{"version":3,"file":"main.js","sources":["../../src/core/util/dom-manip.ts","../../src/core/util/geom.ts","../../src/core/util/scrollbars.ts","../../src/core/util/dom-geom.ts","../../src/core/util/dom-event.ts","../../src/core/datelib/marker.ts","../../src/core/datelib/duration.ts","../../src/core/util/misc.ts","../../node_modules/tslib/tslib.es6.js","../../src/core/structs/recurring-event.ts","../../src/core/util/object.ts","../../src/core/structs/event-store.ts","../../src/core/datelib/date-range.ts","../../src/core/util/array.ts","../../src/core/util/memoize.ts","../../src/core/datelib/formatting-native.ts","../../src/core/datelib/formatting-cmd.ts","../../src/core/datelib/formatting-func.ts","../../src/core/datelib/formatting.ts","../../src/core/api/EventSourceApi.ts","../../src/core/api/EventApi.ts","../../src/core/component/event-rendering.ts","../../src/core/structs/event-mutation.ts","../../src/core/reducers/eventStore.ts","../../src/core/validation.ts","../../src/core/util/html.ts","../../src/core/component/event-ui.ts","../../src/core/structs/event.ts","../../src/core/structs/business-hours.ts","../../src/core/component/memoized-rendering.ts","../../src/core/component/event-splitting.ts","../../src/core/component/date-rendering.ts","../../src/core/util/promise.ts","../../src/core/common/Mixin.ts","../../src/core/common/EmitterMixin.ts","../../src/core/common/PositionCache.ts","../../src/core/common/scroll-controller.ts","../../src/core/common/ScrollComponent.ts","../../src/core/theme/Theme.ts","../../src/core/component/Component.ts","../../src/core/component/DateComponent.ts","../../src/core/plugin-system.ts","../../src/core/event-sources/array-event-source.ts","../../src/core/event-sources/func-event-source.ts","../../src/core/util/requestJson.ts","../../src/core/event-sources/json-feed-event-source.ts","../../src/core/structs/recurring-event-simple.ts","../../src/core/option-change-handlers.ts","../../src/core/options.ts","../../src/core/datelib/locale.ts","../../src/core/OptionsManager.ts","../../src/core/datelib/calendar-system.ts","../../src/core/datelib/parsing.ts","../../src/core/datelib/env.ts","../../src/core/structs/event-source.ts","../../src/core/reducers/eventSources.ts","../../src/core/DateProfileGenerator.ts","../../src/core/reducers/main.ts","../../src/core/structs/date-span.ts","../../src/core/structs/view-def.ts","../../src/core/structs/view-config.ts","../../src/core/structs/view-spec.ts","../../src/core/Toolbar.ts","../../src/core/CalendarComponent.ts","../../src/core/interactions/interaction.ts","../../src/core/interactions/EventClicking.ts","../../src/core/interactions/EventHovering.ts","../../src/core/theme/StandardTheme.ts","../../src/core/Calendar.ts","../../src/core/View.ts","../../src/core/component/renderers/FgEventRenderer.ts","../../src/core/component/renderers/FillRenderer.ts","../../src/core/datelib/timezone.ts","../../src/core/interactions/ElementDragging.ts","../../src/core/formatting-api.ts","../../src/core/structs/drag-meta.ts","../../src/core/common/table-utils.ts","../../src/core/common/DayHeader.ts","../../src/core/common/DaySeries.ts","../../src/core/common/DayTable.ts","../../src/core/common/slicing-utils.ts","../../src/core/main.ts"],"sourcesContent":["\n// Creating\n// ----------------------------------------------------------------------------------------------------------------\n\nconst elementPropHash = { // when props given to createElement should be treated as props, not attributes\n className: true,\n colSpan: true,\n rowSpan: true\n}\n\nconst containerTagHash = {\n ', selector: string): HTMLElement[] {\n let containers = container instanceof HTMLElement ? [ container ] : container\n let allMatches: HTMLElement[] = []\n\n for (let i = 0; i < containers.length; i++) {\n let matches = containers[i].querySelectorAll(selector)\n\n for (let j = 0; j < matches.length; j++) {\n allMatches.push(matches[j] as HTMLElement)\n }\n }\n\n return allMatches\n}\n\n// accepts multiple subject els\n// only queries direct child elements\nexport function findChildren(parent: HTMLElement[] | HTMLElement, selector?: string): HTMLElement[] {\n let parents = parent instanceof HTMLElement ? [ parent ] : parent\n let allMatches = []\n\n for (let i = 0; i < parents.length; i++) {\n let childNodes = parents[i].children // only ever elements\n\n for (let j = 0; j < childNodes.length; j++) {\n let childNode = childNodes[j]\n\n if (!selector || elementMatches(childNode as HTMLElement, selector)) {\n allMatches.push(childNode)\n }\n }\n }\n\n return allMatches\n}\n\n\n// Attributes\n// ----------------------------------------------------------------------------------------------------------------\n\nexport function forceClassName(el: HTMLElement, className: string, bool) { // might not be used anywhere\n if (bool) {\n el.classList.add(className)\n } else {\n el.classList.remove(className)\n }\n}\n\n\n// Style\n// ----------------------------------------------------------------------------------------------------------------\n\nconst PIXEL_PROP_RE = /(top|left|right|bottom|width|height)$/i\n\nexport function applyStyle(el: HTMLElement, props: object) {\n for (let propName in props) {\n applyStyleProp(el, propName, props[propName])\n }\n}\n\nexport function applyStyleProp(el: HTMLElement, name: string, val) {\n if (val == null) {\n el.style[name] = ''\n } else if (typeof val === 'number' && PIXEL_PROP_RE.test(name)) {\n el.style[name] = val + 'px'\n } else {\n el.style[name] = val\n }\n}\n","\nexport interface Point {\n left: number\n top: number\n}\n\nexport interface Rect {\n left: number\n right: number\n top: number\n bottom: number\n}\n\n\nexport function pointInsideRect(point: Point, rect: Rect): boolean {\n return point.left >= rect.left &&\n point.left < rect.right &&\n point.top >= rect.top &&\n point.top < rect.bottom\n}\n\n\n// Returns a new rectangle that is the intersection of the two rectangles. If they don't intersect, returns false\nexport function intersectRects(rect1: Rect, rect2: Rect): Rect | false {\n let res = {\n left: Math.max(rect1.left, rect2.left),\n right: Math.min(rect1.right, rect2.right),\n top: Math.max(rect1.top, rect2.top),\n bottom: Math.min(rect1.bottom, rect2.bottom)\n }\n\n if (res.left < res.right && res.top < res.bottom) {\n return res\n }\n\n return false\n}\n\n\nexport function translateRect(rect: Rect, deltaX: number, deltaY: number): Rect {\n return {\n left: rect.left + deltaX,\n right: rect.right + deltaX,\n top: rect.top + deltaY,\n bottom: rect.bottom + deltaY\n }\n}\n\n\n// Returns a new point that will have been moved to reside within the given rectangle\nexport function constrainPoint(point: Point, rect: Rect): Point {\n return {\n left: Math.min(Math.max(point.left, rect.left), rect.right),\n top: Math.min(Math.max(point.top, rect.top), rect.bottom)\n }\n}\n\n\n// Returns a point that is the center of the given rectangle\nexport function getRectCenter(rect: Rect): Point {\n return {\n left: (rect.left + rect.right) / 2,\n top: (rect.top + rect.bottom) / 2\n }\n}\n\n\n// Subtracts point2's coordinates from point1's coordinates, returning a delta\nexport function diffPoints(point1: Point, point2: Point): Point {\n return {\n left: point1.left - point2.left,\n top: point1.top - point2.top\n }\n}\n","import { createElement, removeElement } from './dom-manip'\n\n\n// Logic for determining if, when the element is right-to-left, the scrollbar appears on the left side\n\nlet isRtlScrollbarOnLeft: boolean | null = null\n\nexport function getIsRtlScrollbarOnLeft() { // responsible for caching the computation\n if (isRtlScrollbarOnLeft === null) {\n isRtlScrollbarOnLeft = computeIsRtlScrollbarOnLeft()\n }\n return isRtlScrollbarOnLeft\n}\n\nfunction computeIsRtlScrollbarOnLeft() { // creates an offscreen test element, then removes it\n let outerEl = createElement('div', {\n style: {\n position: 'absolute',\n top: -1000,\n left: 0,\n border: 0,\n padding: 0,\n overflow: 'scroll',\n direction: 'rtl'\n }\n }, '
')\n\n document.body.appendChild(outerEl)\n let innerEl = outerEl.firstChild as HTMLElement\n let res = innerEl.getBoundingClientRect().left > outerEl.getBoundingClientRect().left\n\n removeElement(outerEl)\n return res\n}\n\n\n// The scrollbar width computations in computeEdges are sometimes flawed when it comes to\n// retina displays, rounding, and IE11. Massage them into a usable value.\nexport function sanitizeScrollbarWidth(width: number) {\n width = Math.max(0, width) // no negatives\n width = Math.round(width)\n return width\n}\n","import { Rect, intersectRects } from './geom'\nimport { sanitizeScrollbarWidth, getIsRtlScrollbarOnLeft } from './scrollbars'\n\nexport interface EdgeInfo {\n borderLeft: number\n borderRight: number\n borderTop: number\n borderBottom: number\n scrollbarLeft: number\n scrollbarRight: number\n scrollbarBottom: number\n paddingLeft?: number\n paddingRight?: number\n paddingTop?: number\n paddingBottom?: number\n}\n\n\nexport function computeEdges(el, getPadding = false): EdgeInfo {\n let computedStyle = window.getComputedStyle(el)\n let borderLeft = parseInt(computedStyle.borderLeftWidth, 10) || 0\n let borderRight = parseInt(computedStyle.borderRightWidth, 10) || 0\n let borderTop = parseInt(computedStyle.borderTopWidth, 10) || 0\n let borderBottom = parseInt(computedStyle.borderBottomWidth, 10) || 0\n let scrollbarLeftRight = sanitizeScrollbarWidth(el.offsetWidth - el.clientWidth - borderLeft - borderRight)\n let scrollbarBottom = sanitizeScrollbarWidth(el.offsetHeight - el.clientHeight - borderTop - borderBottom)\n let res: EdgeInfo = {\n borderLeft,\n borderRight,\n borderTop,\n borderBottom,\n scrollbarBottom,\n scrollbarLeft: 0,\n scrollbarRight: 0\n }\n\n if (getIsRtlScrollbarOnLeft() && computedStyle.direction === 'rtl') { // is the scrollbar on the left side?\n res.scrollbarLeft = scrollbarLeftRight\n } else {\n res.scrollbarRight = scrollbarLeftRight\n }\n\n if (getPadding) {\n res.paddingLeft = parseInt(computedStyle.paddingLeft, 10) || 0\n res.paddingRight = parseInt(computedStyle.paddingRight, 10) || 0\n res.paddingTop = parseInt(computedStyle.paddingTop, 10) || 0\n res.paddingBottom = parseInt(computedStyle.paddingBottom, 10) || 0\n }\n\n return res\n}\n\n\nexport function computeInnerRect(el, goWithinPadding = false) {\n let outerRect = computeRect(el)\n let edges = computeEdges(el, goWithinPadding)\n let res = {\n left: outerRect.left + edges.borderLeft + edges.scrollbarLeft,\n right: outerRect.right - edges.borderRight - edges.scrollbarRight,\n top: outerRect.top + edges.borderTop,\n bottom: outerRect.bottom - edges.borderBottom - edges.scrollbarBottom\n }\n\n if (goWithinPadding) {\n res.left += edges.paddingLeft\n res.right -= edges.paddingRight\n res.top += edges.paddingTop\n res.bottom -= edges.paddingBottom\n }\n\n return res\n}\n\n\nexport function computeRect(el): Rect {\n let rect = el.getBoundingClientRect()\n\n return {\n left: rect.left + window.pageXOffset,\n top: rect.top + window.pageYOffset,\n right: rect.right + window.pageXOffset,\n bottom: rect.bottom + window.pageYOffset\n }\n}\n\n\nfunction computeViewportRect(): Rect {\n return {\n left: window.pageXOffset,\n right: window.pageXOffset + document.documentElement.clientWidth,\n top: window.pageYOffset,\n bottom: window.pageYOffset + document.documentElement.clientHeight\n }\n}\n\n\nexport function computeHeightAndMargins(el: HTMLElement) {\n let computed = window.getComputedStyle(el)\n return el.getBoundingClientRect().height +\n parseInt(computed.marginTop, 10) +\n parseInt(computed.marginBottom, 10)\n}\n\n\n// does not return window\nexport function getClippingParents(el: HTMLElement): HTMLElement[] {\n let parents: HTMLElement[] = []\n\n while (el instanceof HTMLElement) { // will stop when gets to document or null\n let computedStyle = window.getComputedStyle(el)\n\n if (computedStyle.position === 'fixed') {\n break\n }\n\n if ((/(auto|scroll)/).test(computedStyle.overflow + computedStyle.overflowY + computedStyle.overflowX)) {\n parents.push(el)\n }\n\n el = el.parentNode as HTMLElement\n }\n\n return parents\n}\n\n\nexport function computeClippingRect(el: HTMLElement): Rect {\n return getClippingParents(el)\n .map(function(el) {\n return computeInnerRect(el)\n })\n .concat(computeViewportRect())\n .reduce(function(rect0, rect1) {\n return intersectRects(rect0, rect1) || rect1 // should always intersect\n })\n}\n","import { elementClosest } from './dom-manip'\n\n\n// Stops a mouse/touch event from doing it's native browser action\nexport function preventDefault(ev) {\n ev.preventDefault()\n}\n\n\n// Event Delegation\n// ----------------------------------------------------------------------------------------------------------------\n\nexport function listenBySelector(\n container: HTMLElement,\n eventType: string,\n selector: string,\n handler: (ev: Event, matchedTarget: HTMLElement) => void\n) {\n function realHandler(ev: Event) {\n let matchedChild = elementClosest(ev.target as HTMLElement, selector)\n if (matchedChild) {\n handler.call(matchedChild, ev, matchedChild)\n }\n }\n\n container.addEventListener(eventType, realHandler)\n\n return function() {\n container.removeEventListener(eventType, realHandler)\n }\n}\n\nexport function listenToHoverBySelector(\n container: HTMLElement,\n selector: string,\n onMouseEnter: (ev: Event, matchedTarget: HTMLElement) => void,\n onMouseLeave: (ev: Event, matchedTarget: HTMLElement) => void\n) {\n let currentMatchedChild\n\n return listenBySelector(container, 'mouseover', selector, function(ev, matchedChild) {\n if (matchedChild !== currentMatchedChild) {\n currentMatchedChild = matchedChild\n onMouseEnter(ev, matchedChild)\n\n let realOnMouseLeave = (ev) => {\n currentMatchedChild = null\n onMouseLeave(ev, matchedChild)\n matchedChild.removeEventListener('mouseleave', realOnMouseLeave)\n }\n\n // listen to the next mouseleave, and then unattach\n matchedChild.addEventListener('mouseleave', realOnMouseLeave)\n }\n })\n}\n\n\n// Animation\n// ----------------------------------------------------------------------------------------------------------------\n\nconst transitionEventNames = [\n 'webkitTransitionEnd',\n 'otransitionend',\n 'oTransitionEnd',\n 'msTransitionEnd',\n 'transitionend'\n]\n\n// triggered only when the next single subsequent transition finishes\nexport function whenTransitionDone(el: HTMLElement, callback: (ev: Event) => void) {\n let realCallback = function(ev) {\n callback(ev)\n transitionEventNames.forEach(function(eventName) {\n el.removeEventListener(eventName, realCallback)\n })\n }\n\n transitionEventNames.forEach(function(eventName) {\n el.addEventListener(eventName, realCallback) // cross-browser way to determine when the transition finishes\n })\n}\n","import { Duration } from './duration'\n\nexport type DateMarker = Date\n\nexport const DAY_IDS = [ 'sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat' ]\n\n\n// Adding\n\nexport function addWeeks(m: DateMarker, n: number) {\n let a = dateToUtcArray(m)\n a[2] += n * 7\n return arrayToUtcDate(a)\n}\n\nexport function addDays(m: DateMarker, n: number) {\n let a = dateToUtcArray(m)\n a[2] += n\n return arrayToUtcDate(a)\n}\n\nexport function addMs(m: DateMarker, n: number) {\n let a = dateToUtcArray(m)\n a[6] += n\n return arrayToUtcDate(a)\n}\n\n\n// Diffing (all return floats)\n\nexport function diffWeeks(m0, m1) {\n return diffDays(m0, m1) / 7\n}\n\nexport function diffDays(m0, m1) {\n return (m1.valueOf() - m0.valueOf()) / (1000 * 60 * 60 * 24)\n}\n\nexport function diffHours(m0, m1) {\n return (m1.valueOf() - m0.valueOf()) / (1000 * 60 * 60)\n}\n\nexport function diffMinutes(m0, m1) {\n return (m1.valueOf() - m0.valueOf()) / (1000 * 60)\n}\n\nexport function diffSeconds(m0, m1) {\n return (m1.valueOf() - m0.valueOf()) / 1000\n}\n\nexport function diffDayAndTime(m0: DateMarker, m1: DateMarker): Duration {\n let m0day = startOfDay(m0)\n let m1day = startOfDay(m1)\n\n return {\n years: 0,\n months: 0,\n days: Math.round(diffDays(m0day, m1day)),\n milliseconds: (m1.valueOf() - m1day.valueOf()) - (m0.valueOf() - m0day.valueOf())\n }\n}\n\n\n// Diffing Whole Units\n\nexport function diffWholeWeeks(m0: DateMarker, m1: DateMarker): number {\n let d = diffWholeDays(m0, m1)\n\n if (d !== null && d % 7 === 0) {\n return d / 7\n }\n\n return null\n}\n\nexport function diffWholeDays(m0: DateMarker, m1: DateMarker): number {\n if (timeAsMs(m0) === timeAsMs(m1)) {\n return Math.round(diffDays(m0, m1))\n }\n return null\n}\n\n\n// Start-Of\n\nexport function startOfDay(m: DateMarker): DateMarker {\n return arrayToUtcDate([\n m.getUTCFullYear(),\n m.getUTCMonth(),\n m.getUTCDate()\n ])\n}\n\nexport function startOfHour(m: DateMarker) {\n return arrayToUtcDate([\n m.getUTCFullYear(),\n m.getUTCMonth(),\n m.getUTCDate(),\n m.getUTCHours()\n ])\n}\n\nexport function startOfMinute(m: DateMarker) {\n return arrayToUtcDate([\n m.getUTCFullYear(),\n m.getUTCMonth(),\n m.getUTCDate(),\n m.getUTCHours(),\n m.getUTCMinutes()\n ])\n}\n\nexport function startOfSecond(m: DateMarker) {\n return arrayToUtcDate([\n m.getUTCFullYear(),\n m.getUTCMonth(),\n m.getUTCDate(),\n m.getUTCHours(),\n m.getUTCMinutes(),\n m.getUTCSeconds()\n ])\n}\n\n\n// Week Computation\n\nexport function weekOfYear(marker, dow, doy) {\n let y = marker.getUTCFullYear()\n let w = weekOfGivenYear(marker, y, dow, doy)\n\n if (w < 1) {\n return weekOfGivenYear(marker, y - 1, dow, doy)\n }\n\n let nextW = weekOfGivenYear(marker, y + 1, dow, doy)\n if (nextW >= 1) {\n return Math.min(w, nextW)\n }\n\n return w\n}\n\nfunction weekOfGivenYear(marker, year, dow, doy) {\n let firstWeekStart = arrayToUtcDate([ year, 0, 1 + firstWeekOffset(year, dow, doy) ])\n let dayStart = startOfDay(marker)\n let days = Math.round(diffDays(firstWeekStart, dayStart))\n\n return Math.floor(days / 7) + 1 // zero-indexed\n}\n\n// start-of-first-week - start-of-year\nfunction firstWeekOffset(year, dow, doy) {\n\n // first-week day -- which january is always in the first week (4 for iso, 1 for other)\n let fwd = 7 + dow - doy\n\n // first-week day local weekday -- which local weekday is fwd\n let fwdlw = (7 + arrayToUtcDate([ year, 0, fwd ]).getUTCDay() - dow) % 7\n\n return -fwdlw + fwd - 1\n}\n\n\n// Array Conversion\n\nexport function dateToLocalArray(date) {\n return [\n date.getFullYear(),\n date.getMonth(),\n date.getDate(),\n date.getHours(),\n date.getMinutes(),\n date.getSeconds(),\n date.getMilliseconds()\n ]\n}\n\nexport function arrayToLocalDate(a) {\n return new Date(\n a[0],\n a[1] || 0,\n a[2] == null ? 1 : a[2], // day of month\n a[3] || 0,\n a[4] || 0,\n a[5] || 0\n )\n}\n\nexport function dateToUtcArray(date) {\n return [\n date.getUTCFullYear(),\n date.getUTCMonth(),\n date.getUTCDate(),\n date.getUTCHours(),\n date.getUTCMinutes(),\n date.getUTCSeconds(),\n date.getUTCMilliseconds()\n ]\n}\n\nexport function arrayToUtcDate(a) {\n\n // according to web standards (and Safari), a month index is required.\n // massage if only given a year.\n if (a.length === 1) {\n a = a.concat([ 0 ])\n }\n\n return new Date(Date.UTC.apply(Date, a))\n}\n\n\n// Other Utils\n\nexport function isValidDate(m: DateMarker) {\n return !isNaN(m.valueOf())\n}\n\nexport function timeAsMs(m: DateMarker) {\n return m.getUTCHours() * 1000 * 60 * 60 +\n m.getUTCMinutes() * 1000 * 60 +\n m.getUTCSeconds() * 1000 +\n m.getUTCMilliseconds()\n}\n","import { isInt } from '../util/misc'\n\nexport type DurationInput = DurationObjectInput | string | number\n\nexport interface DurationObjectInput {\n years?: number\n year?: number\n months?: number\n month?: number\n weeks?: number\n week?: number\n days?: number\n day?: number\n hours?: number\n hour?: number\n minutes?: number\n minute?: number\n seconds?: number\n second?: number\n milliseconds?: number\n millisecond?: number\n ms?: number\n}\n\nexport interface Duration {\n years: number\n months: number\n days: number\n milliseconds: number\n}\n\nconst INTERNAL_UNITS = [ 'years', 'months', 'days', 'milliseconds' ]\nconst PARSE_RE = /^(-?)(?:(\\d+)\\.)?(\\d+):(\\d\\d)(?::(\\d\\d)(?:\\.(\\d\\d\\d))?)?/\n\n\n// Parsing and Creation\n\nexport function createDuration(input: DurationInput, unit?: string): Duration | null {\n if (typeof input === 'string') {\n return parseString(input)\n } else if (typeof input === 'object' && input) { // non-null object\n return normalizeObject(input)\n } else if (typeof input === 'number') {\n return normalizeObject({ [unit || 'milliseconds']: input })\n } else {\n return null\n }\n}\n\nfunction parseString(s: string): Duration {\n let m = PARSE_RE.exec(s)\n if (m) {\n let sign = m[1] ? -1 : 1\n return {\n years: 0,\n months: 0,\n days: sign * (m[2] ? parseInt(m[2], 10) : 0),\n milliseconds: sign * (\n (m[3] ? parseInt(m[3], 10) : 0) * 60 * 60 * 1000 + // hours\n (m[4] ? parseInt(m[4], 10) : 0) * 60 * 1000 + // minutes\n (m[5] ? parseInt(m[5], 10) : 0) * 1000 + // seconds\n (m[6] ? parseInt(m[6], 10) : 0) // ms\n )\n }\n }\n return null\n}\n\nfunction normalizeObject(obj: DurationObjectInput): Duration {\n return {\n years: obj.years || obj.year || 0,\n months: obj.months || obj.month || 0,\n days:\n (obj.days || obj.day || 0) +\n getWeeksFromInput(obj) * 7,\n milliseconds:\n (obj.hours || obj.hour || 0) * 60 * 60 * 1000 + // hours\n (obj.minutes || obj.minute || 0) * 60 * 1000 + // minutes\n (obj.seconds || obj.second || 0) * 1000 + // seconds\n (obj.milliseconds || obj.millisecond || obj.ms || 0) // ms\n }\n}\n\nexport function getWeeksFromInput(obj: DurationObjectInput) {\n return obj.weeks || obj.week || 0\n}\n\n\n// Equality\n\nexport function durationsEqual(d0: Duration, d1: Duration): boolean {\n return d0.years === d1.years &&\n d0.months === d1.months &&\n d0.days === d1.days &&\n d0.milliseconds === d1.milliseconds\n}\n\nexport function isSingleDay(dur: Duration) {\n return dur.years === 0 && dur.months === 0 && dur.days === 1 && dur.milliseconds === 0\n}\n\n\n// Simple Math\n\nexport function addDurations(d0: Duration, d1: Duration) {\n return {\n years: d0.years + d1.years,\n months: d0.months + d1.months,\n days: d0.days + d1.days,\n milliseconds: d0.milliseconds + d1.milliseconds\n }\n}\n\nexport function subtractDurations(d1: Duration, d0: Duration): Duration {\n return {\n years: d1.years - d0.years,\n months: d1.months - d0.months,\n days: d1.days - d0.days,\n milliseconds: d1.milliseconds - d0.milliseconds\n }\n}\n\nexport function multiplyDuration(d: Duration, n: number) {\n return {\n years: d.years * n,\n months: d.months * n,\n days: d.days * n,\n milliseconds: d.milliseconds * n\n }\n}\n\n\n// Conversions\n// \"Rough\" because they are based on average-case Gregorian months/years\n\nexport function asRoughYears(dur: Duration) {\n return asRoughDays(dur) / 365\n}\n\nexport function asRoughMonths(dur: Duration) {\n return asRoughDays(dur) / 30\n}\n\nexport function asRoughDays(dur: Duration) {\n return asRoughMs(dur) / 864e5\n}\n\nexport function asRoughHours(dur: Duration) {\n return asRoughMs(dur) / (1000 * 60 * 60)\n}\n\nexport function asRoughMinutes(dur: Duration) {\n return asRoughMs(dur) / (1000 * 60)\n}\n\nexport function asRoughSeconds(dur: Duration) {\n return asRoughMs(dur) / 1000\n}\n\nexport function asRoughMs(dur: Duration) {\n return dur.years * (365 * 864e5) +\n dur.months * (30 * 864e5) +\n dur.days * 864e5 +\n dur.milliseconds\n}\n\n\n// Advanced Math\n\nexport function wholeDivideDurations(numerator: Duration, denominator: Duration): number {\n let res = null\n\n for (let i = 0; i < INTERNAL_UNITS.length; i++) {\n let unit = INTERNAL_UNITS[i]\n\n if (denominator[unit]) {\n let localRes = numerator[unit] / denominator[unit]\n\n if (!isInt(localRes) || (res !== null && res !== localRes)) {\n return null\n }\n\n res = localRes\n\n } else if (numerator[unit]) {\n // needs to divide by something but can't!\n return null\n }\n }\n\n return res\n}\n\nexport function greatestDurationDenominator(dur: Duration, dontReturnWeeks?: boolean) {\n let ms = dur.milliseconds\n if (ms) {\n if (ms % 1000 !== 0) {\n return { unit: 'millisecond', value: ms }\n }\n if (ms % (1000 * 60) !== 0) {\n return { unit: 'second', value: ms / 1000 }\n }\n if (ms % (1000 * 60 * 60) !== 0) {\n return { unit: 'minute', value: ms / (1000 * 60) }\n }\n if (ms) {\n return { unit: 'hour', value: ms / (1000 * 60 * 60) }\n }\n }\n if (dur.days) {\n if (!dontReturnWeeks && dur.days % 7 === 0) {\n return { unit: 'week', value: dur.days / 7 }\n }\n return { unit: 'day', value: dur.days }\n }\n if (dur.months) {\n return { unit: 'month', value: dur.months }\n }\n if (dur.years) {\n return { unit: 'year', value: dur.years }\n }\n return { unit: 'millisecond', value: 0 }\n}\n","import { applyStyle } from './dom-manip'\nimport { computeHeightAndMargins } from './dom-geom'\nimport { preventDefault } from './dom-event'\nimport { DateMarker, startOfDay, addDays, diffDays, diffDayAndTime } from '../datelib/marker'\nimport { Duration, asRoughMs, createDuration } from '../datelib/duration'\nimport { DateEnv } from '../datelib/env'\nimport { DateRange, OpenDateRange } from '../datelib/date-range'\n\n\n/* FullCalendar-specific DOM Utilities\n----------------------------------------------------------------------------------------------------------------------*/\n\n\n// Given the scrollbar widths of some other container, create borders/margins on rowEls in order to match the left\n// and right space that was offset by the scrollbars. A 1-pixel border first, then margin beyond that.\nexport function compensateScroll(rowEl: HTMLElement, scrollbarWidths) {\n if (scrollbarWidths.left) {\n applyStyle(rowEl, {\n borderLeftWidth: 1,\n marginLeft: scrollbarWidths.left - 1\n })\n }\n if (scrollbarWidths.right) {\n applyStyle(rowEl, {\n borderRightWidth: 1,\n marginRight: scrollbarWidths.right - 1\n })\n }\n}\n\n\n// Undoes compensateScroll and restores all borders/margins\nexport function uncompensateScroll(rowEl: HTMLElement) {\n applyStyle(rowEl, {\n marginLeft: '',\n marginRight: '',\n borderLeftWidth: '',\n borderRightWidth: ''\n })\n}\n\n\n// Make the mouse cursor express that an event is not allowed in the current area\nexport function disableCursor() {\n document.body.classList.add('fc-not-allowed')\n}\n\n\n// Returns the mouse cursor to its original look\nexport function enableCursor() {\n document.body.classList.remove('fc-not-allowed')\n}\n\n\n// Given a total available height to fill, have `els` (essentially child rows) expand to accomodate.\n// By default, all elements that are shorter than the recommended height are expanded uniformly, not considering\n// any other els that are already too tall. if `shouldRedistribute` is on, it considers these tall rows and\n// reduces the available height.\nexport function distributeHeight(els: HTMLElement[], availableHeight, shouldRedistribute) {\n\n // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n\n let minOffset1 = Math.floor(availableHeight / els.length) // for non-last element\n let minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)) // for last element *FLOORING NOTE*\n let flexEls = [] // elements that are allowed to expand. array of DOM nodes\n let flexOffsets = [] // amount of vertical space it takes up\n let flexHeights = [] // actual css height\n let usedHeight = 0\n\n undistributeHeight(els) // give all elements their natural height\n\n // find elements that are below the recommended height (expandable).\n // important to query for heights in a single first pass (to avoid reflow oscillation).\n els.forEach(function(el, i) {\n let minOffset = i === els.length - 1 ? minOffset2 : minOffset1\n let naturalOffset = computeHeightAndMargins(el)\n\n if (naturalOffset < minOffset) {\n flexEls.push(el)\n flexOffsets.push(naturalOffset)\n flexHeights.push(el.offsetHeight)\n } else {\n // this element stretches past recommended height (non-expandable). mark the space as occupied.\n usedHeight += naturalOffset\n }\n })\n\n // readjust the recommended height to only consider the height available to non-maxed-out rows.\n if (shouldRedistribute) {\n availableHeight -= usedHeight\n minOffset1 = Math.floor(availableHeight / flexEls.length)\n minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)) // *FLOORING NOTE*\n }\n\n // assign heights to all expandable elements\n flexEls.forEach(function(el, i) {\n let minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1\n let naturalOffset = flexOffsets[i]\n let naturalHeight = flexHeights[i]\n let newHeight = minOffset - (naturalOffset - naturalHeight) // subtract the margin/padding\n\n if (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n el.style.height = newHeight + 'px'\n }\n })\n}\n\n\n// Undoes distrubuteHeight, restoring all els to their natural height\nexport function undistributeHeight(els: HTMLElement[]) {\n els.forEach(function(el) {\n el.style.height = ''\n })\n}\n\n\n// Given `els`, a set of cells, find the cell with the largest natural width and set the widths of all the\n// cells to be that width.\n// PREREQUISITE: if you want a cell to take up width, it needs to have a single inner element w/ display:inline\nexport function matchCellWidths(els: HTMLElement[]) {\n let maxInnerWidth = 0\n\n els.forEach(function(el) {\n let innerEl = el.firstChild // hopefully an element\n if (innerEl instanceof HTMLElement) {\n let innerWidth = innerEl.offsetWidth\n if (innerWidth > maxInnerWidth) {\n maxInnerWidth = innerWidth\n }\n }\n })\n\n maxInnerWidth++ // sometimes not accurate of width the text needs to stay on one line. insurance\n\n els.forEach(function(el) {\n el.style.width = maxInnerWidth + 'px'\n })\n\n return maxInnerWidth\n}\n\n\n// Given one element that resides inside another,\n// Subtracts the height of the inner element from the outer element.\nexport function subtractInnerElHeight(outerEl: HTMLElement, innerEl: HTMLElement) {\n\n // effin' IE8/9/10/11 sometimes returns 0 for dimensions. this weird hack was the only thing that worked\n let reflowStyleProps = {\n position: 'relative', // cause a reflow, which will force fresh dimension recalculation\n left: -1 // ensure reflow in case the el was already relative. negative is less likely to cause new scroll\n }\n applyStyle(outerEl, reflowStyleProps)\n applyStyle(innerEl, reflowStyleProps)\n\n let diff = outerEl.offsetHeight - innerEl.offsetHeight // grab the dimensions\n\n // undo hack\n let resetStyleProps = { position: '', left: '' }\n applyStyle(outerEl, resetStyleProps)\n applyStyle(innerEl, resetStyleProps)\n\n return diff\n}\n\n\n/* Selection\n----------------------------------------------------------------------------------------------------------------------*/\n\n\nexport function preventSelection(el: HTMLElement) {\n el.classList.add('fc-unselectable')\n el.addEventListener('selectstart', preventDefault)\n}\n\n\nexport function allowSelection(el: HTMLElement) {\n el.classList.remove('fc-unselectable')\n el.removeEventListener('selectstart', preventDefault)\n}\n\n\n/* Context Menu\n----------------------------------------------------------------------------------------------------------------------*/\n\n\nexport function preventContextMenu(el: HTMLElement) {\n el.addEventListener('contextmenu', preventDefault)\n}\n\n\nexport function allowContextMenu(el: HTMLElement) {\n el.removeEventListener('contextmenu', preventDefault)\n}\n\n\n/* Object Ordering by Field\n----------------------------------------------------------------------------------------------------------------------*/\n\nexport function parseFieldSpecs(input) {\n let specs = []\n let tokens = []\n let i\n let token\n\n if (typeof input === 'string') {\n tokens = input.split(/\\s*,\\s*/)\n } else if (typeof input === 'function') {\n tokens = [ input ]\n } else if (Array.isArray(input)) {\n tokens = input\n }\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i]\n\n if (typeof token === 'string') {\n specs.push(\n token.charAt(0) === '-' ?\n { field: token.substring(1), order: -1 } :\n { field: token, order: 1 }\n )\n } else if (typeof token === 'function') {\n specs.push({ func: token })\n }\n }\n\n return specs\n}\n\n\nexport function compareByFieldSpecs(obj0, obj1, fieldSpecs) {\n let i\n let cmp\n\n for (i = 0; i < fieldSpecs.length; i++) {\n cmp = compareByFieldSpec(obj0, obj1, fieldSpecs[i])\n if (cmp) {\n return cmp\n }\n }\n\n return 0\n}\n\n\nexport function compareByFieldSpec(obj0, obj1, fieldSpec) {\n if (fieldSpec.func) {\n return fieldSpec.func(obj0, obj1)\n }\n\n return flexibleCompare(obj0[fieldSpec.field], obj1[fieldSpec.field])\n * (fieldSpec.order || 1)\n}\n\n\nexport function flexibleCompare(a, b) {\n if (!a && !b) {\n return 0\n }\n if (b == null) {\n return -1\n }\n if (a == null) {\n return 1\n }\n if (typeof a === 'string' || typeof b === 'string') {\n return String(a).localeCompare(String(b))\n }\n return a - b\n}\n\n\n/* String Utilities\n----------------------------------------------------------------------------------------------------------------------*/\n\n\nexport function capitaliseFirstLetter(str) {\n return str.charAt(0).toUpperCase() + str.slice(1)\n}\n\n\nexport function padStart(val, len) { // doesn't work with total length more than 3\n let s = String(val)\n return '000'.substr(0, len - s.length) + s\n}\n\n\n/* Number Utilities\n----------------------------------------------------------------------------------------------------------------------*/\n\n\nexport function compareNumbers(a, b) { // for .sort()\n return a - b\n}\n\n\nexport function isInt(n) {\n return n % 1 === 0\n}\n\n\n/* Weird Utilities\n----------------------------------------------------------------------------------------------------------------------*/\n\n\nexport function applyAll(functions, thisObj, args) {\n if (typeof functions === 'function') { // supplied a single function\n functions = [ functions ]\n }\n if (functions) {\n let i\n let ret\n for (i = 0; i < functions.length; i++) {\n ret = functions[i].apply(thisObj, args) || ret\n }\n return ret\n }\n}\n\n\nexport function firstDefined(...args) {\n for (let i = 0; i < args.length; i++) {\n if (args[i] !== undefined) {\n return args[i]\n }\n }\n}\n\n\n// Returns a function, that, as long as it continues to be invoked, will not\n// be triggered. The function will be called after it stops being called for\n// N milliseconds. If `immediate` is passed, trigger the function on the\n// leading edge, instead of the trailing.\n// https://github.com/jashkenas/underscore/blob/1.6.0/underscore.js#L714\nexport function debounce(func, wait) {\n let timeout\n let args\n let context\n let timestamp\n let result\n\n let later = function() {\n let last = new Date().valueOf() - timestamp\n if (last < wait) {\n timeout = setTimeout(later, wait - last)\n } else {\n timeout = null\n result = func.apply(context, args)\n context = args = null\n }\n }\n\n return function() {\n context = this\n args = arguments\n timestamp = new Date().valueOf()\n if (!timeout) {\n timeout = setTimeout(later, wait)\n }\n return result\n }\n}\n\n\n/* Object Parsing\n----------------------------------------------------------------------------------------------------------------------*/\n\n\nexport type GenericHash = { [key: string]: any }\n\n// Number and Boolean are only types that defaults or not computed for\n// TODO: write more comments\nexport function refineProps(rawProps: GenericHash, processors: GenericHash, defaults: GenericHash = {}, leftoverProps?: GenericHash): GenericHash {\n let refined: GenericHash = {}\n\n for (let key in processors) {\n let processor = processors[key]\n\n if (rawProps[key] !== undefined) {\n // found\n if (processor === Function) {\n refined[key] = typeof rawProps[key] === 'function' ? rawProps[key] : null\n } else if (processor) { // a refining function?\n refined[key] = processor(rawProps[key])\n } else {\n refined[key] = rawProps[key]\n }\n } else if (defaults[key] !== undefined) {\n // there's an explicit default\n refined[key] = defaults[key]\n } else {\n // must compute a default\n if (processor === String) {\n refined[key] = '' // empty string is default for String\n } else if (!processor || processor === Number || processor === Boolean || processor === Function) {\n refined[key] = null // assign null for other non-custom processor funcs\n } else {\n refined[key] = processor(null) // run the custom processor func\n }\n }\n }\n\n if (leftoverProps) {\n for (let key in rawProps) {\n if (processors[key] === undefined) {\n leftoverProps[key] = rawProps[key]\n }\n }\n }\n\n return refined\n}\n\n\n/* Date stuff that doesn't belong in datelib core\n----------------------------------------------------------------------------------------------------------------------*/\n\n\n// given a timed range, computes an all-day range that has the same exact duration,\n// but whose start time is aligned with the start of the day.\nexport function computeAlignedDayRange(timedRange: DateRange): DateRange {\n let dayCnt = Math.floor(diffDays(timedRange.start, timedRange.end)) || 1\n let start = startOfDay(timedRange.start)\n let end = addDays(start, dayCnt)\n return { start, end }\n}\n\n\n// given a timed range, computes an all-day range based on how for the end date bleeds into the next day\n// TODO: give nextDayThreshold a default arg\nexport function computeVisibleDayRange(timedRange: OpenDateRange, nextDayThreshold: Duration = createDuration(0)): OpenDateRange {\n let startDay: DateMarker = null\n let endDay: DateMarker = null\n\n if (timedRange.end) {\n endDay = startOfDay(timedRange.end)\n\n let endTimeMS: number = timedRange.end.valueOf() - endDay.valueOf() // # of milliseconds into `endDay`\n\n // If the end time is actually inclusively part of the next day and is equal to or\n // beyond the next day threshold, adjust the end to be the exclusive end of `endDay`.\n // Otherwise, leaving it as inclusive will cause it to exclude `endDay`.\n if (endTimeMS && endTimeMS >= asRoughMs(nextDayThreshold)) {\n endDay = addDays(endDay, 1)\n }\n }\n\n if (timedRange.start) {\n startDay = startOfDay(timedRange.start) // the beginning of the day the range starts\n\n // If end is within `startDay` but not past nextDayThreshold, assign the default duration of one day.\n if (endDay && endDay <= startDay) {\n endDay = addDays(startDay, 1)\n }\n }\n\n return { start: startDay, end: endDay }\n}\n\n\n// spans from one day into another?\nexport function isMultiDayRange(range: DateRange) {\n let visibleRange = computeVisibleDayRange(range)\n\n return diffDays(visibleRange.start, visibleRange.end) > 1\n}\n\n\nexport function diffDates(date0: DateMarker, date1: DateMarker, dateEnv: DateEnv, largeUnit?: string) {\n if (largeUnit === 'year') {\n return createDuration(dateEnv.diffWholeYears(date0, date1), 'year')!\n } else if (largeUnit === 'month') {\n return createDuration(dateEnv.diffWholeMonths(date0, date1), 'month')!\n } else {\n return diffDayAndTime(date0, date1) // returns a duration\n }\n}\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","import { EventInput, EventDef } from './event'\nimport { DateRange } from '../datelib/date-range'\nimport { DateEnv } from '../datelib/env'\nimport { Duration } from '../datelib/duration'\nimport { DateMarker, startOfDay } from '../datelib/marker'\nimport { __assign } from 'tslib'\n\n/*\nThe plugin system for defining how a recurring event is expanded into individual instances.\n*/\n\nexport interface ParsedRecurring {\n typeData: any\n allDayGuess: boolean | null\n duration: Duration | null // signals hasEnd\n}\n\nexport interface RecurringType {\n parse: (rawEvent: EventInput, leftoverProps: any, dateEnv: DateEnv) => ParsedRecurring | null\n expand: (typeData: any, framingRange: DateRange, dateEnv: DateEnv) => DateMarker[]\n}\n\n\nexport function parseRecurring(\n eventInput: EventInput,\n allDayDefault: boolean | null,\n dateEnv: DateEnv,\n recurringTypes: RecurringType[],\n leftovers: any\n) {\n for (let i = 0; i < recurringTypes.length; i++) {\n let localLeftovers = {} as any\n let parsed = recurringTypes[i].parse(eventInput, localLeftovers, dateEnv) as ParsedRecurring\n\n if (parsed) {\n\n let allDay = localLeftovers.allDay\n delete localLeftovers.allDay // remove from leftovers\n if (allDay == null) {\n allDay = allDayDefault\n if (allDay == null) {\n allDay = parsed.allDayGuess\n if (allDay == null) {\n allDay = false\n }\n }\n }\n\n __assign(leftovers, localLeftovers)\n\n return {\n allDay,\n duration: parsed.duration,\n typeData: parsed.typeData,\n typeId: i\n }\n\n }\n }\n\n return null\n}\n\n\n/*\nEvent MUST have a recurringDef\n*/\nexport function expandRecurringRanges(\n eventDef: EventDef,\n duration: Duration,\n framingRange: DateRange,\n dateEnv: DateEnv,\n recurringTypes: RecurringType[]\n): DateMarker[] {\n let typeDef = recurringTypes[eventDef.recurringDef.typeId]\n let markers = typeDef.expand(\n eventDef.recurringDef.typeData,\n {\n start: dateEnv.subtract(framingRange.start, duration), // for when event starts before framing range and goes into\n end: framingRange.end\n },\n dateEnv\n )\n\n // the recurrence plugins don't guarantee that all-day events are start-of-day, so we have to\n if (eventDef.allDay) {\n markers = markers.map(startOfDay)\n }\n\n return markers\n}\n","\nconst hasOwnProperty = Object.prototype.hasOwnProperty\n\n// Merges an array of objects into a single object.\n// The second argument allows for an array of property names who's object values will be merged together.\nexport function mergeProps(propObjs, complexProps?): any {\n let dest = {}\n let i\n let name\n let complexObjs\n let j\n let val\n let props\n\n if (complexProps) {\n for (i = 0; i < complexProps.length; i++) {\n name = complexProps[i]\n complexObjs = []\n\n // collect the trailing object values, stopping when a non-object is discovered\n for (j = propObjs.length - 1; j >= 0; j--) {\n val = propObjs[j][name]\n\n if (typeof val === 'object' && val) { // non-null object\n complexObjs.unshift(val)\n } else if (val !== undefined) {\n dest[name] = val // if there were no objects, this value will be used\n break\n }\n }\n\n // if the trailing values were objects, use the merged value\n if (complexObjs.length) {\n dest[name] = mergeProps(complexObjs)\n }\n }\n }\n\n // copy values into the destination, going from last to first\n for (i = propObjs.length - 1; i >= 0; i--) {\n props = propObjs[i]\n\n for (name in props) {\n if (!(name in dest)) { // if already assigned by previous props or complex props, don't reassign\n dest[name] = props[name]\n }\n }\n }\n\n return dest\n}\n\n\nexport function filterHash(hash, func) {\n let filtered = {}\n\n for (let key in hash) {\n if (func(hash[key], key)) {\n filtered[key] = hash[key]\n }\n }\n\n return filtered\n}\n\n\nexport function mapHash(\n hash: { [key: string]: InputItem },\n func: (input: InputItem, key: string) => OutputItem\n): { [key: string]: OutputItem } {\n let newHash = {}\n\n for (let key in hash) {\n newHash[key] = func(hash[key], key)\n }\n\n return newHash\n}\n\n\nexport function arrayToHash(a): { [key: string]: true } {\n let hash = {}\n\n for (let item of a) {\n hash[item] = true\n }\n\n return hash\n}\n\n\nexport function hashValuesToArray(obj) {\n let a = []\n\n for (let key in obj) {\n a.push(obj[key])\n }\n\n return a\n}\n\n\nexport function isPropsEqual(obj0, obj1) {\n\n for (let key in obj0) {\n if (hasOwnProperty.call(obj0, key)) {\n if (!(key in obj1)) {\n return false\n }\n }\n }\n\n for (let key in obj1) {\n if (hasOwnProperty.call(obj1, key)) {\n if (obj0[key] !== obj1[key]) {\n return false\n }\n }\n }\n\n return true\n}\n","import {\n EventInput,\n EventDef,\n EventDefHash,\n EventInstance,\n EventInstanceHash,\n createEventInstance,\n parseEvent,\n EventTuple\n} from './event'\nimport { EventSource } from './event-source'\nimport { expandRecurringRanges } from './recurring-event'\nimport Calendar from '../Calendar'\nimport { filterHash } from '../util/object'\nimport { DateRange } from '../datelib/date-range'\n\n/*\nA data structure that encapsulates EventDefs and EventInstances.\nUtils for parsing this data from raw EventInputs.\nUtils for manipulating an EventStore.\n*/\n\nexport interface EventStore {\n defs: EventDefHash\n instances: EventInstanceHash\n}\n\nexport function parseEvents(\n rawEvents: EventInput[],\n sourceId: string,\n calendar: Calendar,\n allowOpenRange?: boolean\n): EventStore {\n let eventStore = createEmptyEventStore()\n\n for (let rawEvent of rawEvents) {\n let tuple = parseEvent(rawEvent, sourceId, calendar, allowOpenRange)\n\n if (tuple) {\n eventTupleToStore(tuple, eventStore)\n }\n }\n\n return eventStore\n}\n\nexport function eventTupleToStore(tuple: EventTuple, eventStore: EventStore = createEmptyEventStore()) {\n eventStore.defs[tuple.def.defId] = tuple.def\n\n if (tuple.instance) {\n eventStore.instances[tuple.instance.instanceId] = tuple.instance\n }\n\n return eventStore\n}\n\nexport function expandRecurring(eventStore: EventStore, framingRange: DateRange, calendar: Calendar): EventStore {\n let dateEnv = calendar.dateEnv\n let { defs, instances } = eventStore\n\n // remove existing recurring instances\n instances = filterHash(instances, function(instance: EventInstance) {\n return !defs[instance.defId].recurringDef\n })\n\n for (let defId in defs) {\n let def = defs[defId]\n\n if (def.recurringDef) {\n let duration = def.recurringDef.duration\n\n if (!duration) {\n duration = def.allDay ?\n calendar.defaultAllDayEventDuration :\n calendar.defaultTimedEventDuration\n }\n\n let starts = expandRecurringRanges(def, duration, framingRange, calendar.dateEnv, calendar.pluginSystem.hooks.recurringTypes)\n\n for (let start of starts) {\n let instance = createEventInstance(defId, {\n start,\n end: dateEnv.add(start, duration)\n })\n instances[instance.instanceId] = instance\n }\n }\n }\n\n return { defs, instances }\n}\n\n// retrieves events that have the same groupId as the instance specified by `instanceId`\n// or they are the same as the instance.\n// why might instanceId not be in the store? an event from another calendar?\nexport function getRelevantEvents(eventStore: EventStore, instanceId: string): EventStore {\n let instance = eventStore.instances[instanceId]\n\n if (instance) {\n let def = eventStore.defs[instance.defId]\n\n // get events/instances with same group\n let newStore = filterEventStoreDefs(eventStore, function(lookDef) {\n return isEventDefsGrouped(def, lookDef)\n })\n\n // add the original\n // TODO: wish we could use eventTupleToStore or something like it\n newStore.defs[def.defId] = def\n newStore.instances[instance.instanceId] = instance\n\n return newStore\n }\n\n return createEmptyEventStore()\n}\n\nfunction isEventDefsGrouped(def0: EventDef, def1: EventDef): boolean {\n return Boolean(def0.groupId && def0.groupId === def1.groupId)\n}\n\nexport function transformRawEvents(rawEvents, eventSource: EventSource, calendar: Calendar) {\n let calEachTransform = calendar.opt('eventDataTransform')\n let sourceEachTransform = eventSource ? eventSource.eventDataTransform : null\n\n if (sourceEachTransform) {\n rawEvents = transformEachRawEvent(rawEvents, sourceEachTransform)\n }\n\n if (calEachTransform) {\n rawEvents = transformEachRawEvent(rawEvents, calEachTransform)\n }\n\n return rawEvents\n}\n\nfunction transformEachRawEvent(rawEvents, func) {\n let refinedEvents\n\n if (!func) {\n refinedEvents = rawEvents\n } else {\n refinedEvents = []\n\n for (let rawEvent of rawEvents) {\n let refinedEvent = func(rawEvent)\n\n if (refinedEvent) {\n refinedEvents.push(refinedEvent)\n } else if (refinedEvent == null) {\n refinedEvents.push(rawEvent)\n } // if a different falsy value, do nothing\n }\n }\n\n return refinedEvents\n}\n\nexport function createEmptyEventStore(): EventStore {\n return { defs: {}, instances: {} }\n}\n\nexport function mergeEventStores(store0: EventStore, store1: EventStore): EventStore {\n return {\n defs: { ...store0.defs, ...store1.defs },\n instances: { ...store0.instances, ...store1.instances }\n }\n}\n\nexport function filterEventStoreDefs(eventStore: EventStore, filterFunc: (eventDef: EventDef) => boolean): EventStore {\n let defs = filterHash(eventStore.defs, filterFunc)\n let instances = filterHash(eventStore.instances, function(instance: EventInstance) {\n return defs[instance.defId] // still exists?\n })\n return { defs, instances }\n}\n","import { DateMarker } from './marker'\nimport { DateEnv, DateInput } from './env'\n\nexport interface DateRangeInput {\n start?: DateInput\n end?: DateInput\n}\n\nexport interface OpenDateRange {\n start: DateMarker | null\n end: DateMarker | null\n}\n\nexport interface DateRange {\n start: DateMarker\n end: DateMarker\n}\n\nexport function parseRange(input: DateRangeInput, dateEnv: DateEnv): OpenDateRange {\n let start = null\n let end = null\n\n if (input.start) {\n start = dateEnv.createMarker(input.start)\n }\n\n if (input.end) {\n end = dateEnv.createMarker(input.end)\n }\n\n if (!start && !end) {\n return null\n }\n\n if (start && end && end < start) {\n return null\n }\n\n return { start, end }\n}\n\n// SIDE-EFFECT: will mutate ranges.\n// Will return a new array result.\nexport function invertRanges(ranges: DateRange[], constraintRange: DateRange): DateRange[] {\n let invertedRanges: DateRange[] = []\n let start = constraintRange.start // the end of the previous range. the start of the new range\n let i\n let dateRange\n\n // ranges need to be in order. required for our date-walking algorithm\n ranges.sort(compareRanges)\n\n for (i = 0; i < ranges.length; i++) {\n dateRange = ranges[i]\n\n // add the span of time before the event (if there is any)\n if (dateRange.start > start) { // compare millisecond time (skip any ambig logic)\n invertedRanges.push({ start, end: dateRange.start })\n }\n\n if (dateRange.end > start) {\n start = dateRange.end\n }\n }\n\n // add the span of time after the last event (if there is any)\n if (start < constraintRange.end) { // compare millisecond time (skip any ambig logic)\n invertedRanges.push({ start, end: constraintRange.end })\n }\n\n return invertedRanges\n}\n\nfunction compareRanges(range0: DateRange, range1: DateRange) {\n return range0.start.valueOf() - range1.start.valueOf() // earlier ranges go first\n}\n\nexport function intersectRanges(range0: OpenDateRange, range1: OpenDateRange): OpenDateRange {\n let start = range0.start\n let end = range0.end\n let newRange = null\n\n if (range1.start !== null) {\n if (start === null) {\n start = range1.start\n } else {\n start = new Date(Math.max(start.valueOf(), range1.start.valueOf()))\n }\n }\n\n if (range1.end != null) {\n if (end === null) {\n end = range1.end\n } else {\n end = new Date(Math.min(end.valueOf(), range1.end.valueOf()))\n }\n }\n\n if (start === null || end === null || start < end) {\n newRange = { start, end }\n }\n\n return newRange\n}\n\nexport function rangesEqual(range0: OpenDateRange, range1: OpenDateRange): boolean {\n return (range0.start === null ? null : range0.start.valueOf()) === (range1.start === null ? null : range1.start.valueOf()) &&\n (range0.end === null ? null : range0.end.valueOf()) === (range1.end === null ? null : range1.end.valueOf())\n}\n\nexport function rangesIntersect(range0: OpenDateRange, range1: OpenDateRange): boolean {\n return (range0.end === null || range1.start === null || range0.end > range1.start) &&\n (range0.start === null || range1.end === null || range0.start < range1.end)\n}\n\nexport function rangeContainsRange(outerRange: OpenDateRange, innerRange: OpenDateRange): boolean {\n return (outerRange.start === null || (innerRange.start !== null && innerRange.start >= outerRange.start)) &&\n (outerRange.end === null || (innerRange.end !== null && innerRange.end <= outerRange.end))\n}\n\nexport function rangeContainsMarker(range: OpenDateRange, date: DateMarker | number): boolean { // date can be a millisecond time\n return (range.start === null || date >= range.start) &&\n (range.end === null || date < range.end)\n}\n\n// If the given date is not within the given range, move it inside.\n// (If it's past the end, make it one millisecond before the end).\nexport function constrainMarkerToRange(date: DateMarker, range: DateRange): DateMarker {\n if (range.start != null && date < range.start) {\n return range.start\n }\n\n if (range.end != null && date >= range.end) {\n return new Date(range.end.valueOf() - 1)\n }\n\n return date\n}\n","\nexport function removeMatching(array, testFunc) {\n let removeCnt = 0\n let i = 0\n\n while (i < array.length) {\n if (testFunc(array[i])) { // truthy value means *remove*\n array.splice(i, 1)\n removeCnt++\n } else {\n i++\n }\n }\n\n return removeCnt\n}\n\n\nexport function removeExact(array, exactVal) {\n let removeCnt = 0\n let i = 0\n\n while (i < array.length) {\n if (array[i] === exactVal) {\n array.splice(i, 1)\n removeCnt++\n } else {\n i++\n }\n }\n\n return removeCnt\n}\n\nexport function isArraysEqual(a0, a1) {\n let len = a0.length\n let i\n\n if (len !== a1.length) { // not array? or not same length?\n return false\n }\n\n for (i = 0; i < len; i++) {\n if (a0[i] !== a1[i]) {\n return false\n }\n }\n\n return true\n}\n","import { isArraysEqual } from './array'\n\nexport function memoize(workerFunc: T): T {\n let args\n let res\n\n return function() {\n if (!args || !isArraysEqual(args, arguments)) {\n args = arguments\n res = (workerFunc as any).apply(this, arguments)\n }\n\n return res\n } as any\n}\n\n/*\nalways executes the workerFunc, but if the result is equal to the previous result,\nreturn the previous result instead.\n*/\nexport function memoizeOutput(workerFunc: T, equalityFunc: (output0, output1) => boolean): T {\n let cachedRes = null\n\n return function() {\n let newRes = (workerFunc as any).apply(this, arguments)\n\n if (cachedRes === null || !(cachedRes === newRes || equalityFunc(cachedRes, newRes))) {\n cachedRes = newRes\n }\n\n return cachedRes\n } as any\n}\n","import { DateMarker, timeAsMs } from './marker'\nimport { CalendarSystem } from './calendar-system'\nimport { Locale } from './locale'\nimport { DateFormatter, DateFormattingContext, ZonedMarker, formatTimeZoneOffset } from './formatting'\nimport { memoize } from '../util/memoize'\n\nconst EXTENDED_SETTINGS_AND_SEVERITIES = {\n week: 3,\n separator: 0, // 0 = not applicable\n omitZeroMinute: 0,\n meridiem: 0, // like am/pm\n omitCommas: 0\n}\n\nconst STANDARD_DATE_PROP_SEVERITIES = {\n timeZoneName: 7,\n era: 6,\n year: 5,\n month: 4,\n day: 2,\n weekday: 2,\n hour: 1,\n minute: 1,\n second: 1\n}\n\nconst MERIDIEM_RE = /\\s*([ap])\\.?m\\.?/i // eats up leading spaces too\nconst COMMA_RE = /,/g // we need re for globalness\nconst MULTI_SPACE_RE = /\\s+/g\nconst LTR_RE = /\\u200e/g // control character\nconst UTC_RE = /UTC|GMT/\n\nexport class NativeFormatter implements DateFormatter {\n\n standardDateProps: any\n extendedSettings: any\n severity: number\n private buildFormattingFunc: typeof buildFormattingFunc // caching for efficiency with same date env\n\n constructor(formatSettings) {\n let standardDateProps: any = {}\n let extendedSettings: any = {}\n let severity = 0\n\n for (let name in formatSettings) {\n if (name in EXTENDED_SETTINGS_AND_SEVERITIES) {\n extendedSettings[name] = formatSettings[name]\n severity = Math.max(EXTENDED_SETTINGS_AND_SEVERITIES[name], severity)\n } else {\n standardDateProps[name] = formatSettings[name]\n\n if (name in STANDARD_DATE_PROP_SEVERITIES) {\n severity = Math.max(STANDARD_DATE_PROP_SEVERITIES[name], severity)\n }\n }\n }\n\n this.standardDateProps = standardDateProps\n this.extendedSettings = extendedSettings\n this.severity = severity\n\n this.buildFormattingFunc = memoize(buildFormattingFunc)\n }\n\n format(date: ZonedMarker, context: DateFormattingContext) {\n return this.buildFormattingFunc(this.standardDateProps, this.extendedSettings, context)(date)\n }\n\n formatRange(start: ZonedMarker, end: ZonedMarker, context: DateFormattingContext) {\n let { standardDateProps, extendedSettings } = this\n\n let diffSeverity = computeMarkerDiffSeverity(start.marker, end.marker, context.calendarSystem)\n if (!diffSeverity) {\n return this.format(start, context)\n }\n\n let biggestUnitForPartial = diffSeverity\n if (\n biggestUnitForPartial > 1 && // the two dates are different in a way that's larger scale than time\n (standardDateProps.year === 'numeric' || standardDateProps.year === '2-digit') &&\n (standardDateProps.month === 'numeric' || standardDateProps.month === '2-digit') &&\n (standardDateProps.day === 'numeric' || standardDateProps.day === '2-digit')\n ) {\n biggestUnitForPartial = 1 // make it look like the dates are only different in terms of time\n }\n\n let full0 = this.format(start, context)\n let full1 = this.format(end, context)\n\n if (full0 === full1) {\n return full0\n }\n\n let partialDateProps = computePartialFormattingOptions(standardDateProps, biggestUnitForPartial)\n let partialFormattingFunc = buildFormattingFunc(partialDateProps, extendedSettings, context)\n let partial0 = partialFormattingFunc(start)\n let partial1 = partialFormattingFunc(end)\n\n let insertion = findCommonInsertion(full0, partial0, full1, partial1)\n let separator = extendedSettings.separator || ''\n\n if (insertion) {\n return insertion.before + partial0 + separator + partial1 + insertion.after\n }\n\n return full0 + separator + full1\n }\n\n getLargestUnit() {\n switch (this.severity) {\n case 7:\n case 6:\n case 5:\n return 'year'\n case 4:\n return 'month'\n case 3:\n return 'week'\n default:\n return 'day'\n }\n }\n\n}\n\nfunction buildFormattingFunc(\n standardDateProps,\n extendedSettings,\n context: DateFormattingContext\n): (date: ZonedMarker) => string {\n let standardDatePropCnt = Object.keys(standardDateProps).length\n\n if (standardDatePropCnt === 1 && standardDateProps.timeZoneName === 'short') {\n return function(date: ZonedMarker) {\n return formatTimeZoneOffset(date.timeZoneOffset)\n }\n }\n\n if (standardDatePropCnt === 0 && extendedSettings.week) {\n return function(date: ZonedMarker) {\n return formatWeekNumber(\n context.computeWeekNumber(date.marker),\n context.weekLabel,\n context.locale,\n extendedSettings.week\n )\n }\n }\n\n return buildNativeFormattingFunc(standardDateProps, extendedSettings, context)\n}\n\nfunction buildNativeFormattingFunc(\n standardDateProps,\n extendedSettings,\n context: DateFormattingContext\n): (date: ZonedMarker) => string {\n standardDateProps = { ...standardDateProps } // copy\n extendedSettings = { ...extendedSettings } // copy\n\n sanitizeSettings(standardDateProps, extendedSettings)\n\n standardDateProps.timeZone = 'UTC' // we leverage the only guaranteed timeZone for our UTC markers\n\n let normalFormat = new Intl.DateTimeFormat(context.locale.codes, standardDateProps)\n let zeroFormat // needed?\n\n if (extendedSettings.omitZeroMinute) {\n let zeroProps = { ...standardDateProps }\n delete zeroProps.minute // seconds and ms were already considered in sanitizeSettings\n zeroFormat = new Intl.DateTimeFormat(context.locale.codes, zeroProps)\n }\n\n return function(date: ZonedMarker) {\n let marker = date.marker\n let format\n\n if (zeroFormat && !marker.getUTCMinutes()) {\n format = zeroFormat\n } else {\n format = normalFormat\n }\n\n let s = format.format(marker)\n\n return postProcess(s, date, standardDateProps, extendedSettings, context)\n }\n}\n\nfunction sanitizeSettings(standardDateProps, extendedSettings) {\n\n // deal with a browser inconsistency where formatting the timezone\n // requires that the hour/minute be present.\n if (standardDateProps.timeZoneName) {\n if (!standardDateProps.hour) {\n standardDateProps.hour = '2-digit'\n }\n if (!standardDateProps.minute) {\n standardDateProps.minute = '2-digit'\n }\n }\n\n // only support short timezone names\n if (standardDateProps.timeZoneName === 'long') {\n standardDateProps.timeZoneName = 'short'\n }\n\n // if requesting to display seconds, MUST display minutes\n if (extendedSettings.omitZeroMinute && (standardDateProps.second || standardDateProps.millisecond)) {\n delete extendedSettings.omitZeroMinute\n }\n}\n\nfunction postProcess(s: string, date: ZonedMarker, standardDateProps, extendedSettings, context: DateFormattingContext): string {\n\n s = s.replace(LTR_RE, '') // remove left-to-right control chars. do first. good for other regexes\n\n if (standardDateProps.timeZoneName === 'short') {\n s = injectTzoStr(\n s,\n (context.timeZone === 'UTC' || date.timeZoneOffset == null) ?\n 'UTC' : // important to normalize for IE, which does \"GMT\"\n formatTimeZoneOffset(date.timeZoneOffset)\n )\n }\n\n if (extendedSettings.omitCommas) {\n s = s.replace(COMMA_RE, '').trim()\n }\n\n if (extendedSettings.omitZeroMinute) {\n s = s.replace(':00', '') // zeroFormat doesn't always achieve this\n }\n\n // ^ do anything that might create adjacent spaces before this point,\n // because MERIDIEM_RE likes to eat up loading spaces\n\n if (extendedSettings.meridiem === false) {\n s = s.replace(MERIDIEM_RE, '').trim()\n } else if (extendedSettings.meridiem === 'narrow') { // a/p\n s = s.replace(MERIDIEM_RE, function(m0, m1) {\n return m1.toLocaleLowerCase()\n })\n } else if (extendedSettings.meridiem === 'short') { // am/pm\n s = s.replace(MERIDIEM_RE, function(m0, m1) {\n return m1.toLocaleLowerCase() + 'm'\n })\n } else if (extendedSettings.meridiem === 'lowercase') { // other meridiem transformers already converted to lowercase\n s = s.replace(MERIDIEM_RE, function(m0) {\n return m0.toLocaleLowerCase()\n })\n }\n\n s = s.replace(MULTI_SPACE_RE, ' ')\n s = s.trim()\n\n return s\n}\n\nfunction injectTzoStr(s: string, tzoStr: string): string {\n let replaced = false\n\n s = s.replace(UTC_RE, function() {\n replaced = true\n return tzoStr\n })\n\n // IE11 doesn't include UTC/GMT in the original string, so append to end\n if (!replaced) {\n s += ' ' + tzoStr\n }\n\n return s\n}\n\nfunction formatWeekNumber(num: number, weekLabel: string, locale: Locale, display?: 'numeric' | 'narrow' | 'short'): string {\n let parts = []\n\n if (display === 'narrow') {\n parts.push(weekLabel)\n } else if (display === 'short') {\n parts.push(weekLabel, ' ')\n }\n // otherwise, considered 'numeric'\n\n parts.push(locale.simpleNumberFormat.format(num))\n\n if (locale.options.isRtl) { // TODO: use control characters instead?\n parts.reverse()\n }\n\n return parts.join('')\n}\n\n\n// Range Formatting Utils\n\n// 0 = exactly the same\n// 1 = different by time\n// and bigger\nfunction computeMarkerDiffSeverity(d0: DateMarker, d1: DateMarker, ca: CalendarSystem) {\n if (ca.getMarkerYear(d0) !== ca.getMarkerYear(d1)) {\n return 5\n }\n if (ca.getMarkerMonth(d0) !== ca.getMarkerMonth(d1)) {\n return 4\n }\n if (ca.getMarkerDay(d0) !== ca.getMarkerDay(d1)) {\n return 2\n }\n if (timeAsMs(d0) !== timeAsMs(d1)) {\n return 1\n }\n return 0\n}\n\nfunction computePartialFormattingOptions(options, biggestUnit) {\n let partialOptions = {}\n\n for (let name in options) {\n if (\n !(name in STANDARD_DATE_PROP_SEVERITIES) || // not a date part prop (like timeZone)\n STANDARD_DATE_PROP_SEVERITIES[name] <= biggestUnit\n ) {\n partialOptions[name] = options[name]\n }\n }\n\n return partialOptions\n}\n\nfunction findCommonInsertion(full0, partial0, full1, partial1) {\n\n let i0 = 0\n while (i0 < full0.length) {\n\n let found0 = full0.indexOf(partial0, i0)\n if (found0 === -1) {\n break\n }\n\n let before0 = full0.substr(0, found0)\n i0 = found0 + partial0.length\n let after0 = full0.substr(i0)\n\n let i1 = 0\n while (i1 < full1.length) {\n\n let found1 = full1.indexOf(partial1, i1)\n if (found1 === -1) {\n break\n }\n\n let before1 = full1.substr(0, found1)\n i1 = found1 + partial1.length\n let after1 = full1.substr(i1)\n\n if (before0 === before1 && after0 === after1) {\n return {\n before: before0,\n after: after0\n }\n }\n }\n }\n\n return null\n}\n","import {\n DateFormatter, DateFormattingContext, ZonedMarker,\n VerboseFormattingArg, createVerboseFormattingArg\n} from './formatting'\n\nexport type CmdFormatterFunc = (cmd: string, arg: VerboseFormattingArg) => string\n\n/*\nTODO: fix the terminology of \"formatter\" vs \"formatting func\"\n*/\n\n/*\nAt the time of instantiation, this object does not know which cmd-formatting system it will use.\nIt receives this at the time of formatting, as a setting.\n*/\nexport class CmdFormatter implements DateFormatter {\n\n cmdStr: string\n separator: string\n\n constructor(cmdStr: string, separator?: string) {\n this.cmdStr = cmdStr\n this.separator = separator\n }\n\n format(date: ZonedMarker, context: DateFormattingContext) {\n return context.cmdFormatter(this.cmdStr, createVerboseFormattingArg(date, null, context, this.separator))\n }\n\n formatRange(start: ZonedMarker, end: ZonedMarker, context: DateFormattingContext) {\n return context.cmdFormatter(this.cmdStr, createVerboseFormattingArg(start, end, context, this.separator))\n }\n\n}\n","import {\n DateFormatter, DateFormattingContext, ZonedMarker,\n VerboseFormattingArg, createVerboseFormattingArg\n} from './formatting'\n\nexport type FuncFormatterFunc = (arg: VerboseFormattingArg) => string\n\n\nexport class FuncFormatter implements DateFormatter {\n\n func: FuncFormatterFunc\n\n constructor(func: FuncFormatterFunc) {\n this.func = func\n }\n\n format(date: ZonedMarker, context: DateFormattingContext) {\n return this.func(createVerboseFormattingArg(date, null, context))\n }\n\n formatRange(start: ZonedMarker, end: ZonedMarker, context: DateFormattingContext) {\n return this.func(createVerboseFormattingArg(start, end, context))\n }\n\n}\n","import { padStart } from '../util/misc'\nimport { DateMarker } from './marker'\nimport { CalendarSystem } from './calendar-system'\nimport { Locale } from './locale'\nimport { NativeFormatter } from './formatting-native'\nimport { CmdFormatter, CmdFormatterFunc } from './formatting-cmd'\nimport { FuncFormatter, FuncFormatterFunc } from './formatting-func'\n\nexport interface ZonedMarker {\n marker: DateMarker,\n timeZoneOffset: number\n}\n\nexport interface ExpandedZonedMarker extends ZonedMarker {\n array: number[],\n year: number,\n month: number,\n day: number,\n hour: number,\n minute: number,\n second: number,\n millisecond: number\n}\n\nexport interface VerboseFormattingArg { // TODO: kill this\n date: ExpandedZonedMarker\n start: ExpandedZonedMarker\n end?: ExpandedZonedMarker\n timeZone: string\n localeCodes: string[],\n separator: string\n}\n\nexport interface DateFormattingContext {\n timeZone: string,\n locale: Locale,\n calendarSystem: CalendarSystem\n computeWeekNumber: (d: DateMarker) => number\n weekLabel: string\n cmdFormatter?: CmdFormatterFunc\n}\n\nexport interface DateFormatter {\n format(date: ZonedMarker, context: DateFormattingContext)\n formatRange(start: ZonedMarker, end: ZonedMarker, context: DateFormattingContext)\n}\n\n// TODO: use Intl.DateTimeFormatOptions\nexport type FormatterInput = object | string | FuncFormatterFunc\n\n\n// Formatter Object Creation\n\nexport function createFormatter(input: FormatterInput, defaultSeparator?: string): DateFormatter {\n if (typeof input === 'object' && input) { // non-null object\n if (typeof defaultSeparator === 'string') {\n input = { separator: defaultSeparator, ...input }\n }\n return new NativeFormatter(input)\n\n } else if (typeof input === 'string') {\n return new CmdFormatter(input, defaultSeparator)\n\n } else if (typeof input === 'function') {\n return new FuncFormatter(input as FuncFormatterFunc)\n }\n}\n\n\n// String Utils\n\n// timeZoneOffset is in minutes\nexport function buildIsoString(marker: DateMarker, timeZoneOffset?: number, stripZeroTime: boolean = false) {\n let s = marker.toISOString()\n\n s = s.replace('.000', '')\n\n if (stripZeroTime) {\n s = s.replace('T00:00:00Z', '')\n }\n\n if (s.length > 10) { // time part wasn't stripped, can add timezone info\n if (timeZoneOffset == null) {\n s = s.replace('Z', '')\n } else if (timeZoneOffset !== 0) {\n s = s.replace('Z', formatTimeZoneOffset(timeZoneOffset, true))\n }\n // otherwise, its UTC-0 and we want to keep the Z\n }\n\n return s\n}\n\nexport function formatIsoTimeString(marker: DateMarker) {\n return padStart(marker.getUTCHours(), 2) + ':' +\n padStart(marker.getUTCMinutes(), 2) + ':' +\n padStart(marker.getUTCSeconds(), 2)\n}\n\nexport function formatTimeZoneOffset(minutes: number, doIso = false) {\n let sign = minutes < 0 ? '-' : '+'\n let abs = Math.abs(minutes)\n let hours = Math.floor(abs / 60)\n let mins = Math.round(abs % 60)\n\n if (doIso) {\n return sign + padStart(hours, 2) + ':' + padStart(mins, 2)\n } else {\n return 'GMT' + sign + hours + (mins ? ':' + padStart(mins, 2) : '')\n }\n}\n\n\n// Arg Utils\n\nexport function createVerboseFormattingArg(start: ZonedMarker, end: ZonedMarker, context: DateFormattingContext, separator?: string): VerboseFormattingArg {\n let startInfo = expandZonedMarker(start, context.calendarSystem)\n let endInfo = end ? expandZonedMarker(end, context.calendarSystem) : null\n\n return {\n date: startInfo,\n start: startInfo,\n end: endInfo,\n timeZone: context.timeZone,\n localeCodes: context.locale.codes,\n separator\n }\n}\n\nfunction expandZonedMarker(dateInfo: ZonedMarker, calendarSystem: CalendarSystem): ExpandedZonedMarker {\n let a = calendarSystem.markerToArray(dateInfo.marker)\n\n return {\n marker: dateInfo.marker,\n timeZoneOffset: dateInfo.timeZoneOffset,\n array: a,\n year: a[0],\n month: a[1],\n day: a[2],\n hour: a[3],\n minute: a[4],\n second: a[5],\n millisecond: a[6]\n }\n}\n","import Calendar from '../Calendar'\nimport { EventSource } from '../structs/event-source'\n\nexport default class EventSourceApi {\n\n calendar: Calendar\n internalEventSource: EventSource // rename?\n\n constructor(calendar: Calendar, internalEventSource: EventSource) {\n this.calendar = calendar\n this.internalEventSource = internalEventSource\n }\n\n remove() {\n this.calendar.dispatch({\n type: 'REMOVE_EVENT_SOURCE',\n sourceId: this.internalEventSource.sourceId\n })\n }\n\n refetch() {\n this.calendar.dispatch({\n type: 'FETCH_EVENT_SOURCES',\n sourceIds: [ this.internalEventSource.sourceId ]\n })\n }\n\n get id(): string {\n return this.internalEventSource.publicId\n }\n\n // only relevant to json-feed event sources\n get url(): string {\n return this.internalEventSource.meta.url\n }\n\n}\n","import Calendar from '../Calendar'\nimport { EventDef, EventInstance, NON_DATE_PROPS, DATE_PROPS } from '../structs/event'\nimport { UNSCOPED_EVENT_UI_PROPS } from '../component/event-ui'\nimport { EventMutation } from '../structs/event-mutation'\nimport { DateInput } from '../datelib/env'\nimport { diffDates, computeAlignedDayRange } from '../util/misc'\nimport { subtractDurations, DurationInput, createDuration } from '../datelib/duration'\nimport { createFormatter, FormatterInput } from '../datelib/formatting'\nimport EventSourceApi from './EventSourceApi'\n\nexport default class EventApi {\n\n _calendar: Calendar\n _def: EventDef\n _instance: EventInstance | null\n\n constructor(calendar: Calendar, def: EventDef, instance?: EventInstance) {\n this._calendar = calendar\n this._def = def\n this._instance = instance || null\n }\n\n /*\n TODO: make event struct more responsible for this\n */\n setProp(name: string, val: string) {\n if (name in DATE_PROPS) {\n // error. date-related props need other methods\n\n } else if (name in NON_DATE_PROPS) {\n\n if (typeof NON_DATE_PROPS[name] === 'function') {\n val = NON_DATE_PROPS[name](val)\n }\n\n this.mutate({\n standardProps: { [name]: val }\n })\n\n } else if (name in UNSCOPED_EVENT_UI_PROPS) {\n let ui\n\n if (typeof UNSCOPED_EVENT_UI_PROPS[name] === 'function') {\n val = UNSCOPED_EVENT_UI_PROPS[name](val)\n }\n\n if (name === 'color') {\n ui = { backgroundColor: val, borderColor: val }\n } else if (name === 'editable') {\n ui = { startEditable: val, durationEditable: val }\n } else {\n ui = { [name]: val }\n }\n\n this.mutate({\n standardProps: { ui }\n })\n\n } else {\n // error\n }\n }\n\n setExtendedProp(name: string, val: string) {\n this.mutate({\n extendedProps: { [name]: val }\n })\n }\n\n setStart(startInput: DateInput, options: { granularity?: string, maintainDuration?: boolean } = {}) {\n let { dateEnv } = this._calendar\n let start = dateEnv.createMarker(startInput)\n\n if (start && this._instance) { // TODO: warning if parsed bad\n let instanceRange = this._instance.range\n let startDelta = diffDates(instanceRange.start, start, dateEnv, options.granularity) // what if parsed bad!?\n let endDelta = null\n\n if (options.maintainDuration) {\n let origDuration = diffDates(instanceRange.start, instanceRange.end, dateEnv, options.granularity)\n let newDuration = diffDates(start, instanceRange.end, dateEnv, options.granularity)\n endDelta = subtractDurations(origDuration, newDuration)\n }\n\n this.mutate({ startDelta, endDelta })\n }\n }\n\n setEnd(endInput: DateInput | null, options: { granularity?: string } = {}) {\n let { dateEnv } = this._calendar\n let end\n\n if (endInput != null) {\n end = dateEnv.createMarker(endInput)\n\n if (!end) {\n return // TODO: warning if parsed bad\n }\n }\n\n if (this._instance) {\n if (end) {\n let endDelta = diffDates(this._instance.range.end, end, dateEnv, options.granularity)\n this.mutate({ endDelta })\n } else {\n this.mutate({ standardProps: { hasEnd: false } })\n }\n }\n }\n\n setDates(startInput: DateInput, endInput: DateInput | null, options: { allDay?: boolean, granularity?: string } = {}) {\n let { dateEnv } = this._calendar\n let standardProps = { allDay: options.allDay } as any\n let start = dateEnv.createMarker(startInput)\n let end\n\n if (!start) {\n return // TODO: warning if parsed bad\n }\n\n if (endInput != null) {\n end = dateEnv.createMarker(endInput)\n\n if (!end) { // TODO: warning if parsed bad\n return\n }\n }\n\n if (this._instance) {\n let instanceRange = this._instance.range\n\n // when computing the diff for an event being converted to all-day,\n // compute diff off of the all-day values the way event-mutation does.\n if (options.allDay === true) {\n instanceRange = computeAlignedDayRange(instanceRange)\n }\n\n let startDelta = diffDates(instanceRange.start, start, dateEnv, options.granularity)\n\n if (end) {\n let endDelta = diffDates(instanceRange.end, end, dateEnv, options.granularity)\n this.mutate({ startDelta, endDelta, standardProps })\n } else {\n standardProps.hasEnd = false\n this.mutate({ startDelta, standardProps })\n }\n }\n }\n\n moveStart(deltaInput: DurationInput) {\n let delta = createDuration(deltaInput)\n\n if (delta) { // TODO: warning if parsed bad\n this.mutate({ startDelta: delta })\n }\n }\n\n moveEnd(deltaInput: DurationInput) {\n let delta = createDuration(deltaInput)\n\n if (delta) { // TODO: warning if parsed bad\n this.mutate({ endDelta: delta })\n }\n }\n\n moveDates(deltaInput: DurationInput) {\n let delta = createDuration(deltaInput)\n\n if (delta) { // TODO: warning if parsed bad\n this.mutate({ startDelta: delta, endDelta: delta })\n }\n }\n\n setAllDay(allDay: boolean, options: { maintainDuration?: boolean } = {}) {\n let standardProps = { allDay } as any\n let maintainDuration = options.maintainDuration\n\n if (maintainDuration == null) {\n maintainDuration = this._calendar.opt('allDayMaintainDuration')\n }\n\n if (this._def.allDay !== allDay) {\n standardProps.hasEnd = maintainDuration\n }\n\n this.mutate({ standardProps })\n }\n\n formatRange(formatInput: FormatterInput) {\n let { dateEnv } = this._calendar\n let instance = this._instance\n let formatter = createFormatter(formatInput, this._calendar.opt('defaultRangeSeparator'))\n\n if (this._def.hasEnd) {\n return dateEnv.formatRange(instance.range.start, instance.range.end, formatter, {\n forcedStartTzo: instance.forcedStartTzo,\n forcedEndTzo: instance.forcedEndTzo\n })\n } else {\n return dateEnv.format(instance.range.start, formatter, {\n forcedTzo: instance.forcedStartTzo\n })\n }\n }\n\n mutate(mutation: EventMutation) { // meant to be private. but plugins need access\n let def = this._def\n let instance = this._instance\n\n if (instance) {\n this._calendar.dispatch({\n type: 'MUTATE_EVENTS',\n instanceId: instance.instanceId,\n mutation,\n fromApi: true\n })\n\n let eventStore = this._calendar.state.eventStore\n this._def = eventStore.defs[def.defId]\n this._instance = eventStore.instances[instance.instanceId]\n }\n }\n\n remove() {\n this._calendar.dispatch({\n type: 'REMOVE_EVENT_DEF',\n defId: this._def.defId\n })\n }\n\n get source(): EventSourceApi | null {\n let sourceId = this._def.sourceId\n\n if (sourceId) {\n return new EventSourceApi(\n this._calendar,\n this._calendar.state.eventSources[sourceId]\n )\n }\n return null\n }\n\n get start(): Date | null {\n return this._instance ?\n this._calendar.dateEnv.toDate(this._instance.range.start) :\n null\n }\n\n get end(): Date | null {\n return (this._instance && this._def.hasEnd) ?\n this._calendar.dateEnv.toDate(this._instance.range.end) :\n null\n }\n\n // computable props that all access the def\n // TODO: find a TypeScript-compatible way to do this at scale\n get id(): string { return this._def.publicId }\n get groupId(): string { return this._def.groupId }\n get allDay(): boolean { return this._def.allDay }\n get title(): string { return this._def.title }\n get url(): string { return this._def.url }\n get rendering(): string { return this._def.rendering }\n get startEditable(): boolean { return this._def.ui.startEditable }\n get durationEditable(): boolean { return this._def.ui.durationEditable }\n get constraint(): any { return this._def.ui.constraints[0] || null }\n get overlap(): any { return this._def.ui.overlap }\n get allow(): any { return this._def.ui.allows[0] || null }\n get backgroundColor(): string { return this._def.ui.backgroundColor }\n get borderColor(): string { return this._def.ui.borderColor }\n get textColor(): string { return this._def.ui.textColor }\n\n // NOTE: user can't modify these because Object.freeze was called in event-def parsing\n get classNames(): string[] { return this._def.ui.classNames }\n get extendedProps(): any { return this._def.extendedProps }\n\n}\n","import { EventDef, EventTuple, EventDefHash } from '../structs/event'\nimport { EventStore } from '../structs/event-store'\nimport { DateRange, invertRanges, intersectRanges } from '../datelib/date-range'\nimport { Duration } from '../datelib/duration'\nimport { computeVisibleDayRange } from '../util/misc'\nimport { Seg } from './DateComponent'\nimport View from '../View'\nimport EventApi from '../api/EventApi'\nimport { EventUi, EventUiHash, combineEventUis } from './event-ui'\nimport { mapHash } from '../util/object'\n\nexport interface EventRenderRange extends EventTuple {\n ui: EventUi\n range: DateRange\n isStart: boolean\n isEnd: boolean\n}\n\n/*\nSpecifying nextDayThreshold signals that all-day ranges should be sliced.\n*/\nexport function sliceEventStore(eventStore: EventStore, eventUiBases: EventUiHash, framingRange: DateRange, nextDayThreshold?: Duration) {\n let inverseBgByGroupId: { [groupId: string]: DateRange[] } = {}\n let inverseBgByDefId: { [defId: string]: DateRange[] } = {}\n let defByGroupId: { [groupId: string]: EventDef } = {}\n let bgRanges: EventRenderRange[] = []\n let fgRanges: EventRenderRange[] = []\n let eventUis = compileEventUis(eventStore.defs, eventUiBases)\n\n for (let defId in eventStore.defs) {\n let def = eventStore.defs[defId]\n\n if (def.rendering === 'inverse-background') {\n if (def.groupId) {\n inverseBgByGroupId[def.groupId] = []\n\n if (!defByGroupId[def.groupId]) {\n defByGroupId[def.groupId] = def\n }\n } else {\n inverseBgByDefId[defId] = []\n }\n }\n }\n\n for (let instanceId in eventStore.instances) {\n let instance = eventStore.instances[instanceId]\n let def = eventStore.defs[instance.defId]\n let ui = eventUis[def.defId]\n let origRange = instance.range\n\n let normalRange = (!def.allDay && nextDayThreshold) ?\n computeVisibleDayRange(origRange, nextDayThreshold) :\n origRange\n\n let slicedRange = intersectRanges(normalRange, framingRange)\n\n if (slicedRange) {\n if (def.rendering === 'inverse-background') {\n if (def.groupId) {\n inverseBgByGroupId[def.groupId].push(slicedRange)\n } else {\n inverseBgByDefId[instance.defId].push(slicedRange)\n }\n } else {\n (def.rendering === 'background' ? bgRanges : fgRanges).push({\n def,\n ui,\n instance,\n range: slicedRange,\n isStart: normalRange.start && normalRange.start.valueOf() === slicedRange.start.valueOf(),\n isEnd: normalRange.end && normalRange.end.valueOf() === slicedRange.end.valueOf()\n })\n }\n }\n }\n\n for (let groupId in inverseBgByGroupId) { // BY GROUP\n let ranges = inverseBgByGroupId[groupId]\n let invertedRanges = invertRanges(ranges, framingRange)\n\n for (let invertedRange of invertedRanges) {\n let def = defByGroupId[groupId]\n let ui = eventUis[def.defId]\n\n bgRanges.push({\n def,\n ui,\n instance: null,\n range: invertedRange,\n isStart: false,\n isEnd: false\n })\n }\n }\n\n for (let defId in inverseBgByDefId) {\n let ranges = inverseBgByDefId[defId]\n let invertedRanges = invertRanges(ranges, framingRange)\n\n for (let invertedRange of invertedRanges) {\n bgRanges.push({\n def: eventStore.defs[defId],\n ui: eventUis[defId],\n instance: null,\n range: invertedRange,\n isStart: false,\n isEnd: false\n })\n }\n }\n\n return { bg: bgRanges, fg: fgRanges }\n}\n\nexport function hasBgRendering(def: EventDef) {\n return def.rendering === 'background' || def.rendering === 'inverse-background'\n}\n\nexport function filterSegsViaEls(view: View, segs: Seg[], isMirror: boolean) {\n\n if (view.hasPublicHandlers('eventRender')) {\n segs = segs.filter(function(seg) {\n let custom = view.publiclyTrigger('eventRender', [\n {\n event: new EventApi(\n view.calendar,\n seg.eventRange.def,\n seg.eventRange.instance\n ),\n isMirror,\n isStart: seg.isStart,\n isEnd: seg.isEnd,\n // TODO: include seg.range once all components consistently generate it\n el: seg.el,\n view\n }\n ])\n\n if (custom === false) { // means don't render at all\n return false\n } else if (custom && custom !== true) {\n seg.el = custom\n }\n\n return true\n })\n }\n\n for (let seg of segs) {\n setElSeg(seg.el, seg)\n }\n\n return segs\n}\n\nfunction setElSeg(el: HTMLElement, seg: Seg) {\n (el as any).fcSeg = seg\n}\n\nexport function getElSeg(el: HTMLElement): Seg | null {\n return (el as any).fcSeg || null\n}\n\n\n// event ui computation\n\nexport function compileEventUis(eventDefs: EventDefHash, eventUiBases: EventUiHash) {\n return mapHash(eventDefs, function(eventDef: EventDef) {\n return compileEventUi(eventDef, eventUiBases)\n })\n}\n\nexport function compileEventUi(eventDef: EventDef, eventUiBases: EventUiHash) {\n let uis = []\n\n if (eventUiBases['']) {\n uis.push(eventUiBases[''])\n }\n\n if (eventUiBases[eventDef.defId]) {\n uis.push(eventUiBases[eventDef.defId])\n }\n\n uis.push(eventDef.ui)\n\n return combineEventUis(uis)\n}\n","import { Duration, asRoughMs, durationsEqual } from '../datelib/duration'\nimport { EventStore, createEmptyEventStore } from './event-store'\nimport { EventDef, EventInstance } from './event'\nimport Calendar from '../Calendar'\nimport { computeAlignedDayRange } from '../util/misc'\nimport { startOfDay } from '../datelib/marker'\nimport { EventUiHash, EventUi } from '../component/event-ui'\nimport { compileEventUis } from '../component/event-rendering'\n\n/*\nA data structure for how to modify an EventDef/EventInstance within an EventStore\n*/\n\nexport interface EventMutation {\n startDelta?: Duration\n endDelta?: Duration\n standardProps?: any // for the def. should not include extendedProps\n extendedProps?: any // for the def\n}\n\n// applies the mutation to ALL defs/instances within the event store\nexport function applyMutationToEventStore(eventStore: EventStore, eventConfigBase: EventUiHash, mutation: EventMutation, calendar: Calendar): EventStore {\n let eventConfigs = compileEventUis(eventStore.defs, eventConfigBase)\n let dest = createEmptyEventStore()\n\n for (let defId in eventStore.defs) {\n let def = eventStore.defs[defId]\n\n dest.defs[defId] = applyMutationToEventDef(def, eventConfigs[defId], mutation, calendar.pluginSystem.hooks.eventDefMutationAppliers, calendar)\n }\n\n for (let instanceId in eventStore.instances) {\n let instance = eventStore.instances[instanceId]\n let def = dest.defs[instance.defId] // important to grab the newly modified def\n\n dest.instances[instanceId] = applyMutationToEventInstance(instance, def, eventConfigs[instance.defId], mutation, calendar)\n }\n\n return dest\n}\n\nexport type eventDefMutationApplier = (eventDef: EventDef, mutation: EventMutation, calendar: Calendar) => void\n\n\nfunction applyMutationToEventDef(eventDef: EventDef, eventConfig: EventUi, mutation: EventMutation, appliers: eventDefMutationApplier[], calendar: Calendar): EventDef {\n let standardProps = mutation.standardProps || {}\n\n // if hasEnd has not been specified, guess a good value based on deltas.\n // if duration will change, there's no way the default duration will persist,\n // and thus, we need to mark the event as having a real end\n if (\n standardProps.hasEnd == null &&\n eventConfig.durationEditable &&\n willDeltasAffectDuration(\n eventConfig.startEditable ? mutation.startDelta : null,\n mutation.endDelta || null\n )\n ) {\n standardProps.hasEnd = true // TODO: is this mutation okay?\n }\n\n let copy: EventDef = {\n ...eventDef,\n ...standardProps,\n ui: { ...eventDef.ui, ...standardProps.ui } // the only prop we want to recursively overlay\n }\n\n if (mutation.extendedProps) {\n copy.extendedProps = { ...copy.extendedProps, ...mutation.extendedProps }\n }\n\n for (let applier of appliers) {\n applier(copy, mutation, calendar)\n }\n\n if (!copy.hasEnd && calendar.opt('forceEventDuration')) {\n copy.hasEnd = true\n }\n\n return copy\n}\n\nfunction willDeltasAffectDuration(startDelta: Duration | null, endDelta: Duration | null) {\n if (startDelta && !asRoughMs(startDelta)) { startDelta = null }\n if (endDelta && !asRoughMs(endDelta)) { endDelta = null }\n\n if (!startDelta && !endDelta) {\n return false\n }\n\n if (Boolean(startDelta) !== Boolean(endDelta)) {\n return true\n }\n\n return !durationsEqual(startDelta, endDelta)\n}\n\nfunction applyMutationToEventInstance(\n eventInstance: EventInstance,\n eventDef: EventDef, // must first be modified by applyMutationToEventDef\n eventConfig: EventUi,\n mutation: EventMutation,\n calendar: Calendar\n): EventInstance {\n let dateEnv = calendar.dateEnv\n let forceAllDay = mutation.standardProps && mutation.standardProps.allDay === true\n let clearEnd = mutation.standardProps && mutation.standardProps.hasEnd === false\n let copy = { ...eventInstance } as EventInstance\n\n if (forceAllDay) {\n copy.range = computeAlignedDayRange(copy.range)\n }\n\n if (mutation.startDelta && eventConfig.startEditable) {\n copy.range = {\n start: dateEnv.add(copy.range.start, mutation.startDelta),\n end: copy.range.end\n }\n }\n\n if (clearEnd) {\n copy.range = {\n start: copy.range.start,\n end: calendar.getDefaultEventEnd(eventDef.allDay, copy.range.start)\n }\n } else if (\n mutation.endDelta &&\n (\n eventConfig.durationEditable ||\n !willDeltasAffectDuration( // TODO: nonDRY logic above\n eventConfig.startEditable ? mutation.startDelta : null,\n mutation.endDelta\n )\n )\n ) {\n copy.range = {\n start: copy.range.start,\n end: dateEnv.add(copy.range.end, mutation.endDelta)\n }\n }\n\n // in case event was all-day but the supplied deltas were not\n // better util for this?\n if (eventDef.allDay) {\n copy.range = {\n start: startOfDay(copy.range.start),\n end: startOfDay(copy.range.end)\n }\n }\n\n // handle invalid durations\n if (copy.range.end < copy.range.start) {\n copy.range.end = calendar.getDefaultEventEnd(eventDef.allDay, copy.range.start)\n }\n\n return copy\n}\n","import Calendar from '../Calendar'\nimport { filterHash, mapHash } from '../util/object'\nimport { EventMutation, applyMutationToEventStore } from '../structs/event-mutation'\nimport { EventDef, EventInstance, EventInput, EventInstanceHash } from '../structs/event'\nimport {\n EventStore,\n mergeEventStores,\n getRelevantEvents,\n createEmptyEventStore,\n filterEventStoreDefs,\n parseEvents,\n expandRecurring,\n transformRawEvents\n} from '../structs/event-store'\nimport { Action } from './types'\nimport { EventSourceHash, EventSource } from '../structs/event-source'\nimport { DateRange } from '../datelib/date-range'\nimport { DateProfile } from '../DateProfileGenerator'\nimport { DateEnv } from '../datelib/env'\nimport { EventUiHash } from '../component/event-ui'\n\n\nexport default function(eventStore: EventStore, action: Action, eventSources: EventSourceHash, dateProfile: DateProfile, calendar: Calendar): EventStore {\n switch (action.type) {\n\n case 'RECEIVE_EVENTS': // raw\n return receiveRawEvents(\n eventStore,\n eventSources[action.sourceId],\n action.fetchId,\n action.fetchRange,\n action.rawEvents,\n calendar\n )\n\n case 'ADD_EVENTS': // already parsed, but not expanded\n return addEvent(\n eventStore,\n action.eventStore, // new ones\n dateProfile ? dateProfile.activeRange : null,\n calendar\n )\n\n case 'MERGE_EVENTS': // already parsed and expanded\n return mergeEventStores(eventStore, action.eventStore)\n\n case 'PREV': // TODO: how do we track all actions that affect dateProfile :(\n case 'NEXT':\n case 'SET_DATE':\n case 'SET_VIEW_TYPE':\n if (dateProfile) {\n return expandRecurring(eventStore, dateProfile.activeRange, calendar)\n } else {\n return eventStore\n }\n\n case 'CHANGE_TIMEZONE':\n return rezoneDates(eventStore, action.oldDateEnv, calendar.dateEnv)\n\n case 'MUTATE_EVENTS':\n return applyMutationToRelated(eventStore, action.instanceId, action.mutation, action.fromApi, calendar)\n\n case 'REMOVE_EVENT_INSTANCES':\n return excludeInstances(eventStore, action.instances)\n\n case 'REMOVE_EVENT_DEF':\n return filterEventStoreDefs(eventStore, function(eventDef) {\n return eventDef.defId !== action.defId\n })\n\n case 'REMOVE_EVENT_SOURCE':\n return excludeEventsBySourceId(eventStore, action.sourceId)\n\n case 'REMOVE_ALL_EVENT_SOURCES':\n return filterEventStoreDefs(eventStore, function(eventDef: EventDef) {\n return !eventDef.sourceId // only keep events with no source id\n })\n\n case 'REMOVE_ALL_EVENTS':\n return createEmptyEventStore()\n\n case 'RESET_EVENTS':\n return { // returns a new object with the same contents\n defs: eventStore.defs,\n instances: eventStore.instances\n }\n\n default:\n return eventStore\n }\n}\n\n\nfunction receiveRawEvents(\n eventStore: EventStore,\n eventSource: EventSource,\n fetchId: string,\n fetchRange: DateRange | null,\n rawEvents: EventInput[],\n calendar: Calendar\n): EventStore {\n\n if (\n eventSource && // not already removed\n fetchId === eventSource.latestFetchId // TODO: wish this logic was always in event-sources\n ) {\n\n let subset = parseEvents(\n transformRawEvents(rawEvents, eventSource, calendar),\n eventSource.sourceId,\n calendar\n )\n\n if (fetchRange) {\n subset = expandRecurring(subset, fetchRange, calendar)\n }\n\n return mergeEventStores(\n excludeEventsBySourceId(eventStore, eventSource.sourceId),\n subset\n )\n }\n\n return eventStore\n}\n\n\nfunction addEvent(eventStore: EventStore, subset: EventStore, expandRange: DateRange | null, calendar: Calendar): EventStore {\n\n if (expandRange) {\n subset = expandRecurring(subset, expandRange, calendar)\n }\n\n return mergeEventStores(eventStore, subset)\n}\n\n\nfunction rezoneDates(eventStore: EventStore, oldDateEnv: DateEnv, newDateEnv: DateEnv): EventStore {\n let defs = eventStore.defs\n\n let instances = mapHash(eventStore.instances, function(instance: EventInstance): EventInstance {\n let def = defs[instance.defId]\n\n if (def.allDay || def.recurringDef) {\n return instance // isn't dependent on timezone\n } else {\n return {\n ...instance,\n range: {\n start: newDateEnv.createMarker(oldDateEnv.toDate(instance.range.start, instance.forcedStartTzo)),\n end: newDateEnv.createMarker(oldDateEnv.toDate(instance.range.end, instance.forcedEndTzo))\n },\n forcedStartTzo: newDateEnv.canComputeOffset ? null : instance.forcedStartTzo,\n forcedEndTzo: newDateEnv.canComputeOffset ? null : instance.forcedEndTzo\n }\n }\n })\n\n return { defs, instances }\n}\n\n\nfunction applyMutationToRelated(eventStore: EventStore, instanceId: string, mutation: EventMutation, fromApi: boolean, calendar: Calendar): EventStore {\n let relevant = getRelevantEvents(eventStore, instanceId)\n let eventConfigBase = fromApi ?\n { '': { // HACK. always allow API to mutate events\n startEditable: true,\n durationEditable: true,\n constraints: [],\n overlap: null,\n allows: [],\n backgroundColor: '',\n borderColor: '',\n textColor: '',\n classNames: []\n } } as EventUiHash :\n calendar.eventUiBases\n\n\n relevant = applyMutationToEventStore(relevant, eventConfigBase, mutation, calendar)\n\n return mergeEventStores(eventStore, relevant)\n}\n\n\nfunction excludeEventsBySourceId(eventStore, sourceId) {\n return filterEventStoreDefs(eventStore, function(eventDef: EventDef) {\n return eventDef.sourceId !== sourceId\n })\n}\n\n\n// QUESTION: why not just return instances? do a general object-property-exclusion util\nexport function excludeInstances(eventStore: EventStore, removals: EventInstanceHash): EventStore {\n return {\n defs: eventStore.defs,\n instances: filterHash(eventStore.instances, function(instance: EventInstance) {\n return !removals[instance.instanceId]\n })\n }\n}\n","import { EventStore, expandRecurring, filterEventStoreDefs, parseEvents, createEmptyEventStore } from './structs/event-store'\nimport Calendar from './Calendar'\nimport { DateSpan, DateSpanApi } from './structs/date-span'\nimport { rangeContainsRange, rangesIntersect, DateRange, OpenDateRange } from './datelib/date-range'\nimport EventApi from './api/EventApi'\nimport { compileEventUis } from './component/event-rendering'\nimport { excludeInstances } from './reducers/eventStore'\nimport { EventInput } from './structs/event'\nimport { EventInteractionState } from './interactions/event-interaction-state'\nimport { SplittableProps } from './component/event-splitting'\nimport { mapHash } from './util/object'\n\n// TODO: rename to \"criteria\" ?\nexport type ConstraintInput = 'businessHours' | string | EventInput | EventInput[]\nexport type Constraint = 'businessHours' | string | EventStore | false // false means won't pass at all\nexport type OverlapFunc = ((stillEvent: EventApi, movingEvent: EventApi | null) => boolean)\nexport type AllowFunc = (span: DateSpanApi, movingEvent: EventApi | null) => boolean\nexport type isPropsValidTester = (props: SplittableProps, calendar: Calendar) => boolean\n\n\n// high-level segmenting-aware tester functions\n// ------------------------------------------------------------------------------------------------------------------------\n\nexport function isInteractionValid(interaction: EventInteractionState, calendar: Calendar) {\n return isNewPropsValid({ eventDrag: interaction }, calendar) // HACK: the eventDrag props is used for ALL interactions\n}\n\nexport function isDateSelectionValid(dateSelection: DateSpan, calendar: Calendar) {\n return isNewPropsValid({ dateSelection }, calendar)\n}\n\nfunction isNewPropsValid(newProps, calendar: Calendar) {\n let view = calendar.view\n\n let props = {\n businessHours: view ? view.props.businessHours : createEmptyEventStore(), // why? yuck\n dateSelection: '',\n eventStore: calendar.state.eventStore,\n eventUiBases: calendar.eventUiBases,\n eventSelection: '',\n eventDrag: null,\n eventResize: null,\n ...newProps\n }\n\n return (calendar.pluginSystem.hooks.isPropsValid || isPropsValid)(props, calendar)\n}\n\nexport function isPropsValid(state: SplittableProps, calendar: Calendar, dateSpanMeta = {}, filterConfig?): boolean {\n\n if (state.eventDrag && !isInteractionPropsValid(state, calendar, dateSpanMeta, filterConfig)) {\n return false\n }\n\n if (state.dateSelection && !isDateSelectionPropsValid(state, calendar, dateSpanMeta, filterConfig)) {\n return false\n }\n\n return true\n}\n\n\n// Moving Event Validation\n// ------------------------------------------------------------------------------------------------------------------------\n\nfunction isInteractionPropsValid(state: SplittableProps, calendar: Calendar, dateSpanMeta: any, filterConfig): boolean {\n let interaction = state.eventDrag // HACK: the eventDrag props is used for ALL interactions\n\n let subjectEventStore = interaction.mutatedEvents\n let subjectDefs = subjectEventStore.defs\n let subjectInstances = subjectEventStore.instances\n let subjectConfigs = compileEventUis(\n subjectDefs,\n interaction.isEvent ?\n state.eventUiBases :\n { '': calendar.selectionConfig } // if not a real event, validate as a selection\n )\n\n if (filterConfig) {\n subjectConfigs = mapHash(subjectConfigs, filterConfig)\n }\n\n let otherEventStore = excludeInstances(state.eventStore, interaction.affectedEvents.instances) // exclude the subject events. TODO: exclude defs too?\n let otherDefs = otherEventStore.defs\n let otherInstances = otherEventStore.instances\n let otherConfigs = compileEventUis(otherDefs, state.eventUiBases)\n\n for (let subjectInstanceId in subjectInstances) {\n let subjectInstance = subjectInstances[subjectInstanceId]\n let subjectRange = subjectInstance.range\n let subjectConfig = subjectConfigs[subjectInstance.defId]\n let subjectDef = subjectDefs[subjectInstance.defId]\n\n // constraint\n if (!allConstraintsPass(subjectConfig.constraints, subjectRange, otherEventStore, state.businessHours, calendar)) {\n return false\n }\n\n // overlap\n\n let overlapFunc = calendar.opt('eventOverlap')\n if (typeof overlapFunc !== 'function') { overlapFunc = null }\n\n for (let otherInstanceId in otherInstances) {\n let otherInstance = otherInstances[otherInstanceId]\n\n // intersect! evaluate\n if (rangesIntersect(subjectRange, otherInstance.range)) {\n let otherOverlap = otherConfigs[otherInstance.defId].overlap\n\n // consider the other event's overlap. only do this if the subject event is a \"real\" event\n if (otherOverlap === false && interaction.isEvent) {\n return false\n }\n\n if (subjectConfig.overlap === false) {\n return false\n }\n\n if (overlapFunc && !overlapFunc(\n new EventApi(calendar, otherDefs[otherInstance.defId], otherInstance), // still event\n new EventApi(calendar, subjectDef, subjectInstance) // moving event\n )) {\n return false\n }\n }\n }\n\n // allow (a function)\n for (let subjectAllow of subjectConfig.allows) {\n\n let subjectDateSpan: DateSpan = {\n ...dateSpanMeta,\n range: subjectInstance.range,\n allDay: subjectDef.allDay\n }\n\n let origDef = state.eventStore.defs[subjectDef.defId]\n let origInstance = state.eventStore.instances[subjectInstanceId]\n let eventApi\n\n if (origDef) { // was previously in the calendar\n eventApi = new EventApi(calendar, origDef, origInstance)\n } else { // was an external event\n eventApi = new EventApi(calendar, subjectDef) // no instance, because had no dates\n }\n\n if (!subjectAllow(\n calendar.buildDateSpanApi(subjectDateSpan),\n eventApi\n )) {\n return false\n }\n }\n\n }\n\n return true\n}\n\n\n// Date Selection Validation\n// ------------------------------------------------------------------------------------------------------------------------\n\nfunction isDateSelectionPropsValid(state: SplittableProps, calendar: Calendar, dateSpanMeta: any, filterConfig): boolean {\n let relevantEventStore = state.eventStore\n let relevantDefs = relevantEventStore.defs\n let relevantInstances = relevantEventStore.instances\n\n let selection = state.dateSelection\n let selectionRange = selection.range\n let { selectionConfig } = calendar\n\n if (filterConfig) {\n selectionConfig = filterConfig(selectionConfig)\n }\n\n // constraint\n if (!allConstraintsPass(selectionConfig.constraints, selectionRange, relevantEventStore, state.businessHours, calendar)) {\n return false\n }\n\n // overlap\n\n let overlapFunc = calendar.opt('selectOverlap')\n if (typeof overlapFunc !== 'function') { overlapFunc = null }\n\n for (let relevantInstanceId in relevantInstances) {\n let relevantInstance = relevantInstances[relevantInstanceId]\n\n // intersect! evaluate\n if (rangesIntersect(selectionRange, relevantInstance.range)) {\n\n if (selectionConfig.overlap === false) {\n return false\n }\n\n if (overlapFunc && !overlapFunc(\n new EventApi(calendar, relevantDefs[relevantInstance.defId], relevantInstance)\n )) {\n return false\n }\n }\n }\n\n // allow (a function)\n for (let selectionAllow of selectionConfig.allows) {\n\n let fullDateSpan = { ...dateSpanMeta, ...selection }\n\n if (!selectionAllow(\n calendar.buildDateSpanApi(fullDateSpan),\n null\n )) {\n return false\n }\n }\n\n return true\n}\n\n\n// Constraint Utils\n// ------------------------------------------------------------------------------------------------------------------------\n\nfunction allConstraintsPass(\n constraints: Constraint[],\n subjectRange: DateRange,\n otherEventStore: EventStore,\n businessHoursUnexpanded: EventStore,\n calendar: Calendar\n): boolean {\n for (let constraint of constraints) {\n if (!anyRangesContainRange(\n constraintToRanges(constraint, subjectRange, otherEventStore, businessHoursUnexpanded, calendar),\n subjectRange\n )) {\n return false\n }\n }\n\n return true\n}\n\nfunction constraintToRanges(\n constraint: Constraint,\n subjectRange: DateRange, // for expanding a recurring constraint, or expanding business hours\n otherEventStore: EventStore, // for if constraint is an even group ID\n businessHoursUnexpanded: EventStore, // for if constraint is 'businessHours'\n calendar: Calendar // for expanding businesshours\n): OpenDateRange[] {\n\n if (constraint === 'businessHours') {\n return eventStoreToRanges(\n expandRecurring(businessHoursUnexpanded, subjectRange, calendar)\n )\n\n } else if (typeof constraint === 'string') { // an group ID\n return eventStoreToRanges(\n filterEventStoreDefs(otherEventStore, function(eventDef) {\n return eventDef.groupId === constraint\n })\n )\n\n } else if (typeof constraint === 'object' && constraint) { // non-null object\n return eventStoreToRanges(\n expandRecurring(constraint, subjectRange, calendar)\n )\n }\n\n return [] // if it's false\n}\n\n// TODO: move to event-store file?\nfunction eventStoreToRanges(eventStore: EventStore): DateRange[] {\n let { instances } = eventStore\n let ranges: DateRange[] = []\n\n for (let instanceId in instances) {\n ranges.push(instances[instanceId].range)\n }\n\n return ranges\n}\n\n// TODO: move to geom file?\nfunction anyRangesContainRange(outerRanges: DateRange[], innerRange: DateRange): boolean {\n\n for (let outerRange of outerRanges) {\n if (rangeContainsRange(outerRange, innerRange)) {\n return true\n }\n }\n\n return false\n}\n\n\n// Parsing\n// ------------------------------------------------------------------------------------------------------------------------\n\nexport function normalizeConstraint(input: ConstraintInput, calendar: Calendar): Constraint | null {\n if (Array.isArray(input)) {\n return parseEvents(input, '', calendar, true) // allowOpenRange=true\n\n } else if (typeof input === 'object' && input) { // non-null object\n return parseEvents([ input ], '', calendar, true) // allowOpenRange=true\n\n } else if (input != null) {\n return String(input)\n\n } else {\n return null\n }\n}\n","\nexport function htmlEscape(s) {\n return (s + '').replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/'/g, ''')\n .replace(/\"/g, '"')\n .replace(/\\n/g, '
')\n}\n\n\n// Given a hash of CSS properties, returns a string of CSS.\n// Uses property names as-is (no camel-case conversion). Will not make statements for null/undefined values.\nexport function cssToStr(cssProps) {\n let statements = []\n\n for (let name in cssProps) {\n let val = cssProps[name]\n if (val != null && val !== '') {\n statements.push(name + ':' + val)\n }\n }\n\n return statements.join(';')\n}\n\n\n// Given an object hash of HTML attribute names to values,\n// generates a string that can be injected between < > in HTML\nexport function attrsToStr(attrs) {\n let parts = []\n\n for (let name in attrs) {\n let val = attrs[name]\n if (val != null) {\n parts.push(name + '=\"' + htmlEscape(val) + '\"')\n }\n }\n\n return parts.join(' ')\n}\n\n\nexport type ClassNameInput = string | string[]\n\nexport function parseClassName(raw: ClassNameInput) {\n if (Array.isArray(raw)) {\n return raw\n } else if (typeof raw === 'string') {\n return raw.split(/\\s+/)\n } else {\n return []\n }\n}\n","import { Constraint, AllowFunc, normalizeConstraint, ConstraintInput } from '../validation'\nimport { parseClassName } from '../util/html'\nimport { refineProps, capitaliseFirstLetter } from '../util/misc'\nimport Calendar from '../Calendar'\n\n// TODO: better called \"EventSettings\" or \"EventConfig\"\n// TODO: move this file into structs\n// TODO: separate constraint/overlap/allow, because selection uses only that, not other props\n\nexport interface UnscopedEventUiInput {\n editable?: boolean\n startEditable?: boolean\n durationEditable?: boolean\n constraint?: ConstraintInput\n overlap?: boolean\n allow?: AllowFunc\n className?: string[] | string\n classNames?: string[] | string\n backgroundColor?: string\n borderColor?: string\n textColor?: string\n color?: string\n}\n\nexport interface EventUi {\n startEditable: boolean | null\n durationEditable: boolean | null\n constraints: Constraint[]\n overlap: boolean | null\n allows: AllowFunc[]\n backgroundColor: string\n borderColor: string\n textColor: string,\n classNames: string[]\n}\n\nexport type EventUiHash = { [defId: string]: EventUi }\n\nexport const UNSCOPED_EVENT_UI_PROPS = {\n editable: Boolean,\n startEditable: Boolean,\n durationEditable: Boolean,\n constraint: null,\n overlap: null,\n allow: null,\n className: parseClassName,\n classNames: parseClassName,\n color: String,\n backgroundColor: String,\n borderColor: String,\n textColor: String\n}\n\nexport function processUnscopedUiProps(rawProps: UnscopedEventUiInput, calendar: Calendar, leftovers?): EventUi {\n let props = refineProps(rawProps, UNSCOPED_EVENT_UI_PROPS, {}, leftovers)\n let constraint = normalizeConstraint(props.constraint, calendar)\n\n return {\n startEditable: props.startEditable != null ? props.startEditable : props.editable,\n durationEditable: props.durationEditable != null ? props.durationEditable : props.editable,\n constraints: constraint != null ? [ constraint ] : [],\n overlap: props.overlap,\n allows: props.allow != null ? [ props.allow ] : [],\n backgroundColor: props.backgroundColor || props.color,\n borderColor: props.borderColor || props.color,\n textColor: props.textColor,\n classNames: props.classNames.concat(props.className)\n }\n}\n\nexport function processScopedUiProps(prefix: string, rawScoped: any, calendar: Calendar, leftovers?): EventUi {\n let rawUnscoped = {} as any\n let wasFound = {} as any\n\n for (let key in UNSCOPED_EVENT_UI_PROPS) {\n let scopedKey = prefix + capitaliseFirstLetter(key)\n rawUnscoped[key] = rawScoped[scopedKey]\n wasFound[scopedKey] = true\n }\n\n if (prefix === 'event') {\n rawUnscoped.editable = rawScoped.editable // special case. there is no 'eventEditable', just 'editable'\n }\n\n if (leftovers) {\n for (let key in rawScoped) {\n if (!wasFound[key]) {\n leftovers[key] = rawScoped[key]\n }\n }\n }\n\n return processUnscopedUiProps(rawUnscoped, calendar)\n}\n\nconst EMPTY_EVENT_UI: EventUi = {\n startEditable: null,\n durationEditable: null,\n constraints: [],\n overlap: null,\n allows: [],\n backgroundColor: '',\n borderColor: '',\n textColor: '',\n classNames: []\n}\n\n// prevent against problems with <2 args!\nexport function combineEventUis(uis: EventUi[]): EventUi {\n return uis.reduce(combineTwoEventUis, EMPTY_EVENT_UI)\n}\n\nfunction combineTwoEventUis(item0: EventUi, item1: EventUi): EventUi { // hash1 has higher precedence\n return {\n startEditable: item1.startEditable != null ? item1.startEditable : item0.startEditable,\n durationEditable: item1.durationEditable != null ? item1.durationEditable : item0.durationEditable,\n constraints: item0.constraints.concat(item1.constraints),\n overlap: typeof item1.overlap === 'boolean' ? item1.overlap : item0.overlap,\n allows: item0.allows.concat(item1.allows),\n backgroundColor: item1.backgroundColor || item0.backgroundColor,\n borderColor: item1.borderColor || item0.borderColor,\n textColor: item1.textColor || item0.textColor,\n classNames: item0.classNames.concat(item1.classNames)\n }\n}\n","import { refineProps } from '../util/misc'\nimport { DateInput } from '../datelib/env'\nimport Calendar from '../Calendar'\nimport { DateRange } from '../datelib/date-range'\nimport { startOfDay } from '../datelib/marker'\nimport { parseRecurring } from './recurring-event'\nimport { Duration } from '../datelib/duration'\nimport { UnscopedEventUiInput, EventUi, processUnscopedUiProps } from '../component/event-ui'\nimport { __assign } from 'tslib'\n\n/*\nUtils for parsing event-input data. Each util parses a subset of the event-input's data.\nIt's up to the caller to stitch them together into an aggregate object like an EventStore.\n*/\n\nexport type EventRenderingChoice = '' | 'background' | 'inverse-background' | 'none'\n\nexport interface EventNonDateInput extends UnscopedEventUiInput {\n id?: string | number\n groupId?: string | number\n title?: string\n url?: string\n rendering?: EventRenderingChoice\n extendedProps?: object\n [extendedProp: string]: any\n}\n\nexport interface EventDateInput {\n start?: DateInput\n end?: DateInput\n date?: DateInput\n allDay?: boolean\n}\n\nexport type EventInput = EventNonDateInput & EventDateInput\n\nexport interface EventDef {\n defId: string\n sourceId: string\n publicId: string\n groupId: string\n allDay: boolean\n hasEnd: boolean\n recurringDef: { typeId: number, typeData: any, duration: Duration | null } | null\n title: string\n url: string\n rendering: EventRenderingChoice\n ui: EventUi\n extendedProps: any\n}\n\nexport interface EventInstance {\n instanceId: string\n defId: string\n range: DateRange\n forcedStartTzo: number | null\n forcedEndTzo: number | null\n}\n\nexport interface EventTuple {\n def: EventDef\n instance: EventInstance | null\n}\n\nexport type EventInstanceHash = { [instanceId: string]: EventInstance }\nexport type EventDefHash = { [defId: string]: EventDef }\n\nexport const NON_DATE_PROPS = {\n id: String,\n groupId: String,\n title: String,\n url: String,\n rendering: String,\n extendedProps: null\n}\n\nexport const DATE_PROPS = {\n start: null,\n date: null, // alias for start\n end: null,\n allDay: null\n}\n\nlet uid = 0\n\n\nexport function parseEvent(raw: EventInput, sourceId: string, calendar: Calendar, allowOpenRange?: boolean): EventTuple | null {\n let allDayDefault = computeIsAllDayDefault(sourceId, calendar)\n let leftovers0 = {}\n let recurringRes = parseRecurring(\n raw, // raw, but with single-event stuff stripped out\n allDayDefault,\n calendar.dateEnv,\n calendar.pluginSystem.hooks.recurringTypes,\n leftovers0 // will populate with non-recurring props\n )\n\n if (recurringRes) {\n let def = parseEventDef(leftovers0, sourceId, recurringRes.allDay, Boolean(recurringRes.duration), calendar)\n\n def.recurringDef = { // don't want all the props from recurringRes. TODO: more efficient way to do this\n typeId: recurringRes.typeId,\n typeData: recurringRes.typeData,\n duration: recurringRes.duration\n }\n\n return { def, instance: null }\n\n } else {\n let leftovers1 = {}\n let singleRes = parseSingle(raw, allDayDefault, calendar, leftovers1, allowOpenRange)\n\n if (singleRes) {\n let def = parseEventDef(leftovers1, sourceId, singleRes.allDay, singleRes.hasEnd, calendar)\n let instance = createEventInstance(def.defId, singleRes.range, singleRes.forcedStartTzo, singleRes.forcedEndTzo)\n\n return { def, instance }\n }\n }\n\n return null\n}\n\n\n/*\nWill NOT populate extendedProps with the leftover properties.\nWill NOT populate date-related props.\nThe EventNonDateInput has been normalized (id => publicId, etc).\n*/\nexport function parseEventDef(raw: EventNonDateInput, sourceId: string, allDay: boolean, hasEnd: boolean, calendar: Calendar): EventDef {\n let leftovers = {}\n let def = pluckNonDateProps(raw, calendar, leftovers) as EventDef\n\n def.defId = String(uid++)\n def.sourceId = sourceId\n def.allDay = allDay\n def.hasEnd = hasEnd\n\n for (let eventDefParser of calendar.pluginSystem.hooks.eventDefParsers) {\n let newLeftovers = {}\n eventDefParser(def, leftovers, newLeftovers)\n leftovers = newLeftovers\n }\n\n def.extendedProps = __assign(leftovers, def.extendedProps || {})\n\n // help out EventApi from having user modify props\n Object.freeze(def.ui.classNames)\n Object.freeze(def.extendedProps)\n\n return def\n}\n\nexport type eventDefParserFunc = (def: EventDef, props: any, leftovers: any) => void\n\n\nexport function createEventInstance(\n defId: string,\n range: DateRange,\n forcedStartTzo?: number,\n forcedEndTzo?: number\n): EventInstance {\n return {\n instanceId: String(uid++),\n defId,\n range,\n forcedStartTzo: forcedStartTzo == null ? null : forcedStartTzo,\n forcedEndTzo: forcedEndTzo == null ? null : forcedEndTzo\n }\n}\n\n\nfunction parseSingle(raw: EventInput, allDayDefault: boolean | null, calendar: Calendar, leftovers?, allowOpenRange?: boolean) {\n let props = pluckDateProps(raw, leftovers)\n let allDay = props.allDay\n let startMeta\n let startMarker = null\n let hasEnd = false\n let endMeta\n let endMarker = null\n\n startMeta = calendar.dateEnv.createMarkerMeta(props.start)\n\n if (startMeta) {\n startMarker = startMeta.marker\n } else if (!allowOpenRange) {\n return null\n }\n\n if (props.end != null) {\n endMeta = calendar.dateEnv.createMarkerMeta(props.end)\n }\n\n if (allDay == null) {\n if (allDayDefault != null) {\n allDay = allDayDefault\n } else {\n // fall back to the date props LAST\n allDay = (!startMeta || startMeta.isTimeUnspecified) &&\n (!endMeta || endMeta.isTimeUnspecified)\n }\n }\n\n if (allDay && startMarker) {\n startMarker = startOfDay(startMarker)\n }\n\n if (endMeta) {\n endMarker = endMeta.marker\n\n if (allDay) {\n endMarker = startOfDay(endMarker)\n }\n\n if (startMarker && endMarker <= startMarker) {\n endMarker = null\n }\n }\n\n if (endMarker) {\n hasEnd = true\n } else if (!allowOpenRange) {\n hasEnd = calendar.opt('forceEventDuration') || false\n\n endMarker = calendar.dateEnv.add(\n startMarker,\n allDay ?\n calendar.defaultAllDayEventDuration :\n calendar.defaultTimedEventDuration\n )\n }\n\n return {\n allDay,\n hasEnd,\n range: { start: startMarker, end: endMarker },\n forcedStartTzo: startMeta ? startMeta.forcedTzo : null,\n forcedEndTzo: endMeta ? endMeta.forcedTzo : null\n }\n}\n\n\nfunction pluckDateProps(raw: EventInput, leftovers: any) {\n let props = refineProps(raw, DATE_PROPS, {}, leftovers)\n\n props.start = (props.start !== null) ? props.start : props.date\n delete props.date\n\n return props\n}\n\n\nfunction pluckNonDateProps(raw: EventInput, calendar: Calendar, leftovers?) {\n let preLeftovers = {}\n let props = refineProps(raw, NON_DATE_PROPS, {}, preLeftovers)\n let ui = processUnscopedUiProps(preLeftovers, calendar, leftovers)\n\n props.publicId = props.id\n delete props.id\n\n props.ui = ui\n\n return props\n}\n\n\nfunction computeIsAllDayDefault(sourceId: string, calendar: Calendar): boolean | null {\n let res = null\n\n if (sourceId) {\n let source = calendar.state.eventSources[sourceId]\n res = source.allDayDefault\n }\n\n if (res == null) {\n res = calendar.opt('allDayDefault')\n }\n\n return res\n}\n","import Calendar from '../Calendar'\n\nimport { EventInput } from './event'\nimport { EventStore, parseEvents } from './event-store'\n\n/*\nUtils for converting raw business hour input into an EventStore,\nfor both rendering and the constraint system.\n*/\n\nexport type BusinessHoursInput = boolean | EventInput | EventInput[]\n\nconst DEF_DEFAULTS = {\n startTime: '09:00',\n endTime: '17:00',\n daysOfWeek: [ 1, 2, 3, 4, 5 ], // monday - friday\n rendering: 'inverse-background',\n classNames: 'fc-nonbusiness',\n groupId: '_businessHours' // so multiple defs get grouped\n}\n\n/*\nTODO: pass around as EventDefHash!!!\n*/\nexport function parseBusinessHours(input: BusinessHoursInput, calendar: Calendar): EventStore {\n return parseEvents(\n refineInputs(input),\n '',\n calendar\n )\n}\n\nfunction refineInputs(input: BusinessHoursInput) {\n let rawDefs\n\n if (input === true) {\n rawDefs = [ {} ] // will get DEF_DEFAULTS verbatim\n } else if (Array.isArray(input)) {\n // if specifying an array, every sub-definition NEEDS a day-of-week\n rawDefs = input.filter(function(rawDef) {\n return rawDef.daysOfWeek\n })\n } else if (typeof input === 'object' && input) { // non-null object\n rawDefs = [ input ]\n } else { // is probably false\n rawDefs = []\n }\n\n rawDefs = rawDefs.map(function(rawDef) {\n return { ...DEF_DEFAULTS, ...rawDef }\n })\n\n return rawDefs\n}\n","import { isArraysEqual } from '../util/array'\n\nexport interface MemoizedRendering {\n (...args: ArgsType): void\n unrender: () => void\n dependents: MemoizedRendering[]\n}\n\nexport function memoizeRendering(\n renderFunc: (...args: ArgsType) => void,\n unrenderFunc?: (...args: ArgsType) => void,\n dependencies: MemoizedRendering[] = []\n): MemoizedRendering {\n\n let dependents: MemoizedRendering[] = []\n let thisContext\n let prevArgs\n\n function unrender() {\n if (prevArgs) {\n\n for (let dependent of dependents) {\n dependent.unrender()\n }\n\n if (unrenderFunc) {\n unrenderFunc.apply(thisContext, prevArgs)\n }\n\n prevArgs = null\n }\n }\n\n function res() {\n if (!prevArgs || !isArraysEqual(prevArgs, arguments)) {\n unrender()\n thisContext = this\n prevArgs = arguments\n renderFunc.apply(this, arguments)\n }\n }\n\n res.dependents = dependents\n res.unrender = unrender\n\n for (let dependency of dependencies) {\n dependency.dependents.push(res)\n }\n\n return res\n}\n","import { EventStore, createEmptyEventStore } from '../structs/event-store'\nimport { EventDef } from '../structs/event'\nimport { EventInteractionState } from '../interactions/event-interaction-state'\nimport { mapHash } from '../util/object'\nimport { memoize } from '../util/memoize'\nimport { EventUiHash, EventUi, combineEventUis } from './event-ui'\nimport { DateSpan } from '../structs/date-span'\nimport { __assign } from 'tslib'\n\nexport interface SplittableProps {\n businessHours: EventStore | null // is this really allowed to be null?\n dateSelection: DateSpan | null\n eventStore: EventStore\n eventUiBases: EventUiHash\n eventSelection: string\n eventDrag: EventInteractionState | null\n eventResize: EventInteractionState | null\n}\n\nconst EMPTY_EVENT_STORE = createEmptyEventStore() // for purecomponents. TODO: keep elsewhere\n\nexport default abstract class Splitter {\n\n private getKeysForEventDefs = memoize(this._getKeysForEventDefs)\n private splitDateSelection = memoize(this._splitDateSpan)\n private splitEventStore = memoize(this._splitEventStore)\n private splitIndividualUi = memoize(this._splitIndividualUi)\n private splitEventDrag = memoize(this._splitInteraction)\n private splitEventResize = memoize(this._splitInteraction)\n private eventUiBuilders = {} // TODO: typescript protection\n\n abstract getKeyInfo(props: PropsType): { [key: string]: { ui?: EventUi, businessHours?: EventStore } }\n abstract getKeysForDateSpan(dateSpan: DateSpan): string[]\n abstract getKeysForEventDef(eventDef: EventDef): string[]\n\n splitProps(props: PropsType): { [key: string]: SplittableProps } {\n\n let keyInfos = this.getKeyInfo(props)\n let defKeys = this.getKeysForEventDefs(props.eventStore)\n let dateSelections = this.splitDateSelection(props.dateSelection)\n let individualUi = this.splitIndividualUi(props.eventUiBases, defKeys) // the individual *bases*\n let eventStores = this.splitEventStore(props.eventStore, defKeys)\n let eventDrags = this.splitEventDrag(props.eventDrag)\n let eventResizes = this.splitEventResize(props.eventResize)\n let splitProps: { [key: string]: SplittableProps } = {}\n\n this.eventUiBuilders = mapHash(keyInfos, (info, key) => {\n return this.eventUiBuilders[key] || memoize(buildEventUiForKey)\n })\n\n for (let key in keyInfos) {\n let keyInfo = keyInfos[key]\n let eventStore = eventStores[key] || EMPTY_EVENT_STORE\n let buildEventUi = this.eventUiBuilders[key]\n\n splitProps[key] = {\n businessHours: keyInfo.businessHours || props.businessHours,\n dateSelection: dateSelections[key] || null,\n eventStore,\n eventUiBases: buildEventUi(props.eventUiBases[''], keyInfo.ui, individualUi[key]),\n eventSelection: eventStore.instances[props.eventSelection] ? props.eventSelection : '',\n eventDrag: eventDrags[key] || null,\n eventResize: eventResizes[key] || null\n }\n }\n\n return splitProps\n }\n\n private _splitDateSpan(dateSpan: DateSpan | null) {\n let dateSpans = {}\n\n if (dateSpan) {\n let keys = this.getKeysForDateSpan(dateSpan)\n\n for (let key of keys) {\n dateSpans[key] = dateSpan\n }\n }\n\n return dateSpans\n }\n\n private _getKeysForEventDefs(eventStore: EventStore) {\n return mapHash(eventStore.defs, (eventDef: EventDef) => {\n return this.getKeysForEventDef(eventDef)\n })\n }\n\n private _splitEventStore(eventStore: EventStore, defKeys): { [key: string]: EventStore } {\n let { defs, instances } = eventStore\n let splitStores = {}\n\n for (let defId in defs) {\n for (let key of defKeys[defId]) {\n\n if (!splitStores[key]) {\n splitStores[key] = createEmptyEventStore()\n }\n\n splitStores[key].defs[defId] = defs[defId]\n }\n }\n\n for (let instanceId in instances) {\n let instance = instances[instanceId]\n\n for (let key of defKeys[instance.defId]) {\n\n if (splitStores[key]) { // must have already been created\n splitStores[key].instances[instanceId] = instance\n }\n }\n }\n\n return splitStores\n }\n\n private _splitIndividualUi(eventUiBases: EventUiHash, defKeys): { [key: string]: EventUiHash } {\n let splitHashes: { [key: string]: EventUiHash } = {}\n\n for (let defId in eventUiBases) {\n if (defId) { // not the '' key\n for (let key of defKeys[defId]) {\n\n if (!splitHashes[key]) {\n splitHashes[key] = {}\n }\n\n splitHashes[key][defId] = eventUiBases[defId]\n }\n }\n }\n\n return splitHashes\n }\n\n private _splitInteraction(interaction: EventInteractionState | null): { [key: string]: EventInteractionState } {\n let splitStates: { [key: string]: EventInteractionState } = {}\n\n if (interaction) {\n let affectedStores = this._splitEventStore(\n interaction.affectedEvents,\n this._getKeysForEventDefs(interaction.affectedEvents) // can't use cached. might be events from other calendar\n )\n\n // can't rely on defKeys because event data is mutated\n let mutatedKeysByDefId = this._getKeysForEventDefs(interaction.mutatedEvents)\n let mutatedStores = this._splitEventStore(interaction.mutatedEvents, mutatedKeysByDefId)\n\n let populate = function(key) {\n if (!splitStates[key]) {\n splitStates[key] = {\n affectedEvents: affectedStores[key] || EMPTY_EVENT_STORE,\n mutatedEvents: mutatedStores[key] || EMPTY_EVENT_STORE,\n isEvent: interaction.isEvent,\n origSeg: interaction.origSeg\n }\n }\n }\n\n for (let key in affectedStores) {\n populate(key)\n }\n\n for (let key in mutatedStores) {\n populate(key)\n }\n }\n\n return splitStates\n }\n\n}\n\nfunction buildEventUiForKey(allUi: EventUi | null, eventUiForKey: EventUi | null, individualUi: EventUiHash | null) {\n let baseParts = []\n\n if (allUi) {\n baseParts.push(allUi)\n }\n\n if (eventUiForKey) {\n baseParts.push(eventUiForKey)\n }\n\n let stuff = {\n '': combineEventUis(baseParts)\n }\n\n if (individualUi) {\n __assign(stuff, individualUi)\n }\n\n return stuff\n}\n","import { htmlEscape, attrsToStr } from '../util/html'\nimport { DateMarker, startOfDay, addDays, DAY_IDS } from '../datelib/marker'\nimport { rangeContainsMarker } from '../datelib/date-range'\nimport Component, { ComponentContext } from '../component/Component'\nimport { DateProfile } from '../DateProfileGenerator'\n\n\n// Generates HTML for an anchor to another view into the calendar.\n// Will either generate an tag or a non-clickable tag, depending on enabled settings.\n// `gotoOptions` can either be a DateMarker, or an object with the form:\n// { date, type, forceOff }\n// `type` is a view-type like \"day\" or \"week\". default value is \"day\".\n// `attrs` and `innerHtml` are use to generate the rest of the HTML tag.\nexport function buildGotoAnchorHtml(component: Component, gotoOptions, attrs, innerHtml?) {\n let { dateEnv } = component\n let date\n let type\n let forceOff\n let finalOptions\n\n if (gotoOptions instanceof Date) {\n date = gotoOptions // a single date-like input\n } else {\n date = gotoOptions.date\n type = gotoOptions.type\n forceOff = gotoOptions.forceOff\n }\n\n finalOptions = { // for serialization into the link\n date: dateEnv.formatIso(date, { omitTime: true }),\n type: type || 'day'\n }\n\n if (typeof attrs === 'string') {\n innerHtml = attrs\n attrs = null\n }\n\n attrs = attrs ? ' ' + attrsToStr(attrs) : '' // will have a leading space\n innerHtml = innerHtml || ''\n\n if (!forceOff && component.opt('navLinks')) {\n return '' +\n innerHtml +\n ''\n } else {\n return '' +\n innerHtml +\n ''\n }\n}\n\n\nexport function getAllDayHtml(component: Component) {\n return component.opt('allDayHtml') || htmlEscape(component.opt('allDayText'))\n}\n\n\n// Computes HTML classNames for a single-day element\nexport function getDayClasses(date: DateMarker, dateProfile: DateProfile, context: ComponentContext, noThemeHighlight?) {\n let { calendar, view, theme, dateEnv } = context\n let classes = []\n let todayStart: DateMarker\n let todayEnd: DateMarker\n\n if (!rangeContainsMarker(dateProfile.activeRange, date)) {\n classes.push('fc-disabled-day')\n } else {\n classes.push('fc-' + DAY_IDS[date.getUTCDay()])\n\n if (\n view.opt('monthMode') &&\n dateEnv.getMonth(date) !== dateEnv.getMonth(dateProfile.currentRange.start)\n ) {\n classes.push('fc-other-month')\n }\n\n todayStart = startOfDay(calendar.getNow())\n todayEnd = addDays(todayStart, 1)\n\n if (date < todayStart) {\n classes.push('fc-past')\n } else if (date >= todayEnd) {\n classes.push('fc-future')\n } else {\n classes.push('fc-today')\n\n if (noThemeHighlight !== true) {\n classes.push(theme.getClass('today'))\n }\n }\n }\n\n return classes\n}\n","\n// given a function that resolves a result asynchronously.\n// the function can either call passed-in success and failure callbacks,\n// or it can return a promise.\n// if you need to pass additional params to func, bind them first.\nexport function unpromisify(func, success, failure?) {\n\n // guard against success/failure callbacks being called more than once\n // and guard against a promise AND callback being used together.\n let isResolved = false\n let wrappedSuccess = function() {\n if (!isResolved) {\n isResolved = true\n success.apply(this, arguments)\n }\n }\n let wrappedFailure = function() {\n if (!isResolved) {\n isResolved = true\n if (failure) {\n failure.apply(this, arguments)\n }\n }\n }\n\n let res = func(wrappedSuccess, wrappedFailure)\n if (res && typeof res.then === 'function') {\n res.then(wrappedSuccess, wrappedFailure)\n }\n}\n","\nexport default class Mixin {\n\n // mix into a CLASS\n static mixInto(destClass) {\n this.mixIntoObj(destClass.prototype)\n }\n\n // mix into ANY object\n static mixIntoObj(destObj) {\n Object.getOwnPropertyNames(this.prototype).forEach((name) => { // copy methods\n if (!destObj[name]) { // if destination doesn't already define it\n destObj[name] = this.prototype[name]\n }\n })\n }\n\n /*\n will override existing methods\n TODO: remove! not used anymore\n */\n static mixOver(destClass) {\n Object.getOwnPropertyNames(this.prototype).forEach((name) => { // copy methods\n destClass.prototype[name] = this.prototype[name]\n })\n }\n\n}\n","/*\nUSAGE:\n import { default as EmitterMixin, EmitterInterface } from './EmitterMixin'\nin class:\n on: EmitterInterface['on']\n one: EmitterInterface['one']\n off: EmitterInterface['off']\n trigger: EmitterInterface['trigger']\n triggerWith: EmitterInterface['triggerWith']\n hasHandlers: EmitterInterface['hasHandlers']\nafter class:\n EmitterMixin.mixInto(TheClass)\n*/\n\nimport { applyAll } from '../util/misc'\nimport Mixin from './Mixin'\n\nexport interface EmitterInterface {\n on(types, handler)\n one(types, handler)\n off(types, handler)\n trigger(type, ...args)\n triggerWith(type, context, args)\n hasHandlers(type)\n}\n\nexport default class EmitterMixin extends Mixin implements EmitterInterface {\n\n _handlers: any\n _oneHandlers: any\n\n on(type, handler) {\n addToHash(\n this._handlers || (this._handlers = {}),\n type,\n handler\n )\n return this // for chaining\n }\n\n // todo: add comments\n one(type, handler) {\n addToHash(\n this._oneHandlers || (this._oneHandlers = {}),\n type,\n handler\n )\n return this // for chaining\n }\n\n off(type, handler?) {\n if (this._handlers) {\n removeFromHash(this._handlers, type, handler)\n }\n if (this._oneHandlers) {\n removeFromHash(this._oneHandlers, type, handler)\n }\n return this // for chaining\n }\n\n trigger(type, ...args) {\n this.triggerWith(type, this, args)\n return this // for chaining\n }\n\n triggerWith(type, context, args) {\n if (this._handlers) {\n applyAll(this._handlers[type], context, args)\n }\n if (this._oneHandlers) {\n applyAll(this._oneHandlers[type], context, args)\n delete this._oneHandlers[type] // will never fire again\n }\n return this // for chaining\n }\n\n hasHandlers(type) {\n return (this._handlers && this._handlers[type] && this._handlers[type].length) ||\n (this._oneHandlers && this._oneHandlers[type] && this._oneHandlers[type].length)\n }\n\n}\n\nfunction addToHash(hash, type, handler) {\n (hash[type] || (hash[type] = []))\n .push(handler)\n}\n\nfunction removeFromHash(hash, type, handler?) {\n if (handler) {\n if (hash[type]) {\n hash[type] = hash[type].filter(function(func) {\n return func !== handler\n })\n }\n } else {\n delete hash[type] // remove all handler funcs for this type\n }\n}\n","\n/*\nRecords offset information for a set of elements, relative to an origin element.\nCan record the left/right OR the top/bottom OR both.\nProvides methods for querying the cache by position.\n*/\nexport default class PositionCache {\n\n originClientRect: ClientRect\n els: HTMLElement[] // assumed to be siblings\n originEl: HTMLElement // options can override the natural originEl\n isHorizontal: boolean // whether to query for left/right/width\n isVertical: boolean // whether to query for top/bottom/height\n\n // arrays of coordinates (from topleft of originEl)\n // caller can access these directly\n lefts: any\n rights: any\n tops: any\n bottoms: any\n\n\n constructor(originEl: HTMLElement, els: HTMLElement[], isHorizontal: boolean, isVertical: boolean) {\n this.originEl = originEl\n this.els = els\n this.isHorizontal = isHorizontal\n this.isVertical = isVertical\n }\n\n\n // Queries the els for coordinates and stores them.\n // Call this method before using and of the get* methods below.\n build() {\n let originEl = this.originEl\n let originClientRect = this.originClientRect =\n originEl.getBoundingClientRect() // relative to viewport top-left\n\n if (this.isHorizontal) {\n this.buildElHorizontals(originClientRect.left)\n }\n\n if (this.isVertical) {\n this.buildElVerticals(originClientRect.top)\n }\n }\n\n\n // Populates the left/right internal coordinate arrays\n buildElHorizontals(originClientLeft: number) {\n let lefts = []\n let rights = []\n\n for (let el of this.els) {\n let rect = el.getBoundingClientRect()\n lefts.push(rect.left - originClientLeft)\n rights.push(rect.right - originClientLeft)\n }\n\n this.lefts = lefts\n this.rights = rights\n }\n\n\n // Populates the top/bottom internal coordinate arrays\n buildElVerticals(originClientTop: number) {\n let tops = []\n let bottoms = []\n\n for (let el of this.els) {\n let rect = el.getBoundingClientRect()\n tops.push(rect.top - originClientTop)\n bottoms.push(rect.bottom - originClientTop)\n }\n\n this.tops = tops\n this.bottoms = bottoms\n }\n\n\n // Given a left offset (from document left), returns the index of the el that it horizontally intersects.\n // If no intersection is made, returns undefined.\n leftToIndex(leftPosition: number) {\n let lefts = this.lefts\n let rights = this.rights\n let len = lefts.length\n let i\n\n for (i = 0; i < len; i++) {\n if (leftPosition >= lefts[i] && leftPosition < rights[i]) {\n return i\n }\n }\n }\n\n\n // Given a top offset (from document top), returns the index of the el that it vertically intersects.\n // If no intersection is made, returns undefined.\n topToIndex(topPosition: number) {\n let tops = this.tops\n let bottoms = this.bottoms\n let len = tops.length\n let i\n\n for (i = 0; i < len; i++) {\n if (topPosition >= tops[i] && topPosition < bottoms[i]) {\n return i\n }\n }\n }\n\n\n // Gets the width of the element at the given index\n getWidth(leftIndex: number) {\n return this.rights[leftIndex] - this.lefts[leftIndex]\n }\n\n\n // Gets the height of the element at the given index\n getHeight(topIndex: number) {\n return this.bottoms[topIndex] - this.tops[topIndex]\n }\n\n}\n","\n/*\nAn object for getting/setting scroll-related information for an element.\nInternally, this is done very differently for window versus DOM element,\nso this object serves as a common interface.\n*/\nexport abstract class ScrollController {\n\n abstract getScrollTop(): number\n abstract getScrollLeft(): number\n abstract setScrollTop(top: number): void\n abstract setScrollLeft(left: number): void\n abstract getClientWidth(): number\n abstract getClientHeight(): number\n abstract getScrollWidth(): number\n abstract getScrollHeight(): number\n\n getMaxScrollTop() {\n return this.getScrollHeight() - this.getClientHeight()\n }\n\n getMaxScrollLeft() {\n return this.getScrollWidth() - this.getClientWidth()\n }\n\n canScrollVertically() {\n return this.getMaxScrollTop() > 0\n }\n\n canScrollHorizontally() {\n return this.getMaxScrollLeft() > 0\n }\n\n canScrollUp() {\n return this.getScrollTop() > 0\n }\n\n canScrollDown() {\n return this.getScrollTop() < this.getMaxScrollTop()\n }\n\n canScrollLeft() {\n return this.getScrollLeft() > 0\n }\n\n canScrollRight() {\n return this.getScrollLeft() < this.getMaxScrollLeft()\n }\n\n}\n\nexport class ElementScrollController extends ScrollController {\n\n el: HTMLElement\n\n constructor(el: HTMLElement) {\n super()\n this.el = el\n }\n\n getScrollTop() {\n return this.el.scrollTop\n }\n\n getScrollLeft() {\n return this.el.scrollLeft\n }\n\n setScrollTop(top: number) {\n this.el.scrollTop = top\n }\n\n setScrollLeft(left: number) {\n this.el.scrollLeft = left\n }\n\n getScrollWidth() {\n return this.el.scrollWidth\n }\n\n getScrollHeight() {\n return this.el.scrollHeight\n }\n\n getClientHeight() {\n return this.el.clientHeight\n }\n\n getClientWidth() {\n return this.el.clientWidth\n }\n\n}\n\nexport class WindowScrollController extends ScrollController {\n\n getScrollTop() {\n return window.pageYOffset\n }\n\n getScrollLeft() {\n return window.pageXOffset\n }\n\n setScrollTop(n: number) {\n window.scroll(window.pageXOffset, n)\n }\n\n setScrollLeft(n: number) {\n window.scroll(n, window.pageYOffset)\n }\n\n getScrollWidth() {\n return document.documentElement.scrollWidth\n }\n\n getScrollHeight() {\n return document.documentElement.scrollHeight\n }\n\n getClientHeight() {\n return document.documentElement.clientHeight\n }\n\n getClientWidth() {\n return document.documentElement.clientWidth\n }\n\n}\n","import { computeEdges } from '../util/dom-geom'\nimport { removeElement, createElement, applyStyle, applyStyleProp } from '../util/dom-manip'\nimport { ElementScrollController } from './scroll-controller'\n\nexport interface ScrollbarWidths {\n left: number\n right: number\n bottom: number\n}\n\n/*\nEmbodies a div that has potential scrollbars\n*/\nexport default class ScrollComponent extends ElementScrollController {\n\n overflowX: string\n overflowY: string\n\n constructor(overflowX: string, overflowY: string) {\n super(\n createElement('div', {\n className: 'fc-scroller'\n })\n )\n this.overflowX = overflowX\n this.overflowY = overflowY\n this.applyOverflow()\n }\n\n\n // sets to natural height, unlocks overflow\n clear() {\n this.setHeight('auto')\n this.applyOverflow()\n }\n\n\n destroy() {\n removeElement(this.el)\n }\n\n\n // Overflow\n // -----------------------------------------------------------------------------------------------------------------\n\n\n applyOverflow() {\n applyStyle(this.el, {\n overflowX: this.overflowX,\n overflowY: this.overflowY\n })\n }\n\n\n // Causes any 'auto' overflow values to resolves to 'scroll' or 'hidden'.\n // Useful for preserving scrollbar widths regardless of future resizes.\n // Can pass in scrollbarWidths for optimization.\n lockOverflow(scrollbarWidths: ScrollbarWidths) {\n let overflowX = this.overflowX\n let overflowY = this.overflowY\n\n scrollbarWidths = scrollbarWidths || this.getScrollbarWidths()\n\n if (overflowX === 'auto') {\n overflowX = (\n scrollbarWidths.bottom || // horizontal scrollbars?\n this.canScrollHorizontally() // OR scrolling pane with massless scrollbars?\n ) ? 'scroll' : 'hidden'\n }\n\n if (overflowY === 'auto') {\n overflowY = (\n scrollbarWidths.left || scrollbarWidths.right || // horizontal scrollbars?\n this.canScrollVertically() // OR scrolling pane with massless scrollbars?\n ) ? 'scroll' : 'hidden'\n }\n\n applyStyle(this.el, { overflowX, overflowY })\n }\n\n\n setHeight(height: number | string) {\n applyStyleProp(this.el, 'height', height)\n }\n\n\n getScrollbarWidths(): ScrollbarWidths {\n let edges = computeEdges(this.el)\n return {\n left: edges.scrollbarLeft,\n right: edges.scrollbarRight,\n bottom: edges.scrollbarBottom\n }\n }\n\n}\n","\nexport default class Theme {\n\n calendarOptions: any\n\n // settings. default values are set after the class\n classes: any\n iconClasses: any\n baseIconClass: string\n iconOverrideOption: any\n iconOverrideCustomButtonOption: any\n iconOverridePrefix: string\n\n\n constructor(calendarOptions) {\n this.calendarOptions = calendarOptions\n this.processIconOverride()\n }\n\n\n processIconOverride() {\n if (this.iconOverrideOption) {\n this.setIconOverride(\n this.calendarOptions[this.iconOverrideOption]\n )\n }\n }\n\n\n setIconOverride(iconOverrideHash) {\n let iconClassesCopy\n let buttonName\n\n if (typeof iconOverrideHash === 'object' && iconOverrideHash) { // non-null object\n iconClassesCopy = { ...this.iconClasses }\n\n for (buttonName in iconOverrideHash) {\n iconClassesCopy[buttonName] = this.applyIconOverridePrefix(\n iconOverrideHash[buttonName]\n )\n }\n\n this.iconClasses = iconClassesCopy\n } else if (iconOverrideHash === false) {\n this.iconClasses = {}\n }\n }\n\n\n applyIconOverridePrefix(className) {\n let prefix = this.iconOverridePrefix\n\n if (prefix && className.indexOf(prefix) !== 0) { // if not already present\n className = prefix + className\n }\n\n return className\n }\n\n\n getClass(key) {\n return this.classes[key] || ''\n }\n\n\n getIconClass(buttonName) {\n let className = this.iconClasses[buttonName]\n\n if (className) {\n return this.baseIconClass + ' ' + className\n }\n\n return ''\n }\n\n\n getCustomButtonIconClass(customButtonProps) {\n let className\n\n if (this.iconOverrideCustomButtonOption) {\n className = customButtonProps[this.iconOverrideCustomButtonOption]\n\n if (className) {\n return this.baseIconClass + ' ' + this.applyIconOverridePrefix(className)\n }\n }\n\n return ''\n }\n\n}\n\nTheme.prototype.classes = {}\nTheme.prototype.iconClasses = {}\nTheme.prototype.baseIconClass = ''\nTheme.prototype.iconOverridePrefix = ''\n\nexport type ThemeClass = { new(calendarOptions: any): Theme }\n","import Calendar from '../Calendar'\nimport View from '../View'\nimport Theme from '../theme/Theme'\nimport { DateEnv } from '../datelib/env'\n\nlet guid = 0\n\nexport interface ComponentContext {\n options: any\n dateEnv: DateEnv\n theme: Theme\n calendar: Calendar\n view: View\n}\n\nexport type EqualityFuncHash = { [propName: string]: (obj0, obj1) => boolean }\n\nexport default class Component {\n\n equalityFuncs: EqualityFuncHash // can't initialize here. done below...\n\n uid: string\n props: PropsType | null\n\n // context vars\n context: ComponentContext\n dateEnv: DateEnv\n theme: Theme\n view: View\n calendar: Calendar\n isRtl: boolean\n\n constructor(context: ComponentContext, isView?: boolean) {\n\n // HACK to populate view at top of component instantiation call chain\n if (isView) {\n context.view = this as any\n }\n\n this.uid = String(guid++)\n this.context = context\n this.dateEnv = context.dateEnv\n this.theme = context.theme\n this.view = context.view\n this.calendar = context.calendar\n this.isRtl = this.opt('dir') === 'rtl'\n }\n\n static addEqualityFuncs(newFuncs: EqualityFuncHash) {\n this.prototype.equalityFuncs = {\n ...this.prototype.equalityFuncs,\n ...newFuncs\n }\n }\n\n opt(name) {\n return this.context.options[name]\n }\n\n receiveProps(props: PropsType) {\n let { anyChanges, comboProps } = recycleProps(this.props || {}, props, this.equalityFuncs)\n\n this.props = comboProps\n\n if (anyChanges) {\n this.render(comboProps)\n }\n }\n\n protected render(props: PropsType) {\n }\n\n // after destroy is called, this component won't ever be used again\n destroy() {\n }\n\n}\n\nComponent.prototype.equalityFuncs = {}\n\n\n/*\nReuses old values when equal. If anything is unequal, returns newProps as-is.\nGreat for PureComponent, but won't be feasible with React, so just eliminate and use React's DOM diffing.\n*/\nfunction recycleProps(oldProps, newProps, equalityFuncs: EqualityFuncHash) {\n let comboProps = {} as any // some old, some new\n let anyChanges = false\n\n for (let key in newProps) {\n if (\n key in oldProps && (\n oldProps[key] === newProps[key] ||\n (equalityFuncs[key] && equalityFuncs[key](oldProps[key], newProps[key]))\n )\n ) {\n // equal to old? use old prop\n comboProps[key] = oldProps[key]\n } else {\n comboProps[key] = newProps[key]\n anyChanges = true\n }\n }\n\n for (let key in oldProps) {\n if (!(key in newProps)) {\n anyChanges = true\n break\n }\n }\n\n return { anyChanges, comboProps }\n}\n","import Component, { ComponentContext } from './Component'\nimport { EventRenderRange } from './event-rendering'\nimport { DateSpan } from '../structs/date-span'\nimport { EventInstanceHash } from '../structs/event'\nimport { rangeContainsRange } from '../datelib/date-range'\nimport { Hit } from '../interactions/hit'\nimport { elementClosest, removeElement } from '../util/dom-manip'\nimport { isDateSelectionValid, isInteractionValid } from '../validation'\nimport EventApi from '../api/EventApi'\nimport FgEventRenderer from './renderers/FgEventRenderer'\nimport FillRenderer from './renderers/FillRenderer'\nimport { EventInteractionState } from '../interactions/event-interaction-state'\nimport View from '../View'\nimport { EventHandlerName, EventHandlerArgs } from '../types/input-types'\n\nexport type DateComponentHash = { [uid: string]: DateComponent }\n\n// NOTE: for fg-events, eventRange.range is NOT sliced,\n// thus, we need isStart/isEnd\nexport interface Seg {\n component?: DateComponent\n isStart: boolean\n isEnd: boolean\n eventRange?: EventRenderRange\n el?: HTMLElement\n [otherProp: string]: any // TODO: remove this. extending Seg will handle this\n}\n\nexport interface EventSegUiInteractionState {\n affectedInstances: EventInstanceHash\n segs: Seg[]\n isEvent: boolean\n sourceSeg: any\n}\n\n/*\nPURPOSES:\n- hook up to fg, fill, and mirror renderers\n- interface for dragging and hits\n*/\nexport default class DateComponent extends Component {\n\n // self-config, overridable by subclasses. must set on prototype\n fgSegSelector: string // lets eventRender produce elements without fc-event class\n bgSegSelector: string\n // IN SCHEDULER: allowAcrossResources\n\n // if defined, holds the unit identified (ex: \"year\" or \"month\") that determines the level of granularity\n // of the date areas. if not defined, assumes to be day and time granularity.\n // TODO: port isTimeScale into same system?\n largeUnit: any\n\n eventRenderer: FgEventRenderer\n mirrorRenderer: FgEventRenderer\n fillRenderer: FillRenderer\n\n el: HTMLElement // passed in to constructor\n\n\n constructor(context: ComponentContext, el: HTMLElement, isView?: boolean) {\n super(context, isView)\n\n this.el = el\n }\n\n destroy() {\n super.destroy()\n\n removeElement(this.el)\n }\n\n\n // TODO: WHAT ABOUT (sourceSeg && sourceSeg.component.doesDragMirror)\n //\n // Event Drag-n-Drop Rendering (for both events and external elements)\n // ---------------------------------------------------------------------------------------------------------------\n /*\n renderEventDragSegs(state: EventSegUiInteractionState) {\n if (state) {\n let { isEvent, segs, sourceSeg } = state\n\n if (this.eventRenderer) {\n this.eventRenderer.hideByHash(state.affectedInstances)\n }\n\n // if the user is dragging something that is considered an event with real event data,\n // and this component likes to do drag mirrors OR the component where the seg came from\n // likes to do drag mirrors, then render a drag mirror.\n if (isEvent && (this.doesDragMirror || sourceSeg && sourceSeg.component.doesDragMirror)) {\n if (this.mirrorRenderer) {\n this.mirrorRenderer.renderSegs(segs, { isDragging: true, sourceSeg })\n }\n }\n\n // if it would be impossible to render a drag mirror OR this component likes to render\n // highlights, then render a highlight.\n if (!isEvent || this.doesDragHighlight) {\n if (this.fillRenderer) {\n this.fillRenderer.renderSegs('highlight', segs)\n }\n }\n }\n }\n */\n\n\n // Hit System\n // -----------------------------------------------------------------------------------------------------------------\n\n\n buildPositionCaches() {\n }\n\n\n queryHit(positionLeft: number, positionTop: number, elWidth: number, elHeight: number): Hit | null {\n return null // this should be abstract\n }\n\n\n // Validation\n // -----------------------------------------------------------------------------------------------------------------\n\n isInteractionValid(interaction: EventInteractionState) {\n let { calendar } = this\n let dateProfile = (this.props as any).dateProfile // HACK\n let instances = interaction.mutatedEvents.instances\n\n if (dateProfile) { // HACK for DayTile\n for (let instanceId in instances) {\n if (!rangeContainsRange(dateProfile.validRange, instances[instanceId].range)) {\n return false\n }\n }\n }\n\n return isInteractionValid(interaction, calendar)\n }\n\n isDateSelectionValid(selection: DateSpan): boolean {\n let dateProfile = (this.props as any).dateProfile // HACK\n\n if (\n dateProfile && // HACK for DayTile\n !rangeContainsRange(dateProfile.validRange, selection.range)\n ) {\n return false\n }\n\n return isDateSelectionValid(selection, this.calendar)\n }\n\n\n // Triggering\n // -----------------------------------------------------------------------------------------------------------------\n // TODO: move to Calendar\n\n\n publiclyTrigger(name: T, args?: EventHandlerArgs) {\n let calendar = this.calendar\n\n return calendar.publiclyTrigger(name, args)\n }\n\n\n publiclyTriggerAfterSizing(name: T, args: EventHandlerArgs) {\n let calendar = this.calendar\n\n return calendar.publiclyTriggerAfterSizing(name, args)\n }\n\n\n hasPublicHandlers(name: T) {\n let calendar = this.calendar\n\n return calendar.hasPublicHandlers(name)\n }\n\n\n triggerRenderedSegs(segs: Seg[], isMirrors: boolean) {\n let { calendar } = this\n\n if (this.hasPublicHandlers('eventPositioned')) {\n\n for (let seg of segs) {\n this.publiclyTriggerAfterSizing('eventPositioned', [\n {\n event: new EventApi(\n calendar,\n seg.eventRange.def,\n seg.eventRange.instance\n ),\n isMirror: isMirrors,\n isStart: seg.isStart,\n isEnd: seg.isEnd,\n el: seg.el,\n view: this as unknown as View // safe to cast because this method is only called on context.view\n }\n ])\n }\n }\n\n if (!calendar.state.loadingLevel) { // avoid initial empty state while pending\n calendar.afterSizingTriggers._eventsPositioned = [ null ] // fire once\n }\n }\n\n triggerWillRemoveSegs(segs: Seg[], isMirrors: boolean) {\n let { calendar } = this\n\n for (let seg of segs) {\n calendar.trigger('eventElRemove', seg.el)\n }\n\n if (this.hasPublicHandlers('eventDestroy')) {\n\n for (let seg of segs) {\n this.publiclyTrigger('eventDestroy', [\n {\n event: new EventApi(\n calendar,\n seg.eventRange.def,\n seg.eventRange.instance\n ),\n isMirror: isMirrors,\n el: seg.el,\n view: this as unknown as View // safe to cast because this method is only called on context.view\n }\n ])\n }\n }\n }\n\n\n // Pointer Interaction Utils\n // -----------------------------------------------------------------------------------------------------------------\n\n isValidSegDownEl(el: HTMLElement) {\n return !(this.props as any).eventDrag && // HACK\n !(this.props as any).eventResize && // HACK\n !elementClosest(el, '.fc-mirror') &&\n (this.isPopover() || !this.isInPopover(el))\n // ^above line ensures we don't detect a seg interaction within a nested component.\n // it's a HACK because it only supports a popover as the nested component.\n }\n\n\n isValidDateDownEl(el: HTMLElement) {\n let segEl = elementClosest(el, this.fgSegSelector)\n\n return (!segEl || segEl.classList.contains('fc-mirror')) &&\n !elementClosest(el, '.fc-more') && // a \"more..\" link\n !elementClosest(el, 'a[data-goto]') && // a clickable nav link\n !this.isInPopover(el)\n }\n\n\n isPopover() {\n return this.el.classList.contains('fc-popover')\n }\n\n\n isInPopover(el: HTMLElement) {\n return Boolean(elementClosest(el, '.fc-popover'))\n }\n\n}\n\nDateComponent.prototype.fgSegSelector = '.fc-event-container > *'\nDateComponent.prototype.bgSegSelector = '.fc-bgevent:not(.fc-nonbusiness)'\n","import { reducerFunc } from './reducers/types'\nimport { eventDefParserFunc } from './structs/event'\nimport { eventDefMutationApplier } from './structs/event-mutation'\nimport Calendar, { DatePointTransform, DateSpanTransform, CalendarInteractionClass, OptionChangeHandlerMap } from './Calendar'\nimport { ViewConfigInputHash } from './structs/view-config'\nimport { ViewSpec } from './structs/view-spec'\nimport View, { ViewProps } from './View'\nimport { CalendarComponentProps } from './CalendarComponent'\nimport { isPropsValidTester } from './validation'\nimport { eventDragMutationMassager, EventDropTransformers } from './interactions/event-dragging'\nimport { dateSelectionJoinTransformer } from './interactions/date-selecting'\nimport { EventResizeJoinTransforms } from './interactions/event-resizing'\nimport { ExternalDefTransform } from './interactions/external-element-dragging'\nimport { InteractionClass } from './interactions/interaction'\nimport { ThemeClass } from './theme/Theme'\nimport { EventSourceDef } from './structs/event-source'\nimport { CmdFormatterFunc } from './datelib/formatting-cmd'\nimport { RecurringType } from './structs/recurring-event'\nimport { NamedTimeZoneImplClass } from './datelib/timezone'\nimport { ElementDraggingClass } from './interactions/ElementDragging'\n\n// TODO: easier way to add new hooks? need to update a million things\n\nexport interface PluginDefInput {\n deps?: PluginDef[]\n reducers?: reducerFunc[]\n eventDefParsers?: eventDefParserFunc[]\n eventDragMutationMassagers?: eventDragMutationMassager[]\n eventDefMutationAppliers?: eventDefMutationApplier[]\n dateSelectionTransformers?: dateSelectionJoinTransformer[]\n datePointTransforms?: DatePointTransform[]\n dateSpanTransforms?: DateSpanTransform[]\n views?: ViewConfigInputHash\n viewPropsTransformers?: ViewPropsTransformerClass[]\n isPropsValid?: isPropsValidTester\n externalDefTransforms?: ExternalDefTransform[]\n eventResizeJoinTransforms?: EventResizeJoinTransforms[]\n viewContainerModifiers?: ViewContainerModifier[]\n eventDropTransformers?: EventDropTransformers[]\n componentInteractions?: InteractionClass[]\n calendarInteractions?: CalendarInteractionClass[]\n themeClasses?: { [themeSystemName: string]: ThemeClass }\n eventSourceDefs?: EventSourceDef[]\n cmdFormatter?: CmdFormatterFunc\n recurringTypes?: RecurringType[]\n namedTimeZonedImpl?: NamedTimeZoneImplClass\n defaultView?: string\n elementDraggingImpl?: ElementDraggingClass\n optionChangeHandlers?: OptionChangeHandlerMap\n}\n\nexport interface PluginHooks {\n reducers: reducerFunc[]\n eventDefParsers: eventDefParserFunc[]\n eventDragMutationMassagers: eventDragMutationMassager[]\n eventDefMutationAppliers: eventDefMutationApplier[]\n dateSelectionTransformers: dateSelectionJoinTransformer[]\n datePointTransforms: DatePointTransform[]\n dateSpanTransforms: DateSpanTransform[]\n views: ViewConfigInputHash // TODO: parse before gets to this step?\n viewPropsTransformers: ViewPropsTransformerClass[]\n isPropsValid: isPropsValidTester | null\n externalDefTransforms: ExternalDefTransform[]\n eventResizeJoinTransforms: EventResizeJoinTransforms[]\n viewContainerModifiers: ViewContainerModifier[]\n eventDropTransformers: EventDropTransformers[]\n componentInteractions: InteractionClass[]\n calendarInteractions: CalendarInteractionClass[]\n themeClasses: { [themeSystemName: string]: ThemeClass }\n eventSourceDefs: EventSourceDef[]\n cmdFormatter?: CmdFormatterFunc\n recurringTypes: RecurringType[]\n namedTimeZonedImpl?: NamedTimeZoneImplClass\n defaultView: string\n elementDraggingImpl?: ElementDraggingClass\n optionChangeHandlers: OptionChangeHandlerMap\n}\n\nexport interface PluginDef extends PluginHooks {\n id: string\n deps: PluginDef[]\n}\n\nexport type ViewPropsTransformerClass = new() => ViewPropsTransformer\n\nexport interface ViewPropsTransformer {\n transform(viewProps: ViewProps, viewSpec: ViewSpec, calendarProps: CalendarComponentProps, view: View): any\n}\n\nexport type ViewContainerModifier = (contentEl: HTMLElement, calendar: Calendar) => void\n\n\nlet uid = 0\n\nexport function createPlugin(input: PluginDefInput): PluginDef {\n return {\n id: String(uid++),\n deps: input.deps || [],\n reducers: input.reducers || [],\n eventDefParsers: input.eventDefParsers || [],\n eventDragMutationMassagers: input.eventDragMutationMassagers || [],\n eventDefMutationAppliers: input.eventDefMutationAppliers || [],\n dateSelectionTransformers: input.dateSelectionTransformers || [],\n datePointTransforms: input.datePointTransforms || [],\n dateSpanTransforms: input.dateSpanTransforms || [],\n views: input.views || {},\n viewPropsTransformers: input.viewPropsTransformers || [],\n isPropsValid: input.isPropsValid || null,\n externalDefTransforms: input.externalDefTransforms || [],\n eventResizeJoinTransforms: input.eventResizeJoinTransforms || [],\n viewContainerModifiers: input.viewContainerModifiers || [],\n eventDropTransformers: input.eventDropTransformers || [],\n componentInteractions: input.componentInteractions || [],\n calendarInteractions: input.calendarInteractions || [],\n themeClasses: input.themeClasses || {},\n eventSourceDefs: input.eventSourceDefs || [],\n cmdFormatter: input.cmdFormatter,\n recurringTypes: input.recurringTypes || [],\n namedTimeZonedImpl: input.namedTimeZonedImpl,\n defaultView: input.defaultView || '',\n elementDraggingImpl: input.elementDraggingImpl,\n optionChangeHandlers: input.optionChangeHandlers || {}\n }\n}\n\nexport class PluginSystem {\n\n hooks: PluginHooks\n addedHash: { [pluginId: string]: true }\n\n constructor() {\n this.hooks = {\n reducers: [],\n eventDefParsers: [],\n eventDragMutationMassagers: [],\n eventDefMutationAppliers: [],\n dateSelectionTransformers: [],\n datePointTransforms: [],\n dateSpanTransforms: [],\n views: {},\n viewPropsTransformers: [],\n isPropsValid: null,\n externalDefTransforms: [],\n eventResizeJoinTransforms: [],\n viewContainerModifiers: [],\n eventDropTransformers: [],\n componentInteractions: [],\n calendarInteractions: [],\n themeClasses: {},\n eventSourceDefs: [],\n cmdFormatter: null,\n recurringTypes: [],\n namedTimeZonedImpl: null,\n defaultView: '',\n elementDraggingImpl: null,\n optionChangeHandlers: {}\n }\n this.addedHash = {}\n }\n\n add(plugin: PluginDef) {\n if (!this.addedHash[plugin.id]) {\n this.addedHash[plugin.id] = true\n\n for (let dep of plugin.deps) {\n this.add(dep)\n }\n\n this.hooks = combineHooks(this.hooks, plugin)\n }\n }\n\n}\n\nfunction combineHooks(hooks0: PluginHooks, hooks1: PluginHooks): PluginHooks {\n return {\n reducers: hooks0.reducers.concat(hooks1.reducers),\n eventDefParsers: hooks0.eventDefParsers.concat(hooks1.eventDefParsers),\n eventDragMutationMassagers: hooks0.eventDragMutationMassagers.concat(hooks1.eventDragMutationMassagers),\n eventDefMutationAppliers: hooks0.eventDefMutationAppliers.concat(hooks1.eventDefMutationAppliers),\n dateSelectionTransformers: hooks0.dateSelectionTransformers.concat(hooks1.dateSelectionTransformers),\n datePointTransforms: hooks0.datePointTransforms.concat(hooks1.datePointTransforms),\n dateSpanTransforms: hooks0.dateSpanTransforms.concat(hooks1.dateSpanTransforms),\n views: { ...hooks0.views, ...hooks1.views },\n viewPropsTransformers: hooks0.viewPropsTransformers.concat(hooks1.viewPropsTransformers),\n isPropsValid: hooks1.isPropsValid || hooks0.isPropsValid,\n externalDefTransforms: hooks0.externalDefTransforms.concat(hooks1.externalDefTransforms),\n eventResizeJoinTransforms: hooks0.eventResizeJoinTransforms.concat(hooks1.eventResizeJoinTransforms),\n viewContainerModifiers: hooks0.viewContainerModifiers.concat(hooks1.viewContainerModifiers),\n eventDropTransformers: hooks0.eventDropTransformers.concat(hooks1.eventDropTransformers),\n calendarInteractions: hooks0.calendarInteractions.concat(hooks1.calendarInteractions),\n componentInteractions: hooks0.componentInteractions.concat(hooks1.componentInteractions),\n themeClasses: { ...hooks0.themeClasses, ...hooks1.themeClasses },\n eventSourceDefs: hooks0.eventSourceDefs.concat(hooks1.eventSourceDefs),\n cmdFormatter: hooks1.cmdFormatter || hooks0.cmdFormatter,\n recurringTypes: hooks0.recurringTypes.concat(hooks1.recurringTypes),\n namedTimeZonedImpl: hooks1.namedTimeZonedImpl || hooks0.namedTimeZonedImpl,\n defaultView: hooks0.defaultView || hooks1.defaultView, // put earlier plugins FIRST\n elementDraggingImpl: hooks0.elementDraggingImpl || hooks1.elementDraggingImpl, // \"\n optionChangeHandlers: { ...hooks0.optionChangeHandlers, ...hooks1.optionChangeHandlers }\n }\n}\n","import { createPlugin } from '../plugin-system'\nimport { EventSourceDef } from '../structs/event-source'\nimport { EventInput } from '../structs/event'\n\nlet eventSourceDef: EventSourceDef = {\n ignoreRange: true,\n\n parseMeta(raw: any): EventInput[] | null {\n if (Array.isArray(raw)) { // short form\n return raw\n } else if (Array.isArray(raw.events)) {\n return raw.events\n }\n return null\n },\n\n fetch(arg, success) {\n success({\n rawEvents: arg.eventSource.meta as EventInput[]\n })\n }\n}\n\nexport default createPlugin({\n eventSourceDefs: [ eventSourceDef ]\n})\n","import { unpromisify } from '../util/promise'\nimport { EventSourceError, EventSourceDef } from '../structs/event-source'\nimport { EventInput } from '../structs/event'\nimport { createPlugin } from '../plugin-system'\n\nexport type EventSourceFunc = (\n arg: {\n start: Date\n end: Date\n timeZone: string\n },\n successCallback: (events: EventInput[]) => void,\n failureCallback: (error: EventSourceError) => void\n) => (void | PromiseLike)\n\n\nlet eventSourceDef: EventSourceDef = {\n\n parseMeta(raw: any): EventSourceFunc {\n if (typeof raw === 'function') { // short form\n return raw\n } else if (typeof raw.events === 'function') {\n return raw.events\n }\n return null\n },\n\n fetch(arg, success, failure) {\n let dateEnv = arg.calendar.dateEnv\n let func = arg.eventSource.meta as EventSourceFunc\n\n unpromisify(\n func.bind(null, { // the function returned from parseMeta\n start: dateEnv.toDate(arg.range.start),\n end: dateEnv.toDate(arg.range.end),\n startStr: dateEnv.formatIso(arg.range.start),\n endStr: dateEnv.formatIso(arg.range.end),\n timeZone: dateEnv.timeZone\n }),\n function(rawEvents) { // success\n success({ rawEvents }) // needs an object response\n },\n failure // send errorObj directly to failure callback\n )\n }\n\n}\n\nexport default createPlugin({\n eventSourceDefs: [ eventSourceDef ]\n})\n","\nexport default function requestJson(method: string, url: string, params: object, successCallback, failureCallback) {\n method = method.toUpperCase()\n\n let body = null\n\n if (method === 'GET') {\n url = injectQueryStringParams(url, params)\n } else {\n body = encodeParams(params)\n }\n\n let xhr = new XMLHttpRequest()\n xhr.open(method, url, true)\n\n if (method !== 'GET') {\n xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded')\n }\n\n xhr.onload = function() {\n if (xhr.status >= 200 && xhr.status < 400) {\n try {\n let res = JSON.parse(xhr.responseText)\n successCallback(res, xhr)\n } catch (err) {\n failureCallback('Failure parsing JSON', xhr)\n }\n } else {\n failureCallback('Request failed', xhr)\n }\n }\n\n xhr.onerror = function() {\n failureCallback('Request failed', xhr)\n }\n\n xhr.send(body)\n}\n\nfunction injectQueryStringParams(url: string, params) {\n return url +\n (url.indexOf('?') === -1 ? '?' : '&') +\n encodeParams(params)\n}\n\nfunction encodeParams(params) {\n let parts = []\n\n for (let key in params) {\n parts.push(encodeURIComponent(key) + '=' + encodeURIComponent(params[key]))\n }\n\n return parts.join('&')\n}\n","import requestJson from '../util/requestJson'\nimport Calendar from '../Calendar'\nimport { EventSourceDef } from '../structs/event-source'\nimport { DateRange } from '../datelib/date-range'\nimport { __assign } from 'tslib'\nimport { createPlugin } from '../plugin-system'\n\ninterface JsonFeedMeta {\n url: string\n method: string\n extraParams?: any\n startParam?: string\n endParam?: string\n timeZoneParam?: string\n}\n\nlet eventSourceDef: EventSourceDef = {\n\n parseMeta(raw: any): JsonFeedMeta | null {\n if (typeof raw === 'string') { // short form\n raw = { url: raw }\n } else if (!raw || typeof raw !== 'object' || !raw.url) {\n return null\n }\n\n return {\n url: raw.url,\n method: (raw.method || 'GET').toUpperCase(),\n extraParams: raw.extraParams,\n startParam: raw.startParam,\n endParam: raw.endParam,\n timeZoneParam: raw.timeZoneParam\n }\n },\n\n fetch(arg, success, failure) {\n let meta: JsonFeedMeta = arg.eventSource.meta\n let requestParams = buildRequestParams(meta, arg.range, arg.calendar)\n\n requestJson(\n meta.method, meta.url, requestParams,\n function(rawEvents, xhr) {\n success({ rawEvents, xhr })\n },\n function(errorMessage, xhr) {\n failure({ message: errorMessage, xhr })\n }\n )\n }\n\n}\n\nexport default createPlugin({\n eventSourceDefs: [ eventSourceDef ]\n})\n\nfunction buildRequestParams(meta: JsonFeedMeta, range: DateRange, calendar: Calendar) {\n const dateEnv = calendar.dateEnv\n let startParam\n let endParam\n let timeZoneParam\n let customRequestParams\n let params = {}\n\n startParam = meta.startParam\n if (startParam == null) {\n startParam = calendar.opt('startParam')\n }\n\n endParam = meta.endParam\n if (endParam == null) {\n endParam = calendar.opt('endParam')\n }\n\n timeZoneParam = meta.timeZoneParam\n if (timeZoneParam == null) {\n timeZoneParam = calendar.opt('timeZoneParam')\n }\n\n // retrieve any outbound GET/POST data from the options\n if (typeof meta.extraParams === 'function') {\n // supplied as a function that returns a key/value object\n customRequestParams = meta.extraParams()\n } else {\n // probably supplied as a straight key/value object\n customRequestParams = meta.extraParams || {}\n }\n\n __assign(params, customRequestParams)\n\n params[startParam] = dateEnv.formatIso(range.start)\n params[endParam] = dateEnv.formatIso(range.end)\n\n if (dateEnv.timeZone !== 'local') {\n params[timeZoneParam] = dateEnv.timeZone\n }\n\n return params\n}\n","import { startOfDay, addDays, DateMarker } from '../datelib/marker'\nimport { Duration, createDuration, subtractDurations } from '../datelib/duration'\nimport { arrayToHash } from '../util/object'\nimport { refineProps } from '../util/misc'\nimport { RecurringType, ParsedRecurring } from './recurring-event'\nimport { EventInput } from './event'\nimport { DateRange, intersectRanges } from '../datelib/date-range'\nimport { DateEnv } from '../datelib/env'\nimport { createPlugin } from '../plugin-system'\n\n/*\nAn implementation of recurring events that only supports every-day or weekly recurrences.\n*/\n\ninterface SimpleRecurringData {\n daysOfWeek: number[] | null\n startTime: Duration | null\n endTime: Duration | null\n startRecur: DateMarker | null\n endRecur: DateMarker | null\n}\n\ninterface SimpleParsedRecurring extends ParsedRecurring {\n typeData: SimpleRecurringData // the whole point is to make this more specific\n}\n\nlet recurring: RecurringType = {\n\n parse(rawEvent: EventInput, leftoverProps: any, dateEnv: DateEnv): SimpleParsedRecurring | null {\n let createMarker = dateEnv.createMarker.bind(dateEnv)\n let processors = {\n daysOfWeek: null,\n startTime: createDuration,\n endTime: createDuration,\n startRecur: createMarker,\n endRecur: createMarker\n }\n\n let props = refineProps(rawEvent, processors, {}, leftoverProps) as SimpleRecurringData\n let anyValid = false\n\n for (let propName in props) {\n if (props[propName] != null) {\n anyValid = true\n break\n }\n }\n\n if (anyValid) {\n let duration: Duration = null\n\n if ('duration' in leftoverProps) {\n duration = createDuration(leftoverProps.duration)\n delete leftoverProps.duration\n }\n if (!duration && props.startTime && props.endTime) {\n duration = subtractDurations(props.endTime, props.startTime)\n }\n\n return {\n allDayGuess: Boolean(!props.startTime && !props.endTime),\n duration,\n typeData: props // doesn't need endTime anymore but oh well\n }\n }\n\n return null\n },\n\n expand(typeData: SimpleRecurringData, framingRange: DateRange, dateEnv: DateEnv): DateMarker[] {\n let clippedFramingRange = intersectRanges(\n framingRange,\n { start: typeData.startRecur, end: typeData.endRecur }\n )\n\n if (clippedFramingRange) {\n return expandRanges(\n typeData.daysOfWeek,\n typeData.startTime,\n clippedFramingRange,\n dateEnv\n )\n } else {\n return []\n }\n }\n\n}\n\nexport default createPlugin({\n recurringTypes: [ recurring ]\n})\n\nfunction expandRanges(\n daysOfWeek: number[] | null,\n startTime: Duration | null,\n framingRange: DateRange,\n dateEnv: DateEnv\n): DateMarker[] {\n let dowHash: { [num: string]: true } | null = daysOfWeek ? arrayToHash(daysOfWeek) : null\n let dayMarker = startOfDay(framingRange.start)\n let endMarker = framingRange.end\n let instanceStarts: DateMarker[] = []\n\n while (dayMarker < endMarker) {\n let instanceStart\n\n // if everyday, or this particular day-of-week\n if (!dowHash || dowHash[dayMarker.getUTCDay()]) {\n\n if (startTime) {\n instanceStart = dateEnv.add(dayMarker, startTime)\n } else {\n instanceStart = dayMarker\n }\n\n instanceStarts.push(instanceStart)\n }\n\n dayMarker = addDays(dayMarker, 1)\n }\n\n return instanceStarts\n}\n","import { createPlugin } from './plugin-system'\nimport { Calendar } from './main'\nimport { hashValuesToArray } from './util/object'\nimport { EventSource } from './structs/event-source'\n\nexport default createPlugin({\n optionChangeHandlers: {\n events(events, calendar, deepEquals) {\n handleEventSources([ events ], calendar, deepEquals)\n },\n eventSources: handleEventSources,\n plugins: handlePlugins\n }\n})\n\nfunction handleEventSources(inputs, calendar: Calendar, deepEquals) {\n let unfoundSources: EventSource[] = hashValuesToArray(calendar.state.eventSources)\n let newInputs = []\n\n for (let input of inputs) {\n let inputFound = false\n\n for (let i = 0; i < unfoundSources.length; i++) {\n if (deepEquals(unfoundSources[i]._raw, input)) {\n unfoundSources.splice(i, 1) // delete\n inputFound = true\n break\n }\n }\n\n if (!inputFound) {\n newInputs.push(input)\n }\n }\n\n for (let unfoundSource of unfoundSources) {\n calendar.dispatch({\n type: 'REMOVE_EVENT_SOURCE',\n sourceId: unfoundSource.sourceId\n })\n }\n\n for (let newInput of newInputs) {\n console.log('add new event source!!!', newInput)\n calendar.addEventSource(newInput)\n }\n}\n\n// shortcoming: won't remove plugins\nfunction handlePlugins(inputs, calendar: Calendar) {\n calendar.addPluginInputs(inputs) // will gracefully handle duplicates\n}\n","import { mergeProps } from './util/object'\nimport { PluginDef } from './plugin-system'\nimport ArrayEventSourcePlugin from './event-sources/array-event-source'\nimport FuncEventSourcePlugin from './event-sources/func-event-source'\nimport JsonFeedEventSourcePlugin from './event-sources/json-feed-event-source'\nimport SimpleRecurrencePlugin from './structs/recurring-event-simple'\nimport { capitaliseFirstLetter } from './util/misc'\nimport DefaultOptionChangeHandlers from './option-change-handlers'\n\nexport const config = {} as any // TODO: make these options\n\nexport const globalDefaults = {\n\n defaultRangeSeparator: ' - ',\n titleRangeSeparator: ' \\u2013 ', // en dash\n\n defaultTimedEventDuration: '01:00:00',\n defaultAllDayEventDuration: { day: 1 },\n forceEventDuration: false,\n nextDayThreshold: '00:00:00',\n\n // display\n columnHeader: true,\n defaultView: '',\n aspectRatio: 1.35,\n header: {\n left: 'title',\n center: '',\n right: 'today prev,next'\n },\n weekends: true,\n weekNumbers: false,\n weekNumberCalculation: 'local',\n\n editable: false,\n\n // nowIndicator: false,\n\n scrollTime: '06:00:00',\n minTime: '00:00:00',\n maxTime: '24:00:00',\n showNonCurrentDates: true,\n\n // event ajax\n lazyFetching: true,\n startParam: 'start',\n endParam: 'end',\n timeZoneParam: 'timeZone',\n\n timeZone: 'local', // TODO: throw error if given falsy value?\n\n // allDayDefault: undefined,\n\n // locale\n locales: [],\n locale: '', // blank values means it will compute based off locales[]\n // dir: will get this from the default locale\n // buttonIcons: null,\n\n // allows setting a min-height to the event segment to prevent short events overlapping each other\n timeGridEventMinHeight: 0,\n\n themeSystem: 'standard',\n\n // eventResizableFromStart: false,\n dragRevertDuration: 500,\n dragScroll: true,\n\n allDayMaintainDuration: false,\n\n // selectable: false,\n unselectAuto: true,\n // selectMinDistance: 0,\n\n dropAccept: '*',\n\n eventOrder: 'start,-duration,allDay,title',\n // ^ if start tie, longer events go before shorter. final tie-breaker is title text\n\n // rerenderDelay: null,\n\n eventLimit: false,\n eventLimitClick: 'popover',\n dayPopoverFormat: { month: 'long', day: 'numeric', year: 'numeric' },\n\n handleWindowResize: true,\n windowResizeDelay: 100, // milliseconds before an updateSize happens\n\n longPressDelay: 1000,\n eventDragMinDistance: 5 // only applies to mouse\n\n}\n\n\nexport const rtlDefaults = { // right-to-left defaults\n header: { // TODO: smarter solution (first/center/last ?)\n left: 'next,prev today',\n center: '',\n right: 'title'\n },\n buttonIcons: {\n // TODO: make RTL support the responibility of the theme\n prev: 'fc-icon-chevron-right',\n next: 'fc-icon-chevron-left',\n prevYear: 'fc-icon-chevrons-right',\n nextYear: 'fc-icon-chevrons-left'\n }\n}\n\n\nlet complexOptions = [ // names of options that are objects whose properties should be combined\n 'header',\n 'footer',\n 'buttonText',\n 'buttonIcons'\n]\n\n\n// Merges an array of option objects into a single object\nexport function mergeOptions(optionObjs) {\n return mergeProps(optionObjs, complexOptions)\n}\n\n\n\n// TODO: move this stuff to a \"plugin\"-related file...\n\nconst INTERNAL_PLUGINS: PluginDef[] = [\n ArrayEventSourcePlugin,\n FuncEventSourcePlugin,\n JsonFeedEventSourcePlugin,\n SimpleRecurrencePlugin,\n DefaultOptionChangeHandlers\n]\n\nexport function refinePluginDefs(pluginInputs: any[]): PluginDef[] {\n let plugins = []\n\n for (let pluginInput of pluginInputs) {\n\n if (typeof pluginInput === 'string') {\n let globalName = 'FullCalendar' + capitaliseFirstLetter(pluginInput)\n\n if (!window[globalName]) {\n console.warn('Plugin file not loaded for ' + pluginInput)\n } else {\n plugins.push(window[globalName].default) // is an ES6 module\n }\n\n } else {\n plugins.push(pluginInput)\n }\n }\n\n return INTERNAL_PLUGINS.concat(plugins)\n}\n","import { mergeProps, hashValuesToArray } from '../util/object'\nimport { __assign } from 'tslib'\n\nexport type LocaleCodeArg = string | string[]\nexport type LocaleSingularArg = LocaleCodeArg | RawLocale\n\nexport interface Locale {\n codeArg: LocaleCodeArg\n codes: string[]\n week: { dow: number, doy: number }\n simpleNumberFormat: Intl.NumberFormat\n options: any\n}\n\nexport interface RawLocale {\n code: string\n [otherProp: string]: any\n}\n\nexport type RawLocaleMap = { [code: string]: RawLocale }\n\nexport interface RawLocaleInfo {\n map: RawLocaleMap\n defaultCode: string\n}\n\nconst RAW_EN_LOCALE = {\n code: 'en',\n week: {\n dow: 0, // Sunday is the first day of the week\n doy: 4 // 4 days need to be within the year to be considered the first week\n },\n dir: 'ltr',\n buttonText: {\n prev: 'prev',\n next: 'next',\n prevYear: 'prev year',\n nextYear: 'next year',\n year: 'year',\n today: 'today',\n month: 'month',\n week: 'week',\n day: 'day',\n list: 'list'\n },\n weekLabel: 'W',\n allDayText: 'all-day',\n eventLimitText: 'more',\n noEventsMessage: 'No events to display'\n}\n\nexport function parseRawLocales(explicitRawLocales: RawLocale[]): RawLocaleInfo {\n let defaultCode = explicitRawLocales.length > 0 ? explicitRawLocales[0].code : 'en'\n let globalArray = window['FullCalendarLocalesAll'] || [] // from locales-all.js\n let globalObject = window['FullCalendarLocales'] || {} // from locales/*.js. keys are meaningless\n let allRawLocales = globalArray.concat( // globalArray is low prio\n hashValuesToArray(globalObject), // medium prio\n explicitRawLocales // highest prio\n )\n let rawLocaleMap = {\n en: RAW_EN_LOCALE // necessary?\n }\n\n for (let rawLocale of allRawLocales) {\n rawLocaleMap[rawLocale.code] = rawLocale\n }\n\n return {\n map: rawLocaleMap,\n defaultCode\n }\n}\n\nexport function buildLocale(inputSingular: LocaleSingularArg, available: RawLocaleMap) {\n if (typeof inputSingular === 'object' && !Array.isArray(inputSingular)) {\n return parseLocale(\n inputSingular.code,\n [ inputSingular.code ],\n inputSingular\n )\n } else {\n return queryLocale(inputSingular, available)\n }\n}\n\nfunction queryLocale(codeArg: LocaleCodeArg, available: RawLocaleMap): Locale {\n let codes = [].concat(codeArg || []) // will convert to array\n let raw = queryRawLocale(codes, available) || RAW_EN_LOCALE\n\n return parseLocale(codeArg, codes, raw)\n}\n\nfunction queryRawLocale(codes: string[], available: RawLocaleMap): RawLocale {\n for (let i = 0; i < codes.length; i++) {\n let parts = codes[i].toLocaleLowerCase().split('-')\n\n for (let j = parts.length; j > 0; j--) {\n let simpleId = parts.slice(0, j).join('-')\n\n if (available[simpleId]) {\n return available[simpleId]\n }\n }\n }\n return null\n}\n\nfunction parseLocale(codeArg: LocaleCodeArg, codes: string[], raw: RawLocale): Locale {\n let merged = mergeProps([ RAW_EN_LOCALE, raw ], [ 'buttonText' ])\n\n delete merged.code // don't want this part of the options\n\n let week = merged.week\n delete merged.week\n\n return {\n codeArg,\n codes,\n week,\n simpleNumberFormat: new Intl.NumberFormat(codeArg),\n options: merged\n }\n}\n","import { firstDefined } from './util/misc'\nimport { globalDefaults, rtlDefaults, mergeOptions } from './options'\nimport { parseRawLocales, buildLocale } from './datelib/locale'\nimport { __assign } from 'tslib'\n\n\nexport default class OptionsManager {\n\n dirDefaults: any // option defaults related to LTR or RTL\n localeDefaults: any // option defaults related to current locale\n overrides: any // option overrides given to the fullCalendar constructor\n dynamicOverrides: any // options set with dynamic setter method. higher precedence than view overrides.\n computed: any\n\n\n constructor(overrides) {\n this.overrides = { ...overrides } // make a copy\n this.dynamicOverrides = {}\n this.compute()\n }\n\n\n mutate(updates, removals: string[], isDynamic?: boolean) {\n let overrideHash = isDynamic ? this.dynamicOverrides : this.overrides\n\n __assign(overrideHash, updates)\n\n for (let propName of removals) {\n delete overrideHash[propName]\n }\n\n this.compute()\n }\n\n\n // Computes the flattened options hash for the calendar and assigns to `this.options`.\n // Assumes this.overrides and this.dynamicOverrides have already been initialized.\n compute() {\n\n // TODO: not a very efficient system\n let locales = firstDefined( // explicit locale option given?\n this.dynamicOverrides.locales,\n this.overrides.locales,\n globalDefaults.locales\n )\n let locale = firstDefined( // explicit locales option given?\n this.dynamicOverrides.locale,\n this.overrides.locale,\n globalDefaults.locale\n )\n let available = parseRawLocales(locales)\n let localeDefaults = buildLocale(locale || available.defaultCode, available.map).options\n\n let dir = firstDefined( // based on options computed so far, is direction RTL?\n this.dynamicOverrides.dir,\n this.overrides.dir,\n localeDefaults.dir\n )\n\n let dirDefaults = dir === 'rtl' ? rtlDefaults : {}\n\n this.dirDefaults = dirDefaults\n this.localeDefaults = localeDefaults\n\n this.computed = mergeOptions([ // merge defaults and overrides. lowest to highest precedence\n globalDefaults, // global defaults\n dirDefaults,\n localeDefaults,\n this.overrides,\n this.dynamicOverrides\n ])\n }\n\n}\n","import { DateMarker, arrayToUtcDate, dateToUtcArray } from './marker'\n\nexport interface CalendarSystem {\n getMarkerYear(d: DateMarker): number\n getMarkerMonth(d: DateMarker): number\n getMarkerDay(d: DateMarker): number\n arrayToMarker(arr: number[]): DateMarker\n markerToArray(d: DateMarker): number[]\n}\n\n\nlet calendarSystemClassMap = {}\n\nexport function registerCalendarSystem(name, theClass) {\n calendarSystemClassMap[name] = theClass\n}\n\nexport function createCalendarSystem(name) {\n return new calendarSystemClassMap[name]()\n}\n\n\nclass GregorianCalendarSystem implements CalendarSystem {\n\n getMarkerYear(d: DateMarker) {\n return d.getUTCFullYear()\n }\n\n getMarkerMonth(d: DateMarker) {\n return d.getUTCMonth()\n }\n\n getMarkerDay(d: DateMarker) {\n return d.getUTCDate()\n }\n\n arrayToMarker(arr) {\n return arrayToUtcDate(arr)\n }\n\n markerToArray(marker) {\n return dateToUtcArray(marker)\n }\n\n}\n\nregisterCalendarSystem('gregory', GregorianCalendarSystem)\n","import { isValidDate } from './marker'\n\n\nconst ISO_RE = /^\\s*(\\d{4})(-(\\d{2})(-(\\d{2})([T ](\\d{2}):(\\d{2})(:(\\d{2})(\\.(\\d+))?)?(Z|(([-+])(\\d{2})(:?(\\d{2}))?))?)?)?)?$/\n\nexport function parse(str) {\n let m = ISO_RE.exec(str)\n\n if (m) {\n let marker = new Date(Date.UTC(\n Number(m[1]),\n m[3] ? Number(m[3]) - 1 : 0,\n Number(m[5] || 1),\n Number(m[7] || 0),\n Number(m[8] || 0),\n Number(m[10] || 0),\n m[12] ? Number('0.' + m[12]) * 1000 : 0\n ))\n\n if (isValidDate(marker)) {\n let timeZoneOffset = null\n\n if (m[13]) {\n timeZoneOffset = (m[15] === '-' ? -1 : 1) * (\n Number(m[16] || 0) * 60 +\n Number(m[18] || 0)\n )\n }\n\n return {\n marker,\n isTimeUnspecified: !m[6],\n timeZoneOffset\n }\n }\n }\n\n return null\n}\n","import {\n DateMarker, addMs,\n diffHours, diffMinutes, diffSeconds, diffWholeWeeks, diffWholeDays,\n startOfDay, startOfHour, startOfMinute, startOfSecond,\n weekOfYear, arrayToUtcDate, dateToUtcArray, dateToLocalArray, arrayToLocalDate, timeAsMs, isValidDate\n} from './marker'\nimport { CalendarSystem, createCalendarSystem } from './calendar-system'\nimport { Locale } from './locale'\nimport { NamedTimeZoneImpl, NamedTimeZoneImplClass } from './timezone'\nimport { Duration, asRoughYears, asRoughMonths, asRoughDays, asRoughMs } from './duration'\nimport { DateFormatter, buildIsoString } from './formatting'\nimport { parse } from './parsing'\nimport { isInt } from '../util/misc'\nimport { CmdFormatterFunc } from './formatting-cmd'\n\nexport interface DateEnvSettings {\n timeZone: string\n namedTimeZoneImpl?: NamedTimeZoneImplClass\n calendarSystem: string\n locale: Locale\n weekNumberCalculation?: any\n firstDay?: any,\n weekLabel?: string,\n cmdFormatter?: CmdFormatterFunc\n}\n\nexport type DateInput = Date | string | number | number[]\n\nexport interface DateMarkerMeta {\n marker: DateMarker\n isTimeUnspecified: boolean\n forcedTzo: number | null\n}\n\n\nexport class DateEnv {\n\n timeZone: string\n namedTimeZoneImpl: NamedTimeZoneImpl\n canComputeOffset: boolean\n\n calendarSystem: CalendarSystem\n locale: Locale\n weekDow: number // which day begins the week\n weekDoy: number // which day must be within the year, for computing the first week number\n weekNumberFunc: any\n weekLabel: string // DON'T LIKE how options are confused with local\n cmdFormatter?: CmdFormatterFunc\n\n\n constructor(settings: DateEnvSettings) {\n let timeZone = this.timeZone = settings.timeZone\n let isNamedTimeZone = timeZone !== 'local' && timeZone !== 'UTC'\n\n if (settings.namedTimeZoneImpl && isNamedTimeZone) {\n this.namedTimeZoneImpl = new settings.namedTimeZoneImpl(timeZone)\n }\n\n this.canComputeOffset = Boolean(!isNamedTimeZone || this.namedTimeZoneImpl)\n\n this.calendarSystem = createCalendarSystem(settings.calendarSystem)\n this.locale = settings.locale\n this.weekDow = settings.locale.week.dow\n this.weekDoy = settings.locale.week.doy\n\n if (settings.weekNumberCalculation === 'ISO') {\n this.weekDow = 1\n this.weekDoy = 4\n } else if (typeof settings.firstDay === 'number') {\n this.weekDow = settings.firstDay\n }\n\n if (typeof settings.weekNumberCalculation === 'function') {\n this.weekNumberFunc = settings.weekNumberCalculation\n }\n\n this.weekLabel = settings.weekLabel != null ? settings.weekLabel : settings.locale.options.weekLabel\n\n this.cmdFormatter = settings.cmdFormatter\n }\n\n\n // Creating / Parsing\n\n createMarker(input: DateInput): DateMarker {\n let meta = this.createMarkerMeta(input)\n if (meta === null) {\n return null\n }\n return meta.marker\n }\n\n createNowMarker(): DateMarker {\n if (this.canComputeOffset) {\n return this.timestampToMarker(new Date().valueOf())\n } else {\n // if we can't compute the current date val for a timezone,\n // better to give the current local date vals than UTC\n return arrayToUtcDate(dateToLocalArray(new Date()))\n }\n }\n\n createMarkerMeta(input: DateInput): DateMarkerMeta {\n\n if (typeof input === 'string') {\n return this.parse(input)\n }\n\n let marker = null\n\n if (typeof input === 'number') {\n marker = this.timestampToMarker(input)\n } else if (input instanceof Date) {\n input = input.valueOf()\n\n if (!isNaN(input)) {\n marker = this.timestampToMarker(input)\n }\n } else if (Array.isArray(input)) {\n marker = arrayToUtcDate(input)\n }\n\n if (marker === null || !isValidDate(marker)) {\n return null\n }\n\n return { marker, isTimeUnspecified: false, forcedTzo: null }\n }\n\n parse(s: string) {\n let parts = parse(s)\n if (parts === null) {\n return null\n }\n\n let marker = parts.marker\n let forcedTzo = null\n\n if (parts.timeZoneOffset !== null) {\n if (this.canComputeOffset) {\n marker = this.timestampToMarker(marker.valueOf() - parts.timeZoneOffset * 60 * 1000)\n } else {\n forcedTzo = parts.timeZoneOffset\n }\n }\n\n return { marker, isTimeUnspecified: parts.isTimeUnspecified, forcedTzo }\n }\n\n\n // Accessors\n\n getYear(marker: DateMarker): number {\n return this.calendarSystem.getMarkerYear(marker)\n }\n\n getMonth(marker: DateMarker): number {\n return this.calendarSystem.getMarkerMonth(marker)\n }\n\n\n // Adding / Subtracting\n\n add(marker: DateMarker, dur: Duration): DateMarker {\n let a = this.calendarSystem.markerToArray(marker)\n a[0] += dur.years\n a[1] += dur.months\n a[2] += dur.days\n a[6] += dur.milliseconds\n return this.calendarSystem.arrayToMarker(a)\n }\n\n subtract(marker: DateMarker, dur: Duration): DateMarker {\n let a = this.calendarSystem.markerToArray(marker)\n a[0] -= dur.years\n a[1] -= dur.months\n a[2] -= dur.days\n a[6] -= dur.milliseconds\n return this.calendarSystem.arrayToMarker(a)\n }\n\n addYears(marker: DateMarker, n: number) {\n let a = this.calendarSystem.markerToArray(marker)\n a[0] += n\n return this.calendarSystem.arrayToMarker(a)\n }\n\n addMonths(marker: DateMarker, n: number) {\n let a = this.calendarSystem.markerToArray(marker)\n a[1] += n\n return this.calendarSystem.arrayToMarker(a)\n }\n\n\n // Diffing Whole Units\n\n diffWholeYears(m0: DateMarker, m1: DateMarker): number {\n let { calendarSystem } = this\n\n if (\n timeAsMs(m0) === timeAsMs(m1) &&\n calendarSystem.getMarkerDay(m0) === calendarSystem.getMarkerDay(m1) &&\n calendarSystem.getMarkerMonth(m0) === calendarSystem.getMarkerMonth(m1)\n ) {\n return calendarSystem.getMarkerYear(m1) - calendarSystem.getMarkerYear(m0)\n }\n return null\n }\n\n diffWholeMonths(m0: DateMarker, m1: DateMarker): number {\n let { calendarSystem } = this\n\n if (\n timeAsMs(m0) === timeAsMs(m1) &&\n calendarSystem.getMarkerDay(m0) === calendarSystem.getMarkerDay(m1)\n ) {\n return (calendarSystem.getMarkerMonth(m1) - calendarSystem.getMarkerMonth(m0)) +\n (calendarSystem.getMarkerYear(m1) - calendarSystem.getMarkerYear(m0)) * 12\n }\n return null\n }\n\n\n // Range / Duration\n\n greatestWholeUnit(m0: DateMarker, m1: DateMarker) {\n let n = this.diffWholeYears(m0, m1)\n\n if (n !== null) {\n return { unit: 'year', value: n }\n }\n\n n = this.diffWholeMonths(m0, m1)\n\n if (n !== null) {\n return { unit: 'month', value: n }\n }\n\n n = diffWholeWeeks(m0, m1)\n\n if (n !== null) {\n return { unit: 'week', value: n }\n }\n\n n = diffWholeDays(m0, m1)\n\n if (n !== null) {\n return { unit: 'day', value: n }\n }\n\n n = diffHours(m0, m1)\n\n if (isInt(n)) {\n return { unit: 'hour', value: n }\n }\n\n n = diffMinutes(m0, m1)\n\n if (isInt(n)) {\n return { unit: 'minute', value: n }\n }\n\n n = diffSeconds(m0, m1)\n\n if (isInt(n)) {\n return { unit: 'second', value: n }\n }\n\n return { unit: 'millisecond', value: m1.valueOf() - m0.valueOf() }\n }\n\n countDurationsBetween(m0: DateMarker, m1: DateMarker, d: Duration) {\n // TODO: can use greatestWholeUnit\n let diff\n\n if (d.years) {\n diff = this.diffWholeYears(m0, m1)\n if (diff !== null) {\n return diff / asRoughYears(d)\n }\n }\n\n if (d.months) {\n diff = this.diffWholeMonths(m0, m1)\n if (diff !== null) {\n return diff / asRoughMonths(d)\n }\n }\n\n if (d.days) {\n diff = diffWholeDays(m0, m1)\n if (diff !== null) {\n return diff / asRoughDays(d)\n }\n }\n\n return (m1.valueOf() - m0.valueOf()) / asRoughMs(d)\n }\n\n\n // Start-Of\n\n startOf(m: DateMarker, unit: string) {\n if (unit === 'year') {\n return this.startOfYear(m)\n } else if (unit === 'month') {\n return this.startOfMonth(m)\n } else if (unit === 'week') {\n return this.startOfWeek(m)\n } else if (unit === 'day') {\n return startOfDay(m)\n } else if (unit === 'hour') {\n return startOfHour(m)\n } else if (unit === 'minute') {\n return startOfMinute(m)\n } else if (unit === 'second') {\n return startOfSecond(m)\n }\n }\n\n startOfYear(m: DateMarker): DateMarker {\n return this.calendarSystem.arrayToMarker([\n this.calendarSystem.getMarkerYear(m)\n ])\n }\n\n startOfMonth(m: DateMarker): DateMarker {\n return this.calendarSystem.arrayToMarker([\n this.calendarSystem.getMarkerYear(m),\n this.calendarSystem.getMarkerMonth(m)\n ])\n }\n\n startOfWeek(m: DateMarker): DateMarker {\n return this.calendarSystem.arrayToMarker([\n this.calendarSystem.getMarkerYear(m),\n this.calendarSystem.getMarkerMonth(m),\n m.getUTCDate() - ((m.getUTCDay() - this.weekDow + 7) % 7)\n ])\n }\n\n\n // Week Number\n\n computeWeekNumber(marker: DateMarker): number {\n if (this.weekNumberFunc) {\n return this.weekNumberFunc(this.toDate(marker))\n } else {\n return weekOfYear(marker, this.weekDow, this.weekDoy)\n }\n }\n\n // TODO: choke on timeZoneName: long\n format(marker: DateMarker, formatter: DateFormatter, dateOptions: { forcedTzo?: number } = {}) {\n return formatter.format(\n {\n marker: marker,\n timeZoneOffset: dateOptions.forcedTzo != null ?\n dateOptions.forcedTzo :\n this.offsetForMarker(marker)\n },\n this\n )\n }\n\n formatRange(start: DateMarker, end: DateMarker, formatter: DateFormatter, dateOptions: { forcedStartTzo?: number, forcedEndTzo?: number, isEndExclusive?: boolean } = {}) {\n\n if (dateOptions.isEndExclusive) {\n end = addMs(end, -1)\n }\n\n return formatter.formatRange(\n {\n marker: start,\n timeZoneOffset: dateOptions.forcedStartTzo != null ?\n dateOptions.forcedStartTzo :\n this.offsetForMarker(start)\n },\n {\n marker: end,\n timeZoneOffset: dateOptions.forcedEndTzo != null ?\n dateOptions.forcedEndTzo :\n this.offsetForMarker(end)\n },\n this\n )\n }\n\n formatIso(marker: DateMarker, extraOptions: any = {}) {\n let timeZoneOffset = null\n\n if (!extraOptions.omitTimeZoneOffset) {\n if (extraOptions.forcedTzo != null) {\n timeZoneOffset = extraOptions.forcedTzo\n } else {\n timeZoneOffset = this.offsetForMarker(marker)\n }\n }\n\n return buildIsoString(marker, timeZoneOffset, extraOptions.omitTime)\n }\n\n\n // TimeZone\n\n timestampToMarker(ms: number) {\n if (this.timeZone === 'local') {\n return arrayToUtcDate(dateToLocalArray(new Date(ms)))\n } else if (this.timeZone === 'UTC' || !this.namedTimeZoneImpl) {\n return new Date(ms)\n } else {\n return arrayToUtcDate(this.namedTimeZoneImpl.timestampToArray(ms))\n }\n }\n\n offsetForMarker(m: DateMarker) {\n if (this.timeZone === 'local') {\n return -arrayToLocalDate(dateToUtcArray(m)).getTimezoneOffset() // convert \"inverse\" offset to \"normal\" offset\n } else if (this.timeZone === 'UTC') {\n return 0\n } else if (this.namedTimeZoneImpl) {\n return this.namedTimeZoneImpl.offsetForArray(dateToUtcArray(m))\n }\n return null\n }\n\n\n // Conversion\n\n toDate(m: DateMarker, forcedTzo?: number): Date {\n if (this.timeZone === 'local') {\n return arrayToLocalDate(dateToUtcArray(m))\n } else if (this.timeZone === 'UTC') {\n return new Date(m.valueOf()) // make sure it's a copy\n } else if (!this.namedTimeZoneImpl) {\n return new Date(m.valueOf() - (forcedTzo || 0))\n } else {\n return new Date(\n m.valueOf() -\n this.namedTimeZoneImpl.offsetForArray(dateToUtcArray(m)) * 1000 * 60 // convert minutes -> ms\n )\n }\n }\n\n}\n","import { refineProps } from '../util/misc'\nimport { EventInput } from './event'\nimport Calendar from '../Calendar'\nimport { DateRange } from '../datelib/date-range'\nimport { EventSourceFunc } from '../event-sources/func-event-source'\nimport { EventUi, processUnscopedUiProps } from '../component/event-ui'\nimport { ConstraintInput, AllowFunc } from '../validation'\n\n/*\nParsing and normalization of the EventSource data type, which defines how event data is fetched.\nContains the plugin system for defining new types if event sources.\n\nTODO: \"EventSource\" is the same name as a built-in type in TypeScript. Rethink.\n*/\n\nexport type EventSourceError = {\n message: string\n response?: any // an XHR or something like it\n [otherProp: string]: any\n}\n\nexport type EventInputTransformer = (eventInput: EventInput) => EventInput | null\nexport type EventSourceSuccessResponseHandler = (rawData: any, response: any) => EventInput[] | void\nexport type EventSourceErrorResponseHandler = (error: EventSourceError) => void\n\nexport interface ExtendedEventSourceInput {\n id?: string | number // only accept number?\n allDayDefault?: boolean\n eventDataTransform?: EventInputTransformer\n\n // array or function (TODO: move this to array-event-source/func-event-source?)\n events?: EventInput[] | EventSourceFunc\n\n // json feed (TODO: how to move this to json-feed-event-source?)\n url?: string\n method?: string\n extraParams?: object | (() => object)\n startParam?: string\n endParam?: string\n timeZoneParam?: string\n\n // for any network-related sources\n success?: EventSourceSuccessResponseHandler\n failure?: EventSourceErrorResponseHandler\n\n editable?: boolean\n startEditable?: boolean\n durationEditable?: boolean\n constraint?: ConstraintInput\n overlap?: boolean\n allow?: AllowFunc\n className?: string[] | string\n classNames?: string[] | string\n backgroundColor?: string\n borderColor?: string\n textColor?: string\n color?: string\n\n [otherProp: string]: any // in case plugins want more props\n}\n\nexport type EventSourceInput =\n ExtendedEventSourceInput | // object in extended form\n EventSourceFunc | // just a function\n string // a URL for a JSON feed\n\nexport interface EventSource {\n _raw: any\n sourceId: string\n sourceDefId: number // one of the few IDs that's a NUMBER not a string\n meta: any\n publicId: string\n isFetching: boolean\n latestFetchId: string\n fetchRange: DateRange | null\n allDayDefault: boolean | null\n eventDataTransform: EventInputTransformer\n ui: EventUi\n success: EventSourceSuccessResponseHandler | null\n failure: EventSourceErrorResponseHandler | null\n extendedProps: any // undocumented\n}\n\nexport type EventSourceHash = { [sourceId: string]: EventSource }\n\nexport type EventSourceFetcher = (\n arg: {\n eventSource: EventSource\n calendar: Calendar\n range: DateRange\n },\n success: (res: { rawEvents: EventInput[], xhr?: XMLHttpRequest }) => void,\n failure: (error: EventSourceError) => void\n) => (void | PromiseLike)\n\nexport interface EventSourceDef {\n ignoreRange?: boolean\n parseMeta: (raw: EventSourceInput) => object | null\n fetch: EventSourceFetcher\n}\n\nconst SIMPLE_SOURCE_PROPS = {\n id: String,\n allDayDefault: Boolean,\n eventDataTransform: Function,\n success: Function,\n failure: Function\n}\n\nlet uid = 0\n\nexport function doesSourceNeedRange(eventSource: EventSource, calendar: Calendar) {\n let defs = calendar.pluginSystem.hooks.eventSourceDefs\n\n return !defs[eventSource.sourceDefId].ignoreRange\n}\n\nexport function parseEventSource(raw: EventSourceInput, calendar: Calendar): EventSource | null {\n let defs = calendar.pluginSystem.hooks.eventSourceDefs\n\n for (let i = defs.length - 1; i >= 0; i--) { // later-added plugins take precedence\n let def = defs[i]\n let meta = def.parseMeta(raw)\n\n if (meta) {\n let res = parseEventSourceProps(\n typeof raw === 'object' ? raw : {},\n meta,\n i,\n calendar\n )\n\n res._raw = raw\n return res\n }\n }\n\n return null\n}\n\nfunction parseEventSourceProps(raw: ExtendedEventSourceInput, meta: object, sourceDefId: number, calendar: Calendar): EventSource {\n let leftovers0 = {}\n let props = refineProps(raw, SIMPLE_SOURCE_PROPS, {}, leftovers0)\n let leftovers1 = {}\n let ui = processUnscopedUiProps(leftovers0, calendar, leftovers1)\n\n props.isFetching = false\n props.latestFetchId = ''\n props.fetchRange = null\n props.publicId = String(raw.id || '')\n props.sourceId = String(uid++)\n props.sourceDefId = sourceDefId\n props.meta = meta\n props.ui = ui\n props.extendedProps = leftovers1\n\n return props as EventSource\n}\n","import { EventSource, EventSourceHash, doesSourceNeedRange } from '../structs/event-source'\nimport Calendar from '../Calendar'\nimport { arrayToHash, filterHash } from '../util/object'\nimport { DateRange } from '../datelib/date-range'\nimport { DateProfile } from '../DateProfileGenerator'\nimport { Action } from './types'\n\nexport default function(eventSources: EventSourceHash, action: Action, dateProfile: DateProfile | null, calendar: Calendar): EventSourceHash {\n switch (action.type) {\n\n case 'ADD_EVENT_SOURCES': // already parsed\n return addSources(eventSources, action.sources, dateProfile ? dateProfile.activeRange : null, calendar)\n\n case 'REMOVE_EVENT_SOURCE':\n return removeSource(eventSources, action.sourceId)\n\n case 'PREV': // TODO: how do we track all actions that affect dateProfile :(\n case 'NEXT':\n case 'SET_DATE':\n case 'SET_VIEW_TYPE':\n if (dateProfile) {\n return fetchDirtySources(eventSources, dateProfile.activeRange, calendar)\n } else {\n return eventSources\n }\n\n case 'FETCH_EVENT_SOURCES':\n case 'CHANGE_TIMEZONE':\n return fetchSourcesByIds(\n eventSources,\n (action as any).sourceIds ?\n arrayToHash((action as any).sourceIds) :\n excludeStaticSources(eventSources, calendar),\n dateProfile ? dateProfile.activeRange : null,\n calendar\n )\n\n case 'RECEIVE_EVENTS':\n case 'RECEIVE_EVENT_ERROR':\n return receiveResponse(eventSources, action.sourceId, action.fetchId, action.fetchRange)\n\n case 'REMOVE_ALL_EVENT_SOURCES':\n return {}\n\n default:\n return eventSources\n }\n}\n\n\nlet uid = 0\n\n\nfunction addSources(eventSourceHash: EventSourceHash, sources: EventSource[], fetchRange: DateRange | null, calendar: Calendar): EventSourceHash {\n let hash: EventSourceHash = {}\n\n for (let source of sources) {\n hash[source.sourceId] = source\n }\n\n if (fetchRange) {\n hash = fetchDirtySources(hash, fetchRange, calendar)\n }\n\n return { ...eventSourceHash, ...hash }\n}\n\n\nfunction removeSource(eventSourceHash: EventSourceHash, sourceId: string): EventSourceHash {\n return filterHash(eventSourceHash, function(eventSource: EventSource) {\n return eventSource.sourceId !== sourceId\n })\n}\n\n\nfunction fetchDirtySources(sourceHash: EventSourceHash, fetchRange: DateRange, calendar: Calendar): EventSourceHash {\n return fetchSourcesByIds(\n sourceHash,\n filterHash(sourceHash, function(eventSource) {\n return isSourceDirty(eventSource, fetchRange, calendar)\n }),\n fetchRange,\n calendar\n )\n}\n\n\nfunction isSourceDirty(eventSource: EventSource, fetchRange: DateRange, calendar: Calendar) {\n\n if (!doesSourceNeedRange(eventSource, calendar)) {\n return !eventSource.latestFetchId\n } else {\n return !calendar.opt('lazyFetching') ||\n !eventSource.fetchRange ||\n fetchRange.start < eventSource.fetchRange.start ||\n fetchRange.end > eventSource.fetchRange.end\n }\n}\n\n\nfunction fetchSourcesByIds(\n prevSources: EventSourceHash,\n sourceIdHash: { [sourceId: string]: any },\n fetchRange: DateRange,\n calendar: Calendar\n): EventSourceHash {\n let nextSources: EventSourceHash = {}\n\n for (let sourceId in prevSources) {\n let source = prevSources[sourceId]\n\n if (sourceIdHash[sourceId]) {\n nextSources[sourceId] = fetchSource(source, fetchRange, calendar)\n } else {\n nextSources[sourceId] = source\n }\n }\n\n return nextSources\n}\n\n\nfunction fetchSource(eventSource: EventSource, fetchRange: DateRange, calendar: Calendar) {\n let sourceDef = calendar.pluginSystem.hooks.eventSourceDefs[eventSource.sourceDefId]\n let fetchId = String(uid++)\n\n sourceDef.fetch(\n {\n eventSource,\n calendar,\n range: fetchRange\n },\n function(res) {\n let { rawEvents } = res\n let calSuccess = calendar.opt('eventSourceSuccess')\n let calSuccessRes\n let sourceSuccessRes\n\n if (eventSource.success) {\n sourceSuccessRes = eventSource.success(rawEvents, res.xhr)\n }\n if (calSuccess) {\n calSuccessRes = calSuccess(rawEvents, res.xhr)\n }\n\n rawEvents = sourceSuccessRes || calSuccessRes || rawEvents\n\n calendar.dispatch({\n type: 'RECEIVE_EVENTS',\n sourceId: eventSource.sourceId,\n fetchId,\n fetchRange,\n rawEvents\n })\n },\n function(error) {\n let callFailure = calendar.opt('eventSourceFailure')\n\n console.warn(error.message, error)\n\n if (eventSource.failure) {\n eventSource.failure(error)\n }\n if (callFailure) {\n callFailure(error)\n }\n\n calendar.dispatch({\n type: 'RECEIVE_EVENT_ERROR',\n sourceId: eventSource.sourceId,\n fetchId,\n fetchRange,\n error\n })\n }\n )\n\n return {\n ...eventSource,\n isFetching: true,\n latestFetchId: fetchId\n }\n}\n\n\nfunction receiveResponse(sourceHash: EventSourceHash, sourceId: string, fetchId: string, fetchRange: DateRange) {\n let eventSource: EventSource = sourceHash[sourceId]\n\n if (\n eventSource && // not already removed\n fetchId === eventSource.latestFetchId\n ) {\n return {\n ...sourceHash,\n [sourceId]: {\n ...eventSource,\n isFetching: false,\n fetchRange\n }\n }\n }\n\n return sourceHash\n}\n\n\nfunction excludeStaticSources(eventSources: EventSourceHash, calendar: Calendar): EventSourceHash {\n return filterHash(eventSources, function(eventSource) {\n return doesSourceNeedRange(eventSource, calendar)\n })\n}\n","import { DateMarker, startOfDay, addDays } from './datelib/marker'\nimport { Duration, createDuration, getWeeksFromInput, asRoughDays, asRoughMs, greatestDurationDenominator, durationsEqual } from './datelib/duration'\nimport { DateRange, OpenDateRange, constrainMarkerToRange, intersectRanges, rangesIntersect, parseRange, rangesEqual } from './datelib/date-range'\nimport { ViewSpec } from './structs/view-spec'\nimport { DateEnv } from './datelib/env'\nimport Calendar from './Calendar'\nimport { computeVisibleDayRange } from './util/misc'\n\n\nexport interface DateProfile {\n currentRange: DateRange\n currentRangeUnit: string\n isRangeAllDay: boolean\n validRange: OpenDateRange\n activeRange: DateRange\n renderRange: DateRange\n minTime: Duration\n maxTime: Duration\n isValid: boolean\n dateIncrement: Duration\n}\n\n\nexport default class DateProfileGenerator {\n\n viewSpec: ViewSpec\n options: any\n dateEnv: DateEnv\n calendar: Calendar // avoid\n isHiddenDayHash: boolean[]\n\n\n constructor(viewSpec: ViewSpec, calendar: Calendar) {\n this.viewSpec = viewSpec\n this.options = viewSpec.options\n this.dateEnv = calendar.dateEnv\n this.calendar = calendar\n\n this.initHiddenDays()\n }\n\n\n /* Date Range Computation\n ------------------------------------------------------------------------------------------------------------------*/\n\n\n // Builds a structure with info about what the dates/ranges will be for the \"prev\" view.\n buildPrev(currentDateProfile: DateProfile, currentDate: DateMarker): DateProfile {\n let { dateEnv } = this\n\n let prevDate = dateEnv.subtract(\n dateEnv.startOf(currentDate, currentDateProfile.currentRangeUnit), // important for start-of-month\n currentDateProfile.dateIncrement\n )\n\n return this.build(prevDate, -1)\n }\n\n\n // Builds a structure with info about what the dates/ranges will be for the \"next\" view.\n buildNext(currentDateProfile: DateProfile, currentDate: DateMarker): DateProfile {\n let { dateEnv } = this\n\n let nextDate = dateEnv.add(\n dateEnv.startOf(currentDate, currentDateProfile.currentRangeUnit), // important for start-of-month\n currentDateProfile.dateIncrement\n )\n\n return this.build(nextDate, 1)\n }\n\n\n // Builds a structure holding dates/ranges for rendering around the given date.\n // Optional direction param indicates whether the date is being incremented/decremented\n // from its previous value. decremented = -1, incremented = 1 (default).\n build(currentDate: DateMarker, direction?, forceToValid = false): DateProfile {\n let validRange: DateRange\n let minTime = null\n let maxTime = null\n let currentInfo\n let isRangeAllDay\n let renderRange: DateRange\n let activeRange: DateRange\n let isValid\n\n validRange = this.buildValidRange()\n validRange = this.trimHiddenDays(validRange)\n\n if (forceToValid) {\n currentDate = constrainMarkerToRange(currentDate, validRange)\n }\n\n currentInfo = this.buildCurrentRangeInfo(currentDate, direction)\n isRangeAllDay = /^(year|month|week|day)$/.test(currentInfo.unit)\n renderRange = this.buildRenderRange(\n this.trimHiddenDays(currentInfo.range),\n currentInfo.unit,\n isRangeAllDay\n )\n renderRange = this.trimHiddenDays(renderRange)\n activeRange = renderRange\n\n if (!this.options.showNonCurrentDates) {\n activeRange = intersectRanges(activeRange, currentInfo.range)\n }\n\n minTime = createDuration(this.options.minTime)\n maxTime = createDuration(this.options.maxTime)\n activeRange = this.adjustActiveRange(activeRange, minTime, maxTime)\n activeRange = intersectRanges(activeRange, validRange) // might return null\n\n // it's invalid if the originally requested date is not contained,\n // or if the range is completely outside of the valid range.\n isValid = rangesIntersect(currentInfo.range, validRange)\n\n return {\n // constraint for where prev/next operations can go and where events can be dragged/resized to.\n // an object with optional start and end properties.\n validRange: validRange,\n\n // range the view is formally responsible for.\n // for example, a month view might have 1st-31st, excluding padded dates\n currentRange: currentInfo.range,\n\n // name of largest unit being displayed, like \"month\" or \"week\"\n currentRangeUnit: currentInfo.unit,\n\n isRangeAllDay,\n\n // dates that display events and accept drag-n-drop\n // will be `null` if no dates accept events\n activeRange,\n\n // date range with a rendered skeleton\n // includes not-active days that need some sort of DOM\n renderRange,\n\n // Duration object that denotes the first visible time of any given day\n minTime,\n\n // Duration object that denotes the exclusive visible end time of any given day\n maxTime,\n\n isValid,\n\n // how far the current date will move for a prev/next operation\n dateIncrement: this.buildDateIncrement(currentInfo.duration)\n // pass a fallback (might be null) ^\n }\n }\n\n\n // Builds an object with optional start/end properties.\n // Indicates the minimum/maximum dates to display.\n // not responsible for trimming hidden days.\n buildValidRange(): OpenDateRange {\n return this.getRangeOption('validRange', this.calendar.getNow()) ||\n { start: null, end: null } // completely open-ended\n }\n\n\n // Builds a structure with info about the \"current\" range, the range that is\n // highlighted as being the current month for example.\n // See build() for a description of `direction`.\n // Guaranteed to have `range` and `unit` properties. `duration` is optional.\n buildCurrentRangeInfo(date: DateMarker, direction) {\n let { viewSpec, dateEnv } = this\n let duration = null\n let unit = null\n let range = null\n let dayCount\n\n if (viewSpec.duration) {\n duration = viewSpec.duration\n unit = viewSpec.durationUnit\n range = this.buildRangeFromDuration(date, direction, duration, unit)\n } else if ((dayCount = this.options.dayCount)) {\n unit = 'day'\n range = this.buildRangeFromDayCount(date, direction, dayCount)\n } else if ((range = this.buildCustomVisibleRange(date))) {\n unit = dateEnv.greatestWholeUnit(range.start, range.end).unit\n } else {\n duration = this.getFallbackDuration()\n unit = greatestDurationDenominator(duration).unit\n range = this.buildRangeFromDuration(date, direction, duration, unit)\n }\n\n return { duration: duration, unit: unit, range }\n }\n\n\n getFallbackDuration(): Duration {\n return createDuration({ day: 1 })\n }\n\n\n // Returns a new activeRange to have time values (un-ambiguate)\n // minTime or maxTime causes the range to expand.\n adjustActiveRange(range: DateRange, minTime: Duration, maxTime: Duration) {\n let { dateEnv } = this\n let start = range.start\n let end = range.end\n\n if ((this.viewSpec.class as any).prototype.usesMinMaxTime) {\n\n // expand active range if minTime is negative (why not when positive?)\n if (asRoughDays(minTime) < 0) {\n start = startOfDay(start) // necessary?\n start = dateEnv.add(start, minTime)\n }\n\n // expand active range if maxTime is beyond one day (why not when positive?)\n if (asRoughDays(maxTime) > 1) {\n end = startOfDay(end) // necessary?\n end = addDays(end, -1)\n end = dateEnv.add(end, maxTime)\n }\n }\n\n return { start, end }\n }\n\n\n // Builds the \"current\" range when it is specified as an explicit duration.\n // `unit` is the already-computed greatestDurationDenominator unit of duration.\n buildRangeFromDuration(date: DateMarker, direction, duration: Duration, unit) {\n let { dateEnv } = this\n let alignment = this.options.dateAlignment\n let dateIncrementInput\n let dateIncrementDuration\n let start: DateMarker\n let end: DateMarker\n let res\n\n // compute what the alignment should be\n if (!alignment) {\n dateIncrementInput = this.options.dateIncrement\n\n if (dateIncrementInput) {\n dateIncrementDuration = createDuration(dateIncrementInput)\n\n // use the smaller of the two units\n if (asRoughMs(dateIncrementDuration) < asRoughMs(duration)) {\n alignment = greatestDurationDenominator(\n dateIncrementDuration,\n !getWeeksFromInput(dateIncrementInput)\n ).unit\n } else {\n alignment = unit\n }\n } else {\n alignment = unit\n }\n }\n\n // if the view displays a single day or smaller\n if (asRoughDays(duration) <= 1) {\n if (this.isHiddenDay(start)) {\n start = this.skipHiddenDays(start, direction)\n start = startOfDay(start)\n }\n }\n\n function computeRes() {\n start = dateEnv.startOf(date, alignment)\n end = dateEnv.add(start, duration)\n res = { start, end }\n }\n\n computeRes()\n\n // if range is completely enveloped by hidden days, go past the hidden days\n if (!this.trimHiddenDays(res)) {\n date = this.skipHiddenDays(date, direction)\n computeRes()\n }\n\n return res\n }\n\n\n // Builds the \"current\" range when a dayCount is specified.\n buildRangeFromDayCount(date: DateMarker, direction, dayCount) {\n let { dateEnv } = this\n let customAlignment = this.options.dateAlignment\n let runningCount = 0\n let start: DateMarker = date\n let end: DateMarker\n\n if (customAlignment) {\n start = dateEnv.startOf(start, customAlignment)\n }\n\n start = startOfDay(start)\n start = this.skipHiddenDays(start, direction)\n\n end = start\n do {\n end = addDays(end, 1)\n if (!this.isHiddenDay(end)) {\n runningCount++\n }\n } while (runningCount < dayCount)\n\n return { start, end }\n }\n\n\n // Builds a normalized range object for the \"visible\" range,\n // which is a way to define the currentRange and activeRange at the same time.\n buildCustomVisibleRange(date: DateMarker) {\n let { dateEnv } = this\n let visibleRange = this.getRangeOption('visibleRange', dateEnv.toDate(date))\n\n if (visibleRange && (visibleRange.start == null || visibleRange.end == null)) {\n return null\n }\n\n return visibleRange\n }\n\n\n // Computes the range that will represent the element/cells for *rendering*,\n // but which may have voided days/times.\n // not responsible for trimming hidden days.\n buildRenderRange(currentRange: DateRange, currentRangeUnit, isRangeAllDay) {\n return currentRange\n }\n\n\n // Compute the duration value that should be added/substracted to the current date\n // when a prev/next operation happens.\n buildDateIncrement(fallback): Duration {\n let dateIncrementInput = this.options.dateIncrement\n let customAlignment\n\n if (dateIncrementInput) {\n return createDuration(dateIncrementInput)\n } else if ((customAlignment = this.options.dateAlignment)) {\n return createDuration(1, customAlignment)\n } else if (fallback) {\n return fallback\n } else {\n return createDuration({ days: 1 })\n }\n }\n\n\n // Arguments after name will be forwarded to a hypothetical function value\n // WARNING: passed-in arguments will be given to generator functions as-is and can cause side-effects.\n // Always clone your objects if you fear mutation.\n getRangeOption(name, ...otherArgs): OpenDateRange {\n let val = this.options[name]\n\n if (typeof val === 'function') {\n val = val.apply(null, otherArgs)\n }\n\n if (val) {\n val = parseRange(val, this.dateEnv)\n }\n\n if (val) {\n val = computeVisibleDayRange(val)\n }\n\n return val\n }\n\n\n /* Hidden Days\n ------------------------------------------------------------------------------------------------------------------*/\n\n\n // Initializes internal variables related to calculating hidden days-of-week\n initHiddenDays() {\n let hiddenDays = this.options.hiddenDays || [] // array of day-of-week indices that are hidden\n let isHiddenDayHash = [] // is the day-of-week hidden? (hash with day-of-week-index -> bool)\n let dayCnt = 0\n let i\n\n if (this.options.weekends === false) {\n hiddenDays.push(0, 6) // 0=sunday, 6=saturday\n }\n\n for (i = 0; i < 7; i++) {\n if (\n !(isHiddenDayHash[i] = hiddenDays.indexOf(i) !== -1)\n ) {\n dayCnt++\n }\n }\n\n if (!dayCnt) {\n throw new Error('invalid hiddenDays') // all days were hidden? bad.\n }\n\n this.isHiddenDayHash = isHiddenDayHash\n }\n\n\n // Remove days from the beginning and end of the range that are computed as hidden.\n // If the whole range is trimmed off, returns null\n trimHiddenDays(range: DateRange): DateRange | null {\n let start = range.start\n let end = range.end\n\n if (start) {\n start = this.skipHiddenDays(start)\n }\n\n if (end) {\n end = this.skipHiddenDays(end, -1, true)\n }\n\n if (start == null || end == null || start < end) {\n return { start, end }\n }\n\n return null\n }\n\n\n // Is the current day hidden?\n // `day` is a day-of-week index (0-6), or a Date (used for UTC)\n isHiddenDay(day) {\n if (day instanceof Date) {\n day = day.getUTCDay()\n }\n return this.isHiddenDayHash[day]\n }\n\n\n // Incrementing the current day until it is no longer a hidden day, returning a copy.\n // DOES NOT CONSIDER validRange!\n // If the initial value of `date` is not a hidden day, don't do anything.\n // Pass `isExclusive` as `true` if you are dealing with an end date.\n // `inc` defaults to `1` (increment one day forward each time)\n skipHiddenDays(date: DateMarker, inc = 1, isExclusive = false) {\n while (\n this.isHiddenDayHash[(date.getUTCDay() + (isExclusive ? inc : 0) + 7) % 7]\n ) {\n date = addDays(date, inc)\n }\n return date\n }\n\n}\n\n// TODO: find a way to avoid comparing DateProfiles. it's tedious\nexport function isDateProfilesEqual(p0: DateProfile, p1: DateProfile) {\n return rangesEqual(p0.activeRange, p1.activeRange) &&\n rangesEqual(p0.validRange, p1.validRange) &&\n durationsEqual(p0.minTime, p1.minTime) &&\n durationsEqual(p0.maxTime, p1.maxTime)\n}\n","import Calendar from '../Calendar'\nimport reduceEventSources from './eventSources'\nimport reduceEventStore from './eventStore'\nimport { DateProfile, isDateProfilesEqual } from '../DateProfileGenerator'\nimport { DateSpan } from '../structs/date-span'\nimport { EventInteractionState } from '../interactions/event-interaction-state'\nimport { CalendarState, Action } from './types'\nimport { EventSourceHash } from '../structs/event-source'\nimport { DateMarker } from '../datelib/marker'\nimport { rangeContainsMarker } from '../datelib/date-range'\n\nexport default function(state: CalendarState, action: Action, calendar: Calendar): CalendarState {\n\n let viewType = reduceViewType(state.viewType, action)\n let dateProfile = reduceDateProfile(state.dateProfile, action, state.currentDate, viewType, calendar)\n let eventSources = reduceEventSources(state.eventSources, action, dateProfile, calendar)\n\n let nextState = {\n ...state,\n viewType,\n dateProfile,\n currentDate: reduceCurrentDate(state.currentDate, action, dateProfile),\n eventSources,\n eventStore: reduceEventStore(state.eventStore, action, eventSources, dateProfile, calendar),\n dateSelection: reduceDateSelection(state.dateSelection, action, calendar),\n eventSelection: reduceSelectedEvent(state.eventSelection, action),\n eventDrag: reduceEventDrag(state.eventDrag, action, eventSources, calendar),\n eventResize: reduceEventResize(state.eventResize, action, eventSources, calendar),\n eventSourceLoadingLevel: computeLoadingLevel(eventSources),\n loadingLevel: computeLoadingLevel(eventSources)\n }\n\n for (let reducerFunc of calendar.pluginSystem.hooks.reducers) {\n nextState = reducerFunc(nextState, action, calendar)\n }\n\n // console.log(action.type, nextState)\n\n return nextState\n}\n\nfunction reduceViewType(currentViewType: string, action: Action): string {\n switch (action.type) {\n case 'SET_VIEW_TYPE':\n return action.viewType\n default:\n return currentViewType\n }\n}\n\nfunction reduceDateProfile(currentDateProfile: DateProfile | null, action: Action, currentDate: DateMarker, viewType: string, calendar: Calendar): DateProfile {\n let newDateProfile: DateProfile\n\n switch (action.type) {\n\n case 'PREV':\n newDateProfile = calendar.dateProfileGenerators[viewType].buildPrev(currentDateProfile, currentDate)\n break\n\n case 'NEXT':\n newDateProfile = calendar.dateProfileGenerators[viewType].buildNext(currentDateProfile, currentDate)\n break\n\n case 'SET_DATE':\n if (\n !currentDateProfile.activeRange ||\n !rangeContainsMarker(currentDateProfile.currentRange, action.dateMarker)\n ) {\n newDateProfile = calendar.dateProfileGenerators[viewType].build(\n action.dateMarker,\n undefined,\n true // forceToValid\n )\n }\n break\n\n case 'SET_VIEW_TYPE':\n let generator = calendar.dateProfileGenerators[viewType]\n\n if (!generator) {\n throw new Error(\n viewType ?\n 'The FullCalendar view \"' + viewType + '\" does not exist. Make sure your plugins are loaded correctly.' :\n 'No available FullCalendar view plugins.'\n )\n }\n\n newDateProfile = generator.build(\n action.dateMarker || currentDate,\n undefined,\n true // forceToValid\n )\n break\n }\n\n if (\n newDateProfile &&\n newDateProfile.isValid &&\n !(currentDateProfile && isDateProfilesEqual(currentDateProfile, newDateProfile))\n ) {\n return newDateProfile\n } else {\n return currentDateProfile\n }\n}\n\nfunction reduceCurrentDate(currentDate: DateMarker, action: Action, dateProfile: DateProfile): DateMarker {\n switch (action.type) {\n\n case 'PREV':\n case 'NEXT':\n if (!rangeContainsMarker(dateProfile.currentRange, currentDate)) {\n return dateProfile.currentRange.start\n } else {\n return currentDate\n }\n\n case 'SET_DATE':\n case 'SET_VIEW_TYPE':\n let newDate = action.dateMarker || currentDate\n if (dateProfile.activeRange && !rangeContainsMarker(dateProfile.activeRange, newDate)) {\n return dateProfile.currentRange.start\n } else {\n return newDate\n }\n\n default:\n return currentDate\n }\n}\n\nfunction reduceDateSelection(currentSelection: DateSpan | null, action: Action, calendar: Calendar) {\n switch (action.type) {\n case 'SELECT_DATES':\n return action.selection\n case 'UNSELECT_DATES':\n return null\n default:\n return currentSelection\n }\n}\n\nfunction reduceSelectedEvent(currentInstanceId: string, action: Action): string {\n switch (action.type) {\n case 'SELECT_EVENT':\n return action.eventInstanceId\n case 'UNSELECT_EVENT':\n return ''\n default:\n return currentInstanceId\n }\n}\n\nfunction reduceEventDrag(currentDrag: EventInteractionState | null, action: Action, sources: EventSourceHash, calendar: Calendar): EventInteractionState | null {\n switch (action.type) {\n\n case 'SET_EVENT_DRAG':\n let newDrag = action.state\n\n return {\n affectedEvents: newDrag.affectedEvents,\n mutatedEvents: newDrag.mutatedEvents,\n isEvent: newDrag.isEvent,\n origSeg: newDrag.origSeg\n }\n\n case 'UNSET_EVENT_DRAG':\n return null\n\n default:\n return currentDrag\n }\n}\n\nfunction reduceEventResize(currentResize: EventInteractionState | null, action: Action, sources: EventSourceHash, calendar: Calendar): EventInteractionState | null {\n switch (action.type) {\n\n case 'SET_EVENT_RESIZE':\n let newResize = action.state\n\n return {\n affectedEvents: newResize.affectedEvents,\n mutatedEvents: newResize.mutatedEvents,\n isEvent: newResize.isEvent,\n origSeg: newResize.origSeg\n }\n\n case 'UNSET_EVENT_RESIZE':\n return null\n\n default:\n return currentResize\n }\n}\n\nfunction computeLoadingLevel(eventSources: EventSourceHash): number {\n let cnt = 0\n\n for (let sourceId in eventSources) {\n if (eventSources[sourceId].isFetching) {\n cnt++\n }\n }\n\n return cnt\n}\n","import { DateRange, rangesEqual, OpenDateRange } from '../datelib/date-range'\nimport { DateInput, DateEnv } from '../datelib/env'\nimport { refineProps } from '../util/misc'\nimport { Duration } from '../datelib/duration'\nimport { parseEventDef, createEventInstance } from './event'\nimport { EventRenderRange, compileEventUi } from '../component/event-rendering'\nimport { EventUiHash } from '../component/event-ui'\nimport Calendar from '../Calendar'\n\n/*\nA data-structure for a date-range that will be visually displayed.\nContains other metadata like allDay, and anything else Components might like to store.\n\nTODO: in future, put otherProps in own object.\n*/\n\nexport interface OpenDateSpanInput {\n start?: DateInput\n end?: DateInput\n allDay?: boolean\n [otherProp: string]: any\n}\n\nexport interface DateSpanInput extends OpenDateSpanInput {\n start: DateInput\n end: DateInput\n}\n\nexport interface OpenDateSpan {\n range: OpenDateRange\n allDay: boolean\n [otherProp: string]: any\n}\n\nexport interface DateSpan extends OpenDateSpan {\n range: DateRange\n}\n\nexport interface DateSpanApi {\n start: Date\n end: Date\n startStr: string\n endStr: string\n allDay: boolean\n}\n\nexport interface DatePointApi {\n date: Date\n dateStr: string\n allDay: boolean\n}\n\nconst STANDARD_PROPS = {\n start: null,\n end: null,\n allDay: Boolean\n}\n\nexport function parseDateSpan(raw: DateSpanInput, dateEnv: DateEnv, defaultDuration?: Duration): DateSpan | null {\n let span = parseOpenDateSpan(raw, dateEnv)\n let { range } = span\n\n if (!range.start) {\n return null\n }\n\n if (!range.end) {\n if (defaultDuration == null) {\n return null\n } else {\n range.end = dateEnv.add(range.start, defaultDuration)\n }\n }\n\n return span as DateSpan\n}\n\n/*\nTODO: somehow combine with parseRange?\nWill return null if the start/end props were present but parsed invalidly.\n*/\nexport function parseOpenDateSpan(raw: OpenDateSpanInput, dateEnv: DateEnv): OpenDateSpan | null {\n let leftovers = {} as DateSpan\n let standardProps = refineProps(raw, STANDARD_PROPS, {}, leftovers)\n let startMeta = standardProps.start ? dateEnv.createMarkerMeta(standardProps.start) : null\n let endMeta = standardProps.end ? dateEnv.createMarkerMeta(standardProps.end) : null\n let allDay = standardProps.allDay\n\n if (allDay == null) {\n allDay = (startMeta && startMeta.isTimeUnspecified) &&\n (!endMeta || endMeta.isTimeUnspecified)\n }\n\n // use this leftover object as the selection object\n leftovers.range = {\n start: startMeta ? startMeta.marker : null,\n end: endMeta ? endMeta.marker : null\n }\n leftovers.allDay = allDay\n\n return leftovers\n}\n\nexport function isDateSpansEqual(span0: DateSpan, span1: DateSpan): boolean {\n return rangesEqual(span0.range, span1.range) &&\n span0.allDay === span1.allDay &&\n isSpanPropsEqual(span0, span1)\n}\n\n// the NON-DATE-RELATED props\nfunction isSpanPropsEqual(span0: DateSpan, span1: DateSpan): boolean {\n\n for (let propName in span1) {\n if (propName !== 'range' && propName !== 'allDay') {\n if (span0[propName] !== span1[propName]) {\n return false\n }\n }\n }\n\n // are there any props that span0 has that span1 DOESN'T have?\n // both have range/allDay, so no need to special-case.\n for (let propName in span0) {\n if (!(propName in span1)) {\n return false\n }\n }\n\n return true\n}\n\nexport function buildDateSpanApi(span: DateSpan, dateEnv: DateEnv): DateSpanApi {\n return {\n start: dateEnv.toDate(span.range.start),\n end: dateEnv.toDate(span.range.end),\n startStr: dateEnv.formatIso(span.range.start, { omitTime: span.allDay }),\n endStr: dateEnv.formatIso(span.range.end, { omitTime: span.allDay }),\n allDay: span.allDay\n }\n}\n\nexport function buildDatePointApi(span: DateSpan, dateEnv: DateEnv): DatePointApi {\n return {\n date: dateEnv.toDate(span.range.start),\n dateStr: dateEnv.formatIso(span.range.start, { omitTime: span.allDay }),\n allDay: span.allDay\n }\n}\n\nexport function fabricateEventRange(dateSpan: DateSpan, eventUiBases: EventUiHash, calendar: Calendar): EventRenderRange {\n let def = parseEventDef(\n { editable: false },\n '', // sourceId\n dateSpan.allDay,\n true, // hasEnd\n calendar\n )\n\n return {\n def,\n ui: compileEventUi(def, eventUiBases),\n instance: createEventInstance(def.defId, dateSpan.range),\n range: dateSpan.range,\n isStart: true,\n isEnd: true\n }\n}\n","import { ViewClass, ViewConfigHash } from './view-config'\n\n/*\nRepresents information for an instantiatable View class along with settings\nthat are specific to that view. No other settings, like calendar-wide settings, are stored.\n*/\nexport interface ViewDef {\n type: string\n class: ViewClass\n overrides: any\n defaults: any\n}\n\nexport type ViewDefHash = { [viewType: string]: ViewDef }\n\nexport function compileViewDefs(defaultConfigs: ViewConfigHash, overrideConfigs: ViewConfigHash): ViewDefHash {\n let hash: ViewDefHash = {}\n let viewType: string\n\n for (viewType in defaultConfigs) {\n ensureViewDef(viewType, hash, defaultConfigs, overrideConfigs)\n }\n\n for (viewType in overrideConfigs) {\n ensureViewDef(viewType, hash, defaultConfigs, overrideConfigs)\n }\n\n return hash\n}\n\nfunction ensureViewDef(viewType: string, hash: ViewDefHash, defaultConfigs: ViewConfigHash, overrideConfigs: ViewConfigHash): ViewDef | null {\n if (hash[viewType]) {\n return hash[viewType]\n }\n\n let viewDef = buildViewDef(viewType, hash, defaultConfigs, overrideConfigs)\n\n if (viewDef) {\n hash[viewType] = viewDef\n }\n\n return viewDef\n}\n\nfunction buildViewDef(viewType: string, hash: ViewDefHash, defaultConfigs: ViewConfigHash, overrideConfigs: ViewConfigHash): ViewDef | null {\n let defaultConfig = defaultConfigs[viewType]\n let overrideConfig = overrideConfigs[viewType]\n\n let queryProp = function(name) {\n return (defaultConfig && defaultConfig[name] !== null) ? defaultConfig[name] :\n ((overrideConfig && overrideConfig[name] !== null) ? overrideConfig[name] : null)\n }\n\n let theClass = queryProp('class') as ViewClass\n let superType = queryProp('superType') as string\n\n if (!superType && theClass) {\n superType =\n findViewNameBySubclass(theClass, overrideConfigs) ||\n findViewNameBySubclass(theClass, defaultConfigs)\n }\n\n let superDef = superType ? ensureViewDef(superType, hash, defaultConfigs, overrideConfigs) : null\n\n if (!theClass && superDef) {\n theClass = superDef.class\n }\n\n if (!theClass) {\n return null // don't throw a warning, might be settings for a single-unit view\n }\n\n return {\n type: viewType,\n class: theClass,\n defaults: {\n ...(superDef ? superDef.defaults : {}),\n ...(defaultConfig ? defaultConfig.options : {})\n },\n overrides: {\n ...(superDef ? superDef.overrides : {}),\n ...(overrideConfig ? overrideConfig.options : {})\n }\n }\n}\n\nfunction findViewNameBySubclass(viewSubclass: ViewClass, configs: ViewConfigHash): string {\n let superProto = Object.getPrototypeOf(viewSubclass.prototype)\n\n for (let viewType in configs) {\n let parsed = configs[viewType]\n\n // need DIRECT subclass, so instanceof won't do it\n if (parsed.class && parsed.class.prototype === superProto) {\n return viewType\n }\n }\n\n return ''\n}\n","import View from '../View'\nimport { ViewSpec } from './view-spec'\nimport { refineProps } from '../util/misc'\nimport { mapHash } from '../util/object'\nimport { ComponentContext } from '../component/Component'\nimport DateProfileGenerator from '../DateProfileGenerator'\n\n/*\nA view-config represents information for either:\nA) creating a new instantiatable view class. in which case, supplied a class/type in addition to options, OR\nB) options to customize an existing view, in which case only provides options.\n*/\n\nexport type ViewClass = new(\n context: ComponentContext,\n viewSpec: ViewSpec,\n dateProfileGenerator:\n DateProfileGenerator,\n parentEl: HTMLElement\n) => View\n\nexport interface ViewConfigObjectInput {\n type?: string\n class?: ViewClass\n [optionName: string]: any\n}\n\nexport type ViewConfigInput = ViewClass | ViewConfigObjectInput\nexport type ViewConfigInputHash = { [viewType: string]: ViewConfigInput }\n\nexport interface ViewConfig {\n superType: string\n class: ViewClass | null\n options: any\n}\n\nexport type ViewConfigHash = { [viewType: string]: ViewConfig }\n\nexport function parseViewConfigs(inputs: ViewConfigInputHash): ViewConfigHash {\n return mapHash(inputs, parseViewConfig)\n}\n\nconst VIEW_DEF_PROPS = {\n type: String,\n class: null\n}\n\nfunction parseViewConfig(input: ViewConfigInput): ViewConfig {\n if (typeof input === 'function') {\n input = { class: input }\n }\n\n let options = {}\n let props = refineProps(input, VIEW_DEF_PROPS, {}, options)\n\n return {\n superType: props.type,\n class: props.class,\n options\n }\n}\n","import { ViewDef, compileViewDefs } from './view-def'\nimport { Duration, createDuration, greatestDurationDenominator, getWeeksFromInput } from '../datelib/duration'\nimport OptionsManager from '../OptionsManager'\nimport { mapHash } from '../util/object'\nimport { globalDefaults } from '../options'\nimport { ViewConfigInputHash, parseViewConfigs, ViewConfigHash, ViewClass } from './view-config'\n\n/*\nRepresents everything needed to instantiate a new view instance,\nincluding options that have been compiled from view-specific and calendar-wide options,\nas well as duration information.\n\nOverall flow:\nViewConfig -> ViewDef -> ViewSpec\n*/\nexport interface ViewSpec {\n type: string\n class: ViewClass\n duration: Duration\n durationUnit: string\n singleUnit: string\n options: any\n buttonTextOverride: string\n buttonTextDefault: string\n}\n\nexport type ViewSpecHash = { [viewType: string]: ViewSpec }\n\nexport function buildViewSpecs(defaultInputs: ViewConfigInputHash, optionsManager: OptionsManager): ViewSpecHash {\n let defaultConfigs = parseViewConfigs(defaultInputs)\n let overrideConfigs = parseViewConfigs(optionsManager.overrides.views)\n let viewDefs = compileViewDefs(defaultConfigs, overrideConfigs)\n\n return mapHash(viewDefs, function(viewDef) {\n return buildViewSpec(viewDef, overrideConfigs, optionsManager)\n })\n}\n\nfunction buildViewSpec(viewDef: ViewDef, overrideConfigs: ViewConfigHash, optionsManager: OptionsManager): ViewSpec {\n let durationInput =\n viewDef.overrides.duration ||\n viewDef.defaults.duration ||\n optionsManager.dynamicOverrides.duration ||\n optionsManager.overrides.duration\n\n let duration = null\n let durationUnit = ''\n let singleUnit = ''\n let singleUnitOverrides = {}\n\n if (durationInput) {\n duration = createDuration(durationInput)\n\n if (duration) { // valid?\n let denom = greatestDurationDenominator(\n duration,\n !getWeeksFromInput(durationInput)\n )\n\n durationUnit = denom.unit\n\n if (denom.value === 1) {\n singleUnit = durationUnit\n singleUnitOverrides = overrideConfigs[durationUnit] ? overrideConfigs[durationUnit].options : {}\n }\n }\n }\n\n let queryButtonText = function(options) {\n let buttonTextMap = options.buttonText || {}\n let buttonTextKey = viewDef.defaults.buttonTextKey\n\n if (buttonTextKey != null && buttonTextMap[buttonTextKey] != null) {\n return buttonTextMap[buttonTextKey]\n }\n\n if (buttonTextMap[viewDef.type] != null) {\n return buttonTextMap[viewDef.type]\n }\n\n if (buttonTextMap[singleUnit] != null) {\n return buttonTextMap[singleUnit]\n }\n }\n\n return {\n type: viewDef.type,\n class: viewDef.class,\n duration,\n durationUnit,\n singleUnit,\n\n options: {\n ...globalDefaults,\n ...viewDef.defaults,\n ...optionsManager.dirDefaults,\n ...optionsManager.localeDefaults,\n ...optionsManager.overrides,\n ...singleUnitOverrides,\n ...viewDef.overrides,\n ...optionsManager.dynamicOverrides\n },\n\n buttonTextOverride:\n queryButtonText(optionsManager.dynamicOverrides) ||\n queryButtonText(optionsManager.overrides) || // constructor-specified buttonText lookup hash takes precedence\n viewDef.overrides.buttonText, // `buttonText` for view-specific options is a string\n\n buttonTextDefault:\n queryButtonText(optionsManager.localeDefaults) ||\n queryButtonText(optionsManager.dirDefaults) ||\n viewDef.defaults.buttonText ||\n queryButtonText(globalDefaults) ||\n viewDef.type // fall back to given view name\n }\n}\n","import { htmlEscape } from './util/html'\nimport { htmlToElement, appendToElement, findElements, createElement, removeElement } from './util/dom-manip'\nimport Component, { ComponentContext } from './component/Component'\nimport { ViewSpec } from './structs/view-spec'\nimport { memoizeRendering } from './component/memoized-rendering'\n\n/* Toolbar with buttons and title\n----------------------------------------------------------------------------------------------------------------------*/\n\nexport interface ToolbarRenderProps {\n layout: any\n title: string\n activeButton: string\n isTodayEnabled: boolean\n isPrevEnabled: boolean\n isNextEnabled: boolean\n}\n\nexport default class Toolbar extends Component {\n\n el: HTMLElement\n viewsWithButtons: any\n\n private _renderLayout = memoizeRendering(this.renderLayout, this.unrenderLayout)\n private _updateTitle = memoizeRendering(this.updateTitle, null, [ this._renderLayout ])\n private _updateActiveButton = memoizeRendering(this.updateActiveButton, null, [ this._renderLayout ])\n private _updateToday = memoizeRendering(this.updateToday, null, [ this._renderLayout ])\n private _updatePrev = memoizeRendering(this.updatePrev, null, [ this._renderLayout ])\n private _updateNext = memoizeRendering(this.updateNext, null, [ this._renderLayout ])\n\n\n constructor(context: ComponentContext, extraClassName) {\n super(context)\n\n this.el = createElement('div', { className: 'fc-toolbar ' + extraClassName })\n }\n\n\n destroy() {\n super.destroy()\n\n this._renderLayout.unrender() // should unrender everything else\n removeElement(this.el)\n }\n\n\n render(props: ToolbarRenderProps) {\n this._renderLayout(props.layout)\n this._updateTitle(props.title)\n this._updateActiveButton(props.activeButton)\n this._updateToday(props.isTodayEnabled)\n this._updatePrev(props.isPrevEnabled)\n this._updateNext(props.isNextEnabled)\n }\n\n\n renderLayout(layout) {\n let { el } = this\n\n this.viewsWithButtons = []\n\n appendToElement(el, this.renderSection('left', layout.left))\n appendToElement(el, this.renderSection('center', layout.center))\n appendToElement(el, this.renderSection('right', layout.right))\n }\n\n\n unrenderLayout() {\n this.el.innerHTML = ''\n }\n\n\n renderSection(position, buttonStr) {\n let { theme, calendar } = this\n let optionsManager = calendar.optionsManager\n let viewSpecs = calendar.viewSpecs\n let sectionEl = createElement('div', { className: 'fc-' + position })\n let calendarCustomButtons = optionsManager.computed.customButtons || {}\n let calendarButtonTextOverrides = optionsManager.overrides.buttonText || {}\n let calendarButtonText = optionsManager.computed.buttonText || {}\n\n if (buttonStr) {\n buttonStr.split(' ').forEach((buttonGroupStr, i) => {\n let groupChildren = []\n let isOnlyButtons = true\n let groupEl\n\n buttonGroupStr.split(',').forEach((buttonName, j) => {\n let customButtonProps\n let viewSpec: ViewSpec\n let buttonClick\n let buttonIcon // only one of these will be set\n let buttonText // \"\n let buttonInnerHtml\n let buttonClasses\n let buttonEl: HTMLElement\n let buttonAriaAttr\n\n if (buttonName === 'title') {\n groupChildren.push(htmlToElement('

 

')) // we always want it to take up height\n isOnlyButtons = false\n } else {\n\n if ((customButtonProps = calendarCustomButtons[buttonName])) {\n buttonClick = function(ev) {\n if (customButtonProps.click) {\n customButtonProps.click.call(buttonEl, ev)\n }\n };\n (buttonIcon = theme.getCustomButtonIconClass(customButtonProps)) ||\n (buttonIcon = theme.getIconClass(buttonName)) ||\n (buttonText = customButtonProps.text)\n } else if ((viewSpec = viewSpecs[buttonName])) {\n this.viewsWithButtons.push(buttonName)\n buttonClick = function() {\n calendar.changeView(buttonName)\n };\n (buttonText = viewSpec.buttonTextOverride) ||\n (buttonIcon = theme.getIconClass(buttonName)) ||\n (buttonText = viewSpec.buttonTextDefault)\n } else if (calendar[buttonName]) { // a calendar method\n buttonClick = function() {\n calendar[buttonName]()\n };\n (buttonText = calendarButtonTextOverrides[buttonName]) ||\n (buttonIcon = theme.getIconClass(buttonName)) ||\n (buttonText = calendarButtonText[buttonName])\n // ^ everything else is considered default\n }\n\n if (buttonClick) {\n\n buttonClasses = [\n 'fc-' + buttonName + '-button',\n theme.getClass('button')\n ]\n\n if (buttonText) {\n buttonInnerHtml = htmlEscape(buttonText)\n buttonAriaAttr = ''\n } else if (buttonIcon) {\n buttonInnerHtml = \"\"\n buttonAriaAttr = ' aria-label=\"' + buttonName + '\"'\n }\n\n buttonEl = htmlToElement( // type=\"button\" so that it doesn't submit a form\n ''\n )\n\n buttonEl.addEventListener('click', buttonClick)\n\n groupChildren.push(buttonEl)\n }\n }\n })\n\n if (groupChildren.length > 1) {\n groupEl = document.createElement('div')\n\n let buttonGroupClassName = theme.getClass('buttonGroup')\n if (isOnlyButtons && buttonGroupClassName) {\n groupEl.classList.add(buttonGroupClassName)\n }\n\n appendToElement(groupEl, groupChildren)\n sectionEl.appendChild(groupEl)\n } else {\n appendToElement(sectionEl, groupChildren) // 1 or 0 children\n }\n })\n }\n\n return sectionEl\n }\n\n\n updateToday(isTodayEnabled) {\n this.toggleButtonEnabled('today', isTodayEnabled)\n }\n\n\n updatePrev(isPrevEnabled) {\n this.toggleButtonEnabled('prev', isPrevEnabled)\n }\n\n\n updateNext(isNextEnabled) {\n this.toggleButtonEnabled('next', isNextEnabled)\n }\n\n\n updateTitle(text) {\n findElements(this.el, 'h2').forEach(function(titleEl) {\n titleEl.innerText = text\n })\n }\n\n\n updateActiveButton(buttonName?) {\n let className = this.theme.getClass('buttonActive')\n\n findElements(this.el, 'button').forEach((buttonEl) => { // fyi, themed buttons don't have .fc-button\n if (buttonName && buttonEl.classList.contains('fc-' + buttonName + '-button')) {\n buttonEl.classList.add(className)\n } else {\n buttonEl.classList.remove(className)\n }\n })\n }\n\n\n toggleButtonEnabled(buttonName, bool) {\n findElements(this.el, '.fc-' + buttonName + '-button').forEach((buttonEl: HTMLButtonElement) => {\n buttonEl.disabled = !bool\n })\n }\n\n}\n","import Component, { ComponentContext } from './component/Component'\nimport { ViewSpec } from './structs/view-spec'\nimport View from './View'\nimport Toolbar from './Toolbar'\nimport DateProfileGenerator, { DateProfile } from './DateProfileGenerator'\nimport { prependToElement, createElement, removeElement, appendToElement, applyStyle } from './util/dom-manip'\nimport { rangeContainsMarker, DateRange } from './datelib/date-range'\nimport { EventStore } from './structs/event-store'\nimport { EventUiHash } from './component/event-ui'\nimport { BusinessHoursInput, parseBusinessHours } from './structs/business-hours'\nimport { memoize } from './util/memoize'\nimport { computeHeightAndMargins } from './util/dom-geom'\nimport { createFormatter } from './datelib/formatting'\nimport { diffWholeDays, DateMarker } from './datelib/marker'\nimport { memoizeRendering } from './component/memoized-rendering'\nimport { CalendarState } from './reducers/types'\nimport { ViewPropsTransformerClass } from './plugin-system'\nimport { __assign } from 'tslib'\n\nexport interface CalendarComponentProps extends CalendarState {\n viewSpec: ViewSpec\n dateProfileGenerator: DateProfileGenerator // for the current view\n eventUiBases: EventUiHash\n}\n\nexport default class CalendarComponent extends Component {\n\n view: View\n header: Toolbar\n footer: Toolbar\n\n computeTitle: (dateProfile, viewOptions) => string\n parseBusinessHours: (input: BusinessHoursInput) => EventStore\n\n el: HTMLElement\n contentEl: HTMLElement\n\n isHeightAuto: boolean\n viewHeight: number\n\n private _renderToolbars = memoizeRendering(this.renderToolbars)\n private buildViewPropTransformers = memoize(buildViewPropTransformers)\n\n\n constructor(context: ComponentContext, el: HTMLElement) {\n super(context)\n\n this.el = el\n\n prependToElement(\n el,\n this.contentEl = createElement('div', { className: 'fc-view-container' })\n )\n\n let { calendar } = this\n for (let modifyViewContainer of calendar.pluginSystem.hooks.viewContainerModifiers) {\n modifyViewContainer(this.contentEl, calendar)\n }\n\n this.toggleElClassNames(true)\n\n this.computeTitle = memoize(computeTitle)\n\n this.parseBusinessHours = memoize((input) => {\n return parseBusinessHours(input, this.calendar)\n })\n }\n\n destroy() {\n if (this.header) {\n this.header.destroy()\n }\n\n if (this.footer) {\n this.footer.destroy()\n }\n\n if (this.view) {\n this.view.destroy()\n }\n\n removeElement(this.contentEl)\n this.toggleElClassNames(false)\n\n super.destroy()\n }\n\n toggleElClassNames(bool: boolean) {\n let classList = this.el.classList\n let dirClassName = 'fc-' + this.opt('dir')\n let themeClassName = this.theme.getClass('widget')\n\n if (bool) {\n classList.add('fc')\n classList.add(dirClassName)\n classList.add(themeClassName)\n } else {\n classList.remove('fc')\n classList.remove(dirClassName)\n classList.remove(themeClassName)\n }\n }\n\n render(props: CalendarComponentProps) {\n this.freezeHeight()\n\n let title = this.computeTitle(props.dateProfile, props.viewSpec.options)\n this._renderToolbars(props.viewSpec, props.dateProfile, props.currentDate, props.dateProfileGenerator, title)\n this.renderView(props, title)\n\n this.updateSize()\n this.thawHeight()\n }\n\n renderToolbars(viewSpec: ViewSpec, dateProfile: DateProfile, currentDate: DateMarker, dateProfileGenerator: DateProfileGenerator, title: string) {\n let headerLayout = this.opt('header')\n let footerLayout = this.opt('footer')\n\n let now = this.calendar.getNow()\n let todayInfo = dateProfileGenerator.build(now)\n let prevInfo = dateProfileGenerator.buildPrev(dateProfile, currentDate)\n let nextInfo = dateProfileGenerator.buildNext(dateProfile, currentDate)\n\n let toolbarProps = {\n title,\n activeButton: viewSpec.type,\n isTodayEnabled: todayInfo.isValid && !rangeContainsMarker(dateProfile.currentRange, now),\n isPrevEnabled: prevInfo.isValid,\n isNextEnabled: nextInfo.isValid\n }\n\n if (headerLayout) {\n if (!this.header) {\n this.header = new Toolbar(this.context, 'fc-header-toolbar')\n prependToElement(this.el, this.header.el)\n }\n this.header.receiveProps({\n layout: headerLayout,\n ...toolbarProps\n })\n } else if (this.header) {\n this.header.destroy()\n this.header = null\n }\n\n if (footerLayout) {\n if (!this.footer) {\n this.footer = new Toolbar(this.context, 'fc-footer-toolbar')\n appendToElement(this.el, this.footer.el)\n }\n this.footer.receiveProps({\n layout: footerLayout,\n ...toolbarProps\n })\n } else if (this.footer) {\n this.footer.destroy()\n this.footer = null\n }\n }\n\n renderView(props: CalendarComponentProps, title: string) {\n let { view } = this\n let { viewSpec, dateProfileGenerator } = props\n\n if (!view || view.viewSpec !== viewSpec) {\n\n if (view) {\n view.destroy()\n }\n\n view = this.view = new viewSpec['class'](\n {\n calendar: this.calendar,\n view: null, // HACK. will get populated by Component\n dateEnv: this.dateEnv,\n theme: this.theme,\n options: viewSpec.options\n },\n viewSpec,\n dateProfileGenerator,\n this.contentEl\n )\n } else {\n view.addScroll(view.queryScroll())\n }\n\n view.title = title // for the API\n\n let viewProps = {\n dateProfile: props.dateProfile,\n businessHours: this.parseBusinessHours(viewSpec.options.businessHours),\n eventStore: props.eventStore,\n eventUiBases: props.eventUiBases,\n dateSelection: props.dateSelection,\n eventSelection: props.eventSelection,\n eventDrag: props.eventDrag,\n eventResize: props.eventResize\n }\n\n let transformers = this.buildViewPropTransformers(this.calendar.pluginSystem.hooks.viewPropsTransformers)\n\n for (let transformer of transformers) {\n __assign(\n viewProps,\n transformer.transform(viewProps, viewSpec, props, view)\n )\n }\n\n view.receiveProps(viewProps)\n }\n\n\n // Sizing\n // -----------------------------------------------------------------------------------------------------------------\n\n updateSize(isResize = false) {\n let { view } = this\n\n if (isResize) {\n view.addScroll(view.queryScroll())\n }\n\n if (isResize || this.isHeightAuto == null) {\n this.computeHeightVars()\n }\n\n view.updateSize(isResize, this.viewHeight, this.isHeightAuto)\n view.updateNowIndicator() // we need to guarantee this will run after updateSize\n view.popScroll(isResize)\n }\n\n computeHeightVars() {\n let { calendar } = this // yuck. need to handle dynamic options\n let heightInput = calendar.opt('height')\n let contentHeightInput = calendar.opt('contentHeight')\n\n this.isHeightAuto = heightInput === 'auto' || contentHeightInput === 'auto'\n\n if (typeof contentHeightInput === 'number') { // exists and not 'auto'\n this.viewHeight = contentHeightInput\n } else if (typeof contentHeightInput === 'function') { // exists and is a function\n this.viewHeight = contentHeightInput()\n } else if (typeof heightInput === 'number') { // exists and not 'auto'\n this.viewHeight = heightInput - this.queryToolbarsHeight()\n } else if (typeof heightInput === 'function') { // exists and is a function\n this.viewHeight = heightInput() - this.queryToolbarsHeight()\n } else if (heightInput === 'parent') { // set to height of parent element\n this.viewHeight = (this.el.parentNode as HTMLElement).offsetHeight - this.queryToolbarsHeight()\n } else {\n this.viewHeight = Math.round(\n this.contentEl.offsetWidth /\n Math.max(calendar.opt('aspectRatio'), .5)\n )\n }\n }\n\n queryToolbarsHeight() {\n let height = 0\n\n if (this.header) {\n height += computeHeightAndMargins(this.header.el)\n }\n\n if (this.footer) {\n height += computeHeightAndMargins(this.footer.el)\n }\n\n return height\n }\n\n\n // Height \"Freezing\"\n // -----------------------------------------------------------------------------------------------------------------\n\n freezeHeight() {\n applyStyle(this.el, {\n height: this.el.offsetHeight,\n overflow: 'hidden'\n })\n }\n\n thawHeight() {\n applyStyle(this.el, {\n height: '',\n overflow: ''\n })\n }\n\n}\n\n\n// Title and Date Formatting\n// -----------------------------------------------------------------------------------------------------------------\n\n// Computes what the title at the top of the calendar should be for this view\nfunction computeTitle(dateProfile, viewOptions) {\n let range: DateRange\n\n // for views that span a large unit of time, show the proper interval, ignoring stray days before and after\n if (/^(year|month)$/.test(dateProfile.currentRangeUnit)) {\n range = dateProfile.currentRange\n } else { // for day units or smaller, use the actual day range\n range = dateProfile.activeRange\n }\n\n return this.dateEnv.formatRange(\n range.start,\n range.end,\n createFormatter(\n viewOptions.titleFormat || computeTitleFormat(dateProfile),\n viewOptions.titleRangeSeparator\n ),\n { isEndExclusive: dateProfile.isRangeAllDay }\n )\n}\n\n\n// Generates the format string that should be used to generate the title for the current date range.\n// Attempts to compute the most appropriate format if not explicitly specified with `titleFormat`.\nfunction computeTitleFormat(dateProfile) {\n let currentRangeUnit = dateProfile.currentRangeUnit\n\n if (currentRangeUnit === 'year') {\n return { year: 'numeric' }\n } else if (currentRangeUnit === 'month') {\n return { year: 'numeric', month: 'long' } // like \"September 2014\"\n } else {\n let days = diffWholeDays(\n dateProfile.currentRange.start,\n dateProfile.currentRange.end\n )\n if (days !== null && days > 1) {\n // multi-day range. shorter, like \"Sep 9 - 10 2014\"\n return { year: 'numeric', month: 'short', day: 'numeric' }\n } else {\n // one day. longer, like \"September 9 2014\"\n return { year: 'numeric', month: 'long', day: 'numeric' }\n }\n }\n}\n\n\n// Plugin\n// -----------------------------------------------------------------------------------------------------------------\n\nfunction buildViewPropTransformers(theClasses: ViewPropsTransformerClass[]) {\n return theClasses.map(function(theClass) {\n return new theClass()\n })\n}\n","import DateComponent from '../component/DateComponent'\n\n\nexport abstract class Interaction {\n\n component: DateComponent\n\n constructor(settings: InteractionSettings) {\n this.component = settings.component\n }\n\n destroy() {\n }\n\n}\n\nexport type InteractionClass = { new(settings: InteractionSettings): Interaction }\n\n\nexport interface InteractionSettingsInput {\n el: HTMLElement\n useEventCenter?: boolean\n // TODO: add largeUnit\n}\n\nexport interface InteractionSettings {\n component: DateComponent\n el: HTMLElement\n useEventCenter: boolean\n}\n\nexport type InteractionSettingsStore = { [componenUid: string]: InteractionSettings }\n\nexport function parseInteractionSettings(component: DateComponent, input: InteractionSettingsInput): InteractionSettings {\n return {\n component: component,\n el: input.el,\n useEventCenter: input.useEventCenter != null ? input.useEventCenter : true\n }\n}\n\nexport function interactionSettingsToStore(settings: InteractionSettings) {\n return {\n [settings.component.uid]: settings\n }\n}\n\n\n\n// global state\nexport let interactionSettingsStore: InteractionSettingsStore = {}\n","import { listenBySelector } from '../util/dom-event'\nimport EventApi from '../api/EventApi'\nimport { elementClosest } from '../util/dom-manip'\nimport { getElSeg } from '../component/event-rendering'\nimport { Interaction, InteractionSettings } from './interaction'\n\n/*\nDetects when the user clicks on an event within a DateComponent\n*/\nexport default class EventClicking extends Interaction {\n\n constructor(settings: InteractionSettings) {\n super(settings)\n let { component } = settings\n\n this.destroy = listenBySelector(\n component.el,\n 'click',\n component.fgSegSelector + ',' + component.bgSegSelector,\n this.handleSegClick\n )\n }\n\n handleSegClick = (ev: Event, segEl: HTMLElement) => {\n let { component } = this\n let seg = getElSeg(segEl)\n\n if (\n seg && // might be the
surrounding the more link\n component.isValidSegDownEl(ev.target as HTMLElement)\n ) {\n\n // our way to simulate a link click for elements that can't be tags\n // grab before trigger fired in case trigger trashes DOM thru rerendering\n let hasUrlContainer = elementClosest(ev.target as HTMLElement, '.fc-has-url')\n let url = hasUrlContainer ? (hasUrlContainer.querySelector('a[href]') as any).href : ''\n\n component.publiclyTrigger('eventClick', [\n {\n el: segEl,\n event: new EventApi(\n component.calendar,\n seg.eventRange.def,\n seg.eventRange.instance\n ),\n jsEvent: ev as MouseEvent, // Is this always a mouse event? See #4655\n view: component.view\n }\n ])\n\n if (url && !ev.defaultPrevented) {\n window.location.href = url\n }\n }\n }\n\n}\n","import { listenToHoverBySelector } from '../util/dom-event'\nimport EventApi from '../api/EventApi'\nimport { getElSeg } from '../component/event-rendering'\nimport { Interaction, InteractionSettings } from './interaction'\n\n/*\nTriggers events and adds/removes core classNames when the user's pointer\nenters/leaves event-elements of a component.\n*/\nexport default class EventHovering extends Interaction {\n\n removeHoverListeners: () => void\n currentSegEl: HTMLElement\n\n constructor(settings: InteractionSettings) {\n super(settings)\n let { component } = settings\n\n this.removeHoverListeners = listenToHoverBySelector(\n component.el,\n component.fgSegSelector + ',' + component.bgSegSelector,\n this.handleSegEnter,\n this.handleSegLeave\n )\n\n component.calendar.on('eventElRemove', this.handleEventElRemove)\n }\n\n destroy() {\n this.removeHoverListeners()\n this.component.calendar.off('eventElRemove', this.handleEventElRemove)\n }\n\n // for simulating an eventMouseLeave when the event el is destroyed while mouse is over it\n handleEventElRemove = (el: HTMLElement) => {\n if (el === this.currentSegEl) {\n this.handleSegLeave(null, this.currentSegEl)\n }\n }\n\n handleSegEnter = (ev: Event, segEl: HTMLElement) => {\n if (getElSeg(segEl)) { // TODO: better way to make sure not hovering over more+ link or its wrapper\n segEl.classList.add('fc-allow-mouse-resize')\n this.currentSegEl = segEl\n this.triggerEvent('eventMouseEnter', ev, segEl)\n }\n }\n\n handleSegLeave = (ev: Event | null, segEl: HTMLElement) => {\n if (this.currentSegEl) {\n segEl.classList.remove('fc-allow-mouse-resize')\n this.currentSegEl = null\n this.triggerEvent('eventMouseLeave', ev, segEl)\n }\n }\n\n triggerEvent(publicEvName: 'eventMouseEnter' | 'eventMouseLeave', ev: Event | null, segEl: HTMLElement) {\n let { component } = this\n let seg = getElSeg(segEl)!\n\n if (!ev || component.isValidSegDownEl(ev.target as HTMLElement)) {\n component.publiclyTrigger(publicEvName, [\n {\n el: segEl,\n event: new EventApi(\n this.component.calendar,\n seg.eventRange.def,\n seg.eventRange.instance\n ),\n jsEvent: ev as MouseEvent, // Is this always a mouse event? See #4655\n view: component.view\n }\n ])\n }\n }\n\n}\n","import Theme from './Theme'\n\nexport default class StandardTheme extends Theme {\n}\n\nStandardTheme.prototype.classes = {\n widget: 'fc-unthemed',\n widgetHeader: 'fc-widget-header',\n widgetContent: 'fc-widget-content',\n\n buttonGroup: 'fc-button-group',\n button: 'fc-button fc-button-primary',\n buttonActive: 'fc-button-active',\n\n popoverHeader: 'fc-widget-header',\n popoverContent: 'fc-widget-content',\n\n // day grid\n headerRow: 'fc-widget-header',\n dayRow: 'fc-widget-content',\n\n // list view\n listView: 'fc-widget-content'\n}\n\nStandardTheme.prototype.baseIconClass = 'fc-icon'\nStandardTheme.prototype.iconClasses = {\n close: 'fc-icon-x',\n prev: 'fc-icon-chevron-left',\n next: 'fc-icon-chevron-right',\n prevYear: 'fc-icon-chevrons-left',\n nextYear: 'fc-icon-chevrons-right'\n}\n\nStandardTheme.prototype.iconOverrideOption = 'buttonIcons'\nStandardTheme.prototype.iconOverrideCustomButtonOption = 'icon'\nStandardTheme.prototype.iconOverridePrefix = 'fc-icon-'\n","import { listenBySelector } from './util/dom-event'\nimport { capitaliseFirstLetter, debounce } from './util/misc'\nimport { default as EmitterMixin, EmitterInterface } from './common/EmitterMixin'\nimport OptionsManager from './OptionsManager'\nimport View from './View'\nimport Theme from './theme/Theme'\nimport { OptionsInput, EventHandlerName, EventHandlerArgs } from './types/input-types'\nimport { Locale, buildLocale, parseRawLocales, RawLocaleMap } from './datelib/locale'\nimport { DateEnv, DateInput } from './datelib/env'\nimport { DateMarker, startOfDay } from './datelib/marker'\nimport { createFormatter } from './datelib/formatting'\nimport { Duration, createDuration, DurationInput } from './datelib/duration'\nimport reduce from './reducers/main'\nimport { parseDateSpan, DateSpanInput, DateSpan, buildDateSpanApi, DateSpanApi, buildDatePointApi, DatePointApi } from './structs/date-span'\nimport { memoize, memoizeOutput } from './util/memoize'\nimport { mapHash, isPropsEqual } from './util/object'\nimport { DateRangeInput } from './datelib/date-range'\nimport DateProfileGenerator from './DateProfileGenerator'\nimport { EventSourceInput, parseEventSource, EventSourceHash } from './structs/event-source'\nimport { EventInput, parseEvent, EventDefHash } from './structs/event'\nimport { CalendarState, Action } from './reducers/types'\nimport EventSourceApi from './api/EventSourceApi'\nimport EventApi from './api/EventApi'\nimport { createEmptyEventStore, EventStore, eventTupleToStore } from './structs/event-store'\nimport { processScopedUiProps, EventUiHash, EventUi } from './component/event-ui'\nimport { buildViewSpecs, ViewSpecHash, ViewSpec } from './structs/view-spec'\nimport { PluginSystem } from './plugin-system'\nimport CalendarComponent from './CalendarComponent'\nimport { __assign } from 'tslib'\nimport { refinePluginDefs } from './options'\nimport DateComponent from './component/DateComponent'\nimport { PointerDragEvent } from './interactions/pointer'\nimport { InteractionSettingsInput, parseInteractionSettings, Interaction, interactionSettingsStore, InteractionClass } from './interactions/interaction'\nimport EventClicking from './interactions/EventClicking'\nimport EventHovering from './interactions/EventHovering'\nimport StandardTheme from './theme/StandardTheme'\nimport { CmdFormatterFunc } from './datelib/formatting-cmd'\nimport { NamedTimeZoneImplClass } from './datelib/timezone'\n\nexport interface DateClickApi extends DatePointApi {\n dayEl: HTMLElement\n jsEvent: UIEvent\n view: View\n}\n\nexport interface DateSelectionApi extends DateSpanApi {\n jsEvent: UIEvent\n view: View\n}\n\nexport type DatePointTransform = (dateSpan: DateSpan, calendar: Calendar) => any\nexport type DateSpanTransform = (dateSpan: DateSpan, calendar: Calendar) => any\n\nexport type CalendarInteraction = { destroy() }\nexport type CalendarInteractionClass = { new(calendar: Calendar): CalendarInteraction }\n\nexport type OptionChangeHandler = (propValue: any, calendar: Calendar, deepEquals) => void\nexport type OptionChangeHandlerMap = { [propName: string]: OptionChangeHandler }\n\nexport default class Calendar {\n\n // global handler registry\n static on: EmitterInterface['on']\n static off: EmitterInterface['off']\n static trigger: EmitterInterface['trigger']\n\n on: EmitterInterface['on']\n one: EmitterInterface['one']\n off: EmitterInterface['off']\n trigger: EmitterInterface['trigger']\n triggerWith: EmitterInterface['triggerWith']\n hasHandlers: EmitterInterface['hasHandlers']\n\n private parseRawLocales = memoize(parseRawLocales)\n private buildLocale = memoize(buildLocale)\n private buildDateEnv = memoize(buildDateEnv)\n private buildTheme = memoize(buildTheme)\n private buildEventUiSingleBase = memoize(this._buildEventUiSingleBase)\n private buildSelectionConfig = memoize(this._buildSelectionConfig)\n private buildEventUiBySource = memoizeOutput(buildEventUiBySource, isPropsEqual)\n private buildEventUiBases = memoize(buildEventUiBases)\n\n eventUiBases: EventUiHash // solely for validation system\n selectionConfig: EventUi // doesn't need all the info EventUi provides. only validation-related. TODO: separate data structs\n\n optionsManager: OptionsManager\n viewSpecs: ViewSpecHash\n dateProfileGenerators: { [viewName: string]: DateProfileGenerator }\n theme: Theme\n dateEnv: DateEnv\n availableRawLocales: RawLocaleMap\n pluginSystem: PluginSystem\n defaultAllDayEventDuration: Duration\n defaultTimedEventDuration: Duration\n\n calendarInteractions: CalendarInteraction[]\n interactionsStore: { [componentUid: string]: Interaction[] } = {}\n removeNavLinkListener: any\n\n windowResizeProxy: any\n isHandlingWindowResize: boolean\n\n state: CalendarState\n actionQueue = []\n isReducing: boolean = false\n\n // isDisplaying: boolean = false // installed in DOM? accepting renders?\n needsRerender: boolean = false // needs a render?\n needsFullRerender: boolean = false\n isRendering: boolean = false // currently in the executeRender function?\n renderingPauseDepth: number = 0\n renderableEventStore: EventStore\n buildDelayedRerender = memoize(buildDelayedRerender)\n delayedRerender: any\n afterSizingTriggers: any = {}\n isViewUpdated: boolean = false\n isDatesUpdated: boolean = false\n isEventsUpdated: boolean = false\n\n el: HTMLElement\n component: CalendarComponent\n\n\n constructor(el: HTMLElement, overrides?: OptionsInput) {\n this.el = el\n\n this.optionsManager = new OptionsManager(overrides || {})\n this.pluginSystem = new PluginSystem()\n\n // only do once. don't do in handleOptions. because can't remove plugins\n this.addPluginInputs(this.optionsManager.computed.plugins || [])\n\n this.handleOptions(this.optionsManager.computed)\n this.publiclyTrigger('_init') // for tests\n this.hydrate()\n\n this.calendarInteractions = this.pluginSystem.hooks.calendarInteractions\n .map((calendarInteractionClass) => {\n return new calendarInteractionClass(this)\n })\n }\n\n\n addPluginInputs(pluginInputs) {\n let pluginDefs = refinePluginDefs(pluginInputs)\n\n for (let pluginDef of pluginDefs) {\n this.pluginSystem.add(pluginDef)\n }\n }\n\n\n // public API\n get view(): View {\n return this.component ? this.component.view : null\n }\n\n\n // Public API for rendering\n // -----------------------------------------------------------------------------------------------------------------\n\n\n render() {\n if (!this.component) {\n this.renderableEventStore = createEmptyEventStore()\n this.bindHandlers()\n this.executeRender()\n } else {\n this.requestRerender(true)\n }\n }\n\n\n destroy() {\n if (this.component) {\n this.unbindHandlers()\n this.component.destroy() // don't null-out. in case API needs access\n this.component = null // umm ???\n\n for (let interaction of this.calendarInteractions) {\n interaction.destroy()\n }\n\n this.publiclyTrigger('_destroyed')\n }\n }\n\n\n // Handlers\n // -----------------------------------------------------------------------------------------------------------------\n\n\n bindHandlers() {\n\n // event delegation for nav links\n this.removeNavLinkListener = listenBySelector(this.el, 'click', 'a[data-goto]', (ev, anchorEl) => {\n let gotoOptions: any = anchorEl.getAttribute('data-goto')\n gotoOptions = gotoOptions ? JSON.parse(gotoOptions) : {}\n\n let { dateEnv } = this\n let dateMarker = dateEnv.createMarker(gotoOptions.date)\n let viewType = gotoOptions.type\n\n // property like \"navLinkDayClick\". might be a string or a function\n let customAction = this.viewOpt('navLink' + capitaliseFirstLetter(viewType) + 'Click')\n\n if (typeof customAction === 'function') {\n customAction(dateEnv.toDate(dateMarker), ev)\n } else {\n if (typeof customAction === 'string') {\n viewType = customAction\n }\n this.zoomTo(dateMarker, viewType)\n }\n })\n\n if (this.opt('handleWindowResize')) {\n window.addEventListener('resize',\n this.windowResizeProxy = debounce( // prevents rapid calls\n this.windowResize.bind(this),\n this.opt('windowResizeDelay')\n )\n )\n }\n }\n\n unbindHandlers() {\n this.removeNavLinkListener()\n\n if (this.windowResizeProxy) {\n window.removeEventListener('resize', this.windowResizeProxy)\n this.windowResizeProxy = null\n }\n }\n\n\n // Dispatcher\n // -----------------------------------------------------------------------------------------------------------------\n\n\n hydrate() {\n this.state = this.buildInitialState()\n\n let rawSources = this.opt('eventSources') || []\n let singleRawSource = this.opt('events')\n let sources = [] // parsed\n\n if (singleRawSource) {\n rawSources.unshift(singleRawSource)\n }\n\n for (let rawSource of rawSources) {\n let source = parseEventSource(rawSource, this)\n if (source) {\n sources.push(source)\n }\n }\n\n this.batchRendering(() => {\n this.dispatch({ type: 'INIT' }) // pass in sources here?\n this.dispatch({ type: 'ADD_EVENT_SOURCES', sources })\n this.dispatch({\n type: 'SET_VIEW_TYPE',\n viewType: this.opt('defaultView') || this.pluginSystem.hooks.defaultView\n })\n })\n }\n\n\n buildInitialState(): CalendarState {\n return {\n viewType: null,\n loadingLevel: 0,\n eventSourceLoadingLevel: 0,\n currentDate: this.getInitialDate(),\n dateProfile: null,\n eventSources: {},\n eventStore: createEmptyEventStore(),\n dateSelection: null,\n eventSelection: '',\n eventDrag: null,\n eventResize: null\n }\n }\n\n\n dispatch(action: Action) {\n this.actionQueue.push(action)\n\n if (!this.isReducing) {\n this.isReducing = true\n let oldState = this.state\n\n while (this.actionQueue.length) {\n this.state = this.reduce(\n this.state,\n this.actionQueue.shift(),\n this\n )\n }\n\n let newState = this.state\n this.isReducing = false\n\n if (!oldState.loadingLevel && newState.loadingLevel) {\n this.publiclyTrigger('loading', [ true ])\n } else if (oldState.loadingLevel && !newState.loadingLevel) {\n this.publiclyTrigger('loading', [ false ])\n }\n\n let view = this.component && this.component.view\n\n if (oldState.eventStore !== newState.eventStore || this.needsFullRerender) {\n if (oldState.eventStore) {\n this.isEventsUpdated = true\n }\n }\n\n if (oldState.dateProfile !== newState.dateProfile || this.needsFullRerender) {\n if (oldState.dateProfile && view) { // why would view be null!?\n this.publiclyTrigger('datesDestroy', [\n {\n view,\n el: view.el\n }\n ])\n }\n this.isDatesUpdated = true\n }\n\n if (oldState.viewType !== newState.viewType || this.needsFullRerender) {\n if (oldState.viewType && view) { // why would view be null!?\n this.publiclyTrigger('viewSkeletonDestroy', [\n {\n view,\n el: view.el\n }\n ])\n }\n this.isViewUpdated = true\n }\n\n this.requestRerender()\n }\n }\n\n\n reduce(state: CalendarState, action: Action, calendar: Calendar): CalendarState {\n return reduce(state, action, calendar)\n }\n\n\n // Render Queue\n // -----------------------------------------------------------------------------------------------------------------\n\n\n requestRerender(needsFull = false) {\n this.needsRerender = true\n this.needsFullRerender = this.needsFullRerender || needsFull\n this.delayedRerender() // will call a debounced-version of tryRerender\n }\n\n\n tryRerender() {\n if (\n this.component && // must be accepting renders\n this.needsRerender && // indicates that a rerender was requested\n !this.renderingPauseDepth && // not paused\n !this.isRendering // not currently in the render loop\n ) {\n this.executeRender()\n }\n }\n\n\n batchRendering(func) {\n this.renderingPauseDepth++\n func()\n this.renderingPauseDepth--\n\n if (this.needsRerender) {\n this.requestRerender()\n }\n }\n\n\n // Rendering\n // -----------------------------------------------------------------------------------------------------------------\n\n executeRender() {\n let { needsFullRerender } = this // save before clearing\n\n // clear these BEFORE the render so that new values will accumulate during render\n this.needsRerender = false\n this.needsFullRerender = false\n\n this.isRendering = true\n this.renderComponent(needsFullRerender)\n this.isRendering = false\n\n // received a rerender request while rendering\n if (this.needsRerender) {\n this.delayedRerender()\n }\n }\n\n /*\n don't call this directly. use executeRender instead\n */\n renderComponent(needsFull) {\n let { state, component } = this\n let { viewType } = state\n let viewSpec = this.viewSpecs[viewType]\n let savedScroll = (needsFull && component) ? component.view.queryScroll() : null\n\n if (!viewSpec) {\n throw new Error(`View type \"${viewType}\" is not valid`)\n }\n\n // if event sources are still loading and progressive rendering hasn't been enabled,\n // keep rendering the last fully loaded set of events\n let renderableEventStore = this.renderableEventStore =\n (state.eventSourceLoadingLevel && !this.opt('progressiveEventRendering')) ?\n this.renderableEventStore :\n state.eventStore\n\n let eventUiSingleBase = this.buildEventUiSingleBase(viewSpec.options)\n let eventUiBySource = this.buildEventUiBySource(state.eventSources)\n let eventUiBases = this.eventUiBases = this.buildEventUiBases(renderableEventStore.defs, eventUiSingleBase, eventUiBySource)\n\n if (needsFull || !component) {\n\n if (component) {\n component.freezeHeight() // next component will unfreeze it\n component.destroy()\n }\n\n component = this.component = new CalendarComponent({\n calendar: this,\n view: null, // HACK. will get populated by Component\n dateEnv: this.dateEnv,\n theme: this.theme,\n options: this.optionsManager.computed\n }, this.el)\n }\n\n component.receiveProps({\n ...state,\n viewSpec,\n dateProfile: state.dateProfile,\n dateProfileGenerator: this.dateProfileGenerators[viewType],\n eventStore: renderableEventStore,\n eventUiBases,\n dateSelection: state.dateSelection,\n eventSelection: state.eventSelection,\n eventDrag: state.eventDrag,\n eventResize: state.eventResize\n })\n\n if (savedScroll) {\n component.view.applyScroll(savedScroll, false)\n }\n\n if (this.isViewUpdated) {\n this.isViewUpdated = false\n this.publiclyTrigger('viewSkeletonRender', [\n {\n view: component.view,\n el: component.view.el\n }\n ])\n }\n\n if (this.isDatesUpdated) {\n this.isDatesUpdated = false\n this.publiclyTrigger('datesRender', [\n {\n view: component.view,\n el: component.view.el\n }\n ])\n }\n\n if (this.isEventsUpdated) {\n this.isEventsUpdated = false\n }\n\n this.releaseAfterSizingTriggers()\n }\n\n\n // Options\n // -----------------------------------------------------------------------------------------------------------------\n\n\n setOption(name: string, val) {\n this.mutateOptions({ [name]: val }, [], true)\n }\n\n\n getOption(name: string) { // getter, used externally\n return this.optionsManager.computed[name]\n }\n\n\n opt(name: string) { // getter, used internally\n return this.optionsManager.computed[name]\n }\n\n\n viewOpt(name: string) { // getter, used internally\n return this.viewOpts()[name]\n }\n\n\n viewOpts() {\n return this.viewSpecs[this.state.viewType].options\n }\n\n /*\n handles option changes (like a diff)\n */\n mutateOptions(updates, removals: string[], isDynamic?: boolean, deepEquals?) {\n let changeHandlers = this.pluginSystem.hooks.optionChangeHandlers\n let normalUpdates = {}\n let specialUpdates = {}\n let oldDateEnv = this.dateEnv // do this before handleOptions\n let isTimeZoneDirty = false\n let isSizeDirty = false\n let anyDifficultOptions = Boolean(removals.length)\n\n for (let name in updates) {\n if (changeHandlers[name]) {\n specialUpdates[name] = updates[name]\n } else {\n normalUpdates[name] = updates[name]\n }\n }\n\n for (let name in normalUpdates) {\n if (/^(height|contentHeight|aspectRatio)$/.test(name)) {\n isSizeDirty = true\n } else if (/^(defaultDate|defaultView)$/.test(name)) {\n // can't change date this way. use gotoDate instead\n } else {\n anyDifficultOptions = true\n\n if (name === 'timeZone') {\n isTimeZoneDirty = true\n }\n }\n }\n\n this.optionsManager.mutate(normalUpdates, removals, isDynamic)\n\n if (anyDifficultOptions) {\n this.handleOptions(this.optionsManager.computed)\n this.needsFullRerender = true\n }\n\n console.log('anyDifficultOptions', anyDifficultOptions)\n this.batchRendering(() => {\n\n if (anyDifficultOptions) {\n\n if (isTimeZoneDirty) {\n this.dispatch({\n type: 'CHANGE_TIMEZONE',\n oldDateEnv\n })\n }\n\n /* HACK\n has the same effect as calling this.requestRerender(true)\n but recomputes the state's dateProfile\n */\n this.dispatch({\n type: 'SET_VIEW_TYPE',\n viewType: this.state.viewType\n })\n\n } else if (isSizeDirty) {\n this.updateSize()\n }\n\n // special updates\n if (deepEquals) {\n for (let name in specialUpdates) {\n changeHandlers[name](specialUpdates[name], this, deepEquals)\n }\n }\n\n })\n }\n\n /*\n rebuilds things based off of a complete set of refined options\n */\n handleOptions(options) {\n let pluginHooks = this.pluginSystem.hooks\n\n this.defaultAllDayEventDuration = createDuration(options.defaultAllDayEventDuration)\n this.defaultTimedEventDuration = createDuration(options.defaultTimedEventDuration)\n this.delayedRerender = this.buildDelayedRerender(options.rerenderDelay)\n this.theme = this.buildTheme(options)\n\n let available = this.parseRawLocales(options.locales)\n this.availableRawLocales = available.map\n let locale = this.buildLocale(options.locale || available.defaultCode, available.map)\n\n this.dateEnv = this.buildDateEnv(\n locale,\n options.timeZone,\n pluginHooks.namedTimeZonedImpl,\n options.firstDay,\n options.weekNumberCalculation,\n options.weekLabel,\n pluginHooks.cmdFormatter\n )\n\n this.selectionConfig = this.buildSelectionConfig(options) // needs dateEnv. do after :(\n\n // ineffecient to do every time?\n this.viewSpecs = buildViewSpecs(\n pluginHooks.views,\n this.optionsManager\n )\n\n // ineffecient to do every time?\n this.dateProfileGenerators = mapHash(this.viewSpecs, (viewSpec) => {\n return new viewSpec.class.prototype.dateProfileGeneratorClass(viewSpec, this)\n })\n }\n\n\n getAvailableLocaleCodes() {\n return Object.keys(this.availableRawLocales)\n }\n\n\n _buildSelectionConfig(rawOpts) {\n return processScopedUiProps('select', rawOpts, this)\n }\n\n\n _buildEventUiSingleBase(rawOpts) {\n if (rawOpts.editable) { // so 'editable' affected events\n rawOpts = { ...rawOpts, eventEditable: true }\n }\n return processScopedUiProps('event', rawOpts, this)\n }\n\n\n // Trigger\n // -----------------------------------------------------------------------------------------------------------------\n\n\n hasPublicHandlers(name: T): boolean {\n return this.hasHandlers(name) ||\n this.opt(name) // handler specified in options\n }\n\n\n publiclyTrigger(name: T, args?: EventHandlerArgs) {\n let optHandler = this.opt(name)\n\n this.triggerWith(name, this, args)\n\n if (optHandler) {\n return optHandler.apply(this, args)\n }\n }\n\n\n publiclyTriggerAfterSizing(name: T, args: EventHandlerArgs) {\n let { afterSizingTriggers } = this;\n\n (afterSizingTriggers[name] || (afterSizingTriggers[name] = [])).push(args)\n }\n\n\n releaseAfterSizingTriggers() {\n let { afterSizingTriggers } = this\n\n for (let name in afterSizingTriggers) {\n for (let args of afterSizingTriggers[name]) {\n this.publiclyTrigger(name as EventHandlerName, args)\n }\n }\n\n this.afterSizingTriggers = {}\n }\n\n\n // View\n // -----------------------------------------------------------------------------------------------------------------\n\n\n // Returns a boolean about whether the view is okay to instantiate at some point\n isValidViewType(viewType: string): boolean {\n return Boolean(this.viewSpecs[viewType])\n }\n\n\n changeView(viewType: string, dateOrRange?: DateRangeInput | DateInput) {\n let dateMarker = null\n\n if (dateOrRange) {\n if ((dateOrRange as DateRangeInput).start && (dateOrRange as DateRangeInput).end) { // a range\n this.optionsManager.mutate({ visibleRange: dateOrRange }, []) // will not rerender\n this.handleOptions(this.optionsManager.computed) // ...but yuck\n } else { // a date\n dateMarker = this.dateEnv.createMarker(dateOrRange as DateInput) // just like gotoDate\n }\n }\n\n this.unselect()\n this.dispatch({\n type: 'SET_VIEW_TYPE',\n viewType,\n dateMarker\n })\n }\n\n\n // Forces navigation to a view for the given date.\n // `viewType` can be a specific view name or a generic one like \"week\" or \"day\".\n // needs to change\n zoomTo(dateMarker: DateMarker, viewType?: string) {\n let spec\n\n viewType = viewType || 'day' // day is default zoom\n spec = this.viewSpecs[viewType] ||\n this.getUnitViewSpec(viewType)\n\n this.unselect()\n\n if (spec) {\n this.dispatch({\n type: 'SET_VIEW_TYPE',\n viewType: spec.type,\n dateMarker\n })\n } else {\n this.dispatch({\n type: 'SET_DATE',\n dateMarker\n })\n }\n }\n\n\n // Given a duration singular unit, like \"week\" or \"day\", finds a matching view spec.\n // Preference is given to views that have corresponding buttons.\n getUnitViewSpec(unit: string): ViewSpec | null {\n let { component } = this\n let viewTypes = []\n let i\n let spec\n\n // put views that have buttons first. there will be duplicates, but oh\n if (component.header) {\n viewTypes.push(...component.header.viewsWithButtons)\n }\n if (component.footer) {\n viewTypes.push(...component.footer.viewsWithButtons)\n }\n\n for (let viewType in this.viewSpecs) {\n viewTypes.push(viewType)\n }\n\n for (i = 0; i < viewTypes.length; i++) {\n spec = this.viewSpecs[viewTypes[i]]\n if (spec) {\n if (spec.singleUnit === unit) {\n return spec\n }\n }\n }\n }\n\n\n // Current Date\n // -----------------------------------------------------------------------------------------------------------------\n\n\n getInitialDate() {\n let defaultDateInput = this.opt('defaultDate')\n\n // compute the initial ambig-timezone date\n if (defaultDateInput != null) {\n return this.dateEnv.createMarker(defaultDateInput)\n } else {\n return this.getNow() // getNow already returns unzoned\n }\n }\n\n\n prev() {\n this.unselect()\n this.dispatch({ type: 'PREV' })\n }\n\n\n next() {\n this.unselect()\n this.dispatch({ type: 'NEXT' })\n }\n\n\n prevYear() {\n this.unselect()\n this.dispatch({\n type: 'SET_DATE',\n dateMarker: this.dateEnv.addYears(this.state.currentDate, -1)\n })\n }\n\n\n nextYear() {\n this.unselect()\n this.dispatch({\n type: 'SET_DATE',\n dateMarker: this.dateEnv.addYears(this.state.currentDate, 1)\n })\n }\n\n\n today() {\n this.unselect()\n this.dispatch({\n type: 'SET_DATE',\n dateMarker: this.getNow()\n })\n }\n\n\n gotoDate(zonedDateInput) {\n this.unselect()\n this.dispatch({\n type: 'SET_DATE',\n dateMarker: this.dateEnv.createMarker(zonedDateInput)\n })\n }\n\n\n incrementDate(deltaInput) { // is public facing\n let delta = createDuration(deltaInput)\n\n if (delta) { // else, warn about invalid input?\n this.unselect()\n this.dispatch({\n type: 'SET_DATE',\n dateMarker: this.dateEnv.add(this.state.currentDate, delta)\n })\n }\n }\n\n\n // for external API\n getDate(): Date {\n return this.dateEnv.toDate(this.state.currentDate)\n }\n\n\n // Date Formatting Utils\n // -----------------------------------------------------------------------------------------------------------------\n\n\n formatDate(d: DateInput, formatter): string {\n const { dateEnv } = this\n return dateEnv.format(\n dateEnv.createMarker(d),\n createFormatter(formatter)\n )\n }\n\n\n // `settings` is for formatter AND isEndExclusive\n formatRange(d0: DateInput, d1: DateInput, settings) {\n const { dateEnv } = this\n return dateEnv.formatRange(\n dateEnv.createMarker(d0),\n dateEnv.createMarker(d1),\n createFormatter(settings, this.opt('defaultRangeSeparator')),\n settings\n )\n }\n\n\n formatIso(d: DateInput, omitTime?: boolean) {\n const { dateEnv } = this\n return dateEnv.formatIso(dateEnv.createMarker(d), { omitTime })\n }\n\n\n // Sizing\n // -----------------------------------------------------------------------------------------------------------------\n\n\n windowResize(ev: Event) {\n if (\n !this.isHandlingWindowResize &&\n this.component && // why?\n (ev as any).target === window // not a jqui resize event\n ) {\n this.isHandlingWindowResize = true\n this.updateSize()\n this.publiclyTrigger('windowResize', [ this.view ])\n this.isHandlingWindowResize = false\n }\n }\n\n\n updateSize() { // public\n if (this.component) { // when?\n this.component.updateSize(true)\n }\n }\n\n\n // Component Registration\n // -----------------------------------------------------------------------------------------------------------------\n\n\n registerInteractiveComponent(component: DateComponent, settingsInput: InteractionSettingsInput) {\n let settings = parseInteractionSettings(component, settingsInput)\n let DEFAULT_INTERACTIONS: InteractionClass[] = [\n EventClicking,\n EventHovering\n ]\n let interactionClasses: InteractionClass[] = DEFAULT_INTERACTIONS.concat(\n this.pluginSystem.hooks.componentInteractions\n )\n let interactions = interactionClasses.map((interactionClass) => {\n return new interactionClass(settings)\n })\n\n this.interactionsStore[component.uid] = interactions\n interactionSettingsStore[component.uid] = settings\n }\n\n\n unregisterInteractiveComponent(component: DateComponent) {\n\n for (let listener of this.interactionsStore[component.uid]) {\n listener.destroy()\n }\n\n delete this.interactionsStore[component.uid]\n delete interactionSettingsStore[component.uid]\n }\n\n\n // Date Selection / Event Selection / DayClick\n // -----------------------------------------------------------------------------------------------------------------\n\n\n // this public method receives start/end dates in any format, with any timezone\n // NOTE: args were changed from v3\n select(dateOrObj: DateInput | any, endDate?: DateInput) {\n let selectionInput: DateSpanInput\n\n if (endDate == null) {\n if (dateOrObj.start != null) {\n selectionInput = dateOrObj as DateSpanInput\n } else {\n selectionInput = {\n start: dateOrObj,\n end: null\n }\n }\n } else {\n selectionInput = {\n start: dateOrObj,\n end: endDate\n } as DateSpanInput\n }\n\n let selection = parseDateSpan(\n selectionInput,\n this.dateEnv,\n createDuration({ days: 1 }) // TODO: cache this?\n )\n\n if (selection) { // throw parse error otherwise?\n this.dispatch({ type: 'SELECT_DATES', selection })\n this.triggerDateSelect(selection)\n }\n }\n\n\n // public method\n unselect(pev?: PointerDragEvent) {\n if (this.state.dateSelection) {\n this.dispatch({ type: 'UNSELECT_DATES' })\n this.triggerDateUnselect(pev)\n }\n }\n\n\n triggerDateSelect(selection: DateSpan, pev?: PointerDragEvent) {\n const arg = {\n ...this.buildDateSpanApi(selection),\n jsEvent: pev ? pev.origEvent as MouseEvent : null, // Is this always a mouse event? See #4655\n view: this.view\n }\n this.publiclyTrigger('select', [ arg ])\n }\n\n\n triggerDateUnselect(pev?: PointerDragEvent) {\n this.publiclyTrigger('unselect', [\n {\n jsEvent: pev ? pev.origEvent : null,\n view: this.view\n }\n ])\n }\n\n\n // TODO: receive pev?\n triggerDateClick(dateSpan: DateSpan, dayEl: HTMLElement, view: View, ev: UIEvent) {\n const arg = {\n ...this.buildDatePointApi(dateSpan),\n dayEl,\n jsEvent: ev as MouseEvent, // Is this always a mouse event? See #4655\n view\n }\n\n this.publiclyTrigger('dateClick', [ arg ])\n }\n\n\n buildDatePointApi(dateSpan: DateSpan) {\n let props = {} as DatePointApi\n\n for (let transform of this.pluginSystem.hooks.datePointTransforms) {\n __assign(props, transform(dateSpan, this))\n }\n\n __assign(props, buildDatePointApi(dateSpan, this.dateEnv))\n\n return props\n }\n\n\n buildDateSpanApi(dateSpan: DateSpan) {\n let props = {} as DateSpanApi\n\n for (let transform of this.pluginSystem.hooks.dateSpanTransforms) {\n __assign(props, transform(dateSpan, this))\n }\n\n __assign(props, buildDateSpanApi(dateSpan, this.dateEnv))\n\n return props\n }\n\n\n // Date Utils\n // -----------------------------------------------------------------------------------------------------------------\n\n\n // Returns a DateMarker for the current date, as defined by the client's computer or from the `now` option\n getNow(): DateMarker {\n let now = this.opt('now')\n\n if (typeof now === 'function') {\n now = now()\n }\n\n if (now == null) {\n return this.dateEnv.createNowMarker()\n }\n\n return this.dateEnv.createMarker(now)\n }\n\n\n // Event-Date Utilities\n // -----------------------------------------------------------------------------------------------------------------\n\n\n // Given an event's allDay status and start date, return what its fallback end date should be.\n // TODO: rename to computeDefaultEventEnd\n getDefaultEventEnd(allDay: boolean, marker: DateMarker): DateMarker {\n let end = marker\n\n if (allDay) {\n end = startOfDay(end)\n end = this.dateEnv.add(end, this.defaultAllDayEventDuration)\n } else {\n end = this.dateEnv.add(end, this.defaultTimedEventDuration)\n }\n\n return end\n }\n\n\n // Public Events API\n // -----------------------------------------------------------------------------------------------------------------\n\n\n addEvent(eventInput: EventInput, sourceInput?: EventSourceApi | string | number): EventApi | null {\n\n if (eventInput instanceof EventApi) {\n let def = eventInput._def\n let instance = eventInput._instance\n\n // not already present? don't want to add an old snapshot\n if (!this.state.eventStore.defs[def.defId]) {\n this.dispatch({\n type: 'ADD_EVENTS',\n eventStore: eventTupleToStore({ def, instance }) // TODO: better util for two args?\n })\n }\n\n return eventInput\n }\n\n let sourceId\n if (sourceInput instanceof EventSourceApi) {\n sourceId = sourceInput.internalEventSource.sourceId\n } else if (sourceInput != null) {\n let sourceApi = this.getEventSourceById(sourceInput) // TODO: use an internal function\n\n if (!sourceApi) {\n console.warn('Could not find an event source with ID \"' + sourceInput + '\"') // TODO: test\n return null\n } else {\n sourceId = sourceApi.internalEventSource.sourceId\n }\n }\n\n let tuple = parseEvent(eventInput, sourceId, this)\n\n if (tuple) {\n\n this.dispatch({\n type: 'ADD_EVENTS',\n eventStore: eventTupleToStore(tuple)\n })\n\n return new EventApi(\n this,\n tuple.def,\n tuple.def.recurringDef ? null : tuple.instance\n )\n }\n\n return null\n }\n\n\n // TODO: optimize\n getEventById(id: string): EventApi | null {\n let { defs, instances } = this.state.eventStore\n\n id = String(id)\n\n for (let defId in defs) {\n let def = defs[defId]\n\n if (def.publicId === id) {\n\n if (def.recurringDef) {\n return new EventApi(this, def, null)\n } else {\n\n for (let instanceId in instances) {\n let instance = instances[instanceId]\n\n if (instance.defId === def.defId) {\n return new EventApi(this, def, instance)\n }\n }\n }\n }\n }\n\n return null\n }\n\n\n getEvents(): EventApi[] {\n let { defs, instances } = this.state.eventStore\n let eventApis: EventApi[] = []\n\n for (let id in instances) {\n let instance = instances[id]\n let def = defs[instance.defId]\n\n eventApis.push(new EventApi(this, def, instance))\n }\n\n return eventApis\n }\n\n\n removeAllEvents() {\n this.dispatch({ type: 'REMOVE_ALL_EVENTS' })\n }\n\n\n rerenderEvents() { // API method. destroys old events if previously rendered.\n this.dispatch({ type: 'RESET_EVENTS' })\n }\n\n\n // Public Event Sources API\n // -----------------------------------------------------------------------------------------------------------------\n\n\n getEventSources(): EventSourceApi[] {\n let sourceHash = this.state.eventSources\n let sourceApis: EventSourceApi[] = []\n\n for (let internalId in sourceHash) {\n sourceApis.push(new EventSourceApi(this, sourceHash[internalId]))\n }\n\n return sourceApis\n }\n\n\n getEventSourceById(id: string | number): EventSourceApi | null {\n let sourceHash = this.state.eventSources\n\n id = String(id)\n\n for (let sourceId in sourceHash) {\n if (sourceHash[sourceId].publicId === id) {\n return new EventSourceApi(this, sourceHash[sourceId])\n }\n }\n\n return null\n }\n\n\n addEventSource(sourceInput: EventSourceInput): EventSourceApi {\n\n if (sourceInput instanceof EventSourceApi) {\n\n // not already present? don't want to add an old snapshot\n if (!this.state.eventSources[sourceInput.internalEventSource.sourceId]) {\n this.dispatch({\n type: 'ADD_EVENT_SOURCES',\n sources: [ sourceInput.internalEventSource ]\n })\n }\n\n return sourceInput\n }\n\n let eventSource = parseEventSource(sourceInput, this)\n\n if (eventSource) { // TODO: error otherwise?\n this.dispatch({ type: 'ADD_EVENT_SOURCES', sources: [ eventSource ] })\n\n return new EventSourceApi(this, eventSource)\n }\n\n return null\n }\n\n\n removeAllEventSources() {\n this.dispatch({ type: 'REMOVE_ALL_EVENT_SOURCES' })\n }\n\n\n refetchEvents() {\n this.dispatch({ type: 'FETCH_EVENT_SOURCES' })\n }\n\n\n // Scroll\n // -----------------------------------------------------------------------------------------------------------------\n\n scrollToTime(timeInput: DurationInput) {\n let time = createDuration(timeInput)\n\n if (time) {\n this.component.view.scrollToTime(time)\n }\n }\n\n}\n\nEmitterMixin.mixInto(Calendar)\n\n\n// for memoizers\n// -----------------------------------------------------------------------------------------------------------------\n\n\nfunction buildDateEnv(locale: Locale, timeZone, namedTimeZoneImpl: NamedTimeZoneImplClass, firstDay, weekNumberCalculation, weekLabel, cmdFormatter: CmdFormatterFunc) {\n return new DateEnv({\n calendarSystem: 'gregory', // TODO: make this a setting\n timeZone,\n namedTimeZoneImpl,\n locale,\n weekNumberCalculation,\n firstDay,\n weekLabel,\n cmdFormatter\n })\n}\n\n\nfunction buildTheme(this: Calendar, calendarOptions) {\n let themeClass = this.pluginSystem.hooks.themeClasses[calendarOptions.themeSystem] || StandardTheme\n return new themeClass(calendarOptions)\n}\n\n\nfunction buildDelayedRerender(this: Calendar, wait) {\n let func = this.tryRerender.bind(this)\n\n if (wait != null) {\n func = debounce(func, wait)\n }\n\n return func\n}\n\n\nfunction buildEventUiBySource(eventSources: EventSourceHash): EventUiHash {\n return mapHash(eventSources, function(eventSource) {\n return eventSource.ui\n })\n}\n\n\nfunction buildEventUiBases(eventDefs: EventDefHash, eventUiSingleBase: EventUi, eventUiBySource: EventUiHash) {\n let eventUiBases: EventUiHash = { '': eventUiSingleBase }\n\n for (let defId in eventDefs) {\n let def = eventDefs[defId]\n\n if (def.sourceId && eventUiBySource[def.sourceId]) {\n eventUiBases[defId] = eventUiBySource[def.sourceId]\n }\n }\n\n return eventUiBases\n}\n","import { parseFieldSpecs } from './util/misc'\nimport DateProfileGenerator, { DateProfile } from './DateProfileGenerator'\nimport { DateMarker, addMs } from './datelib/marker'\nimport { createDuration, Duration } from './datelib/duration'\nimport { default as EmitterMixin, EmitterInterface } from './common/EmitterMixin'\nimport { ViewSpec } from './structs/view-spec'\nimport { createElement } from './util/dom-manip'\nimport { ComponentContext } from './component/Component'\nimport DateComponent from './component/DateComponent'\nimport { EventStore } from './structs/event-store'\nimport { EventUiHash } from './component/event-ui'\nimport { sliceEventStore, EventRenderRange } from './component/event-rendering'\nimport { DateSpan } from './structs/date-span'\nimport { EventInteractionState } from './interactions/event-interaction-state'\nimport { memoizeRendering } from './component/memoized-rendering'\nimport { __assign } from 'tslib'\n\nexport interface ViewProps {\n dateProfile: DateProfile\n businessHours: EventStore\n eventStore: EventStore\n eventUiBases: EventUiHash\n dateSelection: DateSpan | null\n eventSelection: string\n eventDrag: EventInteractionState | null\n eventResize: EventInteractionState | null\n}\n\nexport default abstract class View extends DateComponent {\n\n // config properties, initialized after class on prototype\n usesMinMaxTime: boolean // whether minTime/maxTime will affect the activeRange. Views must opt-in.\n dateProfileGeneratorClass: any // initialized after class. used by Calendar\n\n on: EmitterInterface['on']\n one: EmitterInterface['one']\n off: EmitterInterface['off']\n trigger: EmitterInterface['trigger']\n triggerWith: EmitterInterface['triggerWith']\n hasHandlers: EmitterInterface['hasHandlers']\n\n viewSpec: ViewSpec\n dateProfileGenerator: DateProfileGenerator\n type: string // subclass' view name (string). for the API\n title: string // the text that will be displayed in the header's title. SET BY CALLER for API\n\n queuedScroll: any\n\n eventOrderSpecs: any // criteria for ordering events when they have same date/time\n nextDayThreshold: Duration\n\n // now indicator\n isNowIndicatorRendered: boolean\n initialNowDate: DateMarker // result first getNow call\n initialNowQueriedMs: number // ms time the getNow was called\n nowIndicatorTimeoutID: any // for refresh timing of now indicator\n nowIndicatorIntervalID: any // \"\n\n private renderDatesMem = memoizeRendering(this.renderDatesWrap, this.unrenderDatesWrap)\n private renderBusinessHoursMem = memoizeRendering(this.renderBusinessHours, this.unrenderBusinessHours, [ this.renderDatesMem ])\n private renderDateSelectionMem = memoizeRendering(this.renderDateSelectionWrap, this.unrenderDateSelectionWrap, [ this.renderDatesMem ])\n private renderEventsMem = memoizeRendering(this.renderEvents, this.unrenderEvents, [ this.renderDatesMem ])\n private renderEventSelectionMem = memoizeRendering(this.renderEventSelectionWrap, this.unrenderEventSelectionWrap, [ this.renderEventsMem ])\n private renderEventDragMem = memoizeRendering(this.renderEventDragWrap, this.unrenderEventDragWrap, [ this.renderDatesMem ])\n private renderEventResizeMem = memoizeRendering(this.renderEventResizeWrap, this.unrenderEventResizeWrap, [ this.renderDatesMem ])\n\n\n constructor(context: ComponentContext, viewSpec: ViewSpec, dateProfileGenerator: DateProfileGenerator, parentEl: HTMLElement) {\n super(\n context,\n createElement('div', { className: 'fc-view fc-' + viewSpec.type + '-view' }),\n true // isView (HACK)\n )\n\n this.viewSpec = viewSpec\n this.dateProfileGenerator = dateProfileGenerator\n this.type = viewSpec.type\n this.eventOrderSpecs = parseFieldSpecs(this.opt('eventOrder'))\n this.nextDayThreshold = createDuration(this.opt('nextDayThreshold'))\n\n parentEl.appendChild(this.el)\n this.initialize()\n }\n\n\n initialize() { // convenient for sublcasses\n }\n\n\n // Date Setting/Unsetting\n // -----------------------------------------------------------------------------------------------------------------\n\n\n get activeStart(): Date {\n return this.dateEnv.toDate(this.props.dateProfile.activeRange.start)\n }\n\n get activeEnd(): Date {\n return this.dateEnv.toDate(this.props.dateProfile.activeRange.end)\n }\n\n get currentStart(): Date {\n return this.dateEnv.toDate(this.props.dateProfile.currentRange.start)\n }\n\n get currentEnd(): Date {\n return this.dateEnv.toDate(this.props.dateProfile.currentRange.end)\n }\n\n\n // General Rendering\n // -----------------------------------------------------------------------------------------------------------------\n\n\n render(props: ViewProps) {\n this.renderDatesMem(props.dateProfile)\n this.renderBusinessHoursMem(props.businessHours)\n this.renderDateSelectionMem(props.dateSelection)\n this.renderEventsMem(props.eventStore)\n this.renderEventSelectionMem(props.eventSelection)\n this.renderEventDragMem(props.eventDrag)\n this.renderEventResizeMem(props.eventResize)\n }\n\n\n destroy() {\n super.destroy()\n\n this.renderDatesMem.unrender() // should unrender everything else\n }\n\n\n // Sizing\n // -----------------------------------------------------------------------------------------------------------------\n\n\n updateSize(isResize: boolean, viewHeight: number, isAuto: boolean) {\n let { calendar } = this\n\n if (isResize || calendar.isViewUpdated || calendar.isDatesUpdated || calendar.isEventsUpdated) {\n // sort of the catch-all sizing\n // anything that might cause dimension changes\n this.updateBaseSize(isResize, viewHeight, isAuto)\n }\n }\n\n\n updateBaseSize(isResize: boolean, viewHeight: number, isAuto: boolean) {\n }\n\n\n // Date Rendering\n // -----------------------------------------------------------------------------------------------------------------\n\n renderDatesWrap(dateProfile: DateProfile) {\n this.renderDates(dateProfile)\n this.addScroll({\n timeMs: createDuration(this.opt('scrollTime')).milliseconds\n })\n this.startNowIndicator(dateProfile) // shouldn't render yet because updateSize will be called soon\n }\n\n unrenderDatesWrap() {\n this.stopNowIndicator()\n this.unrenderDates()\n }\n\n renderDates(dateProfile: DateProfile) {}\n unrenderDates() {}\n\n\n // Business Hours\n // -----------------------------------------------------------------------------------------------------------------\n\n renderBusinessHours(businessHours: EventStore) {}\n unrenderBusinessHours() {}\n\n\n // Date Selection\n // -----------------------------------------------------------------------------------------------------------------\n\n renderDateSelectionWrap(selection: DateSpan) {\n if (selection) {\n this.renderDateSelection(selection)\n }\n }\n\n unrenderDateSelectionWrap(selection: DateSpan) {\n if (selection) {\n this.unrenderDateSelection(selection)\n }\n }\n\n renderDateSelection(selection: DateSpan) {}\n unrenderDateSelection(selection: DateSpan) {}\n\n\n // Event Rendering\n // -----------------------------------------------------------------------------------------------------------------\n\n renderEvents(eventStore: EventStore) {}\n unrenderEvents() {}\n\n // util for subclasses\n sliceEvents(eventStore: EventStore, allDay: boolean): EventRenderRange[] {\n let { props } = this\n\n return sliceEventStore(\n eventStore,\n props.eventUiBases,\n props.dateProfile.activeRange,\n allDay ? this.nextDayThreshold : null\n ).fg\n }\n\n\n // Event Selection\n // -----------------------------------------------------------------------------------------------------------------\n\n renderEventSelectionWrap(instanceId: string) {\n if (instanceId) {\n this.renderEventSelection(instanceId)\n }\n }\n\n unrenderEventSelectionWrap(instanceId: string) {\n if (instanceId) {\n this.unrenderEventSelection(instanceId)\n }\n }\n\n renderEventSelection(instanceId: string) {}\n unrenderEventSelection(instanceId: string) {}\n\n\n // Event Drag\n // -----------------------------------------------------------------------------------------------------------------\n\n renderEventDragWrap(state: EventInteractionState) {\n if (state) {\n this.renderEventDrag(state)\n }\n }\n\n unrenderEventDragWrap(state: EventInteractionState) {\n if (state) {\n this.unrenderEventDrag(state)\n }\n }\n\n renderEventDrag(state: EventInteractionState) {}\n unrenderEventDrag(state: EventInteractionState) {}\n\n\n // Event Resize\n // -----------------------------------------------------------------------------------------------------------------\n\n renderEventResizeWrap(state: EventInteractionState) {\n if (state) {\n this.renderEventResize(state)\n }\n }\n\n unrenderEventResizeWrap(state: EventInteractionState) {\n if (state) {\n this.unrenderEventResize(state)\n }\n }\n\n renderEventResize(state: EventInteractionState) {}\n unrenderEventResize(state: EventInteractionState) {}\n\n\n /* Now Indicator\n ------------------------------------------------------------------------------------------------------------------*/\n\n\n // Immediately render the current time indicator and begins re-rendering it at an interval,\n // which is defined by this.getNowIndicatorUnit().\n // TODO: somehow do this for the current whole day's background too\n startNowIndicator(dateProfile: DateProfile) {\n let { dateEnv } = this\n let unit\n let update\n let delay // ms wait value\n\n if (this.opt('nowIndicator')) {\n unit = this.getNowIndicatorUnit(dateProfile)\n if (unit) {\n update = this.updateNowIndicator.bind(this)\n\n this.initialNowDate = this.calendar.getNow()\n this.initialNowQueriedMs = new Date().valueOf()\n\n // wait until the beginning of the next interval\n delay = dateEnv.add(\n dateEnv.startOf(this.initialNowDate, unit),\n createDuration(1, unit)\n ).valueOf() - this.initialNowDate.valueOf()\n\n // TODO: maybe always use setTimeout, waiting until start of next unit\n this.nowIndicatorTimeoutID = setTimeout(() => {\n this.nowIndicatorTimeoutID = null\n update()\n\n if (unit === 'second') {\n delay = 1000 // every second\n } else {\n delay = 1000 * 60 // otherwise, every minute\n }\n\n this.nowIndicatorIntervalID = setInterval(update, delay) // update every interval\n }, delay)\n }\n\n // rendering will be initiated in updateSize\n }\n }\n\n\n // rerenders the now indicator, computing the new current time from the amount of time that has passed\n // since the initial getNow call.\n updateNowIndicator() {\n if (\n this.props.dateProfile && // a way to determine if dates were rendered yet\n this.initialNowDate // activated before?\n ) {\n this.unrenderNowIndicator() // won't unrender if unnecessary\n this.renderNowIndicator(\n addMs(this.initialNowDate, new Date().valueOf() - this.initialNowQueriedMs)\n )\n this.isNowIndicatorRendered = true\n }\n }\n\n\n // Immediately unrenders the view's current time indicator and stops any re-rendering timers.\n // Won't cause side effects if indicator isn't rendered.\n stopNowIndicator() {\n if (this.isNowIndicatorRendered) {\n\n if (this.nowIndicatorTimeoutID) {\n clearTimeout(this.nowIndicatorTimeoutID)\n this.nowIndicatorTimeoutID = null\n }\n if (this.nowIndicatorIntervalID) {\n clearInterval(this.nowIndicatorIntervalID)\n this.nowIndicatorIntervalID = null\n }\n\n this.unrenderNowIndicator()\n this.isNowIndicatorRendered = false\n }\n }\n\n\n getNowIndicatorUnit(dateProfile: DateProfile) {\n // subclasses should implement\n }\n\n\n // Renders a current time indicator at the given datetime\n renderNowIndicator(date) {\n // SUBCLASSES MUST PASS TO CHILDREN!\n }\n\n\n // Undoes the rendering actions from renderNowIndicator\n unrenderNowIndicator() {\n // SUBCLASSES MUST PASS TO CHILDREN!\n }\n\n\n /* Scroller\n ------------------------------------------------------------------------------------------------------------------*/\n\n\n addScroll(scroll) {\n let queuedScroll = this.queuedScroll || (this.queuedScroll = {})\n\n __assign(queuedScroll, scroll)\n }\n\n\n popScroll(isResize: boolean) {\n this.applyQueuedScroll(isResize)\n this.queuedScroll = null\n }\n\n\n applyQueuedScroll(isResize: boolean) {\n this.applyScroll(this.queuedScroll || {}, isResize)\n }\n\n\n queryScroll() {\n let scroll = {} as any\n\n if (this.props.dateProfile) { // dates rendered yet?\n __assign(scroll, this.queryDateScroll())\n }\n\n return scroll\n }\n\n\n applyScroll(scroll, isResize: boolean) {\n let { timeMs } = scroll\n\n if (timeMs != null) {\n delete scroll.timeMs\n\n if (this.props.dateProfile) { // dates rendered yet?\n __assign(scroll, this.computeDateScroll(timeMs))\n }\n }\n\n if (this.props.dateProfile) { // dates rendered yet?\n this.applyDateScroll(scroll)\n }\n }\n\n\n computeDateScroll(timeMs: number) {\n return {} // subclasses must implement\n }\n\n\n queryDateScroll() {\n return {} // subclasses must implement\n }\n\n\n applyDateScroll(scroll) {\n // subclasses must implement\n }\n\n\n // for API\n scrollToTime(time: Duration) {\n this.applyScroll({\n timeMs: time.milliseconds\n }, false)\n }\n\n}\n\nEmitterMixin.mixInto(View)\n\nView.prototype.usesMinMaxTime = false\nView.prototype.dateProfileGeneratorClass = DateProfileGenerator\n","import { DateMarker } from '../../datelib/marker'\nimport { createFormatter, DateFormatter } from '../../datelib/formatting'\nimport { htmlToElements } from '../../util/dom-manip'\nimport { compareByFieldSpecs } from '../../util/misc'\nimport { EventUi } from '../event-ui'\nimport { EventRenderRange, filterSegsViaEls } from '../event-rendering'\nimport { Seg } from '../DateComponent'\nimport { ComponentContext } from '../Component'\n\n\nexport default abstract class FgEventRenderer {\n\n context: ComponentContext\n\n // derived from options\n eventTimeFormat: DateFormatter\n displayEventTime: boolean\n displayEventEnd: boolean\n\n segs: Seg[] = []\n isSizeDirty: boolean = false\n\n\n constructor(context: ComponentContext) {\n this.context = context\n }\n\n\n renderSegs(segs: Seg[], mirrorInfo?) {\n this.rangeUpdated() // called too frequently :(\n\n // render an `.el` on each seg\n // returns a subset of the segs. segs that were actually rendered\n segs = this.renderSegEls(segs, mirrorInfo)\n\n this.segs = segs\n this.attachSegs(segs, mirrorInfo)\n\n this.isSizeDirty = true\n this.context.view.triggerRenderedSegs(this.segs, Boolean(mirrorInfo))\n }\n\n\n unrender(_segs: Seg[], mirrorInfo?) {\n this.context.view.triggerWillRemoveSegs(this.segs, Boolean(mirrorInfo))\n this.detachSegs(this.segs)\n this.segs = []\n }\n\n\n abstract renderSegHtml(seg: Seg, mirrorInfo): string\n abstract attachSegs(segs: Seg[], mirrorInfo)\n abstract detachSegs(segs: Seg[])\n\n\n // Updates values that rely on options and also relate to range\n rangeUpdated() {\n let { options } = this.context\n let displayEventTime\n let displayEventEnd\n\n this.eventTimeFormat = createFormatter(\n options.eventTimeFormat || this.computeEventTimeFormat(),\n options.defaultRangeSeparator\n )\n\n displayEventTime = options.displayEventTime\n if (displayEventTime == null) {\n displayEventTime = this.computeDisplayEventTime() // might be based off of range\n }\n\n displayEventEnd = options.displayEventEnd\n if (displayEventEnd == null) {\n displayEventEnd = this.computeDisplayEventEnd() // might be based off of range\n }\n\n this.displayEventTime = displayEventTime\n this.displayEventEnd = displayEventEnd\n }\n\n\n // Renders and assigns an `el` property for each foreground event segment.\n // Only returns segments that successfully rendered.\n renderSegEls(segs: Seg[], mirrorInfo) {\n let html = ''\n let i\n\n if (segs.length) { // don't build an empty html string\n\n // build a large concatenation of event segment HTML\n for (i = 0; i < segs.length; i++) {\n html += this.renderSegHtml(segs[i], mirrorInfo)\n }\n\n // Grab individual elements from the combined HTML string. Use each as the default rendering.\n // Then, compute the 'el' for each segment. An el might be null if the eventRender callback returned false.\n htmlToElements(html).forEach((el, i) => {\n let seg = segs[i]\n\n if (el) {\n seg.el = el\n }\n })\n\n segs = filterSegsViaEls(this.context.view, segs, Boolean(mirrorInfo))\n }\n\n return segs\n }\n\n\n // Generic utility for generating the HTML classNames for an event segment's element\n getSegClasses(seg: Seg, isDraggable, isResizable, mirrorInfo) {\n let classes = [\n 'fc-event',\n seg.isStart ? 'fc-start' : 'fc-not-start',\n seg.isEnd ? 'fc-end' : 'fc-not-end'\n ].concat(seg.eventRange.ui.classNames)\n\n if (isDraggable) {\n classes.push('fc-draggable')\n }\n\n if (isResizable) {\n classes.push('fc-resizable')\n }\n\n if (mirrorInfo) {\n classes.push('fc-mirror')\n\n if (mirrorInfo.isDragging) {\n classes.push('fc-dragging')\n }\n\n if (mirrorInfo.isResizing) {\n classes.push('fc-resizing')\n }\n }\n\n return classes\n }\n\n\n // Compute the text that should be displayed on an event's element.\n // `range` can be the Event object itself, or something range-like, with at least a `start`.\n // If event times are disabled, or the event has no time, will return a blank string.\n // If not specified, formatter will default to the eventTimeFormat setting,\n // and displayEnd will default to the displayEventEnd setting.\n getTimeText(eventRange: EventRenderRange, formatter?, displayEnd?) {\n let { def, instance } = eventRange\n\n return this._getTimeText(\n instance.range.start,\n def.hasEnd ? instance.range.end : null,\n def.allDay,\n formatter,\n displayEnd,\n instance.forcedStartTzo,\n instance.forcedEndTzo\n )\n }\n\n\n _getTimeText(\n start: DateMarker,\n end: DateMarker,\n allDay,\n formatter?,\n displayEnd?,\n forcedStartTzo?: number,\n forcedEndTzo?: number\n) {\n let { dateEnv } = this.context\n\n if (formatter == null) {\n formatter = this.eventTimeFormat\n }\n\n if (displayEnd == null) {\n displayEnd = this.displayEventEnd\n }\n\n if (this.displayEventTime && !allDay) {\n if (displayEnd && end) {\n return dateEnv.formatRange(start, end, formatter, {\n forcedStartTzo,\n forcedEndTzo\n })\n } else {\n return dateEnv.format(start, formatter, {\n forcedTzo: forcedStartTzo\n })\n }\n }\n\n return ''\n }\n\n\n computeEventTimeFormat(): any {\n return {\n hour: 'numeric',\n minute: '2-digit',\n omitZeroMinute: true\n }\n }\n\n\n computeDisplayEventTime() {\n return true\n }\n\n\n computeDisplayEventEnd() {\n return true\n }\n\n\n // Utility for generating event skin-related CSS properties\n getSkinCss(ui: EventUi) {\n return {\n 'background-color': ui.backgroundColor,\n 'border-color': ui.borderColor,\n color: ui.textColor\n }\n }\n\n\n sortEventSegs(segs): Seg[] {\n let specs = this.context.view.eventOrderSpecs\n let objs = segs.map(buildSegCompareObj)\n\n objs.sort(function(obj0, obj1) {\n return compareByFieldSpecs(obj0, obj1, specs)\n })\n\n return objs.map(function(c) {\n return c._seg\n })\n }\n\n\n computeSizes(force: boolean) {\n if (force || this.isSizeDirty) {\n this.computeSegSizes(this.segs)\n }\n }\n\n\n assignSizes(force: boolean) {\n if (force || this.isSizeDirty) {\n this.assignSegSizes(this.segs)\n this.isSizeDirty = false\n }\n }\n\n\n computeSegSizes(segs: Seg[]) {\n }\n\n\n assignSegSizes(segs: Seg[]) {\n }\n\n\n // Manipulation on rendered segs\n\n\n hideByHash(hash) {\n if (hash) {\n for (let seg of this.segs) {\n if (hash[seg.eventRange.instance.instanceId]) {\n seg.el.style.visibility = 'hidden'\n }\n }\n }\n }\n\n\n showByHash(hash) {\n if (hash) {\n for (let seg of this.segs) {\n if (hash[seg.eventRange.instance.instanceId]) {\n seg.el.style.visibility = ''\n }\n }\n }\n }\n\n\n selectByInstanceId(instanceId: string) {\n if (instanceId) {\n for (let seg of this.segs) {\n let eventInstance = seg.eventRange.instance\n if (\n eventInstance && eventInstance.instanceId === instanceId &&\n seg.el // necessary?\n ) {\n seg.el.classList.add('fc-selected')\n }\n }\n }\n }\n\n\n unselectByInstanceId(instanceId: string) {\n if (instanceId) {\n for (let seg of this.segs) {\n if (seg.el) { // necessary?\n seg.el.classList.remove('fc-selected')\n }\n }\n }\n }\n\n}\n\n\n// returns a object with all primitive props that can be compared\nexport function buildSegCompareObj(seg: Seg) {\n let eventDef = seg.eventRange.def\n let range = seg.eventRange.instance.range\n let start = range.start ? range.start.valueOf() : 0 // TODO: better support for open-range events\n let end = range.end ? range.end.valueOf() : 0 // \"\n\n return {\n ...eventDef.extendedProps,\n ...eventDef,\n id: eventDef.publicId,\n start,\n end,\n duration: end - start,\n allDay: Number(eventDef.allDay),\n _seg: seg // for later retrieval\n }\n}\n","import { cssToStr } from '../../util/html'\nimport { htmlToElements, removeElement, elementMatches } from '../../util/dom-manip'\nimport { Seg } from '../DateComponent'\nimport { filterSegsViaEls } from '../event-rendering'\nimport { ComponentContext } from '../Component'\n\n\nexport default abstract class FillRenderer { // use for highlight, background events, business hours\n\n context: ComponentContext\n fillSegTag: string = 'div'\n containerElsByType: any // a hash of element sets used for rendering each fill. Keyed by fill name.\n segsByType: any\n dirtySizeFlags: any = {}\n\n\n constructor(context: ComponentContext) {\n this.context = context\n this.containerElsByType = {}\n this.segsByType = {}\n }\n\n\n getSegsByType(type: string) {\n return this.segsByType[type] || []\n }\n\n\n renderSegs(type, segs: Seg[]) {\n let renderedSegs = this.renderSegEls(type, segs) // assignes `.el` to each seg. returns successfully rendered segs\n let containerEls = this.attachSegs(type, renderedSegs)\n\n if (containerEls) {\n (this.containerElsByType[type] || (this.containerElsByType[type] = []))\n .push(...containerEls)\n }\n\n this.segsByType[type] = renderedSegs\n\n if (type === 'bgEvent') {\n this.context.view.triggerRenderedSegs(renderedSegs, false) // isMirror=false\n }\n\n this.dirtySizeFlags[type] = true\n }\n\n\n // Unrenders a specific type of fill that is currently rendered on the grid\n unrender(type) {\n let segs = this.segsByType[type]\n\n if (segs) {\n\n if (type === 'bgEvent') {\n this.context.view.triggerWillRemoveSegs(segs, false) // isMirror=false\n }\n\n this.detachSegs(type, segs)\n }\n }\n\n\n // Renders and assigns an `el` property for each fill segment. Generic enough to work with different types.\n // Only returns segments that successfully rendered.\n renderSegEls(type, segs: Seg[]) {\n let html = ''\n let i\n\n if (segs.length) {\n\n // build a large concatenation of segment HTML\n for (i = 0; i < segs.length; i++) {\n html += this.renderSegHtml(type, segs[i])\n }\n\n // Grab individual elements from the combined HTML string. Use each as the default rendering.\n // Then, compute the 'el' for each segment.\n htmlToElements(html).forEach((el, i) => {\n let seg = segs[i]\n\n if (el) {\n seg.el = el\n }\n })\n\n if (type === 'bgEvent') {\n segs = filterSegsViaEls(\n this.context.view,\n segs,\n false // isMirror. background events can never be mirror elements\n )\n }\n\n // correct element type? (would be bad if a non-TD were inserted into a table for example)\n segs = segs.filter((seg) => {\n return elementMatches(seg.el, this.fillSegTag)\n })\n }\n\n return segs\n }\n\n\n // Builds the HTML needed for one fill segment. Generic enough to work with different types.\n renderSegHtml(type, seg: Seg) {\n let css = null\n let classNames = []\n\n if (type !== 'highlight' && type !== 'businessHours') {\n css = {\n 'background-color': seg.eventRange.ui.backgroundColor\n }\n }\n\n if (type !== 'highlight') {\n classNames = classNames.concat(seg.eventRange.ui.classNames)\n }\n\n if (type === 'businessHours') {\n classNames.push('fc-bgevent')\n } else {\n classNames.push('fc-' + type.toLowerCase())\n }\n\n return '<' + this.fillSegTag +\n (classNames.length ? ' class=\"' + classNames.join(' ') + '\"' : '') +\n (css ? ' style=\"' + cssToStr(css) + '\"' : '') +\n '>'\n }\n\n\n abstract attachSegs(type, segs: Seg[]): HTMLElement[] | void\n\n\n detachSegs(type, segs: Seg[]) {\n let containerEls = this.containerElsByType[type]\n\n if (containerEls) {\n containerEls.forEach(removeElement)\n delete this.containerElsByType[type]\n }\n }\n\n\n computeSizes(force: boolean) {\n for (let type in this.segsByType) {\n if (force || this.dirtySizeFlags[type]) {\n this.computeSegSizes(this.segsByType[type])\n }\n }\n }\n\n\n assignSizes(force: boolean) {\n for (let type in this.segsByType) {\n if (force || this.dirtySizeFlags[type]) {\n this.assignSegSizes(this.segsByType[type])\n }\n }\n\n this.dirtySizeFlags = {}\n }\n\n\n computeSegSizes(segs: Seg[]) {\n }\n\n\n assignSegSizes(segs: Seg[]) {\n }\n\n}\n","\nexport abstract class NamedTimeZoneImpl {\n\n timeZoneName: string\n\n constructor(timeZoneName: string) {\n this.timeZoneName = timeZoneName\n }\n\n abstract offsetForArray(a: number[]): number\n abstract timestampToArray(ms: number): number[]\n}\n\nexport type NamedTimeZoneImplClass = { new(timeZoneName: string): NamedTimeZoneImpl }\n","import EmitterMixin from '../common/EmitterMixin'\n\n/*\nAn abstraction for a dragging interaction originating on an event.\nDoes higher-level things than PointerDragger, such as possibly:\n- a \"mirror\" that moves with the pointer\n- a minimum number of pixels or other criteria for a true drag to begin\n\nsubclasses must emit:\n- pointerdown\n- dragstart\n- dragmove\n- pointerup\n- dragend\n*/\nexport default abstract class ElementDragging { // TODO: rename to *Interface?\n\n emitter: EmitterMixin\n\n constructor(el: HTMLElement) {\n this.emitter = new EmitterMixin()\n }\n\n destroy() {\n }\n\n // if given true, should prevent dragstart+dragmove+dragend from firing\n abstract setIgnoreMove(bool: boolean): void\n\n setMirrorIsVisible(bool: boolean) {\n // optional if subclass doesn't want to support a mirror\n }\n\n setMirrorNeedsRevert(bool: boolean) {\n // optional if subclass doesn't want to support a mirror\n }\n\n setAutoScrollEnabled(bool: boolean) {\n // optional\n }\n\n}\n\nexport type ElementDraggingClass = { new(el: HTMLElement): ElementDragging }\n","import { DateEnv, DateInput } from './datelib/env'\nimport { createFormatter } from './datelib/formatting'\nimport { parseRawLocales, buildLocale } from './datelib/locale'\nimport { globalDefaults } from './options'\n\nexport function formatDate(dateInput: DateInput, settings = {}) {\n let dateEnv = buildDateEnv(settings)\n let formatter = createFormatter(settings)\n let dateMeta = dateEnv.createMarkerMeta(dateInput)\n\n if (!dateMeta) { // TODO: warning?\n return ''\n }\n\n return dateEnv.format(dateMeta.marker, formatter, {\n forcedTzo: dateMeta.forcedTzo\n })\n}\n\nexport function formatRange(\n startInput: DateInput,\n endInput: DateInput,\n settings // mixture of env and formatter settings\n) {\n let dateEnv = buildDateEnv(typeof settings === 'object' && settings ? settings : {}) // pass in if non-null object\n let formatter = createFormatter(settings, globalDefaults.defaultRangeSeparator)\n let startMeta = dateEnv.createMarkerMeta(startInput)\n let endMeta = dateEnv.createMarkerMeta(endInput)\n\n if (!startMeta || !endMeta) { // TODO: warning?\n return ''\n }\n\n return dateEnv.formatRange(startMeta.marker, endMeta.marker, formatter, {\n forcedStartTzo: startMeta.forcedTzo,\n forcedEndTzo: endMeta.forcedTzo,\n isEndExclusive: settings.isEndExclusive\n })\n}\n\n// TODO: more DRY and optimized\nfunction buildDateEnv(settings) {\n let locale = buildLocale(settings.locale || 'en', parseRawLocales([]).map) // TODO: don't hardcode 'en' everywhere\n\n // ensure required settings\n settings = {\n timeZone: globalDefaults.timeZone,\n calendarSystem: 'gregory',\n ...settings,\n locale\n }\n\n return new DateEnv(settings)\n}\n","import { createDuration, Duration, DurationInput } from '../datelib/duration'\nimport { refineProps } from '../util/misc'\nimport { EventNonDateInput } from '../structs/event'\n\n/*\nInformation about what will happen when an external element is dragged-and-dropped\nonto a calendar. Contains information for creating an event.\n*/\n\nexport interface DragMetaInput extends EventNonDateInput {\n startTime?: DurationInput\n duration?: DurationInput\n create?: boolean\n sourceId?: string\n}\n\nexport interface DragMeta {\n startTime: Duration | null\n duration: Duration | null\n create: boolean // create an event when dropped?\n sourceId: string // similar to addEvent's parameter\n leftoverProps: object\n}\n\nconst DRAG_META_PROPS = {\n startTime: createDuration,\n duration: createDuration,\n create: Boolean,\n sourceId: String\n}\n\nconst DRAG_META_DEFAULTS = {\n create: true\n}\n\nexport function parseDragMeta(raw: DragMetaInput): DragMeta {\n let leftoverProps = {}\n let refined = refineProps(raw, DRAG_META_PROPS, DRAG_META_DEFAULTS, leftoverProps) as DragMeta\n\n refined.leftoverProps = leftoverProps\n\n return refined\n}\n","import { rangeContainsMarker } from '../datelib/date-range'\nimport { htmlEscape } from '../util/html'\nimport { buildGotoAnchorHtml, getDayClasses } from '../component/date-rendering'\nimport { DateMarker, DAY_IDS } from '../datelib/marker'\nimport { DateProfile } from '../DateProfileGenerator'\nimport { ComponentContext } from '../component/Component'\n\n// Computes a default column header formatting string if `colFormat` is not explicitly defined\nexport function computeFallbackHeaderFormat(datesRepDistinctDays: boolean, dayCnt: number) {\n // if more than one week row, or if there are a lot of columns with not much space,\n // put just the day numbers will be in each cell\n if (!datesRepDistinctDays || dayCnt > 10) {\n return { weekday: 'short' } // \"Sat\"\n } else if (dayCnt > 1) {\n return { weekday: 'short', month: 'numeric', day: 'numeric', omitCommas: true } // \"Sat 11/12\"\n } else {\n return { weekday: 'long' } // \"Saturday\"\n }\n}\n\nexport function renderDateCell(\n dateMarker: DateMarker,\n dateProfile: DateProfile,\n datesRepDistinctDays,\n colCnt,\n colHeadFormat,\n context: ComponentContext,\n colspan?,\n otherAttrs?\n): string {\n let { view, dateEnv, theme, options } = context\n let isDateValid = rangeContainsMarker(dateProfile.activeRange, dateMarker) // TODO: called too frequently. cache somehow.\n let classNames = [\n 'fc-day-header',\n theme.getClass('widgetHeader')\n ]\n let innerHtml\n\n if (typeof options.columnHeaderHtml === 'function') {\n innerHtml = options.columnHeaderHtml(\n dateEnv.toDate(dateMarker)\n )\n } else if (typeof options.columnHeaderText === 'function') {\n innerHtml = htmlEscape(\n options.columnHeaderText(\n dateEnv.toDate(dateMarker)\n )\n )\n } else {\n innerHtml = htmlEscape(dateEnv.format(dateMarker, colHeadFormat))\n }\n\n // if only one row of days, the classNames on the header can represent the specific days beneath\n if (datesRepDistinctDays) {\n classNames = classNames.concat(\n // includes the day-of-week class\n // noThemeHighlight=true (don't highlight the header)\n getDayClasses(dateMarker, dateProfile, context, true)\n )\n } else {\n classNames.push('fc-' + DAY_IDS[dateMarker.getUTCDay()]) // only add the day-of-week class\n }\n\n return '' +\n ' 1 ?\n ' colspan=\"' + colspan + '\"' :\n '') +\n (otherAttrs ?\n ' ' + otherAttrs :\n '') +\n '>' +\n (isDateValid ?\n // don't make a link if the heading could represent multiple days, or if there's only one day (forceOff)\n buildGotoAnchorHtml(\n view,\n { date: dateMarker, forceOff: !datesRepDistinctDays || colCnt === 1 },\n innerHtml\n ) :\n // if not valid, display text, but no link\n innerHtml\n ) +\n ''\n}\n","import Component, { ComponentContext } from '../component/Component'\nimport { htmlToElement, removeElement } from '../util/dom-manip'\nimport { DateMarker } from '../datelib/marker'\nimport { DateProfile } from '../DateProfileGenerator'\nimport { createFormatter } from '../datelib/formatting'\nimport { computeFallbackHeaderFormat, renderDateCell } from './table-utils'\n\nexport interface DayTableHeaderProps {\n dates: DateMarker[]\n dateProfile: DateProfile\n datesRepDistinctDays: boolean\n renderIntroHtml?: () => string\n}\n\nexport default class DayHeader extends Component {\n\n el: HTMLElement\n thead: HTMLElement\n\n constructor(context: ComponentContext, parentEl: HTMLElement) {\n super(context)\n\n parentEl.innerHTML = '' // because might be nbsp\n parentEl.appendChild(\n this.el = htmlToElement(\n '
' +\n '' +\n '' +\n '
' +\n '
'\n )\n )\n\n this.thead = this.el.querySelector('thead')\n }\n\n destroy() {\n removeElement(this.el)\n }\n\n render(props: DayTableHeaderProps) {\n let { dates, datesRepDistinctDays } = props\n let parts = []\n\n if (props.renderIntroHtml) {\n parts.push(props.renderIntroHtml())\n }\n\n let colHeadFormat = createFormatter(\n this.opt('columnHeaderFormat') ||\n computeFallbackHeaderFormat(datesRepDistinctDays, dates.length)\n )\n\n for (let date of dates) {\n parts.push(\n renderDateCell(\n date,\n props.dateProfile,\n datesRepDistinctDays,\n dates.length,\n colHeadFormat,\n this.context\n )\n )\n }\n\n if (this.isRtl) {\n parts.reverse()\n }\n\n this.thead.innerHTML = '' + parts.join('') + ''\n }\n\n}\n","import DateProfileGenerator from '../DateProfileGenerator'\nimport { DateMarker, addDays, diffDays } from '../datelib/marker'\nimport { DateRange } from '../datelib/date-range'\n\nexport interface DaySeriesSeg {\n firstIndex: number\n lastIndex: number\n isStart: boolean\n isEnd: boolean\n}\n\nexport default class DaySeries {\n\n cnt: number\n dates: DateMarker[] // whole-day dates for each column. left to right\n indices: number[] // for each day from start, the offset\n\n constructor(range: DateRange, dateProfileGenerator: DateProfileGenerator) {\n let date: DateMarker = range.start\n let end: DateMarker = range.end\n let indices: number[] = []\n let dates: DateMarker[] = []\n let dayIndex = -1\n\n while (date < end) { // loop each day from start to end\n if (dateProfileGenerator.isHiddenDay(date)) {\n indices.push(dayIndex + 0.5) // mark that it's between indices\n } else {\n dayIndex++\n indices.push(dayIndex)\n dates.push(date)\n }\n date = addDays(date, 1)\n }\n\n this.dates = dates\n this.indices = indices\n this.cnt = dates.length\n }\n\n sliceRange(range: DateRange): DaySeriesSeg | null {\n let firstIndex = this.getDateDayIndex(range.start) // inclusive first index\n let lastIndex = this.getDateDayIndex(addDays(range.end, -1)) // inclusive last index\n\n let clippedFirstIndex = Math.max(0, firstIndex)\n let clippedLastIndex = Math.min(this.cnt - 1, lastIndex)\n\n // deal with in-between indices\n clippedFirstIndex = Math.ceil(clippedFirstIndex) // in-between starts round to next cell\n clippedLastIndex = Math.floor(clippedLastIndex) // in-between ends round to prev cell\n\n if (clippedFirstIndex <= clippedLastIndex) {\n return {\n firstIndex: clippedFirstIndex,\n lastIndex: clippedLastIndex,\n isStart: firstIndex === clippedFirstIndex,\n isEnd: lastIndex === clippedLastIndex\n }\n } else {\n return null\n }\n }\n\n // Given a date, returns its chronolocial cell-index from the first cell of the grid.\n // If the date lies between cells (because of hiddenDays), returns a floating-point value between offsets.\n // If before the first offset, returns a negative number.\n // If after the last offset, returns an offset past the last cell offset.\n // Only works for *start* dates of cells. Will not work for exclusive end dates for cells.\n private getDateDayIndex(date: DateMarker) {\n let indices = this.indices\n let dayOffset = Math.floor(diffDays(this.dates[0], date))\n\n if (dayOffset < 0) {\n return indices[0] - 1\n } else if (dayOffset >= indices.length) {\n return indices[indices.length - 1] + 1\n } else {\n return indices[dayOffset]\n }\n }\n\n}\n","import DaySeries from './DaySeries'\nimport { DateRange } from '../datelib/date-range'\nimport { DateMarker } from '../datelib/marker'\nimport { Seg } from '../component/DateComponent'\n\nexport interface DayTableSeg extends Seg {\n row: number\n firstCol: number\n lastCol: number\n}\n\nexport interface DayTableCell {\n date: DateMarker\n htmlAttrs?: string\n}\n\nexport default class DayTable {\n\n rowCnt: number\n colCnt: number\n cells: DayTableCell[][]\n headerDates: DateMarker[]\n\n private daySeries: DaySeries\n\n constructor(daySeries: DaySeries, breakOnWeeks: boolean) {\n let { dates } = daySeries\n let daysPerRow\n let firstDay\n let rowCnt\n\n if (breakOnWeeks) {\n // count columns until the day-of-week repeats\n firstDay = dates[0].getUTCDay()\n for (daysPerRow = 1; daysPerRow < dates.length; daysPerRow++) {\n if (dates[daysPerRow].getUTCDay() === firstDay) {\n break\n }\n }\n rowCnt = Math.ceil(dates.length / daysPerRow)\n } else {\n rowCnt = 1\n daysPerRow = dates.length\n }\n\n this.rowCnt = rowCnt\n this.colCnt = daysPerRow\n this.daySeries = daySeries\n this.cells = this.buildCells()\n this.headerDates = this.buildHeaderDates()\n }\n\n private buildCells() {\n let rows = []\n\n for (let row = 0; row < this.rowCnt; row++) {\n let cells = []\n\n for (let col = 0; col < this.colCnt; col++) {\n cells.push(\n this.buildCell(row, col)\n )\n }\n\n rows.push(cells)\n }\n\n return rows\n }\n\n private buildCell(row, col) {\n return {\n date: this.daySeries.dates[row * this.colCnt + col]\n }\n }\n\n private buildHeaderDates() {\n let dates = []\n\n for (let col = 0; col < this.colCnt; col++) {\n dates.push(this.cells[0][col].date)\n }\n\n return dates\n }\n\n sliceRange(range: DateRange): DayTableSeg[] {\n let { colCnt } = this\n let seriesSeg = this.daySeries.sliceRange(range)\n let segs: DayTableSeg[] = []\n\n if (seriesSeg) {\n let { firstIndex, lastIndex } = seriesSeg\n let index = firstIndex\n\n while (index <= lastIndex) {\n let row = Math.floor(index / colCnt)\n let nextIndex = Math.min((row + 1) * colCnt, lastIndex + 1)\n\n segs.push({\n row,\n firstCol: index % colCnt,\n lastCol: (nextIndex - 1) % colCnt,\n isStart: seriesSeg.isStart && index === firstIndex,\n isEnd: seriesSeg.isEnd && (nextIndex - 1) === lastIndex\n })\n\n index = nextIndex\n }\n }\n\n return segs\n }\n\n}\n","import { DateRange } from '../datelib/date-range'\nimport { EventStore, expandRecurring } from '../structs/event-store'\nimport { EventUiHash } from '../component/event-ui'\nimport { sliceEventStore, EventRenderRange } from '../component/event-rendering'\nimport { DateProfile } from '../DateProfileGenerator'\nimport DateComponent, { Seg, EventSegUiInteractionState } from '../component/DateComponent' // TODO: rename EventSegUiInteractionState, move here\nimport { DateSpan, fabricateEventRange } from '../structs/date-span'\nimport { EventInteractionState } from '../interactions/event-interaction-state'\nimport { Duration } from '../datelib/duration'\nimport { memoize } from '../util/memoize'\nimport { DateMarker, addMs } from '../datelib/marker'\n\nexport interface SliceableProps {\n dateSelection: DateSpan\n businessHours: EventStore\n eventStore: EventStore\n eventDrag: EventInteractionState | null\n eventResize: EventInteractionState | null\n eventSelection: string\n eventUiBases: EventUiHash\n}\n\nexport interface SlicedProps {\n dateSelectionSegs: SegType[]\n businessHourSegs: SegType[]\n fgEventSegs: SegType[]\n bgEventSegs: SegType[]\n eventDrag: EventSegUiInteractionState | null\n eventResize: EventSegUiInteractionState | null\n eventSelection: string\n}\n\nexport default abstract class Slicer {\n\n private sliceBusinessHours = memoize(this._sliceBusinessHours)\n private sliceDateSelection = memoize(this._sliceDateSpan)\n private sliceEventStore = memoize(this._sliceEventStore)\n private sliceEventDrag = memoize(this._sliceInteraction)\n private sliceEventResize = memoize(this._sliceInteraction)\n\n abstract sliceRange(dateRange: DateRange, ...extraArgs: ExtraArgs): SegType[]\n\n sliceProps(\n props: SliceableProps,\n dateProfile: DateProfile,\n nextDayThreshold: Duration | null,\n component: DateComponent, // TODO: kill\n ...extraArgs: ExtraArgs\n ): SlicedProps {\n let { eventUiBases } = props\n let eventSegs = this.sliceEventStore(props.eventStore, eventUiBases, dateProfile, nextDayThreshold, component, ...extraArgs)\n\n return {\n dateSelectionSegs: this.sliceDateSelection(props.dateSelection, eventUiBases, component, ...extraArgs),\n businessHourSegs: this.sliceBusinessHours(props.businessHours, dateProfile, nextDayThreshold, component, ...extraArgs),\n fgEventSegs: eventSegs.fg,\n bgEventSegs: eventSegs.bg,\n eventDrag: this.sliceEventDrag(props.eventDrag, eventUiBases, dateProfile, nextDayThreshold, component, ...extraArgs),\n eventResize: this.sliceEventResize(props.eventResize, eventUiBases, dateProfile, nextDayThreshold, component, ...extraArgs),\n eventSelection: props.eventSelection\n } // TODO: give interactionSegs?\n }\n\n sliceNowDate( // does not memoize\n date: DateMarker,\n component: DateComponent, // TODO: kill\n ...extraArgs: ExtraArgs\n ): SegType[] {\n return this._sliceDateSpan(\n { range: { start: date, end: addMs(date, 1) }, allDay: false }, // add 1 ms, protect against null range\n {},\n component,\n ...extraArgs\n )\n }\n\n private _sliceBusinessHours(\n businessHours: EventStore,\n dateProfile: DateProfile,\n nextDayThreshold: Duration | null,\n component: DateComponent, // TODO: kill\n ...extraArgs: ExtraArgs\n ): SegType[] {\n if (!businessHours) {\n return []\n }\n\n return this._sliceEventStore(\n expandRecurring(\n businessHours,\n computeActiveRange(dateProfile, Boolean(nextDayThreshold)),\n component.calendar\n ),\n {},\n dateProfile,\n nextDayThreshold,\n component,\n ...extraArgs\n ).bg\n }\n\n private _sliceEventStore(\n eventStore: EventStore,\n eventUiBases: EventUiHash,\n dateProfile: DateProfile,\n nextDayThreshold: Duration | null,\n component: DateComponent, // TODO: kill\n ...extraArgs: ExtraArgs\n ): { bg: SegType[], fg: SegType[] } {\n if (eventStore) {\n let rangeRes = sliceEventStore(\n eventStore,\n eventUiBases,\n computeActiveRange(dateProfile, Boolean(nextDayThreshold)),\n nextDayThreshold\n )\n\n return {\n bg: this.sliceEventRanges(rangeRes.bg, component, extraArgs),\n fg: this.sliceEventRanges(rangeRes.fg, component, extraArgs)\n }\n\n } else {\n return { bg: [], fg: [] }\n }\n }\n\n private _sliceInteraction(\n interaction: EventInteractionState,\n eventUiBases: EventUiHash,\n dateProfile: DateProfile,\n nextDayThreshold: Duration | null,\n component: DateComponent, // TODO: kill\n ...extraArgs: ExtraArgs\n ): EventSegUiInteractionState {\n if (!interaction) {\n return null\n }\n\n let rangeRes = sliceEventStore(\n interaction.mutatedEvents,\n eventUiBases,\n computeActiveRange(dateProfile, Boolean(nextDayThreshold)),\n nextDayThreshold\n )\n\n return {\n segs: this.sliceEventRanges(rangeRes.fg, component, extraArgs),\n affectedInstances: interaction.affectedEvents.instances,\n isEvent: interaction.isEvent,\n sourceSeg: interaction.origSeg\n }\n }\n\n private _sliceDateSpan(\n dateSpan: DateSpan,\n eventUiBases: EventUiHash,\n component: DateComponent, // TODO: kill\n ...extraArgs: ExtraArgs\n ): SegType[] {\n if (!dateSpan) {\n return []\n }\n\n let eventRange = fabricateEventRange(dateSpan, eventUiBases, component.calendar)\n let segs = this.sliceRange(dateSpan.range, ...extraArgs)\n\n for (let seg of segs) {\n seg.component = component\n seg.eventRange = eventRange\n }\n\n return segs\n }\n\n /*\n \"complete\" seg means it has component and eventRange\n */\n private sliceEventRanges(\n eventRanges: EventRenderRange[],\n component: DateComponent, // TODO: kill\n extraArgs: ExtraArgs\n ): SegType[] {\n let segs: SegType[] = []\n\n for (let eventRange of eventRanges) {\n segs.push(...this.sliceEventRange(eventRange, component, extraArgs))\n }\n\n return segs\n }\n\n /*\n \"complete\" seg means it has component and eventRange\n */\n private sliceEventRange(\n eventRange: EventRenderRange,\n component: DateComponent, // TODO: kill\n extraArgs: ExtraArgs\n ): SegType[] {\n let segs = this.sliceRange(eventRange.range, ...extraArgs)\n\n for (let seg of segs) {\n seg.component = component\n seg.eventRange = eventRange\n seg.isStart = eventRange.isStart && seg.isStart\n seg.isEnd = eventRange.isEnd && seg.isEnd\n }\n\n return segs\n }\n\n}\n\n/*\nfor incorporating minTime/maxTime if appropriate\nTODO: should be part of DateProfile!\nTimelineDateProfile already does this btw\n*/\nfunction computeActiveRange(dateProfile: DateProfile, isComponentAllDay: boolean): DateRange {\n let range = dateProfile.activeRange\n\n if (isComponentAllDay) {\n return range\n }\n\n return {\n start: addMs(range.start, dateProfile.minTime.milliseconds),\n end: addMs(range.end, dateProfile.maxTime.milliseconds - 864e5) // 864e5 = ms in a day\n }\n}\n","\n// exports\n// --------------------------------------------------------------------------------------------------\n\nexport const version = '<%= version %>'\n\n// types\nexport { OptionsInput } from './types/input-types'\nexport {\n EventInput, EventDef, EventDefHash, EventInstance, EventInstanceHash,\n parseEventDef, createEventInstance, EventTuple\n} from './structs/event'\nexport { BusinessHoursInput, parseBusinessHours } from './structs/business-hours'\n\nexport {\n applyAll,\n debounce,\n padStart,\n isInt,\n capitaliseFirstLetter,\n parseFieldSpecs,\n compareByFieldSpecs,\n compareByFieldSpec,\n flexibleCompare,\n computeVisibleDayRange,\n refineProps,\n matchCellWidths, uncompensateScroll, compensateScroll, subtractInnerElHeight,\n isMultiDayRange,\n distributeHeight,\n undistributeHeight,\n preventSelection, allowSelection, preventContextMenu, allowContextMenu,\n compareNumbers, enableCursor, disableCursor,\n diffDates\n} from './util/misc'\n\nexport {\n htmlEscape,\n cssToStr\n} from './util/html'\n\nexport {\n removeExact,\n isArraysEqual\n} from './util/array'\n\nexport { memoize, memoizeOutput } from './util/memoize'\nexport { memoizeRendering, MemoizedRendering } from './component/memoized-rendering'\n\nexport {\n intersectRects,\n Rect, pointInsideRect,\n constrainPoint,\n getRectCenter, diffPoints, Point,\n translateRect\n} from './util/geom'\n\nexport { mapHash, filterHash, isPropsEqual } from './util/object'\n\nexport {\n findElements,\n findChildren,\n htmlToElement,\n createElement,\n insertAfterElement,\n prependToElement,\n removeElement,\n appendToElement,\n applyStyle,\n applyStyleProp,\n elementMatches,\n elementClosest,\n forceClassName\n} from './util/dom-manip'\n\nexport { EventStore, filterEventStoreDefs, createEmptyEventStore, mergeEventStores, getRelevantEvents, eventTupleToStore } from './structs/event-store'\nexport { EventUiHash, EventUi, processScopedUiProps, combineEventUis } from './component/event-ui'\nexport { default as Splitter, SplittableProps } from './component/event-splitting'\nexport { buildGotoAnchorHtml, getAllDayHtml, getDayClasses } from './component/date-rendering'\n\nexport {\n preventDefault,\n listenBySelector,\n whenTransitionDone\n} from './util/dom-event'\n\nexport {\n computeInnerRect,\n computeEdges,\n computeHeightAndMargins,\n getClippingParents,\n computeClippingRect,\n computeRect\n} from './util/dom-geom'\n\nexport { unpromisify } from './util/promise'\n\nexport { default as EmitterMixin, EmitterInterface } from './common/EmitterMixin'\nexport { DateRange, rangeContainsMarker, intersectRanges, rangesEqual, rangesIntersect, rangeContainsRange } from './datelib/date-range'\nexport { default as Mixin } from './common/Mixin'\nexport { default as PositionCache } from './common/PositionCache'\nexport { default as ScrollComponent, ScrollbarWidths } from './common/ScrollComponent'\nexport { ScrollController, ElementScrollController, WindowScrollController } from './common/scroll-controller'\nexport { default as Theme } from './theme/Theme'\nexport { default as Component, ComponentContext } from './component/Component'\nexport { default as DateComponent, Seg, EventSegUiInteractionState } from './component/DateComponent'\nexport { default as Calendar, DatePointTransform, DateSpanTransform, DateSelectionApi } from './Calendar'\nexport { default as View, ViewProps } from './View'\nexport { default as FgEventRenderer, buildSegCompareObj } from './component/renderers/FgEventRenderer'\nexport { default as FillRenderer } from './component/renderers/FillRenderer'\n\nexport { default as DateProfileGenerator, DateProfile } from './DateProfileGenerator'\nexport { ViewDef } from './structs/view-def'\nexport { ViewSpec } from './structs/view-spec'\nexport { DateSpan, DateSpanApi, DatePointApi, isDateSpansEqual } from './structs/date-span'\n\nexport { DateMarker, addDays, startOfDay, addMs, addWeeks, diffWeeks, diffWholeWeeks, diffWholeDays, diffDayAndTime, diffDays, isValidDate } from './datelib/marker'\nexport {\n Duration, createDuration,\n isSingleDay, multiplyDuration, addDurations,\n asRoughMinutes, asRoughSeconds, asRoughMs,\n wholeDivideDurations, greatestDurationDenominator\n} from './datelib/duration'\nexport { DateEnv, DateMarkerMeta } from './datelib/env'\n\nexport {\n DateFormatter,\n createFormatter,\n VerboseFormattingArg,\n formatIsoTimeString\n} from './datelib/formatting'\nexport { NamedTimeZoneImpl } from './datelib/timezone'\nexport { parse as parseMarker } from './datelib/parsing'\n\nexport { EventSourceDef, EventSource, EventSourceHash } from './structs/event-source'\n\nexport { Interaction, InteractionSettings, interactionSettingsToStore, interactionSettingsStore, InteractionSettingsStore } from './interactions/interaction'\nexport { PointerDragEvent } from './interactions/pointer'\nexport { Hit } from './interactions/hit'\nexport { dateSelectionJoinTransformer } from './interactions/date-selecting'\nexport { eventDragMutationMassager } from './interactions/event-dragging'\nexport { EventResizeJoinTransforms } from './interactions/event-resizing'\nexport { default as ElementDragging } from './interactions/ElementDragging'\n\nexport { formatDate, formatRange } from './formatting-api'\n\nexport { globalDefaults, config } from './options'\n\nexport { RecurringType, ParsedRecurring } from './structs/recurring-event'\n\nexport { DragMetaInput, DragMeta, parseDragMeta } from './structs/drag-meta'\n\nexport { createPlugin, PluginDef, PluginDefInput, ViewPropsTransformer, ViewContainerModifier } from './plugin-system'\nexport { reducerFunc, Action, CalendarState } from './reducers/types'\nexport { CalendarComponentProps } from './CalendarComponent'\n\nexport { default as DayHeader } from './common/DayHeader'\nexport { computeFallbackHeaderFormat, renderDateCell } from './common/table-utils'\n\nexport { default as DaySeries } from './common/DaySeries'\n\nexport { EventInteractionState } from './interactions/event-interaction-state'\nexport { EventRenderRange, sliceEventStore, hasBgRendering, getElSeg } from './component/event-rendering'\n\nexport { default as DayTable, DayTableSeg, DayTableCell } from './common/DayTable'\n\nexport { default as Slicer, SlicedProps } from './common/slicing-utils'\n\nexport { EventMutation, applyMutationToEventStore } from './structs/event-mutation'\nexport { Constraint, ConstraintInput, AllowFunc, isPropsValid, isInteractionValid } from './validation'\nexport { default as EventApi } from './api/EventApi'\n\nexport { default as requestJson } from './util/requestJson'\n"],"names":["tslib_1.__assign","tslib_1.__extends","uid","eventSourceDef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