/*! FullCalendar Timeline Plugin v4.1.0 Docs & License: https://fullcalendar.io/scheduler (c) 2019 Adam Shaw */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@fullcalendar/core")):"function"==typeof define&&define.amd?define(["exports","@fullcalendar/core"],t):(e=e||self,t(e.FullCalendarTimeline={},e.FullCalendar))}(this,function(e,t){"use strict";function r(e,t){function r(){this.constructor=e}T(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function n(){return z||(z=i())}function i(){var e=t.htmlToElement('
A
');document.body.appendChild(e);var r;return e.scrollLeft>0?r="positive":(e.scrollLeft=1,r=e.scrollLeft>0?"reverse":"negative"),t.removeElement(e),r}function o(e,r){var n=r.dateEnv,i={labelInterval:c(r,"slotLabelInterval"),slotDuration:c(r,"slotDuration")};d(i,e,n),h(i,e,n),u(i,e,n);var o=r.opt("slotLabelFormat"),s=Array.isArray(o)?o:null!=o?[o]:p(i,e,n,r);i.headerFormats=s.map(function(e){return t.createFormatter(e)}),i.isTimeScale=Boolean(i.slotDuration.milliseconds);var v=null;if(!i.isTimeScale){var y=t.greatestDurationDenominator(i.slotDuration).unit;/year|month|week/.test(y)&&(v=y)}i.largeUnit=v,i.emphasizeWeeks=t.isSingleDay(i.slotDuration)&&f("weeks",e,n)>=2&&!r.opt("businessHours");var S,b,E=r.opt("snapDuration");E&&(S=t.createDuration(E),b=t.wholeDivideDurations(i.slotDuration,S)),null==b&&(S=i.slotDuration,b=1),i.snapDuration=S,i.snapsPerSlot=b;var D=t.asRoughMs(e.maxTime)-t.asRoughMs(e.minTime),w=l(e.renderRange.start,i,n),C=l(e.renderRange.end,i,n);i.isTimeScale&&(w=n.add(w,e.minTime),C=n.add(t.addDays(C,-1),e.maxTime)),i.timeWindowMs=D,i.normalizedRange={start:w,end:C};for(var T=[],R=w;Rt.config.MAX_TIMELINE_SLOTS&&(console.warn("slotLabelInterval results in too many cells"),e.labelInterval=null)}if(e.slotDuration){var l=n.countDurationsBetween(i.start,i.end,e.slotDuration);l>t.config.MAX_TIMELINE_SLOTS&&(console.warn("slotDuration results in too many cells"),e.slotDuration=null)}if(e.labelInterval&&e.slotDuration){var s=t.wholeDivideDurations(e.labelInterval,e.slotDuration);(null===s||s<1)&&(console.warn("slotLabelInterval must be a multiple of slotDuration"),e.slotDuration=null)}}function h(e,r,n){var i=r.currentRange,o=e.labelInterval;if(!o){var l=void 0;if(e.slotDuration){for(var s=0,a=O;s=W)break}e.labelInterval=o}return o}function u(e,r,n){var i=r.currentRange,o=e.slotDuration;if(!o){for(var l=h(e,r,n),s=0,a=O;s1&&u<=A){o=d;break}}if(o){var p=n.countDurationsBetween(i.start,i.end,o);p>B&&(o=null)}o||(o=l),e.slotDuration=o}return o}function p(e,r,n,i){var o,l,s=e.labelInterval,a=t.greatestDurationDenominator(s).unit,c=i.opt("weekNumbers"),d=o=l=null;switch("week"!==a||c||(a="day"),a){case"year":d={year:"numeric"};break;case"month":f("years",r,n)>1&&(d={year:"numeric"}),o={month:"short"};break;case"week":f("years",r,n)>1&&(d={year:"numeric"}),o={week:"narrow"};break;case"day":f("years",r,n)>1?d={year:"numeric",month:"long"}:f("months",r,n)>1&&(d={month:"long"}),c&&(o={week:"short"}),l={weekday:"narrow",day:"numeric"};break;case"hour":c&&(d={week:"short"}),f("days",r,n)>1&&(o={weekday:"short",day:"numeric",month:"numeric",omitCommas:!0}),l={hour:"numeric",minute:"2-digit",omitZeroMinute:!0,meridiem:"short"};break;case"minute":t.asRoughMinutes(s)/60>=A?(d={hour:"numeric",meridiem:"short"},o=function(e){return":"+t.padStart(e.date.minute,2)}):d={hour:"numeric",minute:"numeric",meridiem:"short"};break;case"second":t.asRoughSeconds(s)/60>=A?(d={hour:"numeric",minute:"2-digit",meridiem:"lowercase"},o=function(e){return":"+t.padStart(e.date.second,2)}):d={hour:"numeric",minute:"2-digit",second:"2-digit",meridiem:"lowercase"};break;case"millisecond":d={hour:"numeric",minute:"2-digit",second:"2-digit",meridiem:"lowercase"},o=function(e){return"."+t.padStart(e.millisecond,3)}}return[].concat(d||[],o||[],l||[])}function f(e,r,n){var i=r.currentRange,o=null;return"years"===e?o=n.diffWholeYears(i.start,i.end):"months"===e?o=n.diffWholeMonths(i.start,i.end):"weeks"===e?o=n.diffWholeMonths(i.start,i.end):"days"===e&&(o=t.diffWholeDays(i.start,i.end)),o||0}function g(e,t){for(var r=e.slotDates,n=e.emphasizeWeeks,i=null,o=[],l=0,s=r;l1&&h'),r=e.style.position;return r.indexOf("sticky")!==-1?r:null}function E(e){for(var t=0,r=0,n=e;rt.left}function C(e,t){var r=e.resourceEditable;if(null==r){var n=e.sourceId&&t.state.eventSources[e.sourceId];n&&(r=n.extendedProps.resourceEditable),null==r&&(r=t.opt("eventResourceEditable"),null==r&&(r=!0))}return r}/*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ var T=function(e,t){return(T=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},R=function(){return R=Object.assign||function(e){for(var t,r=1,n=arguments.length;r
'),this.contentEl=this.el.querySelector(".fc-content"),this.bgEl=this.el.querySelector(".fc-bg")}return e.prototype.setGutters=function(e){e?R(this.gutters,e):this.gutters={},this.updateSize()},e.prototype.setWidth=function(e){this.width=e,this.updateSize()},e.prototype.setMinWidth=function(e){this.minWidth=e,this.updateSize()},e.prototype.clearWidth=function(){this.width=null,this.minWidth=null,this.updateSize()},e.prototype.updateSize=function(){var e=this,r=e.gutters,n=e.el;t.forceClassName(n,"fc-gutter-left",r.left),t.forceClassName(n,"fc-gutter-right",r.right),t.forceClassName(n,"fc-gutter-top",r.top),t.forceClassName(n,"fc-gutter-bottom",r.bottom),t.applyStyle(n,{paddingLeft:r.left||"",paddingRight:r.right||"",paddingTop:r.top||"",paddingBottom:r.bottom||"",width:null!=this.width?this.width+(r.left||0)+(r.right||0):"",minWidth:null!=this.minWidth?this.minWidth+(r.left||0)+(r.right||0):""}),t.applyStyle(this.bgEl,{left:r.left||"",right:r.right||"",top:r.top||"",bottom:r.bottom||""})},e}(),M=function(e){function i(r,n){var i=e.call(this,r,n)||this;return i.reportScroll=function(){i.isScrolling||i.reportScrollStart(),i.trigger("scroll"),i.isMoving=!0,i.requestMovingEnd()},i.reportScrollStart=function(){i.isScrolling||(i.isScrolling=!0,i.trigger("scrollStart",i.isTouching))},i.reportTouchStart=function(){i.isTouching=!0},i.reportTouchEnd=function(){i.isTouching&&(i.isTouching=!1,i.isTouchScrollEnabled&&i.unbindPreventTouchScroll(),i.isMoving||i.reportScrollEnd())},i.isScrolling=!1,i.isTouching=!1,i.isMoving=!1,i.isTouchScrollEnabled=!0,i.requestMovingEnd=t.debounce(i.reportMovingEnd,500),i.canvas=new x,i.el.appendChild(i.canvas.el),i.applyOverflow(),i.bindHandlers(),i}return r(i,e),i.prototype.destroy=function(){e.prototype.destroy.call(this),this.unbindHandlers()},i.prototype.disableTouchScroll=function(){this.isTouchScrollEnabled=!1,this.bindPreventTouchScroll()},i.prototype.enableTouchScroll=function(){this.isTouchScrollEnabled=!0,this.isTouching||this.unbindPreventTouchScroll()},i.prototype.bindPreventTouchScroll=function(){this.preventTouchScrollHandler||this.el.addEventListener("touchmove",this.preventTouchScrollHandler=t.preventDefault)},i.prototype.unbindPreventTouchScroll=function(){this.preventTouchScrollHandler&&(this.el.removeEventListener("touchmove",this.preventTouchScrollHandler),this.preventTouchScrollHandler=null)},i.prototype.bindHandlers=function(){this.el.addEventListener("scroll",this.reportScroll),this.el.addEventListener("touchstart",this.reportTouchStart,{passive:!0}),this.el.addEventListener("touchend",this.reportTouchEnd)},i.prototype.unbindHandlers=function(){this.el.removeEventListener("scroll",this.reportScroll),this.el.removeEventListener("touchstart",this.reportTouchStart,{passive:!0}),this.el.removeEventListener("touchend",this.reportTouchEnd)},i.prototype.reportMovingEnd=function(){this.isMoving=!1,this.isTouching||this.reportScrollEnd()},i.prototype.reportScrollEnd=function(){this.isScrolling&&(this.trigger("scrollEnd"),this.isScrolling=!1)},i.prototype.getScrollLeft=function(){var e=this.el,t=window.getComputedStyle(e).direction,r=e.scrollLeft;if("rtl"===t)switch(n()){case"positive":r=r+e.clientWidth-e.scrollWidth;break;case"reverse":r=-r}return r},i.prototype.setScrollLeft=function(e){var t=this.el,r=window.getComputedStyle(t).direction;if("rtl"===r)switch(n()){case"positive":e=e-t.clientWidth+t.scrollWidth;break;case"reverse":e=-e}t.scrollLeft=e},i.prototype.getScrollFromLeft=function(){var e=this.el,t=window.getComputedStyle(e).direction,r=e.scrollLeft;if("rtl"===t)switch(n()){case"negative":r=r-e.clientWidth+e.scrollWidth;break;case"reverse":r=-r-e.clientWidth+e.scrollWidth}return r},i}(t.ScrollComponent);t.EmitterMixin.mixInto(M);var z,k=function(){function e(e,r,n){this.isHScrollbarsClipped=!1,this.isVScrollbarsClipped=!1,"clipped-scroll"===e&&(e="scroll",this.isHScrollbarsClipped=!0),"clipped-scroll"===r&&(r="scroll",this.isVScrollbarsClipped=!0),this.enhancedScroll=new M(e,r),n.appendChild(this.el=t.createElement("div",{className:"fc-scroller-clip"})),this.el.appendChild(this.enhancedScroll.el)}return e.prototype.destroy=function(){t.removeElement(this.el)},e.prototype.updateSize=function(){var e=this.enhancedScroll,r=e.el,n=t.computeEdges(r),i={marginLeft:0,marginRight:0,marginTop:0,marginBottom:0};this.isVScrollbarsClipped&&(i.marginLeft=-n.scrollbarLeft,i.marginRight=-n.scrollbarRight),this.isHScrollbarsClipped&&(i.marginBottom=-n.scrollbarBottom),t.applyStyle(r,i),!this.isHScrollbarsClipped&&"hidden"!==e.overflowX||!this.isVScrollbarsClipped&&"hidden"!==e.overflowY||n.scrollbarLeft||n.scrollbarRight||n.scrollbarBottom?r.classList.remove("fc-no-scrollbars"):r.classList.add("fc-no-scrollbars")},e.prototype.setHeight=function(e){this.enhancedScroll.setHeight(e)},e.prototype.getScrollbarWidths=function(){var e=this.enhancedScroll.getScrollbarWidths();return this.isVScrollbarsClipped&&(e.left=0,e.right=0),this.isHScrollbarsClipped&&(e.bottom=0),e},e}(),I=function(){function e(e,t){this.axis=e,this.scrollers=t;for(var r=0,n=this.scrollers;rt.asRoughMs(e.slotDuration),a=t.isSingleDay(e.slotDuration),c="",d=e.slotCnt-1;d>=0;d--)c+="";c+="",c+="";for(var h=0,u=o;h";for(var g=0,m=p;g1?' colspan="'+v.colspan+'"':"")+'>
'+v.spanHtml+"
"}c+=""}c+="",this.tableEl.innerHTML=c,this.slatColEls=t.findElements(this.tableEl,"col"),this.innerEls=t.findElements(this.tableEl.querySelector("tr:last-child"),"th .fc-cell-text"),t.findElements(this.tableEl.querySelectorAll("tr:not(:last-child)"),"th .fc-cell-text").forEach(function(e){e.classList.add("fc-sticky")})},n}(t.Component),L=function(e){function n(r,n){var i=e.call(this,r)||this;return n.appendChild(i.el=t.createElement("div",{className:"fc-slats"})),i}return r(n,e),n.prototype.destroy=function(){t.removeElement(this.el),e.prototype.destroy.call(this)},n.prototype.render=function(e){this.renderDates(e.tDateProfile)},n.prototype.renderDates=function(e){for(var r=this,n=r.theme,i=r.view,o=r.dateEnv,l=e.slotDates,s=e.isWeekStarts,a='',c=0;c";a+="",a+="";for(var c=0;c
",this.el.innerHTML=a,this.slatColEls=t.findElements(this.el,"col"),this.slatEls=t.findElements(this.el,"td");for(var c=0;c
'},n.prototype.updateSize=function(){this.outerCoordCache.build(),this.innerCoordCache.build()},n.prototype.positionToHit=function(e){var r=this.outerCoordCache,n=this.props.tDateProfile,i=r.leftToIndex(e);if(null!=i){var o=r.getWidth(i),l=this.isRtl?(r.rights[i]-e)/o:(e-r.lefts[i])/o,s=Math.floor(l*n.snapsPerSlot),a=this.dateEnv.add(n.slotDates[i],t.multiplyDuration(n.snapDuration,s)),c=this.dateEnv.add(a,n.snapDuration);return{dateSpan:{range:{start:a,end:c},allDay:!this.props.tDateProfile.isTimeScale},dayEl:this.slatColEls[i],left:r.lefts[i],right:r.rights[i]}}return null},n}(t.Component),W=18,A=6,B=200;t.config.MAX_TIMELINE_SLOTS=1e3;var O=[{years:1},{months:1},{days:1},{hours:1},{minutes:30},{minutes:15},{minutes:10},{minutes:5},{minutes:1},{seconds:30},{seconds:15},{seconds:10},{seconds:5},{seconds:1},{milliseconds:500},{milliseconds:100},{milliseconds:10},{milliseconds:1}],N=function(){function e(e,t){this.headParent=e,this.bodyParent=t}return e.prototype.render=function(e,r){var n=r?{right:-e}:{left:e};this.headParent.appendChild(this.arrowEl=t.createElement("div",{className:"fc-now-indicator fc-now-indicator-arrow",style:n})),this.bodyParent.appendChild(this.lineEl=t.createElement("div",{className:"fc-now-indicator fc-now-indicator-line",style:n}))},e.prototype.unrender=function(){this.arrowEl&&t.removeElement(this.arrowEl),this.lineEl&&t.removeElement(this.lineEl)},e}(),_=b(),F=/Edge/.test(navigator.userAgent),q="-webkit-sticky"===_,U="fc-sticky",j=function(){function e(e,t,r){var n=this;this.usingRelative=null,this.updateSize=function(){var e=Array.prototype.slice.call(n.scroller.canvas.el.querySelectorAll("."+U)),t=n.queryElGeoms(e),r=n.scroller.el.clientWidth;if(n.usingRelative){var i=n.computeElDestinations(t,r);y(e,t,i)}else S(e,t,r)},this.scroller=e,this.usingRelative=!_||F&&t||(F||q)&&r,this.usingRelative&&e.on("scrollEnd",this.updateSize)}return e.prototype.destroy=function(){this.scroller.off("scrollEnd",this.updateSize)},e.prototype.queryElGeoms=function(e){for(var r=this.scroller.canvas.el.getBoundingClientRect(),n=[],i=0,o=e;ii&&(o=s,i="",l=Math.floor(s/n.slotDates.length))}r.headerScroller.enhancedScroll.canvas.setWidth(i),r.headerScroller.enhancedScroll.canvas.setMinWidth(o),r.bodyScroller.enhancedScroll.canvas.setWidth(i),r.bodyScroller.enhancedScroll.canvas.setMinWidth(o),""!==l&&this.header.slatColEls.slice(0,-1).concat(this.slats.slatColEls.slice(0,-1)).forEach(function(e){e.style.width=l+"px"})},n.prototype.computeDateSnapCoverage=function(e){var r=this,n=r.dateEnv,i=r.tDateProfile,o=n.countDurationsBetween(i.normalizedRange.start,e,i.snapDuration);if(o<0)return 0;if(o>=i.snapDiffToIndex.length)return i.snapCnt;var l=Math.floor(o),s=i.snapDiffToIndex[l];return t.isInt(s)?s+=o-l:s=Math.ceil(s),s},n.prototype.dateToCoord=function(e){var t=this.tDateProfile,r=this.computeDateSnapCoverage(e),n=r/t.snapsPerSlot,i=Math.floor(n);i=Math.min(i,t.slotCnt-1);var o=n-i,l=this.slats,s=l.innerCoordCache,a=l.outerCoordCache;return this.isRtl?a.rights[i]-s.getWidth(i)*o-a.originClientRect.width:a.lefts[i]+s.getWidth(i)*o},n.prototype.rangeToCoords=function(e){return this.isRtl?{right:this.dateToCoord(e.start),left:this.dateToCoord(e.end)}:{left:this.dateToCoord(e.start),right:this.dateToCoord(e.end)}},n.prototype.computeDateScroll=function(e){var r=this.dateEnv,n=this.props.dateProfile,i=0;return n&&(i=this.dateToCoord(r.add(t.startOfDay(n.activeRange.start),t.createDuration(e))),!this.isRtl&&i&&(i+=1)),{left:i}},n.prototype.queryDateScroll=function(){var e=this.layout.bodyScroller.enhancedScroll;return{left:e.getScrollLeft()}},n.prototype.applyDateScroll=function(e){this.layout.bodyScroller.enhancedScroll.setScrollLeft(e.left||0),this.layout.headerScroller.enhancedScroll.setScrollLeft(e.left||0)},n}(t.Component),G=function(e){function n(t,r,n){var i=e.call(this,t)||this;return i.masterContainerEl=r,i.timeAxis=n,i}return r(n,e),n.prototype.renderSegHtml=function(e,r){var n=e.eventRange,i=n.def,o=n.ui,l=o.startEditable||C(i,this.timeAxis.calendar),s=e.isStart&&o.durationEditable&&this.context.options.eventResizableFromStart,a=e.isEnd&&o.durationEditable,c=this.getSegClasses(e,l,s||a,r);c.unshift("fc-timeline-event","fc-h-event");var d=this.getTimeText(n);return'
'+(d?''+t.htmlEscape(d)+"":"")+''+(i.title?t.htmlEscape(i.title):" ")+"
"+(s?'
':"")+(a?'
':"")+"
"},n.prototype.computeDisplayEventTime=function(){return!this.timeAxis.tDateProfile.isTimeScale},n.prototype.computeDisplayEventEnd=function(){return!1},n.prototype.computeEventTimeFormat=function(){return{hour:"numeric",minute:"2-digit",omitZeroMinute:!0,meridiem:"narrow"}},n.prototype.attachSegs=function(e,r){if(!this.el&&this.masterContainerEl&&(this.el=t.createElement("div",{className:"fc-event-container"}),r&&this.el.classList.add("fc-mirror-container"),this.masterContainerEl.appendChild(this.el)),this.el)for(var n=0,i=e;n '},t.prototype.render=function(t){e.prototype.render.call(this,t),this.timeAxis.receiveProps({dateProfile:t.dateProfile}),this.lane.receiveProps(R({},t,{nextDayThreshold:this.nextDayThreshold}))},t.prototype.updateSize=function(e,t,r){this.timeAxis.updateSize(e,t,r),this.lane.updateSize(e)},t.prototype.getNowIndicatorUnit=function(e){return this.timeAxis.getNowIndicatorUnit(e)},t.prototype.renderNowIndicator=function(e){this.timeAxis.renderNowIndicator(e)},t.prototype.unrenderNowIndicator=function(){this.timeAxis.unrenderNowIndicator()},t.prototype.computeDateScroll=function(e){return this.timeAxis.computeDateScroll(e)},t.prototype.applyScroll=function(t,r){e.prototype.applyScroll.call(this,t,r);var n=this.calendar;(r||n.isViewUpdated||n.isDatesUpdated||n.isEventsUpdated)&&this.timeAxis.updateStickyScrollers()},t.prototype.applyDateScroll=function(e){this.timeAxis.applyDateScroll(e)},t.prototype.queryScroll=function(){var e=this.timeAxis.layout.bodyScroller.enhancedScroll;return{top:e.getScrollTop(),left:e.getScrollLeft()}},t.prototype.buildPositionCaches=function(){this.timeAxis.slats.updateSize()},t.prototype.queryHit=function(e,t,r,n){var i=this.timeAxis.slats.positionToHit(e);if(i)return{component:this,dateSpan:i.dateSpan,rect:{left:i.left,right:i.right,top:0,bottom:n},dayEl:i.dayEl,layer:0}},t}(t.View),K=t.createPlugin({defaultView:"timelineDay",views:{timeline:{"class":Y,eventResizableFromStart:!0},timelineDay:{type:"timeline",duration:{days:1}},timelineWeek:{type:"timeline",duration:{weeks:1}},timelineMonth:{type:"timeline",duration:{months:1}},timelineYear:{type:"timeline",duration:{years:1}}}});e.HeaderBodyLayout=P,e.ScrollJoiner=I,e.StickyScroller=j,e.TimeAxis=V,e.TimelineLane=Z,e.TimelineView=Y,e["default"]=K,Object.defineProperty(e,"__esModule",{value:!0})});