@syncfusion/ej2-schedule 31.2.2 → 31.2.10
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/README.md +10 -2
- package/dist/ej2-schedule.min.js +2 -2
- package/dist/ej2-schedule.umd.min.js +2 -2
- package/dist/ej2-schedule.umd.min.js.map +1 -1
- package/dist/es6/ej2-schedule.es2015.js +21 -13
- package/dist/es6/ej2-schedule.es2015.js.map +1 -1
- package/dist/es6/ej2-schedule.es5.js +23 -19
- package/dist/es6/ej2-schedule.es5.js.map +1 -1
- package/dist/global/ej2-schedule.min.js +2 -2
- package/dist/global/ej2-schedule.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +9 -9
- package/src/schedule/event-renderer/vertical-view.js +20 -19
- package/src/schedule/renderer/agenda.js +3 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: ej2-schedule.min.js
|
|
3
|
-
* version : 31.2.
|
|
3
|
+
* version : 31.2.10
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2025. 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
|
-
this.ej=this.ej||{},this.ej.schedule=function(e,t,i,n,r,a,s,o,l,p,c){"use strict";function h(e,i,n){var r=0,a=t.createElement("div",{className:i}).cloneNode();return a.style.visibility="hidden",a.style.position="absolute",e.appendChild(a),r=W(a,n),t.remove(a),r}function d(e,i,n){var r=0,a=t.createElement("div",{className:i}).cloneNode();return a.style.visibility="hidden",a.style.position="absolute",e.appendChild(a),r=B(a,n),t.remove(a),r}function u(e){var t=getComputedStyle(e);return window.WebKitCSSMatrix?new WebKitCSSMatrix(t.webkitTransform).m42:0}function g(e){var t=getComputedStyle(e);return window.WebKitCSSMatrix?new WebKitCSSMatrix(t.webkitTransform).m41:0}function v(e,t){var i=new Date(e.getTime());return t=(t-i.getDay()-7)%7,new Date(i.setDate(i.getDate()+(isNaN(t)?0:t)))}function m(e,t){var i=v(e,t),n=new Date(i.getFullYear(),i.getMonth(),i.getDate()+6);return new Date(n.getTime())}function f(e){return new Date(e.getFullYear(),e.getMonth(),1)}function y(e){return new Date(e.getFullYear(),e.getMonth()+1,0)}function T(e){var t=new Date(e.getFullYear(),0,1).valueOf(),i=(new Date(e.getFullYear(),e.getMonth(),e.getDate()).valueOf()-t+Qe)/Qe;return Math.ceil(i/7)}function w(e,t){return new Date(t.valueOf()-(t.valueOf()-e.valueOf())/2)}function D(e,t){var i=e.getTimezoneOffset(),n=new Date(e.getTime()+t),r=n.getTimezoneOffset()-i;return e.setTime(n.getTime()+r*Ke),e}function b(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function C(e){var t=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0).getTimezoneOffset(),i=e.getTimezoneOffset()-t;return e.getTime()-new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0).getTime()-60*i*1e3}function S(e,t){return Math.ceil((t.getTime()-e.getTime())/Qe)}function O(e,t){return e=new Date(""+e),new Date(e.setDate(e.getDate()+t))}function E(e,t){var i=(e=new Date(""+e)).getDate();return e.setDate(1),e.setMonth(e.getMonth()+t),e.setDate(Math.min(i,A(e))),e}function x(e,t){var i=(e=new Date(""+e)).getDate();return e.setDate(1),e.setFullYear(e.getFullYear()+t),e.setDate(Math.min(i,A(e))),e}function V(e,t,i){var n=new Date(e.getTime());n.setHours(t.getHours()),n.setMinutes(t.getMinutes()),n.setSeconds(t.getSeconds());var r=new Date(e.getTime());return 0===i.getHours()?r=O(r,1):(r.setHours(i.getHours()),r.setMinutes(i.getMinutes()),r.setSeconds(i.getSeconds())),{startHour:n,endHour:r}}function A(e){return y(e).getDate()}function I(e,t){var i=b(new Date(e)),n=b(new Date(t));return Math.round((n.getTime()-i.getTime())/Qe)}function k(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,"/"))}function M(){if(null!==Ze)return Ze;null===Je&&(Je=window.devicePixelRatio||window.screen.availWidth/document.documentElement.clientWidth);var e=t.createElement("div"),i=0;e.style.cssText="width:100px;height: 100px;overflow: scroll;position: absolute;top: -9999px;",document.body.appendChild(e);var n=devicePixelRatio?"1.10"===devicePixelRatio.toFixed(2)||devicePixelRatio<=1?Math.ceil(devicePixelRatio%1):Math.floor(devicePixelRatio%1):0;return i=e.offsetWidth-e.clientWidth-n|0,document.body.removeChild(e),Ze=i}function R(){var e=window.devicePixelRatio||window.screen.availWidth/document.documentElement.clientWidth;Je&&Je!==e&&(Ze=null,Je=e)}function H(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 P(e){var t=getComputedStyle(e);return e.offsetHeight+(parseInt(t.marginTop,10)||0)+(parseInt(t.marginBottom,10)||0)}function j(e){for(var t=0,i=[].slice.call(e.children);t<i.length;t++){var n=i[t];e.removeChild(n)}}function N(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 L(e){var t=e.getFullYear(),i=e.getMonth(),n=e.getDate(),r=e.getHours(),a=e.getMinutes(),s=e.getSeconds(),o=e.getMilliseconds();return Date.UTC(t,i,n,r,a,s,o)}function q(){return window.navigator.userAgent.toLowerCase().indexOf("mobi")>-1}function F(){return window.navigator.userAgent.toLowerCase().indexOf("ipad")>-1}function U(e,i){if("multiple"===i)e=e.split(" ").map(function(e){return e.charAt(0).toLocaleUpperCase()+e.substring(1)}).join(" ");else if("single"===i){if(e[0]>="0"&&e[0]<="9"){var n=e.match(/[a-zA-Z]/);e=t.isNullOrUndefined(n)?e:e.slice(0,n.index)+e[n.index].toLocaleUpperCase()+e.slice(n.index+1)}e=e[0].toLocaleUpperCase()+e.slice(1)}return e}function B(e,t){return t?e.offsetWidth:e.getBoundingClientRect().width}function W(e,t){return t?e.offsetHeight:e.getBoundingClientRect().height}function z(e,t){return t?e.offsetTop:e.getBoundingClientRect().top}function Y(e,i,n,r){void 0===r&&(r="Gregorian");var a,s,o=Ee(e),l=i.getConstant(Vt)+" ",p=r.toLowerCase();if("en"===n||"en-US"===n){var c="months.stand-alone.abbreviated",h="days.stand-alone.abbreviated";s=t.getValue(c,t.getDefaultDateObject(p)),a=t.getValue(h,t.getDefaultDateObject(p))}else{var c="main."+n+".dates.calendars."+p+".months.stand-alone.abbreviated",h="main."+n+".dates.calendars."+p+".days.stand-alone.abbreviated";s=t.getValue(c,t.cldrData),a=t.getValue(h,t.cldrData)}switch(o.interval>1&&(l+=o.interval+" "),o.freq){case"DAILY":l+=i.getConstant(It);break;case"WEEKLY":l+=i.getConstant(kt)+" "+i.getConstant(xt)+" ",o.day.forEach(function(e,i){l+=U(t.getValue(Ht[""+e],a),"single"),l+=o.day.length-1===i?"":", "});break;case"MONTHLY":l+=i.getConstant(Mt)+" "+i.getConstant(xt)+" ",l+=_(o,a,i);break;case"YEARLY":l+=i.getConstant(Rt)+" "+i.getConstant(xt)+" ",l+=U(t.getValue(o.month[0].toString(),s),"single")+" ",l+=_(o,a,i)}if(o.count)l+=", "+o.count+" "+i.getConstant(Et);else if(o.until){var d=o.until;l+=", "+i.getConstant(At)+" "+d.getDate()+" "+U(t.getValue((d.getMonth()+1).toString(),s),"single")+" "+d.getFullYear()}return l}function _(e,i,n){var r="";if(e.monthDay.length)r+=e.monthDay[0];else if(e.day){var a=e.setPosition-1;r+=n.getConstant(Ot[a>-1?a:Ot.length-1])+" "+U(t.getValue(Ht[e.day[0]],i),"single")}return r}function G(e,i,n,r,a,s,o,l){void 0===a&&(a=St),void 0===s&&(s=null),void 0===o&&(o="Gregorian"),void 0===l&&(l=null);var p,c=Ee(i);Be=je(o);var h=[],d=new Date(e.getTime());qe=[];var u=t.isNullOrUndefined(n)?[]:n.split(","),g=new Tt;if(u.forEach(function(e){var t=X(e);l&&(t=g.add(new Date(t.getTime()),l)),qe.push(new Date(t.getTime()).setHours(0,0,0,0))}),c.recExceptionCount=t.isNullOrUndefined(c.count)?0:qe.length,Ue=s&&s>e&&!c.count?new Date(new Date(s.getTime()).setHours(0,0,0)):null,!c.until&&Ue&&((p=new Date(Ue.getTime())).setDate(Ue.getDate()+a*c.interval),c.until=p),c.until&&e>c.until)return h;if(Fe=a,r=r||0,He(Ct[parseInt(r.toString(),10)]),c.until){var v=b(c.until);c.until=new Date(v.getFullYear(),v.getMonth(),v.getDate(),23,59,59)}switch(c.freq){case"DAILY":Z(d,c.until,h,c);break;case"WEEKLY":J(d,c.until,h,c,r);break;case"MONTHLY":$(d,c.until,h,c);break;case"YEARLY":ee(d,c.until,h,c)}return h}function X(e){return new Date(e.substr(0,4)+"-"+e.substr(4,2)+"-"+e.substr(6,5)+":"+e.substr(11,2)+":"+e.substr(13))}function Q(e,t){var i=new Date(t).setHours(0,0,0,0);-1===qe.indexOf(i)&&(!Ue||i>=Ue.getTime())&&e.push(t)}function K(e,t){var i=Fe;return t.count?i=t.count:t.until&&("DAILY"===t.freq||"WEEKLY"===t.freq?i=Math.floor((t.until.getTime()-e.getTime())/Qe)+1:"MONTHLY"!==t.freq&&"YEARLY"!==t.freq||(i=Math.floor((t.until.getMonth()+12*t.until.getFullYear()-(e.getMonth()+12*e.getFullYear()))/t.interval)+(t.day.length>1?Math.floor((t.until.getTime()-e.getTime())/Qe)+1:1),"YEARLY"===t.freq&&(i=t.month.length>1?i*t.month.length:i))),i}function Z(e,t,i,n){for(var r=new Date(e.getTime()),a=n.interval,s=K(e,n),o=n.day;be(r,t)&&(!0,!(Pe(r,n)&&(o.indexOf(Ct[r.getDay()])>-1||0===o.length)&&(Q(i,r.getTime()),s&&i.length+n.recExceptionCount>=s)));)r.setDate(r.getDate()+a),r.getHours()!==e.getHours()&&r.setHours(e.getHours())}function J(e,i,n,r,a){var s=new Date(e.getTime());r.day.length||r.day.push(Ct[e.getDay()]);var o,l=r.interval,p=r.day,c=K(e,r),h=!0,d=[];if(p.length>1)for((t.isNullOrUndefined(r.wkst)||""===r.wkst)&&(r.wkst=bt[0]),o=Ct.indexOf(r.wkst);be(s,i);){var u=Ct.indexOf(Ct[s.getDay()])-o,g=O(O(s,-(u=-1===u?6:u)),6),v=new Date(s.getTime());for(g=b(g),v=b(v);g>=v&&(p.indexOf(Ct[s.getDay()])>-1&&d.push([s.getTime()]),!(c&&n.length+r.recExceptionCount>=c));)s.setDate(s.getDate()+1),s.getHours()!==e.getHours()&&s.setHours(e.getHours()),v=b(v=new Date(s.getTime()));if(s.setDate(s.getDate()-1),c&&n.length+r.recExceptionCount>=c)break;s.setDate(s.getDate()+1+7*(l-1)),ge(d,h,e,i,n,r),d=[]}else{for(s=Oe(e,r.day),l>1&&bt.indexOf(r.day[0])<e.getDay()-a&&s.setDate(s.getDate()+7*(l-1));be(s,i)&&((h=Pe(s,r))&&p.indexOf(Ct[s.getDay()])>-1&&Q(n,s.getTime()),!(c&&n.length+r.recExceptionCount>=c));)s.setDate(s.getDate()+7*l);ge(d,h,e,i,n,r),d=[]}}function $(e,t,i,n){switch(n.month.length||n.day.length||n.monthDay.length?n.month.length>0&&!n.day.length&&!n.monthDay.length&&n.monthDay.push(e.getDate()):(n.monthDay.push(e.getDate()),"YEARLY"===n.freq&&n.month.push(e.getMonth()+1)),Me(n)){case"day":switch(n.freq){case"MONTHLY":ce(e,t,i,n);break;case"YEARLY":he(e,t,i,n)}break;case"both":case"date":switch(n.freq){case"MONTHLY":se(e,t,i,n);break;case"YEARLY":ae(e,t,i,n)}}}function ee(e,t,i,n){switch(ne(n)){case"MONTH":$(e,t,i,n);break;case"WEEKNO":te(e,t,i,n);break;case"YEARDAY":ie(e,t,i,n)}}function te(e,i,n,r){for(var a,s,o,l,p,c=Be.getYearLastDate(e,0),h=K(e,r),d=r.weekNo,u=[],g=r.day;be(c,i);){s=6-bt.indexOf(Ct[c.getDay()])+1;for(var v=0;v<d.length;v++)for(l=1===(o=(o=d[parseInt(v.toString(),10)])>0?o:53+o+1)?s:s+7*(o-1),p=1===o?s-7:s+7*(o-2);p<l;)a=new Date(c.getTime()+Qe*p),(0===g.length||g.indexOf(Ct[a.getDay()])>-1)&&(t.isNullOrUndefined(r.setPosition)?ye(void 0,e,i,n,r,a.getTime()):u.push([a.getTime()])),p++;if(t.isNullOrUndefined(r.setPosition)||De(u,void 0,e,i,n,r),h&&n.length+r.recExceptionCount>=h)return;c=Be.getYearLastDate(a,r.interval),u=[]}}function ie(e,i,n,r){for(var a,s,o=Be.getYearLastDate(e,0),l=K(e,r),p=[],c=r.day;be(o,i);){for(var h=0;h<r.yearDay.length;h++)s=r.yearDay[parseInt(h.toString(),10)],a=new Date(o.getTime()),s!==Be.getLeapYearDaysCount()&&s!==-Be.getLeapYearDaysCount()||Be.isLeapYear(Be.getFullYear(a),1)?(a.setDate(a.getDate()+(s<0?Be.getYearDaysCount(a,1)+1+s:s)),(0===c.length||c.indexOf(Ct[a.getDay()])>-1)&&(null==r.setPosition?ye(void 0,e,i,n,r,a.getTime()):p.push([a.getTime()]))):a.setDate(a.getDate()+1);if(t.isNullOrUndefined(r.setPosition)||De(p,void 0,e,i,n,r),l&&n.length+r.recExceptionCount>=l)return;o=Be.getYearLastDate(a,r.interval),p=[]}}function ne(e){return e.yearDay.length?"YEARDAY":e.weekNo.length?"WEEKNO":"MONTH"}function re(e,t){var i={monthCollection:[],index:0,tempDate:new Date(e.getTime()),mainDate:new Date(e.getTime()),expectedCount:K(e,t),monthInit:0,dateCollection:[]};return t.month.length&&Be.setMonth(i.tempDate,t.month[0],i.tempDate.getDate()),i}function ae(e,t,i,n){if(n.month.length)return void se(e,t,i,n);var r,a=re(e,n);for(a.tempDate=a.mainDate=Be.getMonthStartDate(a.tempDate);be(a.tempDate,t);){for(r=new Date(a.tempDate.getTime());Be.isSameYear(r,a.tempDate)&&a.expectedCount&&i.length+n.recExceptionCount<=a.expectedCount;){if(!(0===n.month.length||n.month.length>0&&!Be.checkMonth(a.tempDate,n.month))){Be.setValidDate(a.tempDate,1,1),a.tempDate=Oe(a.tempDate,n.day);break}oe(n,a,t,!1),a.beginDate=new Date(a.tempDate.getTime()),a.monthInit=le(a.tempDate,n,a.monthInit,a.beginDate)}if(a.tempDate.setFullYear(r.getFullYear(),r.getMonth(),r.getDate()),ge(a.dateCollection,a.state,e,t,i,n),Be.isLastMonth(a.tempDate)&&(Be.setValidDate(a.tempDate,1,1),a.tempDate=Oe(a.tempDate,n.day)),a.expectedCount&&i.length+n.recExceptionCount>=a.expectedCount)return;a.tempDate.setFullYear(a.tempDate.getFullYear()+n.interval-1),a.tempDate=Oe(a.tempDate,n.day),a.monthInit=le(a.tempDate,n,a.monthInit,a.beginDate),a.dateCollection=[]}}function se(e,i,n,r){var a=re(e,r);if(a.tempDate=a.mainDate=Be.getMonthStartDate(a.tempDate),!(("MONTHLY"===r.freq&&12===r.interval||"YEARLY"===r.freq)&&Be.getMonthDaysCount(e)<r.monthDay[0]))for(;be(a.tempDate,i);){if(a.beginDate=new Date(a.tempDate.getTime()),oe(r,a,i,!0,e,n),t.isNullOrUndefined(r.setPosition)||De(a.dateCollection,a.state,e,i,n,r),a.expectedCount&&n.length+r.recExceptionCount>=a.expectedCount)return;a.monthInit=le(a.tempDate,r,a.monthInit,a.beginDate),a.dateCollection=[]}}function oe(e,i,n,r,a,s){for(var o=0;o<e.monthDay.length;o++){i.date=e.monthDay[parseInt(o.toString(),10)],i.tempDate=Be.getMonthStartDate(i.tempDate);var l=Be.getMonthDaysCount(i.tempDate);if(i.date=i.date>0?i.date:l+i.date+1,xe(i.tempDate,i.date,i.mainDate)&&i.date>0){if(Be.setDate(i.tempDate,i.date),n&&i.tempDate>n)return;(0===e.day.length||e.day.indexOf(Ct[i.tempDate.getDay()])>-1)&&(r&&t.isNullOrUndefined(e.setPosition)&&i.expectedCount&&s.length+e.recExceptionCount<i.expectedCount?ye(i.state,a,n,s,e,i.tempDate.getTime()):i.dateCollection.push([i.tempDate.getTime()]))}}}function le(e,i,n,r,a){void 0===r&&(r=null);var s=r?r.getMonth():0,o=Be.getMonthStartDate(e);return a=t.isNullOrUndefined(a)?i.interval:a,e.setFullYear(o.getFullYear()),e.setMonth(o.getMonth()),e.setDate(o.getDate()),i.month.length?(n++,n%=i.month.length,Be.setMonth(e,i.month[parseInt(n.toString(),10)],1),0===n&&Be.addYears(e,a,i.month[0])):(r&&r.getFullYear()<e.getFullYear()&&(s=e.getMonth()-1),Be.setValidDate(e,a,1,s,r)),n}function pe(e,i,n,r){var a=r.day,s=new Date(e.getTime());s=Be.getMonthStartDate(s);var o,l,p=[],c=[],h=[],d=K(e,r),u=0;for(r.month.length&&Be.setMonth(s,r.month[0],1),s=Oe(s,r.day);be(s,i)&&d&&n.length+r.recExceptionCount<d;){var g=new Date(s.getTime());if(a.map(function(e){return Pt.test(e)}).indexOf(!0)>-1){for(var v=0;v<=a.length-1;v++){var m=a[parseInt(v.toString(),10)].match(Nt),f=parseInt(m[0],10);for(s=new Date(s.getTime()),s=Oe(s=Be.getMonthStartDate(s),a),g.setFullYear(s.getFullYear(),s.getMonth(),s.getDate());Be.isSameYear(g,s)&&Be.isSameMonth(g,s);)m[m.length-1]===Ct[g.getDay()]&&p.push([g.getTime()]),g.setDate(g.getDate()+1);if(g.setDate(g.getDate()-1),o=m[0].indexOf("-")>-1?p.length- -1*f:f-1,o=isNaN(o)?0:o,p.length>0&&(t.isNullOrUndefined(r.setPosition)?De(p,void 0,e,i,n,r,o):c=[fe(p,o,h)]),d&&n.length+r.recExceptionCount>=d)return;p=[]}t.isNullOrUndefined(r.setPosition)||(we(c,void 0,e,i,n,r),h=[]),u=le(s,r,u,l),s=Oe(s,r.day),p=[]}else{var y=[],T=Ve(a);g.setFullYear(s.getFullYear(),s.getMonth(),s.getDate());var w=new Date(s.getTime());for(l=new Date(s.getTime());Be.isSameMonth(w,s);)y.push(s.getTime()),a.indexOf(Ct[s.getDay()])>-1&&(p.push(y),y=[]),s.setDate(s.getDate()+T[Ct[s.getDay()]]);if(o=r.setPosition<1?p.length+r.setPosition:r.setPosition-1,t.isNullOrUndefined(r.setPosition)){o=0;for(var D=[],b=0;b<p.length;b++)for(var C=0;C<p[parseInt(b.toString(),10)].length;C++)D.push(p[parseInt(b.toString(),10)][parseInt(C.toString(),10)]);p=[D]}if(p.length>0&&De(p,void 0,e,i,n,r,o),d&&n.length+r.recExceptionCount>=d)return;u=le(s,r,u,l),s=Oe(s,r.day),p=[]}}}function ce(e,t,i,n){if(n.day.length>1)return void pe(e,t,i,n);var r,a=new Date(e.getTime()),s=K(e,n),o=[],l=0;for(a=Be.getMonthStartDate(a),n.month.length&&Be.setMonth(a,n.month[0],1),a=Oe(a,n.day);be(a,t)&&s&&i.length+n.recExceptionCount<s;){r=new Date(a.getTime());for(var p=new Date(a.getTime());Be.isSameMonth(a,p);)o.push([p.getTime()]),p.setDate(p.getDate()+7);me(o,e,t,i,n),l=le(a,n,l,r),a=Oe(a,n.day),o=[]}}function he(e,i,n,r){var a=r.day,s=a.map(function(e){return Pt.test(e)});if(a.length>1&&s.indexOf(!0)>-1)return void de(e,i,n,r);if(r.month.length&&1===a.length&&s.indexOf(!0)>-1)return void ce(e,i,n,r);var o,l=new Date(e.getTime()),p=K(e,r),c=r.interval,h=[];for(r.month.length&&Be.setMonth(l,r.month[0],l.getDate()),t.isNullOrUndefined(r.setPosition)&&0===r.month.length&&0===r.weekNo.length&&l.setFullYear(e.getFullYear(),0,1),l=Oe(l=Be.getMonthStartDate(l),r.day);be(l,i);){for(o=new Date(l.getTime());Be.isSameYear(o,l)&&p&&n.length+r.recExceptionCount<=p;)for(o=new Date(l.getTime());Be.isSameYear(o,l);){if(!(0===r.month.length||r.month.length>0&&!Be.checkMonth(l,r.month))){Be.setValidDate(l,1,1),l=Oe(l,r.day);break}if(a.length>1){if(Be.compareMonth(o,l)){Be.setValidDate(l,1,1),l=Oe(l,r.day);break}a.indexOf(Ct[o.getDay()])>-1&&h.push([o.getTime()]),o.setDate(o.getDate()+1)}else{if(o.getFullYear()>l.getFullYear()){Be.setValidDate(l,1,1),l=Oe(l,r.day);break}var d=Ce(a[0]);Ct[o.getDay()]===d&&new Date(o.getFullYear(),o.getMonth(),0)>new Date(e.getFullYear())&&h.push([o.getTime()]),o.setDate(o.getDate()+7)}}if(l.setFullYear(o.getFullYear(),o.getMonth(),o.getDate()),me(h,e,i,n,r),Be.isLastMonth(l)&&(Be.setValidDate(l,1,1),l=Oe(l,r.day)),l.setFullYear(l.getFullYear()+c-1),p&&n.length+r.recExceptionCount>=p)return;l=Oe(l,r.day),h=[]}}function de(e,i,n,r){var a,s,o,l=r.day,p=K(e,r),c=new Date(e.getTime()),h=r.interval,d=[],u=[],g=0;c=Be.getMonthStartDate(c);var v=[];for(r.month.length&&Be.setMonth(c,r.month[0],1),c=Oe(c,r.day);be(c,i);){s=new Date(c.getTime());for(var m=0;m<=r.month.length;m++)for(var f=0;f<=l.length-1;f++){for(c=Oe(c=Be.getMonthStartDate(c),r.day),d=[];Be.isSameYear(s,c)&&p&&n.length+r.recExceptionCount<=p;)for(;Be.isSameYear(s,c);){if(s=new Date(c.getTime()),0===r.month.length||r.month.length>0&&r.month[parseInt(m.toString(),10)]===Be.getMonth(s)){var y=l[parseInt(f.toString(),10)].match(Nt),T=parseInt(y[0],10);for(o=new Date(c.getTime());Be.isSameYear(o,c)&&Be.isSameMonth(o,c);)y[y.length-1]===Ct[o.getDay()]&&d.push([o.getTime()]),o.setDate(o.getDate()+1);o.setDate(o.getDate()-1),a=y[0].indexOf("-")>-1?d.length- -1*T:T-1,a=isNaN(a)?0:a}g=le(c,r,g,void 0,1),c=Oe(c,r.day)}if(c=0===f&&o?new Date(o.getTime()):new Date(s.getTime()),d.length>0&&(t.isNullOrUndefined(r.setPosition)?De(d,void 0,e,i,n,r,a):u=[fe(d,a,v)]),p&&n.length+r.recExceptionCount>=p)return}t.isNullOrUndefined(r.setPosition)||(we(u,void 0,e,i,n,r),v=[]),Be.isLastMonth(c)?(Be.setValidDate(c,1,1),c.setFullYear(c.getFullYear()+h-1)):c.setFullYear(c.getFullYear()+h),c=Oe(c,r.day),r.month.length&&Be.setMonth(c,r.month[0],c.getDate())}}function ue(e,t){var i,n={monthCollection:[],index:0};if(1===t.length){var r=t[0].match(Nt),a=void 0;r.length>1?i=(a=parseInt(r[0],10))<1?e.length+a:a-1:(i=0,e=ve(e))}else i=0,e=ve(e);return n.monthCollection=e,n.index=i,n}function ge(e,i,n,r,a,s){var o=s.setPosition<1?e.length+s.setPosition:s.setPosition-1;t.isNullOrUndefined(s.setPosition)&&(o=0,e=ve(e)),e.length>0&&De(e,i,n,r,a,s,o)}function ve(e){for(var t=[],i=0;i<e.length;i++)for(var n=0;n<e[parseInt(i.toString(),10)].length;n++)t.push(new Date(e[parseInt(i.toString(),10)][parseInt(n.toString(),10)]).getTime());return e=t.length>0?[t]:[]}function me(e,t,i,n,r){var a=[],s=ue(e,r.day);e=s.monthCollection;var o=s.index;null!=r.setPosition?we([fe(e,o,a)],void 0,t,i,n,r):e.length>0&&De(e,void 0,t,i,n,r,o),a=[]}function fe(e,t,i){for(var n=0;n<e[parseInt(t.toString(),10)].length;n++)i.push(e[parseInt(t.toString(),10)][parseInt(n.toString(),10)]);return i}function ye(e,t,i,n,r,a){var s=K(t,r),o=new Date(a);e=Pe(o,r),o>=t&&be(o,i)&&e&&s&&n.length+r.recExceptionCount<s&&Q(n,a)}function Te(e,t,i,n,r){var a=t||0,s=new Date(e,r.month[0]-1,1),o=new Date(e,r.month[0],0).getDate(),l=(s.getDay()-a+7)%7+o,p=Math.ceil(l/7)-1,c=i[parseInt(n.toString(),10)][parseInt(p.toString(),10)];return Pe(new Date(c),r)?p:p-1}function we(e,t,i,n,r,a){if(e.length>0)for(var s=0;s<e.length;s++){e[parseInt(s.toString(),10)].sort();var o=a.day.map(function(e){return Pt.test(e)}),l="YEARLY"===a.freq&&a.validRules.indexOf("BYMONTH")>-1&&!(o.indexOf(!0)>-1)?Te(new Date(e[0][0]).getFullYear(),0,e,s,a):e[parseInt(s.toString(),10)].length+a.setPosition,p=a.setPosition<1?l:a.setPosition-1;ye(t,i,n,r,a,e[parseInt(s.toString(),10)][parseInt(p.toString(),10)])}}function De(e,i,n,r,a,s,o){if(e.length>0){o=t.isNullOrUndefined(o)?s.setPosition<1?e.length+s.setPosition:s.setPosition-1:o,e[parseInt(o.toString(),10)].sort();for(var l=0;l<e[parseInt(o.toString(),10)].length;l++)ye(i,n,r,a,s,e[parseInt(o.toString(),10)][parseInt(l.toString(),10)])}}function be(e,t){return!t||e<=t}function Ce(e){return e.replace(jt,"")}function Se(e,t){var i=[];return t.forEach(function(e){var t=e.match(Nt);2===t.length?i.push(t[1]):i.push(t[0])}),-1===i.indexOf(Ct[parseInt(e.toString(),10)])}function Oe(e,t){var i,n=new Date(e.getTime());if(t.length>0){for(var r=[],a=0;a<=t.length-1;a++)i=Ce(t[parseInt(a.toString(),10)]),r.push(i);if(-1===r.indexOf(Ct[n.getDay()]))do{n.setDate(n.getDate()+1)}while(-1===r.indexOf(Ct[n.getDay()]))}return n}function Ee(e){var t,i={freq:null,interval:1,count:null,until:null,day:[],wkst:null,month:[],weekNo:[],monthDay:[],yearDay:[],setPosition:null,validRules:[]},n=[];if(e.split(";").forEach(function(e){switch((n=e.split("="))[0]){case"UNTIL":t=n[1],i.until=X(t);break;case"BYDAY":i.day=n[1].split(","),i.validRules.push(n[0]);break;case"BYMONTHDAY":i.monthDay=n[1].split(",").map(Number),i.validRules.push(n[0]);break;case"BYMONTH":i.month=n[1].split(",").map(Number),i.validRules.push(n[0]);break;case"BYYEARDAY":i.yearDay=n[1].split(",").map(Number),i.validRules.push(n[0]);break;case"BYWEEKNO":i.weekNo=n[1].split(",").map(Number),i.validRules.push(n[0]);break;case"INTERVAL":i.interval=parseInt(n[1],10);break;case"COUNT":i.count=parseInt(n[1],10);break;case"BYSETPOS":i.setPosition=parseInt(n[1],10)>4?-1:parseInt(n[1],10);break;case"FREQ":i.freq=n[1];break;case"WKST":i.wkst=n[1]}}),"MONTHLY"===i.freq&&0===i.monthDay.length){var r=i.validRules.indexOf("BYDAY");i.validRules.splice(r,1)}return i}function xe(e,t,i){return t<=Be.getMonthDaysCount(e)&&e>=i}function Ve(e){var t={};return e.forEach(function(i,n){if(n===e.length-1){for(var r=bt.indexOf(i),a=r;a%7!==bt.indexOf(e[0]);)a++;t[""+i]=a-r}else t[""+i]=bt.indexOf(e[n+1])-bt.indexOf(i)}),t}function Ae(e,t){var i,n=t.slice(0),r=Be.getMonthDaysCount(e);for(i=n.shift();i;){if(i<0&&(i=i+r+1),i===e.getDate())return!1;i=n.shift()}return!0}function Ie(e,t){var i,n=t.slice(0),r=ke(e);for(i=n.shift();i;){if(i<0&&(i=i+Be.getYearDaysCount(e,0)+1),i===r)return!1;i=n.shift()}return!0}function ke(e){Dt[Be.getFullYear(e)]||(Dt[Be.getFullYear(e)]=Be.getYearLastDate(e,0));var t=Dt[Be.getFullYear(e)],i=e.getTime()-t.getTime();return Math.ceil(i/Qe)}function Me(e){return e.monthDay.length&&!e.day.length?"date":!e.monthDay.length&&e.day.length?"day":"both"}function Re(e){var t=e.shift();e.push(t)}function He(e){for(;bt[0]!==e;)Re(bt)}function Pe(e,t){var i=!0,n=t.day,r=t.month,a=Be.getExpectedDays(e,t.monthDay),s=t.yearDay;return t.validRules.forEach(function(t){switch(t){case"BYDAY":Se(e.getDay(),n)&&(i=!1);break;case"BYMONTH":Be.checkMonth(e,r)&&(i=!1);break;case"BYMONTHDAY":Ae(e,a)&&(i=!1);break;case"BYYEARDAY":Ie(e,s)&&(i=!1)}}),i}function je(e){return"Islamic"===e?new yt:new ft}function Ne(e){return[e.getUTCFullYear(),Le(e.getUTCMonth()+1),Le(e.getUTCDate()),"T",Le(e.getUTCHours()),Le(e.getUTCMinutes()),Le(e.getUTCSeconds()),"Z"].join("")}function Le(e){return("0"+e).slice(-2)}var qe,Fe,Ue,Be,We="actionBegin",ze="renderCell",Ye="inlineClick",_e="data-ready",Ge="content-ready",Xe="scroll-ui-update",Qe=864e5,Ke=6e4,Ze=null,Je=null,$e="e-schedule",et="e-icons",tt="e-table-container",it="e-schedule-table",nt="e-content-table",rt="e-popup-open",at="e-appointment-container",st="e-text-ellipsis",ot="e-schedule-form",lt="e-schedule-event-tooltip",pt="e-disable-dates",ct=function(){return(ct=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++){t=arguments[i];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)},ht=function(){function e(e){this.parent=e,this.l10n=this.parent.localeObj,this.renderHeader(),this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on("document-click",this.closeHeaderPopup,this)},e.prototype.removeEventListener=function(){this.parent.off("document-click",this.closeHeaderPopup)},e.prototype.closeHeaderPopup=function(e){var i=t.closest(e.event.target,".e-date-range,.e-header-popup,.e-day,.e-selected"),n=t.closest(e.event.target,".e-hor-nav,.e-toolbar-pop"),r=this.parent.element.querySelector(".e-content-wrap"),a=this.parent.element.querySelector(".e-toolbar-pop");if(this.parent.isAdaptive)if(t.isNullOrUndefined(n)||!n.classList.contains("e-toolbar-pop")&&!n.classList.contains("e-hor-nav")||n.classList.contains("e-hor-nav")&&a&&a.classList.contains(rt)){t.removeClass([r],"e-scroll-hidden");var s=this.element.querySelector(".e-toolbar-pop");if(!t.isNullOrUndefined(s)){var o=s.ej2_instances[0];!o||!t.isNullOrUndefined(n)&&n.classList.contains("e-hor-nav")&&s.classList.contains(rt)||o.hide()}}else t.addClass([r],"e-scroll-hidden");t.isNullOrUndefined(i)&&this.hideHeaderPopup()},e.prototype.hideHeaderPopup=function(){this.headerPopup&&this.headerPopup.hide()},e.prototype.renderHeader=function(){this.element=t.createElement("div",{className:"e-schedule-toolbar-container"});var e=t.createElement("div",{className:"e-schedule-toolbar"});this.element.appendChild(e),this.parent.element.insertBefore(this.element,this.parent.element.firstElementChild),this.renderToolbar()},e.prototype.renderToolbar=function(){var e=this,t=this.parent.toolbarItems&&this.parent.toolbarItems.length>0?this.getToolbarItems():this.getItems();this.parent.trigger(We,{requestType:"toolbarItemRendering",items:t},function(t){e.toolbarObj=new n.Toolbar({items:t.items,overflowMode:"Popup",clicked:e.toolbarClickHandler.bind(e),created:e.toolbarCreateHandler.bind(e),enableRtl:e.parent.enableRtl,enableHtmlSanitizer:e.parent.enableHtmlSanitizer,locale:e.parent.locale}),e.toolbarObj.isStringTemplate=!0,e.toolbarObj.root=e.parent.root?e.parent.root:e.parent,e.toolbarObj.appendTo(e.parent.element.querySelector(".e-schedule-toolbar")),e.toolbarObj.element.setAttribute("aria-label","Scheduler");var i=e.toolbarObj.element.querySelector(".e-prev");i&&i.firstElementChild.setAttribute("title",e.l10n.getConstant("previous"));var r=e.toolbarObj.element.querySelector(".e-next");r&&r.firstElementChild.setAttribute("title",e.l10n.getConstant("next")),e.updateAddIcon(),e.updateActiveView(),e.parent.trigger("actionComplete",{requestType:"toolBarItemRendered",items:e.toolbarObj.items})})},e.prototype.updateItems=function(){var e=this;if(this.toolbarObj){var t=this.getItems();this.parent.trigger(We,{requestType:"toolbarItemRendering",items:t},function(t){e.toolbarObj.items=t.items,e.toolbarObj.dataBind(),e.parent.trigger("actionComplete",{requestType:"toolBarItemRendered",items:e.toolbarObj.items})})}},e.prototype.getPopUpRelativeElement=function(){return this.parent.isAdaptive?this.toolbarObj.element:this.element.querySelector(".e-date-range")},e.prototype.setDayOfWeek=function(e){this.headerCalendar&&(this.headerCalendar.firstDayOfWeek=e,this.headerCalendar.dataBind())},e.prototype.setCalendarDate=function(e){this.headerCalendar&&(this.headerCalendar.value=e,this.headerCalendar.dataBind())},e.prototype.setCalendarMinMaxDate=function(){this.headerCalendar&&(this.headerCalendar.min=this.parent.minDate,this.headerCalendar.max=this.parent.maxDate,this.headerCalendar.dataBind())},e.prototype.getCalendarView=function(){return["Month","MonthAgenda","TimelineMonth"].indexOf(this.parent.currentView)>-1?"Year":["Year","TimelineYear"].indexOf(this.parent.currentView)>-1?"Decade":"Month"},e.prototype.setCalendarView=function(){if(this.headerCalendar){var e=this.getCalendarView();this.headerCalendar.depth=e,this.headerCalendar.start=e,this.headerCalendar.refresh()}},e.prototype.updateActiveView=function(){var e=[].slice.call(this.toolbarObj.element.querySelectorAll(".e-views"));t.removeClass(e,["e-active-view"]),e.length>0&&e[this.parent.viewIndex]&&t.addClass([e[this.parent.viewIndex]],["e-active-view"])},e.prototype.updateDateRange=function(e){var i=this.toolbarObj.element.querySelector(".e-date-range");if(i){i.firstElementChild.setAttribute("aria-haspopup","true");var n=i.querySelector(".e-tbar-btn-text");if(this.parent.activeViewOptions.dateRangeTemplate){n.textContent="";var r={startDate:this.parent.activeView.getStartDate(),endDate:this.parent.activeView.getEndDate(),currentView:this.parent.currentView},a=this.parent.activeViewOptions.dateRangeTemplateName,s=this.parent.element.id+"_"+a+"dateRangeTemplate",o=[].slice.call(this.parent.getDateRangeTemplate()(r,this.parent,"dateRangeTemplate",s,!1,void 0,void 0,this.parent.root));t.append(o,n)}else{var l=this.parent.activeView.getDateRangeText(e);i.firstElementChild.setAttribute("aria-label",l),n.textContent=l}this.refresh()}},e.prototype.refresh=function(){this.toolbarObj&&this.toolbarObj.refreshOverflow()},e.prototype.updateAddIcon=function(){var e=this.toolbarObj.element.querySelector(".e-add");e&&(this.parent.eventSettings.allowAdding?t.removeClass([e],"e-hidden"):t.addClass([e],"e-hidden"))},e.prototype.getDateRangeText=function(){return U(this.parent.globalize.formatDate(this.parent.selectedDate,{format:"MMMM y",calendar:this.parent.getCalendarMode()}),"single")},e.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},e.prototype.getToolbarItems=function(){for(var e,i=[],n=0,r=this.parent.toolbarItems;n<r.length;n++){var a=r[n];e=this.getItemModel(a);var s=void 0;if(a.name)switch(a.name){case"Today":(s={showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-today",text:this.l10n.getConstant("today"),cssClass:"e-today",overflow:"Show"}).align=e.align?e.align:a.align,i.push(ct({},s,e));break;case"Previous":(s={prefixIcon:"e-icon-prev",tooltipText:"Previous",overflow:"Show",cssClass:"e-prev",htmlAttributes:{role:"navigation"}}).align=e.align?e.align:a.align,i.push(ct({},s,e));break;case"Next":(s={prefixIcon:"e-icon-next",tooltipText:"Next",overflow:"Show",cssClass:"e-next",htmlAttributes:{role:"navigation"}}).align=e.align?e.align:a.align,i.push(ct({},s,e));break;case"DateRangeText":(s={text:this.getDateRangeText(),suffixIcon:"e-icon-down-arrow",cssClass:"e-date-range",overflow:"Show",htmlAttributes:{"aria-atomic":"true","aria-live":"assertive",role:"navigation"}}).align=e.align?e.align:a.align,i.push(ct({},s,e));break;case"NewEvent":(s={showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-add",text:this.l10n.getConstant("newEvent"),cssClass:"e-add",overflow:"Show"}).align=e.align?e.align:a.align,i.push(ct({},s,e));break;case"Views":if(!t.isNullOrUndefined(this.parent.views)&&this.parent.views.length>1)for(var o=0,l=this.parent.views;o<l.length;o++){var p=l[o];(s=this.getItemObject(p)).align=e.align?e.align:a.align,i.push(ct({},s,e))}break;case"Custom":i.push(a)}else i.push(a)}return i},e.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"}),!t.isNullOrUndefined(this.parent.views)&&this.parent.views.length>1&&e.push({align:"Right",type:"Separator",cssClass:"e-schedule-seperator"})),!t.isNullOrUndefined(this.parent.views)&&this.parent.views.length>1)for(var i=0,n=this.parent.views;i<n.length;i++){var r=n[i];e.push(this.getItemObject(r))}return e},e.prototype.getItemObject=function(e){var t,i;"string"==typeof e?(t=e.toLowerCase(),i=null):(t=e.option.toLowerCase(),i=e.displayName);var n,r=this.parent.isAdaptive||this.parent.enableAdaptiveUI;switch(t){case"day":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-day",text:i||this.l10n.getConstant("day"),cssClass:"e-views e-day"};break;case"week":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-week",text:i||this.l10n.getConstant("week"),cssClass:"e-views e-week"};break;case"workweek":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-workweek",text:i||this.l10n.getConstant("workWeek"),cssClass:"e-views e-work-week"};break;case"month":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-month",text:i||this.l10n.getConstant("month"),cssClass:"e-views e-month"};break;case"year":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-year",text:i||this.l10n.getConstant("year"),cssClass:"e-views e-year"};break;case"agenda":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-agenda",text:i||this.l10n.getConstant("agenda"),cssClass:"e-views e-agenda"};break;case"monthagenda":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-month-agenda",text:i||this.l10n.getConstant("monthAgenda"),cssClass:"e-views e-month-agenda"};break;case"timelineday":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-day",text:i||this.l10n.getConstant("timelineDay"),cssClass:"e-views e-timeline-day"};break;case"timelineweek":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-week",text:i||this.l10n.getConstant("timelineWeek"),cssClass:"e-views e-timeline-week"};break;case"timelineworkweek":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-workweek",text:i||this.l10n.getConstant("timelineWorkWeek"),cssClass:"e-views e-timeline-work-week"};break;case"timelinemonth":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-month",text:i||this.l10n.getConstant("timelineMonth"),cssClass:"e-views e-timeline-month"};break;case"timelineyear":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-year-"+("Vertical"===e.orientation?"vertical":"horizontal"),text:i||this.l10n.getConstant("timelineYear"),cssClass:"e-views e-timeline-year"}}return n},e.prototype.renderHeaderPopup=function(){var e=t.createElement("div",{className:"e-header-popup"}),n=t.createElement("div",{className:"e-header-calendar"});e.appendChild(n),this.element.appendChild(e),this.headerPopup=new i.Popup(e,{actionOnScroll:"hide",targetType:"relative",relateTo:this.getPopUpRelativeElement(),position:{X:"left",Y:"bottom"},collision:{X:"fit"},viewPortElement:this.element,enableRtl:this.parent.enableRtl});var a=this.getCalendarView(),s="Month"===this.parent.currentView&&!t.isNullOrUndefined(this.parent.activeViewOptions.displayDate)&&!this.hasSelectedDate();this.headerCalendar=new r.Calendar({value:s?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:a,start:a,calendarMode:this.parent.calendarMode,change:this.calendarChange.bind(this)}),this.setCalendarTimezone(),this.headerCalendar.appendTo(n),this.headerPopup.hide()},e.prototype.calendarChange=function(e){if(e.value.getTime()!==this.parent.selectedDate.getTime()){var t=b(new Date(e.value));this.parent.changeDate(t)}this.headerPopup.hide()},e.prototype.setCalendarTimezone=function(){this.headerCalendar&&(this.headerCalendar.timezone=this.parent.timezone||this.parent.tzModule.getLocalTimezoneName())},e.prototype.calculateViewIndex=function(e){var i=t.closest(e.originalEvent.target,".e-views");return[].slice.call(this.element.querySelectorAll(".e-views")).indexOf(i)},e.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())},e.prototype.toolbarClickHandler=function(e){if(e.item){var i,n,r;switch(e.item.cssClass.replace("e-views ","")){case"e-date-range":this.headerPopup||this.renderHeaderPopup(),this.headerPopup.element.classList.contains(rt)?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=b(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()&&b(this.parent.activeViewOptions.displayDate)!==r||"Month"===this.parent.currentView&&this.parent.activeViewOptions.numberOfWeeks>0&&!this.hasSelectedDate()&&b(f(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":if(n=this.parent.activeCellsData.startTime.getTime()===this.parent.activeCellsData.endTime.getTime(),this.parent.activeCellsData&&!n)i=this.parent.activeCellsData;else{var a=this.parent.activeViewOptions.timeScale.interval,s=this.parent.activeViewOptions.timeScale.slotCount,o=a*Ke/s,l=new Date(this.parent.selectedDate.getTime()),p=this.parent.getCurrentTime();l.setHours(p.getHours(),Math.round(l.getMinutes()/o)*o,0),i={startTime:l,endTime:new Date(new Date(l.getTime()).setMilliseconds(l.getMilliseconds()+o)),isAllDay:!1}}this.parent.eventWindow.openEditor(t.extend(i,{cancel:!1,event:e.originalEvent}),"Add")}if(!t.isNullOrUndefined(this.toolbarObj)){var c=this.toolbarObj.element.querySelector(".e-toolbar-pop");c&&"Input"!==e.item.type&&c.ej2_instances[0].hide({name:"SlideUp",duration:100})}}},e.prototype.hasSelectedDate=function(){var e=b(this.parent.selectedDate).getTime();return e>=this.parent.activeView.getStartDate().getTime()&&e<=this.parent.activeView.getEndDate().getTime()},e.prototype.getHeaderElement=function(){return this.toolbarObj.element},e.prototype.updateHeaderItems=function(e){var i=this.toolbarObj.element.querySelector(".e-prev"),n=this.toolbarObj.element.querySelector(".e-next"),r=this.toolbarObj.element.querySelector(".e-date-range");i&&("add"===e?t.addClass([i],"e-hidden"):t.removeClass([i],"e-hidden")),n&&("add"===e?t.addClass([n],"e-hidden"):t.removeClass([n],"e-hidden")),r&&("add"===e?t.addClass([r],st):t.removeClass([r],st))},e.prototype.previousNextIconHandler=function(){var e="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(e[0].getTime()),a=new Date(e[e.length-1].getTime());if("WorkWeek"===this.parent.currentView||"TimelineWorkWeek"===this.parent.currentView)a=O(r=v(b(this.parent.selectedDate),this.parent.activeViewOptions.firstDayOfWeek),7*this.parent.activeViewOptions.interval);else if("Month"===this.parent.currentView){var s=!t.isNullOrUndefined(this.parent.activeViewOptions.displayDate)||this.parent.activeViewOptions.numberOfWeeks>0;r=s?this.parent.activeView.getStartDate():f(this.parent.selectedDate),a=s?this.parent.activeView.getEndDate():y(E(r,this.parent.activeViewOptions.interval-1))}t.isNullOrUndefined(i)||this.toolbarObj.enableItems(i,r>b(this.parent.minDate)),t.isNullOrUndefined(n)||this.toolbarObj.enableItems(n,a<b(this.parent.maxDate)),this.setCalendarMinMaxDate()},e.prototype.getModuleName=function(){return"headerbar"},e.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(),t.remove(this.element),this.toolbarObj=null),this.element=null,this.parent=null,this.l10n=null},e}(),dt=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.getModuleName=function(){return"scroll"},e.prototype.setWidth=function(){this.parent.element.style.width=t.formatUnit(this.parent.width)},e.prototype.setHeight=function(){this.parent.element.style.height=t.formatUnit(this.parent.height)},e.prototype.addEventListener=function(){this.parent.on(Ge,this.setDimensions,this),this.parent.on("ui-update",this.onPropertyChanged,this)},e.prototype.removeEventListener=function(){this.parent.off(Ge,this.setDimensions),this.parent.off("ui-update",this.onPropertyChanged)},e.prototype.setDimensions=function(){this.setWidth(),this.setHeight();var e={cssProperties:this.parent.getCssProperties(),module:this.getModuleName()};this.parent.notify(Xe,e)},e.prototype.onPropertyChanged=function(){this.setDimensions()},e.prototype.destroy=function(){this.removeEventListener()},e}(),ut=function(){function e(e){this.parent=e,this.element=this.parent.element.querySelector("."+tt),this.touchObj=new t.Touch(this.element,{scroll:this.scrollHandler.bind(this),swipe:this.swipeHandler.bind(this),tapHold:this.tapHoldHandler.bind(this),swipeSettings:{swipeThresholdDistance:1}}),t.EventHandler.add(this.element,"transitionend",this.onTransitionEnd,this),this.touchLeftDirection=this.parent.enableRtl?"Right":"Left",this.touchRightDirection=this.parent.enableRtl?"Left":"Right"}return e.prototype.scrollHandler=function(e){t.isNullOrUndefined(this.parent.eventTooltip)||this.parent.eventTooltip.close();var i=!this.parent.isAdaptive&&e.originalEvent&&e.originalEvent.target&&!t.isNullOrUndefined(t.closest(e.originalEvent.target,".e-appointment"));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("e-translate")&&this.onTransitionEnd(),"Left"===e.scrollDirection||"Right"===e.scrollDirection){var n={requestType:"dateNavigate",cancel:!1,event:e.originalEvent};if(this.parent.trigger(We,n),n.cancel)return;var r=this.element.querySelector(".e-content-wrap");if(r&&r.scrollWidth>r.clientWidth)return;this.isScrollTriggered=!0,e.originalEvent.preventDefault(),e.originalEvent.stopPropagation()}if(e.scrollDirection===this.touchLeftDirection){this.nextPanel||(this.renderPanel("e-next-panel","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));s=this.parent.enableRtl?e.distanceX:-e.distanceX;this.element.style.transform="translatex("+(this.getTranslateX(this.element)+s)+"px)"}else if(e.scrollDirection===this.touchRightDirection){var a=0;this.previousPanel||(this.renderPanel("e-previous-panel","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),a=this.previousPanel.element.offsetWidth);var s=this.parent.enableRtl?a-e.distanceX:-a+e.distanceX;this.element.style.transform="translatex("+(this.getTranslateX(this.element)+s)+"px)"}}},e.prototype.swipeHandler=function(e){if(this.isScrollTriggered&&!this.parent.uiStateValues.action&&this.parent.allowSwiping&&!this.parent.uiStateValues.isTapHold){this.isScrollTriggered=!1;var i="Left"===e.swipeDirection?this.parent.activeView.renderDates[0]:this.parent.activeView.renderDates.slice(-1)[0];if("Left"===e.swipeDirection&&i<this.parent.maxDate||"Right"===e.swipeDirection&&i>=this.parent.minDate){var n=Date.now()-this.timeStampStart,r=e.distanceX*(t.Browser.isDevice?6:1.66);r>n||e.distanceX>this.parent.element.offsetWidth/2?(this.swapPanels(e.swipeDirection),r>n&&e.distanceX>this.parent.element.offsetWidth/2&&(this.element.style.transitionDuration=(t.Browser.isDevice?e.distanceX:r)/n/10+"s"),this.confirmSwipe(e.swipeDirection)):this.cancelSwipe();var a={requestType:"dateNavigate",cancel:!1,event:e.originalEvent};this.parent.trigger("actionComplete",a)}else this.cancelSwipe();this.timeStampStart=null}},e.prototype.tapHoldHandler=function(e){var i=t.closest(e.originalEvent.target,".e-appointment");t.isNullOrUndefined(i)||(this.parent.uiStateValues.isTapHold=!0,this.parent.isAdaptive?(t.Browser.isIos&&t.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(i),this.triggerResizeStart(e.originalEvent)))},e.prototype.triggerResizeStart=function(e){this.parent.resizeModule&&t.closest(e.target,".e-event-resize")&&this.parent.resizeModule.resizeStart(e)},e.prototype.preventEventClick=function(e){e.preventDefault(),t.EventHandler.remove(this.element,"touchend",this.preventEventClick)},e.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)},e.prototype.swapPanels=function(e){if(e===this.touchLeftDirection){t=this.nextPanel;this.nextPanel=this.currentPanel,this.currentPanel=t}else{var t=this.previousPanel;this.previousPanel=this.currentPanel,this.currentPanel=t}},e.prototype.confirmSwipe=function(e){var i=this,n={action:"date",cancel:!1,previousDate:e===this.touchLeftDirection?this.nextPanel.selectedDate:this.previousPanel.selectedDate,currentDate:this.currentPanel.selectedDate};this.parent.trigger("navigating",n,function(n){if(n.cancel)i.swapPanels(e),i.cancelSwipe();else{i.parent.activeView.setPanel(i.currentPanel.element),i.parent.setProperties({selectedDate:i.currentPanel.selectedDate},!0);var r=void 0;r=i.parent.enableRtl?e===i.touchLeftDirection?i.previousPanel?i.previousPanel.element.offsetLeft:i.currentPanel.element.offsetWidth:0:e===i.touchLeftDirection?-i.currentPanel.element.offsetLeft:0,i.parent.activeView.renderDates=i.currentPanel.renderDates,i.parent.activeView.colLevels=i.currentPanel.colLevels,t.addClass([i.element],"e-translate"),i.element.style.transform="translatex("+r+"px)",i.parent.headerModule&&i.parent.headerModule.updateDateRange(),i.parent.renderTemplates(),i.parent.crudModule.refreshDataManager()}})},e.prototype.cancelSwipe=function(){var e=this;if(this.parent.activeView.setPanel(this.currentPanel.element),this.parent.setProperties({selectedDate:this.currentPanel.selectedDate},!0),this.parent.activeView.renderDates=this.currentPanel.renderDates,this.parent.activeViewOptions.group.resources.length>0&&this.parent.resourceBase.lastResourceLevel.length>0){var i=this.parent.resourceBase.resourceCollection[0].workDaysField;this.parent.resourceBase.lastResourceLevel.forEach(function(t){if(i){var n=t[i],r=Array.isArray(n)&&(!e.parent.showWeekend||"WorkWeek"===e.parent.currentView);t.renderDates=r?e.calculateResourceSpecificDates(t,i):e.currentPanel.renderDates}else t.renderDates=e.currentPanel.renderDates})}this.parent.activeView.colLevels=this.currentPanel.colLevels,t.addClass([this.element],"e-translate");var n=this.previousPanel?this.previousPanel.element.offsetWidth:0;this.element.style.transform="translatex("+(this.parent.enableRtl?n:-this.currentPanel.element.offsetLeft)+"px)"},e.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},e.prototype.onTransitionEnd=function(){(t.isNullOrUndefined(this.element)||this.element.classList.contains("e-translate"))&&(this.parent.uiStateValues.isSwipeScroll=!1,t.removeClass([this.element],"e-translate"),this.element.style.transitionDuration="",this.element.style.transform="",this.previousPanel&&(t.remove(this.previousPanel.element),this.previousPanel=null,t.removeClass([this.currentPanel.element],"e-previous-panel"),t.addClass([this.currentPanel.element],"e-current-panel")),this.nextPanel&&(t.remove(this.nextPanel.element),this.nextPanel=null,t.removeClass([this.currentPanel.element],"e-next-panel"),t.addClass([this.currentPanel.element],"e-current-panel")),this.currentPanel=null,this.parent.activeView.getPanel().style.width="")},e.prototype.getTranslateX=function(e){var t=window.getComputedStyle(e);return new WebKitCSSMatrix(t.webkitTransform).m41},e.prototype.setDimensions=function(e){e.style.width=this.parent.element.clientWidth+"px"},e.prototype.resetValues=function(){this.currentPanel=null,this.previousPanel=null,this.nextPanel=null,this.timeStampStart=null,this.element.style.transform="",this.element.style.transitionDuration="",j(this.element),t.removeClass([this.element],"e-translate")},e.prototype.destroy=function(){this.touchObj&&(this.touchObj.destroy(),this.touchObj=null),t.EventHandler.remove(this.element,"transitionend",this.onTransitionEnd),this.resetValues()},e}(),gt=function(){return(gt=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++){t=arguments[i];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)},vt=function(){function e(e){this.selectedCells=[],this.isCutContentPasted=!1,this.isCutAction=!1,this.keyConfigs={downArrow:"downarrow",upArrow:"uparrow",rightArrow:"rightarrow",leftArrow:"leftarrow",shiftDownArrow:"shift+downarrow",shiftUpArrow:"shift+uparrow",shiftRightArrow:"shift+rightarrow",shiftLeftArrow:"shift+leftarrow",ctrlLeftArrow:"ctrl+leftarrow",ctrlRightArrow:"ctrl+rightarrow",altOne:"alt+1",altTwo:"alt+2",altThree:"alt+3",altFour:"alt+4",altFive:"alt+5",altSix:"alt+6",altSeven:"alt+7",altEight:"alt+8",altNine:"alt+9",enter:"enter",escape:"escape",delete:"delete",backspace:"backspace",home:"home",pageUp:"pageup",pageDown:"pagedown",tab:"tab",shiftTab:"shift+tab",ctrlShiftUpArrow:"ctrl+shift+uparrow",ctrlShiftDownArrow:"ctrl+shift+downarrow",ctrlShiftLeftArrow:"ctrl+shift+leftarrow",ctrlShiftRightArrow:"ctrl+shift+rightarrow",shiftAltY:"shift+alt+y",shiftAltN:"shift+alt+n",cut:"ctrl+x",copy:"ctrl+c",cmdCut:"cmd+x",cmdCopy:"cmd+c"},this.parent=e,this.parent.element.tabIndex=-1===this.parent.element.tabIndex?0:this.parent.element.tabIndex,this.keyboardModule=new t.KeyboardEvents(this.parent.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.addEventListener(),this.createClipboardElement()}return e.prototype.keyActionHandler=function(e){var t=e.target;if(!("home"===e.action&&t&&["INPUT","TEXTAREA","SELECT"].indexOf(t.tagName)>-1&&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":if("Agenda"===this.parent.currentView||"MonthAgenda"===this.parent.currentView||"Year"===this.parent.currentView)return;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)}},e.prototype.processShiftAltN=function(e){var i=this.parent.getSelectedCells(),n=e.target,r=t.extend({},null,!0);if(i.length>0&&(t.closest(n,".e-work-cells")||t.closest(n,".e-all-day-cells")||t.closest(n,".e-header-cells")))r=this.getSelectedElements(n);else if(t.closest(n,".e-appointment")&&!t.isNullOrUndefined(this.parent.activeEventData.event)){var a=this.parent.activeEventData.event;r.startTime=a.StartTime,r.endTime=a.EndTime,r.isAllDay=a.IsAllDay}else{var s=this.parent.getStartEndTime(this.parent.workHours.start),o=this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount;r.startTime=new Date(this.parent.selectedDate),r.startTime.setHours(s.getHours(),s.getMinutes(),0,0),r.endTime=new Date(r.startTime.getTime()+6e4*o)}var l=t.extend(r,{cancel:!1,event:e});null!=l&&this.parent.eventWindow.openEditor(l,"Add")},e.prototype.processFTwelve=function(e){var i=e.target;if(i.classList.contains("e-work-cells")||i.classList.contains("e-all-day-cells")){this.parent.activeCellsData=this.getSelectedElements(i);var n=t.extend(this.parent.activeCellsData,{cancel:!1,event:e}),r={element:n.element,groupIndex:n.groupIndex,type:"Cell"};this.parent.notify(Ye,r)}if(i.classList.contains("e-appointment"))return void i.click()},e.prototype.addEventListener=function(){this.parent.on("cell-mouse-down",this.onCellMouseDown,this),this.parent.allowClipboard&&this.parent.on("document-paste",this.pasteHandler,this)},e.prototype.removeEventListener=function(){this.parent.off("cell-mouse-down",this.onCellMouseDown),this.parent.off("document-paste",this.pasteHandler)},e.prototype.onCellMouseDown=function(e){if(!e.event.shiftKey&&(this.initialTarget=this.getClosestCell(e.event),!this.parent.activeViewOptions.readonly&&"MonthAgenda"!==this.parent.currentView&&this.initialTarget&&(e.event.target.classList.contains("e-work-cells")&&3!==e.event.which&&(this.parent.removeSelectedClass(),t.EventHandler.add(this.parent.getContentTable(),"mousemove",this.onMouseSelection,this),t.EventHandler.add(this.parent.getContentTable(),"mouseup mouseleave",this.onMoveUp,this)),e.event.target.classList.contains("e-all-day-cells")&&3!==e.event.which))){this.parent.removeSelectedClass();var i=this.parent.getAllDayRow();t.EventHandler.add(i,"mousemove",this.onMouseSelection,this),t.EventHandler.add(i,"mouseup mouseleave",this.onMoveUp,this)}},e.prototype.onMouseSelection=function(e){var i=[].slice.call(this.parent.element.querySelectorAll(".e-appointment"));t.addClass(i,"e-allow-select");var n=this.parent.boundaryValidation(e.pageY,e.pageX);if(n.bottom||n.top||n.left||n.right){var r=this.parent.element.querySelector(".e-content-wrap"),a=r.offsetHeight<=r.scrollHeight&&r.scrollTop>=0&&r.scrollTop+r.offsetHeight<=r.scrollHeight,s=r.offsetWidth<=r.scrollWidth&&r.scrollLeft>=0&&r.scrollLeft+r.offsetWidth<=r.scrollWidth;a&&(n.top||n.bottom)&&(r.scrollTop+=n.top?-e.target.offsetHeight:e.target.offsetHeight),s&&(n.left||n.right)&&(r.scrollLeft+=n.left?-e.target.offsetWidth:e.target.offsetWidth)}var o=this.getClosestCell(e);o&&this.selectCells(!0,o)},e.prototype.getClosestCell=function(e){return t.closest(e.target,".e-work-cells,.e-all-day-cells")},e.prototype.onMoveUp=function(e){var i=this,n=[].slice.call(this.parent.element.querySelectorAll(".e-appointment"));if(t.removeClass(n,"e-allow-select"),t.EventHandler.remove(this.parent.getContentTable(),"mousemove",this.onMouseSelection),t.EventHandler.remove(this.parent.getContentTable(),"mouseup mouseleave",this.onMoveUp),e.target.classList.contains("e-all-day-cells")){var r=this.parent.getAllDayRow();t.EventHandler.remove(r,"mousemove",this.onMouseSelection),t.EventHandler.remove(r,"mouseup mouseleave",this.onMoveUp)}if(!this.isPreventAction(e)){var a=t.closest(e.target,".e-work-cells,.e-all-day-cells,.e-header-cells");if(a){var s=this.parent.getSelectedCells();if(s.length>0&&-1===s.indexOf(a)&&(a=s[s.length-1]),"TimelineYear"!==this.parent.currentView||!a.classList.contains("e-other-month")){this.parent.activeCellsData=this.getSelectedElements(a);var o={};this.parent.eventWindow&&this.parent.eventWindow.convertToEventData(this.parent.activeCellsData,o);var l={data:o,element:this.parent.activeCellsData.element,event:e,requestType:"cellSelect",showQuickPopup:!1};this.parent.trigger("select",l,function(n){if((n.showQuickPopup||i.parent.quickInfoOnSelectionEnd)&&s.length>1){var r=t.extend(i.parent.activeCellsData,{cancel:!1,event:e,name:"cellClick"});i.parent.notify("cellClick",r)}})}}}},e.prototype.processEnter=function(e){if(!(this.parent.activeViewOptions.readonly&&!e.target.classList.contains("e-appointment")||this.isPreventAction(e)||"TimelineYear"===this.parent.currentView&&e.target.classList.contains("e-other-month"))){var i=e.target;if(t.closest(i,".e-quick-popup-wrapper"))return void(i.classList.contains("e-event-details")||i.classList.contains("e-event-create")||i.classList.contains("e-event-edit")||i.classList.contains("e-event-delete")||i.classList.contains("e-close")?(i.click(),e.preventDefault()):i.classList.contains("e-subject")&&(this.parent.element.querySelector(".e-event-create").click(),e.preventDefault()));if(i.classList.contains("e-resource-cells")&&i.classList.contains("e-parent-node")){var n=i.querySelector(".e-resource-tree-icon");return void(n&&n.click())}if(!i.classList.contains("e-work-cells")&&!i.classList.contains("e-all-day-cells"))return i.classList.contains("e-inline-subject")&&this.parent.inlineModule?void this.parent.inlineModule.inlineCrudActions(i):i.classList.contains("e-appointment")||i.classList.contains("e-more-event-close")||i.classList.contains("e-all-day-appointment-section")||i.classList.contains("e-more-indicator")?void i.click():i.classList.contains("e-header-date")?(this.parent.setProperties({selectedDate:this.parent.getDateFromElement(i)},!0),this.parent.changeView(this.parent.getNavigateView(),e),void this.processEscape(e)):void 0;this.parent.activeCellsData=this.getSelectedElements(i);var r=t.extend(this.parent.activeCellsData,{cancel:!1,event:e});if(this.parent.allowInline){var a={element:r.element,groupIndex:r.groupIndex,type:"Cell"};this.parent.notify(Ye,a)}else"Year"===this.parent.currentView?i.click():this.parent.notify("cellClick",r)}},e.prototype.getSelectedElements=function(e){var t;if(this.selectedCells.length>1&&e.classList.contains("e-selected-cell")){var i=this.parent.getCellDetails(this.selectedCells[0]),n=this.parent.getCellDetails(this.selectedCells.slice(-1)[0]);i.endTime=n.endTime,i.element=e,t=i}else t=this.parent.getCellDetails(e);return t},e.prototype.getCells=function(e,t,i){var n=this.parent.getContentTable(),r="TimelineYear"===this.parent.currentView,a=r&&!e?".e-work-cells:not(.e-other-month)":"td",s=[].slice.call(n.querySelectorAll(a)),o=n.rows.length,l=n.rows[0].cells.length;if(t&&t.classList.contains("e-all-day-cells")){var p=this.parent.getAllDayRow();s=[].slice.call(p.cells),o=1,l=p.cells.length}var c=s.indexOf(t),h=s.indexOf(i),d=[];if(e){for(var u=0;u<l;u++)for(var g=0;g<o;g++){var v=s[l*g+u];r&&v.classList.contains("e-other-month")||d.push(v)}c=d.indexOf(t),h=d.indexOf(i)}if(c>h){var m=c;c=h,h=m}return(e?d:s).slice(c,h+1)},e.prototype.focusFirstCell=function(){if("Agenda"===this.parent.currentView){var e=this.parent.getContentTable().querySelector(".e-agenda-cells");return e.setAttribute("tabindex","0"),void e.focus()}if(this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.activeView.isTimelineView()&&"TimelineYear"!==this.parent.currentView){var t=this.parent.element.querySelector("."+nt+" tr:not(.e-hidden) .e-work-cells:not(.e-resource-group-cells)");this.selectCells(!1,t)}else if(this.parent.currentView.indexOf("Year")>-1){var i=".e-work-cells:not(.e-other-month):not(.e-resource-group-cells)";i+="TimelineYear"===this.parent.currentView&&"Vertical"===this.parent.activeViewOptions.orientation?'[data-date="'+this.parent.activeView.startDate().getTime()+'"]':"",this.selectCells(!1,this.parent.element.querySelector(i))}else this.selectCells(!1,this.parent.getWorkCellElements()[0])},e.prototype.isInverseTableSelect=function(){return this.parent.activeView.isInverseTableSelect},e.prototype.selectCells=function(e,t){var i=this;this.parent.removeSelectedClass();var n=t instanceof Array?t.slice(-1)[0]:t;if(e){var r,a=["Day","Week","WorkWeek","TimelineDay","TimelineWeek","TimelineWorkWeek","TimelineMonth","TimelineYear"],s={element:t,requestType:"mousemove",allowMultipleRow:!0};this.parent.inlineModule.removeInlineAppointmentElement(),this.parent.trigger("select",s,function(e){if(!e.allowMultipleRow||!i.parent.allowMultiRowSelection){var t="TimelineYear"===i.parent.currentView;if(t&&"Horizontal"===i.parent.activeViewOptions.orientation||"Month"===i.parent.currentView){var s=t&&i.parent.activeViewOptions.group.resources.length>0;n=s?i.initialTarget:i.initialTarget.parentElement.children[n.cellIndex]}else a.indexOf(i.parent.currentView)>-1&&(n=n.parentElement.children[i.initialTarget.cellIndex])}var o=i.getCells(i.isInverseTableSelect(),i.initialTarget,n);if(i.parent.activeViewOptions.group.resources.length>0){r=i.initialTarget.getAttribute("data-group-index");for(var l=[],p=0,c=o;p<c.length;p++)(v=c[p]).getAttribute("data-group-index")===r&&l.push(v);o=l}if(i.parent.allowMultiCellSelection||(o=[i.initialTarget]),i.selectedCells=o,o.length>2&&!n.classList.contains("e-all-day-cells")){var h=i.getAllDayCells(o);if(i.parent.activeViewOptions.group.resources.length>0){for(var d=[],u=0,g=h;u<g.length;u++){var v=g[u];v.getAttribute("data-group-index")===r&&d.push(v)}h=d}o=o.concat(h)}n.getAttribute("data-group-index")!==r&&i.parent.activeViewOptions.group.resources.length>0&&(n=i.selectedCells[i.selectedCells.length-1]),i.parent.addSelectedClass(o,n)})}else{s={element:n,requestType:"cellSelect"};this.parent.trigger("select",s,function(){i.initialTarget=n,i.selectedCells=[n],i.parent.addSelectedClass([n],n)})}},e.prototype.selectAppointment=function(e,i){var n=this.getAppointmentElements();if(!(n.length<0)){this.parent.eventBase.removeSelectedAppointmentClass();var r;if(i.classList.contains("e-appointment")){var a=n.indexOf(i);r=n[e?a-1:a+1]}else r=e?n[n.length-1]:n[0];r&&(this.parent.eventBase.addSelectedAppointments([r],!0),r.focus(),t.addClass([r],"e-active-appointment-agenda"))}},e.prototype.selectAppointmentElementFromWorkCell=function(e,t){var i=this;if(this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.removeSelectedClass(),t.classList.contains("e-work-cells")||t.classList.contains("e-all-day-cells")){var n=this.getUniqueAppointmentElements(),r=[],a=this.parent.getDateFromElement(t).getTime();if(this.parent.eventsProcessed.filter(function(t){return e?t[i.parent.eventFields.startTime].getTime()<=a:t[i.parent.eventFields.startTime].getTime()>=a}).filter(function(e){n.filter(function(t){JSON.stringify(e.Guid)===JSON.stringify(t.getAttribute("data-guid"))&&r.push(t)})}),r.length>0){var s=e?r[r.length-1]:r[0],o=this.getAppointmentElementsByGuid(s.getAttribute("data-guid"));this.parent.eventBase.addSelectedAppointments(o,!0),o[o.length-1].focus()}}},e.prototype.getAllDayCells=function(e){var t=this.parent.getAllDayRow();if(!t)return[];var i=e[0],n=e[e.length-1],r=this.parent.getCellDetails(i);return this.parent.getCellDetails(n).endTime.getTime()-r.startTime.getTime()>=Qe?[].slice.call(t.cells).slice(i.cellIndex,n.cellIndex+1):[]},e.prototype.getAppointmentElements=function(){return[].slice.call(this.parent.element.querySelectorAll(".e-appointment"))},e.prototype.getAppointmentElementsByGuid=function(e){return[].slice.call(this.parent.element.querySelectorAll('div[data-guid="'+e+'"]'))},e.prototype.getUniqueAppointmentElements=function(){var e=this.getAppointmentElements(),t=[];return e.map(function(e){return e.getAttribute("data-guid")}).filter(function(i,n,r){r.indexOf(i)===n&&t.push(e[parseInt(n.toString(),10)])}),t},e.prototype.getWorkCellFromAppointmentElement=function(e){var t=this.parent.eventBase.getEventByGuid(e.getAttribute("data-guid"));return this.parent.eventBase.selectWorkCellByTime([t])},e.prototype.processViewNavigation=function(e){if(!t.isNullOrUndefined(e.code)){var i=parseInt(e.code.slice(e.code.length-1),10)-1;if(!isNaN(i)&&!t.isNullOrUndefined(this.parent.views)&&i<this.parent.views.length){var n=this.parent.viewCollections[parseInt(i.toString(),10)].option;this.parent.changeView(n,e,void 0,i),this.parent.headerModule&&this.parent.headerModule.element.querySelector(".e-active-view button").focus()}}},e.prototype.isCalendarTarget=function(e){var i=e.currentTarget||e.target;return!(!i||t.isNullOrUndefined(i.querySelector(".e-header-popup.e-popup-open")))},e.prototype.cancelUpDownAction=function(e){var t=e&&"Vertical"===this.parent.activeViewOptions.orientation,i=this.parent.activeViewOptions.group.resources.length>0;return!!(t&&i||e&&this.initialTarget.classList.contains("e-other-month"))||!((!this.parent.activeView.isTimelineView()||e)&&"MonthAgenda"!==this.parent.currentView)},e.prototype.processUp=function(e,t){var i="TimelineYear"===this.parent.currentView;if(!(t&&this.cancelUpDownAction(i)||this.isCalendarTarget(e))){var n=e.target,r=this.parent.getSelectedCells(),a=this.parent.eventBase.getSelectedAppointments(),s=this.parent.element.querySelector(".e-more-popup-wrapper"),o=this.getQuickPopupElement();if(r.length>0&&!e.target.classList.contains("e-work-cells")&&(n=r[r.length-1]),a.length>0&&!s.classList.contains(rt)&&!o.classList.contains(rt)&&-1!==["Day","Week","WorkWeek","Month"].indexOf(this.parent.currentView)&&(n=this.getWorkCellFromAppointmentElement(a[a.length-1]),this.parent.eventBase.removeSelectedAppointmentClass()),n)if(n.classList.contains("e-work-cells")&&!this.parent.element.querySelector("."+rt)){var l=this.parent.getTableRows(),p=l.indexOf(n.parentElement),c=void 0;if(i&&t&&0===this.parent.activeViewOptions.group.resources.length&&(c=this.isInverseTableSelect()?this.getVerticalUpDownCell(l,n,p,!0):this.getHorizontalUpDownCell(l,n,p,!0)),(p>0||c)&&p<l.length){if(c=c||l[p-1].cells[n.cellIndex],"Year"===this.parent.currentView&&c.classList.contains("e-other-month")){if(!(this.parent.activeView.getStartDate().getTime()<+c.getAttribute("data-date")))return;c=this.getYearUpDownCell(l,p-1,n.cellIndex,!0)}e.preventDefault(),this.selectCells(t,c)}}else"Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||this.selectAppointment(!0,n)}},e.prototype.processDown=function(e,t){var i="TimelineYear"===this.parent.currentView;if(!(t&&this.cancelUpDownAction(i)||this.isCalendarTarget(e))){var n=e.target,r=this.parent.getSelectedCells(),a=this.parent.eventBase.getSelectedAppointments(),s=this.parent.element.querySelector(".e-more-popup-wrapper"),o=this.getQuickPopupElement();r.length>0&&!e.target.classList.contains("e-work-cells")&&(n=r[r.length-1]),a.length>0&&!s.classList.contains(rt)&&!o.classList.contains(rt)&&-1!==["Day","Week","WorkWeek","Month"].indexOf(this.parent.currentView)&&(n=this.getWorkCellFromAppointmentElement(a[a.length-1]),this.parent.eventBase.removeSelectedAppointmentClass());var l=this.parent.getTableRows();if(n)if(n.classList.contains("e-work-cells")&&!this.parent.element.querySelector("."+rt)){var p=l.indexOf(n.parentElement),c=void 0;if(i&&t&&0===this.parent.activeViewOptions.group.resources.length&&(c=this.isInverseTableSelect()?this.getVerticalUpDownCell(l,n,p,!1):this.getHorizontalUpDownCell(l,n,p,!1)),p>=0&&(p<l.length-1||c)){if(c=c||l[p+1].cells[n.cellIndex],"Year"===this.parent.currentView&&c.classList.contains("e-other-month")){if(!(this.parent.activeView.getEndDate().getTime()>+c.getAttribute("data-date")))return;c=this.getYearUpDownCell(l,p+1,n.cellIndex,!1)}e.preventDefault(),this.selectCells(t,c)}}else"Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||this.selectAppointment(!1,n)}},e.prototype.getYearUpDownCell=function(e,t,i,n){for(;e[parseInt(t.toString(),10)]&&e[parseInt(t.toString(),10)].cells[parseInt(i.toString(),10)].classList.contains("e-other-month");)t+=n?-1:1;return e[parseInt(t.toString(),10)].cells[parseInt(i.toString(),10)]},e.prototype.getHorizontalUpDownCell=function(e,t,i,n){var r=e[i+(n?-1:1)],a=r?r.cells[t.cellIndex]:t;if(a.classList.contains("e-other-month")){var s=r.querySelector(".e-work-cells:not(.e-other-month)"),o=new Date(+s.getAttribute("data-date")),l='[data-date="'+new Date(o.getFullYear(),o.getMonth()+1,0).getTime()+'"]';a=a.cellIndex<s.cellIndex?s:r.querySelector(l)}return a},e.prototype.getVerticalUpDownCell=function(e,t,i,n){var r=n&&i>0||!n&&i<e.length-1?e[i+(n?-1:1)].cells[t.cellIndex]:void 0;if(!r||r.classList.contains("e-other-month")){if(e[parseInt(i.toString(),10)].cells[t.cellIndex-(n?1:-1)]){var a=+t.getAttribute("data-date")-(n?Qe:-Qe);return this.parent.getContentTable().querySelector('.e-work-cells[data-date="'+a+'"]')}r=t}return r},e.prototype.processLeftRight=function(e){var t="Year"===this.parent.currentView?e.closest("tbody"):this.parent.getContentTable(),i=e.parentNode.sectionRowIndex;return{element:t,rowIndex:i,columnIndex:e.cellIndex,maxIndex:t.rows[parseInt(i.toString(),10)].cells.length}},e.prototype.getQuickPopupElement=function(){return(this.parent.isAdaptive?document.body:this.parent.element).querySelector(".e-quick-popup-wrapper")},e.prototype.isCancelLeftRightAction=function(e,t,i){var n="MonthAgenda"===this.parent.currentView||i&&this.initialTarget.classList.contains("e-other-month");if("Agenda"===this.parent.currentView||t&&n)return!0;if(this.isPreventAction(e)&&t)return!0;var r=this.parent.element.querySelector(".e-more-popup-wrapper"),a=this.getQuickPopupElement();return!(!r.classList.contains(rt)&&!a.classList.contains(rt))},e.prototype.processRight=function(e,i){var n="TimelineYear"===this.parent.currentView;if(!this.isCancelLeftRightAction(e,i,n)&&!this.isCalendarTarget(e)){var r,a=this.parent.getSelectedCells(),s=this.parent.eventBase.getSelectedAppointments(),o=e.target;if(a.length>0&&!o.classList.contains("e-work-cells")&&!o.classList.contains("e-all-day-cells")&&(o=a[a.length-1]),!(s.length>0)||(o=this.getWorkCellFromAppointmentElement(s[s.length-1]),this.parent.eventBase.removeSelectedAppointmentClass(),o))if(o.classList.contains("e-work-cells")&&e.target.classList.contains("e-work-cells")){var l=this.processLeftRight(o),p=new Date(+o.getAttribute("data-date")),c="Year"===this.parent.currentView&&p.getTime()===y(p).getTime();if(l.columnIndex>=0&&l.columnIndex<l.maxIndex-1&&!c)r=this.calculateNextPrevDate(o,l.element.rows[l.rowIndex].cells[o.cellIndex+1],"right"),n&&i&&r.classList.contains("e-other-month")&&(r=this.getTimelineYearTargetCell(l,o,!0)),t.isNullOrUndefined(r)||this.selectCells(i,r);else if(l.columnIndex===l.maxIndex-1||c)if(!this.isInverseTableSelect()&&l.rowIndex<l.element.rows.length-1&&!c)r=this.calculateNextPrevDate(o,l.element.rows[l.rowIndex+1].cells[0],"right"),r=n&&i&&r.classList.contains("e-other-month")?this.getHorizontalLeftRightCell(l,o,!0):r,t.isNullOrUndefined(r)||this.selectCells(i,r);else if(!i){if(c&&p.getTime()!==this.parent.activeView.getEndDate().getTime())return void this.selectCells(i,this.parent.element.querySelector(':not(.e-other-month)[data-date="'+(p.getTime()+Qe)+'"]'));var h=this.isInverseTableSelect()?l.rowIndex:0;this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Next"),e);var d=this.parent.getContentTable(),u=c?d.rows[parseInt(h.toString(),10)].querySelector(".e-work-cells:not(.e-other-month)"):d.rows[parseInt(h.toString(),10)].cells[0];this.selectCells(!1,u)}}else if(o.classList.contains("e-all-day-cells")){var g=o.cellIndex,v=this.parent.getAllDayRow(),m=v.cells.length;if(g>=0&&g<m-1)this.selectCells(i,v.cells[g+1]);else if(g===m-1&&!i){this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Next"),e);var f=this.parent.getAllDayRow();this.selectCells(!1,f.cells[0])}}}},e.prototype.processLeft=function(e,i){var n="TimelineYear"===this.parent.currentView;if(!this.isCancelLeftRightAction(e,i,n)&&!this.isCalendarTarget(e)){var r,a=e.target,s=this.parent.getSelectedCells();s.length>0&&!a.classList.contains("e-work-cells")&&!a.classList.contains("e-all-day-cells")&&(a=s[s.length-1]);var o=this.parent.eventBase.getSelectedAppointments();if(!(o.length>0)||(a=this.getWorkCellFromAppointmentElement(o[o.length-1]),this.parent.eventBase.removeSelectedAppointmentClass(),a))if(e.target.classList.contains("e-work-cells")&&a.classList.contains("e-work-cells")){var l=this.processLeftRight(a),p=new Date(+a.getAttribute("data-date")),c="Year"===this.parent.currentView&&p.getTime()===f(p).getTime();if(l.columnIndex>0&&l.columnIndex<l.maxIndex&&!c)r=this.calculateNextPrevDate(a,l.element.rows[l.rowIndex].cells[a.cellIndex-1],"left"),n&&i&&r.classList.contains("e-other-month")&&(r=this.getTimelineYearTargetCell(l,a,!1)),t.isNullOrUndefined(r)||this.selectCells(i,r);else if(0===l.columnIndex||c)if(!this.isInverseTableSelect()&&l.rowIndex>0)r=this.calculateNextPrevDate(a,l.element.rows[l.rowIndex-1].cells[l.maxIndex-1],"left"),r=n&&i&&r.classList.contains("e-other-month")?this.getHorizontalLeftRightCell(l,a,!1):r,t.isNullOrUndefined(r)||this.selectCells(i,r);else if(!i){if(c&&p.getTime()!==this.parent.activeView.getStartDate().getTime())return void this.selectCells(i,this.parent.element.querySelector('[data-date="'+(p.getTime()-Qe)+'"]'));this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Previous"),e);var h=this.parent.getContentTable(),d=this.isInverseTableSelect()?l.rowIndex:h.rows.length-1,u=h.rows[parseInt(d.toString(),10)].cells[l.maxIndex-1];if(c){var g=this.parent.element.querySelectorAll("."+nt+" tbody");u=g.item(g.length-1).querySelector(':not(.e-other-month)[data-date="'+this.parent.activeView.getEndDate().getTime()+'"]')}this.selectCells(!1,u)}}else if(a.classList.contains("e-all-day-cells")){var v=a.cellIndex,m=this.parent.getAllDayRow(),y=m.cells.length;if(v>0&&v<y)this.selectCells(i,m.cells[v-1]);else if(0===v&&!i){this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Previous"),e);var T=this.parent.getAllDayRow();this.selectCells(!1,T.cells[y-1])}}}},e.prototype.getTimelineYearTargetCell=function(e,t,i){return this.isInverseTableSelect()?this.getVerticalLeftRightCell(t,i):this.getHorizontalLeftRightCell(e,t,i)},e.prototype.getHorizontalLeftRightCell=function(e,t,i){var n=e.element.rows[t.parentNode.sectionRowIndex+(i?1:-1)];if(n){var r=i?".e-work-cells:not(.e-other-month)":'[data-date="'+(+t.getAttribute("data-date")-Qe)+'"]';return n.querySelector(r)}return t},e.prototype.getVerticalLeftRightCell=function(e,t){var i=new Date(+e.getAttribute("data-date")),n=new Date(i.getFullYear(),i.getMonth()+(t?1:-1),1),r=this.parent.getContentTable(),a=r.querySelector('[data-date="'+n.getTime()+'"]');return a.parentNode.sectionRowIndex>e.parentNode.sectionRowIndex?a:r.querySelector('[data-date="'+new Date(n.getFullYear(),n.getMonth()+1,0).getTime()+'"]')},e.prototype.calculateNextPrevDate=function(e,t,i){var n=this.initialTarget.getAttribute("data-group-index");if(this.parent.activeViewOptions.group.resources.length>0&&"Month"===this.parent.currentView&&e&&t&&t.getAttribute("data-group-index")!==n){var r=this.parent.getDateFromElement(e),a="right"===i?new Date(r.setDate(r.getDate()+1)):new Date(r.setDate(r.getDate()-1));t=[].slice.call(this.parent.element.querySelectorAll('td[data-date="'+a.getTime().toString()+'"][data-group-index="'+n+'"]'))[0]}return t},e.prototype.getFocusableElements=function(e){return[].slice.call(e.querySelectorAll('a[href]:not([tabindex="-1"]),input:not([disabled]):not([tabindex="-1"]),textarea:not([disabled]):not([tabindex="-1"]),button:not([disabled]):not([tabindex="-1"]),select:not([disabled]):not([tabindex="-1"]),[tabindex]:not([tabindex="-1"]),[contentEditable=true]:not([tabindex="-1"])'))},e.prototype.processTabOnPopup=function(e,i){var n=this,r=this.getFocusableElements(i),a=(r=r.filter(function(e){var t=n.parent.element.querySelector(".e-popup-footer");return t&&t.offsetParent?!(e.classList.contains("e-edit")||e.classList.contains("e-delete")):!(e.classList.contains("e-event-edit")||e.classList.contains("e-event-delete"))}))[0],s=r[r.length-1];t.isNullOrUndefined(s)||document.activeElement!==s||e.shiftKey||(e.preventDefault(),a.focus()),!t.isNullOrUndefined(a)&&document.activeElement===a&&e.shiftKey&&(e.preventDefault(),s.focus())},e.prototype.processTab=function(e,i){var n=e.target;if(n.classList.contains("e-inline-subject")&&this.parent.inlineModule&&(n=n.closest(".e-appointment"),this.parent.inlineModule.inlineCrudActions(e.target)),"TimelineYear"===this.parent.currentView&&n.classList.contains("e-other-month"))return void(n.classList.contains("e-selected-cell")&&this.parent.removeSelectedClass());var r=t.closest(n,".e-quick-popup-wrapper,.e-more-popup-wrapper");if(r&&r.classList.contains(rt))return r.classList.contains("e-more-popup-wrapper")&&this.parent.eventBase.removeSelectedAppointmentClass(),void this.processTabOnPopup(e,r);if(n.classList.contains($e))return void this.parent.eventBase.removeSelectedAppointmentClass();if(n.classList.contains("e-resource-cells")&&this.parent.activeView.isTimelineView()&&this.parent.activeViewOptions.group.resources.length>0){var a=parseInt(n.getAttribute("data-group-index"),10),s='.e-appointment[data-group-index="'+(i?a-1:a)+'"]';if((c=[].slice.call(this.parent.element.querySelectorAll(s))).length>0){this.parent.eventBase.removeSelectedAppointmentClass();var o=i?c.slice(-1)[0]:c[0];this.parent.eventBase.addSelectedAppointments([o],!0),o.focus(),e.preventDefault()}else if(a+1===this.parent.resourceBase.lastResourceLevel.length)this.parent.element.focus(),e.preventDefault();else if(this.parent.virtualScrollModule){var l=this.parent.element.querySelector(".e-virtual-track"),p=Math.round(l.offsetHeight/this.parent.resourceBase.expandedResources.length);this.parent.element.querySelector(".e-content-wrap").scrollTop=(i?a-1:a+1)*p,this.parent.virtualScrollModule.virtualScrolling()}else this.setScrollPosition(a)}else{if(n.classList.contains("e-appointment")){var c=[].slice.call(this.parent.element.querySelectorAll(".e-appointment")),h="TimelineYear"===this.parent.currentView;if((this.parent.activeView.isTimelineView()&&!h||h&&"Vertical"===this.parent.activeViewOptions.orientation)&&this.parent.activeViewOptions.group.resources.length>0){a=parseInt(n.getAttribute("data-group-index"),10);c=[].slice.call(this.parent.element.querySelectorAll('.e-appointment[data-group-index="'+a+'"]'));var d='.e-resource-cells[data-group-index="'+(i?a:a+1)+'"]',u=this.parent.element.querySelector(d);if(u&&(i&&n.getAttribute("data-guid")===c[0].getAttribute("data-guid")||!i&&n.getAttribute("data-guid")===c.slice(-1)[0].getAttribute("data-guid")))return this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.virtualScrollModule?u.focus({preventScroll:!0}):u.focus(),this.parent.activeView.isTimelineView()&&this.parent.activeViewOptions.group.resources.length>0&&t.isNullOrUndefined(this.parent.virtualScrollModule)&&this.setScrollPosition(a),void e.preventDefault()}var g=this.parent.eventBase.getSelectedAppointments();if(g.length>0&&(n=g[g.length-1]),this.parent.eventBase.removeSelectedAppointmentClass(),!i&&n.getAttribute("data-guid")===c[c.length-1].getAttribute("data-guid")||i&&n.getAttribute("data-guid")===c[0].getAttribute("data-guid"))return;return void("Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||(this.selectAppointment(i,n),e.preventDefault()))}var v=this.parent.getSelectedCells();if(v.length>0&&!n.classList.contains("e-appointment"))return n=v[v.length-1],this.selectAppointmentElementFromWorkCell(i,n),void e.preventDefault();n&&!n.classList.contains("e-resource-cells")&&this.parent.activeView.isTimelineView()&&this.parent.activeViewOptions.group.resources.length>0&&this.processTabOnResourceCells(n,i)}},e.prototype.processDelete=function(e){var i=document.activeElement;if("MonthAgenda"===this.parent.currentView||!t.isNullOrUndefined(i)&&t.closest(i,".e-quick-popup-wrapper")){var n=this.parent.eventBase.getSelectedEvents().element;i=n&&t.isNullOrUndefined(n.length)?n:n[0]}if(i&&i.classList.contains("e-appointment")){if(t.addClass([i],"e-appointment-border"),this.parent.activeEventData=this.parent.eventBase.getSelectedEvents(),this.parent.activeViewOptions.readonly||i.classList.contains("e-read-only")||!this.parent.eventSettings.allowDeleting)return;this.parent.quickPopup.deleteClick(e)}},e.prototype.processCtrlShiftNavigationArrows=function(e){if(this.parent.activeViewOptions.group.resources.length>0&&document.activeElement.classList.contains("e-appointment")){var t=parseInt(document.activeElement.getAttribute("data-group-index"),10);r=(r="ctrlShiftLeftArrow"===e.action||"ctrlShiftUpArrow"===e.action?t-1:t+1)<0?0:r>this.parent.resourceBase.lastResourceLevel.length?this.parent.resourceBase.lastResourceLevel.length:r;for(var i=[];0===i.length&&r>=0&&r<=this.parent.resourceBase.lastResourceLevel.length;)i=[].slice.call(this.parent.element.querySelectorAll('.e-appointment[data-group-index="'+r+'"]')),r="ctrlShiftLeftArrow"===e.action||"ctrlShiftUpArrow"===e.action?r-1:r+1;var n=i[0];n&&(this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.eventBase.addSelectedAppointments([n],!0),n.focus())}else if(this.parent.activeViewOptions.group.resources.length>0&&!document.activeElement.classList.contains("e-appointment")){var r=this.parent.resourceBase.renderedResources[0].groupIndex,a='.e-appointment[data-group-index="'+r+'"]',s=[].slice.call(this.parent.element.querySelectorAll(a));if(s.length>0){this.parent.eventBase.removeSelectedAppointmentClass();var o=s[0];this.parent.eventBase.addSelectedAppointments([o],!0),o.focus(),e.preventDefault()}}},e.prototype.processEscape=function(e){this.parent.quickPopup.onClosePopup(e),this.parent.quickPopup.morePopup.hide(),this.parent.headerModule&&this.parent.headerModule.hideHeaderPopup(),this.parent.inlineModule&&this.parent.inlineModule.removeInlineAppointmentElement()},e.prototype.isPreventAction=function(e){var i=t.closest(e.target,".e-resource-group-cells");return!(!this.parent.activeView.isTimelineView()||t.isNullOrUndefined(i))},e.prototype.processTabOnResourceCells=function(e,t){var i=[].slice.call(this.parent.element.querySelectorAll('[tabIndex="0"]')),n=i.indexOf(e),r=t?i[n-1]:i[n+1];if(r&&r.classList.contains("e-resource-cells")){var a=parseInt(r.getAttribute("data-group-index"),10);if(this.parent.virtualScrollModule){var s=this.parent.element.querySelector(".e-resource-column-wrap");[].slice.call(this.parent.element.querySelectorAll(".e-resource-cells")).forEach(function(e){e.getBoundingClientRect().top<s.getBoundingClientRect().top&&e.setAttribute("tabindex","-1")})}else this.setScrollPosition(a)}},e.prototype.setScrollPosition=function(e){var t=this.parent.element.querySelector('.e-work-cells[data-group-index="'+e+'"]');t&&(this.parent.element.querySelector(".e-content-wrap").scrollTop=t.offsetTop)},e.prototype.createClipboardElement=function(){this.parent.allowClipboard&&(this.clipBoardTextArea=this.parent.createElement("textarea",{className:"e-clipboard",attrs:{tabindex:"-1"}}),this.parent.element.appendChild(this.clipBoardTextArea))},e.prototype.setCopy=function(e,i){var n=this;if(""===window.getSelection().toString()){this.clipBoardTextArea.value="";var r={elements:[],eventDatas:[]};if(e){var a=this.filterReadOnlyEvent(e);r.eventDatas=a}else{if(!this.parent||!this.parent.eventBase)return;var s=this.parent.eventBase.getSelectedEvents();s.event=s&&s.event?Array.isArray(s.event)?this.filterReadOnlyEvent(s.event):this.filterReadOnlyEvent([s.event]):void 0,s.element&&s.event?r={elements:s.element,eventDatas:s.event}:(r.element=[i.target],r.eventDatas=[this.parent.getEventDetails(i.target)])}this.clipBoardTextArea.value=JSON.stringify(r.eventDatas,void 0,2),/ipad|ipod|iphone/i.test(t.Browser.userAgent)?this.clipBoardTextArea.setSelectionRange(0,this.clipBoardTextArea.value.length):this.clipBoardTextArea.select(),t.isNullOrUndefined(navigator.clipboard)||navigator.clipboard.writeText(this.clipBoardTextArea.value).then(function(){if(n.clipBoardTextArea.blur(),window.getSelection().removeAllRanges(),i){var e=i.target.closest(".e-appointment");e&&e.focus()}}).catch(function(e){throw e})}},e.prototype.filterReadOnlyEvent=function(e){var t=this;return e.filter(function(e){return!e[t.parent.eventFields.isReadonly]})},e.prototype.processClipboardAction=function(e,t,i){this.parent.allowClipboard&&(this.isCutAction=e,this.isCutContentPasted=!1,this.parent.closeQuickInfoPopup(),this.setCopy(t||void 0,i))},e.prototype.pasteHandler=function(e,t){var i=this;if(this.parent.allowClipboard&&!this.isCutContentPasted){var n=this.parent.getSelectedCells().length>0?this.parent.getSelectedCells():t?[t]:[];if(0!==n.length&&!this.parent.eventWindow.dialogObject.visible&&!this.parent.quickPopup.quickPopup.element.classList.contains(rt)){var r=(e.clipboardData||e.event.clipboardData||window.clipboardData).getData("text");if("[]"!==r&&""!==r){var a;try{a=JSON.parse(r)}catch(e){a=r}var s={cancel:!1,data:a,element:n};this.parent.trigger("beforePaste",s,function(e){return e.cancel?void i.parent.closeQuickInfoPopup():Array.isArray(e.data)&&e.data.every(function(e){return"object"==typeof e})?(i.processPaste(e.data,t),void(i.isCutAction&&(i.isCutContentPasted=!0))):void(i.clipBoardTextArea.value="")})}}}},e.prototype.processPaste=function(e,i){if(this.parent&&this.parent.eventWindow&&this.parent.eventBase&&e&&e.length){var n=this.getTargetElements(i),r=this.parent.getCellDetails(n),a={};this.parent.eventWindow.convertToEventData(r,a);var s=this.isAllDayEvent(n),o=this.parent.getResourcesByIndex(r.groupIndex),l=this.processEventData(e,s,r,o),p=this.parent.eventBase.sortByDateTime(l),c=this.prepareEventData(p,a);t.removeClass(n,"e-selected-cell"),c.length>0&&(this.isCutAction?this.parent.saveEvent(c):this.parent.addEvent(c))}},e.prototype.getTargetElements=function(e){return this.parent.getSelectedCells().length>0?this.parent.getSelectedCells():e?[e]:[]},e.prototype.isAllDayEvent=function(e){return!e.some(function(e){return e.classList.contains("e-work-cells")})},e.prototype.processEventData=function(e,t,i,n){var r=this;return e.map(function(e){var a,s=gt({},e,(a={},a[r.parent.eventFields.startTime]=new Date(e[r.parent.eventFields.startTime]),a[r.parent.eventFields.endTime]=new Date(e[r.parent.eventFields.endTime]),a[r.parent.eventFields.recurrenceID]=null,a[r.parent.eventFields.isAllDay]=t,a));return r.adjustEventTime(s,t,e.IsAllDay,i),n&&n.groupData&&Object.assign(s,n.groupData),s})},e.prototype.adjustEventTime=function(e,t,i,n){var r=this.parent.activeViewOptions.timeScale.enable;-1!==["Day","Week","WorkWeek"].indexOf(this.parent.currentView)&&r?t?(e[this.parent.eventFields.endTime]=new Date(e[this.parent.eventFields.startTime]),e[this.parent.eventFields.endTime].setDate(e[this.parent.eventFields.startTime].getDate()+1)):i&&(e[this.parent.eventFields.startTime]=new Date(e[this.parent.eventFields.startTime].setHours(0,0,0,0)),e[this.parent.eventFields.endTime]=new Date(e[this.parent.eventFields.startTime].getTime()+(n.endTime.getTime()-n.startTime.getTime()))):i&&(e[this.parent.eventFields.isAllDay]=!0,e[this.parent.eventFields.startTime]=new Date(e[this.parent.eventFields.startTime].setHours(0,0,0,0)),e[this.parent.eventFields.endTime]=new Date(e[this.parent.eventFields.startTime].getTime()+(e[this.parent.eventFields.endTime].getTime()-e[this.parent.eventFields.startTime].getTime())))},e.prototype.prepareEventData=function(e,t){var i=this,n=new Date(e[0][this.parent.eventFields.startTime]),r=this.parent.getEventMaxID();return e.map(function(e){var a=i.calculateTotalDuration(e,t,n),s=i.isCutAction?e:gt({},e);return e[i.parent.eventFields.recurrenceRule]||(s[i.parent.eventFields.startTime]=new Date(new Date(s[i.parent.eventFields.startTime]).setMilliseconds(a)),s[i.parent.eventFields.endTime]=new Date(new Date(s[i.parent.eventFields.endTime]).setMilliseconds(a))),i.isCutAction||(s[i.parent.eventFields.id]=r++),s})},e.prototype.calculateTotalDuration=function(e,t,i){if(-1===["Month","TimelineMonth","TimelineYear"].indexOf(this.parent.currentView)&&this.parent.activeViewOptions.timeScale.enable)return t[this.parent.eventFields.startTime].getTime()-i.getTime();var n=new Date(e[this.parent.eventFields.startTime]);return t[this.parent.eventFields.startTime].getTime()-i.getTime()+(36e5*n.getHours()+6e4*n.getMinutes()+1e3*n.getSeconds())},e.prototype.getModuleName=function(){return"keyboard"},e.prototype.destroy=function(){this.removeEventListener(),this.selectedCells=[],this.clipBoardTextArea=null,this.keyboardModule.destroy()},e}(),mt=function(){function e(e,t,i){this.parent=e,this.initDataManager(t,i)}return e.prototype.initDataManager=function(e,t){this.dataManager=e instanceof a.DataManager?e:new a.DataManager(e),this.query=t instanceof a.Query?t:new a.Query},e.prototype.generateQuery=function(e,i){var n=this.query.clone();if(this.parent&&e&&i){if(this.parent.activeViewOptions&&this.parent.activeViewOptions.enableLazyLoading&&!t.isNullOrUndefined(this.parent.activeViewOptions.group.resources)&&this.parent.activeViewOptions.group.resources.length>0&&this.parent.resourceBase&&this.parent.resourceBase.resourceCollection.length>0&&this.parent.resourceBase.renderedResources.length>0){var r=[];this.parent.resourceBase.resourceCollection.forEach(function(){return r.push([])}),this.parent.resourceBase.renderedResources.forEach(function(e){r.forEach(function(t,i){var n=e.groupOrder[parseInt(i.toString(),10)];n&&t.indexOf(n)<0&&t.push(n)})}),this.parent.resourceBase.resourceCollection.forEach(function(e,t){n.addParams(e.field,r[parseInt(t.toString(),10)].toString())})}if(this.parent.timezone&&(e=this.parent.tzModule.remove(new Date(+e.getTime()),this.parent.timezone),i=this.parent.tzModule.remove(new Date(+i.getTime()),this.parent.timezone)),this.parent.eventSettings.includeFiltersInQuery){var s=this.getStartEndQuery(e,i),o=new a.Predicate(this.parent.eventFields.recurrenceRule,"notequal",null).and(new a.Predicate(this.parent.eventFields.recurrenceRule,"notequal",""));return n.where(s.or(o))}n.addParams("StartDate",e.toISOString()),n.addParams("EndDate",i.toISOString())}return n},e.prototype.getStartEndQuery=function(e,t){var i=this.parent.eventFields;return new a.Predicate(i.startTime,"greaterthanorequal",e).and(new a.Predicate(i.endTime,"greaterthanorequal",e)).and(new a.Predicate(i.startTime,"lessthan",t)).or(new a.Predicate(i.startTime,"lessthanorequal",e).and(new a.Predicate(i.endTime,"greaterthan",e)))},e.prototype.getData=function(e){return this.dataManager.executeQuery(e)},e.prototype.destroy=function(){this.dataManager=null,this.query=null},e}(),ft=function(){function e(){}return e.prototype.firstDateOfMonth=function(e){return new Date(e.getFullYear(),e.getMonth())},e.prototype.lastDateOfMonth=function(e){return new Date(e.getFullYear(),e.getMonth()+1,0)},e.prototype.isMonthStart=function(e){return 1===e.getDate()},e.prototype.getLeapYearDaysCount=function(){return 366},e.prototype.getYearDaysCount=function(e,t){return(e.getFullYear()+t)%4==0?366:365},e.prototype.getDate=function(e){return e.getDate()},e.prototype.getMonth=function(e){return e.getMonth()+1},e.prototype.getFullYear=function(e){return e.getFullYear()},e.prototype.getYearLastDate=function(e,t){return new Date(e.getFullYear()+t,0,0)},e.prototype.getMonthDaysCount=function(e){return this.lastDateOfMonth(e).getDate()},e.prototype.getMonthStartDate=function(e){return new Date(e.getFullYear(),e.getMonth(),1,e.getHours(),e.getMinutes())},e.prototype.getMonthEndDate=function(e){return e.setDate(1),new Date(e.setMonth(e.getMonth()+1))},e.prototype.getExpectedDays=function(e,t){return t},e.prototype.setDate=function(e,t){e.setDate(t)},e.prototype.setValidDate=function(e,i,n,r,a){t.isNullOrUndefined(a)?e.setMonth(e.getMonth()+i,n):e.setMonth((a?r:e.getMonth())+i)},e.prototype.setMonth=function(e,t,i){e.setDate(1),e.setFullYear(e.getFullYear()),e.setMonth(t-1);var n=new Date(e.getFullYear(),e.getMonth()+1,0).getDate();e.setDate(Math.min(i,n))},e.prototype.addYears=function(e,t){e.setFullYear(e.getFullYear()+t)},e.prototype.isSameMonth=function(e,t){return e.getMonth()===t.getMonth()},e.prototype.checkMonth=function(e,t){return-1===t.indexOf(e.getMonth()+1)},e.prototype.compareMonth=function(e,t){return e.getMonth()>t.getMonth()},e.prototype.isSameYear=function(e,t){return e.getFullYear()===t.getFullYear()},e.prototype.isLastMonth=function(e){return 11===e.getMonth()},e.prototype.isLeapYear=function(e,t){return(e+t)%4==0},e}(),yt=function(){function e(){}return e.prototype.firstDateOfMonth=function(e){var i=this.getHijriDate(e);return t.HijriParser.toGregorian(i.year,i.month,1)},e.prototype.lastDateOfMonth=function(e){var i=this.getHijriDate(e),n=this.getDaysInMonth(i.month,i.year),r=t.HijriParser.toGregorian(i.year,i.month,n),a=new Date(r.getTime());a=new Date(a.setDate(a.getDate()+1));var s=this.getHijriDate(a);return i.month===s.month?a:(s=this.getHijriDate(r),i.month===s.month?r:new Date(r.setDate(r.getDate()-1)))},e.prototype.isMonthStart=function(e){return 1===this.getHijriDate(e).date},e.prototype.getLeapYearDaysCount=function(){return 355},e.prototype.getYearDaysCount=function(e,t){var i=this.getHijriDate(e);return this.isLeapYear(i.year,t)?355:354},e.prototype.getDate=function(e){return this.getHijriDate(e).date},e.prototype.getMonth=function(e){return this.getHijriDate(e).month},e.prototype.getFullYear=function(e){return this.getHijriDate(e).year},e.prototype.getYearLastDate=function(e,i){var n=this.getHijriDate(e);return t.HijriParser.toGregorian(n.year+i,1,0)},e.prototype.getMonthDaysCount=function(e){var t=this.lastDateOfMonth(e);return this.getHijriDate(t).date},e.prototype.getMonthStartDate=function(e){var t=this.firstDateOfMonth(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),e.getHours(),e.getMinutes())},e.prototype.getMonthEndDate=function(e){var t=this.lastDateOfMonth(e);return t.setDate(t.getDate()+1),new Date(t.setMonth(t.getMonth()))},e.prototype.getExpectedDays=function(e,i){for(var n=this.getHijriDate(e),r=[],a=0;a<i.length;a++){var s=t.HijriParser.toGregorian(n.year,n.month,i[parseInt(a.toString(),10)]);r.push(s.getDate())}return r},e.prototype.setDate=function(e,i){var n=this.getHijriDate(e),r=t.HijriParser.toGregorian(n.year,n.month,i);this.updateDateObj(e,r)},e.prototype.setValidDate=function(e,i,n,r,a){var s=t.isNullOrUndefined(a)?e:this.firstDateOfMonth(a),o=this.getHijriDate(s),l=t.HijriParser.toGregorian(o.year,o.month+i,n);this.updateDateObj(e,l)},e.prototype.setMonth=function(e,i,n){var r=this.getHijriDate(e),a=t.HijriParser.toGregorian(r.year,i,n);this.updateDateObj(e,a)},e.prototype.addYears=function(e,i,n){var r=this.getHijriDate(e),a=t.HijriParser.toGregorian(r.year+i,n,1);this.updateDateObj(e,a)},e.prototype.isSameMonth=function(e,t){var i=this.getHijriDate(e),n=this.getHijriDate(t);return i.month===n.month},e.prototype.checkMonth=function(e,t){var i=this.getHijriDate(e);return-1===t.indexOf(i.month)},e.prototype.compareMonth=function(e,t){var i=this.getHijriDate(e),n=this.getHijriDate(t);return i.month>n.month},e.prototype.isSameYear=function(e,t){var i=this.getHijriDate(e),n=this.getHijriDate(t);return i.year===n.year},e.prototype.isLastMonth=function(e){return 12===this.getHijriDate(e).month},e.prototype.updateDateObj=function(e,t){e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate())},e.prototype.isLeapYear=function(e,t){return(14+11*(e+t))%30<11},e.prototype.getDaysInMonth=function(e,t){var i=0;return i=29+(e+1)%2,11===e&&this.isLeapYear(t,0)&&i++,i},e.prototype.getHijriDate=function(e){return t.HijriParser.getHijriDate(e)},e}(),Tt=function(){function e(){this.timezoneData=[],this.timezoneData=this.getTimezoneData()}return e.prototype.offset=function(e,t){var i=e.getTimezoneOffset();try{var n=new Date(e.toLocaleString("en-US",{timeZone:t}));return isNaN(n.getTime())?0:(e.getTime()-n.getTime())/6e4+i}catch(e){return 0}},e.prototype.convert=function(e,t,i){"string"==typeof t&&(t=this.offset(e,t)),"string"==typeof i&&(i=this.offset(e,i));var n=e.getTimezoneOffset(),r=(e=new Date(e.getTime()+6e4*(t-i))).getTimezoneOffset();return new Date(e.getTime()+6e4*(r-n))},e.prototype.add=function(e,t){return this.convert(e,e.getTimezoneOffset(),t)},e.prototype.remove=function(e,t){return this.convert(e,t,e.getTimezoneOffset())},e.prototype.removeLocalOffset=function(e){return new Date(e.getTime()-6e4*e.getTimezoneOffset())},e.prototype.getLocalTimezoneName=function(){return window.Intl?Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC":"UTC"},e.prototype.getTimezoneData=function(){return wt},e}(),wt=[{Value:"Pacific/Niue",Text:"(UTC-11:00) Niue"},{Value:"Pacific/Pago_Pago",Text:"(UTC-11:00) Pago Pago"},{Value:"Pacific/Honolulu",Text:"(UTC-10:00) Hawaii Time"},{Value:"Pacific/Rarotonga",Text:"(UTC-10:00) Rarotonga"},{Value:"Pacific/Tahiti",Text:"(UTC-10:00) Tahiti"},{Value:"Pacific/Marquesas",Text:"(UTC-09:30) Marquesas"},{Value:"America/Anchorage",Text:"(UTC-09:00) Alaska Time"},{Value:"Pacific/Gambier",Text:"(UTC-09:00) Gambier"},{Value:"America/Los_Angeles",Text:"(UTC-08:00) Pacific Time"},{Value:"America/Tijuana",Text:"(UTC-08:00) Pacific Time - Tijuana"},{Value:"America/Vancouver",Text:"(UTC-08:00) Pacific Time - Vancouver"},{Value:"America/Whitehorse",Text:"(UTC-08:00) Pacific Time - Whitehorse"},{Value:"Pacific/Pitcairn",Text:"(UTC-08:00) Pitcairn"},{Value:"America/Denver",Text:"(UTC-07:00) Mountain Time"},{Value:"America/Phoenix",Text:"(UTC-07:00) Mountain Time - Arizona"},{Value:"America/Mazatlan",Text:"(UTC-07:00) Mountain Time - Chihuahua, Mazatlan"},{Value:"America/Dawson_Creek",Text:"(UTC-07:00) Mountain Time - Dawson Creek"},{Value:"America/Edmonton",Text:"(UTC-07:00) Mountain Time - Edmonton"},{Value:"America/Hermosillo",Text:"(UTC-07:00) Mountain Time - Hermosillo"},{Value:"America/Yellowknife",Text:"(UTC-07:00) Mountain Time - Yellowknife"},{Value:"America/Belize",Text:"(UTC-06:00) Belize"},{Value:"America/Chicago",Text:"(UTC-06:00) Central Time"},{Value:"America/Mexico_City",Text:"(UTC-06:00) Central Time - Mexico City"},{Value:"America/Regina",Text:"(UTC-06:00) Central Time - Regina"},{Value:"America/Tegucigalpa",Text:"(UTC-06:00) Central Time - Tegucigalpa"},{Value:"America/Winnipeg",Text:"(UTC-06:00) Central Time - Winnipeg"},{Value:"America/Costa_Rica",Text:"(UTC-06:00) Costa Rica"},{Value:"America/El_Salvador",Text:"(UTC-06:00) El Salvador"},{Value:"Pacific/Galapagos",Text:"(UTC-06:00) Galapagos"},{Value:"America/Guatemala",Text:"(UTC-06:00) Guatemala"},{Value:"America/Managua",Text:"(UTC-06:00) Managua"},{Value:"America/Cancun",Text:"(UTC-05:00) America Cancun"},{Value:"America/Bogota",Text:"(UTC-05:00) Bogota"},{Value:"Pacific/Easter",Text:"(UTC-05:00) Easter Island"},{Value:"America/New_York",Text:"(UTC-05:00) Eastern Time"},{Value:"America/Iqaluit",Text:"(UTC-05:00) Eastern Time - Iqaluit"},{Value:"America/Toronto",Text:"(UTC-05:00) Eastern Time - Toronto"},{Value:"America/Guayaquil",Text:"(UTC-05:00) Guayaquil"},{Value:"America/Havana",Text:"(UTC-05:00) Havana"},{Value:"America/Jamaica",Text:"(UTC-05:00) Jamaica"},{Value:"America/Lima",Text:"(UTC-05:00) Lima"},{Value:"America/Nassau",Text:"(UTC-05:00) Nassau"},{Value:"America/Panama",Text:"(UTC-05:00) Panama"},{Value:"America/Port-au-Prince",Text:"(UTC-05:00) Port-au-Prince"},{Value:"America/Rio_Branco",Text:"(UTC-05:00) Rio Branco"},{Value:"America/Halifax",Text:"(UTC-04:00) Atlantic Time - Halifax"},{Value:"America/Barbados",Text:"(UTC-04:00) Barbados"},{Value:"Atlantic/Bermuda",Text:"(UTC-04:00) Bermuda"},{Value:"America/Boa_Vista",Text:"(UTC-04:00) Boa Vista"},{Value:"America/Caracas",Text:"(UTC-04:00) Caracas"},{Value:"America/Curacao",Text:"(UTC-04:00) Curacao"},{Value:"America/Grand_Turk",Text:"(UTC-04:00) Grand Turk"},{Value:"America/Guyana",Text:"(UTC-04:00) Guyana"},{Value:"America/La_Paz",Text:"(UTC-04:00) La Paz"},{Value:"America/Manaus",Text:"(UTC-04:00) Manaus"},{Value:"America/Martinique",Text:"(UTC-04:00) Martinique"},{Value:"America/Port_of_Spain",Text:"(UTC-04:00) Port of Spain"},{Value:"America/Porto_Velho",Text:"(UTC-04:00) Porto Velho"},{Value:"America/Puerto_Rico",Text:"(UTC-04:00) Puerto Rico"},{Value:"America/Santo_Domingo",Text:"(UTC-04:00) Santo Domingo"},{Value:"America/Thule",Text:"(UTC-04:00) Thule"},{Value:"America/St_Johns",Text:"(UTC-03:30) Newfoundland Time - St. Johns"},{Value:"America/Araguaina",Text:"(UTC-03:00) Araguaina"},{Value:"America/Asuncion",Text:"(UTC-03:00) Asuncion"},{Value:"America/Belem",Text:"(UTC-03:00) Belem"},{Value:"America/Argentina/Buenos_Aires",Text:"(UTC-03:00) Buenos Aires"},{Value:"America/Campo_Grande",Text:"(UTC-03:00) Campo Grande"},{Value:"America/Cayenne",Text:"(UTC-03:00) Cayenne"},{Value:"America/Cuiaba",Text:"(UTC-03:00) Cuiaba"},{Value:"America/Fortaleza",Text:"(UTC-03:00) Fortaleza"},{Value:"America/Godthab",Text:"(UTC-03:00) Godthab"},{Value:"America/Maceio",Text:"(UTC-03:00) Maceio"},{Value:"America/Miquelon",Text:"(UTC-03:00) Miquelon"},{Value:"America/Montevideo",Text:"(UTC-03:00) Montevideo"},{Value:"Antarctica/Palmer",Text:"(UTC-03:00) Palmer"},{Value:"America/Paramaribo",Text:"(UTC-03:00) Paramaribo"},{Value:"America/Punta_Arenas",Text:"(UTC-03:00) Punta Arenas"},{Value:"America/Recife",Text:"(UTC-03:00) Recife"},{Value:"Antarctica/Rothera",Text:"(UTC-03:00) Rothera"},{Value:"America/Bahia",Text:"(UTC-03:00) Salvador"},{Value:"America/Santiago",Text:"(UTC-03:00) Santiago"},{Value:"Atlantic/Stanley",Text:"(UTC-03:00) Stanley"},{Value:"America/Noronha",Text:"(UTC-02:00) Noronha"},{Value:"America/Sao_Paulo",Text:"(UTC-02:00) Sao Paulo"},{Value:"Atlantic/South_Georgia",Text:"(UTC-02:00) South Georgia"},{Value:"Atlantic/Azores",Text:"(UTC-01:00) Azores"},{Value:"Atlantic/Cape_Verde",Text:"(UTC-01:00) Cape Verde"},{Value:"America/Scoresbysund",Text:"(UTC-01:00) Scoresbysund"},{Value:"Africa/Abidjan",Text:"(UTC+00:00) Abidjan"},{Value:"Africa/Accra",Text:"(UTC+00:00) Accra"},{Value:"Africa/Bissau",Text:"(UTC+00:00) Bissau"},{Value:"Atlantic/Canary",Text:"(UTC+00:00) Canary Islands"},{Value:"Africa/Casablanca",Text:"(UTC+00:00) Casablanca"},{Value:"America/Danmarkshavn",Text:"(UTC+00:00) Danmarkshavn"},{Value:"Europe/Dublin",Text:"(UTC+00:00) Dublin"},{Value:"Africa/El_Aaiun",Text:"(UTC+00:00) El Aaiun"},{Value:"Atlantic/Faroe",Text:"(UTC+00:00) Faeroe"},{Value:"Etc/UTC",Text:"(UTC+00:00) UTC (no daylight saving)"},{Value:"Europe/Lisbon",Text:"(UTC+00:00) Lisbon"},{Value:"Europe/London",Text:"(UTC+00:00) London"},{Value:"Africa/Monrovia",Text:"(UTC+00:00) Monrovia"},{Value:"Atlantic/Reykjavik",Text:"(UTC+00:00) Reykjavik"},{Value:"UTC",Text:"UTC"},{Value:"Africa/Algiers",Text:"(UTC+01:00) Algiers"},{Value:"Europe/Amsterdam",Text:"(UTC+01:00) Amsterdam"},{Value:"Europe/Andorra",Text:"(UTC+01:00) Andorra"},{Value:"Europe/Berlin",Text:"(UTC+01:00) Berlin"},{Value:"Europe/Brussels",Text:"(UTC+01:00) Brussels"},{Value:"Europe/Budapest",Text:"(UTC+01:00) Budapest"},{Value:"Europe/Belgrade",Text:"(UTC+01:00) Central European Time - Belgrade"},{Value:"Europe/Prague",Text:"(UTC+01:00) Central European Time - Prague"},{Value:"Africa/Ceuta",Text:"(UTC+01:00) Ceuta"},{Value:"Europe/Copenhagen",Text:"(UTC+01:00) Copenhagen"},{Value:"Europe/Gibraltar",Text:"(UTC+01:00) Gibraltar"},{Value:"Africa/Lagos",Text:"(UTC+01:00) Lagos"},{Value:"Europe/Luxembourg",Text:"(UTC+01:00) Luxembourg"},{Value:"Europe/Madrid",Text:"(UTC+01:00) Madrid"},{Value:"Europe/Malta",Text:"(UTC+01:00) Malta"},{Value:"Europe/Monaco",Text:"(UTC+01:00) Monaco"},{Value:"Africa/Ndjamena",Text:"(UTC+01:00) Ndjamena"},{Value:"Europe/Oslo",Text:"(UTC+01:00) Oslo"},{Value:"Europe/Paris",Text:"(UTC+01:00) Paris"},{Value:"Europe/Rome",Text:"(UTC+01:00) Rome"},{Value:"Europe/Stockholm",Text:"(UTC+01:00) Stockholm"},{Value:"Europe/Tirane",Text:"(UTC+01:00) Tirane"},{Value:"Africa/Tunis",Text:"(UTC+01:00) Tunis"},{Value:"Europe/Vienna",Text:"(UTC+01:00) Vienna"},{Value:"Europe/Warsaw",Text:"(UTC+01:00) Warsaw"},{Value:"Europe/Zurich",Text:"(UTC+01:00) Zurich"},{Value:"Asia/Amman",Text:"(UTC+02:00) Amman"},{Value:"Europe/Athens",Text:"(UTC+02:00) Athens"},{Value:"Asia/Beirut",Text:"(UTC+02:00) Beirut"},{Value:"Europe/Bucharest",Text:"(UTC+02:00) Bucharest"},{Value:"Africa/Cairo",Text:"(UTC+02:00) Cairo"},{Value:"Europe/Chisinau",Text:"(UTC+02:00) Chisinau"},{Value:"Asia/Damascus",Text:"(UTC+02:00) Damascus"},{Value:"Asia/Gaza",Text:"(UTC+02:00) Gaza"},{Value:"Europe/Helsinki",Text:"(UTC+02:00) Helsinki"},{Value:"Asia/Jerusalem",Text:"(UTC+02:00) Jerusalem"},{Value:"Africa/Johannesburg",Text:"(UTC+02:00) Johannesburg"},{Value:"Africa/Khartoum",Text:"(UTC+02:00) Khartoum"},{Value:"Europe/Kiev",Text:"(UTC+02:00) Kiev"},{Value:"Africa/Maputo",Text:"(UTC+02:00) Maputo"},{Value:"Europe/Kaliningrad",Text:"(UTC+02:00) Moscow-01 - Kaliningrad"},{Value:"Asia/Nicosia",Text:"(UTC+02:00) Nicosia"},{Value:"Europe/Riga",Text:"(UTC+02:00) Riga"},{Value:"Europe/Sofia",Text:"(UTC+02:00) Sofia"},{Value:"Europe/Tallinn",Text:"(UTC+02:00) Tallinn"},{Value:"Africa/Tripoli",Text:"(UTC+02:00) Tripoli"},{Value:"Europe/Vilnius",Text:"(UTC+02:00) Vilnius"},{Value:"Africa/Windhoek",Text:"(UTC+02:00) Windhoek"},{Value:"Asia/Baghdad",Text:"(UTC+03:00) Baghdad"},{Value:"Europe/Istanbul",Text:"(UTC+03:00) Istanbul"},{Value:"Europe/Minsk",Text:"(UTC+03:00) Minsk"},{Value:"Europe/Moscow",Text:"(UTC+03:00) Moscow+00 - Moscow"},{Value:"Africa/Nairobi",Text:"(UTC+03:00) Nairobi"},{Value:"Asia/Qatar",Text:"(UTC+03:00) Qatar"},{Value:"Asia/Riyadh",Text:"(UTC+03:00) Riyadh"},{Value:"Antarctica/Syowa",Text:"(UTC+03:00) Syowa"},{Value:"Asia/Tehran",Text:"(UTC+03:30) Tehran"},{Value:"Asia/Baku",Text:"(UTC+04:00) Baku"},{Value:"Asia/Dubai",Text:"(UTC+04:00) Dubai"},{Value:"Indian/Mahe",Text:"(UTC+04:00) Mahe"},{Value:"Indian/Mauritius",Text:"(UTC+04:00) Mauritius"},{Value:"Europe/Samara",Text:"(UTC+04:00) Moscow+01 - Samara"},{Value:"Indian/Reunion",Text:"(UTC+04:00) Reunion"},{Value:"Asia/Tbilisi",Text:"(UTC+04:00) Tbilisi"},{Value:"Asia/Yerevan",Text:"(UTC+04:00) Yerevan"},{Value:"Asia/Kabul",Text:"(UTC+04:30) Kabul"},{Value:"Asia/Aqtau",Text:"(UTC+05:00) Aqtau"},{Value:"Asia/Aqtobe",Text:"(UTC+05:00) Aqtobe"},{Value:"Asia/Ashgabat",Text:"(UTC+05:00) Ashgabat"},{Value:"Asia/Dushanbe",Text:"(UTC+05:00) Dushanbe"},{Value:"Asia/Karachi",Text:"(UTC+05:00) Karachi"},{Value:"Indian/Kerguelen",Text:"(UTC+05:00) Kerguelen"},{Value:"Indian/Maldives",Text:"(UTC+05:00) Maldives"},{Value:"Antarctica/Mawson",Text:"(UTC+05:00) Mawson"},{Value:"Asia/Yekaterinburg",Text:"(UTC+05:00) Moscow+02 - Yekaterinburg"},{Value:"Asia/Tashkent",Text:"(UTC+05:00) Tashkent"},{Value:"Asia/Colombo",Text:"(UTC+05:30) Colombo"},{Value:"Asia/Kolkata",Text:"(UTC+05:30) India Standard Time"},{Value:"Asia/Katmandu",Text:"(UTC+05:45) Katmandu"},{Value:"Asia/Almaty",Text:"(UTC+06:00) Almaty"},{Value:"Asia/Bishkek",Text:"(UTC+06:00) Bishkek"},{Value:"Indian/Chagos",Text:"(UTC+06:00) Chagos"},{Value:"Asia/Dhaka",Text:"(UTC+06:00) Dhaka"},{Value:"Asia/Omsk",Text:"(UTC+06:00) Moscow+03 - Omsk"},{Value:"Asia/Thimphu",Text:"(UTC+06:00) Thimphu"},{Value:"Antarctica/Vostok",Text:"(UTC+06:00) Vostok"},{Value:"Indian/Cocos",Text:"(UTC+06:30) Cocos"},{Value:"Asia/Yangon",Text:"(UTC+06:30) Rangoon"},{Value:"Asia/Bangkok",Text:"(UTC+07:00) Bangkok"},{Value:"Indian/Christmas",Text:"(UTC+07:00) Christmas"},{Value:"Antarctica/Davis",Text:"(UTC+07:00) Davis"},{Value:"Asia/Saigon",Text:"(UTC+07:00) Hanoi"},{Value:"Asia/Hovd",Text:"(UTC+07:00) Hovd"},{Value:"Asia/Jakarta",Text:"(UTC+07:00) Jakarta"},{Value:"Asia/Krasnoyarsk",Text:"(UTC+07:00) Moscow+04 - Krasnoyarsk"},{Value:"Asia/Brunei",Text:"(UTC+08:00) Brunei"},{Value:"Asia/Shanghai",Text:"(UTC+08:00) China Time - Beijing"},{Value:"Asia/Choibalsan",Text:"(UTC+08:00) Choibalsan"},{Value:"Asia/Hong_Kong",Text:"(UTC+08:00) Hong Kong"},{Value:"Asia/Kuala_Lumpur",Text:"(UTC+08:00) Kuala Lumpur"},{Value:"Asia/Macau",Text:"(UTC+08:00) Macau"},{Value:"Asia/Makassar",Text:"(UTC+08:00) Makassar"},{Value:"Asia/Manila",Text:"(UTC+08:00) Manila"},{Value:"Asia/Irkutsk",Text:"(UTC+08:00) Moscow+05 - Irkutsk"},{Value:"Asia/Singapore",Text:"(UTC+08:00) Singapore"},{Value:"Asia/Taipei",Text:"(UTC+08:00) Taipei"},{Value:"Asia/Ulaanbaatar",Text:"(UTC+08:00) Ulaanbaatar"},{Value:"Australia/Perth",Text:"(UTC+08:00) Western Time - Perth"},{Value:"Asia/Pyongyang",Text:"(UTC+08:30) Pyongyang"},{Value:"Asia/Dili",Text:"(UTC+09:00) Dili"},{Value:"Asia/Jayapura",Text:"(UTC+09:00) Jayapura"},{Value:"Asia/Yakutsk",Text:"(UTC+09:00) Moscow+06 - Yakutsk"},{Value:"Pacific/Palau",Text:"(UTC+09:00) Palau"},{Value:"Asia/Seoul",Text:"(UTC+09:00) Seoul"},{Value:"Asia/Tokyo",Text:"(UTC+09:00) Tokyo"},{Value:"Australia/Darwin",Text:"(UTC+09:30) Central Time - Darwin"},{Value:"Antarctica/DumontDUrville",Text:'(UTC+10:00) Dumont D"Urville'},{Value:"Australia/Brisbane",Text:"(UTC+10:00) Eastern Time - Brisbane"},{Value:"Pacific/Guam",Text:"(UTC+10:00) Guam"},{Value:"Asia/Vladivostok",Text:"(UTC+10:00) Moscow+07 - Vladivostok"},{Value:"Pacific/Port_Moresby",Text:"(UTC+10:00) Port Moresby"},{Value:"Pacific / Chuuk",Text:"(UTC+10:00) Truk"},{Value:"Australia/Adelaide",Text:"(UTC+10:30) Central Time - Adelaide"},{Value:"Antarctica/Casey",Text:"(UTC+11:00) Casey"},{Value:"Australia/Hobart",Text:"(UTC+11:00) Eastern Time - Hobart"},{Value:"Australia/Sydney",Text:"(UTC+11:00) Eastern Time - Melbourne, Sydney"},{Value:"Pacific/Efate",Text:"(UTC+11:00) Efate"},{Value:"Pacific/Guadalcanal",Text:"(UTC+11:00) Guadalcanal"},{Value:"Pacific/Kosrae",Text:"(UTC+11:00) Kosrae"},{Value:"Asia/Magadan",Text:"(UTC+11:00) Moscow+08 - Magadan"},{Value:"Pacific / Norfolk",Text:"(UTC+11:00) Norfolk"},{Value:"Pacific/Noumea",Text:"(UTC+11:00) Noumea"},{Value:"Pacific/Pohnpei",Text:"(UTC+11:00) Ponape"},{Value:"Pacific/Funafuti",Text:"(UTC+12:00) Funafuti"},{Value:"Pacific/Kwajalein",Text:"(UTC+12:00) Kwajalein"},{Value:"Pacific/Majuro",Text:"(UTC+12:00) Majuro"},{Value:"Asia/Kamchatka",Text:"(UTC+12:00) Moscow+09 - Petropavlovsk - Kamchatskiy"},{Value:"Pacific / Nauru",Text:"(UTC+12:00) Nauru"},{Value:"Pacific/Tarawa",Text:"(UTC+12:00) Tarawa"},{Value:"Pacific/Wake",Text:"(UTC+12:00) Wake"},{Value:"Pacific/Wallis",Text:"(UTC+12:00) Wallis"},{Value:"Pacific/Auckland",Text:"(UTC+13:00) Auckland"},{Value:"Pacific/Enderbury",Text:"(UTC+13:00) Enderbury"},{Value:"Pacific/Fakaofo",Text:"(UTC+13:00) Fakaofo"},{Value:"Pacific/Fiji",Text:"(UTC+13:00) Fiji"},{Value:"Pacific/Tongatapu",Text:"(UTC+13:00) Tongatapu"},{Value:"Pacific/Apia",Text:"(UTC+14:00) Apia"},{Value:"Pacific/Kiritimati",Text:"(UTC+14:00) Kiritimati"}],Dt={},bt=["SU","MO","TU","WE","TH","FR","SA"],Ct=["SU","MO","TU","WE","TH","FR","SA"],St=43,Ot=["first","second","third","fourth","last"],Et="summaryTimes",xt="summaryOn",Vt="every",At="summaryUntil",It="summaryDay",kt="summaryWeek",Mt="summaryMonth",Rt="summaryYear",Ht={SU:"sun",MO:"mon",TU:"tue",WE:"wed",TH:"thu",FR:"fri",SA:"sat"},Pt=/\d/,jt=/[^A-Z]+/,Nt=/[a-z]+|[^a-z]+/gi,Lt=function(){function e(e){this.slots=[],this.processedData=[],this.isDoubleTapped=!1,this.parent=e}return e.prototype.processData=function(e,i,n){var r=this,a=this.parent.activeView.startDate(),s=this.parent.activeView.endDate(),o=this.parent.eventFields,l=[],p=1,c=!1,h=this.parent.resourceBase?this.parent.resourceBase.resourceCollection:[];e.length>0&&t.isNullOrUndefined(e[0][o.id])&&(c=!0);for(var d=this,u=0,g=e;u<g.length;u++)!function(e){c&&(e[o.id]=p++),e=d.updateEventDateTime(e),i?d.processTimezoneChange(e,n):d.parent.isPrinting||d.parent.uiStateValues.isPreventTimezone||(e=d.processTimezone(e));for(var a=0;a<h.length;a++)null!==e[h[parseInt(a.toString(),10)].field]&&0!==e[h[parseInt(a.toString(),10)].field]||(e[h[parseInt(a.toString(),10)].field]=void 0);if(t.isNullOrUndefined(e[o.recurrenceRule])||""!==e[o.recurrenceRule]||(e[o.recurrenceRule]=null),t.isNullOrUndefined(e[o.recurrenceRule])||!t.isNullOrUndefined(e[o.recurrenceID])||d.parent.crudModule&&d.parent.crudModule.crudObj.isCrudAction)if(d.parent.crudModule&&d.parent.crudModule.crudObj.isCrudAction)if(!t.isNullOrUndefined(e[o.recurrenceRule])&&t.isNullOrUndefined(e[o.recurrenceID]))for(var s=0,u=d.generateOccurrence(e,null,!0);s<u.length;s++)!function(e){var t=d.parent.eventsProcessed.filter(function(t){return t[o.startTime].getTime()-e[o.startTime].getTime()==0&&t[o.id]===e[o.id]});e.Guid=t.length>0?t[0].Guid:d.generateGuid(),l.push(e)}(u[s]);else{var g=d.parent.eventsProcessed.filter(function(t){return t[r.parent.eventFields.id]===e[r.parent.eventFields.id]});e.Guid=g.length>0?g[0].Guid:d.generateGuid(),l.push(e)}else e.Guid=d.generateGuid(),l.push(e);else l=l.concat(d.generateOccurrence(e,null,!0))}(g[u]);this.parent.eventsProcessed=[];var v=l.filter(function(e){return!e[r.parent.eventFields.isBlock]});if(this.parent.eventsProcessed=this.filterEvents(a,s,v),!this.parent.activeViewOptions.allowOverlap&&this.parent.eventsProcessed.length>0){this.processedData=this.parent.eventsProcessed;for(var m=[],f=this.parent.eventFields,y=0,T=this.parent.eventsProcessed;y<T.length;y++){var w=T[y],D=this.findOverlappingData(w,m);if(D){if(!this.parent.eventSettings.sortComparer&&(new Date(w[f.endTime]).getTime()-new Date(w[f.startTime]).getTime()>new Date(D[f.endTime]).getTime()-new Date(D[f.startTime]).getTime()&&w[f.startTime]===D[f.startTime]||!0===w[f.isAllDay])){var C=m.indexOf(D);-1!==C&&m.splice(C,1),m.push(w)}}else m.push(w)}this.parent.eventsProcessed=m}for(var S=l.filter(function(e){return e[r.parent.eventFields.isBlock]}),E=0,x=S;E<x.length;E++){var V=x[E];V[o.isAllDay]&&(b(new Date(V[o.startTime].getTime()))<b(new Date(V[o.endTime].getTime()))||(V[o.startTime]=b(V[o.startTime]),V[o.endTime]=O(b(V[o.endTime]),1)))}return this.parent.blockProcessed=S,v},e.prototype.findOverlappingData=function(e,i){for(var n=this.parent.activeViewOptions.group.resources.length>0,r=n?this.parent.resourceBase.resourceCollection:[],a=n?r[r.length-1].field:null,s=this.parent.eventFields,o=new Date(e[s.startTime]),l=new Date(e[s.endTime]),p=0,c=i;p<c.length;p++){var h=c[p];if(o<h[s.endTime]&&l>h[s.startTime]&&h[s.id]!==e[s.id]&&(!n||t.isNullOrUndefined(a)||this.compareResourceValues(h[""+a],e[""+a])))return h}},e.prototype.isOverlapRange=function(e,i){var n=this;void 0===i&&(i=null);for(var r=this.parent.activeViewOptions.group.resources.length>0,a=r?this.parent.resourceBase.resourceCollection:[],s=r?a[a.length-1].field:null,o=Array.isArray(e)?e:[e],l=this.parent.eventFields,p=[],c=!1,h=0,d=o;h<d.length;h++)for(var u=d[h],g=0,v=t.isNullOrUndefined(u[l.recurrenceRule])||!t.isNullOrUndefined(u[l.recurrenceID])&&u[l.recurrenceID]!==u[l.id]||!t.isNullOrUndefined(u[l.recurrenceID])&&"EditSeries"!==i?[u]:this.generateOccurrence(u);g<v.length;g++){var m=v[g],f=function(e){return n.processedData.filter(function(i){return e[l.startTime]<i[l.endTime]&&e[l.endTime]>i[l.startTime]&&i[l.id]!==e[l.id]&&(!r||t.isNullOrUndefined(s)||n.compareResourceValues(i[""+s],e[""+s]))})}(m);f.length>0&&p.push.apply(p,f),this.findOverlappingData(m,this.parent.eventsProcessed)&&(c=!0)}return this.parent.overlapAppointments=p,c},e.prototype.compareResourceValues=function(e,t){var i=function(e){return Array.isArray(e)?e[0]:e};return i(e)===i(t)},e.prototype.checkOverlap=function(e){return!(this.parent.activeViewOptions.allowOverlap||!this.isOverlapRange(e))&&(this.parent.quickPopup.openValidationError("overlapAlert",e),!0)},e.prototype.updateEventDateTime=function(e){return"string"==typeof e[this.parent.eventFields.startTime]&&(e[this.parent.eventFields.startTime]=k(e[this.parent.eventFields.startTime])),"string"==typeof e[this.parent.eventFields.endTime]&&(e[this.parent.eventFields.endTime]=k(e[this.parent.eventFields.endTime])),e},e.prototype.getProcessedEvents=function(e){void 0===e&&(e=this.parent.eventsData);for(var i=[],n=0,r=e;n<r.length;n++){var a=r[n];!t.isNullOrUndefined(a[this.parent.eventFields.recurrenceRule])&&t.isNullOrUndefined(a[this.parent.eventFields.recurrenceID])?i=i.concat(this.generateOccurrence(a)):i.push(a)}return i},e.prototype.timezonePropertyChange=function(e){var t=this.parent.eventsData.concat(this.parent.blockData),i=this.processData(t,!0,e);this.parent.notify(_e,{processedData:i})},e.prototype.timezoneConvert=function(e){var t=this.parent.eventFields;if(e[t.startTimezone]=e[t.startTimezone]||e[t.endTimezone],e[t.endTimezone]=e[t.endTimezone]||e[t.startTimezone],this.parent.timezone){var i=e[t.startTimezone],n=e[t.endTimezone];e[t.startTime]=this.parent.tzModule.convert(e[t.startTime],this.parent.timezone,i),e[t.endTime]=this.parent.tzModule.convert(e[t.endTime],this.parent.timezone,n)}},e.prototype.processTimezoneChange=function(e,t){var i=this.parent.eventFields;e[i.isAllDay]||(t&&this.parent.timezone?(e[i.startTime]=this.parent.tzModule.convert(e[i.startTime],t,this.parent.timezone),e[i.endTime]=this.parent.tzModule.convert(e[i.endTime],t,this.parent.timezone)):!t&&this.parent.timezone?(e[i.startTime]=this.parent.tzModule.add(e[i.startTime],this.parent.timezone),e[i.endTime]=this.parent.tzModule.add(e[i.endTime],this.parent.timezone)):t&&!this.parent.timezone&&(e[i.startTime]=this.parent.tzModule.remove(e[i.startTime],t),e[i.endTime]=this.parent.tzModule.remove(e[i.endTime],t)))},e.prototype.processTimezone=function(e,t){void 0===t&&(t=!1);var i=this.parent.eventFields;if(e[i.isAllDay])return e;if(e[i.startTimezone]||e[i.endTimezone]){var n=e[i.startTimezone]||e[i.endTimezone],r=e[i.endTimezone]||e[i.startTimezone];t?this.parent.timezone?(e[i.startTime]=this.parent.tzModule.convert(e[i.startTime],n,this.parent.timezone),e[i.endTime]=this.parent.tzModule.convert(e[i.endTime],r,this.parent.timezone),e[i.startTime]=this.parent.tzModule.remove(e[i.startTime],this.parent.timezone),e[i.endTime]=this.parent.tzModule.remove(e[i.endTime],this.parent.timezone)):(e[i.startTime]=this.parent.tzModule.remove(e[i.startTime],n),e[i.endTime]=this.parent.tzModule.remove(e[i.endTime],r)):(e[i.startTime]=this.parent.tzModule.add(e[i.startTime],n),e[i.endTime]=this.parent.tzModule.add(e[i.endTime],r),this.parent.timezone&&(e[i.startTime]=this.parent.tzModule.convert(e[i.startTime],n,this.parent.timezone),e[i.endTime]=this.parent.tzModule.convert(e[i.endTime],r,this.parent.timezone)))}else this.parent.timezone&&(t?(e[i.startTime]=this.parent.tzModule.remove(e[i.startTime],this.parent.timezone),e[i.endTime]=this.parent.tzModule.remove(e[i.endTime],this.parent.timezone)):(e[i.startTime]=this.parent.tzModule.add(e[i.startTime],this.parent.timezone),e[i.endTime]=this.parent.tzModule.add(e[i.endTime],this.parent.timezone)));return e},e.prototype.filterBlockEvents=function(e){var i,n=this.parent.eventFields,r=e[n.startTime],a=e[n.endTime];if(this.parent.activeViewOptions.group.resources.length>0){var s=this.getGroupIndexFromEvent(e);i=this.parent.resourceBase.lastResourceLevel[parseInt(s.toString(),10)]}for(var o=t.extend([],this.parent.blockProcessed,null,!0),l=0,p=o;l<p.length;l++){var c=p[l];c[n.isAllDay]&&c[n.endTime].getTime()>b(new Date(c[n.endTime].getTime())).getTime()&&(c[n.startTime]=b(c[n.startTime]),c[n.endTime]=O(b(c[n.endTime]),1))}return this.filterEvents(r,a,o,i)},e.prototype.filterEvents=function(e,t,i,n){void 0===i&&(i=this.parent.eventsProcessed);var r=this.parent.dataModule.getStartEndQuery(e,t),s=new a.DataManager({json:i}).executeLocal((new a.Query).where(r));return n&&(s=this.filterEventsByResource(n,s)),this.sortByTime(s)},e.prototype.filterEventsByRange=function(e,t,i){var n=this,r=[];return r=t&&i?this.filterEvents(t,i,e):t&&!i?e.filter(function(e){return e[n.parent.eventFields.startTime]>=t}):!t&&i?e.filter(function(e){return e[n.parent.eventFields.endTime]<=i}):e,this.sortByTime(r)},e.prototype.filterEventsByResource=function(e,t){void 0===t&&(t=this.parent.eventsProcessed);for(var i={},n=this.parent.resourceBase.resourceCollection,r=0;r<n.length;r++)i[n[parseInt(r.toString(),10)].field]=e.groupOrder[parseInt(r.toString(),10)];var a=Object.keys(i);return t.filter(function(e){return a.every(function(t){return e[""+t]instanceof Array?e[""+t].indexOf(i[""+t])>-1:e[""+t]===i[""+t]})})},e.prototype.sortByTime=function(e){if(!this.parent.eventSettings.sortComparer||"function"!=typeof this.parent.eventSettings.sortComparer&&"string"!=typeof this.parent.eventSettings.sortComparer){var t=this.parent.eventFields;e.sort(function(e,i){var n=e[t.startTime],r=i[t.startTime];return n.getTime()-r.getTime()})}else e=this.customSorting(e);return e},e.prototype.sortByDateTime=function(e){if(!this.parent.eventSettings.sortComparer||"function"!=typeof this.parent.eventSettings.sortComparer&&"string"!=typeof this.parent.eventSettings.sortComparer){var t=this.parent.eventFields;e.sort(function(e,i){var n=e[t.startTime],r=i[t.startTime],a=e[t.endTime],s=i[t.endTime],o=a.getTime()-n.getTime(),l=s.getTime()-r.getTime();return n.getTime()-r.getTime()||l-o})}else e=this.customSorting(e);return e},e.prototype.customSorting=function(e){if("function"==typeof this.parent.eventSettings.sortComparer)return this.parent.eventSettings.sortComparer.call(this.parent,e);if("string"==typeof this.parent.eventSettings.sortComparer){var i=this.parent.eventSettings.sortComparer.split("."),n=void 0;if(t.isNullOrUndefined(window)||(n=window[i[i.length-1]]),n)return n(e)}return e},e.prototype.getSmallestMissingNumber=function(e){for(var t=Math.max.apply(Math,e),i=0;i<t;i++)if(-1===e.indexOf(i))return i;return t+1},e.prototype.splitEventByDay=function(e){var i=this.parent.eventFields,n=[],r=e[i.startTime],a=e[i.endTime];if(b(new Date(r.getTime()))<b(new Date(a.getTime())))for(var s=new Date(r.getTime()),o=O(b(new Date(r.getTime())),1),l=0===a.getHours()&&0===a.getMinutes()?a:O(a,1),p=1,c=I(r.getTime(),l.getTime());o<=a&&s.getTime()!==o.getTime();){var h=t.extend({},e);h[i.startTime]=s,h[i.endTime]=o,h.data={index:p,count:c},h.Guid=this.generateGuid(),h.isSpanned=!0,n.push(h),s=o,b(new Date(s.getTime())).getTime()===b(new Date(a.getTime())).getTime()&&o.getTime()!==a.getTime()?(o=new Date(s.getTime()),o=new Date(o.setHours(a.getHours(),a.getMinutes(),a.getSeconds()))):o=O(b(new Date(s.getTime())),1),p++}else n.push(e);return n},e.prototype.splitEvent=function(e,i){var n=this.parent.eventFields,r=b(e[n.startTime]).getTime(),a=b(e[n.endTime]).getTime();C(e[n.endTime])<=0&&(a=r>(w=O(b(e[n.endTime]),-1).getTime())?r:w);var s=r,o=a,l=[];if(r!==a){r<i[0].getTime()&&(r=i[0].getTime()),a>i[i.length-1].getTime()&&(a=i[i.length-1].getTime());for(var p=r,c=0;c<this.slots.length;c++){var h=this.slots[parseInt(c.toString(),10)];if("WorkWeek"===this.parent.currentView||"TimelineWorkWeek"===this.parent.currentView||this.parent.activeViewOptions.group.byDate||this.parent.activeViewOptions.showWeekend){for(var d=[],u=0,g=h;u<g.length;u++){var v=g[u];d.push(new Date(v))}var m=this.getRenderedDates(d);if(!t.isNullOrUndefined(m)&&m.length>0){h=[];for(var f=0,y=m;f<y.length;f++){var T=y[f];h.push(T.getTime())}}}if("number"==typeof h){var w=h;(h=[]).push(w)}var D=h[0];if((p=p<=D&&a>=D?D:p)>a||D>a)break;if(!this.parent.activeViewOptions.group.byDate&&this.parent.activeViewOptions.showWeekend&&"WorkWeek"!==this.parent.currentView&&"TimelineWorkWeek"!==this.parent.currentView){var S=h.indexOf(p);if(-1!==S){var E=h.indexOf(a),x=-1!==E,V=(E=x?E:h.length-1)-S+1,A=h[parseInt(S.toString(),10)]!==s,I=h[parseInt(E.toString(),10)]!==o;if(l.push(this.cloneEventObject(e,h[parseInt(S.toString(),10)],h[parseInt(E.toString(),10)],V,A,I)),x)break}}else if(this.dateInRange(p,h[0],h[h.length-1])){for(var k=[],M=0;M<h.length;M++)this.dateInRange(h[parseInt(M.toString(),10)],s,o)&&k.push(h[parseInt(M.toString(),10)]);if(k.length>0)if(this.parent.activeViewOptions.group.byDate)for(var R=0,H=k;R<H.length;R++){var P=H[R];l.push(this.cloneEventObject(e,P,P,1,P!==s,P!==o))}else{var A=k[0]!==s,I=k[k.length-1]!==o;l.push(this.cloneEventObject(e,k[0],k[k.length-1],k.length,A,I))}}}}else l.push(this.cloneEventObject(e,r,a,1,!1,!1));return l},e.prototype.cloneEventObject=function(e,i,n,r,a,s){var o=this.parent.eventFields,l=t.extend({},e,null,!0),p={count:r,isLeft:a,isRight:s};return p[o.startTime]=e[o.startTime],p[o.endTime]=e[o.endTime],l.data=p,l[o.startTime]=new Date(i),l[o.endTime]=new Date(n),l},e.prototype.dateInRange=function(e,t,i){return t<=e&&e<=i},e.prototype.getSelectedEventElements=function(e){if(this.removeSelectedAppointmentClass(),this.parent.selectedElements.length<=0)this.parent.selectedElements.push(e);else if(this.parent.selectedElements.filter(function(t){return t.getAttribute("data-guid")===e.getAttribute("data-guid")}).length<=0)for(var t='div[data-guid="'+e.getAttribute("data-guid")+'"]',i=0,n=[].slice.call(this.parent.element.querySelectorAll(t));i<n.length;i++){var r=n[i];this.parent.selectedElements.push(r)}else{var a=this.parent.selectedElements.filter(function(t){return t.getAttribute("data-guid")!==e.getAttribute("data-guid")});this.parent.selectedElements=a}return e&&this.parent.selectedElements.length>0&&this.addSelectedAppointments(this.parent.selectedElements,!1),this.parent.selectedElements},e.prototype.getSelectedEvents=function(){var e=this,t=[],i=[];return[].slice.call(this.parent.element.querySelectorAll(".e-appointment-border")).filter(function(n){0===t.filter(function(e){return e.Guid===n.getAttribute("data-guid")}).length&&t.push(e.getEventByGuid(n.getAttribute("data-guid"))),i.push(n)}),{event:t.length>1?t:t[0],element:i.length>1?i:i[0]}},e.prototype.removeSelectedAppointmentClass=function(){var e=this.getSelectedAppointments();t.removeClass(e,"e-appointment-border"),"Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||t.removeClass(e,"e-active-appointment-agenda")},e.prototype.addSelectedAppointments=function(e,i){"MonthAgenda"!==this.parent.currentView&&this.parent.removeSelectedClass(),t.addClass(e,"e-appointment-border"),e.length>0&&!i&&e[e.length-1].focus()},e.prototype.getSelectedAppointments=function(){return[].slice.call(this.parent.element.querySelectorAll(".e-appointment-border,.e-appointment:focus"))},e.prototype.focusElement=function(e){if(!this.parent.eventWindow.dialogObject||!this.parent.eventWindow.dialogObject.visible){var i=document.activeElement,n=this.parent.getSelectedCells();if(!(n.length>0&&(i&&(this.parent.element.contains(i)||-1!==n.indexOf(i))||e))){var r=this.getSelectedAppointments();return r.length>0?this.parent.activeEventData&&this.parent.activeEventData.element&&r.indexOf(this.parent.activeEventData.element)>-1?void this.parent.activeEventData.element.focus():void r[r.length-1].focus():void 0}if(this.parent.keyboardInteractionModule){var a=!t.isNullOrUndefined(this.parent.activeCellsData)&&this.parent.activeCellsData.element||n[n.length-1];this.parent.keyboardInteractionModule.selectCells(a instanceof Array,a)}}},e.prototype.selectWorkCellByTime=function(e){var i;if("Agenda"===this.parent.currentView||"MonthAgenda"===this.parent.currentView)return i;if(e.length>0){var n=e[e.length-1],r=n[this.parent.eventFields.startTime],a=void 0,s=this.isAllDayAppointment(n);a="Month"===this.parent.currentView||s||!this.parent.activeViewOptions.timeScale.enable?new Date(+r).setHours(0,0,0,0):this.findNearestSlot(r);var o=void 0;o=s&&-1!==["Day","Week","WorkWeek"].indexOf(this.parent.currentView)?this.parent.getAllDayRow():this.parent.getContentTable();var l='[data-date="'+new Date(a).getTime()+'"]';if(!t.isNullOrUndefined(this.parent.activeViewOptions.group.resources)&&this.parent.activeViewOptions.group.resources.length>0&&(l+='[data-group-index="'+this.getGroupIndexFromEvent(n)+'"]'),i=o.querySelector(l))return this.parent.activeCellsData=this.parent.getCellDetails(i),this.parent.keyboardInteractionModule&&this.parent.keyboardInteractionModule.selectCells(!1,i),i}return i},e.prototype.findNearestSlot=function(e){var t=this.parent.activeViewOptions.timeScale.interval*Ke/this.parent.activeViewOptions.timeScale.slotCount,i=Math.round(Qe/t),n=new Date(e);n.setHours(0,0,0,0);var r=Array.from({length:i},function(e,i){return new Date(n.getTime()+i*t)}).reduce(function(t,i){var n=Math.abs(e.getTime()-i.getTime());return!t||n<Math.abs(e.getTime()-t.getTime())?i:t},null);return 1e3*Math.trunc(r.getTime()/1e3)},e.prototype.getGroupIndexFromEvent=function(e){for(var i,n,r,a,s=this.parent.resourceBase.resourceCollection.length-1;s>=0;s--){var o=e[this.parent.resourceBase.resourceCollection[parseInt(s.toString(),10)].field];if(!t.isNullOrUndefined(o)){n=this.parent.resourceBase.resourceCollection[parseInt(s.toString(),10)],i=s,r=n.name,a=n.field;break}}t.isNullOrUndefined(r)&&t.isNullOrUndefined(i)&&(r=this.parent.resourceCollection.slice(-1)[0].name,i=this.parent.resourceCollection.length-1,a=this.parent.resourceCollection.slice(-1)[0].field,n=this.parent.resourceCollection.filter(function(e,t){return e.name===r?(i=t,e):null})[0]);var l=e[""+a]instanceof Array?e[""+a][0]:e[""+a];if(i>0){var p=this.parent.resourceCollection[i-1].field;return this.parent.resourceBase.getIndexFromResourceId(l,r,n,e,p)}return this.parent.resourceBase.getIndexFromResourceId(l,r,n)},e.prototype.isAllDayAppointment=function(e){var t=this.parent.eventFields,i=e[t.isAllDay],n=(L(e[t.endTime])-L(e[t.startTime]))/Qe>=1;return!!(i||"TimeSlot"!==this.parent.eventSettings.spannedEventPlacement&&n)},e.prototype.addEventListener=function(){this.parent.on("document-click",this.appointmentBorderRemove,this)},e.prototype.removeEventListener=function(){this.parent.off("document-click",this.appointmentBorderRemove)},e.prototype.appointmentBorderRemove=function(e){var i=e.event.target;if(t.closest(i,".e-appointment"))"MonthAgenda"!==this.parent.currentView&&this.parent.removeSelectedClass();else if(!t.closest(i,"."+rt)){if(this.parent.uiStateValues.isTapHold&&t.closest(i,".e-work-cells,.e-all-day-cells"))return;this.parent.uiStateValues.isTapHold=!1,this.removeSelectedAppointmentClass(),this.parent.selectedElements=[]}},e.prototype.wireAppointmentEvents=function(e,i,n){void 0===n&&(n=!1);var r=!t.isNullOrUndefined(i)&&i[this.parent.eventFields.isReadonly];t.EventHandler.add(e,"click",this.eventClick,this),this.parent.isAdaptive||this.parent.activeViewOptions.readonly||r||(t.EventHandler.add(e,"touchend",this.eventTouchClick,this),t.EventHandler.add(e,"dblclick",this.eventDoubleClick,this)),this.parent.activeViewOptions.readonly||r||n||(this.parent.resizeModule&&this.parent.resizeModule.wireResizeEvent(e),this.parent.dragAndDropModule&&this.parent.dragAndDropModule.wireDragEvent(e))},e.prototype.eventTouchClick=function(e){var t=this;if(this.parent.uiStateValues.isTouchScroll||this.parent.uiStateValues.isTapHold||this.parent.uiStateValues.action)return void(this.parent.uiStateValues.isTouchScroll=this.parent.uiStateValues.isTapHold=!1);setTimeout(function(){return t.isDoubleTapped=!1},250),e.preventDefault(),this.isDoubleTapped?this.eventDoubleClick(e):this.isDoubleTapped||(this.isDoubleTapped=!0,this.eventClick(e))},e.prototype.renderResizeHandler=function(e,i,n){if(this.parent.resizeModule&&this.parent.allowResizing&&!this.parent.activeViewOptions.readonly&&!n)for(var r=0,a=Object.keys(i);r<a.length;r++){var s=a[r],o=t.createElement("div",{className:"e-event-resize"});switch(s){case"isLeft":i.isLeft||(o.appendChild(t.createElement("div",{className:"e-left-right-resize"})),t.addClass([o],this.parent.enableRtl?"e-right-handler":"e-left-handler"),t.prepend([o],e));break;case"isRight":i.isRight||(o.appendChild(t.createElement("div",{className:"e-left-right-resize"})),t.addClass([o],this.parent.enableRtl?"e-left-handler":"e-right-handler"),t.append([o],e));break;case"isTop":i.isTop||(o.appendChild(t.createElement("div",{className:"e-top-bottom-resize"})),t.addClass([o],"e-top-handler"),t.prepend([o],e));break;case"isBottom":i.isBottom||(o.appendChild(t.createElement("div",{className:"e-top-bottom-resize"})),t.addClass([o],"e-bottom-handler"),t.append([o],e))}}},e.prototype.eventClick=function(e){var i=this,n=e.target;if(!(n.classList.contains("e-drag-clone")||n.classList.contains("e-resize-clone")||n.classList.contains("e-inline-subject")))if((e.ctrlKey||e.metaKey)&&1===e.which&&this.parent.keyboardInteractionModule){this.parent.quickPopup.quickPopup.hide(),this.parent.selectedElements=[].slice.call(this.parent.element.querySelectorAll(".e-appointment-border"));var r=t.closest(e.target,".e-appointment");this.getSelectedEventElements(r),this.activeEventData(e,!1);var a={data:this.parent.activeEventData.event,element:this.parent.activeEventData.element,event:e,requestType:"eventSelect"};this.parent.trigger("select",a);o=t.extend(this.parent.activeEventData,{cancel:!1,originalEvent:e});this.parent.trigger("eventClick",o)}else{this.removeSelectedAppointmentClass(),this.activeEventData(e,!0);var s={data:this.parent.activeEventData.event,element:this.parent.activeEventData.element,event:e,requestType:"eventSelect"};this.parent.trigger("select",s);var o=t.extend(this.parent.activeEventData,{cancel:!1,originalEvent:e});this.parent.trigger("eventClick",o,function(e){if(e.cancel)i.removeSelectedAppointmentClass(),i.parent.selectedElements=[],i.parent.quickPopup&&i.parent.quickPopup.quickPopupHide();else if("Agenda"!==i.parent.currentView&&"MonthAgenda"!==i.parent.currentView||t.addClass([i.parent.activeEventData.element],"e-active-appointment-agenda"),i.parent.allowInline){var n={data:e.event,element:e.element,type:"Event"};i.parent.notify(Ye,n)}else i.parent.notify("eventClick",e)})}},e.prototype.eventDoubleClick=function(e){var i=this;if(this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(!0),"touchend"===e.type&&this.activeEventData(e,!0),this.removeSelectedAppointmentClass(),this.parent.selectedElements=[],!this.parent.activeEventData.element.classList.contains("e-inline-appointment")&&!this.parent.activeEventData.element.querySelector(".e-inline-subject")){var n=t.extend(this.parent.activeEventData,{cancel:!1,originalEvent:e});this.parent.trigger("eventDoubleClick",n,function(e){!e.cancel&&i.parent.eventSettings.allowEditing&&(!t.isNullOrUndefined(i.parent.activeEventData.event)&&t.isNullOrUndefined(i.parent.activeEventData.event[i.parent.eventFields.recurrenceID])?i.parent.eventWindow.openEditor(i.parent.activeEventData.event,"Save"):(i.parent.currentAction="EditOccurrence",i.parent.quickPopup.openRecurrenceAlert()))})}},e.prototype.getEventByGuid=function(e){return this.parent.eventsProcessed.filter(function(t){return t.Guid===e})[0]},e.prototype.getEventById=function(e){var t=this;return this.parent.eventsData.filter(function(i){return i[t.parent.eventFields.id]===e})[0]},e.prototype.generateGuid=function(){var e=new Uint8Array(32);window.crypto.getRandomValues(e);var t=0;return"xyxxxxyx-xxxy-yxxx-xyxx-xxyxxxxyyxxx".replace(/[xy]/g,function(i){var n=15&e[t++];return("x"===i?n:3&n|8).toString(16)})},e.prototype.getEventIDType=function(){return 0!==this.parent.eventsData.length?typeof this.parent.eventsData[0][this.parent.eventFields.id]:0!==this.parent.blockData.length?typeof this.parent.blockData[0][this.parent.eventFields.id]:"string"},e.prototype.getEventMaxID=function(e){var i=this;if(this.parent.eventsData.length<1&&this.parent.blockData.length<1)return 1;var n,r=this.getEventIDType();if("string"===r&&(n=this.generateGuid()),"number"===r){var a=this.parent.eventsData.concat(this.parent.blockData).map(function(e){return e[i.parent.eventFields.id]}).reduce(function(e,t){return Math.max(e,t)});n=(a=t.isNullOrUndefined(e)?a:a+e)+1}return n},e.prototype.activeEventData=function(e,i){var n=this,r=t.closest(e.target,".e-appointment"),a=r.getAttribute("data-guid");i&&(this.addSelectedAppointments([].slice.call(this.parent.element.querySelectorAll('div[data-guid="'+a+'"]')),!0),r.focus());var s=this.getEventByGuid(a);s&&s.isSpanned&&(s=this.parent.eventsData.filter(function(e){return e[n.parent.eventFields.id]===s[n.parent.eventFields.id]})[0]),this.parent.activeEventData={event:s,element:r}},e.prototype.generateOccurrence=function(e,i,n){var r=this,a=e[this.parent.eventFields.startTime],s=e[this.parent.eventFields.endTime],o=e[this.parent.eventFields.recurrenceRule],l=s.getTimezoneOffset()-a.getTimezoneOffset(),p=s.getTime()-a.getTime()-6e4*l;i=new Date((i||this.parent.activeView.startDate()).getTime()-p);var c,h=e[this.parent.eventFields.recurrenceException];"Agenda"!==this.parent.currentView&&n&&(c=S(i,this.parent.activeView.endDate())+1);var d=this.parent.timezone||this.parent.tzModule.getLocalTimezoneName(),u=this.parent.activeViewOptions.firstDayOfWeek,g=this.parent.calendarMode;e[this.parent.eventFields.recurrenceRule]&&this.isDayBasedRecurrence(e)&&this.parent.timezone&&e[this.parent.eventFields.startTimezone]&&e[this.parent.eventFields.endTimezone]&&(a=this.parent.tzModule.convert(e[this.parent.eventFields.startTime],this.parent.timezone,e[this.parent.eventFields.startTimezone]));var v=G(a,o,h,u,c,i,g,d);"Agenda"===this.parent.currentView&&-1===o.indexOf("COUNT")&&-1===o.indexOf("UNTIL")&&(t.isNullOrUndefined(e.generatedDates)?e.generatedDates={start:new Date(v[0]),end:new Date(v[v.length-1])}:(v[0]<e.generatedDates.start.getTime()&&(e.generatedDates.start=new Date(v[0])),v[v.length-1]>e.generatedDates.end.getTime()&&(e.generatedDates.end=new Date(v[v.length-1]))));var m=!1,f=[];e[this.parent.eventFields.recurrenceRule]&&this.isDayBasedRecurrence(e)&&this.parent.timezone&&e[this.parent.eventFields.startTimezone]&&e[this.parent.eventFields.endTimezone]&&(m=!0,f.push.apply(f,v.map(function(t){return r.parent.tzModule.convert(new Date(t),e[r.parent.eventFields.startTimezone],r.parent.timezone).getTime()})));for(var y=[],T=0,w=f=f.length>0?f:v;T<w.length;T++){var D=w[T],b=t.extend({},e,null,!0);D=m?D:this.getDSTAdjustedTime(D,b),b[this.parent.eventFields.startTime]=new Date(D),b[this.parent.eventFields.endTime]=new Date(new Date(D).setMilliseconds(p)),b[this.parent.eventFields.recurrenceID]=b[this.parent.eventFields.id],delete b[this.parent.eventFields.recurrenceException],delete b[this.parent.eventFields.followingID],b.Guid=this.generateGuid(),y.push(b)}return y},e.prototype.isDayBasedRecurrence=function(e){return e[this.parent.eventFields.recurrenceRule].includes("BYMONTHDAY")||e[this.parent.eventFields.recurrenceRule].includes("BYDAY")},e.prototype.getDSTAdjustedTime=function(e,t){var i=e;if(this.parent.timezone&&(t[this.parent.eventFields.startTimezone]||t[this.parent.eventFields.endTimezone])){var n=this.getDSTDiff(t[this.parent.eventFields.startTime],new Date(e),t[this.parent.eventFields.startTimezone]),r=this.getDSTDiff(t[this.parent.eventFields.startTime],new Date(e),this.parent.timezone);i=new Date(e).getTime()-6e4*(n-r)}return i},e.prototype.getDSTDiff=function(e,t,i){return this.parent.tzModule.offset(new Date(e),i)-this.parent.tzModule.offset(new Date(t),i)},e.prototype.getParentEvent=function(e,i){void 0===i&&(i=!1);var n;do{(e=this.getFollowingEvent(e))&&(n=t.extend({},e,null,!0))}while(e&&i);if(i&&n){var r=this.getEventCollections(n),a=r.follow.slice(-1)[0];r.occurrence.length>0&&!n[this.parent.eventFields.recurrenceException]&&(a=r.occurrence.slice(-1)[0]),a&&(n[this.parent.eventFields.recurrenceRule]=a[this.parent.eventFields.recurrenceRule])}return n},e.prototype.getEventCollections=function(e,t){var i=[],n=[],r=e;do{(r=this.getFollowingEvent(r,!0))&&i.push(r),n=n.concat(this.getOccurrenceEvent(r||e))}while(r);var a={};if(t){var s=this.parent.eventFields;a={follow:i.filter(function(e){return e[s.startTime]>=t[s.startTime]}),occurrence:n.filter(function(e){return e[s.startTime]>=t[s.startTime]})}}else a={follow:i,occurrence:n};return a},e.prototype.getFollowingEvent=function(e,t){var i,n=this.parent.eventFields;return i=t?e[n.id]:e[n.recurrenceID]||e[n.followingID],this.parent.eventsData.filter(function(e){return e[t?n.followingID:n.id]===i}).shift()},e.prototype.isFollowingEvent=function(e,t){var i=e[this.parent.eventFields.startTime],n=t[this.parent.eventFields.startTime];return i.getHours()===n.getHours()&&i.getMinutes()===n.getMinutes()&&i.getSeconds()===n.getSeconds()},e.prototype.getOccurrenceEvent=function(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=!1);var n=t?"Guid":i?this.parent.eventFields.followingID:this.parent.eventFields.recurrenceID,r=t?"Guid":this.parent.eventFields.id;return(t?this.parent.eventsProcessed:this.parent.eventsData).filter(function(t){return t[""+n]===e[""+r]})},e.prototype.getOccurrencesByID=function(e){for(var i=this.parent.eventFields,n=[],r=0,a=this.parent.eventsData.filter(function(t){return t[i.id]===e});r<a.length;r++){var s=a[r];t.isNullOrUndefined(s[i.recurrenceRule])||(n=n.concat(this.generateOccurrence(s)))}return n},e.prototype.getOccurrencesByRange=function(e,i){for(var n=this.parent.eventFields,r=[],a=0,s=this.parent.eventsData;a<s.length;a++){var o=s[a];t.isNullOrUndefined(o[n.recurrenceRule])||(r=r.concat(this.generateOccurrence(o)))}return r.filter(function(r){return r[n.startTime]>=e&&r[n.endTime]<=i&&!t.isNullOrUndefined(r[n.recurrenceID])})},e.prototype.getDeletedOccurrences=function(e){var i,n=this.parent.eventFields,r=[];if((i="string"==typeof e||"number"==typeof e?this.parent.eventsData.filter(function(t){return t[n.id]===e})[0]:t.extend({},e,null,!0))[n.recurrenceException])for(var a=i[n.recurrenceException].split(","),s=this,o=0,l=a.length;o<l;o++)!function(o,l){if(0===s.parent.eventsData.filter(function(e){return e[n.recurrenceID]===i[n.id]&&e[n.recurrenceException]===a[parseInt(o.toString(),10)]}).length){var p=X(a[parseInt(o.toString(),10)]),c=t.extend({},e,null,!0);c[n.recurrenceID]=i[n.id],delete c[n.followingID],c[n.recurrenceException]=a[parseInt(o.toString(),10)];var h=new Date(p.getTime()),d=i[n.endTime].getTime()-i[n.startTime].getTime(),u=new Date(h.getTime());u.setMilliseconds(d),c[n.startTime]=new Date(h.getTime()),c[n.endTime]=new Date(u.getTime()),r.push(c)}}(o);return r},e.prototype.applyResourceColor=function(e,i,n,r,a){if(this.parent.resourceBase){var s=this.parent.resourceBase.getResourceColor(i,r);s&&(e.style[n]=t.isNullOrUndefined(a)?s:function(e,t){return e=e.replace("#",""),"rgba("+parseInt(e.substring(0,e.length/3),16)+", "+parseInt(e.substring(e.length/3,2*e.length/3),16)+", "+parseInt(e.substring(2*e.length/3,3*e.length/3),16)+", "+t+")"}(s,a))}},e.prototype.createBlockAppointmentElement=function(e,i,n){var r,a=e[this.parent.eventFields.subject]||this.parent.eventSettings.fields.subject.default,s=t.createElement("div",{className:"e-block-appointment",attrs:{"data-id":"Appointment_"+e[this.parent.eventFields.id],"aria-disabled":"true"}});if(t.isNullOrUndefined(this.parent.activeViewOptions.eventTemplate)){var o=t.createElement("div",{className:"e-subject"});this.parent.sanitize(a,o),r=[o]}else{var l=this.parent.element.id+"_"+this.parent.activeViewOptions.eventTemplateName+"eventTemplate",p=n&&-1===this.parent.currentView.indexOf("Year")?this.parent.getEventTemplateName(i):"eventTemplate";r=this.parent.getAppointmentTemplate()(e,this.parent,p,l,!1,void 0,void 0,this.parent.root)}return t.append(r,s),this.setWrapperAttributes(s,i),s},e.prototype.setWrapperAttributes=function(e,i){t.isNullOrUndefined(this.cssClass)||t.addClass([e],this.cssClass),this.parent.activeViewOptions.group.resources.length>0&&e.setAttribute("data-group-index",i.toString())},e.prototype.getReadonlyAttribute=function(e){return(e[this.parent.eventFields.isReadonly]||this.parent.readonly).toString()},e.prototype.isBlockRange=function(e){for(var i=e instanceof Array?e:[e],n=!1,r=this.parent.eventFields,a=0,s=i;a<s.length;a++){var o=s[a],l=[];t.isNullOrUndefined(o[r.recurrenceRule])||!t.isNullOrUndefined(o[r.recurrenceID])&&o[r.id]!==o[r.recurrenceID]?l.push(o):l=this.generateOccurrence(o);for(var p=0,c=l;p<c.length;p++){var h=c[p];if(this.filterBlockEvents(h).length>0){n=!0;break}}}return this.parent.uiStateValues.isBlock=n,n},e.prototype.getFilterEventsList=function(e,t){return new a.DataManager(e).executeLocal((new a.Query).where(t))},e.prototype.getSeriesEvents=function(e,i){var n=this.parent.eventFields;i=t.isNullOrUndefined(i)?e[n.startTime]:i;var r,s,o,l=[],p=e[n.id],c=e[n.followingID],h="EditSeries"===this.parent.currentAction?"greaterthan":"greaterthanorequal";do{o=new a.Predicate(n.followingID,"equal",p).and(new a.Predicate(n.startTime,h,i)),r=(s=this.getFilterEventsList(this.parent.eventsData,o)).slice(-1)[0],t.isNullOrUndefined(r)||r[n.id]===c?c=null:(l.push(r),p=r[n.id],c=r[n.followingID])}while(1===s.length&&!t.isNullOrUndefined(r[n.followingID]));return l},e.prototype.getEditedOccurrences=function(e,t){for(var i,n=this.parent.eventFields,r=[],s=0,o=e;s<o.length;s++){var l=o[s],p=new a.Predicate(n.recurrenceID,"equal",l[n.id]).or(new a.Predicate(n.recurrenceID,"equal",l[n.followingID]).and(new a.Predicate(n.recurrenceID,"notequal",void 0)).and(new a.Predicate(n.recurrenceID,"notequal",null)));"EditFollowingEvents"!==this.parent.currentAction&&"DeleteFollowingEvents"!==this.parent.currentAction||(p=p.and(new a.Predicate(n.startTime,"greaterthanorequal",t))),i=this.getFilterEventsList(this.parent.eventsData,p),r=r.concat(i)}return r},e.prototype.getRenderedDates=function(e){var i,n=0,r=e.length,a=t.isNullOrUndefined(this.parent.maxDate)?new Date(2099,11,31):this.parent.maxDate,s=t.isNullOrUndefined(this.parent.minDate)?new Date(1900,0,1):this.parent.minDate;if(e[0]<s&&e[e.length-1]>a){for(var o=0;o<e.length;o++)b(e[parseInt(o.toString(),10)]).getTime()===b(new Date(s)).getTime()&&(n=o),b(e[parseInt(o.toString(),10)]).getTime()===b(new Date(a)).getTime()&&(r=o);i=e.filter(function(t){return t>=e[parseInt(n.toString(),10)]&&t<=e[parseInt(r.toString(),10)]})}return i},e.prototype.isValidEvent=function(e,t,i,n){var r=i.getTime()>n.startHour.getTime()&&t.getTime()<n.endHour.getTime(),a=n.startHour.getTime()<=t.getTime()&&e[this.parent.eventFields.startTime].getTime()>=n.startHour.getTime()&&e[this.parent.eventFields.endTime].getTime()<n.endHour.getTime()&&t.getTime()===i.getTime();return r||a},e.prototype.allDayExpandScroll=function(e){var i=0;[].slice.call(this.parent.element.querySelectorAll(".e-header-row")).forEach(function(e){[].slice.call(e.children).forEach(function(e){e.style.top=i+"px"}),i+=e.offsetHeight}),i=e.offsetHeight-i,this.parent.element.querySelector(".e-all-day-cells").style.height=i/12+"em",this.parent.uiStateValues.expand?t.addClass([e],"e-all-day-scroll"):t.removeClass([e],"e-all-day-scroll")},e.prototype.updateEventMinimumDuration=function(e,t,i){if((t.getTime()<i.getTime()||t.getTime()===i.getTime()&&e.startHour.getTime()<i.getTime()&&e.endHour.getTime()>t.getTime()&&-1===this.parent.currentView.indexOf("Timeline"))&&(L(i)-L(t))/Ke<this.parent.eventSettings.minimumEventDuration){var n=new Date(t);if(n.setMinutes(n.getMinutes()+this.parent.eventSettings.minimumEventDuration),(i=n).getTime()>e.endHour.getTime()){var r=new Date(e.endHour.getTime());r.setMinutes(r.getMinutes()-this.parent.eventSettings.minimumEventDuration),t=r,i=e.endHour}}return{startDate:t,endDate:i}},e.prototype.createEventWrapper=function(e,i){void 0===e&&(e=""),void 0===i&&(i=0);for(var n=t.createElement("tr"),r=this.parent.activeView.colLevels.slice(-1)[0],a=this.parent.isReact&&this.parent.activeViewOptions.eventTemplate?" e-appointment-wrapper-hidden":"",s=0,o=r.length;s<o;s++){var l=r[parseInt(s.toString(),10)],p=t.createElement("td",{className:"allDay"===e?"e-all-day-appointment-wrapper"+a:"timeIndicator"===e?"e-timeline-wrapper":"e-day-wrapper"+a,attrs:{"data-date":l.date.getTime().toString()}});if(t.isNullOrUndefined(l.groupIndex)||p.setAttribute("data-group-index",l.groupIndex.toString()),""===e){var c=t.createElement("div",{id:"e-appointment-wrapper-"+i.toString(),className:"e-appointment-wrapper"});p.appendChild(c)}n.appendChild(p),i+=1}return n},e.prototype.getPageCoordinates=function(e){if(t.isNullOrUndefined(e))return e;var i=e.event;return i&&i.changedTouches?i.changedTouches[0]:e.changedTouches?e.changedTouches[0]:i||e},e.prototype.renderSpannedIcon=function(e,i){var n=t.createElement("div",{className:"e-indicator "+et});if(i.isLeft){var r=n.cloneNode();t.addClass([r],"e-left-icon"),t.prepend([r],e)}if(i.isRight){var a=n.cloneNode();t.addClass([a],"e-right-icon"),t.append([a],e)}if(i.isTop){var s=n.cloneNode();t.addClass([s],"e-up-icon"),t.prepend([s],e)}if(i.isBottom){var o=n.cloneNode();t.addClass([o],"e-down-icon"),t.append([o],e)}},e.prototype.addCellHeight=function(e,i,n,r,a,s){if(void 0===s&&(s=!0),this.parent.activeViewOptions.maxEventsPerRow&&!this.parent.rowAutoHeight){for(var o=[].slice.call(this.parent.element.querySelectorAll(e)),l=this.parent.showWeekNumber?[].slice.call(this.parent.element.querySelectorAll(".e-week-number-wrapper tbody tr")):[],p=0,c=o;p<c.length;p++){var h=c[p],d=this.parent.activeViewOptions.maxEventsPerRow*(i+("Month"===this.parent.currentView?n:2))+r+a;l.length>0&&t.setStyleAttribute(l[o.indexOf(h)].firstElementChild,{height:d+"px"}),t.setStyleAttribute(h.firstElementChild,{height:d+"px"})}this.parent.enablePersistence||this.parent.activeViewOptions.allowVirtualScrolling||!s||this.parent.notify(Ge,{})}},e.prototype.unWireEvents=function(){for(var e=0,i=[].slice.call(this.parent.element.querySelectorAll(".e-appointment"));e<i.length;e++){var n=i[e];t.EventHandler.clearEvents(n)}},e.prototype.destroy=function(){this.unWireEvents(),this.parent=null},e}(),qt=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ft=function(e){function i(i){var n=e.call(this,i)||this;return n.dateRender=[],n.renderedEvents=[],n.renderedAllDayEvents=[],n.overlapEvents=[],n.moreEvents=[],n.overlapList=[],n.allDayEvents=[],n.slotCount=n.parent.activeViewOptions.timeScale.slotCount,n.interval=n.parent.activeViewOptions.timeScale.interval,n.allDayLevel=0,n.startHour=n.getStartEndHours(n.parent.activeViewOptions.startHour),n.endHour=n.getStartEndHours(n.parent.activeViewOptions.endHour),n.element=n.parent.activeView.getPanel(),n.fields=n.parent.eventFields,n.animation=new t.Animation({progress:n.animationUiUpdate.bind(n)}),n.addEventListener(),n}return qt(i,e),i.prototype.renderAppointments=function(){var e=this;if(!t.isNullOrUndefined(this.parent)){this.parent.dragAndDropModule&&this.parent.dragAndDropModule.setDragArea(),this.isResourceEventTemplate=this.parent.isSpecificResourceEvents();for(var i=[].slice.call(this.parent.element.querySelectorAll(".e-block-appointment,.e-appointment,.e-row-count-wrapper")),n=!(!this.parent.crudModule||!this.parent.crudModule.crudObj.isCrudAction),r=function(i){if(e.parent.isReact&&!t.isNullOrUndefined(e.parent.activeViewOptions.eventTemplate)){var n=t.closest(i,".e-day-wrapper,.e-all-day-appointment-wrapper");n&&!n.classList.contains("e-appointment-wrapper-hidden")&&t.addClass([n],"e-appointment-wrapper-hidden")}},a=0,s=i;a<s.length;a++){var o=s[a];if(!n||o.classList.contains("e-all-day-appointment")||o.classList.contains("e-row-count-wrapper"))r(o),t.remove(o);else for(var l=parseInt(o.getAttribute("data-group-index"),10),p=0,c=this.parent.crudModule.crudObj.sourceEvent.length;p<c;p++)l!==this.parent.crudModule.crudObj.sourceEvent[parseInt(p.toString(),10)].groupIndex&&l!==this.parent.crudModule.crudObj.targetEvent[parseInt(p.toString(),10)].groupIndex||(r(o),t.remove(o))}if(this.element.querySelector(".e-work-cells")&&(this.parent.virtualScrollModule&&this.parent.virtualScrollModule.updateFocusedWorkCell(),this.allDayElement=[].slice.call(this.element.querySelectorAll(".e-all-day-cells")),this.setAllDayRowHeight(0),0!==this.parent.eventsProcessed.length||0!==this.parent.blockProcessed.length)){var h=this.element.querySelector(".e-all-day-appointment-section");t.EventHandler.remove(h,"click",this.rowExpandCollapse),t.EventHandler.add(h,"click",this.rowExpandCollapse,this),this.renderedEvents=[],this.renderedAllDayEvents=[],this.initializeValues(),this.processBlockEvents(),this.renderEvents("normalEvents"),this.allDayEvents.length>0&&(this.allDayEvents=this.allDayEvents.filter(function(e,t,i){return t===i.map(function(e){return e.Guid}).indexOf(e.Guid)}),t.removeClass(this.allDayElement,"e-animate"),this.slots.push(this.parent.activeView.renderDates.map(function(e){return+e})),this.renderEvents("allDayEvents"),this.animation.animate(this.allDayElement[0])),this.parent.notify(Ge,{}),t.addClass(this.allDayElement,"e-animate"),n&&(this.parent.crudModule.crudObj.isCrudAction=!1),this.parent.renderTemplates(function(){if(e.parent&&e.parent.isReact&&e.parent.activeViewOptions.eventTemplate){var i=[].slice.call(e.parent.element.querySelectorAll(".e-appointment-wrapper-hidden"));t.removeClass(i,"e-appointment-wrapper-hidden")}})}}},i.prototype.initializeValues=function(){if(this.resources=this.parent.activeViewOptions.group.resources.length>0?this.parent.uiStateValues.isGroupAdaptive?[this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]]:this.parent.resourceBase.lastResourceLevel:[],this.resources.length>0&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.virtualScrollModule&&(this.resources=this.parent.resourceBase.renderedResources),this.cellHeight=parseFloat(this.parent.getElementHeight(this.parent.element.querySelector(".e-content-wrap tbody tr")).toFixed(2)),this.dateRender[0]=this.parent.activeView.renderDates,this.parent.activeViewOptions.group.resources.length>0)for(var e=0,t=this.resources.length;e<t;e++)this.dateRender[parseInt(e.toString(),10)]=this.resources[parseInt(e.toString(),10)].renderDates},i.prototype.getHeight=function(e,t){var i=(L(t)-L(e))/Ke*(this.cellHeight*this.slotCount)/this.interval;return i=i<=0?this.cellHeight:i},i.prototype.appendEvent=function(e,i,n,r){var a=this.element.querySelector('.e-appointment-wrapper[id="e-appointment-wrapper-'+n+'"]');this.parent.enableRtl?t.setStyleAttribute(i,{right:r}):t.setStyleAttribute(i,{left:r});var s=i.classList.contains("e-block-appointment")?"blockEvent":"event",o={data:t.extend({},e,null,!0),element:i,cancel:!1,type:s};this.parent.trigger("eventRendered",o,function(e){e.cancel||a.appendChild(i)})},i.prototype.processBlockEvents=function(){for(var e=this.getResourceList(),t=this.getStartCount(),i=0,n=e;i<n.length;i++)for(var r=n[i],a=this.dateRender[parseInt(r.toString(),10)],s=0,o=a.length;s<o;s++){for(var l=new Date(a[parseInt(s.toString(),10)].getTime()),p=b(O(a[parseInt(s.toString(),10)],1)),c=0,h=this.filterEvents(l,p,this.parent.blockProcessed,this.resources[parseInt(r.toString(),10)]);c<h.length;c++){var d=h[c];this.parent.resourceBase&&this.setValues(d,r),this.renderBlockEvents(d,s,r,t),this.cssClass=null,this.groupOrder=null}t+=1}},i.prototype.renderBlockEvents=function(e,i,n,r){var a=this.isSpannedEvent(e,i,n),s=a[this.fields.startTime],o=a[this.fields.endTime],l=V(b(new Date(this.dateRender[parseInt(n.toString(),10)][parseInt(i.toString(),10)].getTime())),this.startHour,this.endHour);if(s<=o&&this.isValidEvent(e,s,o,l)&&this.isWorkDayAvailable(n,s)){var p=void 0,c=void 0;if(a[this.fields.isAllDay]){var h=this.parent.element.querySelector(".e-content-wrap table");c=t.formatUnit(h.offsetHeight),p=t.formatUnit(0)}else c=t.formatUnit(this.getHeight(s,o)),p=t.formatUnit(this.getTopValue(s));e.IsBlock&&(c=t.formatUnit(parseInt(c,10)-1));var d=this.createBlockAppointmentElement(e,n,this.isResourceEventTemplate),u=e.IsBlock?"99%":"100%";t.setStyleAttribute(d,{width:u,height:c,top:p});var g=this.getDayIndex(i,n,r),v=e.IsBlock?"0.5px":"0px";this.appendEvent(e,d,g,v)}},i.prototype.renderEvents=function(e){t.removeClass(this.allDayElement,"e-animate");for(var i,n="allDayEvents"===e?this.sortByDateTime(this.allDayEvents):void 0,r=this.getResourceList(),a=this.getStartCount(),s="allDayEvents"===e?this.parent.getElementHeightFromClass(this.element.querySelector(".e-all-day-appointment-wrapper"),"e-appointment"):0,o="allDayEvents"===e&&this.allDayElement.length>0?this.allDayElement[0].offsetTop:0,l=this,p=0,c=r;p<c.length;p++)!function(r){i=!0,l.parent.crudModule&&l.parent.crudModule.crudObj.isCrudAction&&"allDayEvents"!==e&&!l.parent.uiStateValues.isGroupAdaptive&&0===l.parent.crudModule.crudObj.sourceEvent.filter(function(e){return e.groupIndex===r}).length&&0===l.parent.crudModule.crudObj.targetEvent.filter(function(e){return e.groupIndex===r}).length&&(i=!1),l.slots=[];var p=l.dateRender[parseInt(r.toString(),10)],c=l.getRenderedDates(p)||p;l.slots.push(p.map(function(e){return+e}));for(var h=0,d=p.length;h<d&&p[parseInt(h.toString(),10)]<=c[c.length-1];h++){l.renderedEvents=[];var u=new Date(p[parseInt(h.toString(),10)].getTime()),g=b(O(p[parseInt(h.toString(),10)],1)),v=l.filterEvents(u,g,n,l.resources[parseInt(r.toString(),10)]);if(i)for(var m=0,f=v;m<f.length;m++){var y=f[m];if(l.parent.resourceBase&&l.setValues(y,r),"allDayEvents"===e)l.renderAllDayEvents(y,h,r,a,!1,o,s);else if(l.isAllDayAppointment(y))l.allDayEvents.push(t.extend({},y,null,!0));else{if(l.parent.eventSettings.enableMaxHeight&&l.getOverlapIndex(y,h,!1,r)>0)continue;l.renderNormalEvents(y,h,r,a)}l.cssClass=null,l.groupOrder=null}else for(var T=0,w=v;T<w.length;T++){var D=w[T];l.isAllDayAppointment(D)&&l.allDayEvents.push(t.extend({},D,null,!0))}a+=1}}(c[p])},i.prototype.getStartCount=function(){return this.parent.virtualScrollModule&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.timeScale.enable?parseInt(this.element.querySelector(".e-appointment-wrapper").getAttribute("id").split("-").slice(-1)[0],10):0},i.prototype.getDayIndex=function(e,t,i){var n=this;if(!this.parent.activeViewOptions.group.byDate)return i;if(this.parent.activeViewOptions.group.byDate&&!this.parent.activeViewOptions.group.hideNonWorkingDays){var r=this.parent.resourceBase.lastResourceLevel[0].renderDates.indexOf(this.dateRender[parseInt(t.toString(),10)][parseInt(e.toString(),10)]);return this.resources.length*r+t}for(var a=0,s=this.parent.activeView.colLevels[0],o=this.dateRender[parseInt(t.toString(),10)][parseInt(e.toString(),10)].getTime(),l=[],p=0;p<s.length&&(l=this.parent.resourceBase.resourceDateTree[parseInt(p.toString(),10)],o!==s[parseInt(p.toString(),10)].date.getTime());p++)a+=s[parseInt(p.toString(),10)].colSpan;var c=l.findIndex(function(e){return e.groupOrder.toString()===n.resources[parseInt(t.toString(),10)].groupOrder.toString()});return c<0?a:a+c},i.prototype.setValues=function(e,t){this.parent.activeViewOptions.group.resources.length>0?(this.cssClass=this.resources[parseInt(t.toString(),10)].cssClass,this.groupOrder=this.resources[parseInt(t.toString(),10)].groupOrder):this.cssClass=this.parent.resourceBase.getCssClass(e)},i.prototype.getResourceList=function(){return Array.apply(null,{length:this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive?this.resources.length:1}).map(function(e,t){return t})},i.prototype.createAppointmentElement=function(e,i,n,r){var a=this.parent.eventFields,s=e[a.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),o=t.createElement("div",{className:"e-appointment",attrs:{"data-id":"Appointment_"+e[a.id],"data-guid":e.Guid,role:"button",tabindex:"0","aria-disabled":this.parent.eventBase.getReadonlyAttribute(e),"aria-label":this.parent.getAnnouncementString(e)}});e[this.fields.isReadonly]&&t.addClass([o],"e-read-only");var l=t.createElement("div",{className:"e-appointment-details"});if(o.appendChild(l),this.parent.activeViewOptions.group.resources.length>0){var p=this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:r;o.setAttribute("data-group-index",p.toString())}var c,h=n;if(t.isNullOrUndefined(this.parent.activeViewOptions.eventTemplate)){var d=t.createElement("div",{className:"e-subject"});if(this.parent.sanitize(s,d),i)if(e[a.isAllDay])c=[d];else{c=[];var u=t.createElement("div",{className:"e-time"+(this.parent.isAdaptive?" e-disable":""),innerHTML:this.parent.getTimeString(e[a.startTime])}),g=t.createElement("div",{className:"e-time"+(this.parent.isAdaptive?" e-disable":""),innerHTML:this.parent.getTimeString(e[a.endTime])});t.addClass([d],"e-text-center"),h.isLeft||c.push(u),c.push(d),h.isRight||c.push(g)}else{var v=this.parent.getTimeString(e[a.startTime])+" - "+this.parent.getTimeString(e[a.endTime]),m=t.createElement("div",{className:"e-time"+(this.parent.isAdaptive?" e-disable":""),innerHTML:v}),f=t.createElement("div",{className:"e-location"});this.parent.sanitize(e[a.location]||this.parent.eventSettings.fields.location.default||"",f),c=[d,m,f]}}else{var y=this.parent.element.id+"_"+this.parent.activeViewOptions.eventTemplateName+"eventTemplate",T=this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:r,w=this.isResourceEventTemplate?this.parent.getEventTemplateName(T):"eventTemplate";c=this.parent.getAppointmentTemplate()(e,this.parent,w,y,!1,void 0,void 0,this.parent.root)}if(t.append(c,l),!(this.parent.isAdaptive||t.isNullOrUndefined(e[a.recurrenceRule])&&t.isNullOrUndefined(e[a.recurrenceID]))){var D=e[a.id]===e[a.recurrenceID]?"e-recurrence-icon":"e-recurrence-edit-icon",b=t.createElement("div",{className:et+" "+D});i?l.appendChild(b):o.appendChild(b)}return this.parent.eventBase.renderSpannedIcon(i?l:o,h),t.isNullOrUndefined(this.cssClass)||t.addClass([o],this.cssClass),this.applyResourceColor(o,e,"backgroundColor",this.groupOrder),this.renderResizeHandler(o,h,e[this.fields.isReadonly]),o},i.prototype.createMoreIndicator=function(e,i,n){var r=n+i,a=e[parseInt(r.toString(),10)];if(a.childElementCount<=0){var s=t.createElement("div",{className:"e-row-count-wrapper",id:"e-row-count-wrapper-"+r.toString()}),o=t.createElement("div",{className:"e-more-indicator",attrs:{tabindex:"0","data-index":r.toString(),"data-count":"1"},innerHTML:"+1 "+(this.parent.isAdaptive?"":this.parent.localeObj.getConstant("more"))});s.appendChild(o),a.appendChild(s),t.EventHandler.add(o,"click",this.rowExpandCollapse,this)}else{var l=a.querySelector(".e-more-indicator"),p=parseInt(l.getAttribute("data-count"),10)+1;l.setAttribute("data-count",p.toString()),l.innerHTML="+"+this.parent.globalize.formatNumber(p)+" "+(this.parent.isAdaptive?"":this.parent.localeObj.getConstant("more"))}},i.prototype.isSpannedEvent=function(e,i,n){var r=b(this.dateRender[parseInt(n.toString(),10)][parseInt(i.toString(),10)]),a=this.getRenderedDates(this.dateRender[parseInt(n.toString(),10)])||[r];0===a.filter(function(e){return e.getDay()===i}).length&&(r=b(a[0]));var s=this.parent.eventFields,o=V(r,this.startHour,this.endHour),l=t.extend({},e,null,!0);l.isSpanned={isBottom:!1,isTop:!1,isSameDuration:l[s.startTime].getTime()===l[s.endTime].getTime()},e[s.startTime].getTime()<o.startHour.getTime()&&(l[s.startTime]=o.startHour,l.isSpanned.isTop=!0),e[s.endTime].getTime()>o.endHour.getTime()&&(l[s.endTime]=o.endHour,l.isSpanned.isBottom=!0);var p=this.updateEventMinimumDuration(o,l[s.startTime],l[s.endTime]);return l[s.startTime]=p.startDate,l[s.endTime]=p.endDate,l},i.prototype.isWorkDayAvailable=function(e,t){if(this.parent.activeViewOptions.group.hideNonWorkingDays&&this.resources.length>0){var i=this.resources[parseInt(e.toString(),10)].resourceData[this.resources[parseInt(e.toString(),10)].resource.workDaysField]||this.parent.activeViewOptions.workDays;return i&&i.indexOf(t.getDay())>=0}return!0},i.prototype.renderAllDayEvents=function(e,i,n,r,a,s,o){var l=this,p=this.getRenderedDates(this.dateRender[parseInt(n.toString(),10)])||this.dateRender[parseInt(n.toString(),10)];this.parent.activeViewOptions.group.byDate&&(this.slots[0]=[this.dateRender[parseInt(n.toString(),10)][parseInt(i.toString(),10)].getTime()],p=[this.dateRender[parseInt(n.toString(),10)][parseInt(i.toString(),10)]]);var c=this.splitEvent(e,p)[0],h=new Date(c[this.parent.eventFields.startTime].getTime()),d=new Date(c[this.parent.eventFields.endTime].getTime());if(!(h.getTime()<this.parent.minDate.getTime()||d.getTime()>this.parent.maxDate.getTime())){var u=0,g=1,v=p[0].getTime()<=h.getTime()&&O(p.slice(-1)[0],1).getTime()>=h.getTime();if(h<=d&&v&&this.isWorkDayAvailable(n,h)){var m=[];if(this.renderedAllDayEvents[parseInt(n.toString(),10)]&&(m=this.renderedAllDayEvents[parseInt(n.toString(),10)].filter(function(t){return t.Guid===e.Guid}),this.parent.activeViewOptions.group.byDate&&(m=m.filter(function(e){return e[l.parent.eventFields.startTime]>=p[parseInt(i.toString(),10)]&&e[l.parent.eventFields.endTime]<=O(new Date(+p[parseInt(i.toString(),10)]),1)}))),0===m.length){var f=c.data.count,y=this.getOverlapIndex(c,i,!0,n);c.Index=y,this.allDayLevel=this.allDayLevel<y?y:this.allDayLevel;var T=c.data.isRight?0:"Day"===this.parent.currentView?4:7;f>=0&&(u=100*f-(this.parent.activeViewOptions.allowOverlap?T:0)),t.isNullOrUndefined(this.renderedAllDayEvents[parseInt(n.toString(),10)])&&(this.renderedAllDayEvents[parseInt(n.toString(),10)]=[]),this.renderedAllDayEvents[parseInt(n.toString(),10)].push(t.extend({},c,null,!0));var w,D=[].slice.call(this.element.querySelector(".e-all-day-row").children),b=this.getDayIndex(i,n,r),C=this.element.querySelector(".e-all-day-appointment-wrapper:nth-child("+(b+1)+")");w=a?this.parent.inlineModule.createInlineAppointmentElement(e):this.createAppointmentElement(e,!0,c.data,n),t.addClass([w],"e-all-day-appointment");var S=t.extend({},c.data,null,!0);e.data=S;var E={data:e,element:w,cancel:!1};this.parent.trigger("eventRendered",E,function(i){if(!i.cancel){if(C.appendChild(w),g+=(0===y?s:s+y*o)+1,t.setStyleAttribute(w,{width:u+"%",top:t.formatUnit(g)}),y>1){l.moreEvents.push(w);for(var n=0,r=f;n<r;n++)l.createMoreIndicator(D,n,b)}l.allDayElement[0].setAttribute("data-count",l.allDayLevel.toString());var a=4+(!l.parent.uiStateValues.expand&&l.allDayLevel>2?3*o:(l.allDayLevel+1)*o);l.setAllDayRowHeight(a),l.addOrRemoveClass(),l.wireAppointmentEvents(w,e)}})}}}},i.prototype.renderNormalEvents=function(e,i,n,r,a){var s=this.isSpannedEvent(e,i,n),o=s[this.fields.startTime],l=s[this.fields.endTime],p="0%",c=0,h=V(b(new Date(this.dateRender[parseInt(n.toString(),10)][parseInt(i.toString(),10)].getTime())),this.startHour,this.endHour),d=this.isValidEvent(e,o,l,h);if(!(o.getTime()<this.parent.minDate.getTime()||l.getTime()>O(this.parent.maxDate,1).getTime())&&o<=l&&d&&this.isWorkDayAvailable(n,o)){var u=s.isSpanned.isSameDuration?this.cellHeight:this.getHeight(o,l);o.getTime()>=h.startHour.getTime()&&(c=this.getTopValue(o));var g=this.getOverlapIndex(s,i,!1,n);s.Index=g,this.overlapList.push(s),this.overlapList.length>1?(t.isNullOrUndefined(this.overlapEvents[parseInt(g.toString(),10)])&&(this.overlapEvents[parseInt(g.toString(),10)]=[]),this.overlapEvents[parseInt(g.toString(),10)].push(s)):(this.overlapEvents=[],this.overlapEvents.push([s]));var v={index:g,left:"0%",width:p=this.getEventWidth(),day:r,dayIndex:i,record:s,resource:n},m=this.adjustOverlapElements(v);p=m.appWidth,t.isNullOrUndefined(this.renderedEvents[parseInt(n.toString(),10)])&&(this.renderedEvents[parseInt(n.toString(),10)]=[]),this.renderedEvents[parseInt(n.toString(),10)].push(t.extend({},s,null,!0));var f=void 0;f=a?this.parent.inlineModule.createInlineAppointmentElement(e):this.createAppointmentElement(e,!1,s.isSpanned,n),t.setStyleAttribute(f,{width:this.parent.eventSettings.enableMaxHeight||!this.parent.activeViewOptions.allowOverlap?"100%":m.appWidth,height:u+"px",top:c+"px"});var y=u-40-15*f.querySelectorAll(".e-indicator").length,T=f.querySelector(".e-subject");!this.parent.isAdaptive&&T&&(T.style.maxHeight=t.formatUnit(y));var w=this.getDayIndex(i,n,r),D={};D[this.fields.startTime]=e[this.fields.startTime],D[this.fields.endTime]=e[this.fields.endTime],s.data=D,this.appendEvent(s,f,w,m.appLeft),this.wireAppointmentEvents(f,e)}},i.prototype.getEventWidth=function(){var e=(("Day"===this.parent.currentView?97:94)-this.overlapEvents.length)/this.overlapEvents.length;return(e<0?0:e)+"%"},i.prototype.getEventLeft=function(e,t){var i=(parseFloat(e)+1)*t;return(i>99?99:i)+"%"},i.prototype.getStartEndHours=function(e){if(!t.isNullOrUndefined(e)&&""!==e){var i=new Date(2e3,0,0,0),n=e.split(":");return 2===n.length&&i.setHours(parseInt(n[0],10),parseInt(n[1],10),0),i}return null},i.prototype.getTopValue=function(e){var t=this.getStartEndHours(this.parent.activeViewOptions.startHour),i=60*(e.getHours()-t.getHours())+(e.getMinutes()-t.getMinutes());return this.parent.activeViewOptions.timeScale.enable?i*this.cellHeight*this.slotCount/this.interval:0},i.prototype.getOverlapIndex=function(e,i,n,r){var a=this,s=this.parent.eventFields,o=[],l=-1;if(this.overlapEvents=[],n){if(!t.isNullOrUndefined(this.renderedAllDayEvents[parseInt(r.toString(),10)])){var p=b(new Date(this.dateRender[parseInt(r.toString(),10)][parseInt(i.toString(),10)].getTime()));o=this.renderedAllDayEvents[parseInt(r.toString(),10)].filter(function(e){return b(e[s.startTime]).getTime()<=p.getTime()&&b(e[s.endTime]).getTime()>=p.getTime()}),this.parent.activeViewOptions.group.resources.length>0&&(o=this.filterEventsByResource(this.resources[parseInt(r.toString(),10)],o))}}else{var c=t.isNullOrUndefined(this.renderedEvents[parseInt(r.toString(),10)])?[]:this.renderedEvents[parseInt(r.toString(),10)],h=[],d=e[s.startTime],u=e[s.endTime];this.overlapList=c.filter(function(e){return e[s.endTime]>d&&e[s.startTime]<=u||e[s.startTime]>=u&&e[s.endTime]<=d||e[s.endTime].getTime()===e[s.startTime].getTime()&&e[s.startTime].getTime()===d.getTime()&&e[s.endTime]<u}),this.parent.activeViewOptions.group.resources.length>0&&(this.overlapList=this.filterEventsByResource(this.resources[parseInt(r.toString(),10)],this.overlapList));var g=[];this.overlapList.forEach(function(e){g.push(e);for(var t=[],i=new Set;g.length>0&&"break"!==function(){var e=g.shift();if(c.filter(function(t){return t[s.endTime]>e[s.startTime]&&t[s.startTime]<=e[s.endTime]&&!i.has(t[s.id])}).forEach(function(e){t.push(e),i.add(e[s.id]),g.push(e)}),i.size<c.length-1)return"break"}(););a.parent.activeViewOptions.group.resources.length>0&&(t=a.filterEventsByResource(a.resources[parseInt(r.toString(),10)],t));var n=t.filter(function(e){return-1===a.overlapList.indexOf(e)});n.length>0&&(h=h.concat(n))});for(var v=0;v<h.length-1;v++)for(var m=v+1;m<h.length;m++)h[parseInt(v.toString(),10)][s.id]===h[parseInt(m.toString(),10)][s.id]&&(h.splice(m,1),m--);this.overlapList=this.overlapList.concat(h);for(var f=0,y=o=this.overlapList;f<y.length;f++){var T=y[f],w=T.Index;t.isNullOrUndefined(this.overlapEvents[parseInt(w.toString(),10)])?this.overlapEvents[parseInt(w.toString(),10)]=[T]:this.overlapEvents[parseInt(w.toString(),10)].push(T)}}if(n||(o=o.filter(function(t){return t[s.startTime]===e[s.startTime]&&t[s.endTime]>e[s.endTime]||t[s.endTime]>e[s.startTime]&&t[s.startTime]<e[s.endTime]||t[s.endTime]===e[s.startTime]&&t[s.startTime]===e[s.endTime]||t[s.startTime].getTime()===e[s.startTime].getTime()&&t[s.endTime].getTime()===e[s.endTime].getTime()||t[s.startTime].getTime()===e[s.startTime].getTime()&&t[s.endTime].getTime()<e[s.endTime].getTime()||t[s.endTime].getTime()>e[s.endTime].getTime()})),o.length>0){var D=o.map(function(e){return e.Index});l=D.length>0?this.getSmallestMissingNumber(D):0}return-1===l?0:l},i.prototype.adjustOverlapElements=function(e){for(var i={appWidth:e.width,appLeft:e.left},n=0,r=this.overlapEvents.length;n<r;n++)if(!t.isNullOrUndefined(this.overlapEvents[parseInt(n.toString(),10)]))for(var a=0,s=this.overlapEvents[parseInt(n.toString(),10)].length;a<s;a++){var o=this.getDayIndex(e.dayIndex,e.resource,e.day),l=this.element.querySelector("#e-appointment-wrapper-"+o);if(l&&l.childElementCount>0){var p=this.overlapEvents[parseInt(n.toString(),10)][parseInt(a.toString(),10)].Guid;if(l.querySelectorAll('div[data-guid="'+p+'"]').length>0&&p!==e.record.Guid){var c=l.querySelector('div[data-guid="'+p+'"]');parseFloat(e.width)<=parseFloat(c.style.width)?(this.parent.enableRtl?c.style.right=this.getEventLeft(e.width,n):c.style.left=this.getEventLeft(e.width,n),c.style.width=parseFloat(e.width)+"%",i.appWidth=c.style.width):i.appWidth=c.style.width}else{var h=e.width;t.isNullOrUndefined(this.overlapEvents[n-1])&&(h=this.getEventWidth()),i.appWidth=h,i.appLeft=this.getEventLeft(h,e.index)}}}return i},i.prototype.setAllDayRowHeight=function(e){var i=this.parent.element.querySelector(".e-date-header-wrap");"auto"!==this.parent.height&&this.parent.enableAllDayScroll||t.addClass([i],"e-all-day-auto");var n=this.parent.element.querySelector(".e-all-day-row");if(n.style.height="",this.parent.uiStateValues.expand&&"auto"!==this.parent.height&&this.parent.enableAllDayScroll)n.style.height=e/12+"em",this.parent.eventBase.allDayExpandScroll(i);else{for(var r=0,a=this.allDayElement;r<a.length;r++)a[r].style.height=e/12+"em";t.removeClass([i],"e-all-day-scroll")}},i.prototype.addOrRemoveClass=function(){var e=this;this.moreEvents.filter(function(i){!e.parent.uiStateValues.expand&&e.allDayLevel>2?(t.addClass([i],"e-appointment-hide"),i.setAttribute("tabindex","-1")):(t.removeClass([i],"e-appointment-hide"),i.setAttribute("tabindex","0"))});var i=this.element.querySelector(".e-all-day-appointment-section");this.parent.uiStateValues.expand?(t.removeClass([i],"e-appointment-expand"),t.addClass([i],"e-appointment-collapse")):(t.removeClass([i],"e-appointment-collapse"),t.addClass([i],"e-appointment-expand")),this.allDayLevel>2?t.removeClass([i],"e-disable"):t.addClass([i],"e-disable"),[].slice.call(this.element.querySelectorAll(".e-row-count-wrapper")).forEach(function(i){!e.parent.uiStateValues.expand&&e.allDayLevel>2?t.removeClass([i],"e-disable"):t.addClass([i],"e-disable")})},i.prototype.getEventHeight=function(){var e=t.createElement("div",{className:"e-appointment",styles:"visibility:hidden"});this.element.querySelector(".e-all-day-appointment-wrapper:first-child").appendChild(e);var i=e.offsetHeight;return t.remove(e),i},i.prototype.rowExpandCollapse=function(){var e=this.element.querySelector(".e-all-day-appointment-section");this.parent.uiStateValues.expand=e.classList.contains("e-appointment-expand");var t;this.parent.uiStateValues.expand?(e.setAttribute("title",this.parent.localeObj.getConstant("collapseAllDaySection")),e.setAttribute("aria-label",this.parent.localeObj.getConstant("collapseAllDaySection")),t=(this.allDayLevel+1)*this.getEventHeight()+4):(e.setAttribute("title",this.parent.localeObj.getConstant("expandAllDaySection")),e.setAttribute("aria-label",this.parent.localeObj.getConstant("expandAllDaySection")),t=3*this.getEventHeight()+4,this.parent.element.querySelector(".e-date-header-wrap").scrollTop=0),this.setAllDayRowHeight(t),this.animation.animate(this.allDayElement[0]),this.addOrRemoveClass(),this.animation.animate(e)},i.prototype.animationUiUpdate=function(){this.parent.notify(Ge,{})},i.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed||(this.removeEventListener(),this.allDayElement=null,this.renderedAllDayEvents=null,this.renderedEvents=null,this.slotCount=null,this.interval=null,this.startHour=null,this.endHour=null,this.element=null,this.fields=null,this.animation=null,e.prototype.destroy.call(this))},i}(Lt),Ut=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Bt=function(e){function i(t){var i=e.call(this,t)||this;return i.renderedEvents=[],i.monthHeaderHeight=0,i.moreIndicatorHeight=19,i.renderType="day",i.element=i.parent.activeView.getPanel(),i.fields=i.parent.eventFields,i.maxHeight=i.parent.eventSettings.enableMaxHeight&&!i.parent.eventSettings.enableIndicator&&!i.parent.rowAutoHeight,i.withIndicator=i.parent.eventSettings.enableMaxHeight&&i.parent.eventSettings.enableIndicator&&!i.parent.rowAutoHeight,i.maxOrIndicator=i.maxHeight||i.withIndicator,i.moreIndicatorHeight=i.parent.rowAutoHeight&&i.parent.eventSettings.ignoreWhitespace?0:i.moreIndicatorHeight,i.addEventListener(),i}return Ut(i,e),i.prototype.removeEventWrapper=function(e){if(e.length>0)for(var i=0,n=e="Month"===this.parent.currentView||!this.parent.activeView.isTimelineView()&&!this.parent.activeViewOptions.timeScale.enable?e:[e[0]];i<n.length;i++){var r=n[i];r.parentElement&&r.parentElement.parentNode&&t.remove(r.parentElement)}},i.prototype.renderAppointments=function(){this.parent.dragAndDropModule&&this.parent.dragAndDropModule.setDragArea(),this.isResourceEventTemplate=this.parent.isSpecificResourceEvents();var e=this.parent.element.querySelector(".e-content-wrap");this.parent.rowAutoHeight&&(this.parent.uiStateValues.top=e.scrollTop,this.parent.uiStateValues.left=e.scrollLeft);var i=[].slice.call(this.element.querySelectorAll(".e-appointment-wrapper"));if(this.parent.crudModule&&this.parent.crudModule.crudObj.isCrudAction)for(var n=0,r=this.parent.crudModule.crudObj.sourceEvent.length;n<r;n++){var a=[].slice.call(this.element.querySelectorAll('.e-appointment-wrapper [data-group-index="'+this.parent.crudModule.crudObj.sourceEvent[parseInt(n.toString(),10)].groupIndex+'"]'));if(this.removeEventWrapper(a),this.parent.crudModule.crudObj.targetEvent[parseInt(n.toString(),10)]&&this.parent.crudModule.crudObj.sourceEvent[parseInt(n.toString(),10)].groupIndex!==this.parent.crudModule.crudObj.targetEvent[parseInt(n.toString(),10)].groupIndex){var s=[].slice.call(this.element.querySelectorAll('.e-appointment-wrapper [data-group-index="'+this.parent.crudModule.crudObj.targetEvent[parseInt(n.toString(),10)].groupIndex+'"]'));this.removeEventWrapper(s)}}else for(var o=0,l=i;o<l.length;o++){var p=l[o];t.remove(p)}if(this.removeHeightProperty(nt),this.element.querySelector(".e-work-cells")){if("Month"===this.parent.currentView){var c=t.createElement("div",{className:"e-appointment-wrapper"}),h=this.parent.element.querySelector(".e-work-cells");h.appendChild(c),this.monthHeaderHeight=c.offsetTop-h.offsetTop,h.removeChild(c)}this.eventHeight=this.parent.getElementHeightFromClass(this.element,"e-appointment");var d="."+nt+" tbody tr";this.addCellHeight(d,this.eventHeight,"Month"===this.parent.currentView?0:2,this.monthHeaderHeight,this.moreIndicatorHeight);var u=e.scrollTop;if(this.parent.rowAutoHeight&&this.parent.virtualScrollModule&&!this.parent.virtualScrollModule.isHorizontalScroll&&!t.isNullOrUndefined(this.parent.currentAction)&&(e.scrollTop=e.scrollTop-1),this.parent.activeViewOptions.group.resources.length>0?(this.renderResourceEvents(),this.parent.virtualScrollModule&&this.parent.virtualScrollModule.updateFocusedWorkCell()):this.renderEventsHandler(this.parent.activeView.renderDates,this.parent.activeViewOptions.workDays),this.parent.rowAutoHeight){this.updateBlockElements();var g={cssProperties:this.parent.getCssProperties(),module:this.parent.getModuleName(),isPreventScrollUpdate:!0,scrollPosition:{left:this.parent.uiStateValues.left,top:this.parent.uiStateValues.top}};if(this.parent.virtualScrollModule&&!this.parent.virtualScrollModule.isHorizontalScroll&&(this.parent.currentAction?(e.scrollTop=u,this.parent.currentAction=null):this.parent.virtualScrollModule.updateVirtualScrollHeight()),this.parent.enablePersistence||this.parent.notify(Ge,{}),this.parent.notify(Xe,g),"Month"===this.parent.currentView&&this.parent.showWeekNumber){var v=[].slice.call(this.parent.element.querySelectorAll(".e-content-wrap table tr td:first-child"));[].slice.call(this.parent.element.querySelectorAll("td.e-week-number")).forEach(function(e,i){var n=v[parseInt(i.toString(),10)].offsetHeight;t.setStyleAttribute(e,{height:n+"px"})});var m=this.parent.element.querySelector(".e-week-number-wrapper");t.isNullOrUndefined(m)||(m.scrollTop=this.parent.element.querySelector(".e-content-wrap").scrollTop)}}this.parent.renderTemplates()}},i.prototype.renderEventsHandler=function(e,i,n){this.renderedEvents=[];var r,a,s=0;if(n?(s=n.groupIndex,this.cssClass=n.cssClass,this.groupOrder=n.groupOrder,r=this.parent.eventBase.filterEventsByResource(n,this.parent.eventsProcessed),a=this.parent.eventBase.filterEventsByResource(n,this.parent.blockProcessed),this.workCells=[].slice.call(this.element.querySelectorAll('.e-work-cells[data-group-index="'+s+'"]'))):(r=this.parent.eventsProcessed,a=this.parent.blockProcessed,this.workCells=[].slice.call(this.element.querySelectorAll(".e-work-cells"))),this.sortByDateTime(r),this.sortByDateTime(a),"Month"===this.parent.currentView&&this.parent.rowAutoHeight&&0===this.parent.activeViewOptions.group.resources.length){var o=[].slice.call(this.parent.element.querySelectorAll(".e-content-wrap table tr td:first-child")),l=this.parent.element.querySelector("."+nt).clientHeight/o.length;o.forEach(function(e){t.setStyleAttribute(e,{height:l+"px"})})}var p=this.workCells[this.parent.activeView.isTimelineView()?0:this.workCells.length-1];this.cellWidth=this.parent.getElementWidth(p),this.cellHeight=this.parent.getElementHeight(p),this.dateRender=e;var c=this.getRenderedDates(e);this.getSlotDates(i||this.parent.activeViewOptions.workDays),this.processBlockEvents(a,s,n);for(var h=[],d=0,u=r;d<u.length;d++){var g=u[d];this.parent.resourceBase&&!n&&(this.cssClass=this.parent.resourceBase.getCssClass(g)),h=h.concat(this.splitEvent(g,c||this.dateRender))}for(var v=0;v<this.slots.length;v++){this.renderedEvents=[];for(var m=this.slots[parseInt(v.toString(),10)],f=O(new Date(m[m.length-1]),1),y=0,T=this.filterEvents(new Date(m[0]),f,h);y<T.length;y++){var w=T[y];if(this.maxHeight){var D="Month"===this.parent.currentView?w[this.fields.startTime]:this.getStartTime(w,w.data);if(this.getIndex(D)>0)continue}this.updateIndicatorIcon(w),this.renderEvents(w,s,r)}}this.cssClass=null,this.groupOrder=null},i.prototype.processBlockEvents=function(e,i,n){for(var r=0,a=e;r<a.length;r++){var s=a[r];this.parent.resourceBase&&!n&&(this.cssClass=this.parent.resourceBase.getCssClass(s));var o=[];if("day"!==this.renderType||s[this.fields.isAllDay])o.push(s);else{var l=t.extend({},s,null,!0),p=this.isSameDate(l[this.fields.startTime],l[this.fields.endTime]);if(l.isBlockIcon=p,!p&&C(l[this.fields.startTime])>0&&((c=t.extend({},s,null,!0))[this.fields.endTime]=O(b(new Date(s[this.fields.startTime]+"")),1),c.isBlockIcon=!0,l[this.fields.startTime]=c[this.fields.endTime],o.push(c)),!(p=this.isSameDate(l[this.fields.startTime],l[this.fields.endTime]))&&C(l[this.fields.endTime])>0){var c=t.extend({},s,null,!0);c[this.fields.startTime]=b(new Date(s[this.fields.endTime]+"")),c.isBlockIcon=!0,o.push(c),l[this.fields.endTime]=c[this.fields.startTime]}o.push(l)}for(var h=0,d=o;h<d.length;h++)for(var u=d[h],g=0,v=this.splitEvent(u,this.dateRender);g<v.length;g++){var m=v[g];this.renderBlockEvents(m,i,!!u.isBlockIcon)}}},i.prototype.isSameDate=function(e,t){return new Date(+e).setHours(0,0,0,0)===new Date(+t).setHours(0,0,0,0)},i.prototype.renderBlockEvents=function(e,i,n){var r=e.data,a=this.getStartTime(e,r),s=this.getEndTime(e,r),o=this.parent.getIndexOfDate(this.dateRender,b(new Date(a.getTime())));if(!(o<0||a>s)){var l=this.getCellTd(o),p=this.getPosition(a,s,e[this.fields.isAllDay],o);if(n)this.renderBlockIndicator(l,p,i);else{var c=r.count,h=this.getEventWidth(a,s,e[this.fields.isAllDay],c);h=h<=0?this.cellWidth:h,h=e.IsBlock?h-1:h;var d=this.parent.enableRtl?0:e.IsBlock?p+1:p,u=this.parent.enableRtl?e.IsBlock?p+1:p:0,g=this.cellHeight-this.monthHeaderHeight;g=e.IsBlock?g-1:g;var v=this.getRowTop(i),m=this.createBlockAppointmentElement(e,i,this.isResourceEventTemplate);t.setStyleAttribute(m,{width:h+"px",height:g+"px",left:d+"px",right:u+"px",top:v+"px"}),this.renderEventElement(e,m,l)}}},i.prototype.renderBlockIndicator=function(e,i,n){var r=t.createElement("div",{className:"e-icons e-block-indicator"});t.isNullOrUndefined(e.querySelector(".e-block-indicator"))&&e.appendChild(r)},i.prototype.getStartTime=function(e,t){return e[this.fields.startTime]},i.prototype.getEndTime=function(e,t){return e[this.fields.endTime]},i.prototype.getCellTd=function(e){return this.workCells[parseInt(e.toString(),10)]},i.prototype.getEventWidth=function(e,t,i,n){return n*this.cellWidth-1},i.prototype.getPosition=function(e,t,i,n){return 0},i.prototype.getRowTop=function(e){return 0},i.prototype.updateIndicatorIcon=function(e){if(-1!==this.parent.currentView.indexOf("Timeline")&&"TimelineMonth"!==this.parent.currentView&&!e[this.fields.isAllDay]){var t=e.data,i=this.parent.activeView.getStartHour(),n=this.parent.activeView.getEndHour(),r=V(e[this.fields.startTime],i,n),a=V(e[this.fields.endTime],i,n),s=t[this.fields.startTime],o=t[this.fields.endTime];if(t.isLeft=t.isLeft||s.getTime()<r.startHour.getTime(),t.isRight=t.isRight||o.getTime()>a.endHour.getTime(),b(s).getTime()!==b(o).getTime()){var l=r.startHour,p=a.endHour,c=new Date(b(s));if(c.setHours(p.getHours(),p.getMinutes(),p.getSeconds()),t.isLeft=t.isLeft||s.getTime()>=(l.getDate()===r.endHour.getDate()?c.getTime():O(c,1).getTime()),o.getTime()!==b(o).getTime()){var h=new Date(b(o));t.isRight=t.isRight||o.getTime()<=h.setHours(l.getHours(),l.getMinutes(),l.getSeconds())}}}},i.prototype.renderResourceEvents=function(){var e=this.parent.uiStateValues.isGroupAdaptive?[this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]]:this.parent.resourceBase.renderedResources;if(this.parent.crudModule&&this.parent.crudModule.crudObj.isCrudAction){for(var t=0,i=this.parent.crudModule.crudObj.sourceEvent.length;t<i;t++){var n=this.parent.crudModule.crudObj.sourceEvent[parseInt(t.toString(),10)];if((!this.parent.uiStateValues.isGroupAdaptive||this.parent.uiStateValues.groupIndex===n.groupIndex&&this.parent.uiStateValues.isGroupAdaptive)&&this.renderEventsHandler(n.renderDates,n.workDays,n),this.parent.crudModule.crudObj.sourceEvent[parseInt(t.toString(),10)].groupIndex!==this.parent.crudModule.crudObj.targetEvent[parseInt(t.toString(),10)].groupIndex){var r=this.parent.crudModule.crudObj.targetEvent[parseInt(t.toString(),10)];this.renderEventsHandler(r.renderDates,r.workDays,r)}}this.parent.crudModule.crudObj.isCrudAction=!1}else for(var a=0,s=e;a<s.length;a++){var o=s[a];this.renderEventsHandler(o.renderDates,o.workDays,o)}},i.prototype.getSlotDates=function(e){this.slots=[];for(var t=this.dateRender.map(function(e){return+e}),i=!this.parent.activeViewOptions.showWeekend||this.parent.activeViewOptions.group.byDate&&this.parent.activeViewOptions.group.hideNonWorkingDays?e.length:7;t.length>0;)this.slots.push(t.splice(0,i))},i.prototype.createAppointmentElement=function(e,i,n){void 0===n&&(n=!1);var r=e[this.fields.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),a=t.extend({},e,e.data,!0),s={"data-id":"Appointment_"+e[this.fields.id],role:"button",tabindex:"0","aria-disabled":this.parent.eventBase.getReadonlyAttribute(e),"aria-label":this.parent.getAnnouncementString(a,r)};n||(s["data-guid"]=e.Guid),this.parent.activeViewOptions.group.resources.length>0&&(s["data-group-index"]=i.toString());var o=t.createElement("div",{className:"e-appointment",attrs:s});t.isNullOrUndefined(this.cssClass)||t.addClass([o],this.cssClass),e[this.fields.isReadonly]&&t.addClass([o],"e-read-only");var l=t.createElement("div",{className:"e-appointment-details"});o.appendChild(l);var p,c=e.data,h=this.getEventData(e);if(t.isNullOrUndefined(this.parent.activeViewOptions.eventTemplate)){var d=e[this.fields.location]||this.parent.eventSettings.fields.location.default||"",u=t.createElement("div",{className:"e-subject"});this.parent.sanitize(r+(d?"; "+d:""),u);var g=t.createElement("div",{className:"e-time"+(this.parent.isAdaptive?" e-disable":""),innerHTML:this.parent.getTimeString(c[this.fields.startTime])}),v=t.createElement("div",{className:"e-time"+(this.parent.isAdaptive?" e-disable":""),innerHTML:this.parent.getTimeString(c[this.fields.endTime])});if("Month"===this.parent.currentView)e[this.fields.isAllDay]?(p=[u],t.addClass([u],"e-text-center")):c.count<=1&&!c.isLeft&&!c.isRight?p=[g,u]:(p=[],t.addClass([u],"e-text-center"),c.isLeft||p.push(g),p.push(u),c.isRight||p.push(v));else{var m=void 0;if(e[this.fields.isAllDay])m=[u,t.createElement("div",{className:"e-time",innerHTML:this.parent.localeObj.getConstant("allDay")})];else{var f=this.parent.getTimeString(c[this.fields.startTime])+" - "+this.parent.getTimeString(c[this.fields.endTime]),y=t.createElement("div",{className:"e-time"+(this.parent.isAdaptive?" e-disable":""),innerHTML:f}),T=t.createElement("div",{className:"e-location"});this.parent.sanitize(d,T),m=[u,y,T]}var w=t.createElement("div",{className:"e-inner-wrap"});t.append(m,w),p=[w]}}else{var D=this.parent.element.id+"_"+this.parent.activeViewOptions.eventTemplateName+"eventTemplate",b=this.isResourceEventTemplate?this.parent.getEventTemplateName(i):"eventTemplate";p=this.parent.getAppointmentTemplate()(h,this.parent,b,D,!1,void 0,void 0,this.parent.root)}return t.append(p,l),this.appendEventIcons(e,l),this.renderResizeHandler(o,e.data,e[this.fields.isReadonly]),o},i.prototype.appendEventIcons=function(e,i){var n=e.data;if(!t.isNullOrUndefined(e[this.fields.recurrenceRule])||!t.isNullOrUndefined(e[this.fields.recurrenceID])){var r=e[this.fields.id]===e[this.fields.recurrenceID]?"e-recurrence-icon":"e-recurrence-edit-icon";i.appendChild(t.createElement("div",{className:et+" "+r+(this.parent.isAdaptive?" e-disable":"")}))}if(n.isLeft){var a=t.createElement("div",{className:"e-indicator e-icons e-left-icon"});t.prepend([a],i)}if(n.isRight){var s=t.createElement("div",{className:"e-indicator e-icons e-right-icon"});t.append([s],i)}},i.prototype.renderEvents=function(e,i,n){var r=e[this.fields.startTime],a=e[this.fields.endTime],s=this.parent.getIndexOfDate(this.dateRender,b(r));if(!(s<0||r.getTime()<this.parent.minDate.getTime()||a.getTime()>this.parent.maxDate.getTime())){var o=this.parent.rowAutoHeight?1:this.parent.activeViewOptions.maxEventsPerRow,l=this.getIndex(r);e.Index=l;var p=e.data.count;if(r.getTime()<=a.getTime()){var c=p*this.cellWidth-5,h=this.workCells[parseInt(s.toString(),10)],d=l*(this.eventHeight+0),u=this.monthHeaderHeight+(l+1)*(this.eventHeight+0)+this.moreIndicatorHeight,g=!this.parent.activeViewOptions.maxEventsPerRow||this.parent.rowAutoHeight||this.parent.eventSettings.enableIndicator?this.maxOrIndicator?l<1:this.cellHeight>u:l<o;if(this.parent.rowAutoHeight||g){this.renderedEvents.push(t.extend({},e,null,!0));var v=void 0;if(v=this.inlineValue?this.parent.inlineModule.createInlineAppointmentElement():this.createAppointmentElement(e,i),this.applyResourceColor(v,e,"backgroundColor",this.groupOrder),this.wireAppointmentEvents(v,e),t.setStyleAttribute(v,{width:c+"px",top:d+"px"}),this.renderEventElement(e,v,h),this.parent.rowAutoHeight){var m=this.parent.element.querySelector(".e-content-wrap"),f=this.parent.getElementWidth(m),y=m.offsetHeight===m.clientHeight&&m.offsetWidth===m.clientWidth,T=h.parentElement.firstElementChild;this.updateCellHeight(T,u),y&&(m.offsetWidth>m.clientWidth||f!==this.parent.getElementWidth(m))&&this.adjustAppointments(f)}}else for(var w=0;w<p;w++)if(this.workCells[s+w]){var D=this.workCells[s+w].querySelector(".e-more-indicator");if(D){var C=parseInt(D.getAttribute("data-count"),10)+1;D.setAttribute("data-count",C.toString()),D.setAttribute("aria-label",C+" "+this.parent.localeObj.getConstant("moreEvents")),D.innerHTML=this.getMoreIndicatorText(C)}else{var S=new Date(this.dateRender[s+w].getTime()),E=O(this.dateRender[s+w],1),x=this.workCells[s+w].getAttribute("data-group-index"),V=this.getMoreIndicatorElement(1,S,E);t.isNullOrUndefined(x)||V.setAttribute("data-group-index",x),V.style.top=this.cellHeight-this.monthHeaderHeight-this.moreIndicatorHeight+"px",V.style.width=this.cellWidth-2+"px",this.renderElement(this.workCells[s+w],V),t.EventHandler.add(V,"click",this.moreIndicatorClick,this)}}}}},i.prototype.adjustAppointments=function(e){var t=this,i=this.parent.element.querySelector("."+nt+" tbody tr"),n=this.parent.getElementWidth(this.workCells[0]);this.cellWidth=n/+(this.workCells[0].getAttribute("colspan")||1);var r=n*i.children.length/(e/100);[].slice.call(this.parent.element.querySelectorAll(".e-appointment")).forEach(function(e){t.parent.enableRtl&&"0px"!==e.style.right?e.style.right=parseFloat(e.style.right)/100*r+"px":"0px"!==e.style.left&&(e.style.left=parseFloat(e.style.left)/100*r+"px"),e.style.width=parseFloat(e.style.width)/100*r+"px"})},i.prototype.updateCellHeight=function(e,i){i>e.offsetHeight&&t.setStyleAttribute(e,{height:i+"px"})},i.prototype.updateBlockElements=function(){for(var e=0,i=[].slice.call(this.element.querySelectorAll(".e-block-appointment"));e<i.length;e++){var n=i[e],r=t.closest(n,"tr");this.monthHeaderHeight=n.offsetParent.offsetTop-r.offsetTop,n.style.height=r.offsetHeight-1-this.monthHeaderHeight+"px";var a=r.firstElementChild,s=Math.round(n.offsetWidth/a.offsetWidth);n.style.width=a.offsetWidth*s+"px"}},i.prototype.getFilteredEvents=function(e,i,n,r){var a;if(t.isNullOrUndefined(n))a=this.filterEvents(e,i);else{var s=this.parent.resourceBase.lastResourceLevel[parseInt(n,10)];a=this.filterEvents(e,i,t.isNullOrUndefined(r)?void 0:r,s)}return a},i.prototype.getOverlapEvents=function(e,t){for(var i=[],n=b(e).getTime(),r=0,a=t;r<a.length;r++){var s=a[r];b(s[this.fields.startTime]).getTime()<=n&&b(s[this.fields.endTime]).getTime()>=n&&i.push(s)}return i},i.prototype.getIndex=function(e){var t=-1,i=this.renderedEvents;if(i.length>0){var n=this.getOverlapEvents(e,i).map(function(e){return e.Index});t=n.length>0?this.getSmallestMissingNumber(n):0}return-1===t?0:t},i.prototype.moreIndicatorClick=function(e){var i=this,n=t.closest(e.target,".e-more-indicator"),r=new Date(parseInt(n.getAttribute("data-start-date"),10)),a=new Date(parseInt(n.getAttribute("data-end-date"),10)),s=n.getAttribute("data-group-index"),o={cancel:!1,event:e,element:n,isPopupOpen:!0,startTime:r,endTime:a,viewName:this.parent.getNavigateView()};s&&(o.groupIndex=parseInt(s,10)),this.parent.trigger("moreEventsClick",o,function(t){if(!t.cancel)if(t.isPopupOpen){var n=i.getFilteredEvents(r,a,s),o={date:r,event:n,element:e.target};i.parent.quickPopup.moreEventClick(o,a,s)}else i.parent.setProperties({selectedDate:r},!0),i.parent.changeView(t.viewName,e)})},i.prototype.renderEventElement=function(e,t,i){var n=this,r=t.classList.contains("e-block-appointment")?"blockEvent":"event",a=t.classList.contains("e-appointment"),s={data:"Month"===this.parent.currentView?this.getSpannedTime(e):this.getEventData(e),element:t,cancel:!1,type:r};this.parent.trigger("eventRendered",s,function(e){e.cancel?n.renderedEvents.pop():n.renderElement(i,t,a)})},i.prototype.getSpannedTime=function(e){var i=t.extend({},e,null,!0);return i[this.fields.startTime].getDate()===i.data[this.fields.startTime].getDate()&&(i[this.fields.startTime]=i.data[this.fields.startTime]),i[this.fields.endTime].getDate()===i.data[this.fields.endTime].getDate()&&(i[this.fields.endTime]=i.data[this.fields.endTime]),i},i.prototype.getEventData=function(e){var i=t.extend({},e,null,!0);return i[this.fields.startTime]=e.data[this.fields.startTime],i[this.fields.endTime]=e.data[this.fields.endTime],i},i.prototype.renderElement=function(e,i,n){void 0===n&&(n=!1),this.maxOrIndicator&&n&&this.setMaxEventHeight(i,e);var r=e.querySelector(".e-appointment-wrapper");if(r)r.appendChild(i);else{var a=t.createElement("div",{className:"e-appointment-wrapper"});a.appendChild(i),e.appendChild(a)}},i.prototype.getMoreIndicatorElement=function(e,i,n){return t.createElement("div",{className:"e-more-indicator",innerHTML:this.getMoreIndicatorText(e),attrs:{role:"button",tabindex:"0","aria-label":this.parent.globalize.formatNumber(e)+" "+this.parent.localeObj.getConstant("moreEvents"),"data-count":e.toString(),"data-start-date":i.getTime().toString(),"data-end-date":n.getTime().toString()}})},i.prototype.getMoreIndicatorText=function(e){return"+"+this.parent.globalize.formatNumber(e)+" "+(this.parent.isAdaptive?"":this.parent.localeObj.getConstant("more"))},i.prototype.removeHeightProperty=function(e){for(var t=0,i=[].slice.call(this.element.querySelectorAll("."+e+" tbody tr"));t<i.length;t++)i[t].firstElementChild.style.height=""},i.prototype.setMaxEventHeight=function(e,i){var n=P(i.querySelector(".e-date-header")),r=i.offsetHeight-n-(this.maxHeight?0:this.moreIndicatorHeight);t.setStyleAttribute(e,{height:r+"px","align-items":"center"})},i.prototype.destroy=function(){this.element=null,this.fields=null,this.maxHeight=null,this.withIndicator=null,this.maxOrIndicator=null,this.moreIndicatorHeight=null,this.removeEventListener(),e.prototype.destroy.call(this)},i}(Lt),Wt=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),zt=function(e){function i(t,i){var n=e.call(this,t)||this;n.startHour=n.parent.activeView.getStartHour(),n.endHour=n.parent.activeView.getEndHour(),n.slotCount=n.parent.activeViewOptions.timeScale.slotCount,n.interval=n.parent.activeViewOptions.timeScale.interval,n.day=0,n.rowIndex=0,n.cellTops=[],n.renderType=i,n.eventContainers=[].slice.call(n.element.querySelectorAll("."+at));var r=[].slice.call(n.element.querySelectorAll("."+nt+" tbody tr"));return n.dayLength=0===r.length?0:r[0].children.length,n.content=n.parent.element.querySelector("."+it+"."+nt),n}return Wt(i,e),i.prototype.getSlotDates=function(){if(this.slots=[],this.slots.push(this.parent.activeView.renderDates.map(function(e){return+e})),this.parent.activeViewOptions.headerRows.length>0&&"Hour"!==this.parent.activeViewOptions.headerRows.slice(-1)[0].option){this.renderType="day";var e=this.content.querySelector(".e-work-cells");this.cellWidth=this.parent.getElementWidth(e)/+(e.getAttribute("colspan")||1),this.slotsPerDay=1}else this.slotsPerDay=this.dayLength/this.dateRender.length},i.prototype.getOverlapEvents=function(e,t){var i=[];if("day"===this.renderType)for(var n=0,r=t;n<r.length;n++)b((o=r[n])[this.fields.startTime]).getTime()<=b(new Date(e.getTime())).getTime()&&b(o[this.fields.endTime]).getTime()>=b(new Date(e.getTime())).getTime()&&i.push(o);else for(var a=0,s=t;a<s.length;a++){var o=s[a],l=o.data;(l.trimStartTime.getTime()<=e.getTime()&&l.trimEndTime.getTime()>e.getTime()||l.trimStartTime.getTime()===e.getTime()&&l.trimEndTime.getTime()===e.getTime())&&i.push(o)}return i},i.prototype.getSortComparerIndex=function(e,t){var i=-1,n=this.renderedEvents;if(n.length>0){var r=this.getOverlapSortComparerEvents(e,t,n).map(function(e){return e.Index});i=r.length>0?this.getSmallestMissingNumber(r):0}return-1===i?0:i},i.prototype.getOverlapSortComparerEvents=function(e,t,i){for(var n=[],r=this,a=0,s=i;a<s.length;a++)!function(i){if("day"===r.renderType){var a=b(e).getTime(),s=b(t).getTime(),o=b(i[r.fields.startTime]).getTime(),l=b(i[r.fields.endTime]).getTime();(o<=a&&l>=a||function(){var e=s-(C(t)<=0?Qe:0);return e=a>e?a:e,l>=e&&o<=e}()||o>a&&l<s)&&n.push(i)}else{var p=i.data;(p.trimStartTime.getTime()<=e.getTime()&&e.getTime()<p.trimEndTime.getTime()||e.getTime()<=p.trimStartTime.getTime()&&p.trimStartTime.getTime()<t.getTime())&&n.push(i)}}(s[a]);return n},i.prototype.renderResourceEvents=function(){this.removeHeightProperty("e-resource-column-table");this.addCellHeight(".e-resource-column-table tbody tr",this.eventHeight,2,this.moreIndicatorHeight,0,!1);var e=this.parent.uiStateValues.isGroupAdaptive?[this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]]:this.parent.resourceBase.renderedResources;if(this.parent.crudModule&&this.parent.crudModule.crudObj.isCrudAction){for(var t=0,i=this.parent.crudModule.crudObj.sourceEvent.length;t<i;t++){var n=this.parent.crudModule.crudObj.sourceEvent[parseInt(t.toString(),10)];if(this.rowIndex=n.groupIndex,(!this.parent.uiStateValues.isGroupAdaptive||this.parent.uiStateValues.groupIndex===n.groupIndex&&this.parent.uiStateValues.isGroupAdaptive)&&this.renderEventsHandler(this.parent.activeView.renderDates,this.parent.activeViewOptions.workDays,n),this.parent.crudModule.crudObj.targetEvent[parseInt(t.toString(),10)]&&this.parent.crudModule.crudObj.sourceEvent[parseInt(t.toString(),10)].groupIndex!==this.parent.crudModule.crudObj.targetEvent[parseInt(t.toString(),10)].groupIndex){var r=this.parent.crudModule.crudObj.targetEvent[parseInt(t.toString(),10)];this.rowIndex=r.groupIndex,this.renderEventsHandler(this.parent.activeView.renderDates,this.parent.activeViewOptions.workDays,r)}}this.parent.crudModule.crudObj.isCrudAction=!1}else for(t=0;t<e.length;t++)this.rowIndex=t,this.renderEventsHandler(this.parent.activeView.renderDates,this.parent.activeViewOptions.workDays,e[parseInt(t.toString(),10)])},i.prototype.renderEvents=function(e,i,n){var r=e[this.fields.startTime],a=e[this.fields.endTime];if(!(r.getTime()<this.parent.minDate.getTime()||a.getTime()>this.parent.maxDate.getTime())){var s=e.data;r=this.getStartTime(e,s),a=this.getEndTime(e,s);var o=V(e[this.fields.startTime],this.startHour,this.endHour),l=this.updateEventMinimumDuration(o,r,a);if(r=l.startDate,a=l.endDate,this.day=this.parent.getIndexOfDate(this.dateRender,b(new Date(r.getTime()))),!(this.day<0)){var p=this.getCellTd(),c=this.parent.rowAutoHeight?1:this.parent.activeViewOptions.maxEventsPerRow,h=t.isNullOrUndefined(this.parent.eventSettings.sortComparer)?this.getIndex(r):this.getSortComparerIndex(r,a);e.Index=h;var d=this.eventHeight,u=s.count,g=t.extend({},e,null,!0);g[this.fields.startTime]=s[this.fields.startTime],g[this.fields.endTime]=s[this.fields.endTime];var v=V(b(new Date(this.dateRender[this.day].getTime())),this.startHour,this.endHour),m=!0;if(m=!(!this.isDayProcess()&&!g[this.fields.isAllDay])||this.isValidEvent(g,r,a,v),r<=a&&m){var f=this.getEventWidth(r,a,e[this.fields.isAllDay],u);f="day"===this.renderType?f-2:f;var y=0,T=0,w=this.getPosition(r,a,e[this.fields.isAllDay],this.day);f=f<=0?this.cellWidth:f,this.renderedEvents.push(t.extend({},e,null,!0)),t.isNullOrUndefined(this.cellTops[parseInt(i.toString(),10)])&&(this.cellTops[parseInt(i.toString(),10)]=this.getRowTop(i));var D=this.cellTops[parseInt(i.toString(),10)],C=D+(this.maxHeight?0:2)+h*(d+2);y=this.parent.enableRtl?0:w,T=this.parent.enableRtl?w:0;var S=(h+1)*(d+2)+this.moreIndicatorHeight,E=!this.parent.activeViewOptions.maxEventsPerRow||this.parent.rowAutoHeight||this.parent.eventSettings.enableIndicator?this.maxOrIndicator?h<1:this.cellHeight>S:h<c;if(this.parent.rowAutoHeight||E){var x=void 0;if(x=t.isNullOrUndefined(this.inlineValue)?this.createAppointmentElement(e,i):this.parent.inlineModule.createInlineAppointmentElement(),this.applyResourceColor(x,e,"backgroundColor",this.groupOrder),t.setStyleAttribute(x,{width:f+"px",left:y+"px",right:T+"px",top:C+"px"}),this.wireAppointmentEvents(x,e),this.parent.rowAutoHeight){var A=this.parent.element.querySelector(".e-content-wrap"),I=this.parent.getElementWidth(A),k=A.offsetHeight===A.clientHeight&&A.offsetWidth===A.clientWidth;this.renderEventElement(e,x,p);var M=this.getFirstChild(i);this.updateCellHeight(M,S),k&&(A.offsetWidth>A.clientWidth||I!==this.parent.getElementWidth(A))&&this.adjustAppointments(I)}else this.renderEventElement(e,x,p)}else for(var R=0;R<u;R++){var H=p.querySelector(".e-more-indicator"),P=this.parent.enableRtl?T:y;P=Math.floor(P/this.cellWidth)*this.cellWidth;var j=this.interval/this.slotCount,N="TimelineMonth"===this.parent.activeViewOptions.option||"day"===this.renderType||0!==R?new Date(this.dateRender[this.day+R].getTime()):new Date(r),q=O(this.dateRender[this.day+R],1);if("TimelineMonth"===this.parent.activeViewOptions.option||"day"===this.renderType){var F=this.getPosition(N,q,e[this.fields.isAllDay],this.day+R);this.renderTimelineMoreIndicator(r,N,q,d,j,i,n,D,y,T,p,H,P,F)}else for(var U=(L(a)-L(r))/Ke*this.slotCount/this.interval,B=0;B<U&&(N=0===B?new Date(N.getTime()):new Date(N.getTime()+6e4*j),U<1&&(N=this.adjustToNearestTimeSlot(N,j)),q=new Date(N.getTime()+6e4*j),!(U>=1&&q.getTime()>a.getTime()));B++){var W=this.getPosition(N,q,!1,this.day+R);if(P>W)break;P=W,this.renderTimelineMoreIndicator(r,N,q,d,j,i,n,D,y,T,p,H,P,W)}}}this.parent.renderTemplates()}}},i.prototype.adjustToNearestTimeSlot=function(e,t){var i=new Date(e),n=60*i.getHours()*60*1e3+60*i.getMinutes()*1e3,r=Math.floor(n/(60*t*1e3))*(60*t*1e3),a=new Date(i.getTime());return a.setHours(r/36e5%24),a.setMinutes(r%36e5/6e4),a},i.prototype.renderTimelineMoreIndicator=function(e,i,n,r,a,s,o,l,p,c,h,d,u,g){if(p=this.parent.enableRtl?c=g:g,u=this.parent.enableRtl?c:p,u=Math.floor(u/this.cellWidth)*this.cellWidth,h&&t.isNullOrUndefined(d)||!this.isAlreadyAvail(u,h)){var v="TimelineMonth"===this.parent.activeViewOptions.option||"day"===this.renderType?new Date(+e):i,m=new Date(v.setMinutes(Math.floor(v.getMinutes()/a)*a)),f=new Date(m.getTime()+6e4*a),y=void 0;this.parent.activeViewOptions.group.resources.length>0&&!t.isNullOrUndefined(s)&&(y=s.toString());var T=this.getFilterEvents(i,n,m,f,y,o),w=this.cellHeight-this.moreIndicatorHeight;r=this.withIndicator?w-2:r;var D=Math.floor(w/(r+2)),b=this.parent.activeViewOptions.maxEventsPerRow&&!this.parent.eventSettings.enableIndicator?T.length-this.parent.activeViewOptions.maxEventsPerRow:T.length-D<=0?1:T.length-D,C=void 0;C="day"===this.renderType?this.getMoreIndicatorElement(b,i,n):this.getMoreIndicatorElement(b,m,f),t.isNullOrUndefined(y)||C.setAttribute("data-group-index",y),C.style.top=l+w+"px",C.style.width=this.cellWidth+"px",C.style.left=Math.floor(p/this.cellWidth)*this.cellWidth+"px",C.style.right=Math.floor(c/this.cellWidth)*this.cellWidth+"px",this.renderElement(h,C),t.EventHandler.add(C,"click",this.moreIndicatorClick,this)}},i.prototype.updateCellHeight=function(e,i){if(i>(""===e.style.height?this.cellHeight:parseInt(e.style.height,10))){if(t.setStyleAttribute(e,{height:i+"px"}),this.parent.activeViewOptions.group.resources.length>0){var n=this.parent.element.querySelector('.e-resource-column-table tbody td[data-group-index="'+e.getAttribute("data-group-index")+'"]');n&&t.setStyleAttribute(n,{height:i+"px"})}var r=this.parent.element.querySelector(".e-month-header-wrapper table tr:nth-child("+(e.parentElement.rowIndex+1)+") td");r&&t.setStyleAttribute(r,{height:i+"px"})}},i.prototype.getFirstChild=function(e){var t="."+nt+" tbody td",i="";return this.parent.activeViewOptions.group.resources.length>0&&(i='[data-group-index="'+e.toString()+'"]'),this.parent.element.querySelector(t+i)},i.prototype.updateBlockElements=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll(".e-block-appointment"));e<t.length;e++){var i=t[e],n=parseInt(i.getAttribute("data-group-index"),10),r=this.getFirstChild(n);i.style.height=r.offsetHeight-1+"px";var a=i.offsetWidth/r.offsetWidth;i.style.width=r.offsetWidth*a+"px"}for(var s=0,o=[].slice.call(this.element.querySelectorAll(".e-block-indicator"));s<o.length;s++){var i=o[s],n=parseInt(i.getAttribute("data-group-index"),10);i.style.top=this.getRowTop(n)+this.getFirstChild(n).offsetHeight-18+"px"}},i.prototype.getStartTime=function(e,t){var i=e[this.fields.startTime],n=V(i,this.startHour,this.endHour);return i=this.isDayProcess()?e[this.fields.startTime]:n.startHour.getTime()>=t[this.fields.startTime]?n.startHour:n.endHour.getTime()<=t[this.fields.startTime]?this.getNextDay(n.startHour,t):t[this.fields.startTime],t.trimStartTime=e[this.fields.isAllDay]?n.startHour:t[this.fields.startTime],i},i.prototype.getNextDay=function(e,t){for(var i,n=1;n<=this.dateRender.length;n++)if(i=O(e,n),-1!==this.parent.getIndexOfDate(this.dateRender,b(new Date(e.getTime()))))return t.count=t.count-1,i;return i},i.prototype.getEndTime=function(e,t){var i=e[this.fields.endTime],n=V(i,this.startHour,this.endHour);return this.isDayProcess()?i=t[this.fields.endTime]:(i=t[this.fields.endTime],(n.endHour.getTime()<=t[this.fields.endTime]||e[this.fields.isAllDay])&&(i=n.endHour),n.startHour.getTime()>=t[this.fields.endTime].getTime()&&!e[this.fields.isAllDay]&&(i=this.getPreviousDay(n.startHour,n.endHour,t))),t.trimEndTime=e[this.fields.isAllDay]?n.endHour:t[this.fields.endTime],i},i.prototype.getPreviousDay=function(e,t,i){for(var n=1;n<=this.dateRender.length;n++){var r=O(t,-n);if(-1!==this.parent.getIndexOfDate(this.dateRender,b(new Date(e.getTime())))){(r=b(new Date(r.getTime()))).setHours(t.getHours(),t.getMinutes(),t.getSeconds());var a=i.count,s=i[this.fields.endTime];return i.count=0!==s.getHours()||0!==s.getMinutes()?a-1:a,r}}return i[this.fields.endTime]},i.prototype.getEventWidth=function(e,t,i,n){return"day"===this.renderType||i?n*this.slotsPerDay*this.cellWidth:this.isSameDay(e,t)?this.getSameDayEventsWidth(e,t):this.getSpannedEventsWidth(e,t,n)},i.prototype.getSameDayEventsWidth=function(e,t){return(L(t)-L(e))/Ke*(this.cellWidth*this.slotCount)/this.getIntervalInMinutes(e)},i.prototype.getSpannedEventsWidth=function(e,t,i){var n,r=i*this.slotsPerDay*this.cellWidth,a=V(b(new Date(e.getTime())),this.startHour,this.endHour),s=this.getSameDayEventsWidth(a.startHour,e);if(-1===this.parent.getIndexOfDate(this.dateRender,b(new Date(t.getTime()))))n=0;else{var o=V(b(new Date(t.getTime())),this.startHour,this.endHour),l=o.startHour,p=o.endHour,c=this.interval/this.slotCount,h=this.getEndTimeOfLastSlot(l,p,c),d=p<h?p:h;n=this.getSameDayEventsWidth(t,d),n=this.slotsPerDay*this.cellWidth===n?0:n}var u=s+n;return r>u?r-u:r-s},i.prototype.getEndTimeOfLastSlot=function(e,t,i){var n=(t.getTime()-e.getTime())/6e4,r=Math.floor(n/i)*i,a=new Date(e);return a.setMinutes(r),a},i.prototype.isSameDay=function(e,t){return this.parent.getIndexOfDate(this.dateRender,b(new Date(e.getTime())))===this.parent.getIndexOfDate(this.dateRender,b(new Date(t.getTime())))},i.prototype.getAppointmentLeft=function(e,t,i){var n=this.isSameDay(t,e.startHour)?(L(t)-L(e.startHour))/(Ke*this.getIntervalInMinutes(t))*this.slotCount:0;return 0===i?n:Math.round((L(e.endHour)-L(e.startHour))/this.interval/Ke*this.slotCount)*i+n},i.prototype.getPosition=function(e,t,i,n){if("day"===this.renderType||i)return n*this.slotsPerDay*this.cellWidth;var r=V(b(new Date(this.dateRender[parseInt(n.toString(),10)].getTime())),this.startHour,this.endHour);return(r.endHour.getTime()<=t.getTime()&&r.startHour.getTime()>=e.getTime()?this.getAppointmentLeft(r,r.startHour,n):r.endHour.getTime()<=t.getTime()?this.getAppointmentLeft(r,e,n):r.startHour.getTime()>=e.getTime()?this.getAppointmentLeft(r,r.startHour,n):this.getAppointmentLeft(r,e,n))*this.cellWidth},i.prototype.getFilterEvents=function(e,t,i,n,r,a){return"day"===this.renderType?this.getFilteredEvents(e,t,r,a):this.getFilteredEvents(i,n,r,a)},i.prototype.getIntervalInMinutes=function(e){if(1!==this.slotsPerDay)return this.interval;var t=V(b(new Date(e.getTime())),this.startHour,this.endHour);return(t.endHour.getTime()-t.startHour.getTime())/Ke},i.prototype.isAlreadyAvail=function(e,t){for(var i=[].slice.call(t.querySelectorAll(".e-more-indicator")),n=0;n<i.length;n++){var r=void 0;if(i&&(r=this.parent.enableRtl?i[parseInt(n.toString(),10)].style.right:i[parseInt(n.toString(),10)].style.left),parseInt(r,10)===Math.floor(e))return!0}return!1},i.prototype.getRowTop=function(e){return this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive?this.parent.element.querySelector('.e-content-wrap tbody td[data-group-index="'+e.toString()+'"]').offsetTop:0},i.prototype.getCellTd=function(){var e=this.parent.uiStateValues.isGroupAdaptive?0:this.rowIndex;return this.eventContainers[parseInt(e.toString(),10)]},i.prototype.renderBlockIndicator=function(e,i,n){if(!(this.parent.headerRows.length>0&&("Hour"!==this.parent.headerRows[this.parent.headerRows.length-1].option||"Date"!==this.parent.headerRows[this.parent.headerRows.length-1].option)||(i=Math.floor(i/this.cellWidth)*this.cellWidth+this.cellWidth-22,this.isAlreadyAvail(i,e)))){var r=t.createElement("div",{className:"e-icons e-block-indicator"});this.parent.activeViewOptions.group.resources.length>0&&r.setAttribute("data-group-index",n.toString()),this.parent.enableRtl?r.style.right=i+"px":r.style.left=i+"px",r.style.top=this.getRowTop(n)+this.cellHeight-18+"px",this.renderElement(e,r)}},i.prototype.setMaxEventHeight=function(e,i){t.setStyleAttribute(e,{height:this.cellHeight-(this.maxHeight?0:2)-(this.maxHeight?0:this.moreIndicatorHeight)+"px"})},i.prototype.isDayProcess=function(){return"TimelineMonth"===this.parent.currentView||!this.parent.activeViewOptions.timeScale.enable||this.parent.activeViewOptions.headerRows.length>0&&"Hour"!==this.parent.activeViewOptions.headerRows.slice(-1)[0].option},i.prototype.destroy=function(){this.renderType=null,this.eventContainers=null,this.dayLength=null,this.content=null,e.prototype.destroy.call(this),this.parent=null},i}(Bt),Yt=function(){function e(e){this.parent=e,this.parent.on(Ye,this.inlineEdit,this)}return e.prototype.inlineEdit=function(e){if(this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(),"Cell"===e.type){var t=this.parent.element.querySelector(".e-more-popup-wrapper");t&&t.classList.contains(rt)&&this.parent.quickPopup.morePopup.hide(),this.removeInlineAppointmentElement(),this.cellEdit(e)}else this.parent.element.querySelector(".e-inline-subject")!==e.element.querySelector(".e-inline-subject")&&this.removeInlineAppointmentElement(),this.eventEdit(e)},e.prototype.cellEdit=function(e){var t=this.generateEventData(),i=e.element.cellIndex,n=this.getEventDaysCount(t);n>1&&(n=Math.round(n),i-=--n);var r=b(new Date(""+t[this.parent.eventFields.startTime])).getTime(),a=b(new Date(""+t[this.parent.eventFields.endTime])).getTime(),s=e.groupIndex||0,o="Day"===this.parent.currentView||"Week"===this.parent.currentView||"WorkWeek"===this.parent.currentView;if(this.parent.activeViewOptions.timeScale.enable&&o){var l=t[this.parent.eventFields.startTime].getDay();this.createVerticalViewInline(t,l,s,i)}else"Month"===this.parent.currentView||!this.parent.activeViewOptions.timeScale.enable&&o?this.createMonthViewInline(t,s,r,a):this.createTimelineViewInline(t,r,a,s);var p=this.parent.element.querySelector(".e-inline-subject");p&&p.focus()},e.prototype.eventEdit=function(e){var i,n=e.element.querySelector(".e-inline-subject");if(t.addClass([e.element],"e-inline-edit"),n)i=n.value;else{var r=e.element.querySelector(".e-subject");if(t.isNullOrUndefined(r)||t.addClass([r],"e-disable"),i=!t.isNullOrUndefined(e.data)&&e.data[this.parent.eventFields.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),n=this.inlineInputEle=t.createElement("input",{className:"e-inline-subject",attrs:{value:i}}),t.closest(e.element,".e-more-popup-wrapper"))e.element.insertBefore(n,r);else if(["Agenda","MonthAgenda"].indexOf(this.parent.currentView)>-1){var a=e.element.querySelector(".e-subject-wrap");t.isNullOrUndefined(a)&&(a=t.createElement("div",{className:"e-subject-wrap"}),e.element.prepend(a)),a.insertBefore(n,a.firstChild)}else{var s=["TimelineDay","TimelineWeek","TimelineWorkWeek","TimelineMonth"].indexOf(this.parent.currentView)>-1?".e-inner-wrap":".e-appointment-details",o=e.element.querySelector(s);t.isNullOrUndefined(o)?e.element.querySelector(".e-appointment-details").prepend(n):r&&this.parent.activeViewOptions&&!this.parent.activeViewOptions.eventTemplate?o.insertBefore(n,r):o.prepend(n)}n.focus()}n.setSelectionRange(i.length,i.length)},e.prototype.createVerticalViewInline=function(e,t,i,n){var r,a=this.getEventDaysCount(e),s=new Ft(this.parent);s.initializeValues();var o=s.dateRender[parseInt(i.toString(),10)].map(function(e){return e.getDay()}).indexOf(t);if(a>=1){s.allDayElement=[].slice.call(this.parent.element.querySelectorAll(".e-all-day-cells")),(r=s.slots).push.apply(r,this.parent.activeView.renderDates.map(function(e){return+e}));var l=[].slice.call(this.parent.element.querySelectorAll(".e-all-day-appointment")),p=0;l.length>0&&(p=Math.floor(this.parent.getElementHeight(this.parent.element.querySelector(".e-all-day-row"))/l[0].offsetHeight)-1),s.allDayLevel=p;var c=this.parent.getElementHeightFromClass(this.parent.element.querySelector(".e-all-day-appointment-wrapper"),"e-appointment"),h=s.allDayElement.length>0?s.allDayElement[0].offsetTop:0;s.renderAllDayEvents(e,o,i,n,this.parent.allowInline,h,c)}else s.renderNormalEvents(e,o,i,n,this.parent.allowInline)},e.prototype.createMonthViewInline=function(e,t,i,n){var r=this.getEventDaysCount(e),a=this.parent.eventBase.cloneEventObject(e,i,n,r,!1,!1),s=new Bt(this.parent);s.dateRender=this.parent.activeView.renderDates,s.inlineValue=this.parent.allowInline;var o=this.parent.activeView.renderDates,l=this.parent.activeViewOptions.workDays,p=".e-work-cells";if(this.parent.activeViewOptions.group.resources.length>0){p+='[data-group-index="'+t+'"]';var c=this.parent.resourceBase.lastResourceLevel[parseInt(t.toString(),10)];o=c.renderDates,l=c.workDays}s.dateRender=o,s.workCells=[].slice.call(this.parent.element.querySelectorAll(p)),s.cellWidth=s.workCells[0].offsetWidth,s.cellHeight=s.workCells[0].offsetHeight,s.eventHeight=this.parent.getElementHeightFromClass(this.parent.monthModule.element||s.element,"e-appointment"),s.getSlotDates(l);for(var h=s.getRenderedDates(o),d=0,u=s.splitEvent(a,h||o);d<u.length;d++){var g=u[d];s.renderEvents(g,t)}this.parent.element.querySelector(".e-inline-subject").focus()},e.prototype.createTimelineViewInline=function(e,t,i,n){var r=this.getEventDaysCount(e),a=this.parent.eventBase.cloneEventObject(e,t,i,r,!1,!1),s=new zt(this.parent,this.parent.activeViewOptions.timeScale.enable?"hour":"day");s.dateRender=this.parent.activeView.renderDates,s.eventContainers=[].slice.call(this.parent.element.querySelectorAll("."+at));var o=this.parent.element.querySelector(".e-work-cells");s.inlineValue=this.parent.allowInline,s.cellWidth=o.offsetWidth,s.cellHeight=o.offsetHeight;var l=0===this.parent.element.querySelectorAll("."+nt+" tbody tr").length?0:this.parent.element.querySelectorAll("."+nt+" tbody tr")[0].children.length;s.slotsPerDay=l/s.dateRender.length,s.eventHeight=this.parent.getElementHeightFromClass(s.element,"e-appointment"),s.renderEvents(a,n)},e.prototype.getEventDaysCount=function(e){var t=e[this.parent.eventFields.startTime],i=e[this.parent.eventFields.endTime];return Math.abs(i.getTime()-t.getTime())/Qe},e.prototype.generateEventData=function(e){var t=this.parent.element.querySelector(".e-inline-subject"),i=t?t.value:e?e.innerHTML:"",n={};return n[this.parent.eventFields.id]=this.parent.eventBase.getEventMaxID(),n[this.parent.eventFields.subject]=i,n[this.parent.eventFields.startTime]=this.parent.activeCellsData.startTime,n[this.parent.eventFields.endTime]=this.parent.activeCellsData.endTime,n[this.parent.eventFields.isAllDay]=this.parent.activeCellsData.isAllDay,this.parent.eventWindow.setDefaultValueToObject(n),this.parent.resourceBase&&this.parent.resourceBase.setResourceValues(n,this.parent.activeCellsData.groupIndex),n},e.prototype.documentClick=function(e){e&&""!==e.value?this.inlineCrudActions(e):this.removeInlineAppointmentElement()},e.prototype.inlineCrudActions=function(e){if(t.closest(e,".e-inline-appointment")){var i=this.generateEventData(e);this.parent.addEvent(i)}else{var n=t.closest(e,".e-appointment"),r=this.parent.getEventDetails(n);r[this.parent.eventFields.subject]=e.value;var a=void 0;r[this.parent.eventFields.id]===r[this.parent.eventFields.recurrenceID]&&(a="EditOccurrence",r[this.parent.eventFields.id]=this.parent.eventBase.getEventMaxID()),this.parent.saveEvent(r,a)}this.removeInlineAppointmentElement()},e.prototype.createInlineAppointmentElement=function(e){var i=t.createElement("div",{className:"e-appointment e-inline-appointment e-inline-edit"}),n=t.createElement("div",{className:"e-appointment-details"});i.appendChild(n);var r=this.inlineInputEle=t.createElement("input",{className:"e-inline-subject"});return n.appendChild(r),e&&this.parent.eventBase.applyResourceColor(i,e,"backgroundColor"),i},e.prototype.removeInlineAppointmentElement=function(){var e=[].slice.call(this.parent.element.querySelectorAll(".e-inline-appointment"));e.length>0&&e.forEach(function(e){var i=e.querySelector(".e-inline-subject");t.isNullOrUndefined(i)||i.blur(),t.remove(e)});var i=this.getInlineElement();if(i){var n=t.closest(i,".e-appointment");t.removeClass([n],"e-inline-edit");var r=n.querySelector(".e-subject");t.isNullOrUndefined(r)||t.removeClass([r],"e-disable"),t.remove(i)}this.inlineInputEle=null},e.prototype.getInlineElement=function(){return this.inlineInputEle},e.prototype.destroy=function(){this.inlineInputEle=null,this.parent.off(Ye,this.inlineEdit)},e}(),_t=function(){function e(){}return e.prototype.renderFormValidator=function(e,t,i,n){var r=this;this.element=i,this.formObj=new o.FormValidator(e,{locale:n,customPlacement:function(e,t){r.errorPlacement(e,t)},rules:t,validationComplete:function(e){r.validationComplete(e)},focusout:function(e){r.focusOut(e)}})},e.prototype.focusOut=function(e){var t=e.relatedTarget;t&&(t.classList.contains("e-dlg-closeicon-btn")||t.classList.contains("e-close")||t.classList.contains("e-all-day-cells")||t.classList.contains("e-header-cells")||t.classList.contains("e-event-details")||t.classList.contains("e-work-cells")||t.classList.contains("e-event-cancel"))?this.ignoreError=!0:this.ignoreError=!1},e.prototype.validationComplete=function(e){var t=this.element.querySelector("#"+e.inputName+"_Error");t&&(t.style.display="failure"===e.status?"":"none")},e.prototype.errorPlacement=function(e,i){var n=i.getAttribute("for"),r=this.element.querySelector("#"+n+"_Error");r||this.ignoreError||this.createTooltip(e,i,n,""),t.isNullOrUndefined(r)||(r.querySelector(".e-error").innerHTML=i.innerHTML)},e.prototype.createTooltip=function(e,i,n,r){var a,s,o=e.getBoundingClientRect();this.element.classList.contains("e-quick-popup-wrapper")?(a=this.element,s=this.element.getBoundingClientRect()):s=(a=this.element.querySelector(".e-schedule-dialog .e-dlg-content")).getBoundingClientRect();var l=t.createElement("div",{className:"e-tooltip-wrap e-popup e-schedule-error",id:n+"_Error",styles:"display:"+r+";top:"+(o.bottom-s.top+a.scrollTop+9)+"px;left:"+(o.left-s.left+a.scrollLeft+o.width/2)+"px;"}),p=t.createElement("div",{className:"e-tip-content"});p.appendChild(i);var c=t.createElement("div",{className:"e-arrow-tip e-tip-top"});c.appendChild(t.createElement("div",{className:"e-arrow-tip-outer e-tip-top"})),c.appendChild(t.createElement("div",{className:"e-arrow-tip-inner e-tip-top"})),l.appendChild(p),l.appendChild(c),a.appendChild(l),l.style.left=parseInt(l.style.left,10)-l.offsetWidth/2+"px"},e.prototype.destroyToolTip=function(){if(this.element)for(var e=0,i=[].slice.call(this.element.querySelectorAll(".e-schedule-error"));e<i.length;e++){var n=i[e];t.remove(n)}this.formObj&&this.formObj.element&&this.formObj.reset()},e.prototype.destroy=function(){this.formObj&&this.formObj.element&&!this.formObj.isDestroyed&&this.formObj.destroy(),this.formObj=null,this.element=null},e}(),Gt=function(){function e(e){this.isMultipleEventSelect=!1,this.isCrudAction=!1,this.parent=e,this.l10n=this.parent.localeObj,this.fieldValidator=new _t,this.render(),this.addEventListener()}return e.prototype.render=function(){this.renderQuickPopup(),this.renderMorePopup(),this.renderQuickDialog()},e.prototype.renderQuickPopup=function(){var e=t.createElement("div",{className:"e-quick-popup-wrapper e-popup-close",attrs:{role:"dialog"}});this.parent.isAdaptive?(document.body.appendChild(e),t.addClass([e],"e-device")):this.parent.element.appendChild(e),this.quickPopup=new i.Popup(e,{targetType:this.parent.isAdaptive?"container":"relative",enableRtl:this.parent.enableRtl,open:this.quickPopupOpen.bind(this),close:this.quickPopupClose.bind(this),hideAnimation:this.parent.isAdaptive?{name:"ZoomOut"}:{name:"FadeOut",duration:150},showAnimation:this.parent.isAdaptive?{name:"ZoomIn"}:{name:"FadeIn",duration:150},collision:this.parent.isAdaptive?{X:"fit",Y:"fit"}:this.parent.enableRtl?{X:"flip",Y:"fit"}:{X:"none",Y:"fit"},position:this.parent.isAdaptive||this.parent.enableRtl?{X:"left",Y:"top"}:{X:"right",Y:"top"},viewPortElement:this.parent.isAdaptive?document.body:this.parent.element,zIndex:this.parent.isAdaptive?1004:3})},e.prototype.renderMorePopup=function(){var e='<div class="e-more-event-popup"><div class="e-more-event-header"><div class="e-more-event-close" title="'+this.l10n.getConstant("close")+'" tabindex="0" role="button"></div><div class="e-more-event-date-header"><div class="e-header-day" id="'+this.parent.element.id+'_more_popup"></div><div class="e-header-date e-navigate" tabindex="0" role="link"></div></div></div></div>',n=t.createElement("div",{className:"e-more-popup-wrapper e-popup-close",innerHTML:e});this.parent.isAdaptive?(document.body.appendChild(n),t.addClass([n],"e-device")):this.parent.element.appendChild(n),this.morePopup=new i.Popup(n,{targetType:this.parent.isAdaptive?"container":"relative",enableRtl:this.parent.enableRtl,hideAnimation:{name:"ZoomOut",duration:300},showAnimation:{name:"ZoomIn",duration:300},open:this.morePopupOpen.bind(this),close:this.morePopupClose.bind(this),collision:this.parent.isAdaptive?{X:"fit",Y:"fit"}:this.parent.enableRtl?{X:"flip",Y:"fit"}:{X:"flip",Y:"flip"},viewPortElement:this.parent.isAdaptive?document.body:this.parent.element,zIndex:this.parent.isAdaptive?1002:2}),this.morePopup.element.setAttribute("role","dialog"),this.morePopup.element.setAttribute("aria-labelledby",this.parent.element.id+"_more_popup");var r=this.morePopup.element.querySelector(".e-more-event-close");this.renderButton("e-round",et+" e-close-icon",!1,r,this.closeClick),t.EventHandler.add(this.morePopup.element.querySelector(".e-header-date"),"click",this.navigationClick,this)},e.prototype.renderQuickDialog=function(){var e=[{buttonModel:{cssClass:"e-quick-alertok e-flat",isPrimary:!0},click:this.dialogButtonClick.bind(this)},{buttonModel:{cssClass:"e-quick-alertcancel e-flat",isPrimary:!1},click:this.dialogButtonClick.bind(this)},{buttonModel:{cssClass:"e-quick-dialog-cancel e-disable e-flat",isPrimary:!1},click:this.dialogButtonClick.bind(this)}];if(this.parent.eventSettings.editFollowingEvents){var n={buttonModel:{cssClass:"e-quick-alertfollowing e-flat",isPrimary:!1},click:this.dialogButtonClick.bind(this)};e.splice(1,0,n)}this.quickDialog=new i.Dialog({animationSettings:{effect:"Zoom"},buttons:e,cssClass:"e-quick-dialog",closeOnEscape:!0,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,beforeClose:this.beforeQuickDialogClose.bind(this),isModal:!0,position:{X:"center",Y:"center"},showCloseIcon:!0,target:document.body,visible:!1,width:"auto"});var r=t.createElement("div",{id:this.parent.element.id+"QuickDialog"});this.parent.element.appendChild(r),this.quickDialog.appendTo(r);var a=this.quickDialog.element.querySelector(".e-quick-alertok");a&&(a.setAttribute("aria-label",this.l10n.getConstant("occurrence")),a.setAttribute("aria-label",a.innerHTML));var s=this.quickDialog.element.querySelector(".e-quick-alertcancel");s&&(s.setAttribute("aria-label",this.l10n.getConstant("series")),s.setAttribute("aria-label",s.innerHTML)),this.quickDialog.element.querySelector(".e-dlg-closeicon-btn")&&this.quickDialog.element.querySelector(".e-dlg-closeicon-btn").setAttribute("title",this.l10n.getConstant("close"))},e.prototype.renderButton=function(e,i,n,r,a){new s.Button({cssClass:e,disabled:n,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,iconCss:i}).appendTo(r),t.EventHandler.add(r,"click",a,this),t.removeClass([r],et)},e.prototype.quickDialogClass=function(e){var i=["e-quick-dialog-occurrence-event","e-quick-dialog-series-event","e-quick-dialog-delete","e-quick-dialog-cancel","e-quick-dialog-alert-btn","e-disable"],n=this.quickDialog.element.querySelector(".e-quick-alertok"),r=this.quickDialog.element.querySelector(".e-quick-alertcancel"),a=this.quickDialog.element.querySelector(".e-quick-alertfollowing");switch(t.removeClass([n,r],i),t.addClass([this.quickDialog.element.querySelector(".e-quick-dialog-cancel")],"e-disable"),this.parent.eventSettings.editFollowingEvents&&(t.addClass([a],"e-disable"),t.removeClass([this.quickDialog.element],"e-following-events-dialog")),e){case"Recurrence":t.addClass([n],"e-quick-dialog-occurrence-event"),t.addClass([r],"e-quick-dialog-series-event"),this.parent.eventSettings.editFollowingEvents&&(t.removeClass([a],"e-disable"),t.addClass([this.quickDialog.element],"e-following-events-dialog"),t.addClass([a],"e-quick-dialog-following-events"));break;case"Delete":t.addClass([n],"e-quick-dialog-delete"),t.addClass([r],"e-quick-dialog-cancel");break;case"Alert":t.addClass([n],["e-quick-alertok","e-quick-dialog-alert-btn"]),t.addClass([r],["e-quick-alertcancel","e-disable"])}},e.prototype.applyFormValidation=function(){var e=this.quickPopup.element.querySelector("."+ot),t={};t[this.parent.eventSettings.fields.subject.name]=this.parent.eventSettings.fields.subject.validation,this.fieldValidator.renderFormValidator(e,t,this.quickPopup.element,this.parent.locale)},e.prototype.openRecurrenceAlert=function(){var e=this.quickDialog.element.querySelector(".e-quick-alertok");e&&(e.innerHTML=this.l10n.getConstant("Delete"===this.parent.currentAction?"deleteEvent":"editEvent"),e.setAttribute("aria-label",e.innerHTML));var t=this.quickDialog.element.querySelector(".e-quick-alertfollowing");t&&(t.innerHTML=this.l10n.getConstant("editFollowingEvent"),t.setAttribute("aria-label",t.innerHTML));var i=this.quickDialog.element.querySelector(".e-quick-alertcancel");i&&(i.innerHTML=this.l10n.getConstant("Delete"===this.parent.currentAction?"deleteSeries":"editSeries"),i.setAttribute("aria-label",i.innerHTML)),this.quickDialog.content=this.l10n.getConstant("editContent"),this.quickDialog.header=this.l10n.getConstant("Delete"===this.parent.currentAction?"deleteTitle":"editTitle"),this.quickDialogClass("Recurrence"),this.showQuickDialog("RecurrenceAlert")},e.prototype.openRecurrenceValidationAlert=function(e){this.quickDialogClass("Alert");var i=this.quickDialog.element.querySelector(".e-quick-alertok");i.innerHTML=this.l10n.getConstant("ok"),i.setAttribute("aria-label",i.innerHTML);var n=this.quickDialog.element.querySelector(".e-quick-alertcancel");n.innerHTML=this.l10n.getConstant("cancel"),n.setAttribute("aria-label",n.innerHTML),this.quickDialog.header=this.l10n.getConstant("alert");var r;switch(e){case"wrongPattern":t.addClass([n],"e-disable"),this.quickDialog.content=this.l10n.getConstant("wrongPattern");break;case"createError":t.addClass([n],"e-disable"),this.quickDialog.content=this.l10n.getConstant("createError");break;case"sameDayAlert":t.addClass([n],"e-disable"),this.quickDialog.content=this.l10n.getConstant("sameDayAlert");break;case"seriesChangeAlert":r=this.quickDialog.element.querySelector(".e-quick-dialog-cancel"),t.removeClass([n,r],"e-disable"),this.quickDialog.content=this.l10n.getConstant("seriesChangeAlert"),i.innerHTML=this.l10n.getConstant("yes"),n.innerHTML=this.l10n.getConstant("no"),r.innerHTML=this.l10n.getConstant("cancel");break;case"occurrenceAlert":t.addClass([n],"e-disable"),this.quickDialog.content=this.l10n.getConstant("occurenceAlert")}(!this.parent.enableRecurrenceValidation&&"wrongPattern"===e||this.parent.enableRecurrenceValidation)&&this.showQuickDialog("RecurrenceValidationAlert")},e.prototype.openDeleteAlert=function(){if(!this.parent.activeViewOptions.readonly){var e=this.quickDialog.element.querySelector(".e-quick-alertok");e&&(e.innerHTML=this.l10n.getConstant("delete"),e.setAttribute("aria-label",e.innerHTML));var t=this.quickDialog.element.querySelector(".e-quick-alertcancel");t&&(t.innerHTML=this.l10n.getConstant("cancel"),t.setAttribute("aria-label",t.innerHTML)),this.quickDialog.content=this.parent.activeEventData.event.length>1?this.l10n.getConstant("deleteMultipleContent"):this.l10n.getConstant("deleteContent"),this.quickDialog.header=this.parent.activeEventData.event.length>1?this.l10n.getConstant("deleteMultipleEvent"):this.l10n.getConstant("deleteEvent"),this.quickDialogClass("Delete"),this.showQuickDialog("DeleteAlert")}},e.prototype.openValidationError=function(e,t){this.quickDialog.header=this.l10n.getConstant("alert"),this.quickDialog.content=this.l10n.getConstant(e);var i=this.quickDialog.element.querySelector(".e-quick-alertok");i&&(i.innerHTML=this.l10n.getConstant("ok"),i.setAttribute("aria-label",i.innerHTML));var n=this.quickDialog.element.querySelector(".e-quick-alertcancel");n&&(n.innerHTML=this.l10n.getConstant("cancel"),i.setAttribute("aria-label",n.innerHTML)),this.quickDialogClass("Alert"),this.showQuickDialog("overlapAlert"===e?"OverlapAlert":"ValidationAlert",t)},e.prototype.showQuickDialog=function(e,i){var n=this;this.quickDialog.dataBind();var r={type:e,cancel:!1,element:this.quickDialog.element,data:t.extend({},i||this.parent.activeEventData.event,null,!0)};this.parent.activeViewOptions.allowOverlap||(r.overlapEvents=this.parent.overlapAppointments),this.parent.trigger("popupOpen",r,function(e){e.cancel||n.quickDialog.show()})},e.prototype.createMoreEventList=function(e,i,n){var r=this,a=this.parent.eventFields,s=t.createElement("div",{className:"e-more-event-content"}),o=t.createElement("div",{className:"e-more-appointment-wrapper"});if(0===e.length)o=t.createElement("div",{className:"e-more-event-content",innerHTML:this.l10n.getConstant("emptyContainer")});else for(var l=this,p=0,c=e;p<c.length;p++)!function(e){var s=e[a.subject]||l.parent.eventSettings.fields.subject.default||l.parent.localeObj.getConstant("addTitle"),p=t.createElement("div",{className:"e-appointment",attrs:{"data-id":""+e[a.id],"data-guid":e.Guid,role:"button",tabindex:"0","aria-disabled":l.parent.eventBase.getReadonlyAttribute(e),"aria-label":l.parent.getAnnouncementString(e)}});e[a.isReadonly]&&t.addClass([p],"e-read-only");var c=void 0;if(t.isNullOrUndefined(l.parent.activeViewOptions.eventTemplate))p.appendChild(t.createElement("div",{className:"e-subject"})),l.parent.sanitize(s,p.firstElementChild);else{var h=l.parent.element.id+"_"+l.parent.activeViewOptions.eventTemplateName+"eventTemplate";c=l.parent.getAppointmentTemplate()(e,l.parent,"eventTemplate",h,!1,void 0,void 0,l.parent.root),t.append(c,p)}if(t.isNullOrUndefined(n)||p.setAttribute("data-group-index",n),!t.isNullOrUndefined(e[a.recurrenceRule])){var d=e[a.id]===e[a.recurrenceID]?"e-recurrence-icon":"e-recurrence-edit-icon";p.appendChild(t.createElement("div",{className:et+" "+d}))}var u={data:t.extend({},e,null,!0),element:p,cancel:!1};l.parent.trigger("eventRendered",u,function(t){if(!t.cancel){o.appendChild(p);var n=r.parent.isAdaptive||"Year"===r.parent.currentView;r.parent.eventBase.wireAppointmentEvents(p,e,n),r.parent.eventBase.applyResourceColor(p,e,"backgroundColor",i)}})}(c[p]);return s.appendChild(o),s},e.prototype.tapHoldEventPopup=function(e){var i=t.closest(e.target,".e-appointment");this.parent.selectedElements=[],this.isMultipleEventSelect=!0,this.parent.eventBase.getSelectedEventElements(i),this.parent.activeEventData=this.parent.eventBase.getSelectedEvents();var n=i.getAttribute("data-guid"),r=this.parent.eventBase.getEventByGuid(n);if(!t.isNullOrUndefined(r)){var a=r[this.parent.eventFields.subject]||this.l10n.getConstant("noTitle"),s='<div class="e-multiple-event-popup"><div class="e-popup-header"><button class="e-close" title="'+this.l10n.getConstant("close")+'"></button><div class="e-subject">'+a+'</div><button class="e-edit" title="'+this.l10n.getConstant("edit")+'"></button><button class="e-delete" title="'+this.l10n.getConstant("delete")+'"></button></div></div>';this.quickPopup.element.innerHTML=s;var o=this.quickPopup.element.querySelector(".e-close");this.renderButton("e-flat e-round e-small",et+" e-close-icon",!1,o,this.closeClick);var l=this.parent.activeViewOptions.readonly||r[this.parent.eventFields.isReadonly],p=!this.parent.eventSettings.allowEditing||l,c=!this.parent.eventSettings.allowDeleting||l,h=this.quickPopup.element.querySelector(".e-edit");h&&this.renderButton("e-flat e-round e-small",et+" e-edit-icon",p,h,this.editClick);var d=this.quickPopup.element.querySelector(".e-delete");d&&this.renderButton("e-flat e-round e-small",et+" e-delete-icon",c,d,this.deleteClick),this.beforeQuickPopupOpen(i,this.parent.eventBase.getPageCoordinates(e))}},e.prototype.isCellBlocked=function(e){var t={};if(t[this.parent.eventFields.startTime]=this.parent.activeCellsData.startTime,t[this.parent.eventFields.endTime]=this.parent.activeCellsData.endTime,t[this.parent.eventFields.isAllDay]=this.parent.activeCellsData.isAllDay,this.parent.activeViewOptions.group.resources.length>0){var i=e.element instanceof Array?e.element[0]:e.element,n=parseInt(i.getAttribute("data-group-index"),10);this.parent.resourceBase.setResourceValues(t,isNaN(n)?null:n)}return this.parent.eventBase.isBlockRange(t)},e.prototype.cellClick=function(e){var i=new Date(e.startTime.getTime());if(!this.parent.showQuickInfo||!this.parent.eventSettings.allowAdding||"MonthAgenda"===this.parent.currentView||this.isCellBlocked(e)||!this.parent.isMinMaxDate(new Date(i.setHours(0,0,0,0))))return void this.quickPopupHide();var n=t.isNullOrUndefined(e.event)?e.element:e.event.target;if(this.parent.isAdaptive){this.quickPopupHide();var r=this.parent.element.querySelector(".e-new-event");t.isNullOrUndefined(r)&&(r=t.createElement("div",{className:"e-new-event",innerHTML:'<div class="e-title">+ '+this.l10n.getConstant("newEvent")+"</div>"}));var a=t.closest(n,".e-work-cells,.e-all-day-cells");return void(a&&a.appendChild(r))}var s=t.closest(n,".e-work-cells,.e-all-day-cells,.e-header-cells");if(!t.isNullOrUndefined(s)&&!n.classList.contains("e-more-indicator")){if(this.quickPopup.relateTo===s&&this.quickPopup.element.classList.contains(rt)){var l=this.quickPopup.element.querySelector(".e-subject");return void(l&&l.focus())}this.quickPopup.element&&this.destroyPopupButtons("quickPopup");var p={};p[this.parent.eventFields.startTime]=this.parent.activeCellsData.startTime,p[this.parent.eventFields.endTime]=this.parent.activeCellsData.endTime,p[this.parent.eventFields.isAllDay]=this.parent.activeCellsData.isAllDay;var c=t.createElement("div",{className:"e-cell-popup"});c.appendChild(this.getPopupHeader("Cell",p)),c.appendChild(this.getPopupContent("Cell",e,p)),c.appendChild(this.getPopupFooter("Cell",p)),this.quickPopup.element.setAttribute("aria-label",this.l10n.getConstant("newEvent"));var h=c.querySelector(".e-subject");h&&o.Input.createInput({element:h,properties:{placeholder:this.l10n.getConstant("addTitle")}}),t.isNullOrUndefined(this.parent.eventSettings.fields.subject.default)||(h.value=this.parent.eventSettings.fields.subject.default);var d=c.querySelector(".e-close");d&&this.renderButton("e-flat e-round e-small",et+" e-close-icon",!1,d,this.popupClose);var u=c.querySelector(".e-event-details");u&&this.renderButton("e-flat","",!1,u,this.detailsClick);var g=c.querySelector(".e-event-create");g&&this.renderButton("e-flat e-primary","",this.parent.activeViewOptions.readonly,g,this.saveClick),this.morePopup&&this.morePopup.hide(),this.quickPopup.content=c,this.quickPopup.relateTo=s,this.quickPopup.dataBind(),this.beforeQuickPopupOpen(s,this.parent.eventBase.getPageCoordinates(e.event))}},e.prototype.isSameEventClick=function(e){if(this.quickPopup.relateTo===t.closest(e.element,".e-appointment")&&this.quickPopup.element.classList.contains(rt)){var i=this.quickPopup.element.querySelector(".e-edit");if(i&&i.focus(),!this.parent.isAdaptive){var n=this.quickPopup.element.querySelector(".e-event-edit");n&&n.focus()}return!0}return!1},e.prototype.isQuickTemplate=function(e){return"Both"===this.parent.quickInfoTemplates.templateType||this.parent.quickInfoTemplates.templateType===e},e.prototype.eventClick=function(e){if(this.parent.eventTooltip&&this.parent.eventTooltip.close(),this.parent.showQuickInfo)if(this.parent.isAdaptive&&this.isMultipleEventSelect)this.updateTapHoldEventPopup(t.closest(e.element,".e-appointment"));else{var i=this.isSameEventClick(e);if(this.parent.selectedElements=[],i)return;this.quickPopup.element&&this.destroyPopupButtons("quickPopup");var n=e.event,r=t.createElement("div",{className:"e-event-popup"});r.appendChild(this.getPopupHeader("Event",n)),r.appendChild(this.getPopupContent("Event",e,n)),r.appendChild(this.getPopupFooter("Event",n)),this.quickPopup.element.setAttribute("aria-label",this.l10n.getConstant("editEvent"));var a=this.parent.activeViewOptions.readonly||n[this.parent.eventFields.isReadonly],s=!this.parent.eventSettings.allowEditing||a,o=!this.parent.eventSettings.allowDeleting||a,l=r.querySelector(".e-edit"),p="e-flat e-round e-small";l&&this.renderButton(p,et+" e-edit-icon",s,l,this.editClick);var c=r.querySelector(".e-delete");c&&this.renderButton(p,et+" e-delete-icon",o,c,this.deleteClick);var h=r.querySelector(".e-close");h&&this.renderButton(p,et+" e-close-icon",!1,h,this.popupClose);var d=r.querySelector(".e-event-edit");d&&this.renderButton("e-flat e-primary","",s,d,this.editClick);var u=r.querySelector(".e-event-delete");u&&this.renderButton("e-flat","",o,u,this.deleteClick),this.morePopup&&!t.closest(e.element,".e-more-appointment-wrapper")&&this.morePopup.hide(),this.quickPopup.content=r,this.quickPopup.relateTo=this.parent.isAdaptive?document.body:t.closest(e.element,".e-appointment"),this.quickPopup.dataBind(),this.beforeQuickPopupOpen(e.element,this.parent.eventBase.getPageCoordinates(e.originalEvent))}},e.prototype.getPopupHeader=function(e,i){var n=t.createElement("div",{className:"e-popup-header"});if(this.isQuickTemplate(e)&&this.parent.quickInfoTemplates.header){var r=t.extend({},i,{elementType:e.toLowerCase()},!0),a=this.parent.element.id,s=[].slice.call(this.parent.getQuickInfoTemplatesHeader()(r,this.parent,"header",a+"_headerTemplate",!1));t.append([].slice.call(s),n)}else{var o=void 0,l=void 0;switch(e){case"Cell":o='<div class="e-header-icon-wrapper"><button class="e-close" title="'+this.l10n.getConstant("close")+'"></button></div>';break;case"Event":l=this.getFormattedString(i),o='<div class="e-header-icon-wrapper"><button class="e-edit e-icons" title="'+this.l10n.getConstant("edit")+'"></button><button class="e-delete e-icons" title="'+this.l10n.getConstant("delete")+'"></button><button class="e-close" title="'+this.l10n.getConstant("close")+'"></button></div><div class="e-subject-wrap"><div class="e-subject e-text-ellipsis" title="'+(l.eventSubject?l.eventSubject.replaceAll('"',"'"):l.eventSubject)+'"></div></div >'}var p=t.createElement("div",{innerHTML:o});if("Event"===e){var c=p.querySelector(".e-subject");this.parent.sanitize(l.eventSubject,c)}t.append([].slice.call(p.childNodes),n)}return n},e.prototype.getPopupContent=function(e,i,n){var r=t.createElement("div",{className:"e-popup-content"});if(this.isQuickTemplate(e)&&this.parent.quickInfoTemplates.content){var a=t.extend({},n,{elementType:e.toLowerCase()},!0),s=this.parent.element.id,o=[].slice.call(this.parent.getQuickInfoTemplatesContent()(a,this.parent,"content",s+"_contentTemplate",!1));t.append([].slice.call(o),r)}else{var l=void 0,p=void 0,c=this.getResourceText(i,e.toLowerCase());switch(e){case"Cell":p=this.getFormattedString(n),l='<table class="e-popup-table"><tbody><tr><td><form class="'+ot+'">\n <input class="e-subject e-field" type="text" name="'+this.parent.eventFields.subject+'" /></form></td></tr><tr><td><div class="e-date-time"><div class="e-date-time-icon e-icons"></div><div class="e-date-time-details '+st+'">'+p.details+"</div></div>"+(this.parent.activeViewOptions.group.resources.length>0?'<div class="e-resource"><div class="e-resource-icon e-icons "></div><div class="e-resource-details e-text-ellipsis"></div></div>':"")+"</td></tr></tbody></table>";break;case"Event":l='<div class="e-date-time"><div class="e-date-time-icon e-icons"></div><div class="e-date-time-wrapper e-text-ellipsis"><div class="e-date-time-details e-text-ellipsis">'+this.getFormattedString(n).details+"</div>",n[this.parent.eventFields.recurrenceRule]&&(l+='<div class="e-recurrence-summary e-text-ellipsis">'+this.getRecurrenceSummary(n)+"</div>"),l+="</div></div>",n[this.parent.eventFields.location]&&(l+='<div class="e-location"><div class="e-location-icon e-icons"></div><div class="e-location-details e-text-ellipsis"></div></div>'),(n[this.parent.eventFields.startTimezone]||n[this.parent.eventFields.endTimezone])&&(l+='<div class="e-time-zone"><div class="e-time-zone-icon e-icons"></div><div class="e-time-zone-details e-text-ellipsis">'+this.getTimezone(n)+"</div></div>"),n[this.parent.eventFields.description]&&(l+='<div class="e-description"><div class="e-description-icon e-icons"></div><div class="e-description-details e-text-ellipsis"></div></div>'),this.parent.resourceCollection.length>0&&(l+='<div class="e-resource"><div class="e-resource-icon e-icons"></div><div class="e-resource-details e-text-ellipsis"></div></div>')}var h=t.createElement("div",{innerHTML:l}),d=h.querySelector("form");if(d&&(d.onsubmit=function(){return!1}),n[this.parent.eventFields.location]){var u=h.querySelector(".e-location-details");t.isNullOrUndefined(u)||this.parent.sanitize(n[this.parent.eventFields.location],u)}if(n[this.parent.eventFields.description]){var g=h.querySelector(".e-description-details");t.isNullOrUndefined(g)||this.parent.sanitize(n[this.parent.eventFields.description],g)}if(c){var v=h.querySelector(".e-resource-details");t.isNullOrUndefined(v)||this.parent.sanitize(c,v)}t.append([].slice.call(h.childNodes),r)}return r},e.prototype.getPopupFooter=function(e,i){var n=t.createElement("div",{className:"e-popup-footer"});if(this.isQuickTemplate(e)&&this.parent.quickInfoTemplates.footer){var r=t.extend({},i,{elementType:e.toLowerCase()},!0),a=this.parent.element.id,s=[].slice.call(this.parent.getQuickInfoTemplatesFooter()(r,this.parent,"footer",a+"_footerTemplate",!1));t.append([].slice.call(s),n)}else{var o=void 0;switch(e){case"Cell":o='<button class="e-event-details e-text-ellipsis" title="'+this.l10n.getConstant("moreDetails")+'">'+this.l10n.getConstant("moreDetails")+'</button><button class="e-event-create e-text-ellipsis" title="'+this.l10n.getConstant("save")+'">'+this.l10n.getConstant("save")+"</button>";break;case"Event":o=this.parent.isAdaptive?"":'<button class="e-event-edit e-text-ellipsis" title="'+this.l10n.getConstant("edit")+'">'+this.l10n.getConstant("edit")+'</button><button class="e-event-delete e-text-ellipsis" title="'+this.l10n.getConstant("delete")+'">'+this.l10n.getConstant("delete")+"</button>"}var l=t.createElement("div",{innerHTML:o});t.append([].slice.call(l.childNodes),n)}return n},e.prototype.getResourceText=function(e,i){if(0===this.parent.resourceCollection.length)return null;var n="";if(0===this.parent.activeViewOptions.group.resources.length){var r=this.parent.resourceBase.resourceCollection.slice(-1)[0],a=r.dataSource;if("event"===i)for(var s=e.event,o=0,l=a;o<l.length;o++)!function(e){var t=s[r.field];if(t instanceof Array){if(t.indexOf(e[r.idField])>-1){var i=t[t.indexOf(e[r.idField])],o=a.filter(function(e){return e[r.idField]===i})[0];n+=""===n?o[r.textField]:", "+o[r.textField]}}else e[r.idField]===t&&(n=e[r.textField].toString())}(l[o]);else n=a[0][r.textField].toString()}else if("event"===i){for(var p,s=e.event,a=void 0,c=this.parent.resourceBase.resourceCollection.length-1;c>=0;c--)if(a=s[this.parent.resourceBase.resourceCollection[parseInt(c.toString(),10)].field],!t.isNullOrUndefined(a)){p=this.parent.resourceBase.resourceCollection[parseInt(c.toString(),10)];break}Array.isArray(a)||(a=[a]);var h=[],d=p.dataSource;a.forEach(function(e){var t,i=H(d,p.idField,e);i>-1&&(t=d[parseInt(i.toString(),10)][p.textField]),t&&h.push(t)}),n=h.join(", ")}else{var u=e,g=t.isNullOrUndefined(u.groupIndex)?0:u.groupIndex,v=this.parent.resourceBase.lastResourceLevel[parseInt(g.toString(),10)];n=v.resourceData[v.resource.textField]}return n},e.prototype.getFormattedString=function(e){var t=this.parent.eventFields,i=e[t.subject]||this.l10n.getConstant("noTitle"),n=e[t.startTime],r=e[t.endTime],a=this.getDateFormat(n,"long"),s=e[t.isAllDay]&&0===r.getHours()&&0===r.getMinutes()?this.getDateFormat(O(new Date(r.getTime()),-1),"long"):this.getDateFormat(r,"long"),o=this.parent.getTimeString(n),l=this.parent.getTimeString(r),p="",c=r.getDate()!==n.getDate()&&(r.getTime()-n.getTime())/36e5<24?1:0;return e[t.isAllDay]?(p=a+" ("+this.l10n.getConstant("allDay")+")",(L(r)-L(n))/Qe>1&&(p+=" - "+s+" ("+this.l10n.getConstant("allDay")+")")):p=(L(r)-L(n))/Qe>=1||c>0?a+" ("+o+") - "+s+" ("+l+")":a+" ("+o+" - "+l+")",{eventSubject:i,details:p}},e.prototype.moreEventClick=function(e,i,n){var r=this;this.quickPopupHide(!0);var a=this.morePopup.element.querySelector(".e-more-event-content");a&&t.remove(a);var s=e.date.getTime().toString(),o=t.closest(e.element,".e-more-indicator,.e-work-cells"),l=this.parent.globalize.formatDate(e.date,{format:"E",calendar:this.parent.getCalendarMode()});this.morePopup.element.querySelector(".e-header-day").innerHTML=U(l,"single");var p=this.morePopup.element.querySelector(".e-header-date");p.innerHTML=this.getDateFormat(e.date,"d"),p.setAttribute("data-date",s),p.setAttribute("data-end-date",i.getTime().toString());var c;t.isNullOrUndefined(n)||(p.setAttribute("data-group-index",n),c=this.parent.resourceBase.lastResourceLevel[parseInt(n,10)].groupOrder);var h=this.createMoreEventList(e.event,c,n);if(this.morePopup.element.querySelector(".e-more-event-popup").appendChild(h),t.removeClass(this.morePopup.element.querySelector(".e-more-event-date-header").childNodes,"e-current-date"),b(e.date).getTime()===b(this.parent.getCurrentTime()).getTime()&&t.addClass(this.morePopup.element.querySelector(".e-more-event-date-header").childNodes,"e-current-date"),!this.parent.isAdaptive)if(-1!==this.parent.currentView.indexOf("Timeline")){var d=o.getAttribute("data-group-index"),u=new Date(parseInt(o.getAttribute("data-start-date"),10));u.setHours(u.getHours(),u.getMinutes(),0);var g=u.getTime().toString();if(t.isNullOrUndefined(d))this.morePopup.relateTo=this.parent.element.querySelector('.e-content-wrap tbody tr td[data-date="'+g+'"]');else if(this.morePopup.relateTo=this.parent.element.querySelector('.e-content-wrap tbody tr td[data-group-index="'+d+'"][data-date="'+g+'"]'),t.isNullOrUndefined(this.morePopup.relateTo))for(var v=[].slice.call(this.parent.element.querySelectorAll('.e-content-wrap tbody tr td[data-group-index="'+d+'"]')),m=0;m<v.length;m++)v[parseInt(m.toString(),10)].getAttribute("data-date")<g&&(this.morePopup.relateTo=v[parseInt(m.toString(),10)])}else this.morePopup.relateTo=t.closest(o,".e-work-cells");this.parent.renderTemplates(function(){var t={type:"EventContainer",cancel:!1,element:r.morePopup.element,data:e};r.parent.trigger("popupOpen",t,function(e){e.cancel||r.morePopup.show()})})},e.prototype.saveClick=function(e){this.applyFormValidation(),this.dialogEvent=e,this.isCrudAction=!0,this.quickPopupHide()},e.prototype.detailsClick=function(e){var i=this.quickPopup.element.querySelector(".e-subject");i&&""!==i.value&&t.extend(this.parent.activeCellsData,{subject:i.value}),this.dialogEvent=e,this.isCrudAction=!1,this.fieldValidator.destroyToolTip(),this.quickPopupHide(),this.parent.eventWindow.openEditor(this.parent.activeCellsData,"Add")},e.prototype.editClick=function(e){this.dialogEvent=e,this.quickPopupHide(!0);var i=this.parent.activeEventData.event;this.parent.currentAction="EditSeries",t.isNullOrUndefined(i[this.parent.eventFields.recurrenceRule])?this.parent.eventWindow.openEditor(i,this.parent.currentAction):(this.parent.currentAction="EditOccurrence",this.openRecurrenceAlert())},e.prototype.deleteClick=function(e){this.dialogEvent=e,this.quickPopupHide(!0),this.parent.currentAction="Delete",this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule]?this.openRecurrenceAlert():this.openDeleteAlert()},e.prototype.updateMoreEventContent=function(){if(!this.morePopup.element.classList.contains("e-popup-close")){var e=this.morePopup.element.querySelector(".e-more-event-content");e&&t.remove(e);var i,n,r=this.morePopup.element.querySelector(".e-header-date"),a=new Date(parseInt(r.getAttribute("data-date"),10)),s=new Date(parseInt(r.getAttribute("data-end-date"),10)),o=r.getAttribute("data-group-index");t.isNullOrUndefined(o)||(n=(i=this.parent.resourceBase.lastResourceLevel[parseInt(o,10)]).groupOrder);var l=this.parent.eventBase.filterEvents(a,s,this.parent.eventsProcessed,i),p=this.createMoreEventList(l,n,o);this.morePopup.element.querySelector(".e-more-event-popup").appendChild(p)}},e.prototype.closeClick=function(e){this.dialogEvent=e,"Year"===this.parent.currentView&&this.parent.activeCellsData&&this.parent.activeCellsData.element&&this.parent.selectCell(this.parent.activeCellsData.element),this.quickPopupHide(),this.morePopup.hide()},e.prototype.dialogButtonClick=function(e){this.dialogEvent=e,this.quickDialog.hide();var t=e.target,i=this.quickDialog.element.querySelector(".e-quick-alertcancel"),n=this.parent.activeEventData.event;if(t.classList.contains("e-quick-dialog-occurrence-event"))switch(this.parent.currentAction="Delete"===this.parent.currentAction?"DeleteOccurrence":"EditOccurrence",this.parent.currentAction){case"EditOccurrence":this.parent.eventWindow.openEditor(n,this.parent.currentAction);break;case"DeleteOccurrence":this.parent.crudModule.deleteEvent(n,this.parent.currentAction)}else if(t.classList.contains("e-quick-dialog-following-events"))switch(this.parent.currentAction="Delete"===this.parent.currentAction?"DeleteFollowingEvents":"EditFollowingEvents",this.parent.currentAction){case"EditFollowingEvents":this.parent.eventWindow.openEditor(n,this.parent.currentAction);break;case"DeleteFollowingEvents":this.parent.crudModule.deleteEvent(n,this.parent.currentAction)}else if(t.classList.contains("e-quick-dialog-series-event"))switch(this.parent.currentAction="Delete"===this.parent.currentAction?"DeleteSeries":"EditSeries",this.parent.currentAction){case"EditSeries":this.parent.eventWindow.openEditor(this.parent.eventBase.getParentEvent(n,!0),this.parent.currentAction);break;case"DeleteSeries":this.parent.crudModule.deleteEvent(n,this.parent.currentAction)}else t.classList.contains("e-quick-dialog-delete")?this.parent.crudModule.deleteEvent(n,this.parent.currentAction):!i.classList.contains("e-disable")&&(t.classList.contains("e-quick-alertok")||t.classList.contains("e-quick-alertcancel")&&!i.classList.contains("e-quick-dialog-cancel"))&&(this.parent.uiStateValues.isIgnoreOccurrence=t.classList.contains("e-quick-alertcancel"),this.parent.eventWindow.eventSave(e,this.l10n.getConstant("ok")))},e.prototype.updateTapHoldEventPopup=function(e){var i=this.parent.eventBase.getSelectedEventElements(e);if(this.parent.activeEventData=this.parent.eventBase.getSelectedEvents(),i.length>0){var n=this.parent.eventBase.getEventByGuid(i[0].getAttribute("data-guid")),r=1===i.length?n[this.parent.eventFields.subject]||this.l10n.getConstant("noTitle"):"("+i.length+") "+this.l10n.getConstant("selectedItems");this.quickPopup.element.querySelector(".e-subject").innerHTML=r,i.length>1?t.addClass([this.quickPopup.element.querySelector(".e-edit-icon")],"e-hidden"):t.removeClass([this.quickPopup.element.querySelector(".e-edit-icon")],"e-hidden")}else this.parent.selectedElements=[],this.quickPopupHide()},e.prototype.getTimezone=function(e){var t="";return t+=e[this.parent.eventFields.startTimezone]||"",t+=""===t?"":" - ",t+=e[this.parent.eventFields.endTimezone]||""},e.prototype.getRecurrenceSummary=function(e){var t=this.parent.eventWindow.getRecurrenceEditorInstance();if(t){var i=t.getRuleSummary(e[this.parent.eventFields.recurrenceRule]);return i.charAt(0).toUpperCase()+i.slice(1)}return""},e.prototype.getDateFormat=function(e,t){return U(this.parent.globalize.formatDate(e,{skeleton:t,calendar:this.parent.getCalendarMode()}),"single")},e.prototype.getDataFromTarget=function(e){if(e.classList.contains("e-appointment"))return this.parent.activeEventData.event;var t={startTime:this.parent.activeCellsData.startTime,endTime:this.parent.activeCellsData.endTime,isAllDay:this.parent.activeCellsData.isAllDay,groupIndex:this.parent.activeCellsData.groupIndex},i=this.parent.activeCellsData;return this.parent.eventWindow.convertToEventData(i,t),t},e.prototype.beforeQuickDialogClose=function(e){var i=this,n={event:e.event||this.dialogEvent,type:t.isNullOrUndefined(this.parent.activeEventData.event)?"ValidationAlert":t.isNullOrUndefined(this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule])?"DeleteAlert":"RecurrenceAlert",cancel:!1,data:this.parent.activeEventData.event,element:this.quickDialog.element};this.parent.trigger("popupClose",n,function(e){e.cancel||i.parent.eventBase.focusElement(!0)})},e.prototype.beforeQuickPopupOpen=function(e,n){var r=this;this.parent.renderTemplates(function(){var a=r.quickPopup.element.querySelector(".e-event-popup"),s=r.parent.isAdaptive?a?"ViewEventInfo":"EditEventInfo":"QuickInfo",o={type:s,cancel:!1,data:t.extend({},r.getDataFromTarget(e),null,!0),target:e,element:r.quickPopup.element};r.parent.trigger("popupOpen",o,function(o){if(o.cancel)r.quickPopupHide(),r.destroyPopupButtons("quickPopup"),o.element.classList.contains(rt)&&r.quickPopupClose(),j(r.quickPopup.element),r.isMultipleEventSelect=!1;else{var l=r.quickPopup.element.style.display;if(r.quickPopup.element.style.display="block",r.parent.isAdaptive)r.quickPopup.element.removeAttribute("style"),r.quickPopup.element.style.display="block",r.quickPopup.element.style.height=t.formatUnit("EditEventInfo"===s?65:window.innerHeight);else{var p=r.parent.virtualScrollModule&&r.parent.virtualScrollModule.isHorizontalScroll&&!t.isNullOrUndefined(t.closest(e,"."+nt)),c=r.parent.element.querySelector(".e-content-wrap table");r.quickPopup.offsetX=p&&!r.parent.enableRtl?g(c)+10:10,r.quickPopup.offsetY=r.parent.virtualScrollModule&&!r.parent.virtualScrollModule.isHorizontalScroll?r.quickPopup.offsetY:0,r.quickPopup.collision={X:r.parent.enableRtl?"flip":"none",Y:"fit"},r.quickPopup.position={X:r.parent.enableRtl?"left":"right",Y:r.parent.enableRtl?"bottom":"top"},r.quickPopup.dataBind(),r.quickPopup.refreshPosition(null,!0);var h=i.isCollide(r.quickPopup.element,r.parent.element);if(h.indexOf(r.parent.enableRtl?"left":"right")>-1&&(r.quickPopup.offsetX=-e.offsetWidth-10-r.quickPopup.element.offsetWidth,p&&!r.parent.enableRtl&&(r.quickPopup.offsetX=g(c)+r.quickPopup.offsetX),r.quickPopup.dataBind(),r.quickPopup.refreshPosition(null,!0),i.isCollide(r.quickPopup.element,r.parent.element).indexOf("left")>-1&&(r.quickPopup.position={X:"center",Y:"center"},r.quickPopup.collision={X:"fit",Y:"fit"},r.quickPopup.offsetX=-r.quickPopup.element.offsetWidth/2,r.quickPopup.dataBind())),r.parent.virtualScrollModule&&!r.parent.virtualScrollModule.isHorizontalScroll&&(h.indexOf("top")>-1||h.indexOf("bottom")>-1)){var d=u(c);r.quickPopup.offsetY=d,r.quickPopup.dataBind(),r.quickPopup.refreshPosition(null,!0)}if("center"===r.quickPopup.position.X&&"center"===r.quickPopup.position.Y&&!t.isNullOrUndefined(n)&&n.clientX&&n.clientY){var v=n.clientX,m=n.clientY,f=e.getBoundingClientRect(),y=n.offsetY||Math.ceil(m-f.y),T=r.quickPopup.offsetY,w=i.isCollide(r.quickPopup.element,e),D=r.quickPopup.element.getBoundingClientRect(),b=document.elementFromPoint(v,m);(w.indexOf("top")>-1||w.indexOf("bottom")>-1||t.closest(b,".e-quick-popup-wrapper"))&&(D.top<=m&&m<=D.top+D.height?(r.quickPopup.offsetY=T-D.height-10,r.quickPopup.dataBind(),(w=i.isCollide(r.quickPopup.element,r.parent.element)).indexOf("top")>-1&&(r.quickPopup.offsetY=T+y+10,r.quickPopup.dataBind())):i.isCollide(r.quickPopup.element,r.parent.element).indexOf("bottom")>-1&&(r.quickPopup.offsetY=T-y-Math.ceil(D.height)-10,r.quickPopup.dataBind()))}}a&&r.applyEventColor(),r.quickPopup.element.style.display=l,r.quickPopup.dataBind(),r.quickPopup.show()}})})},e.prototype.applyEventColor=function(){var e="";e="Agenda"===this.parent.currentView||"MonthAgenda"===this.parent.currentView?this.parent.enableRtl?"border-right-color":"border-left-color":"background-color";var t=this.parent.activeEventData.element.style[e];if(""!==t){var i=this.quickPopup.element.querySelector(".e-popup-header"),n=this.quickPopup.element.querySelector(".e-popup-footer");n&&n.offsetParent&&(i=this.quickPopup.element.querySelector(".e-subject"))&&(i.style.borderLeftColor=t,t="rgba("+t.match(/\d+/g).join()+",0.3)"),i&&(i.style.backgroundColor=t)}},e.prototype.quickPopupOpen=function(){if(this.parent.isAdaptive)return void(this.quickPopup.element.style.top="0px");if(this.quickPopup.element.querySelector(".e-cell-popup")){var e=this.quickPopup.element.querySelector(".e-subject");e&&e.focus()}else{var t=this.quickPopup.element.querySelector(".e-event-edit");t&&t.focus();var i=this.quickPopup.element.querySelector(".e-edit");i&&i.focus()}},e.prototype.quickPopupClose=function(){this.parent.eventBase.focusElement(),this.quickPopup.relateTo=".e-work-cells",this.fieldValidator.destroyToolTip(),this.quickPopup.element.querySelectorAll(".e-formvalidator").length&&this.fieldValidator.destroy(),this.destroyPopupButtons("quickPopup"),j(this.quickPopup.element)},e.prototype.morePopupOpen=function(){if(this.parent.isAdaptive)return this.morePopup.element.style.top="0px",this.morePopup.element.style.left="0px",void(this.morePopup.element.style.height=t.formatUnit(window.innerHeight));this.morePopup.element.querySelector(".e-header-date").focus(),this.morePopup.refreshPosition()},e.prototype.morePopupClose=function(){var e=this.parent.element.querySelector(".e-more-appointment-wrapper");e&&t.remove(e)},e.prototype.popupClose=function(e){this.dialogEvent=e,this.isCrudAction=!1,this.quickPopupHide(!0)},e.prototype.quickPopupHide=function(e){var t=this;if(this.quickPopup.element.classList.contains(rt)){var i,n=this.quickPopup.element.querySelector(".e-cell-popup");if(n){var r=this.quickPopup.element.querySelector(".e-formvalidator");if(this.isCrudAction&&r&&!r.ej2_instances[0].validate())return;var a=this.parent.eventFields,s=this.parent.eventWindow.getObjectFromFormData("e-quick-popup-wrapper");this.parent.eventWindow.setDefaultValueToObject(s),s[a.id]=this.parent.eventBase.getEventMaxID(),s[a.startTime]=this.parent.activeCellsData.startTime,s[a.endTime]=this.parent.activeCellsData.endTime,s[a.isAllDay]=this.parent.activeCellsData.isAllDay,this.parent.resourceBase&&this.parent.resourceBase.setResourceValues(s),i=s}else i=this.parent.activeEventData.event;var o=this.quickPopup.element.querySelector(".e-event-popup"),l={event:this.dialogEvent,type:this.parent.isAdaptive?o?"ViewEventInfo":"EditEventInfo":"QuickInfo",cancel:!1,data:i,element:this.quickPopup.element,target:n?this.parent.activeCellsData.element:this.parent.activeEventData.element};this.parent.trigger("popupClose",l,function(i){if(!i.cancel&&t.quickPopup.element.classList.contains("e-popup-open")){if(n&&t.isCrudAction&&(t.parent.currentAction="Add",t.parent.crudModule.addEvent(i.data)),e){var r=t.quickPopup.hideAnimation;t.quickPopup.hideAnimation=null,t.quickPopup.hide(),t.quickPopup.hideAnimation=r}else t.quickPopup.hide();t.isMultipleEventSelect=!1,t.isCrudAction=!1}})}},e.prototype.navigationClick=function(e){var i=t.closest(e.target,".e-navigate");if(!t.isNullOrUndefined(i)){var n=this.parent.getDateFromElement(e.currentTarget);t.isNullOrUndefined(n)||(this.closeClick(e),this.parent.setProperties({selectedDate:n},!0),this.parent.changeView(this.parent.getNavigateView(),e))}},e.prototype.documentClick=function(e){var i=e.event.target,n=".e-quick-popup-wrapper,.e-header-cells,.e-all-day-cells,.e-work-cells,.e-appointment";!!t.closest(i,".e-dialog")||(n+=",.e-popup");var r=this.parent.element.querySelector(".e-quick-popup-wrapper");(r&&r.childElementCount>0&&!t.closest(i,n)||!t.closest(i,n))&&(this.quickPopupHide(),this.parent.removeNewEventElement());var a=this.parent.allowInline?this.parent.inlineModule.getInlineElement():null;a&&a!==i&&this.parent.inlineModule.documentClick(a),t.closest(i,".e-appointment,.e-header-cells")&&this.parent.removeNewEventElement();var s=t.closest(i,".e-quick-popup-wrapper")||t.closest(i,".e-quick-dialog");!(i.classList.contains("e-event-edit")||i.classList.contains("e-edit")||i.classList.contains("e-edit-icon"))&&(s||t.closest(i,".e-more-popup-wrapper")||!i.classList||i.classList.contains("e-more-indicator")||t.closest(i,".e-more-popup-wrapper."+rt)||t.closest(i,".e-work-cells"))||this.morePopup.hide()},e.prototype.onClosePopup=function(e){t.isNullOrUndefined(e)||(this.dialogEvent=e),this.quickPopupHide(),(t.isNullOrUndefined(e)||!t.isNullOrUndefined(e)&&"escape"!==e.action||this.parent.inlineModule&&this.parent.element.querySelector(".e-inline-appointment"))&&this.parent.eventBase.focusElement()},e.prototype.addEventListener=function(){this.parent.on("cellClick",this.cellClick,this),this.parent.on("eventClick",this.eventClick,this),this.parent.on("document-click",this.documentClick,this),this.parent.on(_e,this.updateMoreEventContent,this)},e.prototype.removeEventListener=function(){this.parent.off("cellClick",this.cellClick),this.parent.off("eventClick",this.eventClick),this.parent.off("document-click",this.documentClick),this.parent.off(_e,this.updateMoreEventContent)},e.prototype.destroyPopupButtons=function(e){for(var t="quickPopup"===e?this.quickPopup:this.morePopup,i=0,n=[].slice.call(t.element.querySelectorAll(".e-control.e-btn"));i<n.length;i++){var r=n[i],a=r.ej2_instances?r.ej2_instances[0]:null;a&&a.destroy()}if("quickPopup"===e){var s=t.element.querySelector("input.e-subject");s&&s.remove();var o=this.quickPopup.element.querySelector("form."+ot);o&&(j(o),o.remove()),this.parent.resetTemplates(["content","header","footer"])}},e.prototype.refreshQuickDialog=function(){this.destroyQuickDialog(),this.renderQuickDialog()},e.prototype.refreshQuickPopup=function(){this.destroyQuickPopup(),this.renderQuickPopup()},e.prototype.refreshMorePopup=function(){this.destroyMorePopup(),this.renderMorePopup()},e.prototype.destroyQuickDialog=function(){this.quickDialog.element&&(this.quickDialog.destroy(),t.remove(this.quickDialog.element),this.quickDialog=null)},e.prototype.destroyQuickPopup=function(){this.quickPopup.element&&(this.destroyPopupButtons("quickPopup"),this.quickPopup.destroy(),t.remove(this.quickPopup.element),this.quickPopup=null)},e.prototype.destroyMorePopup=function(){this.morePopup.element&&(this.destroyPopupButtons("morePopup"),this.morePopup.destroy(),t.remove(this.morePopup.element),this.morePopup=null)},e.prototype.destroy=function(){this.quickPopup.element.querySelectorAll(".e-formvalidator").length&&this.fieldValidator.destroy(),this.removeEventListener(),this.destroyQuickPopup(),this.destroyMorePopup(),this.destroyQuickDialog(),this.dialogEvent=null,this.parent=null,this.l10n=null,this.isCrudAction=null,this.fieldValidator=null,this.isMultipleEventSelect=null},e}(),Xt=function(){function e(e){this.parent=e,this.tooltipObj=new i.Tooltip({animation:{close:{effect:"FadeOut"}},content:"No title",position:"BottomRight",offsetY:10,mouseTrail:!this.parent.isAdaptive,showTipPointer:!1,cssClass:this.parent.cssClass+" "+lt,target:this.getTargets(),beforeRender:this.onBeforeRender.bind(this),beforeClose:this.onTooltipClose.bind(this),beforeOpen:this.onTooltipOpen.bind(this),enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}),this.tooltipObj.appendTo(this.parent.element)}return e.prototype.getTargets=function(){var e=[];return this.parent.activeViewOptions.group.headerTooltipTemplate&&e.push(".e-resource-cells"),this.parent.eventSettings.enableTooltip&&e.push(".e-appointment"),e.join(",")},e.prototype.onBeforeRender=function(e){var i=this;if(this.parent.uiStateValues.isSwipeScroll)return void(e.cancel=!0);if(t.isNullOrUndefined(e.target.getAttribute("data-tooltip-id"))){if(e.target.classList.contains("e-resource-cells")&&this.parent.activeViewOptions.group.resources.length>0){if(e.target.closest(".e-left-indent-wrap"))return void(e.cancel=!0);var n=void 0;if(this.parent.activeView.isTimelineView()){var r=parseInt(e.target.getAttribute("data-group-index"),10);n=this.parent.resourceBase.lastResourceLevel[parseInt(r.toString(),10)]}else{var a=e.target.parentNode.sectionRowIndex,s=e.target.cellIndex;n=this.parent.activeView.getColumnLevels()[parseInt(a.toString(),10)][parseInt(s.toString(),10)]}var o={resource:n.resource,resourceData:n.resourceData},l=t.createElement("div"),p=this.parent.element.id+"_headerTooltipTemplate",c=[].slice.call(this.parent.getHeaderTooltipTemplate()(o,this.parent,"headerTooltipTemplate",p,!1));return t.append(c,l),this.setContent(l),void this.parent.renderTemplates()}var h=this.parent.eventBase.getEventByGuid(e.target.getAttribute("data-guid"));if(t.isNullOrUndefined(h))return void this.setContent("No Title");if(t.isNullOrUndefined(this.parent.eventSettings.tooltipTemplate)){var d=this.parent.globalize,u=this.parent.eventFields,g=new Date(""+h[u.startTime]),v=new Date(""+h[u.endTime]);v=v.getTime()-g.getTime()!=0&&0===v.getHours()&&0===v.getMinutes()?new Date(v.setMilliseconds(-1e3)):v;var m=b(new Date(""+g)),f=b(new Date(""+v)),y=h[u.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),T=t.isNullOrUndefined(h[u.location])?"":h[u.location],w="",D="",C="";w=d.formatDate(g,{type:"date",skeleton:"MMMd",calendar:this.parent.getCalendarMode()}),D=d.formatDate(g,{type:"date",skeleton:"medium",calendar:this.parent.getCalendarMode()}),C=d.formatDate(v,{type:"date",skeleton:"medium",calendar:this.parent.getCalendarMode()}),w=U(w,"single"),D=U(D,"single"),C=U(C,"single");var S=this.parent.getTimeString(g),O=this.parent.getTimeString(v),E=void 0,x='<div><div class="e-subject">'+y+'</div><div class="e-location">'+T+'</div><div class="e-details">'+(E=m.getTime()===f.getTime()?U(E=d.formatDate(g,{type:"date",skeleton:"long",calendar:this.parent.getCalendarMode()}),"single"):m.getFullYear()===f.getFullYear()?w+" - "+C:D+" - "+C)+'</div><div class="e-all-day">'+(h[u.isAllDay]?this.parent.localeObj.getConstant("allDay"):S+" - "+O)+"</div></div>",V=function(){return x};this.setContent(t.initializeCSPTemplate(V))}else{var l=t.createElement("div"),p=this.parent.element.id+"_tooltipTemplate",c=[].slice.call(this.parent.getEventTooltipTemplate()(h,this.parent,"tooltipTemplate",p,!1));t.append(c,l),this.setContent(l)}this.parent.renderTemplates(function(){if(i.parent&&i.parent.isReact&&!t.isNullOrUndefined(i.parent.eventSettings.tooltipTemplate)){var e=document.querySelector(".e-tooltip-hidden");e&&t.removeClass([e],"e-tooltip-hidden")}})}},e.prototype.onTooltipOpen=function(e){e.element&&this.parent.isReact&&!t.isNullOrUndefined(this.parent.eventSettings.tooltipTemplate)&&t.addClass([e.element],"e-tooltip-hidden");var i=this.parent.eventBase.getEventByGuid(e.target.getAttribute("data-guid"));if(!t.isNullOrUndefined(i)){var n={cancel:!1,data:i,content:e.element,target:e.target};this.parent.trigger("tooltipOpen",n,function(t){if(t.cancel)return void(e.cancel=!0);e.element=t.content})}},e.prototype.onTooltipClose=function(e){e.element&&(t.removeClass([e.element],rt),t.addClass([e.element],"e-popup-close")),this.parent.isReact&&this.parent.eventWindow.dialogObject&&this.parent.eventWindow.dialogObject.visible||this.parent.resetTemplates(["tooltipTemplate","headerTooltipTemplate"])},e.prototype.setContent=function(e){this.tooltipObj.setProperties({content:e,windowCollision:!0},!0)},e.prototype.close=function(){this.tooltipObj.close()},e.prototype.destroy=function(){this.tooltipObj.destroy(),t.addClass([this.parent.element],"e-control"),this.tooltipObj=null,this.parent=null},e}(),Qt=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Kt=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},Zt="e-input-wrapper",Jt="e-form-left",$t="e-recurrence-count",ei="e-hide-recurrence-element",ti="e-primary",ii={none:"",daily:"days",weekly:"weeks",monthly:"months",yearly:"years"},ni={sun:"SU",mon:"MO",tue:"TU",wed:"WE",thu:"TH",fri:"FR",sat:"SA"},ri=["e-days","e-non-week","e-end-on","e-interval","e-year-expander","e-month-expander"],ai=["e-non-week"],si=["e-days","e-year-expander"],oi=["e-days"],li=["e-days","e-non-week","e-year-expander","e-month-expander"],pi=["e-end-on-date","e-end-on-count"],ci=["e-end-on-date"],hi=["e-end-on-count"],di=function(e){function i(t,i){var n=e.call(this,t,i)||this;return n.defaultLocale={none:"None",daily:"Daily",weekly:"Weekly",monthly:"Monthly",month:"Month",yearly:"Yearly",never:"Never",until:"Until",count:"Count",first:"First",second:"Second",third:"Third",fourth:"Fourth",last:"Last",repeat:"Repeat",repeatEvery:"Repeat every",on:"Repeat On",end:"End",onDay:"Day",days:"Day(s)",weeks:"Week(s)",months:"Month(s)",years:"Year(s)",every:"every",summaryTimes:"time(s)",summaryOn:"on",summaryUntil:"until",summaryRepeat:"Repeats",summaryDay:"day(s)",summaryWeek:"week(s)",summaryMonth:"month(s)",summaryYear:"year(s)",monthWeek:"Month Week",monthPosition:"Month Position",monthExpander:"Month Expander",yearExpander:"Year Expander",repeatInterval:"Repeat Interval"},n.renderStatus=!1,n.dayButtons=[],n.monthButtons=[],n}return Qt(i,e),i.prototype.startState=function(e,t,i){this.showFormElement(),this.updateForm(e),this.freshOnEndForm(),this.updateEndOnForm(t),this.selectMonthDay(i),this.updateUntilDate(i),this.onMonthDay.setProperties({checked:!0})},i.prototype.preRender=function(){this.localeObj=new t.L10n(this.getModuleName(),this.defaultLocale,this.locale),this.calendarUtil=je(this.calendarMode)},i.prototype.applyCustomClass=function(e){e&&t.addClass([this.element],e.split(" "))},i.prototype.initialize=function(){t.addClass([this.element],"e-"+this.getModuleName()),this.renderComponent(),"string"==typeof this.startDate&&this.setProperties({startDate:new Date(this.startDate)},!1),t.isNullOrUndefined(this.value)||""===this.value?(t.isNullOrUndefined(this.repeatType.value)||(this.startState(this.repeatType.value.toString().toUpperCase(),this.endTypes[0],this.startDate),this.updateForm(this.repeatType.value.toString())),this.selectedType>0&&this.setProperties({value:this.getRecurrenceRule()},!1)):this.setRecurrenceRule(this.value),this.applyCustomClass(this.cssClass)},i.prototype.triggerChangeEvent=function(){var e=this;if(this.renderStatus){var t=this.getRecurrenceRule();this.trigger("change",{value:t},function(t){return e.setProperties({value:t.value},!1)})}},i.prototype.resetDayButton=function(){[].slice.call(this.element.querySelectorAll(".e-days button")).forEach(function(e){return t.removeClass([e],["e-active",ti])})},i.prototype.daySelection=function(e){this.resetDayButton();var i=[0,1,2,3,4,5,6];this.rotateArray(i,this.firstDayOfWeek);var n=this.element.querySelector('.e-days button[data-index="'+i.indexOf(e)+'"]');n&&t.addClass([n],["e-active",ti])},i.prototype.rtlClass=function(e){e?t.addClass([this.element],"e-rtl"):t.removeClass([this.element],"e-rtl")},i.prototype.updateUntilDate=function(e){var t=new Date(e.getTime());t.setDate(t.getDate()+60),this.untilDateObj.setProperties({value:t})},i.prototype.selectMonthDay=function(e){var t=["sun","mon","tue","wed","thu","fri","sat"];this.monthDate.setProperties({value:this.calendarUtil.getDate(e)}),this.monthWeekDays.setProperties({value:ni[t[e.getDay()]]}),this.monthValue.setProperties({value:""+this.calendarUtil.getMonth(e)}),this.monthWeekPos.setProperties({value:this.getDayPosition(e)}),this.daySelection(e.getDay())},i.prototype.updateForm=function(e){var i=this;this.repeatType.setProperties({value:e});var n=this.element.querySelector(".e-end-on");switch("daily"===e?t.classList(n,[Jt],["e-form-right"]):t.classList(n,["e-form-right"],[Jt]),e){case"none":ri.forEach(function(e){return t.addClass([i.element.querySelector("."+e)],ei)});break;case"weekly":ai.forEach(function(e){return t.addClass([i.element.querySelector("."+e)],ei)});break;case"monthly":si.forEach(function(e){return t.addClass([i.element.querySelector("."+e)],ei)});break;case"yearly":oi.forEach(function(e){return t.addClass([i.element.querySelector("."+e)],ei)});break;case"daily":li.forEach(function(e){return t.addClass([i.element.querySelector("."+e)],ei)})}},i.prototype.updateEndOnForm=function(e){var i=this;switch(this.endType.setProperties({value:e}),e){case"never":pi.forEach(function(e){return t.addClass([i.element.querySelector("."+e)],ei)});break;case"until":hi.forEach(function(e){return t.addClass([i.element.querySelector("."+e)],ei)});break;case"count":ci.forEach(function(e){return t.addClass([i.element.querySelector("."+e)],ei)})}},i.prototype.freshOnEndForm=function(){var e=this;pi.forEach(function(i){var n=e.element.querySelector("."+i);n&&t.removeClass([n],ei)})},i.prototype.showFormElement=function(){var e=this;ri.forEach(function(i){var n=e.element.querySelector("."+i);n&&t.removeClass([n],ei)})},i.prototype.renderDropdowns=function(){var e=this,t=this;this.repeatType=new l.DropDownList({dataSource:this.getRepeatData(),floatLabelType:"Always",enableRtl:this.enableRtl,index:this.selectedType,fields:{text:"text",value:"value"},placeholder:this.localeObj.getConstant("repeat"),htmlAttributes:{title:this.localeObj.getConstant("repeat")},change:function(i){t.setProperties({selectedType:e.frequencies.indexOf(i.value)},!1),t.element.querySelector(".e-repeat-content").innerHTML=t.localeObj.getConstant(ii[i.value]),t.showFormElement(),t.updateForm(i.value),t.resetFormValues(),t.triggerChangeEvent()}}),this.repeatType.appendTo(this.element.querySelector(".e-repeat-element")),this.endType=new l.DropDownList({dataSource:this.getEndData(),popupWidth:this.getPopupWidth(),floatLabelType:"Always",placeholder:this.localeObj.getConstant("end"),enableRtl:this.enableRtl,index:1,fields:{text:"text",value:"value"},change:function(e){t.freshOnEndForm(),t.updateEndOnForm(e.value),t.resetFormValues(),t.triggerChangeEvent()}}),this.endType.appendTo(this.element.querySelector(".e-end-on-element"));var i=function(i){return new l.DropDownList({dataSource:i,popupWidth:e.getPopupWidth(),enableRtl:e.enableRtl,fields:{text:"text",value:"value"},index:1,change:function(e){t.onWeekDay.setProperties({checked:!0}),t.resetFormValues(),t.triggerChangeEvent()}})};this.monthWeekPos=i(this.getMonthPosData()),this.monthWeekPos.appendTo(this.element.querySelector(".e-month-pos")),this.monthWeekDays=i(this.getDayData("wide")),this.monthWeekDays.appendTo(this.element.querySelector(".e-month-week")),this.monthValue=new l.DropDownList({dataSource:this.getMonthData(),fields:{text:"text",value:"value"},enableRtl:this.enableRtl,index:7,change:function(e){t.resetFormValues(),t.triggerChangeEvent()}}),this.monthValue.appendTo(this.element.querySelector(".e-year-expander-element"))},i.prototype.setDefaultValue=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll(".e-control .e-numerictextbox"));e<t.length;e++){var i=t[e].ej2_instances[0];i.element.classList.contains("e-repeat-interval")?(i.value=1,i.dataBind()):i.element.classList.contains($t)&&(i.value=10,i.dataBind())}},i.prototype.resetFormValues=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll('.e-control [type="text"]'));e<t.length;e++){var i=t[e],n=void 0;if(i.classList.contains("e-datepicker"))(n=i.ej2_instances[0]).value?(n.value=n.value,n.dataBind()):this.updateUntilDate(this.startDate);else if(i.classList.contains("e-dropdownlist"))(n=i.ej2_instances[0]).index=n.index||0,n.dataBind();else if(i.classList.contains("e-numerictextbox")){var r=void 0;r=(n=i.ej2_instances[0]).element.classList.contains("e-repeat-interval")?1:n.element.classList.contains($t)?10:this.startDate.getDate(),n.value=n.value||r,n.dataBind()}}},i.prototype.getPopupWidth=function(){return t.Browser.isDevice?"100%":"auto"},i.prototype.renderDatePickers=function(){var e=this;this.untilDateObj=new r.DatePicker({firstDayOfWeek:this.firstDayOfWeek,enableRtl:this.enableRtl,locale:this.locale,min:this.minDate,max:this.maxDate,format:t.isNullOrUndefined(this.dateFormat)?this.getFormat("dateFormats"):this.dateFormat,change:function(t){t.value&&e.triggerChangeEvent()}}),this.untilDateObj.appendTo(this.element.querySelector(".e-until-date"))},i.prototype.getFormat=function(e){return"en"===this.locale||"en-US"===this.locale?t.getValue(e+".short",t.getDefaultDateObject(this.getCalendarMode())):t.getValue("main."+this.locale+".dates.calendars."+this.getCalendarMode()+"."+e+".short",t.cldrData)},i.prototype.dayButtonRender=function(){for(var e=this,i=this,n=0,r=[].slice.call(this.element.querySelectorAll(".e-days button"));n<r.length;n++){var a=r[n],o=new s.Button({isToggle:!0,enableRtl:this.enableRtl},a);this.dayButtons.push(o),t.EventHandler.add(a,"click",function(n){var r=[].slice.call(e.element.querySelectorAll(".e-days button."+ti)),a=n.target;a.classList.contains(ti)?r.length>1&&(t.removeClass([a],ti),i.triggerChangeEvent()):(t.addClass([a],ti),i.triggerChangeEvent())})}},i.prototype.radioButtonRender=function(){var e=this;this.onMonthDay=new s.RadioButton({label:this.localeObj.getConstant("onDay"),enableRtl:this.enableRtl,name:"monthType",value:"day",change:function(){e.resetFormValues(),e.triggerChangeEvent()}}),this.onMonthDay.appendTo(this.element.querySelector(".e-month-expander-element")),this.monthButtons.push(this.onMonthDay),this.onWeekDay=new s.RadioButton({label:this.localeObj.getConstant("monthExpander"),cssClass:"e-month-type",name:"monthType",enableRtl:this.enableRtl,value:"daypos",change:function(){e.resetFormValues(),e.triggerChangeEvent()}}),this.onWeekDay.appendTo(this.element.querySelector(".e-month-expander-wrapper")),this.monthButtons.push(this.onWeekDay)},i.prototype.numericTextboxRender=function(){var e=this;this.recurrenceCount=new o.NumericTextBox({value:10,format:"#",enableRtl:this.enableRtl,min:1,max:999,change:function(){e.triggerChangeEvent()}}),this.recurrenceCount.appendTo(this.element.querySelector("."+$t)),this.monthDate=new o.NumericTextBox({value:1,format:"#",enableRtl:this.enableRtl,min:1,max:31,change:function(){e.onMonthDay.setProperties({checked:!0}),e.triggerChangeEvent()}}),this.monthDate.appendTo(this.element.querySelector(".e-month-day")),this.repeatInterval=new o.NumericTextBox({value:1,format:"#",min:1,max:999,enableRtl:this.enableRtl,floatLabelType:"Always",placeholder:this.localeObj.getConstant("repeatEvery"),change:function(){e.triggerChangeEvent()}}),this.repeatInterval.appendTo(this.element.querySelector(".e-repeat-interval"))},i.prototype.renderComponent=function(){this.setTemplate(),this.renderDropdowns(),this.renderDatePickers(),this.dayButtonRender(),this.radioButtonRender(),this.numericTextboxRender()},i.prototype.rotateArray=function(e,t){for(var i,n=0;n<t;n++)i=e.shift(),e.push(i)},i.prototype.getEndData=function(){var e=this,t=[];return this.endTypes.forEach(function(i){t.push({text:e.localeObj.getConstant(i),value:i})}),t},i.prototype.getDayPosition=function(e){var t=new Date(e.getTime()),i=new Date(e.getTime()),n=e.getDay(),r=[];for(t=this.calendarUtil.getMonthStartDate(t),i=this.calendarUtil.getMonthEndDate(i);t<i;)t.getDay()===n&&r.push(t.getTime()),t.setDate(t.getDate()+1);return r.indexOf(e.getTime())===r.length-1?-1:r.indexOf(e.getTime())+1},i.prototype.getRepeatData=function(){var e=[],t=this;return this.frequencies.forEach(function(i){var n="none"===i?"never":i;e.push({text:t.localeObj.getConstant(n),value:i})}),e},i.prototype.getMonthPosData=function(){var e={first:1,second:2,third:3,fourth:4,last:-1},t=this,i=[];return["first","second","third","fourth","last"].forEach(function(n){i.push({text:t.localeObj.getConstant(n),value:e[""+n]})}),i},i.prototype.getDayData=function(e){var i,n=["sun","mon","tue","wed","thu","fri","sat"],r=[];if(this.rotateArray(n,this.firstDayOfWeek),"en"===this.locale||"en-US"===this.locale){a="days.stand-alone.";i=t.getValue(a+e,t.getDefaultDateObject(this.getCalendarMode()))}else{var a="main."+this.locale+".dates.calendars."+this.getCalendarMode()+".days.stand-alone."+e;i=t.getValue(a,t.cldrData)}for(var s=0,o=n;s<o.length;s++){var l=o[s],p=t.getValue(l,i);r.push({text:"narrow"===e?p:U(p,"single"),value:ni[""+l]})}return r},i.prototype.getMonthData=function(){var e,i=[];if("en"===this.locale||"en-US"===this.locale){n="months.stand-alone.wide";e=t.getValue(n,t.getDefaultDateObject(this.getCalendarMode()))}else{var n="main."+this.locale+".dates.calendars."+this.getCalendarMode()+".months.stand-alone.wide";e=t.getValue(n,t.cldrData)}for(var r=0,a=Object.keys(e);r<a.length;r++){var s=a[r];i.push({text:U(t.getValue(s,e),"single"),value:s})}return i},i.prototype.setTemplate=function(){var e=this.getDayData("narrow"),t=this.getDayData("wide");this.element.innerHTML='<div class="e-editor"><div class="e-input-wrapper e-form-left"><input type="text" tabindex="0" class="e-repeat-element"label="'+"e-repeat-element".substr(2)+'" /></div><div class="'+Zt+' e-interval e-form-right"><table class="e-recurrence-table e-repeat-content-wrapper" role="none"><tr><td><input type="text" tabindex="0" id="'+this.element.id+'_e-repeat-interval" class="e-repeat-interval"title="'+this.localeObj.getConstant("repeatEvery")+'" /></td><td><span class="e-repeat-content"></span></td></tr></table></div><div class="e-input-wrapper-side e-days '+Jt+'"><div class=e-week-expander-label>'+this.localeObj.getConstant("on")+'</div><button type="button" class="e-round" data-index="0" title="'+t[0].text+'">'+e[0].text+'</button><button type="button" class="e-round" data-index="1" title="'+t[1].text+'">'+e[1].text+'</button><button type="button" class="e-round" data-index="2" title="'+t[2].text+'">'+e[2].text+'</button><button type="button" class="e-round" data-index="3" title="'+t[3].text+'">'+e[3].text+'</button><button type="button" class="e-round" data-index="4" title="'+t[4].text+'">'+e[4].text+'</button><button type="button" class="e-round" data-index="5" title="'+t[5].text+'">'+e[5].text+'</button><button type="button" class="e-round" data-index="6" title="'+t[6].text+'">'+e[6].text+'</button></div><div class="e-input-wrapper-side e-non-week '+Jt+'"><div class=e-month-expander-label>'+this.localeObj.getConstant("on")+'</div><div class="e-year-expander"><input class="e-year-expander-element" type="text" tabindex="0" title="'+this.localeObj.getConstant("yearExpander")+'"/></div><div class="e-month-expander"><table class="e-recurrence-table e-month-expand-wrapper" role="none"><tr><td><div class="'+Zt+' e-month-expander-checkbox-wrapper"><input class="e-month-expander-element"title="'+this.localeObj.getConstant("monthExpander")+'" type="radio"></div></td><td colspan="2"><div class="'+Zt+' e-monthday-element"><input type="text" tabindex="0" id="'+this.element.id+'_e-month-day" class="e-month-day"title="'+this.localeObj.getConstant("on")+'" /></div></td></tr><tr><td><div class="'+Zt+' e-month-expander-checkbox-wrapper e-repeat-on-week-selector"><input class="e-month-expander-wrapper"title="'+this.localeObj.getConstant("monthExpander")+'" type="radio"></div></td><td><div class="'+Zt+' e-week-position" ><input type="text" tabindex="0" class="e-month-pos"title="'+this.localeObj.getConstant("monthPosition")+'" /></div></td><td><div class="'+Zt+' e-day-position"><input type="text" tabindex="0" class="e-month-week"title="'+this.localeObj.getConstant("monthWeek")+'" /></div></td></tr></table></div></div><div class="e-input-wrapper-side e-end-on e-form-right"><div class="'+Zt+' e-end-on-left"><input type="text" tabindex="0" class="e-end-on-element"title="'+this.localeObj.getConstant("end")+'" /></div><div class="'+Zt+' e-end-on-date" ><input type="text" tabindex="0" class="e-until-date"title="'+this.localeObj.getConstant("until")+'" /></div><div class="'+Zt+' e-end-on-count"><input type="text" tabindex="0" id="'+this.element.id+"_"+$t+'" class="'+$t+'"title="'+this.localeObj.getConstant("count")+'" /></div></div></div></div>'},i.prototype.getSelectedDaysData=function(){var e="BYDAY=",t=[].slice.call(this.element.querySelectorAll(".e-days button."+ti)),i=["SU","MO","TU","WE","TH","FR","SA"];this.rotateArray(i,this.firstDayOfWeek);for(var n=0;n<t.length;n++)e+=i[parseInt(t[parseInt(n.toString(),10)].getAttribute("data-index"),10)]+(n===t.length-1?"":",");return e+";"},i.prototype.getSelectedMonthData=function(){return this.onWeekDay.checked?"BYDAY="+this.monthWeekDays.value+";BYSETPOS="+this.monthWeekPos.value+";":"BYMONTHDAY="+this.monthDate.value+";"},i.prototype.getIntervalData=function(){return"INTERVAL="+this.repeatInterval.value+";"},i.prototype.getEndOnCount=function(){return"COUNT="+this.recurrenceCount.value+";"},i.prototype.getYearMonthRuleData=function(){return"BYMONTH="+this.monthValue.value+";"},i.prototype.updateWeekButton=function(e){var t=["SU","MO","TU","WE","TH","FR","SA"];this.rotateArray(t,this.firstDayOfWeek);for(var i=0,n=this.dayButtons;i<n.length;i++){var r=n[i],a=parseInt(r.element.getAttribute("data-index"),10);-1!==e.indexOf(t[parseInt(a.toString(),10)])?r.setProperties({isPrimary:!0}):r.setProperties({isPrimary:!1})}},i.prototype.updateMonthUI=function(){if(this.ruleObject.monthDay.length)this.monthDate.setProperties({value:this.ruleObject.monthDay[0]}),this.onMonthDay.setProperties({checked:!0});else{this.onWeekDay.setProperties({checked:!0}),this.monthWeekPos.setProperties({value:this.ruleObject.setPosition});for(var e=0,t=Object.keys(ni);e<t.length;e++){var i=t[e];if(ni[""+i]===this.ruleObject.day[0]){this.monthWeekDays.setProperties({value:this.ruleObject.day[0]});break}}}},i.prototype.updateUI=function(e,t){switch(this.repeatInterval.setProperties({value:this.ruleObject.interval}),t){case"until":this.untilDateObj.setProperties({value:this.ruleObject.until});break;case"count":this.recurrenceCount.setProperties({value:this.ruleObject.count})}switch(e){case"weekly":this.updateWeekButton(this.ruleObject.day);break;case"yearly":this.monthValue.setProperties({index:this.ruleObject.month[0]-1}),this.updateMonthUI();break;case"monthly":this.updateMonthUI()}},i.prototype.getUntilData=function(){return this.untilDateObj.value?"UNTIL="+Ne(this.untilDateObj.value)+";":""},i.prototype.destroyComponents=function(){this.recurrenceCount.isDestroyed||(this.recurrenceCount.destroy(),this.recurrenceCount=null),this.monthDate.isDestroyed||(this.monthDate.destroy(),this.monthDate=null),this.repeatInterval.isDestroyed||(this.repeatInterval.destroy(),this.repeatInterval=null),this.untilDateObj.isDestroyed||(this.untilDateObj.destroy(),this.untilDateObj=null),this.repeatType.isDestroyed||(this.repeatType.destroy(),this.repeatType=null),this.endType.isDestroyed||(this.endType.destroy(),this.endType=null),this.monthWeekPos.isDestroyed||(this.monthWeekPos.destroy(),this.monthWeekPos=null),this.monthWeekDays.isDestroyed||(this.monthWeekDays.destroy(),this.monthWeekDays=null),this.monthValue.isDestroyed||(this.monthValue.destroy(),this.monthValue=null),this.onMonthDay.isDestroyed||(this.onMonthDay.destroy(),this.onMonthDay=null),this.onWeekDay.isDestroyed||(this.onWeekDay.destroy(),this.onWeekDay=null),this.dayButtons.forEach(function(e){e.isDestroyed||e.destroy()}),this.dayButtons=[],this.monthButtons.forEach(function(e){e.isDestroyed||e.destroy()}),this.monthButtons=[]},i.prototype.resetFields=function(){this.startState("none",this.endTypes[0],this.startDate),this.setDefaultValue()},i.prototype.updateRuleUntilDate=function(e){if(this.untilDateObj.value&&e){var t=this.untilDateObj.value,i=new Date(t.getFullYear(),t.getMonth(),t.getDate(),e.getHours(),e.getMinutes(),e.getMilliseconds());this.untilDateObj.setProperties({value:i})}},i.prototype.getCalendarMode=function(){return t.isNullOrUndefined(this.calendarMode)?"gregorian":this.calendarMode.toLowerCase()},i.prototype.getRuleSummary=function(e){return void 0===e&&(e=this.getRecurrenceRule()),Y(e,this.localeObj,this.locale,this.calendarMode)},i.prototype.getRecurrenceDates=function(e,i,n,r,a){return a=t.isNullOrUndefined(a)?this.startDate:a,G(e,i,n,this.firstDayOfWeek,r,a,this.calendarMode)},i.prototype.getRecurrenceRule=function(){var e="FREQ=";switch(this.repeatType.value){case"daily":e+="DAILY;";break;case"weekly":e+="WEEKLY;"+this.getSelectedDaysData();break;case"monthly":e+="MONTHLY;"+this.getSelectedMonthData();break;case"yearly":e+="YEARLY;"+this.getSelectedMonthData()+this.getYearMonthRuleData();break;case"none":return""}switch(e+=this.getIntervalData(),this.endType.value){case"until":e+=this.getUntilData();break;case"count":e+=this.getEndOnCount()}return e},i.prototype.setRecurrenceRule=function(e,t){if(void 0===t&&(t=this.startDate),!e)return void this.repeatType.setProperties({value:"none"});this.renderStatus=!1,this.ruleObject=Ee(e);var i=this.ruleObject.count?"count":this.ruleObject.until?"until":"never";switch(this.ruleObject.freq){case"DAILY":this.startState("daily",i,t),this.updateUI("daily",i);break;case"WEEKLY":this.startState("weekly",i,t),this.updateUI("weekly",i);break;case"MONTHLY":this.startState("monthly",i,t),this.updateUI("monthly",i);break;case"YEARLY":this.startState("yearly",i,t),this.updateUI("yearly",i)}this.renderStatus=!0,this.triggerChangeEvent()},i.prototype.detachInputs=function(){for(var e=0,i=[].slice.call(this.element.querySelectorAll("input"));e<i.length;e++){var n=i[e];t.detach(n)}},i.prototype.destroy=function(){if(!this.isDestroyed){this.destroyComponents(),e.prototype.destroy.call(this);var i=["e-"+this.getModuleName()];for(this.cssClass&&(i=i.concat(this.cssClass.split(" "))),t.removeClass([this.element],i),this.detachInputs();this.element.firstElementChild;)this.element.removeChild(this.element.firstElementChild)}},i.prototype.getModuleName=function(){return"recurrenceeditor"},i.prototype.getPersistData=function(){return this.addOnPersist([])},i.prototype.render=function(){this.initialize(),this.rtlClass(this.enableRtl),this.renderStatus=!0,this.renderComplete()},i.prototype.onPropertyChanged=function(e,i){for(var n=0,r=Object.keys(e);n<r.length;n++)switch(r[n]){case"startDate":this.selectMonthDay(e.startDate),this.updateUntilDate(e.startDate),this.endType.setProperties({index:0});break;case"enableRtl":this.rtlClass(e.enableRtl);break;case"cssClass":i.cssClass&&t.removeClass([this.element],i.cssClass.split(" ")),e.cssClass&&t.addClass([this.element],e.cssClass.split(" "));break;case"selectedType":this.repeatType.setProperties({index:this.selectedType});break;case"minDate":this.untilDateObj.setProperties({min:this.minDate});break;case"maxDate":this.untilDateObj.setProperties({max:this.maxDate});break;case"value":this.getRecurrenceRule()!==this.value&&this.setRecurrenceRule(this.value);break;case"calendarMode":this.calendarMode=e.calendarMode,this.calendarUtil=je(e.calendarMode);break;case"locale":case"frequencies":case"firstDayOfWeek":case"endTypes":this.refresh();break;case"dateFormat":this.untilDateObj.setProperties({format:e.dateFormat})}},Kt([t.Property(["none","daily","weekly","monthly","yearly"])],i.prototype,"frequencies",void 0),Kt([t.Property(["never","until","count"])],i.prototype,"endTypes",void 0),Kt([t.Property(0)],i.prototype,"firstDayOfWeek",void 0),Kt([t.Property(new Date)],i.prototype,"startDate",void 0),Kt([t.Property()],i.prototype,"dateFormat",void 0),Kt([t.Property("Gregorian")],i.prototype,"calendarMode",void 0),Kt([t.Property()],i.prototype,"cssClass",void 0),Kt([t.Property()],i.prototype,"value",void 0),Kt([t.Property(new Date(1900,0,1))],i.prototype,"minDate",void 0),Kt([t.Property(new Date(2099,11,31))],i.prototype,"maxDate",void 0),Kt([t.Property(0)],i.prototype,"selectedType",void 0),Kt([t.Event()],i.prototype,"change",void 0),Kt([t.Event()],i.prototype,"created",void 0),Kt([t.Event()],i.prototype,"destroyed",void 0),i=Kt([t.NotifyPropertyChanges],i)}(t.Component),ui=function(){function e(e){this.parent=e,this.l10n=this.parent.localeObj,this.fields=this.parent.eventFields,this.eventWindowTime={startTime:new Date,endTime:new Date},this.renderEventWindow()}return e.prototype.renderEventWindow=function(){this.element=t.createElement("div",{id:this.parent.element.id+"_dialog_wrapper"}),this.parent.element.appendChild(this.element);var e={animationSettings:{effect:"Zoom"},content:this.getEventWindowContent(),cssClass:"e-schedule-dialog",enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,height:this.parent.isAdaptive?"100%":"auto",minHeight:"300px",isModal:!0,showCloseIcon:!this.parent.isAdaptive,target:document.body,visible:!1,width:"500px",beforeOpen:this.onBeforeOpen.bind(this),beforeClose:this.onBeforeClose.bind(this)};this.parent.isAdaptive?(e.cssClass="e-schedule-dialog e-device",this.parent.editorHeaderTemplate||(e.header='<div class="e-title-header"><div class="e-back-icon e-icons"></div><div class="e-title-text">'+this.l10n.getConstant("newEvent")+'</div><div class="e-save-icon e-icons"></div></div>')):(this.parent.editorFooterTemplate||this.renderDialogButtons(e),this.parent.editorHeaderTemplate||(e.header='<div class="e-title-text">'+this.l10n.getConstant("newEvent")+"</div>")),this.dialogObject=new i.Dialog(e,this.element),this.dialogObject.element.querySelector(".e-dlg-closeicon-btn")&&this.dialogObject.element.querySelector(".e-dlg-closeicon-btn").setAttribute("title",this.l10n.getConstant("close")),this.addEventHandlers(),t.addClass([this.element.parentElement],"e-schedule-dialog-container"),t.EventHandler.add(this.dialogObject.element,"keydown",this.preventEventSave,this),this.applyFormValidation()},e.prototype.renderDialogButtons=function(e){e.buttons=[{buttonModel:{content:this.l10n.getConstant("deleteButton"),cssClass:"e-event-delete",disabled:!this.parent.eventSettings.allowDeleting||this.parent.readonly},click:this.eventDelete.bind(this)},{buttonModel:{content:this.l10n.getConstant("saveButton"),cssClass:"e-primary e-event-save",isPrimary:!0,disabled:!this.parent.eventSettings.allowAdding||this.parent.readonly},click:this.eventSave.bind(this)},{buttonModel:{cssClass:"e-event-cancel",content:this.l10n.getConstant("cancelButton")},click:this.dialogClose.bind(this)}]},e.prototype.addEventHandlers=function(){var e=this.element.querySelector(".e-back-icon"),i=this.element.querySelector(".e-save-icon");!this.parent.isAdaptive||t.isNullOrUndefined(e)||t.isNullOrUndefined(i)||(t.EventHandler.add(e,"click",this.dialogClose,this),t.EventHandler.add(i,"click",this.eventSave,this))},e.prototype.refresh=function(){this.destroy(!0),this.renderEventWindow()},e.prototype.refreshRecurrenceEditor=function(){if(this.recurrenceEditor){var e=this.recurrenceEditor.element;this.recurrenceEditor.destroy(),this.createRecurrenceEditor(e)}},e.prototype.setRecurrenceEditor=function(e){this.parent.editorTemplate&&(this.recurrenceEditor=e)},e.prototype.openEditor=function(e,i,n,r){if(this.parent.currentAction=i,this.parent.removeNewEventElement(),this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(!0),this.parent.inlineModule.removeInlineAppointmentElement(),"Add"===i){var a={};this.cellClickAction=!n,this.parent.activeCellsData=e;var s=e;this.cellClickAction?this.convertToEventData(s,a):(this.parent.activeCellsData={startTime:s.startTime||s[this.fields.startTime],endTime:s.endTime||s[this.fields.endTime],isAllDay:s.isAllDay||s[this.fields.isAllDay],element:s.element,groupIndex:s.groupIndex},a=s),e=a}t.isNullOrUndefined(this.parent.editorHeaderTemplate)||(this.parent.resetTemplates(["editorHeaderTemplate"]),this.parent.isAdaptive&&!this.parent.editorFooterTemplate?this.dialogObject.header=this.createAdaptiveHeaderElement(e):this.dialogObject.header=this.getDialogHeader(e)),t.isNullOrUndefined(this.parent.editorFooterTemplate)||(this.parent.resetTemplates(["editorFooterTemplate"]),this.dialogObject.footerTemplate=this.getDialogFooter(e)),t.isNullOrUndefined(this.parent.editorHeaderTemplate)&&t.isNullOrUndefined(this.parent.editorFooterTemplate)||(this.dialogObject.dataBind(),this.addEventHandlers()),t.isNullOrUndefined(this.parent.editorTemplate)?this.setEditorContent(e,i,r):this.renderFormElements(this.element.querySelector(".e-schedule-form"),e,i,r)},e.prototype.setEditorContent=function(e,i,n){switch(!this.parent.isAdaptive&&t.isNullOrUndefined(this.parent.editorTemplate)&&t.removeClass([this.dialogObject.element.querySelector(".e-recurrenceeditor")],"e-disable"),this.recurrenceEditor&&(this.recurrenceEditor.firstDayOfWeek=this.parent.activeViewOptions.firstDayOfWeek),i){case"Add":this.onCellDetailsUpdate(e,n);break;case"Save":case"EditOccurrence":case"EditSeries":case"EditFollowingEvents":"EditOccurrence"===i&&!this.parent.isAdaptive&&t.isNullOrUndefined(this.parent.editorTemplate)&&t.addClass([this.dialogObject.element.querySelector(".e-recurrenceeditor")],"e-disable"),this.cellClickAction=!1,this.onEventDetailsUpdate(e)}},e.prototype.setDialogContent=function(){this.dialogObject.content=this.getEventWindowContent(),this.dialogObject.dataBind(),this.applyFormValidation()},e.prototype.setDialogHeader=function(){t.isNullOrUndefined(this.parent.editorHeaderTemplate)?this.parent.isAdaptive?this.dialogObject.header='<div class="e-title-header"><div class="e-back-icon e-icons"></div><div class="e-title-text">'+this.l10n.getConstant("newEvent")+'</div><div class="e-save-icon e-icons"></div></div>':this.dialogObject.header='<div class="e-title-text">'+this.l10n.getConstant("newEvent")+"</div>":(this.parent.resetTemplates(["editorHeaderTemplate"]),this.parent.isAdaptive&&!this.parent.editorFooterTemplate?this.dialogObject.header=this.createAdaptiveHeaderElement():this.dialogObject.header=this.getDialogHeader()),this.dialogObject.dataBind(),this.addEventHandlers()},e.prototype.setDialogFooter=function(){t.isNullOrUndefined(this.parent.editorFooterTemplate)?!this.parent.isAdaptive&&t.isNullOrUndefined(this.parent.editorFooterTemplate)?this.renderDialogButtons(this.dialogObject):this.parent.isAdaptive&&t.isNullOrUndefined(this.parent.editorFooterTemplate)&&(this.dialogObject.footerTemplate=null):(this.parent.resetTemplates(["editorFooterTemplate"]),this.dialogObject.footerTemplate=this.getDialogFooter()),this.dialogObject.dataBind()},e.prototype.createAdaptiveHeaderElement=function(e){var i=t.createElement("div",{className:"e-title-header"}),n=t.createElement("div",{className:"e-back-icon e-icons"});i.appendChild(n);var r=this.getDialogHeader(e);i.appendChild(r);var a=t.createElement("div",{className:"e-save-icon e-icons"});return i.appendChild(a),i},e.prototype.getDialogHeader=function(e){var i=[],n=this.parent.element.id+"_editorHeaderTemplate",r=document.createElement("div");return i=[].slice.call(this.parent.getEditorHeaderTemplate()(e||{},this.parent,"editorHeaderTemplate",n,!1)),t.append(i,r),r},e.prototype.getDialogFooter=function(e){var i=[],n=this.parent.element.id+"_editorFooterTemplate",r=document.createElement("div");return i=[].slice.call(this.parent.getEditorFooterTemplate()(e||{},this.parent,"editorFooterTemplate",n,!1)),t.append(i,r),r},e.prototype.preventEventSave=function(e){this.parent&&!this.parent.allowKeyboardInteraction&&"Enter"===e.code&&(this.isEnterKey=!0)},e.prototype.onBeforeOpen=function(e){var i=this,n=this.eventData[this.fields.endTime].getTime(),r={type:"Editor",data:this.eventData,cancel:!1,element:this.element,target:this.cellClickAction?this.parent.activeCellsData.element:this.parent.activeEventData.element};this.cellClickAction&&(r.duration=this.getSlotDuration());var s=this.getInstance("e-event-save");s&&(s.disabled=!(this.cellClickAction?this.parent.eventSettings.allowAdding:this.parent.eventSettings.allowEditing),s.dataBind());var o=this.getInstance("e-event-delete");o&&(o.disabled=!this.parent.eventSettings.allowDeleting,o.dataBind());var l=new a.Deferred;return this.parent.trigger("popupOpen",r,function(r){if(e.cancel=r.cancel,e.maxHeight=i.parent.isAdaptive?"max-content":e.maxHeight,i.duration=i.cellClickAction?r.duration:null,i.eventData[i.fields.endTime].getTime()!==n||i.cellClickAction||0!==i.eventData[i.fields.endTime].getHours()||0!==i.eventData[i.fields.endTime].getMinutes()||(i.eventData=t.extend({},i.eventData,null,!0),i.trimAllDay(i.eventData)),i.refreshDateTimePicker(i.duration),i.cellClickAction&&r.duration!==i.getSlotDuration()&&t.isNullOrUndefined(i.parent.editorTemplate)){var a=i.getInstance("e-start"),s=i.getInstance("e-end");s.value=new Date(a.value.getTime()+Ke*r.duration),s.dataBind()}i.parent.editorTemplate&&i.element.querySelector(".e-recurrenceeditor")&&!i.recurrenceEditor&&(i.recurrenceEditor=i.getInstance("e-recurrenceeditor")),l.resolve(e)}),l},e.prototype.onBeforeClose=function(e){var t=this;e.isInteracted&&(this.isCrudAction=!1);var i={type:"Editor",event:e.event||this.dialogEvent,data:this.eventCrudData,cancel:!1,element:this.element,target:this.cellClickAction?this.parent.activeCellsData.element:this.parent.activeEventData.element},n=new a.Deferred;return this.parent.trigger("popupClose",i,function(i){e.cancel=i.cancel,i.cancel||(t.isCrudAction&&(e.cancel=t.processCrudActions(i.data),t.isCrudAction=e.cancel),t.isCrudAction||(t.resetForm(),t.parent.eventBase.focusElement(!0),t.eventCrudData=null)),n.resolve(e)}),n},e.prototype.getEventWindowContent=function(){var e=t.createElement("div",{className:"e-form-container"}),i=t.createElement("form",{id:this.parent.element.id+"EditForm",className:ot});return i.onsubmit=function(){return!1},this.renderFormElements(i),e.appendChild(i),e},e.prototype.renderFormElements=function(e,i,n,r){var a=this;if(t.isNullOrUndefined(this.parent.editorTemplate))e.appendChild(this.getDefaultEventWindowContent()),i&&this.setEditorContent(i,n,r);else{if(i&&(this.fieldValidator&&(this.fieldValidator.destroy(),this.fieldValidator=null),this.recurrenceEditor&&(this.recurrenceEditor.destroy(),this.recurrenceEditor=null),this.destroyComponents(),this.parent.resetTemplates(["editorTemplate"]),t.EventHandler.clearEvents(e),!this.parent.isReact))for(var s=0,o=[].slice.call(e.children);s<o.length;s++){var l=o[s];t.remove(l)}var p=this.parent.element.id+"_editorTemplate",c=[].slice.call(this.parent.getEditorTemplate()(i||{},this.parent,"editorTemplate",p,!1));t.append(c,e),this.parent.renderTemplates(function(){a.element&&(a.applyFormValidation(),i&&a.setEditorContent(i,n,r))})}},e.prototype.getDefaultEventWindowContent=function(){var e=this.createDivElement("e-dialog-parent"),i=this.createDivElement("e-title-location-row");e.appendChild(i),i.appendChild(this.renderTextBox("e-subject")),i.appendChild(this.renderTextBox("e-location"));var n=this.createDivElement("e-start-end-row");e.appendChild(n),n.appendChild(this.renderDateTimePicker("e-start",this.onTimeChange.bind(this))),n.appendChild(this.renderDateTimePicker("e-end"));var r=this.createDivElement("e-all-day-time-zone-row");e.appendChild(r),r.appendChild(this.renderCheckBox("e-all-day")),r.appendChild(this.renderCheckBox("e-time-zone"));var a=this.createDivElement("e-time-zone-row");e.appendChild(a),a.appendChild(this.renderDropDown("e-start-time-zone")),a.appendChild(this.renderDropDown("e-end-time-zone"));var o=this.createDivElement("e-repeat-parent-row");e.appendChild(o);var l=this.renderCheckBox("e-repeat"),p=t.createElement("span",{className:"e-recurrence-container"}),c=t.createElement("button",{className:"e-recurrence-edit-button",attrs:{type:"button",title:this.l10n.getConstant("editRecurrence")}});if(this.buttonObj=new s.Button({iconCss:"e-recurrence-edit e-icons",cssClass:"e-medium "+this.parent.cssClass}),p.appendChild(c),this.buttonObj.appendTo(c),l.appendChild(p),o.appendChild(l),this.parent.isAdaptive?t.EventHandler.add(c,"click",this.loadRecurrenceEditor,this):this.createRecurrenceEditor(e),this.parent.resourceCollection.length>0){for(var h=this.createDivElement("e-resources-row"),d=0,u=this.parent.resourceBase.resourceCollection;d<u.length;d++){var g=u[d];h.appendChild(this.renderResourceDetails(g))}e.appendChild(h)}var v=this.createDivElement("e-description-row");v.appendChild(this.renderTextBox("e-description")),e.appendChild(v);var m=t.createElement("button",{attrs:{type:"hidden",title:"submit"}});return m.style.display="none",e.appendChild(m),e},e.prototype.createRecurrenceEditor=function(e){var i=t.createElement("div",{id:this.parent.element.id+"_recurrence_editor"});e.appendChild(i),this.recurrenceEditor=this.renderRecurrenceEditor(),this.recurrenceEditor.appendTo(i),this.updateMinMaxDateToEditor()},e.prototype.createDivElement=function(e){return t.createElement("div",{className:e})},e.prototype.createInputElement=function(e,i,n){return t.createElement(n||"input",{className:e,attrs:{type:"text",name:i,value:"",id:i}})},e.prototype.getSlotDuration=function(){return this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount},e.prototype.renderDateTimePicker=function(e,i){var n=this.createDivElement(e+"-container"),a=this.getFieldName(e),s=this.createInputElement(e+" e-field",a);return n.appendChild(s),new r.DateTimePicker({change:i,firstDayOfWeek:this.parent.activeViewOptions.firstDayOfWeek,calendarMode:this.parent.calendarMode,min:this.parent.minDate,max:new Date(new Date(+this.parent.maxDate).setHours(23,59,59)),cssClass:this.parent.cssClass,enableRtl:this.parent.enableRtl,locale:this.parent.locale,floatLabelType:"Always",strictMode:!0,timeFormat:this.parent.activeViewOptions.timeFormat,format:(t.isNullOrUndefined(this.parent.dateFormat)?this.getFormat("dateFormats"):this.parent.dateFormat)+" "+this.parent.activeViewOptions.timeFormat,placeholder:this.getFieldLabel(e),step:this.getSlotDuration(),width:"100%"}).appendTo(s),n},e.prototype.refreshDateTimePicker=function(e){for(var t=0,i=[].slice.call(this.element.querySelectorAll(".e-start,.e-end"));t<i.length;t++){var n=i[t].ej2_instances[0];n.firstDayOfWeek=this.parent.activeViewOptions.firstDayOfWeek,n.timeFormat=this.parent.activeViewOptions.timeFormat,n.step=e||this.getSlotDuration(),n.dataBind()}},e.prototype.onTimeChange=function(){var e=this.getInstance("e-start");if(e.element.parentElement.classList.contains("e-input-focus")){var i=this.getInstance("e-end"),n=0;this.cellClickAction?(n=Ke*this.duration,this.eventWindowTime.startTime=e.value):n=this.eventData[this.fields.endTime].getTime()-this.eventData[this.fields.startTime].getTime();var r=t.isNullOrUndefined(e.value)?null:new Date(e.value.getTime()+n);this.cellClickAction&&(this.eventWindowTime.endTime=r),i.value=r,i.dataBind()}this.recurrenceEditor&&this.recurrenceEditor.updateRuleUntilDate(this.eventWindowTime.startTime)},e.prototype.renderResourceDetails=function(e){var i=this,n=e.field,r="e-"+n,a=e.title,s=this.createDivElement(r+"-container e-resources"),o=this.createInputElement(r+" e-field",n);s.appendChild(o);var p=function(i){return t.SanitizeHtmlHelper.sanitize('<div class="e-resource-template">\n <div class="e-resource-color" data-resource-color="'+i[e.colorField]+'"></div>\n <div class="e-resource-text">'+i[e.textField]+"</div></div>")};return t.initializeCSPTemplate(p,e),e.allowMultiple?new l.MultiSelect({enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass||"",dataSource:e.dataSource,change:this.onMultiselectResourceChange.bind(this),itemTemplate:p,fields:{text:e.textField,value:e.idField},htmlAttributes:{name:n},floatLabelType:"Always",placeholder:a,popupHeight:"230px",popupWidth:"447px",mode:"Box",open:function(e){Promise.resolve().then(function(){i.applyStylesAfterRender(e)})}}).appendTo(o):new l.DropDownList({cssClass:this.parent.cssClass||"",change:this.onDropdownResourceChange.bind(this),dataSource:e.dataSource,enableRtl:this.parent.enableRtl,fields:{text:e.textField,value:e.idField},htmlAttributes:{name:n},floatLabelType:"Always",placeholder:a,popupHeight:"230px",popupWidth:"447px",itemTemplate:p,open:function(e){Promise.resolve().then(function(){i.applyStylesAfterRender(e)})}}).appendTo(o),s},e.prototype.applyStylesAfterRender=function(e){e.popup&&e.popup.element&&e.popup.element.querySelectorAll(".e-resource-color[data-resource-color]").forEach(function(e){var t=e.getAttribute("data-resource-color");t&&(e.style.backgroundColor=t)})},e.prototype.renderDropDown=function(e){var t=this,i=this.getFieldName(e),n=this.createDivElement(e+"-container"),r=this.createInputElement(e+" e-field",i);return n.appendChild(r),new l.DropDownList({allowFiltering:!0,change:this.onTimezoneChange.bind(this),cssClass:this.parent.cssClass||"",dataSource:this.parent.timezoneDataSource,enableRtl:this.parent.enableRtl,fields:{text:"Text",value:"Value"},filterBarPlaceholder:this.parent.localeObj.getConstant("searchTimezone"),noRecordsTemplate:this.parent.localeObj.getConstant("noRecords"),filtering:function(e){var i=new a.Query;i=""!==e.text?i.where("Text","contains",e.text,!0):i,e.updateData(t.parent.timezoneDataSource,i)},htmlAttributes:{title:this.getFieldLabel(e),name:i},floatLabelType:"Always",placeholder:this.getFieldLabel(e),popupHeight:"230px"}).appendTo(r),n},e.prototype.onMultiselectResourceChange=function(e){if(e.value&&this.parent.activeViewOptions.group.byGroupID&&!(this.parent.resourceCollection.length<=1))for(var i=this.parent.resourceBase.resourceCollection,n=e.element.getAttribute("name")||this.getColumnName(e.element),r=0;r<i.length;r++)if(i[parseInt(r.toString(),10)].field===n&&r<i.length-1){for(var a=this.createInstance(r),s=[],o=this,l=0;l<e.value.length;l++)!function(n){var a=i[r+1],l=a.dataSource.filter(function(t){return t[a.groupIDField]===e.value[parseInt(n.toString(),10)]})[0],p=t.isNullOrUndefined(l)?null:l[i[r+1].groupIDField],c=o.filterDatasource(r,p);s=s.concat(c)}(l);a.dataSource=s,a.dataBind()}},e.prototype.createInstance=function(e){var t=this.parent.resourceBase.resourceCollection[e+1],i=this.element.querySelector(".e-"+t.field).ej2_instances[0];return i.clear(),i},e.prototype.onDropdownResourceChange=function(e){if(e.value&&!(this.parent.resourceCollection.length<=1)&&this.parent.activeViewOptions.group.byGroupID)for(var t=e.element.getAttribute("name")||this.getColumnName(e.element),i=this.parent.resourceBase.resourceCollection,n=0;n<i.length;n++)if(n<i.length-1&&i[parseInt(n.toString(),10)].field===t){var r=this.createInstance(n),a=e.itemData[i[parseInt(n.toString(),10)].idField];r.dataSource=this.filterDatasource(n,a),r.dataBind();var s=r.dataSource.length>0?r.dataSource[0][i[n+1].idField]:null;r.value=i[n+1].allowMultiple?[s]:s,r.dataBind()}},e.prototype.filterDatasource=function(e,t){var i=this.parent.resourceBase.resourceCollection[e+1];return i.dataSource.filter(function(e){return e[i.groupIDField]===t})},e.prototype.onTimezoneChange=function(e){if((e.element.getAttribute("name")||this.getColumnName(e.element))===this.parent.eventFields.startTimezone){var t=this.getInstance("e-start-time-zone"),i=this.getInstance("e-end-time-zone");i.value=t.value,i.dataBind()}},e.prototype.renderCheckBox=function(e){var t=this.createDivElement(e+"-container"),i=this.getFieldName(e),n=this.createInputElement(e+" e-field",i);t.appendChild(n);var r=new s.CheckBox({change:this.onChange.bind(this),cssClass:e+" "+this.parent.cssClass,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,label:this.getFieldLabel(e)});return r.appendTo(n),n.setAttribute("name",i),"Repeat"===i&&(this.repeatStatus=r),t},e.prototype.renderTextBox=function(e){var t=this.createDivElement(e+"-container"),i=this.getFieldName(e),n="e-description"===e?"textarea":"input",r=this.createInputElement(e+" e-field",i,n);return t.appendChild(r),o.Input.createInput({element:r,floatLabelType:"Always",properties:{enableRtl:this.parent.enableRtl,placeholder:this.getFieldLabel(e)}}),t},e.prototype.getFieldName=function(e){var t="";switch(e){case"e-subject":t=this.fields.subject;break;case"e-location":t=this.fields.location;break;case"e-start":t=this.fields.startTime;break;case"e-end":t=this.fields.endTime;break;case"e-description":t=this.fields.description;break;case"e-all-day":t=this.fields.isAllDay;break;case"e-start-time-zone":t=this.fields.startTimezone;break;case"e-end-time-zone":t=this.fields.endTimezone;break;case"e-time-zone":t="Timezone";break;case"e-repeat":t="Repeat"}return t},e.prototype.getFieldLabel=function(e){var t="";switch(e){case"e-subject":t=this.parent.editorTitles.subject;break;case"e-location":t=this.parent.editorTitles.location;break;case"e-description":t=this.parent.editorTitles.description;break;case"e-start":t=this.parent.editorTitles.startTime;break;case"e-end":t=this.parent.editorTitles.endTime;break;case"e-start-time-zone":t=this.parent.editorTitles.startTimezone;break;case"e-end-time-zone":t=this.parent.editorTitles.endTimezone;break;case"e-repeat":t=this.parent.editorTitles.recurrenceRule;break;case"e-all-day":t=this.parent.editorTitles.isAllDay;break;case"e-time-zone":t=this.l10n.getConstant("timezone")}return t},e.prototype.onChange=function(e){if(e.event&&e.event.target){var i=t.closest(e.event.target,".e-all-day,.e-time-zone,.e-repeat");i.classList.contains("e-all-day")?this.onAllDayChange(e.checked):i.classList.contains("e-time-zone")?this.timezoneChangeStyle(e.checked):i.classList.contains("e-repeat")&&this.onRepeatChange(e.checked)}},e.prototype.renderRepeatDialog=function(){var e=t.createElement("div");this.repeatDialogObject=new i.Dialog({header:this.l10n.getConstant("recurrence"),visible:!1,content:'<div class="e-rec-editor"></div>',closeOnEscape:!0,width:"90%",buttons:[{click:this.repeatSaveDialog.bind(this),buttonModel:{content:this.l10n.getConstant("save"),cssClass:"e-save",isPrimary:!0}},{click:this.repeatCancelDialog.bind(this),buttonModel:{cssClass:"e-cancel",content:this.l10n.getConstant("cancel")}}],target:this.element,animationSettings:{effect:"Zoom"},enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,isModal:!0,cssClass:"e-recurrence-dialog",open:this.repeatOpenDialog.bind(this)}),this.element.appendChild(e),this.repeatDialogObject.appendTo(e),this.createRecurrenceEditor(this.repeatDialogObject.element.querySelector(".e-rec-editor"))},e.prototype.loadRecurrenceEditor=function(){this.repeatDialogObject.show(),this.recurrenceEditor&&this.repeatRule&&this.recurrenceEditor.setRecurrenceRule(this.repeatRule)},e.prototype.onRepeatChange=function(e){if(e)this.repeatDialogObject||this.renderRepeatDialog(),this.recurrenceEditor.setProperties({startDate:this.repeatStartDate,selectedType:0}),this.loadRecurrenceEditor();else{this.repeatDialogObject&&this.repeatDialogObject.hide(),this.repeatRule="",this.recurrenceEditor&&(this.recurrenceEditor.setRecurrenceRule(this.repeatRule),this.updateRepeatLabel(this.repeatRule));var i=this.element.querySelector(".e-recurrence-container");t.addClass([i],"e-hide")}},e.prototype.repeatSaveDialog=function(){this.repeatRule=this.recurrenceEditor.getRecurrenceRule();var e=this.element.querySelector(".e-recurrence-container");this.recurrenceEditor.getRecurrenceRule()?t.removeClass([e],"e-hide"):(t.addClass([e],"e-hide"),this.repeatStatus.setProperties({checked:!1})),this.updateRepeatLabel(this.repeatRule),this.closeRepeatDialog()},e.prototype.closeRepeatDialog=function(){this.repeatDialogObject.hide()},e.prototype.repeatCancelDialog=function(){this.closeRepeatDialog(),this.recurrenceEditor&&this.recurrenceEditor.setRecurrenceRule(this.repeatTempRule),this.repeatTempRule||this.repeatStatus.setProperties({checked:!1})},e.prototype.repeatOpenDialog=function(){this.repeatTempRule=this.recurrenceEditor.getRecurrenceRule()},e.prototype.onCellDetailsUpdate=function(e,i){if(this.parent.eventSettings.allowAdding){this.parent.isAdaptive&&i&&!this.repeatDialogObject&&this.renderRepeatDialog(),this.element.querySelector("."+ot).removeAttribute("data-id"),t.isNullOrUndefined(this.parent.editorHeaderTemplate)&&(this.element.querySelector(".e-title-text").innerHTML=this.l10n.getConstant("newEvent")),e.Timezone=!1,this.repeatStartDate=e[this.fields.startTime],this.repeatRule="",t.isNullOrUndefined(this.parent.eventSettings.fields.subject.default)||(e[this.fields.subject]=this.parent.eventSettings.fields.subject.default),t.isNullOrUndefined(this.parent.eventSettings.fields.location.default)||(e[this.fields.location]=this.parent.eventSettings.fields.location.default),t.isNullOrUndefined(this.parent.eventSettings.fields.description.default)||(e[this.fields.description]=this.parent.eventSettings.fields.description.default),this.showDetails(e),e[this.fields.recurrenceRule]&&this.recurrenceEditor&&(this.recurrenceEditor.setRecurrenceRule(e[this.fields.recurrenceRule],e[this.fields.startTime]),this.repeatRule=e[this.fields.recurrenceRule]);var n=this.element.querySelector(".e-event-delete");if(n&&t.addClass([n],"e-disable"),this.recurrenceEditor&&(this.recurrenceEditor.setProperties({startDate:e[this.fields.startTime],selectedType:t.isNullOrUndefined(i)?t.isNullOrUndefined(e[this.fields.recurrenceRule])?0:this.recurrenceEditor.selectedType:i}),this.repeatRule=this.recurrenceEditor.value),this.parent.isAdaptive&&t.isNullOrUndefined(this.parent.editorTemplate)){var r=this.element.querySelector(".e-recurrence-container");e[this.fields.recurrenceRule]||i?(t.removeClass([r],"e-hide"),this.repeatStatus.setProperties({checked:!0})):(t.addClass([r],"e-hide"),this.repeatStatus.setProperties({checked:!1})),this.updateRepeatLabel(this.repeatRule)}else{var a=this.element.querySelector(".e-event-save");this.disableButton(a,!1)}this.dialogObject.show()}},e.prototype.convertToEventData=function(e,t){e&&(e.subject&&(t[this.fields.subject]=e.subject),t[this.fields.startTime]=e.startTime,t[this.fields.endTime]=e.endTime,t[this.fields.isAllDay]=e.isAllDay,e.RecurrenceRule&&(t[this.fields.recurrenceRule]=e.RecurrenceRule),(this.parent.resourceCollection.length>0||this.parent.activeViewOptions.group.resources.length>0)&&this.parent.resourceBase.setResourceValues(t))},e.prototype.applyFormValidation=function(){var e=this.element.querySelector("."+ot);if(e){var i=function(e){return e&&Object.keys(e).length>0?e:void 0},n={},r=i(this.parent.eventSettings.fields.subject.validation);t.isNullOrUndefined(r)||(n[this.parent.eventSettings.fields.subject.name]=r);var a=i(this.parent.eventSettings.fields.location.validation);t.isNullOrUndefined(a)||(n[this.parent.eventSettings.fields.location.name]=a);var s=i(this.parent.eventSettings.fields.startTime.validation);t.isNullOrUndefined(s)||(n[this.parent.eventSettings.fields.startTime.name]=s);var o=i(this.parent.eventSettings.fields.endTime.validation);t.isNullOrUndefined(o)||(n[this.parent.eventSettings.fields.endTime.name]=o);var l=i(this.parent.eventSettings.fields.description.validation);t.isNullOrUndefined(l)||(n[this.parent.eventSettings.fields.description.name]=l),this.fieldValidator&&(this.fieldValidator.destroy(),this.fieldValidator=null),this.fieldValidator=new _t,this.fieldValidator.renderFormValidator(e,n,this.element,this.parent.locale)}},e.prototype.showDetails=function(e){this.eventData=e;var i=t.extend({},e,null,!0),n=this.getFormElements("e-schedule-dialog");this.cellClickAction&&(!this.cellClickAction||t.isNullOrUndefined(this.parent.editorTemplate))||0!==i[this.fields.endTime].getHours()||0!==i[this.fields.endTime].getMinutes()||this.trimAllDay(i);for(var r=Object.keys(i),a=0,s=n;a<s.length;a++){var o=s[a],l=o.name||this.getColumnName(o);t.isNullOrUndefined(l)||""===l||(-1!==r.indexOf(l)?this.setValueToElement(o,i[""+l]):this.setDefaultValueToElement(o))}if(t.isNullOrUndefined(this.parent.editorTemplate)){this.onAllDayChange(i[this.fields.isAllDay]);var p=this.getInstance("e-time-zone.e-field");t.isNullOrUndefined(i[this.fields.startTimezone])&&t.isNullOrUndefined(i[this.fields.endTimezone])||(p.checked=!0,p.dataBind()),this.timezoneChangeStyle(p.checked),delete i.Timezone}},e.prototype.getColumnName=function(e){var i=e.getAttribute("data-name")||"";if(""===i){var n=!1,r="";e.classList.contains("e-dropdownlist")?(r="e-ddl",n=!0):e.classList.contains("e-multiselect")?(r="e-multiselect",n=!0):e.classList.contains("e-datetimepicker")?r="e-datetimepicker":e.classList.contains("e-datepicker")?r="e-datepicker":e.classList.contains("e-checkbox")?r="e-checkbox":e.classList.contains("e-numerictextbox")&&(r="e-numerictextbox");var a=n?"."+r+":not(.e-control)":"."+r,s=t.closest(e,a)||e.querySelector("."+r);if(s){var o=s.querySelector("[name]");o&&(i=o.name)}}return i},e.prototype.onAllDayChange=function(e){var i,n=this.getInstance("e-start"),r=this.getInstance("e-end"),a=this.element.querySelector(".e-time-zone-container");e?(i=t.isNullOrUndefined(this.parent.dateFormat)?this.getFormat("dateFormats"):this.parent.dateFormat,t.addClass(this.element.querySelectorAll(".e-time-icon"),"e-icon-disable"),t.addClass([a],"e-disable"),this.element.querySelector(".e-time-zone-row")&&t.removeClass([this.element.querySelector(".e-time-zone-row")],"e-enable"),n.format=r.format=i):(i=t.isNullOrUndefined(this.parent.dateFormat)?this.getFormat("dateFormats")+" "+this.parent.activeViewOptions.timeFormat:this.parent.dateFormat+" "+this.parent.activeViewOptions.timeFormat,t.removeClass(this.element.querySelectorAll(".e-time-icon"),"e-icon-disable"),t.removeClass([a],"e-disable"),this.element.querySelector(".e-checkbox-wrapper .e-time-zone").checked&&t.addClass([this.element.querySelector(".e-time-zone-row")],"e-enable"),n.format=r.format=i),this.cellClickAction&&this.updateDateTime(e,n,r),n.dataBind(),r.dataBind(),t.isNullOrUndefined(this.recurrenceEditor)||this.recurrenceEditor.updateRuleUntilDate(n.value)},e.prototype.updateDateTime=function(e,i,n){var r,a;if(!t.isNullOrUndefined(this.eventWindowTime.startTime)||!t.isNullOrUndefined(this.eventWindowTime.endTime)){if(e)if(r=b(new Date(this.eventWindowTime.startTime.getTime())),this.parent.activeCellsData.isAllDay){var s=O(new Date(this.eventWindowTime.endTime.getTime()),-1).getTime();a=+this.eventWindowTime.startTime>s?this.eventWindowTime.endTime:new Date(s)}else a=b(new Date(this.eventWindowTime.endTime.getTime()));else{var o=this.parent.activeCellsData.startTime;if((r=new Date(this.eventWindowTime.startTime.getTime())).setHours(o.getHours(),o.getMinutes(),o.getSeconds()),this.parent.activeCellsData.isAllDay){var l=this.parent.getStartEndTime(this.parent.workHours.start);r.setHours(l.getHours(),l.getMinutes(),l.getSeconds()),(a=new Date(r.getTime())).setMilliseconds(Ke*this.getSlotDuration())}else(a=new Date(r.getTime())).setMilliseconds(this.parent.activeCellsData.endTime.getTime()-this.parent.activeCellsData.startTime.getTime())}this.eventWindowTime={startTime:new Date(r.getTime()),endTime:new Date(a.getTime())},i.value=r,n.value=a,i.dataBind(),n.dataBind()}},e.prototype.getFormat=function(e){return t.isNullOrUndefined(this.parent.locale)||"en"===this.parent.locale||"en-US"===this.parent.locale?t.getValue(e+".short",t.getDefaultDateObject(this.parent.getCalendarMode())):t.getValue("main."+this.parent.locale+".dates.calendars."+this.parent.getCalendarMode()+"."+e+".short",t.cldrData)},e.prototype.onEventDetailsUpdate=function(e){if(this.parent.eventSettings.allowEditing){if(!this.parent.isAdaptive&&t.isNullOrUndefined(this.parent.editorFooterTemplate)&&t.removeClass([this.element.querySelector(".e-event-delete")],"e-disable"),t.isNullOrUndefined(this.parent.editorHeaderTemplate)&&(this.element.querySelector(".e-title-text").innerHTML=this.l10n.getConstant("editEvent")),this.element.querySelector("."+ot).setAttribute("data-id",e[this.fields.id].toString()),t.isNullOrUndefined(this.parent.editorTemplate)){e=t.extend({},e,null,!0);var i=this.getInstance("e-time-zone.e-field"),n=void 0;e[this.fields.startTimezone]||e[this.fields.endTimezone]?(n=!0,this.parent.eventBase.timezoneConvert(e)):n=!1,e.Timezone=n,i.checked=n,i.dataBind()}if(this.showDetails(e),e[this.fields.recurrenceRule]&&this.recurrenceEditor?this.recurrenceEditor.setRecurrenceRule(e[this.fields.recurrenceRule],e[this.fields.startTime]):!this.parent.isAdaptive&&this.recurrenceEditor&&(this.recurrenceEditor.setProperties({startDate:e[this.fields.startTime]}),this.recurrenceEditor.setRecurrenceRule("")),this.repeatStartDate=e[this.fields.startTime],this.repeatRule="",e[this.fields.recurrenceRule]&&(this.recurrenceEditor&&this.recurrenceEditor.setRecurrenceRule(e[this.fields.recurrenceRule],e[this.fields.startTime]),this.repeatRule=e[this.fields.recurrenceRule]),this.parent.isAdaptive&&t.isNullOrUndefined(this.parent.editorTemplate)){var r=this.element.querySelector(".e-recurrence-container");e[this.fields.recurrenceRule]?(t.removeClass([r],"e-hide"),this.repeatStatus.setProperties({checked:!0})):(t.addClass([r],"e-hide"),this.repeatStatus.setProperties({checked:!1})),this.updateRepeatLabel(this.repeatRule)}var a=this.parent.readonly||e[this.fields.isReadonly];if(this.parent.isAdaptive){var s=this.element.querySelector(".e-save-icon");s&&(a?t.addClass([s],"e-icon-disable"):t.removeClass([s],"e-icon-disable"))}else{var o=this.element.querySelector(".e-event-save"),l=this.element.querySelector(".e-event-delete");this.disableButton(o,a),this.disableButton(l,a)}this.dialogObject.show()}},e.prototype.disableButton=function(e,t){e&&(e.ej2_instances[0].disabled=t)},e.prototype.renderRecurrenceEditor=function(){return new di({calendarMode:this.parent.calendarMode,cssClass:this.parent.cssClass,dateFormat:this.parent.dateFormat,enableRtl:this.parent.enableRtl,firstDayOfWeek:this.parent.activeViewOptions.firstDayOfWeek,locale:this.parent.locale})},e.prototype.updateMinMaxDateToEditor=function(){var e=this.element.querySelector(".e-start"),t=this.element.querySelector(".e-end");if(e&&t){var i=e.ej2_instances[0],n=t.ej2_instances[0];i.min=this.parent.minDate,i.max=new Date(new Date(+this.parent.maxDate).setHours(23,59,59)),n.min=this.parent.minDate,n.max=new Date(new Date(+this.parent.maxDate).setHours(23,59,59)),i.dataBind(),n.dataBind()}if(this.recurrenceEditor){var r=this.recurrenceEditor.element.querySelector(".e-until-date");if(r){var a=r.ej2_instances[0];a.min=this.parent.minDate,a.max=this.parent.maxDate,a.dataBind()}}},e.prototype.updateRepeatLabel=function(e){this.parent.isAdaptive&&!this.repeatDialogObject&&this.renderRepeatDialog();var t=e?this.l10n.getConstant("repeats")+" "+this.recurrenceEditor.getRuleSummary(e):this.l10n.getConstant("repeat");this.repeatStatus.setProperties({label:t})},e.prototype.dialogClose=function(e){if(this.isEnterKey)return void(this.isEnterKey=!1);this.dialogEvent=e,this.isCrudAction=!1,this.parent.activeEventData={event:void 0,element:void 0},this.parent.currentAction=null,this.dialogObject.hide()},e.prototype.resetForm=function(){this.fieldValidator.destroyToolTip(),this.resetFormFields(),this.parent.isAdaptive||!this.recurrenceEditor||this.recurrenceEditor.isDestroyed||this.recurrenceEditor.resetFields()},e.prototype.timezoneChangeStyle=function(e){var i=this.element.querySelector(".e-time-zone-row"),n=this.parent.tzModule.getLocalTimezoneName();if(e){t.addClass([i],"e-enable");var r=this.getInstance("e-start-time-zone"),a=this.getInstance("e-end-time-zone"),s=r.dataSource;r.value&&this.parent.timezone||s.some(function(e){return e.Value===n})||(s.push({Value:n,Text:n}),r.dataSource=s,a.dataSource=s,r.dataBind(),a.dataBind()),r.value=r.value||this.parent.timezone||n,a.value=a.value||this.parent.timezone||n,r.dataBind(),a.dataBind()}else t.removeClass([i],"e-enable")},e.prototype.resetFormFields=function(){for(var e=0,i=this.getFormElements("e-schedule-dialog");e<i.length;e++){var n=i[e],r=n.name||this.getColumnName(n);t.isNullOrUndefined(r)||""===r||this.setDefaultValueToElement(n)}},e.prototype.eventSave=function(e,t){if(this.isEnterKey)return void(this.isEnterKey=!1);var i=this.element.querySelector("."+ot);if(!i||!i.classList.contains("e-formvalidator")||i.ej2_instances[0].validate()){var n=this.getEventDataFromEditor();this.processEventValidation(n.tempData,t)||(this.eventCrudData=n.eventData,this.dialogEvent=e,this.isCrudAction=!0,this.dialogObject.hide())}},e.prototype.getEventDataFromEditor=function(){var e=t.extend({},this.getObjectFromFormData("e-schedule-dialog"));e.Timezone||(e[this.fields.startTimezone]=null,e[this.fields.endTimezone]=null),delete e.Timezone,delete e.Repeat,this.setDefaultValueToObject(e),e[this.fields.recurrenceRule]=this.recurrenceEditor?this.recurrenceEditor.getRecurrenceRule()||null:void 0;var i=t.extend({},e,null,!0);return e[this.fields.isAllDay]&&(e[this.fields.startTime]=t.isNullOrUndefined(e[this.fields.startTime])?null:b(new Date(e[this.fields.startTime].getTime())),e[this.fields.endTime]=t.isNullOrUndefined(e[this.fields.endTime])?null:O(b(new Date(e[this.fields.endTime].getTime())),1)),{eventData:e,tempData:i}},e.prototype.processEventValidation=function(e,i){var n;if(t.isNullOrUndefined(this.parent.editorTemplate)){if(!e[this.fields.startTime]||!e[this.fields.endTime])return this.parent.quickPopup.openValidationError("invalidDateError"),!0;if(e[this.fields.startTime]>e[this.fields.endTime])return this.parent.quickPopup.openValidationError("startEndError"),!0}if(this.recurrenceEditor&&this.recurrenceEditor.value&&""!==this.recurrenceEditor.value){"EditOccurrence"!==this.parent.currentAction&&(n=this.recurrenceValidation(e[this.fields.startTime],e[this.fields.endTime],i));var r=!0;if("seriesChangeAlert"===n&&this.parent.uiStateValues.isIgnoreOccurrence&&(r=!1),!t.isNullOrUndefined(n)&&r&&(!this.parent.enableRecurrenceValidation&&"wrongPattern"===n||this.parent.enableRecurrenceValidation))return this.parent.quickPopup.openRecurrenceValidationAlert(n),!0}return!1},e.prototype.processCrudActions=function(e){var i=this;this.parent.uiStateValues.isBlock=!1;var n=this.getResourceData(e),r=(this.parent.activeViewOptions.group.resources.length>0||this.parent.resourceCollection.length>0)&&!this.parent.activeViewOptions.group.allowGroupEdit&&!t.isNullOrUndefined(n),a=this.getEventIdFromForm();if(t.isNullOrUndefined(a)){if(this.parent.currentAction="Add",this.parent.eventBase.checkOverlap(e))return!0;r?this.resourceSaveEvent(e,this.parent.currentAction):(e[this.fields.id]=this.parent.eventBase.getEventMaxID(),this.parent.addEvent(e))}else{var s="string"===this.parent.eventBase.getEventIDType()?a:parseInt(a,10),o=this.parent.eventsData.filter(function(e){return e[i.fields.id]===s})[0];if(t.isNullOrUndefined(o)&&(o=this.parent.blockData.filter(function(e){return e[i.fields.id]===s})[0]),(e=t.extend({},o,e))[this.fields.isReadonly])return!1;if(this.parent.eventBase.checkOverlap(e))return!0;var l=void 0;if(!t.isNullOrUndefined(o[this.fields.recurrenceRule])){if(l=this.parent.currentAction,e.Guid=this.parent.activeEventData.event.Guid,"EditOccurrence"===this.parent.currentAction&&(e[this.fields.recurrenceID]?(s=e[this.fields.recurrenceID],l=null):(e[this.fields.id]=this.parent.eventBase.getEventMaxID(),e.Guid=this.parent.activeEventData.event.Guid),this.parent.enableRecurrenceValidation&&this.editOccurrenceValidation(s,e)))return!0;"EditSeries"===this.parent.currentAction||e[this.fields.id]!==o[this.fields.id]?e[this.fields.recurrenceID]=o[this.fields.id]:"EditFollowingEvents"===this.parent.currentAction&&(e[this.fields.id]=this.parent.eventBase.getEventMaxID(),e[this.fields.followingID]=o[this.fields.id])}r?this.resourceSaveEvent(e,"Save",l):this.parent.saveEvent(e,l)}return this.parent.uiStateValues.isBlock},e.prototype.getResourceData=function(e){var i=null;return!t.isNullOrUndefined(this.parent.resourceBase)&&!t.isNullOrUndefined(this.parent.resourceBase.resourceCollection)&&this.parent.resourceBase.resourceCollection.length>0&&(i=e[this.parent.resourceBase.resourceCollection.slice(-1)[0].field]),i},e.prototype.getObjectFromFormData=function(e){for(var i={},n=0,r=this.getFormElements(e);n<r.length;n++){var a=r[n],s=a.name||this.getColumnName(a);t.isNullOrUndefined(s)||""===s||(i[""+s]=this.getValueFromElement(a))}return i},e.prototype.setDefaultValueToObject=function(e){t.isNullOrUndefined(e[this.fields.subject])||(e[this.fields.subject]=e[this.fields.subject]||this.parent.eventSettings.fields.subject.default||this.l10n.getConstant("addTitle")),t.isNullOrUndefined(e[this.fields.location])||(e[this.fields.location]=e[this.fields.location]||this.parent.eventSettings.fields.location.default),t.isNullOrUndefined(e[this.fields.description])||(e[this.fields.description]=e[this.fields.description]||this.parent.eventSettings.fields.description.default)},e.prototype.recurrenceValidation=function(e,i,n){var r,a=this.recurrenceEditor,s=this.getInstance("e-repeat-interval.e-numerictextbox").value;if(n!==this.l10n.getConstant("ok")){var o=this.parent.activeEventData.event,l=[];if(("EditSeries"===this.parent.currentAction||"EditFollowingEvents"===this.parent.currentAction)&&!t.isNullOrUndefined(o)){var p=o[this.parent.eventFields.startTime],c=this.parent.eventBase.getSeriesEvents(this.eventData,p);if(c.length>0)l=this.parent.eventBase.getEditedOccurrences(c,p);else{var h=this.parent.eventBase.getEventById(o[this.parent.eventFields.id]);l=this.parent.eventBase.getEditedOccurrences([h],p)}"EditSeries"!==this.parent.currentAction||t.isNullOrUndefined(this.eventData[this.parent.eventFields.recurrenceException])||l.push(this.eventData)}if(l.length>0&&(r="seriesChangeAlert"),"until"===this.getInstance("e-end-on-left .e-ddl .e-dropdownlist").value&&this.getInstance("e-end-on-date .e-datepicker").value<e&&(r="wrongPattern"),t.isNullOrUndefined(r)){var d=a.value.split(";")[1].split("=")[1].split(","),u={SU:0,MO:1,TU:2,WE:3,TH:4,FR:5,SA:6},g=[],v=[],m=void 0;switch(a.value.split(";")[0].split("=")[1]){case"DAILY":(i.getTime()-e.getTime())/36e5>24*s&&(r="createError");break;case"WEEKLY":d=a.value.split(";")[1].split("=")[1].split(",");for(f=0;f<d.length*(s+1);f++)g[parseInt(f.toString(),10)]=d.length>f?u[d[parseInt(f.toString(),10)]]:g[f-d.length]+7*s;m=g.sort(function(e,t){return e-t});for(var f=1;f<m.length;f++)v.push(m[parseInt(f.toString(),10)]-m[f-1]);((i.getTime()-e.getTime())/36e5>=24*Math.min.apply(Math,v)||t.isNullOrUndefined(s))&&(r="createError");break;case"MONTHLY":i.getTime()>=new Date(+e).setMonth(e.getMonth()+s)&&(r="createError");break;case"YEARLY":i.getTime()>=new Date(+e).setFullYear(e.getFullYear()+s)&&(r="createError")}}}else i.getTime()>=new Date(+e).setMonth(e.getMonth()+s)&&(r="createError"),t.isNullOrUndefined(r)&&this.parent.quickPopup.quickDialog.hide();return t.isNullOrUndefined(s)&&(r="createError"),r},e.prototype.getRecurrenceIndex=function(e,t){for(var i,n=0;n<e.length;n++)if(t[this.fields.startTime].valueOf()===e[parseInt(n.toString(),10)][this.fields.startTime].valueOf()){i=n;break}return i},e.prototype.trimAllDay=function(e){if(e[this.fields.isAllDay]){var t=O(new Date(+e[this.fields.endTime]),-1).getTime();e[this.fields.endTime]=+e[this.fields.startTime]>t?e[this.fields.endTime]:new Date(t)}},e.prototype.editOccurrenceValidation=function(e,i,n){var r=this;void 0===n&&(n=this.eventData);var a=this.parent.getOccurrencesByID(e);this.parent.eventsData.filter(function(t){return t[r.fields.recurrenceID]===e}).map(function(e){return a.push(t.extend({},e))}),i=t.extend({},i),this.trimAllDay(i);for(var s=0,o=a;s<o.length;s++){var l=o[s];this.trimAllDay(l)}this.parent.eventBase.sortByTime(a);var p=this.getRecurrenceIndex(a,n);if(t.isNullOrUndefined(p))return!1;var c,h,d=new Date(+i[this.fields.startTime]),u=new Date(+i[this.fields.endTime]);p!==a.length-1&&(c=new Date(+a[p+1][this.fields.startTime]),h=new Date(+a[p+1][this.fields.endTime]));var g=new Date(+a[a.length-1][this.fields.endTime]);if(0===p){if(!t.isNullOrUndefined(a[p+1])){if(!(c.getTime()>=u.getTime())&&b(g).getTime()>=b(d).getTime()||b(g).getTime()<b(d).getTime())return this.parent.quickPopup.openRecurrenceValidationAlert("occurrenceAlert"),!0;if(!(b(d).getTime()<b(c).getTime()))return this.parent.quickPopup.openRecurrenceValidationAlert("sameDayAlert"),!0}return!1}var v=new Date(+a[p-1][this.fields.startTime]),m=new Date(+a[p-1][this.fields.endTime]);if(p===a.length-1){if(b(new Date(+a[a.length-1-p][this.fields.startTime])).getTime()>b(d).getTime())return this.parent.quickPopup.openRecurrenceValidationAlert("occurrenceAlert"),!0;if(!(m.getTime()<=d.getTime()&&b(d).getTime()>b(v).getTime()))return this.parent.quickPopup.openRecurrenceValidationAlert("sameDayAlert"),!0}else{if(!(b(v).getTime()<b(d).getTime()||b(new Date(+a[0][this.fields.startTime])).getTime()>b(d).getTime())||!(b(c).getTime()>b(d).getTime()||g.getTime()<d.getTime()))return this.parent.quickPopup.openRecurrenceValidationAlert("sameDayAlert"),!0;if(!(m.getTime()<=d.getTime()&&c.getTime()>=u.getTime())||b(h).getTime()<b(d).getTime()||b(v).getTime()>b(u).getTime()||!(b(d).getTime()<b(c).getTime()))return this.parent.quickPopup.openRecurrenceValidationAlert("occurrenceAlert"),!0}return!1},e.prototype.resourceSaveEvent=function(e,i,n){var r=this,a=this.parent.resourceBase.resourceCollection.slice(-1)[0],s=e[a.field];s=s instanceof Array?s.reverse():[s].reverse();for(var o=this.parent.resourceBase.lastResourceLevel,l=[],p=this,c=0;c<s.length;c++){var h=function(c){var h=t.extend({},e,null,!0);h[p.fields.id]=p.parent.eventBase.getEventMaxID();var d=[],u=function(){if("Save"===i&&c===s.length-1)if(d.length>0){d[0][r.fields.id]=e[r.fields.id];for(var t=1;t<d.length;t++)d[parseInt(t.toString(),10)][r.fields.id]=r.parent.eventBase.getEventMaxID(c),l.push(d[parseInt(t.toString(),10)]),r.parent.saveEvent(d[0],n)}else h[r.fields.id]=e[r.fields.id],r.parent.saveEvent(h,n);else if(d.length>0)for(var a=0;a<d.length;a++)d[parseInt(a.toString(),10)][r.fields.id]=r.parent.eventBase.getEventMaxID(a),l.push(d[parseInt(a.toString(),10)]);else h[r.fields.id]=r.parent.eventBase.getEventMaxID(c),l.push(h)};if(p.parent.activeViewOptions.group.byGroupID&&!t.isNullOrUndefined(o)){var g=a.dataSource,v=p.parent.resourceCollection,m=void 0;if((m=v.length>1?H(g,a.idField,s[parseInt(c.toString(),10)],h,v):H(g,a.idField,s[parseInt(c.toString(),10)]))<0)return{value:void 0};for(var f=g[parseInt(m.toString(),10)][a.groupIDField],y=o.filter(function(e){return e.resourceData[a.idField]===s[parseInt(c.toString(),10)]}).filter(function(e){return e.resourceData[a.groupIDField]===f})[0].groupOrder,T=0;T<p.parent.resourceBase.resourceCollection.length;T++){w=p.parent.resourceBase.resourceCollection[parseInt(T.toString(),10)].field;h[""+w]=y[parseInt(T.toString(),10)]instanceof Array?y[parseInt(T.toString(),10)][0]:y[parseInt(T.toString(),10)]}u()}else{for(m=0;m<p.parent.resourceBase.resourceCollection.length-1;m++){var w=p.parent.resourceBase.resourceCollection[parseInt(m.toString(),10)].field;if(h[""+w]instanceof Array&&h[""+w].length>1)for(var D=0;D<h[""+w].length;D++){var b=t.extend({},h,null,!0);b[""+w]=e[""+w][parseInt(D.toString(),10)],b[a.field]=s[parseInt(c.toString(),10)],d.push(b)}else if(0===d.length)h[""+w]=e[""+w]instanceof Array?e[""+w][0]:e[""+w],h[a.field]=s[parseInt(c.toString(),10)];else for(var C=0;C<d.length;C++)d[parseInt(C.toString(),10)][""+w]=e[""+w]instanceof Array?e[""+w][0]:e[""+w]}h[a.field]=s[parseInt(c.toString(),10)],u()}}(c);if("object"==typeof h)return h.value}if(l.length>0){for(var d=0,u=l;d<u.length;d++){var g=u[d];g[this.fields.recurrenceException]=null,g[this.fields.recurrenceID]=null}this.parent.addEvent(l)}},e.prototype.getEventIdFromForm=function(){return this.element.querySelector("."+ot).getAttribute("data-id")},e.prototype.getFormElements=function(e){return"e-schedule-dialog"===e?[].slice.call(this.element.querySelectorAll(".e-field")):[].slice.call(this.parent.element.querySelectorAll("."+e+" .e-field"))},e.prototype.getValueFromElement=function(e){return e.classList.contains("e-datepicker")?e.ej2_instances[0].value:e.classList.contains("e-datetimepicker")?e.ej2_instances[0].value:e.classList.contains("e-dropdownlist")?e.ej2_instances[0].value:e.classList.contains("e-multiselect")?e.ej2_instances[0].value:e.classList.contains("e-checkbox")?e.ej2_instances[0].checked:e.classList.contains("e-numerictextbox")?e.ej2_instances[0].value:"checkbox"===e.type?e.checked:this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(e.value):e.value},e.prototype.setValueToElement=function(e,t){if(e.classList.contains("e-datepicker"))(i=e.ej2_instances[0]).value=t,i.dataBind();else if(e.classList.contains("e-datetimepicker"))(i=e.ej2_instances[0]).element.classList.contains("e-start")?this.eventWindowTime.startTime=new Date(""+t):this.eventWindowTime.endTime=new Date(""+t),i.value=t,i.dataBind();else if(e.classList.contains("e-dropdownlist"))(i=e.ej2_instances[0]).value=t,i.dataBind();else if(e.classList.contains("e-multiselect"))(i=e.ej2_instances[0]).value=[],i.value=t instanceof Array?t:[t],i.dataBind();else if(e.classList.contains("e-checkbox"))(i=e.ej2_instances[0]).checked=t,i.dataBind();else if(e.classList.contains("e-numerictextbox")){var i=e.ej2_instances[0];i.value=t,i.dataBind()}else"checkbox"!==e.type?e.value=t||"":e.checked=t},e.prototype.setDefaultValueToElement=function(e){if(e.classList.contains("e-datepicker"))(t=e.ej2_instances[0]).value=this.parent.getCurrentTime(),t.dataBind();else if(e.classList.contains("e-datetimepicker")){var t=e.ej2_instances[0],i=this.parent.getCurrentTime();this.eventWindowTime={startTime:i,endTime:i},t.value=i,t.dataBind()}else e.classList.contains("e-dropdownlist")?((t=e.ej2_instances[0]).value=null,t.dataBind()):e.classList.contains("e-multiselect")?((t=e.ej2_instances[0]).value=[],t.dataBind()):e.classList.contains("e-checkbox")?((t=e.ej2_instances[0]).checked=!1,t.dataBind()):e.classList.contains("e-numerictextbox")?((t=e.ej2_instances[0]).value=null,t.dataBind()):"checkbox"===e.type?e.checked=!1:e.value=""},e.prototype.getInstance=function(e){var t=this.element.querySelector("."+e);return t?t.ej2_instances[0]:null},e.prototype.eventDelete=function(e){if(this.isEnterKey)return void(this.isEnterKey=!1);switch(this.parent.currentAction){case"EditOccurrence":t.isNullOrUndefined(this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule])?this.parent.currentAction="Delete":this.parent.currentAction="DeleteOccurrence";break;case"EditSeries":this.parent.currentAction="DeleteSeries";break;case"Save":this.parent.currentAction="Delete";break;case"EditFollowingEvents":t.isNullOrUndefined(this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule])||(this.parent.currentAction="DeleteFollowingEvents")}this.dialogEvent=e,this.isCrudAction=!1,this.dialogObject.hide(),this.parent.quickPopup.openDeleteAlert()},e.prototype.getRecurrenceEditorInstance=function(){return this.parent.isAdaptive&&!this.repeatDialogObject&&this.renderRepeatDialog(),this.recurrenceEditor},e.prototype.destroyComponents=function(){for(var e=0,t=this.getFormElements("e-schedule-dialog");e<t.length;e++){var i=t[e],n=void 0;i.classList.contains("e-datetimepicker")?n=i.ej2_instances:i.classList.contains("e-datepicker")?n=i.ej2_instances:i.classList.contains("e-checkbox")?n=i.ej2_instances:i.classList.contains("e-dropdownlist")?n=i.ej2_instances:i.classList.contains("e-multiselect")?n=i.ej2_instances:i.classList.contains("e-numerictextbox")&&(n=i.ej2_instances),n&&n[0]&&n[0].destroy()}this.buttonObj&&this.buttonObj.destroy()},e.prototype.detachComponents=function(){for(var e=0,i=this.getFormElements("e-schedule-dialog");e<i.length;e++){var n=i[e];t.detach(n)}},e.prototype.destroy=function(e){if(this.parent&&!this.parent.isDestroyed&&this.parent.resetTemplates(["editorTemplate","editorHeaderTemplate","editorFooterTemplate"]),this.destroyComponents(),this.recurrenceEditor&&(this.recurrenceEditor.destroy(),t.detach(this.recurrenceEditor.element),this.recurrenceEditor=null),this.fieldValidator&&(this.fieldValidator.destroy(),this.fieldValidator=null),this.repeatDialogObject&&(this.repeatDialogObject.destroy(),this.repeatDialogObject=null),this.detachComponents(),this.dialogObject){if(this.dialogObject.element){var i=this.dialogObject.element.querySelector("form");j(i),t.detach(i),t.EventHandler.remove(this.dialogObject.element,"keydown",this.preventEventSave)}this.dialogObject.destroy(),this.dialogObject=null}this.element&&(t.remove(this.element),this.element=null),e||(this.l10n=null,this.parent=null,this.fields=null,this.buttonObj=null,this.repeatStatus=null,this.eventWindowTime=null,this.dialogEvent=null)},e}(),gi=function(){function e(e){this.translateY=0,this.itemSize=60,this.renderedLength=0,this.averageRowHeight=0,this.startIndex=0,this.existingDataCollection=[],this.enableTransition=!0,this.parent=e,this.bufferCount=e.activeViewOptions.overscanCount<3?3:e.activeViewOptions.overscanCount,this.addEventListener()}return e.prototype.addEventListener=function(){!this.parent||this.parent&&this.parent.isDestroyed||this.parent.on("virtual-scroll",this.virtualScrolling,this)},e.prototype.removeEventListener=function(){!this.parent||this.parent&&this.parent.isDestroyed||this.parent.off("virtual-scroll",this.virtualScrolling)},e.prototype.getRenderedCount=function(){this.setItemSize();var e=this.isHorizontalScroll?this.parent.element.clientWidth:this.parent.element.clientHeight;return this.renderedLength=Math.ceil(e/this.itemSize)+this.bufferCount,this.renderedLength},e.prototype.renderVirtualTrack=function(e){var i=t.createElement("div",{className:"e-virtual-track"});if(this.isHorizontalScroll){var n=this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-1].length;i.style.width=n*this.itemSize+"px"}else i.style.height=this.parent.resourceBase.expandedResources.length*this.itemSize+"px";e.appendChild(i)},e.prototype.updateVirtualScrollHeight=function(){var e=this.parent.element.querySelector(".e-virtual-track"),t=this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].groupIndex;if(this.parent.resourceBase.renderedResources[this.parent.resourceBase.renderedResources.length-1].groupIndex!==t){var i=this.parent.element.querySelector("."+nt);this.renderedLength=i.querySelector("tbody").children.length,e.style.height=i.offsetHeight+(this.parent.resourceBase.expandedResources.length-this.renderedLength)*i.offsetHeight/this.renderedLength+"px";var n=this.parent.element.querySelector(".e-content-wrap");3===this.bufferCount&&n.scrollHeight-n.scrollTop<n.offsetHeight*this.bufferCount&&(e.style.height=parseInt(e.style.height,10)+n.offsetHeight*this.bufferCount+"px")}else e.style.height="";this.averageRowHeight=e.offsetHeight/this.parent.resourceBase.expandedResources.length},e.prototype.updateVirtualTrackHeight=function(e){var t=this.parent.resourceBase.renderedResources.length;if(t!==this.getRenderedCount()){e.style.height=this.parent.element.querySelector(".e-content-wrap").clientHeight+"px";var i=this.parent.element.querySelector(".e-resource-column-wrap"),n=this.parent.element.querySelector(".e-content-wrap"),r=this.parent.element.querySelector(".e-event-table");this.translateY=0,this.setTranslate(i,n,r)}else{var a=this.parent.resourceBase.renderedResources[t-1].groupIndex,s=t+(this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].groupIndex-a);s=s>this.parent.resourceBase.expandedResources.length?this.parent.resourceBase.expandedResources.length:s,e.style.height=s*this.itemSize+"px"}},e.prototype.setItemSize=function(){if(this.isHorizontalScroll)if(this.parent.group.byDate){var e=this.parent.element.querySelector(".e-date-header-wrap table col");this.itemSize=e?B(e,this.parent.uiStateValues.isTransformed):this.itemSize}else this.itemSize=d(this.parent.activeView.element,"e-work-cells",this.parent.uiStateValues.isTransformed)||this.itemSize;else this.itemSize=this.parent.getElementHeightFromClass(this.parent.activeView.element,"e-work-cells")||this.itemSize},e.prototype.refreshLayout=function(){var e=this.parent.uiStateValues.scheduleHeight;this.parent.uiStateValues.scheduleHeight=this.parent.element.offsetHeight;var i=this.renderedLength;if(this.parent.uiStateValues.scheduleHeight!==e){i<this.getRenderedCount()&&(this.isRemoteRefresh=!0);var n=this.parent.element.querySelector(".e-resource-column-wrap"),r=this.parent.element.querySelector(".e-content-wrap"),a=this.parent.element.querySelector(".e-event-table");this.parent.rowAutoHeight||(this.enableTransition=!1,t.removeClass([r,n],"e-transition"));var s=parseInt(n.querySelector("tbody td").getAttribute("data-group-index"),10),o=s+this.renderedLength;s=(s=o>this.parent.resourceBase.expandedResources.length?this.parent.resourceBase.expandedResources.length-this.renderedLength:s)<0?0:s,this.existingDataCollection=this.parent.resourceBase.renderedResources,this.parent.resourceBase.renderedResources=this.parent.resourceBase.expandedResources.slice(s,o),this.parent.resourceBase.renderedResources.length>0&&this.updateContent(n,r,a,this.parent.resourceBase.renderedResources)}},e.prototype.renderEvents=function(){this.setTabIndex();var e=this.triggerScrollEvent("virtualScrollStop");if(this.parent.activeViewOptions&&this.parent.activeViewOptions.enableLazyLoading&&this.parent.crudModule)return e.length>0?(this.parent.crudModule.refreshProcessedData(!0,e),void this.parent.hideSpinner()):void this.parent.crudModule.refreshDataManager();this.parent.crudModule&&this.parent.crudModule.refreshProcessedData(!0),"Month"!==this.parent.currentView&&this.parent.notify(Ge,{}),this.parent.hideSpinner()},e.prototype.virtualScrolling=function(){var e=this;this.parent.quickPopup&&(this.parent.quickPopup.quickPopupHide(),this.parent.quickPopup.morePopup.hide());var i=this.parent.element.querySelector(".e-content-wrap");if(this.isHorizontalScroll)this.horizontalScrolling(i);else{var n=this.parent.element.querySelector(".e-resource-column-wrap"),r=this.parent.element.querySelector(".e-event-table"),a=this.parent.element.querySelector(".e-current-timeline"),s=this.parent.element.querySelector("."+nt);this.parent.rowAutoHeight||t.addClass([i,n],"e-transition"),this.renderedLength=n.querySelector("tbody").children.length;var o=parseInt(n.querySelector("tbody td").getAttribute("data-group-index"),10),l=this.parent.rowAutoHeight?s.offsetHeight-i.offsetHeight:this.bufferCount*this.itemSize,p=[];if(this.existingDataCollection=this.parent.resourceBase.renderedResources,i.scrollTop-this.translateY<0?p=this.upScroll(i,o):(i.scrollTop+i.clientHeight>=i.scrollHeight-this.itemSize||i.scrollTop>this.translateY+l)&&(p=this.downScroll(i,o)),!t.isNullOrUndefined(p)&&p.length>0){this.triggerScrollEvent("virtualScrollStart");var c=this.parent.getSelectedCells();this.focusedEle=c[c.length-1]||this.focusedEle,this.updateContent(n,i,r,p),this.setTranslate(n,i,r,a),this.parent.dragAndDropModule&&"drag"===this.parent.dragAndDropModule.actionObj.action&&this.parent.dragAndDropModule.navigationWrapper(),window.clearTimeout(this.timeValue),this.timeValue=window.setTimeout(function(){e.renderEvents()},250)}}},e.prototype.horizontalScrolling=function(e){var i=this,n=[],r=this.bufferCount*this.itemSize;if(Math.abs(e.scrollLeft)-Math.abs(this.translateY)<0?n=this.leftScroll(e):Math.abs(e.scrollLeft)-Math.abs(this.translateY)>r&&(n=this.rightScroll(e)),!t.isNullOrUndefined(n)&&n.length>0){if(this.parent.resourceBase.expandedResources.length!==n.length||this.parent.resourceBase.expandedResources[0]!==n[0]||this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1]!==n[n.length-1]){this.triggerScrollEvent("virtualScrollStart");var a=this.parent.activeView.colLevels.slice(0);this.updateHorizontalContent(e,n),t.setStyleAttribute(e.querySelector("table"),{transform:"translateX("+this.translateY+"px)"}),this.parent.activeView.colLevels=a,this.parent.dragAndDropModule&&"drag"===this.parent.dragAndDropModule.actionObj.action&&this.parent.dragAndDropModule.navigationWrapper()}window.clearTimeout(this.timeValue),this.timeValue=window.setTimeout(function(){i.renderEvents()},250)}},e.prototype.triggerScrollEvent=function(e){var i=this,n=[];if(!this.parent.activeView)return n;var r={startDate:this.parent.activeView.startDate(),endDate:this.parent.activeView.endDate(),startIndex:this.parent.resourceBase.renderedResources[0].groupIndex,endIndex:this.parent.resourceBase.renderedResources[this.parent.resourceBase.renderedResources.length-1].groupIndex,resourceData:this.parent.resourceBase.renderedResources.map(function(e){return e.resourceData}),name:e};return this.parent.trigger(e,r,function(r){"virtualScrollStart"===e?i.parent.showSpinner():"virtualScrollStop"===e&&!t.isNullOrUndefined(r.eventData)&&r.eventData.length>0&&(n=r.eventData)}),n},e.prototype.upScroll=function(e,t){var i=0;i=~~(e.scrollTop/this.itemSize)+Math.ceil(e.clientHeight/this.itemSize)-this.renderedLength,this.parent.rowAutoHeight&&(i=i>t?t-this.bufferCount:i),i=i>0?i:0;var n=this.getBufferCollection(i,i+this.renderedLength);if(this.parent.resourceBase.renderedResources=n,0===t)this.translateY=e.scrollTop;else{var r=this.parent.rowAutoHeight?this.averageRowHeight:this.itemSize;r=r>0?r:this.itemSize,this.translateY=e.scrollTop-this.bufferCount*r>0?e.scrollTop-this.bufferCount*r:0,this.parent.rowAutoHeight&&0===this.translateY&&0!==i&&(n=this.getBufferCollection(0,this.renderedLength),this.parent.resourceBase.renderedResources=n)}return n},e.prototype.downScroll=function(e,t){if(this.parent.resourceBase.renderedResources[this.parent.resourceBase.renderedResources.length-1].groupIndex===this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].groupIndex)return null;var i=0;i=~~(e.scrollTop/this.itemSize),this.parent.rowAutoHeight&&(i=(i=~~((e.scrollTop-this.translateY)/this.averageRowHeight)+t)>t+this.bufferCount?i:t+this.bufferCount);var n=i+this.renderedLength;n=n>this.parent.resourceBase.expandedResources.length?i+(this.parent.resourceBase.expandedResources.length-i):n;var r=this.getBufferCollection(n-this.renderedLength,n);return this.translateY=e.scrollTop,r},e.prototype.leftScroll=function(e){var t=0;return t=~~(Math.abs(e.scrollLeft)/this.itemSize)+Math.ceil(e.clientWidth/this.itemSize)-this.renderedLength,t=t>0?t:0,this.getCollection(t,t+this.renderedLength)},e.prototype.rightScroll=function(e){var t=this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-1],i=0,n=(i=~~(Math.abs(e.scrollLeft)/this.itemSize))+this.renderedLength;return n=n>t.length-1?t.length-1:n,this.getCollection(n-this.renderedLength,n)},e.prototype.getCollection=function(e,t){this.translateY=e*this.itemSize,e=e<0?0:e;var i=this.getResCollection(e,t);return this.parent.enableRtl&&(this.translateY=-this.translateY),i},e.prototype.getResCollection=function(e,t){var i=this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-1];t=t>i.length?i.length-1:t;var n=[],r={startIndex:0,endIndex:0};if(this.parent.activeViewOptions.group.byDate){if(i[parseInt(e.toString(),10)].date.getTime()===this.parent.resourceBase.expandedResources[0].date.getTime()&&i[parseInt(t.toString(),10)].date.getTime()===this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].date.getTime())return this.parent.resourceBase.expandedResources;n=this.getByDateCollection(i[parseInt(e.toString(),10)],i[parseInt(t.toString(),10)],r),this.setRenderedDates(n)}else{if(i[parseInt(e.toString(),10)].groupIndex===this.parent.resourceBase.expandedResources[0].groupIndex&&i[parseInt(t.toString(),10)].groupIndex===this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].groupIndex)return this.parent.resourceBase.expandedResources;n=this.getByIdCollection(i[parseInt(e.toString(),10)],i[parseInt(t.toString(),10)],r)}return"Month"!==this.parent.currentView&&(this.startIndex=r.startIndex,n=i.slice(r.startIndex,r.endIndex)),this.translateY=r.startIndex*this.itemSize,n},e.prototype.getByDateCollection=function(e,t,i){var n=this.parent.activeView.colLevels[0].filter(function(i){return e.date.getTime()<=i.date.getTime()&&i.date.getTime()<=t.date.getTime()});return this.setStartEndIndex(this.parent.activeView.colLevels[0],n[0],n[n.length-1],i),n},e.prototype.getByIdCollection=function(e,t,i){var n=this.parent.resourceBase.lastResourceLevel.filter(function(i){return e.groupIndex<=i.groupIndex&&i.groupIndex<=t.groupIndex});return this.parent.resourceBase.renderedResources=n,this.setStartEndIndex(this.parent.resourceBase.lastResourceLevel,n[0],n[n.length-1],i),n},e.prototype.setStartEndIndex=function(e,t,i,n){var r=0;e.filter(function(e){t===e?n.startIndex=r:i===e&&(n.endIndex=r+e.colSpan),r+=e.colSpan}),t===i&&(n.endIndex=n.startIndex+i.colSpan)},e.prototype.updateContent=function(e,i,n,r){var a=e.querySelector("tbody").children.length;document.activeElement&&document.activeElement.classList.contains("e-resource-cells")&&(this.isResourceCell=!0,this.parent.element.focus());for(m=0;m<a;m++)t.remove(n.querySelector("div"));this.parent.resourceBase.renderedResources=r;var s=this.parent.activeView.getGroupIndices(r),o=this.parent.activeView.getGroupIndices(this.existingDataCollection),l=s.filter(function(e){return o.indexOf(e)<0}),p=Array.from(e.querySelectorAll("tbody tr")),c=Array.from(i.querySelectorAll("tbody tr")),h=e.querySelector("tbody"),d=i.querySelector("tbody");this.removeObsoleteRows(p,s),this.removeObsoleteRows(c,s);var u=this.parent.resourceBase.getContentRows(r,!0);this.parent.isReact&&this.parent.renderTemplates();for(var g=this.parent.activeView.getContentRows(),v=this.parent.activeView.getEventRows(r.length),m=0;m<l.length;m++){var f=s.indexOf(l[parseInt(m.toString(),10)]);0===f?(t.prepend([u[parseInt(m.toString(),10)]],h),t.prepend([g[parseInt(m.toString(),10)]],d)):h&&d&&h.children[parseInt(f.toString(),10)]&&d.children[parseInt(f.toString(),10)]?(h.insertBefore(u[parseInt(m.toString(),10)],h.children[parseInt(f.toString(),10)]),d.insertBefore(g[parseInt(m.toString(),10)],d.children[parseInt(f.toString(),10)])):(t.append([u[parseInt(m.toString(),10)]],h),t.append([g[parseInt(m.toString(),10)]],d))}t.append(v,n)},e.prototype.removeObsoleteRows=function(e,i){e.forEach(function(e){var n=parseInt(e.firstElementChild.getAttribute("data-group-index"),10);i.indexOf(n)<0&&t.remove(e)})},e.prototype.updateHorizontalContent=function(e,t){this.existingDataCollection=this.parent.resourceBase.expandedResources,this.parent.resourceBase.expandedResources=t;var i=this.parent.getSelectedCells();this.focusedEle=i[i.length-1]||this.focusedEle;var n=e.querySelector("tbody"),r=Array.from(n.querySelectorAll("tr"));"Month"===this.parent.currentView?this.updateMonthViewContent(e,t):this.updateOtherViewContent(e,t,r)},e.prototype.updateMonthViewContent=function(e,i){for(var n=e.querySelectorAll(" tr").length,r=0;r<n;r++)t.remove(e.querySelector("tbody tr"));this.parent.activeViewOptions.group.byDate?this.parent.activeView.colLevels[0]=i:this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-2]=i;var a=this.parent.activeView.getContentRows();t.append(a,e.querySelector("tbody"))},e.prototype.updateOtherViewContent=function(e,i,n){var r=this,a=e.querySelector("tbody"),s=e.querySelector("colgroup"),o=e.querySelector("thead"),l=e.querySelector("table");this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-1]=i;var p=this.parent.activeViewOptions.group.byDate?new Set(i.map(function(e){return e.date.getTime()})):new Set(i.map(function(e){return e.groupIndex}));n.forEach(function(e){Array.from(e.querySelectorAll("td")).forEach(function(e){p.has(r.getIdentifier(e))||e.remove()})});for(var c=[].slice.call(e.querySelector("colgroup").children),h=0;h<c.length;h++)t.remove(c[parseInt(h.toString(),10)]);i.forEach(function(){return s.appendChild(t.createElement("col"))});for(var d=[].slice.call(e.querySelector("thead").children),h=0;h<d.length;h++)t.remove(d[parseInt(h.toString(),10)]);o.appendChild(this.parent.eventBase.createEventWrapper("",this.startIndex>0?this.startIndex:0)),this.parent.activeViewOptions.timeScale.enable&&o.appendChild(this.parent.eventBase.createEventWrapper("timeIndicator")),t.prepend([o],l);var u=this.parent.activeView.getContentRows();this.mergeNewTdData(a,u)},e.prototype.getIdentifier=function(e){return this.parent.activeViewOptions.group.byDate?b(new Date(parseInt(e.getAttribute("data-date"),10))).getTime():parseInt(e.getAttribute("data-group-index"),10)},e.prototype.mergeNewTdData=function(e,t){var i=this;Array.from(e.querySelectorAll("tr")).forEach(function(e,n){if(n<t.length){var r=t[parseInt(n.toString(),10)],a=Array.from(e.querySelectorAll("td"));Array.from(r.querySelectorAll("td")).forEach(function(t){for(var n=!1,r=0,s=a;r<s.length;r++){var o=s[r];if(i.getIdentifier(t)<i.getIdentifier(o)){e.insertBefore(t,o),n=!0;break}}n||e.appendChild(t)})}})},e.prototype.getBufferCollection=function(e,t){return this.parent.resourceBase.expandedResources.slice(e,t)},e.prototype.setTranslate=function(e,i,n,r){t.setStyleAttribute(e.querySelector("table"),{transform:"translateY("+this.translateY+"px)"}),t.setStyleAttribute(i.querySelector("table"),{transform:"translateY("+this.translateY+"px)"}),t.setStyleAttribute(n,{transform:"translateY("+this.translateY+"px)"}),t.isNullOrUndefined(r)||t.setStyleAttribute(r,{transform:"translateY("+this.translateY+"px)"})},e.prototype.updateFocusedWorkCell=function(){if(this.focusedEle){var e=parseInt(this.focusedEle.getAttribute("data-date"),10),t=parseInt(this.focusedEle.getAttribute("data-group-index"),10),i=this.parent.element.querySelector('.e-work-cells[data-date="'+e+'"][data-group-index="'+t+'"]');i&&this.parent.addSelectedClass([i],i,!0),this.focusedEle=null}},e.prototype.setRenderedDates=function(e){if("Month"!==this.parent.currentView){var t=e.map(function(e){return e.date});this.parent.resourceBase.renderedResources.forEach(function(e){return e.renderDates=t})}else{var i=e.map(function(e){return e.date.getDay()}),n=this.parent.activeView.renderDates.filter(function(e){return i.indexOf(e.getDay())>=0});this.parent.resourceBase.renderedResources.forEach(function(e){return e.renderDates=n})}},e.prototype.setTabIndex=function(){var e=this.parent.element.querySelector(".e-resource-column-wrap"),t=[].slice.call(this.parent.element.querySelectorAll(".e-resource-cells"));t&&e&&t.forEach(function(t){t.getBoundingClientRect().top>=e.getBoundingClientRect().top&&t.setAttribute("tabindex","0")});var i=this.parent.element.querySelector('.e-resource-cells[tabindex="0"]');this.isResourceCell&&i&&(i.focus(),this.isResourceCell=!1)},e.prototype.destroy=function(){this.removeEventListener(),this.focusedEle=null},e}(),vi=function(){function e(e){this.parent=e}return e.prototype.render=function(e,t){void 0===t&&(t=!0),this.initializeLayout(e),this.parent.activeView&&t&&this.parent.crudModule.refreshDataManager()},e.prototype.initializeLayout=function(e){if(this.parent.activeView){var i=["cellTemplate","tooltipTemplate","majorSlotTemplate","minorSlotTemplate","headerTooltipTemplate","dateHeaderTemplate","dayHeaderTemplate","monthHeaderTemplate","headerIndentTemplate","resourceHeaderTemplate","cellHeaderTemplate","dateRangeTemplate"];this.parent.activeEventTemplates.length>0?(i=i.concat(this.parent.activeEventTemplates),this.parent.activeEventTemplates=[]):i.push("eventTemplate"),this.parent.resetTemplates(i),this.parent.activeView.removeEventListener(),this.parent.activeView.destroy()}switch(e){case"Day":this.parent.activeView=this.parent.dayModule;break;case"Week":this.parent.activeView=this.parent.weekModule;break;case"WorkWeek":this.parent.activeView=this.parent.workWeekModule;break;case"Month":this.parent.activeView=this.parent.monthModule;break;case"Year":this.parent.activeView=this.parent.yearModule;break;case"Agenda":this.parent.activeView=this.parent.agendaModule;break;case"MonthAgenda":this.parent.activeView=this.parent.monthAgendaModule;break;case"TimelineDay":this.parent.activeView=this.parent.timelineViewsModule,t.isNullOrUndefined(this.parent.activeView)||(this.parent.activeView.viewClass="e-timeline-day-view");break;case"TimelineWorkWeek":this.parent.activeView=this.parent.timelineViewsModule,t.isNullOrUndefined(this.parent.activeView)||(this.parent.activeView.viewClass="e-timeline-work-week-view");break;case"TimelineWeek":this.parent.activeView=this.parent.timelineViewsModule,t.isNullOrUndefined(this.parent.activeView)||(this.parent.activeView.viewClass="e-timeline-week-view");break;case"TimelineMonth":this.parent.activeView=this.parent.timelineMonthModule;break;case"TimelineYear":this.parent.activeView=this.parent.timelineYearModule}if(t.isNullOrUndefined(this.parent.activeView)){var n=this.parent.viewCollections[0].option;if(n)return this.parent.setProperties({currentView:n},!0),this.parent.headerModule&&(this.parent.headerModule.updateActiveView(),this.parent.headerModule.setCalendarView()),console.warn('[WARNING] :: Module "'+e+'" is not available in Schedule component! You either misspelled the module name or forgot to load it.'),this.initializeLayout(n);throw Error("Inject required modules")}this.parent.uiStateValues.scheduleHeight=this.parent.element.offsetHeight,this.parent.activeView.viewIndex=this.parent.viewIndex,this.updateLabelText(e),this.parent.activeView.addEventListener(),this.parent.activeView.getRenderDates(),this.parent.uiStateValues.isGroupAdaptive=this.parent.activeViewOptions.group.resources.length>0&&(this.parent.enableAdaptiveUI&&!this.parent.isAdaptive||this.parent.isAdaptive&&this.parent.activeViewOptions.group.enableCompactView),this.parent.virtualScrollModule&&(this.parent.virtualScrollModule.destroy(),this.parent.virtualScrollModule=null),(-1===["Agenda","MonthAgenda","Year","TimelineYear"].indexOf(this.parent.currentView)||"TimelineYear"===this.parent.currentView&&"Vertical"===this.parent.activeViewOptions.orientation)&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(this.parent.virtualScrollModule=new gi(this.parent),this.parent.activeView.isTimelineView()?this.parent.uiStateValues.top=0:(this.parent.virtualScrollModule.isHorizontalScroll=!0,this.parent.uiStateValues.left=0)),this.updateHeader(),this.parent.currentTimezoneDate=this.parent.getCurrentTime(),this.parent.activeView.renderLayout("e-current-panel"),this.parent.renderTemplates(),this.parent.eventTooltip&&(this.parent.eventTooltip.destroy(),this.parent.eventTooltip=null),(this.parent.eventSettings.enableTooltip||this.parent.activeViewOptions.group.resources.length>0&&this.parent.activeViewOptions.group.headerTooltipTemplate)&&(this.parent.eventTooltip=new Xt(this.parent))},e.prototype.updateHeader=function(){this.parent.headerModule&&(this.parent.headerModule.setDayOfWeek(this.parent.activeViewOptions.firstDayOfWeek),this.parent.activeViewOptions.readonly?t.addClass([this.parent.element],"e-read-only"):this.parent.element.classList.contains("e-read-only")&&t.removeClass([this.parent.element],"e-read-only"),this.parent.headerModule.updateDateRange(),this.parent.headerModule.updateHeaderItems("remove"))},e.prototype.updateLabelText=function(e){this.parent.element.setAttribute("role","application"),this.parent.element.removeAttribute("aria-labelledby"),this.parent.element.removeAttribute("aria-label"),"Year"===e?this.parent.element.setAttribute("aria-label",this.parent.activeView.getLabelText(e)):this.parent.element.setAttribute("aria-labelledby",this.parent.element.id+"_table")},e}(),mi=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),fi=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},yi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return mi(i,e),fi([t.Property(!0)],i.prototype,"highlight",void 0),fi([t.Property("09:00")],i.prototype,"start",void 0),fi([t.Property("18:00")],i.prototype,"end",void 0),i}(t.ChildProperty),Ti=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),wi=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},Di=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ti(i,e),wi([t.Property(!0)],i.prototype,"enable",void 0),wi([t.Property(60)],i.prototype,"interval",void 0),wi([t.Property(2)],i.prototype,"slotCount",void 0),wi([t.Property()],i.prototype,"minorSlotTemplate",void 0),wi([t.Property()],i.prototype,"majorSlotTemplate",void 0),i}(t.ChildProperty),bi=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ci=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},Si=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return bi(i,e),Ci([t.Property("Both")],i.prototype,"templateType",void 0),Ci([t.Property()],i.prototype,"header",void 0),Ci([t.Property()],i.prototype,"content",void 0),Ci([t.Property()],i.prototype,"footer",void 0),i}(t.ChildProperty),Oi=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ei=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},xi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Oi(i,e),Ei([t.Property()],i.prototype,"option",void 0),Ei([t.Property()],i.prototype,"template",void 0),i}(t.ChildProperty),Vi=function(){function e(e){this.parent=e,this.crudObj={sourceEvent:null,targetEvent:null,isCrudAction:!1}}return e.prototype.getQuery=function(){var e=this.parent.activeView.startDate(),t=this.parent.activeView.endDate();return this.parent.dataModule.generateQuery(e,t)},e.prototype.getTable=function(){return this.parent.eventSettings.query?this.parent.eventSettings.query.clone().fromTable:null},e.prototype.refreshDataManager=function(){var e=this;if(this.parent.activeView){if(this.parent.uiStateValues&&this.parent.uiStateValues.isPreventEventRefresh)return this.parent.uiStateValues.isPreventEventRefresh=!1,this.parent.refreshEvents(!1),void this.parent.hideSpinner();var t=this.parent.activeView.startDate(),i=this.parent.activeView.endDate();this.parent.dataModule.getData(this.parent.dataModule.generateQuery(t,i)).then(function(t){return e.dataManagerSuccess(t)}).catch(function(t){return e.dataManagerFailure(t)})}},e.prototype.dataManagerSuccess=function(e){var i=this;!this.parent||this.parent&&this.parent.isDestroyed||this.parent.trigger("dataBinding",e,function(e){if(!e.cancel){var n=t.extend([],e.result,null,!0);i.parent.eventsData=n.filter(function(e){return!e[i.parent.eventFields.isBlock]}),i.parent.blockData=n.filter(function(e){return e[i.parent.eventFields.isBlock]}),i.refreshProcessedData(),i.parent.dragAndDropModule&&"drag"===i.parent.dragAndDropModule.actionObj.action&&i.parent.dragAndDropModule.navigationWrapper(),i.parent.trigger("dataBound",null,function(){i.parent.hideSpinner(),i.parent.isPrinting&&setTimeout(function(){i.parent.notify("print",{})},100)})}})},e.prototype.dataManagerFailure=function(e){var t=this;!this.parent||this.parent&&this.parent.isDestroyed||this.parent.trigger("actionFailure",{error:e},function(){return t.parent.hideSpinner()})},e.prototype.refreshProcessedData=function(e,i){if(void 0===e&&(e=!1),this.parent.dragAndDropModule&&(this.parent.dragAndDropModule.actionObj.action="",t.removeClass([this.parent.element],"e-event-action")),this.parent.activeViewOptions&&this.parent.activeViewOptions.eventTemplate){var n=["eventTemplate"];if(this.crudObj.isCrudAction&&-1===["Agenda","MonthAgenda","Year","TimelineYear"].indexOf(this.parent.currentView)){n=[];for(var r=0,a=this.crudObj.sourceEvent.length;r<a;r++)n.push("eventTemplate_"+this.crudObj.sourceEvent[parseInt(r.toString(),10)].groupIndex),this.crudObj.targetEvent[parseInt(r.toString(),10)]&&this.crudObj.sourceEvent[parseInt(r.toString(),10)].groupIndex!==this.crudObj.targetEvent[parseInt(r.toString(),10)].groupIndex&&n.push("eventTemplate_"+this.crudObj.targetEvent[parseInt(r.toString(),10)].groupIndex)}n.length>0&&this.parent.resetTemplates(n)}if(e)return void this.parent.notify(_e,{processedData:i?this.parent.eventBase.processData(i):this.parent.eventsProcessed});var s=this.parent.eventsData||[],o=this.parent.blockData||[],l=s.concat(o);this.parent.notify(_e,{processedData:this.parent.eventBase?this.parent.eventBase.processData(l):[]})},e.prototype.refreshData=function(e){var i=this,n={requestType:e.requestType,cancel:!1,data:e.data,addedRecords:e.editParams.addedRecords,changedRecords:e.editParams.changedRecords,deletedRecords:e.editParams.deletedRecords};if(this.parent.dragAndDropModule&&this.parent.dragAndDropModule.actionObj&&this.parent.dragAndDropModule.actionObj.element&&this.parent.dragAndDropModule.actionObj.action&&(this.parent.dragAndDropModule.actionObj.element.style.display="none"),this.parent.resizeModule&&this.parent.resizeModule.actionObj&&this.parent.resizeModule.actionObj.element&&this.parent.resizeModule.actionObj.action&&(this.parent.resizeModule.actionObj.element.style.display="none"),this.parent.isSpecificResourceEvents()&&("eventCreated"===e.requestType||"eventRemoved"===e.requestType)){this.crudObj.isCrudAction=!0,this.crudObj.sourceEvent=[];for(var r=this,a=0,s=e.data instanceof Array?0===e.data.length&&"eventRemoved"===e.requestType?e.editParams.deletedRecords:e.data:"string"!=typeof e.data&&"number"!=typeof e.data||"eventRemoved"!==e.requestType?[e.data]:e.editParams.deletedRecords;a<s.length;a++)!function(i){r.crudObj.isCrudAction=!("eventRemoved"===e.requestType&&!t.isNullOrUndefined(i.parent));var n=r.parent.eventBase.getGroupIndexFromEvent(i);n>-1&&0===r.parent.crudModule.crudObj.sourceEvent.filter(function(e){return e.groupIndex===n}).length&&r.crudObj.isCrudAction&&r.crudObj.sourceEvent.push(r.parent.resourceBase.lastResourceLevel[parseInt(n.toString(),10)])}(s[a]);this.crudObj.targetEvent=this.crudObj.sourceEvent}this.parent.dataModule.dataManager.dataSource.offline?this.parent.trigger("actionComplete",n,function(e){e.cancel||i.refreshDataManager()}):e.promise.then(function(){!i.parent||i.parent&&i.parent.isDestroyed||i.parent.trigger("actionComplete",n,function(e){e.cancel||i.refreshDataManager()})}).catch(function(e){!i.parent||i.parent&&i.parent.isDestroyed||i.parent.trigger("actionFailure",{error:e})})},e.prototype.processAddEvent=function(e){var i,n=this.parent.eventFields,r={addedRecords:[],changedRecords:[],deletedRecords:[]};if(e.addedRecords instanceof Array){for(var a=0,s=e.addedRecords;a<s.length;a++){var o=s[a];o=this.parent.eventBase.updateEventDateTime(o);var l=t.extend({},this.parent.eventBase.processTimezone(o,!0),null,!0);r.addedRecords.push(l)}i=this.parent.dataModule.dataManager.saveChanges(r,n.id,this.getTable(),this.getQuery())}else{var p=this.parent.eventBase.processTimezone(e.addedRecords,!0);r.addedRecords.push(p),i=this.parent.dataModule.dataManager.insert(p,this.getTable(),this.getQuery())}var c={requestType:"eventCreated",cancel:!1,data:e.addedRecords,promise:i,editParams:r};this.refreshData(c)},e.prototype.processSaveEvent=function(e){var i,n=this.parent.eventFields,r={addedRecords:[],changedRecords:[],deletedRecords:[]};if(e.changedRecords instanceof Array){for(var a=0,s=e.changedRecords;a<s.length;a++){var o=s[a];o=this.parent.eventBase.updateEventDateTime(o);var l=t.extend({},this.parent.eventBase.processTimezone(o,!0),null,!0);r.changedRecords.push(l)}i=this.parent.dataModule.dataManager.saveChanges(r,n.id,this.getTable(),this.getQuery())}else{var p=this.parent.eventBase.processTimezone(e.changedRecords,!0);r.changedRecords.push(p),i=this.parent.dataModule.dataManager.update(n.id,p,this.getTable(),this.getQuery())}var c=t.extend({},e.changedRecords[e.changedRecords.length-1],null,!0);this.parent.eventBase.selectWorkCellByTime([this.parent.eventBase.processTimezone(c)]);var h={requestType:"eventChanged",cancel:!1,data:e.changedRecords,promise:i,editParams:r};this.refreshData(h)},e.prototype.processDeleteEvent=function(e){var t,i=this.parent.eventFields,n={addedRecords:[],changedRecords:[],deletedRecords:[]};e.deletedRecords.length>1?(n.deletedRecords=n.deletedRecords.concat(e.deletedRecords),t=this.parent.dataModule.dataManager.saveChanges(n,i.id,this.getTable(),this.getQuery())):(n.deletedRecords.push(e.deletedRecords[0]),t=this.parent.dataModule.dataManager.remove(i.id,e.deletedRecords[0],this.getTable(),this.getQuery())),this.parent.eventBase.selectWorkCellByTime(e.deletedRecords);var r={requestType:"eventRemoved",cancel:!1,data:e.deletedRecords,promise:t,editParams:n};this.refreshData(r)},e.prototype.addEvent=function(e){var t=this;if(this.parent.eventSettings.allowAdding&&!this.parent.activeViewOptions.readonly){if(!this.isBlockEvent(e)&&this.parent.eventBase.isBlockRange(e))return void this.parent.quickPopup.openValidationError("blockAlert",e);if(this.parent.eventBase.checkOverlap(e))return;var i=e instanceof Array?e:[e];if(0===i.length)return;var n={requestType:"eventCreate",cancel:!1,data:i,addedRecords:i,changedRecords:[],deletedRecords:[]};this.parent.trigger(We,n,function(e){e.cancel||(e.promise?e.promise.then(function(i){!t.parent||t.parent&&t.parent.isDestroyed||i&&t.processAddEvent(e)}).catch(function(e){!t.parent||t.parent&&t.parent.isDestroyed||t.parent.trigger("actionFailure",{error:e})}):t.processAddEvent(e))})}},e.prototype.saveEvent=function(e,t){var i=this;if(this.parent.eventSettings.allowEditing&&!this.parent.activeViewOptions.readonly){if("EditFollowingEvents"!==this.parent.currentAction&&!this.isBlockEvent(e)&&this.parent.eventBase.isBlockRange(e))return this.parent.quickPopup.openValidationError("blockAlert",e),void(this.parent.crudModule.crudObj.isCrudAction=!1);var n=e instanceof Array?e:[e];if(0===n.length)return;if(this.parent.currentAction=t,t)switch(t){case"Save":this.processSave(e);break;case"EditOccurrence":this.processOccurrences(e,t);break;case"EditFollowingEvents":this.processFollowSeries(e,t);break;case"EditSeries":this.processEntireSeries(e,t)}else{if(this.parent.eventBase.checkOverlap(e))return;var r={requestType:"eventChange",cancel:!1,data:e,addedRecords:[],changedRecords:n,deletedRecords:[]};this.parent.trigger(We,r,function(e){e.cancel||(e.promise?e.promise.then(function(t){!i.parent||i.parent&&i.parent.isDestroyed||t&&i.processSaveEvent(e)}).catch(function(e){!i.parent||i.parent&&i.parent.isDestroyed||i.parent.trigger("actionFailure",{error:e})}):i.processSaveEvent(e))})}}},e.prototype.deleteEvent=function(e,t){var i=this;if(this.parent.eventSettings.allowDeleting&&!this.parent.activeViewOptions.readonly){this.parent.currentAction=t;var n=[];if(0===(n="string"==typeof e||"number"==typeof e?this.parent.eventsData.filter(function(t){return t[i.parent.eventFields.id]===e}):e instanceof Array?e:[e]).length)return;if(t)switch(t){case"Delete":this.processDelete(n);break;case"DeleteOccurrence":this.processOccurrences(n,t);break;case"DeleteFollowingEvents":this.processFollowSeries(n,t);break;case"DeleteSeries":this.processEntireSeries(n,t)}else{var r={requestType:"eventRemove",cancel:!1,data:e,addedRecords:[],changedRecords:[],deletedRecords:n};this.parent.trigger(We,r,function(e){e.cancel||(e.promise?e.promise.then(function(t){!i.parent||i.parent&&i.parent.isDestroyed||t&&i.processDeleteEvent(e)}).catch(function(e){!i.parent||i.parent&&i.parent.isDestroyed||i.parent.trigger("actionFailure",{error:e})}):i.processDeleteEvent(e))})}}},e.prototype.processOccurrences=function(e,i){var n=this,r=[],a=!1;if(e instanceof Array)for(var s=0,o=e;s<o.length;s++){var l=o[s];r.push({occurrence:l,parent:this.getParentEvent(l)})}else r={occurrence:e,parent:this.getParentEvent(e)};var p=e instanceof Array?e:[e],c={requestType:"EditOccurrence"===i?"eventChange":"eventRemove",cancel:!1,addedRecords:[],changedRecords:p,deletedRecords:[]};c.data=r,this.parent.trigger(We,c,function(e){if(!e.cancel){for(var s=n.parent.eventFields,o={addedRecords:[],changedRecords:[],deletedRecords:[]},l=r instanceof Array?r:[r],p=0,c=e.changedRecords.length;p<c;p++)!function(t,r){var p=e.changedRecords[parseInt(t.toString(),10)],c=l[parseInt(t.toString(),10)].parent,h=c[s.recurrenceException],d=void 0,u=void 0;switch(i){case"EditOccurrence":d=n.parent.eventsProcessed.filter(function(e){return e.Guid===p.Guid})[0],(u=n.excludeDateCheck(d[s.startTime],h))!==c[s.recurrenceException]?(c[s.recurrenceException]=u,p[s.recurrenceException]=Ne(d[s.startTime]),p[s.recurrenceID]=c[s.id],p[s.followingID]=null,o.changedRecords.push(n.parent.eventBase.processTimezone(c,!0)),o.addedRecords.push(n.parent.eventBase.processTimezone(p,!0))):o.changedRecords.push(n.parent.eventBase.processTimezone(p,!0));break;case"DeleteOccurrence":p[s.recurrenceException]||(c[s.recurrenceException]=n.excludeDateCheck(p[s.startTime],h),o.changedRecords.push(n.parent.eventBase.processTimezone(c,!0))),p[s.id]!==c[s.id]&&(o.deletedRecords.push(n.parent.eventBase.processTimezone(p,!0)),a=!0)}}(p);var h=n.parent.dataModule.dataManager.saveChanges(o,s.id,n.getTable(),n.getQuery()),d=t.extend({},e.changedRecords[e.changedRecords.length-1],null,!0);n.parent.eventBase.selectWorkCellByTime("EditOccurrence"===i?[n.parent.eventBase.processTimezone(d)]:[d]);var u={requestType:"EditOccurrence"===i?"eventChanged":"eventRemoved",cancel:!1,data:a?e.deletedRecords:e.changedRecords,promise:h,editParams:o};n.refreshData(u)}})},e.prototype.processFollowSeries=function(e,i){var n=this,r=[];if(e instanceof Array)for(var a=0,s=e;a<s.length;a++){var o=s[a];r.push({occurrence:o,parent:this.getParentEvent(o)})}else r={occurrence:e,parent:this.getParentEvent(e)};var l=e instanceof Array?e:[e],p={requestType:"EditFollowingEvents"===i?"eventChange":"eventRemove",cancel:!1,addedRecords:[],changedRecords:l,deletedRecords:[]};p.data=r,this.parent.trigger(We,p,function(e){if(!e.cancel){for(var a=n.parent.eventFields,s={addedRecords:[],changedRecords:[],deletedRecords:[]},o=r instanceof Array?r:[r],l=0,p=e.changedRecords.length;l<p;l++)!function(t,r){var l=e.changedRecords[parseInt(t.toString(),10)],p=o[parseInt(t.toString(),10)].parent,c=n.parent.eventBase.getEventCollections(p,l),h=void 0;switch(i){case"EditFollowingEvents":if(n.processRecurrenceRule(p,l),h=!n.parent.eventBase.isFollowingEvent(p,l),l[a.followingID]=h?null:p[a.id],l[a.recurrenceID]=null,s.addedRecords.push(n.parent.eventBase.processTimezone(l,!0)),s.changedRecords.push(n.parent.eventBase.processTimezone(p,!0)),!n.parent.uiStateValues.isIgnoreOccurrence){if(l[a.recurrenceException]=null,c.occurrence.length>0){var d=c.occurrence.slice(-1)[0][a.recurrenceRule];-1===d.indexOf("COUNT")&&(l[a.recurrenceRule]=d)}c.follow.length>0&&(l[a.recurrenceRule]=c.follow.slice(-1)[0][a.recurrenceRule],s.deletedRecords=s.deletedRecords.concat(c.follow)),h&&(c.occurrence=c.occurrence.filter(function(e){return e[a.recurrenceID]===p[a.id]})),s.deletedRecords=s.deletedRecords.concat(c.occurrence)}break;case"DeleteFollowingEvents":n.processRecurrenceRule(p,l[a.startTime]),s.changedRecords.push(n.parent.eventBase.processTimezone(p,!0)),s.deletedRecords=s.deletedRecords.concat(c.occurrence).concat(c.follow)}}(l);var c=n.parent.dataModule.dataManager.saveChanges(s,a.id,n.getTable(),n.getQuery()),h=t.extend({},e.changedRecords[e.changedRecords.length-1],null,!0);n.parent.eventBase.selectWorkCellByTime("EditFollowingEvents"===i?[n.parent.eventBase.processTimezone(h)]:[h]);var d={requestType:"EditFollowingEvents"===i?"eventChanged":"eventRemoved",cancel:!1,data:e.changedRecords,promise:c,editParams:s};n.refreshData(d)}})},e.prototype.processEntireSeries=function(e,i){var n=this,r=[],a=!1;if(e instanceof Array)for(var s=0,o=e;s<o.length;s++){var l=o[s];r.push(this.getParentEvent(l,!0))}else r=this.getParentEvent(e,!0);var p=e instanceof Array?e:[e],c={requestType:"EditSeries"===i?"eventChange":"eventRemove",cancel:!1,addedRecords:[],changedRecords:[],deletedRecords:[]};if(c.data=r,"EditSeries"===i?c.changedRecords=p:c.deletedRecords=p,"EditSeries"===i&&!this.parent.uiStateValues.isIgnoreOccurrence)for(var h=r instanceof Array?r:[r],d=0,u=c.changedRecords.length;d<u;d++){var g=h[parseInt(d.toString(),10)],v=this.parent.eventBase.getEventCollections(g),m=v.follow.concat(v.occurrence);c.deletedRecords=c.deletedRecords.concat(m)}this.parent.trigger(We,c,function(e){if(!e.cancel){for(var s=n.parent.eventFields,o={addedRecords:[],changedRecords:[],deletedRecords:[]},l=r instanceof Array?r:[r],p="EditSeries"===i?e.changedRecords:e.deletedRecords,c=0,h=p.length;c<h;c++)!function(e,t){var r=p[parseInt(e.toString(),10)],c=l[parseInt(e.toString(),10)],h=n.parent.eventBase.getEventCollections(c),d=h.follow.concat(h.occurrence);switch(i){case"EditSeries":if(r[s.id]=c[s.id],r[s.recurrenceID]=null,r[s.followingID]=null,n.parent.uiStateValues.isIgnoreOccurrence&&r[s.recurrenceException]){var u=n.parent.eventsData.filter(function(e){return e[s.id]===r[s.id]});u.length>0&&(r[s.recurrenceRule]=u[0][s.recurrenceRule])}else r[s.recurrenceException]=null,o.deletedRecords=o.deletedRecords.concat(d);o.changedRecords.push(n.parent.eventBase.processTimezone(r,!0)),n.parent.uiStateValues.isIgnoreOccurrence=!1;break;case"DeleteSeries":o.deletedRecords=o.deletedRecords.concat(d.concat(n.parent.eventBase.processTimezone(c,!0))),a=!0}}(c);var d=n.parent.dataModule.dataManager.saveChanges(o,s.id,n.getTable(),n.getQuery()),u=t.extend({},p[p.length-1],null,!0);n.parent.eventBase.selectWorkCellByTime("EditSeries"===i?[n.parent.eventBase.processTimezone(u)]:[u]);var g={requestType:"EditSeries"===i?"eventChanged":"eventRemoved",cancel:!1,data:a?e.deletedRecords:e.changedRecords,promise:d,editParams:o};n.refreshData(g)}})},e.prototype.processDelete=function(e){for(var i=this,n=[],r=0,a=e;r<a.length;r++){var s=a[r];s[this.parent.eventFields.recurrenceRule]?n.push({occurrence:s,parent:this.getParentEvent(s)}):n.push(s)}var o={requestType:"eventRemove",cancel:!1,addedRecords:[],changedRecords:[],deletedRecords:e};o.data=n,this.parent.trigger(We,o,function(e){if(!e.cancel){for(var r=i.parent.eventFields,a={addedRecords:[],changedRecords:[],deletedRecords:[]},s=t.extend([],e.deletedRecords,null,!0),o=0,l=e.deletedRecords.length;o<l;o++)!function(s,o){var l=t.isNullOrUndefined(e.deletedRecords[parseInt(s.toString(),10)][i.parent.eventFields.recurrenceRule]);if(!l){var p=n[parseInt(s.toString(),10)].parent,c=a.changedRecords.filter(function(e){return e[r.id]===p[r.id]}),h=e.deletedRecords[parseInt(s.toString(),10)][r.startTime];if(c.length>0){var d=c[0];d[r.recurrenceException]=i.excludeDateCheck(h,d[r.recurrenceException])}else p[r.recurrenceException]=i.excludeDateCheck(h,p[r.recurrenceException]);0===c.length&&a.changedRecords.push(i.parent.eventBase.processTimezone(p,!0)),l=e.deletedRecords[parseInt(s.toString(),10)][r.id]!==p[r.id]}if(l){if(e.deletedRecords instanceof Array)for(var u=0,g=e.deletedRecords;u<g.length;u++){var v=g[u];i.parent.eventBase.processTimezone(v,!0)}a.deletedRecords.push(e.deletedRecords[parseInt(s.toString(),10)])}}(o);var p=i.parent.dataModule.dataManager.saveChanges(a,r.id,i.getTable(),i.getQuery());i.parent.eventBase.selectWorkCellByTime(s);var c={requestType:"eventRemoved",cancel:!1,data:e.deletedRecords,promise:p,editParams:a};i.refreshData(c)}})},e.prototype.processSave=function(e){for(var i=this,n=e instanceof Array?e:[e],r=[],a=0,s=n;a<s.length;a++){var o=s[a];o[this.parent.eventFields.recurrenceRule]?r.push({occurrence:o,parent:this.getParentEvent(o)}):r.push(o)}var l={requestType:"eventChange",cancel:!1,addedRecords:[],changedRecords:n,deletedRecords:[]};l.data=r,this.parent.trigger(We,l,function(e){if(!e.cancel){for(var n=i.parent.eventFields,r={addedRecords:[],changedRecords:[],deletedRecords:[]},a=0,s=e.changedRecords;a<s.length;a++){var o=s[a];if(!t.isNullOrUndefined(o[n.recurrenceRule])&&t.isNullOrUndefined(o[n.recurrenceException])){var l=Ne(o[n.startTime]),p=i.getParentEvent(o);p[n.recurrenceException]=t.isNullOrUndefined(p[n.recurrenceException])?l:p[n.recurrenceException].concat(","+l),o[n.id]=i.parent.getEventMaxID(),o[n.recurrenceException]=l,r.addedRecords.push(i.parent.eventBase.processTimezone(o,!0)),r.changedRecords.push(i.parent.eventBase.processTimezone(p,!0))}else r.changedRecords.push(i.parent.eventBase.processTimezone(o,!0))}var c=i.parent.dataModule.dataManager.saveChanges(r,n.id,i.getTable(),i.getQuery()),h=t.extend({},e.changedRecords[e.changedRecords.length-1],null,!0);i.parent.eventBase.selectWorkCellByTime([i.parent.eventBase.processTimezone(h)]);var d={requestType:"eventChanged",cancel:!1,data:e.changedRecords,promise:c,editParams:r};i.refreshData(d)}})},e.prototype.getParentEvent=function(e,t){void 0===t&&(t=!1);var i=this.parent.eventBase.getParentEvent(e,t)||e;return(i[this.parent.eventFields.startTimezone]||i[this.parent.eventFields.endTimezone])&&this.parent.eventBase.timezoneConvert(i),i},e.prototype.excludeDateCheck=function(e,i){var n=this.parent.timezone||this.parent.tzModule.getLocalTimezoneName();n&&(e=this.parent.tzModule.remove(new Date(+e.getTime()),n));var r=Ne(e);return t.isNullOrUndefined(i)?i=r:-1===i.indexOf(r)&&(i=t.isNullOrUndefined(i)?r:i+","+r),i},e.prototype.processRecurrenceRule=function(e,t){var i,n=this.parent.eventFields,r=e[n.recurrenceRule];if(t instanceof Date)i=new Date(+t);else{i=new Date(+t[n.startTime]);var a=t[n.recurrenceRule];if(a){var s=e[n.startTime],o=G(s,a,"DeleteFollowingEvents"===this.parent.currentAction?t[n.recurrenceException]:null,this.parent.activeViewOptions.firstDayOfWeek),l=new Date(o.slice(-1)[0]);l.setHours(i.getHours(),i.getMinutes(),i.getSeconds()),i.setHours(s.getHours(),s.getMinutes(),s.getSeconds()),t[n.recurrenceRule]=this.getUpdatedRecurrenceRule(a,new Date(+l),!1)}}e[n.recurrenceRule]=this.getUpdatedRecurrenceRule(r,O(new Date(i.getTime()),-1),!0)},e.prototype.getUpdatedRecurrenceRule=function(e,t,i){for(var n="",r=0,a=e.split(";");r<a.length;r++){var s=a[r];if(""!==s){var o=s.split("=")[0],l=s.split("=")[1];"COUNT"!==o&&"UNTIL"!==o||(l=Ne(t),s=s.replace(s,"UNTIL="+l)),n+=s+";"}}return i&&-1===n.indexOf("UNTIL")&&(n+="UNTIL="+Ne(t)),n},e.prototype.isBlockEvent=function(e){for(var t=!1,i=0,n=e instanceof Array?e:[e];i<n.length;i++)t=n[i][this.parent.eventFields.isBlock]||!1;return t},e.prototype.destroy=function(){this.crudObj=null,this.parent=null},e}(),Ai=function(){function e(e){this.parent=e,t.EventHandler.add(this.parent.element,"mouseover",this.onHover,this)}return e.prototype.cellMouseDown=function(e){this.isPreventAction(e)||this.parent.notify("cell-mouse-down",{event:e})},e.prototype.cellClick=function(e){var i=this;if(!this.isPreventAction(e)){var n=t.closest(e.target,".e-work-cells,.e-all-day-cells,.e-header-cells");if(!t.isNullOrUndefined(n)){if(!t.isNullOrUndefined(t.closest(e.target,".e-new-event")))return void this.parent.eventWindow.openEditor(this.parent.activeCellsData,"Add");var r=n.classList.contains("e-work-cells")||n.classList.contains("e-all-day-cells");this.parent.uiStateValues.isTapHold&&!this.parent.uiStateValues.action&&r&&(this.parent.uiStateValues.isTapHold=!1,this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.selectedElements=[]);var a=t.closest(e.target,".e-navigate"),s=this.parent.getNavigateView(),o=this.parent.currentView===s;if(t.isNullOrUndefined(a)||o||t.isNullOrUndefined(this.parent.viewOptions[s.charAt(0).toLowerCase()+s.slice(1)])){if(this.parent.activeViewOptions.readonly&&"MonthAgenda"!==this.parent.currentView)return void(this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide());if(this.parent.isAdaptive&&(e.target.classList.contains("e-more-indicator")||t.closest(e.target,".e-more-indicator")))return;if(r&&e.shiftKey&&1===e.which&&this.parent.keyboardInteractionModule)return void this.parent.keyboardInteractionModule.onMouseSelection(e);this.parent.activeCellsData=this.parent.getCellDetails(n);var l=t.extend(this.parent.activeCellsData,{cancel:!1,event:e,name:"cellClick"});this.parent.trigger("cellClick",l,function(e){if(e.cancel)i.parent.quickPopup&&i.parent.quickPopup.quickPopupHide();else if(r&&i.parent.selectCell(n),i.parent.allowInline){var t={element:e.element,groupIndex:e.groupIndex,type:"Cell"};i.parent.notify(Ye,t)}else i.parent.notify("cellClick",e)})}else{var p=this.parent.getDateFromElement(n);!t.isNullOrUndefined(p)&&this.parent.isMinMaxDate(p)&&(this.parent.setProperties({selectedDate:p},!0),this.parent.changeView(this.parent.getNavigateView(),e))}}}},e.prototype.cellDblClick=function(e){var i=this,n=t.closest(e.target,".e-work-cells,.e-all-day-cells,.e-header-cells");if(!(this.parent.activeViewOptions.readonly||this.isPreventAction(e)||t.isNullOrUndefined(n))){var r=t.extend(this.parent.activeCellsData,{cancel:!1,event:e,name:"cellDoubleClick"});this.parent.trigger("cellDoubleClick",r,function(e){if(e.startTime){var t=new Date(e.startTime.getTime());i.parent.isMinMaxDate(new Date(t.setHours(0,0,0,0)))&&(e.cancel||i.parent.eventWindow.openEditor(i.parent.activeCellsData,"Add"))}})}},e.prototype.onHover=function(e){var i=t.closest(e.target,".e-work-cells,.e-time-slots,.e-all-day-cells,.e-header-cells,.e-resource-cells,.e-appointment,.e-week-number,.e-month-header");if(i){var n={element:i,event:e};this.parent.trigger("hover",n)}},e.prototype.isPreventAction=function(e){if(t.closest(e.target,".e-navigate"))return!1;if(t.closest(e.target,".e-appointment-wrapper")&&!t.closest(e.target,".e-more-indicator"))return!0;var i=t.closest(e.target,".e-appointment,.e-resource-group-cells");return!t.isNullOrUndefined(i)||(i=t.closest(e.target,".e-header-cells"),!(!this.parent.activeView||!this.parent.activeView.isTimelineView()||t.isNullOrUndefined(i)))},e.prototype.destroy=function(){t.EventHandler.remove(this.parent.element,"mouseover",this.onHover)},e}(),Ii=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ki=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},Mi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ii(i,e),ki([t.Property()],i.prototype,"name",void 0),ki([t.Property()],i.prototype,"default",void 0),ki([t.Property()],i.prototype,"title",void 0),ki([t.Property({})],i.prototype,"validation",void 0),i}(t.ChildProperty),Ri=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Hi=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},Pi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ri(i,e),Hi([t.Property("Id")],i.prototype,"id",void 0),Hi([t.Property("IsBlock")],i.prototype,"isBlock",void 0),Hi([t.Complex({name:"Subject"},Mi)],i.prototype,"subject",void 0),Hi([t.Complex({name:"StartTime"},Mi)],i.prototype,"startTime",void 0),Hi([t.Complex({name:"EndTime"},Mi)],i.prototype,"endTime",void 0),Hi([t.Complex({name:"StartTimezone"},Mi)],i.prototype,"startTimezone",void 0),Hi([t.Complex({name:"EndTimezone"},Mi)],i.prototype,"endTimezone",void 0),Hi([t.Complex({name:"Location"},Mi)],i.prototype,"location",void 0),Hi([t.Complex({name:"Description"},Mi)],i.prototype,"description",void 0),Hi([t.Complex({name:"IsAllDay"},Mi)],i.prototype,"isAllDay",void 0),Hi([t.Complex({name:"RecurrenceID"},Mi)],i.prototype,"recurrenceID",void 0),Hi([t.Complex({name:"RecurrenceRule"},Mi)],i.prototype,"recurrenceRule",void 0),Hi([t.Complex({name:"RecurrenceException"},Mi)],i.prototype,"recurrenceException",void 0),Hi([t.Property("IsReadonly")],i.prototype,"isReadonly",void 0),Hi([t.Property("FollowingID")],i.prototype,"followingID",void 0),i}(t.ChildProperty),ji=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ni=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},Li=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ji(i,e),Ni([t.Property()],i.prototype,"template",void 0),Ni([t.Property([])],i.prototype,"dataSource",void 0),Ni([t.Property()],i.prototype,"query",void 0),Ni([t.Complex({},Pi)],i.prototype,"fields",void 0),Ni([t.Property(!1)],i.prototype,"enableTooltip",void 0),Ni([t.Property("AllDayRow")],i.prototype,"spannedEventPlacement",void 0),Ni([t.Property(1)],i.prototype,"minimumEventDuration",void 0),Ni([t.Property()],i.prototype,"tooltipTemplate",void 0),Ni([t.Property()],i.prototype,"resourceColorField",void 0),Ni([t.Property(!1)],i.prototype,"editFollowingEvents",void 0),Ni([t.Property(!0)],i.prototype,"allowAdding",void 0),Ni([t.Property(!0)],i.prototype,"allowEditing",void 0),Ni([t.Property(!0)],i.prototype,"allowDeleting",void 0),Ni([t.Property(!1)],i.prototype,"enableMaxHeight",void 0),Ni([t.Property(!1)],i.prototype,"enableIndicator",void 0),Ni([t.Property(!1)],i.prototype,"ignoreWhitespace",void 0),Ni([t.Property()],i.prototype,"sortComparer",void 0),Ni([t.Property()],i.prototype,"includeFiltersInQuery",void 0),i}(t.ChildProperty),qi=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Fi=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},Ui=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return qi(i,e),Fi([t.Property(!1)],i.prototype,"byDate",void 0),Fi([t.Property(!0)],i.prototype,"byGroupID",void 0),Fi([t.Property(!1)],i.prototype,"allowGroupEdit",void 0),Fi([t.Property([])],i.prototype,"resources",void 0),Fi([t.Property(!0)],i.prototype,"enableCompactView",void 0),Fi([t.Property()],i.prototype,"headerTooltipTemplate",void 0),Fi([t.Property(!1)],i.prototype,"hideNonWorkingDays",void 0),i}(t.ChildProperty),Bi=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Wi=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},zi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Bi(i,e),Wi([t.Property()],i.prototype,"field",void 0),Wi([t.Property()],i.prototype,"title",void 0),Wi([t.Property()],i.prototype,"name",void 0),Wi([t.Property(!1)],i.prototype,"allowMultiple",void 0),Wi([t.Property([])],i.prototype,"dataSource",void 0),Wi([t.Property()],i.prototype,"query",void 0),Wi([t.Property("Id")],i.prototype,"idField",void 0),Wi([t.Property("Text")],i.prototype,"textField",void 0),Wi([t.Property("Expanded")],i.prototype,"expandedField",void 0),Wi([t.Property("GroupID")],i.prototype,"groupIDField",void 0),Wi([t.Property("Color")],i.prototype,"colorField",void 0),Wi([t.Property("StartHour")],i.prototype,"startHourField",void 0),Wi([t.Property("EndHour")],i.prototype,"endHourField",void 0),Wi([t.Property("WorkDays")],i.prototype,"workDaysField",void 0),Wi([t.Property("CssClass")],i.prototype,"cssClassField",void 0),i}(t.ChildProperty),Yi=function(){function e(e){this.resourceCollection=[],this.leftPixel=25,this.resourceDateTree=[],this.parent=e}return e.prototype.renderResourceHeaderIndent=function(e){var i=t.createElement("td",{className:"e-resource-left-td"}),n=t.createElement("div",{className:"e-resource-text"});if(this.parent.activeViewOptions.headerIndentTemplate){var r={className:[i.className],type:"emptyCells"};this.parent.renderHeaderIndentTemplate(r,i)}else i.appendChild(n);var a={elementType:"emptyCells",element:i};this.parent.trigger(ze,a),e.appendChild(i)},e.prototype.hideResourceRows=function(e){if(!(this.resourceCollection.length<=1||this.parent.virtualScrollModule))for(var i=this.lastResourceLevel.length,n=0;n<i;n++){var r=this.lastResourceLevel[parseInt(n.toString(),10)].resourceData,a=this.lastResourceLevel[parseInt(n.toString(),10)].resource;if("e-parent-node"===r.ClassName&&!r[a.expandedField]&&!t.isNullOrUndefined(r[a.expandedField])){var s=[].slice.call(e.children).slice(n+1,n+(parseInt(r.Count,10)+1));t.addClass(s,"e-hidden")}}},e.prototype.createResourceColumn=function(){var e=this.resourceCollection,i=t.createElement("div",{className:"e-resource-column-wrap"}),n=this.parent.activeView.createTableLayout("e-resource-column-table");!this.parent.uiStateValues.isGroupAdaptive&&this.parent.rowAutoHeight&&this.parent.activeView.isTimelineView()&&this.parent.activeViewOptions.group.resources.length>0&&t.addClass([n],"e-auto-height");var r=n.querySelector("tbody"),a=this.generateTreeData(!0);if(this.countCalculation(e.slice(0,-2),e.slice(0,-1)),this.renderedResources=this.lastResourceLevel,this.parent.virtualScrollModule){var s=this.parent.virtualScrollModule.getRenderedCount();this.setExpandedResources(),a=this.expandedResources.slice(0,s),this.renderedResources=a}return t.append(this.getContentRows(a),r),this.hideResourceRows(r),n.appendChild(r),i.appendChild(n),i},e.prototype.setRenderedResources=function(){var e=this.resourceCollection;this.generateTreeData(!0);this.countCalculation(e.slice(0,-2),e.slice(0,-1)),this.renderedResources=this.lastResourceLevel},e.prototype.setExpandedResources=function(){for(var e=[],i=0;i<this.lastResourceLevel.length;i++){var n=this.lastResourceLevel[parseInt(i.toString(),10)].resourceData,r=n.Count;e.push(this.lastResourceLevel[parseInt(i.toString(),10)]);var a=n[this.lastResourceLevel[parseInt(i.toString(),10)].resource.expandedField];!t.isNullOrUndefined(a)&&!a&&r>0&&(i+=r)}this.expandedResources=e},e.prototype.getContentRows=function(e,i){for(var n,r,a=[],s=this.resourceCollection,o=t.createElement("tr"),l=t.createElement("td",{attrs:{tabindex:i?"-1":"0"}}),p=this.parent.activeView.getGroupIndices(),c=0;c<e.length;c++)if(!(p.length>0&&p.indexOf(e[parseInt(c.toString(),10)].groupIndex)>-1)){var h=l.cloneNode();if(r=H(s,"name",e[parseInt(c.toString(),10)].resource.name),r===s.length-1?(t.extend(e[parseInt(c.toString(),10)].resourceData,{ClassName:"e-child-node"}),this.renderedResources[parseInt(c.toString(),10)].className=["e-child-node"]):(t.extend(e[parseInt(c.toString(),10)].resourceData,{ClassName:"e-parent-node"}),this.renderedResources[parseInt(c.toString(),10)].className=["e-parent-node"]),n=r*this.leftPixel+"px","e-parent-node"===e[parseInt(c.toString(),10)].resourceData.ClassName&&!t.isNullOrUndefined(e[parseInt(c.toString(),10)].resourceData.Count)&&e[parseInt(c.toString(),10)].resourceData.Count>0){var d=void 0;d=e[parseInt(c.toString(),10)].resourceData[s[parseInt(r.toString(),10)].expandedField]||t.isNullOrUndefined(e[parseInt(c.toString(),10)].resourceData[s[parseInt(r.toString(),10)].expandedField])?"e-resource-collapse":"e-resource-expand";var u=t.createElement("div");t.addClass([u],["e-resource-tree-icon",d]),this.setMargin(u,n),h.appendChild(u),this.resourceCollection.length>1&&t.EventHandler.add(u,"click",this.onTreeIconClick,this)}this.parent.activeView.setResourceHeaderContent(h,e[parseInt(c.toString(),10)],"e-resource-text"),h.setAttribute("data-group-index",e[parseInt(c.toString(),10)].groupIndex.toString()),h.setAttribute("aria-label",e[parseInt(c.toString(),10)].resourceData[e[parseInt(c.toString(),10)].resource.textField]+" resource"),this.parent.activeViewOptions.resourceHeaderTemplate||this.setMargin(h.querySelector(".e-resource-text"),n);var g=["e-resource-cells",e[parseInt(c.toString(),10)].resourceData.ClassName];t.addClass([h],g);var v={elementType:"resourceHeader",element:h,groupIndex:e[parseInt(c.toString(),10)].groupIndex};this.parent.trigger(ze,v);var m=o.cloneNode();m.appendChild(h),a.push(m)}return a},e.prototype.setMargin=function(e,t){this.parent.enableRtl?e.style.marginRight=t:e.style.marginLeft=t},e.prototype.countCalculation=function(e,i){for(var n,r=0;r<e.length;r++){for(var s=e[e.length-(r+1)].dataSource,o=0;o<s.length;o++){var l=0;if(this.parent.activeViewOptions.group.byGroupID){var p=(new a.Query).where(i[i.length-1].groupIDField,"equal",s[parseInt(o.toString(),10)][e[e.length-(r+1)].idField]);n=new a.DataManager(i[i.length-1].dataSource).executeLocal(p)}else n=i[i.length-1].dataSource;for(var c=0;c<n.length;c++)l+=parseInt(n[parseInt(c.toString(),10)].Count,10);l+=parseInt(s[parseInt(o.toString(),10)].Count,10),t.extend(s[parseInt(o.toString(),10)],{Count:l})}i=i.slice(0,-1)}},e.prototype.onTreeIconClick=function(e){var i=this;this.parent.eventTooltip&&this.parent.eventTooltip.close();var n,r=e.target,a=t.closest(r,".e-parent-node").parentElement,s=parseInt(a.children[0].getAttribute("data-group-index"),10),o={cancel:!1,event:e,groupIndex:s,requestType:r.classList.contains("e-resource-collapse")?"resourceCollapse":"resourceExpand"};this.parent.trigger(We,o,function(a){if(!a.cancel){r.classList.contains("e-resource-collapse")?(t.classList(r,["e-resource-expand"],["e-resource-collapse"]),n=!0):(t.classList(r,["e-resource-collapse"],["e-resource-expand"]),n=!1);for(var l=0,p=[].slice.call(i.parent.element.querySelectorAll(".e-appointment,.e-more-indicator"));l<p.length;l++){var c=p[l];t.remove(c)}i.parent.virtualScrollModule?i.updateVirtualContent(s,n,e,r):i.updateContent(s,n);var h={cssProperties:i.parent.getCssProperties(),module:"scroll"};i.parent.notify(Xe,h),o={cancel:!1,event:e,groupIndex:s,requestType:r.classList.contains("e-resource-collapse")?"resourceExpanded":"resourceCollapsed"},i.parent.refreshEvents(!1),i.parent.trigger("actionComplete",o)}})},e.prototype.updateContent=function(e,i){for(var n,r=[],a=[],s=[],o=this.lastResourceLevel[parseInt(e.toString(),10)].resourceData,l=[].slice.call(this.parent.element.querySelectorAll(".e-resource-column-wrap tr")),p=[].slice.call(this.parent.element.querySelectorAll(".e-content-wrap tbody tr")),c=[].slice.call(this.parent.element.querySelectorAll(".e-content-wrap ."+at)),h=0;h<o.Count;h++)r.push(l[e+h+1]),a.push(p[e+h+1]),s.push(c[e+h+1]);for(var d=this.lastResourceLevel,u=0;u<r.length;u++){var g=!0;if(n=r[parseInt(u.toString(),10)].children[0].classList.contains("e-parent-node"),d[parseInt(e.toString(),10)].resourceData[d[parseInt(e.toString(),10)].resource.expandedField]=!i,i)n&&(m=r[parseInt(u.toString(),10)].querySelector(".e-resource-tree-icon"))&&t.classList(m,["e-resource-expand"],["e-resource-collapse"]),r[parseInt(u.toString(),10)].classList.contains("e-hidden")||t.addClass([r[parseInt(u.toString(),10)],a[parseInt(u.toString(),10)],s[parseInt(u.toString(),10)]],"e-hidden");else{if(n){var v=r[parseInt(u.toString(),10)].rowIndex;if(d[parseInt(v.toString(),10)].resourceData[d[parseInt(v.toString(),10)].resource.expandedField]||t.isNullOrUndefined(d[parseInt(v.toString(),10)].resourceData[d[parseInt(v.toString(),10)].resource.expandedField])||(r.splice(u+1,parseInt(d[parseInt(v.toString(),10)].resourceData.Count,10)),a.splice(u+1,parseInt(d[parseInt(v.toString(),10)].resourceData.Count,10)),s.splice(u+1,parseInt(d[parseInt(v.toString(),10)].resourceData.Count,10)),g=!1),g){var m=r[parseInt(u.toString(),10)].querySelector(".e-resource-tree-icon");m&&t.classList(m,["e-resource-collapse"],["e-resource-expand"])}}r[parseInt(u.toString(),10)].classList.contains("e-hidden")&&t.removeClass([r[parseInt(u.toString(),10)],a[parseInt(u.toString(),10)],s[parseInt(u.toString(),10)]],"e-hidden")}}},e.prototype.updateVirtualContent=function(e,i,n,r){this.lastResourceLevel[parseInt(e.toString(),10)].resourceData[this.lastResourceLevel[parseInt(e.toString(),10)].resource.expandedField]=!i,this.setExpandedResources();var a=this.parent.virtualScrollModule.getRenderedCount(),s=this.expandedResources.indexOf(this.renderedResources[0]);if(this.parent.virtualScrollModule.existingDataCollection=this.renderedResources,this.renderedResources=this.expandedResources.slice(s,s+a),this.renderedResources.length<a){var o=this.expandedResources.length-a;o=o>0?o:0,this.renderedResources=this.expandedResources.slice(o,this.expandedResources.length)}var l=this.parent.element.querySelector(".e-virtual-track");this.parent.virtualScrollModule.updateVirtualTrackHeight(l);var p=this.parent.element.querySelector(".e-resource-column-wrap table"),c=this.parent.element.querySelector(".e-content-wrap table"),h=this.parent.element.querySelector(".e-event-table");this.parent.virtualScrollModule.updateContent(p,c,h,this.renderedResources);var d=this.parent.element.querySelector(".e-current-timeline");t.isNullOrUndefined(d)||(d.style.height=this.parent.element.querySelector("."+nt).offsetHeight+"px")},e.prototype.renderResourceHeader=function(){var e=t.createElement("div",{className:"e-schedule-resource-toolbar-container"});if(e.innerHTML='<div class="e-schedule-resource-toolbar"><div class="e-resource-menu"><div class="e-icons e-icon-menu"></div></div><div class="e-resource-level-title"></div></div>',"MonthAgenda"===this.parent.currentView){var i=this.parent.activeView.getPanel().querySelector(".e-content-wrap");i.insertBefore(e,i.querySelector(".e-wrapper-container"))}else this.parent.element.insertBefore(e,this.parent.element.querySelector("."+tt));this.renderResourceHeaderText(),t.EventHandler.add(e.querySelector(".e-icon-menu"),"click",this.menuClick,this)},e.prototype.renderResourceTree=function(){this.popupOverlay=t.createElement("div",{className:"e-resource-tree-popup-overlay"});var e=t.createElement("div",{className:"e-resource-tree-popup e-popup-close"});if("MonthAgenda"===this.parent.currentView){var r=this.parent.activeView.getPanel().querySelector(".e-wrapper-container");r.insertBefore(e,r.children[0]),r.appendChild(this.popupOverlay)}else this.parent.element.querySelector("."+tt).appendChild(e),this.parent.element.querySelector("."+tt).appendChild(this.popupOverlay);var a=t.createElement("div",{className:"e-resource-tree"});e.appendChild(a),this.treeViewObj=new n.TreeView({cssClass:this.parent.cssClass,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,fields:{dataSource:[].slice.call(this.generateTreeData()),id:"resourceId",text:"resourceName",child:"resourceChild"},nodeTemplate:this.parent.resourceHeaderTemplate,nodeClicked:this.resourceClick.bind(this),created:this.resourceTreeCreated.bind(this)}),this.treeViewObj.root=this.parent.root?this.parent.root:this.parent,this.treeViewObj.appendTo(a),this.treeViewObj.expandAll(),this.treePopup=new i.Popup(e,{targetType:"relative",actionOnScroll:"none",content:this.treeViewObj.element,relateTo:this.parent.element.querySelector("."+tt),enableRtl:this.parent.enableRtl,hideAnimation:{name:"SlideLeftOut",duration:500},showAnimation:{name:"SlideLeftIn",duration:500},viewPortElement:this.parent.element.querySelector("."+("MonthAgenda"===this.parent.currentView?"e-wrapper-container":tt))}),this.parent.on("document-click",this.documentClick,this)},e.prototype.resourceTreeCreated=function(){this.parent.activeViewOptions.resourceHeaderTemplate&&this.parent.portals&&this.treeViewObj.portals&&(this.parent.portals=this.parent.portals.concat(this.treeViewObj.portals),this.parent.renderTemplates())},e.prototype.generateTreeData=function(e){for(var i=this,n=[],r=[],a=0,s=this,o=0,l=this.resourceTreeLevel.length;o<l;o++)!function(o,l){var p=function(n,s,o){var l,c,h=i.resourceCollection[parseInt(s.toString(),10)];e?(c={type:"resourceHeader",resource:n.resource,resourceData:n.resourceData,groupIndex:a,groupOrder:n.groupOrder},r.push(c),a++):l={resourceId:o,resourceName:n.resourceData[h.textField],resource:n.resource,resourceData:n.resourceData},n.child.length>0&&!e&&(l.resourceChild=[]);for(var d=1,u=0,g=n.child;u<g.length;u++){var v=g[u];e?p(v,s+1,o+"-"+d):l.resourceChild.push(p(v,s+1,o+"-"+d)),d+=1}return e&&t.extend(c.resourceData,{Count:d-1}),l};e?p(s.resourceTreeLevel[parseInt(o.toString(),10)],0,(o+1).toString()):n.push(p(s.resourceTreeLevel[parseInt(o.toString(),10)],0,(o+1).toString()))}(o);return e?(this.lastResourceLevel=r,r):n},e.prototype.renderResourceHeaderText=function(){for(var e=this.lastResourceLevel[this.parent.uiStateValues.groupIndex],i=[],n=this,r=0,a=e.groupOrder.length;r<a;r++)!function(r,a){var s=n.resourceCollection[parseInt(r.toString(),10)],o=s.dataSource.filter(function(t){return t[s.idField]===e.groupOrder[parseInt(r.toString(),10)]}),l=t.createElement("div",{className:"e-resource-name"});n.parent.sanitize(o[0][s.textField],l),i.push(l);var p=t.createElement("div",{className:"e-icons e-icon-next"});i.push(p)}(r);i.pop();var s=("MonthAgenda"===this.parent.currentView?this.parent.activeView.getPanel():this.parent.element).querySelector(".e-resource-level-title");j(s);for(var o=0,l=i;o<l.length;o++){var p=l[o];s.appendChild(p)}1===this.lastResourceLevel.length&&t.addClass([this.parent.element.querySelector(".e-resource-menu")],"e-disable")},e.prototype.menuClick=function(e){if(this.parent.element.querySelector(".e-resource-tree-popup").classList.contains(rt))this.treePopup.hide(),t.removeClass([this.popupOverlay],"e-enable");else{var i=[].slice.call(this.treeViewObj.element.querySelectorAll(".e-list-item:not(.e-has-child)"));t.removeClass(i,"e-active"),t.addClass([i[this.parent.uiStateValues.groupIndex]],"e-active"),this.treePopup.show(),t.addClass([this.popupOverlay],"e-enable")}},e.prototype.selectResourceByIndex=function(e){this.lastResourceLevel&&e>-1&&e<this.lastResourceLevel.length&&this.triggerEvents(e)},e.prototype.resourceClick=function(e){if(!e.node.classList.contains("e-has-child")){this.treePopup.hide(),t.removeClass([this.popupOverlay],"e-enable");var i=[].slice.call(this.treeViewObj.element.querySelectorAll(".e-list-item:not(.e-has-child)")).indexOf(e.node);this.triggerEvents(i,e),e.event.preventDefault()}},e.prototype.triggerEvents=function(e,t){var i=this,n={cancel:!1,event:t?t.event:null,groupIndex:e,requestType:"resourceChange"};this.parent.trigger(We,n,function(e){e.cancel||(i.parent.uiStateValues.groupIndex=e.groupIndex,i.parent.renderModule.render(i.parent.currentView),n={cancel:!1,event:t?t.event:null,groupIndex:i.parent.uiStateValues.groupIndex,requestType:"resourceChanged"},i.parent.adaptiveGroupIndex=i.parent.uiStateValues.groupIndex,i.parent.trigger("actionComplete",n))})},e.prototype.documentClick=function(e){if(!t.closest(e.event.target,".e-resource-tree-popup")){var i=this.parent.element.querySelector(".e-resource-tree-popup");i&&i.classList.contains(rt)&&(this.treePopup.hide(),t.removeClass([this.popupOverlay],"e-enable"))}},e.prototype.bindResourcesData=function(e){var t=this;this.parent.showSpinner();for(var i=[],n=0,r=this.parent.resources;n<r.length;n++){var a=r[n],s=new mt(this.parent,a.dataSource,a.query);i.push(s.getData(s.generateQuery()))}Promise.all(i).then(function(i){return t.dataManagerSuccess(i,e)}).catch(function(e){return t.parent.crudModule.dataManagerFailure(e)})},e.prototype.dataManagerSuccess=function(e,t){if(!(!this.parent||this.parent&&this.parent.isDestroyed)){this.parent.resourceCollection=[];for(var i=0,n=e.length;i<n;i++){var r=this.parent.resources[parseInt(i.toString(),10)],a=this.getResourceModel(r,e[parseInt(i.toString(),10)].result);this.parent.resourceCollection.push(a)}this.refreshLayout(t)}},e.prototype.getResourceModel=function(e,t){return{field:e.field,title:e.title,name:e.name,allowMultiple:e.allowMultiple,dataSource:t||e.dataSource,idField:e.idField,textField:e.textField,groupIDField:e.groupIDField,colorField:e.colorField,startHourField:e.startHourField,endHourField:e.endHourField,workDaysField:e.workDaysField,expandedField:e.expandedField,cssClassField:e.cssClassField}},e.prototype.refreshLayout=function(e){!t.isNullOrUndefined(this.parent.uiStateValues.groupIndex)&&this.parent.enablePersistence||(this.parent.uiStateValues.groupIndex=0),this.parent.renderElements(e)},e.prototype.setResourceCollection=function(){var e=[];if(this.resourceCollection=[],this.colorIndex=null,this.parent.activeViewOptions.group.resources.length>0)for(var i=0,n=this.parent.activeViewOptions.group.resources;i<n.length;i++){var r=n[i],a=H(this.parent.resourceCollection,"name",r);a>=0&&e.push(this.parent.resourceCollection[parseInt(a.toString(),10)])}else this.parent.resourceCollection.length>0&&(e=this.parent.resourceCollection);for(var s=0,o=0,l=e;o<l.length;o++){var r=l[o],p=this.getResourceModel(r);r.name===this.parent.eventSettings.resourceColorField&&(this.colorIndex=s),s++,this.resourceCollection.push(p)}t.isNullOrUndefined(this.colorIndex)&&(this.colorIndex=this.resourceCollection.length-1)},e.prototype.generateResourceLevels=function(e,t){var i=this,n=this.resourceCollection,r=[],a=[],s=function(t,n,o,l,p){var c=[],h=t[0];if(h){var d=void 0;if(l&&i.parent.activeViewOptions.group.byGroupID){var u=l[o.idField];d=h.dataSource.filter(function(e){return e[h.groupIDField]===u})}else d=h.dataSource;for(var g=0;g<d.length;g++){var v=[];p&&p.length>0&&(v=v.concat(p)),v.push(d[parseInt(g.toString(),10)][h.idField]);var m=s(t.slice(1),n+1,h,d[parseInt(g.toString(),10)],v);if(!(0===n&&0===m.length&&i.resourceCollection.length>1)){var f=[],y=i.parent.activeView.renderDates,T=void 0;if(!i.parent.activeViewOptions.group.byDate&&n+1===i.resourceCollection.length){var w=d[parseInt(g.toString(),10)][h.workDaysField],D=d[parseInt(g.toString(),10)][h.startHourField],b=d[parseInt(g.toString(),10)][h.endHourField];w&&w.length>0?(y=i.parent.activeView.getRenderDates(w),T=w,f=i.parent.activeView.getDateSlots(y,w)):(T=i.parent.activeViewOptions.workDays,f=e);var C=i.generateCustomHours(f,D,b,v);a=a.concat(C)}var S=d[parseInt(g.toString(),10)][h.cssClassField],O={type:"resourceHeader",className:["e-resource-cells"],resourceLevelIndex:n,groupOrder:v,resource:h,resourceData:d[parseInt(g.toString(),10)],colSpan:i.parent.activeViewOptions.group.byDate?1:f.length,renderDates:y,workDays:T,cssClass:S,child:m};c.push(O)}}return r[parseInt(n.toString(),10)]||(r[parseInt(n.toString(),10)]=[]),c.length>0&&r[parseInt(n.toString(),10)].push(c),c}return[]};return this.resourceTreeLevel=s(n,0),t?[]:this.generateHeaderLevels(r,a,e)},e.prototype.generateCustomHours=function(e,i,n,r){for(var a=t.extend([],e,null,!0),s=0,o=a;s<o.length;s++){var l=o[s];i&&(l.startHour=this.parent.getStartEndTime(i)),n&&(l.endHour=this.parent.getStartEndTime(n)),r&&(l.groupOrder=r)}return a},e.prototype.generateHeaderLevels=function(e,i,n){for(var r=[],a=e.length-1;a>=0;a--)for(var s=0,o=0,l=e[parseInt(a.toString(),10)];o<l.length;o++)for(var p=0,c=l[o];p<c.length;p++){var h=c[p];if(e[a+1]&&e[a+1].length>0){var d=e[parseInt((a+1).toString(),10)][parseInt(s.toString(),10)];if(!d)continue;for(var u=0,g=0,v=d;g<v.length;g++){var m=v[g];(!this.parent.activeViewOptions.group.byGroupID||this.parent.activeViewOptions.group.byGroupID&&m.resourceData[m.resource.groupIDField]===h.resourceData[h.resource.idField])&&(u+=m.colSpan)}h.colSpan=u}h.groupIndex=s,s++,r[h.resourceLevelIndex]=r[h.resourceLevelIndex]||[],r[h.resourceLevelIndex].push(h)}if(this.lastResourceLevel=r.slice(-1)[0]||[],!this.parent.activeViewOptions.group.byDate){for(var f=0,y=0,T=this.lastResourceLevel;y<T.length;y++)for(var w=T[y],a=0;a<w.colSpan;a++)i[parseInt(f.toString(),10)].groupIndex=w.groupIndex,f++;return r.push(i),r}var D=[],b=t.extend([],r,null,!0),C=[];if(this.parent.activeViewOptions.group.hideNonWorkingDays){for(var S=[],O=0,E=this,x=0,V=n;x<V.length;x++)!function(e){E.resourceDateTree[parseInt(O.toString(),10)]=[];for(var i=[],n=0;n<E.lastResourceLevel.length;n++)!function(n){var r=E.lastResourceLevel[parseInt(n.toString(),10)].resourceData[E.lastResourceLevel[parseInt(n.toString(),10)].resource.workDaysField];if(r||(r=E.parent.activeViewOptions.workDays),-1!==r.indexOf(e.date.getDay())){var a=t.extend({},E.lastResourceLevel[parseInt(n.toString(),10)],null,!0);a.date=e.date,E.lastResourceLevel[parseInt(n.toString(),10)].workDays=r,a.startHour=E.parent.getStartEndTime(a.resourceData[a.resource.startHourField])||e.startHour,a.endHour=E.parent.getStartEndTime(a.resourceData[a.resource.endHourField])||e.endHour,E.resourceDateTree[parseInt(O.toString(),10)].push(a);for(var s=0;s<a.groupOrder.length;s++)!function(r){if(i[parseInt(r.toString(),10)]||(i[parseInt(r.toString(),10)]=[]),r===a.groupOrder.length-1){S[parseInt(n.toString(),10)]||(S[parseInt(n.toString(),10)]=[]);var s=a.renderDates.filter(function(t){return t.getDay()===e.date.getDay()});return S[parseInt(n.toString(),10)]=S[parseInt(n.toString(),10)].concat(s),i[parseInt(r.toString(),10)].push(a),"continue"}var o=b[parseInt(r.toString(),10)].filter(function(e){return e.resourceData[e.resource.idField]===a.groupOrder[parseInt(r.toString(),10)]});if(o&&o.length>0){var l=i[parseInt(r.toString(),10)].filter(function(e){return e.resourceData[e.resource.idField]===a.groupOrder[parseInt(r.toString(),10)]});if(l&&l.length>0)l[0].colSpan+=1;else{var p=t.extend({},o[0],null,!0);p.colSpan=1,i[parseInt(r.toString(),10)].push(p)}}}(s)}}(n);if(i.length>0){for(var r=0;r<b.length;r++)D[parseInt(r.toString(),10)]||(D[parseInt(r.toString(),10)]=[]),D[parseInt(r.toString(),10)]=D[parseInt(r.toString(),10)].concat(i[parseInt(r.toString(),10)]);e.colSpan=i[i.length-1].length,C.push(e)}O++}(H=V[x]);return this.resourceDateTree=this.resourceDateTree.filter(function(e){return e.length>0}),this.lastResourceLevel.forEach(function(e,t){S[parseInt(t.toString(),10)]&&(e.renderDates=S[parseInt(t.toString(),10)].sort(function(e,t){return e.getTime()-t.getTime()}))}),D.unshift(C),D}for(var A=0,I=0,k=b[0];I<k.length;I++)A+=k[I].colSpan;for(var M=0,R=n;M<R.length;M++){var H=R[M];H.colSpan=A,C.push(H);for(var P=t.extend([],b,null,!0),j=0,N=P.length;j<N;j++){if(j===P.length-1)for(var L=0,q=P[parseInt(j.toString(),10)];L<q.length;L++){var F=q[L];F.date=H.date,F.workDays=H.workDays,F.startHour=this.parent.getStartEndTime(F.resourceData[F.resource.startHourField])||H.startHour,F.endHour=this.parent.getStartEndTime(F.resourceData[F.resource.endHourField])||H.endHour}D[parseInt(j.toString(),10)]||(D[parseInt(j.toString(),10)]=[]),D[parseInt(j.toString(),10)]=D[parseInt(j.toString(),10)].concat(P[parseInt(j.toString(),10)])}}return D.unshift(C),D},e.prototype.setResourceValues=function(e,i){var n=this,r=function(t,i,r){n.resourceCollection[parseInt(t.toString(),10)].allowMultiple&&n.parent.activeViewOptions.group.allowGroupEdit?e[""+i]=[r]:e[""+i]=r};if(void 0===i&&(i=this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:this.parent.activeCellsData.groupIndex),this.parent.activeViewOptions.group.resources.length>0&&!t.isNullOrUndefined(i))for(var a=this.lastResourceLevel[parseInt(i.toString(),10)].groupOrder,s=0;s<this.resourceCollection.length;s++)r(s,this.resourceCollection[parseInt(s.toString(),10)].field,a[parseInt(s.toString(),10)]);else if(this.parent.resourceCollection.length>0)for(s=0;s<this.resourceCollection.length;s++){var o=this.resourceCollection[parseInt(s.toString(),10)].dataSource[0];o&&r(s,this.resourceCollection[parseInt(s.toString(),10)].field,o[this.resourceCollection[parseInt(s.toString(),10)].idField])}},e.prototype.getResourceColor=function(e,i){var n=!t.isNullOrUndefined(i)&&this.colorIndex>i.length-1?i.length-1:this.colorIndex,r=this.resourceCollection[parseInt(n.toString(),10)];if(!(t.isNullOrUndefined(i)&&this.parent.activeViewOptions.group.allowGroupEdit&&r.allowMultiple)){var a=t.isNullOrUndefined(i)?e[r.field]:i[parseInt(n.toString(),10)],s=this.filterData(r.dataSource,r.idField,a);return s.length>0?s[0][r.colorField]:void 0}},e.prototype.getCssClass=function(e){var t=this.resourceCollection.slice(-1)[0];if(!this.parent.activeViewOptions.group.allowGroupEdit||!t.allowMultiple){var i=this.filterData(t.dataSource,t.idField,e[t.field]);return i.length>0?i[0][t.cssClassField]:void 0}},e.prototype.getResourceRenderDates=function(){var e=[].concat.apply([],this.lastResourceLevel.map(function(e){return e.renderDates})),t=e.map(function(e){return e.getTime()}),i=function(e){return e.filter(function(e,i){return t.indexOf(e.getTime())===i})}(e);return i.sort(function(e,t){return e.getTime()-t.getTime()}),i},e.prototype.filterData=function(e,t,i){return e.filter(function(e){return e[""+t]===i})},e.prototype.getResourceData=function(e,i,n){if(this.parent.activeViewOptions.group.allowGroupEdit){for(var r={},a=0,s=n;a<s.length;a++)for(var o=s[a],l=this.lastResourceLevel[parseInt(o.toString(),10)].groupOrder,p=0,c=l.length;p<c;p++){var h=this.resourceCollection[parseInt(p.toString(),10)].field;t.isNullOrUndefined(r[""+h])&&(r[""+h]=[]),r[""+h].push(l[parseInt(p.toString(),10)])}e=t.extend(e,r)}else for(var p=0,d=this.resourceCollection.length;p<d;p++)this.lastResourceLevel[parseInt(i.toString(),10)]&&(e[this.resourceCollection[parseInt(p.toString(),10)].field]=this.lastResourceLevel[parseInt(i.toString(),10)].groupOrder[parseInt(p.toString(),10)])},e.prototype.addResource=function(e,t,i){for(var n=e instanceof Array?e:[e],r=0,s=this.parent.resourceCollection;r<s.length&&"break"!==function(e){if(e.name===t)return n.forEach(function(t,n){return new a.DataManager({json:e.dataSource}).insert(t,null,null,i+n)}),"break"}(s[r]);r++);this.refreshLayout(!0)},e.prototype.removeResource=function(e,t){for(var i=e instanceof Array?e:[e],n=0,r=this.parent.resourceCollection;n<r.length&&"break"!==function(e){if(e.name===t)return i.forEach(function(t){return new a.DataManager({json:e.dataSource}).remove(e.idField,t)}),"break"}(r[n]);n++);this.refreshLayout(!0)},e.prototype.getIndexFromResourceId=function(e,i,n,r,a){if(i=i||this.parent.resourceCollection.slice(-1)[0].name,t.isNullOrUndefined(n)&&(n=this.resourceCollection.filter(function(e){return e.name===i})[0],t.isNullOrUndefined(n)))return null;var s=n.dataSource.filter(function(t){return r&&t[n.idField]===e?t[n.groupIDField]===r[""+a]?t[n.idField]===e:null:t[n.idField]===e})[0];return this.lastResourceLevel.map(function(e){return e.resourceData}).indexOf(s)},e.prototype.resourceExpand=function(e,t,i){var n=this.parent.resourceCollection.filter(function(e){return e.name===t?e:null})[0],r=0,a=n.dataSource.filter(function(t){return t[n.idField]===e})[0];r=this.parent.activeViewOptions.group.byGroupID?this.lastResourceLevel.map(function(e){return e.resourceData}).indexOf(a):this.getIndexFromResourceId(e,t,n);var s=this.parent.element.querySelector('.e-resource-column-wrap [data-group-index="'+r+'"] .e-resource-tree-icon');s&&(s.classList.contains("e-resource-expand")&&!i?s.click():s.classList.contains("e-resource-collapse")&&i&&s.click())},e.prototype.resourceScroll=function(e,t){if(!(this.parent.isAdaptive||["Agenda","MonthAgenda"].indexOf(this.parent.currentView)>-1)){var i=t||this.parent.resourceCollection.slice(-1)[0].name,n=this.parent.resourceCollection.length-1,r=this.parent.resourceCollection.filter(function(e,t){return e.name===i?(n=t,e):null})[0],a=this.parent.element.querySelector(".e-content-wrap"),s=0;if(this.parent.activeView.isTimelineView()){if(this.parent.activeViewOptions.group.byGroupID){var o=r.dataSource.filter(function(t){return t[r.idField]===e})[0];s=this.lastResourceLevel.map(function(e){return e.resourceData}).indexOf(o)}else s=this.getIndexFromResourceId(e,i,r);if(this.parent.virtualScrollModule){var l=this.parent.element.querySelector(".e-virtual-track"),p=Math.round(l.offsetHeight/this.expandedResources.length);this.parent.rowAutoHeight&&(a.scrollTop=0,this.parent.virtualScrollModule.virtualScrolling()),a.scrollTop=s*p-(this.parent.virtualScrollModule.bufferCount-1)*p,this.parent.virtualScrollModule.virtualScrolling(),this.parent.rowAutoHeight?(c=this.parent.element.querySelector('.e-work-cells[data-group-index="'+s+'"]'))&&!c.parentElement.classList.contains("e-hidden")&&(a.scrollTop=a.scrollTop<c.offsetTop?c.offsetTop:a.scrollTop+c.offsetTop):a.scrollTop=s*p}else{var c=this.parent.element.querySelector('.e-work-cells[data-group-index="'+s+'"]');c&&!c.parentElement.classList.contains("e-hidden")&&(a.scrollTop=c.offsetTop)}}else{s=this.parent.activeViewOptions.group.byGroupID?i===this.parent.resourceCollection.slice(-1)[0].name?this.lastResourceLevel.map(function(e){return e.resourceData[r.idField]}).indexOf(e):r.dataSource.map(function(e){return e[r.idField]}).indexOf(e):this.getIndexFromResourceId(e,i,r);var h="Month"===this.parent.currentView?this.parent.element.querySelector(".e-date-header-wrap tbody tr:nth-child("+(n+1)+")"):this.parent.element.querySelector(".e-header-row:nth-child("+(n+1)+")"),d=[].slice.call(h.children).map(function(e){return e.offsetLeft});a.scrollLeft=d[parseInt(s.toString(),10)]}}},e.prototype.destroy=function(){if(this.parent.off("document-click",this.documentClick),this.treeViewObj){if(this.treeViewObj.portals&&this.treeViewObj.portals.length>0){var e=this.treeViewObj.portals.map(function(e){return e.propName});e.length>0&&this.parent.resetTemplates(e)}this.treeViewObj.destroy(),this.treeViewObj=null}this.treePopup&&(this.treePopup.destroy(),this.treePopup=null,t.remove(this.parent.element.querySelector(".e-resource-tree-popup")),t.remove(this.parent.element.querySelector(".e-resource-tree-popup-overlay")));var i=this.parent.element.querySelector(".e-schedule-resource-toolbar-container");i&&t.remove(i)},e}(),_i=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Gi=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},Xi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _i(i,e),Gi([t.Property("")],i.prototype,"id",void 0),Gi([t.Property("")],i.prototype,"text",void 0),Gi([t.Property("auto")],i.prototype,"width",void 0),Gi([t.Property("")],i.prototype,"cssClass",void 0),Gi([t.Property(!1)],i.prototype,"showAlwaysInPopup",void 0),Gi([t.Property(!1)],i.prototype,"disabled",void 0),Gi([t.Property("")],i.prototype,"prefixIcon",void 0),Gi([t.Property("")],i.prototype,"suffixIcon",void 0),Gi([t.Property(!0)],i.prototype,"visible",void 0),Gi([t.Property("None")],i.prototype,"overflow",void 0),Gi([t.Property("")],i.prototype,"template",void 0),Gi([t.Property("Button")],i.prototype,"type",void 0),Gi([t.Property("Both")],i.prototype,"showTextOn",void 0),Gi([t.Property(null)],i.prototype,"htmlAttributes",void 0),Gi([t.Property("")],i.prototype,"tooltipText",void 0),Gi([t.Property("Left")],i.prototype,"align",void 0),Gi([t.Property(-1)],i.prototype,"tabIndex",void 0),Gi([t.Property("Custom")],i.prototype,"name",void 0),Gi([t.Event()],i.prototype,"click",void 0),i}(t.ChildProperty),Qi=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ki=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},Zi=function(e){function n(t,i){var n=e.call(this,t,i)||this;return n.adaptiveGroupIndex=0,n}return Qi(n,e),n.prototype.render=function(){var e=[],n=[];if(e.push($e),this.enableRtl?e.push("e-rtl"):n.push("e-rtl"),this.isAdaptive?e.push("e-device"):n.push("e-device"),this.enableAdaptiveUI?e.push("e-adaptive"):n.push("e-adaptive"),this.allowMultiDrag?e.push("e-multi-drag"):n.push("e-multi-drag"),this.cssClass)for(var r=0,a=this.cssClass.split(" ");r<a.length;r++){var s=a[r];e.push(s)}t.classList(this.element,e,n),this.validateDate(),i.createSpinner({target:this.element}),this.scrollModule=new dt(this),this.scrollModule.setWidth(),this.scrollModule.setHeight(),this.renderModule=new vi(this),this.eventBase=new Lt(this),this.workCellAction=new Ai(this),this.allowKeyboardInteraction&&(this.keyboardInteractionModule=new vt(this)),this.inlineModule=new Yt(this),this.initializeDataModule(),this.renderTableContainer(),this.activeViewOptions=this.getActiveViewOptions(),this.initializeResources(),this.wireEvents()},n.prototype.renderTableContainer=function(){this.element.querySelector("."+tt)||this.element.appendChild(this.createElement("div",{className:tt}))},n.prototype.getEventTemplateName=function(e){var t="eventTemplate_"+e;return this.activeEventTemplates.indexOf(t)<0&&this.activeEventTemplates.push(t),t},n.prototype.getElementWidth=function(e){return B(e,this.uiStateValues.isTransformed)},n.prototype.getElementHeight=function(e){return W(e,this.uiStateValues.isTransformed)},n.prototype.getElementHeightFromClass=function(e,t){return h(e,t,this.uiStateValues.isTransformed)},n.prototype.renderTemplates=function(e){this.isReact?this.renderReactTemplates(e):e&&e()},n.prototype.resetTemplates=function(e){(this.isAngular||this.isReact)&&this.clearTemplate(e)},n.prototype.sanitize=function(e,i){this.enableHtmlSanitizer?i.innerText=t.SanitizeHtmlHelper.sanitize(e):i.innerHTML=e},n.prototype.initializeResources=function(e){void 0===e&&(e=!1),this.resources.length>0?(this.resourceBase=new Yi(this),this.resourceBase.bindResourcesData(e)):(this.resourceBase=null,this.resourceCollection=[],this.renderElements(e))},n.prototype.destroyEditorWindow=function(){this.eventWindow&&(this.eventWindow.destroy(),this.eventWindow=null),this.eventWindow=new ui(this)},n.prototype.renderElements=function(e){if(e)return this.initializeView(this.currentView),void this.eventWindow.refresh();this.destroyHeaderModule(),this.showHeaderBar&&(this.headerModule=new ht(this)),this.renderTableContainer(),this.uiStateValues.isTransformed=Math.round(this.element.getBoundingClientRect().width)!==this.element.offsetWidth,(t.Browser.isDevice||t.Browser.isTouch)&&(this.scheduleTouchModule=new ut(this)),this.initializeView(this.currentView),this.destroyPopups(),this.isPrinting||this.initializePopups()},n.prototype.validateDate=function(e){void 0===e&&(e=this.selectedDate);var i=e instanceof Date?new Date(e.getTime()):new Date(e),n=t.isNullOrUndefined(this.minDate)?new Date(1900,0,1):this.minDate instanceof Date?new Date(this.minDate.getTime()):new Date(this.minDate),r=t.isNullOrUndefined(this.maxDate)?new Date(2099,11,31):this.maxDate instanceof Date?new Date(this.maxDate.getTime()):new Date(this.maxDate);if(!(n<=r))throw Error("minDate should be equal or less than maxDate");i<n&&(i=n),i>r&&(i=r),this.setProperties({selectedDate:new Date(""+i),minDate:new Date(""+n),maxDate:new Date(""+r)},!0),this.eventWindow&&this.eventWindow.updateMinMaxDateToEditor()},n.prototype.getViewIndex=function(e){for(var t=0;t<this.viewCollections.length;t++)if(this.viewCollections[parseInt(t.toString(),10)].option===e)return t;return-1},n.prototype.setViewOptions=function(e){if(void 0===e&&(e=!1),!t.isNullOrUndefined(this.views)&&0!==this.views.length){this.viewOptions={},this.viewCollections=[];var i,n,r=this.viewIndex,a=0;this.viewIndex=-1;for(var s=0,o=this.views;s<o.length;s++){var l=o[s],p="string"!=typeof l;"string"==typeof l?(i=l,this.currentView===i&&(n=i,this.viewIndex=a)):(i=l.option,l.isSelected&&(n=i,this.viewIndex=a));var c=t.extend({option:i},p?l:{}),h=i.charAt(0).toLowerCase()+i.slice(1);c.cellHeaderTemplateName=c.cellHeaderTemplate?c.option:"",c.dateHeaderTemplateName=c.dateHeaderTemplate?c.option:"",c.dateRangeTemplateName=c.dateRangeTemplate?c.option:"",c.cellTemplateName=c.cellTemplate?c.option:"",c.dayHeaderTemplateName=c.dayHeaderTemplate?c.option:"",c.monthHeaderTemplateName=c.monthHeaderTemplate?c.option:"",c.resourceHeaderTemplateName=c.resourceHeaderTemplate?c.option:"",c.headerIndentTemplateName=c.headerIndentTemplate?c.option:"",c.eventTemplateName=c.eventTemplate?c.option:"",t.isNullOrUndefined(c.firstDayOfWeek)||0!==c.firstDayOfWeek||delete c.firstDayOfWeek,t.isNullOrUndefined(c.interval)||1!==c.interval||delete c.interval,this.viewCollections.push(c),t.isNullOrUndefined(this.viewOptions[""+h])?this.viewOptions[""+h]=[c]:this.viewOptions[""+h].push(c),a++}if(!e&&n&&this.setProperties({currentView:n},!0),-1===this.viewIndex){var d=this.getViewIndex(this.currentView);this.viewIndex="string"==typeof this.views[0]||t.isNullOrUndefined(r)||-1===r?-1===d?0:d:r}}},n.prototype.getActiveViewOptions=function(){var e={enable:this.timeScale.enable,interval:this.timeScale.interval,slotCount:this.timeScale.slotCount,majorSlotTemplate:this.timeScale.majorSlotTemplate,minorSlotTemplate:this.timeScale.minorSlotTemplate},i={byDate:!(this.viewCollections[this.viewIndex].option.indexOf("Year")>-1)&&this.group.byDate,byGroupID:this.group.byGroupID,allowGroupEdit:this.group.allowGroupEdit,resources:t.isNullOrUndefined(this.group.resources)?[]:this.group.resources,headerTooltipTemplate:this.group.headerTooltipTemplate,enableCompactView:this.group.enableCompactView,hideNonWorkingDays:["Day","Week","WorkWeek","Month"].indexOf(this.currentView)>-1&&this.group.hideNonWorkingDays},n=this.viewCollections[this.viewIndex].workDays?[]:this.workDays,r={dateFormat:this.dateFormat,endHour:this.endHour,isSelected:!1,option:null,readonly:this.readonly,startHour:this.startHour,allowVirtualScrolling:!1,allowOverlap:this.allowOverlap,overscanCount:this.overscanCount,cellHeaderTemplate:this.cellHeaderTemplate,dayHeaderTemplate:this.dayHeaderTemplate,monthHeaderTemplate:this.monthHeaderTemplate,cellTemplate:this.cellTemplate,eventTemplate:this.eventSettings.template,dateHeaderTemplate:this.dateHeaderTemplate,dateRangeTemplate:this.dateRangeTemplate,resourceHeaderTemplate:this.resourceHeaderTemplate,headerIndentTemplate:this.headerIndentTemplate,firstMonthOfYear:this.firstMonthOfYear,firstDayOfWeek:this.firstDayOfWeek,workDays:n,monthsCount:this.monthsCount,showWeekend:this.showWeekend,showWeekNumber:this.showWeekNumber,displayName:null,interval:1,timeScale:e,timeFormat:this.internalTimeFormat,group:i,headerRows:this.headerRows,orientation:"Horizontal",numberOfWeeks:0,displayDate:null,enableLazyLoading:!1},a=this.viewCollections[this.viewIndex],s=t.extend(r,a,void 0,!0);return 0!==this.firstDayOfWeek&&a.firstDayOfWeek&&this.firstDayOfWeek!==a.firstDayOfWeek&&(s.firstDayOfWeek=this.firstDayOfWeek),s.displayDate&&(s.displayDate=s.displayDate instanceof Date?new Date(s.displayDate.getTime()):new Date(s.displayDate)),s.enableLazyLoading&&!t.isNullOrUndefined(s.group.resources)&&s.group.resources.length>0&&(-1===["Agenda","MonthAgenda","Year","TimelineYear"].indexOf(s.option)||"TimelineYear"===s.option&&"Vertical"===s.orientation)&&(s.allowVirtualScrolling=!0),s},n.prototype.initializeDataModule=function(){this.eventFields={id:this.eventSettings.fields.id,isBlock:this.eventSettings.fields.isBlock,subject:this.eventSettings.fields.subject.name,startTime:this.eventSettings.fields.startTime.name,endTime:this.eventSettings.fields.endTime.name,startTimezone:this.eventSettings.fields.startTimezone.name,endTimezone:this.eventSettings.fields.endTimezone.name,location:this.eventSettings.fields.location.name,description:this.eventSettings.fields.description.name,isAllDay:this.eventSettings.fields.isAllDay.name,recurrenceID:this.eventSettings.fields.recurrenceID.name,recurrenceRule:this.eventSettings.fields.recurrenceRule.name,recurrenceException:this.eventSettings.fields.recurrenceException.name,isReadonly:this.eventSettings.fields.isReadonly,followingID:this.eventSettings.fields.followingID},this.setEditorTitles(),this.dataModule=new mt(this,this.eventSettings.dataSource,this.eventSettings.query),this.crudModule=new Vi(this)},n.prototype.setEditorTitles=function(){this.editorTitles={subject:this.eventSettings.fields.subject.title||this.localeObj.getConstant("title"),startTime:this.eventSettings.fields.startTime.title||this.localeObj.getConstant("start"),endTime:this.eventSettings.fields.endTime.title||this.localeObj.getConstant("end"),isAllDay:this.eventSettings.fields.isAllDay.title||this.localeObj.getConstant("allDay"),startTimezone:this.eventSettings.fields.startTimezone.title||this.localeObj.getConstant("startTimezone"),endTimezone:this.eventSettings.fields.endTimezone.title||this.localeObj.getConstant("endTimezone"),location:this.eventSettings.fields.location.title||this.localeObj.getConstant("location"),description:this.eventSettings.fields.description.title||this.localeObj.getConstant("description"),recurrenceRule:this.eventSettings.fields.recurrenceRule.title||this.localeObj.getConstant("repeat")}},n.prototype.initializeView=function(e){this.showSpinner(),this.activeViewOptions=this.getActiveViewOptions(),this.resourceBase&&this.resourceBase.setResourceCollection(),this.initializeTemplates(),this.renderModule.render(e)},n.prototype.initializeTemplates=function(){this.cellHeaderTemplateFn=this.templateParser(this.activeViewOptions.cellHeaderTemplate),this.dayHeaderTemplateFn=this.templateParser(this.activeViewOptions.dayHeaderTemplate),this.monthHeaderTemplateFn=this.templateParser(this.activeViewOptions.monthHeaderTemplate),this.cellTemplateFn=this.templateParser(this.activeViewOptions.cellTemplate),this.dateHeaderTemplateFn=this.templateParser(this.activeViewOptions.dateHeaderTemplate),this.dateRangeTemplateFn=this.templateParser(this.activeViewOptions.dateRangeTemplate),this.majorSlotTemplateFn=this.templateParser(this.activeViewOptions.timeScale.majorSlotTemplate),this.minorSlotTemplateFn=this.templateParser(this.activeViewOptions.timeScale.minorSlotTemplate),this.appointmentTemplateFn=this.templateParser(this.activeViewOptions.eventTemplate),this.resourceHeaderTemplateFn=this.templateParser(this.activeViewOptions.resourceHeaderTemplate),this.headerIndentTemplateFn=this.templateParser(this.activeViewOptions.headerIndentTemplate),this.headerTooltipTemplateFn=this.templateParser(this.activeViewOptions.group.headerTooltipTemplate),this.eventTooltipTemplateFn=this.templateParser(this.eventSettings.tooltipTemplate),this.editorTemplateFn=this.templateParser(this.editorTemplate),this.editorHeaderTemplateFn=this.templateParser(this.editorHeaderTemplate),this.editorFooterTemplateFn=this.templateParser(this.editorFooterTemplate),this.quickInfoTemplatesHeaderFn=this.templateParser(this.quickInfoTemplates.header),this.quickInfoTemplatesContentFn=this.templateParser(this.quickInfoTemplates.content),this.quickInfoTemplatesFooterFn=this.templateParser(this.quickInfoTemplates.footer)},n.prototype.initializePopups=function(){this.eventWindow=new ui(this),this.quickPopup=new Gt(this)},n.prototype.getDayNames=function(e){var i,n=[],r="";t.isNullOrUndefined(this.locale)||"en"===this.locale||"en-US"===this.locale?(r="days.stand-alone.",i=t.getValue(r+e,t.getDefaultDateObject(this.getCalendarMode()))):(r="main."+this.locale+".dates.calendars."+this.getCalendarMode()+".days.format."+e,i=t.getValue(r,t.cldrData));for(var a=0,s=Object.keys(i);a<s.length;a++){var o=s[a];n.push(t.getValue(o,i))}return n},n.prototype.setCldrTimeFormat=function(){if(!t.isNullOrUndefined(this.timeFormat))return void(this.internalTimeFormat=this.timeFormat);t.isNullOrUndefined(this.locale)||"en"===this.locale||"en-US"===this.locale?this.internalTimeFormat=t.getValue("timeFormats.short",t.getDefaultDateObject(this.getCalendarMode())):this.internalTimeFormat=t.getValue("main."+this.locale+".dates.calendars."+this.getCalendarMode()+".timeFormats.short",t.cldrData)},n.prototype.getCalendarMode=function(){return t.isNullOrUndefined(this.calendarMode)?"gregorian":this.calendarMode.toLowerCase()},n.prototype.getTimeString=function(e){return this.globalize.formatDate(e,{format:this.activeViewOptions.timeFormat,type:"time",calendar:this.getCalendarMode()}).toLocaleUpperCase()},n.prototype.getDateTime=function(e){return e instanceof Date?new Date(e.getTime()):new Date(e)},n.prototype.setCalendarMode=function(){"Islamic"===this.calendarMode?this.calendarUtil=new yt:this.calendarUtil=new ft},n.prototype.changeView=function(e,i,n,r){var a=this;if(t.isNullOrUndefined(r)&&(r=this.getViewIndex(e)),!(!n&&r===this.viewIndex&&this.currentView===e||r<0)){var s=this.activeViewOptions?this.activeViewOptions.option:this.currentView,o={requestType:"viewNavigate",cancel:!1,event:i};this.trigger(We,o,function(t){if(t.cancel)a.currentView=s;else{var n={action:"view",cancel:!1,currentDate:a.selectedDate,previousView:s,currentView:e,viewIndex:r};a.trigger("navigating",n,function(t){if(t.cancel)a.currentView=s;else{var n=["Day","Week","WorkWeek"].indexOf(e)>-1&&["Day","Week","WorkWeek"].indexOf(s)<0;a.uiStateValues.isInitial=n||e.indexOf("Timeline")>-1||e.indexOf("Year")>-1,a.uiStateValues.top=e.indexOf("Timeline")>-1&&s.indexOf("Timeline")<0?0:a.uiStateValues.top,a.viewIndex=t.viewIndex,a.setProperties({currentView:e},!0),a.headerModule&&(a.headerModule.updateActiveView(),a.headerModule.setCalendarDate(a.selectedDate),a.headerModule.setCalendarView()),a.initializeView(a.currentView),a.animateLayout(),o={requestType:"viewNavigate",cancel:!1,event:i},a.trigger("actionComplete",o)}})}})}},n.prototype.changeDate=function(e,t){var i=this,n={requestType:"dateNavigate",cancel:!1,event:t};this.trigger(We,n,function(r){if(!r.cancel){var a={action:"date",cancel:!1,previousDate:i.selectedDate,currentDate:e};i.trigger("navigating",a,function(e){e.cancel||(i.uiStateValues.isInitial=i.activeView.isTimelineView()&&"TimelineYear"!==i.currentView,i.validateDate(e.currentDate),i.headerModule&&i.headerModule.setCalendarDate(e.currentDate),"MonthAgenda"===i.currentView&&i.monthAgendaModule&&(i.monthAgendaModule.monthAgendaDate=new Date(""+i.selectedDate)),i.initializeView(i.currentView),i.animateLayout(),n={requestType:"dateNavigate",cancel:!1,event:t},i.trigger("actionComplete",n))})}})},n.prototype.isMinMaxDate=function(e){void 0===e&&(e=this.selectedDate);var i=t.isNullOrUndefined(this.maxDate)?new Date(2099,11,31):this.maxDate,n=t.isNullOrUndefined(this.minDate)?new Date(1900,0,1):this.minDate;return e.getTime()>=n.getTime()&&e.getTime()<=i.getTime()},n.prototype.isSelectedDate=function(e){return e.setHours(0,0,0,0)===new Date(""+this.selectedDate).setHours(0,0,0,0)},n.prototype.getCurrentTime=function(e){return void 0===e&&(e=new Date),this.timezone?this.tzModule.convert(e,this.tzModule.getLocalTimezoneName(),this.timezone):e},n.prototype.getNavigateView=function(){return this.activeView.isTimelineView()?"TimelineMonth"===this.currentView||"TimelineYear"===this.currentView?"TimelineDay":"Agenda":"Day"},n.prototype.animateLayout=function(){this.activeView.element&&new t.Animation({duration:600,name:"FadeIn",timingFunction:"easeIn"}).animate(this.activeView.element)},n.prototype.requiredModules=function(){var e=[];this.setViewOptions(!0);for(var t=0,i=Object.keys(this.viewOptions);t<i.length;t++){var n=i[t];n="timelineDay"===n||"timelineWeek"===n||"timelineWorkWeek"===n?"timelineViews":n,e.push({member:n,args:[this]})}return this.allowDragAndDrop&&e.push({member:"dragAndDrop",args:[this]}),this.allowResizing&&e.push({member:"resize",args:[this]}),e.push({member:"excelExport",args:[this]}),e.push({member:"iCalendarExport",args:[this]}),e.push({member:"iCalendarImport",args:[this]}),e.push({member:"print",args:[this]}),e},n.prototype.preRender=function(){this.isAdaptive=t.Browser.isDevice||F(),this.globalize=new t.Internationalization(this.locale),this.tzModule=new Tt,(this&&t.isNullOrUndefined(this.uiStateValues)||!this.enablePersistence)&&(this.uiStateValues={expand:!1,isInitial:!0,left:0,top:0,isGroupAdaptive:!1,isIgnoreOccurrence:!1,groupIndex:this.adaptiveGroupIndex,action:!1,isBlock:!1,isCustomMonth:!0,isPreventTimezone:!1,isTransformed:!1}),this.currentTimezoneDate=this.getCurrentTime(),this.activeCellsData={startTime:new Date(this.currentTimezoneDate),endTime:new Date(this.currentTimezoneDate),isAllDay:!1},this.activeEventData={event:void 0,element:void 0},this.getDefaultLocale(),this.localeObj=new t.L10n(this.getModuleName(),this.defaultLocale,this.locale),this.setCldrTimeFormat(),this.setCalendarMode(),this.eventsData=[],this.eventsProcessed=[],this.blockData=[],this.blockProcessed=[],this.resourceCollection=[],this.currentAction=null,this.selectedElements=[],this.activeEventTemplates=[],this.setViewOptions()},n.prototype.getDefaultLocale=function(){this.defaultLocale={day:"Day",week:"Week",workWeek:"Work Week",month:"Month",year:"Year",agenda:"Agenda",weekAgenda:"Week Agenda",workWeekAgenda:"Work Week Agenda",monthAgenda:"Month Agenda",today:"Today",noEvents:"No events",emptyContainer:"There are no events scheduled on this day.",allDay:"All day",start:"Start",end:"End",more:"more",close:"Close",cancel:"Cancel",noTitle:"(No Title)",delete:"Delete",deleteEvent:"Delete Event",deleteMultipleEvent:"Delete Multiple Events",selectedItems:"Items selected",deleteSeries:"Entire Series",edit:"Edit",editSeries:"Entire Series",editEvent:"Edit Event",createEvent:"Create",subject:"Subject",addTitle:"Add title",moreDetails:"More Details",moreEvents:"More Events",save:"Save",editContent:"How would you like to change the appointment in the series?",deleteContent:"Are you sure you want to delete this event?",deleteMultipleContent:"Are you sure you want to delete the selected events?",newEvent:"New Event",title:"Title",location:"Location",description:"Description",timezone:"Timezone",startTimezone:"Start Timezone",endTimezone:"End Timezone",repeat:"Repeat",saveButton:"Save",cancelButton:"Cancel",deleteButton:"Delete",recurrence:"Recurrence",wrongPattern:"The recurrence pattern is not valid.",seriesChangeAlert:"Do you want to cancel the changes made to specific instances of this series and match it to the whole series again?",createError:"The duration of the event must be shorter than how frequently it occurs. Shorten the duration, or change the recurrence pattern in the recurrence event editor.",sameDayAlert:"Two occurrences of the same event cannot occur on the same day.",occurenceAlert:"Cannot reschedule an occurrence of the recurring appointment if it skips over a later occurrence of the same appointment.",editRecurrence:"Edit Recurrence",recurringEvent:"Recurring Event",repeats:"Repeats",alert:"Alert",startEndError:"The selected end date occurs before the start date.",invalidDateError:"The entered date value is invalid.",blockAlert:"Events cannot be scheduled within the blocked time range.",overlapAlert:"Events cannot be scheduled during the chosen time as it overlaps with another event.",ok:"Ok",yes:"Yes",no:"No",of:"of",occurrence:"Occurrence",series:"Series",previous:"Previous",next:"Next",timelineDay:"Timeline Day",timelineWeek:"Timeline Week",timelineWorkWeek:"Timeline Work Week",timelineMonth:"Timeline Month",timelineYear:"Timeline Year",editFollowingEvent:"Following Events",deleteTitle:"Delete Event",editTitle:"Edit Event",beginFrom:"Begin From",endAt:"Ends At",expandAllDaySection:"Expand-all-day-section",collapseAllDaySection:"Collapse-all-day-section",searchTimezone:"Search Timezone",noRecords:"No records found"}},n.prototype.wireEvents=function(){t.EventHandler.add(window,"resize",this.onScheduleResize,this),t.EventHandler.add(window,"orientationchange",this.onScheduleResize,this),t.EventHandler.add(document,t.Browser.touchStartEvent,this.onDocumentClick,this),this.allowClipboard&&t.EventHandler.add(document,"paste",this.onDocumentPaste,this)},n.prototype.removeSelectedClass=function(){for(var e=this.getSelectedCells(),i=0,n=e;i<n.length;i++)n[i].removeAttribute("tabindex");t.removeClass(e,"e-selected-cell"),this.keyboardInteractionModule&&this.keyboardInteractionModule.selectedCells.length>0&&(this.keyboardInteractionModule.selectedCells=[])},n.prototype.addSelectedClass=function(e,i,n){t.addClass(e,"e-selected-cell"),i&&(i.setAttribute("tabindex","0"),i.focus({preventScroll:n||!1}))},n.prototype.selectCell=function(e){this.removeSelectedClass(),this.addSelectedClass([e],e)},n.prototype.getAllDayRow=function(){return this.element.querySelector(".e-all-day-row")},n.prototype.getContentTable=function(){return this.activeView.element.querySelector("."+nt+" tbody")},n.prototype.getTableRows=function(){return[].slice.call(this.element.querySelectorAll("."+nt+" tbody tr:not(.e-hidden)"))},n.prototype.getWorkCellElements=function(){return[].slice.call(this.element.querySelectorAll(".e-work-cells"))},n.prototype.getIndexOfDate=function(e,t){return e.map(Number).indexOf(+t)},n.prototype.isAllDayCell=function(e){return!(!(["Month","TimelineMonth","TimelineYear","MonthAgenda"].indexOf(this.currentView)>-1||e.classList.contains("e-all-day-cells")||e.classList.contains("e-header-cells"))&&this.activeViewOptions.timeScale.enable)||!!(this.activeView.isTimelineView()&&this.activeViewOptions.headerRows.length>0&&"Hour"!==this.activeViewOptions.headerRows.slice(-1)[0].option)},n.prototype.getDateFromElement=function(e){var i;if(t.isNullOrUndefined(e)||(i=e.getAttribute("data-date")),!t.isNullOrUndefined(i)){var n=parseInt(i,10);return new Date(n)}},n.prototype.getTargetElement=function(e,t,i){var n,r=document.elementFromPoint(t,i);return r&&(n=r.closest(e)),n?[n]:null},n.prototype.getCellHeaderTemplate=function(){return this.cellHeaderTemplateFn},n.prototype.getDayHeaderTemplate=function(){return this.dayHeaderTemplateFn},n.prototype.getMonthHeaderTemplate=function(){return this.monthHeaderTemplateFn},n.prototype.getCellTemplate=function(){return this.cellTemplateFn},n.prototype.getDateHeaderTemplate=function(){return this.dateHeaderTemplateFn},n.prototype.getDateRangeTemplate=function(){return this.dateRangeTemplateFn},n.prototype.getMajorSlotTemplate=function(){return this.majorSlotTemplateFn},n.prototype.getMinorSlotTemplate=function(){return this.minorSlotTemplateFn},n.prototype.getAppointmentTemplate=function(){return this.appointmentTemplateFn},n.prototype.getEventTooltipTemplate=function(){return this.eventTooltipTemplateFn},n.prototype.getHeaderTooltipTemplate=function(){return this.headerTooltipTemplateFn},n.prototype.getEditorTemplate=function(){return this.editorTemplateFn},n.prototype.getEditorHeaderTemplate=function(){return this.editorHeaderTemplateFn},n.prototype.getEditorFooterTemplate=function(){return this.editorFooterTemplateFn},n.prototype.getQuickInfoTemplatesHeader=function(){return this.quickInfoTemplatesHeaderFn},n.prototype.getQuickInfoTemplatesContent=function(){return this.quickInfoTemplatesContentFn},n.prototype.getQuickInfoTemplatesFooter=function(){return this.quickInfoTemplatesFooterFn},n.prototype.getResourceHeaderTemplate=function(){return this.resourceHeaderTemplateFn},n.prototype.getHeaderIndentTemplate=function(){return this.headerIndentTemplateFn},n.prototype.getCssProperties=function(){return{border:this.enableRtl?"borderLeftWidth":"borderRightWidth",padding:this.enableRtl?"paddingLeft":"paddingRight",rtlBorder:this.enableRtl?"borderRightWidth":"borderLeftWidth",rtlPadding:this.enableRtl?"paddingRight":"paddingLeft"}},n.prototype.removeNewEventElement=function(){var e=this.element.querySelector(".e-new-event");t.isNullOrUndefined(e)||t.remove(e)},n.prototype.getStartEndTime=function(e){if(!t.isNullOrUndefined(e)&&""!==e){var i=b(new Date(this.currentTimezoneDate)||this.getCurrentTime()),n=e.split(":");return 2===n.length&&i.setHours(parseInt(n[0],10),parseInt(n[1],10),0),i}return null},n.prototype.onDocumentClick=function(e){this.notify("document-click",{event:e})},n.prototype.onDocumentPaste=function(e){this.notify("document-paste",{event:e})},n.prototype.onScheduleResize=function(){if(!(t.isNullOrUndefined(this.activeView)||(this.isAdaptive||q())&&document.activeElement&&(document.activeElement.classList.contains("e-subject")||document.activeElement.classList.contains("e-inline-subject"))||this.uiStateValues.isTapHold))if(this.virtualScrollModule&&this.activeView.isTimelineView()&&this.virtualScrollModule.refreshLayout(),this.activeViewOptions.timeScale.enable&&this.activeView&&this.activeView.highlightCurrentTime(),this.quickPopup&&this.quickPopup.onClosePopup(),R(),"Month"===this.currentView||"Agenda"!==this.currentView&&"MonthAgenda"!==this.currentView&&!this.activeViewOptions.timeScale.enable||this.activeView.isTimelineView()){this.activeView.resetColWidth(),this.notify(Xe,{cssProperties:this.getCssProperties(),isPreventScrollUpdate:!0});var e=!1;if(this.activeViewOptions.enableLazyLoading&&this.virtualScrollModule&&this.virtualScrollModule.isRemoteRefresh&&(e=this.virtualScrollModule.isRemoteRefresh,this.virtualScrollModule.isRemoteRefresh=!1),this.refreshEvents(e),this.virtualScrollModule&&!this.virtualScrollModule.enableTransition){var i=this.element.querySelector(".e-resource-column-wrap"),n=this.element.querySelector(".e-content-wrap");this.virtualScrollModule.enableTransition=!0,t.addClass([n,i],"e-transition")}}else this.notify(Ge,{})},n.prototype.templateParser=function(e){if(e)try{return"function"==typeof e?t.compile(e):document.querySelectorAll(e).length?t.compile(document.querySelector(e).innerHTML.trim()):t.compile(e)}catch(i){return t.compile(e)}},n.prototype.getSelectedCells=function(){return[].slice.call(this.element.querySelectorAll(".e-selected-cell"))},n.prototype.getAnnouncementString=function(e,t){var i;if(this.quickPopup&&this.activeViewOptions.group.resources.length>0){i=this.quickPopup.getResourceText({event:e},"event")+'"s event - '}var n=t||e[this.eventFields.subject]||this.eventSettings.fields.subject.default,r=e[this.eventFields.location]||this.eventSettings.fields.location.default,a=this.globalize.formatDate(e[this.eventFields.startTime],{type:"dateTime",skeleton:"full",calendar:this.getCalendarMode()}),s=this.globalize.formatDate(e[this.eventFields.endTime],{type:"dateTime",skeleton:"full",calendar:this.getCalendarMode()}),o=n+" "+this.localeObj.getConstant("beginFrom")+" "+a+" "+this.localeObj.getConstant("endAt")+" "+s;return i&&(o=i+" "+o),r&&""!==r&&(o=o+" "+this.localeObj.getConstant("location")+" "+r),e[this.eventFields.recurrenceRule]&&""!==e[this.eventFields.recurrenceRule]&&e[this.eventFields.id]===e[this.eventFields.recurrenceID]&&(o=o+" "+this.localeObj.getConstant("recurringEvent")),o},n.prototype.boundaryValidation=function(e,t){var i={left:!1,right:!1,top:!1,bottom:!1},n=this.element.querySelector(".e-content-wrap").getBoundingClientRect();return e<n.top+30+window.pageYOffset&&e>n.top+window.pageYOffset&&(i.top=!0),e>n.bottom-30+window.pageYOffset&&e<n.bottom+window.pageYOffset&&(i.bottom=!0),t<n.left+30+window.pageXOffset&&t>n.left+window.pageXOffset&&(i.left=!0),t>n.right-30+window.pageXOffset&&t<n.right+window.pageXOffset&&(i.right=!0),i},n.prototype.getWeekNumberContent=function(e){var t;if("FirstDay"===this.weekRule){var i=m(e.slice(-1)[0],this.firstDayOfWeek);t=this.globalize.formatNumber(T(i))}else if("FirstFourDayWeek"===this.weekRule){var n=w(r=v(e.slice(-1)[0],this.firstDayOfWeek),m(e.slice(-1)[0],this.firstDayOfWeek));t=this.globalize.formatNumber(T(n))}else if("FirstFullWeek"===this.weekRule){var r=v(e.slice(-1)[0],this.firstDayOfWeek);t=this.globalize.formatNumber(T(r))}return t},n.prototype.renderHeaderIndentTemplate=function(e,i){if(this.activeViewOptions.headerIndentTemplate){var n=this.element.id+"_"+this.activeViewOptions.headerIndentTemplateName+"headerIndentTemplate",r=[].slice.call(this.getHeaderIndentTemplate()(e,this,"headerIndentTemplate",n,!1,void 0,void 0,this.root));t.append(r,i)}},n.prototype.isSpecificResourceEvents=function(){return this.activeViewOptions.group.resources.length>0&&!this.activeViewOptions.group.allowGroupEdit&&!this.rowAutoHeight&&!this.virtualScrollModule&&this.activeViewOptions.group.byGroupID},n.prototype.unWireEvents=function(){t.EventHandler.remove(window,"resize",this.onScheduleResize),t.EventHandler.remove(window,"orientationchange",this.onScheduleResize),t.EventHandler.remove(document,t.Browser.touchStartEvent,this.onDocumentClick),t.EventHandler.remove(document,"paste",this.onDocumentPaste)},n.prototype.getModuleName=function(){return"schedule"},n.prototype.getPersistData=function(){return this.addOnPersist(["currentView","selectedDate","scrollTop","scrollLeft","adaptiveGroupIndex"])},n.prototype.onPropertyChanged=function(e,i){if(!this.isReact||!t.isNullOrUndefined(this.activeView)){for(var n={isRefresh:!1,isResource:!1,isDate:!1,isView:!1,isLayout:!1,isDataManager:!1},r=0,a=Object.keys(e);r<a.length;r++){var s=a[r];switch(s){case"views":this.setViewOptions(),this.headerModule&&this.headerModule.updateItems(),n.isView=!0;break;case"currentView":n.isView=!0;break;case"minDate":case"maxDate":case"selectedDate":n.isDate=!0;break;case"dateFormat":this.activeViewOptions=this.getActiveViewOptions(),this.headerModule&&this.headerModule.updateDateRange();break;case"showHeaderBar":case"toolbarItems":this.destroyHeaderModule(),e.showHeaderBar&&(this.headerModule=new ht(this),this.headerModule.updateDateRange()),this.notify(Xe,{cssProperties:this.getCssProperties()}),this.activeView.isTimelineView()&&this.refreshEvents(!1);break;case"workDays":JSON.stringify(i.workDays)!==JSON.stringify(e.workDays)&&(n.isLayout=!0);break;case"showWeekend":case"startHour":case"endHour":case"workHours":case"readonly":case"headerRows":case"showWeekNumber":case"rowAutoHeight":n.isLayout=!0;break;case"locale":case"calendarMode":this.globalize=new t.Internationalization(this.locale),this.localeObj=new t.L10n(this.getModuleName(),this.defaultLocale,this.locale),this.setCldrTimeFormat(),this.setCalendarMode(),n.isRefresh=!0;break;case"firstDayOfWeek":this.activeViewOptions.firstDayOfWeek=e.firstDayOfWeek,this.eventWindow&&this.eventWindow.refreshRecurrenceEditor(),n.isLayout=!0;break;case"showTimeIndicator":this.activeViewOptions.timeScale.enable&&this.activeView&&this.activeView.highlightCurrentTime();break;case"cellHeaderTemplate":this.activeViewOptions.cellHeaderTemplate=e.cellHeaderTemplate,this.cellHeaderTemplateFn=this.templateParser(this.activeViewOptions.cellHeaderTemplate),n.isLayout=!0;break;case"cellTemplate":this.activeViewOptions.cellTemplate=e.cellTemplate,this.cellTemplateFn=this.templateParser(this.activeViewOptions.cellTemplate),n.isLayout=!0;break;case"dateHeaderTemplate":this.activeViewOptions.dateHeaderTemplate=e.dateHeaderTemplate,this.dateHeaderTemplateFn=this.templateParser(this.activeViewOptions.dateHeaderTemplate),n.isLayout=!0;break;case"dateRangeTemplate":this.activeViewOptions.dateRangeTemplate=e.dateRangeTemplate,this.dateRangeTemplateFn=this.templateParser(this.activeViewOptions.dateRangeTemplate),this.headerModule&&this.headerModule.updateDateRange();break;case"dayHeaderTemplate":this.activeViewOptions.dayHeaderTemplate=e.dayHeaderTemplate,this.dayHeaderTemplateFn=this.templateParser(this.activeViewOptions.dayHeaderTemplate),n.isLayout=!0;break;case"monthHeaderTemplate":this.activeViewOptions.monthHeaderTemplate=e.monthHeaderTemplate,this.monthHeaderTemplateFn=this.templateParser(this.activeViewOptions.monthHeaderTemplate),n.isLayout=!0;break;case"resourceHeaderTemplate":this.activeViewOptions.resourceHeaderTemplate=e.resourceHeaderTemplate,this.resourceHeaderTemplateFn=this.templateParser(this.activeViewOptions.resourceHeaderTemplate),n.isLayout=!0;break;case"timezone":this.eventBase.timezonePropertyChange(i.timezone),this.headerModule&&this.headerModule.setCalendarTimezone();break;case"enableRtl":this.setRtlClass(),n.isRefresh=!0;break;default:this.extendedPropertyChange(s,e,i,n)}}this.propertyChangeAction(n)}},n.prototype.propertyChangeAction=function(e){e.isRefresh?this.refresh():e.isResource?this.initializeResources(!0):e.isView?this.changeView(this.currentView,null,!0):e.isDate?(t.isNullOrUndefined(this.selectedDate)&&this.setProperties({selectedDate:this.getCurrentTime()},!0),this.changeDate(this.selectedDate)):e.isLayout?(this.activeCellsData=null,this.initializeView(this.currentView)):e.isDataManager&&this.crudModule&&(this.dragAndDropModule&&(this.dragAndDropModule.actionObj.action="",t.removeClass([this.element],"e-event-action")),this.crudModule.refreshDataManager())},n.prototype.allDayRowScrollUpdate=function(){var e=this.element.querySelector(".e-date-header-wrap"),i=this.element.querySelector(".e-all-day-row");if("auto"!==this.height&&this.enableAllDayScroll)e.classList.contains("e-all-day-auto")&&t.removeClass([e],"e-all-day-auto"),this.eventBase.allDayExpandScroll(e);else if(t.addClass([e],"e-all-day-auto"),e.classList.contains("e-all-day-scroll")&&t.removeClass([e],"e-all-day-scroll"),this.uiStateValues.expand){var n=[].slice.call(this.element.querySelectorAll(".e-all-day-cells"));n[0].style.height=i.style.height?i.style.height:n[1].style.height}this.uiStateValues.expand||(i.style.height="")},n.prototype.extendedPropertyChange=function(e,i,n,r){switch(e){case"width":case"height":case"enableAllDayScroll":["Day","Week","WorkWeek"].indexOf(this.currentView)>-1&&this.allDayRowScrollUpdate(),this.notify("ui-update",{module:"scroll",properties:{width:i.width,height:i.height}});break;case"cssClass":n.cssClass&&t.removeClass([this.element],n.cssClass.split(" ")),i.cssClass&&t.addClass([this.element],i.cssClass.split(" "));break;case"hideEmptyAgendaDays":case"agendaDaysCount":this.activeViewOptions=this.getActiveViewOptions(),r.isView=!0;break;case"eventSettings":this.onEventSettingsPropertyChanged(i.eventSettings,n.eventSettings,r);break;case"allowKeyboardInteraction":case"allowClipboard":this.keyboardInteractionModule&&(this.keyboardInteractionModule.destroy(),this.keyboardInteractionModule=null),(i.allowKeyboardInteraction||i.allowClipboard)&&(this.keyboardInteractionModule=new vt(this)),"allowClipboard"===e&&(i.allowClipboard?t.EventHandler.add(document,"paste",this.onDocumentPaste,this):t.EventHandler.remove(document,"paste",this.onDocumentPaste));break;case"timezoneDataSource":this.eventWindow&&this.eventWindow.refresh();break;case"editorTemplate":t.isNullOrUndefined(this.editorTemplate)||(this.editorTemplateFn=this.templateParser(this.editorTemplate)),this.eventWindow&&this.eventWindow.setDialogContent();break;case"editorHeaderTemplate":t.isNullOrUndefined(this.editorHeaderTemplate)||(this.editorHeaderTemplateFn=this.templateParser(this.editorHeaderTemplate)),this.eventWindow&&this.eventWindow.setDialogHeader();break;case"editorFooterTemplate":t.isNullOrUndefined(this.editorFooterTemplate)||(this.editorFooterTemplateFn=this.templateParser(this.editorFooterTemplate)),this.eventWindow&&this.eventWindow.setDialogFooter();break;case"quickInfoTemplates":this.quickInfoTemplates.header&&(this.quickInfoTemplatesHeaderFn=this.templateParser(this.quickInfoTemplates.header)),this.quickInfoTemplates.content&&(this.quickInfoTemplatesContentFn=this.templateParser(this.quickInfoTemplates.content)),this.quickInfoTemplates.footer&&(this.quickInfoTemplatesFooterFn=this.templateParser(this.quickInfoTemplates.footer));break;case"group":this.onGroupSettingsPropertyChanged(i.group,n.group,r);break;case"resources":r.isResource=!0;break;case"timeScale":this.activeViewOptions.timeScale.interval=i.timeScale.interval||this.activeViewOptions.timeScale.interval,this.activeViewOptions.timeScale.slotCount=i.timeScale.slotCount||this.activeViewOptions.timeScale.slotCount,this.eventWindow&&this.eventWindow.refreshDateTimePicker(),r.isLayout=!0;break;case"allowDragAndDrop":case"allowResizing":case"eventDragArea":case"allowOverlap":this.refreshEvents(!1);break;case"weekRule":r.isLayout=!0;break;case"firstMonthOfYear":this.activeViewOptions.firstMonthOfYear=i.firstMonthOfYear,this.viewIndex=this.activeView.viewIndex,r.isLayout=!0;break;case"monthsCount":this.activeViewOptions.monthsCount=i.monthsCount,this.viewIndex=this.activeView.viewIndex,r.isLayout=!0;break;case"timeFormat":this.internalTimeFormat=i.timeFormat||this.activeViewOptions.timeFormat,this.eventWindow&&this.eventWindow.refreshDateTimePicker(),r.isLayout=!0;break;case"enableAdaptiveUI":this.showHeaderBar&&this.headerModule&&(this.destroyHeaderModule(),this.headerModule=new ht(this),this.headerModule.updateDateRange()),r.isLayout=!0;break;case"headerIndentTemplate":this.activeViewOptions.headerIndentTemplate=i.headerIndentTemplate,this.headerIndentTemplateFn=this.templateParser(this.activeViewOptions.headerIndentTemplate),r.isLayout=!0}},n.prototype.setRtlClass=function(){this.enableRtl?t.addClass([this.element],"e-rtl"):t.removeClass([this.element],"e-rtl")},n.prototype.onGroupSettingsPropertyChanged=function(e,t,i){for(var n=0,r=Object.keys(e);n<r.length;n++)"headerTooltipTemplate"===r[n]?this.headerTooltipTemplateFn=this.templateParser(e.headerTooltipTemplate):(i.isLayout=!0,this.eventWindow&&this.eventWindow.refresh())},n.prototype.onEventSettingsPropertyChanged=function(e,t,i){for(var n=0,r=Object.keys(e);n<r.length;n++)switch(r[n]){case"dataSource":case"query":case"fields":case"includeFiltersInQuery":this.initializeDataModule(),i.isDataManager=!0;break;case"template":this.activeViewOptions.eventTemplate=e.template,this.appointmentTemplateFn=this.templateParser(this.activeViewOptions.eventTemplate),i.isDataManager=!0;break;case"enableTooltip":this.eventTooltip&&(this.eventTooltip.destroy(),this.eventTooltip=null),e.enableTooltip&&(this.eventTooltip=new Xt(this));break;case"tooltipTemplate":this.eventTooltipTemplateFn=this.templateParser(this.eventSettings.tooltipTemplate);break;case"resourceColorField":this.resourceBase&&this.resourceBase.setResourceCollection(),i.isDataManager=!0;break;case"editFollowingEvents":this.quickPopup&&this.quickPopup.refreshQuickDialog();break;case"allowAdding":case"allowEditing":case"allowDeleting":this.showHeaderBar&&this.headerModule&&this.headerModule.updateAddIcon(),this.eventWindow&&this.eventWindow.refresh();break;case"spannedEventPlacement":case"minimumEventDuration":case"enableMaxHeight":case"enableIndicator":this.refreshEvents(!1);break;case"ignoreWhitespace":i.isLayout=!0}},n.prototype.destroyHeaderModule=function(){this.headerModule&&(this.headerModule.destroy(),this.headerModule=null)},n.prototype.destroyPopups=function(){this.quickPopup&&(this.quickPopup.destroy(),this.quickPopup=null),this.eventWindow&&(this.eventWindow.destroy(),this.eventWindow=null)},n.prototype.showSpinner=function(){i.showSpinner(this.element)},n.prototype.hideSpinner=function(){i.hideSpinner(this.element)},n.prototype.setWorkHours=function(e,i,n,r){var a=[];a=this.getWorkHourCells(e,i,n,r),t.addClass(a,"e-work-hours")},n.prototype.resetWorkHours=function(e,i,n,r){if(void 0===e&&(e=this.activeView.renderDates),e&&i&&n){var a=this.getWorkHourCells(e,i,n,r);t.removeClass(a,"e-work-hours")}else{var s=[].slice.call(this.element.querySelectorAll(".e-work-hours"));t.removeClass(s,"e-work-hours")}},n.prototype.getWorkHourCells=function(e,i,n,r){if(["Agenda","MonthAgenda","Month","TimelineMonth"].indexOf(this.currentView)>-1)return[];var a=this.getStartEndTime(i),s=this.getStartEndTime(n),o=this.getContentTable();if(t.isNullOrUndefined(a)||t.isNullOrUndefined(s)||!o)return[];a.setMilliseconds(0),s.setMilliseconds(0);var l=this.activeView.getStartHour();a<l&&(a=l);var p=this.activeView.getEndHour();s>p&&(s=p);for(var c=this.activeViewOptions.timeScale.interval*Ke/this.activeViewOptions.timeScale.slotCount,h=(l.getTimezoneOffset()-a.getTimezoneOffset())*Ke,d=Math.abs((l.getTimezoneOffset()-s.getTimezoneOffset())*Ke),u=Math.round((a.getTime()-l.getTime()+h)/c),g=Math.ceil((s.getTime()-l.getTime()-d)/c),v=u,m=g,f=[],y=0,T=e;y<T.length;y++){var w=T[y];b(w=this.getDateTime(w));var D=this.activeView.renderDates;t.isNullOrUndefined(r)||!this.resourceBase||this.activeView.isTimelineView()||(D=this.resourceBase.lastResourceLevel[parseInt(r.toString(),10)].renderDates);var C=this.getIndexOfDate(D,w);if(C>=0){if(this.activeView.isTimelineView()){var S=Math.round((p.getTime()-l.getTime())/c);u=v+C*S,g=m+C*S}for(var O=u;O<g;O++)if(this.activeView.isTimelineView()){var E=t.isNullOrUndefined(r)?0:r;f.push(o.rows[parseInt(E.toString(),10)].cells[parseInt(O.toString(),10)])}else if(t.isNullOrUndefined(r))f.push(o.rows[parseInt(O.toString(),10)].cells[parseInt(C.toString(),10)]);else{var x='.e-work-cells[data-group-index="'+r+'"]',V=[].slice.call(o.rows[parseInt(O.toString(),10)].querySelectorAll(x));f.push(V[parseInt(C.toString(),10)])}}}return f},n.prototype.getCellDetails=function(e){var i=e instanceof Array?e:[e],n=t.getElement(i[0]),r=t.getElement(i.slice(-1)[0]),a=this.getDateFromElement(n),s=this.getDateFromElement(r);if(!t.isNullOrUndefined(a)&&!t.isNullOrUndefined(s)){var o=this.activeView.isTimelineView()&&!t.isNullOrUndefined(r.getAttribute("colSpan"))&&this.headerRows.length>0,l=o?parseInt(r.getAttribute("colSpan"),10):1,p={startTime:a,endTime:s=!this.activeViewOptions.timeScale.enable||o||r.classList.contains("e-all-day-cells")||r.classList.contains("e-header-cells")?O(new Date(s.getTime()),l):this.activeView.getEndDateFromStartDate(s),isAllDay:this.isAllDayCell(n),element:e},c=n.getAttribute("data-group-index");return t.isNullOrUndefined(c)||(p.groupIndex=parseInt(c,10)),p}},n.prototype.getSelectedElements=function(){return this.keyboardInteractionModule&&this.keyboardInteractionModule.selectedCells.length>0?this.keyboardInteractionModule.selectedCells:this.getSelectedCells()},n.prototype.getResourceCollections=function(){return this.resourceCollection},n.prototype.setResourceCollections=function(e,t){void 0===t&&(t=!0),!t&&this.uiStateValues&&(this.uiStateValues.isPreventEventRefresh=!0),this.setProperties({resources:e},!1)},n.prototype.changeCurrentView=function(e,t){var i=this.getViewIndex(e),n=e.charAt(0).toLowerCase()+e.slice(1),r=this.viewOptions[""+n];r&&(i=this.viewCollections.indexOf(r[t||0])),-1!==i&&i!==this.viewIndex&&this.changeView(e,null,null,i)},n.prototype.getCurrentViewIndex=function(){return this.viewIndex},n.prototype.getResourcesByIndex=function(e){if(this.resourceBase&&this.resourceBase.lastResourceLevel){if(e<0||e>=this.resourceBase.lastResourceLevel.length)return;var t=this.resourceBase.lastResourceLevel[parseInt(e.toString(),10)],i={};return this.resourceBase.setResourceValues(i,e),{resource:t.resource,resourceData:t.resourceData,groupData:i}}},n.prototype.expandResource=function(e,t){this.activeView.isTimelineView()&&this.resourceBase&&this.resourceCollection.length>1&&this.resourceBase.resourceExpand(e,t,!1)},n.prototype.collapseResource=function(e,t){this.activeView.isTimelineView()&&this.resourceBase&&this.resourceCollection.length>1&&this.resourceBase.resourceExpand(e,t,!0)},n.prototype.scrollTo=function(e,i){this.currentView.indexOf("Agenda")<0&&t.isNullOrUndefined(this.element.querySelector(".e-work-cells"))||(this.activeView.scrollToDate&&t.isNullOrUndefined(e)&&i?this.activeView.scrollToDate(i):this.activeView.scrollToHour&&this.activeView.scrollToHour(e,i))},n.prototype.scrollToResource=function(e,t){this.resourceBase&&this.resourceBase.lastResourceLevel&&this.resourceBase.resourceScroll(e,t)},n.prototype.exportToICalendar=function(e,t){if(!this.iCalendarExportModule)throw console.warn('[WARNING] :: Module "ICalendarExport" is not available in Schedule component! You either misspelled the module name or forgot to load it.'),Error("Inject ICalendarExport module");this.iCalendarExportModule.initializeCalendarExport(e,t)},n.prototype.importICalendar=function(e){if(!this.iCalendarImportModule)throw console.warn('[WARNING] :: Module "ICalendarImport" is not available in Schedule component! You either misspelled the module name or forgot to load it.'),Error("Inject ICalendarImport module");this.iCalendarImportModule.initializeCalendarImport(e)},n.prototype.addEvent=function(e){this.crudModule.addEvent(e)},n.prototype.generateEventOccurrences=function(e,t){return this.eventBase?this.eventBase.generateOccurrence(e,t):[]},n.prototype.exportToExcel=function(e){if(!this.excelExportModule)throw console.warn('[WARNING] :: Module "ExcelExport" is not available in Schedule component! You either misspelled the module name or forgot to load it.'),Error("Inject ExcelExport module");this.excelExportModule.initializeExcelExport(e)},n.prototype.print=function(e){if(!this.printModule)throw console.warn('[WARNING] :: Module "Print" is not available in Schedule component! You either misspelled the module name or forgot to load it.'),Error("Inject Print module");this.printModule.print(e)},n.prototype.saveEvent=function(e,t){this.crudModule.saveEvent(e,t)},n.prototype.deleteEvent=function(e,t){this.crudModule.deleteEvent(e,t)},n.prototype.getEvents=function(e,t,i){var n=[];return n=i?this.eventBase.getProcessedEvents():this.eventsData,e&&(e=this.getDateTime(e)),t&&(t=this.getDateTime(t)),n=this.eventBase.filterEventsByRange(n,e,t)},n.prototype.getBlockEvents=function(e,t,i){var n=[];return n=i?this.eventBase.getProcessedEvents(this.blockData):this.blockData,e&&(e=this.getDateTime(e)),t&&(t=this.getDateTime(t)),n=this.eventBase.filterEventsByRange(n,e,t)},n.prototype.getOccurrencesByID=function(e){return this.eventBase.getOccurrencesByID(e)},n.prototype.getOccurrencesByRange=function(e,t){return e=this.getDateTime(e),t=this.getDateTime(t),this.eventBase.getOccurrencesByRange(e,t)},n.prototype.getCurrentViewDates=function(){return this.activeView?this.activeView.renderDates:[]},n.prototype.setRecurrenceEditor=function(e){this.eventWindow.setRecurrenceEditor(e)},n.prototype.getEventMaxID=function(){return this.eventBase.getEventMaxID()},n.prototype.getDeletedOccurrences=function(e){return this.eventBase.getDeletedOccurrences(e)},n.prototype.getCurrentViewEvents=function(){return this.eventsProcessed},n.prototype.refreshEvents=function(e){void 0===e&&(e=!0),e?(this.dragAndDropModule&&(this.dragAndDropModule.actionObj.action="",t.removeClass([this.element],"e-event-action")),this.crudModule.refreshDataManager()):(this.uiStateValues&&(this.uiStateValues.isPreventTimezone=!0),this.crudModule&&this.crudModule.refreshProcessedData(),this.uiStateValues&&(this.uiStateValues.isPreventTimezone=!1))},n.prototype.refreshTemplates=function(e){switch(e?this.resetTemplates([e]):this.resetTemplates(),e){case"eventTemplate":this.appointmentTemplateFn=this.templateParser(this.activeViewOptions.eventTemplate),this.refreshEvents(!1);break;case"dateHeaderTemplate":this.dateHeaderTemplateFn=this.templateParser(this.activeViewOptions.dateHeaderTemplate),this.activeView.refreshHeader();break;case"dateRangeTemplate":this.dateRangeTemplateFn=this.templateParser(this.activeViewOptions.dateRangeTemplate),this.headerModule&&this.headerModule.refresh();break;case"resourceHeaderTemplate":this.resourceHeaderTemplateFn=this.templateParser(this.activeViewOptions.resourceHeaderTemplate),this.activeView.isTimelineView()?this.activeView.refreshResourceHeader():this.activeView.refreshHeader();break;case"quickInfoTemplates":this.quickPopup&&(this.quickPopup.destroy(),this.quickPopup=null),this.quickPopup=new Gt(this),this.quickInfoTemplatesHeaderFn=this.templateParser(this.quickInfoTemplates.header),this.quickInfoTemplatesContentFn=this.templateParser(this.quickInfoTemplates.content),this.quickInfoTemplatesFooterFn=this.templateParser(this.quickInfoTemplates.footer);break;case"editorTemplate":this.destroyEditorWindow(),this.editorTemplateFn=this.templateParser(this.editorTemplate);break;case"editorHeaderTemplate":this.destroyEditorWindow(),this.editorHeaderTemplateFn=this.templateParser(this.editorHeaderTemplate);break;case"editorFooterTemplate":this.destroyEditorWindow(),this.editorFooterTemplateFn=this.templateParser(this.editorFooterTemplate);break;case"tooltipTemplate":case"headerTooltipTemplate":this.eventTooltip&&(this.eventTooltip.destroy(),this.eventTooltip=null),this.eventTooltip=new Xt(this),this.eventTooltipTemplateFn=this.templateParser(this.eventSettings.tooltipTemplate),this.headerTooltipTemplateFn=this.templateParser(this.activeViewOptions.group.headerTooltipTemplate);break;default:this.initializeView(this.currentView)}},n.prototype.refreshLayout=function(){this.onScheduleResize(),this.headerModule&&this.headerModule.refresh(),this.eventWindow&&this.eventWindow.refresh()},n.prototype.getEventDetails=function(e){var i=(e=t.getElement(e)).getAttribute("data-guid");return i?this.eventBase.getEventByGuid(i):{}},n.prototype.isSlotAvailable=function(e,i,n){var r,a,s=this,o=this.activeEventData.event;if(e instanceof Date||"string"==typeof e?(r=e,a=i):(o=e,r=e[this.eventFields.startTime],a=e[this.eventFields.endTime],this.resourceBase&&(n=this.eventBase.getGroupIndexFromEvent(e))),t.isNullOrUndefined(r)||t.isNullOrUndefined(a))return!0;r=this.getDateTime(r),a=this.getDateTime(a);var l=this.eventBase.filterEvents(r,a);return!t.isNullOrUndefined(n)&&this.resourceBase&&this.resourceBase.lastResourceLevel.length>0&&(l=this.eventBase.filterEventsByResource(this.resourceBase.lastResourceLevel[parseInt(n.toString(),10)],l)),o&&(l=o.Guid?l.filter(function(e){return e.Guid!==o.Guid}):l.filter(function(e){return e[s.eventFields.id]!==o[s.eventFields.id]})),!(l.length>0)},n.prototype.copy=function(e){this.processCutCopyActions(e,!1)},n.prototype.cut=function(e){this.processCutCopyActions(e,!0)},n.prototype.paste=function(e){var i=this;if(this.allowClipboard&&this.allowKeyboardInteraction&&e&&(e.classList.contains("e-work-cells")||e.classList.contains("e-all-day-cells"))){if(!this.activeCellsData){var n=this.getCellDetails([e]);n&&(this.activeCellsData=n)}var r=new DataTransfer;t.isNullOrUndefined(navigator.clipboard)||navigator.clipboard.readText().then(function(t){r.setData("text/plain",t);var n=new ClipboardEvent("paste",{bubbles:!0,cancelable:!0});Object.defineProperty(n,"clipboardData",{value:r}),i.keyboardInteractionModule.pasteHandler(n,e)}).catch(function(e){throw e})}},n.prototype.processCutCopyActions=function(e,t){var i=this;if(e&&this.allowClipboard&&this.allowKeyboardInteraction){var n=[];e.forEach(function(e){if(e.classList.contains("e-appointment")){var t=i.getEventDetails(e);t&&n.push(t)}}),n.length>0&&this.keyboardInteractionModule.processClipboardAction(t,n)}},n.prototype.openEditor=function(e,i,n,r){"Add"!==i||n?(e[this.eventFields.startTime]=this.getDateTime(e[this.eventFields.startTime]),e[this.eventFields.endTime]=this.getDateTime(e[this.eventFields.endTime])):(e.startTime=this.getDateTime(e.startTime),e.endTime=this.getDateTime(e.endTime),t.isNullOrUndefined(e.element)||(e.element=t.getElement(e.element))),this.currentAction=i,"Add"!==i&&(this.activeEventData.event=e),this.eventWindow.openEditor(e,i,n,r)},n.prototype.closeEditor=function(){this.eventWindow&&this.eventWindow.dialogClose()},n.prototype.openQuickInfoPopup=function(e){var i=this;if("Year"!==this.currentView&&!t.isNullOrUndefined(e))if(t.isNullOrUndefined(e[this.eventFields.id])){if("Agenda"===this.currentView||"MonthAgenda"===this.currentView||t.isNullOrUndefined(this.activeView))return;var n={startTime:this.activeCellsData.startTime=this.getDateTime(e[this.eventFields.startTime]),endTime:this.activeCellsData.endTime=this.getDateTime(e[this.eventFields.endTime]),isAllDay:this.activeCellsData.isAllDay=!t.isNullOrUndefined(e[this.eventFields.isAllDay])&&e[this.eventFields.isAllDay]},r=this.activeView.getAdjustedDate(new Date(n.startTime));if(r){var a='.e-work-cells[data-date="'+r.getTime()+'"]';this.activeViewOptions.group.resources.length>0&&!this.uiStateValues.isGroupAdaptive&&this.resourceBase&&this.eventBase&&(n.groupIndex=this.eventBase.getGroupIndexFromEvent(e),a='.e-work-cells[data-date="'+r.getTime()+'"][data-group-index="'+n.groupIndex+'"]');var s=this.element.querySelector(a);s&&(s.focus(),n.element=s,this.notify("cellClick",n))}}else{var o=this.getCurrentViewEvents().filter(function(t){return e[i.eventFields.id]===t[i.eventFields.id]});if(o.length<=0)return;var l=o[0];if(e[this.eventFields.recurrenceRule]){var p=o.filter(function(t){return t[i.eventFields.startTime].getTime()===e[i.eventFields.startTime].getTime()});p.length>0&&(l=p[0])}var c=this.element.querySelector('div[data-guid="'+l.Guid+'"]');c&&(this.eventBase.removeSelectedAppointmentClass(),this.eventBase.addSelectedAppointments([c],!1),this.activeEventData={event:l,element:c},"Agenda"!==this.currentView&&"MonthAgenda"!==this.currentView||t.addClass([this.activeEventData.element],"e-active-appointment-agenda"),this.notify("eventClick",this.activeEventData))}},n.prototype.closeQuickInfoPopup=function(){this.quickPopup&&this.quickPopup.quickPopupHide(!0)},n.prototype.openOverlapAlert=function(e){var t=this;if(this.quickPopup){var i={type:"OverlapAlert",cancel:!1,element:this.quickPopup.quickDialog.element,data:e.data,overlapEvents:e.overlapEvents};this.trigger("popupOpen",i,function(i){i.cancel||t.quickPopup.openValidationError("overlapAlert",e.data)})}},n.prototype.closeOverlapAlert=function(){var e=this;if(this.quickPopup){var t={type:"OverlapAlert",cancel:!1,data:this.activeEventData.event,element:this.quickPopup.quickDialog.element};this.trigger("popupClose",t,function(t){t.cancel||e.quickPopup.quickDialog.hide()})}},n.prototype.closeTooltip=function(){this.eventTooltip&&this.eventTooltip.close()},n.prototype.getDateRangeText=function(e){return t.isNullOrUndefined(e)&&0===e.length||!this.activeView?"":this.activeView.getDateRangeText(e[0],e)},n.prototype.getViewDates=function(e){if(void 0===e&&(e="Current"),!this.activeView)return[];switch(e){case"Previous":case"Next":return this.activeView.getRenderDates(void 0,this.activeView.getNextPreviousDate(e));case"Current":return this.getCurrentViewDates()}},n.prototype.selectResourceByIndex=function(e){this.resourceBase&&this.uiStateValues.isGroupAdaptive&&this.resourceBase.selectResourceByIndex(e)},n.prototype.getIndexFromResourceId=function(e,t){return this.resourceBase?this.resourceBase.getIndexFromResourceId(e,t):null},n.prototype.addResource=function(e,t,i){this.resourceBase.addResource(e,t,i)},n.prototype.removeResource=function(e,t){this.resourceBase.removeResource(e,t)},n.prototype.destroy=function(){this.eventTooltip&&(this.eventTooltip.destroy(),this.eventTooltip=null),this.destroyPopups(),this.hideSpinner(),this.unWireEvents(),this.destroyHeaderModule(),this.eventBase&&(this.eventBase.destroy(),this.eventBase=null),this.workCellAction&&(this.workCellAction.destroy(),this.workCellAction=null),this.inlineModule&&(this.inlineModule.destroy(),this.inlineModule=null),this.keyboardInteractionModule&&(this.keyboardInteractionModule.destroy(),this.keyboardInteractionModule=null),this.scrollModule&&(this.scrollModule.destroy(),this.scrollModule=null),this.printModule&&this.printModule.destroy(),this.activeView&&(this.resetTemplates(),this.activeView.removeEventListener(),this.activeView.destroy(),this.activeView=null),this.scheduleTouchModule&&(this.scheduleTouchModule.destroy(),this.scheduleTouchModule=null),this.crudModule&&(this.crudModule.destroy(),this.crudModule=null),this.dataModule&&(this.dataModule.destroy(),this.dataModule=null),e.prototype.destroy.call(this);for(var i=0,n=["dayModule","weekModule","workWeekModule","monthModule","monthAgendaModule","yearModule","agendaModule","timelineViewsModule","timelineMonthModule","timelineYearModule","resizeModule","dragAndDropModule","excelExportModule","printModule","iCalendarExportModule","iCalendarImportModule","tzModule","eventsData","eventsProcessed","blockData","blockProcessed","uiStateValues","viewCollections","viewOptions","defaultLocale","localeObj","selectedElements","resourceCollection","editorTitles","eventFields","activeViewOptions","activeEventData","activeCellsData","renderModule"];i<n.length;i++)this[""+n[i]]=null;j(this.element);var r=[$e,"e-rtl","e-device","e-multi-drag"];this.cssClass&&(r=r.concat(this.cssClass.split(" "))),t.removeClass([this.element],r)},Ki([t.Property("auto")],n.prototype,"width",void 0),Ki([t.Property("auto")],n.prototype,"height",void 0),Ki([t.Property(!0)],n.prototype,"showHeaderBar",void 0),Ki([t.Property(!0)],n.prototype,"showTimeIndicator",void 0),Ki([t.Property(!0)],n.prototype,"allowSwiping",void 0),Ki([t.Property(!0)],n.prototype,"allowOverlap",void 0),Ki([t.Property(3)],n.prototype,"overscanCount",void 0),Ki([t.Collection([],Xi)],n.prototype,"toolbarItems",void 0),Ki([t.Property("Week")],n.prototype,"currentView",void 0),Ki([t.Property(["Day","Week","WorkWeek","Month","Agenda"])],n.prototype,"views",void 0),Ki([t.Property(new Date)],n.prototype,"selectedDate",void 0),Ki([t.Property(new Date(1900,0,1))],n.prototype,"minDate",void 0),Ki([t.Property(new Date(2099,11,31))],n.prototype,"maxDate",void 0),Ki([t.Property()],n.prototype,"dateFormat",void 0),Ki([t.Property("Gregorian")],n.prototype,"calendarMode",void 0),Ki([t.Property(!0)],n.prototype,"showWeekend",void 0),Ki([t.Property(0)],n.prototype,"firstDayOfWeek",void 0),Ki([t.Property("FirstDay")],n.prototype,"weekRule",void 0),Ki([t.Property([1,2,3,4,5])],n.prototype,"workDays",void 0),Ki([t.Property(12)],n.prototype,"monthsCount",void 0),Ki([t.Property("00:00")],n.prototype,"startHour",void 0),Ki([t.Property("24:00")],n.prototype,"endHour",void 0),Ki([t.Property(null)],n.prototype,"timeFormat",void 0),Ki([t.Property(!0)],n.prototype,"enableHtmlSanitizer",void 0),Ki([t.Property(!1)],n.prototype,"enableAllDayScroll",void 0),Ki([t.Property(!1)],n.prototype,"enableAdaptiveUI",void 0),Ki([t.Property(!0)],n.prototype,"allowResizing",void 0),Ki([t.Complex({},yi)],n.prototype,"workHours",void 0),Ki([t.Complex({},Di)],n.prototype,"timeScale",void 0),Ki([t.Property(!0)],n.prototype,"allowKeyboardInteraction",void 0),Ki([t.Property(!0)],n.prototype,"allowDragAndDrop",void 0),Ki([t.Property()],n.prototype,"dateHeaderTemplate",void 0),Ki([t.Property()],n.prototype,"dateRangeTemplate",void 0),Ki([t.Property()],n.prototype,"cellHeaderTemplate",void 0),Ki([t.Property()],n.prototype,"dayHeaderTemplate",void 0),Ki([t.Property()],n.prototype,"monthHeaderTemplate",void 0),Ki([t.Property()],n.prototype,"cellTemplate",void 0),Ki([t.Property(!1)],n.prototype,"readonly",void 0),Ki([t.Property(!0)],n.prototype,"showQuickInfo",void 0),Ki([t.Property(!1)],n.prototype,"allowInline",void 0),Ki([t.Property(!0)],n.prototype,"allowMultiCellSelection",void 0),Ki([t.Property(!0)],n.prototype,"allowMultiRowSelection",void 0),Ki([t.Property(!1)],n.prototype,"quickInfoOnSelectionEnd",void 0),Ki([t.Property(!1)],n.prototype,"showWeekNumber",void 0),Ki([t.Property(!1)],n.prototype,"rowAutoHeight",void 0),Ki([t.Property(!1)],n.prototype,"allowMultiDrag",void 0),Ki([t.Property(0)],n.prototype,"firstMonthOfYear",void 0),Ki([t.Property()],n.prototype,"editorTemplate",void 0),Ki([t.Property()],n.prototype,"editorHeaderTemplate",void 0),Ki([t.Property()],n.prototype,"editorFooterTemplate",void 0),Ki([t.Complex({},Si)],n.prototype,"quickInfoTemplates",void 0),Ki([t.Property(7)],n.prototype,"agendaDaysCount",void 0),Ki([t.Property(!0)],n.prototype,"hideEmptyAgendaDays",void 0),Ki([t.Property(!0)],n.prototype,"enableRecurrenceValidation",void 0),Ki([t.Property()],n.prototype,"timezone",void 0),Ki([t.Complex({},Li)],n.prototype,"eventSettings",void 0),Ki([t.Property(wt)],n.prototype,"timezoneDataSource",void 0),Ki([t.Property()],n.prototype,"resourceHeaderTemplate",void 0),Ki([t.Property()],n.prototype,"headerIndentTemplate",void 0),Ki([t.Complex({},Ui)],n.prototype,"group",void 0),Ki([t.Collection([],zi)],n.prototype,"resources",void 0),Ki([t.Collection([],xi)],n.prototype,"headerRows",void 0),Ki([t.Property()],n.prototype,"cssClass",void 0),Ki([t.Property(!1)],n.prototype,"allowClipboard",void 0),Ki([t.Property()],n.prototype,"eventDragArea",void 0),Ki([t.Event()],n.prototype,"created",void 0),Ki([t.Event()],n.prototype,"destroyed",void 0),Ki([t.Event()],n.prototype,"cellClick",void 0),Ki([t.Event()],n.prototype,"cellDoubleClick",void 0),Ki([t.Event()],n.prototype,"moreEventsClick",void 0),Ki([t.Event()],n.prototype,"hover",void 0),Ki([t.Event()],n.prototype,"select",void 0),Ki([t.Event()],n.prototype,"actionBegin",void 0),Ki([t.Event()],n.prototype,"actionComplete",void 0),Ki([t.Event()],n.prototype,"actionFailure",void 0),Ki([t.Event()],n.prototype,"navigating",void 0),Ki([t.Event()],n.prototype,"renderCell",void 0),Ki([t.Event()],n.prototype,"eventClick",void 0),Ki([t.Event()],n.prototype,"eventDoubleClick",void 0),Ki([t.Event()],n.prototype,"eventRendered",void 0),Ki([t.Event()],n.prototype,"dataBinding",void 0),Ki([t.Event()],n.prototype,"popupOpen",void 0),Ki([t.Event()],n.prototype,"popupClose",void 0),Ki([t.Event()],n.prototype,"dragStart",void 0),Ki([t.Event()],n.prototype,"drag",void 0),Ki([t.Event()],n.prototype,"dragStop",void 0),Ki([t.Event()],n.prototype,"resizeStart",void 0),Ki([t.Event()],n.prototype,"resizing",void 0),Ki([t.Event()],n.prototype,"resizeStop",void 0),Ki([t.Event()],n.prototype,"virtualScrollStart",void 0),Ki([t.Event()],n.prototype,"virtualScrollStop",void 0),Ki([t.Event()],n.prototype,"dataBound",void 0),Ki([t.Event()],n.prototype,"beforePaste",void 0),Ki([t.Event()],n.prototype,"beforePrint",void 0),Ki([t.Event()],n.prototype,"excelExport",void 0),Ki([t.Event()],n.prototype,"tooltipOpen",void 0),n=Ki([t.NotifyPropertyChanges],n)}(t.Component),Ji=function(){function e(e){this.daysVariation=0,this.parent=e,this.actionObj={X:0,Y:0,groupIndex:0,cellWidth:0,cellHeight:0,slotInterval:0,interval:0,actionIndex:0,cloneElement:[],originalElement:[],action:null,isAllDay:null,excludeSelectors:null,index:0,navigationInterval:null,scrollInterval:null},this.scrollArgs={element:null,width:0,height:0},this.resizeEdges={left:!1,right:!1,top:!1,bottom:!1},this.scrollEdges={left:!1,right:!1,top:!1,bottom:!1}}return e.prototype.getChangedData=function(e){var i=this,n=t.extend({},this.actionObj.event,null,!0);if(n[this.parent.eventFields.startTime]=this.actionObj.start,n[this.parent.eventFields.endTime]=this.actionObj.end,t.isNullOrUndefined(this.actionObj.isAllDay)||(n[this.parent.eventFields.isAllDay]=this.actionObj.isAllDay),this.parent.activeViewOptions.group.resources.length>0){var r=this.getOriginalElement(this.actionObj.element);if(r){var a=r.map(function(e){return parseInt(e.getAttribute("data-group-index"),10)});if(-1===a.indexOf(this.actionObj.groupIndex)||!t.isNullOrUndefined(e)&&e.length>0){var s=parseInt(this.actionObj.clone.getAttribute("data-group-index"),10);(a=a.filter(function(e){return e!==s})).push(this.actionObj.groupIndex),e&&e.length>0?e.forEach(function(e){i.parent.resourceBase.getResourceData(e,i.actionObj.groupIndex,a)}):this.parent.resourceBase.getResourceData(n,this.actionObj.groupIndex,a)}}}return n},e.prototype.saveChangedData=function(e,t){void 0===t&&(t=!1),this.parent.activeEventData.event=this.actionObj.event,this.parent.currentAction="Save";var i,n=[e.data];t&&(n=e.selectedData);for(var r=0,a=n;r<a.length;r++){var s=a[r],o=!(this.parent.activeViewOptions.group.resources.length>0)||parseInt(this.actionObj.element.getAttribute("data-group-index"),10)===this.actionObj.groupIndex;if(+s[this.parent.eventFields.startTime]==+this.actionObj.event[this.parent.eventFields.startTime]&&+s[this.parent.eventFields.endTime]==+this.actionObj.event[this.parent.eventFields.endTime]&&o)return void(this.parent.crudModule.crudObj.isCrudAction=!1);if(s[this.parent.eventFields.recurrenceRule]){var l=s[this.parent.eventFields.recurrenceID]||s[this.parent.eventFields.id];if(s[this.parent.eventFields.id]===s[this.parent.eventFields.recurrenceID]&&(s[this.parent.eventFields.id]=this.parent.eventBase.getEventMaxID(),i="EditOccurrence"),this.parent.enableRecurrenceValidation&&this.parent.eventWindow.editOccurrenceValidation(l,s,this.actionObj.event))return}else i=null;(s[this.parent.eventFields.startTimezone]||s[this.parent.eventFields.endTimezone])&&this.parent.eventBase.timezoneConvert(s),this.parent.crudModule.saveEvent(s,i)}},e.prototype.calculateIntervalTime=function(e){var t=b(e).getTime(),i=this.parent.activeView.getStartHour(),n=Ke*this.actionObj.interval;return t+=(60*i.getHours()+i.getMinutes())*Ke+1e3*i.getSeconds(),t+=Math.floor((e.getTime()-t)/n)*n,new Date(t)},e.prototype.getContentAreaDimension=function(){var e=this.parent.element.querySelector(".e-content-wrap"),t=[].slice.call(e.querySelector("tr").children);this.parent.activeView.isTimelineView()||!(this.parent.activeViewOptions.group.resources.length>0)||this.parent.isAdaptive||this.parent.enableAdaptiveUI||this.parent.virtualScrollModule||(t=this.getResourceElements(t));var i=t[0].getBoundingClientRect(),n=t.slice(-1)[0].getBoundingClientRect();return{bottom:e.scrollHeight-5,left:this.parent.enableRtl?n.left:i.left,right:this.parent.enableRtl?i.right:n.right,top:0,leftOffset:this.parent.enableRtl?n.right:i.right,rightOffset:this.parent.enableRtl?i.left:n.left}},e.prototype.getIndex=function(e){var t=[].slice.call(this.parent.getContentTable().querySelector("tr").children),i={minIndex:0,maxIndex:t.length-1};if("resize"===this.actionObj.action&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&!this.parent.activeView.isTimelineView()){var n=this.getResourceElements(t);i.minIndex=n[0].cellIndex,i.maxIndex=n.slice(-1)[0].cellIndex}return e<i.minIndex&&(e=i.minIndex),e>i.maxIndex&&(e=i.maxIndex),e},e.prototype.updateTimePosition=function(e,i){for(var n=0,r=0,a=this.actionObj.cloneElement;r<a.length;r++){var s=a[r].querySelector(".e-time");if(s){var o=this.actionObj.start,l=this.actionObj.end;i&&i.length>0&&(o=i[parseInt(n.toString(),10)][this.parent.eventFields.startTime],l=i[parseInt(n.toString(),10)][this.parent.eventFields.endTime]),s.innerHTML=this.parent.getTimeString(o)+" - "+this.parent.getTimeString(l)}n++}if(this.parent.activeViewOptions.timeScale.enable&&this.parent.isAdaptive&&"Month"!==this.parent.currentView&&"TimelineMonth"!==this.parent.currentView){var p=this.parent.element.querySelector(".e-clone-time-indicator");if(!p){p=t.createElement("div",{className:"e-clone-time-indicator"});var c=this.parent.activeView.isTimelineView()?"e-date-header-wrap":"e-time-cells-wrap";this.parent.element.querySelector("."+c).appendChild(p)}p.innerHTML=this.parent.getTimeString(e);var h=0;if(this.parent.activeView.isTimelineView())if(this.parent.enableRtl){var d=parseInt(this.actionObj.clone.style.right,10);h="drag"===this.actionObj.action||this.resizeEdges.left?d+this.actionObj.clone.offsetWidth:d,p.style.right=t.formatUnit(h)}else{var u=parseInt(this.actionObj.clone.style.left,10);h="drag"===this.actionObj.action||this.resizeEdges.left?u:u+this.actionObj.clone.offsetWidth,p.style.left=t.formatUnit(h)}else h="drag"===this.actionObj.action||this.resizeEdges.top?this.actionObj.clone.offsetTop:this.actionObj.clone.offsetTop+this.actionObj.clone.offsetHeight,p.style.top=t.formatUnit(h)}},e.prototype.getResourceElements=function(e){var t=this;return e.filter(function(e){return parseInt(e.getAttribute("data-group-index"),10)===t.actionObj.groupIndex})},e.prototype.getOriginalElement=function(e){var i,n=e.getAttribute("data-guid");if(e.offsetParent&&e.offsetParent.classList.contains("e-more-event-popup")||this.parent.activeView.isTimelineView()||"resize"!==this.actionObj.action&&this.parent.virtualScrollModule)i=[].slice.call(this.parent.element.querySelectorAll('[data-guid="'+n+'"]'));else{var r=t.closest(e,"tr");r&&(i=[].slice.call(r.querySelectorAll('[data-guid="'+n+'"]')))}return i},e.prototype.createCloneElement=function(e){var i=document.createElement("div");i.appendChild(e.cloneNode(!0));var n=i.children[0],r=["e-schedule-event-clone"];r.push("drag"===this.actionObj.action?"e-drag-clone":"e-resize-clone"),"Month"!==this.parent.currentView&&"TimelineMonth"!==this.parent.currentView||r.push("e-month-event"),t.addClass([n],r),t.addClass([e],"e-event-action"),t.isNullOrUndefined(e.parentElement)||e.parentElement.appendChild(n),n.style.width=t.formatUnit(n.offsetWidth-2);var a=document.querySelector(this.parent.eventDragArea);return this.parent.eventDragArea&&"drag"===this.actionObj.action&&a&&a.appendChild(n),t.setStyleAttribute(n,{border:"0px"}),n},e.prototype.removeCloneElementClasses=function(){var e=this.actionObj.originalElement;"Month"!==this.parent.currentView&&"TimelineYear"!==this.parent.currentView&&"Day"!==this.parent.currentView&&"Week"!==this.parent.currentView&&"WorkWeek"!==this.parent.currentView||(e=[].slice.call(this.parent.element.querySelectorAll(".e-event-action"))),t.removeClass(e,"e-event-action")},e.prototype.removeCloneElement=function(){this.actionObj.originalElement=[];for(var e=0,i=[].slice.call(this.parent.element.querySelectorAll(".e-dynamic-clone"));e<i.length;e++){var n=i[e];t.remove(n)}for(var r=0,a=this.actionObj.cloneElement;r<a.length;r++){var s=a[r];t.isNullOrUndefined(s.parentNode)||t.remove(s)}this.actionObj.cloneElement=[];var o=this.parent.element.querySelector(".e-clone-time-indicator");o&&t.remove(o)},e.prototype.getCursorElement=function(e){var t=this.parent.eventBase.getPageCoordinates(e);return document.elementFromPoint(t.clientX,t.clientY)},e.prototype.autoScroll=function(){var e=this.parent.element.querySelector(".e-content-wrap"),t=e.offsetHeight<=e.scrollHeight,i=e.offsetWidth<=e.scrollWidth,n=t&&e.scrollTop>=0&&e.scrollTop+e.offsetHeight<=e.scrollHeight,r=i&&e.scrollLeft>=0&&e.scrollLeft+e.offsetWidth<=e.scrollWidth;if("resize"===this.actionObj.action&&this.scrollEdges.right&&e.scrollLeft+e.offsetWidth>e.scrollWidth){var a=[].slice.call(this.parent.getContentTable().querySelector("tr").children).length-1;r=Math.ceil((this.actionObj.clone.offsetLeft+this.actionObj.clone.offsetWidth)/this.actionObj.cellWidth)===a}n&&(this.scrollEdges.top||this.scrollEdges.bottom)&&(e.scrollTop+=this.scrollEdges.top?-this.actionObj.scroll.scrollBy:this.actionObj.scroll.scrollBy,"resize"===this.actionObj.action&&e.scrollHeight!==e.offsetHeight+e.scrollTop&&e.scrollTop>0&&(this.actionObj.Y+=this.scrollEdges.top?this.actionObj.scroll.scrollBy:-this.actionObj.scroll.scrollBy)),r&&(this.scrollEdges.left||this.scrollEdges.right)&&(e.scrollLeft+=this.scrollEdges.left?-this.actionObj.scroll.scrollBy:this.actionObj.scroll.scrollBy,"resize"===this.actionObj.action&&e.scrollWidth!==e.offsetWidth+e.scrollLeft&&e.scrollLeft>0&&(this.actionObj.X+=this.scrollEdges.left?this.actionObj.scroll.scrollBy:-this.actionObj.scroll.scrollBy))},e.prototype.autoScrollValidation=function(){if(!this.actionObj.scroll.enable)return!1;var e=this.parent.boundaryValidation(this.actionObj.pageY,this.actionObj.pageX);return this.scrollEdges=e,e.bottom||e.top||e.left||e.right},e.prototype.actionClass=function(e){"addClass"===e?t.addClass([this.parent.element],"e-event-action"):t.removeClass([this.parent.element],"e-event-action")},e.prototype.updateScrollPosition=function(e){var i=this;this.scrollEventArgs=e,this.actionObj.scroll.enable&&t.isNullOrUndefined(this.actionObj.scrollInterval)&&(this.actionObj.scrollInterval=window.setInterval(function(){if(i.autoScrollValidation()&&!i.actionObj.clone.classList.contains("e-all-day-appointment")){if(i.parent.activeView.isTimelineView()&&i.parent.activeViewOptions.group.resources.length>0&&i.actionObj.groupIndex<0)return;i.autoScroll(),"drag"===i.actionObj.action?i.parent.dragAndDropModule.updateDraggingDateTime(i.scrollEventArgs):i.parent.resizeModule.updateResizingDirection(i.scrollEventArgs)}},this.actionObj.scroll.timeDelay))},e.prototype.updateOriginalElement=function(e){var i='[data-id="'+e.getAttribute("data-id")+'"]';this.parent.activeViewOptions.group.resources.length>0&&(i=i.concat('[data-group-index = "'+e.getAttribute("data-group-index")+'"]')),e.hasAttribute("data-guid")&&(i+='[data-guid="'+e.getAttribute("data-guid")+'"]');var n=[].slice.call(this.parent.element.querySelectorAll(i));t.addClass(n,"e-event-action");var r=[].slice.call(this.parent.element.querySelectorAll(".e-schedule-event-clone"));t.removeClass(r,"e-event-action")},e.prototype.getUpdatedEvent=function(e,t,i){var n=JSON.parse(JSON.stringify(i));return n[this.parent.eventFields.startTime]=e,n[this.parent.eventFields.endTime]=t,n},e.prototype.dynamicYearlyEventsRendering=function(e,i){if(void 0===i&&(i=!1),t.isNullOrUndefined(this.parent.eventDragArea)){var n=this.actionObj.cellWidth-7;if(i&&(this.resizeEdges.left||this.resizeEdges.right)&&(n=this.actionObj.cellWidth*e.count),i||"Horizontal"!==this.parent.activeViewOptions.orientation||0!==this.parent.activeViewOptions.group.resources.length||((r=this.yearEvent.isSpannedEvent(e,e[this.parent.eventFields.startTime]))[this.parent.eventFields.startTime].getTime()===r[this.parent.eventFields.endTime].getTime()&&(r.isSpanned.count=1),n=r.isSpanned.count*this.actionObj.cellWidth),!i&&"Vertical"===this.parent.activeViewOptions.orientation&&0!==this.parent.activeViewOptions.group.resources.length){var r=this.yearEvent.isSpannedEvent(e,e[this.parent.eventFields.startTime]);n=r.isSpanned.count*this.actionObj.cellWidth}var a=this.createAppointmentElement(this.actionObj.groupIndex,e[this.parent.eventFields.subject]);a.setAttribute("drag","true"),t.addClass([a],"e-schedule-event-clone"),t.setStyleAttribute(a,{width:n+"px",border:"0px","pointer-events":"none",position:"absolute",overflow:"hidden",padding:"3px"}),""!==this.actionObj.clone.style.backgroundColor&&t.setStyleAttribute(a,{backgroundColor:this.actionObj.clone.style.backgroundColor});var s=b(e[this.parent.eventFields.startTime]).getTime(),o='.e-work-cells[data-date="'+s+'"]';this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(o='.e-work-cells[data-date="'+s+'"][data-group-index="'+this.actionObj.groupIndex+'"]');var l=this.parent.element.querySelector(o);if(!t.isNullOrUndefined(l)){if(i){var p=l.querySelector(".e-date-header"),c=this.actionObj.cellHeight*e.count-(p?p.offsetHeight:0)-7;(this.resizeEdges.right||this.resizeEdges.left)&&(c=parseInt(this.actionObj.clone.style.height,10)),t.setStyleAttribute(a,{height:c+"px"})}this.renderDynamicElement(l,a,!0),this.actionObj.cloneElement.push(a)}}},e.prototype.renderDynamicElement=function(e,i,n){if(e.querySelector(".e-appointment-wrapper"))e.querySelector(".e-appointment-wrapper").appendChild(i);else{var r=t.createElement("div",{className:"e-appointment-wrapper"});r.appendChild(i),e.appendChild(r)}},e.prototype.createAppointmentElement=function(e,i){var n=t.createElement("div",{className:"e-appointment",innerHTML:i});return this.parent.activeViewOptions.group.resources.length>0&&n.setAttribute("data-group-index",e.toString()),n},e.prototype.dynamicEventsRendering=function(e){var i=this;if(t.isNullOrUndefined(this.parent.eventDragArea)){var n,r=this.parent.activeView.renderDates,a=[].slice.call(this.parent.element.querySelectorAll(".e-work-cells")),s=this.parent.activeViewOptions.workDays;if(this.parent.activeViewOptions.group.resources.length>0){var o=(this.parent.virtualScrollModule&&this.parent.virtualScrollModule.isHorizontalScroll?this.parent.resourceBase.renderedResources:this.parent.resourceBase.lastResourceLevel).filter(function(e){return e.groupIndex===i.actionObj.groupIndex});r=o[0].renderDates;var l='.e-work-cells[data-group-index="'+this.actionObj.groupIndex+'"]';a=[].slice.call(this.parent.element.querySelectorAll(l)),s=o[0].workDays,n=o[0].groupOrder}if(this.monthEvent.dateRender=r,this.monthEvent.getSlotDates(s),this.resizeEdges.left||this.resizeEdges.right)for(var p=0,c=[].slice.call(this.parent.element.querySelectorAll(".e-schedule-event-clone"));p<c.length;p++){var h=c[p];t.remove(h)}for(var d=0,u=this.monthEvent.splitEvent(e,r);d<u.length;d++){var g=u[d],v=this.parent.getIndexOfDate(r,b(g[this.monthEvent.fields.startTime])),m=g.data.count*this.actionObj.cellWidth-7,f=this.monthEvent.createAppointmentElement(g,this.actionObj.groupIndex,!0);f.setAttribute("drag","true"),t.addClass([f],"e-schedule-event-clone"),this.monthEvent.applyResourceColor(f,g,"backgroundColor",n),t.setStyleAttribute(f,{width:m+"px",border:"0px","pointer-events":"none"});var y=a[parseInt(v.toString(),10)];y&&(this.monthEvent.renderElement(y,f,!0),this.actionObj.cloneElement.push(f))}}},e.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed||(this.actionObj={},this.scrollArgs={},this.resizeEdges={left:!1,right:!1,top:!1,bottom:!1},this.scrollEdges={left:!1,right:!1,top:!1,bottom:!1})},e}(),$i=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),en=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return $i(i,e),i.prototype.wireResizeEvent=function(e){for(var i=0,n=[].slice.call(e.querySelectorAll(".e-event-resize"));i<n.length;i++){var r=n[i];t.EventHandler.add(r,t.Browser.touchStartEvent,this.resizeStart,this)}},i.prototype.resizeHelper=function(){if(this.parent.activeViewOptions.group.resources.length>0&&this.parent.activeViewOptions.group.allowGroupEdit)for(var e=0,t=this.actionObj.originalElement.length;e<t;e++){var i=this.createCloneElement(this.actionObj.originalElement[parseInt(e.toString(),10)]);this.actionObj.cloneElement[parseInt(e.toString(),10)]=i,this.actionObj.element===this.actionObj.originalElement[parseInt(e.toString(),10)]&&(this.actionObj.clone=i)}else this.actionObj.element&&(this.actionObj.clone=this.createCloneElement(this.actionObj.element)),this.actionObj.cloneElement=[this.actionObj.clone],this.actionObj.originalElement=[this.actionObj.element]},i.prototype.resizeStart=function(e){var i=this;if((!e||"touchstart"!==e.type||this.parent.uiStateValues.isTapHold&&t.closest(e.target,".e-appointment-border"))&&!t.closest(e.target,".e-inline-edit")){var n=t.closest(e.target,".e-event-resize");if(this.actionObj.element=t.closest(n,".e-appointment"),this.actionObj.event=this.parent.eventBase.getEventByGuid(this.actionObj.element.getAttribute("data-guid")),!t.isNullOrUndefined(this.actionObj.event)){this.parent.eventBase.removeSelectedAppointmentClass(),this.actionObj.action="resize",this.actionObj.slotInterval=this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount,this.actionObj.interval=this.actionObj.slotInterval;var r=t.extend({},this.actionObj.event,null,!0),a={cancel:!1,data:r,element:this.actionObj.element,event:e,interval:this.actionObj.interval,scroll:{enable:!0,scrollBy:30,timeDelay:100}};this.parent.trigger("resizeStart",a,function(a){if(!a.cancel){i.actionClass("addClass"),i.parent.uiStateValues.action=!0,i.resizeEdges={left:n.classList.contains("e-left-handler"),right:n.classList.contains("e-right-handler"),top:n.classList.contains("e-top-handler"),bottom:n.classList.contains("e-bottom-handler")},i.actionObj.groupIndex=i.parent.uiStateValues.isGroupAdaptive?i.parent.uiStateValues.groupIndex:0;var s=i.parent.element.querySelector(".e-work-cells");i.actionObj.cellWidth=i.parent.getElementWidth(s),i.actionObj.cellHeight=i.parent.getElementHeight(s);var o=i.parent.activeViewOptions.headerRows.map(function(e){return e.option});if(i.parent.activeView.isTimelineView()&&o.length>0&&["Date","Hour"].indexOf(o.slice(-1)[0])<0){for(var l=i.parent.getContentTable().querySelector("tr"),p=0,c=0,h=[].slice.call(l.children);c<h.length;c++){var d=h[c];p+=parseInt(d.getAttribute("colspan"),10)}var u=l.getBoundingClientRect();i.actionObj.cellWidth=u.width/p,i.actionObj.cellHeight=u.height}var g=i.parent.eventBase.getPageCoordinates(e);i.actionObj.X=g.pageX,i.actionObj.Y=g.pageY,i.actionObj.groupIndex=parseInt(i.actionObj.element.getAttribute("data-group-index")||"0",10),i.actionObj.interval=a.interval,i.actionObj.scroll=a.scroll,i.actionObj.start=new Date(r[i.parent.eventFields.startTime].getTime()),i.actionObj.end=new Date(r[i.parent.eventFields.endTime].getTime()),i.actionObj.originalElement=i.getOriginalElement(i.actionObj.element),"Month"===i.parent.currentView&&(i.daysVariation=-1,i.monthEvent=new Bt(i.parent));var v=i.parent.element.querySelector(".e-content-wrap");if(i.scrollArgs={element:v,width:v.scrollWidth,height:v.scrollHeight},["Month","TimelineYear"].indexOf(i.parent.currentView)<0){var m=Math.round(i.scrollArgs.width/i.actionObj.cellWidth)*i.actionObj.cellWidth;i.scrollArgs.width=i.scrollArgs.width<m?m:i.scrollArgs.width}t.EventHandler.add(document,t.Browser.touchMoveEvent,i.resizing,i),t.EventHandler.add(document,t.Browser.touchEndEvent,i.resizeStop,i)}})}}},i.prototype.resizing=function(e){if(e&&"touchmove"===e.type&&e.preventDefault(),this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(),0===this.parent.element.querySelectorAll(".e-resize-clone").length&&this.resizeHelper(),t.isNullOrUndefined(e.target)||!e.target.classList.contains(pt)){var i=this.parent.eventBase.getPageCoordinates(e);if("Month"===this.parent.currentView||"TimelineYear"===this.parent.currentView){var n=document.documentElement,r=(window.pageXOffset||n.scrollLeft)-(n.clientLeft||0),a=(window.pageYOffset||n.scrollTop)-(n.clientTop||0);this.actionObj.pageX=i.pageX-r,this.actionObj.pageY=i.pageY-a}else this.actionObj.pageX=i.pageX,this.actionObj.pageY=i.pageY;this.updateScrollPosition(e),this.updateResizingDirection(e);var s={cancel:!1,data:t.extend({},this.actionObj.event,null,!0),element:this.actionObj.element,event:e,startTime:this.actionObj.start,endTime:this.actionObj.end};this.parent.group.resources.length>0&&(s.groupIndex=this.actionObj.groupIndex),this.parent.trigger("resizing",s)}},i.prototype.updateResizingDirection=function(e){if("Month"===this.parent.currentView||"TimelineYear"===this.parent.currentView)return void this.monthResizing();var i=this.resizeValidation(e);if(this.resizeEdges.left){if(i){var n=this.getLeftRightStyles(e,!0);if(parseInt(n.width,10)<1)return;for(var r=0,a=this.actionObj.cloneElement;r<a.length;r++){v=a[r];t.setStyleAttribute(v,n),t.addClass([v],"e-left-handler")}}this.horizontalResizing(!this.parent.enableRtl)}if(this.resizeEdges.right){if(i){var s=this.getLeftRightStyles(e,!1);if(parseInt(s.width,10)<1)return;for(var o=0,l=this.actionObj.cloneElement;o<l.length;o++){v=l[o];t.setStyleAttribute(v,s),t.addClass([v],"e-right-handler")}}this.horizontalResizing(this.parent.enableRtl)}if(this.resizeEdges.top){if(i){var p=this.getTopBottomStyles(e,!0);if(parseInt(p.height,10)<1)return;for(var c=0,h=this.actionObj.cloneElement;c<h.length;c++){v=h[c];t.setStyleAttribute(v,p),t.addClass([v],"e-top-handler")}}this.verticalResizing(!0)}if(this.resizeEdges.bottom){if(i){var d=this.getTopBottomStyles(e,!1);if(parseInt(d.height,10)<1)return;for(var u=0,g=this.actionObj.cloneElement;u<g.length;u++){var v=g[u];t.setStyleAttribute(v,d),t.addClass([v],"e-bottom-handler")}}this.verticalResizing(!1)}},i.prototype.monthResizing=function(){if(this.removeCloneElement(),!t.isNullOrUndefined(this.actionObj.pageX)&&!t.isNullOrUndefined(this.actionObj.pageY)){var e=document.elementFromPoint(this.actionObj.pageX,this.actionObj.pageY);if(!t.isNullOrUndefined(e)){var i=this.parent.getDateFromElement(e),n=!(this.parent.activeViewOptions.group.resources.length>0)||parseInt(e.getAttribute("data-group-index"),10)===this.actionObj.groupIndex,r=new Date(this.actionObj.event[this.parent.eventFields.startTime].getTime()),a=new Date(this.actionObj.event[this.parent.eventFields.endTime].getTime());if(!this.parent.enableRtl&&this.resizeEdges.left||this.parent.enableRtl&&this.resizeEdges.right||this.resizeEdges.top?r=i:(!this.parent.enableRtl&&this.resizeEdges.right||this.parent.enableRtl&&this.resizeEdges.left||this.resizeEdges.bottom)&&(a=O(i,1)),n&&r<a){this.actionObj.start=r,this.actionObj.end=a;var s=this.getUpdatedEvent(this.actionObj.start,this.actionObj.end,this.actionObj.event);"TimelineYear"===this.parent.currentView?this.yearEventsRendering(s):this.dynamicEventsRendering(s),this.updateOriginalElement(this.actionObj.clone)}}}},i.prototype.yearEventsRendering=function(e){for(var i=0,n=[].slice.call(this.parent.element.querySelectorAll(".e-schedule-event-clone"));i<n.length;i++){var r=n[i];t.remove(r)}var a=new Date(e[this.parent.eventFields.endTime]),s=0;0===this.parent.activeViewOptions.group.resources.length&&(s=this.getMonthDiff(e[this.parent.eventFields.startTime],O(a,-1)));for(var o=0;o<=s;o++){var l=void 0;0===this.parent.activeViewOptions.group.resources.length?l=this.getEventCount(e,this.actionObj.start.getMonth()+o):(l=t.extend({},e,null,!0),a=this.resizeEdges.left||this.resizeEdges.right?O(a,-1):a,l.count=this.getMonthDiff(e[this.parent.eventFields.startTime],a)+1),this.dynamicYearlyEventsRendering(l,!0)}},i.prototype.getMonthDiff=function(e,t){var i;return i=12*(t.getFullYear()-e.getFullYear()),i-=e.getMonth(),i+=t.getMonth(),i<=0?0:i},i.prototype.getEventCount=function(e,i){var n=t.extend({},e,null,!0),r=n[this.parent.eventFields.startTime],a=n[this.parent.eventFields.endTime],s=new Date(this.parent.selectedDate.getFullYear(),i,1),o=O(new Date(this.parent.selectedDate.getFullYear(),i+1,0),1),l=1;return r.getTime()<s.getTime()&&(n[this.parent.eventFields.startTime]=s),a.getTime()>o.getTime()&&(n[this.parent.eventFields.endTime]=o),0===this.parent.activeViewOptions.group.resources.length&&(l=Math.ceil((n[this.parent.eventFields.endTime].getTime()-n[this.parent.eventFields.startTime].getTime())/Qe)),n.count=l,n},i.prototype.resizeStop=function(e){var i=this;t.EventHandler.remove(document,t.Browser.touchMoveEvent,this.resizing),t.EventHandler.remove(document,t.Browser.touchEndEvent,this.resizeStop),clearInterval(this.actionObj.scrollInterval),this.actionObj.scrollInterval=null,this.actionObj.action=null,this.removeCloneElementClasses(),this.removeCloneElement(),this.actionClass("removeClass"),this.parent.uiStateValues.action=this.parent.uiStateValues.isTapHold=!1;var n={cancel:!1,data:this.getChangedData(),element:this.actionObj.element,event:e};this.parent.trigger("resizeStop",n,function(e){e.cancel||i.parent.eventBase.checkOverlap(e.data)||(i.parent.isSpecificResourceEvents()&&(i.parent.crudModule.crudObj.sourceEvent=[i.parent.resourceBase.lastResourceLevel[parseInt(e.element.getAttribute("data-group-index"),10)]],i.parent.crudModule.crudObj.targetEvent=i.parent.crudModule.crudObj.sourceEvent,i.parent.crudModule.crudObj.isCrudAction=!0),i.saveChangedData(e))})},i.prototype.verticalResizing=function(e){var i=this.actionObj.clone.offsetTop;e||(i+=this.actionObj.clone.offsetHeight);var n=i/Math.round(this.actionObj.cellHeight)*this.actionObj.slotInterval,r=this.actionObj.clone.offsetParent;if(!t.isNullOrUndefined(r)){var a=b(this.parent.getDateFromElement(r));a.setHours(this.parent.activeView.getStartHour().getHours()),a.setMinutes(n+this.parent.activeView.getStartHour().getMinutes()),e?this.actionObj.start=this.calculateIntervalTime(a):this.actionObj.end=this.calculateIntervalTime(a),this.updateTimePosition(a)}},i.prototype.horizontalResizing=function(e){var i,n=new Date(this.actionObj.event[this.parent.eventFields.startTime].getTime()),r=new Date(this.actionObj.event[this.parent.eventFields.endTime].getTime()),a=this.parent.currentView,s="TimelineMonth"===this.parent.currentView;if(this.parent.activeView.isTimelineView()){E=this.parent.getContentTable().querySelector("tr");if(this.parent.activeViewOptions.headerRows.length>0){var o=this.parent.activeViewOptions.headerRows.map(function(e){return e.option});a=o.slice(-1)[0],s&&"Hour"===a&&(a=o.slice(-2)[0]||"Month")}i=e?n:r;var l=0,p=[].slice.call(E.children),c=!1,h=this.actionObj.cellWidth/(this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount),d=parseFloat(this.parent.enableRtl?this.actionObj.clone.style.right:this.actionObj.clone.style.left);if(d=Math.round(d/h)*h,-1!==["Year","Month","Week","Date"].indexOf(a)){for(var u=0,g=0,v=p;g<v.length;g++){var m=v[g];u+=parseInt(m.getAttribute("colspan"),10)}var f=this.parent.enableRtl?parseInt(this.actionObj.clone.style.right,10):parseInt(this.actionObj.clone.style.left,10);f=Math.round(f/this.actionObj.cellWidth)*this.actionObj.cellWidth,e||(f+=this.parent.getElementWidth(this.actionObj.clone)-this.actionObj.cellWidth),l=s?Math.floor(f/Math.floor(this.parent.getElementWidth(E)/u)):Math.round(f/(this.parent.getElementWidth(E)/u)),c=(l=e?l:s?l+1:l)===p.length,l=l<0?0:l>=u?u-1:l}else{var y=this.actionObj.cellWidth;if(l=e?Math.round(d/this.actionObj.cellWidth):Math.ceil((d+(this.parent.getElementWidth(this.actionObj.clone)-y))/this.actionObj.cellWidth),this.parent.enableRtl){var T=Math.round(d/this.actionObj.cellWidth)*this.actionObj.cellWidth+(e?0:this.parent.getElementWidth(this.actionObj.clone)-this.actionObj.cellWidth);l=Math.floor(T/this.actionObj.cellWidth)}c=l===p.length,l=this.getIndex(l)}var w=void 0;if(w=-1!==["Year","Month","Week","Date"].indexOf(a)?new Date(this.parent.activeView.renderDates[parseInt(l.toString(),10)].getTime()):this.parent.getDateFromElement(E.children[parseInt(l.toString(),10)]),-1===["TimelineMonth","Year","Month","Week","Date"].indexOf(a)&&this.parent.activeViewOptions.timeScale.enable){e||(d+=this.parent.getElementWidth(this.actionObj.clone));var D=Math.floor(this.actionObj.slotInterval/this.actionObj.cellWidth*(d-Math.floor(d/this.actionObj.cellWidth)*this.actionObj.cellWidth));D=c||!e&&0===D?this.actionObj.slotInterval:D,i=new Date(w.getTime()),i=new Date(w.getTime()+D*Ke),this.updateTimePosition(i)}else i=new Date(w.setHours(i.getHours(),i.getMinutes(),i.getSeconds()))}else{var C=t.closest(this.actionObj.clone,"td").cellIndex,S=Math.ceil((e?this.parent.getElementWidth(this.actionObj.element):0)/this.actionObj.cellWidth)*this.actionObj.cellWidth,u=Math.ceil((this.parent.getElementWidth(this.actionObj.clone)-S)/this.actionObj.cellWidth),E=t.closest(this.actionObj.clone,"tr"),x=e?C-u:C+u-1;x=this.getIndex(x),i=this.parent.getDateFromElement(E.children[parseInt(x.toString(),10)]),e?i.setHours(n.getHours(),n.getMinutes(),n.getSeconds()):i.setHours(r.getHours(),r.getMinutes(),r.getSeconds())}var V=-1!==["TimelineMonth","Year","Month","Week","WorkWeek","Date","Day"].indexOf(a)||!this.parent.activeViewOptions.timeScale.enable;if(e)r.getTime()-i.getTime()<=0&&(i=V?b(r):n),this.actionObj.start=V?i:this.calculateIntervalTime(i);else{var A=V&&0===i.getHours()&&0===i.getMinutes()?O(i,1):i;V&&A.getTime()-n.getTime()<=0&&(A=O(b(n),1)),this.actionObj.end=V?A:this.calculateIntervalTime(A)}},i.prototype.getTopBottomStyles=function(e,i){var n=this.parent.element.querySelector(".e-content-wrap"),r=this.actionObj.cellHeight/this.actionObj.slotInterval*this.actionObj.interval,a=i?this.actionObj.element.offsetHeight+(this.actionObj.Y-this.actionObj.pageY):this.actionObj.element.offsetHeight+(this.actionObj.pageY-this.actionObj.Y),s=i?this.actionObj.element.offsetTop-(this.actionObj.Y-this.actionObj.pageY):this.actionObj.clone.offsetTop;return a=s<0?this.actionObj.clone.offsetHeight:this.actionObj.clone.offsetTop+this.actionObj.clone.offsetHeight>this.scrollArgs.height?this.actionObj.clone.offsetHeight:a,s=s<0?0:s,a=(s=i?Math.floor(s/r)*r:s)+a>=n.scrollHeight?n.scrollHeight-s:Math.ceil(a/r)*r,!i&&this.actionObj.clone.offsetTop+a>=this.parent.getContentTable().offsetHeight&&(a=this.parent.getContentTable().offsetHeight-this.actionObj.clone.offsetTop),{height:t.formatUnit(a<this.actionObj.cellHeight?Math.floor(a/r)*r:a),top:t.formatUnit(a<this.actionObj.cellHeight&&i?Math.ceil(s/r)*r:s),left:"0px",right:"0px",width:"100%"}},i.prototype.getLeftRightStyles=function(e,i){var n={},r=this.parent.activeView.isTimelineView(),a=["TimelineDay","TimelineWeek","TimelineWorkWeek"].indexOf(this.parent.currentView)>-1&&this.parent.activeViewOptions.timeScale.enable,s=this.actionObj.cellWidth/this.actionObj.slotInterval*this.actionObj.interval,o=i?this.actionObj.X-this.actionObj.pageX:this.actionObj.pageX-this.actionObj.X,l=r?Math.round(this.parent.getElementWidth(this.actionObj.element)/this.actionObj.cellWidth)*this.actionObj.cellWidth:"Month"===this.parent.currentView?this.parent.getElementWidth(this.actionObj.element):Math.ceil(this.parent.getElementWidth(this.actionObj.element)/this.actionObj.cellWidth)*this.actionObj.cellWidth,p=l+Math.ceil(o/this.actionObj.cellWidth)*this.actionObj.cellWidth,c=this.parent.enableRtl?parseInt(this.actionObj.element.style.right,10):this.actionObj.clone.offsetLeft;if(c=Math.round(c/s)*s,a){if(p=l+Math.ceil(o/s)*s,!i){var h=(+parseFloat(this.actionObj.element.style[this.parent.enableRtl?"right":"left"])).toFixed(1),d=Math.round(l/s)*s;h===c.toFixed(1)&&d===l||(p=Math.round((c+p)/s)*s-c)}this.actionObj.event[this.parent.eventFields.isAllDay]=!1}var u=!i&&Math.floor(p+this.actionObj.clone.offsetLeft)>this.scrollArgs.width?this.parent.getElementWidth(this.actionObj.clone):(this.actionObj.cellWidth,p);if(this.parent.enableRtl){var g=r?parseInt(this.actionObj.element.style.right,10):-(p-this.actionObj.cellWidth);g=r?g:i?0:g>0?0:g,r&&!i&&(g=Math.round(g/s)*s,(g-=Math.ceil((this.actionObj.pageX-this.actionObj.X)/s)*s)<0&&(g=parseInt(this.actionObj.clone.style.right,10),u=parseInt(this.actionObj.clone.style.width,10))),g=g>=this.scrollArgs.width?this.scrollArgs.width-this.actionObj.cellWidth:g,n.right=t.formatUnit(g),u=u+g>this.scrollArgs.width?this.parent.getElementWidth(this.actionObj.clone):u}else{var v=i?this.actionObj.element.offsetLeft-(this.actionObj.X-this.actionObj.pageX):this.parent.enableRtl?this.actionObj.element.offsetLeft:0;r&&(v=i?v:parseInt(this.actionObj.clone.style.left,10),v=this.parent.enableRtl?i?v:this.actionObj.pageX<this.actionObj.X-this.parent.getElementWidth(this.actionObj.clone)?parseInt(this.actionObj.clone.style.right,10):v:i&&this.actionObj.pageX>this.actionObj.X+this.parent.getElementWidth(this.actionObj.clone)&&this.parent.getElementWidth(this.actionObj.clone)===this.actionObj.cellWidth?parseInt(this.actionObj.clone.style.left,10):v);var m=v;(v=r?a?i?this.actionObj.element.offsetLeft-Math.ceil((this.actionObj.element.offsetLeft-v)/s)*s:v:Math.floor(v/this.actionObj.cellWidth)*this.actionObj.cellWidth:Math.ceil(Math.abs(v)/this.actionObj.cellWidth)*this.actionObj.cellWidth)<0&&(r&&i&&v%s?(v=parseInt(this.actionObj.clone.style.left,10),u=parseInt(this.actionObj.clone.style.width,10)):(v=0,u=this.parent.getElementWidth(this.actionObj.clone)));var f=Math.ceil(this.parent.getElementWidth(this.actionObj.clone)/this.actionObj.cellWidth)*this.actionObj.cellWidth;i&&(n.left=t.formatUnit(r?v:i?m<0?-v:Math.ceil((l-f)/this.actionObj.cellWidth)*this.actionObj.cellWidth:v))}return u=Math.floor(u),n.width=t.formatUnit(u),n},i.prototype.resizeValidation=function(e){var t=this.parent.eventBase.getPageCoordinates(e),i=this.getContentAreaDimension(),n=this.parent.activeView.isTimelineView()&&this.parent.activeViewOptions.timeScale.enable,r=this.actionObj.cellWidth,a=!1;return this.resizeEdges.left&&(t.pageX<i.leftOffset&&t.pageX>=i.left&&n&&(r=0),a=t.pageX-r>=i.left),this.resizeEdges.right&&(t.pageX>i.rightOffset&&t.pageX<=i.right&&n&&(r=0),a=t.pageX+r<=i.right),this.resizeEdges.top&&(a=this.actionObj.clone.offsetTop>=i.top),this.resizeEdges.bottom&&(a=this.actionObj.clone.offsetTop+this.actionObj.clone.offsetHeight<=this.scrollArgs.height),a},i.prototype.getModuleName=function(){return"resize"},i}(Ji),tn=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),nn=function(e){function i(t){var i=e.call(this,t,"day")||this;return i.isResource=!1,i}return tn(i,e),i.prototype.renderAppointments=function(){this.parent.dragAndDropModule&&this.parent.dragAndDropModule.setDragArea(),this.fields=this.parent.eventFields;for(var e="Year"===this.parent.currentView?".e-work-cells .e-appointment":".e-appointment-wrapper,.e-more-indicator",i=0,n=[].slice.call(this.parent.element.querySelectorAll(e));i<n.length;i++){var r=n[i];t.remove(r)}this.renderedEvents=[],"Year"===this.parent.currentView?this.yearViewEvents():(this.removeCellHeight(),this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive?(this.isResource=!0,this.timelineResourceEvents()):this.timelineYearViewEvents()),this.parent.renderTemplates(),this.parent.notify(Ge,{})},i.prototype.yearViewEvents=function(){for(var e=this.getMonths(),i=0,n=e;i<n.length;i++)for(var r=n[i],a=".e-month-calendar:nth-child("+(e.indexOf(r)+1)+") td.e-work-cells",s=[].slice.call(this.parent.element.querySelectorAll(a)),o=new Date(this.parent.selectedDate.getFullYear(),r,1),l=this.parent.calendarUtil.getMonthStartDate(new Date(o.getTime())),p=this.parent.calendarUtil.getMonthEndDate(new Date(o.getTime())),c=v(l,this.parent.activeViewOptions.firstDayOfWeek),h=O(m(p,this.parent.activeViewOptions.firstDayOfWeek),1),d=0;c.getTime()<h.getTime();d++){var u=b(new Date(c.getTime())),g=O(new Date(u.getTime()),1);if(c=O(new Date(c.getTime()),1),this.parent.isMinMaxDate(u)&&this.parent.eventBase.filterEvents(u,g).length>0){var f=s[parseInt(d.toString(),10)];f&&f.appendChild(t.createElement("div",{className:"e-appointment"}))}}},i.prototype.timelineYearViewEvents=function(){var e=this,i=this.parent.element.querySelector(".e-work-cells:not(.e-other-month)");this.cellWidth=this.parent.getElementWidth(i),this.cellHeader=P(i.querySelector(".e-date-header"));var n=this.parent.element.querySelector(".e-event-table");this.eventHeight=this.parent.getElementHeightFromClass(n,"e-appointment");var r=".e-month-header-wrapper tbody tr,.e-resource-column-table tbody tr,."+nt+" tbody tr";this.addCellHeight(r,this.eventHeight,2,this.cellHeader,this.moreIndicatorHeight);for(var a=[].slice.call(this.parent.element.querySelectorAll("."+at)),s=this.getMonths(),o=this.parent.activeViewOptions.group.resources.length>0&&this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:void 0,l=0;l<s.length;l++){var p=a[parseInt(l.toString(),10)],c=l+1,h=t.createElement("div",{className:"e-appointment-wrapper"});p.appendChild(h);var d=new Date(this.parent.selectedDate.getFullYear(),s[parseInt(l.toString(),10)],1),u=new Date(d.getFullYear(),d.getMonth()+1,0),g=d.getDay(),v=[];for("Horizontal"===this.parent.activeViewOptions.orientation&&(this.renderedEvents=[]);d.getTime()<=u.getTime();){var m=void 0,f=void 0;if("Vertical"===this.parent.activeViewOptions.orientation){var y=a[parseInt(g.toString(),10)];c=g+1,(h=y.querySelector(".e-appointment-wrapper"))||(h=t.createElement("div",{className:"e-appointment-wrapper"}),y.appendChild(h)),this.parent.enableRtl?f=l*this.cellWidth:m=l*this.cellWidth}else this.parent.enableRtl?f=(g+d.getDate()-1)*this.cellWidth:m=(g+d.getDate()-1)*this.cellWidth;var T=this.parent.element.querySelector(".e-content-wrap tr:nth-child("+c+") td");this.cellHeight=T.offsetHeight;var w=b(new Date(d.getTime())),D=O(new Date(w.getTime()),1),C=void 0;this.parent.uiStateValues.isGroupAdaptive&&(C=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]);for(var S=this.parent.eventBase.filterEvents(w,D,void 0,C),E=this,x=0,V=(S=this.parent.eventBase.sortByDateTime(S)).length;x<V;x++)!function(e,i){var n=t.extend({},S[parseInt(e.toString(),10)],null,!0);E.updateSpannedEvents(n,w,D);var r=E.getIndex(w);n.Index=r;var a=E.cellHeader+E.eventHeight*(r+1)+2+E.moreIndicatorHeight,s=E.cellHeight-E.cellHeader-E.moreIndicatorHeight,p=Math.floor(s/(E.eventHeight+2)),c=E.parent.rowAutoHeight?1:E.parent.activeViewOptions.maxEventsPerRow,u=E.parent.activeViewOptions.maxEventsPerRow?i-c:i-p<=0?1:i-p;if("Horizontal"===E.parent.activeViewOptions.orientation){var y=E.renderedEvents.filter(function(e){return e.Guid===n.Guid}),b=v.filter(function(e){return e.Guid===n.Guid});if(y.length>0&&y[0].MoreIndicator||b.length>0&&b[0].MoreIndicator){C="Horizontal"===E.parent.activeViewOptions.orientation?l:g;return E.renderMoreIndicator(h,u,w,C,m,f,o),"continue"}if(y.length>0||b.length>0)return"continue"}if(E.maxHeight&&-1!==E.parent.currentView.indexOf("Timeline")&&r>0)return"continue";if(E.parent.rowAutoHeight||E.shouldRenderAppointment(r,a))E.renderEvent(h,n,l,m,f,d,g),(E.parent.rowAutoHeight||E.cellHeight>a)&&E.updateCellHeight(T,a),v.push(n);else{var C="Horizontal"===E.parent.activeViewOptions.orientation?l:g;E.renderMoreIndicator(h,u,w,C,m,f,o),"Horizontal"===E.parent.activeViewOptions.orientation&&(n.MoreIndicator=!0,E.renderedEvents.push(n),v.push(n))}}(x,V);d=O(new Date(d.getTime()),1),"Vertical"===this.parent.activeViewOptions.orientation&&(g++,this.renderedEvents=[])}}if(this.parent.rowAutoHeight&&"Vertical"===this.parent.activeViewOptions.orientation){var A=[].slice.call(this.parent.element.querySelectorAll("."+at)),I=[].slice.call(this.parent.element.querySelectorAll("."+nt+" tbody tr"));A.forEach(function(t,i){var n=[].slice.call(t.querySelectorAll(".e-appointment")),r=I[parseInt(i.toString(),10)].offsetTop+e.cellHeader+2;n.forEach(function(t){var i=parseInt(t.getAttribute("data-index"),10);t.style.top=r+i*e.eventHeight+"px",t.removeAttribute("data-index")})})}},i.prototype.updateSpannedEvents=function(e,t,i){var n=this.isResource&&"Vertical"===this.parent.activeViewOptions.orientation||!this.isResource&&"Horizontal"===this.parent.activeViewOptions.orientation,r={isLeft:!0,isRight:!0,isBottom:!0,isTop:!0};t.getTime()<=e[this.fields.startTime].getTime()&&(n?r.isLeft=!1:r.isTop=!1),(i.getTime()>=e[this.fields.endTime].getTime()||n&&!this.isResource&&O(i,-1).getMonth()===e[this.fields.endTime].getMonth()||n&&this.isResource&&i.getTime()<=e[this.fields.endTime].getTime())&&(n?r.isRight=!1:r.isBottom=!1),e.data=r},i.prototype.timelineResourceEvents=function(){var e=this,t=this.parent.element.querySelector(".e-content-wrap"),i=t.offsetWidth>t.clientWidth,n=this.parent.element.querySelector(".e-work-cells");this.cellWidth=this.parent.getElementWidth(n),this.cellHeader=0;var r=this.parent.element.querySelector(".e-event-table");this.eventHeight=this.parent.getElementHeightFromClass(r,"e-appointment");var a=".e-month-header-wrapper tbody tr,.e-resource-column-table tbody tr,."+nt+" tbody tr";this.addCellHeight(a,this.eventHeight,2,this.cellHeader,this.moreIndicatorHeight);var s=[].slice.call(this.parent.element.querySelectorAll("."+at)),o=this.parent.uiStateValues.isGroupAdaptive?[this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]]:this.parent.activeViewOptions.allowVirtualScrolling?this.parent.resourceBase.renderedResources:this.parent.resourceBase.lastResourceLevel,l=this.getMonths();if("Horizontal"===this.parent.activeViewOptions.orientation)for(d=0;d<l.length;d++)for(var p=new Date(this.parent.selectedDate.getFullYear(),l[parseInt(d.toString(),10)],1),c=0,h=o.length;c<h;c++)this.renderedEvents=[],this.renderResourceEvent(s[parseInt(d.toString(),10)],o[parseInt(c.toString(),10)],d,c,p);else for(var c=0,h=o.length;c<h;c++){this.renderedEvents=[];for(var d=0;d<l.length;d++){p=new Date(this.parent.selectedDate.getFullYear(),l[parseInt(d.toString(),10)],1);this.renderResourceEvent(s[parseInt(c.toString(),10)],o[parseInt(c.toString(),10)],d,c,p)}}if(this.parent.rowAutoHeight&&!i&&t.offsetWidth>t.clientWidth){[].slice.call(this.parent.element.querySelectorAll(".e-appointment")).forEach(function(e){e.style.removeProperty("left"),e.style.removeProperty("right")});var u=[].slice.call(this.parent.element.querySelectorAll("."+at)),g=this.parent.element.querySelector("."+nt),v=[].slice.call(g.querySelectorAll("tbody tr"));u.forEach(function(t,i){var n=[].slice.call(t.children),r=v[parseInt(i.toString(),10)];n.forEach(function(t,i){var n=r.querySelector("td:nth-child("+(i+1)+")"),a=[].slice.call(t.children),s=e.parent.getElementWidth(n),o=n.offsetLeft;if(e.parent.enableRtl){var l=g.offsetWidth-o-n.offsetWidth;a.forEach(function(e){e.style.width=Math.floor(parseInt(e.style.width,10)/s)*s+"px",e.style.right=l+"px"})}else a.forEach(function(e){e.style.width=Math.floor(parseInt(e.style.width,10)/s)*s+"px",e.style.left=o+"px"})})})}},i.prototype.shouldRenderAppointment=function(e,t){var i=this.parent.rowAutoHeight?1:this.parent.activeViewOptions.maxEventsPerRow;return!this.parent.activeViewOptions.maxEventsPerRow||this.parent.rowAutoHeight||this.parent.eventSettings.enableIndicator?this.maxOrIndicator?e<1:this.cellHeight>t:e<i},i.prototype.renderResourceEvent=function(e,i,n,r,a){var s=t.createElement("div",{className:"e-appointment-wrapper"});e.appendChild(s);var o=O(y(new Date(a.getTime())),1),l=this.parent.eventBase.filterEvents(a,o,void 0,i),p="Vertical"===this.parent.activeViewOptions.orientation?r:n,c=this.parent.element.querySelector(".e-content-wrap tr:nth-child("+(p+1)+") td");this.cellHeight=c.offsetHeight,this.groupOrder=i.groupOrder;for(var h=[],d=this,u=0;u<l.length;u++){var g=function(e){var i=l[parseInt(e.toString(),10)],o=void 0,p=t.extend({},i,null,!0);if(d.parent.activeViewOptions.group.resources.length>0){var u=d.isSpannedEvent(p,a);o=d.getIndex(u[d.fields.startTime]),p.Index=o}else o=d.getIndex(p[d.fields.startTime]),p.Index=o;var g=d.cellHeader+d.eventHeight*(e+1)+2+d.moreIndicatorHeight,v="Vertical"===d.parent.activeViewOptions.orientation?n*d.cellWidth:r*d.cellWidth;if(!d.parent.isMinMaxDate(p[d.fields.startTime]))return{value:void 0};if("Vertical"===d.parent.activeViewOptions.orientation&&d.parent.activeViewOptions.group.resources.length>0){var m=d.renderedEvents.filter(function(e){return e.Guid===p.Guid}),f=h.filter(function(e){return e.Guid===p.Guid});if(m.length>0||f.length>0)return"continue"}if(d.maxHeight&&-1!==d.parent.currentView.indexOf("Timeline")&&o>0)return"continue";if(!d.parent.rowAutoHeight&&!d.shouldRenderAppointment(o,g)){var y="Horizontal"===d.parent.activeViewOptions.orientation?n:r;if(d.renderMoreIndicator(s,l.length-e,a,y,v,v,r),"Horizontal"===d.parent.activeViewOptions.orientation)for(var T=r;T<l.length;T++)d.renderedEvents.push(t.extend({},l[parseInt(T.toString(),10)],{Index:o+T},!0));return"break"}d.renderEvent(s,p,n,v,v,a,r),d.updateCellHeight(c,g),h.push(p)}(u);if("object"==typeof g)return g.value;if("break"===g)break}},i.prototype.setMaxEventHeight=function(e,i){var n=i.offsetHeight-this.cellHeader-(this.maxHeight?0:this.moreIndicatorHeight);t.setStyleAttribute(e,{height:n+"px","align-items":"center"})},i.prototype.renderEvent=function(e,i,n,r,a,s,o){var l,p,c=this,h=this.isSpannedEvent(i,s),d=this.createEventElement(h);if(1===h.isSpanned.count){var u=O(h[this.fields.endTime],-1);h[this.fields.endTime]=u>h[this.fields.startTime]?u:h[this.fields.endTime]}if(!(h[this.fields.startTime]>h[this.fields.endTime])){"Horizontal"===this.parent.activeViewOptions.orientation?(p=n+1,h[this.fields.startTime].getTime()===h[this.fields.endTime].getTime()&&(h.isSpanned.count=1),l=h.isSpanned.count*this.cellWidth):(p=o+1,l=this.isResource?h.isSpanned.count*this.cellWidth:this.cellWidth);var g=this.parent.element.querySelector(".e-content-wrap tr:nth-child("+p+") td"),v=g.offsetTop+this.cellHeader+this.eventHeight*h.Index+2;t.setStyleAttribute(d,{width:l+"px",height:this.eventHeight+"px",left:r+"px",right:a+"px",top:v+"px"}),this.maxOrIndicator&&-1!==this.parent.currentView.indexOf("Timeline")&&this.setMaxEventHeight(d,g),!this.isResource&&this.parent.rowAutoHeight&&"Vertical"===this.parent.activeViewOptions.orientation&&d.setAttribute("data-index",h.Index.toString());var m={data:h,element:d,cancel:!1,type:"event"};this.parent.trigger("eventRendered",m,function(i){i.cancel||(e.appendChild(d),c.wireAppointmentEvents(d,h),c.parent.activeViewOptions.group.resources.length>0?c.renderedEvents.push(t.extend({},h,null,!0)):"Vertical"===c.parent.activeViewOptions.orientation?c.renderedEvents.push(t.extend({},h,null,!0)):((h.isSpanned.isRight||h.isSpanned.isLeft)&&"Horizontal"===c.parent.activeViewOptions.orientation||!h.isSpanned.isRight)&&c.renderedEvents.push(t.extend({},h,null,!0)))})}},i.prototype.renderMoreIndicator=function(e,i,n,r,a,s,o){if(0!==this.parent.activeViewOptions.group.resources.length||!e.querySelector('[data-start-date="'+n.getTime()+'"]')){var l;l=this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive?O(y(new Date(n.getTime())),1):O(new Date(n.getTime()),1);var p=this.getMoreIndicatorElement(i,n,l),c=this.parent.element.querySelector(".e-content-wrap tr:nth-child("+(r+1)+")").offsetTop+(this.cellHeight-this.moreIndicatorHeight);a=Math.floor(a/this.cellWidth)*this.cellWidth,s=Math.floor(s/this.cellWidth)*this.cellWidth,t.setStyleAttribute(p,{width:this.cellWidth+"px",left:a+"px",right:s+"px",top:c+"px"}),t.isNullOrUndefined(o)||p.setAttribute("data-group-index",o.toString()),e.appendChild(p),t.EventHandler.add(p,"click",this.moreIndicatorClick,this)}},i.prototype.createEventElement=function(e){var i=e[this.fields.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),n=t.createElement("div",{className:"e-appointment",attrs:{"data-id":"Appointment_"+e[this.fields.id],"data-guid":e.Guid,role:"button",tabindex:"0","aria-disabled":this.parent.eventBase.getReadonlyAttribute(e),"aria-label":this.parent.getAnnouncementString(e)}});if(this.cssClass&&t.addClass([n],this.cssClass),e[this.fields.isReadonly]&&t.addClass([n],"e-read-only"),this.parent.activeViewOptions.group.resources.length>0){var r=this.getGroupIndexFromEvent(e);n.setAttribute("data-group-index",r.toString())}var a=[],s=t.extend({},e,null,!0);if(this.parent.activeViewOptions.eventTemplate){var o=this.parent.element.id+"_"+this.parent.activeViewOptions.eventTemplateName+"eventTemplate";a=this.parent.getAppointmentTemplate()(s,this.parent,"eventTemplate",o,!1,void 0,void 0,this.parent.root)}else{var l=e[this.fields.location]||this.parent.eventSettings.fields.location.default||"",p=t.createElement("div",{className:"e-subject",innerHTML:i+(l?"; "+l:"")}),c=t.createElement("div",{className:"e-time"+(this.parent.isAdaptive?" e-disable":""),innerHTML:this.parent.getTimeString(s[this.fields.startTime])}),h=t.createElement("div",{className:"e-time"+(this.parent.isAdaptive?" e-disable":""),innerHTML:this.parent.getTimeString(s[this.fields.endTime])});t.addClass([p],"e-text-center"),e[this.fields.isAllDay]?a=[p]:s.isLeft||s.isRight?(s.isLeft||a.push(c),a.push(p),s.isRight||a.push(h)):a=[c,p,h]}var d=t.createElement("div",{className:"e-appointment-details"});return t.append(a,d),n.appendChild(d),this.parent.eventBase.renderSpannedIcon(n,e.isSpanned),this.renderResizeHandler(n,e.data,e[this.fields.isReadonly]),this.applyResourceColor(n,s,"backgroundColor",this.groupOrder),n},i.prototype.isSpannedEvent=function(e,i){var n=new Date(i.getFullYear(),i.getMonth(),1),r=O(new Date(i.getFullYear(),i.getMonth()+1,0),1),a=t.extend({},e,null,!0),s=a[this.fields.startTime],o=a[this.fields.endTime],l={isLeft:!1,isRight:!1,count:1},p=new Date(this.parent.selectedDate.getFullYear(),this.parent.firstMonthOfYear,1),c=E(p,this.parent.monthsCount);if(this.isResource&&this.updateSpannedEvents(e,n,r),"Vertical"===this.parent.activeViewOptions.orientation&&this.parent.activeViewOptions.group.resources.length>0){this.updateSpannedEventDetails(s,o,p,c,a,l);var h=a[this.fields.startTime],d=new Date(a[this.fields.endTime]-1);l.count=d.getMonth()-h.getMonth()+this.parent.monthsCount*(d.getFullYear()-h.getFullYear())+1}else if(this.updateSpannedEventDetails(s,o,n,r,a,l),0===this.parent.activeViewOptions.group.resources.length||this.parent.uiStateValues.isGroupAdaptive){var u=b(a[this.fields.endTime]).getTime(),g=b(a[this.fields.startTime]).getTime();(e[this.fields.isAllDay]&&u===e[this.fields.endTime].getTime()||l.isRight)&&(u=O(new Date(u),-1).getTime()),l.count=Math.round((u-g)/Qe)+1}return a.isSpanned=l,b(s).getTime()<b(this.parent.minDate).getTime()&&(a[this.fields.startTime]=this.parent.minDate),b(o).getTime()>b(this.parent.maxDate).getTime()&&(a[this.fields.endTime]=this.parent.maxDate),a},i.prototype.updateSpannedEventDetails=function(e,t,i,n,r,a){e.getTime()<i.getTime()&&(r[this.fields.startTime]=i,a.isLeft=!0),t.getTime()>n.getTime()&&(r[this.fields.endTime]=n,a.isRight=!0)},i.prototype.getOverlapEvents=function(e,t){var i,n,r=[];if(this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive){var a=this.parent.calendarUtil.getMonthStartDate(new Date(e.getTime())),s=O(this.parent.calendarUtil.getMonthEndDate(new Date(e.getTime())),-1);i=b(new Date(a.getTime())).getTime(),n=b(new Date(s.getTime())).getTime()}else this.parent.rowAutoHeight?(i=b(new Date(e.getTime())).getTime(),n=O(b(new Date(e.getTime())),1).getTime()):i=n=b(new Date(e.getTime())).getTime();for(var o=0,l=t;o<l.length;o++){var p=l[o],c=new Date(p[this.fields.startTime].getTime()),h=new Date(p[this.fields.endTime].getTime()),d=p[this.fields.isAllDay]?b(h).getTime()>i||b(h).getTime()===i&&h.getTime()!==b(h).getTime():b(h).getTime()>=i;b(c).getTime()<=i&&d||b(c).getTime()>=i&&b(h).getTime()<=n?r.push(p):"Vertical"===this.parent.activeViewOptions.orientation&&b(c).getTime()>=i&&b(h).getTime()>=n&&r.push(p)}return r},i.prototype.getMonths=function(){var e=this;return Array.apply(null,{length:this.parent.monthsCount}).map(function(t,i){return e.parent.firstMonthOfYear+i})},i.prototype.removeCellHeight=function(){for(var e=".e-month-header-wrapper tbody tr,.e-resource-column-table tbody tr,."+nt+" tbody tr",t=0,i=[].slice.call(this.element.querySelectorAll(e));t<i.length;t++)i[t].firstElementChild.style.height=""},i.prototype.destroy=function(){e.prototype.destroy.call(this),this.parent=null},i}(zt),rn=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),an=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.widthUptoCursorPoint=0,t.heightUptoCursorPoint=0,t.cursorPointIndex=0,t.isHeaderRows=!1,t.isTimelineDayProcess=!1,t.widthPerMinute=0,t.heightPerMinute=0,t.minDiff=0,t.isStepDragging=!1,t.isMorePopupOpened=!1,t.isAllDayDrag=!1,t.isMultiSelect=!1,t.multiData=[],t.updatedData=[],t.swagData=[],t.startTime=0,t.isAllDayTarget=!1,t.targetTd=null,t.isCursorAhead=!1,t.enableCurrentViewDrag=!1,t.isPreventMultiDrag=!1,t.slotsUptoCursor=-1,t.eleTop=0,t.distanceUptoCursor=0,t}return rn(i,e),i.prototype.wireDragEvent=function(e){new t.Draggable(e,{abort:".e-event-resize, .e-inline-edit",clone:!0,isDragScroll:!0,enableTailMode:!!this.parent.eventDragArea,cursorAt:this.parent.eventDragArea?{left:-20,top:-20}:{left:0,top:0},dragArea:this.dragArea,dragStart:this.dragStart.bind(this),drag:this.drag.bind(this),dragStop:this.dragStop.bind(this),enableAutoScroll:!1,helper:this.dragHelper.bind(this),queryPositionInfo:this.dragPosition.bind(this)})},i.prototype.setDragArea=function(){var e=document.querySelector(this.parent.eventDragArea);this.dragArea=this.parent.eventDragArea&&e?e:this.parent.element.querySelector("."+nt)},i.prototype.dragHelper=function(e){var i=this;if(e.sender&&"touchmove"===e.sender.type&&(!this.parent.uiStateValues.isTapHold||!e.element.classList.contains("e-appointment-border")))return null;if(this.setDragActionDefaultValues(),this.actionObj.element=e.element,e.sender&&["Day","Week","WorkWeek"].indexOf(this.parent.currentView)>-1){var n=this.parent.eventBase.getPageCoordinates(e.sender);this.distanceUptoCursor=n.clientY-this.actionObj.element.getBoundingClientRect().top,this.eleTop=parseFloat(this.actionObj.element.style.top),this.slotsUptoCursor=-1}this.actionObj.action="drag";var r=[];return!this.parent.allowMultiDrag||t.isNullOrUndefined(this.parent.selectedElements)||0===this.parent.selectedElements.length||this.parent.selectedElements.length>0&&-1===this.parent.selectedElements.indexOf(this.actionObj.element)?r=[e.element]:(r=this.parent.selectedElements,this.isMultiSelect=!0),r.forEach(function(e){var n=i.createCloneElement(e);e.getAttribute("data-guid")===i.actionObj.element.getAttribute("data-guid")&&(i.actionObj.clone=n,i.parent.eventDragArea||"Month"===i.parent.currentView||!i.parent.activeViewOptions.timeScale.enable||i.parent.activeView.isTimelineView()||i.actionObj.element.classList.contains("e-all-day-appointment")||t.setStyleAttribute(i.actionObj.clone,{cursor:"move",left:"0%",right:"0%",width:"100%"}),i.actionObj.clone.style.top=t.formatUnit(i.actionObj.element.offsetTop)),i.actionObj.cloneElement.push(n),i.actionObj.originalElement.push(e)}),this.actionObj.clone},i.prototype.dragPosition=function(e){if(this.parent.eventDragArea)return{left:e.left,top:e.top};var i=this.actionObj.cellHeight/this.actionObj.slotInterval*this.actionObj.interval,n=t.formatUnit(0);"Month"===this.parent.currentView&&(n=e.left);var r;r=this.isStepDragging?Math.ceil(this.actionObj.clone.getBoundingClientRect().right)+this.actionObj.interval:this.actionObj.clone.getBoundingClientRect().right;var a=this.parent.element.querySelector(".e-content-wrap").getBoundingClientRect().right;!(this.parent.activeView.isTimelineView()&&"TimelineYear"!==this.parent.currentView&&!this.parent.enableRtl&&this.actionObj.pageX>r)||this.isMorePopupOpened||this.actionObj.pageX>a||(this.isCursorAhead=!0),this.parent.activeView.isTimelineView()&&(n=t.formatUnit(this.actionObj.clone.offsetLeft));var s;if(this.parent.activeView.isTimelineView()||!this.parent.timeScale.enable||!t.isNullOrUndefined(this.actionObj.clone.offsetParent)&&this.actionObj.clone.offsetParent.classList.contains("e-more-event-popup"))s=t.formatUnit(this.actionObj.clone.offsetTop);else if("Month"===this.parent.currentView)s=t.formatUnit(0);else if(this.actionObj.clone.classList.contains("e-all-day-appointment"))s=t.formatUnit(this.parent.element.querySelector(".e-all-day-row").offsetTop),t.setStyleAttribute(this.actionObj.clone,{width:t.formatUnit(Math.ceil(this.actionObj.clone.offsetWidth/this.actionObj.cellWidth)*this.actionObj.cellWidth),right:this.parent.enableRtl&&t.formatUnit(0)});else{this.actionObj.element.classList.contains("e-all-day-appointment")&&!this.actionObj.clone.classList.contains("e-all-day-appointment")&&t.setStyleAttribute(this.actionObj.clone,{height:t.formatUnit(this.actionObj.cellHeight),width:t.formatUnit(this.actionObj.cellWidth-1),pointerEvents:"none"});var o=parseInt(e.top,10);if(o=o<0?0:o,this.slotsUptoCursor<0){var l=Math.floor((this.eleTop+this.distanceUptoCursor)/i),p=Math.floor(this.eleTop/i);this.slotsUptoCursor=l-p}o=(Math.floor((o+this.distanceUptoCursor+1)/i)-this.slotsUptoCursor)*i,s=t.formatUnit(o<0?0:o);var c=this.parent.element.querySelector(".e-content-wrap").scrollHeight,h=parseInt(s,10)+this.actionObj.clone.offsetHeight;h>c&&(s=parseInt(s,10)-(h-c)+"px"),this.isPreventMultiDrag&&(s=t.formatUnit(this.actionObj.clone.offsetTop))}return{left:n,top:s}},i.prototype.setDragActionDefaultValues=function(){this.actionObj.action="drag",this.actionObj.isAllDay=null,this.actionObj.slotInterval=this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount,this.actionObj.interval=this.actionObj.slotInterval;var e=this.parent.element.querySelector(".e-work-cells");this.actionObj.cellWidth=e.offsetWidth,this.actionObj.cellHeight=e.offsetHeight},i.prototype.dragStart=function(e){var i=this,n=this.actionObj.element.getAttribute("data-guid");this.actionObj.event=this.parent.eventBase.getEventByGuid(n);var r=t.extend({},this.actionObj.event,null,!0);t.isNullOrUndefined(r)||(this.startTime=r[this.parent.eventFields.startTime].getTime()),this.parent.allowMultiDrag||this.parent.eventBase.removeSelectedAppointmentClass();var a={cancel:!1,data:r,selectedData:this.getSelectedData(),event:e,excludeSelectors:null,element:this.actionObj.element,interval:this.actionObj.interval,navigation:{enable:!1,timeDelay:2e3},scroll:{enable:!0,scrollBy:30,timeDelay:100}};this.parent.trigger("dragStart",a,function(n){if(n.cancel||!t.isNullOrUndefined(i.actionObj.element)&&t.isNullOrUndefined(i.actionObj.element.parentElement)){var s=i.actionObj.element.ej2_instances[0];return t.isNullOrUndefined(s)||s.intDestroy(e.event),i.isMultiSelect=!1,i.multiData=[],i.actionObj.action="",i.removeCloneElementClasses(),void i.removeCloneElement()}i.actionClass("addClass"),i.parent.uiStateValues.action=!0,i.actionObj.start=r[i.parent.eventFields.startTime],i.actionObj.end=r[i.parent.eventFields.endTime],i.actionObj.groupIndex=parseInt(i.actionObj.element.getAttribute("data-group-index")||"0",10),i.actionObj.interval=n.interval,i.actionObj.navigation=n.navigation,i.actionObj.scroll=n.scroll,i.enableCurrentViewDrag=a.dragWithinRange&&!a.navigation.enable&&i.parent.allowMultiDrag,i.actionObj.excludeSelectors=n.excludeSelectors;var o=i.parent.element.querySelector(".e-content-wrap");if(i.scrollArgs={element:o,width:o.scrollWidth,height:o.scrollHeight},i.widthPerMinute=i.actionObj.cellWidth/i.actionObj.slotInterval*i.actionObj.interval,i.heightPerMinute=i.actionObj.cellHeight/i.actionObj.slotInterval*i.actionObj.interval,i.widthUptoCursorPoint=0,i.heightUptoCursorPoint=0,i.cursorPointIndex=-1,i.isHeaderRows=!1,i.isTimelineDayProcess=!1,i.minDiff=0,i.isMorePopupOpened=!1,i.daysVariation=-1,i.isAllDayTarget=i.actionObj.clone.classList.contains("e-all-day-appointment"),(i.parent.activeView.isTimelineView()||!i.parent.timeScale.enable)&&"TimelineYear"!==i.parent.currentView){!t.isNullOrUndefined(i.actionObj.clone.offsetParent)&&i.actionObj.clone.offsetParent.classList.contains("e-more-event-popup")&&(i.isMorePopupOpened=!0),i.actionObj.pageX=e.event.pageX;var l=i.parent.activeViewOptions.headerRows;i.isHeaderRows=l.length>0&&"Hour"!==l[l.length-1].option&&"Date"!==l[l.length-1].option,i.isTimelineDayProcess=!i.parent.activeViewOptions.timeScale.enable||i.isHeaderRows||"TimelineMonth"===i.parent.currentView||l.length>0&&"Date"===l[l.length-1].option,i.isAllDayDrag=!i.isTimelineDayProcess&&r[i.parent.eventFields.isAllDay],i.isStepDragging=!i.isTimelineDayProcess&&!i.isAllDayDrag&&i.actionObj.slotInterval!==i.actionObj.interval,i.isTimelineDayProcess?i.timelineEventModule=new zt(i.parent,"day"):i.timelineEventModule=new zt(i.parent,"hour")}"TimelineYear"===i.parent.currentView&&(i.yearEvent=new nn(i.parent)),"Month"===i.parent.currentView&&(i.startTime=b(new Date(i.startTime)).getTime(),i.updateOriginalElement(i.actionObj.clone),i.monthEvent=new Bt(i.parent)),"Day"!==i.parent.currentView&&"Week"!==i.parent.currentView&&"WorkWeek"!==i.parent.currentView||(i.verticalEvent=new Ft(i.parent),i.verticalEvent.initializeValues(),i.splitEvent(i.actionObj.event).forEach(function(e){var n='.e-day-wrapper[data-date="'+b(e[i.parent.eventFields.startTime]).getTime()+'"]';i.parent.activeViewOptions.group.resources.length>0&&(n=n.concat('[data-group-index = "'+i.actionObj.groupIndex+'"]'));var r=i.parent.element.querySelector(n);if(r){var a=r.querySelector('[data-id="'+i.actionObj.clone.getAttribute("data-id")+'"]');a&&t.addClass([a],"e-event-action")}}))})},i.prototype.getSelectedData=function(){if(this.isMultiSelect&&0===this.multiData.length&&this.parent.selectedElements.length>0)for(var e=0,i=this.parent.selectedElements;e<i.length;e++){var n=i[e].getAttribute("data-guid"),r=this.parent.eventBase.getEventByGuid(n);this.multiData.push(t.extend({},r,null,!0))}return this.multiData},i.prototype.drag=function(e){if(e.event&&"touchmove"===e.event.type&&e.event.preventDefault(),this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(!0),t.isNullOrUndefined(e.target)||!e.target.classList||!e.target.classList.contains(pt)){var i=t.extend({},this.actionObj.event,null,!0),n=this.parent.eventBase.getPageCoordinates(e);if(this.actionObj.Y=this.actionObj.pageY=n.pageY,this.actionObj.X=this.actionObj.pageX=n.pageX,this.actionObj.target=e.target,this.widthUptoCursorPoint=0===this.widthUptoCursorPoint?Math.ceil(Math.abs(this.actionObj.clone.getBoundingClientRect().left-this.actionObj.X)/this.widthPerMinute)*this.widthPerMinute:this.widthUptoCursorPoint,this.widthUptoCursorPoint=this.isMorePopupOpened?this.actionObj.cellWidth:this.widthUptoCursorPoint,this.heightUptoCursorPoint=0===this.heightUptoCursorPoint?Math.ceil(Math.abs(this.actionObj.clone.getBoundingClientRect().top-this.actionObj.Y)/this.heightPerMinute)*this.heightPerMinute:this.heightUptoCursorPoint,["Day","Week","WorkWeek"].indexOf(this.parent.currentView)>-1&&(this.isAllDayDrag=this.parent.activeViewOptions.timeScale.enable?this.actionObj.clone.classList.contains("e-all-day-appointment"):this.actionObj.event[this.parent.eventFields.isAllDay]),this.isStepDragging&&0===this.minDiff&&this.calculateMinutesDiff(i),("Month"===this.parent.currentView||this.isAllDayDrag)&&this.daysVariation<0){var r=this.parent.getDateFromElement(this.actionObj.target);if(t.isNullOrUndefined(r))this.daysVariation=0;else{var a=b(r),s=b(new Date(i[this.parent.eventFields.startTime].getTime()));this.daysVariation=(a.getTime()-s.getTime())/Qe}}else this.daysVariation=0;if(this.parent.eventDragArea){var o=n.target;this.actionObj.clone.style.top=t.formatUnit(o.offsetTop),this.actionObj.clone.style.left=t.formatUnit(o.offsetLeft),t.closest(o,"."+$e)?"Week"!==this.parent.currentView&&"WorkWeek"!==this.parent.currentView&&"Day"!==this.parent.currentView&&(this.actionObj.clone.style.width=t.formatUnit(this.actionObj.element.offsetWidth)):(this.actionObj.clone.style.height="",this.actionObj.clone.style.width="")}this.updateScrollPosition(e),this.updateNavigatingPosition(e),this.updateDraggingDateTime(e);var l={data:i,event:e,element:this.actionObj.element,startTime:this.actionObj.start,endTime:this.actionObj.end,selectedData:this.updatedData};this.parent.group.resources.length>0&&(l.groupIndex=this.actionObj.groupIndex),this.parent.trigger("drag",l)}},i.prototype.calculateMinutesDiff=function(e){this.parent.enableRtl?this.minDiff=(this.actionObj.clone.offsetWidth-this.widthUptoCursorPoint)/this.widthPerMinute*this.actionObj.interval:this.minDiff=this.widthUptoCursorPoint/this.widthPerMinute*this.actionObj.interval;var t=e[this.parent.eventFields.startTime],i=V(this.parent.activeView.renderDates[0],this.parent.activeView.getStartHour(),this.parent.activeView.getEndHour());i.startHour.getTime()>t.getTime()&&(this.minDiff=this.minDiff+(i.startHour.getTime()-t.getTime())/Ke)},i.prototype.dragStop=function(e){var i=this;if(this.isCursorAhead=!1,this.isPreventMultiDrag=!1,this.removeCloneElementClasses(),this.removeCloneElement(),clearInterval(this.actionObj.navigationInterval),this.actionObj.navigationInterval=null,clearInterval(this.actionObj.scrollInterval),this.actionObj.scrollInterval=null,this.actionClass("removeClass"),this.parent.uiStateValues.action=this.parent.uiStateValues.isTapHold=!1,!this.isAllowDrop(e)){var n=e.target.classList&&!e.target.classList.contains("e-work-cells")&&this.parent.cellTemplate?t.closest(e.target,".e-work-cells"):e.target,r={cancel:!1,data:this.getChangedData(this.updatedData),selectedData:this.updatedData,event:e,element:this.actionObj.element,target:n};this.actionObj.action=null,this.parent.trigger("dragStop",r,function(e){if(!e.cancel&&!i.parent.eventBase.checkOverlap(e.data)){if(i.parent.isSpecificResourceEvents()){i.parent.crudModule.crudObj.isCrudAction=!0,i.parent.crudModule.crudObj.sourceEvent=[i.parent.resourceBase.lastResourceLevel[parseInt(r.element.getAttribute("data-group-index"),10)]];var t=parseInt(r.target.getAttribute("data-group-index"),10)||i.actionObj.groupIndex;i.parent.crudModule.crudObj.targetEvent=[i.parent.resourceBase.lastResourceLevel[parseInt(t.toString(),10)]]}i.saveChangedData(e,i.isMultiSelect)}}),this.updatedData=[],this.multiData=[],this.isMultiSelect=!1,this.parent.selectedElements=[]}},i.prototype.updateNavigatingPosition=function(e){var i=this;if(this.actionObj.navigation.enable){var n=this.parent.getCurrentTime();t.isNullOrUndefined(this.actionObj.navigationInterval)&&(this.actionObj.navigationInterval=window.setInterval(function(){if(n){var t=i.parent.getCurrentTime().getSeconds(),r=n.getSeconds()+i.actionObj.navigation.timeDelay/1e3;(r=r>=60?r-60:r)===t&&(n=i.parent.getCurrentTime(),i.viewNavigation(e),i.updateDraggingDateTime(e))}},this.actionObj.navigation.timeDelay))}},i.prototype.updateDraggingDateTime=function(e){!t.isNullOrUndefined(this.actionObj.clone.offsetParent)&&this.actionObj.clone.offsetParent.classList.contains("e-more-event-popup")?this.morePopupEventDragging(e):this.parent.activeView.isTimelineView()&&"TimelineYear"!==this.parent.currentView?(this.timelineEventModule.dateRender=this.parent.activeView.renderDates,this.timelineEventModule.cellWidth=this.actionObj.cellWidth,this.timelineEventModule.getSlotDates(),this.actionObj.cellWidth=this.isHeaderRows?this.timelineEventModule.cellWidth:this.parent.getElementWidth(this.parent.element.querySelector(".e-work-cells")),this.calculateTimelineTime(e)):"Month"===this.parent.currentView||"TimelineYear"===this.parent.currentView?this.calculateVerticalDate(e):this.calculateVerticalTime(e)},i.prototype.navigationWrapper=function(){if(this.parent.activeView.isTimelineView()){var e=void 0;if(e=this.parent.activeViewOptions.group.resources.length>0?this.parent.element.querySelectorAll(".e-appointment-container:not(.e-hidden)").item(this.actionObj.index):this.parent.element.querySelector("."+at),!t.isNullOrUndefined(e)){var i=e.querySelector(".e-appointment-wrapper");i||(i=t.createElement("div",{className:"e-appointment-wrapper"}),e.appendChild(i)),this.actionObj.cloneElement.forEach(function(e){i.appendChild(e)})}}else if("Month"!==this.parent.currentView&&this.parent.timeScale.enable){var n=this.actionObj.clone.classList.contains("e-all-day-appointment")?".e-all-day-appointment-wrapper":".e-appointment-wrapper";if(this.parent.element.querySelectorAll(n).item(this.actionObj.index).appendChild(this.actionObj.clone),".e-all-day-appointment-wrapper"===n){var r=this.getAllDayEventHeight(),a=[].slice.call(this.parent.element.querySelectorAll(".e-all-day-cells:first-child"));if(a[0].offsetHeight<r)for(var s=0,o=a;s<o.length;s++)o[s].style.height=(r+2)/12+"em";this.actionObj.clone.style.height=t.formatUnit(r)}this.actionObj.height=parseInt(this.actionObj.clone.style.height,10)}else{var l=[].slice.call(this.parent.element.querySelectorAll(".e-work-cells"));this.actionObj.index=this.parent.activeView.renderDates.length<this.actionObj.index?this.parent.activeView.renderDates.length-1:this.actionObj.index;var p=l[this.actionObj.index].querySelector(".e-appointment-wrapper");p||(p=t.createElement("div",{className:"e-appointment-wrapper"}),l[this.actionObj.index].appendChild(p)),p.appendChild(this.actionObj.clone)}},i.prototype.viewNavigation=function(e){var i,n=this.parent.element.querySelector(".e-content-wrap");n&&(!this.scrollEdges.top&&!this.scrollEdges.bottom||t.closest(this.actionObj.clone,".e-all-day-appointment-wrapper"))&&(0===n.scrollLeft&&Math.round(this.actionObj.X)<=Math.round(n.getBoundingClientRect().left+this.actionObj.cellWidth+window.pageXOffset)?i=this.parent.enableRtl?"Next":"Previous":Math.round(n.scrollLeft)+n.clientWidth===n.scrollWidth&&Math.round(this.actionObj.X)>=Math.round(n.getBoundingClientRect().right-this.actionObj.cellWidth+window.pageXOffset)&&(i=this.parent.enableRtl?"Previous":"Next"),i&&this.parent.changeDate(this.parent.activeView.getNextPreviousDate(i)))},i.prototype.morePopupEventDragging=function(e){if(!(t.isNullOrUndefined(e.target)||e.target&&t.isNullOrUndefined(t.closest(e.target,"td")))){var i=t.extend({},this.actionObj.event,null,!0),n=i[this.parent.eventFields.endTime].getTime()-i[this.parent.eventFields.startTime].getTime(),r=t.closest(e.target,"td");if("TimelineYear"!==this.parent.currentView||r.classList.contains("e-work-cells")&&!r.classList.contains("e-other-month")){var a=this.parent.getDateFromElement(r),s=new Date(a.getTime());s.setMilliseconds(n),this.parent.activeViewOptions.group.resources.length>0&&(this.actionObj.groupIndex=parseInt(r.getAttribute("data-group-index"),10)),this.actionObj.start=new Date(a.getTime()),this.actionObj.end=new Date(s.getTime()),this.actionObj.clone.style.top=t.formatUnit(r.offsetParent.offsetTop),this.actionObj.clone.style.left=t.formatUnit(r.offsetLeft),this.actionObj.clone.style.width=t.formatUnit(r.offsetWidth),this.actionObj.cloneElement.length>1&&this.actionObj.cloneElement.forEach(function(e){e.style.width=t.formatUnit(r.offsetWidth)});var o,l=r;if(this.parent.activeView.isTimelineView()){var p=t.closest(r,"tr").rowIndex;l=this.parent.element.querySelectorAll(".e-appointment-container").item(p)}(o=l.querySelector(".e-appointment-wrapper"))||(o=t.createElement("div",{className:"e-appointment-wrapper"}),l.appendChild(o)),this.appendCloneElement(o)}}},i.prototype.calculateVerticalTime=function(e){var i=this;if(!(t.isNullOrUndefined(this.actionObj.target)||this.actionObj.target&&t.isNullOrUndefined(t.closest(this.actionObj.target,"tr")))&&(t.isNullOrUndefined(t.closest(this.actionObj.target,"td"))||t.closest(this.actionObj.target,"td").classList.contains("e-work-cells")||t.closest(this.actionObj.target,"td").classList.contains("e-all-day-cells"))){this.parent.activeViewOptions.timeScale.enable&&this.swapDragging(e);var n=this.parent.element.querySelector(".e-content-wrap"),r=t.extend({},this.actionObj.event,null,!0),a=r[this.parent.eventFields.startTime],s=L(r[this.parent.eventFields.endTime])-L(a),o=Math.floor(parseInt(this.actionObj.clone.style.top,10)/this.actionObj.cellHeight)*this.actionObj.cellHeight;o=o<0?0:o,(this.scrollEdges.top||this.scrollEdges.bottom)&&(o=this.scrollEdges.top?n.scrollTop-this.heightUptoCursorPoint+this.actionObj.cellHeight+window.pageYOffset:n.scrollTop+n.offsetHeight-this.actionObj.clone.offsetHeight+window.pageYOffset+(this.actionObj.clone.offsetHeight-this.heightUptoCursorPoint),o=Math.round(o/this.actionObj.cellHeight)*this.actionObj.cellHeight,n.scrollTop>0&&o<n.scrollHeight&&(this.actionObj.clone.style.top=t.formatUnit(o)));var l,p=this.parent.activeViewOptions.timeScale.enable?o/this.actionObj.cellHeight:0,c=this.actionObj.cellHeight/this.actionObj.slotInterval,h=parseInt(this.actionObj.clone.style.top,10)-o;l=this.isAllDayDrag?this.parent.element.querySelector(".e-all-day-row"):[].slice.call(this.parent.getContentTable().querySelectorAll("tr"))[parseInt(p.toString(),10)];var d;t.isNullOrUndefined(t.closest(this.actionObj.target,"td"))||!t.closest(this.actionObj.target,"td").classList.contains("e-work-cells")&&!t.closest(this.actionObj.target,"td").classList.contains("e-all-day-cells")||(d=t.closest(this.actionObj.target,"td").cellIndex);var u=t.isNullOrUndefined(d)?t.closest(this.actionObj.clone,"td").cellIndex:d;if(this.actionObj.index=u,!t.isNullOrUndefined(l)){var g=l.children[parseInt(u.toString(),10)];this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(this.actionObj.groupIndex=parseInt(g.getAttribute("data-group-index"),10));var v,m;if(this.parent.activeViewOptions.timeScale.enable&&!this.isAllDayDrag)this.enableCurrentViewDrag&&0!==this.multiData.length||this.appendCloneElement(this.getEventWrapper(u)),(v=this.parent.getDateFromElement(g)).setMinutes(v.getMinutes()+h/c),m=new Date(v.getTime()),this.actionObj.element.classList.contains("e-all-day-appointment")?m.setMinutes(m.getMinutes()+this.actionObj.slotInterval):m.setMilliseconds(s);else{(v=this.parent.getDateFromElement(g)).setDate(v.getDate()-this.daysVariation),v.setHours(a.getHours(),a.getMinutes(),a.getSeconds()),(m=new Date(v.getTime())).setMilliseconds(s),!this.actionObj.element.classList.contains("e-all-day-appointment")&&this.actionObj.clone.classList.contains("e-all-day-appointment")&&(m=O(b(m),1));var f=this.parent.activeViewOptions.group.byDate||this.parent.virtualScrollModule&&!this.parent.activeViewOptions.timeScale.enable?u:void 0;this.updateAllDayEvents(v,m,f)}this.actionObj.start=new Date(+v),this.actionObj.end=new Date(+m);for(var y=this.getUpdatedEvent(this.actionObj.start,this.actionObj.end,this.actionObj.event),T=0,w=[].slice.call(this.parent.element.querySelectorAll(".e-dynamic-clone"));T<w.length;T++){R=w[T];t.remove(R)}if(this.multiData.length>0){if(this.isAllDayTarget&&this.isAllDayDrag&&!t.isNullOrUndefined(this.actionObj.isAllDay)&&!this.actionObj.isAllDay){var D=parseInt(t.closest(this.actionObj.target,"td").getAttribute("data-date"),10);this.multiData.forEach(function(e){if(i.swagData.push(t.extend({},e,null,!0)),e[i.parent.eventFields.isAllDay]){e[i.parent.eventFields.startTime]=new Date(e[i.parent.eventFields.startTime].getTime()+(D-i.startTime));var n=new Date(e[i.parent.eventFields.startTime]),r=new Date(n.setMinutes(n.getMinutes()+i.actionObj.slotInterval));e[i.parent.eventFields.endTime]=r,e[i.parent.eventFields.isAllDay]=!1}}),this.startTime=D}if(this.isAllDayTarget&&this.isAllDayDrag&&!t.isNullOrUndefined(this.actionObj.isAllDay)&&this.actionObj.isAllDay&&this.swagData.length>0){this.multiData=this.swagData,this.swagData=[];var C=t.extend({},this.actionObj.event,null,!0);this.startTime=C[this.parent.eventFields.startTime].getTime()}var S=y[this.parent.eventFields.startTime].getTime()-this.startTime;if(this.enableCurrentViewDrag)for(var E=this.getRenderedDates(),x=0;x<this.multiData.length;x++){var V=t.extend({},this.multiData[parseInt(x.toString(),10)],null,!0),A=new Date(V[this.parent.eventFields.startTime].getTime()+S);if((k=this.parent.getIndexOfDate(E,b(A)))<0){this.isPreventMultiDrag=!0;break}this.isPreventMultiDrag=!1}if(!this.isPreventMultiDrag)for(var I=0;I<this.multiData.length;I++){this.updatedData[parseInt(I.toString(),10)]=this.updateMultipleData(this.multiData[parseInt(I.toString(),10)],S);var k=this.getDayIndex(this.updatedData[parseInt(I.toString(),10)]);if(k>=0){var M=this.updatedData[parseInt(I.toString(),10)][this.parent.eventFields.isAllDay],R=this.getEventWrapper(k,M);this.appendCloneElement(R,this.actionObj.cloneElement[parseInt(I.toString(),10)]),this.updateEventHeight(this.updatedData[parseInt(I.toString(),10)],I,k)}else t.isNullOrUndefined(this.actionObj.cloneElement[parseInt(I.toString(),10)].parentNode)||t.remove(this.actionObj.cloneElement[parseInt(I.toString(),10)])}}else this.updateEventHeight(y);this.updateTimePosition(this.actionObj.start,this.updatedData)}}},i.prototype.splitEvent=function(e){var i=this.parent.eventFields,n=[],r=e[i.startTime],a=e[i.endTime];if(b(new Date(r.getTime()))<b(new Date(a.getTime()))){for(var s=b(new Date(r.getTime())),o=new Date(s.getTime()),l=0;s<new Date(a.getTime());l++){o=new Date(o.setDate(s.getDate()+1));var p=t.extend({},e,null,!0);p[i.startTime]=new Date(s),p[i.endTime]=new Date(o),s=new Date(s.setDate(s.getDate()+1)),n.push(p)}var c=n.length-1;n[0][i.startTime]=r,n[parseInt(c.toString(),10)][i.endTime]=a}else n.push(e);return n},i.prototype.updateMultipleData=function(e,i){var n=t.extend({},e,null,!0);!t.isNullOrUndefined(this.actionObj.isAllDay)&&this.parent.activeViewOptions.timeScale.enable&&(this.isAllDayTarget&&n[this.parent.eventFields.isAllDay]||!this.isAllDayTarget&&!n[this.parent.eventFields.isAllDay])&&(n[this.parent.eventFields.isAllDay]=this.actionObj.isAllDay);var r=n[this.parent.eventFields.endTime].getTime()-n[this.parent.eventFields.startTime].getTime();if(n[this.parent.eventFields.isAllDay]){var a=Math.ceil(i/864e5),s=Math.ceil(r/864e5),o=new Date(n[this.parent.eventFields.startTime]);n[this.parent.eventFields.startTime]=b(new Date(o.setDate(o.getDate()+a))),n[this.parent.eventFields.endTime]=O(n[this.parent.eventFields.startTime],s)}else n[this.parent.eventFields.startTime]=new Date(n[this.parent.eventFields.startTime].getTime()+i),n[this.parent.eventFields.endTime]=new Date(n[this.parent.eventFields.startTime].getTime()+r);return n},i.prototype.getDayIndex=function(e){var i=t.extend({},e,null,!0),n=b(i[this.parent.eventFields.startTime]);if(this.parent.activeViewOptions.timeScale.enable&&!i[this.parent.eventFields.isAllDay]){var r=this.parent.activeView.getStartHour();n.setMilliseconds(r.getTime()-b(r).getTime())}var a=n.getTime(),s="",o="e-day-wrapper";return o=this.parent.activeViewOptions.timeScale.enable&&i[this.parent.eventFields.isAllDay]?"e-all-day-appointment-wrapper":"e-work-cells",s="."+o+'[data-date="'+a+'"]',this.parent.activeViewOptions.group.resources.length>0&&(s=s+'[data-group-index="'+this.actionObj.groupIndex+'"]'),this.targetTd=this.parent.element.querySelector(s),t.isNullOrUndefined(this.targetTd)?-1:this.targetTd.cellIndex},i.prototype.updateEventHeight=function(e,i,n){this.verticalEvent.initializeValues();var r=this.verticalEvent.getStartCount();if(!this.parent.uiStateValues.isGroupAdaptive)for(c=0;c<this.actionObj.groupIndex;c++)this.verticalEvent.dateRender[parseInt(c.toString(),10)]&&(r+=this.verticalEvent.dateRender[parseInt(c.toString(),10)].length);var a=this.parent.uiStateValues.isGroupAdaptive?r:this.actionObj.groupIndex;if(!(!this.parent.activeViewOptions.group.byDate||t.isNullOrUndefined(this.parent.getDateFromElement(this.actionObj.target)))||!this.parent.activeViewOptions.group.byDate)for(var s=-1,o=this.parent.activeViewOptions.group.byDate?this.parent.getIndexOfDate(this.verticalEvent.dateRender[parseInt(a.toString(),10)],b(this.parent.getDateFromElement(t.isNullOrUndefined(i)?this.actionObj.target:this.targetTd))):t.isNullOrUndefined(i)?this.actionObj.index-r:n-r,l=this.splitEvent(e),p=this.parent.eventBase.isAllDayAppointment(e)||l.length>2||"TimeSlot"!==this.parent.eventSettings.spannedEventPlacement?[e]:l,c=0;c<p.length;c++){if(c>0){var h='.e-day-wrapper[data-date="'+b(p[parseInt(c.toString(),10)][this.parent.eventFields.startTime]).getTime()+'"]';this.parent.activeViewOptions.group.resources.length>0&&(h=h.concat('[data-group-index = "'+this.actionObj.groupIndex+'"]'));var d=this.parent.element.querySelector(h);d?(o+=1,s=d.cellIndex):o=-1}if(o>=0){var u=this.verticalEvent.isSpannedEvent(p[parseInt(c.toString(),10)],o,a),g=u[this.verticalEvent.fields.startTime],v=u[this.verticalEvent.fields.endTime],m=this.parent.activeViewOptions.timeScale.enable?this.verticalEvent.getHeight(g,v):this.actionObj.element.offsetHeight,f=this.parent.activeViewOptions.timeScale.enable?this.verticalEvent.getTopValue(g):this.actionObj.element.offsetTop;if(t.isNullOrUndefined(i))0===c?(this.actionObj.clone.classList.contains("e-all-day-appointment")&&(f=this.parent.element.querySelector(".e-all-day-row").offsetTop,m=this.getAllDayEventHeight()),this.actionObj.clone.style.top=t.formatUnit(f),this.actionObj.clone.style.height=t.formatUnit(m)):this.renderSpannedEvents(u,s,f,m);else{var y=this.actionObj.cellWidth;if(e[this.parent.eventFields.isAllDay]&&this.parent.activeViewOptions.timeScale.enable){var T=e[this.parent.eventFields.endTime].getTime()-e[this.parent.eventFields.startTime].getTime(),w=Math.ceil(T/864e5);w>=0&&(y=w*this.actionObj.cellWidth)}this.actionObj.cloneElement[parseInt(i.toString(),10)]&&(0===c?(this.actionObj.cloneElement[parseInt(i.toString(),10)].style.top=t.formatUnit(f),this.actionObj.cloneElement[parseInt(i.toString(),10)].style.height=t.formatUnit(m),this.actionObj.cloneElement[parseInt(i.toString(),10)].style.width=t.formatUnit(y),this.actionObj.cloneElement[parseInt(i.toString(),10)].style.left=t.formatUnit(0)):this.renderSpannedEvents(u,s,f,m))}}}},i.prototype.renderSpannedEvents=function(e,i,n,r){if(e[this.parent.eventFields.startTime].getTime()!==e[this.parent.eventFields.endTime].getTime()){var a=this.verticalEvent.createAppointmentElement(e,!1,e.isSpanned,this.actionObj.groupIndex);t.addClass([a],["e-schedule-event-clone","e-dynamic-clone"]),t.setStyleAttribute(a,{width:"100%",height:r+"px",top:n+"px",border:"0px"}),[].slice.call(this.parent.element.querySelectorAll(".e-appointment-wrapper"))[parseInt(i.toString(),10)].appendChild(a)}},i.prototype.getRenderedDates=function(){var e,t,i=this,n=this.parent.activeView.renderDates;return(e=this.parent.eventBase.slots).push.apply(e,this.parent.activeView.renderDates.map(function(e){return+e})),this.parent.activeViewOptions.group.resources.length>0&&(this.parent.eventBase.slots=[],n=this.parent.resourceBase.lastResourceLevel.filter(function(e){return e.groupIndex===i.actionObj.groupIndex})[0].renderDates,(t=this.parent.eventBase.slots).push.apply(t,n.map(function(e){return+e}))),n},i.prototype.updateAllDayEvents=function(e,i,n){this.parent.eventBase.slots=[];var r=this.getUpdatedEvent(e,i,this.actionObj.event),a=this.getRenderedDates(),s=this.parent.eventBase.splitEvent(r,a),o='.e-all-day-cells[data-date="'+s[0][this.parent.eventFields.startTime].getTime()+'"]';this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(o=o.concat('[data-group-index = "'+this.actionObj.groupIndex+'"]'));var l=[].slice.call(this.parent.element.querySelectorAll(o));if(l.length>0||!t.isNullOrUndefined(n)){var p=t.isNullOrUndefined(n)?l[0].cellIndex:n;this.appendCloneElement(this.getEventWrapper(p)),this.actionObj.clone.style.width=t.formatUnit(s[0].data.count*this.actionObj.cellWidth)}},i.prototype.swapDragging=function(e){if(!this.isPreventMultiDrag){var i=!t.isNullOrUndefined(t.closest(this.actionObj.target,"td"))&&t.closest(this.actionObj.target,"td").cellIndex;if(t.closest(this.actionObj.target,".e-date-header-wrap")&&!t.closest(this.actionObj.clone,".e-all-day-appointment-wrapper")){t.addClass([this.actionObj.clone],"e-all-day-appointment"),this.appendCloneElement(this.getEventWrapper(i)),this.actionObj.isAllDay=!0;var n=this.getAllDayEventHeight(),r=[].slice.call(this.parent.element.querySelectorAll(".e-all-day-cells:first-child"));if(r[0].offsetHeight<n)for(var a=0,s=r;a<s.length;a++)s[a].style.height=(n+2)/12+"em";t.setStyleAttribute(this.actionObj.clone,{width:t.formatUnit(this.actionObj.cellWidth),height:t.formatUnit(n),top:t.formatUnit(this.parent.element.querySelector(".e-all-day-row").offsetTop)})}if(t.closest(this.actionObj.target,".e-work-cells")&&!t.closest(this.actionObj.clone,".e-day-wrapper")){t.removeClass([this.actionObj.clone],"e-all-day-appointment"),this.appendCloneElement(this.getEventWrapper(i)),this.actionObj.isAllDay=!1;var o=0===this.actionObj.element.offsetHeight?this.actionObj.height:this.actionObj.element.offsetHeight;t.setStyleAttribute(this.actionObj.clone,{left:t.formatUnit(0),height:t.formatUnit(o),width:t.formatUnit(this.actionObj.cellWidth)})}}},i.prototype.calculateVerticalDate=function(e){if(!(t.isNullOrUndefined(e.target)||e.target&&t.isNullOrUndefined(t.closest(e.target,"tr"))||e.target&&"DIV"===e.target.tagName)){var i=t.extend({},this.actionObj.event,null,!0);t.isNullOrUndefined(this.parent.eventDragArea)&&this.removeCloneElement();var n=L(i[this.parent.eventFields.endTime])-L(i[this.parent.eventFields.startTime]),r=t.closest(this.actionObj.target,"td");if(!t.isNullOrUndefined(r)){var a=r.parentElement;this.actionObj.index=a.rowIndex*a.children.length+r.cellIndex,r=[].slice.call(this.parent.element.querySelectorAll(".e-work-cells"))[this.actionObj.index];var s=this.parent.getDateFromElement(r);if(!t.isNullOrUndefined(s)){this.parent.activeViewOptions.group.resources.length>0&&(this.actionObj.groupIndex=parseInt(r.getAttribute("data-group-index"),10));var o=new Date(s.setDate(s.getDate()-this.daysVariation)),l=new Date(o.getTime()),p=L(i[this.parent.eventFields.startTime])-L(b(new Date(+i[this.parent.eventFields.startTime])));l.setMilliseconds(p);var c=new Date(l.getTime());c.setMilliseconds(n),this.actionObj.start=new Date(l.getTime()),this.actionObj.end=new Date(c.getTime())}}var h=this.getUpdatedEvent(this.actionObj.start,this.actionObj.end,this.actionObj.event);if(t.isNullOrUndefined(this.parent.eventDragArea))for(var d=0,u=[].slice.call(this.parent.element.querySelectorAll(".e-schedule-event-clone"));d<u.length;d++){var g=u[d];t.remove(g)}if(this.multiData&&this.multiData.length>0){var v=b(new Date(h[this.parent.eventFields.startTime])),p=v.getTime()-this.startTime;"TimelineYear"===this.parent.currentView&&this.parent.group.resources.length>0&&(p=12*(v.getFullYear()-new Date(this.startTime).getFullYear()),p-=new Date(this.startTime).getMonth(),p+=v.getMonth());for(var m=0;m<this.multiData.length;m++)this.updatedData[parseInt(m.toString(),10)]=this.updateMultipleVerticalDate(this.multiData[parseInt(m.toString(),10)],p),"TimelineYear"===this.parent.currentView?this.dynamicYearlyEventsRendering(this.updatedData[parseInt(m.toString(),10)]):this.dynamicEventsRendering(this.updatedData[parseInt(m.toString(),10)])}else"TimelineYear"===this.parent.currentView?this.dynamicYearlyEventsRendering(h):this.dynamicEventsRendering(h)}},i.prototype.updateMultipleVerticalDate=function(e,i){var n=t.extend({},e,null,!0),r=n[this.parent.eventFields.endTime].getTime()-n[this.parent.eventFields.startTime].getTime(),a=new Date(n[this.parent.eventFields.startTime]);if("TimelineYear"===this.parent.currentView&&this.parent.group.resources.length>0)n[this.parent.eventFields.startTime]=new Date(a.setMonth(a.getMonth()+i));else{var s=Math.ceil(i/Qe);n[this.parent.eventFields.startTime]=new Date(a.setDate(a.getDate()+s))}return n[this.parent.eventFields.endTime]=new Date(n[this.parent.eventFields.startTime].getTime()+r),n},i.prototype.calculateTimelineTime=function(e){var i=t.extend({},this.actionObj.event,null,!0),n=L(i[this.parent.eventFields.endTime])-L(i[this.parent.eventFields.startTime]),r=this.parent.enableRtl?Math.abs(this.actionObj.clone.offsetLeft)-this.actionObj.clone.offsetWidth:parseInt(this.actionObj.clone.style.left,10);r=Math.round(r/this.actionObj.cellWidth)*this.actionObj.cellWidth;var a;this.parent.enableRtl&&(a=Math.abs(parseInt(this.actionObj.clone.style.right,10)),this.actionObj.clone.style.right=t.formatUnit(a)),r=this.getOffsetValue(r,a);var s=this.getColumnIndex(r),o=this.parent.element.querySelector(".e-content-wrap"),l=o.getBoundingClientRect().right,p=this.parent.activeView.isTimelineView()&&!this.parent.enableRtl&&this.actionObj.pageX>this.actionObj.clone.getBoundingClientRect().right&&!this.isMorePopupOpened&&!(this.actionObj.pageX>l),c=this.parent.eventDragArea?o.scrollLeft-o.offsetLeft:0;!this.isCursorAhead&&!p||this.isStepDragging||(this.isCursorAhead=!0);var h=Math.floor((this.actionObj.pageX-this.actionObj.clone.getBoundingClientRect().left+c)/this.actionObj.cellWidth);this.parent.enableRtl&&(h=Math.abs(Math.floor((this.actionObj.pageX-this.actionObj.clone.getBoundingClientRect().right)/this.actionObj.cellWidth))-1),this.cursorPointIndex<0&&this.cursorIndex(e,i,r,h);var d=this.parent.getContentTable().querySelector("tr"),u=this.getCursorCurrentIndex(s,h,d);u=u<0?0:u;var g=this.isHeaderRows?new Date(this.timelineEventModule.dateRender[parseInt(u.toString(),10)].getTime()):this.parent.getDateFromElement(d.children[parseInt(u.toString(),10)]);if(g=this.isAllDayDrag?b(g):g,this.isStepDragging){var v=this.getWidthDiff(d,u);if(0!==v){var m=Math.ceil(v/this.widthPerMinute);if(g.setMinutes(g.getMinutes()+m*this.actionObj.interval),this.isCursorAhead||p)g.setMilliseconds(-n);else{g.setMinutes(g.getMinutes()-this.minDiff);var f=this.actionObj.interval*Ke;m=Math.abs(g.getTime()-this.actionObj.start.getTime())/f;var y=Math.trunc(m);y!==m&&(m=y*f*(g>this.actionObj.start?1:-1),g=new Date(this.actionObj.start.getTime()+m))}}else g=this.actionObj.start}else if(!this.isCursorAhead&&!p||this.isAllDayDrag)g.setMinutes(g.getMinutes()-this.cursorPointIndex*(this.isTimelineDayProcess||this.isAllDayDrag?1440:this.actionObj.slotInterval));else{var T=this.isTimelineDayProcess||this.isAllDayDrag?1440:this.actionObj.slotInterval;g.setMinutes(g.getMinutes()+T),g.setMilliseconds(-n),g.getTime()===b(g).getTime()&&0===g.getMinutes()&&0===n&&g.setMinutes(-T)}if(this.isStepDragging||(g=this.calculateIntervalTime(g)),this.isTimelineDayProcess||this.isAllDayDrag){D=i[this.parent.eventFields.startTime];g.setHours(D.getHours(),D.getMinutes(),D.getSeconds())}if(this.parent.eventDragArea){var w=this.parent.getDateFromElement(e.target);if(!t.isNullOrUndefined(w))if(this.parent.activeViewOptions.timeScale.enable&&"TimelineMonth"!==this.parent.currentView)g=w;else{var D=i[this.parent.eventFields.startTime];g=new Date(w.setHours(D.getHours(),D.getMinutes(),D.getSeconds()))}}var C=new Date(g.getTime());C.setMilliseconds(n);var S=[this.getUpdatedEvent(g,C,this.actionObj.event)];if(this.multiData.length>0){for(var O=S[0][this.parent.eventFields.startTime].getTime()-this.startTime,E=0;E<this.multiData.length;E++)this.updatedData[parseInt(E.toString(),10)]=this.updateMultipleData(this.multiData[parseInt(E.toString(),10)],O);S=this.updatedData}for(var x=0;x<S.length;x++){var V=this.multiData.length>0?this.actionObj.cloneElement[parseInt(x.toString(),10)]:this.actionObj.clone;if(t.isNullOrUndefined(this.parent.eventDragArea)){var A=this.timelineEventModule.splitEvent(S[parseInt(x.toString(),10)],this.timelineEventModule.dateRender),I=A[0].data,k=this.timelineEventModule.getStartTime(A[0],I),M=this.timelineEventModule.getEndTime(A[0],I),R=this.timelineEventModule.getEventWidth(k,M,i[this.parent.eventFields.isAllDay],I.count),H=this.parent.getIndexOfDate(this.timelineEventModule.dateRender,b(new Date(k.getTime())));H=H<0?0:H;var P=this.timelineEventModule.getPosition(k,M,i[this.parent.eventFields.isAllDay],H);this.parent.enableRtl?V.style.right=t.formatUnit(P):V.style.left=t.formatUnit(P),this.isMorePopupOpened||(V.style.width=t.formatUnit(R))}this.parent.activeViewOptions.group.resources.length>0&&this.calculateResourceGroupingPosition(e,V),this.actionObj.start=new Date(g.getTime()),this.actionObj.end=new Date(C.getTime()),this.updateTimePosition(this.actionObj.start,this.updatedData)}},i.prototype.getOffsetValue=function(e,i){if(this.scrollEdges.left||this.scrollEdges.right){var n=this.parent.element.querySelector(".e-content-wrap");this.parent.enableRtl?(i=n.offsetWidth-n.scrollLeft,this.scrollEdges.right?i=i-n.offsetWidth+this.actionObj.clone.offsetWidth-(this.actionObj.clone.offsetWidth-this.widthUptoCursorPoint):(i+=this.widthUptoCursorPoint)-this.widthUptoCursorPoint>=n.scrollWidth&&(this.actionObj.clone.style.width=t.formatUnit(this.actionObj.clone.offsetWidth-this.widthUptoCursorPoint+this.actionObj.cellWidth),i=n.scrollLeft-n.scrollWidth),t.isNullOrUndefined(this.parent.eventDragArea)&&(this.actionObj.clone.style.left=t.formatUnit(i))):(this.scrollEdges.left?(e=n.scrollLeft-this.widthUptoCursorPoint+this.actionObj.cellWidth,n.scrollLeft+n.offsetWidth>=n.offsetWidth?n.scrollLeft=n.scrollLeft-1:0===this.actionObj.clone.offsetLeft&&(e=n.scrollLeft)):e=n.scrollLeft+n.offsetWidth-this.actionObj.clone.offsetWidth+(this.actionObj.clone.offsetWidth-this.widthUptoCursorPoint),e=e<0?0:e,t.isNullOrUndefined(this.parent.eventDragArea)&&(this.actionObj.clone.style.left=t.formatUnit(e)))}return e},i.prototype.getWidthDiff=function(e,t){var i=this.scrollArgs.element.getBoundingClientRect();if(i.left<=this.actionObj.pageX&&i.right>=this.actionObj.pageX){var n=e.children[parseInt(t.toString(),10)].offsetLeft,r=this.actionObj.pageX-i.left;return this.parent.enableRtl?n+this.actionObj.cellWidth-(this.scrollArgs.element.scrollLeft+r):this.scrollArgs.element.scrollLeft+r-n}return 0},i.prototype.getColumnIndex=function(e){var t=Math.round(e/this.actionObj.cellWidth);return this.isHeaderRows?t:this.getIndex(t)},i.prototype.getCursorCurrentIndex=function(e,t,i){var n=e+t;if(this.isHeaderRows){var r=Math.floor(i.offsetWidth/this.actionObj.cellWidth);return n>r-1?r-1:n}return n>i.children.length-1?i.children.length-1:n},i.prototype.cursorIndex=function(e,i,n,r){var a=t.closest(e.target,".e-work-cells");if(t.isNullOrUndefined(a)||this.isMorePopupOpened)this.cursorPointIndex=0;else{var s=this.parent.getDateFromElement(a);if(s=this.isAllDayDrag?b(s):s,this.isHeaderRows){var o=Math.floor(n/this.actionObj.cellWidth);s=new Date(this.timelineEventModule.dateRender[o+r].getTime())}var l=s.getTime()-i[this.parent.eventFields.startTime].getTime();if(this.isTimelineDayProcess||this.isAllDayDrag)this.cursorPointIndex=Math.abs(Math.ceil(l/Qe));else{var p=Math.floor(l/Ke/(this.actionObj.slotInterval/this.actionObj.cellWidth));this.cursorPointIndex=Math.floor(p/this.actionObj.cellWidth),this.cursorPointIndex=this.cursorPointIndex<0?0:this.cursorPointIndex}}},i.prototype.calculateResourceGroupingPosition=function(e,i){var n=this.parent.element.querySelector(".e-content-wrap"),r=[].slice.call(this.parent.element.querySelectorAll(".e-content-wrap .e-content-table tr:not(.e-hidden)")),a=u(n.querySelector("table"));a=t.isNullOrUndefined(a)?0:a;var s=this.parent.rowAutoHeight?~~(n.querySelector("table").offsetHeight/r.length):this.actionObj.cellHeight,o=Math.floor(Math.floor(this.actionObj.Y+(n.scrollTop-a-(window.scrollY||window.pageYOffset))-z(n,this.parent.uiStateValues.isTransformed))/s);o=o<0?0:o>r.length-1?r.length-1:o,this.actionObj.index=o;var l=this.parent.element.querySelectorAll(".e-appointment-container:not(.e-hidden)").item(o),p=l.querySelector(".e-appointment-wrapper");p||(p=t.createElement("div",{className:"e-appointment-wrapper"}),l.appendChild(p)),this.appendCloneElement(p,i);var c=t.closest(this.actionObj.target,"td");if(this.actionObj.groupIndex=c&&!isNaN(parseInt(c.getAttribute("data-group-index"),10))?parseInt(c.getAttribute("data-group-index"),10):this.actionObj.groupIndex,t.isNullOrUndefined(this.parent.eventDragArea)){var h=this.parent.getElementHeight(r[parseInt(o.toString(),10)])*o;if(this.parent.rowAutoHeight){var d=this.getCursorElement(e);d&&(h=d.classList.contains("e-work-cells")?d.offsetTop:d.offsetParent&&d.offsetParent.classList.contains("e-appointment")?d.offsetParent.offsetTop:h)}i.style.top=t.formatUnit(h)}},i.prototype.appendCloneElement=function(e,i){void 0===i&&(i=null),i=t.isNullOrUndefined(i)?this.actionObj.clone:i;var n=document.querySelector(this.parent.eventDragArea);this.parent.eventDragArea&&n?n.appendChild(i):e.appendChild(i)},i.prototype.getEventWrapper=function(e,i){var n;if(t.isNullOrUndefined(i)&&(i=this.actionObj.clone.classList.contains("e-all-day-appointment")),this.parent.activeViewOptions.timeScale.enable){var r=i?".e-all-day-appointment-wrapper":".e-appointment-wrapper";n=this.parent.element.querySelectorAll(r).item(e)}else{var a=this.parent.element.querySelectorAll(".e-work-cells").item(e);(n=a.querySelector(".e-appointment-wrapper"))||(n=t.createElement("div",{className:"e-appointment-wrapper"}),a.appendChild(n))}return n},i.prototype.getAllDayEventHeight=function(){var e=t.createElement("div",{className:"e-appointment"});this.parent.element.querySelector(".e-all-day-appointment-wrapper").appendChild(e);var i=e.offsetHeight;return t.remove(e),i},i.prototype.isAllowDrop=function(e){if(!this.actionObj.excludeSelectors)return!1;for(var t=!1,i=0,n=this.actionObj.excludeSelectors.split(",");i<n.length;i++){var r=n[i];if(e.target.classList.contains(r)){t=!0;break}}return t},i.prototype.getModuleName=function(){return"dragAndDrop"},i}(Ji),sn=function(){function e(e){this.previousNextAction="Next",this.skipPersistenceSave=!1,this.isScrolledBottom=!1,this.parent=e}return e.prototype.isTimelineView=function(){return-1!==this.parent.currentView.indexOf("Timeline")},e.prototype.getContentRows=function(){return[]},e.prototype.refreshHeader=function(){},e.prototype.refreshResourceHeader=function(){var e=this.element.querySelector(".e-resource-column-table"),i=Array.from(e.querySelectorAll(".e-resource-cells"));i.forEach(function(e){Array.from(e.children).forEach(function(e){e.classList.contains("e-resource-expand")||e.classList.contains("e-resource-collapse")||t.remove(e)})});var n=this.parent.resourceBase.renderedResources;if(!t.isNullOrUndefined(n)&&n.length>0)for(var r=0;r<i.length;r++){var a=i[parseInt(r.toString(),10)],s=n[parseInt(r.toString(),10)];if(this.parent.activeView&&!t.isNullOrUndefined(a)&&!t.isNullOrUndefined(s)&&parseInt(a.getAttribute("data-group-index"),10)===s.groupIndex){this.parent.activeView.setResourceHeaderContent(a,s,"e-resource-text");var o={element:a,elementType:"resourceHeader",groupIndex:s.groupIndex};this.parent.trigger(ze,o)}}this.parent.renderTemplates(),this.parent.notify(Ge,{})},e.prototype.getDayName=function(e){return this.parent.getDayNames("abbreviated")[e.getDay()]},e.prototype.getDate=function(e){return this.parent.globalize.formatDate(e,{format:"d",calendar:this.parent.getCalendarMode()})},e.prototype.getTime=function(e){return this.parent.isAdaptive?"HH:mm"===this.parent.activeViewOptions.timeFormat||"HH.mm"===this.parent.activeViewOptions.timeFormat?this.parent.globalize.formatDate(e,{format:"H",calendar:this.parent.getCalendarMode()}):this.parent.globalize.formatDate(e,{skeleton:"h",calendar:this.parent.getCalendarMode()}):this.parent.getTimeString(e)},e.prototype.getTimelineDate=function(e){return U(this.parent.globalize.formatDate(e,{skeleton:"MMMd",calendar:this.parent.getCalendarMode()})+", "+this.parent.getDayNames("wide")[e.getDay()],"multiple")},e.prototype.createEventTable=function(e){var i=t.createElement("div",{className:"e-event-table"});return t.append(this.getEventRows(e),i),i},e.prototype.getEventRows=function(e){for(var i,n=[],r=0;r<e;r++)i=t.createElement("div",{className:at}),this.parent.resourceBase&&!this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.renderedResources&&i.setAttribute("data-group-index",this.parent.resourceBase.renderedResources[parseInt(r.toString(),10)].groupIndex.toString()),n.push(i);return n},e.prototype.collapseRows=function(e){this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(this.parent.resourceBase.hideResourceRows(e.querySelector("tbody")),this.parent.resourceBase.hideResourceRows(e.querySelector(".e-event-table")))},e.prototype.createTableLayout=function(e){var i=e||"",n=t.createElement("table",{className:it+" "+i}),r=t.createElement("tbody");return n.appendChild(r),n},e.prototype.setAriaAttributes=function(e){e.setAttribute("role","grid"),"Year"!==this.parent.currentView&&e.setAttribute("id",this.parent.element.id+"_table"),e.setAttribute("aria-label",this.getLabelText(this.parent.currentView))},e.prototype.createColGroup=function(e,i){if(!t.isNullOrUndefined(i)){var n=i.length;i[0]&&i[0].colSpan&&(n=i.map(function(e){return e.colSpan}).reduce(function(e,t){return e+t}));for(var r=t.createElement("colgroup"),a=0;a<n;a++)r.appendChild(t.createElement("col"));t.prepend([r],e)}},e.prototype.getScrollXIndent=function(e){return e.offsetHeight-e.clientHeight>0?M():0},e.prototype.scrollTopPanel=function(e){this.getDatesHeaderElement().firstElementChild.scrollLeft=e.scrollLeft},e.prototype.scrollHeaderLabels=function(e){for(var i=this.element.querySelector(".e-date-header-wrap table"),n=i.offsetWidth/i.querySelectorAll("colgroup col").length,r=0,a=[".e-header-year-cell",".e-header-month-cell",".e-header-week-cell",".e-header-cells"];r<a.length;r++){var s=a[r],o=[].slice.call(this.element.querySelectorAll(s));if(o.length>0){for(var l=0,p=o;l<p.length;l++)p[l].children[0].style[this.parent.enableRtl?"right":"left"]="";!function(i,r){for(var a,s=0,o=0,l=r?-e.scrollLeft:e.scrollLeft,p=0,c=i;p<c.length;p++){var h=c[p];if((o+=parseInt(h.getAttribute("colSpan"),10))>Math.floor(l/n)){a=h;break}s+=h.offsetWidth}t.isNullOrUndefined(a)||(a.children[0].style[r?"right":"left"]=l-s+"px")}(o,this.parent.enableRtl)}}},e.prototype.addAttributes=function(e,i){e.template&&t.append(e.template,i),e.colSpan&&i.setAttribute("colspan",e.colSpan.toString()),e.className&&t.addClass([i],e.className)},e.prototype.getHeaderBarHeight=function(){var e=2;if(this.parent.headerModule&&(e+=P(this.parent.headerModule.getHeaderElement())),this.parent.uiStateValues.isGroupAdaptive){var t=this.parent.element.querySelector(".e-schedule-resource-toolbar");t&&(e+=t.offsetHeight)}return e},e.prototype.renderPanel=function(e){"e-previous-panel"===e?t.prepend([this.element],this.parent.element.querySelector("."+tt)):this.parent.element.querySelector("."+tt).appendChild(this.element)},e.prototype.setPanel=function(e){this.element=e},e.prototype.getPanel=function(){return this.element},e.prototype.getDatesHeaderElement=function(){return this.element.querySelector(".e-date-header-container")},e.prototype.getDateSlots=function(e,t){return[]},e.prototype.generateColumnLevels=function(){return[]},e.prototype.getColumnLevels=function(){return this.colLevels},e.prototype.highlightCurrentTime=function(){},e.prototype.getStartDate=function(){return this.renderDates[0]},e.prototype.getEndDate=function(){return this.renderDates[this.renderDates.length-1]},e.prototype.startDate=function(){return this.renderDates[0]},e.prototype.endDate=function(){return O(this.renderDates[this.renderDates.length-1],1)},e.prototype.getStartHour=function(){var e=this.parent.getStartEndTime(this.parent.activeViewOptions.startHour);return t.isNullOrUndefined(e)&&(e=new Date(2e3,0,0,0)),e},e.prototype.getEndHour=function(){var e=this.parent.getStartEndTime(this.parent.activeViewOptions.endHour);return t.isNullOrUndefined(e)&&(e=new Date(2e3,0,0,0)),e},e.prototype.isCurrentDate=function(e){return e.setHours(0,0,0,0)===new Date(this.parent.currentTimezoneDate).setHours(0,0,0,0)},e.prototype.isCurrentMonth=function(e){return this.parent.activeViewOptions.displayDate||this.parent.activeViewOptions.numberOfWeeks>0?this.parent.activeView.getStartDate().getTime()<=this.parent.getCurrentTime().getTime()&&this.parent.activeView.getEndDate().getTime()>=this.parent.getCurrentTime().getTime():e.getFullYear()===this.parent.getCurrentTime().getFullYear()&&e.getMonth()===this.parent.getCurrentTime().getMonth()},e.prototype.isWorkDay=function(e,i){return void 0===i&&(i=this.parent.activeViewOptions.workDays),!t.isNullOrUndefined(i)&&i.indexOf(e.getDay())>=0},e.prototype.isWorkHour=function(e,i,n,r){return!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(n)&&(i.setMilliseconds(0),n.setMilliseconds(0),b(e).getTime()!==b(i).getTime()&&(i=new Date(2e3,0,0,i.getHours(),i.getMinutes(),i.getMilliseconds()),n=new Date(2e3,0,0,n.getHours(),n.getMinutes(),n.getMilliseconds())),!(C(e)<C(i)||C(e)>=C(n)||!this.isWorkDay(e,r)))},e.prototype.getRenderDates=function(e,t){void 0===t&&(t=this.parent.selectedDate);var i=[];if("Week"===this.parent.currentView||"TimelineWeek"===this.parent.currentView)for(var n=v(b(t),this.parent.activeViewOptions.firstDayOfWeek),r=0,a=7*this.parent.activeViewOptions.interval;r<a;r++)this.parent.activeViewOptions.showWeekend?i.push(n):this.isWorkDay(n,e)&&i.push(n),n=O(n,1);else if("WorkWeek"===this.parent.currentView||"TimelineWorkWeek"===this.parent.currentView)for(var n=v(b(t),this.parent.activeViewOptions.firstDayOfWeek),r=0,s=7*this.parent.activeViewOptions.interval;r<s;r++)this.isWorkDay(n,e)&&i.push(n),n=O(n,1);else{var o="Agenda"===this.parent.currentView?this.parent.agendaDaysCount:this.parent.activeViewOptions.interval,n=b(t);do{this.parent.activeViewOptions.showWeekend?i.push(n):this.isWorkDay(n,e)&&i.push(n),n=O(n,1)}while(o!==i.length)}return e||(this.renderDates=i),this.parent.headerModule&&this.parent.headerModule.previousNextIconHandler(),i},e.prototype.getNextPreviousDate=function(e){if(this.previousNextAction=e,"Day"===this.parent.currentView||"TimelineDay"===this.parent.currentView){if(this.parent.activeViewOptions.showWeekend){var t=this.parent.activeViewOptions.interval;return O(this.parent.selectedDate,"Next"===e?t:-t)}var i=void 0;if("Next"===e)for(i=O(this.renderDates.slice(-1)[0],1);!this.isWorkDay(i);)i=O(i,1);else{i=O(this.renderDates[0],-1);var n=0;do{this.isWorkDay(i)&&(n+=1),this.parent.activeViewOptions.interval!==n&&(i=O(i,-1))}while(this.parent.activeViewOptions.interval!==n)}return i}var r="Next"===e?7:-7;return O(this.parent.selectedDate,r*this.parent.activeViewOptions.interval)},e.prototype.formatViewLabel=function(e,t,i){var n={type:"date",skeleton:"full",calendar:this.parent.getCalendarMode()};return this.parent.localeObj.getConstant(e)+" "+this.parent.localeObj.getConstant("start")+" "+this.parent.globalize.formatDate(t,n)+" "+this.parent.localeObj.getConstant("endAt")+" "+this.parent.globalize.formatDate(i,n)},e.prototype.getLabelText=function(e){var t=e.charAt(0).toLowerCase()+e.substring(1);return"Year"===e||"TimelineYear"===e?this.formatViewLabel(t,this.parent.activeView.getStartDate(),this.parent.activeView.getEndDate()):this.renderDates.length>0?"Day"===this.parent.currentView||"TimelineDay"===this.parent.currentView?this.parent.localeObj.getConstant(t)+" of "+U(this.parent.globalize.formatDate(this.parent.selectedDate,{type:"date",skeleton:"full",calendar:this.parent.getCalendarMode()}),"single"):this.formatViewLabel(t,this.renderDates[0],this.renderDates[this.renderDates.length-1]):""},e.prototype.getDateRangeText=function(e,t){if(void 0===e&&(e=this.renderDates[0]),void 0===t&&(t=this.renderDates),this.parent.isAdaptive){var i=this.parent.activeViewOptions.dateFormat?this.parent.activeViewOptions.dateFormat:"MMMM y";return U(this.parent.globalize.formatDate(this.parent.selectedDate,{format:i,calendar:this.parent.getCalendarMode()}),"single")}return this.formatDateRange(e,t[t.length-1])},e.prototype.formatDateRange=function(e,i){var n=this.parent.globalize,r=this.parent.getCalendarMode();if(e===i&&(i=null),!t.isNullOrUndefined(this.parent.activeViewOptions.dateFormat)){var a="";return i?(a=n.formatDate(e,{format:this.parent.activeViewOptions.dateFormat,calendar:r})+" - "+n.formatDate(i,{format:this.parent.activeViewOptions.dateFormat,calendar:r}),U(a,"multiple")):(a=n.formatDate(e,{format:this.parent.activeViewOptions.dateFormat,calendar:r}),U(a,"multiple"))}var s,o;if(o=t.isNullOrUndefined(this.parent.locale)||"en"===this.parent.locale||"en-US"===this.parent.locale?t.getValue("dateFormats.long",t.getDefaultDateObject(r)):t.getValue("main."+this.parent.locale+".dates.calendars."+r+".dateFormats.long",t.cldrData),!i)return U(n.formatDate(e,{format:o,calendar:r}),"single");var l=o.trim().toLocaleLowerCase();return s="d"===l.substr(0,1)?e.getFullYear()===i.getFullYear()?e.getMonth()===i.getMonth()?n.formatDate(e,{format:"dd",calendar:r})+" - "+n.formatDate(i,{format:"dd MMMM yyyy",calendar:r}):n.formatDate(e,{format:"dd MMM",calendar:r})+" - "+n.formatDate(i,{format:"dd MMM yyyy",calendar:r}):n.formatDate(e,{format:"dd MMM yyyy",calendar:r})+" - "+n.formatDate(i,{format:"dd MMM yyyy",calendar:r}):"m"===l.substr(0,1)?e.getFullYear()===i.getFullYear()?e.getMonth()===i.getMonth()?n.formatDate(e,{format:"MMMM dd",calendar:r})+" - "+n.formatDate(i,{format:"dd, yyyy",calendar:r}):n.formatDate(e,{format:"MMM dd",calendar:r})+" - "+n.formatDate(i,{format:"MMM dd, yyyy",calendar:r}):n.formatDate(e,{format:"MMM dd, yyyy",calendar:r})+" - "+n.formatDate(i,{format:"MMM dd, yyyy",calendar:r}):n.formatDate(e,{format:o,calendar:r})+" - "+n.formatDate(i,{format:o,calendar:r}),U(s,"multiple")},e.prototype.getMobileDateElement=function(e,i){return t.createElement("div",{className:i,innerHTML:'<div class="e-m-date">'+this.parent.globalize.formatDate(e,{format:"d",calendar:this.parent.getCalendarMode()})+'</div><div class="e-m-day">'+U(this.parent.globalize.formatDate(e,{format:"E",calendar:this.parent.getCalendarMode()}),"single")+"</div>"})},e.prototype.setResourceHeaderContent=function(e,i,n){if(void 0===n&&(n=st),this.parent.activeViewOptions.resourceHeaderTemplate){var r={resource:i.resource,resourceData:i.resourceData},a=this.parent.element.id+"_"+this.parent.activeViewOptions.resourceHeaderTemplateName+"resourceHeaderTemplate",s=[].slice.call(this.parent.getResourceHeaderTemplate()(r,this.parent,"resourceHeaderTemplate",a,!1,void 0,void 0,this.parent.root));t.append(s,e)}else{var o=t.createElement("div",{className:n});this.parent.sanitize(i.resourceData[i.resource.textField],o),e.appendChild(o)}},e.prototype.renderResourceMobileLayout=function(){this.parent.resourceBase.lastResourceLevel&&this.parent.resourceBase.lastResourceLevel.length<=0||(this.parent.resourceBase.renderResourceHeader(),this.parent.resourceBase.renderResourceTree())},e.prototype.addAutoHeightClass=function(e){!this.parent.uiStateValues.isGroupAdaptive&&this.parent.rowAutoHeight&&this.isTimelineView()&&this.parent.activeViewOptions.group.resources.length>0&&t.addClass([e],"e-auto-height")},e.prototype.getColElements=function(){return[].slice.call(this.element.querySelectorAll(".e-content-wrap col, .e-date-header-wrap col"))},e.prototype.setColWidth=function(e){if(this.isTimelineView()){var i=this.getColElements(),n=this.element.querySelector("."+nt+" tbody"),r=this.parent.getElementWidth(n)/(i.length/2);if(e.offsetHeight!==e.clientHeight){var a=this.parent.element.querySelector(".e-resource-column-wrap");t.isNullOrUndefined(a)||a.offsetHeight===e.clientHeight||t.setStyleAttribute(a,{height:t.formatUnit(e.clientHeight)})}[].slice.call(this.element.querySelectorAll(".e-header-cells,.e-time-slots,.e-header-week-cell,.e-header-month-cell,.e-header-year-cell")).forEach(function(e){var i=t.isNullOrUndefined(e.getAttribute("colspan"))?"1":e.getAttribute("colspan"),n=parseInt(i,10);t.setStyleAttribute(e,{width:t.formatUnit(r*n)})})}},e.prototype.resetColWidth=function(){for(var e=0,t=this.getColElements();e<t.length;e++)t[e].style.width=""},e.prototype.getContentAreaElement=function(){return this.element.querySelector(".e-content-wrap")},e.prototype.wireExpandCollapseIconEvents=function(){if(this.parent.resourceBase&&this.parent.resourceBase.resourceCollection.length>1)for(var e=0,i=[].slice.call(this.element.querySelectorAll(".e-resource-tree-icon"));e<i.length;e++){var n=i[e];t.EventHandler.clearEvents(n),t.EventHandler.add(n,"click",this.parent.resourceBase.onTreeIconClick,this.parent.resourceBase)}},e.prototype.scrollToDate=function(e){if(-1!==["Month","TimelineMonth"].indexOf(this.parent.currentView)&&!t.isNullOrUndefined(e)){var i=this.getContentAreaElement(),n=new Date(b(new Date(+e)).getTime()).getTime(),r=i.querySelector('.e-work-cells[data-date="'+n+'"]');"Month"===this.parent.currentView&&r&&(i.scrollWidth>i.clientWidth&&(this.parent.enableRtl?i.scrollLeft=-(this.parent.getContentTable().offsetWidth-r.offsetLeft-r.offsetWidth):i.scrollLeft=r.offsetLeft),i.scrollTop=r.offsetTop),"TimelineMonth"===this.parent.currentView&&r&&(this.parent.enableRtl?i.scrollLeft=-(this.parent.getContentTable().offsetWidth-r.offsetLeft-r.offsetWidth):i.scrollLeft=r.offsetLeft)}},e.prototype.setPersistence=function(){if(this.parent.enablePersistence){var e=this.element.querySelector(".e-content-wrap");this.parent.virtualScrollModule&&this.isScrolledBottom&&(this.isScrolledBottom=!1,this.skipPersistenceSave=!0,e.scrollTop=this.parent.scrollTop,this.skipPersistenceSave=!1),t.isNullOrUndefined(e)||(this.parent.scrollLeft=e.scrollLeft,this.parent.scrollTop=e.scrollTop)}},e.prototype.retainScrollPosition=function(){if(this.parent.enablePersistence){var e=this.parent.element.querySelector(".e-content-wrap");t.isNullOrUndefined(e)||t.isNullOrUndefined(this.parent.scrollLeft)||t.isNullOrUndefined(this.parent.scrollTop)||(this.isScrolledBottom=e.scrollHeight-e.clientHeight<this.parent.scrollTop,e.scrollTop=this.parent.scrollTop,e.scrollLeft=this.parent.scrollLeft)}},e.prototype.getViewStartDate=function(){var e=this.renderDates[0];return this.parent.activeViewOptions.group.resources.length>0&&this.parent.resourceBase.lastResourceLevel.length>0&&(e=this.parent.resourceBase.getResourceRenderDates()[0]),e},e.prototype.getViewEndDate=function(){var e=O(this.renderDates[this.renderDates.length-1],1);return this.parent.activeViewOptions.group.resources.length>0&&this.parent.resourceBase.lastResourceLevel.length>0&&(e=O(this.parent.resourceBase.getResourceRenderDates().slice(-1)[0],1)),e},e.prototype.getAdjustedDate=function(e){return!this.parent.activeViewOptions.timeScale.enable||"Month"===this.parent.currentView||"TimelineYear"===this.parent.currentView&&0===this.parent.activeViewOptions.group.resources.length?new Date(e.setHours(0,0,0,0)):"TimelineYear"===this.parent.currentView&&this.parent.activeViewOptions.group.resources.length>0?(e.setHours(0,0,0,0),new Date(e.setDate(1))):null},e.prototype.resetColLevels=function(){this.parent.resourceBase.expandedResources=[];for(var e=this.parent.virtualScrollModule.getRenderedCount(),t=this.parent.activeViewOptions.group.byDate?this.colLevels[0]:this.parent.resourceBase.renderedResources,i=0,n=0;n<t.length&&!(i>=e);n++)i+=t[parseInt(n.toString(),10)].colSpan,this.parent.resourceBase.expandedResources.push(t[parseInt(n.toString(),10)]);this.parent.activeViewOptions.group.byDate?(this.colLevels[0]=this.parent.resourceBase.expandedResources,this.parent.virtualScrollModule.setRenderedDates(this.parent.resourceBase.expandedResources)):(this.colLevels[this.colLevels.length-2]=this.parent.resourceBase.expandedResources,this.parent.resourceBase.renderedResources=this.parent.resourceBase.expandedResources),"Month"!==this.parent.currentView&&(this.colLevels[this.colLevels.length-1]=this.colLevels[this.colLevels.length-1].slice(0,i),this.parent.resourceBase.expandedResources=this.colLevels[this.colLevels.length-1])},e.prototype.getCollection=function(e){return this.parent.virtualScrollModule&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(e||this.parent.virtualScrollModule.existingDataCollection.length>0)?t.isNullOrUndefined(e)?this.parent.virtualScrollModule.existingDataCollection:e:[]},e.prototype.getGroupIndices=function(e){return this.getCollection(e).map(function(e){return e.groupIndex})},e.prototype.getRenderedDate=function(e){var t=[];return this.getCollection(e).forEach(function(e){var i=e.date.getTime();-1===t.indexOf(i)&&t.push(i)}),t},e.prototype.destroy=function(){this.element&&this.element.parentNode&&t.remove(this.element),this.element=null,this.renderDates=null,this.colLevels=null},e}(),on=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ln=function(e){function i(t){var i=e.call(this,t)||this;return i.viewClass="e-day-view",i.isInverseTableSelect=!0,i.baseCssClass="e-vertical-view",i.appointment=null,i}return on(i,e),i.prototype.getModuleName=function(){return"verticalView"},i.prototype.addEventListener=function(){this.parent.on(Xe,this.scrollUiUpdate,this),this.parent.on(_e,this.renderEvents,this)},i.prototype.removeEventListener=function(){this.parent&&(this.parent.off(Xe,this.scrollUiUpdate),this.parent.off(_e,this.renderEvents))},i.prototype.renderEvents=function(){this.appointment=this.parent.activeViewOptions.timeScale.enable?new Ft(this.parent):new Bt(this.parent),this.appointment.renderAppointments(),this.parent.notify("events-loaded",{})},i.prototype.onContentScroll=function(e){this.parent.removeNewEventElement();var i=e.target;this.parent.notify("virtual-scroll",e),this.scrollLeftPanel(i),this.scrollTopPanel(i),this.parent.isAdaptive||(this.parent.uiStateValues.top=i.scrollTop),this.parent.uiStateValues.left=i.scrollLeft,t.isNullOrUndefined(this.parent.quickPopup)||this.parent.uiStateValues.isTapHold||this.parent.quickPopup.quickPopupHide(),this.setPersistence()},i.prototype.onAdaptiveMove=function(e){this.parent.uiStateValues.action&&e.preventDefault()},i.prototype.onAdaptiveScroll=function(e){this.parent&&!this.parent.isDestroyed&&(this.parent.removeNewEventElement(),this.parent.uiStateValues.top=e.target.scrollTop)},i.prototype.scrollLeftPanel=function(e){var i=this.getLeftPanelElement();t.isNullOrUndefined(i)||(i.scrollTop=e.scrollTop)},i.prototype.scrollUiUpdate=function(e){if(this.parent){var i=this.parent.element.querySelector(".e-date-header-wrap"),n=this.getHeaderBarHeight(),r=this.getLeftPanelElement(),a=this.getScrollableElement(),s=this.getDatesHeaderElement(),o=this.parent.element.offsetHeight-n-s.offsetHeight;this.setContentHeight(a,r,o),this.setColWidth(a);var l=M();s.firstElementChild.style[e.cssProperties.rtlBorder]="",s.style[e.cssProperties.rtlPadding]="";var p=!this.parent.enableAllDayScroll||!(a.offsetWidth-a.clientWidth<=i.offsetWidth-i.clientWidth&&i.classList.contains("e-all-day-scroll"));a.offsetWidth-a.clientWidth>0&&p?(s.firstElementChild.style[e.cssProperties.border]=l>0?"1px":"0px",s.style[e.cssProperties.padding]=l>0?l-1+"px":"0px"):(s.firstElementChild.style[e.cssProperties.border]="",s.style[e.cssProperties.padding]=""),e.isPreventScrollUpdate||(this.parent.uiStateValues.isInitial?(this.parent.currentView.indexOf("Timeline")>-1&&(a.scrollTop=this.parent.uiStateValues.top),this.scrollToWorkHour(),this.parent.uiStateValues.isInitial=!1):(r&&(r.scrollTop=this.parent.uiStateValues.top),a.scrollTop=this.parent.uiStateValues.top,a.scrollLeft=this.parent.uiStateValues.left)),this.parent.activeViewOptions.timeScale.enable&&this.highlightCurrentTime(),this.retainScrollPosition(),t.isNullOrUndefined(r)||t.isNullOrUndefined(a)||r.scrollTop===a.scrollTop||(r.scrollTop=a.scrollTop)}},i.prototype.setContentHeight=function(e,i,n){this.parent.isAdaptive&&!this.isTimelineView()?e.style.height="auto"===this.parent.height?"auto":t.formatUnit(n):(t.isNullOrUndefined(i)||(i.style.height="auto"===this.parent.height?"auto":t.formatUnit(n-this.getScrollXIndent(e))),e.style.height="auto"===this.parent.height?"auto":t.formatUnit(n))},i.prototype.scrollToWorkHour=function(){if(this.parent.workHours.highlight){var e=this.element.querySelector(".e-work-hours");e&&(this.getScrollableElement().scrollTop=e.offsetTop,this.parent.uiStateValues.top=e.offsetTop,this.parent.uiStateValues.left=0)}},i.prototype.scrollToHour=function(e,i){var n=this.parent.getStartEndTime(e);if(!t.isNullOrUndefined(i)){var r=this.element.querySelector('.e-header-cells[data-date="'+new Date(b(i)).getTime()+'"]');if(r)if(this.parent.enableRtl){var a=this.element.querySelector("."+nt);this.getScrollableElement().scrollLeft=-(a.offsetWidth-r.offsetLeft-r.offsetWidth)}else this.getScrollableElement().scrollLeft=r.offsetLeft}t.isNullOrUndefined(n)||(this.getScrollableElement().scrollTop=this.getTopFromDateTime(n))},i.prototype.scrollToDate=function(e){this.scrollToHour(null,e)},i.prototype.generateColumnLevels=function(){var e=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays),t=[];if(this.parent.activeViewOptions.group.resources.length>0){if(t=this.parent.resourceBase.generateResourceLevels(e),this.parent.activeViewOptions.group.hideNonWorkingDays)for(;0===t[0].length;)this.parent.setProperties({selectedDate:this.parent.activeView.getNextPreviousDate(this.previousNextAction)},!0),this.parent.activeView.getRenderDates(),this.parent.headerModule&&(this.parent.headerModule.setCalendarDate(this.parent.selectedDate),this.parent.headerModule.updateDateRange()),e=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays),t=this.parent.resourceBase.generateResourceLevels(e);if(this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.lastResourceLevel.length>0){var i=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex],n=i.resourceData[i.resource.startHourField],r=i.resourceData[i.resource.endHourField];t=[this.getDateSlots(i.renderDates,i.workDays,n,r)]}}else t.push(e);return this.colLevels=t,t},i.prototype.getDateSlots=function(e,t,i,n){void 0===i&&(i=this.parent.workHours.start),void 0===n&&(n=this.parent.workHours.end);for(var r=[],a=this.parent.getStartEndTime(i),s=this.parent.getStartEndTime(n),o=0,l=e;o<l.length;o++){var p=l[o],c=["e-header-cells"];this.isCurrentDate(p)&&c.push("e-current-day"),r.push({date:p,type:"dateHeader",className:c,colSpan:1,workDays:t,startHour:new Date(+a),endHour:new Date(+s)})}return r},i.prototype.isWorkHourRange=function(e){return this.getStartHour().getTime()<=e.getTime()&&this.getEndHour().getTime()>=e.getTime()},i.prototype.highlightCurrentTime=function(){var e=this;if(!(this.parent.activeViewOptions.headerRows.length>0&&"Hour"!==this.parent.activeViewOptions.headerRows.slice(-1)[0].option)){var i=this.parent.getCurrentTime();if(this.parent.showTimeIndicator&&this.isWorkHourRange(i))if(this.getCurrentTimeIndicatorIndex().length>0&&!t.isNullOrUndefined(this.element.querySelector(".e-work-cells"))){if(this.changeCurrentTimePosition(),t.isNullOrUndefined(this.currentTimeIndicatorTimer)){var n=Ke-(1e3*i.getSeconds()+i.getMilliseconds());n<=Ke-1e3&&window.setTimeout(function(){t.isNullOrUndefined(e.currentTimeIndicatorTimer)||(e.clearCurrentTimeIndicatorTimer(),e.changeCurrentTimePosition(),e.updateCurrentTimeIndicatorTimer())},n),this.updateCurrentTimeIndicatorTimer()}}else this.clearCurrentTimeIndicatorTimer();else this.clearCurrentTimeIndicatorTimer()}},i.prototype.getCurrentTimeIndicatorIndex=function(){var e=[];if(!t.isNullOrUndefined(this.parent.resourceBase)&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive){var i=0,n=b(this.parent.getCurrentTime());if(this.parent.virtualScrollModule&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.activeViewOptions.group.byDate)for(var r=0,a=this.parent.resourceBase.expandedResources;r<a.length;r++)b((l=a[r]).date).getTime()===n.getTime()&&e.push(i),i+=1;else for(var s=0,o=this.parent.resourceBase.renderedResources;s<o.length;s++){var l=o[s];if((h=this.parent.getIndexOfDate(l.renderDates,n))>=0){var p=this.parent.activeViewOptions.group.byDate?this.parent.resourceBase.lastResourceLevel.length*h+i:i+h;e.push(p)}i+=this.parent.activeViewOptions.group.byDate?1:l.renderDates.length}}else{var c=this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.lastResourceLevel.length>0?this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex].renderDates:this.renderDates,h=this.parent.getIndexOfDate(c,b(this.parent.getCurrentTime()));h>=0&&e.push(h)}return e},i.prototype.clearCurrentTimeIndicatorTimer=function(){t.isNullOrUndefined(this.currentTimeIndicatorTimer)||(window.clearInterval(this.currentTimeIndicatorTimer),this.currentTimeIndicatorTimer=null,this.removeCurrentTimeIndicatorElements())},i.prototype.updateCurrentTimeIndicatorTimer=function(){var e=this;this.currentTimeIndicatorTimer=window.setInterval(function(){e.changeCurrentTimePosition()},Ke)},i.prototype.removeCurrentTimeIndicatorElements=function(){for(var e=0,i=[].slice.call(this.element.querySelectorAll(".e-previous-timeline,.e-current-timeline,.e-current-time"));e<i.length;e++){var n=i[e];t.remove(n)}},i.prototype.changeCurrentTimePosition=function(){if(!this.parent||this.parent&&this.parent.isDestroyed)return void(this.parent=null);this.removeCurrentTimeIndicatorElements();var e=this.getCurrentTimeIndicatorIndex(),i=this.parent.getContentTable().rows[0],n=this.getTopFromDateTime(this.parent.getCurrentTime()),r=t.formatUnit(n),a=Math.floor(n/i.cells[0].offsetHeight),s=this.getLeftPanelElement(),o=[].slice.call(s.querySelectorAll("tr"));if(!t.isNullOrUndefined(a)&&!isNaN(a)&&a!==o.length){for(var l=[].slice.call(this.element.querySelectorAll(".e-timeline-wrapper")),p=0,c=e[0];p<c;p++)l[parseInt(p.toString(),10)].appendChild(t.createElement("div",{className:"e-previous-timeline",styles:"top:"+r}));for(var h=0,d=e;h<d.length;h++){var u=d[h];l.length>u&&l[parseInt(u.toString(),10)].appendChild(t.createElement("div",{className:"e-current-timeline",styles:"top:"+r}))}var g=t.createElement("div",{innerHTML:this.parent.getTimeString(this.parent.getCurrentTime()),className:"e-current-time",styles:"top:"+r});a<=o.length&&(t.removeClass(s.querySelectorAll(".e-hide-childs"),"e-hide-childs"),o[parseInt(a.toString(),10)]&&t.addClass([o[parseInt(a.toString(),10)].lastElementChild],"e-hide-childs"),t.prepend([g],s),g.style.top=t.formatUnit(g.offsetTop-g.offsetHeight/2))}},i.prototype.getTopFromDateTime=function(e){var t=this.getStartEndHours(this.parent.activeViewOptions.startHour),i=this.getStartEndHours(this.parent.activeViewOptions.endHour),n=60*(e.getHours()-t.getHours())+(e.getMinutes()-t.getMinutes()),r=V(b(new Date(e.getTime())),t,i),a=(r.endHour.getTime()-r.startHour.getTime())/Ke,s=this.parent.activeViewOptions.timeScale.interval,o=0;return o=0===t.getHours()&&0===t.getMinutes()&&0===i.getHours()&&0===i.getMinutes()?s:1!==this.parent.activeViewOptions.timeScale.slotCount?s:s>a?a:s,n*this.getWorkCellHeight()*this.parent.activeViewOptions.timeScale.slotCount/o},i.prototype.getWorkCellHeight=function(){return parseFloat(this.parent.getElementHeight(this.element.querySelector(".e-work-cells")).toFixed(2))},i.prototype.getTdContent=function(e,i,n){var r,a=t.createElement("div"),s="",o=this.parent.element.id+"_";switch(i){case"dateHeader":if(this.parent.activeViewOptions.dateHeaderTemplate){s="dateHeaderTemplate";var l={date:e,type:i,groupIndex:n},p=this.parent.activeViewOptions.dateHeaderTemplateName;r=[].slice.call(this.parent.getDateHeaderTemplate()(l,this.parent,s,o+p+s,!1,void 0,void 0,this.parent.root))}else a.innerHTML=this.parent.activeView.isTimelineView()?'<span class="e-header-date e-navigate">'+this.getTimelineDate(e)+"</span>":'<div class="e-header-day">'+U(this.getDayName(e),"single")+'</div><div class="e-header-date e-navigate" role="link">'+this.getDate(e)+"</div>",r=[].slice.call(a.childNodes);break;case"majorSlot":if(this.parent.activeViewOptions.timeScale.majorSlotTemplate){s="majorSlotTemplate";l={date:e,type:i};r=[].slice.call(this.parent.getMajorSlotTemplate()(l,this.parent,s,o+s,!1,void 0,void 0,this.parent.root))}else a.innerHTML="<span>"+this.getTime(e)+"</span>",r=[].slice.call(a.childNodes);break;case"minorSlot":if(this.parent.activeViewOptions.timeScale.minorSlotTemplate){s="minorSlotTemplate";l={date:e,type:i};r=[].slice.call(this.parent.getMinorSlotTemplate()(l,this.parent,s,o+s,!1,void 0,void 0,this.parent.root))}else r=[].slice.call(a.childNodes);break;case"alldayCells":if(this.parent.activeViewOptions.cellTemplate){p=this.parent.activeViewOptions.cellTemplateName;s="cellTemplate";l={date:e,type:i,groupIndex:n};r=[].slice.call(this.parent.getCellTemplate()(l,this.parent,s,o+p+s,!1,void 0,void 0,this.parent.root))}}return r},i.prototype.refreshHeader=function(){t.remove(this.element.querySelector("tbody tr")),this.renderHeader(),this.parent.notify(Ge,{});var e=this.element.querySelector(".e-date-header-wrap");e&&(e.scrollLeft=this.parent.uiStateValues.left)},i.prototype.renderLayout=function(e){this.setPanel(t.createElement("div",{className:"e-table-wrap"}));var i=[this.baseCssClass,this.viewClass];i.push(e),this.parent.activeViewOptions.group.byDate&&i.push("e-by-date"),this.parent.activeViewOptions.timeScale.enable||t.addClass([this.element],["e-timescale-disable",this.viewClass]),this.parent.activeViewOptions.allowVirtualScrolling&&!this.parent.uiStateValues.isGroupAdaptive&&i.push("e-virtual-scroll"),this.parent.rowAutoHeight&&this.parent.eventSettings.ignoreWhitespace&&i.push("e-ignore-whitespace"),this.renderPanel(e),t.addClass([this.element],i),this.element.appendChild(this.createTableLayout("e-outer-table")),this.element.querySelector("table").setAttribute("role","presentation"),this.colLevels=this.generateColumnLevels(),this.renderHeader(),this.renderContent(),this.parent.uiStateValues.isGroupAdaptive&&!this.parent.element.querySelector(".e-schedule-resource-toolbar-container")&&this.renderResourceMobileLayout(),this.parent.notify(Ge,{})},i.prototype.renderHeader=function(){var e=t.createElement("tr"),i=t.createElement("td");if(i.appendChild(this.renderDatesHeader()),this.parent.activeViewOptions.timeScale.enable){var n=t.createElement("td",{className:"e-left-indent"});n.appendChild(this.renderLeftIndent()),e.appendChild(n)}e.appendChild(i),t.prepend([e],this.element.querySelector("tbody"))},i.prototype.renderContent=function(){this.parent.activeViewOptions.group.resources.length>0&&(this.parent.resourceBase.renderedResources=t.extend([],this.parent.resourceBase.lastResourceLevel,null,!0));var e=t.createElement("tr"),i=t.createElement("td");if(this.parent.isAdaptive){i.setAttribute("colspan",this.parent.activeViewOptions.timeScale.enable?"2":"1");var n=t.createElement("div",{className:"e-scroll-container"});this.parent.activeViewOptions.timeScale.enable&&n.appendChild(this.renderTimeCells()),n.appendChild(this.renderContentArea()),i.appendChild(n),t.EventHandler.add(n,"scroll",this.onAdaptiveScroll,this),t.EventHandler.add(n,t.Browser.touchMoveEvent,this.onAdaptiveMove,this),e.appendChild(i)}else{var r=this.colLevels.slice(0);this.parent.virtualScrollModule&&this.resetColLevels();var a=this.renderContentArea();if(i.appendChild(a),this.parent.activeViewOptions.timeScale.enable){var s=t.createElement("td");s.appendChild(this.renderTimeCells()),e.appendChild(s)}e.appendChild(i),this.parent.virtualScrollModule&&(this.colLevels=r,this.parent.virtualScrollModule.renderVirtualTrack(a))}this.element.querySelector("tbody").appendChild(e)},i.prototype.renderLeftIndent=function(){for(var e,i=t.createElement("div",{className:"e-left-indent-wrap"}),n=this.createTableLayout(),r=t.createElement("tr"),a=this.colLevels.length,s=0;s<a;s++){var o=r.cloneNode(),l={className:[this.colLevels[parseInt(s.toString(),10)][0]&&this.colLevels[parseInt(s.toString(),10)][0].className[0]],type:"emptyCells"};if(this.parent.activeViewOptions.showWeekNumber&&-1!==l.className.indexOf("e-header-cells")){l.className.push("e-week-number");var p=this.parent.getWeekNumberContent(this.renderDates);l.template=[t.createElement("span",{innerHTML:""+p,attrs:{title:this.parent.localeObj.getConstant("week")+" "+p}})]}e=this.createTd(l),this.parent.renderHeaderIndentTemplate(l,e),o.appendChild(e),n.querySelector("tbody").appendChild(o)}var c=r.cloneNode(),h=t.createElement("div",{attrs:{tabindex:"0",role:"button",title:this.parent.localeObj.getConstant("expandAllDaySection"),"aria-disabled":"false","aria-label":this.parent.localeObj.getConstant("expandAllDaySection")},className:"e-all-day-appointment-section e-appointment-expand e-icons e-disable"}),d={className:["e-all-day-cells"],type:"emptyCells"};return(e=this.createTd(d)).appendChild(h),this.parent.renderHeaderIndentTemplate(d,e),c.appendChild(e),n.querySelector("tbody").appendChild(c),i.appendChild(n),i},i.prototype.renderDatesHeader=function(){var e=t.createElement("div",{className:"e-date-header-container"}),i=t.createElement("div",{className:"e-date-header-wrap"});e.appendChild(i);for(var n=this.createTableLayout(),r=t.createElement("tr",{className:"e-header-row"}),a=this.colLevels.length,s=this.colLevels[a-1],o=0;o<a;o++){for(var l=r.cloneNode(),p=this.colLevels[parseInt(o.toString(),10)],c=0;c<p.length;c++)l.appendChild(this.createTd(p[parseInt(c.toString(),10)]));n.querySelector("tbody").appendChild(l)}return this.createAllDayRow(n,s),this.createColGroup(n,s),i.appendChild(n),e},i.prototype.createAllDayRow=function(e,i){for(var n=t.createElement("tr",{className:"e-all-day-row"}),r=0;r<i.length;r++){var a=t.extend({},i[parseInt(r.toString(),10)]);a.className=["e-all-day-cells"],a.type="alldayCells";var s=this.createTd(a);s.setAttribute("data-date",a.date.getTime().toString()),t.isNullOrUndefined(a.groupIndex)?this.parent.uiStateValues.isGroupAdaptive&&s.setAttribute("data-group-index",""+this.parent.uiStateValues.groupIndex):s.setAttribute("data-group-index",""+a.groupIndex),this.wireCellEvents(s),n.appendChild(s)}e.querySelector("tbody").appendChild(n);var o=t.createElement("thead");o.appendChild(this.parent.eventBase.createEventWrapper("allDay")),t.prepend([o],e)},i.prototype.createTd=function(e){var i=t.createElement("td");if(this.addAttributes(e,i),e.date&&e.type){var n=this.getTdContent(e.date,e.type,e.groupIndex);n&&n.length&&t.append(n,i)}this.parent.isMinMaxDate(b(new Date(""+e.date)))||t.addClass([i],pt),"resourceHeader"===e.type&&this.setResourceHeaderContent(i,e),"dateHeader"===e.type&&e.className.indexOf("e-header-cells")>=0&&(i.setAttribute("data-date",e.date.getTime().toString()),t.isNullOrUndefined(e.groupIndex)||i.setAttribute("data-group-index",""+e.groupIndex),this.wireMouseEvents(i));var r={elementType:e.type,element:i,date:e.date,groupIndex:e.groupIndex};return this.parent.trigger(ze,r),i},i.prototype.wireCellEvents=function(e){t.EventHandler.add(e,"mousedown",this.parent.workCellAction.cellMouseDown,this.parent.workCellAction),this.wireMouseEvents(e)},i.prototype.wireMouseEvents=function(e){t.EventHandler.add(e,"click",this.parent.workCellAction.cellClick,this.parent.workCellAction),this.parent.isAdaptive||t.EventHandler.add(e,"dblclick",this.parent.workCellAction.cellDblClick,this.parent.workCellAction)},i.prototype.renderTimeCells=function(){var e=this,i=t.createElement("div",{className:"e-time-cells-wrap"}),n=this.createTableLayout(),r=t.createElement("tr"),a=function(t){t.type=t.first?"majorSlot":"minorSlot",t.className=t.last?["e-time-cells","e-time-slots"]:["e-time-slots"];var i=r.cloneNode(),a={date:t.date,type:t.type,className:t.className};return i.appendChild(e.createTd(a)),n.querySelector("tbody").appendChild(i),t};return this.getTimeSlotRows(a),i.appendChild(n),i},i.prototype.renderContentArea=function(){var e=t.createElement("div",{className:"e-content-wrap"}),i=this.createTableLayout(nt);return this.setAriaAttributes(i),this.addAutoHeightClass(i),this.renderContentTable(i),this.createColGroup(i,this.colLevels.slice(-1)[0]),e.appendChild(i),this.wireCellEvents(i.querySelector("tbody")),t.EventHandler.add(e,"scroll",this.onContentScroll,this),t.EventHandler.add(e,t.Browser.touchMoveEvent,this.onAdaptiveMove,this),e},i.prototype.renderContentTable=function(e){var i=e.querySelector("tbody");t.append(this.getContentRows(),i),this.renderContentTableHeader(e)},i.prototype.getContentRows=function(){var e=this,i=[],n=t.createElement("tr"),r=t.createElement("td"),a=[];this.parent.virtualScrollModule&&this.parent.activeViewOptions.group.resources.length>0&&(a=this.parent.activeViewOptions.group.byDate?this.getRenderedDate():this.getGroupIndices());var s=function(t){for(var s=n.cloneNode(),o=0,l=e.colLevels[e.colLevels.length-1];o<l.length;o++){var p=l[o],c=!0;if(e.parent.virtualScrollModule&&e.parent.activeViewOptions.group.resources.length>0){var h=e.parent.activeViewOptions.group.byDate?p.date.getTime():p.groupIndex;c=a.indexOf(h)<0}if(c){var d=e.createContentTd(p,t,r);s.appendChild(d)}}return i.push(s),t};return this.getTimeSlotRows(s),i},i.prototype.createContentTd=function(e,i,n){var r=n.cloneNode();e.colSpan&&r.setAttribute("colspan",e.colSpan.toString());var a=this.getContentTdClass(i),s=b(e.date);this.parent.isMinMaxDate(s)||a.push(pt),s=new Date(s.setHours(i.date.getHours(),i.date.getMinutes(),i.date.getSeconds(),i.date.getMilliseconds()));var o="workCells";if(-1!==e.className.indexOf("e-parent-node")&&(a.push("e-resource-group-cells"),o="resourceGroupCells"),this.parent.workHours.highlight&&(this.parent.activeViewOptions.timeScale.enable&&this.isWorkHour(s,e.startHour,e.endHour,e.workDays)||!this.parent.activeViewOptions.timeScale.enable&&this.isWorkDay(s,e.workDays))&&a.push("e-work-hours"),t.addClass([r],a),this.parent.activeViewOptions.cellTemplate){var l={date:s,type:o,groupIndex:e.groupIndex},p=this.parent.element.id+"_"+this.parent.activeViewOptions.cellTemplateName+"cellTemplate",c=[].slice.call(this.parent.getCellTemplate()(l,this.parent,"cellTemplate",p,!1,void 0,void 0,this.parent.root));t.append(c,r)}r.setAttribute("data-date",s.getTime().toString());if(this.parent.activeViewOptions.timeScale.enable){var h=this.parent.globalize.formatDate(s,{type:"dateTime",skeleton:"full",calendar:this.parent.getCalendarMode()}),d=this.parent.globalize.formatDate(this.getEndDateFromStartDate(s),{type:"dateTime",skeleton:"full",calendar:this.parent.getCalendarMode()});r.setAttribute("aria-label",h+" "+this.parent.localeObj.getConstant("endAt")+" "+d)}else{var u=this.parent.globalize.formatDate(e.date,{skeleton:"full",calendar:this.parent.getCalendarMode()});r.setAttribute("aria-label",u)}if(!t.isNullOrUndefined(e.groupIndex)||this.parent.uiStateValues.isGroupAdaptive){var g=this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:e.groupIndex;r.setAttribute("data-group-index",""+g)}var v={elementType:o,element:r,date:s,groupIndex:e.groupIndex};return this.parent.trigger(ze,v),r},i.prototype.getContentTdClass=function(e){return e.last?["e-work-cells"]:["e-work-cells","e-alternate-cells"]},i.prototype.renderContentTableHeader=function(e){var i=t.createElement("thead");i.appendChild(this.parent.eventBase.createEventWrapper()),this.parent.activeViewOptions.timeScale.enable&&i.appendChild(this.parent.eventBase.createEventWrapper("timeIndicator")),t.prepend([i],e)},i.prototype.getScrollableElement=function(){return this.parent.isAdaptive&&!this.isTimelineView()?this.element.querySelector(".e-scroll-container"):this.getContentAreaElement()},i.prototype.getLeftPanelElement=function(){return this.element.querySelector(".e-time-cells-wrap")},i.prototype.getEndDateFromStartDate=function(e){var t=this.parent.activeViewOptions.timeScale.interval*Ke/this.parent.activeViewOptions.timeScale.slotCount,i=new Date(e.getTime());return i.setMilliseconds(i.getMilliseconds()+t),i},i.prototype.getStartEndHours=function(e){if(!t.isNullOrUndefined(e)&&""!==e){var i=new Date(2e3,0,0,0),n=e.split(":");return 2===n.length&&i.setHours(parseInt(n[0],10),parseInt(n[1],10),0),i}return new Date(2e3,0,0,0)},i.prototype.getTimeSlotRows=function(e){var t=[],i=this.getStartEndHours(this.parent.activeViewOptions.startHour),n=this.getStartEndHours(this.parent.activeViewOptions.endHour),r=this.parent.activeViewOptions.timeScale.interval*Ke,a=r/this.parent.activeViewOptions.timeScale.slotCount,s=Math.round(Qe/a),o=i.getTime(),l=n.getTime();if(o!==l){var p=i.getTimezoneOffset()!==n.getTimezoneOffset()?l-o-36e5:l-o;s=Math.round(p/a)}this.parent.activeViewOptions.timeScale.enable||(s=1);for(var c=this.parent.getStartEndTime(this.parent.workHours.start),h=this.parent.getStartEndTime(this.parent.workHours.end),d=0;d<s;d++){var u=new Date(o+a*d);if(N(u)||new Date(o).getTimezoneOffset()!==u.getTimezoneOffset()){var g=new Date(o).getTimezoneOffset()-u.getTimezoneOffset();u=new Date(u.getTime()-6e4*g)}var v=d%(r/a),m={date:new Date(""+u),startHour:c,endHour:h,first:0===v,middle:v<this.parent.activeViewOptions.timeScale.slotCount-1,last:v===this.parent.activeViewOptions.timeScale.slotCount-1,type:""};e&&e(m),t.push(m)}return t},i.prototype.getAdjustedDate=function(e){if(!this.parent.activeViewOptions.timeScale.enable)return new Date(e.setHours(0,0,0,0));for(var t=this.getTimeSlotRows(),i=new Date(new Date(t[0].date.getTime()).setHours(e.getHours(),e.getMinutes(),e.getMilliseconds())),n=0;n<t.length;n++)if(t[parseInt(n.toString(),10)].date.getTime()>i.getTime())return e.setHours(t[n-1].date.getHours(),t[n-1].date.getMinutes(),t[n-1].date.getMilliseconds()),new Date(e);return null},i.prototype.destroy=function(){if(!this.parent||this.parent&&this.parent.isDestroyed)return void(this.parent=null);if(this.clearCurrentTimeIndicatorTimer(),this.element){this.appointment&&(this.appointment.destroy(),this.appointment=null);var i=this.getContentAreaElement();i&&(t.EventHandler.remove(i,"scroll",this.onContentScroll),t.EventHandler.remove(i,t.Browser.touchMoveEvent,this.onAdaptiveMove)),this.parent.resourceBase&&this.parent.resourceBase.destroy(),this.parent.scheduleTouchModule&&this.parent.scheduleTouchModule.resetValues(),e.prototype.destroy.call(this)}},i}(sn),pn=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),cn=function(e){function t(t){var i=e.call(this,t)||this;return i.viewClass="e-day-view",i}return pn(t,e),t.prototype.getModuleName=function(){return"day"},t}(ln),hn=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),dn=function(e){function t(t){var i=e.call(this,t)||this;return i.viewClass="e-week-view",i}return hn(t,e),t.prototype.startDate=function(){return this.getViewStartDate()},t.prototype.endDate=function(){return this.getViewEndDate()},t.prototype.getModuleName=function(){return"week"},t}(ln),un=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),gn=function(e){function t(t){var i=e.call(this,t)||this;return i.viewClass="e-work-week-view",i}return un(t,e),t.prototype.startDate=function(){return this.getViewStartDate()},t.prototype.endDate=function(){return this.getViewEndDate()},t.prototype.getModuleName=function(){return"workWeek"},t}(ln),vn=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),mn=function(e){function i(t){var i=e.call(this,t)||this;return i.dayNameFormat="wide",i.viewClass="e-month-view",i.isInverseTableSelect=!1,i.monthEvent=null,i.monthDates={},i}return vn(i,e),i.prototype.addEventListener=function(){this.parent.on(Xe,this.onScrollUIUpdate,this),this.parent.on(_e,this.onDataReady,this),this.parent.on("cellClick",this.onCellClick,this)},i.prototype.removeEventListener=function(){this.parent&&(this.parent.off(Xe,this.onScrollUIUpdate),this.parent.off(_e,this.onDataReady),this.parent.off("cellClick",this.onCellClick))},i.prototype.onDataReady=function(e){this.monthEvent=new Bt(this.parent),this.monthEvent.renderAppointments(),this.parent.notify("events-loaded",{})},i.prototype.onCellClick=function(e){},i.prototype.onContentScroll=function(e){this.skipPersistenceSave||(this.parent.removeNewEventElement(),this.parent.notify("virtual-scroll",e),this.scrollTopPanel(e.target),this.scrollLeftPanel(e.target),this.parent.uiStateValues.top=e.target.scrollTop,this.parent.uiStateValues.left=e.target.scrollLeft,this.setPersistence())},i.prototype.scrollLeftPanel=function(e){var t=this.getLeftPanelElement();t&&(t.scrollTop=e.scrollTop)},i.prototype.getLeftPanelElement=function(){return this.element.querySelector(".e-week-number-wrapper")},i.prototype.onScrollUIUpdate=function(e){var t=this.getHeaderBarHeight(),i=this.getDatesHeaderElement(),n=this.getContentAreaElement(),r=this.parent.element.offsetHeight-t-i.offsetHeight,a=this.getLeftPanelElement();"auto"!==this.parent.height&&this.setContentHeight(n,a,r);var s=M();if(i.firstElementChild.style[e.cssProperties.rtlBorder]="",i.style[e.cssProperties.rtlPadding]="",n.offsetWidth-n.clientWidth>0?(i.firstElementChild.style[e.cssProperties.border]=s>0?"1px":"0px",i.style[e.cssProperties.padding]=s>0?s-1+"px":"0px"):(i.firstElementChild.style[e.cssProperties.border]="",i.style[e.cssProperties.padding]=""),this.setColWidth(n),e.scrollPosition||!e.isPreventScrollUpdate&&"TimelineMonth"===this.parent.currentView){var o="TimelineMonth"===this.parent.currentView?this.parent.uiStateValues.top:e.scrollPosition.top;a&&(a.scrollTop=o),n.scrollTop=o,this.parent.uiStateValues.isInitial?(this.scrollToSelectedDate(),this.parent.uiStateValues.isInitial=!1):n.scrollLeft="TimelineMonth"===this.parent.currentView?this.parent.uiStateValues.left:e.scrollPosition.left}this.retainScrollPosition()},i.prototype.scrollToSelectedDate=function(){var e=new Date(this.parent.selectedDate);e.setHours(0,0,0,0);var i=this.element.querySelector('.e-header-cells[data-date="'+e.getTime().toString()+'"]'),n=this.getContentAreaElement();t.isNullOrUndefined(i)?n.scrollLeft=0:n.scrollLeft=this.parent.enableRtl?-(this.parent.getContentTable().offsetWidth-i.offsetLeft-i.offsetWidth):i.offsetLeft,0===n.scrollLeft&&this.parent.uiStateValues.isInitial&&(this.parent.uiStateValues.left=0)},i.prototype.setContentHeight=function(e,i,n){e.style.height="auto","Month"===this.parent.currentView&&(e.style.height=t.formatUnit(n)),i&&("MonthAgenda"===this.parent.currentView&&(n=this.parent.activeViewOptions.interval>1?this.getContentAreaElement().firstElementChild.offsetHeight:this.element.querySelector("."+nt).offsetHeight),i.style.height="auto",i.style.height=t.formatUnit(n-this.getScrollXIndent(e)))},i.prototype.generateColumnLevels=function(){var e=[],t=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays);if(this.parent.activeViewOptions.group.resources.length>0){if(e=this.parent.resourceBase.generateResourceLevels(t),"MonthAgenda"===this.parent.currentView&&(e=[t]),this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.lastResourceLevel.length>0){var i=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex],n=this.getDateSlots(i.renderDates,i.workDays);if(this.parent.activeViewOptions.group.byDate&&this.parent.activeViewOptions.group.hideNonWorkingDays){var r=n.findIndex(function(e,t){return 0!==t&&e.date.getDay()===n[0].date.getDay()});n=r>-1?n.slice(0,r):n}e=[n]}}else e.push(t);return this.colLevels=e,e},i.prototype.getDateSlots=function(e,t){for(var i=this.parent.activeViewOptions.showWeekend?7:t.length,n=[],r=this.isCurrentMonth(this.parent.selectedDate),a=0;a<i;a++){var s=["e-header-cells"],o=e.slice(0,i).map(function(e){return e.getDay()});r&&o.indexOf(this.parent.currentTimezoneDate.getDay())===a&&s.push("e-current-day"),n.push({date:e[parseInt(a.toString(),10)],type:"monthDay",className:s,colSpan:1,workDays:t})}return n},i.prototype.getDayNameFormat=function(){return this.parent.isAdaptive||this.parent.activeViewOptions.group.resources.length>0?"abbreviated":"wide"},i.prototype.renderLayout=function(e){this.dayNameFormat=this.getDayNameFormat(),this.setPanel(t.createElement("div",{className:"e-table-wrap"}));var i=[this.viewClass];i.push(e),this.parent.activeViewOptions.group.byDate&&(i.push("e-by-date"),"Month"!==this.parent.currentView&&(this.parent.activeViewOptions.group.hideNonWorkingDays=!1)),this.parent.activeViewOptions.allowVirtualScrolling&&!this.parent.uiStateValues.isGroupAdaptive&&i.push("e-virtual-scroll"),this.parent.rowAutoHeight&&this.parent.eventSettings.ignoreWhitespace&&i.push("e-ignore-whitespace"),t.addClass([this.element],i),this.renderPanel(e),this.element.appendChild(this.createTableLayout("e-outer-table")),this.element.querySelector("table").setAttribute("role","presentation"),this.colLevels=this.generateColumnLevels(),this.renderHeader(),this.renderContent();var n="MonthAgenda"===this.parent.currentView?this.parent.activeView.getPanel():this.parent.element;this.parent.uiStateValues.isGroupAdaptive&&!n.querySelector(".e-schedule-resource-toolbar-container")&&this.renderResourceMobileLayout(),this.parent.notify(Ge,{}),this.parent.uiStateValues.isCustomMonth&&(this.parent.uiStateValues.isCustomMonth=!1)},i.prototype.refreshHeader=function(){t.remove(this.element.querySelector("tbody tr")),this.renderHeader(),this.parent.notify(Ge,{});var e=this.element.querySelector(".e-date-header-wrap"),i=this.element.querySelector(".e-content-wrap");e&&(e.scrollLeft=this.parent.uiStateValues.left),i&&(i.scrollLeft=this.parent.uiStateValues.left)},i.prototype.wireCellEvents=function(e){t.EventHandler.add(e,"mousedown",this.parent.workCellAction.cellMouseDown,this.parent.workCellAction),t.EventHandler.add(e,"click",this.parent.workCellAction.cellClick,this.parent.workCellAction),this.parent.isAdaptive||t.EventHandler.add(e,"dblclick",this.parent.workCellAction.cellDblClick,this.parent.workCellAction)},i.prototype.renderHeader=function(){var e=t.createElement("tr");this.renderLeftIndent(e);var i=t.createElement("td");i.appendChild(this.renderDatesHeader()),e.appendChild(i),t.prepend([e],this.element.querySelector("tbody"))},i.prototype.renderLeftIndent=function(e){this.parent.activeViewOptions.showWeekNumber&&e.appendChild(t.createElement("td",{className:"e-left-indent"}))},i.prototype.renderContent=function(){this.parent.activeViewOptions.group.resources.length>0&&(this.parent.resourceBase.renderedResources=t.extend([],this.parent.resourceBase.lastResourceLevel,null,!0));var e=t.createElement("tr");this.parent.activeViewOptions.showWeekNumber&&e.appendChild(this.renderWeekNumberContent());var i=t.createElement("td"),n=this.colLevels.slice(0);this.parent.virtualScrollModule&&this.resetColLevels();var r=t.createElement("div",{className:"e-content-wrap"}),a=this.renderContentArea();if("Month"===this.parent.currentView)r.appendChild(a);else{var s=t.createElement("div",{className:tt});s.appendChild(a),r.appendChild(s)}t.EventHandler.add(r,"scroll",this.onContentScroll,this),i.appendChild(r),e.appendChild(i),this.parent.virtualScrollModule&&(this.colLevels=n,this.parent.virtualScrollModule.renderVirtualTrack(r)),this.element.querySelector("tbody").appendChild(e),this.renderAppointmentContainer()},i.prototype.renderWeekNumberContent=function(){var e=this.renderDates.map(function(e){return new Date(+e)}),i=t.createElement("td"),n=t.createElement("div",{className:"e-week-number-wrapper"});i.appendChild(n);var r=this.createTableLayout();n.appendChild(r);for(var a=this.parent.activeViewOptions.showWeekend?7:this.parent.activeViewOptions.workDays.length,s=0,o=this.renderDates.length/a;s<o;s++){var l=e.splice(0,a),p=this.parent.getWeekNumberContent(l);r.querySelector("tbody").appendChild(this.createWeekNumberElement(p))}return i},i.prototype.renderAppointmentContainer=function(){},i.prototype.renderDatesHeader=function(){var e=t.createElement("div",{className:"e-date-header-container"}),i=t.createElement("div",{className:"e-date-header-wrap"});e.appendChild(i);var n=this.createTableLayout();if("Month"===this.parent.currentView){var r=t.createElement("thead");r.appendChild(t.createElement("tr")),t.prepend([r],n)}this.createColGroup(n,this.colLevels[this.colLevels.length-1]);for(var a=t.createElement("tr"),s=0;s<this.colLevels.length;s++){for(var o=this.colLevels[parseInt(s.toString(),10)],l=a.cloneNode(),p=0;p<o.length;p++){var c=o[parseInt(p.toString(),10)];l.appendChild(this.createHeaderCell(c))}n.querySelector("tbody").appendChild(l)}return i.appendChild(n),e},i.prototype.createHeaderCell=function(e){var i=t.createElement("td");if(this.addAttributes(e,i),"monthDay"===e.type){s=t.createElement("span",{innerHTML:U(this.parent.getDayNames(this.dayNameFormat)[e.date.getDay()],"single")});i.appendChild(s)}if("resourceHeader"===e.type&&this.setResourceHeaderContent(i,e),"dateHeader"===e.type){if(t.addClass([i],"e-date-header"),i.setAttribute("data-date",e.date.getTime().toString()),this.parent.activeViewOptions.dateHeaderTemplate){var n={date:e.date,type:e.type},r=this.parent.element.id+"_"+this.parent.activeViewOptions.dateHeaderTemplateName+"dateHeaderTemplate",a=[].slice.call(this.parent.getDateHeaderTemplate()(n,this.parent,"dateHeaderTemplate",r,!1,void 0,void 0,this.parent.root));a&&a.length&&t.append(a,i)}else{var s=t.createElement("span",{className:"e-navigate"}),o=this.parent.globalize.formatDate(e.date,{skeleton:"full",calendar:this.parent.getCalendarMode()});s.setAttribute("title",U(o,"multiple"));var l=!this.parent.calendarUtil.isMonthStart(e.date)||this.isCurrentDate(e.date)||this.parent.isAdaptive?this.parent.globalize.formatDate(e.date,{skeleton:"d",calendar:this.parent.getCalendarMode()}):this.parent.globalize.formatDate(e.date,{format:"MMM d",calendar:this.parent.getCalendarMode()});s.innerHTML=U(l,"single"),i.appendChild(s)}this.wireCellEvents(i)}var p={elementType:e.type,element:i,date:e.date,groupIndex:e.groupIndex};return this.parent.trigger(ze,p),i},i.prototype.getContentSlots=function(){if(!this.colLevels[this.colLevels.length-1]||!this.colLevels[this.colLevels.length-1][0])return[];var e=[],t=function(t,i,n,r){var a={date:new Date(+i),groupIndex:n.groupIndex,workDays:n.workDays,type:"monthCells",className:r||["e-work-cells"]};e[parseInt(t.toString(),10)]||(e[parseInt(t.toString(),10)]=[]),e[parseInt(t.toString(),10)].push(a)},i="MonthAgenda"!==this.parent.currentView&&this.parent.activeViewOptions.group.resources.length>0;if(!i||this.parent.uiStateValues.isGroupAdaptive||this.parent.activeViewOptions.group.byDate)for(var n=this.renderDates.map(function(e){return new Date(+e)}),r=this.parent.activeViewOptions.showWeekend?7:this.parent.activeViewOptions.workDays.length,a=this.colLevels.slice(0,1)[0],s=this.renderDates.map(Number).indexOf(+a[0].date),o=0;o<this.renderDates.length/r;o++)for(var l,p=n.splice(0,r),c=s,h=this,d=s;d<this.colLevels[0].length+s&&d<p.length;d++)!function(e){var n=p[parseInt(c.toString(),10)];if(c++,i){var a=h.colLevels[h.colLevels.length-1],s=a.length/r,d=a.slice(0,s);if(h.parent.activeViewOptions.group.hideNonWorkingDays&&0===(d=a.filter(function(e){return e.date.getDay()===n.getDay()})).length)return e-=1,l=e,"continue";for(var u=0;u<d.length;u++){var g=void 0;0!==u&&(g=["e-work-cells","e-disable-date"]),t(o,n,d[parseInt(u.toString(),10)],g)}}else t(o,n,h.colLevels[h.colLevels.length-1][0]);l=e}(d),d=l;else for(var u=0,g=this.colLevels[this.colLevels.length-2];u<g.length;u++)for(var v=g[u],n=v.renderDates.map(function(e){return new Date(+e)}),r=this.parent.activeViewOptions.showWeekend?7:v.workDays.length,o=0;o<v.renderDates.length/r;o++)for(var m=0,f=p=n.splice(0,r);m<f.length;m++){var y=f[m];t(o,y,v)}return e},i.prototype.updateClassList=function(e){!this.isCustomMonth()&&this.isOtherMonth(e.date)&&e.className.push("e-other-month"),this.parent.isMinMaxDate(e.date)||e.className.push(pt),this.updateSelectedCellClass(e)},i.prototype.updateSelectedCellClass=function(e){},i.prototype.isOtherMonth=function(e){return e.getTime()<this.monthDates.start.getTime()||e.getTime()>this.monthDates.end.getTime()},i.prototype.renderContentArea=function(){var e=this.createTableLayout(nt);this.setAriaAttributes(e),this.addAutoHeightClass(e),"TimelineMonth"===this.parent.currentView&&this.createColGroup(e,this.colLevels[this.colLevels.length-1]);var i=new Date(this.parent.selectedDate.getTime());this.monthDates={start:this.parent.calendarUtil.firstDateOfMonth(i),end:this.parent.calendarUtil.lastDateOfMonth(E(i,this.parent.activeViewOptions.interval-1))};var n=e.querySelector("tbody");return t.append(this.getContentRows(),n),this.wireCellEvents(n),e},i.prototype.getContentRows=function(){for(var e=[],i=t.createElement("tr"),n=t.createElement("td"),r=this.getContentSlots(),a="TimelineMonth"===this.parent.currentView?this.getGroupIndices():[],s=0;s<r.length;s++)if(!(a.length>0&&a.indexOf(r[parseInt(s.toString(),10)][0].groupIndex)>-1)){for(var o=i.cloneNode(),l=0;l<r[parseInt(s.toString(),10)].length;l++){var p=this.createContentTd(r[parseInt(s.toString(),10)][parseInt(l.toString(),10)],n);o.appendChild(p)}e.push(o)}return e},i.prototype.createContentTd=function(e,i){var n=i.cloneNode();e.colSpan&&n.setAttribute("colspan",e.colSpan.toString()),this.updateClassList(e);var r=e.type;if(-1!==e.className.indexOf("e-parent-node")&&(e.className.push("e-resource-group-cells"),r="resourceGroupCells"),this.parent.workHours.highlight&&this.isWorkDay(e.date,e.workDays)&&e.className.push("e-work-days"),this.isCurrentDate(e.date)&&e.className.push("e-current-date"),t.addClass([n],e.className),n.setAttribute("data-date",e.date.getTime().toString()),!t.isNullOrUndefined(e.groupIndex)||this.parent.uiStateValues.isGroupAdaptive){var a=this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:e.groupIndex;n.setAttribute("data-group-index",""+a)}if(this.renderDateHeaderElement(e,n),this.parent.activeViewOptions.cellTemplate){var s={date:e.date,type:r,groupIndex:e.groupIndex},o=this.parent.element.id+"_"+this.parent.activeViewOptions.cellTemplateName+"cellTemplate",l=[].slice.call(this.parent.getCellTemplate()(s,this.parent,"cellTemplate",o,!1,void 0,void 0,this.parent.root));t.append(l,n)}var p={elementType:r,element:n,date:e.date,groupIndex:e.groupIndex};return this.parent.trigger(ze,p),n},i.prototype.renderDateHeaderElement=function(e,i){if("TimelineMonth"!==this.parent.currentView){var n=t.createElement("div",{className:"e-date-header"});if(this.parent.activeViewOptions.cellHeaderTemplate){var r={date:e.date,type:e.type,groupIndex:e.groupIndex},a=this.parent.element.id+"_"+this.parent.activeViewOptions.cellHeaderTemplateName+"cellHeaderTemplate",s=[].slice.call(this.parent.getCellHeaderTemplate()(r,this.parent,"cellHeaderTemplate",a,!1,void 0,void 0,this.parent.root));t.append(s,n)}else{var o=!this.parent.calendarUtil.isMonthStart(e.date)||this.isCurrentDate(e.date)||this.parent.isAdaptive?this.parent.globalize.formatDate(e.date,{skeleton:"d",calendar:this.parent.getCalendarMode()}):this.parent.globalize.formatDate(e.date,{format:"MMM d",calendar:this.parent.getCalendarMode()});n.innerHTML=U(o,"single")}if(i.appendChild(n),"month"===this.getModuleName()){t.addClass([n],"e-navigate");var l=this.parent.globalize.formatDate(e.date,{skeleton:"full",calendar:this.parent.getCalendarMode()});i.setAttribute("aria-label",l)}}},i.prototype.getMonthStart=function(e){var i=v("Month"===this.parent.currentView&&!t.isNullOrUndefined(this.parent.activeViewOptions.displayDate)&&!this.parent.uiStateValues.isSwipeScroll&&(this.parent.uiStateValues.isCustomMonth||this.isCustomRange())?this.parent.activeViewOptions.displayDate:this.parent.uiStateValues.isCustomMonth||!this.parent.uiStateValues.isSwipeScroll&&this.isCustomRange()||!this.isCustomMonth()?this.parent.calendarUtil.firstDateOfMonth(e):e,this.parent.activeViewOptions.firstDayOfWeek);return new Date(i.getFullYear(),i.getMonth(),i.getDate())},i.prototype.getMonthEnd=function(e){if(this.isCustomMonth())return O(this.getMonthStart(e),7*(this.parent.activeViewOptions.numberOfWeeks>0?this.parent.activeViewOptions.numberOfWeeks:6)-1);var t=E(e,this.parent.activeViewOptions.interval-1);return O(v(this.parent.calendarUtil.lastDateOfMonth(t),this.parent.activeViewOptions.firstDayOfWeek),6)},i.prototype.isCustomRange=function(){var e=this.parent.getCurrentViewDates();if(e&&e.length>0){var t=b(this.parent.selectedDate).getTime(),i=v(e[e.length-1],this.parent.activeViewOptions.firstDayOfWeek);return!(t>=v(e[0],this.parent.activeViewOptions.firstDayOfWeek).getTime()&&t<=O(i,6).getTime())}return!1},i.prototype.getRenderDates=function(e,t){void 0===t&&(t=this.parent.selectedDate);var i=[],n=b(t),r=this.getMonthStart(n),a=this.getMonthEnd(n);do{this.parent.activeViewOptions.showWeekend?i.push(r):this.isWorkDay(r,e)&&i.push(r),(r=O(r,1)).getHours()>0&&(r=b(r))}while(r.getTime()<=a.getTime());return e||(this.renderDates=i),this.parent.headerModule&&this.parent.headerModule.previousNextIconHandler(),i},i.prototype.getNextPreviousDate=function(e){if(this.isCustomMonth()){var t=this.parent.getCurrentViewDates();return O(v("Next"===e?t[t.length-1]:t[0],this.parent.activeViewOptions.firstDayOfWeek),"Next"===e?7:7*-(this.parent.activeViewOptions.numberOfWeeks>0?this.parent.activeViewOptions.numberOfWeeks:6))}return E(this.parent.selectedDate,("Next"===e?1:-1)*this.parent.activeViewOptions.interval)},i.prototype.getStartDate=function(){return this.getMonthStart(this.parent.selectedDate)},i.prototype.getEndDate=function(){return this.getMonthEnd(this.parent.selectedDate)},i.prototype.getEndDateFromStartDate=function(e){return O(new Date(e.getTime()),1)},i.prototype.getDateRangeText=function(e,i){if(void 0===e&&(e=this.parent.selectedDate),void 0===i&&(i=null),this.parent.isAdaptive||t.isNullOrUndefined(this.parent.activeViewOptions.dateFormat)){e=!t.isNullOrUndefined(i)&&i.length>6?i[6]:e;var n=void 0,r=!1;if(this.isCustomMonth()){var a=!t.isNullOrUndefined(i)&&i.length>0?i:this.parent.getCurrentViewDates();(r=a[0].getMonth()!==a[a.length-1].getMonth()||a[0].getFullYear()!==a[a.length-1].getFullYear())&&(e=a[0],n=a[a.length-1])}var s="Month"!==this.parent.currentView||!this.isCustomMonth();if(this.parent.activeViewOptions.interval>1&&s||r)return n=n||E(y(e),this.parent.activeViewOptions.interval-1),e.getFullYear()===n.getFullYear()?U(this.parent.globalize.formatDate(e,{format:"MMMM",calendar:this.parent.getCalendarMode()})+" - "+this.parent.globalize.formatDate(n,{format:"MMMM ",calendar:this.parent.getCalendarMode()})+this.parent.globalize.formatDate(n,{skeleton:"y",calendar:this.parent.getCalendarMode()}),"single"):U(this.parent.globalize.formatDate(e,{format:"MMMM",calendar:this.parent.getCalendarMode()})+" "+e.getFullYear()+" - "+this.parent.globalize.formatDate(n,{format:"MMMM ",calendar:this.parent.getCalendarMode()})+this.parent.globalize.formatDate(n,{skeleton:"y",calendar:this.parent.getCalendarMode()}),"single");var o=this.parent.activeViewOptions.dateFormat?this.parent.activeViewOptions.dateFormat:"MMMM y";return U(this.parent.globalize.formatDate(e,{format:o,calendar:this.parent.getCalendarMode()}),"single")}return this.formatDateRange(!t.isNullOrUndefined(i)&&i.length>0?i[0]:this.parent.selectedDate)},i.prototype.getLabelText=function(e){var t=e.charAt(0).toLowerCase()+e.substring(1);return this.formatViewLabel(t,this.getStartDate(),this.getEndDate())},i.prototype.createWeekNumberElement=function(e){var i=t.createElement("tr"),n=t.createElement("td",{className:"e-week-number",attrs:{title:e?this.parent.localeObj.getConstant("week")+" "+e:""},innerHTML:e||""});i.appendChild(n);var r={elementType:"weekNumberCell",element:n};return this.parent.trigger(ze,r),i},i.prototype.unWireEvents=function(){var e=this.element.querySelector(".e-content-wrap");e&&t.EventHandler.remove(e,"scroll",this.onContentScroll)},i.prototype.isCustomMonth=function(){return"Month"===this.parent.currentView&&(!t.isNullOrUndefined(this.parent.activeViewOptions.displayDate)||this.parent.activeViewOptions.numberOfWeeks>0)},i.prototype.getModuleName=function(){return"month"},i.prototype.destroy=function(){if(!this.parent||this.parent&&this.parent.isDestroyed)return void(this.parent=null);this.element&&(this.monthEvent&&(this.monthEvent.destroy(),this.monthEvent=null),this.unWireEvents(),this.parent.resourceBase&&this.parent.resourceBase.destroy(),this.parent.scheduleTouchModule&&this.parent.scheduleTouchModule.resetValues(),e.prototype.destroy.call(this))},i}(sn),fn=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),yn=function(e){function i(t){var i=e.call(this,t)||this;return i.viewClass="e-year-view",i.isInverseTableSelect=!1,i.yearEventModule=null,i}return fn(i,e),i.prototype.getModuleName=function(){return"year"},i.prototype.renderLayout=function(e){this.parent.resourceBase&&this.parent.resourceBase.generateResourceLevels([{renderDates:this.parent.activeView.renderDates}]),this.setPanel(t.createElement("div",{className:"e-table-wrap"}));var i="Horizontal"===this.parent.activeViewOptions.orientation?"e-horizontal":"e-vertical";t.addClass([this.element],[this.viewClass,i,e]),this.renderPanel(e),this.parent.activeViewOptions.allowVirtualScrolling&&t.addClass([this.element],["e-virtual-scroll"]);var n=this.createTableLayout("e-outer-table");this.element.appendChild(n),this.element.querySelector("table").setAttribute("role","presentation");var r=n.querySelector("tbody");this.rowCount=this.getRowColumnCount("row"),this.columnCount=this.getRowColumnCount("column"),this.renderHeader(r),this.renderContent(r),"Year"!==this.parent.currentView&&this.parent.uiStateValues.isGroupAdaptive&&(this.generateColumnLevels(),this.renderResourceMobileLayout()),t.EventHandler.add(this.element.querySelector(".e-content-wrap"),"scroll",this.onContentScroll,this),this.parent.notify(Ge,{})},i.prototype.renderHeader=function(e){},i.prototype.renderContent=function(e){var i=t.createElement("tr");e.appendChild(i);var n=t.createElement("td");i.appendChild(n),this.element.querySelector("tbody").appendChild(i);var r=t.createElement("div",{className:"e-content-wrap"});n.appendChild(r);var a=this.createTableLayout("e-calendar-table");r.appendChild(a);var s=t.createElement("tr");a.querySelector("tbody").appendChild(s);var o=t.createElement("td");s.appendChild(o);var l=t.createElement("div",{className:"e-calendar-wrapper"});o.appendChild(l);for(var p=0,c=this.getMonths();p<c.length;p++){var h=c[p],d=new Date(this.parent.selectedDate.getFullYear(),h,1),u=t.createElement("div",{className:"e-month-calendar e-calendar",attrs:{"data-role":"calendar"}});u.appendChild(this.renderCalendarHeader(d)),u.appendChild(this.renderCalendarContent(d)),l.appendChild(u)}this.renderDates.splice(0,1)},i.prototype.renderCalendarHeader=function(e){var i=t.createElement("div",{className:"e-header e-month"}),n=t.createElement("div",{className:"e-day e-title"});if(this.parent.activeViewOptions.monthHeaderTemplate){var r={date:e,type:"monthHeader"};this.renderTemplates(this.parent.getMonthHeaderTemplate(),r,"monthHeaderTemplate",this.parent.activeViewOptions.monthHeaderTemplateName,n)}else n.innerHTML=this.getMonthName(e);return i.appendChild(n),this.parent.trigger(ze,{elementType:"headerCells",element:n,date:e}),i},i.prototype.renderCalendarContent=function(e){var i=this.getMonthDates(e),n=t.createElement("div",{className:"e-content e-month"}),r=this.createTableLayout("e-calendar-table "+nt);n.appendChild(r),this.setAriaAttributes(r);var a=t.createElement("thead",{className:"e-week-header"}),s=t.createElement("tr"),o=v(f(e),this.parent.activeViewOptions.firstDayOfWeek);this.parent.activeViewOptions.showWeekNumber&&s.appendChild(t.createElement("th"));for(var l=0;l<7;l++){if(this.parent.activeViewOptions.dayHeaderTemplate){var p=t.createElement("th"),c={date:o,type:"dayHeader"};this.renderTemplates(this.parent.getDayHeaderTemplate(),c,"dayHeaderTemplate",this.parent.activeViewOptions.dayHeaderTemplateName,p),s.appendChild(p)}else s.appendChild(t.createElement("th",{innerHTML:this.parent.getDayNames("narrow")[o.getDay()]}));var h=new Date(o.getTime()+Qe);o=h.getDate()===o.getDate()?O(h,1):h}a.appendChild(s),t.prepend([a],r);for(var d=r.querySelector("tbody");i.length>0;){var u=i.splice(0,7),g=t.createElement("tr");if(this.parent.activeViewOptions.showWeekNumber){var m=this.parent.getWeekNumberContent(u),y=t.createElement("td",{className:"e-week-number",attrs:{title:this.parent.localeObj.getConstant("week")+" "+m},innerHTML:m});g.appendChild(y),this.parent.trigger(ze,{elementType:"weekNumberCells",element:y})}for(var T=0,w=u;T<w.length;T++){var D=w[T],y=t.createElement("td",{className:"e-cell e-work-cells",attrs:{"data-date":D.getTime().toString()}});if(this.parent.activeViewOptions.cellHeaderTemplate){c={date:D,type:"monthCells"};this.renderTemplates(this.parent.getCellHeaderTemplate(),c,"cellHeaderTemplate",this.parent.activeViewOptions.cellHeaderTemplateName,y)}else{var b=t.createElement("span",{className:"e-day",innerHTML:this.parent.globalize.formatDate(D,{skeleton:"d",calendar:this.parent.getCalendarMode()}),attrs:{title:this.parent.globalize.formatDate(D,{type:"date",skeleton:"full"})}});y.appendChild(b)}if(this.parent.activeViewOptions.cellTemplate){c={date:D,type:"monthCells"};this.renderTemplates(this.parent.getCellTemplate(),c,"cellTemplate",this.parent.activeViewOptions.cellTemplateName,y)}var C=[];e.getMonth()!==D.getMonth()&&(C.push("e-other-month"),y.firstElementChild&&!this.parent.activeViewOptions.cellTemplate&&y.firstElementChild.setAttribute("aria-disabled","true")),this.isCurrentDate(D)&&e.getMonth()===D.getMonth()&&(C=C.concat(["e-today","e-selected"])),C.length>0&&t.addClass([y],C),g.appendChild(y),e.getMonth()===D.getMonth()&&this.renderDates.push(new Date(D)),this.parent.isMinMaxDate(D)?(t.EventHandler.add(y,"click",this.onCellClick,this),this.parent.isAdaptive||t.EventHandler.add(y,"dblclick",this.parent.workCellAction.cellDblClick,this.parent.workCellAction)):t.addClass([y],pt),this.parent.trigger(ze,{elementType:"workCells",element:y,date:D})}d.appendChild(g)}return n},i.prototype.createTableColGroup=function(e){for(var i=t.createElement("colgroup"),n=0;n<e;n++)i.appendChild(t.createElement("col"));return i},i.prototype.getMonthName=function(e){return U(this.parent.globalize.formatDate(e,{format:this.parent.activeViewOptions.dateFormat||"MMMM y",calendar:this.parent.getCalendarMode()}),"multiple")},i.prototype.generateColumnLevels=function(){var e=[],t=this.getDateSlots([this.parent.selectedDate],this.parent.activeViewOptions.workDays);if(this.parent.activeViewOptions.group.resources.length>0){if(e=this.parent.resourceBase.generateResourceLevels(t),this.parent.uiStateValues.isGroupAdaptive){var i=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex];e=[this.getDateSlots([this.parent.selectedDate],i.workDays)]}}else e.push(t);return e.pop(),this.colLevels=e,e},i.prototype.getDateSlots=function(e,t,i,n){return void 0===i&&(i=this.parent.workHours.start),void 0===n&&(n=this.parent.workHours.end),[{date:e[0],type:"dateHeader",className:["e-header-cells"],colSpan:1,workDays:t,startHour:new Date(+this.parent.globalize.parseDate(i,{skeleton:"Hm"})),endHour:new Date(+this.parent.globalize.parseDate(n,{skeleton:"Hm"}))}]},i.prototype.getMonthDates=function(e){for(var t=v(f(e),this.parent.activeViewOptions.firstDayOfWeek),i=O(new Date(+t),42),n=[],r=t;r.getTime()<i.getTime();r=O(r,1))n.push(b(new Date(r)));return n},i.prototype.getRowColumnCount=function(e){for(var t=this.getMonths(),i=this.parent.selectedDate.getFullYear(),n=[],r=0,a=t;r<a.length;r++){var s=a[r];n.push(new Date(i,s,1).getDay()+new Date(i,s+1,0).getDate())}var o=Math.max.apply(Math,n);return"row"===e?"Horizontal"===this.parent.activeViewOptions.orientation?t.length:o:"Horizontal"===this.parent.activeViewOptions.orientation?o:t.length},i.prototype.isCurrentDate=function(e){return b(new Date).getTime()===b(new Date(e.getTime())).getTime()},i.prototype.getMonths=function(){var e=this;return Array.apply(null,{length:this.parent.activeViewOptions.monthsCount}).map(function(t,i){return e.parent.firstMonthOfYear+i})},i.prototype.renderTemplates=function(e,i,n,r,a){var s=this.parent.element.id+"_"+r+n,o=[].slice.call(e(i,this.parent,n,s,!1,void 0,void 0,this.parent.root));t.append(o,a)},i.prototype.onCellClick=function(e){var i=t.closest(e.target,".e-work-cells"),n=this.parent.getDateFromElement(i);this.parent.activeCellsData=this.parent.getCellDetails(i);var r=n.getTime()<this.getStartDate().getTime();if(r||n.getTime()>this.getEndDate().getTime()){this.parent.changeDate(this.parent.activeView.getNextPreviousDate(r?"Previous":"Next"),e);var a=this.parent.activeCellsData.startTime.getTime(),s=a>=this.getStartDate().getTime()&&a<=this.getEndDate().getTime()?a:(r?this.getEndDate():this.getStartDate()).getTime(),o=this.parent.element.querySelector(':not(.e-other-month)[data-date="'+s+'"]');this.parent.selectCell(o),this.parent.activeCellsData=this.parent.getCellDetails(o)}else{var l=O(new Date(n.getTime()),1),p={date:n,event:this.parent.eventBase.filterEvents(n,l),element:e.target};i.classList.contains("e-other-month")&&(i=this.parent.element.querySelector(':not(.e-other-month)[data-date="'+i.getAttribute("data-date")+'"]')),this.parent.activeCellsData=this.parent.getCellDetails(i);var c=t.extend(this.parent.activeCellsData,{cancel:!1,event:e,name:"cellClick"});this.parent.trigger("cellClick",c),this.parent.quickPopup.moreEventClick(p,l)}},i.prototype.onContentScroll=function(e){var t=e.target,i=this.getDatesHeaderElement();this.parent.notify("virtual-scroll",e),i&&(i.firstElementChild.scrollLeft=t.scrollLeft);var n=this.element.querySelector(".e-month-header-wrapper,.e-resource-column-wrap");n&&(n.scrollTop=t.scrollTop),this.parent.isAdaptive||(this.parent.uiStateValues.top=e.target.scrollTop),this.parent.uiStateValues.left=e.target.scrollLeft,this.setPersistence()},i.prototype.onScrollUiUpdate=function(e){var i=this.parent.element.offsetHeight-this.getHeaderBarHeight(),n=this.element.querySelector(".e-date-header-container");n&&(i-=n.offsetHeight);var r=this.element.querySelector(".e-content-wrap");if(r&&(r.style.height=t.formatUnit(i)),!this.parent.isAdaptive&&n){var a=M();r.offsetWidth-r.clientWidth>0?(n.firstElementChild.style[e.cssProperties.border]=a>0?"1px":"0px",n.style[e.cssProperties.padding]=a>0?a-1+"px":"0px"):(n.firstElementChild.style[e.cssProperties.border]="",n.style[e.cssProperties.padding]="")}this.setColWidth(this.getContentAreaElement());var s=this.element.querySelector(".e-month-header-wrapper,.e-resource-column-wrap");if(s){var o=r.scrollWidth>r.clientWidth;s.style.height=t.formatUnit(i-(o?17:0))}e.isPreventScrollUpdate||(this.parent.uiStateValues.isInitial?(this.parent.uiStateValues.isInitial=!1,this.parent.uiStateValues.top=this.parent.uiStateValues.left=0):(s&&(s.scrollTop=this.parent.uiStateValues.top),r.scrollTop=this.parent.uiStateValues.top,r.scrollLeft=this.parent.uiStateValues.left)),this.retainScrollPosition()},i.prototype.getStartDate=function(){return new Date(this.parent.selectedDate.getFullYear(),this.parent.firstMonthOfYear%12,1)},i.prototype.getEndDate=function(){return O(E(this.getStartDate(),this.parent.monthsCount),-1)},i.prototype.startDate=function(){return"Year"===this.parent.currentView?v(this.getStartDate(),this.parent.activeViewOptions.firstDayOfWeek):this.getStartDate()},i.prototype.endDate=function(){return"Year"===this.parent.currentView?O(m(this.getEndDate(),this.parent.activeViewOptions.firstDayOfWeek),1):O(this.getEndDate(),1)},i.prototype.getEndDateFromStartDate=function(e){var t=new Date(e.getTime());return this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(t=y(t)),O(new Date(t.getTime()),1)},i.prototype.getNextPreviousDate=function(e){return x(this.parent.selectedDate,"Next"===e?1:-1)},i.prototype.getDateRangeText=function(e,i){void 0===e&&(e=this.parent.selectedDate),void 0===i&&(i=null);var n=!t.isNullOrUndefined(i)&&i.length>0,r=n?i[0]:this.getStartDate(),a=n?i[i.length-1]:this.getEndDate();return r.getFullYear()!==a.getFullYear()?this.parent.globalize.formatDate(r,{format:"MMM y",calendar:this.parent.getCalendarMode()})+" - "+this.parent.globalize.formatDate(a,{format:"MMM y",calendar:this.parent.getCalendarMode()}):this.parent.globalize.formatDate(n?i[0]:e,{skeleton:"y",calendar:this.parent.getCalendarMode()})},i.prototype.addEventListener=function(){this.parent.on(Xe,this.onScrollUiUpdate,this),this.parent.on(_e,this.onDataReady,this)},i.prototype.removeEventListener=function(){this.parent&&(this.parent.off(Xe,this.onScrollUiUpdate),this.parent.off(_e,this.onDataReady))},i.prototype.onDataReady=function(e){this.yearEventModule=new nn(this.parent),this.yearEventModule.renderAppointments(),this.parent.notify("events-loaded",e)},i.prototype.scrollToDate=function(e){var i=+new Date(b(e)),n=this.element.querySelector('.e-work-cells:not(.e-other-month)[data-date="'+i+'"]');n&&(n=t.closest(n,".e-month-calendar"),this.getContentAreaElement().scrollTop=n.offsetTop)},i.prototype.destroy=function(){if(!this.parent||this.parent&&this.parent.isDestroyed)return void(this.parent=null);if(this.element){var i=this.element.querySelector(".e-content-wrap");i&&t.EventHandler.remove(i,"scroll",this.onContentScroll),this.yearEventModule&&(this.yearEventModule.destroy(),this.yearEventModule=null),this.parent.resourceBase&&this.parent.resourceBase.destroy(),e.prototype.destroy.call(this)}},i}(sn),Tn=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),wn=function(e){function i(t){return e.call(this,t)||this}return Tn(i,e),i.prototype.createAgendaContentElement=function(e,i,n,r,a){var s,o=this,l=this.parent.eventFields;if("noEvents"===e){var c=[{subject:this.parent.localeObj.getConstant("noEvents")}];0===(s=p.ListBase.createList(this.parent.createElement,c,{moduleName:"agenda",listClass:this.parent.activeView.viewClass,itemClass:this.parent.activeView.viewClass,template:t.initializeCSPTemplate(function(){return'<div class="e-no-event">'+o.parent.localeObj.getConstant("noEvents")+"</div>"})})).querySelector(".e-agenda-item").children.length&&s.firstElementChild.appendChild(t.createElement("div",{className:"e-no-event",innerHTML:this.parent.localeObj.getConstant("noEvents")}))}else s=p.ListBase.createList(this.parent.createElement,i,{moduleName:"agenda",listClass:this.parent.activeView.viewClass,itemClass:this.parent.activeView.viewClass}),[].slice.call(s.children).forEach(function(e,n){var s=t.createElement("div",{className:"e-appointment",attrs:{"data-id":"Appointment_"+i[parseInt(n.toString(),10)][""+o.parent.eventFields.id],"data-guid":i[parseInt(n.toString(),10)].Guid,role:"button",tabindex:"0","aria-disabled":o.parent.eventBase.getReadonlyAttribute(i[parseInt(n.toString(),10)]),"aria-label":o.parent.getAnnouncementString(i[parseInt(n.toString(),10)])}});t.isNullOrUndefined(a)||s.setAttribute("data-group-index",a.toString()),o.parent.eventBase.applyResourceColor(s,i[parseInt(n.toString(),10)],"borderColor",r);var p;if(t.isNullOrUndefined(o.parent.activeViewOptions.eventTemplate))p=o.createAppointment(i[parseInt(n.toString(),10)]);else{t.addClass([s],"e-template");var c=o.parent.element.id+"_"+o.parent.activeViewOptions.eventTemplateName+"eventTemplate";if(p=o.parent.getAppointmentTemplate()(i[parseInt(n.toString(),10)],o.parent,"eventTemplate",c,!1,void 0,void 0,o.parent.root),!t.isNullOrUndefined(i[parseInt(n.toString(),10)][l.recurrenceRule])){var h=i[parseInt(n.toString(),10)][l.id]===i[parseInt(n.toString(),10)][l.recurrenceID]?"e-recurrence-icon":"e-recurrence-edit-icon";s.appendChild(t.createElement("div",{className:et+" "+h}))}}t.append([].slice.call(p),s),j(e),e.appendChild(s);var d={data:t.extend({},i[parseInt(n.toString(),10)],null,!0),element:e,cancel:!1};o.parent.trigger("eventRendered",d,function(i){i.cancel&&t.remove(e)})});return n.appendChild(s),("MonthAgenda"===this.parent.currentView&&this.parent.activeViewOptions.group.resources.length>0||"Agenda"===this.parent.currentView)&&t.addClass([n],"e-day-border"),this.parent.renderTemplates(),n},i.prototype.createAppointment=function(e){var i=this.parent.eventFields,n=e[i.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),r=e[i.location]||this.parent.eventSettings.fields.location.default,a=t.createElement("div",{className:"e-subject-wrap"});t.isNullOrUndefined(r)||""===r||(n+=",");var s=t.createElement("div",{className:"e-subject"});if(this.parent.sanitize(n,s),a.appendChild(s),!t.isNullOrUndefined(r)&&""!==r){var o=t.createElement("div",{className:"e-location"});this.parent.sanitize(r,o),a.appendChild(o)}if(!t.isNullOrUndefined(e[i.recurrenceRule])){var l=e[i.id]===e[i.recurrenceID]?"e-recurrence-icon":"e-recurrence-edit-icon";a.appendChild(t.createElement("div",{className:et+" "+l}))}var p=e[i.startTime],c=e[i.endTime],h=e[i.isAllDay],d=this.parent.localeObj.getConstant("allDay"),u=this.parent.getTimeString(p)+" - "+this.parent.getTimeString(c);t.isNullOrUndefined(e.data)||(d=((c.getTimezoneOffset()!==p.getTimezoneOffset()?c.getTime()-p.getTime()+36e5:c.getTime()-p.getTime())/Qe>=1?d:u)+" ("+this.parent.localeObj.getConstant("day")+" "+e.data.index+"/"+e.data.count+")");var g=!t.isNullOrUndefined(e.data)||h?d:u;return[a,t.createElement("div",{className:"e-date-time",innerHTML:g})]},i.prototype.processAgendaEvents=function(e){var i=[];if(t.isNullOrUndefined(e))return i;for(var n=0,r=e;n<r.length;n++){var a=r[n],s=this.parent.eventBase.splitEventByDay(a);i=i.concat(s.length>1?s:a)}return i},i.prototype.wireEventActions=function(){for(var e=0,i=[].slice.call(this.parent.element.querySelectorAll(".e-appointment"));e<i.length;e++){a=i[e];this.parent.eventBase.wireAppointmentEvents(a,this.parent.getEventDetails(a),!0)}for(var n=0,r=[].slice.call(this.parent.element.querySelectorAll(".e-m-date"));n<r.length;n++){var a=r[n];t.EventHandler.add(a,"click",this.parent.agendaModule.dayNavigationClick,this)}},i.prototype.calculateResourceTableElement=function(e,i,n,r){if(void 0===r&&(r=null),t.isNullOrUndefined(this.parent.resourceBase.lastResourceLevel)){var a=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays);this.parent.resourceBase.generateResourceLevels(a)}for(var s=O(new Date(n.getTime()),i),o=this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView?i:1,l=this.parent.resourceBase.resourceCollection,p=this.parent.resourceBase.lastResourceLevel,c=n,h=n,d=this.parent.activeViewOptions.showWeekend,u=0;u<o;u++){var g=[],v=[],m=0,f=void 0,y=void 0,T=O(h,u);if("Agenda"===this.parent.currentView&&this.parent.activeViewOptions.group.byDate&&this.parent.activeViewOptions.allowVirtualScrolling&&!d&&!this.isWorkDay(T)){do{if((T=O(T,1))>=r)break}while(!this.isWorkDay(T)||this.parent.eventBase.filterEvents(T,O(T,1)).length<1);if(T>=r)break;h=O(T,-u),s=O(T,1)}var w=this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView?O(T,1):s,D=this.parent.eventBase.filterEvents(T,w);if(D.length>0||!this.parent.hideEmptyAgendaDays||"MonthAgenda"===this.parent.currentView){for(var b=0;b<p.length;b++){i=this.parent.activeViewOptions.group.byDate&&"MonthAgenda"!==this.parent.currentView?1:i;M=[];n=T;var C=this.parent.eventBase.filterEvents(n,s,D,p[parseInt(b.toString(),10)]);if(C.length>0||!this.parent.hideEmptyAgendaDays||"MonthAgenda"===this.parent.currentView)for(var S=0;S<i;S++){var E=this.parent.eventBase.filterEvents(n,O(n,1),C,void 0);if(((d||!d&&(this.parent.group.byDate?this.isWorkDay(n):this.isWorkDay(n,p[parseInt(b.toString(),10)].workDays)))&&(E.length>0||!this.parent.hideEmptyAgendaDays)||"MonthAgenda"===this.parent.currentView)&&(M.push(E[0]),f={rowSpan:1,type:"eventColumn",resource:l[l.length-1],groupIndex:p[parseInt(b.toString(),10)].groupIndex,groupOrder:p[parseInt(b.toString(),10)].groupOrder,resourceData:p[parseInt(b.toString(),10)].resourceData,eventData:E,date:n},y={rowSpan:1,type:"dateColumn",resource:l[parseInt((l.length-1).toString(),10)],groupOrder:p[parseInt(b.toString(),10)].groupOrder,resourceData:p[parseInt(b.toString(),10)].resourceData,date:n,groupIndex:p[parseInt(b.toString(),10)].groupIndex},g[parseInt(m.toString(),10)]||(g[parseInt(m.toString(),10)]=[]),g[parseInt(m.toString(),10)].push(f),g[parseInt(m.toString(),10)].push(y),m++),(n=O(n,1)).getTime()>=s.getTime()||this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView){if(M.length>0){g[g.length-1][1].cssClass="e-day-border";var x={rowSpan:M.length,type:"resourceColumn",resource:l[parseInt((l.length-1).toString(),10)],groupOrder:p[parseInt(b.toString(),10)].groupOrder.slice(0,-1),resourceData:p[parseInt(b.toString(),10)].resourceData,groupIndex:g.length-M.length,className:["e-resource-name"],date:n};g[parseInt((g.length-M.length).toString(),10)].push(x),v.push(t.extend({},x,null,!0))}break}}}for(var V=l.slice(0,-1),A=[],I=0,k=0;k<V.length;k++)for(var M=V[V.length-(k+1)].dataSource,R=0;R<M.length;R++)for(var H=0,P=0;P<v.length;P++)v[parseInt(P.toString(),10)].groupOrder[V.length-(k+1)]===M[parseInt(R.toString(),10)][V[V.length-(k+1)].idField]&&(I+=v[parseInt(P.toString(),10)].rowSpan,A.push(t.extend({},v[parseInt(P.toString(),10)],null,!0))),++H===v.length&&A.length>0&&(A[0].rowSpan=I,A[0].type="parentColumnLevel_"+(k+1),A[0].resource=V[V.length-(k+1)],A[0].resourceData=M[parseInt(R.toString(),10)],A[0].date=n,g[A[0].groupIndex].push(A[0]),A=[],I=0);this.createResourceTableRow(g,e)}}0===this.parent.eventBase.filterEvents(c,s).length&&!this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays&&this.renderEmptyContent(e,c)},i.prototype.createResourceTableRow=function(e,i){var n,r,a,s=t.createElement("tr"),o=t.createElement("td"),l=0;if(this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView){for(var p=[],c=this.parent.resourceBase.resourceCollection.slice(0,-1),h=0;h<e.length;h++)p=p.concat(e[parseInt(h.toString(),10)]);a=c.length>0?"parentColumnLevel_"+c.length:"resourceColumn";for(var d=p.filter(function(e){return e.type===a}),u=0;u<d.length;u++)l+=d[parseInt(u.toString(),10)].rowSpan}for(var g=0;g<e.length;g++){n=s.cloneNode();for(var v=e[parseInt(g.toString(),10)].length-1;v>=0;v--){var m=e[parseInt(g.toString(),10)][parseInt(v.toString(),10)],f=o.cloneNode();if("dateColumn"===m.type){if(this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView){r=e[parseInt(g.toString(),10)][parseInt(v.toString(),10)];continue}f.setAttribute("data-date",m.date.getTime().toString()),f.appendChild(this.createDateHeaderElement(m.date,m.groupIndex));var y=["e-agenda-cells","e-date-column"];m.cssClass&&y.push(m.cssClass),t.addClass([f],y),this.isCurrentDate(new Date(m.date.getTime()))&&t.addClass(f.childNodes,"e-current-day"),n.appendChild(f)}else if("eventColumn"===m.type){for(var T=0===m.eventData.length?"noEvents":"data",w=0;w<n.childNodes.length;w++){var D=n.childNodes.item(w),b=D.classList.contains("e-resource-column")?"resourceHeader":"dateHeader";this.parent.trigger(ze,{elementType:b,element:D,date:m.date,groupIndex:m.groupIndex})}(f=this.createAgendaContentElement(T,m.eventData,f,m.groupOrder,m.groupIndex)).setAttribute("data-date",m.date.getTime().toString()),(this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView)&&t.addClass([f],["e-agenda-cells","e-day-padding"]),n.appendChild(f);var C=0===m.eventData.length?"noEvents":"agendaCells";this.parent.trigger(ze,{elementType:C,element:f,date:m.date,groupIndex:m.groupIndex})}else f.setAttribute("rowspan",m.rowSpan.toString()),t.addClass([f],"e-resource-column"),this.setResourceHeaderContent(f,m,m.className[0]),n.appendChild(f)}if(this.parent.activeViewOptions.group.byDate&&0===g&&"MonthAgenda"!==this.parent.currentView){(f=o.cloneNode()).setAttribute("data-date",r.date.getTime().toString()),f.setAttribute("rowspan",l.toString()),f.appendChild(this.createDateHeaderElement(r.date)),t.addClass([f],["e-agenda-cells","e-date-column","e-date-border"]);var S=I(this.parent.selectedDate.getTime(),r.date.getTime());if(n.setAttribute("data-row-index",S.toString()),this.parent.element.querySelector('.e-agenda-view tr[data-row-index="'+S+'"]'))break;n.insertBefore(f,n.childNodes[0])}i.appendChild(n)}},i.prototype.createDateHeaderElement=function(e,i){var n;if(this.parent.activeViewOptions.dateHeaderTemplate){n=t.createElement("div",{className:"e-day-date-header"});var r={date:e,type:"dateHeader",groupIndex:i},a=this.parent.element.id+"_"+this.parent.activeViewOptions.dateHeaderTemplateName+"dateHeaderTemplate",s=[].slice.call(this.parent.getDateHeaderTemplate()(r,this.parent,"dateHeaderTemplate",a,!1,void 0,void 0,this.parent.root));t.append(s,n)}else n=this.getMobileDateElement(e,"e-day-date-header");return n},i.prototype.renderEmptyContent=function(e,i,n){var r=this.createTableRowElement(i,"noEvents"),a=r.children[0],s=t.createElement("div",{className:"e-empty-event",innerHTML:this.parent.localeObj.getConstant("noEvents")});a.appendChild(s),e.appendChild(r),n&&this.parent.trigger(ze,{elementType:"noEvents",element:a,date:i})},i.prototype.createTableRowElement=function(e,i){var n=I(this.parent.selectedDate.getTime(),e.getTime()),r=t.createElement("tr",{attrs:{"data-row-index":n.toString()}}),a=t.createElement("td",{attrs:{class:"monthHeader"===i?"e-month-header":"e-agenda-cells","aria-selected":"false","data-column-index":n.toString(),"data-date":e.getTime().toString()}}),s=a.cloneNode(),o=a.cloneNode();return r.appendChild(s),"noEvents"!==i&&r.appendChild(o),r},i.prototype.destroy=function(){e.prototype.destroy.call(this)},i}(sn),Dn=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),bn=function(e){function i(t){var i=e.call(this,t)||this;return i.viewClass="e-agenda-view",i.isInverseTableSelect=!1,i.agendaDates={},i.virtualScrollTop=1,i}return Dn(i,e),i.prototype.getModuleName=function(){return"agenda"},i.prototype.renderLayout=function(){this.agendaDates={},this.element=t.createElement("div",{className:"e-table-wrap"}),t.addClass([this.element],this.viewClass),this.element.appendChild(this.createTableLayout("e-outer-table")),this.element.querySelector("table").setAttribute("role","presentation"),this.parent.element.querySelector("."+tt).appendChild(this.element);var e=t.createElement("tr");this.element.querySelector("tbody").appendChild(e);var i=t.createElement("td");e.appendChild(i);var n=t.createElement("div",{className:"e-content-wrap"});i.appendChild(n);var r=this.createTableLayout(nt);this.setAriaAttributes(r),n.appendChild(r);var a=r.querySelector("tbody"),s=b(this.parent.selectedDate);this.renderEmptyContent(a,s),this.wireEvents(),this.parent.resourceBase&&this.parent.resourceBase.generateResourceLevels([{renderDates:this.parent.activeView.renderDates}]),this.parent.uiStateValues.isGroupAdaptive&&!this.parent.element.querySelector(".e-schedule-resource-toolbar-container")&&this.renderResourceMobileLayout(),this.parent.notify(Ge,{})},i.prototype.eventLoad=function(e){this.dataSource=t.extend([],this.parent.eventsData,null,!0);for(var i=0,n=this.parent.eventsData;i<n.length;i++)delete n[i].generatedDates;var r=this.parent.activeViewOptions.allowVirtualScrolling?e.processedData:this.parent.eventsProcessed;if(this.parent.uiStateValues.isGroupAdaptive){var a=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex];this.dataSource=this.parent.eventBase.filterEventsByResource(a,this.dataSource),r=this.parent.eventBase.filterEventsByResource(a,r)}this.parent.eventsProcessed=this.processAgendaEvents(r);var s=b(this.parent.selectedDate),o=this.element.querySelector("."+nt+" tbody"),l=t.closest(o,".e-content-wrap"),p=l.scrollTop;j(o),this.renderInitialContent(o,s),this.wireEventActions(),l.scrollTop=p,this.parent.notify("events-loaded",{}),this.parent.activeViewOptions.allowVirtualScrolling||this.retainScrollPosition()},i.prototype.refreshEvent=function(e){for(var i=[],n=this.parent.eventFields,r=0,a=this.dataSource;r<a.length;r++){var s=a[r];t.isNullOrUndefined(s[n.recurrenceID])&&!t.isNullOrUndefined(s[n.recurrenceRule])&&!t.isNullOrUndefined(s.generatedDates)&&e>=s.generatedDates.end&&(i=i.concat(this.parent.eventBase.generateOccurrence(s,e)))}this.parent.eventsProcessed=this.parent.eventsProcessed.concat(this.processAgendaEvents(i))},i.prototype.refreshHeader=function(){var e=this.element.querySelector("."+nt+" tbody");this.parent.activeViewOptions.group.byDate?j(e):t.remove(e.firstElementChild);var i=b(this.parent.selectedDate),n=t.createElement("tbody"),r=new Date(i.getTime()),a=this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays?this.getEndDateFromStartDate(r):O(r,this.parent.agendaDaysCount);this.renderContent(n,r,a),t.append([].slice.call(n.childNodes),e)},i.prototype.renderInitialContent=function(e,i){var n=t.createElement("tbody"),r=new Date(i.getTime()),a=this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays?this.getEndDateFromStartDate(r):O(r,this.parent.agendaDaysCount);if(this.renderContent(n,r,a),t.append([].slice.call(n.childNodes),e),this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays&&this.parent.eventsData.length>0)for(var s=this.getContentAreaElement(),o=s.querySelector(".e-content-table");s.offsetWidth<=s.clientWidth&&!(this.parent.isAdaptive&&o.offsetHeight>=s.clientHeight);){var l=t.createElement("tbody");if(a=r,r=O(a,-this.parent.agendaDaysCount),this.renderContent(l,r,a),t.prepend([].slice.call(l.childNodes),e),r<=this.parent.minDate)break}e.childNodes.length<=0&&this.renderEmptyContent(e,i,!0)},i.prototype.renderContent=function(e,i,n){var r=this.parent.eventFields,a=new Date(i.getTime()),s=this.appointmentFiltering(a,n);if(s.length>0&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays)if(this.parent.activeViewOptions.showWeekend||this.isAgendaWorkDay(s[0][r.startTime]))i=new Date(new Date(s[0][r.startTime].getTime()).setHours(0,0,0,0)),this.updateHeaderText(s[0][r.startTime]);else for(var o=0,l=s;o<l.length;o++){var p=l[o];if(this.isAgendaWorkDay(p[r.startTime])){i=new Date(new Date(p[r.startTime].getTime()).setHours(0,0,0,0)),this.updateHeaderText(p[r.startTime]);break}}var c;if(!this.parent.hideEmptyAgendaDays||this.parent.agendaDaysCount>0&&s.length>0){if(this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive){var h=i;this.parent.activeViewOptions.group.byDate||(this.parent.activeViewOptions.allowVirtualScrolling=!1,h=a,this.parent.headerModule&&(this.parent.headerModule.updateDateRange(),this.parent.headerModule.updateHeaderItems("remove"))),this.calculateResourceTableElement(e,this.parent.agendaDaysCount,h,n)}else for(var d=0;d<this.parent.agendaDaysCount;d++){var u=this.createTableRowElement(i,"data"),g=this.element.querySelector('tr[data-row-index="'+ +u.dataset.rowIndex+'"]');if(g||!this.parent.activeViewOptions.showWeekend&&!this.isAgendaWorkDay(i)){if(i=O(i,1),!g&&this.parent.activeViewOptions.allowVirtualScrolling&&d--,i.getTime()>n.getTime())break}else{var v=u.children[0],m=u.children[1],f=this.appointmentFiltering(i);if(f.length>0||!this.parent.hideEmptyAgendaDays&&0===f.length){var y=this.parent.hideEmptyAgendaDays||0!==f.length?"data":"noEvents";v.appendChild(this.createDateHeaderElement(i)),u.appendChild(v),this.parent.trigger(ze,{elementType:"dateHeader",element:v,date:i});var T=this.createAgendaContentElement(y,f,m);u.appendChild(T),T.querySelectorAll("li").length>0&&e.appendChild(u);var w=this.parent.hideEmptyAgendaDays||0!==f.length?"agendaCells":"noEvents";this.parent.trigger(ze,{elementType:w,element:T,date:i})}else this.parent.activeViewOptions.allowVirtualScrolling&&d--;if(this.isCurrentDate(new Date(i.getTime()))&&t.addClass(v.childNodes,"e-current-day"),(i=O(i,1)).getTime()>n.getTime())break}}c=new Date(i.getTime()-Qe)}this.agendaDates={start:a,end:c}},i.prototype.isAgendaWorkDay=function(e){return this.parent.uiStateValues.isGroupAdaptive&&!this.parent.group.byDate?this.isWorkDay(e,this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex].workDays):this.isWorkDay(e)},i.prototype.agendaScrolling=function(e){this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(),this.parent.activeViewOptions.allowVirtualScrolling&&this.virtualScrolling(e),this.parent.activeViewOptions.allowVirtualScrolling||this.setPersistence()},i.prototype.virtualScrolling=function(e){var i,n=e.target,r=n.scrollTop,a=n.scrollHeight,s=r+n.clientHeight,o=this.virtualScrollTop<r?"next":"previous",l=n.querySelector("tbody"),p=t.createElement("tbody"),c=this.getElementFromScrollerPosition(e),h=this.parent.getDateFromElement(c);if(0===r){if(i=this.getPreviousNextDate(O(h,-1),o),this.appointmentFiltering(i.start,i.end).length>0||!this.parent.hideEmptyAgendaDays){this.renderContent(p,i.start,i.end),t.prepend([].slice.call(p.childNodes),l),this.wireEventActions();for(var d=0,u=l.children;d<u.length;d++)if(u[parseInt(d.toString(),10)].getAttribute("data-row-index")===c.getAttribute("data-column-index")){var g=u[parseInt(d.toString(),10)].offsetTop-this.element.querySelector(".e-agenda-item").offsetHeight;n.scrollTop=g;break}this.updateHeaderText(h)}}else s>=a-5?(i=this.getPreviousNextDate(O(h,1),o),(this.appointmentFiltering(i.start,i.end).length>0||!this.parent.hideEmptyAgendaDays)&&(this.renderContent(p,i.start,i.end),t.append([].slice.call(p.childNodes),l),this.wireEventActions(),this.updateHeaderText(h))):this.updateHeaderText(h);this.virtualScrollTop=r;var v=this.parent.eventBase.getSelectedAppointments();v.length>0&&v[v.length-1].focus()},i.prototype.getElementFromScrollerPosition=function(e){var i,n,r=e.target,a=r.scrollTop,s=r.scrollHeight,o=a+r.clientHeight,l=[].slice.call(r.querySelectorAll(".e-agenda-item"));if(l.length>0)if(0===a)n=l[0],i=t.closest(n,".e-agenda-cells");else if(o===s)n=l[l.length-1],i=t.closest(n,".e-agenda-cells");else for(var p=0,c=l.length;p<c;p++)if(n=l[parseInt(p.toString(),10)],n.getBoundingClientRect().top>=0){i=t.closest(n,".e-agenda-cells");break}return i},i.prototype.updateHeaderText=function(e){this.parent.showHeaderBar&&this.parent.headerModule.updateDateRange(e)},i.prototype.getPreviousNextDate=function(e,t){var i=new Date(e.getTime()),n=this.getStartDateFromEndDate(e),r=this.getEndDateFromStartDate(e),a=0;do{if((this.parent.activeViewOptions.showWeekend||!this.parent.activeViewOptions.showWeekend&&this.isAgendaWorkDay(i))&&(this.appointmentFiltering(i).length>0||!this.parent.hideEmptyAgendaDays)&&a++,(i=O(i,"next"===t?1:-1))<n||i>r)break}while(a!==this.parent.agendaDaysCount);var s=O(i,"next"===t?-1:1);return"next"===t?{start:e,end:O(s,1)}:{start:s,end:O(e,1)}},i.prototype.appointmentFiltering=function(e,i){var n,r,a=this;!t.isNullOrUndefined(e)&&t.isNullOrUndefined(i)?(n=b(new Date(e.getTime())),r=D(new Date(n.getTime()),Qe)):(n=new Date(e.getTime()),r=new Date(i.getTime()));var s=this.parent.eventBase.filterEvents(n,r);if(0===s.length&&(this.refreshEvent(e),s=this.parent.eventBase.filterEvents(n,r)),!t.isNullOrUndefined(this.parent.minDate)||!t.isNullOrUndefined(this.parent.maxDate)){var o=this.parent.eventFields;s=s.filter(function(e){var t=e[o.startTime],i=e[o.endTime];return!(t.getTime()<a.parent.minDate.getTime()||i.getTime()>O(a.parent.maxDate,1).getTime())})}return s},i.prototype.getStartDateFromEndDate=function(e){var t,i=this.parent.eventFields;if(this.parent.eventsProcessed.length>0){var n=Math.min.apply(Math,this.parent.eventsProcessed.map(function(e){return e[i.startTime].getTime()}));t=this.parent.hideEmptyAgendaDays?new Date(n):this.parent.minDate}else t=this.parent.hideEmptyAgendaDays?E(e,-1):this.parent.minDate;return b(t)},i.prototype.getEndDateFromStartDate=function(e){var t,i=this.parent.eventFields;if(this.parent.eventsProcessed.length>0){var n=Math.max.apply(Math,this.parent.eventsProcessed.map(function(e){return e[i.endTime].getTime()}));t=this.parent.hideEmptyAgendaDays?new Date(n):this.parent.maxDate}else t=this.parent.hideEmptyAgendaDays?E(e,1):this.parent.maxDate;return b(O(t,1))},i.prototype.getNextPreviousDate=function(e){var t="Next"===e?1:-1;return O(this.parent.selectedDate,t)},i.prototype.startDate=function(){return b(this.parent.selectedDate)},i.prototype.endDate=function(){return this.parent.activeViewOptions.allowVirtualScrolling?this.getEndDateFromStartDate(this.startDate()):O(this.startDate(),this.parent.agendaDaysCount)},i.prototype.getDateRangeText=function(e){var i=this.parent.activeViewOptions.dateFormat?this.parent.activeViewOptions.dateFormat:"MMMM y";if(this.parent.activeViewOptions.allowVirtualScrolling||this.parent.isAdaptive){var n=t.isNullOrUndefined(e)?this.parent.selectedDate:e;return U(this.parent.globalize.formatDate(n,{format:i,calendar:this.parent.getCalendarMode()}),"multiple")}var r=this.parent.selectedDate,a=O(r,this.parent.agendaDaysCount-1);return this.formatDateRange(r,a)},i.prototype.dayNavigationClick=function(e){var i=t.closest(e.currentTarget,".e-agenda-cells"),n=this.parent.getDateFromElement(i);t.isNullOrUndefined(n)||this.parent.isAdaptive||!this.parent.isMinMaxDate(n)||(this.parent.setProperties({selectedDate:n},!0),this.parent.changeView("Day",e))},i.prototype.wireEvents=function(){t.EventHandler.add(this.element.querySelector(".e-content-wrap"),"scroll",this.agendaScrolling,this)},i.prototype.unWireEvents=function(){t.EventHandler.remove(this.element.querySelector(".e-content-wrap"),"scroll",this.agendaScrolling);for(var e=0,i=[].slice.call(this.element.querySelectorAll(".e-m-date"));e<i.length;e++){var n=i[e];t.EventHandler.remove(n,"click",this.dayNavigationClick)}},i.prototype.addEventListener=function(){this.parent.on(Xe,this.onAgendaScrollUiUpdate,this),this.parent.on(_e,this.eventLoad,this)},i.prototype.removeEventListener=function(){this.parent&&(this.parent.off(Xe,this.onAgendaScrollUiUpdate),this.parent.off(_e,this.eventLoad))},i.prototype.onAgendaScrollUiUpdate=function(){var e=this.getHeaderBarHeight();this.parent.headerModule&&(this.parent.activeViewOptions.allowVirtualScrolling?this.parent.headerModule.updateHeaderItems("add"):this.parent.headerModule.updateHeaderItems("remove"));var i=this.element.querySelector(".e-content-wrap");"auto"!==this.parent.height&&(i.style.height=t.formatUnit(this.parent.element.offsetHeight-e))},i.prototype.scrollToDate=function(e){var t=new Date(+b(e));if(this.parent.activeViewOptions.allowVirtualScrolling)(!this.parent.hideEmptyAgendaDays||this.parent.getEvents(t,O(t,1),!0).length>0)&&this.parent.changeDate(t);else{var i=this.element.querySelector('.e-agenda-cells[data-date="'+t.getTime()+'"]');i&&(this.getContentAreaElement().scrollTop=i.offsetTop)}},i.prototype.destroy=function(){if(!this.parent||this.parent&&this.parent.isDestroyed)return void(this.parent=null);this.element&&(this.unWireEvents(),this.parent.resourceBase&&this.parent.resourceBase.destroy(),this.parent.headerModule&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.headerModule.updateHeaderItems("remove"),e.prototype.destroy.call(this))},i}(wn),Cn=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Sn=function(e){function i(t){var i=e.call(this,t)||this;return i.dayNameFormat="narrow",i.viewClass="e-month-agenda-view",i.monthAgendaDate=new Date(""+t.selectedDate),i}return Cn(i,e),i.prototype.getModuleName=function(){return"monthAgenda"},i.prototype.renderAppointmentContainer=function(){var e=this.getContentAreaElement(),i=t.createElement("div",{className:"e-wrapper-container"});e.appendChild(i);var n=t.createElement("div",{className:"e-appointment-wrap"});i.appendChild(n),this.appendAppContainer(n),this.setEventWrapperHeight()},i.prototype.getDayNameFormat=function(){return this.parent.isAdaptive?"narrow":"abbreviated"},i.prototype.updateSelectedCellClass=function(e){b(e.date).getTime()===b(new Date(""+this.parent.selectedDate)).getTime()&&e.className.push("e-selected-cell")},i.prototype.setEventWrapperHeight=function(){var e=(this.parent.headerModule?this.parent.headerModule.getHeaderElement().offsetHeight:0)+2,i=this.parent.element.querySelector(".e-schedule-resource-toolbar");i&&(e+=i.offsetHeight);var n=this.getContentAreaElement().firstElementChild,r=this.element.querySelector(".e-date-header-wrap"),a=this.parent.element.offsetHeight-e-r.offsetHeight,s=this.parent.activeViewOptions.interval>1?Math.round(.8*a):n.offsetHeight,o=a-s,l=this.element.querySelector(".e-wrapper-container"),p=this.element.querySelector(".e-appointment-wrap");"auto"!==this.parent.height&&(this.parent.activeViewOptions.interval>1&&(n.style.height=t.formatUnit(s),t.EventHandler.add(n,"scroll",this.onContentScroll,this)),l.style.height=p.style.height=t.formatUnit(o))},i.prototype.onDataReady=function(e){this.setEventWrapperHeight(),this.clearElements();var i=e.processedData;if(this.parent.uiStateValues.isGroupAdaptive){var n=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex];i=this.parent.eventBase.filterEventsByResource(n,i)}this.agendaBase=this.getAgendaBase(),this.parent.eventsProcessed=this.agendaBase.processAgendaEvents(i);for(var r=0,a=0,s=this.renderDates;a<s.length;a++){var o=s[a],l=this.appointmentFiltering(o),p=this.element.querySelectorAll(".e-work-cells")[parseInt(r.toString(),10)];l.length>0&&(p.querySelector(".e-appointment-indicator")||p.appendChild(t.createElement("div",{className:"e-appointment-indicator"})),o.getTime()===b(new Date(this.monthAgendaDate.getTime())).getTime()&&this.onEventRender(l,o)),r++}this.parent.notify("events-loaded",{})},i.prototype.onCellClick=function(e){this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide();var t=this.appointmentFiltering(e.startTime);this.onEventRender(t,e.startTime),this.parent.notify("events-loaded",{}),this.monthAgendaDate=new Date(""+e.startTime),this.parent.setProperties({selectedDate:this.monthAgendaDate},!0)},i.prototype.onEventRender=function(e,i){this.agendaBase=this.getAgendaBase();var n=this.element.querySelector(".e-appointment-wrap");if(j(n),0===this.parent.activeViewOptions.group.resources.length||this.parent.uiStateValues.isGroupAdaptive)if(e.length>0){var r=t.createElement("div",{className:at});n.appendChild(this.agendaBase.createAgendaContentElement("data",e,r))}else this.appendAppContainer(n);else if(e.length>0){var a=this.createTableLayout(),s=a.querySelector("tbody");this.agendaBase.calculateResourceTableElement(s,1,i),a.appendChild(s),n.appendChild(a)}else this.appendAppContainer(n);this.agendaBase.wireEventActions()},i.prototype.appointmentFiltering=function(e){var t=b(new Date(e.getTime())),i=D(new Date(t.getTime()),Qe);return this.parent.eventBase.filterEvents(t,i)},i.prototype.clearElements=function(){for(var e=0,i=[].slice.call(this.element.querySelectorAll(".e-appointment-indicator"));e<i.length;e++){var n=i[e];t.remove(n)}this.appendAppContainer(this.element.querySelector(".e-appointment-wrap"))},i.prototype.appendAppContainer=function(e){var i=t.createElement("div",{className:at});t.addClass([i],"e-no-event"),i.innerHTML=this.parent.localeObj.getConstant("noEvents"),j(e),e.appendChild(i)},i.prototype.getNextPreviousDate=function(e){var t=this.parent.selectedDate,i="Next"===e?this.parent.activeViewOptions.interval:-this.parent.activeViewOptions.interval,n=E(this.parent.selectedDate,i),r="Next"===e?2:0,a=new Date(t.getFullYear(),t.getMonth()+r,0).getDate(),s=a>=this.monthAgendaDate.getDate()?this.monthAgendaDate.getDate():a;return this.monthAgendaDate=new Date(n.getFullYear(),n.getMonth(),s),this.monthAgendaDate},i.prototype.getAgendaBase=function(){return this.agendaBase||new wn(this.parent)},i.prototype.destroy=function(){this.agendaBase&&(this.agendaBase.destroy(),this.agendaBase=null),e.prototype.destroy.call(this)},i}(mn),On=function(){function e(e,t){this.parent=e,this.renderDates=t}return e.prototype.groupByYear=function(e){for(var t={},i=0,n=e;i<n.length;i++){var r=n[i],a=r.getFullYear();t[parseInt(a.toString(),10)]=t[parseInt(a.toString(),10)]||[],t[parseInt(a.toString(),10)].push(r)}return t},e.prototype.groupByMonth=function(e){for(var t={},i=0,n=e;i<n.length;i++){var r=n[i],a=12*(r.getFullYear()-1970)+r.getMonth();t[parseInt(a.toString(),10)]=t[parseInt(a.toString(),10)]||[],t[parseInt(a.toString(),10)].push(r)}return t},e.prototype.groupByWeek=function(e){for(var t={},i=0,n=e;i<n.length;i++){var r=n[i],a=+new Date(1970,0,1),s=r.getTimezoneOffset()-new Date(1970,0,1).getTimezoneOffset(),o=Math.ceil(((+r-a-60*s*1e3)/Qe+new Date(a).getDay()+1)/7);this.parent.activeViewOptions.firstDayOfWeek&&this.parent.activeViewOptions.firstDayOfWeek>new Date(+r).getDay()&&(o-=1),t[parseInt(o.toString(),10)]=t[parseInt(o.toString(),10)]||[],t[parseInt(o.toString(),10)].push(r)}return t},e.prototype.generateSlots=function(e,i,n,r,a){for(var s=this,o=function(e,t){return s.parent.globalize.formatDate(e,{format:t,calendar:s.parent.getCalendarMode()})},l=[],p=Object.keys(e),c=0;c<p.length;c++){var h=e[p[parseInt(c.toString(),10)]],d=void 0;if(n.template){var u={date:h[0],type:a},g=this.parent.element.id+"_headerRowTemplate";d=[].slice.call(this.parent.templateParser(n.template)(u,this.parent,"template",g,!1))}else{var v=void 0;switch(n.option){case"Year":v='<span class="e-header-year">'+o(h[0],"y")+"</span>";break;case"Month":v='<span class="e-header-month">'+U(o(h[0],"MMMM"),"single")+"</span>";break;case"Week":v='<span class="e-header-week">'+this.parent.getWeekNumberContent(h)+"</span>"}var m=t.createElement("div",{innerHTML:v});d=[].slice.call(m.childNodes)}l.push({date:h[0],type:a,className:[r],colSpan:h.length*i,template:d})}return l},e.prototype.generateColumnLevels=function(e,t){var i=[],n=this.parent.activeViewOptions.headerRows,r=1;"Hour"===n[n.length-1].option&&t.length>0&&(r=t.length/e.length);for(var a,s,o,l=[],p=0,c=n;p<c.length;p++){var h=c[p];switch(h.option){case"Year":a=this.groupByYear(this.renderDates),l=this.generateSlots(a,r,h,"e-header-year-cell","yearHeader"),i.push(l);break;case"Month":s=this.groupByMonth(this.renderDates),l=this.generateSlots(s,r,h,"e-header-month-cell","monthHeader"),i.push(l);break;case"Week":o=this.groupByWeek(this.renderDates),l=this.generateSlots(o,r,h,"e-header-week-cell","weekHeader"),i.push(l);break;case"Date":l=(l=e).map(function(e){return e.colSpan=r,e}),i.push(l);break;case"Hour":t.length>0&&i.push(t)}}return i},e}(),En=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),xn=function(e){function i(t){var i=e.call(this,t)||this;return i.timelineAppointment=null,i.baseCssClass="e-timeline-view",i}return En(i,e),i.prototype.getModuleName=function(){return"timelineViews"},i.prototype.getLeftPanelElement=function(){return this.element.querySelector(".e-resource-column-wrap")},i.prototype.scrollTopPanel=function(t){e.prototype.scrollTopPanel.call(this,t),this.scrollHeaderLabels(t)},i.prototype.scrollToWorkHour=function(){var e=this.parent.getStartEndTime(this.parent.workHours.start),i=this.isWorkDay(this.parent.selectedDate)&&this.parent.workHours.highlight&&!t.isNullOrUndefined(e)?new Date(+this.parent.selectedDate).setHours(e.getHours(),e.getMinutes(),0,0):new Date(+this.parent.selectedDate).setHours(0,0,0,0),n='[data-date="'+new Date(i).getTime().toString()+'"]',r=this.element.querySelector(n);r&&(this.getContentAreaElement().scrollLeft=this.parent.enableRtl?-(this.parent.getContentTable().offsetWidth-r.offsetLeft-r.offsetWidth):r.offsetLeft)},i.prototype.scrollToHour=function(e,i){var n,r;if(i&&(r=this.parent.getIndexOfDate(this.renderDates,b(i)))>=0&&(n=i,!t.isNullOrUndefined(e))){var a=e.split(":");2===a.length&&(n=new Date(i.setHours(parseInt(a[0],10),parseInt(a[1],10),0)))}if(n=t.isNullOrUndefined(i)?this.parent.getStartEndTime(e):n,!t.isNullOrUndefined(n)){var s;s=t.isNullOrUndefined(e)||!this.parent.activeViewOptions.timeScale.enable?r*this.parent.getElementWidth(this.element.querySelector(".e-work-cells")):t.isNullOrUndefined(i)?this.getLeftFromDateTime(null,n):this.getLeftFromDateTime([r],n),this.getScrollableElement().scrollLeft=this.parent.enableRtl?-s:s}},i.prototype.generateColumnLevels=function(){var e=[],t=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays);e.push(t),this.parent.activeViewOptions.group.resources.length>0&&this.parent.resourceBase.generateResourceLevels(t,!this.parent.uiStateValues.isGroupAdaptive);var i=[];return this.parent.activeViewOptions.timeScale.enable&&(i=this.generateTimeSlots(e[e.length-1]),e.push(i)),this.parent.activeViewOptions.headerRows.length>0&&(e=new On(this.parent,this.renderDates).generateColumnLevels(t,i)),e},i.prototype.generateTimeSlots=function(e){for(var i=this,n=function(e){return e.type=e.first?"majorSlot":"minorSlot",e.className=e.first?["e-time-slots"]:["e-time-slots","e-time-cells"],e.workDays=i.parent.activeViewOptions.workDays,e},r=this.getTimeSlotRows(n),a=[],s=0,o=e;s<o.length;s++){var l=o[s];l.colSpan=r.length;for(var p=0,c=t.extend([],r,null,!0);p<c.length;p++){var h=c[p],d=b(new Date(""+l.date));h.date=D(d,C(h.date)),a.push(h)}}return a},i.prototype.changeCurrentTimePosition=function(){if(!(!this.parent||this.parent&&this.parent.isDestroyed)){this.removeCurrentTimeIndicatorElements();var e=this.getCurrentTimeIndicatorIndex(),i=this.getLeftFromDateTime(e,this.parent.getCurrentTime()),n=this.element.querySelector("."+nt).offsetHeight,r=this.element.querySelector(".e-date-header-wrap");if(this.element.querySelector(".e-content-wrap").appendChild(t.createElement("div",{className:"e-current-timeline",styles:(this.parent.enableRtl?"right":"left")+":"+t.formatUnit(i)+"; height:"+t.formatUnit(n)})),this.parent.virtualScrollModule){var a=this.parent.element.querySelector(".e-current-timeline"),s=this.parent.element.querySelector(".e-content-wrap table");t.setStyleAttribute(a,{transform:s.style.transform})}var o=t.createElement("div",{innerHTML:this.parent.getTimeString(this.parent.getCurrentTime()),className:"e-current-time"});r.appendChild(o),o.style[this.parent.enableRtl?"right":"left"]=t.formatUnit(i-o.offsetWidth/2)}},i.prototype.getLeftFromDateTime=function(e,i){var n=this.getStartHour(),r=this.getEndHour(),a=0,s=60*(i.getHours()-n.getHours())+(i.getMinutes()-n.getMinutes()),o=V(b(new Date(i.getTime())),n,r),l=(o.endHour.getTime()-o.startHour.getTime())/Ke,p=this.parent.activeViewOptions.timeScale.interval,c=0;if(c=0===n.getHours()&&0===n.getMinutes()&&0===r.getHours()&&0===r.getMinutes()?p:1!==this.parent.activeViewOptions.timeScale.slotCount?p:p>l?l:p,!t.isNullOrUndefined(e)&&0!==e[0]){var h=this.parent.activeView.colLevels.findIndex(function(e){return"dateHeader"===e[0].type});if(this.parent.activeView.colLevels[parseInt(h.toString(),10)]&&this.parent.activeView.colLevels[parseInt(h.toString(),10)][0].colSpan)a=e[0]*this.parent.activeView.colLevels[parseInt(h.toString(),10)][0].colSpan*this.parent.getElementWidth(this.element.querySelector(".e-work-cells"));else{var d=this.getEndHour(),u=0===d.getHours()?24:d.getHours();s+=e[0]*(60*(u-n.getHours())+(d.getMinutes()-n.getMinutes()))}}return a+s*this.parent.getElementWidth(this.element.querySelector(".e-work-cells"))*this.parent.activeViewOptions.timeScale.slotCount/c},i.prototype.renderHeader=function(){var e=t.createElement("tr");this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.renderResourceHeaderIndent(e);var i=t.createElement("td");i.appendChild(this.renderDatesHeader()),e.appendChild(i),t.prepend([e],this.element.querySelector("tbody"))},i.prototype.createAllDayRow=function(e,t){},i.prototype.getCurrentTimeIndicatorIndex=function(){var e=[],t=this.parent.getIndexOfDate(this.renderDates,b(this.parent.getCurrentTime()));return t>=0&&e.push(t),e},i.prototype.renderContent=function(){var e=t.createElement("tr");if(this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive){var i=t.createElement("td");i.appendChild(this.parent.resourceBase.createResourceColumn()),e.appendChild(i)}var n=t.createElement("td"),r=this.renderContentArea();r.appendChild(this.createEventTable(this.getRowCount())),this.collapseRows(r),n.appendChild(r),e.appendChild(n),this.parent.virtualScrollModule&&this.parent.virtualScrollModule.renderVirtualTrack(r),this.element.querySelector("tbody").appendChild(e)},i.prototype.getRowCount=function(){return this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive?this.parent.resourceBase.renderedResources.length:1},i.prototype.getResourceTdData=function(e,t){var i=this.parent.resourceBase.renderedResources[parseInt(e.toString(),10)],n=i.resourceData[i.resource.startHourField]||this.parent.workHours.start,r=i.resourceData[i.resource.endHourField]||this.parent.workHours.end;return t.startHour=this.parent.getStartEndTime(n),t.endHour=this.parent.getStartEndTime(r),t.workDays=i.resourceData[i.resource.workDaysField]||this.parent.workDays,t.className=i.className,t.groupIndex=i.groupIndex,t.groupOrder=i.groupOrder,t},i.prototype.renderContentTable=function(e){var i=e.querySelector("tbody");t.append(this.getContentRows(),i)},i.prototype.getContentRows=function(){for(var e=[],i=t.createElement("tr"),n=t.createElement("td"),r=this.getRowCount(),a=this.getGroupIndices(),s=0;s<r;s++)if(!(a.length>0&&a.indexOf(this.parent.resourceBase.renderedResources[parseInt(s.toString(),10)].groupIndex)>-1)){for(var o=i.cloneNode(),l=0,p=this.colLevels[this.colLevels.length-1];l<p.length;l++){var c=p[l];this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(c=this.getResourceTdData(s,c));var h=this.createContentTd(c,c,n);o.appendChild(h)}e.push(o)}return e},i.prototype.getContentTdClass=function(e){return e.first||!this.parent.activeViewOptions.timeScale.enable?["e-work-cells"]:["e-work-cells","e-alternate-cells"]},i.prototype.renderEvents=function(){this.timelineAppointment=new zt(this.parent,this.parent.activeViewOptions.timeScale.enable?"hour":"day"),this.timelineAppointment.renderAppointments(),this.parent.notify("events-loaded",{})},i.prototype.getAdjustedDate=function(e){if(!this.parent.activeViewOptions.timeScale.enable)return new Date(e.setHours(0,0,0,0));for(var t=this.colLevels[this.colLevels.length-1],i=0;i<t.length;i++)if(t[parseInt(i.toString(),10)].date.getTime()>e.getTime())return t[i-1].date;return null},i.prototype.destroy=function(){if(!this.parent||this.parent&&this.parent.isDestroyed)return void(this.parent=null);this.timelineAppointment&&(this.timelineAppointment.destroy(),this.timelineAppointment=null),e.prototype.destroy.call(this)},i}(ln),Vn=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),An=function(e){function i(t){var i=e.call(this,t)||this;return i.viewClass="e-timeline-month-view",i.isInverseTableSelect=!0,i.appointment=null,i}return Vn(i,e),i.prototype.getModuleName=function(){return"timelineMonth"},i.prototype.onDataReady=function(){this.appointment=new zt(this.parent,"day"),this.appointment.renderAppointments(),this.parent.notify("events-loaded",{})},i.prototype.getLeftPanelElement=function(){return this.element.querySelector(".e-resource-column-wrap")},i.prototype.scrollTopPanel=function(t){e.prototype.scrollTopPanel.call(this,t),this.scrollHeaderLabels(t)},i.prototype.setContentHeight=function(e,i,n){i&&(i.style.height=t.formatUnit(n-this.getScrollXIndent(e))),e.style.height=t.formatUnit(n)},i.prototype.getDateSlots=function(e,t){for(var i=[],n=0,r=e;n<r.length;n++){var a=r[n],s=["e-header-cells"];this.isCurrentDate(a)&&s.push("e-current-day"),i.push({date:a,type:"dateHeader",className:s,colSpan:1,workDays:t})}return i},i.prototype.renderLeftIndent=function(e){this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.renderResourceHeaderIndent(e)},i.prototype.renderContent=function(){var e=t.createElement("tr");if(this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive){var i=t.createElement("td");i.appendChild(this.parent.resourceBase.createResourceColumn()),e.appendChild(i)}var n=t.createElement("td");this.element.querySelector("tbody").appendChild(e);var r=t.createElement("div",{className:"e-content-wrap"});r.appendChild(this.renderContentArea()),r.appendChild(this.createEventTable(this.getRowCount())),this.collapseRows(r),t.EventHandler.add(r,"scroll",this.onContentScroll,this),n.appendChild(r),this.parent.virtualScrollModule&&this.parent.virtualScrollModule.renderVirtualTrack(r),e.appendChild(n)},i.prototype.getRowCount=function(){return this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive?this.parent.resourceBase.renderedResources.length:1},i.prototype.getContentSlots=function(){for(var e=[],t=0;t<this.getRowCount();t++)for(var i=0,n=this.colLevels[this.colLevels.length-1];i<n.length;i++){var r=n[i];if(r.className=["e-work-cells"],this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive){var a=this.parent.resourceBase.renderedResources[parseInt(t.toString(),10)];r.workDays=a.resourceData[a.resource.workDaysField]||this.parent.workDays,r.className=r.className.concat(a.className),r.groupIndex=a.groupIndex,r.groupOrder=a.groupOrder}var s={date:new Date(+r.date),colSpan:r.colSpan,groupIndex:r.groupIndex,workDays:r.workDays,type:"monthCells",className:r.className};e[parseInt(t.toString(),10)]||(e[parseInt(t.toString(),10)]=[]),e[parseInt(t.toString(),10)].push(s)}return e},i.prototype.updateClassList=function(e){this.parent.isMinMaxDate(e.date)||e.className.push(pt)},i.prototype.unWireEvents=function(){t.EventHandler.remove(this.getContentAreaElement(),"scroll",this.onContentScroll)},i.prototype.getMonthStart=function(e){var t=this.parent.calendarUtil.firstDateOfMonth(b(e));return new Date(t.getFullYear(),t.getMonth(),t.getDate())},i.prototype.getMonthEnd=function(e){var t=this.parent.calendarUtil.firstDateOfMonth(b(e));return this.parent.calendarUtil.lastDateOfMonth(E(new Date(+t),this.parent.activeViewOptions.interval-1))},i.prototype.generateColumnLevels=function(){var e=[],t=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays);e.push(t),this.parent.activeViewOptions.group.resources.length>0&&this.parent.resourceBase.generateResourceLevels(t,!this.parent.uiStateValues.isGroupAdaptive);var i=[];return this.parent.activeViewOptions.headerRows.length>0&&(e=new On(this.parent,this.renderDates).generateColumnLevels(t,i)),this.colLevels=e,e},i.prototype.getAdjustedDate=function(e){for(var t=this.colLevels[this.colLevels.length-1],i=0;i<t.length;i++)if(t[parseInt(i.toString(),10)].date.getTime()>e.getTime())return t[i-1].date;return null},i.prototype.destroy=function(){if(!this.parent||this.parent&&this.parent.isDestroyed)return void(this.parent=null);if(this.element){var i=this.element.querySelector(".e-content-wrap");i&&t.EventHandler.remove(i,"scroll",this.onContentScroll)}this.appointment&&(this.appointment.destroy(),this.appointment=null),e.prototype.destroy.call(this)},i}(mn),In=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),kn=function(e){function i(t){var i=e.call(this,t)||this;return i.viewClass="e-timeline-year-view",i.isInverseTableSelect=!0,i}return In(i,e),i.prototype.getModuleName=function(){return"timelineYear"},i.prototype.renderHeader=function(e){var i=t.createElement("tr");if(e.appendChild(i),"Vertical"===this.parent.activeViewOptions.orientation&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive)this.parent.resourceBase.renderResourceHeaderIndent(i);else{var n=t.createElement("td",{className:"e-left-indent"});i.appendChild(n),n.appendChild(this.renderResourceHeader("e-left-indent-wrap"))}var r="Horizontal"===this.parent.activeViewOptions.orientation,a=this.parent.activeViewOptions.group.resources.length>0;this.isInverseTableSelect=!(r&&!a);var s=t.createElement("td");i.appendChild(s);var o=t.createElement("div",{className:"e-date-header-container"});if(s.appendChild(o),"Horizontal"===this.parent.activeViewOptions.orientation&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive)o.appendChild(this.renderResourceHeader("e-date-header-wrap")),this.columnCount=this.colLevels.slice(-1)[0].length;else{var l=t.createElement("div",{className:"e-date-header-wrap"});o.appendChild(l);var p=this.createTableLayout();l.appendChild(p),p.appendChild(this.createTableColGroup(this.columnCount));var c=t.createElement("tr");p.querySelector("tbody").appendChild(c);for(var h=this.getMonths(),d=this.getMonthDates(new Date(this.parent.selectedDate.getFullYear(),h[0],1)),u=0;u<this.columnCount;u++){var g=new Date(this.parent.selectedDate.getFullYear(),h[parseInt(u.toString(),10)],1),v=t.createElement("td",{className:"e-header-cells"});"Horizontal"===this.parent.activeViewOptions.orientation?this.parent.dayHeaderTemplate?t.append(this.renderDayMonthHeaderTemplate(d[parseInt(u.toString(),10)],u,"dayHeaderTemplate"),v):v.innerHTML="<span>"+this.parent.getDayNames("abbreviated")[u%7]+"</span>":(this.parent.monthHeaderTemplate?t.append(this.renderDayMonthHeaderTemplate(g,h[parseInt(u.toString(),10)],"monthHeaderTemplate"),v):v.innerHTML="<span>"+this.getMonthName(g)+"</span>",v.setAttribute("data-date",g.getTime().toString())),c.appendChild(v),this.parent.trigger(ze,{elementType:"headerCells",element:v})}}},i.prototype.renderResourceHeader=function(e){var i=t.createElement("div",{className:e}),n=this.createTableLayout();i.appendChild(n);var r=t.createElement("tr");if(this.parent.activeViewOptions.group.resources.length>0)this.colLevels=this.generateColumnLevels();else{var a=[{className:["e-header-cells"],type:"headerCell"}];this.colLevels=[a]}for(var s=0,o=this.colLevels;s<o.length;s++){for(var l=o[s],p=r.cloneNode(),c=0,h="e-date-header-wrap"===e?l:[l[0]];c<h.length;c++){var d=h[c],u=t.createElement("td");d.className&&t.addClass([u],d.className),"e-date-header-wrap"===e&&(d.template&&t.append(d.template,u),d.colSpan&&u.setAttribute("colspan",d.colSpan.toString()),d.groupIndex>-1&&u.setAttribute("data-group-index",d.groupIndex.toString()),this.setResourceHeaderContent(u,d)),"e-left-indent-wrap"===e&&this.parent.renderHeaderIndentTemplate(d,u);var g={elementType:d.type,element:u,date:d.date,groupIndex:d.groupIndex};this.parent.trigger(ze,g),p.appendChild(u)}n.querySelector("tbody").appendChild(p)}return"e-date-header-wrap"===e&&n.appendChild(this.createTableColGroup(this.colLevels.slice(-1)[0].length)),i},i.prototype.renderContent=function(e){var i=t.createElement("tr");e.appendChild(i);var n,r=t.createElement("td"),a=t.createElement("td"),s=[];if("Vertical"===this.parent.activeViewOptions.orientation&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive)s.push(r),r.appendChild(this.parent.resourceBase.createResourceColumn()),this.rowCount=this.parent.resourceBase.renderedResources.length;else{s.push(r);var o=t.createElement("div",{className:"e-month-header-wrapper"});r.appendChild(o),o.appendChild(this.createTableLayout()),n=o.querySelector("tbody")}s.push(a),t.append(s,i);var l=t.createElement("div",{className:"e-content-wrap"});a.appendChild(l);var p=this.createTableLayout(nt);this.setAriaAttributes(p),l.appendChild(p);var c=t.createElement("div",{className:"e-event-table"});l.appendChild(c),this.parent.virtualScrollModule&&this.parent.virtualScrollModule.renderVirtualTrack(l);var h=p.querySelector("tbody");if(this.parent.rowAutoHeight){var d=[p],u=this.parent.element.querySelector(".e-month-header-wrapper ."+it);u&&d.push(u),t.addClass(d,"e-auto-height")}if(this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive){var g="Horizontal"===this.parent.activeViewOptions.orientation?this.colLevels.slice(-1)[0].length:this.columnCount;p.appendChild(this.createTableColGroup(g)),this.renderResourceContent(c,n,h)}else p.appendChild(this.createTableColGroup(this.columnCount)),this.renderDefaultContent(c,n,h)},i.prototype.renderDefaultContent=function(e,i,n){for(var r=this.getMonths(),a=this.getMonthDates(new Date(this.parent.selectedDate.getFullYear(),r[0],1)),s=0;s<this.rowCount;s++){e.appendChild(t.createElement("div",{className:at}));var o=new Date(this.parent.selectedDate.getFullYear(),r[parseInt(s.toString(),10)],1),l=this.parent.calendarUtil.getMonthStartDate(new Date(o.getTime())),p=this.parent.calendarUtil.getMonthEndDate(new Date(o.getTime())),c=t.createElement("tr"),h=c.cloneNode();i.appendChild(h);var d=c.cloneNode();n.appendChild(d);var u=t.createElement("td",{className:"e-month-header"});"Horizontal"===this.parent.activeViewOptions.orientation?(this.parent.monthHeaderTemplate?t.append(this.renderDayMonthHeaderTemplate(l,s,"monthHeaderTemplate"),u):u.innerHTML="<span>"+this.getMonthName(o)+"</span>",u.setAttribute("data-date",o.getTime().toString())):this.parent.dayHeaderTemplate?t.append(this.renderDayMonthHeaderTemplate(a[parseInt(s.toString(),10)],s,"dayHeaderTemplate"),u):u.innerHTML="<span>"+this.parent.getDayNames("abbreviated")[s%7]+"</span>",h.appendChild(u),this.parent.trigger(ze,{elementType:"leftHeaderCells",element:u});for(var g=new Date(l.getTime()),v=0;v<this.columnCount;v++){var m=void 0;if("Vertical"===this.parent.activeViewOptions.orientation){o=new Date(this.parent.selectedDate.getFullYear(),r[parseInt(v.toString(),10)],1),l=this.parent.calendarUtil.getMonthStartDate(new Date(o.getTime())),p=this.parent.calendarUtil.getMonthEndDate(new Date(o.getTime()));var f=s-l.getDay()+1;g=new Date(this.parent.selectedDate.getFullYear(),r[parseInt(v.toString(),10)],f),m=f>0&&g.getTime()<p.getTime()}else m=v>=l.getDay()&&g.getTime()<p.getTime();var y=this.parent.globalize.formatDate(g,{skeleton:"full",calendar:this.parent.getCalendarMode()}),T=t.createElement("td",{className:"e-work-cells",attrs:{"aria-label":y}});d.appendChild(T);var w=t.createElement("div",{className:"e-date-header e-navigate",innerHTML:m?this.parent.globalize.formatDate(g,{skeleton:"d",calendar:this.parent.getCalendarMode()}):""});if(m){var D=[T],b=[];this.parent.activeViewOptions.workDays.indexOf(g.getDay())>-1&&b.push("e-work-days"),this.parent.isMinMaxDate(g)||t.addClass([T],pt),this.isCurrentDate(g)&&(b.push("e-current-day"),"Horizontal"===this.parent.activeViewOptions.orientation?D.push(this.element.querySelector(".e-header-cells:nth-child("+(v+1)+")")):D.push(this.element.querySelectorAll(".e-month-header").item(s))),b.length>0&&t.addClass(D,b)}else t.addClass([T],"e-other-month"),this.parent.isMinMaxDate(g)||t.addClass([T],pt);T.classList.contains("e-other-month")||(this.renderDates.push(new Date(g)),T.appendChild(w),m&&(T.setAttribute("data-date",g.getTime().toString()),this.wireEvents(T)),this.renderCellTemplate({date:g,type:"workCells"},T),this.parent.trigger(ze,{elementType:"workCells",element:T,date:g}),m&&"Horizontal"===this.parent.activeViewOptions.orientation&&(g=O(new Date(g.getTime()),1)))}}this.renderDates.splice(0,1)},i.prototype.getContentRows=function(){for(var e=[],i=this.getMonths(),n=this.getGroupIndices(),r=0;r<this.parent.resourceBase.renderedResources.length;r++){var a=void 0;if(!(this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(a=this.parent.resourceBase.renderedResources[parseInt(r.toString(),10)],n.length>0&&n.indexOf(a.groupIndex)>-1))){var s=t.createElement("tr");e.push(s);for(var o=new Date(this.parent.selectedDate.getFullYear(),i[parseInt(r.toString(),10)],1),l=this.parent.calendarUtil.getMonthStartDate(new Date(o.getTime())),p=0;p<this.columnCount;p++){var c=[],h=a.groupIndex;(c=c.concat(a.className)).indexOf("e-parent-node")>-1?c.push("e-resource-group-cells"):c.push("e-work-days"),o=new Date(this.parent.selectedDate.getFullYear(),i[parseInt(p.toString(),10)],1),l=this.parent.calendarUtil.getMonthStartDate(new Date(o.getTime()));var d=t.createElement("td",{className:"e-work-cells",attrs:{"aria-selected":"false","data-date":l.getTime().toString()}});t.addClass([d],c),d.setAttribute("data-group-index",h.toString()),this.renderCellTemplate({date:l,type:"resourceGroupCells",groupIndex:h},d),this.wireEvents(d),this.parent.trigger(ze,{elementType:"resourceGroupCells",element:d,date:l}),s.appendChild(d)}}}return e},i.prototype.renderResourceContent=function(e,i,n){for(var r=this.getMonths(),a=0;a<this.rowCount;a++){e.appendChild(t.createElement("div",{className:at}));var s=t.createElement("tr");n.appendChild(s);var o=void 0;"Vertical"===this.parent.activeViewOptions.orientation&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(o=this.parent.resourceBase.renderedResources[parseInt(a.toString(),10)]);var l=new Date(this.parent.selectedDate.getFullYear(),r[parseInt(a.toString(),10)],1),p=this.parent.calendarUtil.getMonthStartDate(new Date(l.getTime()));if("Horizontal"===this.parent.activeViewOptions.orientation){var c=s.cloneNode();i.appendChild(c);var h=t.createElement("td",{className:"e-month-header",attrs:{"data-date":p.getTime().toString()}});this.parent.monthHeaderTemplate?t.append(this.renderDayMonthHeaderTemplate(l,a,"monthHeaderTemplate"),h):h.innerHTML="<span>"+this.getMonthName(l)+"</span>",c.appendChild(h)}for(var d=0;d<this.columnCount;d++){var u=[],g=void 0;"Vertical"===this.parent.activeViewOptions.orientation?(g=o.groupIndex,(u=u.concat(o.className)).indexOf("e-parent-node")>-1?u.push("e-resource-group-cells"):u.push("e-work-days"),l=new Date(this.parent.selectedDate.getFullYear(),r[parseInt(d.toString(),10)],1),p=this.parent.calendarUtil.getMonthStartDate(new Date(l.getTime()))):(g=this.colLevels.slice(-1)[0][parseInt(d.toString(),10)].groupIndex,u.push("e-work-days"));var v=this.parent.globalize.formatDate(p,{type:"dateTime",skeleton:"full",calendar:this.parent.getCalendarMode()}),m=this.parent.globalize.formatDate(this.parent.calendarUtil.getMonthEndDate(new Date(l.getTime())),{type:"dateTime",skeleton:"full",calendar:this.parent.getCalendarMode()}),f=t.createElement("td",{className:"e-work-cells",attrs:{"aria-selected":"false","data-date":p.getTime().toString(),"aria-label":v+" "+this.parent.localeObj.getConstant("endAt")+" "+m}});t.addClass([f],u),f.setAttribute("data-group-index",g.toString()),this.renderCellTemplate({date:p,type:"resourceGroupCells",groupIndex:g},f),this.wireEvents(f),s.appendChild(f),this.parent.trigger(ze,{elementType:"resourceGroupCells",element:f,date:p})}}"Vertical"===this.parent.activeViewOptions.orientation&&this.collapseRows(this.parent.element.querySelector(".e-content-wrap"))},i.prototype.renderDayMonthHeaderTemplate=function(e,t,i){var n={date:e,type:"dayHeaderTemplate"===i?"dayHeader":"monthHeader"},r="schedule_"+this.parent.activeViewOptions.dayHeaderTemplateName+"dayHeaderTemplate",a="schedule_"+this.parent.activeViewOptions.dayHeaderTemplateName+"monthHeaderTemplate";return"dayHeaderTemplate"===i?(n.day=this.parent.getDayNames("wide")[t%7],[].slice.call(this.parent.getDayHeaderTemplate()(n,this.parent,"dayHeaderTemplate",r,!1,void 0,void 0,this.parent.root))):[].slice.call(this.parent.getMonthHeaderTemplate()(n,this.parent,"monthHeaderTemplate",a,!1,void 0,void 0,this.parent.root))},i.prototype.renderCellTemplate=function(e,i){if(this.parent.activeViewOptions.cellTemplate&&!i.classList.contains("e-other-month")){var n={date:e.date,type:e.type};e.groupIndex&&(n.groupIndex=e.groupIndex);var r=this.parent.element.id+"_"+this.parent.activeViewOptions.cellTemplateName+"cellTemplate",a=[].slice.call(this.parent.getCellTemplate()(n,this.parent,"cellTemplate",r,!1,void 0,void 0,this.parent.root));t.append(a,i)}},i.prototype.scrollToDate=function(e){var t;t=null!==this.parent.activeViewOptions.group.resources&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive?+new Date(b(f(e))):+new Date(b(e));var i=this.element.querySelector('[data-date="'+t+'"]');if(i){var n=this.getScrollableElement();if(this.parent.enableRtl){var r=this.element.querySelector("."+nt);n.scrollLeft=-(r.offsetWidth-i.offsetLeft-i.offsetWidth)}else n.scrollLeft=i.offsetLeft;n.scrollTop=i.offsetTop}},i.prototype.getScrollableElement=function(){return this.parent.isAdaptive&&!this.isTimelineView()?this.element.querySelector(".e-scroll-container"):this.getContentAreaElement()},i.prototype.wireEvents=function(e){t.EventHandler.add(e,"mousedown",this.parent.workCellAction.cellMouseDown,this.parent.workCellAction),t.EventHandler.add(e,"click",this.parent.workCellAction.cellClick,this.parent.workCellAction),this.parent.isAdaptive||t.EventHandler.add(e,"dblclick",this.parent.workCellAction.cellDblClick,this.parent.workCellAction)},i}(yn),Mn=function(){function e(e){this.parent=e}return e.prototype.initializeCalendarExport=function(e,t){var i=this.getCalendarString(e,t);this.download(i,e)},e.prototype.getCalendarString=function(e,i){var n=this,r=i||t.extend([],this.parent.eventsData,null,!0);r=this.parent.eventBase.sortByTime(r);var a=-1!==navigator.appVersion.indexOf("Win")?"\r\n":"\n",s=[],o=[],l=this.parent.timezone||this.parent.tzModule.getLocalTimezoneName(),p=this.parent.eventFields;return r.forEach(function(e){var i=e[p.id]||e.Guid||n.parent.eventBase.generateGuid(),c=[];if(e[p.recurrenceID]){var h=n.filterEvents(o,p.id,e[p.recurrenceID]);i=h.length>0?h[0].UID:i}if(!e[p.recurrenceID]&&e[p.recurrenceRule]&&e[p.recurrenceException]){f=e[p.recurrenceException].split(",");n.filterEvents(r,p.recurrenceID,e[p.id]).forEach(function(e){c.push(Ne(e[p.startTime]))});var d=f.filter(function(e){return-1===c.indexOf(e)});e[p.recurrenceException]=d.length>0?d.join(",")+",":""}var u=e[p.startTimezone]||l,g=e[p.endTimezone]||l,v=!!e[p.isReadonly]&&e[p.isReadonly],m=["BEGIN:VEVENT","LOCATION:"+(e[p.location]||""),"SUMMARY:"+(e[p.subject]||""),"UID:"+i,"DESCRIPTION:"+(e[p.description]||""),"ISREADONLY:"+v,"END:VEVENT"];if(e[p.isAllDay]?(m.splice(4,0,"DTEND;VALUE=DATE:"+n.convertDateToString(e[p.endTime],!0)),m.splice(4,0,"DTSTART;VALUE=DATE:"+n.convertDateToString(e[p.startTime],!0))):e[p.isAllDay]||e[p.recurrenceRule]?(m.splice(4,0,'DTEND;TZID="'+g+'":'+n.convertDateToString(e[p.endTime])),m.splice(4,0,'DTSTART;TZID="'+u+'":'+n.convertDateToString(e[p.startTime]))):(m.splice(4,0,"DTEND:"+n.convertDateToString(e[p.endTime])),m.splice(4,0,"DTSTART:"+n.convertDateToString(e[p.startTime]))),e[p.recurrenceRule]&&m.splice(4,0,"RRULE:"+e[p.recurrenceRule]),e[p.recurrenceException])for(var f=e[p.recurrenceException].split(","),y=0;y<f.length-1;y++)m.splice(5,0,"EXDATE:"+n.convertDateToString(X(f[parseInt(y.toString(),10)]),e[p.isAllDay]));e[p.recurrenceID]&&m.splice(4,0,'RECURRENCE-ID;TZID="'+u+'":'+n.convertDateToString(e[p.startTime],e[p.isAllDay]));var T=n.customFieldFilter(e,p);T.length>0&&T.forEach(function(t){return m.splice(4,0,t+":"+(e[""+t]||""))});var w=t.extend({},e);w.UID=i,o.push(w),s.push(m.join(a))}),["BEGIN:VCALENDAR","PRODID:-//Syncfusion Inc//Scheduler//EN","VERSION:2.0","CALSCALE:GREGORIAN","METHOD:PUBLISH","X-WR-CALNAME:"+(e||"Calendar"),"X-WR-TIMEZONE:"+l].join(a)+a+s.join(a)+a+"END:VCALENDAR"},e.prototype.customFieldFilter=function(e,t){var i=Object.keys(t).map(function(e){return t[""+e]});return Object.keys(e).filter(function(e){return-1===i.indexOf(e)&&"Guid"!==e})},e.prototype.convertDateToString=function(e,t){var i=("0000"+e.getFullYear().toString()).slice(-4),n=("00"+(e.getMonth()+1).toString()).slice(-2),r=("00"+e.getDate().toString()).slice(-2),a=("00"+e.getHours().toString()).slice(-2),s=("00"+e.getMinutes().toString()).slice(-2),o=("00"+e.getSeconds().toString()).slice(-2);return t?i+n+r:i+n+r+"T"+a+s+o},e.prototype.download=function(e,t){var i=new Blob([e],{type:"data:text/calendar;charset=utf8"});if(t=(t||"Calendar")+".ics",navigator.msSaveBlob)navigator.msSaveBlob(i,t);else{var n=document.createElementNS("http://www.w3.org/1999/xhtml","a");n.download=t,n.href=URL.createObjectURL(i);var r=document.createEvent("MouseEvent");r.initEvent("click",!0,!0),n.dispatchEvent(r),setTimeout(function(){URL.revokeObjectURL(n.href),n.href=void 0})}},e.prototype.filterEvents=function(e,t,i){return e.filter(function(e){return e[""+t]===i})},e.prototype.getModuleName=function(){return"iCalendarExport"},e.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed||(this.parent=null)},e}(),Rn=function(){function e(e){this.allDay=!1,this.parent=e}return e.prototype.initializeCalendarImport=function(e){var t=this;if(e&&e instanceof Blob){var i=new FileReader;i.onload=function(){var e=i.result;t.iCalendarParser(e)},i.readAsText(e,"UTF-8")}else e&&"string"==typeof e&&this.iCalendarParser(e)},e.prototype.iCalendarParser=function(e){var i,n,r={isEvent:!1,curEvent:null,id:this.parent.eventBase.getEventMaxID(),count:0,events:[],key:null},a=e.length,s=e.search(/[^ \t]/),o=s;do{0===(o=e.indexOf("\n",s)+1)?(o=a,n=0):n=o>1&&"\r"===e[o-2]?2:1;var l=e.charAt(s);" "===l||"\n"===l||"\t"===l?i+=e.slice(s+1,o-n):(i&&(r=this.updateEventData(i,r)),i=e.slice(s,o-n)),s=o}while(o!==a);(i=i.trim()).length&&(r=this.updateEventData(i,r));var p=t.extend([],r.events,null,!0);this.parent.addEvent(this.processOccurrence(p,r.id))},e.prototype.updateEventData=function(e,i){var n=this.parent.eventFields,r=i.id,a=i.events,s=i.isEvent,o=i.count,l=i.curEvent,p=i.key;if(s||"BEGIN:VEVENT"!==e||(s=!0,l={}),s&&"END:VEVENT"===e&&(s=!1,a.push(l),l=null),s){var c=e.indexOf(":"),h=e.substring(0,c).replace(/^\s\s*/,"").replace(/\s\s*$/,""),d=e.substring(c+1,e.length).replace(/^\s\s*/,"").replace(/\s\s*$/,"");if(-1!==e.indexOf("SUMMARY")&&(h="SUMMARY"),-1!==e.indexOf("DTSTART"))l[n.startTime]=this.dateParsing(e),l[n.isAllDay]=this.allDay,this.allDay=!1;else if(-1!==e.indexOf("DTEND"))l[n.endTime]=this.dateParsing(e);else if(-1!==e.indexOf("EXDATE"))d=Ne(this.dateParsing(e)),l[n.recurrenceException]=t.isNullOrUndefined(l[n.recurrenceException])?d:l[n.recurrenceException]+","+d;else if(-1!==e.indexOf("RECURRENCE-ID"))d=Ne(this.dateParsing(e)),l[n.recurrenceException]=d,l[n.recurrenceID]=d;else switch(p=h||p){case"BEGIN":break;case"UID":l[""+h]=d,"number"==typeof r?(l[n.id]=parseInt(d,10),isNaN(l[n.id])&&(l[n.id]=r+o,o++)):l[n.id]=d;break;case"SUMMARY":l[n.subject]=this.getFormattedString(d);break;case"LOCATION":l[n.location]=this.getFormattedString(d);break;case"DESCRIPTION":l[n.description]?l[n.description]=this.getFormattedString(l[n.description]+"\r\n"+d):l[n.description]=this.getFormattedString(d);break;case"ISREADONLY":l[n.isReadonly]=d.indexOf("true")>-1;break;case"RRULE":l[n.recurrenceRule]=d;break;default:if(this.parent.resourceCollection.length>0){var u=this.parent.resourceCollection.filter(function(e){return e.field===h});l[""+h]=u.length>0&&"number"==typeof u[0].dataSource[0][u[0].idField]?parseInt(d,10):d}else l[""+h]=d}}return{isEvent:s,curEvent:l,id:r,count:o,events:a,key:p}},e.prototype.processOccurrence=function(e,i){var n=this,r=[],a=this.parent.eventFields,s=[];return this.parent.eventsData.forEach(function(e){s.push(e[a.id])}),e.forEach(function(o){var l,p;if(o.hasOwnProperty(a.recurrenceID)||(l=o,p=o[a.id]),s.indexOf(o[a.id])<0){var c=e.filter(function(e){return e.UID===o.UID});if(c.length>1&&t.isNullOrUndefined(o[a.recurrenceID])){p="number"==typeof i?i++:p;for(var h=0;h<c.length;h++)if(c[parseInt(h.toString(),10)].hasOwnProperty(a.recurrenceID)){var d=c[parseInt(h.toString(),10)][a.recurrenceID];c[parseInt(h.toString(),10)][a.id]="number"==typeof i?i++:n.parent.eventBase.generateGuid(),c[parseInt(h.toString(),10)][a.recurrenceID]=p,c[parseInt(h.toString(),10)][a.recurrenceException]=null,l[a.recurrenceException]=n.getExcludeDateString(l[a.recurrenceException],d),delete c[parseInt(h.toString(),10)].UID,r.push(c[parseInt(h.toString(),10)])}delete l.UID,l[a.id]=p,r.push(l)}else o.hasOwnProperty(a.recurrenceID)||(delete o.UID,o[a.id]="number"==typeof i?i++:p,r.push(o))}}),r},e.prototype.getExcludeDateString=function(e,i){if(t.isNullOrUndefined(e))return i;if(t.isNullOrUndefined(i))return e;var n=e.split(",").map(function(e){return e.split("T")[0]}),r=i.split(",").map(function(e){return e.split("T")[0]});return n.filter(function(e){return r.indexOf(e)>-1}).length>0?e:e+","+i},e.prototype.getFormattedString=function(e){return(e=e||"").replace(/\\\,/g,",").replace(/\\\;/g,";").replace(/\\[nN]/g,"\n").replace(/\\\\/g,"\\")},e.prototype.dateParsing=function(e){var t=e.split(":"),i=t[t.length-1],n=new Date(this.getFormattedString(i));if(e&&(e.indexOf("VALUE=DATE")>-1||e.indexOf("RECURRENCE-ID;TZID")>-1)){var r=/^(\d{4})(\d{2})(\d{2})$/.exec(i);null!==r&&(n=new Date(parseInt(r[1],10),parseInt(r[2],10)-1,parseInt(r[3],10))),e.indexOf("DTSTART")>-1&&(this.allDay=!0)}var a=/^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})(Z)?$/.exec(i);return null!==a&&(n="Z"===a[7]?new Date(Date.UTC(parseInt(a[1],10),parseInt(a[2],10)-1,parseInt(a[3],10),parseInt(a[4],10),parseInt(a[5],10),parseInt(a[6],10))):new Date(parseInt(a[1],10),parseInt(a[2],10)-1,parseInt(a[3],10),parseInt(a[4],10),parseInt(a[5],10),parseInt(a[6],10))),n},e.prototype.getModuleName=function(){return"iCalendarImport"},e.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed},e}(),Hn=function(){function e(e){this.parent=e}return e.prototype.initializeExcelExport=function(e){void 0===e&&(e={});var i,n=this.getExportColumns(e),r=e.fileName||"Schedule",a=e.exportType||"xlsx",s=e.includeOccurrences||!1;t.isNullOrUndefined(e.separator)||","===e.separator||(i=e.separator);var o;o=e.customData?s?this.parent.eventBase.getProcessedEvents(e.customData):e.customData:s?this.parent.eventsProcessed:this.parent.eventsData,this.processWorkbook(n,r,a,o,i)},e.prototype.processWorkbook=function(e,i,n,r,a){var s=this,o=[],l=[],p=[];e.forEach(function(e,t){o.push({index:t+1,width:"Id"===e.name?50:150})});var h={fontSize:12,borders:{color:"#E0E0E0"},bold:!0};e.forEach(function(e,t){p.push({index:t+1,value:e.text,style:h})}),l.push({index:1,cells:p}),r.forEach(function(i,n){var r=[];e.forEach(function(e,n){var a={index:n+1,value:i[e.name]||""};if(e.name===s.parent.eventFields.startTime||e.name===s.parent.eventFields.endTime){var o={fontSize:12,numberFormat:"m/d/yyyy h:mm a"};a=t.extend({},a,{style:o},!0)}r.push(a)}),l.push({index:n+2,cells:r})});var d={cancel:!1,worksheets:[{columns:o,rows:l}]};this.parent.trigger("excelExport",d,function(e){e.cancel||new c.Workbook({worksheets:e.worksheets},n,s.parent.locale,void 0,a).save(i+"."+n)})},e.prototype.getExportColumns=function(e){var t=this,i=e.fieldsInfo||[];return 0===i.length&&(e.fields||Object.keys(this.parent.eventFields).map(function(e){return t.parent.eventFields[""+e]})).forEach(function(e){i.push({name:e,text:e})}),i},e.prototype.getModuleName=function(){return"excelExport"},e.prototype.destroy=function(){this.parent=null},e}(),Pn=function(){function e(e){this.parent=e}return e.prototype.print=function(e){t.isNullOrUndefined(e)?this.printScheduler():this.printSchedulerWithModel(e)},e.prototype.printScheduler=function(){var e=this,i=this.parent.element.cloneNode(!0);i.id=this.parent.element.id+"_print";var n={cancel:!1,printElement:i};this.parent.trigger("beforePrint",n,function(n){if(!n.cancel){document.body.appendChild(i);for(var r="MonthAgenda"===e.parent.currentView?".e-appointment-wrap":".e-content-wrap",a=e.parent.element.querySelector(r),s="",o=0,l=[].slice.call(document.getElementsByTagName("head")[0].querySelectorAll("link, style"));o<l.length;o++)s+=l[o].outerHTML;var p=t.createElement("div");i.style.width=e.parent.element.offsetWidth+"px";var c=100*Math.round(parseInt(i.style.width,10)/100);p.appendChild(i);var h=window.open("","print","height=550,width="+c+",tabbar=no");h.document.write("<!DOCTYPE html><html><head>"+s+"</head><body>"+p.innerHTML+"<script>(function() { window.ready = true; })();<\/script></body></html>"),h.document.close(),h.focus(),setTimeout(function(){if(h.ready&&a){a.scrollLeft=a.scrollLeft,a.scrollTop=a.scrollTop;var e=h.document.querySelector(".e-date-header-wrap");e&&(e.scrollLeft=a.scrollLeft);var t=h.document.querySelector(".e-time-cells-wrap");t&&(t.scrollTop=a.scrollTop);var i=h.document.querySelector(r);i&&(i.scrollLeft=a.scrollLeft,i.scrollTop=a.scrollTop),h.print(),h.close()}},500)}})},e.prototype.printSchedulerWithModel=function(e){var i=this,n=t.createElement("div",{id:this.parent.element.id+"_print",className:"e-print-schedule"});document.body.appendChild(n),Zi.Inject(cn,dn,gn,mn,bn,Sn,xn,An,yn,kn),this.printInstance=new Zi(this.getPrintScheduleModel(e)),this.printInstance.isPrinting=!0,this.printInstance.registeredTemplate=this.parent.registeredTemplate,this.printInstance.root=this.parent.root?this.parent.root:this.parent,this.printInstance.appendTo(n);var r={cancel:!1,printElement:n};this.parent.trigger("beforePrint",r,function(e){if(e.cancel)return void i.printCleanup();i.printInstance.on("print",i.contentReady,i),i.printWindow=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no"),i.printWindow.moveTo(0,0),i.printWindow.resizeTo(screen.availWidth,screen.availHeight)})},e.prototype.getPrintScheduleModel=function(e){for(var i,n,r,a,s={},o=["cellHeaderTemplate","dayHeaderTemplate","monthHeaderTemplate","cellTemplate","dateHeaderTemplate","dateRangeTemplate","eventTemplate","resourceHeaderTemplate","headerIndentTemplate"],l=["actionBegin","actionComplete","actionFailure","created","dataBinding","dataBound","destroyed","eventRendered","moreEventsClick","navigating","popupOpen","popupClose","renderCell"],p=0,c=["agendaDaysCount","calendarMode","cssClass","currentView","dateFormat","enableRtl","endHour","eventSettings","firstDayOfWeek","firstMonthOfYear","group","height","locale","maxDate","minDate","readonly","resources","rowAutoHeight","selectedDate","showHeaderBar","showTimeIndicator","showWeekNumber","showWeekend","startHour","timeFormat","timeScale","timezone","views","width","workDays","workHours","dateHeaderTemplate","dateRangeTemplate","cellHeaderTemplate","dayHeaderTemplate","monthHeaderTemplate","cellTemplate","resourceHeaderTemplate","headerIndentTemplate","actionBegin","actionComplete","actionFailure","created","dataBinding","dataBound","destroyed","eventRendered","moreEventsClick","navigating","popupOpen","popupClose","renderCell"];p<c.length;p++){var h=c[p];switch(h){case"eventSettings":(i=Object.assign({},this.parent.eventSettings.properties)).dataSource=this.parent.eventsData;var d=t.isNullOrUndefined(e.eventSettings)||t.isNullOrUndefined(e.eventSettings.template)?i.template:e.eventSettings.template;i.template=this.parent.isAngular||"function"!=typeof d?d:null,s.eventSettings=i;break;case"group":(n=t.isNullOrUndefined(e.group)?this.parent.group:e.group).headerTooltipTemplate=null,s.group=n;break;case"timeScale":r=t.isNullOrUndefined(e.timeScale)?this.parent.timeScale:e.timeScale,this.parent.isAngular||(r.majorSlotTemplate="function"==typeof r.majorSlotTemplate?null:r.majorSlotTemplate,r.minorSlotTemplate="function"==typeof r.minorSlotTemplate?null:r.minorSlotTemplate),s.timeScale=r;break;case"views":if(a=t.isNullOrUndefined(e.views)?this.parent.views:e.views,!this.parent.isAngular&&a&&a.length>0&&"object"==typeof a[0])for(var u=0,g=a;u<g.length;u++)!function(e){o.forEach(function(i){t.isNullOrUndefined(e[""+i])||(e[""+i]="function"==typeof e[""+i]?null:e[""+i])})}(g[u]);s.views=a;break;default:if(o.indexOf(h)>-1){s[""+h]=t.isNullOrUndefined(e[""+h])?this.parent.isAngular||"function"!=typeof this.parent[""+h]?this.parent[""+h]:null:this.parent.isAngular||"function"!=typeof e[""+h]?e[""+h]:null;break}if(l.indexOf(h)>-1){s[""+h]=e[""+h];break}s[""+h]=t.isNullOrUndefined(e[""+h])?this.parent[""+h]:e[""+h]}}return s},e.prototype.contentReady=function(){var e=this;this.printWindow=t.print(this.printInstance.element,this.printWindow),this.closePrintWindow(this.printWindow,!0),this.printWindow.onbeforeunload=function(){e.printCleanup()}},e.prototype.closePrintWindow=function(e,i){var n=this;if(t.Browser.isIos)var r=setInterval(function(){e.opener?e.close():t.isNullOrUndefined(e.opener)&&(i&&n.printCleanup(),clearInterval(r))},500)},e.prototype.printCleanup=function(){this.printInstance&&(this.printInstance.off("print",this.contentReady),this.printInstance.element.remove(),this.printInstance.destroy(),this.printInstance=null),this.printWindow&&(this.printWindow.onbeforeunload=null,this.printWindow=null)},e.prototype.getModuleName=function(){return"print"},e.prototype.destroy=function(){this.parent=null},e}();return Zi.Inject(cn,dn,gn,mn,yn,bn,Sn,xn,An,kn,en,an,Hn,Mn,Rn,Pn),e.Agenda=bn,e.DEFAULT_WEEKS=6,e.Day=cn,e.DragAndDrop=an,e.ExcelExport=Hn,e.Gregorian=ft,e.HeaderRenderer=ht,e.ICalendarExport=Mn,e.ICalendarImport=Rn,e.Islamic=yt,e.MS_PER_DAY=Qe,e.MS_PER_MINUTE=Ke,e.Month=mn,e.MonthAgenda=Sn,e.Print=Pn,e.RecurrenceEditor=di,e.Resize=en,e.Schedule=Zi,e.TimelineMonth=An,e.TimelineViews=xn,e.TimelineYear=kn,e.Timezone=Tt,e.ViewBase=sn,e.WEEK_LENGTH=7,e.Week=dn,e.WorkWeek=gn,e.Year=yn,e.actionBegin=We,e.actionComplete="actionComplete",e.actionFailure="actionFailure",e.addDays=O,e.addMonths=E,e.addYears=x,e.agendaCells="agendaCells",e.beforePaste="beforePaste",e.beforePrint="beforePrint",e.capitalizeFirstWord=U,e.cellClick="cellClick",e.cellDoubleClick="cellDoubleClick",e.cellMouseDown="cell-mouse-down",e.cellSelect="cellSelect",e.contentReady=Ge,e.dataBinding="dataBinding",e.dataBound="dataBound",e.dataReady=_e,e.dateHeader="dateHeader",e.documentClick="document-click",e.documentPaste="document-paste",e.drag="drag",e.dragStart="dragStart",e.dragStop="dragStop",e.eventClick="eventClick",e.eventDoubleClick="eventDoubleClick",e.eventRendered="eventRendered",e.eventsLoaded="events-loaded",e.excelExport="excelExport",e.extractObjectFromRule=Ee,e.findIndexInData=H,e.firstDateOfMonth=f,e.generate=G,e.generateSummary=Y,e.getCalendarUtil=je,e.getDateCount=S,e.getDateFromRecurrenceDateString=X,e.getDateFromString=k,e.getDateInMs=C,e.getDaysCount=I,e.getElementHeight=W,e.getElementHeightFromClass=h,e.getElementTop=z,e.getElementWidth=B,e.getElementWidthFromClass=d,e.getMaxDays=A,e.getOuterHeight=P,e.getRecurrenceStringFromDate=Ne,e.getScrollBarWidth=M,e.getStartEndHours=V,e.getTranslateX=g,e.getTranslateY=u,e.getUniversalTime=L,e.getWeekFirstDate=v,e.getWeekLastDate=m,e.getWeekMiddleDate=w,e.getWeekNumber=T,e.hover="hover",e.initialEnd="initial-end",e.initialLoad="initial-load",e.inlineClick=Ye,e.isDaylightSavingTime=N,e.isIPadDevice=F,e.isMobile=q,e.lastDateOfMonth=y,e.moreEventsClick="moreEventsClick",e.navigating="navigating",e.noEvents="noEvents",e.popupClose="popupClose",e.popupOpen="popupOpen",e.print="print",e.removeChildren=j,e.renderCell=ze,e.resetScrollbarWidth=R,e.resetTime=b,e.resizeStart="resizeStart",e.resizeStop="resizeStop",e.resizing="resizing",e.resourceHeader="resourceHeader",e.scroll="scroll",e.scrollUiUpdate=Xe,e.select="select",e.setTime=D,e.timezoneData=wt,e.tooltipOpen="tooltipOpen",e.uiUpdate="ui-update",e.virtualScroll="virtual-scroll",e.virtualScrollStart="virtualScrollStart",e.virtualScrollStop="virtualScrollStop",e}({},ej.base,ej.popups,ej.navigations,ej.calendars,ej.data,ej.buttons,ej.inputs,ej.dropdowns,ej.lists,ej.excelexport),this.ejs=ej;
|
|
10
|
+
this.ej=this.ej||{},this.ej.schedule=function(e,t,i,n,r,a,s,o,l,p,c){"use strict";function h(e,i,n){var r=0,a=t.createElement("div",{className:i}).cloneNode();return a.style.visibility="hidden",a.style.position="absolute",e.appendChild(a),r=W(a,n),t.remove(a),r}function d(e,i,n){var r=0,a=t.createElement("div",{className:i}).cloneNode();return a.style.visibility="hidden",a.style.position="absolute",e.appendChild(a),r=B(a,n),t.remove(a),r}function u(e){var t=getComputedStyle(e);return window.WebKitCSSMatrix?new WebKitCSSMatrix(t.webkitTransform).m42:0}function g(e){var t=getComputedStyle(e);return window.WebKitCSSMatrix?new WebKitCSSMatrix(t.webkitTransform).m41:0}function v(e,t){var i=new Date(e.getTime());return t=(t-i.getDay()-7)%7,new Date(i.setDate(i.getDate()+(isNaN(t)?0:t)))}function m(e,t){var i=v(e,t),n=new Date(i.getFullYear(),i.getMonth(),i.getDate()+6);return new Date(n.getTime())}function f(e){return new Date(e.getFullYear(),e.getMonth(),1)}function y(e){return new Date(e.getFullYear(),e.getMonth()+1,0)}function T(e){var t=new Date(e.getFullYear(),0,1).valueOf(),i=(new Date(e.getFullYear(),e.getMonth(),e.getDate()).valueOf()-t+Qe)/Qe;return Math.ceil(i/7)}function w(e,t){return new Date(t.valueOf()-(t.valueOf()-e.valueOf())/2)}function D(e,t){var i=e.getTimezoneOffset(),n=new Date(e.getTime()+t),r=n.getTimezoneOffset()-i;return e.setTime(n.getTime()+r*Ke),e}function b(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function C(e){var t=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0).getTimezoneOffset(),i=e.getTimezoneOffset()-t;return e.getTime()-new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0).getTime()-60*i*1e3}function S(e,t){return Math.ceil((t.getTime()-e.getTime())/Qe)}function O(e,t){return e=new Date(""+e),new Date(e.setDate(e.getDate()+t))}function E(e,t){var i=(e=new Date(""+e)).getDate();return e.setDate(1),e.setMonth(e.getMonth()+t),e.setDate(Math.min(i,A(e))),e}function x(e,t){var i=(e=new Date(""+e)).getDate();return e.setDate(1),e.setFullYear(e.getFullYear()+t),e.setDate(Math.min(i,A(e))),e}function V(e,t,i){var n=new Date(e.getTime());n.setHours(t.getHours()),n.setMinutes(t.getMinutes()),n.setSeconds(t.getSeconds());var r=new Date(e.getTime());return 0===i.getHours()?r=O(r,1):(r.setHours(i.getHours()),r.setMinutes(i.getMinutes()),r.setSeconds(i.getSeconds())),{startHour:n,endHour:r}}function A(e){return y(e).getDate()}function I(e,t){var i=b(new Date(e)),n=b(new Date(t));return Math.round((n.getTime()-i.getTime())/Qe)}function k(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,"/"))}function M(){if(null!==Ze)return Ze;null===Je&&(Je=window.devicePixelRatio||window.screen.availWidth/document.documentElement.clientWidth);var e=t.createElement("div"),i=0;e.style.cssText="width:100px;height: 100px;overflow: scroll;position: absolute;top: -9999px;",document.body.appendChild(e);var n=devicePixelRatio?"1.10"===devicePixelRatio.toFixed(2)||devicePixelRatio<=1?Math.ceil(devicePixelRatio%1):Math.floor(devicePixelRatio%1):0;return i=e.offsetWidth-e.clientWidth-n|0,document.body.removeChild(e),Ze=i}function R(){var e=window.devicePixelRatio||window.screen.availWidth/document.documentElement.clientWidth;Je&&Je!==e&&(Ze=null,Je=e)}function H(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 P(e){var t=getComputedStyle(e);return e.offsetHeight+(parseInt(t.marginTop,10)||0)+(parseInt(t.marginBottom,10)||0)}function j(e){for(var t=0,i=[].slice.call(e.children);t<i.length;t++){var n=i[t];e.removeChild(n)}}function N(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 L(e){var t=e.getFullYear(),i=e.getMonth(),n=e.getDate(),r=e.getHours(),a=e.getMinutes(),s=e.getSeconds(),o=e.getMilliseconds();return Date.UTC(t,i,n,r,a,s,o)}function q(){return window.navigator.userAgent.toLowerCase().indexOf("mobi")>-1}function F(){return window.navigator.userAgent.toLowerCase().indexOf("ipad")>-1}function U(e,i){if("multiple"===i)e=e.split(" ").map(function(e){return e.charAt(0).toLocaleUpperCase()+e.substring(1)}).join(" ");else if("single"===i){if(e[0]>="0"&&e[0]<="9"){var n=e.match(/[a-zA-Z]/);e=t.isNullOrUndefined(n)?e:e.slice(0,n.index)+e[n.index].toLocaleUpperCase()+e.slice(n.index+1)}e=e[0].toLocaleUpperCase()+e.slice(1)}return e}function B(e,t){return t?e.offsetWidth:e.getBoundingClientRect().width}function W(e,t){return t?e.offsetHeight:e.getBoundingClientRect().height}function z(e,t){return t?e.offsetTop:e.getBoundingClientRect().top}function Y(e,i,n,r){void 0===r&&(r="Gregorian");var a,s,o=Ee(e),l=i.getConstant(Vt)+" ",p=r.toLowerCase();if("en"===n||"en-US"===n){var c="months.stand-alone.abbreviated",h="days.stand-alone.abbreviated";s=t.getValue(c,t.getDefaultDateObject(p)),a=t.getValue(h,t.getDefaultDateObject(p))}else{var c="main."+n+".dates.calendars."+p+".months.stand-alone.abbreviated",h="main."+n+".dates.calendars."+p+".days.stand-alone.abbreviated";s=t.getValue(c,t.cldrData),a=t.getValue(h,t.cldrData)}switch(o.interval>1&&(l+=o.interval+" "),o.freq){case"DAILY":l+=i.getConstant(It);break;case"WEEKLY":l+=i.getConstant(kt)+" "+i.getConstant(xt)+" ",o.day.forEach(function(e,i){l+=U(t.getValue(Ht[""+e],a),"single"),l+=o.day.length-1===i?"":", "});break;case"MONTHLY":l+=i.getConstant(Mt)+" "+i.getConstant(xt)+" ",l+=_(o,a,i);break;case"YEARLY":l+=i.getConstant(Rt)+" "+i.getConstant(xt)+" ",l+=U(t.getValue(o.month[0].toString(),s),"single")+" ",l+=_(o,a,i)}if(o.count)l+=", "+o.count+" "+i.getConstant(Et);else if(o.until){var d=o.until;l+=", "+i.getConstant(At)+" "+d.getDate()+" "+U(t.getValue((d.getMonth()+1).toString(),s),"single")+" "+d.getFullYear()}return l}function _(e,i,n){var r="";if(e.monthDay.length)r+=e.monthDay[0];else if(e.day){var a=e.setPosition-1;r+=n.getConstant(Ot[a>-1?a:Ot.length-1])+" "+U(t.getValue(Ht[e.day[0]],i),"single")}return r}function G(e,i,n,r,a,s,o,l){void 0===a&&(a=St),void 0===s&&(s=null),void 0===o&&(o="Gregorian"),void 0===l&&(l=null);var p,c=Ee(i);Be=je(o);var h=[],d=new Date(e.getTime());qe=[];var u=t.isNullOrUndefined(n)?[]:n.split(","),g=new Tt;if(u.forEach(function(e){var t=X(e);l&&(t=g.add(new Date(t.getTime()),l)),qe.push(new Date(t.getTime()).setHours(0,0,0,0))}),c.recExceptionCount=t.isNullOrUndefined(c.count)?0:qe.length,Ue=s&&s>e&&!c.count?new Date(new Date(s.getTime()).setHours(0,0,0)):null,!c.until&&Ue&&((p=new Date(Ue.getTime())).setDate(Ue.getDate()+a*c.interval),c.until=p),c.until&&e>c.until)return h;if(Fe=a,r=r||0,He(Ct[parseInt(r.toString(),10)]),c.until){var v=b(c.until);c.until=new Date(v.getFullYear(),v.getMonth(),v.getDate(),23,59,59)}switch(c.freq){case"DAILY":Z(d,c.until,h,c);break;case"WEEKLY":J(d,c.until,h,c,r);break;case"MONTHLY":$(d,c.until,h,c);break;case"YEARLY":ee(d,c.until,h,c)}return h}function X(e){return new Date(e.substr(0,4)+"-"+e.substr(4,2)+"-"+e.substr(6,5)+":"+e.substr(11,2)+":"+e.substr(13))}function Q(e,t){var i=new Date(t).setHours(0,0,0,0);-1===qe.indexOf(i)&&(!Ue||i>=Ue.getTime())&&e.push(t)}function K(e,t){var i=Fe;return t.count?i=t.count:t.until&&("DAILY"===t.freq||"WEEKLY"===t.freq?i=Math.floor((t.until.getTime()-e.getTime())/Qe)+1:"MONTHLY"!==t.freq&&"YEARLY"!==t.freq||(i=Math.floor((t.until.getMonth()+12*t.until.getFullYear()-(e.getMonth()+12*e.getFullYear()))/t.interval)+(t.day.length>1?Math.floor((t.until.getTime()-e.getTime())/Qe)+1:1),"YEARLY"===t.freq&&(i=t.month.length>1?i*t.month.length:i))),i}function Z(e,t,i,n){for(var r=new Date(e.getTime()),a=n.interval,s=K(e,n),o=n.day;be(r,t)&&(!0,!(Pe(r,n)&&(o.indexOf(Ct[r.getDay()])>-1||0===o.length)&&(Q(i,r.getTime()),s&&i.length+n.recExceptionCount>=s)));)r.setDate(r.getDate()+a),r.getHours()!==e.getHours()&&r.setHours(e.getHours())}function J(e,i,n,r,a){var s=new Date(e.getTime());r.day.length||r.day.push(Ct[e.getDay()]);var o,l=r.interval,p=r.day,c=K(e,r),h=!0,d=[];if(p.length>1)for((t.isNullOrUndefined(r.wkst)||""===r.wkst)&&(r.wkst=bt[0]),o=Ct.indexOf(r.wkst);be(s,i);){var u=Ct.indexOf(Ct[s.getDay()])-o,g=O(O(s,-(u=-1===u?6:u)),6),v=new Date(s.getTime());for(g=b(g),v=b(v);g>=v&&(p.indexOf(Ct[s.getDay()])>-1&&d.push([s.getTime()]),!(c&&n.length+r.recExceptionCount>=c));)s.setDate(s.getDate()+1),s.getHours()!==e.getHours()&&s.setHours(e.getHours()),v=b(v=new Date(s.getTime()));if(s.setDate(s.getDate()-1),c&&n.length+r.recExceptionCount>=c)break;s.setDate(s.getDate()+1+7*(l-1)),ge(d,h,e,i,n,r),d=[]}else{for(s=Oe(e,r.day),l>1&&bt.indexOf(r.day[0])<e.getDay()-a&&s.setDate(s.getDate()+7*(l-1));be(s,i)&&((h=Pe(s,r))&&p.indexOf(Ct[s.getDay()])>-1&&Q(n,s.getTime()),!(c&&n.length+r.recExceptionCount>=c));)s.setDate(s.getDate()+7*l);ge(d,h,e,i,n,r),d=[]}}function $(e,t,i,n){switch(n.month.length||n.day.length||n.monthDay.length?n.month.length>0&&!n.day.length&&!n.monthDay.length&&n.monthDay.push(e.getDate()):(n.monthDay.push(e.getDate()),"YEARLY"===n.freq&&n.month.push(e.getMonth()+1)),Me(n)){case"day":switch(n.freq){case"MONTHLY":ce(e,t,i,n);break;case"YEARLY":he(e,t,i,n)}break;case"both":case"date":switch(n.freq){case"MONTHLY":se(e,t,i,n);break;case"YEARLY":ae(e,t,i,n)}}}function ee(e,t,i,n){switch(ne(n)){case"MONTH":$(e,t,i,n);break;case"WEEKNO":te(e,t,i,n);break;case"YEARDAY":ie(e,t,i,n)}}function te(e,i,n,r){for(var a,s,o,l,p,c=Be.getYearLastDate(e,0),h=K(e,r),d=r.weekNo,u=[],g=r.day;be(c,i);){s=6-bt.indexOf(Ct[c.getDay()])+1;for(var v=0;v<d.length;v++)for(l=1===(o=(o=d[parseInt(v.toString(),10)])>0?o:53+o+1)?s:s+7*(o-1),p=1===o?s-7:s+7*(o-2);p<l;)a=new Date(c.getTime()+Qe*p),(0===g.length||g.indexOf(Ct[a.getDay()])>-1)&&(t.isNullOrUndefined(r.setPosition)?ye(void 0,e,i,n,r,a.getTime()):u.push([a.getTime()])),p++;if(t.isNullOrUndefined(r.setPosition)||De(u,void 0,e,i,n,r),h&&n.length+r.recExceptionCount>=h)return;c=Be.getYearLastDate(a,r.interval),u=[]}}function ie(e,i,n,r){for(var a,s,o=Be.getYearLastDate(e,0),l=K(e,r),p=[],c=r.day;be(o,i);){for(var h=0;h<r.yearDay.length;h++)s=r.yearDay[parseInt(h.toString(),10)],a=new Date(o.getTime()),s!==Be.getLeapYearDaysCount()&&s!==-Be.getLeapYearDaysCount()||Be.isLeapYear(Be.getFullYear(a),1)?(a.setDate(a.getDate()+(s<0?Be.getYearDaysCount(a,1)+1+s:s)),(0===c.length||c.indexOf(Ct[a.getDay()])>-1)&&(null==r.setPosition?ye(void 0,e,i,n,r,a.getTime()):p.push([a.getTime()]))):a.setDate(a.getDate()+1);if(t.isNullOrUndefined(r.setPosition)||De(p,void 0,e,i,n,r),l&&n.length+r.recExceptionCount>=l)return;o=Be.getYearLastDate(a,r.interval),p=[]}}function ne(e){return e.yearDay.length?"YEARDAY":e.weekNo.length?"WEEKNO":"MONTH"}function re(e,t){var i={monthCollection:[],index:0,tempDate:new Date(e.getTime()),mainDate:new Date(e.getTime()),expectedCount:K(e,t),monthInit:0,dateCollection:[]};return t.month.length&&Be.setMonth(i.tempDate,t.month[0],i.tempDate.getDate()),i}function ae(e,t,i,n){if(n.month.length)return void se(e,t,i,n);var r,a=re(e,n);for(a.tempDate=a.mainDate=Be.getMonthStartDate(a.tempDate);be(a.tempDate,t);){for(r=new Date(a.tempDate.getTime());Be.isSameYear(r,a.tempDate)&&a.expectedCount&&i.length+n.recExceptionCount<=a.expectedCount;){if(!(0===n.month.length||n.month.length>0&&!Be.checkMonth(a.tempDate,n.month))){Be.setValidDate(a.tempDate,1,1),a.tempDate=Oe(a.tempDate,n.day);break}oe(n,a,t,!1),a.beginDate=new Date(a.tempDate.getTime()),a.monthInit=le(a.tempDate,n,a.monthInit,a.beginDate)}if(a.tempDate.setFullYear(r.getFullYear(),r.getMonth(),r.getDate()),ge(a.dateCollection,a.state,e,t,i,n),Be.isLastMonth(a.tempDate)&&(Be.setValidDate(a.tempDate,1,1),a.tempDate=Oe(a.tempDate,n.day)),a.expectedCount&&i.length+n.recExceptionCount>=a.expectedCount)return;a.tempDate.setFullYear(a.tempDate.getFullYear()+n.interval-1),a.tempDate=Oe(a.tempDate,n.day),a.monthInit=le(a.tempDate,n,a.monthInit,a.beginDate),a.dateCollection=[]}}function se(e,i,n,r){var a=re(e,r);if(a.tempDate=a.mainDate=Be.getMonthStartDate(a.tempDate),!(("MONTHLY"===r.freq&&12===r.interval||"YEARLY"===r.freq)&&Be.getMonthDaysCount(e)<r.monthDay[0]))for(;be(a.tempDate,i);){if(a.beginDate=new Date(a.tempDate.getTime()),oe(r,a,i,!0,e,n),t.isNullOrUndefined(r.setPosition)||De(a.dateCollection,a.state,e,i,n,r),a.expectedCount&&n.length+r.recExceptionCount>=a.expectedCount)return;a.monthInit=le(a.tempDate,r,a.monthInit,a.beginDate),a.dateCollection=[]}}function oe(e,i,n,r,a,s){for(var o=0;o<e.monthDay.length;o++){i.date=e.monthDay[parseInt(o.toString(),10)],i.tempDate=Be.getMonthStartDate(i.tempDate);var l=Be.getMonthDaysCount(i.tempDate);if(i.date=i.date>0?i.date:l+i.date+1,xe(i.tempDate,i.date,i.mainDate)&&i.date>0){if(Be.setDate(i.tempDate,i.date),n&&i.tempDate>n)return;(0===e.day.length||e.day.indexOf(Ct[i.tempDate.getDay()])>-1)&&(r&&t.isNullOrUndefined(e.setPosition)&&i.expectedCount&&s.length+e.recExceptionCount<i.expectedCount?ye(i.state,a,n,s,e,i.tempDate.getTime()):i.dateCollection.push([i.tempDate.getTime()]))}}}function le(e,i,n,r,a){void 0===r&&(r=null);var s=r?r.getMonth():0,o=Be.getMonthStartDate(e);return a=t.isNullOrUndefined(a)?i.interval:a,e.setFullYear(o.getFullYear()),e.setMonth(o.getMonth()),e.setDate(o.getDate()),i.month.length?(n++,n%=i.month.length,Be.setMonth(e,i.month[parseInt(n.toString(),10)],1),0===n&&Be.addYears(e,a,i.month[0])):(r&&r.getFullYear()<e.getFullYear()&&(s=e.getMonth()-1),Be.setValidDate(e,a,1,s,r)),n}function pe(e,i,n,r){var a=r.day,s=new Date(e.getTime());s=Be.getMonthStartDate(s);var o,l,p=[],c=[],h=[],d=K(e,r),u=0;for(r.month.length&&Be.setMonth(s,r.month[0],1),s=Oe(s,r.day);be(s,i)&&d&&n.length+r.recExceptionCount<d;){var g=new Date(s.getTime());if(a.map(function(e){return Pt.test(e)}).indexOf(!0)>-1){for(var v=0;v<=a.length-1;v++){var m=a[parseInt(v.toString(),10)].match(Nt),f=parseInt(m[0],10);for(s=new Date(s.getTime()),s=Oe(s=Be.getMonthStartDate(s),a),g.setFullYear(s.getFullYear(),s.getMonth(),s.getDate());Be.isSameYear(g,s)&&Be.isSameMonth(g,s);)m[m.length-1]===Ct[g.getDay()]&&p.push([g.getTime()]),g.setDate(g.getDate()+1);if(g.setDate(g.getDate()-1),o=m[0].indexOf("-")>-1?p.length- -1*f:f-1,o=isNaN(o)?0:o,p.length>0&&(t.isNullOrUndefined(r.setPosition)?De(p,void 0,e,i,n,r,o):c=[fe(p,o,h)]),d&&n.length+r.recExceptionCount>=d)return;p=[]}t.isNullOrUndefined(r.setPosition)||(we(c,void 0,e,i,n,r),h=[]),u=le(s,r,u,l),s=Oe(s,r.day),p=[]}else{var y=[],T=Ve(a);g.setFullYear(s.getFullYear(),s.getMonth(),s.getDate());var w=new Date(s.getTime());for(l=new Date(s.getTime());Be.isSameMonth(w,s);)y.push(s.getTime()),a.indexOf(Ct[s.getDay()])>-1&&(p.push(y),y=[]),s.setDate(s.getDate()+T[Ct[s.getDay()]]);if(o=r.setPosition<1?p.length+r.setPosition:r.setPosition-1,t.isNullOrUndefined(r.setPosition)){o=0;for(var D=[],b=0;b<p.length;b++)for(var C=0;C<p[parseInt(b.toString(),10)].length;C++)D.push(p[parseInt(b.toString(),10)][parseInt(C.toString(),10)]);p=[D]}if(p.length>0&&De(p,void 0,e,i,n,r,o),d&&n.length+r.recExceptionCount>=d)return;u=le(s,r,u,l),s=Oe(s,r.day),p=[]}}}function ce(e,t,i,n){if(n.day.length>1)return void pe(e,t,i,n);var r,a=new Date(e.getTime()),s=K(e,n),o=[],l=0;for(a=Be.getMonthStartDate(a),n.month.length&&Be.setMonth(a,n.month[0],1),a=Oe(a,n.day);be(a,t)&&s&&i.length+n.recExceptionCount<s;){r=new Date(a.getTime());for(var p=new Date(a.getTime());Be.isSameMonth(a,p);)o.push([p.getTime()]),p.setDate(p.getDate()+7);me(o,e,t,i,n),l=le(a,n,l,r),a=Oe(a,n.day),o=[]}}function he(e,i,n,r){var a=r.day,s=a.map(function(e){return Pt.test(e)});if(a.length>1&&s.indexOf(!0)>-1)return void de(e,i,n,r);if(r.month.length&&1===a.length&&s.indexOf(!0)>-1)return void ce(e,i,n,r);var o,l=new Date(e.getTime()),p=K(e,r),c=r.interval,h=[];for(r.month.length&&Be.setMonth(l,r.month[0],l.getDate()),t.isNullOrUndefined(r.setPosition)&&0===r.month.length&&0===r.weekNo.length&&l.setFullYear(e.getFullYear(),0,1),l=Oe(l=Be.getMonthStartDate(l),r.day);be(l,i);){for(o=new Date(l.getTime());Be.isSameYear(o,l)&&p&&n.length+r.recExceptionCount<=p;)for(o=new Date(l.getTime());Be.isSameYear(o,l);){if(!(0===r.month.length||r.month.length>0&&!Be.checkMonth(l,r.month))){Be.setValidDate(l,1,1),l=Oe(l,r.day);break}if(a.length>1){if(Be.compareMonth(o,l)){Be.setValidDate(l,1,1),l=Oe(l,r.day);break}a.indexOf(Ct[o.getDay()])>-1&&h.push([o.getTime()]),o.setDate(o.getDate()+1)}else{if(o.getFullYear()>l.getFullYear()){Be.setValidDate(l,1,1),l=Oe(l,r.day);break}var d=Ce(a[0]);Ct[o.getDay()]===d&&new Date(o.getFullYear(),o.getMonth(),0)>new Date(e.getFullYear())&&h.push([o.getTime()]),o.setDate(o.getDate()+7)}}if(l.setFullYear(o.getFullYear(),o.getMonth(),o.getDate()),me(h,e,i,n,r),Be.isLastMonth(l)&&(Be.setValidDate(l,1,1),l=Oe(l,r.day)),l.setFullYear(l.getFullYear()+c-1),p&&n.length+r.recExceptionCount>=p)return;l=Oe(l,r.day),h=[]}}function de(e,i,n,r){var a,s,o,l=r.day,p=K(e,r),c=new Date(e.getTime()),h=r.interval,d=[],u=[],g=0;c=Be.getMonthStartDate(c);var v=[];for(r.month.length&&Be.setMonth(c,r.month[0],1),c=Oe(c,r.day);be(c,i);){s=new Date(c.getTime());for(var m=0;m<=r.month.length;m++)for(var f=0;f<=l.length-1;f++){for(c=Oe(c=Be.getMonthStartDate(c),r.day),d=[];Be.isSameYear(s,c)&&p&&n.length+r.recExceptionCount<=p;)for(;Be.isSameYear(s,c);){if(s=new Date(c.getTime()),0===r.month.length||r.month.length>0&&r.month[parseInt(m.toString(),10)]===Be.getMonth(s)){var y=l[parseInt(f.toString(),10)].match(Nt),T=parseInt(y[0],10);for(o=new Date(c.getTime());Be.isSameYear(o,c)&&Be.isSameMonth(o,c);)y[y.length-1]===Ct[o.getDay()]&&d.push([o.getTime()]),o.setDate(o.getDate()+1);o.setDate(o.getDate()-1),a=y[0].indexOf("-")>-1?d.length- -1*T:T-1,a=isNaN(a)?0:a}g=le(c,r,g,void 0,1),c=Oe(c,r.day)}if(c=0===f&&o?new Date(o.getTime()):new Date(s.getTime()),d.length>0&&(t.isNullOrUndefined(r.setPosition)?De(d,void 0,e,i,n,r,a):u=[fe(d,a,v)]),p&&n.length+r.recExceptionCount>=p)return}t.isNullOrUndefined(r.setPosition)||(we(u,void 0,e,i,n,r),v=[]),Be.isLastMonth(c)?(Be.setValidDate(c,1,1),c.setFullYear(c.getFullYear()+h-1)):c.setFullYear(c.getFullYear()+h),c=Oe(c,r.day),r.month.length&&Be.setMonth(c,r.month[0],c.getDate())}}function ue(e,t){var i,n={monthCollection:[],index:0};if(1===t.length){var r=t[0].match(Nt),a=void 0;r.length>1?i=(a=parseInt(r[0],10))<1?e.length+a:a-1:(i=0,e=ve(e))}else i=0,e=ve(e);return n.monthCollection=e,n.index=i,n}function ge(e,i,n,r,a,s){var o=s.setPosition<1?e.length+s.setPosition:s.setPosition-1;t.isNullOrUndefined(s.setPosition)&&(o=0,e=ve(e)),e.length>0&&De(e,i,n,r,a,s,o)}function ve(e){for(var t=[],i=0;i<e.length;i++)for(var n=0;n<e[parseInt(i.toString(),10)].length;n++)t.push(new Date(e[parseInt(i.toString(),10)][parseInt(n.toString(),10)]).getTime());return e=t.length>0?[t]:[]}function me(e,t,i,n,r){var a=[],s=ue(e,r.day);e=s.monthCollection;var o=s.index;null!=r.setPosition?we([fe(e,o,a)],void 0,t,i,n,r):e.length>0&&De(e,void 0,t,i,n,r,o),a=[]}function fe(e,t,i){for(var n=0;n<e[parseInt(t.toString(),10)].length;n++)i.push(e[parseInt(t.toString(),10)][parseInt(n.toString(),10)]);return i}function ye(e,t,i,n,r,a){var s=K(t,r),o=new Date(a);e=Pe(o,r),o>=t&&be(o,i)&&e&&s&&n.length+r.recExceptionCount<s&&Q(n,a)}function Te(e,t,i,n,r){var a=t||0,s=new Date(e,r.month[0]-1,1),o=new Date(e,r.month[0],0).getDate(),l=(s.getDay()-a+7)%7+o,p=Math.ceil(l/7)-1,c=i[parseInt(n.toString(),10)][parseInt(p.toString(),10)];return Pe(new Date(c),r)?p:p-1}function we(e,t,i,n,r,a){if(e.length>0)for(var s=0;s<e.length;s++){e[parseInt(s.toString(),10)].sort();var o=a.day.map(function(e){return Pt.test(e)}),l="YEARLY"===a.freq&&a.validRules.indexOf("BYMONTH")>-1&&!(o.indexOf(!0)>-1)?Te(new Date(e[0][0]).getFullYear(),0,e,s,a):e[parseInt(s.toString(),10)].length+a.setPosition,p=a.setPosition<1?l:a.setPosition-1;ye(t,i,n,r,a,e[parseInt(s.toString(),10)][parseInt(p.toString(),10)])}}function De(e,i,n,r,a,s,o){if(e.length>0){o=t.isNullOrUndefined(o)?s.setPosition<1?e.length+s.setPosition:s.setPosition-1:o,e[parseInt(o.toString(),10)].sort();for(var l=0;l<e[parseInt(o.toString(),10)].length;l++)ye(i,n,r,a,s,e[parseInt(o.toString(),10)][parseInt(l.toString(),10)])}}function be(e,t){return!t||e<=t}function Ce(e){return e.replace(jt,"")}function Se(e,t){var i=[];return t.forEach(function(e){var t=e.match(Nt);2===t.length?i.push(t[1]):i.push(t[0])}),-1===i.indexOf(Ct[parseInt(e.toString(),10)])}function Oe(e,t){var i,n=new Date(e.getTime());if(t.length>0){for(var r=[],a=0;a<=t.length-1;a++)i=Ce(t[parseInt(a.toString(),10)]),r.push(i);if(-1===r.indexOf(Ct[n.getDay()]))do{n.setDate(n.getDate()+1)}while(-1===r.indexOf(Ct[n.getDay()]))}return n}function Ee(e){var t,i={freq:null,interval:1,count:null,until:null,day:[],wkst:null,month:[],weekNo:[],monthDay:[],yearDay:[],setPosition:null,validRules:[]},n=[];if(e.split(";").forEach(function(e){switch((n=e.split("="))[0]){case"UNTIL":t=n[1],i.until=X(t);break;case"BYDAY":i.day=n[1].split(","),i.validRules.push(n[0]);break;case"BYMONTHDAY":i.monthDay=n[1].split(",").map(Number),i.validRules.push(n[0]);break;case"BYMONTH":i.month=n[1].split(",").map(Number),i.validRules.push(n[0]);break;case"BYYEARDAY":i.yearDay=n[1].split(",").map(Number),i.validRules.push(n[0]);break;case"BYWEEKNO":i.weekNo=n[1].split(",").map(Number),i.validRules.push(n[0]);break;case"INTERVAL":i.interval=parseInt(n[1],10);break;case"COUNT":i.count=parseInt(n[1],10);break;case"BYSETPOS":i.setPosition=parseInt(n[1],10)>4?-1:parseInt(n[1],10);break;case"FREQ":i.freq=n[1];break;case"WKST":i.wkst=n[1]}}),"MONTHLY"===i.freq&&0===i.monthDay.length){var r=i.validRules.indexOf("BYDAY");i.validRules.splice(r,1)}return i}function xe(e,t,i){return t<=Be.getMonthDaysCount(e)&&e>=i}function Ve(e){var t={};return e.forEach(function(i,n){if(n===e.length-1){for(var r=bt.indexOf(i),a=r;a%7!==bt.indexOf(e[0]);)a++;t[""+i]=a-r}else t[""+i]=bt.indexOf(e[n+1])-bt.indexOf(i)}),t}function Ae(e,t){var i,n=t.slice(0),r=Be.getMonthDaysCount(e);for(i=n.shift();i;){if(i<0&&(i=i+r+1),i===e.getDate())return!1;i=n.shift()}return!0}function Ie(e,t){var i,n=t.slice(0),r=ke(e);for(i=n.shift();i;){if(i<0&&(i=i+Be.getYearDaysCount(e,0)+1),i===r)return!1;i=n.shift()}return!0}function ke(e){Dt[Be.getFullYear(e)]||(Dt[Be.getFullYear(e)]=Be.getYearLastDate(e,0));var t=Dt[Be.getFullYear(e)],i=e.getTime()-t.getTime();return Math.ceil(i/Qe)}function Me(e){return e.monthDay.length&&!e.day.length?"date":!e.monthDay.length&&e.day.length?"day":"both"}function Re(e){var t=e.shift();e.push(t)}function He(e){for(;bt[0]!==e;)Re(bt)}function Pe(e,t){var i=!0,n=t.day,r=t.month,a=Be.getExpectedDays(e,t.monthDay),s=t.yearDay;return t.validRules.forEach(function(t){switch(t){case"BYDAY":Se(e.getDay(),n)&&(i=!1);break;case"BYMONTH":Be.checkMonth(e,r)&&(i=!1);break;case"BYMONTHDAY":Ae(e,a)&&(i=!1);break;case"BYYEARDAY":Ie(e,s)&&(i=!1)}}),i}function je(e){return"Islamic"===e?new yt:new ft}function Ne(e){return[e.getUTCFullYear(),Le(e.getUTCMonth()+1),Le(e.getUTCDate()),"T",Le(e.getUTCHours()),Le(e.getUTCMinutes()),Le(e.getUTCSeconds()),"Z"].join("")}function Le(e){return("0"+e).slice(-2)}var qe,Fe,Ue,Be,We="actionBegin",ze="renderCell",Ye="inlineClick",_e="data-ready",Ge="content-ready",Xe="scroll-ui-update",Qe=864e5,Ke=6e4,Ze=null,Je=null,$e="e-schedule",et="e-icons",tt="e-table-container",it="e-schedule-table",nt="e-content-table",rt="e-popup-open",at="e-appointment-container",st="e-text-ellipsis",ot="e-schedule-form",lt="e-schedule-event-tooltip",pt="e-disable-dates",ct=function(){return(ct=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++){t=arguments[i];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)},ht=function(){function e(e){this.parent=e,this.l10n=this.parent.localeObj,this.renderHeader(),this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on("document-click",this.closeHeaderPopup,this)},e.prototype.removeEventListener=function(){this.parent.off("document-click",this.closeHeaderPopup)},e.prototype.closeHeaderPopup=function(e){var i=t.closest(e.event.target,".e-date-range,.e-header-popup,.e-day,.e-selected"),n=t.closest(e.event.target,".e-hor-nav,.e-toolbar-pop"),r=this.parent.element.querySelector(".e-content-wrap"),a=this.parent.element.querySelector(".e-toolbar-pop");if(this.parent.isAdaptive)if(t.isNullOrUndefined(n)||!n.classList.contains("e-toolbar-pop")&&!n.classList.contains("e-hor-nav")||n.classList.contains("e-hor-nav")&&a&&a.classList.contains(rt)){t.removeClass([r],"e-scroll-hidden");var s=this.element.querySelector(".e-toolbar-pop");if(!t.isNullOrUndefined(s)){var o=s.ej2_instances[0];!o||!t.isNullOrUndefined(n)&&n.classList.contains("e-hor-nav")&&s.classList.contains(rt)||o.hide()}}else t.addClass([r],"e-scroll-hidden");t.isNullOrUndefined(i)&&this.hideHeaderPopup()},e.prototype.hideHeaderPopup=function(){this.headerPopup&&this.headerPopup.hide()},e.prototype.renderHeader=function(){this.element=t.createElement("div",{className:"e-schedule-toolbar-container"});var e=t.createElement("div",{className:"e-schedule-toolbar"});this.element.appendChild(e),this.parent.element.insertBefore(this.element,this.parent.element.firstElementChild),this.renderToolbar()},e.prototype.renderToolbar=function(){var e=this,t=this.parent.toolbarItems&&this.parent.toolbarItems.length>0?this.getToolbarItems():this.getItems();this.parent.trigger(We,{requestType:"toolbarItemRendering",items:t},function(t){e.toolbarObj=new n.Toolbar({items:t.items,overflowMode:"Popup",clicked:e.toolbarClickHandler.bind(e),created:e.toolbarCreateHandler.bind(e),enableRtl:e.parent.enableRtl,enableHtmlSanitizer:e.parent.enableHtmlSanitizer,locale:e.parent.locale}),e.toolbarObj.isStringTemplate=!0,e.toolbarObj.root=e.parent.root?e.parent.root:e.parent,e.toolbarObj.appendTo(e.parent.element.querySelector(".e-schedule-toolbar")),e.toolbarObj.element.setAttribute("aria-label","Scheduler");var i=e.toolbarObj.element.querySelector(".e-prev");i&&i.firstElementChild.setAttribute("title",e.l10n.getConstant("previous"));var r=e.toolbarObj.element.querySelector(".e-next");r&&r.firstElementChild.setAttribute("title",e.l10n.getConstant("next")),e.updateAddIcon(),e.updateActiveView(),e.parent.trigger("actionComplete",{requestType:"toolBarItemRendered",items:e.toolbarObj.items})})},e.prototype.updateItems=function(){var e=this;if(this.toolbarObj){var t=this.getItems();this.parent.trigger(We,{requestType:"toolbarItemRendering",items:t},function(t){e.toolbarObj.items=t.items,e.toolbarObj.dataBind(),e.parent.trigger("actionComplete",{requestType:"toolBarItemRendered",items:e.toolbarObj.items})})}},e.prototype.getPopUpRelativeElement=function(){return this.parent.isAdaptive?this.toolbarObj.element:this.element.querySelector(".e-date-range")},e.prototype.setDayOfWeek=function(e){this.headerCalendar&&(this.headerCalendar.firstDayOfWeek=e,this.headerCalendar.dataBind())},e.prototype.setCalendarDate=function(e){this.headerCalendar&&(this.headerCalendar.value=e,this.headerCalendar.dataBind())},e.prototype.setCalendarMinMaxDate=function(){this.headerCalendar&&(this.headerCalendar.min=this.parent.minDate,this.headerCalendar.max=this.parent.maxDate,this.headerCalendar.dataBind())},e.prototype.getCalendarView=function(){return["Month","MonthAgenda","TimelineMonth"].indexOf(this.parent.currentView)>-1?"Year":["Year","TimelineYear"].indexOf(this.parent.currentView)>-1?"Decade":"Month"},e.prototype.setCalendarView=function(){if(this.headerCalendar){var e=this.getCalendarView();this.headerCalendar.depth=e,this.headerCalendar.start=e,this.headerCalendar.refresh()}},e.prototype.updateActiveView=function(){var e=[].slice.call(this.toolbarObj.element.querySelectorAll(".e-views"));t.removeClass(e,["e-active-view"]),e.length>0&&e[this.parent.viewIndex]&&t.addClass([e[this.parent.viewIndex]],["e-active-view"])},e.prototype.updateDateRange=function(e){var i=this.toolbarObj.element.querySelector(".e-date-range");if(i){i.firstElementChild.setAttribute("aria-haspopup","true");var n=i.querySelector(".e-tbar-btn-text");if(this.parent.activeViewOptions.dateRangeTemplate){n.textContent="";var r={startDate:this.parent.activeView.getStartDate(),endDate:this.parent.activeView.getEndDate(),currentView:this.parent.currentView},a=this.parent.activeViewOptions.dateRangeTemplateName,s=this.parent.element.id+"_"+a+"dateRangeTemplate",o=[].slice.call(this.parent.getDateRangeTemplate()(r,this.parent,"dateRangeTemplate",s,!1,void 0,void 0,this.parent.root));t.append(o,n)}else{var l=this.parent.activeView.getDateRangeText(e);i.firstElementChild.setAttribute("aria-label",l),n.textContent=l}this.refresh()}},e.prototype.refresh=function(){this.toolbarObj&&this.toolbarObj.refreshOverflow()},e.prototype.updateAddIcon=function(){var e=this.toolbarObj.element.querySelector(".e-add");e&&(this.parent.eventSettings.allowAdding?t.removeClass([e],"e-hidden"):t.addClass([e],"e-hidden"))},e.prototype.getDateRangeText=function(){return U(this.parent.globalize.formatDate(this.parent.selectedDate,{format:"MMMM y",calendar:this.parent.getCalendarMode()}),"single")},e.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},e.prototype.getToolbarItems=function(){for(var e,i=[],n=0,r=this.parent.toolbarItems;n<r.length;n++){var a=r[n];e=this.getItemModel(a);var s=void 0;if(a.name)switch(a.name){case"Today":(s={showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-today",text:this.l10n.getConstant("today"),cssClass:"e-today",overflow:"Show"}).align=e.align?e.align:a.align,i.push(ct({},s,e));break;case"Previous":(s={prefixIcon:"e-icon-prev",tooltipText:"Previous",overflow:"Show",cssClass:"e-prev",htmlAttributes:{role:"navigation"}}).align=e.align?e.align:a.align,i.push(ct({},s,e));break;case"Next":(s={prefixIcon:"e-icon-next",tooltipText:"Next",overflow:"Show",cssClass:"e-next",htmlAttributes:{role:"navigation"}}).align=e.align?e.align:a.align,i.push(ct({},s,e));break;case"DateRangeText":(s={text:this.getDateRangeText(),suffixIcon:"e-icon-down-arrow",cssClass:"e-date-range",overflow:"Show",htmlAttributes:{"aria-atomic":"true","aria-live":"assertive",role:"navigation"}}).align=e.align?e.align:a.align,i.push(ct({},s,e));break;case"NewEvent":(s={showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-add",text:this.l10n.getConstant("newEvent"),cssClass:"e-add",overflow:"Show"}).align=e.align?e.align:a.align,i.push(ct({},s,e));break;case"Views":if(!t.isNullOrUndefined(this.parent.views)&&this.parent.views.length>1)for(var o=0,l=this.parent.views;o<l.length;o++){var p=l[o];(s=this.getItemObject(p)).align=e.align?e.align:a.align,i.push(ct({},s,e))}break;case"Custom":i.push(a)}else i.push(a)}return i},e.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"}),!t.isNullOrUndefined(this.parent.views)&&this.parent.views.length>1&&e.push({align:"Right",type:"Separator",cssClass:"e-schedule-seperator"})),!t.isNullOrUndefined(this.parent.views)&&this.parent.views.length>1)for(var i=0,n=this.parent.views;i<n.length;i++){var r=n[i];e.push(this.getItemObject(r))}return e},e.prototype.getItemObject=function(e){var t,i;"string"==typeof e?(t=e.toLowerCase(),i=null):(t=e.option.toLowerCase(),i=e.displayName);var n,r=this.parent.isAdaptive||this.parent.enableAdaptiveUI;switch(t){case"day":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-day",text:i||this.l10n.getConstant("day"),cssClass:"e-views e-day"};break;case"week":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-week",text:i||this.l10n.getConstant("week"),cssClass:"e-views e-week"};break;case"workweek":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-workweek",text:i||this.l10n.getConstant("workWeek"),cssClass:"e-views e-work-week"};break;case"month":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-month",text:i||this.l10n.getConstant("month"),cssClass:"e-views e-month"};break;case"year":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-year",text:i||this.l10n.getConstant("year"),cssClass:"e-views e-year"};break;case"agenda":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-agenda",text:i||this.l10n.getConstant("agenda"),cssClass:"e-views e-agenda"};break;case"monthagenda":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-month-agenda",text:i||this.l10n.getConstant("monthAgenda"),cssClass:"e-views e-month-agenda"};break;case"timelineday":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-day",text:i||this.l10n.getConstant("timelineDay"),cssClass:"e-views e-timeline-day"};break;case"timelineweek":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-week",text:i||this.l10n.getConstant("timelineWeek"),cssClass:"e-views e-timeline-week"};break;case"timelineworkweek":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-workweek",text:i||this.l10n.getConstant("timelineWorkWeek"),cssClass:"e-views e-timeline-work-week"};break;case"timelinemonth":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-month",text:i||this.l10n.getConstant("timelineMonth"),cssClass:"e-views e-timeline-month"};break;case"timelineyear":n={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-year-"+("Vertical"===e.orientation?"vertical":"horizontal"),text:i||this.l10n.getConstant("timelineYear"),cssClass:"e-views e-timeline-year"}}return n},e.prototype.renderHeaderPopup=function(){var e=t.createElement("div",{className:"e-header-popup"}),n=t.createElement("div",{className:"e-header-calendar"});e.appendChild(n),this.element.appendChild(e),this.headerPopup=new i.Popup(e,{actionOnScroll:"hide",targetType:"relative",relateTo:this.getPopUpRelativeElement(),position:{X:"left",Y:"bottom"},collision:{X:"fit"},viewPortElement:this.element,enableRtl:this.parent.enableRtl});var a=this.getCalendarView(),s="Month"===this.parent.currentView&&!t.isNullOrUndefined(this.parent.activeViewOptions.displayDate)&&!this.hasSelectedDate();this.headerCalendar=new r.Calendar({value:s?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:a,start:a,calendarMode:this.parent.calendarMode,change:this.calendarChange.bind(this)}),this.setCalendarTimezone(),this.headerCalendar.appendTo(n),this.headerPopup.hide()},e.prototype.calendarChange=function(e){if(e.value.getTime()!==this.parent.selectedDate.getTime()){var t=b(new Date(e.value));this.parent.changeDate(t)}this.headerPopup.hide()},e.prototype.setCalendarTimezone=function(){this.headerCalendar&&(this.headerCalendar.timezone=this.parent.timezone||this.parent.tzModule.getLocalTimezoneName())},e.prototype.calculateViewIndex=function(e){var i=t.closest(e.originalEvent.target,".e-views");return[].slice.call(this.element.querySelectorAll(".e-views")).indexOf(i)},e.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())},e.prototype.toolbarClickHandler=function(e){if(e.item){var i,n,r;switch(e.item.cssClass.replace("e-views ","")){case"e-date-range":this.headerPopup||this.renderHeaderPopup(),this.headerPopup.element.classList.contains(rt)?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=b(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()&&b(this.parent.activeViewOptions.displayDate)!==r||"Month"===this.parent.currentView&&this.parent.activeViewOptions.numberOfWeeks>0&&!this.hasSelectedDate()&&b(f(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":if(n=this.parent.activeCellsData.startTime.getTime()===this.parent.activeCellsData.endTime.getTime(),this.parent.activeCellsData&&!n)i=this.parent.activeCellsData;else{var a=this.parent.activeViewOptions.timeScale.interval,s=this.parent.activeViewOptions.timeScale.slotCount,o=a*Ke/s,l=new Date(this.parent.selectedDate.getTime()),p=this.parent.getCurrentTime();l.setHours(p.getHours(),Math.round(l.getMinutes()/o)*o,0),i={startTime:l,endTime:new Date(new Date(l.getTime()).setMilliseconds(l.getMilliseconds()+o)),isAllDay:!1}}this.parent.eventWindow.openEditor(t.extend(i,{cancel:!1,event:e.originalEvent}),"Add")}if(!t.isNullOrUndefined(this.toolbarObj)){var c=this.toolbarObj.element.querySelector(".e-toolbar-pop");c&&"Input"!==e.item.type&&c.ej2_instances[0].hide({name:"SlideUp",duration:100})}}},e.prototype.hasSelectedDate=function(){var e=b(this.parent.selectedDate).getTime();return e>=this.parent.activeView.getStartDate().getTime()&&e<=this.parent.activeView.getEndDate().getTime()},e.prototype.getHeaderElement=function(){return this.toolbarObj.element},e.prototype.updateHeaderItems=function(e){var i=this.toolbarObj.element.querySelector(".e-prev"),n=this.toolbarObj.element.querySelector(".e-next"),r=this.toolbarObj.element.querySelector(".e-date-range");i&&("add"===e?t.addClass([i],"e-hidden"):t.removeClass([i],"e-hidden")),n&&("add"===e?t.addClass([n],"e-hidden"):t.removeClass([n],"e-hidden")),r&&("add"===e?t.addClass([r],st):t.removeClass([r],st))},e.prototype.previousNextIconHandler=function(){var e="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(e[0].getTime()),a=new Date(e[e.length-1].getTime());if("WorkWeek"===this.parent.currentView||"TimelineWorkWeek"===this.parent.currentView)a=O(r=v(b(this.parent.selectedDate),this.parent.activeViewOptions.firstDayOfWeek),7*this.parent.activeViewOptions.interval);else if("Month"===this.parent.currentView){var s=!t.isNullOrUndefined(this.parent.activeViewOptions.displayDate)||this.parent.activeViewOptions.numberOfWeeks>0;r=s?this.parent.activeView.getStartDate():f(this.parent.selectedDate),a=s?this.parent.activeView.getEndDate():y(E(r,this.parent.activeViewOptions.interval-1))}t.isNullOrUndefined(i)||this.toolbarObj.enableItems(i,r>b(this.parent.minDate)),t.isNullOrUndefined(n)||this.toolbarObj.enableItems(n,a<b(this.parent.maxDate)),this.setCalendarMinMaxDate()},e.prototype.getModuleName=function(){return"headerbar"},e.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(),t.remove(this.element),this.toolbarObj=null),this.element=null,this.parent=null,this.l10n=null},e}(),dt=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.getModuleName=function(){return"scroll"},e.prototype.setWidth=function(){this.parent.element.style.width=t.formatUnit(this.parent.width)},e.prototype.setHeight=function(){this.parent.element.style.height=t.formatUnit(this.parent.height)},e.prototype.addEventListener=function(){this.parent.on(Ge,this.setDimensions,this),this.parent.on("ui-update",this.onPropertyChanged,this)},e.prototype.removeEventListener=function(){this.parent.off(Ge,this.setDimensions),this.parent.off("ui-update",this.onPropertyChanged)},e.prototype.setDimensions=function(){this.setWidth(),this.setHeight();var e={cssProperties:this.parent.getCssProperties(),module:this.getModuleName()};this.parent.notify(Xe,e)},e.prototype.onPropertyChanged=function(){this.setDimensions()},e.prototype.destroy=function(){this.removeEventListener()},e}(),ut=function(){function e(e){this.parent=e,this.element=this.parent.element.querySelector("."+tt),this.touchObj=new t.Touch(this.element,{scroll:this.scrollHandler.bind(this),swipe:this.swipeHandler.bind(this),tapHold:this.tapHoldHandler.bind(this),swipeSettings:{swipeThresholdDistance:1}}),t.EventHandler.add(this.element,"transitionend",this.onTransitionEnd,this),this.touchLeftDirection=this.parent.enableRtl?"Right":"Left",this.touchRightDirection=this.parent.enableRtl?"Left":"Right"}return e.prototype.scrollHandler=function(e){t.isNullOrUndefined(this.parent.eventTooltip)||this.parent.eventTooltip.close();var i=!this.parent.isAdaptive&&e.originalEvent&&e.originalEvent.target&&!t.isNullOrUndefined(t.closest(e.originalEvent.target,".e-appointment"));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("e-translate")&&this.onTransitionEnd(),"Left"===e.scrollDirection||"Right"===e.scrollDirection){var n={requestType:"dateNavigate",cancel:!1,event:e.originalEvent};if(this.parent.trigger(We,n),n.cancel)return;var r=this.element.querySelector(".e-content-wrap");if(r&&r.scrollWidth>r.clientWidth)return;this.isScrollTriggered=!0,e.originalEvent.preventDefault(),e.originalEvent.stopPropagation()}if(e.scrollDirection===this.touchLeftDirection){this.nextPanel||(this.renderPanel("e-next-panel","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));s=this.parent.enableRtl?e.distanceX:-e.distanceX;this.element.style.transform="translatex("+(this.getTranslateX(this.element)+s)+"px)"}else if(e.scrollDirection===this.touchRightDirection){var a=0;this.previousPanel||(this.renderPanel("e-previous-panel","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),a=this.previousPanel.element.offsetWidth);var s=this.parent.enableRtl?a-e.distanceX:-a+e.distanceX;this.element.style.transform="translatex("+(this.getTranslateX(this.element)+s)+"px)"}}},e.prototype.swipeHandler=function(e){if(this.isScrollTriggered&&!this.parent.uiStateValues.action&&this.parent.allowSwiping&&!this.parent.uiStateValues.isTapHold){this.isScrollTriggered=!1;var i="Left"===e.swipeDirection?this.parent.activeView.renderDates[0]:this.parent.activeView.renderDates.slice(-1)[0];if("Left"===e.swipeDirection&&i<this.parent.maxDate||"Right"===e.swipeDirection&&i>=this.parent.minDate){var n=Date.now()-this.timeStampStart,r=e.distanceX*(t.Browser.isDevice?6:1.66);r>n||e.distanceX>this.parent.element.offsetWidth/2?(this.swapPanels(e.swipeDirection),r>n&&e.distanceX>this.parent.element.offsetWidth/2&&(this.element.style.transitionDuration=(t.Browser.isDevice?e.distanceX:r)/n/10+"s"),this.confirmSwipe(e.swipeDirection)):this.cancelSwipe();var a={requestType:"dateNavigate",cancel:!1,event:e.originalEvent};this.parent.trigger("actionComplete",a)}else this.cancelSwipe();this.timeStampStart=null}},e.prototype.tapHoldHandler=function(e){var i=t.closest(e.originalEvent.target,".e-appointment");t.isNullOrUndefined(i)||(this.parent.uiStateValues.isTapHold=!0,this.parent.isAdaptive?(t.Browser.isIos&&t.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(i),this.triggerResizeStart(e.originalEvent)))},e.prototype.triggerResizeStart=function(e){this.parent.resizeModule&&t.closest(e.target,".e-event-resize")&&this.parent.resizeModule.resizeStart(e)},e.prototype.preventEventClick=function(e){e.preventDefault(),t.EventHandler.remove(this.element,"touchend",this.preventEventClick)},e.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)},e.prototype.swapPanels=function(e){if(e===this.touchLeftDirection){t=this.nextPanel;this.nextPanel=this.currentPanel,this.currentPanel=t}else{var t=this.previousPanel;this.previousPanel=this.currentPanel,this.currentPanel=t}},e.prototype.confirmSwipe=function(e){var i=this,n={action:"date",cancel:!1,previousDate:e===this.touchLeftDirection?this.nextPanel.selectedDate:this.previousPanel.selectedDate,currentDate:this.currentPanel.selectedDate};this.parent.trigger("navigating",n,function(n){if(n.cancel)i.swapPanels(e),i.cancelSwipe();else{i.parent.activeView.setPanel(i.currentPanel.element),i.parent.setProperties({selectedDate:i.currentPanel.selectedDate},!0);var r=void 0;r=i.parent.enableRtl?e===i.touchLeftDirection?i.previousPanel?i.previousPanel.element.offsetLeft:i.currentPanel.element.offsetWidth:0:e===i.touchLeftDirection?-i.currentPanel.element.offsetLeft:0,i.parent.activeView.renderDates=i.currentPanel.renderDates,i.parent.activeView.colLevels=i.currentPanel.colLevels,t.addClass([i.element],"e-translate"),i.element.style.transform="translatex("+r+"px)",i.parent.headerModule&&i.parent.headerModule.updateDateRange(),i.parent.renderTemplates(),i.parent.crudModule.refreshDataManager()}})},e.prototype.cancelSwipe=function(){var e=this;if(this.parent.activeView.setPanel(this.currentPanel.element),this.parent.setProperties({selectedDate:this.currentPanel.selectedDate},!0),this.parent.activeView.renderDates=this.currentPanel.renderDates,this.parent.activeViewOptions.group.resources.length>0&&this.parent.resourceBase.lastResourceLevel.length>0){var i=this.parent.resourceBase.resourceCollection[0].workDaysField;this.parent.resourceBase.lastResourceLevel.forEach(function(t){if(i){var n=t[i],r=Array.isArray(n)&&(!e.parent.showWeekend||"WorkWeek"===e.parent.currentView);t.renderDates=r?e.calculateResourceSpecificDates(t,i):e.currentPanel.renderDates}else t.renderDates=e.currentPanel.renderDates})}this.parent.activeView.colLevels=this.currentPanel.colLevels,t.addClass([this.element],"e-translate");var n=this.previousPanel?this.previousPanel.element.offsetWidth:0;this.element.style.transform="translatex("+(this.parent.enableRtl?n:-this.currentPanel.element.offsetLeft)+"px)"},e.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},e.prototype.onTransitionEnd=function(){(t.isNullOrUndefined(this.element)||this.element.classList.contains("e-translate"))&&(this.parent.uiStateValues.isSwipeScroll=!1,t.removeClass([this.element],"e-translate"),this.element.style.transitionDuration="",this.element.style.transform="",this.previousPanel&&(t.remove(this.previousPanel.element),this.previousPanel=null,t.removeClass([this.currentPanel.element],"e-previous-panel"),t.addClass([this.currentPanel.element],"e-current-panel")),this.nextPanel&&(t.remove(this.nextPanel.element),this.nextPanel=null,t.removeClass([this.currentPanel.element],"e-next-panel"),t.addClass([this.currentPanel.element],"e-current-panel")),this.currentPanel=null,this.parent.activeView.getPanel().style.width="")},e.prototype.getTranslateX=function(e){var t=window.getComputedStyle(e);return new WebKitCSSMatrix(t.webkitTransform).m41},e.prototype.setDimensions=function(e){e.style.width=this.parent.element.clientWidth+"px"},e.prototype.resetValues=function(){this.currentPanel=null,this.previousPanel=null,this.nextPanel=null,this.timeStampStart=null,this.element.style.transform="",this.element.style.transitionDuration="",j(this.element),t.removeClass([this.element],"e-translate")},e.prototype.destroy=function(){this.touchObj&&(this.touchObj.destroy(),this.touchObj=null),t.EventHandler.remove(this.element,"transitionend",this.onTransitionEnd),this.resetValues()},e}(),gt=function(){return(gt=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++){t=arguments[i];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)},vt=function(){function e(e){this.selectedCells=[],this.isCutContentPasted=!1,this.isCutAction=!1,this.keyConfigs={downArrow:"downarrow",upArrow:"uparrow",rightArrow:"rightarrow",leftArrow:"leftarrow",shiftDownArrow:"shift+downarrow",shiftUpArrow:"shift+uparrow",shiftRightArrow:"shift+rightarrow",shiftLeftArrow:"shift+leftarrow",ctrlLeftArrow:"ctrl+leftarrow",ctrlRightArrow:"ctrl+rightarrow",altOne:"alt+1",altTwo:"alt+2",altThree:"alt+3",altFour:"alt+4",altFive:"alt+5",altSix:"alt+6",altSeven:"alt+7",altEight:"alt+8",altNine:"alt+9",enter:"enter",escape:"escape",delete:"delete",backspace:"backspace",home:"home",pageUp:"pageup",pageDown:"pagedown",tab:"tab",shiftTab:"shift+tab",ctrlShiftUpArrow:"ctrl+shift+uparrow",ctrlShiftDownArrow:"ctrl+shift+downarrow",ctrlShiftLeftArrow:"ctrl+shift+leftarrow",ctrlShiftRightArrow:"ctrl+shift+rightarrow",shiftAltY:"shift+alt+y",shiftAltN:"shift+alt+n",cut:"ctrl+x",copy:"ctrl+c",cmdCut:"cmd+x",cmdCopy:"cmd+c"},this.parent=e,this.parent.element.tabIndex=-1===this.parent.element.tabIndex?0:this.parent.element.tabIndex,this.keyboardModule=new t.KeyboardEvents(this.parent.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.addEventListener(),this.createClipboardElement()}return e.prototype.keyActionHandler=function(e){var t=e.target;if(!("home"===e.action&&t&&["INPUT","TEXTAREA","SELECT"].indexOf(t.tagName)>-1&&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":if("Agenda"===this.parent.currentView||"MonthAgenda"===this.parent.currentView||"Year"===this.parent.currentView)return;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)}},e.prototype.processShiftAltN=function(e){var i=this.parent.getSelectedCells(),n=e.target,r=t.extend({},null,!0);if(i.length>0&&(t.closest(n,".e-work-cells")||t.closest(n,".e-all-day-cells")||t.closest(n,".e-header-cells")))r=this.getSelectedElements(n);else if(t.closest(n,".e-appointment")&&!t.isNullOrUndefined(this.parent.activeEventData.event)){var a=this.parent.activeEventData.event;r.startTime=a.StartTime,r.endTime=a.EndTime,r.isAllDay=a.IsAllDay}else{var s=this.parent.getStartEndTime(this.parent.workHours.start),o=this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount;r.startTime=new Date(this.parent.selectedDate),r.startTime.setHours(s.getHours(),s.getMinutes(),0,0),r.endTime=new Date(r.startTime.getTime()+6e4*o)}var l=t.extend(r,{cancel:!1,event:e});null!=l&&this.parent.eventWindow.openEditor(l,"Add")},e.prototype.processFTwelve=function(e){var i=e.target;if(i.classList.contains("e-work-cells")||i.classList.contains("e-all-day-cells")){this.parent.activeCellsData=this.getSelectedElements(i);var n=t.extend(this.parent.activeCellsData,{cancel:!1,event:e}),r={element:n.element,groupIndex:n.groupIndex,type:"Cell"};this.parent.notify(Ye,r)}if(i.classList.contains("e-appointment"))return void i.click()},e.prototype.addEventListener=function(){this.parent.on("cell-mouse-down",this.onCellMouseDown,this),this.parent.allowClipboard&&this.parent.on("document-paste",this.pasteHandler,this)},e.prototype.removeEventListener=function(){this.parent.off("cell-mouse-down",this.onCellMouseDown),this.parent.off("document-paste",this.pasteHandler)},e.prototype.onCellMouseDown=function(e){if(!e.event.shiftKey&&(this.initialTarget=this.getClosestCell(e.event),!this.parent.activeViewOptions.readonly&&"MonthAgenda"!==this.parent.currentView&&this.initialTarget&&(e.event.target.classList.contains("e-work-cells")&&3!==e.event.which&&(this.parent.removeSelectedClass(),t.EventHandler.add(this.parent.getContentTable(),"mousemove",this.onMouseSelection,this),t.EventHandler.add(this.parent.getContentTable(),"mouseup mouseleave",this.onMoveUp,this)),e.event.target.classList.contains("e-all-day-cells")&&3!==e.event.which))){this.parent.removeSelectedClass();var i=this.parent.getAllDayRow();t.EventHandler.add(i,"mousemove",this.onMouseSelection,this),t.EventHandler.add(i,"mouseup mouseleave",this.onMoveUp,this)}},e.prototype.onMouseSelection=function(e){var i=[].slice.call(this.parent.element.querySelectorAll(".e-appointment"));t.addClass(i,"e-allow-select");var n=this.parent.boundaryValidation(e.pageY,e.pageX);if(n.bottom||n.top||n.left||n.right){var r=this.parent.element.querySelector(".e-content-wrap"),a=r.offsetHeight<=r.scrollHeight&&r.scrollTop>=0&&r.scrollTop+r.offsetHeight<=r.scrollHeight,s=r.offsetWidth<=r.scrollWidth&&r.scrollLeft>=0&&r.scrollLeft+r.offsetWidth<=r.scrollWidth;a&&(n.top||n.bottom)&&(r.scrollTop+=n.top?-e.target.offsetHeight:e.target.offsetHeight),s&&(n.left||n.right)&&(r.scrollLeft+=n.left?-e.target.offsetWidth:e.target.offsetWidth)}var o=this.getClosestCell(e);o&&this.selectCells(!0,o)},e.prototype.getClosestCell=function(e){return t.closest(e.target,".e-work-cells,.e-all-day-cells")},e.prototype.onMoveUp=function(e){var i=this,n=[].slice.call(this.parent.element.querySelectorAll(".e-appointment"));if(t.removeClass(n,"e-allow-select"),t.EventHandler.remove(this.parent.getContentTable(),"mousemove",this.onMouseSelection),t.EventHandler.remove(this.parent.getContentTable(),"mouseup mouseleave",this.onMoveUp),e.target.classList.contains("e-all-day-cells")){var r=this.parent.getAllDayRow();t.EventHandler.remove(r,"mousemove",this.onMouseSelection),t.EventHandler.remove(r,"mouseup mouseleave",this.onMoveUp)}if(!this.isPreventAction(e)){var a=t.closest(e.target,".e-work-cells,.e-all-day-cells,.e-header-cells");if(a){var s=this.parent.getSelectedCells();if(s.length>0&&-1===s.indexOf(a)&&(a=s[s.length-1]),"TimelineYear"!==this.parent.currentView||!a.classList.contains("e-other-month")){this.parent.activeCellsData=this.getSelectedElements(a);var o={};this.parent.eventWindow&&this.parent.eventWindow.convertToEventData(this.parent.activeCellsData,o);var l={data:o,element:this.parent.activeCellsData.element,event:e,requestType:"cellSelect",showQuickPopup:!1};this.parent.trigger("select",l,function(n){if((n.showQuickPopup||i.parent.quickInfoOnSelectionEnd)&&s.length>1){var r=t.extend(i.parent.activeCellsData,{cancel:!1,event:e,name:"cellClick"});i.parent.notify("cellClick",r)}})}}}},e.prototype.processEnter=function(e){if(!(this.parent.activeViewOptions.readonly&&!e.target.classList.contains("e-appointment")||this.isPreventAction(e)||"TimelineYear"===this.parent.currentView&&e.target.classList.contains("e-other-month"))){var i=e.target;if(t.closest(i,".e-quick-popup-wrapper"))return void(i.classList.contains("e-event-details")||i.classList.contains("e-event-create")||i.classList.contains("e-event-edit")||i.classList.contains("e-event-delete")||i.classList.contains("e-close")?(i.click(),e.preventDefault()):i.classList.contains("e-subject")&&(this.parent.element.querySelector(".e-event-create").click(),e.preventDefault()));if(i.classList.contains("e-resource-cells")&&i.classList.contains("e-parent-node")){var n=i.querySelector(".e-resource-tree-icon");return void(n&&n.click())}if(!i.classList.contains("e-work-cells")&&!i.classList.contains("e-all-day-cells"))return i.classList.contains("e-inline-subject")&&this.parent.inlineModule?void this.parent.inlineModule.inlineCrudActions(i):i.classList.contains("e-appointment")||i.classList.contains("e-more-event-close")||i.classList.contains("e-all-day-appointment-section")||i.classList.contains("e-more-indicator")?void i.click():i.classList.contains("e-header-date")?(this.parent.setProperties({selectedDate:this.parent.getDateFromElement(i)},!0),this.parent.changeView(this.parent.getNavigateView(),e),void this.processEscape(e)):void 0;this.parent.activeCellsData=this.getSelectedElements(i);var r=t.extend(this.parent.activeCellsData,{cancel:!1,event:e});if(this.parent.allowInline){var a={element:r.element,groupIndex:r.groupIndex,type:"Cell"};this.parent.notify(Ye,a)}else"Year"===this.parent.currentView?i.click():this.parent.notify("cellClick",r)}},e.prototype.getSelectedElements=function(e){var t;if(this.selectedCells.length>1&&e.classList.contains("e-selected-cell")){var i=this.parent.getCellDetails(this.selectedCells[0]),n=this.parent.getCellDetails(this.selectedCells.slice(-1)[0]);i.endTime=n.endTime,i.element=e,t=i}else t=this.parent.getCellDetails(e);return t},e.prototype.getCells=function(e,t,i){var n=this.parent.getContentTable(),r="TimelineYear"===this.parent.currentView,a=r&&!e?".e-work-cells:not(.e-other-month)":"td",s=[].slice.call(n.querySelectorAll(a)),o=n.rows.length,l=n.rows[0].cells.length;if(t&&t.classList.contains("e-all-day-cells")){var p=this.parent.getAllDayRow();s=[].slice.call(p.cells),o=1,l=p.cells.length}var c=s.indexOf(t),h=s.indexOf(i),d=[];if(e){for(var u=0;u<l;u++)for(var g=0;g<o;g++){var v=s[l*g+u];r&&v.classList.contains("e-other-month")||d.push(v)}c=d.indexOf(t),h=d.indexOf(i)}if(c>h){var m=c;c=h,h=m}return(e?d:s).slice(c,h+1)},e.prototype.focusFirstCell=function(){if("Agenda"===this.parent.currentView){var e=this.parent.getContentTable().querySelector(".e-agenda-cells");return e.setAttribute("tabindex","0"),void e.focus()}if(this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.activeView.isTimelineView()&&"TimelineYear"!==this.parent.currentView){var t=this.parent.element.querySelector("."+nt+" tr:not(.e-hidden) .e-work-cells:not(.e-resource-group-cells)");this.selectCells(!1,t)}else if(this.parent.currentView.indexOf("Year")>-1){var i=".e-work-cells:not(.e-other-month):not(.e-resource-group-cells)";i+="TimelineYear"===this.parent.currentView&&"Vertical"===this.parent.activeViewOptions.orientation?'[data-date="'+this.parent.activeView.startDate().getTime()+'"]':"",this.selectCells(!1,this.parent.element.querySelector(i))}else this.selectCells(!1,this.parent.getWorkCellElements()[0])},e.prototype.isInverseTableSelect=function(){return this.parent.activeView.isInverseTableSelect},e.prototype.selectCells=function(e,t){var i=this;this.parent.removeSelectedClass();var n=t instanceof Array?t.slice(-1)[0]:t;if(e){var r,a=["Day","Week","WorkWeek","TimelineDay","TimelineWeek","TimelineWorkWeek","TimelineMonth","TimelineYear"],s={element:t,requestType:"mousemove",allowMultipleRow:!0};this.parent.inlineModule.removeInlineAppointmentElement(),this.parent.trigger("select",s,function(e){if(!e.allowMultipleRow||!i.parent.allowMultiRowSelection){var t="TimelineYear"===i.parent.currentView;if(t&&"Horizontal"===i.parent.activeViewOptions.orientation||"Month"===i.parent.currentView){var s=t&&i.parent.activeViewOptions.group.resources.length>0;n=s?i.initialTarget:i.initialTarget.parentElement.children[n.cellIndex]}else a.indexOf(i.parent.currentView)>-1&&(n=n.parentElement.children[i.initialTarget.cellIndex])}var o=i.getCells(i.isInverseTableSelect(),i.initialTarget,n);if(i.parent.activeViewOptions.group.resources.length>0){r=i.initialTarget.getAttribute("data-group-index");for(var l=[],p=0,c=o;p<c.length;p++)(v=c[p]).getAttribute("data-group-index")===r&&l.push(v);o=l}if(i.parent.allowMultiCellSelection||(o=[i.initialTarget]),i.selectedCells=o,o.length>2&&!n.classList.contains("e-all-day-cells")){var h=i.getAllDayCells(o);if(i.parent.activeViewOptions.group.resources.length>0){for(var d=[],u=0,g=h;u<g.length;u++){var v=g[u];v.getAttribute("data-group-index")===r&&d.push(v)}h=d}o=o.concat(h)}n.getAttribute("data-group-index")!==r&&i.parent.activeViewOptions.group.resources.length>0&&(n=i.selectedCells[i.selectedCells.length-1]),i.parent.addSelectedClass(o,n)})}else{s={element:n,requestType:"cellSelect"};this.parent.trigger("select",s,function(){i.initialTarget=n,i.selectedCells=[n],i.parent.addSelectedClass([n],n)})}},e.prototype.selectAppointment=function(e,i){var n=this.getAppointmentElements();if(!(n.length<0)){this.parent.eventBase.removeSelectedAppointmentClass();var r;if(i.classList.contains("e-appointment")){var a=n.indexOf(i);r=n[e?a-1:a+1]}else r=e?n[n.length-1]:n[0];r&&(this.parent.eventBase.addSelectedAppointments([r],!0),r.focus(),t.addClass([r],"e-active-appointment-agenda"))}},e.prototype.selectAppointmentElementFromWorkCell=function(e,t){var i=this;if(this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.removeSelectedClass(),t.classList.contains("e-work-cells")||t.classList.contains("e-all-day-cells")){var n=this.getUniqueAppointmentElements(),r=[],a=this.parent.getDateFromElement(t).getTime();if(this.parent.eventsProcessed.filter(function(t){return e?t[i.parent.eventFields.startTime].getTime()<=a:t[i.parent.eventFields.startTime].getTime()>=a}).filter(function(e){n.filter(function(t){JSON.stringify(e.Guid)===JSON.stringify(t.getAttribute("data-guid"))&&r.push(t)})}),r.length>0){var s=e?r[r.length-1]:r[0],o=this.getAppointmentElementsByGuid(s.getAttribute("data-guid"));this.parent.eventBase.addSelectedAppointments(o,!0),o[o.length-1].focus()}}},e.prototype.getAllDayCells=function(e){var t=this.parent.getAllDayRow();if(!t)return[];var i=e[0],n=e[e.length-1],r=this.parent.getCellDetails(i);return this.parent.getCellDetails(n).endTime.getTime()-r.startTime.getTime()>=Qe?[].slice.call(t.cells).slice(i.cellIndex,n.cellIndex+1):[]},e.prototype.getAppointmentElements=function(){return[].slice.call(this.parent.element.querySelectorAll(".e-appointment"))},e.prototype.getAppointmentElementsByGuid=function(e){return[].slice.call(this.parent.element.querySelectorAll('div[data-guid="'+e+'"]'))},e.prototype.getUniqueAppointmentElements=function(){var e=this.getAppointmentElements(),t=[];return e.map(function(e){return e.getAttribute("data-guid")}).filter(function(i,n,r){r.indexOf(i)===n&&t.push(e[parseInt(n.toString(),10)])}),t},e.prototype.getWorkCellFromAppointmentElement=function(e){var t=this.parent.eventBase.getEventByGuid(e.getAttribute("data-guid"));return this.parent.eventBase.selectWorkCellByTime([t])},e.prototype.processViewNavigation=function(e){if(!t.isNullOrUndefined(e.code)){var i=parseInt(e.code.slice(e.code.length-1),10)-1;if(!isNaN(i)&&!t.isNullOrUndefined(this.parent.views)&&i<this.parent.views.length){var n=this.parent.viewCollections[parseInt(i.toString(),10)].option;this.parent.changeView(n,e,void 0,i),this.parent.headerModule&&this.parent.headerModule.element.querySelector(".e-active-view button").focus()}}},e.prototype.isCalendarTarget=function(e){var i=e.currentTarget||e.target;return!(!i||t.isNullOrUndefined(i.querySelector(".e-header-popup.e-popup-open")))},e.prototype.cancelUpDownAction=function(e){var t=e&&"Vertical"===this.parent.activeViewOptions.orientation,i=this.parent.activeViewOptions.group.resources.length>0;return!!(t&&i||e&&this.initialTarget.classList.contains("e-other-month"))||!((!this.parent.activeView.isTimelineView()||e)&&"MonthAgenda"!==this.parent.currentView)},e.prototype.processUp=function(e,t){var i="TimelineYear"===this.parent.currentView;if(!(t&&this.cancelUpDownAction(i)||this.isCalendarTarget(e))){var n=e.target,r=this.parent.getSelectedCells(),a=this.parent.eventBase.getSelectedAppointments(),s=this.parent.element.querySelector(".e-more-popup-wrapper"),o=this.getQuickPopupElement();if(r.length>0&&!e.target.classList.contains("e-work-cells")&&(n=r[r.length-1]),a.length>0&&!s.classList.contains(rt)&&!o.classList.contains(rt)&&-1!==["Day","Week","WorkWeek","Month"].indexOf(this.parent.currentView)&&(n=this.getWorkCellFromAppointmentElement(a[a.length-1]),this.parent.eventBase.removeSelectedAppointmentClass()),n)if(n.classList.contains("e-work-cells")&&!this.parent.element.querySelector("."+rt)){var l=this.parent.getTableRows(),p=l.indexOf(n.parentElement),c=void 0;if(i&&t&&0===this.parent.activeViewOptions.group.resources.length&&(c=this.isInverseTableSelect()?this.getVerticalUpDownCell(l,n,p,!0):this.getHorizontalUpDownCell(l,n,p,!0)),(p>0||c)&&p<l.length){if(c=c||l[p-1].cells[n.cellIndex],"Year"===this.parent.currentView&&c.classList.contains("e-other-month")){if(!(this.parent.activeView.getStartDate().getTime()<+c.getAttribute("data-date")))return;c=this.getYearUpDownCell(l,p-1,n.cellIndex,!0)}e.preventDefault(),this.selectCells(t,c)}}else"Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||this.selectAppointment(!0,n)}},e.prototype.processDown=function(e,t){var i="TimelineYear"===this.parent.currentView;if(!(t&&this.cancelUpDownAction(i)||this.isCalendarTarget(e))){var n=e.target,r=this.parent.getSelectedCells(),a=this.parent.eventBase.getSelectedAppointments(),s=this.parent.element.querySelector(".e-more-popup-wrapper"),o=this.getQuickPopupElement();r.length>0&&!e.target.classList.contains("e-work-cells")&&(n=r[r.length-1]),a.length>0&&!s.classList.contains(rt)&&!o.classList.contains(rt)&&-1!==["Day","Week","WorkWeek","Month"].indexOf(this.parent.currentView)&&(n=this.getWorkCellFromAppointmentElement(a[a.length-1]),this.parent.eventBase.removeSelectedAppointmentClass());var l=this.parent.getTableRows();if(n)if(n.classList.contains("e-work-cells")&&!this.parent.element.querySelector("."+rt)){var p=l.indexOf(n.parentElement),c=void 0;if(i&&t&&0===this.parent.activeViewOptions.group.resources.length&&(c=this.isInverseTableSelect()?this.getVerticalUpDownCell(l,n,p,!1):this.getHorizontalUpDownCell(l,n,p,!1)),p>=0&&(p<l.length-1||c)){if(c=c||l[p+1].cells[n.cellIndex],"Year"===this.parent.currentView&&c.classList.contains("e-other-month")){if(!(this.parent.activeView.getEndDate().getTime()>+c.getAttribute("data-date")))return;c=this.getYearUpDownCell(l,p+1,n.cellIndex,!1)}e.preventDefault(),this.selectCells(t,c)}}else"Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||this.selectAppointment(!1,n)}},e.prototype.getYearUpDownCell=function(e,t,i,n){for(;e[parseInt(t.toString(),10)]&&e[parseInt(t.toString(),10)].cells[parseInt(i.toString(),10)].classList.contains("e-other-month");)t+=n?-1:1;return e[parseInt(t.toString(),10)].cells[parseInt(i.toString(),10)]},e.prototype.getHorizontalUpDownCell=function(e,t,i,n){var r=e[i+(n?-1:1)],a=r?r.cells[t.cellIndex]:t;if(a.classList.contains("e-other-month")){var s=r.querySelector(".e-work-cells:not(.e-other-month)"),o=new Date(+s.getAttribute("data-date")),l='[data-date="'+new Date(o.getFullYear(),o.getMonth()+1,0).getTime()+'"]';a=a.cellIndex<s.cellIndex?s:r.querySelector(l)}return a},e.prototype.getVerticalUpDownCell=function(e,t,i,n){var r=n&&i>0||!n&&i<e.length-1?e[i+(n?-1:1)].cells[t.cellIndex]:void 0;if(!r||r.classList.contains("e-other-month")){if(e[parseInt(i.toString(),10)].cells[t.cellIndex-(n?1:-1)]){var a=+t.getAttribute("data-date")-(n?Qe:-Qe);return this.parent.getContentTable().querySelector('.e-work-cells[data-date="'+a+'"]')}r=t}return r},e.prototype.processLeftRight=function(e){var t="Year"===this.parent.currentView?e.closest("tbody"):this.parent.getContentTable(),i=e.parentNode.sectionRowIndex;return{element:t,rowIndex:i,columnIndex:e.cellIndex,maxIndex:t.rows[parseInt(i.toString(),10)].cells.length}},e.prototype.getQuickPopupElement=function(){return(this.parent.isAdaptive?document.body:this.parent.element).querySelector(".e-quick-popup-wrapper")},e.prototype.isCancelLeftRightAction=function(e,t,i){var n="MonthAgenda"===this.parent.currentView||i&&this.initialTarget.classList.contains("e-other-month");if("Agenda"===this.parent.currentView||t&&n)return!0;if(this.isPreventAction(e)&&t)return!0;var r=this.parent.element.querySelector(".e-more-popup-wrapper"),a=this.getQuickPopupElement();return!(!r.classList.contains(rt)&&!a.classList.contains(rt))},e.prototype.processRight=function(e,i){var n="TimelineYear"===this.parent.currentView;if(!this.isCancelLeftRightAction(e,i,n)&&!this.isCalendarTarget(e)){var r,a=this.parent.getSelectedCells(),s=this.parent.eventBase.getSelectedAppointments(),o=e.target;if(a.length>0&&!o.classList.contains("e-work-cells")&&!o.classList.contains("e-all-day-cells")&&(o=a[a.length-1]),!(s.length>0)||(o=this.getWorkCellFromAppointmentElement(s[s.length-1]),this.parent.eventBase.removeSelectedAppointmentClass(),o))if(o.classList.contains("e-work-cells")&&e.target.classList.contains("e-work-cells")){var l=this.processLeftRight(o),p=new Date(+o.getAttribute("data-date")),c="Year"===this.parent.currentView&&p.getTime()===y(p).getTime();if(l.columnIndex>=0&&l.columnIndex<l.maxIndex-1&&!c)r=this.calculateNextPrevDate(o,l.element.rows[l.rowIndex].cells[o.cellIndex+1],"right"),n&&i&&r.classList.contains("e-other-month")&&(r=this.getTimelineYearTargetCell(l,o,!0)),t.isNullOrUndefined(r)||this.selectCells(i,r);else if(l.columnIndex===l.maxIndex-1||c)if(!this.isInverseTableSelect()&&l.rowIndex<l.element.rows.length-1&&!c)r=this.calculateNextPrevDate(o,l.element.rows[l.rowIndex+1].cells[0],"right"),r=n&&i&&r.classList.contains("e-other-month")?this.getHorizontalLeftRightCell(l,o,!0):r,t.isNullOrUndefined(r)||this.selectCells(i,r);else if(!i){if(c&&p.getTime()!==this.parent.activeView.getEndDate().getTime())return void this.selectCells(i,this.parent.element.querySelector(':not(.e-other-month)[data-date="'+(p.getTime()+Qe)+'"]'));var h=this.isInverseTableSelect()?l.rowIndex:0;this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Next"),e);var d=this.parent.getContentTable(),u=c?d.rows[parseInt(h.toString(),10)].querySelector(".e-work-cells:not(.e-other-month)"):d.rows[parseInt(h.toString(),10)].cells[0];this.selectCells(!1,u)}}else if(o.classList.contains("e-all-day-cells")){var g=o.cellIndex,v=this.parent.getAllDayRow(),m=v.cells.length;if(g>=0&&g<m-1)this.selectCells(i,v.cells[g+1]);else if(g===m-1&&!i){this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Next"),e);var f=this.parent.getAllDayRow();this.selectCells(!1,f.cells[0])}}}},e.prototype.processLeft=function(e,i){var n="TimelineYear"===this.parent.currentView;if(!this.isCancelLeftRightAction(e,i,n)&&!this.isCalendarTarget(e)){var r,a=e.target,s=this.parent.getSelectedCells();s.length>0&&!a.classList.contains("e-work-cells")&&!a.classList.contains("e-all-day-cells")&&(a=s[s.length-1]);var o=this.parent.eventBase.getSelectedAppointments();if(!(o.length>0)||(a=this.getWorkCellFromAppointmentElement(o[o.length-1]),this.parent.eventBase.removeSelectedAppointmentClass(),a))if(e.target.classList.contains("e-work-cells")&&a.classList.contains("e-work-cells")){var l=this.processLeftRight(a),p=new Date(+a.getAttribute("data-date")),c="Year"===this.parent.currentView&&p.getTime()===f(p).getTime();if(l.columnIndex>0&&l.columnIndex<l.maxIndex&&!c)r=this.calculateNextPrevDate(a,l.element.rows[l.rowIndex].cells[a.cellIndex-1],"left"),n&&i&&r.classList.contains("e-other-month")&&(r=this.getTimelineYearTargetCell(l,a,!1)),t.isNullOrUndefined(r)||this.selectCells(i,r);else if(0===l.columnIndex||c)if(!this.isInverseTableSelect()&&l.rowIndex>0)r=this.calculateNextPrevDate(a,l.element.rows[l.rowIndex-1].cells[l.maxIndex-1],"left"),r=n&&i&&r.classList.contains("e-other-month")?this.getHorizontalLeftRightCell(l,a,!1):r,t.isNullOrUndefined(r)||this.selectCells(i,r);else if(!i){if(c&&p.getTime()!==this.parent.activeView.getStartDate().getTime())return void this.selectCells(i,this.parent.element.querySelector('[data-date="'+(p.getTime()-Qe)+'"]'));this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Previous"),e);var h=this.parent.getContentTable(),d=this.isInverseTableSelect()?l.rowIndex:h.rows.length-1,u=h.rows[parseInt(d.toString(),10)].cells[l.maxIndex-1];if(c){var g=this.parent.element.querySelectorAll("."+nt+" tbody");u=g.item(g.length-1).querySelector(':not(.e-other-month)[data-date="'+this.parent.activeView.getEndDate().getTime()+'"]')}this.selectCells(!1,u)}}else if(a.classList.contains("e-all-day-cells")){var v=a.cellIndex,m=this.parent.getAllDayRow(),y=m.cells.length;if(v>0&&v<y)this.selectCells(i,m.cells[v-1]);else if(0===v&&!i){this.parent.changeDate(this.parent.activeView.getNextPreviousDate("Previous"),e);var T=this.parent.getAllDayRow();this.selectCells(!1,T.cells[y-1])}}}},e.prototype.getTimelineYearTargetCell=function(e,t,i){return this.isInverseTableSelect()?this.getVerticalLeftRightCell(t,i):this.getHorizontalLeftRightCell(e,t,i)},e.prototype.getHorizontalLeftRightCell=function(e,t,i){var n=e.element.rows[t.parentNode.sectionRowIndex+(i?1:-1)];if(n){var r=i?".e-work-cells:not(.e-other-month)":'[data-date="'+(+t.getAttribute("data-date")-Qe)+'"]';return n.querySelector(r)}return t},e.prototype.getVerticalLeftRightCell=function(e,t){var i=new Date(+e.getAttribute("data-date")),n=new Date(i.getFullYear(),i.getMonth()+(t?1:-1),1),r=this.parent.getContentTable(),a=r.querySelector('[data-date="'+n.getTime()+'"]');return a.parentNode.sectionRowIndex>e.parentNode.sectionRowIndex?a:r.querySelector('[data-date="'+new Date(n.getFullYear(),n.getMonth()+1,0).getTime()+'"]')},e.prototype.calculateNextPrevDate=function(e,t,i){var n=this.initialTarget.getAttribute("data-group-index");if(this.parent.activeViewOptions.group.resources.length>0&&"Month"===this.parent.currentView&&e&&t&&t.getAttribute("data-group-index")!==n){var r=this.parent.getDateFromElement(e),a="right"===i?new Date(r.setDate(r.getDate()+1)):new Date(r.setDate(r.getDate()-1));t=[].slice.call(this.parent.element.querySelectorAll('td[data-date="'+a.getTime().toString()+'"][data-group-index="'+n+'"]'))[0]}return t},e.prototype.getFocusableElements=function(e){return[].slice.call(e.querySelectorAll('a[href]:not([tabindex="-1"]),input:not([disabled]):not([tabindex="-1"]),textarea:not([disabled]):not([tabindex="-1"]),button:not([disabled]):not([tabindex="-1"]),select:not([disabled]):not([tabindex="-1"]),[tabindex]:not([tabindex="-1"]),[contentEditable=true]:not([tabindex="-1"])'))},e.prototype.processTabOnPopup=function(e,i){var n=this,r=this.getFocusableElements(i),a=(r=r.filter(function(e){var t=n.parent.element.querySelector(".e-popup-footer");return t&&t.offsetParent?!(e.classList.contains("e-edit")||e.classList.contains("e-delete")):!(e.classList.contains("e-event-edit")||e.classList.contains("e-event-delete"))}))[0],s=r[r.length-1];t.isNullOrUndefined(s)||document.activeElement!==s||e.shiftKey||(e.preventDefault(),a.focus()),!t.isNullOrUndefined(a)&&document.activeElement===a&&e.shiftKey&&(e.preventDefault(),s.focus())},e.prototype.processTab=function(e,i){var n=e.target;if(n.classList.contains("e-inline-subject")&&this.parent.inlineModule&&(n=n.closest(".e-appointment"),this.parent.inlineModule.inlineCrudActions(e.target)),"TimelineYear"===this.parent.currentView&&n.classList.contains("e-other-month"))return void(n.classList.contains("e-selected-cell")&&this.parent.removeSelectedClass());var r=t.closest(n,".e-quick-popup-wrapper,.e-more-popup-wrapper");if(r&&r.classList.contains(rt))return r.classList.contains("e-more-popup-wrapper")&&this.parent.eventBase.removeSelectedAppointmentClass(),void this.processTabOnPopup(e,r);if(n.classList.contains($e))return void this.parent.eventBase.removeSelectedAppointmentClass();if(n.classList.contains("e-resource-cells")&&this.parent.activeView.isTimelineView()&&this.parent.activeViewOptions.group.resources.length>0){var a=parseInt(n.getAttribute("data-group-index"),10),s='.e-appointment[data-group-index="'+(i?a-1:a)+'"]';if((c=[].slice.call(this.parent.element.querySelectorAll(s))).length>0){this.parent.eventBase.removeSelectedAppointmentClass();var o=i?c.slice(-1)[0]:c[0];this.parent.eventBase.addSelectedAppointments([o],!0),o.focus(),e.preventDefault()}else if(a+1===this.parent.resourceBase.lastResourceLevel.length)this.parent.element.focus(),e.preventDefault();else if(this.parent.virtualScrollModule){var l=this.parent.element.querySelector(".e-virtual-track"),p=Math.round(l.offsetHeight/this.parent.resourceBase.expandedResources.length);this.parent.element.querySelector(".e-content-wrap").scrollTop=(i?a-1:a+1)*p,this.parent.virtualScrollModule.virtualScrolling()}else this.setScrollPosition(a)}else{if(n.classList.contains("e-appointment")){var c=[].slice.call(this.parent.element.querySelectorAll(".e-appointment")),h="TimelineYear"===this.parent.currentView;if((this.parent.activeView.isTimelineView()&&!h||h&&"Vertical"===this.parent.activeViewOptions.orientation)&&this.parent.activeViewOptions.group.resources.length>0){a=parseInt(n.getAttribute("data-group-index"),10);c=[].slice.call(this.parent.element.querySelectorAll('.e-appointment[data-group-index="'+a+'"]'));var d='.e-resource-cells[data-group-index="'+(i?a:a+1)+'"]',u=this.parent.element.querySelector(d);if(u&&(i&&n.getAttribute("data-guid")===c[0].getAttribute("data-guid")||!i&&n.getAttribute("data-guid")===c.slice(-1)[0].getAttribute("data-guid")))return this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.virtualScrollModule?u.focus({preventScroll:!0}):u.focus(),this.parent.activeView.isTimelineView()&&this.parent.activeViewOptions.group.resources.length>0&&t.isNullOrUndefined(this.parent.virtualScrollModule)&&this.setScrollPosition(a),void e.preventDefault()}var g=this.parent.eventBase.getSelectedAppointments();if(g.length>0&&(n=g[g.length-1]),this.parent.eventBase.removeSelectedAppointmentClass(),!i&&n.getAttribute("data-guid")===c[c.length-1].getAttribute("data-guid")||i&&n.getAttribute("data-guid")===c[0].getAttribute("data-guid"))return;return void("Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||(this.selectAppointment(i,n),e.preventDefault()))}var v=this.parent.getSelectedCells();if(v.length>0&&!n.classList.contains("e-appointment"))return n=v[v.length-1],this.selectAppointmentElementFromWorkCell(i,n),void e.preventDefault();n&&!n.classList.contains("e-resource-cells")&&this.parent.activeView.isTimelineView()&&this.parent.activeViewOptions.group.resources.length>0&&this.processTabOnResourceCells(n,i)}},e.prototype.processDelete=function(e){var i=document.activeElement;if("MonthAgenda"===this.parent.currentView||!t.isNullOrUndefined(i)&&t.closest(i,".e-quick-popup-wrapper")){var n=this.parent.eventBase.getSelectedEvents().element;i=n&&t.isNullOrUndefined(n.length)?n:n[0]}if(i&&i.classList.contains("e-appointment")){if(t.addClass([i],"e-appointment-border"),this.parent.activeEventData=this.parent.eventBase.getSelectedEvents(),this.parent.activeViewOptions.readonly||i.classList.contains("e-read-only")||!this.parent.eventSettings.allowDeleting)return;this.parent.quickPopup.deleteClick(e)}},e.prototype.processCtrlShiftNavigationArrows=function(e){if(this.parent.activeViewOptions.group.resources.length>0&&document.activeElement.classList.contains("e-appointment")){var t=parseInt(document.activeElement.getAttribute("data-group-index"),10);r=(r="ctrlShiftLeftArrow"===e.action||"ctrlShiftUpArrow"===e.action?t-1:t+1)<0?0:r>this.parent.resourceBase.lastResourceLevel.length?this.parent.resourceBase.lastResourceLevel.length:r;for(var i=[];0===i.length&&r>=0&&r<=this.parent.resourceBase.lastResourceLevel.length;)i=[].slice.call(this.parent.element.querySelectorAll('.e-appointment[data-group-index="'+r+'"]')),r="ctrlShiftLeftArrow"===e.action||"ctrlShiftUpArrow"===e.action?r-1:r+1;var n=i[0];n&&(this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.eventBase.addSelectedAppointments([n],!0),n.focus())}else if(this.parent.activeViewOptions.group.resources.length>0&&!document.activeElement.classList.contains("e-appointment")){var r=this.parent.resourceBase.renderedResources[0].groupIndex,a='.e-appointment[data-group-index="'+r+'"]',s=[].slice.call(this.parent.element.querySelectorAll(a));if(s.length>0){this.parent.eventBase.removeSelectedAppointmentClass();var o=s[0];this.parent.eventBase.addSelectedAppointments([o],!0),o.focus(),e.preventDefault()}}},e.prototype.processEscape=function(e){this.parent.quickPopup.onClosePopup(e),this.parent.quickPopup.morePopup.hide(),this.parent.headerModule&&this.parent.headerModule.hideHeaderPopup(),this.parent.inlineModule&&this.parent.inlineModule.removeInlineAppointmentElement()},e.prototype.isPreventAction=function(e){var i=t.closest(e.target,".e-resource-group-cells");return!(!this.parent.activeView.isTimelineView()||t.isNullOrUndefined(i))},e.prototype.processTabOnResourceCells=function(e,t){var i=[].slice.call(this.parent.element.querySelectorAll('[tabIndex="0"]')),n=i.indexOf(e),r=t?i[n-1]:i[n+1];if(r&&r.classList.contains("e-resource-cells")){var a=parseInt(r.getAttribute("data-group-index"),10);if(this.parent.virtualScrollModule){var s=this.parent.element.querySelector(".e-resource-column-wrap");[].slice.call(this.parent.element.querySelectorAll(".e-resource-cells")).forEach(function(e){e.getBoundingClientRect().top<s.getBoundingClientRect().top&&e.setAttribute("tabindex","-1")})}else this.setScrollPosition(a)}},e.prototype.setScrollPosition=function(e){var t=this.parent.element.querySelector('.e-work-cells[data-group-index="'+e+'"]');t&&(this.parent.element.querySelector(".e-content-wrap").scrollTop=t.offsetTop)},e.prototype.createClipboardElement=function(){this.parent.allowClipboard&&(this.clipBoardTextArea=this.parent.createElement("textarea",{className:"e-clipboard",attrs:{tabindex:"-1"}}),this.parent.element.appendChild(this.clipBoardTextArea))},e.prototype.setCopy=function(e,i){var n=this;if(""===window.getSelection().toString()){this.clipBoardTextArea.value="";var r={elements:[],eventDatas:[]};if(e){var a=this.filterReadOnlyEvent(e);r.eventDatas=a}else{if(!this.parent||!this.parent.eventBase)return;var s=this.parent.eventBase.getSelectedEvents();s.event=s&&s.event?Array.isArray(s.event)?this.filterReadOnlyEvent(s.event):this.filterReadOnlyEvent([s.event]):void 0,s.element&&s.event?r={elements:s.element,eventDatas:s.event}:(r.element=[i.target],r.eventDatas=[this.parent.getEventDetails(i.target)])}this.clipBoardTextArea.value=JSON.stringify(r.eventDatas,void 0,2),/ipad|ipod|iphone/i.test(t.Browser.userAgent)?this.clipBoardTextArea.setSelectionRange(0,this.clipBoardTextArea.value.length):this.clipBoardTextArea.select(),t.isNullOrUndefined(navigator.clipboard)||navigator.clipboard.writeText(this.clipBoardTextArea.value).then(function(){if(n.clipBoardTextArea.blur(),window.getSelection().removeAllRanges(),i){var e=i.target.closest(".e-appointment");e&&e.focus()}}).catch(function(e){throw e})}},e.prototype.filterReadOnlyEvent=function(e){var t=this;return e.filter(function(e){return!e[t.parent.eventFields.isReadonly]})},e.prototype.processClipboardAction=function(e,t,i){this.parent.allowClipboard&&(this.isCutAction=e,this.isCutContentPasted=!1,this.parent.closeQuickInfoPopup(),this.setCopy(t||void 0,i))},e.prototype.pasteHandler=function(e,t){var i=this;if(this.parent.allowClipboard&&!this.isCutContentPasted){var n=this.parent.getSelectedCells().length>0?this.parent.getSelectedCells():t?[t]:[];if(0!==n.length&&!this.parent.eventWindow.dialogObject.visible&&!this.parent.quickPopup.quickPopup.element.classList.contains(rt)){var r=(e.clipboardData||e.event.clipboardData||window.clipboardData).getData("text");if("[]"!==r&&""!==r){var a;try{a=JSON.parse(r)}catch(e){a=r}var s={cancel:!1,data:a,element:n};this.parent.trigger("beforePaste",s,function(e){return e.cancel?void i.parent.closeQuickInfoPopup():Array.isArray(e.data)&&e.data.every(function(e){return"object"==typeof e})?(i.processPaste(e.data,t),void(i.isCutAction&&(i.isCutContentPasted=!0))):void(i.clipBoardTextArea.value="")})}}}},e.prototype.processPaste=function(e,i){if(this.parent&&this.parent.eventWindow&&this.parent.eventBase&&e&&e.length){var n=this.getTargetElements(i),r=this.parent.getCellDetails(n),a={};this.parent.eventWindow.convertToEventData(r,a);var s=this.isAllDayEvent(n),o=this.parent.getResourcesByIndex(r.groupIndex),l=this.processEventData(e,s,r,o),p=this.parent.eventBase.sortByDateTime(l),c=this.prepareEventData(p,a);t.removeClass(n,"e-selected-cell"),c.length>0&&(this.isCutAction?this.parent.saveEvent(c):this.parent.addEvent(c))}},e.prototype.getTargetElements=function(e){return this.parent.getSelectedCells().length>0?this.parent.getSelectedCells():e?[e]:[]},e.prototype.isAllDayEvent=function(e){return!e.some(function(e){return e.classList.contains("e-work-cells")})},e.prototype.processEventData=function(e,t,i,n){var r=this;return e.map(function(e){var a,s=gt({},e,(a={},a[r.parent.eventFields.startTime]=new Date(e[r.parent.eventFields.startTime]),a[r.parent.eventFields.endTime]=new Date(e[r.parent.eventFields.endTime]),a[r.parent.eventFields.recurrenceID]=null,a[r.parent.eventFields.isAllDay]=t,a));return r.adjustEventTime(s,t,e.IsAllDay,i),n&&n.groupData&&Object.assign(s,n.groupData),s})},e.prototype.adjustEventTime=function(e,t,i,n){var r=this.parent.activeViewOptions.timeScale.enable;-1!==["Day","Week","WorkWeek"].indexOf(this.parent.currentView)&&r?t?(e[this.parent.eventFields.endTime]=new Date(e[this.parent.eventFields.startTime]),e[this.parent.eventFields.endTime].setDate(e[this.parent.eventFields.startTime].getDate()+1)):i&&(e[this.parent.eventFields.startTime]=new Date(e[this.parent.eventFields.startTime].setHours(0,0,0,0)),e[this.parent.eventFields.endTime]=new Date(e[this.parent.eventFields.startTime].getTime()+(n.endTime.getTime()-n.startTime.getTime()))):i&&(e[this.parent.eventFields.isAllDay]=!0,e[this.parent.eventFields.startTime]=new Date(e[this.parent.eventFields.startTime].setHours(0,0,0,0)),e[this.parent.eventFields.endTime]=new Date(e[this.parent.eventFields.startTime].getTime()+(e[this.parent.eventFields.endTime].getTime()-e[this.parent.eventFields.startTime].getTime())))},e.prototype.prepareEventData=function(e,t){var i=this,n=new Date(e[0][this.parent.eventFields.startTime]),r=this.parent.getEventMaxID();return e.map(function(e){var a=i.calculateTotalDuration(e,t,n),s=i.isCutAction?e:gt({},e);return e[i.parent.eventFields.recurrenceRule]||(s[i.parent.eventFields.startTime]=new Date(new Date(s[i.parent.eventFields.startTime]).setMilliseconds(a)),s[i.parent.eventFields.endTime]=new Date(new Date(s[i.parent.eventFields.endTime]).setMilliseconds(a))),i.isCutAction||(s[i.parent.eventFields.id]=r++),s})},e.prototype.calculateTotalDuration=function(e,t,i){if(-1===["Month","TimelineMonth","TimelineYear"].indexOf(this.parent.currentView)&&this.parent.activeViewOptions.timeScale.enable)return t[this.parent.eventFields.startTime].getTime()-i.getTime();var n=new Date(e[this.parent.eventFields.startTime]);return t[this.parent.eventFields.startTime].getTime()-i.getTime()+(36e5*n.getHours()+6e4*n.getMinutes()+1e3*n.getSeconds())},e.prototype.getModuleName=function(){return"keyboard"},e.prototype.destroy=function(){this.removeEventListener(),this.selectedCells=[],this.clipBoardTextArea=null,this.keyboardModule.destroy()},e}(),mt=function(){function e(e,t,i){this.parent=e,this.initDataManager(t,i)}return e.prototype.initDataManager=function(e,t){this.dataManager=e instanceof a.DataManager?e:new a.DataManager(e),this.query=t instanceof a.Query?t:new a.Query},e.prototype.generateQuery=function(e,i){var n=this.query.clone();if(this.parent&&e&&i){if(this.parent.activeViewOptions&&this.parent.activeViewOptions.enableLazyLoading&&!t.isNullOrUndefined(this.parent.activeViewOptions.group.resources)&&this.parent.activeViewOptions.group.resources.length>0&&this.parent.resourceBase&&this.parent.resourceBase.resourceCollection.length>0&&this.parent.resourceBase.renderedResources.length>0){var r=[];this.parent.resourceBase.resourceCollection.forEach(function(){return r.push([])}),this.parent.resourceBase.renderedResources.forEach(function(e){r.forEach(function(t,i){var n=e.groupOrder[parseInt(i.toString(),10)];n&&t.indexOf(n)<0&&t.push(n)})}),this.parent.resourceBase.resourceCollection.forEach(function(e,t){n.addParams(e.field,r[parseInt(t.toString(),10)].toString())})}if(this.parent.timezone&&(e=this.parent.tzModule.remove(new Date(+e.getTime()),this.parent.timezone),i=this.parent.tzModule.remove(new Date(+i.getTime()),this.parent.timezone)),this.parent.eventSettings.includeFiltersInQuery){var s=this.getStartEndQuery(e,i),o=new a.Predicate(this.parent.eventFields.recurrenceRule,"notequal",null).and(new a.Predicate(this.parent.eventFields.recurrenceRule,"notequal",""));return n.where(s.or(o))}n.addParams("StartDate",e.toISOString()),n.addParams("EndDate",i.toISOString())}return n},e.prototype.getStartEndQuery=function(e,t){var i=this.parent.eventFields;return new a.Predicate(i.startTime,"greaterthanorequal",e).and(new a.Predicate(i.endTime,"greaterthanorequal",e)).and(new a.Predicate(i.startTime,"lessthan",t)).or(new a.Predicate(i.startTime,"lessthanorequal",e).and(new a.Predicate(i.endTime,"greaterthan",e)))},e.prototype.getData=function(e){return this.dataManager.executeQuery(e)},e.prototype.destroy=function(){this.dataManager=null,this.query=null},e}(),ft=function(){function e(){}return e.prototype.firstDateOfMonth=function(e){return new Date(e.getFullYear(),e.getMonth())},e.prototype.lastDateOfMonth=function(e){return new Date(e.getFullYear(),e.getMonth()+1,0)},e.prototype.isMonthStart=function(e){return 1===e.getDate()},e.prototype.getLeapYearDaysCount=function(){return 366},e.prototype.getYearDaysCount=function(e,t){return(e.getFullYear()+t)%4==0?366:365},e.prototype.getDate=function(e){return e.getDate()},e.prototype.getMonth=function(e){return e.getMonth()+1},e.prototype.getFullYear=function(e){return e.getFullYear()},e.prototype.getYearLastDate=function(e,t){return new Date(e.getFullYear()+t,0,0)},e.prototype.getMonthDaysCount=function(e){return this.lastDateOfMonth(e).getDate()},e.prototype.getMonthStartDate=function(e){return new Date(e.getFullYear(),e.getMonth(),1,e.getHours(),e.getMinutes())},e.prototype.getMonthEndDate=function(e){return e.setDate(1),new Date(e.setMonth(e.getMonth()+1))},e.prototype.getExpectedDays=function(e,t){return t},e.prototype.setDate=function(e,t){e.setDate(t)},e.prototype.setValidDate=function(e,i,n,r,a){t.isNullOrUndefined(a)?e.setMonth(e.getMonth()+i,n):e.setMonth((a?r:e.getMonth())+i)},e.prototype.setMonth=function(e,t,i){e.setDate(1),e.setFullYear(e.getFullYear()),e.setMonth(t-1);var n=new Date(e.getFullYear(),e.getMonth()+1,0).getDate();e.setDate(Math.min(i,n))},e.prototype.addYears=function(e,t){e.setFullYear(e.getFullYear()+t)},e.prototype.isSameMonth=function(e,t){return e.getMonth()===t.getMonth()},e.prototype.checkMonth=function(e,t){return-1===t.indexOf(e.getMonth()+1)},e.prototype.compareMonth=function(e,t){return e.getMonth()>t.getMonth()},e.prototype.isSameYear=function(e,t){return e.getFullYear()===t.getFullYear()},e.prototype.isLastMonth=function(e){return 11===e.getMonth()},e.prototype.isLeapYear=function(e,t){return(e+t)%4==0},e}(),yt=function(){function e(){}return e.prototype.firstDateOfMonth=function(e){var i=this.getHijriDate(e);return t.HijriParser.toGregorian(i.year,i.month,1)},e.prototype.lastDateOfMonth=function(e){var i=this.getHijriDate(e),n=this.getDaysInMonth(i.month,i.year),r=t.HijriParser.toGregorian(i.year,i.month,n),a=new Date(r.getTime());a=new Date(a.setDate(a.getDate()+1));var s=this.getHijriDate(a);return i.month===s.month?a:(s=this.getHijriDate(r),i.month===s.month?r:new Date(r.setDate(r.getDate()-1)))},e.prototype.isMonthStart=function(e){return 1===this.getHijriDate(e).date},e.prototype.getLeapYearDaysCount=function(){return 355},e.prototype.getYearDaysCount=function(e,t){var i=this.getHijriDate(e);return this.isLeapYear(i.year,t)?355:354},e.prototype.getDate=function(e){return this.getHijriDate(e).date},e.prototype.getMonth=function(e){return this.getHijriDate(e).month},e.prototype.getFullYear=function(e){return this.getHijriDate(e).year},e.prototype.getYearLastDate=function(e,i){var n=this.getHijriDate(e);return t.HijriParser.toGregorian(n.year+i,1,0)},e.prototype.getMonthDaysCount=function(e){var t=this.lastDateOfMonth(e);return this.getHijriDate(t).date},e.prototype.getMonthStartDate=function(e){var t=this.firstDateOfMonth(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),e.getHours(),e.getMinutes())},e.prototype.getMonthEndDate=function(e){var t=this.lastDateOfMonth(e);return t.setDate(t.getDate()+1),new Date(t.setMonth(t.getMonth()))},e.prototype.getExpectedDays=function(e,i){for(var n=this.getHijriDate(e),r=[],a=0;a<i.length;a++){var s=t.HijriParser.toGregorian(n.year,n.month,i[parseInt(a.toString(),10)]);r.push(s.getDate())}return r},e.prototype.setDate=function(e,i){var n=this.getHijriDate(e),r=t.HijriParser.toGregorian(n.year,n.month,i);this.updateDateObj(e,r)},e.prototype.setValidDate=function(e,i,n,r,a){var s=t.isNullOrUndefined(a)?e:this.firstDateOfMonth(a),o=this.getHijriDate(s),l=t.HijriParser.toGregorian(o.year,o.month+i,n);this.updateDateObj(e,l)},e.prototype.setMonth=function(e,i,n){var r=this.getHijriDate(e),a=t.HijriParser.toGregorian(r.year,i,n);this.updateDateObj(e,a)},e.prototype.addYears=function(e,i,n){var r=this.getHijriDate(e),a=t.HijriParser.toGregorian(r.year+i,n,1);this.updateDateObj(e,a)},e.prototype.isSameMonth=function(e,t){var i=this.getHijriDate(e),n=this.getHijriDate(t);return i.month===n.month},e.prototype.checkMonth=function(e,t){var i=this.getHijriDate(e);return-1===t.indexOf(i.month)},e.prototype.compareMonth=function(e,t){var i=this.getHijriDate(e),n=this.getHijriDate(t);return i.month>n.month},e.prototype.isSameYear=function(e,t){var i=this.getHijriDate(e),n=this.getHijriDate(t);return i.year===n.year},e.prototype.isLastMonth=function(e){return 12===this.getHijriDate(e).month},e.prototype.updateDateObj=function(e,t){e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate())},e.prototype.isLeapYear=function(e,t){return(14+11*(e+t))%30<11},e.prototype.getDaysInMonth=function(e,t){var i=0;return i=29+(e+1)%2,11===e&&this.isLeapYear(t,0)&&i++,i},e.prototype.getHijriDate=function(e){return t.HijriParser.getHijriDate(e)},e}(),Tt=function(){function e(){this.timezoneData=[],this.timezoneData=this.getTimezoneData()}return e.prototype.offset=function(e,t){var i=e.getTimezoneOffset();try{var n=new Date(e.toLocaleString("en-US",{timeZone:t}));return isNaN(n.getTime())?0:(e.getTime()-n.getTime())/6e4+i}catch(e){return 0}},e.prototype.convert=function(e,t,i){"string"==typeof t&&(t=this.offset(e,t)),"string"==typeof i&&(i=this.offset(e,i));var n=e.getTimezoneOffset(),r=(e=new Date(e.getTime()+6e4*(t-i))).getTimezoneOffset();return new Date(e.getTime()+6e4*(r-n))},e.prototype.add=function(e,t){return this.convert(e,e.getTimezoneOffset(),t)},e.prototype.remove=function(e,t){return this.convert(e,t,e.getTimezoneOffset())},e.prototype.removeLocalOffset=function(e){return new Date(e.getTime()-6e4*e.getTimezoneOffset())},e.prototype.getLocalTimezoneName=function(){return window.Intl?Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC":"UTC"},e.prototype.getTimezoneData=function(){return wt},e}(),wt=[{Value:"Pacific/Niue",Text:"(UTC-11:00) Niue"},{Value:"Pacific/Pago_Pago",Text:"(UTC-11:00) Pago Pago"},{Value:"Pacific/Honolulu",Text:"(UTC-10:00) Hawaii Time"},{Value:"Pacific/Rarotonga",Text:"(UTC-10:00) Rarotonga"},{Value:"Pacific/Tahiti",Text:"(UTC-10:00) Tahiti"},{Value:"Pacific/Marquesas",Text:"(UTC-09:30) Marquesas"},{Value:"America/Anchorage",Text:"(UTC-09:00) Alaska Time"},{Value:"Pacific/Gambier",Text:"(UTC-09:00) Gambier"},{Value:"America/Los_Angeles",Text:"(UTC-08:00) Pacific Time"},{Value:"America/Tijuana",Text:"(UTC-08:00) Pacific Time - Tijuana"},{Value:"America/Vancouver",Text:"(UTC-08:00) Pacific Time - Vancouver"},{Value:"America/Whitehorse",Text:"(UTC-08:00) Pacific Time - Whitehorse"},{Value:"Pacific/Pitcairn",Text:"(UTC-08:00) Pitcairn"},{Value:"America/Denver",Text:"(UTC-07:00) Mountain Time"},{Value:"America/Phoenix",Text:"(UTC-07:00) Mountain Time - Arizona"},{Value:"America/Mazatlan",Text:"(UTC-07:00) Mountain Time - Chihuahua, Mazatlan"},{Value:"America/Dawson_Creek",Text:"(UTC-07:00) Mountain Time - Dawson Creek"},{Value:"America/Edmonton",Text:"(UTC-07:00) Mountain Time - Edmonton"},{Value:"America/Hermosillo",Text:"(UTC-07:00) Mountain Time - Hermosillo"},{Value:"America/Yellowknife",Text:"(UTC-07:00) Mountain Time - Yellowknife"},{Value:"America/Belize",Text:"(UTC-06:00) Belize"},{Value:"America/Chicago",Text:"(UTC-06:00) Central Time"},{Value:"America/Mexico_City",Text:"(UTC-06:00) Central Time - Mexico City"},{Value:"America/Regina",Text:"(UTC-06:00) Central Time - Regina"},{Value:"America/Tegucigalpa",Text:"(UTC-06:00) Central Time - Tegucigalpa"},{Value:"America/Winnipeg",Text:"(UTC-06:00) Central Time - Winnipeg"},{Value:"America/Costa_Rica",Text:"(UTC-06:00) Costa Rica"},{Value:"America/El_Salvador",Text:"(UTC-06:00) El Salvador"},{Value:"Pacific/Galapagos",Text:"(UTC-06:00) Galapagos"},{Value:"America/Guatemala",Text:"(UTC-06:00) Guatemala"},{Value:"America/Managua",Text:"(UTC-06:00) Managua"},{Value:"America/Cancun",Text:"(UTC-05:00) America Cancun"},{Value:"America/Bogota",Text:"(UTC-05:00) Bogota"},{Value:"Pacific/Easter",Text:"(UTC-05:00) Easter Island"},{Value:"America/New_York",Text:"(UTC-05:00) Eastern Time"},{Value:"America/Iqaluit",Text:"(UTC-05:00) Eastern Time - Iqaluit"},{Value:"America/Toronto",Text:"(UTC-05:00) Eastern Time - Toronto"},{Value:"America/Guayaquil",Text:"(UTC-05:00) Guayaquil"},{Value:"America/Havana",Text:"(UTC-05:00) Havana"},{Value:"America/Jamaica",Text:"(UTC-05:00) Jamaica"},{Value:"America/Lima",Text:"(UTC-05:00) Lima"},{Value:"America/Nassau",Text:"(UTC-05:00) Nassau"},{Value:"America/Panama",Text:"(UTC-05:00) Panama"},{Value:"America/Port-au-Prince",Text:"(UTC-05:00) Port-au-Prince"},{Value:"America/Rio_Branco",Text:"(UTC-05:00) Rio Branco"},{Value:"America/Halifax",Text:"(UTC-04:00) Atlantic Time - Halifax"},{Value:"America/Barbados",Text:"(UTC-04:00) Barbados"},{Value:"Atlantic/Bermuda",Text:"(UTC-04:00) Bermuda"},{Value:"America/Boa_Vista",Text:"(UTC-04:00) Boa Vista"},{Value:"America/Caracas",Text:"(UTC-04:00) Caracas"},{Value:"America/Curacao",Text:"(UTC-04:00) Curacao"},{Value:"America/Grand_Turk",Text:"(UTC-04:00) Grand Turk"},{Value:"America/Guyana",Text:"(UTC-04:00) Guyana"},{Value:"America/La_Paz",Text:"(UTC-04:00) La Paz"},{Value:"America/Manaus",Text:"(UTC-04:00) Manaus"},{Value:"America/Martinique",Text:"(UTC-04:00) Martinique"},{Value:"America/Port_of_Spain",Text:"(UTC-04:00) Port of Spain"},{Value:"America/Porto_Velho",Text:"(UTC-04:00) Porto Velho"},{Value:"America/Puerto_Rico",Text:"(UTC-04:00) Puerto Rico"},{Value:"America/Santo_Domingo",Text:"(UTC-04:00) Santo Domingo"},{Value:"America/Thule",Text:"(UTC-04:00) Thule"},{Value:"America/St_Johns",Text:"(UTC-03:30) Newfoundland Time - St. Johns"},{Value:"America/Araguaina",Text:"(UTC-03:00) Araguaina"},{Value:"America/Asuncion",Text:"(UTC-03:00) Asuncion"},{Value:"America/Belem",Text:"(UTC-03:00) Belem"},{Value:"America/Argentina/Buenos_Aires",Text:"(UTC-03:00) Buenos Aires"},{Value:"America/Campo_Grande",Text:"(UTC-03:00) Campo Grande"},{Value:"America/Cayenne",Text:"(UTC-03:00) Cayenne"},{Value:"America/Cuiaba",Text:"(UTC-03:00) Cuiaba"},{Value:"America/Fortaleza",Text:"(UTC-03:00) Fortaleza"},{Value:"America/Godthab",Text:"(UTC-03:00) Godthab"},{Value:"America/Maceio",Text:"(UTC-03:00) Maceio"},{Value:"America/Miquelon",Text:"(UTC-03:00) Miquelon"},{Value:"America/Montevideo",Text:"(UTC-03:00) Montevideo"},{Value:"Antarctica/Palmer",Text:"(UTC-03:00) Palmer"},{Value:"America/Paramaribo",Text:"(UTC-03:00) Paramaribo"},{Value:"America/Punta_Arenas",Text:"(UTC-03:00) Punta Arenas"},{Value:"America/Recife",Text:"(UTC-03:00) Recife"},{Value:"Antarctica/Rothera",Text:"(UTC-03:00) Rothera"},{Value:"America/Bahia",Text:"(UTC-03:00) Salvador"},{Value:"America/Santiago",Text:"(UTC-03:00) Santiago"},{Value:"Atlantic/Stanley",Text:"(UTC-03:00) Stanley"},{Value:"America/Noronha",Text:"(UTC-02:00) Noronha"},{Value:"America/Sao_Paulo",Text:"(UTC-02:00) Sao Paulo"},{Value:"Atlantic/South_Georgia",Text:"(UTC-02:00) South Georgia"},{Value:"Atlantic/Azores",Text:"(UTC-01:00) Azores"},{Value:"Atlantic/Cape_Verde",Text:"(UTC-01:00) Cape Verde"},{Value:"America/Scoresbysund",Text:"(UTC-01:00) Scoresbysund"},{Value:"Africa/Abidjan",Text:"(UTC+00:00) Abidjan"},{Value:"Africa/Accra",Text:"(UTC+00:00) Accra"},{Value:"Africa/Bissau",Text:"(UTC+00:00) Bissau"},{Value:"Atlantic/Canary",Text:"(UTC+00:00) Canary Islands"},{Value:"Africa/Casablanca",Text:"(UTC+00:00) Casablanca"},{Value:"America/Danmarkshavn",Text:"(UTC+00:00) Danmarkshavn"},{Value:"Europe/Dublin",Text:"(UTC+00:00) Dublin"},{Value:"Africa/El_Aaiun",Text:"(UTC+00:00) El Aaiun"},{Value:"Atlantic/Faroe",Text:"(UTC+00:00) Faeroe"},{Value:"Etc/UTC",Text:"(UTC+00:00) UTC (no daylight saving)"},{Value:"Europe/Lisbon",Text:"(UTC+00:00) Lisbon"},{Value:"Europe/London",Text:"(UTC+00:00) London"},{Value:"Africa/Monrovia",Text:"(UTC+00:00) Monrovia"},{Value:"Atlantic/Reykjavik",Text:"(UTC+00:00) Reykjavik"},{Value:"UTC",Text:"UTC"},{Value:"Africa/Algiers",Text:"(UTC+01:00) Algiers"},{Value:"Europe/Amsterdam",Text:"(UTC+01:00) Amsterdam"},{Value:"Europe/Andorra",Text:"(UTC+01:00) Andorra"},{Value:"Europe/Berlin",Text:"(UTC+01:00) Berlin"},{Value:"Europe/Brussels",Text:"(UTC+01:00) Brussels"},{Value:"Europe/Budapest",Text:"(UTC+01:00) Budapest"},{Value:"Europe/Belgrade",Text:"(UTC+01:00) Central European Time - Belgrade"},{Value:"Europe/Prague",Text:"(UTC+01:00) Central European Time - Prague"},{Value:"Africa/Ceuta",Text:"(UTC+01:00) Ceuta"},{Value:"Europe/Copenhagen",Text:"(UTC+01:00) Copenhagen"},{Value:"Europe/Gibraltar",Text:"(UTC+01:00) Gibraltar"},{Value:"Africa/Lagos",Text:"(UTC+01:00) Lagos"},{Value:"Europe/Luxembourg",Text:"(UTC+01:00) Luxembourg"},{Value:"Europe/Madrid",Text:"(UTC+01:00) Madrid"},{Value:"Europe/Malta",Text:"(UTC+01:00) Malta"},{Value:"Europe/Monaco",Text:"(UTC+01:00) Monaco"},{Value:"Africa/Ndjamena",Text:"(UTC+01:00) Ndjamena"},{Value:"Europe/Oslo",Text:"(UTC+01:00) Oslo"},{Value:"Europe/Paris",Text:"(UTC+01:00) Paris"},{Value:"Europe/Rome",Text:"(UTC+01:00) Rome"},{Value:"Europe/Stockholm",Text:"(UTC+01:00) Stockholm"},{Value:"Europe/Tirane",Text:"(UTC+01:00) Tirane"},{Value:"Africa/Tunis",Text:"(UTC+01:00) Tunis"},{Value:"Europe/Vienna",Text:"(UTC+01:00) Vienna"},{Value:"Europe/Warsaw",Text:"(UTC+01:00) Warsaw"},{Value:"Europe/Zurich",Text:"(UTC+01:00) Zurich"},{Value:"Asia/Amman",Text:"(UTC+02:00) Amman"},{Value:"Europe/Athens",Text:"(UTC+02:00) Athens"},{Value:"Asia/Beirut",Text:"(UTC+02:00) Beirut"},{Value:"Europe/Bucharest",Text:"(UTC+02:00) Bucharest"},{Value:"Africa/Cairo",Text:"(UTC+02:00) Cairo"},{Value:"Europe/Chisinau",Text:"(UTC+02:00) Chisinau"},{Value:"Asia/Damascus",Text:"(UTC+02:00) Damascus"},{Value:"Asia/Gaza",Text:"(UTC+02:00) Gaza"},{Value:"Europe/Helsinki",Text:"(UTC+02:00) Helsinki"},{Value:"Asia/Jerusalem",Text:"(UTC+02:00) Jerusalem"},{Value:"Africa/Johannesburg",Text:"(UTC+02:00) Johannesburg"},{Value:"Africa/Khartoum",Text:"(UTC+02:00) Khartoum"},{Value:"Europe/Kiev",Text:"(UTC+02:00) Kiev"},{Value:"Africa/Maputo",Text:"(UTC+02:00) Maputo"},{Value:"Europe/Kaliningrad",Text:"(UTC+02:00) Moscow-01 - Kaliningrad"},{Value:"Asia/Nicosia",Text:"(UTC+02:00) Nicosia"},{Value:"Europe/Riga",Text:"(UTC+02:00) Riga"},{Value:"Europe/Sofia",Text:"(UTC+02:00) Sofia"},{Value:"Europe/Tallinn",Text:"(UTC+02:00) Tallinn"},{Value:"Africa/Tripoli",Text:"(UTC+02:00) Tripoli"},{Value:"Europe/Vilnius",Text:"(UTC+02:00) Vilnius"},{Value:"Africa/Windhoek",Text:"(UTC+02:00) Windhoek"},{Value:"Asia/Baghdad",Text:"(UTC+03:00) Baghdad"},{Value:"Europe/Istanbul",Text:"(UTC+03:00) Istanbul"},{Value:"Europe/Minsk",Text:"(UTC+03:00) Minsk"},{Value:"Europe/Moscow",Text:"(UTC+03:00) Moscow+00 - Moscow"},{Value:"Africa/Nairobi",Text:"(UTC+03:00) Nairobi"},{Value:"Asia/Qatar",Text:"(UTC+03:00) Qatar"},{Value:"Asia/Riyadh",Text:"(UTC+03:00) Riyadh"},{Value:"Antarctica/Syowa",Text:"(UTC+03:00) Syowa"},{Value:"Asia/Tehran",Text:"(UTC+03:30) Tehran"},{Value:"Asia/Baku",Text:"(UTC+04:00) Baku"},{Value:"Asia/Dubai",Text:"(UTC+04:00) Dubai"},{Value:"Indian/Mahe",Text:"(UTC+04:00) Mahe"},{Value:"Indian/Mauritius",Text:"(UTC+04:00) Mauritius"},{Value:"Europe/Samara",Text:"(UTC+04:00) Moscow+01 - Samara"},{Value:"Indian/Reunion",Text:"(UTC+04:00) Reunion"},{Value:"Asia/Tbilisi",Text:"(UTC+04:00) Tbilisi"},{Value:"Asia/Yerevan",Text:"(UTC+04:00) Yerevan"},{Value:"Asia/Kabul",Text:"(UTC+04:30) Kabul"},{Value:"Asia/Aqtau",Text:"(UTC+05:00) Aqtau"},{Value:"Asia/Aqtobe",Text:"(UTC+05:00) Aqtobe"},{Value:"Asia/Ashgabat",Text:"(UTC+05:00) Ashgabat"},{Value:"Asia/Dushanbe",Text:"(UTC+05:00) Dushanbe"},{Value:"Asia/Karachi",Text:"(UTC+05:00) Karachi"},{Value:"Indian/Kerguelen",Text:"(UTC+05:00) Kerguelen"},{Value:"Indian/Maldives",Text:"(UTC+05:00) Maldives"},{Value:"Antarctica/Mawson",Text:"(UTC+05:00) Mawson"},{Value:"Asia/Yekaterinburg",Text:"(UTC+05:00) Moscow+02 - Yekaterinburg"},{Value:"Asia/Tashkent",Text:"(UTC+05:00) Tashkent"},{Value:"Asia/Colombo",Text:"(UTC+05:30) Colombo"},{Value:"Asia/Kolkata",Text:"(UTC+05:30) India Standard Time"},{Value:"Asia/Katmandu",Text:"(UTC+05:45) Katmandu"},{Value:"Asia/Almaty",Text:"(UTC+06:00) Almaty"},{Value:"Asia/Bishkek",Text:"(UTC+06:00) Bishkek"},{Value:"Indian/Chagos",Text:"(UTC+06:00) Chagos"},{Value:"Asia/Dhaka",Text:"(UTC+06:00) Dhaka"},{Value:"Asia/Omsk",Text:"(UTC+06:00) Moscow+03 - Omsk"},{Value:"Asia/Thimphu",Text:"(UTC+06:00) Thimphu"},{Value:"Antarctica/Vostok",Text:"(UTC+06:00) Vostok"},{Value:"Indian/Cocos",Text:"(UTC+06:30) Cocos"},{Value:"Asia/Yangon",Text:"(UTC+06:30) Rangoon"},{Value:"Asia/Bangkok",Text:"(UTC+07:00) Bangkok"},{Value:"Indian/Christmas",Text:"(UTC+07:00) Christmas"},{Value:"Antarctica/Davis",Text:"(UTC+07:00) Davis"},{Value:"Asia/Saigon",Text:"(UTC+07:00) Hanoi"},{Value:"Asia/Hovd",Text:"(UTC+07:00) Hovd"},{Value:"Asia/Jakarta",Text:"(UTC+07:00) Jakarta"},{Value:"Asia/Krasnoyarsk",Text:"(UTC+07:00) Moscow+04 - Krasnoyarsk"},{Value:"Asia/Brunei",Text:"(UTC+08:00) Brunei"},{Value:"Asia/Shanghai",Text:"(UTC+08:00) China Time - Beijing"},{Value:"Asia/Choibalsan",Text:"(UTC+08:00) Choibalsan"},{Value:"Asia/Hong_Kong",Text:"(UTC+08:00) Hong Kong"},{Value:"Asia/Kuala_Lumpur",Text:"(UTC+08:00) Kuala Lumpur"},{Value:"Asia/Macau",Text:"(UTC+08:00) Macau"},{Value:"Asia/Makassar",Text:"(UTC+08:00) Makassar"},{Value:"Asia/Manila",Text:"(UTC+08:00) Manila"},{Value:"Asia/Irkutsk",Text:"(UTC+08:00) Moscow+05 - Irkutsk"},{Value:"Asia/Singapore",Text:"(UTC+08:00) Singapore"},{Value:"Asia/Taipei",Text:"(UTC+08:00) Taipei"},{Value:"Asia/Ulaanbaatar",Text:"(UTC+08:00) Ulaanbaatar"},{Value:"Australia/Perth",Text:"(UTC+08:00) Western Time - Perth"},{Value:"Asia/Pyongyang",Text:"(UTC+08:30) Pyongyang"},{Value:"Asia/Dili",Text:"(UTC+09:00) Dili"},{Value:"Asia/Jayapura",Text:"(UTC+09:00) Jayapura"},{Value:"Asia/Yakutsk",Text:"(UTC+09:00) Moscow+06 - Yakutsk"},{Value:"Pacific/Palau",Text:"(UTC+09:00) Palau"},{Value:"Asia/Seoul",Text:"(UTC+09:00) Seoul"},{Value:"Asia/Tokyo",Text:"(UTC+09:00) Tokyo"},{Value:"Australia/Darwin",Text:"(UTC+09:30) Central Time - Darwin"},{Value:"Antarctica/DumontDUrville",Text:'(UTC+10:00) Dumont D"Urville'},{Value:"Australia/Brisbane",Text:"(UTC+10:00) Eastern Time - Brisbane"},{Value:"Pacific/Guam",Text:"(UTC+10:00) Guam"},{Value:"Asia/Vladivostok",Text:"(UTC+10:00) Moscow+07 - Vladivostok"},{Value:"Pacific/Port_Moresby",Text:"(UTC+10:00) Port Moresby"},{Value:"Pacific / Chuuk",Text:"(UTC+10:00) Truk"},{Value:"Australia/Adelaide",Text:"(UTC+10:30) Central Time - Adelaide"},{Value:"Antarctica/Casey",Text:"(UTC+11:00) Casey"},{Value:"Australia/Hobart",Text:"(UTC+11:00) Eastern Time - Hobart"},{Value:"Australia/Sydney",Text:"(UTC+11:00) Eastern Time - Melbourne, Sydney"},{Value:"Pacific/Efate",Text:"(UTC+11:00) Efate"},{Value:"Pacific/Guadalcanal",Text:"(UTC+11:00) Guadalcanal"},{Value:"Pacific/Kosrae",Text:"(UTC+11:00) Kosrae"},{Value:"Asia/Magadan",Text:"(UTC+11:00) Moscow+08 - Magadan"},{Value:"Pacific / Norfolk",Text:"(UTC+11:00) Norfolk"},{Value:"Pacific/Noumea",Text:"(UTC+11:00) Noumea"},{Value:"Pacific/Pohnpei",Text:"(UTC+11:00) Ponape"},{Value:"Pacific/Funafuti",Text:"(UTC+12:00) Funafuti"},{Value:"Pacific/Kwajalein",Text:"(UTC+12:00) Kwajalein"},{Value:"Pacific/Majuro",Text:"(UTC+12:00) Majuro"},{Value:"Asia/Kamchatka",Text:"(UTC+12:00) Moscow+09 - Petropavlovsk - Kamchatskiy"},{Value:"Pacific / Nauru",Text:"(UTC+12:00) Nauru"},{Value:"Pacific/Tarawa",Text:"(UTC+12:00) Tarawa"},{Value:"Pacific/Wake",Text:"(UTC+12:00) Wake"},{Value:"Pacific/Wallis",Text:"(UTC+12:00) Wallis"},{Value:"Pacific/Auckland",Text:"(UTC+13:00) Auckland"},{Value:"Pacific/Enderbury",Text:"(UTC+13:00) Enderbury"},{Value:"Pacific/Fakaofo",Text:"(UTC+13:00) Fakaofo"},{Value:"Pacific/Fiji",Text:"(UTC+13:00) Fiji"},{Value:"Pacific/Tongatapu",Text:"(UTC+13:00) Tongatapu"},{Value:"Pacific/Apia",Text:"(UTC+14:00) Apia"},{Value:"Pacific/Kiritimati",Text:"(UTC+14:00) Kiritimati"}],Dt={},bt=["SU","MO","TU","WE","TH","FR","SA"],Ct=["SU","MO","TU","WE","TH","FR","SA"],St=43,Ot=["first","second","third","fourth","last"],Et="summaryTimes",xt="summaryOn",Vt="every",At="summaryUntil",It="summaryDay",kt="summaryWeek",Mt="summaryMonth",Rt="summaryYear",Ht={SU:"sun",MO:"mon",TU:"tue",WE:"wed",TH:"thu",FR:"fri",SA:"sat"},Pt=/\d/,jt=/[^A-Z]+/,Nt=/[a-z]+|[^a-z]+/gi,Lt=function(){function e(e){this.slots=[],this.processedData=[],this.isDoubleTapped=!1,this.parent=e}return e.prototype.processData=function(e,i,n){var r=this,a=this.parent.activeView.startDate(),s=this.parent.activeView.endDate(),o=this.parent.eventFields,l=[],p=1,c=!1,h=this.parent.resourceBase?this.parent.resourceBase.resourceCollection:[];e.length>0&&t.isNullOrUndefined(e[0][o.id])&&(c=!0);for(var d=this,u=0,g=e;u<g.length;u++)!function(e){c&&(e[o.id]=p++),e=d.updateEventDateTime(e),i?d.processTimezoneChange(e,n):d.parent.isPrinting||d.parent.uiStateValues.isPreventTimezone||(e=d.processTimezone(e));for(var a=0;a<h.length;a++)null!==e[h[parseInt(a.toString(),10)].field]&&0!==e[h[parseInt(a.toString(),10)].field]||(e[h[parseInt(a.toString(),10)].field]=void 0);if(t.isNullOrUndefined(e[o.recurrenceRule])||""!==e[o.recurrenceRule]||(e[o.recurrenceRule]=null),t.isNullOrUndefined(e[o.recurrenceRule])||!t.isNullOrUndefined(e[o.recurrenceID])||d.parent.crudModule&&d.parent.crudModule.crudObj.isCrudAction)if(d.parent.crudModule&&d.parent.crudModule.crudObj.isCrudAction)if(!t.isNullOrUndefined(e[o.recurrenceRule])&&t.isNullOrUndefined(e[o.recurrenceID]))for(var s=0,u=d.generateOccurrence(e,null,!0);s<u.length;s++)!function(e){var t=d.parent.eventsProcessed.filter(function(t){return t[o.startTime].getTime()-e[o.startTime].getTime()==0&&t[o.id]===e[o.id]});e.Guid=t.length>0?t[0].Guid:d.generateGuid(),l.push(e)}(u[s]);else{var g=d.parent.eventsProcessed.filter(function(t){return t[r.parent.eventFields.id]===e[r.parent.eventFields.id]});e.Guid=g.length>0?g[0].Guid:d.generateGuid(),l.push(e)}else e.Guid=d.generateGuid(),l.push(e);else l=l.concat(d.generateOccurrence(e,null,!0))}(g[u]);this.parent.eventsProcessed=[];var v=l.filter(function(e){return!e[r.parent.eventFields.isBlock]});if(this.parent.eventsProcessed=this.filterEvents(a,s,v),!this.parent.activeViewOptions.allowOverlap&&this.parent.eventsProcessed.length>0){this.processedData=this.parent.eventsProcessed;for(var m=[],f=this.parent.eventFields,y=0,T=this.parent.eventsProcessed;y<T.length;y++){var w=T[y],D=this.findOverlappingData(w,m);if(D){if(!this.parent.eventSettings.sortComparer&&(new Date(w[f.endTime]).getTime()-new Date(w[f.startTime]).getTime()>new Date(D[f.endTime]).getTime()-new Date(D[f.startTime]).getTime()&&w[f.startTime]===D[f.startTime]||!0===w[f.isAllDay])){var C=m.indexOf(D);-1!==C&&m.splice(C,1),m.push(w)}}else m.push(w)}this.parent.eventsProcessed=m}for(var S=l.filter(function(e){return e[r.parent.eventFields.isBlock]}),E=0,x=S;E<x.length;E++){var V=x[E];V[o.isAllDay]&&(b(new Date(V[o.startTime].getTime()))<b(new Date(V[o.endTime].getTime()))||(V[o.startTime]=b(V[o.startTime]),V[o.endTime]=O(b(V[o.endTime]),1)))}return this.parent.blockProcessed=S,v},e.prototype.findOverlappingData=function(e,i){for(var n=this.parent.activeViewOptions.group.resources.length>0,r=n?this.parent.resourceBase.resourceCollection:[],a=n?r[r.length-1].field:null,s=this.parent.eventFields,o=new Date(e[s.startTime]),l=new Date(e[s.endTime]),p=0,c=i;p<c.length;p++){var h=c[p];if(o<h[s.endTime]&&l>h[s.startTime]&&h[s.id]!==e[s.id]&&(!n||t.isNullOrUndefined(a)||this.compareResourceValues(h[""+a],e[""+a])))return h}},e.prototype.isOverlapRange=function(e,i){var n=this;void 0===i&&(i=null);for(var r=this.parent.activeViewOptions.group.resources.length>0,a=r?this.parent.resourceBase.resourceCollection:[],s=r?a[a.length-1].field:null,o=Array.isArray(e)?e:[e],l=this.parent.eventFields,p=[],c=!1,h=0,d=o;h<d.length;h++)for(var u=d[h],g=0,v=t.isNullOrUndefined(u[l.recurrenceRule])||!t.isNullOrUndefined(u[l.recurrenceID])&&u[l.recurrenceID]!==u[l.id]||!t.isNullOrUndefined(u[l.recurrenceID])&&"EditSeries"!==i?[u]:this.generateOccurrence(u);g<v.length;g++){var m=v[g],f=function(e){return n.processedData.filter(function(i){return e[l.startTime]<i[l.endTime]&&e[l.endTime]>i[l.startTime]&&i[l.id]!==e[l.id]&&(!r||t.isNullOrUndefined(s)||n.compareResourceValues(i[""+s],e[""+s]))})}(m);f.length>0&&p.push.apply(p,f),this.findOverlappingData(m,this.parent.eventsProcessed)&&(c=!0)}return this.parent.overlapAppointments=p,c},e.prototype.compareResourceValues=function(e,t){var i=function(e){return Array.isArray(e)?e[0]:e};return i(e)===i(t)},e.prototype.checkOverlap=function(e){return!(this.parent.activeViewOptions.allowOverlap||!this.isOverlapRange(e))&&(this.parent.quickPopup.openValidationError("overlapAlert",e),!0)},e.prototype.updateEventDateTime=function(e){return"string"==typeof e[this.parent.eventFields.startTime]&&(e[this.parent.eventFields.startTime]=k(e[this.parent.eventFields.startTime])),"string"==typeof e[this.parent.eventFields.endTime]&&(e[this.parent.eventFields.endTime]=k(e[this.parent.eventFields.endTime])),e},e.prototype.getProcessedEvents=function(e){void 0===e&&(e=this.parent.eventsData);for(var i=[],n=0,r=e;n<r.length;n++){var a=r[n];!t.isNullOrUndefined(a[this.parent.eventFields.recurrenceRule])&&t.isNullOrUndefined(a[this.parent.eventFields.recurrenceID])?i=i.concat(this.generateOccurrence(a)):i.push(a)}return i},e.prototype.timezonePropertyChange=function(e){var t=this.parent.eventsData.concat(this.parent.blockData),i=this.processData(t,!0,e);this.parent.notify(_e,{processedData:i})},e.prototype.timezoneConvert=function(e){var t=this.parent.eventFields;if(e[t.startTimezone]=e[t.startTimezone]||e[t.endTimezone],e[t.endTimezone]=e[t.endTimezone]||e[t.startTimezone],this.parent.timezone){var i=e[t.startTimezone],n=e[t.endTimezone];e[t.startTime]=this.parent.tzModule.convert(e[t.startTime],this.parent.timezone,i),e[t.endTime]=this.parent.tzModule.convert(e[t.endTime],this.parent.timezone,n)}},e.prototype.processTimezoneChange=function(e,t){var i=this.parent.eventFields;e[i.isAllDay]||(t&&this.parent.timezone?(e[i.startTime]=this.parent.tzModule.convert(e[i.startTime],t,this.parent.timezone),e[i.endTime]=this.parent.tzModule.convert(e[i.endTime],t,this.parent.timezone)):!t&&this.parent.timezone?(e[i.startTime]=this.parent.tzModule.add(e[i.startTime],this.parent.timezone),e[i.endTime]=this.parent.tzModule.add(e[i.endTime],this.parent.timezone)):t&&!this.parent.timezone&&(e[i.startTime]=this.parent.tzModule.remove(e[i.startTime],t),e[i.endTime]=this.parent.tzModule.remove(e[i.endTime],t)))},e.prototype.processTimezone=function(e,t){void 0===t&&(t=!1);var i=this.parent.eventFields;if(e[i.isAllDay])return e;if(e[i.startTimezone]||e[i.endTimezone]){var n=e[i.startTimezone]||e[i.endTimezone],r=e[i.endTimezone]||e[i.startTimezone];t?this.parent.timezone?(e[i.startTime]=this.parent.tzModule.convert(e[i.startTime],n,this.parent.timezone),e[i.endTime]=this.parent.tzModule.convert(e[i.endTime],r,this.parent.timezone),e[i.startTime]=this.parent.tzModule.remove(e[i.startTime],this.parent.timezone),e[i.endTime]=this.parent.tzModule.remove(e[i.endTime],this.parent.timezone)):(e[i.startTime]=this.parent.tzModule.remove(e[i.startTime],n),e[i.endTime]=this.parent.tzModule.remove(e[i.endTime],r)):(e[i.startTime]=this.parent.tzModule.add(e[i.startTime],n),e[i.endTime]=this.parent.tzModule.add(e[i.endTime],r),this.parent.timezone&&(e[i.startTime]=this.parent.tzModule.convert(e[i.startTime],n,this.parent.timezone),e[i.endTime]=this.parent.tzModule.convert(e[i.endTime],r,this.parent.timezone)))}else this.parent.timezone&&(t?(e[i.startTime]=this.parent.tzModule.remove(e[i.startTime],this.parent.timezone),e[i.endTime]=this.parent.tzModule.remove(e[i.endTime],this.parent.timezone)):(e[i.startTime]=this.parent.tzModule.add(e[i.startTime],this.parent.timezone),e[i.endTime]=this.parent.tzModule.add(e[i.endTime],this.parent.timezone)));return e},e.prototype.filterBlockEvents=function(e){var i,n=this.parent.eventFields,r=e[n.startTime],a=e[n.endTime];if(this.parent.activeViewOptions.group.resources.length>0){var s=this.getGroupIndexFromEvent(e);i=this.parent.resourceBase.lastResourceLevel[parseInt(s.toString(),10)]}for(var o=t.extend([],this.parent.blockProcessed,null,!0),l=0,p=o;l<p.length;l++){var c=p[l];c[n.isAllDay]&&c[n.endTime].getTime()>b(new Date(c[n.endTime].getTime())).getTime()&&(c[n.startTime]=b(c[n.startTime]),c[n.endTime]=O(b(c[n.endTime]),1))}return this.filterEvents(r,a,o,i)},e.prototype.filterEvents=function(e,t,i,n){void 0===i&&(i=this.parent.eventsProcessed);var r=this.parent.dataModule.getStartEndQuery(e,t),s=new a.DataManager({json:i}).executeLocal((new a.Query).where(r));return n&&(s=this.filterEventsByResource(n,s)),this.sortByTime(s)},e.prototype.filterEventsByRange=function(e,t,i){var n=this,r=[];return r=t&&i?this.filterEvents(t,i,e):t&&!i?e.filter(function(e){return e[n.parent.eventFields.startTime]>=t}):!t&&i?e.filter(function(e){return e[n.parent.eventFields.endTime]<=i}):e,this.sortByTime(r)},e.prototype.filterEventsByResource=function(e,t){void 0===t&&(t=this.parent.eventsProcessed);for(var i={},n=this.parent.resourceBase.resourceCollection,r=0;r<n.length;r++)i[n[parseInt(r.toString(),10)].field]=e.groupOrder[parseInt(r.toString(),10)];var a=Object.keys(i);return t.filter(function(e){return a.every(function(t){return e[""+t]instanceof Array?e[""+t].indexOf(i[""+t])>-1:e[""+t]===i[""+t]})})},e.prototype.sortByTime=function(e){if(!this.parent.eventSettings.sortComparer||"function"!=typeof this.parent.eventSettings.sortComparer&&"string"!=typeof this.parent.eventSettings.sortComparer){var t=this.parent.eventFields;e.sort(function(e,i){var n=e[t.startTime],r=i[t.startTime];return n.getTime()-r.getTime()})}else e=this.customSorting(e);return e},e.prototype.sortByDateTime=function(e){if(!this.parent.eventSettings.sortComparer||"function"!=typeof this.parent.eventSettings.sortComparer&&"string"!=typeof this.parent.eventSettings.sortComparer){var t=this.parent.eventFields;e.sort(function(e,i){var n=e[t.startTime],r=i[t.startTime],a=e[t.endTime],s=i[t.endTime],o=a.getTime()-n.getTime(),l=s.getTime()-r.getTime();return n.getTime()-r.getTime()||l-o})}else e=this.customSorting(e);return e},e.prototype.customSorting=function(e){if("function"==typeof this.parent.eventSettings.sortComparer)return this.parent.eventSettings.sortComparer.call(this.parent,e);if("string"==typeof this.parent.eventSettings.sortComparer){var i=this.parent.eventSettings.sortComparer.split("."),n=void 0;if(t.isNullOrUndefined(window)||(n=window[i[i.length-1]]),n)return n(e)}return e},e.prototype.getSmallestMissingNumber=function(e){for(var t=Math.max.apply(Math,e),i=0;i<t;i++)if(-1===e.indexOf(i))return i;return t+1},e.prototype.splitEventByDay=function(e){var i=this.parent.eventFields,n=[],r=e[i.startTime],a=e[i.endTime];if(b(new Date(r.getTime()))<b(new Date(a.getTime())))for(var s=new Date(r.getTime()),o=O(b(new Date(r.getTime())),1),l=0===a.getHours()&&0===a.getMinutes()?a:O(a,1),p=1,c=I(r.getTime(),l.getTime());o<=a&&s.getTime()!==o.getTime();){var h=t.extend({},e);h[i.startTime]=s,h[i.endTime]=o,h.data={index:p,count:c},h.Guid=this.generateGuid(),h.isSpanned=!0,n.push(h),s=o,b(new Date(s.getTime())).getTime()===b(new Date(a.getTime())).getTime()&&o.getTime()!==a.getTime()?(o=new Date(s.getTime()),o=new Date(o.setHours(a.getHours(),a.getMinutes(),a.getSeconds()))):o=O(b(new Date(s.getTime())),1),p++}else n.push(e);return n},e.prototype.splitEvent=function(e,i){var n=this.parent.eventFields,r=b(e[n.startTime]).getTime(),a=b(e[n.endTime]).getTime();C(e[n.endTime])<=0&&(a=r>(w=O(b(e[n.endTime]),-1).getTime())?r:w);var s=r,o=a,l=[];if(r!==a){r<i[0].getTime()&&(r=i[0].getTime()),a>i[i.length-1].getTime()&&(a=i[i.length-1].getTime());for(var p=r,c=0;c<this.slots.length;c++){var h=this.slots[parseInt(c.toString(),10)];if("WorkWeek"===this.parent.currentView||"TimelineWorkWeek"===this.parent.currentView||this.parent.activeViewOptions.group.byDate||this.parent.activeViewOptions.showWeekend){for(var d=[],u=0,g=h;u<g.length;u++){var v=g[u];d.push(new Date(v))}var m=this.getRenderedDates(d);if(!t.isNullOrUndefined(m)&&m.length>0){h=[];for(var f=0,y=m;f<y.length;f++){var T=y[f];h.push(T.getTime())}}}if("number"==typeof h){var w=h;(h=[]).push(w)}var D=h[0];if((p=p<=D&&a>=D?D:p)>a||D>a)break;if(!this.parent.activeViewOptions.group.byDate&&this.parent.activeViewOptions.showWeekend&&"WorkWeek"!==this.parent.currentView&&"TimelineWorkWeek"!==this.parent.currentView){var S=h.indexOf(p);if(-1!==S){var E=h.indexOf(a),x=-1!==E,V=(E=x?E:h.length-1)-S+1,A=h[parseInt(S.toString(),10)]!==s,I=h[parseInt(E.toString(),10)]!==o;if(l.push(this.cloneEventObject(e,h[parseInt(S.toString(),10)],h[parseInt(E.toString(),10)],V,A,I)),x)break}}else if(this.dateInRange(p,h[0],h[h.length-1])){for(var k=[],M=0;M<h.length;M++)this.dateInRange(h[parseInt(M.toString(),10)],s,o)&&k.push(h[parseInt(M.toString(),10)]);if(k.length>0)if(this.parent.activeViewOptions.group.byDate)for(var R=0,H=k;R<H.length;R++){var P=H[R];l.push(this.cloneEventObject(e,P,P,1,P!==s,P!==o))}else{var A=k[0]!==s,I=k[k.length-1]!==o;l.push(this.cloneEventObject(e,k[0],k[k.length-1],k.length,A,I))}}}}else l.push(this.cloneEventObject(e,r,a,1,!1,!1));return l},e.prototype.cloneEventObject=function(e,i,n,r,a,s){var o=this.parent.eventFields,l=t.extend({},e,null,!0),p={count:r,isLeft:a,isRight:s};return p[o.startTime]=e[o.startTime],p[o.endTime]=e[o.endTime],l.data=p,l[o.startTime]=new Date(i),l[o.endTime]=new Date(n),l},e.prototype.dateInRange=function(e,t,i){return t<=e&&e<=i},e.prototype.getSelectedEventElements=function(e){if(this.removeSelectedAppointmentClass(),this.parent.selectedElements.length<=0)this.parent.selectedElements.push(e);else if(this.parent.selectedElements.filter(function(t){return t.getAttribute("data-guid")===e.getAttribute("data-guid")}).length<=0)for(var t='div[data-guid="'+e.getAttribute("data-guid")+'"]',i=0,n=[].slice.call(this.parent.element.querySelectorAll(t));i<n.length;i++){var r=n[i];this.parent.selectedElements.push(r)}else{var a=this.parent.selectedElements.filter(function(t){return t.getAttribute("data-guid")!==e.getAttribute("data-guid")});this.parent.selectedElements=a}return e&&this.parent.selectedElements.length>0&&this.addSelectedAppointments(this.parent.selectedElements,!1),this.parent.selectedElements},e.prototype.getSelectedEvents=function(){var e=this,t=[],i=[];return[].slice.call(this.parent.element.querySelectorAll(".e-appointment-border")).filter(function(n){0===t.filter(function(e){return e.Guid===n.getAttribute("data-guid")}).length&&t.push(e.getEventByGuid(n.getAttribute("data-guid"))),i.push(n)}),{event:t.length>1?t:t[0],element:i.length>1?i:i[0]}},e.prototype.removeSelectedAppointmentClass=function(){var e=this.getSelectedAppointments();t.removeClass(e,"e-appointment-border"),"Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||t.removeClass(e,"e-active-appointment-agenda")},e.prototype.addSelectedAppointments=function(e,i){"MonthAgenda"!==this.parent.currentView&&this.parent.removeSelectedClass(),t.addClass(e,"e-appointment-border"),e.length>0&&!i&&e[e.length-1].focus()},e.prototype.getSelectedAppointments=function(){return[].slice.call(this.parent.element.querySelectorAll(".e-appointment-border,.e-appointment:focus"))},e.prototype.focusElement=function(e){if(!this.parent.eventWindow.dialogObject||!this.parent.eventWindow.dialogObject.visible){var i=document.activeElement,n=this.parent.getSelectedCells();if(!(n.length>0&&(i&&(this.parent.element.contains(i)||-1!==n.indexOf(i))||e))){var r=this.getSelectedAppointments();return r.length>0?this.parent.activeEventData&&this.parent.activeEventData.element&&r.indexOf(this.parent.activeEventData.element)>-1?void this.parent.activeEventData.element.focus():void r[r.length-1].focus():void 0}if(this.parent.keyboardInteractionModule){var a=!t.isNullOrUndefined(this.parent.activeCellsData)&&this.parent.activeCellsData.element||n[n.length-1];this.parent.keyboardInteractionModule.selectCells(a instanceof Array,a)}}},e.prototype.selectWorkCellByTime=function(e){var i;if("Agenda"===this.parent.currentView||"MonthAgenda"===this.parent.currentView)return i;if(e.length>0){var n=e[e.length-1],r=n[this.parent.eventFields.startTime],a=void 0,s=this.isAllDayAppointment(n);a="Month"===this.parent.currentView||s||!this.parent.activeViewOptions.timeScale.enable?new Date(+r).setHours(0,0,0,0):this.findNearestSlot(r);var o=void 0;o=s&&-1!==["Day","Week","WorkWeek"].indexOf(this.parent.currentView)?this.parent.getAllDayRow():this.parent.getContentTable();var l='[data-date="'+new Date(a).getTime()+'"]';if(!t.isNullOrUndefined(this.parent.activeViewOptions.group.resources)&&this.parent.activeViewOptions.group.resources.length>0&&(l+='[data-group-index="'+this.getGroupIndexFromEvent(n)+'"]'),i=o.querySelector(l))return this.parent.activeCellsData=this.parent.getCellDetails(i),this.parent.keyboardInteractionModule&&this.parent.keyboardInteractionModule.selectCells(!1,i),i}return i},e.prototype.findNearestSlot=function(e){var t=this.parent.activeViewOptions.timeScale.interval*Ke/this.parent.activeViewOptions.timeScale.slotCount,i=Math.round(Qe/t),n=new Date(e);n.setHours(0,0,0,0);var r=Array.from({length:i},function(e,i){return new Date(n.getTime()+i*t)}).reduce(function(t,i){var n=Math.abs(e.getTime()-i.getTime());return!t||n<Math.abs(e.getTime()-t.getTime())?i:t},null);return 1e3*Math.trunc(r.getTime()/1e3)},e.prototype.getGroupIndexFromEvent=function(e){for(var i,n,r,a,s=this.parent.resourceBase.resourceCollection.length-1;s>=0;s--){var o=e[this.parent.resourceBase.resourceCollection[parseInt(s.toString(),10)].field];if(!t.isNullOrUndefined(o)){n=this.parent.resourceBase.resourceCollection[parseInt(s.toString(),10)],i=s,r=n.name,a=n.field;break}}t.isNullOrUndefined(r)&&t.isNullOrUndefined(i)&&(r=this.parent.resourceCollection.slice(-1)[0].name,i=this.parent.resourceCollection.length-1,a=this.parent.resourceCollection.slice(-1)[0].field,n=this.parent.resourceCollection.filter(function(e,t){return e.name===r?(i=t,e):null})[0]);var l=e[""+a]instanceof Array?e[""+a][0]:e[""+a];if(i>0){var p=this.parent.resourceCollection[i-1].field;return this.parent.resourceBase.getIndexFromResourceId(l,r,n,e,p)}return this.parent.resourceBase.getIndexFromResourceId(l,r,n)},e.prototype.isAllDayAppointment=function(e){var t=this.parent.eventFields,i=e[t.isAllDay],n=(L(e[t.endTime])-L(e[t.startTime]))/Qe>=1;return!!(i||"TimeSlot"!==this.parent.eventSettings.spannedEventPlacement&&n)},e.prototype.addEventListener=function(){this.parent.on("document-click",this.appointmentBorderRemove,this)},e.prototype.removeEventListener=function(){this.parent.off("document-click",this.appointmentBorderRemove)},e.prototype.appointmentBorderRemove=function(e){var i=e.event.target;if(t.closest(i,".e-appointment"))"MonthAgenda"!==this.parent.currentView&&this.parent.removeSelectedClass();else if(!t.closest(i,"."+rt)){if(this.parent.uiStateValues.isTapHold&&t.closest(i,".e-work-cells,.e-all-day-cells"))return;this.parent.uiStateValues.isTapHold=!1,this.removeSelectedAppointmentClass(),this.parent.selectedElements=[]}},e.prototype.wireAppointmentEvents=function(e,i,n){void 0===n&&(n=!1);var r=!t.isNullOrUndefined(i)&&i[this.parent.eventFields.isReadonly];t.EventHandler.add(e,"click",this.eventClick,this),this.parent.isAdaptive||this.parent.activeViewOptions.readonly||r||(t.EventHandler.add(e,"touchend",this.eventTouchClick,this),t.EventHandler.add(e,"dblclick",this.eventDoubleClick,this)),this.parent.activeViewOptions.readonly||r||n||(this.parent.resizeModule&&this.parent.resizeModule.wireResizeEvent(e),this.parent.dragAndDropModule&&this.parent.dragAndDropModule.wireDragEvent(e))},e.prototype.eventTouchClick=function(e){var t=this;if(this.parent.uiStateValues.isTouchScroll||this.parent.uiStateValues.isTapHold||this.parent.uiStateValues.action)return void(this.parent.uiStateValues.isTouchScroll=this.parent.uiStateValues.isTapHold=!1);setTimeout(function(){return t.isDoubleTapped=!1},250),e.preventDefault(),this.isDoubleTapped?this.eventDoubleClick(e):this.isDoubleTapped||(this.isDoubleTapped=!0,this.eventClick(e))},e.prototype.renderResizeHandler=function(e,i,n){if(this.parent.resizeModule&&this.parent.allowResizing&&!this.parent.activeViewOptions.readonly&&!n)for(var r=0,a=Object.keys(i);r<a.length;r++){var s=a[r],o=t.createElement("div",{className:"e-event-resize"});switch(s){case"isLeft":i.isLeft||(o.appendChild(t.createElement("div",{className:"e-left-right-resize"})),t.addClass([o],this.parent.enableRtl?"e-right-handler":"e-left-handler"),t.prepend([o],e));break;case"isRight":i.isRight||(o.appendChild(t.createElement("div",{className:"e-left-right-resize"})),t.addClass([o],this.parent.enableRtl?"e-left-handler":"e-right-handler"),t.append([o],e));break;case"isTop":i.isTop||(o.appendChild(t.createElement("div",{className:"e-top-bottom-resize"})),t.addClass([o],"e-top-handler"),t.prepend([o],e));break;case"isBottom":i.isBottom||(o.appendChild(t.createElement("div",{className:"e-top-bottom-resize"})),t.addClass([o],"e-bottom-handler"),t.append([o],e))}}},e.prototype.eventClick=function(e){var i=this,n=e.target;if(!(n.classList.contains("e-drag-clone")||n.classList.contains("e-resize-clone")||n.classList.contains("e-inline-subject")))if((e.ctrlKey||e.metaKey)&&1===e.which&&this.parent.keyboardInteractionModule){this.parent.quickPopup.quickPopup.hide(),this.parent.selectedElements=[].slice.call(this.parent.element.querySelectorAll(".e-appointment-border"));var r=t.closest(e.target,".e-appointment");this.getSelectedEventElements(r),this.activeEventData(e,!1);var a={data:this.parent.activeEventData.event,element:this.parent.activeEventData.element,event:e,requestType:"eventSelect"};this.parent.trigger("select",a);o=t.extend(this.parent.activeEventData,{cancel:!1,originalEvent:e});this.parent.trigger("eventClick",o)}else{this.removeSelectedAppointmentClass(),this.activeEventData(e,!0);var s={data:this.parent.activeEventData.event,element:this.parent.activeEventData.element,event:e,requestType:"eventSelect"};this.parent.trigger("select",s);var o=t.extend(this.parent.activeEventData,{cancel:!1,originalEvent:e});this.parent.trigger("eventClick",o,function(e){if(e.cancel)i.removeSelectedAppointmentClass(),i.parent.selectedElements=[],i.parent.quickPopup&&i.parent.quickPopup.quickPopupHide();else if("Agenda"!==i.parent.currentView&&"MonthAgenda"!==i.parent.currentView||t.addClass([i.parent.activeEventData.element],"e-active-appointment-agenda"),i.parent.allowInline){var n={data:e.event,element:e.element,type:"Event"};i.parent.notify(Ye,n)}else i.parent.notify("eventClick",e)})}},e.prototype.eventDoubleClick=function(e){var i=this;if(this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(!0),"touchend"===e.type&&this.activeEventData(e,!0),this.removeSelectedAppointmentClass(),this.parent.selectedElements=[],!this.parent.activeEventData.element.classList.contains("e-inline-appointment")&&!this.parent.activeEventData.element.querySelector(".e-inline-subject")){var n=t.extend(this.parent.activeEventData,{cancel:!1,originalEvent:e});this.parent.trigger("eventDoubleClick",n,function(e){!e.cancel&&i.parent.eventSettings.allowEditing&&(!t.isNullOrUndefined(i.parent.activeEventData.event)&&t.isNullOrUndefined(i.parent.activeEventData.event[i.parent.eventFields.recurrenceID])?i.parent.eventWindow.openEditor(i.parent.activeEventData.event,"Save"):(i.parent.currentAction="EditOccurrence",i.parent.quickPopup.openRecurrenceAlert()))})}},e.prototype.getEventByGuid=function(e){return this.parent.eventsProcessed.filter(function(t){return t.Guid===e})[0]},e.prototype.getEventById=function(e){var t=this;return this.parent.eventsData.filter(function(i){return i[t.parent.eventFields.id]===e})[0]},e.prototype.generateGuid=function(){var e=new Uint8Array(32);window.crypto.getRandomValues(e);var t=0;return"xyxxxxyx-xxxy-yxxx-xyxx-xxyxxxxyyxxx".replace(/[xy]/g,function(i){var n=15&e[t++];return("x"===i?n:3&n|8).toString(16)})},e.prototype.getEventIDType=function(){return 0!==this.parent.eventsData.length?typeof this.parent.eventsData[0][this.parent.eventFields.id]:0!==this.parent.blockData.length?typeof this.parent.blockData[0][this.parent.eventFields.id]:"string"},e.prototype.getEventMaxID=function(e){var i=this;if(this.parent.eventsData.length<1&&this.parent.blockData.length<1)return 1;var n,r=this.getEventIDType();if("string"===r&&(n=this.generateGuid()),"number"===r){var a=this.parent.eventsData.concat(this.parent.blockData).map(function(e){return e[i.parent.eventFields.id]}).reduce(function(e,t){return Math.max(e,t)});n=(a=t.isNullOrUndefined(e)?a:a+e)+1}return n},e.prototype.activeEventData=function(e,i){var n=this,r=t.closest(e.target,".e-appointment"),a=r.getAttribute("data-guid");i&&(this.addSelectedAppointments([].slice.call(this.parent.element.querySelectorAll('div[data-guid="'+a+'"]')),!0),r.focus());var s=this.getEventByGuid(a);s&&s.isSpanned&&(s=this.parent.eventsData.filter(function(e){return e[n.parent.eventFields.id]===s[n.parent.eventFields.id]})[0]),this.parent.activeEventData={event:s,element:r}},e.prototype.generateOccurrence=function(e,i,n){var r=this,a=e[this.parent.eventFields.startTime],s=e[this.parent.eventFields.endTime],o=e[this.parent.eventFields.recurrenceRule],l=s.getTimezoneOffset()-a.getTimezoneOffset(),p=s.getTime()-a.getTime()-6e4*l;i=new Date((i||this.parent.activeView.startDate()).getTime()-p);var c,h=e[this.parent.eventFields.recurrenceException];"Agenda"!==this.parent.currentView&&n&&(c=S(i,this.parent.activeView.endDate())+1);var d=this.parent.timezone||this.parent.tzModule.getLocalTimezoneName(),u=this.parent.activeViewOptions.firstDayOfWeek,g=this.parent.calendarMode;e[this.parent.eventFields.recurrenceRule]&&this.isDayBasedRecurrence(e)&&this.parent.timezone&&e[this.parent.eventFields.startTimezone]&&e[this.parent.eventFields.endTimezone]&&(a=this.parent.tzModule.convert(e[this.parent.eventFields.startTime],this.parent.timezone,e[this.parent.eventFields.startTimezone]));var v=G(a,o,h,u,c,i,g,d);"Agenda"===this.parent.currentView&&-1===o.indexOf("COUNT")&&-1===o.indexOf("UNTIL")&&(t.isNullOrUndefined(e.generatedDates)?e.generatedDates={start:new Date(v[0]),end:new Date(v[v.length-1])}:(v[0]<e.generatedDates.start.getTime()&&(e.generatedDates.start=new Date(v[0])),v[v.length-1]>e.generatedDates.end.getTime()&&(e.generatedDates.end=new Date(v[v.length-1]))));var m=!1,f=[];e[this.parent.eventFields.recurrenceRule]&&this.isDayBasedRecurrence(e)&&this.parent.timezone&&e[this.parent.eventFields.startTimezone]&&e[this.parent.eventFields.endTimezone]&&(m=!0,f.push.apply(f,v.map(function(t){return r.parent.tzModule.convert(new Date(t),e[r.parent.eventFields.startTimezone],r.parent.timezone).getTime()})));for(var y=[],T=0,w=f=f.length>0?f:v;T<w.length;T++){var D=w[T],b=t.extend({},e,null,!0);D=m?D:this.getDSTAdjustedTime(D,b),b[this.parent.eventFields.startTime]=new Date(D),b[this.parent.eventFields.endTime]=new Date(new Date(D).setMilliseconds(p)),b[this.parent.eventFields.recurrenceID]=b[this.parent.eventFields.id],delete b[this.parent.eventFields.recurrenceException],delete b[this.parent.eventFields.followingID],b.Guid=this.generateGuid(),y.push(b)}return y},e.prototype.isDayBasedRecurrence=function(e){return e[this.parent.eventFields.recurrenceRule].includes("BYMONTHDAY")||e[this.parent.eventFields.recurrenceRule].includes("BYDAY")},e.prototype.getDSTAdjustedTime=function(e,t){var i=e;if(this.parent.timezone&&(t[this.parent.eventFields.startTimezone]||t[this.parent.eventFields.endTimezone])){var n=this.getDSTDiff(t[this.parent.eventFields.startTime],new Date(e),t[this.parent.eventFields.startTimezone]),r=this.getDSTDiff(t[this.parent.eventFields.startTime],new Date(e),this.parent.timezone);i=new Date(e).getTime()-6e4*(n-r)}return i},e.prototype.getDSTDiff=function(e,t,i){return this.parent.tzModule.offset(new Date(e),i)-this.parent.tzModule.offset(new Date(t),i)},e.prototype.getParentEvent=function(e,i){void 0===i&&(i=!1);var n;do{(e=this.getFollowingEvent(e))&&(n=t.extend({},e,null,!0))}while(e&&i);if(i&&n){var r=this.getEventCollections(n),a=r.follow.slice(-1)[0];r.occurrence.length>0&&!n[this.parent.eventFields.recurrenceException]&&(a=r.occurrence.slice(-1)[0]),a&&(n[this.parent.eventFields.recurrenceRule]=a[this.parent.eventFields.recurrenceRule])}return n},e.prototype.getEventCollections=function(e,t){var i=[],n=[],r=e;do{(r=this.getFollowingEvent(r,!0))&&i.push(r),n=n.concat(this.getOccurrenceEvent(r||e))}while(r);var a={};if(t){var s=this.parent.eventFields;a={follow:i.filter(function(e){return e[s.startTime]>=t[s.startTime]}),occurrence:n.filter(function(e){return e[s.startTime]>=t[s.startTime]})}}else a={follow:i,occurrence:n};return a},e.prototype.getFollowingEvent=function(e,t){var i,n=this.parent.eventFields;return i=t?e[n.id]:e[n.recurrenceID]||e[n.followingID],this.parent.eventsData.filter(function(e){return e[t?n.followingID:n.id]===i}).shift()},e.prototype.isFollowingEvent=function(e,t){var i=e[this.parent.eventFields.startTime],n=t[this.parent.eventFields.startTime];return i.getHours()===n.getHours()&&i.getMinutes()===n.getMinutes()&&i.getSeconds()===n.getSeconds()},e.prototype.getOccurrenceEvent=function(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=!1);var n=t?"Guid":i?this.parent.eventFields.followingID:this.parent.eventFields.recurrenceID,r=t?"Guid":this.parent.eventFields.id;return(t?this.parent.eventsProcessed:this.parent.eventsData).filter(function(t){return t[""+n]===e[""+r]})},e.prototype.getOccurrencesByID=function(e){for(var i=this.parent.eventFields,n=[],r=0,a=this.parent.eventsData.filter(function(t){return t[i.id]===e});r<a.length;r++){var s=a[r];t.isNullOrUndefined(s[i.recurrenceRule])||(n=n.concat(this.generateOccurrence(s)))}return n},e.prototype.getOccurrencesByRange=function(e,i){for(var n=this.parent.eventFields,r=[],a=0,s=this.parent.eventsData;a<s.length;a++){var o=s[a];t.isNullOrUndefined(o[n.recurrenceRule])||(r=r.concat(this.generateOccurrence(o)))}return r.filter(function(r){return r[n.startTime]>=e&&r[n.endTime]<=i&&!t.isNullOrUndefined(r[n.recurrenceID])})},e.prototype.getDeletedOccurrences=function(e){var i,n=this.parent.eventFields,r=[];if((i="string"==typeof e||"number"==typeof e?this.parent.eventsData.filter(function(t){return t[n.id]===e})[0]:t.extend({},e,null,!0))[n.recurrenceException])for(var a=i[n.recurrenceException].split(","),s=this,o=0,l=a.length;o<l;o++)!function(o,l){if(0===s.parent.eventsData.filter(function(e){return e[n.recurrenceID]===i[n.id]&&e[n.recurrenceException]===a[parseInt(o.toString(),10)]}).length){var p=X(a[parseInt(o.toString(),10)]),c=t.extend({},e,null,!0);c[n.recurrenceID]=i[n.id],delete c[n.followingID],c[n.recurrenceException]=a[parseInt(o.toString(),10)];var h=new Date(p.getTime()),d=i[n.endTime].getTime()-i[n.startTime].getTime(),u=new Date(h.getTime());u.setMilliseconds(d),c[n.startTime]=new Date(h.getTime()),c[n.endTime]=new Date(u.getTime()),r.push(c)}}(o);return r},e.prototype.applyResourceColor=function(e,i,n,r,a){if(this.parent.resourceBase){var s=this.parent.resourceBase.getResourceColor(i,r);s&&(e.style[n]=t.isNullOrUndefined(a)?s:function(e,t){return e=e.replace("#",""),"rgba("+parseInt(e.substring(0,e.length/3),16)+", "+parseInt(e.substring(e.length/3,2*e.length/3),16)+", "+parseInt(e.substring(2*e.length/3,3*e.length/3),16)+", "+t+")"}(s,a))}},e.prototype.createBlockAppointmentElement=function(e,i,n){var r,a=e[this.parent.eventFields.subject]||this.parent.eventSettings.fields.subject.default,s=t.createElement("div",{className:"e-block-appointment",attrs:{"data-id":"Appointment_"+e[this.parent.eventFields.id],"aria-disabled":"true"}});if(t.isNullOrUndefined(this.parent.activeViewOptions.eventTemplate)){var o=t.createElement("div",{className:"e-subject"});this.parent.sanitize(a,o),r=[o]}else{var l=this.parent.element.id+"_"+this.parent.activeViewOptions.eventTemplateName+"eventTemplate",p=n&&-1===this.parent.currentView.indexOf("Year")?this.parent.getEventTemplateName(i):"eventTemplate";r=this.parent.getAppointmentTemplate()(e,this.parent,p,l,!1,void 0,void 0,this.parent.root)}return t.append(r,s),this.setWrapperAttributes(s,i),s},e.prototype.setWrapperAttributes=function(e,i){t.isNullOrUndefined(this.cssClass)||t.addClass([e],this.cssClass),this.parent.activeViewOptions.group.resources.length>0&&e.setAttribute("data-group-index",i.toString())},e.prototype.getReadonlyAttribute=function(e){return(e[this.parent.eventFields.isReadonly]||this.parent.readonly).toString()},e.prototype.isBlockRange=function(e){for(var i=e instanceof Array?e:[e],n=!1,r=this.parent.eventFields,a=0,s=i;a<s.length;a++){var o=s[a],l=[];t.isNullOrUndefined(o[r.recurrenceRule])||!t.isNullOrUndefined(o[r.recurrenceID])&&o[r.id]!==o[r.recurrenceID]?l.push(o):l=this.generateOccurrence(o);for(var p=0,c=l;p<c.length;p++){var h=c[p];if(this.filterBlockEvents(h).length>0){n=!0;break}}}return this.parent.uiStateValues.isBlock=n,n},e.prototype.getFilterEventsList=function(e,t){return new a.DataManager(e).executeLocal((new a.Query).where(t))},e.prototype.getSeriesEvents=function(e,i){var n=this.parent.eventFields;i=t.isNullOrUndefined(i)?e[n.startTime]:i;var r,s,o,l=[],p=e[n.id],c=e[n.followingID],h="EditSeries"===this.parent.currentAction?"greaterthan":"greaterthanorequal";do{o=new a.Predicate(n.followingID,"equal",p).and(new a.Predicate(n.startTime,h,i)),r=(s=this.getFilterEventsList(this.parent.eventsData,o)).slice(-1)[0],t.isNullOrUndefined(r)||r[n.id]===c?c=null:(l.push(r),p=r[n.id],c=r[n.followingID])}while(1===s.length&&!t.isNullOrUndefined(r[n.followingID]));return l},e.prototype.getEditedOccurrences=function(e,t){for(var i,n=this.parent.eventFields,r=[],s=0,o=e;s<o.length;s++){var l=o[s],p=new a.Predicate(n.recurrenceID,"equal",l[n.id]).or(new a.Predicate(n.recurrenceID,"equal",l[n.followingID]).and(new a.Predicate(n.recurrenceID,"notequal",void 0)).and(new a.Predicate(n.recurrenceID,"notequal",null)));"EditFollowingEvents"!==this.parent.currentAction&&"DeleteFollowingEvents"!==this.parent.currentAction||(p=p.and(new a.Predicate(n.startTime,"greaterthanorequal",t))),i=this.getFilterEventsList(this.parent.eventsData,p),r=r.concat(i)}return r},e.prototype.getRenderedDates=function(e){var i,n=0,r=e.length,a=t.isNullOrUndefined(this.parent.maxDate)?new Date(2099,11,31):this.parent.maxDate,s=t.isNullOrUndefined(this.parent.minDate)?new Date(1900,0,1):this.parent.minDate;if(e[0]<s&&e[e.length-1]>a){for(var o=0;o<e.length;o++)b(e[parseInt(o.toString(),10)]).getTime()===b(new Date(s)).getTime()&&(n=o),b(e[parseInt(o.toString(),10)]).getTime()===b(new Date(a)).getTime()&&(r=o);i=e.filter(function(t){return t>=e[parseInt(n.toString(),10)]&&t<=e[parseInt(r.toString(),10)]})}return i},e.prototype.isValidEvent=function(e,t,i,n){var r=i.getTime()>n.startHour.getTime()&&t.getTime()<n.endHour.getTime(),a=n.startHour.getTime()<=t.getTime()&&e[this.parent.eventFields.startTime].getTime()>=n.startHour.getTime()&&e[this.parent.eventFields.endTime].getTime()<n.endHour.getTime()&&t.getTime()===i.getTime();return r||a},e.prototype.allDayExpandScroll=function(e){var i=0;[].slice.call(this.parent.element.querySelectorAll(".e-header-row")).forEach(function(e){[].slice.call(e.children).forEach(function(e){e.style.top=i+"px"}),i+=e.offsetHeight}),i=e.offsetHeight-i,this.parent.element.querySelector(".e-all-day-cells").style.height=i/12+"em",this.parent.uiStateValues.expand?t.addClass([e],"e-all-day-scroll"):t.removeClass([e],"e-all-day-scroll")},e.prototype.updateEventMinimumDuration=function(e,t,i){if((t.getTime()<i.getTime()||t.getTime()===i.getTime()&&e.startHour.getTime()<i.getTime()&&e.endHour.getTime()>t.getTime()&&-1===this.parent.currentView.indexOf("Timeline"))&&(L(i)-L(t))/Ke<this.parent.eventSettings.minimumEventDuration){var n=new Date(t);if(n.setMinutes(n.getMinutes()+this.parent.eventSettings.minimumEventDuration),(i=n).getTime()>e.endHour.getTime()){var r=new Date(e.endHour.getTime());r.setMinutes(r.getMinutes()-this.parent.eventSettings.minimumEventDuration),t=r,i=e.endHour}}return{startDate:t,endDate:i}},e.prototype.createEventWrapper=function(e,i){void 0===e&&(e=""),void 0===i&&(i=0);for(var n=t.createElement("tr"),r=this.parent.activeView.colLevels.slice(-1)[0],a=this.parent.isReact&&this.parent.activeViewOptions.eventTemplate?" e-appointment-wrapper-hidden":"",s=0,o=r.length;s<o;s++){var l=r[parseInt(s.toString(),10)],p=t.createElement("td",{className:"allDay"===e?"e-all-day-appointment-wrapper"+a:"timeIndicator"===e?"e-timeline-wrapper":"e-day-wrapper"+a,attrs:{"data-date":l.date.getTime().toString()}});if(t.isNullOrUndefined(l.groupIndex)||p.setAttribute("data-group-index",l.groupIndex.toString()),""===e){var c=t.createElement("div",{id:"e-appointment-wrapper-"+i.toString(),className:"e-appointment-wrapper"});p.appendChild(c)}n.appendChild(p),i+=1}return n},e.prototype.getPageCoordinates=function(e){if(t.isNullOrUndefined(e))return e;var i=e.event;return i&&i.changedTouches?i.changedTouches[0]:e.changedTouches?e.changedTouches[0]:i||e},e.prototype.renderSpannedIcon=function(e,i){var n=t.createElement("div",{className:"e-indicator "+et});if(i.isLeft){var r=n.cloneNode();t.addClass([r],"e-left-icon"),t.prepend([r],e)}if(i.isRight){var a=n.cloneNode();t.addClass([a],"e-right-icon"),t.append([a],e)}if(i.isTop){var s=n.cloneNode();t.addClass([s],"e-up-icon"),t.prepend([s],e)}if(i.isBottom){var o=n.cloneNode();t.addClass([o],"e-down-icon"),t.append([o],e)}},e.prototype.addCellHeight=function(e,i,n,r,a,s){if(void 0===s&&(s=!0),this.parent.activeViewOptions.maxEventsPerRow&&!this.parent.rowAutoHeight){for(var o=[].slice.call(this.parent.element.querySelectorAll(e)),l=this.parent.showWeekNumber?[].slice.call(this.parent.element.querySelectorAll(".e-week-number-wrapper tbody tr")):[],p=0,c=o;p<c.length;p++){var h=c[p],d=this.parent.activeViewOptions.maxEventsPerRow*(i+("Month"===this.parent.currentView?n:2))+r+a;l.length>0&&t.setStyleAttribute(l[o.indexOf(h)].firstElementChild,{height:d+"px"}),t.setStyleAttribute(h.firstElementChild,{height:d+"px"})}this.parent.enablePersistence||this.parent.activeViewOptions.allowVirtualScrolling||!s||this.parent.notify(Ge,{})}},e.prototype.unWireEvents=function(){for(var e=0,i=[].slice.call(this.parent.element.querySelectorAll(".e-appointment"));e<i.length;e++){var n=i[e];t.EventHandler.clearEvents(n)}},e.prototype.destroy=function(){this.unWireEvents(),this.parent=null},e}(),qt=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ft=function(e){function i(i){var n=e.call(this,i)||this;return n.dateRender=[],n.renderedEvents=[],n.renderedAllDayEvents=[],n.overlapEvents=[],n.moreEvents=[],n.overlapList=[],n.allDayEvents=[],n.slotCount=n.parent.activeViewOptions.timeScale.slotCount,n.interval=n.parent.activeViewOptions.timeScale.interval,n.allDayLevel=0,n.startHour=n.getStartEndHours(n.parent.activeViewOptions.startHour),n.endHour=n.getStartEndHours(n.parent.activeViewOptions.endHour),n.element=n.parent.activeView.getPanel(),n.fields=n.parent.eventFields,n.animation=new t.Animation({progress:n.animationUiUpdate.bind(n)}),n.addEventListener(),n}return qt(i,e),i.prototype.renderAppointments=function(){var e=this;if(!t.isNullOrUndefined(this.parent)){this.parent.dragAndDropModule&&this.parent.dragAndDropModule.setDragArea(),this.isResourceEventTemplate=this.parent.isSpecificResourceEvents();for(var i=[].slice.call(this.parent.element.querySelectorAll(".e-block-appointment,.e-appointment,.e-row-count-wrapper")),n=!(!this.parent.crudModule||!this.parent.crudModule.crudObj.isCrudAction),r=function(i){if(e.parent.isReact&&!t.isNullOrUndefined(e.parent.activeViewOptions.eventTemplate)){var n=t.closest(i,".e-day-wrapper,.e-all-day-appointment-wrapper");n&&!n.classList.contains("e-appointment-wrapper-hidden")&&t.addClass([n],"e-appointment-wrapper-hidden")}},a=0,s=i;a<s.length;a++){var o=s[a];if(!n||o.classList.contains("e-all-day-appointment")||o.classList.contains("e-row-count-wrapper"))r(o),t.remove(o);else for(var l=parseInt(o.getAttribute("data-group-index"),10),p=0,c=this.parent.crudModule.crudObj.sourceEvent.length;p<c;p++)l!==this.parent.crudModule.crudObj.sourceEvent[parseInt(p.toString(),10)].groupIndex&&l!==this.parent.crudModule.crudObj.targetEvent[parseInt(p.toString(),10)].groupIndex||(r(o),t.remove(o))}if(this.element.querySelector(".e-work-cells")&&(this.parent.virtualScrollModule&&this.parent.virtualScrollModule.updateFocusedWorkCell(),this.allDayElement=[].slice.call(this.element.querySelectorAll(".e-all-day-cells")),this.setAllDayRowHeight(0),0!==this.parent.eventsProcessed.length||0!==this.parent.blockProcessed.length)){var h=this.element.querySelector(".e-all-day-appointment-section");t.EventHandler.remove(h,"click",this.rowExpandCollapse),t.EventHandler.add(h,"click",this.rowExpandCollapse,this),this.renderedEvents=[],this.renderedAllDayEvents=[],this.initializeValues(),this.processBlockEvents(),this.renderEvents("normalEvents"),this.allDayEvents.length>0&&(this.allDayEvents=this.allDayEvents.filter(function(e,t,i){return t===i.map(function(e){return e.Guid}).indexOf(e.Guid)}),t.removeClass(this.allDayElement,"e-animate"),this.slots.push(this.parent.activeView.renderDates.map(function(e){return+e})),this.renderEvents("allDayEvents"),this.animation.animate(this.allDayElement[0])),this.parent.notify(Ge,{}),t.addClass(this.allDayElement,"e-animate"),n&&(this.parent.crudModule.crudObj.isCrudAction=!1),this.parent.renderTemplates(function(){if(e.parent&&e.parent.isReact&&e.parent.activeViewOptions.eventTemplate){var i=[].slice.call(e.parent.element.querySelectorAll(".e-appointment-wrapper-hidden"));t.removeClass(i,"e-appointment-wrapper-hidden")}})}}},i.prototype.initializeValues=function(){if(this.resources=this.parent.activeViewOptions.group.resources.length>0?this.parent.uiStateValues.isGroupAdaptive?[this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]]:this.parent.resourceBase.lastResourceLevel:[],this.resources.length>0&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.virtualScrollModule&&(this.resources=this.parent.resourceBase.renderedResources),this.cellHeight=parseFloat(this.parent.getElementHeight(this.parent.element.querySelector(".e-content-wrap tbody tr")).toFixed(2)),this.dateRender[0]=this.parent.activeView.renderDates,this.parent.activeViewOptions.group.resources.length>0)for(var e=0,t=this.resources.length;e<t;e++)this.dateRender[parseInt(e.toString(),10)]=this.resources[parseInt(e.toString(),10)].renderDates},i.prototype.getHeight=function(e,t){var i=(L(t)-L(e))/Ke*(this.cellHeight*this.slotCount)/this.interval;return i=i<=0?this.cellHeight:i},i.prototype.appendEvent=function(e,i,n,r){var a=this.element.querySelector('.e-appointment-wrapper[id="e-appointment-wrapper-'+n+'"]');this.parent.enableRtl?t.setStyleAttribute(i,{right:r}):t.setStyleAttribute(i,{left:r});var s=i.classList.contains("e-block-appointment")?"blockEvent":"event",o={data:t.extend({},e,null,!0),element:i,cancel:!1,type:s};this.parent.trigger("eventRendered",o,function(e){e.cancel||a.appendChild(i)})},i.prototype.processBlockEvents=function(){for(var e=this.getResourceList(),t=this.getStartCount(),i=0,n=e;i<n.length;i++)for(var r=n[i],a=this.dateRender[parseInt(r.toString(),10)],s=0,o=a.length;s<o;s++){for(var l=new Date(a[parseInt(s.toString(),10)].getTime()),p=b(O(a[parseInt(s.toString(),10)],1)),c=0,h=this.filterEvents(l,p,this.parent.blockProcessed,this.resources[parseInt(r.toString(),10)]);c<h.length;c++){var d=h[c];this.parent.resourceBase&&this.setValues(d,r),this.renderBlockEvents(d,s,r,t),this.cssClass=null,this.groupOrder=null}t+=1}},i.prototype.renderBlockEvents=function(e,i,n,r){var a=this.isSpannedEvent(e,i,n),s=a[this.fields.startTime],o=a[this.fields.endTime],l=V(b(new Date(this.dateRender[parseInt(n.toString(),10)][parseInt(i.toString(),10)].getTime())),this.startHour,this.endHour);if(s<=o&&this.isValidEvent(e,s,o,l)&&this.isWorkDayAvailable(n,s)){var p=void 0,c=void 0;if(a[this.fields.isAllDay]){var h=this.parent.element.querySelector(".e-content-wrap table");c=t.formatUnit(h.offsetHeight),p=t.formatUnit(0)}else c=t.formatUnit(this.getHeight(s,o)),p=t.formatUnit(this.getTopValue(s));e.IsBlock&&(c=t.formatUnit(parseInt(c,10)-1));var d=this.createBlockAppointmentElement(e,n,this.isResourceEventTemplate),u=e.IsBlock?"99%":"100%";t.setStyleAttribute(d,{width:u,height:c,top:p});var g=this.getDayIndex(i,n,r),v=e.IsBlock?"0.5px":"0px";this.appendEvent(e,d,g,v)}},i.prototype.renderEvents=function(e){t.removeClass(this.allDayElement,"e-animate");for(var i,n="allDayEvents"===e?this.sortByDateTime(this.allDayEvents):void 0,r=this.getResourceList(),a=this.getStartCount(),s="allDayEvents"===e?this.parent.getElementHeightFromClass(this.element.querySelector(".e-all-day-appointment-wrapper"),"e-appointment"):0,o="allDayEvents"===e&&this.allDayElement.length>0?this.allDayElement[0].offsetTop:0,l=this,p=0,c=r;p<c.length;p++)!function(r){i=!0,l.parent.crudModule&&l.parent.crudModule.crudObj.isCrudAction&&"allDayEvents"!==e&&!l.parent.uiStateValues.isGroupAdaptive&&0===l.parent.crudModule.crudObj.sourceEvent.filter(function(e){return e.groupIndex===r}).length&&0===l.parent.crudModule.crudObj.targetEvent.filter(function(e){return e.groupIndex===r}).length&&(i=!1),l.slots=[];var p=l.dateRender[parseInt(r.toString(),10)],c=l.getRenderedDates(p)||p;l.slots.push(p.map(function(e){return+e}));for(var h=0,d=p.length;h<d&&p[parseInt(h.toString(),10)]<=c[c.length-1];h++){l.renderedEvents=[];var u=new Date(p[parseInt(h.toString(),10)].getTime()),g=b(O(p[parseInt(h.toString(),10)],1)),v=l.filterEvents(u,g,n,l.resources[parseInt(r.toString(),10)]);if(i)for(var m=0,f=v;m<f.length;m++){var y=f[m];if(l.parent.resourceBase&&l.setValues(y,r),"allDayEvents"===e)l.renderAllDayEvents(y,h,r,a,!1,o,s);else if(l.isAllDayAppointment(y))l.allDayEvents.push(t.extend({},y,null,!0));else{if(l.parent.eventSettings.enableMaxHeight&&l.getOverlapIndex(y,h,!1,r)>0)continue;l.renderNormalEvents(y,h,r,a)}l.cssClass=null,l.groupOrder=null}else for(var T=0,w=v;T<w.length;T++){var D=w[T];l.isAllDayAppointment(D)&&l.allDayEvents.push(t.extend({},D,null,!0))}a+=1}}(c[p])},i.prototype.getStartCount=function(){return this.parent.virtualScrollModule&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.timeScale.enable?parseInt(this.element.querySelector(".e-appointment-wrapper").getAttribute("id").split("-").slice(-1)[0],10):0},i.prototype.getDayIndex=function(e,t,i){var n=this;if(!this.parent.activeViewOptions.group.byDate)return i;if(this.parent.activeViewOptions.group.byDate&&!this.parent.activeViewOptions.group.hideNonWorkingDays){var r=this.parent.resourceBase.lastResourceLevel[0].renderDates.indexOf(this.dateRender[parseInt(t.toString(),10)][parseInt(e.toString(),10)]);return this.resources.length*r+t}for(var a=0,s=this.parent.activeView.colLevels[0],o=this.dateRender[parseInt(t.toString(),10)][parseInt(e.toString(),10)].getTime(),l=[],p=0;p<s.length&&(l=this.parent.resourceBase.resourceDateTree[parseInt(p.toString(),10)],o!==s[parseInt(p.toString(),10)].date.getTime());p++)a+=s[parseInt(p.toString(),10)].colSpan;var c=l.findIndex(function(e){return e.groupOrder.toString()===n.resources[parseInt(t.toString(),10)].groupOrder.toString()});return c<0?a:a+c},i.prototype.setValues=function(e,t){this.parent.activeViewOptions.group.resources.length>0?(this.cssClass=this.resources[parseInt(t.toString(),10)].cssClass,this.groupOrder=this.resources[parseInt(t.toString(),10)].groupOrder):this.cssClass=this.parent.resourceBase.getCssClass(e)},i.prototype.getResourceList=function(){return Array.apply(null,{length:this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive?this.resources.length:1}).map(function(e,t){return t})},i.prototype.createAppointmentElement=function(e,i,n,r){var a=this.parent.eventFields,s=e[a.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),o=t.createElement("div",{className:"e-appointment",attrs:{"data-id":"Appointment_"+e[a.id],"data-guid":e.Guid,role:"button",tabindex:"0","aria-disabled":this.parent.eventBase.getReadonlyAttribute(e),"aria-label":this.parent.getAnnouncementString(e)}});e[this.fields.isReadonly]&&t.addClass([o],"e-read-only");var l=t.createElement("div",{className:"e-appointment-details"});if(o.appendChild(l),this.parent.activeViewOptions.group.resources.length>0){var p=this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:r;o.setAttribute("data-group-index",p.toString())}var c,h=n;if(t.isNullOrUndefined(this.parent.activeViewOptions.eventTemplate)){var d=t.createElement("div",{className:"e-subject"});if(this.parent.sanitize(s,d),i)if(e[a.isAllDay])c=[d];else{c=[];var u=t.createElement("div",{className:"e-time"+(this.parent.isAdaptive?" e-disable":""),innerHTML:this.parent.getTimeString(e[a.startTime])}),g=t.createElement("div",{className:"e-time"+(this.parent.isAdaptive?" e-disable":""),innerHTML:this.parent.getTimeString(e[a.endTime])});t.addClass([d],"e-text-center"),h.isLeft||c.push(u),c.push(d),h.isRight||c.push(g)}else{var v=this.parent.getTimeString(e[a.startTime])+" - "+this.parent.getTimeString(e[a.endTime]),m=t.createElement("div",{className:"e-time"+(this.parent.isAdaptive?" e-disable":""),innerHTML:v}),f=t.createElement("div",{className:"e-location"});this.parent.sanitize(e[a.location]||this.parent.eventSettings.fields.location.default||"",f),c=[d,m,f]}}else{var y=this.parent.element.id+"_"+this.parent.activeViewOptions.eventTemplateName+"eventTemplate",T=this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:r,w=this.isResourceEventTemplate?this.parent.getEventTemplateName(T):"eventTemplate";c=this.parent.getAppointmentTemplate()(e,this.parent,w,y,!1,void 0,void 0,this.parent.root)}if(t.append(c,l),!(this.parent.isAdaptive||t.isNullOrUndefined(e[a.recurrenceRule])&&t.isNullOrUndefined(e[a.recurrenceID]))){var D=e[a.id]===e[a.recurrenceID]?"e-recurrence-icon":"e-recurrence-edit-icon",b=t.createElement("div",{className:et+" "+D});i?l.appendChild(b):o.appendChild(b)}return this.parent.eventBase.renderSpannedIcon(i?l:o,h),t.isNullOrUndefined(this.cssClass)||t.addClass([o],this.cssClass),this.applyResourceColor(o,e,"backgroundColor",this.groupOrder),this.renderResizeHandler(o,h,e[this.fields.isReadonly]),o},i.prototype.createMoreIndicator=function(e,i,n){var r=n+i,a=e[parseInt(r.toString(),10)];if(a.childElementCount<=0){var s=t.createElement("div",{className:"e-row-count-wrapper",id:"e-row-count-wrapper-"+r.toString()}),o=t.createElement("div",{className:"e-more-indicator",attrs:{tabindex:"0","data-index":r.toString(),"data-count":"1"},innerHTML:"+1 "+(this.parent.isAdaptive?"":this.parent.localeObj.getConstant("more"))});s.appendChild(o),a.appendChild(s),t.EventHandler.add(o,"click",this.rowExpandCollapse,this)}else{var l=a.querySelector(".e-more-indicator"),p=parseInt(l.getAttribute("data-count"),10)+1;l.setAttribute("data-count",p.toString()),l.innerHTML="+"+this.parent.globalize.formatNumber(p)+" "+(this.parent.isAdaptive?"":this.parent.localeObj.getConstant("more"))}},i.prototype.isSpannedEvent=function(e,i,n){var r=b(this.dateRender[parseInt(n.toString(),10)][parseInt(i.toString(),10)]),a=this.getRenderedDates(this.dateRender[parseInt(n.toString(),10)])||[r];0===a.filter(function(e){return e.getDay()===i}).length&&(r=b(a[0]));var s=this.parent.eventFields,o=V(r,this.startHour,this.endHour),l=t.extend({},e,null,!0);l.isSpanned={isBottom:!1,isTop:!1,isSameDuration:l[s.startTime].getTime()===l[s.endTime].getTime()},e[s.startTime].getTime()<o.startHour.getTime()&&(l[s.startTime]=o.startHour,l.isSpanned.isTop=!0),e[s.endTime].getTime()>o.endHour.getTime()&&(l[s.endTime]=o.endHour,l.isSpanned.isBottom=!0);var p=this.updateEventMinimumDuration(o,l[s.startTime],l[s.endTime]);return l[s.startTime]=p.startDate,l[s.endTime]=p.endDate,l},i.prototype.isWorkDayAvailable=function(e,t){if(this.parent.activeViewOptions.group.hideNonWorkingDays&&this.resources.length>0){var i=this.resources[parseInt(e.toString(),10)].resourceData[this.resources[parseInt(e.toString(),10)].resource.workDaysField]||this.parent.activeViewOptions.workDays;return i&&i.indexOf(t.getDay())>=0}return!0},i.prototype.renderAllDayEvents=function(e,i,n,r,a,s,o){var l=this,p=this.getRenderedDates(this.dateRender[parseInt(n.toString(),10)])||this.dateRender[parseInt(n.toString(),10)];this.parent.activeViewOptions.group.byDate&&(this.slots[0]=[this.dateRender[parseInt(n.toString(),10)][parseInt(i.toString(),10)].getTime()],p=[this.dateRender[parseInt(n.toString(),10)][parseInt(i.toString(),10)]]);var c=this.splitEvent(e,p)[0],h=new Date(c[this.parent.eventFields.startTime].getTime()),d=new Date(c[this.parent.eventFields.endTime].getTime());if(!(h.getTime()<this.parent.minDate.getTime()||d.getTime()>this.parent.maxDate.getTime())){var u=0,g=1,v=p[0].getTime()<=h.getTime()&&O(p.slice(-1)[0],1).getTime()>=h.getTime();if(h<=d&&v&&this.isWorkDayAvailable(n,h)){var m=[];if(this.renderedAllDayEvents[parseInt(n.toString(),10)]&&(m=this.renderedAllDayEvents[parseInt(n.toString(),10)].filter(function(t){return t.Guid===e.Guid}),this.parent.activeViewOptions.group.byDate&&(m=m.filter(function(e){return e[l.parent.eventFields.startTime]>=p[parseInt(i.toString(),10)]&&e[l.parent.eventFields.endTime]<=O(new Date(+p[parseInt(i.toString(),10)]),1)}))),0===m.length){var f=c.data.count,y=this.getOverlapIndex(c,i,!0,n);c.Index=y,this.allDayLevel=this.allDayLevel<y?y:this.allDayLevel;var T=c.data.isRight?0:"Day"===this.parent.currentView?4:7;f>=0&&(u=100*f-(this.parent.activeViewOptions.allowOverlap?T:0)),t.isNullOrUndefined(this.renderedAllDayEvents[parseInt(n.toString(),10)])&&(this.renderedAllDayEvents[parseInt(n.toString(),10)]=[]),this.renderedAllDayEvents[parseInt(n.toString(),10)].push(t.extend({},c,null,!0));var w,D=[].slice.call(this.element.querySelector(".e-all-day-row").children),b=this.getDayIndex(i,n,r),C=this.element.querySelector(".e-all-day-appointment-wrapper:nth-child("+(b+1)+")");w=a?this.parent.inlineModule.createInlineAppointmentElement(e):this.createAppointmentElement(e,!0,c.data,n),t.addClass([w],"e-all-day-appointment");var S=t.extend({},c.data,null,!0);e.data=S;var E={data:e,element:w,cancel:!1};this.parent.trigger("eventRendered",E,function(i){if(!i.cancel){if(C.appendChild(w),g+=(0===y?s:s+y*o)+1,t.setStyleAttribute(w,{width:u+"%",top:t.formatUnit(g)}),y>1){l.moreEvents.push(w);for(var n=0,r=f;n<r;n++)l.createMoreIndicator(D,n,b)}l.allDayElement[0].setAttribute("data-count",l.allDayLevel.toString());var a=4+(!l.parent.uiStateValues.expand&&l.allDayLevel>2?3*o:(l.allDayLevel+1)*o);l.setAllDayRowHeight(a),l.addOrRemoveClass(),l.wireAppointmentEvents(w,e)}})}}}},i.prototype.renderNormalEvents=function(e,i,n,r,a){var s=this.isSpannedEvent(e,i,n),o=s[this.fields.startTime],l=s[this.fields.endTime],p="0%",c=0,h=V(b(new Date(this.dateRender[parseInt(n.toString(),10)][parseInt(i.toString(),10)].getTime())),this.startHour,this.endHour),d=this.isValidEvent(e,o,l,h);if(!(o.getTime()<this.parent.minDate.getTime()||l.getTime()>O(this.parent.maxDate,1).getTime())&&o<=l&&d&&this.isWorkDayAvailable(n,o)){var u=s.isSpanned.isSameDuration?this.cellHeight:this.getHeight(o,l);o.getTime()>=h.startHour.getTime()&&(c=this.getTopValue(o));var g=this.getOverlapIndex(s,i,!1,n);s.Index=g,this.overlapList.push(s),this.overlapList.length>1?(t.isNullOrUndefined(this.overlapEvents[parseInt(g.toString(),10)])&&(this.overlapEvents[parseInt(g.toString(),10)]=[]),this.overlapEvents[parseInt(g.toString(),10)].push(s)):(this.overlapEvents=[],this.overlapEvents.push([s]));var v={index:g,left:"0%",width:p=this.getEventWidth(),day:r,dayIndex:i,record:s,resource:n},m=this.adjustOverlapElements(v);p=m.appWidth,t.isNullOrUndefined(this.renderedEvents[parseInt(n.toString(),10)])&&(this.renderedEvents[parseInt(n.toString(),10)]=[]),this.renderedEvents[parseInt(n.toString(),10)].push(t.extend({},s,null,!0));var f=void 0;f=a?this.parent.inlineModule.createInlineAppointmentElement(e):this.createAppointmentElement(e,!1,s.isSpanned,n),t.setStyleAttribute(f,{width:this.parent.eventSettings.enableMaxHeight||!this.parent.activeViewOptions.allowOverlap?"100%":m.appWidth,height:u+"px",top:c+"px"});var y=u-40-15*f.querySelectorAll(".e-indicator").length,T=f.querySelector(".e-subject");!this.parent.isAdaptive&&T&&(T.style.maxHeight=t.formatUnit(y));var w=this.getDayIndex(i,n,r),D={};D[this.fields.startTime]=e[this.fields.startTime],D[this.fields.endTime]=e[this.fields.endTime],s.data=D,this.appendEvent(s,f,w,m.appLeft),this.wireAppointmentEvents(f,e)}},i.prototype.getEventWidth=function(){var e=(("Day"===this.parent.currentView?97:94)-this.overlapEvents.length)/this.overlapEvents.length;return(e<0?0:e)+"%"},i.prototype.getEventLeft=function(e,t){var i=(parseFloat(e)+1)*t;return(i>99?99:i)+"%"},i.prototype.getStartEndHours=function(e){if(!t.isNullOrUndefined(e)&&""!==e){var i=new Date(2e3,0,0,0),n=e.split(":");return 2===n.length&&i.setHours(parseInt(n[0],10),parseInt(n[1],10),0),i}return null},i.prototype.getTopValue=function(e){var t=this.getStartEndHours(this.parent.activeViewOptions.startHour),i=60*(e.getHours()-t.getHours())+(e.getMinutes()-t.getMinutes());return this.parent.activeViewOptions.timeScale.enable?i*this.cellHeight*this.slotCount/this.interval:0},i.prototype.getOverlapIndex=function(e,i,n,r){var a=this,s=this.parent.eventFields,o=[],l=-1;if(this.overlapEvents=[],n){if(!t.isNullOrUndefined(this.renderedAllDayEvents[parseInt(r.toString(),10)])){var p=b(new Date(this.dateRender[parseInt(r.toString(),10)][parseInt(i.toString(),10)].getTime()));o=this.renderedAllDayEvents[parseInt(r.toString(),10)].filter(function(e){return b(e[s.startTime]).getTime()<=p.getTime()&&b(e[s.endTime]).getTime()>=p.getTime()}),this.parent.activeViewOptions.group.resources.length>0&&(o=this.filterEventsByResource(this.resources[parseInt(r.toString(),10)],o))}}else{var c=t.isNullOrUndefined(this.renderedEvents[parseInt(r.toString(),10)])?[]:this.renderedEvents[parseInt(r.toString(),10)],h=[],d=e[s.startTime],u=e[s.endTime];this.overlapList=c.filter(function(e){return e[s.endTime]>d&&e[s.startTime]<=u||e[s.startTime]>=u&&e[s.endTime]<=d||e[s.endTime].getTime()===e[s.startTime].getTime()&&e[s.startTime].getTime()===d.getTime()&&e[s.endTime]<u}),this.parent.activeViewOptions.group.resources.length>0&&(this.overlapList=this.filterEventsByResource(this.resources[parseInt(r.toString(),10)],this.overlapList));var g=[];this.overlapList.forEach(function(e){var t=[],i=new Set;for(g.push(e),i.add(e[s.id]),t.push(e);g.length>0;)for(var n=g.shift(),o=n[s.endTime].getTime(),l=n[s.startTime].getTime(),p=0,d=c;p<d.length;p++){var u=d[p],v=u[s.startTime].getTime(),m=u[s.endTime].getTime();if(v>=o)break;i.has(u[s.id])||m>l&&v<o&&(t.push(u),i.add(u[s.id]),g.push(u))}a.parent.activeViewOptions.group.resources.length>0&&(t=a.filterEventsByResource(a.resources[parseInt(r.toString(),10)],t));var f=t.filter(function(e){return-1===a.overlapList.indexOf(e)});f.length>0&&(h=h.concat(f))});for(var v=0;v<h.length-1;v++)for(var m=v+1;m<h.length;m++)h[parseInt(v.toString(),10)][s.id]===h[parseInt(m.toString(),10)][s.id]&&(h.splice(m,1),m--);this.overlapList=this.overlapList.concat(h);for(var f=0,y=o=this.overlapList;f<y.length;f++){var T=y[f],w=T.Index;t.isNullOrUndefined(this.overlapEvents[parseInt(w.toString(),10)])?this.overlapEvents[parseInt(w.toString(),10)]=[T]:this.overlapEvents[parseInt(w.toString(),10)].push(T)}}if(n||(o=o.filter(function(t){return t[s.startTime]===e[s.startTime]&&t[s.endTime]>e[s.endTime]||t[s.endTime]>e[s.startTime]&&t[s.startTime]<e[s.endTime]||t[s.endTime]===e[s.startTime]&&t[s.startTime]===e[s.endTime]||t[s.startTime].getTime()===e[s.startTime].getTime()&&t[s.endTime].getTime()===e[s.endTime].getTime()||t[s.startTime].getTime()===e[s.startTime].getTime()&&t[s.endTime].getTime()<e[s.endTime].getTime()||t[s.endTime].getTime()>e[s.endTime].getTime()})),o.length>0){var D=o.map(function(e){return e.Index});l=D.length>0?this.getSmallestMissingNumber(D):0}return-1===l?0:l},i.prototype.adjustOverlapElements=function(e){for(var i={appWidth:e.width,appLeft:e.left},n=0,r=this.overlapEvents.length;n<r;n++)if(!t.isNullOrUndefined(this.overlapEvents[parseInt(n.toString(),10)]))for(var a=0,s=this.overlapEvents[parseInt(n.toString(),10)].length;a<s;a++){var o=this.getDayIndex(e.dayIndex,e.resource,e.day),l=this.element.querySelector("#e-appointment-wrapper-"+o);if(l&&l.childElementCount>0){var p=this.overlapEvents[parseInt(n.toString(),10)][parseInt(a.toString(),10)].Guid;if(l.querySelectorAll('div[data-guid="'+p+'"]').length>0&&p!==e.record.Guid){var c=l.querySelector('div[data-guid="'+p+'"]');parseFloat(e.width)<=parseFloat(c.style.width)?(this.parent.enableRtl?c.style.right=this.getEventLeft(e.width,n):c.style.left=this.getEventLeft(e.width,n),c.style.width=parseFloat(e.width)+"%",i.appWidth=c.style.width):i.appWidth=c.style.width}else{var h=e.width;t.isNullOrUndefined(this.overlapEvents[n-1])&&(h=this.getEventWidth()),i.appWidth=h,i.appLeft=this.getEventLeft(h,e.index)}}}return i},i.prototype.setAllDayRowHeight=function(e){var i=this.parent.element.querySelector(".e-date-header-wrap");"auto"!==this.parent.height&&this.parent.enableAllDayScroll||t.addClass([i],"e-all-day-auto");var n=this.parent.element.querySelector(".e-all-day-row");if(n.style.height="",this.parent.uiStateValues.expand&&"auto"!==this.parent.height&&this.parent.enableAllDayScroll)n.style.height=e/12+"em",this.parent.eventBase.allDayExpandScroll(i);else{for(var r=0,a=this.allDayElement;r<a.length;r++)a[r].style.height=e/12+"em";t.removeClass([i],"e-all-day-scroll")}},i.prototype.addOrRemoveClass=function(){var e=this;this.moreEvents.filter(function(i){!e.parent.uiStateValues.expand&&e.allDayLevel>2?(t.addClass([i],"e-appointment-hide"),i.setAttribute("tabindex","-1")):(t.removeClass([i],"e-appointment-hide"),i.setAttribute("tabindex","0"))});var i=this.element.querySelector(".e-all-day-appointment-section");this.parent.uiStateValues.expand?(t.removeClass([i],"e-appointment-expand"),t.addClass([i],"e-appointment-collapse")):(t.removeClass([i],"e-appointment-collapse"),t.addClass([i],"e-appointment-expand")),this.allDayLevel>2?t.removeClass([i],"e-disable"):t.addClass([i],"e-disable"),[].slice.call(this.element.querySelectorAll(".e-row-count-wrapper")).forEach(function(i){!e.parent.uiStateValues.expand&&e.allDayLevel>2?t.removeClass([i],"e-disable"):t.addClass([i],"e-disable")})},i.prototype.getEventHeight=function(){var e=t.createElement("div",{className:"e-appointment",styles:"visibility:hidden"});this.element.querySelector(".e-all-day-appointment-wrapper:first-child").appendChild(e);var i=e.offsetHeight;return t.remove(e),i},i.prototype.rowExpandCollapse=function(){var e=this.element.querySelector(".e-all-day-appointment-section");this.parent.uiStateValues.expand=e.classList.contains("e-appointment-expand");var t;this.parent.uiStateValues.expand?(e.setAttribute("title",this.parent.localeObj.getConstant("collapseAllDaySection")),e.setAttribute("aria-label",this.parent.localeObj.getConstant("collapseAllDaySection")),t=(this.allDayLevel+1)*this.getEventHeight()+4):(e.setAttribute("title",this.parent.localeObj.getConstant("expandAllDaySection")),e.setAttribute("aria-label",this.parent.localeObj.getConstant("expandAllDaySection")),t=3*this.getEventHeight()+4,this.parent.element.querySelector(".e-date-header-wrap").scrollTop=0),this.setAllDayRowHeight(t),this.animation.animate(this.allDayElement[0]),this.addOrRemoveClass(),this.animation.animate(e)},i.prototype.animationUiUpdate=function(){this.parent.notify(Ge,{})},i.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed||(this.removeEventListener(),this.allDayElement=null,this.renderedAllDayEvents=null,this.renderedEvents=null,this.slotCount=null,this.interval=null,this.startHour=null,this.endHour=null,this.element=null,this.fields=null,this.animation=null,e.prototype.destroy.call(this))},i}(Lt),Ut=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Bt=function(e){function i(t){var i=e.call(this,t)||this;return i.renderedEvents=[],i.monthHeaderHeight=0,i.moreIndicatorHeight=19,i.renderType="day",i.element=i.parent.activeView.getPanel(),i.fields=i.parent.eventFields,i.maxHeight=i.parent.eventSettings.enableMaxHeight&&!i.parent.eventSettings.enableIndicator&&!i.parent.rowAutoHeight,i.withIndicator=i.parent.eventSettings.enableMaxHeight&&i.parent.eventSettings.enableIndicator&&!i.parent.rowAutoHeight,i.maxOrIndicator=i.maxHeight||i.withIndicator,i.moreIndicatorHeight=i.parent.rowAutoHeight&&i.parent.eventSettings.ignoreWhitespace?0:i.moreIndicatorHeight,i.addEventListener(),i}return Ut(i,e),i.prototype.removeEventWrapper=function(e){if(e.length>0)for(var i=0,n=e="Month"===this.parent.currentView||!this.parent.activeView.isTimelineView()&&!this.parent.activeViewOptions.timeScale.enable?e:[e[0]];i<n.length;i++){var r=n[i];r.parentElement&&r.parentElement.parentNode&&t.remove(r.parentElement)}},i.prototype.renderAppointments=function(){this.parent.dragAndDropModule&&this.parent.dragAndDropModule.setDragArea(),this.isResourceEventTemplate=this.parent.isSpecificResourceEvents();var e=this.parent.element.querySelector(".e-content-wrap");this.parent.rowAutoHeight&&(this.parent.uiStateValues.top=e.scrollTop,this.parent.uiStateValues.left=e.scrollLeft);var i=[].slice.call(this.element.querySelectorAll(".e-appointment-wrapper"));if(this.parent.crudModule&&this.parent.crudModule.crudObj.isCrudAction)for(var n=0,r=this.parent.crudModule.crudObj.sourceEvent.length;n<r;n++){var a=[].slice.call(this.element.querySelectorAll('.e-appointment-wrapper [data-group-index="'+this.parent.crudModule.crudObj.sourceEvent[parseInt(n.toString(),10)].groupIndex+'"]'));if(this.removeEventWrapper(a),this.parent.crudModule.crudObj.targetEvent[parseInt(n.toString(),10)]&&this.parent.crudModule.crudObj.sourceEvent[parseInt(n.toString(),10)].groupIndex!==this.parent.crudModule.crudObj.targetEvent[parseInt(n.toString(),10)].groupIndex){var s=[].slice.call(this.element.querySelectorAll('.e-appointment-wrapper [data-group-index="'+this.parent.crudModule.crudObj.targetEvent[parseInt(n.toString(),10)].groupIndex+'"]'));this.removeEventWrapper(s)}}else for(var o=0,l=i;o<l.length;o++){var p=l[o];t.remove(p)}if(this.removeHeightProperty(nt),this.element.querySelector(".e-work-cells")){if("Month"===this.parent.currentView){var c=t.createElement("div",{className:"e-appointment-wrapper"}),h=this.parent.element.querySelector(".e-work-cells");h.appendChild(c),this.monthHeaderHeight=c.offsetTop-h.offsetTop,h.removeChild(c)}this.eventHeight=this.parent.getElementHeightFromClass(this.element,"e-appointment");var d="."+nt+" tbody tr";this.addCellHeight(d,this.eventHeight,"Month"===this.parent.currentView?0:2,this.monthHeaderHeight,this.moreIndicatorHeight);var u=e.scrollTop;if(this.parent.rowAutoHeight&&this.parent.virtualScrollModule&&!this.parent.virtualScrollModule.isHorizontalScroll&&!t.isNullOrUndefined(this.parent.currentAction)&&(e.scrollTop=e.scrollTop-1),this.parent.activeViewOptions.group.resources.length>0?(this.renderResourceEvents(),this.parent.virtualScrollModule&&this.parent.virtualScrollModule.updateFocusedWorkCell()):this.renderEventsHandler(this.parent.activeView.renderDates,this.parent.activeViewOptions.workDays),this.parent.rowAutoHeight){this.updateBlockElements();var g={cssProperties:this.parent.getCssProperties(),module:this.parent.getModuleName(),isPreventScrollUpdate:!0,scrollPosition:{left:this.parent.uiStateValues.left,top:this.parent.uiStateValues.top}};if(this.parent.virtualScrollModule&&!this.parent.virtualScrollModule.isHorizontalScroll&&(this.parent.currentAction?(e.scrollTop=u,this.parent.currentAction=null):this.parent.virtualScrollModule.updateVirtualScrollHeight()),this.parent.enablePersistence||this.parent.notify(Ge,{}),this.parent.notify(Xe,g),"Month"===this.parent.currentView&&this.parent.showWeekNumber){var v=[].slice.call(this.parent.element.querySelectorAll(".e-content-wrap table tr td:first-child"));[].slice.call(this.parent.element.querySelectorAll("td.e-week-number")).forEach(function(e,i){var n=v[parseInt(i.toString(),10)].offsetHeight;t.setStyleAttribute(e,{height:n+"px"})});var m=this.parent.element.querySelector(".e-week-number-wrapper");t.isNullOrUndefined(m)||(m.scrollTop=this.parent.element.querySelector(".e-content-wrap").scrollTop)}}this.parent.renderTemplates()}},i.prototype.renderEventsHandler=function(e,i,n){this.renderedEvents=[];var r,a,s=0;if(n?(s=n.groupIndex,this.cssClass=n.cssClass,this.groupOrder=n.groupOrder,r=this.parent.eventBase.filterEventsByResource(n,this.parent.eventsProcessed),a=this.parent.eventBase.filterEventsByResource(n,this.parent.blockProcessed),this.workCells=[].slice.call(this.element.querySelectorAll('.e-work-cells[data-group-index="'+s+'"]'))):(r=this.parent.eventsProcessed,a=this.parent.blockProcessed,this.workCells=[].slice.call(this.element.querySelectorAll(".e-work-cells"))),this.sortByDateTime(r),this.sortByDateTime(a),"Month"===this.parent.currentView&&this.parent.rowAutoHeight&&0===this.parent.activeViewOptions.group.resources.length){var o=[].slice.call(this.parent.element.querySelectorAll(".e-content-wrap table tr td:first-child")),l=this.parent.element.querySelector("."+nt).clientHeight/o.length;o.forEach(function(e){t.setStyleAttribute(e,{height:l+"px"})})}var p=this.workCells[this.parent.activeView.isTimelineView()?0:this.workCells.length-1];this.cellWidth=this.parent.getElementWidth(p),this.cellHeight=this.parent.getElementHeight(p),this.dateRender=e;var c=this.getRenderedDates(e);this.getSlotDates(i||this.parent.activeViewOptions.workDays),this.processBlockEvents(a,s,n);for(var h=[],d=0,u=r;d<u.length;d++){var g=u[d];this.parent.resourceBase&&!n&&(this.cssClass=this.parent.resourceBase.getCssClass(g)),h=h.concat(this.splitEvent(g,c||this.dateRender))}for(var v=0;v<this.slots.length;v++){this.renderedEvents=[];for(var m=this.slots[parseInt(v.toString(),10)],f=O(new Date(m[m.length-1]),1),y=0,T=this.filterEvents(new Date(m[0]),f,h);y<T.length;y++){var w=T[y];if(this.maxHeight){var D="Month"===this.parent.currentView?w[this.fields.startTime]:this.getStartTime(w,w.data);if(this.getIndex(D)>0)continue}this.updateIndicatorIcon(w),this.renderEvents(w,s,r)}}this.cssClass=null,this.groupOrder=null},i.prototype.processBlockEvents=function(e,i,n){for(var r=0,a=e;r<a.length;r++){var s=a[r];this.parent.resourceBase&&!n&&(this.cssClass=this.parent.resourceBase.getCssClass(s));var o=[];if("day"!==this.renderType||s[this.fields.isAllDay])o.push(s);else{var l=t.extend({},s,null,!0),p=this.isSameDate(l[this.fields.startTime],l[this.fields.endTime]);if(l.isBlockIcon=p,!p&&C(l[this.fields.startTime])>0&&((c=t.extend({},s,null,!0))[this.fields.endTime]=O(b(new Date(s[this.fields.startTime]+"")),1),c.isBlockIcon=!0,l[this.fields.startTime]=c[this.fields.endTime],o.push(c)),!(p=this.isSameDate(l[this.fields.startTime],l[this.fields.endTime]))&&C(l[this.fields.endTime])>0){var c=t.extend({},s,null,!0);c[this.fields.startTime]=b(new Date(s[this.fields.endTime]+"")),c.isBlockIcon=!0,o.push(c),l[this.fields.endTime]=c[this.fields.startTime]}o.push(l)}for(var h=0,d=o;h<d.length;h++)for(var u=d[h],g=0,v=this.splitEvent(u,this.dateRender);g<v.length;g++){var m=v[g];this.renderBlockEvents(m,i,!!u.isBlockIcon)}}},i.prototype.isSameDate=function(e,t){return new Date(+e).setHours(0,0,0,0)===new Date(+t).setHours(0,0,0,0)},i.prototype.renderBlockEvents=function(e,i,n){var r=e.data,a=this.getStartTime(e,r),s=this.getEndTime(e,r),o=this.parent.getIndexOfDate(this.dateRender,b(new Date(a.getTime())));if(!(o<0||a>s)){var l=this.getCellTd(o),p=this.getPosition(a,s,e[this.fields.isAllDay],o);if(n)this.renderBlockIndicator(l,p,i);else{var c=r.count,h=this.getEventWidth(a,s,e[this.fields.isAllDay],c);h=h<=0?this.cellWidth:h,h=e.IsBlock?h-1:h;var d=this.parent.enableRtl?0:e.IsBlock?p+1:p,u=this.parent.enableRtl?e.IsBlock?p+1:p:0,g=this.cellHeight-this.monthHeaderHeight;g=e.IsBlock?g-1:g;var v=this.getRowTop(i),m=this.createBlockAppointmentElement(e,i,this.isResourceEventTemplate);t.setStyleAttribute(m,{width:h+"px",height:g+"px",left:d+"px",right:u+"px",top:v+"px"}),this.renderEventElement(e,m,l)}}},i.prototype.renderBlockIndicator=function(e,i,n){var r=t.createElement("div",{className:"e-icons e-block-indicator"});t.isNullOrUndefined(e.querySelector(".e-block-indicator"))&&e.appendChild(r)},i.prototype.getStartTime=function(e,t){return e[this.fields.startTime]},i.prototype.getEndTime=function(e,t){return e[this.fields.endTime]},i.prototype.getCellTd=function(e){return this.workCells[parseInt(e.toString(),10)]},i.prototype.getEventWidth=function(e,t,i,n){return n*this.cellWidth-1},i.prototype.getPosition=function(e,t,i,n){return 0},i.prototype.getRowTop=function(e){return 0},i.prototype.updateIndicatorIcon=function(e){if(-1!==this.parent.currentView.indexOf("Timeline")&&"TimelineMonth"!==this.parent.currentView&&!e[this.fields.isAllDay]){var t=e.data,i=this.parent.activeView.getStartHour(),n=this.parent.activeView.getEndHour(),r=V(e[this.fields.startTime],i,n),a=V(e[this.fields.endTime],i,n),s=t[this.fields.startTime],o=t[this.fields.endTime];if(t.isLeft=t.isLeft||s.getTime()<r.startHour.getTime(),t.isRight=t.isRight||o.getTime()>a.endHour.getTime(),b(s).getTime()!==b(o).getTime()){var l=r.startHour,p=a.endHour,c=new Date(b(s));if(c.setHours(p.getHours(),p.getMinutes(),p.getSeconds()),t.isLeft=t.isLeft||s.getTime()>=(l.getDate()===r.endHour.getDate()?c.getTime():O(c,1).getTime()),o.getTime()!==b(o).getTime()){var h=new Date(b(o));t.isRight=t.isRight||o.getTime()<=h.setHours(l.getHours(),l.getMinutes(),l.getSeconds())}}}},i.prototype.renderResourceEvents=function(){var e=this.parent.uiStateValues.isGroupAdaptive?[this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]]:this.parent.resourceBase.renderedResources;if(this.parent.crudModule&&this.parent.crudModule.crudObj.isCrudAction){for(var t=0,i=this.parent.crudModule.crudObj.sourceEvent.length;t<i;t++){var n=this.parent.crudModule.crudObj.sourceEvent[parseInt(t.toString(),10)];if((!this.parent.uiStateValues.isGroupAdaptive||this.parent.uiStateValues.groupIndex===n.groupIndex&&this.parent.uiStateValues.isGroupAdaptive)&&this.renderEventsHandler(n.renderDates,n.workDays,n),this.parent.crudModule.crudObj.sourceEvent[parseInt(t.toString(),10)].groupIndex!==this.parent.crudModule.crudObj.targetEvent[parseInt(t.toString(),10)].groupIndex){var r=this.parent.crudModule.crudObj.targetEvent[parseInt(t.toString(),10)];this.renderEventsHandler(r.renderDates,r.workDays,r)}}this.parent.crudModule.crudObj.isCrudAction=!1}else for(var a=0,s=e;a<s.length;a++){var o=s[a];this.renderEventsHandler(o.renderDates,o.workDays,o)}},i.prototype.getSlotDates=function(e){this.slots=[];for(var t=this.dateRender.map(function(e){return+e}),i=!this.parent.activeViewOptions.showWeekend||this.parent.activeViewOptions.group.byDate&&this.parent.activeViewOptions.group.hideNonWorkingDays?e.length:7;t.length>0;)this.slots.push(t.splice(0,i))},i.prototype.createAppointmentElement=function(e,i,n){void 0===n&&(n=!1);var r=e[this.fields.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),a=t.extend({},e,e.data,!0),s={"data-id":"Appointment_"+e[this.fields.id],role:"button",tabindex:"0","aria-disabled":this.parent.eventBase.getReadonlyAttribute(e),"aria-label":this.parent.getAnnouncementString(a,r)};n||(s["data-guid"]=e.Guid),this.parent.activeViewOptions.group.resources.length>0&&(s["data-group-index"]=i.toString());var o=t.createElement("div",{className:"e-appointment",attrs:s});t.isNullOrUndefined(this.cssClass)||t.addClass([o],this.cssClass),e[this.fields.isReadonly]&&t.addClass([o],"e-read-only");var l=t.createElement("div",{className:"e-appointment-details"});o.appendChild(l);var p,c=e.data,h=this.getEventData(e);if(t.isNullOrUndefined(this.parent.activeViewOptions.eventTemplate)){var d=e[this.fields.location]||this.parent.eventSettings.fields.location.default||"",u=t.createElement("div",{className:"e-subject"});this.parent.sanitize(r+(d?"; "+d:""),u);var g=t.createElement("div",{className:"e-time"+(this.parent.isAdaptive?" e-disable":""),innerHTML:this.parent.getTimeString(c[this.fields.startTime])}),v=t.createElement("div",{className:"e-time"+(this.parent.isAdaptive?" e-disable":""),innerHTML:this.parent.getTimeString(c[this.fields.endTime])});if("Month"===this.parent.currentView)e[this.fields.isAllDay]?(p=[u],t.addClass([u],"e-text-center")):c.count<=1&&!c.isLeft&&!c.isRight?p=[g,u]:(p=[],t.addClass([u],"e-text-center"),c.isLeft||p.push(g),p.push(u),c.isRight||p.push(v));else{var m=void 0;if(e[this.fields.isAllDay])m=[u,t.createElement("div",{className:"e-time",innerHTML:this.parent.localeObj.getConstant("allDay")})];else{var f=this.parent.getTimeString(c[this.fields.startTime])+" - "+this.parent.getTimeString(c[this.fields.endTime]),y=t.createElement("div",{className:"e-time"+(this.parent.isAdaptive?" e-disable":""),innerHTML:f}),T=t.createElement("div",{className:"e-location"});this.parent.sanitize(d,T),m=[u,y,T]}var w=t.createElement("div",{className:"e-inner-wrap"});t.append(m,w),p=[w]}}else{var D=this.parent.element.id+"_"+this.parent.activeViewOptions.eventTemplateName+"eventTemplate",b=this.isResourceEventTemplate?this.parent.getEventTemplateName(i):"eventTemplate";p=this.parent.getAppointmentTemplate()(h,this.parent,b,D,!1,void 0,void 0,this.parent.root)}return t.append(p,l),this.appendEventIcons(e,l),this.renderResizeHandler(o,e.data,e[this.fields.isReadonly]),o},i.prototype.appendEventIcons=function(e,i){var n=e.data;if(!t.isNullOrUndefined(e[this.fields.recurrenceRule])||!t.isNullOrUndefined(e[this.fields.recurrenceID])){var r=e[this.fields.id]===e[this.fields.recurrenceID]?"e-recurrence-icon":"e-recurrence-edit-icon";i.appendChild(t.createElement("div",{className:et+" "+r+(this.parent.isAdaptive?" e-disable":"")}))}if(n.isLeft){var a=t.createElement("div",{className:"e-indicator e-icons e-left-icon"});t.prepend([a],i)}if(n.isRight){var s=t.createElement("div",{className:"e-indicator e-icons e-right-icon"});t.append([s],i)}},i.prototype.renderEvents=function(e,i,n){var r=e[this.fields.startTime],a=e[this.fields.endTime],s=this.parent.getIndexOfDate(this.dateRender,b(r));if(!(s<0||r.getTime()<this.parent.minDate.getTime()||a.getTime()>this.parent.maxDate.getTime())){var o=this.parent.rowAutoHeight?1:this.parent.activeViewOptions.maxEventsPerRow,l=this.getIndex(r);e.Index=l;var p=e.data.count;if(r.getTime()<=a.getTime()){var c=p*this.cellWidth-5,h=this.workCells[parseInt(s.toString(),10)],d=l*(this.eventHeight+0),u=this.monthHeaderHeight+(l+1)*(this.eventHeight+0)+this.moreIndicatorHeight,g=!this.parent.activeViewOptions.maxEventsPerRow||this.parent.rowAutoHeight||this.parent.eventSettings.enableIndicator?this.maxOrIndicator?l<1:this.cellHeight>u:l<o;if(this.parent.rowAutoHeight||g){this.renderedEvents.push(t.extend({},e,null,!0));var v=void 0;if(v=this.inlineValue?this.parent.inlineModule.createInlineAppointmentElement():this.createAppointmentElement(e,i),this.applyResourceColor(v,e,"backgroundColor",this.groupOrder),this.wireAppointmentEvents(v,e),t.setStyleAttribute(v,{width:c+"px",top:d+"px"}),this.renderEventElement(e,v,h),this.parent.rowAutoHeight){var m=this.parent.element.querySelector(".e-content-wrap"),f=this.parent.getElementWidth(m),y=m.offsetHeight===m.clientHeight&&m.offsetWidth===m.clientWidth,T=h.parentElement.firstElementChild;this.updateCellHeight(T,u),y&&(m.offsetWidth>m.clientWidth||f!==this.parent.getElementWidth(m))&&this.adjustAppointments(f)}}else for(var w=0;w<p;w++)if(this.workCells[s+w]){var D=this.workCells[s+w].querySelector(".e-more-indicator");if(D){var C=parseInt(D.getAttribute("data-count"),10)+1;D.setAttribute("data-count",C.toString()),D.setAttribute("aria-label",C+" "+this.parent.localeObj.getConstant("moreEvents")),D.innerHTML=this.getMoreIndicatorText(C)}else{var S=new Date(this.dateRender[s+w].getTime()),E=O(this.dateRender[s+w],1),x=this.workCells[s+w].getAttribute("data-group-index"),V=this.getMoreIndicatorElement(1,S,E);t.isNullOrUndefined(x)||V.setAttribute("data-group-index",x),V.style.top=this.cellHeight-this.monthHeaderHeight-this.moreIndicatorHeight+"px",V.style.width=this.cellWidth-2+"px",this.renderElement(this.workCells[s+w],V),t.EventHandler.add(V,"click",this.moreIndicatorClick,this)}}}}},i.prototype.adjustAppointments=function(e){var t=this,i=this.parent.element.querySelector("."+nt+" tbody tr"),n=this.parent.getElementWidth(this.workCells[0]);this.cellWidth=n/+(this.workCells[0].getAttribute("colspan")||1);var r=n*i.children.length/(e/100);[].slice.call(this.parent.element.querySelectorAll(".e-appointment")).forEach(function(e){t.parent.enableRtl&&"0px"!==e.style.right?e.style.right=parseFloat(e.style.right)/100*r+"px":"0px"!==e.style.left&&(e.style.left=parseFloat(e.style.left)/100*r+"px"),e.style.width=parseFloat(e.style.width)/100*r+"px"})},i.prototype.updateCellHeight=function(e,i){i>e.offsetHeight&&t.setStyleAttribute(e,{height:i+"px"})},i.prototype.updateBlockElements=function(){for(var e=0,i=[].slice.call(this.element.querySelectorAll(".e-block-appointment"));e<i.length;e++){var n=i[e],r=t.closest(n,"tr");this.monthHeaderHeight=n.offsetParent.offsetTop-r.offsetTop,n.style.height=r.offsetHeight-1-this.monthHeaderHeight+"px";var a=r.firstElementChild,s=Math.round(n.offsetWidth/a.offsetWidth);n.style.width=a.offsetWidth*s+"px"}},i.prototype.getFilteredEvents=function(e,i,n,r){var a;if(t.isNullOrUndefined(n))a=this.filterEvents(e,i);else{var s=this.parent.resourceBase.lastResourceLevel[parseInt(n,10)];a=this.filterEvents(e,i,t.isNullOrUndefined(r)?void 0:r,s)}return a},i.prototype.getOverlapEvents=function(e,t){for(var i=[],n=b(e).getTime(),r=0,a=t;r<a.length;r++){var s=a[r];b(s[this.fields.startTime]).getTime()<=n&&b(s[this.fields.endTime]).getTime()>=n&&i.push(s)}return i},i.prototype.getIndex=function(e){var t=-1,i=this.renderedEvents;if(i.length>0){var n=this.getOverlapEvents(e,i).map(function(e){return e.Index});t=n.length>0?this.getSmallestMissingNumber(n):0}return-1===t?0:t},i.prototype.moreIndicatorClick=function(e){var i=this,n=t.closest(e.target,".e-more-indicator"),r=new Date(parseInt(n.getAttribute("data-start-date"),10)),a=new Date(parseInt(n.getAttribute("data-end-date"),10)),s=n.getAttribute("data-group-index"),o={cancel:!1,event:e,element:n,isPopupOpen:!0,startTime:r,endTime:a,viewName:this.parent.getNavigateView()};s&&(o.groupIndex=parseInt(s,10)),this.parent.trigger("moreEventsClick",o,function(t){if(!t.cancel)if(t.isPopupOpen){var n=i.getFilteredEvents(r,a,s),o={date:r,event:n,element:e.target};i.parent.quickPopup.moreEventClick(o,a,s)}else i.parent.setProperties({selectedDate:r},!0),i.parent.changeView(t.viewName,e)})},i.prototype.renderEventElement=function(e,t,i){var n=this,r=t.classList.contains("e-block-appointment")?"blockEvent":"event",a=t.classList.contains("e-appointment"),s={data:"Month"===this.parent.currentView?this.getSpannedTime(e):this.getEventData(e),element:t,cancel:!1,type:r};this.parent.trigger("eventRendered",s,function(e){e.cancel?n.renderedEvents.pop():n.renderElement(i,t,a)})},i.prototype.getSpannedTime=function(e){var i=t.extend({},e,null,!0);return i[this.fields.startTime].getDate()===i.data[this.fields.startTime].getDate()&&(i[this.fields.startTime]=i.data[this.fields.startTime]),i[this.fields.endTime].getDate()===i.data[this.fields.endTime].getDate()&&(i[this.fields.endTime]=i.data[this.fields.endTime]),i},i.prototype.getEventData=function(e){var i=t.extend({},e,null,!0);return i[this.fields.startTime]=e.data[this.fields.startTime],i[this.fields.endTime]=e.data[this.fields.endTime],i},i.prototype.renderElement=function(e,i,n){void 0===n&&(n=!1),this.maxOrIndicator&&n&&this.setMaxEventHeight(i,e);var r=e.querySelector(".e-appointment-wrapper");if(r)r.appendChild(i);else{var a=t.createElement("div",{className:"e-appointment-wrapper"});a.appendChild(i),e.appendChild(a)}},i.prototype.getMoreIndicatorElement=function(e,i,n){return t.createElement("div",{className:"e-more-indicator",innerHTML:this.getMoreIndicatorText(e),attrs:{role:"button",tabindex:"0","aria-label":this.parent.globalize.formatNumber(e)+" "+this.parent.localeObj.getConstant("moreEvents"),"data-count":e.toString(),"data-start-date":i.getTime().toString(),"data-end-date":n.getTime().toString()}})},i.prototype.getMoreIndicatorText=function(e){return"+"+this.parent.globalize.formatNumber(e)+" "+(this.parent.isAdaptive?"":this.parent.localeObj.getConstant("more"))},i.prototype.removeHeightProperty=function(e){for(var t=0,i=[].slice.call(this.element.querySelectorAll("."+e+" tbody tr"));t<i.length;t++)i[t].firstElementChild.style.height=""},i.prototype.setMaxEventHeight=function(e,i){var n=P(i.querySelector(".e-date-header")),r=i.offsetHeight-n-(this.maxHeight?0:this.moreIndicatorHeight);t.setStyleAttribute(e,{height:r+"px","align-items":"center"})},i.prototype.destroy=function(){this.element=null,this.fields=null,this.maxHeight=null,this.withIndicator=null,this.maxOrIndicator=null,this.moreIndicatorHeight=null,this.removeEventListener(),e.prototype.destroy.call(this)},i}(Lt),Wt=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),zt=function(e){function i(t,i){var n=e.call(this,t)||this;n.startHour=n.parent.activeView.getStartHour(),n.endHour=n.parent.activeView.getEndHour(),n.slotCount=n.parent.activeViewOptions.timeScale.slotCount,n.interval=n.parent.activeViewOptions.timeScale.interval,n.day=0,n.rowIndex=0,n.cellTops=[],n.renderType=i,n.eventContainers=[].slice.call(n.element.querySelectorAll("."+at));var r=[].slice.call(n.element.querySelectorAll("."+nt+" tbody tr"));return n.dayLength=0===r.length?0:r[0].children.length,n.content=n.parent.element.querySelector("."+it+"."+nt),n}return Wt(i,e),i.prototype.getSlotDates=function(){if(this.slots=[],this.slots.push(this.parent.activeView.renderDates.map(function(e){return+e})),this.parent.activeViewOptions.headerRows.length>0&&"Hour"!==this.parent.activeViewOptions.headerRows.slice(-1)[0].option){this.renderType="day";var e=this.content.querySelector(".e-work-cells");this.cellWidth=this.parent.getElementWidth(e)/+(e.getAttribute("colspan")||1),this.slotsPerDay=1}else this.slotsPerDay=this.dayLength/this.dateRender.length},i.prototype.getOverlapEvents=function(e,t){var i=[];if("day"===this.renderType)for(var n=0,r=t;n<r.length;n++)b((o=r[n])[this.fields.startTime]).getTime()<=b(new Date(e.getTime())).getTime()&&b(o[this.fields.endTime]).getTime()>=b(new Date(e.getTime())).getTime()&&i.push(o);else for(var a=0,s=t;a<s.length;a++){var o=s[a],l=o.data;(l.trimStartTime.getTime()<=e.getTime()&&l.trimEndTime.getTime()>e.getTime()||l.trimStartTime.getTime()===e.getTime()&&l.trimEndTime.getTime()===e.getTime())&&i.push(o)}return i},i.prototype.getSortComparerIndex=function(e,t){var i=-1,n=this.renderedEvents;if(n.length>0){var r=this.getOverlapSortComparerEvents(e,t,n).map(function(e){return e.Index});i=r.length>0?this.getSmallestMissingNumber(r):0}return-1===i?0:i},i.prototype.getOverlapSortComparerEvents=function(e,t,i){for(var n=[],r=this,a=0,s=i;a<s.length;a++)!function(i){if("day"===r.renderType){var a=b(e).getTime(),s=b(t).getTime(),o=b(i[r.fields.startTime]).getTime(),l=b(i[r.fields.endTime]).getTime();(o<=a&&l>=a||function(){var e=s-(C(t)<=0?Qe:0);return e=a>e?a:e,l>=e&&o<=e}()||o>a&&l<s)&&n.push(i)}else{var p=i.data;(p.trimStartTime.getTime()<=e.getTime()&&e.getTime()<p.trimEndTime.getTime()||e.getTime()<=p.trimStartTime.getTime()&&p.trimStartTime.getTime()<t.getTime())&&n.push(i)}}(s[a]);return n},i.prototype.renderResourceEvents=function(){this.removeHeightProperty("e-resource-column-table");this.addCellHeight(".e-resource-column-table tbody tr",this.eventHeight,2,this.moreIndicatorHeight,0,!1);var e=this.parent.uiStateValues.isGroupAdaptive?[this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]]:this.parent.resourceBase.renderedResources;if(this.parent.crudModule&&this.parent.crudModule.crudObj.isCrudAction){for(var t=0,i=this.parent.crudModule.crudObj.sourceEvent.length;t<i;t++){var n=this.parent.crudModule.crudObj.sourceEvent[parseInt(t.toString(),10)];if(this.rowIndex=n.groupIndex,(!this.parent.uiStateValues.isGroupAdaptive||this.parent.uiStateValues.groupIndex===n.groupIndex&&this.parent.uiStateValues.isGroupAdaptive)&&this.renderEventsHandler(this.parent.activeView.renderDates,this.parent.activeViewOptions.workDays,n),this.parent.crudModule.crudObj.targetEvent[parseInt(t.toString(),10)]&&this.parent.crudModule.crudObj.sourceEvent[parseInt(t.toString(),10)].groupIndex!==this.parent.crudModule.crudObj.targetEvent[parseInt(t.toString(),10)].groupIndex){var r=this.parent.crudModule.crudObj.targetEvent[parseInt(t.toString(),10)];this.rowIndex=r.groupIndex,this.renderEventsHandler(this.parent.activeView.renderDates,this.parent.activeViewOptions.workDays,r)}}this.parent.crudModule.crudObj.isCrudAction=!1}else for(t=0;t<e.length;t++)this.rowIndex=t,this.renderEventsHandler(this.parent.activeView.renderDates,this.parent.activeViewOptions.workDays,e[parseInt(t.toString(),10)])},i.prototype.renderEvents=function(e,i,n){var r=e[this.fields.startTime],a=e[this.fields.endTime];if(!(r.getTime()<this.parent.minDate.getTime()||a.getTime()>this.parent.maxDate.getTime())){var s=e.data;r=this.getStartTime(e,s),a=this.getEndTime(e,s);var o=V(e[this.fields.startTime],this.startHour,this.endHour),l=this.updateEventMinimumDuration(o,r,a);if(r=l.startDate,a=l.endDate,this.day=this.parent.getIndexOfDate(this.dateRender,b(new Date(r.getTime()))),!(this.day<0)){var p=this.getCellTd(),c=this.parent.rowAutoHeight?1:this.parent.activeViewOptions.maxEventsPerRow,h=t.isNullOrUndefined(this.parent.eventSettings.sortComparer)?this.getIndex(r):this.getSortComparerIndex(r,a);e.Index=h;var d=this.eventHeight,u=s.count,g=t.extend({},e,null,!0);g[this.fields.startTime]=s[this.fields.startTime],g[this.fields.endTime]=s[this.fields.endTime];var v=V(b(new Date(this.dateRender[this.day].getTime())),this.startHour,this.endHour),m=!0;if(m=!(!this.isDayProcess()&&!g[this.fields.isAllDay])||this.isValidEvent(g,r,a,v),r<=a&&m){var f=this.getEventWidth(r,a,e[this.fields.isAllDay],u);f="day"===this.renderType?f-2:f;var y=0,T=0,w=this.getPosition(r,a,e[this.fields.isAllDay],this.day);f=f<=0?this.cellWidth:f,this.renderedEvents.push(t.extend({},e,null,!0)),t.isNullOrUndefined(this.cellTops[parseInt(i.toString(),10)])&&(this.cellTops[parseInt(i.toString(),10)]=this.getRowTop(i));var D=this.cellTops[parseInt(i.toString(),10)],C=D+(this.maxHeight?0:2)+h*(d+2);y=this.parent.enableRtl?0:w,T=this.parent.enableRtl?w:0;var S=(h+1)*(d+2)+this.moreIndicatorHeight,E=!this.parent.activeViewOptions.maxEventsPerRow||this.parent.rowAutoHeight||this.parent.eventSettings.enableIndicator?this.maxOrIndicator?h<1:this.cellHeight>S:h<c;if(this.parent.rowAutoHeight||E){var x=void 0;if(x=t.isNullOrUndefined(this.inlineValue)?this.createAppointmentElement(e,i):this.parent.inlineModule.createInlineAppointmentElement(),this.applyResourceColor(x,e,"backgroundColor",this.groupOrder),t.setStyleAttribute(x,{width:f+"px",left:y+"px",right:T+"px",top:C+"px"}),this.wireAppointmentEvents(x,e),this.parent.rowAutoHeight){var A=this.parent.element.querySelector(".e-content-wrap"),I=this.parent.getElementWidth(A),k=A.offsetHeight===A.clientHeight&&A.offsetWidth===A.clientWidth;this.renderEventElement(e,x,p);var M=this.getFirstChild(i);this.updateCellHeight(M,S),k&&(A.offsetWidth>A.clientWidth||I!==this.parent.getElementWidth(A))&&this.adjustAppointments(I)}else this.renderEventElement(e,x,p)}else for(var R=0;R<u;R++){var H=p.querySelector(".e-more-indicator"),P=this.parent.enableRtl?T:y;P=Math.floor(P/this.cellWidth)*this.cellWidth;var j=this.interval/this.slotCount,N="TimelineMonth"===this.parent.activeViewOptions.option||"day"===this.renderType||0!==R?new Date(this.dateRender[this.day+R].getTime()):new Date(r),q=O(this.dateRender[this.day+R],1);if("TimelineMonth"===this.parent.activeViewOptions.option||"day"===this.renderType){var F=this.getPosition(N,q,e[this.fields.isAllDay],this.day+R);this.renderTimelineMoreIndicator(r,N,q,d,j,i,n,D,y,T,p,H,P,F)}else for(var U=(L(a)-L(r))/Ke*this.slotCount/this.interval,B=0;B<U&&(N=0===B?new Date(N.getTime()):new Date(N.getTime()+6e4*j),U<1&&(N=this.adjustToNearestTimeSlot(N,j)),q=new Date(N.getTime()+6e4*j),!(U>=1&&q.getTime()>a.getTime()));B++){var W=this.getPosition(N,q,!1,this.day+R);if(P>W)break;P=W,this.renderTimelineMoreIndicator(r,N,q,d,j,i,n,D,y,T,p,H,P,W)}}}this.parent.renderTemplates()}}},i.prototype.adjustToNearestTimeSlot=function(e,t){var i=new Date(e),n=60*i.getHours()*60*1e3+60*i.getMinutes()*1e3,r=Math.floor(n/(60*t*1e3))*(60*t*1e3),a=new Date(i.getTime());return a.setHours(r/36e5%24),a.setMinutes(r%36e5/6e4),a},i.prototype.renderTimelineMoreIndicator=function(e,i,n,r,a,s,o,l,p,c,h,d,u,g){if(p=this.parent.enableRtl?c=g:g,u=this.parent.enableRtl?c:p,u=Math.floor(u/this.cellWidth)*this.cellWidth,h&&t.isNullOrUndefined(d)||!this.isAlreadyAvail(u,h)){var v="TimelineMonth"===this.parent.activeViewOptions.option||"day"===this.renderType?new Date(+e):i,m=new Date(v.setMinutes(Math.floor(v.getMinutes()/a)*a)),f=new Date(m.getTime()+6e4*a),y=void 0;this.parent.activeViewOptions.group.resources.length>0&&!t.isNullOrUndefined(s)&&(y=s.toString());var T=this.getFilterEvents(i,n,m,f,y,o),w=this.cellHeight-this.moreIndicatorHeight;r=this.withIndicator?w-2:r;var D=Math.floor(w/(r+2)),b=this.parent.activeViewOptions.maxEventsPerRow&&!this.parent.eventSettings.enableIndicator?T.length-this.parent.activeViewOptions.maxEventsPerRow:T.length-D<=0?1:T.length-D,C=void 0;C="day"===this.renderType?this.getMoreIndicatorElement(b,i,n):this.getMoreIndicatorElement(b,m,f),t.isNullOrUndefined(y)||C.setAttribute("data-group-index",y),C.style.top=l+w+"px",C.style.width=this.cellWidth+"px",C.style.left=Math.floor(p/this.cellWidth)*this.cellWidth+"px",C.style.right=Math.floor(c/this.cellWidth)*this.cellWidth+"px",this.renderElement(h,C),t.EventHandler.add(C,"click",this.moreIndicatorClick,this)}},i.prototype.updateCellHeight=function(e,i){if(i>(""===e.style.height?this.cellHeight:parseInt(e.style.height,10))){if(t.setStyleAttribute(e,{height:i+"px"}),this.parent.activeViewOptions.group.resources.length>0){var n=this.parent.element.querySelector('.e-resource-column-table tbody td[data-group-index="'+e.getAttribute("data-group-index")+'"]');n&&t.setStyleAttribute(n,{height:i+"px"})}var r=this.parent.element.querySelector(".e-month-header-wrapper table tr:nth-child("+(e.parentElement.rowIndex+1)+") td");r&&t.setStyleAttribute(r,{height:i+"px"})}},i.prototype.getFirstChild=function(e){var t="."+nt+" tbody td",i="";return this.parent.activeViewOptions.group.resources.length>0&&(i='[data-group-index="'+e.toString()+'"]'),this.parent.element.querySelector(t+i)},i.prototype.updateBlockElements=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll(".e-block-appointment"));e<t.length;e++){var i=t[e],n=parseInt(i.getAttribute("data-group-index"),10),r=this.getFirstChild(n);i.style.height=r.offsetHeight-1+"px";var a=i.offsetWidth/r.offsetWidth;i.style.width=r.offsetWidth*a+"px"}for(var s=0,o=[].slice.call(this.element.querySelectorAll(".e-block-indicator"));s<o.length;s++){var i=o[s],n=parseInt(i.getAttribute("data-group-index"),10);i.style.top=this.getRowTop(n)+this.getFirstChild(n).offsetHeight-18+"px"}},i.prototype.getStartTime=function(e,t){var i=e[this.fields.startTime],n=V(i,this.startHour,this.endHour);return i=this.isDayProcess()?e[this.fields.startTime]:n.startHour.getTime()>=t[this.fields.startTime]?n.startHour:n.endHour.getTime()<=t[this.fields.startTime]?this.getNextDay(n.startHour,t):t[this.fields.startTime],t.trimStartTime=e[this.fields.isAllDay]?n.startHour:t[this.fields.startTime],i},i.prototype.getNextDay=function(e,t){for(var i,n=1;n<=this.dateRender.length;n++)if(i=O(e,n),-1!==this.parent.getIndexOfDate(this.dateRender,b(new Date(e.getTime()))))return t.count=t.count-1,i;return i},i.prototype.getEndTime=function(e,t){var i=e[this.fields.endTime],n=V(i,this.startHour,this.endHour);return this.isDayProcess()?i=t[this.fields.endTime]:(i=t[this.fields.endTime],(n.endHour.getTime()<=t[this.fields.endTime]||e[this.fields.isAllDay])&&(i=n.endHour),n.startHour.getTime()>=t[this.fields.endTime].getTime()&&!e[this.fields.isAllDay]&&(i=this.getPreviousDay(n.startHour,n.endHour,t))),t.trimEndTime=e[this.fields.isAllDay]?n.endHour:t[this.fields.endTime],i},i.prototype.getPreviousDay=function(e,t,i){for(var n=1;n<=this.dateRender.length;n++){var r=O(t,-n);if(-1!==this.parent.getIndexOfDate(this.dateRender,b(new Date(e.getTime())))){(r=b(new Date(r.getTime()))).setHours(t.getHours(),t.getMinutes(),t.getSeconds());var a=i.count,s=i[this.fields.endTime];return i.count=0!==s.getHours()||0!==s.getMinutes()?a-1:a,r}}return i[this.fields.endTime]},i.prototype.getEventWidth=function(e,t,i,n){return"day"===this.renderType||i?n*this.slotsPerDay*this.cellWidth:this.isSameDay(e,t)?this.getSameDayEventsWidth(e,t):this.getSpannedEventsWidth(e,t,n)},i.prototype.getSameDayEventsWidth=function(e,t){return(L(t)-L(e))/Ke*(this.cellWidth*this.slotCount)/this.getIntervalInMinutes(e)},i.prototype.getSpannedEventsWidth=function(e,t,i){var n,r=i*this.slotsPerDay*this.cellWidth,a=V(b(new Date(e.getTime())),this.startHour,this.endHour),s=this.getSameDayEventsWidth(a.startHour,e);if(-1===this.parent.getIndexOfDate(this.dateRender,b(new Date(t.getTime()))))n=0;else{var o=V(b(new Date(t.getTime())),this.startHour,this.endHour),l=o.startHour,p=o.endHour,c=this.interval/this.slotCount,h=this.getEndTimeOfLastSlot(l,p,c),d=p<h?p:h;n=this.getSameDayEventsWidth(t,d),n=this.slotsPerDay*this.cellWidth===n?0:n}var u=s+n;return r>u?r-u:r-s},i.prototype.getEndTimeOfLastSlot=function(e,t,i){var n=(t.getTime()-e.getTime())/6e4,r=Math.floor(n/i)*i,a=new Date(e);return a.setMinutes(r),a},i.prototype.isSameDay=function(e,t){return this.parent.getIndexOfDate(this.dateRender,b(new Date(e.getTime())))===this.parent.getIndexOfDate(this.dateRender,b(new Date(t.getTime())))},i.prototype.getAppointmentLeft=function(e,t,i){var n=this.isSameDay(t,e.startHour)?(L(t)-L(e.startHour))/(Ke*this.getIntervalInMinutes(t))*this.slotCount:0;return 0===i?n:Math.round((L(e.endHour)-L(e.startHour))/this.interval/Ke*this.slotCount)*i+n},i.prototype.getPosition=function(e,t,i,n){if("day"===this.renderType||i)return n*this.slotsPerDay*this.cellWidth;var r=V(b(new Date(this.dateRender[parseInt(n.toString(),10)].getTime())),this.startHour,this.endHour);return(r.endHour.getTime()<=t.getTime()&&r.startHour.getTime()>=e.getTime()?this.getAppointmentLeft(r,r.startHour,n):r.endHour.getTime()<=t.getTime()?this.getAppointmentLeft(r,e,n):r.startHour.getTime()>=e.getTime()?this.getAppointmentLeft(r,r.startHour,n):this.getAppointmentLeft(r,e,n))*this.cellWidth},i.prototype.getFilterEvents=function(e,t,i,n,r,a){return"day"===this.renderType?this.getFilteredEvents(e,t,r,a):this.getFilteredEvents(i,n,r,a)},i.prototype.getIntervalInMinutes=function(e){if(1!==this.slotsPerDay)return this.interval;var t=V(b(new Date(e.getTime())),this.startHour,this.endHour);return(t.endHour.getTime()-t.startHour.getTime())/Ke},i.prototype.isAlreadyAvail=function(e,t){for(var i=[].slice.call(t.querySelectorAll(".e-more-indicator")),n=0;n<i.length;n++){var r=void 0;if(i&&(r=this.parent.enableRtl?i[parseInt(n.toString(),10)].style.right:i[parseInt(n.toString(),10)].style.left),parseInt(r,10)===Math.floor(e))return!0}return!1},i.prototype.getRowTop=function(e){return this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive?this.parent.element.querySelector('.e-content-wrap tbody td[data-group-index="'+e.toString()+'"]').offsetTop:0},i.prototype.getCellTd=function(){var e=this.parent.uiStateValues.isGroupAdaptive?0:this.rowIndex;return this.eventContainers[parseInt(e.toString(),10)]},i.prototype.renderBlockIndicator=function(e,i,n){if(!(this.parent.headerRows.length>0&&("Hour"!==this.parent.headerRows[this.parent.headerRows.length-1].option||"Date"!==this.parent.headerRows[this.parent.headerRows.length-1].option)||(i=Math.floor(i/this.cellWidth)*this.cellWidth+this.cellWidth-22,this.isAlreadyAvail(i,e)))){var r=t.createElement("div",{className:"e-icons e-block-indicator"});this.parent.activeViewOptions.group.resources.length>0&&r.setAttribute("data-group-index",n.toString()),this.parent.enableRtl?r.style.right=i+"px":r.style.left=i+"px",r.style.top=this.getRowTop(n)+this.cellHeight-18+"px",this.renderElement(e,r)}},i.prototype.setMaxEventHeight=function(e,i){t.setStyleAttribute(e,{height:this.cellHeight-(this.maxHeight?0:2)-(this.maxHeight?0:this.moreIndicatorHeight)+"px"})},i.prototype.isDayProcess=function(){return"TimelineMonth"===this.parent.currentView||!this.parent.activeViewOptions.timeScale.enable||this.parent.activeViewOptions.headerRows.length>0&&"Hour"!==this.parent.activeViewOptions.headerRows.slice(-1)[0].option},i.prototype.destroy=function(){this.renderType=null,this.eventContainers=null,this.dayLength=null,this.content=null,e.prototype.destroy.call(this),this.parent=null},i}(Bt),Yt=function(){function e(e){this.parent=e,this.parent.on(Ye,this.inlineEdit,this)}return e.prototype.inlineEdit=function(e){if(this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(),"Cell"===e.type){var t=this.parent.element.querySelector(".e-more-popup-wrapper");t&&t.classList.contains(rt)&&this.parent.quickPopup.morePopup.hide(),this.removeInlineAppointmentElement(),this.cellEdit(e)}else this.parent.element.querySelector(".e-inline-subject")!==e.element.querySelector(".e-inline-subject")&&this.removeInlineAppointmentElement(),this.eventEdit(e)},e.prototype.cellEdit=function(e){var t=this.generateEventData(),i=e.element.cellIndex,n=this.getEventDaysCount(t);n>1&&(n=Math.round(n),i-=--n);var r=b(new Date(""+t[this.parent.eventFields.startTime])).getTime(),a=b(new Date(""+t[this.parent.eventFields.endTime])).getTime(),s=e.groupIndex||0,o="Day"===this.parent.currentView||"Week"===this.parent.currentView||"WorkWeek"===this.parent.currentView;if(this.parent.activeViewOptions.timeScale.enable&&o){var l=t[this.parent.eventFields.startTime].getDay();this.createVerticalViewInline(t,l,s,i)}else"Month"===this.parent.currentView||!this.parent.activeViewOptions.timeScale.enable&&o?this.createMonthViewInline(t,s,r,a):this.createTimelineViewInline(t,r,a,s);var p=this.parent.element.querySelector(".e-inline-subject");p&&p.focus()},e.prototype.eventEdit=function(e){var i,n=e.element.querySelector(".e-inline-subject");if(t.addClass([e.element],"e-inline-edit"),n)i=n.value;else{var r=e.element.querySelector(".e-subject");if(t.isNullOrUndefined(r)||t.addClass([r],"e-disable"),i=!t.isNullOrUndefined(e.data)&&e.data[this.parent.eventFields.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),n=this.inlineInputEle=t.createElement("input",{className:"e-inline-subject",attrs:{value:i}}),t.closest(e.element,".e-more-popup-wrapper"))e.element.insertBefore(n,r);else if(["Agenda","MonthAgenda"].indexOf(this.parent.currentView)>-1){var a=e.element.querySelector(".e-subject-wrap");t.isNullOrUndefined(a)&&(a=t.createElement("div",{className:"e-subject-wrap"}),e.element.prepend(a)),a.insertBefore(n,a.firstChild)}else{var s=["TimelineDay","TimelineWeek","TimelineWorkWeek","TimelineMonth"].indexOf(this.parent.currentView)>-1?".e-inner-wrap":".e-appointment-details",o=e.element.querySelector(s);t.isNullOrUndefined(o)?e.element.querySelector(".e-appointment-details").prepend(n):r&&this.parent.activeViewOptions&&!this.parent.activeViewOptions.eventTemplate?o.insertBefore(n,r):o.prepend(n)}n.focus()}n.setSelectionRange(i.length,i.length)},e.prototype.createVerticalViewInline=function(e,t,i,n){var r,a=this.getEventDaysCount(e),s=new Ft(this.parent);s.initializeValues();var o=s.dateRender[parseInt(i.toString(),10)].map(function(e){return e.getDay()}).indexOf(t);if(a>=1){s.allDayElement=[].slice.call(this.parent.element.querySelectorAll(".e-all-day-cells")),(r=s.slots).push.apply(r,this.parent.activeView.renderDates.map(function(e){return+e}));var l=[].slice.call(this.parent.element.querySelectorAll(".e-all-day-appointment")),p=0;l.length>0&&(p=Math.floor(this.parent.getElementHeight(this.parent.element.querySelector(".e-all-day-row"))/l[0].offsetHeight)-1),s.allDayLevel=p;var c=this.parent.getElementHeightFromClass(this.parent.element.querySelector(".e-all-day-appointment-wrapper"),"e-appointment"),h=s.allDayElement.length>0?s.allDayElement[0].offsetTop:0;s.renderAllDayEvents(e,o,i,n,this.parent.allowInline,h,c)}else s.renderNormalEvents(e,o,i,n,this.parent.allowInline)},e.prototype.createMonthViewInline=function(e,t,i,n){var r=this.getEventDaysCount(e),a=this.parent.eventBase.cloneEventObject(e,i,n,r,!1,!1),s=new Bt(this.parent);s.dateRender=this.parent.activeView.renderDates,s.inlineValue=this.parent.allowInline;var o=this.parent.activeView.renderDates,l=this.parent.activeViewOptions.workDays,p=".e-work-cells";if(this.parent.activeViewOptions.group.resources.length>0){p+='[data-group-index="'+t+'"]';var c=this.parent.resourceBase.lastResourceLevel[parseInt(t.toString(),10)];o=c.renderDates,l=c.workDays}s.dateRender=o,s.workCells=[].slice.call(this.parent.element.querySelectorAll(p)),s.cellWidth=s.workCells[0].offsetWidth,s.cellHeight=s.workCells[0].offsetHeight,s.eventHeight=this.parent.getElementHeightFromClass(this.parent.monthModule.element||s.element,"e-appointment"),s.getSlotDates(l);for(var h=s.getRenderedDates(o),d=0,u=s.splitEvent(a,h||o);d<u.length;d++){var g=u[d];s.renderEvents(g,t)}this.parent.element.querySelector(".e-inline-subject").focus()},e.prototype.createTimelineViewInline=function(e,t,i,n){var r=this.getEventDaysCount(e),a=this.parent.eventBase.cloneEventObject(e,t,i,r,!1,!1),s=new zt(this.parent,this.parent.activeViewOptions.timeScale.enable?"hour":"day");s.dateRender=this.parent.activeView.renderDates,s.eventContainers=[].slice.call(this.parent.element.querySelectorAll("."+at));var o=this.parent.element.querySelector(".e-work-cells");s.inlineValue=this.parent.allowInline,s.cellWidth=o.offsetWidth,s.cellHeight=o.offsetHeight;var l=0===this.parent.element.querySelectorAll("."+nt+" tbody tr").length?0:this.parent.element.querySelectorAll("."+nt+" tbody tr")[0].children.length;s.slotsPerDay=l/s.dateRender.length,s.eventHeight=this.parent.getElementHeightFromClass(s.element,"e-appointment"),s.renderEvents(a,n)},e.prototype.getEventDaysCount=function(e){var t=e[this.parent.eventFields.startTime],i=e[this.parent.eventFields.endTime];return Math.abs(i.getTime()-t.getTime())/Qe},e.prototype.generateEventData=function(e){var t=this.parent.element.querySelector(".e-inline-subject"),i=t?t.value:e?e.innerHTML:"",n={};return n[this.parent.eventFields.id]=this.parent.eventBase.getEventMaxID(),n[this.parent.eventFields.subject]=i,n[this.parent.eventFields.startTime]=this.parent.activeCellsData.startTime,n[this.parent.eventFields.endTime]=this.parent.activeCellsData.endTime,n[this.parent.eventFields.isAllDay]=this.parent.activeCellsData.isAllDay,this.parent.eventWindow.setDefaultValueToObject(n),this.parent.resourceBase&&this.parent.resourceBase.setResourceValues(n,this.parent.activeCellsData.groupIndex),n},e.prototype.documentClick=function(e){e&&""!==e.value?this.inlineCrudActions(e):this.removeInlineAppointmentElement()},e.prototype.inlineCrudActions=function(e){if(t.closest(e,".e-inline-appointment")){var i=this.generateEventData(e);this.parent.addEvent(i)}else{var n=t.closest(e,".e-appointment"),r=this.parent.getEventDetails(n);r[this.parent.eventFields.subject]=e.value;var a=void 0;r[this.parent.eventFields.id]===r[this.parent.eventFields.recurrenceID]&&(a="EditOccurrence",r[this.parent.eventFields.id]=this.parent.eventBase.getEventMaxID()),this.parent.saveEvent(r,a)}this.removeInlineAppointmentElement()},e.prototype.createInlineAppointmentElement=function(e){var i=t.createElement("div",{className:"e-appointment e-inline-appointment e-inline-edit"}),n=t.createElement("div",{className:"e-appointment-details"});i.appendChild(n);var r=this.inlineInputEle=t.createElement("input",{className:"e-inline-subject"});return n.appendChild(r),e&&this.parent.eventBase.applyResourceColor(i,e,"backgroundColor"),i},e.prototype.removeInlineAppointmentElement=function(){var e=[].slice.call(this.parent.element.querySelectorAll(".e-inline-appointment"));e.length>0&&e.forEach(function(e){var i=e.querySelector(".e-inline-subject");t.isNullOrUndefined(i)||i.blur(),t.remove(e)});var i=this.getInlineElement();if(i){var n=t.closest(i,".e-appointment");t.removeClass([n],"e-inline-edit");var r=n.querySelector(".e-subject");t.isNullOrUndefined(r)||t.removeClass([r],"e-disable"),t.remove(i)}this.inlineInputEle=null},e.prototype.getInlineElement=function(){return this.inlineInputEle},e.prototype.destroy=function(){this.inlineInputEle=null,this.parent.off(Ye,this.inlineEdit)},e}(),_t=function(){function e(){}return e.prototype.renderFormValidator=function(e,t,i,n){var r=this;this.element=i,this.formObj=new o.FormValidator(e,{locale:n,customPlacement:function(e,t){r.errorPlacement(e,t)},rules:t,validationComplete:function(e){r.validationComplete(e)},focusout:function(e){r.focusOut(e)}})},e.prototype.focusOut=function(e){var t=e.relatedTarget;t&&(t.classList.contains("e-dlg-closeicon-btn")||t.classList.contains("e-close")||t.classList.contains("e-all-day-cells")||t.classList.contains("e-header-cells")||t.classList.contains("e-event-details")||t.classList.contains("e-work-cells")||t.classList.contains("e-event-cancel"))?this.ignoreError=!0:this.ignoreError=!1},e.prototype.validationComplete=function(e){var t=this.element.querySelector("#"+e.inputName+"_Error");t&&(t.style.display="failure"===e.status?"":"none")},e.prototype.errorPlacement=function(e,i){var n=i.getAttribute("for"),r=this.element.querySelector("#"+n+"_Error");r||this.ignoreError||this.createTooltip(e,i,n,""),t.isNullOrUndefined(r)||(r.querySelector(".e-error").innerHTML=i.innerHTML)},e.prototype.createTooltip=function(e,i,n,r){var a,s,o=e.getBoundingClientRect();this.element.classList.contains("e-quick-popup-wrapper")?(a=this.element,s=this.element.getBoundingClientRect()):s=(a=this.element.querySelector(".e-schedule-dialog .e-dlg-content")).getBoundingClientRect();var l=t.createElement("div",{className:"e-tooltip-wrap e-popup e-schedule-error",id:n+"_Error",styles:"display:"+r+";top:"+(o.bottom-s.top+a.scrollTop+9)+"px;left:"+(o.left-s.left+a.scrollLeft+o.width/2)+"px;"}),p=t.createElement("div",{className:"e-tip-content"});p.appendChild(i);var c=t.createElement("div",{className:"e-arrow-tip e-tip-top"});c.appendChild(t.createElement("div",{className:"e-arrow-tip-outer e-tip-top"})),c.appendChild(t.createElement("div",{className:"e-arrow-tip-inner e-tip-top"})),l.appendChild(p),l.appendChild(c),a.appendChild(l),l.style.left=parseInt(l.style.left,10)-l.offsetWidth/2+"px"},e.prototype.destroyToolTip=function(){if(this.element)for(var e=0,i=[].slice.call(this.element.querySelectorAll(".e-schedule-error"));e<i.length;e++){var n=i[e];t.remove(n)}this.formObj&&this.formObj.element&&this.formObj.reset()},e.prototype.destroy=function(){this.formObj&&this.formObj.element&&!this.formObj.isDestroyed&&this.formObj.destroy(),this.formObj=null,this.element=null},e}(),Gt=function(){function e(e){this.isMultipleEventSelect=!1,this.isCrudAction=!1,this.parent=e,this.l10n=this.parent.localeObj,this.fieldValidator=new _t,this.render(),this.addEventListener()}return e.prototype.render=function(){this.renderQuickPopup(),this.renderMorePopup(),this.renderQuickDialog()},e.prototype.renderQuickPopup=function(){var e=t.createElement("div",{className:"e-quick-popup-wrapper e-popup-close",attrs:{role:"dialog"}});this.parent.isAdaptive?(document.body.appendChild(e),t.addClass([e],"e-device")):this.parent.element.appendChild(e),this.quickPopup=new i.Popup(e,{targetType:this.parent.isAdaptive?"container":"relative",enableRtl:this.parent.enableRtl,open:this.quickPopupOpen.bind(this),close:this.quickPopupClose.bind(this),hideAnimation:this.parent.isAdaptive?{name:"ZoomOut"}:{name:"FadeOut",duration:150},showAnimation:this.parent.isAdaptive?{name:"ZoomIn"}:{name:"FadeIn",duration:150},collision:this.parent.isAdaptive?{X:"fit",Y:"fit"}:this.parent.enableRtl?{X:"flip",Y:"fit"}:{X:"none",Y:"fit"},position:this.parent.isAdaptive||this.parent.enableRtl?{X:"left",Y:"top"}:{X:"right",Y:"top"},viewPortElement:this.parent.isAdaptive?document.body:this.parent.element,zIndex:this.parent.isAdaptive?1004:3})},e.prototype.renderMorePopup=function(){var e='<div class="e-more-event-popup"><div class="e-more-event-header"><div class="e-more-event-close" title="'+this.l10n.getConstant("close")+'" tabindex="0" role="button"></div><div class="e-more-event-date-header"><div class="e-header-day" id="'+this.parent.element.id+'_more_popup"></div><div class="e-header-date e-navigate" tabindex="0" role="link"></div></div></div></div>',n=t.createElement("div",{className:"e-more-popup-wrapper e-popup-close",innerHTML:e});this.parent.isAdaptive?(document.body.appendChild(n),t.addClass([n],"e-device")):this.parent.element.appendChild(n),this.morePopup=new i.Popup(n,{targetType:this.parent.isAdaptive?"container":"relative",enableRtl:this.parent.enableRtl,hideAnimation:{name:"ZoomOut",duration:300},showAnimation:{name:"ZoomIn",duration:300},open:this.morePopupOpen.bind(this),close:this.morePopupClose.bind(this),collision:this.parent.isAdaptive?{X:"fit",Y:"fit"}:this.parent.enableRtl?{X:"flip",Y:"fit"}:{X:"flip",Y:"flip"},viewPortElement:this.parent.isAdaptive?document.body:this.parent.element,zIndex:this.parent.isAdaptive?1002:2}),this.morePopup.element.setAttribute("role","dialog"),this.morePopup.element.setAttribute("aria-labelledby",this.parent.element.id+"_more_popup");var r=this.morePopup.element.querySelector(".e-more-event-close");this.renderButton("e-round",et+" e-close-icon",!1,r,this.closeClick),t.EventHandler.add(this.morePopup.element.querySelector(".e-header-date"),"click",this.navigationClick,this)},e.prototype.renderQuickDialog=function(){var e=[{buttonModel:{cssClass:"e-quick-alertok e-flat",isPrimary:!0},click:this.dialogButtonClick.bind(this)},{buttonModel:{cssClass:"e-quick-alertcancel e-flat",isPrimary:!1},click:this.dialogButtonClick.bind(this)},{buttonModel:{cssClass:"e-quick-dialog-cancel e-disable e-flat",isPrimary:!1},click:this.dialogButtonClick.bind(this)}];if(this.parent.eventSettings.editFollowingEvents){var n={buttonModel:{cssClass:"e-quick-alertfollowing e-flat",isPrimary:!1},click:this.dialogButtonClick.bind(this)};e.splice(1,0,n)}this.quickDialog=new i.Dialog({animationSettings:{effect:"Zoom"},buttons:e,cssClass:"e-quick-dialog",closeOnEscape:!0,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,beforeClose:this.beforeQuickDialogClose.bind(this),isModal:!0,position:{X:"center",Y:"center"},showCloseIcon:!0,target:document.body,visible:!1,width:"auto"});var r=t.createElement("div",{id:this.parent.element.id+"QuickDialog"});this.parent.element.appendChild(r),this.quickDialog.appendTo(r);var a=this.quickDialog.element.querySelector(".e-quick-alertok");a&&(a.setAttribute("aria-label",this.l10n.getConstant("occurrence")),a.setAttribute("aria-label",a.innerHTML));var s=this.quickDialog.element.querySelector(".e-quick-alertcancel");s&&(s.setAttribute("aria-label",this.l10n.getConstant("series")),s.setAttribute("aria-label",s.innerHTML)),this.quickDialog.element.querySelector(".e-dlg-closeicon-btn")&&this.quickDialog.element.querySelector(".e-dlg-closeicon-btn").setAttribute("title",this.l10n.getConstant("close"))},e.prototype.renderButton=function(e,i,n,r,a){new s.Button({cssClass:e,disabled:n,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,iconCss:i}).appendTo(r),t.EventHandler.add(r,"click",a,this),t.removeClass([r],et)},e.prototype.quickDialogClass=function(e){var i=["e-quick-dialog-occurrence-event","e-quick-dialog-series-event","e-quick-dialog-delete","e-quick-dialog-cancel","e-quick-dialog-alert-btn","e-disable"],n=this.quickDialog.element.querySelector(".e-quick-alertok"),r=this.quickDialog.element.querySelector(".e-quick-alertcancel"),a=this.quickDialog.element.querySelector(".e-quick-alertfollowing");switch(t.removeClass([n,r],i),t.addClass([this.quickDialog.element.querySelector(".e-quick-dialog-cancel")],"e-disable"),this.parent.eventSettings.editFollowingEvents&&(t.addClass([a],"e-disable"),t.removeClass([this.quickDialog.element],"e-following-events-dialog")),e){case"Recurrence":t.addClass([n],"e-quick-dialog-occurrence-event"),t.addClass([r],"e-quick-dialog-series-event"),this.parent.eventSettings.editFollowingEvents&&(t.removeClass([a],"e-disable"),t.addClass([this.quickDialog.element],"e-following-events-dialog"),t.addClass([a],"e-quick-dialog-following-events"));break;case"Delete":t.addClass([n],"e-quick-dialog-delete"),t.addClass([r],"e-quick-dialog-cancel");break;case"Alert":t.addClass([n],["e-quick-alertok","e-quick-dialog-alert-btn"]),t.addClass([r],["e-quick-alertcancel","e-disable"])}},e.prototype.applyFormValidation=function(){var e=this.quickPopup.element.querySelector("."+ot),t={};t[this.parent.eventSettings.fields.subject.name]=this.parent.eventSettings.fields.subject.validation,this.fieldValidator.renderFormValidator(e,t,this.quickPopup.element,this.parent.locale)},e.prototype.openRecurrenceAlert=function(){var e=this.quickDialog.element.querySelector(".e-quick-alertok");e&&(e.innerHTML=this.l10n.getConstant("Delete"===this.parent.currentAction?"deleteEvent":"editEvent"),e.setAttribute("aria-label",e.innerHTML));var t=this.quickDialog.element.querySelector(".e-quick-alertfollowing");t&&(t.innerHTML=this.l10n.getConstant("editFollowingEvent"),t.setAttribute("aria-label",t.innerHTML));var i=this.quickDialog.element.querySelector(".e-quick-alertcancel");i&&(i.innerHTML=this.l10n.getConstant("Delete"===this.parent.currentAction?"deleteSeries":"editSeries"),i.setAttribute("aria-label",i.innerHTML)),this.quickDialog.content=this.l10n.getConstant("editContent"),this.quickDialog.header=this.l10n.getConstant("Delete"===this.parent.currentAction?"deleteTitle":"editTitle"),this.quickDialogClass("Recurrence"),this.showQuickDialog("RecurrenceAlert")},e.prototype.openRecurrenceValidationAlert=function(e){this.quickDialogClass("Alert");var i=this.quickDialog.element.querySelector(".e-quick-alertok");i.innerHTML=this.l10n.getConstant("ok"),i.setAttribute("aria-label",i.innerHTML);var n=this.quickDialog.element.querySelector(".e-quick-alertcancel");n.innerHTML=this.l10n.getConstant("cancel"),n.setAttribute("aria-label",n.innerHTML),this.quickDialog.header=this.l10n.getConstant("alert");var r;switch(e){case"wrongPattern":t.addClass([n],"e-disable"),this.quickDialog.content=this.l10n.getConstant("wrongPattern");break;case"createError":t.addClass([n],"e-disable"),this.quickDialog.content=this.l10n.getConstant("createError");break;case"sameDayAlert":t.addClass([n],"e-disable"),this.quickDialog.content=this.l10n.getConstant("sameDayAlert");break;case"seriesChangeAlert":r=this.quickDialog.element.querySelector(".e-quick-dialog-cancel"),t.removeClass([n,r],"e-disable"),this.quickDialog.content=this.l10n.getConstant("seriesChangeAlert"),i.innerHTML=this.l10n.getConstant("yes"),n.innerHTML=this.l10n.getConstant("no"),r.innerHTML=this.l10n.getConstant("cancel");break;case"occurrenceAlert":t.addClass([n],"e-disable"),this.quickDialog.content=this.l10n.getConstant("occurenceAlert")}(!this.parent.enableRecurrenceValidation&&"wrongPattern"===e||this.parent.enableRecurrenceValidation)&&this.showQuickDialog("RecurrenceValidationAlert")},e.prototype.openDeleteAlert=function(){if(!this.parent.activeViewOptions.readonly){var e=this.quickDialog.element.querySelector(".e-quick-alertok");e&&(e.innerHTML=this.l10n.getConstant("delete"),e.setAttribute("aria-label",e.innerHTML));var t=this.quickDialog.element.querySelector(".e-quick-alertcancel");t&&(t.innerHTML=this.l10n.getConstant("cancel"),t.setAttribute("aria-label",t.innerHTML)),this.quickDialog.content=this.parent.activeEventData.event.length>1?this.l10n.getConstant("deleteMultipleContent"):this.l10n.getConstant("deleteContent"),this.quickDialog.header=this.parent.activeEventData.event.length>1?this.l10n.getConstant("deleteMultipleEvent"):this.l10n.getConstant("deleteEvent"),this.quickDialogClass("Delete"),this.showQuickDialog("DeleteAlert")}},e.prototype.openValidationError=function(e,t){this.quickDialog.header=this.l10n.getConstant("alert"),this.quickDialog.content=this.l10n.getConstant(e);var i=this.quickDialog.element.querySelector(".e-quick-alertok");i&&(i.innerHTML=this.l10n.getConstant("ok"),i.setAttribute("aria-label",i.innerHTML));var n=this.quickDialog.element.querySelector(".e-quick-alertcancel");n&&(n.innerHTML=this.l10n.getConstant("cancel"),i.setAttribute("aria-label",n.innerHTML)),this.quickDialogClass("Alert"),this.showQuickDialog("overlapAlert"===e?"OverlapAlert":"ValidationAlert",t)},e.prototype.showQuickDialog=function(e,i){var n=this;this.quickDialog.dataBind();var r={type:e,cancel:!1,element:this.quickDialog.element,data:t.extend({},i||this.parent.activeEventData.event,null,!0)};this.parent.activeViewOptions.allowOverlap||(r.overlapEvents=this.parent.overlapAppointments),this.parent.trigger("popupOpen",r,function(e){e.cancel||n.quickDialog.show()})},e.prototype.createMoreEventList=function(e,i,n){var r=this,a=this.parent.eventFields,s=t.createElement("div",{className:"e-more-event-content"}),o=t.createElement("div",{className:"e-more-appointment-wrapper"});if(0===e.length)o=t.createElement("div",{className:"e-more-event-content",innerHTML:this.l10n.getConstant("emptyContainer")});else for(var l=this,p=0,c=e;p<c.length;p++)!function(e){var s=e[a.subject]||l.parent.eventSettings.fields.subject.default||l.parent.localeObj.getConstant("addTitle"),p=t.createElement("div",{className:"e-appointment",attrs:{"data-id":""+e[a.id],"data-guid":e.Guid,role:"button",tabindex:"0","aria-disabled":l.parent.eventBase.getReadonlyAttribute(e),"aria-label":l.parent.getAnnouncementString(e)}});e[a.isReadonly]&&t.addClass([p],"e-read-only");var c=void 0;if(t.isNullOrUndefined(l.parent.activeViewOptions.eventTemplate))p.appendChild(t.createElement("div",{className:"e-subject"})),l.parent.sanitize(s,p.firstElementChild);else{var h=l.parent.element.id+"_"+l.parent.activeViewOptions.eventTemplateName+"eventTemplate";c=l.parent.getAppointmentTemplate()(e,l.parent,"eventTemplate",h,!1,void 0,void 0,l.parent.root),t.append(c,p)}if(t.isNullOrUndefined(n)||p.setAttribute("data-group-index",n),!t.isNullOrUndefined(e[a.recurrenceRule])){var d=e[a.id]===e[a.recurrenceID]?"e-recurrence-icon":"e-recurrence-edit-icon";p.appendChild(t.createElement("div",{className:et+" "+d}))}var u={data:t.extend({},e,null,!0),element:p,cancel:!1};l.parent.trigger("eventRendered",u,function(t){if(!t.cancel){o.appendChild(p);var n=r.parent.isAdaptive||"Year"===r.parent.currentView;r.parent.eventBase.wireAppointmentEvents(p,e,n),r.parent.eventBase.applyResourceColor(p,e,"backgroundColor",i)}})}(c[p]);return s.appendChild(o),s},e.prototype.tapHoldEventPopup=function(e){var i=t.closest(e.target,".e-appointment");this.parent.selectedElements=[],this.isMultipleEventSelect=!0,this.parent.eventBase.getSelectedEventElements(i),this.parent.activeEventData=this.parent.eventBase.getSelectedEvents();var n=i.getAttribute("data-guid"),r=this.parent.eventBase.getEventByGuid(n);if(!t.isNullOrUndefined(r)){var a=r[this.parent.eventFields.subject]||this.l10n.getConstant("noTitle"),s='<div class="e-multiple-event-popup"><div class="e-popup-header"><button class="e-close" title="'+this.l10n.getConstant("close")+'"></button><div class="e-subject">'+a+'</div><button class="e-edit" title="'+this.l10n.getConstant("edit")+'"></button><button class="e-delete" title="'+this.l10n.getConstant("delete")+'"></button></div></div>';this.quickPopup.element.innerHTML=s;var o=this.quickPopup.element.querySelector(".e-close");this.renderButton("e-flat e-round e-small",et+" e-close-icon",!1,o,this.closeClick);var l=this.parent.activeViewOptions.readonly||r[this.parent.eventFields.isReadonly],p=!this.parent.eventSettings.allowEditing||l,c=!this.parent.eventSettings.allowDeleting||l,h=this.quickPopup.element.querySelector(".e-edit");h&&this.renderButton("e-flat e-round e-small",et+" e-edit-icon",p,h,this.editClick);var d=this.quickPopup.element.querySelector(".e-delete");d&&this.renderButton("e-flat e-round e-small",et+" e-delete-icon",c,d,this.deleteClick),this.beforeQuickPopupOpen(i,this.parent.eventBase.getPageCoordinates(e))}},e.prototype.isCellBlocked=function(e){var t={};if(t[this.parent.eventFields.startTime]=this.parent.activeCellsData.startTime,t[this.parent.eventFields.endTime]=this.parent.activeCellsData.endTime,t[this.parent.eventFields.isAllDay]=this.parent.activeCellsData.isAllDay,this.parent.activeViewOptions.group.resources.length>0){var i=e.element instanceof Array?e.element[0]:e.element,n=parseInt(i.getAttribute("data-group-index"),10);this.parent.resourceBase.setResourceValues(t,isNaN(n)?null:n)}return this.parent.eventBase.isBlockRange(t)},e.prototype.cellClick=function(e){var i=new Date(e.startTime.getTime());if(!this.parent.showQuickInfo||!this.parent.eventSettings.allowAdding||"MonthAgenda"===this.parent.currentView||this.isCellBlocked(e)||!this.parent.isMinMaxDate(new Date(i.setHours(0,0,0,0))))return void this.quickPopupHide();var n=t.isNullOrUndefined(e.event)?e.element:e.event.target;if(this.parent.isAdaptive){this.quickPopupHide();var r=this.parent.element.querySelector(".e-new-event");t.isNullOrUndefined(r)&&(r=t.createElement("div",{className:"e-new-event",innerHTML:'<div class="e-title">+ '+this.l10n.getConstant("newEvent")+"</div>"}));var a=t.closest(n,".e-work-cells,.e-all-day-cells");return void(a&&a.appendChild(r))}var s=t.closest(n,".e-work-cells,.e-all-day-cells,.e-header-cells");if(!t.isNullOrUndefined(s)&&!n.classList.contains("e-more-indicator")){if(this.quickPopup.relateTo===s&&this.quickPopup.element.classList.contains(rt)){var l=this.quickPopup.element.querySelector(".e-subject");return void(l&&l.focus())}this.quickPopup.element&&this.destroyPopupButtons("quickPopup");var p={};p[this.parent.eventFields.startTime]=this.parent.activeCellsData.startTime,p[this.parent.eventFields.endTime]=this.parent.activeCellsData.endTime,p[this.parent.eventFields.isAllDay]=this.parent.activeCellsData.isAllDay;var c=t.createElement("div",{className:"e-cell-popup"});c.appendChild(this.getPopupHeader("Cell",p)),c.appendChild(this.getPopupContent("Cell",e,p)),c.appendChild(this.getPopupFooter("Cell",p)),this.quickPopup.element.setAttribute("aria-label",this.l10n.getConstant("newEvent"));var h=c.querySelector(".e-subject");h&&o.Input.createInput({element:h,properties:{placeholder:this.l10n.getConstant("addTitle")}}),t.isNullOrUndefined(this.parent.eventSettings.fields.subject.default)||(h.value=this.parent.eventSettings.fields.subject.default);var d=c.querySelector(".e-close");d&&this.renderButton("e-flat e-round e-small",et+" e-close-icon",!1,d,this.popupClose);var u=c.querySelector(".e-event-details");u&&this.renderButton("e-flat","",!1,u,this.detailsClick);var g=c.querySelector(".e-event-create");g&&this.renderButton("e-flat e-primary","",this.parent.activeViewOptions.readonly,g,this.saveClick),this.morePopup&&this.morePopup.hide(),this.quickPopup.content=c,this.quickPopup.relateTo=s,this.quickPopup.dataBind(),this.beforeQuickPopupOpen(s,this.parent.eventBase.getPageCoordinates(e.event))}},e.prototype.isSameEventClick=function(e){if(this.quickPopup.relateTo===t.closest(e.element,".e-appointment")&&this.quickPopup.element.classList.contains(rt)){var i=this.quickPopup.element.querySelector(".e-edit");if(i&&i.focus(),!this.parent.isAdaptive){var n=this.quickPopup.element.querySelector(".e-event-edit");n&&n.focus()}return!0}return!1},e.prototype.isQuickTemplate=function(e){return"Both"===this.parent.quickInfoTemplates.templateType||this.parent.quickInfoTemplates.templateType===e},e.prototype.eventClick=function(e){if(this.parent.eventTooltip&&this.parent.eventTooltip.close(),this.parent.showQuickInfo)if(this.parent.isAdaptive&&this.isMultipleEventSelect)this.updateTapHoldEventPopup(t.closest(e.element,".e-appointment"));else{var i=this.isSameEventClick(e);if(this.parent.selectedElements=[],i)return;this.quickPopup.element&&this.destroyPopupButtons("quickPopup");var n=e.event,r=t.createElement("div",{className:"e-event-popup"});r.appendChild(this.getPopupHeader("Event",n)),r.appendChild(this.getPopupContent("Event",e,n)),r.appendChild(this.getPopupFooter("Event",n)),this.quickPopup.element.setAttribute("aria-label",this.l10n.getConstant("editEvent"));var a=this.parent.activeViewOptions.readonly||n[this.parent.eventFields.isReadonly],s=!this.parent.eventSettings.allowEditing||a,o=!this.parent.eventSettings.allowDeleting||a,l=r.querySelector(".e-edit"),p="e-flat e-round e-small";l&&this.renderButton(p,et+" e-edit-icon",s,l,this.editClick);var c=r.querySelector(".e-delete");c&&this.renderButton(p,et+" e-delete-icon",o,c,this.deleteClick);var h=r.querySelector(".e-close");h&&this.renderButton(p,et+" e-close-icon",!1,h,this.popupClose);var d=r.querySelector(".e-event-edit");d&&this.renderButton("e-flat e-primary","",s,d,this.editClick);var u=r.querySelector(".e-event-delete");u&&this.renderButton("e-flat","",o,u,this.deleteClick),this.morePopup&&!t.closest(e.element,".e-more-appointment-wrapper")&&this.morePopup.hide(),this.quickPopup.content=r,this.quickPopup.relateTo=this.parent.isAdaptive?document.body:t.closest(e.element,".e-appointment"),this.quickPopup.dataBind(),this.beforeQuickPopupOpen(e.element,this.parent.eventBase.getPageCoordinates(e.originalEvent))}},e.prototype.getPopupHeader=function(e,i){var n=t.createElement("div",{className:"e-popup-header"});if(this.isQuickTemplate(e)&&this.parent.quickInfoTemplates.header){var r=t.extend({},i,{elementType:e.toLowerCase()},!0),a=this.parent.element.id,s=[].slice.call(this.parent.getQuickInfoTemplatesHeader()(r,this.parent,"header",a+"_headerTemplate",!1));t.append([].slice.call(s),n)}else{var o=void 0,l=void 0;switch(e){case"Cell":o='<div class="e-header-icon-wrapper"><button class="e-close" title="'+this.l10n.getConstant("close")+'"></button></div>';break;case"Event":l=this.getFormattedString(i),o='<div class="e-header-icon-wrapper"><button class="e-edit e-icons" title="'+this.l10n.getConstant("edit")+'"></button><button class="e-delete e-icons" title="'+this.l10n.getConstant("delete")+'"></button><button class="e-close" title="'+this.l10n.getConstant("close")+'"></button></div><div class="e-subject-wrap"><div class="e-subject e-text-ellipsis" title="'+(l.eventSubject?l.eventSubject.replaceAll('"',"'"):l.eventSubject)+'"></div></div >'}var p=t.createElement("div",{innerHTML:o});if("Event"===e){var c=p.querySelector(".e-subject");this.parent.sanitize(l.eventSubject,c)}t.append([].slice.call(p.childNodes),n)}return n},e.prototype.getPopupContent=function(e,i,n){var r=t.createElement("div",{className:"e-popup-content"});if(this.isQuickTemplate(e)&&this.parent.quickInfoTemplates.content){var a=t.extend({},n,{elementType:e.toLowerCase()},!0),s=this.parent.element.id,o=[].slice.call(this.parent.getQuickInfoTemplatesContent()(a,this.parent,"content",s+"_contentTemplate",!1));t.append([].slice.call(o),r)}else{var l=void 0,p=void 0,c=this.getResourceText(i,e.toLowerCase());switch(e){case"Cell":p=this.getFormattedString(n),l='<table class="e-popup-table"><tbody><tr><td><form class="'+ot+'">\n <input class="e-subject e-field" type="text" name="'+this.parent.eventFields.subject+'" /></form></td></tr><tr><td><div class="e-date-time"><div class="e-date-time-icon e-icons"></div><div class="e-date-time-details '+st+'">'+p.details+"</div></div>"+(this.parent.activeViewOptions.group.resources.length>0?'<div class="e-resource"><div class="e-resource-icon e-icons "></div><div class="e-resource-details e-text-ellipsis"></div></div>':"")+"</td></tr></tbody></table>";break;case"Event":l='<div class="e-date-time"><div class="e-date-time-icon e-icons"></div><div class="e-date-time-wrapper e-text-ellipsis"><div class="e-date-time-details e-text-ellipsis">'+this.getFormattedString(n).details+"</div>",n[this.parent.eventFields.recurrenceRule]&&(l+='<div class="e-recurrence-summary e-text-ellipsis">'+this.getRecurrenceSummary(n)+"</div>"),l+="</div></div>",n[this.parent.eventFields.location]&&(l+='<div class="e-location"><div class="e-location-icon e-icons"></div><div class="e-location-details e-text-ellipsis"></div></div>'),(n[this.parent.eventFields.startTimezone]||n[this.parent.eventFields.endTimezone])&&(l+='<div class="e-time-zone"><div class="e-time-zone-icon e-icons"></div><div class="e-time-zone-details e-text-ellipsis">'+this.getTimezone(n)+"</div></div>"),n[this.parent.eventFields.description]&&(l+='<div class="e-description"><div class="e-description-icon e-icons"></div><div class="e-description-details e-text-ellipsis"></div></div>'),this.parent.resourceCollection.length>0&&(l+='<div class="e-resource"><div class="e-resource-icon e-icons"></div><div class="e-resource-details e-text-ellipsis"></div></div>')}var h=t.createElement("div",{innerHTML:l}),d=h.querySelector("form");if(d&&(d.onsubmit=function(){return!1}),n[this.parent.eventFields.location]){var u=h.querySelector(".e-location-details");t.isNullOrUndefined(u)||this.parent.sanitize(n[this.parent.eventFields.location],u)}if(n[this.parent.eventFields.description]){var g=h.querySelector(".e-description-details");t.isNullOrUndefined(g)||this.parent.sanitize(n[this.parent.eventFields.description],g)}if(c){var v=h.querySelector(".e-resource-details");t.isNullOrUndefined(v)||this.parent.sanitize(c,v)}t.append([].slice.call(h.childNodes),r)}return r},e.prototype.getPopupFooter=function(e,i){var n=t.createElement("div",{className:"e-popup-footer"});if(this.isQuickTemplate(e)&&this.parent.quickInfoTemplates.footer){var r=t.extend({},i,{elementType:e.toLowerCase()},!0),a=this.parent.element.id,s=[].slice.call(this.parent.getQuickInfoTemplatesFooter()(r,this.parent,"footer",a+"_footerTemplate",!1));t.append([].slice.call(s),n)}else{var o=void 0;switch(e){case"Cell":o='<button class="e-event-details e-text-ellipsis" title="'+this.l10n.getConstant("moreDetails")+'">'+this.l10n.getConstant("moreDetails")+'</button><button class="e-event-create e-text-ellipsis" title="'+this.l10n.getConstant("save")+'">'+this.l10n.getConstant("save")+"</button>";break;case"Event":o=this.parent.isAdaptive?"":'<button class="e-event-edit e-text-ellipsis" title="'+this.l10n.getConstant("edit")+'">'+this.l10n.getConstant("edit")+'</button><button class="e-event-delete e-text-ellipsis" title="'+this.l10n.getConstant("delete")+'">'+this.l10n.getConstant("delete")+"</button>"}var l=t.createElement("div",{innerHTML:o});t.append([].slice.call(l.childNodes),n)}return n},e.prototype.getResourceText=function(e,i){if(0===this.parent.resourceCollection.length)return null;var n="";if(0===this.parent.activeViewOptions.group.resources.length){var r=this.parent.resourceBase.resourceCollection.slice(-1)[0],a=r.dataSource;if("event"===i)for(var s=e.event,o=0,l=a;o<l.length;o++)!function(e){var t=s[r.field];if(t instanceof Array){if(t.indexOf(e[r.idField])>-1){var i=t[t.indexOf(e[r.idField])],o=a.filter(function(e){return e[r.idField]===i})[0];n+=""===n?o[r.textField]:", "+o[r.textField]}}else e[r.idField]===t&&(n=e[r.textField].toString())}(l[o]);else n=a[0][r.textField].toString()}else if("event"===i){for(var p,s=e.event,a=void 0,c=this.parent.resourceBase.resourceCollection.length-1;c>=0;c--)if(a=s[this.parent.resourceBase.resourceCollection[parseInt(c.toString(),10)].field],!t.isNullOrUndefined(a)){p=this.parent.resourceBase.resourceCollection[parseInt(c.toString(),10)];break}Array.isArray(a)||(a=[a]);var h=[],d=p.dataSource;a.forEach(function(e){var t,i=H(d,p.idField,e);i>-1&&(t=d[parseInt(i.toString(),10)][p.textField]),t&&h.push(t)}),n=h.join(", ")}else{var u=e,g=t.isNullOrUndefined(u.groupIndex)?0:u.groupIndex,v=this.parent.resourceBase.lastResourceLevel[parseInt(g.toString(),10)];n=v.resourceData[v.resource.textField]}return n},e.prototype.getFormattedString=function(e){var t=this.parent.eventFields,i=e[t.subject]||this.l10n.getConstant("noTitle"),n=e[t.startTime],r=e[t.endTime],a=this.getDateFormat(n,"long"),s=e[t.isAllDay]&&0===r.getHours()&&0===r.getMinutes()?this.getDateFormat(O(new Date(r.getTime()),-1),"long"):this.getDateFormat(r,"long"),o=this.parent.getTimeString(n),l=this.parent.getTimeString(r),p="",c=r.getDate()!==n.getDate()&&(r.getTime()-n.getTime())/36e5<24?1:0;return e[t.isAllDay]?(p=a+" ("+this.l10n.getConstant("allDay")+")",(L(r)-L(n))/Qe>1&&(p+=" - "+s+" ("+this.l10n.getConstant("allDay")+")")):p=(L(r)-L(n))/Qe>=1||c>0?a+" ("+o+") - "+s+" ("+l+")":a+" ("+o+" - "+l+")",{eventSubject:i,details:p}},e.prototype.moreEventClick=function(e,i,n){var r=this;this.quickPopupHide(!0);var a=this.morePopup.element.querySelector(".e-more-event-content");a&&t.remove(a);var s=e.date.getTime().toString(),o=t.closest(e.element,".e-more-indicator,.e-work-cells"),l=this.parent.globalize.formatDate(e.date,{format:"E",calendar:this.parent.getCalendarMode()});this.morePopup.element.querySelector(".e-header-day").innerHTML=U(l,"single");var p=this.morePopup.element.querySelector(".e-header-date");p.innerHTML=this.getDateFormat(e.date,"d"),p.setAttribute("data-date",s),p.setAttribute("data-end-date",i.getTime().toString());var c;t.isNullOrUndefined(n)||(p.setAttribute("data-group-index",n),c=this.parent.resourceBase.lastResourceLevel[parseInt(n,10)].groupOrder);var h=this.createMoreEventList(e.event,c,n);if(this.morePopup.element.querySelector(".e-more-event-popup").appendChild(h),t.removeClass(this.morePopup.element.querySelector(".e-more-event-date-header").childNodes,"e-current-date"),b(e.date).getTime()===b(this.parent.getCurrentTime()).getTime()&&t.addClass(this.morePopup.element.querySelector(".e-more-event-date-header").childNodes,"e-current-date"),!this.parent.isAdaptive)if(-1!==this.parent.currentView.indexOf("Timeline")){var d=o.getAttribute("data-group-index"),u=new Date(parseInt(o.getAttribute("data-start-date"),10));u.setHours(u.getHours(),u.getMinutes(),0);var g=u.getTime().toString();if(t.isNullOrUndefined(d))this.morePopup.relateTo=this.parent.element.querySelector('.e-content-wrap tbody tr td[data-date="'+g+'"]');else if(this.morePopup.relateTo=this.parent.element.querySelector('.e-content-wrap tbody tr td[data-group-index="'+d+'"][data-date="'+g+'"]'),t.isNullOrUndefined(this.morePopup.relateTo))for(var v=[].slice.call(this.parent.element.querySelectorAll('.e-content-wrap tbody tr td[data-group-index="'+d+'"]')),m=0;m<v.length;m++)v[parseInt(m.toString(),10)].getAttribute("data-date")<g&&(this.morePopup.relateTo=v[parseInt(m.toString(),10)])}else this.morePopup.relateTo=t.closest(o,".e-work-cells");this.parent.renderTemplates(function(){var t={type:"EventContainer",cancel:!1,element:r.morePopup.element,data:e};r.parent.trigger("popupOpen",t,function(e){e.cancel||r.morePopup.show()})})},e.prototype.saveClick=function(e){this.applyFormValidation(),this.dialogEvent=e,this.isCrudAction=!0,this.quickPopupHide()},e.prototype.detailsClick=function(e){var i=this.quickPopup.element.querySelector(".e-subject");i&&""!==i.value&&t.extend(this.parent.activeCellsData,{subject:i.value}),this.dialogEvent=e,this.isCrudAction=!1,this.fieldValidator.destroyToolTip(),this.quickPopupHide(),this.parent.eventWindow.openEditor(this.parent.activeCellsData,"Add")},e.prototype.editClick=function(e){this.dialogEvent=e,this.quickPopupHide(!0);var i=this.parent.activeEventData.event;this.parent.currentAction="EditSeries",t.isNullOrUndefined(i[this.parent.eventFields.recurrenceRule])?this.parent.eventWindow.openEditor(i,this.parent.currentAction):(this.parent.currentAction="EditOccurrence",this.openRecurrenceAlert())},e.prototype.deleteClick=function(e){this.dialogEvent=e,this.quickPopupHide(!0),this.parent.currentAction="Delete",this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule]?this.openRecurrenceAlert():this.openDeleteAlert()},e.prototype.updateMoreEventContent=function(){if(!this.morePopup.element.classList.contains("e-popup-close")){var e=this.morePopup.element.querySelector(".e-more-event-content");e&&t.remove(e);var i,n,r=this.morePopup.element.querySelector(".e-header-date"),a=new Date(parseInt(r.getAttribute("data-date"),10)),s=new Date(parseInt(r.getAttribute("data-end-date"),10)),o=r.getAttribute("data-group-index");t.isNullOrUndefined(o)||(n=(i=this.parent.resourceBase.lastResourceLevel[parseInt(o,10)]).groupOrder);var l=this.parent.eventBase.filterEvents(a,s,this.parent.eventsProcessed,i),p=this.createMoreEventList(l,n,o);this.morePopup.element.querySelector(".e-more-event-popup").appendChild(p)}},e.prototype.closeClick=function(e){this.dialogEvent=e,"Year"===this.parent.currentView&&this.parent.activeCellsData&&this.parent.activeCellsData.element&&this.parent.selectCell(this.parent.activeCellsData.element),this.quickPopupHide(),this.morePopup.hide()},e.prototype.dialogButtonClick=function(e){this.dialogEvent=e,this.quickDialog.hide();var t=e.target,i=this.quickDialog.element.querySelector(".e-quick-alertcancel"),n=this.parent.activeEventData.event;if(t.classList.contains("e-quick-dialog-occurrence-event"))switch(this.parent.currentAction="Delete"===this.parent.currentAction?"DeleteOccurrence":"EditOccurrence",this.parent.currentAction){case"EditOccurrence":this.parent.eventWindow.openEditor(n,this.parent.currentAction);break;case"DeleteOccurrence":this.parent.crudModule.deleteEvent(n,this.parent.currentAction)}else if(t.classList.contains("e-quick-dialog-following-events"))switch(this.parent.currentAction="Delete"===this.parent.currentAction?"DeleteFollowingEvents":"EditFollowingEvents",this.parent.currentAction){case"EditFollowingEvents":this.parent.eventWindow.openEditor(n,this.parent.currentAction);break;case"DeleteFollowingEvents":this.parent.crudModule.deleteEvent(n,this.parent.currentAction)}else if(t.classList.contains("e-quick-dialog-series-event"))switch(this.parent.currentAction="Delete"===this.parent.currentAction?"DeleteSeries":"EditSeries",this.parent.currentAction){case"EditSeries":this.parent.eventWindow.openEditor(this.parent.eventBase.getParentEvent(n,!0),this.parent.currentAction);break;case"DeleteSeries":this.parent.crudModule.deleteEvent(n,this.parent.currentAction)}else t.classList.contains("e-quick-dialog-delete")?this.parent.crudModule.deleteEvent(n,this.parent.currentAction):!i.classList.contains("e-disable")&&(t.classList.contains("e-quick-alertok")||t.classList.contains("e-quick-alertcancel")&&!i.classList.contains("e-quick-dialog-cancel"))&&(this.parent.uiStateValues.isIgnoreOccurrence=t.classList.contains("e-quick-alertcancel"),this.parent.eventWindow.eventSave(e,this.l10n.getConstant("ok")))},e.prototype.updateTapHoldEventPopup=function(e){var i=this.parent.eventBase.getSelectedEventElements(e);if(this.parent.activeEventData=this.parent.eventBase.getSelectedEvents(),i.length>0){var n=this.parent.eventBase.getEventByGuid(i[0].getAttribute("data-guid")),r=1===i.length?n[this.parent.eventFields.subject]||this.l10n.getConstant("noTitle"):"("+i.length+") "+this.l10n.getConstant("selectedItems");this.quickPopup.element.querySelector(".e-subject").innerHTML=r,i.length>1?t.addClass([this.quickPopup.element.querySelector(".e-edit-icon")],"e-hidden"):t.removeClass([this.quickPopup.element.querySelector(".e-edit-icon")],"e-hidden")}else this.parent.selectedElements=[],this.quickPopupHide()},e.prototype.getTimezone=function(e){var t="";return t+=e[this.parent.eventFields.startTimezone]||"",t+=""===t?"":" - ",t+=e[this.parent.eventFields.endTimezone]||""},e.prototype.getRecurrenceSummary=function(e){var t=this.parent.eventWindow.getRecurrenceEditorInstance();if(t){var i=t.getRuleSummary(e[this.parent.eventFields.recurrenceRule]);return i.charAt(0).toUpperCase()+i.slice(1)}return""},e.prototype.getDateFormat=function(e,t){return U(this.parent.globalize.formatDate(e,{skeleton:t,calendar:this.parent.getCalendarMode()}),"single")},e.prototype.getDataFromTarget=function(e){if(e.classList.contains("e-appointment"))return this.parent.activeEventData.event;var t={startTime:this.parent.activeCellsData.startTime,endTime:this.parent.activeCellsData.endTime,isAllDay:this.parent.activeCellsData.isAllDay,groupIndex:this.parent.activeCellsData.groupIndex},i=this.parent.activeCellsData;return this.parent.eventWindow.convertToEventData(i,t),t},e.prototype.beforeQuickDialogClose=function(e){var i=this,n={event:e.event||this.dialogEvent,type:t.isNullOrUndefined(this.parent.activeEventData.event)?"ValidationAlert":t.isNullOrUndefined(this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule])?"DeleteAlert":"RecurrenceAlert",cancel:!1,data:this.parent.activeEventData.event,element:this.quickDialog.element};this.parent.trigger("popupClose",n,function(e){e.cancel||i.parent.eventBase.focusElement(!0)})},e.prototype.beforeQuickPopupOpen=function(e,n){var r=this;this.parent.renderTemplates(function(){var a=r.quickPopup.element.querySelector(".e-event-popup"),s=r.parent.isAdaptive?a?"ViewEventInfo":"EditEventInfo":"QuickInfo",o={type:s,cancel:!1,data:t.extend({},r.getDataFromTarget(e),null,!0),target:e,element:r.quickPopup.element};r.parent.trigger("popupOpen",o,function(o){if(o.cancel)r.quickPopupHide(),r.destroyPopupButtons("quickPopup"),o.element.classList.contains(rt)&&r.quickPopupClose(),j(r.quickPopup.element),r.isMultipleEventSelect=!1;else{var l=r.quickPopup.element.style.display;if(r.quickPopup.element.style.display="block",r.parent.isAdaptive)r.quickPopup.element.removeAttribute("style"),r.quickPopup.element.style.display="block",r.quickPopup.element.style.height=t.formatUnit("EditEventInfo"===s?65:window.innerHeight);else{var p=r.parent.virtualScrollModule&&r.parent.virtualScrollModule.isHorizontalScroll&&!t.isNullOrUndefined(t.closest(e,"."+nt)),c=r.parent.element.querySelector(".e-content-wrap table");r.quickPopup.offsetX=p&&!r.parent.enableRtl?g(c)+10:10,r.quickPopup.offsetY=r.parent.virtualScrollModule&&!r.parent.virtualScrollModule.isHorizontalScroll?r.quickPopup.offsetY:0,r.quickPopup.collision={X:r.parent.enableRtl?"flip":"none",Y:"fit"},r.quickPopup.position={X:r.parent.enableRtl?"left":"right",Y:r.parent.enableRtl?"bottom":"top"},r.quickPopup.dataBind(),r.quickPopup.refreshPosition(null,!0);var h=i.isCollide(r.quickPopup.element,r.parent.element);if(h.indexOf(r.parent.enableRtl?"left":"right")>-1&&(r.quickPopup.offsetX=-e.offsetWidth-10-r.quickPopup.element.offsetWidth,p&&!r.parent.enableRtl&&(r.quickPopup.offsetX=g(c)+r.quickPopup.offsetX),r.quickPopup.dataBind(),r.quickPopup.refreshPosition(null,!0),i.isCollide(r.quickPopup.element,r.parent.element).indexOf("left")>-1&&(r.quickPopup.position={X:"center",Y:"center"},r.quickPopup.collision={X:"fit",Y:"fit"},r.quickPopup.offsetX=-r.quickPopup.element.offsetWidth/2,r.quickPopup.dataBind())),r.parent.virtualScrollModule&&!r.parent.virtualScrollModule.isHorizontalScroll&&(h.indexOf("top")>-1||h.indexOf("bottom")>-1)){var d=u(c);r.quickPopup.offsetY=d,r.quickPopup.dataBind(),r.quickPopup.refreshPosition(null,!0)}if("center"===r.quickPopup.position.X&&"center"===r.quickPopup.position.Y&&!t.isNullOrUndefined(n)&&n.clientX&&n.clientY){var v=n.clientX,m=n.clientY,f=e.getBoundingClientRect(),y=n.offsetY||Math.ceil(m-f.y),T=r.quickPopup.offsetY,w=i.isCollide(r.quickPopup.element,e),D=r.quickPopup.element.getBoundingClientRect(),b=document.elementFromPoint(v,m);(w.indexOf("top")>-1||w.indexOf("bottom")>-1||t.closest(b,".e-quick-popup-wrapper"))&&(D.top<=m&&m<=D.top+D.height?(r.quickPopup.offsetY=T-D.height-10,r.quickPopup.dataBind(),(w=i.isCollide(r.quickPopup.element,r.parent.element)).indexOf("top")>-1&&(r.quickPopup.offsetY=T+y+10,r.quickPopup.dataBind())):i.isCollide(r.quickPopup.element,r.parent.element).indexOf("bottom")>-1&&(r.quickPopup.offsetY=T-y-Math.ceil(D.height)-10,r.quickPopup.dataBind()))}}a&&r.applyEventColor(),r.quickPopup.element.style.display=l,r.quickPopup.dataBind(),r.quickPopup.show()}})})},e.prototype.applyEventColor=function(){var e="";e="Agenda"===this.parent.currentView||"MonthAgenda"===this.parent.currentView?this.parent.enableRtl?"border-right-color":"border-left-color":"background-color";var t=this.parent.activeEventData.element.style[e];if(""!==t){var i=this.quickPopup.element.querySelector(".e-popup-header"),n=this.quickPopup.element.querySelector(".e-popup-footer");n&&n.offsetParent&&(i=this.quickPopup.element.querySelector(".e-subject"))&&(i.style.borderLeftColor=t,t="rgba("+t.match(/\d+/g).join()+",0.3)"),i&&(i.style.backgroundColor=t)}},e.prototype.quickPopupOpen=function(){if(this.parent.isAdaptive)return void(this.quickPopup.element.style.top="0px");if(this.quickPopup.element.querySelector(".e-cell-popup")){var e=this.quickPopup.element.querySelector(".e-subject");e&&e.focus()}else{var t=this.quickPopup.element.querySelector(".e-event-edit");t&&t.focus();var i=this.quickPopup.element.querySelector(".e-edit");i&&i.focus()}},e.prototype.quickPopupClose=function(){this.parent.eventBase.focusElement(),this.quickPopup.relateTo=".e-work-cells",this.fieldValidator.destroyToolTip(),this.quickPopup.element.querySelectorAll(".e-formvalidator").length&&this.fieldValidator.destroy(),this.destroyPopupButtons("quickPopup"),j(this.quickPopup.element)},e.prototype.morePopupOpen=function(){if(this.parent.isAdaptive)return this.morePopup.element.style.top="0px",this.morePopup.element.style.left="0px",void(this.morePopup.element.style.height=t.formatUnit(window.innerHeight));this.morePopup.element.querySelector(".e-header-date").focus(),this.morePopup.refreshPosition()},e.prototype.morePopupClose=function(){var e=this.parent.element.querySelector(".e-more-appointment-wrapper");e&&t.remove(e)},e.prototype.popupClose=function(e){this.dialogEvent=e,this.isCrudAction=!1,this.quickPopupHide(!0)},e.prototype.quickPopupHide=function(e){var t=this;if(this.quickPopup.element.classList.contains(rt)){var i,n=this.quickPopup.element.querySelector(".e-cell-popup");if(n){var r=this.quickPopup.element.querySelector(".e-formvalidator");if(this.isCrudAction&&r&&!r.ej2_instances[0].validate())return;var a=this.parent.eventFields,s=this.parent.eventWindow.getObjectFromFormData("e-quick-popup-wrapper");this.parent.eventWindow.setDefaultValueToObject(s),s[a.id]=this.parent.eventBase.getEventMaxID(),s[a.startTime]=this.parent.activeCellsData.startTime,s[a.endTime]=this.parent.activeCellsData.endTime,s[a.isAllDay]=this.parent.activeCellsData.isAllDay,this.parent.resourceBase&&this.parent.resourceBase.setResourceValues(s),i=s}else i=this.parent.activeEventData.event;var o=this.quickPopup.element.querySelector(".e-event-popup"),l={event:this.dialogEvent,type:this.parent.isAdaptive?o?"ViewEventInfo":"EditEventInfo":"QuickInfo",cancel:!1,data:i,element:this.quickPopup.element,target:n?this.parent.activeCellsData.element:this.parent.activeEventData.element};this.parent.trigger("popupClose",l,function(i){if(!i.cancel&&t.quickPopup.element.classList.contains("e-popup-open")){if(n&&t.isCrudAction&&(t.parent.currentAction="Add",t.parent.crudModule.addEvent(i.data)),e){var r=t.quickPopup.hideAnimation;t.quickPopup.hideAnimation=null,t.quickPopup.hide(),t.quickPopup.hideAnimation=r}else t.quickPopup.hide();t.isMultipleEventSelect=!1,t.isCrudAction=!1}})}},e.prototype.navigationClick=function(e){var i=t.closest(e.target,".e-navigate");if(!t.isNullOrUndefined(i)){var n=this.parent.getDateFromElement(e.currentTarget);t.isNullOrUndefined(n)||(this.closeClick(e),this.parent.setProperties({selectedDate:n},!0),this.parent.changeView(this.parent.getNavigateView(),e))}},e.prototype.documentClick=function(e){var i=e.event.target,n=".e-quick-popup-wrapper,.e-header-cells,.e-all-day-cells,.e-work-cells,.e-appointment";!!t.closest(i,".e-dialog")||(n+=",.e-popup");var r=this.parent.element.querySelector(".e-quick-popup-wrapper");(r&&r.childElementCount>0&&!t.closest(i,n)||!t.closest(i,n))&&(this.quickPopupHide(),this.parent.removeNewEventElement());var a=this.parent.allowInline?this.parent.inlineModule.getInlineElement():null;a&&a!==i&&this.parent.inlineModule.documentClick(a),t.closest(i,".e-appointment,.e-header-cells")&&this.parent.removeNewEventElement();var s=t.closest(i,".e-quick-popup-wrapper")||t.closest(i,".e-quick-dialog");!(i.classList.contains("e-event-edit")||i.classList.contains("e-edit")||i.classList.contains("e-edit-icon"))&&(s||t.closest(i,".e-more-popup-wrapper")||!i.classList||i.classList.contains("e-more-indicator")||t.closest(i,".e-more-popup-wrapper."+rt)||t.closest(i,".e-work-cells"))||this.morePopup.hide()},e.prototype.onClosePopup=function(e){t.isNullOrUndefined(e)||(this.dialogEvent=e),this.quickPopupHide(),(t.isNullOrUndefined(e)||!t.isNullOrUndefined(e)&&"escape"!==e.action||this.parent.inlineModule&&this.parent.element.querySelector(".e-inline-appointment"))&&this.parent.eventBase.focusElement()},e.prototype.addEventListener=function(){this.parent.on("cellClick",this.cellClick,this),this.parent.on("eventClick",this.eventClick,this),this.parent.on("document-click",this.documentClick,this),this.parent.on(_e,this.updateMoreEventContent,this)},e.prototype.removeEventListener=function(){this.parent.off("cellClick",this.cellClick),this.parent.off("eventClick",this.eventClick),this.parent.off("document-click",this.documentClick),this.parent.off(_e,this.updateMoreEventContent)},e.prototype.destroyPopupButtons=function(e){for(var t="quickPopup"===e?this.quickPopup:this.morePopup,i=0,n=[].slice.call(t.element.querySelectorAll(".e-control.e-btn"));i<n.length;i++){var r=n[i],a=r.ej2_instances?r.ej2_instances[0]:null;a&&a.destroy()}if("quickPopup"===e){var s=t.element.querySelector("input.e-subject");s&&s.remove();var o=this.quickPopup.element.querySelector("form."+ot);o&&(j(o),o.remove()),this.parent.resetTemplates(["content","header","footer"])}},e.prototype.refreshQuickDialog=function(){this.destroyQuickDialog(),this.renderQuickDialog()},e.prototype.refreshQuickPopup=function(){this.destroyQuickPopup(),this.renderQuickPopup()},e.prototype.refreshMorePopup=function(){this.destroyMorePopup(),this.renderMorePopup()},e.prototype.destroyQuickDialog=function(){this.quickDialog.element&&(this.quickDialog.destroy(),t.remove(this.quickDialog.element),this.quickDialog=null)},e.prototype.destroyQuickPopup=function(){this.quickPopup.element&&(this.destroyPopupButtons("quickPopup"),this.quickPopup.destroy(),t.remove(this.quickPopup.element),this.quickPopup=null)},e.prototype.destroyMorePopup=function(){this.morePopup.element&&(this.destroyPopupButtons("morePopup"),this.morePopup.destroy(),t.remove(this.morePopup.element),this.morePopup=null)},e.prototype.destroy=function(){this.quickPopup.element.querySelectorAll(".e-formvalidator").length&&this.fieldValidator.destroy(),this.removeEventListener(),this.destroyQuickPopup(),this.destroyMorePopup(),this.destroyQuickDialog(),this.dialogEvent=null,this.parent=null,this.l10n=null,this.isCrudAction=null,this.fieldValidator=null,this.isMultipleEventSelect=null},e}(),Xt=function(){function e(e){this.parent=e,this.tooltipObj=new i.Tooltip({animation:{close:{effect:"FadeOut"}},content:"No title",position:"BottomRight",offsetY:10,mouseTrail:!this.parent.isAdaptive,showTipPointer:!1,cssClass:this.parent.cssClass+" "+lt,target:this.getTargets(),beforeRender:this.onBeforeRender.bind(this),beforeClose:this.onTooltipClose.bind(this),beforeOpen:this.onTooltipOpen.bind(this),enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}),this.tooltipObj.appendTo(this.parent.element)}return e.prototype.getTargets=function(){var e=[];return this.parent.activeViewOptions.group.headerTooltipTemplate&&e.push(".e-resource-cells"),this.parent.eventSettings.enableTooltip&&e.push(".e-appointment"),e.join(",")},e.prototype.onBeforeRender=function(e){var i=this;if(this.parent.uiStateValues.isSwipeScroll)return void(e.cancel=!0);if(t.isNullOrUndefined(e.target.getAttribute("data-tooltip-id"))){if(e.target.classList.contains("e-resource-cells")&&this.parent.activeViewOptions.group.resources.length>0){if(e.target.closest(".e-left-indent-wrap"))return void(e.cancel=!0);var n=void 0;if(this.parent.activeView.isTimelineView()){var r=parseInt(e.target.getAttribute("data-group-index"),10);n=this.parent.resourceBase.lastResourceLevel[parseInt(r.toString(),10)]}else{var a=e.target.parentNode.sectionRowIndex,s=e.target.cellIndex;n=this.parent.activeView.getColumnLevels()[parseInt(a.toString(),10)][parseInt(s.toString(),10)]}var o={resource:n.resource,resourceData:n.resourceData},l=t.createElement("div"),p=this.parent.element.id+"_headerTooltipTemplate",c=[].slice.call(this.parent.getHeaderTooltipTemplate()(o,this.parent,"headerTooltipTemplate",p,!1));return t.append(c,l),this.setContent(l),void this.parent.renderTemplates()}var h=this.parent.eventBase.getEventByGuid(e.target.getAttribute("data-guid"));if(t.isNullOrUndefined(h))return void this.setContent("No Title");if(t.isNullOrUndefined(this.parent.eventSettings.tooltipTemplate)){var d=this.parent.globalize,u=this.parent.eventFields,g=new Date(""+h[u.startTime]),v=new Date(""+h[u.endTime]);v=v.getTime()-g.getTime()!=0&&0===v.getHours()&&0===v.getMinutes()?new Date(v.setMilliseconds(-1e3)):v;var m=b(new Date(""+g)),f=b(new Date(""+v)),y=h[u.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),T=t.isNullOrUndefined(h[u.location])?"":h[u.location],w="",D="",C="";w=d.formatDate(g,{type:"date",skeleton:"MMMd",calendar:this.parent.getCalendarMode()}),D=d.formatDate(g,{type:"date",skeleton:"medium",calendar:this.parent.getCalendarMode()}),C=d.formatDate(v,{type:"date",skeleton:"medium",calendar:this.parent.getCalendarMode()}),w=U(w,"single"),D=U(D,"single"),C=U(C,"single");var S=this.parent.getTimeString(g),O=this.parent.getTimeString(v),E=void 0,x='<div><div class="e-subject">'+y+'</div><div class="e-location">'+T+'</div><div class="e-details">'+(E=m.getTime()===f.getTime()?U(E=d.formatDate(g,{type:"date",skeleton:"long",calendar:this.parent.getCalendarMode()}),"single"):m.getFullYear()===f.getFullYear()?w+" - "+C:D+" - "+C)+'</div><div class="e-all-day">'+(h[u.isAllDay]?this.parent.localeObj.getConstant("allDay"):S+" - "+O)+"</div></div>",V=function(){return x};this.setContent(t.initializeCSPTemplate(V))}else{var l=t.createElement("div"),p=this.parent.element.id+"_tooltipTemplate",c=[].slice.call(this.parent.getEventTooltipTemplate()(h,this.parent,"tooltipTemplate",p,!1));t.append(c,l),this.setContent(l)}this.parent.renderTemplates(function(){if(i.parent&&i.parent.isReact&&!t.isNullOrUndefined(i.parent.eventSettings.tooltipTemplate)){var e=document.querySelector(".e-tooltip-hidden");e&&t.removeClass([e],"e-tooltip-hidden")}})}},e.prototype.onTooltipOpen=function(e){e.element&&this.parent.isReact&&!t.isNullOrUndefined(this.parent.eventSettings.tooltipTemplate)&&t.addClass([e.element],"e-tooltip-hidden");var i=this.parent.eventBase.getEventByGuid(e.target.getAttribute("data-guid"));if(!t.isNullOrUndefined(i)){var n={cancel:!1,data:i,content:e.element,target:e.target};this.parent.trigger("tooltipOpen",n,function(t){if(t.cancel)return void(e.cancel=!0);e.element=t.content})}},e.prototype.onTooltipClose=function(e){e.element&&(t.removeClass([e.element],rt),t.addClass([e.element],"e-popup-close")),this.parent.isReact&&this.parent.eventWindow.dialogObject&&this.parent.eventWindow.dialogObject.visible||this.parent.resetTemplates(["tooltipTemplate","headerTooltipTemplate"])},e.prototype.setContent=function(e){this.tooltipObj.setProperties({content:e,windowCollision:!0},!0)},e.prototype.close=function(){this.tooltipObj.close()},e.prototype.destroy=function(){this.tooltipObj.destroy(),t.addClass([this.parent.element],"e-control"),this.tooltipObj=null,this.parent=null},e}(),Qt=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Kt=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},Zt="e-input-wrapper",Jt="e-form-left",$t="e-recurrence-count",ei="e-hide-recurrence-element",ti="e-primary",ii={none:"",daily:"days",weekly:"weeks",monthly:"months",yearly:"years"},ni={sun:"SU",mon:"MO",tue:"TU",wed:"WE",thu:"TH",fri:"FR",sat:"SA"},ri=["e-days","e-non-week","e-end-on","e-interval","e-year-expander","e-month-expander"],ai=["e-non-week"],si=["e-days","e-year-expander"],oi=["e-days"],li=["e-days","e-non-week","e-year-expander","e-month-expander"],pi=["e-end-on-date","e-end-on-count"],ci=["e-end-on-date"],hi=["e-end-on-count"],di=function(e){function i(t,i){var n=e.call(this,t,i)||this;return n.defaultLocale={none:"None",daily:"Daily",weekly:"Weekly",monthly:"Monthly",month:"Month",yearly:"Yearly",never:"Never",until:"Until",count:"Count",first:"First",second:"Second",third:"Third",fourth:"Fourth",last:"Last",repeat:"Repeat",repeatEvery:"Repeat every",on:"Repeat On",end:"End",onDay:"Day",days:"Day(s)",weeks:"Week(s)",months:"Month(s)",years:"Year(s)",every:"every",summaryTimes:"time(s)",summaryOn:"on",summaryUntil:"until",summaryRepeat:"Repeats",summaryDay:"day(s)",summaryWeek:"week(s)",summaryMonth:"month(s)",summaryYear:"year(s)",monthWeek:"Month Week",monthPosition:"Month Position",monthExpander:"Month Expander",yearExpander:"Year Expander",repeatInterval:"Repeat Interval"},n.renderStatus=!1,n.dayButtons=[],n.monthButtons=[],n}return Qt(i,e),i.prototype.startState=function(e,t,i){this.showFormElement(),this.updateForm(e),this.freshOnEndForm(),this.updateEndOnForm(t),this.selectMonthDay(i),this.updateUntilDate(i),this.onMonthDay.setProperties({checked:!0})},i.prototype.preRender=function(){this.localeObj=new t.L10n(this.getModuleName(),this.defaultLocale,this.locale),this.calendarUtil=je(this.calendarMode)},i.prototype.applyCustomClass=function(e){e&&t.addClass([this.element],e.split(" "))},i.prototype.initialize=function(){t.addClass([this.element],"e-"+this.getModuleName()),this.renderComponent(),"string"==typeof this.startDate&&this.setProperties({startDate:new Date(this.startDate)},!1),t.isNullOrUndefined(this.value)||""===this.value?(t.isNullOrUndefined(this.repeatType.value)||(this.startState(this.repeatType.value.toString().toUpperCase(),this.endTypes[0],this.startDate),this.updateForm(this.repeatType.value.toString())),this.selectedType>0&&this.setProperties({value:this.getRecurrenceRule()},!1)):this.setRecurrenceRule(this.value),this.applyCustomClass(this.cssClass)},i.prototype.triggerChangeEvent=function(){var e=this;if(this.renderStatus){var t=this.getRecurrenceRule();this.trigger("change",{value:t},function(t){return e.setProperties({value:t.value},!1)})}},i.prototype.resetDayButton=function(){[].slice.call(this.element.querySelectorAll(".e-days button")).forEach(function(e){return t.removeClass([e],["e-active",ti])})},i.prototype.daySelection=function(e){this.resetDayButton();var i=[0,1,2,3,4,5,6];this.rotateArray(i,this.firstDayOfWeek);var n=this.element.querySelector('.e-days button[data-index="'+i.indexOf(e)+'"]');n&&t.addClass([n],["e-active",ti])},i.prototype.rtlClass=function(e){e?t.addClass([this.element],"e-rtl"):t.removeClass([this.element],"e-rtl")},i.prototype.updateUntilDate=function(e){var t=new Date(e.getTime());t.setDate(t.getDate()+60),this.untilDateObj.setProperties({value:t})},i.prototype.selectMonthDay=function(e){var t=["sun","mon","tue","wed","thu","fri","sat"];this.monthDate.setProperties({value:this.calendarUtil.getDate(e)}),this.monthWeekDays.setProperties({value:ni[t[e.getDay()]]}),this.monthValue.setProperties({value:""+this.calendarUtil.getMonth(e)}),this.monthWeekPos.setProperties({value:this.getDayPosition(e)}),this.daySelection(e.getDay())},i.prototype.updateForm=function(e){var i=this;this.repeatType.setProperties({value:e});var n=this.element.querySelector(".e-end-on");switch("daily"===e?t.classList(n,[Jt],["e-form-right"]):t.classList(n,["e-form-right"],[Jt]),e){case"none":ri.forEach(function(e){return t.addClass([i.element.querySelector("."+e)],ei)});break;case"weekly":ai.forEach(function(e){return t.addClass([i.element.querySelector("."+e)],ei)});break;case"monthly":si.forEach(function(e){return t.addClass([i.element.querySelector("."+e)],ei)});break;case"yearly":oi.forEach(function(e){return t.addClass([i.element.querySelector("."+e)],ei)});break;case"daily":li.forEach(function(e){return t.addClass([i.element.querySelector("."+e)],ei)})}},i.prototype.updateEndOnForm=function(e){var i=this;switch(this.endType.setProperties({value:e}),e){case"never":pi.forEach(function(e){return t.addClass([i.element.querySelector("."+e)],ei)});break;case"until":hi.forEach(function(e){return t.addClass([i.element.querySelector("."+e)],ei)});break;case"count":ci.forEach(function(e){return t.addClass([i.element.querySelector("."+e)],ei)})}},i.prototype.freshOnEndForm=function(){var e=this;pi.forEach(function(i){var n=e.element.querySelector("."+i);n&&t.removeClass([n],ei)})},i.prototype.showFormElement=function(){var e=this;ri.forEach(function(i){var n=e.element.querySelector("."+i);n&&t.removeClass([n],ei)})},i.prototype.renderDropdowns=function(){var e=this,t=this;this.repeatType=new l.DropDownList({dataSource:this.getRepeatData(),floatLabelType:"Always",enableRtl:this.enableRtl,index:this.selectedType,fields:{text:"text",value:"value"},placeholder:this.localeObj.getConstant("repeat"),htmlAttributes:{title:this.localeObj.getConstant("repeat")},change:function(i){t.setProperties({selectedType:e.frequencies.indexOf(i.value)},!1),t.element.querySelector(".e-repeat-content").innerHTML=t.localeObj.getConstant(ii[i.value]),t.showFormElement(),t.updateForm(i.value),t.resetFormValues(),t.triggerChangeEvent()}}),this.repeatType.appendTo(this.element.querySelector(".e-repeat-element")),this.endType=new l.DropDownList({dataSource:this.getEndData(),popupWidth:this.getPopupWidth(),floatLabelType:"Always",placeholder:this.localeObj.getConstant("end"),enableRtl:this.enableRtl,index:1,fields:{text:"text",value:"value"},change:function(e){t.freshOnEndForm(),t.updateEndOnForm(e.value),t.resetFormValues(),t.triggerChangeEvent()}}),this.endType.appendTo(this.element.querySelector(".e-end-on-element"));var i=function(i){return new l.DropDownList({dataSource:i,popupWidth:e.getPopupWidth(),enableRtl:e.enableRtl,fields:{text:"text",value:"value"},index:1,change:function(e){t.onWeekDay.setProperties({checked:!0}),t.resetFormValues(),t.triggerChangeEvent()}})};this.monthWeekPos=i(this.getMonthPosData()),this.monthWeekPos.appendTo(this.element.querySelector(".e-month-pos")),this.monthWeekDays=i(this.getDayData("wide")),this.monthWeekDays.appendTo(this.element.querySelector(".e-month-week")),this.monthValue=new l.DropDownList({dataSource:this.getMonthData(),fields:{text:"text",value:"value"},enableRtl:this.enableRtl,index:7,change:function(e){t.resetFormValues(),t.triggerChangeEvent()}}),this.monthValue.appendTo(this.element.querySelector(".e-year-expander-element"))},i.prototype.setDefaultValue=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll(".e-control .e-numerictextbox"));e<t.length;e++){var i=t[e].ej2_instances[0];i.element.classList.contains("e-repeat-interval")?(i.value=1,i.dataBind()):i.element.classList.contains($t)&&(i.value=10,i.dataBind())}},i.prototype.resetFormValues=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll('.e-control [type="text"]'));e<t.length;e++){var i=t[e],n=void 0;if(i.classList.contains("e-datepicker"))(n=i.ej2_instances[0]).value?(n.value=n.value,n.dataBind()):this.updateUntilDate(this.startDate);else if(i.classList.contains("e-dropdownlist"))(n=i.ej2_instances[0]).index=n.index||0,n.dataBind();else if(i.classList.contains("e-numerictextbox")){var r=void 0;r=(n=i.ej2_instances[0]).element.classList.contains("e-repeat-interval")?1:n.element.classList.contains($t)?10:this.startDate.getDate(),n.value=n.value||r,n.dataBind()}}},i.prototype.getPopupWidth=function(){return t.Browser.isDevice?"100%":"auto"},i.prototype.renderDatePickers=function(){var e=this;this.untilDateObj=new r.DatePicker({firstDayOfWeek:this.firstDayOfWeek,enableRtl:this.enableRtl,locale:this.locale,min:this.minDate,max:this.maxDate,format:t.isNullOrUndefined(this.dateFormat)?this.getFormat("dateFormats"):this.dateFormat,change:function(t){t.value&&e.triggerChangeEvent()}}),this.untilDateObj.appendTo(this.element.querySelector(".e-until-date"))},i.prototype.getFormat=function(e){return"en"===this.locale||"en-US"===this.locale?t.getValue(e+".short",t.getDefaultDateObject(this.getCalendarMode())):t.getValue("main."+this.locale+".dates.calendars."+this.getCalendarMode()+"."+e+".short",t.cldrData)},i.prototype.dayButtonRender=function(){for(var e=this,i=this,n=0,r=[].slice.call(this.element.querySelectorAll(".e-days button"));n<r.length;n++){var a=r[n],o=new s.Button({isToggle:!0,enableRtl:this.enableRtl},a);this.dayButtons.push(o),t.EventHandler.add(a,"click",function(n){var r=[].slice.call(e.element.querySelectorAll(".e-days button."+ti)),a=n.target;a.classList.contains(ti)?r.length>1&&(t.removeClass([a],ti),i.triggerChangeEvent()):(t.addClass([a],ti),i.triggerChangeEvent())})}},i.prototype.radioButtonRender=function(){var e=this;this.onMonthDay=new s.RadioButton({label:this.localeObj.getConstant("onDay"),enableRtl:this.enableRtl,name:"monthType",value:"day",change:function(){e.resetFormValues(),e.triggerChangeEvent()}}),this.onMonthDay.appendTo(this.element.querySelector(".e-month-expander-element")),this.monthButtons.push(this.onMonthDay),this.onWeekDay=new s.RadioButton({label:this.localeObj.getConstant("monthExpander"),cssClass:"e-month-type",name:"monthType",enableRtl:this.enableRtl,value:"daypos",change:function(){e.resetFormValues(),e.triggerChangeEvent()}}),this.onWeekDay.appendTo(this.element.querySelector(".e-month-expander-wrapper")),this.monthButtons.push(this.onWeekDay)},i.prototype.numericTextboxRender=function(){var e=this;this.recurrenceCount=new o.NumericTextBox({value:10,format:"#",enableRtl:this.enableRtl,min:1,max:999,change:function(){e.triggerChangeEvent()}}),this.recurrenceCount.appendTo(this.element.querySelector("."+$t)),this.monthDate=new o.NumericTextBox({value:1,format:"#",enableRtl:this.enableRtl,min:1,max:31,change:function(){e.onMonthDay.setProperties({checked:!0}),e.triggerChangeEvent()}}),this.monthDate.appendTo(this.element.querySelector(".e-month-day")),this.repeatInterval=new o.NumericTextBox({value:1,format:"#",min:1,max:999,enableRtl:this.enableRtl,floatLabelType:"Always",placeholder:this.localeObj.getConstant("repeatEvery"),change:function(){e.triggerChangeEvent()}}),this.repeatInterval.appendTo(this.element.querySelector(".e-repeat-interval"))},i.prototype.renderComponent=function(){this.setTemplate(),this.renderDropdowns(),this.renderDatePickers(),this.dayButtonRender(),this.radioButtonRender(),this.numericTextboxRender()},i.prototype.rotateArray=function(e,t){for(var i,n=0;n<t;n++)i=e.shift(),e.push(i)},i.prototype.getEndData=function(){var e=this,t=[];return this.endTypes.forEach(function(i){t.push({text:e.localeObj.getConstant(i),value:i})}),t},i.prototype.getDayPosition=function(e){var t=new Date(e.getTime()),i=new Date(e.getTime()),n=e.getDay(),r=[];for(t=this.calendarUtil.getMonthStartDate(t),i=this.calendarUtil.getMonthEndDate(i);t<i;)t.getDay()===n&&r.push(t.getTime()),t.setDate(t.getDate()+1);return r.indexOf(e.getTime())===r.length-1?-1:r.indexOf(e.getTime())+1},i.prototype.getRepeatData=function(){var e=[],t=this;return this.frequencies.forEach(function(i){var n="none"===i?"never":i;e.push({text:t.localeObj.getConstant(n),value:i})}),e},i.prototype.getMonthPosData=function(){var e={first:1,second:2,third:3,fourth:4,last:-1},t=this,i=[];return["first","second","third","fourth","last"].forEach(function(n){i.push({text:t.localeObj.getConstant(n),value:e[""+n]})}),i},i.prototype.getDayData=function(e){var i,n=["sun","mon","tue","wed","thu","fri","sat"],r=[];if(this.rotateArray(n,this.firstDayOfWeek),"en"===this.locale||"en-US"===this.locale){a="days.stand-alone.";i=t.getValue(a+e,t.getDefaultDateObject(this.getCalendarMode()))}else{var a="main."+this.locale+".dates.calendars."+this.getCalendarMode()+".days.stand-alone."+e;i=t.getValue(a,t.cldrData)}for(var s=0,o=n;s<o.length;s++){var l=o[s],p=t.getValue(l,i);r.push({text:"narrow"===e?p:U(p,"single"),value:ni[""+l]})}return r},i.prototype.getMonthData=function(){var e,i=[];if("en"===this.locale||"en-US"===this.locale){n="months.stand-alone.wide";e=t.getValue(n,t.getDefaultDateObject(this.getCalendarMode()))}else{var n="main."+this.locale+".dates.calendars."+this.getCalendarMode()+".months.stand-alone.wide";e=t.getValue(n,t.cldrData)}for(var r=0,a=Object.keys(e);r<a.length;r++){var s=a[r];i.push({text:U(t.getValue(s,e),"single"),value:s})}return i},i.prototype.setTemplate=function(){var e=this.getDayData("narrow"),t=this.getDayData("wide");this.element.innerHTML='<div class="e-editor"><div class="e-input-wrapper e-form-left"><input type="text" tabindex="0" class="e-repeat-element"label="'+"e-repeat-element".substr(2)+'" /></div><div class="'+Zt+' e-interval e-form-right"><table class="e-recurrence-table e-repeat-content-wrapper" role="none"><tr><td><input type="text" tabindex="0" id="'+this.element.id+'_e-repeat-interval" class="e-repeat-interval"title="'+this.localeObj.getConstant("repeatEvery")+'" /></td><td><span class="e-repeat-content"></span></td></tr></table></div><div class="e-input-wrapper-side e-days '+Jt+'"><div class=e-week-expander-label>'+this.localeObj.getConstant("on")+'</div><button type="button" class="e-round" data-index="0" title="'+t[0].text+'">'+e[0].text+'</button><button type="button" class="e-round" data-index="1" title="'+t[1].text+'">'+e[1].text+'</button><button type="button" class="e-round" data-index="2" title="'+t[2].text+'">'+e[2].text+'</button><button type="button" class="e-round" data-index="3" title="'+t[3].text+'">'+e[3].text+'</button><button type="button" class="e-round" data-index="4" title="'+t[4].text+'">'+e[4].text+'</button><button type="button" class="e-round" data-index="5" title="'+t[5].text+'">'+e[5].text+'</button><button type="button" class="e-round" data-index="6" title="'+t[6].text+'">'+e[6].text+'</button></div><div class="e-input-wrapper-side e-non-week '+Jt+'"><div class=e-month-expander-label>'+this.localeObj.getConstant("on")+'</div><div class="e-year-expander"><input class="e-year-expander-element" type="text" tabindex="0" title="'+this.localeObj.getConstant("yearExpander")+'"/></div><div class="e-month-expander"><table class="e-recurrence-table e-month-expand-wrapper" role="none"><tr><td><div class="'+Zt+' e-month-expander-checkbox-wrapper"><input class="e-month-expander-element"title="'+this.localeObj.getConstant("monthExpander")+'" type="radio"></div></td><td colspan="2"><div class="'+Zt+' e-monthday-element"><input type="text" tabindex="0" id="'+this.element.id+'_e-month-day" class="e-month-day"title="'+this.localeObj.getConstant("on")+'" /></div></td></tr><tr><td><div class="'+Zt+' e-month-expander-checkbox-wrapper e-repeat-on-week-selector"><input class="e-month-expander-wrapper"title="'+this.localeObj.getConstant("monthExpander")+'" type="radio"></div></td><td><div class="'+Zt+' e-week-position" ><input type="text" tabindex="0" class="e-month-pos"title="'+this.localeObj.getConstant("monthPosition")+'" /></div></td><td><div class="'+Zt+' e-day-position"><input type="text" tabindex="0" class="e-month-week"title="'+this.localeObj.getConstant("monthWeek")+'" /></div></td></tr></table></div></div><div class="e-input-wrapper-side e-end-on e-form-right"><div class="'+Zt+' e-end-on-left"><input type="text" tabindex="0" class="e-end-on-element"title="'+this.localeObj.getConstant("end")+'" /></div><div class="'+Zt+' e-end-on-date" ><input type="text" tabindex="0" class="e-until-date"title="'+this.localeObj.getConstant("until")+'" /></div><div class="'+Zt+' e-end-on-count"><input type="text" tabindex="0" id="'+this.element.id+"_"+$t+'" class="'+$t+'"title="'+this.localeObj.getConstant("count")+'" /></div></div></div></div>'},i.prototype.getSelectedDaysData=function(){var e="BYDAY=",t=[].slice.call(this.element.querySelectorAll(".e-days button."+ti)),i=["SU","MO","TU","WE","TH","FR","SA"];this.rotateArray(i,this.firstDayOfWeek);for(var n=0;n<t.length;n++)e+=i[parseInt(t[parseInt(n.toString(),10)].getAttribute("data-index"),10)]+(n===t.length-1?"":",");return e+";"},i.prototype.getSelectedMonthData=function(){return this.onWeekDay.checked?"BYDAY="+this.monthWeekDays.value+";BYSETPOS="+this.monthWeekPos.value+";":"BYMONTHDAY="+this.monthDate.value+";"},i.prototype.getIntervalData=function(){return"INTERVAL="+this.repeatInterval.value+";"},i.prototype.getEndOnCount=function(){return"COUNT="+this.recurrenceCount.value+";"},i.prototype.getYearMonthRuleData=function(){return"BYMONTH="+this.monthValue.value+";"},i.prototype.updateWeekButton=function(e){var t=["SU","MO","TU","WE","TH","FR","SA"];this.rotateArray(t,this.firstDayOfWeek);for(var i=0,n=this.dayButtons;i<n.length;i++){var r=n[i],a=parseInt(r.element.getAttribute("data-index"),10);-1!==e.indexOf(t[parseInt(a.toString(),10)])?r.setProperties({isPrimary:!0}):r.setProperties({isPrimary:!1})}},i.prototype.updateMonthUI=function(){if(this.ruleObject.monthDay.length)this.monthDate.setProperties({value:this.ruleObject.monthDay[0]}),this.onMonthDay.setProperties({checked:!0});else{this.onWeekDay.setProperties({checked:!0}),this.monthWeekPos.setProperties({value:this.ruleObject.setPosition});for(var e=0,t=Object.keys(ni);e<t.length;e++){var i=t[e];if(ni[""+i]===this.ruleObject.day[0]){this.monthWeekDays.setProperties({value:this.ruleObject.day[0]});break}}}},i.prototype.updateUI=function(e,t){switch(this.repeatInterval.setProperties({value:this.ruleObject.interval}),t){case"until":this.untilDateObj.setProperties({value:this.ruleObject.until});break;case"count":this.recurrenceCount.setProperties({value:this.ruleObject.count})}switch(e){case"weekly":this.updateWeekButton(this.ruleObject.day);break;case"yearly":this.monthValue.setProperties({index:this.ruleObject.month[0]-1}),this.updateMonthUI();break;case"monthly":this.updateMonthUI()}},i.prototype.getUntilData=function(){return this.untilDateObj.value?"UNTIL="+Ne(this.untilDateObj.value)+";":""},i.prototype.destroyComponents=function(){this.recurrenceCount.isDestroyed||(this.recurrenceCount.destroy(),this.recurrenceCount=null),this.monthDate.isDestroyed||(this.monthDate.destroy(),this.monthDate=null),this.repeatInterval.isDestroyed||(this.repeatInterval.destroy(),this.repeatInterval=null),this.untilDateObj.isDestroyed||(this.untilDateObj.destroy(),this.untilDateObj=null),this.repeatType.isDestroyed||(this.repeatType.destroy(),this.repeatType=null),this.endType.isDestroyed||(this.endType.destroy(),this.endType=null),this.monthWeekPos.isDestroyed||(this.monthWeekPos.destroy(),this.monthWeekPos=null),this.monthWeekDays.isDestroyed||(this.monthWeekDays.destroy(),this.monthWeekDays=null),this.monthValue.isDestroyed||(this.monthValue.destroy(),this.monthValue=null),this.onMonthDay.isDestroyed||(this.onMonthDay.destroy(),this.onMonthDay=null),this.onWeekDay.isDestroyed||(this.onWeekDay.destroy(),this.onWeekDay=null),this.dayButtons.forEach(function(e){e.isDestroyed||e.destroy()}),this.dayButtons=[],this.monthButtons.forEach(function(e){e.isDestroyed||e.destroy()}),this.monthButtons=[]},i.prototype.resetFields=function(){this.startState("none",this.endTypes[0],this.startDate),this.setDefaultValue()},i.prototype.updateRuleUntilDate=function(e){if(this.untilDateObj.value&&e){var t=this.untilDateObj.value,i=new Date(t.getFullYear(),t.getMonth(),t.getDate(),e.getHours(),e.getMinutes(),e.getMilliseconds());this.untilDateObj.setProperties({value:i})}},i.prototype.getCalendarMode=function(){return t.isNullOrUndefined(this.calendarMode)?"gregorian":this.calendarMode.toLowerCase()},i.prototype.getRuleSummary=function(e){return void 0===e&&(e=this.getRecurrenceRule()),Y(e,this.localeObj,this.locale,this.calendarMode)},i.prototype.getRecurrenceDates=function(e,i,n,r,a){return a=t.isNullOrUndefined(a)?this.startDate:a,G(e,i,n,this.firstDayOfWeek,r,a,this.calendarMode)},i.prototype.getRecurrenceRule=function(){var e="FREQ=";switch(this.repeatType.value){case"daily":e+="DAILY;";break;case"weekly":e+="WEEKLY;"+this.getSelectedDaysData();break;case"monthly":e+="MONTHLY;"+this.getSelectedMonthData();break;case"yearly":e+="YEARLY;"+this.getSelectedMonthData()+this.getYearMonthRuleData();break;case"none":return""}switch(e+=this.getIntervalData(),this.endType.value){case"until":e+=this.getUntilData();break;case"count":e+=this.getEndOnCount()}return e},i.prototype.setRecurrenceRule=function(e,t){if(void 0===t&&(t=this.startDate),!e)return void this.repeatType.setProperties({value:"none"});this.renderStatus=!1,this.ruleObject=Ee(e);var i=this.ruleObject.count?"count":this.ruleObject.until?"until":"never";switch(this.ruleObject.freq){case"DAILY":this.startState("daily",i,t),this.updateUI("daily",i);break;case"WEEKLY":this.startState("weekly",i,t),this.updateUI("weekly",i);break;case"MONTHLY":this.startState("monthly",i,t),this.updateUI("monthly",i);break;case"YEARLY":this.startState("yearly",i,t),this.updateUI("yearly",i)}this.renderStatus=!0,this.triggerChangeEvent()},i.prototype.detachInputs=function(){for(var e=0,i=[].slice.call(this.element.querySelectorAll("input"));e<i.length;e++){var n=i[e];t.detach(n)}},i.prototype.destroy=function(){if(!this.isDestroyed){this.destroyComponents(),e.prototype.destroy.call(this);var i=["e-"+this.getModuleName()];for(this.cssClass&&(i=i.concat(this.cssClass.split(" "))),t.removeClass([this.element],i),this.detachInputs();this.element.firstElementChild;)this.element.removeChild(this.element.firstElementChild)}},i.prototype.getModuleName=function(){return"recurrenceeditor"},i.prototype.getPersistData=function(){return this.addOnPersist([])},i.prototype.render=function(){this.initialize(),this.rtlClass(this.enableRtl),this.renderStatus=!0,this.renderComplete()},i.prototype.onPropertyChanged=function(e,i){for(var n=0,r=Object.keys(e);n<r.length;n++)switch(r[n]){case"startDate":this.selectMonthDay(e.startDate),this.updateUntilDate(e.startDate),this.endType.setProperties({index:0});break;case"enableRtl":this.rtlClass(e.enableRtl);break;case"cssClass":i.cssClass&&t.removeClass([this.element],i.cssClass.split(" ")),e.cssClass&&t.addClass([this.element],e.cssClass.split(" "));break;case"selectedType":this.repeatType.setProperties({index:this.selectedType});break;case"minDate":this.untilDateObj.setProperties({min:this.minDate});break;case"maxDate":this.untilDateObj.setProperties({max:this.maxDate});break;case"value":this.getRecurrenceRule()!==this.value&&this.setRecurrenceRule(this.value);break;case"calendarMode":this.calendarMode=e.calendarMode,this.calendarUtil=je(e.calendarMode);break;case"locale":case"frequencies":case"firstDayOfWeek":case"endTypes":this.refresh();break;case"dateFormat":this.untilDateObj.setProperties({format:e.dateFormat})}},Kt([t.Property(["none","daily","weekly","monthly","yearly"])],i.prototype,"frequencies",void 0),Kt([t.Property(["never","until","count"])],i.prototype,"endTypes",void 0),Kt([t.Property(0)],i.prototype,"firstDayOfWeek",void 0),Kt([t.Property(new Date)],i.prototype,"startDate",void 0),Kt([t.Property()],i.prototype,"dateFormat",void 0),Kt([t.Property("Gregorian")],i.prototype,"calendarMode",void 0),Kt([t.Property()],i.prototype,"cssClass",void 0),Kt([t.Property()],i.prototype,"value",void 0),Kt([t.Property(new Date(1900,0,1))],i.prototype,"minDate",void 0),Kt([t.Property(new Date(2099,11,31))],i.prototype,"maxDate",void 0),Kt([t.Property(0)],i.prototype,"selectedType",void 0),Kt([t.Event()],i.prototype,"change",void 0),Kt([t.Event()],i.prototype,"created",void 0),Kt([t.Event()],i.prototype,"destroyed",void 0),i=Kt([t.NotifyPropertyChanges],i)}(t.Component),ui=function(){function e(e){this.parent=e,this.l10n=this.parent.localeObj,this.fields=this.parent.eventFields,this.eventWindowTime={startTime:new Date,endTime:new Date},this.renderEventWindow()}return e.prototype.renderEventWindow=function(){this.element=t.createElement("div",{id:this.parent.element.id+"_dialog_wrapper"}),this.parent.element.appendChild(this.element);var e={animationSettings:{effect:"Zoom"},content:this.getEventWindowContent(),cssClass:"e-schedule-dialog",enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,height:this.parent.isAdaptive?"100%":"auto",minHeight:"300px",isModal:!0,showCloseIcon:!this.parent.isAdaptive,target:document.body,visible:!1,width:"500px",beforeOpen:this.onBeforeOpen.bind(this),beforeClose:this.onBeforeClose.bind(this)};this.parent.isAdaptive?(e.cssClass="e-schedule-dialog e-device",this.parent.editorHeaderTemplate||(e.header='<div class="e-title-header"><div class="e-back-icon e-icons"></div><div class="e-title-text">'+this.l10n.getConstant("newEvent")+'</div><div class="e-save-icon e-icons"></div></div>')):(this.parent.editorFooterTemplate||this.renderDialogButtons(e),this.parent.editorHeaderTemplate||(e.header='<div class="e-title-text">'+this.l10n.getConstant("newEvent")+"</div>")),this.dialogObject=new i.Dialog(e,this.element),this.dialogObject.element.querySelector(".e-dlg-closeicon-btn")&&this.dialogObject.element.querySelector(".e-dlg-closeicon-btn").setAttribute("title",this.l10n.getConstant("close")),this.addEventHandlers(),t.addClass([this.element.parentElement],"e-schedule-dialog-container"),t.EventHandler.add(this.dialogObject.element,"keydown",this.preventEventSave,this),this.applyFormValidation()},e.prototype.renderDialogButtons=function(e){e.buttons=[{buttonModel:{content:this.l10n.getConstant("deleteButton"),cssClass:"e-event-delete",disabled:!this.parent.eventSettings.allowDeleting||this.parent.readonly},click:this.eventDelete.bind(this)},{buttonModel:{content:this.l10n.getConstant("saveButton"),cssClass:"e-primary e-event-save",isPrimary:!0,disabled:!this.parent.eventSettings.allowAdding||this.parent.readonly},click:this.eventSave.bind(this)},{buttonModel:{cssClass:"e-event-cancel",content:this.l10n.getConstant("cancelButton")},click:this.dialogClose.bind(this)}]},e.prototype.addEventHandlers=function(){var e=this.element.querySelector(".e-back-icon"),i=this.element.querySelector(".e-save-icon");!this.parent.isAdaptive||t.isNullOrUndefined(e)||t.isNullOrUndefined(i)||(t.EventHandler.add(e,"click",this.dialogClose,this),t.EventHandler.add(i,"click",this.eventSave,this))},e.prototype.refresh=function(){this.destroy(!0),this.renderEventWindow()},e.prototype.refreshRecurrenceEditor=function(){if(this.recurrenceEditor){var e=this.recurrenceEditor.element;this.recurrenceEditor.destroy(),this.createRecurrenceEditor(e)}},e.prototype.setRecurrenceEditor=function(e){this.parent.editorTemplate&&(this.recurrenceEditor=e)},e.prototype.openEditor=function(e,i,n,r){if(this.parent.currentAction=i,this.parent.removeNewEventElement(),this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(!0),this.parent.inlineModule.removeInlineAppointmentElement(),"Add"===i){var a={};this.cellClickAction=!n,this.parent.activeCellsData=e;var s=e;this.cellClickAction?this.convertToEventData(s,a):(this.parent.activeCellsData={startTime:s.startTime||s[this.fields.startTime],endTime:s.endTime||s[this.fields.endTime],isAllDay:s.isAllDay||s[this.fields.isAllDay],element:s.element,groupIndex:s.groupIndex},a=s),e=a}t.isNullOrUndefined(this.parent.editorHeaderTemplate)||(this.parent.resetTemplates(["editorHeaderTemplate"]),this.parent.isAdaptive&&!this.parent.editorFooterTemplate?this.dialogObject.header=this.createAdaptiveHeaderElement(e):this.dialogObject.header=this.getDialogHeader(e)),t.isNullOrUndefined(this.parent.editorFooterTemplate)||(this.parent.resetTemplates(["editorFooterTemplate"]),this.dialogObject.footerTemplate=this.getDialogFooter(e)),t.isNullOrUndefined(this.parent.editorHeaderTemplate)&&t.isNullOrUndefined(this.parent.editorFooterTemplate)||(this.dialogObject.dataBind(),this.addEventHandlers()),t.isNullOrUndefined(this.parent.editorTemplate)?this.setEditorContent(e,i,r):this.renderFormElements(this.element.querySelector(".e-schedule-form"),e,i,r)},e.prototype.setEditorContent=function(e,i,n){switch(!this.parent.isAdaptive&&t.isNullOrUndefined(this.parent.editorTemplate)&&t.removeClass([this.dialogObject.element.querySelector(".e-recurrenceeditor")],"e-disable"),this.recurrenceEditor&&(this.recurrenceEditor.firstDayOfWeek=this.parent.activeViewOptions.firstDayOfWeek),i){case"Add":this.onCellDetailsUpdate(e,n);break;case"Save":case"EditOccurrence":case"EditSeries":case"EditFollowingEvents":"EditOccurrence"===i&&!this.parent.isAdaptive&&t.isNullOrUndefined(this.parent.editorTemplate)&&t.addClass([this.dialogObject.element.querySelector(".e-recurrenceeditor")],"e-disable"),this.cellClickAction=!1,this.onEventDetailsUpdate(e)}},e.prototype.setDialogContent=function(){this.dialogObject.content=this.getEventWindowContent(),this.dialogObject.dataBind(),this.applyFormValidation()},e.prototype.setDialogHeader=function(){t.isNullOrUndefined(this.parent.editorHeaderTemplate)?this.parent.isAdaptive?this.dialogObject.header='<div class="e-title-header"><div class="e-back-icon e-icons"></div><div class="e-title-text">'+this.l10n.getConstant("newEvent")+'</div><div class="e-save-icon e-icons"></div></div>':this.dialogObject.header='<div class="e-title-text">'+this.l10n.getConstant("newEvent")+"</div>":(this.parent.resetTemplates(["editorHeaderTemplate"]),this.parent.isAdaptive&&!this.parent.editorFooterTemplate?this.dialogObject.header=this.createAdaptiveHeaderElement():this.dialogObject.header=this.getDialogHeader()),this.dialogObject.dataBind(),this.addEventHandlers()},e.prototype.setDialogFooter=function(){t.isNullOrUndefined(this.parent.editorFooterTemplate)?!this.parent.isAdaptive&&t.isNullOrUndefined(this.parent.editorFooterTemplate)?this.renderDialogButtons(this.dialogObject):this.parent.isAdaptive&&t.isNullOrUndefined(this.parent.editorFooterTemplate)&&(this.dialogObject.footerTemplate=null):(this.parent.resetTemplates(["editorFooterTemplate"]),this.dialogObject.footerTemplate=this.getDialogFooter()),this.dialogObject.dataBind()},e.prototype.createAdaptiveHeaderElement=function(e){var i=t.createElement("div",{className:"e-title-header"}),n=t.createElement("div",{className:"e-back-icon e-icons"});i.appendChild(n);var r=this.getDialogHeader(e);i.appendChild(r);var a=t.createElement("div",{className:"e-save-icon e-icons"});return i.appendChild(a),i},e.prototype.getDialogHeader=function(e){var i=[],n=this.parent.element.id+"_editorHeaderTemplate",r=document.createElement("div");return i=[].slice.call(this.parent.getEditorHeaderTemplate()(e||{},this.parent,"editorHeaderTemplate",n,!1)),t.append(i,r),r},e.prototype.getDialogFooter=function(e){var i=[],n=this.parent.element.id+"_editorFooterTemplate",r=document.createElement("div");return i=[].slice.call(this.parent.getEditorFooterTemplate()(e||{},this.parent,"editorFooterTemplate",n,!1)),t.append(i,r),r},e.prototype.preventEventSave=function(e){this.parent&&!this.parent.allowKeyboardInteraction&&"Enter"===e.code&&(this.isEnterKey=!0)},e.prototype.onBeforeOpen=function(e){var i=this,n=this.eventData[this.fields.endTime].getTime(),r={type:"Editor",data:this.eventData,cancel:!1,element:this.element,target:this.cellClickAction?this.parent.activeCellsData.element:this.parent.activeEventData.element};this.cellClickAction&&(r.duration=this.getSlotDuration());var s=this.getInstance("e-event-save");s&&(s.disabled=!(this.cellClickAction?this.parent.eventSettings.allowAdding:this.parent.eventSettings.allowEditing),s.dataBind());var o=this.getInstance("e-event-delete");o&&(o.disabled=!this.parent.eventSettings.allowDeleting,o.dataBind());var l=new a.Deferred;return this.parent.trigger("popupOpen",r,function(r){if(e.cancel=r.cancel,e.maxHeight=i.parent.isAdaptive?"max-content":e.maxHeight,i.duration=i.cellClickAction?r.duration:null,i.eventData[i.fields.endTime].getTime()!==n||i.cellClickAction||0!==i.eventData[i.fields.endTime].getHours()||0!==i.eventData[i.fields.endTime].getMinutes()||(i.eventData=t.extend({},i.eventData,null,!0),i.trimAllDay(i.eventData)),i.refreshDateTimePicker(i.duration),i.cellClickAction&&r.duration!==i.getSlotDuration()&&t.isNullOrUndefined(i.parent.editorTemplate)){var a=i.getInstance("e-start"),s=i.getInstance("e-end");s.value=new Date(a.value.getTime()+Ke*r.duration),s.dataBind()}i.parent.editorTemplate&&i.element.querySelector(".e-recurrenceeditor")&&!i.recurrenceEditor&&(i.recurrenceEditor=i.getInstance("e-recurrenceeditor")),l.resolve(e)}),l},e.prototype.onBeforeClose=function(e){var t=this;e.isInteracted&&(this.isCrudAction=!1);var i={type:"Editor",event:e.event||this.dialogEvent,data:this.eventCrudData,cancel:!1,element:this.element,target:this.cellClickAction?this.parent.activeCellsData.element:this.parent.activeEventData.element},n=new a.Deferred;return this.parent.trigger("popupClose",i,function(i){e.cancel=i.cancel,i.cancel||(t.isCrudAction&&(e.cancel=t.processCrudActions(i.data),t.isCrudAction=e.cancel),t.isCrudAction||(t.resetForm(),t.parent.eventBase.focusElement(!0),t.eventCrudData=null)),n.resolve(e)}),n},e.prototype.getEventWindowContent=function(){var e=t.createElement("div",{className:"e-form-container"}),i=t.createElement("form",{id:this.parent.element.id+"EditForm",className:ot});return i.onsubmit=function(){return!1},this.renderFormElements(i),e.appendChild(i),e},e.prototype.renderFormElements=function(e,i,n,r){var a=this;if(t.isNullOrUndefined(this.parent.editorTemplate))e.appendChild(this.getDefaultEventWindowContent()),i&&this.setEditorContent(i,n,r);else{if(i&&(this.fieldValidator&&(this.fieldValidator.destroy(),this.fieldValidator=null),this.recurrenceEditor&&(this.recurrenceEditor.destroy(),this.recurrenceEditor=null),this.destroyComponents(),this.parent.resetTemplates(["editorTemplate"]),t.EventHandler.clearEvents(e),!this.parent.isReact))for(var s=0,o=[].slice.call(e.children);s<o.length;s++){var l=o[s];t.remove(l)}var p=this.parent.element.id+"_editorTemplate",c=[].slice.call(this.parent.getEditorTemplate()(i||{},this.parent,"editorTemplate",p,!1));t.append(c,e),this.parent.renderTemplates(function(){a.element&&(a.applyFormValidation(),i&&a.setEditorContent(i,n,r))})}},e.prototype.getDefaultEventWindowContent=function(){var e=this.createDivElement("e-dialog-parent"),i=this.createDivElement("e-title-location-row");e.appendChild(i),i.appendChild(this.renderTextBox("e-subject")),i.appendChild(this.renderTextBox("e-location"));var n=this.createDivElement("e-start-end-row");e.appendChild(n),n.appendChild(this.renderDateTimePicker("e-start",this.onTimeChange.bind(this))),n.appendChild(this.renderDateTimePicker("e-end"));var r=this.createDivElement("e-all-day-time-zone-row");e.appendChild(r),r.appendChild(this.renderCheckBox("e-all-day")),r.appendChild(this.renderCheckBox("e-time-zone"));var a=this.createDivElement("e-time-zone-row");e.appendChild(a),a.appendChild(this.renderDropDown("e-start-time-zone")),a.appendChild(this.renderDropDown("e-end-time-zone"));var o=this.createDivElement("e-repeat-parent-row");e.appendChild(o);var l=this.renderCheckBox("e-repeat"),p=t.createElement("span",{className:"e-recurrence-container"}),c=t.createElement("button",{className:"e-recurrence-edit-button",attrs:{type:"button",title:this.l10n.getConstant("editRecurrence")}});if(this.buttonObj=new s.Button({iconCss:"e-recurrence-edit e-icons",cssClass:"e-medium "+this.parent.cssClass}),p.appendChild(c),this.buttonObj.appendTo(c),l.appendChild(p),o.appendChild(l),this.parent.isAdaptive?t.EventHandler.add(c,"click",this.loadRecurrenceEditor,this):this.createRecurrenceEditor(e),this.parent.resourceCollection.length>0){for(var h=this.createDivElement("e-resources-row"),d=0,u=this.parent.resourceBase.resourceCollection;d<u.length;d++){var g=u[d];h.appendChild(this.renderResourceDetails(g))}e.appendChild(h)}var v=this.createDivElement("e-description-row");v.appendChild(this.renderTextBox("e-description")),e.appendChild(v);var m=t.createElement("button",{attrs:{type:"hidden",title:"submit"}});return m.style.display="none",e.appendChild(m),e},e.prototype.createRecurrenceEditor=function(e){var i=t.createElement("div",{id:this.parent.element.id+"_recurrence_editor"});e.appendChild(i),this.recurrenceEditor=this.renderRecurrenceEditor(),this.recurrenceEditor.appendTo(i),this.updateMinMaxDateToEditor()},e.prototype.createDivElement=function(e){return t.createElement("div",{className:e})},e.prototype.createInputElement=function(e,i,n){return t.createElement(n||"input",{className:e,attrs:{type:"text",name:i,value:"",id:i}})},e.prototype.getSlotDuration=function(){return this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount},e.prototype.renderDateTimePicker=function(e,i){var n=this.createDivElement(e+"-container"),a=this.getFieldName(e),s=this.createInputElement(e+" e-field",a);return n.appendChild(s),new r.DateTimePicker({change:i,firstDayOfWeek:this.parent.activeViewOptions.firstDayOfWeek,calendarMode:this.parent.calendarMode,min:this.parent.minDate,max:new Date(new Date(+this.parent.maxDate).setHours(23,59,59)),cssClass:this.parent.cssClass,enableRtl:this.parent.enableRtl,locale:this.parent.locale,floatLabelType:"Always",strictMode:!0,timeFormat:this.parent.activeViewOptions.timeFormat,format:(t.isNullOrUndefined(this.parent.dateFormat)?this.getFormat("dateFormats"):this.parent.dateFormat)+" "+this.parent.activeViewOptions.timeFormat,placeholder:this.getFieldLabel(e),step:this.getSlotDuration(),width:"100%"}).appendTo(s),n},e.prototype.refreshDateTimePicker=function(e){for(var t=0,i=[].slice.call(this.element.querySelectorAll(".e-start,.e-end"));t<i.length;t++){var n=i[t].ej2_instances[0];n.firstDayOfWeek=this.parent.activeViewOptions.firstDayOfWeek,n.timeFormat=this.parent.activeViewOptions.timeFormat,n.step=e||this.getSlotDuration(),n.dataBind()}},e.prototype.onTimeChange=function(){var e=this.getInstance("e-start");if(e.element.parentElement.classList.contains("e-input-focus")){var i=this.getInstance("e-end"),n=0;this.cellClickAction?(n=Ke*this.duration,this.eventWindowTime.startTime=e.value):n=this.eventData[this.fields.endTime].getTime()-this.eventData[this.fields.startTime].getTime();var r=t.isNullOrUndefined(e.value)?null:new Date(e.value.getTime()+n);this.cellClickAction&&(this.eventWindowTime.endTime=r),i.value=r,i.dataBind()}this.recurrenceEditor&&this.recurrenceEditor.updateRuleUntilDate(this.eventWindowTime.startTime)},e.prototype.renderResourceDetails=function(e){var i=this,n=e.field,r="e-"+n,a=e.title,s=this.createDivElement(r+"-container e-resources"),o=this.createInputElement(r+" e-field",n);s.appendChild(o);var p=function(i){return t.SanitizeHtmlHelper.sanitize('<div class="e-resource-template">\n <div class="e-resource-color" data-resource-color="'+i[e.colorField]+'"></div>\n <div class="e-resource-text">'+i[e.textField]+"</div></div>")};return t.initializeCSPTemplate(p,e),e.allowMultiple?new l.MultiSelect({enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass||"",dataSource:e.dataSource,change:this.onMultiselectResourceChange.bind(this),itemTemplate:p,fields:{text:e.textField,value:e.idField},htmlAttributes:{name:n},floatLabelType:"Always",placeholder:a,popupHeight:"230px",popupWidth:"447px",mode:"Box",open:function(e){Promise.resolve().then(function(){i.applyStylesAfterRender(e)})}}).appendTo(o):new l.DropDownList({cssClass:this.parent.cssClass||"",change:this.onDropdownResourceChange.bind(this),dataSource:e.dataSource,enableRtl:this.parent.enableRtl,fields:{text:e.textField,value:e.idField},htmlAttributes:{name:n},floatLabelType:"Always",placeholder:a,popupHeight:"230px",popupWidth:"447px",itemTemplate:p,open:function(e){Promise.resolve().then(function(){i.applyStylesAfterRender(e)})}}).appendTo(o),s},e.prototype.applyStylesAfterRender=function(e){e.popup&&e.popup.element&&e.popup.element.querySelectorAll(".e-resource-color[data-resource-color]").forEach(function(e){var t=e.getAttribute("data-resource-color");t&&(e.style.backgroundColor=t)})},e.prototype.renderDropDown=function(e){var t=this,i=this.getFieldName(e),n=this.createDivElement(e+"-container"),r=this.createInputElement(e+" e-field",i);return n.appendChild(r),new l.DropDownList({allowFiltering:!0,change:this.onTimezoneChange.bind(this),cssClass:this.parent.cssClass||"",dataSource:this.parent.timezoneDataSource,enableRtl:this.parent.enableRtl,fields:{text:"Text",value:"Value"},filterBarPlaceholder:this.parent.localeObj.getConstant("searchTimezone"),noRecordsTemplate:this.parent.localeObj.getConstant("noRecords"),filtering:function(e){var i=new a.Query;i=""!==e.text?i.where("Text","contains",e.text,!0):i,e.updateData(t.parent.timezoneDataSource,i)},htmlAttributes:{title:this.getFieldLabel(e),name:i},floatLabelType:"Always",placeholder:this.getFieldLabel(e),popupHeight:"230px"}).appendTo(r),n},e.prototype.onMultiselectResourceChange=function(e){if(e.value&&this.parent.activeViewOptions.group.byGroupID&&!(this.parent.resourceCollection.length<=1))for(var i=this.parent.resourceBase.resourceCollection,n=e.element.getAttribute("name")||this.getColumnName(e.element),r=0;r<i.length;r++)if(i[parseInt(r.toString(),10)].field===n&&r<i.length-1){for(var a=this.createInstance(r),s=[],o=this,l=0;l<e.value.length;l++)!function(n){var a=i[r+1],l=a.dataSource.filter(function(t){return t[a.groupIDField]===e.value[parseInt(n.toString(),10)]})[0],p=t.isNullOrUndefined(l)?null:l[i[r+1].groupIDField],c=o.filterDatasource(r,p);s=s.concat(c)}(l);a.dataSource=s,a.dataBind()}},e.prototype.createInstance=function(e){var t=this.parent.resourceBase.resourceCollection[e+1],i=this.element.querySelector(".e-"+t.field).ej2_instances[0];return i.clear(),i},e.prototype.onDropdownResourceChange=function(e){if(e.value&&!(this.parent.resourceCollection.length<=1)&&this.parent.activeViewOptions.group.byGroupID)for(var t=e.element.getAttribute("name")||this.getColumnName(e.element),i=this.parent.resourceBase.resourceCollection,n=0;n<i.length;n++)if(n<i.length-1&&i[parseInt(n.toString(),10)].field===t){var r=this.createInstance(n),a=e.itemData[i[parseInt(n.toString(),10)].idField];r.dataSource=this.filterDatasource(n,a),r.dataBind();var s=r.dataSource.length>0?r.dataSource[0][i[n+1].idField]:null;r.value=i[n+1].allowMultiple?[s]:s,r.dataBind()}},e.prototype.filterDatasource=function(e,t){var i=this.parent.resourceBase.resourceCollection[e+1];return i.dataSource.filter(function(e){return e[i.groupIDField]===t})},e.prototype.onTimezoneChange=function(e){if((e.element.getAttribute("name")||this.getColumnName(e.element))===this.parent.eventFields.startTimezone){var t=this.getInstance("e-start-time-zone"),i=this.getInstance("e-end-time-zone");i.value=t.value,i.dataBind()}},e.prototype.renderCheckBox=function(e){var t=this.createDivElement(e+"-container"),i=this.getFieldName(e),n=this.createInputElement(e+" e-field",i);t.appendChild(n);var r=new s.CheckBox({change:this.onChange.bind(this),cssClass:e+" "+this.parent.cssClass,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,label:this.getFieldLabel(e)});return r.appendTo(n),n.setAttribute("name",i),"Repeat"===i&&(this.repeatStatus=r),t},e.prototype.renderTextBox=function(e){var t=this.createDivElement(e+"-container"),i=this.getFieldName(e),n="e-description"===e?"textarea":"input",r=this.createInputElement(e+" e-field",i,n);return t.appendChild(r),o.Input.createInput({element:r,floatLabelType:"Always",properties:{enableRtl:this.parent.enableRtl,placeholder:this.getFieldLabel(e)}}),t},e.prototype.getFieldName=function(e){var t="";switch(e){case"e-subject":t=this.fields.subject;break;case"e-location":t=this.fields.location;break;case"e-start":t=this.fields.startTime;break;case"e-end":t=this.fields.endTime;break;case"e-description":t=this.fields.description;break;case"e-all-day":t=this.fields.isAllDay;break;case"e-start-time-zone":t=this.fields.startTimezone;break;case"e-end-time-zone":t=this.fields.endTimezone;break;case"e-time-zone":t="Timezone";break;case"e-repeat":t="Repeat"}return t},e.prototype.getFieldLabel=function(e){var t="";switch(e){case"e-subject":t=this.parent.editorTitles.subject;break;case"e-location":t=this.parent.editorTitles.location;break;case"e-description":t=this.parent.editorTitles.description;break;case"e-start":t=this.parent.editorTitles.startTime;break;case"e-end":t=this.parent.editorTitles.endTime;break;case"e-start-time-zone":t=this.parent.editorTitles.startTimezone;break;case"e-end-time-zone":t=this.parent.editorTitles.endTimezone;break;case"e-repeat":t=this.parent.editorTitles.recurrenceRule;break;case"e-all-day":t=this.parent.editorTitles.isAllDay;break;case"e-time-zone":t=this.l10n.getConstant("timezone")}return t},e.prototype.onChange=function(e){if(e.event&&e.event.target){var i=t.closest(e.event.target,".e-all-day,.e-time-zone,.e-repeat");i.classList.contains("e-all-day")?this.onAllDayChange(e.checked):i.classList.contains("e-time-zone")?this.timezoneChangeStyle(e.checked):i.classList.contains("e-repeat")&&this.onRepeatChange(e.checked)}},e.prototype.renderRepeatDialog=function(){var e=t.createElement("div");this.repeatDialogObject=new i.Dialog({header:this.l10n.getConstant("recurrence"),visible:!1,content:'<div class="e-rec-editor"></div>',closeOnEscape:!0,width:"90%",buttons:[{click:this.repeatSaveDialog.bind(this),buttonModel:{content:this.l10n.getConstant("save"),cssClass:"e-save",isPrimary:!0}},{click:this.repeatCancelDialog.bind(this),buttonModel:{cssClass:"e-cancel",content:this.l10n.getConstant("cancel")}}],target:this.element,animationSettings:{effect:"Zoom"},enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,isModal:!0,cssClass:"e-recurrence-dialog",open:this.repeatOpenDialog.bind(this)}),this.element.appendChild(e),this.repeatDialogObject.appendTo(e),this.createRecurrenceEditor(this.repeatDialogObject.element.querySelector(".e-rec-editor"))},e.prototype.loadRecurrenceEditor=function(){this.repeatDialogObject.show(),this.recurrenceEditor&&this.repeatRule&&this.recurrenceEditor.setRecurrenceRule(this.repeatRule)},e.prototype.onRepeatChange=function(e){if(e)this.repeatDialogObject||this.renderRepeatDialog(),this.recurrenceEditor.setProperties({startDate:this.repeatStartDate,selectedType:0}),this.loadRecurrenceEditor();else{this.repeatDialogObject&&this.repeatDialogObject.hide(),this.repeatRule="",this.recurrenceEditor&&(this.recurrenceEditor.setRecurrenceRule(this.repeatRule),this.updateRepeatLabel(this.repeatRule));var i=this.element.querySelector(".e-recurrence-container");t.addClass([i],"e-hide")}},e.prototype.repeatSaveDialog=function(){this.repeatRule=this.recurrenceEditor.getRecurrenceRule();var e=this.element.querySelector(".e-recurrence-container");this.recurrenceEditor.getRecurrenceRule()?t.removeClass([e],"e-hide"):(t.addClass([e],"e-hide"),this.repeatStatus.setProperties({checked:!1})),this.updateRepeatLabel(this.repeatRule),this.closeRepeatDialog()},e.prototype.closeRepeatDialog=function(){this.repeatDialogObject.hide()},e.prototype.repeatCancelDialog=function(){this.closeRepeatDialog(),this.recurrenceEditor&&this.recurrenceEditor.setRecurrenceRule(this.repeatTempRule),this.repeatTempRule||this.repeatStatus.setProperties({checked:!1})},e.prototype.repeatOpenDialog=function(){this.repeatTempRule=this.recurrenceEditor.getRecurrenceRule()},e.prototype.onCellDetailsUpdate=function(e,i){if(this.parent.eventSettings.allowAdding){this.parent.isAdaptive&&i&&!this.repeatDialogObject&&this.renderRepeatDialog(),this.element.querySelector("."+ot).removeAttribute("data-id"),t.isNullOrUndefined(this.parent.editorHeaderTemplate)&&(this.element.querySelector(".e-title-text").innerHTML=this.l10n.getConstant("newEvent")),e.Timezone=!1,this.repeatStartDate=e[this.fields.startTime],this.repeatRule="",t.isNullOrUndefined(this.parent.eventSettings.fields.subject.default)||(e[this.fields.subject]=this.parent.eventSettings.fields.subject.default),t.isNullOrUndefined(this.parent.eventSettings.fields.location.default)||(e[this.fields.location]=this.parent.eventSettings.fields.location.default),t.isNullOrUndefined(this.parent.eventSettings.fields.description.default)||(e[this.fields.description]=this.parent.eventSettings.fields.description.default),this.showDetails(e),e[this.fields.recurrenceRule]&&this.recurrenceEditor&&(this.recurrenceEditor.setRecurrenceRule(e[this.fields.recurrenceRule],e[this.fields.startTime]),this.repeatRule=e[this.fields.recurrenceRule]);var n=this.element.querySelector(".e-event-delete");if(n&&t.addClass([n],"e-disable"),this.recurrenceEditor&&(this.recurrenceEditor.setProperties({startDate:e[this.fields.startTime],selectedType:t.isNullOrUndefined(i)?t.isNullOrUndefined(e[this.fields.recurrenceRule])?0:this.recurrenceEditor.selectedType:i}),this.repeatRule=this.recurrenceEditor.value),this.parent.isAdaptive&&t.isNullOrUndefined(this.parent.editorTemplate)){var r=this.element.querySelector(".e-recurrence-container");e[this.fields.recurrenceRule]||i?(t.removeClass([r],"e-hide"),this.repeatStatus.setProperties({checked:!0})):(t.addClass([r],"e-hide"),this.repeatStatus.setProperties({checked:!1})),this.updateRepeatLabel(this.repeatRule)}else{var a=this.element.querySelector(".e-event-save");this.disableButton(a,!1)}this.dialogObject.show()}},e.prototype.convertToEventData=function(e,t){e&&(e.subject&&(t[this.fields.subject]=e.subject),t[this.fields.startTime]=e.startTime,t[this.fields.endTime]=e.endTime,t[this.fields.isAllDay]=e.isAllDay,e.RecurrenceRule&&(t[this.fields.recurrenceRule]=e.RecurrenceRule),(this.parent.resourceCollection.length>0||this.parent.activeViewOptions.group.resources.length>0)&&this.parent.resourceBase.setResourceValues(t))},e.prototype.applyFormValidation=function(){var e=this.element.querySelector("."+ot);if(e){var i=function(e){return e&&Object.keys(e).length>0?e:void 0},n={},r=i(this.parent.eventSettings.fields.subject.validation);t.isNullOrUndefined(r)||(n[this.parent.eventSettings.fields.subject.name]=r);var a=i(this.parent.eventSettings.fields.location.validation);t.isNullOrUndefined(a)||(n[this.parent.eventSettings.fields.location.name]=a);var s=i(this.parent.eventSettings.fields.startTime.validation);t.isNullOrUndefined(s)||(n[this.parent.eventSettings.fields.startTime.name]=s);var o=i(this.parent.eventSettings.fields.endTime.validation);t.isNullOrUndefined(o)||(n[this.parent.eventSettings.fields.endTime.name]=o);var l=i(this.parent.eventSettings.fields.description.validation);t.isNullOrUndefined(l)||(n[this.parent.eventSettings.fields.description.name]=l),this.fieldValidator&&(this.fieldValidator.destroy(),this.fieldValidator=null),this.fieldValidator=new _t,this.fieldValidator.renderFormValidator(e,n,this.element,this.parent.locale)}},e.prototype.showDetails=function(e){this.eventData=e;var i=t.extend({},e,null,!0),n=this.getFormElements("e-schedule-dialog");this.cellClickAction&&(!this.cellClickAction||t.isNullOrUndefined(this.parent.editorTemplate))||0!==i[this.fields.endTime].getHours()||0!==i[this.fields.endTime].getMinutes()||this.trimAllDay(i);for(var r=Object.keys(i),a=0,s=n;a<s.length;a++){var o=s[a],l=o.name||this.getColumnName(o);t.isNullOrUndefined(l)||""===l||(-1!==r.indexOf(l)?this.setValueToElement(o,i[""+l]):this.setDefaultValueToElement(o))}if(t.isNullOrUndefined(this.parent.editorTemplate)){this.onAllDayChange(i[this.fields.isAllDay]);var p=this.getInstance("e-time-zone.e-field");t.isNullOrUndefined(i[this.fields.startTimezone])&&t.isNullOrUndefined(i[this.fields.endTimezone])||(p.checked=!0,p.dataBind()),this.timezoneChangeStyle(p.checked),delete i.Timezone}},e.prototype.getColumnName=function(e){var i=e.getAttribute("data-name")||"";if(""===i){var n=!1,r="";e.classList.contains("e-dropdownlist")?(r="e-ddl",n=!0):e.classList.contains("e-multiselect")?(r="e-multiselect",n=!0):e.classList.contains("e-datetimepicker")?r="e-datetimepicker":e.classList.contains("e-datepicker")?r="e-datepicker":e.classList.contains("e-checkbox")?r="e-checkbox":e.classList.contains("e-numerictextbox")&&(r="e-numerictextbox");var a=n?"."+r+":not(.e-control)":"."+r,s=t.closest(e,a)||e.querySelector("."+r);if(s){var o=s.querySelector("[name]");o&&(i=o.name)}}return i},e.prototype.onAllDayChange=function(e){var i,n=this.getInstance("e-start"),r=this.getInstance("e-end"),a=this.element.querySelector(".e-time-zone-container");e?(i=t.isNullOrUndefined(this.parent.dateFormat)?this.getFormat("dateFormats"):this.parent.dateFormat,t.addClass(this.element.querySelectorAll(".e-time-icon"),"e-icon-disable"),t.addClass([a],"e-disable"),this.element.querySelector(".e-time-zone-row")&&t.removeClass([this.element.querySelector(".e-time-zone-row")],"e-enable"),n.format=r.format=i):(i=t.isNullOrUndefined(this.parent.dateFormat)?this.getFormat("dateFormats")+" "+this.parent.activeViewOptions.timeFormat:this.parent.dateFormat+" "+this.parent.activeViewOptions.timeFormat,t.removeClass(this.element.querySelectorAll(".e-time-icon"),"e-icon-disable"),t.removeClass([a],"e-disable"),this.element.querySelector(".e-checkbox-wrapper .e-time-zone").checked&&t.addClass([this.element.querySelector(".e-time-zone-row")],"e-enable"),n.format=r.format=i),this.cellClickAction&&this.updateDateTime(e,n,r),n.dataBind(),r.dataBind(),t.isNullOrUndefined(this.recurrenceEditor)||this.recurrenceEditor.updateRuleUntilDate(n.value)},e.prototype.updateDateTime=function(e,i,n){var r,a;if(!t.isNullOrUndefined(this.eventWindowTime.startTime)||!t.isNullOrUndefined(this.eventWindowTime.endTime)){if(e)if(r=b(new Date(this.eventWindowTime.startTime.getTime())),this.parent.activeCellsData.isAllDay){var s=O(new Date(this.eventWindowTime.endTime.getTime()),-1).getTime();a=+this.eventWindowTime.startTime>s?this.eventWindowTime.endTime:new Date(s)}else a=b(new Date(this.eventWindowTime.endTime.getTime()));else{var o=this.parent.activeCellsData.startTime;if((r=new Date(this.eventWindowTime.startTime.getTime())).setHours(o.getHours(),o.getMinutes(),o.getSeconds()),this.parent.activeCellsData.isAllDay){var l=this.parent.getStartEndTime(this.parent.workHours.start);r.setHours(l.getHours(),l.getMinutes(),l.getSeconds()),(a=new Date(r.getTime())).setMilliseconds(Ke*this.getSlotDuration())}else(a=new Date(r.getTime())).setMilliseconds(this.parent.activeCellsData.endTime.getTime()-this.parent.activeCellsData.startTime.getTime())}this.eventWindowTime={startTime:new Date(r.getTime()),endTime:new Date(a.getTime())},i.value=r,n.value=a,i.dataBind(),n.dataBind()}},e.prototype.getFormat=function(e){return t.isNullOrUndefined(this.parent.locale)||"en"===this.parent.locale||"en-US"===this.parent.locale?t.getValue(e+".short",t.getDefaultDateObject(this.parent.getCalendarMode())):t.getValue("main."+this.parent.locale+".dates.calendars."+this.parent.getCalendarMode()+"."+e+".short",t.cldrData)},e.prototype.onEventDetailsUpdate=function(e){if(this.parent.eventSettings.allowEditing){if(!this.parent.isAdaptive&&t.isNullOrUndefined(this.parent.editorFooterTemplate)&&t.removeClass([this.element.querySelector(".e-event-delete")],"e-disable"),t.isNullOrUndefined(this.parent.editorHeaderTemplate)&&(this.element.querySelector(".e-title-text").innerHTML=this.l10n.getConstant("editEvent")),this.element.querySelector("."+ot).setAttribute("data-id",e[this.fields.id].toString()),t.isNullOrUndefined(this.parent.editorTemplate)){e=t.extend({},e,null,!0);var i=this.getInstance("e-time-zone.e-field"),n=void 0;e[this.fields.startTimezone]||e[this.fields.endTimezone]?(n=!0,this.parent.eventBase.timezoneConvert(e)):n=!1,e.Timezone=n,i.checked=n,i.dataBind()}if(this.showDetails(e),e[this.fields.recurrenceRule]&&this.recurrenceEditor?this.recurrenceEditor.setRecurrenceRule(e[this.fields.recurrenceRule],e[this.fields.startTime]):!this.parent.isAdaptive&&this.recurrenceEditor&&(this.recurrenceEditor.setProperties({startDate:e[this.fields.startTime]}),this.recurrenceEditor.setRecurrenceRule("")),this.repeatStartDate=e[this.fields.startTime],this.repeatRule="",e[this.fields.recurrenceRule]&&(this.recurrenceEditor&&this.recurrenceEditor.setRecurrenceRule(e[this.fields.recurrenceRule],e[this.fields.startTime]),this.repeatRule=e[this.fields.recurrenceRule]),this.parent.isAdaptive&&t.isNullOrUndefined(this.parent.editorTemplate)){var r=this.element.querySelector(".e-recurrence-container");e[this.fields.recurrenceRule]?(t.removeClass([r],"e-hide"),this.repeatStatus.setProperties({checked:!0})):(t.addClass([r],"e-hide"),this.repeatStatus.setProperties({checked:!1})),this.updateRepeatLabel(this.repeatRule)}var a=this.parent.readonly||e[this.fields.isReadonly];if(this.parent.isAdaptive){var s=this.element.querySelector(".e-save-icon");s&&(a?t.addClass([s],"e-icon-disable"):t.removeClass([s],"e-icon-disable"))}else{var o=this.element.querySelector(".e-event-save"),l=this.element.querySelector(".e-event-delete");this.disableButton(o,a),this.disableButton(l,a)}this.dialogObject.show()}},e.prototype.disableButton=function(e,t){e&&(e.ej2_instances[0].disabled=t)},e.prototype.renderRecurrenceEditor=function(){return new di({calendarMode:this.parent.calendarMode,cssClass:this.parent.cssClass,dateFormat:this.parent.dateFormat,enableRtl:this.parent.enableRtl,firstDayOfWeek:this.parent.activeViewOptions.firstDayOfWeek,locale:this.parent.locale})},e.prototype.updateMinMaxDateToEditor=function(){var e=this.element.querySelector(".e-start"),t=this.element.querySelector(".e-end");if(e&&t){var i=e.ej2_instances[0],n=t.ej2_instances[0];i.min=this.parent.minDate,i.max=new Date(new Date(+this.parent.maxDate).setHours(23,59,59)),n.min=this.parent.minDate,n.max=new Date(new Date(+this.parent.maxDate).setHours(23,59,59)),i.dataBind(),n.dataBind()}if(this.recurrenceEditor){var r=this.recurrenceEditor.element.querySelector(".e-until-date");if(r){var a=r.ej2_instances[0];a.min=this.parent.minDate,a.max=this.parent.maxDate,a.dataBind()}}},e.prototype.updateRepeatLabel=function(e){this.parent.isAdaptive&&!this.repeatDialogObject&&this.renderRepeatDialog();var t=e?this.l10n.getConstant("repeats")+" "+this.recurrenceEditor.getRuleSummary(e):this.l10n.getConstant("repeat");this.repeatStatus.setProperties({label:t})},e.prototype.dialogClose=function(e){if(this.isEnterKey)return void(this.isEnterKey=!1);this.dialogEvent=e,this.isCrudAction=!1,this.parent.activeEventData={event:void 0,element:void 0},this.parent.currentAction=null,this.dialogObject.hide()},e.prototype.resetForm=function(){this.fieldValidator.destroyToolTip(),this.resetFormFields(),this.parent.isAdaptive||!this.recurrenceEditor||this.recurrenceEditor.isDestroyed||this.recurrenceEditor.resetFields()},e.prototype.timezoneChangeStyle=function(e){var i=this.element.querySelector(".e-time-zone-row"),n=this.parent.tzModule.getLocalTimezoneName();if(e){t.addClass([i],"e-enable");var r=this.getInstance("e-start-time-zone"),a=this.getInstance("e-end-time-zone"),s=r.dataSource;r.value&&this.parent.timezone||s.some(function(e){return e.Value===n})||(s.push({Value:n,Text:n}),r.dataSource=s,a.dataSource=s,r.dataBind(),a.dataBind()),r.value=r.value||this.parent.timezone||n,a.value=a.value||this.parent.timezone||n,r.dataBind(),a.dataBind()}else t.removeClass([i],"e-enable")},e.prototype.resetFormFields=function(){for(var e=0,i=this.getFormElements("e-schedule-dialog");e<i.length;e++){var n=i[e],r=n.name||this.getColumnName(n);t.isNullOrUndefined(r)||""===r||this.setDefaultValueToElement(n)}},e.prototype.eventSave=function(e,t){if(this.isEnterKey)return void(this.isEnterKey=!1);var i=this.element.querySelector("."+ot);if(!i||!i.classList.contains("e-formvalidator")||i.ej2_instances[0].validate()){var n=this.getEventDataFromEditor();this.processEventValidation(n.tempData,t)||(this.eventCrudData=n.eventData,this.dialogEvent=e,this.isCrudAction=!0,this.dialogObject.hide())}},e.prototype.getEventDataFromEditor=function(){var e=t.extend({},this.getObjectFromFormData("e-schedule-dialog"));e.Timezone||(e[this.fields.startTimezone]=null,e[this.fields.endTimezone]=null),delete e.Timezone,delete e.Repeat,this.setDefaultValueToObject(e),e[this.fields.recurrenceRule]=this.recurrenceEditor?this.recurrenceEditor.getRecurrenceRule()||null:void 0;var i=t.extend({},e,null,!0);return e[this.fields.isAllDay]&&(e[this.fields.startTime]=t.isNullOrUndefined(e[this.fields.startTime])?null:b(new Date(e[this.fields.startTime].getTime())),e[this.fields.endTime]=t.isNullOrUndefined(e[this.fields.endTime])?null:O(b(new Date(e[this.fields.endTime].getTime())),1)),{eventData:e,tempData:i}},e.prototype.processEventValidation=function(e,i){var n;if(t.isNullOrUndefined(this.parent.editorTemplate)){if(!e[this.fields.startTime]||!e[this.fields.endTime])return this.parent.quickPopup.openValidationError("invalidDateError"),!0;if(e[this.fields.startTime]>e[this.fields.endTime])return this.parent.quickPopup.openValidationError("startEndError"),!0}if(this.recurrenceEditor&&this.recurrenceEditor.value&&""!==this.recurrenceEditor.value){"EditOccurrence"!==this.parent.currentAction&&(n=this.recurrenceValidation(e[this.fields.startTime],e[this.fields.endTime],i));var r=!0;if("seriesChangeAlert"===n&&this.parent.uiStateValues.isIgnoreOccurrence&&(r=!1),!t.isNullOrUndefined(n)&&r&&(!this.parent.enableRecurrenceValidation&&"wrongPattern"===n||this.parent.enableRecurrenceValidation))return this.parent.quickPopup.openRecurrenceValidationAlert(n),!0}return!1},e.prototype.processCrudActions=function(e){var i=this;this.parent.uiStateValues.isBlock=!1;var n=this.getResourceData(e),r=(this.parent.activeViewOptions.group.resources.length>0||this.parent.resourceCollection.length>0)&&!this.parent.activeViewOptions.group.allowGroupEdit&&!t.isNullOrUndefined(n),a=this.getEventIdFromForm();if(t.isNullOrUndefined(a)){if(this.parent.currentAction="Add",this.parent.eventBase.checkOverlap(e))return!0;r?this.resourceSaveEvent(e,this.parent.currentAction):(e[this.fields.id]=this.parent.eventBase.getEventMaxID(),this.parent.addEvent(e))}else{var s="string"===this.parent.eventBase.getEventIDType()?a:parseInt(a,10),o=this.parent.eventsData.filter(function(e){return e[i.fields.id]===s})[0];if(t.isNullOrUndefined(o)&&(o=this.parent.blockData.filter(function(e){return e[i.fields.id]===s})[0]),(e=t.extend({},o,e))[this.fields.isReadonly])return!1;if(this.parent.eventBase.checkOverlap(e))return!0;var l=void 0;if(!t.isNullOrUndefined(o[this.fields.recurrenceRule])){if(l=this.parent.currentAction,e.Guid=this.parent.activeEventData.event.Guid,"EditOccurrence"===this.parent.currentAction&&(e[this.fields.recurrenceID]?(s=e[this.fields.recurrenceID],l=null):(e[this.fields.id]=this.parent.eventBase.getEventMaxID(),e.Guid=this.parent.activeEventData.event.Guid),this.parent.enableRecurrenceValidation&&this.editOccurrenceValidation(s,e)))return!0;"EditSeries"===this.parent.currentAction||e[this.fields.id]!==o[this.fields.id]?e[this.fields.recurrenceID]=o[this.fields.id]:"EditFollowingEvents"===this.parent.currentAction&&(e[this.fields.id]=this.parent.eventBase.getEventMaxID(),e[this.fields.followingID]=o[this.fields.id])}r?this.resourceSaveEvent(e,"Save",l):this.parent.saveEvent(e,l)}return this.parent.uiStateValues.isBlock},e.prototype.getResourceData=function(e){var i=null;return!t.isNullOrUndefined(this.parent.resourceBase)&&!t.isNullOrUndefined(this.parent.resourceBase.resourceCollection)&&this.parent.resourceBase.resourceCollection.length>0&&(i=e[this.parent.resourceBase.resourceCollection.slice(-1)[0].field]),i},e.prototype.getObjectFromFormData=function(e){for(var i={},n=0,r=this.getFormElements(e);n<r.length;n++){var a=r[n],s=a.name||this.getColumnName(a);t.isNullOrUndefined(s)||""===s||(i[""+s]=this.getValueFromElement(a))}return i},e.prototype.setDefaultValueToObject=function(e){t.isNullOrUndefined(e[this.fields.subject])||(e[this.fields.subject]=e[this.fields.subject]||this.parent.eventSettings.fields.subject.default||this.l10n.getConstant("addTitle")),t.isNullOrUndefined(e[this.fields.location])||(e[this.fields.location]=e[this.fields.location]||this.parent.eventSettings.fields.location.default),t.isNullOrUndefined(e[this.fields.description])||(e[this.fields.description]=e[this.fields.description]||this.parent.eventSettings.fields.description.default)},e.prototype.recurrenceValidation=function(e,i,n){var r,a=this.recurrenceEditor,s=this.getInstance("e-repeat-interval.e-numerictextbox").value;if(n!==this.l10n.getConstant("ok")){var o=this.parent.activeEventData.event,l=[];if(("EditSeries"===this.parent.currentAction||"EditFollowingEvents"===this.parent.currentAction)&&!t.isNullOrUndefined(o)){var p=o[this.parent.eventFields.startTime],c=this.parent.eventBase.getSeriesEvents(this.eventData,p);if(c.length>0)l=this.parent.eventBase.getEditedOccurrences(c,p);else{var h=this.parent.eventBase.getEventById(o[this.parent.eventFields.id]);l=this.parent.eventBase.getEditedOccurrences([h],p)}"EditSeries"!==this.parent.currentAction||t.isNullOrUndefined(this.eventData[this.parent.eventFields.recurrenceException])||l.push(this.eventData)}if(l.length>0&&(r="seriesChangeAlert"),"until"===this.getInstance("e-end-on-left .e-ddl .e-dropdownlist").value&&this.getInstance("e-end-on-date .e-datepicker").value<e&&(r="wrongPattern"),t.isNullOrUndefined(r)){var d=a.value.split(";")[1].split("=")[1].split(","),u={SU:0,MO:1,TU:2,WE:3,TH:4,FR:5,SA:6},g=[],v=[],m=void 0;switch(a.value.split(";")[0].split("=")[1]){case"DAILY":(i.getTime()-e.getTime())/36e5>24*s&&(r="createError");break;case"WEEKLY":d=a.value.split(";")[1].split("=")[1].split(",");for(f=0;f<d.length*(s+1);f++)g[parseInt(f.toString(),10)]=d.length>f?u[d[parseInt(f.toString(),10)]]:g[f-d.length]+7*s;m=g.sort(function(e,t){return e-t});for(var f=1;f<m.length;f++)v.push(m[parseInt(f.toString(),10)]-m[f-1]);((i.getTime()-e.getTime())/36e5>=24*Math.min.apply(Math,v)||t.isNullOrUndefined(s))&&(r="createError");break;case"MONTHLY":i.getTime()>=new Date(+e).setMonth(e.getMonth()+s)&&(r="createError");break;case"YEARLY":i.getTime()>=new Date(+e).setFullYear(e.getFullYear()+s)&&(r="createError")}}}else i.getTime()>=new Date(+e).setMonth(e.getMonth()+s)&&(r="createError"),t.isNullOrUndefined(r)&&this.parent.quickPopup.quickDialog.hide();return t.isNullOrUndefined(s)&&(r="createError"),r},e.prototype.getRecurrenceIndex=function(e,t){for(var i,n=0;n<e.length;n++)if(t[this.fields.startTime].valueOf()===e[parseInt(n.toString(),10)][this.fields.startTime].valueOf()){i=n;break}return i},e.prototype.trimAllDay=function(e){if(e[this.fields.isAllDay]){var t=O(new Date(+e[this.fields.endTime]),-1).getTime();e[this.fields.endTime]=+e[this.fields.startTime]>t?e[this.fields.endTime]:new Date(t)}},e.prototype.editOccurrenceValidation=function(e,i,n){var r=this;void 0===n&&(n=this.eventData);var a=this.parent.getOccurrencesByID(e);this.parent.eventsData.filter(function(t){return t[r.fields.recurrenceID]===e}).map(function(e){return a.push(t.extend({},e))}),i=t.extend({},i),this.trimAllDay(i);for(var s=0,o=a;s<o.length;s++){var l=o[s];this.trimAllDay(l)}this.parent.eventBase.sortByTime(a);var p=this.getRecurrenceIndex(a,n);if(t.isNullOrUndefined(p))return!1;var c,h,d=new Date(+i[this.fields.startTime]),u=new Date(+i[this.fields.endTime]);p!==a.length-1&&(c=new Date(+a[p+1][this.fields.startTime]),h=new Date(+a[p+1][this.fields.endTime]));var g=new Date(+a[a.length-1][this.fields.endTime]);if(0===p){if(!t.isNullOrUndefined(a[p+1])){if(!(c.getTime()>=u.getTime())&&b(g).getTime()>=b(d).getTime()||b(g).getTime()<b(d).getTime())return this.parent.quickPopup.openRecurrenceValidationAlert("occurrenceAlert"),!0;if(!(b(d).getTime()<b(c).getTime()))return this.parent.quickPopup.openRecurrenceValidationAlert("sameDayAlert"),!0}return!1}var v=new Date(+a[p-1][this.fields.startTime]),m=new Date(+a[p-1][this.fields.endTime]);if(p===a.length-1){if(b(new Date(+a[a.length-1-p][this.fields.startTime])).getTime()>b(d).getTime())return this.parent.quickPopup.openRecurrenceValidationAlert("occurrenceAlert"),!0;if(!(m.getTime()<=d.getTime()&&b(d).getTime()>b(v).getTime()))return this.parent.quickPopup.openRecurrenceValidationAlert("sameDayAlert"),!0}else{if(!(b(v).getTime()<b(d).getTime()||b(new Date(+a[0][this.fields.startTime])).getTime()>b(d).getTime())||!(b(c).getTime()>b(d).getTime()||g.getTime()<d.getTime()))return this.parent.quickPopup.openRecurrenceValidationAlert("sameDayAlert"),!0;if(!(m.getTime()<=d.getTime()&&c.getTime()>=u.getTime())||b(h).getTime()<b(d).getTime()||b(v).getTime()>b(u).getTime()||!(b(d).getTime()<b(c).getTime()))return this.parent.quickPopup.openRecurrenceValidationAlert("occurrenceAlert"),!0}return!1},e.prototype.resourceSaveEvent=function(e,i,n){var r=this,a=this.parent.resourceBase.resourceCollection.slice(-1)[0],s=e[a.field];s=s instanceof Array?s.reverse():[s].reverse();for(var o=this.parent.resourceBase.lastResourceLevel,l=[],p=this,c=0;c<s.length;c++){var h=function(c){var h=t.extend({},e,null,!0);h[p.fields.id]=p.parent.eventBase.getEventMaxID();var d=[],u=function(){if("Save"===i&&c===s.length-1)if(d.length>0){d[0][r.fields.id]=e[r.fields.id];for(var t=1;t<d.length;t++)d[parseInt(t.toString(),10)][r.fields.id]=r.parent.eventBase.getEventMaxID(c),l.push(d[parseInt(t.toString(),10)]),r.parent.saveEvent(d[0],n)}else h[r.fields.id]=e[r.fields.id],r.parent.saveEvent(h,n);else if(d.length>0)for(var a=0;a<d.length;a++)d[parseInt(a.toString(),10)][r.fields.id]=r.parent.eventBase.getEventMaxID(a),l.push(d[parseInt(a.toString(),10)]);else h[r.fields.id]=r.parent.eventBase.getEventMaxID(c),l.push(h)};if(p.parent.activeViewOptions.group.byGroupID&&!t.isNullOrUndefined(o)){var g=a.dataSource,v=p.parent.resourceCollection,m=void 0;if((m=v.length>1?H(g,a.idField,s[parseInt(c.toString(),10)],h,v):H(g,a.idField,s[parseInt(c.toString(),10)]))<0)return{value:void 0};for(var f=g[parseInt(m.toString(),10)][a.groupIDField],y=o.filter(function(e){return e.resourceData[a.idField]===s[parseInt(c.toString(),10)]}).filter(function(e){return e.resourceData[a.groupIDField]===f})[0].groupOrder,T=0;T<p.parent.resourceBase.resourceCollection.length;T++){w=p.parent.resourceBase.resourceCollection[parseInt(T.toString(),10)].field;h[""+w]=y[parseInt(T.toString(),10)]instanceof Array?y[parseInt(T.toString(),10)][0]:y[parseInt(T.toString(),10)]}u()}else{for(m=0;m<p.parent.resourceBase.resourceCollection.length-1;m++){var w=p.parent.resourceBase.resourceCollection[parseInt(m.toString(),10)].field;if(h[""+w]instanceof Array&&h[""+w].length>1)for(var D=0;D<h[""+w].length;D++){var b=t.extend({},h,null,!0);b[""+w]=e[""+w][parseInt(D.toString(),10)],b[a.field]=s[parseInt(c.toString(),10)],d.push(b)}else if(0===d.length)h[""+w]=e[""+w]instanceof Array?e[""+w][0]:e[""+w],h[a.field]=s[parseInt(c.toString(),10)];else for(var C=0;C<d.length;C++)d[parseInt(C.toString(),10)][""+w]=e[""+w]instanceof Array?e[""+w][0]:e[""+w]}h[a.field]=s[parseInt(c.toString(),10)],u()}}(c);if("object"==typeof h)return h.value}if(l.length>0){for(var d=0,u=l;d<u.length;d++){var g=u[d];g[this.fields.recurrenceException]=null,g[this.fields.recurrenceID]=null}this.parent.addEvent(l)}},e.prototype.getEventIdFromForm=function(){return this.element.querySelector("."+ot).getAttribute("data-id")},e.prototype.getFormElements=function(e){return"e-schedule-dialog"===e?[].slice.call(this.element.querySelectorAll(".e-field")):[].slice.call(this.parent.element.querySelectorAll("."+e+" .e-field"))},e.prototype.getValueFromElement=function(e){return e.classList.contains("e-datepicker")?e.ej2_instances[0].value:e.classList.contains("e-datetimepicker")?e.ej2_instances[0].value:e.classList.contains("e-dropdownlist")?e.ej2_instances[0].value:e.classList.contains("e-multiselect")?e.ej2_instances[0].value:e.classList.contains("e-checkbox")?e.ej2_instances[0].checked:e.classList.contains("e-numerictextbox")?e.ej2_instances[0].value:"checkbox"===e.type?e.checked:this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(e.value):e.value},e.prototype.setValueToElement=function(e,t){if(e.classList.contains("e-datepicker"))(i=e.ej2_instances[0]).value=t,i.dataBind();else if(e.classList.contains("e-datetimepicker"))(i=e.ej2_instances[0]).element.classList.contains("e-start")?this.eventWindowTime.startTime=new Date(""+t):this.eventWindowTime.endTime=new Date(""+t),i.value=t,i.dataBind();else if(e.classList.contains("e-dropdownlist"))(i=e.ej2_instances[0]).value=t,i.dataBind();else if(e.classList.contains("e-multiselect"))(i=e.ej2_instances[0]).value=[],i.value=t instanceof Array?t:[t],i.dataBind();else if(e.classList.contains("e-checkbox"))(i=e.ej2_instances[0]).checked=t,i.dataBind();else if(e.classList.contains("e-numerictextbox")){var i=e.ej2_instances[0];i.value=t,i.dataBind()}else"checkbox"!==e.type?e.value=t||"":e.checked=t},e.prototype.setDefaultValueToElement=function(e){if(e.classList.contains("e-datepicker"))(t=e.ej2_instances[0]).value=this.parent.getCurrentTime(),t.dataBind();else if(e.classList.contains("e-datetimepicker")){var t=e.ej2_instances[0],i=this.parent.getCurrentTime();this.eventWindowTime={startTime:i,endTime:i},t.value=i,t.dataBind()}else e.classList.contains("e-dropdownlist")?((t=e.ej2_instances[0]).value=null,t.dataBind()):e.classList.contains("e-multiselect")?((t=e.ej2_instances[0]).value=[],t.dataBind()):e.classList.contains("e-checkbox")?((t=e.ej2_instances[0]).checked=!1,t.dataBind()):e.classList.contains("e-numerictextbox")?((t=e.ej2_instances[0]).value=null,t.dataBind()):"checkbox"===e.type?e.checked=!1:e.value=""},e.prototype.getInstance=function(e){var t=this.element.querySelector("."+e);return t?t.ej2_instances[0]:null},e.prototype.eventDelete=function(e){if(this.isEnterKey)return void(this.isEnterKey=!1);switch(this.parent.currentAction){case"EditOccurrence":t.isNullOrUndefined(this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule])?this.parent.currentAction="Delete":this.parent.currentAction="DeleteOccurrence";break;case"EditSeries":this.parent.currentAction="DeleteSeries";break;case"Save":this.parent.currentAction="Delete";break;case"EditFollowingEvents":t.isNullOrUndefined(this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule])||(this.parent.currentAction="DeleteFollowingEvents")}this.dialogEvent=e,this.isCrudAction=!1,this.dialogObject.hide(),this.parent.quickPopup.openDeleteAlert()},e.prototype.getRecurrenceEditorInstance=function(){return this.parent.isAdaptive&&!this.repeatDialogObject&&this.renderRepeatDialog(),this.recurrenceEditor},e.prototype.destroyComponents=function(){for(var e=0,t=this.getFormElements("e-schedule-dialog");e<t.length;e++){var i=t[e],n=void 0;i.classList.contains("e-datetimepicker")?n=i.ej2_instances:i.classList.contains("e-datepicker")?n=i.ej2_instances:i.classList.contains("e-checkbox")?n=i.ej2_instances:i.classList.contains("e-dropdownlist")?n=i.ej2_instances:i.classList.contains("e-multiselect")?n=i.ej2_instances:i.classList.contains("e-numerictextbox")&&(n=i.ej2_instances),n&&n[0]&&n[0].destroy()}this.buttonObj&&this.buttonObj.destroy()},e.prototype.detachComponents=function(){for(var e=0,i=this.getFormElements("e-schedule-dialog");e<i.length;e++){var n=i[e];t.detach(n)}},e.prototype.destroy=function(e){if(this.parent&&!this.parent.isDestroyed&&this.parent.resetTemplates(["editorTemplate","editorHeaderTemplate","editorFooterTemplate"]),this.destroyComponents(),this.recurrenceEditor&&(this.recurrenceEditor.destroy(),t.detach(this.recurrenceEditor.element),this.recurrenceEditor=null),this.fieldValidator&&(this.fieldValidator.destroy(),this.fieldValidator=null),this.repeatDialogObject&&(this.repeatDialogObject.destroy(),this.repeatDialogObject=null),this.detachComponents(),this.dialogObject){if(this.dialogObject.element){var i=this.dialogObject.element.querySelector("form");j(i),t.detach(i),t.EventHandler.remove(this.dialogObject.element,"keydown",this.preventEventSave)}this.dialogObject.destroy(),this.dialogObject=null}this.element&&(t.remove(this.element),this.element=null),e||(this.l10n=null,this.parent=null,this.fields=null,this.buttonObj=null,this.repeatStatus=null,this.eventWindowTime=null,this.dialogEvent=null)},e}(),gi=function(){function e(e){this.translateY=0,this.itemSize=60,this.renderedLength=0,this.averageRowHeight=0,this.startIndex=0,this.existingDataCollection=[],this.enableTransition=!0,this.parent=e,this.bufferCount=e.activeViewOptions.overscanCount<3?3:e.activeViewOptions.overscanCount,this.addEventListener()}return e.prototype.addEventListener=function(){!this.parent||this.parent&&this.parent.isDestroyed||this.parent.on("virtual-scroll",this.virtualScrolling,this)},e.prototype.removeEventListener=function(){!this.parent||this.parent&&this.parent.isDestroyed||this.parent.off("virtual-scroll",this.virtualScrolling)},e.prototype.getRenderedCount=function(){this.setItemSize();var e=this.isHorizontalScroll?this.parent.element.clientWidth:this.parent.element.clientHeight;return this.renderedLength=Math.ceil(e/this.itemSize)+this.bufferCount,this.renderedLength},e.prototype.renderVirtualTrack=function(e){var i=t.createElement("div",{className:"e-virtual-track"});if(this.isHorizontalScroll){var n=this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-1].length;i.style.width=n*this.itemSize+"px"}else i.style.height=this.parent.resourceBase.expandedResources.length*this.itemSize+"px";e.appendChild(i)},e.prototype.updateVirtualScrollHeight=function(){var e=this.parent.element.querySelector(".e-virtual-track"),t=this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].groupIndex;if(this.parent.resourceBase.renderedResources[this.parent.resourceBase.renderedResources.length-1].groupIndex!==t){var i=this.parent.element.querySelector("."+nt);this.renderedLength=i.querySelector("tbody").children.length,e.style.height=i.offsetHeight+(this.parent.resourceBase.expandedResources.length-this.renderedLength)*i.offsetHeight/this.renderedLength+"px";var n=this.parent.element.querySelector(".e-content-wrap");3===this.bufferCount&&n.scrollHeight-n.scrollTop<n.offsetHeight*this.bufferCount&&(e.style.height=parseInt(e.style.height,10)+n.offsetHeight*this.bufferCount+"px")}else e.style.height="";this.averageRowHeight=e.offsetHeight/this.parent.resourceBase.expandedResources.length},e.prototype.updateVirtualTrackHeight=function(e){var t=this.parent.resourceBase.renderedResources.length;if(t!==this.getRenderedCount()){e.style.height=this.parent.element.querySelector(".e-content-wrap").clientHeight+"px";var i=this.parent.element.querySelector(".e-resource-column-wrap"),n=this.parent.element.querySelector(".e-content-wrap"),r=this.parent.element.querySelector(".e-event-table");this.translateY=0,this.setTranslate(i,n,r)}else{var a=this.parent.resourceBase.renderedResources[t-1].groupIndex,s=t+(this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].groupIndex-a);s=s>this.parent.resourceBase.expandedResources.length?this.parent.resourceBase.expandedResources.length:s,e.style.height=s*this.itemSize+"px"}},e.prototype.setItemSize=function(){if(this.isHorizontalScroll)if(this.parent.group.byDate){var e=this.parent.element.querySelector(".e-date-header-wrap table col");this.itemSize=e?B(e,this.parent.uiStateValues.isTransformed):this.itemSize}else this.itemSize=d(this.parent.activeView.element,"e-work-cells",this.parent.uiStateValues.isTransformed)||this.itemSize;else this.itemSize=this.parent.getElementHeightFromClass(this.parent.activeView.element,"e-work-cells")||this.itemSize},e.prototype.refreshLayout=function(){var e=this.parent.uiStateValues.scheduleHeight;this.parent.uiStateValues.scheduleHeight=this.parent.element.offsetHeight;var i=this.renderedLength;if(this.parent.uiStateValues.scheduleHeight!==e){i<this.getRenderedCount()&&(this.isRemoteRefresh=!0);var n=this.parent.element.querySelector(".e-resource-column-wrap"),r=this.parent.element.querySelector(".e-content-wrap"),a=this.parent.element.querySelector(".e-event-table");this.parent.rowAutoHeight||(this.enableTransition=!1,t.removeClass([r,n],"e-transition"));var s=parseInt(n.querySelector("tbody td").getAttribute("data-group-index"),10),o=s+this.renderedLength;s=(s=o>this.parent.resourceBase.expandedResources.length?this.parent.resourceBase.expandedResources.length-this.renderedLength:s)<0?0:s,this.existingDataCollection=this.parent.resourceBase.renderedResources,this.parent.resourceBase.renderedResources=this.parent.resourceBase.expandedResources.slice(s,o),this.parent.resourceBase.renderedResources.length>0&&this.updateContent(n,r,a,this.parent.resourceBase.renderedResources)}},e.prototype.renderEvents=function(){this.setTabIndex();var e=this.triggerScrollEvent("virtualScrollStop");if(this.parent.activeViewOptions&&this.parent.activeViewOptions.enableLazyLoading&&this.parent.crudModule)return e.length>0?(this.parent.crudModule.refreshProcessedData(!0,e),void this.parent.hideSpinner()):void this.parent.crudModule.refreshDataManager();this.parent.crudModule&&this.parent.crudModule.refreshProcessedData(!0),"Month"!==this.parent.currentView&&this.parent.notify(Ge,{}),this.parent.hideSpinner()},e.prototype.virtualScrolling=function(){var e=this;this.parent.quickPopup&&(this.parent.quickPopup.quickPopupHide(),this.parent.quickPopup.morePopup.hide());var i=this.parent.element.querySelector(".e-content-wrap");if(this.isHorizontalScroll)this.horizontalScrolling(i);else{var n=this.parent.element.querySelector(".e-resource-column-wrap"),r=this.parent.element.querySelector(".e-event-table"),a=this.parent.element.querySelector(".e-current-timeline"),s=this.parent.element.querySelector("."+nt);this.parent.rowAutoHeight||t.addClass([i,n],"e-transition"),this.renderedLength=n.querySelector("tbody").children.length;var o=parseInt(n.querySelector("tbody td").getAttribute("data-group-index"),10),l=this.parent.rowAutoHeight?s.offsetHeight-i.offsetHeight:this.bufferCount*this.itemSize,p=[];if(this.existingDataCollection=this.parent.resourceBase.renderedResources,i.scrollTop-this.translateY<0?p=this.upScroll(i,o):(i.scrollTop+i.clientHeight>=i.scrollHeight-this.itemSize||i.scrollTop>this.translateY+l)&&(p=this.downScroll(i,o)),!t.isNullOrUndefined(p)&&p.length>0){this.triggerScrollEvent("virtualScrollStart");var c=this.parent.getSelectedCells();this.focusedEle=c[c.length-1]||this.focusedEle,this.updateContent(n,i,r,p),this.setTranslate(n,i,r,a),this.parent.dragAndDropModule&&"drag"===this.parent.dragAndDropModule.actionObj.action&&this.parent.dragAndDropModule.navigationWrapper(),window.clearTimeout(this.timeValue),this.timeValue=window.setTimeout(function(){e.renderEvents()},250)}}},e.prototype.horizontalScrolling=function(e){var i=this,n=[],r=this.bufferCount*this.itemSize;if(Math.abs(e.scrollLeft)-Math.abs(this.translateY)<0?n=this.leftScroll(e):Math.abs(e.scrollLeft)-Math.abs(this.translateY)>r&&(n=this.rightScroll(e)),!t.isNullOrUndefined(n)&&n.length>0){if(this.parent.resourceBase.expandedResources.length!==n.length||this.parent.resourceBase.expandedResources[0]!==n[0]||this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1]!==n[n.length-1]){this.triggerScrollEvent("virtualScrollStart");var a=this.parent.activeView.colLevels.slice(0);this.updateHorizontalContent(e,n),t.setStyleAttribute(e.querySelector("table"),{transform:"translateX("+this.translateY+"px)"}),this.parent.activeView.colLevels=a,this.parent.dragAndDropModule&&"drag"===this.parent.dragAndDropModule.actionObj.action&&this.parent.dragAndDropModule.navigationWrapper()}window.clearTimeout(this.timeValue),this.timeValue=window.setTimeout(function(){i.renderEvents()},250)}},e.prototype.triggerScrollEvent=function(e){var i=this,n=[];if(!this.parent.activeView)return n;var r={startDate:this.parent.activeView.startDate(),endDate:this.parent.activeView.endDate(),startIndex:this.parent.resourceBase.renderedResources[0].groupIndex,endIndex:this.parent.resourceBase.renderedResources[this.parent.resourceBase.renderedResources.length-1].groupIndex,resourceData:this.parent.resourceBase.renderedResources.map(function(e){return e.resourceData}),name:e};return this.parent.trigger(e,r,function(r){"virtualScrollStart"===e?i.parent.showSpinner():"virtualScrollStop"===e&&!t.isNullOrUndefined(r.eventData)&&r.eventData.length>0&&(n=r.eventData)}),n},e.prototype.upScroll=function(e,t){var i=0;i=~~(e.scrollTop/this.itemSize)+Math.ceil(e.clientHeight/this.itemSize)-this.renderedLength,this.parent.rowAutoHeight&&(i=i>t?t-this.bufferCount:i),i=i>0?i:0;var n=this.getBufferCollection(i,i+this.renderedLength);if(this.parent.resourceBase.renderedResources=n,0===t)this.translateY=e.scrollTop;else{var r=this.parent.rowAutoHeight?this.averageRowHeight:this.itemSize;r=r>0?r:this.itemSize,this.translateY=e.scrollTop-this.bufferCount*r>0?e.scrollTop-this.bufferCount*r:0,this.parent.rowAutoHeight&&0===this.translateY&&0!==i&&(n=this.getBufferCollection(0,this.renderedLength),this.parent.resourceBase.renderedResources=n)}return n},e.prototype.downScroll=function(e,t){if(this.parent.resourceBase.renderedResources[this.parent.resourceBase.renderedResources.length-1].groupIndex===this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].groupIndex)return null;var i=0;i=~~(e.scrollTop/this.itemSize),this.parent.rowAutoHeight&&(i=(i=~~((e.scrollTop-this.translateY)/this.averageRowHeight)+t)>t+this.bufferCount?i:t+this.bufferCount);var n=i+this.renderedLength;n=n>this.parent.resourceBase.expandedResources.length?i+(this.parent.resourceBase.expandedResources.length-i):n;var r=this.getBufferCollection(n-this.renderedLength,n);return this.translateY=e.scrollTop,r},e.prototype.leftScroll=function(e){var t=0;return t=~~(Math.abs(e.scrollLeft)/this.itemSize)+Math.ceil(e.clientWidth/this.itemSize)-this.renderedLength,t=t>0?t:0,this.getCollection(t,t+this.renderedLength)},e.prototype.rightScroll=function(e){var t=this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-1],i=0,n=(i=~~(Math.abs(e.scrollLeft)/this.itemSize))+this.renderedLength;return n=n>t.length-1?t.length-1:n,this.getCollection(n-this.renderedLength,n)},e.prototype.getCollection=function(e,t){this.translateY=e*this.itemSize,e=e<0?0:e;var i=this.getResCollection(e,t);return this.parent.enableRtl&&(this.translateY=-this.translateY),i},e.prototype.getResCollection=function(e,t){var i=this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-1];t=t>i.length?i.length-1:t;var n=[],r={startIndex:0,endIndex:0};if(this.parent.activeViewOptions.group.byDate){if(i[parseInt(e.toString(),10)].date.getTime()===this.parent.resourceBase.expandedResources[0].date.getTime()&&i[parseInt(t.toString(),10)].date.getTime()===this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].date.getTime())return this.parent.resourceBase.expandedResources;n=this.getByDateCollection(i[parseInt(e.toString(),10)],i[parseInt(t.toString(),10)],r),this.setRenderedDates(n)}else{if(i[parseInt(e.toString(),10)].groupIndex===this.parent.resourceBase.expandedResources[0].groupIndex&&i[parseInt(t.toString(),10)].groupIndex===this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].groupIndex)return this.parent.resourceBase.expandedResources;n=this.getByIdCollection(i[parseInt(e.toString(),10)],i[parseInt(t.toString(),10)],r)}return"Month"!==this.parent.currentView&&(this.startIndex=r.startIndex,n=i.slice(r.startIndex,r.endIndex)),this.translateY=r.startIndex*this.itemSize,n},e.prototype.getByDateCollection=function(e,t,i){var n=this.parent.activeView.colLevels[0].filter(function(i){return e.date.getTime()<=i.date.getTime()&&i.date.getTime()<=t.date.getTime()});return this.setStartEndIndex(this.parent.activeView.colLevels[0],n[0],n[n.length-1],i),n},e.prototype.getByIdCollection=function(e,t,i){var n=this.parent.resourceBase.lastResourceLevel.filter(function(i){return e.groupIndex<=i.groupIndex&&i.groupIndex<=t.groupIndex});return this.parent.resourceBase.renderedResources=n,this.setStartEndIndex(this.parent.resourceBase.lastResourceLevel,n[0],n[n.length-1],i),n},e.prototype.setStartEndIndex=function(e,t,i,n){var r=0;e.filter(function(e){t===e?n.startIndex=r:i===e&&(n.endIndex=r+e.colSpan),r+=e.colSpan}),t===i&&(n.endIndex=n.startIndex+i.colSpan)},e.prototype.updateContent=function(e,i,n,r){var a=e.querySelector("tbody").children.length;document.activeElement&&document.activeElement.classList.contains("e-resource-cells")&&(this.isResourceCell=!0,this.parent.element.focus());for(m=0;m<a;m++)t.remove(n.querySelector("div"));this.parent.resourceBase.renderedResources=r;var s=this.parent.activeView.getGroupIndices(r),o=this.parent.activeView.getGroupIndices(this.existingDataCollection),l=s.filter(function(e){return o.indexOf(e)<0}),p=Array.from(e.querySelectorAll("tbody tr")),c=Array.from(i.querySelectorAll("tbody tr")),h=e.querySelector("tbody"),d=i.querySelector("tbody");this.removeObsoleteRows(p,s),this.removeObsoleteRows(c,s);var u=this.parent.resourceBase.getContentRows(r,!0);this.parent.isReact&&this.parent.renderTemplates();for(var g=this.parent.activeView.getContentRows(),v=this.parent.activeView.getEventRows(r.length),m=0;m<l.length;m++){var f=s.indexOf(l[parseInt(m.toString(),10)]);0===f?(t.prepend([u[parseInt(m.toString(),10)]],h),t.prepend([g[parseInt(m.toString(),10)]],d)):h&&d&&h.children[parseInt(f.toString(),10)]&&d.children[parseInt(f.toString(),10)]?(h.insertBefore(u[parseInt(m.toString(),10)],h.children[parseInt(f.toString(),10)]),d.insertBefore(g[parseInt(m.toString(),10)],d.children[parseInt(f.toString(),10)])):(t.append([u[parseInt(m.toString(),10)]],h),t.append([g[parseInt(m.toString(),10)]],d))}t.append(v,n)},e.prototype.removeObsoleteRows=function(e,i){e.forEach(function(e){var n=parseInt(e.firstElementChild.getAttribute("data-group-index"),10);i.indexOf(n)<0&&t.remove(e)})},e.prototype.updateHorizontalContent=function(e,t){this.existingDataCollection=this.parent.resourceBase.expandedResources,this.parent.resourceBase.expandedResources=t;var i=this.parent.getSelectedCells();this.focusedEle=i[i.length-1]||this.focusedEle;var n=e.querySelector("tbody"),r=Array.from(n.querySelectorAll("tr"));"Month"===this.parent.currentView?this.updateMonthViewContent(e,t):this.updateOtherViewContent(e,t,r)},e.prototype.updateMonthViewContent=function(e,i){for(var n=e.querySelectorAll(" tr").length,r=0;r<n;r++)t.remove(e.querySelector("tbody tr"));this.parent.activeViewOptions.group.byDate?this.parent.activeView.colLevels[0]=i:this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-2]=i;var a=this.parent.activeView.getContentRows();t.append(a,e.querySelector("tbody"))},e.prototype.updateOtherViewContent=function(e,i,n){var r=this,a=e.querySelector("tbody"),s=e.querySelector("colgroup"),o=e.querySelector("thead"),l=e.querySelector("table");this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-1]=i;var p=this.parent.activeViewOptions.group.byDate?new Set(i.map(function(e){return e.date.getTime()})):new Set(i.map(function(e){return e.groupIndex}));n.forEach(function(e){Array.from(e.querySelectorAll("td")).forEach(function(e){p.has(r.getIdentifier(e))||e.remove()})});for(var c=[].slice.call(e.querySelector("colgroup").children),h=0;h<c.length;h++)t.remove(c[parseInt(h.toString(),10)]);i.forEach(function(){return s.appendChild(t.createElement("col"))});for(var d=[].slice.call(e.querySelector("thead").children),h=0;h<d.length;h++)t.remove(d[parseInt(h.toString(),10)]);o.appendChild(this.parent.eventBase.createEventWrapper("",this.startIndex>0?this.startIndex:0)),this.parent.activeViewOptions.timeScale.enable&&o.appendChild(this.parent.eventBase.createEventWrapper("timeIndicator")),t.prepend([o],l);var u=this.parent.activeView.getContentRows();this.mergeNewTdData(a,u)},e.prototype.getIdentifier=function(e){return this.parent.activeViewOptions.group.byDate?b(new Date(parseInt(e.getAttribute("data-date"),10))).getTime():parseInt(e.getAttribute("data-group-index"),10)},e.prototype.mergeNewTdData=function(e,t){var i=this;Array.from(e.querySelectorAll("tr")).forEach(function(e,n){if(n<t.length){var r=t[parseInt(n.toString(),10)],a=Array.from(e.querySelectorAll("td"));Array.from(r.querySelectorAll("td")).forEach(function(t){for(var n=!1,r=0,s=a;r<s.length;r++){var o=s[r];if(i.getIdentifier(t)<i.getIdentifier(o)){e.insertBefore(t,o),n=!0;break}}n||e.appendChild(t)})}})},e.prototype.getBufferCollection=function(e,t){return this.parent.resourceBase.expandedResources.slice(e,t)},e.prototype.setTranslate=function(e,i,n,r){t.setStyleAttribute(e.querySelector("table"),{transform:"translateY("+this.translateY+"px)"}),t.setStyleAttribute(i.querySelector("table"),{transform:"translateY("+this.translateY+"px)"}),t.setStyleAttribute(n,{transform:"translateY("+this.translateY+"px)"}),t.isNullOrUndefined(r)||t.setStyleAttribute(r,{transform:"translateY("+this.translateY+"px)"})},e.prototype.updateFocusedWorkCell=function(){if(this.focusedEle){var e=parseInt(this.focusedEle.getAttribute("data-date"),10),t=parseInt(this.focusedEle.getAttribute("data-group-index"),10),i=this.parent.element.querySelector('.e-work-cells[data-date="'+e+'"][data-group-index="'+t+'"]');i&&this.parent.addSelectedClass([i],i,!0),this.focusedEle=null}},e.prototype.setRenderedDates=function(e){if("Month"!==this.parent.currentView){var t=e.map(function(e){return e.date});this.parent.resourceBase.renderedResources.forEach(function(e){return e.renderDates=t})}else{var i=e.map(function(e){return e.date.getDay()}),n=this.parent.activeView.renderDates.filter(function(e){return i.indexOf(e.getDay())>=0});this.parent.resourceBase.renderedResources.forEach(function(e){return e.renderDates=n})}},e.prototype.setTabIndex=function(){var e=this.parent.element.querySelector(".e-resource-column-wrap"),t=[].slice.call(this.parent.element.querySelectorAll(".e-resource-cells"));t&&e&&t.forEach(function(t){t.getBoundingClientRect().top>=e.getBoundingClientRect().top&&t.setAttribute("tabindex","0")});var i=this.parent.element.querySelector('.e-resource-cells[tabindex="0"]');this.isResourceCell&&i&&(i.focus(),this.isResourceCell=!1)},e.prototype.destroy=function(){this.removeEventListener(),this.focusedEle=null},e}(),vi=function(){function e(e){this.parent=e}return e.prototype.render=function(e,t){void 0===t&&(t=!0),this.initializeLayout(e),this.parent.activeView&&t&&this.parent.crudModule.refreshDataManager()},e.prototype.initializeLayout=function(e){if(this.parent.activeView){var i=["cellTemplate","tooltipTemplate","majorSlotTemplate","minorSlotTemplate","headerTooltipTemplate","dateHeaderTemplate","dayHeaderTemplate","monthHeaderTemplate","headerIndentTemplate","resourceHeaderTemplate","cellHeaderTemplate","dateRangeTemplate"];this.parent.activeEventTemplates.length>0?(i=i.concat(this.parent.activeEventTemplates),this.parent.activeEventTemplates=[]):i.push("eventTemplate"),this.parent.resetTemplates(i),this.parent.activeView.removeEventListener(),this.parent.activeView.destroy()}switch(e){case"Day":this.parent.activeView=this.parent.dayModule;break;case"Week":this.parent.activeView=this.parent.weekModule;break;case"WorkWeek":this.parent.activeView=this.parent.workWeekModule;break;case"Month":this.parent.activeView=this.parent.monthModule;break;case"Year":this.parent.activeView=this.parent.yearModule;break;case"Agenda":this.parent.activeView=this.parent.agendaModule;break;case"MonthAgenda":this.parent.activeView=this.parent.monthAgendaModule;break;case"TimelineDay":this.parent.activeView=this.parent.timelineViewsModule,t.isNullOrUndefined(this.parent.activeView)||(this.parent.activeView.viewClass="e-timeline-day-view");break;case"TimelineWorkWeek":this.parent.activeView=this.parent.timelineViewsModule,t.isNullOrUndefined(this.parent.activeView)||(this.parent.activeView.viewClass="e-timeline-work-week-view");break;case"TimelineWeek":this.parent.activeView=this.parent.timelineViewsModule,t.isNullOrUndefined(this.parent.activeView)||(this.parent.activeView.viewClass="e-timeline-week-view");break;case"TimelineMonth":this.parent.activeView=this.parent.timelineMonthModule;break;case"TimelineYear":this.parent.activeView=this.parent.timelineYearModule}if(t.isNullOrUndefined(this.parent.activeView)){var n=this.parent.viewCollections[0].option;if(n)return this.parent.setProperties({currentView:n},!0),this.parent.headerModule&&(this.parent.headerModule.updateActiveView(),this.parent.headerModule.setCalendarView()),console.warn('[WARNING] :: Module "'+e+'" is not available in Schedule component! You either misspelled the module name or forgot to load it.'),this.initializeLayout(n);throw Error("Inject required modules")}this.parent.uiStateValues.scheduleHeight=this.parent.element.offsetHeight,this.parent.activeView.viewIndex=this.parent.viewIndex,this.updateLabelText(e),this.parent.activeView.addEventListener(),this.parent.activeView.getRenderDates(),this.parent.uiStateValues.isGroupAdaptive=this.parent.activeViewOptions.group.resources.length>0&&(this.parent.enableAdaptiveUI&&!this.parent.isAdaptive||this.parent.isAdaptive&&this.parent.activeViewOptions.group.enableCompactView),this.parent.virtualScrollModule&&(this.parent.virtualScrollModule.destroy(),this.parent.virtualScrollModule=null),(-1===["Agenda","MonthAgenda","Year","TimelineYear"].indexOf(this.parent.currentView)||"TimelineYear"===this.parent.currentView&&"Vertical"===this.parent.activeViewOptions.orientation)&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(this.parent.virtualScrollModule=new gi(this.parent),this.parent.activeView.isTimelineView()?this.parent.uiStateValues.top=0:(this.parent.virtualScrollModule.isHorizontalScroll=!0,this.parent.uiStateValues.left=0)),this.updateHeader(),this.parent.currentTimezoneDate=this.parent.getCurrentTime(),this.parent.activeView.renderLayout("e-current-panel"),this.parent.renderTemplates(),this.parent.eventTooltip&&(this.parent.eventTooltip.destroy(),this.parent.eventTooltip=null),(this.parent.eventSettings.enableTooltip||this.parent.activeViewOptions.group.resources.length>0&&this.parent.activeViewOptions.group.headerTooltipTemplate)&&(this.parent.eventTooltip=new Xt(this.parent))},e.prototype.updateHeader=function(){this.parent.headerModule&&(this.parent.headerModule.setDayOfWeek(this.parent.activeViewOptions.firstDayOfWeek),this.parent.activeViewOptions.readonly?t.addClass([this.parent.element],"e-read-only"):this.parent.element.classList.contains("e-read-only")&&t.removeClass([this.parent.element],"e-read-only"),this.parent.headerModule.updateDateRange(),this.parent.headerModule.updateHeaderItems("remove"))},e.prototype.updateLabelText=function(e){this.parent.element.setAttribute("role","application"),this.parent.element.removeAttribute("aria-labelledby"),this.parent.element.removeAttribute("aria-label"),"Year"===e?this.parent.element.setAttribute("aria-label",this.parent.activeView.getLabelText(e)):this.parent.element.setAttribute("aria-labelledby",this.parent.element.id+"_table")},e}(),mi=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),fi=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},yi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return mi(i,e),fi([t.Property(!0)],i.prototype,"highlight",void 0),fi([t.Property("09:00")],i.prototype,"start",void 0),fi([t.Property("18:00")],i.prototype,"end",void 0),i}(t.ChildProperty),Ti=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),wi=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},Di=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ti(i,e),wi([t.Property(!0)],i.prototype,"enable",void 0),wi([t.Property(60)],i.prototype,"interval",void 0),wi([t.Property(2)],i.prototype,"slotCount",void 0),wi([t.Property()],i.prototype,"minorSlotTemplate",void 0),wi([t.Property()],i.prototype,"majorSlotTemplate",void 0),i}(t.ChildProperty),bi=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ci=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},Si=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return bi(i,e),Ci([t.Property("Both")],i.prototype,"templateType",void 0),Ci([t.Property()],i.prototype,"header",void 0),Ci([t.Property()],i.prototype,"content",void 0),Ci([t.Property()],i.prototype,"footer",void 0),i}(t.ChildProperty),Oi=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ei=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},xi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Oi(i,e),Ei([t.Property()],i.prototype,"option",void 0),Ei([t.Property()],i.prototype,"template",void 0),i}(t.ChildProperty),Vi=function(){function e(e){this.parent=e,this.crudObj={sourceEvent:null,targetEvent:null,isCrudAction:!1}}return e.prototype.getQuery=function(){var e=this.parent.activeView.startDate(),t=this.parent.activeView.endDate();return this.parent.dataModule.generateQuery(e,t)},e.prototype.getTable=function(){return this.parent.eventSettings.query?this.parent.eventSettings.query.clone().fromTable:null},e.prototype.refreshDataManager=function(){var e=this;if(this.parent.activeView){if(this.parent.uiStateValues&&this.parent.uiStateValues.isPreventEventRefresh)return this.parent.uiStateValues.isPreventEventRefresh=!1,this.parent.refreshEvents(!1),void this.parent.hideSpinner();var t=this.parent.activeView.startDate(),i=this.parent.activeView.endDate();this.parent.dataModule.getData(this.parent.dataModule.generateQuery(t,i)).then(function(t){return e.dataManagerSuccess(t)}).catch(function(t){return e.dataManagerFailure(t)})}},e.prototype.dataManagerSuccess=function(e){var i=this;!this.parent||this.parent&&this.parent.isDestroyed||this.parent.trigger("dataBinding",e,function(e){if(!e.cancel){var n=t.extend([],e.result,null,!0);i.parent.eventsData=n.filter(function(e){return!e[i.parent.eventFields.isBlock]}),i.parent.blockData=n.filter(function(e){return e[i.parent.eventFields.isBlock]}),i.refreshProcessedData(),i.parent.dragAndDropModule&&"drag"===i.parent.dragAndDropModule.actionObj.action&&i.parent.dragAndDropModule.navigationWrapper(),i.parent.trigger("dataBound",null,function(){i.parent.hideSpinner(),i.parent.isPrinting&&setTimeout(function(){i.parent.notify("print",{})},100)})}})},e.prototype.dataManagerFailure=function(e){var t=this;!this.parent||this.parent&&this.parent.isDestroyed||this.parent.trigger("actionFailure",{error:e},function(){return t.parent.hideSpinner()})},e.prototype.refreshProcessedData=function(e,i){if(void 0===e&&(e=!1),this.parent.dragAndDropModule&&(this.parent.dragAndDropModule.actionObj.action="",t.removeClass([this.parent.element],"e-event-action")),this.parent.activeViewOptions&&this.parent.activeViewOptions.eventTemplate){var n=["eventTemplate"];if(this.crudObj.isCrudAction&&-1===["Agenda","MonthAgenda","Year","TimelineYear"].indexOf(this.parent.currentView)){n=[];for(var r=0,a=this.crudObj.sourceEvent.length;r<a;r++)n.push("eventTemplate_"+this.crudObj.sourceEvent[parseInt(r.toString(),10)].groupIndex),this.crudObj.targetEvent[parseInt(r.toString(),10)]&&this.crudObj.sourceEvent[parseInt(r.toString(),10)].groupIndex!==this.crudObj.targetEvent[parseInt(r.toString(),10)].groupIndex&&n.push("eventTemplate_"+this.crudObj.targetEvent[parseInt(r.toString(),10)].groupIndex)}n.length>0&&this.parent.resetTemplates(n)}if(e)return void this.parent.notify(_e,{processedData:i?this.parent.eventBase.processData(i):this.parent.eventsProcessed});var s=this.parent.eventsData||[],o=this.parent.blockData||[],l=s.concat(o);this.parent.notify(_e,{processedData:this.parent.eventBase?this.parent.eventBase.processData(l):[]})},e.prototype.refreshData=function(e){var i=this,n={requestType:e.requestType,cancel:!1,data:e.data,addedRecords:e.editParams.addedRecords,changedRecords:e.editParams.changedRecords,deletedRecords:e.editParams.deletedRecords};if(this.parent.dragAndDropModule&&this.parent.dragAndDropModule.actionObj&&this.parent.dragAndDropModule.actionObj.element&&this.parent.dragAndDropModule.actionObj.action&&(this.parent.dragAndDropModule.actionObj.element.style.display="none"),this.parent.resizeModule&&this.parent.resizeModule.actionObj&&this.parent.resizeModule.actionObj.element&&this.parent.resizeModule.actionObj.action&&(this.parent.resizeModule.actionObj.element.style.display="none"),this.parent.isSpecificResourceEvents()&&("eventCreated"===e.requestType||"eventRemoved"===e.requestType)){this.crudObj.isCrudAction=!0,this.crudObj.sourceEvent=[];for(var r=this,a=0,s=e.data instanceof Array?0===e.data.length&&"eventRemoved"===e.requestType?e.editParams.deletedRecords:e.data:"string"!=typeof e.data&&"number"!=typeof e.data||"eventRemoved"!==e.requestType?[e.data]:e.editParams.deletedRecords;a<s.length;a++)!function(i){r.crudObj.isCrudAction=!("eventRemoved"===e.requestType&&!t.isNullOrUndefined(i.parent));var n=r.parent.eventBase.getGroupIndexFromEvent(i);n>-1&&0===r.parent.crudModule.crudObj.sourceEvent.filter(function(e){return e.groupIndex===n}).length&&r.crudObj.isCrudAction&&r.crudObj.sourceEvent.push(r.parent.resourceBase.lastResourceLevel[parseInt(n.toString(),10)])}(s[a]);this.crudObj.targetEvent=this.crudObj.sourceEvent}this.parent.dataModule.dataManager.dataSource.offline?this.parent.trigger("actionComplete",n,function(e){e.cancel||i.refreshDataManager()}):e.promise.then(function(){!i.parent||i.parent&&i.parent.isDestroyed||i.parent.trigger("actionComplete",n,function(e){e.cancel||i.refreshDataManager()})}).catch(function(e){!i.parent||i.parent&&i.parent.isDestroyed||i.parent.trigger("actionFailure",{error:e})})},e.prototype.processAddEvent=function(e){var i,n=this.parent.eventFields,r={addedRecords:[],changedRecords:[],deletedRecords:[]};if(e.addedRecords instanceof Array){for(var a=0,s=e.addedRecords;a<s.length;a++){var o=s[a];o=this.parent.eventBase.updateEventDateTime(o);var l=t.extend({},this.parent.eventBase.processTimezone(o,!0),null,!0);r.addedRecords.push(l)}i=this.parent.dataModule.dataManager.saveChanges(r,n.id,this.getTable(),this.getQuery())}else{var p=this.parent.eventBase.processTimezone(e.addedRecords,!0);r.addedRecords.push(p),i=this.parent.dataModule.dataManager.insert(p,this.getTable(),this.getQuery())}var c={requestType:"eventCreated",cancel:!1,data:e.addedRecords,promise:i,editParams:r};this.refreshData(c)},e.prototype.processSaveEvent=function(e){var i,n=this.parent.eventFields,r={addedRecords:[],changedRecords:[],deletedRecords:[]};if(e.changedRecords instanceof Array){for(var a=0,s=e.changedRecords;a<s.length;a++){var o=s[a];o=this.parent.eventBase.updateEventDateTime(o);var l=t.extend({},this.parent.eventBase.processTimezone(o,!0),null,!0);r.changedRecords.push(l)}i=this.parent.dataModule.dataManager.saveChanges(r,n.id,this.getTable(),this.getQuery())}else{var p=this.parent.eventBase.processTimezone(e.changedRecords,!0);r.changedRecords.push(p),i=this.parent.dataModule.dataManager.update(n.id,p,this.getTable(),this.getQuery())}var c=t.extend({},e.changedRecords[e.changedRecords.length-1],null,!0);this.parent.eventBase.selectWorkCellByTime([this.parent.eventBase.processTimezone(c)]);var h={requestType:"eventChanged",cancel:!1,data:e.changedRecords,promise:i,editParams:r};this.refreshData(h)},e.prototype.processDeleteEvent=function(e){var t,i=this.parent.eventFields,n={addedRecords:[],changedRecords:[],deletedRecords:[]};e.deletedRecords.length>1?(n.deletedRecords=n.deletedRecords.concat(e.deletedRecords),t=this.parent.dataModule.dataManager.saveChanges(n,i.id,this.getTable(),this.getQuery())):(n.deletedRecords.push(e.deletedRecords[0]),t=this.parent.dataModule.dataManager.remove(i.id,e.deletedRecords[0],this.getTable(),this.getQuery())),this.parent.eventBase.selectWorkCellByTime(e.deletedRecords);var r={requestType:"eventRemoved",cancel:!1,data:e.deletedRecords,promise:t,editParams:n};this.refreshData(r)},e.prototype.addEvent=function(e){var t=this;if(this.parent.eventSettings.allowAdding&&!this.parent.activeViewOptions.readonly){if(!this.isBlockEvent(e)&&this.parent.eventBase.isBlockRange(e))return void this.parent.quickPopup.openValidationError("blockAlert",e);if(this.parent.eventBase.checkOverlap(e))return;var i=e instanceof Array?e:[e];if(0===i.length)return;var n={requestType:"eventCreate",cancel:!1,data:i,addedRecords:i,changedRecords:[],deletedRecords:[]};this.parent.trigger(We,n,function(e){e.cancel||(e.promise?e.promise.then(function(i){!t.parent||t.parent&&t.parent.isDestroyed||i&&t.processAddEvent(e)}).catch(function(e){!t.parent||t.parent&&t.parent.isDestroyed||t.parent.trigger("actionFailure",{error:e})}):t.processAddEvent(e))})}},e.prototype.saveEvent=function(e,t){var i=this;if(this.parent.eventSettings.allowEditing&&!this.parent.activeViewOptions.readonly){if("EditFollowingEvents"!==this.parent.currentAction&&!this.isBlockEvent(e)&&this.parent.eventBase.isBlockRange(e))return this.parent.quickPopup.openValidationError("blockAlert",e),void(this.parent.crudModule.crudObj.isCrudAction=!1);var n=e instanceof Array?e:[e];if(0===n.length)return;if(this.parent.currentAction=t,t)switch(t){case"Save":this.processSave(e);break;case"EditOccurrence":this.processOccurrences(e,t);break;case"EditFollowingEvents":this.processFollowSeries(e,t);break;case"EditSeries":this.processEntireSeries(e,t)}else{if(this.parent.eventBase.checkOverlap(e))return;var r={requestType:"eventChange",cancel:!1,data:e,addedRecords:[],changedRecords:n,deletedRecords:[]};this.parent.trigger(We,r,function(e){e.cancel||(e.promise?e.promise.then(function(t){!i.parent||i.parent&&i.parent.isDestroyed||t&&i.processSaveEvent(e)}).catch(function(e){!i.parent||i.parent&&i.parent.isDestroyed||i.parent.trigger("actionFailure",{error:e})}):i.processSaveEvent(e))})}}},e.prototype.deleteEvent=function(e,t){var i=this;if(this.parent.eventSettings.allowDeleting&&!this.parent.activeViewOptions.readonly){this.parent.currentAction=t;var n=[];if(0===(n="string"==typeof e||"number"==typeof e?this.parent.eventsData.filter(function(t){return t[i.parent.eventFields.id]===e}):e instanceof Array?e:[e]).length)return;if(t)switch(t){case"Delete":this.processDelete(n);break;case"DeleteOccurrence":this.processOccurrences(n,t);break;case"DeleteFollowingEvents":this.processFollowSeries(n,t);break;case"DeleteSeries":this.processEntireSeries(n,t)}else{var r={requestType:"eventRemove",cancel:!1,data:e,addedRecords:[],changedRecords:[],deletedRecords:n};this.parent.trigger(We,r,function(e){e.cancel||(e.promise?e.promise.then(function(t){!i.parent||i.parent&&i.parent.isDestroyed||t&&i.processDeleteEvent(e)}).catch(function(e){!i.parent||i.parent&&i.parent.isDestroyed||i.parent.trigger("actionFailure",{error:e})}):i.processDeleteEvent(e))})}}},e.prototype.processOccurrences=function(e,i){var n=this,r=[],a=!1;if(e instanceof Array)for(var s=0,o=e;s<o.length;s++){var l=o[s];r.push({occurrence:l,parent:this.getParentEvent(l)})}else r={occurrence:e,parent:this.getParentEvent(e)};var p=e instanceof Array?e:[e],c={requestType:"EditOccurrence"===i?"eventChange":"eventRemove",cancel:!1,addedRecords:[],changedRecords:p,deletedRecords:[]};c.data=r,this.parent.trigger(We,c,function(e){if(!e.cancel){for(var s=n.parent.eventFields,o={addedRecords:[],changedRecords:[],deletedRecords:[]},l=r instanceof Array?r:[r],p=0,c=e.changedRecords.length;p<c;p++)!function(t,r){var p=e.changedRecords[parseInt(t.toString(),10)],c=l[parseInt(t.toString(),10)].parent,h=c[s.recurrenceException],d=void 0,u=void 0;switch(i){case"EditOccurrence":d=n.parent.eventsProcessed.filter(function(e){return e.Guid===p.Guid})[0],(u=n.excludeDateCheck(d[s.startTime],h))!==c[s.recurrenceException]?(c[s.recurrenceException]=u,p[s.recurrenceException]=Ne(d[s.startTime]),p[s.recurrenceID]=c[s.id],p[s.followingID]=null,o.changedRecords.push(n.parent.eventBase.processTimezone(c,!0)),o.addedRecords.push(n.parent.eventBase.processTimezone(p,!0))):o.changedRecords.push(n.parent.eventBase.processTimezone(p,!0));break;case"DeleteOccurrence":p[s.recurrenceException]||(c[s.recurrenceException]=n.excludeDateCheck(p[s.startTime],h),o.changedRecords.push(n.parent.eventBase.processTimezone(c,!0))),p[s.id]!==c[s.id]&&(o.deletedRecords.push(n.parent.eventBase.processTimezone(p,!0)),a=!0)}}(p);var h=n.parent.dataModule.dataManager.saveChanges(o,s.id,n.getTable(),n.getQuery()),d=t.extend({},e.changedRecords[e.changedRecords.length-1],null,!0);n.parent.eventBase.selectWorkCellByTime("EditOccurrence"===i?[n.parent.eventBase.processTimezone(d)]:[d]);var u={requestType:"EditOccurrence"===i?"eventChanged":"eventRemoved",cancel:!1,data:a?e.deletedRecords:e.changedRecords,promise:h,editParams:o};n.refreshData(u)}})},e.prototype.processFollowSeries=function(e,i){var n=this,r=[];if(e instanceof Array)for(var a=0,s=e;a<s.length;a++){var o=s[a];r.push({occurrence:o,parent:this.getParentEvent(o)})}else r={occurrence:e,parent:this.getParentEvent(e)};var l=e instanceof Array?e:[e],p={requestType:"EditFollowingEvents"===i?"eventChange":"eventRemove",cancel:!1,addedRecords:[],changedRecords:l,deletedRecords:[]};p.data=r,this.parent.trigger(We,p,function(e){if(!e.cancel){for(var a=n.parent.eventFields,s={addedRecords:[],changedRecords:[],deletedRecords:[]},o=r instanceof Array?r:[r],l=0,p=e.changedRecords.length;l<p;l++)!function(t,r){var l=e.changedRecords[parseInt(t.toString(),10)],p=o[parseInt(t.toString(),10)].parent,c=n.parent.eventBase.getEventCollections(p,l),h=void 0;switch(i){case"EditFollowingEvents":if(n.processRecurrenceRule(p,l),h=!n.parent.eventBase.isFollowingEvent(p,l),l[a.followingID]=h?null:p[a.id],l[a.recurrenceID]=null,s.addedRecords.push(n.parent.eventBase.processTimezone(l,!0)),s.changedRecords.push(n.parent.eventBase.processTimezone(p,!0)),!n.parent.uiStateValues.isIgnoreOccurrence){if(l[a.recurrenceException]=null,c.occurrence.length>0){var d=c.occurrence.slice(-1)[0][a.recurrenceRule];-1===d.indexOf("COUNT")&&(l[a.recurrenceRule]=d)}c.follow.length>0&&(l[a.recurrenceRule]=c.follow.slice(-1)[0][a.recurrenceRule],s.deletedRecords=s.deletedRecords.concat(c.follow)),h&&(c.occurrence=c.occurrence.filter(function(e){return e[a.recurrenceID]===p[a.id]})),s.deletedRecords=s.deletedRecords.concat(c.occurrence)}break;case"DeleteFollowingEvents":n.processRecurrenceRule(p,l[a.startTime]),s.changedRecords.push(n.parent.eventBase.processTimezone(p,!0)),s.deletedRecords=s.deletedRecords.concat(c.occurrence).concat(c.follow)}}(l);var c=n.parent.dataModule.dataManager.saveChanges(s,a.id,n.getTable(),n.getQuery()),h=t.extend({},e.changedRecords[e.changedRecords.length-1],null,!0);n.parent.eventBase.selectWorkCellByTime("EditFollowingEvents"===i?[n.parent.eventBase.processTimezone(h)]:[h]);var d={requestType:"EditFollowingEvents"===i?"eventChanged":"eventRemoved",cancel:!1,data:e.changedRecords,promise:c,editParams:s};n.refreshData(d)}})},e.prototype.processEntireSeries=function(e,i){var n=this,r=[],a=!1;if(e instanceof Array)for(var s=0,o=e;s<o.length;s++){var l=o[s];r.push(this.getParentEvent(l,!0))}else r=this.getParentEvent(e,!0);var p=e instanceof Array?e:[e],c={requestType:"EditSeries"===i?"eventChange":"eventRemove",cancel:!1,addedRecords:[],changedRecords:[],deletedRecords:[]};if(c.data=r,"EditSeries"===i?c.changedRecords=p:c.deletedRecords=p,"EditSeries"===i&&!this.parent.uiStateValues.isIgnoreOccurrence)for(var h=r instanceof Array?r:[r],d=0,u=c.changedRecords.length;d<u;d++){var g=h[parseInt(d.toString(),10)],v=this.parent.eventBase.getEventCollections(g),m=v.follow.concat(v.occurrence);c.deletedRecords=c.deletedRecords.concat(m)}this.parent.trigger(We,c,function(e){if(!e.cancel){for(var s=n.parent.eventFields,o={addedRecords:[],changedRecords:[],deletedRecords:[]},l=r instanceof Array?r:[r],p="EditSeries"===i?e.changedRecords:e.deletedRecords,c=0,h=p.length;c<h;c++)!function(e,t){var r=p[parseInt(e.toString(),10)],c=l[parseInt(e.toString(),10)],h=n.parent.eventBase.getEventCollections(c),d=h.follow.concat(h.occurrence);switch(i){case"EditSeries":if(r[s.id]=c[s.id],r[s.recurrenceID]=null,r[s.followingID]=null,n.parent.uiStateValues.isIgnoreOccurrence&&r[s.recurrenceException]){var u=n.parent.eventsData.filter(function(e){return e[s.id]===r[s.id]});u.length>0&&(r[s.recurrenceRule]=u[0][s.recurrenceRule])}else r[s.recurrenceException]=null,o.deletedRecords=o.deletedRecords.concat(d);o.changedRecords.push(n.parent.eventBase.processTimezone(r,!0)),n.parent.uiStateValues.isIgnoreOccurrence=!1;break;case"DeleteSeries":o.deletedRecords=o.deletedRecords.concat(d.concat(n.parent.eventBase.processTimezone(c,!0))),a=!0}}(c);var d=n.parent.dataModule.dataManager.saveChanges(o,s.id,n.getTable(),n.getQuery()),u=t.extend({},p[p.length-1],null,!0);n.parent.eventBase.selectWorkCellByTime("EditSeries"===i?[n.parent.eventBase.processTimezone(u)]:[u]);var g={requestType:"EditSeries"===i?"eventChanged":"eventRemoved",cancel:!1,data:a?e.deletedRecords:e.changedRecords,promise:d,editParams:o};n.refreshData(g)}})},e.prototype.processDelete=function(e){for(var i=this,n=[],r=0,a=e;r<a.length;r++){var s=a[r];s[this.parent.eventFields.recurrenceRule]?n.push({occurrence:s,parent:this.getParentEvent(s)}):n.push(s)}var o={requestType:"eventRemove",cancel:!1,addedRecords:[],changedRecords:[],deletedRecords:e};o.data=n,this.parent.trigger(We,o,function(e){if(!e.cancel){for(var r=i.parent.eventFields,a={addedRecords:[],changedRecords:[],deletedRecords:[]},s=t.extend([],e.deletedRecords,null,!0),o=0,l=e.deletedRecords.length;o<l;o++)!function(s,o){var l=t.isNullOrUndefined(e.deletedRecords[parseInt(s.toString(),10)][i.parent.eventFields.recurrenceRule]);if(!l){var p=n[parseInt(s.toString(),10)].parent,c=a.changedRecords.filter(function(e){return e[r.id]===p[r.id]}),h=e.deletedRecords[parseInt(s.toString(),10)][r.startTime];if(c.length>0){var d=c[0];d[r.recurrenceException]=i.excludeDateCheck(h,d[r.recurrenceException])}else p[r.recurrenceException]=i.excludeDateCheck(h,p[r.recurrenceException]);0===c.length&&a.changedRecords.push(i.parent.eventBase.processTimezone(p,!0)),l=e.deletedRecords[parseInt(s.toString(),10)][r.id]!==p[r.id]}if(l){if(e.deletedRecords instanceof Array)for(var u=0,g=e.deletedRecords;u<g.length;u++){var v=g[u];i.parent.eventBase.processTimezone(v,!0)}a.deletedRecords.push(e.deletedRecords[parseInt(s.toString(),10)])}}(o);var p=i.parent.dataModule.dataManager.saveChanges(a,r.id,i.getTable(),i.getQuery());i.parent.eventBase.selectWorkCellByTime(s);var c={requestType:"eventRemoved",cancel:!1,data:e.deletedRecords,promise:p,editParams:a};i.refreshData(c)}})},e.prototype.processSave=function(e){for(var i=this,n=e instanceof Array?e:[e],r=[],a=0,s=n;a<s.length;a++){var o=s[a];o[this.parent.eventFields.recurrenceRule]?r.push({occurrence:o,parent:this.getParentEvent(o)}):r.push(o)}var l={requestType:"eventChange",cancel:!1,addedRecords:[],changedRecords:n,deletedRecords:[]};l.data=r,this.parent.trigger(We,l,function(e){if(!e.cancel){for(var n=i.parent.eventFields,r={addedRecords:[],changedRecords:[],deletedRecords:[]},a=0,s=e.changedRecords;a<s.length;a++){var o=s[a];if(!t.isNullOrUndefined(o[n.recurrenceRule])&&t.isNullOrUndefined(o[n.recurrenceException])){var l=Ne(o[n.startTime]),p=i.getParentEvent(o);p[n.recurrenceException]=t.isNullOrUndefined(p[n.recurrenceException])?l:p[n.recurrenceException].concat(","+l),o[n.id]=i.parent.getEventMaxID(),o[n.recurrenceException]=l,r.addedRecords.push(i.parent.eventBase.processTimezone(o,!0)),r.changedRecords.push(i.parent.eventBase.processTimezone(p,!0))}else r.changedRecords.push(i.parent.eventBase.processTimezone(o,!0))}var c=i.parent.dataModule.dataManager.saveChanges(r,n.id,i.getTable(),i.getQuery()),h=t.extend({},e.changedRecords[e.changedRecords.length-1],null,!0);i.parent.eventBase.selectWorkCellByTime([i.parent.eventBase.processTimezone(h)]);var d={requestType:"eventChanged",cancel:!1,data:e.changedRecords,promise:c,editParams:r};i.refreshData(d)}})},e.prototype.getParentEvent=function(e,t){void 0===t&&(t=!1);var i=this.parent.eventBase.getParentEvent(e,t)||e;return(i[this.parent.eventFields.startTimezone]||i[this.parent.eventFields.endTimezone])&&this.parent.eventBase.timezoneConvert(i),i},e.prototype.excludeDateCheck=function(e,i){var n=this.parent.timezone||this.parent.tzModule.getLocalTimezoneName();n&&(e=this.parent.tzModule.remove(new Date(+e.getTime()),n));var r=Ne(e);return t.isNullOrUndefined(i)?i=r:-1===i.indexOf(r)&&(i=t.isNullOrUndefined(i)?r:i+","+r),i},e.prototype.processRecurrenceRule=function(e,t){var i,n=this.parent.eventFields,r=e[n.recurrenceRule];if(t instanceof Date)i=new Date(+t);else{i=new Date(+t[n.startTime]);var a=t[n.recurrenceRule];if(a){var s=e[n.startTime],o=G(s,a,"DeleteFollowingEvents"===this.parent.currentAction?t[n.recurrenceException]:null,this.parent.activeViewOptions.firstDayOfWeek),l=new Date(o.slice(-1)[0]);l.setHours(i.getHours(),i.getMinutes(),i.getSeconds()),i.setHours(s.getHours(),s.getMinutes(),s.getSeconds()),t[n.recurrenceRule]=this.getUpdatedRecurrenceRule(a,new Date(+l),!1)}}e[n.recurrenceRule]=this.getUpdatedRecurrenceRule(r,O(new Date(i.getTime()),-1),!0)},e.prototype.getUpdatedRecurrenceRule=function(e,t,i){for(var n="",r=0,a=e.split(";");r<a.length;r++){var s=a[r];if(""!==s){var o=s.split("=")[0],l=s.split("=")[1];"COUNT"!==o&&"UNTIL"!==o||(l=Ne(t),s=s.replace(s,"UNTIL="+l)),n+=s+";"}}return i&&-1===n.indexOf("UNTIL")&&(n+="UNTIL="+Ne(t)),n},e.prototype.isBlockEvent=function(e){for(var t=!1,i=0,n=e instanceof Array?e:[e];i<n.length;i++)t=n[i][this.parent.eventFields.isBlock]||!1;return t},e.prototype.destroy=function(){this.crudObj=null,this.parent=null},e}(),Ai=function(){function e(e){this.parent=e,t.EventHandler.add(this.parent.element,"mouseover",this.onHover,this)}return e.prototype.cellMouseDown=function(e){this.isPreventAction(e)||this.parent.notify("cell-mouse-down",{event:e})},e.prototype.cellClick=function(e){var i=this;if(!this.isPreventAction(e)){var n=t.closest(e.target,".e-work-cells,.e-all-day-cells,.e-header-cells");if(!t.isNullOrUndefined(n)){if(!t.isNullOrUndefined(t.closest(e.target,".e-new-event")))return void this.parent.eventWindow.openEditor(this.parent.activeCellsData,"Add");var r=n.classList.contains("e-work-cells")||n.classList.contains("e-all-day-cells");this.parent.uiStateValues.isTapHold&&!this.parent.uiStateValues.action&&r&&(this.parent.uiStateValues.isTapHold=!1,this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.selectedElements=[]);var a=t.closest(e.target,".e-navigate"),s=this.parent.getNavigateView(),o=this.parent.currentView===s;if(t.isNullOrUndefined(a)||o||t.isNullOrUndefined(this.parent.viewOptions[s.charAt(0).toLowerCase()+s.slice(1)])){if(this.parent.activeViewOptions.readonly&&"MonthAgenda"!==this.parent.currentView)return void(this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide());if(this.parent.isAdaptive&&(e.target.classList.contains("e-more-indicator")||t.closest(e.target,".e-more-indicator")))return;if(r&&e.shiftKey&&1===e.which&&this.parent.keyboardInteractionModule)return void this.parent.keyboardInteractionModule.onMouseSelection(e);this.parent.activeCellsData=this.parent.getCellDetails(n);var l=t.extend(this.parent.activeCellsData,{cancel:!1,event:e,name:"cellClick"});this.parent.trigger("cellClick",l,function(e){if(e.cancel)i.parent.quickPopup&&i.parent.quickPopup.quickPopupHide();else if(r&&i.parent.selectCell(n),i.parent.allowInline){var t={element:e.element,groupIndex:e.groupIndex,type:"Cell"};i.parent.notify(Ye,t)}else i.parent.notify("cellClick",e)})}else{var p=this.parent.getDateFromElement(n);!t.isNullOrUndefined(p)&&this.parent.isMinMaxDate(p)&&(this.parent.setProperties({selectedDate:p},!0),this.parent.changeView(this.parent.getNavigateView(),e))}}}},e.prototype.cellDblClick=function(e){var i=this,n=t.closest(e.target,".e-work-cells,.e-all-day-cells,.e-header-cells");if(!(this.parent.activeViewOptions.readonly||this.isPreventAction(e)||t.isNullOrUndefined(n))){var r=t.extend(this.parent.activeCellsData,{cancel:!1,event:e,name:"cellDoubleClick"});this.parent.trigger("cellDoubleClick",r,function(e){if(e.startTime){var t=new Date(e.startTime.getTime());i.parent.isMinMaxDate(new Date(t.setHours(0,0,0,0)))&&(e.cancel||i.parent.eventWindow.openEditor(i.parent.activeCellsData,"Add"))}})}},e.prototype.onHover=function(e){var i=t.closest(e.target,".e-work-cells,.e-time-slots,.e-all-day-cells,.e-header-cells,.e-resource-cells,.e-appointment,.e-week-number,.e-month-header");if(i){var n={element:i,event:e};this.parent.trigger("hover",n)}},e.prototype.isPreventAction=function(e){if(t.closest(e.target,".e-navigate"))return!1;if(t.closest(e.target,".e-appointment-wrapper")&&!t.closest(e.target,".e-more-indicator"))return!0;var i=t.closest(e.target,".e-appointment,.e-resource-group-cells");return!t.isNullOrUndefined(i)||(i=t.closest(e.target,".e-header-cells"),!(!this.parent.activeView||!this.parent.activeView.isTimelineView()||t.isNullOrUndefined(i)))},e.prototype.destroy=function(){t.EventHandler.remove(this.parent.element,"mouseover",this.onHover)},e}(),Ii=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ki=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},Mi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ii(i,e),ki([t.Property()],i.prototype,"name",void 0),ki([t.Property()],i.prototype,"default",void 0),ki([t.Property()],i.prototype,"title",void 0),ki([t.Property({})],i.prototype,"validation",void 0),i}(t.ChildProperty),Ri=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Hi=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},Pi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ri(i,e),Hi([t.Property("Id")],i.prototype,"id",void 0),Hi([t.Property("IsBlock")],i.prototype,"isBlock",void 0),Hi([t.Complex({name:"Subject"},Mi)],i.prototype,"subject",void 0),Hi([t.Complex({name:"StartTime"},Mi)],i.prototype,"startTime",void 0),Hi([t.Complex({name:"EndTime"},Mi)],i.prototype,"endTime",void 0),Hi([t.Complex({name:"StartTimezone"},Mi)],i.prototype,"startTimezone",void 0),Hi([t.Complex({name:"EndTimezone"},Mi)],i.prototype,"endTimezone",void 0),Hi([t.Complex({name:"Location"},Mi)],i.prototype,"location",void 0),Hi([t.Complex({name:"Description"},Mi)],i.prototype,"description",void 0),Hi([t.Complex({name:"IsAllDay"},Mi)],i.prototype,"isAllDay",void 0),Hi([t.Complex({name:"RecurrenceID"},Mi)],i.prototype,"recurrenceID",void 0),Hi([t.Complex({name:"RecurrenceRule"},Mi)],i.prototype,"recurrenceRule",void 0),Hi([t.Complex({name:"RecurrenceException"},Mi)],i.prototype,"recurrenceException",void 0),Hi([t.Property("IsReadonly")],i.prototype,"isReadonly",void 0),Hi([t.Property("FollowingID")],i.prototype,"followingID",void 0),i}(t.ChildProperty),ji=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ni=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},Li=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ji(i,e),Ni([t.Property()],i.prototype,"template",void 0),Ni([t.Property([])],i.prototype,"dataSource",void 0),Ni([t.Property()],i.prototype,"query",void 0),Ni([t.Complex({},Pi)],i.prototype,"fields",void 0),Ni([t.Property(!1)],i.prototype,"enableTooltip",void 0),Ni([t.Property("AllDayRow")],i.prototype,"spannedEventPlacement",void 0),Ni([t.Property(1)],i.prototype,"minimumEventDuration",void 0),Ni([t.Property()],i.prototype,"tooltipTemplate",void 0),Ni([t.Property()],i.prototype,"resourceColorField",void 0),Ni([t.Property(!1)],i.prototype,"editFollowingEvents",void 0),Ni([t.Property(!0)],i.prototype,"allowAdding",void 0),Ni([t.Property(!0)],i.prototype,"allowEditing",void 0),Ni([t.Property(!0)],i.prototype,"allowDeleting",void 0),Ni([t.Property(!1)],i.prototype,"enableMaxHeight",void 0),Ni([t.Property(!1)],i.prototype,"enableIndicator",void 0),Ni([t.Property(!1)],i.prototype,"ignoreWhitespace",void 0),Ni([t.Property()],i.prototype,"sortComparer",void 0),Ni([t.Property()],i.prototype,"includeFiltersInQuery",void 0),i}(t.ChildProperty),qi=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Fi=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},Ui=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return qi(i,e),Fi([t.Property(!1)],i.prototype,"byDate",void 0),Fi([t.Property(!0)],i.prototype,"byGroupID",void 0),Fi([t.Property(!1)],i.prototype,"allowGroupEdit",void 0),Fi([t.Property([])],i.prototype,"resources",void 0),Fi([t.Property(!0)],i.prototype,"enableCompactView",void 0),Fi([t.Property()],i.prototype,"headerTooltipTemplate",void 0),Fi([t.Property(!1)],i.prototype,"hideNonWorkingDays",void 0),i}(t.ChildProperty),Bi=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Wi=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},zi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Bi(i,e),Wi([t.Property()],i.prototype,"field",void 0),Wi([t.Property()],i.prototype,"title",void 0),Wi([t.Property()],i.prototype,"name",void 0),Wi([t.Property(!1)],i.prototype,"allowMultiple",void 0),Wi([t.Property([])],i.prototype,"dataSource",void 0),Wi([t.Property()],i.prototype,"query",void 0),Wi([t.Property("Id")],i.prototype,"idField",void 0),Wi([t.Property("Text")],i.prototype,"textField",void 0),Wi([t.Property("Expanded")],i.prototype,"expandedField",void 0),Wi([t.Property("GroupID")],i.prototype,"groupIDField",void 0),Wi([t.Property("Color")],i.prototype,"colorField",void 0),Wi([t.Property("StartHour")],i.prototype,"startHourField",void 0),Wi([t.Property("EndHour")],i.prototype,"endHourField",void 0),Wi([t.Property("WorkDays")],i.prototype,"workDaysField",void 0),Wi([t.Property("CssClass")],i.prototype,"cssClassField",void 0),i}(t.ChildProperty),Yi=function(){function e(e){this.resourceCollection=[],this.leftPixel=25,this.resourceDateTree=[],this.parent=e}return e.prototype.renderResourceHeaderIndent=function(e){var i=t.createElement("td",{className:"e-resource-left-td"}),n=t.createElement("div",{className:"e-resource-text"});if(this.parent.activeViewOptions.headerIndentTemplate){var r={className:[i.className],type:"emptyCells"};this.parent.renderHeaderIndentTemplate(r,i)}else i.appendChild(n);var a={elementType:"emptyCells",element:i};this.parent.trigger(ze,a),e.appendChild(i)},e.prototype.hideResourceRows=function(e){if(!(this.resourceCollection.length<=1||this.parent.virtualScrollModule))for(var i=this.lastResourceLevel.length,n=0;n<i;n++){var r=this.lastResourceLevel[parseInt(n.toString(),10)].resourceData,a=this.lastResourceLevel[parseInt(n.toString(),10)].resource;if("e-parent-node"===r.ClassName&&!r[a.expandedField]&&!t.isNullOrUndefined(r[a.expandedField])){var s=[].slice.call(e.children).slice(n+1,n+(parseInt(r.Count,10)+1));t.addClass(s,"e-hidden")}}},e.prototype.createResourceColumn=function(){var e=this.resourceCollection,i=t.createElement("div",{className:"e-resource-column-wrap"}),n=this.parent.activeView.createTableLayout("e-resource-column-table");!this.parent.uiStateValues.isGroupAdaptive&&this.parent.rowAutoHeight&&this.parent.activeView.isTimelineView()&&this.parent.activeViewOptions.group.resources.length>0&&t.addClass([n],"e-auto-height");var r=n.querySelector("tbody"),a=this.generateTreeData(!0);if(this.countCalculation(e.slice(0,-2),e.slice(0,-1)),this.renderedResources=this.lastResourceLevel,this.parent.virtualScrollModule){var s=this.parent.virtualScrollModule.getRenderedCount();this.setExpandedResources(),a=this.expandedResources.slice(0,s),this.renderedResources=a}return t.append(this.getContentRows(a),r),this.hideResourceRows(r),n.appendChild(r),i.appendChild(n),i},e.prototype.setRenderedResources=function(){var e=this.resourceCollection;this.generateTreeData(!0);this.countCalculation(e.slice(0,-2),e.slice(0,-1)),this.renderedResources=this.lastResourceLevel},e.prototype.setExpandedResources=function(){for(var e=[],i=0;i<this.lastResourceLevel.length;i++){var n=this.lastResourceLevel[parseInt(i.toString(),10)].resourceData,r=n.Count;e.push(this.lastResourceLevel[parseInt(i.toString(),10)]);var a=n[this.lastResourceLevel[parseInt(i.toString(),10)].resource.expandedField];!t.isNullOrUndefined(a)&&!a&&r>0&&(i+=r)}this.expandedResources=e},e.prototype.getContentRows=function(e,i){for(var n,r,a=[],s=this.resourceCollection,o=t.createElement("tr"),l=t.createElement("td",{attrs:{tabindex:i?"-1":"0"}}),p=this.parent.activeView.getGroupIndices(),c=0;c<e.length;c++)if(!(p.length>0&&p.indexOf(e[parseInt(c.toString(),10)].groupIndex)>-1)){var h=l.cloneNode();if(r=H(s,"name",e[parseInt(c.toString(),10)].resource.name),r===s.length-1?(t.extend(e[parseInt(c.toString(),10)].resourceData,{ClassName:"e-child-node"}),this.renderedResources[parseInt(c.toString(),10)].className=["e-child-node"]):(t.extend(e[parseInt(c.toString(),10)].resourceData,{ClassName:"e-parent-node"}),this.renderedResources[parseInt(c.toString(),10)].className=["e-parent-node"]),n=r*this.leftPixel+"px","e-parent-node"===e[parseInt(c.toString(),10)].resourceData.ClassName&&!t.isNullOrUndefined(e[parseInt(c.toString(),10)].resourceData.Count)&&e[parseInt(c.toString(),10)].resourceData.Count>0){var d=void 0;d=e[parseInt(c.toString(),10)].resourceData[s[parseInt(r.toString(),10)].expandedField]||t.isNullOrUndefined(e[parseInt(c.toString(),10)].resourceData[s[parseInt(r.toString(),10)].expandedField])?"e-resource-collapse":"e-resource-expand";var u=t.createElement("div");t.addClass([u],["e-resource-tree-icon",d]),this.setMargin(u,n),h.appendChild(u),this.resourceCollection.length>1&&t.EventHandler.add(u,"click",this.onTreeIconClick,this)}this.parent.activeView.setResourceHeaderContent(h,e[parseInt(c.toString(),10)],"e-resource-text"),h.setAttribute("data-group-index",e[parseInt(c.toString(),10)].groupIndex.toString()),h.setAttribute("aria-label",e[parseInt(c.toString(),10)].resourceData[e[parseInt(c.toString(),10)].resource.textField]+" resource"),this.parent.activeViewOptions.resourceHeaderTemplate||this.setMargin(h.querySelector(".e-resource-text"),n);var g=["e-resource-cells",e[parseInt(c.toString(),10)].resourceData.ClassName];t.addClass([h],g);var v={elementType:"resourceHeader",element:h,groupIndex:e[parseInt(c.toString(),10)].groupIndex};this.parent.trigger(ze,v);var m=o.cloneNode();m.appendChild(h),a.push(m)}return a},e.prototype.setMargin=function(e,t){this.parent.enableRtl?e.style.marginRight=t:e.style.marginLeft=t},e.prototype.countCalculation=function(e,i){for(var n,r=0;r<e.length;r++){for(var s=e[e.length-(r+1)].dataSource,o=0;o<s.length;o++){var l=0;if(this.parent.activeViewOptions.group.byGroupID){var p=(new a.Query).where(i[i.length-1].groupIDField,"equal",s[parseInt(o.toString(),10)][e[e.length-(r+1)].idField]);n=new a.DataManager(i[i.length-1].dataSource).executeLocal(p)}else n=i[i.length-1].dataSource;for(var c=0;c<n.length;c++)l+=parseInt(n[parseInt(c.toString(),10)].Count,10);l+=parseInt(s[parseInt(o.toString(),10)].Count,10),t.extend(s[parseInt(o.toString(),10)],{Count:l})}i=i.slice(0,-1)}},e.prototype.onTreeIconClick=function(e){var i=this;this.parent.eventTooltip&&this.parent.eventTooltip.close();var n,r=e.target,a=t.closest(r,".e-parent-node").parentElement,s=parseInt(a.children[0].getAttribute("data-group-index"),10),o={cancel:!1,event:e,groupIndex:s,requestType:r.classList.contains("e-resource-collapse")?"resourceCollapse":"resourceExpand"};this.parent.trigger(We,o,function(a){if(!a.cancel){r.classList.contains("e-resource-collapse")?(t.classList(r,["e-resource-expand"],["e-resource-collapse"]),n=!0):(t.classList(r,["e-resource-collapse"],["e-resource-expand"]),n=!1);for(var l=0,p=[].slice.call(i.parent.element.querySelectorAll(".e-appointment,.e-more-indicator"));l<p.length;l++){var c=p[l];t.remove(c)}i.parent.virtualScrollModule?i.updateVirtualContent(s,n,e,r):i.updateContent(s,n);var h={cssProperties:i.parent.getCssProperties(),module:"scroll"};i.parent.notify(Xe,h),o={cancel:!1,event:e,groupIndex:s,requestType:r.classList.contains("e-resource-collapse")?"resourceExpanded":"resourceCollapsed"},i.parent.refreshEvents(!1),i.parent.trigger("actionComplete",o)}})},e.prototype.updateContent=function(e,i){for(var n,r=[],a=[],s=[],o=this.lastResourceLevel[parseInt(e.toString(),10)].resourceData,l=[].slice.call(this.parent.element.querySelectorAll(".e-resource-column-wrap tr")),p=[].slice.call(this.parent.element.querySelectorAll(".e-content-wrap tbody tr")),c=[].slice.call(this.parent.element.querySelectorAll(".e-content-wrap ."+at)),h=0;h<o.Count;h++)r.push(l[e+h+1]),a.push(p[e+h+1]),s.push(c[e+h+1]);for(var d=this.lastResourceLevel,u=0;u<r.length;u++){var g=!0;if(n=r[parseInt(u.toString(),10)].children[0].classList.contains("e-parent-node"),d[parseInt(e.toString(),10)].resourceData[d[parseInt(e.toString(),10)].resource.expandedField]=!i,i)n&&(m=r[parseInt(u.toString(),10)].querySelector(".e-resource-tree-icon"))&&t.classList(m,["e-resource-expand"],["e-resource-collapse"]),r[parseInt(u.toString(),10)].classList.contains("e-hidden")||t.addClass([r[parseInt(u.toString(),10)],a[parseInt(u.toString(),10)],s[parseInt(u.toString(),10)]],"e-hidden");else{if(n){var v=r[parseInt(u.toString(),10)].rowIndex;if(d[parseInt(v.toString(),10)].resourceData[d[parseInt(v.toString(),10)].resource.expandedField]||t.isNullOrUndefined(d[parseInt(v.toString(),10)].resourceData[d[parseInt(v.toString(),10)].resource.expandedField])||(r.splice(u+1,parseInt(d[parseInt(v.toString(),10)].resourceData.Count,10)),a.splice(u+1,parseInt(d[parseInt(v.toString(),10)].resourceData.Count,10)),s.splice(u+1,parseInt(d[parseInt(v.toString(),10)].resourceData.Count,10)),g=!1),g){var m=r[parseInt(u.toString(),10)].querySelector(".e-resource-tree-icon");m&&t.classList(m,["e-resource-collapse"],["e-resource-expand"])}}r[parseInt(u.toString(),10)].classList.contains("e-hidden")&&t.removeClass([r[parseInt(u.toString(),10)],a[parseInt(u.toString(),10)],s[parseInt(u.toString(),10)]],"e-hidden")}}},e.prototype.updateVirtualContent=function(e,i,n,r){this.lastResourceLevel[parseInt(e.toString(),10)].resourceData[this.lastResourceLevel[parseInt(e.toString(),10)].resource.expandedField]=!i,this.setExpandedResources();var a=this.parent.virtualScrollModule.getRenderedCount(),s=this.expandedResources.indexOf(this.renderedResources[0]);if(this.parent.virtualScrollModule.existingDataCollection=this.renderedResources,this.renderedResources=this.expandedResources.slice(s,s+a),this.renderedResources.length<a){var o=this.expandedResources.length-a;o=o>0?o:0,this.renderedResources=this.expandedResources.slice(o,this.expandedResources.length)}var l=this.parent.element.querySelector(".e-virtual-track");this.parent.virtualScrollModule.updateVirtualTrackHeight(l);var p=this.parent.element.querySelector(".e-resource-column-wrap table"),c=this.parent.element.querySelector(".e-content-wrap table"),h=this.parent.element.querySelector(".e-event-table");this.parent.virtualScrollModule.updateContent(p,c,h,this.renderedResources);var d=this.parent.element.querySelector(".e-current-timeline");t.isNullOrUndefined(d)||(d.style.height=this.parent.element.querySelector("."+nt).offsetHeight+"px")},e.prototype.renderResourceHeader=function(){var e=t.createElement("div",{className:"e-schedule-resource-toolbar-container"});if(e.innerHTML='<div class="e-schedule-resource-toolbar"><div class="e-resource-menu"><div class="e-icons e-icon-menu"></div></div><div class="e-resource-level-title"></div></div>',"MonthAgenda"===this.parent.currentView){var i=this.parent.activeView.getPanel().querySelector(".e-content-wrap");i.insertBefore(e,i.querySelector(".e-wrapper-container"))}else this.parent.element.insertBefore(e,this.parent.element.querySelector("."+tt));this.renderResourceHeaderText(),t.EventHandler.add(e.querySelector(".e-icon-menu"),"click",this.menuClick,this)},e.prototype.renderResourceTree=function(){this.popupOverlay=t.createElement("div",{className:"e-resource-tree-popup-overlay"});var e=t.createElement("div",{className:"e-resource-tree-popup e-popup-close"});if("MonthAgenda"===this.parent.currentView){var r=this.parent.activeView.getPanel().querySelector(".e-wrapper-container");r.insertBefore(e,r.children[0]),r.appendChild(this.popupOverlay)}else this.parent.element.querySelector("."+tt).appendChild(e),this.parent.element.querySelector("."+tt).appendChild(this.popupOverlay);var a=t.createElement("div",{className:"e-resource-tree"});e.appendChild(a),this.treeViewObj=new n.TreeView({cssClass:this.parent.cssClass,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,fields:{dataSource:[].slice.call(this.generateTreeData()),id:"resourceId",text:"resourceName",child:"resourceChild"},nodeTemplate:this.parent.resourceHeaderTemplate,nodeClicked:this.resourceClick.bind(this),created:this.resourceTreeCreated.bind(this)}),this.treeViewObj.root=this.parent.root?this.parent.root:this.parent,this.treeViewObj.appendTo(a),this.treeViewObj.expandAll(),this.treePopup=new i.Popup(e,{targetType:"relative",actionOnScroll:"none",content:this.treeViewObj.element,relateTo:this.parent.element.querySelector("."+tt),enableRtl:this.parent.enableRtl,hideAnimation:{name:"SlideLeftOut",duration:500},showAnimation:{name:"SlideLeftIn",duration:500},viewPortElement:this.parent.element.querySelector("."+("MonthAgenda"===this.parent.currentView?"e-wrapper-container":tt))}),this.parent.on("document-click",this.documentClick,this)},e.prototype.resourceTreeCreated=function(){this.parent.activeViewOptions.resourceHeaderTemplate&&this.parent.portals&&this.treeViewObj.portals&&(this.parent.portals=this.parent.portals.concat(this.treeViewObj.portals),this.parent.renderTemplates())},e.prototype.generateTreeData=function(e){for(var i=this,n=[],r=[],a=0,s=this,o=0,l=this.resourceTreeLevel.length;o<l;o++)!function(o,l){var p=function(n,s,o){var l,c,h=i.resourceCollection[parseInt(s.toString(),10)];e?(c={type:"resourceHeader",resource:n.resource,resourceData:n.resourceData,groupIndex:a,groupOrder:n.groupOrder},r.push(c),a++):l={resourceId:o,resourceName:n.resourceData[h.textField],resource:n.resource,resourceData:n.resourceData},n.child.length>0&&!e&&(l.resourceChild=[]);for(var d=1,u=0,g=n.child;u<g.length;u++){var v=g[u];e?p(v,s+1,o+"-"+d):l.resourceChild.push(p(v,s+1,o+"-"+d)),d+=1}return e&&t.extend(c.resourceData,{Count:d-1}),l};e?p(s.resourceTreeLevel[parseInt(o.toString(),10)],0,(o+1).toString()):n.push(p(s.resourceTreeLevel[parseInt(o.toString(),10)],0,(o+1).toString()))}(o);return e?(this.lastResourceLevel=r,r):n},e.prototype.renderResourceHeaderText=function(){for(var e=this.lastResourceLevel[this.parent.uiStateValues.groupIndex],i=[],n=this,r=0,a=e.groupOrder.length;r<a;r++)!function(r,a){var s=n.resourceCollection[parseInt(r.toString(),10)],o=s.dataSource.filter(function(t){return t[s.idField]===e.groupOrder[parseInt(r.toString(),10)]}),l=t.createElement("div",{className:"e-resource-name"});n.parent.sanitize(o[0][s.textField],l),i.push(l);var p=t.createElement("div",{className:"e-icons e-icon-next"});i.push(p)}(r);i.pop();var s=("MonthAgenda"===this.parent.currentView?this.parent.activeView.getPanel():this.parent.element).querySelector(".e-resource-level-title");j(s);for(var o=0,l=i;o<l.length;o++){var p=l[o];s.appendChild(p)}1===this.lastResourceLevel.length&&t.addClass([this.parent.element.querySelector(".e-resource-menu")],"e-disable")},e.prototype.menuClick=function(e){if(this.parent.element.querySelector(".e-resource-tree-popup").classList.contains(rt))this.treePopup.hide(),t.removeClass([this.popupOverlay],"e-enable");else{var i=[].slice.call(this.treeViewObj.element.querySelectorAll(".e-list-item:not(.e-has-child)"));t.removeClass(i,"e-active"),t.addClass([i[this.parent.uiStateValues.groupIndex]],"e-active"),this.treePopup.show(),t.addClass([this.popupOverlay],"e-enable")}},e.prototype.selectResourceByIndex=function(e){this.lastResourceLevel&&e>-1&&e<this.lastResourceLevel.length&&this.triggerEvents(e)},e.prototype.resourceClick=function(e){if(!e.node.classList.contains("e-has-child")){this.treePopup.hide(),t.removeClass([this.popupOverlay],"e-enable");var i=[].slice.call(this.treeViewObj.element.querySelectorAll(".e-list-item:not(.e-has-child)")).indexOf(e.node);this.triggerEvents(i,e),e.event.preventDefault()}},e.prototype.triggerEvents=function(e,t){var i=this,n={cancel:!1,event:t?t.event:null,groupIndex:e,requestType:"resourceChange"};this.parent.trigger(We,n,function(e){e.cancel||(i.parent.uiStateValues.groupIndex=e.groupIndex,i.parent.renderModule.render(i.parent.currentView),n={cancel:!1,event:t?t.event:null,groupIndex:i.parent.uiStateValues.groupIndex,requestType:"resourceChanged"},i.parent.adaptiveGroupIndex=i.parent.uiStateValues.groupIndex,i.parent.trigger("actionComplete",n))})},e.prototype.documentClick=function(e){if(!t.closest(e.event.target,".e-resource-tree-popup")){var i=this.parent.element.querySelector(".e-resource-tree-popup");i&&i.classList.contains(rt)&&(this.treePopup.hide(),t.removeClass([this.popupOverlay],"e-enable"))}},e.prototype.bindResourcesData=function(e){var t=this;this.parent.showSpinner();for(var i=[],n=0,r=this.parent.resources;n<r.length;n++){var a=r[n],s=new mt(this.parent,a.dataSource,a.query);i.push(s.getData(s.generateQuery()))}Promise.all(i).then(function(i){return t.dataManagerSuccess(i,e)}).catch(function(e){return t.parent.crudModule.dataManagerFailure(e)})},e.prototype.dataManagerSuccess=function(e,t){if(!(!this.parent||this.parent&&this.parent.isDestroyed)){this.parent.resourceCollection=[];for(var i=0,n=e.length;i<n;i++){var r=this.parent.resources[parseInt(i.toString(),10)],a=this.getResourceModel(r,e[parseInt(i.toString(),10)].result);this.parent.resourceCollection.push(a)}this.refreshLayout(t)}},e.prototype.getResourceModel=function(e,t){return{field:e.field,title:e.title,name:e.name,allowMultiple:e.allowMultiple,dataSource:t||e.dataSource,idField:e.idField,textField:e.textField,groupIDField:e.groupIDField,colorField:e.colorField,startHourField:e.startHourField,endHourField:e.endHourField,workDaysField:e.workDaysField,expandedField:e.expandedField,cssClassField:e.cssClassField}},e.prototype.refreshLayout=function(e){!t.isNullOrUndefined(this.parent.uiStateValues.groupIndex)&&this.parent.enablePersistence||(this.parent.uiStateValues.groupIndex=0),this.parent.renderElements(e)},e.prototype.setResourceCollection=function(){var e=[];if(this.resourceCollection=[],this.colorIndex=null,this.parent.activeViewOptions.group.resources.length>0)for(var i=0,n=this.parent.activeViewOptions.group.resources;i<n.length;i++){var r=n[i],a=H(this.parent.resourceCollection,"name",r);a>=0&&e.push(this.parent.resourceCollection[parseInt(a.toString(),10)])}else this.parent.resourceCollection.length>0&&(e=this.parent.resourceCollection);for(var s=0,o=0,l=e;o<l.length;o++){var r=l[o],p=this.getResourceModel(r);r.name===this.parent.eventSettings.resourceColorField&&(this.colorIndex=s),s++,this.resourceCollection.push(p)}t.isNullOrUndefined(this.colorIndex)&&(this.colorIndex=this.resourceCollection.length-1)},e.prototype.generateResourceLevels=function(e,t){var i=this,n=this.resourceCollection,r=[],a=[],s=function(t,n,o,l,p){var c=[],h=t[0];if(h){var d=void 0;if(l&&i.parent.activeViewOptions.group.byGroupID){var u=l[o.idField];d=h.dataSource.filter(function(e){return e[h.groupIDField]===u})}else d=h.dataSource;for(var g=0;g<d.length;g++){var v=[];p&&p.length>0&&(v=v.concat(p)),v.push(d[parseInt(g.toString(),10)][h.idField]);var m=s(t.slice(1),n+1,h,d[parseInt(g.toString(),10)],v);if(!(0===n&&0===m.length&&i.resourceCollection.length>1)){var f=[],y=i.parent.activeView.renderDates,T=void 0;if(!i.parent.activeViewOptions.group.byDate&&n+1===i.resourceCollection.length){var w=d[parseInt(g.toString(),10)][h.workDaysField],D=d[parseInt(g.toString(),10)][h.startHourField],b=d[parseInt(g.toString(),10)][h.endHourField];w&&w.length>0?(y=i.parent.activeView.getRenderDates(w),T=w,f=i.parent.activeView.getDateSlots(y,w)):(T=i.parent.activeViewOptions.workDays,f=e);var C=i.generateCustomHours(f,D,b,v);a=a.concat(C)}var S=d[parseInt(g.toString(),10)][h.cssClassField],O={type:"resourceHeader",className:["e-resource-cells"],resourceLevelIndex:n,groupOrder:v,resource:h,resourceData:d[parseInt(g.toString(),10)],colSpan:i.parent.activeViewOptions.group.byDate?1:f.length,renderDates:y,workDays:T,cssClass:S,child:m};c.push(O)}}return r[parseInt(n.toString(),10)]||(r[parseInt(n.toString(),10)]=[]),c.length>0&&r[parseInt(n.toString(),10)].push(c),c}return[]};return this.resourceTreeLevel=s(n,0),t?[]:this.generateHeaderLevels(r,a,e)},e.prototype.generateCustomHours=function(e,i,n,r){for(var a=t.extend([],e,null,!0),s=0,o=a;s<o.length;s++){var l=o[s];i&&(l.startHour=this.parent.getStartEndTime(i)),n&&(l.endHour=this.parent.getStartEndTime(n)),r&&(l.groupOrder=r)}return a},e.prototype.generateHeaderLevels=function(e,i,n){for(var r=[],a=e.length-1;a>=0;a--)for(var s=0,o=0,l=e[parseInt(a.toString(),10)];o<l.length;o++)for(var p=0,c=l[o];p<c.length;p++){var h=c[p];if(e[a+1]&&e[a+1].length>0){var d=e[parseInt((a+1).toString(),10)][parseInt(s.toString(),10)];if(!d)continue;for(var u=0,g=0,v=d;g<v.length;g++){var m=v[g];(!this.parent.activeViewOptions.group.byGroupID||this.parent.activeViewOptions.group.byGroupID&&m.resourceData[m.resource.groupIDField]===h.resourceData[h.resource.idField])&&(u+=m.colSpan)}h.colSpan=u}h.groupIndex=s,s++,r[h.resourceLevelIndex]=r[h.resourceLevelIndex]||[],r[h.resourceLevelIndex].push(h)}if(this.lastResourceLevel=r.slice(-1)[0]||[],!this.parent.activeViewOptions.group.byDate){for(var f=0,y=0,T=this.lastResourceLevel;y<T.length;y++)for(var w=T[y],a=0;a<w.colSpan;a++)i[parseInt(f.toString(),10)].groupIndex=w.groupIndex,f++;return r.push(i),r}var D=[],b=t.extend([],r,null,!0),C=[];if(this.parent.activeViewOptions.group.hideNonWorkingDays){for(var S=[],O=0,E=this,x=0,V=n;x<V.length;x++)!function(e){E.resourceDateTree[parseInt(O.toString(),10)]=[];for(var i=[],n=0;n<E.lastResourceLevel.length;n++)!function(n){var r=E.lastResourceLevel[parseInt(n.toString(),10)].resourceData[E.lastResourceLevel[parseInt(n.toString(),10)].resource.workDaysField];if(r||(r=E.parent.activeViewOptions.workDays),-1!==r.indexOf(e.date.getDay())){var a=t.extend({},E.lastResourceLevel[parseInt(n.toString(),10)],null,!0);a.date=e.date,E.lastResourceLevel[parseInt(n.toString(),10)].workDays=r,a.startHour=E.parent.getStartEndTime(a.resourceData[a.resource.startHourField])||e.startHour,a.endHour=E.parent.getStartEndTime(a.resourceData[a.resource.endHourField])||e.endHour,E.resourceDateTree[parseInt(O.toString(),10)].push(a);for(var s=0;s<a.groupOrder.length;s++)!function(r){if(i[parseInt(r.toString(),10)]||(i[parseInt(r.toString(),10)]=[]),r===a.groupOrder.length-1){S[parseInt(n.toString(),10)]||(S[parseInt(n.toString(),10)]=[]);var s=a.renderDates.filter(function(t){return t.getDay()===e.date.getDay()});return S[parseInt(n.toString(),10)]=S[parseInt(n.toString(),10)].concat(s),i[parseInt(r.toString(),10)].push(a),"continue"}var o=b[parseInt(r.toString(),10)].filter(function(e){return e.resourceData[e.resource.idField]===a.groupOrder[parseInt(r.toString(),10)]});if(o&&o.length>0){var l=i[parseInt(r.toString(),10)].filter(function(e){return e.resourceData[e.resource.idField]===a.groupOrder[parseInt(r.toString(),10)]});if(l&&l.length>0)l[0].colSpan+=1;else{var p=t.extend({},o[0],null,!0);p.colSpan=1,i[parseInt(r.toString(),10)].push(p)}}}(s)}}(n);if(i.length>0){for(var r=0;r<b.length;r++)D[parseInt(r.toString(),10)]||(D[parseInt(r.toString(),10)]=[]),D[parseInt(r.toString(),10)]=D[parseInt(r.toString(),10)].concat(i[parseInt(r.toString(),10)]);e.colSpan=i[i.length-1].length,C.push(e)}O++}(H=V[x]);return this.resourceDateTree=this.resourceDateTree.filter(function(e){return e.length>0}),this.lastResourceLevel.forEach(function(e,t){S[parseInt(t.toString(),10)]&&(e.renderDates=S[parseInt(t.toString(),10)].sort(function(e,t){return e.getTime()-t.getTime()}))}),D.unshift(C),D}for(var A=0,I=0,k=b[0];I<k.length;I++)A+=k[I].colSpan;for(var M=0,R=n;M<R.length;M++){var H=R[M];H.colSpan=A,C.push(H);for(var P=t.extend([],b,null,!0),j=0,N=P.length;j<N;j++){if(j===P.length-1)for(var L=0,q=P[parseInt(j.toString(),10)];L<q.length;L++){var F=q[L];F.date=H.date,F.workDays=H.workDays,F.startHour=this.parent.getStartEndTime(F.resourceData[F.resource.startHourField])||H.startHour,F.endHour=this.parent.getStartEndTime(F.resourceData[F.resource.endHourField])||H.endHour}D[parseInt(j.toString(),10)]||(D[parseInt(j.toString(),10)]=[]),D[parseInt(j.toString(),10)]=D[parseInt(j.toString(),10)].concat(P[parseInt(j.toString(),10)])}}return D.unshift(C),D},e.prototype.setResourceValues=function(e,i){var n=this,r=function(t,i,r){n.resourceCollection[parseInt(t.toString(),10)].allowMultiple&&n.parent.activeViewOptions.group.allowGroupEdit?e[""+i]=[r]:e[""+i]=r};if(void 0===i&&(i=this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:this.parent.activeCellsData.groupIndex),this.parent.activeViewOptions.group.resources.length>0&&!t.isNullOrUndefined(i))for(var a=this.lastResourceLevel[parseInt(i.toString(),10)].groupOrder,s=0;s<this.resourceCollection.length;s++)r(s,this.resourceCollection[parseInt(s.toString(),10)].field,a[parseInt(s.toString(),10)]);else if(this.parent.resourceCollection.length>0)for(s=0;s<this.resourceCollection.length;s++){var o=this.resourceCollection[parseInt(s.toString(),10)].dataSource[0];o&&r(s,this.resourceCollection[parseInt(s.toString(),10)].field,o[this.resourceCollection[parseInt(s.toString(),10)].idField])}},e.prototype.getResourceColor=function(e,i){var n=!t.isNullOrUndefined(i)&&this.colorIndex>i.length-1?i.length-1:this.colorIndex,r=this.resourceCollection[parseInt(n.toString(),10)];if(!(t.isNullOrUndefined(i)&&this.parent.activeViewOptions.group.allowGroupEdit&&r.allowMultiple)){var a=t.isNullOrUndefined(i)?e[r.field]:i[parseInt(n.toString(),10)],s=this.filterData(r.dataSource,r.idField,a);return s.length>0?s[0][r.colorField]:void 0}},e.prototype.getCssClass=function(e){var t=this.resourceCollection.slice(-1)[0];if(!this.parent.activeViewOptions.group.allowGroupEdit||!t.allowMultiple){var i=this.filterData(t.dataSource,t.idField,e[t.field]);return i.length>0?i[0][t.cssClassField]:void 0}},e.prototype.getResourceRenderDates=function(){var e=[].concat.apply([],this.lastResourceLevel.map(function(e){return e.renderDates})),t=e.map(function(e){return e.getTime()}),i=function(e){return e.filter(function(e,i){return t.indexOf(e.getTime())===i})}(e);return i.sort(function(e,t){return e.getTime()-t.getTime()}),i},e.prototype.filterData=function(e,t,i){return e.filter(function(e){return e[""+t]===i})},e.prototype.getResourceData=function(e,i,n){if(this.parent.activeViewOptions.group.allowGroupEdit){for(var r={},a=0,s=n;a<s.length;a++)for(var o=s[a],l=this.lastResourceLevel[parseInt(o.toString(),10)].groupOrder,p=0,c=l.length;p<c;p++){var h=this.resourceCollection[parseInt(p.toString(),10)].field;t.isNullOrUndefined(r[""+h])&&(r[""+h]=[]),r[""+h].push(l[parseInt(p.toString(),10)])}e=t.extend(e,r)}else for(var p=0,d=this.resourceCollection.length;p<d;p++)this.lastResourceLevel[parseInt(i.toString(),10)]&&(e[this.resourceCollection[parseInt(p.toString(),10)].field]=this.lastResourceLevel[parseInt(i.toString(),10)].groupOrder[parseInt(p.toString(),10)])},e.prototype.addResource=function(e,t,i){for(var n=e instanceof Array?e:[e],r=0,s=this.parent.resourceCollection;r<s.length&&"break"!==function(e){if(e.name===t)return n.forEach(function(t,n){return new a.DataManager({json:e.dataSource}).insert(t,null,null,i+n)}),"break"}(s[r]);r++);this.refreshLayout(!0)},e.prototype.removeResource=function(e,t){for(var i=e instanceof Array?e:[e],n=0,r=this.parent.resourceCollection;n<r.length&&"break"!==function(e){if(e.name===t)return i.forEach(function(t){return new a.DataManager({json:e.dataSource}).remove(e.idField,t)}),"break"}(r[n]);n++);this.refreshLayout(!0)},e.prototype.getIndexFromResourceId=function(e,i,n,r,a){if(i=i||this.parent.resourceCollection.slice(-1)[0].name,t.isNullOrUndefined(n)&&(n=this.resourceCollection.filter(function(e){return e.name===i})[0],t.isNullOrUndefined(n)))return null;var s=n.dataSource.filter(function(t){return r&&t[n.idField]===e?t[n.groupIDField]===r[""+a]?t[n.idField]===e:null:t[n.idField]===e})[0];return this.lastResourceLevel.map(function(e){return e.resourceData}).indexOf(s)},e.prototype.resourceExpand=function(e,t,i){var n=this.parent.resourceCollection.filter(function(e){return e.name===t?e:null})[0],r=0,a=n.dataSource.filter(function(t){return t[n.idField]===e})[0];r=this.parent.activeViewOptions.group.byGroupID?this.lastResourceLevel.map(function(e){return e.resourceData}).indexOf(a):this.getIndexFromResourceId(e,t,n);var s=this.parent.element.querySelector('.e-resource-column-wrap [data-group-index="'+r+'"] .e-resource-tree-icon');s&&(s.classList.contains("e-resource-expand")&&!i?s.click():s.classList.contains("e-resource-collapse")&&i&&s.click())},e.prototype.resourceScroll=function(e,t){if(!(this.parent.isAdaptive||["Agenda","MonthAgenda"].indexOf(this.parent.currentView)>-1)){var i=t||this.parent.resourceCollection.slice(-1)[0].name,n=this.parent.resourceCollection.length-1,r=this.parent.resourceCollection.filter(function(e,t){return e.name===i?(n=t,e):null})[0],a=this.parent.element.querySelector(".e-content-wrap"),s=0;if(this.parent.activeView.isTimelineView()){if(this.parent.activeViewOptions.group.byGroupID){var o=r.dataSource.filter(function(t){return t[r.idField]===e})[0];s=this.lastResourceLevel.map(function(e){return e.resourceData}).indexOf(o)}else s=this.getIndexFromResourceId(e,i,r);if(this.parent.virtualScrollModule){var l=this.parent.element.querySelector(".e-virtual-track"),p=Math.round(l.offsetHeight/this.expandedResources.length);this.parent.rowAutoHeight&&(a.scrollTop=0,this.parent.virtualScrollModule.virtualScrolling()),a.scrollTop=s*p-(this.parent.virtualScrollModule.bufferCount-1)*p,this.parent.virtualScrollModule.virtualScrolling(),this.parent.rowAutoHeight?(c=this.parent.element.querySelector('.e-work-cells[data-group-index="'+s+'"]'))&&!c.parentElement.classList.contains("e-hidden")&&(a.scrollTop=a.scrollTop<c.offsetTop?c.offsetTop:a.scrollTop+c.offsetTop):a.scrollTop=s*p}else{var c=this.parent.element.querySelector('.e-work-cells[data-group-index="'+s+'"]');c&&!c.parentElement.classList.contains("e-hidden")&&(a.scrollTop=c.offsetTop)}}else{s=this.parent.activeViewOptions.group.byGroupID?i===this.parent.resourceCollection.slice(-1)[0].name?this.lastResourceLevel.map(function(e){return e.resourceData[r.idField]}).indexOf(e):r.dataSource.map(function(e){return e[r.idField]}).indexOf(e):this.getIndexFromResourceId(e,i,r);var h="Month"===this.parent.currentView?this.parent.element.querySelector(".e-date-header-wrap tbody tr:nth-child("+(n+1)+")"):this.parent.element.querySelector(".e-header-row:nth-child("+(n+1)+")"),d=[].slice.call(h.children).map(function(e){return e.offsetLeft});a.scrollLeft=d[parseInt(s.toString(),10)]}}},e.prototype.destroy=function(){if(this.parent.off("document-click",this.documentClick),this.treeViewObj){if(this.treeViewObj.portals&&this.treeViewObj.portals.length>0){var e=this.treeViewObj.portals.map(function(e){return e.propName});e.length>0&&this.parent.resetTemplates(e)}this.treeViewObj.destroy(),this.treeViewObj=null}this.treePopup&&(this.treePopup.destroy(),this.treePopup=null,t.remove(this.parent.element.querySelector(".e-resource-tree-popup")),t.remove(this.parent.element.querySelector(".e-resource-tree-popup-overlay")));var i=this.parent.element.querySelector(".e-schedule-resource-toolbar-container");i&&t.remove(i)},e}(),_i=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Gi=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},Xi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _i(i,e),Gi([t.Property("")],i.prototype,"id",void 0),Gi([t.Property("")],i.prototype,"text",void 0),Gi([t.Property("auto")],i.prototype,"width",void 0),Gi([t.Property("")],i.prototype,"cssClass",void 0),Gi([t.Property(!1)],i.prototype,"showAlwaysInPopup",void 0),Gi([t.Property(!1)],i.prototype,"disabled",void 0),Gi([t.Property("")],i.prototype,"prefixIcon",void 0),Gi([t.Property("")],i.prototype,"suffixIcon",void 0),Gi([t.Property(!0)],i.prototype,"visible",void 0),Gi([t.Property("None")],i.prototype,"overflow",void 0),Gi([t.Property("")],i.prototype,"template",void 0),Gi([t.Property("Button")],i.prototype,"type",void 0),Gi([t.Property("Both")],i.prototype,"showTextOn",void 0),Gi([t.Property(null)],i.prototype,"htmlAttributes",void 0),Gi([t.Property("")],i.prototype,"tooltipText",void 0),Gi([t.Property("Left")],i.prototype,"align",void 0),Gi([t.Property(-1)],i.prototype,"tabIndex",void 0),Gi([t.Property("Custom")],i.prototype,"name",void 0),Gi([t.Event()],i.prototype,"click",void 0),i}(t.ChildProperty),Qi=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ki=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s},Zi=function(e){function n(t,i){var n=e.call(this,t,i)||this;return n.adaptiveGroupIndex=0,n}return Qi(n,e),n.prototype.render=function(){var e=[],n=[];if(e.push($e),this.enableRtl?e.push("e-rtl"):n.push("e-rtl"),this.isAdaptive?e.push("e-device"):n.push("e-device"),this.enableAdaptiveUI?e.push("e-adaptive"):n.push("e-adaptive"),this.allowMultiDrag?e.push("e-multi-drag"):n.push("e-multi-drag"),this.cssClass)for(var r=0,a=this.cssClass.split(" ");r<a.length;r++){var s=a[r];e.push(s)}t.classList(this.element,e,n),this.validateDate(),i.createSpinner({target:this.element}),this.scrollModule=new dt(this),this.scrollModule.setWidth(),this.scrollModule.setHeight(),this.renderModule=new vi(this),this.eventBase=new Lt(this),this.workCellAction=new Ai(this),this.allowKeyboardInteraction&&(this.keyboardInteractionModule=new vt(this)),this.inlineModule=new Yt(this),this.initializeDataModule(),this.renderTableContainer(),this.activeViewOptions=this.getActiveViewOptions(),this.initializeResources(),this.wireEvents()},n.prototype.renderTableContainer=function(){this.element.querySelector("."+tt)||this.element.appendChild(this.createElement("div",{className:tt}))},n.prototype.getEventTemplateName=function(e){var t="eventTemplate_"+e;return this.activeEventTemplates.indexOf(t)<0&&this.activeEventTemplates.push(t),t},n.prototype.getElementWidth=function(e){return B(e,this.uiStateValues.isTransformed)},n.prototype.getElementHeight=function(e){return W(e,this.uiStateValues.isTransformed)},n.prototype.getElementHeightFromClass=function(e,t){return h(e,t,this.uiStateValues.isTransformed)},n.prototype.renderTemplates=function(e){this.isReact?this.renderReactTemplates(e):e&&e()},n.prototype.resetTemplates=function(e){(this.isAngular||this.isReact)&&this.clearTemplate(e)},n.prototype.sanitize=function(e,i){this.enableHtmlSanitizer?i.innerText=t.SanitizeHtmlHelper.sanitize(e):i.innerHTML=e},n.prototype.initializeResources=function(e){void 0===e&&(e=!1),this.resources.length>0?(this.resourceBase=new Yi(this),this.resourceBase.bindResourcesData(e)):(this.resourceBase=null,this.resourceCollection=[],this.renderElements(e))},n.prototype.destroyEditorWindow=function(){this.eventWindow&&(this.eventWindow.destroy(),this.eventWindow=null),this.eventWindow=new ui(this)},n.prototype.renderElements=function(e){if(e)return this.initializeView(this.currentView),void this.eventWindow.refresh();this.destroyHeaderModule(),this.showHeaderBar&&(this.headerModule=new ht(this)),this.renderTableContainer(),this.uiStateValues.isTransformed=Math.round(this.element.getBoundingClientRect().width)!==this.element.offsetWidth,(t.Browser.isDevice||t.Browser.isTouch)&&(this.scheduleTouchModule=new ut(this)),this.initializeView(this.currentView),this.destroyPopups(),this.isPrinting||this.initializePopups()},n.prototype.validateDate=function(e){void 0===e&&(e=this.selectedDate);var i=e instanceof Date?new Date(e.getTime()):new Date(e),n=t.isNullOrUndefined(this.minDate)?new Date(1900,0,1):this.minDate instanceof Date?new Date(this.minDate.getTime()):new Date(this.minDate),r=t.isNullOrUndefined(this.maxDate)?new Date(2099,11,31):this.maxDate instanceof Date?new Date(this.maxDate.getTime()):new Date(this.maxDate);if(!(n<=r))throw Error("minDate should be equal or less than maxDate");i<n&&(i=n),i>r&&(i=r),this.setProperties({selectedDate:new Date(""+i),minDate:new Date(""+n),maxDate:new Date(""+r)},!0),this.eventWindow&&this.eventWindow.updateMinMaxDateToEditor()},n.prototype.getViewIndex=function(e){for(var t=0;t<this.viewCollections.length;t++)if(this.viewCollections[parseInt(t.toString(),10)].option===e)return t;return-1},n.prototype.setViewOptions=function(e){if(void 0===e&&(e=!1),!t.isNullOrUndefined(this.views)&&0!==this.views.length){this.viewOptions={},this.viewCollections=[];var i,n,r=this.viewIndex,a=0;this.viewIndex=-1;for(var s=0,o=this.views;s<o.length;s++){var l=o[s],p="string"!=typeof l;"string"==typeof l?(i=l,this.currentView===i&&(n=i,this.viewIndex=a)):(i=l.option,l.isSelected&&(n=i,this.viewIndex=a));var c=t.extend({option:i},p?l:{}),h=i.charAt(0).toLowerCase()+i.slice(1);c.cellHeaderTemplateName=c.cellHeaderTemplate?c.option:"",c.dateHeaderTemplateName=c.dateHeaderTemplate?c.option:"",c.dateRangeTemplateName=c.dateRangeTemplate?c.option:"",c.cellTemplateName=c.cellTemplate?c.option:"",c.dayHeaderTemplateName=c.dayHeaderTemplate?c.option:"",c.monthHeaderTemplateName=c.monthHeaderTemplate?c.option:"",c.resourceHeaderTemplateName=c.resourceHeaderTemplate?c.option:"",c.headerIndentTemplateName=c.headerIndentTemplate?c.option:"",c.eventTemplateName=c.eventTemplate?c.option:"",t.isNullOrUndefined(c.firstDayOfWeek)||0!==c.firstDayOfWeek||delete c.firstDayOfWeek,t.isNullOrUndefined(c.interval)||1!==c.interval||delete c.interval,this.viewCollections.push(c),t.isNullOrUndefined(this.viewOptions[""+h])?this.viewOptions[""+h]=[c]:this.viewOptions[""+h].push(c),a++}if(!e&&n&&this.setProperties({currentView:n},!0),-1===this.viewIndex){var d=this.getViewIndex(this.currentView);this.viewIndex="string"==typeof this.views[0]||t.isNullOrUndefined(r)||-1===r?-1===d?0:d:r}}},n.prototype.getActiveViewOptions=function(){var e={enable:this.timeScale.enable,interval:this.timeScale.interval,slotCount:this.timeScale.slotCount,majorSlotTemplate:this.timeScale.majorSlotTemplate,minorSlotTemplate:this.timeScale.minorSlotTemplate},i={byDate:!(this.viewCollections[this.viewIndex].option.indexOf("Year")>-1)&&this.group.byDate,byGroupID:this.group.byGroupID,allowGroupEdit:this.group.allowGroupEdit,resources:t.isNullOrUndefined(this.group.resources)?[]:this.group.resources,headerTooltipTemplate:this.group.headerTooltipTemplate,enableCompactView:this.group.enableCompactView,hideNonWorkingDays:["Day","Week","WorkWeek","Month"].indexOf(this.currentView)>-1&&this.group.hideNonWorkingDays},n=this.viewCollections[this.viewIndex].workDays?[]:this.workDays,r={dateFormat:this.dateFormat,endHour:this.endHour,isSelected:!1,option:null,readonly:this.readonly,startHour:this.startHour,allowVirtualScrolling:!1,allowOverlap:this.allowOverlap,overscanCount:this.overscanCount,cellHeaderTemplate:this.cellHeaderTemplate,dayHeaderTemplate:this.dayHeaderTemplate,monthHeaderTemplate:this.monthHeaderTemplate,cellTemplate:this.cellTemplate,eventTemplate:this.eventSettings.template,dateHeaderTemplate:this.dateHeaderTemplate,dateRangeTemplate:this.dateRangeTemplate,resourceHeaderTemplate:this.resourceHeaderTemplate,headerIndentTemplate:this.headerIndentTemplate,firstMonthOfYear:this.firstMonthOfYear,firstDayOfWeek:this.firstDayOfWeek,workDays:n,monthsCount:this.monthsCount,showWeekend:this.showWeekend,showWeekNumber:this.showWeekNumber,displayName:null,interval:1,timeScale:e,timeFormat:this.internalTimeFormat,group:i,headerRows:this.headerRows,orientation:"Horizontal",numberOfWeeks:0,displayDate:null,enableLazyLoading:!1},a=this.viewCollections[this.viewIndex],s=t.extend(r,a,void 0,!0);return 0!==this.firstDayOfWeek&&a.firstDayOfWeek&&this.firstDayOfWeek!==a.firstDayOfWeek&&(s.firstDayOfWeek=this.firstDayOfWeek),s.displayDate&&(s.displayDate=s.displayDate instanceof Date?new Date(s.displayDate.getTime()):new Date(s.displayDate)),s.enableLazyLoading&&!t.isNullOrUndefined(s.group.resources)&&s.group.resources.length>0&&(-1===["Agenda","MonthAgenda","Year","TimelineYear"].indexOf(s.option)||"TimelineYear"===s.option&&"Vertical"===s.orientation)&&(s.allowVirtualScrolling=!0),s},n.prototype.initializeDataModule=function(){this.eventFields={id:this.eventSettings.fields.id,isBlock:this.eventSettings.fields.isBlock,subject:this.eventSettings.fields.subject.name,startTime:this.eventSettings.fields.startTime.name,endTime:this.eventSettings.fields.endTime.name,startTimezone:this.eventSettings.fields.startTimezone.name,endTimezone:this.eventSettings.fields.endTimezone.name,location:this.eventSettings.fields.location.name,description:this.eventSettings.fields.description.name,isAllDay:this.eventSettings.fields.isAllDay.name,recurrenceID:this.eventSettings.fields.recurrenceID.name,recurrenceRule:this.eventSettings.fields.recurrenceRule.name,recurrenceException:this.eventSettings.fields.recurrenceException.name,isReadonly:this.eventSettings.fields.isReadonly,followingID:this.eventSettings.fields.followingID},this.setEditorTitles(),this.dataModule=new mt(this,this.eventSettings.dataSource,this.eventSettings.query),this.crudModule=new Vi(this)},n.prototype.setEditorTitles=function(){this.editorTitles={subject:this.eventSettings.fields.subject.title||this.localeObj.getConstant("title"),startTime:this.eventSettings.fields.startTime.title||this.localeObj.getConstant("start"),endTime:this.eventSettings.fields.endTime.title||this.localeObj.getConstant("end"),isAllDay:this.eventSettings.fields.isAllDay.title||this.localeObj.getConstant("allDay"),startTimezone:this.eventSettings.fields.startTimezone.title||this.localeObj.getConstant("startTimezone"),endTimezone:this.eventSettings.fields.endTimezone.title||this.localeObj.getConstant("endTimezone"),location:this.eventSettings.fields.location.title||this.localeObj.getConstant("location"),description:this.eventSettings.fields.description.title||this.localeObj.getConstant("description"),recurrenceRule:this.eventSettings.fields.recurrenceRule.title||this.localeObj.getConstant("repeat")}},n.prototype.initializeView=function(e){this.showSpinner(),this.activeViewOptions=this.getActiveViewOptions(),this.resourceBase&&this.resourceBase.setResourceCollection(),this.initializeTemplates(),this.renderModule.render(e)},n.prototype.initializeTemplates=function(){this.cellHeaderTemplateFn=this.templateParser(this.activeViewOptions.cellHeaderTemplate),this.dayHeaderTemplateFn=this.templateParser(this.activeViewOptions.dayHeaderTemplate),this.monthHeaderTemplateFn=this.templateParser(this.activeViewOptions.monthHeaderTemplate),this.cellTemplateFn=this.templateParser(this.activeViewOptions.cellTemplate),this.dateHeaderTemplateFn=this.templateParser(this.activeViewOptions.dateHeaderTemplate),this.dateRangeTemplateFn=this.templateParser(this.activeViewOptions.dateRangeTemplate),this.majorSlotTemplateFn=this.templateParser(this.activeViewOptions.timeScale.majorSlotTemplate),this.minorSlotTemplateFn=this.templateParser(this.activeViewOptions.timeScale.minorSlotTemplate),this.appointmentTemplateFn=this.templateParser(this.activeViewOptions.eventTemplate),this.resourceHeaderTemplateFn=this.templateParser(this.activeViewOptions.resourceHeaderTemplate),this.headerIndentTemplateFn=this.templateParser(this.activeViewOptions.headerIndentTemplate),this.headerTooltipTemplateFn=this.templateParser(this.activeViewOptions.group.headerTooltipTemplate),this.eventTooltipTemplateFn=this.templateParser(this.eventSettings.tooltipTemplate),this.editorTemplateFn=this.templateParser(this.editorTemplate),this.editorHeaderTemplateFn=this.templateParser(this.editorHeaderTemplate),this.editorFooterTemplateFn=this.templateParser(this.editorFooterTemplate),this.quickInfoTemplatesHeaderFn=this.templateParser(this.quickInfoTemplates.header),this.quickInfoTemplatesContentFn=this.templateParser(this.quickInfoTemplates.content),this.quickInfoTemplatesFooterFn=this.templateParser(this.quickInfoTemplates.footer)},n.prototype.initializePopups=function(){this.eventWindow=new ui(this),this.quickPopup=new Gt(this)},n.prototype.getDayNames=function(e){var i,n=[],r="";t.isNullOrUndefined(this.locale)||"en"===this.locale||"en-US"===this.locale?(r="days.stand-alone.",i=t.getValue(r+e,t.getDefaultDateObject(this.getCalendarMode()))):(r="main."+this.locale+".dates.calendars."+this.getCalendarMode()+".days.format."+e,i=t.getValue(r,t.cldrData));for(var a=0,s=Object.keys(i);a<s.length;a++){var o=s[a];n.push(t.getValue(o,i))}return n},n.prototype.setCldrTimeFormat=function(){if(!t.isNullOrUndefined(this.timeFormat))return void(this.internalTimeFormat=this.timeFormat);t.isNullOrUndefined(this.locale)||"en"===this.locale||"en-US"===this.locale?this.internalTimeFormat=t.getValue("timeFormats.short",t.getDefaultDateObject(this.getCalendarMode())):this.internalTimeFormat=t.getValue("main."+this.locale+".dates.calendars."+this.getCalendarMode()+".timeFormats.short",t.cldrData)},n.prototype.getCalendarMode=function(){return t.isNullOrUndefined(this.calendarMode)?"gregorian":this.calendarMode.toLowerCase()},n.prototype.getTimeString=function(e){return this.globalize.formatDate(e,{format:this.activeViewOptions.timeFormat,type:"time",calendar:this.getCalendarMode()}).toLocaleUpperCase()},n.prototype.getDateTime=function(e){return e instanceof Date?new Date(e.getTime()):new Date(e)},n.prototype.setCalendarMode=function(){"Islamic"===this.calendarMode?this.calendarUtil=new yt:this.calendarUtil=new ft},n.prototype.changeView=function(e,i,n,r){var a=this;if(t.isNullOrUndefined(r)&&(r=this.getViewIndex(e)),!(!n&&r===this.viewIndex&&this.currentView===e||r<0)){var s=this.activeViewOptions?this.activeViewOptions.option:this.currentView,o={requestType:"viewNavigate",cancel:!1,event:i};this.trigger(We,o,function(t){if(t.cancel)a.currentView=s;else{var n={action:"view",cancel:!1,currentDate:a.selectedDate,previousView:s,currentView:e,viewIndex:r};a.trigger("navigating",n,function(t){if(t.cancel)a.currentView=s;else{var n=["Day","Week","WorkWeek"].indexOf(e)>-1&&["Day","Week","WorkWeek"].indexOf(s)<0;a.uiStateValues.isInitial=n||e.indexOf("Timeline")>-1||e.indexOf("Year")>-1,a.uiStateValues.top=e.indexOf("Timeline")>-1&&s.indexOf("Timeline")<0?0:a.uiStateValues.top,a.viewIndex=t.viewIndex,a.setProperties({currentView:e},!0),a.headerModule&&(a.headerModule.updateActiveView(),a.headerModule.setCalendarDate(a.selectedDate),a.headerModule.setCalendarView()),a.initializeView(a.currentView),a.animateLayout(),o={requestType:"viewNavigate",cancel:!1,event:i},a.trigger("actionComplete",o)}})}})}},n.prototype.changeDate=function(e,t){var i=this,n={requestType:"dateNavigate",cancel:!1,event:t};this.trigger(We,n,function(r){if(!r.cancel){var a={action:"date",cancel:!1,previousDate:i.selectedDate,currentDate:e};i.trigger("navigating",a,function(e){e.cancel||(i.uiStateValues.isInitial=i.activeView.isTimelineView()&&"TimelineYear"!==i.currentView,i.validateDate(e.currentDate),i.headerModule&&i.headerModule.setCalendarDate(e.currentDate),"MonthAgenda"===i.currentView&&i.monthAgendaModule&&(i.monthAgendaModule.monthAgendaDate=new Date(""+i.selectedDate)),i.initializeView(i.currentView),i.animateLayout(),n={requestType:"dateNavigate",cancel:!1,event:t},i.trigger("actionComplete",n))})}})},n.prototype.isMinMaxDate=function(e){void 0===e&&(e=this.selectedDate);var i=t.isNullOrUndefined(this.maxDate)?new Date(2099,11,31):this.maxDate,n=t.isNullOrUndefined(this.minDate)?new Date(1900,0,1):this.minDate;return e.getTime()>=n.getTime()&&e.getTime()<=i.getTime()},n.prototype.isSelectedDate=function(e){return e.setHours(0,0,0,0)===new Date(""+this.selectedDate).setHours(0,0,0,0)},n.prototype.getCurrentTime=function(e){return void 0===e&&(e=new Date),this.timezone?this.tzModule.convert(e,this.tzModule.getLocalTimezoneName(),this.timezone):e},n.prototype.getNavigateView=function(){return this.activeView.isTimelineView()?"TimelineMonth"===this.currentView||"TimelineYear"===this.currentView?"TimelineDay":"Agenda":"Day"},n.prototype.animateLayout=function(){this.activeView.element&&new t.Animation({duration:600,name:"FadeIn",timingFunction:"easeIn"}).animate(this.activeView.element)},n.prototype.requiredModules=function(){var e=[];this.setViewOptions(!0);for(var t=0,i=Object.keys(this.viewOptions);t<i.length;t++){var n=i[t];n="timelineDay"===n||"timelineWeek"===n||"timelineWorkWeek"===n?"timelineViews":n,e.push({member:n,args:[this]})}return this.allowDragAndDrop&&e.push({member:"dragAndDrop",args:[this]}),this.allowResizing&&e.push({member:"resize",args:[this]}),e.push({member:"excelExport",args:[this]}),e.push({member:"iCalendarExport",args:[this]}),e.push({member:"iCalendarImport",args:[this]}),e.push({member:"print",args:[this]}),e},n.prototype.preRender=function(){this.isAdaptive=t.Browser.isDevice||F(),this.globalize=new t.Internationalization(this.locale),this.tzModule=new Tt,(this&&t.isNullOrUndefined(this.uiStateValues)||!this.enablePersistence)&&(this.uiStateValues={expand:!1,isInitial:!0,left:0,top:0,isGroupAdaptive:!1,isIgnoreOccurrence:!1,groupIndex:this.adaptiveGroupIndex,action:!1,isBlock:!1,isCustomMonth:!0,isPreventTimezone:!1,isTransformed:!1}),this.currentTimezoneDate=this.getCurrentTime(),this.activeCellsData={startTime:new Date(this.currentTimezoneDate),endTime:new Date(this.currentTimezoneDate),isAllDay:!1},this.activeEventData={event:void 0,element:void 0},this.getDefaultLocale(),this.localeObj=new t.L10n(this.getModuleName(),this.defaultLocale,this.locale),this.setCldrTimeFormat(),this.setCalendarMode(),this.eventsData=[],this.eventsProcessed=[],this.blockData=[],this.blockProcessed=[],this.resourceCollection=[],this.currentAction=null,this.selectedElements=[],this.activeEventTemplates=[],this.setViewOptions()},n.prototype.getDefaultLocale=function(){this.defaultLocale={day:"Day",week:"Week",workWeek:"Work Week",month:"Month",year:"Year",agenda:"Agenda",weekAgenda:"Week Agenda",workWeekAgenda:"Work Week Agenda",monthAgenda:"Month Agenda",today:"Today",noEvents:"No events",emptyContainer:"There are no events scheduled on this day.",allDay:"All day",start:"Start",end:"End",more:"more",close:"Close",cancel:"Cancel",noTitle:"(No Title)",delete:"Delete",deleteEvent:"Delete Event",deleteMultipleEvent:"Delete Multiple Events",selectedItems:"Items selected",deleteSeries:"Entire Series",edit:"Edit",editSeries:"Entire Series",editEvent:"Edit Event",createEvent:"Create",subject:"Subject",addTitle:"Add title",moreDetails:"More Details",moreEvents:"More Events",save:"Save",editContent:"How would you like to change the appointment in the series?",deleteContent:"Are you sure you want to delete this event?",deleteMultipleContent:"Are you sure you want to delete the selected events?",newEvent:"New Event",title:"Title",location:"Location",description:"Description",timezone:"Timezone",startTimezone:"Start Timezone",endTimezone:"End Timezone",repeat:"Repeat",saveButton:"Save",cancelButton:"Cancel",deleteButton:"Delete",recurrence:"Recurrence",wrongPattern:"The recurrence pattern is not valid.",seriesChangeAlert:"Do you want to cancel the changes made to specific instances of this series and match it to the whole series again?",createError:"The duration of the event must be shorter than how frequently it occurs. Shorten the duration, or change the recurrence pattern in the recurrence event editor.",sameDayAlert:"Two occurrences of the same event cannot occur on the same day.",occurenceAlert:"Cannot reschedule an occurrence of the recurring appointment if it skips over a later occurrence of the same appointment.",editRecurrence:"Edit Recurrence",recurringEvent:"Recurring Event",repeats:"Repeats",alert:"Alert",startEndError:"The selected end date occurs before the start date.",invalidDateError:"The entered date value is invalid.",blockAlert:"Events cannot be scheduled within the blocked time range.",overlapAlert:"Events cannot be scheduled during the chosen time as it overlaps with another event.",ok:"Ok",yes:"Yes",no:"No",of:"of",occurrence:"Occurrence",series:"Series",previous:"Previous",next:"Next",timelineDay:"Timeline Day",timelineWeek:"Timeline Week",timelineWorkWeek:"Timeline Work Week",timelineMonth:"Timeline Month",timelineYear:"Timeline Year",editFollowingEvent:"Following Events",deleteTitle:"Delete Event",editTitle:"Edit Event",beginFrom:"Begin From",endAt:"Ends At",expandAllDaySection:"Expand-all-day-section",collapseAllDaySection:"Collapse-all-day-section",searchTimezone:"Search Timezone",noRecords:"No records found"}},n.prototype.wireEvents=function(){t.EventHandler.add(window,"resize",this.onScheduleResize,this),t.EventHandler.add(window,"orientationchange",this.onScheduleResize,this),t.EventHandler.add(document,t.Browser.touchStartEvent,this.onDocumentClick,this),this.allowClipboard&&t.EventHandler.add(document,"paste",this.onDocumentPaste,this)},n.prototype.removeSelectedClass=function(){for(var e=this.getSelectedCells(),i=0,n=e;i<n.length;i++)n[i].removeAttribute("tabindex");t.removeClass(e,"e-selected-cell"),this.keyboardInteractionModule&&this.keyboardInteractionModule.selectedCells.length>0&&(this.keyboardInteractionModule.selectedCells=[])},n.prototype.addSelectedClass=function(e,i,n){t.addClass(e,"e-selected-cell"),i&&(i.setAttribute("tabindex","0"),i.focus({preventScroll:n||!1}))},n.prototype.selectCell=function(e){this.removeSelectedClass(),this.addSelectedClass([e],e)},n.prototype.getAllDayRow=function(){return this.element.querySelector(".e-all-day-row")},n.prototype.getContentTable=function(){return this.activeView.element.querySelector("."+nt+" tbody")},n.prototype.getTableRows=function(){return[].slice.call(this.element.querySelectorAll("."+nt+" tbody tr:not(.e-hidden)"))},n.prototype.getWorkCellElements=function(){return[].slice.call(this.element.querySelectorAll(".e-work-cells"))},n.prototype.getIndexOfDate=function(e,t){return e.map(Number).indexOf(+t)},n.prototype.isAllDayCell=function(e){return!(!(["Month","TimelineMonth","TimelineYear","MonthAgenda"].indexOf(this.currentView)>-1||e.classList.contains("e-all-day-cells")||e.classList.contains("e-header-cells"))&&this.activeViewOptions.timeScale.enable)||!!(this.activeView.isTimelineView()&&this.activeViewOptions.headerRows.length>0&&"Hour"!==this.activeViewOptions.headerRows.slice(-1)[0].option)},n.prototype.getDateFromElement=function(e){var i;if(t.isNullOrUndefined(e)||(i=e.getAttribute("data-date")),!t.isNullOrUndefined(i)){var n=parseInt(i,10);return new Date(n)}},n.prototype.getTargetElement=function(e,t,i){var n,r=document.elementFromPoint(t,i);return r&&(n=r.closest(e)),n?[n]:null},n.prototype.getCellHeaderTemplate=function(){return this.cellHeaderTemplateFn},n.prototype.getDayHeaderTemplate=function(){return this.dayHeaderTemplateFn},n.prototype.getMonthHeaderTemplate=function(){return this.monthHeaderTemplateFn},n.prototype.getCellTemplate=function(){return this.cellTemplateFn},n.prototype.getDateHeaderTemplate=function(){return this.dateHeaderTemplateFn},n.prototype.getDateRangeTemplate=function(){return this.dateRangeTemplateFn},n.prototype.getMajorSlotTemplate=function(){return this.majorSlotTemplateFn},n.prototype.getMinorSlotTemplate=function(){return this.minorSlotTemplateFn},n.prototype.getAppointmentTemplate=function(){return this.appointmentTemplateFn},n.prototype.getEventTooltipTemplate=function(){return this.eventTooltipTemplateFn},n.prototype.getHeaderTooltipTemplate=function(){return this.headerTooltipTemplateFn},n.prototype.getEditorTemplate=function(){return this.editorTemplateFn},n.prototype.getEditorHeaderTemplate=function(){return this.editorHeaderTemplateFn},n.prototype.getEditorFooterTemplate=function(){return this.editorFooterTemplateFn},n.prototype.getQuickInfoTemplatesHeader=function(){return this.quickInfoTemplatesHeaderFn},n.prototype.getQuickInfoTemplatesContent=function(){return this.quickInfoTemplatesContentFn},n.prototype.getQuickInfoTemplatesFooter=function(){return this.quickInfoTemplatesFooterFn},n.prototype.getResourceHeaderTemplate=function(){return this.resourceHeaderTemplateFn},n.prototype.getHeaderIndentTemplate=function(){return this.headerIndentTemplateFn},n.prototype.getCssProperties=function(){return{border:this.enableRtl?"borderLeftWidth":"borderRightWidth",padding:this.enableRtl?"paddingLeft":"paddingRight",rtlBorder:this.enableRtl?"borderRightWidth":"borderLeftWidth",rtlPadding:this.enableRtl?"paddingRight":"paddingLeft"}},n.prototype.removeNewEventElement=function(){var e=this.element.querySelector(".e-new-event");t.isNullOrUndefined(e)||t.remove(e)},n.prototype.getStartEndTime=function(e){if(!t.isNullOrUndefined(e)&&""!==e){var i=b(new Date(this.currentTimezoneDate)||this.getCurrentTime()),n=e.split(":");return 2===n.length&&i.setHours(parseInt(n[0],10),parseInt(n[1],10),0),i}return null},n.prototype.onDocumentClick=function(e){this.notify("document-click",{event:e})},n.prototype.onDocumentPaste=function(e){this.notify("document-paste",{event:e})},n.prototype.onScheduleResize=function(){if(!(t.isNullOrUndefined(this.activeView)||(this.isAdaptive||q())&&document.activeElement&&(document.activeElement.classList.contains("e-subject")||document.activeElement.classList.contains("e-inline-subject"))||this.uiStateValues.isTapHold))if(this.virtualScrollModule&&this.activeView.isTimelineView()&&this.virtualScrollModule.refreshLayout(),this.activeViewOptions.timeScale.enable&&this.activeView&&this.activeView.highlightCurrentTime(),this.quickPopup&&this.quickPopup.onClosePopup(),R(),"Month"===this.currentView||"Agenda"!==this.currentView&&"MonthAgenda"!==this.currentView&&!this.activeViewOptions.timeScale.enable||this.activeView.isTimelineView()){this.activeView.resetColWidth(),this.notify(Xe,{cssProperties:this.getCssProperties(),isPreventScrollUpdate:!0});var e=!1;if(this.activeViewOptions.enableLazyLoading&&this.virtualScrollModule&&this.virtualScrollModule.isRemoteRefresh&&(e=this.virtualScrollModule.isRemoteRefresh,this.virtualScrollModule.isRemoteRefresh=!1),this.refreshEvents(e),this.virtualScrollModule&&!this.virtualScrollModule.enableTransition){var i=this.element.querySelector(".e-resource-column-wrap"),n=this.element.querySelector(".e-content-wrap");this.virtualScrollModule.enableTransition=!0,t.addClass([n,i],"e-transition")}}else this.notify(Ge,{})},n.prototype.templateParser=function(e){if(e)try{return"function"==typeof e?t.compile(e):document.querySelectorAll(e).length?t.compile(document.querySelector(e).innerHTML.trim()):t.compile(e)}catch(i){return t.compile(e)}},n.prototype.getSelectedCells=function(){return[].slice.call(this.element.querySelectorAll(".e-selected-cell"))},n.prototype.getAnnouncementString=function(e,t){var i;if(this.quickPopup&&this.activeViewOptions.group.resources.length>0){i=this.quickPopup.getResourceText({event:e},"event")+'"s event - '}var n=t||e[this.eventFields.subject]||this.eventSettings.fields.subject.default,r=e[this.eventFields.location]||this.eventSettings.fields.location.default,a=this.globalize.formatDate(e[this.eventFields.startTime],{type:"dateTime",skeleton:"full",calendar:this.getCalendarMode()}),s=this.globalize.formatDate(e[this.eventFields.endTime],{type:"dateTime",skeleton:"full",calendar:this.getCalendarMode()}),o=n+" "+this.localeObj.getConstant("beginFrom")+" "+a+" "+this.localeObj.getConstant("endAt")+" "+s;return i&&(o=i+" "+o),r&&""!==r&&(o=o+" "+this.localeObj.getConstant("location")+" "+r),e[this.eventFields.recurrenceRule]&&""!==e[this.eventFields.recurrenceRule]&&e[this.eventFields.id]===e[this.eventFields.recurrenceID]&&(o=o+" "+this.localeObj.getConstant("recurringEvent")),o},n.prototype.boundaryValidation=function(e,t){var i={left:!1,right:!1,top:!1,bottom:!1},n=this.element.querySelector(".e-content-wrap").getBoundingClientRect();return e<n.top+30+window.pageYOffset&&e>n.top+window.pageYOffset&&(i.top=!0),e>n.bottom-30+window.pageYOffset&&e<n.bottom+window.pageYOffset&&(i.bottom=!0),t<n.left+30+window.pageXOffset&&t>n.left+window.pageXOffset&&(i.left=!0),t>n.right-30+window.pageXOffset&&t<n.right+window.pageXOffset&&(i.right=!0),i},n.prototype.getWeekNumberContent=function(e){var t;if("FirstDay"===this.weekRule){var i=m(e.slice(-1)[0],this.firstDayOfWeek);t=this.globalize.formatNumber(T(i))}else if("FirstFourDayWeek"===this.weekRule){var n=w(r=v(e.slice(-1)[0],this.firstDayOfWeek),m(e.slice(-1)[0],this.firstDayOfWeek));t=this.globalize.formatNumber(T(n))}else if("FirstFullWeek"===this.weekRule){var r=v(e.slice(-1)[0],this.firstDayOfWeek);t=this.globalize.formatNumber(T(r))}return t},n.prototype.renderHeaderIndentTemplate=function(e,i){if(this.activeViewOptions.headerIndentTemplate){var n=this.element.id+"_"+this.activeViewOptions.headerIndentTemplateName+"headerIndentTemplate",r=[].slice.call(this.getHeaderIndentTemplate()(e,this,"headerIndentTemplate",n,!1,void 0,void 0,this.root));t.append(r,i)}},n.prototype.isSpecificResourceEvents=function(){return this.activeViewOptions.group.resources.length>0&&!this.activeViewOptions.group.allowGroupEdit&&!this.rowAutoHeight&&!this.virtualScrollModule&&this.activeViewOptions.group.byGroupID},n.prototype.unWireEvents=function(){t.EventHandler.remove(window,"resize",this.onScheduleResize),t.EventHandler.remove(window,"orientationchange",this.onScheduleResize),t.EventHandler.remove(document,t.Browser.touchStartEvent,this.onDocumentClick),t.EventHandler.remove(document,"paste",this.onDocumentPaste)},n.prototype.getModuleName=function(){return"schedule"},n.prototype.getPersistData=function(){return this.addOnPersist(["currentView","selectedDate","scrollTop","scrollLeft","adaptiveGroupIndex"])},n.prototype.onPropertyChanged=function(e,i){if(!this.isReact||!t.isNullOrUndefined(this.activeView)){for(var n={isRefresh:!1,isResource:!1,isDate:!1,isView:!1,isLayout:!1,isDataManager:!1},r=0,a=Object.keys(e);r<a.length;r++){var s=a[r];switch(s){case"views":this.setViewOptions(),this.headerModule&&this.headerModule.updateItems(),n.isView=!0;break;case"currentView":n.isView=!0;break;case"minDate":case"maxDate":case"selectedDate":n.isDate=!0;break;case"dateFormat":this.activeViewOptions=this.getActiveViewOptions(),this.headerModule&&this.headerModule.updateDateRange();break;case"showHeaderBar":case"toolbarItems":this.destroyHeaderModule(),e.showHeaderBar&&(this.headerModule=new ht(this),this.headerModule.updateDateRange()),this.notify(Xe,{cssProperties:this.getCssProperties()}),this.activeView.isTimelineView()&&this.refreshEvents(!1);break;case"workDays":JSON.stringify(i.workDays)!==JSON.stringify(e.workDays)&&(n.isLayout=!0);break;case"showWeekend":case"startHour":case"endHour":case"workHours":case"readonly":case"headerRows":case"showWeekNumber":case"rowAutoHeight":n.isLayout=!0;break;case"locale":case"calendarMode":this.globalize=new t.Internationalization(this.locale),this.localeObj=new t.L10n(this.getModuleName(),this.defaultLocale,this.locale),this.setCldrTimeFormat(),this.setCalendarMode(),n.isRefresh=!0;break;case"firstDayOfWeek":this.activeViewOptions.firstDayOfWeek=e.firstDayOfWeek,this.eventWindow&&this.eventWindow.refreshRecurrenceEditor(),n.isLayout=!0;break;case"showTimeIndicator":this.activeViewOptions.timeScale.enable&&this.activeView&&this.activeView.highlightCurrentTime();break;case"cellHeaderTemplate":this.activeViewOptions.cellHeaderTemplate=e.cellHeaderTemplate,this.cellHeaderTemplateFn=this.templateParser(this.activeViewOptions.cellHeaderTemplate),n.isLayout=!0;break;case"cellTemplate":this.activeViewOptions.cellTemplate=e.cellTemplate,this.cellTemplateFn=this.templateParser(this.activeViewOptions.cellTemplate),n.isLayout=!0;break;case"dateHeaderTemplate":this.activeViewOptions.dateHeaderTemplate=e.dateHeaderTemplate,this.dateHeaderTemplateFn=this.templateParser(this.activeViewOptions.dateHeaderTemplate),n.isLayout=!0;break;case"dateRangeTemplate":this.activeViewOptions.dateRangeTemplate=e.dateRangeTemplate,this.dateRangeTemplateFn=this.templateParser(this.activeViewOptions.dateRangeTemplate),this.headerModule&&this.headerModule.updateDateRange();break;case"dayHeaderTemplate":this.activeViewOptions.dayHeaderTemplate=e.dayHeaderTemplate,this.dayHeaderTemplateFn=this.templateParser(this.activeViewOptions.dayHeaderTemplate),n.isLayout=!0;break;case"monthHeaderTemplate":this.activeViewOptions.monthHeaderTemplate=e.monthHeaderTemplate,this.monthHeaderTemplateFn=this.templateParser(this.activeViewOptions.monthHeaderTemplate),n.isLayout=!0;break;case"resourceHeaderTemplate":this.activeViewOptions.resourceHeaderTemplate=e.resourceHeaderTemplate,this.resourceHeaderTemplateFn=this.templateParser(this.activeViewOptions.resourceHeaderTemplate),n.isLayout=!0;break;case"timezone":this.eventBase.timezonePropertyChange(i.timezone),this.headerModule&&this.headerModule.setCalendarTimezone();break;case"enableRtl":this.setRtlClass(),n.isRefresh=!0;break;default:this.extendedPropertyChange(s,e,i,n)}}this.propertyChangeAction(n)}},n.prototype.propertyChangeAction=function(e){e.isRefresh?this.refresh():e.isResource?this.initializeResources(!0):e.isView?this.changeView(this.currentView,null,!0):e.isDate?(t.isNullOrUndefined(this.selectedDate)&&this.setProperties({selectedDate:this.getCurrentTime()},!0),this.changeDate(this.selectedDate)):e.isLayout?(this.activeCellsData=null,this.initializeView(this.currentView)):e.isDataManager&&this.crudModule&&(this.dragAndDropModule&&(this.dragAndDropModule.actionObj.action="",t.removeClass([this.element],"e-event-action")),this.crudModule.refreshDataManager())},n.prototype.allDayRowScrollUpdate=function(){var e=this.element.querySelector(".e-date-header-wrap"),i=this.element.querySelector(".e-all-day-row");if("auto"!==this.height&&this.enableAllDayScroll)e.classList.contains("e-all-day-auto")&&t.removeClass([e],"e-all-day-auto"),this.eventBase.allDayExpandScroll(e);else if(t.addClass([e],"e-all-day-auto"),e.classList.contains("e-all-day-scroll")&&t.removeClass([e],"e-all-day-scroll"),this.uiStateValues.expand){var n=[].slice.call(this.element.querySelectorAll(".e-all-day-cells"));n[0].style.height=i.style.height?i.style.height:n[1].style.height}this.uiStateValues.expand||(i.style.height="")},n.prototype.extendedPropertyChange=function(e,i,n,r){switch(e){case"width":case"height":case"enableAllDayScroll":["Day","Week","WorkWeek"].indexOf(this.currentView)>-1&&this.allDayRowScrollUpdate(),this.notify("ui-update",{module:"scroll",properties:{width:i.width,height:i.height}});break;case"cssClass":n.cssClass&&t.removeClass([this.element],n.cssClass.split(" ")),i.cssClass&&t.addClass([this.element],i.cssClass.split(" "));break;case"hideEmptyAgendaDays":case"agendaDaysCount":this.activeViewOptions=this.getActiveViewOptions(),r.isView=!0;break;case"eventSettings":this.onEventSettingsPropertyChanged(i.eventSettings,n.eventSettings,r);break;case"allowKeyboardInteraction":case"allowClipboard":this.keyboardInteractionModule&&(this.keyboardInteractionModule.destroy(),this.keyboardInteractionModule=null),(i.allowKeyboardInteraction||i.allowClipboard)&&(this.keyboardInteractionModule=new vt(this)),"allowClipboard"===e&&(i.allowClipboard?t.EventHandler.add(document,"paste",this.onDocumentPaste,this):t.EventHandler.remove(document,"paste",this.onDocumentPaste));break;case"timezoneDataSource":this.eventWindow&&this.eventWindow.refresh();break;case"editorTemplate":t.isNullOrUndefined(this.editorTemplate)||(this.editorTemplateFn=this.templateParser(this.editorTemplate)),this.eventWindow&&this.eventWindow.setDialogContent();break;case"editorHeaderTemplate":t.isNullOrUndefined(this.editorHeaderTemplate)||(this.editorHeaderTemplateFn=this.templateParser(this.editorHeaderTemplate)),this.eventWindow&&this.eventWindow.setDialogHeader();break;case"editorFooterTemplate":t.isNullOrUndefined(this.editorFooterTemplate)||(this.editorFooterTemplateFn=this.templateParser(this.editorFooterTemplate)),this.eventWindow&&this.eventWindow.setDialogFooter();break;case"quickInfoTemplates":this.quickInfoTemplates.header&&(this.quickInfoTemplatesHeaderFn=this.templateParser(this.quickInfoTemplates.header)),this.quickInfoTemplates.content&&(this.quickInfoTemplatesContentFn=this.templateParser(this.quickInfoTemplates.content)),this.quickInfoTemplates.footer&&(this.quickInfoTemplatesFooterFn=this.templateParser(this.quickInfoTemplates.footer));break;case"group":this.onGroupSettingsPropertyChanged(i.group,n.group,r);break;case"resources":r.isResource=!0;break;case"timeScale":this.activeViewOptions.timeScale.interval=i.timeScale.interval||this.activeViewOptions.timeScale.interval,this.activeViewOptions.timeScale.slotCount=i.timeScale.slotCount||this.activeViewOptions.timeScale.slotCount,this.eventWindow&&this.eventWindow.refreshDateTimePicker(),r.isLayout=!0;break;case"allowDragAndDrop":case"allowResizing":case"eventDragArea":case"allowOverlap":this.refreshEvents(!1);break;case"weekRule":r.isLayout=!0;break;case"firstMonthOfYear":this.activeViewOptions.firstMonthOfYear=i.firstMonthOfYear,this.viewIndex=this.activeView.viewIndex,r.isLayout=!0;break;case"monthsCount":this.activeViewOptions.monthsCount=i.monthsCount,this.viewIndex=this.activeView.viewIndex,r.isLayout=!0;break;case"timeFormat":this.internalTimeFormat=i.timeFormat||this.activeViewOptions.timeFormat,this.eventWindow&&this.eventWindow.refreshDateTimePicker(),r.isLayout=!0;break;case"enableAdaptiveUI":this.showHeaderBar&&this.headerModule&&(this.destroyHeaderModule(),this.headerModule=new ht(this),this.headerModule.updateDateRange()),r.isLayout=!0;break;case"headerIndentTemplate":this.activeViewOptions.headerIndentTemplate=i.headerIndentTemplate,this.headerIndentTemplateFn=this.templateParser(this.activeViewOptions.headerIndentTemplate),r.isLayout=!0}},n.prototype.setRtlClass=function(){this.enableRtl?t.addClass([this.element],"e-rtl"):t.removeClass([this.element],"e-rtl")},n.prototype.onGroupSettingsPropertyChanged=function(e,t,i){for(var n=0,r=Object.keys(e);n<r.length;n++)"headerTooltipTemplate"===r[n]?this.headerTooltipTemplateFn=this.templateParser(e.headerTooltipTemplate):(i.isLayout=!0,this.eventWindow&&this.eventWindow.refresh())},n.prototype.onEventSettingsPropertyChanged=function(e,t,i){for(var n=0,r=Object.keys(e);n<r.length;n++)switch(r[n]){case"dataSource":case"query":case"fields":case"includeFiltersInQuery":this.initializeDataModule(),i.isDataManager=!0;break;case"template":this.activeViewOptions.eventTemplate=e.template,this.appointmentTemplateFn=this.templateParser(this.activeViewOptions.eventTemplate),i.isDataManager=!0;break;case"enableTooltip":this.eventTooltip&&(this.eventTooltip.destroy(),this.eventTooltip=null),e.enableTooltip&&(this.eventTooltip=new Xt(this));break;case"tooltipTemplate":this.eventTooltipTemplateFn=this.templateParser(this.eventSettings.tooltipTemplate);break;case"resourceColorField":this.resourceBase&&this.resourceBase.setResourceCollection(),i.isDataManager=!0;break;case"editFollowingEvents":this.quickPopup&&this.quickPopup.refreshQuickDialog();break;case"allowAdding":case"allowEditing":case"allowDeleting":this.showHeaderBar&&this.headerModule&&this.headerModule.updateAddIcon(),this.eventWindow&&this.eventWindow.refresh();break;case"spannedEventPlacement":case"minimumEventDuration":case"enableMaxHeight":case"enableIndicator":this.refreshEvents(!1);break;case"ignoreWhitespace":i.isLayout=!0}},n.prototype.destroyHeaderModule=function(){this.headerModule&&(this.headerModule.destroy(),this.headerModule=null)},n.prototype.destroyPopups=function(){this.quickPopup&&(this.quickPopup.destroy(),this.quickPopup=null),this.eventWindow&&(this.eventWindow.destroy(),this.eventWindow=null)},n.prototype.showSpinner=function(){i.showSpinner(this.element)},n.prototype.hideSpinner=function(){i.hideSpinner(this.element)},n.prototype.setWorkHours=function(e,i,n,r){var a=[];a=this.getWorkHourCells(e,i,n,r),t.addClass(a,"e-work-hours")},n.prototype.resetWorkHours=function(e,i,n,r){if(void 0===e&&(e=this.activeView.renderDates),e&&i&&n){var a=this.getWorkHourCells(e,i,n,r);t.removeClass(a,"e-work-hours")}else{var s=[].slice.call(this.element.querySelectorAll(".e-work-hours"));t.removeClass(s,"e-work-hours")}},n.prototype.getWorkHourCells=function(e,i,n,r){if(["Agenda","MonthAgenda","Month","TimelineMonth"].indexOf(this.currentView)>-1)return[];var a=this.getStartEndTime(i),s=this.getStartEndTime(n),o=this.getContentTable();if(t.isNullOrUndefined(a)||t.isNullOrUndefined(s)||!o)return[];a.setMilliseconds(0),s.setMilliseconds(0);var l=this.activeView.getStartHour();a<l&&(a=l);var p=this.activeView.getEndHour();s>p&&(s=p);for(var c=this.activeViewOptions.timeScale.interval*Ke/this.activeViewOptions.timeScale.slotCount,h=(l.getTimezoneOffset()-a.getTimezoneOffset())*Ke,d=Math.abs((l.getTimezoneOffset()-s.getTimezoneOffset())*Ke),u=Math.round((a.getTime()-l.getTime()+h)/c),g=Math.ceil((s.getTime()-l.getTime()-d)/c),v=u,m=g,f=[],y=0,T=e;y<T.length;y++){var w=T[y];b(w=this.getDateTime(w));var D=this.activeView.renderDates;t.isNullOrUndefined(r)||!this.resourceBase||this.activeView.isTimelineView()||(D=this.resourceBase.lastResourceLevel[parseInt(r.toString(),10)].renderDates);var C=this.getIndexOfDate(D,w);if(C>=0){if(this.activeView.isTimelineView()){var S=Math.round((p.getTime()-l.getTime())/c);u=v+C*S,g=m+C*S}for(var O=u;O<g;O++)if(this.activeView.isTimelineView()){var E=t.isNullOrUndefined(r)?0:r;f.push(o.rows[parseInt(E.toString(),10)].cells[parseInt(O.toString(),10)])}else if(t.isNullOrUndefined(r))f.push(o.rows[parseInt(O.toString(),10)].cells[parseInt(C.toString(),10)]);else{var x='.e-work-cells[data-group-index="'+r+'"]',V=[].slice.call(o.rows[parseInt(O.toString(),10)].querySelectorAll(x));f.push(V[parseInt(C.toString(),10)])}}}return f},n.prototype.getCellDetails=function(e){var i=e instanceof Array?e:[e],n=t.getElement(i[0]),r=t.getElement(i.slice(-1)[0]),a=this.getDateFromElement(n),s=this.getDateFromElement(r);if(!t.isNullOrUndefined(a)&&!t.isNullOrUndefined(s)){var o=this.activeView.isTimelineView()&&!t.isNullOrUndefined(r.getAttribute("colSpan"))&&this.headerRows.length>0,l=o?parseInt(r.getAttribute("colSpan"),10):1,p={startTime:a,endTime:s=!this.activeViewOptions.timeScale.enable||o||r.classList.contains("e-all-day-cells")||r.classList.contains("e-header-cells")?O(new Date(s.getTime()),l):this.activeView.getEndDateFromStartDate(s),isAllDay:this.isAllDayCell(n),element:e},c=n.getAttribute("data-group-index");return t.isNullOrUndefined(c)||(p.groupIndex=parseInt(c,10)),p}},n.prototype.getSelectedElements=function(){return this.keyboardInteractionModule&&this.keyboardInteractionModule.selectedCells.length>0?this.keyboardInteractionModule.selectedCells:this.getSelectedCells()},n.prototype.getResourceCollections=function(){return this.resourceCollection},n.prototype.setResourceCollections=function(e,t){void 0===t&&(t=!0),!t&&this.uiStateValues&&(this.uiStateValues.isPreventEventRefresh=!0),this.setProperties({resources:e},!1)},n.prototype.changeCurrentView=function(e,t){var i=this.getViewIndex(e),n=e.charAt(0).toLowerCase()+e.slice(1),r=this.viewOptions[""+n];r&&(i=this.viewCollections.indexOf(r[t||0])),-1!==i&&i!==this.viewIndex&&this.changeView(e,null,null,i)},n.prototype.getCurrentViewIndex=function(){return this.viewIndex},n.prototype.getResourcesByIndex=function(e){if(this.resourceBase&&this.resourceBase.lastResourceLevel){if(e<0||e>=this.resourceBase.lastResourceLevel.length)return;var t=this.resourceBase.lastResourceLevel[parseInt(e.toString(),10)],i={};return this.resourceBase.setResourceValues(i,e),{resource:t.resource,resourceData:t.resourceData,groupData:i}}},n.prototype.expandResource=function(e,t){this.activeView.isTimelineView()&&this.resourceBase&&this.resourceCollection.length>1&&this.resourceBase.resourceExpand(e,t,!1)},n.prototype.collapseResource=function(e,t){this.activeView.isTimelineView()&&this.resourceBase&&this.resourceCollection.length>1&&this.resourceBase.resourceExpand(e,t,!0)},n.prototype.scrollTo=function(e,i){this.currentView.indexOf("Agenda")<0&&t.isNullOrUndefined(this.element.querySelector(".e-work-cells"))||(this.activeView.scrollToDate&&t.isNullOrUndefined(e)&&i?this.activeView.scrollToDate(i):this.activeView.scrollToHour&&this.activeView.scrollToHour(e,i))},n.prototype.scrollToResource=function(e,t){this.resourceBase&&this.resourceBase.lastResourceLevel&&this.resourceBase.resourceScroll(e,t)},n.prototype.exportToICalendar=function(e,t){if(!this.iCalendarExportModule)throw console.warn('[WARNING] :: Module "ICalendarExport" is not available in Schedule component! You either misspelled the module name or forgot to load it.'),Error("Inject ICalendarExport module");this.iCalendarExportModule.initializeCalendarExport(e,t)},n.prototype.importICalendar=function(e){if(!this.iCalendarImportModule)throw console.warn('[WARNING] :: Module "ICalendarImport" is not available in Schedule component! You either misspelled the module name or forgot to load it.'),Error("Inject ICalendarImport module");this.iCalendarImportModule.initializeCalendarImport(e)},n.prototype.addEvent=function(e){this.crudModule.addEvent(e)},n.prototype.generateEventOccurrences=function(e,t){return this.eventBase?this.eventBase.generateOccurrence(e,t):[]},n.prototype.exportToExcel=function(e){if(!this.excelExportModule)throw console.warn('[WARNING] :: Module "ExcelExport" is not available in Schedule component! You either misspelled the module name or forgot to load it.'),Error("Inject ExcelExport module");this.excelExportModule.initializeExcelExport(e)},n.prototype.print=function(e){if(!this.printModule)throw console.warn('[WARNING] :: Module "Print" is not available in Schedule component! You either misspelled the module name or forgot to load it.'),Error("Inject Print module");this.printModule.print(e)},n.prototype.saveEvent=function(e,t){this.crudModule.saveEvent(e,t)},n.prototype.deleteEvent=function(e,t){this.crudModule.deleteEvent(e,t)},n.prototype.getEvents=function(e,t,i){var n=[];return n=i?this.eventBase.getProcessedEvents():this.eventsData,e&&(e=this.getDateTime(e)),t&&(t=this.getDateTime(t)),n=this.eventBase.filterEventsByRange(n,e,t)},n.prototype.getBlockEvents=function(e,t,i){var n=[];return n=i?this.eventBase.getProcessedEvents(this.blockData):this.blockData,e&&(e=this.getDateTime(e)),t&&(t=this.getDateTime(t)),n=this.eventBase.filterEventsByRange(n,e,t)},n.prototype.getOccurrencesByID=function(e){return this.eventBase.getOccurrencesByID(e)},n.prototype.getOccurrencesByRange=function(e,t){return e=this.getDateTime(e),t=this.getDateTime(t),this.eventBase.getOccurrencesByRange(e,t)},n.prototype.getCurrentViewDates=function(){return this.activeView?this.activeView.renderDates:[]},n.prototype.setRecurrenceEditor=function(e){this.eventWindow.setRecurrenceEditor(e)},n.prototype.getEventMaxID=function(){return this.eventBase.getEventMaxID()},n.prototype.getDeletedOccurrences=function(e){return this.eventBase.getDeletedOccurrences(e)},n.prototype.getCurrentViewEvents=function(){return this.eventsProcessed},n.prototype.refreshEvents=function(e){void 0===e&&(e=!0),e?(this.dragAndDropModule&&(this.dragAndDropModule.actionObj.action="",t.removeClass([this.element],"e-event-action")),this.crudModule.refreshDataManager()):(this.uiStateValues&&(this.uiStateValues.isPreventTimezone=!0),this.crudModule&&this.crudModule.refreshProcessedData(),this.uiStateValues&&(this.uiStateValues.isPreventTimezone=!1))},n.prototype.refreshTemplates=function(e){switch(e?this.resetTemplates([e]):this.resetTemplates(),e){case"eventTemplate":this.appointmentTemplateFn=this.templateParser(this.activeViewOptions.eventTemplate),this.refreshEvents(!1);break;case"dateHeaderTemplate":this.dateHeaderTemplateFn=this.templateParser(this.activeViewOptions.dateHeaderTemplate),this.activeView.refreshHeader();break;case"dateRangeTemplate":this.dateRangeTemplateFn=this.templateParser(this.activeViewOptions.dateRangeTemplate),this.headerModule&&this.headerModule.refresh();break;case"resourceHeaderTemplate":this.resourceHeaderTemplateFn=this.templateParser(this.activeViewOptions.resourceHeaderTemplate),this.activeView.isTimelineView()?this.activeView.refreshResourceHeader():this.activeView.refreshHeader();break;case"quickInfoTemplates":this.quickPopup&&(this.quickPopup.destroy(),this.quickPopup=null),this.quickPopup=new Gt(this),this.quickInfoTemplatesHeaderFn=this.templateParser(this.quickInfoTemplates.header),this.quickInfoTemplatesContentFn=this.templateParser(this.quickInfoTemplates.content),this.quickInfoTemplatesFooterFn=this.templateParser(this.quickInfoTemplates.footer);break;case"editorTemplate":this.destroyEditorWindow(),this.editorTemplateFn=this.templateParser(this.editorTemplate);break;case"editorHeaderTemplate":this.destroyEditorWindow(),this.editorHeaderTemplateFn=this.templateParser(this.editorHeaderTemplate);break;case"editorFooterTemplate":this.destroyEditorWindow(),this.editorFooterTemplateFn=this.templateParser(this.editorFooterTemplate);break;case"tooltipTemplate":case"headerTooltipTemplate":this.eventTooltip&&(this.eventTooltip.destroy(),this.eventTooltip=null),this.eventTooltip=new Xt(this),this.eventTooltipTemplateFn=this.templateParser(this.eventSettings.tooltipTemplate),this.headerTooltipTemplateFn=this.templateParser(this.activeViewOptions.group.headerTooltipTemplate);break;default:this.initializeView(this.currentView)}},n.prototype.refreshLayout=function(){this.onScheduleResize(),this.headerModule&&this.headerModule.refresh(),this.eventWindow&&this.eventWindow.refresh()},n.prototype.getEventDetails=function(e){var i=(e=t.getElement(e)).getAttribute("data-guid");return i?this.eventBase.getEventByGuid(i):{}},n.prototype.isSlotAvailable=function(e,i,n){var r,a,s=this,o=this.activeEventData.event;if(e instanceof Date||"string"==typeof e?(r=e,a=i):(o=e,r=e[this.eventFields.startTime],a=e[this.eventFields.endTime],this.resourceBase&&(n=this.eventBase.getGroupIndexFromEvent(e))),t.isNullOrUndefined(r)||t.isNullOrUndefined(a))return!0;r=this.getDateTime(r),a=this.getDateTime(a);var l=this.eventBase.filterEvents(r,a);return!t.isNullOrUndefined(n)&&this.resourceBase&&this.resourceBase.lastResourceLevel.length>0&&(l=this.eventBase.filterEventsByResource(this.resourceBase.lastResourceLevel[parseInt(n.toString(),10)],l)),o&&(l=o.Guid?l.filter(function(e){return e.Guid!==o.Guid}):l.filter(function(e){return e[s.eventFields.id]!==o[s.eventFields.id]})),!(l.length>0)},n.prototype.copy=function(e){this.processCutCopyActions(e,!1)},n.prototype.cut=function(e){this.processCutCopyActions(e,!0)},n.prototype.paste=function(e){var i=this;if(this.allowClipboard&&this.allowKeyboardInteraction&&e&&(e.classList.contains("e-work-cells")||e.classList.contains("e-all-day-cells"))){if(!this.activeCellsData){var n=this.getCellDetails([e]);n&&(this.activeCellsData=n)}var r=new DataTransfer;t.isNullOrUndefined(navigator.clipboard)||navigator.clipboard.readText().then(function(t){r.setData("text/plain",t);var n=new ClipboardEvent("paste",{bubbles:!0,cancelable:!0});Object.defineProperty(n,"clipboardData",{value:r}),i.keyboardInteractionModule.pasteHandler(n,e)}).catch(function(e){throw e})}},n.prototype.processCutCopyActions=function(e,t){var i=this;if(e&&this.allowClipboard&&this.allowKeyboardInteraction){var n=[];e.forEach(function(e){if(e.classList.contains("e-appointment")){var t=i.getEventDetails(e);t&&n.push(t)}}),n.length>0&&this.keyboardInteractionModule.processClipboardAction(t,n)}},n.prototype.openEditor=function(e,i,n,r){"Add"!==i||n?(e[this.eventFields.startTime]=this.getDateTime(e[this.eventFields.startTime]),e[this.eventFields.endTime]=this.getDateTime(e[this.eventFields.endTime])):(e.startTime=this.getDateTime(e.startTime),e.endTime=this.getDateTime(e.endTime),t.isNullOrUndefined(e.element)||(e.element=t.getElement(e.element))),this.currentAction=i,"Add"!==i&&(this.activeEventData.event=e),this.eventWindow.openEditor(e,i,n,r)},n.prototype.closeEditor=function(){this.eventWindow&&this.eventWindow.dialogClose()},n.prototype.openQuickInfoPopup=function(e){var i=this;if("Year"!==this.currentView&&!t.isNullOrUndefined(e))if(t.isNullOrUndefined(e[this.eventFields.id])){if("Agenda"===this.currentView||"MonthAgenda"===this.currentView||t.isNullOrUndefined(this.activeView))return;var n={startTime:this.activeCellsData.startTime=this.getDateTime(e[this.eventFields.startTime]),endTime:this.activeCellsData.endTime=this.getDateTime(e[this.eventFields.endTime]),isAllDay:this.activeCellsData.isAllDay=!t.isNullOrUndefined(e[this.eventFields.isAllDay])&&e[this.eventFields.isAllDay]},r=this.activeView.getAdjustedDate(new Date(n.startTime));if(r){var a='.e-work-cells[data-date="'+r.getTime()+'"]';this.activeViewOptions.group.resources.length>0&&!this.uiStateValues.isGroupAdaptive&&this.resourceBase&&this.eventBase&&(n.groupIndex=this.eventBase.getGroupIndexFromEvent(e),a='.e-work-cells[data-date="'+r.getTime()+'"][data-group-index="'+n.groupIndex+'"]');var s=this.element.querySelector(a);s&&(s.focus(),n.element=s,this.notify("cellClick",n))}}else{var o=this.getCurrentViewEvents().filter(function(t){return e[i.eventFields.id]===t[i.eventFields.id]});if(o.length<=0)return;var l=o[0];if(e[this.eventFields.recurrenceRule]){var p=o.filter(function(t){return t[i.eventFields.startTime].getTime()===e[i.eventFields.startTime].getTime()});p.length>0&&(l=p[0])}var c=this.element.querySelector('div[data-guid="'+l.Guid+'"]');c&&(this.eventBase.removeSelectedAppointmentClass(),this.eventBase.addSelectedAppointments([c],!1),this.activeEventData={event:l,element:c},"Agenda"!==this.currentView&&"MonthAgenda"!==this.currentView||t.addClass([this.activeEventData.element],"e-active-appointment-agenda"),this.notify("eventClick",this.activeEventData))}},n.prototype.closeQuickInfoPopup=function(){this.quickPopup&&this.quickPopup.quickPopupHide(!0)},n.prototype.openOverlapAlert=function(e){var t=this;if(this.quickPopup){var i={type:"OverlapAlert",cancel:!1,element:this.quickPopup.quickDialog.element,data:e.data,overlapEvents:e.overlapEvents};this.trigger("popupOpen",i,function(i){i.cancel||t.quickPopup.openValidationError("overlapAlert",e.data)})}},n.prototype.closeOverlapAlert=function(){var e=this;if(this.quickPopup){var t={type:"OverlapAlert",cancel:!1,data:this.activeEventData.event,element:this.quickPopup.quickDialog.element};this.trigger("popupClose",t,function(t){t.cancel||e.quickPopup.quickDialog.hide()})}},n.prototype.closeTooltip=function(){this.eventTooltip&&this.eventTooltip.close()},n.prototype.getDateRangeText=function(e){return t.isNullOrUndefined(e)&&0===e.length||!this.activeView?"":this.activeView.getDateRangeText(e[0],e)},n.prototype.getViewDates=function(e){if(void 0===e&&(e="Current"),!this.activeView)return[];switch(e){case"Previous":case"Next":return this.activeView.getRenderDates(void 0,this.activeView.getNextPreviousDate(e));case"Current":return this.getCurrentViewDates()}},n.prototype.selectResourceByIndex=function(e){this.resourceBase&&this.uiStateValues.isGroupAdaptive&&this.resourceBase.selectResourceByIndex(e)},n.prototype.getIndexFromResourceId=function(e,t){return this.resourceBase?this.resourceBase.getIndexFromResourceId(e,t):null},n.prototype.addResource=function(e,t,i){this.resourceBase.addResource(e,t,i)},n.prototype.removeResource=function(e,t){this.resourceBase.removeResource(e,t)},n.prototype.destroy=function(){this.eventTooltip&&(this.eventTooltip.destroy(),this.eventTooltip=null),this.destroyPopups(),this.hideSpinner(),this.unWireEvents(),this.destroyHeaderModule(),this.eventBase&&(this.eventBase.destroy(),this.eventBase=null),this.workCellAction&&(this.workCellAction.destroy(),this.workCellAction=null),this.inlineModule&&(this.inlineModule.destroy(),this.inlineModule=null),this.keyboardInteractionModule&&(this.keyboardInteractionModule.destroy(),this.keyboardInteractionModule=null),this.scrollModule&&(this.scrollModule.destroy(),this.scrollModule=null),this.printModule&&this.printModule.destroy(),this.activeView&&(this.resetTemplates(),this.activeView.removeEventListener(),this.activeView.destroy(),this.activeView=null),this.scheduleTouchModule&&(this.scheduleTouchModule.destroy(),this.scheduleTouchModule=null),this.crudModule&&(this.crudModule.destroy(),this.crudModule=null),this.dataModule&&(this.dataModule.destroy(),this.dataModule=null),e.prototype.destroy.call(this);for(var i=0,n=["dayModule","weekModule","workWeekModule","monthModule","monthAgendaModule","yearModule","agendaModule","timelineViewsModule","timelineMonthModule","timelineYearModule","resizeModule","dragAndDropModule","excelExportModule","printModule","iCalendarExportModule","iCalendarImportModule","tzModule","eventsData","eventsProcessed","blockData","blockProcessed","uiStateValues","viewCollections","viewOptions","defaultLocale","localeObj","selectedElements","resourceCollection","editorTitles","eventFields","activeViewOptions","activeEventData","activeCellsData","renderModule"];i<n.length;i++)this[""+n[i]]=null;j(this.element);var r=[$e,"e-rtl","e-device","e-multi-drag"];this.cssClass&&(r=r.concat(this.cssClass.split(" "))),t.removeClass([this.element],r)},Ki([t.Property("auto")],n.prototype,"width",void 0),Ki([t.Property("auto")],n.prototype,"height",void 0),Ki([t.Property(!0)],n.prototype,"showHeaderBar",void 0),Ki([t.Property(!0)],n.prototype,"showTimeIndicator",void 0),Ki([t.Property(!0)],n.prototype,"allowSwiping",void 0),Ki([t.Property(!0)],n.prototype,"allowOverlap",void 0),Ki([t.Property(3)],n.prototype,"overscanCount",void 0),Ki([t.Collection([],Xi)],n.prototype,"toolbarItems",void 0),Ki([t.Property("Week")],n.prototype,"currentView",void 0),Ki([t.Property(["Day","Week","WorkWeek","Month","Agenda"])],n.prototype,"views",void 0),Ki([t.Property(new Date)],n.prototype,"selectedDate",void 0),Ki([t.Property(new Date(1900,0,1))],n.prototype,"minDate",void 0),Ki([t.Property(new Date(2099,11,31))],n.prototype,"maxDate",void 0),Ki([t.Property()],n.prototype,"dateFormat",void 0),Ki([t.Property("Gregorian")],n.prototype,"calendarMode",void 0),Ki([t.Property(!0)],n.prototype,"showWeekend",void 0),Ki([t.Property(0)],n.prototype,"firstDayOfWeek",void 0),Ki([t.Property("FirstDay")],n.prototype,"weekRule",void 0),Ki([t.Property([1,2,3,4,5])],n.prototype,"workDays",void 0),Ki([t.Property(12)],n.prototype,"monthsCount",void 0),Ki([t.Property("00:00")],n.prototype,"startHour",void 0),Ki([t.Property("24:00")],n.prototype,"endHour",void 0),Ki([t.Property(null)],n.prototype,"timeFormat",void 0),Ki([t.Property(!0)],n.prototype,"enableHtmlSanitizer",void 0),Ki([t.Property(!1)],n.prototype,"enableAllDayScroll",void 0),Ki([t.Property(!1)],n.prototype,"enableAdaptiveUI",void 0),Ki([t.Property(!0)],n.prototype,"allowResizing",void 0),Ki([t.Complex({},yi)],n.prototype,"workHours",void 0),Ki([t.Complex({},Di)],n.prototype,"timeScale",void 0),Ki([t.Property(!0)],n.prototype,"allowKeyboardInteraction",void 0),Ki([t.Property(!0)],n.prototype,"allowDragAndDrop",void 0),Ki([t.Property()],n.prototype,"dateHeaderTemplate",void 0),Ki([t.Property()],n.prototype,"dateRangeTemplate",void 0),Ki([t.Property()],n.prototype,"cellHeaderTemplate",void 0),Ki([t.Property()],n.prototype,"dayHeaderTemplate",void 0),Ki([t.Property()],n.prototype,"monthHeaderTemplate",void 0),Ki([t.Property()],n.prototype,"cellTemplate",void 0),Ki([t.Property(!1)],n.prototype,"readonly",void 0),Ki([t.Property(!0)],n.prototype,"showQuickInfo",void 0),Ki([t.Property(!1)],n.prototype,"allowInline",void 0),Ki([t.Property(!0)],n.prototype,"allowMultiCellSelection",void 0),Ki([t.Property(!0)],n.prototype,"allowMultiRowSelection",void 0),Ki([t.Property(!1)],n.prototype,"quickInfoOnSelectionEnd",void 0),Ki([t.Property(!1)],n.prototype,"showWeekNumber",void 0),Ki([t.Property(!1)],n.prototype,"rowAutoHeight",void 0),Ki([t.Property(!1)],n.prototype,"allowMultiDrag",void 0),Ki([t.Property(0)],n.prototype,"firstMonthOfYear",void 0),Ki([t.Property()],n.prototype,"editorTemplate",void 0),Ki([t.Property()],n.prototype,"editorHeaderTemplate",void 0),Ki([t.Property()],n.prototype,"editorFooterTemplate",void 0),Ki([t.Complex({},Si)],n.prototype,"quickInfoTemplates",void 0),Ki([t.Property(7)],n.prototype,"agendaDaysCount",void 0),Ki([t.Property(!0)],n.prototype,"hideEmptyAgendaDays",void 0),Ki([t.Property(!0)],n.prototype,"enableRecurrenceValidation",void 0),Ki([t.Property()],n.prototype,"timezone",void 0),Ki([t.Complex({},Li)],n.prototype,"eventSettings",void 0),Ki([t.Property(wt)],n.prototype,"timezoneDataSource",void 0),Ki([t.Property()],n.prototype,"resourceHeaderTemplate",void 0),Ki([t.Property()],n.prototype,"headerIndentTemplate",void 0),Ki([t.Complex({},Ui)],n.prototype,"group",void 0),Ki([t.Collection([],zi)],n.prototype,"resources",void 0),Ki([t.Collection([],xi)],n.prototype,"headerRows",void 0),Ki([t.Property()],n.prototype,"cssClass",void 0),Ki([t.Property(!1)],n.prototype,"allowClipboard",void 0),Ki([t.Property()],n.prototype,"eventDragArea",void 0),Ki([t.Event()],n.prototype,"created",void 0),Ki([t.Event()],n.prototype,"destroyed",void 0),Ki([t.Event()],n.prototype,"cellClick",void 0),Ki([t.Event()],n.prototype,"cellDoubleClick",void 0),Ki([t.Event()],n.prototype,"moreEventsClick",void 0),Ki([t.Event()],n.prototype,"hover",void 0),Ki([t.Event()],n.prototype,"select",void 0),Ki([t.Event()],n.prototype,"actionBegin",void 0),Ki([t.Event()],n.prototype,"actionComplete",void 0),Ki([t.Event()],n.prototype,"actionFailure",void 0),Ki([t.Event()],n.prototype,"navigating",void 0),Ki([t.Event()],n.prototype,"renderCell",void 0),Ki([t.Event()],n.prototype,"eventClick",void 0),Ki([t.Event()],n.prototype,"eventDoubleClick",void 0),Ki([t.Event()],n.prototype,"eventRendered",void 0),Ki([t.Event()],n.prototype,"dataBinding",void 0),Ki([t.Event()],n.prototype,"popupOpen",void 0),Ki([t.Event()],n.prototype,"popupClose",void 0),Ki([t.Event()],n.prototype,"dragStart",void 0),Ki([t.Event()],n.prototype,"drag",void 0),Ki([t.Event()],n.prototype,"dragStop",void 0),Ki([t.Event()],n.prototype,"resizeStart",void 0),Ki([t.Event()],n.prototype,"resizing",void 0),Ki([t.Event()],n.prototype,"resizeStop",void 0),Ki([t.Event()],n.prototype,"virtualScrollStart",void 0),Ki([t.Event()],n.prototype,"virtualScrollStop",void 0),Ki([t.Event()],n.prototype,"dataBound",void 0),Ki([t.Event()],n.prototype,"beforePaste",void 0),Ki([t.Event()],n.prototype,"beforePrint",void 0),Ki([t.Event()],n.prototype,"excelExport",void 0),Ki([t.Event()],n.prototype,"tooltipOpen",void 0),n=Ki([t.NotifyPropertyChanges],n)}(t.Component),Ji=function(){function e(e){this.daysVariation=0,this.parent=e,this.actionObj={X:0,Y:0,groupIndex:0,cellWidth:0,cellHeight:0,slotInterval:0,interval:0,actionIndex:0,cloneElement:[],originalElement:[],action:null,isAllDay:null,excludeSelectors:null,index:0,navigationInterval:null,scrollInterval:null},this.scrollArgs={element:null,width:0,height:0},this.resizeEdges={left:!1,right:!1,top:!1,bottom:!1},this.scrollEdges={left:!1,right:!1,top:!1,bottom:!1}}return e.prototype.getChangedData=function(e){var i=this,n=t.extend({},this.actionObj.event,null,!0);if(n[this.parent.eventFields.startTime]=this.actionObj.start,n[this.parent.eventFields.endTime]=this.actionObj.end,t.isNullOrUndefined(this.actionObj.isAllDay)||(n[this.parent.eventFields.isAllDay]=this.actionObj.isAllDay),this.parent.activeViewOptions.group.resources.length>0){var r=this.getOriginalElement(this.actionObj.element);if(r){var a=r.map(function(e){return parseInt(e.getAttribute("data-group-index"),10)});if(-1===a.indexOf(this.actionObj.groupIndex)||!t.isNullOrUndefined(e)&&e.length>0){var s=parseInt(this.actionObj.clone.getAttribute("data-group-index"),10);(a=a.filter(function(e){return e!==s})).push(this.actionObj.groupIndex),e&&e.length>0?e.forEach(function(e){i.parent.resourceBase.getResourceData(e,i.actionObj.groupIndex,a)}):this.parent.resourceBase.getResourceData(n,this.actionObj.groupIndex,a)}}}return n},e.prototype.saveChangedData=function(e,t){void 0===t&&(t=!1),this.parent.activeEventData.event=this.actionObj.event,this.parent.currentAction="Save";var i,n=[e.data];t&&(n=e.selectedData);for(var r=0,a=n;r<a.length;r++){var s=a[r],o=!(this.parent.activeViewOptions.group.resources.length>0)||parseInt(this.actionObj.element.getAttribute("data-group-index"),10)===this.actionObj.groupIndex;if(+s[this.parent.eventFields.startTime]==+this.actionObj.event[this.parent.eventFields.startTime]&&+s[this.parent.eventFields.endTime]==+this.actionObj.event[this.parent.eventFields.endTime]&&o)return void(this.parent.crudModule.crudObj.isCrudAction=!1);if(s[this.parent.eventFields.recurrenceRule]){var l=s[this.parent.eventFields.recurrenceID]||s[this.parent.eventFields.id];if(s[this.parent.eventFields.id]===s[this.parent.eventFields.recurrenceID]&&(s[this.parent.eventFields.id]=this.parent.eventBase.getEventMaxID(),i="EditOccurrence"),this.parent.enableRecurrenceValidation&&this.parent.eventWindow.editOccurrenceValidation(l,s,this.actionObj.event))return}else i=null;(s[this.parent.eventFields.startTimezone]||s[this.parent.eventFields.endTimezone])&&this.parent.eventBase.timezoneConvert(s),this.parent.crudModule.saveEvent(s,i)}},e.prototype.calculateIntervalTime=function(e){var t=b(e).getTime(),i=this.parent.activeView.getStartHour(),n=Ke*this.actionObj.interval;return t+=(60*i.getHours()+i.getMinutes())*Ke+1e3*i.getSeconds(),t+=Math.floor((e.getTime()-t)/n)*n,new Date(t)},e.prototype.getContentAreaDimension=function(){var e=this.parent.element.querySelector(".e-content-wrap"),t=[].slice.call(e.querySelector("tr").children);this.parent.activeView.isTimelineView()||!(this.parent.activeViewOptions.group.resources.length>0)||this.parent.isAdaptive||this.parent.enableAdaptiveUI||this.parent.virtualScrollModule||(t=this.getResourceElements(t));var i=t[0].getBoundingClientRect(),n=t.slice(-1)[0].getBoundingClientRect();return{bottom:e.scrollHeight-5,left:this.parent.enableRtl?n.left:i.left,right:this.parent.enableRtl?i.right:n.right,top:0,leftOffset:this.parent.enableRtl?n.right:i.right,rightOffset:this.parent.enableRtl?i.left:n.left}},e.prototype.getIndex=function(e){var t=[].slice.call(this.parent.getContentTable().querySelector("tr").children),i={minIndex:0,maxIndex:t.length-1};if("resize"===this.actionObj.action&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&!this.parent.activeView.isTimelineView()){var n=this.getResourceElements(t);i.minIndex=n[0].cellIndex,i.maxIndex=n.slice(-1)[0].cellIndex}return e<i.minIndex&&(e=i.minIndex),e>i.maxIndex&&(e=i.maxIndex),e},e.prototype.updateTimePosition=function(e,i){for(var n=0,r=0,a=this.actionObj.cloneElement;r<a.length;r++){var s=a[r].querySelector(".e-time");if(s){var o=this.actionObj.start,l=this.actionObj.end;i&&i.length>0&&(o=i[parseInt(n.toString(),10)][this.parent.eventFields.startTime],l=i[parseInt(n.toString(),10)][this.parent.eventFields.endTime]),s.innerHTML=this.parent.getTimeString(o)+" - "+this.parent.getTimeString(l)}n++}if(this.parent.activeViewOptions.timeScale.enable&&this.parent.isAdaptive&&"Month"!==this.parent.currentView&&"TimelineMonth"!==this.parent.currentView){var p=this.parent.element.querySelector(".e-clone-time-indicator");if(!p){p=t.createElement("div",{className:"e-clone-time-indicator"});var c=this.parent.activeView.isTimelineView()?"e-date-header-wrap":"e-time-cells-wrap";this.parent.element.querySelector("."+c).appendChild(p)}p.innerHTML=this.parent.getTimeString(e);var h=0;if(this.parent.activeView.isTimelineView())if(this.parent.enableRtl){var d=parseInt(this.actionObj.clone.style.right,10);h="drag"===this.actionObj.action||this.resizeEdges.left?d+this.actionObj.clone.offsetWidth:d,p.style.right=t.formatUnit(h)}else{var u=parseInt(this.actionObj.clone.style.left,10);h="drag"===this.actionObj.action||this.resizeEdges.left?u:u+this.actionObj.clone.offsetWidth,p.style.left=t.formatUnit(h)}else h="drag"===this.actionObj.action||this.resizeEdges.top?this.actionObj.clone.offsetTop:this.actionObj.clone.offsetTop+this.actionObj.clone.offsetHeight,p.style.top=t.formatUnit(h)}},e.prototype.getResourceElements=function(e){var t=this;return e.filter(function(e){return parseInt(e.getAttribute("data-group-index"),10)===t.actionObj.groupIndex})},e.prototype.getOriginalElement=function(e){var i,n=e.getAttribute("data-guid");if(e.offsetParent&&e.offsetParent.classList.contains("e-more-event-popup")||this.parent.activeView.isTimelineView()||"resize"!==this.actionObj.action&&this.parent.virtualScrollModule)i=[].slice.call(this.parent.element.querySelectorAll('[data-guid="'+n+'"]'));else{var r=t.closest(e,"tr");r&&(i=[].slice.call(r.querySelectorAll('[data-guid="'+n+'"]')))}return i},e.prototype.createCloneElement=function(e){var i=document.createElement("div");i.appendChild(e.cloneNode(!0));var n=i.children[0],r=["e-schedule-event-clone"];r.push("drag"===this.actionObj.action?"e-drag-clone":"e-resize-clone"),"Month"!==this.parent.currentView&&"TimelineMonth"!==this.parent.currentView||r.push("e-month-event"),t.addClass([n],r),t.addClass([e],"e-event-action"),t.isNullOrUndefined(e.parentElement)||e.parentElement.appendChild(n),n.style.width=t.formatUnit(n.offsetWidth-2);var a=document.querySelector(this.parent.eventDragArea);return this.parent.eventDragArea&&"drag"===this.actionObj.action&&a&&a.appendChild(n),t.setStyleAttribute(n,{border:"0px"}),n},e.prototype.removeCloneElementClasses=function(){var e=this.actionObj.originalElement;"Month"!==this.parent.currentView&&"TimelineYear"!==this.parent.currentView&&"Day"!==this.parent.currentView&&"Week"!==this.parent.currentView&&"WorkWeek"!==this.parent.currentView||(e=[].slice.call(this.parent.element.querySelectorAll(".e-event-action"))),t.removeClass(e,"e-event-action")},e.prototype.removeCloneElement=function(){this.actionObj.originalElement=[];for(var e=0,i=[].slice.call(this.parent.element.querySelectorAll(".e-dynamic-clone"));e<i.length;e++){var n=i[e];t.remove(n)}for(var r=0,a=this.actionObj.cloneElement;r<a.length;r++){var s=a[r];t.isNullOrUndefined(s.parentNode)||t.remove(s)}this.actionObj.cloneElement=[];var o=this.parent.element.querySelector(".e-clone-time-indicator");o&&t.remove(o)},e.prototype.getCursorElement=function(e){var t=this.parent.eventBase.getPageCoordinates(e);return document.elementFromPoint(t.clientX,t.clientY)},e.prototype.autoScroll=function(){var e=this.parent.element.querySelector(".e-content-wrap"),t=e.offsetHeight<=e.scrollHeight,i=e.offsetWidth<=e.scrollWidth,n=t&&e.scrollTop>=0&&e.scrollTop+e.offsetHeight<=e.scrollHeight,r=i&&e.scrollLeft>=0&&e.scrollLeft+e.offsetWidth<=e.scrollWidth;if("resize"===this.actionObj.action&&this.scrollEdges.right&&e.scrollLeft+e.offsetWidth>e.scrollWidth){var a=[].slice.call(this.parent.getContentTable().querySelector("tr").children).length-1;r=Math.ceil((this.actionObj.clone.offsetLeft+this.actionObj.clone.offsetWidth)/this.actionObj.cellWidth)===a}n&&(this.scrollEdges.top||this.scrollEdges.bottom)&&(e.scrollTop+=this.scrollEdges.top?-this.actionObj.scroll.scrollBy:this.actionObj.scroll.scrollBy,"resize"===this.actionObj.action&&e.scrollHeight!==e.offsetHeight+e.scrollTop&&e.scrollTop>0&&(this.actionObj.Y+=this.scrollEdges.top?this.actionObj.scroll.scrollBy:-this.actionObj.scroll.scrollBy)),r&&(this.scrollEdges.left||this.scrollEdges.right)&&(e.scrollLeft+=this.scrollEdges.left?-this.actionObj.scroll.scrollBy:this.actionObj.scroll.scrollBy,"resize"===this.actionObj.action&&e.scrollWidth!==e.offsetWidth+e.scrollLeft&&e.scrollLeft>0&&(this.actionObj.X+=this.scrollEdges.left?this.actionObj.scroll.scrollBy:-this.actionObj.scroll.scrollBy))},e.prototype.autoScrollValidation=function(){if(!this.actionObj.scroll.enable)return!1;var e=this.parent.boundaryValidation(this.actionObj.pageY,this.actionObj.pageX);return this.scrollEdges=e,e.bottom||e.top||e.left||e.right},e.prototype.actionClass=function(e){"addClass"===e?t.addClass([this.parent.element],"e-event-action"):t.removeClass([this.parent.element],"e-event-action")},e.prototype.updateScrollPosition=function(e){var i=this;this.scrollEventArgs=e,this.actionObj.scroll.enable&&t.isNullOrUndefined(this.actionObj.scrollInterval)&&(this.actionObj.scrollInterval=window.setInterval(function(){if(i.autoScrollValidation()&&!i.actionObj.clone.classList.contains("e-all-day-appointment")){if(i.parent.activeView.isTimelineView()&&i.parent.activeViewOptions.group.resources.length>0&&i.actionObj.groupIndex<0)return;i.autoScroll(),"drag"===i.actionObj.action?i.parent.dragAndDropModule.updateDraggingDateTime(i.scrollEventArgs):i.parent.resizeModule.updateResizingDirection(i.scrollEventArgs)}},this.actionObj.scroll.timeDelay))},e.prototype.updateOriginalElement=function(e){var i='[data-id="'+e.getAttribute("data-id")+'"]';this.parent.activeViewOptions.group.resources.length>0&&(i=i.concat('[data-group-index = "'+e.getAttribute("data-group-index")+'"]')),e.hasAttribute("data-guid")&&(i+='[data-guid="'+e.getAttribute("data-guid")+'"]');var n=[].slice.call(this.parent.element.querySelectorAll(i));t.addClass(n,"e-event-action");var r=[].slice.call(this.parent.element.querySelectorAll(".e-schedule-event-clone"));t.removeClass(r,"e-event-action")},e.prototype.getUpdatedEvent=function(e,t,i){var n=JSON.parse(JSON.stringify(i));return n[this.parent.eventFields.startTime]=e,n[this.parent.eventFields.endTime]=t,n},e.prototype.dynamicYearlyEventsRendering=function(e,i){if(void 0===i&&(i=!1),t.isNullOrUndefined(this.parent.eventDragArea)){var n=this.actionObj.cellWidth-7;if(i&&(this.resizeEdges.left||this.resizeEdges.right)&&(n=this.actionObj.cellWidth*e.count),i||"Horizontal"!==this.parent.activeViewOptions.orientation||0!==this.parent.activeViewOptions.group.resources.length||((r=this.yearEvent.isSpannedEvent(e,e[this.parent.eventFields.startTime]))[this.parent.eventFields.startTime].getTime()===r[this.parent.eventFields.endTime].getTime()&&(r.isSpanned.count=1),n=r.isSpanned.count*this.actionObj.cellWidth),!i&&"Vertical"===this.parent.activeViewOptions.orientation&&0!==this.parent.activeViewOptions.group.resources.length){var r=this.yearEvent.isSpannedEvent(e,e[this.parent.eventFields.startTime]);n=r.isSpanned.count*this.actionObj.cellWidth}var a=this.createAppointmentElement(this.actionObj.groupIndex,e[this.parent.eventFields.subject]);a.setAttribute("drag","true"),t.addClass([a],"e-schedule-event-clone"),t.setStyleAttribute(a,{width:n+"px",border:"0px","pointer-events":"none",position:"absolute",overflow:"hidden",padding:"3px"}),""!==this.actionObj.clone.style.backgroundColor&&t.setStyleAttribute(a,{backgroundColor:this.actionObj.clone.style.backgroundColor});var s=b(e[this.parent.eventFields.startTime]).getTime(),o='.e-work-cells[data-date="'+s+'"]';this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(o='.e-work-cells[data-date="'+s+'"][data-group-index="'+this.actionObj.groupIndex+'"]');var l=this.parent.element.querySelector(o);if(!t.isNullOrUndefined(l)){if(i){var p=l.querySelector(".e-date-header"),c=this.actionObj.cellHeight*e.count-(p?p.offsetHeight:0)-7;(this.resizeEdges.right||this.resizeEdges.left)&&(c=parseInt(this.actionObj.clone.style.height,10)),t.setStyleAttribute(a,{height:c+"px"})}this.renderDynamicElement(l,a,!0),this.actionObj.cloneElement.push(a)}}},e.prototype.renderDynamicElement=function(e,i,n){if(e.querySelector(".e-appointment-wrapper"))e.querySelector(".e-appointment-wrapper").appendChild(i);else{var r=t.createElement("div",{className:"e-appointment-wrapper"});r.appendChild(i),e.appendChild(r)}},e.prototype.createAppointmentElement=function(e,i){var n=t.createElement("div",{className:"e-appointment",innerHTML:i});return this.parent.activeViewOptions.group.resources.length>0&&n.setAttribute("data-group-index",e.toString()),n},e.prototype.dynamicEventsRendering=function(e){var i=this;if(t.isNullOrUndefined(this.parent.eventDragArea)){var n,r=this.parent.activeView.renderDates,a=[].slice.call(this.parent.element.querySelectorAll(".e-work-cells")),s=this.parent.activeViewOptions.workDays;if(this.parent.activeViewOptions.group.resources.length>0){var o=(this.parent.virtualScrollModule&&this.parent.virtualScrollModule.isHorizontalScroll?this.parent.resourceBase.renderedResources:this.parent.resourceBase.lastResourceLevel).filter(function(e){return e.groupIndex===i.actionObj.groupIndex});r=o[0].renderDates;var l='.e-work-cells[data-group-index="'+this.actionObj.groupIndex+'"]';a=[].slice.call(this.parent.element.querySelectorAll(l)),s=o[0].workDays,n=o[0].groupOrder}if(this.monthEvent.dateRender=r,this.monthEvent.getSlotDates(s),this.resizeEdges.left||this.resizeEdges.right)for(var p=0,c=[].slice.call(this.parent.element.querySelectorAll(".e-schedule-event-clone"));p<c.length;p++){var h=c[p];t.remove(h)}for(var d=0,u=this.monthEvent.splitEvent(e,r);d<u.length;d++){var g=u[d],v=this.parent.getIndexOfDate(r,b(g[this.monthEvent.fields.startTime])),m=g.data.count*this.actionObj.cellWidth-7,f=this.monthEvent.createAppointmentElement(g,this.actionObj.groupIndex,!0);f.setAttribute("drag","true"),t.addClass([f],"e-schedule-event-clone"),this.monthEvent.applyResourceColor(f,g,"backgroundColor",n),t.setStyleAttribute(f,{width:m+"px",border:"0px","pointer-events":"none"});var y=a[parseInt(v.toString(),10)];y&&(this.monthEvent.renderElement(y,f,!0),this.actionObj.cloneElement.push(f))}}},e.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed||(this.actionObj={},this.scrollArgs={},this.resizeEdges={left:!1,right:!1,top:!1,bottom:!1},this.scrollEdges={left:!1,right:!1,top:!1,bottom:!1})},e}(),$i=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),en=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return $i(i,e),i.prototype.wireResizeEvent=function(e){for(var i=0,n=[].slice.call(e.querySelectorAll(".e-event-resize"));i<n.length;i++){var r=n[i];t.EventHandler.add(r,t.Browser.touchStartEvent,this.resizeStart,this)}},i.prototype.resizeHelper=function(){if(this.parent.activeViewOptions.group.resources.length>0&&this.parent.activeViewOptions.group.allowGroupEdit)for(var e=0,t=this.actionObj.originalElement.length;e<t;e++){var i=this.createCloneElement(this.actionObj.originalElement[parseInt(e.toString(),10)]);this.actionObj.cloneElement[parseInt(e.toString(),10)]=i,this.actionObj.element===this.actionObj.originalElement[parseInt(e.toString(),10)]&&(this.actionObj.clone=i)}else this.actionObj.element&&(this.actionObj.clone=this.createCloneElement(this.actionObj.element)),this.actionObj.cloneElement=[this.actionObj.clone],this.actionObj.originalElement=[this.actionObj.element]},i.prototype.resizeStart=function(e){var i=this;if((!e||"touchstart"!==e.type||this.parent.uiStateValues.isTapHold&&t.closest(e.target,".e-appointment-border"))&&!t.closest(e.target,".e-inline-edit")){var n=t.closest(e.target,".e-event-resize");if(this.actionObj.element=t.closest(n,".e-appointment"),this.actionObj.event=this.parent.eventBase.getEventByGuid(this.actionObj.element.getAttribute("data-guid")),!t.isNullOrUndefined(this.actionObj.event)){this.parent.eventBase.removeSelectedAppointmentClass(),this.actionObj.action="resize",this.actionObj.slotInterval=this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount,this.actionObj.interval=this.actionObj.slotInterval;var r=t.extend({},this.actionObj.event,null,!0),a={cancel:!1,data:r,element:this.actionObj.element,event:e,interval:this.actionObj.interval,scroll:{enable:!0,scrollBy:30,timeDelay:100}};this.parent.trigger("resizeStart",a,function(a){if(!a.cancel){i.actionClass("addClass"),i.parent.uiStateValues.action=!0,i.resizeEdges={left:n.classList.contains("e-left-handler"),right:n.classList.contains("e-right-handler"),top:n.classList.contains("e-top-handler"),bottom:n.classList.contains("e-bottom-handler")},i.actionObj.groupIndex=i.parent.uiStateValues.isGroupAdaptive?i.parent.uiStateValues.groupIndex:0;var s=i.parent.element.querySelector(".e-work-cells");i.actionObj.cellWidth=i.parent.getElementWidth(s),i.actionObj.cellHeight=i.parent.getElementHeight(s);var o=i.parent.activeViewOptions.headerRows.map(function(e){return e.option});if(i.parent.activeView.isTimelineView()&&o.length>0&&["Date","Hour"].indexOf(o.slice(-1)[0])<0){for(var l=i.parent.getContentTable().querySelector("tr"),p=0,c=0,h=[].slice.call(l.children);c<h.length;c++){var d=h[c];p+=parseInt(d.getAttribute("colspan"),10)}var u=l.getBoundingClientRect();i.actionObj.cellWidth=u.width/p,i.actionObj.cellHeight=u.height}var g=i.parent.eventBase.getPageCoordinates(e);i.actionObj.X=g.pageX,i.actionObj.Y=g.pageY,i.actionObj.groupIndex=parseInt(i.actionObj.element.getAttribute("data-group-index")||"0",10),i.actionObj.interval=a.interval,i.actionObj.scroll=a.scroll,i.actionObj.start=new Date(r[i.parent.eventFields.startTime].getTime()),i.actionObj.end=new Date(r[i.parent.eventFields.endTime].getTime()),i.actionObj.originalElement=i.getOriginalElement(i.actionObj.element),"Month"===i.parent.currentView&&(i.daysVariation=-1,i.monthEvent=new Bt(i.parent));var v=i.parent.element.querySelector(".e-content-wrap");if(i.scrollArgs={element:v,width:v.scrollWidth,height:v.scrollHeight},["Month","TimelineYear"].indexOf(i.parent.currentView)<0){var m=Math.round(i.scrollArgs.width/i.actionObj.cellWidth)*i.actionObj.cellWidth;i.scrollArgs.width=i.scrollArgs.width<m?m:i.scrollArgs.width}t.EventHandler.add(document,t.Browser.touchMoveEvent,i.resizing,i),t.EventHandler.add(document,t.Browser.touchEndEvent,i.resizeStop,i)}})}}},i.prototype.resizing=function(e){if(e&&"touchmove"===e.type&&e.preventDefault(),this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(),0===this.parent.element.querySelectorAll(".e-resize-clone").length&&this.resizeHelper(),t.isNullOrUndefined(e.target)||!e.target.classList.contains(pt)){var i=this.parent.eventBase.getPageCoordinates(e);if("Month"===this.parent.currentView||"TimelineYear"===this.parent.currentView){var n=document.documentElement,r=(window.pageXOffset||n.scrollLeft)-(n.clientLeft||0),a=(window.pageYOffset||n.scrollTop)-(n.clientTop||0);this.actionObj.pageX=i.pageX-r,this.actionObj.pageY=i.pageY-a}else this.actionObj.pageX=i.pageX,this.actionObj.pageY=i.pageY;this.updateScrollPosition(e),this.updateResizingDirection(e);var s={cancel:!1,data:t.extend({},this.actionObj.event,null,!0),element:this.actionObj.element,event:e,startTime:this.actionObj.start,endTime:this.actionObj.end};this.parent.group.resources.length>0&&(s.groupIndex=this.actionObj.groupIndex),this.parent.trigger("resizing",s)}},i.prototype.updateResizingDirection=function(e){if("Month"===this.parent.currentView||"TimelineYear"===this.parent.currentView)return void this.monthResizing();var i=this.resizeValidation(e);if(this.resizeEdges.left){if(i){var n=this.getLeftRightStyles(e,!0);if(parseInt(n.width,10)<1)return;for(var r=0,a=this.actionObj.cloneElement;r<a.length;r++){v=a[r];t.setStyleAttribute(v,n),t.addClass([v],"e-left-handler")}}this.horizontalResizing(!this.parent.enableRtl)}if(this.resizeEdges.right){if(i){var s=this.getLeftRightStyles(e,!1);if(parseInt(s.width,10)<1)return;for(var o=0,l=this.actionObj.cloneElement;o<l.length;o++){v=l[o];t.setStyleAttribute(v,s),t.addClass([v],"e-right-handler")}}this.horizontalResizing(this.parent.enableRtl)}if(this.resizeEdges.top){if(i){var p=this.getTopBottomStyles(e,!0);if(parseInt(p.height,10)<1)return;for(var c=0,h=this.actionObj.cloneElement;c<h.length;c++){v=h[c];t.setStyleAttribute(v,p),t.addClass([v],"e-top-handler")}}this.verticalResizing(!0)}if(this.resizeEdges.bottom){if(i){var d=this.getTopBottomStyles(e,!1);if(parseInt(d.height,10)<1)return;for(var u=0,g=this.actionObj.cloneElement;u<g.length;u++){var v=g[u];t.setStyleAttribute(v,d),t.addClass([v],"e-bottom-handler")}}this.verticalResizing(!1)}},i.prototype.monthResizing=function(){if(this.removeCloneElement(),!t.isNullOrUndefined(this.actionObj.pageX)&&!t.isNullOrUndefined(this.actionObj.pageY)){var e=document.elementFromPoint(this.actionObj.pageX,this.actionObj.pageY);if(!t.isNullOrUndefined(e)){var i=this.parent.getDateFromElement(e),n=!(this.parent.activeViewOptions.group.resources.length>0)||parseInt(e.getAttribute("data-group-index"),10)===this.actionObj.groupIndex,r=new Date(this.actionObj.event[this.parent.eventFields.startTime].getTime()),a=new Date(this.actionObj.event[this.parent.eventFields.endTime].getTime());if(!this.parent.enableRtl&&this.resizeEdges.left||this.parent.enableRtl&&this.resizeEdges.right||this.resizeEdges.top?r=i:(!this.parent.enableRtl&&this.resizeEdges.right||this.parent.enableRtl&&this.resizeEdges.left||this.resizeEdges.bottom)&&(a=O(i,1)),n&&r<a){this.actionObj.start=r,this.actionObj.end=a;var s=this.getUpdatedEvent(this.actionObj.start,this.actionObj.end,this.actionObj.event);"TimelineYear"===this.parent.currentView?this.yearEventsRendering(s):this.dynamicEventsRendering(s),this.updateOriginalElement(this.actionObj.clone)}}}},i.prototype.yearEventsRendering=function(e){for(var i=0,n=[].slice.call(this.parent.element.querySelectorAll(".e-schedule-event-clone"));i<n.length;i++){var r=n[i];t.remove(r)}var a=new Date(e[this.parent.eventFields.endTime]),s=0;0===this.parent.activeViewOptions.group.resources.length&&(s=this.getMonthDiff(e[this.parent.eventFields.startTime],O(a,-1)));for(var o=0;o<=s;o++){var l=void 0;0===this.parent.activeViewOptions.group.resources.length?l=this.getEventCount(e,this.actionObj.start.getMonth()+o):(l=t.extend({},e,null,!0),a=this.resizeEdges.left||this.resizeEdges.right?O(a,-1):a,l.count=this.getMonthDiff(e[this.parent.eventFields.startTime],a)+1),this.dynamicYearlyEventsRendering(l,!0)}},i.prototype.getMonthDiff=function(e,t){var i;return i=12*(t.getFullYear()-e.getFullYear()),i-=e.getMonth(),i+=t.getMonth(),i<=0?0:i},i.prototype.getEventCount=function(e,i){var n=t.extend({},e,null,!0),r=n[this.parent.eventFields.startTime],a=n[this.parent.eventFields.endTime],s=new Date(this.parent.selectedDate.getFullYear(),i,1),o=O(new Date(this.parent.selectedDate.getFullYear(),i+1,0),1),l=1;return r.getTime()<s.getTime()&&(n[this.parent.eventFields.startTime]=s),a.getTime()>o.getTime()&&(n[this.parent.eventFields.endTime]=o),0===this.parent.activeViewOptions.group.resources.length&&(l=Math.ceil((n[this.parent.eventFields.endTime].getTime()-n[this.parent.eventFields.startTime].getTime())/Qe)),n.count=l,n},i.prototype.resizeStop=function(e){var i=this;t.EventHandler.remove(document,t.Browser.touchMoveEvent,this.resizing),t.EventHandler.remove(document,t.Browser.touchEndEvent,this.resizeStop),clearInterval(this.actionObj.scrollInterval),this.actionObj.scrollInterval=null,this.actionObj.action=null,this.removeCloneElementClasses(),this.removeCloneElement(),this.actionClass("removeClass"),this.parent.uiStateValues.action=this.parent.uiStateValues.isTapHold=!1;var n={cancel:!1,data:this.getChangedData(),element:this.actionObj.element,event:e};this.parent.trigger("resizeStop",n,function(e){e.cancel||i.parent.eventBase.checkOverlap(e.data)||(i.parent.isSpecificResourceEvents()&&(i.parent.crudModule.crudObj.sourceEvent=[i.parent.resourceBase.lastResourceLevel[parseInt(e.element.getAttribute("data-group-index"),10)]],i.parent.crudModule.crudObj.targetEvent=i.parent.crudModule.crudObj.sourceEvent,i.parent.crudModule.crudObj.isCrudAction=!0),i.saveChangedData(e))})},i.prototype.verticalResizing=function(e){var i=this.actionObj.clone.offsetTop;e||(i+=this.actionObj.clone.offsetHeight);var n=i/Math.round(this.actionObj.cellHeight)*this.actionObj.slotInterval,r=this.actionObj.clone.offsetParent;if(!t.isNullOrUndefined(r)){var a=b(this.parent.getDateFromElement(r));a.setHours(this.parent.activeView.getStartHour().getHours()),a.setMinutes(n+this.parent.activeView.getStartHour().getMinutes()),e?this.actionObj.start=this.calculateIntervalTime(a):this.actionObj.end=this.calculateIntervalTime(a),this.updateTimePosition(a)}},i.prototype.horizontalResizing=function(e){var i,n=new Date(this.actionObj.event[this.parent.eventFields.startTime].getTime()),r=new Date(this.actionObj.event[this.parent.eventFields.endTime].getTime()),a=this.parent.currentView,s="TimelineMonth"===this.parent.currentView;if(this.parent.activeView.isTimelineView()){E=this.parent.getContentTable().querySelector("tr");if(this.parent.activeViewOptions.headerRows.length>0){var o=this.parent.activeViewOptions.headerRows.map(function(e){return e.option});a=o.slice(-1)[0],s&&"Hour"===a&&(a=o.slice(-2)[0]||"Month")}i=e?n:r;var l=0,p=[].slice.call(E.children),c=!1,h=this.actionObj.cellWidth/(this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount),d=parseFloat(this.parent.enableRtl?this.actionObj.clone.style.right:this.actionObj.clone.style.left);if(d=Math.round(d/h)*h,-1!==["Year","Month","Week","Date"].indexOf(a)){for(var u=0,g=0,v=p;g<v.length;g++){var m=v[g];u+=parseInt(m.getAttribute("colspan"),10)}var f=this.parent.enableRtl?parseInt(this.actionObj.clone.style.right,10):parseInt(this.actionObj.clone.style.left,10);f=Math.round(f/this.actionObj.cellWidth)*this.actionObj.cellWidth,e||(f+=this.parent.getElementWidth(this.actionObj.clone)-this.actionObj.cellWidth),l=s?Math.floor(f/Math.floor(this.parent.getElementWidth(E)/u)):Math.round(f/(this.parent.getElementWidth(E)/u)),c=(l=e?l:s?l+1:l)===p.length,l=l<0?0:l>=u?u-1:l}else{var y=this.actionObj.cellWidth;if(l=e?Math.round(d/this.actionObj.cellWidth):Math.ceil((d+(this.parent.getElementWidth(this.actionObj.clone)-y))/this.actionObj.cellWidth),this.parent.enableRtl){var T=Math.round(d/this.actionObj.cellWidth)*this.actionObj.cellWidth+(e?0:this.parent.getElementWidth(this.actionObj.clone)-this.actionObj.cellWidth);l=Math.floor(T/this.actionObj.cellWidth)}c=l===p.length,l=this.getIndex(l)}var w=void 0;if(w=-1!==["Year","Month","Week","Date"].indexOf(a)?new Date(this.parent.activeView.renderDates[parseInt(l.toString(),10)].getTime()):this.parent.getDateFromElement(E.children[parseInt(l.toString(),10)]),-1===["TimelineMonth","Year","Month","Week","Date"].indexOf(a)&&this.parent.activeViewOptions.timeScale.enable){e||(d+=this.parent.getElementWidth(this.actionObj.clone));var D=Math.floor(this.actionObj.slotInterval/this.actionObj.cellWidth*(d-Math.floor(d/this.actionObj.cellWidth)*this.actionObj.cellWidth));D=c||!e&&0===D?this.actionObj.slotInterval:D,i=new Date(w.getTime()),i=new Date(w.getTime()+D*Ke),this.updateTimePosition(i)}else i=new Date(w.setHours(i.getHours(),i.getMinutes(),i.getSeconds()))}else{var C=t.closest(this.actionObj.clone,"td").cellIndex,S=Math.ceil((e?this.parent.getElementWidth(this.actionObj.element):0)/this.actionObj.cellWidth)*this.actionObj.cellWidth,u=Math.ceil((this.parent.getElementWidth(this.actionObj.clone)-S)/this.actionObj.cellWidth),E=t.closest(this.actionObj.clone,"tr"),x=e?C-u:C+u-1;x=this.getIndex(x),i=this.parent.getDateFromElement(E.children[parseInt(x.toString(),10)]),e?i.setHours(n.getHours(),n.getMinutes(),n.getSeconds()):i.setHours(r.getHours(),r.getMinutes(),r.getSeconds())}var V=-1!==["TimelineMonth","Year","Month","Week","WorkWeek","Date","Day"].indexOf(a)||!this.parent.activeViewOptions.timeScale.enable;if(e)r.getTime()-i.getTime()<=0&&(i=V?b(r):n),this.actionObj.start=V?i:this.calculateIntervalTime(i);else{var A=V&&0===i.getHours()&&0===i.getMinutes()?O(i,1):i;V&&A.getTime()-n.getTime()<=0&&(A=O(b(n),1)),this.actionObj.end=V?A:this.calculateIntervalTime(A)}},i.prototype.getTopBottomStyles=function(e,i){var n=this.parent.element.querySelector(".e-content-wrap"),r=this.actionObj.cellHeight/this.actionObj.slotInterval*this.actionObj.interval,a=i?this.actionObj.element.offsetHeight+(this.actionObj.Y-this.actionObj.pageY):this.actionObj.element.offsetHeight+(this.actionObj.pageY-this.actionObj.Y),s=i?this.actionObj.element.offsetTop-(this.actionObj.Y-this.actionObj.pageY):this.actionObj.clone.offsetTop;return a=s<0?this.actionObj.clone.offsetHeight:this.actionObj.clone.offsetTop+this.actionObj.clone.offsetHeight>this.scrollArgs.height?this.actionObj.clone.offsetHeight:a,s=s<0?0:s,a=(s=i?Math.floor(s/r)*r:s)+a>=n.scrollHeight?n.scrollHeight-s:Math.ceil(a/r)*r,!i&&this.actionObj.clone.offsetTop+a>=this.parent.getContentTable().offsetHeight&&(a=this.parent.getContentTable().offsetHeight-this.actionObj.clone.offsetTop),{height:t.formatUnit(a<this.actionObj.cellHeight?Math.floor(a/r)*r:a),top:t.formatUnit(a<this.actionObj.cellHeight&&i?Math.ceil(s/r)*r:s),left:"0px",right:"0px",width:"100%"}},i.prototype.getLeftRightStyles=function(e,i){var n={},r=this.parent.activeView.isTimelineView(),a=["TimelineDay","TimelineWeek","TimelineWorkWeek"].indexOf(this.parent.currentView)>-1&&this.parent.activeViewOptions.timeScale.enable,s=this.actionObj.cellWidth/this.actionObj.slotInterval*this.actionObj.interval,o=i?this.actionObj.X-this.actionObj.pageX:this.actionObj.pageX-this.actionObj.X,l=r?Math.round(this.parent.getElementWidth(this.actionObj.element)/this.actionObj.cellWidth)*this.actionObj.cellWidth:"Month"===this.parent.currentView?this.parent.getElementWidth(this.actionObj.element):Math.ceil(this.parent.getElementWidth(this.actionObj.element)/this.actionObj.cellWidth)*this.actionObj.cellWidth,p=l+Math.ceil(o/this.actionObj.cellWidth)*this.actionObj.cellWidth,c=this.parent.enableRtl?parseInt(this.actionObj.element.style.right,10):this.actionObj.clone.offsetLeft;if(c=Math.round(c/s)*s,a){if(p=l+Math.ceil(o/s)*s,!i){var h=(+parseFloat(this.actionObj.element.style[this.parent.enableRtl?"right":"left"])).toFixed(1),d=Math.round(l/s)*s;h===c.toFixed(1)&&d===l||(p=Math.round((c+p)/s)*s-c)}this.actionObj.event[this.parent.eventFields.isAllDay]=!1}var u=!i&&Math.floor(p+this.actionObj.clone.offsetLeft)>this.scrollArgs.width?this.parent.getElementWidth(this.actionObj.clone):(this.actionObj.cellWidth,p);if(this.parent.enableRtl){var g=r?parseInt(this.actionObj.element.style.right,10):-(p-this.actionObj.cellWidth);g=r?g:i?0:g>0?0:g,r&&!i&&(g=Math.round(g/s)*s,(g-=Math.ceil((this.actionObj.pageX-this.actionObj.X)/s)*s)<0&&(g=parseInt(this.actionObj.clone.style.right,10),u=parseInt(this.actionObj.clone.style.width,10))),g=g>=this.scrollArgs.width?this.scrollArgs.width-this.actionObj.cellWidth:g,n.right=t.formatUnit(g),u=u+g>this.scrollArgs.width?this.parent.getElementWidth(this.actionObj.clone):u}else{var v=i?this.actionObj.element.offsetLeft-(this.actionObj.X-this.actionObj.pageX):this.parent.enableRtl?this.actionObj.element.offsetLeft:0;r&&(v=i?v:parseInt(this.actionObj.clone.style.left,10),v=this.parent.enableRtl?i?v:this.actionObj.pageX<this.actionObj.X-this.parent.getElementWidth(this.actionObj.clone)?parseInt(this.actionObj.clone.style.right,10):v:i&&this.actionObj.pageX>this.actionObj.X+this.parent.getElementWidth(this.actionObj.clone)&&this.parent.getElementWidth(this.actionObj.clone)===this.actionObj.cellWidth?parseInt(this.actionObj.clone.style.left,10):v);var m=v;(v=r?a?i?this.actionObj.element.offsetLeft-Math.ceil((this.actionObj.element.offsetLeft-v)/s)*s:v:Math.floor(v/this.actionObj.cellWidth)*this.actionObj.cellWidth:Math.ceil(Math.abs(v)/this.actionObj.cellWidth)*this.actionObj.cellWidth)<0&&(r&&i&&v%s?(v=parseInt(this.actionObj.clone.style.left,10),u=parseInt(this.actionObj.clone.style.width,10)):(v=0,u=this.parent.getElementWidth(this.actionObj.clone)));var f=Math.ceil(this.parent.getElementWidth(this.actionObj.clone)/this.actionObj.cellWidth)*this.actionObj.cellWidth;i&&(n.left=t.formatUnit(r?v:i?m<0?-v:Math.ceil((l-f)/this.actionObj.cellWidth)*this.actionObj.cellWidth:v))}return u=Math.floor(u),n.width=t.formatUnit(u),n},i.prototype.resizeValidation=function(e){var t=this.parent.eventBase.getPageCoordinates(e),i=this.getContentAreaDimension(),n=this.parent.activeView.isTimelineView()&&this.parent.activeViewOptions.timeScale.enable,r=this.actionObj.cellWidth,a=!1;return this.resizeEdges.left&&(t.pageX<i.leftOffset&&t.pageX>=i.left&&n&&(r=0),a=t.pageX-r>=i.left),this.resizeEdges.right&&(t.pageX>i.rightOffset&&t.pageX<=i.right&&n&&(r=0),a=t.pageX+r<=i.right),this.resizeEdges.top&&(a=this.actionObj.clone.offsetTop>=i.top),this.resizeEdges.bottom&&(a=this.actionObj.clone.offsetTop+this.actionObj.clone.offsetHeight<=this.scrollArgs.height),a},i.prototype.getModuleName=function(){return"resize"},i}(Ji),tn=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),nn=function(e){function i(t){var i=e.call(this,t,"day")||this;return i.isResource=!1,i}return tn(i,e),i.prototype.renderAppointments=function(){this.parent.dragAndDropModule&&this.parent.dragAndDropModule.setDragArea(),this.fields=this.parent.eventFields;for(var e="Year"===this.parent.currentView?".e-work-cells .e-appointment":".e-appointment-wrapper,.e-more-indicator",i=0,n=[].slice.call(this.parent.element.querySelectorAll(e));i<n.length;i++){var r=n[i];t.remove(r)}this.renderedEvents=[],"Year"===this.parent.currentView?this.yearViewEvents():(this.removeCellHeight(),this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive?(this.isResource=!0,this.timelineResourceEvents()):this.timelineYearViewEvents()),this.parent.renderTemplates(),this.parent.notify(Ge,{})},i.prototype.yearViewEvents=function(){for(var e=this.getMonths(),i=0,n=e;i<n.length;i++)for(var r=n[i],a=".e-month-calendar:nth-child("+(e.indexOf(r)+1)+") td.e-work-cells",s=[].slice.call(this.parent.element.querySelectorAll(a)),o=new Date(this.parent.selectedDate.getFullYear(),r,1),l=this.parent.calendarUtil.getMonthStartDate(new Date(o.getTime())),p=this.parent.calendarUtil.getMonthEndDate(new Date(o.getTime())),c=v(l,this.parent.activeViewOptions.firstDayOfWeek),h=O(m(p,this.parent.activeViewOptions.firstDayOfWeek),1),d=0;c.getTime()<h.getTime();d++){var u=b(new Date(c.getTime())),g=O(new Date(u.getTime()),1);if(c=O(new Date(c.getTime()),1),this.parent.isMinMaxDate(u)&&this.parent.eventBase.filterEvents(u,g).length>0){var f=s[parseInt(d.toString(),10)];f&&f.appendChild(t.createElement("div",{className:"e-appointment"}))}}},i.prototype.timelineYearViewEvents=function(){var e=this,i=this.parent.element.querySelector(".e-work-cells:not(.e-other-month)");this.cellWidth=this.parent.getElementWidth(i),this.cellHeader=P(i.querySelector(".e-date-header"));var n=this.parent.element.querySelector(".e-event-table");this.eventHeight=this.parent.getElementHeightFromClass(n,"e-appointment");var r=".e-month-header-wrapper tbody tr,.e-resource-column-table tbody tr,."+nt+" tbody tr";this.addCellHeight(r,this.eventHeight,2,this.cellHeader,this.moreIndicatorHeight);for(var a=[].slice.call(this.parent.element.querySelectorAll("."+at)),s=this.getMonths(),o=this.parent.activeViewOptions.group.resources.length>0&&this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:void 0,l=0;l<s.length;l++){var p=a[parseInt(l.toString(),10)],c=l+1,h=t.createElement("div",{className:"e-appointment-wrapper"});p.appendChild(h);var d=new Date(this.parent.selectedDate.getFullYear(),s[parseInt(l.toString(),10)],1),u=new Date(d.getFullYear(),d.getMonth()+1,0),g=d.getDay(),v=[];for("Horizontal"===this.parent.activeViewOptions.orientation&&(this.renderedEvents=[]);d.getTime()<=u.getTime();){var m=void 0,f=void 0;if("Vertical"===this.parent.activeViewOptions.orientation){var y=a[parseInt(g.toString(),10)];c=g+1,(h=y.querySelector(".e-appointment-wrapper"))||(h=t.createElement("div",{className:"e-appointment-wrapper"}),y.appendChild(h)),this.parent.enableRtl?f=l*this.cellWidth:m=l*this.cellWidth}else this.parent.enableRtl?f=(g+d.getDate()-1)*this.cellWidth:m=(g+d.getDate()-1)*this.cellWidth;var T=this.parent.element.querySelector(".e-content-wrap tr:nth-child("+c+") td");this.cellHeight=T.offsetHeight;var w=b(new Date(d.getTime())),D=O(new Date(w.getTime()),1),C=void 0;this.parent.uiStateValues.isGroupAdaptive&&(C=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]);for(var S=this.parent.eventBase.filterEvents(w,D,void 0,C),E=this,x=0,V=(S=this.parent.eventBase.sortByDateTime(S)).length;x<V;x++)!function(e,i){var n=t.extend({},S[parseInt(e.toString(),10)],null,!0);E.updateSpannedEvents(n,w,D);var r=E.getIndex(w);n.Index=r;var a=E.cellHeader+E.eventHeight*(r+1)+2+E.moreIndicatorHeight,s=E.cellHeight-E.cellHeader-E.moreIndicatorHeight,p=Math.floor(s/(E.eventHeight+2)),c=E.parent.rowAutoHeight?1:E.parent.activeViewOptions.maxEventsPerRow,u=E.parent.activeViewOptions.maxEventsPerRow?i-c:i-p<=0?1:i-p;if("Horizontal"===E.parent.activeViewOptions.orientation){var y=E.renderedEvents.filter(function(e){return e.Guid===n.Guid}),b=v.filter(function(e){return e.Guid===n.Guid});if(y.length>0&&y[0].MoreIndicator||b.length>0&&b[0].MoreIndicator){C="Horizontal"===E.parent.activeViewOptions.orientation?l:g;return E.renderMoreIndicator(h,u,w,C,m,f,o),"continue"}if(y.length>0||b.length>0)return"continue"}if(E.maxHeight&&-1!==E.parent.currentView.indexOf("Timeline")&&r>0)return"continue";if(E.parent.rowAutoHeight||E.shouldRenderAppointment(r,a))E.renderEvent(h,n,l,m,f,d,g),(E.parent.rowAutoHeight||E.cellHeight>a)&&E.updateCellHeight(T,a),v.push(n);else{var C="Horizontal"===E.parent.activeViewOptions.orientation?l:g;E.renderMoreIndicator(h,u,w,C,m,f,o),"Horizontal"===E.parent.activeViewOptions.orientation&&(n.MoreIndicator=!0,E.renderedEvents.push(n),v.push(n))}}(x,V);d=O(new Date(d.getTime()),1),"Vertical"===this.parent.activeViewOptions.orientation&&(g++,this.renderedEvents=[])}}if(this.parent.rowAutoHeight&&"Vertical"===this.parent.activeViewOptions.orientation){var A=[].slice.call(this.parent.element.querySelectorAll("."+at)),I=[].slice.call(this.parent.element.querySelectorAll("."+nt+" tbody tr"));A.forEach(function(t,i){var n=[].slice.call(t.querySelectorAll(".e-appointment")),r=I[parseInt(i.toString(),10)].offsetTop+e.cellHeader+2;n.forEach(function(t){var i=parseInt(t.getAttribute("data-index"),10);t.style.top=r+i*e.eventHeight+"px",t.removeAttribute("data-index")})})}},i.prototype.updateSpannedEvents=function(e,t,i){var n=this.isResource&&"Vertical"===this.parent.activeViewOptions.orientation||!this.isResource&&"Horizontal"===this.parent.activeViewOptions.orientation,r={isLeft:!0,isRight:!0,isBottom:!0,isTop:!0};t.getTime()<=e[this.fields.startTime].getTime()&&(n?r.isLeft=!1:r.isTop=!1),(i.getTime()>=e[this.fields.endTime].getTime()||n&&!this.isResource&&O(i,-1).getMonth()===e[this.fields.endTime].getMonth()||n&&this.isResource&&i.getTime()<=e[this.fields.endTime].getTime())&&(n?r.isRight=!1:r.isBottom=!1),e.data=r},i.prototype.timelineResourceEvents=function(){var e=this,t=this.parent.element.querySelector(".e-content-wrap"),i=t.offsetWidth>t.clientWidth,n=this.parent.element.querySelector(".e-work-cells");this.cellWidth=this.parent.getElementWidth(n),this.cellHeader=0;var r=this.parent.element.querySelector(".e-event-table");this.eventHeight=this.parent.getElementHeightFromClass(r,"e-appointment");var a=".e-month-header-wrapper tbody tr,.e-resource-column-table tbody tr,."+nt+" tbody tr";this.addCellHeight(a,this.eventHeight,2,this.cellHeader,this.moreIndicatorHeight);var s=[].slice.call(this.parent.element.querySelectorAll("."+at)),o=this.parent.uiStateValues.isGroupAdaptive?[this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]]:this.parent.activeViewOptions.allowVirtualScrolling?this.parent.resourceBase.renderedResources:this.parent.resourceBase.lastResourceLevel,l=this.getMonths();if("Horizontal"===this.parent.activeViewOptions.orientation)for(d=0;d<l.length;d++)for(var p=new Date(this.parent.selectedDate.getFullYear(),l[parseInt(d.toString(),10)],1),c=0,h=o.length;c<h;c++)this.renderedEvents=[],this.renderResourceEvent(s[parseInt(d.toString(),10)],o[parseInt(c.toString(),10)],d,c,p);else for(var c=0,h=o.length;c<h;c++){this.renderedEvents=[];for(var d=0;d<l.length;d++){p=new Date(this.parent.selectedDate.getFullYear(),l[parseInt(d.toString(),10)],1);this.renderResourceEvent(s[parseInt(c.toString(),10)],o[parseInt(c.toString(),10)],d,c,p)}}if(this.parent.rowAutoHeight&&!i&&t.offsetWidth>t.clientWidth){[].slice.call(this.parent.element.querySelectorAll(".e-appointment")).forEach(function(e){e.style.removeProperty("left"),e.style.removeProperty("right")});var u=[].slice.call(this.parent.element.querySelectorAll("."+at)),g=this.parent.element.querySelector("."+nt),v=[].slice.call(g.querySelectorAll("tbody tr"));u.forEach(function(t,i){var n=[].slice.call(t.children),r=v[parseInt(i.toString(),10)];n.forEach(function(t,i){var n=r.querySelector("td:nth-child("+(i+1)+")"),a=[].slice.call(t.children),s=e.parent.getElementWidth(n),o=n.offsetLeft;if(e.parent.enableRtl){var l=g.offsetWidth-o-n.offsetWidth;a.forEach(function(e){e.style.width=Math.floor(parseInt(e.style.width,10)/s)*s+"px",e.style.right=l+"px"})}else a.forEach(function(e){e.style.width=Math.floor(parseInt(e.style.width,10)/s)*s+"px",e.style.left=o+"px"})})})}},i.prototype.shouldRenderAppointment=function(e,t){var i=this.parent.rowAutoHeight?1:this.parent.activeViewOptions.maxEventsPerRow;return!this.parent.activeViewOptions.maxEventsPerRow||this.parent.rowAutoHeight||this.parent.eventSettings.enableIndicator?this.maxOrIndicator?e<1:this.cellHeight>t:e<i},i.prototype.renderResourceEvent=function(e,i,n,r,a){var s=t.createElement("div",{className:"e-appointment-wrapper"});e.appendChild(s);var o=O(y(new Date(a.getTime())),1),l=this.parent.eventBase.filterEvents(a,o,void 0,i),p="Vertical"===this.parent.activeViewOptions.orientation?r:n,c=this.parent.element.querySelector(".e-content-wrap tr:nth-child("+(p+1)+") td");this.cellHeight=c.offsetHeight,this.groupOrder=i.groupOrder;for(var h=[],d=this,u=0;u<l.length;u++){var g=function(e){var i=l[parseInt(e.toString(),10)],o=void 0,p=t.extend({},i,null,!0);if(d.parent.activeViewOptions.group.resources.length>0){var u=d.isSpannedEvent(p,a);o=d.getIndex(u[d.fields.startTime]),p.Index=o}else o=d.getIndex(p[d.fields.startTime]),p.Index=o;var g=d.cellHeader+d.eventHeight*(e+1)+2+d.moreIndicatorHeight,v="Vertical"===d.parent.activeViewOptions.orientation?n*d.cellWidth:r*d.cellWidth;if(!d.parent.isMinMaxDate(p[d.fields.startTime]))return{value:void 0};if("Vertical"===d.parent.activeViewOptions.orientation&&d.parent.activeViewOptions.group.resources.length>0){var m=d.renderedEvents.filter(function(e){return e.Guid===p.Guid}),f=h.filter(function(e){return e.Guid===p.Guid});if(m.length>0||f.length>0)return"continue"}if(d.maxHeight&&-1!==d.parent.currentView.indexOf("Timeline")&&o>0)return"continue";if(!d.parent.rowAutoHeight&&!d.shouldRenderAppointment(o,g)){var y="Horizontal"===d.parent.activeViewOptions.orientation?n:r;if(d.renderMoreIndicator(s,l.length-e,a,y,v,v,r),"Horizontal"===d.parent.activeViewOptions.orientation)for(var T=r;T<l.length;T++)d.renderedEvents.push(t.extend({},l[parseInt(T.toString(),10)],{Index:o+T},!0));return"break"}d.renderEvent(s,p,n,v,v,a,r),d.updateCellHeight(c,g),h.push(p)}(u);if("object"==typeof g)return g.value;if("break"===g)break}},i.prototype.setMaxEventHeight=function(e,i){var n=i.offsetHeight-this.cellHeader-(this.maxHeight?0:this.moreIndicatorHeight);t.setStyleAttribute(e,{height:n+"px","align-items":"center"})},i.prototype.renderEvent=function(e,i,n,r,a,s,o){var l,p,c=this,h=this.isSpannedEvent(i,s),d=this.createEventElement(h);if(1===h.isSpanned.count){var u=O(h[this.fields.endTime],-1);h[this.fields.endTime]=u>h[this.fields.startTime]?u:h[this.fields.endTime]}if(!(h[this.fields.startTime]>h[this.fields.endTime])){"Horizontal"===this.parent.activeViewOptions.orientation?(p=n+1,h[this.fields.startTime].getTime()===h[this.fields.endTime].getTime()&&(h.isSpanned.count=1),l=h.isSpanned.count*this.cellWidth):(p=o+1,l=this.isResource?h.isSpanned.count*this.cellWidth:this.cellWidth);var g=this.parent.element.querySelector(".e-content-wrap tr:nth-child("+p+") td"),v=g.offsetTop+this.cellHeader+this.eventHeight*h.Index+2;t.setStyleAttribute(d,{width:l+"px",height:this.eventHeight+"px",left:r+"px",right:a+"px",top:v+"px"}),this.maxOrIndicator&&-1!==this.parent.currentView.indexOf("Timeline")&&this.setMaxEventHeight(d,g),!this.isResource&&this.parent.rowAutoHeight&&"Vertical"===this.parent.activeViewOptions.orientation&&d.setAttribute("data-index",h.Index.toString());var m={data:h,element:d,cancel:!1,type:"event"};this.parent.trigger("eventRendered",m,function(i){i.cancel||(e.appendChild(d),c.wireAppointmentEvents(d,h),c.parent.activeViewOptions.group.resources.length>0?c.renderedEvents.push(t.extend({},h,null,!0)):"Vertical"===c.parent.activeViewOptions.orientation?c.renderedEvents.push(t.extend({},h,null,!0)):((h.isSpanned.isRight||h.isSpanned.isLeft)&&"Horizontal"===c.parent.activeViewOptions.orientation||!h.isSpanned.isRight)&&c.renderedEvents.push(t.extend({},h,null,!0)))})}},i.prototype.renderMoreIndicator=function(e,i,n,r,a,s,o){if(0!==this.parent.activeViewOptions.group.resources.length||!e.querySelector('[data-start-date="'+n.getTime()+'"]')){var l;l=this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive?O(y(new Date(n.getTime())),1):O(new Date(n.getTime()),1);var p=this.getMoreIndicatorElement(i,n,l),c=this.parent.element.querySelector(".e-content-wrap tr:nth-child("+(r+1)+")").offsetTop+(this.cellHeight-this.moreIndicatorHeight);a=Math.floor(a/this.cellWidth)*this.cellWidth,s=Math.floor(s/this.cellWidth)*this.cellWidth,t.setStyleAttribute(p,{width:this.cellWidth+"px",left:a+"px",right:s+"px",top:c+"px"}),t.isNullOrUndefined(o)||p.setAttribute("data-group-index",o.toString()),e.appendChild(p),t.EventHandler.add(p,"click",this.moreIndicatorClick,this)}},i.prototype.createEventElement=function(e){var i=e[this.fields.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),n=t.createElement("div",{className:"e-appointment",attrs:{"data-id":"Appointment_"+e[this.fields.id],"data-guid":e.Guid,role:"button",tabindex:"0","aria-disabled":this.parent.eventBase.getReadonlyAttribute(e),"aria-label":this.parent.getAnnouncementString(e)}});if(this.cssClass&&t.addClass([n],this.cssClass),e[this.fields.isReadonly]&&t.addClass([n],"e-read-only"),this.parent.activeViewOptions.group.resources.length>0){var r=this.getGroupIndexFromEvent(e);n.setAttribute("data-group-index",r.toString())}var a=[],s=t.extend({},e,null,!0);if(this.parent.activeViewOptions.eventTemplate){var o=this.parent.element.id+"_"+this.parent.activeViewOptions.eventTemplateName+"eventTemplate";a=this.parent.getAppointmentTemplate()(s,this.parent,"eventTemplate",o,!1,void 0,void 0,this.parent.root)}else{var l=e[this.fields.location]||this.parent.eventSettings.fields.location.default||"",p=t.createElement("div",{className:"e-subject",innerHTML:i+(l?"; "+l:"")}),c=t.createElement("div",{className:"e-time"+(this.parent.isAdaptive?" e-disable":""),innerHTML:this.parent.getTimeString(s[this.fields.startTime])}),h=t.createElement("div",{className:"e-time"+(this.parent.isAdaptive?" e-disable":""),innerHTML:this.parent.getTimeString(s[this.fields.endTime])});t.addClass([p],"e-text-center"),e[this.fields.isAllDay]?a=[p]:s.isLeft||s.isRight?(s.isLeft||a.push(c),a.push(p),s.isRight||a.push(h)):a=[c,p,h]}var d=t.createElement("div",{className:"e-appointment-details"});return t.append(a,d),n.appendChild(d),this.parent.eventBase.renderSpannedIcon(n,e.isSpanned),this.renderResizeHandler(n,e.data,e[this.fields.isReadonly]),this.applyResourceColor(n,s,"backgroundColor",this.groupOrder),n},i.prototype.isSpannedEvent=function(e,i){var n=new Date(i.getFullYear(),i.getMonth(),1),r=O(new Date(i.getFullYear(),i.getMonth()+1,0),1),a=t.extend({},e,null,!0),s=a[this.fields.startTime],o=a[this.fields.endTime],l={isLeft:!1,isRight:!1,count:1},p=new Date(this.parent.selectedDate.getFullYear(),this.parent.firstMonthOfYear,1),c=E(p,this.parent.monthsCount);if(this.isResource&&this.updateSpannedEvents(e,n,r),"Vertical"===this.parent.activeViewOptions.orientation&&this.parent.activeViewOptions.group.resources.length>0){this.updateSpannedEventDetails(s,o,p,c,a,l);var h=a[this.fields.startTime],d=new Date(a[this.fields.endTime]-1);l.count=d.getMonth()-h.getMonth()+this.parent.monthsCount*(d.getFullYear()-h.getFullYear())+1}else if(this.updateSpannedEventDetails(s,o,n,r,a,l),0===this.parent.activeViewOptions.group.resources.length||this.parent.uiStateValues.isGroupAdaptive){var u=b(a[this.fields.endTime]).getTime(),g=b(a[this.fields.startTime]).getTime();(e[this.fields.isAllDay]&&u===e[this.fields.endTime].getTime()||l.isRight)&&(u=O(new Date(u),-1).getTime()),l.count=Math.round((u-g)/Qe)+1}return a.isSpanned=l,b(s).getTime()<b(this.parent.minDate).getTime()&&(a[this.fields.startTime]=this.parent.minDate),b(o).getTime()>b(this.parent.maxDate).getTime()&&(a[this.fields.endTime]=this.parent.maxDate),a},i.prototype.updateSpannedEventDetails=function(e,t,i,n,r,a){e.getTime()<i.getTime()&&(r[this.fields.startTime]=i,a.isLeft=!0),t.getTime()>n.getTime()&&(r[this.fields.endTime]=n,a.isRight=!0)},i.prototype.getOverlapEvents=function(e,t){var i,n,r=[];if(this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive){var a=this.parent.calendarUtil.getMonthStartDate(new Date(e.getTime())),s=O(this.parent.calendarUtil.getMonthEndDate(new Date(e.getTime())),-1);i=b(new Date(a.getTime())).getTime(),n=b(new Date(s.getTime())).getTime()}else this.parent.rowAutoHeight?(i=b(new Date(e.getTime())).getTime(),n=O(b(new Date(e.getTime())),1).getTime()):i=n=b(new Date(e.getTime())).getTime();for(var o=0,l=t;o<l.length;o++){var p=l[o],c=new Date(p[this.fields.startTime].getTime()),h=new Date(p[this.fields.endTime].getTime()),d=p[this.fields.isAllDay]?b(h).getTime()>i||b(h).getTime()===i&&h.getTime()!==b(h).getTime():b(h).getTime()>=i;b(c).getTime()<=i&&d||b(c).getTime()>=i&&b(h).getTime()<=n?r.push(p):"Vertical"===this.parent.activeViewOptions.orientation&&b(c).getTime()>=i&&b(h).getTime()>=n&&r.push(p)}return r},i.prototype.getMonths=function(){var e=this;return Array.apply(null,{length:this.parent.monthsCount}).map(function(t,i){return e.parent.firstMonthOfYear+i})},i.prototype.removeCellHeight=function(){for(var e=".e-month-header-wrapper tbody tr,.e-resource-column-table tbody tr,."+nt+" tbody tr",t=0,i=[].slice.call(this.element.querySelectorAll(e));t<i.length;t++)i[t].firstElementChild.style.height=""},i.prototype.destroy=function(){e.prototype.destroy.call(this),this.parent=null},i}(zt),rn=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),an=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.widthUptoCursorPoint=0,t.heightUptoCursorPoint=0,t.cursorPointIndex=0,t.isHeaderRows=!1,t.isTimelineDayProcess=!1,t.widthPerMinute=0,t.heightPerMinute=0,t.minDiff=0,t.isStepDragging=!1,t.isMorePopupOpened=!1,t.isAllDayDrag=!1,t.isMultiSelect=!1,t.multiData=[],t.updatedData=[],t.swagData=[],t.startTime=0,t.isAllDayTarget=!1,t.targetTd=null,t.isCursorAhead=!1,t.enableCurrentViewDrag=!1,t.isPreventMultiDrag=!1,t.slotsUptoCursor=-1,t.eleTop=0,t.distanceUptoCursor=0,t}return rn(i,e),i.prototype.wireDragEvent=function(e){new t.Draggable(e,{abort:".e-event-resize, .e-inline-edit",clone:!0,isDragScroll:!0,enableTailMode:!!this.parent.eventDragArea,cursorAt:this.parent.eventDragArea?{left:-20,top:-20}:{left:0,top:0},dragArea:this.dragArea,dragStart:this.dragStart.bind(this),drag:this.drag.bind(this),dragStop:this.dragStop.bind(this),enableAutoScroll:!1,helper:this.dragHelper.bind(this),queryPositionInfo:this.dragPosition.bind(this)})},i.prototype.setDragArea=function(){var e=document.querySelector(this.parent.eventDragArea);this.dragArea=this.parent.eventDragArea&&e?e:this.parent.element.querySelector("."+nt)},i.prototype.dragHelper=function(e){var i=this;if(e.sender&&"touchmove"===e.sender.type&&(!this.parent.uiStateValues.isTapHold||!e.element.classList.contains("e-appointment-border")))return null;if(this.setDragActionDefaultValues(),this.actionObj.element=e.element,e.sender&&["Day","Week","WorkWeek"].indexOf(this.parent.currentView)>-1){var n=this.parent.eventBase.getPageCoordinates(e.sender);this.distanceUptoCursor=n.clientY-this.actionObj.element.getBoundingClientRect().top,this.eleTop=parseFloat(this.actionObj.element.style.top),this.slotsUptoCursor=-1}this.actionObj.action="drag";var r=[];return!this.parent.allowMultiDrag||t.isNullOrUndefined(this.parent.selectedElements)||0===this.parent.selectedElements.length||this.parent.selectedElements.length>0&&-1===this.parent.selectedElements.indexOf(this.actionObj.element)?r=[e.element]:(r=this.parent.selectedElements,this.isMultiSelect=!0),r.forEach(function(e){var n=i.createCloneElement(e);e.getAttribute("data-guid")===i.actionObj.element.getAttribute("data-guid")&&(i.actionObj.clone=n,i.parent.eventDragArea||"Month"===i.parent.currentView||!i.parent.activeViewOptions.timeScale.enable||i.parent.activeView.isTimelineView()||i.actionObj.element.classList.contains("e-all-day-appointment")||t.setStyleAttribute(i.actionObj.clone,{cursor:"move",left:"0%",right:"0%",width:"100%"}),i.actionObj.clone.style.top=t.formatUnit(i.actionObj.element.offsetTop)),i.actionObj.cloneElement.push(n),i.actionObj.originalElement.push(e)}),this.actionObj.clone},i.prototype.dragPosition=function(e){if(this.parent.eventDragArea)return{left:e.left,top:e.top};var i=this.actionObj.cellHeight/this.actionObj.slotInterval*this.actionObj.interval,n=t.formatUnit(0);"Month"===this.parent.currentView&&(n=e.left);var r;r=this.isStepDragging?Math.ceil(this.actionObj.clone.getBoundingClientRect().right)+this.actionObj.interval:this.actionObj.clone.getBoundingClientRect().right;var a=this.parent.element.querySelector(".e-content-wrap").getBoundingClientRect().right;!(this.parent.activeView.isTimelineView()&&"TimelineYear"!==this.parent.currentView&&!this.parent.enableRtl&&this.actionObj.pageX>r)||this.isMorePopupOpened||this.actionObj.pageX>a||(this.isCursorAhead=!0),this.parent.activeView.isTimelineView()&&(n=t.formatUnit(this.actionObj.clone.offsetLeft));var s;if(this.parent.activeView.isTimelineView()||!this.parent.timeScale.enable||!t.isNullOrUndefined(this.actionObj.clone.offsetParent)&&this.actionObj.clone.offsetParent.classList.contains("e-more-event-popup"))s=t.formatUnit(this.actionObj.clone.offsetTop);else if("Month"===this.parent.currentView)s=t.formatUnit(0);else if(this.actionObj.clone.classList.contains("e-all-day-appointment"))s=t.formatUnit(this.parent.element.querySelector(".e-all-day-row").offsetTop),t.setStyleAttribute(this.actionObj.clone,{width:t.formatUnit(Math.ceil(this.actionObj.clone.offsetWidth/this.actionObj.cellWidth)*this.actionObj.cellWidth),right:this.parent.enableRtl&&t.formatUnit(0)});else{this.actionObj.element.classList.contains("e-all-day-appointment")&&!this.actionObj.clone.classList.contains("e-all-day-appointment")&&t.setStyleAttribute(this.actionObj.clone,{height:t.formatUnit(this.actionObj.cellHeight),width:t.formatUnit(this.actionObj.cellWidth-1),pointerEvents:"none"});var o=parseInt(e.top,10);if(o=o<0?0:o,this.slotsUptoCursor<0){var l=Math.floor((this.eleTop+this.distanceUptoCursor)/i),p=Math.floor(this.eleTop/i);this.slotsUptoCursor=l-p}o=(Math.floor((o+this.distanceUptoCursor+1)/i)-this.slotsUptoCursor)*i,s=t.formatUnit(o<0?0:o);var c=this.parent.element.querySelector(".e-content-wrap").scrollHeight,h=parseInt(s,10)+this.actionObj.clone.offsetHeight;h>c&&(s=parseInt(s,10)-(h-c)+"px"),this.isPreventMultiDrag&&(s=t.formatUnit(this.actionObj.clone.offsetTop))}return{left:n,top:s}},i.prototype.setDragActionDefaultValues=function(){this.actionObj.action="drag",this.actionObj.isAllDay=null,this.actionObj.slotInterval=this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount,this.actionObj.interval=this.actionObj.slotInterval;var e=this.parent.element.querySelector(".e-work-cells");this.actionObj.cellWidth=e.offsetWidth,this.actionObj.cellHeight=e.offsetHeight},i.prototype.dragStart=function(e){var i=this,n=this.actionObj.element.getAttribute("data-guid");this.actionObj.event=this.parent.eventBase.getEventByGuid(n);var r=t.extend({},this.actionObj.event,null,!0);t.isNullOrUndefined(r)||(this.startTime=r[this.parent.eventFields.startTime].getTime()),this.parent.allowMultiDrag||this.parent.eventBase.removeSelectedAppointmentClass();var a={cancel:!1,data:r,selectedData:this.getSelectedData(),event:e,excludeSelectors:null,element:this.actionObj.element,interval:this.actionObj.interval,navigation:{enable:!1,timeDelay:2e3},scroll:{enable:!0,scrollBy:30,timeDelay:100}};this.parent.trigger("dragStart",a,function(n){if(n.cancel||!t.isNullOrUndefined(i.actionObj.element)&&t.isNullOrUndefined(i.actionObj.element.parentElement)){var s=i.actionObj.element.ej2_instances[0];return t.isNullOrUndefined(s)||s.intDestroy(e.event),i.isMultiSelect=!1,i.multiData=[],i.actionObj.action="",i.removeCloneElementClasses(),void i.removeCloneElement()}i.actionClass("addClass"),i.parent.uiStateValues.action=!0,i.actionObj.start=r[i.parent.eventFields.startTime],i.actionObj.end=r[i.parent.eventFields.endTime],i.actionObj.groupIndex=parseInt(i.actionObj.element.getAttribute("data-group-index")||"0",10),i.actionObj.interval=n.interval,i.actionObj.navigation=n.navigation,i.actionObj.scroll=n.scroll,i.enableCurrentViewDrag=a.dragWithinRange&&!a.navigation.enable&&i.parent.allowMultiDrag,i.actionObj.excludeSelectors=n.excludeSelectors;var o=i.parent.element.querySelector(".e-content-wrap");if(i.scrollArgs={element:o,width:o.scrollWidth,height:o.scrollHeight},i.widthPerMinute=i.actionObj.cellWidth/i.actionObj.slotInterval*i.actionObj.interval,i.heightPerMinute=i.actionObj.cellHeight/i.actionObj.slotInterval*i.actionObj.interval,i.widthUptoCursorPoint=0,i.heightUptoCursorPoint=0,i.cursorPointIndex=-1,i.isHeaderRows=!1,i.isTimelineDayProcess=!1,i.minDiff=0,i.isMorePopupOpened=!1,i.daysVariation=-1,i.isAllDayTarget=i.actionObj.clone.classList.contains("e-all-day-appointment"),(i.parent.activeView.isTimelineView()||!i.parent.timeScale.enable)&&"TimelineYear"!==i.parent.currentView){!t.isNullOrUndefined(i.actionObj.clone.offsetParent)&&i.actionObj.clone.offsetParent.classList.contains("e-more-event-popup")&&(i.isMorePopupOpened=!0),i.actionObj.pageX=e.event.pageX;var l=i.parent.activeViewOptions.headerRows;i.isHeaderRows=l.length>0&&"Hour"!==l[l.length-1].option&&"Date"!==l[l.length-1].option,i.isTimelineDayProcess=!i.parent.activeViewOptions.timeScale.enable||i.isHeaderRows||"TimelineMonth"===i.parent.currentView||l.length>0&&"Date"===l[l.length-1].option,i.isAllDayDrag=!i.isTimelineDayProcess&&r[i.parent.eventFields.isAllDay],i.isStepDragging=!i.isTimelineDayProcess&&!i.isAllDayDrag&&i.actionObj.slotInterval!==i.actionObj.interval,i.isTimelineDayProcess?i.timelineEventModule=new zt(i.parent,"day"):i.timelineEventModule=new zt(i.parent,"hour")}"TimelineYear"===i.parent.currentView&&(i.yearEvent=new nn(i.parent)),"Month"===i.parent.currentView&&(i.startTime=b(new Date(i.startTime)).getTime(),i.updateOriginalElement(i.actionObj.clone),i.monthEvent=new Bt(i.parent)),"Day"!==i.parent.currentView&&"Week"!==i.parent.currentView&&"WorkWeek"!==i.parent.currentView||(i.verticalEvent=new Ft(i.parent),i.verticalEvent.initializeValues(),i.splitEvent(i.actionObj.event).forEach(function(e){var n='.e-day-wrapper[data-date="'+b(e[i.parent.eventFields.startTime]).getTime()+'"]';i.parent.activeViewOptions.group.resources.length>0&&(n=n.concat('[data-group-index = "'+i.actionObj.groupIndex+'"]'));var r=i.parent.element.querySelector(n);if(r){var a=r.querySelector('[data-id="'+i.actionObj.clone.getAttribute("data-id")+'"]');a&&t.addClass([a],"e-event-action")}}))})},i.prototype.getSelectedData=function(){if(this.isMultiSelect&&0===this.multiData.length&&this.parent.selectedElements.length>0)for(var e=0,i=this.parent.selectedElements;e<i.length;e++){var n=i[e].getAttribute("data-guid"),r=this.parent.eventBase.getEventByGuid(n);this.multiData.push(t.extend({},r,null,!0))}return this.multiData},i.prototype.drag=function(e){if(e.event&&"touchmove"===e.event.type&&e.event.preventDefault(),this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(!0),t.isNullOrUndefined(e.target)||!e.target.classList||!e.target.classList.contains(pt)){var i=t.extend({},this.actionObj.event,null,!0),n=this.parent.eventBase.getPageCoordinates(e);if(this.actionObj.Y=this.actionObj.pageY=n.pageY,this.actionObj.X=this.actionObj.pageX=n.pageX,this.actionObj.target=e.target,this.widthUptoCursorPoint=0===this.widthUptoCursorPoint?Math.ceil(Math.abs(this.actionObj.clone.getBoundingClientRect().left-this.actionObj.X)/this.widthPerMinute)*this.widthPerMinute:this.widthUptoCursorPoint,this.widthUptoCursorPoint=this.isMorePopupOpened?this.actionObj.cellWidth:this.widthUptoCursorPoint,this.heightUptoCursorPoint=0===this.heightUptoCursorPoint?Math.ceil(Math.abs(this.actionObj.clone.getBoundingClientRect().top-this.actionObj.Y)/this.heightPerMinute)*this.heightPerMinute:this.heightUptoCursorPoint,["Day","Week","WorkWeek"].indexOf(this.parent.currentView)>-1&&(this.isAllDayDrag=this.parent.activeViewOptions.timeScale.enable?this.actionObj.clone.classList.contains("e-all-day-appointment"):this.actionObj.event[this.parent.eventFields.isAllDay]),this.isStepDragging&&0===this.minDiff&&this.calculateMinutesDiff(i),("Month"===this.parent.currentView||this.isAllDayDrag)&&this.daysVariation<0){var r=this.parent.getDateFromElement(this.actionObj.target);if(t.isNullOrUndefined(r))this.daysVariation=0;else{var a=b(r),s=b(new Date(i[this.parent.eventFields.startTime].getTime()));this.daysVariation=(a.getTime()-s.getTime())/Qe}}else this.daysVariation=0;if(this.parent.eventDragArea){var o=n.target;this.actionObj.clone.style.top=t.formatUnit(o.offsetTop),this.actionObj.clone.style.left=t.formatUnit(o.offsetLeft),t.closest(o,"."+$e)?"Week"!==this.parent.currentView&&"WorkWeek"!==this.parent.currentView&&"Day"!==this.parent.currentView&&(this.actionObj.clone.style.width=t.formatUnit(this.actionObj.element.offsetWidth)):(this.actionObj.clone.style.height="",this.actionObj.clone.style.width="")}this.updateScrollPosition(e),this.updateNavigatingPosition(e),this.updateDraggingDateTime(e);var l={data:i,event:e,element:this.actionObj.element,startTime:this.actionObj.start,endTime:this.actionObj.end,selectedData:this.updatedData};this.parent.group.resources.length>0&&(l.groupIndex=this.actionObj.groupIndex),this.parent.trigger("drag",l)}},i.prototype.calculateMinutesDiff=function(e){this.parent.enableRtl?this.minDiff=(this.actionObj.clone.offsetWidth-this.widthUptoCursorPoint)/this.widthPerMinute*this.actionObj.interval:this.minDiff=this.widthUptoCursorPoint/this.widthPerMinute*this.actionObj.interval;var t=e[this.parent.eventFields.startTime],i=V(this.parent.activeView.renderDates[0],this.parent.activeView.getStartHour(),this.parent.activeView.getEndHour());i.startHour.getTime()>t.getTime()&&(this.minDiff=this.minDiff+(i.startHour.getTime()-t.getTime())/Ke)},i.prototype.dragStop=function(e){var i=this;if(this.isCursorAhead=!1,this.isPreventMultiDrag=!1,this.removeCloneElementClasses(),this.removeCloneElement(),clearInterval(this.actionObj.navigationInterval),this.actionObj.navigationInterval=null,clearInterval(this.actionObj.scrollInterval),this.actionObj.scrollInterval=null,this.actionClass("removeClass"),this.parent.uiStateValues.action=this.parent.uiStateValues.isTapHold=!1,!this.isAllowDrop(e)){var n=e.target.classList&&!e.target.classList.contains("e-work-cells")&&this.parent.cellTemplate?t.closest(e.target,".e-work-cells"):e.target,r={cancel:!1,data:this.getChangedData(this.updatedData),selectedData:this.updatedData,event:e,element:this.actionObj.element,target:n};this.actionObj.action=null,this.parent.trigger("dragStop",r,function(e){if(!e.cancel&&!i.parent.eventBase.checkOverlap(e.data)){if(i.parent.isSpecificResourceEvents()){i.parent.crudModule.crudObj.isCrudAction=!0,i.parent.crudModule.crudObj.sourceEvent=[i.parent.resourceBase.lastResourceLevel[parseInt(r.element.getAttribute("data-group-index"),10)]];var t=parseInt(r.target.getAttribute("data-group-index"),10)||i.actionObj.groupIndex;i.parent.crudModule.crudObj.targetEvent=[i.parent.resourceBase.lastResourceLevel[parseInt(t.toString(),10)]]}i.saveChangedData(e,i.isMultiSelect)}}),this.updatedData=[],this.multiData=[],this.isMultiSelect=!1,this.parent.selectedElements=[]}},i.prototype.updateNavigatingPosition=function(e){var i=this;if(this.actionObj.navigation.enable){var n=this.parent.getCurrentTime();t.isNullOrUndefined(this.actionObj.navigationInterval)&&(this.actionObj.navigationInterval=window.setInterval(function(){if(n){var t=i.parent.getCurrentTime().getSeconds(),r=n.getSeconds()+i.actionObj.navigation.timeDelay/1e3;(r=r>=60?r-60:r)===t&&(n=i.parent.getCurrentTime(),i.viewNavigation(e),i.updateDraggingDateTime(e))}},this.actionObj.navigation.timeDelay))}},i.prototype.updateDraggingDateTime=function(e){!t.isNullOrUndefined(this.actionObj.clone.offsetParent)&&this.actionObj.clone.offsetParent.classList.contains("e-more-event-popup")?this.morePopupEventDragging(e):this.parent.activeView.isTimelineView()&&"TimelineYear"!==this.parent.currentView?(this.timelineEventModule.dateRender=this.parent.activeView.renderDates,this.timelineEventModule.cellWidth=this.actionObj.cellWidth,this.timelineEventModule.getSlotDates(),this.actionObj.cellWidth=this.isHeaderRows?this.timelineEventModule.cellWidth:this.parent.getElementWidth(this.parent.element.querySelector(".e-work-cells")),this.calculateTimelineTime(e)):"Month"===this.parent.currentView||"TimelineYear"===this.parent.currentView?this.calculateVerticalDate(e):this.calculateVerticalTime(e)},i.prototype.navigationWrapper=function(){if(this.parent.activeView.isTimelineView()){var e=void 0;if(e=this.parent.activeViewOptions.group.resources.length>0?this.parent.element.querySelectorAll(".e-appointment-container:not(.e-hidden)").item(this.actionObj.index):this.parent.element.querySelector("."+at),!t.isNullOrUndefined(e)){var i=e.querySelector(".e-appointment-wrapper");i||(i=t.createElement("div",{className:"e-appointment-wrapper"}),e.appendChild(i)),this.actionObj.cloneElement.forEach(function(e){i.appendChild(e)})}}else if("Month"!==this.parent.currentView&&this.parent.timeScale.enable){var n=this.actionObj.clone.classList.contains("e-all-day-appointment")?".e-all-day-appointment-wrapper":".e-appointment-wrapper";if(this.parent.element.querySelectorAll(n).item(this.actionObj.index).appendChild(this.actionObj.clone),".e-all-day-appointment-wrapper"===n){var r=this.getAllDayEventHeight(),a=[].slice.call(this.parent.element.querySelectorAll(".e-all-day-cells:first-child"));if(a[0].offsetHeight<r)for(var s=0,o=a;s<o.length;s++)o[s].style.height=(r+2)/12+"em";this.actionObj.clone.style.height=t.formatUnit(r)}this.actionObj.height=parseInt(this.actionObj.clone.style.height,10)}else{var l=[].slice.call(this.parent.element.querySelectorAll(".e-work-cells"));this.actionObj.index=this.parent.activeView.renderDates.length<this.actionObj.index?this.parent.activeView.renderDates.length-1:this.actionObj.index;var p=l[this.actionObj.index].querySelector(".e-appointment-wrapper");p||(p=t.createElement("div",{className:"e-appointment-wrapper"}),l[this.actionObj.index].appendChild(p)),p.appendChild(this.actionObj.clone)}},i.prototype.viewNavigation=function(e){var i,n=this.parent.element.querySelector(".e-content-wrap");n&&(!this.scrollEdges.top&&!this.scrollEdges.bottom||t.closest(this.actionObj.clone,".e-all-day-appointment-wrapper"))&&(0===n.scrollLeft&&Math.round(this.actionObj.X)<=Math.round(n.getBoundingClientRect().left+this.actionObj.cellWidth+window.pageXOffset)?i=this.parent.enableRtl?"Next":"Previous":Math.round(n.scrollLeft)+n.clientWidth===n.scrollWidth&&Math.round(this.actionObj.X)>=Math.round(n.getBoundingClientRect().right-this.actionObj.cellWidth+window.pageXOffset)&&(i=this.parent.enableRtl?"Previous":"Next"),i&&this.parent.changeDate(this.parent.activeView.getNextPreviousDate(i)))},i.prototype.morePopupEventDragging=function(e){if(!(t.isNullOrUndefined(e.target)||e.target&&t.isNullOrUndefined(t.closest(e.target,"td")))){var i=t.extend({},this.actionObj.event,null,!0),n=i[this.parent.eventFields.endTime].getTime()-i[this.parent.eventFields.startTime].getTime(),r=t.closest(e.target,"td");if("TimelineYear"!==this.parent.currentView||r.classList.contains("e-work-cells")&&!r.classList.contains("e-other-month")){var a=this.parent.getDateFromElement(r),s=new Date(a.getTime());s.setMilliseconds(n),this.parent.activeViewOptions.group.resources.length>0&&(this.actionObj.groupIndex=parseInt(r.getAttribute("data-group-index"),10)),this.actionObj.start=new Date(a.getTime()),this.actionObj.end=new Date(s.getTime()),this.actionObj.clone.style.top=t.formatUnit(r.offsetParent.offsetTop),this.actionObj.clone.style.left=t.formatUnit(r.offsetLeft),this.actionObj.clone.style.width=t.formatUnit(r.offsetWidth),this.actionObj.cloneElement.length>1&&this.actionObj.cloneElement.forEach(function(e){e.style.width=t.formatUnit(r.offsetWidth)});var o,l=r;if(this.parent.activeView.isTimelineView()){var p=t.closest(r,"tr").rowIndex;l=this.parent.element.querySelectorAll(".e-appointment-container").item(p)}(o=l.querySelector(".e-appointment-wrapper"))||(o=t.createElement("div",{className:"e-appointment-wrapper"}),l.appendChild(o)),this.appendCloneElement(o)}}},i.prototype.calculateVerticalTime=function(e){var i=this;if(!(t.isNullOrUndefined(this.actionObj.target)||this.actionObj.target&&t.isNullOrUndefined(t.closest(this.actionObj.target,"tr")))&&(t.isNullOrUndefined(t.closest(this.actionObj.target,"td"))||t.closest(this.actionObj.target,"td").classList.contains("e-work-cells")||t.closest(this.actionObj.target,"td").classList.contains("e-all-day-cells"))){this.parent.activeViewOptions.timeScale.enable&&this.swapDragging(e);var n=this.parent.element.querySelector(".e-content-wrap"),r=t.extend({},this.actionObj.event,null,!0),a=r[this.parent.eventFields.startTime],s=L(r[this.parent.eventFields.endTime])-L(a),o=Math.floor(parseInt(this.actionObj.clone.style.top,10)/this.actionObj.cellHeight)*this.actionObj.cellHeight;o=o<0?0:o,(this.scrollEdges.top||this.scrollEdges.bottom)&&(o=this.scrollEdges.top?n.scrollTop-this.heightUptoCursorPoint+this.actionObj.cellHeight+window.pageYOffset:n.scrollTop+n.offsetHeight-this.actionObj.clone.offsetHeight+window.pageYOffset+(this.actionObj.clone.offsetHeight-this.heightUptoCursorPoint),o=Math.round(o/this.actionObj.cellHeight)*this.actionObj.cellHeight,n.scrollTop>0&&o<n.scrollHeight&&(this.actionObj.clone.style.top=t.formatUnit(o)));var l,p=this.parent.activeViewOptions.timeScale.enable?o/this.actionObj.cellHeight:0,c=this.actionObj.cellHeight/this.actionObj.slotInterval,h=parseInt(this.actionObj.clone.style.top,10)-o;l=this.isAllDayDrag?this.parent.element.querySelector(".e-all-day-row"):[].slice.call(this.parent.getContentTable().querySelectorAll("tr"))[parseInt(p.toString(),10)];var d;t.isNullOrUndefined(t.closest(this.actionObj.target,"td"))||!t.closest(this.actionObj.target,"td").classList.contains("e-work-cells")&&!t.closest(this.actionObj.target,"td").classList.contains("e-all-day-cells")||(d=t.closest(this.actionObj.target,"td").cellIndex);var u=t.isNullOrUndefined(d)?t.closest(this.actionObj.clone,"td").cellIndex:d;if(this.actionObj.index=u,!t.isNullOrUndefined(l)){var g=l.children[parseInt(u.toString(),10)];this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(this.actionObj.groupIndex=parseInt(g.getAttribute("data-group-index"),10));var v,m;if(this.parent.activeViewOptions.timeScale.enable&&!this.isAllDayDrag)this.enableCurrentViewDrag&&0!==this.multiData.length||this.appendCloneElement(this.getEventWrapper(u)),(v=this.parent.getDateFromElement(g)).setMinutes(v.getMinutes()+h/c),m=new Date(v.getTime()),this.actionObj.element.classList.contains("e-all-day-appointment")?m.setMinutes(m.getMinutes()+this.actionObj.slotInterval):m.setMilliseconds(s);else{(v=this.parent.getDateFromElement(g)).setDate(v.getDate()-this.daysVariation),v.setHours(a.getHours(),a.getMinutes(),a.getSeconds()),(m=new Date(v.getTime())).setMilliseconds(s),!this.actionObj.element.classList.contains("e-all-day-appointment")&&this.actionObj.clone.classList.contains("e-all-day-appointment")&&(m=O(b(m),1));var f=this.parent.activeViewOptions.group.byDate||this.parent.virtualScrollModule&&!this.parent.activeViewOptions.timeScale.enable?u:void 0;this.updateAllDayEvents(v,m,f)}this.actionObj.start=new Date(+v),this.actionObj.end=new Date(+m);for(var y=this.getUpdatedEvent(this.actionObj.start,this.actionObj.end,this.actionObj.event),T=0,w=[].slice.call(this.parent.element.querySelectorAll(".e-dynamic-clone"));T<w.length;T++){R=w[T];t.remove(R)}if(this.multiData.length>0){if(this.isAllDayTarget&&this.isAllDayDrag&&!t.isNullOrUndefined(this.actionObj.isAllDay)&&!this.actionObj.isAllDay){var D=parseInt(t.closest(this.actionObj.target,"td").getAttribute("data-date"),10);this.multiData.forEach(function(e){if(i.swagData.push(t.extend({},e,null,!0)),e[i.parent.eventFields.isAllDay]){e[i.parent.eventFields.startTime]=new Date(e[i.parent.eventFields.startTime].getTime()+(D-i.startTime));var n=new Date(e[i.parent.eventFields.startTime]),r=new Date(n.setMinutes(n.getMinutes()+i.actionObj.slotInterval));e[i.parent.eventFields.endTime]=r,e[i.parent.eventFields.isAllDay]=!1}}),this.startTime=D}if(this.isAllDayTarget&&this.isAllDayDrag&&!t.isNullOrUndefined(this.actionObj.isAllDay)&&this.actionObj.isAllDay&&this.swagData.length>0){this.multiData=this.swagData,this.swagData=[];var C=t.extend({},this.actionObj.event,null,!0);this.startTime=C[this.parent.eventFields.startTime].getTime()}var S=y[this.parent.eventFields.startTime].getTime()-this.startTime;if(this.enableCurrentViewDrag)for(var E=this.getRenderedDates(),x=0;x<this.multiData.length;x++){var V=t.extend({},this.multiData[parseInt(x.toString(),10)],null,!0),A=new Date(V[this.parent.eventFields.startTime].getTime()+S);if((k=this.parent.getIndexOfDate(E,b(A)))<0){this.isPreventMultiDrag=!0;break}this.isPreventMultiDrag=!1}if(!this.isPreventMultiDrag)for(var I=0;I<this.multiData.length;I++){this.updatedData[parseInt(I.toString(),10)]=this.updateMultipleData(this.multiData[parseInt(I.toString(),10)],S);var k=this.getDayIndex(this.updatedData[parseInt(I.toString(),10)]);if(k>=0){var M=this.updatedData[parseInt(I.toString(),10)][this.parent.eventFields.isAllDay],R=this.getEventWrapper(k,M);this.appendCloneElement(R,this.actionObj.cloneElement[parseInt(I.toString(),10)]),this.updateEventHeight(this.updatedData[parseInt(I.toString(),10)],I,k)}else t.isNullOrUndefined(this.actionObj.cloneElement[parseInt(I.toString(),10)].parentNode)||t.remove(this.actionObj.cloneElement[parseInt(I.toString(),10)])}}else this.updateEventHeight(y);this.updateTimePosition(this.actionObj.start,this.updatedData)}}},i.prototype.splitEvent=function(e){var i=this.parent.eventFields,n=[],r=e[i.startTime],a=e[i.endTime];if(b(new Date(r.getTime()))<b(new Date(a.getTime()))){for(var s=b(new Date(r.getTime())),o=new Date(s.getTime()),l=0;s<new Date(a.getTime());l++){o=new Date(o.setDate(s.getDate()+1));var p=t.extend({},e,null,!0);p[i.startTime]=new Date(s),p[i.endTime]=new Date(o),s=new Date(s.setDate(s.getDate()+1)),n.push(p)}var c=n.length-1;n[0][i.startTime]=r,n[parseInt(c.toString(),10)][i.endTime]=a}else n.push(e);return n},i.prototype.updateMultipleData=function(e,i){var n=t.extend({},e,null,!0);!t.isNullOrUndefined(this.actionObj.isAllDay)&&this.parent.activeViewOptions.timeScale.enable&&(this.isAllDayTarget&&n[this.parent.eventFields.isAllDay]||!this.isAllDayTarget&&!n[this.parent.eventFields.isAllDay])&&(n[this.parent.eventFields.isAllDay]=this.actionObj.isAllDay);var r=n[this.parent.eventFields.endTime].getTime()-n[this.parent.eventFields.startTime].getTime();if(n[this.parent.eventFields.isAllDay]){var a=Math.ceil(i/864e5),s=Math.ceil(r/864e5),o=new Date(n[this.parent.eventFields.startTime]);n[this.parent.eventFields.startTime]=b(new Date(o.setDate(o.getDate()+a))),n[this.parent.eventFields.endTime]=O(n[this.parent.eventFields.startTime],s)}else n[this.parent.eventFields.startTime]=new Date(n[this.parent.eventFields.startTime].getTime()+i),n[this.parent.eventFields.endTime]=new Date(n[this.parent.eventFields.startTime].getTime()+r);return n},i.prototype.getDayIndex=function(e){var i=t.extend({},e,null,!0),n=b(i[this.parent.eventFields.startTime]);if(this.parent.activeViewOptions.timeScale.enable&&!i[this.parent.eventFields.isAllDay]){var r=this.parent.activeView.getStartHour();n.setMilliseconds(r.getTime()-b(r).getTime())}var a=n.getTime(),s="",o="e-day-wrapper";return o=this.parent.activeViewOptions.timeScale.enable&&i[this.parent.eventFields.isAllDay]?"e-all-day-appointment-wrapper":"e-work-cells",s="."+o+'[data-date="'+a+'"]',this.parent.activeViewOptions.group.resources.length>0&&(s=s+'[data-group-index="'+this.actionObj.groupIndex+'"]'),this.targetTd=this.parent.element.querySelector(s),t.isNullOrUndefined(this.targetTd)?-1:this.targetTd.cellIndex},i.prototype.updateEventHeight=function(e,i,n){this.verticalEvent.initializeValues();var r=this.verticalEvent.getStartCount();if(!this.parent.uiStateValues.isGroupAdaptive)for(c=0;c<this.actionObj.groupIndex;c++)this.verticalEvent.dateRender[parseInt(c.toString(),10)]&&(r+=this.verticalEvent.dateRender[parseInt(c.toString(),10)].length);var a=this.parent.uiStateValues.isGroupAdaptive?r:this.actionObj.groupIndex;if(!(!this.parent.activeViewOptions.group.byDate||t.isNullOrUndefined(this.parent.getDateFromElement(this.actionObj.target)))||!this.parent.activeViewOptions.group.byDate)for(var s=-1,o=this.parent.activeViewOptions.group.byDate?this.parent.getIndexOfDate(this.verticalEvent.dateRender[parseInt(a.toString(),10)],b(this.parent.getDateFromElement(t.isNullOrUndefined(i)?this.actionObj.target:this.targetTd))):t.isNullOrUndefined(i)?this.actionObj.index-r:n-r,l=this.splitEvent(e),p=this.parent.eventBase.isAllDayAppointment(e)||l.length>2||"TimeSlot"!==this.parent.eventSettings.spannedEventPlacement?[e]:l,c=0;c<p.length;c++){if(c>0){var h='.e-day-wrapper[data-date="'+b(p[parseInt(c.toString(),10)][this.parent.eventFields.startTime]).getTime()+'"]';this.parent.activeViewOptions.group.resources.length>0&&(h=h.concat('[data-group-index = "'+this.actionObj.groupIndex+'"]'));var d=this.parent.element.querySelector(h);d?(o+=1,s=d.cellIndex):o=-1}if(o>=0){var u=this.verticalEvent.isSpannedEvent(p[parseInt(c.toString(),10)],o,a),g=u[this.verticalEvent.fields.startTime],v=u[this.verticalEvent.fields.endTime],m=this.parent.activeViewOptions.timeScale.enable?this.verticalEvent.getHeight(g,v):this.actionObj.element.offsetHeight,f=this.parent.activeViewOptions.timeScale.enable?this.verticalEvent.getTopValue(g):this.actionObj.element.offsetTop;if(t.isNullOrUndefined(i))0===c?(this.actionObj.clone.classList.contains("e-all-day-appointment")&&(f=this.parent.element.querySelector(".e-all-day-row").offsetTop,m=this.getAllDayEventHeight()),this.actionObj.clone.style.top=t.formatUnit(f),this.actionObj.clone.style.height=t.formatUnit(m)):this.renderSpannedEvents(u,s,f,m);else{var y=this.actionObj.cellWidth;if(e[this.parent.eventFields.isAllDay]&&this.parent.activeViewOptions.timeScale.enable){var T=e[this.parent.eventFields.endTime].getTime()-e[this.parent.eventFields.startTime].getTime(),w=Math.ceil(T/864e5);w>=0&&(y=w*this.actionObj.cellWidth)}this.actionObj.cloneElement[parseInt(i.toString(),10)]&&(0===c?(this.actionObj.cloneElement[parseInt(i.toString(),10)].style.top=t.formatUnit(f),this.actionObj.cloneElement[parseInt(i.toString(),10)].style.height=t.formatUnit(m),this.actionObj.cloneElement[parseInt(i.toString(),10)].style.width=t.formatUnit(y),this.actionObj.cloneElement[parseInt(i.toString(),10)].style.left=t.formatUnit(0)):this.renderSpannedEvents(u,s,f,m))}}}},i.prototype.renderSpannedEvents=function(e,i,n,r){if(e[this.parent.eventFields.startTime].getTime()!==e[this.parent.eventFields.endTime].getTime()){var a=this.verticalEvent.createAppointmentElement(e,!1,e.isSpanned,this.actionObj.groupIndex);t.addClass([a],["e-schedule-event-clone","e-dynamic-clone"]),t.setStyleAttribute(a,{width:"100%",height:r+"px",top:n+"px",border:"0px"}),[].slice.call(this.parent.element.querySelectorAll(".e-appointment-wrapper"))[parseInt(i.toString(),10)].appendChild(a)}},i.prototype.getRenderedDates=function(){var e,t,i=this,n=this.parent.activeView.renderDates;return(e=this.parent.eventBase.slots).push.apply(e,this.parent.activeView.renderDates.map(function(e){return+e})),this.parent.activeViewOptions.group.resources.length>0&&(this.parent.eventBase.slots=[],n=this.parent.resourceBase.lastResourceLevel.filter(function(e){return e.groupIndex===i.actionObj.groupIndex})[0].renderDates,(t=this.parent.eventBase.slots).push.apply(t,n.map(function(e){return+e}))),n},i.prototype.updateAllDayEvents=function(e,i,n){this.parent.eventBase.slots=[];var r=this.getUpdatedEvent(e,i,this.actionObj.event),a=this.getRenderedDates(),s=this.parent.eventBase.splitEvent(r,a),o='.e-all-day-cells[data-date="'+s[0][this.parent.eventFields.startTime].getTime()+'"]';this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(o=o.concat('[data-group-index = "'+this.actionObj.groupIndex+'"]'));var l=[].slice.call(this.parent.element.querySelectorAll(o));if(l.length>0||!t.isNullOrUndefined(n)){var p=t.isNullOrUndefined(n)?l[0].cellIndex:n;this.appendCloneElement(this.getEventWrapper(p)),this.actionObj.clone.style.width=t.formatUnit(s[0].data.count*this.actionObj.cellWidth)}},i.prototype.swapDragging=function(e){if(!this.isPreventMultiDrag){var i=!t.isNullOrUndefined(t.closest(this.actionObj.target,"td"))&&t.closest(this.actionObj.target,"td").cellIndex;if(t.closest(this.actionObj.target,".e-date-header-wrap")&&!t.closest(this.actionObj.clone,".e-all-day-appointment-wrapper")){t.addClass([this.actionObj.clone],"e-all-day-appointment"),this.appendCloneElement(this.getEventWrapper(i)),this.actionObj.isAllDay=!0;var n=this.getAllDayEventHeight(),r=[].slice.call(this.parent.element.querySelectorAll(".e-all-day-cells:first-child"));if(r[0].offsetHeight<n)for(var a=0,s=r;a<s.length;a++)s[a].style.height=(n+2)/12+"em";t.setStyleAttribute(this.actionObj.clone,{width:t.formatUnit(this.actionObj.cellWidth),height:t.formatUnit(n),top:t.formatUnit(this.parent.element.querySelector(".e-all-day-row").offsetTop)})}if(t.closest(this.actionObj.target,".e-work-cells")&&!t.closest(this.actionObj.clone,".e-day-wrapper")){t.removeClass([this.actionObj.clone],"e-all-day-appointment"),this.appendCloneElement(this.getEventWrapper(i)),this.actionObj.isAllDay=!1;var o=0===this.actionObj.element.offsetHeight?this.actionObj.height:this.actionObj.element.offsetHeight;t.setStyleAttribute(this.actionObj.clone,{left:t.formatUnit(0),height:t.formatUnit(o),width:t.formatUnit(this.actionObj.cellWidth)})}}},i.prototype.calculateVerticalDate=function(e){if(!(t.isNullOrUndefined(e.target)||e.target&&t.isNullOrUndefined(t.closest(e.target,"tr"))||e.target&&"DIV"===e.target.tagName)){var i=t.extend({},this.actionObj.event,null,!0);t.isNullOrUndefined(this.parent.eventDragArea)&&this.removeCloneElement();var n=L(i[this.parent.eventFields.endTime])-L(i[this.parent.eventFields.startTime]),r=t.closest(this.actionObj.target,"td");if(!t.isNullOrUndefined(r)){var a=r.parentElement;this.actionObj.index=a.rowIndex*a.children.length+r.cellIndex,r=[].slice.call(this.parent.element.querySelectorAll(".e-work-cells"))[this.actionObj.index];var s=this.parent.getDateFromElement(r);if(!t.isNullOrUndefined(s)){this.parent.activeViewOptions.group.resources.length>0&&(this.actionObj.groupIndex=parseInt(r.getAttribute("data-group-index"),10));var o=new Date(s.setDate(s.getDate()-this.daysVariation)),l=new Date(o.getTime()),p=L(i[this.parent.eventFields.startTime])-L(b(new Date(+i[this.parent.eventFields.startTime])));l.setMilliseconds(p);var c=new Date(l.getTime());c.setMilliseconds(n),this.actionObj.start=new Date(l.getTime()),this.actionObj.end=new Date(c.getTime())}}var h=this.getUpdatedEvent(this.actionObj.start,this.actionObj.end,this.actionObj.event);if(t.isNullOrUndefined(this.parent.eventDragArea))for(var d=0,u=[].slice.call(this.parent.element.querySelectorAll(".e-schedule-event-clone"));d<u.length;d++){var g=u[d];t.remove(g)}if(this.multiData&&this.multiData.length>0){var v=b(new Date(h[this.parent.eventFields.startTime])),p=v.getTime()-this.startTime;"TimelineYear"===this.parent.currentView&&this.parent.group.resources.length>0&&(p=12*(v.getFullYear()-new Date(this.startTime).getFullYear()),p-=new Date(this.startTime).getMonth(),p+=v.getMonth());for(var m=0;m<this.multiData.length;m++)this.updatedData[parseInt(m.toString(),10)]=this.updateMultipleVerticalDate(this.multiData[parseInt(m.toString(),10)],p),"TimelineYear"===this.parent.currentView?this.dynamicYearlyEventsRendering(this.updatedData[parseInt(m.toString(),10)]):this.dynamicEventsRendering(this.updatedData[parseInt(m.toString(),10)])}else"TimelineYear"===this.parent.currentView?this.dynamicYearlyEventsRendering(h):this.dynamicEventsRendering(h)}},i.prototype.updateMultipleVerticalDate=function(e,i){var n=t.extend({},e,null,!0),r=n[this.parent.eventFields.endTime].getTime()-n[this.parent.eventFields.startTime].getTime(),a=new Date(n[this.parent.eventFields.startTime]);if("TimelineYear"===this.parent.currentView&&this.parent.group.resources.length>0)n[this.parent.eventFields.startTime]=new Date(a.setMonth(a.getMonth()+i));else{var s=Math.ceil(i/Qe);n[this.parent.eventFields.startTime]=new Date(a.setDate(a.getDate()+s))}return n[this.parent.eventFields.endTime]=new Date(n[this.parent.eventFields.startTime].getTime()+r),n},i.prototype.calculateTimelineTime=function(e){var i=t.extend({},this.actionObj.event,null,!0),n=L(i[this.parent.eventFields.endTime])-L(i[this.parent.eventFields.startTime]),r=this.parent.enableRtl?Math.abs(this.actionObj.clone.offsetLeft)-this.actionObj.clone.offsetWidth:parseInt(this.actionObj.clone.style.left,10);r=Math.round(r/this.actionObj.cellWidth)*this.actionObj.cellWidth;var a;this.parent.enableRtl&&(a=Math.abs(parseInt(this.actionObj.clone.style.right,10)),this.actionObj.clone.style.right=t.formatUnit(a)),r=this.getOffsetValue(r,a);var s=this.getColumnIndex(r),o=this.parent.element.querySelector(".e-content-wrap"),l=o.getBoundingClientRect().right,p=this.parent.activeView.isTimelineView()&&!this.parent.enableRtl&&this.actionObj.pageX>this.actionObj.clone.getBoundingClientRect().right&&!this.isMorePopupOpened&&!(this.actionObj.pageX>l),c=this.parent.eventDragArea?o.scrollLeft-o.offsetLeft:0;!this.isCursorAhead&&!p||this.isStepDragging||(this.isCursorAhead=!0);var h=Math.floor((this.actionObj.pageX-this.actionObj.clone.getBoundingClientRect().left+c)/this.actionObj.cellWidth);this.parent.enableRtl&&(h=Math.abs(Math.floor((this.actionObj.pageX-this.actionObj.clone.getBoundingClientRect().right)/this.actionObj.cellWidth))-1),this.cursorPointIndex<0&&this.cursorIndex(e,i,r,h);var d=this.parent.getContentTable().querySelector("tr"),u=this.getCursorCurrentIndex(s,h,d);u=u<0?0:u;var g=this.isHeaderRows?new Date(this.timelineEventModule.dateRender[parseInt(u.toString(),10)].getTime()):this.parent.getDateFromElement(d.children[parseInt(u.toString(),10)]);if(g=this.isAllDayDrag?b(g):g,this.isStepDragging){var v=this.getWidthDiff(d,u);if(0!==v){var m=Math.ceil(v/this.widthPerMinute);if(g.setMinutes(g.getMinutes()+m*this.actionObj.interval),this.isCursorAhead||p)g.setMilliseconds(-n);else{g.setMinutes(g.getMinutes()-this.minDiff);var f=this.actionObj.interval*Ke;m=Math.abs(g.getTime()-this.actionObj.start.getTime())/f;var y=Math.trunc(m);y!==m&&(m=y*f*(g>this.actionObj.start?1:-1),g=new Date(this.actionObj.start.getTime()+m))}}else g=this.actionObj.start}else if(!this.isCursorAhead&&!p||this.isAllDayDrag)g.setMinutes(g.getMinutes()-this.cursorPointIndex*(this.isTimelineDayProcess||this.isAllDayDrag?1440:this.actionObj.slotInterval));else{var T=this.isTimelineDayProcess||this.isAllDayDrag?1440:this.actionObj.slotInterval;g.setMinutes(g.getMinutes()+T),g.setMilliseconds(-n),g.getTime()===b(g).getTime()&&0===g.getMinutes()&&0===n&&g.setMinutes(-T)}if(this.isStepDragging||(g=this.calculateIntervalTime(g)),this.isTimelineDayProcess||this.isAllDayDrag){D=i[this.parent.eventFields.startTime];g.setHours(D.getHours(),D.getMinutes(),D.getSeconds())}if(this.parent.eventDragArea){var w=this.parent.getDateFromElement(e.target);if(!t.isNullOrUndefined(w))if(this.parent.activeViewOptions.timeScale.enable&&"TimelineMonth"!==this.parent.currentView)g=w;else{var D=i[this.parent.eventFields.startTime];g=new Date(w.setHours(D.getHours(),D.getMinutes(),D.getSeconds()))}}var C=new Date(g.getTime());C.setMilliseconds(n);var S=[this.getUpdatedEvent(g,C,this.actionObj.event)];if(this.multiData.length>0){for(var O=S[0][this.parent.eventFields.startTime].getTime()-this.startTime,E=0;E<this.multiData.length;E++)this.updatedData[parseInt(E.toString(),10)]=this.updateMultipleData(this.multiData[parseInt(E.toString(),10)],O);S=this.updatedData}for(var x=0;x<S.length;x++){var V=this.multiData.length>0?this.actionObj.cloneElement[parseInt(x.toString(),10)]:this.actionObj.clone;if(t.isNullOrUndefined(this.parent.eventDragArea)){var A=this.timelineEventModule.splitEvent(S[parseInt(x.toString(),10)],this.timelineEventModule.dateRender),I=A[0].data,k=this.timelineEventModule.getStartTime(A[0],I),M=this.timelineEventModule.getEndTime(A[0],I),R=this.timelineEventModule.getEventWidth(k,M,i[this.parent.eventFields.isAllDay],I.count),H=this.parent.getIndexOfDate(this.timelineEventModule.dateRender,b(new Date(k.getTime())));H=H<0?0:H;var P=this.timelineEventModule.getPosition(k,M,i[this.parent.eventFields.isAllDay],H);this.parent.enableRtl?V.style.right=t.formatUnit(P):V.style.left=t.formatUnit(P),this.isMorePopupOpened||(V.style.width=t.formatUnit(R))}this.parent.activeViewOptions.group.resources.length>0&&this.calculateResourceGroupingPosition(e,V),this.actionObj.start=new Date(g.getTime()),this.actionObj.end=new Date(C.getTime()),this.updateTimePosition(this.actionObj.start,this.updatedData)}},i.prototype.getOffsetValue=function(e,i){if(this.scrollEdges.left||this.scrollEdges.right){var n=this.parent.element.querySelector(".e-content-wrap");this.parent.enableRtl?(i=n.offsetWidth-n.scrollLeft,this.scrollEdges.right?i=i-n.offsetWidth+this.actionObj.clone.offsetWidth-(this.actionObj.clone.offsetWidth-this.widthUptoCursorPoint):(i+=this.widthUptoCursorPoint)-this.widthUptoCursorPoint>=n.scrollWidth&&(this.actionObj.clone.style.width=t.formatUnit(this.actionObj.clone.offsetWidth-this.widthUptoCursorPoint+this.actionObj.cellWidth),i=n.scrollLeft-n.scrollWidth),t.isNullOrUndefined(this.parent.eventDragArea)&&(this.actionObj.clone.style.left=t.formatUnit(i))):(this.scrollEdges.left?(e=n.scrollLeft-this.widthUptoCursorPoint+this.actionObj.cellWidth,n.scrollLeft+n.offsetWidth>=n.offsetWidth?n.scrollLeft=n.scrollLeft-1:0===this.actionObj.clone.offsetLeft&&(e=n.scrollLeft)):e=n.scrollLeft+n.offsetWidth-this.actionObj.clone.offsetWidth+(this.actionObj.clone.offsetWidth-this.widthUptoCursorPoint),e=e<0?0:e,t.isNullOrUndefined(this.parent.eventDragArea)&&(this.actionObj.clone.style.left=t.formatUnit(e)))}return e},i.prototype.getWidthDiff=function(e,t){var i=this.scrollArgs.element.getBoundingClientRect();if(i.left<=this.actionObj.pageX&&i.right>=this.actionObj.pageX){var n=e.children[parseInt(t.toString(),10)].offsetLeft,r=this.actionObj.pageX-i.left;return this.parent.enableRtl?n+this.actionObj.cellWidth-(this.scrollArgs.element.scrollLeft+r):this.scrollArgs.element.scrollLeft+r-n}return 0},i.prototype.getColumnIndex=function(e){var t=Math.round(e/this.actionObj.cellWidth);return this.isHeaderRows?t:this.getIndex(t)},i.prototype.getCursorCurrentIndex=function(e,t,i){var n=e+t;if(this.isHeaderRows){var r=Math.floor(i.offsetWidth/this.actionObj.cellWidth);return n>r-1?r-1:n}return n>i.children.length-1?i.children.length-1:n},i.prototype.cursorIndex=function(e,i,n,r){var a=t.closest(e.target,".e-work-cells");if(t.isNullOrUndefined(a)||this.isMorePopupOpened)this.cursorPointIndex=0;else{var s=this.parent.getDateFromElement(a);if(s=this.isAllDayDrag?b(s):s,this.isHeaderRows){var o=Math.floor(n/this.actionObj.cellWidth);s=new Date(this.timelineEventModule.dateRender[o+r].getTime())}var l=s.getTime()-i[this.parent.eventFields.startTime].getTime();if(this.isTimelineDayProcess||this.isAllDayDrag)this.cursorPointIndex=Math.abs(Math.ceil(l/Qe));else{var p=Math.floor(l/Ke/(this.actionObj.slotInterval/this.actionObj.cellWidth));this.cursorPointIndex=Math.floor(p/this.actionObj.cellWidth),this.cursorPointIndex=this.cursorPointIndex<0?0:this.cursorPointIndex}}},i.prototype.calculateResourceGroupingPosition=function(e,i){var n=this.parent.element.querySelector(".e-content-wrap"),r=[].slice.call(this.parent.element.querySelectorAll(".e-content-wrap .e-content-table tr:not(.e-hidden)")),a=u(n.querySelector("table"));a=t.isNullOrUndefined(a)?0:a;var s=this.parent.rowAutoHeight?~~(n.querySelector("table").offsetHeight/r.length):this.actionObj.cellHeight,o=Math.floor(Math.floor(this.actionObj.Y+(n.scrollTop-a-(window.scrollY||window.pageYOffset))-z(n,this.parent.uiStateValues.isTransformed))/s);o=o<0?0:o>r.length-1?r.length-1:o,this.actionObj.index=o;var l=this.parent.element.querySelectorAll(".e-appointment-container:not(.e-hidden)").item(o),p=l.querySelector(".e-appointment-wrapper");p||(p=t.createElement("div",{className:"e-appointment-wrapper"}),l.appendChild(p)),this.appendCloneElement(p,i);var c=t.closest(this.actionObj.target,"td");if(this.actionObj.groupIndex=c&&!isNaN(parseInt(c.getAttribute("data-group-index"),10))?parseInt(c.getAttribute("data-group-index"),10):this.actionObj.groupIndex,t.isNullOrUndefined(this.parent.eventDragArea)){var h=this.parent.getElementHeight(r[parseInt(o.toString(),10)])*o;if(this.parent.rowAutoHeight){var d=this.getCursorElement(e);d&&(h=d.classList.contains("e-work-cells")?d.offsetTop:d.offsetParent&&d.offsetParent.classList.contains("e-appointment")?d.offsetParent.offsetTop:h)}i.style.top=t.formatUnit(h)}},i.prototype.appendCloneElement=function(e,i){void 0===i&&(i=null),i=t.isNullOrUndefined(i)?this.actionObj.clone:i;var n=document.querySelector(this.parent.eventDragArea);this.parent.eventDragArea&&n?n.appendChild(i):e.appendChild(i)},i.prototype.getEventWrapper=function(e,i){var n;if(t.isNullOrUndefined(i)&&(i=this.actionObj.clone.classList.contains("e-all-day-appointment")),this.parent.activeViewOptions.timeScale.enable){var r=i?".e-all-day-appointment-wrapper":".e-appointment-wrapper";n=this.parent.element.querySelectorAll(r).item(e)}else{var a=this.parent.element.querySelectorAll(".e-work-cells").item(e);(n=a.querySelector(".e-appointment-wrapper"))||(n=t.createElement("div",{className:"e-appointment-wrapper"}),a.appendChild(n))}return n},i.prototype.getAllDayEventHeight=function(){var e=t.createElement("div",{className:"e-appointment"});this.parent.element.querySelector(".e-all-day-appointment-wrapper").appendChild(e);var i=e.offsetHeight;return t.remove(e),i},i.prototype.isAllowDrop=function(e){if(!this.actionObj.excludeSelectors)return!1;for(var t=!1,i=0,n=this.actionObj.excludeSelectors.split(",");i<n.length;i++){var r=n[i];if(e.target.classList.contains(r)){t=!0;break}}return t},i.prototype.getModuleName=function(){return"dragAndDrop"},i}(Ji),sn=function(){function e(e){this.previousNextAction="Next",this.skipPersistenceSave=!1,this.isScrolledBottom=!1,this.parent=e}return e.prototype.isTimelineView=function(){return-1!==this.parent.currentView.indexOf("Timeline")},e.prototype.getContentRows=function(){return[]},e.prototype.refreshHeader=function(){},e.prototype.refreshResourceHeader=function(){var e=this.element.querySelector(".e-resource-column-table"),i=Array.from(e.querySelectorAll(".e-resource-cells"));i.forEach(function(e){Array.from(e.children).forEach(function(e){e.classList.contains("e-resource-expand")||e.classList.contains("e-resource-collapse")||t.remove(e)})});var n=this.parent.resourceBase.renderedResources;if(!t.isNullOrUndefined(n)&&n.length>0)for(var r=0;r<i.length;r++){var a=i[parseInt(r.toString(),10)],s=n[parseInt(r.toString(),10)];if(this.parent.activeView&&!t.isNullOrUndefined(a)&&!t.isNullOrUndefined(s)&&parseInt(a.getAttribute("data-group-index"),10)===s.groupIndex){this.parent.activeView.setResourceHeaderContent(a,s,"e-resource-text");var o={element:a,elementType:"resourceHeader",groupIndex:s.groupIndex};this.parent.trigger(ze,o)}}this.parent.renderTemplates(),this.parent.notify(Ge,{})},e.prototype.getDayName=function(e){return this.parent.getDayNames("abbreviated")[e.getDay()]},e.prototype.getDate=function(e){return this.parent.globalize.formatDate(e,{format:"d",calendar:this.parent.getCalendarMode()})},e.prototype.getTime=function(e){return this.parent.isAdaptive?"HH:mm"===this.parent.activeViewOptions.timeFormat||"HH.mm"===this.parent.activeViewOptions.timeFormat?this.parent.globalize.formatDate(e,{format:"H",calendar:this.parent.getCalendarMode()}):this.parent.globalize.formatDate(e,{skeleton:"h",calendar:this.parent.getCalendarMode()}):this.parent.getTimeString(e)},e.prototype.getTimelineDate=function(e){return U(this.parent.globalize.formatDate(e,{skeleton:"MMMd",calendar:this.parent.getCalendarMode()})+", "+this.parent.getDayNames("wide")[e.getDay()],"multiple")},e.prototype.createEventTable=function(e){var i=t.createElement("div",{className:"e-event-table"});return t.append(this.getEventRows(e),i),i},e.prototype.getEventRows=function(e){for(var i,n=[],r=0;r<e;r++)i=t.createElement("div",{className:at}),this.parent.resourceBase&&!this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.renderedResources&&i.setAttribute("data-group-index",this.parent.resourceBase.renderedResources[parseInt(r.toString(),10)].groupIndex.toString()),n.push(i);return n},e.prototype.collapseRows=function(e){this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(this.parent.resourceBase.hideResourceRows(e.querySelector("tbody")),this.parent.resourceBase.hideResourceRows(e.querySelector(".e-event-table")))},e.prototype.createTableLayout=function(e){var i=e||"",n=t.createElement("table",{className:it+" "+i}),r=t.createElement("tbody");return n.appendChild(r),n},e.prototype.setAriaAttributes=function(e){e.setAttribute("role","grid"),"Year"!==this.parent.currentView&&e.setAttribute("id",this.parent.element.id+"_table"),e.setAttribute("aria-label",this.getLabelText(this.parent.currentView))},e.prototype.createColGroup=function(e,i){if(!t.isNullOrUndefined(i)){var n=i.length;i[0]&&i[0].colSpan&&(n=i.map(function(e){return e.colSpan}).reduce(function(e,t){return e+t}));for(var r=t.createElement("colgroup"),a=0;a<n;a++)r.appendChild(t.createElement("col"));t.prepend([r],e)}},e.prototype.getScrollXIndent=function(e){return e.offsetHeight-e.clientHeight>0?M():0},e.prototype.scrollTopPanel=function(e){this.getDatesHeaderElement().firstElementChild.scrollLeft=e.scrollLeft},e.prototype.scrollHeaderLabels=function(e){for(var i=this.element.querySelector(".e-date-header-wrap table"),n=i.offsetWidth/i.querySelectorAll("colgroup col").length,r=0,a=[".e-header-year-cell",".e-header-month-cell",".e-header-week-cell",".e-header-cells"];r<a.length;r++){var s=a[r],o=[].slice.call(this.element.querySelectorAll(s));if(o.length>0){for(var l=0,p=o;l<p.length;l++)p[l].children[0].style[this.parent.enableRtl?"right":"left"]="";!function(i,r){for(var a,s=0,o=0,l=r?-e.scrollLeft:e.scrollLeft,p=0,c=i;p<c.length;p++){var h=c[p];if((o+=parseInt(h.getAttribute("colSpan"),10))>Math.floor(l/n)){a=h;break}s+=h.offsetWidth}t.isNullOrUndefined(a)||(a.children[0].style[r?"right":"left"]=l-s+"px")}(o,this.parent.enableRtl)}}},e.prototype.addAttributes=function(e,i){e.template&&t.append(e.template,i),e.colSpan&&i.setAttribute("colspan",e.colSpan.toString()),e.className&&t.addClass([i],e.className)},e.prototype.getHeaderBarHeight=function(){var e=2;if(this.parent.headerModule&&(e+=P(this.parent.headerModule.getHeaderElement())),this.parent.uiStateValues.isGroupAdaptive){var t=this.parent.element.querySelector(".e-schedule-resource-toolbar");t&&(e+=t.offsetHeight)}return e},e.prototype.renderPanel=function(e){"e-previous-panel"===e?t.prepend([this.element],this.parent.element.querySelector("."+tt)):this.parent.element.querySelector("."+tt).appendChild(this.element)},e.prototype.setPanel=function(e){this.element=e},e.prototype.getPanel=function(){return this.element},e.prototype.getDatesHeaderElement=function(){return this.element.querySelector(".e-date-header-container")},e.prototype.getDateSlots=function(e,t){return[]},e.prototype.generateColumnLevels=function(){return[]},e.prototype.getColumnLevels=function(){return this.colLevels},e.prototype.highlightCurrentTime=function(){},e.prototype.getStartDate=function(){return this.renderDates[0]},e.prototype.getEndDate=function(){return this.renderDates[this.renderDates.length-1]},e.prototype.startDate=function(){return this.renderDates[0]},e.prototype.endDate=function(){return O(this.renderDates[this.renderDates.length-1],1)},e.prototype.getStartHour=function(){var e=this.parent.getStartEndTime(this.parent.activeViewOptions.startHour);return t.isNullOrUndefined(e)&&(e=new Date(2e3,0,0,0)),e},e.prototype.getEndHour=function(){var e=this.parent.getStartEndTime(this.parent.activeViewOptions.endHour);return t.isNullOrUndefined(e)&&(e=new Date(2e3,0,0,0)),e},e.prototype.isCurrentDate=function(e){return e.setHours(0,0,0,0)===new Date(this.parent.currentTimezoneDate).setHours(0,0,0,0)},e.prototype.isCurrentMonth=function(e){return this.parent.activeViewOptions.displayDate||this.parent.activeViewOptions.numberOfWeeks>0?this.parent.activeView.getStartDate().getTime()<=this.parent.getCurrentTime().getTime()&&this.parent.activeView.getEndDate().getTime()>=this.parent.getCurrentTime().getTime():e.getFullYear()===this.parent.getCurrentTime().getFullYear()&&e.getMonth()===this.parent.getCurrentTime().getMonth()},e.prototype.isWorkDay=function(e,i){return void 0===i&&(i=this.parent.activeViewOptions.workDays),!t.isNullOrUndefined(i)&&i.indexOf(e.getDay())>=0},e.prototype.isWorkHour=function(e,i,n,r){return!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(n)&&(i.setMilliseconds(0),n.setMilliseconds(0),b(e).getTime()!==b(i).getTime()&&(i=new Date(2e3,0,0,i.getHours(),i.getMinutes(),i.getMilliseconds()),n=new Date(2e3,0,0,n.getHours(),n.getMinutes(),n.getMilliseconds())),!(C(e)<C(i)||C(e)>=C(n)||!this.isWorkDay(e,r)))},e.prototype.getRenderDates=function(e,t){void 0===t&&(t=this.parent.selectedDate);var i=[];if("Week"===this.parent.currentView||"TimelineWeek"===this.parent.currentView)for(var n=v(b(t),this.parent.activeViewOptions.firstDayOfWeek),r=0,a=7*this.parent.activeViewOptions.interval;r<a;r++)this.parent.activeViewOptions.showWeekend?i.push(n):this.isWorkDay(n,e)&&i.push(n),n=O(n,1);else if("WorkWeek"===this.parent.currentView||"TimelineWorkWeek"===this.parent.currentView)for(var n=v(b(t),this.parent.activeViewOptions.firstDayOfWeek),r=0,s=7*this.parent.activeViewOptions.interval;r<s;r++)this.isWorkDay(n,e)&&i.push(n),n=O(n,1);else{var o="Agenda"===this.parent.currentView?this.parent.agendaDaysCount:this.parent.activeViewOptions.interval,n=b(t);do{this.parent.activeViewOptions.showWeekend?i.push(n):this.isWorkDay(n,e)&&i.push(n),n=O(n,1)}while(o!==i.length)}return e||(this.renderDates=i),this.parent.headerModule&&this.parent.headerModule.previousNextIconHandler(),i},e.prototype.getNextPreviousDate=function(e){if(this.previousNextAction=e,"Day"===this.parent.currentView||"TimelineDay"===this.parent.currentView){if(this.parent.activeViewOptions.showWeekend){var t=this.parent.activeViewOptions.interval;return O(this.parent.selectedDate,"Next"===e?t:-t)}var i=void 0;if("Next"===e)for(i=O(this.renderDates.slice(-1)[0],1);!this.isWorkDay(i);)i=O(i,1);else{i=O(this.renderDates[0],-1);var n=0;do{this.isWorkDay(i)&&(n+=1),this.parent.activeViewOptions.interval!==n&&(i=O(i,-1))}while(this.parent.activeViewOptions.interval!==n)}return i}var r="Next"===e?7:-7;return O(this.parent.selectedDate,r*this.parent.activeViewOptions.interval)},e.prototype.formatViewLabel=function(e,t,i){var n={type:"date",skeleton:"full",calendar:this.parent.getCalendarMode()};return this.parent.localeObj.getConstant(e)+" "+this.parent.localeObj.getConstant("start")+" "+this.parent.globalize.formatDate(t,n)+" "+this.parent.localeObj.getConstant("endAt")+" "+this.parent.globalize.formatDate(i,n)},e.prototype.getLabelText=function(e){var t=e.charAt(0).toLowerCase()+e.substring(1);return"Year"===e||"TimelineYear"===e?this.formatViewLabel(t,this.parent.activeView.getStartDate(),this.parent.activeView.getEndDate()):this.renderDates.length>0?"Day"===this.parent.currentView||"TimelineDay"===this.parent.currentView?this.parent.localeObj.getConstant(t)+" of "+U(this.parent.globalize.formatDate(this.parent.selectedDate,{type:"date",skeleton:"full",calendar:this.parent.getCalendarMode()}),"single"):this.formatViewLabel(t,this.renderDates[0],this.renderDates[this.renderDates.length-1]):""},e.prototype.getDateRangeText=function(e,t){if(void 0===e&&(e=this.renderDates[0]),void 0===t&&(t=this.renderDates),this.parent.isAdaptive){var i=this.parent.activeViewOptions.dateFormat?this.parent.activeViewOptions.dateFormat:"MMMM y";return U(this.parent.globalize.formatDate(this.parent.selectedDate,{format:i,calendar:this.parent.getCalendarMode()}),"single")}return this.formatDateRange(e,t[t.length-1])},e.prototype.formatDateRange=function(e,i){var n=this.parent.globalize,r=this.parent.getCalendarMode();if(e===i&&(i=null),!t.isNullOrUndefined(this.parent.activeViewOptions.dateFormat)){var a="";return i?(a=n.formatDate(e,{format:this.parent.activeViewOptions.dateFormat,calendar:r})+" - "+n.formatDate(i,{format:this.parent.activeViewOptions.dateFormat,calendar:r}),U(a,"multiple")):(a=n.formatDate(e,{format:this.parent.activeViewOptions.dateFormat,calendar:r}),U(a,"multiple"))}var s,o;if(o=t.isNullOrUndefined(this.parent.locale)||"en"===this.parent.locale||"en-US"===this.parent.locale?t.getValue("dateFormats.long",t.getDefaultDateObject(r)):t.getValue("main."+this.parent.locale+".dates.calendars."+r+".dateFormats.long",t.cldrData),!i)return U(n.formatDate(e,{format:o,calendar:r}),"single");var l=o.trim().toLocaleLowerCase();return s="d"===l.substr(0,1)?e.getFullYear()===i.getFullYear()?e.getMonth()===i.getMonth()?n.formatDate(e,{format:"dd",calendar:r})+" - "+n.formatDate(i,{format:"dd MMMM yyyy",calendar:r}):n.formatDate(e,{format:"dd MMM",calendar:r})+" - "+n.formatDate(i,{format:"dd MMM yyyy",calendar:r}):n.formatDate(e,{format:"dd MMM yyyy",calendar:r})+" - "+n.formatDate(i,{format:"dd MMM yyyy",calendar:r}):"m"===l.substr(0,1)?e.getFullYear()===i.getFullYear()?e.getMonth()===i.getMonth()?n.formatDate(e,{format:"MMMM dd",calendar:r})+" - "+n.formatDate(i,{format:"dd, yyyy",calendar:r}):n.formatDate(e,{format:"MMM dd",calendar:r})+" - "+n.formatDate(i,{format:"MMM dd, yyyy",calendar:r}):n.formatDate(e,{format:"MMM dd, yyyy",calendar:r})+" - "+n.formatDate(i,{format:"MMM dd, yyyy",calendar:r}):n.formatDate(e,{format:o,calendar:r})+" - "+n.formatDate(i,{format:o,calendar:r}),U(s,"multiple")},e.prototype.getMobileDateElement=function(e,i){return t.createElement("div",{className:i,innerHTML:'<div class="e-m-date">'+this.parent.globalize.formatDate(e,{format:"d",calendar:this.parent.getCalendarMode()})+'</div><div class="e-m-day">'+U(this.parent.globalize.formatDate(e,{format:"E",calendar:this.parent.getCalendarMode()}),"single")+"</div>"})},e.prototype.setResourceHeaderContent=function(e,i,n){if(void 0===n&&(n=st),this.parent.activeViewOptions.resourceHeaderTemplate){var r={resource:i.resource,resourceData:i.resourceData},a=this.parent.element.id+"_"+this.parent.activeViewOptions.resourceHeaderTemplateName+"resourceHeaderTemplate",s=[].slice.call(this.parent.getResourceHeaderTemplate()(r,this.parent,"resourceHeaderTemplate",a,!1,void 0,void 0,this.parent.root));t.append(s,e)}else{var o=t.createElement("div",{className:n});this.parent.sanitize(i.resourceData[i.resource.textField],o),e.appendChild(o)}},e.prototype.renderResourceMobileLayout=function(){this.parent.resourceBase.lastResourceLevel&&this.parent.resourceBase.lastResourceLevel.length<=0||(this.parent.resourceBase.renderResourceHeader(),this.parent.resourceBase.renderResourceTree())},e.prototype.addAutoHeightClass=function(e){!this.parent.uiStateValues.isGroupAdaptive&&this.parent.rowAutoHeight&&this.isTimelineView()&&this.parent.activeViewOptions.group.resources.length>0&&t.addClass([e],"e-auto-height")},e.prototype.getColElements=function(){return[].slice.call(this.element.querySelectorAll(".e-content-wrap col, .e-date-header-wrap col"))},e.prototype.setColWidth=function(e){if(this.isTimelineView()){var i=this.getColElements(),n=this.element.querySelector("."+nt+" tbody"),r=this.parent.getElementWidth(n)/(i.length/2);if(e.offsetHeight!==e.clientHeight){var a=this.parent.element.querySelector(".e-resource-column-wrap");t.isNullOrUndefined(a)||a.offsetHeight===e.clientHeight||t.setStyleAttribute(a,{height:t.formatUnit(e.clientHeight)})}[].slice.call(this.element.querySelectorAll(".e-header-cells,.e-time-slots,.e-header-week-cell,.e-header-month-cell,.e-header-year-cell")).forEach(function(e){var i=t.isNullOrUndefined(e.getAttribute("colspan"))?"1":e.getAttribute("colspan"),n=parseInt(i,10);t.setStyleAttribute(e,{width:t.formatUnit(r*n)})})}},e.prototype.resetColWidth=function(){for(var e=0,t=this.getColElements();e<t.length;e++)t[e].style.width=""},e.prototype.getContentAreaElement=function(){return this.element.querySelector(".e-content-wrap")},e.prototype.wireExpandCollapseIconEvents=function(){if(this.parent.resourceBase&&this.parent.resourceBase.resourceCollection.length>1)for(var e=0,i=[].slice.call(this.element.querySelectorAll(".e-resource-tree-icon"));e<i.length;e++){var n=i[e];t.EventHandler.clearEvents(n),t.EventHandler.add(n,"click",this.parent.resourceBase.onTreeIconClick,this.parent.resourceBase)}},e.prototype.scrollToDate=function(e){if(-1!==["Month","TimelineMonth"].indexOf(this.parent.currentView)&&!t.isNullOrUndefined(e)){var i=this.getContentAreaElement(),n=new Date(b(new Date(+e)).getTime()).getTime(),r=i.querySelector('.e-work-cells[data-date="'+n+'"]');"Month"===this.parent.currentView&&r&&(i.scrollWidth>i.clientWidth&&(this.parent.enableRtl?i.scrollLeft=-(this.parent.getContentTable().offsetWidth-r.offsetLeft-r.offsetWidth):i.scrollLeft=r.offsetLeft),i.scrollTop=r.offsetTop),"TimelineMonth"===this.parent.currentView&&r&&(this.parent.enableRtl?i.scrollLeft=-(this.parent.getContentTable().offsetWidth-r.offsetLeft-r.offsetWidth):i.scrollLeft=r.offsetLeft)}},e.prototype.setPersistence=function(){if(this.parent.enablePersistence){var e=this.element.querySelector(".e-content-wrap");this.parent.virtualScrollModule&&this.isScrolledBottom&&(this.isScrolledBottom=!1,this.skipPersistenceSave=!0,e.scrollTop=this.parent.scrollTop,this.skipPersistenceSave=!1),t.isNullOrUndefined(e)||(this.parent.scrollLeft=e.scrollLeft,this.parent.scrollTop=e.scrollTop)}},e.prototype.retainScrollPosition=function(){if(this.parent.enablePersistence){var e=this.parent.element.querySelector(".e-content-wrap");t.isNullOrUndefined(e)||t.isNullOrUndefined(this.parent.scrollLeft)||t.isNullOrUndefined(this.parent.scrollTop)||(this.isScrolledBottom=e.scrollHeight-e.clientHeight<this.parent.scrollTop,e.scrollTop=this.parent.scrollTop,e.scrollLeft=this.parent.scrollLeft)}},e.prototype.getViewStartDate=function(){var e=this.renderDates[0];return this.parent.activeViewOptions.group.resources.length>0&&this.parent.resourceBase.lastResourceLevel.length>0&&(e=this.parent.resourceBase.getResourceRenderDates()[0]),e},e.prototype.getViewEndDate=function(){var e=O(this.renderDates[this.renderDates.length-1],1);return this.parent.activeViewOptions.group.resources.length>0&&this.parent.resourceBase.lastResourceLevel.length>0&&(e=O(this.parent.resourceBase.getResourceRenderDates().slice(-1)[0],1)),e},e.prototype.getAdjustedDate=function(e){return!this.parent.activeViewOptions.timeScale.enable||"Month"===this.parent.currentView||"TimelineYear"===this.parent.currentView&&0===this.parent.activeViewOptions.group.resources.length?new Date(e.setHours(0,0,0,0)):"TimelineYear"===this.parent.currentView&&this.parent.activeViewOptions.group.resources.length>0?(e.setHours(0,0,0,0),new Date(e.setDate(1))):null},e.prototype.resetColLevels=function(){this.parent.resourceBase.expandedResources=[];for(var e=this.parent.virtualScrollModule.getRenderedCount(),t=this.parent.activeViewOptions.group.byDate?this.colLevels[0]:this.parent.resourceBase.renderedResources,i=0,n=0;n<t.length&&!(i>=e);n++)i+=t[parseInt(n.toString(),10)].colSpan,this.parent.resourceBase.expandedResources.push(t[parseInt(n.toString(),10)]);this.parent.activeViewOptions.group.byDate?(this.colLevels[0]=this.parent.resourceBase.expandedResources,this.parent.virtualScrollModule.setRenderedDates(this.parent.resourceBase.expandedResources)):(this.colLevels[this.colLevels.length-2]=this.parent.resourceBase.expandedResources,this.parent.resourceBase.renderedResources=this.parent.resourceBase.expandedResources),"Month"!==this.parent.currentView&&(this.colLevels[this.colLevels.length-1]=this.colLevels[this.colLevels.length-1].slice(0,i),this.parent.resourceBase.expandedResources=this.colLevels[this.colLevels.length-1])},e.prototype.getCollection=function(e){return this.parent.virtualScrollModule&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(e||this.parent.virtualScrollModule.existingDataCollection.length>0)?t.isNullOrUndefined(e)?this.parent.virtualScrollModule.existingDataCollection:e:[]},e.prototype.getGroupIndices=function(e){return this.getCollection(e).map(function(e){return e.groupIndex})},e.prototype.getRenderedDate=function(e){var t=[];return this.getCollection(e).forEach(function(e){var i=e.date.getTime();-1===t.indexOf(i)&&t.push(i)}),t},e.prototype.destroy=function(){this.element&&this.element.parentNode&&t.remove(this.element),this.element=null,this.renderDates=null,this.colLevels=null},e}(),on=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ln=function(e){function i(t){var i=e.call(this,t)||this;return i.viewClass="e-day-view",i.isInverseTableSelect=!0,i.baseCssClass="e-vertical-view",i.appointment=null,i}return on(i,e),i.prototype.getModuleName=function(){return"verticalView"},i.prototype.addEventListener=function(){this.parent.on(Xe,this.scrollUiUpdate,this),this.parent.on(_e,this.renderEvents,this)},i.prototype.removeEventListener=function(){this.parent&&(this.parent.off(Xe,this.scrollUiUpdate),this.parent.off(_e,this.renderEvents))},i.prototype.renderEvents=function(){this.appointment=this.parent.activeViewOptions.timeScale.enable?new Ft(this.parent):new Bt(this.parent),this.appointment.renderAppointments(),this.parent.notify("events-loaded",{})},i.prototype.onContentScroll=function(e){this.parent.removeNewEventElement();var i=e.target;this.parent.notify("virtual-scroll",e),this.scrollLeftPanel(i),this.scrollTopPanel(i),this.parent.isAdaptive||(this.parent.uiStateValues.top=i.scrollTop),this.parent.uiStateValues.left=i.scrollLeft,t.isNullOrUndefined(this.parent.quickPopup)||this.parent.uiStateValues.isTapHold||this.parent.quickPopup.quickPopupHide(),this.setPersistence()},i.prototype.onAdaptiveMove=function(e){this.parent.uiStateValues.action&&e.preventDefault()},i.prototype.onAdaptiveScroll=function(e){this.parent&&!this.parent.isDestroyed&&(this.parent.removeNewEventElement(),this.parent.uiStateValues.top=e.target.scrollTop)},i.prototype.scrollLeftPanel=function(e){var i=this.getLeftPanelElement();t.isNullOrUndefined(i)||(i.scrollTop=e.scrollTop)},i.prototype.scrollUiUpdate=function(e){if(this.parent){var i=this.parent.element.querySelector(".e-date-header-wrap"),n=this.getHeaderBarHeight(),r=this.getLeftPanelElement(),a=this.getScrollableElement(),s=this.getDatesHeaderElement(),o=this.parent.element.offsetHeight-n-s.offsetHeight;this.setContentHeight(a,r,o),this.setColWidth(a);var l=M();s.firstElementChild.style[e.cssProperties.rtlBorder]="",s.style[e.cssProperties.rtlPadding]="";var p=!this.parent.enableAllDayScroll||!(a.offsetWidth-a.clientWidth<=i.offsetWidth-i.clientWidth&&i.classList.contains("e-all-day-scroll"));a.offsetWidth-a.clientWidth>0&&p?(s.firstElementChild.style[e.cssProperties.border]=l>0?"1px":"0px",s.style[e.cssProperties.padding]=l>0?l-1+"px":"0px"):(s.firstElementChild.style[e.cssProperties.border]="",s.style[e.cssProperties.padding]=""),e.isPreventScrollUpdate||(this.parent.uiStateValues.isInitial?(this.parent.currentView.indexOf("Timeline")>-1&&(a.scrollTop=this.parent.uiStateValues.top),this.scrollToWorkHour(),this.parent.uiStateValues.isInitial=!1):(r&&(r.scrollTop=this.parent.uiStateValues.top),a.scrollTop=this.parent.uiStateValues.top,a.scrollLeft=this.parent.uiStateValues.left)),this.parent.activeViewOptions.timeScale.enable&&this.highlightCurrentTime(),this.retainScrollPosition(),t.isNullOrUndefined(r)||t.isNullOrUndefined(a)||r.scrollTop===a.scrollTop||(r.scrollTop=a.scrollTop)}},i.prototype.setContentHeight=function(e,i,n){this.parent.isAdaptive&&!this.isTimelineView()?e.style.height="auto"===this.parent.height?"auto":t.formatUnit(n):(t.isNullOrUndefined(i)||(i.style.height="auto"===this.parent.height?"auto":t.formatUnit(n-this.getScrollXIndent(e))),e.style.height="auto"===this.parent.height?"auto":t.formatUnit(n))},i.prototype.scrollToWorkHour=function(){if(this.parent.workHours.highlight){var e=this.element.querySelector(".e-work-hours");e&&(this.getScrollableElement().scrollTop=e.offsetTop,this.parent.uiStateValues.top=e.offsetTop,this.parent.uiStateValues.left=0)}},i.prototype.scrollToHour=function(e,i){var n=this.parent.getStartEndTime(e);if(!t.isNullOrUndefined(i)){var r=this.element.querySelector('.e-header-cells[data-date="'+new Date(b(i)).getTime()+'"]');if(r)if(this.parent.enableRtl){var a=this.element.querySelector("."+nt);this.getScrollableElement().scrollLeft=-(a.offsetWidth-r.offsetLeft-r.offsetWidth)}else this.getScrollableElement().scrollLeft=r.offsetLeft}t.isNullOrUndefined(n)||(this.getScrollableElement().scrollTop=this.getTopFromDateTime(n))},i.prototype.scrollToDate=function(e){this.scrollToHour(null,e)},i.prototype.generateColumnLevels=function(){var e=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays),t=[];if(this.parent.activeViewOptions.group.resources.length>0){if(t=this.parent.resourceBase.generateResourceLevels(e),this.parent.activeViewOptions.group.hideNonWorkingDays)for(;0===t[0].length;)this.parent.setProperties({selectedDate:this.parent.activeView.getNextPreviousDate(this.previousNextAction)},!0),this.parent.activeView.getRenderDates(),this.parent.headerModule&&(this.parent.headerModule.setCalendarDate(this.parent.selectedDate),this.parent.headerModule.updateDateRange()),e=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays),t=this.parent.resourceBase.generateResourceLevels(e);if(this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.lastResourceLevel.length>0){var i=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex],n=i.resourceData[i.resource.startHourField],r=i.resourceData[i.resource.endHourField];t=[this.getDateSlots(i.renderDates,i.workDays,n,r)]}}else t.push(e);return this.colLevels=t,t},i.prototype.getDateSlots=function(e,t,i,n){void 0===i&&(i=this.parent.workHours.start),void 0===n&&(n=this.parent.workHours.end);for(var r=[],a=this.parent.getStartEndTime(i),s=this.parent.getStartEndTime(n),o=0,l=e;o<l.length;o++){var p=l[o],c=["e-header-cells"];this.isCurrentDate(p)&&c.push("e-current-day"),r.push({date:p,type:"dateHeader",className:c,colSpan:1,workDays:t,startHour:new Date(+a),endHour:new Date(+s)})}return r},i.prototype.isWorkHourRange=function(e){return this.getStartHour().getTime()<=e.getTime()&&this.getEndHour().getTime()>=e.getTime()},i.prototype.highlightCurrentTime=function(){var e=this;if(!(this.parent.activeViewOptions.headerRows.length>0&&"Hour"!==this.parent.activeViewOptions.headerRows.slice(-1)[0].option)){var i=this.parent.getCurrentTime();if(this.parent.showTimeIndicator&&this.isWorkHourRange(i))if(this.getCurrentTimeIndicatorIndex().length>0&&!t.isNullOrUndefined(this.element.querySelector(".e-work-cells"))){if(this.changeCurrentTimePosition(),t.isNullOrUndefined(this.currentTimeIndicatorTimer)){var n=Ke-(1e3*i.getSeconds()+i.getMilliseconds());n<=Ke-1e3&&window.setTimeout(function(){t.isNullOrUndefined(e.currentTimeIndicatorTimer)||(e.clearCurrentTimeIndicatorTimer(),e.changeCurrentTimePosition(),e.updateCurrentTimeIndicatorTimer())},n),this.updateCurrentTimeIndicatorTimer()}}else this.clearCurrentTimeIndicatorTimer();else this.clearCurrentTimeIndicatorTimer()}},i.prototype.getCurrentTimeIndicatorIndex=function(){var e=[];if(!t.isNullOrUndefined(this.parent.resourceBase)&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive){var i=0,n=b(this.parent.getCurrentTime());if(this.parent.virtualScrollModule&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.activeViewOptions.group.byDate)for(var r=0,a=this.parent.resourceBase.expandedResources;r<a.length;r++)b((l=a[r]).date).getTime()===n.getTime()&&e.push(i),i+=1;else for(var s=0,o=this.parent.resourceBase.renderedResources;s<o.length;s++){var l=o[s];if((h=this.parent.getIndexOfDate(l.renderDates,n))>=0){var p=this.parent.activeViewOptions.group.byDate?this.parent.resourceBase.lastResourceLevel.length*h+i:i+h;e.push(p)}i+=this.parent.activeViewOptions.group.byDate?1:l.renderDates.length}}else{var c=this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.lastResourceLevel.length>0?this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex].renderDates:this.renderDates,h=this.parent.getIndexOfDate(c,b(this.parent.getCurrentTime()));h>=0&&e.push(h)}return e},i.prototype.clearCurrentTimeIndicatorTimer=function(){t.isNullOrUndefined(this.currentTimeIndicatorTimer)||(window.clearInterval(this.currentTimeIndicatorTimer),this.currentTimeIndicatorTimer=null,this.removeCurrentTimeIndicatorElements())},i.prototype.updateCurrentTimeIndicatorTimer=function(){var e=this;this.currentTimeIndicatorTimer=window.setInterval(function(){e.changeCurrentTimePosition()},Ke)},i.prototype.removeCurrentTimeIndicatorElements=function(){for(var e=0,i=[].slice.call(this.element.querySelectorAll(".e-previous-timeline,.e-current-timeline,.e-current-time"));e<i.length;e++){var n=i[e];t.remove(n)}},i.prototype.changeCurrentTimePosition=function(){if(!this.parent||this.parent&&this.parent.isDestroyed)return void(this.parent=null);this.removeCurrentTimeIndicatorElements();var e=this.getCurrentTimeIndicatorIndex(),i=this.parent.getContentTable().rows[0],n=this.getTopFromDateTime(this.parent.getCurrentTime()),r=t.formatUnit(n),a=Math.floor(n/i.cells[0].offsetHeight),s=this.getLeftPanelElement(),o=[].slice.call(s.querySelectorAll("tr"));if(!t.isNullOrUndefined(a)&&!isNaN(a)&&a!==o.length){for(var l=[].slice.call(this.element.querySelectorAll(".e-timeline-wrapper")),p=0,c=e[0];p<c;p++)l[parseInt(p.toString(),10)].appendChild(t.createElement("div",{className:"e-previous-timeline",styles:"top:"+r}));for(var h=0,d=e;h<d.length;h++){var u=d[h];l.length>u&&l[parseInt(u.toString(),10)].appendChild(t.createElement("div",{className:"e-current-timeline",styles:"top:"+r}))}var g=t.createElement("div",{innerHTML:this.parent.getTimeString(this.parent.getCurrentTime()),className:"e-current-time",styles:"top:"+r});a<=o.length&&(t.removeClass(s.querySelectorAll(".e-hide-childs"),"e-hide-childs"),o[parseInt(a.toString(),10)]&&t.addClass([o[parseInt(a.toString(),10)].lastElementChild],"e-hide-childs"),t.prepend([g],s),g.style.top=t.formatUnit(g.offsetTop-g.offsetHeight/2))}},i.prototype.getTopFromDateTime=function(e){var t=this.getStartEndHours(this.parent.activeViewOptions.startHour),i=this.getStartEndHours(this.parent.activeViewOptions.endHour),n=60*(e.getHours()-t.getHours())+(e.getMinutes()-t.getMinutes()),r=V(b(new Date(e.getTime())),t,i),a=(r.endHour.getTime()-r.startHour.getTime())/Ke,s=this.parent.activeViewOptions.timeScale.interval,o=0;return o=0===t.getHours()&&0===t.getMinutes()&&0===i.getHours()&&0===i.getMinutes()?s:1!==this.parent.activeViewOptions.timeScale.slotCount?s:s>a?a:s,n*this.getWorkCellHeight()*this.parent.activeViewOptions.timeScale.slotCount/o},i.prototype.getWorkCellHeight=function(){return parseFloat(this.parent.getElementHeight(this.element.querySelector(".e-work-cells")).toFixed(2))},i.prototype.getTdContent=function(e,i,n){var r,a=t.createElement("div"),s="",o=this.parent.element.id+"_";switch(i){case"dateHeader":if(this.parent.activeViewOptions.dateHeaderTemplate){s="dateHeaderTemplate";var l={date:e,type:i,groupIndex:n},p=this.parent.activeViewOptions.dateHeaderTemplateName;r=[].slice.call(this.parent.getDateHeaderTemplate()(l,this.parent,s,o+p+s,!1,void 0,void 0,this.parent.root))}else a.innerHTML=this.parent.activeView.isTimelineView()?'<span class="e-header-date e-navigate">'+this.getTimelineDate(e)+"</span>":'<div class="e-header-day">'+U(this.getDayName(e),"single")+'</div><div class="e-header-date e-navigate" role="link">'+this.getDate(e)+"</div>",r=[].slice.call(a.childNodes);break;case"majorSlot":if(this.parent.activeViewOptions.timeScale.majorSlotTemplate){s="majorSlotTemplate";l={date:e,type:i};r=[].slice.call(this.parent.getMajorSlotTemplate()(l,this.parent,s,o+s,!1,void 0,void 0,this.parent.root))}else a.innerHTML="<span>"+this.getTime(e)+"</span>",r=[].slice.call(a.childNodes);break;case"minorSlot":if(this.parent.activeViewOptions.timeScale.minorSlotTemplate){s="minorSlotTemplate";l={date:e,type:i};r=[].slice.call(this.parent.getMinorSlotTemplate()(l,this.parent,s,o+s,!1,void 0,void 0,this.parent.root))}else r=[].slice.call(a.childNodes);break;case"alldayCells":if(this.parent.activeViewOptions.cellTemplate){p=this.parent.activeViewOptions.cellTemplateName;s="cellTemplate";l={date:e,type:i,groupIndex:n};r=[].slice.call(this.parent.getCellTemplate()(l,this.parent,s,o+p+s,!1,void 0,void 0,this.parent.root))}}return r},i.prototype.refreshHeader=function(){t.remove(this.element.querySelector("tbody tr")),this.renderHeader(),this.parent.notify(Ge,{});var e=this.element.querySelector(".e-date-header-wrap");e&&(e.scrollLeft=this.parent.uiStateValues.left)},i.prototype.renderLayout=function(e){this.setPanel(t.createElement("div",{className:"e-table-wrap"}));var i=[this.baseCssClass,this.viewClass];i.push(e),this.parent.activeViewOptions.group.byDate&&i.push("e-by-date"),this.parent.activeViewOptions.timeScale.enable||t.addClass([this.element],["e-timescale-disable",this.viewClass]),this.parent.activeViewOptions.allowVirtualScrolling&&!this.parent.uiStateValues.isGroupAdaptive&&i.push("e-virtual-scroll"),this.parent.rowAutoHeight&&this.parent.eventSettings.ignoreWhitespace&&i.push("e-ignore-whitespace"),this.renderPanel(e),t.addClass([this.element],i),this.element.appendChild(this.createTableLayout("e-outer-table")),this.element.querySelector("table").setAttribute("role","presentation"),this.colLevels=this.generateColumnLevels(),this.renderHeader(),this.renderContent(),this.parent.uiStateValues.isGroupAdaptive&&!this.parent.element.querySelector(".e-schedule-resource-toolbar-container")&&this.renderResourceMobileLayout(),this.parent.notify(Ge,{})},i.prototype.renderHeader=function(){var e=t.createElement("tr"),i=t.createElement("td");if(i.appendChild(this.renderDatesHeader()),this.parent.activeViewOptions.timeScale.enable){var n=t.createElement("td",{className:"e-left-indent"});n.appendChild(this.renderLeftIndent()),e.appendChild(n)}e.appendChild(i),t.prepend([e],this.element.querySelector("tbody"))},i.prototype.renderContent=function(){this.parent.activeViewOptions.group.resources.length>0&&(this.parent.resourceBase.renderedResources=t.extend([],this.parent.resourceBase.lastResourceLevel,null,!0));var e=t.createElement("tr"),i=t.createElement("td");if(this.parent.isAdaptive){i.setAttribute("colspan",this.parent.activeViewOptions.timeScale.enable?"2":"1");var n=t.createElement("div",{className:"e-scroll-container"});this.parent.activeViewOptions.timeScale.enable&&n.appendChild(this.renderTimeCells()),n.appendChild(this.renderContentArea()),i.appendChild(n),t.EventHandler.add(n,"scroll",this.onAdaptiveScroll,this),t.EventHandler.add(n,t.Browser.touchMoveEvent,this.onAdaptiveMove,this),e.appendChild(i)}else{var r=this.colLevels.slice(0);this.parent.virtualScrollModule&&this.resetColLevels();var a=this.renderContentArea();if(i.appendChild(a),this.parent.activeViewOptions.timeScale.enable){var s=t.createElement("td");s.appendChild(this.renderTimeCells()),e.appendChild(s)}e.appendChild(i),this.parent.virtualScrollModule&&(this.colLevels=r,this.parent.virtualScrollModule.renderVirtualTrack(a))}this.element.querySelector("tbody").appendChild(e)},i.prototype.renderLeftIndent=function(){for(var e,i=t.createElement("div",{className:"e-left-indent-wrap"}),n=this.createTableLayout(),r=t.createElement("tr"),a=this.colLevels.length,s=0;s<a;s++){var o=r.cloneNode(),l={className:[this.colLevels[parseInt(s.toString(),10)][0]&&this.colLevels[parseInt(s.toString(),10)][0].className[0]],type:"emptyCells"};if(this.parent.activeViewOptions.showWeekNumber&&-1!==l.className.indexOf("e-header-cells")){l.className.push("e-week-number");var p=this.parent.getWeekNumberContent(this.renderDates);l.template=[t.createElement("span",{innerHTML:""+p,attrs:{title:this.parent.localeObj.getConstant("week")+" "+p}})]}e=this.createTd(l),this.parent.renderHeaderIndentTemplate(l,e),o.appendChild(e),n.querySelector("tbody").appendChild(o)}var c=r.cloneNode(),h=t.createElement("div",{attrs:{tabindex:"0",role:"button",title:this.parent.localeObj.getConstant("expandAllDaySection"),"aria-disabled":"false","aria-label":this.parent.localeObj.getConstant("expandAllDaySection")},className:"e-all-day-appointment-section e-appointment-expand e-icons e-disable"}),d={className:["e-all-day-cells"],type:"emptyCells"};return(e=this.createTd(d)).appendChild(h),this.parent.renderHeaderIndentTemplate(d,e),c.appendChild(e),n.querySelector("tbody").appendChild(c),i.appendChild(n),i},i.prototype.renderDatesHeader=function(){var e=t.createElement("div",{className:"e-date-header-container"}),i=t.createElement("div",{className:"e-date-header-wrap"});e.appendChild(i);for(var n=this.createTableLayout(),r=t.createElement("tr",{className:"e-header-row"}),a=this.colLevels.length,s=this.colLevels[a-1],o=0;o<a;o++){for(var l=r.cloneNode(),p=this.colLevels[parseInt(o.toString(),10)],c=0;c<p.length;c++)l.appendChild(this.createTd(p[parseInt(c.toString(),10)]));n.querySelector("tbody").appendChild(l)}return this.createAllDayRow(n,s),this.createColGroup(n,s),i.appendChild(n),e},i.prototype.createAllDayRow=function(e,i){for(var n=t.createElement("tr",{className:"e-all-day-row"}),r=0;r<i.length;r++){var a=t.extend({},i[parseInt(r.toString(),10)]);a.className=["e-all-day-cells"],a.type="alldayCells";var s=this.createTd(a);s.setAttribute("data-date",a.date.getTime().toString()),t.isNullOrUndefined(a.groupIndex)?this.parent.uiStateValues.isGroupAdaptive&&s.setAttribute("data-group-index",""+this.parent.uiStateValues.groupIndex):s.setAttribute("data-group-index",""+a.groupIndex),this.wireCellEvents(s),n.appendChild(s)}e.querySelector("tbody").appendChild(n);var o=t.createElement("thead");o.appendChild(this.parent.eventBase.createEventWrapper("allDay")),t.prepend([o],e)},i.prototype.createTd=function(e){var i=t.createElement("td");if(this.addAttributes(e,i),e.date&&e.type){var n=this.getTdContent(e.date,e.type,e.groupIndex);n&&n.length&&t.append(n,i)}this.parent.isMinMaxDate(b(new Date(""+e.date)))||t.addClass([i],pt),"resourceHeader"===e.type&&this.setResourceHeaderContent(i,e),"dateHeader"===e.type&&e.className.indexOf("e-header-cells")>=0&&(i.setAttribute("data-date",e.date.getTime().toString()),t.isNullOrUndefined(e.groupIndex)||i.setAttribute("data-group-index",""+e.groupIndex),this.wireMouseEvents(i));var r={elementType:e.type,element:i,date:e.date,groupIndex:e.groupIndex};return this.parent.trigger(ze,r),i},i.prototype.wireCellEvents=function(e){t.EventHandler.add(e,"mousedown",this.parent.workCellAction.cellMouseDown,this.parent.workCellAction),this.wireMouseEvents(e)},i.prototype.wireMouseEvents=function(e){t.EventHandler.add(e,"click",this.parent.workCellAction.cellClick,this.parent.workCellAction),this.parent.isAdaptive||t.EventHandler.add(e,"dblclick",this.parent.workCellAction.cellDblClick,this.parent.workCellAction)},i.prototype.renderTimeCells=function(){var e=this,i=t.createElement("div",{className:"e-time-cells-wrap"}),n=this.createTableLayout(),r=t.createElement("tr"),a=function(t){t.type=t.first?"majorSlot":"minorSlot",t.className=t.last?["e-time-cells","e-time-slots"]:["e-time-slots"];var i=r.cloneNode(),a={date:t.date,type:t.type,className:t.className};return i.appendChild(e.createTd(a)),n.querySelector("tbody").appendChild(i),t};return this.getTimeSlotRows(a),i.appendChild(n),i},i.prototype.renderContentArea=function(){var e=t.createElement("div",{className:"e-content-wrap"}),i=this.createTableLayout(nt);return this.setAriaAttributes(i),this.addAutoHeightClass(i),this.renderContentTable(i),this.createColGroup(i,this.colLevels.slice(-1)[0]),e.appendChild(i),this.wireCellEvents(i.querySelector("tbody")),t.EventHandler.add(e,"scroll",this.onContentScroll,this),t.EventHandler.add(e,t.Browser.touchMoveEvent,this.onAdaptiveMove,this),e},i.prototype.renderContentTable=function(e){var i=e.querySelector("tbody");t.append(this.getContentRows(),i),this.renderContentTableHeader(e)},i.prototype.getContentRows=function(){var e=this,i=[],n=t.createElement("tr"),r=t.createElement("td"),a=[];this.parent.virtualScrollModule&&this.parent.activeViewOptions.group.resources.length>0&&(a=this.parent.activeViewOptions.group.byDate?this.getRenderedDate():this.getGroupIndices());var s=function(t){for(var s=n.cloneNode(),o=0,l=e.colLevels[e.colLevels.length-1];o<l.length;o++){var p=l[o],c=!0;if(e.parent.virtualScrollModule&&e.parent.activeViewOptions.group.resources.length>0){var h=e.parent.activeViewOptions.group.byDate?p.date.getTime():p.groupIndex;c=a.indexOf(h)<0}if(c){var d=e.createContentTd(p,t,r);s.appendChild(d)}}return i.push(s),t};return this.getTimeSlotRows(s),i},i.prototype.createContentTd=function(e,i,n){var r=n.cloneNode();e.colSpan&&r.setAttribute("colspan",e.colSpan.toString());var a=this.getContentTdClass(i),s=b(e.date);this.parent.isMinMaxDate(s)||a.push(pt),s=new Date(s.setHours(i.date.getHours(),i.date.getMinutes(),i.date.getSeconds(),i.date.getMilliseconds()));var o="workCells";if(-1!==e.className.indexOf("e-parent-node")&&(a.push("e-resource-group-cells"),o="resourceGroupCells"),this.parent.workHours.highlight&&(this.parent.activeViewOptions.timeScale.enable&&this.isWorkHour(s,e.startHour,e.endHour,e.workDays)||!this.parent.activeViewOptions.timeScale.enable&&this.isWorkDay(s,e.workDays))&&a.push("e-work-hours"),t.addClass([r],a),this.parent.activeViewOptions.cellTemplate){var l={date:s,type:o,groupIndex:e.groupIndex},p=this.parent.element.id+"_"+this.parent.activeViewOptions.cellTemplateName+"cellTemplate",c=[].slice.call(this.parent.getCellTemplate()(l,this.parent,"cellTemplate",p,!1,void 0,void 0,this.parent.root));t.append(c,r)}r.setAttribute("data-date",s.getTime().toString());if(this.parent.activeViewOptions.timeScale.enable){var h=this.parent.globalize.formatDate(s,{type:"dateTime",skeleton:"full",calendar:this.parent.getCalendarMode()}),d=this.parent.globalize.formatDate(this.getEndDateFromStartDate(s),{type:"dateTime",skeleton:"full",calendar:this.parent.getCalendarMode()});r.setAttribute("aria-label",h+" "+this.parent.localeObj.getConstant("endAt")+" "+d)}else{var u=this.parent.globalize.formatDate(e.date,{skeleton:"full",calendar:this.parent.getCalendarMode()});r.setAttribute("aria-label",u)}if(!t.isNullOrUndefined(e.groupIndex)||this.parent.uiStateValues.isGroupAdaptive){var g=this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:e.groupIndex;r.setAttribute("data-group-index",""+g)}var v={elementType:o,element:r,date:s,groupIndex:e.groupIndex};return this.parent.trigger(ze,v),r},i.prototype.getContentTdClass=function(e){return e.last?["e-work-cells"]:["e-work-cells","e-alternate-cells"]},i.prototype.renderContentTableHeader=function(e){var i=t.createElement("thead");i.appendChild(this.parent.eventBase.createEventWrapper()),this.parent.activeViewOptions.timeScale.enable&&i.appendChild(this.parent.eventBase.createEventWrapper("timeIndicator")),t.prepend([i],e)},i.prototype.getScrollableElement=function(){return this.parent.isAdaptive&&!this.isTimelineView()?this.element.querySelector(".e-scroll-container"):this.getContentAreaElement()},i.prototype.getLeftPanelElement=function(){return this.element.querySelector(".e-time-cells-wrap")},i.prototype.getEndDateFromStartDate=function(e){var t=this.parent.activeViewOptions.timeScale.interval*Ke/this.parent.activeViewOptions.timeScale.slotCount,i=new Date(e.getTime());return i.setMilliseconds(i.getMilliseconds()+t),i},i.prototype.getStartEndHours=function(e){if(!t.isNullOrUndefined(e)&&""!==e){var i=new Date(2e3,0,0,0),n=e.split(":");return 2===n.length&&i.setHours(parseInt(n[0],10),parseInt(n[1],10),0),i}return new Date(2e3,0,0,0)},i.prototype.getTimeSlotRows=function(e){var t=[],i=this.getStartEndHours(this.parent.activeViewOptions.startHour),n=this.getStartEndHours(this.parent.activeViewOptions.endHour),r=this.parent.activeViewOptions.timeScale.interval*Ke,a=r/this.parent.activeViewOptions.timeScale.slotCount,s=Math.round(Qe/a),o=i.getTime(),l=n.getTime();if(o!==l){var p=i.getTimezoneOffset()!==n.getTimezoneOffset()?l-o-36e5:l-o;s=Math.round(p/a)}this.parent.activeViewOptions.timeScale.enable||(s=1);for(var c=this.parent.getStartEndTime(this.parent.workHours.start),h=this.parent.getStartEndTime(this.parent.workHours.end),d=0;d<s;d++){var u=new Date(o+a*d);if(N(u)||new Date(o).getTimezoneOffset()!==u.getTimezoneOffset()){var g=new Date(o).getTimezoneOffset()-u.getTimezoneOffset();u=new Date(u.getTime()-6e4*g)}var v=d%(r/a),m={date:new Date(""+u),startHour:c,endHour:h,first:0===v,middle:v<this.parent.activeViewOptions.timeScale.slotCount-1,last:v===this.parent.activeViewOptions.timeScale.slotCount-1,type:""};e&&e(m),t.push(m)}return t},i.prototype.getAdjustedDate=function(e){if(!this.parent.activeViewOptions.timeScale.enable)return new Date(e.setHours(0,0,0,0));for(var t=this.getTimeSlotRows(),i=new Date(new Date(t[0].date.getTime()).setHours(e.getHours(),e.getMinutes(),e.getMilliseconds())),n=0;n<t.length;n++)if(t[parseInt(n.toString(),10)].date.getTime()>i.getTime())return e.setHours(t[n-1].date.getHours(),t[n-1].date.getMinutes(),t[n-1].date.getMilliseconds()),new Date(e);return null},i.prototype.destroy=function(){if(!this.parent||this.parent&&this.parent.isDestroyed)return void(this.parent=null);if(this.clearCurrentTimeIndicatorTimer(),this.element){this.appointment&&(this.appointment.destroy(),this.appointment=null);var i=this.getContentAreaElement();i&&(t.EventHandler.remove(i,"scroll",this.onContentScroll),t.EventHandler.remove(i,t.Browser.touchMoveEvent,this.onAdaptiveMove)),this.parent.resourceBase&&this.parent.resourceBase.destroy(),this.parent.scheduleTouchModule&&this.parent.scheduleTouchModule.resetValues(),e.prototype.destroy.call(this)}},i}(sn),pn=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),cn=function(e){function t(t){var i=e.call(this,t)||this;return i.viewClass="e-day-view",i}return pn(t,e),t.prototype.getModuleName=function(){return"day"},t}(ln),hn=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),dn=function(e){function t(t){var i=e.call(this,t)||this;return i.viewClass="e-week-view",i}return hn(t,e),t.prototype.startDate=function(){return this.getViewStartDate()},t.prototype.endDate=function(){return this.getViewEndDate()},t.prototype.getModuleName=function(){return"week"},t}(ln),un=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),gn=function(e){function t(t){var i=e.call(this,t)||this;return i.viewClass="e-work-week-view",i}return un(t,e),t.prototype.startDate=function(){return this.getViewStartDate()},t.prototype.endDate=function(){return this.getViewEndDate()},t.prototype.getModuleName=function(){return"workWeek"},t}(ln),vn=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),mn=function(e){function i(t){var i=e.call(this,t)||this;return i.dayNameFormat="wide",i.viewClass="e-month-view",i.isInverseTableSelect=!1,i.monthEvent=null,i.monthDates={},i}return vn(i,e),i.prototype.addEventListener=function(){this.parent.on(Xe,this.onScrollUIUpdate,this),this.parent.on(_e,this.onDataReady,this),this.parent.on("cellClick",this.onCellClick,this)},i.prototype.removeEventListener=function(){this.parent&&(this.parent.off(Xe,this.onScrollUIUpdate),this.parent.off(_e,this.onDataReady),this.parent.off("cellClick",this.onCellClick))},i.prototype.onDataReady=function(e){this.monthEvent=new Bt(this.parent),this.monthEvent.renderAppointments(),this.parent.notify("events-loaded",{})},i.prototype.onCellClick=function(e){},i.prototype.onContentScroll=function(e){this.skipPersistenceSave||(this.parent.removeNewEventElement(),this.parent.notify("virtual-scroll",e),this.scrollTopPanel(e.target),this.scrollLeftPanel(e.target),this.parent.uiStateValues.top=e.target.scrollTop,this.parent.uiStateValues.left=e.target.scrollLeft,this.setPersistence())},i.prototype.scrollLeftPanel=function(e){var t=this.getLeftPanelElement();t&&(t.scrollTop=e.scrollTop)},i.prototype.getLeftPanelElement=function(){return this.element.querySelector(".e-week-number-wrapper")},i.prototype.onScrollUIUpdate=function(e){var t=this.getHeaderBarHeight(),i=this.getDatesHeaderElement(),n=this.getContentAreaElement(),r=this.parent.element.offsetHeight-t-i.offsetHeight,a=this.getLeftPanelElement();"auto"!==this.parent.height&&this.setContentHeight(n,a,r);var s=M();if(i.firstElementChild.style[e.cssProperties.rtlBorder]="",i.style[e.cssProperties.rtlPadding]="",n.offsetWidth-n.clientWidth>0?(i.firstElementChild.style[e.cssProperties.border]=s>0?"1px":"0px",i.style[e.cssProperties.padding]=s>0?s-1+"px":"0px"):(i.firstElementChild.style[e.cssProperties.border]="",i.style[e.cssProperties.padding]=""),this.setColWidth(n),e.scrollPosition||!e.isPreventScrollUpdate&&"TimelineMonth"===this.parent.currentView){var o="TimelineMonth"===this.parent.currentView?this.parent.uiStateValues.top:e.scrollPosition.top;a&&(a.scrollTop=o),n.scrollTop=o,this.parent.uiStateValues.isInitial?(this.scrollToSelectedDate(),this.parent.uiStateValues.isInitial=!1):n.scrollLeft="TimelineMonth"===this.parent.currentView?this.parent.uiStateValues.left:e.scrollPosition.left}this.retainScrollPosition()},i.prototype.scrollToSelectedDate=function(){var e=new Date(this.parent.selectedDate);e.setHours(0,0,0,0);var i=this.element.querySelector('.e-header-cells[data-date="'+e.getTime().toString()+'"]'),n=this.getContentAreaElement();t.isNullOrUndefined(i)?n.scrollLeft=0:n.scrollLeft=this.parent.enableRtl?-(this.parent.getContentTable().offsetWidth-i.offsetLeft-i.offsetWidth):i.offsetLeft,0===n.scrollLeft&&this.parent.uiStateValues.isInitial&&(this.parent.uiStateValues.left=0)},i.prototype.setContentHeight=function(e,i,n){e.style.height="auto","Month"===this.parent.currentView&&(e.style.height=t.formatUnit(n)),i&&("MonthAgenda"===this.parent.currentView&&(n=this.parent.activeViewOptions.interval>1?this.getContentAreaElement().firstElementChild.offsetHeight:this.element.querySelector("."+nt).offsetHeight),i.style.height="auto",i.style.height=t.formatUnit(n-this.getScrollXIndent(e)))},i.prototype.generateColumnLevels=function(){var e=[],t=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays);if(this.parent.activeViewOptions.group.resources.length>0){if(e=this.parent.resourceBase.generateResourceLevels(t),"MonthAgenda"===this.parent.currentView&&(e=[t]),this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.lastResourceLevel.length>0){var i=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex],n=this.getDateSlots(i.renderDates,i.workDays);if(this.parent.activeViewOptions.group.byDate&&this.parent.activeViewOptions.group.hideNonWorkingDays){var r=n.findIndex(function(e,t){return 0!==t&&e.date.getDay()===n[0].date.getDay()});n=r>-1?n.slice(0,r):n}e=[n]}}else e.push(t);return this.colLevels=e,e},i.prototype.getDateSlots=function(e,t){for(var i=this.parent.activeViewOptions.showWeekend?7:t.length,n=[],r=this.isCurrentMonth(this.parent.selectedDate),a=0;a<i;a++){var s=["e-header-cells"],o=e.slice(0,i).map(function(e){return e.getDay()});r&&o.indexOf(this.parent.currentTimezoneDate.getDay())===a&&s.push("e-current-day"),n.push({date:e[parseInt(a.toString(),10)],type:"monthDay",className:s,colSpan:1,workDays:t})}return n},i.prototype.getDayNameFormat=function(){return this.parent.isAdaptive||this.parent.activeViewOptions.group.resources.length>0?"abbreviated":"wide"},i.prototype.renderLayout=function(e){this.dayNameFormat=this.getDayNameFormat(),this.setPanel(t.createElement("div",{className:"e-table-wrap"}));var i=[this.viewClass];i.push(e),this.parent.activeViewOptions.group.byDate&&(i.push("e-by-date"),"Month"!==this.parent.currentView&&(this.parent.activeViewOptions.group.hideNonWorkingDays=!1)),this.parent.activeViewOptions.allowVirtualScrolling&&!this.parent.uiStateValues.isGroupAdaptive&&i.push("e-virtual-scroll"),this.parent.rowAutoHeight&&this.parent.eventSettings.ignoreWhitespace&&i.push("e-ignore-whitespace"),t.addClass([this.element],i),this.renderPanel(e),this.element.appendChild(this.createTableLayout("e-outer-table")),this.element.querySelector("table").setAttribute("role","presentation"),this.colLevels=this.generateColumnLevels(),this.renderHeader(),this.renderContent();var n="MonthAgenda"===this.parent.currentView?this.parent.activeView.getPanel():this.parent.element;this.parent.uiStateValues.isGroupAdaptive&&!n.querySelector(".e-schedule-resource-toolbar-container")&&this.renderResourceMobileLayout(),this.parent.notify(Ge,{}),this.parent.uiStateValues.isCustomMonth&&(this.parent.uiStateValues.isCustomMonth=!1)},i.prototype.refreshHeader=function(){t.remove(this.element.querySelector("tbody tr")),this.renderHeader(),this.parent.notify(Ge,{});var e=this.element.querySelector(".e-date-header-wrap"),i=this.element.querySelector(".e-content-wrap");e&&(e.scrollLeft=this.parent.uiStateValues.left),i&&(i.scrollLeft=this.parent.uiStateValues.left)},i.prototype.wireCellEvents=function(e){t.EventHandler.add(e,"mousedown",this.parent.workCellAction.cellMouseDown,this.parent.workCellAction),t.EventHandler.add(e,"click",this.parent.workCellAction.cellClick,this.parent.workCellAction),this.parent.isAdaptive||t.EventHandler.add(e,"dblclick",this.parent.workCellAction.cellDblClick,this.parent.workCellAction)},i.prototype.renderHeader=function(){var e=t.createElement("tr");this.renderLeftIndent(e);var i=t.createElement("td");i.appendChild(this.renderDatesHeader()),e.appendChild(i),t.prepend([e],this.element.querySelector("tbody"))},i.prototype.renderLeftIndent=function(e){this.parent.activeViewOptions.showWeekNumber&&e.appendChild(t.createElement("td",{className:"e-left-indent"}))},i.prototype.renderContent=function(){this.parent.activeViewOptions.group.resources.length>0&&(this.parent.resourceBase.renderedResources=t.extend([],this.parent.resourceBase.lastResourceLevel,null,!0));var e=t.createElement("tr");this.parent.activeViewOptions.showWeekNumber&&e.appendChild(this.renderWeekNumberContent());var i=t.createElement("td"),n=this.colLevels.slice(0);this.parent.virtualScrollModule&&this.resetColLevels();var r=t.createElement("div",{className:"e-content-wrap"}),a=this.renderContentArea();if("Month"===this.parent.currentView)r.appendChild(a);else{var s=t.createElement("div",{className:tt});s.appendChild(a),r.appendChild(s)}t.EventHandler.add(r,"scroll",this.onContentScroll,this),i.appendChild(r),e.appendChild(i),this.parent.virtualScrollModule&&(this.colLevels=n,this.parent.virtualScrollModule.renderVirtualTrack(r)),this.element.querySelector("tbody").appendChild(e),this.renderAppointmentContainer()},i.prototype.renderWeekNumberContent=function(){var e=this.renderDates.map(function(e){return new Date(+e)}),i=t.createElement("td"),n=t.createElement("div",{className:"e-week-number-wrapper"});i.appendChild(n);var r=this.createTableLayout();n.appendChild(r);for(var a=this.parent.activeViewOptions.showWeekend?7:this.parent.activeViewOptions.workDays.length,s=0,o=this.renderDates.length/a;s<o;s++){var l=e.splice(0,a),p=this.parent.getWeekNumberContent(l);r.querySelector("tbody").appendChild(this.createWeekNumberElement(p))}return i},i.prototype.renderAppointmentContainer=function(){},i.prototype.renderDatesHeader=function(){var e=t.createElement("div",{className:"e-date-header-container"}),i=t.createElement("div",{className:"e-date-header-wrap"});e.appendChild(i);var n=this.createTableLayout();if("Month"===this.parent.currentView){var r=t.createElement("thead");r.appendChild(t.createElement("tr")),t.prepend([r],n)}this.createColGroup(n,this.colLevels[this.colLevels.length-1]);for(var a=t.createElement("tr"),s=0;s<this.colLevels.length;s++){for(var o=this.colLevels[parseInt(s.toString(),10)],l=a.cloneNode(),p=0;p<o.length;p++){var c=o[parseInt(p.toString(),10)];l.appendChild(this.createHeaderCell(c))}n.querySelector("tbody").appendChild(l)}return i.appendChild(n),e},i.prototype.createHeaderCell=function(e){var i=t.createElement("td");if(this.addAttributes(e,i),"monthDay"===e.type){s=t.createElement("span",{innerHTML:U(this.parent.getDayNames(this.dayNameFormat)[e.date.getDay()],"single")});i.appendChild(s)}if("resourceHeader"===e.type&&this.setResourceHeaderContent(i,e),"dateHeader"===e.type){if(t.addClass([i],"e-date-header"),i.setAttribute("data-date",e.date.getTime().toString()),this.parent.activeViewOptions.dateHeaderTemplate){var n={date:e.date,type:e.type},r=this.parent.element.id+"_"+this.parent.activeViewOptions.dateHeaderTemplateName+"dateHeaderTemplate",a=[].slice.call(this.parent.getDateHeaderTemplate()(n,this.parent,"dateHeaderTemplate",r,!1,void 0,void 0,this.parent.root));a&&a.length&&t.append(a,i)}else{var s=t.createElement("span",{className:"e-navigate"}),o=this.parent.globalize.formatDate(e.date,{skeleton:"full",calendar:this.parent.getCalendarMode()});s.setAttribute("title",U(o,"multiple"));var l=!this.parent.calendarUtil.isMonthStart(e.date)||this.isCurrentDate(e.date)||this.parent.isAdaptive?this.parent.globalize.formatDate(e.date,{skeleton:"d",calendar:this.parent.getCalendarMode()}):this.parent.globalize.formatDate(e.date,{format:"MMM d",calendar:this.parent.getCalendarMode()});s.innerHTML=U(l,"single"),i.appendChild(s)}this.wireCellEvents(i)}var p={elementType:e.type,element:i,date:e.date,groupIndex:e.groupIndex};return this.parent.trigger(ze,p),i},i.prototype.getContentSlots=function(){if(!this.colLevels[this.colLevels.length-1]||!this.colLevels[this.colLevels.length-1][0])return[];var e=[],t=function(t,i,n,r){var a={date:new Date(+i),groupIndex:n.groupIndex,workDays:n.workDays,type:"monthCells",className:r||["e-work-cells"]};e[parseInt(t.toString(),10)]||(e[parseInt(t.toString(),10)]=[]),e[parseInt(t.toString(),10)].push(a)},i="MonthAgenda"!==this.parent.currentView&&this.parent.activeViewOptions.group.resources.length>0;if(!i||this.parent.uiStateValues.isGroupAdaptive||this.parent.activeViewOptions.group.byDate)for(var n=this.renderDates.map(function(e){return new Date(+e)}),r=this.parent.activeViewOptions.showWeekend?7:this.parent.activeViewOptions.workDays.length,a=this.colLevels.slice(0,1)[0],s=this.renderDates.map(Number).indexOf(+a[0].date),o=0;o<this.renderDates.length/r;o++)for(var l,p=n.splice(0,r),c=s,h=this,d=s;d<this.colLevels[0].length+s&&d<p.length;d++)!function(e){var n=p[parseInt(c.toString(),10)];if(c++,i){var a=h.colLevels[h.colLevels.length-1],s=a.length/r,d=a.slice(0,s);if(h.parent.activeViewOptions.group.hideNonWorkingDays&&0===(d=a.filter(function(e){return e.date.getDay()===n.getDay()})).length)return e-=1,l=e,"continue";for(var u=0;u<d.length;u++){var g=void 0;0!==u&&(g=["e-work-cells","e-disable-date"]),t(o,n,d[parseInt(u.toString(),10)],g)}}else t(o,n,h.colLevels[h.colLevels.length-1][0]);l=e}(d),d=l;else for(var u=0,g=this.colLevels[this.colLevels.length-2];u<g.length;u++)for(var v=g[u],n=v.renderDates.map(function(e){return new Date(+e)}),r=this.parent.activeViewOptions.showWeekend?7:v.workDays.length,o=0;o<v.renderDates.length/r;o++)for(var m=0,f=p=n.splice(0,r);m<f.length;m++){var y=f[m];t(o,y,v)}return e},i.prototype.updateClassList=function(e){!this.isCustomMonth()&&this.isOtherMonth(e.date)&&e.className.push("e-other-month"),this.parent.isMinMaxDate(e.date)||e.className.push(pt),this.updateSelectedCellClass(e)},i.prototype.updateSelectedCellClass=function(e){},i.prototype.isOtherMonth=function(e){return e.getTime()<this.monthDates.start.getTime()||e.getTime()>this.monthDates.end.getTime()},i.prototype.renderContentArea=function(){var e=this.createTableLayout(nt);this.setAriaAttributes(e),this.addAutoHeightClass(e),"TimelineMonth"===this.parent.currentView&&this.createColGroup(e,this.colLevels[this.colLevels.length-1]);var i=new Date(this.parent.selectedDate.getTime());this.monthDates={start:this.parent.calendarUtil.firstDateOfMonth(i),end:this.parent.calendarUtil.lastDateOfMonth(E(i,this.parent.activeViewOptions.interval-1))};var n=e.querySelector("tbody");return t.append(this.getContentRows(),n),this.wireCellEvents(n),e},i.prototype.getContentRows=function(){for(var e=[],i=t.createElement("tr"),n=t.createElement("td"),r=this.getContentSlots(),a="TimelineMonth"===this.parent.currentView?this.getGroupIndices():[],s=0;s<r.length;s++)if(!(a.length>0&&a.indexOf(r[parseInt(s.toString(),10)][0].groupIndex)>-1)){for(var o=i.cloneNode(),l=0;l<r[parseInt(s.toString(),10)].length;l++){var p=this.createContentTd(r[parseInt(s.toString(),10)][parseInt(l.toString(),10)],n);o.appendChild(p)}e.push(o)}return e},i.prototype.createContentTd=function(e,i){var n=i.cloneNode();e.colSpan&&n.setAttribute("colspan",e.colSpan.toString()),this.updateClassList(e);var r=e.type;if(-1!==e.className.indexOf("e-parent-node")&&(e.className.push("e-resource-group-cells"),r="resourceGroupCells"),this.parent.workHours.highlight&&this.isWorkDay(e.date,e.workDays)&&e.className.push("e-work-days"),this.isCurrentDate(e.date)&&e.className.push("e-current-date"),t.addClass([n],e.className),n.setAttribute("data-date",e.date.getTime().toString()),!t.isNullOrUndefined(e.groupIndex)||this.parent.uiStateValues.isGroupAdaptive){var a=this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:e.groupIndex;n.setAttribute("data-group-index",""+a)}if(this.renderDateHeaderElement(e,n),this.parent.activeViewOptions.cellTemplate){var s={date:e.date,type:r,groupIndex:e.groupIndex},o=this.parent.element.id+"_"+this.parent.activeViewOptions.cellTemplateName+"cellTemplate",l=[].slice.call(this.parent.getCellTemplate()(s,this.parent,"cellTemplate",o,!1,void 0,void 0,this.parent.root));t.append(l,n)}var p={elementType:r,element:n,date:e.date,groupIndex:e.groupIndex};return this.parent.trigger(ze,p),n},i.prototype.renderDateHeaderElement=function(e,i){if("TimelineMonth"!==this.parent.currentView){var n=t.createElement("div",{className:"e-date-header"});if(this.parent.activeViewOptions.cellHeaderTemplate){var r={date:e.date,type:e.type,groupIndex:e.groupIndex},a=this.parent.element.id+"_"+this.parent.activeViewOptions.cellHeaderTemplateName+"cellHeaderTemplate",s=[].slice.call(this.parent.getCellHeaderTemplate()(r,this.parent,"cellHeaderTemplate",a,!1,void 0,void 0,this.parent.root));t.append(s,n)}else{var o=!this.parent.calendarUtil.isMonthStart(e.date)||this.isCurrentDate(e.date)||this.parent.isAdaptive?this.parent.globalize.formatDate(e.date,{skeleton:"d",calendar:this.parent.getCalendarMode()}):this.parent.globalize.formatDate(e.date,{format:"MMM d",calendar:this.parent.getCalendarMode()});n.innerHTML=U(o,"single")}if(i.appendChild(n),"month"===this.getModuleName()){t.addClass([n],"e-navigate");var l=this.parent.globalize.formatDate(e.date,{skeleton:"full",calendar:this.parent.getCalendarMode()});i.setAttribute("aria-label",l)}}},i.prototype.getMonthStart=function(e){var i=v("Month"===this.parent.currentView&&!t.isNullOrUndefined(this.parent.activeViewOptions.displayDate)&&!this.parent.uiStateValues.isSwipeScroll&&(this.parent.uiStateValues.isCustomMonth||this.isCustomRange())?this.parent.activeViewOptions.displayDate:this.parent.uiStateValues.isCustomMonth||!this.parent.uiStateValues.isSwipeScroll&&this.isCustomRange()||!this.isCustomMonth()?this.parent.calendarUtil.firstDateOfMonth(e):e,this.parent.activeViewOptions.firstDayOfWeek);return new Date(i.getFullYear(),i.getMonth(),i.getDate())},i.prototype.getMonthEnd=function(e){if(this.isCustomMonth())return O(this.getMonthStart(e),7*(this.parent.activeViewOptions.numberOfWeeks>0?this.parent.activeViewOptions.numberOfWeeks:6)-1);var t=E(e,this.parent.activeViewOptions.interval-1);return O(v(this.parent.calendarUtil.lastDateOfMonth(t),this.parent.activeViewOptions.firstDayOfWeek),6)},i.prototype.isCustomRange=function(){var e=this.parent.getCurrentViewDates();if(e&&e.length>0){var t=b(this.parent.selectedDate).getTime(),i=v(e[e.length-1],this.parent.activeViewOptions.firstDayOfWeek);return!(t>=v(e[0],this.parent.activeViewOptions.firstDayOfWeek).getTime()&&t<=O(i,6).getTime())}return!1},i.prototype.getRenderDates=function(e,t){void 0===t&&(t=this.parent.selectedDate);var i=[],n=b(t),r=this.getMonthStart(n),a=this.getMonthEnd(n);do{this.parent.activeViewOptions.showWeekend?i.push(r):this.isWorkDay(r,e)&&i.push(r),(r=O(r,1)).getHours()>0&&(r=b(r))}while(r.getTime()<=a.getTime());return e||(this.renderDates=i),this.parent.headerModule&&this.parent.headerModule.previousNextIconHandler(),i},i.prototype.getNextPreviousDate=function(e){if(this.isCustomMonth()){var t=this.parent.getCurrentViewDates();return O(v("Next"===e?t[t.length-1]:t[0],this.parent.activeViewOptions.firstDayOfWeek),"Next"===e?7:7*-(this.parent.activeViewOptions.numberOfWeeks>0?this.parent.activeViewOptions.numberOfWeeks:6))}return E(this.parent.selectedDate,("Next"===e?1:-1)*this.parent.activeViewOptions.interval)},i.prototype.getStartDate=function(){return this.getMonthStart(this.parent.selectedDate)},i.prototype.getEndDate=function(){return this.getMonthEnd(this.parent.selectedDate)},i.prototype.getEndDateFromStartDate=function(e){return O(new Date(e.getTime()),1)},i.prototype.getDateRangeText=function(e,i){if(void 0===e&&(e=this.parent.selectedDate),void 0===i&&(i=null),this.parent.isAdaptive||t.isNullOrUndefined(this.parent.activeViewOptions.dateFormat)){e=!t.isNullOrUndefined(i)&&i.length>6?i[6]:e;var n=void 0,r=!1;if(this.isCustomMonth()){var a=!t.isNullOrUndefined(i)&&i.length>0?i:this.parent.getCurrentViewDates();(r=a[0].getMonth()!==a[a.length-1].getMonth()||a[0].getFullYear()!==a[a.length-1].getFullYear())&&(e=a[0],n=a[a.length-1])}var s="Month"!==this.parent.currentView||!this.isCustomMonth();if(this.parent.activeViewOptions.interval>1&&s||r)return n=n||E(y(e),this.parent.activeViewOptions.interval-1),e.getFullYear()===n.getFullYear()?U(this.parent.globalize.formatDate(e,{format:"MMMM",calendar:this.parent.getCalendarMode()})+" - "+this.parent.globalize.formatDate(n,{format:"MMMM ",calendar:this.parent.getCalendarMode()})+this.parent.globalize.formatDate(n,{skeleton:"y",calendar:this.parent.getCalendarMode()}),"single"):U(this.parent.globalize.formatDate(e,{format:"MMMM",calendar:this.parent.getCalendarMode()})+" "+e.getFullYear()+" - "+this.parent.globalize.formatDate(n,{format:"MMMM ",calendar:this.parent.getCalendarMode()})+this.parent.globalize.formatDate(n,{skeleton:"y",calendar:this.parent.getCalendarMode()}),"single");var o=this.parent.activeViewOptions.dateFormat?this.parent.activeViewOptions.dateFormat:"MMMM y";return U(this.parent.globalize.formatDate(e,{format:o,calendar:this.parent.getCalendarMode()}),"single")}return this.formatDateRange(!t.isNullOrUndefined(i)&&i.length>0?i[0]:this.parent.selectedDate)},i.prototype.getLabelText=function(e){var t=e.charAt(0).toLowerCase()+e.substring(1);return this.formatViewLabel(t,this.getStartDate(),this.getEndDate())},i.prototype.createWeekNumberElement=function(e){var i=t.createElement("tr"),n=t.createElement("td",{className:"e-week-number",attrs:{title:e?this.parent.localeObj.getConstant("week")+" "+e:""},innerHTML:e||""});i.appendChild(n);var r={elementType:"weekNumberCell",element:n};return this.parent.trigger(ze,r),i},i.prototype.unWireEvents=function(){var e=this.element.querySelector(".e-content-wrap");e&&t.EventHandler.remove(e,"scroll",this.onContentScroll)},i.prototype.isCustomMonth=function(){return"Month"===this.parent.currentView&&(!t.isNullOrUndefined(this.parent.activeViewOptions.displayDate)||this.parent.activeViewOptions.numberOfWeeks>0)},i.prototype.getModuleName=function(){return"month"},i.prototype.destroy=function(){if(!this.parent||this.parent&&this.parent.isDestroyed)return void(this.parent=null);this.element&&(this.monthEvent&&(this.monthEvent.destroy(),this.monthEvent=null),this.unWireEvents(),this.parent.resourceBase&&this.parent.resourceBase.destroy(),this.parent.scheduleTouchModule&&this.parent.scheduleTouchModule.resetValues(),e.prototype.destroy.call(this))},i}(sn),fn=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),yn=function(e){function i(t){var i=e.call(this,t)||this;return i.viewClass="e-year-view",i.isInverseTableSelect=!1,i.yearEventModule=null,i}return fn(i,e),i.prototype.getModuleName=function(){return"year"},i.prototype.renderLayout=function(e){this.parent.resourceBase&&this.parent.resourceBase.generateResourceLevels([{renderDates:this.parent.activeView.renderDates}]),this.setPanel(t.createElement("div",{className:"e-table-wrap"}));var i="Horizontal"===this.parent.activeViewOptions.orientation?"e-horizontal":"e-vertical";t.addClass([this.element],[this.viewClass,i,e]),this.renderPanel(e),this.parent.activeViewOptions.allowVirtualScrolling&&t.addClass([this.element],["e-virtual-scroll"]);var n=this.createTableLayout("e-outer-table");this.element.appendChild(n),this.element.querySelector("table").setAttribute("role","presentation");var r=n.querySelector("tbody");this.rowCount=this.getRowColumnCount("row"),this.columnCount=this.getRowColumnCount("column"),this.renderHeader(r),this.renderContent(r),"Year"!==this.parent.currentView&&this.parent.uiStateValues.isGroupAdaptive&&(this.generateColumnLevels(),this.renderResourceMobileLayout()),t.EventHandler.add(this.element.querySelector(".e-content-wrap"),"scroll",this.onContentScroll,this),this.parent.notify(Ge,{})},i.prototype.renderHeader=function(e){},i.prototype.renderContent=function(e){var i=t.createElement("tr");e.appendChild(i);var n=t.createElement("td");i.appendChild(n),this.element.querySelector("tbody").appendChild(i);var r=t.createElement("div",{className:"e-content-wrap"});n.appendChild(r);var a=this.createTableLayout("e-calendar-table");r.appendChild(a);var s=t.createElement("tr");a.querySelector("tbody").appendChild(s);var o=t.createElement("td");s.appendChild(o);var l=t.createElement("div",{className:"e-calendar-wrapper"});o.appendChild(l);for(var p=0,c=this.getMonths();p<c.length;p++){var h=c[p],d=new Date(this.parent.selectedDate.getFullYear(),h,1),u=t.createElement("div",{className:"e-month-calendar e-calendar",attrs:{"data-role":"calendar"}});u.appendChild(this.renderCalendarHeader(d)),u.appendChild(this.renderCalendarContent(d)),l.appendChild(u)}this.renderDates.splice(0,1)},i.prototype.renderCalendarHeader=function(e){var i=t.createElement("div",{className:"e-header e-month"}),n=t.createElement("div",{className:"e-day e-title"});if(this.parent.activeViewOptions.monthHeaderTemplate){var r={date:e,type:"monthHeader"};this.renderTemplates(this.parent.getMonthHeaderTemplate(),r,"monthHeaderTemplate",this.parent.activeViewOptions.monthHeaderTemplateName,n)}else n.innerHTML=this.getMonthName(e);return i.appendChild(n),this.parent.trigger(ze,{elementType:"headerCells",element:n,date:e}),i},i.prototype.renderCalendarContent=function(e){var i=this.getMonthDates(e),n=t.createElement("div",{className:"e-content e-month"}),r=this.createTableLayout("e-calendar-table "+nt);n.appendChild(r),this.setAriaAttributes(r);var a=t.createElement("thead",{className:"e-week-header"}),s=t.createElement("tr"),o=v(f(e),this.parent.activeViewOptions.firstDayOfWeek);this.parent.activeViewOptions.showWeekNumber&&s.appendChild(t.createElement("th"));for(var l=0;l<7;l++){if(this.parent.activeViewOptions.dayHeaderTemplate){var p=t.createElement("th"),c={date:o,type:"dayHeader"};this.renderTemplates(this.parent.getDayHeaderTemplate(),c,"dayHeaderTemplate",this.parent.activeViewOptions.dayHeaderTemplateName,p),s.appendChild(p)}else s.appendChild(t.createElement("th",{innerHTML:this.parent.getDayNames("narrow")[o.getDay()]}));var h=new Date(o.getTime()+Qe);o=h.getDate()===o.getDate()?O(h,1):h}a.appendChild(s),t.prepend([a],r);for(var d=r.querySelector("tbody");i.length>0;){var u=i.splice(0,7),g=t.createElement("tr");if(this.parent.activeViewOptions.showWeekNumber){var m=this.parent.getWeekNumberContent(u),y=t.createElement("td",{className:"e-week-number",attrs:{title:this.parent.localeObj.getConstant("week")+" "+m},innerHTML:m});g.appendChild(y),this.parent.trigger(ze,{elementType:"weekNumberCells",element:y})}for(var T=0,w=u;T<w.length;T++){var D=w[T],y=t.createElement("td",{className:"e-cell e-work-cells",attrs:{"data-date":D.getTime().toString()}});if(this.parent.activeViewOptions.cellHeaderTemplate){c={date:D,type:"monthCells"};this.renderTemplates(this.parent.getCellHeaderTemplate(),c,"cellHeaderTemplate",this.parent.activeViewOptions.cellHeaderTemplateName,y)}else{var b=t.createElement("span",{className:"e-day",innerHTML:this.parent.globalize.formatDate(D,{skeleton:"d",calendar:this.parent.getCalendarMode()}),attrs:{title:this.parent.globalize.formatDate(D,{type:"date",skeleton:"full"})}});y.appendChild(b)}if(this.parent.activeViewOptions.cellTemplate){c={date:D,type:"monthCells"};this.renderTemplates(this.parent.getCellTemplate(),c,"cellTemplate",this.parent.activeViewOptions.cellTemplateName,y)}var C=[];e.getMonth()!==D.getMonth()&&(C.push("e-other-month"),y.firstElementChild&&!this.parent.activeViewOptions.cellTemplate&&y.firstElementChild.setAttribute("aria-disabled","true")),this.isCurrentDate(D)&&e.getMonth()===D.getMonth()&&(C=C.concat(["e-today","e-selected"])),C.length>0&&t.addClass([y],C),g.appendChild(y),e.getMonth()===D.getMonth()&&this.renderDates.push(new Date(D)),this.parent.isMinMaxDate(D)?(t.EventHandler.add(y,"click",this.onCellClick,this),this.parent.isAdaptive||t.EventHandler.add(y,"dblclick",this.parent.workCellAction.cellDblClick,this.parent.workCellAction)):t.addClass([y],pt),this.parent.trigger(ze,{elementType:"workCells",element:y,date:D})}d.appendChild(g)}return n},i.prototype.createTableColGroup=function(e){for(var i=t.createElement("colgroup"),n=0;n<e;n++)i.appendChild(t.createElement("col"));return i},i.prototype.getMonthName=function(e){return U(this.parent.globalize.formatDate(e,{format:this.parent.activeViewOptions.dateFormat||"MMMM y",calendar:this.parent.getCalendarMode()}),"multiple")},i.prototype.generateColumnLevels=function(){var e=[],t=this.getDateSlots([this.parent.selectedDate],this.parent.activeViewOptions.workDays);if(this.parent.activeViewOptions.group.resources.length>0){if(e=this.parent.resourceBase.generateResourceLevels(t),this.parent.uiStateValues.isGroupAdaptive){var i=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex];e=[this.getDateSlots([this.parent.selectedDate],i.workDays)]}}else e.push(t);return e.pop(),this.colLevels=e,e},i.prototype.getDateSlots=function(e,t,i,n){return void 0===i&&(i=this.parent.workHours.start),void 0===n&&(n=this.parent.workHours.end),[{date:e[0],type:"dateHeader",className:["e-header-cells"],colSpan:1,workDays:t,startHour:new Date(+this.parent.globalize.parseDate(i,{skeleton:"Hm"})),endHour:new Date(+this.parent.globalize.parseDate(n,{skeleton:"Hm"}))}]},i.prototype.getMonthDates=function(e){for(var t=v(f(e),this.parent.activeViewOptions.firstDayOfWeek),i=O(new Date(+t),42),n=[],r=t;r.getTime()<i.getTime();r=O(r,1))n.push(b(new Date(r)));return n},i.prototype.getRowColumnCount=function(e){for(var t=this.getMonths(),i=this.parent.selectedDate.getFullYear(),n=[],r=0,a=t;r<a.length;r++){var s=a[r];n.push(new Date(i,s,1).getDay()+new Date(i,s+1,0).getDate())}var o=Math.max.apply(Math,n);return"row"===e?"Horizontal"===this.parent.activeViewOptions.orientation?t.length:o:"Horizontal"===this.parent.activeViewOptions.orientation?o:t.length},i.prototype.isCurrentDate=function(e){return b(new Date).getTime()===b(new Date(e.getTime())).getTime()},i.prototype.getMonths=function(){var e=this;return Array.apply(null,{length:this.parent.activeViewOptions.monthsCount}).map(function(t,i){return e.parent.firstMonthOfYear+i})},i.prototype.renderTemplates=function(e,i,n,r,a){var s=this.parent.element.id+"_"+r+n,o=[].slice.call(e(i,this.parent,n,s,!1,void 0,void 0,this.parent.root));t.append(o,a)},i.prototype.onCellClick=function(e){var i=t.closest(e.target,".e-work-cells"),n=this.parent.getDateFromElement(i);this.parent.activeCellsData=this.parent.getCellDetails(i);var r=n.getTime()<this.getStartDate().getTime();if(r||n.getTime()>this.getEndDate().getTime()){this.parent.changeDate(this.parent.activeView.getNextPreviousDate(r?"Previous":"Next"),e);var a=this.parent.activeCellsData.startTime.getTime(),s=a>=this.getStartDate().getTime()&&a<=this.getEndDate().getTime()?a:(r?this.getEndDate():this.getStartDate()).getTime(),o=this.parent.element.querySelector(':not(.e-other-month)[data-date="'+s+'"]');this.parent.selectCell(o),this.parent.activeCellsData=this.parent.getCellDetails(o)}else{var l=O(new Date(n.getTime()),1),p={date:n,event:this.parent.eventBase.filterEvents(n,l),element:e.target};i.classList.contains("e-other-month")&&(i=this.parent.element.querySelector(':not(.e-other-month)[data-date="'+i.getAttribute("data-date")+'"]')),this.parent.activeCellsData=this.parent.getCellDetails(i);var c=t.extend(this.parent.activeCellsData,{cancel:!1,event:e,name:"cellClick"});this.parent.trigger("cellClick",c),this.parent.quickPopup.moreEventClick(p,l)}},i.prototype.onContentScroll=function(e){var t=e.target,i=this.getDatesHeaderElement();this.parent.notify("virtual-scroll",e),i&&(i.firstElementChild.scrollLeft=t.scrollLeft);var n=this.element.querySelector(".e-month-header-wrapper,.e-resource-column-wrap");n&&(n.scrollTop=t.scrollTop),this.parent.isAdaptive||(this.parent.uiStateValues.top=e.target.scrollTop),this.parent.uiStateValues.left=e.target.scrollLeft,this.setPersistence()},i.prototype.onScrollUiUpdate=function(e){var i=this.parent.element.offsetHeight-this.getHeaderBarHeight(),n=this.element.querySelector(".e-date-header-container");n&&(i-=n.offsetHeight);var r=this.element.querySelector(".e-content-wrap");if(r&&(r.style.height=t.formatUnit(i)),!this.parent.isAdaptive&&n){var a=M();r.offsetWidth-r.clientWidth>0?(n.firstElementChild.style[e.cssProperties.border]=a>0?"1px":"0px",n.style[e.cssProperties.padding]=a>0?a-1+"px":"0px"):(n.firstElementChild.style[e.cssProperties.border]="",n.style[e.cssProperties.padding]="")}this.setColWidth(this.getContentAreaElement());var s=this.element.querySelector(".e-month-header-wrapper,.e-resource-column-wrap");if(s){var o=r.scrollWidth>r.clientWidth;s.style.height=t.formatUnit(i-(o?17:0))}e.isPreventScrollUpdate||(this.parent.uiStateValues.isInitial?(this.parent.uiStateValues.isInitial=!1,this.parent.uiStateValues.top=this.parent.uiStateValues.left=0):(s&&(s.scrollTop=this.parent.uiStateValues.top),r.scrollTop=this.parent.uiStateValues.top,r.scrollLeft=this.parent.uiStateValues.left)),this.retainScrollPosition()},i.prototype.getStartDate=function(){return new Date(this.parent.selectedDate.getFullYear(),this.parent.firstMonthOfYear%12,1)},i.prototype.getEndDate=function(){return O(E(this.getStartDate(),this.parent.monthsCount),-1)},i.prototype.startDate=function(){return"Year"===this.parent.currentView?v(this.getStartDate(),this.parent.activeViewOptions.firstDayOfWeek):this.getStartDate()},i.prototype.endDate=function(){return"Year"===this.parent.currentView?O(m(this.getEndDate(),this.parent.activeViewOptions.firstDayOfWeek),1):O(this.getEndDate(),1)},i.prototype.getEndDateFromStartDate=function(e){var t=new Date(e.getTime());return this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(t=y(t)),O(new Date(t.getTime()),1)},i.prototype.getNextPreviousDate=function(e){return x(this.parent.selectedDate,"Next"===e?1:-1)},i.prototype.getDateRangeText=function(e,i){void 0===e&&(e=this.parent.selectedDate),void 0===i&&(i=null);var n=!t.isNullOrUndefined(i)&&i.length>0,r=n?i[0]:this.getStartDate(),a=n?i[i.length-1]:this.getEndDate();return r.getFullYear()!==a.getFullYear()?this.parent.globalize.formatDate(r,{format:"MMM y",calendar:this.parent.getCalendarMode()})+" - "+this.parent.globalize.formatDate(a,{format:"MMM y",calendar:this.parent.getCalendarMode()}):this.parent.globalize.formatDate(n?i[0]:e,{skeleton:"y",calendar:this.parent.getCalendarMode()})},i.prototype.addEventListener=function(){this.parent.on(Xe,this.onScrollUiUpdate,this),this.parent.on(_e,this.onDataReady,this)},i.prototype.removeEventListener=function(){this.parent&&(this.parent.off(Xe,this.onScrollUiUpdate),this.parent.off(_e,this.onDataReady))},i.prototype.onDataReady=function(e){this.yearEventModule=new nn(this.parent),this.yearEventModule.renderAppointments(),this.parent.notify("events-loaded",e)},i.prototype.scrollToDate=function(e){var i=+new Date(b(e)),n=this.element.querySelector('.e-work-cells:not(.e-other-month)[data-date="'+i+'"]');n&&(n=t.closest(n,".e-month-calendar"),this.getContentAreaElement().scrollTop=n.offsetTop)},i.prototype.destroy=function(){if(!this.parent||this.parent&&this.parent.isDestroyed)return void(this.parent=null);if(this.element){var i=this.element.querySelector(".e-content-wrap");i&&t.EventHandler.remove(i,"scroll",this.onContentScroll),this.yearEventModule&&(this.yearEventModule.destroy(),this.yearEventModule=null),this.parent.resourceBase&&this.parent.resourceBase.destroy(),e.prototype.destroy.call(this)}},i}(sn),Tn=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),wn=function(e){function i(t){return e.call(this,t)||this}return Tn(i,e),i.prototype.createAgendaContentElement=function(e,i,n,r,a){var s,o=this,l=this.parent.eventFields;if("noEvents"===e){var c=[{subject:this.parent.localeObj.getConstant("noEvents")}];0===(s=p.ListBase.createList(this.parent.createElement,c,{moduleName:"agenda",listClass:this.parent.activeView.viewClass,itemClass:this.parent.activeView.viewClass,template:t.initializeCSPTemplate(function(){return'<div class="e-no-event">'+o.parent.localeObj.getConstant("noEvents")+"</div>"})})).querySelector(".e-agenda-item").children.length&&s.firstElementChild.appendChild(t.createElement("div",{className:"e-no-event",innerHTML:this.parent.localeObj.getConstant("noEvents")}))}else s=p.ListBase.createList(this.parent.createElement,i,{moduleName:"agenda",listClass:this.parent.activeView.viewClass,itemClass:this.parent.activeView.viewClass}),[].slice.call(s.children).forEach(function(e,n){var s=t.createElement("div",{className:"e-appointment",attrs:{"data-id":"Appointment_"+i[parseInt(n.toString(),10)][""+o.parent.eventFields.id],"data-guid":i[parseInt(n.toString(),10)].Guid,role:"button",tabindex:"0","aria-disabled":o.parent.eventBase.getReadonlyAttribute(i[parseInt(n.toString(),10)]),"aria-label":o.parent.getAnnouncementString(i[parseInt(n.toString(),10)])}});t.isNullOrUndefined(a)||s.setAttribute("data-group-index",a.toString()),o.parent.eventBase.applyResourceColor(s,i[parseInt(n.toString(),10)],"borderColor",r);var p;if(t.isNullOrUndefined(o.parent.activeViewOptions.eventTemplate))p=o.createAppointment(i[parseInt(n.toString(),10)]);else{t.addClass([s],"e-template");var c=o.parent.element.id+"_"+o.parent.activeViewOptions.eventTemplateName+"eventTemplate";if(p=o.parent.getAppointmentTemplate()(i[parseInt(n.toString(),10)],o.parent,"eventTemplate",c,!1,void 0,void 0,o.parent.root),!t.isNullOrUndefined(i[parseInt(n.toString(),10)][l.recurrenceRule])){var h=i[parseInt(n.toString(),10)][l.id]===i[parseInt(n.toString(),10)][l.recurrenceID]?"e-recurrence-icon":"e-recurrence-edit-icon";s.appendChild(t.createElement("div",{className:et+" "+h}))}}t.append([].slice.call(p),s),j(e),e.appendChild(s);var d={data:t.extend({},i[parseInt(n.toString(),10)],null,!0),element:e,cancel:!1};o.parent.trigger("eventRendered",d,function(i){i.cancel&&t.remove(e)})});return n.appendChild(s),("MonthAgenda"===this.parent.currentView&&this.parent.activeViewOptions.group.resources.length>0||"Agenda"===this.parent.currentView)&&t.addClass([n],"e-day-border"),this.parent.renderTemplates(),n},i.prototype.createAppointment=function(e){var i=this.parent.eventFields,n=e[i.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),r=e[i.location]||this.parent.eventSettings.fields.location.default,a=t.createElement("div",{className:"e-subject-wrap"});t.isNullOrUndefined(r)||""===r||(n+=",");var s=t.createElement("div",{className:"e-subject"});if(this.parent.sanitize(n,s),a.appendChild(s),!t.isNullOrUndefined(r)&&""!==r){var o=t.createElement("div",{className:"e-location"});this.parent.sanitize(r,o),a.appendChild(o)}if(!t.isNullOrUndefined(e[i.recurrenceRule])){var l=e[i.id]===e[i.recurrenceID]?"e-recurrence-icon":"e-recurrence-edit-icon";a.appendChild(t.createElement("div",{className:et+" "+l}))}var p=e[i.startTime],c=e[i.endTime],h=e[i.isAllDay],d=this.parent.localeObj.getConstant("allDay"),u=this.parent.getTimeString(p)+" - "+this.parent.getTimeString(c);t.isNullOrUndefined(e.data)||(d=((c.getTimezoneOffset()!==p.getTimezoneOffset()?c.getTime()-p.getTime()+36e5:c.getTime()-p.getTime())/Qe>=1?d:u)+" ("+this.parent.localeObj.getConstant("day")+" "+e.data.index+"/"+e.data.count+")");var g=!t.isNullOrUndefined(e.data)||h?d:u;return[a,t.createElement("div",{className:"e-date-time",innerHTML:g})]},i.prototype.processAgendaEvents=function(e){var i=[];if(t.isNullOrUndefined(e))return i;for(var n=0,r=e;n<r.length;n++){var a=r[n],s=this.parent.eventBase.splitEventByDay(a);i=i.concat(s.length>1?s:a)}return i},i.prototype.wireEventActions=function(){for(var e=0,i=[].slice.call(this.parent.element.querySelectorAll(".e-appointment"));e<i.length;e++){a=i[e];this.parent.eventBase.wireAppointmentEvents(a,this.parent.getEventDetails(a),!0)}for(var n=0,r=[].slice.call(this.parent.element.querySelectorAll(".e-m-date"));n<r.length;n++){var a=r[n];t.EventHandler.add(a,"click",this.parent.agendaModule.dayNavigationClick,this)}},i.prototype.calculateResourceTableElement=function(e,i,n,r){if(void 0===r&&(r=null),t.isNullOrUndefined(this.parent.resourceBase.lastResourceLevel)){var a=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays);this.parent.resourceBase.generateResourceLevels(a)}for(var s=O(new Date(n.getTime()),i),o=this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView?i:1,l=this.parent.resourceBase.resourceCollection,p=this.parent.resourceBase.lastResourceLevel,c=n,h=n,d=this.parent.activeViewOptions.showWeekend,u=0;u<o;u++){var g=[],v=[],m=0,f=void 0,y=void 0,T=O(h,u);if("Agenda"===this.parent.currentView&&this.parent.activeViewOptions.group.byDate&&this.parent.activeViewOptions.allowVirtualScrolling&&!d&&!this.isWorkDay(T)){do{if((T=O(T,1))>=r)break}while(!this.isWorkDay(T)||this.parent.eventBase.filterEvents(T,O(T,1)).length<1);if(T>=r)break;h=O(T,-u),s=O(T,1)}var w=this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView?O(T,1):s,D=this.parent.eventBase.filterEvents(T,w);if(D.length>0||!this.parent.hideEmptyAgendaDays||"MonthAgenda"===this.parent.currentView){for(var b=0;b<p.length;b++){i=this.parent.activeViewOptions.group.byDate&&"MonthAgenda"!==this.parent.currentView?1:i;M=[];n=T;var C=this.parent.eventBase.filterEvents(n,s,D,p[parseInt(b.toString(),10)]);if(C.length>0||!this.parent.hideEmptyAgendaDays||"MonthAgenda"===this.parent.currentView)for(var S=0;S<i;S++){var E=this.parent.eventBase.filterEvents(n,O(n,1),C,void 0);if(((d||!d&&(this.parent.group.byDate?this.isWorkDay(n):this.isWorkDay(n,p[parseInt(b.toString(),10)].workDays)))&&(E.length>0||!this.parent.hideEmptyAgendaDays)||"MonthAgenda"===this.parent.currentView)&&(M.push(E[0]),f={rowSpan:1,type:"eventColumn",resource:l[l.length-1],groupIndex:p[parseInt(b.toString(),10)].groupIndex,groupOrder:p[parseInt(b.toString(),10)].groupOrder,resourceData:p[parseInt(b.toString(),10)].resourceData,eventData:E,date:n},y={rowSpan:1,type:"dateColumn",resource:l[parseInt((l.length-1).toString(),10)],groupOrder:p[parseInt(b.toString(),10)].groupOrder,resourceData:p[parseInt(b.toString(),10)].resourceData,date:n,groupIndex:p[parseInt(b.toString(),10)].groupIndex},g[parseInt(m.toString(),10)]||(g[parseInt(m.toString(),10)]=[]),g[parseInt(m.toString(),10)].push(f),g[parseInt(m.toString(),10)].push(y),m++),(n=O(n,1)).getTime()>=s.getTime()||this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView){if(M.length>0){g[g.length-1][1].cssClass="e-day-border";var x={rowSpan:M.length,type:"resourceColumn",resource:l[parseInt((l.length-1).toString(),10)],groupOrder:p[parseInt(b.toString(),10)].groupOrder.slice(0,-1),resourceData:p[parseInt(b.toString(),10)].resourceData,groupIndex:g.length-M.length,className:["e-resource-name"],date:n};g[parseInt((g.length-M.length).toString(),10)].push(x),v.push(t.extend({},x,null,!0))}break}}}for(var V=l.slice(0,-1),A=[],I=0,k=0;k<V.length;k++)for(var M=V[V.length-(k+1)].dataSource,R=0;R<M.length;R++)for(var H=0,P=0;P<v.length;P++)v[parseInt(P.toString(),10)].groupOrder[V.length-(k+1)]===M[parseInt(R.toString(),10)][V[V.length-(k+1)].idField]&&(I+=v[parseInt(P.toString(),10)].rowSpan,A.push(t.extend({},v[parseInt(P.toString(),10)],null,!0))),++H===v.length&&A.length>0&&(A[0].rowSpan=I,A[0].type="parentColumnLevel_"+(k+1),A[0].resource=V[V.length-(k+1)],A[0].resourceData=M[parseInt(R.toString(),10)],A[0].date=n,g[A[0].groupIndex].push(A[0]),A=[],I=0);this.createResourceTableRow(g,e)}}0===this.parent.eventBase.filterEvents(c,s).length&&!this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays&&this.renderEmptyContent(e,c)},i.prototype.createResourceTableRow=function(e,i){var n,r,a,s=t.createElement("tr"),o=t.createElement("td"),l=0;if(this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView){for(var p=[],c=this.parent.resourceBase.resourceCollection.slice(0,-1),h=0;h<e.length;h++)p=p.concat(e[parseInt(h.toString(),10)]);a=c.length>0?"parentColumnLevel_"+c.length:"resourceColumn";for(var d=p.filter(function(e){return e.type===a}),u=0;u<d.length;u++)l+=d[parseInt(u.toString(),10)].rowSpan}for(var g=0;g<e.length;g++){n=s.cloneNode();for(var v=e[parseInt(g.toString(),10)].length-1;v>=0;v--){var m=e[parseInt(g.toString(),10)][parseInt(v.toString(),10)],f=o.cloneNode();if("dateColumn"===m.type){if(this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView){r=e[parseInt(g.toString(),10)][parseInt(v.toString(),10)];continue}f.setAttribute("data-date",m.date.getTime().toString()),f.appendChild(this.createDateHeaderElement(m.date,m.groupIndex));var y=["e-agenda-cells","e-date-column"];m.cssClass&&y.push(m.cssClass),t.addClass([f],y),this.isCurrentDate(new Date(m.date.getTime()))&&t.addClass(f.childNodes,"e-current-day"),n.appendChild(f)}else if("eventColumn"===m.type){for(var T=0===m.eventData.length?"noEvents":"data",w=0;w<n.childNodes.length;w++){var D=n.childNodes.item(w),b=D.classList.contains("e-resource-column")?"resourceHeader":"dateHeader";this.parent.trigger(ze,{elementType:b,element:D,date:m.date,groupIndex:m.groupIndex})}(f=this.createAgendaContentElement(T,m.eventData,f,m.groupOrder,m.groupIndex)).setAttribute("data-date",m.date.getTime().toString()),(this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView)&&t.addClass([f],["e-agenda-cells","e-day-padding"]),n.appendChild(f);var C=0===m.eventData.length?"noEvents":"agendaCells";this.parent.trigger(ze,{elementType:C,element:f,date:m.date,groupIndex:m.groupIndex})}else f.setAttribute("rowspan",m.rowSpan.toString()),t.addClass([f],"e-resource-column"),this.setResourceHeaderContent(f,m,m.className[0]),n.appendChild(f)}if(this.parent.activeViewOptions.group.byDate&&0===g&&"MonthAgenda"!==this.parent.currentView){(f=o.cloneNode()).setAttribute("data-date",r.date.getTime().toString()),f.setAttribute("rowspan",l.toString()),f.appendChild(this.createDateHeaderElement(r.date)),t.addClass([f],["e-agenda-cells","e-date-column","e-date-border"]);var S=I(this.parent.selectedDate.getTime(),r.date.getTime());if(n.setAttribute("data-row-index",S.toString()),this.parent.element.querySelector('.e-agenda-view tr[data-row-index="'+S+'"]'))break;n.insertBefore(f,n.childNodes[0])}i.appendChild(n)}},i.prototype.createDateHeaderElement=function(e,i){var n;if(this.parent.activeViewOptions.dateHeaderTemplate){n=t.createElement("div",{className:"e-day-date-header"});var r={date:e,type:"dateHeader",groupIndex:i},a=this.parent.element.id+"_"+this.parent.activeViewOptions.dateHeaderTemplateName+"dateHeaderTemplate",s=[].slice.call(this.parent.getDateHeaderTemplate()(r,this.parent,"dateHeaderTemplate",a,!1,void 0,void 0,this.parent.root));t.append(s,n)}else n=this.getMobileDateElement(e,"e-day-date-header");return n},i.prototype.renderEmptyContent=function(e,i,n){var r=this.createTableRowElement(i,"noEvents"),a=r.children[0],s=t.createElement("div",{className:"e-empty-event",innerHTML:this.parent.localeObj.getConstant("noEvents")});a.appendChild(s),e.appendChild(r),n&&this.parent.trigger(ze,{elementType:"noEvents",element:a,date:i})},i.prototype.createTableRowElement=function(e,i){var n=I(this.parent.selectedDate.getTime(),e.getTime()),r=t.createElement("tr",{attrs:{"data-row-index":n.toString()}}),a=t.createElement("td",{attrs:{class:"monthHeader"===i?"e-month-header":"e-agenda-cells","aria-selected":"false","data-column-index":n.toString(),"data-date":e.getTime().toString()}}),s=a.cloneNode(),o=a.cloneNode();return r.appendChild(s),"noEvents"!==i&&r.appendChild(o),r},i.prototype.destroy=function(){e.prototype.destroy.call(this)},i}(sn),Dn=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),bn=function(e){function i(t){var i=e.call(this,t)||this;return i.viewClass="e-agenda-view",i.isInverseTableSelect=!1,i.agendaDates={},i.virtualScrollTop=1,i}return Dn(i,e),i.prototype.getModuleName=function(){return"agenda"},i.prototype.renderLayout=function(){this.agendaDates={},this.element=t.createElement("div",{className:"e-table-wrap"}),t.addClass([this.element],this.viewClass),this.element.appendChild(this.createTableLayout("e-outer-table")),this.element.querySelector("table").setAttribute("role","presentation"),this.parent.element.querySelector("."+tt).appendChild(this.element);var e=t.createElement("tr");this.element.querySelector("tbody").appendChild(e);var i=t.createElement("td");e.appendChild(i);var n=t.createElement("div",{className:"e-content-wrap"});i.appendChild(n);var r=this.createTableLayout(nt);this.setAriaAttributes(r),n.appendChild(r);var a=r.querySelector("tbody"),s=b(this.parent.selectedDate);this.renderEmptyContent(a,s),this.wireEvents(),this.parent.resourceBase&&this.parent.resourceBase.generateResourceLevels([{renderDates:this.parent.activeView.renderDates}]),this.parent.uiStateValues.isGroupAdaptive&&!this.parent.element.querySelector(".e-schedule-resource-toolbar-container")&&this.renderResourceMobileLayout(),this.parent.notify(Ge,{})},i.prototype.eventLoad=function(e){this.dataSource=t.extend([],this.parent.eventsData,null,!0);for(var i=0,n=this.parent.eventsData;i<n.length;i++)delete n[i].generatedDates;var r=this.parent.activeViewOptions.allowVirtualScrolling?e.processedData:this.parent.eventsProcessed;if(this.parent.uiStateValues.isGroupAdaptive){var a=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex];this.dataSource=this.parent.eventBase.filterEventsByResource(a,this.dataSource),r=this.parent.eventBase.filterEventsByResource(a,r)}this.parent.eventsProcessed=this.processAgendaEvents(r);var s=b(this.parent.selectedDate),o=this.element.querySelector("."+nt+" tbody"),l=t.closest(o,".e-content-wrap"),p=l.scrollTop;j(o),this.renderInitialContent(o,s),this.wireEventActions(),l.scrollTop=p,this.parent.notify("events-loaded",{}),this.parent.activeViewOptions.allowVirtualScrolling||this.retainScrollPosition()},i.prototype.refreshEvent=function(e){for(var i=[],n=this.parent.eventFields,r=0,a=this.dataSource;r<a.length;r++){var s=a[r];t.isNullOrUndefined(s[n.recurrenceID])&&!t.isNullOrUndefined(s[n.recurrenceRule])&&!t.isNullOrUndefined(s.generatedDates)&&e>=s.generatedDates.end&&(i=i.concat(this.parent.eventBase.generateOccurrence(s,e)))}this.parent.eventsProcessed=this.parent.eventsProcessed.concat(this.processAgendaEvents(i))},i.prototype.refreshHeader=function(){var e=this.element.querySelector("."+nt+" tbody");this.parent.activeViewOptions.group.byDate?j(e):t.remove(e.firstElementChild);var i=b(this.parent.selectedDate),n=t.createElement("tbody"),r=new Date(i.getTime()),a=this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays?this.getEndDateFromStartDate(r):O(r,this.parent.agendaDaysCount);this.renderContent(n,r,a),t.append([].slice.call(n.childNodes),e)},i.prototype.renderInitialContent=function(e,i){var n=t.createElement("tbody"),r=new Date(i.getTime()),a=this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays?this.getEndDateFromStartDate(r):O(r,this.parent.agendaDaysCount);if(this.renderContent(n,r,a),t.append([].slice.call(n.childNodes),e),this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays&&this.parent.eventsData.length>0)for(var s=this.getContentAreaElement(),o=s.querySelector(".e-content-table");s.offsetWidth<=s.clientWidth&&!(this.parent.isAdaptive&&o.offsetHeight>=s.clientHeight);){var l=t.createElement("tbody");if(a=r,r=O(a,-this.parent.agendaDaysCount),this.renderContent(l,r,a),t.prepend([].slice.call(l.childNodes),e),r<=this.parent.minDate)break}e.childNodes.length<=0&&this.renderEmptyContent(e,i,!0)},i.prototype.renderContent=function(e,i,n){var r=this.parent.eventFields,a=new Date(i.getTime()),s=this.appointmentFiltering(a,n);if(s.length>0&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays)if(this.parent.activeViewOptions.showWeekend||this.isAgendaWorkDay(s[0][r.startTime]))i=new Date(new Date(s[0][r.startTime].getTime()).setHours(0,0,0,0)),this.updateHeaderText(s[0][r.startTime]);else for(var o=0,l=s;o<l.length;o++){var p=l[o];if(this.isAgendaWorkDay(p[r.startTime])){i=new Date(new Date(p[r.startTime].getTime()).setHours(0,0,0,0)),this.updateHeaderText(p[r.startTime]);break}}var c;if(!this.parent.hideEmptyAgendaDays||this.parent.agendaDaysCount>0&&s.length>0){if(this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive){var h=i;this.parent.activeViewOptions.group.byDate||(this.parent.activeViewOptions.allowVirtualScrolling=!1,h=a,this.parent.headerModule&&(this.parent.headerModule.updateDateRange(),this.parent.headerModule.updateHeaderItems("remove"))),this.calculateResourceTableElement(e,this.parent.agendaDaysCount,h,n)}else for(var d=0;d<this.parent.agendaDaysCount;d++){var u=this.createTableRowElement(i,"data"),g=this.element.querySelector('tr[data-row-index="'+ +u.dataset.rowIndex+'"]');if(g||!this.parent.activeViewOptions.showWeekend&&!this.isAgendaWorkDay(i)){if(i=O(i,1),!g&&this.parent.activeViewOptions.allowVirtualScrolling&&d--,i.getTime()>n.getTime())break}else{var v=u.children[0],m=u.children[1],f=this.appointmentFiltering(i);if(f.length>0||!this.parent.hideEmptyAgendaDays&&0===f.length){var y=this.parent.hideEmptyAgendaDays||0!==f.length?"data":"noEvents";v.appendChild(this.createDateHeaderElement(i)),u.appendChild(v),this.parent.trigger(ze,{elementType:"dateHeader",element:v,date:i});var T=this.createAgendaContentElement(y,f,m);u.appendChild(T),T.querySelectorAll("li").length>0&&e.appendChild(u);var w=this.parent.hideEmptyAgendaDays||0!==f.length?"agendaCells":"noEvents";this.parent.trigger(ze,{elementType:w,element:T,date:i})}else this.parent.activeViewOptions.allowVirtualScrolling&&d--;if(this.isCurrentDate(new Date(i.getTime()))&&t.addClass(v.childNodes,"e-current-day"),(i=O(i,1)).getTime()>n.getTime())break}}c=new Date(i.getTime()-Qe)}this.agendaDates={start:a,end:c}},i.prototype.isAgendaWorkDay=function(e){return this.parent.uiStateValues.isGroupAdaptive&&!this.parent.group.byDate?this.isWorkDay(e,this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex].workDays):this.isWorkDay(e)},i.prototype.agendaScrolling=function(e){this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(),this.parent.activeViewOptions.allowVirtualScrolling&&this.virtualScrolling(e),this.parent.activeViewOptions.allowVirtualScrolling||this.setPersistence()},i.prototype.virtualScrolling=function(e){var i=e.target,n=i.scrollTop,r=i.scrollHeight,a=n+i.clientHeight,s=this.virtualScrollTop<n?"next":"previous",o=i.querySelector("tbody"),l=t.createElement("tbody"),p=this.getElementFromScrollerPosition(e);if(p){var c,h=this.parent.getDateFromElement(p);if(0===n){if(c=this.getPreviousNextDate(O(h,-1),s),this.appointmentFiltering(c.start,c.end).length>0||!this.parent.hideEmptyAgendaDays){this.renderContent(l,c.start,c.end),t.prepend([].slice.call(l.childNodes),o),this.wireEventActions();for(var d=0,u=o.children;d<u.length;d++)if(u[parseInt(d.toString(),10)].getAttribute("data-row-index")===p.getAttribute("data-column-index")){var g=u[parseInt(d.toString(),10)].offsetTop-this.element.querySelector(".e-agenda-item").offsetHeight;i.scrollTop=g;break}this.updateHeaderText(h)}}else a>=r-5?(c=this.getPreviousNextDate(O(h,1),s),(this.appointmentFiltering(c.start,c.end).length>0||!this.parent.hideEmptyAgendaDays)&&(this.renderContent(l,c.start,c.end),t.append([].slice.call(l.childNodes),o),this.wireEventActions(),this.updateHeaderText(h))):this.updateHeaderText(h);this.virtualScrollTop=n;var v=this.parent.eventBase.getSelectedAppointments();v.length>0&&v[v.length-1].focus()}},i.prototype.getElementFromScrollerPosition=function(e){var i,n,r=e.target,a=r.scrollTop,s=r.scrollHeight,o=a+r.clientHeight,l=[].slice.call(r.querySelectorAll(".e-agenda-item"));if(l.length>0)if(0===a)n=l[0],i=t.closest(n,".e-agenda-cells");else if(o===s)n=l[l.length-1],i=t.closest(n,".e-agenda-cells");else for(var p=0,c=l.length;p<c;p++)if(n=l[parseInt(p.toString(),10)],n.getBoundingClientRect().top>=0){i=t.closest(n,".e-agenda-cells");break}return i},i.prototype.updateHeaderText=function(e){this.parent.showHeaderBar&&this.parent.headerModule.updateDateRange(e)},i.prototype.getPreviousNextDate=function(e,t){var i=new Date(e.getTime()),n=this.getStartDateFromEndDate(e),r=this.getEndDateFromStartDate(e),a=0;do{if((this.parent.activeViewOptions.showWeekend||!this.parent.activeViewOptions.showWeekend&&this.isAgendaWorkDay(i))&&(this.appointmentFiltering(i).length>0||!this.parent.hideEmptyAgendaDays)&&a++,(i=O(i,"next"===t?1:-1))<n||i>r)break}while(a!==this.parent.agendaDaysCount);var s=O(i,"next"===t?-1:1);return"next"===t?{start:e,end:O(s,1)}:{start:s,end:O(e,1)}},i.prototype.appointmentFiltering=function(e,i){var n,r,a=this;!t.isNullOrUndefined(e)&&t.isNullOrUndefined(i)?(n=b(new Date(e.getTime())),r=D(new Date(n.getTime()),Qe)):(n=new Date(e.getTime()),r=new Date(i.getTime()));var s=this.parent.eventBase.filterEvents(n,r);if(0===s.length&&(this.refreshEvent(e),s=this.parent.eventBase.filterEvents(n,r)),!t.isNullOrUndefined(this.parent.minDate)||!t.isNullOrUndefined(this.parent.maxDate)){var o=this.parent.eventFields;s=s.filter(function(e){var t=e[o.startTime],i=e[o.endTime];return!(t.getTime()<a.parent.minDate.getTime()||i.getTime()>O(a.parent.maxDate,1).getTime())})}return s},i.prototype.getStartDateFromEndDate=function(e){var t,i=this.parent.eventFields;if(this.parent.eventsProcessed.length>0){var n=Math.min.apply(Math,this.parent.eventsProcessed.map(function(e){return e[i.startTime].getTime()}));t=this.parent.hideEmptyAgendaDays?new Date(n):this.parent.minDate}else t=this.parent.hideEmptyAgendaDays?E(e,-1):this.parent.minDate;return b(t)},i.prototype.getEndDateFromStartDate=function(e){var t,i=this.parent.eventFields;if(this.parent.eventsProcessed.length>0){var n=Math.max.apply(Math,this.parent.eventsProcessed.map(function(e){return e[i.endTime].getTime()}));t=this.parent.hideEmptyAgendaDays?new Date(n):this.parent.maxDate}else t=this.parent.hideEmptyAgendaDays?E(e,1):this.parent.maxDate;return b(O(t,1))},i.prototype.getNextPreviousDate=function(e){var t="Next"===e?1:-1;return O(this.parent.selectedDate,t)},i.prototype.startDate=function(){return b(this.parent.selectedDate)},i.prototype.endDate=function(){return this.parent.activeViewOptions.allowVirtualScrolling?this.getEndDateFromStartDate(this.startDate()):O(this.startDate(),this.parent.agendaDaysCount)},i.prototype.getDateRangeText=function(e){var i=this.parent.activeViewOptions.dateFormat?this.parent.activeViewOptions.dateFormat:"MMMM y";if(this.parent.activeViewOptions.allowVirtualScrolling||this.parent.isAdaptive){var n=t.isNullOrUndefined(e)?this.parent.selectedDate:e;return U(this.parent.globalize.formatDate(n,{format:i,calendar:this.parent.getCalendarMode()}),"multiple")}var r=this.parent.selectedDate,a=O(r,this.parent.agendaDaysCount-1);return this.formatDateRange(r,a)},i.prototype.dayNavigationClick=function(e){var i=t.closest(e.currentTarget,".e-agenda-cells"),n=this.parent.getDateFromElement(i);t.isNullOrUndefined(n)||this.parent.isAdaptive||!this.parent.isMinMaxDate(n)||(this.parent.setProperties({selectedDate:n},!0),this.parent.changeView("Day",e))},i.prototype.wireEvents=function(){t.EventHandler.add(this.element.querySelector(".e-content-wrap"),"scroll",this.agendaScrolling,this)},i.prototype.unWireEvents=function(){t.EventHandler.remove(this.element.querySelector(".e-content-wrap"),"scroll",this.agendaScrolling);for(var e=0,i=[].slice.call(this.element.querySelectorAll(".e-m-date"));e<i.length;e++){var n=i[e];t.EventHandler.remove(n,"click",this.dayNavigationClick)}},i.prototype.addEventListener=function(){this.parent.on(Xe,this.onAgendaScrollUiUpdate,this),this.parent.on(_e,this.eventLoad,this)},i.prototype.removeEventListener=function(){this.parent&&(this.parent.off(Xe,this.onAgendaScrollUiUpdate),this.parent.off(_e,this.eventLoad))},i.prototype.onAgendaScrollUiUpdate=function(){var e=this.getHeaderBarHeight();this.parent.headerModule&&(this.parent.activeViewOptions.allowVirtualScrolling?this.parent.headerModule.updateHeaderItems("add"):this.parent.headerModule.updateHeaderItems("remove"));var i=this.element.querySelector(".e-content-wrap");"auto"!==this.parent.height&&(i.style.height=t.formatUnit(this.parent.element.offsetHeight-e))},i.prototype.scrollToDate=function(e){var t=new Date(+b(e));if(this.parent.activeViewOptions.allowVirtualScrolling)(!this.parent.hideEmptyAgendaDays||this.parent.getEvents(t,O(t,1),!0).length>0)&&this.parent.changeDate(t);else{var i=this.element.querySelector('.e-agenda-cells[data-date="'+t.getTime()+'"]');i&&(this.getContentAreaElement().scrollTop=i.offsetTop)}},i.prototype.destroy=function(){if(!this.parent||this.parent&&this.parent.isDestroyed)return void(this.parent=null);this.element&&(this.unWireEvents(),this.parent.resourceBase&&this.parent.resourceBase.destroy(),this.parent.headerModule&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.headerModule.updateHeaderItems("remove"),e.prototype.destroy.call(this))},i}(wn),Cn=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Sn=function(e){function i(t){var i=e.call(this,t)||this;return i.dayNameFormat="narrow",i.viewClass="e-month-agenda-view",i.monthAgendaDate=new Date(""+t.selectedDate),i}return Cn(i,e),i.prototype.getModuleName=function(){return"monthAgenda"},i.prototype.renderAppointmentContainer=function(){var e=this.getContentAreaElement(),i=t.createElement("div",{className:"e-wrapper-container"});e.appendChild(i);var n=t.createElement("div",{className:"e-appointment-wrap"});i.appendChild(n),this.appendAppContainer(n),this.setEventWrapperHeight()},i.prototype.getDayNameFormat=function(){return this.parent.isAdaptive?"narrow":"abbreviated"},i.prototype.updateSelectedCellClass=function(e){b(e.date).getTime()===b(new Date(""+this.parent.selectedDate)).getTime()&&e.className.push("e-selected-cell")},i.prototype.setEventWrapperHeight=function(){var e=(this.parent.headerModule?this.parent.headerModule.getHeaderElement().offsetHeight:0)+2,i=this.parent.element.querySelector(".e-schedule-resource-toolbar");i&&(e+=i.offsetHeight);var n=this.getContentAreaElement().firstElementChild,r=this.element.querySelector(".e-date-header-wrap"),a=this.parent.element.offsetHeight-e-r.offsetHeight,s=this.parent.activeViewOptions.interval>1?Math.round(.8*a):n.offsetHeight,o=a-s,l=this.element.querySelector(".e-wrapper-container"),p=this.element.querySelector(".e-appointment-wrap");"auto"!==this.parent.height&&(this.parent.activeViewOptions.interval>1&&(n.style.height=t.formatUnit(s),t.EventHandler.add(n,"scroll",this.onContentScroll,this)),l.style.height=p.style.height=t.formatUnit(o))},i.prototype.onDataReady=function(e){this.setEventWrapperHeight(),this.clearElements();var i=e.processedData;if(this.parent.uiStateValues.isGroupAdaptive){var n=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex];i=this.parent.eventBase.filterEventsByResource(n,i)}this.agendaBase=this.getAgendaBase(),this.parent.eventsProcessed=this.agendaBase.processAgendaEvents(i);for(var r=0,a=0,s=this.renderDates;a<s.length;a++){var o=s[a],l=this.appointmentFiltering(o),p=this.element.querySelectorAll(".e-work-cells")[parseInt(r.toString(),10)];l.length>0&&(p.querySelector(".e-appointment-indicator")||p.appendChild(t.createElement("div",{className:"e-appointment-indicator"})),o.getTime()===b(new Date(this.monthAgendaDate.getTime())).getTime()&&this.onEventRender(l,o)),r++}this.parent.notify("events-loaded",{})},i.prototype.onCellClick=function(e){this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide();var t=this.appointmentFiltering(e.startTime);this.onEventRender(t,e.startTime),this.parent.notify("events-loaded",{}),this.monthAgendaDate=new Date(""+e.startTime),this.parent.setProperties({selectedDate:this.monthAgendaDate},!0)},i.prototype.onEventRender=function(e,i){this.agendaBase=this.getAgendaBase();var n=this.element.querySelector(".e-appointment-wrap");if(j(n),0===this.parent.activeViewOptions.group.resources.length||this.parent.uiStateValues.isGroupAdaptive)if(e.length>0){var r=t.createElement("div",{className:at});n.appendChild(this.agendaBase.createAgendaContentElement("data",e,r))}else this.appendAppContainer(n);else if(e.length>0){var a=this.createTableLayout(),s=a.querySelector("tbody");this.agendaBase.calculateResourceTableElement(s,1,i),a.appendChild(s),n.appendChild(a)}else this.appendAppContainer(n);this.agendaBase.wireEventActions()},i.prototype.appointmentFiltering=function(e){var t=b(new Date(e.getTime())),i=D(new Date(t.getTime()),Qe);return this.parent.eventBase.filterEvents(t,i)},i.prototype.clearElements=function(){for(var e=0,i=[].slice.call(this.element.querySelectorAll(".e-appointment-indicator"));e<i.length;e++){var n=i[e];t.remove(n)}this.appendAppContainer(this.element.querySelector(".e-appointment-wrap"))},i.prototype.appendAppContainer=function(e){var i=t.createElement("div",{className:at});t.addClass([i],"e-no-event"),i.innerHTML=this.parent.localeObj.getConstant("noEvents"),j(e),e.appendChild(i)},i.prototype.getNextPreviousDate=function(e){var t=this.parent.selectedDate,i="Next"===e?this.parent.activeViewOptions.interval:-this.parent.activeViewOptions.interval,n=E(this.parent.selectedDate,i),r="Next"===e?2:0,a=new Date(t.getFullYear(),t.getMonth()+r,0).getDate(),s=a>=this.monthAgendaDate.getDate()?this.monthAgendaDate.getDate():a;return this.monthAgendaDate=new Date(n.getFullYear(),n.getMonth(),s),this.monthAgendaDate},i.prototype.getAgendaBase=function(){return this.agendaBase||new wn(this.parent)},i.prototype.destroy=function(){this.agendaBase&&(this.agendaBase.destroy(),this.agendaBase=null),e.prototype.destroy.call(this)},i}(mn),On=function(){function e(e,t){this.parent=e,this.renderDates=t}return e.prototype.groupByYear=function(e){for(var t={},i=0,n=e;i<n.length;i++){var r=n[i],a=r.getFullYear();t[parseInt(a.toString(),10)]=t[parseInt(a.toString(),10)]||[],t[parseInt(a.toString(),10)].push(r)}return t},e.prototype.groupByMonth=function(e){for(var t={},i=0,n=e;i<n.length;i++){var r=n[i],a=12*(r.getFullYear()-1970)+r.getMonth();t[parseInt(a.toString(),10)]=t[parseInt(a.toString(),10)]||[],t[parseInt(a.toString(),10)].push(r)}return t},e.prototype.groupByWeek=function(e){for(var t={},i=0,n=e;i<n.length;i++){var r=n[i],a=+new Date(1970,0,1),s=r.getTimezoneOffset()-new Date(1970,0,1).getTimezoneOffset(),o=Math.ceil(((+r-a-60*s*1e3)/Qe+new Date(a).getDay()+1)/7);this.parent.activeViewOptions.firstDayOfWeek&&this.parent.activeViewOptions.firstDayOfWeek>new Date(+r).getDay()&&(o-=1),t[parseInt(o.toString(),10)]=t[parseInt(o.toString(),10)]||[],t[parseInt(o.toString(),10)].push(r)}return t},e.prototype.generateSlots=function(e,i,n,r,a){for(var s=this,o=function(e,t){return s.parent.globalize.formatDate(e,{format:t,calendar:s.parent.getCalendarMode()})},l=[],p=Object.keys(e),c=0;c<p.length;c++){var h=e[p[parseInt(c.toString(),10)]],d=void 0;if(n.template){var u={date:h[0],type:a},g=this.parent.element.id+"_headerRowTemplate";d=[].slice.call(this.parent.templateParser(n.template)(u,this.parent,"template",g,!1))}else{var v=void 0;switch(n.option){case"Year":v='<span class="e-header-year">'+o(h[0],"y")+"</span>";break;case"Month":v='<span class="e-header-month">'+U(o(h[0],"MMMM"),"single")+"</span>";break;case"Week":v='<span class="e-header-week">'+this.parent.getWeekNumberContent(h)+"</span>"}var m=t.createElement("div",{innerHTML:v});d=[].slice.call(m.childNodes)}l.push({date:h[0],type:a,className:[r],colSpan:h.length*i,template:d})}return l},e.prototype.generateColumnLevels=function(e,t){var i=[],n=this.parent.activeViewOptions.headerRows,r=1;"Hour"===n[n.length-1].option&&t.length>0&&(r=t.length/e.length);for(var a,s,o,l=[],p=0,c=n;p<c.length;p++){var h=c[p];switch(h.option){case"Year":a=this.groupByYear(this.renderDates),l=this.generateSlots(a,r,h,"e-header-year-cell","yearHeader"),i.push(l);break;case"Month":s=this.groupByMonth(this.renderDates),l=this.generateSlots(s,r,h,"e-header-month-cell","monthHeader"),i.push(l);break;case"Week":o=this.groupByWeek(this.renderDates),l=this.generateSlots(o,r,h,"e-header-week-cell","weekHeader"),i.push(l);break;case"Date":l=(l=e).map(function(e){return e.colSpan=r,e}),i.push(l);break;case"Hour":t.length>0&&i.push(t)}}return i},e}(),En=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),xn=function(e){function i(t){var i=e.call(this,t)||this;return i.timelineAppointment=null,i.baseCssClass="e-timeline-view",i}return En(i,e),i.prototype.getModuleName=function(){return"timelineViews"},i.prototype.getLeftPanelElement=function(){return this.element.querySelector(".e-resource-column-wrap")},i.prototype.scrollTopPanel=function(t){e.prototype.scrollTopPanel.call(this,t),this.scrollHeaderLabels(t)},i.prototype.scrollToWorkHour=function(){var e=this.parent.getStartEndTime(this.parent.workHours.start),i=this.isWorkDay(this.parent.selectedDate)&&this.parent.workHours.highlight&&!t.isNullOrUndefined(e)?new Date(+this.parent.selectedDate).setHours(e.getHours(),e.getMinutes(),0,0):new Date(+this.parent.selectedDate).setHours(0,0,0,0),n='[data-date="'+new Date(i).getTime().toString()+'"]',r=this.element.querySelector(n);r&&(this.getContentAreaElement().scrollLeft=this.parent.enableRtl?-(this.parent.getContentTable().offsetWidth-r.offsetLeft-r.offsetWidth):r.offsetLeft)},i.prototype.scrollToHour=function(e,i){var n,r;if(i&&(r=this.parent.getIndexOfDate(this.renderDates,b(i)))>=0&&(n=i,!t.isNullOrUndefined(e))){var a=e.split(":");2===a.length&&(n=new Date(i.setHours(parseInt(a[0],10),parseInt(a[1],10),0)))}if(n=t.isNullOrUndefined(i)?this.parent.getStartEndTime(e):n,!t.isNullOrUndefined(n)){var s;s=t.isNullOrUndefined(e)||!this.parent.activeViewOptions.timeScale.enable?r*this.parent.getElementWidth(this.element.querySelector(".e-work-cells")):t.isNullOrUndefined(i)?this.getLeftFromDateTime(null,n):this.getLeftFromDateTime([r],n),this.getScrollableElement().scrollLeft=this.parent.enableRtl?-s:s}},i.prototype.generateColumnLevels=function(){var e=[],t=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays);e.push(t),this.parent.activeViewOptions.group.resources.length>0&&this.parent.resourceBase.generateResourceLevels(t,!this.parent.uiStateValues.isGroupAdaptive);var i=[];return this.parent.activeViewOptions.timeScale.enable&&(i=this.generateTimeSlots(e[e.length-1]),e.push(i)),this.parent.activeViewOptions.headerRows.length>0&&(e=new On(this.parent,this.renderDates).generateColumnLevels(t,i)),e},i.prototype.generateTimeSlots=function(e){for(var i=this,n=function(e){return e.type=e.first?"majorSlot":"minorSlot",e.className=e.first?["e-time-slots"]:["e-time-slots","e-time-cells"],e.workDays=i.parent.activeViewOptions.workDays,e},r=this.getTimeSlotRows(n),a=[],s=0,o=e;s<o.length;s++){var l=o[s];l.colSpan=r.length;for(var p=0,c=t.extend([],r,null,!0);p<c.length;p++){var h=c[p],d=b(new Date(""+l.date));h.date=D(d,C(h.date)),a.push(h)}}return a},i.prototype.changeCurrentTimePosition=function(){if(!(!this.parent||this.parent&&this.parent.isDestroyed)){this.removeCurrentTimeIndicatorElements();var e=this.getCurrentTimeIndicatorIndex(),i=this.getLeftFromDateTime(e,this.parent.getCurrentTime()),n=this.element.querySelector("."+nt).offsetHeight,r=this.element.querySelector(".e-date-header-wrap");if(this.element.querySelector(".e-content-wrap").appendChild(t.createElement("div",{className:"e-current-timeline",styles:(this.parent.enableRtl?"right":"left")+":"+t.formatUnit(i)+"; height:"+t.formatUnit(n)})),this.parent.virtualScrollModule){var a=this.parent.element.querySelector(".e-current-timeline"),s=this.parent.element.querySelector(".e-content-wrap table");t.setStyleAttribute(a,{transform:s.style.transform})}var o=t.createElement("div",{innerHTML:this.parent.getTimeString(this.parent.getCurrentTime()),className:"e-current-time"});r.appendChild(o),o.style[this.parent.enableRtl?"right":"left"]=t.formatUnit(i-o.offsetWidth/2)}},i.prototype.getLeftFromDateTime=function(e,i){var n=this.getStartHour(),r=this.getEndHour(),a=0,s=60*(i.getHours()-n.getHours())+(i.getMinutes()-n.getMinutes()),o=V(b(new Date(i.getTime())),n,r),l=(o.endHour.getTime()-o.startHour.getTime())/Ke,p=this.parent.activeViewOptions.timeScale.interval,c=0;if(c=0===n.getHours()&&0===n.getMinutes()&&0===r.getHours()&&0===r.getMinutes()?p:1!==this.parent.activeViewOptions.timeScale.slotCount?p:p>l?l:p,!t.isNullOrUndefined(e)&&0!==e[0]){var h=this.parent.activeView.colLevels.findIndex(function(e){return"dateHeader"===e[0].type});if(this.parent.activeView.colLevels[parseInt(h.toString(),10)]&&this.parent.activeView.colLevels[parseInt(h.toString(),10)][0].colSpan)a=e[0]*this.parent.activeView.colLevels[parseInt(h.toString(),10)][0].colSpan*this.parent.getElementWidth(this.element.querySelector(".e-work-cells"));else{var d=this.getEndHour(),u=0===d.getHours()?24:d.getHours();s+=e[0]*(60*(u-n.getHours())+(d.getMinutes()-n.getMinutes()))}}return a+s*this.parent.getElementWidth(this.element.querySelector(".e-work-cells"))*this.parent.activeViewOptions.timeScale.slotCount/c},i.prototype.renderHeader=function(){var e=t.createElement("tr");this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.renderResourceHeaderIndent(e);var i=t.createElement("td");i.appendChild(this.renderDatesHeader()),e.appendChild(i),t.prepend([e],this.element.querySelector("tbody"))},i.prototype.createAllDayRow=function(e,t){},i.prototype.getCurrentTimeIndicatorIndex=function(){var e=[],t=this.parent.getIndexOfDate(this.renderDates,b(this.parent.getCurrentTime()));return t>=0&&e.push(t),e},i.prototype.renderContent=function(){var e=t.createElement("tr");if(this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive){var i=t.createElement("td");i.appendChild(this.parent.resourceBase.createResourceColumn()),e.appendChild(i)}var n=t.createElement("td"),r=this.renderContentArea();r.appendChild(this.createEventTable(this.getRowCount())),this.collapseRows(r),n.appendChild(r),e.appendChild(n),this.parent.virtualScrollModule&&this.parent.virtualScrollModule.renderVirtualTrack(r),this.element.querySelector("tbody").appendChild(e)},i.prototype.getRowCount=function(){return this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive?this.parent.resourceBase.renderedResources.length:1},i.prototype.getResourceTdData=function(e,t){var i=this.parent.resourceBase.renderedResources[parseInt(e.toString(),10)],n=i.resourceData[i.resource.startHourField]||this.parent.workHours.start,r=i.resourceData[i.resource.endHourField]||this.parent.workHours.end;return t.startHour=this.parent.getStartEndTime(n),t.endHour=this.parent.getStartEndTime(r),t.workDays=i.resourceData[i.resource.workDaysField]||this.parent.workDays,t.className=i.className,t.groupIndex=i.groupIndex,t.groupOrder=i.groupOrder,t},i.prototype.renderContentTable=function(e){var i=e.querySelector("tbody");t.append(this.getContentRows(),i)},i.prototype.getContentRows=function(){for(var e=[],i=t.createElement("tr"),n=t.createElement("td"),r=this.getRowCount(),a=this.getGroupIndices(),s=0;s<r;s++)if(!(a.length>0&&a.indexOf(this.parent.resourceBase.renderedResources[parseInt(s.toString(),10)].groupIndex)>-1)){for(var o=i.cloneNode(),l=0,p=this.colLevels[this.colLevels.length-1];l<p.length;l++){var c=p[l];this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(c=this.getResourceTdData(s,c));var h=this.createContentTd(c,c,n);o.appendChild(h)}e.push(o)}return e},i.prototype.getContentTdClass=function(e){return e.first||!this.parent.activeViewOptions.timeScale.enable?["e-work-cells"]:["e-work-cells","e-alternate-cells"]},i.prototype.renderEvents=function(){this.timelineAppointment=new zt(this.parent,this.parent.activeViewOptions.timeScale.enable?"hour":"day"),this.timelineAppointment.renderAppointments(),this.parent.notify("events-loaded",{})},i.prototype.getAdjustedDate=function(e){if(!this.parent.activeViewOptions.timeScale.enable)return new Date(e.setHours(0,0,0,0));for(var t=this.colLevels[this.colLevels.length-1],i=0;i<t.length;i++)if(t[parseInt(i.toString(),10)].date.getTime()>e.getTime())return t[i-1].date;return null},i.prototype.destroy=function(){if(!this.parent||this.parent&&this.parent.isDestroyed)return void(this.parent=null);this.timelineAppointment&&(this.timelineAppointment.destroy(),this.timelineAppointment=null),e.prototype.destroy.call(this)},i}(ln),Vn=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),An=function(e){function i(t){var i=e.call(this,t)||this;return i.viewClass="e-timeline-month-view",i.isInverseTableSelect=!0,i.appointment=null,i}return Vn(i,e),i.prototype.getModuleName=function(){return"timelineMonth"},i.prototype.onDataReady=function(){this.appointment=new zt(this.parent,"day"),this.appointment.renderAppointments(),this.parent.notify("events-loaded",{})},i.prototype.getLeftPanelElement=function(){return this.element.querySelector(".e-resource-column-wrap")},i.prototype.scrollTopPanel=function(t){e.prototype.scrollTopPanel.call(this,t),this.scrollHeaderLabels(t)},i.prototype.setContentHeight=function(e,i,n){i&&(i.style.height=t.formatUnit(n-this.getScrollXIndent(e))),e.style.height=t.formatUnit(n)},i.prototype.getDateSlots=function(e,t){for(var i=[],n=0,r=e;n<r.length;n++){var a=r[n],s=["e-header-cells"];this.isCurrentDate(a)&&s.push("e-current-day"),i.push({date:a,type:"dateHeader",className:s,colSpan:1,workDays:t})}return i},i.prototype.renderLeftIndent=function(e){this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.renderResourceHeaderIndent(e)},i.prototype.renderContent=function(){var e=t.createElement("tr");if(this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive){var i=t.createElement("td");i.appendChild(this.parent.resourceBase.createResourceColumn()),e.appendChild(i)}var n=t.createElement("td");this.element.querySelector("tbody").appendChild(e);var r=t.createElement("div",{className:"e-content-wrap"});r.appendChild(this.renderContentArea()),r.appendChild(this.createEventTable(this.getRowCount())),this.collapseRows(r),t.EventHandler.add(r,"scroll",this.onContentScroll,this),n.appendChild(r),this.parent.virtualScrollModule&&this.parent.virtualScrollModule.renderVirtualTrack(r),e.appendChild(n)},i.prototype.getRowCount=function(){return this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive?this.parent.resourceBase.renderedResources.length:1},i.prototype.getContentSlots=function(){for(var e=[],t=0;t<this.getRowCount();t++)for(var i=0,n=this.colLevels[this.colLevels.length-1];i<n.length;i++){var r=n[i];if(r.className=["e-work-cells"],this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive){var a=this.parent.resourceBase.renderedResources[parseInt(t.toString(),10)];r.workDays=a.resourceData[a.resource.workDaysField]||this.parent.workDays,r.className=r.className.concat(a.className),r.groupIndex=a.groupIndex,r.groupOrder=a.groupOrder}var s={date:new Date(+r.date),colSpan:r.colSpan,groupIndex:r.groupIndex,workDays:r.workDays,type:"monthCells",className:r.className};e[parseInt(t.toString(),10)]||(e[parseInt(t.toString(),10)]=[]),e[parseInt(t.toString(),10)].push(s)}return e},i.prototype.updateClassList=function(e){this.parent.isMinMaxDate(e.date)||e.className.push(pt)},i.prototype.unWireEvents=function(){t.EventHandler.remove(this.getContentAreaElement(),"scroll",this.onContentScroll)},i.prototype.getMonthStart=function(e){var t=this.parent.calendarUtil.firstDateOfMonth(b(e));return new Date(t.getFullYear(),t.getMonth(),t.getDate())},i.prototype.getMonthEnd=function(e){var t=this.parent.calendarUtil.firstDateOfMonth(b(e));return this.parent.calendarUtil.lastDateOfMonth(E(new Date(+t),this.parent.activeViewOptions.interval-1))},i.prototype.generateColumnLevels=function(){var e=[],t=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays);e.push(t),this.parent.activeViewOptions.group.resources.length>0&&this.parent.resourceBase.generateResourceLevels(t,!this.parent.uiStateValues.isGroupAdaptive);var i=[];return this.parent.activeViewOptions.headerRows.length>0&&(e=new On(this.parent,this.renderDates).generateColumnLevels(t,i)),this.colLevels=e,e},i.prototype.getAdjustedDate=function(e){for(var t=this.colLevels[this.colLevels.length-1],i=0;i<t.length;i++)if(t[parseInt(i.toString(),10)].date.getTime()>e.getTime())return t[i-1].date;return null},i.prototype.destroy=function(){if(!this.parent||this.parent&&this.parent.isDestroyed)return void(this.parent=null);if(this.element){var i=this.element.querySelector(".e-content-wrap");i&&t.EventHandler.remove(i,"scroll",this.onContentScroll)}this.appointment&&(this.appointment.destroy(),this.appointment=null),e.prototype.destroy.call(this)},i}(mn),In=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 n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),kn=function(e){function i(t){var i=e.call(this,t)||this;return i.viewClass="e-timeline-year-view",i.isInverseTableSelect=!0,i}return In(i,e),i.prototype.getModuleName=function(){return"timelineYear"},i.prototype.renderHeader=function(e){var i=t.createElement("tr");if(e.appendChild(i),"Vertical"===this.parent.activeViewOptions.orientation&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive)this.parent.resourceBase.renderResourceHeaderIndent(i);else{var n=t.createElement("td",{className:"e-left-indent"});i.appendChild(n),n.appendChild(this.renderResourceHeader("e-left-indent-wrap"))}var r="Horizontal"===this.parent.activeViewOptions.orientation,a=this.parent.activeViewOptions.group.resources.length>0;this.isInverseTableSelect=!(r&&!a);var s=t.createElement("td");i.appendChild(s);var o=t.createElement("div",{className:"e-date-header-container"});if(s.appendChild(o),"Horizontal"===this.parent.activeViewOptions.orientation&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive)o.appendChild(this.renderResourceHeader("e-date-header-wrap")),this.columnCount=this.colLevels.slice(-1)[0].length;else{var l=t.createElement("div",{className:"e-date-header-wrap"});o.appendChild(l);var p=this.createTableLayout();l.appendChild(p),p.appendChild(this.createTableColGroup(this.columnCount));var c=t.createElement("tr");p.querySelector("tbody").appendChild(c);for(var h=this.getMonths(),d=this.getMonthDates(new Date(this.parent.selectedDate.getFullYear(),h[0],1)),u=0;u<this.columnCount;u++){var g=new Date(this.parent.selectedDate.getFullYear(),h[parseInt(u.toString(),10)],1),v=t.createElement("td",{className:"e-header-cells"});"Horizontal"===this.parent.activeViewOptions.orientation?this.parent.dayHeaderTemplate?t.append(this.renderDayMonthHeaderTemplate(d[parseInt(u.toString(),10)],u,"dayHeaderTemplate"),v):v.innerHTML="<span>"+this.parent.getDayNames("abbreviated")[u%7]+"</span>":(this.parent.monthHeaderTemplate?t.append(this.renderDayMonthHeaderTemplate(g,h[parseInt(u.toString(),10)],"monthHeaderTemplate"),v):v.innerHTML="<span>"+this.getMonthName(g)+"</span>",v.setAttribute("data-date",g.getTime().toString())),c.appendChild(v),this.parent.trigger(ze,{elementType:"headerCells",element:v})}}},i.prototype.renderResourceHeader=function(e){var i=t.createElement("div",{className:e}),n=this.createTableLayout();i.appendChild(n);var r=t.createElement("tr");if(this.parent.activeViewOptions.group.resources.length>0)this.colLevels=this.generateColumnLevels();else{var a=[{className:["e-header-cells"],type:"headerCell"}];this.colLevels=[a]}for(var s=0,o=this.colLevels;s<o.length;s++){for(var l=o[s],p=r.cloneNode(),c=0,h="e-date-header-wrap"===e?l:[l[0]];c<h.length;c++){var d=h[c],u=t.createElement("td");d.className&&t.addClass([u],d.className),"e-date-header-wrap"===e&&(d.template&&t.append(d.template,u),d.colSpan&&u.setAttribute("colspan",d.colSpan.toString()),d.groupIndex>-1&&u.setAttribute("data-group-index",d.groupIndex.toString()),this.setResourceHeaderContent(u,d)),"e-left-indent-wrap"===e&&this.parent.renderHeaderIndentTemplate(d,u);var g={elementType:d.type,element:u,date:d.date,groupIndex:d.groupIndex};this.parent.trigger(ze,g),p.appendChild(u)}n.querySelector("tbody").appendChild(p)}return"e-date-header-wrap"===e&&n.appendChild(this.createTableColGroup(this.colLevels.slice(-1)[0].length)),i},i.prototype.renderContent=function(e){var i=t.createElement("tr");e.appendChild(i);var n,r=t.createElement("td"),a=t.createElement("td"),s=[];if("Vertical"===this.parent.activeViewOptions.orientation&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive)s.push(r),r.appendChild(this.parent.resourceBase.createResourceColumn()),this.rowCount=this.parent.resourceBase.renderedResources.length;else{s.push(r);var o=t.createElement("div",{className:"e-month-header-wrapper"});r.appendChild(o),o.appendChild(this.createTableLayout()),n=o.querySelector("tbody")}s.push(a),t.append(s,i);var l=t.createElement("div",{className:"e-content-wrap"});a.appendChild(l);var p=this.createTableLayout(nt);this.setAriaAttributes(p),l.appendChild(p);var c=t.createElement("div",{className:"e-event-table"});l.appendChild(c),this.parent.virtualScrollModule&&this.parent.virtualScrollModule.renderVirtualTrack(l);var h=p.querySelector("tbody");if(this.parent.rowAutoHeight){var d=[p],u=this.parent.element.querySelector(".e-month-header-wrapper ."+it);u&&d.push(u),t.addClass(d,"e-auto-height")}if(this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive){var g="Horizontal"===this.parent.activeViewOptions.orientation?this.colLevels.slice(-1)[0].length:this.columnCount;p.appendChild(this.createTableColGroup(g)),this.renderResourceContent(c,n,h)}else p.appendChild(this.createTableColGroup(this.columnCount)),this.renderDefaultContent(c,n,h)},i.prototype.renderDefaultContent=function(e,i,n){for(var r=this.getMonths(),a=this.getMonthDates(new Date(this.parent.selectedDate.getFullYear(),r[0],1)),s=0;s<this.rowCount;s++){e.appendChild(t.createElement("div",{className:at}));var o=new Date(this.parent.selectedDate.getFullYear(),r[parseInt(s.toString(),10)],1),l=this.parent.calendarUtil.getMonthStartDate(new Date(o.getTime())),p=this.parent.calendarUtil.getMonthEndDate(new Date(o.getTime())),c=t.createElement("tr"),h=c.cloneNode();i.appendChild(h);var d=c.cloneNode();n.appendChild(d);var u=t.createElement("td",{className:"e-month-header"});"Horizontal"===this.parent.activeViewOptions.orientation?(this.parent.monthHeaderTemplate?t.append(this.renderDayMonthHeaderTemplate(l,s,"monthHeaderTemplate"),u):u.innerHTML="<span>"+this.getMonthName(o)+"</span>",u.setAttribute("data-date",o.getTime().toString())):this.parent.dayHeaderTemplate?t.append(this.renderDayMonthHeaderTemplate(a[parseInt(s.toString(),10)],s,"dayHeaderTemplate"),u):u.innerHTML="<span>"+this.parent.getDayNames("abbreviated")[s%7]+"</span>",h.appendChild(u),this.parent.trigger(ze,{elementType:"leftHeaderCells",element:u});for(var g=new Date(l.getTime()),v=0;v<this.columnCount;v++){var m=void 0;if("Vertical"===this.parent.activeViewOptions.orientation){o=new Date(this.parent.selectedDate.getFullYear(),r[parseInt(v.toString(),10)],1),l=this.parent.calendarUtil.getMonthStartDate(new Date(o.getTime())),p=this.parent.calendarUtil.getMonthEndDate(new Date(o.getTime()));var f=s-l.getDay()+1;g=new Date(this.parent.selectedDate.getFullYear(),r[parseInt(v.toString(),10)],f),m=f>0&&g.getTime()<p.getTime()}else m=v>=l.getDay()&&g.getTime()<p.getTime();var y=this.parent.globalize.formatDate(g,{skeleton:"full",calendar:this.parent.getCalendarMode()}),T=t.createElement("td",{className:"e-work-cells",attrs:{"aria-label":y}});d.appendChild(T);var w=t.createElement("div",{className:"e-date-header e-navigate",innerHTML:m?this.parent.globalize.formatDate(g,{skeleton:"d",calendar:this.parent.getCalendarMode()}):""});if(m){var D=[T],b=[];this.parent.activeViewOptions.workDays.indexOf(g.getDay())>-1&&b.push("e-work-days"),this.parent.isMinMaxDate(g)||t.addClass([T],pt),this.isCurrentDate(g)&&(b.push("e-current-day"),"Horizontal"===this.parent.activeViewOptions.orientation?D.push(this.element.querySelector(".e-header-cells:nth-child("+(v+1)+")")):D.push(this.element.querySelectorAll(".e-month-header").item(s))),b.length>0&&t.addClass(D,b)}else t.addClass([T],"e-other-month"),this.parent.isMinMaxDate(g)||t.addClass([T],pt);T.classList.contains("e-other-month")||(this.renderDates.push(new Date(g)),T.appendChild(w),m&&(T.setAttribute("data-date",g.getTime().toString()),this.wireEvents(T)),this.renderCellTemplate({date:g,type:"workCells"},T),this.parent.trigger(ze,{elementType:"workCells",element:T,date:g}),m&&"Horizontal"===this.parent.activeViewOptions.orientation&&(g=O(new Date(g.getTime()),1)))}}this.renderDates.splice(0,1)},i.prototype.getContentRows=function(){for(var e=[],i=this.getMonths(),n=this.getGroupIndices(),r=0;r<this.parent.resourceBase.renderedResources.length;r++){var a=void 0;if(!(this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(a=this.parent.resourceBase.renderedResources[parseInt(r.toString(),10)],n.length>0&&n.indexOf(a.groupIndex)>-1))){var s=t.createElement("tr");e.push(s);for(var o=new Date(this.parent.selectedDate.getFullYear(),i[parseInt(r.toString(),10)],1),l=this.parent.calendarUtil.getMonthStartDate(new Date(o.getTime())),p=0;p<this.columnCount;p++){var c=[],h=a.groupIndex;(c=c.concat(a.className)).indexOf("e-parent-node")>-1?c.push("e-resource-group-cells"):c.push("e-work-days"),o=new Date(this.parent.selectedDate.getFullYear(),i[parseInt(p.toString(),10)],1),l=this.parent.calendarUtil.getMonthStartDate(new Date(o.getTime()));var d=t.createElement("td",{className:"e-work-cells",attrs:{"aria-selected":"false","data-date":l.getTime().toString()}});t.addClass([d],c),d.setAttribute("data-group-index",h.toString()),this.renderCellTemplate({date:l,type:"resourceGroupCells",groupIndex:h},d),this.wireEvents(d),this.parent.trigger(ze,{elementType:"resourceGroupCells",element:d,date:l}),s.appendChild(d)}}}return e},i.prototype.renderResourceContent=function(e,i,n){for(var r=this.getMonths(),a=0;a<this.rowCount;a++){e.appendChild(t.createElement("div",{className:at}));var s=t.createElement("tr");n.appendChild(s);var o=void 0;"Vertical"===this.parent.activeViewOptions.orientation&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(o=this.parent.resourceBase.renderedResources[parseInt(a.toString(),10)]);var l=new Date(this.parent.selectedDate.getFullYear(),r[parseInt(a.toString(),10)],1),p=this.parent.calendarUtil.getMonthStartDate(new Date(l.getTime()));if("Horizontal"===this.parent.activeViewOptions.orientation){var c=s.cloneNode();i.appendChild(c);var h=t.createElement("td",{className:"e-month-header",attrs:{"data-date":p.getTime().toString()}});this.parent.monthHeaderTemplate?t.append(this.renderDayMonthHeaderTemplate(l,a,"monthHeaderTemplate"),h):h.innerHTML="<span>"+this.getMonthName(l)+"</span>",c.appendChild(h)}for(var d=0;d<this.columnCount;d++){var u=[],g=void 0;"Vertical"===this.parent.activeViewOptions.orientation?(g=o.groupIndex,(u=u.concat(o.className)).indexOf("e-parent-node")>-1?u.push("e-resource-group-cells"):u.push("e-work-days"),l=new Date(this.parent.selectedDate.getFullYear(),r[parseInt(d.toString(),10)],1),p=this.parent.calendarUtil.getMonthStartDate(new Date(l.getTime()))):(g=this.colLevels.slice(-1)[0][parseInt(d.toString(),10)].groupIndex,u.push("e-work-days"));var v=this.parent.globalize.formatDate(p,{type:"dateTime",skeleton:"full",calendar:this.parent.getCalendarMode()}),m=this.parent.globalize.formatDate(this.parent.calendarUtil.getMonthEndDate(new Date(l.getTime())),{type:"dateTime",skeleton:"full",calendar:this.parent.getCalendarMode()}),f=t.createElement("td",{className:"e-work-cells",attrs:{"aria-selected":"false","data-date":p.getTime().toString(),"aria-label":v+" "+this.parent.localeObj.getConstant("endAt")+" "+m}});t.addClass([f],u),f.setAttribute("data-group-index",g.toString()),this.renderCellTemplate({date:p,type:"resourceGroupCells",groupIndex:g},f),this.wireEvents(f),s.appendChild(f),this.parent.trigger(ze,{elementType:"resourceGroupCells",element:f,date:p})}}"Vertical"===this.parent.activeViewOptions.orientation&&this.collapseRows(this.parent.element.querySelector(".e-content-wrap"))},i.prototype.renderDayMonthHeaderTemplate=function(e,t,i){var n={date:e,type:"dayHeaderTemplate"===i?"dayHeader":"monthHeader"},r="schedule_"+this.parent.activeViewOptions.dayHeaderTemplateName+"dayHeaderTemplate",a="schedule_"+this.parent.activeViewOptions.dayHeaderTemplateName+"monthHeaderTemplate";return"dayHeaderTemplate"===i?(n.day=this.parent.getDayNames("wide")[t%7],[].slice.call(this.parent.getDayHeaderTemplate()(n,this.parent,"dayHeaderTemplate",r,!1,void 0,void 0,this.parent.root))):[].slice.call(this.parent.getMonthHeaderTemplate()(n,this.parent,"monthHeaderTemplate",a,!1,void 0,void 0,this.parent.root))},i.prototype.renderCellTemplate=function(e,i){if(this.parent.activeViewOptions.cellTemplate&&!i.classList.contains("e-other-month")){var n={date:e.date,type:e.type};e.groupIndex&&(n.groupIndex=e.groupIndex);var r=this.parent.element.id+"_"+this.parent.activeViewOptions.cellTemplateName+"cellTemplate",a=[].slice.call(this.parent.getCellTemplate()(n,this.parent,"cellTemplate",r,!1,void 0,void 0,this.parent.root));t.append(a,i)}},i.prototype.scrollToDate=function(e){var t;t=null!==this.parent.activeViewOptions.group.resources&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive?+new Date(b(f(e))):+new Date(b(e));var i=this.element.querySelector('[data-date="'+t+'"]');if(i){var n=this.getScrollableElement();if(this.parent.enableRtl){var r=this.element.querySelector("."+nt);n.scrollLeft=-(r.offsetWidth-i.offsetLeft-i.offsetWidth)}else n.scrollLeft=i.offsetLeft;n.scrollTop=i.offsetTop}},i.prototype.getScrollableElement=function(){return this.parent.isAdaptive&&!this.isTimelineView()?this.element.querySelector(".e-scroll-container"):this.getContentAreaElement()},i.prototype.wireEvents=function(e){t.EventHandler.add(e,"mousedown",this.parent.workCellAction.cellMouseDown,this.parent.workCellAction),t.EventHandler.add(e,"click",this.parent.workCellAction.cellClick,this.parent.workCellAction),this.parent.isAdaptive||t.EventHandler.add(e,"dblclick",this.parent.workCellAction.cellDblClick,this.parent.workCellAction)},i}(yn),Mn=function(){function e(e){this.parent=e}return e.prototype.initializeCalendarExport=function(e,t){var i=this.getCalendarString(e,t);this.download(i,e)},e.prototype.getCalendarString=function(e,i){var n=this,r=i||t.extend([],this.parent.eventsData,null,!0);r=this.parent.eventBase.sortByTime(r);var a=-1!==navigator.appVersion.indexOf("Win")?"\r\n":"\n",s=[],o=[],l=this.parent.timezone||this.parent.tzModule.getLocalTimezoneName(),p=this.parent.eventFields;return r.forEach(function(e){var i=e[p.id]||e.Guid||n.parent.eventBase.generateGuid(),c=[];if(e[p.recurrenceID]){var h=n.filterEvents(o,p.id,e[p.recurrenceID]);i=h.length>0?h[0].UID:i}if(!e[p.recurrenceID]&&e[p.recurrenceRule]&&e[p.recurrenceException]){f=e[p.recurrenceException].split(",");n.filterEvents(r,p.recurrenceID,e[p.id]).forEach(function(e){c.push(Ne(e[p.startTime]))});var d=f.filter(function(e){return-1===c.indexOf(e)});e[p.recurrenceException]=d.length>0?d.join(",")+",":""}var u=e[p.startTimezone]||l,g=e[p.endTimezone]||l,v=!!e[p.isReadonly]&&e[p.isReadonly],m=["BEGIN:VEVENT","LOCATION:"+(e[p.location]||""),"SUMMARY:"+(e[p.subject]||""),"UID:"+i,"DESCRIPTION:"+(e[p.description]||""),"ISREADONLY:"+v,"END:VEVENT"];if(e[p.isAllDay]?(m.splice(4,0,"DTEND;VALUE=DATE:"+n.convertDateToString(e[p.endTime],!0)),m.splice(4,0,"DTSTART;VALUE=DATE:"+n.convertDateToString(e[p.startTime],!0))):e[p.isAllDay]||e[p.recurrenceRule]?(m.splice(4,0,'DTEND;TZID="'+g+'":'+n.convertDateToString(e[p.endTime])),m.splice(4,0,'DTSTART;TZID="'+u+'":'+n.convertDateToString(e[p.startTime]))):(m.splice(4,0,"DTEND:"+n.convertDateToString(e[p.endTime])),m.splice(4,0,"DTSTART:"+n.convertDateToString(e[p.startTime]))),e[p.recurrenceRule]&&m.splice(4,0,"RRULE:"+e[p.recurrenceRule]),e[p.recurrenceException])for(var f=e[p.recurrenceException].split(","),y=0;y<f.length-1;y++)m.splice(5,0,"EXDATE:"+n.convertDateToString(X(f[parseInt(y.toString(),10)]),e[p.isAllDay]));e[p.recurrenceID]&&m.splice(4,0,'RECURRENCE-ID;TZID="'+u+'":'+n.convertDateToString(e[p.startTime],e[p.isAllDay]));var T=n.customFieldFilter(e,p);T.length>0&&T.forEach(function(t){return m.splice(4,0,t+":"+(e[""+t]||""))});var w=t.extend({},e);w.UID=i,o.push(w),s.push(m.join(a))}),["BEGIN:VCALENDAR","PRODID:-//Syncfusion Inc//Scheduler//EN","VERSION:2.0","CALSCALE:GREGORIAN","METHOD:PUBLISH","X-WR-CALNAME:"+(e||"Calendar"),"X-WR-TIMEZONE:"+l].join(a)+a+s.join(a)+a+"END:VCALENDAR"},e.prototype.customFieldFilter=function(e,t){var i=Object.keys(t).map(function(e){return t[""+e]});return Object.keys(e).filter(function(e){return-1===i.indexOf(e)&&"Guid"!==e})},e.prototype.convertDateToString=function(e,t){var i=("0000"+e.getFullYear().toString()).slice(-4),n=("00"+(e.getMonth()+1).toString()).slice(-2),r=("00"+e.getDate().toString()).slice(-2),a=("00"+e.getHours().toString()).slice(-2),s=("00"+e.getMinutes().toString()).slice(-2),o=("00"+e.getSeconds().toString()).slice(-2);return t?i+n+r:i+n+r+"T"+a+s+o},e.prototype.download=function(e,t){var i=new Blob([e],{type:"data:text/calendar;charset=utf8"});if(t=(t||"Calendar")+".ics",navigator.msSaveBlob)navigator.msSaveBlob(i,t);else{var n=document.createElementNS("http://www.w3.org/1999/xhtml","a");n.download=t,n.href=URL.createObjectURL(i);var r=document.createEvent("MouseEvent");r.initEvent("click",!0,!0),n.dispatchEvent(r),setTimeout(function(){URL.revokeObjectURL(n.href),n.href=void 0})}},e.prototype.filterEvents=function(e,t,i){return e.filter(function(e){return e[""+t]===i})},e.prototype.getModuleName=function(){return"iCalendarExport"},e.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed||(this.parent=null)},e}(),Rn=function(){function e(e){this.allDay=!1,this.parent=e}return e.prototype.initializeCalendarImport=function(e){var t=this;if(e&&e instanceof Blob){var i=new FileReader;i.onload=function(){var e=i.result;t.iCalendarParser(e)},i.readAsText(e,"UTF-8")}else e&&"string"==typeof e&&this.iCalendarParser(e)},e.prototype.iCalendarParser=function(e){var i,n,r={isEvent:!1,curEvent:null,id:this.parent.eventBase.getEventMaxID(),count:0,events:[],key:null},a=e.length,s=e.search(/[^ \t]/),o=s;do{0===(o=e.indexOf("\n",s)+1)?(o=a,n=0):n=o>1&&"\r"===e[o-2]?2:1;var l=e.charAt(s);" "===l||"\n"===l||"\t"===l?i+=e.slice(s+1,o-n):(i&&(r=this.updateEventData(i,r)),i=e.slice(s,o-n)),s=o}while(o!==a);(i=i.trim()).length&&(r=this.updateEventData(i,r));var p=t.extend([],r.events,null,!0);this.parent.addEvent(this.processOccurrence(p,r.id))},e.prototype.updateEventData=function(e,i){var n=this.parent.eventFields,r=i.id,a=i.events,s=i.isEvent,o=i.count,l=i.curEvent,p=i.key;if(s||"BEGIN:VEVENT"!==e||(s=!0,l={}),s&&"END:VEVENT"===e&&(s=!1,a.push(l),l=null),s){var c=e.indexOf(":"),h=e.substring(0,c).replace(/^\s\s*/,"").replace(/\s\s*$/,""),d=e.substring(c+1,e.length).replace(/^\s\s*/,"").replace(/\s\s*$/,"");if(-1!==e.indexOf("SUMMARY")&&(h="SUMMARY"),-1!==e.indexOf("DTSTART"))l[n.startTime]=this.dateParsing(e),l[n.isAllDay]=this.allDay,this.allDay=!1;else if(-1!==e.indexOf("DTEND"))l[n.endTime]=this.dateParsing(e);else if(-1!==e.indexOf("EXDATE"))d=Ne(this.dateParsing(e)),l[n.recurrenceException]=t.isNullOrUndefined(l[n.recurrenceException])?d:l[n.recurrenceException]+","+d;else if(-1!==e.indexOf("RECURRENCE-ID"))d=Ne(this.dateParsing(e)),l[n.recurrenceException]=d,l[n.recurrenceID]=d;else switch(p=h||p){case"BEGIN":break;case"UID":l[""+h]=d,"number"==typeof r?(l[n.id]=parseInt(d,10),isNaN(l[n.id])&&(l[n.id]=r+o,o++)):l[n.id]=d;break;case"SUMMARY":l[n.subject]=this.getFormattedString(d);break;case"LOCATION":l[n.location]=this.getFormattedString(d);break;case"DESCRIPTION":l[n.description]?l[n.description]=this.getFormattedString(l[n.description]+"\r\n"+d):l[n.description]=this.getFormattedString(d);break;case"ISREADONLY":l[n.isReadonly]=d.indexOf("true")>-1;break;case"RRULE":l[n.recurrenceRule]=d;break;default:if(this.parent.resourceCollection.length>0){var u=this.parent.resourceCollection.filter(function(e){return e.field===h});l[""+h]=u.length>0&&"number"==typeof u[0].dataSource[0][u[0].idField]?parseInt(d,10):d}else l[""+h]=d}}return{isEvent:s,curEvent:l,id:r,count:o,events:a,key:p}},e.prototype.processOccurrence=function(e,i){var n=this,r=[],a=this.parent.eventFields,s=[];return this.parent.eventsData.forEach(function(e){s.push(e[a.id])}),e.forEach(function(o){var l,p;if(o.hasOwnProperty(a.recurrenceID)||(l=o,p=o[a.id]),s.indexOf(o[a.id])<0){var c=e.filter(function(e){return e.UID===o.UID});if(c.length>1&&t.isNullOrUndefined(o[a.recurrenceID])){p="number"==typeof i?i++:p;for(var h=0;h<c.length;h++)if(c[parseInt(h.toString(),10)].hasOwnProperty(a.recurrenceID)){var d=c[parseInt(h.toString(),10)][a.recurrenceID];c[parseInt(h.toString(),10)][a.id]="number"==typeof i?i++:n.parent.eventBase.generateGuid(),c[parseInt(h.toString(),10)][a.recurrenceID]=p,c[parseInt(h.toString(),10)][a.recurrenceException]=null,l[a.recurrenceException]=n.getExcludeDateString(l[a.recurrenceException],d),delete c[parseInt(h.toString(),10)].UID,r.push(c[parseInt(h.toString(),10)])}delete l.UID,l[a.id]=p,r.push(l)}else o.hasOwnProperty(a.recurrenceID)||(delete o.UID,o[a.id]="number"==typeof i?i++:p,r.push(o))}}),r},e.prototype.getExcludeDateString=function(e,i){if(t.isNullOrUndefined(e))return i;if(t.isNullOrUndefined(i))return e;var n=e.split(",").map(function(e){return e.split("T")[0]}),r=i.split(",").map(function(e){return e.split("T")[0]});return n.filter(function(e){return r.indexOf(e)>-1}).length>0?e:e+","+i},e.prototype.getFormattedString=function(e){return(e=e||"").replace(/\\\,/g,",").replace(/\\\;/g,";").replace(/\\[nN]/g,"\n").replace(/\\\\/g,"\\")},e.prototype.dateParsing=function(e){var t=e.split(":"),i=t[t.length-1],n=new Date(this.getFormattedString(i));if(e&&(e.indexOf("VALUE=DATE")>-1||e.indexOf("RECURRENCE-ID;TZID")>-1)){var r=/^(\d{4})(\d{2})(\d{2})$/.exec(i);null!==r&&(n=new Date(parseInt(r[1],10),parseInt(r[2],10)-1,parseInt(r[3],10))),e.indexOf("DTSTART")>-1&&(this.allDay=!0)}var a=/^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})(Z)?$/.exec(i);return null!==a&&(n="Z"===a[7]?new Date(Date.UTC(parseInt(a[1],10),parseInt(a[2],10)-1,parseInt(a[3],10),parseInt(a[4],10),parseInt(a[5],10),parseInt(a[6],10))):new Date(parseInt(a[1],10),parseInt(a[2],10)-1,parseInt(a[3],10),parseInt(a[4],10),parseInt(a[5],10),parseInt(a[6],10))),n},e.prototype.getModuleName=function(){return"iCalendarImport"},e.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed},e}(),Hn=function(){function e(e){this.parent=e}return e.prototype.initializeExcelExport=function(e){void 0===e&&(e={});var i,n=this.getExportColumns(e),r=e.fileName||"Schedule",a=e.exportType||"xlsx",s=e.includeOccurrences||!1;t.isNullOrUndefined(e.separator)||","===e.separator||(i=e.separator);var o;o=e.customData?s?this.parent.eventBase.getProcessedEvents(e.customData):e.customData:s?this.parent.eventsProcessed:this.parent.eventsData,this.processWorkbook(n,r,a,o,i)},e.prototype.processWorkbook=function(e,i,n,r,a){var s=this,o=[],l=[],p=[];e.forEach(function(e,t){o.push({index:t+1,width:"Id"===e.name?50:150})});var h={fontSize:12,borders:{color:"#E0E0E0"},bold:!0};e.forEach(function(e,t){p.push({index:t+1,value:e.text,style:h})}),l.push({index:1,cells:p}),r.forEach(function(i,n){var r=[];e.forEach(function(e,n){var a={index:n+1,value:i[e.name]||""};if(e.name===s.parent.eventFields.startTime||e.name===s.parent.eventFields.endTime){var o={fontSize:12,numberFormat:"m/d/yyyy h:mm a"};a=t.extend({},a,{style:o},!0)}r.push(a)}),l.push({index:n+2,cells:r})});var d={cancel:!1,worksheets:[{columns:o,rows:l}]};this.parent.trigger("excelExport",d,function(e){e.cancel||new c.Workbook({worksheets:e.worksheets},n,s.parent.locale,void 0,a).save(i+"."+n)})},e.prototype.getExportColumns=function(e){var t=this,i=e.fieldsInfo||[];return 0===i.length&&(e.fields||Object.keys(this.parent.eventFields).map(function(e){return t.parent.eventFields[""+e]})).forEach(function(e){i.push({name:e,text:e})}),i},e.prototype.getModuleName=function(){return"excelExport"},e.prototype.destroy=function(){this.parent=null},e}(),Pn=function(){function e(e){this.parent=e}return e.prototype.print=function(e){t.isNullOrUndefined(e)?this.printScheduler():this.printSchedulerWithModel(e)},e.prototype.printScheduler=function(){var e=this,i=this.parent.element.cloneNode(!0);i.id=this.parent.element.id+"_print";var n={cancel:!1,printElement:i};this.parent.trigger("beforePrint",n,function(n){if(!n.cancel){document.body.appendChild(i);for(var r="MonthAgenda"===e.parent.currentView?".e-appointment-wrap":".e-content-wrap",a=e.parent.element.querySelector(r),s="",o=0,l=[].slice.call(document.getElementsByTagName("head")[0].querySelectorAll("link, style"));o<l.length;o++)s+=l[o].outerHTML;var p=t.createElement("div");i.style.width=e.parent.element.offsetWidth+"px";var c=100*Math.round(parseInt(i.style.width,10)/100);p.appendChild(i);var h=window.open("","print","height=550,width="+c+",tabbar=no");h.document.write("<!DOCTYPE html><html><head>"+s+"</head><body>"+p.innerHTML+"<script>(function() { window.ready = true; })();<\/script></body></html>"),h.document.close(),h.focus(),setTimeout(function(){if(h.ready&&a){a.scrollLeft=a.scrollLeft,a.scrollTop=a.scrollTop;var e=h.document.querySelector(".e-date-header-wrap");e&&(e.scrollLeft=a.scrollLeft);var t=h.document.querySelector(".e-time-cells-wrap");t&&(t.scrollTop=a.scrollTop);var i=h.document.querySelector(r);i&&(i.scrollLeft=a.scrollLeft,i.scrollTop=a.scrollTop),h.print(),h.close()}},500)}})},e.prototype.printSchedulerWithModel=function(e){var i=this,n=t.createElement("div",{id:this.parent.element.id+"_print",className:"e-print-schedule"});document.body.appendChild(n),Zi.Inject(cn,dn,gn,mn,bn,Sn,xn,An,yn,kn),this.printInstance=new Zi(this.getPrintScheduleModel(e)),this.printInstance.isPrinting=!0,this.printInstance.registeredTemplate=this.parent.registeredTemplate,this.printInstance.root=this.parent.root?this.parent.root:this.parent,this.printInstance.appendTo(n);var r={cancel:!1,printElement:n};this.parent.trigger("beforePrint",r,function(e){if(e.cancel)return void i.printCleanup();i.printInstance.on("print",i.contentReady,i),i.printWindow=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no"),i.printWindow.moveTo(0,0),i.printWindow.resizeTo(screen.availWidth,screen.availHeight)})},e.prototype.getPrintScheduleModel=function(e){for(var i,n,r,a,s={},o=["cellHeaderTemplate","dayHeaderTemplate","monthHeaderTemplate","cellTemplate","dateHeaderTemplate","dateRangeTemplate","eventTemplate","resourceHeaderTemplate","headerIndentTemplate"],l=["actionBegin","actionComplete","actionFailure","created","dataBinding","dataBound","destroyed","eventRendered","moreEventsClick","navigating","popupOpen","popupClose","renderCell"],p=0,c=["agendaDaysCount","calendarMode","cssClass","currentView","dateFormat","enableRtl","endHour","eventSettings","firstDayOfWeek","firstMonthOfYear","group","height","locale","maxDate","minDate","readonly","resources","rowAutoHeight","selectedDate","showHeaderBar","showTimeIndicator","showWeekNumber","showWeekend","startHour","timeFormat","timeScale","timezone","views","width","workDays","workHours","dateHeaderTemplate","dateRangeTemplate","cellHeaderTemplate","dayHeaderTemplate","monthHeaderTemplate","cellTemplate","resourceHeaderTemplate","headerIndentTemplate","actionBegin","actionComplete","actionFailure","created","dataBinding","dataBound","destroyed","eventRendered","moreEventsClick","navigating","popupOpen","popupClose","renderCell"];p<c.length;p++){var h=c[p];switch(h){case"eventSettings":(i=Object.assign({},this.parent.eventSettings.properties)).dataSource=this.parent.eventsData;var d=t.isNullOrUndefined(e.eventSettings)||t.isNullOrUndefined(e.eventSettings.template)?i.template:e.eventSettings.template;i.template=this.parent.isAngular||"function"!=typeof d?d:null,s.eventSettings=i;break;case"group":(n=t.isNullOrUndefined(e.group)?this.parent.group:e.group).headerTooltipTemplate=null,s.group=n;break;case"timeScale":r=t.isNullOrUndefined(e.timeScale)?this.parent.timeScale:e.timeScale,this.parent.isAngular||(r.majorSlotTemplate="function"==typeof r.majorSlotTemplate?null:r.majorSlotTemplate,r.minorSlotTemplate="function"==typeof r.minorSlotTemplate?null:r.minorSlotTemplate),s.timeScale=r;break;case"views":if(a=t.isNullOrUndefined(e.views)?this.parent.views:e.views,!this.parent.isAngular&&a&&a.length>0&&"object"==typeof a[0])for(var u=0,g=a;u<g.length;u++)!function(e){o.forEach(function(i){t.isNullOrUndefined(e[""+i])||(e[""+i]="function"==typeof e[""+i]?null:e[""+i])})}(g[u]);s.views=a;break;default:if(o.indexOf(h)>-1){s[""+h]=t.isNullOrUndefined(e[""+h])?this.parent.isAngular||"function"!=typeof this.parent[""+h]?this.parent[""+h]:null:this.parent.isAngular||"function"!=typeof e[""+h]?e[""+h]:null;break}if(l.indexOf(h)>-1){s[""+h]=e[""+h];break}s[""+h]=t.isNullOrUndefined(e[""+h])?this.parent[""+h]:e[""+h]}}return s},e.prototype.contentReady=function(){var e=this;this.printWindow=t.print(this.printInstance.element,this.printWindow),this.closePrintWindow(this.printWindow,!0),this.printWindow.onbeforeunload=function(){e.printCleanup()}},e.prototype.closePrintWindow=function(e,i){var n=this;if(t.Browser.isIos)var r=setInterval(function(){e.opener?e.close():t.isNullOrUndefined(e.opener)&&(i&&n.printCleanup(),clearInterval(r))},500)},e.prototype.printCleanup=function(){this.printInstance&&(this.printInstance.off("print",this.contentReady),this.printInstance.element.remove(),this.printInstance.destroy(),this.printInstance=null),this.printWindow&&(this.printWindow.onbeforeunload=null,this.printWindow=null)},e.prototype.getModuleName=function(){return"print"},e.prototype.destroy=function(){this.parent=null},e}();return Zi.Inject(cn,dn,gn,mn,yn,bn,Sn,xn,An,kn,en,an,Hn,Mn,Rn,Pn),e.Agenda=bn,e.DEFAULT_WEEKS=6,e.Day=cn,e.DragAndDrop=an,e.ExcelExport=Hn,e.Gregorian=ft,e.HeaderRenderer=ht,e.ICalendarExport=Mn,e.ICalendarImport=Rn,e.Islamic=yt,e.MS_PER_DAY=Qe,e.MS_PER_MINUTE=Ke,e.Month=mn,e.MonthAgenda=Sn,e.Print=Pn,e.RecurrenceEditor=di,e.Resize=en,e.Schedule=Zi,e.TimelineMonth=An,e.TimelineViews=xn,e.TimelineYear=kn,e.Timezone=Tt,e.ViewBase=sn,e.WEEK_LENGTH=7,e.Week=dn,e.WorkWeek=gn,e.Year=yn,e.actionBegin=We,e.actionComplete="actionComplete",e.actionFailure="actionFailure",e.addDays=O,e.addMonths=E,e.addYears=x,e.agendaCells="agendaCells",e.beforePaste="beforePaste",e.beforePrint="beforePrint",e.capitalizeFirstWord=U,e.cellClick="cellClick",e.cellDoubleClick="cellDoubleClick",e.cellMouseDown="cell-mouse-down",e.cellSelect="cellSelect",e.contentReady=Ge,e.dataBinding="dataBinding",e.dataBound="dataBound",e.dataReady=_e,e.dateHeader="dateHeader",e.documentClick="document-click",e.documentPaste="document-paste",e.drag="drag",e.dragStart="dragStart",e.dragStop="dragStop",e.eventClick="eventClick",e.eventDoubleClick="eventDoubleClick",e.eventRendered="eventRendered",e.eventsLoaded="events-loaded",e.excelExport="excelExport",e.extractObjectFromRule=Ee,e.findIndexInData=H,e.firstDateOfMonth=f,e.generate=G,e.generateSummary=Y,e.getCalendarUtil=je,e.getDateCount=S,e.getDateFromRecurrenceDateString=X,e.getDateFromString=k,e.getDateInMs=C,e.getDaysCount=I,e.getElementHeight=W,e.getElementHeightFromClass=h,e.getElementTop=z,e.getElementWidth=B,e.getElementWidthFromClass=d,e.getMaxDays=A,e.getOuterHeight=P,e.getRecurrenceStringFromDate=Ne,e.getScrollBarWidth=M,e.getStartEndHours=V,e.getTranslateX=g,e.getTranslateY=u,e.getUniversalTime=L,e.getWeekFirstDate=v,e.getWeekLastDate=m,e.getWeekMiddleDate=w,e.getWeekNumber=T,e.hover="hover",e.initialEnd="initial-end",e.initialLoad="initial-load",e.inlineClick=Ye,e.isDaylightSavingTime=N,e.isIPadDevice=F,e.isMobile=q,e.lastDateOfMonth=y,e.moreEventsClick="moreEventsClick",e.navigating="navigating",e.noEvents="noEvents",e.popupClose="popupClose",e.popupOpen="popupOpen",e.print="print",e.removeChildren=j,e.renderCell=ze,e.resetScrollbarWidth=R,e.resetTime=b,e.resizeStart="resizeStart",e.resizeStop="resizeStop",e.resizing="resizing",e.resourceHeader="resourceHeader",e.scroll="scroll",e.scrollUiUpdate=Xe,e.select="select",e.setTime=D,e.timezoneData=wt,e.tooltipOpen="tooltipOpen",e.uiUpdate="ui-update",e.virtualScroll="virtual-scroll",e.virtualScrollStart="virtualScrollStart",e.virtualScrollStop="virtualScrollStop",e}({},ej.base,ej.popups,ej.navigations,ej.calendars,ej.data,ej.buttons,ej.inputs,ej.dropdowns,ej.lists,ej.excelexport),this.ejs=ej;
|
|
11
11
|
//# sourceMappingURL=ej2-schedule.min.js.map
|