@syncfusion/ej2-schedule 25.2.7 → 26.1.38

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.
Files changed (174) hide show
  1. package/.eslintrc.json +3 -2
  2. package/dist/ej2-schedule.min.js +2 -2
  3. package/dist/ej2-schedule.umd.min.js +2 -2
  4. package/dist/ej2-schedule.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-schedule.es2015.js +436 -376
  6. package/dist/es6/ej2-schedule.es2015.js.map +1 -1
  7. package/dist/es6/ej2-schedule.es5.js +496 -450
  8. package/dist/es6/ej2-schedule.es5.js.map +1 -1
  9. package/dist/global/ej2-schedule.min.js +2 -2
  10. package/dist/global/ej2-schedule.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +17 -16
  13. package/src/recurrence-editor/date-generator.js +1 -0
  14. package/src/recurrence-editor/recurrence-editor.d.ts +8 -8
  15. package/src/recurrence-editor/recurrence-editor.js +1 -2
  16. package/src/schedule/actions/crud.js +3 -1
  17. package/src/schedule/actions/drag.js +2 -1
  18. package/src/schedule/actions/keyboard.js +1 -1
  19. package/src/schedule/actions/resize.js +5 -0
  20. package/src/schedule/actions/virtual-scroll.js +2 -1
  21. package/src/schedule/base/interface.js +0 -1
  22. package/src/schedule/base/schedule-model.d.ts +11 -11
  23. package/src/schedule/base/schedule.d.ts +11 -11
  24. package/src/schedule/base/schedule.js +28 -12
  25. package/src/schedule/base/util.js +1 -1
  26. package/src/schedule/event-renderer/agenda-base.js +2 -2
  27. package/src/schedule/event-renderer/event-base.js +6 -4
  28. package/src/schedule/event-renderer/month.js +2 -1
  29. package/src/schedule/event-renderer/timeline-view.js +10 -3
  30. package/src/schedule/event-renderer/vertical-view.js +4 -4
  31. package/src/schedule/event-renderer/year.js +3 -2
  32. package/src/schedule/exports/calendar-import.js +1 -2
  33. package/src/schedule/exports/print.js +10 -7
  34. package/src/schedule/models/toolbar-model.d.ts +2 -2
  35. package/src/schedule/popups/event-window.js +1 -1
  36. package/src/schedule/popups/quick-popups.js +1 -1
  37. package/src/schedule/renderer/header-renderer.js +7 -5
  38. package/src/schedule/renderer/month.js +5 -4
  39. package/src/schedule/renderer/renderer.js +8 -2
  40. package/src/schedule/renderer/timeline-year.js +3 -3
  41. package/src/schedule/renderer/vertical-view.d.ts +1 -0
  42. package/src/schedule/renderer/vertical-view.js +24 -9
  43. package/src/schedule/renderer/view-base.d.ts +1 -0
  44. package/src/schedule/renderer/view-base.js +33 -6
  45. package/src/schedule/renderer/year.js +1 -1
  46. package/styles/bootstrap-dark.css +236 -147
  47. package/styles/bootstrap-dark.scss +19 -2
  48. package/styles/bootstrap.css +237 -148
  49. package/styles/bootstrap.scss +19 -2
  50. package/styles/bootstrap4.css +239 -153
  51. package/styles/bootstrap4.scss +19 -2
  52. package/styles/bootstrap5-dark.css +229 -144
  53. package/styles/bootstrap5-dark.scss +19 -2
  54. package/styles/bootstrap5.css +229 -144
  55. package/styles/bootstrap5.scss +19 -2
  56. package/styles/fabric-dark.css +234 -146
  57. package/styles/fabric-dark.scss +19 -2
  58. package/styles/fabric.css +234 -146
  59. package/styles/fabric.scss +19 -2
  60. package/styles/fluent-dark.css +229 -142
  61. package/styles/fluent-dark.scss +19 -2
  62. package/styles/fluent.css +229 -142
  63. package/styles/fluent.scss +19 -2
  64. package/styles/fluent2.css +5947 -0
  65. package/styles/fluent2.scss +19 -0
  66. package/styles/highcontrast-light.css +229 -138
  67. package/styles/highcontrast-light.scss +19 -2
  68. package/styles/highcontrast.css +229 -138
  69. package/styles/highcontrast.scss +19 -2
  70. package/styles/material-dark.css +273 -155
  71. package/styles/material-dark.scss +19 -2
  72. package/styles/material.css +285 -156
  73. package/styles/material.scss +19 -2
  74. package/styles/material3-dark.css +278 -154
  75. package/styles/material3-dark.scss +19 -2
  76. package/styles/material3.css +278 -154
  77. package/styles/material3.scss +19 -2
  78. package/styles/recurrence-editor/_bds-definition.scss +0 -1
  79. package/styles/recurrence-editor/_bootstrap-dark-definition.scss +0 -1
  80. package/styles/recurrence-editor/_bootstrap-definition.scss +0 -1
  81. package/styles/recurrence-editor/_bootstrap4-definition.scss +0 -1
  82. package/styles/recurrence-editor/_bootstrap5-definition.scss +0 -1
  83. package/styles/recurrence-editor/_bootstrap5.3-definition.scss +14 -0
  84. package/styles/recurrence-editor/_fabric-dark-definition.scss +0 -1
  85. package/styles/recurrence-editor/_fabric-definition.scss +0 -1
  86. package/styles/recurrence-editor/_fluent-definition.scss +0 -1
  87. package/styles/recurrence-editor/_fluent2-definition.scss +14 -0
  88. package/styles/recurrence-editor/_fusionnew-definition.scss +0 -1
  89. package/styles/recurrence-editor/_highcontrast-definition.scss +0 -1
  90. package/styles/recurrence-editor/_highcontrast-light-definition.scss +0 -1
  91. package/styles/recurrence-editor/_layout.scss +1 -17
  92. package/styles/recurrence-editor/_material-dark-definition.scss +0 -1
  93. package/styles/recurrence-editor/_material-definition.scss +0 -1
  94. package/styles/recurrence-editor/_material3-definition.scss +0 -1
  95. package/styles/recurrence-editor/_tailwind-definition.scss +0 -1
  96. package/styles/recurrence-editor/bootstrap-dark.css +21 -23
  97. package/styles/recurrence-editor/bootstrap.css +21 -23
  98. package/styles/recurrence-editor/bootstrap4.css +22 -23
  99. package/styles/recurrence-editor/bootstrap5-dark.css +22 -23
  100. package/styles/recurrence-editor/bootstrap5.css +22 -23
  101. package/styles/recurrence-editor/fabric-dark.css +19 -22
  102. package/styles/recurrence-editor/fabric.css +19 -22
  103. package/styles/recurrence-editor/fluent-dark.css +22 -23
  104. package/styles/recurrence-editor/fluent.css +22 -23
  105. package/styles/recurrence-editor/fluent2.css +1534 -0
  106. package/styles/recurrence-editor/fluent2.scss +8 -0
  107. package/styles/recurrence-editor/highcontrast-light.css +19 -22
  108. package/styles/recurrence-editor/highcontrast.css +19 -22
  109. package/styles/recurrence-editor/material-dark.css +32 -26
  110. package/styles/recurrence-editor/material.css +32 -26
  111. package/styles/recurrence-editor/material3-dark.css +33 -27
  112. package/styles/recurrence-editor/material3.css +33 -27
  113. package/styles/recurrence-editor/tailwind-dark.css +32 -26
  114. package/styles/recurrence-editor/tailwind.css +32 -26
  115. package/styles/schedule/_bds-definition.scss +0 -15
  116. package/styles/schedule/_bootstrap-dark-definition.scss +4 -19
  117. package/styles/schedule/_bootstrap-definition.scss +4 -19
  118. package/styles/schedule/_bootstrap4-definition.scss +3 -18
  119. package/styles/schedule/_bootstrap5-definition.scss +1 -22
  120. package/styles/schedule/_bootstrap5.3-definition.scss +273 -0
  121. package/styles/schedule/_fabric-dark-definition.scss +4 -17
  122. package/styles/schedule/_fabric-definition.scss +4 -19
  123. package/styles/schedule/_fluent-definition.scss +0 -14
  124. package/styles/schedule/_fluent2-definition.scss +273 -0
  125. package/styles/schedule/_fusionnew-definition.scss +0 -21
  126. package/styles/schedule/_highcontrast-definition.scss +1 -16
  127. package/styles/schedule/_highcontrast-light-definition.scss +1 -16
  128. package/styles/schedule/_layout.scss +83 -130
  129. package/styles/schedule/_material-dark-definition.scss +5 -20
  130. package/styles/schedule/_material-definition.scss +4 -19
  131. package/styles/schedule/_material3-definition.scss +1 -23
  132. package/styles/schedule/_tailwind-definition.scss +0 -16
  133. package/styles/schedule/_theme.scss +18 -2
  134. package/styles/schedule/bootstrap-dark.css +220 -126
  135. package/styles/schedule/bootstrap.css +221 -127
  136. package/styles/schedule/bootstrap4.css +223 -132
  137. package/styles/schedule/bootstrap5-dark.css +213 -123
  138. package/styles/schedule/bootstrap5.css +213 -123
  139. package/styles/schedule/fabric-dark.css +218 -125
  140. package/styles/schedule/fabric.css +218 -125
  141. package/styles/schedule/fluent-dark.css +213 -121
  142. package/styles/schedule/fluent.css +213 -121
  143. package/styles/schedule/fluent2.css +5551 -0
  144. package/styles/schedule/fluent2.scss +16 -0
  145. package/styles/schedule/highcontrast-light.css +213 -117
  146. package/styles/schedule/highcontrast.css +213 -117
  147. package/styles/schedule/icons/_bds.scss +6 -21
  148. package/styles/schedule/icons/_bootstrap-dark.scss +4 -16
  149. package/styles/schedule/icons/_bootstrap.scss +4 -16
  150. package/styles/schedule/icons/_bootstrap4.scss +8 -26
  151. package/styles/schedule/icons/_bootstrap5.3.scss +220 -0
  152. package/styles/schedule/icons/_bootstrap5.scss +7 -22
  153. package/styles/schedule/icons/_fabric-dark.scss +5 -17
  154. package/styles/schedule/icons/_fabric.scss +5 -17
  155. package/styles/schedule/icons/_fluent.scss +7 -22
  156. package/styles/schedule/icons/_fluent2.scss +220 -0
  157. package/styles/schedule/icons/_fusionnew.scss +7 -22
  158. package/styles/schedule/icons/_highcontrast-light.scss +5 -17
  159. package/styles/schedule/icons/_highcontrast.scss +5 -17
  160. package/styles/schedule/icons/_material-dark.scss +5 -17
  161. package/styles/schedule/icons/_material.scss +5 -17
  162. package/styles/schedule/icons/_material3.scss +7 -22
  163. package/styles/schedule/icons/_tailwind.scss +7 -22
  164. package/styles/schedule/material-dark.css +257 -134
  165. package/styles/schedule/material.css +269 -135
  166. package/styles/schedule/material3-dark.css +262 -133
  167. package/styles/schedule/material3.css +262 -133
  168. package/styles/schedule/tailwind-dark.css +223 -124
  169. package/styles/schedule/tailwind.css +223 -124
  170. package/styles/tailwind-dark.css +239 -145
  171. package/styles/tailwind-dark.scss +19 -2
  172. package/styles/tailwind.css +239 -145
  173. package/styles/tailwind.scss +19 -2
  174. package/CHANGELOG.md +0 -1932
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * filename: ej2-schedule.umd.min.js
3
- * version : 25.2.7
3
+ * version : 26.1.38
4
4
  * Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
7
7
  * licensing@syncfusion.com. Any infringement will be prosecuted under
8
8
  * applicable laws.
9
9
  */
10
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-navigations"),require("@syncfusion/ej2-calendars"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-inputs"),require("@syncfusion/ej2-dropdowns"),require("@syncfusion/ej2-lists"),require("@syncfusion/ej2-excel-export")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-popups","@syncfusion/ej2-navigations","@syncfusion/ej2-calendars","@syncfusion/ej2-data","@syncfusion/ej2-buttons","@syncfusion/ej2-inputs","@syncfusion/ej2-dropdowns","@syncfusion/ej2-lists","@syncfusion/ej2-excel-export"],t):t(e.ej={},e.ej2Base,e.ej2Popups,e.ej2Navigations,e.ej2Calendars,e.ej2Data,e.ej2Buttons,e.ej2Inputs,e.ej2Dropdowns,e.ej2Lists,e.ej2ExcelExport)}(this,function(e,t,i,n,r,a,s,o,l,p,c){"use strict";function h(e,i){var n=0,r=t.createElement("div",{className:i}).cloneNode();return r.style.visibility="hidden",r.style.position="absolute",e.appendChild(r),n=W(r),t.remove(r),n}function d(e,i){var n=0,r=t.createElement("div",{className:i}).cloneNode();return r.style.visibility="hidden",r.style.position="absolute",e.appendChild(r),n=B(r),t.remove(r),n}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()+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+nt)/nt;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*rt),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())/nt)}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())/nt)}function M(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 k(){if(null!==at)return at;null===st&&(st=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),at=i}function R(){var e=window.devicePixelRatio||window.screen.availWidth/document.documentElement.clientWidth;st&&st!==e&&(at=null,st=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 L(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 N(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){return document.body.style.transform.includes("scale")?e.offsetWidth:e.getBoundingClientRect().width}function W(e){return document.body.style.transform.includes("scale")?e.offsetHeight:e.getBoundingClientRect().height}function z(e){return document.body.style.transform.includes("scale")?e.offsetTop:e.getBoundingClientRect().top}function Y(e,i,n,r){void 0===r&&(r="Gregorian");var a,s,o=ve(e),l=i.getConstant(Ur)+" ",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{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(Wr);break;case"WEEKLY":l+=i.getConstant(zr)+" "+i.getConstant(Fr)+" ",o.day.forEach(function(e,i){l+=U(t.getValue(Gr[""+e],a),"single"),l+=o.day.length-1===i?"":", "});break;case"MONTHLY":l+=i.getConstant(Yr)+" "+i.getConstant(Fr)+" ",l+=_(o,a,i);break;case"YEARLY":l+=i.getConstant(_r)+" "+i.getConstant(Fr)+" ",l+=U(t.getValue(o.month[0].toString(),s),"single")+" ",l+=_(o,a,i)}if(o.count)l+=", "+o.count+" "+i.getConstant(qr);else if(o.until){var d=o.until;l+=", "+i.getConstant(Br)+" "+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(Nr[a>-1?a:Nr.length-1])+" "+U(t.getValue(Gr[e.day[0]],i),"single")}return r}function G(e,i,n,r,a,s,o,l){void 0===a&&(a=Lr),void 0===s&&(s=null),void 0===o&&(o="Gregorian"),void 0===l&&(l=null);var p,c=ve(i);Oe=Te(o);var h=[],d=new Date(e.getTime());be=[];var u=t.isNullOrUndefined(n)?[]:n.split(","),g=new kr;if(u.forEach(function(e){var t=X(e);l&&(t=g.add(new Date(t.getTime()),l)),be.push(new Date(t.getTime()).setHours(0,0,0,0))}),c.recExceptionCount=t.isNullOrUndefined(c.count)?0:be.length,Se=s&&s>e&&!c.count?new Date(new Date(s.getTime()).setHours(0,0,0)):null,!c.until&&Se&&((p=new Date(Se.getTime())).setDate(Se.getDate()+a*c.interval),c.until=p),c.until&&e>c.until)return h;if(Ce=a,function(e){for(;Pr[0]!==e;)fe(Pr)}(jr[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":!function(e,t,i,n){var r=new Date(e.getTime()),a=n.interval,s=K(e,n),o=n.day;for(;de(r,t)&&(!0,!(ye(r,n)&&(o.indexOf(jr[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())}(d,c.until,h,c);break;case"WEEKLY":!function(e,i,n,r){var a=new Date(e.getTime());r.day.length||r.day.push(jr[e.getDay()]);var s,o=r.interval,l=r.day,p=K(e,r),c=!0,h=[];if(l.length>1)for((t.isNullOrUndefined(r.wkst)||""===r.wkst)&&(r.wkst=Pr[0]),s=jr.indexOf(r.wkst);de(a,i);){var d=jr.indexOf(jr[a.getDay()])-s,u=O(a,-(d=-1===d?6:d)),g=O(u,6),v=new Date(a.getTime());for(g=b(g),v=b(v);g>=v&&(l.indexOf(jr[a.getDay()])>-1&&h.push([a.getTime()]),!(p&&n.length+r.recExceptionCount>=p));)a.setDate(a.getDate()+1),a.getHours()!==e.getHours()&&a.setHours(e.getHours()),v=b(v=new Date(a.getTime()));if(a.setDate(a.getDate()-1),p&&n.length+r.recExceptionCount>=p)break;a.setDate(a.getDate()+1+7*(o-1)),re(h,c,e,i,n,r),h=[]}else{for(a=ge(e,r.day);de(a,i)&&((c=ye(a,r))&&l.indexOf(jr[a.getDay()])>-1&&Q(n,a.getTime()),!(p&&n.length+r.recExceptionCount>=p));)a.setDate(a.getDate()+7*o);re(h,c,e,i,n,r),h=[]}}(d,c.until,h,c);break;case"MONTHLY":Z(d,c.until,h,c);break;case"YEARLY":!function(e,i,n,r){switch(function(e){{if(e.yearDay.length)return"YEARDAY";if(e.weekNo.length)return"WEEKNO"}return"MONTH"}(r)){case"MONTH":Z(e,i,n,r);break;case"WEEKNO":!function(e,i,n,r){var a,s,o,l,p,c,h=Oe.getYearLastDate(e,0),d=K(e,r),u=r.weekNo,g=[],v=r.day;for(;de(h,i);){s=Pr.indexOf(jr[h.getDay()]),o=6-s+1;for(var m=0;m<u.length;m++)for(l=u[parseInt(m.toString(),10)],p=1===(l=l>0?l:53+l+1)?o:o+7*(l-1),c=1===l?o-7:o+7*(l-2);c<p;)a=new Date(h.getTime()+nt*c),(0===v.length||v.indexOf(jr[a.getDay()])>-1)&&(t.isNullOrUndefined(r.setPosition)?le(void 0,e,i,n,r,a.getTime()):g.push([a.getTime()])),c++;if(t.isNullOrUndefined(r.setPosition)||he(g,void 0,e,i,n,r),d&&n.length+r.recExceptionCount>=d)return;h=Oe.getYearLastDate(a,r.interval),g=[]}}(e,i,n,r);break;case"YEARDAY":!function(e,i,n,r){var a,s,o=Oe.getYearLastDate(e,0),l=K(e,r),p=[],c=r.day;for(;de(o,i);){for(var h=0;h<r.yearDay.length;h++)s=r.yearDay[parseInt(h.toString(),10)],a=new Date(o.getTime()),s!==Oe.getLeapYearDaysCount()&&s!==-Oe.getLeapYearDaysCount()||Oe.isLeapYear(Oe.getFullYear(a),1)?(a.setDate(a.getDate()+(s<0?Oe.getYearDaysCount(a,1)+1+s:s)),(0===c.length||c.indexOf(jr[a.getDay()])>-1)&&(null==r.setPosition?le(void 0,e,i,n,r,a.getTime()):p.push([a.getTime()]))):a.setDate(a.getDate()+1);if(t.isNullOrUndefined(r.setPosition)||he(p,void 0,e,i,n,r),l&&n.length+r.recExceptionCount>=l)return;o=Oe.getYearLastDate(a,r.interval),p=[]}}(e,i,n,r)}}(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===be.indexOf(i)&&(!Se||i>=Se.getTime())&&e.push(t)}function K(e,t){var i=Ce;return t.count?i=t.count:t.until&&("DAILY"===t.freq||"WEEKLY"===t.freq?i=Math.floor((t.until.getTime()-e.getTime())/nt)+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())/nt)+1:1),"YEARLY"===t.freq&&(i=t.month.length>1?i*t.month.length:i))),i}function Z(e,i,n,r){r.month.length||r.day.length||r.monthDay.length?r.month.length>0&&!r.day.length&&!r.monthDay.length&&r.monthDay.push(e.getDate()):(r.monthDay.push(e.getDate()),"YEARLY"===r.freq&&r.month.push(e.getMonth()+1));switch(function(e){{if(e.monthDay.length&&!e.day.length)return"date";if(!e.monthDay.length&&e.day.length)return"day"}return"both"}(r)){case"day":switch(r.freq){case"MONTHLY":ne(e,i,n,r);break;case"YEARLY":!function(e,i,n,r){var a=r.day,s=a.map(function(e){return Xr.test(e)});{if(a.length>1&&s.indexOf(!0)>-1)return void function(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=Oe.getMonthStartDate(c);var v=[];r.month.length&&Oe.setMonth(c,r.month[0],1);c=ge(c,r.day);for(;de(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=ge(c=Oe.getMonthStartDate(c),r.day),d=[];Oe.isSameYear(s,c)&&p&&n.length+r.recExceptionCount<=p;)for(;Oe.isSameYear(s,c);){if(s=new Date(c.getTime()),0===r.month.length||r.month.length>0&&r.month[parseInt(m.toString(),10)]===Oe.getMonth(s)){var y=l[parseInt(f.toString(),10)].match(Kr),T=parseInt(y[0],10);for(o=new Date(c.getTime());Oe.isSameYear(o,c)&&Oe.isSameMonth(o,c);)y[y.length-1]===jr[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=te(c,r,g,void 0,1),c=ge(c,r.day)}if(c=0===f&&o?new Date(o.getTime()):new Date(s.getTime()),d.length>0&&(t.isNullOrUndefined(r.setPosition)?he(d,void 0,e,i,n,r,a):u=[oe(d,a,v)]),p&&n.length+r.recExceptionCount>=p)return}t.isNullOrUndefined(r.setPosition)||(ce(u,void 0,e,i,n,r),v=[]),Oe.isLastMonth(c)?(Oe.setValidDate(c,1,1),c.setFullYear(c.getFullYear()+h-1)):c.setFullYear(c.getFullYear()+h),c=ge(c,r.day),r.month.length&&Oe.setMonth(c,r.month[0],c.getDate())}}(e,i,n,r);if(r.month.length&&1===a.length&&s.indexOf(!0)>-1)return void ne(e,i,n,r)}var o,l=new Date(e.getTime()),p=K(e,r),c=r.interval,h=[];r.month.length&&Oe.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=ge(l=Oe.getMonthStartDate(l),r.day);for(;de(l,i);){for(o=new Date(l.getTime());Oe.isSameYear(o,l)&&p&&n.length+r.recExceptionCount<=p;)for(o=new Date(l.getTime());Oe.isSameYear(o,l);){if(!(0===r.month.length||r.month.length>0&&!Oe.checkMonth(l,r.month))){Oe.setValidDate(l,1,1),l=ge(l,r.day);break}if(a.length>1){if(Oe.compareMonth(o,l)){Oe.setValidDate(l,1,1),l=ge(l,r.day);break}a.indexOf(jr[o.getDay()])>-1&&h.push([o.getTime()]),o.setDate(o.getDate()+1)}else{if(o.getFullYear()>l.getFullYear()){Oe.setValidDate(l,1,1),l=ge(l,r.day);break}var d=ue(a[0]);jr[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()),se(h,e,i,n,r),Oe.isLastMonth(l)&&(Oe.setValidDate(l,1,1),l=ge(l,r.day)),l.setFullYear(l.getFullYear()+c-1),p&&n.length+r.recExceptionCount>=p)return;l=ge(l,r.day),h=[]}}(e,i,n,r)}break;case"both":case"date":switch(r.freq){case"MONTHLY":$(e,i,n,r);break;case"YEARLY":!function(e,t,i,n){if(n.month.length)return void $(e,t,i,n);var r,a=J(e,n);a.tempDate=a.mainDate=Oe.getMonthStartDate(a.tempDate);for(;de(a.tempDate,t);){for(r=new Date(a.tempDate.getTime());Oe.isSameYear(r,a.tempDate)&&a.expectedCount&&i.length+n.recExceptionCount<=a.expectedCount;){if(!(0===n.month.length||n.month.length>0&&!Oe.checkMonth(a.tempDate,n.month))){Oe.setValidDate(a.tempDate,1,1),a.tempDate=ge(a.tempDate,n.day);break}ee(n,a,t,!1),a.beginDate=new Date(a.tempDate.getTime()),a.monthInit=te(a.tempDate,n,a.monthInit,a.beginDate)}if(a.tempDate.setFullYear(r.getFullYear(),r.getMonth(),r.getDate()),re(a.dateCollection,a.state,e,t,i,n),Oe.isLastMonth(a.tempDate)&&(Oe.setValidDate(a.tempDate,1,1),a.tempDate=ge(a.tempDate,n.day)),a.expectedCount&&i.length+n.recExceptionCount>=a.expectedCount)return;a.tempDate.setFullYear(a.tempDate.getFullYear()+n.interval-1),a.tempDate=ge(a.tempDate,n.day),a.monthInit=te(a.tempDate,n,a.monthInit,a.beginDate),a.dateCollection=[]}}(e,i,n,r)}}}function J(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&&Oe.setMonth(i.tempDate,t.month[0],i.tempDate.getDate()),i}function $(e,i,n,r){var a=J(e,r);if(a.tempDate=a.mainDate=Oe.getMonthStartDate(a.tempDate),!(("MONTHLY"===r.freq&&12===r.interval||"YEARLY"===r.freq)&&Oe.getMonthDaysCount(e)<r.monthDay[0]))for(;de(a.tempDate,i);){if(a.beginDate=new Date(a.tempDate.getTime()),ee(r,a,i,!0,e,n),t.isNullOrUndefined(r.setPosition)||he(a.dateCollection,a.state,e,i,n,r),a.expectedCount&&n.length+r.recExceptionCount>=a.expectedCount)return;a.monthInit=te(a.tempDate,r,a.monthInit,a.beginDate),a.dateCollection=[]}}function ee(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=Oe.getMonthStartDate(i.tempDate);var l=Oe.getMonthDaysCount(i.tempDate);if(i.date=i.date>0?i.date:l+i.date+1,function(e,t,i){var n=Oe.getMonthDaysCount(e);return t<=n&&e>=i}(i.tempDate,i.date,i.mainDate)&&i.date>0){if(Oe.setDate(i.tempDate,i.date),n&&i.tempDate>n)return;(0===e.day.length||e.day.indexOf(jr[i.tempDate.getDay()])>-1)&&(r&&t.isNullOrUndefined(e.setPosition)&&i.expectedCount&&s.length+e.recExceptionCount<i.expectedCount?le(i.state,a,n,s,e,i.tempDate.getTime()):i.dateCollection.push([i.tempDate.getTime()]))}}}function te(e,i,n,r,a){void 0===r&&(r=null);var s=r?r.getMonth():0,o=Oe.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,Oe.setMonth(e,i.month[parseInt(n.toString(),10)],1),0===n&&Oe.addYears(e,a,i.month[0])):(r&&r.getFullYear()<e.getFullYear()&&(s=e.getMonth()-1),Oe.setValidDate(e,a,1,s,r)),n}function ie(e,i,n,r){var a=r.day,s=new Date(e.getTime());s=Oe.getMonthStartDate(s);var o,l,p=[],c=[],h=[],d=K(e,r),u=0;for(r.month.length&&Oe.setMonth(s,r.month[0],1),s=ge(s,r.day);de(s,i)&&d&&n.length+r.recExceptionCount<d;){var g=new Date(s.getTime());if(a.map(function(e){return Xr.test(e)}).indexOf(!0)>-1){for(var v=0;v<=a.length-1;v++){var m=a[parseInt(v.toString(),10)].match(Kr),f=parseInt(m[0],10);for(s=new Date(s.getTime()),s=ge(s=Oe.getMonthStartDate(s),a),g.setFullYear(s.getFullYear(),s.getMonth(),s.getDate());Oe.isSameYear(g,s)&&Oe.isSameMonth(g,s);)m[m.length-1]===jr[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)?he(p,void 0,e,i,n,r,o):c=[oe(p,o,h)]),d&&n.length+r.recExceptionCount>=d)return;p=[]}t.isNullOrUndefined(r.setPosition)||(ce(c,void 0,e,i,n,r),h=[]),u=te(s,r,u,l),s=ge(s,r.day),p=[]}else{var y=[],T=function(e){var t={};return e.forEach(function(i,n){if(n===e.length-1){for(var r=Pr.indexOf(i),a=r;a%7!==Pr.indexOf(e[0]);)a++;t[""+i]=a-r}else t[""+i]=Pr.indexOf(e[n+1])-Pr.indexOf(i)}),t}(a);g.setFullYear(s.getFullYear(),s.getMonth(),s.getDate());var w=new Date(s.getTime());for(l=new Date(s.getTime());Oe.isSameMonth(w,s);)y.push(s.getTime()),a.indexOf(jr[s.getDay()])>-1&&(p.push(y),y=[]),s.setDate(s.getDate()+T[jr[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&&he(p,void 0,e,i,n,r,o),d&&n.length+r.recExceptionCount>=d)return;u=te(s,r,u,l),s=ge(s,r.day),p=[]}}}function ne(e,t,i,n){if(n.day.length>1)ie(e,t,i,n);else{var r,a=new Date(e.getTime()),s=K(e,n),o=[],l=0;for(a=Oe.getMonthStartDate(a),n.month.length&&Oe.setMonth(a,n.month[0],1),a=ge(a,n.day);de(a,t)&&s&&i.length+n.recExceptionCount<s;){r=new Date(a.getTime());for(var p=new Date(a.getTime());Oe.isSameMonth(a,p);)o.push([p.getTime()]),p.setDate(p.getDate()+7);se(o,e,t,i,n),l=te(a,n,l,r),a=ge(a,n.day),o=[]}}}function re(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=ae(e)),e.length>0&&he(e,i,n,r,a,s,o)}function ae(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 se(e,t,i,n,r){var a=[],s=function(e,t){var i,n={monthCollection:[],index:0};if(1===t.length){var r=t[0].match(Kr),a=void 0;r.length>1?i=(a=parseInt(r[0],10))<1?e.length+a:a-1:(i=0,e=ae(e))}else i=0,e=ae(e);return n.monthCollection=e,n.index=i,n}(e,r.day);e=s.monthCollection;var o=s.index;null!=r.setPosition?ce([oe(e,o,a)],void 0,t,i,n,r):e.length>0&&he(e,void 0,t,i,n,r,o),a=[]}function oe(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 le(e,t,i,n,r,a){var s=K(t,r),o=new Date(a);e=ye(o,r),o>=t&&de(o,i)&&e&&s&&n.length+r.recExceptionCount<s&&Q(n,a)}function pe(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 ye(new Date(c),r)?p:p-1}function ce(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 Xr.test(e)}),l="YEARLY"===a.freq&&a.validRules.indexOf("BYMONTH")>-1&&!(o.indexOf(!0)>-1)?pe(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;le(t,i,n,r,a,e[parseInt(s.toString(),10)][parseInt(p.toString(),10)])}}function he(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++){le(i,n,r,a,s,e[parseInt(o.toString(),10)][parseInt(l.toString(),10)])}}}function de(e,t){return!t||e<=t}function ue(e){return e.replace(Qr,"")}function ge(e,t){var i,n=new Date(e.getTime());if(t.length>0){for(var r=[],a=0;a<=t.length-1;a++)i=ue(t[parseInt(a.toString(),10)]),r.push(i);if(-1===r.indexOf(jr[n.getDay()]))do{n.setDate(n.getDate()+1)}while(-1===r.indexOf(jr[n.getDay()]))}return n}function ve(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 me(e,t){var i,n=t.slice(0),r=function(e){Hr[Oe.getFullYear(e)]||(Hr[Oe.getFullYear(e)]=Oe.getYearLastDate(e,0));var t=Hr[Oe.getFullYear(e)],i=e.getTime()-t.getTime();return Math.ceil(i/nt)}(e);for(i=n.shift();i;){if(i<0&&(i=i+Oe.getYearDaysCount(e,0)+1),i===r)return!1;i=n.shift()}return!0}function fe(e){var t=e.shift();e.push(t)}function ye(e,t){var i=!0,n=t.day,r=t.month,a=Oe.getExpectedDays(e,t.monthDay),s=t.yearDay;return t.validRules.forEach(function(t){switch(t){case"BYDAY":(function(e,t){var i=[];return t.forEach(function(e){var t=e.match(Kr);2===t.length?i.push(t[1]):i.push(t[0])}),-1===i.indexOf(jr[parseInt(e.toString(),10)])})(e.getDay(),n)&&(i=!1);break;case"BYMONTH":Oe.checkMonth(e,r)&&(i=!1);break;case"BYMONTHDAY":(function(e,t){var i,n=t.slice(0),r=Oe.getMonthDaysCount(e);for(i=n.shift();i;){if(i<0&&(i=i+r+1),i===e.getDate())return!1;i=n.shift()}return!0})(e,a)&&(i=!1);break;case"BYYEARDAY":me(e,s)&&(i=!1)}}),i}function Te(e){return"Islamic"===e?new Mr:new Ir}function we(e){return[e.getUTCFullYear(),De(e.getUTCMonth()+1),De(e.getUTCDate()),"T",De(e.getUTCHours()),De(e.getUTCMinutes()),De(e.getUTCSeconds()),"Z"].join("")}function De(e){return("0"+e).slice(-2)}var be,Ce,Se,Oe,Ee="cellClick",xe="cellDoubleClick",Ve="moreEventsClick",Ae="select",Ie="actionBegin",Me="actionComplete",ke="actionFailure",Re="navigating",He="renderCell",Pe="eventClick",je="eventDoubleClick",Le="eventRendered",Ne="dataBinding",qe="popupOpen",Fe="popupClose",Ue="resizeStart",Be="resizeStop",We="inlineClick",ze="cellSelect",Ye="virtualScrollStart",_e="virtualScrollStop",Ge="print",Xe="data-ready",Qe="events-loaded",Ke="content-ready",Ze="scroll",Je="virtual-scroll",$e="scroll-ui-update",et="ui-update",tt="document-click",it="cell-mouse-down",nt=864e5,rt=6e4,at=null,st=null,ot="e-schedule",lt="e-device",pt="e-multi-drag",ct="e-icons",ht="e-enable",dt="e-disable",ut="e-table-container",gt="e-schedule-table",vt="e-all-day-cells",mt="e-all-day-row",ft="e-content-table",yt="e-work-cells",Tt="e-work-hours",wt="e-popup-open",Dt="e-date-header-wrap",bt="e-date-header-container",Ct="e-header-cells",St="e-work-days",Ot="e-other-month",Et="e-current-day",xt="e-current-date",Vt="e-current-panel",At="e-previous-panel",It="e-translate",Mt="e-left-indent",kt="e-left-indent-wrap",Rt="e-event-table",Ht="e-resource-group-cells",Pt="e-resource-text",jt="e-resource-column-wrap",Lt="e-resource-column-table",Nt="e-parent-node",qt="e-resource-expand",Ft="e-resource-collapse",Ut="e-resource-tree-icon",Bt="e-resource-cells",Wt="e-time-cells-wrap",zt="e-time-slots",Yt="e-alternate-cells",_t="e-current-time",Gt="e-current-timeline",Xt="e-previous-timeline",Qt="e-hide-childs",Kt="e-scroll-container",Zt="e-timeline-wrapper",Jt="e-appointment-wrapper",$t="e-appointment-wrapper-hidden",ei="e-day-wrapper",ti="e-schedule-resource-toolbar-container",ii="e-schedule-toolbar",ni="e-schedule-resource-toolbar",ri="e-selected-cell",ai="e-week-number-wrapper",si="e-week-number",oi="e-appointment-wrap",li="e-wrapper-container",pi="e-appointment-container",ci="e-appointment",hi="e-block-appointment",di="e-block-indicator",ui="e-appointment-border",gi="e-appointment-details",vi="e-subject-wrap",mi="e-resource-name",fi="e-time",yi="e-table-wrap",Ti="e-outer-table",wi="e-content-wrap",Di="e-virtual-track",bi="e-agenda-cells",Ci="e-current-day",Si="e-active-appointment-agenda",Oi="e-month-header",Ei="e-day-date-header",xi="e-date-column",Vi="e-navigate",Ai="e-date-header",Ii="e-date-time",Mi="e-no-event",ki="e-appointment-indicator",Ri="e-indicator",Hi="e-event-action",Pi="e-new-event",ji="e-schedule-event-clone",Li="e-clone-time-indicator",Ni="e-event-resize",qi="e-resize-clone",Fi="e-left-handler",Ui="e-right-handler",Bi="e-top-handler",Wi="e-bottom-handler",zi="e-recurrence-icon",Yi="e-recurrence-edit-icon",_i="e-header-row",Gi="e-all-day-appointment-wrapper",Xi="e-all-day-appointment",Qi="e-appointment-hide",Ki="e-row-count-wrapper",Zi="e-all-day-appointment-section",Ji="e-appointment-expand",$i="e-appointment-collapse",en="e-more-indicator",tn="e-cell-popup",nn="e-event-popup",rn="e-popup-header",an="e-header-icon-wrapper",sn="e-popup-footer",on="e-date-time-details",ln="e-event-details",pn="e-event-create",cn="e-event-edit",hn="e-event-delete",dn="e-text-ellipsis",un="e-more-popup-wrapper",gn="e-more-event-popup",vn="e-more-event-date-header",mn="e-header-date",fn="e-more-event-close",yn="e-more-event-content",Tn="e-more-appointment-wrapper",wn="e-quick-dialog-occurrence-event",Dn="e-quick-dialog-series-event",bn="e-quick-dialog-following-events",Cn="e-following-events-dialog",Sn="e-quick-dialog-delete",On="e-quick-dialog-cancel",En="e-quick-alertok",xn="e-quick-alertcancel",Vn="e-quick-alertfollowing",An="e-quick-dialog-alert-btn",In="e-schedule-dialog",Mn="e-schedule-form",kn="e-all-day",Rn="e-time-zone",Hn="e-repeat",Pn="e-subject",jn="e-location",Ln="e-location-details",Nn="e-start",qn="e-end",Fn="e-description",Un="e-description-details",Bn="e-time-zone-row",Wn="e-start-time-zone",zn="e-end-time-zone",Yn="e-event-cancel",_n="e-event-save",Gn="e-icon-disable",Xn="e-edit",Qn="e-edit-icon",Kn="e-delete",Zn="e-delete-icon",Jn="e-close",$n="e-close-icon",er="e-schedule-error",tr="e-schedule-event-tooltip",ir="e-animate",nr="e-hidden",rr="e-disable-dates",ar="e-quick-popup-wrapper",sr="e-resource-menu",or="e-resource-level-title",lr="e-resource-tree-popup-overlay",pr="e-resource-tree-popup",cr="e-resource-icon",hr="e-resource-details",dr="e-date-time-icon",ur="e-virtual-scroll",gr="e-icon-disable",vr="e-auto-height",mr="e-ignore-whitespace",fr="e-read-only",yr="e-month-header-wrapper",Tr="e-inline-subject",wr="e-inline-appointment",Dr="e-scroll-hidden",br="e-all-day-scroll",Cr="e-all-day-auto",Sr=function(){return(Sr=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)},Or=function(){function e(e){this.parent=e,this.l10n=this.parent.localeObj,this.renderHeader(),this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on(tt,this.closeHeaderPopup,this)},e.prototype.removeEventListener=function(){this.parent.off(tt,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("."+wi);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")&&this.element.querySelector(".e-toolbar-pop").classList.contains(wt)){t.removeClass([r],Dr);var a=this.element.querySelector(".e-toolbar-pop");if(!t.isNullOrUndefined(a)){var s=a.ej2_instances[0];!s||!t.isNullOrUndefined(n)&&n.classList.contains("e-hor-nav")&&a.classList.contains(wt)||s.hide()}}else t.addClass([r],Dr);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:ii});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(Ie,{requestType:"toolbarItemRendering",items:t},function(t){e.toolbarObj=new n.Toolbar({items:t.items,overflowMode:"Popup",clicked:e.toolbarClickHandler.bind(e),enableRtl:e.parent.enableRtl,enableHtmlSanitizer:e.parent.enableHtmlSanitizer,locale:e.parent.locale}),e.toolbarObj.root=e.parent.root?e.parent.root:e.parent,e.toolbarObj.appendTo(e.parent.element.querySelector("."+ii)),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(Me,{requestType:"toolBarItemRendered",items:e.toolbarObj.items})})},e.prototype.updateItems=function(){var e=this;if(this.toolbarObj){var t=this.getItems();this.parent.trigger(Ie,{requestType:"toolbarItemRendering",items:t},function(t){e.toolbarObj.items=t.items,e.toolbarObj.dataBind(),e.parent.trigger(Me,{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){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));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],nr):t.addClass([e],nr))},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,t=[],i=0,n=this.parent.toolbarItems;i<n.length;i++){var r=n[i];e=this.getItemModel(r);var a=void 0;if(r.name)switch(r.name){case"Today":(a={showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-today",text:this.l10n.getConstant("today"),cssClass:"e-today",overflow:"Show"}).align=e.align?e.align:r.align,t.push(Sr({},a,e));break;case"Previous":(a={prefixIcon:"e-icon-prev",tooltipText:"Previous",overflow:"Show",cssClass:"e-prev",htmlAttributes:{role:"navigation"}}).align=e.align?e.align:r.align,t.push(Sr({},a,e));break;case"Next":(a={prefixIcon:"e-icon-next",tooltipText:"Next",overflow:"Show",cssClass:"e-next",htmlAttributes:{role:"navigation"}}).align=e.align?e.align:r.align,t.push(Sr({},a,e));break;case"DateRangeText":(a={text:this.getDateRangeText(),suffixIcon:"e-icon-down-arrow",cssClass:"e-date-range",overflow:"Show",htmlAttributes:{"aria-atomic":"true","aria-live":"assertive",role:"navigation"}}).align=e.align?e.align:r.align,t.push(Sr({},a,e));break;case"NewEvent":(a={showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-add",text:this.l10n.getConstant("newEvent"),cssClass:"e-add",overflow:"Show"}).align=e.align?e.align:r.align,t.push(Sr({},a,e));break;case"Views":if(this.parent.views.length>1)for(var s=0,o=this.parent.views;s<o.length;s++){var l=o[s];(a=this.getItemObject(l)).align=e.align?e.align:r.align,t.push(Sr({},a,e))}break;case"Custom":t.push(r)}else t.push(r)}return t},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"}),this.parent.views.length>1&&e.push({align:"Right",type:"Separator",cssClass:"e-schedule-seperator"})),this.parent.views.length>1)for(var t=0,i=this.parent.views;t<i.length;t++){var n=i[t];e.push(this.getItemObject(n))}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"},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,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.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(wt)?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*rt/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],nr):t.removeClass([i],nr)),n&&("add"===e?t.addClass([n],nr):t.removeClass([n],nr)),r&&("add"===e?t.addClass([r],dn):t.removeClass([r],dn))},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.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}(),Er=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(Ke,this.setDimensions,this),this.parent.on(et,this.onPropertyChanged,this)},e.prototype.removeEventListener=function(){this.parent.off(Ke,this.setDimensions),this.parent.off(et,this.onPropertyChanged)},e.prototype.setDimensions=function(){this.setWidth(),this.setHeight();var e={cssProperties:this.parent.getCssProperties(),module:this.getModuleName()};this.parent.notify($e,e)},e.prototype.onPropertyChanged=function(){this.setDimensions()},e.prototype.destroy=function(){this.removeEventListener()},e}(),xr=function(){function e(e){this.parent=e,this.element=this.parent.element.querySelector("."+ut),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){var i=!this.parent.isAdaptive&&e.originalEvent&&e.originalEvent.target&&!t.isNullOrUndefined(t.closest(e.originalEvent.target,"."+ci));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.timeStampStart||(this.timeStampStart=Date.now()),this.element.classList.contains(It)&&this.onTransitionEnd(),"Left"===e.scrollDirection||"Right"===e.scrollDirection){var n={requestType:"dateNavigate",cancel:!1,event:e.originalEvent};if(this.parent.trigger(Ie,n),n.cancel)return;var r=this.element.querySelector("."+wi);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));var a=this.parent.enableRtl?e.distanceX:-e.distanceX;this.element.style.transform="translatex("+(this.getTranslateX(this.element)+a)+"px)"}else if(e.scrollDirection===this.touchRightDirection){var s=0;this.previousPanel||(this.renderPanel(At,"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),s=this.previousPanel.element.offsetWidth);a=this.parent.enableRtl?s-e.distanceX:-s+e.distanceX;this.element.style.transform="translatex("+(this.getTranslateX(this.element)+a)+"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(Me,a)}else this.cancelSwipe();this.timeStampStart=null}},e.prototype.tapHoldHandler=function(e){var i=t.closest(e.originalEvent.target,"."+ci);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)):["Agenda","MonthAgenda","Year"].indexOf(this.parent.currentView)<0&&(this.parent.selectedElements=[],this.parent.eventBase.getSelectedEventElements(i),this.parent.resizeModule&&t.closest(e.originalEvent.target,"."+Ni)&&this.parent.resizeModule.resizeStart(e.originalEvent)))},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){var t=this.nextPanel;this.nextPanel=this.currentPanel,this.currentPanel=t}else{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(Re,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],It),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(){this.parent.activeView.setPanel(this.currentPanel.element),this.parent.setProperties({selectedDate:this.currentPanel.selectedDate},!0),this.parent.activeView.renderDates=this.currentPanel.renderDates,this.parent.activeView.colLevels=this.currentPanel.colLevels,t.addClass([this.element],It);var e=this.previousPanel?this.previousPanel.element.offsetWidth:0;this.element.style.transform="translatex("+(this.parent.enableRtl?e:-this.currentPanel.element.offsetLeft)+"px)"},e.prototype.onTransitionEnd=function(){t.removeClass([this.element],It),this.element.style.transitionDuration="",this.element.style.transform="",this.previousPanel&&(t.remove(this.previousPanel.element),this.previousPanel=null,t.removeClass([this.currentPanel.element],At),t.addClass([this.currentPanel.element],Vt)),this.nextPanel&&(t.remove(this.nextPanel.element),this.nextPanel=null,t.removeClass([this.currentPanel.element],"e-next-panel"),t.addClass([this.currentPanel.element],Vt)),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],It)},e.prototype.destroy=function(){this.touchObj&&(this.touchObj.destroy(),this.touchObj=null),t.EventHandler.remove(this.element,"transitionend",this.onTransitionEnd),this.resetValues()},e}(),Vr=function(){function e(e){this.selectedCells=[],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"},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()}return e.prototype.keyActionHandler=function(e){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))}},e.prototype.processFTwelve=function(e){var i=e.target;if(i.classList.contains(yt)||i.classList.contains(vt)){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(We,r)}i.classList.contains(ci)&&i.click()},e.prototype.addEventListener=function(){this.parent.on(it,this.onCellMouseDown,this)},e.prototype.removeEventListener=function(){this.parent.off(it,this.onCellMouseDown)},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(yt)&&3!==e.event.which&&(this.parent.removeSelectedClass(),t.EventHandler.add(this.parent.getContentTable(),"mousemove",this.onMouseSelection,this),t.EventHandler.add(this.parent.getContentTable(),"mouseup",this.onMoveUp,this)),e.event.target.classList.contains(vt)&&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",this.onMoveUp,this)}},e.prototype.onMouseSelection=function(e){var i=[].slice.call(this.parent.element.querySelectorAll("."+ci));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("."+wi),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,"."+yt+",."+vt)},e.prototype.onMoveUp=function(e){var i=this,n=[].slice.call(this.parent.element.querySelectorAll("."+ci));if(t.removeClass(n,"e-allow-select"),e.target.classList.contains(yt)&&(t.EventHandler.remove(this.parent.getContentTable(),"mousemove",this.onMouseSelection),t.EventHandler.remove(this.parent.getContentTable(),"mouseup",this.onMoveUp)),e.target.classList.contains(vt)){var r=this.parent.getAllDayRow();t.EventHandler.remove(r,"mousemove",this.onMouseSelection),t.EventHandler.remove(r,"mouseup",this.onMoveUp)}if(!this.isPreventAction(e)){var a=t.closest(e.target,".e-work-cells,.e-all-day-cells,.e-header-cells"),s=this.parent.getSelectedCells();if(s.length>0&&-1===s.indexOf(a)&&(a=s[s.length-1]),"TimelineYear"!==this.parent.currentView||!a.classList.contains(Ot)){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:ze,showQuickPopup:!1};this.parent.trigger(Ae,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(Ee,r)}})}}},e.prototype.processEnter=function(e){if(!(this.parent.activeViewOptions.readonly&&!e.target.classList.contains(ci)||this.isPreventAction(e)||"TimelineYear"===this.parent.currentView&&e.target.classList.contains(Ot))){var i=e.target;if(t.closest(i,"."+ar))i.classList.contains(ln)||i.classList.contains(pn)||i.classList.contains(cn)||i.classList.contains(hn)||i.classList.contains(Jn)?(i.click(),e.preventDefault()):i.classList.contains(Pn)&&(this.parent.element.querySelector("."+pn).click(),e.preventDefault());else if(i.classList.contains(Bt)&&i.classList.contains(Nt)){var n=i.querySelector("."+Ut);n&&n.click()}else if(i.classList.contains(yt)||i.classList.contains(vt)){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(We,a)}else"Year"===this.parent.currentView?i.click():this.parent.notify(Ee,r)}else if(i.classList.contains(Tr)&&this.parent.inlineModule)this.parent.inlineModule.inlineCrudActions(i);else{if(!(i.classList.contains(ci)||i.classList.contains(fn)||i.classList.contains(Zi)||i.classList.contains(en)))return i.classList.contains(mn)?(this.parent.setProperties({selectedDate:this.parent.getDateFromElement(i)},!0),this.parent.changeView(this.parent.getNavigateView(),e),void this.processEscape(e)):void 0;i.click()}}},e.prototype.getSelectedElements=function(e){var t;if(this.selectedCells.length>1&&e.classList.contains(ri)){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?"."+yt+":not(."+Ot+")":"td",s=[].slice.call(n.querySelectorAll(a)),o=n.rows.length,l=n.rows[0].cells.length;if(t&&t.classList.contains(vt)){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(Ot)||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("."+bi);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("."+ft+" tr:not(."+nr+") ."+yt+":not(."+Ht+")");this.selectCells(!1,t)}else if(this.parent.currentView.indexOf("Year")>-1){var i="."+yt+":not(."+Ot+"):not(."+Ht+")";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(Ae,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(vt)){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;(v=g[u]).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:ze};this.parent.trigger(Ae,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(ci)){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],Si))}},e.prototype.selectAppointmentElementFromWorkCell=function(e,t){var i=this;if(this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.removeSelectedClass(),t.classList.contains(yt)||t.classList.contains(vt)){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);if(this.parent.getCellDetails(n).endTime.getTime()-r.startTime.getTime()>=nt){return[].slice.call(t.cells).slice(i.cellIndex,n.cellIndex+1)}return[]},e.prototype.getAppointmentElements=function(){return[].slice.call(this.parent.element.querySelectorAll("."+ci))},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){var t=parseInt(e.key,10)-1;if(t<this.parent.views.length){var i=this.parent.viewCollections[parseInt(t.toString(),10)].option;this.parent.changeView(i,e,void 0,t),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(Ot))||!((!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("."+un),o=this.getQuickPopupElement();if(r.length>0&&!e.target.classList.contains(yt)&&(n=r[r.length-1]),a.length>0&&!s.classList.contains(wt)&&!o.classList.contains(wt)&&-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(yt)&&!this.parent.element.querySelector("."+wt)){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(Ot)){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("."+un),o=this.getQuickPopupElement();r.length>0&&!e.target.classList.contains(yt)&&(n=r[r.length-1]),a.length>0&&!s.classList.contains(wt)&&!o.classList.contains(wt)&&-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(yt)&&!this.parent.element.querySelector("."+wt)){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(Ot)){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(Ot);)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(Ot)){var s=r.querySelector("."+yt+":not(."+Ot+")"),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(Ot)){if(e[parseInt(i.toString(),10)].cells[t.cellIndex-(n?1:-1)]){var a=+t.getAttribute("data-date")-(n?nt:-nt);return this.parent.getContentTable().querySelector("."+yt+'[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("."+ar)},e.prototype.isCancelLeftRightAction=function(e,t,i){var n="MonthAgenda"===this.parent.currentView||i&&this.initialTarget.classList.contains(Ot);if("Agenda"===this.parent.currentView||t&&n)return!0;if(this.isPreventAction(e)&&t)return!0;var r=this.parent.element.querySelector("."+un),a=this.getQuickPopupElement();return!(!r.classList.contains(wt)&&!a.classList.contains(wt))},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(yt)&&!o.classList.contains(vt)&&(o=a[a.length-1]),!(s.length>0)||(o=this.getWorkCellFromAppointmentElement(s[s.length-1]),this.parent.eventBase.removeSelectedAppointmentClass(),o))if(o.classList.contains(yt)&&e.target.classList.contains(yt)){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(Ot)&&(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(Ot)?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(."+Ot+')[data-date="'+(p.getTime()+nt)+'"]'));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("."+yt+":not(."+Ot+")"):d.rows[parseInt(h.toString(),10)].cells[0];this.selectCells(!1,u)}}else if(o.classList.contains(vt)){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(yt)&&!a.classList.contains(vt)&&(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(yt)&&a.classList.contains(yt)){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(Ot)&&(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(Ot)?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()-nt)+'"]'));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("."+ft+" tbody");u=g.item(g.length-1).querySelector(":not(."+Ot+')[data-date="'+this.parent.activeView.getEndDate().getTime()+'"]')}this.selectCells(!1,u)}}else if(a.classList.contains(vt)){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?"."+yt+":not(."+Ot+")":'[data-date="'+(+t.getAttribute("data-date")-nt)+'"]';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("."+sn);return t&&t.offsetParent?!(e.classList.contains(Xn)||e.classList.contains(Kn)):!(e.classList.contains(cn)||e.classList.contains(hn))}))[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(Tr)&&this.parent.inlineModule&&(n=n.closest(".e-appointment"),this.parent.inlineModule.inlineCrudActions(e.target)),"TimelineYear"===this.parent.currentView&&n.classList.contains(Ot))n.classList.contains(ri)&&this.parent.removeSelectedClass();else{var r=t.closest(n,"."+ar+",."+un);if(r&&r.classList.contains(wt))return r.classList.contains(un)&&this.parent.eventBase.removeSelectedAppointmentClass(),void this.processTabOnPopup(e,r);if(n.classList.contains(ot))this.parent.eventBase.removeSelectedAppointmentClass();else if(n.classList.contains(Bt)&&this.parent.activeView.isTimelineView()&&this.parent.activeViewOptions.group.resources.length>0){var a=parseInt(n.getAttribute("data-group-index"),10),s="."+ci+'[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("."+Di),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(ci)){var c=[].slice.call(this.parent.element.querySelectorAll("."+ci)),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("."+ci+'[data-group-index="'+a+'"]'));var d="."+Bt+'[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;"Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||(this.selectAppointment(i,n),e.preventDefault())}else{var v=this.parent.getSelectedCells();if(v.length>0&&!n.classList.contains(ci))return n=v[v.length-1],this.selectAppointmentElementFromWorkCell(i,n),void e.preventDefault();n&&!n.classList.contains(Bt)&&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){var n=this.parent.eventBase.getSelectedEvents().element;i=n&&t.isNullOrUndefined(n.length)?n:n[0]}if(i&&i.classList.contains(ci)){if(t.addClass([i],ui),this.parent.activeEventData=this.parent.eventBase.getSelectedEvents(),this.parent.activeViewOptions.readonly||i.classList.contains(fr)||!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(ci)){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("."+ci+'[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(ci)){var r=this.parent.resourceBase.renderedResources[0].groupIndex,a="."+ci+'[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,"."+Ht);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(Bt)){var a=parseInt(r.getAttribute("data-group-index"),10);if(this.parent.virtualScrollModule){var s=this.parent.element.querySelector("."+jt);[].slice.call(this.parent.element.querySelectorAll("."+Bt)).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("."+yt+'[data-group-index="'+e+'"]');t&&(this.parent.element.querySelector("."+wi).scrollTop=t.offsetTop)},e.prototype.getModuleName=function(){return"keyboard"},e.prototype.destroy=function(){this.removeEventListener(),this.selectedCells=[],this.keyboardModule.destroy()},e}(),Ar=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}(),Ir=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}(),Mr=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}(),kr=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 Rr},e}(),Rr=[{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"}],Hr={},Pr=["SU","MO","TU","WE","TH","FR","SA"],jr=["SU","MO","TU","WE","TH","FR","SA"],Lr=43,Nr=["first","second","third","fourth","last"],qr="summaryTimes",Fr="summaryOn",Ur="every",Br="summaryUntil",Wr="summaryDay",zr="summaryWeek",Yr="summaryMonth",_r="summaryYear",Gr={SU:"sun",MO:"mon",TU:"tue",WE:"wed",TH:"thu",FR:"fri",SA:"sat"},Xr=/\d/,Qr=/[^A-Z]+/,Kr=/[a-z]+|[^a-z]+/gi,Zr=function(){function e(e){this.slots=[],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=function(e){c&&(e[o.id]=p++),e=u.updateEventDateTime(e),i?u.processTimezoneChange(e,n):u.parent.isPrinting||u.parent.uiStateValues.isPreventTimezone||(e=u.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])||u.parent.crudModule&&u.parent.crudModule.crudObj.isCrudAction)if(u.parent.crudModule&&u.parent.crudModule.crudObj.isCrudAction)if(!t.isNullOrUndefined(e[o.recurrenceRule])&&t.isNullOrUndefined(e[o.recurrenceID]))for(var s=function(e){var t=u.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:u.generateGuid(),l.push(e)},d=0,g=u.generateOccurrence(e,null,!0);d<g.length;d++){s(g[d])}else{var v=u.parent.eventsProcessed.filter(function(t){return t[r.parent.eventFields.id]===e[r.parent.eventFields.id]});e.Guid=v.length>0?v[0].Guid:u.generateGuid(),l.push(e)}else e.Guid=u.generateGuid(),l.push(e);else l=l.concat(u.generateOccurrence(e,null,!0))},u=this,g=0,v=e;g<v.length;g++){d(v[g])}this.parent.eventsProcessed=[];var m=l.filter(function(e){return!e[r.parent.eventFields.isBlock]});this.parent.eventsProcessed=this.filterEvents(a,s,m);for(var f=l.filter(function(e){return e[r.parent.eventFields.isBlock]}),y=0,T=f;y<T.length;y++){var w=T[y];if(w[o.isAllDay]){b(new Date(w[o.startTime].getTime()))<b(new Date(w[o.endTime].getTime()))||(w[o.startTime]=b(w[o.startTime]),w[o.endTime]=O(b(w[o.endTime]),1))}}return this.parent.blockProcessed=f,m},e.prototype.updateEventDateTime=function(e){return"string"==typeof e[this.parent.eventFields.startTime]&&(e[this.parent.eventFields.startTime]=M(e[this.parent.eventFields.startTime])),"string"==typeof e[this.parent.eventFields.endTime]&&(e[this.parent.eventFields.endTime]=M(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(Xe,{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];if(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();if(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 M=[],k=0;k<h.length;k++)this.dateInRange(h[parseInt(k.toString(),10)],s,o)&&M.push(h[parseInt(k.toString(),10)]);if(M.length>0)if(this.parent.activeViewOptions.group.byDate)for(var R=0,H=M;R<H.length;R++){var P=H[R];l.push(this.cloneEventObject(e,P,P,1,P!==s,P!==o))}else{A=M[0]!==s,I=M[M.length-1]!==o;l.push(this.cloneEventObject(e,M[0],M[M.length-1],M.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("."+ui)).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,ui),"Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||t.removeClass(e,Si)},e.prototype.addSelectedAppointments=function(e,i){"MonthAgenda"!==this.parent.currentView&&this.parent.removeSelectedClass(),t.addClass(e,ui),e.length>0&&!i&&e[e.length-1].focus()},e.prototype.getSelectedAppointments=function(){return[].slice.call(this.parent.element.querySelectorAll("."+ui+",."+ci+":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 t;if("Agenda"===this.parent.currentView||"MonthAgenda"===this.parent.currentView)return t;if(e.length>0){var i=e[e.length-1],n=i[this.parent.eventFields.startTime],r=new Date(+n).setMinutes(0,0,0),a=this.isAllDayAppointment(i);("Month"===this.parent.currentView||a)&&(r=new Date(+n).setHours(0,0,0,0));var s=void 0;s=a&&-1!==["Day","Week","WorkWeek"].indexOf(this.parent.currentView)?this.parent.getAllDayRow():this.parent.getContentTable();var o='[data-date="'+new Date(r).getTime()+'"]';if(this.parent.activeViewOptions.group.resources.length>0&&(o+='[data-group-index="'+this.getGroupIndexFromEvent(i)+'"]'),t=s.querySelector(o))return this.parent.activeCellsData=this.parent.getCellDetails(t),this.parent.keyboardInteractionModule&&this.parent.keyboardInteractionModule.selectCells(!1,t),t}return t},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=(N(e[t.endTime])-N(e[t.startTime]))/nt>=1;return!!(i||"TimeSlot"!==this.parent.eventSettings.spannedEventPlacement&&n)},e.prototype.addEventListener=function(){this.parent.on(tt,this.appointmentBorderRemove,this)},e.prototype.removeEventListener=function(){this.parent.off(tt,this.appointmentBorderRemove)},e.prototype.appointmentBorderRemove=function(e){var i=e.event.target;if(t.closest(i,"."+ci))"MonthAgenda"!==this.parent.currentView&&this.parent.removeSelectedClass();else if(!t.closest(i,"."+wt)){if(this.parent.uiStateValues.isTapHold&&t.closest(i,"."+yt+",."+vt))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;this.parent.uiStateValues.isTouchScroll||this.parent.uiStateValues.isTapHold||this.parent.uiStateValues.action?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:Ni});switch(s){case"isLeft":i.isLeft||(o.appendChild(t.createElement("div",{className:"e-left-right-resize"})),t.addClass([o],this.parent.enableRtl?Ui:Fi),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?Fi:Ui),t.append([o],e));break;case"isTop":i.isTop||(o.appendChild(t.createElement("div",{className:"e-top-bottom-resize"})),t.addClass([o],Bi),t.prepend([o],e));break;case"isBottom":i.isBottom||(o.appendChild(t.createElement("div",{className:"e-top-bottom-resize"})),t.addClass([o],Wi),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(qi)||n.classList.contains(Tr)))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("."+ui));var r=t.closest(e.target,"."+ci);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(Ae,a);var s=t.extend(this.parent.activeEventData,{cancel:!1,originalEvent:e});this.parent.trigger(Pe,s)}else{this.removeSelectedAppointmentClass(),this.activeEventData(e,!0);var o={data:this.parent.activeEventData.event,element:this.parent.activeEventData.element,event:e,requestType:"eventSelect"};this.parent.trigger(Ae,o);s=t.extend(this.parent.activeEventData,{cancel:!1,originalEvent:e});this.parent.trigger(Pe,s,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],Si),i.parent.allowInline){var n={data:e.event,element:e.element,type:"Event"};i.parent.notify(We,n)}else i.parent.notify(Pe,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(wr)&&!this.parent.activeEventData.element.querySelector("."+Tr)){var n=t.extend(this.parent.activeEventData,{cancel:!1,originalEvent:e});this.parent.trigger(je,n,function(e){e.cancel||(!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(){return"xyxxxxyx-xxxy-yxxx-xyxx-xxyxxxxyyxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|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,"."+ci),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=e[this.parent.eventFields.startTime],a=e[this.parent.eventFields.endTime],s=e[this.parent.eventFields.recurrenceRule],o=a.getTimezoneOffset()-r.getTimezoneOffset(),l=a.getTime()-r.getTime()-6e4*o;i=new Date((i||this.parent.activeView.startDate()).getTime()-l);var p,c=e[this.parent.eventFields.recurrenceException];"Agenda"!==this.parent.currentView&&n&&(p=S(i,this.parent.activeView.endDate())+1);var h=this.parent.timezone||this.parent.tzModule.getLocalTimezoneName(),d=G(r,s,c,this.parent.activeViewOptions.firstDayOfWeek,p,i,this.parent.calendarMode,h);"Agenda"===this.parent.currentView&&-1===s.indexOf("COUNT")&&-1===s.indexOf("UNTIL")&&(t.isNullOrUndefined(e.generatedDates)?e.generatedDates={start:new Date(d[0]),end:new Date(d[d.length-1])}:(d[0]<e.generatedDates.start.getTime()&&(e.generatedDates.start=new Date(d[0])),d[d.length-1]>e.generatedDates.end.getTime()&&(e.generatedDates.end=new Date(d[d.length-1]))));for(var u=[],g=0,v=d;g<v.length;g++){var m=v[g],f=t.extend({},e,null,!0);m=this.getDSTAdjustedTime(m,f),f[this.parent.eventFields.startTime]=new Date(m),f[this.parent.eventFields.endTime]=new Date(new Date(m).setMilliseconds(l)),f[this.parent.eventFields.recurrenceID]=f[this.parent.eventFields.id],delete f[this.parent.eventFields.recurrenceException],delete f[this.parent.eventFields.followingID],f.Guid=this.generateGuid(),u.push(f)}return u},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;i=t?e[n.id]:e[n.recurrenceID]||e[n.followingID];return 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=function(s,l){if(0===o.parent.eventsData.filter(function(e){return e[n.recurrenceID]===i[n.id]&&e[n.recurrenceException]===a[parseInt(s.toString(),10)]}).length){var p=X(a[parseInt(s.toString(),10)]),c=t.extend({},e,null,!0);c[n.recurrenceID]=i[n.id],delete c[n.followingID],c[n.recurrenceException]=a[parseInt(s.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=this,l=0,p=a.length;l<p;l++)s(l);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){e=e.replace("#","");return"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:hi,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:Pn});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)}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 t,i=0,n=e.length;if(e[0]<this.parent.minDate&&e[e.length-1]>this.parent.maxDate){for(var r=0;r<e.length;r++)b(e[parseInt(r.toString(),10)]).getTime()===b(new Date(this.parent.minDate)).getTime()&&(i=r),b(e[parseInt(r.toString(),10)]).getTime()===b(new Date(this.parent.maxDate)).getTime()&&(n=r);t=e.filter(function(t){return t>=e[parseInt(i.toString(),10)]&&t<=e[parseInt(n.toString(),10)]})}return t},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("."+_i)).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("."+vt).style.height=i/12+"em",this.parent.uiStateValues.expand?t.addClass([e],br):t.removeClass([e],br)},e.prototype.updateEventMinimumDuration=function(e,t,i){if(t.getTime()<i.getTime()){if((N(i)-N(t))/rt<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?" "+$t:"",s=0,o=r.length;s<o;s++){var l=r[parseInt(s.toString(),10)],p=t.createElement("td",{className:"allDay"===e?Gi+a:"timeIndicator"===e?Zt:ei+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:Jt+"-"+i.toString(),className:Jt});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:Ri+" "+ct});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("."+ai+" 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(Ke,{})}},e.prototype.unWireEvents=function(){for(var e=0,i=[].slice.call(this.parent.element.querySelectorAll("."+ci));e<i.length;e++){var n=i[e];t.EventHandler.clearEvents(n)}},e.prototype.destroy=function(){this.unWireEvents(),this.parent=null},e}(),Jr=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)}}(),$r=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.parent.activeView.getStartHour(),n.endHour=n.parent.activeView.getEndHour(),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 Jr(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("."+hi+",."+ci+",."+Ki)),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,"."+ei+",."+Gi);n&&!n.classList.contains($t)&&t.addClass([n],$t)}},a=0,s=i;a<s.length;a++){var o=s[a];if(!n||o.classList.contains(Xi)||o.classList.contains(Ki))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("."+yt)&&(this.parent.virtualScrollModule&&this.parent.virtualScrollModule.updateFocusedWorkCell(),this.allDayElement=[].slice.call(this.element.querySelectorAll("."+vt)),this.setAllDayRowHeight(0),0!==this.parent.eventsProcessed.length||0!==this.parent.blockProcessed.length)){var h=this.element.querySelector("."+Zi);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,ir),this.slots.push(this.parent.activeView.renderDates.map(function(e){return+e})),this.renderEvents("allDayEvents"),this.animation.animate(this.allDayElement[0])),this.parent.notify(Ke,{}),t.addClass(this.allDayElement,ir),n&&(this.parent.crudModule.crudObj.isCrudAction=!1),this.parent.renderTemplates(function(){if(e.parent.isReact&&e.parent.activeViewOptions.eventTemplate){var i=[].slice.call(e.parent.element.querySelectorAll("."+$t));t.removeClass(i,$t)}})}}},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(W(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=(N(t)-N(e))/rt*(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("."+Jt+'[id="'+Jt+"-"+n+'"]');this.parent.enableRtl?t.setStyleAttribute(i,{right:r}):t.setStyleAttribute(i,{left:r});var s=i.classList.contains(hi)?"blockEvent":"event",o={data:t.extend({},e,null,!0),element:i,cancel:!1,type:s};this.parent.trigger(Le,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=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("."+wi+" table");c=t.formatUnit(h.offsetHeight),p=t.formatUnit(0)}else c=t.formatUnit(this.getHeight(s,o)),p=t.formatUnit(this.getTopValue(s,i,n));var d=this.createBlockAppointmentElement(e,n,this.isResourceEventTemplate);t.setStyleAttribute(d,{width:"100%",height:c,top:p});var u=this.getDayIndex(i,n,r);this.appendEvent(e,d,u,"0px")}},i.prototype.renderEvents=function(e){t.removeClass(this.allDayElement,ir);for(var i,n="allDayEvents"===e?this.sortByDateTime(this.allDayEvents):void 0,r=this.getResourceList(),a=this.getStartCount(),s="allDayEvents"===e?h(this.element.querySelector("."+Gi),ci):0,o="allDayEvents"===e&&this.allDayElement.length>0?this.allDayElement[0].offsetTop:0,l=function(r){i=!0,p.parent.crudModule&&p.parent.crudModule.crudObj.isCrudAction&&"allDayEvents"!==e&&!p.parent.uiStateValues.isGroupAdaptive&&0===p.parent.crudModule.crudObj.sourceEvent.filter(function(e){return e.groupIndex===r}).length&&0===p.parent.crudModule.crudObj.targetEvent.filter(function(e){return e.groupIndex===r}).length&&(i=!1),p.slots=[];var l=p.dateRender[parseInt(r.toString(),10)],c=p.getRenderedDates(l)||l;p.slots.push(l.map(function(e){return+e}));for(var h=0,d=l.length;h<d&&l[parseInt(h.toString(),10)]<=c[c.length-1];h++){p.renderedEvents=[];var u=new Date(l[parseInt(h.toString(),10)].getTime()),g=O(l[parseInt(h.toString(),10)],1),v=p.filterEvents(u,g,n,p.resources[parseInt(r.toString(),10)]);if(i)for(var m=0,f=v;m<f.length;m++){var y=f[m];if(p.parent.resourceBase&&p.setValues(y,r),"allDayEvents"===e)p.renderAllDayEvents(y,h,r,a,!1,o,s);else if(p.isAllDayAppointment(y))p.allDayEvents.push(t.extend({},y,null,!0));else{if(p.parent.eventSettings.enableMaxHeight&&p.getOverlapIndex(y,h,!1,r)>0)continue;p.renderNormalEvents(y,h,r,a)}p.cssClass=null,p.groupOrder=null}else for(var T=0,w=v;T<w.length;T++){var D=w[T];p.isAllDayAppointment(D)&&p.allDayEvents.push(t.extend({},D,null,!0))}a+=1}},p=this,c=0,d=r;c<d.length;c++){l(d[c])}},i.prototype.getStartCount=function(){return this.parent.virtualScrollModule&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.timeScale.enable?parseInt(this.element.querySelector("."+Jt).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:ci,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:gi});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:Pn});if(this.parent.sanitize(s,d),i)if(e[a.isAllDay])c=[d];else{c=[];var u=t.createElement("div",{className:fi+(this.parent.isAdaptive?" "+dt:""),innerHTML:this.parent.getTimeString(e[a.startTime])}),g=t.createElement("div",{className:fi+(this.parent.isAdaptive?" "+dt:""),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:fi+(this.parent.isAdaptive?" "+dt:""),innerHTML:v}),f=t.createElement("div",{className:jn});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)}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]?zi:Yi,b=t.createElement("div",{className:ct+" "+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:Ki,id:Ki+"-"+r.toString()}),o=t.createElement("div",{className:en,attrs:{tabindex:"0","data-index":r.toString(),"data-count":"1"},innerHTML:"+1&nbsp;"+(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("."+en),p=parseInt(l.getAttribute("data-count"),10)+1;l.setAttribute("data-count",p.toString()),l.innerHTML="+"+this.parent.globalize.formatNumber(p)+"&nbsp;"+(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},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()),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-T),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("."+mt).children),b=this.getDayIndex(i,n,r),C=this.element.querySelector("."+Gi+":nth-child("+(b+1)+")");w=a?this.parent.inlineModule.createInlineAppointmentElement(e):this.createAppointmentElement(e,!0,c.data,n),t.addClass([w],Xi);var S=t.extend({},c.data,null,!0);e.data=S;var E={data:e,element:w,cancel:!1};this.parent.trigger(Le,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=V(b(new Date(this.dateRender[parseInt(n.toString(),10)][parseInt(i.toString(),10)].getTime())),this.startHour,this.endHour),h=this.isValidEvent(e,o,l,c);if(!(o.getTime()<this.parent.minDate.getTime()||l.getTime()>this.parent.maxDate.getTime())&&o<=l&&h&&this.isWorkDayAvailable(n,o)){var d=this.getHeight(o,l);o.getTime()>c.startHour.getTime()&&(p=this.getTopValue(o,i,n));var u=this.getOverlapIndex(s,i,!1,n);s.Index=u,this.overlapList.push(s),this.overlapList.length>1?(t.isNullOrUndefined(this.overlapEvents[parseInt(u.toString(),10)])&&(this.overlapEvents[parseInt(u.toString(),10)]=[]),this.overlapEvents[parseInt(u.toString(),10)].push(s)):(this.overlapEvents=[],this.overlapEvents.push([s]));var g={index:u,left:"0%",width:this.getEventWidth(),day:r,dayIndex:i,record:s,resource:n},v=this.adjustOverlapElements(g);v.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 m=void 0;m=a?this.parent.inlineModule.createInlineAppointmentElement(e):this.createAppointmentElement(e,!1,s.isSpanned,n),t.setStyleAttribute(m,{width:this.parent.eventSettings.enableMaxHeight?"100%":v.appWidth,height:d+"px",top:p+"px"});var f=d-40-15*m.querySelectorAll("."+Ri).length,y=m.querySelector("."+Pn);!this.parent.isAdaptive&&y&&(y.style.maxHeight=t.formatUnit(f));var T=this.getDayIndex(i,n,r),w={};w[this.fields.startTime]=e[this.fields.startTime],w[this.fields.endTime]=e[this.fields.endTime],s.data=w,this.appendEvent(s,m,T,v.appLeft),this.wireAppointmentEvents(m,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.getTopValue=function(e,t,i){var n=b(this.dateRender[parseInt(i.toString(),10)][parseInt(t.toString(),10)]),r=V(n,this.startHour,this.endHour).startHour,a=L(n)&&r.getHours()!==this.startHour.getHours()?this.startHour.getHours():r.getHours(),s=60*(e.getHours()-a)+(e.getMinutes()-r.getMinutes());return this.parent.activeViewOptions.timeScale.enable?s*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)),this.overlapList.forEach(function(e){var t=c.filter(function(t){return t[s.endTime]>e[s.startTime]&&t[s.startTime]<=e[s.endTime]});a.parent.activeViewOptions.group.resources.length>0&&(t=a.filterEventsByResource(a.resources[parseInt(r.toString(),10)],t));var i=t.filter(function(e){return-1===a.overlapList.indexOf(e)});i.length>0&&(h=h.concat(i))});for(var g=0;g<h.length-1;g++)for(var v=g+1;v<h.length;v++)h[parseInt(g.toString(),10)][s.id]===h[parseInt(v.toString(),10)][s.id]&&(h.splice(v,1),v--);this.overlapList=this.overlapList.concat(h);for(var m=0,f=o=this.overlapList;m<f.length;m++){var y=f[m],T=y.Index;t.isNullOrUndefined(this.overlapEvents[parseInt(T.toString(),10)])?this.overlapEvents[parseInt(T.toString(),10)]=[y]:this.overlapEvents[parseInt(T.toString(),10)].push(y)}}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 w=o.map(function(e){return e.Index});l=w.length>0?this.getSmallestMissingNumber(w):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("."+Dt);"auto"!==this.parent.height&&this.parent.enableAllDayScroll||t.addClass([i],Cr);var n=this.parent.element.querySelector("."+mt);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],br)}},i.prototype.addOrRemoveClass=function(){var e=this;this.moreEvents.filter(function(i){!e.parent.uiStateValues.expand&&e.allDayLevel>2?(t.addClass([i],Qi),i.setAttribute("tabindex","-1")):(t.removeClass([i],Qi),i.setAttribute("tabindex","0"))});var i=this.element.querySelector("."+Zi);this.parent.uiStateValues.expand?(t.removeClass([i],Ji),t.addClass([i],$i)):(t.removeClass([i],$i),t.addClass([i],Ji)),this.allDayLevel>2?t.removeClass([i],dt):t.addClass([i],dt);[].slice.call(this.element.querySelectorAll("."+Ki)).forEach(function(i){!e.parent.uiStateValues.expand&&e.allDayLevel>2?t.removeClass([i],dt):t.addClass([i],dt)})},i.prototype.getEventHeight=function(){var e=t.createElement("div",{className:ci,styles:"visibility:hidden"});this.element.querySelector("."+Gi+":first-child").appendChild(e);var i=e.offsetHeight;return t.remove(e),i},i.prototype.rowExpandCollapse=function(){var e=this.element.querySelector("."+Zi);this.parent.uiStateValues.expand=e.classList.contains(Ji);var t;this.parent.uiStateValues.expand?(e.setAttribute("title",this.parent.localeObj.getConstant("collapseAllDaySection")),e.setAttribute("aria-label","Collapse section"),t=(this.allDayLevel+1)*this.getEventHeight()+4):(e.setAttribute("title",this.parent.localeObj.getConstant("expandAllDaySection")),e.setAttribute("aria-label","Expand section"),t=3*this.getEventHeight()+4,this.parent.element.querySelector("."+Dt).scrollTop=0),this.setAllDayRowHeight(t),this.animation.animate(this.allDayElement[0]),this.addOrRemoveClass(),this.animation.animate(e)},i.prototype.animationUiUpdate=function(){this.parent.notify(Ke,{})},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}(Zr),ea=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)}}(),ta=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 ea(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("."+wi);this.parent.rowAutoHeight&&(this.parent.uiStateValues.top=e.scrollTop,this.parent.uiStateValues.left=e.scrollLeft);var i=[].slice.call(this.element.querySelectorAll("."+Jt));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(ft),this.element.querySelector("."+yt)){if("Month"===this.parent.currentView){var c=t.createElement("div",{className:Jt}),d=this.parent.element.querySelector("."+yt);d.appendChild(c),this.monthHeaderHeight=c.offsetTop-d.offsetTop,d.removeChild(c)}this.eventHeight=h(this.element,ci);var u="."+ft+" tbody tr";this.addCellHeight(u,this.eventHeight,"Month"===this.parent.currentView?0:2,this.monthHeaderHeight,this.moreIndicatorHeight);var g=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 v={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=g,this.parent.currentAction=null):this.parent.virtualScrollModule.updateVirtualScrollHeight()),this.parent.enablePersistence||this.parent.notify(Ke,{}),this.parent.notify($e,v),"Month"===this.parent.currentView&&this.parent.showWeekNumber){var m=[].slice.call(this.parent.element.querySelectorAll(".e-content-wrap table tr td:first-child"));[].slice.call(this.parent.element.querySelectorAll("."+si)).forEach(function(e,i){var n=m[parseInt(i.toString(),10)].offsetHeight;t.setStyleAttribute(e,{height:n+"px"})}),this.parent.element.querySelector("."+ai).scrollTop=this.parent.element.querySelector("."+wi).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("."+yt+'[data-group-index="'+s+'"]'))):(r=this.parent.eventsProcessed,a=this.parent.blockProcessed,this.workCells=[].slice.call(this.element.querySelectorAll("."+yt))),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("."+ft).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=B(p),this.cellHeight=W(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)}if(!(p=this.isSameDate(l[this.fields.startTime],l[this.fields.endTime]))&&C(l[this.fields.endTime])>0){var c;(c=t.extend({},s,null,!0))[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;var d=this.parent.enableRtl?0:p,u=this.parent.enableRtl?p:0,g=this.cellHeight-this.monthHeaderHeight,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 "+di});t.isNullOrUndefined(e.querySelector("."+di))&&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.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:ci,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:gi});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:Pn});this.parent.sanitize(r+(d?"; "+d:""),u);var g=t.createElement("div",{className:fi+(this.parent.isAdaptive?" "+dt:""),innerHTML:this.parent.getTimeString(c[this.fields.startTime])}),v=t.createElement("div",{className:fi+(this.parent.isAdaptive?" "+dt:""),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:fi,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:fi+(this.parent.isAdaptive?" "+dt:""),innerHTML:f}),T=t.createElement("div",{className:jn});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)}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]?zi:Yi;i.appendChild(t.createElement("div",{className:ct+" "+r+(this.parent.isAdaptive?" "+dt:"")}))}if(n.isLeft){var a=t.createElement("div",{className:Ri+" "+ct+" e-left-icon"});t.prepend([a],i)}if(n.isRight){var s=t.createElement("div",{className:Ri+" "+ct+" 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=h.parentElement.firstElementChild;this.updateCellHeight(m,u)}}else for(var f=0;f<p;f++)if(this.workCells[s+f]){var y=this.workCells[s+f].querySelector("."+en);if(y){var T=parseInt(y.getAttribute("data-count"),10)+1;y.setAttribute("data-count",T.toString()),y.innerHTML=this.getMoreIndicatorText(T)}else{var w=new Date(this.dateRender[s+f].getTime()),D=O(this.dateRender[s+f],1),C=this.workCells[s+f].getAttribute("data-group-index"),S=this.getMoreIndicatorElement(1,w,D);t.isNullOrUndefined(C)||S.setAttribute("data-group-index",C),S.style.top=this.cellHeight-this.monthHeaderHeight-this.moreIndicatorHeight+"px",S.style.width=this.cellWidth-2+"px",this.renderElement(this.workCells[s+f],S),t.EventHandler.add(S,"click",this.moreIndicatorClick,this)}}}}},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("."+hi));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,"."+en),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(Ve,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(hi)?"blockEvent":"event",a=t.classList.contains(ci),s={data:this.getEventData(e),element:t,cancel:!1,type:r};this.parent.trigger(Le,s,function(e){e.cancel?n.renderedEvents.pop():n.renderElement(i,t,a)})},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("."+Jt);if(r)r.appendChild(i);else{var a=t.createElement("div",{className:Jt});a.appendChild(i),e.appendChild(a)}},i.prototype.getMoreIndicatorElement=function(e,i,n){return t.createElement("div",{className:en,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)+"&nbsp;"+(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("."+Ai)),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}(Zr),ia=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)}}(),na=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("."+pi));var r=[].slice.call(n.element.querySelectorAll("."+ft+" tbody tr"));return n.dayLength=0===r.length?0:r[0].children.length,n.content=n.parent.element.querySelector("."+gt+"."+ft),n}return ia(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("."+yt);this.cellWidth=B(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,l=(o=s[a]).data;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=function(i){if("day"===a.renderType){var r=b(e).getTime(),s=b(t).getTime(),o=b(i[a.fields.startTime]).getTime(),l=b(i[a.fields.endTime]).getTime();(o<=r&&l>=r||function(){var e=s-(C(t)<=0?nt:0);return e=r>e?r:e,l>=e&&o<=e}()||o>r&&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)}},a=this,s=0,o=i;s<o.length;s++){r(o[s])}return n},i.prototype.renderResourceEvents=function(){this.removeHeightProperty(Lt);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.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("."+wi),I=B(A),M=A.offsetHeight===A.clientHeight&&A.offsetWidth===A.clientWidth;this.renderEventElement(e,x,p);var k=this.getFirstChild(i);this.updateCellHeight(k,S),M&&(A.offsetWidth>A.clientWidth||I!==B(A))&&this.adjustAppointments(I)}else this.renderEventElement(e,x,p)}else for(var R=0;R<u;R++){var H=p.querySelector("."+en),P=this.parent.enableRtl?T:y;P=Math.floor(P/this.cellWidth)*this.cellWidth;var j=this.interval/this.slotCount,L="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(L,q,e[this.fields.isAllDay],this.day+R);this.renderTimelineMoreIndicator(r,L,q,d,j,i,n,D,y,T,p,H,P,F)}else for(var U=(N(a)-N(r))/rt*this.slotCount/this.interval,W=0;W<U&&(L=0===W?new Date(L.getTime()):new Date(L.getTime()+6e4*j),U<1&&(L=this.adjustToNearestTimeSlot(L,j)),q=new Date(L.getTime()+6e4*j),!(U>=1&&q.getTime()>a.getTime()));W++){var z=this.getPosition(L,q,!1,this.day+R);if(P>z)break;P=z,this.renderTimelineMoreIndicator(r,L,q,d,j,i,n,D,y,T,p,H,P,z)}}}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("."+Lt+' 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.adjustAppointments=function(e){var t=this,i=this.parent.element.querySelector("."+ft+" tbody tr"),n=B(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("."+ci)).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.getFirstChild=function(e){var t="."+ft+" tbody td",i="";this.parent.activeViewOptions.group.resources.length>0&&(i='[data-group-index="'+e.toString()+'"]');return this.parent.element.querySelector(t+i)},i.prototype.updateBlockElements=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll("."+hi));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+"px";var a=i.offsetWidth/r.offsetWidth;i.style.width=r.offsetWidth*a+"px"}for(var s=0,o=[].slice.call(this.element.querySelectorAll("."+di));s<o.length;s++){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(N(t)-N(e))/rt*(this.cellWidth*this.slotCount)/this.interval},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);n=this.getSameDayEventsWidth(t,o.endHour),n=this.slotsPerDay*this.cellWidth===n?0:n}var l=s+n;return r>l?r-l:r-s},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)?(N(t)-N(e.startHour))/(rt*this.interval)*this.slotCount:0;if(0===i)return n;return Math.round((N(e.endHour)-N(e.startHour))/rt/this.interval*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.isAlreadyAvail=function(e,t){for(var i=[].slice.call(t.querySelectorAll("."+en)),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("."+wi+' 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 "+di});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}(ta),ra=function(){function e(e){this.parent=e,this.parent.on(We,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("."+un);t&&t.classList.contains(wt)&&this.parent.quickPopup.morePopup.hide(),this.removeInlineAppointmentElement(),this.cellEdit(e)}else this.parent.element.querySelector("."+Tr)!==e.element.querySelector("."+Tr)&&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("."+Tr);p&&p.focus()},e.prototype.eventEdit=function(e){var i,n=e.element.querySelector("."+Tr);if(n)i=n.value;else{var r=e.element.querySelector("."+Pn);if(t.isNullOrUndefined(r)?i=e.data[this.parent.eventFields.subject]:(t.addClass([r],dt),i=r.innerText),n=t.createElement("input",{className:Tr,attrs:{value:i}}),t.closest(e.element,"."+un))e.element.insertBefore(n,r);else if(["Agenda","MonthAgenda"].indexOf(this.parent.currentView)>-1){var a=e.element.querySelector("."+vi);t.isNullOrUndefined(a)&&(a=t.createElement("div",{className:vi}),e.element.prepend(a)),a.insertBefore(n,a.firstChild)}else e.element.querySelector(".e-appointment-details").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 $r(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("."+vt)),(r=s.slots).push.apply(r,this.parent.activeView.renderDates.map(function(e){return+e}));var l=[].slice.call(this.parent.element.querySelectorAll("."+Xi)),p=0;l.length>0&&(p=Math.floor(W(this.parent.element.querySelector("."+mt))/l[0].offsetHeight)-1),s.allDayLevel=p;var c=h(this.parent.element.querySelector("."+Gi),ci),d=s.allDayElement.length>0?s.allDayElement[0].offsetTop:0;s.renderAllDayEvents(e,o,i,n,this.parent.allowInline,d,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 ta(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="."+yt;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=h(this.parent.monthModule.element||s.element,ci),s.getSlotDates(l);for(var d=s.getRenderedDates(o),u=0,g=s.splitEvent(a,d||o);u<g.length;u++){var v=g[u];s.renderEvents(v,t)}this.parent.element.querySelector("."+Tr).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 na(this.parent,this.parent.activeViewOptions.timeScale.enable?"hour":"day");s.dateRender=this.parent.activeView.renderDates,s.eventContainers=[].slice.call(this.parent.element.querySelectorAll("."+pi));var o=this.parent.element.querySelector("."+yt);s.inlineValue=this.parent.allowInline,s.cellWidth=o.offsetWidth,s.cellHeight=o.offsetHeight;var l=0===this.parent.element.querySelectorAll("."+ft+" tbody tr").length?0:this.parent.element.querySelectorAll("."+ft+" tbody tr")[0].children.length;s.slotsPerDay=l/s.dateRender.length,s.eventHeight=h(s.element,ci),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())/nt},e.prototype.generateEventData=function(e){var t=this.parent.element.querySelector("."+Tr),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(){var e=this.parent.element.querySelector("."+Tr);e&&""!==e.value?this.inlineCrudActions(e):this.removeInlineAppointmentElement()},e.prototype.inlineCrudActions=function(e){if(t.closest(e,"."+wr)){var i=this.generateEventData(e);this.parent.addEvent(i)}else{var n=t.closest(e,"."+ci),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:ci+" "+wr}),n=t.createElement("div",{className:gi});i.appendChild(n);var r=t.createElement("input",{className:Tr});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("."+wr));e.length>0&&e.forEach(function(e){return t.remove(e)});var i=this.parent.element.querySelector("."+Tr);if(i){var n=t.closest(i,"."+ci).querySelector("."+Pn);t.isNullOrUndefined(n)||t.removeClass([n],dt),t.remove(i)}},e.prototype.destroy=function(){this.parent.off(We,this.inlineEdit)},e}(),aa=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(vt)||t.classList.contains(Ct)||t.classList.contains(ln)||t.classList.contains(yt)||t.classList.contains(Yn))?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(ar)?(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 "+er,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("."+er));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}(),sa=function(){function e(e){this.isMultipleEventSelect=!1,this.isCrudAction=!1,this.parent=e,this.l10n=this.parent.localeObj,this.fieldValidator=new aa,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:ar+" e-popup-close",attrs:{role:"dialog"}});this.parent.isAdaptive?(document.body.appendChild(e),t.addClass([e],lt)):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="'+gn+'"><div class="e-more-event-header"><div class="'+fn+'" title="'+this.l10n.getConstant("close")+'" tabindex="0" role="button"></div><div class="'+vn+'"><div class="e-header-day" id="'+this.parent.element.id+'_more_popup"></div><div class="'+mn+" "+Vi+'" tabindex="0" role="link"></div></div></div></div>',n=t.createElement("div",{className:un+" e-popup-close",innerHTML:e});this.parent.isAdaptive?(document.body.appendChild(n),t.addClass([n],lt)):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("."+fn);this.renderButton("e-round",ct+" "+$n,!1,r,this.closeClick),t.EventHandler.add(this.morePopup.element.querySelector("."+mn),"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("."+En);a&&(a.setAttribute("aria-label",this.l10n.getConstant("occurrence")),a.setAttribute("aria-label",a.innerHTML));var s=this.quickDialog.element.querySelector("."+xn);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],ct)},e.prototype.quickDialogClass=function(e){var i=[wn,Dn,Sn,On,An,dt],n=this.quickDialog.element.querySelector("."+En),r=this.quickDialog.element.querySelector("."+xn),a=this.quickDialog.element.querySelector("."+Vn);switch(t.removeClass([n,r],i),t.addClass([this.quickDialog.element.querySelector("."+On)],dt),this.parent.eventSettings.editFollowingEvents&&(t.addClass([a],dt),t.removeClass([this.quickDialog.element],Cn)),e){case"Recurrence":t.addClass([n],wn),t.addClass([r],Dn),this.parent.eventSettings.editFollowingEvents&&(t.removeClass([a],dt),t.addClass([this.quickDialog.element],Cn),t.addClass([a],bn));break;case"Delete":t.addClass([n],Sn),t.addClass([r],On);break;case"Alert":t.addClass([n],[En,An]),t.addClass([r],[xn,dt])}},e.prototype.applyFormValidation=function(){var e=this.quickPopup.element.querySelector("."+Mn),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("."+En);e&&(e.innerHTML=this.l10n.getConstant("Delete"===this.parent.currentAction?"deleteEvent":"editEvent"),e.setAttribute("aria-label",e.innerHTML));var t=this.quickDialog.element.querySelector("."+Vn);t&&(t.innerHTML=this.l10n.getConstant("editFollowingEvent"),t.setAttribute("aria-label",t.innerHTML));var i=this.quickDialog.element.querySelector("."+xn);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("."+En);i.innerHTML=this.l10n.getConstant("ok"),i.setAttribute("aria-label",i.innerHTML);var n=this.quickDialog.element.querySelector("."+xn);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],dt),this.quickDialog.content=this.l10n.getConstant("wrongPattern");break;case"createError":t.addClass([n],dt),this.quickDialog.content=this.l10n.getConstant("createError");break;case"sameDayAlert":t.addClass([n],dt),this.quickDialog.content=this.l10n.getConstant("sameDayAlert");break;case"seriesChangeAlert":r=this.quickDialog.element.querySelector("."+On),t.removeClass([n,r],dt),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],dt),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("."+En);e&&(e.innerHTML=this.l10n.getConstant("delete"),e.setAttribute("aria-label",e.innerHTML));var t=this.quickDialog.element.querySelector("."+xn);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("."+En);i&&(i.innerHTML=this.l10n.getConstant("ok"),i.setAttribute("aria-label",i.innerHTML));var n=this.quickDialog.element.querySelector("."+xn);n&&(n.innerHTML=this.l10n.getConstant("cancel"),i.setAttribute("aria-label",n.innerHTML)),this.quickDialogClass("Alert"),this.showQuickDialog("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.trigger(qe,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:yn}),o=t.createElement("div",{className:Tn});if(0===e.length)o=t.createElement("div",{className:yn,innerHTML:this.l10n.getConstant("emptyContainer")});else for(var l=function(e){var s=e[a.subject]||p.parent.eventSettings.fields.subject.default||p.parent.localeObj.getConstant("addTitle"),l=t.createElement("div",{className:ci,attrs:{"data-id":""+e[a.id],"data-guid":e.Guid,role:"button",tabindex:"0","aria-disabled":p.parent.eventBase.getReadonlyAttribute(e),"aria-label":p.parent.getAnnouncementString(e)}});e[a.isReadonly]&&t.addClass([l],"e-read-only");var c=void 0;if(t.isNullOrUndefined(p.parent.activeViewOptions.eventTemplate))l.appendChild(t.createElement("div",{className:Pn})),p.parent.sanitize(s,l.firstElementChild);else{var h=p.parent.element.id+"_"+p.parent.activeViewOptions.eventTemplateName+"eventTemplate";c=p.parent.getAppointmentTemplate()(e,p.parent,"eventTemplate",h,!1),t.append(c,l)}if(t.isNullOrUndefined(n)||l.setAttribute("data-group-index",n),!t.isNullOrUndefined(e[a.recurrenceRule])){var d=e[a.id]===e[a.recurrenceID]?zi:Yi;l.appendChild(t.createElement("div",{className:ct+" "+d}))}var u={data:t.extend({},e,null,!0),element:l,cancel:!1};p.parent.trigger(Le,u,function(t){if(!t.cancel){o.appendChild(l);var n=r.parent.isAdaptive||"Year"===r.parent.currentView;r.parent.eventBase.wireAppointmentEvents(l,e,n),r.parent.eventBase.applyResourceColor(l,e,"backgroundColor",i)}})},p=this,c=0,h=e;c<h.length;c++){l(h[c])}return s.appendChild(o),s},e.prototype.tapHoldEventPopup=function(e){var i=t.closest(e.target,"."+ci);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="'+rn+'"><button class="e-close" title="'+this.l10n.getConstant("close")+'"></button><div class="'+Pn+'">'+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("."+Jn);this.renderButton("e-flat e-round e-small",ct+" "+$n,!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("."+Xn);h&&this.renderButton("e-flat e-round e-small",ct+" "+Qn,p,h,this.editClick);var d=this.quickPopup.element.querySelector("."+Kn);d&&this.renderButton("e-flat e-round e-small",ct+" "+Zn,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)))){var n=t.isNullOrUndefined(e.event)?e.element:e.event.target;if(this.parent.isAdaptive){this.quickPopupHide();var r=this.parent.element.querySelector("."+Pi);t.isNullOrUndefined(r)&&(r=t.createElement("div",{className:Pi,innerHTML:'<div class="e-title">+ '+this.l10n.getConstant("newEvent")+"</div>"}));var a=t.closest(n,"."+yt+",."+vt);a&&a.appendChild(r)}else{var s=t.closest(n,"."+yt+",."+vt+",."+Ct);if(!t.isNullOrUndefined(s)&&!n.classList.contains(en)){if(this.quickPopup.relateTo===s&&this.quickPopup.element.classList.contains(wt)){var l=this.quickPopup.element.querySelector("."+Pn);l&&l.focus()}else{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:tn});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("."+Pn);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("."+Jn);d&&this.renderButton("e-flat e-round e-small",ct+" "+$n,!1,d,this.popupClose);var u=c.querySelector("."+ln);u&&this.renderButton("e-flat","",!1,u,this.detailsClick);var g=c.querySelector("."+pn);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))}}}}else this.quickPopupHide()},e.prototype.isSameEventClick=function(e){if(this.quickPopup.relateTo===t.closest(e.element,"."+ci)&&this.quickPopup.element.classList.contains(wt)){var i=this.quickPopup.element.querySelector("."+Xn);if(i&&i.focus(),!this.parent.isAdaptive){var n=this.quickPopup.element.querySelector("."+cn);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,"."+ci));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:nn});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("."+Xn),p="e-flat e-round e-small";l&&this.renderButton(p,ct+" "+Qn,s,l,this.editClick);var c=r.querySelector("."+Kn);c&&this.renderButton(p,ct+" "+Zn,o,c,this.deleteClick);var h=r.querySelector("."+Jn);h&&this.renderButton(p,ct+" "+$n,!1,h,this.popupClose);var d=r.querySelector("."+cn);d&&this.renderButton("e-flat e-primary","",s,d,this.editClick);var u=r.querySelector("."+hn);u&&this.renderButton("e-flat","",o,u,this.deleteClick),this.morePopup&&!t.closest(e.element,"."+Tn)&&this.morePopup.hide(),this.quickPopup.content=r,this.quickPopup.relateTo=this.parent.isAdaptive?document.body:t.closest(e.element,"."+ci),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:rn});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="'+an+'"><button class="'+Jn+'" title="'+this.l10n.getConstant("close")+'"></button></div>';break;case"Event":l=this.getFormattedString(i),o='<div class="'+an+'"><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="'+vi+'"><div class="'+Pn+" "+dn+'" title="'+(l.eventSubject?l.eventSubject.replaceAll('"',"'"):l.eventSubject)+'"></div></div >'}var p=t.createElement("div",{innerHTML:o});if("Event"===e){var c=p.querySelector("."+Pn);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=void 0,h=this.getResourceText(i,e.toLowerCase());switch(e){case"Cell":p=this.getFormattedString(n),l='<table class="e-popup-table"><tbody><tr><td><form class="'+Mn+'" onsubmit="return false;"><input class="'+Pn+' e-field" type="text" name="'+this.parent.eventFields.subject+'" /></form></td></tr><tr><td><div class="'+Ii+'"><div class="'+dr+" "+ct+'"></div><div class="'+on+" "+dn+'">'+p.details+"</div></div>"+(this.parent.activeViewOptions.group.resources.length>0?'<div class="e-resource"><div class="'+cr+" "+ct+' "></div><div class="'+hr+" "+dn+'"></div></div>':"")+"</td></tr></tbody></table>";break;case"Event":c=this.getFormattedString(n),l='<div class="'+Ii+'"><div class="'+dr+" "+ct+'"></div><div class="e-date-time-wrapper '+dn+'"><div class="'+on+" "+dn+'">'+c.details+"</div>",n[this.parent.eventFields.recurrenceRule]&&(l+='<div class="e-recurrence-summary '+dn+'">'+this.getRecurrenceSummary(n)+"</div>"),l+="</div></div>",n[this.parent.eventFields.location]&&(l+='<div class="'+jn+'"><div class="e-location-icon '+ct+'"></div><div class="'+Ln+" "+dn+'"></div></div>'),(n[this.parent.eventFields.startTimezone]||n[this.parent.eventFields.endTimezone])&&(l+='<div class="'+Rn+'"><div class="e-time-zone-icon '+ct+'"></div><div class="e-time-zone-details '+dn+'">'+this.getTimezone(n)+"</div></div>"),n[this.parent.eventFields.description]&&(l+='<div class="'+Fn+'"><div class="e-description-icon '+ct+'"></div><div class="'+Un+" "+dn+'"></div></div>'),this.parent.resourceCollection.length>0&&(l+='<div class="e-resource"><div class="'+cr+" "+ct+'"></div><div class="'+hr+" "+dn+'"></div></div>')}var d=t.createElement("div",{innerHTML:l});if(n[this.parent.eventFields.location]){var u=d.querySelector("."+Ln);t.isNullOrUndefined(u)||this.parent.sanitize(n[this.parent.eventFields.location],u)}if(n[this.parent.eventFields.description]){var g=d.querySelector("."+Un);t.isNullOrUndefined(g)||this.parent.sanitize(n[this.parent.eventFields.description],g)}if(h){var v=d.querySelector("."+hr);t.isNullOrUndefined(v)||this.parent.sanitize(h,v)}t.append([].slice.call(d.childNodes),r)}return r},e.prototype.getPopupFooter=function(e,i){var n=t.createElement("div",{className:sn});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="'+ln+" "+dn+'" title="'+this.l10n.getConstant("moreDetails")+'">'+this.l10n.getConstant("moreDetails")+'</button><button class="'+pn+" "+dn+'" title="'+this.l10n.getConstant("save")+'">'+this.l10n.getConstant("save")+"</button>";break;case"Event":o=this.parent.isAdaptive?"":'<button class="'+cn+" "+dn+'" title="'+this.l10n.getConstant("edit")+'">'+this.l10n.getConstant("edit")+'</button><button class="'+hn+" "+dn+'" 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=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=0,p=a;l<p.length;l++){o(p[l])}else n=a[0][r.textField].toString()}else if("event"===i){s=e.event,a=void 0;for(var c,h=this.parent.resourceBase.resourceCollection.length-1;h>=0;h--)if(a=s[this.parent.resourceBase.resourceCollection[parseInt(h.toString(),10)].field],!t.isNullOrUndefined(a)){c=this.parent.resourceBase.resourceCollection[parseInt(h.toString(),10)];break}Array.isArray(a)||(a=[a]);var d=[],u=c.dataSource;a.forEach(function(e){var t,i=H(u,c.idField,e);i>-1&&(t=u[parseInt(i.toString(),10)][c.textField]),t&&d.push(t)}),n=d.join(", ")}else{var g=e,v=t.isNullOrUndefined(g.groupIndex)?0:g.groupIndex,m=this.parent.resourceBase.lastResourceLevel[parseInt(v.toString(),10)];n=m.resourceData[m.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")+")",(N(r)-N(n))/nt>1&&(p+="&nbsp;-&nbsp;"+s+" ("+this.l10n.getConstant("allDay")+")")):p=(N(r)-N(n))/nt>=1||c>0?a+" ("+o+")&nbsp;-&nbsp;"+s+" ("+l+")":a+" ("+o+"&nbsp;-&nbsp;"+l+")",{eventSubject:i,details:p}},e.prototype.moreEventClick=function(e,i,n){var r=this;this.quickPopupHide(!0);var a=this.morePopup.element.querySelector("."+yn);a&&t.remove(a);var s=e.date.getTime().toString(),o=t.closest(e.element,"."+en+",."+yt),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("."+mn);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("."+gn).appendChild(h),t.removeClass(this.morePopup.element.querySelector("."+vn).childNodes,xt),b(e.date).getTime()===b(this.parent.getCurrentTime()).getTime()&&t.addClass(this.morePopup.element.querySelector("."+vn).childNodes,xt),!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("."+wi+' tbody tr td[data-date="'+g+'"]');else if(this.morePopup.relateTo=this.parent.element.querySelector("."+wi+' tbody tr td[data-group-index="'+d+'"][data-date="'+g+'"]'),t.isNullOrUndefined(this.morePopup.relateTo))for(var v=[].slice.call(this.parent.element.querySelectorAll("."+wi+' 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,"."+yt);this.parent.renderTemplates(function(){var t={type:"EventContainer",cancel:!1,element:r.morePopup.element,data:e};r.parent.trigger(qe,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("."+Pn);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("."+yn);e&&t.remove(e);var i,n,r=this.morePopup.element.querySelector("."+mn),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("."+gn).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("."+xn),n=this.parent.activeEventData.event;if(t.classList.contains(wn))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(bn))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(Dn))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(Sn)?this.parent.crudModule.deleteEvent(n,this.parent.currentAction):!i.classList.contains(dt)&&(t.classList.contains(En)||t.classList.contains(xn)&&!i.classList.contains(On))&&(this.parent.uiStateValues.isIgnoreOccurrence=t.classList.contains(xn),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+")&nbsp;"+this.l10n.getConstant("selectedItems");this.quickPopup.element.querySelector("."+Pn).innerHTML=r,i.length>1?t.addClass([this.quickPopup.element.querySelector("."+Qn)],nr):t.removeClass([this.quickPopup.element.querySelector("."+Qn)],nr)}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(ci))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(Fe,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("."+nn),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(qe,o,function(o){if(o.cancel)r.quickPopupHide(),r.destroyPopupButtons("quickPopup"),o.element.classList.contains(wt)&&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,"."+ft)),c=r.parent.element.querySelector("."+wi+" 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())}if(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,"."+ar))&&(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("."+rn),n=this.quickPopup.element.querySelector("."+sn);n&&n.offsetParent&&(i=this.quickPopup.element.querySelector("."+Pn))&&(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)this.quickPopup.element.style.top="0px";else if(this.quickPopup.element.querySelector("."+tn)){var e=this.quickPopup.element.querySelector("."+Pn);e&&e.focus()}else{var t=this.quickPopup.element.querySelector("."+cn);t&&t.focus();var i=this.quickPopup.element.querySelector("."+Xn);i&&i.focus()}},e.prototype.quickPopupClose=function(){this.parent.eventBase.focusElement(),this.quickPopup.relateTo="."+yt,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("."+mn).focus(),this.morePopup.refreshPosition()},e.prototype.morePopupClose=function(){var e=this.parent.element.querySelector("."+Tn);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(wt)){var i,n=this.quickPopup.element.querySelector("."+tn);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(ar);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("."+nn),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(Fe,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,"."+Vi);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="."+ar+",."+Ct+",."+vt+",."+yt+",."+ci+",.e-popup",r=this.parent.element.querySelector("."+ar);(r&&r.childElementCount>0&&!t.closest(i,n)||!t.closest(i,n))&&(this.quickPopupHide(),this.parent.removeNewEventElement());var a=this.parent.element.querySelector("."+Tr);a&&a!==i&&this.parent.allowInline&&this.parent.inlineModule.documentClick(),t.closest(i,"."+ci+",."+Ct)&&this.parent.removeNewEventElement(),t.closest(i,"."+un)||!i.classList||i.classList.contains(en)||t.closest(i,"."+wt)||t.closest(i,"."+yt)||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("."+wr))&&this.parent.eventBase.focusElement()},e.prototype.addEventListener=function(){this.parent.on(Ee,this.cellClick,this),this.parent.on(Pe,this.eventClick,this),this.parent.on(tt,this.documentClick,this),this.parent.on(Xe,this.updateMoreEventContent,this)},e.prototype.removeEventListener=function(){this.parent.off(Ee,this.cellClick),this.parent.off(Pe,this.eventClick),this.parent.off(tt,this.documentClick),this.parent.off(Xe,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].ej2_instances[0];r&&r.destroy()}if("quickPopup"===e){var a=t.element.querySelector("input."+Pn);a&&a.remove();var s=this.quickPopup.element.querySelector("form."+Mn);s&&(j(s),s.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}(),oa=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+" "+tr,target:this.getTargets(),beforeRender:this.onBeforeRender.bind(this),beforeClose:this.onTooltipClose.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("."+Bt),this.parent.eventSettings.enableTooltip&&e.push("."+ci),e.join(",")},e.prototype.onBeforeRender=function(e){if(t.isNullOrUndefined(e.target.getAttribute("data-tooltip-id"))){if(e.target.classList.contains(Bt)&&this.parent.activeViewOptions.group.resources.length>0){var i=void 0;if(this.parent.activeView.isTimelineView()){var n=parseInt(e.target.getAttribute("data-group-index"),10);i=this.parent.resourceBase.lastResourceLevel[parseInt(n.toString(),10)]}else{var r=e.target.parentNode.sectionRowIndex,a=e.target.cellIndex;i=this.parent.activeView.getColumnLevels()[parseInt(r.toString(),10)][parseInt(a.toString(),10)]}var s={resource:i.resource,resourceData:i.resourceData},o=t.createElement("div"),l=this.parent.element.id+"_headerTooltipTemplate",p=[].slice.call(this.parent.getHeaderTooltipTemplate()(s,this.parent,"headerTooltipTemplate",l,!1));return t.append(p,o),this.setContent(o),void this.parent.renderTemplates()}var c=this.parent.eventBase.getEventByGuid(e.target.getAttribute("data-guid"));if(!t.isNullOrUndefined(c)){if(t.isNullOrUndefined(this.parent.eventSettings.tooltipTemplate)){var h=this.parent.globalize,d=this.parent.eventFields,u=new Date(""+c[d.startTime]),g=new Date(""+c[d.endTime]);g=0===g.getHours()&&0===g.getMinutes()?new Date(g.setMilliseconds(-1e3)):g;var v=b(new Date(""+u)),m=b(new Date(""+g)),f=c[d.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),y=t.isNullOrUndefined(c[d.location])?"":c[d.location],T="",w="",D="";T=h.formatDate(u,{type:"date",skeleton:"MMMd",calendar:this.parent.getCalendarMode()}),w=h.formatDate(u,{type:"date",skeleton:"medium",calendar:this.parent.getCalendarMode()}),D=h.formatDate(g,{type:"date",skeleton:"medium",calendar:this.parent.getCalendarMode()}),T=U(T,"single"),w=U(w,"single"),D=U(D,"single");var C=this.parent.getTimeString(u),S=this.parent.getTimeString(g),O='<div><div class="e-subject">'+f+'</div><div class="e-location">'+y+'</div><div class="e-details">'+(v.getTime()===m.getTime()?U(h.formatDate(u,{type:"date",skeleton:"long",calendar:this.parent.getCalendarMode()}),"single"):v.getFullYear()===m.getFullYear()?T+" - "+D:w+" - "+D)+'</div><div class="e-all-day">'+(c[d.isAllDay]?this.parent.localeObj.getConstant("allDay"):C+" - "+S)+"</div></div>";this.setContent(t.initializeCSPTemplate(function(){return O}))}else{o=t.createElement("div"),l=this.parent.element.id+"_tooltipTemplate",p=[].slice.call(this.parent.getEventTooltipTemplate()(c,this.parent,"tooltipTemplate",l,!1));t.append(p,o),this.setContent(o)}this.parent.renderTemplates()}}},e.prototype.onTooltipClose=function(e){e.element&&(t.removeClass([e.element],wt),t.addClass([e.element],"e-popup-close")),this.parent.resetTemplates(["tooltipTemplate","headerTooltipTemplate"])},e.prototype.setContent=function(e){this.tooltipObj.setProperties({content:e},!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}(),la=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)}}(),pa=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},ca="e-input-wrapper",ha="e-input-wrapper-side",da="e-repeat-element",ua="e-repeat-interval",ga="e-days",va="e-non-week",ma="e-year-expander",fa="e-year-expander-element",ya="e-month-expander",Ta="e-month-expander-element",wa="e-month-expander-checkbox-wrapper",Da="e-form-left",ba="e-form-right",Ca="e-month-day",Sa="e-month-expander-wrapper",Oa="e-end-on-element",Ea="e-end-on-date",xa="e-end-on-count",Va="e-recurrence-count",Aa="e-hide-recurrence-element",Ia="e-primary",Ma="e-recurrence-table",ka="e-repeat-content",Ra="monthly",Ha={none:"",daily:"days",weekly:"weeks",monthly:"months",yearly:"years"},Pa={sun:"SU",mon:"MO",tue:"TU",wed:"WE",thu:"TH",fri:"FR",sat:"SA"},ja=[ga,va,"e-end-on","e-interval",ma,ya],La=[va],Na=[ga,ma],qa=[ga],Fa=[ga,va,ma,ya],Ua=[Ea,xa],Ba=[Ea],Wa=[xa],za=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 la(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=Te(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(),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",Ia])})},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",Ia])},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:Pa[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,[Da],[ba]):t.classList(n,[ba],[Da]),e){case"none":ja.forEach(function(e){return t.addClass([i.element.querySelector("."+e)],Aa)});break;case"weekly":La.forEach(function(e){return t.addClass([i.element.querySelector("."+e)],Aa)});break;case Ra:Na.forEach(function(e){return t.addClass([i.element.querySelector("."+e)],Aa)});break;case"yearly":qa.forEach(function(e){return t.addClass([i.element.querySelector("."+e)],Aa)});break;case"daily":Fa.forEach(function(e){return t.addClass([i.element.querySelector("."+e)],Aa)})}},i.prototype.updateEndOnForm=function(e){var i=this;switch(this.endType.setProperties({value:e}),e){case"never":Ua.forEach(function(e){return t.addClass([i.element.querySelector("."+e)],Aa)});break;case"until":Wa.forEach(function(e){return t.addClass([i.element.querySelector("."+e)],Aa)});break;case"count":Ba.forEach(function(e){return t.addClass([i.element.querySelector("."+e)],Aa)})}},i.prototype.freshOnEndForm=function(){var e=this;Ua.forEach(function(i){var n=e.element.querySelector("."+i);n&&t.removeClass([n],Aa)})},i.prototype.showFormElement=function(){var e=this;ja.forEach(function(i){var n=e.element.querySelector("."+i);n&&t.removeClass([n],Aa)})},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("."+ka).innerHTML=t.localeObj.getConstant(Ha[i.value]),t.showFormElement(),t.updateForm(i.value),t.resetFormValues(),t.triggerChangeEvent()}}),this.repeatType.appendTo(this.element.querySelector("."+da)),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("."+Oa));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("."+fa))},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(ua)?(i.value=1,i.dataBind()):i.element.classList.contains(Va)&&(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(ua)?1:n.element.classList.contains(Va)?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."+Ia)),a=n.target;a.classList.contains(Ia)?r.length>1&&(t.removeClass([a],Ia),i.triggerChangeEvent()):(t.addClass([a],Ia),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("."+Ta)),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("."+Sa)),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("."+Va)),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("."+Ca)),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("."+ua))},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){var a="days.stand-alone.";i=t.getValue(a+e,t.getDefaultDateObject(this.getCalendarMode()))}else{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:Pa[""+l]})}return r},i.prototype.getMonthData=function(){var e,i=[];if("en"===this.locale||"en-US"===this.locale){var n="months.stand-alone.wide";e=t.getValue(n,t.getDefaultDateObject(this.getCalendarMode()))}else{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="'+ca+" "+Da+'"><input type="text" tabindex="0" class="'+da+'"label="'+da.substr(2)+'" /></div><div class="'+ca+" e-interval "+ba+'"><table class="'+Ma+' e-repeat-content-wrapper" role="none"><tr><td><input type="text" tabindex="0" id="'+this.element.id+"_"+ua+'" class="'+ua+'"title="'+this.localeObj.getConstant("repeatEvery")+'" /></td><td><span class="'+ka+'"></span></td></tr></table></div><div class="'+ha+" "+ga+" "+Da+'"><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="'+ha+" "+va+" "+Da+'"><div class=e-month-expander-label>'+this.localeObj.getConstant("on")+'</div><div class="'+ma+'"><input class="'+fa+'" type="text" tabindex="0" title="'+this.localeObj.getConstant("yearExpander")+'"/></div><div class="'+ya+'"><table class="'+Ma+' e-month-expand-wrapper" role="none"><tr><td><div class="'+ca+" "+wa+'"><input class="'+Ta+'"title="'+this.localeObj.getConstant("monthExpander")+'" type="radio"></div></td><td colspan="2"><div class="'+ca+' e-monthday-element"><input type="text" tabindex="0" id="'+this.element.id+"_"+Ca+'" class="'+Ca+'"title="'+this.localeObj.getConstant("on")+'" /></div></td></tr><tr><td><div class="'+ca+" "+wa+'" style="min-width: 30px;margin-bottom:18px;"><input class="'+Sa+'"title="'+this.localeObj.getConstant("monthExpander")+'" type="radio"></div></td><td><div class="'+ca+' e-week-position" ><input type="text" tabindex="0" class="e-month-pos"title="'+this.localeObj.getConstant("monthPosition")+'" /></div></td><td><div class="'+ca+' 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="'+ha+" e-end-on "+ba+'"><div class="'+ca+' e-end-on-left"><input type="text" tabindex="0" class="'+Oa+'"title="'+this.localeObj.getConstant("end")+'" /></div><div class="'+ca+" "+Ea+'" ><input type="text" tabindex="0" class="e-until-date"title="'+this.localeObj.getConstant("until")+'" /></div><div class="'+ca+" "+xa+'"><input type="text" tabindex="0" id="'+this.element.id+"_"+Va+'" class="'+Va+'"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."+Ia)),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(Pa);e<t.length;e++){var i=t[e];if(Pa[""+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 Ra:this.updateMonthUI()}},i.prototype.getUntilData=function(){if(!this.untilDateObj.value)return"";return"UNTIL="+we(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 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 Ra: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){this.renderStatus=!1,this.ruleObject=ve(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(Ra,i,t),this.updateUI(Ra,i);break;case"YEARLY":this.startState("yearly",i,t),this.updateUI("yearly",i)}this.renderStatus=!0,this.triggerChangeEvent()}else this.repeatType.setProperties({value:"none"})},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({minDate:this.minDate});break;case"maxDate":this.untilDateObj.setProperties({maxDate:this.maxDate});break;case"value":this.getRecurrenceRule()!==this.value&&this.setRecurrenceRule(this.value);break;case"calendarMode":this.calendarMode=e.calendarMode,this.calendarUtil=Te(e.calendarMode);break;case"locale":case"frequencies":case"firstDayOfWeek":case"endTypes":this.refresh();break;case"dateFormat":this.untilDateObj.setProperties({format:e.dateFormat})}}},pa([t.Property(["none","daily","weekly","monthly","yearly"])],i.prototype,"frequencies",void 0),pa([t.Property(["never","until","count"])],i.prototype,"endTypes",void 0),pa([t.Property(0)],i.prototype,"firstDayOfWeek",void 0),pa([t.Property(new Date)],i.prototype,"startDate",void 0),pa([t.Property()],i.prototype,"dateFormat",void 0),pa([t.Property("Gregorian")],i.prototype,"calendarMode",void 0),pa([t.Property()],i.prototype,"cssClass",void 0),pa([t.Property()],i.prototype,"value",void 0),pa([t.Property(new Date(1900,0,1))],i.prototype,"minDate",void 0),pa([t.Property(new Date(2099,11,31))],i.prototype,"maxDate",void 0),pa([t.Property(0)],i.prototype,"selectedType",void 0),pa([t.Event()],i.prototype,"change",void 0),i=pa([t.NotifyPropertyChanges],i)}(t.Component),Ya="e-field",_a="e-recurrence-container",Ga="e-hide",Xa=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:In,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=In+" "+lt,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],In+"-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:hn,disabled:!this.parent.eventSettings.allowDeleting||this.parent.readonly},click:this.eventDelete.bind(this)},{buttonModel:{content:this.l10n.getConstant("saveButton"),cssClass:"e-primary "+_n,isPrimary:!0,disabled:!this.parent.eventSettings.allowAdding||this.parent.readonly},click:this.eventSave.bind(this)},{buttonModel:{cssClass:Yn,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}switch(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.renderFormElements(this.element.querySelector(".e-schedule-form"),e),!this.parent.isAdaptive&&t.isNullOrUndefined(this.parent.editorTemplate)&&t.removeClass([this.dialogObject.element.querySelector(".e-recurrenceeditor")],dt),this.recurrenceEditor&&(this.recurrenceEditor.firstDayOfWeek=this.parent.activeViewOptions.firstDayOfWeek),i){case"Add":this.onCellDetailsUpdate(e,r);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")],dt),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(_n);s&&(s.disabled=!(this.cellClickAction?this.parent.eventSettings.allowAdding:this.parent.eventSettings.allowEditing),s.dataBind());var o=this.getInstance(hn);o&&(o.disabled=!this.parent.eventSettings.allowDeleting,o.dataBind());var l=new a.Deferred;return this.parent.trigger(qe,r,function(r){if(e.cancel=r.cancel,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(Nn),s=i.getInstance(qn);s.value=new Date(a.value.getTime()+rt*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(Fe,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:Mn,attrs:{onsubmit:"return false;"}});return this.renderFormElements(i),e.appendChild(i),e},e.prototype.renderFormElements=function(e,i){var n=this;if(t.isNullOrUndefined(this.parent.editorTemplate))e.appendChild(this.getDefaultEventWindowContent());else{if(i){this.fieldValidator&&(this.fieldValidator.destroy(),this.fieldValidator=null),this.recurrenceEditor&&(this.recurrenceEditor.destroy(),this.recurrenceEditor=null),this.destroyComponents();for(var r=0,a=[].slice.call(e.children);r<a.length;r++){var s=a[r];t.remove(s)}this.parent.resetTemplates(["editorTemplate"])}var o=this.parent.element.id+"_editorTemplate",l=[].slice.call(this.parent.getEditorTemplate()(i||{},this.parent,"editorTemplate",o,!1));t.append(l,e),this.parent.renderTemplates(function(){n.element&&(n.applyFormValidation(),n.eventCrudData&&(n.showDetails(n.eventCrudData),n.eventCrudData=null))})}},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(Pn)),i.appendChild(this.renderTextBox(jn));var n=this.createDivElement("e-start-end-row");e.appendChild(n),n.appendChild(this.renderDateTimePicker(Nn,this.onTimeChange.bind(this))),n.appendChild(this.renderDateTimePicker(qn));var r=this.createDivElement("e-all-day-time-zone-row");e.appendChild(r),r.appendChild(this.renderCheckBox(kn)),r.appendChild(this.renderCheckBox(Rn));var a=this.createDivElement(Bn);e.appendChild(a),a.appendChild(this.renderDropDown(Wn)),a.appendChild(this.renderDropDown(zn));var o=this.createDivElement("e-repeat-parent-row");e.appendChild(o);var l=this.renderCheckBox(Hn),p=t.createElement("span",{className:_a}),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(Fn+"-row");v.appendChild(this.renderTextBox(Fn)),e.appendChild(v);var m=t.createElement("button",{attrs:{type:"hidden",title:"submit",style:"display:none"}});return 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+" "+Ya,a);n.appendChild(s);return 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(Nn);if(e.element.parentElement.classList.contains("e-input-focus")){var i=this.getInstance(qn),n=0;this.cellClickAction?(n=rt*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=e.field,n="e-"+i,r=e.title,a=this.createDivElement(n+"-container e-resources"),s=this.createInputElement(n+" "+Ya,i);a.appendChild(s);var o=function(i){return t.SanitizeHtmlHelper.sanitize('<div class="e-resource-template"><div class="e-resource-color" style="background-color:'+i[e.colorField]+'"></div><div class="e-resource-text">'+i[e.textField]+"</div></div>")};if(t.initializeCSPTemplate(o,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:o,fields:{text:e.textField,value:e.idField},htmlAttributes:{name:i},floatLabelType:"Always",placeholder:r,popupHeight:"230px",popupWidth:"447px",mode:"Box"}).appendTo(s)}else{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:i},floatLabelType:"Always",placeholder:r,popupHeight:"230px",popupWidth:"447px",itemTemplate:o}).appendTo(s)}return a},e.prototype.renderDropDown=function(e){var t=this,i=this.getFieldName(e),n=this.createDivElement(e+"-container"),r=this.createInputElement(e+" "+Ya,i);n.appendChild(r);return 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=function(n){var a=i[r+1],o=a.dataSource.filter(function(t){return t[a.groupIDField]===e.value[parseInt(n.toString(),10)]})[0],p=t.isNullOrUndefined(o)?null:o[i[r+1].groupIDField],c=l.filterDatasource(r,p);s=s.concat(c)},l=this,p=0;p<e.value.length;p++)o(p);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(Wn),i=this.getInstance(zn);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+" "+Ya,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===Fn?"textarea":"input",r=this.createInputElement(e+" "+Ya,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 Pn:t=this.fields.subject;break;case jn:t=this.fields.location;break;case Nn:t=this.fields.startTime;break;case qn:t=this.fields.endTime;break;case Fn:t=this.fields.description;break;case kn:t=this.fields.isAllDay;break;case Wn:t=this.fields.startTimezone;break;case zn:t=this.fields.endTimezone;break;case Rn:t="Timezone";break;case Hn:t="Repeat"}return t},e.prototype.getFieldLabel=function(e){var t="";switch(e){case Pn:t=this.parent.editorTitles.subject;break;case jn:t=this.parent.editorTitles.location;break;case Fn:t=this.parent.editorTitles.description;break;case Nn:t=this.parent.editorTitles.startTime;break;case qn:t=this.parent.editorTitles.endTime;break;case Wn:t=this.parent.editorTitles.startTimezone;break;case zn:t=this.parent.editorTitles.endTimezone;break;case Hn:t=this.parent.editorTitles.recurrenceRule;break;case kn:t=this.parent.editorTitles.isAllDay;break;case Rn: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(kn)?this.onAllDayChange(e.checked):i.classList.contains(Rn)?this.timezoneChangeStyle(e.checked):i.classList.contains(Hn)&&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("."+_a);t.addClass([i],Ga)}},e.prototype.repeatSaveDialog=function(){this.repeatRule=this.recurrenceEditor.getRecurrenceRule();var e=this.element.querySelector("."+_a);this.recurrenceEditor.getRecurrenceRule()?t.removeClass([e],Ga):(t.addClass([e],Ga),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("."+Mn).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("."+hn);if(n&&t.addClass([n],dt),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("."+_a);e[this.fields.recurrenceRule]||i?(t.removeClass([r],Ga),this.repeatStatus.setProperties({checked:!0})):(t.addClass([r],Ga),this.repeatStatus.setProperties({checked:!1})),this.updateRepeatLabel(this.repeatRule)}else{var a=this.element.querySelector("."+_n);this.disableButton(a,!1)}this.dialogObject.show()}},e.prototype.convertToEventData=function(e,t){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("."+Mn);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=new aa,this.fieldValidator.renderFormValidator(e,n,this.element,this.parent.locale)}},e.prototype.showDetails=function(e){this.eventData=this.eventCrudData?this.eventData:e;var i=t.extend({},e,null,!0),n=this.getFormElements(In);if(this.parent.isReact&&n.length<1&&!this.cellClickAction)this.eventCrudData=i;else{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(Rn+"."+Ya);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");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(Nn),r=this.getInstance(qn),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"),Gn),t.addClass([a],dt),this.element.querySelector("."+Bn)&&t.removeClass([this.element.querySelector("."+Bn)],ht),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"),Gn),t.removeClass([a],dt),this.element.querySelector(".e-checkbox-wrapper .e-time-zone").checked&&t.addClass([this.element.querySelector("."+Bn)],ht),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,t,i){var n,r;if(e)if(n=b(new Date(this.eventWindowTime.startTime.getTime())),this.parent.activeCellsData.isAllDay){var a=O(new Date(this.eventWindowTime.endTime.getTime()),-1).getTime();r=+this.eventWindowTime.startTime>a?this.eventWindowTime.endTime:new Date(a)}else r=b(new Date(this.eventWindowTime.endTime.getTime()));else{var s=this.parent.activeCellsData.startTime;if((n=new Date(this.eventWindowTime.startTime.getTime())).setHours(s.getHours(),s.getMinutes(),s.getSeconds()),this.parent.activeCellsData.isAllDay){var o=this.parent.getStartEndTime(this.parent.workHours.start);n.setHours(o.getHours(),o.getMinutes(),o.getSeconds()),(r=new Date(n.getTime())).setMilliseconds(rt*this.getSlotDuration())}else(r=new Date(n.getTime())).setMilliseconds(this.parent.activeCellsData.endTime.getTime()-this.parent.activeCellsData.startTime.getTime())}this.eventWindowTime={startTime:new Date(n.getTime()),endTime:new Date(r.getTime())},t.value=n,i.value=r,t.dataBind(),i.dataBind()},e.prototype.getFormat=function(e){return"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("."+hn)],dt),t.isNullOrUndefined(this.parent.editorHeaderTemplate)&&(this.element.querySelector(".e-title-text").innerHTML=this.l10n.getConstant("editEvent")),this.element.querySelector("."+Mn).setAttribute("data-id",e[this.fields.id].toString()),t.isNullOrUndefined(this.parent.editorTemplate)){e=t.extend({},e,null,!0);var i=this.getInstance(Rn+"."+Ya),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("."+_a);e[this.fields.recurrenceRule]?(t.removeClass([r],Ga),this.repeatStatus.setProperties({checked:!0})):(t.addClass([r],Ga),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],gr):t.removeClass([s],gr))}else{var o=this.element.querySelector("."+_n),l=this.element.querySelector("."+hn);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 za({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=this.parent.maxDate,n.min=this.parent.minDate,n.max=this.parent.maxDate,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){this.isEnterKey?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("."+Bn),n=this.parent.tzModule.getLocalTimezoneName();if(e){t.addClass([i],ht);var r=this.getInstance(Wn),a=this.getInstance(zn),s=r.dataSource;if(!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],ht)},e.prototype.resetFormFields=function(){for(var e=0,i=this.getFormElements(In);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)this.isEnterKey=!1;else{var i=this.element.querySelector("."+Mn);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(In));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))this.parent.currentAction="Add",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;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;if(!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]}return 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(var 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(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=function(p){var h=t.extend({},e,null,!0);h[c.fields.id]=c.parent.eventBase.getEventMaxID();var d=[],u=function(){if("Save"===i&&p===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(p),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(p),l.push(h)};if(c.parent.activeViewOptions.group.byGroupID&&!t.isNullOrUndefined(o)){var g=a.dataSource,v=c.parent.resourceCollection,m=void 0;if((m=v.length>1?H(g,a.idField,s[parseInt(p.toString(),10)],h,v):H(g,a.idField,s[parseInt(p.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(p.toString(),10)]}).filter(function(e){return e.resourceData[a.groupIDField]===f})[0].groupOrder,T=0;T<c.parent.resourceBase.resourceCollection.length;T++){var w=c.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<c.parent.resourceBase.resourceCollection.length-1;m++){w=c.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(p.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(p.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(p.toString(),10)],u()}},c=this,h=0;h<s.length;h++){var d=p(h);if("object"==typeof d)return d.value}if(l.length>0){for(var u=0,g=l;u<g.length;u++){var v=g[u];v[this.fields.recurrenceException]=null,v[this.fields.recurrenceID]=null}this.parent.addEvent(l)}},e.prototype.getEventIdFromForm=function(){return this.element.querySelector("."+Mn).getAttribute("data-id")},e.prototype.getFormElements=function(e){return e===In?[].slice.call(this.element.querySelectorAll("."+Ya)):[].slice.call(this.parent.element.querySelectorAll("."+e+" ."+Ya))},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:"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(Nn)?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")){var i;(i=e.ej2_instances[0]).checked=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 if(e.classList.contains("e-dropdownlist")){(t=e.ej2_instances[0]).value=null,t.dataBind()}else if(e.classList.contains("e-multiselect")){(t=e.ej2_instances[0]).value=[],t.dataBind()}else if(e.classList.contains("e-checkbox")){(t=e.ej2_instances[0]).checked=!1,t.dataBind()}else"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)this.isEnterKey=!1;else{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(In);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(In);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}(),Qa=function(){function e(e){this.translateY=0,this.itemSize=60,this.bufferCount=3,this.renderedLength=0,this.averageRowHeight=0,this.startIndex=0,this.parent=e,this.addEventListener()}return e.prototype.addEventListener=function(){!this.parent||this.parent&&this.parent.isDestroyed||this.parent.on(Je,this.virtualScrolling,this)},e.prototype.removeEventListener=function(){!this.parent||this.parent&&this.parent.isDestroyed||this.parent.off(Je,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:Di});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("."+Di),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("."+ft);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("."+wi);n.scrollHeight-n.scrollTop<n.offsetHeight*this.bufferCount&&(e.style.height=parseInt(e.style.height)+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("."+jt),n=this.parent.element.querySelector("."+wi),r=this.parent.element.querySelector("."+Rt);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(){this.isHorizontalScroll?this.itemSize=d(this.parent.activeView.element,yt)||this.itemSize:this.itemSize=h(this.parent.activeView.element,yt)||this.itemSize},e.prototype.refreshLayout=function(){var e=this.parent.uiStateValues.scheduleHeight;this.parent.uiStateValues.scheduleHeight=this.parent.element.offsetHeight;var t=this.renderedLength;if(this.parent.uiStateValues.scheduleHeight!==e){t<this.getRenderedCount()&&(this.isRemoteRefresh=!0);var i=this.parent.element.querySelector("."+jt),n=this.parent.element.querySelector("."+wi),r=this.parent.element.querySelector("."+Rt),a=parseInt(i.querySelector("tbody td").getAttribute("data-group-index"),10),s=a+this.renderedLength;a=s>this.parent.resourceBase.expandedResources.length?this.parent.resourceBase.expandedResources.length-this.renderedLength:a,this.parent.resourceBase.renderedResources=this.parent.resourceBase.expandedResources.slice(a,s),this.parent.resourceBase.renderedResources.length>0&&this.updateContent(i,n,r,this.parent.resourceBase.renderedResources)}},e.prototype.renderEvents=function(){this.setTabIndex();var e=this.triggerScrollEvent(_e);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(Ke,{}),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("."+wi);if(this.isHorizontalScroll)this.horizontalScrolling(i);else{var n=this.parent.element.querySelector("."+jt),r=this.parent.element.querySelector("."+Rt),a=this.parent.element.querySelector("."+Gt),s=this.parent.element.querySelector("."+ft);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(i.scrollTop-this.translateY<0?p=this.upScroll(i,o):i.scrollTop-this.translateY>l&&(p=this.downScroll(i,o)),!t.isNullOrUndefined(p)&&p.length>0){this.triggerScrollEvent(Ye);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(Ye);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){e===Ye?i.parent.showSpinner():e===_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}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=~~(Math.abs(e.scrollLeft)/this.itemSize)+this.renderedLength;return i=i>t.length-1?t.length-1:i,this.getCollection(i-this.renderedLength,i)},e.prototype.getCollection=function(e,t){this.translateY=e*this.itemSize;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],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(Bt)&&(this.isResourceCell=!0,this.parent.element.focus());for(var s=0;s<a;s++)t.remove(e.querySelector("tbody tr")),t.remove(i.querySelector("tbody tr")),t.remove(n.querySelector("div"));this.parent.resourceBase.renderedResources=r;var o=this.parent.resourceBase.getContentRows(r,!0),l=this.parent.activeView.getContentRows(),p=this.parent.activeView.getEventRows(r.length);t.append(o,e.querySelector("tbody")),t.append(l,i.querySelector("tbody")),t.append(p,n)},e.prototype.updateHorizontalContent=function(e,i){this.parent.resourceBase.expandedResources=i;var n=this.parent.getSelectedCells();this.focusedEle=n[n.length-1]||this.focusedEle;for(var r=e.querySelectorAll("tbody tr").length,a=0;a<r;a++)t.remove(e.querySelector("tbody tr"));if("Month"===this.parent.currentView){this.parent.activeViewOptions.group.byDate?this.parent.activeView.colLevels[0]=i:this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-2]=i;var s=this.parent.activeView.getContentRows();t.append(s,e.querySelector("tbody"))}else{var o=[].slice.call(e.querySelector("colgroup").children);for(a=0;a<o.length;a++)t.remove(o[parseInt(a.toString(),10)]);this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-1]=i;s=this.parent.activeView.getContentRows();var l=e.querySelector("table"),p=e.querySelector("thead"),c=e.querySelector("colgroup");i.forEach(function(){c.appendChild(t.createElement("col"))}),p.appendChild(this.parent.eventBase.createEventWrapper("",this.startIndex>0?this.startIndex:0)),this.parent.activeViewOptions.timeScale.enable&&p.appendChild(this.parent.eventBase.createEventWrapper("timeIndicator")),t.prepend([p],l),t.append(s,e.querySelector("tbody"))}},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("."+yt+'[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("."+jt),t=[].slice.call(this.parent.element.querySelectorAll("."+Bt));t&&e&&t.forEach(function(t){t.getBoundingClientRect().top>=e.getBoundingClientRect().top&&t.setAttribute("tabindex","0")});var i=this.parent.element.querySelector("."+Bt+'[tabindex="0"]');this.isResourceCell&&i&&(i.focus(),this.isResourceCell=!1)},e.prototype.destroy=function(){this.removeEventListener(),this.focusedEle=null},e}(),Ka=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 Qa(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(Vt),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 oa(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],fr):this.parent.element.classList.contains(fr)&&t.removeClass([this.parent.element],fr),this.parent.headerModule.updateDateRange(),this.parent.headerModule.updateHeaderItems("remove"))},e.prototype.updateLabelText=function(e){var t=this.parent.activeView.getLabelText(e);this.parent.element.setAttribute("role","application"),this.parent.element.setAttribute("aria-label",t)},e}(),Za=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)}}(),Ja=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},$a=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Za(i,e),Ja([t.Property(!0)],i.prototype,"highlight",void 0),Ja([t.Property("09:00")],i.prototype,"start",void 0),Ja([t.Property("18:00")],i.prototype,"end",void 0),i}(t.ChildProperty),es=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)}}(),ts=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},is=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return es(i,e),ts([t.Property(!0)],i.prototype,"enable",void 0),ts([t.Property(60)],i.prototype,"interval",void 0),ts([t.Property(2)],i.prototype,"slotCount",void 0),ts([t.Property()],i.prototype,"minorSlotTemplate",void 0),ts([t.Property()],i.prototype,"majorSlotTemplate",void 0),i}(t.ChildProperty),ns=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)}}(),rs=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},as=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ns(i,e),rs([t.Property("Both")],i.prototype,"templateType",void 0),rs([t.Property()],i.prototype,"header",void 0),rs([t.Property()],i.prototype,"content",void 0),rs([t.Property()],i.prototype,"footer",void 0),i}(t.ChildProperty),ss=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)}}(),os=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},ls=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ss(i,e),os([t.Property()],i.prototype,"option",void 0),os([t.Property()],i.prototype,"template",void 0),i}(t.ChildProperty),ps=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(){if(this.parent.eventSettings.query){return this.parent.eventSettings.query.clone().fromTable}return 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(Ne,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&&i.parent.notify(Ge,{})})}})},e.prototype.dataManagerFailure=function(e){var t=this;!this.parent||this.parent&&this.parent.isDestroyed||this.parent.trigger(ke,{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)this.parent.notify(Xe,{processedData:i?this.parent.eventBase.processData(i):this.parent.eventsProcessed});else{var s=this.parent.eventsData||[],o=this.parent.blockData||[],l=s.concat(o);this.parent.notify(Xe,{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.element.style.display="none"),this.parent.resizeModule&&this.parent.resizeModule.actionObj&&this.parent.resizeModule.actionObj.element&&(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=function(i){a.crudObj.isCrudAction=!("eventRemoved"===e.requestType&&!t.isNullOrUndefined(i.parent));var n=a.parent.eventBase.getGroupIndexFromEvent(i);n>-1&&0===a.parent.crudModule.crudObj.sourceEvent.filter(function(e){return e.groupIndex===n}).length&&a.crudObj.isCrudAction&&a.crudObj.sourceEvent.push(a.parent.resourceBase.lastResourceLevel[parseInt(n.toString(),10)])},a=this,s=0,o=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;s<o.length;s++){r(o[s])}this.crudObj.targetEvent=this.crudObj.sourceEvent}this.parent.dataModule.dataManager.dataSource.offline?this.parent.trigger(Me,n,function(e){e.cancel||i.refreshDataManager()}):e.promise.then(function(){!i.parent||i.parent&&i.parent.isDestroyed||i.parent.trigger(Me,n,function(e){e.cancel||i.refreshDataManager()})}).catch(function(e){!i.parent||i.parent&&i.parent.isDestroyed||i.parent.trigger(ke,{error:e})})},e.prototype.addEvent=function(e){var i=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);var n=e instanceof Array?e:[e];if(0===n.length)return;var r={requestType:"eventCreate",cancel:!1,data:n,addedRecords:n,changedRecords:[],deletedRecords:[]};this.parent.trigger(Ie,r,function(e){if(!e.cancel){var n=i.parent.eventFields,r={addedRecords:[],changedRecords:[],deletedRecords:[]},a=void 0;if(e.addedRecords instanceof Array){for(var s=0,o=e.addedRecords;s<o.length;s++){var l=o[s];l=i.parent.eventBase.updateEventDateTime(l);var p=t.extend({},i.parent.eventBase.processTimezone(l,!0),null,!0);r.addedRecords.push(p)}a=i.parent.dataModule.dataManager.saveChanges(r,n.id,i.getTable(),i.getQuery())}else{var c=i.parent.eventBase.processTimezone(e.addedRecords,!0);r.addedRecords.push(c),a=i.parent.dataModule.dataManager.insert(c,i.getTable(),i.getQuery())}var h={requestType:"eventCreated",cancel:!1,data:e.addedRecords,promise:a,editParams:r};i.refreshData(h)}})}},e.prototype.saveEvent=function(e,i){var n=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 r=e instanceof Array?e:[e];if(0===r.length)return;if(this.parent.currentAction=i,i)switch(i){case"Save":this.processSave(e);break;case"EditOccurrence":this.processOccurrences(e,i);break;case"EditFollowingEvents":this.processFollowSeries(e,i);break;case"EditSeries":this.processEntireSeries(e,i)}else{var a={requestType:"eventChange",cancel:!1,data:e,addedRecords:[],changedRecords:r,deletedRecords:[]};this.parent.trigger(Ie,a,function(e){if(!e.cancel){var i=void 0,r=n.parent.eventFields,a={addedRecords:[],changedRecords:[],deletedRecords:[]};if(e.changedRecords instanceof Array){for(var s=0,o=e.changedRecords;s<o.length;s++){var l=o[s];l=n.parent.eventBase.updateEventDateTime(l);var p=t.extend({},n.parent.eventBase.processTimezone(l,!0),null,!0);a.changedRecords.push(p)}i=n.parent.dataModule.dataManager.saveChanges(a,r.id,n.getTable(),n.getQuery())}else{var c=n.parent.eventBase.processTimezone(e.changedRecords,!0);a.changedRecords.push(c),i=n.parent.dataModule.dataManager.update(r.id,c,n.getTable(),n.getQuery())}var h=t.extend({},e.changedRecords[e.changedRecords.length-1],null,!0);n.parent.eventBase.selectWorkCellByTime([n.parent.eventBase.processTimezone(h)]);var d={requestType:"eventChanged",cancel:!1,data:e.changedRecords,promise:i,editParams:a};n.refreshData(d)}})}}},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(Ie,r,function(e){if(!e.cancel){var t=void 0,n=i.parent.eventFields,r={addedRecords:[],changedRecords:[],deletedRecords:[]};e.deletedRecords.length>1?(r.deletedRecords=r.deletedRecords.concat(e.deletedRecords),t=i.parent.dataModule.dataManager.saveChanges(r,n.id,i.getTable(),i.getQuery())):(r.deletedRecords.push(e.deletedRecords[0]),t=i.parent.dataModule.dataManager.remove(n.id,e.deletedRecords[0],i.getTable(),i.getQuery())),i.parent.eventBase.selectWorkCellByTime(e.deletedRecords);var a={requestType:"eventRemoved",cancel:!1,data:e.deletedRecords,promise:t,editParams:r};i.refreshData(a)}})}}},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(Ie,c,function(e){if(!e.cancel){for(var s=n.parent.eventFields,o={addedRecords:[],changedRecords:[],deletedRecords:[]},l=r instanceof Array?r:[r],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]=we(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(p),a=!0)}},c=0,h=e.changedRecords.length;c<h;c++)p(c);var d=n.parent.dataModule.dataManager.saveChanges(o,s.id,n.getTable(),n.getQuery()),u=t.extend({},e.changedRecords[e.changedRecords.length-1],null,!0);n.parent.eventBase.selectWorkCellByTime("EditOccurrence"===i?[n.parent.eventBase.processTimezone(u)]:[u]);var g={requestType:"EditOccurrence"===i?"eventChanged":"eventRemoved",cancel:!1,data:a?e.deletedRecords:e.changedRecords,promise:d,editParams:o};n.refreshData(g)}})},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(Ie,p,function(e){if(!e.cancel){for(var a=n.parent.eventFields,s={addedRecords:[],changedRecords:[],deletedRecords:[]},o=r instanceof Array?r:[r],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)}},p=0,c=e.changedRecords.length;p<c;p++)l(p);var h=n.parent.dataModule.dataManager.saveChanges(s,a.id,n.getTable(),n.getQuery()),d=t.extend({},e.changedRecords[e.changedRecords.length-1],null,!0);n.parent.eventBase.selectWorkCellByTime("EditFollowingEvents"===i?[n.parent.eventBase.processTimezone(d)]:[d]);var u={requestType:"EditFollowingEvents"===i?"eventChanged":"eventRemoved",cancel:!1,data:e.changedRecords,promise:h,editParams:s};n.refreshData(u)}})},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:p,deletedRecords:[]};c.data=r,this.parent.trigger(Ie,c,function(e){if(!e.cancel){for(var s=n.parent.eventFields,o={addedRecords:[],changedRecords:[],deletedRecords:[]},l=r instanceof Array?r:[r],p=function(t,r){var p=e.changedRecords[parseInt(t.toString(),10)],c=l[parseInt(t.toString(),10)],h=n.parent.eventBase.getEventCollections(c),d=h.follow.concat(h.occurrence);switch(i){case"EditSeries":if(p[s.id]=c[s.id],p[s.recurrenceID]=null,p[s.followingID]=null,n.parent.uiStateValues.isIgnoreOccurrence&&p[s.recurrenceException]){var u=n.parent.eventsData.filter(function(e){return e[s.id]===p[s.id]});u.length>0&&(p[s.recurrenceRule]=u[0][s.recurrenceRule])}else p[s.recurrenceException]=null,o.deletedRecords=o.deletedRecords.concat(d);o.changedRecords.push(n.parent.eventBase.processTimezone(p,!0)),n.parent.uiStateValues.isIgnoreOccurrence=!1;break;case"DeleteSeries":o.deletedRecords=o.deletedRecords.concat(d.concat(c)),a=!0}},c=0,h=e.changedRecords.length;c<h;c++)p(c);var d=n.parent.dataModule.dataManager.saveChanges(o,s.id,n.getTable(),n.getQuery()),u=t.extend({},e.changedRecords[e.changedRecords.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(Ie,o,function(e){if(!e.cancel){for(var r=i.parent.eventFields,a={addedRecords:[],changedRecords:[],deletedRecords:[]},s=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]}l&&a.deletedRecords.push(e.deletedRecords[parseInt(s.toString(),10)])},o=0,l=e.deletedRecords.length;o<l;o++)s(o);var p=i.parent.dataModule.dataManager.saveChanges(a,r.id,i.getTable(),i.getQuery());i.parent.eventBase.selectWorkCellByTime(e.deletedRecords);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(Ie,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=we(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=we(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=we(t),s=s.replace(s,"UNTIL="+l)),n+=s+";"}}return i&&-1===n.indexOf("UNTIL")&&(n+="UNTIL="+we(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}(),cs=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(it,{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,"."+Pi))){var r=n.classList.contains(yt)||n.classList.contains(vt);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,"."+Vi),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(en)||t.closest(e.target,"."+en)))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(Ee,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(We,t)}else i.parent.notify(Ee,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))}}else this.parent.eventWindow.openEditor(this.parent.activeCellsData,"Add")}},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(xe,r,function(e){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,"."+Vi))return!1;if(t.closest(e.target,"."+Jt)&&!t.closest(e.target,"."+en))return!0;var i=t.closest(e.target,"."+ci+",."+Ht);return!t.isNullOrUndefined(i)||(i=t.closest(e.target,"."+Ct),!(!this.parent.activeView||!this.parent.activeView.isTimelineView()||t.isNullOrUndefined(i)))},e.prototype.destroy=function(){t.EventHandler.remove(this.parent.element,"mouseover",this.onHover)},e}(),hs=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)}}(),ds=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},us=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return hs(i,e),ds([t.Property()],i.prototype,"name",void 0),ds([t.Property()],i.prototype,"default",void 0),ds([t.Property()],i.prototype,"title",void 0),ds([t.Property({})],i.prototype,"validation",void 0),i}(t.ChildProperty),gs=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)}}(),vs=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},ms=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return gs(i,e),vs([t.Property("Id")],i.prototype,"id",void 0),vs([t.Property("IsBlock")],i.prototype,"isBlock",void 0),vs([t.Complex({name:"Subject"},us)],i.prototype,"subject",void 0),vs([t.Complex({name:"StartTime"},us)],i.prototype,"startTime",void 0),vs([t.Complex({name:"EndTime"},us)],i.prototype,"endTime",void 0),vs([t.Complex({name:"StartTimezone"},us)],i.prototype,"startTimezone",void 0),vs([t.Complex({name:"EndTimezone"},us)],i.prototype,"endTimezone",void 0),vs([t.Complex({name:"Location"},us)],i.prototype,"location",void 0),vs([t.Complex({name:"Description"},us)],i.prototype,"description",void 0),vs([t.Complex({name:"IsAllDay"},us)],i.prototype,"isAllDay",void 0),vs([t.Complex({name:"RecurrenceID"},us)],i.prototype,"recurrenceID",void 0),vs([t.Complex({name:"RecurrenceRule"},us)],i.prototype,"recurrenceRule",void 0),vs([t.Complex({name:"RecurrenceException"},us)],i.prototype,"recurrenceException",void 0),vs([t.Property("IsReadonly")],i.prototype,"isReadonly",void 0),vs([t.Property("FollowingID")],i.prototype,"followingID",void 0),i}(t.ChildProperty),fs=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)}}(),ys=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},Ts=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return fs(i,e),ys([t.Property()],i.prototype,"template",void 0),ys([t.Property([])],i.prototype,"dataSource",void 0),ys([t.Property()],i.prototype,"query",void 0),ys([t.Complex({},ms)],i.prototype,"fields",void 0),ys([t.Property(!1)],i.prototype,"enableTooltip",void 0),ys([t.Property("AllDayRow")],i.prototype,"spannedEventPlacement",void 0),ys([t.Property(1)],i.prototype,"minimumEventDuration",void 0),ys([t.Property()],i.prototype,"tooltipTemplate",void 0),ys([t.Property()],i.prototype,"resourceColorField",void 0),ys([t.Property(!1)],i.prototype,"editFollowingEvents",void 0),ys([t.Property(!0)],i.prototype,"allowAdding",void 0),ys([t.Property(!0)],i.prototype,"allowEditing",void 0),ys([t.Property(!0)],i.prototype,"allowDeleting",void 0),ys([t.Property(!1)],i.prototype,"enableMaxHeight",void 0),ys([t.Property(!1)],i.prototype,"enableIndicator",void 0),ys([t.Property(!1)],i.prototype,"ignoreWhitespace",void 0),ys([t.Property()],i.prototype,"sortComparer",void 0),ys([t.Property()],i.prototype,"includeFiltersInQuery",void 0),i}(t.ChildProperty),ws=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)}}(),Ds=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},bs=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ws(i,e),Ds([t.Property(!1)],i.prototype,"byDate",void 0),Ds([t.Property(!0)],i.prototype,"byGroupID",void 0),Ds([t.Property(!1)],i.prototype,"allowGroupEdit",void 0),Ds([t.Property([])],i.prototype,"resources",void 0),Ds([t.Property(!0)],i.prototype,"enableCompactView",void 0),Ds([t.Property()],i.prototype,"headerTooltipTemplate",void 0),Ds([t.Property(!1)],i.prototype,"hideNonWorkingDays",void 0),i}(t.ChildProperty),Cs=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)}}(),Ss=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},Os=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Cs(i,e),Ss([t.Property()],i.prototype,"field",void 0),Ss([t.Property()],i.prototype,"title",void 0),Ss([t.Property()],i.prototype,"name",void 0),Ss([t.Property(!1)],i.prototype,"allowMultiple",void 0),Ss([t.Property([])],i.prototype,"dataSource",void 0),Ss([t.Property()],i.prototype,"query",void 0),Ss([t.Property("Id")],i.prototype,"idField",void 0),Ss([t.Property("Text")],i.prototype,"textField",void 0),Ss([t.Property("Expanded")],i.prototype,"expandedField",void 0),Ss([t.Property("GroupID")],i.prototype,"groupIDField",void 0),Ss([t.Property("Color")],i.prototype,"colorField",void 0),Ss([t.Property("StartHour")],i.prototype,"startHourField",void 0),Ss([t.Property("EndHour")],i.prototype,"endHourField",void 0),Ss([t.Property("WorkDays")],i.prototype,"workDaysField",void 0),Ss([t.Property("CssClass")],i.prototype,"cssClassField",void 0),i}(t.ChildProperty),Es=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:Pt});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(He,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(r.ClassName===Nt&&!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,nr)}}},e.prototype.createResourceColumn=function(){var e=this.resourceCollection,i=t.createElement("div",{className:jt}),n=this.parent.activeView.createTableLayout(Lt);!this.parent.uiStateValues.isGroupAdaptive&&this.parent.rowAutoHeight&&this.parent.activeView.isTimelineView()&&this.parent.activeViewOptions.group.resources.length>0&&t.addClass([n],vr);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=0;p<e.length;p++){var c=l.cloneNode();if((r=H(s,"name",e[parseInt(p.toString(),10)].resource.name))===s.length-1?(t.extend(e[parseInt(p.toString(),10)].resourceData,{ClassName:"e-child-node"}),this.renderedResources[parseInt(p.toString(),10)].className=["e-child-node"]):(t.extend(e[parseInt(p.toString(),10)].resourceData,{ClassName:Nt}),this.renderedResources[parseInt(p.toString(),10)].className=[Nt]),n=r*this.leftPixel+"px",e[parseInt(p.toString(),10)].resourceData.ClassName===Nt&&!t.isNullOrUndefined(e[parseInt(p.toString(),10)].resourceData.Count)&&e[parseInt(p.toString(),10)].resourceData.Count>0){var h=void 0;h=e[parseInt(p.toString(),10)].resourceData[s[parseInt(r.toString(),10)].expandedField]||t.isNullOrUndefined(e[parseInt(p.toString(),10)].resourceData[s[parseInt(r.toString(),10)].expandedField])?Ft:qt;var d=t.createElement("div");t.addClass([d],[Ut,h]),this.setMargin(d,n),c.appendChild(d),this.resourceCollection.length>1&&t.EventHandler.add(d,"click",this.onTreeIconClick,this)}this.parent.activeView.setResourceHeaderContent(c,e[parseInt(p.toString(),10)],Pt),c.setAttribute("data-group-index",e[parseInt(p.toString(),10)].groupIndex.toString()),c.setAttribute("aria-label",e[parseInt(p.toString(),10)].resourceData[e[parseInt(p.toString(),10)].resource.textField]+" resource"),this.parent.activeViewOptions.resourceHeaderTemplate||this.setMargin(c.querySelector("."+Pt),n);var u=[Bt,e[parseInt(p.toString(),10)].resourceData.ClassName];t.addClass([c],u);var g={elementType:"resourceHeader",element:c,groupIndex:e[parseInt(p.toString(),10)].groupIndex};this.parent.trigger(He,g);var v=o.cloneNode();v.appendChild(c),a.push(v)}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,"."+Nt).parentElement,s=parseInt(a.children[0].getAttribute("data-group-index"),10),o={cancel:!1,event:e,groupIndex:s,requestType:r.classList.contains(Ft)?"resourceCollapse":"resourceExpand"};this.parent.trigger(Ie,o,function(a){if(!a.cancel){r.classList.contains(Ft)?(t.classList(r,[qt],[Ft]),n=!0):(t.classList(r,[Ft],[qt]),n=!1);for(var l=0,p=[].slice.call(i.parent.element.querySelectorAll("."+ci+",."+en));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($e,h),o={cancel:!1,event:e,groupIndex:s,requestType:r.classList.contains(Ft)?"resourceExpanded":"resourceCollapsed"},i.parent.refreshEvents(!1),i.parent.trigger(Me,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("."+jt+" tr")),p=[].slice.call(this.parent.element.querySelectorAll("."+wi+" tbody tr")),c=[].slice.call(this.parent.element.querySelectorAll("."+wi+" ."+pi)),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(Nt),d[parseInt(e.toString(),10)].resourceData[d[parseInt(e.toString(),10)].resource.expandedField]=!i,i){if(n){(m=r[parseInt(u.toString(),10)].querySelector("."+Ut))&&t.classList(m,[qt],[Ft])}r[parseInt(u.toString(),10)].classList.contains(nr)||t.addClass([r[parseInt(u.toString(),10)],a[parseInt(u.toString(),10)],s[parseInt(u.toString(),10)]],nr)}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;(m=r[parseInt(u.toString(),10)].querySelector("."+Ut))&&t.classList(m,[Ft],[qt])}}r[parseInt(u.toString(),10)].classList.contains(nr)&&t.removeClass([r[parseInt(u.toString(),10)],a[parseInt(u.toString(),10)],s[parseInt(u.toString(),10)]],nr)}}},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.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("."+Di);this.parent.virtualScrollModule.updateVirtualTrackHeight(l);var p=this.parent.element.querySelector("."+jt+" table"),c=this.parent.element.querySelector("."+wi+" table"),h=this.parent.element.querySelector("."+Rt);this.parent.virtualScrollModule.updateContent(p,c,h,this.renderedResources);var d=this.parent.element.querySelector("."+Gt);t.isNullOrUndefined(d)||(d.style.height=this.parent.element.querySelector("."+ft).offsetHeight+"px")},e.prototype.renderResourceHeader=function(){var e=t.createElement("div",{className:ti});if(e.innerHTML='<div class="'+ni+'"><div class="'+sr+'"><div class="e-icons e-icon-menu"></div></div><div class="'+or+'"></div></div>',"MonthAgenda"===this.parent.currentView){var i=this.parent.activeView.getPanel().querySelector("."+wi);i.insertBefore(e,i.querySelector("."+li))}else this.parent.element.insertBefore(e,this.parent.element.querySelector("."+ut));this.renderResourceHeaderText(),t.EventHandler.add(e.querySelector(".e-icon-menu"),"click",this.menuClick,this)},e.prototype.renderResourceTree=function(){this.popupOverlay=t.createElement("div",{className:lr});var e=t.createElement("div",{className:pr+" e-popup-close"});if("MonthAgenda"===this.parent.currentView){var r=this.parent.activeView.getPanel().querySelector("."+li);r.insertBefore(e,r.children[0]),r.appendChild(this.popupOverlay)}else this.parent.element.querySelector("."+ut).appendChild(e),this.parent.element.querySelector("."+ut).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("."+ut),enableRtl:this.parent.enableRtl,hideAnimation:{name:"SlideLeftOut",duration:500},showAnimation:{name:"SlideLeftIn",duration:500},viewPortElement:this.parent.element.querySelector("."+("MonthAgenda"===this.parent.currentView?li:ut))}),this.parent.on(tt,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=function(s,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(o.resourceTreeLevel[parseInt(s.toString(),10)],0,(s+1).toString()):n.push(p(o.resourceTreeLevel[parseInt(s.toString(),10)],0,(s+1).toString()))},o=this,l=0,p=this.resourceTreeLevel.length;l<p;l++)s(l);return e?(this.lastResourceLevel=r,r):n},e.prototype.renderResourceHeaderText=function(){for(var e=this.lastResourceLevel[this.parent.uiStateValues.groupIndex],i=[],n=function(n,a){var s=r.resourceCollection[parseInt(n.toString(),10)],o=s.dataSource.filter(function(t){return t[s.idField]===e.groupOrder[parseInt(n.toString(),10)]}),l=t.createElement("div",{className:mi});r.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=this,a=0,s=e.groupOrder.length;a<s;a++)n(a);i.pop();var o=("MonthAgenda"===this.parent.currentView?this.parent.activeView.getPanel():this.parent.element).querySelector("."+or);j(o);for(var l=0,p=i;l<p.length;l++){var c=p[l];o.appendChild(c)}1===this.lastResourceLevel.length&&t.addClass([this.parent.element.querySelector("."+sr)],dt)},e.prototype.menuClick=function(e){if(this.parent.element.querySelector("."+pr).classList.contains(wt))this.treePopup.hide(),t.removeClass([this.popupOverlay],ht);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],ht)}},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],ht);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(Ie,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(Me,n))})},e.prototype.documentClick=function(e){if(!t.closest(e.event.target,"."+pr)){var i=this.parent.element.querySelector("."+pr);i&&i.classList.contains(wt)&&(this.treePopup.hide(),t.removeClass([this.popupOverlay],ht))}},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 Ar(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++){r=l[o];var 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++){var w=T[y];for(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=function(e){x.resourceDateTree[parseInt(O.toString(),10)]=[];for(var i=[],n=function(n){var r=x.lastResourceLevel[parseInt(n.toString(),10)].resourceData[x.lastResourceLevel[parseInt(n.toString(),10)].resource.workDaysField];if(r||(r=x.parent.activeViewOptions.workDays),-1!==r.indexOf(e.date.getDay())){var a=t.extend({},x.lastResourceLevel[parseInt(n.toString(),10)],null,!0);a.date=e.date,x.lastResourceLevel[parseInt(n.toString(),10)].workDays=r,a.startHour=x.parent.getStartEndTime(a.resourceData[a.resource.startHourField])||e.startHour,a.endHour=x.parent.getStartEndTime(a.resourceData[a.resource.endHourField])||e.endHour,x.resourceDateTree[parseInt(O.toString(),10)].push(a);for(var 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)}}},o=0;o<a.groupOrder.length;o++)s(o)}},r=0;r<x.lastResourceLevel.length;r++)n(r);if(i.length>0){for(var a=0;a<b.length;a++)D[parseInt(a.toString(),10)]||(D[parseInt(a.toString(),10)]=[]),D[parseInt(a.toString(),10)]=D[parseInt(a.toString(),10)].concat(i[parseInt(a.toString(),10)]);e.colSpan=i[i.length-1].length,C.push(e)}O++},x=this,V=0,A=n;V<A.length;V++){E(P=A[V])}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 I=0,M=0,k=b[0];M<k.length;M++){I+=k[M].colSpan}for(var R=0,H=n;R<H.length;R++){var P;(P=H[R]).colSpan=I,C.push(P);for(var j=t.extend([],b,null,!0),L=0,N=j.length;L<N;L++){if(L===j.length-1)for(var q=0,F=j[parseInt(L.toString(),10)];q<F.length;q++){var U=F[q];U.date=P.date,U.workDays=P.workDays,U.startHour=this.parent.getStartEndTime(U.resourceData[U.resource.startHourField])||P.startHour,U.endHour=this.parent.getStartEndTime(U.resourceData[U.resource.endHourField])||P.endHour}D[parseInt(L.toString(),10)]||(D[parseInt(L.toString(),10)]=[]),D[parseInt(L.toString(),10)]=D[parseInt(L.toString(),10)].concat(j[parseInt(L.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{p=0;for(var 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=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=0,o=this.parent.resourceCollection;s<o.length;s++){if("break"===r(o[s]))break}this.refreshLayout(!0)},e.prototype.removeResource=function(e,t){for(var i=e instanceof Array?e:[e],n=function(e){if(e.name===t)return i.forEach(function(t){return new a.DataManager({json:e.dataSource}).remove(e.idField,t)}),"break"},r=0,s=this.parent.resourceCollection;r<s.length;r++){if("break"===n(s[r]))break}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("."+jt+' [data-group-index="'+r+'"] .'+Ut);s&&(s.classList.contains(qt)&&!i?s.click():s.classList.contains(Ft)&&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("."+wi),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("."+Di),p=Math.round(l.offsetHeight/this.expandedResources.length);if(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("."+yt+'[data-group-index="'+s+'"]'))&&!c.parentElement.classList.contains(nr)&&(a.scrollTop=a.scrollTop<c.offsetTop?c.offsetTop:a.scrollTop+c.offsetTop)}else a.scrollTop=s*p}else{var c;(c=this.parent.element.querySelector("."+yt+'[data-group-index="'+s+'"]'))&&!c.parentElement.classList.contains(nr)&&(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("."+Dt+" tbody tr:nth-child("+(n+1)+")"):this.parent.element.querySelector("."+_i+":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(tt,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("."+pr)),t.remove(this.parent.element.querySelector("."+lr)));var i=this.parent.element.querySelector("."+ti);i&&t.remove(i)},e}(),xs=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)}}(),Vs=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},As=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return xs(i,e),Vs([t.Property("")],i.prototype,"id",void 0),Vs([t.Property("")],i.prototype,"text",void 0),Vs([t.Property("auto")],i.prototype,"width",void 0),Vs([t.Property("")],i.prototype,"cssClass",void 0),Vs([t.Property(!1)],i.prototype,"showAlwaysInPopup",void 0),Vs([t.Property(!1)],i.prototype,"disabled",void 0),Vs([t.Property("")],i.prototype,"prefixIcon",void 0),Vs([t.Property("")],i.prototype,"suffixIcon",void 0),Vs([t.Property(!0)],i.prototype,"visible",void 0),Vs([t.Property("None")],i.prototype,"overflow",void 0),Vs([t.Property("")],i.prototype,"template",void 0),Vs([t.Property("Button")],i.prototype,"type",void 0),Vs([t.Property("Both")],i.prototype,"showTextOn",void 0),Vs([t.Property(null)],i.prototype,"htmlAttributes",void 0),Vs([t.Property("")],i.prototype,"tooltipText",void 0),Vs([t.Property("Left")],i.prototype,"align",void 0),Vs([t.Property(-1)],i.prototype,"tabIndex",void 0),Vs([t.Property("Custom")],i.prototype,"name",void 0),Vs([t.Event()],i.prototype,"click",void 0),i}(t.ChildProperty),Is=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)}}(),Ms=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},ks=function(e){function n(t,i){var n=e.call(this,t,i)||this;return n.adaptiveGroupIndex=0,n}return Is(n,e),n.prototype.render=function(){var e=[],n=[];if(e.push(ot),this.enableRtl?e.push("e-rtl"):n.push("e-rtl"),this.isAdaptive?e.push(lt):n.push(lt),this.enableAdaptiveUI?e.push("e-adaptive"):n.push("e-adaptive"),this.allowMultiDrag?e.push(pt):n.push(pt),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 Er(this),this.scrollModule.setWidth(),this.scrollModule.setHeight(),this.renderModule=new Ka(this),this.eventBase=new Zr(this),this.workCellAction=new cs(this),this.allowKeyboardInteraction&&(this.keyboardInteractionModule=new Vr(this)),this.inlineModule=new ra(this),this.initializeDataModule(),this.renderTableContainer(),this.activeViewOptions=this.getActiveViewOptions(),this.initializeResources(),this.wireEvents()},n.prototype.renderTableContainer=function(){this.element.querySelector("."+ut)||this.element.appendChild(this.createElement("div",{className:ut}))},n.prototype.getEventTemplateName=function(e){var t="eventTemplate_"+e;return this.activeEventTemplates.indexOf(t)<0&&this.activeEventTemplates.push(t),t},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 Es(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 Xa(this)},n.prototype.renderElements=function(e){if(e)return this.initializeView(this.currentView),void this.eventWindow.refresh();this.destroyHeaderModule(),this.showHeaderBar&&(this.headerModule=new Or(this)),this.renderTableContainer(),(t.Browser.isDevice||t.Browser.isTouch)&&(this.scheduleTouchModule=new xr(this)),this.initializeView(this.currentView),this.destroyPopups(),this.isPrinting||this.initializePopups()},n.prototype.validateDate=function(e){void 0===e&&(e=this.selectedDate);var t=e instanceof Date?new Date(e.getTime()):new Date(e),i=this.minDate instanceof Date?new Date(this.minDate.getTime()):new Date(this.minDate),n=this.maxDate instanceof Date?new Date(this.maxDate.getTime()):new Date(this.maxDate);if(!(i<=n))throw Error("minDate should be equal or less than maxDate");t<i&&(t=i),t>n&&(t=n),this.setProperties({selectedDate:new Date(""+t),minDate:new Date(""+i),maxDate:new Date(""+n)},!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){void 0===e&&(e=!1),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: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,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 Ar(this,this.eventSettings.dataSource,this.eventSettings.query),this.crudModule=new ps(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 Xa(this),this.quickPopup=new sa(this)},n.prototype.getDayNames=function(e){var i,n=[],r="";"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(){t.isNullOrUndefined(this.timeFormat)?"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):this.internalTimeFormat=this.timeFormat},n.prototype.getCalendarMode=function(){return 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 Mr:this.calendarUtil=new Ir},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(Ie,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(Re,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(Me,o)}})}})}},n.prototype.changeDate=function(e,t){var i=this,n={requestType:"dateNavigate",cancel:!1,event:t};this.trigger(Ie,n,function(r){if(!r.cancel){var a={action:"date",cancel:!1,previousDate:i.selectedDate,currentDate:e};i.trigger(Re,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(Me,n))})}})},n.prototype.isMinMaxDate=function(e){return void 0===e&&(e=this.selectedDate),e.getTime()>=this.minDate.getTime()&&e.getTime()<=this.maxDate.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 kr,(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}),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",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.",ok:"Ok",yes:"Yes",no:"No",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)},n.prototype.removeSelectedClass=function(){for(var e=this.getSelectedCells(),i=0,n=e;i<n.length;i++){var r=n[i];"Year"!==this.currentView&&r.setAttribute("aria-selected","false"),r.removeAttribute("tabindex")}t.removeClass(e,ri),this.keyboardInteractionModule&&this.keyboardInteractionModule.selectedCells.length>0&&(this.keyboardInteractionModule.selectedCells=[])},n.prototype.addSelectedClass=function(e,i,n){if("Year"!==this.currentView)for(var r=0,a=e;r<a.length;r++){a[r].setAttribute("aria-selected","true")}t.addClass(e,ri),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("."+mt)},n.prototype.getContentTable=function(){return this.activeView.element.querySelector("."+ft+" tbody")},n.prototype.getTableRows=function(){return[].slice.call(this.element.querySelectorAll("."+ft+" tbody tr:not(."+nr+")"))},n.prototype.getWorkCellElements=function(){return[].slice.call(this.element.querySelectorAll("."+yt))},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(vt)||e.classList.contains(Ct))&&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("."+Pi);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(tt,{event:e})},n.prototype.onScheduleResize=function(){if(!(t.isNullOrUndefined(this.activeView)||(this.isAdaptive||q())&&document.activeElement&&document.activeElement.classList.contains(Pn)||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($e,{cssProperties:this.getCssProperties(),isPreventScrollUpdate:!0});var e=!1;this.activeViewOptions.enableLazyLoading&&this.virtualScrollModule&&this.virtualScrollModule.isRemoteRefresh&&(e=this.virtualScrollModule.isRemoteRefresh,this.virtualScrollModule.isRemoteRefresh=!1),this.refreshEvents(e)}else this.notify(Ke,{})},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("."+ri))},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("."+wi).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));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)},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 Or(this),this.headerModule.updateDateRange()),this.notify($e,{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.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?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],Hi)),this.crudModule.refreshDataManager())},n.prototype.allDayRowScrollUpdate=function(){var e=this.element.querySelector("."+Dt),i=this.element.querySelector("."+mt);if("auto"!==this.height&&this.enableAllDayScroll)e.classList.contains(Cr)&&t.removeClass([e],Cr),this.eventBase.allDayExpandScroll(e);else if(t.addClass([e],Cr),e.classList.contains(br)&&t.removeClass([e],br),this.uiStateValues.expand){var n=[].slice.call(this.element.querySelectorAll("."+vt));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(et,{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":this.keyboardInteractionModule&&(this.keyboardInteractionModule.destroy(),this.keyboardInteractionModule=null),i.allowKeyboardInteraction&&(this.keyboardInteractionModule=new Vr(this));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":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 Or(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 oa(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,Tt)},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,Tt)}else{var s=[].slice.call(this.element.querySelectorAll("."+Tt));t.removeClass(s,Tt)}},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*rt/this.activeViewOptions.timeScale.slotCount,h=Math.round((a.getTime()-l.getTime())/c),d=Math.ceil((s.getTime()-l.getTime())/c),u=h,g=d,v=[],m=0,f=e;m<f.length;m++){var y=f[m];b(y=this.getDateTime(y));var T=this.activeView.renderDates;t.isNullOrUndefined(r)||!this.resourceBase||this.activeView.isTimelineView()||(T=this.resourceBase.lastResourceLevel[parseInt(r.toString(),10)].renderDates);var w=this.getIndexOfDate(T,y);if(w>=0){if(this.activeView.isTimelineView()){var D=Math.round((p.getTime()-l.getTime())/c);h=u+w*D,d=g+w*D}for(var C=h;C<d;C++)if(this.activeView.isTimelineView()){var S=t.isNullOrUndefined(r)?0:r;v.push(o.rows[parseInt(S.toString(),10)].cells[parseInt(C.toString(),10)])}else if(t.isNullOrUndefined(r))v.push(o.rows[parseInt(C.toString(),10)].cells[parseInt(w.toString(),10)]);else{var O="."+yt+'[data-group-index="'+r+'"]',E=[].slice.call(o.rows[parseInt(C.toString(),10)].querySelectorAll(O));v.push(E[parseInt(w.toString(),10)])}}}return v},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(vt)||r.classList.contains(Ct)?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.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],Hi)),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 sa(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 oa(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.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="."+yt+'[data-date="'+r.getTime()+'"]';this.activeViewOptions.group.resources.length>0&&!this.uiStateValues.isGroupAdaptive&&this.resourceBase&&this.eventBase&&(n.groupIndex=this.eventBase.getGroupIndexFromEvent(e),a="."+yt+'[data-date="'+r.getTime()+'"][data-group-index="'+n.groupIndex+'"]');var s=this.element.querySelector(a);s&&(s.focus(),n.element=s,this.notify(Ee,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],Si),this.notify(Pe,this.activeEventData))}},n.prototype.closeQuickInfoPopup=function(){this.quickPopup&&this.quickPopup.quickPopupHide(!0)},n.prototype.closeTooltip=function(){this.eventTooltip&&this.eventTooltip.close()},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=[ot,"e-rtl",lt,pt];this.cssClass&&(r=r.concat(this.cssClass.split(" "))),t.removeClass([this.element],r)},Ms([t.Property("auto")],n.prototype,"width",void 0),Ms([t.Property("auto")],n.prototype,"height",void 0),Ms([t.Property(!0)],n.prototype,"showHeaderBar",void 0),Ms([t.Property(!0)],n.prototype,"showTimeIndicator",void 0),Ms([t.Property(!0)],n.prototype,"allowSwiping",void 0),Ms([t.Collection([],As)],n.prototype,"toolbarItems",void 0),Ms([t.Property("Week")],n.prototype,"currentView",void 0),Ms([t.Property(["Day","Week","WorkWeek","Month","Agenda"])],n.prototype,"views",void 0),Ms([t.Property(new Date)],n.prototype,"selectedDate",void 0),Ms([t.Property(new Date(1900,0,1))],n.prototype,"minDate",void 0),Ms([t.Property(new Date(2099,11,31))],n.prototype,"maxDate",void 0),Ms([t.Property()],n.prototype,"dateFormat",void 0),Ms([t.Property("Gregorian")],n.prototype,"calendarMode",void 0),Ms([t.Property(!0)],n.prototype,"showWeekend",void 0),Ms([t.Property(0)],n.prototype,"firstDayOfWeek",void 0),Ms([t.Property("FirstDay")],n.prototype,"weekRule",void 0),Ms([t.Property([1,2,3,4,5])],n.prototype,"workDays",void 0),Ms([t.Property(12)],n.prototype,"monthsCount",void 0),Ms([t.Property("00:00")],n.prototype,"startHour",void 0),Ms([t.Property("24:00")],n.prototype,"endHour",void 0),Ms([t.Property(null)],n.prototype,"timeFormat",void 0),Ms([t.Property(!0)],n.prototype,"enableHtmlSanitizer",void 0),Ms([t.Property(!1)],n.prototype,"enableAllDayScroll",void 0),Ms([t.Property(!1)],n.prototype,"enableAdaptiveUI",void 0),Ms([t.Property(!0)],n.prototype,"allowResizing",void 0),Ms([t.Complex({},$a)],n.prototype,"workHours",void 0),Ms([t.Complex({},is)],n.prototype,"timeScale",void 0),Ms([t.Property(!0)],n.prototype,"allowKeyboardInteraction",void 0),Ms([t.Property(!0)],n.prototype,"allowDragAndDrop",void 0),Ms([t.Property()],n.prototype,"dateHeaderTemplate",void 0),Ms([t.Property()],n.prototype,"dateRangeTemplate",void 0),Ms([t.Property()],n.prototype,"cellHeaderTemplate",void 0),Ms([t.Property()],n.prototype,"dayHeaderTemplate",void 0),Ms([t.Property()],n.prototype,"monthHeaderTemplate",void 0),Ms([t.Property()],n.prototype,"cellTemplate",void 0),Ms([t.Property(!1)],n.prototype,"readonly",void 0),Ms([t.Property(!0)],n.prototype,"showQuickInfo",void 0),Ms([t.Property(!1)],n.prototype,"allowInline",void 0),Ms([t.Property(!0)],n.prototype,"allowMultiCellSelection",void 0),Ms([t.Property(!0)],n.prototype,"allowMultiRowSelection",void 0),Ms([t.Property(!1)],n.prototype,"quickInfoOnSelectionEnd",void 0),Ms([t.Property(!1)],n.prototype,"showWeekNumber",void 0),Ms([t.Property(!1)],n.prototype,"rowAutoHeight",void 0),Ms([t.Property(!1)],n.prototype,"allowMultiDrag",void 0),Ms([t.Property(0)],n.prototype,"firstMonthOfYear",void 0),Ms([t.Property()],n.prototype,"editorTemplate",void 0),Ms([t.Property()],n.prototype,"editorHeaderTemplate",void 0),Ms([t.Property()],n.prototype,"editorFooterTemplate",void 0),Ms([t.Complex({},as)],n.prototype,"quickInfoTemplates",void 0),Ms([t.Property(7)],n.prototype,"agendaDaysCount",void 0),Ms([t.Property(!0)],n.prototype,"hideEmptyAgendaDays",void 0),Ms([t.Property(!0)],n.prototype,"enableRecurrenceValidation",void 0),Ms([t.Property()],n.prototype,"timezone",void 0),Ms([t.Complex({},Ts)],n.prototype,"eventSettings",void 0),Ms([t.Property(Rr)],n.prototype,"timezoneDataSource",void 0),Ms([t.Property()],n.prototype,"resourceHeaderTemplate",void 0),Ms([t.Property()],n.prototype,"headerIndentTemplate",void 0),Ms([t.Complex({},bs)],n.prototype,"group",void 0),Ms([t.Collection([],Os)],n.prototype,"resources",void 0),Ms([t.Collection([],ls)],n.prototype,"headerRows",void 0),Ms([t.Property()],n.prototype,"cssClass",void 0),Ms([t.Property()],n.prototype,"eventDragArea",void 0),Ms([t.Event()],n.prototype,"created",void 0),Ms([t.Event()],n.prototype,"destroyed",void 0),Ms([t.Event()],n.prototype,"cellClick",void 0),Ms([t.Event()],n.prototype,"cellDoubleClick",void 0),Ms([t.Event()],n.prototype,"moreEventsClick",void 0),Ms([t.Event()],n.prototype,"hover",void 0),Ms([t.Event()],n.prototype,"select",void 0),Ms([t.Event()],n.prototype,"actionBegin",void 0),Ms([t.Event()],n.prototype,"actionComplete",void 0),Ms([t.Event()],n.prototype,"actionFailure",void 0),Ms([t.Event()],n.prototype,"navigating",void 0),Ms([t.Event()],n.prototype,"renderCell",void 0),Ms([t.Event()],n.prototype,"eventClick",void 0),Ms([t.Event()],n.prototype,"eventDoubleClick",void 0),Ms([t.Event()],n.prototype,"eventRendered",void 0),Ms([t.Event()],n.prototype,"dataBinding",void 0),Ms([t.Event()],n.prototype,"popupOpen",void 0),Ms([t.Event()],n.prototype,"popupClose",void 0),Ms([t.Event()],n.prototype,"dragStart",void 0),Ms([t.Event()],n.prototype,"drag",void 0),Ms([t.Event()],n.prototype,"dragStop",void 0),Ms([t.Event()],n.prototype,"resizeStart",void 0),Ms([t.Event()],n.prototype,"resizing",void 0),Ms([t.Event()],n.prototype,"resizeStop",void 0),Ms([t.Event()],n.prototype,"virtualScrollStart",void 0),Ms([t.Event()],n.prototype,"virtualScrollStop",void 0),Ms([t.Event()],n.prototype,"dataBound",void 0),n=Ms([t.NotifyPropertyChanges],n)}(t.Component),Rs=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=new Date(+e);return t.setMinutes(Math.floor(t.getMinutes()/this.actionObj.interval)*this.actionObj.interval),t},e.prototype.getContentAreaDimension=function(){var e=this.parent.element.querySelector("."+wi),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("."+fi);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("."+Li);if(!p){p=t.createElement("div",{className:Li});var c=this.parent.activeView.isTimelineView()?Dt:Wt;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(gn)||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=t.createElement("div",{innerHTML:e.outerHTML}).children[0],n=[ji];n.push("drag"===this.actionObj.action?"e-drag-clone":qi),"Month"!==this.parent.currentView&&"TimelineMonth"!==this.parent.currentView||n.push("e-month-event"),t.addClass([i],n),t.addClass([e],Hi),t.isNullOrUndefined(e.parentElement)||e.parentElement.appendChild(i),i.style.width=t.formatUnit(i.offsetWidth-2);var r=document.querySelector(this.parent.eventDragArea);return this.parent.eventDragArea&&"drag"===this.actionObj.action&&r&&r.appendChild(i),t.setStyleAttribute(i,{border:"0px"}),i},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("."+Hi))),t.removeClass(e,Hi)},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("."+Li);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("."+wi),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],Hi):t.removeClass([this.parent.element],Hi)},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(Xi)){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")+'"]'));var n=[].slice.call(this.parent.element.querySelectorAll(i));t.addClass(n,Hi);var r=[].slice.call(this.parent.element.querySelectorAll("."+ji));t.removeClass(r,Hi)},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}if(!i&&"Vertical"===this.parent.activeViewOptions.orientation&&0!==this.parent.activeViewOptions.group.resources.length){var r;n=(r=this.yearEvent.isSpannedEvent(e,e[this.parent.eventFields.startTime])).isSpanned.count*this.actionObj.cellWidth}var a=this.createAppointmentElement(this.actionObj.groupIndex,e[this.parent.eventFields.subject]);a.setAttribute("drag","true"),t.addClass([a],ji),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="."+yt+'[data-date="'+s+'"]';this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(o="."+yt+'[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("."+Ai),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(void 0===n&&(n=!1),e.querySelector("."+Jt))e.querySelector("."+Jt).appendChild(i);else{var r=t.createElement("div",{className:Jt});r.appendChild(i),e.appendChild(r)}},e.prototype.createAppointmentElement=function(e,i){var n=t.createElement("div",{className:ci,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("."+yt)),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="."+yt+'[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("."+ji));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],ji),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}(),Hs=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)}}(),Ps=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Hs(i,e),i.prototype.wireResizeEvent=function(e){for(var i=0,n=[].slice.call(e.querySelectorAll("."+Ni));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,"."+ui)){this.actionObj.action="resize",this.actionObj.slotInterval=this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount,this.actionObj.interval=this.actionObj.slotInterval;var n=t.closest(e.target,"."+Ni);this.actionObj.element=t.closest(n,"."+ci),this.actionObj.event=this.parent.eventBase.getEventByGuid(this.actionObj.element.getAttribute("data-guid"));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(Ue,a,function(a){if(!a.cancel){i.actionClass("addClass"),i.parent.uiStateValues.action=!0,i.resizeEdges={left:n.classList.contains(Fi),right:n.classList.contains(Ui),top:n.classList.contains(Bi),bottom:n.classList.contains(Wi)},i.actionObj.groupIndex=i.parent.uiStateValues.isGroupAdaptive?i.parent.uiStateValues.groupIndex:0;var s=i.parent.element.querySelector("."+yt);i.actionObj.cellWidth=B(s),i.actionObj.cellHeight=W(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 ta(i.parent));var v=i.parent.element.querySelector("."+wi);i.scrollArgs={element:v,width:v.scrollWidth,height:v.scrollHeight},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("."+qi).length&&this.resizeHelper(),t.isNullOrUndefined(e.target)||!e.target.classList.contains(rr)){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){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++){var s=a[r];t.setStyleAttribute(s,n),t.addClass([s],Fi)}}this.horizontalResizing(!this.parent.enableRtl)}if(this.resizeEdges.right){if(i){var o=this.getLeftRightStyles(e,!1);if(parseInt(o.width,10)<1)return;for(var l=0,p=this.actionObj.cloneElement;l<p.length;l++){s=p[l];t.setStyleAttribute(s,o),t.addClass([s],Ui)}}this.horizontalResizing(this.parent.enableRtl)}if(this.resizeEdges.top){if(i){var c=this.getTopBottomStyles(e,!0);if(parseInt(c.height,10)<1)return;for(var h=0,d=this.actionObj.cloneElement;h<d.length;h++){s=d[h];t.setStyleAttribute(s,c),t.addClass([s],Bi)}}this.verticalResizing(!0)}if(this.resizeEdges.bottom){if(i){var u=this.getTopBottomStyles(e,!1);if(parseInt(u.height,10)<1)return;for(var g=0,v=this.actionObj.cloneElement;g<v.length;g++){s=v[g];t.setStyleAttribute(s,u),t.addClass([s],Wi)}}this.verticalResizing(!1)}}else this.monthResizing()},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("."+ji));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())<=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())/nt)),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.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(Be,n,function(e){e.cancel||(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/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=!1,s=this.parent.currentView,o=["TimelineDay","TimelineWeek","TimelineWorkWeek"].indexOf(this.parent.currentView)>-1,l="TimelineMonth"===this.parent.currentView,p=l||o&&!this.parent.activeViewOptions.timeScale.enable;if(this.parent.activeView.isTimelineView()){var c=this.parent.getContentTable().querySelector("tr");if(this.parent.activeViewOptions.headerRows.length>0){var h=this.parent.activeViewOptions.headerRows.map(function(e){return e.option});s=h.slice(-1)[0],l&&"Hour"===s&&(s=h.slice(-2)[0]||"Month")}i=e?n:r;var d=0,u=[].slice.call(c.children),g=!1,v=this.actionObj.cellWidth/(this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount),m=parseFloat(this.parent.enableRtl?this.actionObj.clone.style.right:this.actionObj.clone.style.left);if(m=Math.round(m/v)*v,-1!==["Year","Month","Week","Date"].indexOf(s)){for(var f=0,y=0,T=u;y<T.length;y++){var w=T[y];f+=parseInt(w.getAttribute("colspan"),10)}var D=this.parent.enableRtl?parseInt(this.actionObj.clone.style.right,10):parseInt(this.actionObj.clone.style.left,10);D=Math.round(D/this.actionObj.cellWidth)*this.actionObj.cellWidth,e||(D+=B(this.actionObj.clone)-this.actionObj.cellWidth),d=Math.floor(D/Math.floor(B(c)/f)),a=o&&"Date"===s,g=(d=e?d:l?d+1:d)===u.length,d=d<0?0:d>=f?f-1:d}else{var C=this.actionObj.cellWidth;if(d=e?Math.floor(m/this.actionObj.cellWidth):Math.ceil((m+(B(this.actionObj.clone)-C))/this.actionObj.cellWidth),this.parent.enableRtl){var S=0;"TimelineMonth"!==s&&(this.parent.activeViewOptions.timeScale.enable||l)||(S=this.actionObj.cellWidth);var E=Math.floor(m/this.actionObj.cellWidth)*this.actionObj.cellWidth+(e?0:B(this.actionObj.clone)-S);d=Math.floor(E/this.actionObj.cellWidth)}g=d===u.length,d=this.getIndex(d)}var x=void 0;if(x=-1!==["Year","Month","Week","Date"].indexOf(s)?new Date(this.parent.activeView.renderDates[parseInt(d.toString(),10)].getTime()):this.parent.getDateFromElement(c.children[parseInt(d.toString(),10)]),-1===["TimelineMonth","Year","Month","Week","Date"].indexOf(s)&&this.parent.activeViewOptions.timeScale.enable){e||(m+=B(this.actionObj.clone));var V=Math.ceil(this.actionObj.slotInterval/this.actionObj.cellWidth*(m-Math.floor(m/this.actionObj.cellWidth)*this.actionObj.cellWidth));V=g||!e&&0===V?this.actionObj.slotInterval:V,(i=new Date(x.getTime())).setMinutes(i.getMinutes()+V),this.updateTimePosition(i)}else i=new Date(x.setHours(i.getHours(),i.getMinutes(),i.getSeconds()))}else{var A=t.closest(this.actionObj.clone,"td").cellIndex,I=Math.ceil((e?B(this.actionObj.element):0)/this.actionObj.cellWidth)*this.actionObj.cellWidth,M=(f=Math.ceil((B(this.actionObj.clone)-I)/this.actionObj.cellWidth),c=t.closest(this.actionObj.clone,"tr"),e?A-f:A+f-1);M=this.getIndex(M),i=this.parent.getDateFromElement(c.children[parseInt(M.toString(),10)]),e?i.setHours(n.getHours(),n.getMinutes(),n.getSeconds()):i.setHours(r.getHours(),r.getMinutes(),r.getSeconds())}var k=-1!==["TimelineMonth","Year","Month","Week","Date"].indexOf(s)||!this.parent.activeViewOptions.timeScale.enable;if(e)r.getTime()-i.getTime()<=0&&(i=p?b(r):n),this.actionObj.start=k?i:this.calculateIntervalTime(i);else{var R=(!(o&&this.parent.activeViewOptions.timeScale.enable)||a||o&&["Week","Month","Year"].indexOf(s)>-1)&&0===i.getHours()&&0===i.getMinutes()?O(i,1):i;p&&R.getTime()-n.getTime()<=0&&(R=O(b(n),1)),this.actionObj.end=k?R:this.calculateIntervalTime(R)}},i.prototype.getTopBottomStyles=function(e,i){var n=this.parent.element.querySelector("."+wi),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;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);return{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?B(this.actionObj.element)/this.actionObj.cellWidth*this.actionObj.cellWidth:"Month"===this.parent.currentView?B(this.actionObj.element):Math.ceil(B(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(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&&p+this.actionObj.clone.offsetLeft>this.scrollArgs.width?B(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.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?B(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-B(this.actionObj.clone)?parseInt(this.actionObj.clone.style.right,10):v:i&&this.actionObj.pageX>this.actionObj.X+B(this.actionObj.clone)&&B(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=B(this.actionObj.clone)));var f=Math.ceil(B(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 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}(Rs),js=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)}}(),Ls=function(e){function i(t){var i=e.call(this,t,"day")||this;return i.isResource=!1,i}return js(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?"."+ci:"."+Jt+",."+en,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(Ke,{})},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.firstDayOfWeek),h=O(m(p,this.parent.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)){if(this.parent.eventBase.filterEvents(u,g).length>0){var f=s[parseInt(d.toString(),10)];f&&f.appendChild(t.createElement("div",{className:ci}))}}}},i.prototype.timelineYearViewEvents=function(){var e=this,i=this.parent.element.querySelector("."+yt+":not(."+Ot+")");this.cellWidth=B(i),this.cellHeader=P(i.querySelector("."+Ai));var n=this.parent.element.querySelector("."+Rt);this.eventHeight=h(n,ci);var r="."+yr+" tbody tr,."+Lt+" tbody tr,."+ft+" tbody tr";this.addCellHeight(r,this.eventHeight,2,this.cellHeader,this.moreIndicatorHeight);for(var a=[].slice.call(this.parent.element.querySelectorAll("."+pi)),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,d=t.createElement("div",{className:Jt});p.appendChild(d);var u=new Date(this.parent.selectedDate.getFullYear(),s[parseInt(l.toString(),10)],1),g=new Date(u.getFullYear(),u.getMonth()+1,0),v=u.getDay(),m=[];for("Horizontal"===this.parent.activeViewOptions.orientation&&(this.renderedEvents=[]);u.getTime()<=g.getTime();){var f=void 0,y=void 0;if("Vertical"===this.parent.activeViewOptions.orientation){var T=a[parseInt(v.toString(),10)];c=v+1,(d=T.querySelector("."+Jt))||(d=t.createElement("div",{className:Jt}),T.appendChild(d)),this.parent.enableRtl?y=l*this.cellWidth:f=l*this.cellWidth}else this.parent.enableRtl?y=(v+u.getDate()-1)*this.cellWidth:f=(v+u.getDate()-1)*this.cellWidth;var w=this.parent.element.querySelector(".e-content-wrap tr:nth-child("+c+") td");this.cellHeight=w.offsetHeight;var D=b(new Date(u.getTime())),C=O(new Date(D.getTime()),1),S=void 0;this.parent.uiStateValues.isGroupAdaptive&&(S=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]);for(var E=this.parent.eventBase.filterEvents(D,C,void 0,S),x=function(e,i){var n=t.extend({},E[parseInt(e.toString(),10)],null,!0);V.updateSpannedEvents(n,D,C);var r=V.getIndex(D);n.Index=r;var a=V.cellHeader+V.eventHeight*(r+1)+2+V.moreIndicatorHeight,s=V.cellHeight-V.cellHeader-V.moreIndicatorHeight,p=Math.floor(s/(V.eventHeight+2)),c=V.parent.rowAutoHeight?1:V.parent.activeViewOptions.maxEventsPerRow,h=V.parent.activeViewOptions.maxEventsPerRow?i-c:i-p<=0?1:i-p;if("Horizontal"===V.parent.activeViewOptions.orientation){var g=V.renderedEvents.filter(function(e){return e.Guid===n.Guid}),T=m.filter(function(e){return e.Guid===n.Guid});if(g.length>0&&g[0].MoreIndicator||T.length>0&&T[0].MoreIndicator){var b="Horizontal"===V.parent.activeViewOptions.orientation?l:v;return V.renderMoreIndicator(d,h,D,b,f,y,o),"continue"}if(g.length>0||T.length>0)return"continue"}var S=V.maxOrIndicator||r<c||V.cellHeight>a;if(V.parent.rowAutoHeight||S||V.cellHeight>a)V.renderEvent(d,n,l,f,y,u,v),(V.parent.rowAutoHeight||V.cellHeight>a)&&V.updateCellHeight(w,a),m.push(n);else{b="Horizontal"===V.parent.activeViewOptions.orientation?l:v;V.renderMoreIndicator(d,h,D,b,f,y,o),"Horizontal"===V.parent.activeViewOptions.orientation&&(n.MoreIndicator=!0,V.renderedEvents.push(n),m.push(n))}},V=this,A=0,I=(E=this.parent.eventBase.sortByDateTime(E)).length;A<I;A++)x(A,I);u=O(new Date(u.getTime()),1),"Vertical"===this.parent.activeViewOptions.orientation&&(v++,this.renderedEvents=[])}}if(this.parent.rowAutoHeight&&"Vertical"===this.parent.activeViewOptions.orientation){var M=[].slice.call(this.parent.element.querySelectorAll("."+pi)),k=[].slice.call(this.parent.element.querySelectorAll("."+ft+" tbody tr"));M.forEach(function(t,i){var n=[].slice.call(t.querySelectorAll("."+ci)),r=k[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("."+wi),i=t.offsetWidth>t.clientWidth,n=this.parent.element.querySelector("."+yt);this.cellWidth=B(n),this.cellHeader=0;var r=this.parent.element.querySelector("."+Rt);this.eventHeight=h(r,ci);var a="."+yr+" tbody tr,."+Lt+" tbody tr,."+ft+" tbody tr";this.addCellHeight(a,this.eventHeight,2,this.cellHeader,this.moreIndicatorHeight);var s=[].slice.call(this.parent.element.querySelectorAll("."+pi)),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(var p=0;p<l.length;p++)for(var c=new Date(this.parent.selectedDate.getFullYear(),l[parseInt(p.toString(),10)],1),d=0,u=o.length;d<u;d++)this.renderedEvents=[],this.renderResourceEvent(s[parseInt(p.toString(),10)],o[parseInt(d.toString(),10)],p,d,c);else for(d=0,u=o.length;d<u;d++){this.renderedEvents=[];for(p=0;p<l.length;p++){c=new Date(this.parent.selectedDate.getFullYear(),l[parseInt(p.toString(),10)],1);this.renderResourceEvent(s[parseInt(d.toString(),10)],o[parseInt(d.toString(),10)],p,d,c)}}if(this.parent.rowAutoHeight&&!i&&t.offsetWidth>t.clientWidth){[].slice.call(this.parent.element.querySelectorAll("."+ci)).forEach(function(e){e.style.removeProperty("left"),e.style.removeProperty("right")});var g=[].slice.call(this.parent.element.querySelectorAll("."+pi)),v=this.parent.element.querySelector("."+ft),m=[].slice.call(v.querySelectorAll("tbody tr"));g.forEach(function(t,i){var n=[].slice.call(t.children),r=m[parseInt(i.toString(),10)];n.forEach(function(t,i){var n=r.querySelector("td:nth-child("+(i+1)+")"),a=[].slice.call(t.children),s=B(n),o=n.offsetLeft;if(e.parent.enableRtl){var l=v.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.renderResourceEvent=function(e,i,n,r,a){var s=t.createElement("div",{className:Jt});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=function(e){var i=l[parseInt(e.toString(),10)],o=void 0,p=t.extend({},i,null,!0);if(u.parent.activeViewOptions.group.resources.length>0){var d=u.isSpannedEvent(p,a);o=u.getIndex(d[u.fields.startTime]),p.Index=o}else o=u.getIndex(p[u.fields.startTime]),p.Index=o;var g=u.cellHeader+u.eventHeight*(e+1)+2+u.moreIndicatorHeight,v="Vertical"===u.parent.activeViewOptions.orientation?n*u.cellWidth:r*u.cellWidth;if(!u.parent.isMinMaxDate(p[u.fields.startTime]))return{value:void 0};if("Vertical"===u.parent.activeViewOptions.orientation&&u.parent.activeViewOptions.group.resources.length>0){var m=u.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(!(u.parent.rowAutoHeight||u.cellHeight>g)){var y="Horizontal"===u.parent.activeViewOptions.orientation?n:r;if(u.renderMoreIndicator(s,l.length-e,a,y,v,v,r),"Horizontal"===u.parent.activeViewOptions.orientation)for(var T=r;T<l.length;T++)u.renderedEvents.push(t.extend({},l[parseInt(T.toString(),10)],{Index:o+T},!0));return"break"}u.renderEvent(s,p,n,v,v,a,r),u.updateCellHeight(c,g),h.push(p)},u=this,g=0;g<l.length;g++){var v=d(g);if("object"==typeof v)return v.value;if("break"===v)break}},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").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:g+"px"}),!this.isResource&&this.parent.rowAutoHeight&&"Vertical"===this.parent.activeViewOptions.orientation&&d.setAttribute("data-index",h.Index.toString());var v={data:h,element:d,cancel:!1,type:"event"};this.parent.trigger(Le,v,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:ci,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],fr),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)}else{var l=e[this.fields.location]||this.parent.eventSettings.fields.location.default||"",p=t.createElement("div",{className:Pn,innerHTML:i+(l?";&nbsp"+l:"")}),c=t.createElement("div",{className:fi+(this.parent.isAdaptive?" "+dt:""),innerHTML:this.parent.getTimeString(s[this.fields.startTime])}),h=t.createElement("div",{className:fi+(this.parent.isAdaptive?" "+dt:""),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:gi});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.ceil((u-g)/nt)+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;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="."+yr+" tbody tr,."+Lt+" tbody tr,."+ft+" 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}(na),Ns=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)}}(),qs=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}return Ns(i,e),i.prototype.wireDragEvent=function(e){new t.Draggable(e,{abort:"."+Ni,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("."+ft)},i.prototype.dragHelper=function(e){var i=this;if(e.sender&&"touchmove"===e.sender.type&&(!this.parent.uiStateValues.isTapHold||!e.element.classList.contains(ui)))return null;this.setDragActionDefaultValues(),this.actionObj.element=e.element,this.actionObj.action="drag";var n=[];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)?n=[e.element]:(n=this.parent.selectedElements,this.isMultiSelect=!0),n.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(Xi)||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("."+wi).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(gn))s=t.formatUnit(this.actionObj.clone.offsetTop);else if("Month"===this.parent.currentView)s=t.formatUnit(0);else if(this.actionObj.clone.classList.contains(Xi))s=t.formatUnit(this.parent.element.querySelector("."+mt).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(Xi)&&!this.actionObj.clone.classList.contains(Xi)&&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);o=o<0?0:o,s=t.formatUnit(Math.ceil(o/i)*i);var l=this.parent.element.querySelector(".e-content-wrap").scrollHeight,p=parseInt(s,10)+this.actionObj.clone.offsetHeight;p>l&&(s=parseInt(s,10)-(p-l)+"px")}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("."+yt);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());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 a=i.actionObj.element.ej2_instances[0];return t.isNullOrUndefined(a)||a.intDestroy(e.event),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.actionObj.excludeSelectors=n.excludeSelectors;var s=i.parent.element.querySelector("."+wi);if(i.scrollArgs={element:s,width:s.scrollWidth,height:s.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(Xi),(i.parent.activeView.isTimelineView()||!i.parent.timeScale.enable)&&"TimelineYear"!==i.parent.currentView){!t.isNullOrUndefined(i.actionObj.clone.offsetParent)&&i.actionObj.clone.offsetParent.classList.contains(gn)&&(i.isMorePopupOpened=!0),i.actionObj.pageX=e.event.pageX;var o=i.parent.activeViewOptions.headerRows;i.isHeaderRows=o.length>0&&"Hour"!==o[o.length-1].option&&"Date"!==o[o.length-1].option,i.isTimelineDayProcess=!i.parent.activeViewOptions.timeScale.enable||i.isHeaderRows||"TimelineMonth"===i.parent.currentView||o.length>0&&"Date"===o[o.length-1].option,i.isStepDragging=!i.isTimelineDayProcess&&i.actionObj.slotInterval!==i.actionObj.interval,i.isTimelineDayProcess?i.timelineEventModule=new na(i.parent,"day"):i.timelineEventModule=new na(i.parent,"hour")}if("TimelineYear"===i.parent.currentView&&(i.yearEvent=new Ls(i.parent)),"Month"===i.parent.currentView&&(i.startTime=b(new Date(i.startTime)).getTime(),i.updateOriginalElement(i.actionObj.clone),i.monthEvent=new ta(i.parent)),"Day"===i.parent.currentView||"Week"===i.parent.currentView||"WorkWeek"===i.parent.currentView){i.verticalEvent=new $r(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],Hi)}})}})},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(rr)){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,this.isAllDayDrag=this.parent.activeViewOptions.timeScale.enable?this.actionObj.clone.classList.contains(Xi):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())/nt}}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,"."+ot)?"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())/rt)},i.prototype.dragStop=function(e){var i=this;if(this.isCursorAhead=!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){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(gn)?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:B(this.parent.element.querySelector("."+yt)),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("."+pi),!t.isNullOrUndefined(e)){var i=e.querySelector("."+Jt);i||(i=t.createElement("div",{className:Jt}),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(Xi)?"."+Gi:"."+Jt;if(this.parent.element.querySelectorAll(n).item(this.actionObj.index).appendChild(this.actionObj.clone),n==="."+Gi){var r=this.getAllDayEventHeight(),a=[].slice.call(this.parent.element.querySelectorAll("."+vt+":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("."+yt));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("."+Jt);p||(p=t.createElement("div",{className:Jt}),l[this.actionObj.index].appendChild(p)),p.appendChild(this.actionObj.clone)}},i.prototype.viewNavigation=function(e){var i,n=this.parent.element.querySelector("."+wi);n&&(!this.scrollEdges.top&&!this.scrollEdges.bottom||t.closest(this.actionObj.clone,"."+Gi))&&(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(yt)&&!r.classList.contains(Ot)){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);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("."+Jt))||(o=t.createElement("div",{className:Jt}),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(yt)||t.closest(this.actionObj.target,"td").classList.contains(vt))){this.parent.activeViewOptions.timeScale.enable&&this.swapDragging(e);var n=this.parent.element.querySelector("."+wi),r=t.extend({},this.actionObj.event,null,!0),a=r[this.parent.eventFields.startTime],s=N(r[this.parent.eventFields.endTime])-N(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&&(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;if(this.isAllDayDrag)l=this.parent.element.querySelector("."+mt);else{l=[].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(yt)&&!t.closest(this.actionObj.target,"td").classList.contains(vt)||(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.appendCloneElement(this.getEventWrapper(u)),(v=this.parent.getDateFromElement(g)).setMinutes(v.getMinutes()+h/c),m=new Date(v.getTime()),this.actionObj.element.classList.contains(Xi)?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(Xi)&&this.actionObj.clone.classList.contains(Xi)&&(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++){var D=w[T];t.remove(D)}if(this.multiData.length>0){if(this.isAllDayTarget&&this.isAllDayDrag&&!t.isNullOrUndefined(this.actionObj.isAllDay)&&!this.actionObj.isAllDay){var C=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()+(C-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=C}if(this.isAllDayTarget&&this.isAllDayDrag&&!t.isNullOrUndefined(this.actionObj.isAllDay)&&this.actionObj.isAllDay&&this.swagData.length>0){this.multiData=this.swagData,this.swagData=[];var S=t.extend({},this.actionObj.event,null,!0);this.startTime=S[this.parent.eventFields.startTime].getTime()}for(var E=y[this.parent.eventFields.startTime].getTime()-this.startTime,x=0;x<this.multiData.length;x++){this.updatedData[parseInt(x.toString(),10)]=this.updateMultipleData(this.multiData[parseInt(x.toString(),10)],E);var V=this.getDayIndex(this.updatedData[parseInt(x.toString(),10)]);if(V>=0){D=this.getEventWrapper(V,this.updatedData[parseInt(x.toString(),10)][this.parent.eventFields.isAllDay]);this.appendCloneElement(D,this.actionObj.cloneElement[parseInt(x.toString(),10)]),this.updateEventHeight(this.updatedData[parseInt(x.toString(),10)],x,V)}else t.isNullOrUndefined(this.actionObj.cloneElement[parseInt(x.toString(),10)].parentNode)||t.remove(this.actionObj.cloneElement[parseInt(x.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=ei;return o=this.parent.activeViewOptions.timeScale.enable&&i[this.parent.eventFields.isAllDay]?Gi:yt,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(var a=0;a<this.actionObj.groupIndex;a++)this.verticalEvent.dateRender[parseInt(a.toString(),10)]&&(r+=this.verticalEvent.dateRender[parseInt(a.toString(),10)].length);var s=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){var o=-1,l=this.parent.activeViewOptions.group.byDate?this.parent.getIndexOfDate(this.verticalEvent.dateRender[parseInt(s.toString(),10)],b(this.parent.getDateFromElement(t.isNullOrUndefined(i)?this.actionObj.target:this.targetTd))):t.isNullOrUndefined(i)?this.actionObj.index-r:n-r,p=this.splitEvent(e),c=this.parent.eventBase.isAllDayAppointment(e)||p.length>2||"TimeSlot"!==this.parent.eventSettings.spannedEventPlacement?[e]:p;for(a=0;a<c.length;a++){if(a>0){var h='.e-day-wrapper[data-date="'+b(c[parseInt(a.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?(l+=1,o=d.cellIndex):l=-1}if(l>=0){var u=this.verticalEvent.isSpannedEvent(c[parseInt(a.toString(),10)],l,s),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,l,s):this.actionObj.element.offsetTop;if(t.isNullOrUndefined(i))0===a?(this.actionObj.clone.style.top=t.formatUnit(f),this.actionObj.clone.style.height=t.formatUnit(m)):this.renderSpannedEvents(u,o,f,m);else{var y=this.actionObj.cellWidth;if(e[this.parent.eventFields.isAllDay]){f=this.parent.element.querySelector("."+mt).offsetTop,m=this.getAllDayEventHeight();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===a?(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,o,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],[ji,"e-dynamic-clone"]),t.setStyleAttribute(a,{width:"100%",height:r+"px",top:n+"px",border:"0px"});[].slice.call(this.parent.element.querySelectorAll("."+Jt))[parseInt(i.toString(),10)].appendChild(a)}},i.prototype.getRenderedDates=function(){var e,t,i=this,n=this.parent.activeView.renderDates;if((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}))}return 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){var i=!t.isNullOrUndefined(t.closest(this.actionObj.target,"td"))&&t.closest(this.actionObj.target,"td").cellIndex;if(t.closest(this.actionObj.target,"."+Dt)&&!t.closest(this.actionObj.clone,"."+Gi)){t.addClass([this.actionObj.clone],Xi),this.appendCloneElement(this.getEventWrapper(i)),this.actionObj.isAllDay=!0;var n=this.getAllDayEventHeight(),r=[].slice.call(this.parent.element.querySelectorAll("."+vt+":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("."+mt).offsetTop)})}if(t.closest(this.actionObj.target,"."+yt)&&!t.closest(this.actionObj.clone,"."+ei)){t.removeClass([this.actionObj.clone],Xi),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=N(i[this.parent.eventFields.endTime])-N(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("."+yt))[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=N(i[this.parent.eventFields.startTime])-N(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("."+ji));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/nt);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=N(i[this.parent.eventFields.endTime])-N(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.floor(r/Math.trunc(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("."+wi),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(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*rt;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){var T=this.isTimelineDayProcess?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)}else g.setMinutes(g.getMinutes()-this.cursorPointIndex*(this.isTimelineDayProcess?1440:this.actionObj.slotInterval));if(this.isStepDragging||(g=this.calculateIntervalTime(g)),this.isTimelineDayProcess){var w=i[this.parent.eventFields.startTime];g.setHours(w.getHours(),w.getMinutes(),w.getSeconds())}if(this.parent.eventDragArea){var D=this.parent.getDateFromElement(e.target);if(!t.isNullOrUndefined(D))if(this.parent.activeViewOptions.timeScale.enable&&"TimelineMonth"!==this.parent.currentView)g=D;else{w=i[this.parent.eventFields.startTime];g=new Date(D.setHours(w.getHours(),w.getMinutes(),w.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,M=this.timelineEventModule.getStartTime(A[0],I),k=this.timelineEventModule.getEndTime(A[0],I),R=this.timelineEventModule.getEventWidth(M,k,i[this.parent.eventFields.isAllDay],I.count),H=this.parent.getIndexOfDate(this.timelineEventModule.dateRender,b(new Date(M.getTime())));H=H<0?0:H;var P=this.timelineEventModule.getPosition(M,k,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("."+wi);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.floor(e/Math.trunc(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(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.cursorPointIndex=Math.abs(Math.ceil(l/nt));else{var p=Math.floor(l/rt/(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("."+wi),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))/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("."+Jt);p||(p=t.createElement("div",{className:Jt}),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=W(r[parseInt(o.toString(),10)])*o;if(this.parent.rowAutoHeight){var d=this.getCursorElement(e);d&&(h=d.classList.contains(yt)?d.offsetTop:d.offsetParent&&d.offsetParent.classList.contains(ci)?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(Xi)),this.parent.activeViewOptions.timeScale.enable){var r=i?"."+Gi:"."+Jt;n=this.parent.element.querySelectorAll(r).item(e)}else{var a=this.parent.element.querySelectorAll("."+yt).item(e);(n=a.querySelector("."+Jt))||(n=t.createElement("div",{className:Jt}),a.appendChild(n))}return n},i.prototype.getAllDayEventHeight=function(){var e=t.createElement("div",{className:ci});this.parent.element.querySelector("."+Gi).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}(Rs),Fs=function(){function e(e){this.previousNextAction="next",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("."+Lt),i=Array.from(e.querySelectorAll("."+Bt));if(i.forEach(function(e){Array.from(e.children).forEach(function(e){e.classList.contains(qt)||e.classList.contains(Ft)||t.remove(e)})}),!t.isNullOrUndefined(this.parent.resourceBase.renderedResources)&&this.parent.resourceBase.renderedResources.length>0)for(var n=0;n<i.length;n++){var r=i[parseInt(n.toString(),10)],a=this.parent.resourceBase.renderedResources[parseInt(n.toString(),10)];!this.parent.activeView||t.isNullOrUndefined(r)||t.isNullOrUndefined(a)||parseInt(r.getAttribute("data-group-index"),10)!==a.groupIndex||this.parent.activeView.setResourceHeaderContent(r,a,Pt)}this.parent.renderTemplates(),this.parent.notify(Ke,{})},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:Rt});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:pi}),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("."+Rt)))},e.prototype.createTableLayout=function(e){var i=e||"",n=t.createElement("table",{className:gt+" "+i}),r=t.createElement("tbody");return n.appendChild(r),n},e.prototype.setAriaAttributes=function(e){e.setAttribute("role","grid"),e.setAttribute("aria-label",this.getLabelText(this.parent.currentView))},e.prototype.createColGroup=function(e,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?k():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=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")},a=0,s=[".e-header-year-cell",".e-header-month-cell",".e-header-week-cell",".e-header-cells"];a<s.length;a++){var o=s[a],l=[].slice.call(this.element.querySelectorAll(o));if(l.length>0){for(var p=0,c=l;p<c.length;p++){c[p].children[0].style[this.parent.enableRtl?"right":"left"]=""}r(l,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("."+ni);t&&(e+=t.offsetHeight)}return e},e.prototype.renderPanel=function(e){e===At?t.prepend([this.element],this.parent.element.querySelector("."+ut)):this.parent.element.querySelector("."+ut).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("."+bt)},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,t){return void 0===t&&(t=this.parent.activeViewOptions.workDays),t.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),!(C(e)<C(i)||C(e)>=C(n)||!this.isWorkDay(e,r)))},e.prototype.getRenderDates=function(e){var t=[];if("Week"===this.parent.currentView||"TimelineWeek"===this.parent.currentView)for(var i=v(b(this.parent.selectedDate),this.parent.activeViewOptions.firstDayOfWeek),n=0,r=7*this.parent.activeViewOptions.interval;n<r;n++)this.parent.activeViewOptions.showWeekend?t.push(i):this.isWorkDay(i,e)&&t.push(i),i=O(i,1);else if("WorkWeek"===this.parent.currentView||"TimelineWorkWeek"===this.parent.currentView){i=v(b(this.parent.selectedDate),this.parent.activeViewOptions.firstDayOfWeek),n=0;for(var a=7*this.parent.activeViewOptions.interval;n<a;n++)this.isWorkDay(i,e)&&t.push(i),i=O(i,1)}else{var s="Agenda"===this.parent.currentView?this.parent.agendaDaysCount:this.parent.activeViewOptions.interval;i=b(this.parent.selectedDate);do{this.parent.activeViewOptions.showWeekend?t.push(i):this.isWorkDay(i,e)&&t.push(i),i=O(i,1)}while(s!==t.length)}return e||(this.renderDates=t),this.parent.headerModule&&this.parent.headerModule.previousNextIconHandler(),t},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.getLabelText=function(e){var t=e.charAt(0).toLowerCase()+e.substring(1);return this.parent.localeObj.getConstant(t)+" of "+U(this.parent.globalize.formatDate(this.parent.selectedDate,{skeleton:"long",calendar:this.parent.getCalendarMode()}),"single")},e.prototype.getDateRangeText=function(){if(this.parent.isAdaptive){var e=this.parent.activeViewOptions.dateFormat?this.parent.activeViewOptions.dateFormat:"MMMM y";return U(this.parent.globalize.formatDate(this.parent.selectedDate,{format:e,calendar:this.parent.getCalendarMode()}),"single")}return this.formatDateRange(this.renderDates[0],this.renderDates[this.renderDates.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="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=dn),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));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],vr)},e.prototype.getColElements=function(){return[].slice.call(this.element.querySelectorAll("."+wi+" col, ."+Dt+" col"))},e.prototype.setColWidth=function(e){if(this.isTimelineView()){var i=this.getColElements(),n=B(this.element.querySelector("."+ft+" tbody"))/(i.length/2);if(e.offsetHeight!==e.clientHeight){var r=this.parent.element.querySelector("."+jt);t.isNullOrUndefined(r)||r.offsetHeight===e.clientHeight||t.setStyleAttribute(r,{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"),r=parseInt(i,10);t.setStyleAttribute(e,{width:t.formatUnit(n*r)})})}},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("."+wi)},e.prototype.wireExpandCollapseIconEvents=function(){if(this.parent.resourceBase&&this.parent.resourceBase.resourceCollection.length>1)for(var e=0,i=[].slice.call(this.element.querySelectorAll("."+Ut));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("."+yt+'[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");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)||(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.destroy=function(){this.element&&this.element.parentNode&&t.remove(this.element),this.element=null,this.renderDates=null,this.colLevels=null},e}(),Us=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)}}(),Bs=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 Us(i,e),i.prototype.getModuleName=function(){return"verticalView"},i.prototype.addEventListener=function(){this.parent.on($e,this.scrollUiUpdate,this),this.parent.on(Xe,this.renderEvents,this)},i.prototype.removeEventListener=function(){this.parent&&(this.parent.off($e,this.scrollUiUpdate),this.parent.off(Xe,this.renderEvents))},i.prototype.renderEvents=function(){this.appointment=this.parent.activeViewOptions.timeScale.enable?new $r(this.parent):new ta(this.parent),this.appointment.renderAppointments(),this.parent.notify(Qe,{})},i.prototype.onContentScroll=function(e){this.parent.removeNewEventElement();var i=e.target;this.parent.notify(Je,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 t=this.parent.element.querySelector("."+Dt),i=this.getHeaderBarHeight(),n=this.getLeftPanelElement(),r=this.getScrollableElement(),a=this.getDatesHeaderElement(),s=this.parent.element.offsetHeight-i-a.offsetHeight;this.setContentHeight(r,n,s),this.setColWidth(r);var o=k();a.firstElementChild.style[e.cssProperties.rtlBorder]="",a.style[e.cssProperties.rtlPadding]="";var l=!this.parent.enableAllDayScroll||!(r.offsetWidth-r.clientWidth<=t.offsetWidth-t.clientWidth&&t.classList.contains("e-all-day-scroll"));r.offsetWidth-r.clientWidth>0&&l?(a.firstElementChild.style[e.cssProperties.border]=o>0?"1px":"0px",a.style[e.cssProperties.padding]=o>0?o-1+"px":"0px"):(a.firstElementChild.style[e.cssProperties.border]="",a.style[e.cssProperties.padding]=""),e.isPreventScrollUpdate||(this.parent.uiStateValues.isInitial?(this.parent.currentView.indexOf("Timeline")>-1&&(r.scrollTop=this.parent.uiStateValues.top),this.scrollToWorkHour(),this.parent.uiStateValues.isInitial=!1):(n&&(n.scrollTop=this.parent.uiStateValues.top),r.scrollTop=this.parent.uiStateValues.top,r.scrollLeft=this.parent.uiStateValues.left)),this.parent.activeViewOptions.timeScale.enable&&this.highlightCurrentTime(),this.retainScrollPosition()}},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("."+Tt);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("."+Ct+'[data-date="'+new Date(b(i)).getTime()+'"]');if(r)if(this.parent.enableRtl){var a=this.element.querySelector("."+ft);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=[Ct];this.isCurrentDate(p)&&c.push(Et),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){if([].slice.call(this.element.querySelectorAll("."+yt)).length>0&&this.changeCurrentTimePosition(),t.isNullOrUndefined(this.currentTimeIndicatorTimer)){var n=rt-(1e3*i.getSeconds()+i.getMilliseconds());n<=rt-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((c=this.parent.getIndexOfDate(l.renderDates,n))>=0){var p=this.parent.activeViewOptions.group.byDate?this.parent.resourceBase.lastResourceLevel.length*c+i:i+c;e.push(p)}i+=this.parent.activeViewOptions.group.byDate?1:l.renderDates.length}}else{var c,h=this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.lastResourceLevel.length>0?this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex].renderDates:this.renderDates;(c=this.parent.getIndexOfDate(h,b(this.parent.getCurrentTime())))>=0&&e.push(c)}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()},rt)},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)){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("."+Zt)),p=0,c=e[0];p<c;p++)l[parseInt(p.toString(),10)].appendChild(t.createElement("div",{className:Xt,styles:"top:"+r}));for(var h=0,d=e;h<d.length;h++){var u=d[h];l[parseInt(u.toString(),10)].appendChild(t.createElement("div",{className:Gt,styles:"top:"+r}))}var g=t.createElement("div",{innerHTML:this.parent.getTimeString(this.parent.getCurrentTime()),className:_t,styles:"top:"+r});a<=o.length&&(t.removeClass(s.querySelectorAll("."+Qt),Qt),o[parseInt(a.toString(),10)]&&t.addClass([o[parseInt(a.toString(),10)].lastElementChild],Qt),t.prepend([g],s),g.style.top=t.formatUnit(g.offsetTop-g.offsetHeight/2))}}},i.prototype.getTopFromDateTime=function(e){var t=this.getStartHour();return(60*(e.getHours()-t.getHours())+(e.getMinutes()-t.getMinutes()))*this.getWorkCellHeight()*this.parent.activeViewOptions.timeScale.slotCount/this.parent.activeViewOptions.timeScale.interval},i.prototype.getWorkCellHeight=function(){return parseFloat(W(this.element.querySelector("."+yt)).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},p=this.parent.activeViewOptions.dateHeaderTemplateName;r=[].slice.call(this.parent.getDateHeaderTemplate()(l,this.parent,s,o+p+s,!1))}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))}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))}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))}}return r},i.prototype.refreshHeader=function(){t.remove(this.element.querySelector("tbody tr")),this.renderHeader(),this.parent.notify(Ke,{});var e=this.element.querySelector("."+Dt);e&&(e.scrollLeft=this.parent.uiStateValues.left)},i.prototype.renderLayout=function(e){this.setPanel(t.createElement("div",{className:yi}));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(ur),this.parent.rowAutoHeight&&this.parent.eventSettings.ignoreWhitespace&&i.push(mr),this.renderPanel(e),t.addClass([this.element],i),this.element.appendChild(this.createTableLayout(Ti)),this.element.querySelector("table").setAttribute("role","presentation"),this.colLevels=this.generateColumnLevels(),this.renderHeader(),this.renderContent(),this.parent.uiStateValues.isGroupAdaptive&&!this.parent.element.querySelector("."+ti)&&this.renderResourceMobileLayout(),this.parent.notify(Ke,{})},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:Mt});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:Kt});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:kt}),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(Ct)){l.className.push(si);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:"list",title:this.parent.localeObj.getConstant("expandAllDaySection"),"aria-disabled":"false","aria-label":"Expand section"},className:Zi+" "+Ji+" "+ct+" "+dt}),d={className:[vt],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:bt}),i=t.createElement("div",{className:Dt});e.appendChild(i);for(var n=this.createTableLayout(),r=t.createElement("tr",{className:_i}),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:mt}),r=0;r<i.length;r++){var a=t.extend({},i[parseInt(r.toString(),10)]);a.className=[vt],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],rr),"resourceHeader"===e.type&&this.setResourceHeaderContent(i,e),"dateHeader"===e.type&&e.className.indexOf(Ct)>=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(He,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:Wt}),n=this.createTableLayout(),r=t.createElement("tr");return this.getTimeSlotRows(function(t){t.type=t.first?"majorSlot":"minorSlot",t.className=t.last?["e-time-cells",zt]:[zt];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}),i.appendChild(n),i},i.prototype.renderContentArea=function(){var e=t.createElement("div",{className:wi}),i=this.createTableLayout(ft);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",{attrs:{"aria-selected":"false"}});return this.getTimeSlotRows(function(t){for(var a=n.cloneNode(),s=0,o=e.colLevels[e.colLevels.length-1];s<o.length;s++){var l=o[s],p=e.createContentTd(l,t,r);a.appendChild(p)}return i.push(a),t}),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(rr),D(s,C(i.date));var o="workCells";if(-1!==e.className.indexOf(Nt)&&(a.push(Ht),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(Tt),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));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(He,v),r},i.prototype.getContentTdClass=function(e){return e.last?[yt]:[yt,Yt]},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("."+Kt):this.getContentAreaElement()},i.prototype.getLeftPanelElement=function(){return this.element.querySelector("."+Wt)},i.prototype.getEndDateFromStartDate=function(e){var t=this.parent.activeViewOptions.timeScale.interval*rt/this.parent.activeViewOptions.timeScale.slotCount,i=new Date(e.getTime());return i.setMilliseconds(i.getMilliseconds()+t),i},i.prototype.getTimeSlotRows=function(e){var t=[],i=this.getStartHour(),n=this.getEndHour(),r=this.parent.activeViewOptions.timeScale.interval*rt,a=r/this.parent.activeViewOptions.timeScale.slotCount,s=Math.round(nt/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(L(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)&&(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}(Fs),Ws=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)}}(),zs=function(e){function t(t){var i=e.call(this,t)||this;return i.viewClass="e-day-view",i}return Ws(t,e),t.prototype.getModuleName=function(){return"day"},t}(Bs),Ys=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)}}(),_s=function(e){function t(t){var i=e.call(this,t)||this;return i.viewClass="e-week-view",i}return Ys(t,e),t.prototype.startDate=function(){return this.getViewStartDate()},t.prototype.endDate=function(){return this.getViewEndDate()},t.prototype.getModuleName=function(){return"week"},t}(Bs),Gs=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)}}(),Xs=function(e){function t(t){var i=e.call(this,t)||this;return i.viewClass="e-work-week-view",i}return Gs(t,e),t.prototype.startDate=function(){return this.getViewStartDate()},t.prototype.endDate=function(){return this.getViewEndDate()},t.prototype.getModuleName=function(){return"workWeek"},t}(Bs),Qs=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)}}(),Ks=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 Qs(i,e),i.prototype.addEventListener=function(){this.parent.on($e,this.onScrollUIUpdate,this),this.parent.on(Xe,this.onDataReady,this),this.parent.on(Ee,this.onCellClick,this)},i.prototype.removeEventListener=function(){this.parent&&(this.parent.off($e,this.onScrollUIUpdate),this.parent.off(Xe,this.onDataReady),this.parent.off(Ee,this.onCellClick))},i.prototype.onDataReady=function(e){this.monthEvent=new ta(this.parent),this.monthEvent.renderAppointments(),this.parent.notify(Qe,{})},i.prototype.onCellClick=function(e){},i.prototype.onContentScroll=function(e){this.parent.removeNewEventElement(),this.parent.notify(Je,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("."+ai)},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=k();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}else this.scrollToSelectedDate();this.retainScrollPosition()},i.prototype.scrollToSelectedDate=function(){var e=this.element.querySelector("."+Ct+'[data-date="'+this.parent.selectedDate.getTime().toString()+'"]'),i=this.getContentAreaElement();t.isNullOrUndefined(e)?i.scrollLeft=0:i.scrollLeft=this.parent.enableRtl?-(this.parent.getContentTable().offsetWidth-e.offsetLeft-e.offsetWidth):e.offsetLeft,0===i.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("."+ft).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=[Ct],o=e.slice(0,i).map(function(e){return e.getDay()});r&&o.indexOf(this.parent.currentTimezoneDate.getDay())===a&&s.push(Et),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:yi}));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(ur),this.parent.rowAutoHeight&&this.parent.eventSettings.ignoreWhitespace&&i.push(mr),t.addClass([this.element],i),this.renderPanel(e),this.element.appendChild(this.createTableLayout(Ti)),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("."+ti)&&this.renderResourceMobileLayout(),this.parent.notify(Ke,{}),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(Ke,{});var e=this.element.querySelector("."+Dt),i=this.element.querySelector("."+wi);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:wi}),a=this.renderContentArea();if("Month"===this.parent.currentView)r.appendChild(a);else{var s=t.createElement("div",{className:ut});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:ai});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:bt}),i=t.createElement("div",{className:Dt});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){var n=t.createElement("span",{innerHTML:U(this.parent.getDayNames(this.dayNameFormat)[e.date.getDay()],"single")});i.appendChild(n)}if("resourceHeader"===e.type&&this.setResourceHeaderContent(i,e),"dateHeader"===e.type){if(t.addClass([i],Ai),i.setAttribute("data-date",e.date.getTime().toString()),this.parent.activeViewOptions.dateHeaderTemplate){var r={date:e.date,type:e.type},a=this.parent.element.id+"_"+this.parent.activeViewOptions.dateHeaderTemplateName+"dateHeaderTemplate",s=[].slice.call(this.parent.getDateHeaderTemplate()(r,this.parent,"dateHeaderTemplate",a,!1));s&&s.length&&t.append(s,i)}else{n=t.createElement("span",{className:Vi});var o=this.parent.globalize.formatDate(e.date,{skeleton:"full",calendar:this.parent.getCalendarMode()});n.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()});n.innerHTML=U(l,"single"),i.appendChild(n)}this.wireCellEvents(i)}var p={elementType:e.type,element:i,date:e.date,groupIndex:e.groupIndex};return this.parent.trigger(He,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||[yt]};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){u=this.renderDates.map(function(e){return new Date(+e)}),g=this.parent.activeViewOptions.showWeekend?7:this.parent.activeViewOptions.workDays.length;var n=this.colLevels.slice(0,1)[0],r=this.renderDates.map(Number).indexOf(+n[0].date);for(v=0;v<this.renderDates.length/g;v++){m=u.splice(0,g);for(var a,s=r,o=function(e){var n=m[parseInt(s.toString(),10)];if(s++,i){var r=l.colLevels[l.colLevels.length-1],o=r.length/g,p=r.slice(0,o);if(l.parent.activeViewOptions.group.hideNonWorkingDays&&0===(p=r.filter(function(e){return e.date.getDay()===n.getDay()})).length)return e-=1,a=e,"continue";for(var c=0;c<p.length;c++){var h=void 0;0!==c&&(h=[yt,"e-disable-date"]),t(v,n,p[parseInt(c.toString(),10)],h)}}else t(v,n,l.colLevels[l.colLevels.length-1][0]);a=e},l=this,p=r;p<this.colLevels[0].length+r&&p<m.length;p++)o(p),p=a}}else for(var c=0,h=this.colLevels[this.colLevels.length-2];c<h.length;c++)for(var d=h[c],u=d.renderDates.map(function(e){return new Date(+e)}),g=this.parent.activeViewOptions.showWeekend?7:d.workDays.length,v=0;v<d.renderDates.length/g;v++)for(var m,f=0,y=m=u.splice(0,g);f<y.length;f++){var T=y[f];t(v,T,d)}return e},i.prototype.updateClassList=function(e){!this.isCustomMonth()&&this.isOtherMonth(e.date)&&e.className.push(Ot),this.parent.isMinMaxDate(e.date)||e.className.push(rr),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(ft);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",{attrs:{"aria-selected":"false"}}),r=this.getContentSlots(),a=0;a<r.length;a++){for(var s=i.cloneNode(),o=0;o<r[parseInt(a.toString(),10)].length;o++){var l=this.createContentTd(r[parseInt(a.toString(),10)][parseInt(o.toString(),10)],n);s.appendChild(l)}e.push(s)}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(Nt)&&(e.className.push(Ht),r="resourceGroupCells"),this.parent.workHours.highlight&&this.isWorkDay(e.date,e.workDays)&&e.className.push(St),this.isCurrentDate(e.date)&&e.className.push(xt),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));t.append(l,n)}var p={elementType:r,element:n,date:e.date,groupIndex:e.groupIndex};return this.parent.trigger(He,p),n},i.prototype.renderDateHeaderElement=function(e,i){if("TimelineMonth"!==this.parent.currentView){var n=t.createElement("div",{className:Ai});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));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],Vi);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.isCustomMonth||this.isCustomRange())?this.parent.activeViewOptions.displayDate:this.parent.uiStateValues.isCustomMonth||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){var t=[],i=b(this.parent.selectedDate),n=this.getMonthStart(i),r=this.getMonthEnd(i);do{this.parent.activeViewOptions.showWeekend?t.push(n):this.isWorkDay(n,e)&&t.push(n),(n=O(n,1)).getHours()>0&&(n=b(n))}while(n.getTime()<=r.getTime());return e||(this.renderDates=t),this.parent.headerModule&&this.parent.headerModule.previousNextIconHandler(),t},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(){if(this.parent.isAdaptive||t.isNullOrUndefined(this.parent.activeViewOptions.dateFormat)){var e=this.parent.selectedDate,i=void 0,n=!1;if(this.isCustomMonth()){var r=this.parent.getCurrentViewDates();(n=r[0].getMonth()!==r[r.length-1].getMonth()||r[0].getFullYear()!==r[r.length-1].getFullYear())&&(e=r[0],i=r[r.length-1])}var a="Month"!==this.parent.currentView||!this.isCustomMonth();if(this.parent.activeViewOptions.interval>1&&a||n){if(i=i||E(y(e),this.parent.activeViewOptions.interval-1),e.getFullYear()===i.getFullYear()){return U(this.parent.globalize.formatDate(e,{format:"MMMM",calendar:this.parent.getCalendarMode()})+" - "+this.parent.globalize.formatDate(i,{format:"MMMM ",calendar:this.parent.getCalendarMode()})+this.parent.globalize.formatDate(i,{skeleton:"y",calendar:this.parent.getCalendarMode()}),"single")}return U(this.parent.globalize.formatDate(e,{format:"MMMM",calendar:this.parent.getCalendarMode()})+" "+e.getFullYear()+" - "+this.parent.globalize.formatDate(i,{format:"MMMM ",calendar:this.parent.getCalendarMode()})+this.parent.globalize.formatDate(i,{skeleton:"y",calendar:this.parent.getCalendarMode()}),"single")}var s=this.parent.activeViewOptions.dateFormat?this.parent.activeViewOptions.dateFormat:"MMMM y";return U(this.parent.globalize.formatDate(e,{format:s,calendar:this.parent.getCalendarMode()}),"single")}return this.formatDateRange(this.parent.selectedDate)},i.prototype.getLabelText=function(e){return this.parent.localeObj.getConstant(e)+" of "+U(this.parent.globalize.formatDate(this.parent.selectedDate,{format:"MMMM y",calendar:this.parent.getCalendarMode()}),"single")},i.prototype.createWeekNumberElement=function(e){var i=t.createElement("tr"),n=t.createElement("td",{className:si,attrs:{title:e?this.parent.localeObj.getConstant("week")+" "+e:""},innerHTML:e||""});i.appendChild(n);var r={elementType:"weekNumberCell",element:n};return this.parent.trigger(He,r),i},i.prototype.unWireEvents=function(){var e=this.element.querySelector("."+wi);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(){!this.parent||this.parent&&this.parent.isDestroyed||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}(Fs),Zs=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)}}(),Js=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 Zs(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:yi}));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],[ur]);var n=this.createTableLayout(Ti);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("."+wi),"scroll",this.onContentScroll,this),this.parent.notify(Ke,{})},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:wi});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(He,{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 "+ft);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.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()+nt);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(He,{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 "+yt,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(Ot),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],rr),this.parent.trigger(He,{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){void 0===i&&(i=this.parent.workHours.start),void 0===n&&(n=this.parent.workHours.end);return[{date:e[0],type:"dateHeader",className:[Ct],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.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));t.append(o,a)},i.prototype.onCellClick=function(e){var i=t.closest(e.target,"."+yt),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(."+Ot+')[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(Ot)&&(i=this.parent.element.querySelector(":not(."+Ot+')[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(Ee,c),this.parent.quickPopup.moreEventClick(p,l)}},i.prototype.onContentScroll=function(e){var t=e.target,i=this.getDatesHeaderElement();this.parent.notify(Je,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("."+bt);n&&(i-=n.offsetHeight);var r=this.element.querySelector("."+wi);if(r&&(r.style.height=t.formatUnit(i)),!this.parent.isAdaptive&&n){var a=k();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.firstDayOfWeek):this.getStartDate()},i.prototype.endDate=function(){return"Year"===this.parent.currentView?O(m(this.getEndDate(),this.parent.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(){var e=this.getStartDate(),t=this.getEndDate();return e.getFullYear()!==t.getFullYear()?this.parent.globalize.formatDate(e,{skeleton:"yMMM"})+" - "+this.parent.globalize.formatDate(t,{skeleton:"yMMM"}):this.parent.globalize.formatDate(this.parent.selectedDate,{skeleton:"y"})},i.prototype.addEventListener=function(){this.parent.on($e,this.onScrollUiUpdate,this),this.parent.on(Xe,this.onDataReady,this)},i.prototype.removeEventListener=function(){this.parent&&(this.parent.off($e,this.onScrollUiUpdate),this.parent.off(Xe,this.onDataReady))},i.prototype.onDataReady=function(e){this.yearEventModule=new Ls(this.parent),this.yearEventModule.renderAppointments(),this.parent.notify(Qe,e)},i.prototype.scrollToDate=function(e){var i=+new Date(b(e)),n=this.element.querySelector("."+yt+":not(."+Ot+')[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)&&this.element){var i=this.element.querySelector("."+wi);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}(Fs),$s=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)}}(),eo=function(e){function i(t){return e.call(this,t)||this}return $s(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:'<div class="'+Mi+'">'+this.parent.localeObj.getConstant("noEvents")+"</div>"})).querySelector(".e-agenda-item").children.length&&s.firstElementChild.appendChild(t.createElement("div",{className:Mi,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:ci,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),!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]?zi:Yi;s.appendChild(t.createElement("div",{className:ct+" "+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(Le,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:vi});t.isNullOrUndefined(r)||""===r||(n+=",");var s=t.createElement("div",{className:Pn});if(this.parent.sanitize(n,s),a.appendChild(s),!t.isNullOrUndefined(r)&&""!==r){var o=t.createElement("div",{className:jn});this.parent.sanitize(r,o),a.appendChild(o)}if(!t.isNullOrUndefined(e[i.recurrenceRule])){var l=e[i.id]===e[i.recurrenceID]?zi:Yi;a.appendChild(t.createElement("div",{className:ct+" "+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);if(!t.isNullOrUndefined(e.data)){d=((c.getTimezoneOffset()!==p.getTimezoneOffset()?c.getTime()-p.getTime()+36e5:c.getTime()-p.getTime())/nt>=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:Ii,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("."+ci));e<i.length;e++){var n=i[e];this.parent.eventBase.wireAppointmentEvents(n,this.parent.getEventDetails(n),!0)}for(var r=0,a=[].slice.call(this.parent.element.querySelectorAll(".e-m-date"));r<a.length;r++){n=a[r];t.EventHandler.add(n,"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;var C=[];n=T;var S=this.parent.eventBase.filterEvents(n,s,D,p[parseInt(b.toString(),10)]);if(S.length>0||!this.parent.hideEmptyAgendaDays||"MonthAgenda"===this.parent.currentView)for(var E=0;E<i;E++){var x=this.parent.eventBase.filterEvents(n,O(n,1),S,void 0);if(((d||!d&&(this.parent.group.byDate?this.isWorkDay(n):this.isWorkDay(n,p[parseInt(b.toString(),10)].workDays)))&&(x.length>0||!this.parent.hideEmptyAgendaDays)||"MonthAgenda"===this.parent.currentView)&&(C.push(x[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:x,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},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(C.length>0){g[g.length-1][1].cssClass="e-day-border";var V={rowSpan:C.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-C.length,className:[mi],date:n};g[parseInt((g.length-C.length).toString(),10)].push(V),v.push(t.extend({},V,null,!0))}break}}}for(var A=l.slice(0,-1),I=[],M=0,k=0;k<A.length;k++){C=A[A.length-(k+1)].dataSource;for(var R=0;R<C.length;R++)for(var H=0,P=0;P<v.length;P++)v[parseInt(P.toString(),10)].groupOrder[A.length-(k+1)]===C[parseInt(R.toString(),10)][A[A.length-(k+1)].idField]&&(M+=v[parseInt(P.toString(),10)].rowSpan,I.push(t.extend({},v[parseInt(P.toString(),10)],null,!0))),++H===v.length&&I.length>0&&(I[0].rowSpan=M,I[0].type="parentColumnLevel_"+(k+1),I[0].resource=A[A.length-(k+1)],I[0].resourceData=C[parseInt(R.toString(),10)],I[0].date=n,g[I[0].groupIndex].push(I[0]),I=[],M=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));var y=[bi,xi];m.cssClass&&y.push(m.cssClass),t.addClass([f],y),this.isCurrentDate(new Date(m.date.getTime()))&&t.addClass(f.childNodes,Ci),n.appendChild(f)}else if("eventColumn"===m.type){var T=0===m.eventData.length?"noEvents":"data";(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],[bi,"e-day-padding"]),n.appendChild(f)}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],[bi,xi,"e-date-border"]);var w=I(this.parent.selectedDate.getTime(),r.date.getTime());if(n.setAttribute("data-row-index",w.toString()),this.parent.element.querySelector('.e-agenda-view tr[data-row-index="'+w+'"]'))break;n.insertBefore(f,n.childNodes[0])}i.appendChild(n)}},i.prototype.createDateHeaderElement=function(e){var i;if(this.parent.activeViewOptions.dateHeaderTemplate){i=t.createElement("div",{className:Ei});var n={date:e,type:"dateHeader"},r=this.parent.element.id+"_"+this.parent.activeViewOptions.dateHeaderTemplateName+"dateHeaderTemplate",a=[].slice.call(this.parent.getDateHeaderTemplate()(n,this.parent,"dateHeaderTemplate",r,!1));t.append(a,i)}else i=this.getMobileDateElement(e,Ei);return i},i.prototype.renderEmptyContent=function(e,i){var n=this.createTableRowElement(i,"noEvents"),r=n.children[0],a=t.createElement("div",{className:"e-empty-event",innerHTML:this.parent.localeObj.getConstant("noEvents")});r.appendChild(a),e.appendChild(n)},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?Oi:bi,"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}(Fs),to=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)}}(),io=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 to(i,e),i.prototype.getModuleName=function(){return"agenda"},i.prototype.renderLayout=function(){this.agendaDates={},this.element=t.createElement("div",{className:yi}),t.addClass([this.element],this.viewClass),this.element.appendChild(this.createTableLayout(Ti)),this.element.querySelector("table").setAttribute("role","presentation"),this.parent.element.querySelector("."+ut).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:wi});i.appendChild(n);var r=this.createTableLayout(ft);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("."+ti)&&this.renderResourceMobileLayout(),this.parent.notify(Ke,{})},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("."+ft+" tbody");j(o),this.renderInitialContent(o,s),this.wireEventActions();t.closest(o,"."+wi).scrollTop=1,this.parent.notify(Qe,{}),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("."+ft+" 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)},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);var T=this.createAgendaContentElement(y,f,m);u.appendChild(T),T.querySelectorAll("li").length>0&&e.appendChild(u)}else this.parent.activeViewOptions.allowVirtualScrolling&&d--;if(this.isCurrentDate(new Date(i.getTime()))&&t.addClass(v.childNodes,Ci),(i=O(i,1)).getTime()>n.getTime())break}}c=new Date(i.getTime()-nt)}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,"."+bi);else if(o===s)n=l[l.length-1],i=t.closest(n,"."+bi);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,"."+bi);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++}if((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;!t.isNullOrUndefined(e)&&t.isNullOrUndefined(i)?(n=b(new Date(e.getTime())),r=D(new Date(n.getTime()),nt)):(n=new Date(e.getTime()),r=new Date(i.getTime()));var a=this.parent.eventBase.filterEvents(n,r);return 0===a.length&&(this.refreshEvent(e),a=this.parent.eventBase.filterEvents(n,r)),a},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,"."+bi),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("."+wi),Ze,this.agendaScrolling,this)},i.prototype.unWireEvents=function(){t.EventHandler.remove(this.element.querySelector("."+wi),Ze,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($e,this.onAgendaScrollUiUpdate,this),this.parent.on(Xe,this.eventLoad,this)},i.prototype.removeEventListener=function(){this.parent&&(this.parent.off($e,this.onAgendaScrollUiUpdate),this.parent.off(Xe,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("."+wi);"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("."+bi+'[data-date="'+t.getTime()+'"]');i&&(this.getContentAreaElement().scrollTop=i.offsetTop)}},i.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed||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}(eo),no=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)}}(),ro=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 no(i,e),i.prototype.getModuleName=function(){return"monthAgenda"},i.prototype.renderAppointmentContainer=function(){var e=this.getContentAreaElement(),i=t.createElement("div",{className:li});e.appendChild(i);var n=t.createElement("div",{className:oi});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(this.monthAgendaDate).getTime()&&e.className.push(ri)},i.prototype.setEventWrapperHeight=function(){var e=(this.parent.headerModule?this.parent.headerModule.getHeaderElement().offsetHeight:0)+2,i=this.parent.element.querySelector("."+ni);i&&(e+=i.offsetHeight);var n=this.getContentAreaElement().firstElementChild,r=this.element.querySelector("."+Dt),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("."+li),p=this.element.querySelector("."+oi);"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("."+yt)[parseInt(r.toString(),10)];l.length>0&&(p.querySelector("."+ki)||p.appendChild(t.createElement("div",{className:ki})),o.getTime()===b(new Date(this.monthAgendaDate.getTime())).getTime()&&this.onEventRender(l,o)),r++}this.parent.notify(Qe,{})},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(Qe,{}),this.monthAgendaDate=new Date(""+e.startTime)},i.prototype.onEventRender=function(e,i){this.agendaBase=this.getAgendaBase();var n=this.element.querySelector("."+oi);if(j(n),0===this.parent.activeViewOptions.group.resources.length||this.parent.uiStateValues.isGroupAdaptive)if(e.length>0){var r=t.createElement("div",{className:pi});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()),nt);return this.parent.eventBase.filterEvents(t,i)},i.prototype.clearElements=function(){for(var e=0,i=[].slice.call(this.element.querySelectorAll("."+ki));e<i.length;e++){var n=i[e];t.remove(n)}this.appendAppContainer(this.element.querySelector("."+oi))},i.prototype.appendAppContainer=function(e){var i=t.createElement("div",{className:pi});t.addClass([i],Mi),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 eo(this.parent)},i.prototype.destroy=function(){this.agendaBase&&(this.agendaBase.destroy(),this.agendaBase=null),e.prototype.destroy.call(this)},i}(Ks),ao=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)/nt+new Date(a).getDay()+1)/7);this.parent.firstDayOfWeek&&this.parent.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}(),so=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)}}(),oo=function(e){function i(t){var i=e.call(this,t)||this;return i.timelineAppointment=null,i.baseCssClass="e-timeline-view",i}return so(i,e),i.prototype.getModuleName=function(){return"timelineViews"},i.prototype.getLeftPanelElement=function(){return this.element.querySelector("."+jt)},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*B(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=[];if(this.parent.activeViewOptions.timeScale.enable&&(i=this.generateTimeSlots(e[e.length-1]),e.push(i)),this.parent.activeViewOptions.headerRows.length>0){e=new ao(this.parent,this.renderDates).generateColumnLevels(t,i)}return e},i.prototype.generateTimeSlots=function(e){for(var i=this,n=this.getTimeSlotRows(function(e){return e.type=e.first?"majorSlot":"minorSlot",e.className=e.first?[zt]:[zt,"e-time-cells"],e.workDays=i.parent.activeViewOptions.workDays,e}),r=[],a=0,s=e;a<s.length;a++){var o=s[a];o.colSpan=n.length;for(var l=0,p=t.extend([],n,null,!0);l<p.length;l++){var c=p[l],h=b(new Date(""+o.date));c.date=D(h,C(c.date)),r.push(c)}}return r},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("."+ft).offsetHeight,r=this.element.querySelector("."+Dt);if(this.element.querySelector("."+wi).appendChild(t.createElement("div",{className:Gt,styles:(this.parent.enableRtl?"right":"left")+":"+t.formatUnit(i)+"; height:"+t.formatUnit(n)})),this.parent.virtualScrollModule){var a=this.parent.element.querySelector("."+Gt),s=this.parent.element.querySelector("."+wi+" table");t.setStyleAttribute(a,{transform:s.style.transform})}var o=t.createElement("div",{innerHTML:this.parent.getTimeString(this.parent.getCurrentTime()),className:_t});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=0,a=60*(i.getHours()-n.getHours())+(i.getMinutes()-n.getMinutes());if(!t.isNullOrUndefined(e)&&0!==e[0]){var s=this.parent.activeView.colLevels.findIndex(function(e){return"dateHeader"===e[0].type});if(this.parent.activeView.colLevels[parseInt(s.toString(),10)]&&this.parent.activeView.colLevels[parseInt(s.toString(),10)][0].colSpan)r=e[0]*this.parent.activeView.colLevels[parseInt(s.toString(),10)][0].colSpan*B(this.element.querySelector(".e-work-cells"));else{var o=this.getEndHour(),l=0===o.getHours()?24:o.getHours();a+=e[0]*(60*(l-n.getHours())+(o.getMinutes()-n.getMinutes()))}}return r+a*B(this.element.querySelector(".e-work-cells"))*this.parent.activeViewOptions.timeScale.slotCount/this.parent.activeViewOptions.timeScale.interval},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",{attrs:{"aria-selected":"false"}}),r=this.getRowCount(),a=0;a<r;a++){for(var s=i.cloneNode(),o=0,l=this.colLevels[this.colLevels.length-1];o<l.length;o++){var p=l[o];this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(p=this.getResourceTdData(a,p));var c=this.createContentTd(p,p,n);s.appendChild(c)}e.push(s)}return e},i.prototype.getContentTdClass=function(e){return e.first||!this.parent.activeViewOptions.timeScale.enable?[yt]:[yt,Yt]},i.prototype.renderEvents=function(){this.timelineAppointment=new na(this.parent,this.parent.activeViewOptions.timeScale.enable?"hour":"day"),this.timelineAppointment.renderAppointments(),this.parent.notify(Qe,{})},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(){!this.parent||this.parent&&this.parent.isDestroyed||(this.timelineAppointment&&(this.timelineAppointment.destroy(),this.timelineAppointment=null),e.prototype.destroy.call(this))},i}(Bs),lo=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)}}(),po=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 lo(i,e),i.prototype.getModuleName=function(){return"timelineMonth"},i.prototype.onDataReady=function(){this.appointment=new na(this.parent,"day"),this.appointment.renderAppointments(),this.parent.notify(Qe,{})},i.prototype.getLeftPanelElement=function(){return this.element.querySelector("."+jt)},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=[Ct];this.isCurrentDate(a)&&s.push(Et),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:wi});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=[yt],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(rr)},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);if(this.parent.activeViewOptions.headerRows.length>0){e=new ao(this.parent,this.renderDates).generateColumnLevels(t,[])}return 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)){if(this.element){var i=this.element.querySelector("."+wi);i&&t.EventHandler.remove(i,"scroll",this.onContentScroll)}this.appointment&&(this.appointment.destroy(),this.appointment=null),e.prototype.destroy.call(this)}},i}(Ks),co=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)}}(),ho=function(e){function i(t){var i=e.call(this,t)||this;return i.viewClass="e-timeline-year-view",i.isInverseTableSelect=!0,i}return co(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:Mt});i.appendChild(n),n.appendChild(this.renderResourceHeader(kt))}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:bt});if(s.appendChild(o),"Horizontal"===this.parent.activeViewOptions.orientation&&this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive)o.appendChild(this.renderResourceHeader(Dt)),this.columnCount=this.colLevels.slice(-1)[0].length;else{var l=t.createElement("div",{className:Dt});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:Ct});"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(He,{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:[Ct],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===Dt?l:[l[0]];c<h.length;c++){var d=h[c],u=t.createElement("td");d.className&&t.addClass([u],d.className),e===Dt&&(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===kt&&this.parent.renderHeaderIndentTemplate(d,u);var g={elementType:d.type,element:u,date:d.date,groupIndex:d.groupIndex};this.parent.trigger(He,g),p.appendChild(u)}n.querySelector("tbody").appendChild(p)}return e===Dt&&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:yr});r.appendChild(o),o.appendChild(this.createTableLayout()),n=o.querySelector("tbody")}s.push(a),t.append(s,i);var l=t.createElement("div",{className:wi});a.appendChild(l);var p=this.createTableLayout(ft);this.setAriaAttributes(p),l.appendChild(p);var c=t.createElement("div",{className:Rt});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("."+yr+" ."+gt);u&&d.push(u),t.addClass(d,vr)}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:pi}));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:Oi});"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(He,{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:yt,attrs:{"aria-selected":"false","aria-label":y}});d.appendChild(T);var w=t.createElement("div",{className:Ai+" "+Vi,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(St),this.parent.isMinMaxDate(g)||t.addClass([T],rr),this.isCurrentDate(g)&&(b.push(Et),"Horizontal"===this.parent.activeViewOptions.orientation?D.push(this.element.querySelector("."+Ct+":nth-child("+(v+1)+")")):D.push(this.element.querySelectorAll("."+Oi).item(s))),b.length>0&&t.addClass(D,b)}else t.addClass([T],Ot),this.parent.isMinMaxDate(g)||t.addClass([T],rr);T.classList.contains(Ot)||(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(He,{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=0;n<this.parent.resourceBase.renderedResources.length;n++){var r=t.createElement("tr");e.push(r);var a=void 0;this.parent.activeViewOptions.group.resources.length>0&&!this.parent.uiStateValues.isGroupAdaptive&&(a=this.parent.resourceBase.renderedResources[parseInt(n.toString(),10)]);for(var s=new Date(this.parent.selectedDate.getFullYear(),i[parseInt(n.toString(),10)],1),o=this.parent.calendarUtil.getMonthStartDate(new Date(s.getTime())),l=0;l<this.columnCount;l++){var p=[],c=a.groupIndex;(p=p.concat(a.className)).indexOf(Nt)>-1?p.push(Ht):p.push(St),s=new Date(this.parent.selectedDate.getFullYear(),i[parseInt(l.toString(),10)],1),o=this.parent.calendarUtil.getMonthStartDate(new Date(s.getTime()));var h=t.createElement("td",{className:yt,attrs:{"aria-selected":"false","data-date":o.getTime().toString()}});t.addClass([h],p),h.setAttribute("data-group-index",c.toString()),this.renderCellTemplate({date:o,type:"resourceGroupCells",groupIndex:c},h),this.wireEvents(h),this.parent.trigger(He,{elementType:"resourceGroupCells",element:h,date:o}),r.appendChild(h)}}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:pi}));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:Oi,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(Nt)>-1?u.push(Ht):u.push(St),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(St));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:yt,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(He,{elementType:"resourceGroupCells",element:f,date:p})}}"Vertical"===this.parent.activeViewOptions.orientation&&this.collapseRows(this.parent.element.querySelector("."+wi))},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))):[].slice.call(this.parent.getMonthHeaderTemplate()(n,this.parent,"monthHeaderTemplate",a,!1))},i.prototype.renderCellTemplate=function(e,i){if(this.parent.activeViewOptions.cellTemplate&&!i.classList.contains(Ot)){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));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("."+ft);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("."+Kt):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}(Js),uo=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;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]){var d=e[p.recurrenceException].split(",");n.filterEvents(r,p.recurrenceID,e[p.id]).forEach(function(e){c.push(we(e[p.startTime]))});var u=d.filter(function(e){return-1===c.indexOf(e)});e[p.recurrenceException]=u.length>0?u.join(",")+",":""}var g=e[p.startTimezone]||l,v=e[p.endTimezone]||l,m=!!e[p.isReadonly]&&e[p.isReadonly],f=["BEGIN:VEVENT","LOCATION:"+(e[p.location]||""),"SUMMARY:"+(e[p.subject]||""),"UID:"+i,"DESCRIPTION:"+(e[p.description]||""),"ISREADONLY:"+m,"END:VEVENT"];if(e[p.isAllDay]?(f.splice(4,0,"DTEND;VALUE=DATE:"+n.convertDateToString(e[p.endTime],!0)),f.splice(4,0,"DTSTART;VALUE=DATE:"+n.convertDateToString(e[p.startTime],!0))):e[p.isAllDay]||e[p.recurrenceRule]?(f.splice(4,0,'DTEND;TZID="'+v+'":'+n.convertDateToString(e[p.endTime])),f.splice(4,0,'DTSTART;TZID="'+g+'":'+n.convertDateToString(e[p.startTime]))):(f.splice(4,0,"DTEND:"+n.convertDateToString(e[p.endTime])),f.splice(4,0,"DTSTART:"+n.convertDateToString(e[p.startTime]))),e[p.recurrenceRule]&&f.splice(4,0,"RRULE:"+e[p.recurrenceRule]),e[p.recurrenceException]){d=e[p.recurrenceException].split(",");for(var y=0;y<d.length-1;y++)f.splice(5,0,"EXDATE:"+n.convertDateToString(X(d[parseInt(y.toString(),10)]),e[p.isAllDay]))}e[p.recurrenceID]&&f.splice(4,0,'RECURRENCE-ID;TZID="'+g+'":'+n.convertDateToString(e[p.startTime],e[p.isAllDay]));var T=n.customFieldFilter(e,p);T.length>0&&T.forEach(function(t){return f.splice(4,0,t+":"+(e[""+t]||""))});var w=t.extend({},e);w.UID=i,o.push(w),s.push(f.join(a))});return["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}(),go=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[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=we(this.dateParsing(e)),l[n.recurrenceException]=t.isNullOrUndefined(l[n.recurrenceException])?d:l[n.recurrenceException]+","+d;else if(-1!==e.indexOf("RECURRENCE-ID"))d=we(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}(),vo=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){a=t.extend({},a,{style:{fontSize:12,numberFormat:"m/d/yyyy h:mm AM/PM"}},!0)}r.push(a)}),l.push({index:n+2,cells:r})});var d=[{columns:o,rows:l}];new c.Workbook({worksheets:d},n,this.parent.locale,void 0,a).save(i+"."+n)},e.prototype.getExportColumns=function(e){var t=this,i=e.fieldsInfo||[];if(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})})}return i},e.prototype.getModuleName=function(){return"excelExport"},e.prototype.destroy=function(){this.parent=null},e}(),mo=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.parent.element.cloneNode(!0);e.id=this.parent.element.id+"_print",document.body.appendChild(e);for(var i="MonthAgenda"===this.parent.currentView?".e-appointment-wrap":".e-content-wrap",n=this.parent.element.querySelector(i),r="",a=0,s=[].slice.call(document.getElementsByTagName("head")[0].querySelectorAll("link, style"));a<s.length;a++){r+=s[a].outerHTML}var o=t.createElement("div");e.style.width=this.parent.element.offsetWidth+"px";var l=100*Math.round(parseInt(e.style.width,10)/100);o.appendChild(e);var p=window.open("","print","height=550,width="+l+",tabbar=no");p.document.write("<!DOCTYPE html><html><head>"+r+"</head><body>"+o.innerHTML+"<script>(function() { window.ready = true; })();<\/script></body></html>"),p.document.close(),p.focus(),setTimeout(function(){if(p.ready&&n){n.scrollLeft=n.scrollLeft,n.scrollTop=n.scrollTop;var e=p.document.querySelector(".e-date-header-wrap");e&&(e.scrollLeft=n.scrollLeft);var t=p.document.querySelector(".e-time-cells-wrap");t&&(t.scrollTop=n.scrollTop);var r=p.document.querySelector(i);r&&(r.scrollLeft=n.scrollLeft,r.scrollTop=n.scrollTop),p.print(),p.close()}},500)},e.prototype.printSchedulerWithModel=function(e){var i=t.createElement("div",{id:this.parent.element.id+"_print",className:"e-print-schedule"});document.body.appendChild(i),ks.Inject(zs,_s,Xs,Ks,io,ro,oo,po,Js,ho),this.printInstance=new ks(this.getPrintScheduleModel(e)),this.printInstance.isPrinting=!0,this.printInstance.appendTo(i),this.printInstance.on(Ge,this.contentReady,this),this.printWindow=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no"),this.printWindow.moveTo(0,0),this.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="function"==typeof d?null:d,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).majorSlotTemplate="function"==typeof r.majorSlotTemplate?null:r.majorSlotTemplate,r.minorSlotTemplate="function"==typeof r.minorSlotTemplate?null:r.minorSlotTemplate,e.timeScale=r;break;case"views":if((a=t.isNullOrUndefined(e.views)?this.parent.views:e.views)&&a.length>0&&"object"==typeof a[0])for(var u=function(e){o.forEach(function(i){t.isNullOrUndefined(e[""+i])||(e[""+i]="function"==typeof e[""+i]?null:e[""+i])})},g=0,v=a;g<v.length;g++){u(v[g])}s.views=a;break;default:if(o.indexOf(h)>-1){s[""+h]=t.isNullOrUndefined(e[""+h])?"function"==typeof this.parent[""+h]?null:this.parent[""+h]:"function"==typeof e[""+h]?null:e[""+h];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.printWindow.onbeforeunload=function(){e.printInstance.off(Ge,e.contentReady),e.printInstance.element.remove(),e.printInstance.destroy(),e.printInstance=null,e.printWindow=null}},e.prototype.getModuleName=function(){return"print"},e.prototype.destroy=function(){this.parent=null},e}();e.Schedule=ks,e.cellClick=Ee,e.cellDoubleClick=xe,e.moreEventsClick=Ve,e.select=Ae,e.hover="hover",e.actionBegin=Ie,e.actionComplete=Me,e.actionFailure=ke,e.navigating=Re,e.renderCell=He,e.eventClick=Pe,e.eventDoubleClick=je,e.eventRendered=Le,e.dataBinding=Ne,e.dataBound="dataBound",e.popupOpen=qe,e.popupClose=Fe,e.dragStart="dragStart",e.drag="drag",e.dragStop="dragStop",e.resizeStart=Ue,e.resizing="resizing",e.resizeStop=Be,e.inlineClick=We,e.cellSelect=ze,e.virtualScrollStart=Ye,e.virtualScrollStop=_e,e.initialLoad="initial-load",e.initialEnd="initial-end",e.print=Ge,e.dataReady=Xe,e.eventsLoaded=Qe,e.contentReady=Ke,e.scroll=Ze,e.virtualScroll=Je,e.scrollUiUpdate=$e,e.uiUpdate=et,e.documentClick=tt,e.cellMouseDown=it,e.WEEK_LENGTH=7,e.DEFAULT_WEEKS=6,e.MS_PER_DAY=nt,e.MS_PER_MINUTE=rt,e.getElementHeightFromClass=h,e.getElementWidthFromClass=d,e.getTranslateY=u,e.getTranslateX=g,e.getWeekFirstDate=v,e.getWeekLastDate=m,e.firstDateOfMonth=f,e.lastDateOfMonth=y,e.getWeekNumber=T,e.getWeekMiddleDate=w,e.setTime=D,e.resetTime=b,e.getDateInMs=C,e.getDateCount=S,e.addDays=O,e.addMonths=E,e.addYears=x,e.getStartEndHours=V,e.getMaxDays=A,e.getDaysCount=I,e.getDateFromString=M,e.getScrollBarWidth=k,e.resetScrollbarWidth=R,e.findIndexInData=H,e.getOuterHeight=P,e.removeChildren=j,e.isDaylightSavingTime=L,e.getUniversalTime=N,e.isMobile=q,e.isIPadDevice=F,e.capitalizeFirstWord=U,e.getElementWidth=B,e.getElementHeight=W,e.getElementTop=z,e.Resize=Ps,e.DragAndDrop=qs,e.HeaderRenderer=Or,e.ViewBase=Fs,e.Day=zs,e.Week=_s,e.WorkWeek=Xs,e.Month=Ks,e.Year=Js,e.Agenda=io,e.MonthAgenda=ro,e.TimelineViews=oo,e.TimelineMonth=po,e.TimelineYear=ho,e.Timezone=kr,e.timezoneData=Rr,e.ICalendarExport=uo,e.ICalendarImport=go,e.ExcelExport=vo,e.Print=mo,e.RecurrenceEditor=za,e.generateSummary=Y,e.generate=G,e.getDateFromRecurrenceDateString=X,e.extractObjectFromRule=ve,e.getCalendarUtil=Te,e.getRecurrenceStringFromDate=we,e.Gregorian=Ir,e.Islamic=Mr,Object.defineProperty(e,"__esModule",{value:!0})});
10
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-navigations"),require("@syncfusion/ej2-calendars"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-inputs"),require("@syncfusion/ej2-dropdowns"),require("@syncfusion/ej2-lists"),require("@syncfusion/ej2-excel-export")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-popups","@syncfusion/ej2-navigations","@syncfusion/ej2-calendars","@syncfusion/ej2-data","@syncfusion/ej2-buttons","@syncfusion/ej2-inputs","@syncfusion/ej2-dropdowns","@syncfusion/ej2-lists","@syncfusion/ej2-excel-export"],t):t((e=e||self).ej={},e.ej2Base,e.ej2Popups,e.ej2Navigations,e.ej2Calendars,e.ej2Data,e.ej2Buttons,e.ej2Inputs,e.ej2Dropdowns,e.ej2Lists,e.ej2ExcelExport)}(this,function(e,U,M,k,R,H,P,j,L,N,q){"use strict";var F="cellClick",_="cellDoubleClick",G="moreEventsClick",X="select",Q="hover",K="actionBegin",Z="actionComplete",J="actionFailure",$="navigating",ee="renderCell",te="eventClick",ie="eventDoubleClick",ne="eventRendered",re="dataBinding",ae="dataBound",se="popupOpen",oe="popupClose",le="dragStart",pe="drag",ce="dragStop",he="resizeStart",de="resizing",ue="resizeStop",ge="inlineClick",me="cellSelect",ve="virtualScrollStart",fe="virtualScrollStop",ye="print",Te="data-ready",we="events-loaded",De="content-ready",be="scroll",Ce="virtual-scroll",Se="scroll-ui-update",Oe="ui-update",Ee="document-click",Ve="cell-mouse-down",B=864e5,xe=6e4;function Ae(e,t){t=U.createElement("div",{className:t}).cloneNode();return t.style.visibility="hidden",t.style.position="absolute",e.appendChild(t),e=at(t),U.remove(t),e}function Ie(e,t){t=U.createElement("div",{className:t}).cloneNode();return t.style.visibility="hidden",t.style.position="absolute",e.appendChild(t),e=V(t),U.remove(t),e}function Me(e){e=getComputedStyle(e);return window.WebKitCSSMatrix?new WebKitCSSMatrix(e.webkitTransform).m42:0}function ke(e){e=getComputedStyle(e);return window.WebKitCSSMatrix?new WebKitCSSMatrix(e.webkitTransform).m41:0}function Re(e,t){e=new Date(e.getTime());return t=(t-e.getDay()-7)%7,new Date(e.setDate(e.getDate()+(isNaN(t)?0:t)))}function He(e,t){e=Re(e,t),t=new Date(e.getFullYear(),e.getMonth(),e.getDate()+6);return new Date(t.getTime())}function Pe(e){return new Date(e.getFullYear(),e.getMonth(),1)}function je(e){return new Date(e.getFullYear(),e.getMonth()+1,0)}function Le(e){var t=new Date(e.getFullYear(),0,1).valueOf(),e=new Date(e.getFullYear(),e.getMonth(),e.getDate()).valueOf();return Math.ceil((e-t+B)/B/7)}function Ne(e,t){return new Date(t.valueOf()-(t.valueOf()-e.valueOf())/2)}function qe(e,t){var i=e.getTimezoneOffset(),t=new Date(e.getTime()+t),i=t.getTimezoneOffset()-i;return e.setTime(t.getTime()+i*xe),e}function W(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function Fe(e){var t=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0).getTimezoneOffset(),t=e.getTimezoneOffset()-t;return e.getTime()-new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0).getTime()-60*t*1e3}function Ue(e,t){return Math.ceil((t.getTime()-e.getTime())/B)}function z(e,t){return e=new Date(""+e),new Date(e.setDate(e.getDate()+t))}function Be(e,t){var i=(e=new Date(""+e)).getDate();return e.setDate(1),e.setMonth(e.getMonth()+t),e.setDate(Math.min(i,Ye(e))),e}function We(e,t){var i=(e=new Date(""+e)).getDate();return e.setDate(1),e.setFullYear(e.getFullYear()+t),e.setDate(Math.min(i,Ye(e))),e}function ze(e,t,i){var n=new Date(e.getTime()),t=(n.setHours(t.getHours()),n.setMinutes(t.getMinutes()),n.setSeconds(t.getSeconds()),new Date(e.getTime()));return 0===i.getHours()?t=z(t,1):(t.setHours(i.getHours()),t.setMinutes(i.getMinutes()),t.setSeconds(i.getSeconds())),{startHour:n,endHour:t}}function Ye(e){return je(e).getDate()}function _e(e,t){e=W(new Date(e)),t=W(new Date(t));return Math.round((t.getTime()-e.getTime())/B)}function Ge(e){return-1!==e.indexOf("Date")?new Date(parseInt(e.match(/\d+/g).toString(),10)):-1!==e.indexOf("T")?new Date(e):new Date(e.replace(/-/g,"/"))}var Xe=null,Qe=null;function Ke(){if(null!==Xe)return Xe;null===Qe&&(Qe=window.devicePixelRatio||window.screen.availWidth/document.documentElement.clientWidth);var e=U.createElement("div"),t=(e.style.cssText="width:100px;height: 100px;overflow: scroll;position: absolute;top: -9999px;",document.body.appendChild(e),devicePixelRatio?"1.10"===devicePixelRatio.toFixed(2)||devicePixelRatio<=1?Math.ceil(devicePixelRatio%1):Math.floor(devicePixelRatio%1):0),t=e.offsetWidth-e.clientWidth-t|0;return document.body.removeChild(e),Xe=t}function Ze(){var e=window.devicePixelRatio||window.screen.availWidth/document.documentElement.clientWidth;Qe&&Qe!==e&&(Xe=null,Qe=e)}function Je(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 $e(e){var t=getComputedStyle(e);return e.offsetHeight+(parseInt(t.marginTop,10)||0)+(parseInt(t.marginBottom,10)||0)}function et(e){for(var t=0,i=[].slice.call(e.children);t<i.length;t++){var n=i[t];e.removeChild(n)}}function tt(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 it(e){var t=e.getFullYear(),i=e.getMonth(),n=e.getDate(),r=e.getHours(),a=e.getMinutes(),s=e.getSeconds(),e=e.getMilliseconds();return Date.UTC(t,i,n,r,a,s,e)}function nt(){return-1<window.navigator.userAgent.toLowerCase().indexOf("mobi")}function rt(){return-1<window.navigator.userAgent.toLowerCase().indexOf("ipad")}function f(e,t){return"multiple"===t?e=e.split(" ").map(function(e){return e.charAt(0).toLocaleUpperCase()+e.substring(1)}).join(" "):"single"===t&&("0"<=e[0]&&e[0]<="9"&&(t=e.match(/[a-zA-Z]/),e=U.isNullOrUndefined(t)?e:e.slice(0,t.index)+e[t.index].toLocaleUpperCase()+e.slice(t.index+1)),e=e[0].toLocaleUpperCase()+e.slice(1)),e}function V(e){return document.body.style.transform.includes("scale")?e.offsetWidth:e.getBoundingClientRect().width}function at(e){return document.body.style.transform.includes("scale")?e.offsetHeight:e.getBoundingClientRect().height}function st(e){return document.body.style.transform.includes("scale")?e.offsetTop:e.getBoundingClientRect().top}var ot="e-schedule",lt="e-rtl",pt="e-device",ct="e-adaptive",ht="e-multi-drag",dt="e-icons",ut="e-enable",d="e-disable",gt="e-table-container",mt="e-schedule-table",v="e-all-day-cells",vt="e-all-day-row",S="e-content-table",O="e-work-cells",ft="e-work-hours",yt="e-popup-open",Tt="e-date-header-wrap",wt="e-date-header-container",Dt="e-header-cells",bt="e-work-days",E="e-other-month",Ct="e-current-day",St="e-current-date",Ot="e-current-panel",Et="e-previous-panel",Vt="e-next-panel",xt="e-translate",At="e-left-indent",It="e-left-indent-wrap",Mt="e-event-table",kt="e-resource-group-cells",Rt="e-resource-text",Ht="e-resource-column-wrap",Pt="e-resource-column-table",jt="e-child-node",Lt="e-parent-node",Nt="e-resource-expand",qt="e-resource-collapse",Ft="e-resource-tree-icon",Ut="e-resource-cells",Bt="e-time-cells-wrap",Wt="e-time-cells",zt="e-time-slots",Yt="e-alternate-cells",_t="e-current-time",Gt="e-current-timeline",Xt="e-previous-timeline",Qt="e-hide-childs",Kt="e-scroll-container",Zt="e-timeline-wrapper",x="e-appointment-wrapper",Jt="e-appointment-wrapper-hidden",$t="e-day-wrapper",ei="e-schedule-resource-toolbar-container",ti="e-schedule-toolbar",ii="e-schedule-resource-toolbar",ni="e-selected-cell",ri="e-week-number-wrapper",ai="e-week-number",si="e-appointment-wrap",oi="e-wrapper-container",li="e-appointment-container",A="e-appointment",pi="e-block-appointment",ci="e-block-indicator",hi="e-appointment-border",di="e-appointment-details",ui="e-subject-wrap",gi="e-resource-name",mi="e-time",vi="e-table-wrap",fi="e-outer-table",I="e-content-wrap",yi="e-virtual-track",Ti="e-agenda-cells",wi="e-current-day",Di="e-active-appointment-agenda",bi="e-month-header",Ci="e-day-date-header",Si="e-date-column",Oi="e-navigate",Ei="e-date-header",Vi="e-day-border",xi="e-date-time",Ai="e-no-event",Ii="e-appointment-indicator",Mi="e-indicator",ki="e-left-icon",Ri="e-right-icon",Hi="e-event-action",Pi="e-new-event",ji="e-schedule-event-clone",Li="e-clone-time-indicator",Ni="e-drag-clone",qi="e-event-resize",Fi="e-resize-clone",Ui="e-left-handler",Bi="e-right-handler",Wi="e-top-handler",zi="e-bottom-handler",Yi="e-recurrence-icon",_i="e-recurrence-edit-icon",Gi="e-header-row",Xi="e-all-day-appointment-wrapper",Qi="e-all-day-appointment",Ki="e-appointment-hide",Zi="e-row-count-wrapper",Ji="e-all-day-appointment-section",$i="e-appointment-expand",en="e-appointment-collapse",tn="e-more-indicator",nn="e-cell-popup",rn="e-event-popup",an="e-popup-header",sn="e-header-icon-wrapper",on="e-popup-footer",ln="e-date-time-details",pn="e-event-details",cn="e-event-create",hn="e-event-edit",dn="e-event-delete",un="e-text-ellipsis",gn="e-more-popup-wrapper",mn="e-more-event-popup",vn="e-more-event-date-header",fn="e-header-day",yn="e-header-date",Tn="e-more-event-close",wn="e-more-event-content",Dn="e-more-appointment-wrapper",bn="e-quick-dialog-occurrence-event",Cn="e-quick-dialog-series-event",Sn="e-quick-dialog-following-events",On="e-following-events-dialog",En="e-quick-dialog-delete",Vn="e-quick-dialog-cancel",xn="e-quick-alertok",An="e-quick-alertcancel",In="e-quick-alertfollowing",Mn="e-quick-dialog-alert-btn",kn="e-schedule-dialog",Rn="e-schedule-form",Hn="e-all-day",Pn="e-time-zone",jn="e-repeat",Ln="e-subject",Nn="e-location",qn="e-location-details",Fn="e-start",Un="e-end",Bn="e-description",Wn="e-description-details",zn="e-time-zone-row",Yn="e-start-time-zone",_n="e-end-time-zone",Gn="e-save-icon",Xn="e-event-cancel",Qn="e-event-save",Kn="e-title-text",Zn="e-icon-disable",Jn="e-edit",$n="e-edit-icon",er="e-delete",tr="e-delete-icon",ir="e-close",nr="e-close-icon",rr="e-schedule-error",ar="e-animate",sr="e-hidden",or="e-disable-dates",lr="e-quick-popup-wrapper",pr="e-resource-menu",cr="e-icon-menu",hr="e-resource-level-title",dr="e-resource-tree-popup-overlay",ur="e-resource-tree-popup",gr="e-resource",mr="e-resource-icon",vr="e-resource-details",fr="e-date-time-icon",yr="e-virtual-scroll",Tr="e-icon-disable",wr="e-auto-height",Dr="e-ignore-whitespace",br="e-read-only",Cr="e-month-header-wrapper",Sr="e-inline-subject",Or="e-inline-appointment",Er="e-scroll-hidden",Vr="e-all-day-scroll",xr="e-all-day-auto",Ar=function(){return(Ar=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},Ir=(t.prototype.addEventListener=function(){this.parent.on(Ee,this.closeHeaderPopup,this)},t.prototype.removeEventListener=function(){this.parent.off(Ee,this.closeHeaderPopup)},t.prototype.closeHeaderPopup=function(e){var t,i,n=U.closest(e.event.target,".e-date-range,.e-header-popup,.e-day,.e-selected"),e=U.closest(e.event.target,".e-hor-nav,.e-toolbar-pop"),r=this.parent.element.querySelector("."+I);this.parent.isAdaptive&&(U.isNullOrUndefined(e)||!e.classList.contains("e-toolbar-pop")&&!e.classList.contains("e-hor-nav")||e.classList.contains("e-hor-nav")&&this.element.querySelector(".e-toolbar-pop").classList.contains(yt)?(U.removeClass([r],Er),t=this.element.querySelector(".e-toolbar-pop"),U.isNullOrUndefined(t)||!(i=t.ej2_instances[0])||!U.isNullOrUndefined(e)&&e.classList.contains("e-hor-nav")&&t.classList.contains(yt)||i.hide()):U.addClass([r],Er)),U.isNullOrUndefined(n)&&this.hideHeaderPopup()},t.prototype.hideHeaderPopup=function(){this.headerPopup&&this.headerPopup.hide()},t.prototype.renderHeader=function(){this.element=U.createElement("div",{className:"e-schedule-toolbar-container"});var e=U.createElement("div",{className:ti});this.element.appendChild(e),this.parent.element.insertBefore(this.element,this.parent.element.firstElementChild),this.renderToolbar()},t.prototype.renderToolbar=function(){var t=this,e=this.parent.toolbarItems&&0<this.parent.toolbarItems.length?this.getToolbarItems():this.getItems();this.parent.trigger(K,{requestType:"toolbarItemRendering",items:e},function(e){t.toolbarObj=new k.Toolbar({items:e.items,overflowMode:"Popup",clicked:t.toolbarClickHandler.bind(t),enableRtl:t.parent.enableRtl,enableHtmlSanitizer:t.parent.enableHtmlSanitizer,locale:t.parent.locale}),t.toolbarObj.root=t.parent.root||t.parent,t.toolbarObj.appendTo(t.parent.element.querySelector("."+ti)),t.toolbarObj.element.setAttribute("aria-label","Scheduler");e=t.toolbarObj.element.querySelector(".e-prev"),e&&e.firstElementChild.setAttribute("title",t.l10n.getConstant("previous")),e=t.toolbarObj.element.querySelector(".e-next");e&&e.firstElementChild.setAttribute("title",t.l10n.getConstant("next")),t.updateAddIcon(),t.updateActiveView(),t.parent.trigger(Z,{requestType:"toolBarItemRendered",items:t.toolbarObj.items})})},t.prototype.updateItems=function(){var e,t=this;this.toolbarObj&&(e=this.getItems(),this.parent.trigger(K,{requestType:"toolbarItemRendering",items:e},function(e){t.toolbarObj.items=e.items,t.toolbarObj.dataBind(),t.parent.trigger(Z,{requestType:"toolBarItemRendered",items:t.toolbarObj.items})}))},t.prototype.getPopUpRelativeElement=function(){return this.parent.isAdaptive?this.toolbarObj.element:this.element.querySelector(".e-date-range")},t.prototype.setDayOfWeek=function(e){this.headerCalendar&&(this.headerCalendar.firstDayOfWeek=e,this.headerCalendar.dataBind())},t.prototype.setCalendarDate=function(e){this.headerCalendar&&(this.headerCalendar.value=e,this.headerCalendar.dataBind())},t.prototype.setCalendarMinMaxDate=function(){this.headerCalendar&&(this.headerCalendar.min=this.parent.minDate,this.headerCalendar.max=this.parent.maxDate,this.headerCalendar.dataBind())},t.prototype.getCalendarView=function(){return-1<["Month","MonthAgenda","TimelineMonth"].indexOf(this.parent.currentView)?"Year":-1<["Year","TimelineYear"].indexOf(this.parent.currentView)?"Decade":"Month"},t.prototype.setCalendarView=function(){var e;this.headerCalendar&&(e=this.getCalendarView(),this.headerCalendar.depth=e,this.headerCalendar.start=e,this.headerCalendar.refresh())},t.prototype.updateActiveView=function(){var e=[].slice.call(this.toolbarObj.element.querySelectorAll(".e-views"));U.removeClass(e,["e-active-view"]),0<e.length&&e[this.parent.viewIndex]&&U.addClass([e[this.parent.viewIndex]],["e-active-view"])},t.prototype.updateDateRange=function(e){var t,i,n,r=this.toolbarObj.element.querySelector(".e-date-range");r&&(r.firstElementChild.setAttribute("aria-haspopup","true"),t=r.querySelector(".e-tbar-btn-text"),this.parent.activeViewOptions.dateRangeTemplate?(t.textContent="",i={startDate:this.parent.activeView.getStartDate(),endDate:this.parent.activeView.getEndDate(),currentView:this.parent.currentView},n=this.parent.activeViewOptions.dateRangeTemplateName,n=this.parent.element.id+"_"+n+"dateRangeTemplate",i=[].slice.call(this.parent.getDateRangeTemplate()(i,this.parent,"dateRangeTemplate",n,!1,void 0,void 0,this.parent.root)),U.append(i,t)):(n=this.parent.activeView.getDateRangeText(e),r.firstElementChild.setAttribute("aria-label",n),t.textContent=n),this.refresh())},t.prototype.refresh=function(){this.toolbarObj&&this.toolbarObj.refreshOverflow()},t.prototype.updateAddIcon=function(){var e=this.toolbarObj.element.querySelector(".e-add");e&&(this.parent.eventSettings.allowAdding?U.removeClass([e],sr):U.addClass([e],sr))},t.prototype.getDateRangeText=function(){return f(this.parent.globalize.formatDate(this.parent.selectedDate,{format:"MMMM y",calendar:this.parent.getCalendarMode()}),"single")},t.prototype.getItemModel=function(e){var t={};return e.id&&(t.id=e.id),e.text&&(t.text=e.text),e.tooltipText&&(t.tooltipText=e.tooltipText),e.prefixIcon&&(t.prefixIcon=e.prefixIcon),e.cssClass&&(t.cssClass=e.cssClass),"Both"!==e.showTextOn&&(t.showTextOn=e.showTextOn),e.template&&(t.template=e.template),e.disabled&&(t.disabled=e.disabled),"auto"!==e.width&&(t.width=e.width),e.suffixIcon&&(t.suffixIcon=e.suffixIcon),"Left"!==e.align&&(t.align=e.align),"None"!==e.overflow&&(t.overflow=e.overflow),e.htmlAttributes&&(t.htmlAttributes=e.htmlAttributes),"Button"!==e.type&&(t.type=e.type),!0!==e.visible&&(t.visible=e.visible),e.showAlwaysInPopup&&(t.showAlwaysInPopup=e.showAlwaysInPopup),-1!==e.tabIndex&&(t.tabIndex=e.tabIndex),t},t.prototype.getToolbarItems=function(){for(var e=[],t=0,i=this.parent.toolbarItems;t<i.length;t++){var n=i[t],r=this.getItemModel(n),a=void 0;if(n.name)switch(n.name){case"Today":(a={showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-today",text:this.l10n.getConstant("today"),cssClass:"e-today",overflow:"Show"}).align=r.align||n.align,e.push(Ar({},a,r));break;case"Previous":(a={prefixIcon:"e-icon-prev",tooltipText:"Previous",overflow:"Show",cssClass:"e-prev",htmlAttributes:{role:"navigation"}}).align=r.align||n.align,e.push(Ar({},a,r));break;case"Next":(a={prefixIcon:"e-icon-next",tooltipText:"Next",overflow:"Show",cssClass:"e-next",htmlAttributes:{role:"navigation"}}).align=r.align||n.align,e.push(Ar({},a,r));break;case"DateRangeText":(a={text:this.getDateRangeText(),suffixIcon:"e-icon-down-arrow",cssClass:"e-date-range",overflow:"Show",htmlAttributes:{"aria-atomic":"true","aria-live":"assertive",role:"navigation"}}).align=r.align||n.align,e.push(Ar({},a,r));break;case"NewEvent":(a={showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-add",text:this.l10n.getConstant("newEvent"),cssClass:"e-add",overflow:"Show"}).align=r.align||n.align,e.push(Ar({},a,r));break;case"Views":if(!U.isNullOrUndefined(this.parent.views)&&1<this.parent.views.length)for(var s=0,o=this.parent.views;s<o.length;s++){var l=o[s];(a=this.getItemObject(l)).align=r.align||n.align,e.push(Ar({},a,r))}break;case"Custom":e.push(n)}else e.push(n)}return e},t.prototype.getItems=function(){var e=[];if(e.push({align:"Left",prefixIcon:"e-icon-prev",tooltipText:"Previous",overflow:"Show",cssClass:"e-prev"}),e.push({align:"Left",prefixIcon:"e-icon-next",tooltipText:"Next",overflow:"Show",cssClass:"e-next"}),e.push({align:"Left",text:this.getDateRangeText(),suffixIcon:"e-icon-down-arrow",cssClass:"e-date-range",overflow:"Show",htmlAttributes:{"aria-atomic":"true","aria-live":"assertive"}}),this.parent.isAdaptive||this.parent.enableAdaptiveUI?(e.push({align:"Right",showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-add",text:this.l10n.getConstant("newEvent"),cssClass:"e-add",overflow:"Show"}),e.push({align:"Right",showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-today",text:this.l10n.getConstant("today"),cssClass:"e-today",overflow:"Show"})):(e.push({align:"Right",showAlwaysInPopup:this.parent.isAdaptive||this.parent.enableAdaptiveUI,prefixIcon:"e-icon-today",text:this.l10n.getConstant("today"),cssClass:"e-today",overflow:"Show"}),!U.isNullOrUndefined(this.parent.views)&&1<this.parent.views.length&&e.push({align:"Right",type:"Separator",cssClass:"e-schedule-seperator"})),!U.isNullOrUndefined(this.parent.views)&&1<this.parent.views.length)for(var t=0,i=this.parent.views;t<i.length;t++){var n=i[t];e.push(this.getItemObject(n))}return e},t.prototype.getItemObject=function(e){var t,i,n="string"==typeof e?(t=e.toLowerCase(),null):(t=e.option.toLowerCase(),e.displayName),r=this.parent.isAdaptive||this.parent.enableAdaptiveUI;switch(t){case"day":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-day",text:n||this.l10n.getConstant("day"),cssClass:"e-views e-day"};break;case"week":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-week",text:n||this.l10n.getConstant("week"),cssClass:"e-views e-week"};break;case"workweek":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-workweek",text:n||this.l10n.getConstant("workWeek"),cssClass:"e-views e-work-week"};break;case"month":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-month",text:n||this.l10n.getConstant("month"),cssClass:"e-views e-month"};break;case"year":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-year",text:n||this.l10n.getConstant("year"),cssClass:"e-views e-year"};break;case"agenda":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-agenda",text:n||this.l10n.getConstant("agenda"),cssClass:"e-views e-agenda"};break;case"monthagenda":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-month-agenda",text:n||this.l10n.getConstant("monthAgenda"),cssClass:"e-views e-month-agenda"};break;case"timelineday":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-day",text:n||this.l10n.getConstant("timelineDay"),cssClass:"e-views e-timeline-day"};break;case"timelineweek":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-week",text:n||this.l10n.getConstant("timelineWeek"),cssClass:"e-views e-timeline-week"};break;case"timelineworkweek":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-workweek",text:n||this.l10n.getConstant("timelineWorkWeek"),cssClass:"e-views e-timeline-work-week"};break;case"timelinemonth":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-month",text:n||this.l10n.getConstant("timelineMonth"),cssClass:"e-views e-timeline-month"};break;case"timelineyear":i={align:"Right",showAlwaysInPopup:r,prefixIcon:"e-icon-timeline-year-"+("Vertical"===e.orientation?"vertical":"horizontal"),text:n||this.l10n.getConstant("timelineYear"),cssClass:"e-views e-timeline-year"}}return i},t.prototype.renderHeaderPopup=function(){var e=U.createElement("div",{className:"e-header-popup"}),t=U.createElement("div",{className:"e-header-calendar"}),e=(e.appendChild(t),this.element.appendChild(e),this.headerPopup=new M.Popup(e,{actionOnScroll:"hide",targetType:"relative",relateTo:this.getPopUpRelativeElement(),position:{X:"left",Y:"bottom"},enableRtl:this.parent.enableRtl}),this.getCalendarView()),i="Month"===this.parent.currentView&&!U.isNullOrUndefined(this.parent.activeViewOptions.displayDate)&&!this.hasSelectedDate();this.headerCalendar=new R.Calendar({value:i?this.parent.activeViewOptions.displayDate:this.parent.selectedDate,min:this.parent.minDate,max:this.parent.maxDate,firstDayOfWeek:this.parent.activeViewOptions.firstDayOfWeek,enableRtl:this.parent.enableRtl,locale:this.parent.locale,depth:e,start:e,calendarMode:this.parent.calendarMode,change:this.calendarChange.bind(this)}),this.setCalendarTimezone(),this.headerCalendar.appendTo(t),this.headerPopup.hide()},t.prototype.calendarChange=function(e){e.value.getTime()!==this.parent.selectedDate.getTime()&&(e=W(new Date(e.value)),this.parent.changeDate(e)),this.headerPopup.hide()},t.prototype.setCalendarTimezone=function(){this.headerCalendar&&(this.headerCalendar.timezone=this.parent.timezone||this.parent.tzModule.getLocalTimezoneName())},t.prototype.calculateViewIndex=function(e){e=U.closest(e.originalEvent.target,".e-views");return[].slice.call(this.element.querySelectorAll(".e-views")).indexOf(e)},t.prototype.toolbarClickHandler=function(e){if(e.item){var t;switch(e.item.cssClass.replace("e-views ","")){case"e-date-range":this.headerPopup||this.renderHeaderPopup(),this.headerPopup.element.classList.contains(yt)?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=W(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()&&W(this.parent.activeViewOptions.displayDate)!==r||"Month"===this.parent.currentView&&0<this.parent.activeViewOptions.numberOfWeeks&&!this.hasSelectedDate()&&W(Pe(this.parent.selectedDate))!==r)&&this.parent.changeDate(r,e.originalEvent);break;case"e-prev":this.parent.changeDate(this.parent.activeView.getNextPreviousDate("previous"),e.originalEvent);break;case"e-next":this.parent.changeDate(this.parent.activeView.getNextPreviousDate("next"),e.originalEvent);break;case"e-add":var i,n,r=this.parent.activeCellsData.startTime.getTime()===this.parent.activeCellsData.endTime.getTime();r=this.parent.activeCellsData&&!r?this.parent.activeCellsData:(r=this.parent.activeViewOptions.timeScale.interval,i=this.parent.activeViewOptions.timeScale.slotCount,r=r*xe/i,i=new Date(this.parent.selectedDate.getTime()),n=this.parent.getCurrentTime(),i.setHours(n.getHours(),Math.round(i.getMinutes()/r)*r,0),n=new Date(new Date(i.getTime()).setMilliseconds(i.getMilliseconds()+r)),{startTime:i,endTime:n,isAllDay:!1}),this.parent.eventWindow.openEditor(U.extend(r,{cancel:!1,event:e.originalEvent}),"Add")}U.isNullOrUndefined(this.toolbarObj)||(t=this.toolbarObj.element.querySelector(".e-toolbar-pop"))&&"Input"!==e.item.type&&t.ej2_instances[0].hide({name:"SlideUp",duration:100})}},t.prototype.hasSelectedDate=function(){var e=W(this.parent.selectedDate).getTime();return e>=this.parent.activeView.getStartDate().getTime()&&e<=this.parent.activeView.getEndDate().getTime()},t.prototype.getHeaderElement=function(){return this.toolbarObj.element},t.prototype.updateHeaderItems=function(e){var t=this.toolbarObj.element.querySelector(".e-prev"),i=this.toolbarObj.element.querySelector(".e-next"),n=this.toolbarObj.element.querySelector(".e-date-range");t&&("add"===e?U.addClass([t],sr):U.removeClass([t],sr)),i&&("add"===e?U.addClass([i],sr):U.removeClass([i],sr)),n&&("add"===e?U.addClass([n],un):U.removeClass([n],un))},t.prototype.previousNextIconHandler=function(){var e,t="Agenda"===this.parent.currentView?[this.parent.getCurrentViewDates()[0]]:this.parent.getCurrentViewDates(),i=this.toolbarObj.element.querySelector(".e-prev"),n=this.toolbarObj.element.querySelector(".e-next"),r=new Date(t[0].getTime()),t=new Date(t[t.length-1].getTime());"WorkWeek"===this.parent.currentView||"TimelineWorkWeek"===this.parent.currentView?t=z(r=Re(W(this.parent.selectedDate),this.parent.firstDayOfWeek),7*this.parent.activeViewOptions.interval):"Month"===this.parent.currentView&&(r=(e=!U.isNullOrUndefined(this.parent.activeViewOptions.displayDate)||0<this.parent.activeViewOptions.numberOfWeeks)?this.parent.activeView.getStartDate():Pe(this.parent.selectedDate),t=e?this.parent.activeView.getEndDate():je(Be(r,this.parent.activeViewOptions.interval-1))),U.isNullOrUndefined(i)||this.toolbarObj.enableItems(i,r>W(this.parent.minDate)),U.isNullOrUndefined(n)||this.toolbarObj.enableItems(n,t<W(this.parent.maxDate)),this.setCalendarMinMaxDate()},t.prototype.getModuleName=function(){return"headerbar"},t.prototype.destroy=function(){this.headerPopup&&!this.headerPopup.isDestroyed&&(this.headerPopup.destroy(),this.headerPopup=null),this.headerCalendar&&!this.headerCalendar.isDestroyed&&(this.headerCalendar.destroy(),this.headerCalendar=null),this.toolbarObj&&!this.toolbarObj.isDestroyed&&(this.toolbarObj.destroy(),this.removeEventListener(),U.remove(this.element),this.toolbarObj=null),this.element=null,this.parent=null,this.l10n=null},t);function t(e){this.parent=e,this.l10n=this.parent.localeObj,this.renderHeader(),this.addEventListener()}kr.prototype.getModuleName=function(){return"scroll"},kr.prototype.setWidth=function(){this.parent.element.style.width=U.formatUnit(this.parent.width)},kr.prototype.setHeight=function(){this.parent.element.style.height=U.formatUnit(this.parent.height)},kr.prototype.addEventListener=function(){this.parent.on(De,this.setDimensions,this),this.parent.on(Oe,this.onPropertyChanged,this)},kr.prototype.removeEventListener=function(){this.parent.off(De,this.setDimensions),this.parent.off(Oe,this.onPropertyChanged)},kr.prototype.setDimensions=function(){this.setWidth(),this.setHeight();var e={cssProperties:this.parent.getCssProperties(),module:this.getModuleName()};this.parent.notify(Se,e)},kr.prototype.onPropertyChanged=function(){this.setDimensions()},kr.prototype.destroy=function(){this.removeEventListener()};var Mr=kr;function kr(e){this.parent=e,this.addEventListener()}Hr.prototype.scrollHandler=function(e){var t,i=!this.parent.isAdaptive&&e.originalEvent&&e.originalEvent.target&&!U.isNullOrUndefined(U.closest(e.originalEvent.target,"."+A));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.timeStampStart||(this.timeStampStart=Date.now()),this.element.classList.contains(xt)&&this.onTransitionEnd(),"Left"===e.scrollDirection||"Right"===e.scrollDirection){var i={requestType:"dateNavigate",cancel:!1,event:e.originalEvent};if(this.parent.trigger(K,i),i.cancel)return;i=this.element.querySelector("."+I);if(i&&i.scrollWidth>i.clientWidth)return;this.isScrollTriggered=!0,e.originalEvent.preventDefault(),e.originalEvent.stopPropagation()}e.scrollDirection===this.touchLeftDirection?(this.nextPanel||(this.renderPanel(Vt,"next"),this.nextPanel={element:this.parent.activeView.getPanel(),selectedDate:new Date(this.parent.selectedDate.getTime()),renderDates:this.parent.activeView.renderDates,colLevels:this.parent.activeView.colLevels},this.setDimensions(this.nextPanel.element)),t=this.parent.enableRtl?e.distanceX:-e.distanceX,this.element.style.transform="translatex("+(this.getTranslateX(this.element)+t)+"px)"):e.scrollDirection===this.touchRightDirection&&(i=0,this.previousPanel||(this.renderPanel(Et,"previous"),this.previousPanel={element:this.parent.activeView.getPanel(),selectedDate:new Date(this.parent.selectedDate.getTime()),renderDates:this.parent.activeView.renderDates,colLevels:this.parent.activeView.colLevels},this.setDimensions(this.previousPanel.element),i=this.previousPanel.element.offsetWidth),t=this.parent.enableRtl?i-e.distanceX:-i+e.distanceX,this.element.style.transform="translatex("+(this.getTranslateX(this.element)+t)+"px)")}},Hr.prototype.swipeHandler=function(e){var t,i;this.isScrollTriggered&&!this.parent.uiStateValues.action&&this.parent.allowSwiping&&!this.parent.uiStateValues.isTapHold&&(this.isScrollTriggered=!1,t=("Left"===e.swipeDirection?this.parent.activeView.renderDates:this.parent.activeView.renderDates.slice(-1))[0],"Left"===e.swipeDirection&&t<this.parent.maxDate||"Right"===e.swipeDirection&&t>=this.parent.minDate?((t=Date.now()-this.timeStampStart)<(i=e.distanceX*(U.Browser.isDevice?6:1.66))||e.distanceX>this.parent.element.offsetWidth/2?(this.swapPanels(e.swipeDirection),t<i&&e.distanceX>this.parent.element.offsetWidth/2&&(this.element.style.transitionDuration=(U.Browser.isDevice?e.distanceX:i)/t/10+"s"),this.confirmSwipe(e.swipeDirection)):this.cancelSwipe(),i={requestType:"dateNavigate",cancel:!1,event:e.originalEvent},this.parent.trigger(Z,i)):this.cancelSwipe(),this.timeStampStart=null)},Hr.prototype.tapHoldHandler=function(e){var t=U.closest(e.originalEvent.target,"."+A);U.isNullOrUndefined(t)||(this.parent.uiStateValues.isTapHold=!0,this.parent.isAdaptive?(U.Browser.isIos&&U.EventHandler.add(this.element,"touchend",this.preventEventClick,this),this.parent.quickPopup.tapHoldEventPopup(e.originalEvent)):["Agenda","MonthAgenda","Year"].indexOf(this.parent.currentView)<0&&(this.parent.selectedElements=[],this.parent.eventBase.getSelectedEventElements(t),this.parent.resizeModule)&&U.closest(e.originalEvent.target,"."+qi)&&this.parent.resizeModule.resizeStart(e.originalEvent))},Hr.prototype.preventEventClick=function(e){e.preventDefault(),U.EventHandler.remove(this.element,"touchend",this.preventEventClick)},Hr.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)},Hr.prototype.swapPanels=function(e){var t;e===this.touchLeftDirection?(t=this.nextPanel,this.nextPanel=this.currentPanel):(t=this.previousPanel,this.previousPanel=this.currentPanel),this.currentPanel=t},Hr.prototype.confirmSwipe=function(t){var i=this,e={action:"date",cancel:!1,previousDate:(t===this.touchLeftDirection?this.nextPanel:this.previousPanel).selectedDate,currentDate:this.currentPanel.selectedDate};this.parent.trigger($,e,function(e){e.cancel?(i.swapPanels(t),i.cancelSwipe()):(i.parent.activeView.setPanel(i.currentPanel.element),i.parent.setProperties({selectedDate:i.currentPanel.selectedDate},!0),e=void 0,e=i.parent.enableRtl?t===i.touchLeftDirection?i.previousPanel?i.previousPanel.element.offsetLeft:i.currentPanel.element.offsetWidth:0:t===i.touchLeftDirection?-i.currentPanel.element.offsetLeft:0,i.parent.activeView.renderDates=i.currentPanel.renderDates,i.parent.activeView.colLevels=i.currentPanel.colLevels,U.addClass([i.element],xt),i.element.style.transform="translatex("+e+"px)",i.parent.headerModule&&i.parent.headerModule.updateDateRange(),i.parent.renderTemplates(),i.parent.crudModule.refreshDataManager())})},Hr.prototype.cancelSwipe=function(){this.parent.activeView.setPanel(this.currentPanel.element),this.parent.setProperties({selectedDate:this.currentPanel.selectedDate},!0),this.parent.activeView.renderDates=this.currentPanel.renderDates,this.parent.activeView.colLevels=this.currentPanel.colLevels,U.addClass([this.element],xt);var e=this.previousPanel?this.previousPanel.element.offsetWidth:0;this.element.style.transform="translatex("+(this.parent.enableRtl?e:-this.currentPanel.element.offsetLeft)+"px)"},Hr.prototype.onTransitionEnd=function(){U.removeClass([this.element],xt),this.element.style.transitionDuration="",this.element.style.transform="",this.previousPanel&&(U.remove(this.previousPanel.element),this.previousPanel=null,U.removeClass([this.currentPanel.element],Et),U.addClass([this.currentPanel.element],Ot)),this.nextPanel&&(U.remove(this.nextPanel.element),this.nextPanel=null,U.removeClass([this.currentPanel.element],Vt),U.addClass([this.currentPanel.element],Ot)),this.currentPanel=null,this.parent.activeView.getPanel().style.width=""},Hr.prototype.getTranslateX=function(e){e=window.getComputedStyle(e);return new WebKitCSSMatrix(e.webkitTransform).m41},Hr.prototype.setDimensions=function(e){e.style.width=this.parent.element.clientWidth+"px"},Hr.prototype.resetValues=function(){this.currentPanel=null,this.previousPanel=null,this.nextPanel=null,this.timeStampStart=null,this.element.style.transform="",this.element.style.transitionDuration="",et(this.element),U.removeClass([this.element],xt)},Hr.prototype.destroy=function(){this.touchObj&&(this.touchObj.destroy(),this.touchObj=null),U.EventHandler.remove(this.element,"transitionend",this.onTransitionEnd),this.resetValues()};var Rr=Hr;function Hr(e){this.parent=e,this.element=this.parent.element.querySelector("."+gt),this.touchObj=new U.Touch(this.element,{scroll:this.scrollHandler.bind(this),swipe:this.swipeHandler.bind(this),tapHold:this.tapHoldHandler.bind(this),swipeSettings:{swipeThresholdDistance:1}}),U.EventHandler.add(this.element,"transitionend",this.onTransitionEnd,this),this.touchLeftDirection=this.parent.enableRtl?"Right":"Left",this.touchRightDirection=this.parent.enableRtl?"Left":"Right"}i.prototype.keyActionHandler=function(e){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))}},i.prototype.processFTwelve=function(e){var t=e.target;(t.classList.contains(O)||t.classList.contains(v))&&(this.parent.activeCellsData=this.getSelectedElements(t),e={element:(e=U.extend(this.parent.activeCellsData,{cancel:!1,event:e})).element,groupIndex:e.groupIndex,type:"Cell"},this.parent.notify(ge,e)),t.classList.contains(A)&&t.click()},i.prototype.addEventListener=function(){this.parent.on(Ve,this.onCellMouseDown,this)},i.prototype.removeEventListener=function(){this.parent.off(Ve,this.onCellMouseDown)},i.prototype.onCellMouseDown=function(e){e.event.shiftKey||(this.initialTarget=this.getClosestCell(e.event),!this.parent.activeViewOptions.readonly&&"MonthAgenda"!==this.parent.currentView&&this.initialTarget&&(e.event.target.classList.contains(O)&&3!==e.event.which&&(this.parent.removeSelectedClass(),U.EventHandler.add(this.parent.getContentTable(),"mousemove",this.onMouseSelection,this),U.EventHandler.add(this.parent.getContentTable(),"mouseup",this.onMoveUp,this)),e.event.target.classList.contains(v))&&3!==e.event.which&&(this.parent.removeSelectedClass(),e=this.parent.getAllDayRow(),U.EventHandler.add(e,"mousemove",this.onMouseSelection,this),U.EventHandler.add(e,"mouseup",this.onMoveUp,this)))},i.prototype.onMouseSelection=function(e){var t,i,n=[].slice.call(this.parent.element.querySelectorAll("."+A)),n=(U.addClass(n,"e-allow-select"),this.parent.boundaryValidation(e.pageY,e.pageX)),r=((n.bottom||n.top||n.left||n.right)&&(r=(t=this.parent.element.querySelector("."+I)).offsetHeight<=t.scrollHeight&&0<=t.scrollTop&&t.scrollTop+t.offsetHeight<=t.scrollHeight,i=t.offsetWidth<=t.scrollWidth&&0<=t.scrollLeft&&t.scrollLeft+t.offsetWidth<=t.scrollWidth,r&&(n.top||n.bottom)&&(t.scrollTop+=n.top?-e.target.offsetHeight:e.target.offsetHeight),i)&&(n.left||n.right)&&(t.scrollLeft+=n.left?-e.target.offsetWidth:e.target.offsetWidth),this.getClosestCell(e));r&&this.selectCells(!0,r)},i.prototype.getClosestCell=function(e){return U.closest(e.target,"."+O+",."+v)},i.prototype.onMoveUp=function(t){var i,n=this,e=[].slice.call(this.parent.element.querySelectorAll("."+A));U.removeClass(e,"e-allow-select"),t.target.classList.contains(O)&&(U.EventHandler.remove(this.parent.getContentTable(),"mousemove",this.onMouseSelection),U.EventHandler.remove(this.parent.getContentTable(),"mouseup",this.onMoveUp)),t.target.classList.contains(v)&&(e=this.parent.getAllDayRow(),U.EventHandler.remove(e,"mousemove",this.onMouseSelection),U.EventHandler.remove(e,"mouseup",this.onMoveUp)),this.isPreventAction(t)||(e=U.closest(t.target,".e-work-cells,.e-all-day-cells,.e-header-cells"),0<(i=this.parent.getSelectedCells()).length&&-1===i.indexOf(e)&&(e=i[i.length-1]),"TimelineYear"===this.parent.currentView&&e.classList.contains(E))||(this.parent.activeCellsData=this.getSelectedElements(e),e={},this.parent.eventWindow&&this.parent.eventWindow.convertToEventData(this.parent.activeCellsData,e),e={data:e,element:this.parent.activeCellsData.element,event:t,requestType:me,showQuickPopup:!1},this.parent.trigger(X,e,function(e){(e.showQuickPopup||n.parent.quickInfoOnSelectionEnd)&&1<i.length&&(e=U.extend(n.parent.activeCellsData,{cancel:!1,event:t,name:"cellClick"}),n.parent.notify(F,e))}))},i.prototype.processEnter=function(e){var t,i,n;this.parent.activeViewOptions.readonly&&!e.target.classList.contains(A)||this.isPreventAction(e)||"TimelineYear"===this.parent.currentView&&e.target.classList.contains(E)||(t=e.target,U.closest(t,"."+lr)?t.classList.contains(pn)||t.classList.contains(cn)||t.classList.contains(hn)||t.classList.contains(dn)||t.classList.contains(ir)?(t.click(),e.preventDefault()):t.classList.contains(Ln)&&(this.parent.element.querySelector("."+cn).click(),e.preventDefault()):t.classList.contains(Ut)&&t.classList.contains(Lt)?(i=t.querySelector("."+Ft))&&i.click():t.classList.contains(O)||t.classList.contains(v)?(this.parent.activeCellsData=this.getSelectedElements(t),i=U.extend(this.parent.activeCellsData,{cancel:!1,event:e}),this.parent.allowInline?(n={element:i.element,groupIndex:i.groupIndex,type:"Cell"},this.parent.notify(ge,n)):"Year"===this.parent.currentView?t.click():this.parent.notify(F,i)):t.classList.contains(Sr)&&this.parent.inlineModule?this.parent.inlineModule.inlineCrudActions(t):t.classList.contains(A)||t.classList.contains(Tn)||t.classList.contains(Ji)||t.classList.contains(tn)?t.click():t.classList.contains(yn)&&(this.parent.setProperties({selectedDate:this.parent.getDateFromElement(t)},!0),this.parent.changeView(this.parent.getNavigateView(),e),this.processEscape(e)))},i.prototype.getSelectedElements=function(e){var t,i=1<this.selectedCells.length&&e.classList.contains(ni)?(t=this.parent.getCellDetails(this.selectedCells[0]),i=this.parent.getCellDetails(this.selectedCells.slice(-1)[0]),t.endTime=i.endTime,t.element=e,t):this.parent.getCellDetails(e);return i},i.prototype.getCells=function(e,t,i){var n=this.parent.getContentTable(),r="TimelineYear"===this.parent.currentView,a=[].slice.call(n.querySelectorAll(r&&!e?"."+O+":not(."+E+")":"td")),s=n.rows.length,o=n.rows[0].cells.length,n=(t&&t.classList.contains(v)&&(n=this.parent.getAllDayRow(),a=[].slice.call(n.cells),s=1,o=n.cells.length),a.indexOf(t)),l=a.indexOf(i),p=[];if(e){for(var c=0;c<o;c++)for(var h=0;h<s;h++){var d=a[o*h+c];r&&d.classList.contains(E)||p.push(d)}n=p.indexOf(t),l=p.indexOf(i)}return l<n&&(t=n,n=l,l=t),(e?p:a).slice(n,l+1)},i.prototype.focusFirstCell=function(){var e;"Agenda"===this.parent.currentView?((e=this.parent.getContentTable().querySelector("."+Ti)).setAttribute("tabindex","0"),e.focus()):(this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.activeView.isTimelineView()&&"TimelineYear"!==this.parent.currentView?(e=this.parent.element.querySelector("."+S+" tr:not(."+sr+") ."+O+":not(."+kt+")"),this.selectCells(!1,e)):-1<this.parent.currentView.indexOf("Year")?(e="."+O+":not(."+E+"):not(."+kt+")",e+="TimelineYear"===this.parent.currentView&&"Vertical"===this.parent.activeViewOptions.orientation?'[data-date="'+this.parent.activeView.startDate().getTime()+'"]':"",this.selectCells(!1,this.parent.element.querySelector(e))):this.selectCells(!1,this.parent.getWorkCellElements()[0]))},i.prototype.isInverseTableSelect=function(){return this.parent.activeView.isInverseTableSelect},i.prototype.selectCells=function(e,t){var p,c,i,h=this,d=(this.parent.removeSelectedClass(),t instanceof Array?t.slice(-1)[0]:t);e?(c=["Day","Week","WorkWeek","TimelineDay","TimelineWeek","TimelineWorkWeek","TimelineMonth","TimelineYear"],i={element:t,requestType:"mousemove",allowMultipleRow:!0},this.parent.inlineModule.removeInlineAppointmentElement(),this.parent.trigger(X,i,function(e){e.allowMultipleRow&&h.parent.allowMultiRowSelection||((e="TimelineYear"===h.parent.currentView)&&"Horizontal"===h.parent.activeViewOptions.orientation||"Month"===h.parent.currentView?(e=e&&0<h.parent.activeViewOptions.group.resources.length,d=e?h.initialTarget:h.initialTarget.parentElement.children[d.cellIndex]):-1<c.indexOf(h.parent.currentView)&&(d=d.parentElement.children[h.initialTarget.cellIndex]));e=h.getCells(h.isInverseTableSelect(),h.initialTarget,d);if(0<h.parent.activeViewOptions.group.resources.length){p=h.initialTarget.getAttribute("data-group-index");for(var t=[],i=0,n=e;i<n.length;i++)(a=n[i]).getAttribute("data-group-index")===p&&t.push(a);e=t}if(h.parent.allowMultiCellSelection||(e=[h.initialTarget]),2<(h.selectedCells=e).length&&!d.classList.contains(v)){var r=h.getAllDayCells(e);if(0<h.parent.activeViewOptions.group.resources.length){for(var a,s=[],o=0,l=r;o<l.length;o++)(a=l[o]).getAttribute("data-group-index")===p&&s.push(a);r=s}e=e.concat(r)}d.getAttribute("data-group-index")!==p&&0<h.parent.activeViewOptions.group.resources.length&&(d=h.selectedCells[h.selectedCells.length-1]),h.parent.addSelectedClass(e,d)})):(i={element:d,requestType:me},this.parent.trigger(X,i,function(){h.initialTarget=d,h.selectedCells=[d],h.parent.addSelectedClass([d],d)}))},i.prototype.selectAppointment=function(e,t){var i=this.getAppointmentElements();i.length<0||(this.parent.eventBase.removeSelectedAppointmentClass(),(t=t.classList.contains(A)?(t=i.indexOf(t),i[e?t-1:t+1]):e?i[i.length-1]:i[0])&&(this.parent.eventBase.addSelectedAppointments([t],!0),t.focus(),U.addClass([t],Di)))},i.prototype.selectAppointmentElementFromWorkCell=function(t,e){var i,n,r,a=this;this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.removeSelectedClass(),(e.classList.contains(O)||e.classList.contains(v))&&(i=this.getUniqueAppointmentElements(),n=[],r=this.parent.getDateFromElement(e).getTime(),this.parent.eventsProcessed.filter(function(e){return t?e[a.parent.eventFields.startTime].getTime()<=r:e[a.parent.eventFields.startTime].getTime()>=r}).filter(function(t){i.filter(function(e){JSON.stringify(t.Guid)===JSON.stringify(e.getAttribute("data-guid"))&&n.push(e)})}),0<n.length)&&(e=this.getAppointmentElementsByGuid((t?n[n.length-1]:n[0]).getAttribute("data-guid")),this.parent.eventBase.addSelectedAppointments(e,!0),e[e.length-1].focus())},i.prototype.getAllDayCells=function(e){var t,i,n=this.parent.getAllDayRow();return n&&(t=e[0],e=e[e.length-1],i=this.parent.getCellDetails(t),this.parent.getCellDetails(e).endTime.getTime()-i.startTime.getTime()>=B)?[].slice.call(n.cells).slice(t.cellIndex,e.cellIndex+1):[]},i.prototype.getAppointmentElements=function(){return[].slice.call(this.parent.element.querySelectorAll("."+A))},i.prototype.getAppointmentElementsByGuid=function(e){return[].slice.call(this.parent.element.querySelectorAll('div[data-guid="'+e+'"]'))},i.prototype.getUniqueAppointmentElements=function(){var n=this.getAppointmentElements(),r=[];return n.map(function(e){return e.getAttribute("data-guid")}).filter(function(e,t,i){i.indexOf(e)===t&&r.push(n[parseInt(t.toString(),10)])}),r},i.prototype.getWorkCellFromAppointmentElement=function(e){e=this.parent.eventBase.getEventByGuid(e.getAttribute("data-guid"));return this.parent.eventBase.selectWorkCellByTime([e])},i.prototype.processViewNavigation=function(e){var t,i=parseInt(e.key,10)-1;!U.isNullOrUndefined(this.parent.views)&&i<this.parent.views.length&&(t=this.parent.viewCollections[parseInt(i.toString(),10)].option,this.parent.changeView(t,e,void 0,i),this.parent.headerModule)&&this.parent.headerModule.element.querySelector(".e-active-view button").focus()},i.prototype.isCalendarTarget=function(e){e=e.currentTarget||e.target;return!(!e||U.isNullOrUndefined(e.querySelector(".e-header-popup.e-popup-open")))},i.prototype.cancelUpDownAction=function(e){var t=e&&"Vertical"===this.parent.activeViewOptions.orientation,i=0<this.parent.activeViewOptions.group.resources.length;return!!(t&&i||e&&this.initialTarget.classList.contains(E))||!((!this.parent.activeView.isTimelineView()||e)&&"MonthAgenda"!==this.parent.currentView)},i.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("."+gn),o=this.getQuickPopupElement();if(0<r.length&&!e.target.classList.contains(O)&&(n=r[r.length-1]),0<a.length&&!s.classList.contains(yt)&&!o.classList.contains(yt)&&-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(O)&&!this.parent.element.querySelector("."+yt)){r=this.parent.getTableRows(),s=r.indexOf(n.parentElement),o=void 0;if(i&&t&&0===this.parent.activeViewOptions.group.resources.length&&(o=this.isInverseTableSelect()?this.getVerticalUpDownCell(r,n,s,!0):this.getHorizontalUpDownCell(r,n,s,!0)),(0<s||o)&&s<r.length){if(o=o||r[s-1].cells[n.cellIndex],"Year"===this.parent.currentView&&o.classList.contains(E)){if(!(this.parent.activeView.getStartDate().getTime()<+o.getAttribute("data-date")))return;o=this.getYearUpDownCell(r,s-1,n.cellIndex,!0)}e.preventDefault(),this.selectCells(t,o)}}else"Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||this.selectAppointment(!0,n)}},i.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("."+gn),o=this.getQuickPopupElement(),r=(0<r.length&&!e.target.classList.contains(O)&&(n=r[r.length-1]),0<a.length&&!s.classList.contains(yt)&&!o.classList.contains(yt)&&-1!==["Day","Week","WorkWeek","Month"].indexOf(this.parent.currentView)&&(n=this.getWorkCellFromAppointmentElement(a[a.length-1]),this.parent.eventBase.removeSelectedAppointmentClass()),this.parent.getTableRows());if(n)if(n.classList.contains(O)&&!this.parent.element.querySelector("."+yt)){s=r.indexOf(n.parentElement),o=void 0;if(i&&t&&0===this.parent.activeViewOptions.group.resources.length&&(o=this.isInverseTableSelect()?this.getVerticalUpDownCell(r,n,s,!1):this.getHorizontalUpDownCell(r,n,s,!1)),0<=s&&(s<r.length-1||o)){if(o=o||r[s+1].cells[n.cellIndex],"Year"===this.parent.currentView&&o.classList.contains(E)){if(!(this.parent.activeView.getEndDate().getTime()>+o.getAttribute("data-date")))return;o=this.getYearUpDownCell(r,s+1,n.cellIndex,!1)}e.preventDefault(),this.selectCells(t,o)}}else"Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||this.selectAppointment(!1,n)}},i.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);)t+=n?-1:1;return e[parseInt(t.toString(),10)].cells[parseInt(i.toString(),10)]},i.prototype.getHorizontalUpDownCell=function(e,t,i,n){e=e[i+(n?-1:1)],i=e?e.cells[t.cellIndex]:t;return i.classList.contains(E)&&(n=e.querySelector("."+O+":not(."+E+")"),t=new Date(+n.getAttribute("data-date")),t='[data-date="'+new Date(t.getFullYear(),t.getMonth()+1,0).getTime()+'"]',i=i.cellIndex<n.cellIndex?n:e.querySelector(t)),i},i.prototype.getVerticalUpDownCell=function(e,t,i,n){var r=n&&0<i||!n&&i<e.length-1?e[i+(n?-1:1)].cells[t.cellIndex]:void 0;if(!r||r.classList.contains(E)){if(e[parseInt(i.toString(),10)].cells[t.cellIndex-(n?1:-1)])return e=+t.getAttribute("data-date")-(n?B:-B),this.parent.getContentTable().querySelector("."+O+'[data-date="'+e+'"]');r=t}return r},i.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}},i.prototype.getQuickPopupElement=function(){return(this.parent.isAdaptive?document.body:this.parent.element).querySelector("."+lr)},i.prototype.isCancelLeftRightAction=function(e,t,i){var i="MonthAgenda"===this.parent.currentView||i&&this.initialTarget.classList.contains(E);return!!("Agenda"===this.parent.currentView||t&&i)||!!(this.isPreventAction(e)&&t||(i=this.parent.element.querySelector("."+gn),e=this.getQuickPopupElement(),i.classList.contains(yt))||e.classList.contains(yt))},i.prototype.processRight=function(e,t){var i,n,r,a,s,o="TimelineYear"===this.parent.currentView;this.isCancelLeftRightAction(e,t,o)||this.isCalendarTarget(e)||(r=this.parent.getSelectedCells(),n=this.parent.eventBase.getSelectedAppointments(),i=e.target,0<r.length&&!i.classList.contains(O)&&!i.classList.contains(v)&&(i=r[r.length-1]),0<n.length&&(i=this.getWorkCellFromAppointmentElement(n[n.length-1]),this.parent.eventBase.removeSelectedAppointmentClass(),!i))||(i.classList.contains(O)&&e.target.classList.contains(O)?(r=this.processLeftRight(i),n=new Date(+i.getAttribute("data-date")),a="Year"===this.parent.currentView&&n.getTime()===je(n).getTime(),0<=r.columnIndex&&r.columnIndex<r.maxIndex-1&&!a?(s=this.calculateNextPrevDate(i,r.element.rows[r.rowIndex].cells[i.cellIndex+1],"right"),o&&t&&s.classList.contains(E)&&(s=this.getTimelineYearTargetCell(r,i,!0)),U.isNullOrUndefined(s)||this.selectCells(t,s)):r.columnIndex!==r.maxIndex-1&&!a||(!this.isInverseTableSelect()&&r.rowIndex<r.element.rows.length-1&&!a?(s=this.calculateNextPrevDate(i,r.element.rows[r.rowIndex+1].cells[0],"right"),s=o&&t&&s.classList.contains(E)?this.getHorizontalLeftRightCell(r,i,!0):s,U.isNullOrUndefined(s)||this.selectCells(t,s)):t||(a&&n.getTime()!==this.parent.activeView.getEndDate().getTime()?this.selectCells(t,this.parent.element.querySelector(":not(."+E+')[data-date="'+(n.getTime()+B)+'"]')):(o=this.isInverseTableSelect()?r.rowIndex:0,this.parent.changeDate(this.parent.activeView.getNextPreviousDate("next"),e),s=this.parent.getContentTable(),n=a?s.rows[parseInt(o.toString(),10)].querySelector("."+O+":not(."+E+")"):s.rows[parseInt(o.toString(),10)].cells[0],this.selectCells(!1,n))))):i.classList.contains(v)&&(r=i.cellIndex,s=(a=this.parent.getAllDayRow()).cells.length,0<=r&&r<s-1?this.selectCells(t,a.cells[r+1]):r!==s-1||t||(this.parent.changeDate(this.parent.activeView.getNextPreviousDate("next"),e),o=this.parent.getAllDayRow(),this.selectCells(!1,o.cells[0]))))},i.prototype.processLeft=function(e,t){var i,n,r,a,s,o="TimelineYear"===this.parent.currentView;this.isCancelLeftRightAction(e,t,o)||this.isCalendarTarget(e)||(i=e.target,0<(a=this.parent.getSelectedCells()).length&&!i.classList.contains(O)&&!i.classList.contains(v)&&(i=a[a.length-1]),0<(a=this.parent.eventBase.getSelectedAppointments()).length&&(i=this.getWorkCellFromAppointmentElement(a[a.length-1]),this.parent.eventBase.removeSelectedAppointmentClass(),!i))||(e.target.classList.contains(O)&&i.classList.contains(O)?(a=this.processLeftRight(i),n=new Date(+i.getAttribute("data-date")),s="Year"===this.parent.currentView&&n.getTime()===Pe(n).getTime(),0<a.columnIndex&&a.columnIndex<a.maxIndex&&!s?(r=this.calculateNextPrevDate(i,a.element.rows[a.rowIndex].cells[i.cellIndex-1],"left"),o&&t&&r.classList.contains(E)&&(r=this.getTimelineYearTargetCell(a,i,!1)),U.isNullOrUndefined(r)||this.selectCells(t,r)):0!==a.columnIndex&&!s||(!this.isInverseTableSelect()&&0<a.rowIndex?(r=this.calculateNextPrevDate(i,a.element.rows[a.rowIndex-1].cells[a.maxIndex-1],"left"),r=o&&t&&r.classList.contains(E)?this.getHorizontalLeftRightCell(a,i,!1):r,U.isNullOrUndefined(r)||this.selectCells(t,r)):t||(s&&n.getTime()!==this.parent.activeView.getStartDate().getTime()?this.selectCells(t,this.parent.element.querySelector('[data-date="'+(n.getTime()-B)+'"]')):(this.parent.changeDate(this.parent.activeView.getNextPreviousDate("previous"),e),o=this.parent.getContentTable(),r=this.isInverseTableSelect()?a.rowIndex:o.rows.length-1,n=o.rows[parseInt(r.toString(),10)].cells[a.maxIndex-1],s&&(n=(o=this.parent.element.querySelectorAll("."+S+" tbody")).item(o.length-1).querySelector(":not(."+E+')[data-date="'+this.parent.activeView.getEndDate().getTime()+'"]')),this.selectCells(!1,n))))):i.classList.contains(v)&&(r=i.cellIndex,s=(a=this.parent.getAllDayRow()).cells.length,0<r&&r<s?this.selectCells(t,a.cells[r-1]):0!==r||t||(this.parent.changeDate(this.parent.activeView.getNextPreviousDate("previous"),e),o=this.parent.getAllDayRow(),this.selectCells(!1,o.cells[s-1]))))},i.prototype.getTimelineYearTargetCell=function(e,t,i){return this.isInverseTableSelect()?this.getVerticalLeftRightCell(t,i):this.getHorizontalLeftRightCell(e,t,i)},i.prototype.getHorizontalLeftRightCell=function(e,t,i){e=e.element.rows[t.parentNode.sectionRowIndex+(i?1:-1)];return e?(i=i?"."+O+":not(."+E+")":'[data-date="'+(+t.getAttribute("data-date")-B)+'"]',e.querySelector(i)):t},i.prototype.getVerticalLeftRightCell=function(e,t){var i=new Date(+e.getAttribute("data-date")),i=new Date(i.getFullYear(),i.getMonth()+(t?1:-1),1),t=this.parent.getContentTable(),n=t.querySelector('[data-date="'+i.getTime()+'"]');return n.parentNode.sectionRowIndex>e.parentNode.sectionRowIndex?n:t.querySelector('[data-date="'+new Date(i.getFullYear(),i.getMonth()+1,0).getTime()+'"]')},i.prototype.calculateNextPrevDate=function(e,t,i){var n=this.initialTarget.getAttribute("data-group-index");return 0<this.parent.activeViewOptions.group.resources.length&&"Month"===this.parent.currentView&&e&&t&&t.getAttribute("data-group-index")!==n&&(e=this.parent.getDateFromElement(e),i="right"===i?new Date(e.setDate(e.getDate()+1)):new Date(e.setDate(e.getDate()-1)),t=[].slice.call(this.parent.element.querySelectorAll('td[data-date="'+i.getTime().toString()+'"][data-group-index="'+n+'"]'))[0]),t},i.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"])'))},i.prototype.processTabOnPopup=function(e,t){var i=this,t=this.getFocusableElements(t),n=(t=t.filter(function(e){var t=i.parent.element.querySelector("."+on);return t&&t.offsetParent?!(e.classList.contains(Jn)||e.classList.contains(er)):!(e.classList.contains(hn)||e.classList.contains(dn))}))[0],t=t[t.length-1];U.isNullOrUndefined(t)||document.activeElement!==t||e.shiftKey||(e.preventDefault(),n.focus()),!U.isNullOrUndefined(n)&&document.activeElement===n&&e.shiftKey&&(e.preventDefault(),t.focus())},i.prototype.processTab=function(e,t){var i=e.target;if(i.classList.contains(Sr)&&this.parent.inlineModule&&(i=i.closest(".e-appointment"),this.parent.inlineModule.inlineCrudActions(e.target)),"TimelineYear"===this.parent.currentView&&i.classList.contains(E))i.classList.contains(ni)&&this.parent.removeSelectedClass();else{var n=U.closest(i,"."+lr+",."+gn);if(n&&n.classList.contains(yt))n.classList.contains(gn)&&this.parent.eventBase.removeSelectedAppointmentClass(),this.processTabOnPopup(e,n);else if(i.classList.contains(ot))this.parent.eventBase.removeSelectedAppointmentClass();else if(i.classList.contains(Ut)&&this.parent.activeView.isTimelineView()&&0<this.parent.activeViewOptions.group.resources.length)a=parseInt(i.getAttribute("data-group-index"),10),0<(r=[].slice.call(this.parent.element.querySelectorAll("."+A+'[data-group-index="'+(t?a-1:a)+'"]'))).length?(this.parent.eventBase.removeSelectedAppointmentClass(),n=(t?r.slice(-1):r)[0],this.parent.eventBase.addSelectedAppointments([n],!0),n.focus(),e.preventDefault()):a+1===this.parent.resourceBase.lastResourceLevel.length?(this.parent.element.focus(),e.preventDefault()):this.parent.virtualScrollModule?(n=this.parent.element.querySelector("."+yi),n=Math.round(n.offsetHeight/this.parent.resourceBase.expandedResources.length),this.parent.element.querySelector(".e-content-wrap").scrollTop=(t?a-1:a+1)*n,this.parent.virtualScrollModule.virtualScrolling()):this.setScrollPosition(a);else{if(i.classList.contains(A)){var r=[].slice.call(this.parent.element.querySelectorAll("."+A)),n="TimelineYear"===this.parent.currentView;if((this.parent.activeView.isTimelineView()&&!n||n&&"Vertical"===this.parent.activeViewOptions.orientation)&&0<this.parent.activeViewOptions.group.resources.length){var a=parseInt(i.getAttribute("data-group-index"),10),n=(r=[].slice.call(this.parent.element.querySelectorAll("."+A+'[data-group-index="'+a+'"]')),"."+Ut+'[data-group-index="'+(t?a:a+1)+'"]'),n=this.parent.element.querySelector(n);if(n&&(t&&i.getAttribute("data-guid")===r[0].getAttribute("data-guid")||!t&&i.getAttribute("data-guid")===r.slice(-1)[0].getAttribute("data-guid")))return this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.virtualScrollModule?n.focus({preventScroll:!0}):n.focus(),this.parent.activeView.isTimelineView()&&0<this.parent.activeViewOptions.group.resources.length&&U.isNullOrUndefined(this.parent.virtualScrollModule)&&this.setScrollPosition(a),void e.preventDefault()}n=this.parent.eventBase.getSelectedAppointments();return(0<n.length&&(i=n[n.length-1]),this.parent.eventBase.removeSelectedAppointmentClass(),!t&&i.getAttribute("data-guid")===r[r.length-1].getAttribute("data-guid")||t&&i.getAttribute("data-guid")===r[0].getAttribute("data-guid"))?void 0:void("Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||(this.selectAppointment(t,i),e.preventDefault()))}a=this.parent.getSelectedCells();0<a.length&&!i.classList.contains(A)?(i=a[a.length-1],this.selectAppointmentElementFromWorkCell(t,i),e.preventDefault()):i&&!i.classList.contains(Ut)&&this.parent.activeView.isTimelineView()&&0<this.parent.activeViewOptions.group.resources.length&&this.processTabOnResourceCells(i,t)}}},i.prototype.processDelete=function(e){var t,i=document.activeElement;(i="MonthAgenda"===this.parent.currentView?(t=this.parent.eventBase.getSelectedEvents().element)&&U.isNullOrUndefined(t.length)?t:t[0]:i)&&i.classList.contains(A)&&(U.addClass([i],hi),this.parent.activeEventData=this.parent.eventBase.getSelectedEvents(),this.parent.activeViewOptions.readonly||i.classList.contains(br)||!this.parent.eventSettings.allowDeleting||this.parent.quickPopup.deleteClick(e))},i.prototype.processCtrlShiftNavigationArrows=function(e){if(0<this.parent.activeViewOptions.group.resources.length&&document.activeElement.classList.contains(A)){for(var t=parseInt(document.activeElement.getAttribute("data-group-index"),10),i=(n=(n="ctrlShiftLeftArrow"===e.action||"ctrlShiftUpArrow"===e.action?t-1:t+1)<0?0:n>this.parent.resourceBase.lastResourceLevel.length?this.parent.resourceBase.lastResourceLevel.length:n,[]);0===i.length&&0<=n&&n<=this.parent.resourceBase.lastResourceLevel.length;)i=[].slice.call(this.parent.element.querySelectorAll("."+A+'[data-group-index="'+n+'"]')),n="ctrlShiftLeftArrow"===e.action||"ctrlShiftUpArrow"===e.action?n-1:n+1;t=i[0];t&&(this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.eventBase.addSelectedAppointments([t],!0),t.focus())}else{var n;0<this.parent.activeViewOptions.group.resources.length&&!document.activeElement.classList.contains(A)&&(n=this.parent.resourceBase.renderedResources[0].groupIndex,0<(t=[].slice.call(this.parent.element.querySelectorAll("."+A+'[data-group-index="'+n+'"]'))).length)&&(this.parent.eventBase.removeSelectedAppointmentClass(),t=t[0],this.parent.eventBase.addSelectedAppointments([t],!0),t.focus(),e.preventDefault())}},i.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()},i.prototype.isPreventAction=function(e){e=U.closest(e.target,"."+kt);return!(!this.parent.activeView.isTimelineView()||U.isNullOrUndefined(e))},i.prototype.processTabOnResourceCells=function(e,t){var i,n=[].slice.call(this.parent.element.querySelectorAll('[tabIndex="0"]')),e=n.indexOf(e),t=t?n[e-1]:n[e+1];t&&t.classList.contains(Ut)&&(n=parseInt(t.getAttribute("data-group-index"),10),this.parent.virtualScrollModule?(i=this.parent.element.querySelector("."+Ht),[].slice.call(this.parent.element.querySelectorAll("."+Ut)).forEach(function(e){e.getBoundingClientRect().top<i.getBoundingClientRect().top&&e.setAttribute("tabindex","-1")})):this.setScrollPosition(n))},i.prototype.setScrollPosition=function(e){e=this.parent.element.querySelector("."+O+'[data-group-index="'+e+'"]');e&&(this.parent.element.querySelector("."+I).scrollTop=e.offsetTop)},i.prototype.getModuleName=function(){return"keyboard"},i.prototype.destroy=function(){this.removeEventListener(),this.selectedCells=[],this.keyboardModule.destroy()};var Pr=i;function i(e){this.selectedCells=[],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"},this.parent=e,this.parent.element.tabIndex=-1===this.parent.element.tabIndex?0:this.parent.element.tabIndex,this.keyboardModule=new U.KeyboardEvents(this.parent.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.addEventListener()}Lr.prototype.initDataManager=function(e,t){this.dataManager=e instanceof H.DataManager?e:new H.DataManager(e),this.query=t instanceof H.Query?t:new H.Query},Lr.prototype.generateQuery=function(e,t){var n,i,r,a=this.query.clone();if(this.parent&&e&&t){if(this.parent.activeViewOptions&&this.parent.activeViewOptions.enableLazyLoading&&!U.isNullOrUndefined(this.parent.activeViewOptions.group.resources)&&0<this.parent.activeViewOptions.group.resources.length&&this.parent.resourceBase&&0<this.parent.resourceBase.resourceCollection.length&&0<this.parent.resourceBase.renderedResources.length&&(n=[],this.parent.resourceBase.resourceCollection.forEach(function(){return n.push([])}),this.parent.resourceBase.renderedResources.forEach(function(i){n.forEach(function(e,t){t=i.groupOrder[parseInt(t.toString(),10)];t&&e.indexOf(t)<0&&e.push(t)})}),this.parent.resourceBase.resourceCollection.forEach(function(e,t){a.addParams(e.field,n[parseInt(t.toString(),10)].toString())})),this.parent.timezone&&(e=this.parent.tzModule.remove(new Date(+e.getTime()),this.parent.timezone),t=this.parent.tzModule.remove(new Date(+t.getTime()),this.parent.timezone)),this.parent.eventSettings.includeFiltersInQuery)return i=this.getStartEndQuery(e,t),r=new H.Predicate(this.parent.eventFields.recurrenceRule,"notequal",null).and(new H.Predicate(this.parent.eventFields.recurrenceRule,"notequal","")),a.where(i.or(r));a.addParams("StartDate",e.toISOString()),a.addParams("EndDate",t.toISOString())}return a},Lr.prototype.getStartEndQuery=function(e,t){var i=this.parent.eventFields;return new H.Predicate(i.startTime,"greaterthanorequal",e).and(new H.Predicate(i.endTime,"greaterthanorequal",e)).and(new H.Predicate(i.startTime,"lessthan",t)).or(new H.Predicate(i.startTime,"lessthanorequal",e).and(new H.Predicate(i.endTime,"greaterthan",e)))},Lr.prototype.getData=function(e){return this.dataManager.executeQuery(e)},Lr.prototype.destroy=function(){this.dataManager=null,this.query=null};var jr=Lr;function Lr(e,t,i){this.parent=e,this.initDataManager(t,i)}qr.prototype.firstDateOfMonth=function(e){return new Date(e.getFullYear(),e.getMonth())},qr.prototype.lastDateOfMonth=function(e){return new Date(e.getFullYear(),e.getMonth()+1,0)},qr.prototype.isMonthStart=function(e){return 1===e.getDate()},qr.prototype.getLeapYearDaysCount=function(){return 366},qr.prototype.getYearDaysCount=function(e,t){return(e.getFullYear()+t)%4==0?366:365},qr.prototype.getDate=function(e){return e.getDate()},qr.prototype.getMonth=function(e){return e.getMonth()+1},qr.prototype.getFullYear=function(e){return e.getFullYear()},qr.prototype.getYearLastDate=function(e,t){return new Date(e.getFullYear()+t,0,0)},qr.prototype.getMonthDaysCount=function(e){return this.lastDateOfMonth(e).getDate()},qr.prototype.getMonthStartDate=function(e){return new Date(e.getFullYear(),e.getMonth(),1,e.getHours(),e.getMinutes())},qr.prototype.getMonthEndDate=function(e){return e.setDate(1),new Date(e.setMonth(e.getMonth()+1))},qr.prototype.getExpectedDays=function(e,t){return t},qr.prototype.setDate=function(e,t){e.setDate(t)},qr.prototype.setValidDate=function(e,t,i,n,r){U.isNullOrUndefined(r)?e.setMonth(e.getMonth()+t,i):e.setMonth((r?n:e.getMonth())+t)},qr.prototype.setMonth=function(e,t,i){e.setDate(1),e.setFullYear(e.getFullYear()),e.setMonth(t-1);t=new Date(e.getFullYear(),e.getMonth()+1,0).getDate();e.setDate(Math.min(i,t))},qr.prototype.addYears=function(e,t){e.setFullYear(e.getFullYear()+t)},qr.prototype.isSameMonth=function(e,t){return e.getMonth()===t.getMonth()},qr.prototype.checkMonth=function(e,t){return-1===t.indexOf(e.getMonth()+1)},qr.prototype.compareMonth=function(e,t){return e.getMonth()>t.getMonth()},qr.prototype.isSameYear=function(e,t){return e.getFullYear()===t.getFullYear()},qr.prototype.isLastMonth=function(e){return 11===e.getMonth()},qr.prototype.isLeapYear=function(e,t){return(e+t)%4==0};var Nr=qr;function qr(){}Ur.prototype.firstDateOfMonth=function(e){e=this.getHijriDate(e);return U.HijriParser.toGregorian(e.year,e.month,1)},Ur.prototype.lastDateOfMonth=function(e){var e=this.getHijriDate(e),t=this.getDaysInMonth(e.month,e.year),t=U.HijriParser.toGregorian(e.year,e.month,t),i=new Date(t.getTime()),i=new Date(i.setDate(i.getDate()+1)),n=this.getHijriDate(i);return e.month===n.month?i:(n=this.getHijriDate(t),e.month===n.month?t:new Date(t.setDate(t.getDate()-1)))},Ur.prototype.isMonthStart=function(e){return 1===this.getHijriDate(e).date},Ur.prototype.getLeapYearDaysCount=function(){return 355},Ur.prototype.getYearDaysCount=function(e,t){e=this.getHijriDate(e);return this.isLeapYear(e.year,t)?355:354},Ur.prototype.getDate=function(e){return this.getHijriDate(e).date},Ur.prototype.getMonth=function(e){return this.getHijriDate(e).month},Ur.prototype.getFullYear=function(e){return this.getHijriDate(e).year},Ur.prototype.getYearLastDate=function(e,t){e=this.getHijriDate(e);return U.HijriParser.toGregorian(e.year+t,1,0)},Ur.prototype.getMonthDaysCount=function(e){e=this.lastDateOfMonth(e);return this.getHijriDate(e).date},Ur.prototype.getMonthStartDate=function(e){var t=this.firstDateOfMonth(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),e.getHours(),e.getMinutes())},Ur.prototype.getMonthEndDate=function(e){e=this.lastDateOfMonth(e);return e.setDate(e.getDate()+1),new Date(e.setMonth(e.getMonth()))},Ur.prototype.getExpectedDays=function(e,t){for(var i=this.getHijriDate(e),n=[],r=0;r<t.length;r++){var a=U.HijriParser.toGregorian(i.year,i.month,t[parseInt(r.toString(),10)]);n.push(a.getDate())}return n},Ur.prototype.setDate=function(e,t){var i=this.getHijriDate(e),i=U.HijriParser.toGregorian(i.year,i.month,t);this.updateDateObj(e,i)},Ur.prototype.setValidDate=function(e,t,i,n,r){r=U.isNullOrUndefined(r)?e:this.firstDateOfMonth(r),r=this.getHijriDate(r),r=U.HijriParser.toGregorian(r.year,r.month+t,i);this.updateDateObj(e,r)},Ur.prototype.setMonth=function(e,t,i){var n=this.getHijriDate(e),n=U.HijriParser.toGregorian(n.year,t,i);this.updateDateObj(e,n)},Ur.prototype.addYears=function(e,t,i){var n=this.getHijriDate(e),n=U.HijriParser.toGregorian(n.year+t,i,1);this.updateDateObj(e,n)},Ur.prototype.isSameMonth=function(e,t){e=this.getHijriDate(e),t=this.getHijriDate(t);return e.month===t.month},Ur.prototype.checkMonth=function(e,t){e=this.getHijriDate(e);return-1===t.indexOf(e.month)},Ur.prototype.compareMonth=function(e,t){e=this.getHijriDate(e),t=this.getHijriDate(t);return e.month>t.month},Ur.prototype.isSameYear=function(e,t){e=this.getHijriDate(e),t=this.getHijriDate(t);return e.year===t.year},Ur.prototype.isLastMonth=function(e){return 12===this.getHijriDate(e).month},Ur.prototype.updateDateObj=function(e,t){e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate())},Ur.prototype.isLeapYear=function(e,t){return(14+11*(e+t))%30<11},Ur.prototype.getDaysInMonth=function(e,t){var i=0,i=29+(e+1)%2;return 11===e&&this.isLeapYear(t,0)&&i++,i},Ur.prototype.getHijriDate=function(e){return U.HijriParser.getHijriDate(e)};var Fr=Ur;function Ur(){}Wr.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}},Wr.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(),t=(e=new Date(e.getTime()+6e4*(t-i))).getTimezoneOffset();return new Date(e.getTime()+6e4*(t-n))},Wr.prototype.add=function(e,t){return this.convert(e,e.getTimezoneOffset(),t)},Wr.prototype.remove=function(e,t){return this.convert(e,t,e.getTimezoneOffset())},Wr.prototype.removeLocalOffset=function(e){return new Date(e.getTime()-6e4*e.getTimezoneOffset())},Wr.prototype.getLocalTimezoneName=function(){return window.Intl&&Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"},Wr.prototype.getTimezoneData=function(){return zr};var Br=Wr;function Wr(){this.timezoneData=[],this.timezoneData=this.getTimezoneData()}var zr=[{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"}];function Yr(e,t,i,n){void 0===n&&(n="Gregorian");var r,a,s,o=ga(e),l=t.getConstant("every")+" ",e=n.toLowerCase();switch(a="en"===i||"en-US"===i?(s="days.stand-alone.abbreviated",r=U.getValue("months.stand-alone.abbreviated",U.getDefaultDateObject(e)),U.getValue(s,U.getDefaultDateObject(e))):(s="main."+i+".dates.calendars."+e+".days.stand-alone.abbreviated",r=U.getValue("main."+i+".dates.calendars."+e+".months.stand-alone.abbreviated",U.cldrData),U.getValue(s,U.cldrData)),1<o.interval&&(l+=o.interval+" "),o.freq){case"DAILY":l+=t.getConstant("summaryDay");break;case"WEEKLY":l+=t.getConstant("summaryWeek")+" "+t.getConstant(Oa)+" ",o.day.forEach(function(e,t){l=(l+=f(U.getValue(Ea[""+e],a),"single"))+(o.day.length-1===t?"":", ")});break;case"MONTHLY":l=(l+=t.getConstant("summaryMonth")+" "+t.getConstant(Oa)+" ")+_r(o,a,t);break;case"YEARLY":l=(l=(l+=t.getConstant("summaryYear")+" "+t.getConstant(Oa)+" ")+(f(U.getValue(o.month[0].toString(),r),"single")+" "))+_r(o,a,t)}return o.count?l+=", "+o.count+" "+t.getConstant("summaryTimes"):o.until&&(n=o.until,l+=", "+t.getConstant("summaryUntil")+" "+n.getDate()+" "+f(U.getValue((n.getMonth()+1).toString(),r),"single")+" "+n.getFullYear()),l}function _r(e,t,i){var n,r="";return e.monthDay.length?r+=e.monthDay[0]:e.day&&(n=e.setPosition-1,r+=i.getConstant(Sa[-1<n?n:Sa.length-1])+" "+f(U.getValue(Ea[e.day[0]],t),"single")),r}function Gr(e,t,i,n,r,a,s,o){void 0===r&&(r=43),void 0===a&&(a=null),void 0===s&&(s="Gregorian"),void 0===o&&(o=null);var l=ga(t),p=(Y=fa(s),[]),c=new Date(e.getTime()),t=(ya=[],U.isNullOrUndefined(i)?[]:i.split(",")),j=new Br;if(t.forEach(function(e){e=Xr(e);o&&(e=j.add(new Date(e.getTime()),o)),ya.push(new Date(e.getTime()).setHours(0,0,0,0))}),l.recExceptionCount=U.isNullOrUndefined(l.count)?0:ya.length,wa=a&&e<a&&!l.count?new Date(new Date(a.getTime()).setHours(0,0,0)):null,!l.until&&wa&&((s=new Date(wa.getTime())).setDate(wa.getDate()+r*l.interval),l.until=s),!(l.until&&e>l.until)){Ta=r,n=n||0;for(var L=Ca[parseInt(n.toString(),10)];ba[0]!==L;){h=void 0;d=void 0;var h=ba;var d=h.shift();h.push(d)}switch(l.until&&(i=W(l.until),l.until=new Date(i.getFullYear(),i.getMonth(),i.getDate(),23,59,59)),l.freq){case"DAILY":for(var u=c,N=l.until,g=p,m=l,v=new Date(u.getTime()),q=m.interval,f=Kr(u,m),y=m.day;ha(v,N)&&!(va(v,m)&&(-1<y.indexOf(Ca[v.getDay()])||0===y.length)&&(Qr(g,v.getTime()),f)&&g.length+m.recExceptionCount>=f);)v.setDate(v.getDate()+q),v.getHours()!==u.getHours()&&v.setHours(u.getHours());break;case"WEEKLY":var T=c,w=l.until,D=p,b=l,C=new Date(T.getTime());b.day.length||b.day.push(Ca[T.getDay()]);var S,O=b.interval,E=b.day,V=Kr(T,b),F=!0,x=[];if(1<E.length)for(!U.isNullOrUndefined(b.wkst)&&""!==b.wkst||(b.wkst=ba[0]),S=Ca.indexOf(b.wkst);ha(C,w);){var A=Ca.indexOf(Ca[C.getDay()])-S,A=z(C,-(A=-1==A?6:A)),I=z(A,6),M=new Date(C.getTime());for(I=W(I),M=W(M);M<=I&&(-1<E.indexOf(Ca[C.getDay()])&&x.push([C.getTime()]),!(V&&D.length+b.recExceptionCount>=V));)C.setDate(C.getDate()+1),C.getHours()!==T.getHours()&&C.setHours(T.getHours()),M=W(M=new Date(C.getTime()));if(C.setDate(C.getDate()-1),V&&D.length+b.recExceptionCount>=V)break;C.setDate(C.getDate()+1+7*(O-1)),ra(x,0,T,w,D,b),x=[]}else{for(C=ua(T,b.day);ha(C,w)&&((F=va(C,b))&&-1<E.indexOf(Ca[C.getDay()])&&Qr(D,C.getTime()),!(V&&D.length+b.recExceptionCount>=V));)C.setDate(C.getDate()+7*O);ra(x,0,T,w,D,b),x=[]}break;case"MONTHLY":Zr(c,l.until,p,l);break;case"YEARLY":var k=c,R=l.until,H=p,P=l;switch(function(e){{if(e.yearDay.length)return"YEARDAY";if(e.weekNo.length)return"WEEKNO"}return"MONTH"}(P)){case"MONTH":Zr(k,R,H,P);break;case"WEEKNO":!function(e,t,i,n){var r,a,s,o,l,p,c=Y.getYearLastDate(e,0),h=Kr(e,n),d=n.weekNo,u=[],g=n.day;for(;ha(c,t);){a=ba.indexOf(Ca[c.getDay()]),s=6-a+1;for(var m=0;m<d.length;m++)for(o=d[parseInt(m.toString(),10)],l=1===(o=0<o?o:53+o+1)?s:s+7*(o-1),p=1===o?s-7:s+7*(o-2);p<l;)r=new Date(c.getTime()+B*p),(0===g.length||-1<g.indexOf(Ca[r.getDay()]))&&(U.isNullOrUndefined(n.setPosition)?la(0,e,t,i,n,r.getTime()):u.push([r.getTime()])),p++;if(U.isNullOrUndefined(n.setPosition)||ca(u,0,e,t,i,n),h&&i.length+n.recExceptionCount>=h)return;c=Y.getYearLastDate(r,n.interval),u=[]}}(k,R,H,P);break;case"YEARDAY":!function(e,t,i,n){var r,a,s=Y.getYearLastDate(e,0),o=Kr(e,n),l=[],p=n.day;for(;ha(s,t);){for(var c=0;c<n.yearDay.length;c++)a=n.yearDay[parseInt(c.toString(),10)],r=new Date(s.getTime()),a!==Y.getLeapYearDaysCount()&&a!==-Y.getLeapYearDaysCount()||Y.isLeapYear(Y.getFullYear(r),1)?(r.setDate(r.getDate()+(a<0?Y.getYearDaysCount(r,1)+1+a:a)),(0===p.length||-1<p.indexOf(Ca[r.getDay()]))&&(null==n.setPosition?la(0,e,t,i,n,r.getTime()):l.push([r.getTime()]))):r.setDate(r.getDate()+1);if(U.isNullOrUndefined(n.setPosition)||ca(l,0,e,t,i,n),o&&i.length+n.recExceptionCount>=o)return;s=Y.getYearLastDate(r,n.interval),l=[]}}(k,R,H,P)}}}return p}function Xr(e){return new Date(e.substr(0,4)+"-"+e.substr(4,2)+"-"+e.substr(6,5)+":"+e.substr(11,2)+":"+e.substr(13))}function Qr(e,t){var i=new Date(t).setHours(0,0,0,0);-1===ya.indexOf(i)&&(!wa||i>=wa.getTime())&&e.push(t)}function Kr(e,t){var i=Ta;return t.count?i=t.count:t.until&&("DAILY"===t.freq||"WEEKLY"===t.freq?i=Math.floor((t.until.getTime()-e.getTime())/B)+1:"MONTHLY"!==t.freq&&"YEARLY"!==t.freq||(i=Math.floor((t.until.getMonth()+12*t.until.getFullYear()-(e.getMonth()+12*e.getFullYear()))/t.interval)+(1<t.day.length?Math.floor((t.until.getTime()-e.getTime())/B)+1:1),"YEARLY"===t.freq&&(i=1<t.month.length?i*t.month.length:i))),i}function Zr(e,t,i,n){switch(n.month.length||n.day.length||n.monthDay.length?0<n.month.length&&!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)),function(e){{if(e.monthDay.length&&!e.day.length)return"date";if(!e.monthDay.length&&e.day.length)return"day"}return"both"}(n)){case"day":switch(n.freq){case"MONTHLY":na(e,t,i,n);break;case"YEARLY":!function(e,t,i,n){var r=n.day,a=r.map(function(e){return Va.test(e)});if(1<r.length&&-1<a.indexOf(!0)){var s,o,l,p=e,c=t,h=i,d=n,u=d.day,g=Kr(p,d),m=new Date(p.getTime()),v=d.interval,f=[],y=[],T=0,w=(m=Y.getMonthStartDate(m),[]);for(d.month.length&&Y.setMonth(m,d.month[0],1),m=ua(m,d.day);ha(m,c);){o=new Date(m.getTime());for(var D=0;D<=d.month.length;D++)for(var b=0;b<=u.length-1;b++){for(m=ua(m=Y.getMonthStartDate(m),d.day),f=[];Y.isSameYear(o,m)&&g&&h.length+d.recExceptionCount<=g;)for(;Y.isSameYear(o,m);){if(o=new Date(m.getTime()),0===d.month.length||0<d.month.length&&d.month[parseInt(D.toString(),10)]===Y.getMonth(o)){var C=u[parseInt(b.toString(),10)].match(Aa),S=parseInt(C[0],10);for(l=new Date(m.getTime());Y.isSameYear(l,m)&&Y.isSameMonth(l,m);)C[C.length-1]===Ca[l.getDay()]&&f.push([l.getTime()]),l.setDate(l.getDate()+1);l.setDate(l.getDate()-1),s=-1<C[0].indexOf("-")?f.length- -1*S:S-1,s=isNaN(s)?0:s}T=ta(m,d,T,void 0,1),m=ua(m,d.day)}if(m=0===b&&l?new Date(l.getTime()):new Date(o.getTime()),0<f.length&&(U.isNullOrUndefined(d.setPosition)?ca(f,0,p,c,h,d,s):y=[oa(f,s,w)]),g&&h.length+d.recExceptionCount>=g)return}U.isNullOrUndefined(d.setPosition)||(pa(y,0,p,c,h,d),w=[]),Y.isLastMonth(m)?(Y.setValidDate(m,1,1),m.setFullYear(m.getFullYear()+v-1)):m.setFullYear(m.getFullYear()+v),m=ua(m,d.day),d.month.length&&Y.setMonth(m,d.month[0],m.getDate())}}else if(n.month.length&&1===r.length&&-1<a.indexOf(!0))na(e,t,i,n);else{var O,E=new Date(e.getTime()),V=Kr(e,n),x=n.interval,A=[];for(n.month.length&&Y.setMonth(E,n.month[0],E.getDate()),U.isNullOrUndefined(n.setPosition)&&0===n.month.length&&0===n.weekNo.length&&E.setFullYear(e.getFullYear(),0,1),E=ua(E=Y.getMonthStartDate(E),n.day);ha(E,t);){for(O=new Date(E.getTime());Y.isSameYear(O,E)&&V&&i.length+n.recExceptionCount<=V;)for(O=new Date(E.getTime());Y.isSameYear(O,E);){if(!(0===n.month.length||0<n.month.length&&!Y.checkMonth(E,n.month))){Y.setValidDate(E,1,1),E=ua(E,n.day);break}if(1<r.length){if(Y.compareMonth(O,E)){Y.setValidDate(E,1,1),E=ua(E,n.day);break}-1<r.indexOf(Ca[O.getDay()])&&A.push([O.getTime()]),O.setDate(O.getDate()+1)}else{if(O.getFullYear()>E.getFullYear()){Y.setValidDate(E,1,1),E=ua(E,n.day);break}var I=da(r[0]);Ca[O.getDay()]===I&&new Date(O.getFullYear(),O.getMonth(),0)>new Date(e.getFullYear())&&A.push([O.getTime()]),O.setDate(O.getDate()+7)}}if(E.setFullYear(O.getFullYear(),O.getMonth(),O.getDate()),sa(A,e,t,i,n),Y.isLastMonth(E)&&(Y.setValidDate(E,1,1),E=ua(E,n.day)),E.setFullYear(E.getFullYear()+x-1),V&&i.length+n.recExceptionCount>=V)return;E=ua(E,n.day),A=[]}}}(e,t,i,n)}break;case"both":case"date":switch(n.freq){case"MONTHLY":$r(e,t,i,n);break;case"YEARLY":!function(e,t,i,n){if(n.month.length)$r(e,t,i,n);else{var r,a=Jr(e,n);for(a.tempDate=a.mainDate=Y.getMonthStartDate(a.tempDate);ha(a.tempDate,t);){for(r=new Date(a.tempDate.getTime());Y.isSameYear(r,a.tempDate)&&a.expectedCount&&i.length+n.recExceptionCount<=a.expectedCount;){if(!(0===n.month.length||0<n.month.length&&!Y.checkMonth(a.tempDate,n.month))){Y.setValidDate(a.tempDate,1,1),a.tempDate=ua(a.tempDate,n.day);break}ea(n,a,t,!1),a.beginDate=new Date(a.tempDate.getTime()),a.monthInit=ta(a.tempDate,n,a.monthInit,a.beginDate)}if(a.tempDate.setFullYear(r.getFullYear(),r.getMonth(),r.getDate()),ra(a.dateCollection,a.state,e,t,i,n),Y.isLastMonth(a.tempDate)&&(Y.setValidDate(a.tempDate,1,1),a.tempDate=ua(a.tempDate,n.day)),a.expectedCount&&i.length+n.recExceptionCount>=a.expectedCount)return;a.tempDate.setFullYear(a.tempDate.getFullYear()+n.interval-1),a.tempDate=ua(a.tempDate,n.day),a.monthInit=ta(a.tempDate,n,a.monthInit,a.beginDate),a.dateCollection=[]}}}(e,t,i,n)}}}function Jr(e,t){e={monthCollection:[],index:0,tempDate:new Date(e.getTime()),mainDate:new Date(e.getTime()),expectedCount:Kr(e,t),monthInit:0,dateCollection:[]};return t.month.length&&Y.setMonth(e.tempDate,t.month[0],e.tempDate.getDate()),e}function $r(e,t,i,n){var r=Jr(e,n);if(r.tempDate=r.mainDate=Y.getMonthStartDate(r.tempDate),!(("MONTHLY"===n.freq&&12===n.interval||"YEARLY"===n.freq)&&Y.getMonthDaysCount(e)<n.monthDay[0]))for(;ha(r.tempDate,t);){if(r.beginDate=new Date(r.tempDate.getTime()),ea(n,r,t,!0,e,i),U.isNullOrUndefined(n.setPosition)||ca(r.dateCollection,r.state,e,t,i,n),r.expectedCount&&i.length+n.recExceptionCount>=r.expectedCount)return;r.monthInit=ta(r.tempDate,n,r.monthInit,r.beginDate),r.dateCollection=[]}}function ea(e,t,i,n,r,a){for(var s,o,l,p=0;p<e.monthDay.length;p++){t.date=e.monthDay[parseInt(p.toString(),10)],t.tempDate=Y.getMonthStartDate(t.tempDate);var c=Y.getMonthDaysCount(t.tempDate);if(t.date=0<t.date?t.date:c+t.date+1,c=t.tempDate,s=t.date,o=t.mainDate,l=void 0,l=Y.getMonthDaysCount(c),s<=l&&o<=c&&0<t.date){if(Y.setDate(t.tempDate,t.date),i&&t.tempDate>i)return;(0===e.day.length||-1<e.day.indexOf(Ca[t.tempDate.getDay()]))&&(n&&U.isNullOrUndefined(e.setPosition)&&t.expectedCount&&a.length+e.recExceptionCount<t.expectedCount?la(t.state,r,i,a,e,t.tempDate.getTime()):t.dateCollection.push([t.tempDate.getTime()]))}}}function ta(e,t,i,n,r){var a=(n=void 0===n?null:n)?n.getMonth():0,s=Y.getMonthStartDate(e);return r=U.isNullOrUndefined(r)?t.interval:r,e.setFullYear(s.getFullYear()),e.setMonth(s.getMonth()),e.setDate(s.getDate()),t.month.length?(i++,i%=t.month.length,Y.setMonth(e,t.month[parseInt(i.toString(),10)],1),0===i&&Y.addYears(e,r,t.month[0])):(n&&n.getFullYear()<e.getFullYear()&&(a=e.getMonth()-1),Y.setValidDate(e,r,1,a,n)),i}function ia(e,t,i,n){var r,a=n.day,s=new Date(e.getTime()),o=(s=Y.getMonthStartDate(s),[]),l=[],p=[],c=Kr(e,n),h=0;for(n.month.length&&Y.setMonth(s,n.month[0],1),s=ua(s,n.day);ha(s,t)&&c&&i.length+n.recExceptionCount<c;){var d=new Date(s.getTime());if(-1<a.map(function(e){return Va.test(e)}).indexOf(!0)){for(var u=0;u<=a.length-1;u++){var g=a[parseInt(u.toString(),10)].match(Aa),m=parseInt(g[0],10),s=new Date(s.getTime());for(s=ua(s=Y.getMonthStartDate(s),a),d.setFullYear(s.getFullYear(),s.getMonth(),s.getDate());Y.isSameYear(d,s)&&Y.isSameMonth(d,s);)g[g.length-1]===Ca[d.getDay()]&&o.push([d.getTime()]),d.setDate(d.getDate()+1);if(d.setDate(d.getDate()-1),w=-1<g[0].indexOf("-")?o.length- -1*m:m-1,w=isNaN(w)?0:w,0<o.length&&(U.isNullOrUndefined(n.setPosition)?ca(o,0,e,t,i,n,w):l=[oa(o,w,p)]),c&&i.length+n.recExceptionCount>=c)return;o=[]}U.isNullOrUndefined(n.setPosition)||(pa(l,0,e,t,i,n),p=[])}else{for(var v=[],f=function(r){var a={};return r.forEach(function(e,t){if(t===r.length-1){for(var i=ba.indexOf(e),n=i;n%7!==ba.indexOf(r[0]);)n++;a[""+e]=n-i}else a[""+e]=ba.indexOf(r[t+1])-ba.indexOf(e)}),a}(a),y=(d.setFullYear(s.getFullYear(),s.getMonth(),s.getDate()),new Date(s.getTime())),T=new Date(s.getTime());Y.isSameMonth(y,s);)v.push(s.getTime()),-1<a.indexOf(Ca[s.getDay()])&&(o.push(v),v=[]),s.setDate(s.getDate()+f[Ca[s.getDay()]]);if(w=n.setPosition<1?o.length+n.setPosition:n.setPosition-1,U.isNullOrUndefined(n.setPosition)){for(var w=0,D=[],b=0;b<o.length;b++)for(var C=0;C<o[parseInt(b.toString(),10)].length;C++)D.push(o[parseInt(b.toString(),10)][parseInt(C.toString(),10)]);o=[D]}if(0<o.length&&ca(o,0,e,t,i,n,w),c&&i.length+n.recExceptionCount>=c)return}h=ta(s,n,h,T),s=ua(s,n.day),o=[]}}function na(e,t,i,n){if(1<n.day.length)ia(e,t,i,n);else{var r=new Date(e.getTime()),a=Kr(e,n),s=[],o=0,r=Y.getMonthStartDate(r);for(n.month.length&&Y.setMonth(r,n.month[0],1),r=ua(r,n.day);ha(r,t)&&a&&i.length+n.recExceptionCount<a;){for(var l=new Date(r.getTime()),p=new Date(r.getTime());Y.isSameMonth(r,p);)s.push([p.getTime()]),p.setDate(p.getDate()+7);sa(s,e,t,i,n),o=ta(r,n,o,l),r=ua(r,n.day),s=[]}}}function ra(e,t,i,n,r,a){var s=a.setPosition<1?e.length+a.setPosition:a.setPosition-1;U.isNullOrUndefined(a.setPosition)&&(s=0,e=aa(e)),0<e.length&&ca(e,0,i,n,r,a,s)}function aa(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=0<t.length?[t]:[]}function sa(e,t,i,n,r){var a,s,o,l=r.day,l=(a=e,o={monthCollection:[],index:0},1===(l=l).length&&(p=void 0,1<(l=l[0].match(Aa)).length)?s=(p=parseInt(l[0],10))<1?a.length+p:p-1:(s=0,a=aa(a)),o.monthCollection=a,o.index=s,o),p=(e=l.monthCollection,l.index);null!=r.setPosition?pa([oa(e,p,[])],0,t,i,n,r):0<e.length&&ca(e,0,t,i,n,r,p)}function oa(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 la(e,t,i,n,r,a){var s=Kr(t,r),o=new Date(a);e=va(o,r),t<=o&&ha(o,i)&&e&&s&&n.length+r.recExceptionCount<s&&Qr(n,a)}function pa(e,t,i,n,r,a){if(0<e.length)for(var s=0;s<e.length;s++){e[parseInt(s.toString(),10)].sort();var o=a.day.map(function(e){return Va.test(e)}),o="YEARLY"===a.freq&&-1<a.validRules.indexOf("BYMONTH")&&!(-1<o.indexOf(!0))?(o=new Date(e[0][0]).getFullYear(),l=e,c=s,h=a,d=void(p=0),p=p||0,d=new Date(o,h.month[0]-1,1),o=new Date(o,h.month[0],0).getDate(),d=(d.getDay()-p+7)%7,p=Math.ceil((d+o)/7)-1,d=l[parseInt(c.toString(),10)][parseInt(p.toString(),10)],va(new Date(d),h)?p:p-1):e[parseInt(s.toString(),10)].length+a.setPosition,l=a.setPosition<1?o:a.setPosition-1;la(0,i,n,r,a,e[parseInt(s.toString(),10)][parseInt(l.toString(),10)])}var p,l,c,h,d}function ca(e,t,i,n,r,a,s){if(0<e.length){s=U.isNullOrUndefined(s)?a.setPosition<1?e.length+a.setPosition:a.setPosition-1:s,e[parseInt(s.toString(),10)].sort();for(var o=0;o<e[parseInt(s.toString(),10)].length;o++)la(0,i,n,r,a,e[parseInt(s.toString(),10)][parseInt(o.toString(),10)])}}function ha(e,t){return!t||e<=t}function da(e){return e.replace(xa,"")}function ua(e,t){var i,n=new Date(e.getTime());if(0<t.length){for(var r=[],a=0;a<=t.length-1;a++)i=da(t[parseInt(a.toString(),10)]),r.push(i);if(-1===r.indexOf(Ca[n.getDay()]))for(;n.setDate(n.getDate()+1),-1===r.indexOf(Ca[n.getDay()]););}return n}function ga(e){var t,i={freq:null,interval:1,count:null,until:null,day:[],wkst:null,month:[],weekNo:[],monthDay:[],yearDay:[],setPosition:null,validRules:[]},e=e.split(";"),n=[];return e.forEach(function(e){switch((n=e.split("="))[0]){case"UNTIL":t=n[1],i.until=Xr(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=4<parseInt(n[1],10)?-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&&(e=i.validRules.indexOf("BYDAY"),i.validRules.splice(e,1)),i}function ma(e,t){for(var i,n=t.slice(0),r=(t=e,Da[Y.getFullYear(t)]||(Da[Y.getFullYear(t)]=Y.getYearLastDate(t,0)),i=Da[Y.getFullYear(t)],t=t.getTime()-i.getTime(),Math.ceil(t/B)),a=n.shift();a;){if((a=a<0?a+Y.getYearDaysCount(e,0)+1:a)===r)return;a=n.shift()}return 1}function va(n,e){var r=!0,a=e.day,s=e.month,o=Y.getExpectedDays(n,e.monthDay),l=e.yearDay;return e.validRules.forEach(function(e){switch(e){case"BYDAY":t=n.getDay(),i=[],a.forEach(function(e){e=e.match(Aa);2===e.length?i.push(e[1]):i.push(e[0])}),-1===i.indexOf(Ca[parseInt(t.toString(),10)])&&(r=!1);break;case"BYMONTH":Y.checkMonth(n,s)&&(r=!1);break;case"BYMONTHDAY":!function(e,t){for(var i=t.slice(0),n=Y.getMonthDaysCount(e),r=i.shift();r;){if((r=r<0?r+n+1:r)===e.getDate())return;r=i.shift()}return 1}(n,o)||(r=!1);break;case"BYYEARDAY":ma(n,l)&&(r=!1)}var t,i}),r}function fa(e){return new("Islamic"===e?Fr:Nr)}var ya,Ta,wa,Y,Da={},ba=["SU","MO","TU","WE","TH","FR","SA"],Ca=["SU","MO","TU","WE","TH","FR","SA"],Sa=["first","second","third","fourth","last"],Oa="summaryOn",Ea={SU:"sun",MO:"mon",TU:"tue",WE:"wed",TH:"thu",FR:"fri",SA:"sat"},Va=/\d/,xa=/[^A-Z]+/,Aa=/[a-z]+|[^a-z]+/gi;function Ia(e){return[e.getUTCFullYear(),Ma(e.getUTCMonth()+1),Ma(e.getUTCDate()),"T",Ma(e.getUTCHours()),Ma(e.getUTCMinutes()),Ma(e.getUTCSeconds()),"Z"].join("")}function Ma(e){return("0"+e).slice(-2)}n.prototype.processData=function(e,a,s){for(var o=this,t=this.parent.activeView.startDate(),i=this.parent.activeView.endDate(),l=this.parent.eventFields,p=[],c=1,h=!1,d=this.parent.resourceBase?this.parent.resourceBase.resourceCollection:[],n=(0<e.length&&U.isNullOrUndefined(e[0][l.id])&&(h=!0),function(t){h&&(t[l.id]=c++),t=u.updateEventDateTime(t),a?u.processTimezoneChange(t,s):u.parent.isPrinting||u.parent.uiStateValues.isPreventTimezone||(t=u.processTimezone(t));for(var e=0;e<d.length;e++)null!==t[d[parseInt(e.toString(),10)].field]&&0!==t[d[parseInt(e.toString(),10)].field]||(t[d[parseInt(e.toString(),10)].field]=void 0);if(U.isNullOrUndefined(t[l.recurrenceRule])||""!==t[l.recurrenceRule]||(t[l.recurrenceRule]=null),U.isNullOrUndefined(t[l.recurrenceRule])||!U.isNullOrUndefined(t[l.recurrenceID])||u.parent.crudModule&&u.parent.crudModule.crudObj.isCrudAction)if(u.parent.crudModule&&u.parent.crudModule.crudObj.isCrudAction)if(!U.isNullOrUndefined(t[l.recurrenceRule])&&U.isNullOrUndefined(t[l.recurrenceID]))for(var i=0,n=u.generateOccurrence(t,null,!0);i<n.length;i++)!function(t){var e=u.parent.eventsProcessed.filter(function(e){return e[l.startTime].getTime()-t[l.startTime].getTime()==0&&e[l.id]===t[l.id]});t.Guid=0<e.length?e[0].Guid:u.generateGuid(),p.push(t)}(n[i]);else{var r=u.parent.eventsProcessed.filter(function(e){return e[o.parent.eventFields.id]===t[o.parent.eventFields.id]});t.Guid=0<r.length?r[0].Guid:u.generateGuid(),p.push(t)}else t.Guid=u.generateGuid(),p.push(t);else p=p.concat(u.generateOccurrence(t,null,!0))}),u=this,r=0,g=e;r<g.length;r++)n(g[r]);this.parent.eventsProcessed=[];for(var e=p.filter(function(e){return!e[o.parent.eventFields.isBlock]}),t=(this.parent.eventsProcessed=this.filterEvents(t,i,e),p.filter(function(e){return e[o.parent.eventFields.isBlock]})),m=0,v=t;m<v.length;m++){var f=v[m];!f[l.isAllDay]||W(new Date(f[l.startTime].getTime()))<W(new Date(f[l.endTime].getTime()))||(f[l.startTime]=W(f[l.startTime]),f[l.endTime]=z(W(f[l.endTime]),1))}return this.parent.blockProcessed=t,e},n.prototype.updateEventDateTime=function(e){return"string"==typeof e[this.parent.eventFields.startTime]&&(e[this.parent.eventFields.startTime]=Ge(e[this.parent.eventFields.startTime])),"string"==typeof e[this.parent.eventFields.endTime]&&(e[this.parent.eventFields.endTime]=Ge(e[this.parent.eventFields.endTime])),e},n.prototype.getProcessedEvents=function(e){for(var t=[],i=0,n=e=void 0===e?this.parent.eventsData:e;i<n.length;i++){var r=n[i];!U.isNullOrUndefined(r[this.parent.eventFields.recurrenceRule])&&U.isNullOrUndefined(r[this.parent.eventFields.recurrenceID])?t=t.concat(this.generateOccurrence(r)):t.push(r)}return t},n.prototype.timezonePropertyChange=function(e){var t=this.parent.eventsData.concat(this.parent.blockData),t=this.processData(t,!0,e);this.parent.notify(Te,{processedData:t})},n.prototype.timezoneConvert=function(e){var t,i,n=this.parent.eventFields;e[n.startTimezone]=e[n.startTimezone]||e[n.endTimezone],e[n.endTimezone]=e[n.endTimezone]||e[n.startTimezone],this.parent.timezone&&(t=e[n.startTimezone],i=e[n.endTimezone],e[n.startTime]=this.parent.tzModule.convert(e[n.startTime],this.parent.timezone,t),e[n.endTime]=this.parent.tzModule.convert(e[n.endTime],this.parent.timezone,i))},n.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)))},n.prototype.processTimezone=function(e,t){void 0===t&&(t=!1);var i,n,r=this.parent.eventFields;return e[r.isAllDay]||(e[r.startTimezone]||e[r.endTimezone]?(i=e[r.startTimezone]||e[r.endTimezone],n=e[r.endTimezone]||e[r.startTimezone],t?this.parent.timezone?(e[r.startTime]=this.parent.tzModule.convert(e[r.startTime],i,this.parent.timezone),e[r.endTime]=this.parent.tzModule.convert(e[r.endTime],n,this.parent.timezone),e[r.startTime]=this.parent.tzModule.remove(e[r.startTime],this.parent.timezone),e[r.endTime]=this.parent.tzModule.remove(e[r.endTime],this.parent.timezone)):(e[r.startTime]=this.parent.tzModule.remove(e[r.startTime],i),e[r.endTime]=this.parent.tzModule.remove(e[r.endTime],n)):(e[r.startTime]=this.parent.tzModule.add(e[r.startTime],i),e[r.endTime]=this.parent.tzModule.add(e[r.endTime],n),this.parent.timezone&&(e[r.startTime]=this.parent.tzModule.convert(e[r.startTime],i,this.parent.timezone),e[r.endTime]=this.parent.tzModule.convert(e[r.endTime],n,this.parent.timezone)))):this.parent.timezone&&(t?(e[r.startTime]=this.parent.tzModule.remove(e[r.startTime],this.parent.timezone),e[r.endTime]=this.parent.tzModule.remove(e[r.endTime],this.parent.timezone)):(e[r.startTime]=this.parent.tzModule.add(e[r.startTime],this.parent.timezone),e[r.endTime]=this.parent.tzModule.add(e[r.endTime],this.parent.timezone)))),e},n.prototype.filterBlockEvents=function(e){for(var t,i=this.parent.eventFields,n=e[i.startTime],r=e[i.endTime],e=(0<this.parent.activeViewOptions.group.resources.length&&(e=this.getGroupIndexFromEvent(e),t=this.parent.resourceBase.lastResourceLevel[parseInt(e.toString(),10)]),U.extend([],this.parent.blockProcessed,null,!0)),a=0,s=e;a<s.length;a++){var o=s[a];o[i.isAllDay]&&o[i.endTime].getTime()>W(new Date(o[i.endTime].getTime())).getTime()&&(o[i.startTime]=W(o[i.startTime]),o[i.endTime]=z(W(o[i.endTime]),1))}return this.filterEvents(n,r,e,t)},n.prototype.filterEvents=function(e,t,i,n){void 0===i&&(i=this.parent.eventsProcessed);e=this.parent.dataModule.getStartEndQuery(e,t),t=new H.DataManager({json:i}).executeLocal((new H.Query).where(e));return n&&(t=this.filterEventsByResource(n,t)),this.sortByTime(t)},n.prototype.filterEventsByRange=function(e,t,i){var n=this,r=[],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;return this.sortByTime(r)},n.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(t){return a.every(function(e){return t[""+e]instanceof Array?-1<t[""+e].indexOf(i[""+e]):t[""+e]===i[""+e]})})},n.prototype.sortByTime=function(e){var i;return!this.parent.eventSettings.sortComparer||"function"!=typeof this.parent.eventSettings.sortComparer&&"string"!=typeof this.parent.eventSettings.sortComparer?(i=this.parent.eventFields,e.sort(function(e,t){e=e[i.startTime],t=t[i.startTime];return e.getTime()-t.getTime()})):e=this.customSorting(e),e},n.prototype.sortByDateTime=function(e){var r;return!this.parent.eventSettings.sortComparer||"function"!=typeof this.parent.eventSettings.sortComparer&&"string"!=typeof this.parent.eventSettings.sortComparer?(r=this.parent.eventFields,e.sort(function(e,t){var i=e[r.startTime],n=t[r.startTime],e=e[r.endTime],t=t[r.endTime],e=e.getTime()-i.getTime(),t=t.getTime()-n.getTime();return i.getTime()-n.getTime()||t-e})):e=this.customSorting(e),e},n.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 t=this.parent.eventSettings.sortComparer.split("."),i=void 0;if(i=U.isNullOrUndefined(window)?i:window[t[t.length-1]])return i(e)}return e},n.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},n.prototype.splitEventByDay=function(e){var t=this.parent.eventFields,i=[],n=e[t.startTime],r=e[t.endTime];if(W(new Date(n.getTime()))<W(new Date(r.getTime())))for(var a=new Date(n.getTime()),s=z(W(new Date(n.getTime())),1),o=0===r.getHours()&&0===r.getMinutes()?r:z(r,1),l=1,p=_e(n.getTime(),o.getTime());s<=r&&a.getTime()!==s.getTime();){var c=U.extend({},e);c[t.startTime]=a,c[t.endTime]=s,c.data={index:l,count:p},c.Guid=this.generateGuid(),c.isSpanned=!0,i.push(c),a=s,s=W(new Date(a.getTime())).getTime()===W(new Date(r.getTime())).getTime()&&s.getTime()!==r.getTime()?(s=new Date(a.getTime()),new Date(s.setHours(r.getHours(),r.getMinutes(),r.getSeconds()))):z(W(new Date(a.getTime())),1),l++}else i.push(e);return i},n.prototype.splitEvent=function(e,t){var i=this.parent.eventFields,n=W(e[i.startTime]).getTime(),r=W(e[i.endTime]).getTime(),a=n,s=r=Fe(e[i.endTime])<=0?(c=z(W(e[i.endTime]),-1).getTime())<n?n:c:r,o=[];if(n!==r){n<t[0].getTime()&&(n=t[0].getTime()),r>t[t.length-1].getTime()&&(r=t[t.length-1].getTime());for(var l=n,p=0;p<this.slots.length;p++){var c,h=this.slots[parseInt(p.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 m=g[u];d.push(new Date(m))}var v=this.getRenderedDates(d);if(!U.isNullOrUndefined(v)&&0<v.length)for(var h=[],f=0,y=v;f<y.length;f++){var T=y[f];h.push(T.getTime())}}"number"==typeof h&&(c=h,(h=[]).push(c));v=h[0];if(r<(l=l<=v&&v<=r?v:l)||r<v)break;if(!this.parent.activeViewOptions.group.byDate&&this.parent.activeViewOptions.showWeekend&&"WorkWeek"!==this.parent.currentView&&"TimelineWorkWeek"!==this.parent.currentView){var w=h.indexOf(l);if(-1!==w){var D=h.indexOf(r),b=-1!==D,C=(D=b?D:h.length-1)-w+1,S=h[parseInt(w.toString(),10)]!==a,O=h[parseInt(D.toString(),10)]!==s;if(o.push(this.cloneEventObject(e,h[parseInt(w.toString(),10)],h[parseInt(D.toString(),10)],C,S,O)),b)break}}else if(this.dateInRange(l,h[0],h[h.length-1])){for(var E=[],V=0;V<h.length;V++)this.dateInRange(h[parseInt(V.toString(),10)],a,s)&&E.push(h[parseInt(V.toString(),10)]);if(0<E.length)if(this.parent.activeViewOptions.group.byDate)for(var x=0,A=E;x<A.length;x++){var I=A[x];o.push(this.cloneEventObject(e,I,I,1,I!==a,I!==s))}else{S=E[0]!==a,O=E[E.length-1]!==s;o.push(this.cloneEventObject(e,E[0],E[E.length-1],E.length,S,O))}}}}else o.push(this.cloneEventObject(e,n,r,1,!1,!1));return o},n.prototype.cloneEventObject=function(e,t,i,n,r,a){var s=this.parent.eventFields,o=U.extend({},e,null,!0),n={count:n,isLeft:r,isRight:a};return n[s.startTime]=e[s.startTime],n[s.endTime]=e[s.endTime],o.data=n,o[s.startTime]=new Date(t),o[s.endTime]=new Date(i),o},n.prototype.dateInRange=function(e,t,i){return t<=e&&e<=i},n.prototype.getSelectedEventElements=function(t){if(this.removeSelectedAppointmentClass(),this.parent.selectedElements.length<=0)this.parent.selectedElements.push(t);else if(this.parent.selectedElements.filter(function(e){return e.getAttribute("data-guid")===t.getAttribute("data-guid")}).length<=0)for(var e='div[data-guid="'+t.getAttribute("data-guid")+'"]',i=0,n=[].slice.call(this.parent.element.querySelectorAll(e));i<n.length;i++){var r=n[i];this.parent.selectedElements.push(r)}else{e=this.parent.selectedElements.filter(function(e){return e.getAttribute("data-guid")!==t.getAttribute("data-guid")});this.parent.selectedElements=e}return t&&0<this.parent.selectedElements.length&&this.addSelectedAppointments(this.parent.selectedElements,!1),this.parent.selectedElements},n.prototype.getSelectedEvents=function(){var e=this,i=[],n=[];return[].slice.call(this.parent.element.querySelectorAll("."+hi)).filter(function(t){0===i.filter(function(e){return e.Guid===t.getAttribute("data-guid")}).length&&i.push(e.getEventByGuid(t.getAttribute("data-guid"))),n.push(t)}),{event:1<i.length?i:i[0],element:1<n.length?n:n[0]}},n.prototype.removeSelectedAppointmentClass=function(){var e=this.getSelectedAppointments();U.removeClass(e,hi),"Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView||U.removeClass(e,Di)},n.prototype.addSelectedAppointments=function(e,t){"MonthAgenda"!==this.parent.currentView&&this.parent.removeSelectedClass(),U.addClass(e,hi),0<e.length&&!t&&e[e.length-1].focus()},n.prototype.getSelectedAppointments=function(){return[].slice.call(this.parent.element.querySelectorAll("."+hi+",."+A+":focus"))},n.prototype.focusElement=function(e){var t,i;this.parent.eventWindow.dialogObject&&this.parent.eventWindow.dialogObject.visible||(i=document.activeElement,0<(t=this.parent.getSelectedCells()).length&&(i&&(this.parent.element.contains(i)||-1!==t.indexOf(i))||e)?this.parent.keyboardInteractionModule&&(i=!U.isNullOrUndefined(this.parent.activeCellsData)&&this.parent.activeCellsData.element||t[t.length-1],this.parent.keyboardInteractionModule.selectCells(i instanceof Array,i)):0<(e=this.getSelectedAppointments()).length&&(this.parent.activeEventData&&this.parent.activeEventData.element&&-1<e.indexOf(this.parent.activeEventData.element)?this.parent.activeEventData.element:e[e.length-1]).focus())},n.prototype.selectWorkCellByTime=function(e){if("Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView&&0<e.length){var e=e[e.length-1],t=e[this.parent.eventFields.startTime],i=new Date(+t).setMinutes(0,0,0),n=this.isAllDayAppointment(e),t=("Month"!==this.parent.currentView&&!n||(i=new Date(+t).setHours(0,0,0,0)),void 0),t=n&&-1!==["Day","Week","WorkWeek"].indexOf(this.parent.currentView)?this.parent.getAllDayRow():this.parent.getContentTable(),n='[data-date="'+new Date(i).getTime()+'"]';if(0<this.parent.activeViewOptions.group.resources.length&&(n+='[data-group-index="'+this.getGroupIndexFromEvent(e)+'"]'),i=t.querySelector(n))this.parent.activeCellsData=this.parent.getCellDetails(i),this.parent.keyboardInteractionModule&&this.parent.keyboardInteractionModule.selectCells(!1,i)}return i},n.prototype.getGroupIndexFromEvent=function(e){for(var i,t,n,r,a=this.parent.resourceBase.resourceCollection.length-1;0<=a;a--){var s=e[this.parent.resourceBase.resourceCollection[parseInt(a.toString(),10)].field];if(!U.isNullOrUndefined(s)){t=this.parent.resourceBase.resourceCollection[parseInt(a.toString(),10)],i=a,n=t.name,r=t.field;break}}U.isNullOrUndefined(n)&&U.isNullOrUndefined(i)&&(n=this.parent.resourceCollection.slice(-1)[0].name,i=this.parent.resourceCollection.length-1,r=this.parent.resourceCollection.slice(-1)[0].field,t=this.parent.resourceCollection.filter(function(e,t){return e.name===n?(i=t,e):null})[0]);var o,l=e[""+r]instanceof Array?e[""+r][0]:e[""+r];return 0<i?(o=this.parent.resourceCollection[i-1].field,this.parent.resourceBase.getIndexFromResourceId(l,n,t,e,o)):this.parent.resourceBase.getIndexFromResourceId(l,n,t)},n.prototype.isAllDayAppointment=function(e){var t=this.parent.eventFields,i=e[t.isAllDay],e=1<=(it(e[t.endTime])-it(e[t.startTime]))/B;return!!(i||"TimeSlot"!==this.parent.eventSettings.spannedEventPlacement&&e)},n.prototype.addEventListener=function(){this.parent.on(Ee,this.appointmentBorderRemove,this)},n.prototype.removeEventListener=function(){this.parent.off(Ee,this.appointmentBorderRemove)},n.prototype.appointmentBorderRemove=function(e){e=e.event.target;U.closest(e,"."+A)?"MonthAgenda"!==this.parent.currentView&&this.parent.removeSelectedClass():U.closest(e,"."+yt)||this.parent.uiStateValues.isTapHold&&U.closest(e,"."+O+",."+v)||(this.parent.uiStateValues.isTapHold=!1,this.removeSelectedAppointmentClass(),this.parent.selectedElements=[])},n.prototype.wireAppointmentEvents=function(e,t,i){void 0===i&&(i=!1);t=!U.isNullOrUndefined(t)&&t[this.parent.eventFields.isReadonly];U.EventHandler.add(e,"click",this.eventClick,this),this.parent.isAdaptive||this.parent.activeViewOptions.readonly||t||(U.EventHandler.add(e,"touchend",this.eventTouchClick,this),U.EventHandler.add(e,"dblclick",this.eventDoubleClick,this)),this.parent.activeViewOptions.readonly||t||i||(this.parent.resizeModule&&this.parent.resizeModule.wireResizeEvent(e),this.parent.dragAndDropModule&&this.parent.dragAndDropModule.wireDragEvent(e))},n.prototype.eventTouchClick=function(e){var t=this;this.parent.uiStateValues.isTouchScroll||this.parent.uiStateValues.isTapHold||this.parent.uiStateValues.action?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)))},n.prototype.renderResizeHandler=function(e,t,i){if(this.parent.resizeModule&&this.parent.allowResizing&&!this.parent.activeViewOptions.readonly&&!i)for(var n=0,r=Object.keys(t);n<r.length;n++){var a=r[n],s=U.createElement("div",{className:qi});switch(a){case"isLeft":t.isLeft||(s.appendChild(U.createElement("div",{className:"e-left-right-resize"})),U.addClass([s],this.parent.enableRtl?Bi:Ui),U.prepend([s],e));break;case"isRight":t.isRight||(s.appendChild(U.createElement("div",{className:"e-left-right-resize"})),U.addClass([s],this.parent.enableRtl?Ui:Bi),U.append([s],e));break;case"isTop":t.isTop||(s.appendChild(U.createElement("div",{className:"e-top-bottom-resize"})),U.addClass([s],Wi),U.prepend([s],e));break;case"isBottom":t.isBottom||(s.appendChild(U.createElement("div",{className:"e-top-bottom-resize"})),U.addClass([s],zi),U.append([s],e))}}},n.prototype.eventClick=function(e){var t,i=this,n=e.target;n.classList.contains(Ni)||n.classList.contains(Fi)||n.classList.contains(Sr)||((e.ctrlKey||e.metaKey)&&1===e.which&&this.parent.keyboardInteractionModule?(this.parent.quickPopup.quickPopup.hide(),this.parent.selectedElements=[].slice.call(this.parent.element.querySelectorAll("."+hi)),n=U.closest(e.target,"."+A),this.getSelectedEventElements(n),this.activeEventData(e,!1),n={data:this.parent.activeEventData.event,element:this.parent.activeEventData.element,event:e,requestType:"eventSelect"},this.parent.trigger(X,n),t=U.extend(this.parent.activeEventData,{cancel:!1,originalEvent:e}),this.parent.trigger(te,t)):(this.removeSelectedAppointmentClass(),this.activeEventData(e,!0),n={data:this.parent.activeEventData.event,element:this.parent.activeEventData.element,event:e,requestType:"eventSelect"},this.parent.trigger(X,n),t=U.extend(this.parent.activeEventData,{cancel:!1,originalEvent:e}),this.parent.trigger(te,t,function(e){var t;e.cancel?(i.removeSelectedAppointmentClass(),i.parent.selectedElements=[],i.parent.quickPopup&&i.parent.quickPopup.quickPopupHide()):("Agenda"!==i.parent.currentView&&"MonthAgenda"!==i.parent.currentView||U.addClass([i.parent.activeEventData.element],Di),i.parent.allowInline?(t={data:e.event,element:e.element,type:"Event"},i.parent.notify(ge,t)):i.parent.notify(te,e))})))},n.prototype.eventDoubleClick=function(e){var t=this;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(Or)||this.parent.activeEventData.element.querySelector("."+Sr)||(e=U.extend(this.parent.activeEventData,{cancel:!1,originalEvent:e}),this.parent.trigger(ie,e,function(e){e.cancel||(!U.isNullOrUndefined(t.parent.activeEventData.event)&&U.isNullOrUndefined(t.parent.activeEventData.event[t.parent.eventFields.recurrenceID])?t.parent.eventWindow.openEditor(t.parent.activeEventData.event,"Save"):(t.parent.currentAction="EditOccurrence",t.parent.quickPopup.openRecurrenceAlert()))}))},n.prototype.getEventByGuid=function(t){return this.parent.eventsProcessed.filter(function(e){return e.Guid===t})[0]},n.prototype.getEventById=function(t){var i=this;return this.parent.eventsData.filter(function(e){return e[i.parent.eventFields.id]===t})[0]},n.prototype.generateGuid=function(){return"xyxxxxyx-xxxy-yxxx-xyxx-xxyxxxxyyxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},n.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"},n.prototype.getEventMaxID=function(e){var t,i,n=this;return this.parent.eventsData.length<1&&this.parent.blockData.length<1?1:("string"===(t=this.getEventIDType())&&(i=this.generateGuid()),"number"===t&&(t=this.parent.eventsData.concat(this.parent.blockData).map(function(e){return e[n.parent.eventFields.id]}).reduce(function(e,t){return Math.max(e,t)}),i=(t=U.isNullOrUndefined(e)?t:t+e)+1),i)},n.prototype.activeEventData=function(e,t){var i=this,e=U.closest(e.target,"."+A),n=e.getAttribute("data-guid"),r=(t&&(this.addSelectedAppointments([].slice.call(this.parent.element.querySelectorAll('div[data-guid="'+n+'"]')),!0),e.focus()),this.getEventByGuid(n));r&&r.isSpanned&&(r=this.parent.eventsData.filter(function(e){return e[i.parent.eventFields.id]===r[i.parent.eventFields.id]})[0]),this.parent.activeEventData={event:r,element:e}},n.prototype.generateOccurrence=function(e,t,i){for(var n,r=e[this.parent.eventFields.startTime],a=e[this.parent.eventFields.endTime],s=e[this.parent.eventFields.recurrenceRule],o=a.getTimezoneOffset()-r.getTimezoneOffset(),l=a.getTime()-r.getTime()-6e4*o,a=(t=new Date((t||this.parent.activeView.startDate()).getTime()-l),e[this.parent.eventFields.recurrenceException]),o=("Agenda"!==this.parent.currentView&&i&&(n=Ue(t,this.parent.activeView.endDate())+1),this.parent.timezone||this.parent.tzModule.getLocalTimezoneName()),i=Gr(r,s,a,this.parent.activeViewOptions.firstDayOfWeek,n,t,this.parent.calendarMode,o),p=("Agenda"===this.parent.currentView&&-1===s.indexOf("COUNT")&&-1===s.indexOf("UNTIL")&&(U.isNullOrUndefined(e.generatedDates)?e.generatedDates={start:new Date(i[0]),end:new Date(i[i.length-1])}:(i[0]<e.generatedDates.start.getTime()&&(e.generatedDates.start=new Date(i[0])),i[i.length-1]>e.generatedDates.end.getTime()&&(e.generatedDates.end=new Date(i[i.length-1])))),[]),c=0,h=i;c<h.length;c++){var d=h[c],u=U.extend({},e,null,!0),d=this.getDSTAdjustedTime(d,u);u[this.parent.eventFields.startTime]=new Date(d),u[this.parent.eventFields.endTime]=new Date(new Date(d).setMilliseconds(l)),u[this.parent.eventFields.recurrenceID]=u[this.parent.eventFields.id],delete u[this.parent.eventFields.recurrenceException],delete u[this.parent.eventFields.followingID],u.Guid=this.generateGuid(),p.push(u)}return p},n.prototype.getDSTAdjustedTime=function(e,t){var i,n=e;return this.parent.timezone&&(t[this.parent.eventFields.startTimezone]||t[this.parent.eventFields.endTimezone])&&(i=this.getDSTDiff(t[this.parent.eventFields.startTime],new Date(e),t[this.parent.eventFields.startTimezone]),t=this.getDSTDiff(t[this.parent.eventFields.startTime],new Date(e),this.parent.timezone),n=new Date(e).getTime()-6e4*(i-t)),n},n.prototype.getDSTDiff=function(e,t,i){return this.parent.tzModule.offset(new Date(e),i)-this.parent.tzModule.offset(new Date(t),i)},n.prototype.getParentEvent=function(e,t){var i,n,r;for(void 0===t&&(t=!1);(e=this.getFollowingEvent(e))&&(i=U.extend({},e,null,!0)),e&&t;);return t&&i&&(r=(n=this.getEventCollections(i)).follow.slice(-1)[0],r=0<n.occurrence.length&&!i[this.parent.eventFields.recurrenceException]?n.occurrence.slice(-1)[0]:r)&&(i[this.parent.eventFields.recurrenceRule]=r[this.parent.eventFields.recurrenceRule]),i},n.prototype.getEventCollections=function(e,t){for(var i=[],n=[],r=e;(r=this.getFollowingEvent(r,!0))&&i.push(r),n=n.concat(this.getOccurrenceEvent(r||e)),r;);var a;return t?(a=this.parent.eventFields,{follow:i.filter(function(e){return e[a.startTime]>=t[a.startTime]}),occurrence:n.filter(function(e){return e[a.startTime]>=t[a.startTime]})}):{follow:i,occurrence:n}},n.prototype.getFollowingEvent=function(e,t){var i=this.parent.eventFields,n=t?e[i.id]:e[i.recurrenceID]||e[i.followingID];return this.parent.eventsData.filter(function(e){return e[t?i.followingID:i.id]===n}).shift()},n.prototype.isFollowingEvent=function(e,t){e=e[this.parent.eventFields.startTime],t=t[this.parent.eventFields.startTime];return e.getHours()===t.getHours()&&e.getMinutes()===t.getMinutes()&&e.getSeconds()===t.getSeconds()},n.prototype.getOccurrenceEvent=function(t,e,i){void 0===i&&(i=!1);var n=(e=void 0===e?!1:e)?"Guid":i?this.parent.eventFields.followingID:this.parent.eventFields.recurrenceID,r=e?"Guid":this.parent.eventFields.id;return(e?this.parent.eventsProcessed:this.parent.eventsData).filter(function(e){return e[""+n]===t[""+r]})},n.prototype.getOccurrencesByID=function(t){for(var i=this.parent.eventFields,e=[],n=0,r=this.parent.eventsData.filter(function(e){return e[i.id]===t});n<r.length;n++){var a=r[n];U.isNullOrUndefined(a[i.recurrenceRule])||(e=e.concat(this.generateOccurrence(a)))}return e},n.prototype.getOccurrencesByRange=function(t,i){for(var n=this.parent.eventFields,e=[],r=0,a=this.parent.eventsData;r<a.length;r++){var s=a[r];U.isNullOrUndefined(s[n.recurrenceRule])||(e=e.concat(this.generateOccurrence(s)))}return e.filter(function(e){return e[n.startTime]>=t&&e[n.endTime]<=i&&!U.isNullOrUndefined(e[n.recurrenceID])})},n.prototype.getDeletedOccurrences=function(a){var s=this.parent.eventFields,o=[],l="string"==typeof a||"number"==typeof a?this.parent.eventsData.filter(function(e){return e[s.id]===a})[0]:U.extend({},a,null,!0);if(l[s.recurrenceException])for(var p=l[s.recurrenceException].split(","),c=this,e=0,t=p.length;e<t;e++)!function(t){var e,i,n,r;0===c.parent.eventsData.filter(function(e){return e[s.recurrenceID]===l[s.id]&&e[s.recurrenceException]===p[parseInt(t.toString(),10)]}).length&&(i=Xr(p[parseInt(t.toString(),10)]),(e=U.extend({},a,null,!0))[s.recurrenceID]=l[s.id],delete e[s.followingID],e[s.recurrenceException]=p[parseInt(t.toString(),10)],i=new Date(i.getTime()),n=l[s.endTime].getTime()-l[s.startTime].getTime(),(r=new Date(i.getTime())).setMilliseconds(n),e[s.startTime]=new Date(i.getTime()),e[s.endTime]=new Date(r.getTime()),o.push(e))}(e);return o},n.prototype.applyResourceColor=function(e,t,i,n,r){this.parent.resourceBase&&(t=this.parent.resourceBase.getResourceColor(t,n))&&(e.style[i]=U.isNullOrUndefined(r)?t:(n=r,e=(e=t).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)+", "+n+")"))},n.prototype.createBlockAppointmentElement=function(e,t,i){var n,r=e[this.parent.eventFields.subject]||this.parent.eventSettings.fields.subject.default,a=U.createElement("div",{className:pi,attrs:{"data-id":"Appointment_"+e[this.parent.eventFields.id],"aria-disabled":"true"}});return i=U.isNullOrUndefined(this.parent.activeViewOptions.eventTemplate)?(n=U.createElement("div",{className:Ln}),this.parent.sanitize(r,n),[n]):(r=this.parent.element.id+"_"+this.parent.activeViewOptions.eventTemplateName+"eventTemplate",n=i&&-1===this.parent.currentView.indexOf("Year")?this.parent.getEventTemplateName(t):"eventTemplate",this.parent.getAppointmentTemplate()(e,this.parent,n,r,!1,void 0,void 0,this.parent.root)),U.append(i,a),this.setWrapperAttributes(a,t),a},n.prototype.setWrapperAttributes=function(e,t){U.isNullOrUndefined(this.cssClass)||U.addClass([e],this.cssClass),0<this.parent.activeViewOptions.group.resources.length&&e.setAttribute("data-group-index",t.toString())},n.prototype.getReadonlyAttribute=function(e){return(e[this.parent.eventFields.isReadonly]||this.parent.readonly).toString()},n.prototype.isBlockRange=function(e){for(var e=e instanceof Array?e:[e],t=!1,i=this.parent.eventFields,n=0,r=e;n<r.length;n++){var a=r[n],s=[];U.isNullOrUndefined(a[i.recurrenceRule])||!U.isNullOrUndefined(a[i.recurrenceID])&&a[i.id]!==a[i.recurrenceID]?s.push(a):s=this.generateOccurrence(a);for(var o=0,l=s;o<l.length;o++){var p=l[o];if(0<this.filterBlockEvents(p).length){t=!0;break}}}return this.parent.uiStateValues.isBlock=t},n.prototype.getFilterEventsList=function(e,t){return new H.DataManager(e).executeLocal((new H.Query).where(t))},n.prototype.getSeriesEvents=function(e,t){for(var i,n,r=this.parent.eventFields,a=(t=U.isNullOrUndefined(t)?e[r.startTime]:t,[]),s=e[r.id],o=e[r.followingID],l="EditSeries"===this.parent.currentAction?"greaterthan":"greaterthanorequal";n=new H.Predicate(r.followingID,"equal",s).and(new H.Predicate(r.startTime,l,t)),i=(n=this.getFilterEventsList(this.parent.eventsData,n)).slice(-1)[0],o=U.isNullOrUndefined(i)||i[r.id]===o?null:(a.push(i),s=i[r.id],i[r.followingID]),1===n.length&&!U.isNullOrUndefined(i[r.followingID]););return a},n.prototype.getEditedOccurrences=function(e,t){for(var i=this.parent.eventFields,n=[],r=0,a=e;r<a.length;r++){var s=a[r],s=new H.Predicate(i.recurrenceID,"equal",s[i.id]).or(new H.Predicate(i.recurrenceID,"equal",s[i.followingID]).and(new H.Predicate(i.recurrenceID,"notequal",void 0)).and(new H.Predicate(i.recurrenceID,"notequal",null)));"EditFollowingEvents"!==this.parent.currentAction&&"DeleteFollowingEvents"!==this.parent.currentAction||(s=s.and(new H.Predicate(i.startTime,"greaterthanorequal",t))),s=this.getFilterEventsList(this.parent.eventsData,s),n=n.concat(s)}return n},n.prototype.getRenderedDates=function(t){var e,i=0,n=t.length,r=U.isNullOrUndefined(this.parent.maxDate)?new Date(2099,11,31):this.parent.maxDate,a=U.isNullOrUndefined(this.parent.minDate)?new Date(1900,0,1):this.parent.minDate;if(t[0]<a&&t[t.length-1]>r){for(var s=0;s<t.length;s++)W(t[parseInt(s.toString(),10)]).getTime()===W(new Date(a)).getTime()&&(i=s),W(t[parseInt(s.toString(),10)]).getTime()===W(new Date(r)).getTime()&&(n=s);e=t.filter(function(e){return e>=t[parseInt(i.toString(),10)]&&e<=t[parseInt(n.toString(),10)]})}return e},n.prototype.isValidEvent=function(e,t,i,n){var r=i.getTime()>n.startHour.getTime()&&t.getTime()<n.endHour.getTime(),e=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||e},n.prototype.allDayExpandScroll=function(e){var t=0;[].slice.call(this.parent.element.querySelectorAll("."+Gi)).forEach(function(e){[].slice.call(e.children).forEach(function(e){e.style.top=t+"px"}),t+=e.offsetHeight}),t=e.offsetHeight-t,this.parent.element.querySelector("."+v).style.height=t/12+"em",this.parent.uiStateValues.expand?U.addClass([e],Vr):U.removeClass([e],Vr)},n.prototype.updateEventMinimumDuration=function(e,t,i){var n;return t.getTime()<i.getTime()&&(it(i)-it(t))/xe<this.parent.eventSettings.minimumEventDuration&&((n=new Date(t)).setMinutes(n.getMinutes()+this.parent.eventSettings.minimumEventDuration),(i=n).getTime()>e.endHour.getTime())&&((n=new Date(e.endHour.getTime())).setMinutes(n.getMinutes()-this.parent.eventSettings.minimumEventDuration),t=n,i=e.endHour),{startDate:t,endDate:i}},n.prototype.createEventWrapper=function(e,t){void 0===e&&(e=""),void 0===t&&(t=0);for(var i=U.createElement("tr"),n=this.parent.activeView.colLevels.slice(-1)[0],r=this.parent.isReact&&this.parent.activeViewOptions.eventTemplate?" "+Jt:"",a=0,s=n.length;a<s;a++){var o=n[parseInt(a.toString(),10)],l=U.createElement("td",{className:"allDay"===e?Xi+r:"timeIndicator"===e?Zt:$t+r,attrs:{"data-date":o.date.getTime().toString()}});U.isNullOrUndefined(o.groupIndex)||l.setAttribute("data-group-index",o.groupIndex.toString()),""===e&&(o=U.createElement("div",{id:x+"-"+t.toString(),className:x}),l.appendChild(o)),i.appendChild(l),t+=1}return i},n.prototype.getPageCoordinates=function(e){var t;return U.isNullOrUndefined(e)?e:(t=e.event)&&t.changedTouches?t.changedTouches[0]:e.changedTouches?e.changedTouches[0]:t||e},n.prototype.renderSpannedIcon=function(e,t){var i,n=U.createElement("div",{className:Mi+" "+dt});t.isLeft&&(i=n.cloneNode(),U.addClass([i],ki),U.prepend([i],e)),t.isRight&&(i=n.cloneNode(),U.addClass([i],Ri),U.append([i],e)),t.isTop&&(i=n.cloneNode(),U.addClass([i],"e-up-icon"),U.prepend([i],e)),t.isBottom&&(i=n.cloneNode(),U.addClass([i],"e-down-icon"),U.append([i],e))},n.prototype.addCellHeight=function(e,t,i,n,r,a){if(void 0===a&&(a=!0),this.parent.activeViewOptions.maxEventsPerRow&&!this.parent.rowAutoHeight){for(var s=[].slice.call(this.parent.element.querySelectorAll(e)),o=this.parent.showWeekNumber?[].slice.call(this.parent.element.querySelectorAll("."+ri+" tbody tr")):[],l=0,p=s;l<p.length;l++){var c=p[l],h=this.parent.activeViewOptions.maxEventsPerRow*(t+("Month"===this.parent.currentView?i:2))+n+r;0<o.length&&U.setStyleAttribute(o[s.indexOf(c)].firstElementChild,{height:h+"px"}),U.setStyleAttribute(c.firstElementChild,{height:h+"px"})}this.parent.enablePersistence||this.parent.activeViewOptions.allowVirtualScrolling||!a||this.parent.notify(De,{})}},n.prototype.unWireEvents=function(){for(var e=0,t=[].slice.call(this.parent.element.querySelectorAll("."+A));e<t.length;e++){var i=t[e];U.EventHandler.clearEvents(i)}},n.prototype.destroy=function(){this.unWireEvents(),this.parent=null};var ka=n;function n(e){this.slots=[],this.isDoubleTapped=!1,this.parent=e}Ra=function(e,t){return(Ra=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Ra(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(r,Ha=ka),r.prototype.renderAppointments=function(){var t=this;if(!U.isNullOrUndefined(this.parent)){this.parent.dragAndDropModule&&this.parent.dragAndDropModule.setDragArea(),this.isResourceEventTemplate=this.parent.isSpecificResourceEvents();for(var e=[].slice.call(this.parent.element.querySelectorAll("."+pi+",."+A+",."+Zi)),i=!(!this.parent.crudModule||!this.parent.crudModule.crudObj.isCrudAction),n=function(e){t.parent.isReact&&!U.isNullOrUndefined(t.parent.activeViewOptions.eventTemplate)&&(e=U.closest(e,"."+$t+",."+Xi))&&!e.classList.contains(Jt)&&U.addClass([e],Jt)},r=0,a=e;r<a.length;r++){var s=a[r];if(!i||s.classList.contains(Qi)||s.classList.contains(Zi))n(s),U.remove(s);else for(var o=parseInt(s.getAttribute("data-group-index"),10),l=0,p=this.parent.crudModule.crudObj.sourceEvent.length;l<p;l++)o!==this.parent.crudModule.crudObj.sourceEvent[parseInt(l.toString(),10)].groupIndex&&o!==this.parent.crudModule.crudObj.targetEvent[parseInt(l.toString(),10)].groupIndex||(n(s),U.remove(s))}this.element.querySelector("."+O)&&(this.parent.virtualScrollModule&&this.parent.virtualScrollModule.updateFocusedWorkCell(),this.allDayElement=[].slice.call(this.element.querySelectorAll("."+v)),this.setAllDayRowHeight(0),0===this.parent.eventsProcessed.length&&0===this.parent.blockProcessed.length||(e=this.element.querySelector("."+Ji),U.EventHandler.remove(e,"click",this.rowExpandCollapse),U.EventHandler.add(e,"click",this.rowExpandCollapse,this),this.renderedEvents=[],this.renderedAllDayEvents=[],this.initializeValues(),this.processBlockEvents(),this.renderEvents("normalEvents"),0<this.allDayEvents.length&&(this.allDayEvents=this.allDayEvents.filter(function(e,t,i){return t===i.map(function(e){return e.Guid}).indexOf(e.Guid)}),U.removeClass(this.allDayElement,ar),this.slots.push(this.parent.activeView.renderDates.map(function(e){return+e})),this.renderEvents("allDayEvents"),this.animation.animate(this.allDayElement[0])),this.parent.notify(De,{}),U.addClass(this.allDayElement,ar),i&&(this.parent.crudModule.crudObj.isCrudAction=!1),this.parent.renderTemplates(function(){var e;t.parent.isReact&&t.parent.activeViewOptions.eventTemplate&&(e=[].slice.call(t.parent.element.querySelectorAll("."+Jt)),U.removeClass(e,Jt))})))}},r.prototype.initializeValues=function(){if(this.resources=0<this.parent.activeViewOptions.group.resources.length?this.parent.uiStateValues.isGroupAdaptive?[this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]]:this.parent.resourceBase.lastResourceLevel:[],0<this.resources.length&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.virtualScrollModule&&(this.resources=this.parent.resourceBase.renderedResources),this.cellHeight=parseFloat(at(this.parent.element.querySelector(".e-content-wrap tbody tr")).toFixed(2)),this.dateRender[0]=this.parent.activeView.renderDates,0<this.parent.activeViewOptions.group.resources.length)for(var e=0,t=this.resources.length;e<t;e++)this.dateRender[parseInt(e.toString(),10)]=this.resources[parseInt(e.toString(),10)].renderDates},r.prototype.getHeight=function(e,t){t=(it(t)-it(e))/xe*(this.cellHeight*this.slotCount)/this.interval;return t<=0?this.cellHeight:t},r.prototype.appendEvent=function(e,t,i,n){var r=this.element.querySelector("."+x+'[id="'+x+"-"+i+'"]'),i=(this.parent.enableRtl?U.setStyleAttribute(t,{right:n}):U.setStyleAttribute(t,{left:n}),t.classList.contains(pi)?"blockEvent":"event"),n={data:U.extend({},e,null,!0),element:t,cancel:!1,type:i};this.parent.trigger(ne,n,function(e){e.cancel||r.appendChild(t)})},r.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=z(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}},r.prototype.renderBlockEvents=function(e,t,i,n){var r,a=this.isSpannedEvent(e,t,i),s=a[this.fields.startTime],o=a[this.fields.endTime],l=ze(W(new Date(this.dateRender[parseInt(i.toString(),10)][parseInt(t.toString(),10)].getTime())),this.startHour,this.endHour);s<=o&&this.isValidEvent(e,s,o,l)&&this.isWorkDayAvailable(i,s)&&(r=l=void 0,l=a[this.fields.isAllDay]?(a=this.parent.element.querySelector("."+I+" table"),r=U.formatUnit(a.offsetHeight),U.formatUnit(0)):(r=U.formatUnit(this.getHeight(s,o)),U.formatUnit(this.getTopValue(s,t,i))),a=this.createBlockAppointmentElement(e,i,this.isResourceEventTemplate),U.setStyleAttribute(a,{width:"100%",height:r,top:l}),o=this.getDayIndex(t,i,n),this.appendEvent(e,a,o,"0px"))},r.prototype.renderEvents=function(u){U.removeClass(this.allDayElement,ar);for(var g,m="allDayEvents"===u?this.sortByDateTime(this.allDayEvents):void 0,e=this.getResourceList(),v=this.getStartCount(),f="allDayEvents"===u?Ae(this.element.querySelector("."+Xi),A):0,y="allDayEvents"===u&&0<this.allDayElement.length?this.allDayElement[0].offsetTop:0,T=this,t=0,i=e;t<i.length;t++)!function(t){g=!0,T.parent.crudModule&&T.parent.crudModule.crudObj.isCrudAction&&"allDayEvents"!==u&&!T.parent.uiStateValues.isGroupAdaptive&&0===T.parent.crudModule.crudObj.sourceEvent.filter(function(e){return e.groupIndex===t}).length&&0===T.parent.crudModule.crudObj.targetEvent.filter(function(e){return e.groupIndex===t}).length&&(g=!1),T.slots=[];var e=T.dateRender[parseInt(t.toString(),10)],i=T.getRenderedDates(e)||e;T.slots.push(e.map(function(e){return+e}));for(var n=0,r=e.length;n<r&&e[parseInt(n.toString(),10)]<=i[i.length-1];n++){T.renderedEvents=[];var a=new Date(e[parseInt(n.toString(),10)].getTime()),s=z(e[parseInt(n.toString(),10)],1),a=T.filterEvents(a,s,m,T.resources[parseInt(t.toString(),10)]);if(g)for(var o=0,l=a;o<l.length;o++){var p=l[o];if(T.parent.resourceBase&&T.setValues(p,t),"allDayEvents"===u)T.renderAllDayEvents(p,n,t,v,!1,y,f);else if(T.isAllDayAppointment(p))T.allDayEvents.push(U.extend({},p,null,!0));else{if(T.parent.eventSettings.enableMaxHeight&&0<T.getOverlapIndex(p,n,!1,t))continue;T.renderNormalEvents(p,n,t,v)}T.cssClass=null,T.groupOrder=null}else for(var c=0,h=a;c<h.length;c++){var d=h[c];T.isAllDayAppointment(d)&&T.allDayEvents.push(U.extend({},d,null,!0))}v+=1}}(i[t])},r.prototype.getStartCount=function(){return this.parent.virtualScrollModule&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.timeScale.enable?parseInt(this.element.querySelector("."+x).getAttribute("id").split("-").slice(-1)[0],10):0},r.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)return i=this.parent.resourceBase.lastResourceLevel[0].renderDates.indexOf(this.dateRender[parseInt(t.toString(),10)][parseInt(e.toString(),10)]),this.resources.length*i+t;for(var r=0,a=this.parent.activeView.colLevels[0],s=this.dateRender[parseInt(t.toString(),10)][parseInt(e.toString(),10)].getTime(),o=[],l=0;l<a.length&&(o=this.parent.resourceBase.resourceDateTree[parseInt(l.toString(),10)],s!==a[parseInt(l.toString(),10)].date.getTime());l++)r+=a[parseInt(l.toString(),10)].colSpan;i=o.findIndex(function(e){return e.groupOrder.toString()===n.resources[parseInt(t.toString(),10)].groupOrder.toString()});return i<0?r:r+i},r.prototype.setValues=function(e,t){0<this.parent.activeViewOptions.group.resources.length?(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)},r.prototype.getResourceList=function(){return Array.apply(null,{length:0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?this.resources.length:1}).map(function(e,t){return t})},r.prototype.createAppointmentElement=function(e,t,i,n){var r,a,s=this.parent.eventFields,o=e[s.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),l=U.createElement("div",{className:A,attrs:{"data-id":"Appointment_"+e[s.id],"data-guid":e.Guid,role:"button",tabindex:"0","aria-disabled":this.parent.eventBase.getReadonlyAttribute(e),"aria-label":this.parent.getAnnouncementString(e)}}),p=(e[this.fields.isReadonly]&&U.addClass([l],"e-read-only"),U.createElement("div",{className:di})),c=(l.appendChild(p),0<this.parent.activeViewOptions.group.resources.length&&(c=this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:n,l.setAttribute("data-group-index",c.toString())),i);return U.isNullOrUndefined(this.parent.activeViewOptions.eventTemplate)?(i=U.createElement("div",{className:Ln}),this.parent.sanitize(o,i),t?e[s.isAllDay]?r=[i]:(r=[],o=U.createElement("div",{className:mi+(this.parent.isAdaptive?" "+d:""),innerHTML:this.parent.getTimeString(e[s.startTime])}),a=U.createElement("div",{className:mi+(this.parent.isAdaptive?" "+d:""),innerHTML:this.parent.getTimeString(e[s.endTime])}),U.addClass([i],"e-text-center"),c.isLeft||r.push(o),r.push(i),c.isRight||r.push(a)):(o=this.parent.getTimeString(e[s.startTime])+" - "+this.parent.getTimeString(e[s.endTime]),a=U.createElement("div",{className:mi+(this.parent.isAdaptive?" "+d:""),innerHTML:o}),o=U.createElement("div",{className:Nn}),this.parent.sanitize(e[s.location]||this.parent.eventSettings.fields.location.default||"",o),r=[i,a,o])):(i=this.parent.element.id+"_"+this.parent.activeViewOptions.eventTemplateName+"eventTemplate",a=this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:n,o=this.isResourceEventTemplate?this.parent.getEventTemplateName(a):"eventTemplate",r=this.parent.getAppointmentTemplate()(e,this.parent,o,i,!1,void 0,void 0,this.parent.root)),U.append(r,p),this.parent.isAdaptive||U.isNullOrUndefined(e[s.recurrenceRule])&&U.isNullOrUndefined(e[s.recurrenceID])||(n=e[s.id]===e[s.recurrenceID]?Yi:_i,a=U.createElement("div",{className:dt+" "+n}),(t?p:l).appendChild(a)),this.parent.eventBase.renderSpannedIcon(t?p:l,c),U.isNullOrUndefined(this.cssClass)||U.addClass([l],this.cssClass),this.applyResourceColor(l,e,"backgroundColor",this.groupOrder),this.renderResizeHandler(l,c,e[this.fields.isReadonly]),l},r.prototype.createMoreIndicator=function(e,t,i){var i=i+t,t=e[parseInt(i.toString(),10)];t.childElementCount<=0?(e=U.createElement("div",{className:Zi,id:Zi+"-"+i.toString()}),i=U.createElement("div",{className:tn,attrs:{tabindex:"0","data-index":i.toString(),"data-count":"1"},innerHTML:"+1&nbsp;"+(this.parent.isAdaptive?"":this.parent.localeObj.getConstant("more"))}),e.appendChild(i),t.appendChild(e),U.EventHandler.add(i,"click",this.rowExpandCollapse,this)):(e=t.querySelector("."+tn),i=parseInt(e.getAttribute("data-count"),10)+1,e.setAttribute("data-count",i.toString()),e.innerHTML="+"+this.parent.globalize.formatNumber(i)+"&nbsp;"+(this.parent.isAdaptive?"":this.parent.localeObj.getConstant("more")))},r.prototype.isSpannedEvent=function(e,t,i){var n=W(this.dateRender[parseInt(i.toString(),10)][parseInt(t.toString(),10)]),i=this.getRenderedDates(this.dateRender[parseInt(i.toString(),10)])||[n],i=(0===i.filter(function(e){return e.getDay()===t}).length&&(n=W(i[0])),this.parent.eventFields),n=ze(n,this.startHour,this.endHour),r=U.extend({},e,null,!0),e=(r.isSpanned={isBottom:!1,isTop:!1},e[i.startTime].getTime()<n.startHour.getTime()&&(r[i.startTime]=n.startHour,r.isSpanned.isTop=!0),e[i.endTime].getTime()>n.endHour.getTime()&&(r[i.endTime]=n.endHour,r.isSpanned.isBottom=!0),this.updateEventMinimumDuration(n,r[i.startTime],r[i.endTime]));return r[i.startTime]=e.startDate,r[i.endTime]=e.endDate,r},r.prototype.isWorkDayAvailable=function(e,t){return!(this.parent.activeViewOptions.group.hideNonWorkingDays&&0<this.resources.length)||(e=this.resources[parseInt(e.toString(),10)].resourceData[this.resources[parseInt(e.toString(),10)].resource.workDaysField]||this.parent.activeViewOptions.workDays)&&0<=e.indexOf(t.getDay())},r.prototype.renderAllDayEvents=function(n,t,e,i,r,a,s){var o,l,p,c,h,d,u=this,g=this.getRenderedDates(this.dateRender[parseInt(e.toString(),10)])||this.dateRender[parseInt(e.toString(),10)],m=(this.parent.activeViewOptions.group.byDate&&(this.slots[0]=[this.dateRender[parseInt(e.toString(),10)][parseInt(t.toString(),10)].getTime()],g=[this.dateRender[parseInt(e.toString(),10)][parseInt(t.toString(),10)]]),this.splitEvent(n,g)[0]),v=new Date(m[this.parent.eventFields.startTime].getTime()),f=new Date(m[this.parent.eventFields.endTime].getTime()),y=0,T=1,w=g[0].getTime()<=v.getTime()&&z(g.slice(-1)[0],1).getTime()>=v.getTime();v<=f&&w&&this.isWorkDayAvailable(e,v)&&(f=[],0===(f=this.renderedAllDayEvents[parseInt(e.toString(),10)]&&(f=this.renderedAllDayEvents[parseInt(e.toString(),10)].filter(function(e){return e.Guid===n.Guid}),this.parent.activeViewOptions.group.byDate)?f.filter(function(e){return e[u.parent.eventFields.startTime]>=g[parseInt(t.toString(),10)]&&e[u.parent.eventFields.endTime]<=z(new Date(+g[parseInt(t.toString(),10)]),1)}):f).length)&&(o=m.data.count,l=this.getOverlapIndex(m,t,!0,e),m.Index=l,this.allDayLevel=this.allDayLevel<l?l:this.allDayLevel,w=m.data.isRight?0:"Day"===this.parent.currentView?4:7,0<=o&&(y=100*o-w),U.isNullOrUndefined(this.renderedAllDayEvents[parseInt(e.toString(),10)])&&(this.renderedAllDayEvents[parseInt(e.toString(),10)]=[]),this.renderedAllDayEvents[parseInt(e.toString(),10)].push(U.extend({},m,null,!0)),p=[].slice.call(this.element.querySelector("."+vt).children),c=this.getDayIndex(t,e,i),h=this.element.querySelector("."+Xi+":nth-child("+(c+1)+")"),d=r?this.parent.inlineModule.createInlineAppointmentElement(n):this.createAppointmentElement(n,!0,m.data,e),U.addClass([d],Qi),v=U.extend({},m.data,null,!0),n.data=v,f={data:n,element:d,cancel:!1},this.parent.trigger(ne,f,function(e){if(!e.cancel){if(h.appendChild(d),T+=(0===l?a:a+l*s)+1,U.setStyleAttribute(d,{width:y+"%",top:U.formatUnit(T)}),1<l){u.moreEvents.push(d);for(var t=0,i=o;t<i;t++)u.createMoreIndicator(p,t,c)}u.allDayElement[0].setAttribute("data-count",u.allDayLevel.toString());e=4+(!u.parent.uiStateValues.expand&&2<u.allDayLevel?3*s:(u.allDayLevel+1)*s);u.setAllDayRowHeight(e),u.addOrRemoveClass(),u.wireAppointmentEvents(d,n)}}))},r.prototype.renderNormalEvents=function(e,t,i,n,r){var a=this.isSpannedEvent(e,t,i),s=a[this.fields.startTime],o=a[this.fields.endTime],l=0,p=ze(W(new Date(this.dateRender[parseInt(i.toString(),10)][parseInt(t.toString(),10)].getTime())),this.startHour,this.endHour),c=this.isValidEvent(e,s,o,p);s.getTime()<this.parent.minDate.getTime()||o.getTime()>this.parent.maxDate.getTime()||s<=o&&c&&this.isWorkDayAvailable(i,s)&&(c=this.getHeight(s,o),s.getTime()>=p.startHour.getTime()&&(l=this.getTopValue(s,t,i)),o=this.getOverlapIndex(a,t,!1,i),a.Index=o,this.overlapList.push(a),1<this.overlapList.length?(U.isNullOrUndefined(this.overlapEvents[parseInt(o.toString(),10)])&&(this.overlapEvents[parseInt(o.toString(),10)]=[]),this.overlapEvents[parseInt(o.toString(),10)].push(a)):(this.overlapEvents=[],this.overlapEvents.push([a])),p={index:o,left:"0%",width:this.getEventWidth(),day:n,dayIndex:t,record:a,resource:i},(s=this.adjustOverlapElements(p)).appWidth,U.isNullOrUndefined(this.renderedEvents[parseInt(i.toString(),10)])&&(this.renderedEvents[parseInt(i.toString(),10)]=[]),o=void this.renderedEvents[parseInt(i.toString(),10)].push(U.extend({},a,null,!0)),o=r?this.parent.inlineModule.createInlineAppointmentElement(e):this.createAppointmentElement(e,!1,a.isSpanned,i),U.setStyleAttribute(o,{width:this.parent.eventSettings.enableMaxHeight?"100%":s.appWidth,height:c+"px",top:l+"px"}),p=c-40-15*o.querySelectorAll("."+Mi).length,r=o.querySelector("."+Ln),!this.parent.isAdaptive&&r&&(r.style.maxHeight=U.formatUnit(p)),l=this.getDayIndex(t,i,n),(c={})[this.fields.startTime]=e[this.fields.startTime],c[this.fields.endTime]=e[this.fields.endTime],a.data=c,this.appendEvent(a,o,l,s.appLeft),this.wireAppointmentEvents(o,e))},r.prototype.getEventWidth=function(){var e=(("Day"===this.parent.currentView?97:94)-this.overlapEvents.length)/this.overlapEvents.length;return(e<0?0:e)+"%"},r.prototype.getEventLeft=function(e,t){e=(parseFloat(e)+1)*t;return(99<e?99:e)+"%"},r.prototype.getTopValue=function(e,t,i){i=W(this.dateRender[parseInt(i.toString(),10)][parseInt(t.toString(),10)]),t=ze(i,this.startHour,this.endHour).startHour,i=(tt(i)&&t.getHours()!==this.startHour.getHours()?this.startHour:t).getHours(),i=60*(e.getHours()-i)+(e.getMinutes()-t.getMinutes());return this.parent.activeViewOptions.timeScale.enable?i*this.cellHeight*this.slotCount/this.interval:0},r.prototype.getOverlapIndex=function(t,e,i,n){var r,a=this,s=this.parent.eventFields,o=[],l=-1;if(this.overlapEvents=[],i)U.isNullOrUndefined(this.renderedAllDayEvents[parseInt(n.toString(),10)])||(r=W(new Date(this.dateRender[parseInt(n.toString(),10)][parseInt(e.toString(),10)].getTime())),o=this.renderedAllDayEvents[parseInt(n.toString(),10)].filter(function(e){return W(e[s.startTime]).getTime()<=r.getTime()&&W(e[s.endTime]).getTime()>=r.getTime()}),0<this.parent.activeViewOptions.group.resources.length&&(o=this.filterEventsByResource(this.resources[parseInt(n.toString(),10)],o)));else{var p=U.isNullOrUndefined(this.renderedEvents[parseInt(n.toString(),10)])?[]:this.renderedEvents[parseInt(n.toString(),10)],c=[],h=t[s.startTime],d=t[s.endTime];this.overlapList=p.filter(function(e){return e[s.endTime]>h&&e[s.startTime]<=d||e[s.startTime]>=d&&e[s.endTime]<=h||e[s.endTime].getTime()===e[s.startTime].getTime()&&e[s.startTime].getTime()===h.getTime()&&e[s.endTime]<d}),0<this.parent.activeViewOptions.group.resources.length&&(this.overlapList=this.filterEventsByResource(this.resources[parseInt(n.toString(),10)],this.overlapList)),this.overlapList.forEach(function(t){var e=p.filter(function(e){return e[s.endTime]>t[s.startTime]&&e[s.startTime]<=t[s.endTime]}),e=(e=0<a.parent.activeViewOptions.group.resources.length?a.filterEventsByResource(a.resources[parseInt(n.toString(),10)],e):e).filter(function(e){return-1===a.overlapList.indexOf(e)});0<e.length&&(c=c.concat(e))});for(var u=0;u<c.length-1;u++)for(var g=u+1;g<c.length;g++)c[parseInt(u.toString(),10)][s.id]===c[parseInt(g.toString(),10)][s.id]&&(c.splice(g,1),g--);this.overlapList=this.overlapList.concat(c);for(var m=0,v=o=this.overlapList;m<v.length;m++){var f=v[m],y=f.Index;U.isNullOrUndefined(this.overlapEvents[parseInt(y.toString(),10)])?this.overlapEvents[parseInt(y.toString(),10)]=[f]:this.overlapEvents[parseInt(y.toString(),10)].push(f)}}return-1===(l=0<(o=i?o:o.filter(function(e){return e[s.startTime]===t[s.startTime]&&e[s.endTime]>t[s.endTime]||e[s.endTime]>t[s.startTime]&&e[s.startTime]<t[s.endTime]||e[s.endTime]===t[s.startTime]&&e[s.startTime]===t[s.endTime]||e[s.startTime].getTime()===t[s.startTime].getTime()&&e[s.endTime].getTime()===t[s.endTime].getTime()||e[s.startTime].getTime()===t[s.startTime].getTime()&&e[s.endTime].getTime()<t[s.endTime].getTime()||e[s.endTime].getTime()>t[s.endTime].getTime()})).length?0<(e=o.map(function(e){return e.Index})).length?this.getSmallestMissingNumber(e):0:l)?0:l},r.prototype.adjustOverlapElements=function(e){for(var t={appWidth:e.width,appLeft:e.left},i=0,n=this.overlapEvents.length;i<n;i++)if(!U.isNullOrUndefined(this.overlapEvents[parseInt(i.toString(),10)]))for(var r=0,a=this.overlapEvents[parseInt(i.toString(),10)].length;r<a;r++){var s,o=this.getDayIndex(e.dayIndex,e.resource,e.day),o=this.element.querySelector("#e-appointment-wrapper-"+o);o&&0<o.childElementCount&&(s=this.overlapEvents[parseInt(i.toString(),10)][parseInt(r.toString(),10)].Guid,0<o.querySelectorAll('div[data-guid="'+s+'"]').length&&s!==e.record.Guid?(o=o.querySelector('div[data-guid="'+s+'"]'),parseFloat(e.width)<=parseFloat(o.style.width)&&(this.parent.enableRtl?o.style.right=this.getEventLeft(e.width,i):o.style.left=this.getEventLeft(e.width,i),o.style.width=parseFloat(e.width)+"%"),t.appWidth=o.style.width):(s=e.width,U.isNullOrUndefined(this.overlapEvents[i-1])&&(s=this.getEventWidth()),t.appWidth=s,t.appLeft=this.getEventLeft(s,e.index)))}return t},r.prototype.setAllDayRowHeight=function(e){var t=this.parent.element.querySelector("."+Tt),i=("auto"!==this.parent.height&&this.parent.enableAllDayScroll||U.addClass([t],xr),this.parent.element.querySelector("."+vt));if(i.style.height="",this.parent.uiStateValues.expand&&"auto"!==this.parent.height&&this.parent.enableAllDayScroll)i.style.height=e/12+"em",this.parent.eventBase.allDayExpandScroll(t);else{for(var n=0,r=this.allDayElement;n<r.length;n++)r[n].style.height=e/12+"em";U.removeClass([t],Vr)}},r.prototype.addOrRemoveClass=function(){var t=this,e=(this.moreEvents.filter(function(e){!t.parent.uiStateValues.expand&&2<t.allDayLevel?(U.addClass([e],Ki),e.setAttribute("tabindex","-1")):(U.removeClass([e],Ki),e.setAttribute("tabindex","0"))}),this.element.querySelector("."+Ji));this.parent.uiStateValues.expand?(U.removeClass([e],$i),U.addClass([e],en)):(U.removeClass([e],en),U.addClass([e],$i)),2<this.allDayLevel?U.removeClass([e],d):U.addClass([e],d),[].slice.call(this.element.querySelectorAll("."+Zi)).forEach(function(e){!t.parent.uiStateValues.expand&&2<t.allDayLevel?U.removeClass([e],d):U.addClass([e],d)})},r.prototype.getEventHeight=function(){var e=U.createElement("div",{className:A,styles:"visibility:hidden"}),t=(this.element.querySelector("."+Xi+":first-child").appendChild(e),e.offsetHeight);return U.remove(e),t},r.prototype.rowExpandCollapse=function(){var e,t=this.element.querySelector("."+Ji);this.parent.uiStateValues.expand=t.classList.contains($i),this.parent.uiStateValues.expand?(t.setAttribute("title",this.parent.localeObj.getConstant("collapseAllDaySection")),t.setAttribute("aria-label",this.parent.localeObj.getConstant("collapseAllDaySection")),e=(this.allDayLevel+1)*this.getEventHeight()+4):(t.setAttribute("title",this.parent.localeObj.getConstant("expandAllDaySection")),t.setAttribute("aria-label",this.parent.localeObj.getConstant("expandAllDaySection")),e=3*this.getEventHeight()+4,this.parent.element.querySelector("."+Tt).scrollTop=0),this.setAllDayRowHeight(e),this.animation.animate(this.allDayElement[0]),this.addOrRemoveClass(),this.animation.animate(t)},r.prototype.animationUiUpdate=function(){this.parent.notify(De,{})},r.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,Ha.prototype.destroy.call(this))};var Ra,Ha,Pa=r;function r(e){e=Ha.call(this,e)||this;return e.dateRender=[],e.renderedEvents=[],e.renderedAllDayEvents=[],e.overlapEvents=[],e.moreEvents=[],e.overlapList=[],e.allDayEvents=[],e.slotCount=e.parent.activeViewOptions.timeScale.slotCount,e.interval=e.parent.activeViewOptions.timeScale.interval,e.allDayLevel=0,e.startHour=e.parent.activeView.getStartHour(),e.endHour=e.parent.activeView.getEndHour(),e.element=e.parent.activeView.getPanel(),e.fields=e.parent.eventFields,e.animation=new U.Animation({progress:e.animationUiUpdate.bind(e)}),e.addEventListener(),e}ja=function(e,t){return(ja=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}ja(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(a,La=ka),a.prototype.removeEventWrapper=function(e){if(0<e.length)for(var t=0,i=e="Month"===this.parent.currentView||!this.parent.activeView.isTimelineView()&&!this.parent.activeViewOptions.timeScale.enable?e:[e[0]];t<i.length;t++){var n=i[t];n.parentElement&&n.parentElement.parentNode&&U.remove(n.parentElement)}},a.prototype.renderAppointments=function(){this.parent.dragAndDropModule&&this.parent.dragAndDropModule.setDragArea(),this.isResourceEventTemplate=this.parent.isSpecificResourceEvents();var e,i,t=this.parent.element.querySelector("."+I),n=(this.parent.rowAutoHeight&&(this.parent.uiStateValues.top=t.scrollTop,this.parent.uiStateValues.left=t.scrollLeft),[].slice.call(this.element.querySelectorAll("."+x)));if(this.parent.crudModule&&this.parent.crudModule.crudObj.isCrudAction)for(var r=0,a=this.parent.crudModule.crudObj.sourceEvent.length;r<a;r++){var s=[].slice.call(this.element.querySelectorAll('.e-appointment-wrapper [data-group-index="'+this.parent.crudModule.crudObj.sourceEvent[parseInt(r.toString(),10)].groupIndex+'"]'));this.removeEventWrapper(s),this.parent.crudModule.crudObj.targetEvent[parseInt(r.toString(),10)]&&this.parent.crudModule.crudObj.sourceEvent[parseInt(r.toString(),10)].groupIndex!==this.parent.crudModule.crudObj.targetEvent[parseInt(r.toString(),10)].groupIndex&&(s=[].slice.call(this.element.querySelectorAll('.e-appointment-wrapper [data-group-index="'+this.parent.crudModule.crudObj.targetEvent[parseInt(r.toString(),10)].groupIndex+'"]')),this.removeEventWrapper(s))}else for(var o=0,l=n;o<l.length;o++){var p=l[o];U.remove(p)}this.removeHeightProperty(S),this.element.querySelector("."+O)&&("Month"===this.parent.currentView&&(n=U.createElement("div",{className:x}),(e=this.parent.element.querySelector("."+O)).appendChild(n),this.monthHeaderHeight=n.offsetTop-e.offsetTop,e.removeChild(n)),this.eventHeight=Ae(this.element,A),this.addCellHeight(".e-content-table tbody tr",this.eventHeight,"Month"===this.parent.currentView?0:2,this.monthHeaderHeight,this.moreIndicatorHeight),e=t.scrollTop,this.parent.rowAutoHeight&&this.parent.virtualScrollModule&&!this.parent.virtualScrollModule.isHorizontalScroll&&!U.isNullOrUndefined(this.parent.currentAction)&&(t.scrollTop=t.scrollTop-1),0<this.parent.activeViewOptions.group.resources.length?(this.renderResourceEvents(),this.parent.virtualScrollModule&&this.parent.virtualScrollModule.updateFocusedWorkCell()):this.renderEventsHandler(this.parent.activeView.renderDates,this.parent.activeViewOptions.workDays),this.parent.rowAutoHeight&&(this.updateBlockElements(),n={cssProperties:this.parent.getCssProperties(),module:this.parent.getModuleName(),isPreventScrollUpdate:!0,scrollPosition:{left:this.parent.uiStateValues.left,top:this.parent.uiStateValues.top}},this.parent.virtualScrollModule&&!this.parent.virtualScrollModule.isHorizontalScroll&&(this.parent.currentAction?(t.scrollTop=e,this.parent.currentAction=null):this.parent.virtualScrollModule.updateVirtualScrollHeight()),this.parent.enablePersistence||this.parent.notify(De,{}),this.parent.notify(Se,n),"Month"===this.parent.currentView)&&this.parent.showWeekNumber&&(i=[].slice.call(this.parent.element.querySelectorAll(".e-content-wrap table tr td:first-child")),[].slice.call(this.parent.element.querySelectorAll("."+ai)).forEach(function(e,t){t=i[parseInt(t.toString(),10)].offsetHeight;U.setStyleAttribute(e,{height:t+"px"})}),this.parent.element.querySelector("."+ri).scrollTop=this.parent.element.querySelector("."+I).scrollTop),this.parent.renderTemplates())},a.prototype.renderEventsHandler=function(e,t,i){this.renderedEvents=[];for(var n,r,a,s=0,o=(i?(s=i.groupIndex,this.cssClass=i.cssClass,this.groupOrder=i.groupOrder,n=this.parent.eventBase.filterEventsByResource(i,this.parent.eventsProcessed),r=this.parent.eventBase.filterEventsByResource(i,this.parent.blockProcessed),this.workCells=[].slice.call(this.element.querySelectorAll("."+O+'[data-group-index="'+s+'"]'))):(n=this.parent.eventsProcessed,r=this.parent.blockProcessed,this.workCells=[].slice.call(this.element.querySelectorAll("."+O))),this.sortByDateTime(n),this.sortByDateTime(r),"Month"===this.parent.currentView&&this.parent.rowAutoHeight&&0===this.parent.activeViewOptions.group.resources.length&&(o=[].slice.call(this.parent.element.querySelectorAll(".e-content-wrap table tr td:first-child")),a=this.parent.element.querySelector("."+S).clientHeight/o.length,o.forEach(function(e){U.setStyleAttribute(e,{height:a+"px"})})),this.workCells[this.parent.activeView.isTimelineView()?0:this.workCells.length-1]),l=(this.cellWidth=V(o),this.cellHeight=at(o),this.dateRender=e,this.getRenderedDates(e)),p=(this.getSlotDates(t||this.parent.activeViewOptions.workDays),this.processBlockEvents(r,s,i),[]),c=0,h=n;c<h.length;c++){var d=h[c];this.parent.resourceBase&&!i&&(this.cssClass=this.parent.resourceBase.getCssClass(d)),p=p.concat(this.splitEvent(d,l||this.dateRender))}for(var u=0;u<this.slots.length;u++){this.renderedEvents=[];for(var g=this.slots[parseInt(u.toString(),10)],m=z(new Date(g[g.length-1]),1),v=0,f=this.filterEvents(new Date(g[0]),m,p);v<f.length;v++){var y=f[v];if(this.maxHeight){var T="Month"===this.parent.currentView?y[this.fields.startTime]:this.getStartTime(y,y.data);if(0<this.getIndex(T))continue}this.updateIndicatorIcon(y),this.renderEvents(y,s,n)}}this.cssClass=null,this.groupOrder=null},a.prototype.processBlockEvents=function(e,t,i){for(var n=0,r=e;n<r.length;n++){var a,s,o,l=r[n],p=(this.parent.resourceBase&&!i&&(this.cssClass=this.parent.resourceBase.getCssClass(l)),[]);"day"!==this.renderType||l[this.fields.isAllDay]?p.push(l):(a=U.extend({},l,null,!0),s=this.isSameDate(a[this.fields.startTime],a[this.fields.endTime]),!(a.isBlockIcon=s)&&0<Fe(a[this.fields.startTime])&&((o=U.extend({},l,null,!0))[this.fields.endTime]=z(W(new Date(l[this.fields.startTime]+"")),1),o.isBlockIcon=!0,a[this.fields.startTime]=o[this.fields.endTime],p.push(o)),!(s=this.isSameDate(a[this.fields.startTime],a[this.fields.endTime]))&&0<Fe(a[this.fields.endTime])&&((o=U.extend({},l,null,!0))[this.fields.startTime]=W(new Date(l[this.fields.endTime]+"")),o.isBlockIcon=!0,p.push(o),a[this.fields.endTime]=o[this.fields.startTime]),p.push(a));for(var c=0,h=p;c<h.length;c++)for(var d=h[c],u=0,g=this.splitEvent(d,this.dateRender);u<g.length;u++){var m=g[u];this.renderBlockEvents(m,t,!!d.isBlockIcon)}}},a.prototype.isSameDate=function(e,t){return new Date(+e).setHours(0,0,0,0)===new Date(+t).setHours(0,0,0,0)},a.prototype.renderBlockEvents=function(e,t,i){var n,r=e.data,a=this.getStartTime(e,r),s=this.getEndTime(e,r),o=this.parent.getIndexOfDate(this.dateRender,W(new Date(a.getTime())));o<0||s<a||(n=this.getCellTd(o),o=this.getPosition(a,s,e[this.fields.isAllDay],o),i?this.renderBlockIndicator(n,o,t):(i=r.count,r=(r=this.getEventWidth(a,s,e[this.fields.isAllDay],i))<=0?this.cellWidth:r,a=this.parent.enableRtl?0:o,s=this.parent.enableRtl?o:0,i=this.cellHeight-this.monthHeaderHeight,o=this.getRowTop(t),t=this.createBlockAppointmentElement(e,t,this.isResourceEventTemplate),U.setStyleAttribute(t,{width:r+"px",height:i+"px",left:a+"px",right:s+"px",top:o+"px"}),this.renderEventElement(e,t,n)))},a.prototype.renderBlockIndicator=function(e,t,i){var n=U.createElement("div",{className:"e-icons "+ci});U.isNullOrUndefined(e.querySelector("."+ci))&&e.appendChild(n)},a.prototype.getStartTime=function(e,t){return e[this.fields.startTime]},a.prototype.getEndTime=function(e,t){return e[this.fields.endTime]},a.prototype.getCellTd=function(e){return this.workCells[parseInt(e.toString(),10)]},a.prototype.getEventWidth=function(e,t,i,n){return n*this.cellWidth-1},a.prototype.getPosition=function(e,t,i,n){return 0},a.prototype.getRowTop=function(e){return 0},a.prototype.updateIndicatorIcon=function(e){var t,i,n,r,a,s;-1===this.parent.currentView.indexOf("Timeline")||"TimelineMonth"===this.parent.currentView||e[this.fields.isAllDay]||(t=e.data,n=this.parent.activeView.getStartHour(),r=this.parent.activeView.getEndHour(),i=ze(e[this.fields.startTime],n,r),e=ze(e[this.fields.endTime],n,r),n=t[this.fields.startTime],r=t[this.fields.endTime],t.isLeft=t.isLeft||n.getTime()<i.startHour.getTime(),t.isRight=t.isRight||r.getTime()>e.endHour.getTime(),W(n).getTime()!==W(r).getTime()&&(a=i.startHour,e=e.endHour,(s=new Date(W(n))).setHours(e.getHours(),e.getMinutes(),e.getSeconds()),t.isLeft=t.isLeft||n.getTime()>=(a.getDate()===i.endHour.getDate()?s:z(s,1)).getTime(),r.getTime()!==W(r).getTime())&&(e=new Date(W(r)),t.isRight=t.isRight||r.getTime()<=e.setHours(a.getHours(),a.getMinutes(),a.getSeconds())))},a.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)];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&&(n=this.parent.crudModule.crudObj.targetEvent[parseInt(t.toString(),10)],this.renderEventsHandler(n.renderDates,n.workDays,n))}this.parent.crudModule.crudObj.isCrudAction=!1}else for(var r=0,a=e;r<a.length;r++){var s=a[r];this.renderEventsHandler(s.renderDates,s.workDays,s)}},a.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;0<t.length;)this.slots.push(t.splice(0,i))},a.prototype.createAppointmentElement=function(e,t,i){void 0===i&&(i=!1);var n,r,a,s,o=e[this.fields.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),l=U.extend({},e,e.data,!0),l={"data-id":"Appointment_"+e[this.fields.id],role:"button",tabindex:"0","aria-disabled":this.parent.eventBase.getReadonlyAttribute(e),"aria-label":this.parent.getAnnouncementString(l,o)},i=(i||(l["data-guid"]=e.Guid),0<this.parent.activeViewOptions.group.resources.length&&(l["data-group-index"]=t.toString()),U.createElement("div",{className:A,attrs:l})),l=(U.isNullOrUndefined(this.cssClass)||U.addClass([i],this.cssClass),e[this.fields.isReadonly]&&U.addClass([i],"e-read-only"),U.createElement("div",{className:di})),p=(i.appendChild(l),e.data),c=this.getEventData(e);return U.isNullOrUndefined(this.parent.activeViewOptions.eventTemplate)?(r=e[this.fields.location]||this.parent.eventSettings.fields.location.default||"",a=U.createElement("div",{className:Ln}),this.parent.sanitize(o+(r?"; "+r:""),a),o=U.createElement("div",{className:mi+(this.parent.isAdaptive?" "+d:""),innerHTML:this.parent.getTimeString(p[this.fields.startTime])}),n=U.createElement("div",{className:mi+(this.parent.isAdaptive?" "+d:""),innerHTML:this.parent.getTimeString(p[this.fields.endTime])}),"Month"===this.parent.currentView?e[this.fields.isAllDay]?(s=[a],U.addClass([a],"e-text-center")):p.count<=1&&!p.isLeft&&!p.isRight?s=[o,a]:(s=[],U.addClass([a],"e-text-center"),p.isLeft||s.push(o),s.push(a),p.isRight||s.push(n)):(o=void 0,o=e[this.fields.isAllDay]?[a,U.createElement("div",{className:mi,innerHTML:this.parent.localeObj.getConstant("allDay")})]:(n=this.parent.getTimeString(p[this.fields.startTime])+" - "+this.parent.getTimeString(p[this.fields.endTime]),p=U.createElement("div",{className:mi+(this.parent.isAdaptive?" "+d:""),innerHTML:n}),n=U.createElement("div",{className:Nn}),this.parent.sanitize(r,n),[a,p,n]),r=U.createElement("div",{className:"e-inner-wrap"}),U.append(o,r),s=[r])):(a=this.parent.element.id+"_"+this.parent.activeViewOptions.eventTemplateName+"eventTemplate",p=this.isResourceEventTemplate?this.parent.getEventTemplateName(t):"eventTemplate",s=this.parent.getAppointmentTemplate()(c,this.parent,p,a,!1,void 0,void 0,this.parent.root)),U.append(s,l),this.appendEventIcons(e,l),this.renderResizeHandler(i,e.data,e[this.fields.isReadonly]),i},a.prototype.appendEventIcons=function(e,t){var i=e.data;U.isNullOrUndefined(e[this.fields.recurrenceRule])&&U.isNullOrUndefined(e[this.fields.recurrenceID])||(e=e[this.fields.id]===e[this.fields.recurrenceID]?Yi:_i,t.appendChild(U.createElement("div",{className:dt+" "+e+(this.parent.isAdaptive?" "+d:"")}))),i.isLeft&&(e=U.createElement("div",{className:Mi+" "+dt+" "+ki}),U.prepend([e],t)),i.isRight&&(e=U.createElement("div",{className:Mi+" "+dt+" "+Ri}),U.append([e],t))},a.prototype.renderEvents=function(e,t,i){var n=e[this.fields.startTime],r=e[this.fields.endTime],a=this.parent.getIndexOfDate(this.dateRender,W(n));if(!(a<0||n.getTime()<this.parent.minDate.getTime()||r.getTime()>this.parent.maxDate.getTime())){var s=this.parent.rowAutoHeight?1:this.parent.activeViewOptions.maxEventsPerRow,o=this.getIndex(n),l=(e.Index=o,e.data.count);if(n.getTime()<=r.getTime()){var n=l*this.cellWidth-5,r=this.workCells[parseInt(a.toString(),10)],p=o*(this.eventHeight+0),c=this.monthHeaderHeight+(o+1)*(this.eventHeight+0)+this.moreIndicatorHeight,o=!this.parent.activeViewOptions.maxEventsPerRow||this.parent.rowAutoHeight||this.parent.eventSettings.enableIndicator?this.maxOrIndicator?o<1:this.cellHeight>c:o<s;if(this.parent.rowAutoHeight||o){this.renderedEvents.push(U.extend({},e,null,!0));s=void 0,s=this.inlineValue?this.parent.inlineModule.createInlineAppointmentElement():this.createAppointmentElement(e,t);this.applyResourceColor(s,e,"backgroundColor",this.groupOrder),this.wireAppointmentEvents(s,e),U.setStyleAttribute(s,{width:n+"px",top:p+"px"}),this.renderEventElement(e,s,r),this.parent.rowAutoHeight&&(o=r.parentElement.firstElementChild,this.updateCellHeight(o,c))}else for(var h,d,u,g=0;g<l;g++)this.workCells[a+g]&&((u=this.workCells[a+g].querySelector("."+tn))?(h=parseInt(u.getAttribute("data-count"),10)+1,u.setAttribute("data-count",h.toString()),u.setAttribute("aria-label",h+" "+this.parent.localeObj.getConstant("moreEvents")),u.innerHTML=this.getMoreIndicatorText(h)):(u=new Date(this.dateRender[a+g].getTime()),h=z(this.dateRender[a+g],1),d=this.workCells[a+g].getAttribute("data-group-index"),u=this.getMoreIndicatorElement(1,u,h),U.isNullOrUndefined(d)||u.setAttribute("data-group-index",d),u.style.top=this.cellHeight-this.monthHeaderHeight-this.moreIndicatorHeight+"px",u.style.width=this.cellWidth-2+"px",this.renderElement(this.workCells[a+g],u),U.EventHandler.add(u,"click",this.moreIndicatorClick,this)))}}},a.prototype.updateCellHeight=function(e,t){t>e.offsetHeight&&U.setStyleAttribute(e,{height:t+"px"})},a.prototype.updateBlockElements=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll("."+pi));e<t.length;e++){var i=t[e],n=U.closest(i,"tr"),n=(this.monthHeaderHeight=i.offsetParent.offsetTop-n.offsetTop,i.style.height=n.offsetHeight-1-this.monthHeaderHeight+"px",n.firstElementChild),r=Math.round(i.offsetWidth/n.offsetWidth);i.style.width=n.offsetWidth*r+"px"}},a.prototype.getFilteredEvents=function(e,t,i,n){return U.isNullOrUndefined(i)?this.filterEvents(e,t):(i=this.parent.resourceBase.lastResourceLevel[parseInt(i,10)],this.filterEvents(e,t,U.isNullOrUndefined(n)?void 0:n,i))},a.prototype.getOverlapEvents=function(e,t){for(var i=[],n=W(e).getTime(),r=0,a=t;r<a.length;r++){var s=a[r];W(s[this.fields.startTime]).getTime()<=n&&W(s[this.fields.endTime]).getTime()>=n&&i.push(s)}return i},a.prototype.getIndex=function(e){var t=-1,i=this.renderedEvents;return-1===(t=0<i.length?0<(e=this.getOverlapEvents(e,i).map(function(e){return e.Index})).length?this.getSmallestMissingNumber(e):0:t)?0:t},a.prototype.moreIndicatorClick=function(i){var n=this,e=U.closest(i.target,"."+tn),r=new Date(parseInt(e.getAttribute("data-start-date"),10)),a=new Date(parseInt(e.getAttribute("data-end-date"),10)),s=e.getAttribute("data-group-index"),e={cancel:!1,event:i,element:e,isPopupOpen:!0,startTime:r,endTime:a,viewName:this.parent.getNavigateView()};s&&(e.groupIndex=parseInt(s,10)),this.parent.trigger(G,e,function(e){var t;e.cancel||(e.isPopupOpen?(t=n.getFilteredEvents(r,a,s),t={date:r,event:t,element:i.target},n.parent.quickPopup.moreEventClick(t,a,s)):(n.parent.setProperties({selectedDate:r},!0),n.parent.changeView(e.viewName,i)))})},a.prototype.renderEventElement=function(e,t,i){var n=this,r=t.classList.contains(pi)?"blockEvent":"event",a=t.classList.contains(A),e=this.getEventData(e);this.parent.trigger(ne,{data:e,element:t,cancel:!1,type:r},function(e){e.cancel?n.renderedEvents.pop():n.renderElement(i,t,a)})},a.prototype.getEventData=function(e){var t=U.extend({},e,null,!0);return t[this.fields.startTime]=e.data[this.fields.startTime],t[this.fields.endTime]=e.data[this.fields.endTime],t},a.prototype.renderElement=function(e,t,i){void 0===i&&(i=!1),this.maxOrIndicator&&i&&this.setMaxEventHeight(t,e);var i=e.querySelector("."+x);i?i.appendChild(t):((i=U.createElement("div",{className:x})).appendChild(t),e.appendChild(i))},a.prototype.getMoreIndicatorElement=function(e,t,i){return U.createElement("div",{className:tn,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":t.getTime().toString(),"data-end-date":i.getTime().toString()}})},a.prototype.getMoreIndicatorText=function(e){return"+"+this.parent.globalize.formatNumber(e)+"&nbsp;"+(this.parent.isAdaptive?"":this.parent.localeObj.getConstant("more"))},a.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=""},a.prototype.setMaxEventHeight=function(e,t){var i=$e(t.querySelector("."+Ei)),t=t.offsetHeight-i-(this.maxHeight?0:this.moreIndicatorHeight);U.setStyleAttribute(e,{height:t+"px","align-items":"center"})},a.prototype.destroy=function(){this.element=null,this.fields=null,this.maxHeight=null,this.withIndicator=null,this.maxOrIndicator=null,this.moreIndicatorHeight=null,this.removeEventListener(),La.prototype.destroy.call(this)};var ja,La,Na=a;function a(e){e=La.call(this,e)||this;return e.renderedEvents=[],e.monthHeaderHeight=0,e.moreIndicatorHeight=19,e.renderType="day",e.element=e.parent.activeView.getPanel(),e.fields=e.parent.eventFields,e.maxHeight=e.parent.eventSettings.enableMaxHeight&&!e.parent.eventSettings.enableIndicator&&!e.parent.rowAutoHeight,e.withIndicator=e.parent.eventSettings.enableMaxHeight&&e.parent.eventSettings.enableIndicator&&!e.parent.rowAutoHeight,e.maxOrIndicator=e.maxHeight||e.withIndicator,e.moreIndicatorHeight=e.parent.rowAutoHeight&&e.parent.eventSettings.ignoreWhitespace?0:e.moreIndicatorHeight,e.addEventListener(),e}qa=function(e,t){return(qa=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}qa(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(s,Fa=Na),s.prototype.getSlotDates=function(){var e;this.slots=[],this.slots.push(this.parent.activeView.renderDates.map(function(e){return+e})),0<this.parent.activeViewOptions.headerRows.length&&"Hour"!==this.parent.activeViewOptions.headerRows.slice(-1)[0].option?(this.renderType="day",e=this.content.querySelector("."+O),this.cellWidth=V(e)/+(e.getAttribute("colspan")||1),this.slotsPerDay=1):this.slotsPerDay=this.dayLength/this.dateRender.length},s.prototype.getOverlapEvents=function(e,t){var i=[];if("day"===this.renderType)for(var n=0,r=t;n<r.length;n++)W((o=r[n])[this.fields.startTime]).getTime()<=W(new Date(e.getTime())).getTime()&&W(o[this.fields.endTime]).getTime()>=W(new Date(e.getTime())).getTime()&&i.push(o);else for(var a=0,s=t;a<s.length;a++){var o,l=(o=s[a]).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},s.prototype.getSortComparerIndex=function(e,t){var i=-1,n=this.renderedEvents;return-1===(i=0<n.length?0<(e=this.getOverlapSortComparerEvents(e,t,n).map(function(e){return e.Index})).length?this.getSmallestMissingNumber(e):0:i)?0:i},s.prototype.getOverlapSortComparerEvents=function(s,o,e){for(var l=[],t=function(e){var t,i,n,r,a;"day"===p.renderType?(t=W(s).getTime(),i=W(o).getTime(),n=W(e[p.fields.startTime]).getTime(),r=W(e[p.fields.endTime]).getTime(),(n<=t&&t<=r||(a=(a=i-(Fe(o)<=0?B:0))<t?t:a)<=r&&n<=a||t<n&&r<i)&&l.push(e)):((a=e.data).trimStartTime.getTime()<=s.getTime()&&s.getTime()<a.trimEndTime.getTime()||s.getTime()<=a.trimStartTime.getTime()&&a.trimStartTime.getTime()<o.getTime())&&l.push(e)},p=this,i=0,n=e;i<n.length;i++)t(n[i]);return l},s.prototype.renderResourceEvents=function(){this.removeHeightProperty(Pt);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)];this.rowIndex=n.groupIndex,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&&(n=this.parent.crudModule.crudObj.targetEvent[parseInt(t.toString(),10)],this.rowIndex=n.groupIndex,this.renderEventsHandler(this.parent.activeView.renderDates,this.parent.activeViewOptions.workDays,n))}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)])},s.prototype.renderEvents=function(e,t,i){var n=e[this.fields.startTime],r=e[this.fields.endTime];if(!(n.getTime()<this.parent.minDate.getTime()||r.getTime()>this.parent.maxDate.getTime())){var a=e.data,n=this.getStartTime(e,a),r=this.getEndTime(e,a),s=ze(e[this.fields.startTime],this.startHour,this.endHour),s=this.updateEventMinimumDuration(s,n,r);if(n=s.startDate,r=s.endDate,this.day=this.parent.getIndexOfDate(this.dateRender,W(new Date(n.getTime()))),!(this.day<0)){var o=this.getCellTd(),s=this.parent.rowAutoHeight?1:this.parent.activeViewOptions.maxEventsPerRow,l=U.isNullOrUndefined(this.parent.eventSettings.sortComparer)?this.getIndex(n):this.getSortComparerIndex(n,r),p=(e.Index=l,this.eventHeight),c=a.count,h=U.extend({},e,null,!0);h[this.fields.startTime]=a[this.fields.startTime],h[this.fields.endTime]=a[this.fields.endTime];var a=ze(W(new Date(this.dateRender[this.day].getTime())),this.startHour,this.endHour),d=!0,d=!(!this.isDayProcess()&&!h[this.fields.isAllDay])||this.isValidEvent(h,n,r,a);if(n<=r&&d){var h=this.getEventWidth(n,r,e[this.fields.isAllDay],c),h="day"===this.renderType?h-2:h,a=this.getPosition(n,r,e[this.fields.isAllDay],this.day),u=(h=h<=0?this.cellWidth:h,this.renderedEvents.push(U.extend({},e,null,!0)),U.isNullOrUndefined(this.cellTops[parseInt(t.toString(),10)])&&(this.cellTops[parseInt(t.toString(),10)]=this.getRowTop(t)),this.cellTops[parseInt(t.toString(),10)]),d=u+(this.maxHeight?0:2)+l*(p+2),g=this.parent.enableRtl?0:a,m=this.parent.enableRtl?a:0,a=(l+1)*(p+2)+this.moreIndicatorHeight,l=!this.parent.activeViewOptions.maxEventsPerRow||this.parent.rowAutoHeight||this.parent.eventSettings.enableIndicator?this.maxOrIndicator?l<1:this.cellHeight>a:l<s;if(this.parent.rowAutoHeight||l){var v,s=void 0,s=U.isNullOrUndefined(this.inlineValue)?this.createAppointmentElement(e,t):this.parent.inlineModule.createInlineAppointmentElement();this.applyResourceColor(s,e,"backgroundColor",this.groupOrder),U.setStyleAttribute(s,{width:h+"px",left:g+"px",right:m+"px",top:d+"px"}),this.wireAppointmentEvents(s,e),this.parent.rowAutoHeight?(h=V(l=this.parent.element.querySelector("."+I)),d=l.offsetHeight===l.clientHeight&&l.offsetWidth===l.clientWidth,this.renderEventElement(e,s,o),v=this.getFirstChild(t),this.updateCellHeight(v,a),d&&(l.offsetWidth>l.clientWidth||h!==V(l))&&this.adjustAppointments(h)):this.renderEventElement(e,s,o)}else for(var f=0;f<c;f++){var y=o.querySelector("."+tn),T=this.parent.enableRtl?m:g,T=Math.floor(T/this.cellWidth)*this.cellWidth,w=this.interval/this.slotCount,D="TimelineMonth"===this.parent.activeViewOptions.option||"day"===this.renderType||0!==f?new Date(this.dateRender[this.day+f].getTime()):new Date(n),b=z(this.dateRender[this.day+f],1);if("TimelineMonth"===this.parent.activeViewOptions.option||"day"===this.renderType){var C=this.getPosition(D,b,e[this.fields.isAllDay],this.day+f);this.renderTimelineMoreIndicator(n,D,b,p,w,t,i,u,g,m,o,y,T,C)}else for(var S=(it(r)-it(n))/xe*this.slotCount/this.interval,O=0;O<S&&(D=0===O?new Date(D.getTime()):new Date(D.getTime()+6e4*w),S<1&&(D=this.adjustToNearestTimeSlot(D,w)),b=new Date(D.getTime()+6e4*w),!(1<=S&&b.getTime()>r.getTime()));O++){var E=this.getPosition(D,b,!1,this.day+f);if(E<T)break;this.renderTimelineMoreIndicator(n,D,b,p,w,t,i,u,g,m,o,y,T=E,E)}}}this.parent.renderTemplates()}}},s.prototype.adjustToNearestTimeSlot=function(e,t){var e=new Date(e),i=60*e.getHours()*60*1e3+60*e.getMinutes()*1e3,i=Math.floor(i/(60*t*1e3))*(60*t*1e3),t=new Date(e.getTime());return t.setHours(i/36e5%24),t.setMinutes(i%36e5/6e4),t},s.prototype.renderTimelineMoreIndicator=function(e,t,i,n,r,a,s,o,l,p,c,h,d,u){l=this.parent.enableRtl?p=u:u,d=this.parent.enableRtl?p:l,d=Math.floor(d/this.cellWidth)*this.cellWidth,(c&&U.isNullOrUndefined(h)||!this.isAlreadyAvail(d,c))&&(u="TimelineMonth"===this.parent.activeViewOptions.option||"day"===this.renderType?new Date(+e):t,h=new Date(u.setMinutes(Math.floor(u.getMinutes()/r)*r)),d=new Date(h.getTime()+6e4*r),e=void 0,0<this.parent.activeViewOptions.group.resources.length&&!U.isNullOrUndefined(a)&&(e=a.toString()),u=this.getFilterEvents(t,i,h,d,e,s),r=this.cellHeight-this.moreIndicatorHeight,n=this.withIndicator?r-2:n,a=Math.floor(r/(n+2)),s=this.parent.activeViewOptions.maxEventsPerRow&&!this.parent.eventSettings.enableIndicator?u.length-this.parent.activeViewOptions.maxEventsPerRow:u.length-a<=0?1:u.length-a,n=void 0,n="day"===this.renderType?this.getMoreIndicatorElement(s,t,i):this.getMoreIndicatorElement(s,h,d),U.isNullOrUndefined(e)||n.setAttribute("data-group-index",e),n.style.top=o+r+"px",n.style.width=this.cellWidth+"px",n.style.left=Math.floor(l/this.cellWidth)*this.cellWidth+"px",n.style.right=Math.floor(p/this.cellWidth)*this.cellWidth+"px",this.renderElement(c,n),U.EventHandler.add(n,"click",this.moreIndicatorClick,this))},s.prototype.updateCellHeight=function(e,t){var i;(""===e.style.height?this.cellHeight:parseInt(e.style.height,10))<t&&(U.setStyleAttribute(e,{height:t+"px"}),0<this.parent.activeViewOptions.group.resources.length&&(i=this.parent.element.querySelector("."+Pt+' tbody td[data-group-index="'+e.getAttribute("data-group-index")+'"]'))&&U.setStyleAttribute(i,{height:t+"px"}),i=this.parent.element.querySelector(".e-month-header-wrapper table tr:nth-child("+(e.parentElement.rowIndex+1)+") td"))&&U.setStyleAttribute(i,{height:t+"px"})},s.prototype.adjustAppointments=function(e){var t=this,i=this.parent.element.querySelector("."+S+" tbody tr"),n=V(this.workCells[0]),r=(this.cellWidth=n/+(this.workCells[0].getAttribute("colspan")||1),n*i.children.length/(e/100));[].slice.call(this.parent.element.querySelectorAll("."+A)).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"})},s.prototype.getFirstChild=function(e){var t="";return 0<this.parent.activeViewOptions.group.resources.length&&(t='[data-group-index="'+e.toString()+'"]'),this.parent.element.querySelector(".e-content-table tbody td"+t)},s.prototype.updateBlockElements=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll("."+pi));e<t.length;e++){var i=t[e],n=parseInt(i.getAttribute("data-group-index"),10),r=this.getFirstChild(n),a=(i.style.height=r.offsetHeight+"px",i.offsetWidth/r.offsetWidth);i.style.width=r.offsetWidth*a+"px"}for(var s=0,o=[].slice.call(this.element.querySelectorAll("."+ci));s<o.length;s++){i=o[s],n=parseInt(i.getAttribute("data-group-index"),10);i.style.top=this.getRowTop(n)+this.getFirstChild(n).offsetHeight-18+"px"}},s.prototype.getStartTime=function(e,t){var i=ze(n=e[this.fields.startTime],this.startHour,this.endHour),n=this.isDayProcess()?e[this.fields.startTime]:i.startHour.getTime()>=t[this.fields.startTime]?i.startHour:i.endHour.getTime()<=t[this.fields.startTime]?this.getNextDay(i.startHour,t):t[this.fields.startTime];return t.trimStartTime=e[this.fields.isAllDay]?i.startHour:t[this.fields.startTime],n},s.prototype.getNextDay=function(e,t){for(var i,n=1;n<=this.dateRender.length;n++)if(i=z(e,n),-1!==this.parent.getIndexOfDate(this.dateRender,W(new Date(e.getTime()))))return t.count=t.count-1,i;return i},s.prototype.getEndTime=function(e,t){var i=e[this.fields.endTime],n=ze(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},s.prototype.getPreviousDay=function(e,t,i){for(var n=1;n<=this.dateRender.length;n++){var r,a,s=z(t,-n);if(-1!==this.parent.getIndexOfDate(this.dateRender,W(new Date(e.getTime()))))return(s=W(new Date(s.getTime()))).setHours(t.getHours(),t.getMinutes(),t.getSeconds()),r=i.count,a=i[this.fields.endTime],i.count=0!==a.getHours()||0!==a.getMinutes()?r-1:r,s}return i[this.fields.endTime]},s.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)},s.prototype.getSameDayEventsWidth=function(e,t){var i,n=this.interval;return 1===this.slotsPerDay&&(n=((i=ze(W(new Date(e.getTime())),this.startHour,this.endHour)).endHour.getTime()-i.startHour.getTime())/xe),(it(t)-it(e))/xe*(this.cellWidth*this.slotCount)/n},s.prototype.getSpannedEventsWidth=function(e,t,i){var n,i=i*this.slotsPerDay*this.cellWidth,r=ze(W(new Date(e.getTime())),this.startHour,this.endHour),r=this.getSameDayEventsWidth(r.startHour,e),t=r+(n=-1===this.parent.getIndexOfDate(this.dateRender,W(new Date(t.getTime())))||(e=ze(W(new Date(t.getTime())),this.startHour,this.endHour),n=this.getSameDayEventsWidth(t,e.endHour),this.slotsPerDay*this.cellWidth===n)?0:n);return t<i?i-t:i-r},s.prototype.isSameDay=function(e,t){return this.parent.getIndexOfDate(this.dateRender,W(new Date(e.getTime())))===this.parent.getIndexOfDate(this.dateRender,W(new Date(t.getTime())))},s.prototype.getAppointmentLeft=function(e,t,i){t=this.isSameDay(t,e.startHour)?(it(t)-it(e.startHour))/(xe*this.interval)*this.slotCount:0;return 0===i?t:Math.round((it(e.endHour)-it(e.startHour))/xe/this.interval*this.slotCount)*i+t},s.prototype.getPosition=function(e,t,i,n){return"day"===this.renderType||i?n*this.slotsPerDay*this.cellWidth:((i=ze(W(new Date(this.dateRender[parseInt(n.toString(),10)].getTime())),this.startHour,this.endHour)).endHour.getTime()<=t.getTime()&&i.startHour.getTime()>=e.getTime()||!(i.endHour.getTime()<=t.getTime())&&i.startHour.getTime()>=e.getTime()?this.getAppointmentLeft(i,i.startHour,n):this.getAppointmentLeft(i,e,n))*this.cellWidth},s.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)},s.prototype.isAlreadyAvail=function(e,t){for(var i=[].slice.call(t.querySelectorAll("."+tn)),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},s.prototype.getRowTop=function(e){return 0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?this.parent.element.querySelector("."+I+' tbody td[data-group-index="'+e.toString()+'"]').offsetTop:0},s.prototype.getCellTd=function(){var e=this.parent.uiStateValues.isGroupAdaptive?0:this.rowIndex;return this.eventContainers[parseInt(e.toString(),10)]},s.prototype.renderBlockIndicator=function(e,t,i){var n;0<this.parent.headerRows.length&&("Hour"!==this.parent.headerRows[this.parent.headerRows.length-1].option||"Date"!==this.parent.headerRows[this.parent.headerRows.length-1].option)||(t=Math.floor(t/this.cellWidth)*this.cellWidth+this.cellWidth-22,this.isAlreadyAvail(t,e))||(n=U.createElement("div",{className:"e-icons "+ci}),0<this.parent.activeViewOptions.group.resources.length&&n.setAttribute("data-group-index",i.toString()),this.parent.enableRtl?n.style.right=t+"px":n.style.left=t+"px",n.style.top=this.getRowTop(i)+this.cellHeight-18+"px",this.renderElement(e,n))},s.prototype.setMaxEventHeight=function(e,t){U.setStyleAttribute(e,{height:this.cellHeight-(this.maxHeight?0:2)-(this.maxHeight?0:this.moreIndicatorHeight)+"px"})},s.prototype.isDayProcess=function(){return"TimelineMonth"===this.parent.currentView||!this.parent.activeViewOptions.timeScale.enable||0<this.parent.activeViewOptions.headerRows.length&&"Hour"!==this.parent.activeViewOptions.headerRows.slice(-1)[0].option},s.prototype.destroy=function(){this.renderType=null,this.eventContainers=null,this.dayLength=null,this.content=null,Fa.prototype.destroy.call(this),this.parent=null};var qa,Fa,Ua=s;function s(e,t){e=Fa.call(this,e)||this,e.startHour=e.parent.activeView.getStartHour(),e.endHour=e.parent.activeView.getEndHour(),e.slotCount=e.parent.activeViewOptions.timeScale.slotCount,e.interval=e.parent.activeViewOptions.timeScale.interval,e.day=0,e.rowIndex=0,e.cellTops=[],e.renderType=t,e.eventContainers=[].slice.call(e.element.querySelectorAll("."+li)),t=[].slice.call(e.element.querySelectorAll("."+S+" tbody tr"));return e.dayLength=0===t.length?0:t[0].children.length,e.content=e.parent.element.querySelector("."+mt+"."+S),e}Wa.prototype.inlineEdit=function(e){var t;this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(),"Cell"===e.type?((t=this.parent.element.querySelector("."+gn))&&t.classList.contains(yt)&&this.parent.quickPopup.morePopup.hide(),this.removeInlineAppointmentElement(),this.cellEdit(e)):(this.parent.element.querySelector("."+Sr)!==e.element.querySelector("."+Sr)&&this.removeInlineAppointmentElement(),this.eventEdit(e))},Wa.prototype.cellEdit=function(e){var t=this.generateEventData(),i=e.element.cellIndex,n=this.getEventDaysCount(t),n=(1<n&&(n=Math.round(n),i-=--n),W(new Date(""+t[this.parent.eventFields.startTime])).getTime()),r=W(new Date(""+t[this.parent.eventFields.endTime])).getTime(),e=e.groupIndex||0,a="Day"===this.parent.currentView||"Week"===this.parent.currentView||"WorkWeek"===this.parent.currentView,s=(this.parent.activeViewOptions.timeScale.enable&&a?(s=t[this.parent.eventFields.startTime].getDay(),this.createVerticalViewInline(t,s,e,i)):"Month"===this.parent.currentView||!this.parent.activeViewOptions.timeScale.enable&&a?this.createMonthViewInline(t,e,n,r):this.createTimelineViewInline(t,n,r,e),this.parent.element.querySelector("."+Sr));s&&s.focus()},Wa.prototype.eventEdit=function(e){var t,i,n=e.element.querySelector("."+Sr);n?i=n.value:(t=e.element.querySelector("."+Ln),i=U.isNullOrUndefined(t)?e.data[this.parent.eventFields.subject]:(U.addClass([t],d),t.innerText),n=U.createElement("input",{className:Sr,attrs:{value:i}}),U.closest(e.element,"."+gn)?e.element.insertBefore(n,t):-1<["Agenda","MonthAgenda"].indexOf(this.parent.currentView)?(t=e.element.querySelector("."+ui),U.isNullOrUndefined(t)&&(t=U.createElement("div",{className:ui}),e.element.prepend(t)),t.insertBefore(n,t.firstChild)):e.element.querySelector(".e-appointment-details").prepend(n),n.focus()),n.setSelectionRange(i.length,i.length)},Wa.prototype.createVerticalViewInline=function(e,t,i,n){var r,a=this.getEventDaysCount(e),s=new Pa(this.parent),t=(s.initializeValues(),s.dateRender[parseInt(i.toString(),10)].map(function(e){return e.getDay()}).indexOf(t));1<=a?(s.allDayElement=[].slice.call(this.parent.element.querySelectorAll("."+v)),(a=s.slots).push.apply(a,this.parent.activeView.renderDates.map(function(e){return+e})),(a=0)<(r=[].slice.call(this.parent.element.querySelectorAll("."+Qi))).length&&(a=Math.floor(at(this.parent.element.querySelector("."+vt))/r[0].offsetHeight)-1),s.allDayLevel=a,r=Ae(this.parent.element.querySelector("."+Xi),A),a=0<s.allDayElement.length?s.allDayElement[0].offsetTop:0,s.renderAllDayEvents(e,t,i,n,this.parent.allowInline,a,r)):s.renderNormalEvents(e,t,i,n,this.parent.allowInline)},Wa.prototype.createMonthViewInline=function(e,t,i,n){for(var r=this.getEventDaysCount(e),e=this.parent.eventBase.cloneEventObject(e,i,n,r,!1,!1),a=new Na(this.parent),i=(a.dateRender=this.parent.activeView.renderDates,a.inlineValue=this.parent.allowInline,this.parent.activeView.renderDates),n=this.parent.activeViewOptions.workDays,r="."+O,s=(0<this.parent.activeViewOptions.group.resources.length&&(r+='[data-group-index="'+t+'"]',i=(s=this.parent.resourceBase.lastResourceLevel[parseInt(t.toString(),10)]).renderDates,n=s.workDays),a.dateRender=i,a.workCells=[].slice.call(this.parent.element.querySelectorAll(r)),a.cellWidth=a.workCells[0].offsetWidth,a.cellHeight=a.workCells[0].offsetHeight,a.eventHeight=Ae(this.parent.monthModule.element||a.element,A),a.getSlotDates(n),a.getRenderedDates(i)),o=0,l=a.splitEvent(e,s||i);o<l.length;o++){var p=l[o];a.renderEvents(p,t)}this.parent.element.querySelector("."+Sr).focus()},Wa.prototype.createTimelineViewInline=function(e,t,i,n){var r=this.getEventDaysCount(e),e=this.parent.eventBase.cloneEventObject(e,t,i,r,!1,!1),t=new Ua(this.parent,this.parent.activeViewOptions.timeScale.enable?"hour":"day"),i=(t.dateRender=this.parent.activeView.renderDates,t.eventContainers=[].slice.call(this.parent.element.querySelectorAll("."+li)),this.parent.element.querySelector("."+O)),r=(t.inlineValue=this.parent.allowInline,t.cellWidth=i.offsetWidth,t.cellHeight=i.offsetHeight,0===this.parent.element.querySelectorAll("."+S+" tbody tr").length?0:this.parent.element.querySelectorAll("."+S+" tbody tr")[0].children.length);t.slotsPerDay=r/t.dateRender.length,t.eventHeight=Ae(t.element,A),t.renderEvents(e,n)},Wa.prototype.getEventDaysCount=function(e){var t=e[this.parent.eventFields.startTime],e=e[this.parent.eventFields.endTime];return Math.abs(e.getTime()-t.getTime())/B},Wa.prototype.generateEventData=function(e){var t=this.parent.element.querySelector("."+Sr),t=t?t.value:e?e.innerHTML:"",e={};return e[this.parent.eventFields.id]=this.parent.eventBase.getEventMaxID(),e[this.parent.eventFields.subject]=t,e[this.parent.eventFields.startTime]=this.parent.activeCellsData.startTime,e[this.parent.eventFields.endTime]=this.parent.activeCellsData.endTime,e[this.parent.eventFields.isAllDay]=this.parent.activeCellsData.isAllDay,this.parent.eventWindow.setDefaultValueToObject(e),this.parent.resourceBase&&this.parent.resourceBase.setResourceValues(e,this.parent.activeCellsData.groupIndex),e},Wa.prototype.documentClick=function(){var e=this.parent.element.querySelector("."+Sr);e&&""!==e.value?this.inlineCrudActions(e):this.removeInlineAppointmentElement()},Wa.prototype.inlineCrudActions=function(e){var t;U.closest(e,"."+Or)?(t=this.generateEventData(e),this.parent.addEvent(t)):(t=U.closest(e,"."+A),e=void((t=this.parent.getEventDetails(t))[this.parent.eventFields.subject]=e.value),t[this.parent.eventFields.id]===t[this.parent.eventFields.recurrenceID]&&(e="EditOccurrence",t[this.parent.eventFields.id]=this.parent.eventBase.getEventMaxID()),this.parent.saveEvent(t,e)),this.removeInlineAppointmentElement()},Wa.prototype.createInlineAppointmentElement=function(e){var t=U.createElement("div",{className:A+" "+Or}),i=U.createElement("div",{className:di}),n=(t.appendChild(i),U.createElement("input",{className:Sr}));return i.appendChild(n),e&&this.parent.eventBase.applyResourceColor(t,e,"backgroundColor"),t},Wa.prototype.removeInlineAppointmentElement=function(){var e,t=[].slice.call(this.parent.element.querySelectorAll("."+Or)),t=(0<t.length&&t.forEach(function(e){return U.remove(e)}),this.parent.element.querySelector("."+Sr));t&&(e=U.closest(t,"."+A).querySelector("."+Ln),U.isNullOrUndefined(e)||U.removeClass([e],d),U.remove(t))},Wa.prototype.destroy=function(){this.parent.off(ge,this.inlineEdit)};var Ba=Wa;function Wa(e){this.parent=e,this.parent.on(ge,this.inlineEdit,this)}Ya.prototype.renderFormValidator=function(e,t,i,n){var r=this;this.element=i,this.formObj=new j.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)}})},Ya.prototype.focusOut=function(e){e=e.relatedTarget;e&&(e.classList.contains("e-dlg-closeicon-btn")||e.classList.contains("e-close")||e.classList.contains(v)||e.classList.contains(Dt)||e.classList.contains(pn)||e.classList.contains(O)||e.classList.contains(Xn))?this.ignoreError=!0:this.ignoreError=!1},Ya.prototype.validationComplete=function(e){var t=this.element.querySelector("#"+e.inputName+"_Error");t&&(t.style.display="failure"===e.status?"":"none")},Ya.prototype.errorPlacement=function(e,t){var i=t.getAttribute("for"),n=this.element.querySelector("#"+i+"_Error");n||this.ignoreError||this.createTooltip(e,t,i,""),U.isNullOrUndefined(n)||(n.querySelector(".e-error").innerHTML=t.innerHTML)},Ya.prototype.createTooltip=function(e,t,i,n){var r,e=e.getBoundingClientRect(),a=(this.element.classList.contains(lr)?(r=this.element,this.element):r=this.element.querySelector(".e-schedule-dialog .e-dlg-content")).getBoundingClientRect(),i=U.createElement("div",{className:"e-tooltip-wrap e-popup "+rr,id:i+"_Error",styles:"display:"+n+";top:"+(e.bottom-a.top+r.scrollTop+9)+"px;left:"+(e.left-a.left+r.scrollLeft+e.width/2)+"px;"}),n=U.createElement("div",{className:"e-tip-content"}),a=(n.appendChild(t),U.createElement("div",{className:"e-arrow-tip e-tip-top"}));a.appendChild(U.createElement("div",{className:"e-arrow-tip-outer e-tip-top"})),a.appendChild(U.createElement("div",{className:"e-arrow-tip-inner e-tip-top"})),i.appendChild(n),i.appendChild(a),r.appendChild(i),i.style.left=parseInt(i.style.left,10)-i.offsetWidth/2+"px"},Ya.prototype.destroyToolTip=function(){if(this.element)for(var e=0,t=[].slice.call(this.element.querySelectorAll("."+rr));e<t.length;e++){var i=t[e];U.remove(i)}this.formObj&&this.formObj.element&&this.formObj.reset()},Ya.prototype.destroy=function(){this.formObj&&this.formObj.element&&!this.formObj.isDestroyed&&this.formObj.destroy(),this.formObj=null,this.element=null};var za=Ya;function Ya(){}o.prototype.render=function(){this.renderQuickPopup(),this.renderMorePopup(),this.renderQuickDialog()},o.prototype.renderQuickPopup=function(){var e=U.createElement("div",{className:lr+" e-popup-close",attrs:{role:"dialog"}});this.parent.isAdaptive?(document.body.appendChild(e),U.addClass([e],pt)):this.parent.element.appendChild(e),this.quickPopup=new M.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})},o.prototype.renderMorePopup=function(){var e='<div class="'+mn+'"><div class="e-more-event-header"><div class="'+Tn+'" title="'+this.l10n.getConstant("close")+'" tabindex="0" role="button"></div><div class="'+vn+'"><div class="'+fn+'" id="'+this.parent.element.id+'_more_popup"></div><div class="'+yn+" "+Oi+'" tabindex="0" role="link"></div></div></div></div>',e=U.createElement("div",{className:gn+" e-popup-close",innerHTML:e}),e=(this.parent.isAdaptive?(document.body.appendChild(e),U.addClass([e],pt)):this.parent.element.appendChild(e),this.morePopup=new M.Popup(e,{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"),this.morePopup.element.querySelector("."+Tn));this.renderButton("e-round",dt+" "+nr,!1,e,this.closeClick),U.EventHandler.add(this.morePopup.element.querySelector("."+yn),"click",this.navigationClick,this)},o.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)}],t=(this.parent.eventSettings.editFollowingEvents&&(t={buttonModel:{cssClass:"e-quick-alertfollowing e-flat",isPrimary:!1},click:this.dialogButtonClick.bind(this)},e.splice(1,0,t)),this.quickDialog=new M.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"}),U.createElement("div",{id:this.parent.element.id+"QuickDialog"})),e=(this.parent.element.appendChild(t),this.quickDialog.appendTo(t),this.quickDialog.element.querySelector("."+xn)),t=(e&&(e.setAttribute("aria-label",this.l10n.getConstant("occurrence")),e.setAttribute("aria-label",e.innerHTML)),this.quickDialog.element.querySelector("."+An));t&&(t.setAttribute("aria-label",this.l10n.getConstant("series")),t.setAttribute("aria-label",t.innerHTML)),this.quickDialog.element.querySelector(".e-dlg-closeicon-btn")&&this.quickDialog.element.querySelector(".e-dlg-closeicon-btn").setAttribute("title",this.l10n.getConstant("close"))},o.prototype.renderButton=function(e,t,i,n,r){new P.Button({cssClass:e,disabled:i,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,iconCss:t}).appendTo(n),U.EventHandler.add(n,"click",r,this),U.removeClass([n],dt)},o.prototype.quickDialogClass=function(e){var t=[bn,Cn,En,Vn,Mn,d],i=this.quickDialog.element.querySelector("."+xn),n=this.quickDialog.element.querySelector("."+An),r=this.quickDialog.element.querySelector("."+In);switch(U.removeClass([i,n],t),U.addClass([this.quickDialog.element.querySelector("."+Vn)],d),this.parent.eventSettings.editFollowingEvents&&(U.addClass([r],d),U.removeClass([this.quickDialog.element],On)),e){case"Recurrence":U.addClass([i],bn),U.addClass([n],Cn),this.parent.eventSettings.editFollowingEvents&&(U.removeClass([r],d),U.addClass([this.quickDialog.element],On),U.addClass([r],Sn));break;case"Delete":U.addClass([i],En),U.addClass([n],Vn);break;case"Alert":U.addClass([i],[xn,Mn]),U.addClass([n],[An,d])}},o.prototype.applyFormValidation=function(){var e=this.quickPopup.element.querySelector("."+Rn),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)},o.prototype.openRecurrenceAlert=function(){var e=this.quickDialog.element.querySelector("."+xn),e=(e&&(e.innerHTML=this.l10n.getConstant("Delete"===this.parent.currentAction?"deleteEvent":"editEvent"),e.setAttribute("aria-label",e.innerHTML)),this.quickDialog.element.querySelector("."+In)),e=(e&&(e.innerHTML=this.l10n.getConstant("editFollowingEvent"),e.setAttribute("aria-label",e.innerHTML)),this.quickDialog.element.querySelector("."+An));e&&(e.innerHTML=this.l10n.getConstant("Delete"===this.parent.currentAction?"deleteSeries":"editSeries"),e.setAttribute("aria-label",e.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")},o.prototype.openRecurrenceValidationAlert=function(e){this.quickDialogClass("Alert");var t,i=this.quickDialog.element.querySelector("."+xn),n=(i.innerHTML=this.l10n.getConstant("ok"),i.setAttribute("aria-label",i.innerHTML),this.quickDialog.element.querySelector("."+An));switch(n.innerHTML=this.l10n.getConstant("cancel"),n.setAttribute("aria-label",n.innerHTML),this.quickDialog.header=this.l10n.getConstant("alert"),e){case"wrongPattern":U.addClass([n],d),this.quickDialog.content=this.l10n.getConstant("wrongPattern");break;case"createError":U.addClass([n],d),this.quickDialog.content=this.l10n.getConstant("createError");break;case"sameDayAlert":U.addClass([n],d),this.quickDialog.content=this.l10n.getConstant("sameDayAlert");break;case"seriesChangeAlert":t=this.quickDialog.element.querySelector("."+Vn),U.removeClass([n,t],d),this.quickDialog.content=this.l10n.getConstant("seriesChangeAlert"),i.innerHTML=this.l10n.getConstant("yes"),n.innerHTML=this.l10n.getConstant("no"),t.innerHTML=this.l10n.getConstant("cancel");break;case"occurrenceAlert":U.addClass([n],d),this.quickDialog.content=this.l10n.getConstant("occurenceAlert")}(!this.parent.enableRecurrenceValidation&&"wrongPattern"===e||this.parent.enableRecurrenceValidation)&&this.showQuickDialog("RecurrenceValidationAlert")},o.prototype.openDeleteAlert=function(){var e;this.parent.activeViewOptions.readonly||((e=this.quickDialog.element.querySelector("."+xn))&&(e.innerHTML=this.l10n.getConstant("delete"),e.setAttribute("aria-label",e.innerHTML)),(e=this.quickDialog.element.querySelector("."+An))&&(e.innerHTML=this.l10n.getConstant("cancel"),e.setAttribute("aria-label",e.innerHTML)),this.quickDialog.content=1<this.parent.activeEventData.event.length?this.l10n.getConstant("deleteMultipleContent"):this.l10n.getConstant("deleteContent"),this.quickDialog.header=1<this.parent.activeEventData.event.length?this.l10n.getConstant("deleteMultipleEvent"):this.l10n.getConstant("deleteEvent"),this.quickDialogClass("Delete"),this.showQuickDialog("DeleteAlert"))},o.prototype.openValidationError=function(e,t){this.quickDialog.header=this.l10n.getConstant("alert"),this.quickDialog.content=this.l10n.getConstant(e);var e=this.quickDialog.element.querySelector("."+xn),i=(e&&(e.innerHTML=this.l10n.getConstant("ok"),e.setAttribute("aria-label",e.innerHTML)),this.quickDialog.element.querySelector("."+An));i&&(i.innerHTML=this.l10n.getConstant("cancel"),e.setAttribute("aria-label",i.innerHTML)),this.quickDialogClass("Alert"),this.showQuickDialog("ValidationAlert",t)},o.prototype.showQuickDialog=function(e,t){var i=this,e=(this.quickDialog.dataBind(),{type:e,cancel:!1,element:this.quickDialog.element,data:U.extend({},t||this.parent.activeEventData.event,null,!0)});this.parent.trigger(se,e,function(e){e.cancel||i.quickDialog.show()})},o.prototype.createMoreEventList=function(e,r,a){var s=this,o=this.parent.eventFields,t=U.createElement("div",{className:wn}),l=U.createElement("div",{className:Dn});if(0===e.length)l=U.createElement("div",{className:wn,innerHTML:this.l10n.getConstant("emptyContainer")});else for(var p=this,i=0,n=e;i<n.length;i++)!function(t){var e=t[o.subject]||p.parent.eventSettings.fields.subject.default||p.parent.localeObj.getConstant("addTitle"),i=U.createElement("div",{className:A,attrs:{"data-id":""+t[o.id],"data-guid":t.Guid,role:"button",tabindex:"0","aria-disabled":p.parent.eventBase.getReadonlyAttribute(t),"aria-label":p.parent.getAnnouncementString(t)}}),n=(t[o.isReadonly]&&U.addClass([i],"e-read-only"),void 0),n=(U.isNullOrUndefined(p.parent.activeViewOptions.eventTemplate)?(i.appendChild(U.createElement("div",{className:Ln})),p.parent.sanitize(e,i.firstElementChild)):(e=p.parent.element.id+"_"+p.parent.activeViewOptions.eventTemplateName+"eventTemplate",n=p.parent.getAppointmentTemplate()(t,p.parent,"eventTemplate",e,!1,void 0,void 0,p.parent.root),U.append(n,i)),U.isNullOrUndefined(a)||i.setAttribute("data-group-index",a),U.isNullOrUndefined(t[o.recurrenceRule])||(e=t[o.id]===t[o.recurrenceID]?Yi:_i,i.appendChild(U.createElement("div",{className:dt+" "+e}))),{data:U.extend({},t,null,!0),element:i,cancel:!1});p.parent.trigger(ne,n,function(e){e.cancel||(l.appendChild(i),e=s.parent.isAdaptive||"Year"===s.parent.currentView,s.parent.eventBase.wireAppointmentEvents(i,t,e),s.parent.eventBase.applyResourceColor(i,t,"backgroundColor",r))})}(n[i]);return t.appendChild(l),t},o.prototype.tapHoldEventPopup=function(e){var t,i,n=U.closest(e.target,"."+A),r=(this.parent.selectedElements=[],this.isMultipleEventSelect=!0,this.parent.eventBase.getSelectedEventElements(n),this.parent.activeEventData=this.parent.eventBase.getSelectedEvents(),n.getAttribute("data-guid")),r=this.parent.eventBase.getEventByGuid(r);U.isNullOrUndefined(r)||(t=r[this.parent.eventFields.subject]||this.l10n.getConstant("noTitle"),t='<div class="e-multiple-event-popup"><div class="'+an+'"><button class="'+ir+'" title="'+this.l10n.getConstant("close")+'"></button><div class="'+Ln+'">'+t+'</div><button class="e-edit" title="'+this.l10n.getConstant("edit")+'"></button><button class="'+er+'" title="'+this.l10n.getConstant("delete")+'"></button></div></div>',this.quickPopup.element.innerHTML=t,t=this.quickPopup.element.querySelector("."+ir),this.renderButton("e-flat e-round e-small",dt+" "+nr,!1,t,this.closeClick),t=this.parent.activeViewOptions.readonly||r[this.parent.eventFields.isReadonly],r=!this.parent.eventSettings.allowEditing||t,t=!this.parent.eventSettings.allowDeleting||t,(i=this.quickPopup.element.querySelector("."+Jn))&&this.renderButton("e-flat e-round e-small",dt+" "+$n,r,i,this.editClick),(r=this.quickPopup.element.querySelector("."+er))&&this.renderButton("e-flat e-round e-small",dt+" "+tr,t,r,this.deleteClick),this.beforeQuickPopupOpen(n,this.parent.eventBase.getPageCoordinates(e)))},o.prototype.isCellBlocked=function(e){var t={};return 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,0<this.parent.activeViewOptions.group.resources.length&&(e=e.element instanceof Array?e.element[0]:e.element,e=parseInt(e.getAttribute("data-group-index"),10),this.parent.resourceBase.setResourceValues(t,isNaN(e)?null:e)),this.parent.eventBase.isBlockRange(t)},o.prototype.cellClick=function(e){var t,i,n=new Date(e.startTime.getTime());this.parent.showQuickInfo&&this.parent.eventSettings.allowAdding&&"MonthAgenda"!==this.parent.currentView&&!this.isCellBlocked(e)&&this.parent.isMinMaxDate(new Date(n.setHours(0,0,0,0)))?(n=U.isNullOrUndefined(e.event)?e.element:e.event.target,this.parent.isAdaptive?(this.quickPopupHide(),i=this.parent.element.querySelector("."+Pi),U.isNullOrUndefined(i)&&(i=U.createElement("div",{className:Pi,innerHTML:'<div class="e-title">+ '+this.l10n.getConstant("newEvent")+"</div>"})),(t=U.closest(n,"."+O+",."+v))&&t.appendChild(i)):(t=U.closest(n,"."+O+",."+v+",."+Dt),U.isNullOrUndefined(t)||n.classList.contains(tn)||(this.quickPopup.relateTo===t&&this.quickPopup.element.classList.contains(yt)?(i=this.quickPopup.element.querySelector("."+Ln))&&i.focus():(this.quickPopup.element&&this.destroyPopupButtons("quickPopup"),(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,(i=U.createElement("div",{className:nn})).appendChild(this.getPopupHeader("Cell",n)),i.appendChild(this.getPopupContent("Cell",e,n)),i.appendChild(this.getPopupFooter("Cell",n)),this.quickPopup.element.setAttribute("aria-label",this.l10n.getConstant("newEvent")),(n=i.querySelector("."+Ln))&&j.Input.createInput({element:n,properties:{placeholder:this.l10n.getConstant("addTitle")}}),U.isNullOrUndefined(this.parent.eventSettings.fields.subject.default)||(n.value=this.parent.eventSettings.fields.subject.default),(n=i.querySelector("."+ir))&&this.renderButton("e-flat e-round e-small",dt+" "+nr,!1,n,this.popupClose),(n=i.querySelector("."+pn))&&this.renderButton("e-flat","",!1,n,this.detailsClick),(n=i.querySelector("."+cn))&&this.renderButton("e-flat e-primary","",this.parent.activeViewOptions.readonly,n,this.saveClick),this.morePopup&&this.morePopup.hide(),this.quickPopup.content=i,this.quickPopup.relateTo=t,this.quickPopup.dataBind(),this.beforeQuickPopupOpen(t,this.parent.eventBase.getPageCoordinates(e.event)))))):this.quickPopupHide()},o.prototype.isSameEventClick=function(e){return!(this.quickPopup.relateTo!==U.closest(e.element,"."+A)||!this.quickPopup.element.classList.contains(yt)||((e=this.quickPopup.element.querySelector("."+Jn))&&e.focus(),this.parent.isAdaptive||(e=this.quickPopup.element.querySelector("."+hn))&&e.focus(),0))},o.prototype.isQuickTemplate=function(e){return"Both"===this.parent.quickInfoTemplates.templateType||this.parent.quickInfoTemplates.templateType===e},o.prototype.eventClick=function(e){var t,i,n,r,a;this.parent.eventTooltip&&this.parent.eventTooltip.close(),this.parent.showQuickInfo&&(this.parent.isAdaptive&&this.isMultipleEventSelect?this.updateTapHoldEventPopup(U.closest(e.element,"."+A)):(n=this.isSameEventClick(e),this.parent.selectedElements=[],n||(this.quickPopup.element&&this.destroyPopupButtons("quickPopup"),n=e.event,(t=U.createElement("div",{className:rn})).appendChild(this.getPopupHeader("Event",n)),t.appendChild(this.getPopupContent("Event",e,n)),t.appendChild(this.getPopupFooter("Event",n)),this.quickPopup.element.setAttribute("aria-label",this.l10n.getConstant("editEvent")),n=this.parent.activeViewOptions.readonly||n[this.parent.eventFields.isReadonly],i=!this.parent.eventSettings.allowEditing||n,n=!this.parent.eventSettings.allowDeleting||n,r="e-flat e-round e-small",(a=t.querySelector("."+Jn))&&this.renderButton(r,dt+" "+$n,i,a,this.editClick),(a=t.querySelector("."+er))&&this.renderButton(r,dt+" "+tr,n,a,this.deleteClick),(a=t.querySelector("."+ir))&&this.renderButton(r,dt+" "+nr,!1,a,this.popupClose),(r=t.querySelector("."+hn))&&this.renderButton("e-flat e-primary","",i,r,this.editClick),(a=t.querySelector("."+dn))&&this.renderButton("e-flat","",n,a,this.deleteClick),this.morePopup&&!U.closest(e.element,"."+Dn)&&this.morePopup.hide(),this.quickPopup.content=t,this.quickPopup.relateTo=this.parent.isAdaptive?document.body:U.closest(e.element,"."+A),this.quickPopup.dataBind(),this.beforeQuickPopupOpen(e.element,this.parent.eventBase.getPageCoordinates(e.originalEvent)))))},o.prototype.getPopupHeader=function(e,t){var i=U.createElement("div",{className:an});if(this.isQuickTemplate(e)&&this.parent.quickInfoTemplates.header){var n=U.extend({},t,{elementType:e.toLowerCase()},!0),r=this.parent.element.id,n=[].slice.call(this.parent.getQuickInfoTemplatesHeader()(n,this.parent,"header",r+"_headerTemplate",!1));U.append([].slice.call(n),i)}else{var a=void 0,s=void 0;switch(e){case"Cell":a='<div class="'+sn+'"><button class="'+ir+'" title="'+this.l10n.getConstant("close")+'"></button></div>';break;case"Event":s=this.getFormattedString(t),a='<div class="'+sn+'"><button class="e-edit '+dt+'" title="'+this.l10n.getConstant("edit")+'"></button><button class="'+er+" "+dt+'" title="'+this.l10n.getConstant("delete")+'"></button><button class="'+ir+'" title="'+this.l10n.getConstant("close")+'"></button></div><div class="'+ui+'"><div class="'+Ln+" "+un+'" title="'+(s.eventSubject&&s.eventSubject.replaceAll('"',"'"))+'"></div></div >'}r=U.createElement("div",{innerHTML:a});"Event"===e&&(n=r.querySelector("."+Ln),this.parent.sanitize(s.eventSubject,n)),U.append([].slice.call(r.childNodes),i)}return i},o.prototype.getPopupContent=function(e,t,i){var n=U.createElement("div",{className:"e-popup-content"});if(this.isQuickTemplate(e)&&this.parent.quickInfoTemplates.content){var r=U.extend({},i,{elementType:e.toLowerCase()},!0),a=this.parent.element.id,r=[].slice.call(this.parent.getQuickInfoTemplatesContent()(r,this.parent,"content",a+"_contentTemplate",!1));U.append([].slice.call(r),n)}else{var s,o=void 0,a=this.getResourceText(t,e.toLowerCase());switch(e){case"Cell":s=this.getFormattedString(i),o='<table class="e-popup-table"><tbody><tr><td><form class="'+Rn+'" onsubmit="return false;"><input class="'+Ln+' e-field" type="text" name="'+this.parent.eventFields.subject+'" /></form></td></tr><tr><td><div class="'+xi+'"><div class="'+fr+" "+dt+'"></div><div class="'+ln+" "+un+'">'+s.details+"</div></div>"+(0<this.parent.activeViewOptions.group.resources.length?'<div class="'+gr+'"><div class="'+mr+" "+dt+' "></div><div class="'+vr+" "+un+'"></div></div>':"")+"</td></tr></tbody></table>";break;case"Event":s=this.getFormattedString(i),o='<div class="'+xi+'"><div class="'+fr+" "+dt+'"></div><div class="e-date-time-wrapper '+un+'"><div class="'+ln+" "+un+'">'+s.details+"</div>",i[this.parent.eventFields.recurrenceRule]&&(o+='<div class="e-recurrence-summary '+un+'">'+this.getRecurrenceSummary(i)+"</div>"),o+="</div></div>",i[this.parent.eventFields.location]&&(o+='<div class="'+Nn+'"><div class="e-location-icon '+dt+'"></div><div class="'+qn+" "+un+'"></div></div>'),(i[this.parent.eventFields.startTimezone]||i[this.parent.eventFields.endTimezone])&&(o+='<div class="'+Pn+'"><div class="e-time-zone-icon '+dt+'"></div><div class="e-time-zone-details '+un+'">'+this.getTimezone(i)+"</div></div>"),i[this.parent.eventFields.description]&&(o+='<div class="'+Bn+'"><div class="e-description-icon '+dt+'"></div><div class="'+Wn+" "+un+'"></div></div>'),0<this.parent.resourceCollection.length&&(o+='<div class="'+gr+'"><div class="'+mr+" "+dt+'"></div><div class="'+vr+" "+un+'"></div></div>')}r=U.createElement("div",{innerHTML:o});i[this.parent.eventFields.location]&&(t=r.querySelector("."+qn),U.isNullOrUndefined(t)||this.parent.sanitize(i[this.parent.eventFields.location],t)),i[this.parent.eventFields.description]&&(e=r.querySelector("."+Wn),U.isNullOrUndefined(e)||this.parent.sanitize(i[this.parent.eventFields.description],e)),a&&(t=r.querySelector("."+vr),U.isNullOrUndefined(t)||this.parent.sanitize(a,t)),U.append([].slice.call(r.childNodes),n)}return n},o.prototype.getPopupFooter=function(e,t){var i=U.createElement("div",{className:on});if(this.isQuickTemplate(e)&&this.parent.quickInfoTemplates.footer){var t=U.extend({},t,{elementType:e.toLowerCase()},!0),n=this.parent.element.id,t=[].slice.call(this.parent.getQuickInfoTemplatesFooter()(t,this.parent,"footer",n+"_footerTemplate",!1));U.append([].slice.call(t),i)}else{var r=void 0;switch(e){case"Cell":r='<button class="'+pn+" "+un+'" title="'+this.l10n.getConstant("moreDetails")+'">'+this.l10n.getConstant("moreDetails")+'</button><button class="'+cn+" "+un+'" title="'+this.l10n.getConstant("save")+'">'+this.l10n.getConstant("save")+"</button>";break;case"Event":r=this.parent.isAdaptive?"":'<button class="'+hn+" "+un+'" title="'+this.l10n.getConstant("edit")+'">'+this.l10n.getConstant("edit")+'</button><button class="'+dn+" "+un+'" title="'+this.l10n.getConstant("delete")+'">'+this.l10n.getConstant("delete")+"</button>"}n=U.createElement("div",{innerHTML:r});U.append([].slice.call(n.childNodes),i)}return i},o.prototype.getResourceText=function(e,t){if(0===this.parent.resourceCollection.length)return null;var r="";if(0===this.parent.activeViewOptions.group.resources.length){var a=this.parent.resourceBase.resourceCollection.slice(-1)[0],s=a.dataSource;if("event"===t)for(var o=e.event,i=0,n=s;i<n.length;i++)!function(e){var t,i,n=o[a.field];n instanceof Array?-1<n.indexOf(e[a.idField])&&(t=n[n.indexOf(e[a.idField])],i=s.filter(function(e){return e[a.idField]===t})[0],r+=""===r?i[a.textField]:", "+i[a.textField]):e[a.idField]===n&&(r=e[a.textField].toString())}(n[i]);else r=s[0][a.textField].toString()}else if("event"===t){for(var l,o=e.event,s=void 0,p=this.parent.resourceBase.resourceCollection.length-1;0<=p;p--)if(s=o[this.parent.resourceBase.resourceCollection[parseInt(p.toString(),10)].field],!U.isNullOrUndefined(s)){l=this.parent.resourceBase.resourceCollection[parseInt(p.toString(),10)];break}Array.isArray(s)||(s=[s]);var c=[],h=l.dataSource;s.forEach(function(e){var t,e=Je(h,l.idField,e);(t=-1<e?h[parseInt(e.toString(),10)][l.textField]:t)&&c.push(t)}),r=c.join(", ")}else t=e,e=U.isNullOrUndefined(t.groupIndex)?0:t.groupIndex,t=this.parent.resourceBase.lastResourceLevel[parseInt(e.toString(),10)],r=t.resourceData[t.resource.textField];return r},o.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(z(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")+")",1<(it(r)-it(n))/B&&(p+="&nbsp;-&nbsp;"+s+" ("+this.l10n.getConstant("allDay")+")")):p=1<=(it(r)-it(n))/B||0<c?a+" ("+o+")&nbsp;-&nbsp;"+s+" ("+l+")":a+" ("+o+"&nbsp;-&nbsp;"+l+")",{eventSubject:i,details:p}},o.prototype.moreEventClick=function(t,e,i){var n,r=this,a=(this.quickPopupHide(!0),this.morePopup.element.querySelector("."+wn)),a=(a&&U.remove(a),t.date.getTime().toString()),s=U.closest(t.element,"."+tn+",."+O),o=this.parent.globalize.formatDate(t.date,{format:"E",calendar:this.parent.getCalendarMode()}),o=(this.morePopup.element.querySelector("."+fn).innerHTML=f(o,"single"),this.morePopup.element.querySelector("."+yn)),a=(o.innerHTML=this.getDateFormat(t.date,"d"),o.setAttribute("data-date",a),o.setAttribute("data-end-date",e.getTime().toString()),U.isNullOrUndefined(i)||(o.setAttribute("data-group-index",i),n=this.parent.resourceBase.lastResourceLevel[parseInt(i,10)].groupOrder),this.createMoreEventList(t.event,n,i));if(this.morePopup.element.querySelector("."+mn).appendChild(a),U.removeClass(this.morePopup.element.querySelector("."+vn).childNodes,St),W(t.date).getTime()===W(this.parent.getCurrentTime()).getTime()&&U.addClass(this.morePopup.element.querySelector("."+vn).childNodes,St),!this.parent.isAdaptive)if(-1!==this.parent.currentView.indexOf("Timeline")){var e=s.getAttribute("data-group-index"),o=new Date(parseInt(s.getAttribute("data-start-date"),10)),l=(o.setHours(o.getHours(),o.getMinutes(),0),o.getTime().toString());if(U.isNullOrUndefined(e))this.morePopup.relateTo=this.parent.element.querySelector("."+I+' tbody tr td[data-date="'+l+'"]');else if(this.morePopup.relateTo=this.parent.element.querySelector("."+I+' tbody tr td[data-group-index="'+e+'"][data-date="'+l+'"]'),U.isNullOrUndefined(this.morePopup.relateTo))for(var p=[].slice.call(this.parent.element.querySelectorAll("."+I+' tbody tr td[data-group-index="'+e+'"]')),c=0;c<p.length;c++)p[parseInt(c.toString(),10)].getAttribute("data-date")<l&&(this.morePopup.relateTo=p[parseInt(c.toString(),10)])}else this.morePopup.relateTo=U.closest(s,"."+O);this.parent.renderTemplates(function(){var e={type:"EventContainer",cancel:!1,element:r.morePopup.element,data:t};r.parent.trigger(se,e,function(e){e.cancel||r.morePopup.show()})})},o.prototype.saveClick=function(e){this.applyFormValidation(),this.dialogEvent=e,this.isCrudAction=!0,this.quickPopupHide()},o.prototype.detailsClick=function(e){var t=this.quickPopup.element.querySelector("."+Ln);t&&""!==t.value&&U.extend(this.parent.activeCellsData,{subject:t.value}),this.dialogEvent=e,this.isCrudAction=!1,this.fieldValidator.destroyToolTip(),this.quickPopupHide(),this.parent.eventWindow.openEditor(this.parent.activeCellsData,"Add")},o.prototype.editClick=function(e){this.dialogEvent=e,this.quickPopupHide(!0);e=this.parent.activeEventData.event;this.parent.currentAction="EditSeries",U.isNullOrUndefined(e[this.parent.eventFields.recurrenceRule])?this.parent.eventWindow.openEditor(e,this.parent.currentAction):(this.parent.currentAction="EditOccurrence",this.openRecurrenceAlert())},o.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()},o.prototype.updateMoreEventContent=function(){var e,t,i,n,r;this.morePopup.element.classList.contains("e-popup-close")||((e=this.morePopup.element.querySelector("."+wn))&&U.remove(e),e=this.morePopup.element.querySelector("."+yn),n=new Date(parseInt(e.getAttribute("data-date"),10)),r=new Date(parseInt(e.getAttribute("data-end-date"),10)),e=e.getAttribute("data-group-index"),U.isNullOrUndefined(e)||(i=(t=this.parent.resourceBase.lastResourceLevel[parseInt(e,10)]).groupOrder),n=this.parent.eventBase.filterEvents(n,r,this.parent.eventsProcessed,t),r=this.createMoreEventList(n,i,e),this.morePopup.element.querySelector("."+mn).appendChild(r))},o.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()},o.prototype.dialogButtonClick=function(e){this.dialogEvent=e,this.quickDialog.hide();var t=e.target,i=this.quickDialog.element.querySelector("."+An),n=this.parent.activeEventData.event;if(t.classList.contains(bn))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(Sn))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(Cn))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(En)?this.parent.crudModule.deleteEvent(n,this.parent.currentAction):!i.classList.contains(d)&&(t.classList.contains(xn)||t.classList.contains(An)&&!i.classList.contains(Vn))&&(this.parent.uiStateValues.isIgnoreOccurrence=t.classList.contains(An),this.parent.eventWindow.eventSave(e,this.l10n.getConstant("ok")))},o.prototype.updateTapHoldEventPopup=function(e){var t,e=this.parent.eventBase.getSelectedEventElements(e);this.parent.activeEventData=this.parent.eventBase.getSelectedEvents(),0<e.length?(t=this.parent.eventBase.getEventByGuid(e[0].getAttribute("data-guid")),t=1===e.length?t[this.parent.eventFields.subject]||this.l10n.getConstant("noTitle"):"("+e.length+")&nbsp;"+this.l10n.getConstant("selectedItems"),this.quickPopup.element.querySelector("."+Ln).innerHTML=t,1<e.length?U.addClass([this.quickPopup.element.querySelector("."+$n)],sr):U.removeClass([this.quickPopup.element.querySelector("."+$n)],sr)):(this.parent.selectedElements=[],this.quickPopupHide())},o.prototype.getTimezone=function(e){var t="";return(t+=e[this.parent.eventFields.startTimezone]||"")+(t?" - ":"")+(e[this.parent.eventFields.endTimezone]||"")},o.prototype.getRecurrenceSummary=function(e){var t=this.parent.eventWindow.getRecurrenceEditorInstance();return t?(t=t.getRuleSummary(e[this.parent.eventFields.recurrenceRule])).charAt(0).toUpperCase()+t.slice(1):""},o.prototype.getDateFormat=function(e,t){return f(this.parent.globalize.formatDate(e,{skeleton:t,calendar:this.parent.getCalendarMode()}),"single")},o.prototype.getDataFromTarget=function(e){var t;return e.classList.contains(A)?this.parent.activeEventData.event:(e={startTime:this.parent.activeCellsData.startTime,endTime:this.parent.activeCellsData.endTime,isAllDay:this.parent.activeCellsData.isAllDay,groupIndex:this.parent.activeCellsData.groupIndex},t=this.parent.activeCellsData,this.parent.eventWindow.convertToEventData(t,e),e)},o.prototype.beforeQuickDialogClose=function(e){var t=this,e={event:e.event||this.dialogEvent,type:U.isNullOrUndefined(this.parent.activeEventData.event)?"ValidationAlert":U.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(oe,e,function(e){e.cancel||t.parent.eventBase.focusElement(!0)})},o.prototype.beforeQuickPopupOpen=function(p,c){var h=this;this.parent.renderTemplates(function(){var o=h.quickPopup.element.querySelector("."+rn),l=h.parent.isAdaptive?o?"ViewEventInfo":"EditEventInfo":"QuickInfo",e={type:l,cancel:!1,data:U.extend({},h.getDataFromTarget(p),null,!0),target:p,element:h.quickPopup.element};h.parent.trigger(se,e,function(e){var t,i,n,r,a,s;e.cancel?(h.quickPopupHide(),h.destroyPopupButtons("quickPopup"),e.element.classList.contains(yt)&&h.quickPopupClose(),et(h.quickPopup.element),h.isMultipleEventSelect=!1):(e=h.quickPopup.element.style.display,h.quickPopup.element.style.display="block",h.parent.isAdaptive?(h.quickPopup.element.removeAttribute("style"),h.quickPopup.element.style.display="block",h.quickPopup.element.style.height=U.formatUnit("EditEventInfo"==l?65:window.innerHeight)):(i=h.parent.virtualScrollModule&&h.parent.virtualScrollModule.isHorizontalScroll&&!U.isNullOrUndefined(U.closest(p,"."+S)),t=h.parent.element.querySelector("."+I+" table"),h.quickPopup.offsetX=i&&!h.parent.enableRtl?ke(t)+10:10,h.quickPopup.offsetY=h.parent.virtualScrollModule&&!h.parent.virtualScrollModule.isHorizontalScroll?h.quickPopup.offsetY:0,h.quickPopup.collision={X:h.parent.enableRtl?"flip":"none",Y:"fit"},h.quickPopup.position={X:h.parent.enableRtl?"left":"right",Y:h.parent.enableRtl?"bottom":"top"},h.quickPopup.dataBind(),h.quickPopup.refreshPosition(null,!0),-1<(s=M.isCollide(h.quickPopup.element,h.parent.element)).indexOf(h.parent.enableRtl?"left":"right")&&(h.quickPopup.offsetX=-p.offsetWidth-10-h.quickPopup.element.offsetWidth,i&&!h.parent.enableRtl&&(h.quickPopup.offsetX=ke(t)+h.quickPopup.offsetX),h.quickPopup.dataBind(),h.quickPopup.refreshPosition(null,!0),-1<M.isCollide(h.quickPopup.element,h.parent.element).indexOf("left"))&&(h.quickPopup.position={X:"center",Y:"center"},h.quickPopup.collision={X:"fit",Y:"fit"},h.quickPopup.offsetX=-h.quickPopup.element.offsetWidth/2,h.quickPopup.dataBind()),h.parent.virtualScrollModule&&!h.parent.virtualScrollModule.isHorizontalScroll&&(-1<s.indexOf("top")||-1<s.indexOf("bottom"))&&(i=Me(t),h.quickPopup.offsetY=i,h.quickPopup.dataBind(),h.quickPopup.refreshPosition(null,!0)),"center"===h.quickPopup.position.X&&"center"===h.quickPopup.position.Y&&!U.isNullOrUndefined(c)&&c.clientX&&c.clientY&&(s=c.clientX,t=c.clientY,i=p.getBoundingClientRect(),i=c.offsetY||Math.ceil(t-i.y),n=h.quickPopup.offsetY,r=M.isCollide(h.quickPopup.element,p),a=h.quickPopup.element.getBoundingClientRect(),s=document.elementFromPoint(s,t),-1<r.indexOf("top")||-1<r.indexOf("bottom")||U.closest(s,"."+lr))&&(a.top<=t&&t<=a.top+a.height?(h.quickPopup.offsetY=n-a.height-10,h.quickPopup.dataBind(),-1<(r=M.isCollide(h.quickPopup.element,h.parent.element)).indexOf("top")&&(h.quickPopup.offsetY=n+i+10,h.quickPopup.dataBind())):-1<M.isCollide(h.quickPopup.element,h.parent.element).indexOf("bottom")&&(h.quickPopup.offsetY=n-i-Math.ceil(a.height)-10,h.quickPopup.dataBind()))),o&&h.applyEventColor(),h.quickPopup.element.style.display=e,h.quickPopup.dataBind(),h.quickPopup.show())})})},o.prototype.applyEventColor=function(){var e,t,i="",i="Agenda"===this.parent.currentView||"MonthAgenda"===this.parent.currentView?this.parent.enableRtl?"border-right-color":"border-left-color":"background-color",i=this.parent.activeEventData.element.style[i];""!==i&&(e=this.quickPopup.element.querySelector("."+an),(t=this.quickPopup.element.querySelector("."+on))&&t.offsetParent&&(e=this.quickPopup.element.querySelector("."+Ln))&&(i="rgba("+(e.style.borderLeftColor=i).match(/\d+/g).join()+",0.3)"),e)&&(e.style.backgroundColor=i)},o.prototype.quickPopupOpen=function(){var e;this.parent.isAdaptive?this.quickPopup.element.style.top="0px":this.quickPopup.element.querySelector("."+nn)?(e=this.quickPopup.element.querySelector("."+Ln))&&e.focus():((e=this.quickPopup.element.querySelector("."+hn))&&e.focus(),(e=this.quickPopup.element.querySelector("."+Jn))&&e.focus())},o.prototype.quickPopupClose=function(){this.parent.eventBase.focusElement(),this.quickPopup.relateTo="."+O,this.fieldValidator.destroyToolTip(),this.quickPopup.element.querySelectorAll(".e-formvalidator").length&&this.fieldValidator.destroy(),this.destroyPopupButtons("quickPopup"),et(this.quickPopup.element)},o.prototype.morePopupOpen=function(){this.parent.isAdaptive?(this.morePopup.element.style.top="0px",this.morePopup.element.style.left="0px",this.morePopup.element.style.height=U.formatUnit(window.innerHeight)):(this.morePopup.element.querySelector("."+yn).focus(),this.morePopup.refreshPosition())},o.prototype.morePopupClose=function(){var e=this.parent.element.querySelector("."+Dn);e&&U.remove(e)},o.prototype.popupClose=function(e){this.dialogEvent=e,this.isCrudAction=!1,this.quickPopupHide(!0)},o.prototype.quickPopupHide=function(t){var i=this;if(this.quickPopup.element.classList.contains(yt)){var n=this.quickPopup.element.querySelector("."+nn);if(n){var e=this.quickPopup.element.querySelector(".e-formvalidator");if(this.isCrudAction&&e&&!e.ej2_instances[0].validate())return;var e=this.parent.eventFields,r=this.parent.eventWindow.getObjectFromFormData(lr);this.parent.eventWindow.setDefaultValueToObject(r),r[e.id]=this.parent.eventBase.getEventMaxID(),r[e.startTime]=this.parent.activeCellsData.startTime,r[e.endTime]=this.parent.activeCellsData.endTime,r[e.isAllDay]=this.parent.activeCellsData.isAllDay,this.parent.resourceBase&&this.parent.resourceBase.setResourceValues(r),e=r}else e=this.parent.activeEventData.event;r=this.quickPopup.element.querySelector("."+rn),r={event:this.dialogEvent,type:this.parent.isAdaptive?r?"ViewEventInfo":"EditEventInfo":"QuickInfo",cancel:!1,data:e,element:this.quickPopup.element,target:(n?this.parent.activeCellsData:this.parent.activeEventData).element};this.parent.trigger(oe,r,function(e){e.cancel||i.quickPopup.element.classList.contains("e-popup-open")&&(n&&i.isCrudAction&&(i.parent.currentAction="Add",i.parent.crudModule.addEvent(e.data)),t?(e=i.quickPopup.hideAnimation,i.quickPopup.hideAnimation=null,i.quickPopup.hide(),i.quickPopup.hideAnimation=e):i.quickPopup.hide(),i.isMultipleEventSelect=!1,i.isCrudAction=!1)})}},o.prototype.navigationClick=function(e){var t=U.closest(e.target,"."+Oi);U.isNullOrUndefined(t)||(t=this.parent.getDateFromElement(e.currentTarget),U.isNullOrUndefined(t))||(this.closeClick(e),this.parent.setProperties({selectedDate:t},!0),this.parent.changeView(this.parent.getNavigateView(),e))},o.prototype.documentClick=function(e){var e=e.event.target,t="."+lr+",."+Dt+",."+v+",."+O+",."+A+",.e-popup",i=this.parent.element.querySelector("."+lr),i=((i&&0<i.childElementCount&&!U.closest(e,t)||!U.closest(e,t))&&(this.quickPopupHide(),this.parent.removeNewEventElement()),this.parent.element.querySelector("."+Sr));i&&i!==e&&this.parent.allowInline&&this.parent.inlineModule.documentClick(),U.closest(e,"."+A+",."+Dt)&&this.parent.removeNewEventElement(),U.closest(e,"."+gn)||!e.classList||e.classList.contains(tn)||U.closest(e,"."+yt)||U.closest(e,"."+O)||this.morePopup.hide()},o.prototype.onClosePopup=function(e){U.isNullOrUndefined(e)||(this.dialogEvent=e),this.quickPopupHide(),(U.isNullOrUndefined(e)||!U.isNullOrUndefined(e)&&"escape"!==e.action||this.parent.inlineModule&&this.parent.element.querySelector("."+Or))&&this.parent.eventBase.focusElement()},o.prototype.addEventListener=function(){this.parent.on(F,this.cellClick,this),this.parent.on(te,this.eventClick,this),this.parent.on(Ee,this.documentClick,this),this.parent.on(Te,this.updateMoreEventContent,this)},o.prototype.removeEventListener=function(){this.parent.off(F,this.cellClick),this.parent.off(te,this.eventClick),this.parent.off(Ee,this.documentClick),this.parent.off(Te,this.updateMoreEventContent)},o.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].ej2_instances[0];r&&r.destroy()}"quickPopup"===e&&((e=t.element.querySelector("input."+Ln))&&e.remove(),(t=this.quickPopup.element.querySelector("form."+Rn))&&(et(t),t.remove()),this.parent.resetTemplates(["content","header","footer"]))},o.prototype.refreshQuickDialog=function(){this.destroyQuickDialog(),this.renderQuickDialog()},o.prototype.refreshQuickPopup=function(){this.destroyQuickPopup(),this.renderQuickPopup()},o.prototype.refreshMorePopup=function(){this.destroyMorePopup(),this.renderMorePopup()},o.prototype.destroyQuickDialog=function(){this.quickDialog.element&&(this.quickDialog.destroy(),U.remove(this.quickDialog.element),this.quickDialog=null)},o.prototype.destroyQuickPopup=function(){this.quickPopup.element&&(this.destroyPopupButtons("quickPopup"),this.quickPopup.destroy(),U.remove(this.quickPopup.element),this.quickPopup=null)},o.prototype.destroyMorePopup=function(){this.morePopup.element&&(this.destroyPopupButtons("morePopup"),this.morePopup.destroy(),U.remove(this.morePopup.element),this.morePopup=null)},o.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};var _a=o;function o(e){this.isMultipleEventSelect=!1,this.isCrudAction=!1,this.parent=e,this.l10n=this.parent.localeObj,this.fieldValidator=new za,this.render(),this.addEventListener()}Xa.prototype.getTargets=function(){var e=[];return this.parent.activeViewOptions.group.headerTooltipTemplate&&e.push("."+Ut),this.parent.eventSettings.enableTooltip&&e.push("."+A),e.join(",")},Xa.prototype.onBeforeRender=function(e){var t,i,n,r,a,s,o,l,p,c,h,d,u,g,m,v;U.isNullOrUndefined(e.target.getAttribute("data-tooltip-id"))&&(e.target.classList.contains(Ut)&&0<this.parent.activeViewOptions.group.resources.length?(m=void 0,v={resource:(m=this.parent.activeView.isTimelineView()?(v=parseInt(e.target.getAttribute("data-group-index"),10),this.parent.resourceBase.lastResourceLevel[parseInt(v.toString(),10)]):(v=e.target.parentNode.sectionRowIndex,g=e.target.cellIndex,this.parent.activeView.getColumnLevels()[parseInt(v.toString(),10)][parseInt(g.toString(),10)])).resource,resourceData:m.resourceData},g=U.createElement("div"),m=this.parent.element.id+"_headerTooltipTemplate",v=[].slice.call(this.parent.getHeaderTooltipTemplate()(v,this.parent,"headerTooltipTemplate",m,!1)),U.append(v,g),this.setContent(g),this.parent.renderTemplates()):(e=this.parent.eventBase.getEventByGuid(e.target.getAttribute("data-guid")),U.isNullOrUndefined(e)||(U.isNullOrUndefined(this.parent.eventSettings.tooltipTemplate)?(t=this.parent.globalize,i=this.parent.eventFields,n=new Date(""+e[i.startTime]),d=0===(d=new Date(""+e[i.endTime])).getHours()&&0===d.getMinutes()?new Date(d.setMilliseconds(-1e3)):d,r=W(new Date(""+n)),a=W(new Date(""+d)),s=e[i.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),o=U.isNullOrUndefined(e[i.location])?"":e[i.location],c=p=l="",l=t.formatDate(n,{type:"date",skeleton:"MMMd",calendar:this.parent.getCalendarMode()}),p=t.formatDate(n,{type:"date",skeleton:"medium",calendar:this.parent.getCalendarMode()}),c=t.formatDate(d,{type:"date",skeleton:"medium",calendar:this.parent.getCalendarMode()}),l=f(l,"single"),p=f(p,"single"),c=f(c,"single"),h=this.parent.getTimeString(n),d=this.parent.getTimeString(d),u='<div><div class="e-subject">'+s+'</div><div class="e-location">'+o+'</div><div class="e-details">'+(r.getTime()===a.getTime()?f(t.formatDate(n,{type:"date",skeleton:"long",calendar:this.parent.getCalendarMode()}),"single"):r.getFullYear()===a.getFullYear()?l+" - "+c:p+" - "+c)+'</div><div class="e-all-day">'+(e[i.isAllDay]?this.parent.localeObj.getConstant("allDay"):h+" - "+d)+"</div></div>",this.setContent(U.initializeCSPTemplate(function(){return u}))):(g=U.createElement("div"),m=this.parent.element.id+"_tooltipTemplate",v=[].slice.call(this.parent.getEventTooltipTemplate()(e,this.parent,"tooltipTemplate",m,!1)),U.append(v,g),this.setContent(g)),this.parent.renderTemplates())))},Xa.prototype.onTooltipClose=function(e){e.element&&(U.removeClass([e.element],yt),U.addClass([e.element],"e-popup-close")),this.parent.resetTemplates(["tooltipTemplate","headerTooltipTemplate"])},Xa.prototype.setContent=function(e){this.tooltipObj.setProperties({content:e},!0)},Xa.prototype.close=function(){this.tooltipObj.close()},Xa.prototype.destroy=function(){this.tooltipObj.destroy(),U.addClass([this.parent.element],"e-control"),this.tooltipObj=null,this.parent=null};var Ga=Xa;function Xa(e){this.parent=e,this.tooltipObj=new M.Tooltip({animation:{close:{effect:"FadeOut"}},content:"No title",position:"BottomRight",offsetY:10,mouseTrail:!this.parent.isAdaptive,showTipPointer:!1,cssClass:this.parent.cssClass+" e-schedule-event-tooltip",target:this.getTargets(),beforeRender:this.onBeforeRender.bind(this),beforeClose:this.onTooltipClose.bind(this),enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}),this.tooltipObj.appendTo(this.parent.element)}Qa=function(e,t){return(Qa=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Qa,Ka,Za=function(e,t){function i(){this.constructor=e}Qa(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Ja=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;0<=o;o--)(r=e[o])&&(s=(a<3?r(s):3<a?r(t,i,s):r(t,i))||s);return 3<a&&s&&Object.defineProperty(t,i,s),s},$a="e-input-wrapper",es="e-input-wrapper-side",ts="e-repeat-element",is="e-repeat-interval",ns="e-interval",rs="e-days",as="e-non-week",ss="e-year-expander",os="e-year-expander-element",ls="e-month-expander",ps="e-month-expander-element",cs="e-month-expander-checkbox-wrapper",hs="e-form-left",ds="e-form-right",us="e-month-day",gs="e-month-expander-wrapper",ms="e-month-pos",vs="e-month-week",fs="e-end-on",ys="e-end-on-element",Ts="e-end-on-date",ws="e-until-date",Ds="e-end-on-count",bs="e-recurrence-count",Cs="e-hide-recurrence-element",Ss="e-primary",Os="e-active",Es="e-recurrence-table",Vs="e-repeat-content",xs="none",As="daily",Is="weekly",Ms="monthly",ks="yearly",Rs="never",Hs="until",Ps="count",js="text",Ls="value",Ns="MONTHLY",qs="=",Fs=";",Us={none:"",daily:"days",weekly:"weeks",monthly:"months",yearly:"years"},Bs={sun:"SU",mon:"MO",tue:"TU",wed:"WE",thu:"TH",fri:"FR",sat:"SA"},Ws=[rs,as,fs,ns,ss,ls],zs=[as],Ys=[rs,ss],_s=[rs],Gs=[rs,as,ss,ls],Xs=[Ts,Ds],Qs=[Ts],Ks=[Ds],Zs=(Ka=U.Component,Za(l,Ka),l.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})},l.prototype.preRender=function(){this.localeObj=new U.L10n(this.getModuleName(),this.defaultLocale,this.locale),this.calendarUtil=fa(this.calendarMode)},l.prototype.applyCustomClass=function(e){e&&U.addClass([this.element],e.split(" "))},l.prototype.initialize=function(){U.addClass([this.element],"e-"+this.getModuleName()),this.renderComponent(),U.isNullOrUndefined(this.value)||""===this.value?(U.isNullOrUndefined(this.repeatType.value)||(this.startState(this.repeatType.value.toString().toUpperCase(),this.endTypes[0],this.startDate),this.updateForm(this.repeatType.value.toString())),0<this.selectedType&&this.setProperties({value:this.getRecurrenceRule()},!1)):this.setRecurrenceRule(this.value),this.applyCustomClass(this.cssClass)},l.prototype.triggerChangeEvent=function(){var e,t=this;this.renderStatus&&(e=this.getRecurrenceRule(),this.trigger("change",{value:e},function(e){return t.setProperties({value:e.value},!1)}))},l.prototype.resetDayButton=function(){[].slice.call(this.element.querySelectorAll(".e-days button")).forEach(function(e){return U.removeClass([e],[Os,Ss])})},l.prototype.daySelection=function(e){this.resetDayButton();var t=[0,1,2,3,4,5,6],t=(this.rotateArray(t,this.firstDayOfWeek),this.element.querySelector('.e-days button[data-index="'+t.indexOf(e)+'"]'));t&&U.addClass([t],[Os,Ss])},l.prototype.rtlClass=function(e){e?U.addClass([this.element],"e-rtl"):U.removeClass([this.element],"e-rtl")},l.prototype.updateUntilDate=function(e){e=new Date(e.getTime());e.setDate(e.getDate()+60),this.untilDateObj.setProperties({value:e})},l.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:Bs[t[e.getDay()]]}),this.monthValue.setProperties({value:""+this.calendarUtil.getMonth(e)}),this.monthWeekPos.setProperties({value:this.getDayPosition(e)}),this.daySelection(e.getDay())},l.prototype.updateForm=function(e){var t=this,i=(this.repeatType.setProperties({value:e}),this.element.querySelector("."+fs));switch(e===As?U.classList(i,[hs],[ds]):U.classList(i,[ds],[hs]),e){case xs:Ws.forEach(function(e){return U.addClass([t.element.querySelector("."+e)],Cs)});break;case Is:zs.forEach(function(e){return U.addClass([t.element.querySelector("."+e)],Cs)});break;case Ms:Ys.forEach(function(e){return U.addClass([t.element.querySelector("."+e)],Cs)});break;case ks:_s.forEach(function(e){return U.addClass([t.element.querySelector("."+e)],Cs)});break;case As:Gs.forEach(function(e){return U.addClass([t.element.querySelector("."+e)],Cs)})}},l.prototype.updateEndOnForm=function(e){var t=this;switch(this.endType.setProperties({value:e}),e){case Rs:Xs.forEach(function(e){return U.addClass([t.element.querySelector("."+e)],Cs)});break;case Hs:Ks.forEach(function(e){return U.addClass([t.element.querySelector("."+e)],Cs)});break;case Ps:Qs.forEach(function(e){return U.addClass([t.element.querySelector("."+e)],Cs)})}},l.prototype.freshOnEndForm=function(){var t=this;Xs.forEach(function(e){e=t.element.querySelector("."+e);e&&U.removeClass([e],Cs)})},l.prototype.showFormElement=function(){var t=this;Ws.forEach(function(e){e=t.element.querySelector("."+e);e&&U.removeClass([e],Cs)})},l.prototype.renderDropdowns=function(){function e(e){return new L.DropDownList({dataSource:e,popupWidth:t.getPopupWidth(),enableRtl:t.enableRtl,fields:{text:js,value:Ls},index:1,change:function(e){i.onWeekDay.setProperties({checked:!0}),i.resetFormValues(),i.triggerChangeEvent()}})}var t=this,i=this;this.repeatType=new L.DropDownList({dataSource:this.getRepeatData(),floatLabelType:"Always",enableRtl:this.enableRtl,index:this.selectedType,fields:{text:js,value:Ls},placeholder:this.localeObj.getConstant("repeat"),htmlAttributes:{title:this.localeObj.getConstant("repeat")},change:function(e){i.setProperties({selectedType:t.frequencies.indexOf(e.value)},!1),i.element.querySelector("."+Vs).innerHTML=i.localeObj.getConstant(Us[e.value]),i.showFormElement(),i.updateForm(e.value),i.resetFormValues(),i.triggerChangeEvent()}}),this.repeatType.appendTo(this.element.querySelector("."+ts)),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:js,value:Ls},change:function(e){i.freshOnEndForm(),i.updateEndOnForm(e.value),i.resetFormValues(),i.triggerChangeEvent()}}),this.endType.appendTo(this.element.querySelector("."+ys));this.monthWeekPos=e(this.getMonthPosData()),this.monthWeekPos.appendTo(this.element.querySelector("."+ms)),this.monthWeekDays=e(this.getDayData("wide")),this.monthWeekDays.appendTo(this.element.querySelector("."+vs)),this.monthValue=new L.DropDownList({dataSource:this.getMonthData(),fields:{text:js,value:Ls},enableRtl:this.enableRtl,index:7,change:function(e){i.resetFormValues(),i.triggerChangeEvent()}}),this.monthValue.appendTo(this.element.querySelector("."+os))},l.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(is)?(i.value=1,i.dataBind()):i.element.classList.contains(bs)&&(i.value=10,i.dataBind())}},l.prototype.resetFormValues=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll('.e-control [type="text"]'));e<t.length;e++){var i,n=t[e],r=void 0;n.classList.contains("e-datepicker")?(r=n.ej2_instances[0]).value?(r.value=r.value,r.dataBind()):this.updateUntilDate(this.startDate):n.classList.contains("e-dropdownlist")?((r=n.ej2_instances[0]).index=r.index||0,r.dataBind()):n.classList.contains("e-numerictextbox")&&(i=void 0,i=(r=n.ej2_instances[0]).element.classList.contains(is)?1:r.element.classList.contains(bs)?10:this.startDate.getDate(),r.value=r.value||i,r.dataBind())}},l.prototype.getPopupWidth=function(){return U.Browser.isDevice?"100%":"auto"},l.prototype.renderDatePickers=function(){var t=this;this.untilDateObj=new R.DatePicker({firstDayOfWeek:this.firstDayOfWeek,enableRtl:this.enableRtl,locale:this.locale,min:this.minDate,max:this.maxDate,format:U.isNullOrUndefined(this.dateFormat)?this.getFormat("dateFormats"):this.dateFormat,change:function(e){e.value&&t.triggerChangeEvent()}}),this.untilDateObj.appendTo(this.element.querySelector("."+ws))},l.prototype.getFormat=function(e){e="en"===this.locale||"en-US"===this.locale?U.getValue(e+".short",U.getDefaultDateObject(this.getCalendarMode())):U.getValue("main."+this.locale+".dates.calendars."+this.getCalendarMode()+"."+e+".short",U.cldrData);return e},l.prototype.dayButtonRender=function(){for(var i=this,e=[].slice.call(this.element.querySelectorAll(".e-days button")),n=this,t=0,r=e;t<r.length;t++){var a=r[t],s=new P.Button({isToggle:!0,enableRtl:this.enableRtl},a);this.dayButtons.push(s),U.EventHandler.add(a,"click",function(e){var t=[].slice.call(i.element.querySelectorAll(".e-days button."+Ss)),e=e.target;e.classList.contains(Ss)?1<t.length&&(U.removeClass([e],Ss),n.triggerChangeEvent()):(U.addClass([e],Ss),n.triggerChangeEvent())})}},l.prototype.radioButtonRender=function(){var e=this;this.onMonthDay=new P.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("."+ps)),this.monthButtons.push(this.onMonthDay),this.onWeekDay=new P.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("."+gs)),this.monthButtons.push(this.onWeekDay)},l.prototype.numericTextboxRender=function(){var e=this;this.recurrenceCount=new j.NumericTextBox({value:10,format:"#",enableRtl:this.enableRtl,min:1,max:999,change:function(){e.triggerChangeEvent()}}),this.recurrenceCount.appendTo(this.element.querySelector("."+bs)),this.monthDate=new j.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("."+us)),this.repeatInterval=new j.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("."+is))},l.prototype.renderComponent=function(){this.setTemplate(),this.renderDropdowns(),this.renderDatePickers(),this.dayButtonRender(),this.radioButtonRender(),this.numericTextboxRender()},l.prototype.rotateArray=function(e,t){for(var i,n=0;n<t;n++)i=e.shift(),e.push(i)},l.prototype.getEndData=function(){var t=this,i=[];return this.endTypes.forEach(function(e){i.push({text:t.localeObj.getConstant(e),value:e})}),i},l.prototype.getDayPosition=function(e){for(var t=new Date(e.getTime()),i=new Date(e.getTime()),n=e.getDay(),r=[],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},l.prototype.getRepeatData=function(){var t=[],i=this;return this.frequencies.forEach(function(e){t.push({text:i.localeObj.getConstant(e===xs?Rs:e),value:e})}),t},l.prototype.getMonthPosData=function(){var t={first:1,second:2,third:3,fourth:4,last:-1},i=this,n=[];return["first","second","third","fourth","last"].forEach(function(e){n.push({text:i.localeObj.getConstant(e),value:t[""+e]})}),n},l.prototype.getDayData=function(e){var t,i,n=["sun","mon","tue","wed","thu","fri","sat"],r=[];this.rotateArray(n,this.firstDayOfWeek),t="en"===this.locale||"en-US"===this.locale?U.getValue((i="days.stand-alone.")+e,U.getDefaultDateObject(this.getCalendarMode())):(i="main."+this.locale+".dates.calendars."+this.getCalendarMode()+".days.stand-alone."+e,U.getValue(i,U.cldrData));for(var a=0,s=n;a<s.length;a++){var o=s[a],l=U.getValue(o,t);r.push({text:"narrow"===e?l:f(l,"single"),value:Bs[""+o]})}return r},l.prototype.getMonthData=function(){var e,t,i=[];e="en"===this.locale||"en-US"===this.locale?U.getValue(t="months.stand-alone.wide",U.getDefaultDateObject(this.getCalendarMode())):(t="main."+this.locale+".dates.calendars."+this.getCalendarMode()+".months.stand-alone.wide",U.getValue(t,U.cldrData));for(var n=0,r=Object.keys(e);n<r.length;n++){var a=r[n];i.push({text:f(U.getValue(a,e),"single"),value:a})}return i},l.prototype.setTemplate=function(){var e=this.getDayData("narrow"),t=this.getDayData("wide");this.element.innerHTML='<div class="e-editor"><div class="'+$a+" "+hs+'"><input type="text" tabindex="0" class="'+ts+'"label="'+ts.substr(2)+'" /></div><div class="'+$a+" "+ns+" "+ds+'"><table class="'+Es+' e-repeat-content-wrapper" role="none"><tr><td><input type="text" tabindex="0" id="'+this.element.id+"_"+is+'" class="'+is+'"title="'+this.localeObj.getConstant("repeatEvery")+'" /></td><td><span class="'+Vs+'"></span></td></tr></table></div><div class="'+es+" "+rs+" "+hs+'"><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="'+es+" "+as+" "+hs+'"><div class=e-month-expander-label>'+this.localeObj.getConstant("on")+'</div><div class="'+ss+'"><input class="'+os+'" type="text" tabindex="0" title="'+this.localeObj.getConstant("yearExpander")+'"/></div><div class="'+ls+'"><table class="'+Es+' e-month-expand-wrapper" role="none"><tr><td><div class="'+$a+" "+cs+'"><input class="'+ps+'"title="'+this.localeObj.getConstant("monthExpander")+'" type="radio"></div></td><td colspan="2"><div class="'+$a+' e-monthday-element"><input type="text" tabindex="0" id="'+this.element.id+"_"+us+'" class="'+us+'"title="'+this.localeObj.getConstant("on")+'" /></div></td></tr><tr><td><div class="'+$a+" "+cs+'" style="min-width: 30px;margin-bottom:18px;"><input class="'+gs+'"title="'+this.localeObj.getConstant("monthExpander")+'" type="radio"></div></td><td><div class="'+$a+' e-week-position" ><input type="text" tabindex="0" class="'+ms+'"title="'+this.localeObj.getConstant("monthPosition")+'" /></div></td><td><div class="'+$a+' e-day-position"><input type="text" tabindex="0" class="'+vs+'"title="'+this.localeObj.getConstant("monthWeek")+'" /></div></td></tr></table></div></div><div class="'+es+" "+fs+" "+ds+'"><div class="'+$a+' e-end-on-left"><input type="text" tabindex="0" class="'+ys+'"title="'+this.localeObj.getConstant("end")+'" /></div><div class="'+$a+" "+Ts+'" ><input type="text" tabindex="0" class="'+ws+'"title="'+this.localeObj.getConstant(Hs)+'" /></div><div class="'+$a+" "+Ds+'"><input type="text" tabindex="0" id="'+this.element.id+"_"+bs+'" class="'+bs+'"title="'+this.localeObj.getConstant(Ps)+'" /></div></div></div></div>'},l.prototype.getSelectedDaysData=function(){var e="BYDAY=",t=[].slice.call(this.element.querySelectorAll(".e-days button."+Ss)),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+Fs},l.prototype.getSelectedMonthData=function(){var e=this.onWeekDay.checked?"BYDAY="+this.monthWeekDays.value+Fs+"BYSETPOS"+qs+this.monthWeekPos.value+Fs:"BYMONTHDAY="+this.monthDate.value+Fs;return e},l.prototype.getIntervalData=function(){return"INTERVAL="+this.repeatInterval.value+Fs},l.prototype.getEndOnCount=function(){return"COUNT="+this.recurrenceCount.value+Fs},l.prototype.getYearMonthRuleData=function(){return"BYMONTH="+this.monthValue.value+Fs},l.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})}},l.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(Bs);e<t.length;e++){var i=t[e];if(Bs[""+i]===this.ruleObject.day[0]){this.monthWeekDays.setProperties({value:this.ruleObject.day[0]});break}}}},l.prototype.updateUI=function(e,t){switch(this.repeatInterval.setProperties({value:this.ruleObject.interval}),t){case Hs:this.untilDateObj.setProperties({value:this.ruleObject.until});break;case Ps:this.recurrenceCount.setProperties({value:this.ruleObject.count})}switch(e){case Is:this.updateWeekButton(this.ruleObject.day);break;case ks:this.monthValue.setProperties({index:this.ruleObject.month[0]-1}),this.updateMonthUI();break;case Ms:this.updateMonthUI()}},l.prototype.getUntilData=function(){return this.untilDateObj.value?"UNTIL="+Ia(this.untilDateObj.value)+Fs:""},l.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=[]},l.prototype.resetFields=function(){this.startState(xs,this.endTypes[0],this.startDate),this.setDefaultValue()},l.prototype.updateRuleUntilDate=function(e){var t;this.untilDateObj.value&&e&&(t=this.untilDateObj.value,t=new Date(t.getFullYear(),t.getMonth(),t.getDate(),e.getHours(),e.getMinutes(),e.getMilliseconds()),this.untilDateObj.setProperties({value:t}))},l.prototype.getCalendarMode=function(){return U.isNullOrUndefined(this.calendarMode)?"gregorian":this.calendarMode.toLowerCase()},l.prototype.getRuleSummary=function(e){return Yr(e=void 0===e?this.getRecurrenceRule():e,this.localeObj,this.locale,this.calendarMode)},l.prototype.getRecurrenceDates=function(e,t,i,n,r){return r=U.isNullOrUndefined(r)?this.startDate:r,Gr(e,t,i,this.firstDayOfWeek,n,r,this.calendarMode)},l.prototype.getRecurrenceRule=function(){var e="FREQ=";switch(this.repeatType.value){case As:e+="DAILY;";break;case Is:e+="WEEKLY;"+this.getSelectedDaysData();break;case Ms:e+=Ns+Fs+this.getSelectedMonthData();break;case ks:e+="YEARLY;"+this.getSelectedMonthData()+this.getYearMonthRuleData();break;case xs:return""}switch(e+=this.getIntervalData(),this.endType.value){case Hs:e+=this.getUntilData();break;case Ps:e+=this.getEndOnCount()}return e},l.prototype.setRecurrenceRule=function(e,t){if(void 0===t&&(t=this.startDate),e){this.renderStatus=!1,this.ruleObject=ga(e);var i=this.ruleObject.count?Ps:this.ruleObject.until?Hs:Rs;switch(this.ruleObject.freq){case"DAILY":this.startState(As,i,t),this.updateUI(As,i);break;case"WEEKLY":this.startState(Is,i,t),this.updateUI(Is,i);break;case Ns:this.startState(Ms,i,t),this.updateUI(Ms,i);break;case"YEARLY":this.startState(ks,i,t),this.updateUI(ks,i)}this.renderStatus=!0,this.triggerChangeEvent()}else this.repeatType.setProperties({value:xs})},l.prototype.detachInputs=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll("input"));e<t.length;e++){var i=t[e];U.detach(i)}},l.prototype.destroy=function(){if(!this.isDestroyed){this.destroyComponents(),Ka.prototype.destroy.call(this);var e=["e-"+this.getModuleName()];for(this.cssClass&&(e=e.concat(this.cssClass.split(" "))),U.removeClass([this.element],e),this.detachInputs();this.element.firstElementChild;)this.element.removeChild(this.element.firstElementChild)}},l.prototype.getModuleName=function(){return"recurrenceeditor"},l.prototype.getPersistData=function(){return this.addOnPersist([])},l.prototype.render=function(){this.initialize(),this.rtlClass(this.enableRtl),this.renderStatus=!0,this.renderComplete()},l.prototype.onPropertyChanged=function(e,t){for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){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":t.cssClass&&U.removeClass([this.element],t.cssClass.split(" ")),e.cssClass&&U.addClass([this.element],e.cssClass.split(" "));break;case"selectedType":this.repeatType.setProperties({index:this.selectedType});break;case"minDate":this.untilDateObj.setProperties({minDate:this.minDate});break;case"maxDate":this.untilDateObj.setProperties({maxDate:this.maxDate});break;case"value":this.getRecurrenceRule()!==this.value&&this.setRecurrenceRule(this.value);break;case"calendarMode":this.calendarMode=e.calendarMode,this.calendarUtil=fa(e.calendarMode);break;case"locale":case"frequencies":case"firstDayOfWeek":case"endTypes":this.refresh();break;case"dateFormat":this.untilDateObj.setProperties({format:e.dateFormat})}},Ja([U.Property(["none","daily","weekly","monthly","yearly"])],l.prototype,"frequencies",void 0),Ja([U.Property(["never","until","count"])],l.prototype,"endTypes",void 0),Ja([U.Property(0)],l.prototype,"firstDayOfWeek",void 0),Ja([U.Property(new Date)],l.prototype,"startDate",void 0),Ja([U.Property()],l.prototype,"dateFormat",void 0),Ja([U.Property("Gregorian")],l.prototype,"calendarMode",void 0),Ja([U.Property()],l.prototype,"cssClass",void 0),Ja([U.Property()],l.prototype,"value",void 0),Ja([U.Property(new Date(1900,0,1))],l.prototype,"minDate",void 0),Ja([U.Property(new Date(2099,11,31))],l.prototype,"maxDate",void 0),Ja([U.Property(0)],l.prototype,"selectedType",void 0),Ja([U.Event()],l.prototype,"change",void 0),Ja([U.NotifyPropertyChanges],l));function l(e,t){e=Ka.call(this,e,t)||this;return e.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"},e.renderStatus=!1,e.dayButtons=[],e.monthButtons=[],e}var Js="e-field",$s="e-recurrence-container",eo="e-hide",to=(p.prototype.renderEventWindow=function(){this.element=U.createElement("div",{id:this.parent.element.id+"_dialog_wrapper"}),this.parent.element.appendChild(this.element);var e={animationSettings:{effect:"Zoom"},content:this.getEventWindowContent(),cssClass:kn,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=kn+" "+pt,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 M.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(),U.addClass([this.element.parentElement],kn+"-container"),U.EventHandler.add(this.dialogObject.element,"keydown",this.preventEventSave,this),this.applyFormValidation()},p.prototype.renderDialogButtons=function(e){e.buttons=[{buttonModel:{content:this.l10n.getConstant("deleteButton"),cssClass:dn,disabled:!this.parent.eventSettings.allowDeleting||this.parent.readonly},click:this.eventDelete.bind(this)},{buttonModel:{content:this.l10n.getConstant("saveButton"),cssClass:"e-primary "+Qn,isPrimary:!0,disabled:!this.parent.eventSettings.allowAdding||this.parent.readonly},click:this.eventSave.bind(this)},{buttonModel:{cssClass:Xn,content:this.l10n.getConstant("cancelButton")},click:this.dialogClose.bind(this)}]},p.prototype.addEventHandlers=function(){var e=this.element.querySelector(".e-back-icon"),t=this.element.querySelector("."+Gn);!this.parent.isAdaptive||U.isNullOrUndefined(e)||U.isNullOrUndefined(t)||(U.EventHandler.add(e,"click",this.dialogClose,this),U.EventHandler.add(t,"click",this.eventSave,this))},p.prototype.refresh=function(){this.destroy(!0),this.renderEventWindow()},p.prototype.refreshRecurrenceEditor=function(){var e;this.recurrenceEditor&&(e=this.recurrenceEditor.element,this.recurrenceEditor.destroy(),this.createRecurrenceEditor(e))},p.prototype.setRecurrenceEditor=function(e){this.parent.editorTemplate&&(this.recurrenceEditor=e)},p.prototype.openEditor=function(e,t,i,n){var r;switch(this.parent.currentAction=t,this.parent.removeNewEventElement(),this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(!0),this.parent.inlineModule.removeInlineAppointmentElement(),"Add"===t&&(r={},this.cellClickAction=!i,i=this.parent.activeCellsData=e,this.cellClickAction?this.convertToEventData(i,r):(this.parent.activeCellsData={startTime:i.startTime||i[this.fields.startTime],endTime:i.endTime||i[this.fields.endTime],isAllDay:i.isAllDay||i[this.fields.isAllDay],element:i.element,groupIndex:i.groupIndex},r=i),e=r),U.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)),U.isNullOrUndefined(this.parent.editorFooterTemplate)||(this.parent.resetTemplates(["editorFooterTemplate"]),this.dialogObject.footerTemplate=this.getDialogFooter(e)),U.isNullOrUndefined(this.parent.editorHeaderTemplate)&&U.isNullOrUndefined(this.parent.editorFooterTemplate)||(this.dialogObject.dataBind(),this.addEventHandlers()),U.isNullOrUndefined(this.parent.editorTemplate)||this.renderFormElements(this.element.querySelector(".e-schedule-form"),e),!this.parent.isAdaptive&&U.isNullOrUndefined(this.parent.editorTemplate)&&U.removeClass([this.dialogObject.element.querySelector(".e-recurrenceeditor")],d),this.recurrenceEditor&&(this.recurrenceEditor.firstDayOfWeek=this.parent.activeViewOptions.firstDayOfWeek),t){case"Add":this.onCellDetailsUpdate(e,n);break;case"Save":case"EditOccurrence":case"EditSeries":case"EditFollowingEvents":"EditOccurrence"===t&&!this.parent.isAdaptive&&U.isNullOrUndefined(this.parent.editorTemplate)&&U.addClass([this.dialogObject.element.querySelector(".e-recurrenceeditor")],d),this.cellClickAction=!1,this.onEventDetailsUpdate(e)}},p.prototype.setDialogContent=function(){this.dialogObject.content=this.getEventWindowContent(),this.dialogObject.dataBind(),this.applyFormValidation()},p.prototype.setDialogHeader=function(){U.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()},p.prototype.setDialogFooter=function(){U.isNullOrUndefined(this.parent.editorFooterTemplate)?!this.parent.isAdaptive&&U.isNullOrUndefined(this.parent.editorFooterTemplate)?this.renderDialogButtons(this.dialogObject):this.parent.isAdaptive&&U.isNullOrUndefined(this.parent.editorFooterTemplate)&&(this.dialogObject.footerTemplate=null):(this.parent.resetTemplates(["editorFooterTemplate"]),this.dialogObject.footerTemplate=this.getDialogFooter()),this.dialogObject.dataBind()},p.prototype.createAdaptiveHeaderElement=function(e){var t=U.createElement("div",{className:"e-title-header"}),i=U.createElement("div",{className:"e-back-icon e-icons"}),i=(t.appendChild(i),this.getDialogHeader(e)),e=(t.appendChild(i),U.createElement("div",{className:"e-save-icon e-icons"}));return t.appendChild(e),t},p.prototype.getDialogHeader=function(e){var t=this.parent.element.id+"_editorHeaderTemplate",i=document.createElement("div"),e=[].slice.call(this.parent.getEditorHeaderTemplate()(e||{},this.parent,"editorHeaderTemplate",t,!1));return U.append(e,i),i},p.prototype.getDialogFooter=function(e){var t=this.parent.element.id+"_editorFooterTemplate",i=document.createElement("div"),e=[].slice.call(this.parent.getEditorFooterTemplate()(e||{},this.parent,"editorFooterTemplate",t,!1));return U.append(e,i),i},p.prototype.preventEventSave=function(e){this.parent&&!this.parent.allowKeyboardInteraction&&"Enter"===e.code&&(this.isEnterKey=!0)},p.prototype.onBeforeOpen=function(n){var r=this,a=this.eventData[this.fields.endTime].getTime(),e={type:"Editor",data:this.eventData,cancel:!1,element:this.element,target:(this.cellClickAction?this.parent.activeCellsData:this.parent.activeEventData).element},t=(this.cellClickAction&&(e.duration=this.getSlotDuration()),this.getInstance(Qn)),t=(t&&(t.disabled=!(this.cellClickAction?this.parent.eventSettings.allowAdding:this.parent.eventSettings.allowEditing),t.dataBind()),this.getInstance(dn)),s=(t&&(t.disabled=!this.parent.eventSettings.allowDeleting,t.dataBind()),new H.Deferred);return this.parent.trigger(se,e,function(e){var t,i;n.cancel=e.cancel,r.duration=r.cellClickAction?e.duration:null,r.eventData[r.fields.endTime].getTime()!==a||r.cellClickAction||0!==r.eventData[r.fields.endTime].getHours()||0!==r.eventData[r.fields.endTime].getMinutes()||(r.eventData=U.extend({},r.eventData,null,!0),r.trimAllDay(r.eventData)),r.refreshDateTimePicker(r.duration),r.cellClickAction&&e.duration!==r.getSlotDuration()&&U.isNullOrUndefined(r.parent.editorTemplate)&&(t=r.getInstance(Fn),(i=r.getInstance(Un)).value=new Date(t.value.getTime()+xe*e.duration),i.dataBind()),r.parent.editorTemplate&&r.element.querySelector(".e-recurrenceeditor")&&!r.recurrenceEditor&&(r.recurrenceEditor=r.getInstance("e-recurrenceeditor")),s.resolve(n)}),s},p.prototype.onBeforeClose=function(t){var i=this,e=(t.isInteracted&&(this.isCrudAction=!1),{type:"Editor",event:t.event||this.dialogEvent,data:this.eventCrudData,cancel:!1,element:this.element,target:(this.cellClickAction?this.parent.activeCellsData:this.parent.activeEventData).element}),n=new H.Deferred;return this.parent.trigger(oe,e,function(e){t.cancel=e.cancel,e.cancel||(i.isCrudAction&&(t.cancel=i.processCrudActions(e.data),i.isCrudAction=t.cancel),i.isCrudAction)||(i.resetForm(),i.parent.eventBase.focusElement(!0),i.eventCrudData=null),n.resolve(t)}),n},p.prototype.getEventWindowContent=function(){var e=U.createElement("div",{className:"e-form-container"}),t=U.createElement("form",{id:this.parent.element.id+"EditForm",className:Rn,attrs:{onsubmit:"return false;"}});return this.renderFormElements(t),e.appendChild(t),e},p.prototype.renderFormElements=function(e,t){var i=this;if(U.isNullOrUndefined(this.parent.editorTemplate))e.appendChild(this.getDefaultEventWindowContent());else{if(t){this.fieldValidator&&(this.fieldValidator.destroy(),this.fieldValidator=null),this.recurrenceEditor&&(this.recurrenceEditor.destroy(),this.recurrenceEditor=null),this.destroyComponents();for(var n=0,r=[].slice.call(e.children);n<r.length;n++){var a=r[n];U.remove(a)}this.parent.resetTemplates(["editorTemplate"])}var s=this.parent.element.id+"_editorTemplate",t=[].slice.call(this.parent.getEditorTemplate()(t||{},this.parent,"editorTemplate",s,!1));U.append(t,e),this.parent.renderTemplates(function(){i.element&&(i.applyFormValidation(),i.eventCrudData)&&(i.showDetails(i.eventCrudData),i.eventCrudData=null)})}},p.prototype.getDefaultEventWindowContent=function(){var e=this.createDivElement("e-dialog-parent"),t=this.createDivElement("e-title-location-row"),t=(e.appendChild(t),t.appendChild(this.renderTextBox(Ln)),t.appendChild(this.renderTextBox(Nn)),this.createDivElement("e-start-end-row")),t=(e.appendChild(t),t.appendChild(this.renderDateTimePicker(Fn,this.onTimeChange.bind(this))),t.appendChild(this.renderDateTimePicker(Un)),this.createDivElement("e-all-day-time-zone-row")),t=(e.appendChild(t),t.appendChild(this.renderCheckBox(Hn)),t.appendChild(this.renderCheckBox(Pn)),this.createDivElement(zn)),t=(e.appendChild(t),t.appendChild(this.renderDropDown(Yn)),t.appendChild(this.renderDropDown(_n)),this.createDivElement("e-repeat-parent-row")),i=(e.appendChild(t),this.renderCheckBox(jn)),n=U.createElement("span",{className:$s}),r=U.createElement("button",{className:"e-recurrence-edit-button",attrs:{type:"button",title:this.l10n.getConstant("editRecurrence")}});if(this.buttonObj=new P.Button({iconCss:"e-recurrence-edit e-icons",cssClass:"e-medium "+this.parent.cssClass}),n.appendChild(r),this.buttonObj.appendTo(r),i.appendChild(n),t.appendChild(i),this.parent.isAdaptive?U.EventHandler.add(r,"click",this.loadRecurrenceEditor,this):this.createRecurrenceEditor(e),0<this.parent.resourceCollection.length){for(var a=this.createDivElement("e-resources-row"),s=0,o=this.parent.resourceBase.resourceCollection;s<o.length;s++){var l=o[s];a.appendChild(this.renderResourceDetails(l))}e.appendChild(a)}n=this.createDivElement(Bn+"-row"),n.appendChild(this.renderTextBox(Bn)),e.appendChild(n),t=U.createElement("button",{attrs:{type:"hidden",title:"submit",style:"display:none"}});return e.appendChild(t),e},p.prototype.createRecurrenceEditor=function(e){var t=U.createElement("div",{id:this.parent.element.id+"_recurrence_editor"});e.appendChild(t),this.recurrenceEditor=this.renderRecurrenceEditor(),this.recurrenceEditor.appendTo(t),this.updateMinMaxDateToEditor()},p.prototype.createDivElement=function(e){return U.createElement("div",{className:e})},p.prototype.createInputElement=function(e,t,i){return U.createElement(i||"input",{className:e,attrs:{type:"text",name:t,value:"",id:t}})},p.prototype.getSlotDuration=function(){return this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount},p.prototype.renderDateTimePicker=function(e,t){var i=this.createDivElement(e+"-container"),n=this.getFieldName(e),n=this.createInputElement(e+" "+Js,n);return i.appendChild(n),new R.DateTimePicker({change:t,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:(U.isNullOrUndefined(this.parent.dateFormat)?this.getFormat("dateFormats"):this.parent.dateFormat)+" "+this.parent.activeViewOptions.timeFormat,placeholder:this.getFieldLabel(e),step:this.getSlotDuration(),width:"100%"}).appendTo(n),i},p.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()}},p.prototype.onTimeChange=function(){var e,t,i=this.getInstance(Fn);i.element.parentElement.classList.contains("e-input-focus")&&(e=this.getInstance(Un),t=0,this.cellClickAction?(t=xe*this.duration,this.eventWindowTime.startTime=i.value):t=this.eventData[this.fields.endTime].getTime()-this.eventData[this.fields.startTime].getTime(),i=U.isNullOrUndefined(i.value)?null:new Date(i.value.getTime()+t),this.cellClickAction&&(this.eventWindowTime.endTime=i),e.value=i,e.dataBind()),this.recurrenceEditor&&this.recurrenceEditor.updateRuleUntilDate(this.eventWindowTime.startTime)},p.prototype.renderResourceDetails=function(t){function e(e){return U.SanitizeHtmlHelper.sanitize('<div class="e-resource-template"><div class="e-resource-color" style="background-color:'+e[t.colorField]+'"></div><div class="e-resource-text">'+e[t.textField]+"</div></div>")}var i=t.field,n="e-"+i,r=t.title,a=this.createDivElement(n+"-container e-resources"),n=this.createInputElement(n+" "+Js,i);a.appendChild(n);return U.initializeCSPTemplate(e,t),(t.allowMultiple?new L.MultiSelect({enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass||"",dataSource:t.dataSource,change:this.onMultiselectResourceChange.bind(this),itemTemplate:e,fields:{text:t.textField,value:t.idField},htmlAttributes:{name:i},floatLabelType:"Always",placeholder:r,popupHeight:"230px",popupWidth:"447px",mode:"Box"}):new L.DropDownList({cssClass:this.parent.cssClass||"",change:this.onDropdownResourceChange.bind(this),dataSource:t.dataSource,enableRtl:this.parent.enableRtl,fields:{text:t.textField,value:t.idField},htmlAttributes:{name:i},floatLabelType:"Always",placeholder:r,popupHeight:"230px",popupWidth:"447px",itemTemplate:e})).appendTo(n),a},p.prototype.renderDropDown=function(e){var i=this,t=this.getFieldName(e),n=this.createDivElement(e+"-container"),r=this.createInputElement(e+" "+Js,t);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 t=new H.Query,t=""!==e.text?t.where("Text","contains",e.text,!0):t;e.updateData(i.parent.timezoneDataSource,t)},htmlAttributes:{title:this.getFieldLabel(e),name:t},floatLabelType:"Always",placeholder:this.getFieldLabel(e),popupHeight:"230px"}).appendTo(r),n},p.prototype.onMultiselectResourceChange=function(n){if(n.value&&this.parent.activeViewOptions.group.byGroupID&&!(this.parent.resourceCollection.length<=1))for(var r=this.parent.resourceBase.resourceCollection,e=n.element.getAttribute("name")||this.getColumnName(n.element),a=0;a<r.length;a++)if(r[parseInt(a.toString(),10)].field===e&&a<r.length-1){for(var t=this.createInstance(a),s=[],o=this,i=0;i<n.value.length;i++)!function(t){var i=r[a+1],e=i.dataSource.filter(function(e){return e[i.groupIDField]===n.value[parseInt(t.toString(),10)]})[0],e=U.isNullOrUndefined(e)?null:e[r[a+1].groupIDField],e=o.filterDatasource(a,e);s=s.concat(e)}(i);t.dataSource=s,t.dataBind()}},p.prototype.createInstance=function(e){e=this.parent.resourceBase.resourceCollection[e+1],e=this.element.querySelector(".e-"+e.field).ej2_instances[0];return e.clear(),e},p.prototype.onDropdownResourceChange=function(e){if(e.value&&!(this.parent.resourceCollection.length<=1)&&this.parent.activeViewOptions.group.byGroupID)for(var t,i,n=e.element.getAttribute("name")||this.getColumnName(e.element),r=this.parent.resourceBase.resourceCollection,a=0;a<r.length;a++)a<r.length-1&&r[parseInt(a.toString(),10)].field===n&&(t=this.createInstance(a),i=e.itemData[r[parseInt(a.toString(),10)].idField],t.dataSource=this.filterDatasource(a,i),t.dataBind(),i=0<t.dataSource.length?t.dataSource[0][r[a+1].idField]:null,t.value=r[a+1].allowMultiple?[i]:i,t.dataBind())},p.prototype.filterDatasource=function(e,t){var i=this.parent.resourceBase.resourceCollection[e+1];return i.dataSource.filter(function(e){return e[i.groupIDField]===t})},p.prototype.onTimezoneChange=function(e){var t;(e.element.getAttribute("name")||this.getColumnName(e.element))===this.parent.eventFields.startTimezone&&(e=this.getInstance(Yn),(t=this.getInstance(_n)).value=e.value,t.dataBind())},p.prototype.renderCheckBox=function(e){var t=this.createDivElement(e+"-container"),i=this.getFieldName(e),n=this.createInputElement(e+" "+Js,i),e=(t.appendChild(n),new P.CheckBox({change:this.onChange.bind(this),cssClass:e+" "+this.parent.cssClass,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,label:this.getFieldLabel(e)}));return e.appendTo(n),n.setAttribute("name",i),"Repeat"===i&&(this.repeatStatus=e),t},p.prototype.renderTextBox=function(e){var t=this.createDivElement(e+"-container"),i=this.getFieldName(e),i=this.createInputElement(e+" "+Js,i,e===Bn?"textarea":"input");return t.appendChild(i),j.Input.createInput({element:i,floatLabelType:"Always",properties:{enableRtl:this.parent.enableRtl,placeholder:this.getFieldLabel(e)}}),t},p.prototype.getFieldName=function(e){var t="";switch(e){case Ln:t=this.fields.subject;break;case Nn:t=this.fields.location;break;case Fn:t=this.fields.startTime;break;case Un:t=this.fields.endTime;break;case Bn:t=this.fields.description;break;case Hn:t=this.fields.isAllDay;break;case Yn:t=this.fields.startTimezone;break;case _n:t=this.fields.endTimezone;break;case Pn:t="Timezone";break;case jn:t="Repeat"}return t},p.prototype.getFieldLabel=function(e){var t="";switch(e){case Ln:t=this.parent.editorTitles.subject;break;case Nn:t=this.parent.editorTitles.location;break;case Bn:t=this.parent.editorTitles.description;break;case Fn:t=this.parent.editorTitles.startTime;break;case Un:t=this.parent.editorTitles.endTime;break;case Yn:t=this.parent.editorTitles.startTimezone;break;case _n:t=this.parent.editorTitles.endTimezone;break;case jn:t=this.parent.editorTitles.recurrenceRule;break;case Hn:t=this.parent.editorTitles.isAllDay;break;case Pn:t=this.l10n.getConstant("timezone")}return t},p.prototype.onChange=function(e){var t;e.event&&e.event.target&&((t=U.closest(e.event.target,".e-all-day,.e-time-zone,.e-repeat")).classList.contains(Hn)?this.onAllDayChange(e.checked):t.classList.contains(Pn)?this.timezoneChangeStyle(e.checked):t.classList.contains(jn)&&this.onRepeatChange(e.checked))},p.prototype.renderRepeatDialog=function(){var e=U.createElement("div");this.repeatDialogObject=new M.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"))},p.prototype.loadRecurrenceEditor=function(){this.repeatDialogObject.show(),this.recurrenceEditor&&this.repeatRule&&this.recurrenceEditor.setRecurrenceRule(this.repeatRule)},p.prototype.onRepeatChange=function(e){e?(this.repeatDialogObject||this.renderRepeatDialog(),this.recurrenceEditor.setProperties({startDate:this.repeatStartDate,selectedType:0}),this.loadRecurrenceEditor()):(this.repeatDialogObject&&this.repeatDialogObject.hide(),this.repeatRule="",this.recurrenceEditor&&(this.recurrenceEditor.setRecurrenceRule(this.repeatRule),this.updateRepeatLabel(this.repeatRule)),e=this.element.querySelector("."+$s),U.addClass([e],eo))},p.prototype.repeatSaveDialog=function(){this.repeatRule=this.recurrenceEditor.getRecurrenceRule();var e=this.element.querySelector("."+$s);this.recurrenceEditor.getRecurrenceRule()?U.removeClass([e],eo):(U.addClass([e],eo),this.repeatStatus.setProperties({checked:!1})),this.updateRepeatLabel(this.repeatRule),this.closeRepeatDialog()},p.prototype.closeRepeatDialog=function(){this.repeatDialogObject.hide()},p.prototype.repeatCancelDialog=function(){this.closeRepeatDialog(),this.recurrenceEditor&&this.recurrenceEditor.setRecurrenceRule(this.repeatTempRule),this.repeatTempRule||this.repeatStatus.setProperties({checked:!1})},p.prototype.repeatOpenDialog=function(){this.repeatTempRule=this.recurrenceEditor.getRecurrenceRule()},p.prototype.onCellDetailsUpdate=function(e,t){var i;this.parent.eventSettings.allowAdding&&(this.parent.isAdaptive&&t&&!this.repeatDialogObject&&this.renderRepeatDialog(),this.element.querySelector("."+Rn).removeAttribute("data-id"),U.isNullOrUndefined(this.parent.editorHeaderTemplate)&&(this.element.querySelector("."+Kn).innerHTML=this.l10n.getConstant("newEvent")),e.Timezone=!1,this.repeatStartDate=e[this.fields.startTime],this.repeatRule="",U.isNullOrUndefined(this.parent.eventSettings.fields.subject.default)||(e[this.fields.subject]=this.parent.eventSettings.fields.subject.default),U.isNullOrUndefined(this.parent.eventSettings.fields.location.default)||(e[this.fields.location]=this.parent.eventSettings.fields.location.default),U.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]),(i=this.element.querySelector("."+dn))&&U.addClass([i],d),this.recurrenceEditor&&(this.recurrenceEditor.setProperties({startDate:e[this.fields.startTime],selectedType:U.isNullOrUndefined(t)?U.isNullOrUndefined(e[this.fields.recurrenceRule])?0:this.recurrenceEditor.selectedType:t}),this.repeatRule=this.recurrenceEditor.value),this.parent.isAdaptive&&U.isNullOrUndefined(this.parent.editorTemplate)?(i=this.element.querySelector("."+$s),e[this.fields.recurrenceRule]||t?(U.removeClass([i],eo),this.repeatStatus.setProperties({checked:!0})):(U.addClass([i],eo),this.repeatStatus.setProperties({checked:!1})),this.updateRepeatLabel(this.repeatRule)):(e=this.element.querySelector("."+Qn),this.disableButton(e,!1)),this.dialogObject.show())},p.prototype.convertToEventData=function(e,t){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),(0<this.parent.resourceCollection.length||0<this.parent.activeViewOptions.group.resources.length)&&this.parent.resourceBase.setResourceValues(t)},p.prototype.applyFormValidation=function(){var e,t,i,n=this.element.querySelector("."+Rn);n&&(t={},i=(e=function(e){return e&&0<Object.keys(e).length?e:void 0})(this.parent.eventSettings.fields.subject.validation),U.isNullOrUndefined(i)||(t[this.parent.eventSettings.fields.subject.name]=i),i=e(this.parent.eventSettings.fields.location.validation),U.isNullOrUndefined(i)||(t[this.parent.eventSettings.fields.location.name]=i),i=e(this.parent.eventSettings.fields.startTime.validation),U.isNullOrUndefined(i)||(t[this.parent.eventSettings.fields.startTime.name]=i),i=e(this.parent.eventSettings.fields.endTime.validation),U.isNullOrUndefined(i)||(t[this.parent.eventSettings.fields.endTime.name]=i),i=e(this.parent.eventSettings.fields.description.validation),U.isNullOrUndefined(i)||(t[this.parent.eventSettings.fields.description.name]=i),this.fieldValidator=new za,this.fieldValidator.renderFormValidator(n,t,this.element,this.parent.locale))},p.prototype.showDetails=function(e){this.eventData=this.eventCrudData?this.eventData:e;var t=U.extend({},e,null,!0),e=this.getFormElements(kn);if(this.parent.isReact&&e.length<1&&!this.cellClickAction)this.eventCrudData=t;else{this.cellClickAction&&(!this.cellClickAction||U.isNullOrUndefined(this.parent.editorTemplate))||0!==t[this.fields.endTime].getHours()||0!==t[this.fields.endTime].getMinutes()||this.trimAllDay(t);for(var i=Object.keys(t),n=0,r=e;n<r.length;n++){var a=r[n],s=a.name||this.getColumnName(a);U.isNullOrUndefined(s)||""===s||(-1!==i.indexOf(s)?this.setValueToElement(a,t[""+s]):this.setDefaultValueToElement(a))}U.isNullOrUndefined(this.parent.editorTemplate)&&(this.onAllDayChange(t[this.fields.isAllDay]),e=this.getInstance(Pn+"."+Js),U.isNullOrUndefined(t[this.fields.startTimezone])&&U.isNullOrUndefined(t[this.fields.endTimezone])||(e.checked=!0,e.dataBind()),this.timezoneChangeStyle(e.checked),delete t.Timezone)}},p.prototype.getColumnName=function(e){var t,i,n=e.getAttribute("data-name")||"";return n=""===n&&(i=!1,t="",e.classList.contains("e-dropdownlist")?(t="e-ddl",i=!0):e.classList.contains("e-multiselect")?(t="e-multiselect",i=!0):e.classList.contains("e-datetimepicker")?t="e-datetimepicker":e.classList.contains("e-datepicker")?t="e-datepicker":e.classList.contains("e-checkbox")&&(t="e-checkbox"),i=U.closest(e,i?"."+t+":not(.e-control)":"."+t)||e.querySelector("."+t))&&(e=i.querySelector("[name]"))?e.name:n},p.prototype.onAllDayChange=function(e){var t,i=this.getInstance(Fn),n=this.getInstance(Un),r=this.element.querySelector(".e-time-zone-container");e?(t=U.isNullOrUndefined(this.parent.dateFormat)?this.getFormat("dateFormats"):this.parent.dateFormat,U.addClass(this.element.querySelectorAll(".e-time-icon"),Zn),U.addClass([r],d),this.element.querySelector("."+zn)&&U.removeClass([this.element.querySelector("."+zn)],ut)):(t=U.isNullOrUndefined(this.parent.dateFormat)?this.getFormat("dateFormats")+" "+this.parent.activeViewOptions.timeFormat:this.parent.dateFormat+" "+this.parent.activeViewOptions.timeFormat,U.removeClass(this.element.querySelectorAll(".e-time-icon"),Zn),U.removeClass([r],d),this.element.querySelector(".e-checkbox-wrapper .e-time-zone").checked&&U.addClass([this.element.querySelector("."+zn)],ut)),i.format=n.format=t,this.cellClickAction&&this.updateDateTime(e,i,n),i.dataBind(),n.dataBind(),U.isNullOrUndefined(this.recurrenceEditor)||this.recurrenceEditor.updateRuleUntilDate(i.value)},p.prototype.updateDateTime=function(e,t,i){var n,r;e?(r=W(new Date(this.eventWindowTime.startTime.getTime())),n=this.parent.activeCellsData.isAllDay?(e=z(new Date(this.eventWindowTime.endTime.getTime()),-1).getTime(),+this.eventWindowTime.startTime>e?this.eventWindowTime.endTime:new Date(e)):W(new Date(this.eventWindowTime.endTime.getTime()))):(e=this.parent.activeCellsData.startTime,(r=new Date(this.eventWindowTime.startTime.getTime())).setHours(e.getHours(),e.getMinutes(),e.getSeconds()),this.parent.activeCellsData.isAllDay?(e=this.parent.getStartEndTime(this.parent.workHours.start),r.setHours(e.getHours(),e.getMinutes(),e.getSeconds()),(n=new Date(r.getTime())).setMilliseconds(xe*this.getSlotDuration())):(n=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(n.getTime())},t.value=r,i.value=n,t.dataBind(),i.dataBind()},p.prototype.getFormat=function(e){e=U.isNullOrUndefined(this.parent.locale)||"en"===this.parent.locale||"en-US"===this.parent.locale?U.getValue(e+".short",U.getDefaultDateObject(this.parent.getCalendarMode())):U.getValue("main."+this.parent.locale+".dates.calendars."+this.parent.getCalendarMode()+"."+e+".short",U.cldrData);return e},p.prototype.onEventDetailsUpdate=function(e){var t,i;this.parent.eventSettings.allowEditing&&(!this.parent.isAdaptive&&U.isNullOrUndefined(this.parent.editorFooterTemplate)&&U.removeClass([this.element.querySelector("."+dn)],d),U.isNullOrUndefined(this.parent.editorHeaderTemplate)&&(this.element.querySelector("."+Kn).innerHTML=this.l10n.getConstant("editEvent")),this.element.querySelector("."+Rn).setAttribute("data-id",e[this.fields.id].toString()),U.isNullOrUndefined(this.parent.editorTemplate)&&(e=U.extend({},e,null,!0),t=this.getInstance(Pn+"."+Js),i=void 0,e[this.fields.startTimezone]||e[this.fields.endTimezone]?(i=!0,this.parent.eventBase.timezoneConvert(e)):i=!1,e.Timezone=i,t.checked=i,t.dataBind()),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&&U.isNullOrUndefined(this.parent.editorTemplate)&&(i=this.element.querySelector("."+$s),e[this.fields.recurrenceRule]?(U.removeClass([i],eo),this.repeatStatus.setProperties({checked:!0})):(U.addClass([i],eo),this.repeatStatus.setProperties({checked:!1})),this.updateRepeatLabel(this.repeatRule)),t=this.parent.readonly||e[this.fields.isReadonly],this.parent.isAdaptive?(i=this.element.querySelector("."+Gn))&&(t?U.addClass([i],Tr):U.removeClass([i],Tr)):(e=this.element.querySelector("."+Qn),i=this.element.querySelector("."+dn),this.disableButton(e,t),this.disableButton(i,t)),this.dialogObject.show())},p.prototype.disableButton=function(e,t){e&&(e.ej2_instances[0].disabled=t)},p.prototype.renderRecurrenceEditor=function(){return new Zs({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})},p.prototype.updateMinMaxDateToEditor=function(){var e=this.element.querySelector(".e-start"),t=this.element.querySelector(".e-end");e&&t&&(e=e.ej2_instances[0],t=t.ej2_instances[0],e.min=this.parent.minDate,e.max=this.parent.maxDate,t.min=this.parent.minDate,t.max=this.parent.maxDate,e.dataBind(),t.dataBind()),this.recurrenceEditor&&(e=this.recurrenceEditor.element.querySelector(".e-until-date"))&&((t=e.ej2_instances[0]).min=this.parent.minDate,t.max=this.parent.maxDate,t.dataBind())},p.prototype.updateRepeatLabel=function(e){this.parent.isAdaptive&&!this.repeatDialogObject&&this.renderRepeatDialog();e=e?this.l10n.getConstant("repeats")+" "+this.recurrenceEditor.getRuleSummary(e):this.l10n.getConstant("repeat");this.repeatStatus.setProperties({label:e})},p.prototype.dialogClose=function(e){this.isEnterKey?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())},p.prototype.resetForm=function(){this.fieldValidator.destroyToolTip(),this.resetFormFields(),this.parent.isAdaptive||!this.recurrenceEditor||this.recurrenceEditor.isDestroyed||this.recurrenceEditor.resetFields()},p.prototype.timezoneChangeStyle=function(e){var t,i,n=this.element.querySelector("."+zn),r=this.parent.tzModule.getLocalTimezoneName();e?(U.addClass([n],ut),e=this.getInstance(Yn),t=this.getInstance(_n),i=e.dataSource,e.value&&this.parent.timezone||i.some(function(e){return e.Value===r})||(i.push({Value:r,Text:r}),e.dataSource=i,t.dataSource=i,e.dataBind(),t.dataBind()),e.value=e.value||this.parent.timezone||r,t.value=t.value||this.parent.timezone||r,e.dataBind(),t.dataBind()):U.removeClass([n],ut)},p.prototype.resetFormFields=function(){for(var e=0,t=this.getFormElements(kn);e<t.length;e++){var i=t[e],n=i.name||this.getColumnName(i);U.isNullOrUndefined(n)||""===n||this.setDefaultValueToElement(i)}},p.prototype.eventSave=function(e,t){var i;this.isEnterKey?this.isEnterKey=!1:(i=this.element.querySelector("."+Rn))&&i.classList.contains("e-formvalidator")&&!i.ej2_instances[0].validate()||(i=this.getEventDataFromEditor(),this.processEventValidation(i.tempData,t))||(this.eventCrudData=i.eventData,this.dialogEvent=e,this.isCrudAction=!0,this.dialogObject.hide())},p.prototype.getEventDataFromEditor=function(){var e=U.extend({},this.getObjectFromFormData(kn)),t=(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,U.extend({},e,null,!0));return e[this.fields.isAllDay]&&(e[this.fields.startTime]=U.isNullOrUndefined(e[this.fields.startTime])?null:W(new Date(e[this.fields.startTime].getTime())),e[this.fields.endTime]=U.isNullOrUndefined(e[this.fields.endTime])?null:z(W(new Date(e[this.fields.endTime].getTime())),1)),{eventData:e,tempData:t}},p.prototype.processEventValidation=function(e,t){var i;if(U.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){var n=!0;if("seriesChangeAlert"===(i="EditOccurrence"!==this.parent.currentAction?this.recurrenceValidation(e[this.fields.startTime],e[this.fields.endTime],t):i)&&this.parent.uiStateValues.isIgnoreOccurrence&&(n=!1),!U.isNullOrUndefined(i)&&n&&(!this.parent.enableRecurrenceValidation&&"wrongPattern"===i||this.parent.enableRecurrenceValidation))return this.parent.quickPopup.openRecurrenceValidationAlert(i),!0}return!1},p.prototype.processCrudActions=function(e){var t=this,i=(this.parent.uiStateValues.isBlock=!1,this.getResourceData(e)),i=(0<this.parent.activeViewOptions.group.resources.length||0<this.parent.resourceCollection.length)&&!this.parent.activeViewOptions.group.allowGroupEdit&&!U.isNullOrUndefined(i),n=this.getEventIdFromForm();if(U.isNullOrUndefined(n))this.parent.currentAction="Add",i?this.resourceSaveEvent(e,this.parent.currentAction):(e[this.fields.id]=this.parent.eventBase.getEventMaxID(),this.parent.addEvent(e));else{var r="string"===this.parent.eventBase.getEventIDType()?n:parseInt(n,10),n=this.parent.eventsData.filter(function(e){return e[t.fields.id]===r})[0];if(U.isNullOrUndefined(n)&&(n=this.parent.blockData.filter(function(e){return e[t.fields.id]===r})[0]),(e=U.extend({},n,e))[this.fields.isReadonly])return!1;var a=void 0;if(!U.isNullOrUndefined(n[this.fields.recurrenceRule])){if(a=this.parent.currentAction,e.Guid=this.parent.activeEventData.event.Guid,"EditOccurrence"===this.parent.currentAction&&(e[this.fields.recurrenceID]?(r=e[this.fields.recurrenceID],a=null):(e[this.fields.id]=this.parent.eventBase.getEventMaxID(),e.Guid=this.parent.activeEventData.event.Guid),this.parent.enableRecurrenceValidation)&&this.editOccurrenceValidation(r,e))return!0;"EditSeries"===this.parent.currentAction||e[this.fields.id]!==n[this.fields.id]?e[this.fields.recurrenceID]=n[this.fields.id]:"EditFollowingEvents"===this.parent.currentAction&&(e[this.fields.id]=this.parent.eventBase.getEventMaxID(),e[this.fields.followingID]=n[this.fields.id])}i?this.resourceSaveEvent(e,"Save",a):this.parent.saveEvent(e,a)}return this.parent.uiStateValues.isBlock},p.prototype.getResourceData=function(e){var t=null;return t=!U.isNullOrUndefined(this.parent.resourceBase)&&!U.isNullOrUndefined(this.parent.resourceBase.resourceCollection)&&0<this.parent.resourceBase.resourceCollection.length?e[this.parent.resourceBase.resourceCollection.slice(-1)[0].field]:t},p.prototype.getObjectFromFormData=function(e){for(var t={},i=0,n=this.getFormElements(e);i<n.length;i++){var r=n[i],a=r.name||this.getColumnName(r);U.isNullOrUndefined(a)||""===a||(t[""+a]=this.getValueFromElement(r))}return t},p.prototype.setDefaultValueToObject=function(e){U.isNullOrUndefined(e[this.fields.subject])||(e[this.fields.subject]=e[this.fields.subject]||this.parent.eventSettings.fields.subject.default||this.l10n.getConstant("addTitle")),U.isNullOrUndefined(e[this.fields.location])||(e[this.fields.location]=e[this.fields.location]||this.parent.eventSettings.fields.location.default),U.isNullOrUndefined(e[this.fields.description])||(e[this.fields.description]=e[this.fields.description]||this.parent.eventSettings.fields.description.default)},p.prototype.recurrenceValidation=function(e,t,i){var n,r=this.recurrenceEditor,a=this.getInstance("e-repeat-interval.e-numerictextbox").value;if(i!==this.l10n.getConstant("ok")){var s,o,i=this.parent.activeEventData.event,l=[];if("EditSeries"!==this.parent.currentAction&&"EditFollowingEvents"!==this.parent.currentAction||U.isNullOrUndefined(i)||(s=i[this.parent.eventFields.startTime],l=0<(o=this.parent.eventBase.getSeriesEvents(this.eventData,s)).length?this.parent.eventBase.getEditedOccurrences(o,s):(o=this.parent.eventBase.getEventById(i[this.parent.eventFields.id]),this.parent.eventBase.getEditedOccurrences([o],s)),"EditSeries"!==this.parent.currentAction)||U.isNullOrUndefined(this.eventData[this.parent.eventFields.recurrenceException])||l.push(this.eventData),0<l.length&&(n="seriesChangeAlert"),"until"===this.getInstance("e-end-on-left .e-ddl .e-dropdownlist").value&&this.getInstance("e-end-on-date .e-datepicker").value<e&&(n="wrongPattern"),U.isNullOrUndefined(n)){r.value.split(";")[1].split("=")[1].split(",");var p={SU:0,MO:1,TU:2,WE:3,TH:4,FR:5,SA:6},c=[],h=[];switch(r.value.split(";")[0].split("=")[1]){case"DAILY":(t.getTime()-e.getTime())/36e5>24*a&&(n="createError");break;case"WEEKLY":for(var d=r.value.split(";")[1].split("=")[1].split(","),u=0;u<d.length*(a+1);u++)c[parseInt(u.toString(),10)]=d.length>u?p[d[parseInt(u.toString(),10)]]:c[u-d.length]+7*a;for(var g=c.sort(function(e,t){return e-t}),u=1;u<g.length;u++)h.push(g[parseInt(u.toString(),10)]-g[u-1]);((t.getTime()-e.getTime())/36e5>=24*Math.min.apply(Math,h)||U.isNullOrUndefined(a))&&(n="createError");break;case"MONTHLY":t.getTime()>=new Date(+e).setMonth(e.getMonth()+a)&&(n="createError");break;case"YEARLY":t.getTime()>=new Date(+e).setFullYear(e.getFullYear()+a)&&(n="createError")}}}else t.getTime()>=new Date(+e).setMonth(e.getMonth()+a)&&(n="createError"),U.isNullOrUndefined(n)&&this.parent.quickPopup.quickDialog.hide();return n=U.isNullOrUndefined(a)?"createError":n},p.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},p.prototype.trimAllDay=function(e){var t;e[this.fields.isAllDay]&&(t=z(new Date(+e[this.fields.endTime]),-1).getTime(),e[this.fields.endTime]=+e[this.fields.startTime]>t?e[this.fields.endTime]:new Date(t))},p.prototype.editOccurrenceValidation=function(t,e,i){var n=this,r=(void 0===i&&(i=this.eventData),this.parent.getOccurrencesByID(t));this.parent.eventsData.filter(function(e){return e[n.fields.recurrenceID]===t}).map(function(e){return r.push(U.extend({},e))}),e=U.extend({},e),this.trimAllDay(e);for(var a=0,s=r;a<s.length;a++){var o=s[a];this.trimAllDay(o)}this.parent.eventBase.sortByTime(r);i=this.getRecurrenceIndex(r,i);if(!U.isNullOrUndefined(i)){var l,p,c=new Date(+e[this.fields.startTime]),e=new Date(+e[this.fields.endTime]),h=(i!==r.length-1&&(l=new Date(+r[i+1][this.fields.startTime]),p=new Date(+r[i+1][this.fields.endTime])),new Date(+r[r.length-1][this.fields.endTime]));if(0===i){if(!U.isNullOrUndefined(r[i+1])){if(!(l.getTime()>=e.getTime())&&W(h).getTime()>=W(c).getTime()||W(h).getTime()<W(c).getTime())return this.parent.quickPopup.openRecurrenceValidationAlert("occurrenceAlert"),!0;if(!(W(c).getTime()<W(l).getTime()))return this.parent.quickPopup.openRecurrenceValidationAlert("sameDayAlert"),!0}}else{var d=new Date(+r[i-1][this.fields.startTime]),u=new Date(+r[i-1][this.fields.endTime]);if(i===r.length-1){if(W(new Date(+r[r.length-1-i][this.fields.startTime])).getTime()>W(c).getTime())return this.parent.quickPopup.openRecurrenceValidationAlert("occurrenceAlert"),!0;if(!(u.getTime()<=c.getTime()&&W(c).getTime()>W(d).getTime()))return this.parent.quickPopup.openRecurrenceValidationAlert("sameDayAlert"),!0}else{if(!(W(d).getTime()<W(c).getTime()||W(new Date(+r[0][this.fields.startTime])).getTime()>W(c).getTime())||!(W(l).getTime()>W(c).getTime()||h.getTime()<c.getTime()))return this.parent.quickPopup.openRecurrenceValidationAlert("sameDayAlert"),!0;if(!(u.getTime()<=c.getTime()&&l.getTime()>=e.getTime())||W(p).getTime()<W(c).getTime()||W(d).getTime()>W(e).getTime()||!(W(c).getTime()<W(l).getTime()))return this.parent.quickPopup.openRecurrenceValidationAlert("occurrenceAlert"),!0}}}return!1},p.prototype.resourceSaveEvent=function(g,m,v){for(var f=this,y=this.parent.resourceBase.resourceCollection.slice(-1)[0],T=((T=g[y.field])instanceof Array?T:[T]).reverse(),w=this.parent.resourceBase.lastResourceLevel,D=[],e=function(i){function e(){if("Save"===m&&i===T.length-1)if(0<r.length){r[0][f.fields.id]=g[f.fields.id];for(var e=1;e<r.length;e++)r[parseInt(e.toString(),10)][f.fields.id]=f.parent.eventBase.getEventMaxID(i),D.push(r[parseInt(e.toString(),10)]),f.parent.saveEvent(r[0],v)}else n[f.fields.id]=g[f.fields.id],f.parent.saveEvent(n,v);else if(0<r.length)for(var t=0;t<r.length;t++)r[parseInt(t.toString(),10)][f.fields.id]=f.parent.eventBase.getEventMaxID(t),D.push(r[parseInt(t.toString(),10)]);else n[f.fields.id]=f.parent.eventBase.getEventMaxID(i),D.push(n)}var n=U.extend({},g,null,!0),r=(n[b.fields.id]=b.parent.eventBase.getEventMaxID(),[]);if(b.parent.activeViewOptions.group.byGroupID&&!U.isNullOrUndefined(w)){var t=y.dataSource,a=b.parent.resourceCollection,s=void 0;if((s=1<a.length?Je(t,y.idField,T[parseInt(i.toString(),10)],n,a):Je(t,y.idField,T[parseInt(i.toString(),10)]))<0)return{value:void 0};for(var o=t[parseInt(s.toString(),10)][y.groupIDField],l=w.filter(function(e){return e.resourceData[y.idField]===T[parseInt(i.toString(),10)]}).filter(function(e){return e.resourceData[y.groupIDField]===o})[0].groupOrder,p=0;p<b.parent.resourceBase.resourceCollection.length;p++){var c=b.parent.resourceBase.resourceCollection[parseInt(p.toString(),10)].field;n[""+c]=l[parseInt(p.toString(),10)]instanceof Array?l[parseInt(p.toString(),10)][0]:l[parseInt(p.toString(),10)]}}else{for(s=0;s<b.parent.resourceBase.resourceCollection.length-1;s++){c=b.parent.resourceBase.resourceCollection[parseInt(s.toString(),10)].field;if(n[""+c]instanceof Array&&1<n[""+c].length)for(var h=0;h<n[""+c].length;h++){var d=U.extend({},n,null,!0);d[""+c]=g[""+c][parseInt(h.toString(),10)],d[y.field]=T[parseInt(i.toString(),10)],r.push(d)}else if(0===r.length)n[""+c]=g[""+c]instanceof Array?g[""+c][0]:g[""+c],n[y.field]=T[parseInt(i.toString(),10)];else for(var u=0;u<r.length;u++)r[parseInt(u.toString(),10)][""+c]=g[""+c]instanceof Array?g[""+c][0]:g[""+c]}n[y.field]=T[parseInt(i.toString(),10)]}e()},b=this,t=0;t<T.length;t++){var i=e(t);if("object"==typeof i)return i.value}if(0<D.length){for(var n=0,r=D;n<r.length;n++){var a=r[n];a[this.fields.recurrenceException]=null,a[this.fields.recurrenceID]=null}this.parent.addEvent(D)}},p.prototype.getEventIdFromForm=function(){return this.element.querySelector("."+Rn).getAttribute("data-id")},p.prototype.getFormElements=function(e){return e===kn?[].slice.call(this.element.querySelectorAll("."+Js)):[].slice.call(this.parent.element.querySelectorAll("."+e+" ."+Js))},p.prototype.getValueFromElement=function(e){e=e.classList.contains("e-datepicker")||e.classList.contains("e-datetimepicker")||e.classList.contains("e-dropdownlist")||e.classList.contains("e-multiselect")?e.ej2_instances[0].value:e.classList.contains("e-checkbox")?e.ej2_instances[0].checked:"checkbox"===e.type?e.checked:this.parent.enableHtmlSanitizer?U.SanitizeHtmlHelper.sanitize(e.value):e.value;return e},p.prototype.setValueToElement=function(e,t){var i;e.classList.contains("e-datepicker")?((i=e.ej2_instances[0]).value=t,i.dataBind()):e.classList.contains("e-datetimepicker")?((i=e.ej2_instances[0]).element.classList.contains(Fn)?this.eventWindowTime.startTime=new Date(""+t):this.eventWindowTime.endTime=new Date(""+t),i.value=t,i.dataBind()):e.classList.contains("e-dropdownlist")?((i=e.ej2_instances[0]).value=t,i.dataBind()):e.classList.contains("e-multiselect")?((i=e.ej2_instances[0]).value=[],i.value=t instanceof Array?t:[t],i.dataBind()):e.classList.contains("e-checkbox")?((i=e.ej2_instances[0]).checked=t,i.dataBind()):"checkbox"!==e.type?e.value=t||"":e.checked=t},p.prototype.setDefaultValueToElement=function(e){var t,i;e.classList.contains("e-datepicker")?((i=e.ej2_instances[0]).value=this.parent.getCurrentTime(),i.dataBind()):e.classList.contains("e-datetimepicker")?(i=e.ej2_instances[0],t=this.parent.getCurrentTime(),this.eventWindowTime={startTime:t,endTime:t},i.value=t,i.dataBind()):e.classList.contains("e-dropdownlist")?((i=e.ej2_instances[0]).value=null,i.dataBind()):e.classList.contains("e-multiselect")?((i=e.ej2_instances[0]).value=[],i.dataBind()):e.classList.contains("e-checkbox")?((i=e.ej2_instances[0]).checked=!1,i.dataBind()):"checkbox"===e.type?e.checked=!1:e.value=""},p.prototype.getInstance=function(e){e=this.element.querySelector("."+e);return e?e.ej2_instances[0]:null},p.prototype.eventDelete=function(e){if(this.isEnterKey)this.isEnterKey=!1;else{switch(this.parent.currentAction){case"EditOccurrence":U.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":U.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()}},p.prototype.getRecurrenceEditorInstance=function(){return this.parent.isAdaptive&&!this.repeatDialogObject&&this.renderRepeatDialog(),this.recurrenceEditor},p.prototype.destroyComponents=function(){for(var e=0,t=this.getFormElements(kn);e<t.length;e++){var i=t[e],n=void 0;(n=i.classList.contains("e-datetimepicker")||i.classList.contains("e-datepicker")||i.classList.contains("e-checkbox")||i.classList.contains("e-dropdownlist")||i.classList.contains("e-multiselect")||i.classList.contains("e-numerictextbox")?i.ej2_instances:n)&&n[0]&&n[0].destroy()}this.buttonObj&&this.buttonObj.destroy()},p.prototype.detachComponents=function(){for(var e=0,t=this.getFormElements(kn);e<t.length;e++){var i=t[e];U.detach(i)}},p.prototype.destroy=function(e){var t;this.parent&&!this.parent.isDestroyed&&this.parent.resetTemplates(["editorTemplate","editorHeaderTemplate","editorFooterTemplate"]),this.destroyComponents(),this.recurrenceEditor&&(this.recurrenceEditor.destroy(),U.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&&(this.dialogObject.element&&(et(t=this.dialogObject.element.querySelector("form")),U.detach(t),U.EventHandler.remove(this.dialogObject.element,"keydown",this.preventEventSave)),this.dialogObject.destroy(),this.dialogObject=null),this.element&&(U.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)},p);function p(e){this.parent=e,this.l10n=this.parent.localeObj,this.fields=this.parent.eventFields,this.eventWindowTime={startTime:new Date,endTime:new Date},this.renderEventWindow()}c.prototype.addEventListener=function(){!this.parent||this.parent&&this.parent.isDestroyed||this.parent.on(Ce,this.virtualScrolling,this)},c.prototype.removeEventListener=function(){!this.parent||this.parent&&this.parent.isDestroyed||this.parent.off(Ce,this.virtualScrolling)},c.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},c.prototype.renderVirtualTrack=function(e){var t,i=U.createElement("div",{className:yi});this.isHorizontalScroll?(t=this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-1].length,i.style.width=t*this.itemSize+"px"):i.style.height=this.parent.resourceBase.expandedResources.length*this.itemSize+"px",e.appendChild(i)},c.prototype.updateVirtualScrollHeight=function(){var e=this.parent.element.querySelector("."+yi),t=this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].groupIndex;this.parent.resourceBase.renderedResources[this.parent.resourceBase.renderedResources.length-1].groupIndex!==t?(t=this.parent.element.querySelector("."+S),this.renderedLength=t.querySelector("tbody").children.length,e.style.height=t.offsetHeight+(this.parent.resourceBase.expandedResources.length-this.renderedLength)*t.offsetHeight/this.renderedLength+"px",(t=this.parent.element.querySelector("."+I)).scrollHeight-t.scrollTop<t.offsetHeight*this.bufferCount&&(e.style.height=parseInt(e.style.height,10)+t.offsetHeight*this.bufferCount+"px")):e.style.height="",this.averageRowHeight=e.offsetHeight/this.parent.resourceBase.expandedResources.length},c.prototype.updateVirtualTrackHeight=function(e){var t,i,n,r=this.parent.resourceBase.renderedResources.length;r!==this.getRenderedCount()?(e.style.height=this.parent.element.querySelector(".e-content-wrap").clientHeight+"px",i=this.parent.element.querySelector("."+Ht),n=this.parent.element.querySelector("."+I),t=this.parent.element.querySelector("."+Mt),this.translateY=0,this.setTranslate(i,n,t)):(i=this.parent.resourceBase.renderedResources[r-1].groupIndex,n=(n=r+(this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].groupIndex-i))>this.parent.resourceBase.expandedResources.length?this.parent.resourceBase.expandedResources.length:n,e.style.height=n*this.itemSize+"px")},c.prototype.setItemSize=function(){this.isHorizontalScroll?this.itemSize=Ie(this.parent.activeView.element,O)||this.itemSize:this.itemSize=Ae(this.parent.activeView.element,O)||this.itemSize},c.prototype.refreshLayout=function(){var e,t,i,n=this.parent.uiStateValues.scheduleHeight,r=(this.parent.uiStateValues.scheduleHeight=this.parent.element.offsetHeight,this.renderedLength);this.parent.uiStateValues.scheduleHeight!==n&&(r<this.getRenderedCount()&&(this.isRemoteRefresh=!0),n=this.parent.element.querySelector("."+Ht),r=this.parent.element.querySelector("."+I),e=this.parent.element.querySelector("."+Mt),i=(t=(i=parseInt(n.querySelector("tbody td").getAttribute("data-group-index"),10))+this.renderedLength)>this.parent.resourceBase.expandedResources.length?this.parent.resourceBase.expandedResources.length-this.renderedLength:i,this.parent.resourceBase.renderedResources=this.parent.resourceBase.expandedResources.slice(i=i<0?0:i,t),0<this.parent.resourceBase.renderedResources.length)&&this.updateContent(n,r,e,this.parent.resourceBase.renderedResources)},c.prototype.renderEvents=function(){this.setTabIndex();var e=this.triggerScrollEvent(fe);if(this.parent.activeViewOptions&&this.parent.activeViewOptions.enableLazyLoading&&this.parent.crudModule)return 0<e.length?(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(De,{}),this.parent.hideSpinner()},c.prototype.virtualScrolling=function(){var e,t,i,n,r,a,s=this,o=(this.parent.quickPopup&&(this.parent.quickPopup.quickPopupHide(),this.parent.quickPopup.morePopup.hide()),this.parent.element.querySelector("."+I));this.isHorizontalScroll?this.horizontalScrolling(o):(e=this.parent.element.querySelector("."+Ht),t=this.parent.element.querySelector("."+Mt),i=this.parent.element.querySelector("."+Gt),a=this.parent.element.querySelector("."+S),this.parent.rowAutoHeight||U.addClass([o,e],"e-transition"),this.renderedLength=e.querySelector("tbody").children.length,n=parseInt(e.querySelector("tbody td").getAttribute("data-group-index"),10),a=this.parent.rowAutoHeight?a.offsetHeight-o.offsetHeight:this.bufferCount*this.itemSize,r=[],o.scrollTop-this.translateY<0?r=this.upScroll(o,n):o.scrollTop-this.translateY>a&&(r=this.downScroll(o,n)),!U.isNullOrUndefined(r)&&0<r.length&&(this.triggerScrollEvent(ve),a=this.parent.getSelectedCells(),this.focusedEle=a[a.length-1]||this.focusedEle,this.updateContent(e,o,t,r),this.setTranslate(e,o,t,i),this.parent.dragAndDropModule&&"drag"===this.parent.dragAndDropModule.actionObj.action&&this.parent.dragAndDropModule.navigationWrapper(),window.clearTimeout(this.timeValue),this.timeValue=window.setTimeout(function(){s.renderEvents()},250)))},c.prototype.horizontalScrolling=function(e){var t=this,i=[],n=this.bufferCount*this.itemSize;Math.abs(e.scrollLeft)-Math.abs(this.translateY)<0?i=this.leftScroll(e):Math.abs(e.scrollLeft)-Math.abs(this.translateY)>n&&(i=this.rightScroll(e)),!U.isNullOrUndefined(i)&&0<i.length&&(this.parent.resourceBase.expandedResources.length===i.length&&this.parent.resourceBase.expandedResources[0]===i[0]&&this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1]===i[i.length-1]||(this.triggerScrollEvent(ve),n=this.parent.activeView.colLevels.slice(0),this.updateHorizontalContent(e,i),U.setStyleAttribute(e.querySelector("table"),{transform:"translateX("+this.translateY+"px)"}),this.parent.activeView.colLevels=n,this.parent.dragAndDropModule&&"drag"===this.parent.dragAndDropModule.actionObj.action&&this.parent.dragAndDropModule.navigationWrapper()),window.clearTimeout(this.timeValue),this.timeValue=window.setTimeout(function(){t.renderEvents()},250))},c.prototype.triggerScrollEvent=function(t){var e,i=this,n=[];return this.parent.activeView&&(e={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:t},this.parent.trigger(t,e,function(e){t===ve?i.parent.showSpinner():t===fe&&!U.isNullOrUndefined(e.eventData)&&0<e.eventData.length&&(n=e.eventData)})),n},c.prototype.upScroll=function(e,t){var i=0,i=~~(e.scrollTop/this.itemSize)+Math.ceil(e.clientHeight/this.itemSize)-this.renderedLength,i=(this.parent.rowAutoHeight&&(i=t<i?t-this.bufferCount:i),this.getBufferCollection(i=0<i?i:0,i+this.renderedLength));return this.parent.resourceBase.renderedResources=i,0===t?this.translateY=e.scrollTop:(t=0<(t=this.parent.rowAutoHeight?this.averageRowHeight:this.itemSize)?t:this.itemSize,this.translateY=0<e.scrollTop-this.bufferCount*t?e.scrollTop-this.bufferCount*t:0),i},c.prototype.downScroll=function(e,t){var i;return this.parent.resourceBase.renderedResources[this.parent.resourceBase.renderedResources.length-1].groupIndex===this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length-1].groupIndex?null:(i=0,i=~~(e.scrollTop/this.itemSize),t=(t=(i=this.parent.rowAutoHeight?(i=~~((e.scrollTop-this.translateY)/this.averageRowHeight)+t)>t+this.bufferCount?i:t+this.bufferCount:i)+this.renderedLength)>this.parent.resourceBase.expandedResources.length?i+(this.parent.resourceBase.expandedResources.length-i):t,i=this.getBufferCollection(t-this.renderedLength,t),this.translateY=e.scrollTop,i)},c.prototype.leftScroll=function(e){e=~~(Math.abs(e.scrollLeft)/this.itemSize)+Math.ceil(e.clientWidth/this.itemSize)-this.renderedLength;return this.getCollection(e=0<e?e:0,e+this.renderedLength)},c.prototype.rightScroll=function(e){var t=this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-1],e=(e=~~(Math.abs(e.scrollLeft)/this.itemSize)+this.renderedLength)>t.length-1?t.length-1:e;return this.getCollection(e-this.renderedLength,e)},c.prototype.getCollection=function(e,t){this.translateY=e*this.itemSize;e=this.getResCollection(e,t);return this.parent.enableRtl&&(this.translateY=-this.translateY),e},c.prototype.getResCollection=function(e,t){var i=this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-1],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},c.prototype.getByDateCollection=function(t,i,e){var n=this.parent.activeView.colLevels[0].filter(function(e){return t.date.getTime()<=e.date.getTime()&&e.date.getTime()<=i.date.getTime()});return this.setStartEndIndex(this.parent.activeView.colLevels[0],n[0],n[n.length-1],e),n},c.prototype.getByIdCollection=function(t,i,e){var n=this.parent.resourceBase.lastResourceLevel.filter(function(e){return t.groupIndex<=e.groupIndex&&e.groupIndex<=i.groupIndex});return this.parent.resourceBase.renderedResources=n,this.setStartEndIndex(this.parent.resourceBase.lastResourceLevel,n[0],n[n.length-1],e),n},c.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)},c.prototype.updateContent=function(e,t,i,n){var r=e.querySelector("tbody").children.length;document.activeElement&&document.activeElement.classList.contains(Ut)&&(this.isResourceCell=!0,this.parent.element.focus());for(var a=0;a<r;a++)U.remove(e.querySelector("tbody tr")),U.remove(t.querySelector("tbody tr")),U.remove(i.querySelector("div"));this.parent.resourceBase.renderedResources=n;var s=this.parent.resourceBase.getContentRows(n,!0),o=this.parent.activeView.getContentRows(),n=this.parent.activeView.getEventRows(n.length);U.append(s,e.querySelector("tbody")),U.append(o,t.querySelector("tbody")),U.append(n,i)},c.prototype.updateHorizontalContent=function(e,t){this.parent.resourceBase.expandedResources=t;for(var i=this.parent.getSelectedCells(),n=(this.focusedEle=i[i.length-1]||this.focusedEle,e.querySelectorAll("tbody tr").length),r=0;r<n;r++)U.remove(e.querySelector("tbody tr"));if("Month"===this.parent.currentView){this.parent.activeViewOptions.group.byDate?this.parent.activeView.colLevels[0]=t:this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-2]=t;var a=this.parent.activeView.getContentRows()}else{for(var s=[].slice.call(e.querySelector("colgroup").children),r=0;r<s.length;r++)U.remove(s[parseInt(r.toString(),10)]);this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-1]=t;var a=this.parent.activeView.getContentRows(),i=e.querySelector("table"),o=e.querySelector("thead"),l=e.querySelector("colgroup");t.forEach(function(){l.appendChild(U.createElement("col"))}),o.appendChild(this.parent.eventBase.createEventWrapper("",0<this.startIndex?this.startIndex:0)),this.parent.activeViewOptions.timeScale.enable&&o.appendChild(this.parent.eventBase.createEventWrapper("timeIndicator")),U.prepend([o],i)}U.append(a,e.querySelector("tbody"))},c.prototype.getBufferCollection=function(e,t){return this.parent.resourceBase.expandedResources.slice(e,t)},c.prototype.setTranslate=function(e,t,i,n){U.setStyleAttribute(e.querySelector("table"),{transform:"translateY("+this.translateY+"px)"}),U.setStyleAttribute(t.querySelector("table"),{transform:"translateY("+this.translateY+"px)"}),U.setStyleAttribute(i,{transform:"translateY("+this.translateY+"px)"}),U.isNullOrUndefined(n)||U.setStyleAttribute(n,{transform:"translateY("+this.translateY+"px)"})},c.prototype.updateFocusedWorkCell=function(){var e,t;this.focusedEle&&(t=parseInt(this.focusedEle.getAttribute("data-date"),10),e=parseInt(this.focusedEle.getAttribute("data-group-index"),10),(t=this.parent.element.querySelector("."+O+'[data-date="'+t+'"][data-group-index="'+e+'"]'))&&this.parent.addSelectedClass([t],t,!0),this.focusedEle=null)},c.prototype.setRenderedDates=function(e){var t,i,n;"Month"!==this.parent.currentView?(t=e.map(function(e){return e.date}),this.parent.resourceBase.renderedResources.forEach(function(e){return e.renderDates=t})):(i=e.map(function(e){return e.date.getDay()}),n=this.parent.activeView.renderDates.filter(function(e){return 0<=i.indexOf(e.getDay())}),this.parent.resourceBase.renderedResources.forEach(function(e){return e.renderDates=n}))},c.prototype.setTabIndex=function(){var t=this.parent.element.querySelector("."+Ht),e=[].slice.call(this.parent.element.querySelectorAll("."+Ut)),e=(e&&t&&e.forEach(function(e){e.getBoundingClientRect().top>=t.getBoundingClientRect().top&&e.setAttribute("tabindex","0")}),this.parent.element.querySelector("."+Ut+'[tabindex="0"]'));this.isResourceCell&&e&&(e.focus(),this.isResourceCell=!1)},c.prototype.destroy=function(){this.removeEventListener(),this.focusedEle=null};var io=c;function c(e){this.translateY=0,this.itemSize=60,this.bufferCount=3,this.renderedLength=0,this.averageRowHeight=0,this.startIndex=0,this.parent=e,this.addEventListener()}ro.prototype.render=function(e,t){void 0===t&&(t=!0),this.initializeLayout(e),this.parent.activeView&&t&&this.parent.crudModule.refreshDataManager()},ro.prototype.initializeLayout=function(e){switch(this.parent.activeView&&(t=["cellTemplate","tooltipTemplate","majorSlotTemplate","minorSlotTemplate","headerTooltipTemplate","dateHeaderTemplate","dayHeaderTemplate","monthHeaderTemplate","headerIndentTemplate","resourceHeaderTemplate","cellHeaderTemplate","dateRangeTemplate"],0<this.parent.activeEventTemplates.length?(t=t.concat(this.parent.activeEventTemplates),this.parent.activeEventTemplates=[]):t.push("eventTemplate"),this.parent.resetTemplates(t),this.parent.activeView.removeEventListener(),this.parent.activeView.destroy()),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,U.isNullOrUndefined(this.parent.activeView)||(this.parent.activeView.viewClass="e-timeline-day-view");break;case"TimelineWorkWeek":this.parent.activeView=this.parent.timelineViewsModule,U.isNullOrUndefined(this.parent.activeView)||(this.parent.activeView.viewClass="e-timeline-work-week-view");break;case"TimelineWeek":this.parent.activeView=this.parent.timelineViewsModule,U.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(U.isNullOrUndefined(this.parent.activeView)){var t=this.parent.viewCollections[0].option;if(t)return this.parent.setProperties({currentView:t},!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(t);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=0<this.parent.activeViewOptions.group.resources.length&&(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&&0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(this.parent.virtualScrollModule=new io(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(Ot),this.parent.renderTemplates(),this.parent.eventTooltip&&(this.parent.eventTooltip.destroy(),this.parent.eventTooltip=null),(this.parent.eventSettings.enableTooltip||0<this.parent.activeViewOptions.group.resources.length&&this.parent.activeViewOptions.group.headerTooltipTemplate)&&(this.parent.eventTooltip=new Ga(this.parent))},ro.prototype.updateHeader=function(){this.parent.headerModule&&(this.parent.headerModule.setDayOfWeek(this.parent.activeViewOptions.firstDayOfWeek),this.parent.activeViewOptions.readonly?U.addClass([this.parent.element],br):this.parent.element.classList.contains(br)&&U.removeClass([this.parent.element],br),this.parent.headerModule.updateDateRange(),this.parent.headerModule.updateHeaderItems("remove"))},ro.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")};var no=ro;function ro(e){this.parent=e}ao=function(e,t){return(ao=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var ao,so,Za=function(e,t){function i(){this.constructor=e}ao(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Ja=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;0<=o;o--)(r=e[o])&&(s=(a<3?r(s):3<a?r(t,i,s):r(t,i))||s);return 3<a&&s&&Object.defineProperty(t,i,s),s},Za=(so=U.ChildProperty,Za(oo,so),Ja([U.Property(!0)],oo.prototype,"highlight",void 0),Ja([U.Property("09:00")],oo.prototype,"start",void 0),Ja([U.Property("18:00")],oo.prototype,"end",void 0),oo);function oo(){return null!==so&&so.apply(this,arguments)||this}lo=function(e,t){return(lo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var lo,po,Ja=function(e,t){function i(){this.constructor=e}lo(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},co=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;0<=o;o--)(r=e[o])&&(s=(a<3?r(s):3<a?r(t,i,s):r(t,i))||s);return 3<a&&s&&Object.defineProperty(t,i,s),s},Ja=(po=U.ChildProperty,Ja(ho,po),co([U.Property(!0)],ho.prototype,"enable",void 0),co([U.Property(60)],ho.prototype,"interval",void 0),co([U.Property(2)],ho.prototype,"slotCount",void 0),co([U.Property()],ho.prototype,"minorSlotTemplate",void 0),co([U.Property()],ho.prototype,"majorSlotTemplate",void 0),ho);function ho(){return null!==po&&po.apply(this,arguments)||this}uo=function(e,t){return(uo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var uo,go,co=function(e,t){function i(){this.constructor=e}uo(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},mo=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;0<=o;o--)(r=e[o])&&(s=(a<3?r(s):3<a?r(t,i,s):r(t,i))||s);return 3<a&&s&&Object.defineProperty(t,i,s),s},co=(go=U.ChildProperty,co(vo,go),mo([U.Property("Both")],vo.prototype,"templateType",void 0),mo([U.Property()],vo.prototype,"header",void 0),mo([U.Property()],vo.prototype,"content",void 0),mo([U.Property()],vo.prototype,"footer",void 0),vo);function vo(){return null!==go&&go.apply(this,arguments)||this}fo=function(e,t){return(fo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var fo,yo,mo=function(e,t){function i(){this.constructor=e}fo(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},To=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;0<=o;o--)(r=e[o])&&(s=(a<3?r(s):3<a?r(t,i,s):r(t,i))||s);return 3<a&&s&&Object.defineProperty(t,i,s),s},mo=(yo=U.ChildProperty,mo(wo,yo),To([U.Property()],wo.prototype,"option",void 0),To([U.Property()],wo.prototype,"template",void 0),wo);function wo(){return null!==yo&&yo.apply(this,arguments)||this}bo.prototype.getQuery=function(){var e=this.parent.activeView.startDate(),t=this.parent.activeView.endDate();return this.parent.dataModule.generateQuery(e,t)},bo.prototype.getTable=function(){return this.parent.eventSettings.query?this.parent.eventSettings.query.clone().fromTable:null},bo.prototype.refreshDataManager=function(){var e,t,i=this;this.parent.activeView&&(this.parent.uiStateValues&&this.parent.uiStateValues.isPreventEventRefresh?(this.parent.uiStateValues.isPreventEventRefresh=!1,this.parent.refreshEvents(!1),this.parent.hideSpinner()):(e=this.parent.activeView.startDate(),t=this.parent.activeView.endDate(),this.parent.dataModule.getData(this.parent.dataModule.generateQuery(e,t)).then(function(e){return i.dataManagerSuccess(e)}).catch(function(e){return i.dataManagerFailure(e)})))},bo.prototype.dataManagerSuccess=function(e){var t=this;!this.parent||this.parent&&this.parent.isDestroyed||this.parent.trigger(re,e,function(e){e.cancel||(e=U.extend([],e.result,null,!0),t.parent.eventsData=e.filter(function(e){return!e[t.parent.eventFields.isBlock]}),t.parent.blockData=e.filter(function(e){return e[t.parent.eventFields.isBlock]}),t.refreshProcessedData(),t.parent.dragAndDropModule&&"drag"===t.parent.dragAndDropModule.actionObj.action&&t.parent.dragAndDropModule.navigationWrapper(),t.parent.trigger(ae,null,function(){t.parent.hideSpinner(),t.parent.isPrinting&&setTimeout(function(){t.parent.notify(ye,{})},100)}))})},bo.prototype.dataManagerFailure=function(e){var t=this;!this.parent||this.parent&&this.parent.isDestroyed||this.parent.trigger(J,{error:e},function(){return t.parent.hideSpinner()})},bo.prototype.refreshProcessedData=function(e,t){if(void 0===e&&(e=!1),this.parent.dragAndDropModule&&(this.parent.dragAndDropModule.actionObj.action="",U.removeClass([this.parent.element],"e-event-action")),this.parent.activeViewOptions&&this.parent.activeViewOptions.eventTemplate){var i=["eventTemplate"];if(this.crudObj.isCrudAction&&-1===["Agenda","MonthAgenda","Year","TimelineYear"].indexOf(this.parent.currentView))for(var i=[],n=0,r=this.crudObj.sourceEvent.length;n<r;n++)i.push("eventTemplate_"+this.crudObj.sourceEvent[parseInt(n.toString(),10)].groupIndex),this.crudObj.targetEvent[parseInt(n.toString(),10)]&&this.crudObj.sourceEvent[parseInt(n.toString(),10)].groupIndex!==this.crudObj.targetEvent[parseInt(n.toString(),10)].groupIndex&&i.push("eventTemplate_"+this.crudObj.targetEvent[parseInt(n.toString(),10)].groupIndex);0<i.length&&this.parent.resetTemplates(i)}e?this.parent.notify(Te,{processedData:t?this.parent.eventBase.processData(t):this.parent.eventsProcessed}):(e=this.parent.eventsData||[],t=this.parent.blockData||[],e=e.concat(t),this.parent.notify(Te,{processedData:this.parent.eventBase?this.parent.eventBase.processData(e):[]}))},bo.prototype.refreshData=function(i){var t=this,e={requestType:i.requestType,cancel:!1,data:i.data,addedRecords:i.editParams.addedRecords,changedRecords:i.editParams.changedRecords,deletedRecords:i.editParams.deletedRecords};if(this.parent.dragAndDropModule&&this.parent.dragAndDropModule.actionObj&&this.parent.dragAndDropModule.actionObj.element&&(this.parent.dragAndDropModule.actionObj.element.style.display="none"),this.parent.resizeModule&&this.parent.resizeModule.actionObj&&this.parent.resizeModule.actionObj.element&&(this.parent.resizeModule.actionObj.element.style.display="none"),this.parent.isSpecificResourceEvents()&&("eventCreated"===i.requestType||"eventRemoved"===i.requestType)){this.crudObj.isCrudAction=!0,this.crudObj.sourceEvent=[];for(var n=i.data instanceof Array?0===i.data.length&&"eventRemoved"===i.requestType?i.editParams.deletedRecords:i.data:"string"!=typeof i.data&&"number"!=typeof i.data||"eventRemoved"!==i.requestType?[i.data]:i.editParams.deletedRecords,r=this,a=0,s=n;a<s.length;a++)!function(e){r.crudObj.isCrudAction=!("eventRemoved"===i.requestType&&!U.isNullOrUndefined(e.parent));var t=r.parent.eventBase.getGroupIndexFromEvent(e);-1<t&&0===r.parent.crudModule.crudObj.sourceEvent.filter(function(e){return e.groupIndex===t}).length&&r.crudObj.isCrudAction&&r.crudObj.sourceEvent.push(r.parent.resourceBase.lastResourceLevel[parseInt(t.toString(),10)])}(s[a]);this.crudObj.targetEvent=this.crudObj.sourceEvent}this.parent.dataModule.dataManager.dataSource.offline?this.parent.trigger(Z,e,function(e){e.cancel||t.refreshDataManager()}):i.promise.then(function(){!t.parent||t.parent&&t.parent.isDestroyed||t.parent.trigger(Z,e,function(e){e.cancel||t.refreshDataManager()})}).catch(function(e){!t.parent||t.parent&&t.parent.isDestroyed||t.parent.trigger(J,{error:e})})},bo.prototype.addEvent=function(e){var o=this;this.parent.eventSettings.allowAdding&&!this.parent.activeViewOptions.readonly&&(!this.isBlockEvent(e)&&this.parent.eventBase.isBlockRange(e)?this.parent.quickPopup.openValidationError("blockAlert",e):0!==(e=e instanceof Array?e:[e]).length&&this.parent.trigger(K,{requestType:"eventCreate",cancel:!1,data:e,addedRecords:e,changedRecords:[],deletedRecords:[]},function(e){if(!e.cancel){var t=o.parent.eventFields,i={addedRecords:[],changedRecords:[],deletedRecords:[]},n=void 0;if(e.addedRecords instanceof Array){for(var r=0,a=e.addedRecords;r<a.length;r++){var s=a[r],s=o.parent.eventBase.updateEventDateTime(s),s=U.extend({},o.parent.eventBase.processTimezone(s,!0),null,!0);i.addedRecords.push(s)}n=o.parent.dataModule.dataManager.saveChanges(i,t.id,o.getTable(),o.getQuery())}else{t=o.parent.eventBase.processTimezone(e.addedRecords,!0);i.addedRecords.push(t),n=o.parent.dataModule.dataManager.insert(t,o.getTable(),o.getQuery())}t={requestType:"eventCreated",cancel:!1,data:e.addedRecords,promise:n,editParams:i};o.refreshData(t)}}))},bo.prototype.saveEvent=function(e,t){var l=this;if(this.parent.eventSettings.allowEditing&&!this.parent.activeViewOptions.readonly)if("EditFollowingEvents"!==this.parent.currentAction&&!this.isBlockEvent(e)&&this.parent.eventBase.isBlockRange(e))this.parent.quickPopup.openValidationError("blockAlert",e),this.parent.crudModule.crudObj.isCrudAction=!1;else{var i=e instanceof Array?e:[e];if(0!==i.length)if(this.parent.currentAction=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 this.parent.trigger(K,{requestType:"eventChange",cancel:!1,data:e,addedRecords:[],changedRecords:i,deletedRecords:[]},function(e){if(!e.cancel){var t=void 0,i=l.parent.eventFields,n={addedRecords:[],changedRecords:[],deletedRecords:[]};if(e.changedRecords instanceof Array){for(var r=0,a=e.changedRecords;r<a.length;r++){var s=a[r],s=l.parent.eventBase.updateEventDateTime(s),s=U.extend({},l.parent.eventBase.processTimezone(s,!0),null,!0);n.changedRecords.push(s)}t=l.parent.dataModule.dataManager.saveChanges(n,i.id,l.getTable(),l.getQuery())}else{var o=l.parent.eventBase.processTimezone(e.changedRecords,!0);n.changedRecords.push(o),t=l.parent.dataModule.dataManager.update(i.id,o,l.getTable(),l.getQuery())}i=U.extend({},e.changedRecords[e.changedRecords.length-1],null,!0),o=(l.parent.eventBase.selectWorkCellByTime([l.parent.eventBase.processTimezone(i)]),{requestType:"eventChanged",cancel:!1,data:e.changedRecords,promise:t,editParams:n});l.refreshData(o)}})}},bo.prototype.deleteEvent=function(t,e){var r=this;if(this.parent.eventSettings.allowDeleting&&!this.parent.activeViewOptions.readonly){this.parent.currentAction=e;var i=[],i="string"==typeof t||"number"==typeof t?this.parent.eventsData.filter(function(e){return e[r.parent.eventFields.id]===t}):t instanceof Array?t:[t];if(0!==i.length)if(e)switch(e){case"Delete":this.processDelete(i);break;case"DeleteOccurrence":this.processOccurrences(i,e);break;case"DeleteFollowingEvents":this.processFollowSeries(i,e);break;case"DeleteSeries":this.processEntireSeries(i,e)}else this.parent.trigger(K,{requestType:"eventRemove",cancel:!1,data:t,addedRecords:[],changedRecords:[],deletedRecords:i},function(e){var t,i,n;e.cancel||(i=void 0,n=r.parent.eventFields,t={addedRecords:[],changedRecords:[],deletedRecords:[]},i=1<e.deletedRecords.length?(t.deletedRecords=t.deletedRecords.concat(e.deletedRecords),r.parent.dataModule.dataManager.saveChanges(t,n.id,r.getTable(),r.getQuery())):(t.deletedRecords.push(e.deletedRecords[0]),r.parent.dataModule.dataManager.remove(n.id,e.deletedRecords[0],r.getTable(),r.getQuery())),r.parent.eventBase.selectWorkCellByTime(e.deletedRecords),n={requestType:"eventRemoved",cancel:!1,data:e.deletedRecords,promise:i,editParams:t},r.refreshData(n))})}},bo.prototype.processOccurrences=function(e,c){var h=this,r=[],d=!1;if(e instanceof Array)for(var t=0,i=e;t<i.length;t++){var n=i[t];r.push({occurrence:n,parent:this.getParentEvent(n)})}else r={occurrence:e,parent:this.getParentEvent(e)};e=e instanceof Array?e:[e],e={requestType:"EditOccurrence"===c?"eventChange":"eventRemove",cancel:!1,addedRecords:[],changedRecords:e,deletedRecords:[]};e.data=r,this.parent.trigger(K,e,function(s){if(!s.cancel){for(var o=h.parent.eventFields,l={addedRecords:[],changedRecords:[],deletedRecords:[]},p=r instanceof Array?r:[r],e=0,t=s.changedRecords.length;e<t;e++)!function(e){var t,i,n=s.changedRecords[parseInt(e.toString(),10)],r=p[parseInt(e.toString(),10)].parent,a=r[o.recurrenceException];switch(c){case"EditOccurrence":t=h.parent.eventsProcessed.filter(function(e){return e.Guid===n.Guid})[0],((i=h.excludeDateCheck(t[o.startTime],a))!==r[o.recurrenceException]?(r[o.recurrenceException]=i,n[o.recurrenceException]=Ia(t[o.startTime]),n[o.recurrenceID]=r[o.id],n[o.followingID]=null,l.changedRecords.push(h.parent.eventBase.processTimezone(r,!0)),l.addedRecords):l.changedRecords).push(h.parent.eventBase.processTimezone(n,!0));break;case"DeleteOccurrence":n[o.recurrenceException]||(r[o.recurrenceException]=h.excludeDateCheck(n[o.startTime],a),l.changedRecords.push(h.parent.eventBase.processTimezone(r,!0))),n[o.id]!==r[o.id]&&(l.deletedRecords.push(n),d=!0)}}(e);var i=h.parent.dataModule.dataManager.saveChanges(l,o.id,h.getTable(),h.getQuery()),n=U.extend({},s.changedRecords[s.changedRecords.length-1],null,!0),n=(h.parent.eventBase.selectWorkCellByTime("EditOccurrence"===c?[h.parent.eventBase.processTimezone(n)]:[n]),{requestType:"EditOccurrence"===c?"eventChanged":"eventRemoved",cancel:!1,data:d?s.deletedRecords:s.changedRecords,promise:i,editParams:l});h.refreshData(n)}})},bo.prototype.processFollowSeries=function(e,c){var h=this,r=[];if(e instanceof Array)for(var t=0,i=e;t<i.length;t++){var n=i[t];r.push({occurrence:n,parent:this.getParentEvent(n)})}else r={occurrence:e,parent:this.getParentEvent(e)};e=e instanceof Array?e:[e],e={requestType:"EditFollowingEvents"===c?"eventChange":"eventRemove",cancel:!1,addedRecords:[],changedRecords:e,deletedRecords:[]};e.data=r,this.parent.trigger(K,e,function(s){if(!s.cancel){for(var o=h.parent.eventFields,l={addedRecords:[],changedRecords:[],deletedRecords:[]},p=r instanceof Array?r:[r],e=0,t=s.changedRecords.length;e<t;e++)!function(e){var t,i,n=s.changedRecords[parseInt(e.toString(),10)],r=p[parseInt(e.toString(),10)].parent,a=h.parent.eventBase.getEventCollections(r,n);switch(c){case"EditFollowingEvents":h.processRecurrenceRule(r,n),t=!h.parent.eventBase.isFollowingEvent(r,n),n[o.followingID]=t?null:r[o.id],n[o.recurrenceID]=null,l.addedRecords.push(h.parent.eventBase.processTimezone(n,!0)),l.changedRecords.push(h.parent.eventBase.processTimezone(r,!0)),h.parent.uiStateValues.isIgnoreOccurrence||(n[o.recurrenceException]=null,0<a.occurrence.length&&-1===(i=a.occurrence.slice(-1)[0][o.recurrenceRule]).indexOf("COUNT")&&(n[o.recurrenceRule]=i),0<a.follow.length&&(n[o.recurrenceRule]=a.follow.slice(-1)[0][o.recurrenceRule],l.deletedRecords=l.deletedRecords.concat(a.follow)),t&&(a.occurrence=a.occurrence.filter(function(e){return e[o.recurrenceID]===r[o.id]})),l.deletedRecords=l.deletedRecords.concat(a.occurrence));break;case"DeleteFollowingEvents":h.processRecurrenceRule(r,n[o.startTime]),l.changedRecords.push(h.parent.eventBase.processTimezone(r,!0)),l.deletedRecords=l.deletedRecords.concat(a.occurrence).concat(a.follow)}}(e);var i=h.parent.dataModule.dataManager.saveChanges(l,o.id,h.getTable(),h.getQuery()),n=U.extend({},s.changedRecords[s.changedRecords.length-1],null,!0),n=(h.parent.eventBase.selectWorkCellByTime("EditFollowingEvents"===c?[h.parent.eventBase.processTimezone(n)]:[n]),{requestType:"EditFollowingEvents"===c?"eventChanged":"eventRemoved",cancel:!1,data:s.changedRecords,promise:i,editParams:l});h.refreshData(n)}})},bo.prototype.processEntireSeries=function(e,p){var c=this,r=[],h=!1;if(e instanceof Array)for(var t=0,i=e;t<i.length;t++){var n=i[t];r.push(this.getParentEvent(n,!0))}else r=this.getParentEvent(e,!0);e=e instanceof Array?e:[e],e={requestType:"EditSeries"===p?"eventChange":"eventRemove",cancel:!1,addedRecords:[],changedRecords:e,deletedRecords:[]};e.data=r,this.parent.trigger(K,e,function(a){if(!a.cancel){for(var s=c.parent.eventFields,o={addedRecords:[],changedRecords:[],deletedRecords:[]},l=r instanceof Array?r:[r],e=0,t=a.changedRecords.length;e<t;e++)!function(e){var t,i=a.changedRecords[parseInt(e.toString(),10)],n=l[parseInt(e.toString(),10)],e=c.parent.eventBase.getEventCollections(n),r=e.follow.concat(e.occurrence);switch(p){case"EditSeries":i[s.id]=n[s.id],i[s.recurrenceID]=null,i[s.followingID]=null,c.parent.uiStateValues.isIgnoreOccurrence&&i[s.recurrenceException]?0<(t=c.parent.eventsData.filter(function(e){return e[s.id]===i[s.id]})).length&&(i[s.recurrenceRule]=t[0][s.recurrenceRule]):(i[s.recurrenceException]=null,o.deletedRecords=o.deletedRecords.concat(r)),o.changedRecords.push(c.parent.eventBase.processTimezone(i,!0)),c.parent.uiStateValues.isIgnoreOccurrence=!1;break;case"DeleteSeries":o.deletedRecords=o.deletedRecords.concat(r.concat(n)),h=!0}}(e);var i=c.parent.dataModule.dataManager.saveChanges(o,s.id,c.getTable(),c.getQuery()),n=U.extend({},a.changedRecords[a.changedRecords.length-1],null,!0),n=(c.parent.eventBase.selectWorkCellByTime("EditSeries"===p?[c.parent.eventBase.processTimezone(n)]:[n]),{requestType:"EditSeries"===p?"eventChanged":"eventRemoved",cancel:!1,data:h?a.deletedRecords:a.changedRecords,promise:i,editParams:o});c.refreshData(n)}})},bo.prototype.processDelete=function(e){for(var p=this,c=[],t=0,i=e;t<i.length;t++){var n=i[t];n[this.parent.eventFields.recurrenceRule]?c.push({occurrence:n,parent:this.getParentEvent(n)}):c.push(n)}e={requestType:"eventRemove",cancel:!1,addedRecords:[],changedRecords:[],deletedRecords:e};e.data=c,this.parent.trigger(K,e,function(s){if(!s.cancel){for(var o=p.parent.eventFields,l={addedRecords:[],changedRecords:[],deletedRecords:[]},e=0,t=s.deletedRecords.length;e<t;e++)!function(e){var t,i,n,r,a=U.isNullOrUndefined(s.deletedRecords[parseInt(e.toString(),10)][p.parent.eventFields.recurrenceRule]);a||(t=c[parseInt(e.toString(),10)].parent,i=l.changedRecords.filter(function(e){return e[o.id]===t[o.id]}),n=s.deletedRecords[parseInt(e.toString(),10)][o.startTime],0<i.length?(r=i[0])[o.recurrenceException]=p.excludeDateCheck(n,r[o.recurrenceException]):t[o.recurrenceException]=p.excludeDateCheck(n,t[o.recurrenceException]),0===i.length&&l.changedRecords.push(p.parent.eventBase.processTimezone(t,!0)),a=s.deletedRecords[parseInt(e.toString(),10)][o.id]!==t[o.id]),a&&l.deletedRecords.push(s.deletedRecords[parseInt(e.toString(),10)])}(e);var i=p.parent.dataModule.dataManager.saveChanges(l,o.id,p.getTable(),p.getQuery()),i=(p.parent.eventBase.selectWorkCellByTime(s.deletedRecords),{requestType:"eventRemoved",cancel:!1,data:s.deletedRecords,promise:i,editParams:l});p.refreshData(i)}})},bo.prototype.processSave=function(e){for(var c=this,e=e instanceof Array?e:[e],t=[],i=0,n=e;i<n.length;i++){var r=n[i];r[this.parent.eventFields.recurrenceRule]?t.push({occurrence:r,parent:this.getParentEvent(r)}):t.push(r)}e={requestType:"eventChange",cancel:!1,addedRecords:[],changedRecords:e,deletedRecords:[]};e.data=t,this.parent.trigger(K,e,function(e){if(!e.cancel){for(var t=c.parent.eventFields,i={addedRecords:[],changedRecords:[],deletedRecords:[]},n=0,r=e.changedRecords;n<r.length;n++){var a,s,o=r[n];!U.isNullOrUndefined(o[t.recurrenceRule])&&U.isNullOrUndefined(o[t.recurrenceException])?(a=Ia(o[t.startTime]),(s=c.getParentEvent(o))[t.recurrenceException]=U.isNullOrUndefined(s[t.recurrenceException])?a:s[t.recurrenceException].concat(","+a),o[t.id]=c.parent.getEventMaxID(),o[t.recurrenceException]=a,i.addedRecords.push(c.parent.eventBase.processTimezone(o,!0)),i.changedRecords.push(c.parent.eventBase.processTimezone(s,!0))):i.changedRecords.push(c.parent.eventBase.processTimezone(o,!0))}var l=c.parent.dataModule.dataManager.saveChanges(i,t.id,c.getTable(),c.getQuery()),p=U.extend({},e.changedRecords[e.changedRecords.length-1],null,!0),p=(c.parent.eventBase.selectWorkCellByTime([c.parent.eventBase.processTimezone(p)]),{requestType:"eventChanged",cancel:!1,data:e.changedRecords,promise:l,editParams:i});c.refreshData(p)}})},bo.prototype.getParentEvent=function(e,t){t=this.parent.eventBase.getParentEvent(e,t=void 0===t?!1:t)||e;return(t[this.parent.eventFields.startTimezone]||t[this.parent.eventFields.endTimezone])&&this.parent.eventBase.timezoneConvert(t),t},bo.prototype.excludeDateCheck=function(e,t){var i=this.parent.timezone||this.parent.tzModule.getLocalTimezoneName(),i=Ia(e=i?this.parent.tzModule.remove(new Date(+e.getTime()),i):e);return U.isNullOrUndefined(t)?t=i:-1===t.indexOf(i)&&(t=U.isNullOrUndefined(t)?i:t+","+i),t},bo.prototype.processRecurrenceRule=function(e,t){var i,n,r,a,s=this.parent.eventFields,o=e[s.recurrenceRule];t instanceof Date?i=new Date(+t):(i=new Date(+t[s.startTime]),(n=t[s.recurrenceRule])&&(a=Gr(r=e[s.startTime],n,"DeleteFollowingEvents"===this.parent.currentAction?t[s.recurrenceException]:null,this.parent.activeViewOptions.firstDayOfWeek),(a=new Date(a.slice(-1)[0])).setHours(i.getHours(),i.getMinutes(),i.getSeconds()),i.setHours(r.getHours(),r.getMinutes(),r.getSeconds()),t[s.recurrenceRule]=this.getUpdatedRecurrenceRule(n,new Date(+a),!1))),e[s.recurrenceRule]=this.getUpdatedRecurrenceRule(o,z(new Date(i.getTime()),-1),!0)},bo.prototype.getUpdatedRecurrenceRule=function(e,t,i){for(var n="",r=0,a=e.split(";");r<a.length;r++){var s,o,l=a[r];""!==l&&(s=l.split("=")[0],o=l.split("=")[1],"COUNT"!==s&&"UNTIL"!==s||(o=Ia(t),l=l.replace(l,"UNTIL="+o)),n+=l+";")}return i&&-1===n.indexOf("UNTIL")&&(n+="UNTIL="+Ia(t)),n},bo.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},bo.prototype.destroy=function(){this.crudObj=null,this.parent=null};var Do=bo;function bo(e){this.parent=e,this.crudObj={sourceEvent:null,targetEvent:null,isCrudAction:!1}}So.prototype.cellMouseDown=function(e){this.isPreventAction(e)||this.parent.notify(Ve,{event:e})},So.prototype.cellClick=function(e){var i,n,t,r,a,s=this;this.isPreventAction(e)||(i=U.closest(e.target,".e-work-cells,.e-all-day-cells,.e-header-cells"),U.isNullOrUndefined(i))||(U.isNullOrUndefined(U.closest(e.target,"."+Pi))?(n=i.classList.contains(O)||i.classList.contains(v),this.parent.uiStateValues.isTapHold&&!this.parent.uiStateValues.action&&n&&(this.parent.uiStateValues.isTapHold=!1,this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.selectedElements=[]),r=U.closest(e.target,"."+Oi),t=this.parent.getNavigateView(),a=this.parent.currentView===t,U.isNullOrUndefined(r)||a||U.isNullOrUndefined(this.parent.viewOptions[t.charAt(0).toLowerCase()+t.slice(1)])?this.parent.activeViewOptions.readonly&&"MonthAgenda"!==this.parent.currentView?this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide():this.parent.isAdaptive&&(e.target.classList.contains(tn)||U.closest(e.target,"."+tn))||(n&&e.shiftKey&&1===e.which&&this.parent.keyboardInteractionModule?this.parent.keyboardInteractionModule.onMouseSelection(e):(this.parent.activeCellsData=this.parent.getCellDetails(i),r=U.extend(this.parent.activeCellsData,{cancel:!1,event:e,name:"cellClick"}),this.parent.trigger(F,r,function(e){var t;e.cancel?s.parent.quickPopup&&s.parent.quickPopup.quickPopupHide():(n&&s.parent.selectCell(i),s.parent.allowInline?(t={element:e.element,groupIndex:e.groupIndex,type:"Cell"},s.parent.notify(ge,t)):s.parent.notify(F,e))}))):(a=this.parent.getDateFromElement(i),!U.isNullOrUndefined(a)&&this.parent.isMinMaxDate(a)&&(this.parent.setProperties({selectedDate:a},!0),this.parent.changeView(this.parent.getNavigateView(),e)))):this.parent.eventWindow.openEditor(this.parent.activeCellsData,"Add"))},So.prototype.cellDblClick=function(e){var i=this,t=U.closest(e.target,".e-work-cells,.e-all-day-cells,.e-header-cells");this.parent.activeViewOptions.readonly||this.isPreventAction(e)||U.isNullOrUndefined(t)||(t=U.extend(this.parent.activeCellsData,{cancel:!1,event:e,name:"cellDoubleClick"}),this.parent.trigger(_,t,function(e){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")}))},So.prototype.onHover=function(e){var t=U.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");t&&this.parent.trigger(Q,{element:t,event:e})},So.prototype.isPreventAction=function(e){var t;return!(U.closest(e.target,"."+Oi)||(!U.closest(e.target,"."+x)||U.closest(e.target,"."+tn))&&(t=U.closest(e.target,"."+A+",."+kt),U.isNullOrUndefined(t))&&(t=U.closest(e.target,"."+Dt),!this.parent.activeView||!this.parent.activeView.isTimelineView()||U.isNullOrUndefined(t)))},So.prototype.destroy=function(){U.EventHandler.remove(this.parent.element,"mouseover",this.onHover)};var Co=So;function So(e){this.parent=e,U.EventHandler.add(this.parent.element,"mouseover",this.onHover,this)}Oo=function(e,t){return(Oo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Oo,Eo,To=function(e,t){function i(){this.constructor=e}Oo(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Vo=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;0<=o;o--)(r=e[o])&&(s=(a<3?r(s):3<a?r(t,i,s):r(t,i))||s);return 3<a&&s&&Object.defineProperty(t,i,s),s},To=(Eo=U.ChildProperty,To(xo,Eo),Vo([U.Property()],xo.prototype,"name",void 0),Vo([U.Property()],xo.prototype,"default",void 0),Vo([U.Property()],xo.prototype,"title",void 0),Vo([U.Property({})],xo.prototype,"validation",void 0),xo);function xo(){return null!==Eo&&Eo.apply(this,arguments)||this}Ao=function(e,t){return(Ao=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Ao,Io,Vo=function(e,t){function i(){this.constructor=e}Ao(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},h=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;0<=o;o--)(r=e[o])&&(s=(a<3?r(s):3<a?r(t,i,s):r(t,i))||s);return 3<a&&s&&Object.defineProperty(t,i,s),s},Vo=(Io=U.ChildProperty,Vo(Mo,Io),h([U.Property("Id")],Mo.prototype,"id",void 0),h([U.Property("IsBlock")],Mo.prototype,"isBlock",void 0),h([U.Complex({name:"Subject"},To)],Mo.prototype,"subject",void 0),h([U.Complex({name:"StartTime"},To)],Mo.prototype,"startTime",void 0),h([U.Complex({name:"EndTime"},To)],Mo.prototype,"endTime",void 0),h([U.Complex({name:"StartTimezone"},To)],Mo.prototype,"startTimezone",void 0),h([U.Complex({name:"EndTimezone"},To)],Mo.prototype,"endTimezone",void 0),h([U.Complex({name:"Location"},To)],Mo.prototype,"location",void 0),h([U.Complex({name:"Description"},To)],Mo.prototype,"description",void 0),h([U.Complex({name:"IsAllDay"},To)],Mo.prototype,"isAllDay",void 0),h([U.Complex({name:"RecurrenceID"},To)],Mo.prototype,"recurrenceID",void 0),h([U.Complex({name:"RecurrenceRule"},To)],Mo.prototype,"recurrenceRule",void 0),h([U.Complex({name:"RecurrenceException"},To)],Mo.prototype,"recurrenceException",void 0),h([U.Property("IsReadonly")],Mo.prototype,"isReadonly",void 0),h([U.Property("FollowingID")],Mo.prototype,"followingID",void 0),Mo);function Mo(){return null!==Io&&Io.apply(this,arguments)||this}ko=function(e,t){return(ko=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var ko,Ro,To=function(e,t){function i(){this.constructor=e}ko(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},h=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;0<=o;o--)(r=e[o])&&(s=(a<3?r(s):3<a?r(t,i,s):r(t,i))||s);return 3<a&&s&&Object.defineProperty(t,i,s),s},To=(Ro=U.ChildProperty,To(Ho,Ro),h([U.Property()],Ho.prototype,"template",void 0),h([U.Property([])],Ho.prototype,"dataSource",void 0),h([U.Property()],Ho.prototype,"query",void 0),h([U.Complex({},Vo)],Ho.prototype,"fields",void 0),h([U.Property(!1)],Ho.prototype,"enableTooltip",void 0),h([U.Property("AllDayRow")],Ho.prototype,"spannedEventPlacement",void 0),h([U.Property(1)],Ho.prototype,"minimumEventDuration",void 0),h([U.Property()],Ho.prototype,"tooltipTemplate",void 0),h([U.Property()],Ho.prototype,"resourceColorField",void 0),h([U.Property(!1)],Ho.prototype,"editFollowingEvents",void 0),h([U.Property(!0)],Ho.prototype,"allowAdding",void 0),h([U.Property(!0)],Ho.prototype,"allowEditing",void 0),h([U.Property(!0)],Ho.prototype,"allowDeleting",void 0),h([U.Property(!1)],Ho.prototype,"enableMaxHeight",void 0),h([U.Property(!1)],Ho.prototype,"enableIndicator",void 0),h([U.Property(!1)],Ho.prototype,"ignoreWhitespace",void 0),h([U.Property()],Ho.prototype,"sortComparer",void 0),h([U.Property()],Ho.prototype,"includeFiltersInQuery",void 0),Ho);function Ho(){return null!==Ro&&Ro.apply(this,arguments)||this}Po=function(e,t){return(Po=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Po,jo,Vo=function(e,t){function i(){this.constructor=e}Po(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},h=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;0<=o;o--)(r=e[o])&&(s=(a<3?r(s):3<a?r(t,i,s):r(t,i))||s);return 3<a&&s&&Object.defineProperty(t,i,s),s},Vo=(jo=U.ChildProperty,Vo(Lo,jo),h([U.Property(!1)],Lo.prototype,"byDate",void 0),h([U.Property(!0)],Lo.prototype,"byGroupID",void 0),h([U.Property(!1)],Lo.prototype,"allowGroupEdit",void 0),h([U.Property([])],Lo.prototype,"resources",void 0),h([U.Property(!0)],Lo.prototype,"enableCompactView",void 0),h([U.Property()],Lo.prototype,"headerTooltipTemplate",void 0),h([U.Property(!1)],Lo.prototype,"hideNonWorkingDays",void 0),Lo);function Lo(){return null!==jo&&jo.apply(this,arguments)||this}No=function(e,t){return(No=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var No,qo,h=function(e,t){function i(){this.constructor=e}No(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Fo=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;0<=o;o--)(r=e[o])&&(s=(a<3?r(s):3<a?r(t,i,s):r(t,i))||s);return 3<a&&s&&Object.defineProperty(t,i,s),s},h=(qo=U.ChildProperty,h(Uo,qo),Fo([U.Property()],Uo.prototype,"field",void 0),Fo([U.Property()],Uo.prototype,"title",void 0),Fo([U.Property()],Uo.prototype,"name",void 0),Fo([U.Property(!1)],Uo.prototype,"allowMultiple",void 0),Fo([U.Property([])],Uo.prototype,"dataSource",void 0),Fo([U.Property()],Uo.prototype,"query",void 0),Fo([U.Property("Id")],Uo.prototype,"idField",void 0),Fo([U.Property("Text")],Uo.prototype,"textField",void 0),Fo([U.Property("Expanded")],Uo.prototype,"expandedField",void 0),Fo([U.Property("GroupID")],Uo.prototype,"groupIDField",void 0),Fo([U.Property("Color")],Uo.prototype,"colorField",void 0),Fo([U.Property("StartHour")],Uo.prototype,"startHourField",void 0),Fo([U.Property("EndHour")],Uo.prototype,"endHourField",void 0),Fo([U.Property("WorkDays")],Uo.prototype,"workDaysField",void 0),Fo([U.Property("CssClass")],Uo.prototype,"cssClassField",void 0),Uo);function Uo(){return null!==qo&&qo.apply(this,arguments)||this}u.prototype.renderResourceHeaderIndent=function(e){var t=U.createElement("td",{className:"e-resource-left-td"}),i=U.createElement("div",{className:Rt}),n=(this.parent.activeViewOptions.headerIndentTemplate?(n={className:[t.className],type:"emptyCells"},this.parent.renderHeaderIndentTemplate(n,t)):t.appendChild(i),{elementType:"emptyCells",element:t});this.parent.trigger(ee,n),e.appendChild(t)},u.prototype.hideResourceRows=function(e){if(!(this.resourceCollection.length<=1||this.parent.virtualScrollModule))for(var t=this.lastResourceLevel.length,i=0;i<t;i++){var n=this.lastResourceLevel[parseInt(i.toString(),10)].resourceData,r=this.lastResourceLevel[parseInt(i.toString(),10)].resource;n.ClassName!==Lt||n[r.expandedField]||U.isNullOrUndefined(n[r.expandedField])||(r=[].slice.call(e.children).slice(i+1,i+(parseInt(n.Count,10)+1)),U.addClass(r,sr))}},u.prototype.createResourceColumn=function(){var e=this.resourceCollection,t=U.createElement("div",{className:Ht}),i=this.parent.activeView.createTableLayout(Pt),n=(!this.parent.uiStateValues.isGroupAdaptive&&this.parent.rowAutoHeight&&this.parent.activeView.isTimelineView()&&0<this.parent.activeViewOptions.group.resources.length&&U.addClass([i],wr),i.querySelector("tbody")),r=this.generateTreeData(!0);return this.countCalculation(e.slice(0,-2),e.slice(0,-1)),this.renderedResources=this.lastResourceLevel,this.parent.virtualScrollModule&&(e=this.parent.virtualScrollModule.getRenderedCount(),this.setExpandedResources(),r=this.expandedResources.slice(0,e),this.renderedResources=r),U.append(this.getContentRows(r),n),this.hideResourceRows(n),i.appendChild(n),t.appendChild(i),t},u.prototype.setRenderedResources=function(){var e=this.resourceCollection;this.generateTreeData(!0);this.countCalculation(e.slice(0,-2),e.slice(0,-1)),this.renderedResources=this.lastResourceLevel},u.prototype.setExpandedResources=function(){for(var e=[],t=0;t<this.lastResourceLevel.length;t++){var i=this.lastResourceLevel[parseInt(t.toString(),10)].resourceData,n=i.Count,i=(e.push(this.lastResourceLevel[parseInt(t.toString(),10)]),i[this.lastResourceLevel[parseInt(t.toString(),10)].resource.expandedField]);!U.isNullOrUndefined(i)&&!i&&0<n&&(t+=n)}this.expandedResources=e},u.prototype.getContentRows=function(e,t){for(var i=[],n=this.resourceCollection,r=U.createElement("tr"),a=U.createElement("td",{attrs:{tabindex:t?"-1":"0"}}),s=0;s<e.length;s++){var o=a.cloneNode(),l=((p=Je(n,"name",e[parseInt(s.toString(),10)].resource.name))===n.length-1?(U.extend(e[parseInt(s.toString(),10)].resourceData,{ClassName:jt}),this.renderedResources[parseInt(s.toString(),10)].className=[jt]):(U.extend(e[parseInt(s.toString(),10)].resourceData,{ClassName:Lt}),this.renderedResources[parseInt(s.toString(),10)].className=[Lt]),c=p*this.leftPixel+"px",e[parseInt(s.toString(),10)].resourceData.ClassName===Lt&&!U.isNullOrUndefined(e[parseInt(s.toString(),10)].resourceData.Count)&&0<e[parseInt(s.toString(),10)].resourceData.Count&&(l=void 0,l=e[parseInt(s.toString(),10)].resourceData[n[parseInt(p.toString(),10)].expandedField]||U.isNullOrUndefined(e[parseInt(s.toString(),10)].resourceData[n[parseInt(p.toString(),10)].expandedField])?qt:Nt,p=U.createElement("div"),U.addClass([p],[Ft,l]),this.setMargin(p,c),o.appendChild(p),1<this.resourceCollection.length)&&U.EventHandler.add(p,"click",this.onTreeIconClick,this),this.parent.activeView.setResourceHeaderContent(o,e[parseInt(s.toString(),10)],Rt),o.setAttribute("data-group-index",e[parseInt(s.toString(),10)].groupIndex.toString()),o.setAttribute("aria-label",e[parseInt(s.toString(),10)].resourceData[e[parseInt(s.toString(),10)].resource.textField]+" resource"),this.parent.activeViewOptions.resourceHeaderTemplate||this.setMargin(o.querySelector("."+Rt),c),[Ut,e[parseInt(s.toString(),10)].resourceData.ClassName]),p=(U.addClass([o],l),{elementType:"resourceHeader",element:o,groupIndex:e[parseInt(s.toString(),10)].groupIndex}),c=(this.parent.trigger(ee,p),r.cloneNode());c.appendChild(o),i.push(c)}return i},u.prototype.setMargin=function(e,t){this.parent.enableRtl?e.style.marginRight=t:e.style.marginLeft=t},u.prototype.countCalculation=function(e,t){for(var i=0;i<e.length;i++){for(var n=e[e.length-(i+1)].dataSource,r=0;r<n.length;r++){var a,s,o=0;s=this.parent.activeViewOptions.group.byGroupID?(a=(new H.Query).where(t[t.length-1].groupIDField,"equal",n[parseInt(r.toString(),10)][e[e.length-(i+1)].idField]),new H.DataManager(t[t.length-1].dataSource).executeLocal(a)):t[t.length-1].dataSource;for(var l=0;l<s.length;l++)o+=parseInt(s[parseInt(l.toString(),10)].Count,10);o+=parseInt(n[parseInt(r.toString(),10)].Count,10),U.extend(n[parseInt(r.toString(),10)],{Count:o})}t=t.slice(0,-1)}},u.prototype.onTreeIconClick=function(r){var a,s=this,o=(this.parent.eventTooltip&&this.parent.eventTooltip.close(),r.target),e=U.closest(o,"."+Lt).parentElement,l=parseInt(e.children[0].getAttribute("data-group-index"),10),p={cancel:!1,event:r,groupIndex:l,requestType:o.classList.contains(qt)?"resourceCollapse":"resourceExpand"};this.parent.trigger(K,p,function(e){if(!e.cancel){a=o.classList.contains(qt)?(U.classList(o,[Nt],[qt]),!0):(U.classList(o,[qt],[Nt]),!1);for(var t=0,i=[].slice.call(s.parent.element.querySelectorAll("."+A+",."+tn));t<i.length;t++){var n=i[t];U.remove(n)}s.parent.virtualScrollModule?s.updateVirtualContent(l,a,r,o):s.updateContent(l,a);e={cssProperties:s.parent.getCssProperties(),module:"scroll"};s.parent.notify(Se,e),p={cancel:!1,event:r,groupIndex:l,requestType:o.classList.contains(qt)?"resourceExpanded":"resourceCollapsed"},s.parent.refreshEvents(!1),s.parent.trigger(Z,p)}})},u.prototype.updateContent=function(e,t){for(var i=[],n=[],r=[],a=this.lastResourceLevel[parseInt(e.toString(),10)].resourceData,s=[].slice.call(this.parent.element.querySelectorAll("."+Ht+" tr")),o=[].slice.call(this.parent.element.querySelectorAll("."+I+" tbody tr")),l=[].slice.call(this.parent.element.querySelectorAll("."+I+" ."+li)),p=0;p<a.Count;p++)i.push(s[e+p+1]),n.push(o[e+p+1]),r.push(l[e+p+1]);for(var c=this.lastResourceLevel,h=0;h<i.length;h++){var d,u=!0,g=i[parseInt(h.toString(),10)].children[0].classList.contains(Lt);c[parseInt(e.toString(),10)].resourceData[c[parseInt(e.toString(),10)].resource.expandedField]=!t,t?(g&&(d=i[parseInt(h.toString(),10)].querySelector("."+Ft))&&U.classList(d,[Nt],[qt]),i[parseInt(h.toString(),10)].classList.contains(sr)||U.addClass([i[parseInt(h.toString(),10)],n[parseInt(h.toString(),10)],r[parseInt(h.toString(),10)]],sr)):(g&&(g=i[parseInt(h.toString(),10)].rowIndex,c[parseInt(g.toString(),10)].resourceData[c[parseInt(g.toString(),10)].resource.expandedField]||U.isNullOrUndefined(c[parseInt(g.toString(),10)].resourceData[c[parseInt(g.toString(),10)].resource.expandedField])||(i.splice(h+1,parseInt(c[parseInt(g.toString(),10)].resourceData.Count,10)),n.splice(h+1,parseInt(c[parseInt(g.toString(),10)].resourceData.Count,10)),r.splice(h+1,parseInt(c[parseInt(g.toString(),10)].resourceData.Count,10)),u=!1),u)&&(d=i[parseInt(h.toString(),10)].querySelector("."+Ft))&&U.classList(d,[qt],[Nt]),i[parseInt(h.toString(),10)].classList.contains(sr)&&U.removeClass([i[parseInt(h.toString(),10)],n[parseInt(h.toString(),10)],r[parseInt(h.toString(),10)]],sr))}},u.prototype.updateVirtualContent=function(e,t,i,n){this.lastResourceLevel[parseInt(e.toString(),10)].resourceData[this.lastResourceLevel[parseInt(e.toString(),10)].resource.expandedField]=!t,this.setExpandedResources();var e=this.parent.virtualScrollModule.getRenderedCount(),t=this.expandedResources.indexOf(this.renderedResources[0]),e=(this.renderedResources=this.expandedResources.slice(t,t+e),this.renderedResources.length<e&&(t=this.expandedResources.length-e,this.renderedResources=this.expandedResources.slice(t=0<t?t:0,this.expandedResources.length)),this.parent.element.querySelector("."+yi)),t=(this.parent.virtualScrollModule.updateVirtualTrackHeight(e),this.parent.element.querySelector("."+Ht+" table")),e=this.parent.element.querySelector("."+I+" table"),r=this.parent.element.querySelector("."+Mt),t=(this.parent.virtualScrollModule.updateContent(t,e,r,this.renderedResources),this.parent.element.querySelector("."+Gt));U.isNullOrUndefined(t)||(t.style.height=this.parent.element.querySelector("."+S).offsetHeight+"px")},u.prototype.renderResourceHeader=function(){var e,t=U.createElement("div",{className:ei});t.innerHTML='<div class="'+ii+'"><div class="'+pr+'"><div class="e-icons '+cr+'"></div></div><div class="'+hr+'"></div></div>',"MonthAgenda"===this.parent.currentView?(e=this.parent.activeView.getPanel().querySelector("."+I)).insertBefore(t,e.querySelector("."+oi)):this.parent.element.insertBefore(t,this.parent.element.querySelector("."+gt)),this.renderResourceHeaderText(),U.EventHandler.add(t.querySelector("."+cr),"click",this.menuClick,this)},u.prototype.renderResourceTree=function(){this.popupOverlay=U.createElement("div",{className:dr});var e=U.createElement("div",{className:ur+" e-popup-close"}),t=(("MonthAgenda"===this.parent.currentView?((t=this.parent.activeView.getPanel().querySelector("."+oi)).insertBefore(e,t.children[0]),t):(this.parent.element.querySelector("."+gt).appendChild(e),this.parent.element.querySelector("."+gt))).appendChild(this.popupOverlay),U.createElement("div",{className:"e-resource-tree"}));e.appendChild(t),this.treeViewObj=new k.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,this.treeViewObj.appendTo(t),this.treeViewObj.expandAll(),this.treePopup=new M.Popup(e,{targetType:"relative",actionOnScroll:"none",content:this.treeViewObj.element,relateTo:this.parent.element.querySelector("."+gt),enableRtl:this.parent.enableRtl,hideAnimation:{name:"SlideLeftOut",duration:500},showAnimation:{name:"SlideLeftIn",duration:500},viewPortElement:this.parent.element.querySelector("."+("MonthAgenda"===this.parent.currentView?oi:gt))}),this.parent.on(Ee,this.documentClick,this)},u.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())},u.prototype.generateTreeData=function(h){for(var d=this,i=[],u=[],g=0,e=function(e,t){function c(e,t,i){for(var n,r,a=d.resourceCollection[parseInt(t.toString(),10)],s=(h?(r={type:"resourceHeader",resource:e.resource,resourceData:e.resourceData,groupIndex:g,groupOrder:e.groupOrder},u.push(r),g++):n={resourceId:i,resourceName:e.resourceData[a.textField],resource:e.resource,resourceData:e.resourceData},0<e.child.length&&!h&&(n.resourceChild=[]),1),o=0,l=e.child;o<l.length;o++){var p=l[o];h?c(p,t+1,i+"-"+s):n.resourceChild.push(c(p,t+1,i+"-"+s)),s+=1}return h&&U.extend(r.resourceData,{Count:s-1}),n}h?c(n.resourceTreeLevel[parseInt(e.toString(),10)],0,(e+1).toString()):i.push(c(n.resourceTreeLevel[parseInt(e.toString(),10)],0,(e+1).toString()))},n=this,t=0,r=this.resourceTreeLevel.length;t<r;t++)e(t);return h?this.lastResourceLevel=u:i},u.prototype.renderResourceHeaderText=function(){for(var r=this.lastResourceLevel[this.parent.uiStateValues.groupIndex],a=[],s=this,e=0,t=r.groupOrder.length;e<t;e++)!function(t){var i=s.resourceCollection[parseInt(t.toString(),10)],e=i.dataSource.filter(function(e){return e[i.idField]===r.groupOrder[parseInt(t.toString(),10)]}),n=U.createElement("div",{className:gi}),e=(s.parent.sanitize(e[0][i.textField],n),a.push(n),U.createElement("div",{className:"e-icons e-icon-next"}));a.push(e)}(e);a.pop();var i=("MonthAgenda"===this.parent.currentView?this.parent.activeView.getPanel():this.parent.element).querySelector("."+hr);et(i);for(var n=0,o=a;n<o.length;n++)i.appendChild(o[n]);1===this.lastResourceLevel.length&&U.addClass([this.parent.element.querySelector("."+pr)],d)},u.prototype.menuClick=function(e){var t;this.parent.element.querySelector("."+ur).classList.contains(yt)?(this.treePopup.hide(),U.removeClass([this.popupOverlay],ut)):(t=[].slice.call(this.treeViewObj.element.querySelectorAll(".e-list-item:not(.e-has-child)")),U.removeClass(t,"e-active"),U.addClass([t[this.parent.uiStateValues.groupIndex]],"e-active"),this.treePopup.show(),U.addClass([this.popupOverlay],ut))},u.prototype.selectResourceByIndex=function(e){this.lastResourceLevel&&-1<e&&e<this.lastResourceLevel.length&&this.triggerEvents(e)},u.prototype.resourceClick=function(e){var t;e.node.classList.contains("e-has-child")||(this.treePopup.hide(),U.removeClass([this.popupOverlay],ut),t=[].slice.call(this.treeViewObj.element.querySelectorAll(".e-list-item:not(.e-has-child)")).indexOf(e.node),this.triggerEvents(t,e),e.event.preventDefault())},u.prototype.triggerEvents=function(e,t){var i=this,n={cancel:!1,event:t?t.event:null,groupIndex:e,requestType:"resourceChange"};this.parent.trigger(K,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(Z,n))})},u.prototype.documentClick=function(e){U.closest(e.event.target,"."+ur)||(e=this.parent.element.querySelector("."+ur))&&e.classList.contains(yt)&&(this.treePopup.hide(),U.removeClass([this.popupOverlay],ut))},u.prototype.bindResourcesData=function(t){for(var i=this,e=(this.parent.showSpinner(),[]),n=0,r=this.parent.resources;n<r.length;n++){var a=r[n],a=new jr(this.parent,a.dataSource,a.query);e.push(a.getData(a.generateQuery()))}Promise.all(e).then(function(e){return i.dataManagerSuccess(e,t)}).catch(function(e){return i.parent.crudModule.dataManagerFailure(e)})},u.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)],r=this.getResourceModel(r,e[parseInt(i.toString(),10)].result);this.parent.resourceCollection.push(r)}this.refreshLayout(t)}},u.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}},u.prototype.refreshLayout=function(e){!U.isNullOrUndefined(this.parent.uiStateValues.groupIndex)&&this.parent.enablePersistence||(this.parent.uiStateValues.groupIndex=0),this.parent.renderElements(e)},u.prototype.setResourceCollection=function(){var e=[];if(this.resourceCollection=[],this.colorIndex=null,0<this.parent.activeViewOptions.group.resources.length)for(var t=0,i=this.parent.activeViewOptions.group.resources;t<i.length;t++){var n=i[t],r=Je(this.parent.resourceCollection,"name",n);0<=r&&e.push(this.parent.resourceCollection[parseInt(r.toString(),10)])}else 0<this.parent.resourceCollection.length&&(e=this.parent.resourceCollection);for(var a=0,s=0,o=e;s<o.length;s++){var n=o[s],l=this.getResourceModel(n);n.name===this.parent.eventSettings.resourceColorField&&(this.colorIndex=a),a++,this.resourceCollection.push(l)}U.isNullOrUndefined(this.colorIndex)&&(this.colorIndex=this.resourceCollection.length-1)},u.prototype.generateResourceLevels=function(y,e){function T(e,t,i,n,r){var a=[],s=e[0];if(s){var o,l=void 0;l=n&&w.parent.activeViewOptions.group.byGroupID?(o=n[i.idField],s.dataSource.filter(function(e){return e[s.groupIDField]===o})):s.dataSource;for(var p=0;p<l.length;p++){var c,h,d,u,g,m,v=[],f=((v=r&&0<r.length?v.concat(r):v).push(l[parseInt(p.toString(),10)][s.idField]),T(e.slice(1),t+1,s,l[parseInt(p.toString(),10)],v));0===t&&0===f.length&&1<w.resourceCollection.length||(d=[],c=w.parent.activeView.renderDates,h=void 0,w.parent.activeViewOptions.group.byDate||t+1!==w.resourceCollection.length||(u=l[parseInt(p.toString(),10)][s.workDaysField],g=l[parseInt(p.toString(),10)][s.startHourField],m=l[parseInt(p.toString(),10)][s.endHourField],d=u&&0<u.length?(c=w.parent.activeView.getRenderDates(u),w.parent.activeView.getDateSlots(c,h=u)):(h=w.parent.activeViewOptions.workDays,y),u=w.generateCustomHours(d,g,m,v),b=b.concat(u)),g=l[parseInt(p.toString(),10)][s.cssClassField],m={type:"resourceHeader",className:["e-resource-cells"],resourceLevelIndex:t,groupOrder:v,resource:s,resourceData:l[parseInt(p.toString(),10)],colSpan:w.parent.activeViewOptions.group.byDate?1:d.length,renderDates:c,workDays:h,cssClass:g,child:f},a.push(m))}return D[parseInt(t.toString(),10)]||(D[parseInt(t.toString(),10)]=[]),0<a.length&&D[parseInt(t.toString(),10)].push(a),a}return[]}var w=this,t=this.resourceCollection,D=[],b=[];return this.resourceTreeLevel=T(t,0),e?[]:this.generateHeaderLevels(D,b,y)},u.prototype.generateCustomHours=function(e,t,i,n){for(var e=U.extend([],e,null,!0),r=0,a=e;r<a.length;r++){var s=a[r];t&&(s.startHour=this.parent.getStartEndTime(t)),i&&(s.endHour=this.parent.getStartEndTime(i)),n&&(s.groupOrder=n)}return e},u.prototype.generateHeaderLevels=function(e,t,i){for(var n=[],r=e.length-1;0<=r;r--)for(var a=0,s=0,o=e[parseInt(r.toString(),10)];s<o.length;s++)for(var l=0,p=o[s];l<p.length;l++){var c=p[l];if(e[r+1]&&0<e[r+1].length){var h=e[parseInt((r+1).toString(),10)][parseInt(a.toString(),10)];if(!h)continue;for(var d=0,u=0,g=h;u<g.length;u++){var m=g[u];(!this.parent.activeViewOptions.group.byGroupID||this.parent.activeViewOptions.group.byGroupID&&m.resourceData[m.resource.groupIDField]===c.resourceData[c.resource.idField])&&(d+=m.colSpan)}c.colSpan=d}c.groupIndex=a,a++,n[c.resourceLevelIndex]=n[c.resourceLevelIndex]||[],n[c.resourceLevelIndex].push(c)}if(this.lastResourceLevel=n.slice(-1)[0]||[],!this.parent.activeViewOptions.group.byDate){for(var v=0,f=0,y=this.lastResourceLevel;f<y.length;f++)for(var T=y[f],r=0;r<T.colSpan;r++)t[parseInt(v.toString(),10)].groupIndex=T.groupIndex,v++;return n.push(t),n}var w=[],D=U.extend([],n,null,!0),b=[];if(this.parent.activeViewOptions.group.hideNonWorkingDays){for(var C=[],S=0,j=function(a){O.resourceDateTree[parseInt(S.toString(),10)]=[];for(var s=[],e=function(n){var e=O.lastResourceLevel[parseInt(n.toString(),10)].resourceData[O.lastResourceLevel[parseInt(n.toString(),10)].resource.workDaysField];if(-1!==(e=e||O.parent.activeViewOptions.workDays).indexOf(a.date.getDay()))for(var r=U.extend({},O.lastResourceLevel[parseInt(n.toString(),10)],null,!0),t=(r.date=a.date,O.lastResourceLevel[parseInt(n.toString(),10)].workDays=e,r.startHour=O.parent.getStartEndTime(r.resourceData[r.resource.startHourField])||a.startHour,r.endHour=O.parent.getStartEndTime(r.resourceData[r.resource.endHourField])||a.endHour,O.resourceDateTree[parseInt(S.toString(),10)].push(r),0);t<r.groupOrder.length;t++)!function(t){if(s[parseInt(t.toString(),10)]||(s[parseInt(t.toString(),10)]=[]),t===r.groupOrder.length-1)return C[parseInt(n.toString(),10)]||(C[parseInt(n.toString(),10)]=[]),i=r.renderDates.filter(function(e){return e.getDay()===a.date.getDay()}),C[parseInt(n.toString(),10)]=C[parseInt(n.toString(),10)].concat(i),s[parseInt(t.toString(),10)].push(r);var e,i=D[parseInt(t.toString(),10)].filter(function(e){return e.resourceData[e.resource.idField]===r.groupOrder[parseInt(t.toString(),10)]});i&&0<i.length&&((e=s[parseInt(t.toString(),10)].filter(function(e){return e.resourceData[e.resource.idField]===r.groupOrder[parseInt(t.toString(),10)]}))&&0<e.length?e[0].colSpan+=1:((e=U.extend({},i[0],null,!0)).colSpan=1,s[parseInt(t.toString(),10)].push(e)))}(t)},t=0;t<O.lastResourceLevel.length;t++)e(t);if(0<s.length){for(var i=0;i<D.length;i++)w[parseInt(i.toString(),10)]||(w[parseInt(i.toString(),10)]=[]),w[parseInt(i.toString(),10)]=w[parseInt(i.toString(),10)].concat(s[parseInt(i.toString(),10)]);a.colSpan=s[s.length-1].length,b.push(a)}S++},O=this,E=0,V=i;E<V.length;E++)j(M=V[E]);this.resourceDateTree=this.resourceDateTree.filter(function(e){return 0<e.length}),this.lastResourceLevel.forEach(function(e,t){C[parseInt(t.toString(),10)]&&(e.renderDates=C[parseInt(t.toString(),10)].sort(function(e,t){return e.getTime()-t.getTime()}))})}else{for(var x=0,A=0,L=D[0];A<L.length;A++)x+=L[A].colSpan;for(var I=0,N=i;I<N.length;I++){(M=N[I]).colSpan=x,b.push(M);for(var M,k=U.extend([],D,null,!0),R=0,q=k.length;R<q;R++){if(R===k.length-1)for(var H=0,F=k[parseInt(R.toString(),10)];H<F.length;H++){var P=F[H];P.date=M.date,P.workDays=M.workDays,P.startHour=this.parent.getStartEndTime(P.resourceData[P.resource.startHourField])||M.startHour,P.endHour=this.parent.getStartEndTime(P.resourceData[P.resource.endHourField])||M.endHour}w[parseInt(R.toString(),10)]||(w[parseInt(R.toString(),10)]=[]),w[parseInt(R.toString(),10)]=w[parseInt(R.toString(),10)].concat(k[parseInt(R.toString(),10)])}}}return w.unshift(b),w},u.prototype.setResourceValues=function(n,e){function t(e,t,i){r.resourceCollection[parseInt(e.toString(),10)].allowMultiple&&r.parent.activeViewOptions.group.allowGroupEdit?n[""+t]=[i]:n[""+t]=i}var r=this;if(void 0===e&&(e=(this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues:this.parent.activeCellsData).groupIndex),0<this.parent.activeViewOptions.group.resources.length&&!U.isNullOrUndefined(e))for(var i=this.lastResourceLevel[parseInt(e.toString(),10)].groupOrder,a=0;a<this.resourceCollection.length;a++)t(a,this.resourceCollection[parseInt(a.toString(),10)].field,i[parseInt(a.toString(),10)]);else if(0<this.parent.resourceCollection.length)for(a=0;a<this.resourceCollection.length;a++){var s=this.resourceCollection[parseInt(a.toString(),10)].dataSource[0];s&&t(a,this.resourceCollection[parseInt(a.toString(),10)].field,s[this.resourceCollection[parseInt(a.toString(),10)].idField])}},u.prototype.getResourceColor=function(e,t){var i=!U.isNullOrUndefined(t)&&this.colorIndex>t.length-1?t.length-1:this.colorIndex,n=this.resourceCollection[parseInt(i.toString(),10)];if(!(U.isNullOrUndefined(t)&&this.parent.activeViewOptions.group.allowGroupEdit&&n.allowMultiple))return e=U.isNullOrUndefined(t)?e[n.field]:t[parseInt(i.toString(),10)],0<(t=this.filterData(n.dataSource,n.idField,e)).length?t[0][n.colorField]:void 0},u.prototype.getCssClass=function(e){var t=this.resourceCollection.slice(-1)[0];return(!this.parent.activeViewOptions.group.allowGroupEdit||!t.allowMultiple)&&0<(e=this.filterData(t.dataSource,t.idField,e[t.field])).length?e[0][t.cssClassField]:void 0},u.prototype.getResourceRenderDates=function(){var e=[].concat.apply([],this.lastResourceLevel.map(function(e){return e.renderDates})),i=e.map(function(e){return e.getTime()}),e=e.filter(function(e,t){return i.indexOf(e.getTime())===t});return e.sort(function(e,t){return e.getTime()-t.getTime()}),e},u.prototype.filterData=function(e,t,i){return e.filter(function(e){return e[""+t]===i})},u.prototype.getResourceData=function(e,t,i){if(this.parent.activeViewOptions.group.allowGroupEdit){for(var n={},r=0,a=i;r<a.length;r++)for(var s=a[r],o=this.lastResourceLevel[parseInt(s.toString(),10)].groupOrder,l=0,p=o.length;l<p;l++){var c=this.resourceCollection[parseInt(l.toString(),10)].field;U.isNullOrUndefined(n[""+c])&&(n[""+c]=[]),n[""+c].push(o[parseInt(l.toString(),10)])}U.extend(e,n)}else for(var l=0,h=this.resourceCollection.length;l<h;l++)this.lastResourceLevel[parseInt(t.toString(),10)]&&(e[this.resourceCollection[parseInt(l.toString(),10)].field]=this.lastResourceLevel[parseInt(t.toString(),10)].groupOrder[parseInt(l.toString(),10)])},u.prototype.addResource=function(e,t,n){for(var r=e instanceof Array?e:[e],i=0,a=this.parent.resourceCollection;i<a.length&&"break"!==function(i){if(i.name===t)return r.forEach(function(e,t){return new H.DataManager({json:i.dataSource}).insert(e,null,null,n+t)}),"break"}(a[i]);i++);this.refreshLayout(!0)},u.prototype.removeResource=function(e,i){for(var n=e instanceof Array?e:[e],t=0,r=this.parent.resourceCollection;t<r.length&&"break"!==function(t){if(t.name===i)return n.forEach(function(e){return new H.DataManager({json:t.dataSource}).remove(t.idField,e)}),"break"}(r[t]);t++);this.refreshLayout(!0)},u.prototype.getIndexFromResourceId=function(t,i,n,r,a){var e;return i=i||this.parent.resourceCollection.slice(-1)[0].name,U.isNullOrUndefined(n)&&(n=this.resourceCollection.filter(function(e){return e.name===i})[0],U.isNullOrUndefined(n))?null:(e=n.dataSource.filter(function(e){return!r||e[n.idField]!==t||e[n.groupIDField]===r[""+a]?e[n.idField]===t:null})[0],this.lastResourceLevel.map(function(e){return e.resourceData}).indexOf(e))},u.prototype.resourceExpand=function(t,i,e){var n=this.parent.resourceCollection.filter(function(e){return e.name===i?e:null})[0],r=0,a=n.dataSource.filter(function(e){return e[n.idField]===t})[0],r=this.parent.activeViewOptions.group.byGroupID?this.lastResourceLevel.map(function(e){return e.resourceData}).indexOf(a):this.getIndexFromResourceId(t,i,n),a=this.parent.element.querySelector("."+Ht+' [data-group-index="'+r+'"] .'+Ft);a&&(a.classList.contains(Nt)&&!e||a.classList.contains(qt)&&e)&&a.click()},u.prototype.resourceScroll=function(t,e){var i,n,r,a,s,o;this.parent.isAdaptive||-1<["Agenda","MonthAgenda"].indexOf(this.parent.currentView)||(i=e||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],e=this.parent.element.querySelector("."+I),a=0,this.parent.activeView.isTimelineView()?(a=this.parent.activeViewOptions.group.byGroupID?(s=r.dataSource.filter(function(e){return e[r.idField]===t})[0],this.lastResourceLevel.map(function(e){return e.resourceData}).indexOf(s)):this.getIndexFromResourceId(t,i,r),this.parent.virtualScrollModule?(s=this.parent.element.querySelector("."+yi),s=Math.round(s.offsetHeight/this.expandedResources.length),this.parent.rowAutoHeight&&(e.scrollTop=0,this.parent.virtualScrollModule.virtualScrolling()),e.scrollTop=a*s-(this.parent.virtualScrollModule.bufferCount-1)*s,this.parent.virtualScrollModule.virtualScrolling(),this.parent.rowAutoHeight?(o=this.parent.element.querySelector("."+O+'[data-group-index="'+a+'"]'))&&!o.parentElement.classList.contains(sr)&&(e.scrollTop=e.scrollTop<o.offsetTop?o.offsetTop:e.scrollTop+o.offsetTop):e.scrollTop=a*s):(o=this.parent.element.querySelector("."+O+'[data-group-index="'+a+'"]'))&&!o.parentElement.classList.contains(sr)&&(e.scrollTop=o.offsetTop)):(a=this.parent.activeViewOptions.group.byGroupID?(i===this.parent.resourceCollection.slice(-1)[0].name?this.lastResourceLevel.map(function(e){return e.resourceData[r.idField]}):r.dataSource.map(function(e){return e[r.idField]})).indexOf(t):this.getIndexFromResourceId(t,i,r),s="Month"===this.parent.currentView?this.parent.element.querySelector("."+Tt+" tbody tr:nth-child("+(n+1)+")"):this.parent.element.querySelector("."+Gi+":nth-child("+(n+1)+")"),o=[].slice.call(s.children).map(function(e){return e.offsetLeft}),e.scrollLeft=o[parseInt(a.toString(),10)]))},u.prototype.destroy=function(){this.parent.off(Ee,this.documentClick),this.treeViewObj&&(this.treeViewObj.portals&&0<this.treeViewObj.portals.length&&0<(e=this.treeViewObj.portals.map(function(e){return e.propName})).length&&this.parent.resetTemplates(e),this.treeViewObj.destroy(),this.treeViewObj=null),this.treePopup&&(this.treePopup.destroy(),this.treePopup=null,U.remove(this.parent.element.querySelector("."+ur)),U.remove(this.parent.element.querySelector("."+dr)));var e=this.parent.element.querySelector("."+ei);e&&U.remove(e)};var Bo=u;function u(e){this.resourceCollection=[],this.leftPixel=25,this.resourceDateTree=[],this.parent=e}Wo=function(e,t){return(Wo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Wo,zo,Fo=function(e,t){function i(){this.constructor=e}Wo(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Yo=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;0<=o;o--)(r=e[o])&&(s=(a<3?r(s):3<a?r(t,i,s):r(t,i))||s);return 3<a&&s&&Object.defineProperty(t,i,s),s},Fo=(zo=U.ChildProperty,Fo(_o,zo),Yo([U.Property("")],_o.prototype,"id",void 0),Yo([U.Property("")],_o.prototype,"text",void 0),Yo([U.Property("auto")],_o.prototype,"width",void 0),Yo([U.Property("")],_o.prototype,"cssClass",void 0),Yo([U.Property(!1)],_o.prototype,"showAlwaysInPopup",void 0),Yo([U.Property(!1)],_o.prototype,"disabled",void 0),Yo([U.Property("")],_o.prototype,"prefixIcon",void 0),Yo([U.Property("")],_o.prototype,"suffixIcon",void 0),Yo([U.Property(!0)],_o.prototype,"visible",void 0),Yo([U.Property("None")],_o.prototype,"overflow",void 0),Yo([U.Property("")],_o.prototype,"template",void 0),Yo([U.Property("Button")],_o.prototype,"type",void 0),Yo([U.Property("Both")],_o.prototype,"showTextOn",void 0),Yo([U.Property(null)],_o.prototype,"htmlAttributes",void 0),Yo([U.Property("")],_o.prototype,"tooltipText",void 0),Yo([U.Property("Left")],_o.prototype,"align",void 0),Yo([U.Property(-1)],_o.prototype,"tabIndex",void 0),Yo([U.Property("Custom")],_o.prototype,"name",void 0),Yo([U.Event()],_o.prototype,"click",void 0),_o);function _o(){return null!==zo&&zo.apply(this,arguments)||this}Go=function(e,t){return(Go=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Go,Xo,Yo=function(e,t){function i(){this.constructor=e}Go(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},g=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;0<=o;o--)(r=e[o])&&(s=(a<3?r(s):3<a?r(t,i,s):r(t,i))||s);return 3<a&&s&&Object.defineProperty(t,i,s),s},Qo=(Xo=U.Component,Yo(m,Xo),m.prototype.render=function(){var e=[],t=[];if(e.push(ot),(this.enableRtl?e:t).push(lt),(this.isAdaptive?e:t).push(pt),(this.enableAdaptiveUI?e:t).push(ct),(this.allowMultiDrag?e:t).push(ht),this.cssClass)for(var i=0,n=this.cssClass.split(" ");i<n.length;i++){var r=n[i];e.push(r)}U.classList(this.element,e,t),this.validateDate(),M.createSpinner({target:this.element}),this.scrollModule=new Mr(this),this.scrollModule.setWidth(),this.scrollModule.setHeight(),this.renderModule=new no(this),this.eventBase=new ka(this),this.workCellAction=new Co(this),this.allowKeyboardInteraction&&(this.keyboardInteractionModule=new Pr(this)),this.inlineModule=new Ba(this),this.initializeDataModule(),this.renderTableContainer(),this.activeViewOptions=this.getActiveViewOptions(),this.initializeResources(),this.wireEvents()},m.prototype.renderTableContainer=function(){this.element.querySelector("."+gt)||this.element.appendChild(this.createElement("div",{className:gt}))},m.prototype.getEventTemplateName=function(e){e="eventTemplate_"+e;return this.activeEventTemplates.indexOf(e)<0&&this.activeEventTemplates.push(e),e},m.prototype.renderTemplates=function(e){this.isReact?this.renderReactTemplates(e):e&&e()},m.prototype.resetTemplates=function(e){(this.isAngular||this.isReact)&&this.clearTemplate(e)},m.prototype.sanitize=function(e,t){this.enableHtmlSanitizer?t.innerText=U.SanitizeHtmlHelper.sanitize(e):t.innerHTML=e},m.prototype.initializeResources=function(e){void 0===e&&(e=!1),0<this.resources.length?(this.resourceBase=new Bo(this),this.resourceBase.bindResourcesData(e)):(this.resourceBase=null,this.resourceCollection=[],this.renderElements(e))},m.prototype.destroyEditorWindow=function(){this.eventWindow&&(this.eventWindow.destroy(),this.eventWindow=null),this.eventWindow=new to(this)},m.prototype.renderElements=function(e){e?(this.initializeView(this.currentView),this.eventWindow.refresh()):(this.destroyHeaderModule(),this.showHeaderBar&&(this.headerModule=new Ir(this)),this.renderTableContainer(),(U.Browser.isDevice||U.Browser.isTouch)&&(this.scheduleTouchModule=new Rr(this)),this.initializeView(this.currentView),this.destroyPopups(),this.isPrinting||this.initializePopups())},m.prototype.validateDate=function(e){var e=(e=void 0===e?this.selectedDate:e)instanceof Date?new Date(e.getTime()):new Date(e),t=U.isNullOrUndefined(this.minDate)?new Date(1900,0,1):this.minDate instanceof Date?new Date(this.minDate.getTime()):new Date(this.minDate),i=U.isNullOrUndefined(this.maxDate)?new Date(2099,11,31):this.maxDate instanceof Date?new Date(this.maxDate.getTime()):new Date(this.maxDate);if(!(t<=i))throw Error("minDate should be equal or less than maxDate");i<(e=e<t?t:e)&&(e=i),this.setProperties({selectedDate:new Date(""+e),minDate:new Date(""+t),maxDate:new Date(""+i)},!0),this.eventWindow&&this.eventWindow.updateMinMaxDateToEditor()},m.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},m.prototype.setViewOptions=function(e){if(void 0===e&&(e=!1),!U.isNullOrUndefined(this.views)&&0!==this.views.length){this.viewOptions={},this.viewCollections=[];var t,i,n=this.viewIndex,r=0;this.viewIndex=-1;for(var a=0,s=this.views;a<s.length;a++){var o=s[a],l="string"!=typeof o,l=("string"==typeof o?this.currentView===(t=o)&&(i=t,this.viewIndex=r):(t=o.option,o.isSelected&&(i=t,this.viewIndex=r)),U.extend({option:t},l?o:{})),o=t.charAt(0).toLowerCase()+t.slice(1);l.cellHeaderTemplateName=l.cellHeaderTemplate?l.option:"",l.dateHeaderTemplateName=l.dateHeaderTemplate?l.option:"",l.dateRangeTemplateName=l.dateRangeTemplate?l.option:"",l.cellTemplateName=l.cellTemplate?l.option:"",l.dayHeaderTemplateName=l.dayHeaderTemplate?l.option:"",l.monthHeaderTemplateName=l.monthHeaderTemplate?l.option:"",l.resourceHeaderTemplateName=l.resourceHeaderTemplate?l.option:"",l.headerIndentTemplateName=l.headerIndentTemplate?l.option:"",l.eventTemplateName=l.eventTemplate?l.option:"",U.isNullOrUndefined(l.firstDayOfWeek)||0!==l.firstDayOfWeek||delete l.firstDayOfWeek,U.isNullOrUndefined(l.interval)||1!==l.interval||delete l.interval,this.viewCollections.push(l),U.isNullOrUndefined(this.viewOptions[""+o])?this.viewOptions[""+o]=[l]:this.viewOptions[""+o].push(l),r++}!e&&i&&this.setProperties({currentView:i},!0),-1===this.viewIndex&&(e=this.getViewIndex(this.currentView),this.viewIndex="string"==typeof this.views[0]||U.isNullOrUndefined(n)||-1===n?-1===e?0:e:n)}},m.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},t={byDate:!(-1<this.viewCollections[this.viewIndex].option.indexOf("Year"))&&this.group.byDate,byGroupID:this.group.byGroupID,allowGroupEdit:this.group.allowGroupEdit,resources:U.isNullOrUndefined(this.group.resources)?[]:this.group.resources,headerTooltipTemplate:this.group.headerTooltipTemplate,enableCompactView:this.group.enableCompactView,hideNonWorkingDays:-1<["Day","Week","WorkWeek","Month"].indexOf(this.currentView)&&this.group.hideNonWorkingDays},i=this.viewCollections[this.viewIndex].workDays?[]:this.workDays,i={dateFormat:this.dateFormat,endHour:this.endHour,isSelected:!1,option:null,readonly:this.readonly,startHour:this.startHour,allowVirtualScrolling:!1,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:i,monthsCount:this.monthsCount,showWeekend:this.showWeekend,showWeekNumber:this.showWeekNumber,displayName:null,interval:1,timeScale:e,timeFormat:this.internalTimeFormat,group:t,headerRows:this.headerRows,orientation:"Horizontal",numberOfWeeks:0,displayDate:null,enableLazyLoading:!1},e=this.viewCollections[this.viewIndex],t=U.extend(i,e,void 0,!0);return 0!==this.firstDayOfWeek&&e.firstDayOfWeek&&this.firstDayOfWeek!==e.firstDayOfWeek&&(t.firstDayOfWeek=this.firstDayOfWeek),t.displayDate&&(t.displayDate=t.displayDate instanceof Date?new Date(t.displayDate.getTime()):new Date(t.displayDate)),t.enableLazyLoading&&!U.isNullOrUndefined(t.group.resources)&&0<t.group.resources.length&&(-1===["Agenda","MonthAgenda","Year","TimelineYear"].indexOf(t.option)||"TimelineYear"===t.option&&"Vertical"===t.orientation)&&(t.allowVirtualScrolling=!0),t},m.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 jr(this,this.eventSettings.dataSource,this.eventSettings.query),this.crudModule=new Do(this)},m.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")}},m.prototype.initializeView=function(e){this.showSpinner(),this.activeViewOptions=this.getActiveViewOptions(),this.resourceBase&&this.resourceBase.setResourceCollection(),this.initializeTemplates(),this.renderModule.render(e)},m.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)},m.prototype.initializePopups=function(){this.eventWindow=new to(this),this.quickPopup=new _a(this)},m.prototype.getDayNames=function(e){for(var t=[],i="",n=U.isNullOrUndefined(this.locale)||"en"===this.locale||"en-US"===this.locale?U.getValue((i="days.stand-alone.")+e,U.getDefaultDateObject(this.getCalendarMode())):(i="main."+this.locale+".dates.calendars."+this.getCalendarMode()+".days.format."+e,U.getValue(i,U.cldrData)),r=0,a=Object.keys(n);r<a.length;r++){var s=a[r];t.push(U.getValue(s,n))}return t},m.prototype.setCldrTimeFormat=function(){U.isNullOrUndefined(this.timeFormat)?U.isNullOrUndefined(this.locale)||"en"===this.locale||"en-US"===this.locale?this.internalTimeFormat=U.getValue("timeFormats.short",U.getDefaultDateObject(this.getCalendarMode())):this.internalTimeFormat=U.getValue("main."+this.locale+".dates.calendars."+this.getCalendarMode()+".timeFormats.short",U.cldrData):this.internalTimeFormat=this.timeFormat},m.prototype.getCalendarMode=function(){return U.isNullOrUndefined(this.calendarMode)?"gregorian":this.calendarMode.toLowerCase()},m.prototype.getTimeString=function(e){return this.globalize.formatDate(e,{format:this.activeViewOptions.timeFormat,type:"time",calendar:this.getCalendarMode()}).toLocaleUpperCase()},m.prototype.getDateTime=function(e){return e instanceof Date?new Date(e.getTime()):new Date(e)},m.prototype.setCalendarMode=function(){"Islamic"===this.calendarMode?this.calendarUtil=new Fr:this.calendarUtil=new Nr},m.prototype.changeView=function(i,n,e,t){var r,a,s=this;U.isNullOrUndefined(t)&&(t=this.getViewIndex(i)),!e&&t===this.viewIndex&&this.currentView===i||t<0||(r=this.activeViewOptions?this.activeViewOptions.option:this.currentView,this.trigger(K,{requestType:"viewNavigate",cancel:!1,event:n},function(e){e.cancel?s.currentView=r:(e={action:"view",cancel:!1,currentDate:s.selectedDate,previousView:r,currentView:i,viewIndex:t},s.trigger($,e,function(e){var t;e.cancel?s.currentView=r:(t=-1<["Day","Week","WorkWeek"].indexOf(i)&&["Day","Week","WorkWeek"].indexOf(r)<0,s.uiStateValues.isInitial=t||-1<i.indexOf("Timeline")||-1<i.indexOf("Year"),s.uiStateValues.top=-1<i.indexOf("Timeline")&&r.indexOf("Timeline")<0?0:s.uiStateValues.top,s.viewIndex=e.viewIndex,s.setProperties({currentView:i},!0),s.headerModule&&(s.headerModule.updateActiveView(),s.headerModule.setCalendarDate(s.selectedDate),s.headerModule.setCalendarView()),s.initializeView(s.currentView),s.animateLayout(),a={requestType:"viewNavigate",cancel:!1,event:n},s.trigger(Z,a))}))}))},m.prototype.changeDate=function(t,i){var n,r=this;this.trigger(K,{requestType:"dateNavigate",cancel:!1,event:i},function(e){e.cancel||(e={action:"date",cancel:!1,previousDate:r.selectedDate,currentDate:t},r.trigger($,e,function(e){e.cancel||(r.uiStateValues.isInitial=r.activeView.isTimelineView()&&"TimelineYear"!==r.currentView,r.validateDate(e.currentDate),r.headerModule&&r.headerModule.setCalendarDate(e.currentDate),"MonthAgenda"===r.currentView&&r.monthAgendaModule&&(r.monthAgendaModule.monthAgendaDate=new Date(""+r.selectedDate)),r.initializeView(r.currentView),r.animateLayout(),n={requestType:"dateNavigate",cancel:!1,event:i},r.trigger(Z,n))}))})},m.prototype.isMinMaxDate=function(e){void 0===e&&(e=this.selectedDate);var t=U.isNullOrUndefined(this.maxDate)?new Date(2099,11,31):this.maxDate,i=U.isNullOrUndefined(this.minDate)?new Date(1900,0,1):this.minDate;return e.getTime()>=i.getTime()&&e.getTime()<=t.getTime()},m.prototype.isSelectedDate=function(e){return e.setHours(0,0,0,0)===new Date(""+this.selectedDate).setHours(0,0,0,0)},m.prototype.getCurrentTime=function(e){return void 0===e&&(e=new Date),this.timezone?this.tzModule.convert(e,this.tzModule.getLocalTimezoneName(),this.timezone):e},m.prototype.getNavigateView=function(){return this.activeView.isTimelineView()?"TimelineMonth"===this.currentView||"TimelineYear"===this.currentView?"TimelineDay":"Agenda":"Day"},m.prototype.animateLayout=function(){this.activeView.element&&new U.Animation({duration:600,name:"FadeIn",timingFunction:"easeIn"}).animate(this.activeView.element)},m.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];e.push({member:"timelineDay"===n||"timelineWeek"===n||"timelineWorkWeek"===n?"timelineViews":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},m.prototype.preRender=function(){this.isAdaptive=U.Browser.isDevice||rt(),this.globalize=new U.Internationalization(this.locale),this.tzModule=new Br,(this&&U.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}),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 U.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()},m.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.",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"}},m.prototype.wireEvents=function(){U.EventHandler.add(window,"resize",this.onScheduleResize,this),U.EventHandler.add(window,"orientationchange",this.onScheduleResize,this),U.EventHandler.add(document,U.Browser.touchStartEvent,this.onDocumentClick,this)},m.prototype.removeSelectedClass=function(){for(var e=this.getSelectedCells(),t=0,i=e;t<i.length;t++){var n=i[t];"Year"!==this.currentView&&n.setAttribute("aria-selected","false"),n.removeAttribute("tabindex")}U.removeClass(e,ni),this.keyboardInteractionModule&&0<this.keyboardInteractionModule.selectedCells.length&&(this.keyboardInteractionModule.selectedCells=[])},m.prototype.addSelectedClass=function(e,t,i){if("Year"!==this.currentView)for(var n=0,r=e;n<r.length;n++)r[n].setAttribute("aria-selected","true");U.addClass(e,ni),t&&(t.setAttribute("tabindex","0"),t.focus({preventScroll:i||!1}))},m.prototype.selectCell=function(e){this.removeSelectedClass(),this.addSelectedClass([e],e)},m.prototype.getAllDayRow=function(){return this.element.querySelector("."+vt)},m.prototype.getContentTable=function(){return this.activeView.element.querySelector("."+S+" tbody")},m.prototype.getTableRows=function(){return[].slice.call(this.element.querySelectorAll("."+S+" tbody tr:not(."+sr+")"))},m.prototype.getWorkCellElements=function(){return[].slice.call(this.element.querySelectorAll("."+O))},m.prototype.getIndexOfDate=function(e,t){return e.map(Number).indexOf(+t)},m.prototype.isAllDayCell=function(e){return!(!(-1<["Month","TimelineMonth","TimelineYear","MonthAgenda"].indexOf(this.currentView)||e.classList.contains(v)||e.classList.contains(Dt))&&this.activeViewOptions.timeScale.enable&&!(this.activeView.isTimelineView()&&0<this.activeViewOptions.headerRows.length&&"Hour"!==this.activeViewOptions.headerRows.slice(-1)[0].option))},m.prototype.getDateFromElement=function(e){var t;if(U.isNullOrUndefined(e)||(t=e.getAttribute("data-date")),!U.isNullOrUndefined(t))return e=parseInt(t,10),new Date(e)},m.prototype.getTargetElement=function(e,t,i){var n,t=document.elementFromPoint(t,i);return(n=t?t.closest(e):n)?[n]:null},m.prototype.getCellHeaderTemplate=function(){return this.cellHeaderTemplateFn},m.prototype.getDayHeaderTemplate=function(){return this.dayHeaderTemplateFn},m.prototype.getMonthHeaderTemplate=function(){return this.monthHeaderTemplateFn},m.prototype.getCellTemplate=function(){return this.cellTemplateFn},m.prototype.getDateHeaderTemplate=function(){return this.dateHeaderTemplateFn},m.prototype.getDateRangeTemplate=function(){return this.dateRangeTemplateFn},m.prototype.getMajorSlotTemplate=function(){return this.majorSlotTemplateFn},m.prototype.getMinorSlotTemplate=function(){return this.minorSlotTemplateFn},m.prototype.getAppointmentTemplate=function(){return this.appointmentTemplateFn},m.prototype.getEventTooltipTemplate=function(){return this.eventTooltipTemplateFn},m.prototype.getHeaderTooltipTemplate=function(){return this.headerTooltipTemplateFn},m.prototype.getEditorTemplate=function(){return this.editorTemplateFn},m.prototype.getEditorHeaderTemplate=function(){return this.editorHeaderTemplateFn},m.prototype.getEditorFooterTemplate=function(){return this.editorFooterTemplateFn},m.prototype.getQuickInfoTemplatesHeader=function(){return this.quickInfoTemplatesHeaderFn},m.prototype.getQuickInfoTemplatesContent=function(){return this.quickInfoTemplatesContentFn},m.prototype.getQuickInfoTemplatesFooter=function(){return this.quickInfoTemplatesFooterFn},m.prototype.getResourceHeaderTemplate=function(){return this.resourceHeaderTemplateFn},m.prototype.getHeaderIndentTemplate=function(){return this.headerIndentTemplateFn},m.prototype.getCssProperties=function(){return{border:this.enableRtl?"borderLeftWidth":"borderRightWidth",padding:this.enableRtl?"paddingLeft":"paddingRight",rtlBorder:this.enableRtl?"borderRightWidth":"borderLeftWidth",rtlPadding:this.enableRtl?"paddingRight":"paddingLeft"}},m.prototype.removeNewEventElement=function(){var e=this.element.querySelector("."+Pi);U.isNullOrUndefined(e)||U.remove(e)},m.prototype.getStartEndTime=function(e){var t;return U.isNullOrUndefined(e)||""===e?null:(t=W(new Date(this.currentTimezoneDate)||this.getCurrentTime()),2===(e=e.split(":")).length&&t.setHours(parseInt(e[0],10),parseInt(e[1],10),0),t)},m.prototype.onDocumentClick=function(e){this.notify(Ee,{event:e})},m.prototype.onScheduleResize=function(){var e;U.isNullOrUndefined(this.activeView)||(this.isAdaptive||nt())&&document.activeElement&&document.activeElement.classList.contains(Ln)||this.uiStateValues.isTapHold||(this.virtualScrollModule&&this.activeView.isTimelineView()&&this.virtualScrollModule.refreshLayout(),this.activeViewOptions.timeScale.enable&&this.activeView&&this.activeView.highlightCurrentTime(),this.quickPopup&&this.quickPopup.onClosePopup(),Ze(),"Month"===this.currentView||"Agenda"!==this.currentView&&"MonthAgenda"!==this.currentView&&!this.activeViewOptions.timeScale.enable||this.activeView.isTimelineView()?(this.activeView.resetColWidth(),this.notify(Se,{cssProperties:this.getCssProperties(),isPreventScrollUpdate:!0}),e=!1,this.activeViewOptions.enableLazyLoading&&this.virtualScrollModule&&this.virtualScrollModule.isRemoteRefresh&&(e=this.virtualScrollModule.isRemoteRefresh,this.virtualScrollModule.isRemoteRefresh=!1),this.refreshEvents(e)):this.notify(De,{}))},m.prototype.templateParser=function(t){if(t)try{return"function"!=typeof t&&document.querySelectorAll(t).length?U.compile(document.querySelector(t).innerHTML.trim()):U.compile(t)}catch(e){return U.compile(t)}},m.prototype.getSelectedCells=function(){return[].slice.call(this.element.querySelectorAll("."+ni))},m.prototype.getAnnouncementString=function(e,t){this.quickPopup&&0<this.activeViewOptions.group.resources.length&&(i=this.quickPopup.getResourceText({event:e},"event")+'"s event - ');var i,t=t||e[this.eventFields.subject]||this.eventSettings.fields.subject.default,n=e[this.eventFields.location]||this.eventSettings.fields.location.default,r=this.globalize.formatDate(e[this.eventFields.startTime],{type:"dateTime",skeleton:"full",calendar:this.getCalendarMode()}),a=this.globalize.formatDate(e[this.eventFields.endTime],{type:"dateTime",skeleton:"full",calendar:this.getCalendarMode()}),t=t+" "+this.localeObj.getConstant("beginFrom")+" "+r+" "+this.localeObj.getConstant("endAt")+" "+a;return i&&(t=i+" "+t),n&&""!==n&&(t=t+" "+this.localeObj.getConstant("location")+" "+n),t=e[this.eventFields.recurrenceRule]&&""!==e[this.eventFields.recurrenceRule]&&e[this.eventFields.id]===e[this.eventFields.recurrenceID]?t+" "+this.localeObj.getConstant("recurringEvent"):t},m.prototype.boundaryValidation=function(e,t){var i={left:!1,right:!1,top:!1,bottom:!1},n=this.element.querySelector("."+I).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},m.prototype.getWeekNumberContent=function(e){var t,i,n;return"FirstDay"===this.weekRule?(t=He(e.slice(-1)[0],this.firstDayOfWeek),t=this.globalize.formatNumber(Le(t))):"FirstFourDayWeek"===this.weekRule?(i=Ne(n=Re(e.slice(-1)[0],this.firstDayOfWeek),He(e.slice(-1)[0],this.firstDayOfWeek)),t=this.globalize.formatNumber(Le(i))):"FirstFullWeek"===this.weekRule&&(n=Re(e.slice(-1)[0],this.firstDayOfWeek),t=this.globalize.formatNumber(Le(n))),t},m.prototype.renderHeaderIndentTemplate=function(e,t){var i;this.activeViewOptions.headerIndentTemplate&&(i=this.element.id+"_"+this.activeViewOptions.headerIndentTemplateName+"headerIndentTemplate",e=[].slice.call(this.getHeaderIndentTemplate()(e,this,"headerIndentTemplate",i,!1,void 0,void 0,this.root)),U.append(e,t))},m.prototype.isSpecificResourceEvents=function(){return 0<this.activeViewOptions.group.resources.length&&!this.activeViewOptions.group.allowGroupEdit&&!this.rowAutoHeight&&!this.virtualScrollModule&&this.activeViewOptions.group.byGroupID},m.prototype.unWireEvents=function(){U.EventHandler.remove(window,"resize",this.onScheduleResize),U.EventHandler.remove(window,"orientationchange",this.onScheduleResize),U.EventHandler.remove(document,U.Browser.touchStartEvent,this.onDocumentClick)},m.prototype.getModuleName=function(){return"schedule"},m.prototype.getPersistData=function(){return this.addOnPersist(["currentView","selectedDate","scrollTop","scrollLeft","adaptiveGroupIndex"])},m.prototype.onPropertyChanged=function(e,t){if(!this.isReact||!U.isNullOrUndefined(this.activeView)){for(var i={isRefresh:!1,isResource:!1,isDate:!1,isView:!1,isLayout:!1,isDataManager:!1},n=0,r=Object.keys(e);n<r.length;n++){var a=r[n];switch(a){case"views":this.setViewOptions(),this.headerModule&&this.headerModule.updateItems(),i.isView=!0;break;case"currentView":i.isView=!0;break;case"minDate":case"maxDate":case"selectedDate":i.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 Ir(this),this.headerModule.updateDateRange()),this.notify(Se,{cssProperties:this.getCssProperties()}),this.activeView.isTimelineView()&&this.refreshEvents(!1);break;case"workDays":JSON.stringify(t.workDays)!==JSON.stringify(e.workDays)&&(i.isLayout=!0);break;case"showWeekend":case"startHour":case"endHour":case"workHours":case"readonly":case"headerRows":case"showWeekNumber":case"rowAutoHeight":i.isLayout=!0;break;case"locale":case"calendarMode":this.globalize=new U.Internationalization(this.locale),this.localeObj=new U.L10n(this.getModuleName(),this.defaultLocale,this.locale),this.setCldrTimeFormat(),this.setCalendarMode(),i.isRefresh=!0;break;case"firstDayOfWeek":this.activeViewOptions.firstDayOfWeek=e.firstDayOfWeek,this.eventWindow&&this.eventWindow.refreshRecurrenceEditor(),i.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),i.isLayout=!0;break;case"cellTemplate":this.activeViewOptions.cellTemplate=e.cellTemplate,this.cellTemplateFn=this.templateParser(this.activeViewOptions.cellTemplate),i.isLayout=!0;break;case"dateHeaderTemplate":this.activeViewOptions.dateHeaderTemplate=e.dateHeaderTemplate,this.dateHeaderTemplateFn=this.templateParser(this.activeViewOptions.dateHeaderTemplate),i.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),i.isLayout=!0;break;case"monthHeaderTemplate":this.activeViewOptions.monthHeaderTemplate=e.monthHeaderTemplate,this.monthHeaderTemplateFn=this.templateParser(this.activeViewOptions.monthHeaderTemplate),i.isLayout=!0;break;case"resourceHeaderTemplate":this.activeViewOptions.resourceHeaderTemplate=e.resourceHeaderTemplate,this.resourceHeaderTemplateFn=this.templateParser(this.activeViewOptions.resourceHeaderTemplate),i.isLayout=!0;break;case"timezone":this.eventBase.timezonePropertyChange(t.timezone),this.headerModule&&this.headerModule.setCalendarTimezone();break;case"enableRtl":this.setRtlClass(),i.isRefresh=!0;break;default:this.extendedPropertyChange(a,e,t,i)}}this.propertyChangeAction(i)}},m.prototype.propertyChangeAction=function(e){e.isRefresh?this.refresh():e.isResource?this.initializeResources(!0):e.isView?this.changeView(this.currentView,null,!0):e.isDate?(U.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="",U.removeClass([this.element],Hi)),this.crudModule.refreshDataManager())},m.prototype.allDayRowScrollUpdate=function(){var e=this.element.querySelector("."+Tt),t=this.element.querySelector("."+vt);"auto"!==this.height&&this.enableAllDayScroll?(e.classList.contains(xr)&&U.removeClass([e],xr),this.eventBase.allDayExpandScroll(e)):(U.addClass([e],xr),e.classList.contains(Vr)&&U.removeClass([e],Vr),this.uiStateValues.expand&&((e=[].slice.call(this.element.querySelectorAll("."+v)))[0].style.height=t.style.height||e[1].style.height)),this.uiStateValues.expand||(t.style.height="")},m.prototype.extendedPropertyChange=function(e,t,i,n){switch(e){case"width":case"height":case"enableAllDayScroll":-1<["Day","Week","WorkWeek"].indexOf(this.currentView)&&this.allDayRowScrollUpdate(),this.notify(Oe,{module:"scroll",properties:{width:t.width,height:t.height}});break;case"cssClass":i.cssClass&&U.removeClass([this.element],i.cssClass.split(" ")),t.cssClass&&U.addClass([this.element],t.cssClass.split(" "));break;case"hideEmptyAgendaDays":case"agendaDaysCount":this.activeViewOptions=this.getActiveViewOptions(),n.isView=!0;break;case"eventSettings":this.onEventSettingsPropertyChanged(t.eventSettings,i.eventSettings,n);break;case"allowKeyboardInteraction":this.keyboardInteractionModule&&(this.keyboardInteractionModule.destroy(),this.keyboardInteractionModule=null),t.allowKeyboardInteraction&&(this.keyboardInteractionModule=new Pr(this));break;case"timezoneDataSource":this.eventWindow&&this.eventWindow.refresh();break;case"editorTemplate":U.isNullOrUndefined(this.editorTemplate)||(this.editorTemplateFn=this.templateParser(this.editorTemplate)),this.eventWindow&&this.eventWindow.setDialogContent();break;case"editorHeaderTemplate":U.isNullOrUndefined(this.editorHeaderTemplate)||(this.editorHeaderTemplateFn=this.templateParser(this.editorHeaderTemplate)),this.eventWindow&&this.eventWindow.setDialogHeader();break;case"editorFooterTemplate":U.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(t.group,i.group,n);break;case"resources":n.isResource=!0;break;case"timeScale":this.activeViewOptions.timeScale.interval=t.timeScale.interval||this.activeViewOptions.timeScale.interval,this.activeViewOptions.timeScale.slotCount=t.timeScale.slotCount||this.activeViewOptions.timeScale.slotCount,this.eventWindow&&this.eventWindow.refreshDateTimePicker(),n.isLayout=!0;break;case"allowDragAndDrop":case"allowResizing":case"eventDragArea":this.refreshEvents(!1);break;case"weekRule":n.isLayout=!0;break;case"firstMonthOfYear":this.activeViewOptions.firstMonthOfYear=t.firstMonthOfYear,this.viewIndex=this.activeView.viewIndex,n.isLayout=!0;break;case"monthsCount":this.activeViewOptions.monthsCount=t.monthsCount,this.viewIndex=this.activeView.viewIndex,n.isLayout=!0;break;case"timeFormat":this.internalTimeFormat=t.timeFormat||this.activeViewOptions.timeFormat,this.eventWindow&&this.eventWindow.refreshDateTimePicker(),n.isLayout=!0;break;case"enableAdaptiveUI":this.showHeaderBar&&this.headerModule&&(this.destroyHeaderModule(),this.headerModule=new Ir(this),this.headerModule.updateDateRange()),n.isLayout=!0;break;case"headerIndentTemplate":this.activeViewOptions.headerIndentTemplate=t.headerIndentTemplate,this.headerIndentTemplateFn=this.templateParser(this.activeViewOptions.headerIndentTemplate),n.isLayout=!0}},m.prototype.setRtlClass=function(){this.enableRtl?U.addClass([this.element],"e-rtl"):U.removeClass([this.element],"e-rtl")},m.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())},m.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 Ga(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}},m.prototype.destroyHeaderModule=function(){this.headerModule&&(this.headerModule.destroy(),this.headerModule=null)},m.prototype.destroyPopups=function(){this.quickPopup&&(this.quickPopup.destroy(),this.quickPopup=null),this.eventWindow&&(this.eventWindow.destroy(),this.eventWindow=null)},m.prototype.showSpinner=function(){M.showSpinner(this.element)},m.prototype.hideSpinner=function(){M.hideSpinner(this.element)},m.prototype.setWorkHours=function(e,t,i,n){e=this.getWorkHourCells(e,t,i,n);U.addClass(e,ft)},m.prototype.resetWorkHours=function(e,t,i,n){(e=void 0===e?this.activeView.renderDates:e)&&t&&i?(e=this.getWorkHourCells(e,t,i,n),U.removeClass(e,ft)):(t=[].slice.call(this.element.querySelectorAll("."+ft)),U.removeClass(t,ft))},m.prototype.getWorkHourCells=function(e,t,i,n){if(-1<["Agenda","MonthAgenda","Month","TimelineMonth"].indexOf(this.currentView))return[];var t=this.getStartEndTime(t),i=this.getStartEndTime(i),r=this.getContentTable();if(U.isNullOrUndefined(t)||U.isNullOrUndefined(i)||!r)return[];t.setMilliseconds(0),i.setMilliseconds(0);var a=this.activeView.getStartHour(),s=(t<a&&(t=a),this.activeView.getEndHour());s<i&&(i=s);for(var o=this.activeViewOptions.timeScale.interval*xe/this.activeViewOptions.timeScale.slotCount,l=(a.getTimezoneOffset()-t.getTimezoneOffset())*xe,p=g=Math.round((t.getTime()-a.getTime()+l)/o),c=m=Math.ceil((i.getTime()-a.getTime()+l)/o),h=[],d=0,u=e;d<u.length;d++){var g,m,v=u[d],f=(W(v=this.getDateTime(v)),this.activeView.renderDates),y=(U.isNullOrUndefined(n)||!this.resourceBase||this.activeView.isTimelineView()||(f=this.resourceBase.lastResourceLevel[parseInt(n.toString(),10)].renderDates),this.getIndexOfDate(f,v));if(0<=y){this.activeView.isTimelineView()&&(g=p+y*(f=Math.round((s.getTime()-a.getTime())/o)),m=c+y*f);for(var T,w,D=g;D<m;D++)this.activeView.isTimelineView()?(T=U.isNullOrUndefined(n)?0:n,h.push(r.rows[parseInt(T.toString(),10)].cells[parseInt(D.toString(),10)])):U.isNullOrUndefined(n)?h.push(r.rows[parseInt(D.toString(),10)].cells[parseInt(y.toString(),10)]):(T="."+O+'[data-group-index="'+n+'"]',w=[].slice.call(r.rows[parseInt(D.toString(),10)].querySelectorAll(T)),h.push(w[parseInt(y.toString(),10)]))}}return h},m.prototype.getCellDetails=function(e){var t,i,n=e instanceof Array?e:[e],r=U.getElement(n[0]),n=U.getElement(n.slice(-1)[0]),a=this.getDateFromElement(r),s=this.getDateFromElement(n);if(!U.isNullOrUndefined(a)&&!U.isNullOrUndefined(s))return t=(i=this.activeView.isTimelineView()&&!U.isNullOrUndefined(n.getAttribute("colSpan"))&&0<this.headerRows.length)?parseInt(n.getAttribute("colSpan"),10):1,a={startTime:a,endTime:s=!this.activeViewOptions.timeScale.enable||i||n.classList.contains(v)||n.classList.contains(Dt)?z(new Date(s.getTime()),t):this.activeView.getEndDateFromStartDate(s),isAllDay:this.isAllDayCell(r),element:e},i=r.getAttribute("data-group-index"),U.isNullOrUndefined(i)||(a.groupIndex=parseInt(i,10)),a},m.prototype.getSelectedElements=function(){return this.keyboardInteractionModule&&0<this.keyboardInteractionModule.selectedCells.length?this.keyboardInteractionModule.selectedCells:this.getSelectedCells()},m.prototype.getResourceCollections=function(){return this.resourceCollection},m.prototype.setResourceCollections=function(e,t){!(t=void 0===t?!0:t)&&this.uiStateValues&&(this.uiStateValues.isPreventEventRefresh=!0),this.setProperties({resources:e},!1)},m.prototype.changeCurrentView=function(e,t){var i=this.getViewIndex(e),n=e.charAt(0).toLowerCase()+e.slice(1),n=this.viewOptions[""+n];-1!==(i=n?this.viewCollections.indexOf(n[t||0]):i)&&i!==this.viewIndex&&this.changeView(e,null,null,i)},m.prototype.getCurrentViewIndex=function(){return this.viewIndex},m.prototype.getResourcesByIndex=function(e){var t,i;return!this.resourceBase||!this.resourceBase.lastResourceLevel||e<0||e>=this.resourceBase.lastResourceLevel.length?void 0:(t=this.resourceBase.lastResourceLevel[parseInt(e.toString(),10)],this.resourceBase.setResourceValues(i={},e),{resource:t.resource,resourceData:t.resourceData,groupData:i})},m.prototype.expandResource=function(e,t){this.activeView.isTimelineView()&&this.resourceBase&&1<this.resourceCollection.length&&this.resourceBase.resourceExpand(e,t,!1)},m.prototype.collapseResource=function(e,t){this.activeView.isTimelineView()&&this.resourceBase&&1<this.resourceCollection.length&&this.resourceBase.resourceExpand(e,t,!0)},m.prototype.scrollTo=function(e,t){this.activeView.scrollToDate&&U.isNullOrUndefined(e)&&t?this.activeView.scrollToDate(t):this.activeView.scrollToHour&&this.activeView.scrollToHour(e,t)},m.prototype.scrollToResource=function(e,t){this.resourceBase&&this.resourceBase.lastResourceLevel&&this.resourceBase.resourceScroll(e,t)},m.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)},m.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)},m.prototype.addEvent=function(e){this.crudModule.addEvent(e)},m.prototype.generateEventOccurrences=function(e,t){return this.eventBase?this.eventBase.generateOccurrence(e,t):[]},m.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)},m.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)},m.prototype.saveEvent=function(e,t){this.crudModule.saveEvent(e,t)},m.prototype.deleteEvent=function(e,t){this.crudModule.deleteEvent(e,t)},m.prototype.getEvents=function(e,t,i){var n=[],n=i?this.eventBase.getProcessedEvents():this.eventsData;return e=e&&this.getDateTime(e),t=t&&this.getDateTime(t),n=this.eventBase.filterEventsByRange(n,e,t)},m.prototype.getBlockEvents=function(e,t,i){var n=[],n=i?this.eventBase.getProcessedEvents(this.blockData):this.blockData;return e=e&&this.getDateTime(e),t=t&&this.getDateTime(t),n=this.eventBase.filterEventsByRange(n,e,t)},m.prototype.getOccurrencesByID=function(e){return this.eventBase.getOccurrencesByID(e)},m.prototype.getOccurrencesByRange=function(e,t){return e=this.getDateTime(e),t=this.getDateTime(t),this.eventBase.getOccurrencesByRange(e,t)},m.prototype.getCurrentViewDates=function(){return this.activeView?this.activeView.renderDates:[]},m.prototype.setRecurrenceEditor=function(e){this.eventWindow.setRecurrenceEditor(e)},m.prototype.getEventMaxID=function(){return this.eventBase.getEventMaxID()},m.prototype.getDeletedOccurrences=function(e){return this.eventBase.getDeletedOccurrences(e)},m.prototype.getCurrentViewEvents=function(){return this.eventsProcessed},m.prototype.refreshEvents=function(e){(e=void 0===e?!0:e)?(this.dragAndDropModule&&(this.dragAndDropModule.actionObj.action="",U.removeClass([this.element],Hi)),this.crudModule.refreshDataManager()):(this.uiStateValues&&(this.uiStateValues.isPreventTimezone=!0),this.crudModule&&this.crudModule.refreshProcessedData(),this.uiStateValues&&(this.uiStateValues.isPreventTimezone=!1))},m.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 _a(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 Ga(this),this.eventTooltipTemplateFn=this.templateParser(this.eventSettings.tooltipTemplate),this.headerTooltipTemplateFn=this.templateParser(this.activeViewOptions.group.headerTooltipTemplate);break;default:this.initializeView(this.currentView)}},m.prototype.refreshLayout=function(){this.onScheduleResize(),this.headerModule&&this.headerModule.refresh(),this.eventWindow&&this.eventWindow.refresh()},m.prototype.getEventDetails=function(e){e=(e=U.getElement(e)).getAttribute("data-guid");return e?this.eventBase.getEventByGuid(e):{}},m.prototype.isSlotAvailable=function(e,t,i){var n,r,a=this,s=this.activeEventData.event;return e instanceof Date||"string"==typeof e?(n=e,r=t):(n=(s=e)[this.eventFields.startTime],r=e[this.eventFields.endTime],this.resourceBase&&(i=this.eventBase.getGroupIndexFromEvent(e))),!(!U.isNullOrUndefined(n)&&!U.isNullOrUndefined(r)&&(n=this.getDateTime(n),r=this.getDateTime(r),t=this.eventBase.filterEvents(n,r),!U.isNullOrUndefined(i)&&this.resourceBase&&0<this.resourceBase.lastResourceLevel.length&&(t=this.eventBase.filterEventsByResource(this.resourceBase.lastResourceLevel[parseInt(i.toString(),10)],t)),0<(t=s?s.Guid?t.filter(function(e){return e.Guid!==s.Guid}):t.filter(function(e){return e[a.eventFields.id]!==s[a.eventFields.id]}):t).length))},m.prototype.openEditor=function(e,t,i,n){"Add"!==t||i?(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),U.isNullOrUndefined(e.element)||(e.element=U.getElement(e.element))),"Add"!==(this.currentAction=t)&&(this.activeEventData.event=e),this.eventWindow.openEditor(e,t,i,n)},m.prototype.closeEditor=function(){this.eventWindow&&this.eventWindow.dialogClose()},m.prototype.openQuickInfoPopup=function(t){var e,i,n,r=this;"Year"===this.currentView||U.isNullOrUndefined(t)||(U.isNullOrUndefined(t[this.eventFields.id])?"Agenda"===this.currentView||"MonthAgenda"===this.currentView||U.isNullOrUndefined(this.activeView)||(i={startTime:this.activeCellsData.startTime=this.getDateTime(t[this.eventFields.startTime]),endTime:this.activeCellsData.endTime=this.getDateTime(t[this.eventFields.endTime]),isAllDay:this.activeCellsData.isAllDay=!U.isNullOrUndefined(t[this.eventFields.isAllDay])&&t[this.eventFields.isAllDay]},(e=this.activeView.getAdjustedDate(new Date(i.startTime)))&&(n="."+O+'[data-date="'+e.getTime()+'"]',0<this.activeViewOptions.group.resources.length&&!this.uiStateValues.isGroupAdaptive&&this.resourceBase&&this.eventBase&&(i.groupIndex=this.eventBase.getGroupIndexFromEvent(t),n="."+O+'[data-date="'+e.getTime()+'"][data-group-index="'+i.groupIndex+'"]'),e=this.element.querySelector(n))&&(e.focus(),i.element=e,this.notify(F,i))):(n=this.getCurrentViewEvents().filter(function(e){return t[r.eventFields.id]===e[r.eventFields.id]})).length<=0||(e=n[0],t[this.eventFields.recurrenceRule]&&0<(i=n.filter(function(e){return e[r.eventFields.startTime].getTime()===t[r.eventFields.startTime].getTime()})).length&&(e=i[0]),(n=this.element.querySelector('div[data-guid="'+e.Guid+'"]'))&&(this.eventBase.removeSelectedAppointmentClass(),this.eventBase.addSelectedAppointments([n],!1),this.activeEventData={event:e,element:n},"Agenda"!==this.currentView&&"MonthAgenda"!==this.currentView||U.addClass([this.activeEventData.element],Di),this.notify(te,this.activeEventData))))},m.prototype.closeQuickInfoPopup=function(){this.quickPopup&&this.quickPopup.quickPopupHide(!0)},m.prototype.closeTooltip=function(){this.eventTooltip&&this.eventTooltip.close()},m.prototype.selectResourceByIndex=function(e){this.resourceBase&&this.uiStateValues.isGroupAdaptive&&this.resourceBase.selectResourceByIndex(e)},m.prototype.getIndexFromResourceId=function(e,t){return this.resourceBase?this.resourceBase.getIndexFromResourceId(e,t):null},m.prototype.addResource=function(e,t,i){this.resourceBase.addResource(e,t,i)},m.prototype.removeResource=function(e,t){this.resourceBase.removeResource(e,t)},m.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),Xo.prototype.destroy.call(this);for(var e=0,t=["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"];e<t.length;e++)this[""+t[e]]=null;et(this.element);var i=[ot,lt,pt,ht];this.cssClass&&(i=i.concat(this.cssClass.split(" "))),U.removeClass([this.element],i)},g([U.Property("auto")],m.prototype,"width",void 0),g([U.Property("auto")],m.prototype,"height",void 0),g([U.Property(!0)],m.prototype,"showHeaderBar",void 0),g([U.Property(!0)],m.prototype,"showTimeIndicator",void 0),g([U.Property(!0)],m.prototype,"allowSwiping",void 0),g([U.Collection([],Fo)],m.prototype,"toolbarItems",void 0),g([U.Property("Week")],m.prototype,"currentView",void 0),g([U.Property(["Day","Week","WorkWeek","Month","Agenda"])],m.prototype,"views",void 0),g([U.Property(new Date)],m.prototype,"selectedDate",void 0),g([U.Property(new Date(1900,0,1))],m.prototype,"minDate",void 0),g([U.Property(new Date(2099,11,31))],m.prototype,"maxDate",void 0),g([U.Property()],m.prototype,"dateFormat",void 0),g([U.Property("Gregorian")],m.prototype,"calendarMode",void 0),g([U.Property(!0)],m.prototype,"showWeekend",void 0),g([U.Property(0)],m.prototype,"firstDayOfWeek",void 0),g([U.Property("FirstDay")],m.prototype,"weekRule",void 0),g([U.Property([1,2,3,4,5])],m.prototype,"workDays",void 0),g([U.Property(12)],m.prototype,"monthsCount",void 0),g([U.Property("00:00")],m.prototype,"startHour",void 0),g([U.Property("24:00")],m.prototype,"endHour",void 0),g([U.Property(null)],m.prototype,"timeFormat",void 0),g([U.Property(!0)],m.prototype,"enableHtmlSanitizer",void 0),g([U.Property(!1)],m.prototype,"enableAllDayScroll",void 0),g([U.Property(!1)],m.prototype,"enableAdaptiveUI",void 0),g([U.Property(!0)],m.prototype,"allowResizing",void 0),g([U.Complex({},Za)],m.prototype,"workHours",void 0),g([U.Complex({},Ja)],m.prototype,"timeScale",void 0),g([U.Property(!0)],m.prototype,"allowKeyboardInteraction",void 0),g([U.Property(!0)],m.prototype,"allowDragAndDrop",void 0),g([U.Property()],m.prototype,"dateHeaderTemplate",void 0),g([U.Property()],m.prototype,"dateRangeTemplate",void 0),g([U.Property()],m.prototype,"cellHeaderTemplate",void 0),g([U.Property()],m.prototype,"dayHeaderTemplate",void 0),g([U.Property()],m.prototype,"monthHeaderTemplate",void 0),g([U.Property()],m.prototype,"cellTemplate",void 0),g([U.Property(!1)],m.prototype,"readonly",void 0),g([U.Property(!0)],m.prototype,"showQuickInfo",void 0),g([U.Property(!1)],m.prototype,"allowInline",void 0),g([U.Property(!0)],m.prototype,"allowMultiCellSelection",void 0),g([U.Property(!0)],m.prototype,"allowMultiRowSelection",void 0),g([U.Property(!1)],m.prototype,"quickInfoOnSelectionEnd",void 0),g([U.Property(!1)],m.prototype,"showWeekNumber",void 0),g([U.Property(!1)],m.prototype,"rowAutoHeight",void 0),g([U.Property(!1)],m.prototype,"allowMultiDrag",void 0),g([U.Property(0)],m.prototype,"firstMonthOfYear",void 0),g([U.Property()],m.prototype,"editorTemplate",void 0),g([U.Property()],m.prototype,"editorHeaderTemplate",void 0),g([U.Property()],m.prototype,"editorFooterTemplate",void 0),g([U.Complex({},co)],m.prototype,"quickInfoTemplates",void 0),g([U.Property(7)],m.prototype,"agendaDaysCount",void 0),g([U.Property(!0)],m.prototype,"hideEmptyAgendaDays",void 0),g([U.Property(!0)],m.prototype,"enableRecurrenceValidation",void 0),g([U.Property()],m.prototype,"timezone",void 0),g([U.Complex({},To)],m.prototype,"eventSettings",void 0),g([U.Property(zr)],m.prototype,"timezoneDataSource",void 0),g([U.Property()],m.prototype,"resourceHeaderTemplate",void 0),g([U.Property()],m.prototype,"headerIndentTemplate",void 0),g([U.Complex({},Vo)],m.prototype,"group",void 0),g([U.Collection([],h)],m.prototype,"resources",void 0),g([U.Collection([],mo)],m.prototype,"headerRows",void 0),g([U.Property()],m.prototype,"cssClass",void 0),g([U.Property()],m.prototype,"eventDragArea",void 0),g([U.Event()],m.prototype,"created",void 0),g([U.Event()],m.prototype,"destroyed",void 0),g([U.Event()],m.prototype,"cellClick",void 0),g([U.Event()],m.prototype,"cellDoubleClick",void 0),g([U.Event()],m.prototype,"moreEventsClick",void 0),g([U.Event()],m.prototype,"hover",void 0),g([U.Event()],m.prototype,"select",void 0),g([U.Event()],m.prototype,"actionBegin",void 0),g([U.Event()],m.prototype,"actionComplete",void 0),g([U.Event()],m.prototype,"actionFailure",void 0),g([U.Event()],m.prototype,"navigating",void 0),g([U.Event()],m.prototype,"renderCell",void 0),g([U.Event()],m.prototype,"eventClick",void 0),g([U.Event()],m.prototype,"eventDoubleClick",void 0),g([U.Event()],m.prototype,"eventRendered",void 0),g([U.Event()],m.prototype,"dataBinding",void 0),g([U.Event()],m.prototype,"popupOpen",void 0),g([U.Event()],m.prototype,"popupClose",void 0),g([U.Event()],m.prototype,"dragStart",void 0),g([U.Event()],m.prototype,"drag",void 0),g([U.Event()],m.prototype,"dragStop",void 0),g([U.Event()],m.prototype,"resizeStart",void 0),g([U.Event()],m.prototype,"resizing",void 0),g([U.Event()],m.prototype,"resizeStop",void 0),g([U.Event()],m.prototype,"virtualScrollStart",void 0),g([U.Event()],m.prototype,"virtualScrollStop",void 0),g([U.Event()],m.prototype,"dataBound",void 0),g([U.NotifyPropertyChanges],m));function m(e,t){e=Xo.call(this,e,t)||this;return e.adaptiveGroupIndex=0,e}Ko.prototype.getChangedData=function(e){var t,i,n,r=this,a=U.extend({},this.actionObj.event,null,!0);return a[this.parent.eventFields.startTime]=this.actionObj.start,a[this.parent.eventFields.endTime]=this.actionObj.end,U.isNullOrUndefined(this.actionObj.isAllDay)||(a[this.parent.eventFields.isAllDay]=this.actionObj.isAllDay),0<this.parent.activeViewOptions.group.resources.length&&(t=this.getOriginalElement(this.actionObj.element))&&(-1===(n=t.map(function(e){return parseInt(e.getAttribute("data-group-index"),10)})).indexOf(this.actionObj.groupIndex)||!U.isNullOrUndefined(e)&&0<e.length)&&(i=parseInt(this.actionObj.clone.getAttribute("data-group-index"),10),(n=n.filter(function(e){return e!==i})).push(this.actionObj.groupIndex),e&&0<e.length?e.forEach(function(e){r.parent.resourceBase.getResourceData(e,r.actionObj.groupIndex,n)}):this.parent.resourceBase.getResourceData(a,this.actionObj.groupIndex,n)),a},Ko.prototype.saveChangedData=function(e,t){void 0===t&&(t=!1),this.parent.activeEventData.event=this.actionObj.event,this.parent.currentAction="Save";for(var i,n=[e.data],r=0,a=n=t?e.selectedData:n;r<a.length;r++){var s=a[r],o=!(0<this.parent.activeViewOptions.group.resources.length)||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]){o=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(o,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)}},Ko.prototype.calculateIntervalTime=function(e){e=new Date(+e);return e.setMinutes(Math.floor(e.getMinutes()/this.actionObj.interval)*this.actionObj.interval),e},Ko.prototype.getContentAreaDimension=function(){var e=this.parent.element.querySelector("."+I),t=[].slice.call(e.querySelector("tr").children),i=(t=this.parent.activeView.isTimelineView()||!(0<this.parent.activeViewOptions.group.resources.length)||this.parent.isAdaptive||this.parent.enableAdaptiveUI||this.parent.virtualScrollModule?t:this.getResourceElements(t))[0].getBoundingClientRect(),t=t.slice(-1)[0].getBoundingClientRect();return{bottom:e.scrollHeight-5,left:(this.parent.enableRtl?t:i).left,right:(this.parent.enableRtl?i:t).right,top:0,leftOffset:(this.parent.enableRtl?t:i).right,rightOffset:(this.parent.enableRtl?i:t).left}},Ko.prototype.getIndex=function(e){var t=[].slice.call(this.parent.getContentTable().querySelector("tr").children),i={minIndex:0,maxIndex:t.length-1};return"resize"===this.actionObj.action&&0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&!this.parent.activeView.isTimelineView()&&(t=this.getResourceElements(t),i.minIndex=t[0].cellIndex,i.maxIndex=t.slice(-1)[0].cellIndex),e=i.maxIndex<(e=e<i.minIndex?i.minIndex:e)?i.maxIndex:e},Ko.prototype.updateTimePosition=function(e,t){for(var i,n,r=0,a=0,s=this.actionObj.cloneElement;a<s.length;a++){var o,l,p=s[a].querySelector("."+mi);p&&(o=this.actionObj.start,l=this.actionObj.end,t&&0<t.length&&(o=t[parseInt(r.toString(),10)][this.parent.eventFields.startTime],l=t[parseInt(r.toString(),10)][this.parent.eventFields.endTime]),p.innerHTML=this.parent.getTimeString(o)+" - "+this.parent.getTimeString(l)),r++}this.parent.activeViewOptions.timeScale.enable&&this.parent.isAdaptive&&"Month"!==this.parent.currentView&&"TimelineMonth"!==this.parent.currentView&&((i=this.parent.element.querySelector("."+Li))||(i=U.createElement("div",{className:Li}),n=this.parent.activeView.isTimelineView()?Tt:Bt,this.parent.element.querySelector("."+n).appendChild(i)),i.innerHTML=this.parent.getTimeString(e),n=0,this.parent.activeView.isTimelineView()?this.parent.enableRtl?(e=parseInt(this.actionObj.clone.style.right,10),n="drag"===this.actionObj.action||this.resizeEdges.left?e+this.actionObj.clone.offsetWidth:e,i.style.right=U.formatUnit(n)):(e=parseInt(this.actionObj.clone.style.left,10),n="drag"===this.actionObj.action||this.resizeEdges.left?e:e+this.actionObj.clone.offsetWidth,i.style.left=U.formatUnit(n)):(n="drag"===this.actionObj.action||this.resizeEdges.top?this.actionObj.clone.offsetTop:this.actionObj.clone.offsetTop+this.actionObj.clone.offsetHeight,i.style.top=U.formatUnit(n)))},Ko.prototype.getResourceElements=function(e){var t=this;return e.filter(function(e){return parseInt(e.getAttribute("data-group-index"),10)===t.actionObj.groupIndex})},Ko.prototype.getOriginalElement=function(e){var t,i=e.getAttribute("data-guid");return e.offsetParent&&e.offsetParent.classList.contains(mn)||this.parent.activeView.isTimelineView()||"resize"!==this.actionObj.action&&this.parent.virtualScrollModule?t=[].slice.call(this.parent.element.querySelectorAll('[data-guid="'+i+'"]')):(e=U.closest(e,"tr"))&&(t=[].slice.call(e.querySelectorAll('[data-guid="'+i+'"]'))),t},Ko.prototype.createCloneElement=function(e){var t=U.createElement("div",{innerHTML:e.outerHTML}).children[0],i=[ji],i=(i.push("drag"===this.actionObj.action?Ni:Fi),"Month"!==this.parent.currentView&&"TimelineMonth"!==this.parent.currentView||i.push("e-month-event"),U.addClass([t],i),U.addClass([e],Hi),U.isNullOrUndefined(e.parentElement)||e.parentElement.appendChild(t),t.style.width=U.formatUnit(t.offsetWidth-2),document.querySelector(this.parent.eventDragArea));return this.parent.eventDragArea&&"drag"===this.actionObj.action&&i&&i.appendChild(t),U.setStyleAttribute(t,{border:"0px"}),t},Ko.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("."+Hi))),U.removeClass(e,Hi)},Ko.prototype.removeCloneElement=function(){this.actionObj.originalElement=[];for(var e=0,t=[].slice.call(this.parent.element.querySelectorAll(".e-dynamic-clone"));e<t.length;e++){var i=t[e];U.remove(i)}for(var n=0,r=this.actionObj.cloneElement;n<r.length;n++){var a=r[n];U.isNullOrUndefined(a.parentNode)||U.remove(a)}this.actionObj.cloneElement=[];var s=this.parent.element.querySelector("."+Li);s&&U.remove(s)},Ko.prototype.getCursorElement=function(e){e=this.parent.eventBase.getPageCoordinates(e);return document.elementFromPoint(e.clientX,e.clientY)},Ko.prototype.autoScroll=function(){var e,t=this.parent.element.querySelector("."+I),i=t.offsetHeight<=t.scrollHeight,n=t.offsetWidth<=t.scrollWidth,i=i&&0<=t.scrollTop&&t.scrollTop+t.offsetHeight<=t.scrollHeight,n=n&&0<=t.scrollLeft&&t.scrollLeft+t.offsetWidth<=t.scrollWidth;"resize"===this.actionObj.action&&this.scrollEdges.right&&t.scrollLeft+t.offsetWidth>t.scrollWidth&&(e=[].slice.call(this.parent.getContentTable().querySelector("tr").children).length-1,n=Math.ceil((this.actionObj.clone.offsetLeft+this.actionObj.clone.offsetWidth)/this.actionObj.cellWidth)===e),i&&(this.scrollEdges.top||this.scrollEdges.bottom)&&(t.scrollTop+=this.scrollEdges.top?-this.actionObj.scroll.scrollBy:this.actionObj.scroll.scrollBy,"resize"===this.actionObj.action)&&t.scrollHeight!==t.offsetHeight+t.scrollTop&&0<t.scrollTop&&(this.actionObj.Y+=this.scrollEdges.top?this.actionObj.scroll.scrollBy:-this.actionObj.scroll.scrollBy),n&&(this.scrollEdges.left||this.scrollEdges.right)&&(t.scrollLeft+=this.scrollEdges.left?-this.actionObj.scroll.scrollBy:this.actionObj.scroll.scrollBy,"resize"===this.actionObj.action)&&t.scrollWidth!==t.offsetWidth+t.scrollLeft&&0<t.scrollLeft&&(this.actionObj.X+=this.scrollEdges.left?this.actionObj.scroll.scrollBy:-this.actionObj.scroll.scrollBy)},Ko.prototype.autoScrollValidation=function(){var e;return!!this.actionObj.scroll.enable&&(e=this.parent.boundaryValidation(this.actionObj.pageY,this.actionObj.pageX),(this.scrollEdges=e).bottom||e.top||e.left||e.right)},Ko.prototype.actionClass=function(e){"addClass"===e?U.addClass([this.parent.element],Hi):U.removeClass([this.parent.element],Hi)},Ko.prototype.updateScrollPosition=function(e){var t=this;this.scrollEventArgs=e,this.actionObj.scroll.enable&&U.isNullOrUndefined(this.actionObj.scrollInterval)&&(this.actionObj.scrollInterval=window.setInterval(function(){!t.autoScrollValidation()||t.actionObj.clone.classList.contains(Qi)||t.parent.activeView.isTimelineView()&&0<t.parent.activeViewOptions.group.resources.length&&t.actionObj.groupIndex<0||(t.autoScroll(),"drag"===t.actionObj.action?t.parent.dragAndDropModule.updateDraggingDateTime(t.scrollEventArgs):t.parent.resizeModule.updateResizingDirection(t.scrollEventArgs))},this.actionObj.scroll.timeDelay))},Ko.prototype.updateOriginalElement=function(e){var t='[data-id="'+e.getAttribute("data-id")+'"]',e=(0<this.parent.activeViewOptions.group.resources.length&&(t=t.concat('[data-group-index = "'+e.getAttribute("data-group-index")+'"]')),[].slice.call(this.parent.element.querySelectorAll(t))),t=(U.addClass(e,Hi),[].slice.call(this.parent.element.querySelectorAll("."+ji)));U.removeClass(t,Hi)},Ko.prototype.getUpdatedEvent=function(e,t,i){i=JSON.parse(JSON.stringify(i));return i[this.parent.eventFields.startTime]=e,i[this.parent.eventFields.endTime]=t,i},Ko.prototype.dynamicYearlyEventsRendering=function(e,t){var i,n,r;void 0===t&&(t=!1),U.isNullOrUndefined(this.parent.eventDragArea)&&(n=this.actionObj.cellWidth-7,t&&(this.resizeEdges.left||this.resizeEdges.right)&&(n=this.actionObj.cellWidth*e.count),t||"Horizontal"!==this.parent.activeViewOptions.orientation||0!==this.parent.activeViewOptions.group.resources.length||((i=this.yearEvent.isSpannedEvent(e,e[this.parent.eventFields.startTime]))[this.parent.eventFields.startTime].getTime()===i[this.parent.eventFields.endTime].getTime()&&(i.isSpanned.count=1),n=i.isSpanned.count*this.actionObj.cellWidth),t||"Vertical"!==this.parent.activeViewOptions.orientation||0===this.parent.activeViewOptions.group.resources.length||(n=(i=this.yearEvent.isSpannedEvent(e,e[this.parent.eventFields.startTime])).isSpanned.count*this.actionObj.cellWidth),(i=this.createAppointmentElement(this.actionObj.groupIndex,e[this.parent.eventFields.subject])).setAttribute("drag","true"),U.addClass([i],ji),U.setStyleAttribute(i,{width:n+"px",border:"0px","pointer-events":"none",position:"absolute",overflow:"hidden",padding:"3px"}),""!==this.actionObj.clone.style.backgroundColor&&U.setStyleAttribute(i,{backgroundColor:this.actionObj.clone.style.backgroundColor}),n=W(e[this.parent.eventFields.startTime]).getTime(),r="."+O+'[data-date="'+n+'"]',0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(r="."+O+'[data-date="'+n+'"][data-group-index="'+this.actionObj.groupIndex+'"]'),n=this.parent.element.querySelector(r),U.isNullOrUndefined(n)||(t&&(r=n.querySelector("."+Ei),t=this.actionObj.cellHeight*e.count-(r?r.offsetHeight:0)-7,(this.resizeEdges.right||this.resizeEdges.left)&&(t=parseInt(this.actionObj.clone.style.height,10)),U.setStyleAttribute(i,{height:t+"px"})),this.renderDynamicElement(n,i,!0),this.actionObj.cloneElement.push(i)))},Ko.prototype.renderDynamicElement=function(e,t,i){var n;e.querySelector("."+x)?e.querySelector("."+x).appendChild(t):((n=U.createElement("div",{className:x})).appendChild(t),e.appendChild(n))},Ko.prototype.createAppointmentElement=function(e,t){t=U.createElement("div",{className:A,innerHTML:t});return 0<this.parent.activeViewOptions.group.resources.length&&t.setAttribute("data-group-index",e.toString()),t},Ko.prototype.dynamicEventsRendering=function(e){var t=this;if(U.isNullOrUndefined(this.parent.eventDragArea)){var i,n,r,a=this.parent.activeView.renderDates,s=[].slice.call(this.parent.element.querySelectorAll("."+O)),o=this.parent.activeViewOptions.workDays;if(0<this.parent.activeViewOptions.group.resources.length&&(a=(i=(this.parent.virtualScrollModule&&this.parent.virtualScrollModule.isHorizontalScroll?this.parent.resourceBase.renderedResources:this.parent.resourceBase.lastResourceLevel).filter(function(e){return e.groupIndex===t.actionObj.groupIndex}))[0].renderDates,n="."+O+'[data-group-index="'+this.actionObj.groupIndex+'"]',s=[].slice.call(this.parent.element.querySelectorAll(n)),o=i[0].workDays,r=i[0].groupOrder),this.monthEvent.dateRender=a,this.monthEvent.getSlotDates(o),this.resizeEdges.left||this.resizeEdges.right)for(var l=0,p=[].slice.call(this.parent.element.querySelectorAll("."+ji));l<p.length;l++){var c=p[l];U.remove(c)}for(var h=0,d=this.monthEvent.splitEvent(e,a);h<d.length;h++){var u=d[h],g=this.parent.getIndexOfDate(a,W(u[this.monthEvent.fields.startTime])),m=u.data.count*this.actionObj.cellWidth-7,v=this.monthEvent.createAppointmentElement(u,this.actionObj.groupIndex,!0),u=(v.setAttribute("drag","true"),U.addClass([v],ji),this.monthEvent.applyResourceColor(v,u,"backgroundColor",r),U.setStyleAttribute(v,{width:m+"px",border:"0px","pointer-events":"none"}),s[parseInt(g.toString(),10)]);u&&(this.monthEvent.renderElement(u,v,!0),this.actionObj.cloneElement.push(v))}}},Ko.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})};Yo=Ko;function Ko(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}}Zo=function(e,t){return(Zo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Zo(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})($o,Jo=Yo),$o.prototype.wireResizeEvent=function(e){for(var t=0,i=[].slice.call(e.querySelectorAll("."+qi));t<i.length;t++){var n=i[t];U.EventHandler.add(n,U.Browser.touchStartEvent,this.resizeStart,this)}},$o.prototype.resizeHelper=function(){if(0<this.parent.activeViewOptions.group.resources.length&&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]},$o.prototype.resizeStart=function(s){var o,l,e,p=this;(!s||"touchstart"!==s.type||this.parent.uiStateValues.isTapHold&&U.closest(s.target,"."+hi))&&(this.actionObj.action="resize",this.actionObj.slotInterval=this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount,this.actionObj.interval=this.actionObj.slotInterval,o=U.closest(s.target,"."+qi),this.actionObj.element=U.closest(o,"."+A),this.actionObj.event=this.parent.eventBase.getEventByGuid(this.actionObj.element.getAttribute("data-guid")),e={cancel:!1,data:l=U.extend({},this.actionObj.event,null,!0),element:this.actionObj.element,event:s,interval:this.actionObj.interval,scroll:{enable:!0,scrollBy:30,timeDelay:100}},this.parent.trigger(he,e,function(e){if(!e.cancel){p.actionClass("addClass"),p.parent.uiStateValues.action=!0,p.resizeEdges={left:o.classList.contains(Ui),right:o.classList.contains(Bi),top:o.classList.contains(Wi),bottom:o.classList.contains(zi)},p.actionObj.groupIndex=p.parent.uiStateValues.isGroupAdaptive?p.parent.uiStateValues.groupIndex:0;var t=p.parent.element.querySelector("."+O),t=(p.actionObj.cellWidth=V(t),p.actionObj.cellHeight=at(t),p.parent.activeViewOptions.headerRows.map(function(e){return e.option}));if(p.parent.activeView.isTimelineView()&&0<t.length&&["Date","Hour"].indexOf(t.slice(-1)[0])<0){for(var t=p.parent.getContentTable().querySelector("tr"),i=0,n=0,r=[].slice.call(t.children);n<r.length;n++){var a=r[n];i+=parseInt(a.getAttribute("colspan"),10)}t=t.getBoundingClientRect();p.actionObj.cellWidth=t.width/i,p.actionObj.cellHeight=t.height}t=p.parent.eventBase.getPageCoordinates(s),t=(p.actionObj.X=t.pageX,p.actionObj.Y=t.pageY,p.actionObj.groupIndex=parseInt(p.actionObj.element.getAttribute("data-group-index")||"0",10),p.actionObj.interval=e.interval,p.actionObj.scroll=e.scroll,p.actionObj.start=new Date(l[p.parent.eventFields.startTime].getTime()),p.actionObj.end=new Date(l[p.parent.eventFields.endTime].getTime()),p.actionObj.originalElement=p.getOriginalElement(p.actionObj.element),"Month"===p.parent.currentView&&(p.daysVariation=-1,p.monthEvent=new Na(p.parent)),p.parent.element.querySelector("."+I));p.scrollArgs={element:t,width:t.scrollWidth,height:t.scrollHeight},["Month","TimelineYear"].indexOf(p.parent.currentView)<0&&(e=Math.round(p.scrollArgs.width/p.actionObj.cellWidth)*p.actionObj.cellWidth,p.scrollArgs.width=p.scrollArgs.width<e?e:p.scrollArgs.width),U.EventHandler.add(document,U.Browser.touchMoveEvent,p.resizing,p),U.EventHandler.add(document,U.Browser.touchEndEvent,p.resizeStop,p)}}))},$o.prototype.resizing=function(e){var t,i,n;e&&"touchmove"===e.type&&e.preventDefault(),this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(),0===this.parent.element.querySelectorAll("."+Fi).length&&this.resizeHelper(),!U.isNullOrUndefined(e.target)&&e.target.classList.contains(or)||(t=this.parent.eventBase.getPageCoordinates(e),"Month"===this.parent.currentView||"TimelineYear"===this.parent.currentView?(i=document.documentElement,n=(window.pageXOffset||i.scrollLeft)-(i.clientLeft||0),i=(window.pageYOffset||i.scrollTop)-(i.clientTop||0),this.actionObj.pageX=t.pageX-n,this.actionObj.pageY=t.pageY-i):(this.actionObj.pageX=t.pageX,this.actionObj.pageY=t.pageY),this.updateScrollPosition(e),this.updateResizingDirection(e),n={cancel:!1,data:U.extend({},this.actionObj.event,null,!0),element:this.actionObj.element,event:e,startTime:this.actionObj.start,endTime:this.actionObj.end},0<this.parent.group.resources.length&&(n.groupIndex=this.actionObj.groupIndex),this.parent.trigger(de,n))},$o.prototype.updateResizingDirection=function(e){if("Month"===this.parent.currentView||"TimelineYear"===this.parent.currentView)this.monthResizing();else{var t=this.resizeValidation(e);if(this.resizeEdges.left){if(t){var i=this.getLeftRightStyles(e,!0);if(parseInt(i.width,10)<1)return;for(var n=0,r=this.actionObj.cloneElement;n<r.length;n++){var a=r[n];U.setStyleAttribute(a,i),U.addClass([a],Ui)}}this.horizontalResizing(!this.parent.enableRtl)}if(this.resizeEdges.right){if(t){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++){a=l[o];U.setStyleAttribute(a,s),U.addClass([a],Bi)}}this.horizontalResizing(this.parent.enableRtl)}if(this.resizeEdges.top){if(t){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++){a=h[c];U.setStyleAttribute(a,p),U.addClass([a],Wi)}}this.verticalResizing(!0)}if(this.resizeEdges.bottom){if(t){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++){a=g[u];U.setStyleAttribute(a,d),U.addClass([a],zi)}}this.verticalResizing(!1)}}},$o.prototype.monthResizing=function(){var e,t,i,n;this.removeCloneElement(),U.isNullOrUndefined(this.actionObj.pageX)||U.isNullOrUndefined(this.actionObj.pageY)||(e=document.elementFromPoint(this.actionObj.pageX,this.actionObj.pageY),U.isNullOrUndefined(e))||(n=this.parent.getDateFromElement(e),e=!(0<this.parent.activeViewOptions.group.resources.length)||parseInt(e.getAttribute("data-group-index"),10)===this.actionObj.groupIndex,t=new Date(this.actionObj.event[this.parent.eventFields.startTime].getTime()),i=new Date(this.actionObj.event[this.parent.eventFields.endTime].getTime()),!this.parent.enableRtl&&this.resizeEdges.left||this.parent.enableRtl&&this.resizeEdges.right||this.resizeEdges.top?t=n:(!this.parent.enableRtl&&this.resizeEdges.right||this.parent.enableRtl&&this.resizeEdges.left||this.resizeEdges.bottom)&&(i=z(n,1)),e&&t<i&&(this.actionObj.start=t,this.actionObj.end=i,n=this.getUpdatedEvent(this.actionObj.start,this.actionObj.end,this.actionObj.event),"TimelineYear"===this.parent.currentView?this.yearEventsRendering(n):this.dynamicEventsRendering(n),this.updateOriginalElement(this.actionObj.clone)))},$o.prototype.yearEventsRendering=function(e){for(var t=0,i=[].slice.call(this.parent.element.querySelectorAll("."+ji));t<i.length;t++){var n=i[t];U.remove(n)}var r=new Date(e[this.parent.eventFields.endTime]),a=0;0===this.parent.activeViewOptions.group.resources.length&&(a=this.getMonthDiff(e[this.parent.eventFields.startTime],z(r,-1)));for(var s=0;s<=a;s++){var o=void 0;0===this.parent.activeViewOptions.group.resources.length?o=this.getEventCount(e,this.actionObj.start.getMonth()+s):(o=U.extend({},e,null,!0),r=this.resizeEdges.left||this.resizeEdges.right?z(r,-1):r,o.count=this.getMonthDiff(e[this.parent.eventFields.startTime],r)+1),this.dynamicYearlyEventsRendering(o,!0)}},$o.prototype.getMonthDiff=function(e,t){var i=12*(t.getFullYear()-e.getFullYear());return(i=(i-=e.getMonth())+t.getMonth())<=0?0:i},$o.prototype.getEventCount=function(e,t){var e=U.extend({},e,null,!0),i=e[this.parent.eventFields.startTime],n=e[this.parent.eventFields.endTime],r=new Date(this.parent.selectedDate.getFullYear(),t,1),t=z(new Date(this.parent.selectedDate.getFullYear(),t+1,0),1),a=1;return i.getTime()<r.getTime()&&(e[this.parent.eventFields.startTime]=r),n.getTime()>t.getTime()&&(e[this.parent.eventFields.endTime]=t),0===this.parent.activeViewOptions.group.resources.length&&(a=Math.ceil((e[this.parent.eventFields.endTime].getTime()-e[this.parent.eventFields.startTime].getTime())/B)),e.count=a,e},$o.prototype.resizeStop=function(e){var t=this,e=(U.EventHandler.remove(document,U.Browser.touchMoveEvent,this.resizing),U.EventHandler.remove(document,U.Browser.touchEndEvent,this.resizeStop),clearInterval(this.actionObj.scrollInterval),this.actionObj.scrollInterval=null,this.removeCloneElementClasses(),this.removeCloneElement(),this.actionClass("removeClass"),{cancel:this.parent.uiStateValues.action=this.parent.uiStateValues.isTapHold=!1,data:this.getChangedData(),element:this.actionObj.element,event:e});this.parent.trigger(ue,e,function(e){e.cancel||(t.parent.isSpecificResourceEvents()&&(t.parent.crudModule.crudObj.sourceEvent=[t.parent.resourceBase.lastResourceLevel[parseInt(e.element.getAttribute("data-group-index"),10)]],t.parent.crudModule.crudObj.targetEvent=t.parent.crudModule.crudObj.sourceEvent,t.parent.crudModule.crudObj.isCrudAction=!0),t.saveChangedData(e))})},$o.prototype.verticalResizing=function(e){var t=this.actionObj.clone.offsetTop,t=(e||(t+=this.actionObj.clone.offsetHeight),t/this.actionObj.cellHeight*this.actionObj.slotInterval),i=this.actionObj.clone.offsetParent;U.isNullOrUndefined(i)||((i=W(this.parent.getDateFromElement(i))).setHours(this.parent.activeView.getStartHour().getHours()),i.setMinutes(t+this.parent.activeView.getStartHour().getMinutes()),e?this.actionObj.start=this.calculateIntervalTime(i):this.actionObj.end=this.calculateIntervalTime(i),this.updateTimePosition(i))},$o.prototype.horizontalResizing=function(e){var t=new Date(this.actionObj.event[this.parent.eventFields.startTime].getTime()),i=new Date(this.actionObj.event[this.parent.eventFields.endTime].getTime()),n=!1,r=this.parent.currentView,a=-1<["TimelineDay","TimelineWeek","TimelineWorkWeek"].indexOf(this.parent.currentView),s="TimelineMonth"===this.parent.currentView,o=s||a&&!this.parent.activeViewOptions.timeScale.enable;if(this.parent.activeView.isTimelineView()){var l=this.parent.getContentTable().querySelector("tr"),p=(0<this.parent.activeViewOptions.headerRows.length&&(r=(y=this.parent.activeViewOptions.headerRows.map(function(e){return e.option})).slice(-1)[0],s)&&"Hour"===r&&(r=y.slice(-2)[0]||"Month"),y=e?t:i,0),c=[].slice.call(l.children),h=!1,d=this.actionObj.cellWidth/(this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount),u=parseFloat(this.parent.enableRtl?this.actionObj.clone.style.right:this.actionObj.clone.style.left),u=Math.round(u/d)*d;if(-1!==["Year","Month","Week","Date"].indexOf(r)){for(var g=0,m=0,v=c;m<v.length;m++){var f=v[m];g+=parseInt(f.getAttribute("colspan"),10)}d=this.parent.enableRtl?parseInt(this.actionObj.clone.style.right,10):parseInt(this.actionObj.clone.style.left,10),d=Math.round(d/this.actionObj.cellWidth)*this.actionObj.cellWidth;e||(d+=V(this.actionObj.clone)-this.actionObj.cellWidth),p=Math.floor(d/Math.floor(V(l)/g)),n=a&&"Date"===r,h=(p=!e&&s?p+1:p)===c.length,p=p<0?0:g<=p?g-1:p}else{var d=this.actionObj.cellWidth;p=e?Math.floor(u/this.actionObj.cellWidth):Math.ceil((u+(V(this.actionObj.clone)-d))/this.actionObj.cellWidth),this.parent.enableRtl&&(d=0,"TimelineMonth"!==r&&(this.parent.activeViewOptions.timeScale.enable||s)||(d=this.actionObj.cellWidth),s=Math.floor(u/this.actionObj.cellWidth)*this.actionObj.cellWidth+(e?0:V(this.actionObj.clone)-d),p=Math.floor(s/this.actionObj.cellWidth)),h=p===c.length,p=this.getIndex(p)}var y,d=void 0,d=-1!==["Year","Month","Week","Date"].indexOf(r)?new Date(this.parent.activeView.renderDates[parseInt(p.toString(),10)].getTime()):this.parent.getDateFromElement(l.children[parseInt(p.toString(),10)]);-1===["TimelineMonth","Year","Month","Week","Date"].indexOf(r)&&this.parent.activeViewOptions.timeScale.enable?(e||(u+=V(this.actionObj.clone)),s=Math.ceil(this.actionObj.slotInterval/this.actionObj.cellWidth*(u-Math.floor(u/this.actionObj.cellWidth)*this.actionObj.cellWidth)),s=h||!e&&0===s?this.actionObj.slotInterval:s,(y=new Date(d.getTime())).setMinutes(y.getMinutes()+s),this.updateTimePosition(y)):y=new Date(d.setHours(y.getHours(),y.getMinutes(),y.getSeconds()))}else{c=U.closest(this.actionObj.clone,"td").cellIndex,p=Math.ceil((e?V(this.actionObj.element):0)/this.actionObj.cellWidth)*this.actionObj.cellWidth,g=Math.ceil((V(this.actionObj.clone)-p)/this.actionObj.cellWidth),l=U.closest(this.actionObj.clone,"tr"),u=e?c-g:c+g-1,u=this.getIndex(u);y=this.parent.getDateFromElement(l.children[parseInt(u.toString(),10)]),e?y.setHours(t.getHours(),t.getMinutes(),t.getSeconds()):y.setHours(i.getHours(),i.getMinutes(),i.getSeconds())}h=-1!==["TimelineMonth","Year","Month","Week","Date"].indexOf(r)||!this.parent.activeViewOptions.timeScale.enable;e?(i.getTime()-y.getTime()<=0&&(y=o?W(i):t),this.actionObj.start=h?y:this.calculateIntervalTime(y)):(s=(!(a&&this.parent.activeViewOptions.timeScale.enable)||n||a&&-1<["Week","Month","Year"].indexOf(r))&&0===y.getHours()&&0===y.getMinutes()?z(y,1):y,o&&s.getTime()-t.getTime()<=0&&(s=z(W(t),1)),this.actionObj.end=h?s:this.calculateIntervalTime(s))},$o.prototype.getTopBottomStyles=function(e,t){var i=this.parent.element.querySelector("."+I),n=this.actionObj.cellHeight/this.actionObj.slotInterval*this.actionObj.interval,r=t?this.actionObj.element.offsetHeight+(this.actionObj.Y-this.actionObj.pageY):this.actionObj.element.offsetHeight+(this.actionObj.pageY-this.actionObj.Y),r=(a=t?this.actionObj.element.offsetTop-(this.actionObj.Y-this.actionObj.pageY):this.actionObj.clone.offsetTop)<0||this.actionObj.clone.offsetTop+this.actionObj.clone.offsetHeight>this.scrollArgs.height?this.actionObj.clone.offsetHeight:r,a=a<0?0:a;return r=(a=t?Math.floor(a/n)*n:a)+r>=i.scrollHeight?i.scrollHeight-a:Math.ceil(r/n)*n,!t&&this.actionObj.clone.offsetTop+r>=this.parent.getContentTable().offsetHeight&&(r=this.parent.getContentTable().offsetHeight-this.actionObj.clone.offsetTop),{height:U.formatUnit(r<this.actionObj.cellHeight?Math.floor(r/n)*n:r),top:U.formatUnit(r<this.actionObj.cellHeight&&t?Math.ceil(a/n)*n:a),left:"0px",right:"0px",width:"100%"}},$o.prototype.getLeftRightStyles=function(e,t){var i,n={},r=this.parent.activeView.isTimelineView(),a=-1<["TimelineDay","TimelineWeek","TimelineWorkWeek"].indexOf(this.parent.currentView)&&this.parent.activeViewOptions.timeScale.enable,s=this.actionObj.cellWidth/this.actionObj.slotInterval*this.actionObj.interval,o=t?this.actionObj.X-this.actionObj.pageX:this.actionObj.pageX-this.actionObj.X,l=r?V(this.actionObj.element)/this.actionObj.cellWidth*this.actionObj.cellWidth:"Month"===this.parent.currentView?V(this.actionObj.element):Math.ceil(V(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,o=(a&&(p=l+Math.ceil(o/s)*s,t||(o=(+parseFloat(this.actionObj.element.style[this.parent.enableRtl?"right":"left"])).toFixed(1),i=Math.round(l/s)*s,o===c.toFixed(1)&&i===l)||(p=Math.round((c+p)/s)*s-c),this.actionObj.event[this.parent.eventFields.isAllDay]=!1),!t&&p+this.actionObj.clone.offsetLeft>this.scrollArgs.width?V(this.actionObj.clone):(this.actionObj.cellWidth,p));return this.parent.enableRtl?(i=r?parseInt(this.actionObj.element.style.right,10):-(p-this.actionObj.cellWidth),i=!r&&(t||0<i)?0:i,r&&!t&&(i-=Math.ceil((this.actionObj.pageX-this.actionObj.X)/s)*s)<0&&(i=parseInt(this.actionObj.clone.style.right,10),o=parseInt(this.actionObj.clone.style.width,10)),i=i>=this.scrollArgs.width?this.scrollArgs.width-this.actionObj.cellWidth:i,n.right=U.formatUnit(i),o=o+i>this.scrollArgs.width?V(this.actionObj.clone):o):(c=t?this.actionObj.element.offsetLeft-(this.actionObj.X-this.actionObj.pageX):this.parent.enableRtl?this.actionObj.element.offsetLeft:0,r&&(c=t?c:parseInt(this.actionObj.clone.style.left,10),c=this.parent.enableRtl?!t&&this.actionObj.pageX<this.actionObj.X-V(this.actionObj.clone)?parseInt(this.actionObj.clone.style.right,10):c:t&&this.actionObj.pageX>this.actionObj.X+V(this.actionObj.clone)&&V(this.actionObj.clone)===this.actionObj.cellWidth?parseInt(this.actionObj.clone.style.left,10):c),p=c,(c=r?a?t?this.actionObj.element.offsetLeft-Math.ceil((this.actionObj.element.offsetLeft-c)/s)*s:c:Math.floor(c/this.actionObj.cellWidth)*this.actionObj.cellWidth:Math.ceil(Math.abs(c)/this.actionObj.cellWidth)*this.actionObj.cellWidth)<0&&(o=r&&t&&c%s?(c=parseInt(this.actionObj.clone.style.left,10),parseInt(this.actionObj.clone.style.width,10)):(c=0,V(this.actionObj.clone))),i=Math.ceil(V(this.actionObj.clone)/this.actionObj.cellWidth)*this.actionObj.cellWidth,t&&(n.left=U.formatUnit(!r&&t?p<0?-c:Math.ceil((l-i)/this.actionObj.cellWidth)*this.actionObj.cellWidth:c))),n.width=U.formatUnit(o),n},$o.prototype.resizeValidation=function(e){var e=this.parent.eventBase.getPageCoordinates(e),t=this.getContentAreaDimension(),i=this.parent.activeView.isTimelineView()&&this.parent.activeViewOptions.timeScale.enable,n=this.actionObj.cellWidth,r=!1;return this.resizeEdges.left&&(e.pageX<t.leftOffset&&e.pageX>=t.left&&i&&(n=0),r=e.pageX-n>=t.left),this.resizeEdges.right&&(e.pageX>t.rightOffset&&e.pageX<=t.right&&i&&(n=0),r=e.pageX+n<=t.right),this.resizeEdges.top&&(r=this.actionObj.clone.offsetTop>=t.top),r=this.resizeEdges.bottom?this.actionObj.clone.offsetTop+this.actionObj.clone.offsetHeight<=this.scrollArgs.height:r},$o.prototype.getModuleName=function(){return"resize"};var Zo,Jo,Fo=$o;function $o(){return null!==Jo&&Jo.apply(this,arguments)||this}el=function(e,t){return(el=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}el(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(nl,tl=Ua),nl.prototype.renderAppointments=function(){this.parent.dragAndDropModule&&this.parent.dragAndDropModule.setDragArea(),this.fields=this.parent.eventFields;for(var e="Year"===this.parent.currentView?"."+A:"."+x+",."+tn,t=0,i=[].slice.call(this.parent.element.querySelectorAll(e));t<i.length;t++){var n=i[t];U.remove(n)}this.renderedEvents=[],"Year"===this.parent.currentView?this.yearViewEvents():(this.removeCellHeight(),0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?(this.isResource=!0,this.timelineResourceEvents()):this.timelineYearViewEvents()),this.parent.renderTemplates(),this.parent.notify(De,{})},nl.prototype.yearViewEvents=function(){for(var e=this.getMonths(),t=0,i=e;t<i.length;t++)for(var n=i[t],r=".e-month-calendar:nth-child("+(e.indexOf(n)+1)+") td.e-work-cells",a=[].slice.call(this.parent.element.querySelectorAll(r)),r=new Date(this.parent.selectedDate.getFullYear(),n,1),n=this.parent.calendarUtil.getMonthStartDate(new Date(r.getTime())),r=this.parent.calendarUtil.getMonthEndDate(new Date(r.getTime())),s=Re(n,this.parent.firstDayOfWeek),o=z(He(r,this.parent.firstDayOfWeek),1),l=0;s.getTime()<o.getTime();l++){var p=W(new Date(s.getTime())),c=z(new Date(p.getTime()),1),s=z(new Date(s.getTime()),1);this.parent.isMinMaxDate(p)&&0<this.parent.eventBase.filterEvents(p,c).length&&(p=a[parseInt(l.toString(),10)])&&p.appendChild(U.createElement("div",{className:A}))}},nl.prototype.timelineYearViewEvents=function(){for(var n,r=this,e=this.parent.element.querySelector("."+O+":not(."+E+")"),e=(this.cellWidth=V(e),this.cellHeader=$e(e.querySelector("."+Ei)),this.parent.element.querySelector("."+Mt)),t=(this.eventHeight=Ae(e,A),this.addCellHeight(".e-month-header-wrapper tbody tr,.e-resource-column-table tbody tr,.e-content-table tbody tr",this.eventHeight,2,this.cellHeader,this.moreIndicatorHeight),[].slice.call(this.parent.element.querySelectorAll("."+li))),i=this.getMonths(),l=0<this.parent.activeViewOptions.group.resources.length&&this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues.groupIndex:void 0,p=0;p<i.length;p++){var a=t[parseInt(p.toString(),10)],s=p+1,c=U.createElement("div",{className:x}),h=(a.appendChild(c),new Date(this.parent.selectedDate.getFullYear(),i[parseInt(p.toString(),10)],1)),o=new Date(h.getFullYear(),h.getMonth()+1,0),d=h.getDay(),u=[];for("Horizontal"===this.parent.activeViewOptions.orientation&&(this.renderedEvents=[]);h.getTime()<=o.getTime();){for(var g=void 0,m=void 0,v=("Vertical"===this.parent.activeViewOptions.orientation?(T=t[parseInt(d.toString(),10)],s=d+1,(c=T.querySelector("."+x))||(c=U.createElement("div",{className:x}),T.appendChild(c)),this.parent.enableRtl?m=p*this.cellWidth:g=p*this.cellWidth):this.parent.enableRtl?m=(d+h.getDate()-1)*this.cellWidth:g=(d+h.getDate()-1)*this.cellWidth,this.parent.element.querySelector(".e-content-wrap tr:nth-child("+s+") td")),f=(this.cellHeight=v.offsetHeight,W(new Date(h.getTime()))),y=z(new Date(f.getTime()),1),T=void 0,w=(this.parent.uiStateValues.isGroupAdaptive&&(T=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]),this.parent.eventBase.filterEvents(f,y,void 0,T)),w=this.parent.eventBase.sortByDateTime(w),D=this,b=0,C=w.length;b<C;b++)!function(e,t){var i=U.extend({},w[parseInt(e.toString(),10)],null,!0),e=(D.updateSpannedEvents(i,f,y),D.getIndex(f)),n=(i.Index=e,D.cellHeader+D.eventHeight*(e+1)+2+D.moreIndicatorHeight),r=D.cellHeight-D.cellHeader-D.moreIndicatorHeight,r=Math.floor(r/(D.eventHeight+2)),a=D.parent.rowAutoHeight?1:D.parent.activeViewOptions.maxEventsPerRow,t=D.parent.activeViewOptions.maxEventsPerRow?t-a:t-r<=0?1:t-r;if("Horizontal"===D.parent.activeViewOptions.orientation){var r=D.renderedEvents.filter(function(e){return e.Guid===i.Guid}),s=u.filter(function(e){return e.Guid===i.Guid});if(0<r.length&&r[0].MoreIndicator||0<s.length&&s[0].MoreIndicator)return o="Horizontal"===D.parent.activeViewOptions.orientation?p:d,D.renderMoreIndicator(c,t,f,o,g,m,l);if(0<r.length||0<s.length)return}var o,r=D.maxOrIndicator||e<a||D.cellHeight>n;D.parent.rowAutoHeight||r||D.cellHeight>n?(D.renderEvent(c,i,p,g,m,h,d),(D.parent.rowAutoHeight||D.cellHeight>n)&&D.updateCellHeight(v,n),u.push(i)):(o="Horizontal"===D.parent.activeViewOptions.orientation?p:d,D.renderMoreIndicator(c,t,f,o,g,m,l),"Horizontal"===D.parent.activeViewOptions.orientation&&(i.MoreIndicator=!0,D.renderedEvents.push(i),u.push(i)))}(b,C);h=z(new Date(h.getTime()),1),"Vertical"===this.parent.activeViewOptions.orientation&&(d++,this.renderedEvents=[])}}this.parent.rowAutoHeight&&"Vertical"===this.parent.activeViewOptions.orientation&&(e=[].slice.call(this.parent.element.querySelectorAll("."+li)),n=[].slice.call(this.parent.element.querySelectorAll("."+S+" tbody tr")),e.forEach(function(e,t){var e=[].slice.call(e.querySelectorAll("."+A)),i=n[parseInt(t.toString(),10)].offsetTop+r.cellHeader+2;e.forEach(function(e){var t=parseInt(e.getAttribute("data-index"),10);e.style.top=i+t*r.eventHeight+"px",e.removeAttribute("data-index")})}))},nl.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&&z(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},nl.prototype.timelineResourceEvents=function(){var s,i,o=this,e=this.parent.element.querySelector("."+I),t=e.offsetWidth>e.clientWidth,n=this.parent.element.querySelector("."+O),n=(this.cellWidth=V(n),this.cellHeader=0,this.parent.element.querySelector("."+Mt)),r=(this.eventHeight=Ae(n,A),this.addCellHeight(".e-month-header-wrapper tbody tr,.e-resource-column-table tbody tr,.e-content-table tbody tr",this.eventHeight,2,this.cellHeader,this.moreIndicatorHeight),[].slice.call(this.parent.element.querySelectorAll("."+li))),a=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(var p=0;p<l.length;p++)for(var c=new Date(this.parent.selectedDate.getFullYear(),l[parseInt(p.toString(),10)],1),h=0,d=a.length;h<d;h++)this.renderedEvents=[],this.renderResourceEvent(r[parseInt(p.toString(),10)],a[parseInt(h.toString(),10)],p,h,c);else for(h=0,d=a.length;h<d;h++){this.renderedEvents=[];for(p=0;p<l.length;p++){c=new Date(this.parent.selectedDate.getFullYear(),l[parseInt(p.toString(),10)],1);this.renderResourceEvent(r[parseInt(h.toString(),10)],a[parseInt(h.toString(),10)],p,h,c)}}this.parent.rowAutoHeight&&!t&&e.offsetWidth>e.clientWidth&&([].slice.call(this.parent.element.querySelectorAll("."+A)).forEach(function(e){e.style.removeProperty("left"),e.style.removeProperty("right")}),n=[].slice.call(this.parent.element.querySelectorAll("."+li)),s=this.parent.element.querySelector("."+S),i=[].slice.call(s.querySelectorAll("tbody tr")),n.forEach(function(e,t){var e=[].slice.call(e.children),a=i[parseInt(t.toString(),10)];e.forEach(function(e,t){var i,t=a.querySelector("td:nth-child("+(t+1)+")"),e=[].slice.call(e.children),n=V(t),r=t.offsetLeft;o.parent.enableRtl?(i=s.offsetWidth-r-t.offsetWidth,e.forEach(function(e){e.style.width=Math.floor(parseInt(e.style.width,10)/n)*n+"px",e.style.right=i+"px"})):e.forEach(function(e){e.style.width=Math.floor(parseInt(e.style.width,10)/n)*n+"px",e.style.left=r+"px"})})}))},nl.prototype.renderResourceEvent=function(e,t,l,p,c){for(var h=U.createElement("div",{className:x}),e=(e.appendChild(h),z(je(new Date(c.getTime())),1)),d=this.parent.eventBase.filterEvents(c,e,void 0,t),e="Vertical"===this.parent.activeViewOptions.orientation?p:l,u=this.parent.element.querySelector(".e-content-wrap tr:nth-child("+(e+1)+") td"),g=(this.cellHeight=u.offsetHeight,this.groupOrder=t.groupOrder,[]),m=this,i=0;i<d.length;i++){var n=function(e){var t=d[parseInt(e.toString(),10)],i=void 0,n=U.extend({},t,null,!0),t=(i=0<m.parent.activeViewOptions.group.resources.length?(t=m.isSpannedEvent(n,c),m.getIndex(t[m.fields.startTime])):m.getIndex(n[m.fields.startTime]),n.Index=i,m.cellHeader+m.eventHeight*(e+1)+2+m.moreIndicatorHeight),r="Vertical"===m.parent.activeViewOptions.orientation?l*m.cellWidth:p*m.cellWidth;if(!m.parent.isMinMaxDate(n[m.fields.startTime]))return{value:void 0};if("Vertical"===m.parent.activeViewOptions.orientation&&0<m.parent.activeViewOptions.group.resources.length){var a=m.renderedEvents.filter(function(e){return e.Guid===n.Guid}),s=g.filter(function(e){return e.Guid===n.Guid});if(0<a.length||0<s.length)return"continue"}if(!(m.parent.rowAutoHeight||m.cellHeight>t)){a="Horizontal"===m.parent.activeViewOptions.orientation?l:p;if(m.renderMoreIndicator(h,d.length-e,c,a,r,r,p),"Horizontal"===m.parent.activeViewOptions.orientation)for(var o=p;o<d.length;o++)m.renderedEvents.push(U.extend({},d[parseInt(o.toString(),10)],{Index:i+o},!0));return"break"}m.renderEvent(h,n,l,r,r,c,p),m.updateCellHeight(u,t),g.push(n)}(i);if("object"==typeof n)return n.value;if("break"===n)break}},nl.prototype.renderEvent=function(t,e,i,n,r,a,s){var o,l=this,p=this.isSpannedEvent(e,a),c=this.createEventElement(p);1===p.isSpanned.count&&(e=z(p[this.fields.endTime],-1),p[this.fields.endTime]=e>p[this.fields.startTime]?e:p[this.fields.endTime]),p[this.fields.startTime]>p[this.fields.endTime]||(a="Horizontal"===this.parent.activeViewOptions.orientation?(o=i+1,p[this.fields.startTime].getTime()===p[this.fields.endTime].getTime()&&(p.isSpanned.count=1),p.isSpanned.count*this.cellWidth):(o=s+1,this.isResource?p.isSpanned.count*this.cellWidth:this.cellWidth),e=this.parent.element.querySelector(".e-content-wrap tr:nth-child("+o+") td").offsetTop+this.cellHeader+this.eventHeight*p.Index+2,U.setStyleAttribute(c,{width:a+"px",height:this.eventHeight+"px",left:n+"px",right:r+"px",top:e+"px"}),!this.isResource&&this.parent.rowAutoHeight&&"Vertical"===this.parent.activeViewOptions.orientation&&c.setAttribute("data-index",p.Index.toString()),this.parent.trigger(ne,{data:p,element:c,cancel:!1,type:"event"},function(e){!e.cancel&&(t.appendChild(c),l.wireAppointmentEvents(c,p),0<l.parent.activeViewOptions.group.resources.length||"Vertical"===l.parent.activeViewOptions.orientation||(p.isSpanned.isRight||p.isSpanned.isLeft)&&"Horizontal"===l.parent.activeViewOptions.orientation||!p.isSpanned.isRight)&&l.renderedEvents.push(U.extend({},p,null,!0))}))},nl.prototype.renderMoreIndicator=function(e,t,i,n,r,a,s){var o;0===this.parent.activeViewOptions.group.resources.length&&e.querySelector('[data-start-date="'+i.getTime()+'"]')||(o=0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?z(je(new Date(i.getTime())),1):z(new Date(i.getTime()),1),t=this.getMoreIndicatorElement(t,i,o),i=this.parent.element.querySelector(".e-content-wrap tr:nth-child("+(n+1)+")").offsetTop+(this.cellHeight-this.moreIndicatorHeight),r=Math.floor(r/this.cellWidth)*this.cellWidth,a=Math.floor(a/this.cellWidth)*this.cellWidth,U.setStyleAttribute(t,{width:this.cellWidth+"px",left:r+"px",right:a+"px",top:i+"px"}),U.isNullOrUndefined(s)||t.setAttribute("data-group-index",s.toString()),e.appendChild(t),U.EventHandler.add(t,"click",this.moreIndicatorClick,this))},nl.prototype.createEventElement=function(e){var t,i=e[this.fields.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),n=U.createElement("div",{className:A,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)}}),r=(this.cssClass&&U.addClass([n],this.cssClass),e[this.fields.isReadonly]&&U.addClass([n],br),0<this.parent.activeViewOptions.group.resources.length&&(r=this.getGroupIndexFromEvent(e),n.setAttribute("data-group-index",r.toString())),[]),a=U.extend({},e,null,!0),s=(this.parent.activeViewOptions.eventTemplate?(s=this.parent.element.id+"_"+this.parent.activeViewOptions.eventTemplateName+"eventTemplate",r=this.parent.getAppointmentTemplate()(a,this.parent,"eventTemplate",s,!1,void 0,void 0,this.parent.root)):(s=e[this.fields.location]||this.parent.eventSettings.fields.location.default||"",i=U.createElement("div",{className:Ln,innerHTML:i+(s?";&nbsp"+s:"")}),s=U.createElement("div",{className:mi+(this.parent.isAdaptive?" "+d:""),innerHTML:this.parent.getTimeString(a[this.fields.startTime])}),t=U.createElement("div",{className:mi+(this.parent.isAdaptive?" "+d:""),innerHTML:this.parent.getTimeString(a[this.fields.endTime])}),U.addClass([i],"e-text-center"),e[this.fields.isAllDay]?r=[i]:a.isLeft||a.isRight?(a.isLeft||r.push(s),r.push(i),a.isRight||r.push(t)):r=[s,i,t]),U.createElement("div",{className:di}));return U.append(r,s),n.appendChild(s),this.parent.eventBase.renderSpannedIcon(n,e.isSpanned),this.renderResizeHandler(n,e.data,e[this.fields.isReadonly]),this.applyResourceColor(n,a,"backgroundColor",this.groupOrder),n},nl.prototype.isSpannedEvent=function(e,t){var i=new Date(t.getFullYear(),t.getMonth(),1),t=z(new Date(t.getFullYear(),t.getMonth()+1,0),1),n=U.extend({},e,null,!0),r=n[this.fields.startTime],a=n[this.fields.endTime],s={isLeft:!1,isRight:!1,count:1},o=new Date(this.parent.selectedDate.getFullYear(),this.parent.firstMonthOfYear,1),l=Be(o,this.parent.monthsCount);return this.isResource&&this.updateSpannedEvents(e,i,t),"Vertical"===this.parent.activeViewOptions.orientation&&0<this.parent.activeViewOptions.group.resources.length?(this.updateSpannedEventDetails(r,a,o,l,n,s),o=n[this.fields.startTime],l=new Date(n[this.fields.endTime]-1),s.count=l.getMonth()-o.getMonth()+this.parent.monthsCount*(l.getFullYear()-o.getFullYear())+1):(this.updateSpannedEventDetails(r,a,i,t,n,s),0!==this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive||(l=W(n[this.fields.endTime]).getTime(),o=W(n[this.fields.startTime]).getTime(),(e[this.fields.isAllDay]&&l===e[this.fields.endTime].getTime()||s.isRight)&&(l=z(new Date(l),-1).getTime()),s.count=Math.ceil((l-o)/B)+1)),n.isSpanned=s,W(r).getTime()<W(this.parent.minDate).getTime()&&(n[this.fields.startTime]=this.parent.minDate),W(a).getTime()>W(this.parent.maxDate).getTime()&&(n[this.fields.endTime]=this.parent.maxDate),n},nl.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)},nl.prototype.getOverlapEvents=function(e,t){var i,n,r,a,s=[];0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?(i=this.parent.calendarUtil.getMonthStartDate(new Date(e.getTime())),n=z(this.parent.calendarUtil.getMonthEndDate(new Date(e.getTime())),-1),r=W(new Date(i.getTime())).getTime(),a=W(new Date(n.getTime())).getTime()):this.parent.rowAutoHeight?(r=W(new Date(e.getTime())).getTime(),a=z(W(new Date(e.getTime())),1).getTime()):r=a=W(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]?W(h).getTime()>r:W(h).getTime()>=r;(W(c).getTime()<=r&&d||W(c).getTime()>=r&&W(h).getTime()<=a||"Vertical"===this.parent.activeViewOptions.orientation&&W(c).getTime()>=r&&W(h).getTime()>=a)&&s.push(p)}return s},nl.prototype.getMonths=function(){var i=this;return Array.apply(null,{length:this.parent.monthsCount}).map(function(e,t){return i.parent.firstMonthOfYear+t})},nl.prototype.removeCellHeight=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll(".e-month-header-wrapper tbody tr,.e-resource-column-table tbody tr,.e-content-table tbody tr"));e<t.length;e++)t[e].firstElementChild.style.height=""},nl.prototype.destroy=function(){tl.prototype.destroy.call(this),this.parent=null};var el,tl,il=nl;function nl(e){e=tl.call(this,e,"day")||this;return e.isResource=!1,e}rl=function(e,t){return(rl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}rl(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(y,al=Yo),y.prototype.wireDragEvent=function(e){new U.Draggable(e,{abort:"."+qi,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)})},y.prototype.setDragArea=function(){var e=document.querySelector(this.parent.eventDragArea);this.dragArea=this.parent.eventDragArea&&e?e:this.parent.element.querySelector("."+S)},y.prototype.dragHelper=function(e){var i=this;if(e.sender&&"touchmove"===e.sender.type&&(!this.parent.uiStateValues.isTapHold||!e.element.classList.contains(hi)))return null;this.setDragActionDefaultValues(),this.actionObj.element=e.element,this.actionObj.action="drag";var t=[];return!this.parent.allowMultiDrag||U.isNullOrUndefined(this.parent.selectedElements)||0===this.parent.selectedElements.length||0<this.parent.selectedElements.length&&-1===this.parent.selectedElements.indexOf(this.actionObj.element)?t=[e.element]:(t=this.parent.selectedElements,this.isMultiSelect=!0),t.forEach(function(e){var t=i.createCloneElement(e);e.getAttribute("data-guid")===i.actionObj.element.getAttribute("data-guid")&&(i.actionObj.clone=t,i.parent.eventDragArea||"Month"===i.parent.currentView||!i.parent.activeViewOptions.timeScale.enable||i.parent.activeView.isTimelineView()||i.actionObj.element.classList.contains(Qi)||U.setStyleAttribute(i.actionObj.clone,{cursor:"move",left:"0%",right:"0%",width:"100%"}),i.actionObj.clone.style.top=U.formatUnit(i.actionObj.element.offsetTop)),i.actionObj.cloneElement.push(t),i.actionObj.originalElement.push(e)}),this.actionObj.clone},y.prototype.dragPosition=function(e){var t,i,n,r,a;return this.parent.eventDragArea?{left:e.left,top:e.top}:(t=this.actionObj.cellHeight/this.actionObj.slotInterval*this.actionObj.interval,i=U.formatUnit(0),"Month"===this.parent.currentView&&(i=e.left),n=this.isStepDragging?Math.ceil(this.actionObj.clone.getBoundingClientRect().right)+this.actionObj.interval:this.actionObj.clone.getBoundingClientRect().right,a=this.parent.element.querySelector("."+I).getBoundingClientRect().right,!(this.parent.activeView.isTimelineView()&&"TimelineYear"!==this.parent.currentView&&!this.parent.enableRtl&&this.actionObj.pageX>n)||this.isMorePopupOpened||this.actionObj.pageX>a||(this.isCursorAhead=!0),this.parent.activeView.isTimelineView()&&(i=U.formatUnit(this.actionObj.clone.offsetLeft)),this.parent.activeView.isTimelineView()||!this.parent.timeScale.enable||!U.isNullOrUndefined(this.actionObj.clone.offsetParent)&&this.actionObj.clone.offsetParent.classList.contains(mn)?r=U.formatUnit(this.actionObj.clone.offsetTop):"Month"===this.parent.currentView?r=U.formatUnit(0):this.actionObj.clone.classList.contains(Qi)?(r=U.formatUnit(this.parent.element.querySelector("."+vt).offsetTop),U.setStyleAttribute(this.actionObj.clone,{width:U.formatUnit(Math.ceil(this.actionObj.clone.offsetWidth/this.actionObj.cellWidth)*this.actionObj.cellWidth),right:this.parent.enableRtl&&U.formatUnit(0)})):(this.actionObj.element.classList.contains(Qi)&&!this.actionObj.clone.classList.contains(Qi)&&U.setStyleAttribute(this.actionObj.clone,{height:U.formatUnit(this.actionObj.cellHeight),width:U.formatUnit(this.actionObj.cellWidth-1),pointerEvents:"none"}),n=(n=parseInt(e.top,10))<0?0:n,r=U.formatUnit(Math.ceil(n/t)*t),(a=this.parent.element.querySelector(".e-content-wrap").scrollHeight)<(e=parseInt(r,10)+this.actionObj.clone.offsetHeight)&&(r=parseInt(r,10)-(e-a)+"px")),{left:i,top:r})},y.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("."+O);this.actionObj.cellWidth=e.offsetWidth,this.actionObj.cellHeight=e.offsetHeight},y.prototype.dragStart=function(i){var n=this,e=this.actionObj.element.getAttribute("data-guid"),r=(this.actionObj.event=this.parent.eventBase.getEventByGuid(e),U.extend({},this.actionObj.event,null,!0)),e=(U.isNullOrUndefined(r)||(this.startTime=r[this.parent.eventFields.startTime].getTime()),{cancel:!1,data:r,selectedData:this.getSelectedData(),event:i,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(le,e,function(e){var t;e.cancel||!U.isNullOrUndefined(n.actionObj.element)&&U.isNullOrUndefined(n.actionObj.element.parentElement)?(t=n.actionObj.element.ej2_instances[0],U.isNullOrUndefined(t)||t.intDestroy(i.event),n.actionObj.action="",n.removeCloneElementClasses(),n.removeCloneElement()):(n.actionClass("addClass"),n.parent.uiStateValues.action=!0,n.actionObj.start=r[n.parent.eventFields.startTime],n.actionObj.end=r[n.parent.eventFields.endTime],n.actionObj.groupIndex=parseInt(n.actionObj.element.getAttribute("data-group-index")||"0",10),n.actionObj.interval=e.interval,n.actionObj.navigation=e.navigation,n.actionObj.scroll=e.scroll,n.actionObj.excludeSelectors=e.excludeSelectors,t=n.parent.element.querySelector("."+I),n.scrollArgs={element:t,width:t.scrollWidth,height:t.scrollHeight},n.widthPerMinute=n.actionObj.cellWidth/n.actionObj.slotInterval*n.actionObj.interval,n.heightPerMinute=n.actionObj.cellHeight/n.actionObj.slotInterval*n.actionObj.interval,n.widthUptoCursorPoint=0,n.heightUptoCursorPoint=0,n.cursorPointIndex=-1,n.isHeaderRows=!1,n.isTimelineDayProcess=!1,n.minDiff=0,n.isMorePopupOpened=!1,n.daysVariation=-1,n.isAllDayTarget=n.actionObj.clone.classList.contains(Qi),!n.parent.activeView.isTimelineView()&&n.parent.timeScale.enable||"TimelineYear"===n.parent.currentView||(!U.isNullOrUndefined(n.actionObj.clone.offsetParent)&&n.actionObj.clone.offsetParent.classList.contains(mn)&&(n.isMorePopupOpened=!0),n.actionObj.pageX=i.event.pageX,e=n.parent.activeViewOptions.headerRows,n.isHeaderRows=0<e.length&&"Hour"!==e[e.length-1].option&&"Date"!==e[e.length-1].option,n.isTimelineDayProcess=!n.parent.activeViewOptions.timeScale.enable||n.isHeaderRows||"TimelineMonth"===n.parent.currentView||0<e.length&&"Date"===e[e.length-1].option,n.isStepDragging=!n.isTimelineDayProcess&&n.actionObj.slotInterval!==n.actionObj.interval,n.isTimelineDayProcess?n.timelineEventModule=new Ua(n.parent,"day"):n.timelineEventModule=new Ua(n.parent,"hour")),"TimelineYear"===n.parent.currentView&&(n.yearEvent=new il(n.parent)),"Month"===n.parent.currentView&&(n.startTime=W(new Date(n.startTime)).getTime(),n.updateOriginalElement(n.actionObj.clone),n.monthEvent=new Na(n.parent)),"Day"!==n.parent.currentView&&"Week"!==n.parent.currentView&&"WorkWeek"!==n.parent.currentView||(n.verticalEvent=new Pa(n.parent),n.verticalEvent.initializeValues(),n.splitEvent(n.actionObj.event).forEach(function(e){var e='.e-day-wrapper[data-date="'+W(e[n.parent.eventFields.startTime]).getTime()+'"]',e=(0<n.parent.activeViewOptions.group.resources.length&&(e=e.concat('[data-group-index = "'+n.actionObj.groupIndex+'"]')),n.parent.element.querySelector(e));e&&(e=e.querySelector('[data-id="'+n.actionObj.clone.getAttribute("data-id")+'"]'))&&U.addClass([e],Hi)})))})},y.prototype.getSelectedData=function(){if(this.isMultiSelect&&0===this.multiData.length&&0<this.parent.selectedElements.length)for(var e=0,t=this.parent.selectedElements;e<t.length;e++){var i=t[e].getAttribute("data-guid"),i=this.parent.eventBase.getEventByGuid(i);this.multiData.push(U.extend({},i,null,!0))}return this.multiData},y.prototype.drag=function(e){var t,i,n,r;e.event&&"touchmove"===e.event.type&&e.event.preventDefault(),this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(!0),!U.isNullOrUndefined(e.target)&&e.target.classList&&e.target.classList.contains(or)||(t=U.extend({},this.actionObj.event,null,!0),i=this.parent.eventBase.getPageCoordinates(e),this.actionObj.Y=this.actionObj.pageY=i.pageY,this.actionObj.X=this.actionObj.pageX=i.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,this.isAllDayDrag=this.parent.activeViewOptions.timeScale.enable?this.actionObj.clone.classList.contains(Qi):this.actionObj.event[this.parent.eventFields.isAllDay],this.isStepDragging&&0===this.minDiff&&this.calculateMinutesDiff(t),"Month"!==this.parent.currentView&&!this.isAllDayDrag||!(this.daysVariation<0)||(n=this.parent.getDateFromElement(this.actionObj.target),U.isNullOrUndefined(n))?this.daysVariation=0:(n=W(n),r=W(new Date(t[this.parent.eventFields.startTime].getTime())),this.daysVariation=(n.getTime()-r.getTime())/B),this.parent.eventDragArea&&(n=i.target,this.actionObj.clone.style.top=U.formatUnit(n.offsetTop),this.actionObj.clone.style.left=U.formatUnit(n.offsetLeft),U.closest(n,"."+ot)?"Week"!==this.parent.currentView&&"WorkWeek"!==this.parent.currentView&&"Day"!==this.parent.currentView&&(this.actionObj.clone.style.width=U.formatUnit(this.actionObj.element.offsetWidth)):(this.actionObj.clone.style.height="",this.actionObj.clone.style.width="")),this.updateScrollPosition(e),this.updateNavigatingPosition(e),this.updateDraggingDateTime(e),r={data:t,event:e,element:this.actionObj.element,startTime:this.actionObj.start,endTime:this.actionObj.end,selectedData:this.updatedData},0<this.parent.group.resources.length&&(r.groupIndex=this.actionObj.groupIndex),this.parent.trigger(pe,r))},y.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 e=e[this.parent.eventFields.startTime],t=ze(this.parent.activeView.renderDates[0],this.parent.activeView.getStartHour(),this.parent.activeView.getEndHour());t.startHour.getTime()>e.getTime()&&(this.minDiff=this.minDiff+(t.startHour.getTime()-e.getTime())/xe)},y.prototype.dragStop=function(e){var t,i,n=this;this.isCursorAhead=!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)||(t=e.target.classList&&!e.target.classList.contains("e-work-cells")&&this.parent.cellTemplate?U.closest(e.target,".e-work-cells"):e.target,i={cancel:!1,data:this.getChangedData(this.updatedData),selectedData:this.updatedData,event:e,element:this.actionObj.element,target:t},this.actionObj.action=null,this.parent.trigger(ce,i,function(e){var t;e.cancel||(n.parent.isSpecificResourceEvents()&&(n.parent.crudModule.crudObj.isCrudAction=!0,n.parent.crudModule.crudObj.sourceEvent=[n.parent.resourceBase.lastResourceLevel[parseInt(i.element.getAttribute("data-group-index"),10)]],t=parseInt(i.target.getAttribute("data-group-index"),10)||n.actionObj.groupIndex,n.parent.crudModule.crudObj.targetEvent=[n.parent.resourceBase.lastResourceLevel[parseInt(t.toString(),10)]]),n.saveChangedData(e,n.isMultiSelect))}),this.updatedData=[],this.multiData=[],this.isMultiSelect=!1,this.parent.selectedElements=[])},y.prototype.updateNavigatingPosition=function(i){var n,r=this;this.actionObj.navigation.enable&&(n=this.parent.getCurrentTime(),U.isNullOrUndefined(this.actionObj.navigationInterval))&&(this.actionObj.navigationInterval=window.setInterval(function(){var e,t;n&&(e=r.parent.getCurrentTime().getSeconds(),(t=60<=(t=n.getSeconds()+r.actionObj.navigation.timeDelay/1e3)?t-60:t)===e)&&(n=r.parent.getCurrentTime(),r.viewNavigation(i),r.updateDraggingDateTime(i))},this.actionObj.navigation.timeDelay))},y.prototype.updateDraggingDateTime=function(e){!U.isNullOrUndefined(this.actionObj.clone.offsetParent)&&this.actionObj.clone.offsetParent.classList.contains(mn)?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:V(this.parent.element.querySelector("."+O)),this.calculateTimelineTime(e)):"Month"===this.parent.currentView||"TimelineYear"===this.parent.currentView?this.calculateVerticalDate(e):this.calculateVerticalTime(e)},y.prototype.navigationWrapper=function(){if(this.parent.activeView.isTimelineView()){var t,e=void 0,e=0<this.parent.activeViewOptions.group.resources.length?this.parent.element.querySelectorAll(".e-appointment-container:not(.e-hidden)").item(this.actionObj.index):this.parent.element.querySelector("."+li);U.isNullOrUndefined(e)||((t=e.querySelector("."+x))||(t=U.createElement("div",{className:x}),e.appendChild(t)),this.actionObj.cloneElement.forEach(function(e){t.appendChild(e)}))}else if("Month"!==this.parent.currentView&&this.parent.timeScale.enable){e=this.actionObj.clone.classList.contains(Qi)?"."+Xi:"."+x;if(this.parent.element.querySelectorAll(e).item(this.actionObj.index).appendChild(this.actionObj.clone),e=="."+Xi){var i=this.getAllDayEventHeight(),e=[].slice.call(this.parent.element.querySelectorAll("."+v+":first-child"));if(e[0].offsetHeight<i)for(var n=0,r=e;n<r.length;n++)r[n].style.height=(i+2)/12+"em";this.actionObj.clone.style.height=U.formatUnit(i)}this.actionObj.height=parseInt(this.actionObj.clone.style.height,10)}else{var e=[].slice.call(this.parent.element.querySelectorAll("."+O)),a=(this.actionObj.index=this.parent.activeView.renderDates.length<this.actionObj.index?this.parent.activeView.renderDates.length-1:this.actionObj.index,e[this.actionObj.index].querySelector("."+x));a||(a=U.createElement("div",{className:x}),e[this.actionObj.index].appendChild(a)),a.appendChild(this.actionObj.clone)}},y.prototype.viewNavigation=function(e){var t,i=this.parent.element.querySelector("."+I);i&&(!this.scrollEdges.top&&!this.scrollEdges.bottom||U.closest(this.actionObj.clone,"."+Xi))&&(0===i.scrollLeft&&Math.round(this.actionObj.X)<=Math.round(i.getBoundingClientRect().left+this.actionObj.cellWidth+window.pageXOffset)?t=this.parent.enableRtl?"next":"previous":Math.round(i.scrollLeft)+i.clientWidth===i.scrollWidth&&Math.round(this.actionObj.X)>=Math.round(i.getBoundingClientRect().right-this.actionObj.cellWidth+window.pageXOffset)&&(t=this.parent.enableRtl?"previous":"next"),t)&&this.parent.changeDate(this.parent.activeView.getNextPreviousDate(t))},y.prototype.morePopupEventDragging=function(e){var t,i,n;U.isNullOrUndefined(e.target)||e.target&&U.isNullOrUndefined(U.closest(e.target,"td"))||(n=(n=U.extend({},this.actionObj.event,null,!0))[this.parent.eventFields.endTime].getTime()-n[this.parent.eventFields.startTime].getTime(),e=U.closest(e.target,"td"),("TimelineYear"!==this.parent.currentView||e.classList.contains(O)&&!e.classList.contains(E))&&(i=this.parent.getDateFromElement(e),(t=new Date(i.getTime())).setMilliseconds(n),0<this.parent.activeViewOptions.group.resources.length&&(this.actionObj.groupIndex=parseInt(e.getAttribute("data-group-index"),10)),this.actionObj.start=new Date(i.getTime()),this.actionObj.end=new Date(t.getTime()),this.actionObj.clone.style.top=U.formatUnit(e.offsetParent.offsetTop),this.actionObj.clone.style.left=U.formatUnit(e.offsetLeft),this.actionObj.clone.style.width=U.formatUnit(e.offsetWidth),n=e,this.parent.activeView.isTimelineView()&&(i=U.closest(e,"tr").rowIndex,n=this.parent.element.querySelectorAll(".e-appointment-container").item(i)),(t=n.querySelector("."+x))||(t=U.createElement("div",{className:x}),n.appendChild(t)),this.appendCloneElement(t)))},y.prototype.calculateVerticalTime=function(e){var i=this;if(!(U.isNullOrUndefined(this.actionObj.target)||this.actionObj.target&&U.isNullOrUndefined(U.closest(this.actionObj.target,"tr")))&&(U.isNullOrUndefined(U.closest(this.actionObj.target,"td"))||U.closest(this.actionObj.target,"td").classList.contains(O)||U.closest(this.actionObj.target,"td").classList.contains(v))){this.parent.activeViewOptions.timeScale.enable&&this.swapDragging(e);var e=this.parent.element.querySelector("."+I),t=U.extend({},this.actionObj.event,null,!0),n=t[this.parent.eventFields.startTime],t=it(t[this.parent.eventFields.endTime])-it(n),r=(r=Math.floor(parseInt(this.actionObj.clone.style.top,10)/this.actionObj.cellHeight)*this.actionObj.cellHeight)<0?0:r,e=((this.scrollEdges.top||this.scrollEdges.bottom)&&(r=this.scrollEdges.top?e.scrollTop-this.heightUptoCursorPoint+this.actionObj.cellHeight+window.pageYOffset:e.scrollTop+e.offsetHeight-this.actionObj.clone.offsetHeight+window.pageYOffset+(this.actionObj.clone.offsetHeight-this.heightUptoCursorPoint),r=Math.round(r/this.actionObj.cellHeight)*this.actionObj.cellHeight,0<e.scrollTop)&&(this.actionObj.clone.style.top=U.formatUnit(r)),this.parent.activeViewOptions.timeScale.enable?r/this.actionObj.cellHeight:0),a=this.actionObj.cellHeight/this.actionObj.slotInterval,r=parseInt(this.actionObj.clone.style.top,10)-r,s=(e=this.isAllDayDrag?this.parent.element.querySelector("."+vt):[].slice.call(this.parent.getContentTable().querySelectorAll("tr"))[parseInt(e.toString(),10)],U.isNullOrUndefined(U.closest(this.actionObj.target,"td"))||!U.closest(this.actionObj.target,"td").classList.contains(O)&&!U.closest(this.actionObj.target,"td").classList.contains(v)||(s=U.closest(this.actionObj.target,"td").cellIndex),U.isNullOrUndefined(s)?U.closest(this.actionObj.clone,"td").cellIndex:s);if(this.actionObj.index=s,!U.isNullOrUndefined(e)){for(var o,l,e=e.children[parseInt(s.toString(),10)],a=(0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(this.actionObj.groupIndex=parseInt(e.getAttribute("data-group-index"),10)),this.parent.activeViewOptions.timeScale.enable&&!this.isAllDayDrag?(this.appendCloneElement(this.getEventWrapper(s)),(o=this.parent.getDateFromElement(e)).setMinutes(o.getMinutes()+r/a),l=new Date(o.getTime()),this.actionObj.element.classList.contains(Qi)?l.setMinutes(l.getMinutes()+this.actionObj.slotInterval):l.setMilliseconds(t)):((o=this.parent.getDateFromElement(e)).setDate(o.getDate()-this.daysVariation),o.setHours(n.getHours(),n.getMinutes(),n.getSeconds()),(l=new Date(o.getTime())).setMilliseconds(t),!this.actionObj.element.classList.contains(Qi)&&this.actionObj.clone.classList.contains(Qi)&&(l=z(W(l),1)),r=this.parent.activeViewOptions.group.byDate||this.parent.virtualScrollModule&&!this.parent.activeViewOptions.timeScale.enable?s:void 0,this.updateAllDayEvents(o,l,r)),this.actionObj.start=new Date(+o),this.actionObj.end=new Date(+l),this.getUpdatedEvent(this.actionObj.start,this.actionObj.end,this.actionObj.event)),p=0,c=[].slice.call(this.parent.element.querySelectorAll(".e-dynamic-clone"));p<c.length;p++){var h=c[p];U.remove(h)}if(0<this.multiData.length){this.isAllDayTarget&&this.isAllDayDrag&&!U.isNullOrUndefined(this.actionObj.isAllDay)&&!this.actionObj.isAllDay&&(d=parseInt(U.closest(this.actionObj.target,"td").getAttribute("data-date"),10),this.multiData.forEach(function(e){var t;i.swagData.push(U.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)),t=new Date(e[i.parent.eventFields.startTime]),t=new Date(t.setMinutes(t.getMinutes()+i.actionObj.slotInterval)),e[i.parent.eventFields.endTime]=t,e[i.parent.eventFields.isAllDay]=!1)}),this.startTime=d),this.isAllDayTarget&&this.isAllDayDrag&&!U.isNullOrUndefined(this.actionObj.isAllDay)&&this.actionObj.isAllDay&&0<this.swagData.length&&(this.multiData=this.swagData,this.swagData=[],e=U.extend({},this.actionObj.event,null,!0),this.startTime=e[this.parent.eventFields.startTime].getTime());for(var d,u=a[this.parent.eventFields.startTime].getTime()-this.startTime,g=0;g<this.multiData.length;g++){this.updatedData[parseInt(g.toString(),10)]=this.updateMultipleData(this.multiData[parseInt(g.toString(),10)],u);var m=this.getDayIndex(this.updatedData[parseInt(g.toString(),10)]);0<=m?(h=this.getEventWrapper(m,this.updatedData[parseInt(g.toString(),10)][this.parent.eventFields.isAllDay]),this.appendCloneElement(h,this.actionObj.cloneElement[parseInt(g.toString(),10)]),this.updateEventHeight(this.updatedData[parseInt(g.toString(),10)],g,m)):U.isNullOrUndefined(this.actionObj.cloneElement[parseInt(g.toString(),10)].parentNode)||U.remove(this.actionObj.cloneElement[parseInt(g.toString(),10)])}}else this.updateEventHeight(a);this.updateTimePosition(this.actionObj.start,this.updatedData)}}},y.prototype.splitEvent=function(e){var t=this.parent.eventFields,i=[],n=e[t.startTime],r=e[t.endTime];if(W(new Date(n.getTime()))<W(new Date(r.getTime()))){for(var a=W(new Date(n.getTime())),s=new Date(a.getTime());a<new Date(r.getTime());0){var s=new Date(s.setDate(a.getDate()+1)),o=U.extend({},e,null,!0);o[t.startTime]=new Date(a),o[t.endTime]=new Date(s),a=new Date(a.setDate(a.getDate()+1)),i.push(o)}var l=i.length-1;i[0][t.startTime]=n,i[parseInt(l.toString(),10)][t.endTime]=r}else i.push(e);return i},y.prototype.updateMultipleData=function(e,t){var i,n,r,e=U.extend({},e,null,!0),a=(!U.isNullOrUndefined(this.actionObj.isAllDay)&&this.parent.activeViewOptions.timeScale.enable&&(this.isAllDayTarget&&e[this.parent.eventFields.isAllDay]||!this.isAllDayTarget&&!e[this.parent.eventFields.isAllDay])&&(e[this.parent.eventFields.isAllDay]=this.actionObj.isAllDay),e[this.parent.eventFields.endTime].getTime()-e[this.parent.eventFields.startTime].getTime());return e[this.parent.eventFields.isAllDay]?(i=Math.ceil(t/864e5),n=Math.ceil(a/864e5),r=new Date(e[this.parent.eventFields.startTime]),e[this.parent.eventFields.startTime]=W(new Date(r.setDate(r.getDate()+i))),e[this.parent.eventFields.endTime]=z(e[this.parent.eventFields.startTime],n)):(e[this.parent.eventFields.startTime]=new Date(e[this.parent.eventFields.startTime].getTime()+t),e[this.parent.eventFields.endTime]=new Date(e[this.parent.eventFields.startTime].getTime()+a)),e},y.prototype.getDayIndex=function(e){var e=U.extend({},e,null,!0),t=W(e[this.parent.eventFields.startTime]),i=(this.parent.activeViewOptions.timeScale.enable&&!e[this.parent.eventFields.isAllDay]&&(i=this.parent.activeView.getStartHour(),t.setMilliseconds(i.getTime()-W(i).getTime())),t.getTime()),t="",t="."+(this.parent.activeViewOptions.timeScale.enable&&e[this.parent.eventFields.isAllDay]?Xi:O)+'[data-date="'+i+'"]';return 0<this.parent.activeViewOptions.group.resources.length&&(t=t+'[data-group-index="'+this.actionObj.groupIndex+'"]'),this.targetTd=this.parent.element.querySelector(t),U.isNullOrUndefined(this.targetTd)?-1:this.targetTd.cellIndex},y.prototype.updateEventHeight=function(e,t,i){this.verticalEvent.initializeValues();var n=this.verticalEvent.getStartCount();if(!this.parent.uiStateValues.isGroupAdaptive)for(var r=0;r<this.actionObj.groupIndex;r++)this.verticalEvent.dateRender[parseInt(r.toString(),10)]&&(n+=this.verticalEvent.dateRender[parseInt(r.toString(),10)].length);var a=this.parent.uiStateValues.isGroupAdaptive?n:this.actionObj.groupIndex;if(!(!this.parent.activeViewOptions.group.byDate||U.isNullOrUndefined(this.parent.getDateFromElement(this.actionObj.target)))||!this.parent.activeViewOptions.group.byDate)for(var s,o,l,p,c,h=-1,d=this.parent.activeViewOptions.group.byDate?this.parent.getIndexOfDate(this.verticalEvent.dateRender[parseInt(a.toString(),10)],W(this.parent.getDateFromElement(U.isNullOrUndefined(t)?this.actionObj.target:this.targetTd))):U.isNullOrUndefined(t)?this.actionObj.index-n:i-n,i=this.splitEvent(e),u=this.parent.eventBase.isAllDayAppointment(e)||2<i.length||"TimeSlot"!==this.parent.eventSettings.spannedEventPlacement?[e]:i,r=0;r<u.length;r++)0<r&&(s='.e-day-wrapper[data-date="'+W(u[parseInt(r.toString(),10)][this.parent.eventFields.startTime]).getTime()+'"]',0<this.parent.activeViewOptions.group.resources.length&&(s=s.concat('[data-group-index = "'+this.actionObj.groupIndex+'"]')),(s=this.parent.element.querySelector(s))?(d+=1,h=s.cellIndex):d=-1),0<=d&&(l=(s=this.verticalEvent.isSpannedEvent(u[parseInt(r.toString(),10)],d,a))[this.verticalEvent.fields.startTime],p=s[this.verticalEvent.fields.endTime],p=this.parent.activeViewOptions.timeScale.enable?this.verticalEvent.getHeight(l,p):this.actionObj.element.offsetHeight,l=this.parent.activeViewOptions.timeScale.enable?this.verticalEvent.getTopValue(l,d,a):this.actionObj.element.offsetTop,U.isNullOrUndefined(t)?0===r?(this.actionObj.clone.style.top=U.formatUnit(l),this.actionObj.clone.style.height=U.formatUnit(p)):this.renderSpannedEvents(s,h,l,p):(o=this.actionObj.cellWidth,e[this.parent.eventFields.isAllDay]&&(l=this.parent.element.querySelector("."+vt).offsetTop,p=this.getAllDayEventHeight(),c=e[this.parent.eventFields.endTime].getTime()-e[this.parent.eventFields.startTime].getTime(),0<=(c=Math.ceil(c/864e5)))&&(o=c*this.actionObj.cellWidth),this.actionObj.cloneElement[parseInt(t.toString(),10)]&&(0===r?(this.actionObj.cloneElement[parseInt(t.toString(),10)].style.top=U.formatUnit(l),this.actionObj.cloneElement[parseInt(t.toString(),10)].style.height=U.formatUnit(p),this.actionObj.cloneElement[parseInt(t.toString(),10)].style.width=U.formatUnit(o),this.actionObj.cloneElement[parseInt(t.toString(),10)].style.left=U.formatUnit(0)):this.renderSpannedEvents(s,h,l,p))))},y.prototype.renderSpannedEvents=function(e,t,i,n){e[this.parent.eventFields.startTime].getTime()!==e[this.parent.eventFields.endTime].getTime()&&(e=this.verticalEvent.createAppointmentElement(e,!1,e.isSpanned,this.actionObj.groupIndex),U.addClass([e],[ji,"e-dynamic-clone"]),U.setStyleAttribute(e,{width:"100%",height:n+"px",top:i+"px",border:"0px"}),[].slice.call(this.parent.element.querySelectorAll("."+x))[parseInt(t.toString(),10)].appendChild(e))},y.prototype.getRenderedDates=function(){var e,t=this,i=this.parent.activeView.renderDates;return(e=this.parent.eventBase.slots).push.apply(e,this.parent.activeView.renderDates.map(function(e){return+e})),0<this.parent.activeViewOptions.group.resources.length&&(this.parent.eventBase.slots=[],i=this.parent.resourceBase.lastResourceLevel.filter(function(e){return e.groupIndex===t.actionObj.groupIndex})[0].renderDates,(e=this.parent.eventBase.slots).push.apply(e,i.map(function(e){return+e}))),i},y.prototype.updateAllDayEvents=function(e,t,i){this.parent.eventBase.slots=[];var e=this.getUpdatedEvent(e,t,this.actionObj.event),t=this.getRenderedDates(),e=this.parent.eventBase.splitEvent(e,t),t='.e-all-day-cells[data-date="'+e[0][this.parent.eventFields.startTime].getTime()+'"]',t=(0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(t=t.concat('[data-group-index = "'+this.actionObj.groupIndex+'"]')),[].slice.call(this.parent.element.querySelectorAll(t)));(0<t.length||!U.isNullOrUndefined(i))&&(t=U.isNullOrUndefined(i)?t[0].cellIndex:i,this.appendCloneElement(this.getEventWrapper(t)),this.actionObj.clone.style.width=U.formatUnit(e[0].data.count*this.actionObj.cellWidth))},y.prototype.swapDragging=function(e){var t=!U.isNullOrUndefined(U.closest(this.actionObj.target,"td"))&&U.closest(this.actionObj.target,"td").cellIndex;if(U.closest(this.actionObj.target,"."+Tt)&&!U.closest(this.actionObj.clone,"."+Xi)){U.addClass([this.actionObj.clone],Qi),this.appendCloneElement(this.getEventWrapper(t)),this.actionObj.isAllDay=!0;var i=this.getAllDayEventHeight(),n=[].slice.call(this.parent.element.querySelectorAll("."+v+":first-child"));if(n[0].offsetHeight<i)for(var r=0,a=n;r<a.length;r++)a[r].style.height=(i+2)/12+"em";U.setStyleAttribute(this.actionObj.clone,{width:U.formatUnit(this.actionObj.cellWidth),height:U.formatUnit(i),top:U.formatUnit(this.parent.element.querySelector("."+vt).offsetTop)})}U.closest(this.actionObj.target,"."+O)&&!U.closest(this.actionObj.clone,"."+$t)&&(U.removeClass([this.actionObj.clone],Qi),this.appendCloneElement(this.getEventWrapper(t)),this.actionObj.isAllDay=!1,n=0===this.actionObj.element.offsetHeight?this.actionObj.height:this.actionObj.element.offsetHeight,U.setStyleAttribute(this.actionObj.clone,{left:U.formatUnit(0),height:U.formatUnit(n),width:U.formatUnit(this.actionObj.cellWidth)}))},y.prototype.calculateVerticalDate=function(e){if(!(U.isNullOrUndefined(e.target)||e.target&&U.isNullOrUndefined(U.closest(e.target,"tr"))||e.target&&"DIV"===e.target.tagName)){var t,e=U.extend({},this.actionObj.event,null,!0),i=(U.isNullOrUndefined(this.parent.eventDragArea)&&this.removeCloneElement(),it(e[this.parent.eventFields.endTime])-it(e[this.parent.eventFields.startTime])),n=U.closest(this.actionObj.target,"td"),e=(U.isNullOrUndefined(n)||(t=n.parentElement,this.actionObj.index=t.rowIndex*t.children.length+n.cellIndex,n=[].slice.call(this.parent.element.querySelectorAll("."+O))[this.actionObj.index],t=this.parent.getDateFromElement(n),U.isNullOrUndefined(t))||(0<this.parent.activeViewOptions.group.resources.length&&(this.actionObj.groupIndex=parseInt(n.getAttribute("data-group-index"),10)),n=new Date(t.setDate(t.getDate()-this.daysVariation)),t=new Date(n.getTime()),o=it(e[this.parent.eventFields.startTime])-it(W(new Date(+e[this.parent.eventFields.startTime]))),t.setMilliseconds(o),(n=new Date(t.getTime())).setMilliseconds(i),this.actionObj.start=new Date(t.getTime()),this.actionObj.end=new Date(n.getTime())),this.getUpdatedEvent(this.actionObj.start,this.actionObj.end,this.actionObj.event));if(U.isNullOrUndefined(this.parent.eventDragArea))for(var r=0,a=[].slice.call(this.parent.element.querySelectorAll("."+ji));r<a.length;r++){var s=a[r];U.remove(s)}if(this.multiData&&0<this.multiData.length){var i=W(new Date(e[this.parent.eventFields.startTime])),o=i.getTime()-this.startTime;"TimelineYear"===this.parent.currentView&&0<this.parent.group.resources.length&&(o=12*(i.getFullYear()-new Date(this.startTime).getFullYear()),o=(o-=new Date(this.startTime).getMonth())+i.getMonth());for(var l=0;l<this.multiData.length;l++)this.updatedData[parseInt(l.toString(),10)]=this.updateMultipleVerticalDate(this.multiData[parseInt(l.toString(),10)],o),"TimelineYear"===this.parent.currentView?this.dynamicYearlyEventsRendering(this.updatedData[parseInt(l.toString(),10)]):this.dynamicEventsRendering(this.updatedData[parseInt(l.toString(),10)])}else"TimelineYear"===this.parent.currentView?this.dynamicYearlyEventsRendering(e):this.dynamicEventsRendering(e)}},y.prototype.updateMultipleVerticalDate=function(e,t){var e=U.extend({},e,null,!0),i=e[this.parent.eventFields.endTime].getTime()-e[this.parent.eventFields.startTime].getTime(),n=new Date(e[this.parent.eventFields.startTime]);return"TimelineYear"===this.parent.currentView&&0<this.parent.group.resources.length?e[this.parent.eventFields.startTime]=new Date(n.setMonth(n.getMonth()+t)):(t=Math.ceil(t/B),e[this.parent.eventFields.startTime]=new Date(n.setDate(n.getDate()+t))),e[this.parent.eventFields.endTime]=new Date(e[this.parent.eventFields.startTime].getTime()+i),e},y.prototype.calculateTimelineTime=function(e){var t,i=U.extend({},this.actionObj.event,null,!0),n=it(i[this.parent.eventFields.endTime])-it(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.floor(r/Math.trunc(this.actionObj.cellWidth))*this.actionObj.cellWidth,a=(this.parent.enableRtl&&(a=Math.abs(parseInt(this.actionObj.clone.style.right,10)),this.actionObj.clone.style.right=U.formatUnit(a)),r=this.getOffsetValue(r,a),this.getColumnIndex(r)),s=this.parent.element.querySelector("."+I),o=s.getBoundingClientRect().right,o=this.parent.activeView.isTimelineView()&&!this.parent.enableRtl&&this.actionObj.pageX>this.actionObj.clone.getBoundingClientRect().right&&!this.isMorePopupOpened&&!(this.actionObj.pageX>o),s=this.parent.eventDragArea?s.scrollLeft-s.offsetLeft:0,s=(!this.isCursorAhead&&!o||this.isStepDragging||(this.isCursorAhead=!0),Math.floor((this.actionObj.pageX-this.actionObj.clone.getBoundingClientRect().left+s)/this.actionObj.cellWidth)),r=(this.parent.enableRtl&&(s=Math.abs(Math.floor((this.actionObj.pageX-this.actionObj.clone.getBoundingClientRect().right)/this.actionObj.cellWidth))-1),this.cursorPointIndex<0&&this.cursorIndex(e,i,r,s),this.parent.getContentTable().querySelector("tr")),a=(a=this.getCursorCurrentIndex(a,s,r))<0?0:a,l=this.isHeaderRows?new Date(this.timelineEventModule.dateRender[parseInt(a.toString(),10)].getTime()):this.parent.getDateFromElement(r.children[parseInt(a.toString(),10)]),p=(this.isStepDragging?0!==(s=this.getWidthDiff(r,a))?(r=Math.ceil(s/this.widthPerMinute),l.setMinutes(l.getMinutes()+r*this.actionObj.interval),this.isCursorAhead||o?l.setMilliseconds(-n):(l.setMinutes(l.getMinutes()-this.minDiff),a=this.actionObj.interval*xe,r=Math.abs(l.getTime()-this.actionObj.start.getTime())/a,(s=Math.trunc(r))!==r&&(r=s*a*(l>this.actionObj.start?1:-1),l=new Date(this.actionObj.start.getTime()+r)))):l=this.actionObj.start:this.isCursorAhead||o?(s=this.isTimelineDayProcess?1440:this.actionObj.slotInterval,l.setMinutes(l.getMinutes()+s),l.setMilliseconds(-n),l.getTime()===W(l).getTime()&&0===l.getMinutes()&&0==n&&l.setMinutes(-s)):l.setMinutes(l.getMinutes()-this.cursorPointIndex*(this.isTimelineDayProcess?1440:this.actionObj.slotInterval)),this.isStepDragging||(l=this.calculateIntervalTime(l)),this.isTimelineDayProcess&&(t=i[this.parent.eventFields.startTime],l.setHours(t.getHours(),t.getMinutes(),t.getSeconds())),this.parent.eventDragArea&&(a=this.parent.getDateFromElement(e.target),U.isNullOrUndefined(a)||(l=this.parent.activeViewOptions.timeScale.enable&&"TimelineMonth"!==this.parent.currentView?a:(t=i[this.parent.eventFields.startTime],new Date(a.setHours(t.getHours(),t.getMinutes(),t.getSeconds()))))),new Date(l.getTime())),c=(p.setMilliseconds(n),[this.getUpdatedEvent(l,p,this.actionObj.event)]);if(0<this.multiData.length){for(var h=c[0][this.parent.eventFields.startTime].getTime()-this.startTime,d=0;d<this.multiData.length;d++)this.updatedData[parseInt(d.toString(),10)]=this.updateMultipleData(this.multiData[parseInt(d.toString(),10)],h);c=this.updatedData}for(var u=0;u<c.length;u++){var g,m,v,f,y=0<this.multiData.length?this.actionObj.cloneElement[parseInt(u.toString(),10)]:this.actionObj.clone;U.isNullOrUndefined(this.parent.eventDragArea)&&(m=(g=this.timelineEventModule.splitEvent(c[parseInt(u.toString(),10)],this.timelineEventModule.dateRender))[0].data,f=this.timelineEventModule.getStartTime(g[0],m),g=this.timelineEventModule.getEndTime(g[0],m),m=this.timelineEventModule.getEventWidth(f,g,i[this.parent.eventFields.isAllDay],m.count),v=this.parent.getIndexOfDate(this.timelineEventModule.dateRender,W(new Date(f.getTime()))),f=this.timelineEventModule.getPosition(f,g,i[this.parent.eventFields.isAllDay],v=v<0?0:v),this.parent.enableRtl?y.style.right=U.formatUnit(f):y.style.left=U.formatUnit(f),this.isMorePopupOpened||(y.style.width=U.formatUnit(m))),0<this.parent.activeViewOptions.group.resources.length&&this.calculateResourceGroupingPosition(e,y),this.actionObj.start=new Date(l.getTime()),this.actionObj.end=new Date(p.getTime()),this.updateTimePosition(this.actionObj.start,this.updatedData)}},y.prototype.getOffsetValue=function(e,t){var i;return(this.scrollEdges.left||this.scrollEdges.right)&&(i=this.parent.element.querySelector("."+I),this.parent.enableRtl?(t=i.offsetWidth-i.scrollLeft,this.scrollEdges.right?t=t-i.offsetWidth+this.actionObj.clone.offsetWidth-(this.actionObj.clone.offsetWidth-this.widthUptoCursorPoint):(t+=this.widthUptoCursorPoint)-this.widthUptoCursorPoint>=i.scrollWidth&&(this.actionObj.clone.style.width=U.formatUnit(this.actionObj.clone.offsetWidth-this.widthUptoCursorPoint+this.actionObj.cellWidth),t=i.scrollLeft-i.scrollWidth),U.isNullOrUndefined(this.parent.eventDragArea)&&(this.actionObj.clone.style.left=U.formatUnit(t))):(this.scrollEdges.left?(e=i.scrollLeft-this.widthUptoCursorPoint+this.actionObj.cellWidth,i.scrollLeft+i.offsetWidth>=i.offsetWidth?i.scrollLeft=i.scrollLeft-1:0===this.actionObj.clone.offsetLeft&&(e=i.scrollLeft)):e=i.scrollLeft+i.offsetWidth-this.actionObj.clone.offsetWidth+(this.actionObj.clone.offsetWidth-this.widthUptoCursorPoint),e=e<0?0:e,U.isNullOrUndefined(this.parent.eventDragArea)&&(this.actionObj.clone.style.left=U.formatUnit(e)))),e},y.prototype.getWidthDiff=function(e,t){var i=this.scrollArgs.element.getBoundingClientRect();return i.left<=this.actionObj.pageX&&i.right>=this.actionObj.pageX?(e=e.children[parseInt(t.toString(),10)].offsetLeft,t=this.actionObj.pageX-i.left,this.parent.enableRtl?e+this.actionObj.cellWidth-(this.scrollArgs.element.scrollLeft+t):this.scrollArgs.element.scrollLeft+t-e):0},y.prototype.getColumnIndex=function(e){e=Math.floor(e/Math.trunc(this.actionObj.cellWidth));return this.isHeaderRows?e:this.getIndex(e)},y.prototype.getCursorCurrentIndex=function(e,t,i){e+=t;return this.isHeaderRows?(t=Math.floor(i.offsetWidth/this.actionObj.cellWidth))-1<e?t-1:e:e>i.children.length-1?i.children.length-1:e},y.prototype.cursorIndex=function(e,t,i,n){var e=U.closest(e.target,".e-work-cells");U.isNullOrUndefined(e)||this.isMorePopupOpened?this.cursorPointIndex=0:(e=this.parent.getDateFromElement(e),this.isHeaderRows&&(i=Math.floor(i/this.actionObj.cellWidth),e=new Date(this.timelineEventModule.dateRender[i+n].getTime())),i=e.getTime()-t[this.parent.eventFields.startTime].getTime(),this.isTimelineDayProcess?this.cursorPointIndex=Math.abs(Math.ceil(i/B)):(n=Math.floor(i/xe/(this.actionObj.slotInterval/this.actionObj.cellWidth)),this.cursorPointIndex=Math.floor(n/this.actionObj.cellWidth),this.cursorPointIndex=this.cursorPointIndex<0?0:this.cursorPointIndex))},y.prototype.calculateResourceGroupingPosition=function(e,t){var i=this.parent.element.querySelector("."+I),n=[].slice.call(this.parent.element.querySelectorAll(".e-content-wrap .e-content-table tr:not(.e-hidden)")),r=Me(i.querySelector("table")),r=U.isNullOrUndefined(r)?0:r,a=this.parent.rowAutoHeight?~~(i.querySelector("table").offsetHeight/n.length):this.actionObj.cellHeight,r=(r=Math.floor(Math.floor(this.actionObj.Y+(i.scrollTop-r-(window.scrollY||window.pageYOffset))-st(i))/a))<0?0:r>n.length-1?n.length-1:r,i=(this.actionObj.index=r,this.parent.element.querySelectorAll(".e-appointment-container:not(.e-hidden)").item(r)),a=i.querySelector("."+x),i=(a||(a=U.createElement("div",{className:x}),i.appendChild(a)),this.appendCloneElement(a,t),U.closest(this.actionObj.target,"td"));this.actionObj.groupIndex=i&&!isNaN(parseInt(i.getAttribute("data-group-index"),10))?parseInt(i.getAttribute("data-group-index"),10):this.actionObj.groupIndex,U.isNullOrUndefined(this.parent.eventDragArea)&&(a=at(n[parseInt(r.toString(),10)])*r,this.parent.rowAutoHeight&&(i=this.getCursorElement(e))&&(a=i.classList.contains(O)?i.offsetTop:i.offsetParent&&i.offsetParent.classList.contains(A)?i.offsetParent.offsetTop:a),t.style.top=U.formatUnit(a))},y.prototype.appendCloneElement=function(e,t){t=U.isNullOrUndefined(t=void 0===t?null:t)?this.actionObj.clone:t;var i=document.querySelector(this.parent.eventDragArea);(this.parent.eventDragArea&&i?i:e).appendChild(t)},y.prototype.getEventWrapper=function(e,t){var i;return U.isNullOrUndefined(t)&&(t=this.actionObj.clone.classList.contains(Qi)),this.parent.activeViewOptions.timeScale.enable?i=this.parent.element.querySelectorAll(t?"."+Xi:"."+x).item(e):(i=(t=this.parent.element.querySelectorAll("."+O).item(e)).querySelector("."+x))||(i=U.createElement("div",{className:x}),t.appendChild(i)),i},y.prototype.getAllDayEventHeight=function(){var e=U.createElement("div",{className:A}),t=(this.parent.element.querySelector("."+Xi).appendChild(e),e.offsetHeight);return U.remove(e),t},y.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},y.prototype.getModuleName=function(){return"dragAndDrop"};var rl,al,Za=y;function y(){var e=null!==al&&al.apply(this,arguments)||this;return e.widthUptoCursorPoint=0,e.heightUptoCursorPoint=0,e.cursorPointIndex=0,e.isHeaderRows=!1,e.isTimelineDayProcess=!1,e.widthPerMinute=0,e.heightPerMinute=0,e.minDiff=0,e.isStepDragging=!1,e.isMorePopupOpened=!1,e.isAllDayDrag=!1,e.isMultiSelect=!1,e.multiData=[],e.updatedData=[],e.swagData=[],e.startTime=0,e.isAllDayTarget=!1,e.targetTd=null,e.isCursorAhead=!1,e}T.prototype.isTimelineView=function(){return-1!==this.parent.currentView.indexOf("Timeline")},T.prototype.getContentRows=function(){return[]},T.prototype.refreshHeader=function(){},T.prototype.refreshResourceHeader=function(){var e=this.element.querySelector("."+Pt),t=Array.from(e.querySelectorAll("."+Ut)),i=(t.forEach(function(e){Array.from(e.children).forEach(function(e){e.classList.contains(Nt)||e.classList.contains(qt)||U.remove(e)})}),this.parent.resourceBase.renderedResources);if(!U.isNullOrUndefined(i)&&0<i.length)for(var n=0;n<t.length;n++){var r=t[parseInt(n.toString(),10)],a=i[parseInt(n.toString(),10)];!this.parent.activeView||U.isNullOrUndefined(r)||U.isNullOrUndefined(a)||parseInt(r.getAttribute("data-group-index"),10)!==a.groupIndex||this.parent.activeView.setResourceHeaderContent(r,a,Rt)}this.parent.renderTemplates(),this.parent.notify(De,{})},T.prototype.getDayName=function(e){return this.parent.getDayNames("abbreviated")[e.getDay()]},T.prototype.getDate=function(e){return this.parent.globalize.formatDate(e,{format:"d",calendar:this.parent.getCalendarMode()})},T.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)},T.prototype.getTimelineDate=function(e){return f(this.parent.globalize.formatDate(e,{skeleton:"MMMd",calendar:this.parent.getCalendarMode()})+", "+this.parent.getDayNames("wide")[e.getDay()],"multiple")},T.prototype.createEventTable=function(e){var t=U.createElement("div",{className:Mt});return U.append(this.getEventRows(e),t),t},T.prototype.getEventRows=function(e){for(var t,i=[],n=0;n<e;n++)t=U.createElement("div",{className:li}),this.parent.resourceBase&&!this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.renderedResources&&t.setAttribute("data-group-index",this.parent.resourceBase.renderedResources[parseInt(n.toString(),10)].groupIndex.toString()),i.push(t);return i},T.prototype.collapseRows=function(e){0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(this.parent.resourceBase.hideResourceRows(e.querySelector("tbody")),this.parent.resourceBase.hideResourceRows(e.querySelector("."+Mt)))},T.prototype.createTableLayout=function(e){var e=U.createElement("table",{className:mt+" "+(e||"")}),t=U.createElement("tbody");return e.appendChild(t),e},T.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))},T.prototype.createColGroup=function(e,t){if(!U.isNullOrUndefined(t)){for(var i=t.length,n=(t[0]&&t[0].colSpan&&(i=t.map(function(e){return e.colSpan}).reduce(function(e,t){return e+t})),U.createElement("colgroup")),r=0;r<i;r++)n.appendChild(U.createElement("col"));U.prepend([n],e)}},T.prototype.getScrollXIndent=function(e){return 0<e.offsetHeight-e.clientHeight?Ke():0},T.prototype.scrollTopPanel=function(e){this.getDatesHeaderElement().firstElementChild.scrollLeft=e.scrollLeft},T.prototype.scrollHeaderLabels=function(e){for(var t=this.element.querySelector(".e-date-header-wrap table"),i=t.offsetWidth/t.querySelectorAll("colgroup col").length,n=0,r=[".e-header-year-cell",".e-header-month-cell",".e-header-week-cell",".e-header-cells"];n<r.length;n++){var a=[].slice.call(this.element.querySelectorAll(r[n]));if(0<a.length){for(var s=0,o=a;s<o.length;s++)o[s].children[0].style[this.parent.enableRtl?"right":"left"]="";m=g=u=d=h=c=l=void 0;for(var l,p=this.parent.enableRtl,c=0,h=0,d=p?-e.scrollLeft:e.scrollLeft,u=0,g=a;u<g.length;u++){var m=g[u];if((h+=parseInt(m.getAttribute("colSpan"),10))>Math.floor(d/i)){l=m;break}c+=m.offsetWidth}U.isNullOrUndefined(l)||(l.children[0].style[p?"right":"left"]=d-c+"px")}}},T.prototype.addAttributes=function(e,t){e.template&&U.append(e.template,t),e.colSpan&&t.setAttribute("colspan",e.colSpan.toString()),e.className&&U.addClass([t],e.className)},T.prototype.getHeaderBarHeight=function(){var e,t=2;return this.parent.headerModule&&(t+=$e(this.parent.headerModule.getHeaderElement())),this.parent.uiStateValues.isGroupAdaptive&&(e=this.parent.element.querySelector("."+ii))&&(t+=e.offsetHeight),t},T.prototype.renderPanel=function(e){e===Et?U.prepend([this.element],this.parent.element.querySelector("."+gt)):this.parent.element.querySelector("."+gt).appendChild(this.element)},T.prototype.setPanel=function(e){this.element=e},T.prototype.getPanel=function(){return this.element},T.prototype.getDatesHeaderElement=function(){return this.element.querySelector("."+wt)},T.prototype.getDateSlots=function(e,t){return[]},T.prototype.generateColumnLevels=function(){return[]},T.prototype.getColumnLevels=function(){return this.colLevels},T.prototype.highlightCurrentTime=function(){},T.prototype.getStartDate=function(){return this.renderDates[0]},T.prototype.getEndDate=function(){return this.renderDates[this.renderDates.length-1]},T.prototype.startDate=function(){return this.renderDates[0]},T.prototype.endDate=function(){return z(this.renderDates[this.renderDates.length-1],1)},T.prototype.getStartHour=function(){var e=this.parent.getStartEndTime(this.parent.activeViewOptions.startHour);return e=U.isNullOrUndefined(e)?new Date(2e3,0,0,0):e},T.prototype.getEndHour=function(){var e=this.parent.getStartEndTime(this.parent.activeViewOptions.endHour);return e=U.isNullOrUndefined(e)?new Date(2e3,0,0,0):e},T.prototype.isCurrentDate=function(e){return e.setHours(0,0,0,0)===new Date(this.parent.currentTimezoneDate).setHours(0,0,0,0)},T.prototype.isCurrentMonth=function(e){return this.parent.activeViewOptions.displayDate||0<this.parent.activeViewOptions.numberOfWeeks?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()},T.prototype.isWorkDay=function(e,t){return void 0===t&&(t=this.parent.activeViewOptions.workDays),!U.isNullOrUndefined(t)&&0<=t.indexOf(e.getDay())},T.prototype.isWorkHour=function(e,t,i,n){return!(U.isNullOrUndefined(t)||U.isNullOrUndefined(i)||(t.setMilliseconds(0),i.setMilliseconds(0),Fe(e)<Fe(t))||Fe(e)>=Fe(i)||!this.isWorkDay(e,n))},T.prototype.getRenderDates=function(e){var t=[];if("Week"===this.parent.currentView||"TimelineWeek"===this.parent.currentView)for(var i=Re(W(this.parent.selectedDate),this.parent.activeViewOptions.firstDayOfWeek),n=0,r=7*this.parent.activeViewOptions.interval;n<r;n++)(this.parent.activeViewOptions.showWeekend||this.isWorkDay(i,e))&&t.push(i),i=z(i,1);else if("WorkWeek"===this.parent.currentView||"TimelineWorkWeek"===this.parent.currentView)for(var i=Re(W(this.parent.selectedDate),this.parent.activeViewOptions.firstDayOfWeek),n=0,a=7*this.parent.activeViewOptions.interval;n<a;n++)this.isWorkDay(i,e)&&t.push(i),i=z(i,1);else for(var s="Agenda"===this.parent.currentView?this.parent.agendaDaysCount:this.parent.activeViewOptions.interval,i=W(this.parent.selectedDate);(this.parent.activeViewOptions.showWeekend||this.isWorkDay(i,e))&&t.push(i),i=z(i,1),s!==t.length;);return e||(this.renderDates=t),this.parent.headerModule&&this.parent.headerModule.previousNextIconHandler(),t},T.prototype.getNextPreviousDate=function(e){if(this.previousNextAction=e,"Day"===this.parent.currentView||"TimelineDay"===this.parent.currentView){var t;if(this.parent.activeViewOptions.showWeekend)return t=this.parent.activeViewOptions.interval,z(this.parent.selectedDate,"next"===e?t:-t);var i=void 0;if("next"===e)for(i=z(this.renderDates.slice(-1)[0],1);!this.isWorkDay(i);)i=z(i,1);else for(var i=z(this.renderDates[0],-1),n=0;this.isWorkDay(i)&&(n+=1),this.parent.activeViewOptions.interval!==n&&(i=z(i,-1)),this.parent.activeViewOptions.interval!==n;);return i}return z(this.parent.selectedDate,("next"===e?7:-7)*this.parent.activeViewOptions.interval)},T.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)},T.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()):0<this.renderDates.length?"Day"===this.parent.currentView||"TimelineDay"===this.parent.currentView?this.parent.localeObj.getConstant(t)+" of "+f(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]):""},T.prototype.getDateRangeText=function(){var e;return this.parent.isAdaptive?(e=this.parent.activeViewOptions.dateFormat||"MMMM y",f(this.parent.globalize.formatDate(this.parent.selectedDate,{format:e,calendar:this.parent.getCalendarMode()}),"single")):this.formatDateRange(this.renderDates[0],this.renderDates[this.renderDates.length-1])},T.prototype.formatDateRange=function(e,t){var i,n,r=this.parent.globalize,a=this.parent.getCalendarMode();return e===t&&(t=null),U.isNullOrUndefined(this.parent.activeViewOptions.dateFormat)?(n=U.isNullOrUndefined(this.parent.locale)||"en"===this.parent.locale||"en-US"===this.parent.locale?U.getValue("dateFormats.long",U.getDefaultDateObject(a)):U.getValue("main."+this.parent.locale+".dates.calendars."+a+".dateFormats.long",U.cldrData),t?f("d"===(i=n.trim().toLocaleLowerCase()).substr(0,1)?e.getFullYear()===t.getFullYear()?e.getMonth()===t.getMonth()?r.formatDate(e,{format:"dd",calendar:a})+" - "+r.formatDate(t,{format:"dd MMMM yyyy",calendar:a}):r.formatDate(e,{format:"dd MMM",calendar:a})+" - "+r.formatDate(t,{format:"dd MMM yyyy",calendar:a}):r.formatDate(e,{format:"dd MMM yyyy",calendar:a})+" - "+r.formatDate(t,{format:"dd MMM yyyy",calendar:a}):"m"===i.substr(0,1)?e.getFullYear()===t.getFullYear()?e.getMonth()===t.getMonth()?r.formatDate(e,{format:"MMMM dd",calendar:a})+" - "+r.formatDate(t,{format:"dd, yyyy",calendar:a}):r.formatDate(e,{format:"MMM dd",calendar:a})+" - "+r.formatDate(t,{format:"MMM dd, yyyy",calendar:a}):r.formatDate(e,{format:"MMM dd, yyyy",calendar:a})+" - "+r.formatDate(t,{format:"MMM dd, yyyy",calendar:a}):r.formatDate(e,{format:n,calendar:a})+" - "+r.formatDate(t,{format:n,calendar:a}),"multiple"):f(r.formatDate(e,{format:n,calendar:a}),"single")):f(t?r.formatDate(e,{format:this.parent.activeViewOptions.dateFormat,calendar:a})+" - "+r.formatDate(t,{format:this.parent.activeViewOptions.dateFormat,calendar:a}):r.formatDate(e,{format:this.parent.activeViewOptions.dateFormat,calendar:a}),"multiple")},T.prototype.getMobileDateElement=function(e,t){return U.createElement("div",{className:t,innerHTML:'<div class="e-m-date">'+this.parent.globalize.formatDate(e,{format:"d",calendar:this.parent.getCalendarMode()})+'</div><div class="e-m-day">'+f(this.parent.globalize.formatDate(e,{format:"E",calendar:this.parent.getCalendarMode()}),"single")+"</div>"})},T.prototype.setResourceHeaderContent=function(e,t,i){var n,r;void 0===i&&(i=un),this.parent.activeViewOptions.resourceHeaderTemplate?(n={resource:t.resource,resourceData:t.resourceData},r=this.parent.element.id+"_"+this.parent.activeViewOptions.resourceHeaderTemplateName+"resourceHeaderTemplate",n=[].slice.call(this.parent.getResourceHeaderTemplate()(n,this.parent,"resourceHeaderTemplate",r,!1,void 0,void 0,this.parent.root)),U.append(n,e)):(r=U.createElement("div",{className:i}),this.parent.sanitize(t.resourceData[t.resource.textField],r),e.appendChild(r))},T.prototype.renderResourceMobileLayout=function(){this.parent.resourceBase.lastResourceLevel&&this.parent.resourceBase.lastResourceLevel.length<=0||(this.parent.resourceBase.renderResourceHeader(),this.parent.resourceBase.renderResourceTree())},T.prototype.addAutoHeightClass=function(e){!this.parent.uiStateValues.isGroupAdaptive&&this.parent.rowAutoHeight&&this.isTimelineView()&&0<this.parent.activeViewOptions.group.resources.length&&U.addClass([e],wr)},T.prototype.getColElements=function(){return[].slice.call(this.element.querySelectorAll("."+I+" col, ."+Tt+" col"))},T.prototype.setColWidth=function(e){var i,t;this.isTimelineView()&&(t=this.getColElements(),i=V(this.element.querySelector("."+S+" tbody"))/(t.length/2),e.offsetHeight!==e.clientHeight&&(t=this.parent.element.querySelector("."+Ht),U.isNullOrUndefined(t)||t.offsetHeight===e.clientHeight||U.setStyleAttribute(t,{height:U.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 t=U.isNullOrUndefined(e.getAttribute("colspan"))?"1":e.getAttribute("colspan"),t=parseInt(t,10);U.setStyleAttribute(e,{width:U.formatUnit(i*t)})}))},T.prototype.resetColWidth=function(){for(var e=0,t=this.getColElements();e<t.length;e++)t[e].style.width=""},T.prototype.getContentAreaElement=function(){return this.element.querySelector("."+I)},T.prototype.wireExpandCollapseIconEvents=function(){if(this.parent.resourceBase&&1<this.parent.resourceBase.resourceCollection.length)for(var e=0,t=[].slice.call(this.element.querySelectorAll("."+Ft));e<t.length;e++){var i=t[e];U.EventHandler.clearEvents(i),U.EventHandler.add(i,"click",this.parent.resourceBase.onTreeIconClick,this.parent.resourceBase)}},T.prototype.scrollToDate=function(e){var t;-1===["Month","TimelineMonth"].indexOf(this.parent.currentView)||U.isNullOrUndefined(e)||(t=this.getContentAreaElement(),e=new Date(W(new Date(+e)).getTime()).getTime(),e=t.querySelector("."+O+'[data-date="'+e+'"]'),"Month"===this.parent.currentView&&e&&(t.scrollWidth>t.clientWidth&&(this.parent.enableRtl?t.scrollLeft=-(this.parent.getContentTable().offsetWidth-e.offsetLeft-e.offsetWidth):t.scrollLeft=e.offsetLeft),t.scrollTop=e.offsetTop),"TimelineMonth"===this.parent.currentView&&e&&(this.parent.enableRtl?t.scrollLeft=-(this.parent.getContentTable().offsetWidth-e.offsetLeft-e.offsetWidth):t.scrollLeft=e.offsetLeft))},T.prototype.setPersistence=function(){var e;this.parent.enablePersistence&&(e=this.element.querySelector(".e-content-wrap"),U.isNullOrUndefined(e)||(this.parent.scrollLeft=e.scrollLeft,this.parent.scrollTop=e.scrollTop))},T.prototype.retainScrollPosition=function(){var e;this.parent.enablePersistence&&(e=this.parent.element.querySelector(".e-content-wrap"),U.isNullOrUndefined(e)||U.isNullOrUndefined(this.parent.scrollLeft)||U.isNullOrUndefined(this.parent.scrollTop)||(e.scrollTop=this.parent.scrollTop,e.scrollLeft=this.parent.scrollLeft))},T.prototype.getViewStartDate=function(){var e=this.renderDates[0];return e=0<this.parent.activeViewOptions.group.resources.length&&0<this.parent.resourceBase.lastResourceLevel.length?this.parent.resourceBase.getResourceRenderDates()[0]:e},T.prototype.getViewEndDate=function(){var e=z(this.renderDates[this.renderDates.length-1],1);return e=0<this.parent.activeViewOptions.group.resources.length&&0<this.parent.resourceBase.lastResourceLevel.length?z(this.parent.resourceBase.getResourceRenderDates().slice(-1)[0],1):e},T.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&&0<this.parent.activeViewOptions.group.resources.length?(e.setHours(0,0,0,0),new Date(e.setDate(1))):null},T.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&&!(e<=i);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])},T.prototype.destroy=function(){this.element&&this.element.parentNode&&U.remove(this.element),this.element=null,this.renderDates=null,this.colLevels=null};Ja=T;function T(e){this.previousNextAction="next",this.parent=e}sl=function(e,t){return(sl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}sl(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(w,ol=Ja),w.prototype.getModuleName=function(){return"verticalView"},w.prototype.addEventListener=function(){this.parent.on(Se,this.scrollUiUpdate,this),this.parent.on(Te,this.renderEvents,this)},w.prototype.removeEventListener=function(){this.parent&&(this.parent.off(Se,this.scrollUiUpdate),this.parent.off(Te,this.renderEvents))},w.prototype.renderEvents=function(){this.appointment=new(this.parent.activeViewOptions.timeScale.enable?Pa:Na)(this.parent),this.appointment.renderAppointments(),this.parent.notify(we,{})},w.prototype.onContentScroll=function(e){this.parent.removeNewEventElement();var t=e.target;this.parent.notify(Ce,e),this.scrollLeftPanel(t),this.scrollTopPanel(t),this.parent.isAdaptive||(this.parent.uiStateValues.top=t.scrollTop),this.parent.uiStateValues.left=t.scrollLeft,U.isNullOrUndefined(this.parent.quickPopup)||this.parent.uiStateValues.isTapHold||this.parent.quickPopup.quickPopupHide(),this.setPersistence()},w.prototype.onAdaptiveMove=function(e){this.parent.uiStateValues.action&&e.preventDefault()},w.prototype.onAdaptiveScroll=function(e){this.parent&&!this.parent.isDestroyed&&(this.parent.removeNewEventElement(),this.parent.uiStateValues.top=e.target.scrollTop)},w.prototype.scrollLeftPanel=function(e){var t=this.getLeftPanelElement();U.isNullOrUndefined(t)||(t.scrollTop=e.scrollTop)},w.prototype.scrollUiUpdate=function(e){var t,i,n,r,a;this.parent&&(a=this.parent.element.querySelector("."+Tt),r=this.getHeaderBarHeight(),t=this.getLeftPanelElement(),i=this.getScrollableElement(),n=this.getDatesHeaderElement(),r=this.parent.element.offsetHeight-r-n.offsetHeight,this.setContentHeight(i,t,r),this.setColWidth(i),r=Ke(),n.firstElementChild.style[e.cssProperties.rtlBorder]="",n.style[e.cssProperties.rtlPadding]="",a=!this.parent.enableAllDayScroll||!(i.offsetWidth-i.clientWidth<=a.offsetWidth-a.clientWidth&&a.classList.contains("e-all-day-scroll")),0<i.offsetWidth-i.clientWidth&&a?(n.firstElementChild.style[e.cssProperties.border]=0<r?"1px":"0px",n.style[e.cssProperties.padding]=0<r?r-1+"px":"0px"):(n.firstElementChild.style[e.cssProperties.border]="",n.style[e.cssProperties.padding]=""),e.isPreventScrollUpdate||(this.parent.uiStateValues.isInitial?(-1<this.parent.currentView.indexOf("Timeline")&&(i.scrollTop=this.parent.uiStateValues.top),this.scrollToWorkHour(),this.parent.uiStateValues.isInitial=!1):(t&&(t.scrollTop=this.parent.uiStateValues.top),i.scrollTop=this.parent.uiStateValues.top,i.scrollLeft=this.parent.uiStateValues.left)),this.parent.activeViewOptions.timeScale.enable&&this.highlightCurrentTime(),this.retainScrollPosition(),U.isNullOrUndefined(t)||U.isNullOrUndefined(i)||t.scrollTop===i.scrollTop||(t.scrollTop=i.scrollTop))},w.prototype.setContentHeight=function(e,t,i){this.parent.isAdaptive&&!this.isTimelineView()||U.isNullOrUndefined(t)||(t.style.height="auto"===this.parent.height?"auto":U.formatUnit(i-this.getScrollXIndent(e))),e.style.height="auto"===this.parent.height?"auto":U.formatUnit(i)},w.prototype.scrollToWorkHour=function(){var e;this.parent.workHours.highlight&&(e=this.element.querySelector("."+ft))&&(this.getScrollableElement().scrollTop=e.offsetTop,this.parent.uiStateValues.top=e.offsetTop,this.parent.uiStateValues.left=0)},w.prototype.scrollToHour=function(e,t){var i,e=this.parent.getStartEndTime(e);U.isNullOrUndefined(t)||(t=this.element.querySelector("."+Dt+'[data-date="'+new Date(W(t)).getTime()+'"]'))&&(this.parent.enableRtl?(i=this.element.querySelector("."+S),this.getScrollableElement().scrollLeft=-(i.offsetWidth-t.offsetLeft-t.offsetWidth)):this.getScrollableElement().scrollLeft=t.offsetLeft),U.isNullOrUndefined(e)||(this.getScrollableElement().scrollTop=this.getTopFromDateTime(e))},w.prototype.scrollToDate=function(e){this.scrollToHour(null,e)},w.prototype.generateColumnLevels=function(){var e,t,i,n=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays),r=[];if(0<this.parent.activeViewOptions.group.resources.length){if(r=this.parent.resourceBase.generateResourceLevels(n),this.parent.activeViewOptions.group.hideNonWorkingDays)for(;0===r[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()),n=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays),r=this.parent.resourceBase.generateResourceLevels(n);this.parent.uiStateValues.isGroupAdaptive&&0<this.parent.resourceBase.lastResourceLevel.length&&(t=(e=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]).resourceData[e.resource.startHourField],i=e.resourceData[e.resource.endHourField],r=[this.getDateSlots(e.renderDates,e.workDays,t,i)])}else r.push(n);return this.colLevels=r},w.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=[Dt];this.isCurrentDate(p)&&c.push(Ct),r.push({date:p,type:"dateHeader",className:c,colSpan:1,workDays:t,startHour:new Date(+a),endHour:new Date(+s)})}return r},w.prototype.isWorkHourRange=function(e){return this.getStartHour().getTime()<=e.getTime()&&this.getEndHour().getTime()>=e.getTime()},w.prototype.highlightCurrentTime=function(){var e,t=this;0<this.parent.activeViewOptions.headerRows.length&&"Hour"!==this.parent.activeViewOptions.headerRows.slice(-1)[0].option||(e=this.parent.getCurrentTime(),this.parent.showTimeIndicator&&this.isWorkHourRange(e)&&0<this.getCurrentTimeIndicatorIndex().length?(0<[].slice.call(this.element.querySelectorAll("."+O)).length&&this.changeCurrentTimePosition(),U.isNullOrUndefined(this.currentTimeIndicatorTimer)&&((e=xe-(1e3*e.getSeconds()+e.getMilliseconds()))<=59e3&&window.setTimeout(function(){U.isNullOrUndefined(t.currentTimeIndicatorTimer)||(t.clearCurrentTimeIndicatorTimer(),t.changeCurrentTimePosition(),t.updateCurrentTimeIndicatorTimer())},e),this.updateCurrentTimeIndicatorTimer())):this.clearCurrentTimeIndicatorTimer())},w.prototype.getCurrentTimeIndicatorIndex=function(){var e=[];if(!U.isNullOrUndefined(this.parent.resourceBase)&&0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive){var t=0,i=W(this.parent.getCurrentTime());if(this.parent.virtualScrollModule&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.activeViewOptions.group.byDate)for(var n=0,r=this.parent.resourceBase.expandedResources;n<r.length;n++)W((l=r[n]).date).getTime()===i.getTime()&&e.push(t),t+=1;else for(var a=0,s=this.parent.resourceBase.renderedResources;a<s.length;a++){var o,l=s[a];0<=(p=this.parent.getIndexOfDate(l.renderDates,i))&&(o=this.parent.activeViewOptions.group.byDate?this.parent.resourceBase.lastResourceLevel.length*p+t:t+p,e.push(o)),t+=this.parent.activeViewOptions.group.byDate?1:l.renderDates.length}}else{var p,c=(this.parent.uiStateValues.isGroupAdaptive&&0<this.parent.resourceBase.lastResourceLevel.length?this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]:this).renderDates;0<=(p=this.parent.getIndexOfDate(c,W(this.parent.getCurrentTime())))&&e.push(p)}return e},w.prototype.clearCurrentTimeIndicatorTimer=function(){U.isNullOrUndefined(this.currentTimeIndicatorTimer)||(window.clearInterval(this.currentTimeIndicatorTimer),this.currentTimeIndicatorTimer=null,this.removeCurrentTimeIndicatorElements())},w.prototype.updateCurrentTimeIndicatorTimer=function(){var e=this;this.currentTimeIndicatorTimer=window.setInterval(function(){e.changeCurrentTimePosition()},xe)},w.prototype.removeCurrentTimeIndicatorElements=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll(".e-previous-timeline,.e-current-timeline,.e-current-time"));e<t.length;e++){var i=t[e];U.remove(i)}},w.prototype.changeCurrentTimePosition=function(){if(!(!this.parent||this.parent&&this.parent.isDestroyed)){this.removeCurrentTimeIndicatorElements();var e=this.getCurrentTimeIndicatorIndex(),t=this.parent.getContentTable().rows[0],i=this.getTopFromDateTime(this.parent.getCurrentTime()),n=U.formatUnit(i),i=Math.floor(i/t.cells[0].offsetHeight),t=this.getLeftPanelElement(),r=[].slice.call(t.querySelectorAll("tr"));if(!U.isNullOrUndefined(i)&&!isNaN(i)&&i!==r.length){for(var a=[].slice.call(this.element.querySelectorAll("."+Zt)),s=0,o=e[0];s<o;s++)a[parseInt(s.toString(),10)].appendChild(U.createElement("div",{className:Xt,styles:"top:"+n}));for(var l=0,p=e;l<p.length;l++){var c=p[l];a[parseInt(c.toString(),10)].appendChild(U.createElement("div",{className:Gt,styles:"top:"+n}))}e=U.createElement("div",{innerHTML:this.parent.getTimeString(this.parent.getCurrentTime()),className:_t,styles:"top:"+n});i<=r.length&&(U.removeClass(t.querySelectorAll("."+Qt),Qt),r[parseInt(i.toString(),10)]&&U.addClass([r[parseInt(i.toString(),10)].lastElementChild],Qt),U.prepend([e],t),e.style.top=U.formatUnit(e.offsetTop-e.offsetHeight/2))}}},w.prototype.getTopFromDateTime=function(e){var t=this.getStartHour();return(60*(e.getHours()-t.getHours())+(e.getMinutes()-t.getMinutes()))*this.getWorkCellHeight()*this.parent.activeViewOptions.timeScale.slotCount/this.parent.activeViewOptions.timeScale.interval},w.prototype.getWorkCellHeight=function(){return parseFloat(at(this.element.querySelector("."+O)).toFixed(2))},w.prototype.getTdContent=function(e,t,i){var n,r,a,s=U.createElement("div"),o="",l=this.parent.element.id+"_";switch(t){case"dateHeader":n=this.parent.activeViewOptions.dateHeaderTemplate?(o="dateHeaderTemplate",a={date:e,type:t},r=this.parent.activeViewOptions.dateHeaderTemplateName,[].slice.call(this.parent.getDateHeaderTemplate()(a,this.parent,o,l+r+o,!1,void 0,void 0,this.parent.root))):(s.innerHTML=this.parent.activeView.isTimelineView()?'<span class="e-header-date e-navigate">'+this.getTimelineDate(e)+"</span>":'<div class="e-header-day">'+f(this.getDayName(e),"single")+'</div><div class="e-header-date e-navigate" role="link">'+this.getDate(e)+"</div>",[].slice.call(s.childNodes));break;case"majorSlot":n=this.parent.activeViewOptions.timeScale.majorSlotTemplate?(o="majorSlotTemplate",a={date:e,type:t},[].slice.call(this.parent.getMajorSlotTemplate()(a,this.parent,o,l+o,!1,void 0,void 0,this.parent.root))):(s.innerHTML="<span>"+this.getTime(e)+"</span>",[].slice.call(s.childNodes));break;case"minorSlot":n=this.parent.activeViewOptions.timeScale.minorSlotTemplate?(o="minorSlotTemplate",a={date:e,type:t},[].slice.call(this.parent.getMinorSlotTemplate()(a,this.parent,o,l+o,!1,void 0,void 0,this.parent.root))):[].slice.call(s.childNodes);break;case"alldayCells":this.parent.activeViewOptions.cellTemplate&&(r=this.parent.activeViewOptions.cellTemplateName,o="cellTemplate",a={date:e,type:t,groupIndex:i},n=[].slice.call(this.parent.getCellTemplate()(a,this.parent,o,l+r+o,!1,void 0,void 0,this.parent.root)))}return n},w.prototype.refreshHeader=function(){U.remove(this.element.querySelector("tbody tr")),this.renderHeader(),this.parent.notify(De,{});var e=this.element.querySelector("."+Tt);e&&(e.scrollLeft=this.parent.uiStateValues.left)},w.prototype.renderLayout=function(e){this.setPanel(U.createElement("div",{className:vi}));var t=[this.baseCssClass,this.viewClass];t.push(e),this.parent.activeViewOptions.group.byDate&&t.push("e-by-date"),this.parent.activeViewOptions.timeScale.enable||U.addClass([this.element],["e-timescale-disable",this.viewClass]),this.parent.activeViewOptions.allowVirtualScrolling&&!this.parent.uiStateValues.isGroupAdaptive&&t.push(yr),this.parent.rowAutoHeight&&this.parent.eventSettings.ignoreWhitespace&&t.push(Dr),this.renderPanel(e),U.addClass([this.element],t),this.element.appendChild(this.createTableLayout(fi)),this.element.querySelector("table").setAttribute("role","presentation"),this.colLevels=this.generateColumnLevels(),this.renderHeader(),this.renderContent(),this.parent.uiStateValues.isGroupAdaptive&&!this.parent.element.querySelector("."+ei)&&this.renderResourceMobileLayout(),this.parent.notify(De,{})},w.prototype.renderHeader=function(){var e,t=U.createElement("tr"),i=U.createElement("td");i.appendChild(this.renderDatesHeader()),this.parent.activeViewOptions.timeScale.enable&&((e=U.createElement("td",{className:At})).appendChild(this.renderLeftIndent()),t.appendChild(e)),t.appendChild(i),U.prepend([t],this.element.querySelector("tbody"))},w.prototype.renderContent=function(){0<this.parent.activeViewOptions.group.resources.length&&(this.parent.resourceBase.renderedResources=U.extend([],this.parent.resourceBase.lastResourceLevel,null,!0));var e,t,i,n=U.createElement("tr"),r=U.createElement("td");this.parent.isAdaptive?(r.setAttribute("colspan",this.parent.activeViewOptions.timeScale.enable?"2":"1"),e=U.createElement("div",{className:Kt}),this.parent.activeViewOptions.timeScale.enable&&e.appendChild(this.renderTimeCells()),e.appendChild(this.renderContentArea()),r.appendChild(e),U.EventHandler.add(e,"scroll",this.onAdaptiveScroll,this),U.EventHandler.add(e,U.Browser.touchMoveEvent,this.onAdaptiveMove,this),n.appendChild(r)):(e=this.colLevels.slice(0),this.parent.virtualScrollModule&&this.resetColLevels(),t=this.renderContentArea(),r.appendChild(t),this.parent.activeViewOptions.timeScale.enable&&((i=U.createElement("td")).appendChild(this.renderTimeCells()),n.appendChild(i)),n.appendChild(r),this.parent.virtualScrollModule&&(this.colLevels=e,this.parent.virtualScrollModule.renderVirtualTrack(t))),this.element.querySelector("tbody").appendChild(n)},w.prototype.renderLeftIndent=function(){for(var e=U.createElement("div",{className:It}),t=this.createTableLayout(),i=U.createElement("tr"),n=this.colLevels.length,r=0;r<n;r++){var a,s=i.cloneNode(),o={className:[this.colLevels[parseInt(r.toString(),10)][0]&&this.colLevels[parseInt(r.toString(),10)][0].className[0]],type:"emptyCells"};this.parent.activeViewOptions.showWeekNumber&&-1!==o.className.indexOf(Dt)&&(o.className.push(ai),a=this.parent.getWeekNumberContent(this.renderDates),o.template=[U.createElement("span",{innerHTML:""+a,attrs:{title:this.parent.localeObj.getConstant("week")+" "+a}})]),l=this.createTd(o),this.parent.renderHeaderIndentTemplate(o,l),s.appendChild(l),t.querySelector("tbody").appendChild(s)}var l,p=i.cloneNode(),c=U.createElement("div",{attrs:{tabindex:"0",role:"list",title:this.parent.localeObj.getConstant("expandAllDaySection"),"aria-disabled":"false","aria-label":this.parent.localeObj.getConstant("expandAllDaySection")},className:Ji+" "+$i+" "+dt+" "+d}),h={className:[v],type:"emptyCells"};return(l=this.createTd(h)).appendChild(c),this.parent.renderHeaderIndentTemplate(h,l),p.appendChild(l),t.querySelector("tbody").appendChild(p),e.appendChild(t),e},w.prototype.renderDatesHeader=function(){for(var e=U.createElement("div",{className:wt}),t=U.createElement("div",{className:Tt}),i=(e.appendChild(t),this.createTableLayout()),n=U.createElement("tr",{className:Gi}),r=this.colLevels.length,a=this.colLevels[r-1],s=0;s<r;s++){for(var o=n.cloneNode(),l=this.colLevels[parseInt(s.toString(),10)],p=0;p<l.length;p++)o.appendChild(this.createTd(l[parseInt(p.toString(),10)]));i.querySelector("tbody").appendChild(o)}return this.createAllDayRow(i,a),this.createColGroup(i,a),t.appendChild(i),e},w.prototype.createAllDayRow=function(e,t){for(var i=U.createElement("tr",{className:vt}),n=0;n<t.length;n++){var r=U.extend({},t[parseInt(n.toString(),10)]),a=(r.className=[v],r.type="alldayCells",this.createTd(r));a.setAttribute("data-date",r.date.getTime().toString()),U.isNullOrUndefined(r.groupIndex)?this.parent.uiStateValues.isGroupAdaptive&&a.setAttribute("data-group-index",""+this.parent.uiStateValues.groupIndex):a.setAttribute("data-group-index",""+r.groupIndex),this.wireCellEvents(a),i.appendChild(a)}e.querySelector("tbody").appendChild(i);var s=U.createElement("thead");s.appendChild(this.parent.eventBase.createEventWrapper("allDay")),U.prepend([s],e)},w.prototype.createTd=function(e){var t=U.createElement("td"),i=(this.addAttributes(e,t),e.date&&e.type&&(i=this.getTdContent(e.date,e.type,e.groupIndex))&&i.length&&U.append(i,t),this.parent.isMinMaxDate(W(new Date(""+e.date)))||U.addClass([t],or),"resourceHeader"===e.type&&this.setResourceHeaderContent(t,e),"dateHeader"===e.type&&0<=e.className.indexOf(Dt)&&(t.setAttribute("data-date",e.date.getTime().toString()),U.isNullOrUndefined(e.groupIndex)||t.setAttribute("data-group-index",""+e.groupIndex),this.wireMouseEvents(t)),{elementType:e.type,element:t,date:e.date,groupIndex:e.groupIndex});return this.parent.trigger(ee,i),t},w.prototype.wireCellEvents=function(e){U.EventHandler.add(e,"mousedown",this.parent.workCellAction.cellMouseDown,this.parent.workCellAction),this.wireMouseEvents(e)},w.prototype.wireMouseEvents=function(e){U.EventHandler.add(e,"click",this.parent.workCellAction.cellClick,this.parent.workCellAction),this.parent.isAdaptive||U.EventHandler.add(e,"dblclick",this.parent.workCellAction.cellDblClick,this.parent.workCellAction)},w.prototype.renderTimeCells=function(){var n=this,e=U.createElement("div",{className:Bt}),r=this.createTableLayout(),a=U.createElement("tr");return this.getTimeSlotRows(function(e){e.type=e.first?"majorSlot":"minorSlot",e.className=e.last?[Wt,zt]:[zt];var t=a.cloneNode(),i={date:e.date,type:e.type,className:e.className};return t.appendChild(n.createTd(i)),r.querySelector("tbody").appendChild(t),e}),e.appendChild(r),e},w.prototype.renderContentArea=function(){var e=U.createElement("div",{className:I}),t=this.createTableLayout(S);return this.setAriaAttributes(t),this.addAutoHeightClass(t),this.renderContentTable(t),this.createColGroup(t,this.colLevels.slice(-1)[0]),e.appendChild(t),this.wireCellEvents(t.querySelector("tbody")),U.EventHandler.add(e,"scroll",this.onContentScroll,this),U.EventHandler.add(e,U.Browser.touchMoveEvent,this.onAdaptiveMove,this),e},w.prototype.renderContentTable=function(e){var t=e.querySelector("tbody");U.append(this.getContentRows(),t),this.renderContentTableHeader(e)},w.prototype.getContentRows=function(){var a=this,s=[],o=U.createElement("tr"),l=U.createElement("td",{attrs:{"aria-selected":"false"}});return this.getTimeSlotRows(function(e){for(var t=o.cloneNode(),i=0,n=a.colLevels[a.colLevels.length-1];i<n.length;i++){var r=n[i],r=a.createContentTd(r,e,l);t.appendChild(r)}return s.push(t),e}),s},w.prototype.createContentTd=function(e,t,i){var i=i.cloneNode(),n=(e.colSpan&&i.setAttribute("colspan",e.colSpan.toString()),this.getContentTdClass(t)),r=W(e.date),t=(this.parent.isMinMaxDate(r)||n.push(or),r=new Date(r.setHours(t.date.getHours(),t.date.getMinutes(),t.date.getSeconds(),t.date.getMilliseconds())),"workCells"),a=(-1!==e.className.indexOf(Lt)&&(n.push(kt),t="resourceGroupCells"),this.parent.workHours.highlight&&(this.parent.activeViewOptions.timeScale.enable&&this.isWorkHour(r,e.startHour,e.endHour,e.workDays)||!this.parent.activeViewOptions.timeScale.enable&&this.isWorkDay(r,e.workDays))&&n.push(ft),U.addClass([i],n),this.parent.activeViewOptions.cellTemplate&&(n={date:r,type:t,groupIndex:e.groupIndex},a=this.parent.element.id+"_"+this.parent.activeViewOptions.cellTemplateName+"cellTemplate",n=[].slice.call(this.parent.getCellTemplate()(n,this.parent,"cellTemplate",a,!1,void 0,void 0,this.parent.root)),U.append(n,i)),i.setAttribute("data-date",r.getTime().toString()),this.parent.activeViewOptions.timeScale.enable?(a=this.parent.globalize.formatDate(r,{type:"dateTime",skeleton:"full",calendar:this.parent.getCalendarMode()}),n=this.parent.globalize.formatDate(this.getEndDateFromStartDate(r),{type:"dateTime",skeleton:"full",calendar:this.parent.getCalendarMode()}),i.setAttribute("aria-label",a+" "+this.parent.localeObj.getConstant("endAt")+" "+n)):(a=this.parent.globalize.formatDate(e.date,{skeleton:"full",calendar:this.parent.getCalendarMode()}),i.setAttribute("aria-label",a)),U.isNullOrUndefined(e.groupIndex)&&!this.parent.uiStateValues.isGroupAdaptive||(n=(this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues:e).groupIndex,i.setAttribute("data-group-index",""+n)),{elementType:t,element:i,date:r,groupIndex:e.groupIndex});return this.parent.trigger(ee,a),i},w.prototype.getContentTdClass=function(e){return e.last?[O]:[O,Yt]},w.prototype.renderContentTableHeader=function(e){var t=U.createElement("thead");t.appendChild(this.parent.eventBase.createEventWrapper()),this.parent.activeViewOptions.timeScale.enable&&t.appendChild(this.parent.eventBase.createEventWrapper("timeIndicator")),U.prepend([t],e)},w.prototype.getScrollableElement=function(){return this.parent.isAdaptive&&!this.isTimelineView()?this.element.querySelector("."+Kt):this.getContentAreaElement()},w.prototype.getLeftPanelElement=function(){return this.element.querySelector("."+Bt)},w.prototype.getEndDateFromStartDate=function(e){var t=this.parent.activeViewOptions.timeScale.interval*xe/this.parent.activeViewOptions.timeScale.slotCount,e=new Date(e.getTime());return e.setMilliseconds(e.getMilliseconds()+t),e},w.prototype.getStartEndHours=function(e){var t;return U.isNullOrUndefined(e)||""===e?new Date(2e3,0,0,0):(t=new Date(2e3,0,0,0),2===(e=e.split(":")).length&&t.setHours(parseInt(e[0],10),parseInt(e[1],10),0),t)},w.prototype.getTimeSlotRows=function(e){for(var t=[],i=this.getStartEndHours(this.parent.activeViewOptions.startHour),n=this.getStartEndHours(this.parent.activeViewOptions.endHour),r=this.parent.activeViewOptions.timeScale.interval*xe,a=r/this.parent.activeViewOptions.timeScale.slotCount,s=Math.round(B/a),o=i.getTime(),l=n.getTime(),p=(o!==l&&(i=i.getTimezoneOffset()!==n.getTimezoneOffset()?l-o-36e5:l-o,s=Math.round(i/a)),this.parent.activeViewOptions.timeScale.enable||(s=1),this.parent.getStartEndTime(this.parent.workHours.start)),c=this.parent.getStartEndTime(this.parent.workHours.end),h=0;h<s;h++){var d=new Date(o+a*h),u=(!tt(d)&&new Date(o).getTimezoneOffset()===d.getTimezoneOffset()||(u=new Date(o).getTimezoneOffset()-d.getTimezoneOffset(),d=new Date(d.getTime()-6e4*u)),h%(r/a)),d={date:new Date(""+d),startHour:p,endHour:c,first:0==u,middle:u<this.parent.activeViewOptions.timeScale.slotCount-1,last:u==this.parent.activeViewOptions.timeScale.slotCount-1,type:""};e&&e(d),t.push(d)}return t},w.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},w.prototype.destroy=function(){var e;!this.parent||this.parent&&this.parent.isDestroyed||(this.clearCurrentTimeIndicatorTimer(),this.element&&(this.appointment&&(this.appointment.destroy(),this.appointment=null),(e=this.getContentAreaElement())&&(U.EventHandler.remove(e,"scroll",this.onContentScroll),U.EventHandler.remove(e,U.Browser.touchMoveEvent,this.onAdaptiveMove)),this.parent.resourceBase&&this.parent.resourceBase.destroy(),this.parent.scheduleTouchModule&&this.parent.scheduleTouchModule.resetValues(),ol.prototype.destroy.call(this)))};var sl,ol,co=w;function w(e){e=ol.call(this,e)||this;return e.viewClass="e-day-view",e.isInverseTableSelect=!0,e.baseCssClass="e-vertical-view",e.appointment=null,e}ll=function(e,t){return(ll=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}ll(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(hl,pl=co),hl.prototype.getModuleName=function(){return"day"};var ll,pl,cl=hl;function hl(e){e=pl.call(this,e)||this;return e.viewClass="e-day-view",e}dl=function(e,t){return(dl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}dl(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(ml,ul=co),ml.prototype.startDate=function(){return this.getViewStartDate()},ml.prototype.endDate=function(){return this.getViewEndDate()},ml.prototype.getModuleName=function(){return"week"};var dl,ul,gl=ml;function ml(e){e=ul.call(this,e)||this;return e.viewClass="e-week-view",e}vl=function(e,t){return(vl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}vl(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Tl,fl=co),Tl.prototype.startDate=function(){return this.getViewStartDate()},Tl.prototype.endDate=function(){return this.getViewEndDate()},Tl.prototype.getModuleName=function(){return"workWeek"};var vl,fl,yl=Tl;function Tl(e){e=fl.call(this,e)||this;return e.viewClass="e-work-week-view",e}wl=function(e,t){return(wl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}wl(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(D,Dl=Ja),D.prototype.addEventListener=function(){this.parent.on(Se,this.onScrollUIUpdate,this),this.parent.on(Te,this.onDataReady,this),this.parent.on(F,this.onCellClick,this)},D.prototype.removeEventListener=function(){this.parent&&(this.parent.off(Se,this.onScrollUIUpdate),this.parent.off(Te,this.onDataReady),this.parent.off(F,this.onCellClick))},D.prototype.onDataReady=function(e){this.monthEvent=new Na(this.parent),this.monthEvent.renderAppointments(),this.parent.notify(we,{})},D.prototype.onCellClick=function(e){},D.prototype.onContentScroll=function(e){this.parent.removeNewEventElement(),this.parent.notify(Ce,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()},D.prototype.scrollLeftPanel=function(e){var t=this.getLeftPanelElement();t&&(t.scrollTop=e.scrollTop)},D.prototype.getLeftPanelElement=function(){return this.element.querySelector("."+ri)},D.prototype.onScrollUIUpdate=function(e){var t=this.getHeaderBarHeight(),i=this.getDatesHeaderElement(),n=this.getContentAreaElement(),t=this.parent.element.offsetHeight-t-i.offsetHeight,r=this.getLeftPanelElement(),t=("auto"!==this.parent.height&&this.setContentHeight(n,r,t),Ke());i.firstElementChild.style[e.cssProperties.rtlBorder]="",i.style[e.cssProperties.rtlPadding]="",0<n.offsetWidth-n.clientWidth?(i.firstElementChild.style[e.cssProperties.border]=0<t?"1px":"0px",i.style[e.cssProperties.padding]=0<t?t-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?(t=("TimelineMonth"===this.parent.currentView?this.parent.uiStateValues:e.scrollPosition).top,r&&(r.scrollTop=t),n.scrollTop=t,this.parent.uiStateValues.isInitial?(this.scrollToSelectedDate(),this.parent.uiStateValues.isInitial=!1):n.scrollLeft=("TimelineMonth"===this.parent.currentView?this.parent.uiStateValues:e.scrollPosition).left):this.scrollToSelectedDate(),this.retainScrollPosition()},D.prototype.scrollToSelectedDate=function(){var e=this.element.querySelector("."+Dt+'[data-date="'+this.parent.selectedDate.getTime().toString()+'"]'),t=this.getContentAreaElement();U.isNullOrUndefined(e)?t.scrollLeft=0:t.scrollLeft=this.parent.enableRtl?-(this.parent.getContentTable().offsetWidth-e.offsetLeft-e.offsetWidth):e.offsetLeft,0===t.scrollLeft&&this.parent.uiStateValues.isInitial&&(this.parent.uiStateValues.left=0)},D.prototype.setContentHeight=function(e,t,i){e.style.height="auto","Month"===this.parent.currentView&&(e.style.height=U.formatUnit(i)),t&&("MonthAgenda"===this.parent.currentView&&(i=(1<this.parent.activeViewOptions.interval?this.getContentAreaElement().firstElementChild:this.element.querySelector("."+S)).offsetHeight),t.style.height="auto",t.style.height=U.formatUnit(i-this.getScrollXIndent(e)))},D.prototype.generateColumnLevels=function(){var e,i,t=[],n=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays);return 0<this.parent.activeViewOptions.group.resources.length?(t=this.parent.resourceBase.generateResourceLevels(n),"MonthAgenda"===this.parent.currentView&&(t=[n]),this.parent.uiStateValues.isGroupAdaptive&&0<this.parent.resourceBase.lastResourceLevel.length&&(e=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex],i=this.getDateSlots(e.renderDates,e.workDays),t=[i=this.parent.activeViewOptions.group.byDate&&this.parent.activeViewOptions.group.hideNonWorkingDays?-1<(e=i.findIndex(function(e,t){return 0!==t&&e.date.getDay()===i[0].date.getDay()}))?i.slice(0,e):i:i])):t.push(n),this.colLevels=t},D.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=[Dt],o=e.slice(0,i).map(function(e){return e.getDay()});r&&o.indexOf(this.parent.currentTimezoneDate.getDay())===a&&s.push(Ct),n.push({date:e[parseInt(a.toString(),10)],type:"monthDay",className:s,colSpan:1,workDays:t})}return n},D.prototype.getDayNameFormat=function(){return this.parent.isAdaptive||0<this.parent.activeViewOptions.group.resources.length?"abbreviated":"wide"},D.prototype.renderLayout=function(e){this.dayNameFormat=this.getDayNameFormat(),this.setPanel(U.createElement("div",{className:vi}));var t=[this.viewClass],t=(t.push(e),this.parent.activeViewOptions.group.byDate&&(t.push("e-by-date"),"Month"!==this.parent.currentView)&&(this.parent.activeViewOptions.group.hideNonWorkingDays=!1),this.parent.activeViewOptions.allowVirtualScrolling&&!this.parent.uiStateValues.isGroupAdaptive&&t.push(yr),this.parent.rowAutoHeight&&this.parent.eventSettings.ignoreWhitespace&&t.push(Dr),U.addClass([this.element],t),this.renderPanel(e),this.element.appendChild(this.createTableLayout(fi)),this.element.querySelector("table").setAttribute("role","presentation"),this.colLevels=this.generateColumnLevels(),this.renderHeader(),this.renderContent(),"MonthAgenda"===this.parent.currentView?this.parent.activeView.getPanel():this.parent.element);this.parent.uiStateValues.isGroupAdaptive&&!t.querySelector("."+ei)&&this.renderResourceMobileLayout(),this.parent.notify(De,{}),this.parent.uiStateValues.isCustomMonth&&(this.parent.uiStateValues.isCustomMonth=!1)},D.prototype.refreshHeader=function(){U.remove(this.element.querySelector("tbody tr")),this.renderHeader(),this.parent.notify(De,{});var e=this.element.querySelector("."+Tt),t=this.element.querySelector("."+I);e&&(e.scrollLeft=this.parent.uiStateValues.left),t&&(t.scrollLeft=this.parent.uiStateValues.left)},D.prototype.wireCellEvents=function(e){U.EventHandler.add(e,"mousedown",this.parent.workCellAction.cellMouseDown,this.parent.workCellAction),U.EventHandler.add(e,"click",this.parent.workCellAction.cellClick,this.parent.workCellAction),this.parent.isAdaptive||U.EventHandler.add(e,"dblclick",this.parent.workCellAction.cellDblClick,this.parent.workCellAction)},D.prototype.renderHeader=function(){var e=U.createElement("tr"),t=(this.renderLeftIndent(e),U.createElement("td"));t.appendChild(this.renderDatesHeader()),e.appendChild(t),U.prepend([e],this.element.querySelector("tbody"))},D.prototype.renderLeftIndent=function(e){this.parent.activeViewOptions.showWeekNumber&&e.appendChild(U.createElement("td",{className:"e-left-indent"}))},D.prototype.renderContent=function(){0<this.parent.activeViewOptions.group.resources.length&&(this.parent.resourceBase.renderedResources=U.extend([],this.parent.resourceBase.lastResourceLevel,null,!0));var e,t=U.createElement("tr"),i=(this.parent.activeViewOptions.showWeekNumber&&t.appendChild(this.renderWeekNumberContent()),U.createElement("td")),n=this.colLevels.slice(0),r=(this.parent.virtualScrollModule&&this.resetColLevels(),U.createElement("div",{className:I})),a=this.renderContentArea();"Month"===this.parent.currentView?r.appendChild(a):((e=U.createElement("div",{className:gt})).appendChild(a),r.appendChild(e)),U.EventHandler.add(r,"scroll",this.onContentScroll,this),i.appendChild(r),t.appendChild(i),this.parent.virtualScrollModule&&(this.colLevels=n,this.parent.virtualScrollModule.renderVirtualTrack(r)),this.element.querySelector("tbody").appendChild(t),this.renderAppointmentContainer()},D.prototype.renderWeekNumberContent=function(){for(var e=this.renderDates.map(function(e){return new Date(+e)}),t=U.createElement("td"),i=U.createElement("div",{className:ri}),n=(t.appendChild(i),this.createTableLayout()),r=(i.appendChild(n),this.parent.activeViewOptions.showWeekend?7:this.parent.activeViewOptions.workDays.length),a=0,s=this.renderDates.length/r;a<s;a++){var o=e.splice(0,r),o=this.parent.getWeekNumberContent(o);n.querySelector("tbody").appendChild(this.createWeekNumberElement(o))}return t},D.prototype.renderAppointmentContainer=function(){},D.prototype.renderDatesHeader=function(){for(var e,t=U.createElement("div",{className:wt}),i=U.createElement("div",{className:Tt}),n=(t.appendChild(i),this.createTableLayout()),r=("Month"===this.parent.currentView&&((e=U.createElement("thead")).appendChild(U.createElement("tr")),U.prepend([e],n)),this.createColGroup(n,this.colLevels[this.colLevels.length-1]),U.createElement("tr")),a=0;a<this.colLevels.length;a++){for(var s=this.colLevels[parseInt(a.toString(),10)],o=r.cloneNode(),l=0;l<s.length;l++){var p=s[parseInt(l.toString(),10)];o.appendChild(this.createHeaderCell(p))}n.querySelector("tbody").appendChild(o)}return i.appendChild(n),t},D.prototype.createHeaderCell=function(e){var t,i,n=U.createElement("td"),r=(this.addAttributes(e,n),"monthDay"===e.type&&(t=U.createElement("span",{innerHTML:f(this.parent.getDayNames(this.dayNameFormat)[e.date.getDay()],"single")}),n.appendChild(t)),"resourceHeader"===e.type&&this.setResourceHeaderContent(n,e),"dateHeader"===e.type&&(U.addClass([n],Ei),n.setAttribute("data-date",e.date.getTime().toString()),this.parent.activeViewOptions.dateHeaderTemplate?(i={date:e.date,type:e.type},r=this.parent.element.id+"_"+this.parent.activeViewOptions.dateHeaderTemplateName+"dateHeaderTemplate",(i=[].slice.call(this.parent.getDateHeaderTemplate()(i,this.parent,"dateHeaderTemplate",r,!1,void 0,void 0,this.parent.root)))&&i.length&&U.append(i,n)):(t=U.createElement("span",{className:Oi}),r=this.parent.globalize.formatDate(e.date,{skeleton:"full",calendar:this.parent.getCalendarMode()}),t.setAttribute("title",f(r,"multiple")),i=!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()}),t.innerHTML=f(i,"single"),n.appendChild(t)),this.wireCellEvents(n)),{elementType:e.type,element:n,date:e.date,groupIndex:e.groupIndex});return this.parent.trigger(ee,r),n},D.prototype.getContentSlots=function(){if(!this.colLevels[this.colLevels.length-1]||!this.colLevels[this.colLevels.length-1][0])return[];var r=[],o=function(e,t,i,n){t={date:new Date(+t),groupIndex:i.groupIndex,workDays:i.workDays,type:"monthCells",className:n||[O]};r[parseInt(e.toString(),10)]||(r[parseInt(e.toString(),10)]=[]),r[parseInt(e.toString(),10)].push(t)},l="MonthAgenda"!==this.parent.currentView&&0<this.parent.activeViewOptions.group.resources.length;if(!l||this.parent.uiStateValues.isGroupAdaptive||this.parent.activeViewOptions.group.byDate)for(var e=this.renderDates.map(function(e){return new Date(+e)}),p=this.parent.activeViewOptions.showWeekend?7:this.parent.activeViewOptions.workDays.length,t=this.colLevels.slice(0,1)[0],i=this.renderDates.map(Number).indexOf(+t[0].date),c=0;c<this.renderDates.length/p;c++)for(var h,d=e.splice(0,p),u=i,g=this,n=i;n<this.colLevels[0].length+i&&n<d.length;n++)!function(e){var t=d[parseInt(u.toString(),10)];if(u++,l){var i=g.colLevels[g.colLevels.length-1],n=i.length/p,r=i.slice(0,n);if(g.parent.activeViewOptions.group.hideNonWorkingDays&&0===(r=i.filter(function(e){return e.date.getDay()===t.getDay()})).length)return h=e-=1;for(var a=0;a<r.length;a++){var s=0!==a?[O,"e-disable-date"]:void 0;o(c,t,r[parseInt(a.toString(),10)],s)}}else o(c,t,g.colLevels[g.colLevels.length-1][0]);h=e}(n),n=h;else for(var a=0,s=this.colLevels[this.colLevels.length-2];a<s.length;a++)for(var m=s[a],e=m.renderDates.map(function(e){return new Date(+e)}),p=this.parent.activeViewOptions.showWeekend?7:m.workDays.length,c=0;c<m.renderDates.length/p;c++)for(var d,v=0,f=d=e.splice(0,p);v<f.length;v++){var y=f[v];o(c,y,m)}return r},D.prototype.updateClassList=function(e){!this.isCustomMonth()&&this.isOtherMonth(e.date)&&e.className.push(E),this.parent.isMinMaxDate(e.date)||e.className.push(or),this.updateSelectedCellClass(e)},D.prototype.updateSelectedCellClass=function(e){},D.prototype.isOtherMonth=function(e){return e.getTime()<this.monthDates.start.getTime()||e.getTime()>this.monthDates.end.getTime()},D.prototype.renderContentArea=function(){var e=this.createTableLayout(S),t=(this.setAriaAttributes(e),this.addAutoHeightClass(e),"TimelineMonth"===this.parent.currentView&&this.createColGroup(e,this.colLevels[this.colLevels.length-1]),new Date(this.parent.selectedDate.getTime())),t=(this.monthDates={start:this.parent.calendarUtil.firstDateOfMonth(t),end:this.parent.calendarUtil.lastDateOfMonth(Be(t,this.parent.activeViewOptions.interval-1))},e.querySelector("tbody"));return U.append(this.getContentRows(),t),this.wireCellEvents(t),e},D.prototype.getContentRows=function(){for(var e=[],t=U.createElement("tr"),i=U.createElement("td",{attrs:{"aria-selected":"false"}}),n=this.getContentSlots(),r=0;r<n.length;r++){for(var a=t.cloneNode(),s=0;s<n[parseInt(r.toString(),10)].length;s++){var o=this.createContentTd(n[parseInt(r.toString(),10)][parseInt(s.toString(),10)],i);a.appendChild(o)}e.push(a)}return e},D.prototype.createContentTd=function(e,t){var i,t=t.cloneNode(),n=(e.colSpan&&t.setAttribute("colspan",e.colSpan.toString()),this.updateClassList(e),e.type),r=(-1!==e.className.indexOf(Lt)&&(e.className.push(kt),n="resourceGroupCells"),this.parent.workHours.highlight&&this.isWorkDay(e.date,e.workDays)&&e.className.push(bt),this.isCurrentDate(e.date)&&e.className.push(St),U.addClass([t],e.className),t.setAttribute("data-date",e.date.getTime().toString()),U.isNullOrUndefined(e.groupIndex)&&!this.parent.uiStateValues.isGroupAdaptive||(i=(this.parent.uiStateValues.isGroupAdaptive?this.parent.uiStateValues:e).groupIndex,t.setAttribute("data-group-index",""+i)),this.renderDateHeaderElement(e,t),this.parent.activeViewOptions.cellTemplate&&(i={date:e.date,type:n,groupIndex:e.groupIndex},r=this.parent.element.id+"_"+this.parent.activeViewOptions.cellTemplateName+"cellTemplate",i=[].slice.call(this.parent.getCellTemplate()(i,this.parent,"cellTemplate",r,!1,void 0,void 0,this.parent.root)),U.append(i,t)),{elementType:n,element:t,date:e.date,groupIndex:e.groupIndex});return this.parent.trigger(ee,r),t},D.prototype.renderDateHeaderElement=function(e,t){var i,n,r;"TimelineMonth"!==this.parent.currentView&&(i=U.createElement("div",{className:Ei}),this.parent.activeViewOptions.cellHeaderTemplate?(r={date:e.date,type:e.type,groupIndex:e.groupIndex},n=this.parent.element.id+"_"+this.parent.activeViewOptions.cellHeaderTemplateName+"cellHeaderTemplate",r=[].slice.call(this.parent.getCellHeaderTemplate()(r,this.parent,"cellHeaderTemplate",n,!1,void 0,void 0,this.parent.root)),U.append(r,i)):(n=!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()}),i.innerHTML=f(n,"single")),t.appendChild(i),"month"===this.getModuleName())&&(U.addClass([i],Oi),r=this.parent.globalize.formatDate(e.date,{skeleton:"full",calendar:this.parent.getCalendarMode()}),t.setAttribute("aria-label",r))},D.prototype.getMonthStart=function(e){e=Re("Month"===this.parent.currentView&&!U.isNullOrUndefined(this.parent.activeViewOptions.displayDate)&&(this.parent.uiStateValues.isCustomMonth||this.isCustomRange())?this.parent.activeViewOptions.displayDate:this.parent.uiStateValues.isCustomMonth||this.isCustomRange()||!this.isCustomMonth()?this.parent.calendarUtil.firstDateOfMonth(e):e,this.parent.activeViewOptions.firstDayOfWeek);return new Date(e.getFullYear(),e.getMonth(),e.getDate())},D.prototype.getMonthEnd=function(e){return this.isCustomMonth()?z(this.getMonthStart(e),7*(0<this.parent.activeViewOptions.numberOfWeeks?this.parent.activeViewOptions.numberOfWeeks:6)-1):(e=Be(e,this.parent.activeViewOptions.interval-1),z(Re(this.parent.calendarUtil.lastDateOfMonth(e),this.parent.activeViewOptions.firstDayOfWeek),6))},D.prototype.isCustomRange=function(){var e,t,i=this.parent.getCurrentViewDates();return!(!(i&&0<i.length)||(e=W(this.parent.selectedDate).getTime(),t=Re(i[i.length-1],this.parent.activeViewOptions.firstDayOfWeek),e>=Re(i[0],this.parent.activeViewOptions.firstDayOfWeek).getTime()&&e<=z(t,6).getTime()))},D.prototype.getRenderDates=function(e){for(var t=[],i=W(this.parent.selectedDate),n=this.getMonthStart(i),r=this.getMonthEnd(i);(this.parent.activeViewOptions.showWeekend||this.isWorkDay(n,e))&&t.push(n),(n=0<(n=z(n,1)).getHours()?W(n):n).getTime()<=r.getTime(););return e||(this.renderDates=t),this.parent.headerModule&&this.parent.headerModule.previousNextIconHandler(),t},D.prototype.getNextPreviousDate=function(e){var t;return this.isCustomMonth()?(t=this.parent.getCurrentViewDates(),z(Re("next"===e?t[t.length-1]:t[0],this.parent.activeViewOptions.firstDayOfWeek),"next"===e?7:7*-(0<this.parent.activeViewOptions.numberOfWeeks?this.parent.activeViewOptions.numberOfWeeks:6))):Be(this.parent.selectedDate,("next"===e?1:-1)*this.parent.activeViewOptions.interval)},D.prototype.getStartDate=function(){return this.getMonthStart(this.parent.selectedDate)},D.prototype.getEndDate=function(){return this.getMonthEnd(this.parent.selectedDate)},D.prototype.getEndDateFromStartDate=function(e){return z(new Date(e.getTime()),1)},D.prototype.getDateRangeText=function(){var e,t,i,n;return this.parent.isAdaptive||U.isNullOrUndefined(this.parent.activeViewOptions.dateFormat)?(e=this.parent.selectedDate,i=void 0,t=!1,this.isCustomMonth()&&(t=(n=this.parent.getCurrentViewDates())[0].getMonth()!==n[n.length-1].getMonth()||n[0].getFullYear()!==n[n.length-1].getFullYear())&&(e=n[0],i=n[n.length-1]),n="Month"!==this.parent.currentView||!this.isCustomMonth(),1<this.parent.activeViewOptions.interval&&n||t?(i=i||Be(je(e),this.parent.activeViewOptions.interval-1),e.getFullYear()===i.getFullYear()?f(this.parent.globalize.formatDate(e,{format:"MMMM",calendar:this.parent.getCalendarMode()})+" - "+this.parent.globalize.formatDate(i,{format:"MMMM ",calendar:this.parent.getCalendarMode()})+this.parent.globalize.formatDate(i,{skeleton:"y",calendar:this.parent.getCalendarMode()}),"single"):f(this.parent.globalize.formatDate(e,{format:"MMMM",calendar:this.parent.getCalendarMode()})+" "+e.getFullYear()+" - "+this.parent.globalize.formatDate(i,{format:"MMMM ",calendar:this.parent.getCalendarMode()})+this.parent.globalize.formatDate(i,{skeleton:"y",calendar:this.parent.getCalendarMode()}),"single")):(n=this.parent.activeViewOptions.dateFormat||"MMMM y",f(this.parent.globalize.formatDate(e,{format:n,calendar:this.parent.getCalendarMode()}),"single"))):this.formatDateRange(this.parent.selectedDate)},D.prototype.getLabelText=function(e){e=e.charAt(0).toLowerCase()+e.substring(1);return this.formatViewLabel(e,this.getStartDate(),this.getEndDate())},D.prototype.createWeekNumberElement=function(e){var t=U.createElement("tr"),e=U.createElement("td",{className:ai,attrs:{title:e?this.parent.localeObj.getConstant("week")+" "+e:""},innerHTML:e||""});return t.appendChild(e),this.parent.trigger(ee,{elementType:"weekNumberCell",element:e}),t},D.prototype.unWireEvents=function(){var e=this.element.querySelector("."+I);e&&U.EventHandler.remove(e,"scroll",this.onContentScroll)},D.prototype.isCustomMonth=function(){return"Month"===this.parent.currentView&&(!U.isNullOrUndefined(this.parent.activeViewOptions.displayDate)||0<this.parent.activeViewOptions.numberOfWeeks)},D.prototype.getModuleName=function(){return"month"},D.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed||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(),Dl.prototype.destroy.call(this))};var wl,Dl,bl=D;function D(e){e=Dl.call(this,e)||this;return e.dayNameFormat="wide",e.viewClass="e-month-view",e.isInverseTableSelect=!1,e.monthEvent=null,e.monthDates={},e}Cl=function(e,t){return(Cl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Cl(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(b,Sl=Ja),b.prototype.getModuleName=function(){return"year"},b.prototype.renderLayout=function(e){this.parent.resourceBase&&this.parent.resourceBase.generateResourceLevels([{renderDates:this.parent.activeView.renderDates}]),this.setPanel(U.createElement("div",{className:vi}));var t="Horizontal"===this.parent.activeViewOptions.orientation?"e-horizontal":"e-vertical",t=(U.addClass([this.element],[this.viewClass,t,e]),this.renderPanel(e),this.parent.activeViewOptions.allowVirtualScrolling&&U.addClass([this.element],[yr]),this.createTableLayout(fi)),e=(this.element.appendChild(t),this.element.querySelector("table").setAttribute("role","presentation"),t.querySelector("tbody"));this.rowCount=this.getRowColumnCount("row"),this.columnCount=this.getRowColumnCount("column"),this.renderHeader(e),this.renderContent(e),"Year"!==this.parent.currentView&&this.parent.uiStateValues.isGroupAdaptive&&(this.generateColumnLevels(),this.renderResourceMobileLayout()),U.EventHandler.add(this.element.querySelector("."+I),"scroll",this.onContentScroll,this),this.parent.notify(De,{})},b.prototype.renderHeader=function(e){},b.prototype.renderContent=function(e){var t=U.createElement("tr"),e=(e.appendChild(t),U.createElement("td")),t=(t.appendChild(e),this.element.querySelector("tbody").appendChild(t),U.createElement("div",{className:I})),e=(e.appendChild(t),this.createTableLayout("e-calendar-table")),t=(t.appendChild(e),U.createElement("tr")),e=(e.querySelector("tbody").appendChild(t),U.createElement("td")),i=(t.appendChild(e),U.createElement("div",{className:"e-calendar-wrapper"}));e.appendChild(i);for(var n=0,r=this.getMonths();n<r.length;n++){var a=r[n],a=new Date(this.parent.selectedDate.getFullYear(),a,1),s=U.createElement("div",{className:"e-month-calendar e-calendar",attrs:{"data-role":"calendar"}});s.appendChild(this.renderCalendarHeader(a)),s.appendChild(this.renderCalendarContent(a)),i.appendChild(s)}this.renderDates.splice(0,1)},b.prototype.renderCalendarHeader=function(e){var t,i=U.createElement("div",{className:"e-header e-month"}),n=U.createElement("div",{className:"e-day e-title"});return this.parent.activeViewOptions.monthHeaderTemplate?(t={date:e,type:"monthHeader"},this.renderTemplates(this.parent.getMonthHeaderTemplate(),t,"monthHeaderTemplate",this.parent.activeViewOptions.monthHeaderTemplateName,n)):n.innerHTML=this.getMonthName(e),i.appendChild(n),this.parent.trigger(ee,{elementType:"headerCells",element:n,date:e}),i},b.prototype.renderCalendarContent=function(e){var t=this.getMonthDates(e),i=U.createElement("div",{className:"e-content e-month"}),n=this.createTableLayout("e-calendar-table "+S),r=(i.appendChild(n),this.setAriaAttributes(n),U.createElement("thead",{className:"e-week-header"})),a=U.createElement("tr"),s=Re(Pe(e),this.parent.firstDayOfWeek);this.parent.activeViewOptions.showWeekNumber&&a.appendChild(U.createElement("th"));for(var o=0;o<7;o++){this.parent.activeViewOptions.dayHeaderTemplate?(l=U.createElement("th"),m={date:s,type:"dayHeader"},this.renderTemplates(this.parent.getDayHeaderTemplate(),m,"dayHeaderTemplate",this.parent.activeViewOptions.dayHeaderTemplateName,l),a.appendChild(l)):a.appendChild(U.createElement("th",{innerHTML:this.parent.getDayNames("narrow")[s.getDay()]}));var l=new Date(s.getTime()+B),s=l.getDate()===s.getDate()?z(l,1):l}r.appendChild(a),U.prepend([r],n);for(var p=n.querySelector("tbody");0<t.length;){var c,h=t.splice(0,7),d=U.createElement("tr");this.parent.activeViewOptions.showWeekNumber&&(c=this.parent.getWeekNumberContent(h),f=U.createElement("td",{className:"e-week-number",attrs:{title:this.parent.localeObj.getConstant("week")+" "+c},innerHTML:c}),d.appendChild(f),this.parent.trigger(ee,{elementType:"weekNumberCells",element:f}));for(var u=0,g=h;u<g.length;u++){var m,v=g[u],f=U.createElement("td",{className:"e-cell "+O,attrs:{"data-date":v.getTime().toString()}}),y=(this.parent.activeViewOptions.cellHeaderTemplate?(m={date:v,type:"monthCells"},this.renderTemplates(this.parent.getCellHeaderTemplate(),m,"cellHeaderTemplate",this.parent.activeViewOptions.cellHeaderTemplateName,f)):(y=U.createElement("span",{className:"e-day",innerHTML:this.parent.globalize.formatDate(v,{skeleton:"d",calendar:this.parent.getCalendarMode()}),attrs:{title:this.parent.globalize.formatDate(v,{type:"date",skeleton:"full"})}}),f.appendChild(y)),this.parent.activeViewOptions.cellTemplate&&(m={date:v,type:"monthCells"},this.renderTemplates(this.parent.getCellTemplate(),m,"cellTemplate",this.parent.activeViewOptions.cellTemplateName,f)),[]);e.getMonth()!==v.getMonth()&&(y.push(E),f.firstElementChild)&&!this.parent.activeViewOptions.cellTemplate&&f.firstElementChild.setAttribute("aria-disabled","true"),0<(y=this.isCurrentDate(v)&&e.getMonth()===v.getMonth()?y.concat(["e-today","e-selected"]):y).length&&U.addClass([f],y),d.appendChild(f),e.getMonth()===v.getMonth()&&this.renderDates.push(new Date(v)),this.parent.isMinMaxDate(v)?(U.EventHandler.add(f,"click",this.onCellClick,this),this.parent.isAdaptive||U.EventHandler.add(f,"dblclick",this.parent.workCellAction.cellDblClick,this.parent.workCellAction)):U.addClass([f],or),this.parent.trigger(ee,{elementType:"workCells",element:f,date:v})}p.appendChild(d)}return i},b.prototype.createTableColGroup=function(e){for(var t=U.createElement("colgroup"),i=0;i<e;i++)t.appendChild(U.createElement("col"));return t},b.prototype.getMonthName=function(e){return f(this.parent.globalize.formatDate(e,{format:this.parent.activeViewOptions.dateFormat||"MMMM y",calendar:this.parent.getCalendarMode()}),"multiple")},b.prototype.generateColumnLevels=function(){var e,t=[],i=this.getDateSlots([this.parent.selectedDate],this.parent.activeViewOptions.workDays);return 0<this.parent.activeViewOptions.group.resources.length?(t=this.parent.resourceBase.generateResourceLevels(i),this.parent.uiStateValues.isGroupAdaptive&&(e=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex],t=[this.getDateSlots([this.parent.selectedDate],e.workDays)])):t.push(i),t.pop(),this.colLevels=t},b.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:[Dt],colSpan:1,workDays:t,startHour:new Date(+this.parent.globalize.parseDate(i,{skeleton:"Hm"})),endHour:new Date(+this.parent.globalize.parseDate(n,{skeleton:"Hm"}))}]},b.prototype.getMonthDates=function(e){for(var e=Re(Pe(e),this.parent.firstDayOfWeek),t=z(new Date(+e),42),i=[],n=e;n.getTime()<t.getTime();n=z(n,1))i.push(W(new Date(n)));return i},b.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),e="row"===e?"Horizontal"===this.parent.activeViewOptions.orientation?t.length:o:"Horizontal"===this.parent.activeViewOptions.orientation?o:t.length;return e},b.prototype.isCurrentDate=function(e){return W(new Date).getTime()===W(new Date(e.getTime())).getTime()},b.prototype.getMonths=function(){var i=this;return Array.apply(null,{length:this.parent.activeViewOptions.monthsCount}).map(function(e,t){return i.parent.firstMonthOfYear+t})},b.prototype.renderTemplates=function(e,t,i,n,r){n=this.parent.element.id+"_"+n+i,e=[].slice.call(e(t,this.parent,i,n,!1,void 0,void 0,this.parent.root));U.append(e,r)},b.prototype.onCellClick=function(e){var t,i=U.closest(e.target,"."+O),n=this.parent.getDateFromElement(i),r=(this.parent.activeCellsData=this.parent.getCellDetails(i),n.getTime()<this.getStartDate().getTime());r||n.getTime()>this.getEndDate().getTime()?(this.parent.changeDate(this.parent.activeView.getNextPreviousDate(r?"previous":"next"),e),t=(t=this.parent.activeCellsData.startTime.getTime())>=this.getStartDate().getTime()&&t<=this.getEndDate().getTime()?t:(r?this.getEndDate():this.getStartDate()).getTime(),r=this.parent.element.querySelector(":not(."+E+')[data-date="'+t+'"]'),this.parent.selectCell(r),this.parent.activeCellsData=this.parent.getCellDetails(r)):(t=z(new Date(n.getTime()),1),r={date:n,event:this.parent.eventBase.filterEvents(n,t),element:e.target},i.classList.contains(E)&&(i=this.parent.element.querySelector(":not(."+E+')[data-date="'+i.getAttribute("data-date")+'"]')),this.parent.activeCellsData=this.parent.getCellDetails(i),n=U.extend(this.parent.activeCellsData,{cancel:!1,event:e,name:"cellClick"}),this.parent.trigger(F,n),this.parent.quickPopup.moreEventClick(r,t))},b.prototype.onContentScroll=function(e){var t=e.target,i=this.getDatesHeaderElement(),i=(this.parent.notify(Ce,e),i&&(i.firstElementChild.scrollLeft=t.scrollLeft),this.element.querySelector(".e-month-header-wrapper,.e-resource-column-wrap"));i&&(i.scrollTop=t.scrollTop),this.parent.isAdaptive||(this.parent.uiStateValues.top=e.target.scrollTop),this.parent.uiStateValues.left=e.target.scrollLeft,this.setPersistence()},b.prototype.onScrollUiUpdate=function(e){var t=this.parent.element.offsetHeight-this.getHeaderBarHeight(),i=this.element.querySelector("."+wt),n=(i&&(t-=i.offsetHeight),this.element.querySelector("."+I)),r=(n&&(n.style.height=U.formatUnit(t)),!this.parent.isAdaptive&&i&&(r=Ke(),0<n.offsetWidth-n.clientWidth?(i.firstElementChild.style[e.cssProperties.border]=0<r?"1px":"0px",i.style[e.cssProperties.padding]=0<r?r-1+"px":"0px"):(i.firstElementChild.style[e.cssProperties.border]="",i.style[e.cssProperties.padding]="")),this.setColWidth(this.getContentAreaElement()),this.element.querySelector(".e-month-header-wrapper,.e-resource-column-wrap"));r&&(i=n.scrollWidth>n.clientWidth,r.style.height=U.formatUnit(t-(i?17:0))),e.isPreventScrollUpdate||(this.parent.uiStateValues.isInitial?(this.parent.uiStateValues.isInitial=!1,this.parent.uiStateValues.top=this.parent.uiStateValues.left=0):(r&&(r.scrollTop=this.parent.uiStateValues.top),n.scrollTop=this.parent.uiStateValues.top,n.scrollLeft=this.parent.uiStateValues.left)),this.retainScrollPosition()},b.prototype.getStartDate=function(){return new Date(this.parent.selectedDate.getFullYear(),this.parent.firstMonthOfYear%12,1)},b.prototype.getEndDate=function(){return z(Be(this.getStartDate(),this.parent.monthsCount),-1)},b.prototype.startDate=function(){return"Year"===this.parent.currentView?Re(this.getStartDate(),this.parent.firstDayOfWeek):this.getStartDate()},b.prototype.endDate=function(){return"Year"===this.parent.currentView?z(He(this.getEndDate(),this.parent.firstDayOfWeek),1):z(this.getEndDate(),1)},b.prototype.getEndDateFromStartDate=function(e){e=new Date(e.getTime());return 0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(e=je(e)),z(new Date(e.getTime()),1)},b.prototype.getNextPreviousDate=function(e){return We(this.parent.selectedDate,"next"===e?1:-1)},b.prototype.getDateRangeText=function(){var e=this.getStartDate(),t=this.getEndDate();return e.getFullYear()!==t.getFullYear()?this.parent.globalize.formatDate(e,{skeleton:"yMMM"})+" - "+this.parent.globalize.formatDate(t,{skeleton:"yMMM"}):this.parent.globalize.formatDate(this.parent.selectedDate,{skeleton:"y"})},b.prototype.addEventListener=function(){this.parent.on(Se,this.onScrollUiUpdate,this),this.parent.on(Te,this.onDataReady,this)},b.prototype.removeEventListener=function(){this.parent&&(this.parent.off(Se,this.onScrollUiUpdate),this.parent.off(Te,this.onDataReady))},b.prototype.onDataReady=function(e){this.yearEventModule=new il(this.parent),this.yearEventModule.renderAppointments(),this.parent.notify(we,e)},b.prototype.scrollToDate=function(e){e=+new Date(W(e)),e=this.element.querySelector("."+O+":not(."+E+')[data-date="'+e+'"]');e&&(e=U.closest(e,".e-month-calendar"),this.getContentAreaElement().scrollTop=e.offsetTop)},b.prototype.destroy=function(){var e;!this.parent||this.parent&&this.parent.isDestroyed||this.element&&((e=this.element.querySelector("."+I))&&U.EventHandler.remove(e,"scroll",this.onContentScroll),this.yearEventModule&&(this.yearEventModule.destroy(),this.yearEventModule=null),this.parent.resourceBase&&this.parent.resourceBase.destroy(),Sl.prototype.destroy.call(this))};var Cl,Sl,Ol=b;function b(e){e=Sl.call(this,e)||this;return e.viewClass="e-year-view",e.isInverseTableSelect=!1,e.yearEventModule=null,e}El=function(e,t){return(El=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}El(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Al,Vl=Ja),Al.prototype.createAgendaContentElement=function(e,a,t,s,o){var i,l=this,p=this.parent.eventFields;return"noEvents"===e?(e=[{subject:this.parent.localeObj.getConstant("noEvents")}],0===(i=N.ListBase.createList(this.parent.createElement,e,{moduleName:"agenda",listClass:this.parent.activeView.viewClass,itemClass:this.parent.activeView.viewClass,template:'<div class="'+Ai+'">'+this.parent.localeObj.getConstant("noEvents")+"</div>"})).querySelector(".e-agenda-item").children.length&&i.firstElementChild.appendChild(U.createElement("div",{className:Ai,innerHTML:this.parent.localeObj.getConstant("noEvents")}))):(i=N.ListBase.createList(this.parent.createElement,a,{moduleName:"agenda",listClass:this.parent.activeView.viewClass,itemClass:this.parent.activeView.viewClass}),[].slice.call(i.children).forEach(function(t,e){var i,n=U.createElement("div",{className:A,attrs:{"data-id":"Appointment_"+a[parseInt(e.toString(),10)][""+l.parent.eventFields.id],"data-guid":a[parseInt(e.toString(),10)].Guid,role:"button",tabindex:"0","aria-disabled":l.parent.eventBase.getReadonlyAttribute(a[parseInt(e.toString(),10)]),"aria-label":l.parent.getAnnouncementString(a[parseInt(e.toString(),10)])}}),r=(U.isNullOrUndefined(o)||n.setAttribute("data-group-index",o.toString()),l.parent.eventBase.applyResourceColor(n,a[parseInt(e.toString(),10)],"borderColor",s),U.isNullOrUndefined(l.parent.activeViewOptions.eventTemplate)?i=l.createAppointment(a[parseInt(e.toString(),10)]):(U.addClass([n],"e-template"),r=l.parent.element.id+"_"+l.parent.activeViewOptions.eventTemplateName+"eventTemplate",i=l.parent.getAppointmentTemplate()(a[parseInt(e.toString(),10)],l.parent,"eventTemplate",r,!1,void 0,void 0,l.parent.root),U.isNullOrUndefined(a[parseInt(e.toString(),10)][p.recurrenceRule])||(r=a[parseInt(e.toString(),10)][p.id]===a[parseInt(e.toString(),10)][p.recurrenceID]?Yi:_i,n.appendChild(U.createElement("div",{className:dt+" "+r})))),U.append([].slice.call(i),n),et(t),t.appendChild(n),{data:U.extend({},a[parseInt(e.toString(),10)],null,!0),element:t,cancel:!1});l.parent.trigger(ne,r,function(e){e.cancel&&U.remove(t)})})),t.appendChild(i),("MonthAgenda"===this.parent.currentView&&0<this.parent.activeViewOptions.group.resources.length||"Agenda"===this.parent.currentView)&&U.addClass([t],Vi),this.parent.renderTemplates(),t},Al.prototype.createAppointment=function(e){var t=this.parent.eventFields,i=e[t.subject]||this.parent.eventSettings.fields.subject.default||this.parent.localeObj.getConstant("addTitle"),n=e[t.location]||this.parent.eventSettings.fields.location.default,r=U.createElement("div",{className:ui}),a=(U.isNullOrUndefined(n)||""===n||(i+=","),U.createElement("div",{className:Ln})),n=(this.parent.sanitize(i,a),r.appendChild(a),U.isNullOrUndefined(n)||""===n||(i=U.createElement("div",{className:Nn}),this.parent.sanitize(n,i),r.appendChild(i)),U.isNullOrUndefined(e[t.recurrenceRule])||(a=e[t.id]===e[t.recurrenceID]?Yi:_i,r.appendChild(U.createElement("div",{className:dt+" "+a}))),e[t.startTime]),i=e[t.endTime],a=e[t.isAllDay],t=this.parent.localeObj.getConstant("allDay"),s=this.parent.getTimeString(n)+" - "+this.parent.getTimeString(i),i=(U.isNullOrUndefined(e.data)||(t=(1<=(i.getTimezoneOffset()!==n.getTimezoneOffset()?i.getTime()-n.getTime()+36e5:i.getTime()-n.getTime())/B?t:s)+" ("+this.parent.localeObj.getConstant("day")+" "+e.data.index+"/"+e.data.count+")"),!U.isNullOrUndefined(e.data)||a?t:s);return[r,U.createElement("div",{className:xi,innerHTML:i})]},Al.prototype.processAgendaEvents=function(e){var t=[];if(!U.isNullOrUndefined(e))for(var i=0,n=e;i<n.length;i++)var r=n[i],a=this.parent.eventBase.splitEventByDay(r),t=t.concat(1<a.length?a:r);return t},Al.prototype.wireEventActions=function(){for(var e=0,t=[].slice.call(this.parent.element.querySelectorAll("."+A));e<t.length;e++){var i=t[e];this.parent.eventBase.wireAppointmentEvents(i,this.parent.getEventDetails(i),!0)}for(var n=0,r=[].slice.call(this.parent.element.querySelectorAll(".e-m-date"));n<r.length;n++){i=r[n];U.EventHandler.add(i,"click",this.parent.agendaModule.dayNavigationClick,this)}},Al.prototype.calculateResourceTableElement=function(e,t,i,n){void 0===n&&(n=null),U.isNullOrUndefined(this.parent.resourceBase.lastResourceLevel)&&(l=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays),this.parent.resourceBase.generateResourceLevels(l));for(var r=z(new Date(i.getTime()),t),a=this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView?t:1,s=this.parent.resourceBase.resourceCollection,o=this.parent.resourceBase.lastResourceLevel,l=i,p=i,c=this.parent.activeViewOptions.showWeekend,h=0;h<a;h++){var d,u=[],g=[],m=0,v=z(p,h);if("Agenda"===this.parent.currentView&&this.parent.activeViewOptions.group.byDate&&this.parent.activeViewOptions.allowVirtualScrolling&&!c&&!this.isWorkDay(v)){do{if(n<=(v=z(v,1)))break}while(!this.isWorkDay(v)||this.parent.eventBase.filterEvents(v,z(v,1)).length<1);if(n<=v)break;p=z(v,-h),r=z(v,1)}var f=this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView?z(v,1):r,y=this.parent.eventBase.filterEvents(v,f);if(0<y.length||!this.parent.hideEmptyAgendaDays||"MonthAgenda"===this.parent.currentView){for(var T=0;T<o.length;T++){t=this.parent.activeViewOptions.group.byDate&&"MonthAgenda"!==this.parent.currentView?1:t;var w=[],D=(i=v,this.parent.eventBase.filterEvents(i,r,y,o[parseInt(T.toString(),10)]));if(0<D.length||!this.parent.hideEmptyAgendaDays||"MonthAgenda"===this.parent.currentView)for(var b=0;b<t;b++){var C=this.parent.eventBase.filterEvents(i,z(i,1),D,void 0);if(((c||!c&&(this.parent.group.byDate?this.isWorkDay(i):this.isWorkDay(i,o[parseInt(T.toString(),10)].workDays)))&&(0<C.length||!this.parent.hideEmptyAgendaDays)||"MonthAgenda"===this.parent.currentView)&&(w.push(C[0]),C={rowSpan:1,type:"eventColumn",resource:s[s.length-1],groupIndex:o[parseInt(T.toString(),10)].groupIndex,groupOrder:o[parseInt(T.toString(),10)].groupOrder,resourceData:o[parseInt(T.toString(),10)].resourceData,eventData:C,date:i},d={rowSpan:1,type:"dateColumn",resource:s[parseInt((s.length-1).toString(),10)],groupOrder:o[parseInt(T.toString(),10)].groupOrder,resourceData:o[parseInt(T.toString(),10)].resourceData,date:i},u[parseInt(m.toString(),10)]||(u[parseInt(m.toString(),10)]=[]),u[parseInt(m.toString(),10)].push(C),u[parseInt(m.toString(),10)].push(d),m++),(i=z(i,1)).getTime()>=r.getTime()||this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView){0<w.length&&(u[u.length-1][1].cssClass=Vi,C={rowSpan:w.length,type:"resourceColumn",resource:s[parseInt((s.length-1).toString(),10)],groupOrder:o[parseInt(T.toString(),10)].groupOrder.slice(0,-1),resourceData:o[parseInt(T.toString(),10)].resourceData,groupIndex:u.length-w.length,className:[gi],date:i},u[parseInt((u.length-w.length).toString(),10)].push(C),g.push(U.extend({},C,null,!0)));break}}}for(var S=s.slice(0,-1),O=[],E=0,V=0;V<S.length;V++)for(var w=S[S.length-(V+1)].dataSource,x=0;x<w.length;x++)for(var A=0,I=0;I<g.length;I++)g[parseInt(I.toString(),10)].groupOrder[S.length-(V+1)]===w[parseInt(x.toString(),10)][S[S.length-(V+1)].idField]&&(E+=g[parseInt(I.toString(),10)].rowSpan,O.push(U.extend({},g[parseInt(I.toString(),10)],null,!0))),++A===g.length&&0<O.length&&(O[0].rowSpan=E,O[0].type="parentColumnLevel_"+(V+1),O[0].resource=S[S.length-(V+1)],O[0].resourceData=w[parseInt(x.toString(),10)],O[0].date=i,u[O[0].groupIndex].push(O[0]),O=[],E=0);this.createResourceTableRow(u,e)}}0===this.parent.eventBase.filterEvents(l,r).length&&!this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays&&this.renderEmptyContent(e,l)},Al.prototype.createResourceTableRow=function(e,t){var i,n=U.createElement("tr"),r=U.createElement("td"),a=0;if(this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView){for(var s=[],o=this.parent.resourceBase.resourceCollection.slice(0,-1),l=0;l<e.length;l++)s=s.concat(e[parseInt(l.toString(),10)]);for(var p=0<o.length?"parentColumnLevel_"+o.length:"resourceColumn",c=s.filter(function(e){return e.type===p}),h=0;h<c.length;h++)a+=c[parseInt(h.toString(),10)].rowSpan}for(var d=0;d<e.length;d++){for(var u=n.cloneNode(),g=e[parseInt(d.toString(),10)].length-1;0<=g;g--){var m,v=e[parseInt(d.toString(),10)][parseInt(g.toString(),10)],f=r.cloneNode();"dateColumn"===v.type?this.parent.activeViewOptions.group.byDate||"MonthAgenda"===this.parent.currentView?i=e[parseInt(d.toString(),10)][parseInt(g.toString(),10)]:(f.setAttribute("data-date",v.date.getTime().toString()),f.appendChild(this.createDateHeaderElement(v.date)),m=[Ti,Si],v.cssClass&&m.push(v.cssClass),U.addClass([f],m),this.isCurrentDate(new Date(v.date.getTime()))&&U.addClass(f.childNodes,wi),u.appendChild(f)):("eventColumn"===v.type?(m=0===v.eventData.length?"noEvents":"data",(f=this.createAgendaContentElement(m,v.eventData,f,v.groupOrder,v.groupIndex)).setAttribute("data-date",v.date.getTime().toString()),!this.parent.activeViewOptions.group.byDate&&"MonthAgenda"!==this.parent.currentView||U.addClass([f],[Ti,"e-day-padding"])):(f.setAttribute("rowspan",v.rowSpan.toString()),U.addClass([f],"e-resource-column"),this.setResourceHeaderContent(f,v,v.className[0])),u.appendChild(f))}if(this.parent.activeViewOptions.group.byDate&&0===d&&"MonthAgenda"!==this.parent.currentView){(f=r.cloneNode()).setAttribute("data-date",i.date.getTime().toString()),f.setAttribute("rowspan",a.toString()),f.appendChild(this.createDateHeaderElement(i.date)),U.addClass([f],[Ti,Si,"e-date-border"]);var y=_e(this.parent.selectedDate.getTime(),i.date.getTime());if(u.setAttribute("data-row-index",y.toString()),this.parent.element.querySelector('.e-agenda-view tr[data-row-index="'+y+'"]'))break;u.insertBefore(f,u.childNodes[0])}t.appendChild(u)}},Al.prototype.createDateHeaderElement=function(e){var t,i,n;return this.parent.activeViewOptions.dateHeaderTemplate?(t=U.createElement("div",{className:Ci}),n={date:e,type:"dateHeader"},i=this.parent.element.id+"_"+this.parent.activeViewOptions.dateHeaderTemplateName+"dateHeaderTemplate",n=[].slice.call(this.parent.getDateHeaderTemplate()(n,this.parent,"dateHeaderTemplate",i,!1,void 0,void 0,this.parent.root)),U.append(n,t)):t=this.getMobileDateElement(e,Ci),t},Al.prototype.renderEmptyContent=function(e,t){var t=this.createTableRowElement(t,"noEvents"),i=t.children[0],n=U.createElement("div",{className:"e-empty-event",innerHTML:this.parent.localeObj.getConstant("noEvents")});i.appendChild(n),e.appendChild(t)},Al.prototype.createTableRowElement=function(e,t){var i=_e(this.parent.selectedDate.getTime(),e.getTime()),n=U.createElement("tr",{attrs:{"data-row-index":i.toString()}}),i=U.createElement("td",{attrs:{class:"monthHeader"===t?bi:Ti,"aria-selected":"false","data-column-index":i.toString(),"data-date":e.getTime().toString()}}),e=i.cloneNode(),i=i.cloneNode();return n.appendChild(e),"noEvents"!==t&&n.appendChild(i),n},Al.prototype.destroy=function(){Vl.prototype.destroy.call(this)};var El,Vl,xl=Al;function Al(e){return Vl.call(this,e)||this}Il=function(e,t){return(Il=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Il(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(C,Ml=xl),C.prototype.getModuleName=function(){return"agenda"},C.prototype.renderLayout=function(){this.agendaDates={},this.element=U.createElement("div",{className:vi}),U.addClass([this.element],this.viewClass),this.element.appendChild(this.createTableLayout(fi)),this.element.querySelector("table").setAttribute("role","presentation"),this.parent.element.querySelector("."+gt).appendChild(this.element);var e=U.createElement("tr"),t=(this.element.querySelector("tbody").appendChild(e),U.createElement("td")),e=(e.appendChild(t),U.createElement("div",{className:I})),t=(t.appendChild(e),this.createTableLayout(S)),e=(this.setAriaAttributes(t),e.appendChild(t),t.querySelector("tbody")),t=W(this.parent.selectedDate);this.renderEmptyContent(e,t),this.wireEvents(),this.parent.resourceBase&&this.parent.resourceBase.generateResourceLevels([{renderDates:this.parent.activeView.renderDates}]),this.parent.uiStateValues.isGroupAdaptive&&!this.parent.element.querySelector("."+ei)&&this.renderResourceMobileLayout(),this.parent.notify(De,{})},C.prototype.eventLoad=function(e){this.dataSource=U.extend([],this.parent.eventsData,null,!0);for(var t=0,i=this.parent.eventsData;t<i.length;t++)delete i[t].generatedDates;var e=this.parent.activeViewOptions.allowVirtualScrolling?e.processedData:this.parent.eventsProcessed,n=(this.parent.uiStateValues.isGroupAdaptive&&(n=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex],this.dataSource=this.parent.eventBase.filterEventsByResource(n,this.dataSource),e=this.parent.eventBase.filterEventsByResource(n,e)),this.parent.eventsProcessed=this.processAgendaEvents(e),W(this.parent.selectedDate)),e=this.element.querySelector("."+S+" tbody");et(e),this.renderInitialContent(e,n),this.wireEventActions(),U.closest(e,"."+I).scrollTop=1,this.parent.notify(we,{}),this.parent.activeViewOptions.allowVirtualScrolling||this.retainScrollPosition()},C.prototype.refreshEvent=function(e){for(var t=[],i=this.parent.eventFields,n=0,r=this.dataSource;n<r.length;n++){var a=r[n];U.isNullOrUndefined(a[i.recurrenceID])&&!U.isNullOrUndefined(a[i.recurrenceRule])&&!U.isNullOrUndefined(a.generatedDates)&&e>=a.generatedDates.end&&(t=t.concat(this.parent.eventBase.generateOccurrence(a,e)))}this.parent.eventsProcessed=this.parent.eventsProcessed.concat(this.processAgendaEvents(t))},C.prototype.refreshHeader=function(){var e=this.element.querySelector("."+S+" tbody"),t=(this.parent.activeViewOptions.group.byDate?et(e):U.remove(e.firstElementChild),W(this.parent.selectedDate)),i=U.createElement("tbody"),t=new Date(t.getTime()),n=this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays?this.getEndDateFromStartDate(t):z(t,this.parent.agendaDaysCount);this.renderContent(i,t,n),U.append([].slice.call(i.childNodes),e)},C.prototype.renderInitialContent=function(e,t){var i=U.createElement("tbody"),n=new Date(t.getTime()),r=this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays?this.getEndDateFromStartDate(n):z(n,this.parent.agendaDaysCount);if(this.renderContent(i,n,r),U.append([].slice.call(i.childNodes),e),this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays&&0<this.parent.eventsData.length)for(var a=this.getContentAreaElement(),s=a.querySelector(".e-content-table");a.offsetWidth<=a.clientWidth&&!(this.parent.isAdaptive&&s.offsetHeight>=a.clientHeight);){var o=U.createElement("tbody"),n=z(r=n,-this.parent.agendaDaysCount);if(this.renderContent(o,n,r),U.prepend([].slice.call(o.childNodes),e),n<=this.parent.minDate)break}e.childNodes.length<=0&&this.renderEmptyContent(e,t)},C.prototype.renderContent=function(e,t,i){var n,r=this.parent.eventFields,a=new Date(t.getTime()),s=this.appointmentFiltering(a,i);if(0<s.length&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.hideEmptyAgendaDays)if(this.parent.activeViewOptions.showWeekend||this.isAgendaWorkDay(s[0][r.startTime]))t=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])){t=new Date(new Date(p[r.startTime].getTime()).setHours(0,0,0,0)),this.updateHeaderText(p[r.startTime]);break}}if(!this.parent.hideEmptyAgendaDays||0<this.parent.agendaDaysCount&&0<s.length){if(0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive){s=t;this.parent.activeViewOptions.group.byDate||(this.parent.activeViewOptions.allowVirtualScrolling=!1,s=a,this.parent.headerModule&&(this.parent.headerModule.updateDateRange(),this.parent.headerModule.updateHeaderItems("remove"))),this.calculateResourceTableElement(e,this.parent.agendaDaysCount,s,i)}else for(var c=0;c<this.parent.agendaDaysCount;c++){var h=this.createTableRowElement(t,"data"),d=this.element.querySelector('tr[data-row-index="'+ +h.dataset.rowIndex+'"]');if(d||!this.parent.activeViewOptions.showWeekend&&!this.isAgendaWorkDay(t)){if(t=z(t,1),!d&&this.parent.activeViewOptions.allowVirtualScrolling&&c--,t.getTime()>i.getTime())break}else{var u,d=h.children[0],g=h.children[1],m=this.appointmentFiltering(t);if(0<m.length||!this.parent.hideEmptyAgendaDays&&0===m.length?(u=this.parent.hideEmptyAgendaDays||0!==m.length?"data":"noEvents",d.appendChild(this.createDateHeaderElement(t)),h.appendChild(d),u=this.createAgendaContentElement(u,m,g),h.appendChild(u),0<u.querySelectorAll("li").length&&e.appendChild(h)):this.parent.activeViewOptions.allowVirtualScrolling&&c--,this.isCurrentDate(new Date(t.getTime()))&&U.addClass(d.childNodes,wi),(t=z(t,1)).getTime()>i.getTime())break}}n=new Date(t.getTime()-B)}this.agendaDates={start:a,end:n}},C.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)},C.prototype.agendaScrolling=function(e){this.parent.quickPopup&&this.parent.quickPopup.quickPopupHide(),this.parent.activeViewOptions.allowVirtualScrolling&&this.virtualScrolling(e),this.parent.activeViewOptions.allowVirtualScrolling||this.setPersistence()},C.prototype.virtualScrolling=function(e){var t,i=e.target,n=i.scrollTop,r=i.scrollHeight,a=n+i.clientHeight,s=this.virtualScrollTop<n?"next":"previous",o=i.querySelector("tbody"),l=U.createElement("tbody"),p=this.getElementFromScrollerPosition(e),e=this.parent.getDateFromElement(p);if(0===n){if(t=this.getPreviousNextDate(z(e,-1),s),0<this.appointmentFiltering(t.start,t.end).length||!this.parent.hideEmptyAgendaDays){this.renderContent(l,t.start,t.end),U.prepend([].slice.call(l.childNodes),o),this.wireEventActions();for(var c=0,h=o.children;c<h.length;c++)if(h[parseInt(c.toString(),10)].getAttribute("data-row-index")===p.getAttribute("data-column-index")){var d=h[parseInt(c.toString(),10)].offsetTop-this.element.querySelector(".e-agenda-item").offsetHeight;i.scrollTop=d;break}this.updateHeaderText(e)}}else r-5<=a?(t=this.getPreviousNextDate(z(e,1),s),(0<this.appointmentFiltering(t.start,t.end).length||!this.parent.hideEmptyAgendaDays)&&(this.renderContent(l,t.start,t.end),U.append([].slice.call(l.childNodes),o),this.wireEventActions(),this.updateHeaderText(e))):this.updateHeaderText(e);this.virtualScrollTop=n;r=this.parent.eventBase.getSelectedAppointments();0<r.length&&r[r.length-1].focus()},C.prototype.getElementFromScrollerPosition=function(e){var t,i,e=e.target,n=e.scrollTop,r=e.scrollHeight,a=n+e.clientHeight,s=[].slice.call(e.querySelectorAll(".e-agenda-item"));if(0<s.length)if(0===n)i=s[0],t=U.closest(i,"."+Ti);else if(a===r)i=s[s.length-1],t=U.closest(i,"."+Ti);else for(var o=0,l=s.length;o<l;o++)if(0<=(i=s[parseInt(o.toString(),10)]).getBoundingClientRect().top){t=U.closest(i,"."+Ti);break}return t},C.prototype.updateHeaderText=function(e){this.parent.showHeaderBar&&this.parent.headerModule.updateDateRange(e)},C.prototype.getPreviousNextDate=function(e,t){var i=new Date(e.getTime()),n=this.getStartDateFromEndDate(e),r=this.getEndDateFromStartDate(e),a=0;do{}while(((this.parent.activeViewOptions.showWeekend||!this.parent.activeViewOptions.showWeekend&&this.isAgendaWorkDay(i))&&(0<this.appointmentFiltering(i).length||!this.parent.hideEmptyAgendaDays)&&a++,!((i=z(i,"next"===t?1:-1))<n||r<i))&&a!==this.parent.agendaDaysCount);var s=z(i,"next"===t?-1:1);return"next"===t?{start:e,end:z(s,1)}:{start:s,end:z(e,1)}},C.prototype.appointmentFiltering=function(e,t){var i,t=!U.isNullOrUndefined(e)&&U.isNullOrUndefined(t)?(i=W(new Date(e.getTime())),qe(new Date(i.getTime()),B)):(i=new Date(e.getTime()),new Date(t.getTime())),n=this.parent.eventBase.filterEvents(i,t);return 0===n.length&&(this.refreshEvent(e),n=this.parent.eventBase.filterEvents(i,t)),n},C.prototype.getStartDateFromEndDate=function(e){var t,i=this.parent.eventFields;return W(0<this.parent.eventsProcessed.length?(t=Math.min.apply(Math,this.parent.eventsProcessed.map(function(e){return e[i.startTime].getTime()})),this.parent.hideEmptyAgendaDays?new Date(t):this.parent.minDate):this.parent.hideEmptyAgendaDays?Be(e,-1):this.parent.minDate)},C.prototype.getEndDateFromStartDate=function(e){var t,i=this.parent.eventFields;return W(z(0<this.parent.eventsProcessed.length?(t=Math.max.apply(Math,this.parent.eventsProcessed.map(function(e){return e[i.endTime].getTime()})),this.parent.hideEmptyAgendaDays?new Date(t):this.parent.maxDate):this.parent.hideEmptyAgendaDays?Be(e,1):this.parent.maxDate,1))},C.prototype.getNextPreviousDate=function(e){return z(this.parent.selectedDate,"next"===e?1:-1)},C.prototype.startDate=function(){return W(this.parent.selectedDate)},C.prototype.endDate=function(){return this.parent.activeViewOptions.allowVirtualScrolling?this.getEndDateFromStartDate(this.startDate()):z(this.startDate(),this.parent.agendaDaysCount)},C.prototype.getDateRangeText=function(e){var t=this.parent.activeViewOptions.dateFormat||"MMMM y";return this.parent.activeViewOptions.allowVirtualScrolling||this.parent.isAdaptive?(e=U.isNullOrUndefined(e)?this.parent.selectedDate:e,f(this.parent.globalize.formatDate(e,{format:t,calendar:this.parent.getCalendarMode()}),"multiple")):(t=z(e=this.parent.selectedDate,this.parent.agendaDaysCount-1),this.formatDateRange(e,t))},C.prototype.dayNavigationClick=function(e){var t=U.closest(e.currentTarget,"."+Ti),t=this.parent.getDateFromElement(t);U.isNullOrUndefined(t)||this.parent.isAdaptive||!this.parent.isMinMaxDate(t)||(this.parent.setProperties({selectedDate:t},!0),this.parent.changeView("Day",e))},C.prototype.wireEvents=function(){U.EventHandler.add(this.element.querySelector("."+I),be,this.agendaScrolling,this)},C.prototype.unWireEvents=function(){U.EventHandler.remove(this.element.querySelector("."+I),be,this.agendaScrolling);for(var e=0,t=[].slice.call(this.element.querySelectorAll(".e-m-date"));e<t.length;e++){var i=t[e];U.EventHandler.remove(i,"click",this.dayNavigationClick)}},C.prototype.addEventListener=function(){this.parent.on(Se,this.onAgendaScrollUiUpdate,this),this.parent.on(Te,this.eventLoad,this)},C.prototype.removeEventListener=function(){this.parent&&(this.parent.off(Se,this.onAgendaScrollUiUpdate),this.parent.off(Te,this.eventLoad))},C.prototype.onAgendaScrollUiUpdate=function(){var e=this.getHeaderBarHeight(),t=(this.parent.headerModule&&(this.parent.activeViewOptions.allowVirtualScrolling?this.parent.headerModule.updateHeaderItems("add"):this.parent.headerModule.updateHeaderItems("remove")),this.element.querySelector("."+I));"auto"!==this.parent.height&&(t.style.height=U.formatUnit(this.parent.element.offsetHeight-e))},C.prototype.scrollToDate=function(e){var e=new Date(+W(e));this.parent.activeViewOptions.allowVirtualScrolling?(!this.parent.hideEmptyAgendaDays||0<this.parent.getEvents(e,z(e,1),!0).length)&&this.parent.changeDate(e):(e=this.element.querySelector("."+Ti+'[data-date="'+e.getTime()+'"]'))&&(this.getContentAreaElement().scrollTop=e.offsetTop)},C.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed||this.element&&(this.unWireEvents(),this.parent.resourceBase&&this.parent.resourceBase.destroy(),this.parent.headerModule&&this.parent.activeViewOptions.allowVirtualScrolling&&this.parent.headerModule.updateHeaderItems("remove"),Ml.prototype.destroy.call(this))};var Il,Ml,kl=C;function C(e){e=Ml.call(this,e)||this;return e.viewClass="e-agenda-view",e.isInverseTableSelect=!1,e.agendaDates={},e.virtualScrollTop=1,e}Rl=function(e,t){return(Rl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Rl(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(jl,Hl=bl),jl.prototype.getModuleName=function(){return"monthAgenda"},jl.prototype.renderAppointmentContainer=function(){var e=this.getContentAreaElement(),t=U.createElement("div",{className:oi}),e=(e.appendChild(t),U.createElement("div",{className:si}));t.appendChild(e),this.appendAppContainer(e),this.setEventWrapperHeight()},jl.prototype.getDayNameFormat=function(){return this.parent.isAdaptive?"narrow":"abbreviated"},jl.prototype.updateSelectedCellClass=function(e){W(e.date).getTime()===W(this.monthAgendaDate).getTime()&&e.className.push(ni)},jl.prototype.setEventWrapperHeight=function(){var e=(this.parent.headerModule?this.parent.headerModule.getHeaderElement().offsetHeight:0)+2,t=this.parent.element.querySelector("."+ii),t=(t&&(e+=t.offsetHeight),this.getContentAreaElement().firstElementChild),i=this.element.querySelector("."+Tt),e=this.parent.element.offsetHeight-e-i.offsetHeight,i=1<this.parent.activeViewOptions.interval?Math.round(.8*e):t.offsetHeight,e=e-i,n=this.element.querySelector("."+oi),r=this.element.querySelector("."+si);"auto"!==this.parent.height&&(1<this.parent.activeViewOptions.interval&&(t.style.height=U.formatUnit(i),U.EventHandler.add(t,"scroll",this.onContentScroll,this)),n.style.height=r.style.height=U.formatUnit(e))},jl.prototype.onDataReady=function(e){this.setEventWrapperHeight(),this.clearElements();for(var t,e=e.processedData,i=(this.parent.uiStateValues.isGroupAdaptive&&(t=this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex],e=this.parent.eventBase.filterEventsByResource(t,e)),this.agendaBase=this.getAgendaBase(),this.parent.eventsProcessed=this.agendaBase.processAgendaEvents(e),0),n=0,r=this.renderDates;n<r.length;n++){var a=r[n],s=this.appointmentFiltering(a),o=this.element.querySelectorAll("."+O)[parseInt(i.toString(),10)];0<s.length&&(o.querySelector("."+Ii)||o.appendChild(U.createElement("div",{className:Ii})),a.getTime()===W(new Date(this.monthAgendaDate.getTime())).getTime())&&this.onEventRender(s,a),i++}this.parent.notify(we,{})},jl.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(we,{}),this.monthAgendaDate=new Date(""+e.startTime)},jl.prototype.onEventRender=function(e,t){this.agendaBase=this.getAgendaBase();var i,n=this.element.querySelector("."+si);et(n),0===this.parent.activeViewOptions.group.resources.length||this.parent.uiStateValues.isGroupAdaptive?0<e.length?(i=U.createElement("div",{className:li}),n.appendChild(this.agendaBase.createAgendaContentElement("data",e,i))):this.appendAppContainer(n):0<e.length?(e=(i=this.createTableLayout()).querySelector("tbody"),this.agendaBase.calculateResourceTableElement(e,1,t),i.appendChild(e),n.appendChild(i)):this.appendAppContainer(n),this.agendaBase.wireEventActions()},jl.prototype.appointmentFiltering=function(e){var e=W(new Date(e.getTime())),t=qe(new Date(e.getTime()),B);return this.parent.eventBase.filterEvents(e,t)},jl.prototype.clearElements=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll("."+Ii));e<t.length;e++){var i=t[e];U.remove(i)}this.appendAppContainer(this.element.querySelector("."+si))},jl.prototype.appendAppContainer=function(e){var t=U.createElement("div",{className:li});U.addClass([t],Ai),t.innerHTML=this.parent.localeObj.getConstant("noEvents"),et(e),e.appendChild(t)},jl.prototype.getNextPreviousDate=function(e){var t=this.parent.selectedDate,i="next"===e?this.parent.activeViewOptions.interval:-this.parent.activeViewOptions.interval,i=Be(this.parent.selectedDate,i),e="next"===e?2:0,t=new Date(t.getFullYear(),t.getMonth()+e,0).getDate(),e=t>=this.monthAgendaDate.getDate()?this.monthAgendaDate.getDate():t;return this.monthAgendaDate=new Date(i.getFullYear(),i.getMonth(),e),this.monthAgendaDate},jl.prototype.getAgendaBase=function(){return this.agendaBase||new xl(this.parent)},jl.prototype.destroy=function(){this.agendaBase&&(this.agendaBase.destroy(),this.agendaBase=null),Hl.prototype.destroy.call(this)};var Rl,Hl,Pl=jl;function jl(e){var t=Hl.call(this,e)||this;return t.dayNameFormat="narrow",t.viewClass="e-month-agenda-view",t.monthAgendaDate=new Date(""+e.selectedDate),t}Nl.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},Nl.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},Nl.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(),s=Math.ceil(((+r-a-60*s*1e3)/B+new Date(a).getDay()+1)/7);this.parent.firstDayOfWeek&&this.parent.firstDayOfWeek>new Date(+r).getDay()&&(s-=1),t[parseInt(s.toString(),10)]=t[parseInt(s.toString(),10)]||[],t[parseInt(s.toString(),10)].push(r)}return t},Nl.prototype.generateSlots=function(e,t,i,n,r){for(var a=this,s=function(e,t){return a.parent.globalize.formatDate(e,{format:t,calendar:a.parent.getCalendarMode()})},o=[],l=Object.keys(e),p=0;p<l.length;p++){var c=e[l[parseInt(p.toString(),10)]],h=void 0;if(i.template)var d={date:c[0],type:r},u=this.parent.element.id+"_headerRowTemplate",h=[].slice.call(this.parent.templateParser(i.template)(d,this.parent,"template",u,!1));else{var g=void 0;switch(i.option){case"Year":g='<span class="e-header-year">'+s(c[0],"y")+"</span>";break;case"Month":g='<span class="e-header-month">'+f(s(c[0],"MMMM"),"single")+"</span>";break;case"Week":g='<span class="e-header-week">'+this.parent.getWeekNumberContent(c)+"</span>"}d=U.createElement("div",{innerHTML:g});h=[].slice.call(d.childNodes)}o.push({date:c[0],type:r,className:[n],colSpan:c.length*t,template:h})}return o},Nl.prototype.generateColumnLevels=function(e,t){for(var i,n,r=[],a=this.parent.activeViewOptions.headerRows,s=1,o=("Hour"===a[a.length-1].option&&0<t.length&&(s=t.length/e.length),[]),l=0,p=a;l<p.length;l++){var c=p[l];switch(c.option){case"Year":i=this.groupByYear(this.renderDates),o=this.generateSlots(i,s,c,"e-header-year-cell","yearHeader"),r.push(o);break;case"Month":i=this.groupByMonth(this.renderDates),o=this.generateSlots(i,s,c,"e-header-month-cell","monthHeader"),r.push(o);break;case"Week":n=this.groupByWeek(this.renderDates),o=this.generateSlots(n,s,c,"e-header-week-cell","weekHeader"),r.push(o);break;case"Date":o=(o=e).map(function(e){return e.colSpan=s,e}),r.push(o);break;case"Hour":0<t.length&&r.push(t)}}return r};var Ll=Nl;function Nl(e,t){this.parent=e,this.renderDates=t}ql=function(e,t){return(ql=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}ql(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Bl,Fl=co),Bl.prototype.getModuleName=function(){return"timelineViews"},Bl.prototype.getLeftPanelElement=function(){return this.element.querySelector("."+Ht)},Bl.prototype.scrollTopPanel=function(e){Fl.prototype.scrollTopPanel.call(this,e),this.scrollHeaderLabels(e)},Bl.prototype.scrollToWorkHour=function(){var e=this.parent.getStartEndTime(this.parent.workHours.start),e=this.isWorkDay(this.parent.selectedDate)&&this.parent.workHours.highlight&&!U.isNullOrUndefined(e)?new Date(+this.parent.selectedDate).setHours(e.getHours(),e.getMinutes(),0,0):new Date(+this.parent.selectedDate).setHours(0,0,0,0),e='[data-date="'+new Date(e).getTime().toString()+'"]',e=this.element.querySelector(e);e&&(this.getContentAreaElement().scrollLeft=this.parent.enableRtl?-(this.parent.getContentTable().offsetWidth-e.offsetLeft-e.offsetWidth):e.offsetLeft)},Bl.prototype.scrollToHour=function(e,t){var i,n,r;t&&0<=(n=this.parent.getIndexOfDate(this.renderDates,W(t)))&&(i=t,U.isNullOrUndefined(e)||2===(r=e.split(":")).length&&(i=new Date(t.setHours(parseInt(r[0],10),parseInt(r[1],10),0)))),i=U.isNullOrUndefined(t)?this.parent.getStartEndTime(e):i,U.isNullOrUndefined(i)||(r=U.isNullOrUndefined(e)||!this.parent.activeViewOptions.timeScale.enable?n*V(this.element.querySelector(".e-work-cells")):U.isNullOrUndefined(t)?this.getLeftFromDateTime(null,i):this.getLeftFromDateTime([n],i),this.getScrollableElement().scrollLeft=this.parent.enableRtl?-r:r)},Bl.prototype.generateColumnLevels=function(){var e=[],t=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays),i=(e.push(t),0<this.parent.activeViewOptions.group.resources.length&&this.parent.resourceBase.generateResourceLevels(t,!this.parent.uiStateValues.isGroupAdaptive),[]);return this.parent.activeViewOptions.timeScale.enable&&(i=this.generateTimeSlots(e[e.length-1]),e.push(i)),e=0<this.parent.activeViewOptions.headerRows.length?new Ll(this.parent,this.renderDates).generateColumnLevels(t,i):e},Bl.prototype.generateTimeSlots=function(e){for(var t=this,i=this.getTimeSlotRows(function(e){return e.type=e.first?"majorSlot":"minorSlot",e.className=e.first?[zt]:[zt,Wt],e.workDays=t.parent.activeViewOptions.workDays,e}),n=[],r=0,a=e;r<a.length;r++){var s=a[r];s.colSpan=i.length;for(var o=0,l=U.extend([],i,null,!0);o<l.length;o++){var p=l[o],c=W(new Date(""+s.date));p.date=qe(c,Fe(p.date)),n.push(p)}}return n},Bl.prototype.changeCurrentTimePosition=function(){var e,t,i,n;!this.parent||this.parent&&this.parent.isDestroyed||(this.removeCurrentTimeIndicatorElements(),e=this.getCurrentTimeIndicatorIndex(),e=this.getLeftFromDateTime(e,this.parent.getCurrentTime()),n=this.element.querySelector("."+S).offsetHeight,t=this.element.querySelector("."+Tt),this.element.querySelector("."+I).appendChild(U.createElement("div",{className:Gt,styles:(this.parent.enableRtl?"right":"left")+":"+U.formatUnit(e)+"; height:"+U.formatUnit(n)})),this.parent.virtualScrollModule&&(n=this.parent.element.querySelector("."+Gt),i=this.parent.element.querySelector("."+I+" table"),U.setStyleAttribute(n,{transform:i.style.transform})),n=U.createElement("div",{innerHTML:this.parent.getTimeString(this.parent.getCurrentTime()),className:_t}),t.appendChild(n),n.style[this.parent.enableRtl?"right":"left"]=U.formatUnit(e-n.offsetWidth/2))},Bl.prototype.getLeftFromDateTime=function(e,t){var i,n,r=this.getStartHour(),a=0,t=60*(t.getHours()-r.getHours())+(t.getMinutes()-r.getMinutes());return U.isNullOrUndefined(e)||0!==e[0]&&(i=this.parent.activeView.colLevels.findIndex(function(e){return"dateHeader"===e[0].type}),this.parent.activeView.colLevels[parseInt(i.toString(),10)]&&this.parent.activeView.colLevels[parseInt(i.toString(),10)][0].colSpan?a=e[0]*this.parent.activeView.colLevels[parseInt(i.toString(),10)][0].colSpan*V(this.element.querySelector(".e-work-cells")):(n=0===(i=this.getEndHour()).getHours()?24:i.getHours(),t+=e[0]*(60*(n-r.getHours())+(i.getMinutes()-r.getMinutes())))),a+t*V(this.element.querySelector(".e-work-cells"))*this.parent.activeViewOptions.timeScale.slotCount/this.parent.activeViewOptions.timeScale.interval},Bl.prototype.renderHeader=function(){var e=U.createElement("tr"),t=(0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.renderResourceHeaderIndent(e),U.createElement("td"));t.appendChild(this.renderDatesHeader()),e.appendChild(t),U.prepend([e],this.element.querySelector("tbody"))},Bl.prototype.createAllDayRow=function(e,t){},Bl.prototype.getCurrentTimeIndicatorIndex=function(){var e=[],t=this.parent.getIndexOfDate(this.renderDates,W(this.parent.getCurrentTime()));return 0<=t&&e.push(t),e},Bl.prototype.renderContent=function(){var e=U.createElement("tr"),t=(0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&((t=U.createElement("td")).appendChild(this.parent.resourceBase.createResourceColumn()),e.appendChild(t)),U.createElement("td")),i=this.renderContentArea();i.appendChild(this.createEventTable(this.getRowCount())),this.collapseRows(i),t.appendChild(i),e.appendChild(t),this.parent.virtualScrollModule&&this.parent.virtualScrollModule.renderVirtualTrack(i),this.element.querySelector("tbody").appendChild(e)},Bl.prototype.getRowCount=function(){return 0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?this.parent.resourceBase.renderedResources.length:1},Bl.prototype.getResourceTdData=function(e,t){var e=this.parent.resourceBase.renderedResources[parseInt(e.toString(),10)],i=e.resourceData[e.resource.startHourField]||this.parent.workHours.start,n=e.resourceData[e.resource.endHourField]||this.parent.workHours.end;return t.startHour=this.parent.getStartEndTime(i),t.endHour=this.parent.getStartEndTime(n),t.workDays=e.resourceData[e.resource.workDaysField]||this.parent.workDays,t.className=e.className,t.groupIndex=e.groupIndex,t.groupOrder=e.groupOrder,t},Bl.prototype.renderContentTable=function(e){e=e.querySelector("tbody");U.append(this.getContentRows(),e)},Bl.prototype.getContentRows=function(){for(var e=[],t=U.createElement("tr"),i=U.createElement("td",{attrs:{"aria-selected":"false"}}),n=this.getRowCount(),r=0;r<n;r++){for(var a=t.cloneNode(),s=0,o=this.colLevels[this.colLevels.length-1];s<o.length;s++){var l=o[s],l=(0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(l=this.getResourceTdData(r,l)),this.createContentTd(l,l,i));a.appendChild(l)}e.push(a)}return e},Bl.prototype.getContentTdClass=function(e){return e.first||!this.parent.activeViewOptions.timeScale.enable?[O]:[O,Yt]},Bl.prototype.renderEvents=function(){this.timelineAppointment=new Ua(this.parent,this.parent.activeViewOptions.timeScale.enable?"hour":"day"),this.timelineAppointment.renderAppointments(),this.parent.notify(we,{})},Bl.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},Bl.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed||(this.timelineAppointment&&(this.timelineAppointment.destroy(),this.timelineAppointment=null),Fl.prototype.destroy.call(this))};var ql,Fl,Ul=Bl;function Bl(e){e=Fl.call(this,e)||this;return e.timelineAppointment=null,e.baseCssClass="e-timeline-view",e}Wl=function(e,t){return(Wl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Wl(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(_l,zl=bl),_l.prototype.getModuleName=function(){return"timelineMonth"},_l.prototype.onDataReady=function(){this.appointment=new Ua(this.parent,"day"),this.appointment.renderAppointments(),this.parent.notify(we,{})},_l.prototype.getLeftPanelElement=function(){return this.element.querySelector("."+Ht)},_l.prototype.scrollTopPanel=function(e){zl.prototype.scrollTopPanel.call(this,e),this.scrollHeaderLabels(e)},_l.prototype.setContentHeight=function(e,t,i){t&&(t.style.height=U.formatUnit(i-this.getScrollXIndent(e))),e.style.height=U.formatUnit(i)},_l.prototype.getDateSlots=function(e,t){for(var i=[],n=0,r=e;n<r.length;n++){var a=r[n],s=[Dt];this.isCurrentDate(a)&&s.push(Ct),i.push({date:a,type:"dateHeader",className:s,colSpan:1,workDays:t})}return i},_l.prototype.renderLeftIndent=function(e){0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&this.parent.resourceBase.renderResourceHeaderIndent(e)},_l.prototype.renderContent=function(){var e=U.createElement("tr"),t=(0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&((t=U.createElement("td")).appendChild(this.parent.resourceBase.createResourceColumn()),e.appendChild(t)),U.createElement("td")),i=(this.element.querySelector("tbody").appendChild(e),U.createElement("div",{className:I}));i.appendChild(this.renderContentArea()),i.appendChild(this.createEventTable(this.getRowCount())),this.collapseRows(i),U.EventHandler.add(i,"scroll",this.onContentScroll,this),t.appendChild(i),this.parent.virtualScrollModule&&this.parent.virtualScrollModule.renderVirtualTrack(i),e.appendChild(t)},_l.prototype.getRowCount=function(){return 0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?this.parent.resourceBase.renderedResources.length:1},_l.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],a=(r.className=[O],0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(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),{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(a)}return e},_l.prototype.updateClassList=function(e){this.parent.isMinMaxDate(e.date)||e.className.push(or)},_l.prototype.unWireEvents=function(){U.EventHandler.remove(this.getContentAreaElement(),"scroll",this.onContentScroll)},_l.prototype.getMonthStart=function(e){e=this.parent.calendarUtil.firstDateOfMonth(W(e));return new Date(e.getFullYear(),e.getMonth(),e.getDate())},_l.prototype.getMonthEnd=function(e){e=this.parent.calendarUtil.firstDateOfMonth(W(e));return this.parent.calendarUtil.lastDateOfMonth(Be(new Date(+e),this.parent.activeViewOptions.interval-1))},_l.prototype.generateColumnLevels=function(){var e=[],t=this.getDateSlots(this.renderDates,this.parent.activeViewOptions.workDays);e.push(t),0<this.parent.activeViewOptions.group.resources.length&&this.parent.resourceBase.generateResourceLevels(t,!this.parent.uiStateValues.isGroupAdaptive);return 0<this.parent.activeViewOptions.headerRows.length&&(e=new Ll(this.parent,this.renderDates).generateColumnLevels(t,[])),this.colLevels=e},_l.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},_l.prototype.destroy=function(){var e;!this.parent||this.parent&&this.parent.isDestroyed||(this.element&&(e=this.element.querySelector("."+I))&&U.EventHandler.remove(e,"scroll",this.onContentScroll),this.appointment&&(this.appointment.destroy(),this.appointment=null),zl.prototype.destroy.call(this))};var Wl,zl,Yl=_l;function _l(e){e=zl.call(this,e)||this;return e.viewClass="e-timeline-month-view",e.isInverseTableSelect=!0,e.appointment=null,e}Gl=function(e,t){return(Gl=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Gl(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Kl,Xl=Ol),Kl.prototype.getModuleName=function(){return"timelineYear"},Kl.prototype.renderHeader=function(e){var t=U.createElement("tr"),e=(e.appendChild(t),"Vertical"===this.parent.activeViewOptions.orientation&&0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?this.parent.resourceBase.renderResourceHeaderIndent(t):(e=U.createElement("td",{className:At}),t.appendChild(e),e.appendChild(this.renderResourceHeader(It))),"Horizontal"===this.parent.activeViewOptions.orientation),i=0<this.parent.activeViewOptions.group.resources.length,e=(this.isInverseTableSelect=!e||i,U.createElement("td")),i=(t.appendChild(e),U.createElement("div",{className:wt}));if(e.appendChild(i),"Horizontal"===this.parent.activeViewOptions.orientation&&0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive)i.appendChild(this.renderResourceHeader(Tt)),this.columnCount=this.colLevels.slice(-1)[0].length;else for(var t=U.createElement("div",{className:Tt}),e=(i.appendChild(t),this.createTableLayout()),n=(t.appendChild(e),e.appendChild(this.createTableColGroup(this.columnCount)),U.createElement("tr")),r=(e.querySelector("tbody").appendChild(n),this.getMonths()),a=this.getMonthDates(new Date(this.parent.selectedDate.getFullYear(),r[0],1)),s=0;s<this.columnCount;s++){var o=new Date(this.parent.selectedDate.getFullYear(),r[parseInt(s.toString(),10)],1),l=U.createElement("td",{className:Dt});"Horizontal"===this.parent.activeViewOptions.orientation?this.parent.dayHeaderTemplate?U.append(this.renderDayMonthHeaderTemplate(a[parseInt(s.toString(),10)],s,"dayHeaderTemplate"),l):l.innerHTML="<span>"+this.parent.getDayNames("abbreviated")[s%7]+"</span>":(this.parent.monthHeaderTemplate?U.append(this.renderDayMonthHeaderTemplate(o,r[parseInt(s.toString(),10)],"monthHeaderTemplate"),l):l.innerHTML="<span>"+this.getMonthName(o)+"</span>",l.setAttribute("data-date",o.getTime().toString())),n.appendChild(l),this.parent.trigger(ee,{elementType:"headerCells",element:l})}},Kl.prototype.renderResourceHeader=function(e){var t=U.createElement("div",{className:e}),i=this.createTableLayout(),n=(t.appendChild(i),U.createElement("tr"));0<this.parent.activeViewOptions.group.resources.length?this.colLevels=this.generateColumnLevels():this.colLevels=[[{className:[Dt],type:"headerCell"}]];for(var r=0,a=this.colLevels;r<a.length;r++){for(var s=a[r],o=n.cloneNode(),l=0,p=e===Tt?s:[s[0]];l<p.length;l++){var c=p[l],h=U.createElement("td"),c=(c.className&&U.addClass([h],c.className),e===Tt&&(c.template&&U.append(c.template,h),c.colSpan&&h.setAttribute("colspan",c.colSpan.toString()),-1<c.groupIndex&&h.setAttribute("data-group-index",c.groupIndex.toString()),this.setResourceHeaderContent(h,c)),e===It&&this.parent.renderHeaderIndentTemplate(c,h),{elementType:c.type,element:h,date:c.date,groupIndex:c.groupIndex});this.parent.trigger(ee,c),o.appendChild(h)}i.querySelector("tbody").appendChild(o)}return e===Tt&&i.appendChild(this.createTableColGroup(this.colLevels.slice(-1)[0].length)),t},Kl.prototype.renderContent=function(e){var t,i,n=U.createElement("tr"),e=(e.appendChild(n),U.createElement("td")),r=U.createElement("td"),a=[],e=("Vertical"===this.parent.activeViewOptions.orientation&&0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?(a.push(e),e.appendChild(this.parent.resourceBase.createResourceColumn()),this.rowCount=this.parent.resourceBase.renderedResources.length):(a.push(e),t=U.createElement("div",{className:Cr}),e.appendChild(t),t.appendChild(this.createTableLayout()),t=t.querySelector("tbody")),a.push(r),U.append(a,n),U.createElement("div",{className:I})),a=(r.appendChild(e),this.createTableLayout(S)),n=(this.setAriaAttributes(a),e.appendChild(a),U.createElement("div",{className:Mt})),r=(e.appendChild(n),this.parent.virtualScrollModule&&this.parent.virtualScrollModule.renderVirtualTrack(e),a.querySelector("tbody"));this.parent.rowAutoHeight&&(e=[a],(i=this.parent.element.querySelector("."+Cr+" ."+mt))&&e.push(i),U.addClass(e,wr)),0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?(i="Horizontal"===this.parent.activeViewOptions.orientation?this.colLevels.slice(-1)[0].length:this.columnCount,a.appendChild(this.createTableColGroup(i)),this.renderResourceContent(n,t,r)):(a.appendChild(this.createTableColGroup(this.columnCount)),this.renderDefaultContent(n,t,r))},Kl.prototype.renderDefaultContent=function(e,t,i){for(var n=this.getMonths(),r=this.getMonthDates(new Date(this.parent.selectedDate.getFullYear(),n[0],1)),a=0;a<this.rowCount;a++){e.appendChild(U.createElement("div",{className:li}));for(var s=new Date(this.parent.selectedDate.getFullYear(),n[parseInt(a.toString(),10)],1),o=this.parent.calendarUtil.getMonthStartDate(new Date(s.getTime())),l=this.parent.calendarUtil.getMonthEndDate(new Date(s.getTime())),p=U.createElement("tr"),c=p.cloneNode(),h=(t.appendChild(c),p.cloneNode()),p=(i.appendChild(h),U.createElement("td",{className:bi})),d=("Horizontal"===this.parent.activeViewOptions.orientation?(this.parent.monthHeaderTemplate?U.append(this.renderDayMonthHeaderTemplate(o,a,"monthHeaderTemplate"),p):p.innerHTML="<span>"+this.getMonthName(s)+"</span>",p.setAttribute("data-date",s.getTime().toString())):this.parent.dayHeaderTemplate?U.append(this.renderDayMonthHeaderTemplate(r[parseInt(a.toString(),10)],a,"dayHeaderTemplate"),p):p.innerHTML="<span>"+this.parent.getDayNames("abbreviated")[a%7]+"</span>",c.appendChild(p),this.parent.trigger(ee,{elementType:"leftHeaderCells",element:p}),new Date(o.getTime())),u=0;u<this.columnCount;u++){var g,m,v=void 0,f=(v="Vertical"===this.parent.activeViewOptions.orientation?(s=new Date(this.parent.selectedDate.getFullYear(),n[parseInt(u.toString(),10)],1),o=this.parent.calendarUtil.getMonthStartDate(new Date(s.getTime())),l=this.parent.calendarUtil.getMonthEndDate(new Date(s.getTime())),f=a-o.getDay()+1,d=new Date(this.parent.selectedDate.getFullYear(),n[parseInt(u.toString(),10)],f),0<f&&d.getTime()<l.getTime()):u>=o.getDay()&&d.getTime()<l.getTime(),this.parent.globalize.formatDate(d,{skeleton:"full",calendar:this.parent.getCalendarMode()})),y=U.createElement("td",{className:O,attrs:{"aria-selected":"false","aria-label":f}}),T=(h.appendChild(y),U.createElement("div",{className:Ei+" "+Oi,innerHTML:v?this.parent.globalize.formatDate(d,{skeleton:"d",calendar:this.parent.getCalendarMode()}):""}));v?(g=[y],m=[],-1<this.parent.activeViewOptions.workDays.indexOf(d.getDay())&&m.push(bt),this.parent.isMinMaxDate(d)||U.addClass([y],or),this.isCurrentDate(d)&&(m.push(Ct),"Horizontal"===this.parent.activeViewOptions.orientation?g.push(this.element.querySelector("."+Dt+":nth-child("+(u+1)+")")):g.push(this.element.querySelectorAll("."+bi).item(a))),0<m.length&&U.addClass(g,m)):(U.addClass([y],E),this.parent.isMinMaxDate(d)||U.addClass([y],or)),y.classList.contains(E)||(this.renderDates.push(new Date(d)),y.appendChild(T),v&&(y.setAttribute("data-date",d.getTime().toString()),this.wireEvents(y)),this.renderCellTemplate({date:d,type:"workCells"},y),this.parent.trigger(ee,{elementType:"workCells",element:y,date:d}),v&&"Horizontal"===this.parent.activeViewOptions.orientation&&(d=z(new Date(d.getTime()),1)))}}this.renderDates.splice(0,1)},Kl.prototype.getContentRows=function(){for(var e=[],t=this.getMonths(),i=0;i<this.parent.resourceBase.renderedResources.length;i++)for(var n=U.createElement("tr"),r=(e.push(n),void 0),a=(0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(r=this.parent.resourceBase.renderedResources[parseInt(i.toString(),10)]),new Date(this.parent.selectedDate.getFullYear(),t[parseInt(i.toString(),10)],1)),s=this.parent.calendarUtil.getMonthStartDate(new Date(a.getTime())),o=0;o<this.columnCount;o++){var l=[],p=r.groupIndex,a=(-1<(l=l.concat(r.className)).indexOf(Lt)?l.push(kt):l.push(bt),new Date(this.parent.selectedDate.getFullYear(),t[parseInt(o.toString(),10)],1)),s=this.parent.calendarUtil.getMonthStartDate(new Date(a.getTime())),c=U.createElement("td",{className:O,attrs:{"aria-selected":"false","data-date":s.getTime().toString()}});U.addClass([c],l),c.setAttribute("data-group-index",p.toString()),this.renderCellTemplate({date:s,type:"resourceGroupCells",groupIndex:p},c),this.wireEvents(c),this.parent.trigger(ee,{elementType:"resourceGroupCells",element:c,date:s}),n.appendChild(c)}return e},Kl.prototype.renderResourceContent=function(e,t,i){for(var n=this.getMonths(),r=0;r<this.rowCount;r++){e.appendChild(U.createElement("div",{className:li}));var a,s,o=U.createElement("tr"),l=(i.appendChild(o),void 0),p=("Vertical"===this.parent.activeViewOptions.orientation&&0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(l=this.parent.resourceBase.renderedResources[parseInt(r.toString(),10)]),new Date(this.parent.selectedDate.getFullYear(),n[parseInt(r.toString(),10)],1)),c=this.parent.calendarUtil.getMonthStartDate(new Date(p.getTime()));"Horizontal"===this.parent.activeViewOptions.orientation&&(a=o.cloneNode(),t.appendChild(a),s=U.createElement("td",{className:bi,attrs:{"data-date":c.getTime().toString()}}),this.parent.monthHeaderTemplate?U.append(this.renderDayMonthHeaderTemplate(p,r,"monthHeaderTemplate"),s):s.innerHTML="<span>"+this.getMonthName(p)+"</span>",a.appendChild(s));for(var h=0;h<this.columnCount;h++){var d=[],u=void 0,g=("Vertical"===this.parent.activeViewOptions.orientation?(u=l.groupIndex,-1<(d=d.concat(l.className)).indexOf(Lt)?d.push(kt):d.push(bt),p=new Date(this.parent.selectedDate.getFullYear(),n[parseInt(h.toString(),10)],1),c=this.parent.calendarUtil.getMonthStartDate(new Date(p.getTime()))):(u=this.colLevels.slice(-1)[0][parseInt(h.toString(),10)].groupIndex,d.push(bt)),this.parent.globalize.formatDate(c,{type:"dateTime",skeleton:"full",calendar:this.parent.getCalendarMode()})),m=this.parent.globalize.formatDate(this.parent.calendarUtil.getMonthEndDate(new Date(p.getTime())),{type:"dateTime",skeleton:"full",calendar:this.parent.getCalendarMode()}),g=U.createElement("td",{className:O,attrs:{"aria-selected":"false","data-date":c.getTime().toString(),"aria-label":g+" "+this.parent.localeObj.getConstant("endAt")+" "+m}});U.addClass([g],d),g.setAttribute("data-group-index",u.toString()),this.renderCellTemplate({date:c,type:"resourceGroupCells",groupIndex:u},g),this.wireEvents(g),o.appendChild(g),this.parent.trigger(ee,{elementType:"resourceGroupCells",element:g,date:c})}}"Vertical"===this.parent.activeViewOptions.orientation&&this.collapseRows(this.parent.element.querySelector("."+I))},Kl.prototype.renderDayMonthHeaderTemplate=function(e,t,i){var e={date:e,type:"dayHeaderTemplate"===i?"dayHeader":"monthHeader"},n="schedule_"+this.parent.activeViewOptions.dayHeaderTemplateName+"dayHeaderTemplate",r="schedule_"+this.parent.activeViewOptions.dayHeaderTemplateName+"monthHeaderTemplate";return"dayHeaderTemplate"===i?(e.day=this.parent.getDayNames("wide")[t%7],[].slice.call(this.parent.getDayHeaderTemplate()(e,this.parent,"dayHeaderTemplate",n,!1,void 0,void 0,this.parent.root))):[].slice.call(this.parent.getMonthHeaderTemplate()(e,this.parent,"monthHeaderTemplate",r,!1,void 0,void 0,this.parent.root))},Kl.prototype.renderCellTemplate=function(e,t){var i;this.parent.activeViewOptions.cellTemplate&&!t.classList.contains(E)&&(i={date:e.date,type:e.type},e.groupIndex&&(i.groupIndex=e.groupIndex),e=this.parent.element.id+"_"+this.parent.activeViewOptions.cellTemplateName+"cellTemplate",i=[].slice.call(this.parent.getCellTemplate()(i,this.parent,"cellTemplate",e,!1,void 0,void 0,this.parent.root)),U.append(i,t))},Kl.prototype.scrollToDate=function(e){var t,i,e=null!==this.parent.activeViewOptions.group.resources&&0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive?+new Date(W(Pe(e))):+new Date(W(e)),e=this.element.querySelector('[data-date="'+e+'"]');e&&(t=this.getScrollableElement(),this.parent.enableRtl?(i=this.element.querySelector("."+S),t.scrollLeft=-(i.offsetWidth-e.offsetLeft-e.offsetWidth)):t.scrollLeft=e.offsetLeft,t.scrollTop=e.offsetTop)},Kl.prototype.getScrollableElement=function(){return this.parent.isAdaptive&&!this.isTimelineView()?this.element.querySelector("."+Kt):this.getContentAreaElement()},Kl.prototype.wireEvents=function(e){U.EventHandler.add(e,"mousedown",this.parent.workCellAction.cellMouseDown,this.parent.workCellAction),U.EventHandler.add(e,"click",this.parent.workCellAction.cellClick,this.parent.workCellAction),this.parent.isAdaptive||U.EventHandler.add(e,"dblclick",this.parent.workCellAction.cellDblClick,this.parent.workCellAction)};var Gl,Xl,Ql=Kl;function Kl(e){e=Xl.call(this,e)||this;return e.viewClass="e-timeline-year-view",e.isInverseTableSelect=!0,e}Zl.prototype.initializeCalendarExport=function(e,t){t=this.getCalendarString(e,t);this.download(t,e)},Zl.prototype.getCalendarString=function(e,t){var p=this,c=t||U.extend([],this.parent.eventsData,null,!0),c=this.parent.eventBase.sortByTime(c),h=-1!==navigator.appVersion.indexOf("Win")?"\r\n":"\n",d=[],u=[],g=this.parent.timezone||this.parent.tzModule.getLocalTimezoneName(),m=this.parent.eventFields;return c.forEach(function(t){var e=t[m.id]||t.Guid||p.parent.eventBase.generateGuid(),i=[],n=(t[m.recurrenceID]&&(e=0<(n=p.filterEvents(u,m.id,t[m.recurrenceID])).length?n[0].UID:e),!t[m.recurrenceID]&&t[m.recurrenceRule]&&t[m.recurrenceException]&&(o=t[m.recurrenceException].split(","),p.filterEvents(c,m.recurrenceID,t[m.id]).forEach(function(e){i.push(Ia(e[m.startTime]))}),n=o.filter(function(e){return-1===i.indexOf(e)}),t[m.recurrenceException]=0<n.length?n.join(",")+",":""),t[m.startTimezone]||g),r=t[m.endTimezone]||g,a=t[m.isReadonly]||!1,s=["BEGIN:VEVENT","LOCATION:"+(t[m.location]||""),"SUMMARY:"+(t[m.subject]||""),"UID:"+e,"DESCRIPTION:"+(t[m.description]||""),"ISREADONLY:"+a,"END:VEVENT"];if(t[m.isAllDay]?(s.splice(4,0,"DTEND;VALUE=DATE:"+p.convertDateToString(t[m.endTime],!0)),s.splice(4,0,"DTSTART;VALUE=DATE:"+p.convertDateToString(t[m.startTime],!0))):t[m.isAllDay]||t[m.recurrenceRule]?(s.splice(4,0,'DTEND;TZID="'+r+'":'+p.convertDateToString(t[m.endTime])),s.splice(4,0,'DTSTART;TZID="'+n+'":'+p.convertDateToString(t[m.startTime]))):(s.splice(4,0,"DTEND:"+p.convertDateToString(t[m.endTime])),s.splice(4,0,"DTSTART:"+p.convertDateToString(t[m.startTime]))),t[m.recurrenceRule]&&s.splice(4,0,"RRULE:"+t[m.recurrenceRule]),t[m.recurrenceException])for(var o=t[m.recurrenceException].split(","),l=0;l<o.length-1;l++)s.splice(5,0,"EXDATE:"+p.convertDateToString(Xr(o[parseInt(l.toString(),10)]),t[m.isAllDay]));t[m.recurrenceID]&&s.splice(4,0,'RECURRENCE-ID;TZID="'+n+'":'+p.convertDateToString(t[m.startTime],t[m.isAllDay]));a=p.customFieldFilter(t,m),0<a.length&&a.forEach(function(e){return s.splice(4,0,e+":"+(t[""+e]||""))}),r=U.extend({},t);r.UID=e,u.push(r),d.push(s.join(h))}),["BEGIN:VCALENDAR","PRODID:-//Syncfusion Inc//Scheduler//EN","VERSION:2.0","CALSCALE:GREGORIAN","METHOD:PUBLISH","X-WR-CALNAME:"+(e||"Calendar"),"X-WR-TIMEZONE:"+g].join(h)+h+d.join(h)+h+"END:VCALENDAR"},Zl.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})},Zl.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),e=("00"+e.getSeconds().toString()).slice(-2);return t?i+n+r:i+n+r+"T"+a+s+e},Zl.prototype.download=function(e,t){var i,e=new Blob([e],{type:"data:text/calendar;charset=utf8"});t=(t||"Calendar")+".ics",navigator.msSaveBlob?navigator.msSaveBlob(e,t):((i=document.createElementNS("http://www.w3.org/1999/xhtml","a")).download=t,i.href=URL.createObjectURL(e),(t=document.createEvent("MouseEvent")).initEvent("click",!0,!0),i.dispatchEvent(t),setTimeout(function(){URL.revokeObjectURL(i.href),i.href=void 0}))},Zl.prototype.filterEvents=function(e,t,i){return e.filter(function(e){return e[""+t]===i})},Zl.prototype.getModuleName=function(){return"iCalendarExport"},Zl.prototype.destroy=function(){!this.parent||this.parent&&this.parent.isDestroyed||(this.parent=null)};To=Zl;function Zl(e){this.parent=e}Jl.prototype.initializeCalendarImport=function(e){var t,i=this;e&&e instanceof Blob?((t=new FileReader).onload=function(){var e=t.result;i.iCalendarParser(e)},t.readAsText(e,"UTF-8")):e&&"string"==typeof e&&this.iCalendarParser(e)},Jl.prototype.iCalendarParser=function(e){var t,i={isEvent:!1,curEvent:null,id:this.parent.eventBase.getEventMaxID(),count:0,events:[],key:null},n=e.length,r=e.search(/[^ \t]/),a=r;do{var s=0===(a=e.indexOf("\n",r)+1)?(a=n,0):1<a&&"\r"===e[a-2]?2:1,o=e.charAt(r)}while(" "===o||"\n"===o||"\t"===o?t+=e.slice(r+1,a-s):(t&&(i=this.updateEventData(t,i)),t=e.slice(r,a-s)),(r=a)!==n);(t=t.trim()).length&&(i=this.updateEventData(t,i));var l=U.extend([],i.events,null,!0);this.parent.addEvent(this.processOccurrence(l,i.id))},Jl.prototype.updateEventData=function(e,t){var i=this.parent.eventFields,n=t.id,r=t.events,a=t.isEvent,s=t.count,o=t.curEvent,t=t.key;if(a||"BEGIN:VEVENT"!==e||(a=!0,o={}),a&&"END:VEVENT"===e&&(a=!1,r.push(o),o=null),a){var l,p=e.indexOf(":"),c=e.substring(0,p).replace(/^\s\s*/,"").replace(/\s\s*$/,""),h=e.substring(p+1,e.length).replace(/^\s\s*/,"").replace(/\s\s*$/,"");if(-1!==e.indexOf("SUMMARY")&&(c="SUMMARY"),-1!==e.indexOf("DTSTART"))o[i.startTime]=this.dateParsing(e),o[i.isAllDay]=this.allDay,this.allDay=!1;else if(-1!==e.indexOf("DTEND"))o[i.endTime]=this.dateParsing(e);else if(-1!==e.indexOf("EXDATE"))h=Ia(this.dateParsing(e)),o[i.recurrenceException]=U.isNullOrUndefined(o[i.recurrenceException])?h:o[i.recurrenceException]+","+h;else if(-1!==e.indexOf("RECURRENCE-ID"))h=Ia(this.dateParsing(e)),o[i.recurrenceException]=h,o[i.recurrenceID]=h;else switch(t=c||t){case"BEGIN":break;case"UID":o[""+c]=h,"number"==typeof n?(o[i.id]=parseInt(h,10),isNaN(o[i.id])&&(o[i.id]=n+s,s++)):o[i.id]=h;break;case"SUMMARY":o[i.subject]=this.getFormattedString(h);break;case"LOCATION":o[i.location]=this.getFormattedString(h);break;case"DESCRIPTION":o[i.description]?o[i.description]=this.getFormattedString(o[i.description]+"\r\n"+h):o[i.description]=this.getFormattedString(h);break;case"ISREADONLY":o[i.isReadonly]=-1<h.indexOf("true");break;case"RRULE":o[i.recurrenceRule]=h;break;default:0<this.parent.resourceCollection.length?(l=this.parent.resourceCollection.filter(function(e){return e.field===c}),o[""+c]=0<l.length&&"number"==typeof l[0].dataSource[0][l[0].idField]?parseInt(h,10):h):o[""+c]=h}}return{isEvent:a,curEvent:o,id:n,count:s,events:r,key:t}},Jl.prototype.processOccurrence=function(s,o){var l=this,p=[],c=this.parent.eventFields,h=[];return this.parent.eventsData.forEach(function(e){h.push(e[c.id])}),s.forEach(function(t){var e;if(t.hasOwnProperty(c.recurrenceID)||(r=(e=t)[c.id]),h.indexOf(t[c.id])<0){var i=s.filter(function(e){return e.UID===t.UID});if(1<i.length&&U.isNullOrUndefined(t[c.recurrenceID])){for(var n,r="number"==typeof o?o++:r,a=0;a<i.length;a++)i[parseInt(a.toString(),10)].hasOwnProperty(c.recurrenceID)&&(n=i[parseInt(a.toString(),10)][c.recurrenceID],i[parseInt(a.toString(),10)][c.id]="number"==typeof o?o++:l.parent.eventBase.generateGuid(),i[parseInt(a.toString(),10)][c.recurrenceID]=r,i[parseInt(a.toString(),10)][c.recurrenceException]=null,e[c.recurrenceException]=l.getExcludeDateString(e[c.recurrenceException],n),delete i[parseInt(a.toString(),10)].UID,p.push(i[parseInt(a.toString(),10)]));delete e.UID,e[c.id]=r,p.push(e)}else t.hasOwnProperty(c.recurrenceID)||(delete t.UID,t[c.id]="number"==typeof o?o++:r,p.push(t))}}),p},Jl.prototype.getExcludeDateString=function(e,t){var i,n;return U.isNullOrUndefined(e)?t:U.isNullOrUndefined(t)||(i=e.split(",").map(function(e){return e.split("T")[0]}),n=t.split(",").map(function(e){return e.split("T")[0]}),0<i.filter(function(e){return-1<n.indexOf(e)}).length)?e:e+","+t},Jl.prototype.getFormattedString=function(e){return(e=e||"").replace(/\\\,/g,",").replace(/\\\;/g,";").replace(/\\[nN]/g,"\n").replace(/\\\\/g,"\\")},Jl.prototype.dateParsing=function(e){var t=e.split(":"),t=t[t.length-1],i=new Date(this.getFormattedString(t)),n=(e&&(-1<e.indexOf("VALUE=DATE")||-1<e.indexOf("RECURRENCE-ID;TZID"))&&(null!==(n=/^(\d{4})(\d{2})(\d{2})$/.exec(t))&&(i=new Date(parseInt(n[1],10),parseInt(n[2],10)-1,parseInt(n[3],10))),-1<e.indexOf("DTSTART"))&&(this.allDay=!0),/^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})(Z)?$/.exec(t));return i=null!==n?"Z"===n[7]?new Date(Date.UTC(parseInt(n[1],10),parseInt(n[2],10)-1,parseInt(n[3],10),parseInt(n[4],10),parseInt(n[5],10),parseInt(n[6],10))):new Date(parseInt(n[1],10),parseInt(n[2],10)-1,parseInt(n[3],10),parseInt(n[4],10),parseInt(n[5],10),parseInt(n[6],10)):i},Jl.prototype.getModuleName=function(){return"iCalendarImport"},Jl.prototype.destroy=function(){this.parent&&this.parent&&this.parent.isDestroyed};Vo=Jl;function Jl(e){this.allDay=!1,this.parent=e}$l.prototype.initializeExcelExport=function(e){var t,i=this.getExportColumns(e=void 0===e?{}:e),n=e.fileName||"Schedule",r=e.exportType||"xlsx",a=e.includeOccurrences||!1;U.isNullOrUndefined(e.separator)||","===e.separator||(t=e.separator),e=e.customData?a?this.parent.eventBase.getProcessedEvents(e.customData):e.customData:a?this.parent.eventsProcessed:this.parent.eventsData,this.processWorkbook(i,n,r,e,t)},$l.prototype.processWorkbook=function(t,e,i,n,r){var a=this,s=[],o=[],l=[],p=(t.forEach(function(e,t){s.push({index:t+1,width:"Id"===e.name?50:150})}),{fontSize:12,borders:{color:"#E0E0E0"},bold:!0}),n=(t.forEach(function(e,t){l.push({index:t+1,value:e.text,style:p})}),o.push({index:1,cells:l}),n.forEach(function(i,e){var n=[];t.forEach(function(e,t){t={index:t+1,value:i[e.name]||""};e.name!==a.parent.eventFields.startTime&&e.name!==a.parent.eventFields.endTime||(t=U.extend({},t,{style:{fontSize:12,numberFormat:"m/d/yyyy h:mm AM/PM"}},!0)),n.push(t)}),o.push({index:e+2,cells:n})}),[{columns:s,rows:o}]);new q.Workbook({worksheets:n},i,this.parent.locale,void 0,r).save(e+"."+i)},$l.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},$l.prototype.getModuleName=function(){return"excelExport"},$l.prototype.destroy=function(){this.parent=null};h=$l;function $l(e){this.parent=e}ep.prototype.print=function(e){U.isNullOrUndefined(e)?this.printScheduler():this.printSchedulerWithModel(e)},ep.prototype.printScheduler=function(){for(var e=this.parent.element.cloneNode(!0),t=(e.id=this.parent.element.id+"_print",document.body.appendChild(e),"MonthAgenda"===this.parent.currentView?".e-appointment-wrap":".e-content-wrap"),i=this.parent.element.querySelector(t),n="",r=0,a=[].slice.call(document.getElementsByTagName("head")[0].querySelectorAll("link, style"));r<a.length;r++)n+=a[r].outerHTML;var s=U.createElement("div"),o=(e.style.width=this.parent.element.offsetWidth+"px",100*Math.round(parseInt(e.style.width,10)/100)),l=(s.appendChild(e),window.open("","print","height=550,width="+o+",tabbar=no"));l.document.write("<!DOCTYPE html><html><head>"+n+"</head><body>"+s.innerHTML+"<script>(function() { window.ready = true; })();<\/script></body></html>"),l.document.close(),l.focus(),setTimeout(function(){var e;l.ready&&i&&(i.scrollLeft=i.scrollLeft,i.scrollTop=i.scrollTop,(e=l.document.querySelector(".e-date-header-wrap"))&&(e.scrollLeft=i.scrollLeft),(e=l.document.querySelector(".e-time-cells-wrap"))&&(e.scrollTop=i.scrollTop),(e=l.document.querySelector(t))&&(e.scrollLeft=i.scrollLeft,e.scrollTop=i.scrollTop),l.print(),l.close())},500)},ep.prototype.printSchedulerWithModel=function(e){var t=U.createElement("div",{id:this.parent.element.id+"_print",className:"e-print-schedule"});document.body.appendChild(t),Qo.Inject(cl,gl,yl,bl,kl,Pl,Ul,Yl,Ol,Ql),this.printInstance=new Qo(this.getPrintScheduleModel(e)),this.printInstance.isPrinting=!0,this.printInstance.root=this.parent.root||this.parent,this.printInstance.appendTo(t),this.printInstance.on(ye,this.contentReady,this),this.printWindow=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no"),this.printWindow.moveTo(0,0),this.printWindow.resizeTo(screen.availWidth,screen.availHeight)},ep.prototype.getPrintScheduleModel=function(e){for(var t,i,n={},r=["cellHeaderTemplate","dayHeaderTemplate","monthHeaderTemplate","cellTemplate","dateHeaderTemplate","dateRangeTemplate","eventTemplate","resourceHeaderTemplate","headerIndentTemplate"],a=["actionBegin","actionComplete","actionFailure","created","dataBinding","dataBound","destroyed","eventRendered","moreEventsClick","navigating","popupOpen","popupClose","renderCell"],s=0,o=["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"];s<o.length;s++){var l=o[s];switch(l){case"eventSettings":(t=Object.assign({},this.parent.eventSettings.properties)).dataSource=this.parent.eventsData;var p=(U.isNullOrUndefined(e.eventSettings)||U.isNullOrUndefined(e.eventSettings.template)?t:e.eventSettings).template;t.template=this.parent.isAngular||"function"!=typeof p?p:null,n.eventSettings=t;break;case"group":(p=(U.isNullOrUndefined(e.group)?this.parent:e).group).headerTooltipTemplate=null,n.group=p;break;case"timeScale":t=(U.isNullOrUndefined(e.timeScale)?this.parent:e).timeScale,this.parent.isAngular||(t.majorSlotTemplate="function"==typeof t.majorSlotTemplate?null:t.majorSlotTemplate,t.minorSlotTemplate="function"==typeof t.minorSlotTemplate?null:t.minorSlotTemplate),n.timeScale=t;break;case"views":if(i=(U.isNullOrUndefined(e.views)?this.parent:e).views,!this.parent.isAngular&&i&&0<i.length&&"object"==typeof i[0])for(var c=0,h=i;c<h.length;c++)!function(t){r.forEach(function(e){U.isNullOrUndefined(t[""+e])||(t[""+e]="function"==typeof t[""+e]?null:t[""+e])})}(h[c]);n.views=i;break;default:-1<r.indexOf(l)?n[""+l]=U.isNullOrUndefined(e[""+l])?this.parent.isAngular||"function"!=typeof this.parent[""+l]?this.parent[""+l]:null:this.parent.isAngular||"function"!=typeof e[""+l]?e[""+l]:null:-1<a.indexOf(l)?n[""+l]=e[""+l]:n[""+l]=(U.isNullOrUndefined(e[""+l])?this.parent:e)[""+l]}}return n},ep.prototype.contentReady=function(){var e=this;this.printWindow=U.print(this.printInstance.element,this.printWindow),this.printWindow.onbeforeunload=function(){e.printInstance.off(ye,e.contentReady),e.printInstance.element.remove(),e.printInstance.destroy(),e.printInstance=null,e.printWindow=null}},ep.prototype.getModuleName=function(){return"print"},ep.prototype.destroy=function(){this.parent=null};mo=ep;function ep(e){this.parent=e}e.Agenda=kl,e.DEFAULT_WEEKS=6,e.Day=cl,e.DragAndDrop=Za,e.ExcelExport=h,e.Gregorian=Nr,e.HeaderRenderer=Ir,e.ICalendarExport=To,e.ICalendarImport=Vo,e.Islamic=Fr,e.MS_PER_DAY=B,e.MS_PER_MINUTE=xe,e.Month=bl,e.MonthAgenda=Pl,e.Print=mo,e.RecurrenceEditor=Zs,e.Resize=Fo,e.Schedule=Qo,e.TimelineMonth=Yl,e.TimelineViews=Ul,e.TimelineYear=Ql,e.Timezone=Br,e.ViewBase=Ja,e.WEEK_LENGTH=7,e.Week=gl,e.WorkWeek=yl,e.Year=Ol,e.actionBegin=K,e.actionComplete=Z,e.actionFailure=J,e.addDays=z,e.addMonths=Be,e.addYears=We,e.capitalizeFirstWord=f,e.cellClick=F,e.cellDoubleClick=_,e.cellMouseDown=Ve,e.cellSelect=me,e.contentReady=De,e.dataBinding=re,e.dataBound=ae,e.dataReady=Te,e.documentClick=Ee,e.drag=pe,e.dragStart=le,e.dragStop=ce,e.eventClick=te,e.eventDoubleClick=ie,e.eventRendered=ne,e.eventsLoaded=we,e.extractObjectFromRule=ga,e.findIndexInData=Je,e.firstDateOfMonth=Pe,e.generate=Gr,e.generateSummary=Yr,e.getCalendarUtil=fa,e.getDateCount=Ue,e.getDateFromRecurrenceDateString=Xr,e.getDateFromString=Ge,e.getDateInMs=Fe,e.getDaysCount=_e,e.getElementHeight=at,e.getElementHeightFromClass=Ae,e.getElementTop=st,e.getElementWidth=V,e.getElementWidthFromClass=Ie,e.getMaxDays=Ye,e.getOuterHeight=$e,e.getRecurrenceStringFromDate=Ia,e.getScrollBarWidth=Ke,e.getStartEndHours=ze,e.getTranslateX=ke,e.getTranslateY=Me,e.getUniversalTime=it,e.getWeekFirstDate=Re,e.getWeekLastDate=He,e.getWeekMiddleDate=Ne,e.getWeekNumber=Le,e.hover=Q,e.initialEnd="initial-end",e.initialLoad="initial-load",e.inlineClick=ge,e.isDaylightSavingTime=tt,e.isIPadDevice=rt,e.isMobile=nt,e.lastDateOfMonth=je,e.moreEventsClick=G,e.navigating=$,e.popupClose=oe,e.popupOpen=se,e.print=ye,e.removeChildren=et,e.renderCell=ee,e.resetScrollbarWidth=Ze,e.resetTime=W,e.resizeStart=he,e.resizeStop=ue,e.resizing=de,e.scroll=be,e.scrollUiUpdate=Se,e.select=X,e.setTime=qe,e.timezoneData=zr,e.uiUpdate=Oe,e.virtualScroll=Ce,e.virtualScrollStart=ve,e.virtualScrollStop=fe,Object.defineProperty(e,"__esModule",{value:!0})});
11
11
  //# sourceMappingURL=ej2-schedule.umd.min.js.map