var FullCalendar=function(e){"use strict";var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,n)};function n(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n3)for(n=[n],r=3;r=0;i--){var a=e[i][r];if("object"==typeof a&&a)o.unshift(a);else if(void 0!==a){n[r]=a;break}}o.length&&(n[r]=Ne(o))}for(i=e.length-1;i>=0;i--){var s=e[i];for(var l in s)l in n||(n[l]=s[l])}return n}function He(e,t){var n={};for(var r in e)t(e[r],r)&&(n[r]=e[r]);return n}function Oe(e,t){var n={};for(var r in e)n[r]=t(e[r],r);return n}function Ae(e){for(var t={},n=0,r=e;n1)||"numeric"!==o.year&&"2-digit"!==o.year||"numeric"!==o.month&&"2-digit"!==o.month||"numeric"!==o.day&&"2-digit"!==o.day||(s=1);var l=this.format(e,n),u=this.format(t,n);if(l===u)return l;var c=vt(function(e,t){var n={};for(var r in e)(!(r in lt)||lt[r]<=t)&&(n[r]=e[r]);return n}(o,s),i,n),d=c(e),p=c(t),f=function(e,t,n,r){var o=0;for(;o=$e(t)&&(r=ve(r,1))}return e.start&&(n=be(e.start),r&&r<=n&&(r=ve(n,1))),{start:n,end:r}}function $t(e){var t=Jt(e);return ye(t.start,t.end)>1}function Qt(e,t,n,r){return"year"===r?Ye(n.diffWholeYears(e,t),"year"):"month"===r?Ye(n.diffWholeMonths(e,t),"month"):Ee(e,t)}function en(e,t){var n,r,o=[],i=t.start;for(e.sort(tn),n=0;ni&&o.push({start:i,end:r.start}),r.end>i&&(i=r.end);return it.start)&&(null===e.start||null===t.end||e.start=e.start)&&(null===e.end||null!==t.end&&t.end<=e.end)}function sn(e,t){return(null===e.start||t>=e.start)&&(null===e.end||t=(n||t.end),isToday:t&&sn(t,r.start)}}function Dn(e){var t=["fc-event"];return e.isMirror&&t.push("fc-event-mirror"),e.isDraggable&&t.push("fc-event-draggable"),(e.isStartResizable||e.isEndResizable)&&t.push("fc-event-resizable"),e.isDragging&&t.push("fc-event-dragging"),e.isResizing&&t.push("fc-event-resizing"),e.isSelected&&t.push("fc-event-selected"),e.isStart&&t.push("fc-event-start"),e.isEnd&&t.push("fc-event-end"),e.isPast&&t.push("fc-event-past"),e.isToday&&t.push("fc-event-today"),e.isFuture&&t.push("fc-event-future"),t}function bn(e){return e.instance?e.instance.instanceId:e.def.defId+":"+e.range.start.toISOString()}var Cn={start:_t,end:_t,allDay:Boolean};function wn(e,t,n){var o=function(e,t){var n=xt(e,Cn),o=n.refined,i=n.extra,a=o.start?t.createMarkerMeta(o.start):null,s=o.end?t.createMarkerMeta(o.end):null,l=o.allDay;null==l&&(l=a&&a.isTimeUnspecified&&(!s||s.isTimeUnspecified));return r({range:{start:a?a.marker:null,end:s?s.marker:null},allDay:l},i)}(e,t),i=o.range;if(!i.start)return null;if(!i.end){if(null==n)return null;i.end=t.add(i.start,n)}return o}function Rn(e,t){return rn(e.range,t.range)&&e.allDay===t.allDay&&function(e,t){for(var n in t)if("range"!==n&&"allDay"!==n&&e[n]!==t[n])return!1;for(var n in e)if(!(n in t))return!1;return!0}(e,t)}function Tn(e,t,n){return r(r({},kn(e,t,n)),{timeZone:t.timeZone})}function kn(e,t,n){return{start:t.toDate(e.start),end:t.toDate(e.end),startStr:t.formatIso(e.start,{omitTime:n}),endStr:t.formatIso(e.end,{omitTime:n})}}function Mn(e,t,n){var r=Yt({editable:!1},n),o=Xt(r.refined,r.extra,"",e.allDay,!0,n);return{def:o,ui:fn(o,t),instance:Ie(o.defId,e.range),range:e.range,isStart:!0,isEnd:!0}}function xn(e,t,n){n.emitter.trigger("select",r(r({},_n(e,n)),{jsEvent:t?t.origEvent:null,view:n.viewApi||n.calendarApi.view}))}function _n(e,t){for(var n,o,i={},a=0,s=t.pluginHooks.dateSpanTransforms;a=0;r--){var o=n[r].parseMeta(e);if(o)return{sourceDefId:r,meta:o}}return null}(i,t);if(s)return{_raw:e,isFetching:!1,latestFetchId:"",fetchRange:null,defaultAllDay:i.defaultAllDay,eventDataTransform:i.eventDataTransform,success:i.success,failure:i.failure,publicId:i.id||"",sourceId:$(),sourceDefId:s.sourceDefId,meta:s.meta,ui:Wt(i,t),extendedProps:a}}return null}function Ln(e){return r(r(r({},Lt),An),e.pluginHooks.eventSourceRefiners)}function Wn(e,t){return"function"==typeof e&&(e=e()),null==e?t.createNowMarker():t.createMarker(e)}var Vn=function(){function e(){}return e.prototype.getCurrentData=function(){return this.currentDataManager.getCurrentData()},e.prototype.dispatch=function(e){return this.currentDataManager.dispatch(e)},Object.defineProperty(e.prototype,"view",{get:function(){return this.getCurrentData().viewApi},enumerable:!1,configurable:!0}),e.prototype.batchRendering=function(e){e()},e.prototype.updateSize=function(){this.trigger("_resize",!0)},e.prototype.setOption=function(e,t){this.dispatch({type:"SET_OPTION",optionName:e,rawOptionValue:t})},e.prototype.getOption=function(e){return this.currentDataManager.currentCalendarOptionsInput[e]},e.prototype.getAvailableLocaleCodes=function(){return Object.keys(this.getCurrentData().availableRawLocales)},e.prototype.on=function(e,t){var n=this.currentDataManager;n.currentCalendarOptionsRefiners[e]?n.emitter.on(e,t):console.warn("Unknown listener name '"+e+"'")},e.prototype.off=function(e,t){this.currentDataManager.emitter.off(e,t)},e.prototype.trigger=function(e){for(var t,n=[],r=1;r=1?Math.min(o,i):o}(e,this.weekDow,this.weekDoy)},e.prototype.format=function(e,t,n){return void 0===n&&(n={}),t.format({marker:e,timeZoneOffset:null!=n.forcedTzo?n.forcedTzo:this.offsetForMarker(e)},this)},e.prototype.formatRange=function(e,t,n,r){return void 0===r&&(r={}),r.isEndExclusive&&(t=ge(t,-1)),n.formatRange({marker:e,timeZoneOffset:null!=r.forcedStartTzo?r.forcedStartTzo:this.offsetForMarker(e)},{marker:t,timeZoneOffset:null!=r.forcedEndTzo?r.forcedEndTzo:this.offsetForMarker(t)},this,r.defaultSeparator)},e.prototype.formatIso=function(e,t){void 0===t&&(t={});var n=null;return t.omitTimeZoneOffset||(n=null!=t.forcedTzo?t.forcedTzo:this.offsetForMarker(e)),function(e,t,n){void 0===n&&(n=!1);var r=e.toISOString();return r=r.replace(".000",""),n&&(r=r.replace("T00:00:00Z","")),r.length>10&&(null==t?r=r.replace("Z",""):0!==t&&(r=r.replace("Z",rt(t,!0)))),r}(e,n,t.omitTime)},e.prototype.timestampToMarker=function(e){return"local"===this.timeZone?Me(Re(new Date(e))):"UTC"!==this.timeZone&&this.namedTimeZoneImpl?Me(this.namedTimeZoneImpl.timestampToArray(e)):new Date(e)},e.prototype.offsetForMarker=function(e){return"local"===this.timeZone?-Te(ke(e)).getTimezoneOffset():"UTC"===this.timeZone?0:this.namedTimeZoneImpl?this.namedTimeZoneImpl.offsetForArray(ke(e)):null},e.prototype.toDate=function(e,t){return"local"===this.timeZone?Te(ke(e)):"UTC"===this.timeZone?new Date(e.valueOf()):this.namedTimeZoneImpl?new Date(e.valueOf()-1e3*this.namedTimeZoneImpl.offsetForArray(ke(e))*60):new Date(e.valueOf()-(t||0))},e}(),Kn=[],Jn={code:"en",week:{dow:0,doy:4},direction:"ltr",buttonText:{prev:"prev",next:"next",prevYear:"prev year",nextYear:"next year",year:"year",today:"today",month:"month",week:"week",day:"day",list:"list"},weekText:"W",allDayText:"all-day",moreLinkText:"more",noEventsText:"No events to display"};function $n(e){for(var t=e.length>0?e[0].code:"en",n=Kn.concat(e),r={en:Jn},o=0,i=n;o0;o--){var i=r.slice(0,o).join("-");if(t[i])return t[i]}return null}(n,t)||Jn;return er(e,n,r)}(e,t):er(e.code,[e.code],e)}function er(e,t,n){var r=Ne([Jn,n],["buttonText"]);delete r.code;var o=r.week;return delete r.week,{codeArg:e,codes:t,week:o,simpleNumberFormat:new Intl.NumberFormat(e),options:r}}function tr(e){var t=Qn(e.locale||"en",$n([]).map);return new Xn(r(r({timeZone:bt.timeZone,calendarSystem:"gregory"},e),{locale:t}))}var nr,rr={startTime:"09:00",endTime:"17:00",daysOfWeek:[1,2,3,4,5],display:"inverse-background",classNames:"fc-non-business",groupId:"_businessHours"};function or(e,t){return It(function(e){var t;t=!0===e?[{}]:Array.isArray(e)?e.filter((function(e){return e.daysOfWeek})):"object"==typeof e&&e?[e]:[];return t=t.map((function(e){return r(r({},rr),e)}))}(e),null,t)}function ir(e,t){return e.left>=t.left&&e.left=t.top&&e.top
",e.querySelector("table").style.height="100px",e.querySelector("div").style.height="100%",document.body.appendChild(e);var t=e.querySelector("div").offsetHeight>0;return document.body.removeChild(e),t}()),nr}var dr={defs:{},instances:{}},pr=function(){function e(){this.getKeysForEventDefs=it(this._getKeysForEventDefs),this.splitDateSelection=it(this._splitDateSpan),this.splitEventStore=it(this._splitEventStore),this.splitIndividualUi=it(this._splitIndividualUi),this.splitEventDrag=it(this._splitInteraction),this.splitEventResize=it(this._splitInteraction),this.eventUiBuilders={}}return e.prototype.splitProps=function(e){var t=this,n=this.getKeyInfo(e),r=this.getKeysForEventDefs(e.eventStore),o=this.splitDateSelection(e.dateSelection),i=this.splitIndividualUi(e.eventUiBases,r),a=this.splitEventStore(e.eventStore,r),s=this.splitEventDrag(e.eventDrag),l=this.splitEventResize(e.eventResize),u={};for(var c in this.eventUiBuilders=Oe(n,(function(e,n){return t.eventUiBuilders[n]||it(fr)})),n){var d=n[c],p=a[c]||dr,f=this.eventUiBuilders[c];u[c]={businessHours:d.businessHours||e.businessHours,dateSelection:o[c]||null,eventStore:p,eventUiBases:f(e.eventUiBases[""],d.ui,i[c]),eventSelection:p.instances[e.eventSelection]?e.eventSelection:"",eventDrag:s[c]||null,eventResize:l[c]||null}}return u},e.prototype._splitDateSpan=function(e){var t={};if(e)for(var n=0,r=this.getKeysForDateSpan(e);nn:!!t&&e>=t.end)}}function vr(e,t){var n=["fc-day","fc-day-"+fe[e.dow]];return e.isDisabled?n.push("fc-day-disabled"):(e.isToday&&(n.push("fc-day-today"),n.push(t.getClass("today"))),e.isPast&&n.push("fc-day-past"),e.isFuture&&n.push("fc-day-future"),e.isOther&&n.push("fc-day-other")),n}function gr(e,t){return void 0===t&&(t="day"),JSON.stringify({date:tt(e),type:t})}var mr,yr=null;function Er(){return null===yr&&(yr=function(){var e=document.createElement("div");j(e,{position:"absolute",top:-1e3,left:0,border:0,padding:0,overflow:"scroll",direction:"rtl"}),e.innerHTML="
",document.body.appendChild(e);var t=e.firstChild.getBoundingClientRect().left>e.getBoundingClientRect().left;return W(e),t}()),yr}function Sr(){return mr||(mr=function(){var e=document.createElement("div");e.style.overflow="scroll",document.body.appendChild(e);var t=Dr(e);return document.body.removeChild(e),t}()),mr}function Dr(e){return{x:e.offsetHeight-e.clientHeight,y:e.offsetWidth-e.clientWidth}}function br(e,t){void 0===t&&(t=!1);var n=window.getComputedStyle(e),r=parseInt(n.borderLeftWidth,10)||0,o=parseInt(n.borderRightWidth,10)||0,i=parseInt(n.borderTopWidth,10)||0,a=parseInt(n.borderBottomWidth,10)||0,s=Dr(e),l=s.y-r-o,u={borderLeft:r,borderRight:o,borderTop:i,borderBottom:a,scrollbarBottom:s.x-i-a,scrollbarLeft:0,scrollbarRight:0};return Er()&&"rtl"===n.direction?u.scrollbarLeft=l:u.scrollbarRight=l,t&&(u.paddingLeft=parseInt(n.paddingLeft,10)||0,u.paddingRight=parseInt(n.paddingRight,10)||0,u.paddingTop=parseInt(n.paddingTop,10)||0,u.paddingBottom=parseInt(n.paddingBottom,10)||0),u}function Cr(e,t,n){void 0===t&&(t=!1);var r=n?e.getBoundingClientRect():wr(e),o=br(e,t),i={left:r.left+o.borderLeft+o.scrollbarLeft,right:r.right-o.borderRight-o.scrollbarRight,top:r.top+o.borderTop,bottom:r.bottom-o.borderBottom-o.scrollbarBottom};return t&&(i.left+=o.paddingLeft,i.right-=o.paddingRight,i.top+=o.paddingTop,i.bottom-=o.paddingBottom),i}function wr(e){var t=e.getBoundingClientRect();return{left:t.left+window.pageXOffset,top:t.top+window.pageYOffset,right:t.right+window.pageXOffset,bottom:t.bottom+window.pageYOffset}}function Rr(e){for(var t=[];e instanceof HTMLElement;){var n=window.getComputedStyle(e);if("fixed"===n.position)break;/(auto|scroll)/.test(n.overflow+n.overflowY+n.overflowX)&&t.push(e),e=e.parentNode}return t}function Tr(e,t,n){var r=!1,o=function(){r||(r=!0,t.apply(this,arguments))},i=function(){r||(r=!0,n&&n.apply(this,arguments))},a=e(o,i);a&&"function"==typeof a.then&&a.then(o,i)}var kr=function(){function e(){this.handlers={},this.thisContext=null}return e.prototype.setThisContext=function(e){this.thisContext=e},e.prototype.setOptions=function(e){this.options=e},e.prototype.on=function(e,t){!function(e,t,n){(e[t]||(e[t]=[])).push(n)}(this.handlers,e,t)},e.prototype.off=function(e,t){!function(e,t,n){n?e[t]&&(e[t]=e[t].filter((function(e){return e!==n}))):delete e[t]}(this.handlers,e,t)},e.prototype.trigger=function(e){for(var t=[],n=1;n=n[t]&&e=n[t]&&e0},e.prototype.canScrollHorizontally=function(){return this.getMaxScrollLeft()>0},e.prototype.canScrollUp=function(){return this.getScrollTop()>0},e.prototype.canScrollDown=function(){return this.getScrollTop()0},e.prototype.canScrollRight=function(){return this.getScrollLeft()=c.end?new Date(c.end.valueOf()-1):u),o=this.buildCurrentRangeInfo(e,t),i=/^(year|month|week|day)$/.test(o.unit),a=this.buildRenderRange(this.trimHiddenDays(o.range),o.unit,i),s=a=this.trimHiddenDays(a),d.showNonCurrentDates||(s=nn(s,o.range)),s=nn(s=this.adjustActiveRange(s),r),l=on(o.range,r),{validRange:r,currentRange:o.range,currentRangeUnit:o.unit,isRangeAllDay:i,activeRange:s,renderRange:a,slotMinTime:d.slotMinTime,slotMaxTime:d.slotMaxTime,isValid:l,dateIncrement:this.buildDateIncrement(o.duration)}},e.prototype.buildValidRange=function(){var e=this.props.validRangeInput,t="function"==typeof e?e.call(this.props.calendarApi,this.nowDate):e;return this.refineRange(t)||{start:null,end:null}},e.prototype.buildCurrentRangeInfo=function(e,t){var n,r=this.props,o=null,i=null,a=null;return r.duration?(o=r.duration,i=r.durationUnit,a=this.buildRangeFromDuration(e,t,o,i)):(n=this.props.dayCount)?(i="day",a=this.buildRangeFromDayCount(e,t,n)):(a=this.buildCustomVisibleRange(e))?i=r.dateEnv.greatestWholeUnit(a.start,a.end).unit:(i=et(o=this.getFallbackDuration()).unit,a=this.buildRangeFromDuration(e,t,o,i)),{duration:o,unit:i,range:a}},e.prototype.getFallbackDuration=function(){return Ye({day:1})},e.prototype.adjustActiveRange=function(e){var t=this.props,n=t.dateEnv,r=t.usesMinMaxTime,o=t.slotMinTime,i=t.slotMaxTime,a=e.start,s=e.end;return r&&(Je(o)<0&&(a=be(a),a=n.add(a,o)),Je(i)>1&&(s=ve(s=be(s),-1),s=n.add(s,i))),{start:a,end:s}},e.prototype.buildRangeFromDuration=function(e,t,n,r){var o,i,a,s=this.props,l=s.dateEnv,u=s.dateAlignment;if(!u){var c=this.props.dateIncrement;u=c&&$e(c)<$e(n)?et(c).unit:r}function d(){o=l.startOf(e,u),i=l.add(o,n),a={start:o,end:i}}return Je(n)<=1&&this.isHiddenDay(o)&&(o=be(o=this.skipHiddenDays(o,t))),d(),this.trimHiddenDays(a)||(e=this.skipHiddenDays(e,t),d()),a},e.prototype.buildRangeFromDayCount=function(e,t,n){var r,o=this.props,i=o.dateEnv,a=o.dateAlignment,s=0,l=e;a&&(l=i.startOf(l,a)),l=be(l),r=l=this.skipHiddenDays(l,t);do{r=ve(r,1),this.isHiddenDay(r)||s++}while(se.fetchRange.end:!e.latestFetchId}(e,t,n)})),t,n)}function xo(e,t,n,r){var o={};for(var i in e){var a=e[i];t[i]?o[i]=_o(a,n,r):o[i]=a}return o}function _o(e,t,n){var o=n.options,i=n.calendarApi,a=n.pluginHooks.eventSourceDefs[e.sourceDefId],s=$();return a.fetch({eventSource:e,range:t,context:n},(function(r){var a=r.rawEvents;o.eventSourceSuccess&&(a=o.eventSourceSuccess.call(i,a,r.xhr)||a),e.success&&(a=e.success.call(i,a,r.xhr)||a),n.dispatch({type:"RECEIVE_EVENTS",sourceId:e.sourceId,fetchId:s,fetchRange:t,rawEvents:a})}),(function(r){console.warn(r.message,r),o.eventSourceFailure&&o.eventSourceFailure.call(i,r),e.failure&&e.failure(r),n.dispatch({type:"RECEIVE_EVENT_ERROR",sourceId:e.sourceId,fetchId:s,fetchRange:t,error:r})})),r(r({},e),{isFetching:!0,latestFetchId:s})}function Io(e,t){return He(e,(function(e){return Po(e,t)}))}function Po(e,t){return!t.pluginHooks.eventSourceDefs[e.sourceDefId].ignoreRange}function No(e,t){switch(t.type){case"UNSELECT_DATES":return null;case"SELECT_DATES":return t.selection;default:return e}}function Ho(e,t){switch(t.type){case"UNSELECT_EVENT":return"";case"SELECT_EVENT":return t.eventInstanceId;default:return e}}function Oo(e,t){var n;switch(t.type){case"UNSET_EVENT_DRAG":return null;case"SET_EVENT_DRAG":return{affectedEvents:(n=t.state).affectedEvents,mutatedEvents:n.mutatedEvents,isEvent:n.isEvent};default:return e}}function Ao(e,t){var n;switch(t.type){case"UNSET_EVENT_RESIZE":return null;case"SET_EVENT_RESIZE":return{affectedEvents:(n=t.state).affectedEvents,mutatedEvents:n.mutatedEvents,isEvent:n.isEvent};default:return e}}function Uo(e,t,n,r,o){var i=[];return{headerToolbar:e.headerToolbar?Lo(e.headerToolbar,e,t,n,r,o,i):null,footerToolbar:e.footerToolbar?Lo(e.footerToolbar,e,t,n,r,o,i):null,viewsWithButtons:i}}function Lo(e,t,n,r,o,i,a){return Oe(e,(function(e){return function(e,t,n,r,o,i,a){var s="rtl"===t.direction,l=t.customButtons||{},u=n.buttonText||{},c=t.buttonText||{};return(e?e.split(" "):[]).map((function(e){return e.split(",").map((function(e){if("title"===e)return{buttonName:e};var t,n=void 0,d=void 0,p=void 0,f=void 0;return(t=l[e])?(d=function(e){t.click&&t.click.call(e.target,e,e.target)},(p=r.getCustomButtonIconClass(t))||(p=r.getIconClass(e,s))||(f=t.text)):(n=o[e])?(a.push(e),d=function(){i.changeView(e)},(f=n.buttonTextOverride)||(p=r.getIconClass(e,s))||(f=n.buttonTextDefault)):i[e]&&(d=function(){i[e]()},(f=u[e])||(p=r.getIconClass(e,s))||(f=c[e])),{buttonName:e,buttonClick:d,buttonIcon:p,buttonText:f}}))}))}(e,t,n,r,o,i,a)}))}function Wo(e,t,n,r,o){var i=null;"GET"===(e=e.toUpperCase())?t=function(e,t){return e+(-1===e.indexOf("?")?"?":"&")+Vo(t)}(t,n):i=Vo(n);var a=new XMLHttpRequest;a.open(e,t,!0),"GET"!==e&&a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),a.onload=function(){if(a.status>=200&&a.status<400){var e=!1,t=void 0;try{t=JSON.parse(a.responseText),e=!0}catch(e){}e?r(t,a):o("Failure parsing JSON",a)}else o("Request failed",a)},a.onerror=function(){o("Request failed",a)},a.send(i)}function Vo(e){var t=[];for(var n in e)t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t.join("&")}function zo(e,t){for(var n=Ue(t.getCurrentData().eventSources),r=[],o=0,i=e;o1?{year:"numeric",month:"short",day:"numeric"}:{year:"numeric",month:"long",day:"numeric"}}(e)),{isEndExclusive:e.isRangeAllDay,defaultSeparator:t.titleRangeSeparator})}var Zo=function(){function e(e){var t=this;this.computeOptionsData=it(this._computeOptionsData),this.computeCurrentViewData=it(this._computeCurrentViewData),this.organizeRawLocales=it($n),this.buildLocale=it(Qn),this.buildPluginHooks=ao(),this.buildDateEnv=it(Xo),this.buildTheme=it(Ko),this.parseToolbars=it(Uo),this.buildViewSpecs=it(Do),this.buildDateProfileGenerator=at(Jo),this.buildViewApi=it($o),this.buildViewUiProps=at(ti),this.buildEventUiBySource=it(Qo,Le),this.buildEventUiBases=it(ei),this.parseContextBusinessHours=at(ni),this.buildTitle=it(Yo),this.emitter=new kr,this.actionRunner=new qo(this._handleAction.bind(this),this.updateData.bind(this)),this.currentCalendarOptionsInput={},this.currentCalendarOptionsRefined={},this.currentViewOptionsInput={},this.currentViewOptionsRefined={},this.currentCalendarOptionsRefiners={},this.getCurrentData=function(){return t.data},this.dispatch=function(e){t.actionRunner.request(e)},this.props=e,this.actionRunner.pause();var n={},o=this.computeOptionsData(e.optionOverrides,n,e.calendarApi),i=o.calendarOptions.initialView||o.pluginHooks.initialView,a=this.computeCurrentViewData(i,o,e.optionOverrides,n);e.calendarApi.currentDataManager=this,this.emitter.setThisContext(e.calendarApi),this.emitter.setOptions(a.options);var s,l,u,c=(s=o.calendarOptions,l=o.dateEnv,null!=(u=s.initialDate)?l.createMarker(u):Wn(s.now,l)),d=a.dateProfileGenerator.build(c);sn(d.activeRange,c)||(c=d.currentRange.start);for(var p={dateEnv:o.dateEnv,options:o.calendarOptions,pluginHooks:o.pluginHooks,calendarApi:e.calendarApi,dispatch:this.dispatch,emitter:this.emitter,getCurrentData:this.getCurrentData},f=0,h=o.pluginHooks.contextInit;f1){var m=a&&n.getClass("buttonGroup")||"";return Hr.apply(void 0,o(["div",{className:m}],i))}return i[0]},t}(jr),gi=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={availableWidth:null},t.handleEl=function(e){t.el=e,Yr(t.props.elRef,e),t.updateAvailableWidth()},t.handleResize=function(){t.updateAvailableWidth()},t}return n(t,e),t.prototype.render=function(){var e=this.props,t=this.state,n=e.aspectRatio,r=["fc-view-harness",n||e.liquid||e.height?"fc-view-harness-active":"fc-view-harness-passive"],o="",i="";return n?null!==t.availableWidth?o=t.availableWidth/n:i=1/n*100+"%":o=e.height||"",Hr("div",{ref:this.handleEl,onClick:e.onClick,className:r.join(" "),style:{height:o,paddingBottom:i}},e.children)},t.prototype.componentDidMount=function(){this.context.addResizeHandler(this.handleResize)},t.prototype.componentWillUnmount=function(){this.context.removeResizeHandler(this.handleResize)},t.prototype.updateAvailableWidth=function(){this.el&&this.props.aspectRatio&&this.setState({availableWidth:this.el.offsetWidth})},t}(jr),mi=function(e){function t(t){var n=e.call(this,t)||this;return n.handleSegClick=function(e,t){var r=n.component,o=r.context,i=dn(t);if(i&&r.isValidSegDownEl(e.target)){var a=V(e.target,".fc-event-forced-url"),s=a?a.querySelector("a[href]").href:"";o.emitter.trigger("eventClick",{el:t,event:new zn(r.context,i.eventRange.def,i.eventRange.instance),jsEvent:e,view:o.viewApi}),s&&!e.defaultPrevented&&(window.location.href=s)}},n.destroy=Z(t.el,"click",".fc-event",n.handleSegClick),n}return n(t,e),t}(ai),yi=function(e){function t(t){var n,r,o,i,a,s=e.call(this,t)||this;return s.handleEventElRemove=function(e){e===s.currentSegEl&&s.handleSegLeave(null,s.currentSegEl)},s.handleSegEnter=function(e,t){dn(t)&&(s.currentSegEl=t,s.triggerEvent("eventMouseEnter",e,t))},s.handleSegLeave=function(e,t){s.currentSegEl&&(s.currentSegEl=null,s.triggerEvent("eventMouseLeave",e,t))},s.removeHoverListeners=(n=t.el,r=".fc-event",o=s.handleSegEnter,i=s.handleSegLeave,Z(n,"mouseover",r,(function(e,t){if(t!==a){a=t,o(e,t);var n=function(e){a=null,i(e,t),t.removeEventListener("mouseleave",n)};t.addEventListener("mouseleave",n)}}))),s}return n(t,e),t.prototype.destroy=function(){this.removeHoverListeners()},t.prototype.triggerEvent=function(e,t,n){var r=this.component,o=r.context,i=dn(n);t&&!r.isValidSegDownEl(t.target)||o.emitter.trigger(e,{el:n,event:new zn(o,i.eventRange.def,i.eventRange.instance),jsEvent:t,view:o.viewApi})},t}(ai),Ei=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.buildViewContext=it(Fr),t.buildViewPropTransformers=it(Di),t.buildToolbarProps=it(Si),t.handleNavLinkClick=Y("a[data-navlink]",t._handleNavLinkClick.bind(t)),t.headerRef=Ar(),t.footerRef=Ar(),t.interactionsStore={},t.registerInteractiveComponent=function(e,n){var r=si(e,n),o=[mi,yi].concat(t.props.pluginHooks.componentInteractions).map((function(e){return new e(r)}));t.interactionsStore[e.uid]=o,ui[e.uid]=r},t.unregisterInteractiveComponent=function(e){for(var n=0,r=t.interactionsStore[e.uid];n10?{weekday:"short"}:t>1?{weekday:"short",month:"numeric",day:"numeric",omitCommas:!0}:{weekday:"long"})}var wi="fc-col-header-cell",Ri=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.render=function(){var e=this.context,t=e.dateEnv,n=e.options,o=e.theme,i=e.viewApi,a=this.props,s=a.date,l=a.dateProfile,u=hr(s,a.todayRange,null,l),c=[wi].concat(vr(u,o)),d=t.format(s,a.dayHeaderFormat),p=n.navLinks&&!u.isDisabled&&a.colCnt>1?{"data-navlink":gr(s),tabIndex:0}:{},f=r(r(r({date:t.toDate(s),view:i},a.extraHookProps),{text:d}),u);return Hr(uo,{hookProps:f,classNames:n.dayHeaderClassNames,content:n.dayHeaderContent,defaultContent:ki,didMount:n.dayHeaderDidMount,willUnmount:n.dayHeaderWillUnmount},(function(e,t,n,o){return Hr("th",r({ref:e,className:c.concat(t).join(" "),"data-date":u.isDisabled?void 0:tt(s),colSpan:a.colSpan},a.extraDataAttrs),Hr("div",{className:"fc-scrollgrid-sync-inner"},!u.isDisabled&&Hr("a",r({ref:n,className:["fc-col-header-cell-cushion",a.isSticky?"fc-sticky":""].join(" ")},p),o)))}))},t}(jr),Ti=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.render=function(){var e=this.props,t=this.context,n=t.dateEnv,o=t.theme,i=t.viewApi,a=t.options,s=ve(new Date(2592e5),e.dow),l={dow:e.dow,isDisabled:!1,isFuture:!1,isPast:!1,isToday:!1,isOther:!1},u=[wi].concat(vr(l,o),e.extraClassNames||[]),c=n.format(s,e.dayHeaderFormat),d=r(r(r(r({date:s},l),{view:i}),e.extraHookProps),{text:c});return Hr(uo,{hookProps:d,classNames:a.dayHeaderClassNames,content:a.dayHeaderContent,defaultContent:ki,didMount:a.dayHeaderDidMount,willUnmount:a.dayHeaderWillUnmount},(function(t,n,o,i){return Hr("th",r({ref:t,className:u.concat(n).join(" "),colSpan:e.colSpan},e.extraDataAttrs),Hr("div",{className:"fc-scrollgrid-sync-inner"},Hr("a",{className:["fc-col-header-cell-cushion",e.isSticky?"fc-sticky":""].join(" "),ref:o},i)))}))},t}(jr);function ki(e){return e.text}var Mi=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.initialNowDate=Wn(n.options.now,n.dateEnv),r.initialNowQueriedMs=(new Date).valueOf(),r.state=r.computeTiming().currentState,r}return n(t,e),t.prototype.render=function(){var e=this.props,t=this.state;return e.children(t.nowDate,t.todayRange)},t.prototype.componentDidMount=function(){this.setTimeout()},t.prototype.componentDidUpdate=function(e){e.unit!==this.props.unit&&(this.clearTimeout(),this.setTimeout())},t.prototype.componentWillUnmount=function(){this.clearTimeout()},t.prototype.computeTiming=function(){var e=this.props,t=this.context,n=ge(this.initialNowDate,(new Date).valueOf()-this.initialNowQueriedMs),r=t.dateEnv.startOf(n,e.unit),o=t.dateEnv.add(r,Ye(1,e.unit)),i=o.valueOf()-n.valueOf();return{currentState:{nowDate:r,todayRange:xi(r)},nextState:{nowDate:o,todayRange:xi(o)},waitMs:i}},t.prototype.setTimeout=function(){var e=this,t=this.computeTiming(),n=t.nextState,r=t.waitMs;this.timeoutId=setTimeout((function(){e.setState(n,(function(){e.setTimeout()}))}),r)},t.prototype.clearTimeout=function(){this.timeoutId&&clearTimeout(this.timeoutId)},t.contextType=zr,t}(Nr);function xi(e){var t=be(e);return{start:t,end:ve(t,1)}}var _i=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.createDayHeaderFormatter=it(Ii),t}return n(t,e),t.prototype.render=function(){var e=this.context,t=this.props,n=t.dates,r=t.dateProfile,o=t.datesRepDistinctDays,i=t.renderIntro,a=this.createDayHeaderFormatter(e.options.dayHeaderFormat,o,n.length);return Hr(Mi,{unit:"day"},(function(e,t){return Hr("tr",null,i&&i(),n.map((function(e){return o?Hr(Ri,{key:e.toISOString(),date:e,dateProfile:r,todayRange:t,colCnt:n.length,dayHeaderFormat:a}):Hr(Ti,{key:e.getUTCDay(),dow:e.getUTCDay(),dayHeaderFormat:a})})))}))},t}(jr);function Ii(e,t,n){return e||Ci(t,n)}var Pi=function(){function e(e,t){for(var n=e.start,r=e.end,o=[],i=[],a=-1;n=t.length?t[t.length-1]+1:t[n]},e}(),Ni=function(){function e(e,t){var n,r,o,i=e.dates;if(t){for(r=i[0].getUTCDay(),n=1;nt)return!0}return!1},t.prototype.needsYScrolling=function(){if(Ai.test(this.props.overflowY))return!1;for(var e=this.el,t=this.el.getBoundingClientRect().height-this.getXScrollbarWidth(),n=e.children,r=0;rt)return!0}return!1},t.prototype.getXScrollbarWidth=function(){return Ai.test(this.props.overflowX)?0:this.el.offsetHeight-this.el.clientHeight},t.prototype.getYScrollbarWidth=function(){return Ai.test(this.props.overflowY)?0:this.el.offsetWidth-this.el.clientWidth},t}(jr),Li=function(){function e(e){var t=this;this.masterCallback=e,this.currentMap={},this.depths={},this.callbackMap={},this.handleValue=function(e,n){var r=t,o=r.depths,i=r.currentMap,a=!1,s=!1;null!==e?(a=n in i,i[n]=e,o[n]=(o[n]||0)+1,s=!0):0==--o[n]&&(delete i[n],delete t.callbackMap[n],a=!0),t.masterCallback&&(a&&t.masterCallback(null,String(n)),s&&t.masterCallback(e,String(n)))}}return e.prototype.createRef=function(e){var t=this,n=this.callbackMap[e];return n||(n=this.callbackMap[e]=function(n){t.handleValue(n,String(e))}),n},e.prototype.collect=function(e,t,n){return Fe(this.currentMap,e,t,n)},e.prototype.getAll=function(){return Ue(this.currentMap)},e}();function Wi(e){for(var t=0,n=0,r=F(e,".fc-scrollgrid-shrink");n0&&(this.everMovedDown=!0),i<0?this.everMovedLeft=!0:i>0&&(this.everMovedRight=!0),this.pointerScreenX=n,this.pointerScreenY=r,this.isAnimating||(this.isAnimating=!0,this.requestAnimation(ba()))}},e.prototype.stop=function(){if(this.isEnabled){this.isAnimating=!1;for(var e=0,t=this.scrollCaches;e=0&&u>=0&&c>=0&&d>=0&&(c<=n&&this.everMovedUp&&a.canScrollUp()&&(!r||r.distance>c)&&(r={scrollCache:a,name:"top",distance:c}),d<=n&&this.everMovedDown&&a.canScrollDown()&&(!r||r.distance>d)&&(r={scrollCache:a,name:"bottom",distance:d}),l<=n&&this.everMovedLeft&&a.canScrollLeft()&&(!r||r.distance>l)&&(r={scrollCache:a,name:"left",distance:l}),u<=n&&this.everMovedRight&&a.canScrollRight()&&(!r||r.distance>u)&&(r={scrollCache:a,name:"right",distance:u}))}return r},e.prototype.buildCaches=function(){return this.queryScrollEls().map((function(e){return e===window?new Da(!1):new Sa(e,!1)}))},e.prototype.queryScrollEls=function(){for(var e=[],t=0,n=this.scrollQuery;t=t*t&&r.handleDistanceSurpassed(e)}r.isDragging&&("scroll"!==e.origEvent.type&&(r.mirror.handleMove(e.pageX,e.pageY),r.autoScroller.handleMove(e.pageX,e.pageY)),r.emitter.trigger("dragmove",e))}},r.onPointerUp=function(e){r.isInteracting&&(r.isInteracting=!1,ne(document.body),oe(document.body),r.emitter.trigger("pointerup",e),r.isDragging&&(r.autoScroller.stop(),r.tryStopDrag(e)),r.delayTimeoutId&&(clearTimeout(r.delayTimeoutId),r.delayTimeoutId=null))};var o=r.pointer=new ga(t);return o.emitter.on("pointerdown",r.onPointerDown),o.emitter.on("pointermove",r.onPointerMove),o.emitter.on("pointerup",r.onPointerUp),n&&(o.selector=n),r.mirror=new ya,r.autoScroller=new Ca,r}return n(t,e),t.prototype.destroy=function(){this.pointer.destroy(),this.onPointerUp({})},t.prototype.startDelay=function(e){var t=this;"number"==typeof this.delay?this.delayTimeoutId=setTimeout((function(){t.delayTimeoutId=null,t.handleDelayEnd(e)}),this.delay):this.handleDelayEnd(e)},t.prototype.handleDelayEnd=function(e){this.isDelayEnded=!0,this.tryStartDrag(e)},t.prototype.handleDistanceSurpassed=function(e){this.isDistanceSurpassed=!0,this.tryStartDrag(e)},t.prototype.tryStartDrag=function(e){this.isDelayEnded&&this.isDistanceSurpassed&&(this.pointer.wasTouchScroll&&!this.touchScrollAllowed||(this.isDragging=!0,this.mirrorNeedsRevert=!1,this.autoScroller.start(e.pageX,e.pageY),this.emitter.trigger("dragstart",e),!1===this.touchScrollAllowed&&this.pointer.cancelTouchScroll()))},t.prototype.tryStopDrag=function(e){this.mirror.stop(this.mirrorNeedsRevert,this.stopDrag.bind(this,e))},t.prototype.stopDrag=function(e){this.isDragging=!1,this.emitter.trigger("dragend",e)},t.prototype.setIgnoreMove=function(e){this.pointer.shouldIgnoreMove=e},t.prototype.setMirrorIsVisible=function(e){this.mirror.setIsVisible(e)},t.prototype.setMirrorNeedsRevert=function(e){this.mirrorNeedsRevert=e},t.prototype.setAutoScrollEnabled=function(e){this.autoScroller.isEnabled=e},t}(ci),Ra=function(){function e(e){this.origRect=wr(e),this.scrollCaches=Rr(e).map((function(e){return new Sa(e,!0)}))}return e.prototype.destroy=function(){for(var e=0,t=this.scrollCaches;e=0&&c=0&&do.layer)&&(v.rect.left+=l,v.rect.right+=l,v.rect.top+=u,v.rect.bottom+=u,o=v)}}}return o},e}();function ka(e,t){return!e&&!t||Boolean(e)===Boolean(t)&&Rn(e.dateSpan,t.dateSpan)}function Ma(e,t){for(var n,o,i={},a=0,s=t.pluginHooks.datePointTransforms;ao.start)return c.endDelta=u,c;return null}(s,e,o.subjectEl.classList.contains("fc-event-resizer-start"),l.range,i.pluginHooks.eventResizeJoinTransforms)),u&&(c=Pn(a,i.getCurrentData().eventUiBases,u,i),p.mutatedEvents=c,n.component.isInteractionValid(p)||(d=!0,u=null,c=null,p.mutatedEvents=null)),c?i.dispatch({type:"SET_EVENT_RESIZE",state:p}):i.dispatch({type:"UNSET_EVENT_RESIZE"}),d?Q():ee(),t||(u&&ka(s,e)&&(u=null),n.validMutation=u,n.mutatedRelevantEvents=c)},n.handleDragEnd=function(e){var t=n.component.context,o=n.eventRange.def,i=n.eventRange.instance,a=new zn(t,o,i),s=n.relevantEvents,l=n.mutatedRelevantEvents;if(t.emitter.trigger("eventResizeStop",{el:n.draggingSegEl,event:a,jsEvent:e.origEvent,view:t.viewApi}),n.validMutation){var u=new zn(t,l.defs[o.defId],i?l.instances[i.instanceId]:null);t.dispatch({type:"MERGE_EVENTS",eventStore:l});var c={oldEvent:a,event:u,relatedEvents:Bn(l,t,i),revert:function(){t.dispatch({type:"MERGE_EVENTS",eventStore:s})}};t.emitter.trigger("eventResize",r(r({},c),{el:n.draggingSegEl,startDelta:n.validMutation.startDelta||Ye(0),endDelta:n.validMutation.endDelta||Ye(0),jsEvent:e.origEvent,view:t.viewApi})),t.emitter.trigger("eventChange",c)}else t.emitter.trigger("_noEventResize");n.draggingSeg=null,n.relevantEvents=null,n.validMutation=null};var o=t.component,i=n.dragging=new wa(t.el);i.pointer.selector=".fc-event-resizer",i.touchScrollAllowed=!1,i.autoScroller.isEnabled=o.context.options.dragScroll;var a=n.hitDragging=new Ta(n.dragging,li(t));return a.emitter.on("pointerdown",n.handlePointerDown),a.emitter.on("dragstart",n.handleDragStart),a.emitter.on("hitupdate",n.handleHitUpdate),a.emitter.on("dragend",n.handleDragEnd),n}return n(t,e),t.prototype.destroy=function(){this.dragging.destroy()},t.prototype.querySegEl=function(e){return V(e.subjectEl,".fc-event")},t}(ai);var Na=function(){function e(e){var t=this;this.context=e,this.isRecentPointerDateSelect=!1,this.matchesCancel=!1,this.matchesEvent=!1,this.onSelect=function(e){e.jsEvent&&(t.isRecentPointerDateSelect=!0)},this.onDocumentPointerDown=function(e){var n=t.context.options.unselectCancel,r=e.origEvent.target;t.matchesCancel=!!V(r,n),t.matchesEvent=!!V(r,Ia.SELECTOR)},this.onDocumentPointerUp=function(e){var n=t.context,r=t.documentPointer,o=n.getCurrentData();if(!r.wasTouchScroll){if(o.dateSelection&&!t.isRecentPointerDateSelect){var i=n.options.unselectAuto;!i||i&&t.matchesCancel||n.calendarApi.unselect(e)}o.eventSelection&&!t.matchesEvent&&n.dispatch({type:"UNSELECT_EVENT"})}t.isRecentPointerDateSelect=!1};var n=this.documentPointer=new ga(document);n.shouldIgnoreMove=!0,n.shouldWatchScroll=!1,n.emitter.on("pointerdown",this.onDocumentPointerDown),n.emitter.on("pointerup",this.onDocumentPointerUp),e.emitter.on("select",this.onSelect)}return e.prototype.destroy=function(){this.context.emitter.off("select",this.onSelect),this.documentPointer.destroy()},e}(),Ha={dateClick:_t,eventDragStart:_t,eventDragStop:_t,eventDrop:_t,eventResizeStart:_t,eventResizeStop:_t,eventResize:_t,drop:_t,eventReceive:_t,eventLeave:_t},Oa=function(){function e(e,t){var n=this;this.receivingContext=null,this.droppableEvent=null,this.suppliedDragMeta=null,this.dragMeta=null,this.handleDragStart=function(e){n.dragMeta=n.buildDragMeta(e.subjectEl)},this.handleHitUpdate=function(e,t,o){var i=n.hitDragging.dragging,a=null,s=null,l=!1,u={affectedEvents:{defs:{},instances:{}},mutatedEvents:{defs:{},instances:{}},isEvent:n.dragMeta.create};e&&(a=e.component.context,n.canDropElOnCalendar(o.subjectEl,a)&&(s=function(e,t,n){for(var o=r({},t.leftoverProps),i=0,a=n.pluginHooks.externalDefTransforms;ia.top)return!1}return!0}(e,t,n)){for(var r=e.firstCol;r<=e.lastCol;r++){for(var o=u[r],i=0;i=o[i].top;)i++;o.splice(i,0,{seg:e,top:n,bottom:n+t})}return!0}return!1}for(var M in i)i[M]||(d[M.split(":")[0]]=!0);return{segsByFirstCol:u.map(ts),segsByEachCol:u.map((function(t,n){var o=function(e){for(var t=[],n=0,r=e;n1,showWeekNumbers:t.showWeekNumbers,todayRange:g,dateProfile:n,cells:i,renderIntro:t.renderRowIntro,businessHourSegs:l[a],eventSelection:t.eventSelection,bgEventSegs:u[a].filter(ls),fgEventSegs:c[a],dateSelectionSegs:d[a],eventDrag:p[a],eventResize:f[a],dayMaxEvents:o,dayMaxEventRows:r,clientWidth:t.clientWidth,clientHeight:t.clientHeight,buildMoreLinkText:h,onMoreClick:e.handleMoreLinkClick})})))),!t.forPrint&&a&&a.currentFgEventSegs===t.fgEventSegs&&Hr(is,{date:a.date,dateProfile:n,segs:a.allSegs,alignmentEl:a.dayEl,topAlignmentEl:1===s?t.headerAlignElRef.current:null,onCloseClick:e.handleMorePopoverClose,selectedInstanceId:t.eventSelection,hiddenInstances:(t.eventDrag?t.eventDrag.affectedInstances:null)||(t.eventResize?t.eventResize.affectedInstances:null)||{},todayRange:g}))})))},t.prototype.prepareHits=function(){this.rowPositions=new Mr(this.rootEl,this.rowRefs.collect().map((function(e){return e.getCellEls()[0]})),!1,!0),this.colPositions=new Mr(this.rootEl,this.rowRefs.currentMap[0].getCellEls(),!0,!1)},t.prototype.positionToHit=function(e,t){var n=this.colPositions,r=this.rowPositions,o=n.leftToIndex(e),i=r.topToIndex(t);if(null!=i&&null!=o)return{row:i,col:o,dateSpan:{range:this.getCellRange(i,o),allDay:!0},dayEl:this.getCellEl(i,o),relativeRect:{left:n.lefts[o],right:n.rights[o],top:r.tops[i],bottom:r.bottoms[i]}}},t.prototype.getCellEl=function(e,t){return this.rowRefs.currentMap[e].getCellEls()[t]},t.prototype.getCellRange=function(e,t){var n=this.props.cells[e][t].date;return{start:n,end:ve(n,1)}},t}(oo);function ss(e){return"function"==typeof e?e:function(t){return"+"+t+" "+e}}function ls(e){return e.eventRange.def.allDay}var us=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.slicer=new cs,t.tableRef=Ar(),t.handleRootEl=function(e){e?t.context.registerInteractiveComponent(t,{el:e}):t.context.unregisterInteractiveComponent(t)},t}return n(t,e),t.prototype.render=function(){var e=this.props,t=this.context;return Hr(as,r({ref:this.tableRef,elRef:this.handleRootEl},this.slicer.sliceProps(e,e.dateProfile,e.nextDayThreshold,t,e.dayTableModel),{dateProfile:e.dateProfile,cells:e.dayTableModel.cells,colGroupNode:e.colGroupNode,tableMinWidth:e.tableMinWidth,renderRowIntro:e.renderRowIntro,dayMaxEvents:e.dayMaxEvents,dayMaxEventRows:e.dayMaxEventRows,showWeekNumbers:e.showWeekNumbers,expandRows:e.expandRows,headerAlignElRef:e.headerAlignElRef,clientWidth:e.clientWidth,clientHeight:e.clientHeight,forPrint:e.forPrint}))},t.prototype.prepareHits=function(){this.tableRef.current.prepareHits()},t.prototype.queryHit=function(e,t){var n=this.tableRef.current.positionToHit(e,t);if(n)return{component:this,dateSpan:n.dateSpan,dayEl:n.dayEl,rect:{left:n.relativeRect.left,right:n.relativeRect.right,top:n.relativeRect.top,bottom:n.relativeRect.bottom},layer:0}},t}(oo),cs=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.forceDayIfListItem=!0,t}return n(t,e),t.prototype.sliceRange=function(e,t){return t.sliceRange(e)},t}(Hi),ds=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.buildDayTableModel=it(ps),t.headerRef=Ar(),t.tableRef=Ar(),t}return n(t,e),t.prototype.render=function(){var e=this,t=this.context,n=t.options,r=t.dateProfileGenerator,o=this.props,i=this.buildDayTableModel(o.dateProfile,r),a=n.dayHeaders&&Hr(_i,{ref:this.headerRef,dateProfile:o.dateProfile,dates:i.headerDates,datesRepDistinctDays:1===i.rowCnt}),s=function(t){return Hr(us,{ref:e.tableRef,dateProfile:o.dateProfile,dayTableModel:i,businessHours:o.businessHours,dateSelection:o.dateSelection,eventStore:o.eventStore,eventUiBases:o.eventUiBases,eventSelection:o.eventSelection,eventDrag:o.eventDrag,eventResize:o.eventResize,nextDayThreshold:n.nextDayThreshold,colGroupNode:t.tableColGroupNode,tableMinWidth:t.tableMinWidth,dayMaxEvents:n.dayMaxEvents,dayMaxEventRows:n.dayMaxEventRows,showWeekNumbers:n.weekNumbers,expandRows:!o.isHeightAuto,headerAlignElRef:e.headerElRef,clientWidth:t.clientWidth,clientHeight:t.clientHeight,forPrint:o.forPrint})};return n.dayMinWidth?this.renderHScrollLayout(a,s,i.colCnt,n.dayMinWidth):this.renderSimpleLayout(a,s)},t}(Va);function ps(e,t){var n=new Pi(e.renderRange,t);return new Ni(n,/year|month|week/.test(e.currentRangeUnit))}var fs=io({initialView:"dayGridMonth",optionRefiners:{moreLinkClick:_t,moreLinkClassNames:_t,moreLinkContent:_t,moreLinkDidMount:_t,moreLinkWillUnmount:_t},views:{dayGrid:{component:ds,dateProfileGeneratorClass:function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.buildRenderRange=function(t,n,r){var o,i=this.props.dateEnv,a=e.prototype.buildRenderRange.call(this,t,n,r),s=a.start,l=a.end;(/^(year|month)$/.test(n)&&(s=i.startOfWeek(s),(o=i.startOfWeek(l)).valueOf()!==l.valueOf()&&(l=he(o,1))),this.props.monthMode&&this.props.fixedWeekCount)&&(l=he(l,6-Math.ceil(me(s,l))));return{start:s,end:l}},t}(Co)},dayGridDay:{type:"dayGrid",duration:{days:1}},dayGridWeek:{type:"dayGrid",duration:{weeks:1}},dayGridMonth:{type:"dayGrid",duration:{months:1},monthMode:!0,fixedWeekCount:!0}}}),hs=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.getKeyInfo=function(){return{allDay:{},timed:{}}},t.prototype.getKeysForDateSpan=function(e){return e.allDay?["allDay"]:["timed"]},t.prototype.getKeysForEventDef=function(e){return e.allDay?un(e)?["timed","allDay"]:["allDay"]:["timed"]},t}(pr),vs=function(){function e(e,t,n){this.positions=e,this.dateProfile=t,this.slatMetas=n}return e.prototype.safeComputeTop=function(e){var t=this.dateProfile;if(sn(t.currentRange,e)){var n=be(e),r=e.valueOf()-n.valueOf();if(r>=$e(t.slotMinTime)&&r<$e(t.slotMaxTime))return this.computeTimeTop(Ye(r))}},e.prototype.computeDateTop=function(e,t){return t||(t=be(e)),this.computeTimeTop(Ye(e.valueOf()-t.valueOf()))},e.prototype.computeTimeTop=function(e){var t,n,r=this.positions,o=this.dateProfile,i=this.slatMetas,a=r.els.length,s=i[1].date.valueOf()-i[0].date.valueOf(),l=(e.milliseconds-$e(o.slotMinTime))/s;return l=Math.max(0,l),l=Math.min(a,l),t=Math.floor(l),n=l-(t=Math.min(t,a-1)),r.tops[t]+r.getHeight(t)*n},e}(),gs=[{hours:1},{minutes:30},{minutes:15},{seconds:30},{seconds:15}],ms=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.rootElRef=Ar(),t.slatElRefs=new Li,t}return n(t,e),t.prototype.render=function(){var e=this.props,t=this.context;return Hr("div",{className:"fc-timegrid-slots",ref:this.rootElRef},Hr("table",{className:t.theme.getClass("table"),style:{minWidth:e.tableMinWidth,width:e.clientWidth,height:e.minHeight}},e.tableColGroupNode,Hr(ys,{slatElRefs:this.slatElRefs,axis:e.axis,slatMetas:e.slatMetas})))},t.prototype.componentDidMount=function(){this.updateSizing()},t.prototype.componentDidUpdate=function(){this.updateSizing()},t.prototype.componentWillUnmount=function(){this.props.onCoords&&this.props.onCoords(null)},t.prototype.updateSizing=function(){var e,t=this.props;t.onCoords&&null!==t.clientWidth&&(this.rootElRef.current.offsetHeight&&t.onCoords(new vs(new Mr(this.rootElRef.current,(e=this.slatElRefs.currentMap,t.slatMetas.map((function(t){return e[t.key]}))),!1,!0),this.props.dateProfile,t.slatMetas)))},t}(jr);var ys=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.render=function(){var e=this.props,t=this.context,n=t.options,o=e.slatElRefs;return Hr("tbody",null,e.slatMetas.map((function(i,a){var s={time:i.time,date:t.dateEnv.toDate(i.date),view:t.viewApi},l=["fc-timegrid-slot","fc-timegrid-slot-lane",i.isLabeled?"":"fc-timegrid-slot-minor"];return Hr("tr",{key:i.key,ref:o.createRef(i.key)},e.axis&&Hr(Ss,r({},i)),Hr(uo,{hookProps:s,classNames:n.slotLaneClassNames,content:n.slotLaneContent,didMount:n.slotLaneDidMount,willUnmount:n.slotLaneWillUnmount},(function(e,t,n,r){return Hr("td",{ref:e,className:l.concat(t).join(" "),"data-time":i.isoTimeStr},r)})))})))},t}(jr),Es=St({hour:"numeric",minute:"2-digit",omitZeroMinute:!0,meridiem:"short"});function Ss(e){var t=["fc-timegrid-slot","fc-timegrid-slot-label",e.isLabeled?"fc-scrollgrid-shrink":"fc-timegrid-slot-minor"];return Hr(zr.Consumer,null,(function(n){if(e.isLabeled){var r=n.dateEnv,o=n.options,i=n.viewApi,a=null==o.slotLabelFormat?Es:Array.isArray(o.slotLabelFormat)?St(o.slotLabelFormat[0]):St(o.slotLabelFormat),s={level:0,time:e.time,date:r.toDate(e.date),view:i,text:r.format(e.date,a)};return Hr(uo,{hookProps:s,classNames:o.slotLabelClassNames,content:o.slotLabelContent,defaultContent:Ds,didMount:o.slotLabelDidMount,willUnmount:o.slotLabelWillUnmount},(function(n,r,o,i){return Hr("td",{ref:n,className:t.concat(r).join(" "),"data-time":e.isoTimeStr},Hr("div",{className:"fc-timegrid-slot-label-frame fc-scrollgrid-shrink-frame"},Hr("div",{className:"fc-timegrid-slot-label-cushion fc-scrollgrid-shrink-cushion",ref:o},i)))}))}return Hr("td",{className:t.join(" "),"data-time":e.isoTimeStr})}))}function Ds(e){return e.text}function bs(e,t,n,r,o){for(var i=new Date(0),a=e,s=Ye(0),l=n||function(e){var t,n,r;for(t=gs.length-1;t>=0;t--)if(n=Ye(gs[t]),null!==(r=Qe(n,e))&&r>1)return n;return e}(r),u=[];$e(a)<$e(t);){var c=o.add(i,a),d=null!==Qe(s,l);u.push({date:c,time:a,key:c.toISOString(),isoTimeStr:nt(c),isLabeled:d}),a=Xe(a,r),s=Xe(s,r)}return u}var Cs=St({week:"short"}),ws=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.allDaySplitter=new hs,t.headerElRef=Ar(),t.rootElRef=Ar(),t.scrollerElRef=Ar(),t.state={slatCoords:null},t.handleScrollTopRequest=function(e){var n=t.scrollerElRef.current;n&&(n.scrollTop=e)},t.renderHeadAxis=function(e){void 0===e&&(e="");var n=t.context.options,o=t.props.dateProfile.renderRange,i=ye(o.start,o.end),a=n.navLinks&&1===i?{"data-navlink":gr(o.start,"week"),tabIndex:0}:{};return n.weekNumbers?Hr(ca,{date:o.start,defaultFormat:Cs},(function(t,n,o,i){return Hr("th",{ref:t,className:["fc-timegrid-axis","fc-scrollgrid-shrink"].concat(n).join(" ")},Hr("div",{className:"fc-timegrid-axis-frame fc-scrollgrid-shrink-frame fc-timegrid-axis-frame-liquid",style:{height:e}},Hr("a",r({ref:o,className:"fc-timegrid-axis-cushion fc-scrollgrid-shrink-cushion fc-scrollgrid-sync-inner"},a),i)))})):Hr("th",{className:"fc-timegrid-axis"},Hr("div",{className:"fc-timegrid-axis-frame",style:{height:e}}))},t.renderTableRowAxis=function(e){var n=t.context,r=n.options,o=n.viewApi,i={text:r.allDayText,view:o};return Hr(uo,{hookProps:i,classNames:r.allDayClassNames,content:r.allDayContent,defaultContent:Rs,didMount:r.allDayDidMount,willUnmount:r.allDayWillUnmount},(function(t,n,r,o){return Hr("td",{ref:t,className:["fc-timegrid-axis","fc-scrollgrid-shrink"].concat(n).join(" ")},Hr("div",{className:"fc-timegrid-axis-frame fc-scrollgrid-shrink-frame"+(null==e?" fc-timegrid-axis-frame-liquid":""),style:{height:e}},Hr("span",{className:"fc-timegrid-axis-cushion fc-scrollgrid-shrink-cushion fc-scrollgrid-sync-inner",ref:r},o)))}))},t.handleSlatCoords=function(e){t.setState({slatCoords:e})},t}return n(t,e),t.prototype.renderSimpleLayout=function(e,t,n){var r=this.context,o=this.props,i=[],a=Ki(r.options);return e&&i.push({type:"header",key:"header",isSticky:a,chunk:{elRef:this.headerElRef,tableClassName:"fc-col-header",rowContent:e}}),t&&(i.push({type:"body",key:"all-day",chunk:{content:t}}),i.push({type:"body",key:"all-day-divider",outerContent:Hr("tr",{className:"fc-scrollgrid-section"},Hr("td",{className:"fc-timegrid-divider "+r.theme.getClass("tableCellShaded")}))})),i.push({type:"body",key:"body",liquid:!0,expandRows:Boolean(r.options.expandRows),chunk:{scrollerElRef:this.scrollerElRef,content:n}}),Hr(yo,{viewSpec:r.viewSpec,elRef:this.rootElRef},(function(e,t){return Hr("div",{className:["fc-timegrid"].concat(t).join(" "),ref:e},Hr($i,{liquid:!o.isHeightAuto&&!o.forPrint,cols:[{width:"shrink"}],sections:i}))}))},t.prototype.renderHScrollLayout=function(e,t,n,r,o,i,a){var s=this,l=this.context.pluginHooks.scrollGridImpl;if(!l)throw new Error("No ScrollGrid implementation");var u=this.context,c=this.props,d=!c.forPrint&&Ki(u.options),p=!c.forPrint&&Ji(u.options),f=[];e&&f.push({type:"header",key:"header",isSticky:d,syncRowHeights:!0,chunks:[{key:"axis",rowContent:function(e){return Hr("tr",null,s.renderHeadAxis(e.rowSyncHeights[0]))}},{key:"cols",elRef:this.headerElRef,tableClassName:"fc-col-header",rowContent:e}]}),t&&(f.push({type:"body",key:"all-day",syncRowHeights:!0,chunks:[{key:"axis",rowContent:function(e){return Hr("tr",null,s.renderTableRowAxis(e.rowSyncHeights[0]))}},{key:"cols",content:t}]}),f.push({key:"all-day-divider",type:"body",outerContent:Hr("tr",{className:"fc-scrollgrid-section"},Hr("td",{colSpan:2,className:"fc-timegrid-divider "+u.theme.getClass("tableCellShaded")}))}));var h=u.options.nowIndicator;return f.push({type:"body",key:"body",liquid:!0,expandRows:Boolean(u.options.expandRows),chunks:[{key:"axis",content:function(e){return Hr("div",{className:"fc-timegrid-axis-chunk"},Hr("table",{style:{height:e.expandRows?e.clientHeight:""}},e.tableColGroupNode,Hr("tbody",null,Hr(Ts,{slatMetas:i}))),Hr("div",{className:"fc-timegrid-now-indicator-container"},Hr(Mi,{unit:h?"minute":"day"},(function(e){var t=h&&a&&a.safeComputeTop(e);return"number"==typeof t?Hr(na,{isAxis:!0,date:e},(function(e,n,r,o){return Hr("div",{ref:e,className:["fc-timegrid-now-indicator-arrow"].concat(n).join(" "),style:{top:t}},o)})):null}))))}},{key:"cols",scrollerElRef:this.scrollerElRef,content:n}]}),p&&f.push({key:"footer",type:"footer",isSticky:!0,chunks:[{key:"axis",content:Xi},{key:"cols",content:Xi}]}),Hr(yo,{viewSpec:u.viewSpec,elRef:this.rootElRef},(function(e,t){return Hr("div",{className:["fc-timegrid"].concat(t).join(" "),ref:e},Hr(l,{liquid:!c.isHeightAuto&&!c.forPrint,colGroups:[{width:"shrink",cols:[{width:"shrink"}]},{cols:[{span:r,minWidth:o}]}],sections:f}))}))},t.prototype.getAllDayMaxEventProps=function(){var e=this.context.options,t=e.dayMaxEvents,n=e.dayMaxEventRows;return!0!==t&&!0!==n||(t=void 0,n=5),{dayMaxEvents:t,dayMaxEventRows:n}},t}(oo);function Rs(e){return e.text}var Ts=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.render=function(){return this.props.slatMetas.map((function(e){return Hr("tr",{key:e.key},Hr(Ss,r({},e)))}))},t}(jr);function ks(e,t){var n,r=[];for(n=0;ni.top&&o.top0?" fc-timegrid-event-harness-inset":""),key:s,style:r({visibility:t[s]?"hidden":""},u)},Hr(As,r({seg:e,isDragging:n,isResizing:o,isDateSelecting:i,isSelected:s===l.eventSelection,isCondensed:e.bottom-e.top0?e.renderSegList(s,i):e.renderEmptyMessage()))}))},t.prototype.renderEmptyMessage=function(){var e=this.context,t=e.options,n=e.viewApi,r={text:t.noEventsText,view:n};return Hr(uo,{hookProps:r,classNames:t.noEventsClassNames,content:t.noEventsContent,defaultContent:tl,didMount:t.noEventsDidMount,willUnmount:t.noEventsWillUnmount},(function(e,t,n,r){return Hr("div",{className:["fc-list-empty"].concat(t).join(" "),ref:e},Hr("div",{className:"fc-list-empty-cushion",ref:n},r))}))},t.prototype.renderSegList=function(e,t){var n=this.context,o=n.theme,i=n.options,a=function(e){var t,n,r=[];for(t=0;t",e.whenTransitionDone=K,e.wholeDivideDurations=Qe,e}({});;function Calendar_Model_Initialize(){Ext.define('CalendarSettingsWrapper',{extend:'Ext.data.Model',fields:[{name:'FirstDayOfWeek',type:'string'},{name:'WeekendDays',type:'string'}],associations:[{type:'hasMany',associationKey:'vTenantHoliday',model:'vTenantHoliday',name:'vTenantHoliday'}]});Ext.define('vTenantHoliday',{idProperty:'HolidayID',extend:'Ext.data.Model',fields:[{name:'HolidayID',type:'string'},{name:'Date',type:'date',dateFormat:'c'},{name:'Description',type:'string'},{name:'Skip',type:'bool'}]});};function Calendar_Store_Initialize(){window.CalendarSettingsStore=Ext.create('Ext.data.JsonStore',{model:'CalendarSettingsWrapper',proxy:{type:'rest',url:'/api/Calendar_Index_CalendarSettings',reader:{type:'json'},listeners:{exception:function exception(proxy,response,operation){ProcessException(response,operation);}}},autoSync:false,listeners:{write:processSaveGridResponse,load:function load(store,operation){Calendar_Index_ProcessLoad(store);}}});window.HolidayStore=Ext.create('Ext.data.JsonStore',{model:'vTenantHoliday',proxy:{type:'memory',reader:{type:'json',root:'vTenantHoliday'}}});};window.lastSelectedUserCookie='lastSelectedUserCookie';function Calendar_Controls_IsChanged(d){var res=d.seconds!=0||d.minutes!=0||d.hours!=0||d.days!=0||d.months!=0||d.years!=0;return res;} function Calendar_Controls_Initialize2(){var WeekendDays=CalendarSettingsStore.getAt(0).get('WeekendDays');window.calendarViewModalView.init('divCalendar',WeekendDays,'/api/Calendar_Index_ChangeTaskPeriod',Calendar_Index_OpenTask,function(info,successCallback,failureCallback){dearHelper.blockUI.show('Reading tasks...');Ext.Ajax.request({url:'/api/Calendar_Index_vTask/Get',method:'GET',headers:window.TaskClientTimeHeader,params:{startDate:moment(info.start).format('YYYY-MM-DD'),endDate:moment(info.end).format('YYYY-MM-DD'),entityTypes:window.EntityTypes,taskCategoryID:window.TaskCategoryID,userID:window.SelectedUserID},success:function success(response){dearHelper.blockUI.hide();var data=JSON.parse(response.responseText);var result=[];for(var i=0;iCompleted: ".concat(moment(OriginalTask.CompletedDate).format(window.TaskModule_DateTimeFormat),"");} if(OriginalTask.Details&&OriginalTask.Details.length>0){var taskDetails=OriginalTask.Details;if(taskDetails.length>100){taskDetails="".concat(taskDetails.substring(0,100),"...");} details+="
".concat(taskDetails,"
");} var completedLabel='';if(OriginalTask.IsCompleted){completedLabel="  ");} var taskCategory='';if(OriginalTask.TaskCategoryName&&OriginalTask.TaskCategoryName.length>0){taskCategory="".concat(OriginalTask.TaskCategoryName,"");element.css({'background-color':"#".concat(OriginalTask.TaskCategoryBgColor)});if(d.view.type=='timeGridDay'){element.find('.fc-event-main-frame').append(taskCategory);}else{element.append(taskCategory);}} var dayContent="
".concat(completedLabel,"").concat(title,"")+"
".concat(details);element.find('.fc-event-title').html(dayContent);if(!IsEmptyID(OriginalTask.MasterEntityID)){var entityName=OriginalTask.EntityType===window.TaskConstant.EntityType.DeliveryTask?OriginalTask.LinkTo:OriginalTask.EntityName;var entityLink="
".concat(Task_GetEntityLink(OriginalTask.MasterEntityID,OriginalTask.EntityType,entityName,null,OriginalTask.MasterEntityID,OriginalTask.EntityName),"
");if(d.event.allDay==false){element.find('.fc-event-title').prepend(entityLink);}else{element.find('.fc-event-main-frame').prepend(entityLink);}} element.css('color','#333');element.css('margin-left','10px;');element.css('border','1px solid #ccc');if(d.event.allDay==false){element.find('.fc-event-time').attr('data-start','');element.find('.fc-event-time').attr('data-full','');var startStr=moment(OriginalTask.StartDate).format(TaskModule_TimeFormat);var endStr=moment(OriginalTask.EndDate).format(TaskModule_TimeFormat);if(startStr==endStr){element.find('.fc-event-time').html("".concat(startStr,""));}else{element.find('.fc-event-time').html("".concat(startStr,"-").concat(endStr,""));}}else{element.find('.fc-event-time').html('');}},dayCellClassNames:function dayCellClassNames(d){return weekendDays.includes(d.dow)?'day-off':'';},eventDrop:function eventDrop(d){var event=d.event;var delta=d.delta;if(event.end==null){event.end=event.start;} var isChanged=delta.days!=0||delta.milliseconds!=0||delta.months!=0||delta.years!=0||d.oldEvent._def.allDay!=d.event._def.allDay;if(isChanged==true){var OriginalTask=event._def.extendedProps.OriginalTask;if(OriginalTask.IsCompleted){d.revert();}else{var start=moment(OriginalTask.StartDate);var end=moment(OriginalTask.EndDate);if(d.oldEvent._def.allDay==true&&d.event._def.allDay==false){if(currentViewType=='timeGridDay'){start=start.startOf('day').add(delta.milliseconds,'ms');end=start.clone().startOf('day').add(1,'h').add(delta.milliseconds,'ms');}}else if(currentViewType=='timeGridDay'){start=start.add(delta.milliseconds,'ms');end=end.add(delta.milliseconds,'ms');}else{start=start.add(delta.days,'d');end=end.add(delta.days,'d');} _changePeriod(event.id,start,end,d.event._def.allDay,function(newTaskData){d.event.setExtendedProp('OriginalTask',newTaskData);d.event.setProp('start',moment(newTaskData.StartDate).format());d.event.setProp('end',moment(newTaskData.EndDate).add(1,'ms').format());var startStr=moment(newTaskData.StartDate).format(TaskModule_TimeFormat);var endStr=moment(newTaskData.EndDate).format(TaskModule_TimeFormat);if(startStr==endStr){$(d.el).find('.fc-event-time').html("".concat(startStr,""));}else{$(d.el).find('.fc-event-time').html("".concat(startStr,"-").concat(endStr,""));} cleanTrash($('.fc-event-title'));cleanTrash($('.fc-event-time'));});}} cleanTrash($('.fc-event-title'));cleanTrash($('.fc-event-time'));},eventDragStart:function eventDragStart(d){_editStart=true;},eventDragStop:function eventDragStop(d){_editStart=false;},eventResize:function eventResize(d){var event=d.event;var sdelta=d.startDelta;var edelta=d.endDelta;if(event.end==null){event.end=event.start;} var isChanged=sdelta.days!=0||sdelta.milliseconds!=0||sdelta.months!=0||sdelta.years!=0||edelta.days!=0||edelta.milliseconds!=0||edelta.months!=0||edelta.years!=0;if(isChanged==true){var OriginalTask=event._def.extendedProps.OriginalTask;if(OriginalTask.IsCompleted){d.revert();}else{var start=moment(OriginalTask.StartDate);var end=moment(OriginalTask.EndDate);if(currentViewType=='timeGridDay'){start=start.add(sdelta.milliseconds,'ms');end=end.add(edelta.milliseconds,'ms');}else{start=start.add(sdelta.days,'d');end=end.add(edelta.days,'d');} OriginalTask.StartDate=start.format();OriginalTask.EndDate=end.format();_changePeriod(event.id,start,end,null,function(newTaskData){event.OriginalTask=newTaskData;event.allDay=newTaskData.IsAllDay;event.title=newTaskData.Name;event.start=moment(newTaskData.StartDate).format();event.end=moment(newTaskData.EndDate).add(1,'ms').format();event.backgroundColor="#".concat(newTaskData.TaskCategoryBgColor);event.color="#".concat(newTaskData.TaskCategoryColor);event.className=newTaskData.IsCompleted?'task-completed':'';if(currentViewType=='timeGridDay'){var startStr=moment(newTaskData.StartDate).format(TaskModule_TimeFormat);var endStr=moment(newTaskData.EndDate).format(TaskModule_TimeFormat);if(startStr==endStr){$(d.el).find('.fc-event-time').html("".concat(startStr,""));}else{$(d.el).find('.fc-event-time').html("".concat(startStr,"-").concat(endStr,""));}}});}} cleanTrash($('.fc-event-title'));cleanTrash($('.fc-event-time'));},eventResizeStart:function eventResizeStart(d){_editStart=true;},eventResizeStop:function eventResizeStop(d){_editStart=false;},eventContent:function eventContent(d){if(_editStart&&d.view.type=='timeGridDay'){var OriginalTask=d.event._def.extendedProps.OriginalTask;var tempData={entityLink:'',details:'',category:'',categoryColor:'',taskName:OriginalTask.Name,completed:'',completedIcon:'',parentClass:''};if(!IsEmptyID(OriginalTask.MasterEntityID)){tempData.entityLink=Task_GetEntityLink(OriginalTask.MasterEntityID,OriginalTask.EntityType,OriginalTask.EntityName);} if(d.event.allDay==false){var startStr=moment(OriginalTask.StartDate).format(TaskModule_TimeFormat);var endStr=moment(OriginalTask.EndDate).format(TaskModule_TimeFormat);if(startStr==endStr){tempData.timeStr=startStr;}else{tempData.timeStr="".concat(startStr," -").concat(endStr);}} if(OriginalTask.TaskCategoryName&&OriginalTask.TaskCategoryName.length>0){tempData.category=OriginalTask.TaskCategoryName;tempData.categoryColor=OriginalTask.TaskCategoryBgColor.length>0?"background-color:#".concat(OriginalTask.TaskCategoryBgColor):'';} if(OriginalTask.IsCompleted){tempData.completed="Completed: ".concat(moment(OriginalTask.CompletedDate).format(window.TaskModule_DateTimeFormat));tempData.completedIcon=" ");} var startDate=moment(OriginalTask.StartDate).toDate();var endDate=moment(OriginalTask.EndDate).toDate();if(OriginalTask.IsCompleted){tempData.parentClass='completed';}else if(Task_IsOverdueTask(d.event.allDay,startDate,endDate)){tempData.parentClass='overdue';} if(OriginalTask.Details&&OriginalTask.Details.length>0){var taskDetails=OriginalTask.Details;if(taskDetails.length>100){taskDetails="".concat(taskDetails.substring(0,100),"...");} tempData.details=taskDetails;} return{html:"\n
\n
\n
").concat(tempData.entityLink,"
\n
").concat(tempData.timeStr,"
\n \n
\n
\n
").concat(tempData.completedIcon," ").concat(tempData.taskName,"
\n
").concat(tempData.completed,"
\n
").concat(tempData.details,"
\n
\n \n
\n ").concat(tempData.category,"\n
\n
")};}}});window["divCalendar_".concat(_instanceName)].render();var calendarControl="
\n \n
\n ");if(!$('.calendar-controls').length){$("#".concat(calendarId)).prepend(calendarControl);window["divCalendar_".concat(_instanceName)].render();}} function _changePeriod(taskId,start,end,allDay,callback){Ext.Ajax.request({url:_changePeriodUrl,method:'GET',params:{id:taskId,start:start.format(),end:end.format(),allDay:allDay},success:function success(response){var newTaskData=JSON.parse(response.responseText);if(typeof callback==='function'){callback(newTaskData);}}});} function cleanTrash(elements){elements.each(function(){var t=$(this).html();var ind=t.lastIndexOf('>');t=t.substring(0,ind+1);$(this).html(t);});} function changeView(el,viewType,instanceName){$(el).closest('.dropdown-menu').find('li').removeClass('active');$(el).parents('.calendar-controls').find('>button').html($(el).text());$(el).closest('.dropdown-menu').find("a[data-value=\"".concat(currentViewType,"\"]")).parent('li').addClass('active');currentViewType=viewType;window["divCalendar_".concat(instanceName)].changeView(currentViewType);} function calendarHolidays(viewType){var holidayGroups={};var count=HolidayStore.getCount();for(var i=0;i".concat(holidayGroups[d][i],"");} popoverClass='popovers';attrs=' data-trigger="hover" ';attrs+=' data-toggle="popover" ';attrs+=' data-placement="top" ';attrs+=" data-content=\"".concat(holidays,"\" ");attrs+=' data-delay=\'{"show":"500", "hide":"100"}\' ';attrs+=' data-html="true" ';attrs+=' data-original-title="Holidays" ';holidays+='';cellTop.prepend(" ").concat(firstHoliday,""));} $('.popovers').popover();}} function getCalendar(){return window["divCalendar_".concat(_instanceName)];} function render(){window["divCalendar_".concat(_instanceName)].render();} function refetchEvents(){window["divCalendar_".concat(_instanceName)].refetchEvents();} return{init:init,changeView:changeView,getCalendar:getCalendar,refetchEvents:refetchEvents,render:render};};window.calendarViewModalView=window.calendarFactory('calendarViewModalView');;function Calendar_Index_Ready(){Calendar_Model_Initialize();Calendar_Store_Initialize();} function InitCalendarPopup(){window.isFirstRun=window.isFirstRun===undefined;dearHelper.blockUI.show('Initialising Calendar...');if(window.isFirstRun){$('#divCalendarSelectors').addClass('hiddenContent');} CalendarSettingsStore.load();} function Calendar_Index_AccessCallback(){if(window.TaskModule_IsEnable){window.SelectedUserID=null;if($('#calendarModal').length){TaskShared_TaskModel_Initialize();Calendar_Controls_Initialize2();$('#btnRefresh').click(Calendar_Index_Refresh);$('#btnAddNewTask').click(Calendar_Index_AddNewTask);cbEntityType.on('change',Calendar_Index_ApplyFilter);$('#cbTaskCategory').on('change',Calendar_Index_ApplyFilter);Calendar_Index_Load();}else{console.log('NoPageAccess');NoPageAccess();}}} function Calendar_Index_AddNewTask(){Task_New({},{visibility:{}},function(task){Calendar_Index_Refresh();});setTimeout(function(){var Task_taskModal=$('#Task_taskModal');Task_taskModal.on('hidden.bs.modal',function(event){$(this).closest('.modal-scrollable').css('z-index','-1');var prevModals=$('.modal-backdrop.fade');if(prevModals.length>1){prevModals[prevModals.length-1].remove();}});Task_taskModal.on('show.bs.modal',function(event){$(this).closest('.modal-scrollable').css('z-index','10052');$(this).addClass('in');});Task_taskModal.css({display:'block',height:'570px','margin-top':'-300px'});},100);} function Calendar_Index_ApplyFilter(e){console.log(e);var data=cbEntityType.select2('data');var entityTypes='';if(data&&data.length>0){for(var i=0;i0){taskCategoryID=data[0].id;} window.TaskCategoryID=taskCategoryID;if(window.TaskModule_AllTasks==true){data=$('#cbUser').select2('data');var userID=null;if(data&&data.length>0){userID=data[0].id;var cookieName="".concat(lastSelectedUserCookie,"_").concat(window.UserID);var user={id:data[0].id,name:data[0].name};setCookie(cookieName,JSON.stringify(user));} console.log(data);window.SelectedUserID=userID;} Calendar_Index_Refresh();} function Calendar_Index_Load(){window.calendarViewModalView.render();} function Calendar_Index_Refresh(){window.calendarViewModalView.refetchEvents();} function Calendar_Index_OpenTask(eventClickInfo){if($(eventClickInfo.jsEvent.target).hasClass('entity-link')){return;} var originalTask=eventClickInfo.event._def.extendedProps.OriginalTask;taskHelper.taskDialog.open(originalTask,window.TaskOpenOption,function(task,action){Calendar_Index_Refresh();if(action=='save'){if(task.CompletedDate!=originalTask.CompletedDate){Calendar_Index_Load();}else{Calendar_Index_UpdateEvent(Calendar_Index_UpdateEventProp(eventClickInfo.event,task));}}else if(action=='stopprocess'){}},function(){Calendar_Index_Refresh();});} function Calendar_Index_UpdateEvent(event){event.setProp('id',event.id);event.setProp('title',event.title);event.setProp('start',event.start);event.setProp('end',event.end);event.setProp('allDay',event.allDay);event.setProp('backgroundColor',event.backgroundColor);event.setProp('className',event.className);event.setExtendedProp('OriginalTask',event._def.extendedProps.OriginalTask);} function Calendar_Index_UpdateEventProp(targetEvent,sourceTask){targetEvent.id=sourceTask.TaskID;targetEvent.title=sourceTask.Name;targetEvent.start=sourceTask.StartDate;targetEvent.end=sourceTask.EndDate;targetEvent.allDay=sourceTask.StartDate==sourceTask.EndDate;targetEvent.backgroundColor="#".concat(sourceTask.TaskCategoryColor);targetEvent.className=sourceTask.IsCompleted?'task-completed':'';targetEvent.OriginalTask=sourceTask;return targetEvent;} function Calendar_Index_ProcessLoad(){if(window.isFirstRun){$('#divCalendarSelectors').removeClass('hiddenContent');window.isFirstRun=false;} dearHelper.blockUI.hide();if(CalendarSettingsStore.getCount()==1){HolidayStore.loadRawData(CalendarSettingsStore.getProxy().getReader().jsonData);Calendar_Index_AccessCallback();}};