@syncfusion/ej2-schedule 26.2.14 → 27.1.48

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 (199) hide show
  1. package/dist/ej2-schedule.umd.min.js +2 -2
  2. package/dist/ej2-schedule.umd.min.js.map +1 -1
  3. package/dist/es6/ej2-schedule.es2015.js +151 -29
  4. package/dist/es6/ej2-schedule.es2015.js.map +1 -1
  5. package/dist/es6/ej2-schedule.es5.js +151 -29
  6. package/dist/es6/ej2-schedule.es5.js.map +1 -1
  7. package/dist/global/ej2-schedule.min.js +2 -2
  8. package/dist/global/ej2-schedule.min.js.map +1 -1
  9. package/dist/global/index.d.ts +1 -1
  10. package/package.json +18 -17
  11. package/src/schedule/actions/crud.js +2 -2
  12. package/src/schedule/actions/keyboard.d.ts +1 -0
  13. package/src/schedule/actions/keyboard.js +45 -3
  14. package/src/schedule/actions/resize.js +1 -0
  15. package/src/schedule/actions/virtual-scroll.d.ts +1 -0
  16. package/src/schedule/actions/virtual-scroll.js +35 -4
  17. package/src/schedule/base/interface.d.ts +1 -0
  18. package/src/schedule/base/resource.js +5 -0
  19. package/src/schedule/base/schedule.js +2 -1
  20. package/src/schedule/event-renderer/inline-edit.js +9 -1
  21. package/src/schedule/event-renderer/month.js +4 -1
  22. package/src/schedule/event-renderer/timeline-view.js +4 -1
  23. package/src/schedule/event-renderer/year.js +2 -2
  24. package/src/schedule/renderer/header-renderer.d.ts +1 -0
  25. package/src/schedule/renderer/header-renderer.js +9 -1
  26. package/src/schedule/renderer/month.js +6 -0
  27. package/src/schedule/renderer/timeline-header-row.js +1 -1
  28. package/src/schedule/renderer/timeline-view.js +5 -0
  29. package/src/schedule/renderer/timeline-year.js +6 -2
  30. package/src/schedule/renderer/vertical-view.js +2 -6
  31. package/src/schedule/renderer/view-base.d.ts +1 -0
  32. package/src/schedule/renderer/view-base.js +9 -0
  33. package/src/schedule/renderer/year.js +4 -4
  34. package/styles/bootstrap-dark-lite.css +4169 -0
  35. package/styles/bootstrap-dark-lite.scss +18 -0
  36. package/styles/bootstrap-dark.css +818 -596
  37. package/styles/bootstrap-dark.scss +3 -2
  38. package/styles/bootstrap-lite.css +4164 -0
  39. package/styles/bootstrap-lite.scss +18 -0
  40. package/styles/bootstrap.css +818 -596
  41. package/styles/bootstrap.scss +3 -2
  42. package/styles/bootstrap4-lite.css +4211 -0
  43. package/styles/bootstrap4-lite.scss +18 -0
  44. package/styles/bootstrap4.css +803 -636
  45. package/styles/bootstrap4.scss +3 -2
  46. package/styles/bootstrap5-dark-lite.css +4210 -0
  47. package/styles/bootstrap5-dark-lite.scss +18 -0
  48. package/styles/bootstrap5-dark.css +819 -597
  49. package/styles/bootstrap5-dark.scss +3 -2
  50. package/styles/bootstrap5-lite.css +4210 -0
  51. package/styles/bootstrap5-lite.scss +18 -0
  52. package/styles/bootstrap5.3-lite.css +4256 -0
  53. package/styles/bootstrap5.3-lite.scss +18 -0
  54. package/styles/bootstrap5.3.css +5017 -0
  55. package/styles/bootstrap5.3.scss +20 -0
  56. package/styles/bootstrap5.css +819 -597
  57. package/styles/bootstrap5.scss +3 -2
  58. package/styles/fabric-dark-lite.css +4139 -0
  59. package/styles/fabric-dark-lite.scss +18 -0
  60. package/styles/fabric-dark.css +825 -595
  61. package/styles/fabric-dark.scss +3 -2
  62. package/styles/fabric-lite.css +4136 -0
  63. package/styles/fabric-lite.scss +18 -0
  64. package/styles/fabric.css +825 -588
  65. package/styles/fabric.scss +3 -2
  66. package/styles/fluent-dark-lite.css +4202 -0
  67. package/styles/fluent-dark-lite.scss +18 -0
  68. package/styles/fluent-dark.css +823 -593
  69. package/styles/fluent-dark.scss +3 -2
  70. package/styles/fluent-lite.css +4202 -0
  71. package/styles/fluent-lite.scss +18 -0
  72. package/styles/fluent.css +823 -593
  73. package/styles/fluent.scss +3 -2
  74. package/styles/fluent2-lite.css +4422 -0
  75. package/styles/fluent2-lite.scss +18 -0
  76. package/styles/fluent2.css +860 -602
  77. package/styles/fluent2.scss +3 -2
  78. package/styles/highcontrast-light-lite.css +4228 -0
  79. package/styles/highcontrast-light-lite.scss +18 -0
  80. package/styles/highcontrast-light.css +828 -584
  81. package/styles/highcontrast-light.scss +3 -2
  82. package/styles/highcontrast-lite.css +4237 -0
  83. package/styles/highcontrast-lite.scss +18 -0
  84. package/styles/highcontrast.css +829 -585
  85. package/styles/highcontrast.scss +3 -2
  86. package/styles/material-dark-lite.css +4216 -0
  87. package/styles/material-dark-lite.scss +18 -0
  88. package/styles/material-dark.css +828 -581
  89. package/styles/material-dark.scss +3 -2
  90. package/styles/material-lite.css +4242 -0
  91. package/styles/material-lite.scss +18 -0
  92. package/styles/material.css +826 -600
  93. package/styles/material.scss +3 -2
  94. package/styles/material3-dark-lite.css +4233 -0
  95. package/styles/material3-dark-lite.scss +18 -0
  96. package/styles/material3-dark.css +825 -602
  97. package/styles/material3-dark.scss +3 -2
  98. package/styles/material3-lite.css +4235 -0
  99. package/styles/material3-lite.scss +18 -0
  100. package/styles/material3.css +825 -602
  101. package/styles/material3.scss +3 -2
  102. package/styles/recurrence-editor/_bigger.scss +134 -0
  103. package/styles/recurrence-editor/_layout.scss +0 -110
  104. package/styles/recurrence-editor/bootstrap-dark.css +87 -131
  105. package/styles/recurrence-editor/bootstrap-dark.scss +1 -0
  106. package/styles/recurrence-editor/bootstrap.css +87 -131
  107. package/styles/recurrence-editor/bootstrap.scss +1 -0
  108. package/styles/recurrence-editor/bootstrap4.css +87 -149
  109. package/styles/recurrence-editor/bootstrap4.scss +1 -0
  110. package/styles/recurrence-editor/bootstrap5-dark.css +87 -135
  111. package/styles/recurrence-editor/bootstrap5-dark.scss +1 -0
  112. package/styles/recurrence-editor/bootstrap5.3.css +501 -0
  113. package/styles/recurrence-editor/bootstrap5.3.scss +9 -0
  114. package/styles/recurrence-editor/bootstrap5.css +87 -135
  115. package/styles/recurrence-editor/bootstrap5.scss +1 -0
  116. package/styles/recurrence-editor/fabric-dark.css +87 -130
  117. package/styles/recurrence-editor/fabric-dark.scss +1 -0
  118. package/styles/recurrence-editor/fabric.css +87 -123
  119. package/styles/recurrence-editor/fabric.scss +1 -0
  120. package/styles/recurrence-editor/fluent-dark.css +87 -122
  121. package/styles/recurrence-editor/fluent-dark.scss +1 -0
  122. package/styles/recurrence-editor/fluent.css +87 -122
  123. package/styles/recurrence-editor/fluent.scss +1 -0
  124. package/styles/recurrence-editor/fluent2.css +91 -117
  125. package/styles/recurrence-editor/fluent2.scss +1 -0
  126. package/styles/recurrence-editor/highcontrast-light.css +87 -118
  127. package/styles/recurrence-editor/highcontrast-light.scss +1 -0
  128. package/styles/recurrence-editor/highcontrast.css +87 -118
  129. package/styles/recurrence-editor/highcontrast.scss +1 -0
  130. package/styles/recurrence-editor/material-dark.css +87 -115
  131. package/styles/recurrence-editor/material-dark.scss +1 -0
  132. package/styles/recurrence-editor/material.css +87 -136
  133. package/styles/recurrence-editor/material.scss +1 -0
  134. package/styles/recurrence-editor/material3-dark.css +87 -140
  135. package/styles/recurrence-editor/material3-dark.scss +1 -0
  136. package/styles/recurrence-editor/material3.css +87 -140
  137. package/styles/recurrence-editor/material3.scss +1 -0
  138. package/styles/recurrence-editor/tailwind-dark.css +87 -116
  139. package/styles/recurrence-editor/tailwind-dark.scss +1 -0
  140. package/styles/recurrence-editor/tailwind.css +87 -116
  141. package/styles/recurrence-editor/tailwind.scss +1 -0
  142. package/styles/schedule/_bds-definition.scss +1 -1
  143. package/styles/schedule/_bigger.scss +809 -0
  144. package/styles/schedule/_bootstrap4-definition.scss +1 -1
  145. package/styles/schedule/_bootstrap5-definition.scss +1 -1
  146. package/styles/schedule/_bootstrap5.3-definition.scss +9 -6
  147. package/styles/schedule/_fluent-definition.scss +1 -1
  148. package/styles/schedule/_fluent2-definition.scss +6 -6
  149. package/styles/schedule/_fusionnew-definition.scss +1 -1
  150. package/styles/schedule/_layout.scss +5 -442
  151. package/styles/schedule/_tailwind-definition.scss +1 -1
  152. package/styles/schedule/_theme.scss +23 -1
  153. package/styles/schedule/bootstrap-dark.css +699 -483
  154. package/styles/schedule/bootstrap-dark.scss +1 -0
  155. package/styles/schedule/bootstrap.css +699 -483
  156. package/styles/schedule/bootstrap.scss +1 -0
  157. package/styles/schedule/bootstrap4.css +684 -523
  158. package/styles/schedule/bootstrap4.scss +1 -0
  159. package/styles/schedule/bootstrap5-dark.css +707 -491
  160. package/styles/schedule/bootstrap5-dark.scss +1 -0
  161. package/styles/schedule/bootstrap5.3.css +4615 -0
  162. package/styles/schedule/bootstrap5.3.scss +17 -0
  163. package/styles/schedule/bootstrap5.css +707 -491
  164. package/styles/schedule/bootstrap5.scss +1 -0
  165. package/styles/schedule/fabric-dark.css +706 -482
  166. package/styles/schedule/fabric-dark.scss +1 -0
  167. package/styles/schedule/fabric.css +706 -475
  168. package/styles/schedule/fabric.scss +1 -0
  169. package/styles/schedule/fluent-dark.css +716 -492
  170. package/styles/schedule/fluent-dark.scss +1 -0
  171. package/styles/schedule/fluent.css +716 -492
  172. package/styles/schedule/fluent.scss +1 -0
  173. package/styles/schedule/fluent2.css +746 -497
  174. package/styles/schedule/fluent2.scss +1 -0
  175. package/styles/schedule/highcontrast-light.css +714 -476
  176. package/styles/schedule/highcontrast-light.scss +1 -0
  177. package/styles/schedule/highcontrast.css +714 -476
  178. package/styles/schedule/highcontrast.scss +1 -0
  179. package/styles/schedule/material-dark.css +724 -483
  180. package/styles/schedule/material-dark.scss +1 -0
  181. package/styles/schedule/material.css +720 -500
  182. package/styles/schedule/material.scss +1 -0
  183. package/styles/schedule/material3-dark.css +714 -497
  184. package/styles/schedule/material3-dark.scss +1 -0
  185. package/styles/schedule/material3.css +714 -497
  186. package/styles/schedule/material3.scss +1 -0
  187. package/styles/schedule/tailwind-dark.css +718 -483
  188. package/styles/schedule/tailwind-dark.scss +1 -0
  189. package/styles/schedule/tailwind.css +718 -483
  190. package/styles/schedule/tailwind.scss +1 -0
  191. package/styles/tailwind-dark-lite.css +4179 -0
  192. package/styles/tailwind-dark-lite.scss +18 -0
  193. package/styles/tailwind-dark.css +827 -586
  194. package/styles/tailwind-dark.scss +3 -2
  195. package/styles/tailwind-lite.css +4179 -0
  196. package/styles/tailwind-lite.scss +18 -0
  197. package/styles/tailwind.css +827 -586
  198. package/styles/tailwind.scss +3 -2
  199. package/dist/ej2-schedule.min.js +0 -10
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * filename: ej2-schedule.umd.min.js
3
- * version : 26.2.14
3
+ * version : 27.1.48
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=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,p,H,P,j,N,L){"use strict";var q="cellClick",F="cellDoubleClick",_="moreEventsClick",G="select",X="hover",Q="actionBegin",K="actionComplete",Z="actionFailure",J="navigating",$="renderCell",ee="eventClick",te="eventDoubleClick",ie="eventRendered",ne="dataBinding",re="dataBound",ae="popupOpen",se="popupClose",oe="dragStart",le="drag",pe="dragStop",ce="resizeStart",he="resizing",de="resizeStop",ue="inlineClick",ge="cellSelect",me="virtualScrollStart",ve="virtualScrollStop",fe="print",ye="data-ready",Te="events-loaded",we="content-ready",De="scroll",be="virtual-scroll",Se="scroll-ui-update",Ce="ui-update",Oe="document-click",Ee="cell-mouse-down",B=864e5,Ve=6e4;function xe(e,t,i){t=U.createElement("div",{className:t}).cloneNode();return t.style.visibility="hidden",t.style.position="absolute",e.appendChild(t),e=at(t,i),U.remove(t),e}function Ae(e,t,i){t=U.createElement("div",{className:t}).cloneNode();return t.style.visibility="hidden",t.style.position="absolute",e.appendChild(t),e=rt(t,i),U.remove(t),e}function Ie(e){e=getComputedStyle(e);return window.WebKitCSSMatrix?new WebKitCSSMatrix(e.webkitTransform).m42:0}function Me(e){e=getComputedStyle(e);return window.WebKitCSSMatrix?new WebKitCSSMatrix(e.webkitTransform).m41:0}function ke(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 Re(e,t){e=ke(e,t),t=new Date(e.getFullYear(),e.getMonth(),e.getDate()+6);return new Date(t.getTime())}function He(e){return new Date(e.getFullYear(),e.getMonth(),1)}function Pe(e){return new Date(e.getFullYear(),e.getMonth()+1,0)}function je(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 Le(e,t){var i=e.getTimezoneOffset(),t=new Date(e.getTime()+t),i=t.getTimezoneOffset()-i;return e.setTime(t.getTime()+i*Ve),e}function W(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function qe(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 Fe(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 Ue(e,t){var i=(e=new Date(""+e)).getDate();return e.setDate(1),e.setMonth(e.getMonth()+t),e.setDate(Math.min(i,ze(e))),e}function Be(e,t){var i=(e=new Date(""+e)).getDate();return e.setDate(1),e.setFullYear(e.getFullYear()+t),e.setDate(Math.min(i,ze(e))),e}function We(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 ze(e){return Pe(e).getDate()}function Ye(e,t){e=W(new Date(e)),t=W(new Date(t));return Math.round((t.getTime()-e.getTime())/B)}function _e(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 Ge=null,Xe=null;function Qe(){if(null!==Ge)return Ge;null===Xe&&(Xe=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),Ge=t}function Ke(){var e=window.devicePixelRatio||window.screen.availWidth/document.documentElement.clientWidth;Xe&&Xe!==e&&(Ge=null,Xe=e)}function Ze(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 Je(e){var t=getComputedStyle(e);return e.offsetHeight+(parseInt(t.marginTop,10)||0)+(parseInt(t.marginBottom,10)||0)}function $e(e){for(var t=0,i=[].slice.call(e.children);t<i.length;t++){var n=i[t];e.removeChild(n)}}function et(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 tt(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 it(){return-1<window.navigator.userAgent.toLowerCase().indexOf("mobi")}function nt(){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 rt(e,t){return t?e.offsetWidth:e.getBoundingClientRect().width}function at(e,t){return t?e.offsetHeight:e.getBoundingClientRect().height}function st(e,t){return t?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",w="e-all-day-cells",vt="e-all-day-row",C="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",St="e-current-day",Ct="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",Nt="e-parent-node",Lt="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",V="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",x="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",A="e-content-wrap",yi="e-virtual-track",Ti="e-agenda-cells",wi="e-current-day",Di="e-active-appointment-agenda",bi="e-month-header",Si="e-day-date-header",Ci="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",Ni="e-clone-time-indicator",Li="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",Sn="e-quick-dialog-series-event",Cn="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",Nn="e-subject",Ln="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",Sr="e-month-header-wrapper",Cr="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(Oe,this.closeHeaderPopup,this)},t.prototype.removeEventListener=function(){this.parent.off(Oe,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("."+A);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(Q,{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(K,{requestType:"toolBarItemRendered",items:t.toolbarObj.items})})},t.prototype.updateItems=function(){var e,t=this;this.toolbarObj&&(e=this.getItems(),this.parent.trigger(Q,{requestType:"toolbarItemRendering",items:e},function(e){t.toolbarObj.items=e.items,t.toolbarObj.dataBind(),t.parent.trigger(K,{requestType:"toolBarItemRendered",items:t.toolbarObj.items})}))},t.prototype.getPopUpRelativeElement=function(){return this.parent.isAdaptive?this.toolbarObj.element:this.element.querySelector(".e-date-range")},t.prototype.setDayOfWeek=function(e){this.headerCalendar&&(this.headerCalendar.firstDayOfWeek=e,this.headerCalendar.dataBind())},t.prototype.setCalendarDate=function(e){this.headerCalendar&&(this.headerCalendar.value=e,this.headerCalendar.dataBind())},t.prototype.setCalendarMinMaxDate=function(){this.headerCalendar&&(this.headerCalendar.min=this.parent.minDate,this.headerCalendar.max=this.parent.maxDate,this.headerCalendar.dataBind())},t.prototype.getCalendarView=function(){return-1<["Month","MonthAgenda","TimelineMonth"].indexOf(this.parent.currentView)?"Year":-1<["Year","TimelineYear"].indexOf(this.parent.currentView)?"Decade":"Month"},t.prototype.setCalendarView=function(){var e;this.headerCalendar&&(e=this.getCalendarView(),this.headerCalendar.depth=e,this.headerCalendar.start=e,this.headerCalendar.refresh())},t.prototype.updateActiveView=function(){var e=[].slice.call(this.toolbarObj.element.querySelectorAll(".e-views"));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(He(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*Ve/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=ke(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():He(this.parent.selectedDate),t=e?this.parent.activeView.getEndDate():Pe(Ue(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(we,this.setDimensions,this),this.parent.on(Ce,this.onPropertyChanged,this)},kr.prototype.removeEventListener=function(){this.parent.off(we,this.setDimensions),this.parent.off(Ce,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,"."+x));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(Q,i),i.cancel)return;i=this.element.querySelector("."+A);if(i&&i.scrollWidth>i.clientWidth)return;this.isScrollTriggered=!0,e.originalEvent.preventDefault(),e.originalEvent.stopPropagation()}e.scrollDirection===this.touchLeftDirection?(this.nextPanel||(this.renderPanel(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(K,i)):this.cancelSwipe(),this.timeStampStart=null)},Hr.prototype.tapHoldHandler=function(e){var t=U.closest(e.originalEvent.target,"."+x);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(J,e,function(e){e.cancel?(i.swapPanels(t),i.cancelSwipe()):(i.parent.activeView.setPanel(i.currentPanel.element),i.parent.setProperties({selectedDate:i.currentPanel.selectedDate},!0),e=void 0,e=i.parent.enableRtl?t===i.touchLeftDirection?i.previousPanel?i.previousPanel.element.offsetLeft:i.currentPanel.element.offsetWidth:0:t===i.touchLeftDirection?-i.currentPanel.element.offsetLeft:0,i.parent.activeView.renderDates=i.currentPanel.renderDates,i.parent.activeView.colLevels=i.currentPanel.colLevels,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="",$e(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(w))&&(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(ue,e)),t.classList.contains(x)&&t.click()},i.prototype.addEventListener=function(){this.parent.on(Ee,this.onCellMouseDown,this)},i.prototype.removeEventListener=function(){this.parent.off(Ee,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(w))&&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("."+x)),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("."+A)).offsetHeight<=t.scrollHeight&&0<=t.scrollTop&&t.scrollTop+t.offsetHeight<=t.scrollHeight,i=t.offsetWidth<=t.scrollWidth&&0<=t.scrollLeft&&t.scrollLeft+t.offsetWidth<=t.scrollWidth,r&&(n.top||n.bottom)&&(t.scrollTop+=n.top?-e.target.offsetHeight:e.target.offsetHeight),i)&&(n.left||n.right)&&(t.scrollLeft+=n.left?-e.target.offsetWidth:e.target.offsetWidth),this.getClosestCell(e));r&&this.selectCells(!0,r)},i.prototype.getClosestCell=function(e){return U.closest(e.target,"."+O+",."+w)},i.prototype.onMoveUp=function(t){var i,n=this,e=[].slice.call(this.parent.element.querySelectorAll("."+x));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(w)&&(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:ge,showQuickPopup:!1},this.parent.trigger(G,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(q,e))}))},i.prototype.processEnter=function(e){var t,i,n;this.parent.activeViewOptions.readonly&&!e.target.classList.contains(x)||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(Nn)&&(this.parent.element.querySelector("."+cn).click(),e.preventDefault()):t.classList.contains(Ut)&&t.classList.contains(Nt)?(i=t.querySelector("."+Ft))&&i.click():t.classList.contains(O)||t.classList.contains(w)?(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(ue,n)):"Year"===this.parent.currentView?t.click():this.parent.notify(q,i)):t.classList.contains(Cr)&&this.parent.inlineModule?this.parent.inlineModule.inlineCrudActions(t):t.classList.contains(x)||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(w)&&(n=this.parent.getAllDayRow(),a=[].slice.call(n.cells),s=1,o=n.cells.length),a.indexOf(t)),l=a.indexOf(i),p=[];if(e){for(var c=0;c<o;c++)for(var h=0;h<s;h++){var d=a[o*h+c];r&&d.classList.contains(E)||p.push(d)}n=p.indexOf(t),l=p.indexOf(i)}return l<n&&(t=n,n=l,l=t),(e?p:a).slice(n,l+1)},i.prototype.focusFirstCell=function(){var e;"Agenda"===this.parent.currentView?((e=this.parent.getContentTable().querySelector("."+Ti)).setAttribute("tabindex","0"),e.focus()):(this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.activeView.isTimelineView()&&"TimelineYear"!==this.parent.currentView?(e=this.parent.element.querySelector("."+C+" tr:not(."+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(G,i,function(e){e.allowMultipleRow&&h.parent.allowMultiRowSelection||((e="TimelineYear"===h.parent.currentView)&&"Horizontal"===h.parent.activeViewOptions.orientation||"Month"===h.parent.currentView?(e=e&&0<h.parent.activeViewOptions.group.resources.length,d=e?h.initialTarget:h.initialTarget.parentElement.children[d.cellIndex]):-1<c.indexOf(h.parent.currentView)&&(d=d.parentElement.children[h.initialTarget.cellIndex]));e=h.getCells(h.isInverseTableSelect(),h.initialTarget,d);if(0<h.parent.activeViewOptions.group.resources.length){p=h.initialTarget.getAttribute("data-group-index");for(var t=[],i=0,n=e;i<n.length;i++)(a=n[i]).getAttribute("data-group-index")===p&&t.push(a);e=t}if(h.parent.allowMultiCellSelection||(e=[h.initialTarget]),2<(h.selectedCells=e).length&&!d.classList.contains(w)){var r=h.getAllDayCells(e);if(0<h.parent.activeViewOptions.group.resources.length){for(var a,s=[],o=0,l=r;o<l.length;o++)(a=l[o]).getAttribute("data-group-index")===p&&s.push(a);r=s}e=e.concat(r)}d.getAttribute("data-group-index")!==p&&0<h.parent.activeViewOptions.group.resources.length&&(d=h.selectedCells[h.selectedCells.length-1]),h.parent.addSelectedClass(e,d)})):(i={element:d,requestType:ge},this.parent.trigger(G,i,function(){h.initialTarget=d,h.selectedCells=[d],h.parent.addSelectedClass([d],d)}))},i.prototype.selectAppointment=function(e,t){var i=this.getAppointmentElements();i.length<0||(this.parent.eventBase.removeSelectedAppointmentClass(),(t=t.classList.contains(x)?(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(w))&&(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("."+x))},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(w)&&(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()===Pe(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(w)&&(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(w)&&(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()===He(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("."+C+" tbody")).item(o.length-1).querySelector(":not(."+E+')[data-date="'+this.parent.activeView.getEndDate().getTime()+'"]')),this.selectCells(!1,n))))):i.classList.contains(w)&&(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(Cr)&&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("."+x+'[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(x)){var r=[].slice.call(this.parent.element.querySelectorAll("."+x)),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("."+x+'[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(x)?(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(x)&&(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(x)){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("."+x+'[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(x)&&(n=this.parent.resourceBase.renderedResources[0].groupIndex,0<(t=[].slice.call(this.parent.element.querySelectorAll("."+x+'[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("."+A).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()}Nr.prototype.initDataManager=function(e,t){this.dataManager=e instanceof p.DataManager?e:new p.DataManager(e),this.query=t instanceof p.Query?t:new p.Query},Nr.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 p.Predicate(this.parent.eventFields.recurrenceRule,"notequal",null).and(new p.Predicate(this.parent.eventFields.recurrenceRule,"notequal","")),a.where(i.or(r));a.addParams("StartDate",e.toISOString()),a.addParams("EndDate",t.toISOString())}return a},Nr.prototype.getStartEndQuery=function(e,t){var i=this.parent.eventFields;return new p.Predicate(i.startTime,"greaterthanorequal",e).and(new p.Predicate(i.endTime,"greaterthanorequal",e)).and(new p.Predicate(i.startTime,"lessthan",t)).or(new p.Predicate(i.startTime,"lessthanorequal",e).and(new p.Predicate(i.endTime,"greaterthan",e)))},Nr.prototype.getData=function(e){return this.dataManager.executeQuery(e)},Nr.prototype.destroy=function(){this.dataManager=null,this.query=null};var jr=Nr;function Nr(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 Lr=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(Ca[-1<n?n:Ca.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 N=Sa[parseInt(n.toString(),10)];ba[0]!==N;){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,L=l.until,g=p,m=l,v=new Date(u.getTime()),q=m.interval,f=Kr(u,m),y=m.day;ha(v,L)&&!(va(v,m)&&(-1<y.indexOf(Sa[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,S=new Date(T.getTime());b.day.length||b.day.push(Sa[T.getDay()]);var C,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]),C=Sa.indexOf(b.wkst);ha(S,w);){var A=Sa.indexOf(Sa[S.getDay()])-C,A=z(S,-(A=-1==A?6:A)),I=z(A,6),M=new Date(S.getTime());for(I=W(I),M=W(M);M<=I&&(-1<E.indexOf(Sa[S.getDay()])&&x.push([S.getTime()]),!(V&&D.length+b.recExceptionCount>=V));)S.setDate(S.getDate()+1),S.getHours()!==T.getHours()&&S.setHours(T.getHours()),M=W(M=new Date(S.getTime()));if(S.setDate(S.getDate()-1),V&&D.length+b.recExceptionCount>=V)break;S.setDate(S.getDate()+1+7*(O-1)),ra(x,0,T,w,D,b),x=[]}else{for(S=ua(T,b.day),1<O&&ba.indexOf(b.day[0])<T.getDay()&&S.setDate(S.getDate()+7*(O-1));ha(S,w)&&((F=va(S,b))&&-1<E.indexOf(Sa[S.getDay()])&&Qr(D,S.getTime()),!(V&&D.length+b.recExceptionCount>=V));)S.setDate(S.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(Sa[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(Sa[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(Sa[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 S=u[parseInt(b.toString(),10)].match(Aa),C=parseInt(S[0],10);for(l=new Date(m.getTime());Y.isSameYear(l,m)&&Y.isSameMonth(l,m);)S[S.length-1]===Sa[l.getDay()]&&f.push([l.getTime()]),l.setDate(l.getDate()+1);l.setDate(l.getDate()-1),s=-1<S[0].indexOf("-")?f.length- -1*C:C-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(Sa[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]);Sa[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(Sa[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]===Sa[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(Sa[s.getDay()])&&(o.push(v),v=[]),s.setDate(s.getDate()+f[Sa[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 S=0;S<o[parseInt(b.toString(),10)].length;S++)D.push(o[parseInt(b.toString(),10)][parseInt(S.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(Sa[n.getDay()]))for(;n.setDate(n.getDate()+1),-1===r.indexOf(Sa[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(Sa[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:Lr)}var ya,Ta,wa,Y,Da={},ba=["SU","MO","TU","WE","TH","FR","SA"],Sa=["SU","MO","TU","WE","TH","FR","SA"],Ca=["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]=_e(e[this.parent.eventFields.startTime])),"string"==typeof e[this.parent.eventFields.endTime]&&(e[this.parent.eventFields.endTime]=_e(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(ye,{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 p.DataManager({json:i}).executeLocal((new p.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=Ye(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=qe(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,S=(D=b?D:h.length-1)-w+1,C=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)],S,C,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{C=E[0]!==a,O=E[E.length-1]!==s;o.push(this.cloneEventObject(e,E[0],E[E.length-1],E.length,C,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+",."+x+":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<=(tt(e[t.endTime])-tt(e[t.startTime]))/B;return!!(i||"TimeSlot"!==this.parent.eventSettings.spannedEventPlacement&&e)},n.prototype.addEventListener=function(){this.parent.on(Oe,this.appointmentBorderRemove,this)},n.prototype.removeEventListener=function(){this.parent.off(Oe,this.appointmentBorderRemove)},n.prototype.appointmentBorderRemove=function(e){e=e.event.target;U.closest(e,"."+x)?"MonthAgenda"!==this.parent.currentView&&this.parent.removeSelectedClass():U.closest(e,"."+yt)||this.parent.uiStateValues.isTapHold&&U.closest(e,"."+O+",."+w)||(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(Li)||n.classList.contains(Fi)||n.classList.contains(Cr)||((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,"."+x),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(G,n),t=U.extend(this.parent.activeEventData,{cancel:!1,originalEvent:e}),this.parent.trigger(ee,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(G,n),t=U.extend(this.parent.activeEventData,{cancel:!1,originalEvent:e}),this.parent.trigger(ee,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(ue,t)):i.parent.notify(ee,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("."+Cr)||(e=U.extend(this.parent.activeEventData,{cancel:!1,originalEvent:e}),this.parent.trigger(te,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,"."+x),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=Fe(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:Nn}),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 p.DataManager(e).executeLocal((new p.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 p.Predicate(r.followingID,"equal",s).and(new p.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 p.Predicate(i.recurrenceID,"equal",s[i.id]).or(new p.Predicate(i.recurrenceID,"equal",s[i.followingID]).and(new p.Predicate(i.recurrenceID,"notequal",void 0)).and(new p.Predicate(i.recurrenceID,"notequal",null)));"EditFollowingEvents"!==this.parent.currentAction&&"DeleteFollowingEvents"!==this.parent.currentAction||(s=s.and(new p.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("."+w).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()||t.getTime()===i.getTime()&&e.startHour.getTime()<i.getTime()&&e.endHour.getTime()>t.getTime()&&-1===this.parent.currentView.indexOf("Timeline"))&&(tt(i)-tt(t))/Ve<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:V+"-"+t.toString(),className:V}),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(we,{})}},n.prototype.unWireEvents=function(){for(var e=0,t=[].slice.call(this.parent.element.querySelectorAll("."+x));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+",."+x+",."+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("."+w)),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(we,{}),U.addClass(this.allDayElement,ar),i&&(this.parent.crudModule.crudObj.isCrudAction=!1),this.parent.renderTemplates(function(){var e;t.parent&&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(this.parent.getElementHeight(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=(tt(t)-tt(e))/Ve*(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("."+V+'[id="'+V+"-"+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(ie,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=We(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("."+A+" 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?this.parent.getElementHeightFromClass(this.element.querySelector("."+Xi),x):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("."+V).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:x,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:Nn}),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:Ln}),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=We(n,this.startHour,this.endHour),r=U.extend({},e,null,!0),e=(r.isSpanned={isBottom:!1,isTop:!1,isSameDuration:r[i.startTime].getTime()===r[i.endTime].getTime()},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(ie,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=We(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=a.isSpanned.isSameDuration?this.cellHeight: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("."+Nn),!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=We(i,this.startHour,this.endHour).startHour,i=(et(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:x,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(we,{})},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,Na=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("."+A),n=(this.parent.rowAutoHeight&&(this.parent.uiStateValues.top=t.scrollTop,this.parent.uiStateValues.left=t.scrollLeft),[].slice.call(this.element.querySelectorAll("."+V)));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(C),this.element.querySelector("."+O)&&("Month"===this.parent.currentView&&(n=U.createElement("div",{className:V}),(e=this.parent.element.querySelector("."+O)).appendChild(n),this.monthHeaderHeight=n.offsetTop-e.offsetTop,e.removeChild(n)),this.eventHeight=this.parent.getElementHeightFromClass(this.element,x),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(we,{}),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("."+A).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("."+C).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=this.parent.getElementWidth(o),this.cellHeight=this.parent.getElementHeight(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<qe(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<qe(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=We(e[this.fields.startTime],n,r),e=We(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:x,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:Nn}),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:Ln}),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(_,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(x),e=this.getEventData(e);this.parent.trigger(ie,{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("."+V);i?i.appendChild(t):((i=U.createElement("div",{className:V})).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=Je(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(),Na.prototype.destroy.call(this)};var ja,Na,La=a;function a(e){e=Na.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=La),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=this.parent.getElementWidth(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-(qe(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=We(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=We(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?(l=this.parent.element.querySelector("."+A),h=this.parent.getElementWidth(l),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!==this.parent.getElementWidth(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 S=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,S)}else for(var C=(tt(r)-tt(n))/Ve*this.slotCount/this.interval,O=0;O<C&&(D=0===O?new Date(D.getTime()):new Date(D.getTime()+6e4*w),C<1&&(D=this.adjustToNearestTimeSlot(D,w)),b=new Date(D.getTime()+6e4*w),!(1<=C&&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("."+C+" tbody tr"),n=this.parent.getElementWidth(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("."+x)).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=We(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=We(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=We(W(new Date(e.getTime())),this.startHour,this.endHour)).endHour.getTime()-i.startHour.getTime())/Ve),(tt(t)-tt(e))/Ve*(this.cellWidth*this.slotCount)/n},s.prototype.getSpannedEventsWidth=function(e,t,i){var n,i=i*this.slotsPerDay*this.cellWidth,r=We(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=We(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)?(tt(t)-tt(e.startHour))/(Ve*this.interval)*this.slotCount:0;return 0===i?t:Math.round((tt(e.endHour)-tt(e.startHour))/Ve/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=We(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("."+A+' 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("."+C+" tbody tr"));return e.dayLength=0===t.length?0:t[0].children.length,e.content=e.parent.element.querySelector("."+mt+"."+C),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("."+Cr)!==e.element.querySelector("."+Cr)&&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("."+Cr));s&&s.focus()},Wa.prototype.eventEdit=function(e){var t,i,n=e.element.querySelector("."+Cr);n?i=n.value:(t=e.element.querySelector("."+Nn),i=U.isNullOrUndefined(t)?e.data[this.parent.eventFields.subject]:(U.addClass([t],d),t.innerText),n=U.createElement("input",{className:Cr,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("."+w)),(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(this.parent.getElementHeight(this.parent.element.querySelector("."+vt))/r[0].offsetHeight)-1),s.allDayLevel=a,r=this.parent.getElementHeightFromClass(this.parent.element.querySelector("."+Xi),x),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 La(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=this.parent.getElementHeightFromClass(this.parent.monthModule.element||a.element,x),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("."+Cr).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("."+C+" tbody tr").length?0:this.parent.element.querySelectorAll("."+C+" tbody tr")[0].children.length);t.slotsPerDay=r/t.dateRender.length,t.eventHeight=this.parent.getElementHeightFromClass(t.element,x),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("."+Cr),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("."+Cr);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,"."+x),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:x+" "+Or}),i=U.createElement("div",{className:di}),n=(t.appendChild(i),U.createElement("input",{className:Cr}));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("."+Cr));t&&(e=U.closest(t,"."+x).querySelector("."+Nn),U.isNullOrUndefined(e)||U.removeClass([e],d),U.remove(t))},Wa.prototype.destroy=function(){this.parent.off(ue,this.inlineEdit)};var Ba=Wa;function Wa(e){this.parent=e,this.parent.on(ue,this.inlineEdit,this)}Ya.prototype.renderFormValidator=function(e,t,i,n){var r=this;this.element=i,this.formObj=new P.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(w)||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 H.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,Sn,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],Sn),this.parent.eventSettings.editFollowingEvents&&(U.removeClass([r],d),U.addClass([this.quickDialog.element],On),U.addClass([r],Cn));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(ae,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:x,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:Nn})),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(ie,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,"."+x),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="'+Nn+'">'+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+",."+w))&&t.appendChild(i)):(t=U.closest(n,"."+O+",."+w+",."+Dt),U.isNullOrUndefined(t)||n.classList.contains(tn)||(this.quickPopup.relateTo===t&&this.quickPopup.element.classList.contains(yt)?(i=this.quickPopup.element.querySelector("."+Nn))&&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("."+Nn))&&P.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,"."+x)||!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,"."+x)):(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,"."+x),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="'+Nn+" "+un+'" title="'+(s.eventSubject&&s.eventSubject.replaceAll('"',"'"))+'"></div></div >'}r=U.createElement("div",{innerHTML:a});"Event"===e&&(n=r.querySelector("."+Nn),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="'+Nn+' 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="'+Ln+'"><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=Ze(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<(tt(r)-tt(n))/B&&(p+="&nbsp;-&nbsp;"+s+" ("+this.l10n.getConstant("allDay")+")")):p=1<=(tt(r)-tt(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,Ct),W(t.date).getTime()===W(this.parent.getCurrentTime()).getTime()&&U.addClass(this.morePopup.element.querySelector("."+vn).childNodes,Ct),!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("."+A+' tbody tr td[data-date="'+l+'"]');else if(this.morePopup.relateTo=this.parent.element.querySelector("."+A+' tbody tr td[data-group-index="'+e+'"][data-date="'+l+'"]'),U.isNullOrUndefined(this.morePopup.relateTo))for(var p=[].slice.call(this.parent.element.querySelectorAll("."+A+' 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(ae,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("."+Nn);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(Cn))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(Sn))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("."+Nn).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(x)?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(se,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(ae,e,function(e){var t,i,n,r,a,s;e.cancel?(h.quickPopupHide(),h.destroyPopupButtons("quickPopup"),e.element.classList.contains(yt)&&h.quickPopupClose(),$e(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,"."+C)),t=h.parent.element.querySelector("."+A+" table"),h.quickPopup.offsetX=i&&!h.parent.enableRtl?Me(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=Me(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=Ie(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("."+Nn))&&(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("."+Nn))&&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"),$e(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(se,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+",."+w+",."+O+",."+x+",.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("."+Cr));i&&i!==e&&this.parent.allowInline&&this.parent.inlineModule.documentClick(),U.closest(e,"."+x+",."+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(q,this.cellClick,this),this.parent.on(ee,this.eventClick,this),this.parent.on(Oe,this.documentClick,this),this.parent.on(ye,this.updateMoreEventContent,this)},o.prototype.removeEventListener=function(){this.parent.off(q,this.cellClick),this.parent.off(ee,this.eventClick),this.parent.off(Oe,this.documentClick),this.parent.off(ye,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."+Nn))&&e.remove(),(t=this.quickPopup.element.querySelector("form."+Rn))&&($e(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("."+x),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=(d=new Date(""+e[i.endTime])).getTime()-n.getTime()!=0&&0===d.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",Ss="e-hide-recurrence-element",Cs="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",Ns="value",Ls="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,Cs])})},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,Cs])},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)],Ss)});break;case Is:zs.forEach(function(e){return U.addClass([t.element.querySelector("."+e)],Ss)});break;case Ms:Ys.forEach(function(e){return U.addClass([t.element.querySelector("."+e)],Ss)});break;case ks:_s.forEach(function(e){return U.addClass([t.element.querySelector("."+e)],Ss)});break;case As:Gs.forEach(function(e){return U.addClass([t.element.querySelector("."+e)],Ss)})}},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)],Ss)});break;case Hs:Ks.forEach(function(e){return U.addClass([t.element.querySelector("."+e)],Ss)});break;case Ps:Qs.forEach(function(e){return U.addClass([t.element.querySelector("."+e)],Ss)})}},l.prototype.freshOnEndForm=function(){var t=this;Xs.forEach(function(e){e=t.element.querySelector("."+e);e&&U.removeClass([e],Ss)})},l.prototype.showFormElement=function(){var t=this;Ws.forEach(function(e){e=t.element.querySelector("."+e);e&&U.removeClass([e],Ss)})},l.prototype.renderDropdowns=function(){function e(e){return new j.DropDownList({dataSource:e,popupWidth:t.getPopupWidth(),enableRtl:t.enableRtl,fields:{text:js,value:Ns},index:1,change:function(e){i.onWeekDay.setProperties({checked:!0}),i.resetFormValues(),i.triggerChangeEvent()}})}var t=this,i=this;this.repeatType=new j.DropDownList({dataSource:this.getRepeatData(),floatLabelType:"Always",enableRtl:this.enableRtl,index:this.selectedType,fields:{text:js,value:Ns},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 j.DropDownList({dataSource:this.getEndData(),popupWidth:this.getPopupWidth(),floatLabelType:"Always",placeholder:this.localeObj.getConstant("end"),enableRtl:this.enableRtl,index:1,fields:{text:js,value:Ns},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 j.DropDownList({dataSource:this.getMonthData(),fields:{text:js,value:Ns},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 H.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."+Cs)),e=e.target;e.classList.contains(Cs)?1<t.length&&(U.removeClass([e],Cs),n.triggerChangeEvent()):(U.addClass([e],Cs),n.triggerChangeEvent())})}},l.prototype.radioButtonRender=function(){var e=this;this.onMonthDay=new H.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 H.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 P.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 P.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 P.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."+Cs)),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+=Ls+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 Ls: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=(c.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()},c.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)}]},c.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))},c.prototype.refresh=function(){this.destroy(!0),this.renderEventWindow()},c.prototype.refreshRecurrenceEditor=function(){var e;this.recurrenceEditor&&(e=this.recurrenceEditor.element,this.recurrenceEditor.destroy(),this.createRecurrenceEditor(e))},c.prototype.setRecurrenceEditor=function(e){this.parent.editorTemplate&&(this.recurrenceEditor=e)},c.prototype.openEditor=function(e,t,i,n){var r;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.setEditorContent(e,t,n):this.renderFormElements(this.element.querySelector(".e-schedule-form"),e,t,n)},c.prototype.setEditorContent=function(e,t,i){switch(!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,i);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)}},c.prototype.setDialogContent=function(){this.dialogObject.content=this.getEventWindowContent(),this.dialogObject.dataBind(),this.applyFormValidation()},c.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()},c.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()},c.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},c.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},c.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},c.prototype.preventEventSave=function(e){this.parent&&!this.parent.allowKeyboardInteraction&&"Enter"===e.code&&(this.isEnterKey=!0)},c.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 p.Deferred);return this.parent.trigger(ae,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()+Ve*e.duration),i.dataBind()),r.parent.editorTemplate&&r.element.querySelector(".e-recurrenceeditor")&&!r.recurrenceEditor&&(r.recurrenceEditor=r.getInstance("e-recurrenceeditor")),s.resolve(n)}),s},c.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 p.Deferred;return this.parent.trigger(se,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},c.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},c.prototype.renderFormElements=function(e,t,i,n){var r=this;if(U.isNullOrUndefined(this.parent.editorTemplate))e.appendChild(this.getDefaultEventWindowContent()),t&&this.setEditorContent(t,i,n);else{if(t&&(this.fieldValidator&&(this.fieldValidator.destroy(),this.fieldValidator=null),this.recurrenceEditor&&(this.recurrenceEditor.destroy(),this.recurrenceEditor=null),this.destroyComponents(),this.parent.resetTemplates(["editorTemplate"]),U.EventHandler.clearEvents(e),!this.parent.isReact))for(var a=0,s=[].slice.call(e.children);a<s.length;a++){var o=s[a];U.remove(o)}var l=this.parent.element.id+"_editorTemplate",l=[].slice.call(this.parent.getEditorTemplate()(t||{},this.parent,"editorTemplate",l,!1));U.append(l,e),this.parent.renderTemplates(function(){r.element&&(r.applyFormValidation(),t)&&r.setEditorContent(t,i,n)})}},c.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(Nn)),t.appendChild(this.renderTextBox(Ln)),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 H.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},c.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()},c.prototype.createDivElement=function(e){return U.createElement("div",{className:e})},c.prototype.createInputElement=function(e,t,i){return U.createElement(i||"input",{className:e,attrs:{type:"text",name:t,value:"",id:t}})},c.prototype.getSlotDuration=function(){return this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount},c.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},c.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()}},c.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=Ve*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)},c.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 j.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 j.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},c.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 j.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 p.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},c.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()}},c.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},c.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())},c.prototype.filterDatasource=function(e,t){var i=this.parent.resourceBase.resourceCollection[e+1];return i.dataSource.filter(function(e){return e[i.groupIDField]===t})},c.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())},c.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 H.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},c.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),P.Input.createInput({element:i,floatLabelType:"Always",properties:{enableRtl:this.parent.enableRtl,placeholder:this.getFieldLabel(e)}}),t},c.prototype.getFieldName=function(e){var t="";switch(e){case Nn:t=this.fields.subject;break;case Ln: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},c.prototype.getFieldLabel=function(e){var t="";switch(e){case Nn:t=this.parent.editorTitles.subject;break;case Ln: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},c.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))},c.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"))},c.prototype.loadRecurrenceEditor=function(){this.repeatDialogObject.show(),this.recurrenceEditor&&this.repeatRule&&this.recurrenceEditor.setRecurrenceRule(this.repeatRule)},c.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))},c.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()},c.prototype.closeRepeatDialog=function(){this.repeatDialogObject.hide()},c.prototype.repeatCancelDialog=function(){this.closeRepeatDialog(),this.recurrenceEditor&&this.recurrenceEditor.setRecurrenceRule(this.repeatTempRule),this.repeatTempRule||this.repeatStatus.setProperties({checked:!1})},c.prototype.repeatOpenDialog=function(){this.repeatTempRule=this.recurrenceEditor.getRecurrenceRule()},c.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())},c.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)},c.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&&(this.fieldValidator.destroy(),this.fieldValidator=null),this.fieldValidator=new za,this.fieldValidator.renderFormValidator(n,t,this.element,this.parent.locale))},c.prototype.showDetails=function(e){this.eventData=e;for(var t=U.extend({},e,null,!0),e=this.getFormElements(kn),i=(this.cellClickAction&&(!this.cellClickAction||U.isNullOrUndefined(this.parent.editorTemplate))||0!==t[this.fields.endTime].getHours()||0!==t[this.fields.endTime].getMinutes()||this.trimAllDay(t),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)},c.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},c.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)},c.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(Ve*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()},c.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},c.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())},c.prototype.disableButton=function(e,t){e&&(e.ej2_instances[0].disabled=t)},c.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})},c.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())},c.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})},c.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())},c.prototype.resetForm=function(){this.fieldValidator.destroyToolTip(),this.resetFormFields(),this.parent.isAdaptive||!this.recurrenceEditor||this.recurrenceEditor.isDestroyed||this.recurrenceEditor.resetFields()},c.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)},c.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)}},c.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())},c.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}},c.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},c.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},c.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},c.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},c.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)},c.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},c.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},c.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))},c.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},c.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?Ze(t,y.idField,T[parseInt(i.toString(),10)],n,a):Ze(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)}},c.prototype.getEventIdFromForm=function(){return this.element.querySelector("."+Rn).getAttribute("data-id")},c.prototype.getFormElements=function(e){return e===kn?[].slice.call(this.element.querySelectorAll("."+Js)):[].slice.call(this.parent.element.querySelectorAll("."+e+" ."+Js))},c.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},c.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},c.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=""},c.prototype.getInstance=function(e){e=this.element.querySelector("."+e);return e?e.ej2_instances[0]:null},c.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()}},c.prototype.getRecurrenceEditorInstance=function(){return this.parent.isAdaptive&&!this.repeatDialogObject&&this.renderRepeatDialog(),this.recurrenceEditor},c.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()},c.prototype.detachComponents=function(){for(var e=0,t=this.getFormElements(kn);e<t.length;e++){var i=t[e];U.detach(i)}},c.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&&($e(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)},c);function c(e){this.parent=e,this.l10n=this.parent.localeObj,this.fields=this.parent.eventFields,this.eventWindowTime={startTime:new Date,endTime:new Date},this.renderEventWindow()}h.prototype.addEventListener=function(){!this.parent||this.parent&&this.parent.isDestroyed||this.parent.on(be,this.virtualScrolling,this)},h.prototype.removeEventListener=function(){!this.parent||this.parent&&this.parent.isDestroyed||this.parent.off(be,this.virtualScrolling)},h.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},h.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)},h.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("."+C),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("."+A)).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},h.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("."+A),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")},h.prototype.setItemSize=function(){this.isHorizontalScroll?this.itemSize=Ae(this.parent.activeView.element,O,this.parent.uiStateValues.isTransformed)||this.itemSize:this.itemSize=this.parent.getElementHeightFromClass(this.parent.activeView.element,O)||this.itemSize},h.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("."+A),e=this.parent.element.querySelector("."+Mt),this.parent.rowAutoHeight||(this.enableTransition=!1,U.removeClass([r,n],"e-transition")),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)},h.prototype.renderEvents=function(){this.setTabIndex();var e=this.triggerScrollEvent(ve);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(we,{}),this.parent.hideSpinner()},h.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("."+A));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("."+C),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(me),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)))},h.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(me),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))},h.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===me?i.parent.showSpinner():t===ve&&!U.isNullOrUndefined(e.eventData)&&0<e.eventData.length&&(n=e.eventData)})),n},h.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},h.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)},h.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)},h.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)},h.prototype.getCollection=function(e,t){this.translateY=e*this.itemSize;e=this.getResCollection(e,t);return this.parent.enableRtl&&(this.translateY=-this.translateY),e},h.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},h.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},h.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},h.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)},h.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)},h.prototype.updateHorizontalContent=function(e,t){this.existingDataCollection=this.parent.resourceBase.expandedResources,this.parent.resourceBase.expandedResources=t;var i=this.parent.getSelectedCells(),i=(this.focusedEle=i[i.length-1]||this.focusedEle,e.querySelector("tbody")),i=Array.from(i.querySelectorAll("tr"));"Month"===this.parent.currentView?this.updateMonthViewContent(e,t):this.updateOtherViewContent(e,t,i)},h.prototype.updateMonthViewContent=function(e,t){for(var i=e.querySelectorAll(" tr").length,n=0;n<i;n++)U.remove(e.querySelector("tbody tr"));this.parent.activeViewOptions.group.byDate?this.parent.activeView.colLevels[0]=t:this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-2]=t;t=this.parent.activeView.getContentRows();U.append(t,e.querySelector("tbody"))},h.prototype.updateOtherViewContent=function(e,t,i){for(var n=e.querySelector("tbody"),r=e.querySelector("colgroup"),a=e.querySelector("thead"),s=e.querySelector("table"),o=(this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-1]=t,new Set(t.map(function(e){return e.groupIndex}))),l=(i.forEach(function(e){e.querySelectorAll("td").forEach(function(e){var t=parseInt(e.getAttribute("data-group-index"),10);o.has(t)||e.remove()})}),[].slice.call(e.querySelector("colgroup").children)),p=0;p<l.length;p++)U.remove(l[parseInt(p.toString(),10)]);t.forEach(function(){return r.appendChild(U.createElement("col"))});for(var c=[].slice.call(e.querySelector("thead").children),p=0;p<c.length;p++)U.remove(c[parseInt(p.toString(),10)]);a.appendChild(this.parent.eventBase.createEventWrapper("",0<this.startIndex?this.startIndex:0)),this.parent.activeViewOptions.timeScale.enable&&a.appendChild(this.parent.eventBase.createEventWrapper("timeIndicator")),U.prepend([a],s);i=this.parent.activeView.getContentRows();this.mergeNewTdData(n,i)},h.prototype.mergeNewTdData=function(e,t){Array.from(e.querySelectorAll("tr")).forEach(function(s,e){var o;e<t.length&&(e=t[parseInt(e.toString(),10)],o=Array.from(s.querySelectorAll("td")),Array.from(e.querySelectorAll("td")).forEach(function(e){for(var t=parseInt(e.getAttribute("data-group-index").toString(),10),i=!1,n=0,r=o;n<r.length;n++){var a=r[n];if(t<parseInt(a.getAttribute("data-group-index").toString(),10)){s.insertBefore(e,a),i=!0;break}}i||s.appendChild(e)}))})},h.prototype.getBufferCollection=function(e,t){return this.parent.resourceBase.expandedResources.slice(e,t)},h.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)"})},h.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)},h.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}))},h.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)},h.prototype.destroy=function(){this.removeEventListener(),this.focusedEle=null};var io=h;function h(e){this.translateY=0,this.itemSize=60,this.bufferCount=3,this.renderedLength=0,this.averageRowHeight=0,this.startIndex=0,this.existingDataCollection=[],this.enableTransition=!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(ne,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(re,null,function(){t.parent.hideSpinner(),t.parent.isPrinting&&setTimeout(function(){t.parent.notify(fe,{})},100)}))})},bo.prototype.dataManagerFailure=function(e){var t=this;!this.parent||this.parent&&this.parent.isDestroyed||this.parent.trigger(Z,{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(ye,{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(ye,{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(K,e,function(e){e.cancel||t.refreshDataManager()}):i.promise.then(function(){!t.parent||t.parent&&t.parent.isDestroyed||t.parent.trigger(K,e,function(e){e.cancel||t.refreshDataManager()})}).catch(function(e){!t.parent||t.parent&&t.parent.isDestroyed||t.parent.trigger(Z,{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(Q,{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(Q,{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(Q,{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(Q,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(Q,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,h=[],d=!1;if(e instanceof Array)for(var t=0,i=e;t<i.length;t++){var n=i[t];h.push(this.getParentEvent(n,!0))}else h=this.getParentEvent(e,!0);var e=e instanceof Array?e:[e],r={requestType:"EditSeries"===p?"eventChange":"eventRemove",cancel:!1,addedRecords:[],changedRecords:[],deletedRecords:[]};if(r.data=h,"EditSeries"===p?r.changedRecords=e:r.deletedRecords=e,"EditSeries"===p&&!this.parent.uiStateValues.isIgnoreOccurrence)for(var a=h instanceof Array?h:[h],s=0,o=r.changedRecords.length;s<o;s++){var l=a[parseInt(s.toString(),10)],l=this.parent.eventBase.getEventCollections(l),l=l.follow.concat(l.occurrence);r.deletedRecords=r.deletedRecords.concat(l)}this.parent.trigger(Q,r,function(e){if(!e.cancel){for(var a=c.parent.eventFields,s={addedRecords:[],changedRecords:[],deletedRecords:[]},o=h instanceof Array?h:[h],l="EditSeries"===p?e.changedRecords:e.deletedRecords,t=0,i=l.length;t<i;t++)!function(e){var t,i=l[parseInt(e.toString(),10)],n=o[parseInt(e.toString(),10)],e=c.parent.eventBase.getEventCollections(n),r=e.follow.concat(e.occurrence);switch(p){case"EditSeries":i[a.id]=n[a.id],i[a.recurrenceID]=null,i[a.followingID]=null,c.parent.uiStateValues.isIgnoreOccurrence&&i[a.recurrenceException]?0<(t=c.parent.eventsData.filter(function(e){return e[a.id]===i[a.id]})).length&&(i[a.recurrenceRule]=t[0][a.recurrenceRule]):(i[a.recurrenceException]=null,s.deletedRecords=s.deletedRecords.concat(r)),s.changedRecords.push(c.parent.eventBase.processTimezone(i,!0)),c.parent.uiStateValues.isIgnoreOccurrence=!1;break;case"DeleteSeries":s.deletedRecords=s.deletedRecords.concat(r.concat(n)),d=!0}}(t);var n=c.parent.dataModule.dataManager.saveChanges(s,a.id,c.getTable(),c.getQuery()),r=U.extend({},l[l.length-1],null,!0),r=(c.parent.eventBase.selectWorkCellByTime("EditSeries"===p?[c.parent.eventBase.processTimezone(r)]:[r]),{requestType:"EditSeries"===p?"eventChanged":"eventRemoved",cancel:!1,data:d?e.deletedRecords:e.changedRecords,promise:n,editParams:s});c.refreshData(r)}})},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(Q,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(Q,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}}Co.prototype.cellMouseDown=function(e){this.isPreventAction(e)||this.parent.notify(Ee,{event:e})},Co.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(w),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(q,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(ue,t)):s.parent.notify(q,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"))},Co.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(F,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")}))},Co.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(X,{element:t,event:e})},Co.prototype.isPreventAction=function(e){var t;return!(U.closest(e.target,"."+Oi)||(!U.closest(e.target,"."+V)||U.closest(e.target,"."+tn))&&(t=U.closest(e.target,"."+x+",."+kt),U.isNullOrUndefined(t))&&(t=U.closest(e.target,"."+Dt),!this.parent.activeView||!this.parent.activeView.isTimelineView()||U.isNullOrUndefined(t)))},Co.prototype.destroy=function(){U.EventHandler.remove(this.parent.element,"mouseover",this.onHover)};var So=Co;function Co(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)},u=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),u([U.Property("Id")],Mo.prototype,"id",void 0),u([U.Property("IsBlock")],Mo.prototype,"isBlock",void 0),u([U.Complex({name:"Subject"},To)],Mo.prototype,"subject",void 0),u([U.Complex({name:"StartTime"},To)],Mo.prototype,"startTime",void 0),u([U.Complex({name:"EndTime"},To)],Mo.prototype,"endTime",void 0),u([U.Complex({name:"StartTimezone"},To)],Mo.prototype,"startTimezone",void 0),u([U.Complex({name:"EndTimezone"},To)],Mo.prototype,"endTimezone",void 0),u([U.Complex({name:"Location"},To)],Mo.prototype,"location",void 0),u([U.Complex({name:"Description"},To)],Mo.prototype,"description",void 0),u([U.Complex({name:"IsAllDay"},To)],Mo.prototype,"isAllDay",void 0),u([U.Complex({name:"RecurrenceID"},To)],Mo.prototype,"recurrenceID",void 0),u([U.Complex({name:"RecurrenceRule"},To)],Mo.prototype,"recurrenceRule",void 0),u([U.Complex({name:"RecurrenceException"},To)],Mo.prototype,"recurrenceException",void 0),u([U.Property("IsReadonly")],Mo.prototype,"isReadonly",void 0),u([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)},u=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),u([U.Property()],Ho.prototype,"template",void 0),u([U.Property([])],Ho.prototype,"dataSource",void 0),u([U.Property()],Ho.prototype,"query",void 0),u([U.Complex({},Vo)],Ho.prototype,"fields",void 0),u([U.Property(!1)],Ho.prototype,"enableTooltip",void 0),u([U.Property("AllDayRow")],Ho.prototype,"spannedEventPlacement",void 0),u([U.Property(1)],Ho.prototype,"minimumEventDuration",void 0),u([U.Property()],Ho.prototype,"tooltipTemplate",void 0),u([U.Property()],Ho.prototype,"resourceColorField",void 0),u([U.Property(!1)],Ho.prototype,"editFollowingEvents",void 0),u([U.Property(!0)],Ho.prototype,"allowAdding",void 0),u([U.Property(!0)],Ho.prototype,"allowEditing",void 0),u([U.Property(!0)],Ho.prototype,"allowDeleting",void 0),u([U.Property(!1)],Ho.prototype,"enableMaxHeight",void 0),u([U.Property(!1)],Ho.prototype,"enableIndicator",void 0),u([U.Property(!1)],Ho.prototype,"ignoreWhitespace",void 0),u([U.Property()],Ho.prototype,"sortComparer",void 0),u([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)},u=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(No,jo),u([U.Property(!1)],No.prototype,"byDate",void 0),u([U.Property(!0)],No.prototype,"byGroupID",void 0),u([U.Property(!1)],No.prototype,"allowGroupEdit",void 0),u([U.Property([])],No.prototype,"resources",void 0),u([U.Property(!0)],No.prototype,"enableCompactView",void 0),u([U.Property()],No.prototype,"headerTooltipTemplate",void 0),u([U.Property(!1)],No.prototype,"hideNonWorkingDays",void 0),No);function No(){return null!==jo&&jo.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,qo,u=function(e,t){function i(){this.constructor=e}Lo(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},u=(qo=U.ChildProperty,u(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}g.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($,n),e.appendChild(t)},g.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!==Nt||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))}},g.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},g.prototype.setRenderedResources=function(){var e=this.resourceCollection;this.generateTreeData(!0);this.countCalculation(e.slice(0,-2),e.slice(0,-1)),this.renderedResources=this.lastResourceLevel},g.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},g.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=Ze(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:Nt}),this.renderedResources[parseInt(s.toString(),10)].className=[Nt]),c=p*this.leftPixel+"px",e[parseInt(s.toString(),10)].resourceData.ClassName===Nt&&!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:Lt,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($,p),r.cloneNode());c.appendChild(o),i.push(c)}return i},g.prototype.setMargin=function(e,t){this.parent.enableRtl?e.style.marginRight=t:e.style.marginLeft=t},g.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 p.Query).where(t[t.length-1].groupIDField,"equal",n[parseInt(r.toString(),10)][e[e.length-(i+1)].idField]),new p.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)}},g.prototype.onTreeIconClick=function(r){var a,s=this,o=(this.parent.eventTooltip&&this.parent.eventTooltip.close(),r.target),e=U.closest(o,"."+Nt).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(Q,p,function(e){if(!e.cancel){a=o.classList.contains(qt)?(U.classList(o,[Lt],[qt]),!0):(U.classList(o,[qt],[Lt]),!1);for(var t=0,i=[].slice.call(s.parent.element.querySelectorAll("."+x+",."+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(K,p)}})},g.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("."+A+" tbody tr")),l=[].slice.call(this.parent.element.querySelectorAll("."+A+" ."+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(Nt);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,[Lt],[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],[Lt]),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))}},g.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("."+A+" 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("."+C).offsetHeight+"px")},g.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("."+A)).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)},g.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(Oe,this.documentClick,this)},g.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())},g.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},g.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);$e(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)},g.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))},g.prototype.selectResourceByIndex=function(e){this.lastResourceLevel&&-1<e&&e<this.lastResourceLevel.length&&this.triggerEvents(e)},g.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())},g.prototype.triggerEvents=function(e,t){var i=this,n={cancel:!1,event:t?t.event:null,groupIndex:e,requestType:"resourceChange"};this.parent.trigger(Q,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(K,n))})},g.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))},g.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)})},g.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)}},g.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}},g.prototype.refreshLayout=function(e){!U.isNullOrUndefined(this.parent.uiStateValues.groupIndex)&&this.parent.enablePersistence||(this.parent.uiStateValues.groupIndex=0),this.parent.renderElements(e)},g.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=Ze(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)},g.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)},g.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},g.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 S=[],C=0,j=function(a){O.resourceDateTree[parseInt(C.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(C.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 S[parseInt(n.toString(),10)]||(S[parseInt(n.toString(),10)]=[]),i=r.renderDates.filter(function(e){return e.getDay()===a.date.getDay()}),S[parseInt(n.toString(),10)]=S[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)}C++},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){S[parseInt(t.toString(),10)]&&(e.renderDates=S[parseInt(t.toString(),10)].sort(function(e,t){return e.getTime()-t.getTime()}))})}else{for(var x=0,A=0,N=D[0];A<N.length;A++)x+=N[A].colSpan;for(var I=0,L=i;I<L.length;I++){(M=L[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},g.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])}},g.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},g.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},g.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},g.prototype.filterData=function(e,t,i){return e.filter(function(e){return e[""+t]===i})},g.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)])},g.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 p.DataManager({json:i.dataSource}).insert(e,null,null,n+t)}),"break"}(a[i]);i++);this.refreshLayout(!0)},g.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 p.DataManager({json:t.dataSource}).remove(t.idField,e)}),"break"}(r[t]);t++);this.refreshLayout(!0)},g.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))},g.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(Lt)&&!e||a.classList.contains(qt)&&e)&&a.click()},g.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("."+A),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)]))},g.prototype.destroy=function(){this.parent.off(Oe,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=g;function g(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)},m=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(v,Xo),v.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 So(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()},v.prototype.renderTableContainer=function(){this.element.querySelector("."+gt)||this.element.appendChild(this.createElement("div",{className:gt}))},v.prototype.getEventTemplateName=function(e){e="eventTemplate_"+e;return this.activeEventTemplates.indexOf(e)<0&&this.activeEventTemplates.push(e),e},v.prototype.getElementWidth=function(e){return rt(e,this.uiStateValues.isTransformed)},v.prototype.getElementHeight=function(e){return at(e,this.uiStateValues.isTransformed)},v.prototype.getElementHeightFromClass=function(e,t){return xe(e,t,this.uiStateValues.isTransformed)},v.prototype.renderTemplates=function(e){this.isReact?this.renderReactTemplates(e):e&&e()},v.prototype.resetTemplates=function(e){(this.isAngular||this.isReact)&&this.clearTemplate(e)},v.prototype.sanitize=function(e,t){this.enableHtmlSanitizer?t.innerText=U.SanitizeHtmlHelper.sanitize(e):t.innerHTML=e},v.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))},v.prototype.destroyEditorWindow=function(){this.eventWindow&&(this.eventWindow.destroy(),this.eventWindow=null),this.eventWindow=new to(this)},v.prototype.renderElements=function(e){e?(this.initializeView(this.currentView),this.eventWindow.refresh()):(this.destroyHeaderModule(),this.showHeaderBar&&(this.headerModule=new Ir(this)),this.renderTableContainer(),this.uiStateValues.isTransformed=Math.round(this.element.getBoundingClientRect().width)!==this.element.offsetWidth,(U.Browser.isDevice||U.Browser.isTouch)&&(this.scheduleTouchModule=new Rr(this)),this.initializeView(this.currentView),this.destroyPopups(),this.isPrinting||this.initializePopups())},v.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()},v.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},v.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)}},v.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},v.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)},v.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")}},v.prototype.initializeView=function(e){this.showSpinner(),this.activeViewOptions=this.getActiveViewOptions(),this.resourceBase&&this.resourceBase.setResourceCollection(),this.initializeTemplates(),this.renderModule.render(e)},v.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)},v.prototype.initializePopups=function(){this.eventWindow=new to(this),this.quickPopup=new _a(this)},v.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},v.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},v.prototype.getCalendarMode=function(){return U.isNullOrUndefined(this.calendarMode)?"gregorian":this.calendarMode.toLowerCase()},v.prototype.getTimeString=function(e){return this.globalize.formatDate(e,{format:this.activeViewOptions.timeFormat,type:"time",calendar:this.getCalendarMode()}).toLocaleUpperCase()},v.prototype.getDateTime=function(e){return e instanceof Date?new Date(e.getTime()):new Date(e)},v.prototype.setCalendarMode=function(){"Islamic"===this.calendarMode?this.calendarUtil=new Fr:this.calendarUtil=new Lr},v.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(Q,{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(J,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(K,a))}))}))},v.prototype.changeDate=function(t,i){var n,r=this;this.trigger(Q,{requestType:"dateNavigate",cancel:!1,event:i},function(e){e.cancel||(e={action:"date",cancel:!1,previousDate:r.selectedDate,currentDate:t},r.trigger(J,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(K,n))}))})},v.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()},v.prototype.isSelectedDate=function(e){return e.setHours(0,0,0,0)===new Date(""+this.selectedDate).setHours(0,0,0,0)},v.prototype.getCurrentTime=function(e){return void 0===e&&(e=new Date),this.timezone?this.tzModule.convert(e,this.tzModule.getLocalTimezoneName(),this.timezone):e},v.prototype.getNavigateView=function(){return this.activeView.isTimelineView()?"TimelineMonth"===this.currentView||"TimelineYear"===this.currentView?"TimelineDay":"Agenda":"Day"},v.prototype.animateLayout=function(){this.activeView.element&&new U.Animation({duration:600,name:"FadeIn",timingFunction:"easeIn"}).animate(this.activeView.element)},v.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},v.prototype.preRender=function(){this.isAdaptive=U.Browser.isDevice||nt(),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,isTransformed:!1}),this.currentTimezoneDate=this.getCurrentTime(),this.activeCellsData={startTime:new Date(this.currentTimezoneDate),endTime:new Date(this.currentTimezoneDate),isAllDay:!1},this.activeEventData={event:void 0,element:void 0},this.getDefaultLocale(),this.localeObj=new 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()},v.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"}},v.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)},v.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=[])},v.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}))},v.prototype.selectCell=function(e){this.removeSelectedClass(),this.addSelectedClass([e],e)},v.prototype.getAllDayRow=function(){return this.element.querySelector("."+vt)},v.prototype.getContentTable=function(){return this.activeView.element.querySelector("."+C+" tbody")},v.prototype.getTableRows=function(){return[].slice.call(this.element.querySelectorAll("."+C+" tbody tr:not(."+sr+")"))},v.prototype.getWorkCellElements=function(){return[].slice.call(this.element.querySelectorAll("."+O))},v.prototype.getIndexOfDate=function(e,t){return e.map(Number).indexOf(+t)},v.prototype.isAllDayCell=function(e){return!(!(-1<["Month","TimelineMonth","TimelineYear","MonthAgenda"].indexOf(this.currentView)||e.classList.contains(w)||e.classList.contains(Dt))&&this.activeViewOptions.timeScale.enable&&!(this.activeView.isTimelineView()&&0<this.activeViewOptions.headerRows.length&&"Hour"!==this.activeViewOptions.headerRows.slice(-1)[0].option))},v.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)},v.prototype.getTargetElement=function(e,t,i){var n,t=document.elementFromPoint(t,i);return(n=t?t.closest(e):n)?[n]:null},v.prototype.getCellHeaderTemplate=function(){return this.cellHeaderTemplateFn},v.prototype.getDayHeaderTemplate=function(){return this.dayHeaderTemplateFn},v.prototype.getMonthHeaderTemplate=function(){return this.monthHeaderTemplateFn},v.prototype.getCellTemplate=function(){return this.cellTemplateFn},v.prototype.getDateHeaderTemplate=function(){return this.dateHeaderTemplateFn},v.prototype.getDateRangeTemplate=function(){return this.dateRangeTemplateFn},v.prototype.getMajorSlotTemplate=function(){return this.majorSlotTemplateFn},v.prototype.getMinorSlotTemplate=function(){return this.minorSlotTemplateFn},v.prototype.getAppointmentTemplate=function(){return this.appointmentTemplateFn},v.prototype.getEventTooltipTemplate=function(){return this.eventTooltipTemplateFn},v.prototype.getHeaderTooltipTemplate=function(){return this.headerTooltipTemplateFn},v.prototype.getEditorTemplate=function(){return this.editorTemplateFn},v.prototype.getEditorHeaderTemplate=function(){return this.editorHeaderTemplateFn},v.prototype.getEditorFooterTemplate=function(){return this.editorFooterTemplateFn},v.prototype.getQuickInfoTemplatesHeader=function(){return this.quickInfoTemplatesHeaderFn},v.prototype.getQuickInfoTemplatesContent=function(){return this.quickInfoTemplatesContentFn},v.prototype.getQuickInfoTemplatesFooter=function(){return this.quickInfoTemplatesFooterFn},v.prototype.getResourceHeaderTemplate=function(){return this.resourceHeaderTemplateFn},v.prototype.getHeaderIndentTemplate=function(){return this.headerIndentTemplateFn},v.prototype.getCssProperties=function(){return{border:this.enableRtl?"borderLeftWidth":"borderRightWidth",padding:this.enableRtl?"paddingLeft":"paddingRight",rtlBorder:this.enableRtl?"borderRightWidth":"borderLeftWidth",rtlPadding:this.enableRtl?"paddingRight":"paddingLeft"}},v.prototype.removeNewEventElement=function(){var e=this.element.querySelector("."+Pi);U.isNullOrUndefined(e)||U.remove(e)},v.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)},v.prototype.onDocumentClick=function(e){this.notify(Oe,{event:e})},v.prototype.onScheduleResize=function(){var e,t;U.isNullOrUndefined(this.activeView)||(this.isAdaptive||it())&&document.activeElement&&document.activeElement.classList.contains(Nn)||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(),Ke(),"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.virtualScrollModule&&!this.virtualScrollModule.enableTransition&&(e=this.element.querySelector("."+Ht),t=this.element.querySelector("."+A),this.virtualScrollModule.enableTransition=!0,U.addClass([t,e],"e-transition"))):this.notify(we,{}))},v.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)}},v.prototype.getSelectedCells=function(){return[].slice.call(this.element.querySelectorAll("."+ni))},v.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},v.prototype.boundaryValidation=function(e,t){var i={left:!1,right:!1,top:!1,bottom:!1},n=this.element.querySelector("."+A).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},v.prototype.getWeekNumberContent=function(e){var t,i,n;return"FirstDay"===this.weekRule?(t=Re(e.slice(-1)[0],this.firstDayOfWeek),t=this.globalize.formatNumber(je(t))):"FirstFourDayWeek"===this.weekRule?(i=Ne(n=ke(e.slice(-1)[0],this.firstDayOfWeek),Re(e.slice(-1)[0],this.firstDayOfWeek)),t=this.globalize.formatNumber(je(i))):"FirstFullWeek"===this.weekRule&&(n=ke(e.slice(-1)[0],this.firstDayOfWeek),t=this.globalize.formatNumber(je(n))),t},v.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))},v.prototype.isSpecificResourceEvents=function(){return 0<this.activeViewOptions.group.resources.length&&!this.activeViewOptions.group.allowGroupEdit&&!this.rowAutoHeight&&!this.virtualScrollModule&&this.activeViewOptions.group.byGroupID},v.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)},v.prototype.getModuleName=function(){return"schedule"},v.prototype.getPersistData=function(){return this.addOnPersist(["currentView","selectedDate","scrollTop","scrollLeft","adaptiveGroupIndex"])},v.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)}},v.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())},v.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("."+w)))[0].style.height=t.style.height||e[1].style.height)),this.uiStateValues.expand||(t.style.height="")},v.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(Ce,{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}},v.prototype.setRtlClass=function(){this.enableRtl?U.addClass([this.element],"e-rtl"):U.removeClass([this.element],"e-rtl")},v.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())},v.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}},v.prototype.destroyHeaderModule=function(){this.headerModule&&(this.headerModule.destroy(),this.headerModule=null)},v.prototype.destroyPopups=function(){this.quickPopup&&(this.quickPopup.destroy(),this.quickPopup=null),this.eventWindow&&(this.eventWindow.destroy(),this.eventWindow=null)},v.prototype.showSpinner=function(){M.showSpinner(this.element)},v.prototype.hideSpinner=function(){M.hideSpinner(this.element)},v.prototype.setWorkHours=function(e,t,i,n){e=this.getWorkHourCells(e,t,i,n);U.addClass(e,ft)},v.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))},v.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*Ve/this.activeViewOptions.timeScale.slotCount,l=(a.getTimezoneOffset()-t.getTimezoneOffset())*Ve,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},v.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(w)||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},v.prototype.getSelectedElements=function(){return this.keyboardInteractionModule&&0<this.keyboardInteractionModule.selectedCells.length?this.keyboardInteractionModule.selectedCells:this.getSelectedCells()},v.prototype.getResourceCollections=function(){return this.resourceCollection},v.prototype.setResourceCollections=function(e,t){!(t=void 0===t?!0:t)&&this.uiStateValues&&(this.uiStateValues.isPreventEventRefresh=!0),this.setProperties({resources:e},!1)},v.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)},v.prototype.getCurrentViewIndex=function(){return this.viewIndex},v.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})},v.prototype.expandResource=function(e,t){this.activeView.isTimelineView()&&this.resourceBase&&1<this.resourceCollection.length&&this.resourceBase.resourceExpand(e,t,!1)},v.prototype.collapseResource=function(e,t){this.activeView.isTimelineView()&&this.resourceBase&&1<this.resourceCollection.length&&this.resourceBase.resourceExpand(e,t,!0)},v.prototype.scrollTo=function(e,t){this.currentView.indexOf("Agenda")<0&&U.isNullOrUndefined(this.element.querySelector(".e-work-cells"))||(this.activeView.scrollToDate&&U.isNullOrUndefined(e)&&t?this.activeView.scrollToDate(t):this.activeView.scrollToHour&&this.activeView.scrollToHour(e,t))},v.prototype.scrollToResource=function(e,t){this.resourceBase&&this.resourceBase.lastResourceLevel&&this.resourceBase.resourceScroll(e,t)},v.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)},v.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)},v.prototype.addEvent=function(e){this.crudModule.addEvent(e)},v.prototype.generateEventOccurrences=function(e,t){return this.eventBase?this.eventBase.generateOccurrence(e,t):[]},v.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)},v.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)},v.prototype.saveEvent=function(e,t){this.crudModule.saveEvent(e,t)},v.prototype.deleteEvent=function(e,t){this.crudModule.deleteEvent(e,t)},v.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)},v.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)},v.prototype.getOccurrencesByID=function(e){return this.eventBase.getOccurrencesByID(e)},v.prototype.getOccurrencesByRange=function(e,t){return e=this.getDateTime(e),t=this.getDateTime(t),this.eventBase.getOccurrencesByRange(e,t)},v.prototype.getCurrentViewDates=function(){return this.activeView?this.activeView.renderDates:[]},v.prototype.setRecurrenceEditor=function(e){this.eventWindow.setRecurrenceEditor(e)},v.prototype.getEventMaxID=function(){return this.eventBase.getEventMaxID()},v.prototype.getDeletedOccurrences=function(e){return this.eventBase.getDeletedOccurrences(e)},v.prototype.getCurrentViewEvents=function(){return this.eventsProcessed},v.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))},v.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)}},v.prototype.refreshLayout=function(){this.onScheduleResize(),this.headerModule&&this.headerModule.refresh(),this.eventWindow&&this.eventWindow.refresh()},v.prototype.getEventDetails=function(e){e=(e=U.getElement(e)).getAttribute("data-guid");return e?this.eventBase.getEventByGuid(e):{}},v.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))},v.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)},v.prototype.closeEditor=function(){this.eventWindow&&this.eventWindow.dialogClose()},v.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(q,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(ee,this.activeEventData))))},v.prototype.closeQuickInfoPopup=function(){this.quickPopup&&this.quickPopup.quickPopupHide(!0)},v.prototype.closeTooltip=function(){this.eventTooltip&&this.eventTooltip.close()},v.prototype.selectResourceByIndex=function(e){this.resourceBase&&this.uiStateValues.isGroupAdaptive&&this.resourceBase.selectResourceByIndex(e)},v.prototype.getIndexFromResourceId=function(e,t){return this.resourceBase?this.resourceBase.getIndexFromResourceId(e,t):null},v.prototype.addResource=function(e,t,i){this.resourceBase.addResource(e,t,i)},v.prototype.removeResource=function(e,t){this.resourceBase.removeResource(e,t)},v.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;$e(this.element);var i=[ot,lt,pt,ht];this.cssClass&&(i=i.concat(this.cssClass.split(" "))),U.removeClass([this.element],i)},m([U.Property("auto")],v.prototype,"width",void 0),m([U.Property("auto")],v.prototype,"height",void 0),m([U.Property(!0)],v.prototype,"showHeaderBar",void 0),m([U.Property(!0)],v.prototype,"showTimeIndicator",void 0),m([U.Property(!0)],v.prototype,"allowSwiping",void 0),m([U.Collection([],Fo)],v.prototype,"toolbarItems",void 0),m([U.Property("Week")],v.prototype,"currentView",void 0),m([U.Property(["Day","Week","WorkWeek","Month","Agenda"])],v.prototype,"views",void 0),m([U.Property(new Date)],v.prototype,"selectedDate",void 0),m([U.Property(new Date(1900,0,1))],v.prototype,"minDate",void 0),m([U.Property(new Date(2099,11,31))],v.prototype,"maxDate",void 0),m([U.Property()],v.prototype,"dateFormat",void 0),m([U.Property("Gregorian")],v.prototype,"calendarMode",void 0),m([U.Property(!0)],v.prototype,"showWeekend",void 0),m([U.Property(0)],v.prototype,"firstDayOfWeek",void 0),m([U.Property("FirstDay")],v.prototype,"weekRule",void 0),m([U.Property([1,2,3,4,5])],v.prototype,"workDays",void 0),m([U.Property(12)],v.prototype,"monthsCount",void 0),m([U.Property("00:00")],v.prototype,"startHour",void 0),m([U.Property("24:00")],v.prototype,"endHour",void 0),m([U.Property(null)],v.prototype,"timeFormat",void 0),m([U.Property(!0)],v.prototype,"enableHtmlSanitizer",void 0),m([U.Property(!1)],v.prototype,"enableAllDayScroll",void 0),m([U.Property(!1)],v.prototype,"enableAdaptiveUI",void 0),m([U.Property(!0)],v.prototype,"allowResizing",void 0),m([U.Complex({},Za)],v.prototype,"workHours",void 0),m([U.Complex({},Ja)],v.prototype,"timeScale",void 0),m([U.Property(!0)],v.prototype,"allowKeyboardInteraction",void 0),m([U.Property(!0)],v.prototype,"allowDragAndDrop",void 0),m([U.Property()],v.prototype,"dateHeaderTemplate",void 0),m([U.Property()],v.prototype,"dateRangeTemplate",void 0),m([U.Property()],v.prototype,"cellHeaderTemplate",void 0),m([U.Property()],v.prototype,"dayHeaderTemplate",void 0),m([U.Property()],v.prototype,"monthHeaderTemplate",void 0),m([U.Property()],v.prototype,"cellTemplate",void 0),m([U.Property(!1)],v.prototype,"readonly",void 0),m([U.Property(!0)],v.prototype,"showQuickInfo",void 0),m([U.Property(!1)],v.prototype,"allowInline",void 0),m([U.Property(!0)],v.prototype,"allowMultiCellSelection",void 0),m([U.Property(!0)],v.prototype,"allowMultiRowSelection",void 0),m([U.Property(!1)],v.prototype,"quickInfoOnSelectionEnd",void 0),m([U.Property(!1)],v.prototype,"showWeekNumber",void 0),m([U.Property(!1)],v.prototype,"rowAutoHeight",void 0),m([U.Property(!1)],v.prototype,"allowMultiDrag",void 0),m([U.Property(0)],v.prototype,"firstMonthOfYear",void 0),m([U.Property()],v.prototype,"editorTemplate",void 0),m([U.Property()],v.prototype,"editorHeaderTemplate",void 0),m([U.Property()],v.prototype,"editorFooterTemplate",void 0),m([U.Complex({},co)],v.prototype,"quickInfoTemplates",void 0),m([U.Property(7)],v.prototype,"agendaDaysCount",void 0),m([U.Property(!0)],v.prototype,"hideEmptyAgendaDays",void 0),m([U.Property(!0)],v.prototype,"enableRecurrenceValidation",void 0),m([U.Property()],v.prototype,"timezone",void 0),m([U.Complex({},To)],v.prototype,"eventSettings",void 0),m([U.Property(zr)],v.prototype,"timezoneDataSource",void 0),m([U.Property()],v.prototype,"resourceHeaderTemplate",void 0),m([U.Property()],v.prototype,"headerIndentTemplate",void 0),m([U.Complex({},Vo)],v.prototype,"group",void 0),m([U.Collection([],u)],v.prototype,"resources",void 0),m([U.Collection([],mo)],v.prototype,"headerRows",void 0),m([U.Property()],v.prototype,"cssClass",void 0),m([U.Property()],v.prototype,"eventDragArea",void 0),m([U.Event()],v.prototype,"created",void 0),m([U.Event()],v.prototype,"destroyed",void 0),m([U.Event()],v.prototype,"cellClick",void 0),m([U.Event()],v.prototype,"cellDoubleClick",void 0),m([U.Event()],v.prototype,"moreEventsClick",void 0),m([U.Event()],v.prototype,"hover",void 0),m([U.Event()],v.prototype,"select",void 0),m([U.Event()],v.prototype,"actionBegin",void 0),m([U.Event()],v.prototype,"actionComplete",void 0),m([U.Event()],v.prototype,"actionFailure",void 0),m([U.Event()],v.prototype,"navigating",void 0),m([U.Event()],v.prototype,"renderCell",void 0),m([U.Event()],v.prototype,"eventClick",void 0),m([U.Event()],v.prototype,"eventDoubleClick",void 0),m([U.Event()],v.prototype,"eventRendered",void 0),m([U.Event()],v.prototype,"dataBinding",void 0),m([U.Event()],v.prototype,"popupOpen",void 0),m([U.Event()],v.prototype,"popupClose",void 0),m([U.Event()],v.prototype,"dragStart",void 0),m([U.Event()],v.prototype,"drag",void 0),m([U.Event()],v.prototype,"dragStop",void 0),m([U.Event()],v.prototype,"resizeStart",void 0),m([U.Event()],v.prototype,"resizing",void 0),m([U.Event()],v.prototype,"resizeStop",void 0),m([U.Event()],v.prototype,"virtualScrollStart",void 0),m([U.Event()],v.prototype,"virtualScrollStop",void 0),m([U.Event()],v.prototype,"dataBound",void 0),m([U.NotifyPropertyChanges],v));function v(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("."+A),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("."+Ni))||(i=U.createElement("div",{className:Ni}),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?Li: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("."+Ni);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("."+A),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("."+V)?e.querySelector("."+V).appendChild(t):((n=U.createElement("div",{className:V})).appendChild(t),e.appendChild(n))},Ko.prototype.createAppointmentElement=function(e,t){t=U.createElement("div",{className:x,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,"."+x),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(ce,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=p.parent.getElementWidth(t),p.actionObj.cellHeight=p.parent.getElementHeight(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 La(p.parent)),p.parent.element.querySelector("."+A));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(he,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(de,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+=this.parent.getElementWidth(this.actionObj.clone)-this.actionObj.cellWidth),p=s?Math.floor(d/Math.floor(this.parent.getElementWidth(l)/g)):Math.round(d/(this.parent.getElementWidth(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+(this.parent.getElementWidth(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:this.parent.getElementWidth(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+=this.parent.getElementWidth(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?this.parent.getElementWidth(this.actionObj.element):0)/this.actionObj.cellWidth)*this.actionObj.cellWidth,g=Math.ceil((this.parent.getElementWidth(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("."+A),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?this.parent.getElementWidth(this.actionObj.element)/this.actionObj.cellWidth*this.actionObj.cellWidth:"Month"===this.parent.currentView?this.parent.getElementWidth(this.actionObj.element):Math.ceil(this.parent.getElementWidth(this.actionObj.element)/this.actionObj.cellWidth)*this.actionObj.cellWidth,p=l+Math.ceil(o/this.actionObj.cellWidth)*this.actionObj.cellWidth,c=this.parent.enableRtl?parseInt(this.actionObj.element.style.right,10):this.actionObj.clone.offsetLeft,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?this.parent.getElementWidth(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?this.parent.getElementWidth(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-this.parent.getElementWidth(this.actionObj.clone)?parseInt(this.actionObj.clone.style.right,10):c:t&&this.actionObj.pageX>this.actionObj.X+this.parent.getElementWidth(this.actionObj.clone)&&this.parent.getElementWidth(this.actionObj.clone)===this.actionObj.cellWidth?parseInt(this.actionObj.clone.style.left,10):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,this.parent.getElementWidth(this.actionObj.clone))),i=Math.ceil(this.parent.getElementWidth(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?"."+x:"."+V+",."+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(we,{})},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=ke(n,this.parent.firstDayOfWeek),o=z(Re(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:x}))}},nl.prototype.timelineYearViewEvents=function(){for(var n,r=this,e=this.parent.element.querySelector("."+O+":not(."+E+")"),e=(this.cellWidth=this.parent.getElementWidth(e),this.cellHeader=Je(e.querySelector("."+Ei)),this.parent.element.querySelector("."+Mt)),t=(this.eventHeight=this.parent.getElementHeightFromClass(e,x),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:V}),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("."+V))||(c=U.createElement("div",{className:V}),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,S=w.length;b<S;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,S);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("."+C+" tbody tr")),e.forEach(function(e,t){var e=[].slice.call(e.querySelectorAll("."+x)),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("."+A),t=e.offsetWidth>e.clientWidth,n=this.parent.element.querySelector("."+O),n=(this.cellWidth=this.parent.getElementWidth(n),this.cellHeader=0,this.parent.element.querySelector("."+Mt)),r=(this.eventHeight=this.parent.getElementHeightFromClass(n,x),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("."+x)).forEach(function(e){e.style.removeProperty("left"),e.style.removeProperty("right")}),n=[].slice.call(this.parent.element.querySelectorAll("."+li)),s=this.parent.element.querySelector("."+C),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=o.parent.getElementWidth(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:V}),e=(e.appendChild(h),z(Pe(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(ie,{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(Pe(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:x,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:Nn,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=Ue(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("."+C)},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("."+A).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.floor(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"),this.isPreventMultiDrag&&(r=U.formatUnit(this.actionObj.clone.offsetTop))),{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)),a=(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(oe,a,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.enableCurrentViewDrag=a.dragWithinRange&&!a.navigation.enable&&n.parent.allowMultiDrag,n.actionObj.excludeSelectors=e.excludeSelectors,t=n.parent.element.querySelector("."+A),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 La(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(le,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=We(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())/Ve)},y.prototype.dragStop=function(e){var t,i,n=this;this.isCursorAhead=!1,this.isPreventMultiDrag=!1,this.removeCloneElementClasses(),this.removeCloneElement(),clearInterval(this.actionObj.navigationInterval),this.actionObj.navigationInterval=null,clearInterval(this.actionObj.scrollInterval),this.actionObj.scrollInterval=null,this.actionClass("removeClass"),this.parent.uiStateValues.action=this.parent.uiStateValues.isTapHold=!1,this.isAllowDrop(e)||(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(pe,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:this.parent.getElementWidth(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("."+V))||(t=U.createElement("div",{className:V}),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:"."+V;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("."+w+":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("."+V));a||(a=U.createElement("div",{className:V}),e[this.actionObj.index].appendChild(a)),a.appendChild(this.actionObj.clone)}},y.prototype.viewNavigation=function(e){var t,i=this.parent.element.querySelector("."+A);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("."+V))||(t=U.createElement("div",{className:V}),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(w))){this.parent.activeViewOptions.timeScale.enable&&this.swapDragging(e);var e=this.parent.element.querySelector("."+A),t=U.extend({},this.actionObj.event,null,!0),n=t[this.parent.eventFields.startTime],t=tt(t[this.parent.eventFields.endTime])-tt(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(w)||(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.enableCurrentViewDrag&&0!==this.multiData.length||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());var d,u=a[this.parent.eventFields.startTime].getTime()-this.startTime;if(this.enableCurrentViewDrag)for(var g=this.getRenderedDates(),m=0;m<this.multiData.length;m++){var v=U.extend({},this.multiData[parseInt(m.toString(),10)],null,!0),v=new Date(v[this.parent.eventFields.startTime].getTime()+u);if((f=this.parent.getIndexOfDate(g,W(v)))<0){this.isPreventMultiDrag=!0;break}this.isPreventMultiDrag=!1}if(!this.isPreventMultiDrag)for(var f,y,T=0;T<this.multiData.length;T++)this.updatedData[parseInt(T.toString(),10)]=this.updateMultipleData(this.multiData[parseInt(T.toString(),10)],u),0<=(f=this.getDayIndex(this.updatedData[parseInt(T.toString(),10)]))?(y=this.updatedData[parseInt(T.toString(),10)][this.parent.eventFields.isAllDay],h=this.getEventWrapper(f,y),this.appendCloneElement(h,this.actionObj.cloneElement[parseInt(T.toString(),10)]),this.updateEventHeight(this.updatedData[parseInt(T.toString(),10)],T,f)):U.isNullOrUndefined(this.actionObj.cloneElement[parseInt(T.toString(),10)].parentNode)||U.remove(this.actionObj.cloneElement[parseInt(T.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("."+V))[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){if(!this.isPreventMultiDrag){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("."+w+":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(),tt(e[this.parent.eventFields.endTime])-tt(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=tt(e[this.parent.eventFields.startTime])-tt(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=tt(i[this.parent.eventFields.endTime])-tt(i[this.parent.eventFields.startTime]),r=this.parent.enableRtl?Math.abs(this.actionObj.clone.offsetLeft)-this.actionObj.clone.offsetWidth:parseInt(this.actionObj.clone.style.left,10),r=Math.round(r/this.actionObj.cellWidth)*this.actionObj.cellWidth,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("."+A),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*Ve,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("."+A),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.round(e/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/Ve/(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("."+A),n=[].slice.call(this.parent.element.querySelectorAll(".e-content-wrap .e-content-table tr:not(.e-hidden)")),r=Ie(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,this.parent.uiStateValues.isTransformed))/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("."+V),i=(a||(a=U.createElement("div",{className:V}),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=this.parent.getElementHeight(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(x)?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:"."+V).item(e):(i=(t=this.parent.element.querySelectorAll("."+O).item(e)).querySelector("."+V))||(i=U.createElement("div",{className:V}),t.appendChild(i)),i},y.prototype.getAllDayEventHeight=function(){var e=U.createElement("div",{className:x}),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.enableCurrentViewDrag=!1,e.isPreventMultiDrag=!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(Lt)||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(we,{})},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?Qe():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+=Je(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),qe(e)<qe(t))||qe(e)>=qe(i)||!this.isWorkDay(e,n))},T.prototype.getRenderDates=function(e){var t=[];if("Week"===this.parent.currentView||"TimelineWeek"===this.parent.currentView)for(var i=ke(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=ke(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("."+A+" col, ."+Tt+" col"))},T.prototype.setColWidth=function(e){var t,i,n;this.isTimelineView()&&(t=this.getColElements(),n=this.element.querySelector("."+C+" tbody"),i=this.parent.getElementWidth(n)/(t.length/2),e.offsetHeight!==e.clientHeight&&(n=this.parent.element.querySelector("."+Ht),U.isNullOrUndefined(n)||n.offsetHeight===e.clientHeight||U.setStyleAttribute(n,{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("."+A)},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)})(D,ol=Ja),D.prototype.getModuleName=function(){return"verticalView"},D.prototype.addEventListener=function(){this.parent.on(Se,this.scrollUiUpdate,this),this.parent.on(ye,this.renderEvents,this)},D.prototype.removeEventListener=function(){this.parent&&(this.parent.off(Se,this.scrollUiUpdate),this.parent.off(ye,this.renderEvents))},D.prototype.renderEvents=function(){this.appointment=new(this.parent.activeViewOptions.timeScale.enable?Pa:La)(this.parent),this.appointment.renderAppointments(),this.parent.notify(Te,{})},D.prototype.onContentScroll=function(e){this.parent.removeNewEventElement();var t=e.target;this.parent.notify(be,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()},D.prototype.onAdaptiveMove=function(e){this.parent.uiStateValues.action&&e.preventDefault()},D.prototype.onAdaptiveScroll=function(e){this.parent&&!this.parent.isDestroyed&&(this.parent.removeNewEventElement(),this.parent.uiStateValues.top=e.target.scrollTop)},D.prototype.scrollLeftPanel=function(e){var t=this.getLeftPanelElement();U.isNullOrUndefined(t)||(t.scrollTop=e.scrollTop)},D.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=Qe(),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))},D.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)},D.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)},D.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("."+C),this.getScrollableElement().scrollLeft=-(i.offsetWidth-t.offsetLeft-t.offsetWidth)):this.getScrollableElement().scrollLeft=t.offsetLeft),U.isNullOrUndefined(e)||(this.getScrollableElement().scrollTop=this.getTopFromDateTime(e))},D.prototype.scrollToDate=function(e){this.scrollToHour(null,e)},D.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},D.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(St),r.push({date:p,type:"dateHeader",className:c,colSpan:1,workDays:t,startHour:new Date(+a),endHour:new Date(+s)})}return r},D.prototype.isWorkHourRange=function(e){return this.getStartHour().getTime()<=e.getTime()&&this.getEndHour().getTime()>=e.getTime()},D.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&&!U.isNullOrUndefined(this.element.querySelector("."+O))?(this.changeCurrentTimePosition(),U.isNullOrUndefined(this.currentTimeIndicatorTimer)&&((e=Ve-(1e3*e.getSeconds()+e.getMilliseconds()))<=59e3&&window.setTimeout(function(){U.isNullOrUndefined(t.currentTimeIndicatorTimer)||(t.clearCurrentTimeIndicatorTimer(),t.changeCurrentTimePosition(),t.updateCurrentTimeIndicatorTimer())},e),this.updateCurrentTimeIndicatorTimer())):this.clearCurrentTimeIndicatorTimer())},D.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},D.prototype.clearCurrentTimeIndicatorTimer=function(){U.isNullOrUndefined(this.currentTimeIndicatorTimer)||(window.clearInterval(this.currentTimeIndicatorTimer),this.currentTimeIndicatorTimer=null,this.removeCurrentTimeIndicatorElements())},D.prototype.updateCurrentTimeIndicatorTimer=function(){var e=this;this.currentTimeIndicatorTimer=window.setInterval(function(){e.changeCurrentTimePosition()},Ve)},D.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)}},D.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.length>c&&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))}}},D.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},D.prototype.getWorkCellHeight=function(){return parseFloat(this.parent.getElementHeight(this.element.querySelector("."+O)).toFixed(2))},D.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},D.prototype.refreshHeader=function(){U.remove(this.element.querySelector("tbody tr")),this.renderHeader(),this.parent.notify(we,{});var e=this.element.querySelector("."+Tt);e&&(e.scrollLeft=this.parent.uiStateValues.left)},D.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(we,{})},D.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"))},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,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)},D.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:[w],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},D.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},D.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=[w],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)},D.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($,i),t},D.prototype.wireCellEvents=function(e){U.EventHandler.add(e,"mousedown",this.parent.workCellAction.cellMouseDown,this.parent.workCellAction),this.wireMouseEvents(e)},D.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)},D.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},D.prototype.renderContentArea=function(){var e=U.createElement("div",{className:A}),t=this.createTableLayout(C);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},D.prototype.renderContentTable=function(e){var t=e.querySelector("tbody");U.append(this.getContentRows(),t),this.renderContentTableHeader(e)},D.prototype.getContentRows=function(){var s=this,o=[],l=U.createElement("tr"),p=U.createElement("td",{attrs:{"aria-selected":"false"}}),c=new Set;this.parent.virtualScrollModule&&0<this.parent.activeViewOptions.group.resources.length&&0<this.parent.virtualScrollModule.existingDataCollection.length&&(c=new Set(this.parent.virtualScrollModule.existingDataCollection.map(function(e){return e.groupIndex})));return this.getTimeSlotRows(function(e){for(var t=l.cloneNode(),i=0,n=s.colLevels[s.colLevels.length-1];i<n.length;i++){var r=n[i],a=!0;(a=s.parent.virtualScrollModule&&0<s.parent.activeViewOptions.group.resources.length&&c.has(r.groupIndex)?!1:a)&&(a=s.createContentTd(r,e,p),t.appendChild(a))}return o.push(t),e}),o},D.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(Nt)&&(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($,a),i},D.prototype.getContentTdClass=function(e){return e.last?[O]:[O,Yt]},D.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)},D.prototype.getScrollableElement=function(){return this.parent.isAdaptive&&!this.isTimelineView()?this.element.querySelector("."+Kt):this.getContentAreaElement()},D.prototype.getLeftPanelElement=function(){return this.element.querySelector("."+Bt)},D.prototype.getEndDateFromStartDate=function(e){var t=this.parent.activeViewOptions.timeScale.interval*Ve/this.parent.activeViewOptions.timeScale.slotCount,e=new Date(e.getTime());return e.setMilliseconds(e.getMilliseconds()+t),e},D.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)},D.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*Ve,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=(!et(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},D.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},D.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=D;function D(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)})(b,Dl=Ja),b.prototype.addEventListener=function(){this.parent.on(Se,this.onScrollUIUpdate,this),this.parent.on(ye,this.onDataReady,this),this.parent.on(q,this.onCellClick,this)},b.prototype.removeEventListener=function(){this.parent&&(this.parent.off(Se,this.onScrollUIUpdate),this.parent.off(ye,this.onDataReady),this.parent.off(q,this.onCellClick))},b.prototype.onDataReady=function(e){this.monthEvent=new La(this.parent),this.monthEvent.renderAppointments(),this.parent.notify(Te,{})},b.prototype.onCellClick=function(e){},b.prototype.onContentScroll=function(e){this.parent.removeNewEventElement(),this.parent.notify(be,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()},b.prototype.scrollLeftPanel=function(e){var t=this.getLeftPanelElement();t&&(t.scrollTop=e.scrollTop)},b.prototype.getLeftPanelElement=function(){return this.element.querySelector("."+ri)},b.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),Qe());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()},b.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)},b.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("."+C)).offsetHeight),t.style.height="auto",t.style.height=U.formatUnit(i-this.getScrollXIndent(e)))},b.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},b.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(St),n.push({date:e[parseInt(a.toString(),10)],type:"monthDay",className:s,colSpan:1,workDays:t})}return n},b.prototype.getDayNameFormat=function(){return this.parent.isAdaptive||0<this.parent.activeViewOptions.group.resources.length?"abbreviated":"wide"},b.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(we,{}),this.parent.uiStateValues.isCustomMonth&&(this.parent.uiStateValues.isCustomMonth=!1)},b.prototype.refreshHeader=function(){U.remove(this.element.querySelector("tbody tr")),this.renderHeader(),this.parent.notify(we,{});var e=this.element.querySelector("."+Tt),t=this.element.querySelector("."+A);e&&(e.scrollLeft=this.parent.uiStateValues.left),t&&(t.scrollLeft=this.parent.uiStateValues.left)},b.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)},b.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"))},b.prototype.renderLeftIndent=function(e){this.parent.activeViewOptions.showWeekNumber&&e.appendChild(U.createElement("td",{className:"e-left-indent"}))},b.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:A})),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()},b.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},b.prototype.renderAppointmentContainer=function(){},b.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},b.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($,r),n},b.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},b.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)},b.prototype.updateSelectedCellClass=function(e){},b.prototype.isOtherMonth=function(e){return e.getTime()<this.monthDates.start.getTime()||e.getTime()>this.monthDates.end.getTime()},b.prototype.renderContentArea=function(){var e=this.createTableLayout(C),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(Ue(t,this.parent.activeViewOptions.interval-1))},e.querySelector("tbody"));return U.append(this.getContentRows(),t),this.wireCellEvents(t),e},b.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},b.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(Nt)&&(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(Ct),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($,r),t},b.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))},b.prototype.getMonthStart=function(e){e=ke("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())},b.prototype.getMonthEnd=function(e){return this.isCustomMonth()?z(this.getMonthStart(e),7*(0<this.parent.activeViewOptions.numberOfWeeks?this.parent.activeViewOptions.numberOfWeeks:6)-1):(e=Ue(e,this.parent.activeViewOptions.interval-1),z(ke(this.parent.calendarUtil.lastDateOfMonth(e),this.parent.activeViewOptions.firstDayOfWeek),6))},b.prototype.isCustomRange=function(){var e,t,i=this.parent.getCurrentViewDates();return!(!(i&&0<i.length)||(e=W(this.parent.selectedDate).getTime(),t=ke(i[i.length-1],this.parent.activeViewOptions.firstDayOfWeek),e>=ke(i[0],this.parent.activeViewOptions.firstDayOfWeek).getTime()&&e<=z(t,6).getTime()))},b.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},b.prototype.getNextPreviousDate=function(e){var t;return this.isCustomMonth()?(t=this.parent.getCurrentViewDates(),z(ke("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))):Ue(this.parent.selectedDate,("next"===e?1:-1)*this.parent.activeViewOptions.interval)},b.prototype.getStartDate=function(){return this.getMonthStart(this.parent.selectedDate)},b.prototype.getEndDate=function(){return this.getMonthEnd(this.parent.selectedDate)},b.prototype.getEndDateFromStartDate=function(e){return z(new Date(e.getTime()),1)},b.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||Ue(Pe(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)},b.prototype.getLabelText=function(e){e=e.charAt(0).toLowerCase()+e.substring(1);return this.formatViewLabel(e,this.getStartDate(),this.getEndDate())},b.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($,{elementType:"weekNumberCell",element:e}),t},b.prototype.unWireEvents=function(){var e=this.element.querySelector("."+A);e&&U.EventHandler.remove(e,"scroll",this.onContentScroll)},b.prototype.isCustomMonth=function(){return"Month"===this.parent.currentView&&(!U.isNullOrUndefined(this.parent.activeViewOptions.displayDate)||0<this.parent.activeViewOptions.numberOfWeeks)},b.prototype.getModuleName=function(){return"month"},b.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=b;function b(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}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)})(S,Cl=Ja),S.prototype.getModuleName=function(){return"year"},S.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("."+A),"scroll",this.onContentScroll,this),this.parent.notify(we,{})},S.prototype.renderHeader=function(e){},S.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:A})),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)},S.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($,{elementType:"headerCells",element:n,date:e}),i},S.prototype.renderCalendarContent=function(e){var t=this.getMonthDates(e),i=U.createElement("div",{className:"e-content e-month"}),n=this.createTableLayout("e-calendar-table "+C),r=(i.appendChild(n),this.setAriaAttributes(n),U.createElement("thead",{className:"e-week-header"})),a=U.createElement("tr"),s=ke(He(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($,{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($,{elementType:"workCells",element:f,date:v})}p.appendChild(d)}return i},S.prototype.createTableColGroup=function(e){for(var t=U.createElement("colgroup"),i=0;i<e;i++)t.appendChild(U.createElement("col"));return t},S.prototype.getMonthName=function(e){return f(this.parent.globalize.formatDate(e,{format:this.parent.activeViewOptions.dateFormat||"MMMM y",calendar:this.parent.getCalendarMode()}),"multiple")},S.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},S.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"}))}]},S.prototype.getMonthDates=function(e){for(var e=ke(He(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},S.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},S.prototype.isCurrentDate=function(e){return W(new Date).getTime()===W(new Date(e.getTime())).getTime()},S.prototype.getMonths=function(){var i=this;return Array.apply(null,{length:this.parent.activeViewOptions.monthsCount}).map(function(e,t){return i.parent.firstMonthOfYear+t})},S.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)},S.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(q,n),this.parent.quickPopup.moreEventClick(r,t))},S.prototype.onContentScroll=function(e){var t=e.target,i=this.getDatesHeaderElement(),i=(this.parent.notify(be,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()},S.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("."+A)),r=(n&&(n.style.height=U.formatUnit(t)),!this.parent.isAdaptive&&i&&(r=Qe(),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()},S.prototype.getStartDate=function(){return new Date(this.parent.selectedDate.getFullYear(),this.parent.firstMonthOfYear%12,1)},S.prototype.getEndDate=function(){return z(Ue(this.getStartDate(),this.parent.monthsCount),-1)},S.prototype.startDate=function(){return"Year"===this.parent.currentView?ke(this.getStartDate(),this.parent.firstDayOfWeek):this.getStartDate()},S.prototype.endDate=function(){return"Year"===this.parent.currentView?z(Re(this.getEndDate(),this.parent.firstDayOfWeek),1):z(this.getEndDate(),1)},S.prototype.getEndDateFromStartDate=function(e){e=new Date(e.getTime());return 0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(e=Pe(e)),z(new Date(e.getTime()),1)},S.prototype.getNextPreviousDate=function(e){return Be(this.parent.selectedDate,"next"===e?1:-1)},S.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"})},S.prototype.addEventListener=function(){this.parent.on(Se,this.onScrollUiUpdate,this),this.parent.on(ye,this.onDataReady,this)},S.prototype.removeEventListener=function(){this.parent&&(this.parent.off(Se,this.onScrollUiUpdate),this.parent.off(ye,this.onDataReady))},S.prototype.onDataReady=function(e){this.yearEventModule=new il(this.parent),this.yearEventModule.renderAppointments(),this.parent.notify(Te,e)},S.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)},S.prototype.destroy=function(){var e;!this.parent||this.parent&&this.parent.isDestroyed||this.element&&((e=this.element.querySelector("."+A))&&U.EventHandler.remove(e,"scroll",this.onContentScroll),this.yearEventModule&&(this.yearEventModule.destroy(),this.yearEventModule=null),this.parent.resourceBase&&this.parent.resourceBase.destroy(),Cl.prototype.destroy.call(this))};var Sl,Cl,Ol=S;function S(e){e=Cl.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:x,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),$e(t),t.appendChild(n),{data:U.extend({},a[parseInt(e.toString(),10)],null,!0),element:t,cancel:!1});l.parent.trigger(ie,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:Nn})),n=(this.parent.sanitize(i,a),r.appendChild(a),U.isNullOrUndefined(n)||""===n||(i=U.createElement("div",{className:Ln}),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("."+x));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 S=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<S.length||!this.parent.hideEmptyAgendaDays)||"MonthAgenda"===this.parent.currentView)&&(w.push(S[0]),S={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:S,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(S),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,S={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(S),g.push(U.extend({},S,null,!0)));break}}}for(var C=s.slice(0,-1),O=[],E=0,V=0;V<C.length;V++)for(var w=C[C.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[C.length-(V+1)]===w[parseInt(x.toString(),10)][C[C.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=C[C.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,Ci],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,Ci,"e-date-border"]);var y=Ye(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:Si}),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,Si),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=Ye(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)})(I,Ml=xl),I.prototype.getModuleName=function(){return"agenda"},I.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:A})),t=(t.appendChild(e),this.createTableLayout(C)),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(we,{})},I.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("."+C+" tbody");$e(e),this.renderInitialContent(e,n),this.wireEventActions(),U.closest(e,"."+A).scrollTop=1,this.parent.notify(Te,{}),this.parent.activeViewOptions.allowVirtualScrolling||this.retainScrollPosition()},I.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))},I.prototype.refreshHeader=function(){var e=this.element.querySelector("."+C+" tbody"),t=(this.parent.activeViewOptions.group.byDate?$e(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)},I.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)},I.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}},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 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()},I.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},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{}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)}},I.prototype.appointmentFiltering=function(e,t){var i,t=!U.isNullOrUndefined(e)&&U.isNullOrUndefined(t)?(i=W(new Date(e.getTime())),Le(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},I.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?Ue(e,-1):this.parent.minDate)},I.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?Ue(e,1):this.parent.maxDate,1))},I.prototype.getNextPreviousDate=function(e){return z(this.parent.selectedDate,"next"===e?1:-1)},I.prototype.startDate=function(){return W(this.parent.selectedDate)},I.prototype.endDate=function(){return this.parent.activeViewOptions.allowVirtualScrolling?this.getEndDateFromStartDate(this.startDate()):z(this.startDate(),this.parent.agendaDaysCount)},I.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))},I.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))},I.prototype.wireEvents=function(){U.EventHandler.add(this.element.querySelector("."+A),De,this.agendaScrolling,this)},I.prototype.unWireEvents=function(){U.EventHandler.remove(this.element.querySelector("."+A),De,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)}},I.prototype.addEventListener=function(){this.parent.on(Se,this.onAgendaScrollUiUpdate,this),this.parent.on(ye,this.eventLoad,this)},I.prototype.removeEventListener=function(){this.parent&&(this.parent.off(Se,this.onAgendaScrollUiUpdate),this.parent.off(ye,this.eventLoad))},I.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("."+A));"auto"!==this.parent.height&&(t.style.height=U.formatUnit(this.parent.element.offsetHeight-e))},I.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)},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"),Ml.prototype.destroy.call(this))};var Il,Ml,kl=I;function I(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(Te,{})},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(Te,{}),this.monthAgendaDate=new Date(""+e.startTime)},jl.prototype.onEventRender=function(e,t){this.agendaBase=this.getAgendaBase();var i,n=this.element.querySelector("."+si);$e(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=Le(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"),$e(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=Ue(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}Ll.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},Ll.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},Ll.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},Ll.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},Ll.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 Nl=Ll;function Ll(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*this.parent.getElementWidth(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 Nl(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=Le(c,qe(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("."+C).offsetHeight,t=this.element.querySelector("."+Tt),this.element.querySelector("."+A).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("."+A+" 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*this.parent.getElementWidth(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*this.parent.getElementWidth(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(Te,{})},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(Te,{})},_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(St),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:A}));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(Ue(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 Nl(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("."+A))&&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($,{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($,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:Sr}),e.appendChild(t),t.appendChild(this.createTableLayout()),t=t.querySelector("tbody")),a.push(r),U.append(a,n),U.createElement("div",{className:A})),a=(r.appendChild(e),this.createTableLayout(C)),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("."+Sr+" ."+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($,{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(St),"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($,{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(Nt)?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($,{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(Nt)?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($,{elementType:"resourceGroupCells",element:g,date:c})}}"Vertical"===this.parent.activeViewOptions.orientation&&this.collapseRows(this.parent.element.querySelector("."+A))},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(He(e))):+new Date(W(e)),e=this.element.querySelector('[data-date="'+e+'"]');e&&(t=this.getScrollableElement(),this.parent.enableRtl?(i=this.element.querySelector("."+C),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 a"}},!0)),n.push(t)}),o.push({index:e+2,cells:n})}),[{columns:s,rows:o}]);new L.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};u=$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.registeredTemplate=this.parent.registeredTemplate,this.printInstance.root=this.parent.root||this.parent,this.printInstance.appendTo(t),this.printInstance.on(fe,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(fe,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=u,e.Gregorian=Lr,e.HeaderRenderer=Ir,e.ICalendarExport=To,e.ICalendarImport=Vo,e.Islamic=Fr,e.MS_PER_DAY=B,e.MS_PER_MINUTE=Ve,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=Q,e.actionComplete=K,e.actionFailure=Z,e.addDays=z,e.addMonths=Ue,e.addYears=Be,e.capitalizeFirstWord=f,e.cellClick=q,e.cellDoubleClick=F,e.cellMouseDown=Ee,e.cellSelect=ge,e.contentReady=we,e.dataBinding=ne,e.dataBound=re,e.dataReady=ye,e.documentClick=Oe,e.drag=le,e.dragStart=oe,e.dragStop=pe,e.eventClick=ee,e.eventDoubleClick=te,e.eventRendered=ie,e.eventsLoaded=Te,e.extractObjectFromRule=ga,e.findIndexInData=Ze,e.firstDateOfMonth=He,e.generate=Gr,e.generateSummary=Yr,e.getCalendarUtil=fa,e.getDateCount=Fe,e.getDateFromRecurrenceDateString=Xr,e.getDateFromString=_e,e.getDateInMs=qe,e.getDaysCount=Ye,e.getElementHeight=at,e.getElementHeightFromClass=xe,e.getElementTop=st,e.getElementWidth=rt,e.getElementWidthFromClass=Ae,e.getMaxDays=ze,e.getOuterHeight=Je,e.getRecurrenceStringFromDate=Ia,e.getScrollBarWidth=Qe,e.getStartEndHours=We,e.getTranslateX=Me,e.getTranslateY=Ie,e.getUniversalTime=tt,e.getWeekFirstDate=ke,e.getWeekLastDate=Re,e.getWeekMiddleDate=Ne,e.getWeekNumber=je,e.hover=X,e.initialEnd="initial-end",e.initialLoad="initial-load",e.inlineClick=ue,e.isDaylightSavingTime=et,e.isIPadDevice=nt,e.isMobile=it,e.lastDateOfMonth=Pe,e.moreEventsClick=_,e.navigating=J,e.popupClose=se,e.popupOpen=ae,e.print=fe,e.removeChildren=$e,e.renderCell=$,e.resetScrollbarWidth=Ke,e.resetTime=W,e.resizeStart=ce,e.resizeStop=de,e.resizing=he,e.scroll=De,e.scrollUiUpdate=Se,e.select=G,e.setTime=Le,e.timezoneData=zr,e.uiUpdate=Ce,e.virtualScroll=be,e.virtualScrollStart=me,e.virtualScrollStop=ve,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,p,H,P,j,N,L){"use strict";var q="cellClick",F="cellDoubleClick",_="moreEventsClick",G="select",X="hover",Q="actionBegin",K="actionComplete",Z="actionFailure",J="navigating",$="renderCell",ee="eventClick",te="eventDoubleClick",ie="eventRendered",ne="dataBinding",re="dataBound",ae="popupOpen",se="popupClose",oe="dragStart",le="drag",pe="dragStop",ce="resizeStart",he="resizing",de="resizeStop",ue="inlineClick",ge="cellSelect",me="virtualScrollStart",ve="virtualScrollStop",fe="print",ye="data-ready",Te="events-loaded",we="content-ready",De="scroll",be="virtual-scroll",Se="scroll-ui-update",Ce="ui-update",Oe="document-click",Ee="cell-mouse-down",B=864e5,Ve=6e4;function xe(e,t,i){t=U.createElement("div",{className:t}).cloneNode();return t.style.visibility="hidden",t.style.position="absolute",e.appendChild(t),e=at(t,i),U.remove(t),e}function Ae(e,t,i){t=U.createElement("div",{className:t}).cloneNode();return t.style.visibility="hidden",t.style.position="absolute",e.appendChild(t),e=rt(t,i),U.remove(t),e}function Ie(e){e=getComputedStyle(e);return window.WebKitCSSMatrix?new WebKitCSSMatrix(e.webkitTransform).m42:0}function Me(e){e=getComputedStyle(e);return window.WebKitCSSMatrix?new WebKitCSSMatrix(e.webkitTransform).m41:0}function ke(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 Re(e,t){e=ke(e,t),t=new Date(e.getFullYear(),e.getMonth(),e.getDate()+6);return new Date(t.getTime())}function He(e){return new Date(e.getFullYear(),e.getMonth(),1)}function Pe(e){return new Date(e.getFullYear(),e.getMonth()+1,0)}function je(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 Le(e,t){var i=e.getTimezoneOffset(),t=new Date(e.getTime()+t),i=t.getTimezoneOffset()-i;return e.setTime(t.getTime()+i*Ve),e}function W(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function qe(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 Fe(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 Ue(e,t){var i=(e=new Date(""+e)).getDate();return e.setDate(1),e.setMonth(e.getMonth()+t),e.setDate(Math.min(i,ze(e))),e}function Be(e,t){var i=(e=new Date(""+e)).getDate();return e.setDate(1),e.setFullYear(e.getFullYear()+t),e.setDate(Math.min(i,ze(e))),e}function We(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 ze(e){return Pe(e).getDate()}function Ye(e,t){e=W(new Date(e)),t=W(new Date(t));return Math.round((t.getTime()-e.getTime())/B)}function _e(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 Ge=null,Xe=null;function Qe(){if(null!==Ge)return Ge;null===Xe&&(Xe=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),Ge=t}function Ke(){var e=window.devicePixelRatio||window.screen.availWidth/document.documentElement.clientWidth;Xe&&Xe!==e&&(Ge=null,Xe=e)}function Ze(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 Je(e){var t=getComputedStyle(e);return e.offsetHeight+(parseInt(t.marginTop,10)||0)+(parseInt(t.marginBottom,10)||0)}function $e(e){for(var t=0,i=[].slice.call(e.children);t<i.length;t++){var n=i[t];e.removeChild(n)}}function et(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 tt(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 it(){return-1<window.navigator.userAgent.toLowerCase().indexOf("mobi")}function nt(){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 rt(e,t){return t?e.offsetWidth:e.getBoundingClientRect().width}function at(e,t){return t?e.offsetHeight:e.getBoundingClientRect().height}function st(e,t){return t?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",w="e-all-day-cells",vt="e-all-day-row",C="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",St="e-current-day",Ct="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",Nt="e-parent-node",Lt="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",V="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",x="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",A="e-content-wrap",yi="e-virtual-track",Ti="e-agenda-cells",wi="e-current-day",Di="e-active-appointment-agenda",bi="e-month-header",Si="e-day-date-header",Ci="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",Ni="e-clone-time-indicator",Li="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",Sn="e-quick-dialog-series-event",Cn="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",Nn="e-subject",Ln="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",Sr="e-month-header-wrapper",Cr="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(Oe,this.closeHeaderPopup,this)},t.prototype.removeEventListener=function(){this.parent.off(Oe,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("."+A);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(Q,{requestType:"toolbarItemRendering",items:e},function(e){t.toolbarObj=new k.Toolbar({items:e.items,overflowMode:"Popup",clicked:t.toolbarClickHandler.bind(t),created:t.toolbarCreateHandler.bind(t),enableRtl:t.parent.enableRtl,enableHtmlSanitizer:t.parent.enableHtmlSanitizer,locale:t.parent.locale}),t.toolbarObj.isStringTemplate=!0,t.toolbarObj.root=t.parent.root||t.parent,t.toolbarObj.appendTo(t.parent.element.querySelector("."+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(K,{requestType:"toolBarItemRendered",items:t.toolbarObj.items})})},t.prototype.updateItems=function(){var e,t=this;this.toolbarObj&&(e=this.getItems(),this.parent.trigger(Q,{requestType:"toolbarItemRendering",items:e},function(e){t.toolbarObj.items=e.items,t.toolbarObj.dataBind(),t.parent.trigger(K,{requestType:"toolBarItemRendered",items:t.toolbarObj.items})}))},t.prototype.getPopUpRelativeElement=function(){return this.parent.isAdaptive?this.toolbarObj.element:this.element.querySelector(".e-date-range")},t.prototype.setDayOfWeek=function(e){this.headerCalendar&&(this.headerCalendar.firstDayOfWeek=e,this.headerCalendar.dataBind())},t.prototype.setCalendarDate=function(e){this.headerCalendar&&(this.headerCalendar.value=e,this.headerCalendar.dataBind())},t.prototype.setCalendarMinMaxDate=function(){this.headerCalendar&&(this.headerCalendar.min=this.parent.minDate,this.headerCalendar.max=this.parent.maxDate,this.headerCalendar.dataBind())},t.prototype.getCalendarView=function(){return-1<["Month","MonthAgenda","TimelineMonth"].indexOf(this.parent.currentView)?"Year":-1<["Year","TimelineYear"].indexOf(this.parent.currentView)?"Decade":"Month"},t.prototype.setCalendarView=function(){var e;this.headerCalendar&&(e=this.getCalendarView(),this.headerCalendar.depth=e,this.headerCalendar.start=e,this.headerCalendar.refresh())},t.prototype.updateActiveView=function(){var e=[].slice.call(this.toolbarObj.element.querySelectorAll(".e-views"));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.toolbarCreateHandler=function(){this.parent&&this.parent.portals&&this.toolbarObj&&this.toolbarObj.portals&&(this.parent.portals=this.parent.portals.concat(this.toolbarObj.portals),this.parent.renderReactTemplates())},t.prototype.toolbarClickHandler=function(e){if(e.item){var t;switch(e.item.cssClass.replace("e-views ","")){case"e-date-range":this.headerPopup||this.renderHeaderPopup(),this.headerPopup.element.classList.contains(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(He(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*Ve/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=ke(W(this.parent.selectedDate),this.parent.activeViewOptions.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():He(this.parent.selectedDate),t=e?this.parent.activeView.getEndDate():Pe(Ue(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(we,this.setDimensions,this),this.parent.on(Ce,this.onPropertyChanged,this)},kr.prototype.removeEventListener=function(){this.parent.off(we,this.setDimensions),this.parent.off(Ce,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,"."+x));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(Q,i),i.cancel)return;i=this.element.querySelector("."+A);if(i&&i.scrollWidth>i.clientWidth)return;this.isScrollTriggered=!0,e.originalEvent.preventDefault(),e.originalEvent.stopPropagation()}e.scrollDirection===this.touchLeftDirection?(this.nextPanel||(this.renderPanel(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(K,i)):this.cancelSwipe(),this.timeStampStart=null)},Hr.prototype.tapHoldHandler=function(e){var t=U.closest(e.originalEvent.target,"."+x);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(J,e,function(e){e.cancel?(i.swapPanels(t),i.cancelSwipe()):(i.parent.activeView.setPanel(i.currentPanel.element),i.parent.setProperties({selectedDate:i.currentPanel.selectedDate},!0),e=void 0,e=i.parent.enableRtl?t===i.touchLeftDirection?i.previousPanel?i.previousPanel.element.offsetLeft:i.currentPanel.element.offsetWidth:0:t===i.touchLeftDirection?-i.currentPanel.element.offsetLeft:0,i.parent.activeView.renderDates=i.currentPanel.renderDates,i.parent.activeView.colLevels=i.currentPanel.colLevels,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="",$e(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));break;case"shiftAltY":this.parent.changeDate(new Date,e);break;case"shiftAltN":"Agenda"!==this.parent.currentView&&"MonthAgenda"!==this.parent.currentView&&"Year"!==this.parent.currentView&&this.processShiftAltN(e)}},i.prototype.processShiftAltN=function(e){var t=this.parent.getSelectedCells(),i=e.target,n=U.extend({},null,!0),i=(0<t.length&&(U.closest(i,"."+O)||U.closest(i,"."+w)||U.closest(i,"."+Dt))?n=this.getSelectedElements(i):U.closest(i,"."+x)&&!U.isNullOrUndefined(this.parent.activeEventData.event)?(t=this.parent.activeEventData.event,n.startTime=t.StartTime,n.endTime=t.EndTime,n.isAllDay=t.IsAllDay):(i=this.parent.getStartEndTime(this.parent.workHours.start),t=this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount,n.startTime=new Date(this.parent.selectedDate),n.startTime.setHours(i.getHours(),i.getMinutes(),0,0),n.endTime=new Date(n.startTime.getTime()+6e4*t)),U.extend(n,{cancel:!1,event:e}));null!=i&&this.parent.eventWindow.openEditor(i,"Add")},i.prototype.processFTwelve=function(e){var t=e.target;(t.classList.contains(O)||t.classList.contains(w))&&(this.parent.activeCellsData=this.getSelectedElements(t),e={element:(e=U.extend(this.parent.activeCellsData,{cancel:!1,event:e})).element,groupIndex:e.groupIndex,type:"Cell"},this.parent.notify(ue,e)),t.classList.contains(x)&&t.click()},i.prototype.addEventListener=function(){this.parent.on(Ee,this.onCellMouseDown,this)},i.prototype.removeEventListener=function(){this.parent.off(Ee,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(w))&&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("."+x)),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("."+A)).offsetHeight<=t.scrollHeight&&0<=t.scrollTop&&t.scrollTop+t.offsetHeight<=t.scrollHeight,i=t.offsetWidth<=t.scrollWidth&&0<=t.scrollLeft&&t.scrollLeft+t.offsetWidth<=t.scrollWidth,r&&(n.top||n.bottom)&&(t.scrollTop+=n.top?-e.target.offsetHeight:e.target.offsetHeight),i)&&(n.left||n.right)&&(t.scrollLeft+=n.left?-e.target.offsetWidth:e.target.offsetWidth),this.getClosestCell(e));r&&this.selectCells(!0,r)},i.prototype.getClosestCell=function(e){return U.closest(e.target,"."+O+",."+w)},i.prototype.onMoveUp=function(t){var i,n=this,e=[].slice.call(this.parent.element.querySelectorAll("."+x));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(w)&&(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:ge,showQuickPopup:!1},this.parent.trigger(G,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(q,e))}))},i.prototype.processEnter=function(e){var t,i,n;this.parent.activeViewOptions.readonly&&!e.target.classList.contains(x)||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(Nn)&&(this.parent.element.querySelector("."+cn).click(),e.preventDefault()):t.classList.contains(Ut)&&t.classList.contains(Nt)?(i=t.querySelector("."+Ft))&&i.click():t.classList.contains(O)||t.classList.contains(w)?(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(ue,n)):"Year"===this.parent.currentView?t.click():this.parent.notify(q,i)):t.classList.contains(Cr)&&this.parent.inlineModule?this.parent.inlineModule.inlineCrudActions(t):t.classList.contains(x)||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(w)&&(n=this.parent.getAllDayRow(),a=[].slice.call(n.cells),s=1,o=n.cells.length),a.indexOf(t)),l=a.indexOf(i),p=[];if(e){for(var c=0;c<o;c++)for(var h=0;h<s;h++){var d=a[o*h+c];r&&d.classList.contains(E)||p.push(d)}n=p.indexOf(t),l=p.indexOf(i)}return l<n&&(t=n,n=l,l=t),(e?p:a).slice(n,l+1)},i.prototype.focusFirstCell=function(){var e;"Agenda"===this.parent.currentView?((e=this.parent.getContentTable().querySelector("."+Ti)).setAttribute("tabindex","0"),e.focus()):(this.parent.eventBase.removeSelectedAppointmentClass(),this.parent.activeView.isTimelineView()&&"TimelineYear"!==this.parent.currentView?(e=this.parent.element.querySelector("."+C+" tr:not(."+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(G,i,function(e){e.allowMultipleRow&&h.parent.allowMultiRowSelection||((e="TimelineYear"===h.parent.currentView)&&"Horizontal"===h.parent.activeViewOptions.orientation||"Month"===h.parent.currentView?(e=e&&0<h.parent.activeViewOptions.group.resources.length,d=e?h.initialTarget:h.initialTarget.parentElement.children[d.cellIndex]):-1<c.indexOf(h.parent.currentView)&&(d=d.parentElement.children[h.initialTarget.cellIndex]));e=h.getCells(h.isInverseTableSelect(),h.initialTarget,d);if(0<h.parent.activeViewOptions.group.resources.length){p=h.initialTarget.getAttribute("data-group-index");for(var t=[],i=0,n=e;i<n.length;i++)(a=n[i]).getAttribute("data-group-index")===p&&t.push(a);e=t}if(h.parent.allowMultiCellSelection||(e=[h.initialTarget]),2<(h.selectedCells=e).length&&!d.classList.contains(w)){var r=h.getAllDayCells(e);if(0<h.parent.activeViewOptions.group.resources.length){for(var a,s=[],o=0,l=r;o<l.length;o++)(a=l[o]).getAttribute("data-group-index")===p&&s.push(a);r=s}e=e.concat(r)}d.getAttribute("data-group-index")!==p&&0<h.parent.activeViewOptions.group.resources.length&&(d=h.selectedCells[h.selectedCells.length-1]),h.parent.addSelectedClass(e,d)})):(i={element:d,requestType:ge},this.parent.trigger(G,i,function(){h.initialTarget=d,h.selectedCells=[d],h.parent.addSelectedClass([d],d)}))},i.prototype.selectAppointment=function(e,t){var i=this.getAppointmentElements();i.length<0||(this.parent.eventBase.removeSelectedAppointmentClass(),(t=t.classList.contains(x)?(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(w))&&(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("."+x))},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;U.isNullOrUndefined(e.code)||(t=parseInt(e.code.slice(e.code.length-1),10)-1,!isNaN(t)&&!U.isNullOrUndefined(this.parent.views)&&t<this.parent.views.length&&(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())},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(w)&&(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()===Pe(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(w)&&(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(w)&&(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()===He(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("."+C+" tbody")).item(o.length-1).querySelector(":not(."+E+')[data-date="'+this.parent.activeView.getEndDate().getTime()+'"]')),this.selectCells(!1,n))))):i.classList.contains(w)&&(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(Cr)&&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("."+x+'[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(x)){var r=[].slice.call(this.parent.element.querySelectorAll("."+x)),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("."+x+'[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(x)?(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(x)&&(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(x)){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("."+x+'[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(x)&&(n=this.parent.resourceBase.renderedResources[0].groupIndex,0<(t=[].slice.call(this.parent.element.querySelectorAll("."+x+'[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("."+A).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",shiftAltY:"shift+alt+y",shiftAltN:"shift+alt+n"},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()}Nr.prototype.initDataManager=function(e,t){this.dataManager=e instanceof p.DataManager?e:new p.DataManager(e),this.query=t instanceof p.Query?t:new p.Query},Nr.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 p.Predicate(this.parent.eventFields.recurrenceRule,"notequal",null).and(new p.Predicate(this.parent.eventFields.recurrenceRule,"notequal","")),a.where(i.or(r));a.addParams("StartDate",e.toISOString()),a.addParams("EndDate",t.toISOString())}return a},Nr.prototype.getStartEndQuery=function(e,t){var i=this.parent.eventFields;return new p.Predicate(i.startTime,"greaterthanorequal",e).and(new p.Predicate(i.endTime,"greaterthanorequal",e)).and(new p.Predicate(i.startTime,"lessthan",t)).or(new p.Predicate(i.startTime,"lessthanorequal",e).and(new p.Predicate(i.endTime,"greaterthan",e)))},Nr.prototype.getData=function(e){return this.dataManager.executeQuery(e)},Nr.prototype.destroy=function(){this.dataManager=null,this.query=null};var jr=Nr;function Nr(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 Lr=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(Ca[-1<n?n:Ca.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 N=Sa[parseInt(n.toString(),10)];ba[0]!==N;){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,L=l.until,g=p,m=l,v=new Date(u.getTime()),q=m.interval,f=Kr(u,m),y=m.day;ha(v,L)&&!(va(v,m)&&(-1<y.indexOf(Sa[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,S=new Date(T.getTime());b.day.length||b.day.push(Sa[T.getDay()]);var C,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]),C=Sa.indexOf(b.wkst);ha(S,w);){var A=Sa.indexOf(Sa[S.getDay()])-C,A=z(S,-(A=-1==A?6:A)),I=z(A,6),M=new Date(S.getTime());for(I=W(I),M=W(M);M<=I&&(-1<E.indexOf(Sa[S.getDay()])&&x.push([S.getTime()]),!(V&&D.length+b.recExceptionCount>=V));)S.setDate(S.getDate()+1),S.getHours()!==T.getHours()&&S.setHours(T.getHours()),M=W(M=new Date(S.getTime()));if(S.setDate(S.getDate()-1),V&&D.length+b.recExceptionCount>=V)break;S.setDate(S.getDate()+1+7*(O-1)),ra(x,0,T,w,D,b),x=[]}else{for(S=ua(T,b.day),1<O&&ba.indexOf(b.day[0])<T.getDay()&&S.setDate(S.getDate()+7*(O-1));ha(S,w)&&((F=va(S,b))&&-1<E.indexOf(Sa[S.getDay()])&&Qr(D,S.getTime()),!(V&&D.length+b.recExceptionCount>=V));)S.setDate(S.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(Sa[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(Sa[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(Sa[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 S=u[parseInt(b.toString(),10)].match(Aa),C=parseInt(S[0],10);for(l=new Date(m.getTime());Y.isSameYear(l,m)&&Y.isSameMonth(l,m);)S[S.length-1]===Sa[l.getDay()]&&f.push([l.getTime()]),l.setDate(l.getDate()+1);l.setDate(l.getDate()-1),s=-1<S[0].indexOf("-")?f.length- -1*C:C-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(Sa[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]);Sa[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(Sa[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]===Sa[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(Sa[s.getDay()])&&(o.push(v),v=[]),s.setDate(s.getDate()+f[Sa[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 S=0;S<o[parseInt(b.toString(),10)].length;S++)D.push(o[parseInt(b.toString(),10)][parseInt(S.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(Sa[n.getDay()]))for(;n.setDate(n.getDate()+1),-1===r.indexOf(Sa[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(Sa[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:Lr)}var ya,Ta,wa,Y,Da={},ba=["SU","MO","TU","WE","TH","FR","SA"],Sa=["SU","MO","TU","WE","TH","FR","SA"],Ca=["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]=_e(e[this.parent.eventFields.startTime])),"string"==typeof e[this.parent.eventFields.endTime]&&(e[this.parent.eventFields.endTime]=_e(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(ye,{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 p.DataManager({json:i}).executeLocal((new p.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=Ye(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=qe(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,S=(D=b?D:h.length-1)-w+1,C=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)],S,C,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{C=E[0]!==a,O=E[E.length-1]!==s;o.push(this.cloneEventObject(e,E[0],E[E.length-1],E.length,C,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+",."+x+":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<=(tt(e[t.endTime])-tt(e[t.startTime]))/B;return!!(i||"TimeSlot"!==this.parent.eventSettings.spannedEventPlacement&&e)},n.prototype.addEventListener=function(){this.parent.on(Oe,this.appointmentBorderRemove,this)},n.prototype.removeEventListener=function(){this.parent.off(Oe,this.appointmentBorderRemove)},n.prototype.appointmentBorderRemove=function(e){e=e.event.target;U.closest(e,"."+x)?"MonthAgenda"!==this.parent.currentView&&this.parent.removeSelectedClass():U.closest(e,"."+yt)||this.parent.uiStateValues.isTapHold&&U.closest(e,"."+O+",."+w)||(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(Li)||n.classList.contains(Fi)||n.classList.contains(Cr)||((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,"."+x),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(G,n),t=U.extend(this.parent.activeEventData,{cancel:!1,originalEvent:e}),this.parent.trigger(ee,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(G,n),t=U.extend(this.parent.activeEventData,{cancel:!1,originalEvent:e}),this.parent.trigger(ee,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(ue,t)):i.parent.notify(ee,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("."+Cr)||(e=U.extend(this.parent.activeEventData,{cancel:!1,originalEvent:e}),this.parent.trigger(te,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,"."+x),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=Fe(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:Nn}),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 p.DataManager(e).executeLocal((new p.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 p.Predicate(r.followingID,"equal",s).and(new p.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 p.Predicate(i.recurrenceID,"equal",s[i.id]).or(new p.Predicate(i.recurrenceID,"equal",s[i.followingID]).and(new p.Predicate(i.recurrenceID,"notequal",void 0)).and(new p.Predicate(i.recurrenceID,"notequal",null)));"EditFollowingEvents"!==this.parent.currentAction&&"DeleteFollowingEvents"!==this.parent.currentAction||(s=s.and(new p.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("."+w).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()||t.getTime()===i.getTime()&&e.startHour.getTime()<i.getTime()&&e.endHour.getTime()>t.getTime()&&-1===this.parent.currentView.indexOf("Timeline"))&&(tt(i)-tt(t))/Ve<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:V+"-"+t.toString(),className:V}),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(we,{})}},n.prototype.unWireEvents=function(){for(var e=0,t=[].slice.call(this.parent.element.querySelectorAll("."+x));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+",."+x+",."+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("."+w)),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(we,{}),U.addClass(this.allDayElement,ar),i&&(this.parent.crudModule.crudObj.isCrudAction=!1),this.parent.renderTemplates(function(){var e;t.parent&&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(this.parent.getElementHeight(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=(tt(t)-tt(e))/Ve*(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("."+V+'[id="'+V+"-"+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(ie,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=We(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("."+A+" 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?this.parent.getElementHeightFromClass(this.element.querySelector("."+Xi),x):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("."+V).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:x,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:Nn}),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:Ln}),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=We(n,this.startHour,this.endHour),r=U.extend({},e,null,!0),e=(r.isSpanned={isBottom:!1,isTop:!1,isSameDuration:r[i.startTime].getTime()===r[i.endTime].getTime()},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(ie,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=We(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=a.isSpanned.isSameDuration?this.cellHeight: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("."+Nn),!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=We(i,this.startHour,this.endHour).startHour,i=(et(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:x,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(we,{})},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,Na=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("."+A),n=(this.parent.rowAutoHeight&&(this.parent.uiStateValues.top=t.scrollTop,this.parent.uiStateValues.left=t.scrollLeft),[].slice.call(this.element.querySelectorAll("."+V)));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(C),this.element.querySelector("."+O)&&("Month"===this.parent.currentView&&(n=U.createElement("div",{className:V}),(e=this.parent.element.querySelector("."+O)).appendChild(n),this.monthHeaderHeight=n.offsetTop-e.offsetTop,e.removeChild(n)),this.eventHeight=this.parent.getElementHeightFromClass(this.element,x),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(we,{}),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("."+A).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("."+C).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=this.parent.getElementWidth(o),this.cellHeight=this.parent.getElementHeight(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<qe(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<qe(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=We(e[this.fields.startTime],n,r),e=We(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.parent.uiStateValues.isGroupAdaptive||this.parent.uiStateValues.groupIndex===n.groupIndex&&this.parent.uiStateValues.isGroupAdaptive)&&this.renderEventsHandler(n.renderDates,n.workDays,n),this.parent.crudModule.crudObj.sourceEvent[parseInt(t.toString(),10)].groupIndex!==this.parent.crudModule.crudObj.targetEvent[parseInt(t.toString(),10)].groupIndex&&(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:x,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:Nn}),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:Ln}),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(_,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(x),e=this.getEventData(e);this.parent.trigger(ie,{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("."+V);i?i.appendChild(t):((i=U.createElement("div",{className:V})).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=Je(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(),Na.prototype.destroy.call(this)};var ja,Na,La=a;function a(e){e=Na.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=La),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=this.parent.getElementWidth(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-(qe(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.parent.uiStateValues.isGroupAdaptive||this.parent.uiStateValues.groupIndex===n.groupIndex&&this.parent.uiStateValues.isGroupAdaptive)&&this.renderEventsHandler(this.parent.activeView.renderDates,this.parent.activeViewOptions.workDays,n),this.parent.crudModule.crudObj.targetEvent[parseInt(t.toString(),10)]&&this.parent.crudModule.crudObj.sourceEvent[parseInt(t.toString(),10)].groupIndex!==this.parent.crudModule.crudObj.targetEvent[parseInt(t.toString(),10)].groupIndex&&(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=We(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=We(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?(l=this.parent.element.querySelector("."+A),h=this.parent.getElementWidth(l),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!==this.parent.getElementWidth(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 S=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,S)}else for(var C=(tt(r)-tt(n))/Ve*this.slotCount/this.interval,O=0;O<C&&(D=0===O?new Date(D.getTime()):new Date(D.getTime()+6e4*w),C<1&&(D=this.adjustToNearestTimeSlot(D,w)),b=new Date(D.getTime()+6e4*w),!(1<=C&&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("."+C+" tbody tr"),n=this.parent.getElementWidth(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("."+x)).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=We(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=We(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=We(W(new Date(e.getTime())),this.startHour,this.endHour)).endHour.getTime()-i.startHour.getTime())/Ve),(tt(t)-tt(e))/Ve*(this.cellWidth*this.slotCount)/n},s.prototype.getSpannedEventsWidth=function(e,t,i){var n,i=i*this.slotsPerDay*this.cellWidth,r=We(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=We(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)?(tt(t)-tt(e.startHour))/(Ve*this.interval)*this.slotCount:0;return 0===i?t:Math.round((tt(e.endHour)-tt(e.startHour))/Ve/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=We(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("."+A+' 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("."+C+" tbody tr"));return e.dayLength=0===t.length?0:t[0].children.length,e.content=e.parent.element.querySelector("."+mt+"."+C),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("."+Cr)!==e.element.querySelector("."+Cr)&&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("."+Cr));s&&s.focus()},Wa.prototype.eventEdit=function(e){var t,i,n=e.element.querySelector("."+Cr);n?i=n.value:(t=e.element.querySelector("."+Nn),i=U.isNullOrUndefined(t)?e.data[this.parent.eventFields.subject]:(U.addClass([t],d),t.innerText),n=U.createElement("input",{className:Cr,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)):(t=-1<["TimelineDay","TimelineWeek","TimelineWorkWeek","TimelineMonth"].indexOf(this.parent.currentView)?".e-inner-wrap":".e-appointment-details",t=e.element.querySelector(t),(U.isNullOrUndefined(t)?e.element.querySelector(".e-appointment-details"):t).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("."+w)),(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(this.parent.getElementHeight(this.parent.element.querySelector("."+vt))/r[0].offsetHeight)-1),s.allDayLevel=a,r=this.parent.getElementHeightFromClass(this.parent.element.querySelector("."+Xi),x),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 La(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=this.parent.getElementHeightFromClass(this.parent.monthModule.element||a.element,x),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("."+Cr).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("."+C+" tbody tr").length?0:this.parent.element.querySelectorAll("."+C+" tbody tr")[0].children.length);t.slotsPerDay=r/t.dateRender.length,t.eventHeight=this.parent.getElementHeightFromClass(t.element,x),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("."+Cr),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("."+Cr);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,"."+x),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:x+" "+Or}),i=U.createElement("div",{className:di}),n=(t.appendChild(i),U.createElement("input",{className:Cr}));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("."+Cr));t&&(e=U.closest(t,"."+x).querySelector("."+Nn),U.isNullOrUndefined(e)||U.removeClass([e],d),U.remove(t))},Wa.prototype.destroy=function(){this.parent.off(ue,this.inlineEdit)};var Ba=Wa;function Wa(e){this.parent=e,this.parent.on(ue,this.inlineEdit,this)}Ya.prototype.renderFormValidator=function(e,t,i,n){var r=this;this.element=i,this.formObj=new P.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(w)||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 H.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,Sn,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],Sn),this.parent.eventSettings.editFollowingEvents&&(U.removeClass([r],d),U.addClass([this.quickDialog.element],On),U.addClass([r],Cn));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(ae,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:x,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:Nn})),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(ie,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,"."+x),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="'+Nn+'">'+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+",."+w))&&t.appendChild(i)):(t=U.closest(n,"."+O+",."+w+",."+Dt),U.isNullOrUndefined(t)||n.classList.contains(tn)||(this.quickPopup.relateTo===t&&this.quickPopup.element.classList.contains(yt)?(i=this.quickPopup.element.querySelector("."+Nn))&&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("."+Nn))&&P.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,"."+x)||!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,"."+x)):(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,"."+x),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="'+Nn+" "+un+'" title="'+(s.eventSubject&&s.eventSubject.replaceAll('"',"'"))+'"></div></div >'}r=U.createElement("div",{innerHTML:a});"Event"===e&&(n=r.querySelector("."+Nn),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="'+Nn+' 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="'+Ln+'"><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=Ze(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<(tt(r)-tt(n))/B&&(p+="&nbsp;-&nbsp;"+s+" ("+this.l10n.getConstant("allDay")+")")):p=1<=(tt(r)-tt(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,Ct),W(t.date).getTime()===W(this.parent.getCurrentTime()).getTime()&&U.addClass(this.morePopup.element.querySelector("."+vn).childNodes,Ct),!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("."+A+' tbody tr td[data-date="'+l+'"]');else if(this.morePopup.relateTo=this.parent.element.querySelector("."+A+' tbody tr td[data-group-index="'+e+'"][data-date="'+l+'"]'),U.isNullOrUndefined(this.morePopup.relateTo))for(var p=[].slice.call(this.parent.element.querySelectorAll("."+A+' 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(ae,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("."+Nn);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(Cn))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(Sn))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("."+Nn).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(x)?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(se,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(ae,e,function(e){var t,i,n,r,a,s;e.cancel?(h.quickPopupHide(),h.destroyPopupButtons("quickPopup"),e.element.classList.contains(yt)&&h.quickPopupClose(),$e(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,"."+C)),t=h.parent.element.querySelector("."+A+" table"),h.quickPopup.offsetX=i&&!h.parent.enableRtl?Me(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=Me(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=Ie(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("."+Nn))&&(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("."+Nn))&&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"),$e(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(se,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+",."+w+",."+O+",."+x+",.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("."+Cr));i&&i!==e&&this.parent.allowInline&&this.parent.inlineModule.documentClick(),U.closest(e,"."+x+",."+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(q,this.cellClick,this),this.parent.on(ee,this.eventClick,this),this.parent.on(Oe,this.documentClick,this),this.parent.on(ye,this.updateMoreEventContent,this)},o.prototype.removeEventListener=function(){this.parent.off(q,this.cellClick),this.parent.off(ee,this.eventClick),this.parent.off(Oe,this.documentClick),this.parent.off(ye,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."+Nn))&&e.remove(),(t=this.quickPopup.element.querySelector("form."+Rn))&&($e(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("."+x),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=(d=new Date(""+e[i.endTime])).getTime()-n.getTime()!=0&&0===d.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",Ss="e-hide-recurrence-element",Cs="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",Ns="value",Ls="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,Cs])})},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,Cs])},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)],Ss)});break;case Is:zs.forEach(function(e){return U.addClass([t.element.querySelector("."+e)],Ss)});break;case Ms:Ys.forEach(function(e){return U.addClass([t.element.querySelector("."+e)],Ss)});break;case ks:_s.forEach(function(e){return U.addClass([t.element.querySelector("."+e)],Ss)});break;case As:Gs.forEach(function(e){return U.addClass([t.element.querySelector("."+e)],Ss)})}},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)],Ss)});break;case Hs:Ks.forEach(function(e){return U.addClass([t.element.querySelector("."+e)],Ss)});break;case Ps:Qs.forEach(function(e){return U.addClass([t.element.querySelector("."+e)],Ss)})}},l.prototype.freshOnEndForm=function(){var t=this;Xs.forEach(function(e){e=t.element.querySelector("."+e);e&&U.removeClass([e],Ss)})},l.prototype.showFormElement=function(){var t=this;Ws.forEach(function(e){e=t.element.querySelector("."+e);e&&U.removeClass([e],Ss)})},l.prototype.renderDropdowns=function(){function e(e){return new j.DropDownList({dataSource:e,popupWidth:t.getPopupWidth(),enableRtl:t.enableRtl,fields:{text:js,value:Ns},index:1,change:function(e){i.onWeekDay.setProperties({checked:!0}),i.resetFormValues(),i.triggerChangeEvent()}})}var t=this,i=this;this.repeatType=new j.DropDownList({dataSource:this.getRepeatData(),floatLabelType:"Always",enableRtl:this.enableRtl,index:this.selectedType,fields:{text:js,value:Ns},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 j.DropDownList({dataSource:this.getEndData(),popupWidth:this.getPopupWidth(),floatLabelType:"Always",placeholder:this.localeObj.getConstant("end"),enableRtl:this.enableRtl,index:1,fields:{text:js,value:Ns},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 j.DropDownList({dataSource:this.getMonthData(),fields:{text:js,value:Ns},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 H.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."+Cs)),e=e.target;e.classList.contains(Cs)?1<t.length&&(U.removeClass([e],Cs),n.triggerChangeEvent()):(U.addClass([e],Cs),n.triggerChangeEvent())})}},l.prototype.radioButtonRender=function(){var e=this;this.onMonthDay=new H.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 H.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 P.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 P.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 P.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."+Cs)),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+=Ls+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 Ls: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=(c.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()},c.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)}]},c.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))},c.prototype.refresh=function(){this.destroy(!0),this.renderEventWindow()},c.prototype.refreshRecurrenceEditor=function(){var e;this.recurrenceEditor&&(e=this.recurrenceEditor.element,this.recurrenceEditor.destroy(),this.createRecurrenceEditor(e))},c.prototype.setRecurrenceEditor=function(e){this.parent.editorTemplate&&(this.recurrenceEditor=e)},c.prototype.openEditor=function(e,t,i,n){var r;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.setEditorContent(e,t,n):this.renderFormElements(this.element.querySelector(".e-schedule-form"),e,t,n)},c.prototype.setEditorContent=function(e,t,i){switch(!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,i);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)}},c.prototype.setDialogContent=function(){this.dialogObject.content=this.getEventWindowContent(),this.dialogObject.dataBind(),this.applyFormValidation()},c.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()},c.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()},c.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},c.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},c.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},c.prototype.preventEventSave=function(e){this.parent&&!this.parent.allowKeyboardInteraction&&"Enter"===e.code&&(this.isEnterKey=!0)},c.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 p.Deferred);return this.parent.trigger(ae,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()+Ve*e.duration),i.dataBind()),r.parent.editorTemplate&&r.element.querySelector(".e-recurrenceeditor")&&!r.recurrenceEditor&&(r.recurrenceEditor=r.getInstance("e-recurrenceeditor")),s.resolve(n)}),s},c.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 p.Deferred;return this.parent.trigger(se,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},c.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},c.prototype.renderFormElements=function(e,t,i,n){var r=this;if(U.isNullOrUndefined(this.parent.editorTemplate))e.appendChild(this.getDefaultEventWindowContent()),t&&this.setEditorContent(t,i,n);else{if(t&&(this.fieldValidator&&(this.fieldValidator.destroy(),this.fieldValidator=null),this.recurrenceEditor&&(this.recurrenceEditor.destroy(),this.recurrenceEditor=null),this.destroyComponents(),this.parent.resetTemplates(["editorTemplate"]),U.EventHandler.clearEvents(e),!this.parent.isReact))for(var a=0,s=[].slice.call(e.children);a<s.length;a++){var o=s[a];U.remove(o)}var l=this.parent.element.id+"_editorTemplate",l=[].slice.call(this.parent.getEditorTemplate()(t||{},this.parent,"editorTemplate",l,!1));U.append(l,e),this.parent.renderTemplates(function(){r.element&&(r.applyFormValidation(),t)&&r.setEditorContent(t,i,n)})}},c.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(Nn)),t.appendChild(this.renderTextBox(Ln)),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 H.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},c.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()},c.prototype.createDivElement=function(e){return U.createElement("div",{className:e})},c.prototype.createInputElement=function(e,t,i){return U.createElement(i||"input",{className:e,attrs:{type:"text",name:t,value:"",id:t}})},c.prototype.getSlotDuration=function(){return this.parent.activeViewOptions.timeScale.interval/this.parent.activeViewOptions.timeScale.slotCount},c.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},c.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()}},c.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=Ve*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)},c.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 j.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 j.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},c.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 j.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 p.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},c.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()}},c.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},c.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())},c.prototype.filterDatasource=function(e,t){var i=this.parent.resourceBase.resourceCollection[e+1];return i.dataSource.filter(function(e){return e[i.groupIDField]===t})},c.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())},c.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 H.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},c.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),P.Input.createInput({element:i,floatLabelType:"Always",properties:{enableRtl:this.parent.enableRtl,placeholder:this.getFieldLabel(e)}}),t},c.prototype.getFieldName=function(e){var t="";switch(e){case Nn:t=this.fields.subject;break;case Ln: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},c.prototype.getFieldLabel=function(e){var t="";switch(e){case Nn:t=this.parent.editorTitles.subject;break;case Ln: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},c.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))},c.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"))},c.prototype.loadRecurrenceEditor=function(){this.repeatDialogObject.show(),this.recurrenceEditor&&this.repeatRule&&this.recurrenceEditor.setRecurrenceRule(this.repeatRule)},c.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))},c.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()},c.prototype.closeRepeatDialog=function(){this.repeatDialogObject.hide()},c.prototype.repeatCancelDialog=function(){this.closeRepeatDialog(),this.recurrenceEditor&&this.recurrenceEditor.setRecurrenceRule(this.repeatTempRule),this.repeatTempRule||this.repeatStatus.setProperties({checked:!1})},c.prototype.repeatOpenDialog=function(){this.repeatTempRule=this.recurrenceEditor.getRecurrenceRule()},c.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())},c.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)},c.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&&(this.fieldValidator.destroy(),this.fieldValidator=null),this.fieldValidator=new za,this.fieldValidator.renderFormValidator(n,t,this.element,this.parent.locale))},c.prototype.showDetails=function(e){this.eventData=e;for(var t=U.extend({},e,null,!0),e=this.getFormElements(kn),i=(this.cellClickAction&&(!this.cellClickAction||U.isNullOrUndefined(this.parent.editorTemplate))||0!==t[this.fields.endTime].getHours()||0!==t[this.fields.endTime].getMinutes()||this.trimAllDay(t),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)},c.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},c.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)},c.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(Ve*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()},c.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},c.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())},c.prototype.disableButton=function(e,t){e&&(e.ej2_instances[0].disabled=t)},c.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})},c.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())},c.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})},c.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())},c.prototype.resetForm=function(){this.fieldValidator.destroyToolTip(),this.resetFormFields(),this.parent.isAdaptive||!this.recurrenceEditor||this.recurrenceEditor.isDestroyed||this.recurrenceEditor.resetFields()},c.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)},c.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)}},c.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())},c.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}},c.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},c.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},c.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},c.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},c.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)},c.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},c.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},c.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))},c.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},c.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?Ze(t,y.idField,T[parseInt(i.toString(),10)],n,a):Ze(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)}},c.prototype.getEventIdFromForm=function(){return this.element.querySelector("."+Rn).getAttribute("data-id")},c.prototype.getFormElements=function(e){return e===kn?[].slice.call(this.element.querySelectorAll("."+Js)):[].slice.call(this.parent.element.querySelectorAll("."+e+" ."+Js))},c.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},c.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},c.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=""},c.prototype.getInstance=function(e){e=this.element.querySelector("."+e);return e?e.ej2_instances[0]:null},c.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()}},c.prototype.getRecurrenceEditorInstance=function(){return this.parent.isAdaptive&&!this.repeatDialogObject&&this.renderRepeatDialog(),this.recurrenceEditor},c.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()},c.prototype.detachComponents=function(){for(var e=0,t=this.getFormElements(kn);e<t.length;e++){var i=t[e];U.detach(i)}},c.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&&($e(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)},c);function c(e){this.parent=e,this.l10n=this.parent.localeObj,this.fields=this.parent.eventFields,this.eventWindowTime={startTime:new Date,endTime:new Date},this.renderEventWindow()}h.prototype.addEventListener=function(){!this.parent||this.parent&&this.parent.isDestroyed||this.parent.on(be,this.virtualScrolling,this)},h.prototype.removeEventListener=function(){!this.parent||this.parent&&this.parent.isDestroyed||this.parent.off(be,this.virtualScrolling)},h.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},h.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)},h.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("."+C),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("."+A)).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},h.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("."+A),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")},h.prototype.setItemSize=function(){this.isHorizontalScroll?this.itemSize=Ae(this.parent.activeView.element,O,this.parent.uiStateValues.isTransformed)||this.itemSize:this.itemSize=this.parent.getElementHeightFromClass(this.parent.activeView.element,O)||this.itemSize},h.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("."+A),e=this.parent.element.querySelector("."+Mt),this.parent.rowAutoHeight||(this.enableTransition=!1,U.removeClass([r,n],"e-transition")),i=(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)<0?0:i,this.existingDataCollection=this.parent.resourceBase.renderedResources,this.parent.resourceBase.renderedResources=this.parent.resourceBase.expandedResources.slice(i,t),0<this.parent.resourceBase.renderedResources.length)&&this.updateContent(n,r,e,this.parent.resourceBase.renderedResources)},h.prototype.renderEvents=function(){this.setTabIndex();var e=this.triggerScrollEvent(ve);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(we,{}),this.parent.hideSpinner()},h.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("."+A));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("."+C),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=[],this.existingDataCollection=this.parent.resourceBase.renderedResources,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(me),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)))},h.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(me),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))},h.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===me?i.parent.showSpinner():t===ve&&!U.isNullOrUndefined(e.eventData)&&0<e.eventData.length&&(n=e.eventData)})),n},h.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},h.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)},h.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)},h.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)},h.prototype.getCollection=function(e,t){this.translateY=e*this.itemSize;e=this.getResCollection(e,t);return this.parent.enableRtl&&(this.translateY=-this.translateY),e},h.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},h.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},h.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},h.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)},h.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(i.querySelector("div"));this.parent.resourceBase.renderedResources=n;for(var s=this.parent.activeView.getGroupIndices(n),o=this.parent.activeView.getGroupIndices(this.existingDataCollection),l=s.filter(function(e){return o.indexOf(e)<0}),p=Array.from(e.querySelectorAll("tbody tr")),c=Array.from(t.querySelectorAll("tbody tr")),h=e.querySelector("tbody"),d=t.querySelector("tbody"),u=(this.removeObsoleteRows(p,s),this.removeObsoleteRows(c,s),this.parent.resourceBase.getContentRows(n,!0)),g=this.parent.activeView.getContentRows(),e=this.parent.activeView.getEventRows(n.length),a=0;a<l.length;a++){var m=s.indexOf(l[parseInt(a.toString(),10)]);0===m?(U.prepend([u[parseInt(a.toString(),10)]],h),U.prepend([g[parseInt(a.toString(),10)]],d)):h&&d&&h.children[parseInt(m.toString(),10)]&&d.children[parseInt(m.toString(),10)]?(h.insertBefore(u[parseInt(a.toString(),10)],h.children[parseInt(m.toString(),10)]),d.insertBefore(g[parseInt(a.toString(),10)],d.children[parseInt(m.toString(),10)])):(U.append([u[parseInt(a.toString(),10)]],h),U.append([g[parseInt(a.toString(),10)]],d))}U.append(e,i)},h.prototype.removeObsoleteRows=function(e,i){e.forEach(function(e){var t=parseInt(e.firstElementChild.getAttribute("data-group-index"),10);i.indexOf(t)<0&&U.remove(e)})},h.prototype.updateHorizontalContent=function(e,t){this.existingDataCollection=this.parent.resourceBase.expandedResources,this.parent.resourceBase.expandedResources=t;var i=this.parent.getSelectedCells(),i=(this.focusedEle=i[i.length-1]||this.focusedEle,e.querySelector("tbody")),i=Array.from(i.querySelectorAll("tr"));"Month"===this.parent.currentView?this.updateMonthViewContent(e,t):this.updateOtherViewContent(e,t,i)},h.prototype.updateMonthViewContent=function(e,t){for(var i=e.querySelectorAll(" tr").length,n=0;n<i;n++)U.remove(e.querySelector("tbody tr"));this.parent.activeViewOptions.group.byDate?this.parent.activeView.colLevels[0]=t:this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-2]=t;t=this.parent.activeView.getContentRows();U.append(t,e.querySelector("tbody"))},h.prototype.updateOtherViewContent=function(e,t,i){for(var n=e.querySelector("tbody"),r=e.querySelector("colgroup"),a=e.querySelector("thead"),s=e.querySelector("table"),o=(this.parent.activeView.colLevels[this.parent.activeView.colLevels.length-1]=t,new Set(t.map(function(e){return e.groupIndex}))),l=(i.forEach(function(e){e.querySelectorAll("td").forEach(function(e){var t=parseInt(e.getAttribute("data-group-index"),10);o.has(t)||e.remove()})}),[].slice.call(e.querySelector("colgroup").children)),p=0;p<l.length;p++)U.remove(l[parseInt(p.toString(),10)]);t.forEach(function(){return r.appendChild(U.createElement("col"))});for(var c=[].slice.call(e.querySelector("thead").children),p=0;p<c.length;p++)U.remove(c[parseInt(p.toString(),10)]);a.appendChild(this.parent.eventBase.createEventWrapper("",0<this.startIndex?this.startIndex:0)),this.parent.activeViewOptions.timeScale.enable&&a.appendChild(this.parent.eventBase.createEventWrapper("timeIndicator")),U.prepend([a],s);i=this.parent.activeView.getContentRows();this.mergeNewTdData(n,i)},h.prototype.mergeNewTdData=function(e,t){Array.from(e.querySelectorAll("tr")).forEach(function(s,e){var o;e<t.length&&(e=t[parseInt(e.toString(),10)],o=Array.from(s.querySelectorAll("td")),Array.from(e.querySelectorAll("td")).forEach(function(e){for(var t=parseInt(e.getAttribute("data-group-index").toString(),10),i=!1,n=0,r=o;n<r.length;n++){var a=r[n];if(t<parseInt(a.getAttribute("data-group-index").toString(),10)){s.insertBefore(e,a),i=!0;break}}i||s.appendChild(e)}))})},h.prototype.getBufferCollection=function(e,t){return this.parent.resourceBase.expandedResources.slice(e,t)},h.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)"})},h.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)},h.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}))},h.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)},h.prototype.destroy=function(){this.removeEventListener(),this.focusedEle=null};var io=h;function h(e){this.translateY=0,this.itemSize=60,this.bufferCount=3,this.renderedLength=0,this.averageRowHeight=0,this.startIndex=0,this.existingDataCollection=[],this.enableTransition=!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(ne,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(re,null,function(){t.parent.hideSpinner(),t.parent.isPrinting&&setTimeout(function(){t.parent.notify(fe,{})},100)}))})},bo.prototype.dataManagerFailure=function(e){var t=this;!this.parent||this.parent&&this.parent.isDestroyed||this.parent.trigger(Z,{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(ye,{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(ye,{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.action&&(this.parent.dragAndDropModule.actionObj.element.style.display="none"),this.parent.resizeModule&&this.parent.resizeModule.actionObj&&this.parent.resizeModule.actionObj.element&&this.parent.resizeModule.actionObj.action&&(this.parent.resizeModule.actionObj.element.style.display="none"),this.parent.isSpecificResourceEvents()&&("eventCreated"===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(K,e,function(e){e.cancel||t.refreshDataManager()}):i.promise.then(function(){!t.parent||t.parent&&t.parent.isDestroyed||t.parent.trigger(K,e,function(e){e.cancel||t.refreshDataManager()})}).catch(function(e){!t.parent||t.parent&&t.parent.isDestroyed||t.parent.trigger(Z,{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(Q,{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(Q,{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(Q,{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(Q,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(Q,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,h=[],d=!1;if(e instanceof Array)for(var t=0,i=e;t<i.length;t++){var n=i[t];h.push(this.getParentEvent(n,!0))}else h=this.getParentEvent(e,!0);var e=e instanceof Array?e:[e],r={requestType:"EditSeries"===p?"eventChange":"eventRemove",cancel:!1,addedRecords:[],changedRecords:[],deletedRecords:[]};if(r.data=h,"EditSeries"===p?r.changedRecords=e:r.deletedRecords=e,"EditSeries"===p&&!this.parent.uiStateValues.isIgnoreOccurrence)for(var a=h instanceof Array?h:[h],s=0,o=r.changedRecords.length;s<o;s++){var l=a[parseInt(s.toString(),10)],l=this.parent.eventBase.getEventCollections(l),l=l.follow.concat(l.occurrence);r.deletedRecords=r.deletedRecords.concat(l)}this.parent.trigger(Q,r,function(e){if(!e.cancel){for(var a=c.parent.eventFields,s={addedRecords:[],changedRecords:[],deletedRecords:[]},o=h instanceof Array?h:[h],l="EditSeries"===p?e.changedRecords:e.deletedRecords,t=0,i=l.length;t<i;t++)!function(e){var t,i=l[parseInt(e.toString(),10)],n=o[parseInt(e.toString(),10)],e=c.parent.eventBase.getEventCollections(n),r=e.follow.concat(e.occurrence);switch(p){case"EditSeries":i[a.id]=n[a.id],i[a.recurrenceID]=null,i[a.followingID]=null,c.parent.uiStateValues.isIgnoreOccurrence&&i[a.recurrenceException]?0<(t=c.parent.eventsData.filter(function(e){return e[a.id]===i[a.id]})).length&&(i[a.recurrenceRule]=t[0][a.recurrenceRule]):(i[a.recurrenceException]=null,s.deletedRecords=s.deletedRecords.concat(r)),s.changedRecords.push(c.parent.eventBase.processTimezone(i,!0)),c.parent.uiStateValues.isIgnoreOccurrence=!1;break;case"DeleteSeries":s.deletedRecords=s.deletedRecords.concat(r.concat(n)),d=!0}}(t);var n=c.parent.dataModule.dataManager.saveChanges(s,a.id,c.getTable(),c.getQuery()),r=U.extend({},l[l.length-1],null,!0),r=(c.parent.eventBase.selectWorkCellByTime("EditSeries"===p?[c.parent.eventBase.processTimezone(r)]:[r]),{requestType:"EditSeries"===p?"eventChanged":"eventRemoved",cancel:!1,data:d?e.deletedRecords:e.changedRecords,promise:n,editParams:s});c.refreshData(r)}})},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(Q,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(Q,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}}Co.prototype.cellMouseDown=function(e){this.isPreventAction(e)||this.parent.notify(Ee,{event:e})},Co.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(w),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(q,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(ue,t)):s.parent.notify(q,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"))},Co.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(F,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")}))},Co.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(X,{element:t,event:e})},Co.prototype.isPreventAction=function(e){var t;return!(U.closest(e.target,"."+Oi)||(!U.closest(e.target,"."+V)||U.closest(e.target,"."+tn))&&(t=U.closest(e.target,"."+x+",."+kt),U.isNullOrUndefined(t))&&(t=U.closest(e.target,"."+Dt),!this.parent.activeView||!this.parent.activeView.isTimelineView()||U.isNullOrUndefined(t)))},Co.prototype.destroy=function(){U.EventHandler.remove(this.parent.element,"mouseover",this.onHover)};var So=Co;function Co(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)},u=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),u([U.Property("Id")],Mo.prototype,"id",void 0),u([U.Property("IsBlock")],Mo.prototype,"isBlock",void 0),u([U.Complex({name:"Subject"},To)],Mo.prototype,"subject",void 0),u([U.Complex({name:"StartTime"},To)],Mo.prototype,"startTime",void 0),u([U.Complex({name:"EndTime"},To)],Mo.prototype,"endTime",void 0),u([U.Complex({name:"StartTimezone"},To)],Mo.prototype,"startTimezone",void 0),u([U.Complex({name:"EndTimezone"},To)],Mo.prototype,"endTimezone",void 0),u([U.Complex({name:"Location"},To)],Mo.prototype,"location",void 0),u([U.Complex({name:"Description"},To)],Mo.prototype,"description",void 0),u([U.Complex({name:"IsAllDay"},To)],Mo.prototype,"isAllDay",void 0),u([U.Complex({name:"RecurrenceID"},To)],Mo.prototype,"recurrenceID",void 0),u([U.Complex({name:"RecurrenceRule"},To)],Mo.prototype,"recurrenceRule",void 0),u([U.Complex({name:"RecurrenceException"},To)],Mo.prototype,"recurrenceException",void 0),u([U.Property("IsReadonly")],Mo.prototype,"isReadonly",void 0),u([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)},u=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),u([U.Property()],Ho.prototype,"template",void 0),u([U.Property([])],Ho.prototype,"dataSource",void 0),u([U.Property()],Ho.prototype,"query",void 0),u([U.Complex({},Vo)],Ho.prototype,"fields",void 0),u([U.Property(!1)],Ho.prototype,"enableTooltip",void 0),u([U.Property("AllDayRow")],Ho.prototype,"spannedEventPlacement",void 0),u([U.Property(1)],Ho.prototype,"minimumEventDuration",void 0),u([U.Property()],Ho.prototype,"tooltipTemplate",void 0),u([U.Property()],Ho.prototype,"resourceColorField",void 0),u([U.Property(!1)],Ho.prototype,"editFollowingEvents",void 0),u([U.Property(!0)],Ho.prototype,"allowAdding",void 0),u([U.Property(!0)],Ho.prototype,"allowEditing",void 0),u([U.Property(!0)],Ho.prototype,"allowDeleting",void 0),u([U.Property(!1)],Ho.prototype,"enableMaxHeight",void 0),u([U.Property(!1)],Ho.prototype,"enableIndicator",void 0),u([U.Property(!1)],Ho.prototype,"ignoreWhitespace",void 0),u([U.Property()],Ho.prototype,"sortComparer",void 0),u([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)},u=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(No,jo),u([U.Property(!1)],No.prototype,"byDate",void 0),u([U.Property(!0)],No.prototype,"byGroupID",void 0),u([U.Property(!1)],No.prototype,"allowGroupEdit",void 0),u([U.Property([])],No.prototype,"resources",void 0),u([U.Property(!0)],No.prototype,"enableCompactView",void 0),u([U.Property()],No.prototype,"headerTooltipTemplate",void 0),u([U.Property(!1)],No.prototype,"hideNonWorkingDays",void 0),No);function No(){return null!==jo&&jo.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,qo,u=function(e,t){function i(){this.constructor=e}Lo(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},u=(qo=U.ChildProperty,u(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}g.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($,n),e.appendChild(t)},g.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!==Nt||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))}},g.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},g.prototype.setRenderedResources=function(){var e=this.resourceCollection;this.generateTreeData(!0);this.countCalculation(e.slice(0,-2),e.slice(0,-1)),this.renderedResources=this.lastResourceLevel},g.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},g.prototype.getContentRows=function(e,t){for(var i,n,r,a,s=[],o=this.resourceCollection,l=U.createElement("tr"),p=U.createElement("td",{attrs:{tabindex:t?"-1":"0"}}),c=this.parent.activeView.getGroupIndices(),h=0;h<e.length;h++)0<c.length&&-1<c.indexOf(e[parseInt(h.toString(),10)].groupIndex)||(i=p.cloneNode(),(r=Ze(o,"name",e[parseInt(h.toString(),10)].resource.name))===o.length-1?(U.extend(e[parseInt(h.toString(),10)].resourceData,{ClassName:jt}),this.renderedResources[parseInt(h.toString(),10)].className=[jt]):(U.extend(e[parseInt(h.toString(),10)].resourceData,{ClassName:Nt}),this.renderedResources[parseInt(h.toString(),10)].className=[Nt]),a=r*this.leftPixel+"px",e[parseInt(h.toString(),10)].resourceData.ClassName===Nt&&!U.isNullOrUndefined(e[parseInt(h.toString(),10)].resourceData.Count)&&0<e[parseInt(h.toString(),10)].resourceData.Count&&(n=void 0,n=e[parseInt(h.toString(),10)].resourceData[o[parseInt(r.toString(),10)].expandedField]||U.isNullOrUndefined(e[parseInt(h.toString(),10)].resourceData[o[parseInt(r.toString(),10)].expandedField])?qt:Lt,r=U.createElement("div"),U.addClass([r],[Ft,n]),this.setMargin(r,a),i.appendChild(r),1<this.resourceCollection.length)&&U.EventHandler.add(r,"click",this.onTreeIconClick,this),this.parent.activeView.setResourceHeaderContent(i,e[parseInt(h.toString(),10)],Rt),i.setAttribute("data-group-index",e[parseInt(h.toString(),10)].groupIndex.toString()),i.setAttribute("aria-label",e[parseInt(h.toString(),10)].resourceData[e[parseInt(h.toString(),10)].resource.textField]+" resource"),this.parent.activeViewOptions.resourceHeaderTemplate||this.setMargin(i.querySelector("."+Rt),a),n=[Ut,e[parseInt(h.toString(),10)].resourceData.ClassName],U.addClass([i],n),r={elementType:"resourceHeader",element:i,groupIndex:e[parseInt(h.toString(),10)].groupIndex},this.parent.trigger($,r),(a=l.cloneNode()).appendChild(i),s.push(a));return s},g.prototype.setMargin=function(e,t){this.parent.enableRtl?e.style.marginRight=t:e.style.marginLeft=t},g.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 p.Query).where(t[t.length-1].groupIDField,"equal",n[parseInt(r.toString(),10)][e[e.length-(i+1)].idField]),new p.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)}},g.prototype.onTreeIconClick=function(r){var a,s=this,o=(this.parent.eventTooltip&&this.parent.eventTooltip.close(),r.target),e=U.closest(o,"."+Nt).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(Q,p,function(e){if(!e.cancel){a=o.classList.contains(qt)?(U.classList(o,[Lt],[qt]),!0):(U.classList(o,[qt],[Lt]),!1);for(var t=0,i=[].slice.call(s.parent.element.querySelectorAll("."+x+",."+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(K,p)}})},g.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("."+A+" tbody tr")),l=[].slice.call(this.parent.element.querySelectorAll("."+A+" ."+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(Nt);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,[Lt],[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],[Lt]),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))}},g.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.parent.virtualScrollModule.existingDataCollection=this.renderedResources,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("."+A+" 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("."+C).offsetHeight+"px")},g.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("."+A)).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)},g.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(Oe,this.documentClick,this)},g.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())},g.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},g.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);$e(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)},g.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))},g.prototype.selectResourceByIndex=function(e){this.lastResourceLevel&&-1<e&&e<this.lastResourceLevel.length&&this.triggerEvents(e)},g.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())},g.prototype.triggerEvents=function(e,t){var i=this,n={cancel:!1,event:t?t.event:null,groupIndex:e,requestType:"resourceChange"};this.parent.trigger(Q,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(K,n))})},g.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))},g.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)})},g.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)}},g.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}},g.prototype.refreshLayout=function(e){!U.isNullOrUndefined(this.parent.uiStateValues.groupIndex)&&this.parent.enablePersistence||(this.parent.uiStateValues.groupIndex=0),this.parent.renderElements(e)},g.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=Ze(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)},g.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)},g.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},g.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 S=[],C=0,j=function(a){O.resourceDateTree[parseInt(C.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(C.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 S[parseInt(n.toString(),10)]||(S[parseInt(n.toString(),10)]=[]),i=r.renderDates.filter(function(e){return e.getDay()===a.date.getDay()}),S[parseInt(n.toString(),10)]=S[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)}C++},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){S[parseInt(t.toString(),10)]&&(e.renderDates=S[parseInt(t.toString(),10)].sort(function(e,t){return e.getTime()-t.getTime()}))})}else{for(var x=0,A=0,N=D[0];A<N.length;A++)x+=N[A].colSpan;for(var I=0,L=i;I<L.length;I++){(M=L[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},g.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])}},g.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},g.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},g.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},g.prototype.filterData=function(e,t,i){return e.filter(function(e){return e[""+t]===i})},g.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)])},g.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 p.DataManager({json:i.dataSource}).insert(e,null,null,n+t)}),"break"}(a[i]);i++);this.refreshLayout(!0)},g.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 p.DataManager({json:t.dataSource}).remove(t.idField,e)}),"break"}(r[t]);t++);this.refreshLayout(!0)},g.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))},g.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(Lt)&&!e||a.classList.contains(qt)&&e)&&a.click()},g.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("."+A),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)]))},g.prototype.destroy=function(){this.parent.off(Oe,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=g;function g(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)},m=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(v,Xo),v.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 So(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()},v.prototype.renderTableContainer=function(){this.element.querySelector("."+gt)||this.element.appendChild(this.createElement("div",{className:gt}))},v.prototype.getEventTemplateName=function(e){e="eventTemplate_"+e;return this.activeEventTemplates.indexOf(e)<0&&this.activeEventTemplates.push(e),e},v.prototype.getElementWidth=function(e){return rt(e,this.uiStateValues.isTransformed)},v.prototype.getElementHeight=function(e){return at(e,this.uiStateValues.isTransformed)},v.prototype.getElementHeightFromClass=function(e,t){return xe(e,t,this.uiStateValues.isTransformed)},v.prototype.renderTemplates=function(e){this.isReact?this.renderReactTemplates(e):e&&e()},v.prototype.resetTemplates=function(e){(this.isAngular||this.isReact)&&this.clearTemplate(e)},v.prototype.sanitize=function(e,t){this.enableHtmlSanitizer?t.innerText=U.SanitizeHtmlHelper.sanitize(e):t.innerHTML=e},v.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))},v.prototype.destroyEditorWindow=function(){this.eventWindow&&(this.eventWindow.destroy(),this.eventWindow=null),this.eventWindow=new to(this)},v.prototype.renderElements=function(e){e?(this.initializeView(this.currentView),this.eventWindow.refresh()):(this.destroyHeaderModule(),this.showHeaderBar&&(this.headerModule=new Ir(this)),this.renderTableContainer(),this.uiStateValues.isTransformed=Math.round(this.element.getBoundingClientRect().width)!==this.element.offsetWidth,(U.Browser.isDevice||U.Browser.isTouch)&&(this.scheduleTouchModule=new Rr(this)),this.initializeView(this.currentView),this.destroyPopups(),this.isPrinting||this.initializePopups())},v.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()},v.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},v.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)}},v.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},v.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)},v.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")}},v.prototype.initializeView=function(e){this.showSpinner(),this.activeViewOptions=this.getActiveViewOptions(),this.resourceBase&&this.resourceBase.setResourceCollection(),this.initializeTemplates(),this.renderModule.render(e)},v.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)},v.prototype.initializePopups=function(){this.eventWindow=new to(this),this.quickPopup=new _a(this)},v.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},v.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},v.prototype.getCalendarMode=function(){return U.isNullOrUndefined(this.calendarMode)?"gregorian":this.calendarMode.toLowerCase()},v.prototype.getTimeString=function(e){return this.globalize.formatDate(e,{format:this.activeViewOptions.timeFormat,type:"time",calendar:this.getCalendarMode()}).toLocaleUpperCase()},v.prototype.getDateTime=function(e){return e instanceof Date?new Date(e.getTime()):new Date(e)},v.prototype.setCalendarMode=function(){"Islamic"===this.calendarMode?this.calendarUtil=new Fr:this.calendarUtil=new Lr},v.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(Q,{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(J,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(K,a))}))}))},v.prototype.changeDate=function(t,i){var n,r=this;this.trigger(Q,{requestType:"dateNavigate",cancel:!1,event:i},function(e){e.cancel||(e={action:"date",cancel:!1,previousDate:r.selectedDate,currentDate:t},r.trigger(J,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(K,n))}))})},v.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()},v.prototype.isSelectedDate=function(e){return e.setHours(0,0,0,0)===new Date(""+this.selectedDate).setHours(0,0,0,0)},v.prototype.getCurrentTime=function(e){return void 0===e&&(e=new Date),this.timezone?this.tzModule.convert(e,this.tzModule.getLocalTimezoneName(),this.timezone):e},v.prototype.getNavigateView=function(){return this.activeView.isTimelineView()?"TimelineMonth"===this.currentView||"TimelineYear"===this.currentView?"TimelineDay":"Agenda":"Day"},v.prototype.animateLayout=function(){this.activeView.element&&new U.Animation({duration:600,name:"FadeIn",timingFunction:"easeIn"}).animate(this.activeView.element)},v.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},v.prototype.preRender=function(){this.isAdaptive=U.Browser.isDevice||nt(),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,isTransformed:!1}),this.currentTimezoneDate=this.getCurrentTime(),this.activeCellsData={startTime:new Date(this.currentTimezoneDate),endTime:new Date(this.currentTimezoneDate),isAllDay:!1},this.activeEventData={event:void 0,element:void 0},this.getDefaultLocale(),this.localeObj=new 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()},v.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"}},v.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)},v.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=[])},v.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}))},v.prototype.selectCell=function(e){this.removeSelectedClass(),this.addSelectedClass([e],e)},v.prototype.getAllDayRow=function(){return this.element.querySelector("."+vt)},v.prototype.getContentTable=function(){return this.activeView.element.querySelector("."+C+" tbody")},v.prototype.getTableRows=function(){return[].slice.call(this.element.querySelectorAll("."+C+" tbody tr:not(."+sr+")"))},v.prototype.getWorkCellElements=function(){return[].slice.call(this.element.querySelectorAll("."+O))},v.prototype.getIndexOfDate=function(e,t){return e.map(Number).indexOf(+t)},v.prototype.isAllDayCell=function(e){return!(!(-1<["Month","TimelineMonth","TimelineYear","MonthAgenda"].indexOf(this.currentView)||e.classList.contains(w)||e.classList.contains(Dt))&&this.activeViewOptions.timeScale.enable&&!(this.activeView.isTimelineView()&&0<this.activeViewOptions.headerRows.length&&"Hour"!==this.activeViewOptions.headerRows.slice(-1)[0].option))},v.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)},v.prototype.getTargetElement=function(e,t,i){var n,t=document.elementFromPoint(t,i);return(n=t?t.closest(e):n)?[n]:null},v.prototype.getCellHeaderTemplate=function(){return this.cellHeaderTemplateFn},v.prototype.getDayHeaderTemplate=function(){return this.dayHeaderTemplateFn},v.prototype.getMonthHeaderTemplate=function(){return this.monthHeaderTemplateFn},v.prototype.getCellTemplate=function(){return this.cellTemplateFn},v.prototype.getDateHeaderTemplate=function(){return this.dateHeaderTemplateFn},v.prototype.getDateRangeTemplate=function(){return this.dateRangeTemplateFn},v.prototype.getMajorSlotTemplate=function(){return this.majorSlotTemplateFn},v.prototype.getMinorSlotTemplate=function(){return this.minorSlotTemplateFn},v.prototype.getAppointmentTemplate=function(){return this.appointmentTemplateFn},v.prototype.getEventTooltipTemplate=function(){return this.eventTooltipTemplateFn},v.prototype.getHeaderTooltipTemplate=function(){return this.headerTooltipTemplateFn},v.prototype.getEditorTemplate=function(){return this.editorTemplateFn},v.prototype.getEditorHeaderTemplate=function(){return this.editorHeaderTemplateFn},v.prototype.getEditorFooterTemplate=function(){return this.editorFooterTemplateFn},v.prototype.getQuickInfoTemplatesHeader=function(){return this.quickInfoTemplatesHeaderFn},v.prototype.getQuickInfoTemplatesContent=function(){return this.quickInfoTemplatesContentFn},v.prototype.getQuickInfoTemplatesFooter=function(){return this.quickInfoTemplatesFooterFn},v.prototype.getResourceHeaderTemplate=function(){return this.resourceHeaderTemplateFn},v.prototype.getHeaderIndentTemplate=function(){return this.headerIndentTemplateFn},v.prototype.getCssProperties=function(){return{border:this.enableRtl?"borderLeftWidth":"borderRightWidth",padding:this.enableRtl?"paddingLeft":"paddingRight",rtlBorder:this.enableRtl?"borderRightWidth":"borderLeftWidth",rtlPadding:this.enableRtl?"paddingRight":"paddingLeft"}},v.prototype.removeNewEventElement=function(){var e=this.element.querySelector("."+Pi);U.isNullOrUndefined(e)||U.remove(e)},v.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)},v.prototype.onDocumentClick=function(e){this.notify(Oe,{event:e})},v.prototype.onScheduleResize=function(){var e,t;U.isNullOrUndefined(this.activeView)||(this.isAdaptive||it())&&document.activeElement&&(document.activeElement.classList.contains(Nn)||document.activeElement.classList.contains(Cr))||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(),Ke(),"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.virtualScrollModule&&!this.virtualScrollModule.enableTransition&&(e=this.element.querySelector("."+Ht),t=this.element.querySelector("."+A),this.virtualScrollModule.enableTransition=!0,U.addClass([t,e],"e-transition"))):this.notify(we,{}))},v.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)}},v.prototype.getSelectedCells=function(){return[].slice.call(this.element.querySelectorAll("."+ni))},v.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},v.prototype.boundaryValidation=function(e,t){var i={left:!1,right:!1,top:!1,bottom:!1},n=this.element.querySelector("."+A).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},v.prototype.getWeekNumberContent=function(e){var t,i,n;return"FirstDay"===this.weekRule?(t=Re(e.slice(-1)[0],this.firstDayOfWeek),t=this.globalize.formatNumber(je(t))):"FirstFourDayWeek"===this.weekRule?(i=Ne(n=ke(e.slice(-1)[0],this.firstDayOfWeek),Re(e.slice(-1)[0],this.firstDayOfWeek)),t=this.globalize.formatNumber(je(i))):"FirstFullWeek"===this.weekRule&&(n=ke(e.slice(-1)[0],this.firstDayOfWeek),t=this.globalize.formatNumber(je(n))),t},v.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))},v.prototype.isSpecificResourceEvents=function(){return 0<this.activeViewOptions.group.resources.length&&!this.activeViewOptions.group.allowGroupEdit&&!this.rowAutoHeight&&!this.virtualScrollModule&&this.activeViewOptions.group.byGroupID},v.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)},v.prototype.getModuleName=function(){return"schedule"},v.prototype.getPersistData=function(){return this.addOnPersist(["currentView","selectedDate","scrollTop","scrollLeft","adaptiveGroupIndex"])},v.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)}},v.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())},v.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("."+w)))[0].style.height=t.style.height||e[1].style.height)),this.uiStateValues.expand||(t.style.height="")},v.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(Ce,{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}},v.prototype.setRtlClass=function(){this.enableRtl?U.addClass([this.element],"e-rtl"):U.removeClass([this.element],"e-rtl")},v.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())},v.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}},v.prototype.destroyHeaderModule=function(){this.headerModule&&(this.headerModule.destroy(),this.headerModule=null)},v.prototype.destroyPopups=function(){this.quickPopup&&(this.quickPopup.destroy(),this.quickPopup=null),this.eventWindow&&(this.eventWindow.destroy(),this.eventWindow=null)},v.prototype.showSpinner=function(){M.showSpinner(this.element)},v.prototype.hideSpinner=function(){M.hideSpinner(this.element)},v.prototype.setWorkHours=function(e,t,i,n){e=this.getWorkHourCells(e,t,i,n);U.addClass(e,ft)},v.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))},v.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*Ve/this.activeViewOptions.timeScale.slotCount,l=(a.getTimezoneOffset()-t.getTimezoneOffset())*Ve,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},v.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(w)||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},v.prototype.getSelectedElements=function(){return this.keyboardInteractionModule&&0<this.keyboardInteractionModule.selectedCells.length?this.keyboardInteractionModule.selectedCells:this.getSelectedCells()},v.prototype.getResourceCollections=function(){return this.resourceCollection},v.prototype.setResourceCollections=function(e,t){!(t=void 0===t?!0:t)&&this.uiStateValues&&(this.uiStateValues.isPreventEventRefresh=!0),this.setProperties({resources:e},!1)},v.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)},v.prototype.getCurrentViewIndex=function(){return this.viewIndex},v.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})},v.prototype.expandResource=function(e,t){this.activeView.isTimelineView()&&this.resourceBase&&1<this.resourceCollection.length&&this.resourceBase.resourceExpand(e,t,!1)},v.prototype.collapseResource=function(e,t){this.activeView.isTimelineView()&&this.resourceBase&&1<this.resourceCollection.length&&this.resourceBase.resourceExpand(e,t,!0)},v.prototype.scrollTo=function(e,t){this.currentView.indexOf("Agenda")<0&&U.isNullOrUndefined(this.element.querySelector(".e-work-cells"))||(this.activeView.scrollToDate&&U.isNullOrUndefined(e)&&t?this.activeView.scrollToDate(t):this.activeView.scrollToHour&&this.activeView.scrollToHour(e,t))},v.prototype.scrollToResource=function(e,t){this.resourceBase&&this.resourceBase.lastResourceLevel&&this.resourceBase.resourceScroll(e,t)},v.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)},v.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)},v.prototype.addEvent=function(e){this.crudModule.addEvent(e)},v.prototype.generateEventOccurrences=function(e,t){return this.eventBase?this.eventBase.generateOccurrence(e,t):[]},v.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)},v.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)},v.prototype.saveEvent=function(e,t){this.crudModule.saveEvent(e,t)},v.prototype.deleteEvent=function(e,t){this.crudModule.deleteEvent(e,t)},v.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)},v.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)},v.prototype.getOccurrencesByID=function(e){return this.eventBase.getOccurrencesByID(e)},v.prototype.getOccurrencesByRange=function(e,t){return e=this.getDateTime(e),t=this.getDateTime(t),this.eventBase.getOccurrencesByRange(e,t)},v.prototype.getCurrentViewDates=function(){return this.activeView?this.activeView.renderDates:[]},v.prototype.setRecurrenceEditor=function(e){this.eventWindow.setRecurrenceEditor(e)},v.prototype.getEventMaxID=function(){return this.eventBase.getEventMaxID()},v.prototype.getDeletedOccurrences=function(e){return this.eventBase.getDeletedOccurrences(e)},v.prototype.getCurrentViewEvents=function(){return this.eventsProcessed},v.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))},v.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)}},v.prototype.refreshLayout=function(){this.onScheduleResize(),this.headerModule&&this.headerModule.refresh(),this.eventWindow&&this.eventWindow.refresh()},v.prototype.getEventDetails=function(e){e=(e=U.getElement(e)).getAttribute("data-guid");return e?this.eventBase.getEventByGuid(e):{}},v.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))},v.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)},v.prototype.closeEditor=function(){this.eventWindow&&this.eventWindow.dialogClose()},v.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(q,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(ee,this.activeEventData))))},v.prototype.closeQuickInfoPopup=function(){this.quickPopup&&this.quickPopup.quickPopupHide(!0)},v.prototype.closeTooltip=function(){this.eventTooltip&&this.eventTooltip.close()},v.prototype.selectResourceByIndex=function(e){this.resourceBase&&this.uiStateValues.isGroupAdaptive&&this.resourceBase.selectResourceByIndex(e)},v.prototype.getIndexFromResourceId=function(e,t){return this.resourceBase?this.resourceBase.getIndexFromResourceId(e,t):null},v.prototype.addResource=function(e,t,i){this.resourceBase.addResource(e,t,i)},v.prototype.removeResource=function(e,t){this.resourceBase.removeResource(e,t)},v.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;$e(this.element);var i=[ot,lt,pt,ht];this.cssClass&&(i=i.concat(this.cssClass.split(" "))),U.removeClass([this.element],i)},m([U.Property("auto")],v.prototype,"width",void 0),m([U.Property("auto")],v.prototype,"height",void 0),m([U.Property(!0)],v.prototype,"showHeaderBar",void 0),m([U.Property(!0)],v.prototype,"showTimeIndicator",void 0),m([U.Property(!0)],v.prototype,"allowSwiping",void 0),m([U.Collection([],Fo)],v.prototype,"toolbarItems",void 0),m([U.Property("Week")],v.prototype,"currentView",void 0),m([U.Property(["Day","Week","WorkWeek","Month","Agenda"])],v.prototype,"views",void 0),m([U.Property(new Date)],v.prototype,"selectedDate",void 0),m([U.Property(new Date(1900,0,1))],v.prototype,"minDate",void 0),m([U.Property(new Date(2099,11,31))],v.prototype,"maxDate",void 0),m([U.Property()],v.prototype,"dateFormat",void 0),m([U.Property("Gregorian")],v.prototype,"calendarMode",void 0),m([U.Property(!0)],v.prototype,"showWeekend",void 0),m([U.Property(0)],v.prototype,"firstDayOfWeek",void 0),m([U.Property("FirstDay")],v.prototype,"weekRule",void 0),m([U.Property([1,2,3,4,5])],v.prototype,"workDays",void 0),m([U.Property(12)],v.prototype,"monthsCount",void 0),m([U.Property("00:00")],v.prototype,"startHour",void 0),m([U.Property("24:00")],v.prototype,"endHour",void 0),m([U.Property(null)],v.prototype,"timeFormat",void 0),m([U.Property(!0)],v.prototype,"enableHtmlSanitizer",void 0),m([U.Property(!1)],v.prototype,"enableAllDayScroll",void 0),m([U.Property(!1)],v.prototype,"enableAdaptiveUI",void 0),m([U.Property(!0)],v.prototype,"allowResizing",void 0),m([U.Complex({},Za)],v.prototype,"workHours",void 0),m([U.Complex({},Ja)],v.prototype,"timeScale",void 0),m([U.Property(!0)],v.prototype,"allowKeyboardInteraction",void 0),m([U.Property(!0)],v.prototype,"allowDragAndDrop",void 0),m([U.Property()],v.prototype,"dateHeaderTemplate",void 0),m([U.Property()],v.prototype,"dateRangeTemplate",void 0),m([U.Property()],v.prototype,"cellHeaderTemplate",void 0),m([U.Property()],v.prototype,"dayHeaderTemplate",void 0),m([U.Property()],v.prototype,"monthHeaderTemplate",void 0),m([U.Property()],v.prototype,"cellTemplate",void 0),m([U.Property(!1)],v.prototype,"readonly",void 0),m([U.Property(!0)],v.prototype,"showQuickInfo",void 0),m([U.Property(!1)],v.prototype,"allowInline",void 0),m([U.Property(!0)],v.prototype,"allowMultiCellSelection",void 0),m([U.Property(!0)],v.prototype,"allowMultiRowSelection",void 0),m([U.Property(!1)],v.prototype,"quickInfoOnSelectionEnd",void 0),m([U.Property(!1)],v.prototype,"showWeekNumber",void 0),m([U.Property(!1)],v.prototype,"rowAutoHeight",void 0),m([U.Property(!1)],v.prototype,"allowMultiDrag",void 0),m([U.Property(0)],v.prototype,"firstMonthOfYear",void 0),m([U.Property()],v.prototype,"editorTemplate",void 0),m([U.Property()],v.prototype,"editorHeaderTemplate",void 0),m([U.Property()],v.prototype,"editorFooterTemplate",void 0),m([U.Complex({},co)],v.prototype,"quickInfoTemplates",void 0),m([U.Property(7)],v.prototype,"agendaDaysCount",void 0),m([U.Property(!0)],v.prototype,"hideEmptyAgendaDays",void 0),m([U.Property(!0)],v.prototype,"enableRecurrenceValidation",void 0),m([U.Property()],v.prototype,"timezone",void 0),m([U.Complex({},To)],v.prototype,"eventSettings",void 0),m([U.Property(zr)],v.prototype,"timezoneDataSource",void 0),m([U.Property()],v.prototype,"resourceHeaderTemplate",void 0),m([U.Property()],v.prototype,"headerIndentTemplate",void 0),m([U.Complex({},Vo)],v.prototype,"group",void 0),m([U.Collection([],u)],v.prototype,"resources",void 0),m([U.Collection([],mo)],v.prototype,"headerRows",void 0),m([U.Property()],v.prototype,"cssClass",void 0),m([U.Property()],v.prototype,"eventDragArea",void 0),m([U.Event()],v.prototype,"created",void 0),m([U.Event()],v.prototype,"destroyed",void 0),m([U.Event()],v.prototype,"cellClick",void 0),m([U.Event()],v.prototype,"cellDoubleClick",void 0),m([U.Event()],v.prototype,"moreEventsClick",void 0),m([U.Event()],v.prototype,"hover",void 0),m([U.Event()],v.prototype,"select",void 0),m([U.Event()],v.prototype,"actionBegin",void 0),m([U.Event()],v.prototype,"actionComplete",void 0),m([U.Event()],v.prototype,"actionFailure",void 0),m([U.Event()],v.prototype,"navigating",void 0),m([U.Event()],v.prototype,"renderCell",void 0),m([U.Event()],v.prototype,"eventClick",void 0),m([U.Event()],v.prototype,"eventDoubleClick",void 0),m([U.Event()],v.prototype,"eventRendered",void 0),m([U.Event()],v.prototype,"dataBinding",void 0),m([U.Event()],v.prototype,"popupOpen",void 0),m([U.Event()],v.prototype,"popupClose",void 0),m([U.Event()],v.prototype,"dragStart",void 0),m([U.Event()],v.prototype,"drag",void 0),m([U.Event()],v.prototype,"dragStop",void 0),m([U.Event()],v.prototype,"resizeStart",void 0),m([U.Event()],v.prototype,"resizing",void 0),m([U.Event()],v.prototype,"resizeStop",void 0),m([U.Event()],v.prototype,"virtualScrollStart",void 0),m([U.Event()],v.prototype,"virtualScrollStop",void 0),m([U.Event()],v.prototype,"dataBound",void 0),m([U.NotifyPropertyChanges],v));function v(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("."+A),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("."+Ni))||(i=U.createElement("div",{className:Ni}),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?Li: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("."+Ni);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("."+A),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("."+V)?e.querySelector("."+V).appendChild(t):((n=U.createElement("div",{className:V})).appendChild(t),e.appendChild(n))},Ko.prototype.createAppointmentElement=function(e,t){t=U.createElement("div",{className:x,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,"."+x),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(ce,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=p.parent.getElementWidth(t),p.actionObj.cellHeight=p.parent.getElementHeight(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 La(p.parent)),p.parent.element.querySelector("."+A));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(he,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.actionObj.action=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(de,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+=this.parent.getElementWidth(this.actionObj.clone)-this.actionObj.cellWidth),p=s?Math.floor(d/Math.floor(this.parent.getElementWidth(l)/g)):Math.round(d/(this.parent.getElementWidth(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+(this.parent.getElementWidth(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:this.parent.getElementWidth(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+=this.parent.getElementWidth(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?this.parent.getElementWidth(this.actionObj.element):0)/this.actionObj.cellWidth)*this.actionObj.cellWidth,g=Math.ceil((this.parent.getElementWidth(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("."+A),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?this.parent.getElementWidth(this.actionObj.element)/this.actionObj.cellWidth*this.actionObj.cellWidth:"Month"===this.parent.currentView?this.parent.getElementWidth(this.actionObj.element):Math.ceil(this.parent.getElementWidth(this.actionObj.element)/this.actionObj.cellWidth)*this.actionObj.cellWidth,p=l+Math.ceil(o/this.actionObj.cellWidth)*this.actionObj.cellWidth,c=this.parent.enableRtl?parseInt(this.actionObj.element.style.right,10):this.actionObj.clone.offsetLeft,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?this.parent.getElementWidth(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?this.parent.getElementWidth(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-this.parent.getElementWidth(this.actionObj.clone)?parseInt(this.actionObj.clone.style.right,10):c:t&&this.actionObj.pageX>this.actionObj.X+this.parent.getElementWidth(this.actionObj.clone)&&this.parent.getElementWidth(this.actionObj.clone)===this.actionObj.cellWidth?parseInt(this.actionObj.clone.style.left,10):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,this.parent.getElementWidth(this.actionObj.clone))),i=Math.ceil(this.parent.getElementWidth(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?"."+x:"."+V+",."+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(we,{})},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=ke(n,this.parent.activeViewOptions.firstDayOfWeek),o=z(Re(r,this.parent.activeViewOptions.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:x}))}},nl.prototype.timelineYearViewEvents=function(){for(var n,r=this,e=this.parent.element.querySelector("."+O+":not(."+E+")"),e=(this.cellWidth=this.parent.getElementWidth(e),this.cellHeader=Je(e.querySelector("."+Ei)),this.parent.element.querySelector("."+Mt)),t=(this.eventHeight=this.parent.getElementHeightFromClass(e,x),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:V}),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("."+V))||(c=U.createElement("div",{className:V}),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,S=w.length;b<S;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,S);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("."+C+" tbody tr")),e.forEach(function(e,t){var e=[].slice.call(e.querySelectorAll("."+x)),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("."+A),t=e.offsetWidth>e.clientWidth,n=this.parent.element.querySelector("."+O),n=(this.cellWidth=this.parent.getElementWidth(n),this.cellHeader=0,this.parent.element.querySelector("."+Mt)),r=(this.eventHeight=this.parent.getElementHeightFromClass(n,x),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("."+x)).forEach(function(e){e.style.removeProperty("left"),e.style.removeProperty("right")}),n=[].slice.call(this.parent.element.querySelectorAll("."+li)),s=this.parent.element.querySelector("."+C),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=o.parent.getElementWidth(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:V}),e=(e.appendChild(h),z(Pe(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(ie,{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(Pe(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:x,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:Nn,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=Ue(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("."+C)},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("."+A).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.floor(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"),this.isPreventMultiDrag&&(r=U.formatUnit(this.actionObj.clone.offsetTop))),{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)),a=(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(oe,a,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.enableCurrentViewDrag=a.dragWithinRange&&!a.navigation.enable&&n.parent.allowMultiDrag,n.actionObj.excludeSelectors=e.excludeSelectors,t=n.parent.element.querySelector("."+A),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 La(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(le,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=We(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())/Ve)},y.prototype.dragStop=function(e){var t,i,n=this;this.isCursorAhead=!1,this.isPreventMultiDrag=!1,this.removeCloneElementClasses(),this.removeCloneElement(),clearInterval(this.actionObj.navigationInterval),this.actionObj.navigationInterval=null,clearInterval(this.actionObj.scrollInterval),this.actionObj.scrollInterval=null,this.actionClass("removeClass"),this.parent.uiStateValues.action=this.parent.uiStateValues.isTapHold=!1,this.isAllowDrop(e)||(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(pe,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:this.parent.getElementWidth(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("."+V))||(t=U.createElement("div",{className:V}),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:"."+V;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("."+w+":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("."+V));a||(a=U.createElement("div",{className:V}),e[this.actionObj.index].appendChild(a)),a.appendChild(this.actionObj.clone)}},y.prototype.viewNavigation=function(e){var t,i=this.parent.element.querySelector("."+A);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("."+V))||(t=U.createElement("div",{className:V}),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(w))){this.parent.activeViewOptions.timeScale.enable&&this.swapDragging(e);var e=this.parent.element.querySelector("."+A),t=U.extend({},this.actionObj.event,null,!0),n=t[this.parent.eventFields.startTime],t=tt(t[this.parent.eventFields.endTime])-tt(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(w)||(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.enableCurrentViewDrag&&0!==this.multiData.length||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());var d,u=a[this.parent.eventFields.startTime].getTime()-this.startTime;if(this.enableCurrentViewDrag)for(var g=this.getRenderedDates(),m=0;m<this.multiData.length;m++){var v=U.extend({},this.multiData[parseInt(m.toString(),10)],null,!0),v=new Date(v[this.parent.eventFields.startTime].getTime()+u);if((f=this.parent.getIndexOfDate(g,W(v)))<0){this.isPreventMultiDrag=!0;break}this.isPreventMultiDrag=!1}if(!this.isPreventMultiDrag)for(var f,y,T=0;T<this.multiData.length;T++)this.updatedData[parseInt(T.toString(),10)]=this.updateMultipleData(this.multiData[parseInt(T.toString(),10)],u),0<=(f=this.getDayIndex(this.updatedData[parseInt(T.toString(),10)]))?(y=this.updatedData[parseInt(T.toString(),10)][this.parent.eventFields.isAllDay],h=this.getEventWrapper(f,y),this.appendCloneElement(h,this.actionObj.cloneElement[parseInt(T.toString(),10)]),this.updateEventHeight(this.updatedData[parseInt(T.toString(),10)],T,f)):U.isNullOrUndefined(this.actionObj.cloneElement[parseInt(T.toString(),10)].parentNode)||U.remove(this.actionObj.cloneElement[parseInt(T.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("."+V))[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){if(!this.isPreventMultiDrag){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("."+w+":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(),tt(e[this.parent.eventFields.endTime])-tt(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=tt(e[this.parent.eventFields.startTime])-tt(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=tt(i[this.parent.eventFields.endTime])-tt(i[this.parent.eventFields.startTime]),r=this.parent.enableRtl?Math.abs(this.actionObj.clone.offsetLeft)-this.actionObj.clone.offsetWidth:parseInt(this.actionObj.clone.style.left,10),r=Math.round(r/this.actionObj.cellWidth)*this.actionObj.cellWidth,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("."+A),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*Ve,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("."+A),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.round(e/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/Ve/(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("."+A),n=[].slice.call(this.parent.element.querySelectorAll(".e-content-wrap .e-content-table tr:not(.e-hidden)")),r=Ie(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,this.parent.uiStateValues.isTransformed))/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("."+V),i=(a||(a=U.createElement("div",{className:V}),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=this.parent.getElementHeight(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(x)?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:"."+V).item(e):(i=(t=this.parent.element.querySelectorAll("."+O).item(e)).querySelector("."+V))||(i=U.createElement("div",{className:V}),t.appendChild(i)),i},y.prototype.getAllDayEventHeight=function(){var e=U.createElement("div",{className:x}),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.enableCurrentViewDrag=!1,e.isPreventMultiDrag=!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(Lt)||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(we,{})},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?Qe():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+=Je(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),qe(e)<qe(t))||qe(e)>=qe(i)||!this.isWorkDay(e,n))},T.prototype.getRenderDates=function(e){var t=[];if("Week"===this.parent.currentView||"TimelineWeek"===this.parent.currentView)for(var i=ke(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=ke(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("."+A+" col, ."+Tt+" col"))},T.prototype.setColWidth=function(e){var t,i,n;this.isTimelineView()&&(t=this.getColElements(),n=this.element.querySelector("."+C+" tbody"),i=this.parent.getElementWidth(n)/(t.length/2),e.offsetHeight!==e.clientHeight&&(n=this.parent.element.querySelector("."+Ht),U.isNullOrUndefined(n)||n.offsetHeight===e.clientHeight||U.setStyleAttribute(n,{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("."+A)},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.getGroupIndices=function(e){var t=[];return t=this.parent.virtualScrollModule&&0<this.parent.activeViewOptions.group.resources.length&&(e||0<this.parent.virtualScrollModule.existingDataCollection.length)&&!this.parent.uiStateValues.isGroupAdaptive?(e=U.isNullOrUndefined(e)?this.parent.virtualScrollModule.existingDataCollection:e).map(function(e){return e.groupIndex}):t},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)})(D,ol=Ja),D.prototype.getModuleName=function(){return"verticalView"},D.prototype.addEventListener=function(){this.parent.on(Se,this.scrollUiUpdate,this),this.parent.on(ye,this.renderEvents,this)},D.prototype.removeEventListener=function(){this.parent&&(this.parent.off(Se,this.scrollUiUpdate),this.parent.off(ye,this.renderEvents))},D.prototype.renderEvents=function(){this.appointment=new(this.parent.activeViewOptions.timeScale.enable?Pa:La)(this.parent),this.appointment.renderAppointments(),this.parent.notify(Te,{})},D.prototype.onContentScroll=function(e){this.parent.removeNewEventElement();var t=e.target;this.parent.notify(be,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()},D.prototype.onAdaptiveMove=function(e){this.parent.uiStateValues.action&&e.preventDefault()},D.prototype.onAdaptiveScroll=function(e){this.parent&&!this.parent.isDestroyed&&(this.parent.removeNewEventElement(),this.parent.uiStateValues.top=e.target.scrollTop)},D.prototype.scrollLeftPanel=function(e){var t=this.getLeftPanelElement();U.isNullOrUndefined(t)||(t.scrollTop=e.scrollTop)},D.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=Qe(),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))},D.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)},D.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)},D.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("."+C),this.getScrollableElement().scrollLeft=-(i.offsetWidth-t.offsetLeft-t.offsetWidth)):this.getScrollableElement().scrollLeft=t.offsetLeft),U.isNullOrUndefined(e)||(this.getScrollableElement().scrollTop=this.getTopFromDateTime(e))},D.prototype.scrollToDate=function(e){this.scrollToHour(null,e)},D.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},D.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(St),r.push({date:p,type:"dateHeader",className:c,colSpan:1,workDays:t,startHour:new Date(+a),endHour:new Date(+s)})}return r},D.prototype.isWorkHourRange=function(e){return this.getStartHour().getTime()<=e.getTime()&&this.getEndHour().getTime()>=e.getTime()},D.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&&!U.isNullOrUndefined(this.element.querySelector("."+O))?(this.changeCurrentTimePosition(),U.isNullOrUndefined(this.currentTimeIndicatorTimer)&&((e=Ve-(1e3*e.getSeconds()+e.getMilliseconds()))<=59e3&&window.setTimeout(function(){U.isNullOrUndefined(t.currentTimeIndicatorTimer)||(t.clearCurrentTimeIndicatorTimer(),t.changeCurrentTimePosition(),t.updateCurrentTimeIndicatorTimer())},e),this.updateCurrentTimeIndicatorTimer())):this.clearCurrentTimeIndicatorTimer())},D.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},D.prototype.clearCurrentTimeIndicatorTimer=function(){U.isNullOrUndefined(this.currentTimeIndicatorTimer)||(window.clearInterval(this.currentTimeIndicatorTimer),this.currentTimeIndicatorTimer=null,this.removeCurrentTimeIndicatorElements())},D.prototype.updateCurrentTimeIndicatorTimer=function(){var e=this;this.currentTimeIndicatorTimer=window.setInterval(function(){e.changeCurrentTimePosition()},Ve)},D.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)}},D.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.length>c&&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))}}},D.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},D.prototype.getWorkCellHeight=function(){return parseFloat(this.parent.getElementHeight(this.element.querySelector("."+O)).toFixed(2))},D.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},D.prototype.refreshHeader=function(){U.remove(this.element.querySelector("tbody tr")),this.renderHeader(),this.parent.notify(we,{});var e=this.element.querySelector("."+Tt);e&&(e.scrollLeft=this.parent.uiStateValues.left)},D.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(we,{})},D.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"))},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,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)},D.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:[w],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},D.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},D.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=[w],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)},D.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($,i),t},D.prototype.wireCellEvents=function(e){U.EventHandler.add(e,"mousedown",this.parent.workCellAction.cellMouseDown,this.parent.workCellAction),this.wireMouseEvents(e)},D.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)},D.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},D.prototype.renderContentArea=function(){var e=U.createElement("div",{className:A}),t=this.createTableLayout(C);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},D.prototype.renderContentTable=function(e){var t=e.querySelector("tbody");U.append(this.getContentRows(),t),this.renderContentTableHeader(e)},D.prototype.getContentRows=function(){var s=this,o=[],l=U.createElement("tr"),p=U.createElement("td",{attrs:{"aria-selected":"false"}}),c=this.getGroupIndices();return this.getTimeSlotRows(function(e){for(var t=l.cloneNode(),i=0,n=s.colLevels[s.colLevels.length-1];i<n.length;i++){var r=n[i],a=!0;(a=s.parent.virtualScrollModule&&0<s.parent.activeViewOptions.group.resources.length&&-1<c.indexOf(r.groupIndex)?!1:a)&&(a=s.createContentTd(r,e,p),t.appendChild(a))}return o.push(t),e}),o},D.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(Nt)&&(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($,a),i},D.prototype.getContentTdClass=function(e){return e.last?[O]:[O,Yt]},D.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)},D.prototype.getScrollableElement=function(){return this.parent.isAdaptive&&!this.isTimelineView()?this.element.querySelector("."+Kt):this.getContentAreaElement()},D.prototype.getLeftPanelElement=function(){return this.element.querySelector("."+Bt)},D.prototype.getEndDateFromStartDate=function(e){var t=this.parent.activeViewOptions.timeScale.interval*Ve/this.parent.activeViewOptions.timeScale.slotCount,e=new Date(e.getTime());return e.setMilliseconds(e.getMilliseconds()+t),e},D.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)},D.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*Ve,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=(!et(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},D.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},D.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=D;function D(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)})(b,Dl=Ja),b.prototype.addEventListener=function(){this.parent.on(Se,this.onScrollUIUpdate,this),this.parent.on(ye,this.onDataReady,this),this.parent.on(q,this.onCellClick,this)},b.prototype.removeEventListener=function(){this.parent&&(this.parent.off(Se,this.onScrollUIUpdate),this.parent.off(ye,this.onDataReady),this.parent.off(q,this.onCellClick))},b.prototype.onDataReady=function(e){this.monthEvent=new La(this.parent),this.monthEvent.renderAppointments(),this.parent.notify(Te,{})},b.prototype.onCellClick=function(e){},b.prototype.onContentScroll=function(e){this.parent.removeNewEventElement(),this.parent.notify(be,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()},b.prototype.scrollLeftPanel=function(e){var t=this.getLeftPanelElement();t&&(t.scrollTop=e.scrollTop)},b.prototype.getLeftPanelElement=function(){return this.element.querySelector("."+ri)},b.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),Qe());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()},b.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)},b.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("."+C)).offsetHeight),t.style.height="auto",t.style.height=U.formatUnit(i-this.getScrollXIndent(e)))},b.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},b.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(St),n.push({date:e[parseInt(a.toString(),10)],type:"monthDay",className:s,colSpan:1,workDays:t})}return n},b.prototype.getDayNameFormat=function(){return this.parent.isAdaptive||0<this.parent.activeViewOptions.group.resources.length?"abbreviated":"wide"},b.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(we,{}),this.parent.uiStateValues.isCustomMonth&&(this.parent.uiStateValues.isCustomMonth=!1)},b.prototype.refreshHeader=function(){U.remove(this.element.querySelector("tbody tr")),this.renderHeader(),this.parent.notify(we,{});var e=this.element.querySelector("."+Tt),t=this.element.querySelector("."+A);e&&(e.scrollLeft=this.parent.uiStateValues.left),t&&(t.scrollLeft=this.parent.uiStateValues.left)},b.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)},b.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"))},b.prototype.renderLeftIndent=function(e){this.parent.activeViewOptions.showWeekNumber&&e.appendChild(U.createElement("td",{className:"e-left-indent"}))},b.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:A})),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()},b.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},b.prototype.renderAppointmentContainer=function(){},b.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},b.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($,r),n},b.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},b.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)},b.prototype.updateSelectedCellClass=function(e){},b.prototype.isOtherMonth=function(e){return e.getTime()<this.monthDates.start.getTime()||e.getTime()>this.monthDates.end.getTime()},b.prototype.renderContentArea=function(){var e=this.createTableLayout(C),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(Ue(t,this.parent.activeViewOptions.interval-1))},e.querySelector("tbody"));return U.append(this.getContentRows(),t),this.wireCellEvents(t),e},b.prototype.getContentRows=function(){for(var e=[],t=U.createElement("tr"),i=U.createElement("td",{attrs:{"aria-selected":"false"}}),n=this.getContentSlots(),r="TimelineMonth"===this.parent.currentView?this.getGroupIndices():[],a=0;a<n.length;a++)if(!(0<r.length&&-1<r.indexOf(n[parseInt(a.toString(),10)][0].groupIndex))){for(var s=t.cloneNode(),o=0;o<n[parseInt(a.toString(),10)].length;o++){var l=this.createContentTd(n[parseInt(a.toString(),10)][parseInt(o.toString(),10)],i);s.appendChild(l)}e.push(s)}return e},b.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(Nt)&&(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(Ct),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($,r),t},b.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))},b.prototype.getMonthStart=function(e){e=ke("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())},b.prototype.getMonthEnd=function(e){return this.isCustomMonth()?z(this.getMonthStart(e),7*(0<this.parent.activeViewOptions.numberOfWeeks?this.parent.activeViewOptions.numberOfWeeks:6)-1):(e=Ue(e,this.parent.activeViewOptions.interval-1),z(ke(this.parent.calendarUtil.lastDateOfMonth(e),this.parent.activeViewOptions.firstDayOfWeek),6))},b.prototype.isCustomRange=function(){var e,t,i=this.parent.getCurrentViewDates();return!(!(i&&0<i.length)||(e=W(this.parent.selectedDate).getTime(),t=ke(i[i.length-1],this.parent.activeViewOptions.firstDayOfWeek),e>=ke(i[0],this.parent.activeViewOptions.firstDayOfWeek).getTime()&&e<=z(t,6).getTime()))},b.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},b.prototype.getNextPreviousDate=function(e){var t;return this.isCustomMonth()?(t=this.parent.getCurrentViewDates(),z(ke("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))):Ue(this.parent.selectedDate,("next"===e?1:-1)*this.parent.activeViewOptions.interval)},b.prototype.getStartDate=function(){return this.getMonthStart(this.parent.selectedDate)},b.prototype.getEndDate=function(){return this.getMonthEnd(this.parent.selectedDate)},b.prototype.getEndDateFromStartDate=function(e){return z(new Date(e.getTime()),1)},b.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||Ue(Pe(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)},b.prototype.getLabelText=function(e){e=e.charAt(0).toLowerCase()+e.substring(1);return this.formatViewLabel(e,this.getStartDate(),this.getEndDate())},b.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($,{elementType:"weekNumberCell",element:e}),t},b.prototype.unWireEvents=function(){var e=this.element.querySelector("."+A);e&&U.EventHandler.remove(e,"scroll",this.onContentScroll)},b.prototype.isCustomMonth=function(){return"Month"===this.parent.currentView&&(!U.isNullOrUndefined(this.parent.activeViewOptions.displayDate)||0<this.parent.activeViewOptions.numberOfWeeks)},b.prototype.getModuleName=function(){return"month"},b.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=b;function b(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}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)})(S,Cl=Ja),S.prototype.getModuleName=function(){return"year"},S.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("."+A),"scroll",this.onContentScroll,this),this.parent.notify(we,{})},S.prototype.renderHeader=function(e){},S.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:A})),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)},S.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($,{elementType:"headerCells",element:n,date:e}),i},S.prototype.renderCalendarContent=function(e){var t=this.getMonthDates(e),i=U.createElement("div",{className:"e-content e-month"}),n=this.createTableLayout("e-calendar-table "+C),r=(i.appendChild(n),this.setAriaAttributes(n),U.createElement("thead",{className:"e-week-header"})),a=U.createElement("tr"),s=ke(He(e),this.parent.activeViewOptions.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($,{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($,{elementType:"workCells",element:f,date:v})}p.appendChild(d)}return i},S.prototype.createTableColGroup=function(e){for(var t=U.createElement("colgroup"),i=0;i<e;i++)t.appendChild(U.createElement("col"));return t},S.prototype.getMonthName=function(e){return f(this.parent.globalize.formatDate(e,{format:this.parent.activeViewOptions.dateFormat||"MMMM y",calendar:this.parent.getCalendarMode()}),"multiple")},S.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},S.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"}))}]},S.prototype.getMonthDates=function(e){for(var e=ke(He(e),this.parent.activeViewOptions.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},S.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},S.prototype.isCurrentDate=function(e){return W(new Date).getTime()===W(new Date(e.getTime())).getTime()},S.prototype.getMonths=function(){var i=this;return Array.apply(null,{length:this.parent.activeViewOptions.monthsCount}).map(function(e,t){return i.parent.firstMonthOfYear+t})},S.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)},S.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(q,n),this.parent.quickPopup.moreEventClick(r,t))},S.prototype.onContentScroll=function(e){var t=e.target,i=this.getDatesHeaderElement(),i=(this.parent.notify(be,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()},S.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("."+A)),r=(n&&(n.style.height=U.formatUnit(t)),!this.parent.isAdaptive&&i&&(r=Qe(),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()},S.prototype.getStartDate=function(){return new Date(this.parent.selectedDate.getFullYear(),this.parent.firstMonthOfYear%12,1)},S.prototype.getEndDate=function(){return z(Ue(this.getStartDate(),this.parent.monthsCount),-1)},S.prototype.startDate=function(){return"Year"===this.parent.currentView?ke(this.getStartDate(),this.parent.activeViewOptions.firstDayOfWeek):this.getStartDate()},S.prototype.endDate=function(){return"Year"===this.parent.currentView?z(Re(this.getEndDate(),this.parent.activeViewOptions.firstDayOfWeek),1):z(this.getEndDate(),1)},S.prototype.getEndDateFromStartDate=function(e){e=new Date(e.getTime());return 0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(e=Pe(e)),z(new Date(e.getTime()),1)},S.prototype.getNextPreviousDate=function(e){return Be(this.parent.selectedDate,"next"===e?1:-1)},S.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"})},S.prototype.addEventListener=function(){this.parent.on(Se,this.onScrollUiUpdate,this),this.parent.on(ye,this.onDataReady,this)},S.prototype.removeEventListener=function(){this.parent&&(this.parent.off(Se,this.onScrollUiUpdate),this.parent.off(ye,this.onDataReady))},S.prototype.onDataReady=function(e){this.yearEventModule=new il(this.parent),this.yearEventModule.renderAppointments(),this.parent.notify(Te,e)},S.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)},S.prototype.destroy=function(){var e;!this.parent||this.parent&&this.parent.isDestroyed||this.element&&((e=this.element.querySelector("."+A))&&U.EventHandler.remove(e,"scroll",this.onContentScroll),this.yearEventModule&&(this.yearEventModule.destroy(),this.yearEventModule=null),this.parent.resourceBase&&this.parent.resourceBase.destroy(),Cl.prototype.destroy.call(this))};var Sl,Cl,Ol=S;function S(e){e=Cl.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:x,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),$e(t),t.appendChild(n),{data:U.extend({},a[parseInt(e.toString(),10)],null,!0),element:t,cancel:!1});l.parent.trigger(ie,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:Nn})),n=(this.parent.sanitize(i,a),r.appendChild(a),U.isNullOrUndefined(n)||""===n||(i=U.createElement("div",{className:Ln}),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("."+x));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 S=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<S.length||!this.parent.hideEmptyAgendaDays)||"MonthAgenda"===this.parent.currentView)&&(w.push(S[0]),S={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:S,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(S),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,S={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(S),g.push(U.extend({},S,null,!0)));break}}}for(var C=s.slice(0,-1),O=[],E=0,V=0;V<C.length;V++)for(var w=C[C.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[C.length-(V+1)]===w[parseInt(x.toString(),10)][C[C.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=C[C.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,Ci],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,Ci,"e-date-border"]);var y=Ye(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:Si}),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,Si),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=Ye(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)})(I,Ml=xl),I.prototype.getModuleName=function(){return"agenda"},I.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:A})),t=(t.appendChild(e),this.createTableLayout(C)),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(we,{})},I.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("."+C+" tbody");$e(e),this.renderInitialContent(e,n),this.wireEventActions(),U.closest(e,"."+A).scrollTop=1,this.parent.notify(Te,{}),this.parent.activeViewOptions.allowVirtualScrolling||this.retainScrollPosition()},I.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))},I.prototype.refreshHeader=function(){var e=this.element.querySelector("."+C+" tbody"),t=(this.parent.activeViewOptions.group.byDate?$e(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)},I.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)},I.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}},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 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()},I.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},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{}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)}},I.prototype.appointmentFiltering=function(e,t){var i,t=!U.isNullOrUndefined(e)&&U.isNullOrUndefined(t)?(i=W(new Date(e.getTime())),Le(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},I.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?Ue(e,-1):this.parent.minDate)},I.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?Ue(e,1):this.parent.maxDate,1))},I.prototype.getNextPreviousDate=function(e){return z(this.parent.selectedDate,"next"===e?1:-1)},I.prototype.startDate=function(){return W(this.parent.selectedDate)},I.prototype.endDate=function(){return this.parent.activeViewOptions.allowVirtualScrolling?this.getEndDateFromStartDate(this.startDate()):z(this.startDate(),this.parent.agendaDaysCount)},I.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))},I.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))},I.prototype.wireEvents=function(){U.EventHandler.add(this.element.querySelector("."+A),De,this.agendaScrolling,this)},I.prototype.unWireEvents=function(){U.EventHandler.remove(this.element.querySelector("."+A),De,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)}},I.prototype.addEventListener=function(){this.parent.on(Se,this.onAgendaScrollUiUpdate,this),this.parent.on(ye,this.eventLoad,this)},I.prototype.removeEventListener=function(){this.parent&&(this.parent.off(Se,this.onAgendaScrollUiUpdate),this.parent.off(ye,this.eventLoad))},I.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("."+A));"auto"!==this.parent.height&&(t.style.height=U.formatUnit(this.parent.element.offsetHeight-e))},I.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)},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"),Ml.prototype.destroy.call(this))};var Il,Ml,kl=I;function I(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(Te,{})},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(Te,{}),this.monthAgendaDate=new Date(""+e.startTime)},jl.prototype.onEventRender=function(e,t){this.agendaBase=this.getAgendaBase();var i,n=this.element.querySelector("."+si);$e(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=Le(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"),$e(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=Ue(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}Ll.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},Ll.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},Ll.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.activeViewOptions.firstDayOfWeek&&this.parent.activeViewOptions.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},Ll.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},Ll.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 Nl=Ll;function Ll(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*this.parent.getElementWidth(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 Nl(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=Le(c,qe(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("."+C).offsetHeight,t=this.element.querySelector("."+Tt),this.element.querySelector("."+A).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("."+A+" 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*this.parent.getElementWidth(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*this.parent.getElementWidth(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=this.getGroupIndices(),a=0;a<n;a++)if(!(0<r.length&&-1<r.indexOf(this.parent.resourceBase.renderedResources[parseInt(a.toString(),10)].groupIndex))){for(var s=t.cloneNode(),o=0,l=this.colLevels[this.colLevels.length-1];o<l.length;o++){var p=l[o],p=(0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(p=this.getResourceTdData(a,p)),this.createContentTd(p,p,i));s.appendChild(p)}e.push(s)}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(Te,{})},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(Te,{})},_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(St),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:A}));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(Ue(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 Nl(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("."+A))&&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($,{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($,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:Sr}),e.appendChild(t),t.appendChild(this.createTableLayout()),t=t.querySelector("tbody")),a.push(r),U.append(a,n),U.createElement("div",{className:A})),a=(r.appendChild(e),this.createTableLayout(C)),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("."+Sr+" ."+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($,{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(St),"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($,{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=this.getGroupIndices(),n=0;n<this.parent.resourceBase.renderedResources.length;n++){var r=void 0;if(!(0<this.parent.activeViewOptions.group.resources.length&&!this.parent.uiStateValues.isGroupAdaptive&&(r=this.parent.resourceBase.renderedResources[parseInt(n.toString(),10)],0<i.length)&&-1<i.indexOf(r.groupIndex)))for(var a=U.createElement("tr"),s=(e.push(a),new Date(this.parent.selectedDate.getFullYear(),t[parseInt(n.toString(),10)],1)),o=this.parent.calendarUtil.getMonthStartDate(new Date(s.getTime())),l=0;l<this.columnCount;l++){var p=[],c=r.groupIndex,s=(-1<(p=p.concat(r.className)).indexOf(Nt)?p.push(kt):p.push(bt),new Date(this.parent.selectedDate.getFullYear(),t[parseInt(l.toString(),10)],1)),o=this.parent.calendarUtil.getMonthStartDate(new Date(s.getTime())),h=U.createElement("td",{className:O,attrs:{"aria-selected":"false","data-date":o.getTime().toString()}});U.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($,{elementType:"resourceGroupCells",element:h,date:o}),a.appendChild(h)}}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(Nt)?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($,{elementType:"resourceGroupCells",element:g,date:c})}}"Vertical"===this.parent.activeViewOptions.orientation&&this.collapseRows(this.parent.element.querySelector("."+A))},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(He(e))):+new Date(W(e)),e=this.element.querySelector('[data-date="'+e+'"]');e&&(t=this.getScrollableElement(),this.parent.enableRtl?(i=this.element.querySelector("."+C),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 a"}},!0)),n.push(t)}),o.push({index:e+2,cells:n})}),[{columns:s,rows:o}]);new L.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};u=$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.registeredTemplate=this.parent.registeredTemplate,this.printInstance.root=this.parent.root||this.parent,this.printInstance.appendTo(t),this.printInstance.on(fe,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(fe,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=u,e.Gregorian=Lr,e.HeaderRenderer=Ir,e.ICalendarExport=To,e.ICalendarImport=Vo,e.Islamic=Fr,e.MS_PER_DAY=B,e.MS_PER_MINUTE=Ve,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=Q,e.actionComplete=K,e.actionFailure=Z,e.addDays=z,e.addMonths=Ue,e.addYears=Be,e.capitalizeFirstWord=f,e.cellClick=q,e.cellDoubleClick=F,e.cellMouseDown=Ee,e.cellSelect=ge,e.contentReady=we,e.dataBinding=ne,e.dataBound=re,e.dataReady=ye,e.documentClick=Oe,e.drag=le,e.dragStart=oe,e.dragStop=pe,e.eventClick=ee,e.eventDoubleClick=te,e.eventRendered=ie,e.eventsLoaded=Te,e.extractObjectFromRule=ga,e.findIndexInData=Ze,e.firstDateOfMonth=He,e.generate=Gr,e.generateSummary=Yr,e.getCalendarUtil=fa,e.getDateCount=Fe,e.getDateFromRecurrenceDateString=Xr,e.getDateFromString=_e,e.getDateInMs=qe,e.getDaysCount=Ye,e.getElementHeight=at,e.getElementHeightFromClass=xe,e.getElementTop=st,e.getElementWidth=rt,e.getElementWidthFromClass=Ae,e.getMaxDays=ze,e.getOuterHeight=Je,e.getRecurrenceStringFromDate=Ia,e.getScrollBarWidth=Qe,e.getStartEndHours=We,e.getTranslateX=Me,e.getTranslateY=Ie,e.getUniversalTime=tt,e.getWeekFirstDate=ke,e.getWeekLastDate=Re,e.getWeekMiddleDate=Ne,e.getWeekNumber=je,e.hover=X,e.initialEnd="initial-end",e.initialLoad="initial-load",e.inlineClick=ue,e.isDaylightSavingTime=et,e.isIPadDevice=nt,e.isMobile=it,e.lastDateOfMonth=Pe,e.moreEventsClick=_,e.navigating=J,e.popupClose=se,e.popupOpen=ae,e.print=fe,e.removeChildren=$e,e.renderCell=$,e.resetScrollbarWidth=Ke,e.resetTime=W,e.resizeStart=ce,e.resizeStop=de,e.resizing=he,e.scroll=De,e.scrollUiUpdate=Se,e.select=G,e.setTime=Le,e.timezoneData=zr,e.uiUpdate=Ce,e.virtualScroll=be,e.virtualScrollStart=me,e.virtualScrollStop=ve,Object.defineProperty(e,"__esModule",{value:!0})});
11
11
  //# sourceMappingURL=ej2-schedule.umd.min.js.map