UNPKG

751 kBSource Map (JSON)View Raw
1{"version":3,"file":"main.js","sources":["src/api/EventSourceApi.ts","src/util/dom-manip.ts","src/util/dom-event.ts","src/util/misc.ts","src/datelib/marker.ts","src/structs/event-instance.ts","src/util/object.ts","src/structs/recurring-event.ts","src/datelib/duration.ts","src/datelib/formatting-utils.ts","src/util/array.ts","src/util/memoize.ts","src/datelib/formatting-native.ts","src/datelib/zoned-marker.ts","src/datelib/DateFormatter.ts","src/datelib/formatting-cmd.ts","src/datelib/formatting-func.ts","src/datelib/formatting.ts","src/options.ts","src/structs/event-store.ts","src/structs/constraint.ts","src/util/html.ts","src/component/event-ui.ts","src/structs/event-parse.ts","src/util/date.ts","src/datelib/date-range.ts","src/component/event-rendering.ts","src/structs/date-span.ts","src/calendar-utils.ts","src/structs/event-mutation.ts","src/ViewApi.ts","src/structs/event-source-parse.ts","src/reducers/current-date.ts","src/CalendarApi.tsx","src/api/EventApi.ts","src/datelib/calendar-system.ts","src/datelib/parsing.ts","src/datelib/env.ts","src/global-locales.ts","src/datelib/locale.ts","src/formatting-api.ts","src/structs/business-hours.ts","src/util/geom.ts","src/util/table-styling.tsx","src/component/event-splitting.ts","src/component/date-rendering.tsx","src/common/nav-link.ts","src/util/scrollbar-side.ts","src/util/scrollbar-width.ts","src/util/dom-geom.ts","src/util/promise.ts","src/common/Emitter.ts","src/common/PositionCache.ts","src/common/scroll-controller.ts","src/theme/Theme.ts","src/ScrollResponder.ts","src/ViewContext.ts","src/vdom-util.tsx","src/component/DateComponent.ts","src/plugin-system.ts","src/theme/StandardTheme.ts","src/structs/view-def.ts","src/common/render-hook.tsx","src/common/ViewRoot.tsx","src/structs/view-config.tsx","src/structs/view-spec.ts","src/DateProfileGenerator.ts","src/reducers/view-type.ts","src/reducers/options.ts","src/reducers/date-profile.ts","src/reducers/eventSources.ts","src/reducers/eventStore.ts","src/reducers/date-selection.ts","src/reducers/selected-event.ts","src/reducers/event-drag.ts","src/reducers/event-resize.ts","src/toolbar-parse.ts","src/event-sources/array-event-source.ts","src/event-sources/func-event-source.ts","src/util/requestJson.ts","src/event-sources/json-feed-event-source-refiners.ts","src/event-sources/json-feed-event-source.ts","src/structs/recurring-event-simple-refiners.ts","src/structs/recurring-event-simple.ts","src/option-change-handlers.ts","src/dates-set.ts","src/event-crud.ts","src/global-plugins.ts","src/util/DelayedRunner.ts","src/util/TaskRunner.ts","src/reducers/title-formatting.ts","src/reducers/CalendarDataManager.ts","src/component/CalendarDataProvider.ts","src/View.ts","src/datelib/timezone.ts","src/seg-hierarchy.ts","src/interactions/interaction.ts","src/interactions/ElementDragging.ts","src/global-config.ts","src/structs/drag-meta.ts","src/ToolbarSection.tsx","src/Toolbar.tsx","src/ViewContainer.tsx","src/interactions/EventClicking.ts","src/interactions/EventHovering.ts","src/CalendarContent.tsx","src/CalendarRoot.tsx","src/common/table-utils.ts","src/common/table-cell-util.tsx","src/common/TableDateCell.tsx","src/common/TableDowCell.tsx","src/NowTimer.ts","src/common/DayHeader.tsx","src/common/DaySeriesModel.ts","src/common/DayTableModel.ts","src/common/slicing-utils.ts","src/validation.ts","src/scrollgrid/Scroller.tsx","src/util/RefMap.ts","src/scrollgrid/util.tsx","src/scrollgrid/SimpleScrollGrid.tsx","src/common/EventRoot.tsx","src/common/StandardEvent.tsx","src/common/NowIndicatorRoot.tsx","src/common/DayCellContent.tsx","src/common/DayCellRoot.tsx","src/common/bg-fill.tsx","src/common/WeekNumberRoot.tsx","src/common/Popover.tsx","src/common/MorePopover.tsx","src/common/MoreLinkRoot.tsx","src/main.ts"],"sourcesContent":["import { EventSource } from '../structs/event-source'\nimport { CalendarContext } from '../CalendarContext'\n\n// no public types yet. when there are, export from:\n// import {} from './api-type-deps'\n\nexport class EventSourceApi {\n constructor(\n private context: CalendarContext,\n public internalEventSource: EventSource<any>, // rename?\n ) {\n }\n\n remove() {\n this.context.dispatch({\n type: 'REMOVE_EVENT_SOURCE',\n sourceId: this.internalEventSource.sourceId,\n })\n }\n\n refetch() {\n this.context.dispatch({\n type: 'FETCH_EVENT_SOURCES',\n sourceIds: [this.internalEventSource.sourceId],\n isRefetch: true,\n })\n }\n\n get id(): string {\n return this.internalEventSource.publicId\n }\n\n get url(): string {\n return this.internalEventSource.meta.url\n }\n\n get format(): string {\n return this.internalEventSource.meta.format // TODO: bad. not guaranteed\n }\n}\n","import { Dictionary } from '../options'\n\nexport function removeElement(el: HTMLElement) { // removes nodes in addition to elements. bad name\n if (el.parentNode) {\n el.parentNode.removeChild(el)\n }\n}\n\n// Querying\n// ----------------------------------------------------------------------------------------------------------------\n\nexport function elementClosest(el: HTMLElement, selector: string): HTMLElement {\n if (el.closest) {\n return el.closest(selector)\n\n // really bad fallback for IE\n // from https://developer.mozilla.org/en-US/docs/Web/API/Element/closest\n }\n if (!document.documentElement.contains(el)) {\n return null\n }\n do {\n if (elementMatches(el, selector)) {\n return el\n }\n el = (el.parentElement || el.parentNode) as HTMLElement\n } while (el !== null && el.nodeType === 1)\n return null\n}\n\nexport function elementMatches(el: HTMLElement, selector: string): HTMLElement {\n let method = el.matches || (el as any).matchesSelector || (el as any).msMatchesSelector\n\n return method.call(el, selector)\n}\n\n// accepts multiple subject els\n// returns a real array. good for methods like forEach\n// TODO: accept the document\nexport function findElements(container: HTMLElement[] | HTMLElement | NodeListOf<HTMLElement>, 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 += 1) {\n let matches = containers[i].querySelectorAll(selector)\n\n for (let j = 0; j < matches.length; j += 1) {\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 // TODO: rename to findDirectChildren!\nexport function findDirectChildren(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 += 1) {\n let childNodes = parents[i].children // only ever elements\n\n for (let j = 0; j < childNodes.length; j += 1) {\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// Style\n// ----------------------------------------------------------------------------------------------------------------\n\nconst PIXEL_PROP_RE = /(top|left|right|bottom|width|height)$/i\n\nexport function applyStyle(el: HTMLElement, props: Dictionary) {\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\n// Event Handling\n// ----------------------------------------------------------------------------------------------------------------\n\n// if intercepting bubbled events at the document/window/body level,\n// and want to see originating element (the 'target'), use this util instead\n// of `ev.target` because it goes within web-component boundaries.\nexport function getEventTargetViaRoot(ev: Event) {\n return ev.composedPath?.()[0] ?? ev.target\n}\n\n// Shadow DOM consuderations\n// ----------------------------------------------------------------------------------------------------------------\n\nexport function getElRoot(el: HTMLElement): ShadowRoot | Document {\n return el.getRootNode ? el.getRootNode() as ShadowRoot : document\n}\n","import { elementClosest } from './dom-manip'\nimport { VUIEvent } from '../vdom'\n\n// Stops a mouse/touch event from doing it's native browser action\nexport function preventDefault(ev) {\n ev.preventDefault()\n}\n\n// Event Delegation\n// ----------------------------------------------------------------------------------------------------------------\n\nexport function buildDelegationHandler<EventType extends (Event | VUIEvent)>(\n selector: string,\n handler: (ev: EventType, matchedTarget: HTMLElement) => void,\n) {\n return (ev: EventType) => {\n let matchedChild = elementClosest(ev.target as HTMLElement, selector)\n\n if (matchedChild) {\n handler.call(matchedChild, ev, matchedChild)\n }\n }\n}\n\nexport function listenBySelector(\n container: HTMLElement,\n eventType: string,\n selector: string,\n handler: (ev: Event, matchedTarget: HTMLElement) => void,\n) {\n let attachedHandler = buildDelegationHandler(selector, handler)\n\n container.addEventListener(eventType, attachedHandler)\n\n return () => {\n container.removeEventListener(eventType, attachedHandler)\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, (mouseOverEv, matchedChild) => {\n if (matchedChild !== currentMatchedChild) {\n currentMatchedChild = matchedChild\n onMouseEnter(mouseOverEv, matchedChild)\n\n let realOnMouseLeave = (mouseLeaveEv) => {\n currentMatchedChild = null\n onMouseLeave(mouseLeaveEv, 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// 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 = (ev) => {\n callback(ev)\n transitionEventNames.forEach((eventName) => {\n el.removeEventListener(eventName, realCallback)\n })\n }\n\n transitionEventNames.forEach((eventName) => {\n el.addEventListener(eventName, realCallback) // cross-browser way to determine when the transition finishes\n })\n}\n","import { preventDefault } from './dom-event'\n\nexport type GenericHash = { [key: string]: any } // already did this somewhere\n\nlet guidNumber = 0\n\nexport function guid() {\n guidNumber += 1\n return String(guidNumber)\n}\n\n/* FullCalendar-specific DOM Utilities\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// Returns the mouse cursor to its original look\nexport function enableCursor() {\n document.body.classList.remove('fc-not-allowed')\n}\n\n/* Selection\n----------------------------------------------------------------------------------------------------------------------*/\n\nexport function preventSelection(el: HTMLElement) {\n el.classList.add('fc-unselectable')\n el.addEventListener('selectstart', preventDefault)\n}\n\nexport function allowSelection(el: HTMLElement) {\n el.classList.remove('fc-unselectable')\n el.removeEventListener('selectstart', preventDefault)\n}\n\n/* Context Menu\n----------------------------------------------------------------------------------------------------------------------*/\n\nexport function preventContextMenu(el: HTMLElement) {\n el.addEventListener('contextmenu', preventDefault)\n}\n\nexport function allowContextMenu(el: HTMLElement) {\n el.removeEventListener('contextmenu', preventDefault)\n}\n\n/* Object Ordering by Field\n----------------------------------------------------------------------------------------------------------------------*/\n\nexport interface OrderSpec<Subject> {\n field?: string\n order?: number\n func?: FieldSpecInputFunc<Subject>\n}\n\nexport type FieldSpecInput<Subject> = string | string[] | FieldSpecInputFunc<Subject> | FieldSpecInputFunc<Subject>[]\nexport type FieldSpecInputFunc<Subject> = (a: Subject, b: Subject) => number\n\nexport function parseFieldSpecs<Subject>(input: FieldSpecInput<Subject>): OrderSpec<Subject>[] {\n let specs: OrderSpec<Subject>[] = []\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 += 1) {\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\nexport function compareByFieldSpecs<Subject>(obj0: Subject, obj1: Subject, fieldSpecs: OrderSpec<Subject>[]): number {\n let i\n let cmp\n\n for (i = 0; i < fieldSpecs.length; i += 1) {\n cmp = compareByFieldSpec(obj0, obj1, fieldSpecs[i])\n if (cmp) {\n return cmp\n }\n }\n\n return 0\n}\n\nexport function compareByFieldSpec<Subject>(obj0: Subject, obj1: Subject, fieldSpec: OrderSpec<Subject>): number {\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\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/* String Utilities\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/* Number Utilities\n----------------------------------------------------------------------------------------------------------------------*/\n\nexport function compareNumbers(a, b) { // for .sort()\n return a - b\n}\n\nexport function isInt(n) {\n return n % 1 === 0\n}\n\n/* Weird Utilities\n----------------------------------------------------------------------------------------------------------------------*/\n\nexport function firstDefined(...args) {\n for (let i = 0; i < args.length; i += 1) {\n if (args[i] !== undefined) {\n return args[i]\n }\n }\n return undefined\n}\n\n/* FC-specific DOM dimension stuff\n----------------------------------------------------------------------------------------------------------------------*/\n\nexport function computeSmallestCellWidth(cellEl: HTMLElement) {\n let allWidthEl = cellEl.querySelector('.fc-scrollgrid-shrink-frame')\n let contentWidthEl = cellEl.querySelector('.fc-scrollgrid-shrink-cushion')\n\n if (!allWidthEl) {\n throw new Error('needs fc-scrollgrid-shrink-frame className') // TODO: use const\n }\n if (!contentWidthEl) {\n throw new Error('needs fc-scrollgrid-shrink-cushion className')\n }\n\n return cellEl.getBoundingClientRect().width - allWidthEl.getBoundingClientRect().width + // the cell padding+border\n contentWidthEl.getBoundingClientRect().width\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// 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// Diffing (all return floats)\n// TODO: why not use ranges?\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// 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// 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// 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 // 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// 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 // 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(...(a as [any, any])))\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 { DateRange } from '../datelib/date-range'\nimport { guid } from '../util/misc'\n\nexport interface EventInstance {\n instanceId: string\n defId: string\n range: DateRange\n forcedStartTzo: number | null\n forcedEndTzo: number | null\n}\n\nexport type EventInstanceHash = { [instanceId: string]: EventInstance }\n\nexport function createEventInstance(\n defId: string,\n range: DateRange,\n forcedStartTzo?: number,\n forcedEndTzo?: number,\n): EventInstance {\n return {\n instanceId: guid(),\n defId,\n range,\n forcedStartTzo: forcedStartTzo == null ? null : forcedStartTzo,\n forcedEndTzo: forcedEndTzo == null ? null : forcedEndTzo,\n }\n}\n","const { hasOwnProperty } = Object.prototype\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, complexPropsMap?): any {\n let dest = {}\n\n if (complexPropsMap) {\n for (let name in complexPropsMap) {\n let complexObjs = []\n\n // collect the trailing object values, stopping when a non-object is discovered\n for (let i = propObjs.length - 1; i >= 0; i -= 1) {\n let val = propObjs[i][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 (let i = propObjs.length - 1; i >= 0; i -= 1) {\n let props = propObjs[i]\n\n for (let 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\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\nexport function mapHash<InputItem, OutputItem>(\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\nexport function arrayToHash(a): { [key: string]: true } { // TODO: rename to strinArrayToHash or something\n let hash = {}\n\n for (let item of a) {\n hash[item] = true\n }\n\n return hash\n}\n\nexport function buildHashFromArray<Item, ItemRes>(a: Item[], func: (item: Item, index: number) => [ string, ItemRes ]) {\n let hash: { [key: string]: ItemRes } = {}\n\n for (let i = 0; i < a.length; i += 1) {\n let tuple = func(a[i], i)\n\n hash[tuple[0]] = tuple[1]\n }\n\n return hash\n}\n\nexport function hashValuesToArray(obj) { // can't use Object.values yet because of no IE support\n let a = []\n\n for (let key in obj) {\n a.push(obj[key])\n }\n\n return a\n}\n\nexport function isPropsEqual(obj0, obj1) { // TODO: merge with compareObjs\n if (obj0 === obj1) {\n return true\n }\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\nexport function getUnequalProps(obj0, obj1) {\n let keys: string[] = []\n\n for (let key in obj0) {\n if (hasOwnProperty.call(obj0, key)) {\n if (!(key in obj1)) {\n keys.push(key)\n }\n }\n }\n\n for (let key in obj1) {\n if (hasOwnProperty.call(obj1, key)) {\n if (obj0[key] !== obj1[key]) {\n keys.push(key)\n }\n }\n }\n\n return keys\n}\n\nexport type EqualityFunc<T> = (a: T, b: T) => boolean\nexport type EqualityThing<T> = EqualityFunc<T> | true\n\nexport type EqualityFuncs<ObjType> = { // not really just a \"func\" anymore\n [K in keyof ObjType]?: EqualityThing<ObjType[K]>\n}\n\nexport function compareObjs(oldProps, newProps, equalityFuncs: EqualityFuncs<any> = {}) {\n if (oldProps === newProps) {\n return true\n }\n\n for (let key in newProps) {\n if (key in oldProps && isObjValsEqual(oldProps[key], newProps[key], equalityFuncs[key])) {\n // equal\n } else {\n return false\n }\n }\n\n // check for props that were omitted in the new\n for (let key in oldProps) {\n if (!(key in newProps)) {\n return false\n }\n }\n\n return true\n}\n\n/*\nassumed \"true\" equality for handler names like \"onReceiveSomething\"\n*/\nfunction isObjValsEqual<T>(val0: T, val1: T, comparator: EqualityThing<T>) {\n if (val0 === val1 || comparator === true) {\n return true\n }\n if (comparator) {\n return comparator(val0, val1)\n }\n return false\n}\n\nexport function collectFromHash<Item>(\n hash: { [key: string]: Item },\n startIndex = 0,\n endIndex?: number,\n step = 1,\n) {\n let res: Item[] = []\n\n if (endIndex == null) {\n endIndex = Object.keys(hash).length\n }\n\n for (let i = startIndex; i < endIndex; i += step) {\n let val = hash[i]\n\n if (val !== undefined) { // will disregard undefined for sparse arrays\n res.push(val)\n }\n }\n\n return res\n}\n","import { EventDef } from './event-def'\nimport { EventInstance, createEventInstance } from './event-instance'\nimport { DateRange } from '../datelib/date-range'\nimport { DateEnv } from '../datelib/env'\nimport { Duration } from '../datelib/duration'\nimport { DateMarker, startOfDay } from '../datelib/marker'\nimport { EventStore } from './event-store'\nimport { CalendarContext } from '../CalendarContext'\nimport { filterHash } from '../util/object'\nimport { EventRefined } from './event-parse'\n\n/*\nThe plugin system for defining how a recurring event is expanded into individual instances.\n*/\n\nexport interface ParsedRecurring<RecurringData> {\n typeData: RecurringData\n allDayGuess: boolean | null\n duration: Duration | null // signals hasEnd\n}\n\nexport interface RecurringType<RecurringData> {\n parse: (refined: EventRefined, dateEnv: DateEnv) => ParsedRecurring<RecurringData> | null // TODO: rename to post-process or something\n expand: (typeData: any, framingRange: DateRange, dateEnv: DateEnv) => DateMarker[]\n}\n\nexport function parseRecurring(\n refined: EventRefined,\n defaultAllDay: boolean | null,\n dateEnv: DateEnv,\n recurringTypes: RecurringType<any>[],\n) {\n for (let i = 0; i < recurringTypes.length; i += 1) {\n let parsed = recurringTypes[i].parse(refined, dateEnv)\n\n if (parsed) {\n let { allDay } = refined\n if (allDay == null) {\n allDay = defaultAllDay\n if (allDay == null) {\n allDay = parsed.allDayGuess\n if (allDay == null) {\n allDay = false\n }\n }\n }\n\n return {\n allDay,\n duration: parsed.duration,\n typeData: parsed.typeData,\n typeId: i,\n }\n }\n }\n\n return null\n}\n\nexport function expandRecurring(eventStore: EventStore, framingRange: DateRange, context: CalendarContext): EventStore {\n let { dateEnv, pluginHooks, options } = context\n let { defs, instances } = eventStore\n\n // remove existing recurring instances\n // TODO: bad. always expand events as a second step\n instances = filterHash(instances, (instance: EventInstance) => !defs[instance.defId].recurringDef)\n\n for (let defId in defs) {\n let def = defs[defId]\n\n if (def.recurringDef) {\n let { duration } = def.recurringDef\n\n if (!duration) {\n duration = def.allDay ?\n options.defaultAllDayEventDuration :\n options.defaultTimedEventDuration\n }\n\n let starts = expandRecurringRanges(def, duration, framingRange, dateEnv, pluginHooks.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/*\nEvent MUST have a recurringDef\n*/\nfunction expandRecurringRanges(\n eventDef: EventDef,\n duration: Duration,\n framingRange: DateRange,\n dateEnv: DateEnv,\n recurringTypes: RecurringType<any>[],\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","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 specifiedWeeks?: boolean\n}\n\nconst INTERNAL_UNITS = ['years', 'months', 'days', 'milliseconds']\nconst PARSE_RE = /^(-?)(?:(\\d+)\\.)?(\\d+):(\\d\\d)(?::(\\d\\d)(?:\\.(\\d\\d\\d))?)?/\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 }\n\n if (typeof input === 'object' && input) { // non-null object\n return parseObject(input)\n }\n\n if (typeof input === 'number') {\n return parseObject({ [unit || 'milliseconds']: input })\n }\n return null\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 parseObject(obj: DurationObjectInput): Duration {\n let duration: Duration = {\n years: obj.years || obj.year || 0,\n months: obj.months || obj.month || 0,\n days: obj.days || obj.day || 0,\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 let weeks = obj.weeks || obj.week\n if (weeks) {\n duration.days += weeks * 7\n duration.specifiedWeeks = true\n }\n\n return duration\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 asCleanDays(dur: Duration) {\n if (!dur.years && !dur.months && !dur.milliseconds) {\n return dur.days\n }\n return 0\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// 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// 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 += 1) {\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 } 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) {\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 (dur.specifiedWeeks && 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 { DateMarker } from './marker'\nimport { padStart } from '../util/misc'\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\n// formats the date, but with no time part\n// TODO: somehow merge with buildIsoString and stripZeroTime\n// TODO: rename. omit \"string\"\nexport function formatDayString(marker: DateMarker) {\n return marker.toISOString().replace(/T.*$/, '')\n}\n\n// TODO: use Date::toISOString and use everything after the T?\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 }\n return `GMT${sign}${hours}${mins ? `:${padStart(mins, 2)}` : ''}`\n}\n","// TODO: new util arrayify?\n// Array.prototype.slice.call(\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 += 1\n } else {\n i += 1\n }\n }\n\n return removeCnt\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 += 1\n } else {\n i += 1\n }\n }\n\n return removeCnt\n}\n\nexport function isArraysEqual(a0, a1, equalityFunc?: (v0, v1) => boolean) { // TODO: better typing\n if (a0 === a1) {\n return true\n }\n\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 += 1) {\n if (!(equalityFunc ? equalityFunc(a0[i], a1[i]) : a0[i] === a1[i])) {\n return false\n }\n }\n\n return true\n}\n","import { isArraysEqual } from './array'\nimport { isPropsEqual } from './object'\nimport { Dictionary } from '../options'\n\nexport function memoize<Args extends any[], Res>(\n workerFunc: (...args: Args) => Res,\n resEquality?: (res0: Res, res1: Res) => boolean,\n teardownFunc?: (res: Res) => void,\n): (...args: Args) => Res {\n let currentArgs: Args | undefined\n let currentRes: Res | undefined\n\n return function (...newArgs: Args) { // eslint-disable-line func-names\n if (!currentArgs) {\n currentRes = workerFunc.apply(this, newArgs)\n } else if (!isArraysEqual(currentArgs, newArgs)) {\n if (teardownFunc) {\n teardownFunc(currentRes)\n }\n\n let res = workerFunc.apply(this, newArgs)\n\n if (!resEquality || !resEquality(res, currentRes)) {\n currentRes = res\n }\n }\n\n currentArgs = newArgs\n\n return currentRes\n }\n}\n\nexport function memoizeObjArg<Arg extends Dictionary, Res>(\n workerFunc: (arg: Arg) => Res,\n resEquality?: (res0: Res, res1: Res) => boolean,\n teardownFunc?: (res: Res) => void,\n): (arg: Arg) => Res {\n let currentArg: Arg | undefined\n let currentRes: Res | undefined\n\n return (newArg: Arg) => {\n if (!currentArg) {\n currentRes = workerFunc.call(this, newArg)\n } else if (!isPropsEqual(currentArg, newArg)) {\n if (teardownFunc) {\n teardownFunc(currentRes)\n }\n\n let res = workerFunc.call(this, newArg)\n\n if (!resEquality || !resEquality(res, currentRes)) {\n currentRes = res\n }\n }\n\n currentArg = newArg\n\n return currentRes\n }\n}\n\nexport function memoizeArraylike<Args extends any[], Res>( // used at all?\n workerFunc: (...args: Args) => Res,\n resEquality?: (res0: Res, res1: Res) => boolean,\n teardownFunc?: (res: Res) => void,\n): (argSets: Args[]) => Res[] {\n let currentArgSets: Args[] = []\n let currentResults: Res[] = []\n\n return (newArgSets: Args[]) => {\n let currentLen = currentArgSets.length\n let newLen = newArgSets.length\n let i = 0\n\n for (; i < currentLen; i += 1) {\n if (!newArgSets[i]) { // one of the old sets no longer exists\n if (teardownFunc) {\n teardownFunc(currentResults[i])\n }\n } else if (!isArraysEqual(currentArgSets[i], newArgSets[i])) {\n if (teardownFunc) {\n teardownFunc(currentResults[i])\n }\n\n let res = workerFunc.apply(this, newArgSets[i])\n\n if (!resEquality || !resEquality(res, currentResults[i])) {\n currentResults[i] = res\n }\n }\n }\n\n for (; i < newLen; i += 1) {\n currentResults[i] = workerFunc.apply(this, newArgSets[i])\n }\n\n currentArgSets = newArgSets\n currentResults.splice(newLen) // remove excess\n\n return currentResults\n }\n}\n\nexport function memoizeHashlike<Args extends any[], Res>( // used?\n workerFunc: (...args: Args) => Res,\n resEquality?: (res0: Res, res1: Res) => boolean,\n teardownFunc?: (res: Res) => void, // TODO: change arg order\n): (argHash: { [key: string]: Args }) => { [key: string]: Res } {\n let currentArgHash: { [key: string]: Args } = {}\n let currentResHash: { [key: string]: Res } = {}\n\n return (newArgHash: { [key: string]: Args }) => {\n let newResHash: { [key: string]: Res } = {}\n\n for (let key in newArgHash) {\n if (!currentResHash[key]) {\n newResHash[key] = workerFunc.apply(this, newArgHash[key])\n } else if (!isArraysEqual(currentArgHash[key], newArgHash[key])) {\n if (teardownFunc) {\n teardownFunc(currentResHash[key])\n }\n\n let res = workerFunc.apply(this, newArgHash[key])\n\n newResHash[key] = (resEquality && resEquality(res, currentResHash[key]))\n ? currentResHash[key]\n : res\n } else {\n newResHash[key] = currentResHash[key]\n }\n }\n\n currentArgHash = newArgHash\n currentResHash = newResHash\n\n return newResHash\n }\n}\n","import { DateMarker, timeAsMs } from './marker'\nimport { CalendarSystem } from './calendar-system'\nimport { Locale } from './locale'\nimport { DateFormatter, DateFormattingContext } from './DateFormatter'\nimport { ZonedMarker } from './zoned-marker'\nimport { formatTimeZoneOffset } from './formatting-utils'\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 interface NativeFormatterOptions extends Intl.DateTimeFormatOptions {\n week?: 'short' | 'narrow' | 'numeric'\n meridiem?: 'lowercase' | 'short' | 'narrow' | boolean\n omitZeroMinute?: boolean\n omitCommas?: boolean\n separator?: string\n}\n\nexport class NativeFormatter implements DateFormatter {\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: NativeFormatterOptions) {\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) { // TODO: what about hour12? no severity\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, betterDefaultSeparator?: string) {\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 || betterDefaultSeparator || context.defaultSeparator || ''\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 case 2:\n return 'day'\n default:\n return 'time' // really?\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 (date: ZonedMarker) => (\n formatTimeZoneOffset(date.timeZoneOffset)\n )\n }\n\n if (standardDatePropCnt === 0 && extendedSettings.week) {\n return (date: ZonedMarker) => (\n formatWeekNumber(\n context.computeWeekNumber(date.marker),\n context.weekText,\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 (date: ZonedMarker) => {\n let { marker } = date\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 // 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 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, (m0, m1) => m1.toLocaleLowerCase())\n } else if (extendedSettings.meridiem === 'short') { // am/pm\n s = s.replace(MERIDIEM_RE, (m0, m1) => `${m1.toLocaleLowerCase()}m`)\n } else if (extendedSettings.meridiem === 'lowercase') { // other meridiem transformers already converted to lowercase\n s = s.replace(MERIDIEM_RE, (m0) => m0.toLocaleLowerCase())\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, () => {\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, weekText: string, locale: Locale, display?: 'numeric' | 'narrow' | 'short'): string {\n let parts = []\n\n if (display === 'narrow') {\n parts.push(weekText)\n } else if (display === 'short') {\n parts.push(weekText, ' ')\n }\n // otherwise, considered 'numeric'\n\n parts.push(locale.simpleNumberFormat.format(num))\n\n if (locale.options.direction === 'rtl') { // TODO: use control characters instead?\n parts.reverse()\n }\n\n return parts.join('')\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 let i0 = 0\n while (i0 < full0.length) {\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 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 { DateMarker } from './marker'\nimport { CalendarSystem } from './calendar-system'\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 function 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 { DateMarker } from './marker'\nimport { CalendarSystem } from './calendar-system'\nimport { Locale } from './locale'\nimport { ZonedMarker, ExpandedZonedMarker, expandZonedMarker } from './zoned-marker'\n\nexport interface VerboseFormattingArg { // TODO: kill this\n date: ExpandedZonedMarker\n start: ExpandedZonedMarker\n end?: ExpandedZonedMarker\n timeZone: string\n localeCodes: string[],\n defaultSeparator: string\n}\n\nexport function createVerboseFormattingArg(\n start: ZonedMarker,\n end: ZonedMarker,\n context: DateFormattingContext,\n betterDefaultSeparator?: string,\n): 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 defaultSeparator: betterDefaultSeparator || context.defaultSeparator,\n }\n}\n\nexport type CmdFormatterFunc = (cmd: string, arg: VerboseFormattingArg) => string\n\nexport interface DateFormattingContext {\n timeZone: string,\n locale: Locale,\n calendarSystem: CalendarSystem\n computeWeekNumber: (d: DateMarker) => number\n weekText: string\n cmdFormatter?: CmdFormatterFunc\n defaultSeparator: string\n}\n\nexport interface DateFormatter {\n format(date: ZonedMarker, context: DateFormattingContext): string\n formatRange(start: ZonedMarker, end: ZonedMarker, context: DateFormattingContext, betterDefaultSeparator?: string): string\n}\n","import { DateFormatter, DateFormattingContext, createVerboseFormattingArg } from './DateFormatter'\nimport { ZonedMarker } from './zoned-marker'\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 cmdStr: string\n\n constructor(cmdStr: string) {\n this.cmdStr = cmdStr\n }\n\n format(date: ZonedMarker, context: DateFormattingContext, betterDefaultSeparator?: string) {\n return context.cmdFormatter(this.cmdStr, createVerboseFormattingArg(date, null, context, betterDefaultSeparator))\n }\n\n formatRange(start: ZonedMarker, end: ZonedMarker, context: DateFormattingContext, betterDefaultSeparator?: string) {\n return context.cmdFormatter(this.cmdStr, createVerboseFormattingArg(start, end, context, betterDefaultSeparator))\n }\n}\n","import { DateFormatter, DateFormattingContext, createVerboseFormattingArg, VerboseFormattingArg } from './DateFormatter'\nimport { ZonedMarker } from './zoned-marker'\n\nexport type FuncFormatterFunc = (arg: VerboseFormattingArg) => string\n\nexport class FuncFormatter implements DateFormatter {\n func: FuncFormatterFunc\n\n constructor(func: FuncFormatterFunc) {\n this.func = func\n }\n\n format(date: ZonedMarker, context: DateFormattingContext, betterDefaultSeparator?: string) {\n return this.func(createVerboseFormattingArg(date, null, context, betterDefaultSeparator))\n }\n\n formatRange(start: ZonedMarker, end: ZonedMarker, context: DateFormattingContext, betterDefaultSeparator?: string) {\n return this.func(createVerboseFormattingArg(start, end, context, betterDefaultSeparator))\n }\n}\n","import { NativeFormatter, NativeFormatterOptions } from './formatting-native'\nimport { CmdFormatter } from './formatting-cmd'\nimport { FuncFormatter, FuncFormatterFunc } from './formatting-func'\nimport { DateFormatter } from './DateFormatter'\n\nexport type FormatterInput = NativeFormatterOptions | string | FuncFormatterFunc\n\nexport function createFormatter(input: FormatterInput): DateFormatter {\n if (typeof input === 'object' && input) { // non-null object\n return new NativeFormatter(input)\n }\n\n if (typeof input === 'string') {\n return new CmdFormatter(input)\n }\n\n if (typeof input === 'function') {\n return new FuncFormatter(input as FuncFormatterFunc)\n }\n\n return null\n}\n","import { createDuration } from './datelib/duration'\nimport { mergeProps, isPropsEqual } from './util/object'\nimport { createFormatter } from './datelib/formatting'\nimport { parseFieldSpecs } from './util/misc'\nimport { DateProfileGeneratorClass } from './DateProfileGenerator'\n\n// public\nimport {\n CssDimValue,\n DateInput,\n DateRangeInput,\n BusinessHoursInput,\n EventSourceInput,\n ViewApi,\n LocaleSingularArg, LocaleInput,\n EventInput, EventInputTransformer,\n OverlapFunc, ConstraintInput, AllowFunc,\n PluginDef,\n ViewComponentType,\n SpecificViewContentArg, SpecificViewMountArg,\n ClassNamesGenerator, CustomContentGenerator, DidMountHandler, WillUnmountHandler,\n NowIndicatorContentArg, NowIndicatorMountArg,\n WeekNumberContentArg, WeekNumberMountArg,\n SlotLaneContentArg, SlotLaneMountArg,\n SlotLabelContentArg, SlotLabelMountArg,\n AllDayContentArg, AllDayMountArg,\n DayHeaderContentArg, DayHeaderMountArg,\n DayCellContentArg, DayCellMountArg,\n ViewContentArg, ViewMountArg,\n EventClickArg,\n EventHoveringArg,\n DateSelectArg, DateUnselectArg,\n CalendarApi,\n VUIEvent,\n WeekNumberCalculation,\n FormatterInput,\n ToolbarInput, CustomButtonInput, ButtonIconsInput, ButtonTextCompoundInput,\n EventContentArg, EventMountArg,\n DatesSetArg,\n EventApi, EventAddArg, EventChangeArg, EventRemoveArg,\n MoreLinkContentArg,\n MoreLinkMountArg,\n MoreLinkAction,\n} from './api-type-deps'\n\n// base options\n// ------------\n\nexport const BASE_OPTION_REFINERS = {\n navLinkDayClick: identity as Identity<string | ((this: CalendarApi, date: Date, jsEvent: VUIEvent) => void)>,\n navLinkWeekClick: identity as Identity<string | ((this: CalendarApi, weekStart: Date, jsEvent: VUIEvent) => void)>,\n duration: createDuration,\n bootstrapFontAwesome: identity as Identity<ButtonIconsInput | false>, // TODO: move to bootstrap plugin\n buttonIcons: identity as Identity<ButtonIconsInput | false>,\n customButtons: identity as Identity<{ [name: string]: CustomButtonInput }>,\n defaultAllDayEventDuration: createDuration,\n defaultTimedEventDuration: createDuration,\n nextDayThreshold: createDuration,\n scrollTime: createDuration,\n scrollTimeReset: Boolean,\n slotMinTime: createDuration,\n slotMaxTime: createDuration,\n dayPopoverFormat: createFormatter,\n slotDuration: createDuration,\n snapDuration: createDuration,\n headerToolbar: identity as Identity<ToolbarInput | false>,\n footerToolbar: identity as Identity<ToolbarInput | false>,\n defaultRangeSeparator: String,\n titleRangeSeparator: String,\n forceEventDuration: Boolean,\n\n dayHeaders: Boolean,\n dayHeaderFormat: createFormatter,\n dayHeaderClassNames: identity as Identity<ClassNamesGenerator<DayHeaderContentArg>>,\n dayHeaderContent: identity as Identity<CustomContentGenerator<DayHeaderContentArg>>,\n dayHeaderDidMount: identity as Identity<DidMountHandler<DayHeaderMountArg>>,\n dayHeaderWillUnmount: identity as Identity<WillUnmountHandler<DayHeaderMountArg>>,\n\n dayCellClassNames: identity as Identity<ClassNamesGenerator<DayCellContentArg>>,\n dayCellContent: identity as Identity<CustomContentGenerator<DayCellContentArg>>,\n dayCellDidMount: identity as Identity<DidMountHandler<DayCellMountArg>>,\n dayCellWillUnmount: identity as Identity<WillUnmountHandler<DayCellMountArg>>,\n\n initialView: String,\n aspectRatio: Number,\n weekends: Boolean,\n\n weekNumberCalculation: identity as Identity<WeekNumberCalculation>,\n weekNumbers: Boolean,\n weekNumberClassNames: identity as Identity<ClassNamesGenerator<WeekNumberContentArg>>,\n weekNumberContent: identity as Identity<CustomContentGenerator<WeekNumberContentArg>>,\n weekNumberDidMount: identity as Identity<DidMountHandler<WeekNumberMountArg>>,\n weekNumberWillUnmount: identity as Identity<WillUnmountHandler<WeekNumberMountArg>>,\n\n editable: Boolean,\n\n viewClassNames: identity as Identity<ClassNamesGenerator<ViewContentArg>>,\n viewDidMount: identity as Identity<DidMountHandler<ViewMountArg>>,\n viewWillUnmount: identity as Identity<WillUnmountHandler<ViewMountArg>>,\n\n nowIndicator: Boolean,\n nowIndicatorClassNames: identity as Identity<ClassNamesGenerator<NowIndicatorContentArg>>,\n nowIndicatorContent: identity as Identity<CustomContentGenerator<NowIndicatorContentArg>>,\n nowIndicatorDidMount: identity as Identity<DidMountHandler<NowIndicatorMountArg>>,\n nowIndicatorWillUnmount: identity as Identity<WillUnmountHandler<NowIndicatorMountArg>>,\n\n showNonCurrentDates: Boolean,\n lazyFetching: Boolean,\n startParam: String,\n endParam: String,\n timeZoneParam: String,\n timeZone: String,\n locales: identity as Identity<LocaleInput[]>,\n locale: identity as Identity<LocaleSingularArg>,\n themeSystem: String as Identity<'standard' | string>,\n dragRevertDuration: Number,\n dragScroll: Boolean,\n allDayMaintainDuration: Boolean,\n unselectAuto: Boolean,\n dropAccept: identity as Identity<string | ((this: CalendarApi, draggable: any) => boolean)>, // TODO: type draggable\n eventOrder: parseFieldSpecs,\n eventOrderStrict: Boolean,\n\n handleWindowResize: Boolean,\n windowResizeDelay: Number,\n longPressDelay: Number,\n eventDragMinDistance: Number,\n expandRows: Boolean,\n height: identity as Identity<CssDimValue>,\n contentHeight: identity as Identity<CssDimValue>,\n direction: String as Identity<'ltr' | 'rtl'>,\n weekNumberFormat: createFormatter,\n eventResizableFromStart: Boolean,\n displayEventTime: Boolean,\n displayEventEnd: Boolean,\n weekText: String,\n progressiveEventRendering: Boolean,\n businessHours: identity as Identity<BusinessHoursInput>,\n initialDate: identity as Identity<DateInput>,\n now: identity as Identity<DateInput | ((this: CalendarApi) => DateInput)>,\n eventDataTransform: identity as Identity<EventInputTransformer>,\n stickyHeaderDates: identity as Identity<boolean | 'auto'>,\n stickyFooterScrollbar: identity as Identity<boolean | 'auto'>,\n viewHeight: identity as Identity<CssDimValue>,\n defaultAllDay: Boolean,\n eventSourceFailure: identity as Identity<(this: CalendarApi, error: any) => void>,\n eventSourceSuccess: identity as Identity<(this: CalendarApi, eventsInput: EventInput[], xhr?: XMLHttpRequest) => EventInput[] | void>,\n\n eventDisplay: String, // TODO: give more specific\n eventStartEditable: Boolean,\n eventDurationEditable: Boolean,\n eventOverlap: identity as Identity<boolean | OverlapFunc>,\n eventConstraint: identity as Identity<ConstraintInput>,\n eventAllow: identity as Identity<AllowFunc>,\n eventBackgroundColor: String,\n eventBorderColor: String,\n eventTextColor: String,\n eventColor: String,\n eventClassNames: identity as Identity<ClassNamesGenerator<EventContentArg>>,\n eventContent: identity as Identity<CustomContentGenerator<EventContentArg>>,\n eventDidMount: identity as Identity<DidMountHandler<EventMountArg>>,\n eventWillUnmount: identity as Identity<WillUnmountHandler<EventMountArg>>,\n\n selectConstraint: identity as Identity<ConstraintInput>,\n selectOverlap: identity as Identity<boolean | OverlapFunc>,\n selectAllow: identity as Identity<AllowFunc>,\n\n droppable: Boolean,\n unselectCancel: String,\n\n slotLabelFormat: identity as Identity<FormatterInput | FormatterInput[]>,\n\n slotLaneClassNames: identity as Identity<ClassNamesGenerator<SlotLaneContentArg>>,\n slotLaneContent: identity as Identity<CustomContentGenerator<SlotLaneContentArg>>,\n slotLaneDidMount: identity as Identity<DidMountHandler<SlotLaneMountArg>>,\n slotLaneWillUnmount: identity as Identity<WillUnmountHandler<SlotLaneMountArg>>,\n\n slotLabelClassNames: identity as Identity<ClassNamesGenerator<SlotLabelContentArg>>,\n slotLabelContent: identity as Identity<CustomContentGenerator<SlotLabelContentArg>>,\n slotLabelDidMount: identity as Identity<DidMountHandler<SlotLabelMountArg>>,\n slotLabelWillUnmount: identity as Identity<WillUnmountHandler<SlotLabelMountArg>>,\n\n dayMaxEvents: identity as Identity<boolean | number>,\n dayMaxEventRows: identity as Identity<boolean | number>,\n dayMinWidth: Number,\n slotLabelInterval: createDuration,\n\n allDayText: String,\n allDayClassNames: identity as Identity<ClassNamesGenerator<AllDayContentArg>>,\n allDayContent: identity as Identity<CustomContentGenerator<AllDayContentArg>>,\n allDayDidMount: identity as Identity<DidMountHandler<AllDayMountArg>>,\n allDayWillUnmount: identity as Identity<WillUnmountHandler<AllDayMountArg>>,\n\n slotMinWidth: Number, // move to timeline?\n navLinks: Boolean,\n eventTimeFormat: createFormatter,\n rerenderDelay: Number, // TODO: move to @fullcalendar/core right? nah keep here\n moreLinkText: identity as Identity<string | ((this: CalendarApi, num: number) => string)>, // this not enforced :( check others too\n selectMinDistance: Number,\n selectable: Boolean,\n selectLongPressDelay: Number,\n eventLongPressDelay: Number,\n\n selectMirror: Boolean,\n eventMaxStack: Number,\n eventMinHeight: Number,\n eventMinWidth: Number,\n eventShortHeight: Number,\n slotEventOverlap: Boolean,\n plugins: identity as Identity<PluginDef[]>,\n firstDay: Number,\n dayCount: Number,\n dateAlignment: String,\n dateIncrement: createDuration,\n hiddenDays: identity as Identity<number[]>,\n monthMode: Boolean,\n fixedWeekCount: Boolean,\n validRange: identity as Identity<DateRangeInput | ((this: CalendarApi, nowDate: Date) => DateRangeInput)>, // `this` works?\n visibleRange: identity as Identity<DateRangeInput | ((this: CalendarApi, currentDate: Date) => DateRangeInput)>, // `this` works?\n titleFormat: identity as Identity<FormatterInput>, // DONT parse just yet. we need to inject titleSeparator\n\n // only used by list-view, but languages define the value, so we need it in base options\n noEventsText: String,\n\n moreLinkClick: identity as Identity<MoreLinkAction>,\n moreLinkClassNames: identity as Identity<ClassNamesGenerator<MoreLinkContentArg>>,\n moreLinkContent: identity as Identity<CustomContentGenerator<MoreLinkContentArg>>,\n moreLinkDidMount: identity as Identity<DidMountHandler<MoreLinkMountArg>>,\n moreLinkWillUnmount: identity as Identity<WillUnmountHandler<MoreLinkMountArg>>,\n}\n\ntype BuiltInBaseOptionRefiners = typeof BASE_OPTION_REFINERS\n\nexport interface BaseOptionRefiners extends BuiltInBaseOptionRefiners {\n // for ambient-extending\n}\n\nexport type BaseOptions = RawOptionsFromRefiners< // as RawOptions\n Required<BaseOptionRefiners> // Required is a hack for \"Index signature is missing\"\n>\n\n// do NOT give a type here. need `typeof BASE_OPTION_DEFAULTS` to give real results.\n// raw values.\nexport const BASE_OPTION_DEFAULTS = {\n eventDisplay: 'auto',\n defaultRangeSeparator: ' - ',\n titleRangeSeparator: ' \\u2013 ', // en dash\n defaultTimedEventDuration: '01:00:00',\n defaultAllDayEventDuration: { day: 1 },\n forceEventDuration: false,\n nextDayThreshold: '00:00:00',\n dayHeaders: true,\n initialView: '',\n aspectRatio: 1.35,\n headerToolbar: {\n start: 'title',\n center: '',\n end: 'today prev,next',\n },\n weekends: true,\n weekNumbers: false,\n weekNumberCalculation: 'local' as WeekNumberCalculation,\n editable: false,\n nowIndicator: false,\n scrollTime: '06:00:00',\n scrollTimeReset: true,\n slotMinTime: '00:00:00',\n slotMaxTime: '24:00:00',\n showNonCurrentDates: true,\n lazyFetching: true,\n startParam: 'start',\n endParam: 'end',\n timeZoneParam: 'timeZone',\n timeZone: 'local', // TODO: throw error if given falsy value?\n locales: [],\n locale: '', // blank values means it will compute based off locales[]\n themeSystem: 'standard',\n dragRevertDuration: 500,\n dragScroll: true,\n allDayMaintainDuration: false,\n unselectAuto: true,\n dropAccept: '*',\n eventOrder: 'start,-duration,allDay,title',\n dayPopoverFormat: { month: 'long', day: 'numeric', year: 'numeric' },\n handleWindowResize: true,\n windowResizeDelay: 100, // milliseconds before an updateSize happens\n longPressDelay: 1000,\n eventDragMinDistance: 5, // only applies to mouse\n expandRows: false,\n navLinks: false,\n selectable: false,\n eventMinHeight: 15,\n eventMinWidth: 30,\n eventShortHeight: 30,\n}\n\nexport type BaseOptionsRefined = DefaultedRefinedOptions<\n RefinedOptionsFromRefiners<Required<BaseOptionRefiners>>, // Required is a hack for \"Index signature is missing\"\n keyof typeof BASE_OPTION_DEFAULTS\n>\n\n// calendar listeners\n// ------------------\n\nexport const CALENDAR_LISTENER_REFINERS = {\n datesSet: identity as Identity<(arg: DatesSetArg) => void>,\n eventsSet: identity as Identity<(events: EventApi[]) => void>,\n eventAdd: identity as Identity<(arg: EventAddArg) => void>,\n eventChange: identity as Identity<(arg: EventChangeArg) => void>,\n eventRemove: identity as Identity<(arg: EventRemoveArg) => void>,\n windowResize: identity as Identity<(arg: { view: ViewApi }) => void>,\n eventClick: identity as Identity<(arg: EventClickArg) => void>, // TODO: resource for scheduler????\n eventMouseEnter: identity as Identity<(arg: EventHoveringArg) => void>,\n eventMouseLeave: identity as Identity<(arg: EventHoveringArg) => void>,\n select: identity as Identity<(arg: DateSelectArg) => void>, // resource for scheduler????\n unselect: identity as Identity<(arg: DateUnselectArg) => void>,\n loading: identity as Identity<(isLoading: boolean) => void>,\n\n // internal\n _unmount: identity as Identity<() => void>,\n _beforeprint: identity as Identity<() => void>,\n _afterprint: identity as Identity<() => void>,\n _noEventDrop: identity as Identity<() => void>,\n _noEventResize: identity as Identity<() => void>,\n _resize: identity as Identity<(forced: boolean) => void>,\n _scrollRequest: identity as Identity<(arg: any) => void>,\n}\n\ntype BuiltInCalendarListenerRefiners = typeof CALENDAR_LISTENER_REFINERS\n\nexport interface CalendarListenerRefiners extends BuiltInCalendarListenerRefiners {\n // for ambient extending\n}\n\ntype CalendarListenersLoose = RefinedOptionsFromRefiners<Required<CalendarListenerRefiners>> // Required hack\nexport type CalendarListeners = Required<CalendarListenersLoose> // much more convenient for Emitters and whatnot\n\n// calendar-specific options\n// -------------------------\n\nexport const CALENDAR_OPTION_REFINERS = { // does not include base nor calendar listeners\n buttonText: identity as Identity<ButtonTextCompoundInput>,\n views: identity as Identity<{ [viewId: string]: ViewOptions }>,\n plugins: identity as Identity<PluginDef[]>,\n initialEvents: identity as Identity<EventSourceInput>,\n events: identity as Identity<EventSourceInput>,\n eventSources: identity as Identity<EventSourceInput[]>,\n}\n\ntype BuiltInCalendarOptionRefiners = typeof CALENDAR_OPTION_REFINERS\n\nexport interface CalendarOptionRefiners extends BuiltInCalendarOptionRefiners {\n // for ambient-extending\n}\n\nexport type CalendarOptions =\n BaseOptions &\n CalendarListenersLoose &\n RawOptionsFromRefiners<Required<CalendarOptionRefiners>> // Required hack https://github.com/microsoft/TypeScript/issues/15300\n\nexport type CalendarOptionsRefined =\n BaseOptionsRefined &\n CalendarListenersLoose &\n RefinedOptionsFromRefiners<Required<CalendarOptionRefiners>> // Required hack\n\nexport const COMPLEX_OPTION_COMPARATORS: {\n [optionName in keyof CalendarOptions]: (a: CalendarOptions[optionName], b: CalendarOptions[optionName]) => boolean\n} = {\n headerToolbar: isBoolComplexEqual,\n footerToolbar: isBoolComplexEqual,\n buttonText: isBoolComplexEqual,\n buttonIcons: isBoolComplexEqual,\n}\n\nfunction isBoolComplexEqual(a, b) {\n if (typeof a === 'object' && typeof b === 'object' && a && b) { // both non-null objects\n return isPropsEqual(a, b)\n }\n return a === b\n}\n\n// view-specific options\n// ---------------------\n\nexport const VIEW_OPTION_REFINERS: {\n [name: string]: any\n} = {\n type: String,\n component: identity as Identity<ViewComponentType>,\n buttonText: String,\n buttonTextKey: String, // internal only\n dateProfileGeneratorClass: identity as Identity<DateProfileGeneratorClass>,\n usesMinMaxTime: Boolean, // internal only\n classNames: identity as Identity<ClassNamesGenerator<SpecificViewContentArg>>,\n content: identity as Identity<CustomContentGenerator<SpecificViewContentArg>>,\n didMount: identity as Identity<DidMountHandler<SpecificViewMountArg>>,\n willUnmount: identity as Identity<WillUnmountHandler<SpecificViewMountArg>>,\n}\n\ntype BuiltInViewOptionRefiners = typeof VIEW_OPTION_REFINERS\n\nexport interface ViewOptionRefiners extends BuiltInViewOptionRefiners {\n // for ambient-extending\n}\n\nexport type ViewOptions =\n BaseOptions &\n CalendarListenersLoose &\n RawOptionsFromRefiners<Required<ViewOptionRefiners>> // Required hack\n\nexport type ViewOptionsRefined =\n BaseOptionsRefined &\n CalendarListenersLoose &\n RefinedOptionsFromRefiners<Required<ViewOptionRefiners>> // Required hack\n\n// util funcs\n// ----------------------------------------------------------------------------------------------------\n\nexport function mergeRawOptions(optionSets: Dictionary[]) {\n return mergeProps(optionSets, COMPLEX_OPTION_COMPARATORS)\n}\n\nexport function refineProps<Refiners extends GenericRefiners, Raw extends RawOptionsFromRefiners<Refiners>>(\n input: Raw,\n refiners: Refiners,\n): {\n refined: RefinedOptionsFromRefiners<Refiners>,\n extra: Dictionary,\n} {\n let refined = {} as any\n let extra = {} as any\n\n for (let propName in refiners) {\n if (propName in input) {\n refined[propName] = refiners[propName](input[propName])\n }\n }\n\n for (let propName in input) {\n if (!(propName in refiners)) {\n extra[propName] = input[propName]\n }\n }\n\n return { refined, extra }\n}\n\n// definition utils\n// ----------------------------------------------------------------------------------------------------\n\nexport type GenericRefiners = {\n [propName: string]: (input: any) => any\n}\n\nexport type GenericListenerRefiners = {\n [listenerName: string]: Identity<(this: CalendarApi, ...args: any[]) => void>\n}\n\nexport type RawOptionsFromRefiners<Refiners extends GenericRefiners> = {\n [Prop in keyof Refiners]?: // all optional\n Refiners[Prop] extends ((input: infer RawType) => infer RefinedType)\n ? (any extends RawType ? RefinedType : RawType) // if input type `any`, use output (for Boolean/Number/String)\n : never\n}\n\nexport type RefinedOptionsFromRefiners<Refiners extends GenericRefiners> = {\n [Prop in keyof Refiners]?: // all optional\n Refiners[Prop] extends ((input: any) => infer RefinedType) ? RefinedType : never\n}\n\nexport type DefaultedRefinedOptions<RefinedOptions extends Dictionary, DefaultKey extends keyof RefinedOptions> =\n Required<Pick<RefinedOptions, DefaultKey>> &\n Partial<Omit<RefinedOptions, DefaultKey>>\n\nexport type Dictionary = Record<string, any>\n\nexport type Identity<T = any> = (raw: T) => T\n\nexport function identity<T>(raw: T): T {\n return raw\n}\n","import { EventDef, EventDefHash } from './event-def'\nimport { EventInstance, EventInstanceHash } from './event-instance'\nimport { EventInput, parseEvent, EventTuple, buildEventRefiners } from './event-parse'\nimport { filterHash } from '../util/object'\nimport { CalendarContext } from '../CalendarContext'\nimport { EventSource } from './event-source'\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 eventSource: EventSource<any> | null,\n context: CalendarContext,\n allowOpenRange?: boolean,\n): EventStore {\n let eventStore = createEmptyEventStore()\n let eventRefiners = buildEventRefiners(context)\n\n for (let rawEvent of rawEvents) {\n let tuple = parseEvent(rawEvent, eventSource, context, allowOpenRange, eventRefiners)\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\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, (lookDef) => isEventDefsGrouped(def, lookDef))\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 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, (instance: EventInstance) => (\n defs[instance.defId] // still exists?\n ))\n return { defs, instances }\n}\n\nexport function excludeSubEventStore(master: EventStore, sub: EventStore): EventStore {\n let { defs, instances } = master\n let filteredDefs: { [defId: string]: EventDef } = {}\n let filteredInstances: { [instanceId: string]: EventInstance } = {}\n\n for (let defId in defs) {\n if (!sub.defs[defId]) { // not explicitly excluded\n filteredDefs[defId] = defs[defId]\n }\n }\n\n for (let instanceId in instances) {\n if (\n !sub.instances[instanceId] && // not explicitly excluded\n filteredDefs[instances[instanceId].defId] // def wasn't filtered away\n ) {\n filteredInstances[instanceId] = instances[instanceId]\n }\n }\n\n return {\n defs: filteredDefs,\n instances: filteredInstances,\n }\n}\n","import { EventStore, parseEvents } from './event-store'\nimport { EventInput } from './event-parse'\nimport { DateSpanApi } from './date-span'\nimport { EventApi } from '../api/EventApi'\nimport { SplittableProps } from '../component/event-splitting'\nimport { CalendarContext } from '../CalendarContext'\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, context: CalendarContext) => boolean\n\nexport function normalizeConstraint(input: ConstraintInput, context: CalendarContext): Constraint | null {\n if (Array.isArray(input)) {\n return parseEvents(input, null, context, true) // allowOpenRange=true\n } if (typeof input === 'object' && input) { // non-null object\n return parseEvents([input], null, context, true) // allowOpenRange=true\n } if (input != null) {\n return String(input)\n }\n return null\n}\n","export type ClassNamesInput = string | string[]\n\nexport function parseClassNames(raw: ClassNamesInput) {\n if (Array.isArray(raw)) {\n return raw\n }\n\n if (typeof raw === 'string') {\n return raw.split(/\\s+/)\n }\n\n return []\n}\n","import { Constraint, AllowFunc, normalizeConstraint } from '../structs/constraint'\nimport { parseClassNames } from '../util/html'\nimport { CalendarContext } from '../CalendarContext'\nimport { RawOptionsFromRefiners, RefinedOptionsFromRefiners, identity, Identity } from '../options'\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 const EVENT_UI_REFINERS = {\n display: String,\n editable: Boolean,\n startEditable: Boolean,\n durationEditable: Boolean,\n constraint: identity as Identity<any>, // Identity<ConstraintInput>, // circular reference. ts dies. event->constraint->event\n overlap: identity as Identity<boolean>,\n allow: identity as Identity<AllowFunc>,\n className: parseClassNames, // will both end up as array of strings\n classNames: parseClassNames, // \"\n color: String,\n backgroundColor: String,\n borderColor: String,\n textColor: String,\n}\n\nconst EMPTY_EVENT_UI: EventUi = {\n display: null,\n startEditable: null,\n durationEditable: null,\n constraints: [],\n overlap: null,\n allows: [],\n backgroundColor: '',\n borderColor: '',\n textColor: '',\n classNames: [],\n}\n\ntype BuiltInEventUiRefiners = typeof EVENT_UI_REFINERS\n\ninterface EventUiRefiners extends BuiltInEventUiRefiners {\n // to prevent circular reference (and give is the option for ambient modification for later)\n}\n\nexport type EventUiInput = RawOptionsFromRefiners<Required<EventUiRefiners>> // Required hack\nexport type EventUiRefined = RefinedOptionsFromRefiners<Required<EventUiRefiners>> // Required hack\n\nexport interface EventUi {\n display: string | null\n startEditable: boolean | null\n durationEditable: boolean | null\n constraints: Constraint[]\n overlap: boolean | null\n allows: AllowFunc[] // crappy name to indicate plural\n backgroundColor: string\n borderColor: string\n textColor: string,\n classNames: string[]\n}\n\nexport type EventUiHash = { [defId: string]: EventUi }\n\nexport function createEventUi(refined: EventUiRefined, context: CalendarContext): EventUi {\n let constraint = normalizeConstraint(refined.constraint, context)\n\n return {\n display: refined.display || null,\n startEditable: refined.startEditable != null ? refined.startEditable : refined.editable,\n durationEditable: refined.durationEditable != null ? refined.durationEditable : refined.editable,\n constraints: constraint != null ? [constraint] : [],\n overlap: refined.overlap != null ? refined.overlap : null,\n allows: refined.allow != null ? [refined.allow] : [],\n backgroundColor: refined.backgroundColor || refined.color || '',\n borderColor: refined.borderColor || refined.color || '',\n textColor: refined.textColor || '',\n classNames: (refined.className || []).concat(refined.classNames || []), // join singular and plural\n }\n}\n\n// TODO: 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 display: item1.display != null ? item1.display : item0.display,\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 { __assign } from 'tslib'\nimport { guid } from '../util/misc'\nimport { DateInput } from '../datelib/env'\nimport { startOfDay } from '../datelib/marker'\nimport { parseRecurring } from './recurring-event'\nimport { CalendarContext } from '../CalendarContext'\nimport { EventDef } from './event-def'\nimport { createEventInstance, EventInstance } from './event-instance'\nimport { EventSource } from './event-source'\nimport { RefinedOptionsFromRefiners, RawOptionsFromRefiners, identity, Identity, Dictionary, refineProps } from '../options'\nimport { EVENT_UI_REFINERS, createEventUi, EventUiInput, EventUiRefined } from '../component/event-ui'\n\nexport const EVENT_NON_DATE_REFINERS = {\n id: String,\n groupId: String,\n title: String,\n url: String,\n}\n\nexport const EVENT_DATE_REFINERS = {\n start: identity as Identity<DateInput>,\n end: identity as Identity<DateInput>,\n date: identity as Identity<DateInput>,\n allDay: Boolean,\n}\n\nconst EVENT_REFINERS = { // does NOT include EVENT_UI_REFINERS\n ...EVENT_NON_DATE_REFINERS,\n ...EVENT_DATE_REFINERS,\n extendedProps: identity as Identity<Dictionary>,\n}\n\ntype BuiltInEventRefiners = typeof EVENT_REFINERS\n\nexport interface EventRefiners extends BuiltInEventRefiners {\n // for ambient\n}\n\nexport type EventInput =\n EventUiInput &\n RawOptionsFromRefiners<Required<EventRefiners>> & // Required hack\n { [extendedProp: string]: any }\n\nexport type EventRefined =\n EventUiRefined &\n RefinedOptionsFromRefiners<Required<EventRefiners>> // Required hack\n\nexport interface EventTuple {\n def: EventDef\n instance: EventInstance | null\n}\n\nexport type EventInputTransformer = (input: EventInput) => EventInput\nexport type EventDefMemberAdder = (refined: EventRefined) => Partial<EventDef>\n\nexport function parseEvent(\n raw: EventInput,\n eventSource: EventSource<any> | null,\n context: CalendarContext,\n allowOpenRange: boolean,\n refiners = buildEventRefiners(context),\n): EventTuple | null {\n let { refined, extra } = refineEventDef(raw, context, refiners)\n\n let defaultAllDay = computeIsDefaultAllDay(eventSource, context)\n let recurringRes = parseRecurring(\n refined,\n defaultAllDay,\n context.dateEnv,\n context.pluginHooks.recurringTypes,\n )\n\n if (recurringRes) {\n let def = parseEventDef(\n refined,\n extra,\n eventSource ? eventSource.sourceId : '',\n recurringRes.allDay,\n Boolean(recurringRes.duration),\n context,\n )\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 let singleRes = parseSingle(refined, defaultAllDay, context, allowOpenRange)\n\n if (singleRes) {\n let def = parseEventDef(refined, extra, eventSource ? eventSource.sourceId : '', singleRes.allDay, singleRes.hasEnd, context)\n let instance = createEventInstance(def.defId, singleRes.range, singleRes.forcedStartTzo, singleRes.forcedEndTzo)\n\n return { def, instance }\n }\n\n return null\n}\n\nexport function refineEventDef(raw: EventInput, context: CalendarContext, refiners = buildEventRefiners(context)) {\n return refineProps(raw, refiners)\n}\n\nexport function buildEventRefiners(context: CalendarContext) {\n return { ...EVENT_UI_REFINERS, ...EVENT_REFINERS, ...context.pluginHooks.eventRefiners }\n}\n\n/*\nWill NOT populate extendedProps with the leftover properties.\nWill NOT populate date-related props.\n*/\nexport function parseEventDef(\n refined: EventRefined,\n extra: Dictionary,\n sourceId: string,\n allDay: boolean,\n hasEnd: boolean,\n context: CalendarContext,\n): EventDef {\n let def: EventDef = {\n title: refined.title || '',\n groupId: refined.groupId || '',\n publicId: refined.id || '',\n url: refined.url || '',\n recurringDef: null,\n defId: guid(),\n sourceId,\n allDay,\n hasEnd,\n ui: createEventUi(refined, context),\n extendedProps: {\n ...(refined.extendedProps || {}),\n ...extra,\n },\n }\n\n for (let memberAdder of context.pluginHooks.eventDefMemberAdders) {\n __assign(def, memberAdder(refined))\n }\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\nfunction parseSingle(refined: EventRefined, defaultAllDay: boolean | null, context: CalendarContext, allowOpenRange?: boolean) {\n let { allDay } = refined\n let startMeta\n let startMarker = null\n let hasEnd = false\n let endMeta\n let endMarker = null\n\n let startInput = refined.start != null ? refined.start : refined.date\n startMeta = context.dateEnv.createMarkerMeta(startInput)\n\n if (startMeta) {\n startMarker = startMeta.marker\n } else if (!allowOpenRange) {\n return null\n }\n\n if (refined.end != null) {\n endMeta = context.dateEnv.createMarkerMeta(refined.end)\n }\n\n if (allDay == null) {\n if (defaultAllDay != null) {\n allDay = defaultAllDay\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 = context.options.forceEventDuration || false\n\n endMarker = context.dateEnv.add(\n startMarker,\n allDay ?\n context.options.defaultAllDayEventDuration :\n context.options.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\nfunction computeIsDefaultAllDay(eventSource: EventSource<any> | null, context: CalendarContext): boolean | null {\n let res = null\n\n if (eventSource) {\n res = eventSource.defaultAllDay\n }\n\n if (res == null) {\n res = context.options.defaultAllDay\n }\n\n return res\n}\n","import { 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/* Date stuff that doesn't belong in datelib core\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// 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// 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\nexport function diffDates(date0: DateMarker, date1: DateMarker, dateEnv: DateEnv, largeUnit?: string) {\n if (largeUnit === 'year') {\n return createDuration(dateEnv.diffWholeYears(date0, date1), 'year')!\n }\n\n if (largeUnit === 'month') {\n return createDuration(dateEnv.diffWholeMonths(date0, date1), 'month')!\n }\n\n return diffDayAndTime(date0, date1) // returns a duration\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 // 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 += 1) {\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, end } = range0\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","import { EventDef, EventDefHash } from '../structs/event-def'\nimport { EventTuple } from '../structs/event-parse'\nimport { EventStore } from '../structs/event-store'\nimport { DateRange, invertRanges, intersectRanges, rangeContainsMarker } from '../datelib/date-range'\nimport { Duration } from '../datelib/duration'\nimport { compareByFieldSpecs, OrderSpec } from '../util/misc'\nimport { computeVisibleDayRange } from '../util/date'\nimport { Seg } from './DateComponent'\nimport { EventApi } from '../api/EventApi'\nimport { EventUi, EventUiHash, combineEventUis } from './event-ui'\nimport { mapHash } from '../util/object'\nimport { ViewContext } from '../ViewContext'\nimport { DateFormatter } from '../datelib/DateFormatter'\nimport { addMs, DateMarker, startOfDay } from '../datelib/marker'\nimport { ViewApi } from '../ViewApi'\nimport { MountArg } from '../common/render-hook'\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 let ui = eventUis[def.defId]\n\n if (ui.display === '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 (ui.display === 'inverse-background') {\n if (def.groupId) {\n inverseBgByGroupId[def.groupId].push(slicedRange)\n } else {\n inverseBgByDefId[instance.defId].push(slicedRange)\n }\n } else if (ui.display !== 'none') {\n (ui.display === '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.ui.display === 'background' || def.ui.display === 'inverse-background'\n}\n\nexport function 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 ||\n (el.parentNode as any).fcSeg || // for the harness\n null\n}\n\n// event ui computation\n\nexport function compileEventUis(eventDefs: EventDefHash, eventUiBases: EventUiHash) {\n return mapHash(eventDefs, (eventDef: EventDef) => compileEventUi(eventDef, eventUiBases))\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\nexport function sortEventSegs(segs, eventOrderSpecs: OrderSpec<EventApi>[]): Seg[] {\n let objs = segs.map(buildSegCompareObj)\n\n objs.sort((obj0, obj1) => compareByFieldSpecs(obj0, obj1, eventOrderSpecs))\n\n return objs.map((c) => c._seg)\n}\n\n// returns a object with all primitive props that can be compared\nexport function buildSegCompareObj(seg: Seg) {\n let { eventRange } = seg\n let eventDef = eventRange.def\n let range = eventRange.instance ? eventRange.instance.range : eventRange.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\n// other stuff\n\nexport interface EventContentArg { // for *Content handlers\n event: EventApi\n timeText: string\n backgroundColor: string // TODO: add other EventUi props?\n borderColor: string //\n textColor: string //\n isDraggable: boolean\n isStartResizable: boolean\n isEndResizable: boolean\n isMirror: boolean\n isStart: boolean\n isEnd: boolean\n isPast: boolean\n isFuture: boolean\n isToday: boolean\n isSelected: boolean\n isDragging: boolean\n isResizing: boolean\n view: ViewApi // specifically for the API\n}\n\nexport type EventMountArg = MountArg<EventContentArg>\n\nexport function computeSegDraggable(seg: Seg, context: ViewContext) {\n let { pluginHooks } = context\n let transformers = pluginHooks.isDraggableTransformers\n let { def, ui } = seg.eventRange\n let val = ui.startEditable\n\n for (let transformer of transformers) {\n val = transformer(val, def, ui, context)\n }\n\n return val\n}\n\nexport function computeSegStartResizable(seg: Seg, context: ViewContext) {\n return seg.isStart && seg.eventRange.ui.durationEditable && context.options.eventResizableFromStart\n}\n\nexport function computeSegEndResizable(seg: Seg, context: ViewContext) {\n return seg.isEnd && seg.eventRange.ui.durationEditable\n}\n\nexport function buildSegTimeText(\n seg: Seg,\n timeFormat: DateFormatter,\n context: ViewContext,\n defaultDisplayEventTime?: boolean, // defaults to true\n defaultDisplayEventEnd?: boolean, // defaults to true\n startOverride?: DateMarker,\n endOverride?: DateMarker,\n) {\n let { dateEnv, options } = context\n let { displayEventTime, displayEventEnd } = options\n let eventDef = seg.eventRange.def\n let eventInstance = seg.eventRange.instance\n\n if (displayEventTime == null) { displayEventTime = defaultDisplayEventTime !== false }\n if (displayEventEnd == null) { displayEventEnd = defaultDisplayEventEnd !== false }\n\n let wholeEventStart = eventInstance.range.start\n let wholeEventEnd = eventInstance.range.end\n let segStart = startOverride || seg.start || seg.eventRange.range.start\n let segEnd = endOverride || seg.end || seg.eventRange.range.end\n let isStartDay = startOfDay(wholeEventStart).valueOf() === startOfDay(segStart).valueOf()\n let isEndDay = startOfDay(addMs(wholeEventEnd, -1)).valueOf() === startOfDay(addMs(segEnd, -1)).valueOf()\n\n if (displayEventTime && !eventDef.allDay && (isStartDay || isEndDay)) {\n segStart = isStartDay ? wholeEventStart : segStart\n segEnd = isEndDay ? wholeEventEnd : segEnd\n\n if (displayEventEnd && eventDef.hasEnd) {\n return dateEnv.formatRange(segStart, segEnd, timeFormat, {\n forcedStartTzo: startOverride ? null : eventInstance.forcedStartTzo, // nooooooooooooo, give tzo if same date\n forcedEndTzo: endOverride ? null : eventInstance.forcedEndTzo,\n })\n }\n return dateEnv.format(segStart, timeFormat, {\n forcedTzo: startOverride ? null : eventInstance.forcedStartTzo, // nooooo, same\n })\n }\n\n return ''\n}\n\nexport function getSegMeta(seg: Seg, todayRange: DateRange, nowDate?: DateMarker) { // TODO: make arg order consistent with date util\n let segRange = seg.eventRange.range\n\n return {\n isPast: segRange.end < (nowDate || todayRange.start),\n isFuture: segRange.start >= (nowDate || todayRange.end),\n isToday: todayRange && rangeContainsMarker(todayRange, segRange.start),\n }\n}\n\nexport function getEventClassNames(props: EventContentArg) { // weird that we use this interface, but convenient\n let classNames: string[] = ['fc-event']\n\n if (props.isMirror) {\n classNames.push('fc-event-mirror')\n }\n\n if (props.isDraggable) {\n classNames.push('fc-event-draggable')\n }\n\n if (props.isStartResizable || props.isEndResizable) {\n classNames.push('fc-event-resizable')\n }\n\n if (props.isDragging) {\n classNames.push('fc-event-dragging')\n }\n\n if (props.isResizing) {\n classNames.push('fc-event-resizing')\n }\n\n if (props.isSelected) {\n classNames.push('fc-event-selected')\n }\n\n if (props.isStart) {\n classNames.push('fc-event-start')\n }\n\n if (props.isEnd) {\n classNames.push('fc-event-end')\n }\n\n if (props.isPast) {\n classNames.push('fc-event-past')\n }\n\n if (props.isToday) {\n classNames.push('fc-event-today')\n }\n\n if (props.isFuture) {\n classNames.push('fc-event-future')\n }\n\n return classNames\n}\n\nexport function buildEventRangeKey(eventRange: EventRenderRange) {\n return eventRange.instance\n ? eventRange.instance.instanceId\n : `${eventRange.def.defId}:${eventRange.range.start.toISOString()}`\n // inverse-background events don't have specific instances. TODO: better solution\n}\n","import { DateRange, rangesEqual, OpenDateRange } from '../datelib/date-range'\nimport { DateInput, DateEnv } from '../datelib/env'\nimport { Duration } from '../datelib/duration'\nimport { createEventInstance } from './event-instance'\nimport { parseEventDef, refineEventDef } from './event-parse'\nimport { EventRenderRange, compileEventUi } from '../component/event-rendering'\nimport { EventUiHash } from '../component/event-ui'\nimport { CalendarContext } from '../CalendarContext'\nimport { refineProps, identity, Identity } from '../options'\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 RangeApi {\n start: Date\n end: Date\n startStr: string\n endStr: string\n}\n\nexport interface DateSpanApi extends RangeApi {\n allDay: boolean\n}\n\nexport interface RangeApiWithTimeZone extends RangeApi {\n timeZone: string\n}\n\nexport interface DatePointApi {\n date: Date\n dateStr: string\n allDay: boolean\n}\n\nconst STANDARD_PROPS = {\n start: identity as Identity<DateInput>,\n end: identity as Identity<DateInput>,\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 }\n range.end = dateEnv.add(range.start, defaultDuration)\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 { refined: standardProps, extra } = refineProps(raw, STANDARD_PROPS)\n let startMeta = standardProps.start ? dateEnv.createMarkerMeta(standardProps.start) : null\n let endMeta = standardProps.end ? dateEnv.createMarkerMeta(standardProps.end) : null\n let { allDay } = standardProps\n\n if (allDay == null) {\n allDay = (startMeta && startMeta.isTimeUnspecified) &&\n (!endMeta || endMeta.isTimeUnspecified)\n }\n\n return {\n range: {\n start: startMeta ? startMeta.marker : null,\n end: endMeta ? endMeta.marker : null,\n },\n allDay,\n ...extra,\n }\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 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 ...buildRangeApi(span.range, dateEnv, span.allDay),\n allDay: span.allDay,\n }\n}\n\nexport function buildRangeApiWithTimeZone(range: DateRange, dateEnv: DateEnv, omitTime?: boolean): RangeApiWithTimeZone {\n return {\n ...buildRangeApi(range, dateEnv, omitTime),\n timeZone: dateEnv.timeZone,\n }\n}\n\nexport function buildRangeApi(range: DateRange, dateEnv: DateEnv, omitTime?: boolean): RangeApi {\n return {\n start: dateEnv.toDate(range.start),\n end: dateEnv.toDate(range.end),\n startStr: dateEnv.formatIso(range.start, { omitTime }),\n endStr: dateEnv.formatIso(range.end, { omitTime }),\n }\n}\n\nexport function fabricateEventRange(dateSpan: DateSpan, eventUiBases: EventUiHash, context: CalendarContext): EventRenderRange {\n let res = refineEventDef({ editable: false }, context)\n let def = parseEventDef(\n res.refined,\n res.extra,\n '', // sourceId\n dateSpan.allDay,\n true, // hasEnd\n context,\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 { __assign } from 'tslib'\nimport { PointerDragEvent } from './interactions/pointer'\nimport { buildDateSpanApi, DateSpanApi, DatePointApi, DateSpan } from './structs/date-span'\nimport { CalendarContext } from './CalendarContext'\nimport { ViewApi } from './ViewApi'\nimport { DateMarker, startOfDay } from './datelib/marker'\n\nexport interface DateClickApi extends DatePointApi {\n dayEl: HTMLElement\n jsEvent: UIEvent\n view: ViewApi\n}\n\nexport interface DateSelectionApi extends DateSpanApi {\n jsEvent: UIEvent\n view: ViewApi\n}\n\nexport type DatePointTransform = (dateSpan: DateSpan, context: CalendarContext) => any\nexport type DateSpanTransform = (dateSpan: DateSpan, context: CalendarContext) => any\n\nexport type CalendarInteraction = { destroy: () => void }\nexport type CalendarInteractionClass = { new(context: CalendarContext): CalendarInteraction }\n\nexport type OptionChangeHandler = (propValue: any, context: CalendarContext) => void\nexport type OptionChangeHandlerMap = { [propName: string]: OptionChangeHandler }\n\nexport interface DateSelectArg extends DateSpanApi {\n jsEvent: MouseEvent | null\n view: ViewApi\n}\n\nexport function triggerDateSelect(selection: DateSpan, pev: PointerDragEvent | null, context: CalendarContext & { viewApi?: ViewApi }) {\n context.emitter.trigger('select', {\n ...buildDateSpanApiWithContext(selection, context),\n jsEvent: pev ? pev.origEvent as MouseEvent : null, // Is this always a mouse event? See #4655\n view: context.viewApi || context.calendarApi.view,\n } as DateSelectArg)\n}\n\nexport interface DateUnselectArg {\n jsEvent: MouseEvent\n view: ViewApi\n}\n\nexport function triggerDateUnselect(pev: PointerDragEvent | null, context: CalendarContext & { viewApi?: ViewApi }) {\n context.emitter.trigger('unselect', {\n jsEvent: pev ? pev.origEvent : null,\n view: context.viewApi || context.calendarApi.view,\n } as DateUnselectArg)\n}\n\nexport function buildDateSpanApiWithContext(dateSpan: DateSpan, context: CalendarContext) {\n let props = {} as DateSpanApi\n\n for (let transform of context.pluginHooks.dateSpanTransforms) {\n __assign(props, transform(dateSpan, context))\n }\n\n __assign(props, buildDateSpanApi(dateSpan, context.dateEnv))\n\n return props\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\nexport function getDefaultEventEnd(allDay: boolean, marker: DateMarker, context: CalendarContext): DateMarker {\n let { dateEnv, options } = context\n let end = marker\n\n if (allDay) {\n end = startOfDay(end)\n end = dateEnv.add(end, options.defaultAllDayEventDuration)\n } else {\n end = dateEnv.add(end, options.defaultTimedEventDuration)\n }\n\n return end\n}\n","import { Duration } from '../datelib/duration'\nimport { EventStore, createEmptyEventStore } from './event-store'\nimport { EventDef } from './event-def'\nimport { EventInstance } from './event-instance'\nimport { computeAlignedDayRange } from '../util/date'\nimport { startOfDay } from '../datelib/marker'\nimport { EventUiHash, EventUi } from '../component/event-ui'\nimport { compileEventUis } from '../component/event-rendering'\nimport { CalendarContext } from '../CalendarContext'\nimport { getDefaultEventEnd } from '../calendar-utils'\n\n/*\nA data structure for how to modify an EventDef/EventInstance within an EventStore\n*/\n\nexport interface EventMutation {\n datesDelta?: Duration // body start+end moving together. for dragging\n startDelta?: Duration // for resizing\n endDelta?: Duration // for resizing\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(\n eventStore: EventStore,\n eventConfigBase: EventUiHash,\n mutation: EventMutation,\n context: CalendarContext,\n): 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, context)\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, context)\n }\n\n return dest\n}\n\nexport type eventDefMutationApplier = (eventDef: EventDef, mutation: EventMutation, context: CalendarContext) => void\n\nfunction applyMutationToEventDef(eventDef: EventDef, eventConfig: EventUi, mutation: EventMutation, context: CalendarContext): 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 (mutation.startDelta || mutation.endDelta)\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 context.pluginHooks.eventDefMutationAppliers) {\n applier(copy, mutation, context)\n }\n\n if (!copy.hasEnd && context.options.forceEventDuration) {\n copy.hasEnd = true\n }\n\n return copy\n}\n\nfunction applyMutationToEventInstance(\n eventInstance: EventInstance,\n eventDef: EventDef, // must first be modified by applyMutationToEventDef\n eventConfig: EventUi,\n mutation: EventMutation,\n context: CalendarContext,\n): EventInstance {\n let { dateEnv } = context\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.datesDelta && eventConfig.startEditable) {\n copy.range = {\n start: dateEnv.add(copy.range.start, mutation.datesDelta),\n end: dateEnv.add(copy.range.end, mutation.datesDelta),\n }\n }\n\n if (mutation.startDelta && eventConfig.durationEditable) {\n copy.range = {\n start: dateEnv.add(copy.range.start, mutation.startDelta),\n end: copy.range.end,\n }\n }\n\n if (mutation.endDelta && eventConfig.durationEditable) {\n copy.range = {\n start: copy.range.start,\n end: dateEnv.add(copy.range.end, mutation.endDelta),\n }\n }\n\n if (clearEnd) {\n copy.range = {\n start: copy.range.start,\n end: getDefaultEventEnd(eventDef.allDay, copy.range.start, context),\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 = getDefaultEventEnd(eventDef.allDay, copy.range.start, context)\n }\n\n return copy\n}\n","import { DateEnv } from './datelib/env'\nimport { CalendarData } from './reducers/data-types'\n\n// no public types yet. when there are, export from:\n// import {} from './api-type-deps'\n\nexport class ViewApi { // always represents the current view. otherwise, it'd need to change value every time date changes\n constructor(\n public type: string,\n private getCurrentData: () => CalendarData,\n private dateEnv: DateEnv,\n ) {\n }\n\n get calendar() {\n return this.getCurrentData().calendarApi\n }\n\n get title() {\n return this.getCurrentData().viewTitle\n }\n\n get activeStart() {\n return this.dateEnv.toDate(this.getCurrentData().dateProfile.activeRange.start)\n }\n\n get activeEnd() {\n return this.dateEnv.toDate(this.getCurrentData().dateProfile.activeRange.end)\n }\n\n get currentStart() {\n return this.dateEnv.toDate(this.getCurrentData().dateProfile.currentRange.start)\n }\n\n get currentEnd() {\n return this.dateEnv.toDate(this.getCurrentData().dateProfile.currentRange.end)\n }\n\n getOption(name: string) {\n return this.getCurrentData().options[name] // are the view-specific options\n }\n}\n","import { EventInput, EventInputTransformer } from './event-parse'\nimport { EventSourceFunc } from '../event-sources/func-event-source'\nimport { EventSource, EventSourceSuccessResponseHandler, EventSourceErrorResponseHandler } from './event-source'\nimport { JSON_FEED_EVENT_SOURCE_REFINERS } from '../event-sources/json-feed-event-source-refiners'\nimport { CalendarContext } from '../CalendarContext'\nimport { guid } from '../util/misc'\nimport { EVENT_UI_REFINERS, createEventUi, EventUiInput, EventUiRefined } from '../component/event-ui'\nimport { identity, Identity, RawOptionsFromRefiners, refineProps, RefinedOptionsFromRefiners } from '../options'\n\nconst EVENT_SOURCE_REFINERS = { // does NOT include EVENT_UI_REFINERS\n id: String,\n defaultAllDay: Boolean,\n url: String,\n format: String,\n events: identity as Identity<EventInput[] | EventSourceFunc>, // array or function\n eventDataTransform: identity as Identity<EventInputTransformer>,\n\n // for any network-related sources\n success: identity as Identity<EventSourceSuccessResponseHandler>,\n failure: identity as Identity<EventSourceErrorResponseHandler>,\n}\n\ntype BuiltInEventSourceRefiners = typeof EVENT_SOURCE_REFINERS &\n typeof JSON_FEED_EVENT_SOURCE_REFINERS\n\nexport interface EventSourceRefiners extends BuiltInEventSourceRefiners {\n // for extending\n}\n\nexport type EventSourceInputObject =\n EventUiInput &\n RawOptionsFromRefiners<Required<EventSourceRefiners>> // Required hack\n\nexport type EventSourceInput =\n EventSourceInputObject | // object in extended form\n EventInput[] |\n EventSourceFunc | // just a function\n string // a URL for a JSON feed\n\nexport type EventSourceRefined =\n EventUiRefined &\n RefinedOptionsFromRefiners<Required<EventSourceRefiners>> // Required hack\n\nexport function parseEventSource(\n raw: EventSourceInput,\n context: CalendarContext,\n refiners = buildEventSourceRefiners(context),\n): EventSource<any> | null {\n let rawObj: EventSourceInputObject\n\n if (typeof raw === 'string') {\n rawObj = { url: raw }\n } else if (typeof raw === 'function' || Array.isArray(raw)) {\n rawObj = { events: raw }\n } else if (typeof raw === 'object' && raw) { // not null\n rawObj = raw\n }\n\n if (rawObj) {\n let { refined, extra } = refineProps(rawObj, refiners)\n let metaRes = buildEventSourceMeta(refined, context)\n\n if (metaRes) {\n return {\n _raw: raw,\n isFetching: false,\n latestFetchId: '',\n fetchRange: null,\n defaultAllDay: refined.defaultAllDay,\n eventDataTransform: refined.eventDataTransform,\n success: refined.success,\n failure: refined.failure,\n publicId: refined.id || '',\n sourceId: guid(),\n sourceDefId: metaRes.sourceDefId,\n meta: metaRes.meta,\n ui: createEventUi(refined, context),\n extendedProps: extra,\n }\n }\n }\n\n return null\n}\n\nexport function buildEventSourceRefiners(context: CalendarContext) {\n return { ...EVENT_UI_REFINERS, ...EVENT_SOURCE_REFINERS, ...context.pluginHooks.eventSourceRefiners }\n}\n\nfunction buildEventSourceMeta(raw: EventSourceRefined, context: CalendarContext) {\n let defs = context.pluginHooks.eventSourceDefs\n\n for (let i = defs.length - 1; i >= 0; i -= 1) { // later-added plugins take precedence\n let def = defs[i]\n let meta = def.parseMeta(raw)\n\n if (meta) {\n return { sourceDefId: i, meta }\n }\n }\n\n return null\n}\n","import { DateEnv, DateInput } from '../datelib/env'\nimport { DateMarker } from '../datelib/marker'\nimport { Action } from './Action'\nimport { BaseOptionsRefined } from '../options'\n\nexport function reduceCurrentDate(currentDate: DateMarker, action: Action) {\n switch (action.type) {\n case 'CHANGE_DATE':\n return action.dateMarker\n default:\n return currentDate\n }\n}\n\nexport function getInitialDate(options: BaseOptionsRefined, dateEnv: DateEnv) {\n let initialDateInput = options.initialDate\n\n // compute the initial ambig-timezone date\n if (initialDateInput != null) {\n return dateEnv.createMarker(initialDateInput)\n }\n return getNow(options.now, dateEnv) // getNow already returns unzoned\n}\n\nexport function getNow(nowInput: DateInput | (() => DateInput), dateEnv: DateEnv) {\n if (typeof nowInput === 'function') {\n nowInput = nowInput()\n }\n\n if (nowInput == null) {\n return dateEnv.createNowMarker()\n }\n\n return dateEnv.createMarker(nowInput)\n}\n","import { DateMarker } from './datelib/marker'\nimport { createFormatter } from './datelib/formatting'\nimport { createDuration } from './datelib/duration'\nimport { parseDateSpan } from './structs/date-span'\nimport { parseEventSource } from './structs/event-source-parse'\nimport { parseEvent } from './structs/event-parse'\nimport { eventTupleToStore } from './structs/event-store'\nimport { ViewSpec } from './structs/view-spec'\nimport { PointerDragEvent } from './interactions/pointer'\nimport { getNow } from './reducers/current-date'\nimport { triggerDateSelect, triggerDateUnselect } from './calendar-utils'\nimport { hashValuesToArray } from './util/object'\nimport { CalendarDataManager } from './reducers/CalendarDataManager'\nimport { Action } from './reducers/Action'\nimport { EventSource } from './structs/event-source'\nimport { eventApiToStore, buildEventApis } from './api/EventApi'\n\n// public\nimport {\n CalendarOptions,\n CalendarListeners,\n DateInput,\n DurationInput,\n DateSpanInput,\n DateRangeInput,\n EventSourceInput,\n EventInput,\n EventSourceApi,\n EventApi,\n ViewApi,\n} from './api-type-deps'\n\nexport class CalendarApi {\n currentDataManager?: CalendarDataManager // will be set by CalendarDataManager\n\n getCurrentData() {\n return this.currentDataManager!.getCurrentData()\n }\n\n dispatch(action: Action) {\n return this.currentDataManager!.dispatch(action)\n }\n\n get view(): ViewApi { return this.getCurrentData().viewApi } // for public API\n\n batchRendering(callback: () => void) { // subclasses should implement\n callback()\n }\n\n updateSize() { // public\n this.trigger('_resize', true)\n }\n\n // Options\n // -----------------------------------------------------------------------------------------------------------------\n\n setOption<OptionName extends keyof CalendarOptions>(name: OptionName, val: CalendarOptions[OptionName]) {\n this.dispatch({\n type: 'SET_OPTION',\n optionName: name,\n rawOptionValue: val,\n })\n }\n\n getOption<OptionName extends keyof CalendarOptions>(name: OptionName): CalendarOptions[OptionName] { // getter, used externally. WTF TS\n return this.currentDataManager!.currentCalendarOptionsInput[name]\n }\n\n getAvailableLocaleCodes() {\n return Object.keys(this.getCurrentData().availableRawLocales)\n }\n\n // Trigger\n // -----------------------------------------------------------------------------------------------------------------\n\n on<ListenerName extends keyof CalendarListeners>(handlerName: ListenerName, handler: CalendarListeners[ListenerName]) {\n let { currentDataManager } = this\n\n if (currentDataManager.currentCalendarOptionsRefiners[handlerName]) {\n currentDataManager.emitter.on(handlerName, handler)\n } else {\n console.warn(`Unknown listener name '${handlerName}'`)\n }\n }\n\n off<ListenerName extends keyof CalendarListeners>(handlerName: ListenerName, handler: CalendarListeners[ListenerName]) {\n this.currentDataManager!.emitter.off(handlerName, handler)\n }\n\n // not meant for public use\n trigger<ListenerName extends keyof CalendarListeners>(handlerName: ListenerName, ...args: Parameters<CalendarListeners[ListenerName]>) {\n this.currentDataManager!.emitter.trigger(handlerName, ...args)\n }\n\n // View\n // -----------------------------------------------------------------------------------------------------------------\n\n changeView(viewType: string, dateOrRange?: DateRangeInput | DateInput) {\n this.batchRendering(() => {\n this.unselect()\n\n if (dateOrRange) {\n if ((dateOrRange as DateRangeInput).start && (dateOrRange as DateRangeInput).end) { // a range\n this.dispatch({\n type: 'CHANGE_VIEW_TYPE',\n viewType,\n })\n this.dispatch({ // not very efficient to do two dispatches\n type: 'SET_OPTION',\n optionName: 'visibleRange',\n rawOptionValue: dateOrRange,\n })\n } else {\n let { dateEnv } = this.getCurrentData()\n\n this.dispatch({\n type: 'CHANGE_VIEW_TYPE',\n viewType,\n dateMarker: dateEnv.createMarker(dateOrRange as DateInput),\n })\n }\n } else {\n this.dispatch({\n type: 'CHANGE_VIEW_TYPE',\n viewType,\n })\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 state = this.getCurrentData()\n let spec\n\n viewType = viewType || 'day' // day is default zoom\n spec = state.viewSpecs[viewType] || this.getUnitViewSpec(viewType)\n\n this.unselect()\n\n if (spec) {\n this.dispatch({\n type: 'CHANGE_VIEW_TYPE',\n viewType: spec.type,\n dateMarker,\n })\n } else {\n this.dispatch({\n type: 'CHANGE_DATE',\n dateMarker,\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 private getUnitViewSpec(unit: string): ViewSpec | null {\n let { viewSpecs, toolbarConfig } = this.getCurrentData()\n let viewTypes = [].concat(toolbarConfig.viewsWithButtons)\n let i\n let spec\n\n for (let viewType in viewSpecs) {\n viewTypes.push(viewType)\n }\n\n for (i = 0; i < viewTypes.length; i += 1) {\n spec = viewSpecs[viewTypes[i]]\n if (spec) {\n if (spec.singleUnit === unit) {\n return spec\n }\n }\n }\n\n return null\n }\n\n // Current Date\n // -----------------------------------------------------------------------------------------------------------------\n\n prev() {\n this.unselect()\n this.dispatch({ type: 'PREV' })\n }\n\n next() {\n this.unselect()\n this.dispatch({ type: 'NEXT' })\n }\n\n prevYear() {\n let state = this.getCurrentData()\n this.unselect()\n this.dispatch({\n type: 'CHANGE_DATE',\n dateMarker: state.dateEnv.addYears(state.currentDate, -1),\n })\n }\n\n nextYear() {\n let state = this.getCurrentData()\n\n this.unselect()\n this.dispatch({\n type: 'CHANGE_DATE',\n dateMarker: state.dateEnv.addYears(state.currentDate, 1),\n })\n }\n\n today() {\n let state = this.getCurrentData()\n\n this.unselect()\n this.dispatch({\n type: 'CHANGE_DATE',\n dateMarker: getNow(state.calendarOptions.now, state.dateEnv),\n })\n }\n\n gotoDate(zonedDateInput) {\n let state = this.getCurrentData()\n\n this.unselect()\n this.dispatch({\n type: 'CHANGE_DATE',\n dateMarker: state.dateEnv.createMarker(zonedDateInput),\n })\n }\n\n incrementDate(deltaInput) { // is public facing\n let state = this.getCurrentData()\n let delta = createDuration(deltaInput)\n\n if (delta) { // else, warn about invalid input?\n this.unselect()\n this.dispatch({\n type: 'CHANGE_DATE',\n dateMarker: state.dateEnv.add(state.currentDate, delta),\n })\n }\n }\n\n // for external API\n getDate(): Date {\n let state = this.getCurrentData()\n return state.dateEnv.toDate(state.currentDate)\n }\n\n // Date Formatting Utils\n // -----------------------------------------------------------------------------------------------------------------\n\n formatDate(d: DateInput, formatter): string {\n let { dateEnv } = this.getCurrentData()\n\n return dateEnv.format(\n dateEnv.createMarker(d),\n createFormatter(formatter),\n )\n }\n\n // `settings` is for formatter AND isEndExclusive\n formatRange(d0: DateInput, d1: DateInput, settings) {\n let { dateEnv } = this.getCurrentData()\n\n return dateEnv.formatRange(\n dateEnv.createMarker(d0),\n dateEnv.createMarker(d1),\n createFormatter(settings),\n settings,\n )\n }\n\n formatIso(d: DateInput, omitTime?: boolean) {\n let { dateEnv } = this.getCurrentData()\n\n return dateEnv.formatIso(dateEnv.createMarker(d), { omitTime })\n }\n\n // Date Selection / Event Selection / DayClick\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 state = this.getCurrentData()\n let selection = parseDateSpan(\n selectionInput,\n state.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 triggerDateSelect(selection, null, state)\n }\n }\n\n // public method\n unselect(pev?: PointerDragEvent) {\n let state = this.getCurrentData()\n\n if (state.dateSelection) {\n this.dispatch({ type: 'UNSELECT_DATES' })\n triggerDateUnselect(pev, state)\n }\n }\n\n // Public Events API\n // -----------------------------------------------------------------------------------------------------------------\n\n addEvent(eventInput: EventInput, sourceInput?: EventSourceApi | string | boolean): EventApi | null {\n if (eventInput instanceof EventApi) {\n let def = eventInput._def\n let instance = eventInput._instance\n let currentData = this.getCurrentData()\n\n // not already present? don't want to add an old snapshot\n if (!currentData.eventStore.defs[def.defId]) {\n this.dispatch({\n type: 'ADD_EVENTS',\n eventStore: eventTupleToStore({ def, instance }), // TODO: better util for two args?\n })\n this.triggerEventAdd(eventInput)\n }\n\n return eventInput\n }\n\n let state = this.getCurrentData()\n let eventSource: EventSource<any>\n\n if (sourceInput instanceof EventSourceApi) {\n eventSource = sourceInput.internalEventSource\n } else if (typeof sourceInput === 'boolean') {\n if (sourceInput) { // true. part of the first event source\n [eventSource] = hashValuesToArray(state.eventSources)\n }\n } else if (sourceInput != null) { // an ID. accepts a number too\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 }\n eventSource = sourceApi.internalEventSource\n }\n\n let tuple = parseEvent(eventInput, eventSource, state, false)\n\n if (tuple) {\n let newEventApi = new EventApi(\n state,\n tuple.def,\n tuple.def.recurringDef ? null : tuple.instance,\n )\n this.dispatch({\n type: 'ADD_EVENTS',\n eventStore: eventTupleToStore(tuple),\n })\n this.triggerEventAdd(newEventApi)\n\n return newEventApi\n }\n\n return null\n }\n\n private triggerEventAdd(eventApi: EventApi) {\n let { emitter } = this.getCurrentData()\n\n emitter.trigger('eventAdd', {\n event: eventApi,\n relatedEvents: [],\n revert: () => {\n this.dispatch({\n type: 'REMOVE_EVENTS',\n eventStore: eventApiToStore(eventApi),\n })\n },\n })\n }\n\n // TODO: optimize\n getEventById(id: string): EventApi | null {\n let state = this.getCurrentData()\n let { defs, instances } = state.eventStore\n id = String(id)\n\n for (let defId in defs) {\n let def = defs[defId]\n\n if (def.publicId === id) {\n if (def.recurringDef) {\n return new EventApi(state, def, null)\n }\n\n for (let instanceId in instances) {\n let instance = instances[instanceId]\n\n if (instance.defId === def.defId) {\n return new EventApi(state, def, instance)\n }\n }\n }\n }\n\n return null\n }\n\n getEvents(): EventApi[] {\n let currentData = this.getCurrentData()\n\n return buildEventApis(currentData.eventStore, currentData)\n }\n\n removeAllEvents() {\n this.dispatch({ type: 'REMOVE_ALL_EVENTS' })\n }\n\n // Public Event Sources API\n // -----------------------------------------------------------------------------------------------------------------\n\n getEventSources(): EventSourceApi[] {\n let state = this.getCurrentData()\n let sourceHash = state.eventSources\n let sourceApis: EventSourceApi[] = []\n\n for (let internalId in sourceHash) {\n sourceApis.push(new EventSourceApi(state, sourceHash[internalId]))\n }\n\n return sourceApis\n }\n\n getEventSourceById(id: string): EventSourceApi | null {\n let state = this.getCurrentData()\n let sourceHash = state.eventSources\n id = String(id)\n\n for (let sourceId in sourceHash) {\n if (sourceHash[sourceId].publicId === id) {\n return new EventSourceApi(state, sourceHash[sourceId])\n }\n }\n\n return null\n }\n\n addEventSource(sourceInput: EventSourceInput): EventSourceApi {\n let state = this.getCurrentData()\n\n if (sourceInput instanceof EventSourceApi) {\n // not already present? don't want to add an old snapshot\n if (!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, state)\n\n if (eventSource) { // TODO: error otherwise?\n this.dispatch({ type: 'ADD_EVENT_SOURCES', sources: [eventSource] })\n\n return new EventSourceApi(state, eventSource)\n }\n\n return null\n }\n\n removeAllEventSources() {\n this.dispatch({ type: 'REMOVE_ALL_EVENT_SOURCES' })\n }\n\n refetchEvents() {\n this.dispatch({ type: 'FETCH_EVENT_SOURCES', isRefetch: true })\n }\n\n // Scroll\n // -----------------------------------------------------------------------------------------------------------------\n\n scrollToTime(timeInput: DurationInput) {\n let time = createDuration(timeInput)\n\n if (time) {\n this.trigger('_scrollRequest', { time })\n }\n }\n}\n","import { __assign } from 'tslib'\nimport { EventDef } from '../structs/event-def'\nimport { EVENT_NON_DATE_REFINERS, EVENT_DATE_REFINERS } from '../structs/event-parse'\nimport { EventInstance } from '../structs/event-instance'\nimport { EVENT_UI_REFINERS, EventUiHash } from '../component/event-ui'\nimport { EventMutation, applyMutationToEventStore } from '../structs/event-mutation'\nimport { diffDates, computeAlignedDayRange } from '../util/date'\nimport { createDuration, durationsEqual } from '../datelib/duration'\nimport { createFormatter } from '../datelib/formatting'\nimport { CalendarContext } from '../CalendarContext'\nimport { getRelevantEvents, EventStore } from '../structs/event-store'\nimport { Dictionary } from '../options'\n\n// public\nimport {\n DateInput,\n DurationInput,\n FormatterInput,\n EventSourceApi,\n} from '../api-type-deps'\n\nexport class EventApi {\n _context: CalendarContext\n _def: EventDef\n _instance: EventInstance | null\n // instance will be null if expressing a recurring event that has no current instances,\n // OR if trying to validate an incoming external event that has no dates assigned\n\n constructor(context: CalendarContext, def: EventDef, instance?: EventInstance) {\n this._context = context\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: any) {\n if (name in EVENT_DATE_REFINERS) {\n console.warn('Could not set date-related prop \\'name\\'. Use one of the date-related methods instead.')\n // TODO: make proper aliasing system?\n } else if (name === 'id') {\n val = EVENT_NON_DATE_REFINERS[name](val)\n\n this.mutate({\n standardProps: { publicId: val }, // hardcoded internal name\n })\n } else if (name in EVENT_NON_DATE_REFINERS) {\n val = EVENT_NON_DATE_REFINERS[name](val)\n\n this.mutate({\n standardProps: { [name]: val },\n })\n } else if (name in EVENT_UI_REFINERS) {\n let ui = EVENT_UI_REFINERS[name](val)\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 } else {\n console.warn(`Could not set prop '${name}'. Use setExtendedProp instead.`)\n }\n }\n\n setExtendedProp(name: string, val: any) {\n this.mutate({\n extendedProps: { [name]: val },\n })\n }\n\n setStart(startInput: DateInput, options: { granularity?: string, maintainDuration?: boolean } = {}) {\n let { dateEnv } = this._context\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\n if (options.maintainDuration) {\n this.mutate({ datesDelta: startDelta })\n } else {\n this.mutate({ startDelta })\n }\n }\n }\n\n setEnd(endInput: DateInput | null, options: { granularity?: string } = {}) {\n let { dateEnv } = this._context\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._context\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\n if (durationsEqual(startDelta, endDelta)) {\n this.mutate({ datesDelta: startDelta, standardProps })\n } else {\n this.mutate({ startDelta, endDelta, standardProps })\n }\n } else { // means \"clear the end\"\n standardProps.hasEnd = false\n this.mutate({ datesDelta: 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({ datesDelta: delta })\n }\n }\n\n setAllDay(allDay: boolean, options: { maintainDuration?: boolean } = {}) {\n let standardProps = { allDay } as any\n let { maintainDuration } = options\n\n if (maintainDuration == null) {\n maintainDuration = this._context.options.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._context\n let instance = this._instance\n let formatter = createFormatter(formatInput)\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 }\n return dateEnv.format(instance.range.start, formatter, {\n forcedTzo: instance.forcedStartTzo,\n })\n }\n\n mutate(mutation: EventMutation) { // meant to be private. but plugins need access\n let instance = this._instance\n\n if (instance) {\n let def = this._def\n let context = this._context\n let { eventStore } = context.getCurrentData()\n let relevantEvents = getRelevantEvents(eventStore, instance.instanceId)\n let eventConfigBase = {\n '': { // HACK. always allow API to mutate events\n display: '',\n startEditable: true,\n durationEditable: true,\n constraints: [],\n overlap: null,\n allows: [],\n backgroundColor: '',\n borderColor: '',\n textColor: '',\n classNames: [],\n },\n } as EventUiHash\n\n relevantEvents = applyMutationToEventStore(relevantEvents, eventConfigBase, mutation, context)\n\n let oldEvent = new EventApi(context, def, instance) // snapshot\n this._def = relevantEvents.defs[def.defId]\n this._instance = relevantEvents.instances[instance.instanceId]\n\n context.dispatch({\n type: 'MERGE_EVENTS',\n eventStore: relevantEvents,\n })\n\n context.emitter.trigger('eventChange', {\n oldEvent,\n event: this,\n relatedEvents: buildEventApis(relevantEvents, context, instance),\n revert() {\n context.dispatch({\n type: 'RESET_EVENTS',\n eventStore, // the ORIGINAL store\n })\n },\n })\n }\n }\n\n remove() {\n let context = this._context\n let asStore = eventApiToStore(this)\n\n context.dispatch({\n type: 'REMOVE_EVENTS',\n eventStore: asStore,\n })\n\n context.emitter.trigger('eventRemove', {\n event: this,\n relatedEvents: [],\n revert() {\n context.dispatch({\n type: 'MERGE_EVENTS',\n eventStore: asStore,\n })\n },\n })\n }\n\n get source(): EventSourceApi | null {\n let { sourceId } = this._def\n\n if (sourceId) {\n return new EventSourceApi(\n this._context,\n this._context.getCurrentData().eventSources[sourceId],\n )\n }\n return null\n }\n\n get start(): Date | null {\n return this._instance ?\n this._context.dateEnv.toDate(this._instance.range.start) :\n null\n }\n\n get end(): Date | null {\n return (this._instance && this._def.hasEnd) ?\n this._context.dateEnv.toDate(this._instance.range.end) :\n null\n }\n\n get startStr(): string {\n let instance = this._instance\n if (instance) {\n return this._context.dateEnv.formatIso(instance.range.start, {\n omitTime: this._def.allDay,\n forcedTzo: instance.forcedStartTzo,\n })\n }\n return ''\n }\n\n get endStr(): string {\n let instance = this._instance\n if (instance && this._def.hasEnd) {\n return this._context.dateEnv.formatIso(instance.range.end, {\n omitTime: this._def.allDay,\n forcedTzo: instance.forcedEndTzo,\n })\n }\n return ''\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() { return this._def.publicId }\n get groupId() { return this._def.groupId }\n get allDay() { return this._def.allDay }\n get title() { return this._def.title }\n get url() { return this._def.url }\n get display() { return this._def.ui.display || 'auto' } // bad. just normalize the type earlier\n get startEditable() { return this._def.ui.startEditable }\n get durationEditable() { return this._def.ui.durationEditable }\n get constraint() { return this._def.ui.constraints[0] || null }\n get overlap() { return this._def.ui.overlap }\n get allow() { return this._def.ui.allows[0] || null }\n get backgroundColor() { return this._def.ui.backgroundColor }\n get borderColor() { return this._def.ui.borderColor }\n get textColor() { 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() { return this._def.ui.classNames }\n get extendedProps() { return this._def.extendedProps }\n\n toPlainObject(settings: { collapseExtendedProps?: boolean, collapseColor?: boolean } = {}): Dictionary {\n let def = this._def\n let { ui } = def\n let { startStr, endStr } = this\n let res: Dictionary = {}\n\n if (def.title) {\n res.title = def.title\n }\n\n if (startStr) {\n res.start = startStr\n }\n\n if (endStr) {\n res.end = endStr\n }\n\n if (def.publicId) {\n res.id = def.publicId\n }\n\n if (def.groupId) {\n res.groupId = def.groupId\n }\n\n if (def.url) {\n res.url = def.url\n }\n\n if (ui.display && ui.display !== 'auto') {\n res.display = ui.display\n }\n\n // TODO: what about recurring-event properties???\n // TODO: include startEditable/durationEditable/constraint/overlap/allow\n\n if (settings.collapseColor && ui.backgroundColor && ui.backgroundColor === ui.borderColor) {\n res.color = ui.backgroundColor\n } else {\n if (ui.backgroundColor) {\n res.backgroundColor = ui.backgroundColor\n }\n if (ui.borderColor) {\n res.borderColor = ui.borderColor\n }\n }\n\n if (ui.textColor) {\n res.textColor = ui.textColor\n }\n\n if (ui.classNames.length) {\n res.classNames = ui.classNames\n }\n\n if (Object.keys(def.extendedProps).length) {\n if (settings.collapseExtendedProps) {\n __assign(res, def.extendedProps)\n } else {\n res.extendedProps = def.extendedProps\n }\n }\n\n return res\n }\n\n toJSON() {\n return this.toPlainObject()\n }\n}\n\nexport function eventApiToStore(eventApi: EventApi): EventStore {\n let def = eventApi._def\n let instance = eventApi._instance\n\n return {\n defs: { [def.defId]: def },\n instances: instance\n ? { [instance.instanceId]: instance }\n : {},\n }\n}\n\nexport function buildEventApis(eventStore: EventStore, context: CalendarContext, excludeInstance?: EventInstance): EventApi[] {\n let { defs, instances } = eventStore\n let eventApis: EventApi[] = []\n let excludeInstanceId = excludeInstance ? excludeInstance.instanceId : ''\n\n for (let id in instances) {\n let instance = instances[id]\n let def = defs[instance.defId]\n\n if (instance.instanceId !== excludeInstanceId) {\n eventApis.push(new EventApi(context, def, instance))\n }\n }\n\n return eventApis\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\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\nclass GregorianCalendarSystem implements CalendarSystem {\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\nregisterCalendarSystem('gregory', GregorianCalendarSystem)\n","import { isValidDate } from './marker'\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, CmdFormatterFunc } from './DateFormatter'\nimport { buildIsoString } from './formatting-utils'\nimport { parse } from './parsing'\nimport { isInt } from '../util/misc'\n\nexport type WeekNumberCalculation = 'local' | 'ISO' | ((m: Date) => number)\n\nexport interface DateEnvSettings {\n timeZone: string\n namedTimeZoneImpl?: NamedTimeZoneImplClass\n calendarSystem: string\n locale: Locale\n weekNumberCalculation?: WeekNumberCalculation\n firstDay?: number, // will override what the locale wants\n weekText?: string,\n cmdFormatter?: CmdFormatterFunc\n defaultSeparator?: string\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\nexport class DateEnv {\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 weekText: string // DON'T LIKE how options are confused with local\n cmdFormatter?: CmdFormatterFunc\n defaultSeparator: string\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 }\n\n 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.weekText = settings.weekText != null ? settings.weekText : settings.locale.options.weekText\n\n this.cmdFormatter = settings.cmdFormatter\n this.defaultSeparator = settings.defaultSeparator\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 }\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 createMarkerMeta(input: DateInput): DateMarkerMeta {\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\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 // 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 // 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 // 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 // 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 // Start-Of\n // these DON'T return zoned-dates. only UTC start-of dates\n\n startOf(m: DateMarker, unit: string) {\n if (unit === 'year') {\n return this.startOfYear(m)\n }\n if (unit === 'month') {\n return this.startOfMonth(m)\n }\n if (unit === 'week') {\n return this.startOfWeek(m)\n }\n if (unit === 'day') {\n return startOfDay(m)\n }\n if (unit === 'hour') {\n return startOfHour(m)\n }\n if (unit === 'minute') {\n return startOfMinute(m)\n }\n if (unit === 'second') {\n return startOfSecond(m)\n }\n return null\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 // Week Number\n\n computeWeekNumber(marker: DateMarker): number {\n if (this.weekNumberFunc) {\n return this.weekNumberFunc(this.toDate(marker))\n }\n return weekOfYear(marker, this.weekDow, this.weekDoy)\n }\n\n // TODO: choke on timeZoneName: long\n format(marker: DateMarker, formatter: DateFormatter, dateOptions: { forcedTzo?: number } = {}) {\n return formatter.format(\n {\n marker,\n timeZoneOffset: dateOptions.forcedTzo != null ?\n dateOptions.forcedTzo :\n this.offsetForMarker(marker),\n },\n this,\n )\n }\n\n formatRange(\n start: DateMarker,\n end: DateMarker,\n formatter: DateFormatter,\n dateOptions: { forcedStartTzo?: number, forcedEndTzo?: number, isEndExclusive?: boolean, defaultSeparator?: string } = {},\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 dateOptions.defaultSeparator,\n )\n }\n\n /*\n DUMB: the omitTime arg is dumb. if we omit the time, we want to omit the timezone offset. and if we do that,\n might as well use buildIsoString or some other util directly\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 // TimeZone\n\n timestampToMarker(ms: number) {\n if (this.timeZone === 'local') {\n return arrayToUtcDate(dateToLocalArray(new Date(ms)))\n } if (this.timeZone === 'UTC' || !this.namedTimeZoneImpl) {\n return new Date(ms)\n }\n return arrayToUtcDate(this.namedTimeZoneImpl.timestampToArray(ms))\n }\n\n offsetForMarker(m: DateMarker) {\n if (this.timeZone === 'local') {\n return -arrayToLocalDate(dateToUtcArray(m)).getTimezoneOffset() // convert \"inverse\" offset to \"normal\" offset\n } if (this.timeZone === 'UTC') {\n return 0\n } if (this.namedTimeZoneImpl) {\n return this.namedTimeZoneImpl.offsetForArray(dateToUtcArray(m))\n }\n return null\n }\n\n // Conversion\n\n toDate(m: DateMarker, forcedTzo?: number): Date {\n if (this.timeZone === 'local') {\n return arrayToLocalDate(dateToUtcArray(m))\n }\n\n if (this.timeZone === 'UTC') {\n return new Date(m.valueOf()) // make sure it's a copy\n }\n\n if (!this.namedTimeZoneImpl) {\n return new Date(m.valueOf() - (forcedTzo || 0))\n }\n\n return new Date(\n m.valueOf() -\n this.namedTimeZoneImpl.offsetForArray(dateToUtcArray(m)) * 1000 * 60, // convert minutes -> ms\n )\n }\n}\n","import { LocaleInput } from './datelib/locale'\n\nexport const globalLocales: LocaleInput[] = []\n","import { mergeProps } from '../util/object'\nimport { globalLocales } from '../global-locales' // weird to be importing this\nimport { CalendarOptions, CalendarOptionsRefined } from '../options'\n\nexport type LocaleCodeArg = string | string[]\nexport type LocaleSingularArg = LocaleCodeArg | LocaleInput\n\nexport interface Locale {\n codeArg: LocaleCodeArg\n codes: string[]\n week: { dow: number, doy: number }\n simpleNumberFormat: Intl.NumberFormat\n options: CalendarOptionsRefined\n}\n\nexport interface LocaleInput extends CalendarOptions {\n code: string\n}\n\nexport type LocaleInputMap = { [code: string]: LocaleInput }\n\nexport interface RawLocaleInfo {\n map: LocaleInputMap\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 direction: 'ltr' as ('ltr' | 'rtl'), // TODO: make a real type for this\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 weekText: 'W',\n allDayText: 'all-day',\n moreLinkText: 'more',\n noEventsText: 'No events to display',\n}\n\nexport function organizeRawLocales(explicitRawLocales: LocaleInput[]): RawLocaleInfo {\n let defaultCode = explicitRawLocales.length > 0 ? explicitRawLocales[0].code : 'en'\n let allRawLocales = globalLocales.concat(explicitRawLocales)\n let rawLocaleMap: LocaleInputMap = {\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: LocaleInputMap) {\n if (typeof inputSingular === 'object' && !Array.isArray(inputSingular)) {\n return parseLocale(\n inputSingular.code,\n [inputSingular.code],\n inputSingular,\n )\n }\n return queryLocale(inputSingular, available)\n}\n\nfunction queryLocale(codeArg: LocaleCodeArg, available: LocaleInputMap): 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: LocaleInputMap): LocaleInput {\n for (let i = 0; i < codes.length; i += 1) {\n let parts = codes[i].toLocaleLowerCase().split('-')\n\n for (let j = parts.length; j > 0; j -= 1) {\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: LocaleInput): Locale {\n let merged = mergeProps([RAW_EN_LOCALE, raw], ['buttonText'])\n\n delete merged.code // don't want this part of the options\n let { week } = merged\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 { DateEnv } from './datelib/env'\nimport { createFormatter } from './datelib/formatting'\nimport { NativeFormatterOptions } from './datelib/formatting-native'\nimport { organizeRawLocales, buildLocale } from './datelib/locale'\nimport { BASE_OPTION_DEFAULTS } from './options'\n\n// public\nimport { DateInput } from './api-type-deps'\n\nexport interface FormatDateOptions extends NativeFormatterOptions {\n locale?: string\n}\n\nexport interface FormatRangeOptions extends FormatDateOptions {\n separator?: string\n isEndExclusive?: boolean\n}\n\nexport function formatDate(dateInput: DateInput, options: FormatDateOptions = {}) {\n let dateEnv = buildDateEnv(options)\n let formatter = createFormatter(options)\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 options: FormatRangeOptions, // mixture of env and formatter settings\n) {\n let dateEnv = buildDateEnv(typeof options === 'object' && options ? options : {}) // pass in if non-null object\n let formatter = createFormatter(options)\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: options.isEndExclusive,\n defaultSeparator: BASE_OPTION_DEFAULTS.defaultRangeSeparator,\n })\n}\n\n// TODO: more DRY and optimized\nfunction buildDateEnv(settings: FormatRangeOptions) {\n let locale = buildLocale(settings.locale || 'en', organizeRawLocales([]).map) // TODO: don't hardcode 'en' everywhere\n\n return new DateEnv({\n timeZone: BASE_OPTION_DEFAULTS.timeZone,\n calendarSystem: 'gregory',\n ...settings,\n locale,\n })\n}\n","import { EventInput } from './event-parse'\nimport { EventStore, parseEvents } from './event-store'\nimport { CalendarContext } from '../CalendarContext'\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 display: 'inverse-background',\n classNames: 'fc-non-business',\n groupId: '_businessHours', // so multiple defs get grouped\n}\n\n/*\nTODO: pass around as EventDefHash!!!\n*/\nexport function parseBusinessHours(input: BusinessHoursInput, context: CalendarContext): EventStore {\n return parseEvents(\n refineInputs(input),\n null,\n context,\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((rawDef) => rawDef.daysOfWeek)\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((rawDef) => ({ ...DEF_DEFAULTS, ...rawDef }))\n\n return rawDefs\n}\n","export 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\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// 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\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// 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// 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// 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","let canVGrowWithinCell: boolean\n\nexport function getCanVGrowWithinCell() {\n if (canVGrowWithinCell == null) {\n canVGrowWithinCell = computeCanVGrowWithinCell()\n }\n return canVGrowWithinCell\n}\n\nfunction computeCanVGrowWithinCell() {\n // for SSR, because this function is call immediately at top-level\n // TODO: just make this logic execute top-level, immediately, instead of doing lazily\n if (typeof document === 'undefined') {\n return true\n }\n\n let el = document.createElement('div')\n el.style.position = 'absolute'\n el.style.top = '0px'\n el.style.left = '0px'\n el.innerHTML = '<table><tr><td><div></div></td></tr></table>'\n el.querySelector('table').style.height = '100px'\n el.querySelector('div').style.height = '100%'\n\n document.body.appendChild(el)\n\n let div = el.querySelector('div')\n let possible = div.offsetHeight > 0\n document.body.removeChild(el)\n return possible\n}\n","import { __assign } from 'tslib'\nimport { EventStore, createEmptyEventStore } from '../structs/event-store'\nimport { EventDef } from '../structs/event-def'\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'\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 abstract class Splitter<PropsType extends SplittableProps = SplittableProps> {\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 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) => this.eventUiBuilders[key] || memoize(buildEventUiForKey))\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) => this.getKeysForEventDef(eventDef))\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 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 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 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 = (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 }\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\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 { DateMarker, DAY_IDS } from '../datelib/marker'\nimport { rangeContainsMarker, DateRange } from '../datelib/date-range'\nimport { DateProfile } from '../DateProfileGenerator'\nimport { Theme } from '../theme/Theme'\n\nexport interface DateMeta {\n dow: number\n isDisabled: boolean\n isOther: boolean // like, is it in the non-current \"other\" month\n isToday: boolean\n isPast: boolean\n isFuture: boolean\n}\n\nexport function getDateMeta(date: DateMarker, todayRange?: DateRange, nowDate?: DateMarker, dateProfile?: DateProfile): DateMeta {\n return {\n dow: date.getUTCDay(),\n isDisabled: Boolean(dateProfile && !rangeContainsMarker(dateProfile.activeRange, date)),\n isOther: Boolean(dateProfile && !rangeContainsMarker(dateProfile.currentRange, date)),\n isToday: Boolean(todayRange && rangeContainsMarker(todayRange, date)),\n isPast: Boolean(nowDate ? (date < nowDate) : todayRange ? (date < todayRange.start) : false),\n isFuture: Boolean(nowDate ? (date > nowDate) : todayRange ? (date >= todayRange.end) : false),\n }\n}\n\nexport function getDayClassNames(meta: DateMeta, theme: Theme) {\n let classNames: string[] = [\n 'fc-day',\n `fc-day-${DAY_IDS[meta.dow]}`,\n ]\n\n if (meta.isDisabled) {\n classNames.push('fc-day-disabled')\n } else {\n if (meta.isToday) {\n classNames.push('fc-day-today')\n classNames.push(theme.getClass('today'))\n }\n\n if (meta.isPast) {\n classNames.push('fc-day-past')\n }\n\n if (meta.isFuture) {\n classNames.push('fc-day-future')\n }\n\n if (meta.isOther) {\n classNames.push('fc-day-other')\n }\n }\n\n return classNames\n}\n\nexport function getSlotClassNames(meta: DateMeta, theme: Theme) {\n let classNames: string[] = [\n 'fc-slot',\n `fc-slot-${DAY_IDS[meta.dow]}`,\n ]\n\n if (meta.isDisabled) {\n classNames.push('fc-slot-disabled')\n } else {\n if (meta.isToday) {\n classNames.push('fc-slot-today')\n classNames.push(theme.getClass('today'))\n }\n\n if (meta.isPast) {\n classNames.push('fc-slot-past')\n }\n\n if (meta.isFuture) {\n classNames.push('fc-slot-future')\n }\n }\n\n return classNames\n}\n","import { formatDayString } from '../datelib/formatting-utils'\nimport { DateMarker } from '../datelib/marker'\n\nexport function buildNavLinkData(date: DateMarker, type = 'day') {\n return JSON.stringify({\n date: formatDayString(date),\n type,\n })\n}\n","import { removeElement, applyStyle } from './dom-manip'\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 = document.createElement('div')\n applyStyle(outerEl, {\n position: 'absolute',\n top: -1000,\n left: 0,\n border: 0,\n padding: 0,\n overflow: 'scroll',\n direction: 'rtl',\n })\n outerEl.innerHTML = '<div></div>'\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","export interface ScrollbarWidths {\n x: number\n y: number // TODO: rename to vertical. less confusing when dealing with width/height verbage\n}\n\nlet _scrollbarWidths: ScrollbarWidths | undefined\n\nexport function getScrollbarWidths() { // TODO: way to force recompute?\n if (!_scrollbarWidths) {\n _scrollbarWidths = computeScrollbarWidths()\n }\n\n return _scrollbarWidths\n}\n\nfunction computeScrollbarWidths(): ScrollbarWidths {\n let el = document.createElement('div')\n el.style.overflow = 'scroll'\n el.style.position = 'absolute'\n el.style.top = '-9999px'\n el.style.left = '-9999px'\n document.body.appendChild(el)\n let res = computeScrollbarWidthsForEl(el)\n document.body.removeChild(el)\n return res\n}\n\n// WARNING: will include border\nexport function computeScrollbarWidthsForEl(el: HTMLElement): ScrollbarWidths {\n return {\n x: el.offsetHeight - el.clientHeight,\n y: el.offsetWidth - el.clientWidth,\n }\n}\n","import { intersectRects, Rect } from './geom'\nimport { getIsRtlScrollbarOnLeft } from './scrollbar-side'\nimport { computeScrollbarWidthsForEl } from './scrollbar-width'\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\nexport function computeEdges(el: HTMLElement, getPadding = false): EdgeInfo { // cache somehow?\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 badScrollbarWidths = computeScrollbarWidthsForEl(el) // includes border!\n let scrollbarLeftRight = badScrollbarWidths.y - borderLeft - borderRight\n let scrollbarBottom = badScrollbarWidths.x - borderTop - borderBottom\n\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\nexport function computeInnerRect(el, goWithinPadding = false, doFromWindowViewport?: boolean) {\n let outerRect = doFromWindowViewport ? el.getBoundingClientRect() : 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\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\nexport function computeClippedClientRect(el: HTMLElement): Rect | null {\n let clippingParents = getClippingParents(el)\n let rect: Rect = el.getBoundingClientRect()\n\n for (let clippingParent of clippingParents) {\n let intersection = intersectRects(rect, clippingParent.getBoundingClientRect())\n if (intersection) {\n rect = intersection\n } else {\n return null\n }\n }\n\n return rect\n}\n\nexport function computeHeightAndMargins(el: HTMLElement) {\n return el.getBoundingClientRect().height + computeVMargins(el)\n}\n\nexport function computeVMargins(el: HTMLElement) {\n let computed = window.getComputedStyle(el)\n\n return parseInt(computed.marginTop, 10) +\n parseInt(computed.marginBottom, 10)\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","// 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 // 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 () { // eslint-disable-line func-names\n if (!isResolved) {\n isResolved = true\n success.apply(this, arguments) // eslint-disable-line prefer-rest-params\n }\n }\n let wrappedFailure = function () { // eslint-disable-line func-names\n if (!isResolved) {\n isResolved = true\n if (failure) {\n failure.apply(this, arguments) // eslint-disable-line prefer-rest-params\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","export interface HandlerFuncTypeHash {\n [eventName: string]: (...args: any[]) => any // with all properties required\n}\n\nexport class Emitter<HandlerFuncs extends HandlerFuncTypeHash> {\n private handlers: { [Prop in keyof HandlerFuncs]?: HandlerFuncs[Prop][] } = {}\n\n private options: Partial<HandlerFuncs>\n\n private thisContext: any = null\n\n setThisContext(thisContext) {\n this.thisContext = thisContext\n }\n\n setOptions(options: Partial<HandlerFuncs>) {\n this.options = options\n }\n\n on<Prop extends keyof HandlerFuncs>(type: Prop, handler: HandlerFuncs[Prop]) {\n addToHash(this.handlers, type, handler)\n }\n\n off<Prop extends keyof HandlerFuncs>(type: Prop, handler?: HandlerFuncs[Prop]) {\n removeFromHash(this.handlers, type, handler)\n }\n\n trigger<Prop extends keyof HandlerFuncs>(type: Prop, ...args: Parameters<HandlerFuncs[Prop]>) {\n let attachedHandlers = this.handlers[type] || []\n let optionHandler = this.options && this.options[type]\n let handlers = [].concat(optionHandler || [], attachedHandlers)\n\n for (let handler of handlers) {\n handler.apply(this.thisContext, args)\n }\n }\n\n hasHandlers(type: keyof HandlerFuncs) {\n return (this.handlers[type] && this.handlers[type].length) ||\n (this.options && this.options[type])\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((func) => func !== handler)\n }\n } else {\n delete hash[type] // remove all handler funcs for this type\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 class PositionCache {\n els: HTMLElement[] // assumed to be siblings\n originClientRect: ClientRect\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 constructor(originEl: HTMLElement, els: HTMLElement[], isHorizontal: boolean, isVertical: boolean) {\n this.els = els\n\n let originClientRect = this.originClientRect = originEl.getBoundingClientRect() // relative to viewport top-left\n\n if (isHorizontal) {\n this.buildElHorizontals(originClientRect.left)\n }\n\n if (isVertical) {\n this.buildElVerticals(originClientRect.top)\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 // 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 // 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, rights } = this\n let len = lefts.length\n let i\n\n for (i = 0; i < len; i += 1) {\n if (leftPosition >= lefts[i] && leftPosition < rights[i]) {\n return i\n }\n }\n\n return undefined // TODO: better\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, bottoms } = this\n let len = tops.length\n let i\n\n for (i = 0; i < len; i += 1) {\n if (topPosition >= tops[i] && topPosition < bottoms[i]) {\n return i\n }\n }\n\n return undefined // TODO: better\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 // 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","/* eslint max-classes-per-file: \"off\" */\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 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\nexport class ElementScrollController extends ScrollController {\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\nexport class WindowScrollController extends ScrollController {\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","import { CalendarOptionsRefined } from '../options'\n\nexport class Theme {\n // settings. default values are set after the class\n classes: any\n iconClasses: any\n rtlIconClasses: any\n baseIconClass: string // className that ALL icon elements for this theme should have\n iconOverrideOption: any // the name of the setting to use for icons. the subclass must set this.\n iconOverrideCustomButtonOption: any // the name of the setting, *within* each customButtons object, to use for icons\n iconOverridePrefix: string\n\n constructor(calendarOptions: CalendarOptionsRefined) {\n if (this.iconOverrideOption) {\n this.setIconOverride(\n calendarOptions[this.iconOverrideOption],\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 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 getClass(key) {\n return this.classes[key] || ''\n }\n\n getIconClass(buttonName, isRtl?: boolean) {\n let className\n\n if (isRtl && this.rtlIconClasses) {\n className = this.rtlIconClasses[buttonName] || this.iconClasses[buttonName]\n } else {\n className = this.iconClasses[buttonName]\n }\n\n if (className) {\n return `${this.baseIconClass} ${className}`\n }\n\n return ''\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\nTheme.prototype.classes = {}\nTheme.prototype.iconClasses = {}\nTheme.prototype.baseIconClass = ''\nTheme.prototype.iconOverridePrefix = ''\n\nexport type ThemeClass = { new(calendarOptions: any): Theme }\n","import { __assign } from 'tslib'\nimport { Duration } from './datelib/duration'\nimport { Emitter } from './common/Emitter'\nimport { CalendarListeners } from './options'\n\nexport interface ScrollRequest {\n time?: Duration\n [otherProp: string]: any\n}\n\nexport type ScrollRequestHandler = (request: ScrollRequest) => boolean\n\nexport class ScrollResponder {\n queuedRequest: ScrollRequest\n\n constructor(\n private execFunc: ScrollRequestHandler,\n private emitter: Emitter<CalendarListeners>,\n private scrollTime: Duration,\n private scrollTimeReset: boolean,\n ) {\n emitter.on('_scrollRequest', this.handleScrollRequest)\n this.fireInitialScroll()\n }\n\n detach() {\n this.emitter.off('_scrollRequest', this.handleScrollRequest)\n }\n\n update(isDatesNew: boolean) {\n if (isDatesNew && this.scrollTimeReset) {\n this.fireInitialScroll() // will drain\n } else {\n this.drain()\n }\n }\n\n private fireInitialScroll() {\n this.handleScrollRequest({\n time: this.scrollTime,\n })\n }\n\n private handleScrollRequest = (request: ScrollRequest) => {\n this.queuedRequest = __assign({}, this.queuedRequest || {}, request)\n this.drain()\n }\n\n private drain() {\n if (this.queuedRequest && this.execFunc(this.queuedRequest)) {\n this.queuedRequest = null\n }\n }\n}\n","import { CalendarApi } from './CalendarApi'\nimport { ViewApi } from './ViewApi'\nimport { Theme } from './theme/Theme'\nimport { DateEnv } from './datelib/env'\nimport { PluginHooks } from './plugin-system-struct'\nimport { createContext, Context } from './vdom'\nimport { ScrollResponder, ScrollRequestHandler } from './ScrollResponder'\nimport { DateProfileGenerator } from './DateProfileGenerator'\nimport { ViewSpec } from './structs/view-spec'\nimport { CalendarData } from './reducers/data-types'\nimport { Action } from './reducers/Action'\nimport { Emitter } from './common/Emitter'\nimport { InteractionSettingsInput } from './interactions/interaction'\nimport { DateComponent } from './component/DateComponent'\nimport { CalendarContext } from './CalendarContext'\nimport { createDuration } from './datelib/duration'\nimport { ViewOptionsRefined, CalendarListeners } from './options'\n\nexport const ViewContextType: Context<any> = createContext<ViewContext>({} as any) // for Components\nexport type ResizeHandler = (force: boolean) => void\n\n/*\nit's important that ViewContext extends CalendarContext so that components that subscribe to ViewContext\ncan pass in their ViewContext to util functions that accept CalendarContext.\n*/\nexport interface ViewContext extends CalendarContext {\n options: ViewOptionsRefined // more specific than BaseOptionsRefined\n theme: Theme\n isRtl: boolean\n dateProfileGenerator: DateProfileGenerator\n viewSpec: ViewSpec\n viewApi: ViewApi\n addResizeHandler: (handler: ResizeHandler) => void\n removeResizeHandler: (handler: ResizeHandler) => void\n createScrollResponder: (execFunc: ScrollRequestHandler) => ScrollResponder\n registerInteractiveComponent: (component: DateComponent<any>, settingsInput: InteractionSettingsInput) => void\n unregisterInteractiveComponent: (component: DateComponent<any>) => void\n}\n\nexport function buildViewContext(\n viewSpec: ViewSpec,\n viewApi: ViewApi,\n viewOptions: ViewOptionsRefined,\n dateProfileGenerator: DateProfileGenerator,\n dateEnv: DateEnv,\n theme: Theme,\n pluginHooks: PluginHooks,\n dispatch: (action: Action) => void,\n getCurrentData: () => CalendarData,\n emitter: Emitter<CalendarListeners>,\n calendarApi: CalendarApi,\n registerInteractiveComponent: (component: DateComponent<any>, settingsInput: InteractionSettingsInput) => void,\n unregisterInteractiveComponent: (component: DateComponent<any>) => void,\n): ViewContext {\n return {\n dateEnv,\n options: viewOptions,\n pluginHooks,\n emitter,\n dispatch,\n getCurrentData,\n calendarApi,\n viewSpec,\n viewApi,\n dateProfileGenerator,\n theme,\n isRtl: viewOptions.direction === 'rtl',\n addResizeHandler(handler: ResizeHandler) {\n emitter.on('_resize', handler)\n },\n removeResizeHandler(handler: ResizeHandler) {\n emitter.off('_resize', handler)\n },\n createScrollResponder(execFunc: ScrollRequestHandler) {\n return new ScrollResponder(\n execFunc,\n emitter,\n createDuration(viewOptions.scrollTime),\n viewOptions.scrollTimeReset,\n )\n },\n registerInteractiveComponent,\n unregisterInteractiveComponent,\n }\n}\n","/* eslint max-classes-per-file: off */\n\nimport { __assign } from 'tslib'\nimport { Component, Ref } from './vdom'\nimport { ViewContextType, ViewContext } from './ViewContext'\nimport { compareObjs, EqualityFuncs, getUnequalProps } from './util/object'\nimport { Dictionary } from './options'\n\nexport abstract class PureComponent<Props=Dictionary, State=Dictionary> extends Component<Props, State> {\n static addPropsEquality = addPropsEquality\n static addStateEquality = addStateEquality\n static contextType: any = ViewContextType\n\n context: ViewContext\n propEquality: EqualityFuncs<Props>\n stateEquality: EqualityFuncs<State>\n\n debug: boolean\n\n shouldComponentUpdate(nextProps: Props, nextState: State) {\n if (this.debug) {\n // eslint-disable-next-line no-console\n console.log(getUnequalProps(nextProps, this.props), getUnequalProps(nextState, this.state))\n }\n\n return !compareObjs(this.props, nextProps, this.propEquality) ||\n !compareObjs(this.state, nextState, this.stateEquality)\n }\n}\n\nPureComponent.prototype.propEquality = {}\nPureComponent.prototype.stateEquality = {}\n\nexport abstract class BaseComponent<Props=Dictionary, State=Dictionary> extends PureComponent<Props, State> {\n static contextType: any = ViewContextType\n\n context: ViewContext\n}\n\nfunction addPropsEquality(this: { prototype: { propEquality: any } }, propEquality) {\n let hash = Object.create(this.prototype.propEquality)\n __assign(hash, propEquality)\n this.prototype.propEquality = hash\n}\n\nfunction addStateEquality(this: { prototype: { stateEquality: any } }, stateEquality) {\n let hash = Object.create(this.prototype.stateEquality)\n __assign(hash, stateEquality)\n this.prototype.stateEquality = hash\n}\n\n// use other one\nexport function setRef<RefType>(ref: Ref<RefType> | void, current: RefType) {\n if (typeof ref === 'function') {\n ref(current)\n } else if (ref) {\n // see https://github.com/facebook/react/issues/13029\n (ref as any).current = current\n }\n}\n","import { BaseComponent } from '../vdom-util'\nimport { EventRenderRange } from './event-rendering'\nimport { EventInstanceHash } from '../structs/event-instance'\nimport { Hit } from '../interactions/hit'\nimport { elementClosest } from '../util/dom-manip'\nimport { guid } from '../util/misc'\nimport { Dictionary } from '../options'\n\nexport type DateComponentHash = { [uid: string]: DateComponent<any, any> }\n\n// NOTE: for fg-events, eventRange.range is NOT sliced,\n// thus, we need isStart/isEnd\nexport interface Seg {\n component?: DateComponent<any, any>\n isStart: boolean\n isEnd: boolean\n eventRange?: EventRenderRange\n [otherProp: string]: any // TODO: remove this. extending Seg will handle this\n el?: never\n // NOTE: can sometimes have start/end, which are important values :(\n}\n\nexport interface EventSegUiInteractionState {\n affectedInstances: EventInstanceHash\n segs: Seg[]\n isEvent: boolean\n}\n\n/*\nan INTERACTABLE date component\n\nPURPOSES:\n- hook up to fg, fill, and mirror renderers\n- interface for dragging and hits\n*/\nexport abstract class DateComponent<Props=Dictionary, State=Dictionary> extends BaseComponent<Props, State> {\n uid = guid()\n\n // Hit System\n // -----------------------------------------------------------------------------------------------------------------\n\n prepareHits() {\n }\n\n queryHit(positionLeft: number, positionTop: number, elWidth: number, elHeight: number): Hit | null {\n return null // this should be abstract\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-event-mirror')\n }\n\n isValidDateDownEl(el: HTMLElement) {\n return !elementClosest(el, '.fc-event:not(.fc-bg-event)') &&\n !elementClosest(el, '.fc-more-link') && // a \"more..\" link\n !elementClosest(el, 'a[data-navlink]') && // a clickable nav link\n !elementClosest(el, '.fc-popover') // hack\n }\n}\n","import { guid } from './util/misc'\nimport { PluginDefInput, PluginDef, PluginHooks } from './plugin-system-struct'\nimport { isArraysEqual } from './util/array'\n\n// TODO: easier way to add new hooks? need to update a million things\n\nexport function createPlugin(input: PluginDefInput): PluginDef {\n return {\n id: guid(),\n deps: input.deps || [],\n reducers: input.reducers || [],\n isLoadingFuncs: input.isLoadingFuncs || [],\n contextInit: [].concat(input.contextInit || []),\n eventRefiners: input.eventRefiners || {},\n eventDefMemberAdders: input.eventDefMemberAdders || [],\n eventSourceRefiners: input.eventSourceRefiners || {},\n isDraggableTransformers: input.isDraggableTransformers || [],\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 viewContainerAppends: input.viewContainerAppends || [],\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 initialView: input.initialView || '',\n elementDraggingImpl: input.elementDraggingImpl,\n optionChangeHandlers: input.optionChangeHandlers || {},\n scrollGridImpl: input.scrollGridImpl || null,\n contentTypeHandlers: input.contentTypeHandlers || {},\n listenerRefiners: input.listenerRefiners || {},\n optionRefiners: input.optionRefiners || {},\n propSetHandlers: input.propSetHandlers || {},\n }\n}\n\nfunction buildPluginHooks(pluginDefs: PluginDef[], globalDefs: PluginDef[]): PluginHooks {\n let isAdded: { [pluginId: string]: boolean } = {}\n let hooks: PluginHooks = {\n reducers: [],\n isLoadingFuncs: [],\n contextInit: [],\n eventRefiners: {},\n eventDefMemberAdders: [],\n eventSourceRefiners: {},\n isDraggableTransformers: [],\n eventDragMutationMassagers: [],\n eventDefMutationAppliers: [],\n dateSelectionTransformers: [],\n datePointTransforms: [],\n dateSpanTransforms: [],\n views: {},\n viewPropsTransformers: [],\n isPropsValid: null,\n externalDefTransforms: [],\n viewContainerAppends: [],\n eventDropTransformers: [],\n componentInteractions: [],\n calendarInteractions: [],\n themeClasses: {},\n eventSourceDefs: [],\n cmdFormatter: null,\n recurringTypes: [],\n namedTimeZonedImpl: null,\n initialView: '',\n elementDraggingImpl: null,\n optionChangeHandlers: {},\n scrollGridImpl: null,\n contentTypeHandlers: {},\n listenerRefiners: {},\n optionRefiners: {},\n propSetHandlers: {},\n }\n\n function addDefs(defs: PluginDef[]) {\n for (let def of defs) {\n if (!isAdded[def.id]) {\n isAdded[def.id] = true\n addDefs(def.deps)\n hooks = combineHooks(hooks, def)\n }\n }\n }\n\n if (pluginDefs) {\n addDefs(pluginDefs)\n }\n\n addDefs(globalDefs)\n\n return hooks\n}\n\nexport function buildBuildPluginHooks() { // memoizes\n let currentOverrideDefs: PluginDef[] = []\n let currentGlobalDefs: PluginDef[] = []\n let currentHooks: PluginHooks\n\n return (overrideDefs: PluginDef[], globalDefs: PluginDef[]) => {\n if (!currentHooks || !isArraysEqual(overrideDefs, currentOverrideDefs) || !isArraysEqual(globalDefs, currentGlobalDefs)) {\n currentHooks = buildPluginHooks(overrideDefs, globalDefs)\n }\n currentOverrideDefs = overrideDefs\n currentGlobalDefs = globalDefs\n return currentHooks\n }\n}\n\nfunction combineHooks(hooks0: PluginHooks, hooks1: PluginHooks): PluginHooks {\n return {\n reducers: hooks0.reducers.concat(hooks1.reducers),\n isLoadingFuncs: hooks0.isLoadingFuncs.concat(hooks1.isLoadingFuncs),\n contextInit: hooks0.contextInit.concat(hooks1.contextInit),\n eventRefiners: { ...hooks0.eventRefiners, ...hooks1.eventRefiners },\n eventDefMemberAdders: hooks0.eventDefMemberAdders.concat(hooks1.eventDefMemberAdders),\n eventSourceRefiners: { ...hooks0.eventSourceRefiners, ...hooks1.eventSourceRefiners },\n isDraggableTransformers: hooks0.isDraggableTransformers.concat(hooks1.isDraggableTransformers),\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 viewContainerAppends: hooks0.viewContainerAppends.concat(hooks1.viewContainerAppends),\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 initialView: hooks0.initialView || hooks1.initialView, // put earlier plugins FIRST\n elementDraggingImpl: hooks0.elementDraggingImpl || hooks1.elementDraggingImpl, // \"\n optionChangeHandlers: { ...hooks0.optionChangeHandlers, ...hooks1.optionChangeHandlers },\n scrollGridImpl: hooks1.scrollGridImpl || hooks0.scrollGridImpl,\n contentTypeHandlers: { ...hooks0.contentTypeHandlers, ...hooks1.contentTypeHandlers },\n listenerRefiners: { ...hooks0.listenerRefiners, ...hooks1.listenerRefiners },\n optionRefiners: { ...hooks0.optionRefiners, ...hooks1.optionRefiners },\n propSetHandlers: { ...hooks0.propSetHandlers, ...hooks1.propSetHandlers },\n }\n}\n","import { Theme } from './Theme'\n\nexport class StandardTheme extends Theme {\n}\n\nStandardTheme.prototype.classes = {\n root: 'fc-theme-standard', // TODO: compute this off of registered theme name\n tableCellShaded: 'fc-cell-shaded',\n buttonGroup: 'fc-button-group',\n button: 'fc-button fc-button-primary',\n buttonActive: 'fc-button-active',\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}\nStandardTheme.prototype.rtlIconClasses = {\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\nStandardTheme.prototype.iconOverrideOption = 'buttonIcons' // TODO: make TS-friendly\nStandardTheme.prototype.iconOverrideCustomButtonOption = 'icon'\nStandardTheme.prototype.iconOverridePrefix = 'fc-icon-'\n","import { ViewConfigHash, ViewComponentType } from './view-config'\nimport { ViewOptions } from '../options'\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 component: ViewComponentType\n overrides: ViewOptions\n defaults: ViewOptions\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(\n viewType: string,\n hash: ViewDefHash,\n defaultConfigs: ViewConfigHash,\n overrideConfigs: ViewConfigHash,\n): 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(\n viewType: string,\n hash: ViewDefHash,\n defaultConfigs: ViewConfigHash,\n overrideConfigs: ViewConfigHash,\n): ViewDef | null {\n let defaultConfig = defaultConfigs[viewType]\n let overrideConfig = overrideConfigs[viewType]\n\n let queryProp = (name) => (\n (defaultConfig && defaultConfig[name] !== null) ? defaultConfig[name] :\n ((overrideConfig && overrideConfig[name] !== null) ? overrideConfig[name] : null)\n )\n\n let theComponent = queryProp('component') as ViewComponentType\n let superType = queryProp('superType') as string\n let superDef: ViewDef | null = null\n\n if (superType) {\n if (superType === viewType) {\n throw new Error('Can\\'t have a custom view type that references itself')\n }\n\n superDef = ensureViewDef(superType, hash, defaultConfigs, overrideConfigs)\n }\n\n if (!theComponent && superDef) {\n theComponent = superDef.component\n }\n\n if (!theComponent) {\n return null // don't throw a warning, might be settings for a single-unit view\n }\n\n return {\n type: viewType,\n component: theComponent,\n defaults: {\n ...(superDef ? superDef.defaults : {}),\n ...(defaultConfig ? defaultConfig.rawOptions : {}),\n },\n overrides: {\n ...(superDef ? superDef.overrides : {}),\n ...(overrideConfig ? overrideConfig.rawOptions : {}),\n },\n }\n}\n","/* eslint max-classes-per-file: off */\n\nimport { Ref, createRef, ComponentChildren, createElement, RefObject, createContext, Context } from '../vdom'\nimport { setRef, BaseComponent } from '../vdom-util'\nimport { isPropsEqual } from '../util/object'\nimport { parseClassNames, ClassNamesInput } from '../util/html'\n\nexport type MountArg<ContentArg> = ContentArg & { el: HTMLElement }\nexport type DidMountHandler<TheMountArg extends { el: HTMLElement }> = (mountArg: TheMountArg) => void\nexport type WillUnmountHandler<TheMountArg extends { el: HTMLElement }> = (mountArg: TheMountArg) => void\n\nexport interface RenderHookProps<ContentArg> {\n hookProps: ContentArg\n classNames: ClassNamesGenerator<ContentArg>\n content: CustomContentGenerator<ContentArg>\n defaultContent?: DefaultContentGenerator<ContentArg>\n didMount: DidMountHandler<MountArg<ContentArg>>\n willUnmount: WillUnmountHandler<MountArg<ContentArg>>\n children: RenderHookPropsChildren\n elRef?: Ref<any>\n}\n\nexport type RenderHookPropsChildren = (\n rootElRef: Ref<any>,\n classNames: string[],\n innerElRef: Ref<any>,\n innerContent: ComponentChildren // if falsy, means it wasn't specified\n) => ComponentChildren\n\nexport interface ContentTypeHandlers {\n [contentKey: string]: () => ({\n render: (el: HTMLElement, contentVal: any) => void\n destroy?: () => void\n })\n}\n\n// NOTE: in JSX, you should always use this class with <HookProps> arg. otherwise, will default to any???\nexport class RenderHook<HookProps> extends BaseComponent<RenderHookProps<HookProps>> {\n private rootElRef = createRef()\n\n render() {\n let { props } = this\n let { hookProps } = props\n\n return (\n <MountHook hookProps={hookProps} didMount={props.didMount} willUnmount={props.willUnmount} elRef={this.handleRootEl}>\n {(rootElRef) => (\n <ContentHook hookProps={hookProps} content={props.content} defaultContent={props.defaultContent} backupElRef={this.rootElRef}>\n {(innerElRef, innerContent) => props.children(\n rootElRef,\n normalizeClassNames(props.classNames, hookProps),\n innerElRef,\n innerContent,\n )}\n </ContentHook>\n )}\n </MountHook>\n )\n }\n\n handleRootEl = (el: HTMLElement | null) => {\n setRef(this.rootElRef, el)\n\n if (this.props.elRef) {\n setRef(this.props.elRef, el)\n }\n }\n}\n\nexport interface ObjCustomContent {\n html: string\n domNodes: any[]\n [custom: string]: any // TODO: expose hook for plugins to add!\n}\n\nexport type CustomContent = ComponentChildren | ObjCustomContent\nexport type CustomContentGenerator<HookProps> = CustomContent | ((hookProps: HookProps) => CustomContent)\n\nexport type DefaultContentGenerator<HookProps> = (hookProps: HookProps) => ComponentChildren\n// TODO: rename to be about function, not default. use in above type\n\n// for forcing rerender of components that use the ContentHook\nexport const CustomContentRenderContext: Context<number> = createContext<number>(0)\n\nexport interface ContentHookProps<HookProps> {\n hookProps: HookProps // produced by FullCalendar internally, for rendering an entity/whatever\n content: CustomContentGenerator<HookProps> // the value of a user-hook, like `eventContent`\n defaultContent?: DefaultContentGenerator<HookProps> // if content not specified (TODO: just use content?)\n children: ( // for producing a wrapper around the content\n innerElRef: Ref<any>,\n innerContent: ComponentChildren // if falsy, means it wasn't specified\n ) => ComponentChildren\n backupElRef?: RefObject<any>\n}\n\ninterface ContentHookInnerProps<HookProps> extends ContentHookProps<HookProps> {\n renderId: number\n}\n\nexport function ContentHook<HookProps>(props: ContentHookProps<HookProps>) { // TODO: rename to CustomContentHook?\n return (\n <CustomContentRenderContext.Consumer>\n {(renderId) => (\n <ContentHookInner renderId={renderId} {...props} />\n )}\n </CustomContentRenderContext.Consumer>\n )\n}\n\nclass ContentHookInner<HookProps> extends BaseComponent<ContentHookInnerProps<HookProps>> {\n private innerElRef = createRef()\n\n private customContentInfo: {\n contentKey: string\n contentVal: any\n render: (el: HTMLElement, contentVal: any) => void\n destroy?: () => void\n }\n\n render() {\n return this.props.children(this.innerElRef, this.renderInnerContent())\n }\n\n componentDidMount() {\n this.updateCustomContent()\n }\n\n componentDidUpdate() {\n this.updateCustomContent()\n }\n\n componentWillUnmount() {\n if (this.customContentInfo && this.customContentInfo.destroy) {\n this.customContentInfo.destroy()\n }\n }\n\n private renderInnerContent() {\n let { customContentInfo } = this // only populated if using non-[p]react node(s)\n let innerContent = this.getInnerContent()\n let meta = this.getContentMeta(innerContent)\n\n // initial run, or content-type changing? (from vue -> react for example)\n if (!customContentInfo || customContentInfo.contentKey !== meta.contentKey) {\n // clearing old value\n if (customContentInfo) {\n if (customContentInfo.destroy) {\n customContentInfo.destroy()\n }\n customContentInfo = this.customContentInfo = null\n }\n // assigning new value\n if (meta.contentKey) {\n customContentInfo = this.customContentInfo = { // for non-[p]react\n contentKey: meta.contentKey,\n contentVal: innerContent[meta.contentKey],\n ...meta.buildLifecycleFuncs(),\n }\n }\n // updating\n } else if (customContentInfo) {\n customContentInfo.contentVal = innerContent[meta.contentKey]\n }\n\n return customContentInfo\n ? [] // signal that something was specified\n : innerContent // assume a [p]react vdom node. use it\n }\n\n private getInnerContent() {\n let { props } = this\n let innerContent = normalizeContent(props.content, props.hookProps)\n\n if (innerContent === undefined) { // use the default\n innerContent = normalizeContent(props.defaultContent, props.hookProps)\n }\n\n return innerContent == null ? null : innerContent // convert undefined to null (better for React)\n }\n\n private getContentMeta(innerContent: any) {\n let { contentTypeHandlers } = this.context.pluginHooks\n let contentKey = ''\n let buildLifecycleFuncs = null\n\n if (innerContent) { // allowed to be null, for convenience to caller\n for (let searchKey in contentTypeHandlers) {\n if (innerContent[searchKey] !== undefined) {\n contentKey = searchKey\n buildLifecycleFuncs = contentTypeHandlers[searchKey]\n break\n }\n }\n }\n\n return { contentKey, buildLifecycleFuncs }\n }\n\n private updateCustomContent() {\n if (this.customContentInfo) { // for non-[p]react\n this.customContentInfo.render(\n this.innerElRef.current || this.props.backupElRef.current, // the element to render into\n this.customContentInfo.contentVal,\n )\n }\n }\n}\n\nexport interface MountHookProps<ContentArg> {\n hookProps: ContentArg\n didMount: DidMountHandler<MountArg<ContentArg>>\n willUnmount: WillUnmountHandler<MountArg<ContentArg>>\n children: (rootElRef: Ref<any>) => ComponentChildren\n elRef?: Ref<any> // maybe get rid of once we have better API for caller to combine refs\n}\n\nexport class MountHook<ContentArg> extends BaseComponent<MountHookProps<ContentArg>> {\n rootEl: HTMLElement\n\n render() {\n return this.props.children(this.handleRootEl)\n }\n\n componentDidMount() {\n let callback = this.props.didMount\n\n if (callback) {\n callback({ ...this.props.hookProps, el: this.rootEl })\n }\n }\n\n componentWillUnmount() {\n let callback = this.props.willUnmount\n\n if (callback) {\n callback({ ...this.props.hookProps, el: this.rootEl })\n }\n }\n\n private handleRootEl = (rootEl: HTMLElement) => {\n this.rootEl = rootEl\n\n if (this.props.elRef) {\n setRef(this.props.elRef, rootEl)\n }\n }\n}\n\nexport function buildClassNameNormalizer<HookProps>() { // TODO: general deep-memoizer?\n let currentGenerator: ClassNamesGenerator<HookProps>\n let currentHookProps: HookProps\n let currentClassNames: string[] = []\n\n return (generator: ClassNamesGenerator<HookProps>, hookProps: HookProps) => {\n if (!currentHookProps || !isPropsEqual(currentHookProps, hookProps) || generator !== currentGenerator) {\n currentGenerator = generator\n currentHookProps = hookProps\n currentClassNames = normalizeClassNames(generator, hookProps)\n }\n\n return currentClassNames\n }\n}\n\nexport type ClassNamesGenerator<HookProps> = ClassNamesInput | ((hookProps: HookProps) => ClassNamesInput)\n\nfunction normalizeClassNames<HookProps>(classNames: ClassNamesGenerator<HookProps>, hookProps: HookProps): string[] {\n if (typeof classNames === 'function') {\n classNames = classNames(hookProps)\n }\n\n return parseClassNames(classNames)\n}\n\nfunction normalizeContent(input, hookProps) {\n if (typeof input === 'function') {\n return input(hookProps, createElement) // give the function the vdom-creation func\n }\n return input\n}\n","import { ViewSpec } from '../structs/view-spec'\nimport { MountHook, buildClassNameNormalizer, MountArg } from './render-hook'\nimport { ComponentChildren, createElement, Ref } from '../vdom'\nimport { BaseComponent } from '../vdom-util'\nimport { ViewApi } from '../ViewApi'\n\nexport interface ViewRootProps {\n viewSpec: ViewSpec\n children: (rootElRef: Ref<any>, classNames: string[]) => ComponentChildren\n elRef?: Ref<any>\n}\n\nexport interface ViewContentArg {\n view: ViewApi\n}\n\nexport type ViewMountArg = MountArg<ViewContentArg>\n\nexport class ViewRoot extends BaseComponent<ViewRootProps> {\n normalizeClassNames = buildClassNameNormalizer<ViewContentArg>()\n\n render() {\n let { props, context } = this\n let { options } = context\n let hookProps: ViewContentArg = { view: context.viewApi }\n let customClassNames = this.normalizeClassNames(options.viewClassNames, hookProps)\n\n return (\n <MountHook\n hookProps={hookProps}\n didMount={options.viewDidMount}\n willUnmount={options.viewWillUnmount}\n elRef={props.elRef}\n >\n {(rootElRef) => props.children(\n rootElRef,\n [`fc-${props.viewSpec.type}-view`, 'fc-view'].concat(customClassNames),\n )}\n </MountHook>\n )\n }\n}\n","import { ViewProps } from '../View'\nimport { mapHash } from '../util/object'\nimport { ComponentType, Component, createElement } from '../vdom'\nimport { ViewRoot } from '../common/ViewRoot'\nimport { RenderHook, MountArg } from '../common/render-hook'\nimport { ViewContext, ViewContextType } from '../ViewContext'\nimport { ViewOptions } from '../options'\nimport { Duration } from '../datelib/duration'\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 ViewComponent = Component<ViewProps> // an instance\nexport type ViewComponentType = ComponentType<ViewProps>\n\nexport type ViewConfigInput = ViewComponentType | ViewOptions\nexport type ViewConfigInputHash = { [viewType: string]: ViewConfigInput }\n\nexport interface ViewConfig {\n superType: string\n component: ViewComponentType | null\n rawOptions: ViewOptions\n}\n\nexport type ViewConfigHash = { [viewType: string]: ViewConfig }\n\nexport function parseViewConfigs(inputs: ViewConfigInputHash): ViewConfigHash {\n return mapHash(inputs, parseViewConfig)\n}\n\nfunction parseViewConfig(input: ViewConfigInput): ViewConfig {\n let rawOptions: ViewOptions = typeof input === 'function' ?\n { component: input } :\n input\n let { component } = rawOptions\n\n if (rawOptions.content) {\n component = createViewHookComponent(rawOptions)\n // TODO: remove content/classNames/didMount/etc from options?\n }\n\n return {\n superType: rawOptions.type as any,\n component: component as any,\n rawOptions, // includes type and component too :(\n }\n}\n\nexport interface SpecificViewContentArg extends ViewProps {\n nextDayThreshold: Duration\n}\n\nexport type SpecificViewMountArg = MountArg<SpecificViewContentArg>\n\nfunction createViewHookComponent(options: ViewOptions) {\n return (viewProps: ViewProps) => (\n <ViewContextType.Consumer>\n {(context: ViewContext) => (\n <ViewRoot viewSpec={context.viewSpec}>\n {(viewElRef, viewClassNames) => {\n let hookProps: SpecificViewContentArg = {\n ...viewProps,\n nextDayThreshold: context.options.nextDayThreshold,\n }\n return (\n <RenderHook\n hookProps={hookProps}\n classNames={options.classNames as any}\n content={options.content as any}\n didMount={options.didMount as any}\n willUnmount={options.willUnmount as any}\n elRef={viewElRef}\n >\n {(rootElRef, customClassNames, innerElRef, innerContent) => (\n <div className={viewClassNames.concat(customClassNames).join(' ')} ref={rootElRef}>\n {innerContent}\n </div>\n )}\n </RenderHook>\n )\n }}\n </ViewRoot>\n )}\n </ViewContextType.Consumer>\n )\n}\n","import { ViewDef, compileViewDefs } from './view-def'\nimport { Duration, createDuration, greatestDurationDenominator, DurationInput } from '../datelib/duration'\nimport { mapHash } from '../util/object'\nimport { ViewOptions, CalendarOptions, BASE_OPTION_DEFAULTS } from '../options'\nimport { ViewConfigInputHash, parseViewConfigs, ViewConfigHash, ViewComponentType } 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 component: ViewComponentType\n duration: Duration\n durationUnit: string\n singleUnit: string\n optionDefaults: ViewOptions\n optionOverrides: ViewOptions\n buttonTextOverride: string\n buttonTextDefault: string\n}\n\nexport type ViewSpecHash = { [viewType: string]: ViewSpec }\n\nexport function buildViewSpecs(\n defaultInputs: ViewConfigInputHash,\n optionOverrides: CalendarOptions,\n dynamicOptionOverrides: CalendarOptions,\n localeDefaults,\n): ViewSpecHash {\n let defaultConfigs = parseViewConfigs(defaultInputs)\n let overrideConfigs = parseViewConfigs(optionOverrides.views)\n let viewDefs = compileViewDefs(defaultConfigs, overrideConfigs)\n\n return mapHash(viewDefs, (viewDef) => buildViewSpec(viewDef, overrideConfigs, optionOverrides, dynamicOptionOverrides, localeDefaults))\n}\n\nfunction buildViewSpec(\n viewDef: ViewDef,\n overrideConfigs: ViewConfigHash,\n optionOverrides: CalendarOptions,\n dynamicOptionOverrides: CalendarOptions,\n localeDefaults,\n): ViewSpec {\n let durationInput =\n viewDef.overrides.duration ||\n viewDef.defaults.duration ||\n dynamicOptionOverrides.duration ||\n optionOverrides.duration\n\n let duration = null\n let durationUnit = ''\n let singleUnit = ''\n let singleUnitOverrides: ViewOptions = {}\n\n if (durationInput) {\n duration = createDurationCached(durationInput)\n\n if (duration) { // valid?\n let denom = greatestDurationDenominator(duration)\n durationUnit = denom.unit\n\n if (denom.value === 1) {\n singleUnit = durationUnit\n singleUnitOverrides = overrideConfigs[durationUnit] ? overrideConfigs[durationUnit].rawOptions : {}\n }\n }\n }\n\n let queryButtonText = (optionsSubset) => {\n let buttonTextMap = optionsSubset.buttonText || {}\n let buttonTextKey = viewDef.defaults.buttonTextKey as string\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 return null\n }\n\n return {\n type: viewDef.type,\n component: viewDef.component,\n duration,\n durationUnit,\n singleUnit,\n optionDefaults: viewDef.defaults,\n optionOverrides: { ...singleUnitOverrides, ...viewDef.overrides },\n\n buttonTextOverride:\n queryButtonText(dynamicOptionOverrides) ||\n queryButtonText(optionOverrides) || // constructor-specified buttonText lookup hash takes precedence\n viewDef.overrides.buttonText, // `buttonText` for view-specific options is a string\n\n buttonTextDefault:\n queryButtonText(localeDefaults) ||\n viewDef.defaults.buttonText ||\n queryButtonText(BASE_OPTION_DEFAULTS) ||\n viewDef.type, // fall back to given view name\n }\n}\n\n// hack to get memoization working\n\nlet durationInputMap: { [json: string]: Duration } = {}\n\nfunction createDurationCached(durationInput: DurationInput) {\n let json = JSON.stringify(durationInput)\n let res = durationInputMap[json]\n\n if (res === undefined) {\n res = createDuration(durationInput)\n durationInputMap[json] = res\n }\n\n return res\n}\n","import { DateMarker, startOfDay, addDays } from './datelib/marker'\nimport { Duration, createDuration, asRoughDays, asRoughMs, greatestDurationDenominator } from './datelib/duration'\nimport {\n DateRange,\n OpenDateRange,\n constrainMarkerToRange,\n intersectRanges,\n rangesIntersect,\n parseRange,\n DateRangeInput,\n} from './datelib/date-range'\nimport { DateEnv, DateInput } from './datelib/env'\nimport { computeVisibleDayRange } from './util/date'\nimport { getNow } from './reducers/current-date'\nimport { CalendarApi } from './CalendarApi'\n\nexport interface DateProfile {\n currentRange: DateRange // TODO: does this include slotMinTime/slotMaxTime?\n currentRangeUnit: string\n isRangeAllDay: boolean\n validRange: OpenDateRange\n activeRange: DateRange | null\n renderRange: DateRange\n slotMinTime: Duration\n slotMaxTime: Duration\n isValid: boolean\n dateIncrement: Duration\n}\n\nexport interface DateProfileGeneratorProps extends DateProfileOptions {\n dateProfileGeneratorClass: DateProfileGeneratorClass // not used by DateProfileGenerator itself\n duration: Duration\n durationUnit: string\n usesMinMaxTime: boolean\n dateEnv: DateEnv\n calendarApi: CalendarApi\n}\n\nexport interface DateProfileOptions {\n slotMinTime: Duration\n slotMaxTime: Duration\n showNonCurrentDates?: boolean\n dayCount?: number\n dateAlignment?: string\n dateIncrement?: Duration\n hiddenDays?: number[]\n weekends?: boolean\n nowInput?: DateInput | (() => DateInput)\n validRangeInput?: DateRangeInput | ((this: CalendarApi, nowDate: Date) => DateRangeInput)\n visibleRangeInput?: DateRangeInput | ((this: CalendarApi, nowDate: Date) => DateRangeInput)\n monthMode?: boolean\n fixedWeekCount?: boolean\n}\n\nexport type DateProfileGeneratorClass = {\n new(props: DateProfileGeneratorProps): DateProfileGenerator\n}\n\nexport class DateProfileGenerator { // only publicly used for isHiddenDay :(\n nowDate: DateMarker\n\n isHiddenDayHash: boolean[]\n\n constructor(protected props: DateProfileGeneratorProps) {\n this.nowDate = getNow(props.nowInput, props.dateEnv)\n this.initHiddenDays()\n }\n\n /* Date Range Computation\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, forceToValid?: boolean): DateProfile {\n let { dateEnv } = this.props\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, forceToValid)\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, forceToValid?: boolean): DateProfile {\n let { dateEnv } = this.props\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, forceToValid)\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 = true): DateProfile {\n let { props } = this\n let validRange: DateRange\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 (!props.showNonCurrentDates) {\n activeRange = intersectRanges(activeRange, currentInfo.range)\n }\n\n activeRange = this.adjustActiveRange(activeRange)\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,\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 slotMinTime: props.slotMinTime,\n\n // Duration object that denotes the exclusive visible end time of any given day\n slotMaxTime: props.slotMaxTime,\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 // 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 let input = this.props.validRangeInput\n let simpleInput = typeof input === 'function'\n ? input.call(this.props.calendarApi, this.nowDate)\n : input\n\n return this.refineRange(simpleInput) ||\n { start: null, end: null } // completely open-ended\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 { props } = this\n let duration = null\n let unit = null\n let range = null\n let dayCount\n\n if (props.duration) {\n duration = props.duration\n unit = props.durationUnit\n range = this.buildRangeFromDuration(date, direction, duration, unit)\n } else if ((dayCount = this.props.dayCount)) {\n unit = 'day'\n range = this.buildRangeFromDayCount(date, direction, dayCount)\n } else if ((range = this.buildCustomVisibleRange(date))) {\n unit = props.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, unit, range }\n }\n\n getFallbackDuration(): Duration {\n return createDuration({ day: 1 })\n }\n\n // Returns a new activeRange to have time values (un-ambiguate)\n // slotMinTime or slotMaxTime causes the range to expand.\n adjustActiveRange(range: DateRange) {\n let { dateEnv, usesMinMaxTime, slotMinTime, slotMaxTime } = this.props\n let { start, end } = range\n\n if (usesMinMaxTime) {\n // expand active range if slotMinTime is negative (why not when positive?)\n if (asRoughDays(slotMinTime) < 0) {\n start = startOfDay(start) // necessary?\n start = dateEnv.add(start, slotMinTime)\n }\n\n // expand active range if slotMaxTime is beyond one day (why not when negative?)\n if (asRoughDays(slotMaxTime) > 1) {\n end = startOfDay(end) // necessary?\n end = addDays(end, -1)\n end = dateEnv.add(end, slotMaxTime)\n }\n }\n\n return { start, end }\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, dateAlignment } = this.props\n let start: DateMarker\n let end: DateMarker\n let res\n\n // compute what the alignment should be\n if (!dateAlignment) {\n let { dateIncrement } = this.props\n\n if (dateIncrement) {\n // use the smaller of the two units\n if (asRoughMs(dateIncrement) < asRoughMs(duration)) {\n dateAlignment = greatestDurationDenominator(dateIncrement).unit\n } else {\n dateAlignment = unit\n }\n } else {\n dateAlignment = 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, dateAlignment)\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 // Builds the \"current\" range when a dayCount is specified.\n buildRangeFromDayCount(date: DateMarker, direction, dayCount) {\n let { dateEnv, dateAlignment } = this.props\n let runningCount = 0\n let start: DateMarker = date\n let end: DateMarker\n\n if (dateAlignment) {\n start = dateEnv.startOf(start, dateAlignment)\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 += 1\n }\n } while (runningCount < dayCount)\n\n return { start, end }\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 { props } = this\n let input = props.visibleRangeInput\n let simpleInput = typeof input === 'function'\n ? input.call(props.calendarApi, props.dateEnv.toDate(date))\n : input\n\n let range = this.refineRange(simpleInput)\n\n if (range && (range.start == null || range.end == null)) {\n return null\n }\n\n return range\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 // 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 { dateIncrement } = this.props\n let customAlignment\n\n if (dateIncrement) {\n return dateIncrement\n }\n\n if ((customAlignment = this.props.dateAlignment)) {\n return createDuration(1, customAlignment)\n }\n\n if (fallback) {\n return fallback\n }\n\n return createDuration({ days: 1 })\n }\n\n refineRange(rangeInput: DateRangeInput | undefined): DateRange | null {\n if (rangeInput) {\n let range = parseRange(rangeInput, this.props.dateEnv)\n\n if (range) {\n range = computeVisibleDayRange(range)\n }\n\n return range\n }\n\n return null\n }\n\n /* Hidden Days\n ------------------------------------------------------------------------------------------------------------------*/\n\n // Initializes internal variables related to calculating hidden days-of-week\n initHiddenDays() {\n let hiddenDays = this.props.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.props.weekends === false) {\n hiddenDays.push(0, 6) // 0=sunday, 6=saturday\n }\n\n for (i = 0; i < 7; i += 1) {\n if (\n !(isHiddenDayHash[i] = hiddenDays.indexOf(i) !== -1)\n ) {\n dayCnt += 1\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 // 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, end } = range\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 // 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 // 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","import { Action } from './Action'\n\nexport function reduceViewType(viewType: string, action: Action): string {\n switch (action.type) {\n case 'CHANGE_VIEW_TYPE':\n viewType = action.viewType\n }\n\n return viewType\n}\n","import { Action } from './Action'\n\nexport function reduceDynamicOptionOverrides(dynamicOptionOverrides, action: Action) {\n switch (action.type) {\n case 'SET_OPTION':\n return { ...dynamicOptionOverrides, [action.optionName]: action.rawOptionValue }\n default:\n return dynamicOptionOverrides\n }\n}\n","import { DateProfile, DateProfileGenerator } from '../DateProfileGenerator'\nimport { Action } from './Action'\nimport { DateMarker } from '../datelib/marker'\n\nexport function reduceDateProfile(\n currentDateProfile: DateProfile | null,\n action: Action,\n currentDate: DateMarker,\n dateProfileGenerator: DateProfileGenerator,\n): DateProfile {\n let dp: DateProfile\n\n switch (action.type) {\n case 'CHANGE_VIEW_TYPE':\n return dateProfileGenerator.build(action.dateMarker || currentDate)\n\n case 'CHANGE_DATE':\n return dateProfileGenerator.build(action.dateMarker)\n\n case 'PREV':\n dp = dateProfileGenerator.buildPrev(currentDateProfile, currentDate)\n if (dp.isValid) {\n return dp\n }\n break\n\n case 'NEXT':\n dp = dateProfileGenerator.buildNext(currentDateProfile, currentDate)\n if (dp.isValid) {\n return dp\n }\n break\n }\n\n return currentDateProfile\n}\n","import { EventSource, EventSourceHash } from '../structs/event-source'\nimport { parseEventSource, buildEventSourceRefiners } from '../structs/event-source-parse'\nimport { arrayToHash, filterHash } from '../util/object'\nimport { DateRange } from '../datelib/date-range'\nimport { DateProfile } from '../DateProfileGenerator'\nimport { Action } from './Action'\nimport { guid } from '../util/misc'\nimport { CalendarContext } from '../CalendarContext'\nimport { CalendarOptions } from '../options'\n\nexport function initEventSources(calendarOptions, dateProfile: DateProfile, context: CalendarContext) {\n let activeRange = dateProfile ? dateProfile.activeRange : null\n\n return addSources(\n {},\n parseInitialSources(calendarOptions, context),\n activeRange,\n context,\n )\n}\n\nexport function reduceEventSources(\n eventSources: EventSourceHash,\n action: Action,\n dateProfile: DateProfile,\n context: CalendarContext,\n): EventSourceHash {\n let activeRange = dateProfile ? dateProfile.activeRange : null // need this check?\n\n switch (action.type) {\n case 'ADD_EVENT_SOURCES': // already parsed\n return addSources(eventSources, action.sources, activeRange, context)\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 'CHANGE_DATE':\n case 'CHANGE_VIEW_TYPE':\n if (dateProfile) {\n return fetchDirtySources(eventSources, activeRange, context)\n }\n return eventSources\n\n case 'FETCH_EVENT_SOURCES':\n return fetchSourcesByIds(\n eventSources,\n (action as any).sourceIds ? // why no type?\n arrayToHash((action as any).sourceIds) :\n excludeStaticSources(eventSources, context),\n activeRange,\n action.isRefetch || false,\n context,\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\nexport function reduceEventSourcesNewTimeZone(eventSources: EventSourceHash, dateProfile: DateProfile, context: CalendarContext) {\n let activeRange = dateProfile ? dateProfile.activeRange : null // need this check?\n\n return fetchSourcesByIds(\n eventSources,\n excludeStaticSources(eventSources, context),\n activeRange,\n true,\n context,\n )\n}\n\nexport function computeEventSourcesLoading(eventSources: EventSourceHash): boolean {\n for (let sourceId in eventSources) {\n if (eventSources[sourceId].isFetching) {\n return true\n }\n }\n\n return false\n}\n\nfunction addSources(\n eventSourceHash: EventSourceHash,\n sources: EventSource<any>[],\n fetchRange: DateRange | null,\n context: CalendarContext,\n): 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, context)\n }\n\n return { ...eventSourceHash, ...hash }\n}\n\nfunction removeSource(eventSourceHash: EventSourceHash, sourceId: string): EventSourceHash {\n return filterHash(eventSourceHash, (eventSource: EventSource<any>) => eventSource.sourceId !== sourceId)\n}\n\nfunction fetchDirtySources(sourceHash: EventSourceHash, fetchRange: DateRange, context: CalendarContext): EventSourceHash {\n return fetchSourcesByIds(\n sourceHash,\n filterHash(sourceHash, (eventSource) => isSourceDirty(eventSource, fetchRange, context)),\n fetchRange,\n false,\n context,\n )\n}\n\nfunction isSourceDirty(eventSource: EventSource<any>, fetchRange: DateRange, context: CalendarContext) {\n if (!doesSourceNeedRange(eventSource, context)) {\n return !eventSource.latestFetchId\n }\n return !context.options.lazyFetching ||\n !eventSource.fetchRange ||\n eventSource.isFetching || // always cancel outdated in-progress fetches\n fetchRange.start < eventSource.fetchRange.start ||\n fetchRange.end > eventSource.fetchRange.end\n}\n\nfunction fetchSourcesByIds(\n prevSources: EventSourceHash,\n sourceIdHash: { [sourceId: string]: any },\n fetchRange: DateRange,\n isRefetch: boolean,\n context: CalendarContext,\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, isRefetch, context)\n } else {\n nextSources[sourceId] = source\n }\n }\n\n return nextSources\n}\n\nfunction fetchSource(eventSource: EventSource<any>, fetchRange: DateRange, isRefetch: boolean, context: CalendarContext) {\n let { options, calendarApi } = context\n let sourceDef = context.pluginHooks.eventSourceDefs[eventSource.sourceDefId]\n let fetchId = guid()\n\n sourceDef.fetch(\n {\n eventSource,\n range: fetchRange,\n isRefetch,\n context,\n },\n (res) => { // success callback\n let { rawEvents } = res\n\n if (options.eventSourceSuccess) {\n rawEvents = options.eventSourceSuccess.call(calendarApi, rawEvents, res.xhr) || rawEvents\n }\n\n if (eventSource.success) {\n rawEvents = eventSource.success.call(calendarApi, rawEvents, res.xhr) || rawEvents\n }\n\n context.dispatch({\n type: 'RECEIVE_EVENTS',\n sourceId: eventSource.sourceId,\n fetchId,\n fetchRange,\n rawEvents,\n })\n },\n (error) => { // failure callback\n console.warn(error.message, error)\n\n if (options.eventSourceFailure) {\n options.eventSourceFailure.call(calendarApi, error)\n }\n\n if (eventSource.failure) {\n eventSource.failure(error)\n }\n\n context.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\nfunction receiveResponse(sourceHash: EventSourceHash, sourceId: string, fetchId: string, fetchRange: DateRange) {\n let eventSource: EventSource<any> = 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, // also serves as a marker that at least one fetch has completed\n },\n }\n }\n\n return sourceHash\n}\n\nfunction excludeStaticSources(eventSources: EventSourceHash, context: CalendarContext): EventSourceHash {\n return filterHash(eventSources, (eventSource) => doesSourceNeedRange(eventSource, context))\n}\n\nfunction parseInitialSources(rawOptions: CalendarOptions, context: CalendarContext) {\n let refiners = buildEventSourceRefiners(context)\n let rawSources = [].concat(rawOptions.eventSources || [])\n let sources = [] // parsed\n\n if (rawOptions.initialEvents) {\n rawSources.unshift(rawOptions.initialEvents)\n }\n\n if (rawOptions.events) {\n rawSources.unshift(rawOptions.events)\n }\n\n for (let rawSource of rawSources) {\n let source = parseEventSource(rawSource, context, refiners)\n if (source) {\n sources.push(source)\n }\n }\n\n return sources\n}\n\nfunction doesSourceNeedRange(eventSource: EventSource<any>, context: CalendarContext) {\n let defs = context.pluginHooks.eventSourceDefs\n\n return !defs[eventSource.sourceDefId].ignoreRange\n}\n","import { filterHash, mapHash } from '../util/object'\nimport { EventDef } from '../structs/event-def'\nimport { EventInstance, EventInstanceHash } from '../structs/event-instance'\nimport { EventInput } from '../structs/event-parse'\nimport {\n EventStore,\n mergeEventStores,\n createEmptyEventStore,\n filterEventStoreDefs,\n excludeSubEventStore,\n parseEvents,\n} from '../structs/event-store'\nimport { Action } from './Action'\nimport { EventSourceHash, EventSource } from '../structs/event-source'\nimport { DateRange } from '../datelib/date-range'\nimport { DateProfile } from '../DateProfileGenerator'\nimport { DateEnv } from '../datelib/env'\nimport { CalendarContext } from '../CalendarContext'\nimport { expandRecurring } from '../structs/recurring-event'\n\nexport function reduceEventStore(\n eventStore: EventStore,\n action: Action,\n eventSources: EventSourceHash,\n dateProfile: DateProfile,\n context: CalendarContext,\n): EventStore {\n switch (action.type) {\n case 'RECEIVE_EVENTS': // raw\n return receiveRawEvents(\n eventStore,\n eventSources[action.sourceId],\n action.fetchId,\n action.fetchRange,\n action.rawEvents,\n context,\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 context,\n )\n\n case 'RESET_EVENTS':\n return action.eventStore\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 'CHANGE_DATE':\n case 'CHANGE_VIEW_TYPE':\n if (dateProfile) {\n return expandRecurring(eventStore, dateProfile.activeRange, context)\n }\n return eventStore\n\n case 'REMOVE_EVENTS':\n return excludeSubEventStore(eventStore, action.eventStore)\n\n case 'REMOVE_EVENT_SOURCE':\n return excludeEventsBySourceId(eventStore, action.sourceId)\n\n case 'REMOVE_ALL_EVENT_SOURCES':\n return filterEventStoreDefs(eventStore, (eventDef: EventDef) => (\n !eventDef.sourceId // only keep events with no source id\n ))\n\n case 'REMOVE_ALL_EVENTS':\n return createEmptyEventStore()\n\n default:\n return eventStore\n }\n}\n\nfunction receiveRawEvents(\n eventStore: EventStore,\n eventSource: EventSource<any>,\n fetchId: string,\n fetchRange: DateRange | null,\n rawEvents: EventInput[],\n context: CalendarContext,\n): EventStore {\n if (\n eventSource && // not already removed\n fetchId === eventSource.latestFetchId // TODO: wish this logic was always in event-sources\n ) {\n let subset = parseEvents(\n transformRawEvents(rawEvents, eventSource, context),\n eventSource,\n context,\n )\n\n if (fetchRange) {\n subset = expandRecurring(subset, fetchRange, context)\n }\n\n return mergeEventStores(\n excludeEventsBySourceId(eventStore, eventSource.sourceId),\n subset,\n )\n }\n\n return eventStore\n}\n\nfunction transformRawEvents(rawEvents, eventSource: EventSource<any>, context: CalendarContext) {\n let calEachTransform = context.options.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\nfunction addEvent(eventStore: EventStore, subset: EventStore, expandRange: DateRange | null, context: CalendarContext): EventStore {\n if (expandRange) {\n subset = expandRecurring(subset, expandRange, context)\n }\n\n return mergeEventStores(eventStore, subset)\n}\n\nexport function rezoneEventStoreDates(eventStore: EventStore, oldDateEnv: DateEnv, newDateEnv: DateEnv): EventStore {\n let { defs } = eventStore\n\n let instances = mapHash(eventStore.instances, (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 }\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 return { defs, instances }\n}\n\nfunction excludeEventsBySourceId(eventStore: EventStore, sourceId: string) {\n return filterEventStoreDefs(eventStore, (eventDef: EventDef) => eventDef.sourceId !== sourceId)\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, (instance: EventInstance) => !removals[instance.instanceId]),\n }\n}\n","import { DateSpan } from '../structs/date-span'\nimport { Action } from './Action'\n\nexport function reduceDateSelection(currentSelection: DateSpan | null, action: Action) {\n switch (action.type) {\n case 'UNSELECT_DATES':\n return null\n\n case 'SELECT_DATES':\n return action.selection\n\n default:\n return currentSelection\n }\n}\n","import { Action } from './Action'\n\nexport function reduceSelectedEvent(currentInstanceId: string, action: Action): string {\n switch (action.type) {\n case 'UNSELECT_EVENT':\n return ''\n\n case 'SELECT_EVENT':\n return action.eventInstanceId\n\n default:\n return currentInstanceId\n }\n}\n","import { Action } from './Action'\nimport { EventInteractionState } from '../interactions/event-interaction-state'\n\nexport function reduceEventDrag(currentDrag: EventInteractionState | null, action: Action): EventInteractionState | null {\n let newDrag: EventInteractionState\n\n switch (action.type) {\n case 'UNSET_EVENT_DRAG':\n return null\n\n case 'SET_EVENT_DRAG':\n newDrag = action.state\n\n return {\n affectedEvents: newDrag.affectedEvents,\n mutatedEvents: newDrag.mutatedEvents,\n isEvent: newDrag.isEvent,\n }\n\n default:\n return currentDrag\n }\n}\n","import { EventInteractionState } from '../interactions/event-interaction-state'\nimport { Action } from './Action'\n\nexport function reduceEventResize(currentResize: EventInteractionState | null, action: Action): EventInteractionState | null {\n let newResize: EventInteractionState\n\n switch (action.type) {\n case 'UNSET_EVENT_RESIZE':\n return null\n\n case 'SET_EVENT_RESIZE':\n newResize = action.state\n\n return {\n affectedEvents: newResize.affectedEvents,\n mutatedEvents: newResize.mutatedEvents,\n isEvent: newResize.isEvent,\n }\n\n default:\n return currentResize\n }\n}\n","import { ViewSpec, ViewSpecHash } from './structs/view-spec'\nimport { Theme } from './theme/Theme'\nimport { mapHash } from './util/object'\nimport { CalendarApi } from './CalendarApi'\nimport { CalendarOptionsRefined, CalendarOptions } from './options'\nimport { ToolbarInput, ToolbarModel, ToolbarWidget, CustomButtonInput } from './toolbar-struct'\n\nexport function parseToolbars(\n calendarOptions: CalendarOptionsRefined,\n calendarOptionOverrides: CalendarOptions,\n theme: Theme,\n viewSpecs: ViewSpecHash,\n calendarApi: CalendarApi,\n) {\n let viewsWithButtons: string[] = []\n let headerToolbar = calendarOptions.headerToolbar ? parseToolbar(\n calendarOptions.headerToolbar,\n calendarOptions,\n calendarOptionOverrides,\n theme,\n viewSpecs,\n calendarApi,\n viewsWithButtons,\n ) : null\n let footerToolbar = calendarOptions.footerToolbar ? parseToolbar(\n calendarOptions.footerToolbar,\n calendarOptions,\n calendarOptionOverrides,\n theme,\n viewSpecs,\n calendarApi,\n viewsWithButtons,\n ) : null\n\n return { headerToolbar, footerToolbar, viewsWithButtons }\n}\n\nfunction parseToolbar(\n sectionStrHash: ToolbarInput,\n calendarOptions: CalendarOptionsRefined,\n calendarOptionOverrides: CalendarOptions,\n theme: Theme,\n viewSpecs: ViewSpecHash,\n calendarApi: CalendarApi,\n viewsWithButtons: string[], // dump side effects\n) : ToolbarModel {\n return mapHash(\n sectionStrHash as { [section: string]: string },\n (sectionStr) => parseSection(sectionStr, calendarOptions, calendarOptionOverrides, theme, viewSpecs, calendarApi, viewsWithButtons),\n )\n}\n\n/*\nBAD: querying icons and text here. should be done at render time\n*/\nfunction parseSection(\n sectionStr: string,\n calendarOptions: CalendarOptionsRefined,\n calendarOptionOverrides: CalendarOptions,\n theme: Theme,\n viewSpecs: ViewSpecHash,\n calendarApi: CalendarApi,\n viewsWithButtons: string[], // dump side effects\n): ToolbarWidget[][] {\n let isRtl = calendarOptions.direction === 'rtl'\n let calendarCustomButtons = calendarOptions.customButtons || {}\n let calendarButtonTextOverrides = calendarOptionOverrides.buttonText || {}\n let calendarButtonText = calendarOptions.buttonText || {}\n let sectionSubstrs = sectionStr ? sectionStr.split(' ') : []\n\n return sectionSubstrs.map(\n (buttonGroupStr): ToolbarWidget[] => (\n buttonGroupStr.split(',').map((buttonName): ToolbarWidget => {\n if (buttonName === 'title') {\n return { buttonName }\n }\n\n let customButtonProps: CustomButtonInput\n let viewSpec: ViewSpec\n let buttonClick\n let buttonIcon // only one of these will be set\n let buttonText // \"\n\n if ((customButtonProps = calendarCustomButtons[buttonName])) {\n buttonClick = (ev: UIEvent) => {\n if (customButtonProps.click) {\n customButtonProps.click.call(ev.target, ev, ev.target) // TODO: use Calendar this context?\n }\n };\n (buttonIcon = theme.getCustomButtonIconClass(customButtonProps)) ||\n (buttonIcon = theme.getIconClass(buttonName, isRtl)) ||\n (buttonText = customButtonProps.text)\n } else if ((viewSpec = viewSpecs[buttonName])) {\n viewsWithButtons.push(buttonName)\n\n buttonClick = () => {\n calendarApi.changeView(buttonName)\n };\n (buttonText = viewSpec.buttonTextOverride) ||\n (buttonIcon = theme.getIconClass(buttonName, isRtl)) ||\n (buttonText = viewSpec.buttonTextDefault)\n } else if (calendarApi[buttonName]) { // a calendarApi method\n buttonClick = () => {\n calendarApi[buttonName]()\n };\n (buttonText = calendarButtonTextOverrides[buttonName]) ||\n (buttonIcon = theme.getIconClass(buttonName, isRtl)) ||\n (buttonText = calendarButtonText[buttonName])\n // ^ everything else is considered default\n }\n\n return { buttonName, buttonClick, buttonIcon, buttonText }\n })\n ),\n )\n}\n","import { createPlugin } from '../plugin-system'\nimport { EventSourceDef } from '../structs/event-source-def'\nimport { EventInput } from '../structs/event-parse'\n\nlet eventSourceDef: EventSourceDef<EventInput[]> = {\n ignoreRange: true,\n\n parseMeta(refined) {\n if (Array.isArray(refined.events)) {\n return refined.events\n }\n return null\n },\n\n fetch(arg, success) {\n success({\n rawEvents: arg.eventSource.meta,\n })\n },\n}\n\nexport const arrayEventSourcePlugin = createPlugin({\n eventSourceDefs: [eventSourceDef],\n})\n","import { unpromisify } from '../util/promise'\nimport { EventSourceDef } from '../structs/event-source-def'\nimport { EventSourceError } from '../structs/event-source'\nimport { EventInput } from '../structs/event-parse'\nimport { createPlugin } from '../plugin-system'\nimport { buildRangeApiWithTimeZone } from '../structs/date-span'\n\nexport type EventSourceFunc = (\n arg: {\n start: Date\n end: Date\n startStr: string\n endStr: string\n timeZone: string\n },\n successCallback: (events: EventInput[]) => void,\n failureCallback: (error: EventSourceError) => void\n) => (void | PromiseLike<EventInput[]>)\n\nlet eventSourceDef: EventSourceDef<EventSourceFunc> = {\n\n parseMeta(refined) {\n if (typeof refined.events === 'function') {\n return refined.events\n }\n return null\n },\n\n fetch(arg, success, failure) {\n let { dateEnv } = arg.context\n let func = arg.eventSource.meta\n\n unpromisify(\n func.bind(null, buildRangeApiWithTimeZone(arg.range, dateEnv)),\n (rawEvents) => { // success\n success({ rawEvents }) // needs an object response\n },\n failure, // send errorObj directly to failure callback\n )\n },\n\n}\n\nexport const funcEventSourcePlugin = createPlugin({\n eventSourceDefs: [eventSourceDef],\n})\n","import { Dictionary } from '../options'\n\nexport function requestJson(method: string, url: string, params: Dictionary, 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 = () => {\n if (xhr.status >= 200 && xhr.status < 400) {\n let parsed = false\n let res\n\n try {\n res = JSON.parse(xhr.responseText)\n parsed = true\n } catch (err) {\n // will handle parsed=false\n }\n\n if (parsed) {\n successCallback(res, xhr)\n } else {\n failureCallback('Failure parsing JSON', xhr)\n }\n } else {\n failureCallback('Request failed', xhr)\n }\n }\n\n xhr.onerror = () => {\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 { identity, Identity, Dictionary } from '../options'\n\nexport const JSON_FEED_EVENT_SOURCE_REFINERS = {\n method: String,\n extraParams: identity as Identity<Dictionary | (() => Dictionary)>,\n startParam: String,\n endParam: String,\n timeZoneParam: String,\n}\n","import { __assign } from 'tslib'\nimport { requestJson } from '../util/requestJson'\nimport { CalendarContext } from '../CalendarContext'\nimport { EventSourceDef } from '../structs/event-source-def'\nimport { DateRange } from '../datelib/date-range'\nimport { createPlugin } from '../plugin-system'\nimport { JSON_FEED_EVENT_SOURCE_REFINERS } from './json-feed-event-source-refiners'\n\ninterface JsonFeedMeta {\n url: string\n format: 'json' // for EventSourceApi\n method: string\n extraParams?: any\n startParam?: string\n endParam?: string\n timeZoneParam?: string\n}\n\nlet eventSourceDef: EventSourceDef<JsonFeedMeta> = {\n\n parseMeta(refined) {\n if (refined.url && (refined.format === 'json' || !refined.format)) {\n return {\n url: refined.url,\n format: 'json',\n method: (refined.method || 'GET').toUpperCase(),\n extraParams: refined.extraParams,\n startParam: refined.startParam,\n endParam: refined.endParam,\n timeZoneParam: refined.timeZoneParam,\n }\n }\n return null\n },\n\n fetch(arg, success, failure) {\n let { meta } = arg.eventSource\n let requestParams = buildRequestParams(meta, arg.range, arg.context)\n\n requestJson(\n meta.method, meta.url, requestParams,\n (rawEvents, xhr) => {\n success({ rawEvents, xhr })\n },\n (errorMessage, xhr) => {\n failure({ message: errorMessage, xhr })\n },\n )\n },\n\n}\n\nexport const jsonFeedEventSourcePlugin = createPlugin({\n eventSourceRefiners: JSON_FEED_EVENT_SOURCE_REFINERS,\n eventSourceDefs: [eventSourceDef],\n})\n\nfunction buildRequestParams(meta: JsonFeedMeta, range: DateRange, context: CalendarContext) {\n let { dateEnv, options } = context\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 = options.startParam\n }\n\n endParam = meta.endParam\n if (endParam == null) {\n endParam = options.endParam\n }\n\n timeZoneParam = meta.timeZoneParam\n if (timeZoneParam == null) {\n timeZoneParam = options.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 { createDuration } from '../datelib/duration'\nimport { DateInput } from '../datelib/env'\nimport { identity, Identity } from '../options'\n\nexport const SIMPLE_RECURRING_REFINERS = {\n daysOfWeek: identity as Identity<number[]>,\n startTime: createDuration,\n endTime: createDuration,\n duration: createDuration,\n startRecur: identity as Identity<DateInput>,\n endRecur: identity as Identity<DateInput>,\n}\n","import { startOfDay, addDays, DateMarker } from '../datelib/marker'\nimport { Duration, subtractDurations } from '../datelib/duration'\nimport { arrayToHash } from '../util/object'\nimport { RecurringType } from './recurring-event'\nimport { EventRefined } from './event-parse'\nimport { DateRange, intersectRanges } from '../datelib/date-range'\nimport { DateEnv } from '../datelib/env'\nimport { createPlugin } from '../plugin-system'\nimport { SIMPLE_RECURRING_REFINERS } from './recurring-event-simple-refiners'\nimport './recurring-event-simple-declare'\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\nlet recurring: RecurringType<SimpleRecurringData> = {\n\n parse(refined: EventRefined, dateEnv: DateEnv) {\n if (refined.daysOfWeek || refined.startTime || refined.endTime || refined.startRecur || refined.endRecur) {\n let recurringData: SimpleRecurringData = {\n daysOfWeek: refined.daysOfWeek || null,\n startTime: refined.startTime || null,\n endTime: refined.endTime || null,\n startRecur: refined.startRecur ? dateEnv.createMarker(refined.startRecur) : null,\n endRecur: refined.endRecur ? dateEnv.createMarker(refined.endRecur) : null,\n }\n\n let duration: Duration\n\n if (refined.duration) {\n duration = refined.duration\n }\n if (!duration && refined.startTime && refined.endTime) {\n duration = subtractDurations(refined.endTime, refined.startTime)\n }\n\n return {\n allDayGuess: Boolean(!refined.startTime && !refined.endTime),\n duration,\n typeData: recurringData, // 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 }\n return []\n },\n\n}\n\nexport const simpleRecurringEventsPlugin = createPlugin({\n recurringTypes: [recurring],\n eventRefiners: SIMPLE_RECURRING_REFINERS,\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 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 { hashValuesToArray } from './util/object'\nimport { EventSource } from './structs/event-source'\nimport { CalendarContext } from './CalendarContext'\n\nexport const changeHandlerPlugin = createPlugin({\n optionChangeHandlers: {\n events(events, context) {\n handleEventSources([events], context)\n },\n eventSources: handleEventSources,\n },\n})\n\n/*\nBUG: if `event` was supplied, all previously-given `eventSources` will be wiped out\n*/\nfunction handleEventSources(inputs, context: CalendarContext) {\n let unfoundSources: EventSource<any>[] = hashValuesToArray(context.getCurrentData().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 += 1) {\n if (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 context.dispatch({\n type: 'REMOVE_EVENT_SOURCE',\n sourceId: unfoundSource.sourceId,\n })\n }\n\n for (let newInput of newInputs) {\n context.calendarApi.addEventSource(newInput)\n }\n}\n","import { DateProfile } from './DateProfileGenerator'\nimport { CalendarData } from './reducers/data-types'\nimport { RangeApiWithTimeZone, buildRangeApiWithTimeZone } from './structs/date-span'\nimport { ViewApi } from './ViewApi'\n\nexport type DatesSetArg = RangeApiWithTimeZone & { view: ViewApi }\n\nexport function handleDateProfile(dateProfile: DateProfile, context: CalendarData) {\n context.emitter.trigger('datesSet', {\n ...buildRangeApiWithTimeZone(dateProfile.activeRange, context.dateEnv),\n view: context.viewApi,\n })\n}\n","import { EventStore } from './structs/event-store'\nimport { CalendarData } from './reducers/data-types'\nimport { EventApi, buildEventApis } from './api/EventApi'\nimport { Duration } from './datelib/duration'\nimport { ViewApi } from './ViewApi'\n\nexport interface EventAddArg {\n event: EventApi\n relatedEvents: EventApi[]\n revert: () => void\n}\n\nexport interface EventChangeArg {\n oldEvent: EventApi\n event: EventApi\n relatedEvents: EventApi[]\n revert: () => void\n}\n\nexport interface EventDropArg extends EventChangeArg { // not best place. deals w/ UI\n el: HTMLElement\n delta: Duration\n jsEvent: MouseEvent\n view: ViewApi\n // and other \"transformed\" things\n}\n\nexport interface EventRemoveArg {\n event: EventApi\n relatedEvents: EventApi[]\n revert: () => void\n}\n\nexport function handleEventStore(eventStore: EventStore, context: CalendarData) {\n let { emitter } = context\n\n if (emitter.hasHandlers('eventsSet')) {\n emitter.trigger('eventsSet', buildEventApis(eventStore, context))\n }\n}\n","import { PluginDef } from './plugin-system-struct'\nimport { createPlugin } 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 { simpleRecurringEventsPlugin } from './structs/recurring-event-simple'\nimport { changeHandlerPlugin } from './option-change-handlers'\nimport { handleDateProfile } from './dates-set'\nimport { handleEventStore } from './event-crud'\nimport { isArraysEqual } from './util/array'\nimport { removeElement } from './util/dom-manip'\nimport { computeEventSourcesLoading } from './reducers/eventSources'\nimport { CalendarDataManagerState } from './reducers/data-types'\n\n/*\nthis array is exposed on the root namespace so that UMD plugins can add to it.\nsee the rollup-bundles script.\n*/\nexport const globalPlugins: PluginDef[] = [ // TODO: make a const?\n arrayEventSourcePlugin,\n funcEventSourcePlugin,\n jsonFeedEventSourcePlugin,\n simpleRecurringEventsPlugin,\n changeHandlerPlugin,\n createPlugin({ // misc...\n isLoadingFuncs: [\n (state: CalendarDataManagerState) => computeEventSourcesLoading(state.eventSources),\n ],\n contentTypeHandlers: {\n html: () => ({ render: injectHtml }),\n domNodes: () => ({ render: injectDomNodes }),\n },\n propSetHandlers: {\n dateProfile: handleDateProfile,\n eventStore: handleEventStore,\n },\n }),\n]\n\nexport function injectHtml(el: HTMLElement, html: string) {\n el.innerHTML = html\n}\n\nexport function injectDomNodes(el: HTMLElement, domNodes: Node[] | NodeList) {\n let oldNodes = Array.prototype.slice.call(el.childNodes) // TODO: use array util\n let newNodes = Array.prototype.slice.call(domNodes) // TODO: use array util\n\n if (!isArraysEqual(oldNodes, newNodes)) {\n for (let newNode of newNodes) {\n el.appendChild(newNode)\n }\n oldNodes.forEach(removeElement)\n }\n}\n","export class DelayedRunner {\n private isRunning = false\n private isDirty = false\n private pauseDepths: { [scope: string]: number } = {}\n private timeoutId: number = 0\n\n constructor(\n private drainedOption?: () => void,\n ) {\n }\n\n request(delay?: number) {\n this.isDirty = true\n\n if (!this.isPaused()) {\n this.clearTimeout()\n\n if (delay == null) {\n this.tryDrain()\n } else {\n this.timeoutId = setTimeout( // NOT OPTIMAL! TODO: look at debounce\n this.tryDrain.bind(this),\n delay,\n ) as unknown as number\n }\n }\n }\n\n pause(scope = '') {\n let { pauseDepths } = this\n\n pauseDepths[scope] = (pauseDepths[scope] || 0) + 1\n\n this.clearTimeout()\n }\n\n resume(scope = '', force?: boolean) {\n let { pauseDepths } = this\n\n if (scope in pauseDepths) {\n if (force) {\n delete pauseDepths[scope]\n } else {\n pauseDepths[scope] -= 1\n let depth = pauseDepths[scope]\n\n if (depth <= 0) {\n delete pauseDepths[scope]\n }\n }\n\n this.tryDrain()\n }\n }\n\n isPaused() {\n return Object.keys(this.pauseDepths).length\n }\n\n tryDrain() {\n if (!this.isRunning && !this.isPaused()) {\n this.isRunning = true\n\n while (this.isDirty) {\n this.isDirty = false\n this.drained() // might set isDirty to true again\n }\n\n this.isRunning = false\n }\n }\n\n clear() {\n this.clearTimeout()\n this.isDirty = false\n this.pauseDepths = {}\n }\n\n private clearTimeout() {\n if (this.timeoutId) {\n clearTimeout(this.timeoutId)\n this.timeoutId = 0\n }\n }\n\n protected drained() { // subclasses can implement\n if (this.drainedOption) {\n this.drainedOption()\n }\n }\n}\n","import { DelayedRunner } from './DelayedRunner'\n\nexport class TaskRunner<Task> { // this class USES the DelayedRunner\n private queue: Task[] = []\n\n private delayedRunner: DelayedRunner // will most likely be used WITHOUT any delay\n\n constructor(\n private runTaskOption?: (task: Task) => void,\n private drainedOption?: (completedTasks: Task[]) => void,\n ) {\n this.delayedRunner = new DelayedRunner(this.drain.bind(this))\n }\n\n request(task: Task, delay?: number) {\n this.queue.push(task)\n this.delayedRunner.request(delay)\n }\n\n pause(scope?: string) {\n this.delayedRunner.pause(scope)\n }\n\n resume(scope?: string, force?: boolean) {\n this.delayedRunner.resume(scope, force)\n }\n\n drain() {\n let { queue } = this\n\n while (queue.length) {\n let completedTasks: Task[] = []\n let task: Task\n\n while ((task = queue.shift())) {\n this.runTask(task)\n completedTasks.push(task)\n }\n\n this.drained(completedTasks)\n } // keep going, in case new tasks were added in the drained handler\n }\n\n protected runTask(task: Task) { // subclasses can implement\n if (this.runTaskOption) {\n this.runTaskOption(task)\n }\n }\n\n protected drained(completedTasks: Task[]) { // subclasses can implement\n if (this.drainedOption) {\n this.drainedOption(completedTasks)\n }\n }\n}\n","import { DateProfile } from '../DateProfileGenerator'\nimport { diffWholeDays } from '../datelib/marker'\nimport { createFormatter, FormatterInput } from '../datelib/formatting'\nimport { DateRange } from '../datelib/date-range'\nimport { DateEnv } from '../datelib/env'\nimport { BaseOptions } from '../options'\n\n// Computes what the title at the top of the calendarApi should be for this view\nexport function buildTitle(dateProfile: DateProfile, viewOptions: BaseOptions, dateEnv: DateEnv) {\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 dateEnv.formatRange(\n range.start,\n range.end,\n createFormatter(viewOptions.titleFormat || buildTitleFormat(dateProfile)),\n {\n isEndExclusive: dateProfile.isRangeAllDay,\n defaultSeparator: viewOptions.titleRangeSeparator,\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 buildTitleFormat(dateProfile: DateProfile): FormatterInput {\n let { currentRangeUnit } = dateProfile\n\n if (currentRangeUnit === 'year') {\n return { year: 'numeric' }\n }\n\n if (currentRangeUnit === 'month') {\n return { year: 'numeric', month: 'long' } // like \"September 2014\"\n }\n\n let days = diffWholeDays(\n dateProfile.currentRange.start,\n dateProfile.currentRange.end,\n )\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 }\n\n // one day. longer, like \"September 9 2014\"\n return { year: 'numeric', month: 'long', day: 'numeric' }\n}\n","import { __assign } from 'tslib'\nimport { buildLocale, RawLocaleInfo, organizeRawLocales, LocaleSingularArg } from '../datelib/locale'\nimport { memoize, memoizeObjArg } from '../util/memoize'\nimport { Action } from './Action'\nimport { buildBuildPluginHooks } from '../plugin-system'\nimport { PluginHooks } from '../plugin-system-struct'\nimport { DateEnv } from '../datelib/env'\nimport { CalendarApi } from '../CalendarApi'\nimport { StandardTheme } from '../theme/StandardTheme'\nimport { EventSourceHash } from '../structs/event-source'\nimport { buildViewSpecs, ViewSpec } from '../structs/view-spec'\nimport { mapHash, isPropsEqual } from '../util/object'\nimport { DateProfileGenerator, DateProfileGeneratorProps } from '../DateProfileGenerator'\nimport { reduceViewType } from './view-type'\nimport { getInitialDate, reduceCurrentDate } from './current-date'\nimport { reduceDynamicOptionOverrides } from './options'\nimport { reduceDateProfile } from './date-profile'\nimport { reduceEventSources, initEventSources, reduceEventSourcesNewTimeZone, computeEventSourcesLoading } from './eventSources'\nimport { reduceEventStore, rezoneEventStoreDates } from './eventStore'\nimport { reduceDateSelection } from './date-selection'\nimport { reduceSelectedEvent } from './selected-event'\nimport { reduceEventDrag } from './event-drag'\nimport { reduceEventResize } from './event-resize'\nimport { Emitter } from '../common/Emitter'\nimport { EventUiHash, EventUi, createEventUi } from '../component/event-ui'\nimport { EventDefHash } from '../structs/event-def'\nimport { parseToolbars } from '../toolbar-parse'\nimport {\n CalendarOptionsRefined, CalendarOptions,\n CALENDAR_OPTION_REFINERS, COMPLEX_OPTION_COMPARATORS,\n ViewOptions, ViewOptionsRefined,\n BASE_OPTION_DEFAULTS, mergeRawOptions,\n BASE_OPTION_REFINERS, VIEW_OPTION_REFINERS,\n CalendarListeners, CALENDAR_LISTENER_REFINERS, Dictionary,\n} from '../options'\nimport { rangeContainsMarker } from '../datelib/date-range'\nimport { ViewApi } from '../ViewApi'\nimport { parseBusinessHours } from '../structs/business-hours'\nimport { globalPlugins } from '../global-plugins'\nimport { createEmptyEventStore } from '../structs/event-store'\nimport { CalendarContext } from '../CalendarContext'\nimport { CalendarDataManagerState, CalendarOptionsData, CalendarCurrentViewData, CalendarData } from './data-types'\nimport { TaskRunner } from '../util/TaskRunner'\nimport { buildTitle } from './title-formatting'\n\nexport interface CalendarDataManagerProps {\n optionOverrides: CalendarOptions\n calendarApi: CalendarApi\n onAction?: (action: Action) => void\n onData?: (data: CalendarData) => void\n}\n\nexport type ReducerFunc = ( // TODO: rename to CalendarDataInjector. move view-props-manip hook here as well?\n currentState: Dictionary | null,\n action: Action | null,\n context: CalendarContext & CalendarDataManagerState // more than just context\n) => Dictionary\n\n// in future refactor, do the redux-style function(state=initial) for initial-state\n// also, whatever is happening in constructor, have it happen in action queue too\n\nexport class CalendarDataManager {\n private computeOptionsData = memoize(this._computeOptionsData)\n private computeCurrentViewData = memoize(this._computeCurrentViewData)\n private organizeRawLocales = memoize(organizeRawLocales)\n private buildLocale = memoize(buildLocale)\n private buildPluginHooks = buildBuildPluginHooks()\n private buildDateEnv = memoize(buildDateEnv)\n private buildTheme = memoize(buildTheme)\n private parseToolbars = memoize(parseToolbars)\n private buildViewSpecs = memoize(buildViewSpecs)\n private buildDateProfileGenerator = memoizeObjArg(buildDateProfileGenerator)\n private buildViewApi = memoize(buildViewApi)\n private buildViewUiProps = memoizeObjArg(buildViewUiProps)\n private buildEventUiBySource = memoize(buildEventUiBySource, isPropsEqual)\n private buildEventUiBases = memoize(buildEventUiBases)\n private parseContextBusinessHours = memoizeObjArg(parseContextBusinessHours)\n private buildTitle = memoize(buildTitle)\n\n public emitter = new Emitter<CalendarListeners>()\n private actionRunner = new TaskRunner(this._handleAction.bind(this), this.updateData.bind(this))\n private props: CalendarDataManagerProps\n private state: CalendarDataManagerState\n private data: CalendarData\n\n public currentCalendarOptionsInput: CalendarOptions = {}\n private currentCalendarOptionsRefined: CalendarOptionsRefined = ({} as any)\n private currentViewOptionsInput: ViewOptions = {}\n private currentViewOptionsRefined: ViewOptionsRefined = ({} as any)\n public currentCalendarOptionsRefiners: any = {}\n\n constructor(props: CalendarDataManagerProps) {\n this.props = props\n this.actionRunner.pause()\n\n let dynamicOptionOverrides: CalendarOptions = {}\n let optionsData = this.computeOptionsData(\n props.optionOverrides,\n dynamicOptionOverrides,\n props.calendarApi,\n )\n\n let currentViewType = optionsData.calendarOptions.initialView || optionsData.pluginHooks.initialView\n let currentViewData = this.computeCurrentViewData(\n currentViewType,\n optionsData,\n props.optionOverrides,\n dynamicOptionOverrides,\n )\n\n // wire things up\n // TODO: not DRY\n props.calendarApi.currentDataManager = this\n this.emitter.setThisContext(props.calendarApi)\n this.emitter.setOptions(currentViewData.options)\n\n let currentDate = getInitialDate(optionsData.calendarOptions, optionsData.dateEnv)\n let dateProfile = currentViewData.dateProfileGenerator.build(currentDate)\n\n if (!rangeContainsMarker(dateProfile.activeRange, currentDate)) {\n currentDate = dateProfile.currentRange.start\n }\n\n let calendarContext: CalendarContext = {\n dateEnv: optionsData.dateEnv,\n options: optionsData.calendarOptions,\n pluginHooks: optionsData.pluginHooks,\n calendarApi: props.calendarApi,\n dispatch: this.dispatch,\n emitter: this.emitter,\n getCurrentData: this.getCurrentData,\n }\n\n // needs to be after setThisContext\n for (let callback of optionsData.pluginHooks.contextInit) {\n callback(calendarContext)\n }\n\n // NOT DRY\n let eventSources = initEventSources(optionsData.calendarOptions, dateProfile, calendarContext)\n\n let initialState: CalendarDataManagerState = {\n dynamicOptionOverrides,\n currentViewType,\n currentDate,\n dateProfile,\n businessHours: this.parseContextBusinessHours(calendarContext), // weird to have this in state\n eventSources,\n eventUiBases: {},\n eventStore: createEmptyEventStore(),\n renderableEventStore: createEmptyEventStore(),\n dateSelection: null,\n eventSelection: '',\n eventDrag: null,\n eventResize: null,\n selectionConfig: this.buildViewUiProps(calendarContext).selectionConfig,\n }\n let contextAndState = { ...calendarContext, ...initialState }\n\n for (let reducer of optionsData.pluginHooks.reducers) {\n __assign(initialState, reducer(null, null, contextAndState))\n }\n\n if (computeIsLoading(initialState, calendarContext)) {\n this.emitter.trigger('loading', true) // NOT DRY\n }\n\n this.state = initialState\n this.updateData()\n this.actionRunner.resume()\n }\n\n getCurrentData = () => this.data\n\n dispatch = (action: Action) => {\n this.actionRunner.request(action) // protects against recursive calls to _handleAction\n }\n\n resetOptions(optionOverrides: CalendarOptions, append?: boolean) {\n let { props } = this\n\n props.optionOverrides = append\n ? { ...props.optionOverrides, ...optionOverrides }\n : optionOverrides\n\n this.actionRunner.request({ // hack. will cause updateData\n type: 'NOTHING',\n })\n }\n\n _handleAction(action: Action) {\n let { props, state, emitter } = this\n\n let dynamicOptionOverrides = reduceDynamicOptionOverrides(state.dynamicOptionOverrides, action)\n let optionsData = this.computeOptionsData(\n props.optionOverrides,\n dynamicOptionOverrides,\n props.calendarApi,\n )\n\n let currentViewType = reduceViewType(state.currentViewType, action)\n let currentViewData = this.computeCurrentViewData(\n currentViewType,\n optionsData,\n props.optionOverrides,\n dynamicOptionOverrides,\n )\n\n // wire things up\n // TODO: not DRY\n props.calendarApi.currentDataManager = this\n emitter.setThisContext(props.calendarApi)\n emitter.setOptions(currentViewData.options)\n\n let calendarContext: CalendarContext = {\n dateEnv: optionsData.dateEnv,\n options: optionsData.calendarOptions,\n pluginHooks: optionsData.pluginHooks,\n calendarApi: props.calendarApi,\n dispatch: this.dispatch,\n emitter,\n getCurrentData: this.getCurrentData,\n }\n\n let { currentDate, dateProfile } = state\n\n if (this.data && this.data.dateProfileGenerator !== currentViewData.dateProfileGenerator) { // hack\n dateProfile = currentViewData.dateProfileGenerator.build(currentDate)\n }\n\n currentDate = reduceCurrentDate(currentDate, action)\n dateProfile = reduceDateProfile(dateProfile, action, currentDate, currentViewData.dateProfileGenerator)\n\n if (\n action.type === 'PREV' || // TODO: move this logic into DateProfileGenerator\n action.type === 'NEXT' || // \"\n !rangeContainsMarker(dateProfile.currentRange, currentDate)\n ) {\n currentDate = dateProfile.currentRange.start\n }\n\n let eventSources = reduceEventSources(state.eventSources, action, dateProfile, calendarContext)\n let eventStore = reduceEventStore(state.eventStore, action, eventSources, dateProfile, calendarContext)\n let isEventsLoading = computeEventSourcesLoading(eventSources) // BAD. also called in this func in computeIsLoading\n\n let renderableEventStore =\n (isEventsLoading && !currentViewData.options.progressiveEventRendering) ?\n (state.renderableEventStore || eventStore) : // try from previous state\n eventStore\n\n let { eventUiSingleBase, selectionConfig } = this.buildViewUiProps(calendarContext) // will memoize obj\n let eventUiBySource = this.buildEventUiBySource(eventSources)\n let eventUiBases = this.buildEventUiBases(renderableEventStore.defs, eventUiSingleBase, eventUiBySource)\n\n let newState: CalendarDataManagerState = {\n dynamicOptionOverrides,\n currentViewType,\n currentDate,\n dateProfile,\n eventSources,\n eventStore,\n renderableEventStore,\n selectionConfig,\n eventUiBases,\n businessHours: this.parseContextBusinessHours(calendarContext), // will memoize obj\n dateSelection: reduceDateSelection(state.dateSelection, action),\n eventSelection: reduceSelectedEvent(state.eventSelection, action),\n eventDrag: reduceEventDrag(state.eventDrag, action),\n eventResize: reduceEventResize(state.eventResize, action),\n }\n let contextAndState = { ...calendarContext, ...newState }\n\n for (let reducer of optionsData.pluginHooks.reducers) {\n __assign(newState, reducer(state, action, contextAndState)) // give the OLD state, for old value\n }\n\n let wasLoading = computeIsLoading(state, calendarContext)\n let isLoading = computeIsLoading(newState, calendarContext)\n\n // TODO: use propSetHandlers in plugin system\n if (!wasLoading && isLoading) {\n emitter.trigger('loading', true)\n } else if (wasLoading && !isLoading) {\n emitter.trigger('loading', false)\n }\n\n this.state = newState\n\n if (props.onAction) {\n props.onAction(action)\n }\n }\n\n updateData() {\n let { props, state } = this\n let oldData = this.data\n\n let optionsData = this.computeOptionsData(\n props.optionOverrides,\n state.dynamicOptionOverrides,\n props.calendarApi,\n )\n\n let currentViewData = this.computeCurrentViewData(\n state.currentViewType,\n optionsData,\n props.optionOverrides,\n state.dynamicOptionOverrides,\n )\n\n let data: CalendarData = this.data = {\n viewTitle: this.buildTitle(state.dateProfile, currentViewData.options, optionsData.dateEnv),\n calendarApi: props.calendarApi,\n dispatch: this.dispatch,\n emitter: this.emitter,\n getCurrentData: this.getCurrentData,\n ...optionsData,\n ...currentViewData,\n ...state,\n }\n\n let changeHandlers = optionsData.pluginHooks.optionChangeHandlers\n let oldCalendarOptions = oldData && oldData.calendarOptions\n let newCalendarOptions = optionsData.calendarOptions\n\n if (oldCalendarOptions && oldCalendarOptions !== newCalendarOptions) {\n if (oldCalendarOptions.timeZone !== newCalendarOptions.timeZone) {\n // hack\n state.eventSources = data.eventSources = reduceEventSourcesNewTimeZone(data.eventSources, state.dateProfile, data)\n state.eventStore = data.eventStore = rezoneEventStoreDates(data.eventStore, oldData.dateEnv, data.dateEnv)\n }\n\n for (let optionName in changeHandlers) {\n if (oldCalendarOptions[optionName] !== newCalendarOptions[optionName]) {\n changeHandlers[optionName](newCalendarOptions[optionName], data)\n }\n }\n }\n\n if (props.onData) {\n props.onData(data)\n }\n }\n\n _computeOptionsData(\n optionOverrides: CalendarOptions,\n dynamicOptionOverrides: CalendarOptions,\n calendarApi: CalendarApi,\n ): CalendarOptionsData {\n // TODO: blacklist options that are handled by optionChangeHandlers\n\n let {\n refinedOptions, pluginHooks, localeDefaults, availableLocaleData, extra,\n } = this.processRawCalendarOptions(optionOverrides, dynamicOptionOverrides)\n\n warnUnknownOptions(extra)\n\n let dateEnv = this.buildDateEnv(\n refinedOptions.timeZone,\n refinedOptions.locale,\n refinedOptions.weekNumberCalculation,\n refinedOptions.firstDay,\n refinedOptions.weekText,\n pluginHooks,\n availableLocaleData,\n refinedOptions.defaultRangeSeparator,\n )\n\n let viewSpecs = this.buildViewSpecs(pluginHooks.views, optionOverrides, dynamicOptionOverrides, localeDefaults)\n let theme = this.buildTheme(refinedOptions, pluginHooks)\n let toolbarConfig = this.parseToolbars(refinedOptions, optionOverrides, theme, viewSpecs, calendarApi)\n\n return {\n calendarOptions: refinedOptions,\n pluginHooks,\n dateEnv,\n viewSpecs,\n theme,\n toolbarConfig,\n localeDefaults,\n availableRawLocales: availableLocaleData.map,\n }\n }\n\n // always called from behind a memoizer\n processRawCalendarOptions(optionOverrides: CalendarOptions, dynamicOptionOverrides: CalendarOptions) {\n let { locales, locale } = mergeRawOptions([\n BASE_OPTION_DEFAULTS,\n optionOverrides,\n dynamicOptionOverrides,\n ])\n let availableLocaleData = this.organizeRawLocales(locales)\n let availableRawLocales = availableLocaleData.map\n let localeDefaults = this.buildLocale(locale || availableLocaleData.defaultCode, availableRawLocales).options\n let pluginHooks = this.buildPluginHooks(optionOverrides.plugins || [], globalPlugins)\n let refiners = this.currentCalendarOptionsRefiners = {\n ...BASE_OPTION_REFINERS,\n ...CALENDAR_LISTENER_REFINERS,\n ...CALENDAR_OPTION_REFINERS,\n ...pluginHooks.listenerRefiners,\n ...pluginHooks.optionRefiners,\n }\n let extra = {}\n\n let raw = mergeRawOptions([\n BASE_OPTION_DEFAULTS,\n localeDefaults,\n optionOverrides,\n dynamicOptionOverrides,\n ])\n let refined: Partial<CalendarOptionsRefined> = {}\n let currentRaw = this.currentCalendarOptionsInput\n let currentRefined = this.currentCalendarOptionsRefined\n let anyChanges = false\n\n for (let optionName in raw) {\n if (optionName !== 'plugins') { // because plugins is special-cased\n if (\n raw[optionName] === currentRaw[optionName] ||\n (\n COMPLEX_OPTION_COMPARATORS[optionName] &&\n (optionName in currentRaw) &&\n COMPLEX_OPTION_COMPARATORS[optionName](currentRaw[optionName], raw[optionName])\n )\n ) {\n refined[optionName] = currentRefined[optionName]\n } else if (refiners[optionName]) {\n refined[optionName] = refiners[optionName](raw[optionName])\n anyChanges = true\n } else {\n extra[optionName] = currentRaw[optionName]\n }\n }\n }\n\n if (anyChanges) {\n this.currentCalendarOptionsInput = raw\n this.currentCalendarOptionsRefined = refined as CalendarOptionsRefined\n }\n\n return {\n rawOptions: this.currentCalendarOptionsInput,\n refinedOptions: this.currentCalendarOptionsRefined,\n pluginHooks,\n availableLocaleData,\n localeDefaults,\n extra,\n }\n }\n\n _computeCurrentViewData(\n viewType: string,\n optionsData: CalendarOptionsData,\n optionOverrides: CalendarOptions,\n dynamicOptionOverrides: CalendarOptions,\n ): CalendarCurrentViewData {\n let viewSpec = optionsData.viewSpecs[viewType]\n\n if (!viewSpec) {\n throw new Error(`viewType \"${viewType}\" is not available. Please make sure you've loaded all neccessary plugins`)\n }\n\n let { refinedOptions, extra } = this.processRawViewOptions(\n viewSpec,\n optionsData.pluginHooks,\n optionsData.localeDefaults,\n optionOverrides,\n dynamicOptionOverrides,\n )\n\n warnUnknownOptions(extra)\n\n let dateProfileGenerator = this.buildDateProfileGenerator({\n dateProfileGeneratorClass: viewSpec.optionDefaults.dateProfileGeneratorClass as any,\n duration: viewSpec.duration,\n durationUnit: viewSpec.durationUnit,\n usesMinMaxTime: viewSpec.optionDefaults.usesMinMaxTime as any,\n dateEnv: optionsData.dateEnv,\n calendarApi: this.props.calendarApi, // should come from elsewhere?\n slotMinTime: refinedOptions.slotMinTime,\n slotMaxTime: refinedOptions.slotMaxTime,\n showNonCurrentDates: refinedOptions.showNonCurrentDates,\n dayCount: refinedOptions.dayCount,\n dateAlignment: refinedOptions.dateAlignment,\n dateIncrement: refinedOptions.dateIncrement,\n hiddenDays: refinedOptions.hiddenDays,\n weekends: refinedOptions.weekends,\n nowInput: refinedOptions.now,\n validRangeInput: refinedOptions.validRange,\n visibleRangeInput: refinedOptions.visibleRange,\n monthMode: refinedOptions.monthMode,\n fixedWeekCount: refinedOptions.fixedWeekCount,\n })\n\n let viewApi = this.buildViewApi(viewType, this.getCurrentData, optionsData.dateEnv)\n\n return { viewSpec, options: refinedOptions, dateProfileGenerator, viewApi }\n }\n\n processRawViewOptions(\n viewSpec: ViewSpec,\n pluginHooks: PluginHooks,\n localeDefaults: CalendarOptions,\n optionOverrides: CalendarOptions,\n dynamicOptionOverrides: CalendarOptions,\n ) {\n let raw = mergeRawOptions([\n BASE_OPTION_DEFAULTS,\n viewSpec.optionDefaults,\n localeDefaults,\n optionOverrides,\n viewSpec.optionOverrides,\n dynamicOptionOverrides,\n ])\n let refiners = {\n ...BASE_OPTION_REFINERS,\n ...CALENDAR_LISTENER_REFINERS,\n ...CALENDAR_OPTION_REFINERS,\n ...VIEW_OPTION_REFINERS,\n ...pluginHooks.listenerRefiners,\n ...pluginHooks.optionRefiners,\n }\n let refined: Partial<ViewOptionsRefined> = {}\n let currentRaw = this.currentViewOptionsInput\n let currentRefined = this.currentViewOptionsRefined\n let anyChanges = false\n let extra = {}\n\n for (let optionName in raw) {\n if (raw[optionName] === currentRaw[optionName]) {\n refined[optionName] = currentRefined[optionName]\n } else {\n if (raw[optionName] === this.currentCalendarOptionsInput[optionName]) {\n if (optionName in this.currentCalendarOptionsRefined) { // might be an \"extra\" prop\n refined[optionName] = this.currentCalendarOptionsRefined[optionName]\n }\n } else if (refiners[optionName]) {\n refined[optionName] = refiners[optionName](raw[optionName])\n } else {\n extra[optionName] = raw[optionName]\n }\n\n anyChanges = true\n }\n }\n\n if (anyChanges) {\n this.currentViewOptionsInput = raw\n this.currentViewOptionsRefined = refined as ViewOptionsRefined\n }\n\n return {\n rawOptions: this.currentViewOptionsInput,\n refinedOptions: this.currentViewOptionsRefined,\n extra,\n }\n }\n}\n\nfunction buildDateEnv(\n timeZone: string,\n explicitLocale: LocaleSingularArg,\n weekNumberCalculation,\n firstDay: number | undefined,\n weekText,\n pluginHooks: PluginHooks,\n availableLocaleData: RawLocaleInfo,\n defaultSeparator: string,\n) {\n let locale = buildLocale(explicitLocale || availableLocaleData.defaultCode, availableLocaleData.map)\n\n return new DateEnv({\n calendarSystem: 'gregory', // TODO: make this a setting\n timeZone,\n namedTimeZoneImpl: pluginHooks.namedTimeZonedImpl,\n locale,\n weekNumberCalculation,\n firstDay,\n weekText,\n cmdFormatter: pluginHooks.cmdFormatter,\n defaultSeparator,\n })\n}\n\nfunction buildTheme(options: CalendarOptionsRefined, pluginHooks: PluginHooks) {\n let ThemeClass = pluginHooks.themeClasses[options.themeSystem] || StandardTheme\n\n return new ThemeClass(options)\n}\n\nfunction buildDateProfileGenerator(props: DateProfileGeneratorProps): DateProfileGenerator {\n let DateProfileGeneratorClass = props.dateProfileGeneratorClass || DateProfileGenerator\n\n return new DateProfileGeneratorClass(props)\n}\n\nfunction buildViewApi(type: string, getCurrentData: () => CalendarData, dateEnv: DateEnv) {\n return new ViewApi(type, getCurrentData, dateEnv)\n}\n\nfunction buildEventUiBySource(eventSources: EventSourceHash): EventUiHash {\n return mapHash(eventSources, (eventSource) => eventSource.ui)\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\nfunction buildViewUiProps(calendarContext: CalendarContext) {\n let { options } = calendarContext\n\n return {\n eventUiSingleBase: createEventUi(\n {\n display: options.eventDisplay,\n editable: options.editable, // without \"event\" at start\n startEditable: options.eventStartEditable,\n durationEditable: options.eventDurationEditable,\n constraint: options.eventConstraint,\n overlap: typeof options.eventOverlap === 'boolean' ? options.eventOverlap : undefined,\n allow: options.eventAllow,\n backgroundColor: options.eventBackgroundColor,\n borderColor: options.eventBorderColor,\n textColor: options.eventTextColor,\n color: options.eventColor,\n // classNames: options.eventClassNames // render hook will handle this\n },\n calendarContext,\n ),\n selectionConfig: createEventUi(\n {\n constraint: options.selectConstraint,\n overlap: typeof options.selectOverlap === 'boolean' ? options.selectOverlap : undefined,\n allow: options.selectAllow,\n },\n calendarContext,\n ),\n }\n}\n\nfunction computeIsLoading(state: CalendarDataManagerState, context: CalendarContext) {\n for (let isLoadingFunc of context.pluginHooks.isLoadingFuncs) {\n if (isLoadingFunc(state)) {\n return true\n }\n }\n\n return false\n}\n\nfunction parseContextBusinessHours(calendarContext: CalendarContext) {\n return parseBusinessHours(calendarContext.options.businessHours, calendarContext)\n}\n\nfunction warnUnknownOptions(options: any, viewName?: string) {\n for (let optionName in options) {\n console.warn(\n `Unknown option '${optionName}'` +\n (viewName ? ` for view '${viewName}'` : ''),\n )\n }\n}\n","import { Component, ComponentChildren } from '../vdom'\nimport { CalendarDataManager } from '../reducers/CalendarDataManager'\nimport { CalendarApi } from '../CalendarApi'\nimport { CalendarData } from '../reducers/data-types'\n\nexport interface CalendarDataProviderProps {\n optionOverrides: any\n calendarApi: CalendarApi\n children?: (data: CalendarData) => ComponentChildren\n}\n\n// TODO: move this to react plugin?\nexport class CalendarDataProvider extends Component<CalendarDataProviderProps, CalendarData> {\n dataManager: CalendarDataManager\n\n constructor(props: CalendarDataProviderProps) {\n super(props)\n\n this.dataManager = new CalendarDataManager({\n optionOverrides: props.optionOverrides,\n calendarApi: props.calendarApi,\n onData: this.handleData,\n })\n }\n\n handleData = (data: CalendarData) => {\n if (!this.dataManager) { // still within initial run, before assignment in constructor\n // eslint-disable-next-line react/no-direct-mutation-state\n this.state = data // can't use setState yet\n } else {\n this.setState(data)\n }\n }\n\n render() {\n return this.props.children(this.state)\n }\n\n componentDidUpdate(prevProps: CalendarDataProviderProps) {\n let newOptionOverrides = this.props.optionOverrides\n\n if (newOptionOverrides !== prevProps.optionOverrides) { // prevent recursive handleData\n this.dataManager.resetOptions(newOptionOverrides)\n }\n }\n}\n","import { DateProfile } from './DateProfileGenerator'\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 { Duration } from './datelib/duration'\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 isHeightAuto: boolean\n forPrint: boolean\n}\n\n// HELPERS\n\n/*\nif nextDayThreshold is specified, slicing is done in an all-day fashion.\nyou can get nextDayThreshold from context.nextDayThreshold\n*/\nexport function sliceEvents(\n props: ViewProps & { dateProfile: DateProfile, nextDayThreshold: Duration },\n allDay?: boolean,\n): EventRenderRange[] {\n return sliceEventStore(\n props.eventStore,\n props.eventUiBases,\n props.dateProfile.activeRange,\n allDay ? props.nextDayThreshold : null,\n ).fg\n}\n","export abstract class NamedTimeZoneImpl {\n timeZoneName: string\n\n constructor(timeZoneName: string) {\n this.timeZoneName = timeZoneName\n }\n\n abstract offsetForArray(a: number[]): number\n\n abstract timestampToArray(ms: number): number[]\n}\n\nexport type NamedTimeZoneImplClass = { new(timeZoneName: string): NamedTimeZoneImpl }\n","export interface SegSpan {\n start: number\n end: number\n}\n\nexport interface SegEntry {\n index: number\n thickness: number // should be an integer\n span: SegSpan\n}\n\n// used internally. exposed for subclasses of SegHierarchy\nexport interface SegInsertion {\n level: number // will have an equal coord, or slightly before, entries in existing level\n levelCoord: number\n lateral: number // where to insert in the existing level. -1 if creating a new level\n touchingLevel: number // -1 if no touching\n touchingLateral: number // -1 if no touching\n touchingEntry: SegEntry // the last touching entry in the level\n stackCnt: number\n}\n\nexport interface SegRect extends SegEntry {\n levelCoord: number\n}\n\nexport interface SegEntryGroup {\n entries: SegEntry[]\n span: SegSpan\n}\n\nexport class SegHierarchy {\n // settings\n strictOrder: boolean = false\n allowReslicing: boolean = false\n maxCoord: number = -1 // -1 means no max\n maxStackCnt: number = -1 // -1 means no max\n\n levelCoords: number[] = [] // ordered\n entriesByLevel: SegEntry[][] = [] // parallel with levelCoords\n stackCnts: { [entryId: string]: number } = {} // TODO: use better technique!?\n\n addSegs(inputs: SegEntry[]): SegEntry[] {\n let hiddenEntries: SegEntry[] = []\n\n for (let input of inputs) {\n this.insertEntry(input, hiddenEntries)\n }\n\n return hiddenEntries\n }\n\n insertEntry(entry: SegEntry, hiddenEntries: SegEntry[]): number {\n let insertion = this.findInsertion(entry)\n\n if (this.isInsertionValid(insertion, entry)) {\n this.insertEntryAt(entry, insertion)\n return 1\n }\n\n return this.handleInvalidInsertion(insertion, entry, hiddenEntries)\n }\n\n isInsertionValid(insertion: SegInsertion, entry: SegEntry): boolean {\n return (this.maxCoord === -1 || insertion.levelCoord + entry.thickness <= this.maxCoord) &&\n (this.maxStackCnt === -1 || insertion.stackCnt < this.maxStackCnt)\n }\n\n // returns number of new entries inserted\n handleInvalidInsertion(insertion: SegInsertion, entry: SegEntry, hiddenEntries: SegEntry[]): number {\n if (this.allowReslicing && insertion.touchingEntry) {\n return this.splitEntry(entry, insertion.touchingEntry, hiddenEntries)\n }\n\n hiddenEntries.push(entry)\n return 0\n }\n\n splitEntry(entry: SegEntry, barrier: SegEntry, hiddenEntries: SegEntry[]): number {\n let partCnt = 0\n let splitHiddenEntries: SegEntry[] = []\n let entrySpan = entry.span\n let barrierSpan = barrier.span\n\n if (entrySpan.start < barrierSpan.start) {\n partCnt += this.insertEntry({\n index: entry.index,\n thickness: entry.thickness,\n span: { start: entrySpan.start, end: barrierSpan.start },\n }, splitHiddenEntries)\n }\n\n if (entrySpan.end > barrierSpan.end) {\n partCnt += this.insertEntry({\n index: entry.index,\n thickness: entry.thickness,\n span: { start: barrierSpan.end, end: entrySpan.end },\n }, splitHiddenEntries)\n }\n\n if (partCnt) {\n hiddenEntries.push({\n index: entry.index,\n thickness: entry.thickness,\n span: intersectSpans(barrierSpan, entrySpan), // guaranteed to intersect\n }, ...splitHiddenEntries)\n return partCnt\n }\n\n hiddenEntries.push(entry)\n return 0\n }\n\n insertEntryAt(entry: SegEntry, insertion: SegInsertion): void {\n let { entriesByLevel, levelCoords } = this\n\n if (insertion.lateral === -1) {\n // create a new level\n insertAt(levelCoords, insertion.level, insertion.levelCoord)\n insertAt(entriesByLevel, insertion.level, [entry])\n } else {\n // insert into existing level\n insertAt(entriesByLevel[insertion.level], insertion.lateral, entry)\n }\n\n this.stackCnts[buildEntryKey(entry)] = insertion.stackCnt\n }\n\n findInsertion(newEntry: SegEntry): SegInsertion {\n let { levelCoords, entriesByLevel, strictOrder, stackCnts } = this\n let levelCnt = levelCoords.length\n let candidateCoord = 0\n let touchingLevel: number = -1\n let touchingLateral: number = -1\n let touchingEntry: SegEntry = null\n let stackCnt = 0\n\n for (let trackingLevel = 0; trackingLevel < levelCnt; trackingLevel += 1) {\n let trackingCoord = levelCoords[trackingLevel]\n\n // if the current level is past the placed entry, we have found a good empty space and can stop.\n // if strictOrder, keep finding more lateral intersections.\n if (!strictOrder && trackingCoord >= candidateCoord + newEntry.thickness) {\n break\n }\n\n let trackingEntries = entriesByLevel[trackingLevel]\n let trackingEntry: SegEntry\n let searchRes = binarySearch(trackingEntries, newEntry.span.start, getEntrySpanEnd) // find first entry after newEntry's end\n let lateralIndex = searchRes[0] + searchRes[1] // if exact match (which doesn't collide), go to next one\n\n while ( // loop through entries that horizontally intersect\n (trackingEntry = trackingEntries[lateralIndex]) && // but not past the whole entry list\n trackingEntry.span.start < newEntry.span.end // and not entirely past newEntry\n ) {\n let trackingEntryBottom = trackingCoord + trackingEntry.thickness\n // intersects into the top of the candidate?\n if (trackingEntryBottom > candidateCoord) {\n candidateCoord = trackingEntryBottom\n touchingEntry = trackingEntry\n touchingLevel = trackingLevel\n touchingLateral = lateralIndex\n }\n // butts up against top of candidate? (will happen if just intersected as well)\n if (trackingEntryBottom === candidateCoord) {\n // accumulate the highest possible stackCnt of the trackingEntries that butt up\n stackCnt = Math.max(stackCnt, stackCnts[buildEntryKey(trackingEntry)] + 1)\n }\n lateralIndex += 1\n }\n }\n\n // the destination level will be after touchingEntry's level. find it\n let destLevel = 0\n if (touchingEntry) {\n destLevel = touchingLevel + 1\n while (destLevel < levelCnt && levelCoords[destLevel] < candidateCoord) {\n destLevel += 1\n }\n }\n\n // if adding to an existing level, find where to insert\n let destLateral = -1\n if (destLevel < levelCnt && levelCoords[destLevel] === candidateCoord) {\n destLateral = binarySearch(entriesByLevel[destLevel], newEntry.span.end, getEntrySpanEnd)[0]\n }\n\n return {\n touchingLevel,\n touchingLateral,\n touchingEntry,\n stackCnt,\n levelCoord: candidateCoord,\n level: destLevel,\n lateral: destLateral,\n }\n }\n\n // sorted by levelCoord (lowest to highest)\n toRects(): SegRect[] {\n let { entriesByLevel, levelCoords } = this\n let levelCnt = entriesByLevel.length\n let rects: SegRect[] = []\n\n for (let level = 0; level < levelCnt; level += 1) {\n let entries = entriesByLevel[level]\n let levelCoord = levelCoords[level]\n\n for (let entry of entries) {\n rects.push({ ...entry, levelCoord })\n }\n }\n\n return rects\n }\n}\n\nexport function getEntrySpanEnd(entry: SegEntry) {\n return entry.span.end\n}\n\nexport function buildEntryKey(entry: SegEntry) { // TODO: use Map instead?\n return entry.index + ':' + entry.span.start\n}\n\n// returns groups with entries sorted by input order\nexport function groupIntersectingEntries(entries: SegEntry[]): SegEntryGroup[] {\n let merges: SegEntryGroup[] = []\n\n for (let entry of entries) {\n let filteredMerges: SegEntryGroup[] = []\n let hungryMerge: SegEntryGroup = { // the merge that will eat what it collides with\n span: entry.span,\n entries: [entry],\n }\n\n for (let merge of merges) {\n if (intersectSpans(merge.span, hungryMerge.span)) {\n hungryMerge = {\n entries: merge.entries.concat(hungryMerge.entries), // keep preexisting merge's items first. maintains order\n span: joinSpans(merge.span, hungryMerge.span),\n }\n } else {\n filteredMerges.push(merge)\n }\n }\n\n filteredMerges.push(hungryMerge)\n merges = filteredMerges\n }\n\n return merges\n}\n\nexport function joinSpans(span0: SegSpan, span1: SegSpan): SegSpan {\n return {\n start: Math.min(span0.start, span1.start),\n end: Math.max(span0.end, span1.end),\n }\n}\n\nexport function intersectSpans(span0: SegSpan, span1: SegSpan): SegSpan | null {\n let start = Math.max(span0.start, span1.start)\n let end = Math.min(span0.end, span1.end)\n\n if (start < end) {\n return { start, end }\n }\n\n return null\n}\n\n// general util\n// ---------------------------------------------------------------------------------------------------------------------\n\nfunction insertAt<Item>(arr: Item[], index: number, item: Item) {\n arr.splice(index, 0, item)\n}\n\nexport function binarySearch<Item>(\n a: Item[],\n searchVal: number,\n getItemVal: (item: Item) => number,\n): [number, number] { // returns [level, isExactMatch ? 1 : 0]\n let startIndex = 0\n let endIndex = a.length // exclusive\n\n if (!endIndex || searchVal < getItemVal(a[startIndex])) { // no items OR before first item\n return [0, 0]\n }\n if (searchVal > getItemVal(a[endIndex - 1])) { // after last item\n return [endIndex, 0]\n }\n\n while (startIndex < endIndex) {\n let middleIndex = Math.floor(startIndex + (endIndex - startIndex) / 2)\n let middleVal = getItemVal(a[middleIndex])\n\n if (searchVal < middleVal) {\n endIndex = middleIndex\n } else if (searchVal > middleVal) {\n startIndex = middleIndex + 1\n } else { // equal!\n return [middleIndex, 1]\n }\n }\n\n return [startIndex, 0]\n}\n","import { DateComponent } from '../component/DateComponent'\nimport { Hit } from './hit'\n\nexport abstract class Interaction {\n component: DateComponent<any>\n isHitComboAllowed: ((hit0: Hit, hit1: Hit) => boolean) | null\n\n constructor(settings: InteractionSettings) {\n this.component = settings.component\n this.isHitComboAllowed = settings.isHitComboAllowed || null\n }\n\n destroy() {\n }\n}\n\nexport type InteractionClass = { new(settings: InteractionSettings): Interaction }\n\nexport interface InteractionSettingsInput {\n el: HTMLElement\n useEventCenter?: boolean\n isHitComboAllowed?: (hit0: Hit, hit1: Hit) => boolean\n}\n\nexport interface InteractionSettings {\n component: DateComponent<any>\n el: HTMLElement\n useEventCenter: boolean\n isHitComboAllowed: ((hit0: Hit, hit1: Hit) => boolean) | null\n}\n\nexport type InteractionSettingsStore = { [componenUid: string]: InteractionSettings }\n\nexport function parseInteractionSettings(component: DateComponent<any>, input: InteractionSettingsInput): InteractionSettings {\n return {\n component,\n el: input.el,\n useEventCenter: input.useEventCenter != null ? input.useEventCenter : true,\n isHitComboAllowed: input.isHitComboAllowed || null,\n }\n}\n\nexport function interactionSettingsToStore(settings: InteractionSettings) {\n return {\n [settings.component.uid]: settings,\n }\n}\n\n// global state\nexport const interactionSettingsStore: InteractionSettingsStore = {}\n","import { Emitter } from '../common/Emitter'\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 abstract class ElementDragging { // TODO: rename to *Interface?\n emitter: Emitter<any>\n\n constructor(el: HTMLElement, selector?: string) {\n this.emitter = new Emitter()\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\nexport type ElementDraggingClass = { new(el: HTMLElement, selector?: string): ElementDragging }\n","// TODO: get rid of this in favor of options system,\n// tho it's really easy to access this globally rather than pass thru options.\nexport const config = {} as any\n","import { createDuration, Duration } from '../datelib/duration'\nimport { refineProps, RawOptionsFromRefiners, Dictionary } from '../options'\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\nconst DRAG_META_REFINERS = {\n startTime: createDuration,\n duration: createDuration,\n create: Boolean,\n sourceId: String,\n}\n\nexport type DragMetaInput =\n RawOptionsFromRefiners<typeof DRAG_META_REFINERS> &\n { [otherProp: string]: any } // for leftoverProps\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: Dictionary\n}\n\nexport function parseDragMeta(raw: DragMetaInput): DragMeta {\n let { refined, extra } = refineProps(raw, DRAG_META_REFINERS)\n\n return {\n startTime: refined.startTime || null,\n duration: refined.duration || null,\n create: refined.create != null ? refined.create : true,\n sourceId: refined.sourceId,\n leftoverProps: extra,\n }\n}\n","import { createElement, VNode } from './vdom'\nimport { BaseComponent } from './vdom-util'\nimport { ToolbarWidget } from './toolbar-struct'\n\nexport interface ToolbarContent {\n title: string\n activeButton: string\n isTodayEnabled: boolean\n isPrevEnabled: boolean\n isNextEnabled: boolean\n}\n\nexport interface ToolbarSectionProps extends ToolbarContent {\n widgetGroups: ToolbarWidget[][]\n}\n\nexport class ToolbarSection extends BaseComponent<ToolbarSectionProps> {\n render() {\n let children = this.props.widgetGroups.map((widgetGroup) => this.renderWidgetGroup(widgetGroup))\n\n return createElement('div', { className: 'fc-toolbar-chunk' }, ...children)\n }\n\n renderWidgetGroup(widgetGroup: ToolbarWidget[]) {\n let { props } = this\n let { theme } = this.context\n let children: VNode[] = []\n let isOnlyButtons = true\n\n for (let widget of widgetGroup) {\n let { buttonName, buttonClick, buttonText, buttonIcon } = widget\n\n if (buttonName === 'title') {\n isOnlyButtons = false\n children.push(\n <h2 className=\"fc-toolbar-title\">{props.title}</h2>,\n )\n } else {\n let ariaAttrs = buttonIcon ? { 'aria-label': buttonName } : {}\n\n let buttonClasses = [`fc-${buttonName}-button`, theme.getClass('button')]\n if (buttonName === props.activeButton) {\n buttonClasses.push(theme.getClass('buttonActive'))\n }\n\n let isDisabled =\n (!props.isTodayEnabled && buttonName === 'today') ||\n (!props.isPrevEnabled && buttonName === 'prev') ||\n (!props.isNextEnabled && buttonName === 'next')\n\n children.push(\n <button\n disabled={isDisabled}\n className={buttonClasses.join(' ')}\n onClick={buttonClick}\n type=\"button\"\n {...ariaAttrs}\n >\n {buttonText || (buttonIcon ? <span className={buttonIcon} /> : '')}\n </button>,\n )\n }\n }\n\n if (children.length > 1) {\n let groupClassName = (isOnlyButtons && theme.getClass('buttonGroup')) || ''\n\n return createElement('div', { className: groupClassName }, ...children)\n }\n return children[0]\n }\n}\n","import { createElement } from './vdom'\nimport { BaseComponent } from './vdom-util'\nimport { ToolbarModel, ToolbarWidget } from './toolbar-struct'\nimport { ToolbarSection, ToolbarContent } from './ToolbarSection'\n\nexport interface ToolbarProps extends ToolbarContent {\n extraClassName: string // wish this could be array, but easier for pureness\n model: ToolbarModel\n}\n\nexport class Toolbar extends BaseComponent<ToolbarProps> {\n render() {\n let { model, extraClassName } = this.props\n let forceLtr = false\n let startContent\n let endContent\n let centerContent = model.center\n\n if (model.left) {\n forceLtr = true\n startContent = model.left\n } else {\n startContent = model.start\n }\n\n if (model.right) {\n forceLtr = true\n endContent = model.right\n } else {\n endContent = model.end\n }\n\n let classNames = [\n extraClassName || '',\n 'fc-toolbar',\n forceLtr ? 'fc-toolbar-ltr' : '',\n ]\n\n return (\n <div className={classNames.join(' ')}>\n {this.renderSection('start', startContent || [])}\n {this.renderSection('center', centerContent || [])}\n {this.renderSection('end', endContent || [])}\n </div>\n )\n }\n\n renderSection(key: string, widgetGroups: ToolbarWidget[][]) {\n let { props } = this\n\n return (\n <ToolbarSection\n key={key}\n widgetGroups={widgetGroups}\n title={props.title}\n activeButton={props.activeButton}\n isTodayEnabled={props.isTodayEnabled}\n isPrevEnabled={props.isPrevEnabled}\n isNextEnabled={props.isNextEnabled}\n />\n )\n }\n}\n","import { BaseComponent, setRef } from './vdom-util'\nimport { ComponentChildren, Ref, createElement, VUIEvent } from './vdom'\nimport { CssDimValue } from './scrollgrid/util'\n\nexport interface ViewContainerProps {\n liquid?: boolean\n height?: CssDimValue\n aspectRatio?: number\n onClick?: (ev: VUIEvent) => void\n elRef?: Ref<HTMLDivElement>\n children?: ComponentChildren\n}\n\ninterface ViewContainerState {\n availableWidth: number | null\n}\n\n// TODO: do function component?\nexport class ViewContainer extends BaseComponent<ViewContainerProps, ViewContainerState> {\n el: HTMLElement\n\n state: ViewContainerState = {\n availableWidth: null,\n }\n\n render() {\n let { props, state } = this\n let { aspectRatio } = props\n\n let classNames = [\n 'fc-view-harness',\n (aspectRatio || props.liquid || props.height)\n ? 'fc-view-harness-active' // harness controls the height\n : 'fc-view-harness-passive', // let the view do the height\n ]\n let height: CssDimValue = ''\n let paddingBottom: CssDimValue = ''\n\n if (aspectRatio) {\n if (state.availableWidth !== null) {\n height = state.availableWidth / aspectRatio\n } else {\n // while waiting to know availableWidth, we can't set height to *zero*\n // because will cause lots of unnecessary scrollbars within scrollgrid.\n // BETTER: don't start rendering ANYTHING yet until we know container width\n // NOTE: why not always use paddingBottom? Causes height oscillation (issue 5606)\n paddingBottom = `${(1 / aspectRatio) * 100}%`\n }\n } else {\n height = props.height || ''\n }\n\n return (\n <div\n ref={this.handleEl}\n onClick={props.onClick}\n className={classNames.join(' ')}\n style={{ height, paddingBottom }}\n >\n {props.children}\n </div>\n )\n }\n\n componentDidMount() {\n this.context.addResizeHandler(this.handleResize)\n }\n\n componentWillUnmount() {\n this.context.removeResizeHandler(this.handleResize)\n }\n\n handleEl = (el: HTMLElement | null) => {\n this.el = el\n setRef(this.props.elRef, el)\n this.updateAvailableWidth()\n }\n\n handleResize = () => {\n this.updateAvailableWidth()\n }\n\n updateAvailableWidth() {\n if (\n this.el && // needed. but why?\n this.props.aspectRatio // aspectRatio is the only height setting that needs availableWidth\n ) {\n this.setState({ availableWidth: this.el.offsetWidth })\n }\n }\n}\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'\nimport { ViewApi } from '../ViewApi'\n\nexport interface EventClickArg {\n el: HTMLElement\n event: EventApi\n jsEvent: MouseEvent\n view: ViewApi\n}\n\n/*\nDetects when the user clicks on an event within a DateComponent\n*/\nexport class EventClicking extends Interaction {\n constructor(settings: InteractionSettings) {\n super(settings)\n\n this.destroy = listenBySelector(\n settings.el,\n 'click',\n '.fc-event', // on both fg and bg events\n this.handleSegClick,\n )\n }\n\n handleSegClick = (ev: Event, segEl: HTMLElement) => {\n let { component } = this\n let { context } = component\n let seg = getElSeg(segEl)\n\n if (\n seg && // might be the <div> surrounding the more link\n component.isValidSegDownEl(ev.target as HTMLElement)\n ) {\n // our way to simulate a link click for elements that can't be <a> tags\n // grab before trigger fired in case trigger trashes DOM thru rerendering\n let hasUrlContainer = elementClosest(ev.target as HTMLElement, '.fc-event-forced-url')\n let url = hasUrlContainer ? (hasUrlContainer.querySelector('a[href]') as any).href : ''\n\n context.emitter.trigger('eventClick', {\n el: segEl,\n event: new EventApi(\n component.context,\n seg.eventRange.def,\n seg.eventRange.instance,\n ),\n jsEvent: ev as MouseEvent, // Is this always a mouse event? See #4655\n view: context.viewApi,\n } as EventClickArg)\n\n if (url && !ev.defaultPrevented) {\n window.location.href = url\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'\nimport { ViewApi } from '../ViewApi'\n\nexport interface EventHoveringArg {\n el: HTMLElement\n event: EventApi\n jsEvent: MouseEvent\n view: ViewApi\n}\n\n/*\nTriggers events and adds/removes core classNames when the user's pointer\nenters/leaves event-elements of a component.\n*/\nexport class EventHovering extends Interaction {\n removeHoverListeners: () => void\n\n currentSegEl: HTMLElement\n\n constructor(settings: InteractionSettings) {\n super(settings)\n\n this.removeHoverListeners = listenToHoverBySelector(\n settings.el,\n '.fc-event', // on both fg and bg events\n this.handleSegEnter,\n this.handleSegLeave,\n )\n }\n\n destroy() {\n this.removeHoverListeners()\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 this.currentSegEl = segEl\n this.triggerEvent('eventMouseEnter', ev, segEl)\n }\n }\n\n handleSegLeave = (ev: Event | null, segEl: HTMLElement) => {\n if (this.currentSegEl) {\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 { context } = component\n let seg = getElSeg(segEl)!\n\n if (!ev || component.isValidSegDownEl(ev.target as HTMLElement)) {\n context.emitter.trigger(publicEvName, {\n el: segEl,\n event: new EventApi(\n context,\n seg.eventRange.def,\n seg.eventRange.instance,\n ),\n jsEvent: ev as MouseEvent, // Is this always a mouse event? See #4655\n view: context.viewApi,\n } as EventHoveringArg)\n }\n }\n}\n","import { __assign } from 'tslib'\nimport { ViewContextType, buildViewContext } from './ViewContext'\nimport { ViewSpec } from './structs/view-spec'\nimport { ViewProps } from './View'\nimport { Toolbar } from './Toolbar'\nimport { DateProfileGenerator, DateProfile } from './DateProfileGenerator'\nimport { rangeContainsMarker } from './datelib/date-range'\nimport { memoize } from './util/memoize'\nimport { DateMarker } from './datelib/marker'\nimport { CalendarData } from './reducers/data-types'\nimport { ViewPropsTransformerClass } from './plugin-system-struct'\nimport { createElement, createRef, VUIEvent, Fragment, VNode } from './vdom'\nimport { buildDelegationHandler } from './util/dom-event'\nimport { ViewContainer } from './ViewContainer'\nimport {\n Interaction,\n InteractionSettingsInput,\n InteractionClass,\n parseInteractionSettings,\n interactionSettingsStore,\n} from './interactions/interaction'\nimport { DateComponent } from './component/DateComponent'\nimport { EventClicking } from './interactions/EventClicking'\nimport { EventHovering } from './interactions/EventHovering'\nimport { getNow } from './reducers/current-date'\nimport { CalendarInteraction } from './calendar-utils'\nimport { DelayedRunner } from './util/DelayedRunner'\nimport { PureComponent } from './vdom-util'\n\nexport interface CalendarContentProps extends CalendarData {\n forPrint: boolean\n isHeightAuto: boolean\n}\n\nexport class CalendarContent extends PureComponent<CalendarContentProps> {\n private buildViewContext = memoize(buildViewContext)\n private buildViewPropTransformers = memoize(buildViewPropTransformers)\n private buildToolbarProps = memoize(buildToolbarProps)\n private handleNavLinkClick = buildDelegationHandler('a[data-navlink]', this._handleNavLinkClick.bind(this))\n private headerRef = createRef<Toolbar>()\n private footerRef = createRef<Toolbar>()\n private interactionsStore: { [componentUid: string]: Interaction[] } = {}\n private calendarInteractions: CalendarInteraction[]\n\n /*\n renders INSIDE of an outer div\n */\n render() {\n let { props } = this\n let { toolbarConfig, options } = props\n\n let toolbarProps = this.buildToolbarProps(\n props.viewSpec,\n props.dateProfile,\n props.dateProfileGenerator,\n props.currentDate,\n getNow(props.options.now, props.dateEnv), // TODO: use NowTimer????\n props.viewTitle,\n )\n\n let viewVGrow = false\n let viewHeight: string | number = ''\n let viewAspectRatio: number | undefined\n\n if (props.isHeightAuto || props.forPrint) {\n viewHeight = ''\n } else if (options.height != null) {\n viewVGrow = true\n } else if (options.contentHeight != null) {\n viewHeight = options.contentHeight\n } else {\n viewAspectRatio = Math.max(options.aspectRatio, 0.5) // prevent from getting too tall\n }\n\n let viewContext = this.buildViewContext(\n props.viewSpec,\n props.viewApi,\n props.options,\n props.dateProfileGenerator,\n props.dateEnv,\n props.theme,\n props.pluginHooks,\n props.dispatch,\n props.getCurrentData,\n props.emitter,\n props.calendarApi,\n this.registerInteractiveComponent,\n this.unregisterInteractiveComponent,\n )\n\n return (\n <ViewContextType.Provider value={viewContext}>\n {toolbarConfig.headerToolbar && (\n <Toolbar\n ref={this.headerRef}\n extraClassName=\"fc-header-toolbar\"\n model={toolbarConfig.headerToolbar}\n {...toolbarProps}\n />\n )}\n <ViewContainer\n liquid={viewVGrow}\n height={viewHeight}\n aspectRatio={viewAspectRatio}\n onClick={this.handleNavLinkClick}\n >\n {this.renderView(props)}\n {this.buildAppendContent()}\n </ViewContainer>\n {toolbarConfig.footerToolbar && (\n <Toolbar\n ref={this.footerRef}\n extraClassName=\"fc-footer-toolbar\"\n model={toolbarConfig.footerToolbar}\n {...toolbarProps}\n />\n )}\n </ViewContextType.Provider>\n )\n }\n\n componentDidMount() {\n let { props } = this\n\n this.calendarInteractions = props.pluginHooks.calendarInteractions\n .map((CalendarInteractionClass) => new CalendarInteractionClass(props))\n\n window.addEventListener('resize', this.handleWindowResize)\n\n let { propSetHandlers } = props.pluginHooks\n for (let propName in propSetHandlers) {\n propSetHandlers[propName](props[propName], props)\n }\n }\n\n componentDidUpdate(prevProps: CalendarContentProps) {\n let { props } = this\n\n let { propSetHandlers } = props.pluginHooks\n for (let propName in propSetHandlers) {\n if (props[propName] !== prevProps[propName]) {\n propSetHandlers[propName](props[propName], props)\n }\n }\n }\n\n componentWillUnmount() {\n window.removeEventListener('resize', this.handleWindowResize)\n this.resizeRunner.clear()\n\n for (let interaction of this.calendarInteractions) {\n interaction.destroy()\n }\n\n this.props.emitter.trigger('_unmount')\n }\n\n _handleNavLinkClick(ev: VUIEvent, anchorEl: HTMLElement) {\n let { dateEnv, options, calendarApi } = this.props\n\n let navLinkOptions: any = anchorEl.getAttribute('data-navlink')\n navLinkOptions = navLinkOptions ? JSON.parse(navLinkOptions) : {}\n\n let dateMarker = dateEnv.createMarker(navLinkOptions.date)\n let viewType = navLinkOptions.type\n\n let customAction =\n viewType === 'day' ? options.navLinkDayClick :\n viewType === 'week' ? options.navLinkWeekClick : null\n\n if (typeof customAction === 'function') {\n customAction.call(calendarApi, dateEnv.toDate(dateMarker), ev)\n } else {\n if (typeof customAction === 'string') {\n viewType = customAction\n }\n\n calendarApi.zoomTo(dateMarker, viewType)\n }\n }\n\n buildAppendContent(): VNode {\n let { props } = this\n\n let children = props.pluginHooks.viewContainerAppends.map(\n (buildAppendContent) => buildAppendContent(props),\n )\n\n return createElement(Fragment, {}, ...children)\n }\n\n renderView(props: CalendarContentProps) {\n let { pluginHooks } = props\n let { viewSpec } = props\n\n let viewProps: ViewProps = {\n dateProfile: props.dateProfile,\n businessHours: props.businessHours,\n eventStore: props.renderableEventStore, // !\n eventUiBases: props.eventUiBases,\n dateSelection: props.dateSelection,\n eventSelection: props.eventSelection,\n eventDrag: props.eventDrag,\n eventResize: props.eventResize,\n isHeightAuto: props.isHeightAuto,\n forPrint: props.forPrint,\n }\n\n let transformers = this.buildViewPropTransformers(pluginHooks.viewPropsTransformers)\n\n for (let transformer of transformers) {\n __assign(\n viewProps,\n transformer.transform(viewProps, props),\n )\n }\n\n let ViewComponent = viewSpec.component\n\n return (\n <ViewComponent {...viewProps} />\n )\n }\n\n // Component Registration\n // -----------------------------------------------------------------------------------------------------------------\n\n registerInteractiveComponent = (component: DateComponent<any>, 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.props.pluginHooks.componentInteractions,\n )\n let interactions = interactionClasses.map((TheInteractionClass) => new TheInteractionClass(settings))\n\n this.interactionsStore[component.uid] = interactions\n interactionSettingsStore[component.uid] = settings\n }\n\n unregisterInteractiveComponent = (component: DateComponent<any>) => {\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 // Resizing\n // -----------------------------------------------------------------------------------------------------------------\n\n resizeRunner = new DelayedRunner(() => {\n this.props.emitter.trigger('_resize', true) // should window resizes be considered \"forced\" ?\n this.props.emitter.trigger('windowResize', { view: this.props.viewApi })\n })\n\n handleWindowResize = (ev: UIEvent) => {\n let { options } = this.props\n\n if (\n options.handleWindowResize &&\n ev.target === window // avoid jqui events\n ) {\n this.resizeRunner.request(options.windowResizeDelay)\n }\n }\n}\n\nfunction buildToolbarProps(\n viewSpec: ViewSpec,\n dateProfile: DateProfile,\n dateProfileGenerator: DateProfileGenerator,\n currentDate: DateMarker,\n now: DateMarker,\n title: string,\n) {\n // don't force any date-profiles to valid date profiles (the `false`) so that we can tell if it's invalid\n let todayInfo = dateProfileGenerator.build(now, undefined, false) // TODO: need `undefined` or else INFINITE LOOP for some reason\n let prevInfo = dateProfileGenerator.buildPrev(dateProfile, currentDate, false)\n let nextInfo = dateProfileGenerator.buildNext(dateProfile, currentDate, false)\n\n return {\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\n// Plugin\n// -----------------------------------------------------------------------------------------------------------------\n\nfunction buildViewPropTransformers(theClasses: ViewPropsTransformerClass[]) {\n return theClasses.map((TheClass) => new TheClass())\n}\n","import { ComponentChildren } from './vdom'\nimport { BaseComponent } from './vdom-util'\nimport { CssDimValue } from './scrollgrid/util'\nimport { CalendarOptions, CalendarListeners } from './options'\nimport { Theme } from './theme/Theme'\nimport { getCanVGrowWithinCell } from './util/table-styling'\nimport { Emitter } from './common/Emitter'\n\nexport interface CalendarRootProps {\n options: CalendarOptions\n theme: Theme\n emitter: Emitter<CalendarListeners>\n children: (classNames: string[], height: CssDimValue, isHeightAuto: boolean, forPrint: boolean) => ComponentChildren\n}\n\ninterface CalendarRootState {\n forPrint: boolean\n}\n\nexport class CalendarRoot extends BaseComponent<CalendarRootProps, CalendarRootState> {\n state = {\n forPrint: false,\n }\n\n render() {\n let { props } = this\n let { options } = props\n let { forPrint } = this.state\n\n let isHeightAuto = forPrint || options.height === 'auto' || options.contentHeight === 'auto'\n let height = (!isHeightAuto && options.height != null) ? options.height : ''\n\n let classNames: string[] = [\n 'fc',\n forPrint ? 'fc-media-print' : 'fc-media-screen',\n `fc-direction-${options.direction}`,\n props.theme.getClass('root'),\n ]\n\n if (!getCanVGrowWithinCell()) {\n classNames.push('fc-liquid-hack')\n }\n\n return props.children(classNames, height, isHeightAuto, forPrint)\n }\n\n componentDidMount() {\n let { emitter } = this.props\n emitter.on('_beforeprint', this.handleBeforePrint)\n emitter.on('_afterprint', this.handleAfterPrint)\n }\n\n componentWillUnmount() {\n let { emitter } = this.props\n emitter.off('_beforeprint', this.handleBeforePrint)\n emitter.off('_afterprint', this.handleAfterPrint)\n }\n\n handleBeforePrint = () => {\n this.setState({ forPrint: true })\n }\n\n handleAfterPrint = () => {\n this.setState({ forPrint: false })\n }\n}\n","import { createFormatter } from '../datelib/formatting'\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 createFormatter({ weekday: 'short' }) // \"Sat\"\n }\n\n if (dayCnt > 1) {\n return createFormatter({ weekday: 'short', month: 'numeric', day: 'numeric', omitCommas: true }) // \"Sat 11/12\"\n }\n\n return createFormatter({ weekday: 'long' }) // \"Saturday\"\n}\n","import { DayHeaderContentArg } from '../render-hook-misc'\n\nexport const CLASS_NAME = 'fc-col-header-cell' // do the cushion too? no\n\nexport function renderInner(hookProps: DayHeaderContentArg) {\n return hookProps.text\n}\n","import { DateRange } from '../datelib/date-range'\nimport { getDayClassNames, getDateMeta } from '../component/date-rendering'\nimport { DateMarker } from '../datelib/marker'\nimport { createElement } from '../vdom'\nimport { DateFormatter } from '../datelib/DateFormatter'\nimport { formatDayString } from '../datelib/formatting-utils'\nimport { BaseComponent } from '../vdom-util'\nimport { RenderHook } from './render-hook'\nimport { buildNavLinkData } from './nav-link'\nimport { DateProfile } from '../DateProfileGenerator'\nimport { DayHeaderContentArg } from '../render-hook-misc'\nimport { Dictionary } from '../options'\nimport { CLASS_NAME, renderInner } from './table-cell-util'\n\nexport interface TableDateCellProps {\n date: DateMarker\n dateProfile: DateProfile\n todayRange: DateRange\n colCnt: number\n dayHeaderFormat: DateFormatter\n colSpan?: number\n isSticky?: boolean // TODO: get this outta here somehow\n extraDataAttrs?: Dictionary\n extraHookProps?: Dictionary\n}\n\nexport class TableDateCell extends BaseComponent<TableDateCellProps> { // BAD name for this class now. used in the Header\n render() {\n let { dateEnv, options, theme, viewApi } = this.context\n let { props } = this\n let { date, dateProfile } = props\n let dayMeta = getDateMeta(date, props.todayRange, null, dateProfile)\n\n let classNames = [CLASS_NAME].concat(\n getDayClassNames(dayMeta, theme),\n )\n let text = dateEnv.format(date, props.dayHeaderFormat)\n\n // if colCnt is 1, we are already in a day-view and don't need a navlink\n let navLinkAttrs = (options.navLinks && !dayMeta.isDisabled && props.colCnt > 1)\n ? { 'data-navlink': buildNavLinkData(date), tabIndex: 0 }\n : {}\n\n let hookProps: DayHeaderContentArg = {\n date: dateEnv.toDate(date),\n view: viewApi,\n ...props.extraHookProps,\n text,\n ...dayMeta,\n }\n\n return (\n <RenderHook\n hookProps={hookProps}\n classNames={options.dayHeaderClassNames}\n content={options.dayHeaderContent}\n defaultContent={renderInner}\n didMount={options.dayHeaderDidMount}\n willUnmount={options.dayHeaderWillUnmount}\n >\n {(rootElRef, customClassNames, innerElRef, innerContent) => (\n <th\n ref={rootElRef}\n className={classNames.concat(customClassNames).join(' ')}\n data-date={!dayMeta.isDisabled ? formatDayString(date) : undefined}\n colSpan={props.colSpan}\n {...props.extraDataAttrs}\n >\n <div className=\"fc-scrollgrid-sync-inner\">\n {!dayMeta.isDisabled && (\n <a\n ref={innerElRef}\n className={[\n 'fc-col-header-cell-cushion',\n props.isSticky ? 'fc-sticky' : '',\n ].join(' ')}\n {...navLinkAttrs}\n >\n {innerContent}\n </a>\n )}\n </div>\n </th>\n )}\n </RenderHook>\n )\n }\n}\n","import { getDayClassNames, DateMeta } from '../component/date-rendering'\nimport { addDays } from '../datelib/marker'\nimport { createElement } from '../vdom'\nimport { DateFormatter } from '../datelib/DateFormatter'\nimport { BaseComponent } from '../vdom-util'\nimport { RenderHook } from './render-hook'\nimport { Dictionary } from '../options'\nimport { CLASS_NAME, renderInner } from './table-cell-util'\nimport { DayHeaderContentArg } from '../render-hook-misc'\n\nexport interface TableDowCellProps {\n dow: number\n dayHeaderFormat: DateFormatter\n colSpan?: number\n isSticky?: boolean // TODO: get this outta here somehow\n extraHookProps?: Dictionary\n extraDataAttrs?: Dictionary\n extraClassNames?: string[]\n}\n\nexport class TableDowCell extends BaseComponent<TableDowCellProps> {\n render() {\n let { props } = this\n let { dateEnv, theme, viewApi, options } = this.context\n let date = addDays(new Date(259200000), props.dow) // start with Sun, 04 Jan 1970 00:00:00 GMT\n let dateMeta: DateMeta = {\n dow: props.dow,\n isDisabled: false,\n isFuture: false,\n isPast: false,\n isToday: false,\n isOther: false,\n }\n let classNames = [CLASS_NAME].concat(\n getDayClassNames(dateMeta, theme),\n props.extraClassNames || [],\n )\n let text = dateEnv.format(date, props.dayHeaderFormat)\n let hookProps: DayHeaderContentArg = { // TODO: make this public?\n date,\n ...dateMeta,\n view: viewApi,\n ...props.extraHookProps,\n text,\n }\n\n return (\n <RenderHook\n hookProps={hookProps}\n classNames={options.dayHeaderClassNames}\n content={options.dayHeaderContent}\n defaultContent={renderInner}\n didMount={options.dayHeaderDidMount}\n willUnmount={options.dayHeaderWillUnmount}\n >\n {(rootElRef, customClassNames, innerElRef, innerContent) => (\n <th\n ref={rootElRef}\n className={classNames.concat(customClassNames).join(' ')}\n colSpan={props.colSpan}\n {...props.extraDataAttrs}\n >\n <div className=\"fc-scrollgrid-sync-inner\">\n <a\n className={[\n 'fc-col-header-cell-cushion',\n props.isSticky ? 'fc-sticky' : '',\n ].join(' ')}\n ref={innerElRef}\n >\n {innerContent}\n </a>\n </div>\n </th>\n )}\n </RenderHook>\n )\n }\n}\n","import { DateMarker, addMs, startOfDay, addDays } from './datelib/marker'\nimport { createDuration } from './datelib/duration'\nimport { ViewContext, ViewContextType } from './ViewContext'\nimport { ComponentChildren, Component } from './vdom'\nimport { DateRange } from './datelib/date-range'\nimport { getNow } from './reducers/current-date'\n\nexport interface NowTimerProps {\n unit: string // TODO: add type of unit\n children: (now: DateMarker, todayRange: DateRange) => ComponentChildren\n}\n\ninterface NowTimerState {\n nowDate: DateMarker\n todayRange: DateRange\n}\n\nexport class NowTimer extends Component<NowTimerProps, NowTimerState> {\n static contextType: any = ViewContextType\n context: ViewContext // do this for all components that use the context!!!\n initialNowDate: DateMarker\n initialNowQueriedMs: number\n timeoutId: any\n\n constructor(props: NowTimerProps, context: ViewContext) {\n super(props, context)\n\n this.initialNowDate = getNow(context.options.now, context.dateEnv)\n this.initialNowQueriedMs = new Date().valueOf()\n\n this.state = this.computeTiming().currentState\n }\n\n render() {\n let { props, state } = this\n return props.children(state.nowDate, state.todayRange)\n }\n\n componentDidMount() {\n this.setTimeout()\n }\n\n componentDidUpdate(prevProps: NowTimerProps) {\n if (prevProps.unit !== this.props.unit) {\n this.clearTimeout()\n this.setTimeout()\n }\n }\n\n componentWillUnmount() {\n this.clearTimeout()\n }\n\n private computeTiming() {\n let { props, context } = this\n let unroundedNow = addMs(this.initialNowDate, new Date().valueOf() - this.initialNowQueriedMs)\n let currentUnitStart = context.dateEnv.startOf(unroundedNow, props.unit)\n let nextUnitStart = context.dateEnv.add(currentUnitStart, createDuration(1, props.unit))\n let waitMs = nextUnitStart.valueOf() - unroundedNow.valueOf()\n\n // there is a max setTimeout ms value (https://stackoverflow.com/a/3468650/96342)\n // ensure no longer than a day\n waitMs = Math.min(1000 * 60 * 60 * 24, waitMs)\n\n return {\n currentState: { nowDate: currentUnitStart, todayRange: buildDayRange(currentUnitStart) } as NowTimerState,\n nextState: { nowDate: nextUnitStart, todayRange: buildDayRange(nextUnitStart) } as NowTimerState,\n waitMs,\n }\n }\n\n private setTimeout() {\n let { nextState, waitMs } = this.computeTiming()\n\n this.timeoutId = setTimeout(() => {\n this.setState(nextState, () => {\n this.setTimeout()\n })\n }, waitMs)\n }\n\n private clearTimeout() {\n if (this.timeoutId) {\n clearTimeout(this.timeoutId)\n }\n }\n}\n\nfunction buildDayRange(date: DateMarker): DateRange { // TODO: make this a general util\n let start = startOfDay(date)\n let end = addDays(start, 1)\n\n return { start, end }\n}\n","import { BaseComponent } from '../vdom-util'\nimport { DateMarker } from '../datelib/marker'\nimport { computeFallbackHeaderFormat } from './table-utils'\nimport { VNode, createElement } from '../vdom'\nimport { TableDateCell } from './TableDateCell'\nimport { TableDowCell } from './TableDowCell'\nimport { NowTimer } from '../NowTimer'\nimport { DateRange } from '../datelib/date-range'\nimport { memoize } from '../util/memoize'\nimport { DateProfile } from '../DateProfileGenerator'\nimport { DateFormatter } from '../datelib/DateFormatter'\n\nexport interface DayHeaderProps {\n dateProfile: DateProfile\n dates: DateMarker[]\n datesRepDistinctDays: boolean\n renderIntro?: (rowKey: string) => VNode\n}\n\nexport class DayHeader extends BaseComponent<DayHeaderProps> { // TODO: rename to DayHeaderTr?\n createDayHeaderFormatter = memoize(createDayHeaderFormatter)\n\n render() {\n let { context } = this\n let { dates, dateProfile, datesRepDistinctDays, renderIntro } = this.props\n\n let dayHeaderFormat = this.createDayHeaderFormatter(\n context.options.dayHeaderFormat,\n datesRepDistinctDays,\n dates.length,\n )\n\n return (\n <NowTimer unit=\"day\">\n {(nowDate: DateMarker, todayRange: DateRange) => (\n <tr>\n {renderIntro && renderIntro('day')}\n {dates.map((date) => (\n datesRepDistinctDays ? (\n <TableDateCell\n key={date.toISOString()}\n date={date}\n dateProfile={dateProfile}\n todayRange={todayRange}\n colCnt={dates.length}\n dayHeaderFormat={dayHeaderFormat}\n />\n ) : (\n <TableDowCell\n key={date.getUTCDay()}\n dow={date.getUTCDay()}\n dayHeaderFormat={dayHeaderFormat}\n />\n )\n ))}\n </tr>\n )}\n </NowTimer>\n )\n }\n}\n\nfunction createDayHeaderFormatter(explicitFormat: DateFormatter, datesRepDistinctDays, dateCnt) {\n return explicitFormat || computeFallbackHeaderFormat(datesRepDistinctDays, dateCnt)\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 class DaySeriesModel {\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 } = range\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 += 1\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 }\n return null\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\n let dayOffset = Math.floor(diffDays(this.dates[0], date))\n\n if (dayOffset < 0) {\n return indices[0] - 1\n }\n\n if (dayOffset >= indices.length) {\n return indices[indices.length - 1] + 1\n }\n\n return indices[dayOffset]\n }\n}\n","import { DaySeriesModel } from './DaySeriesModel'\nimport { DateRange } from '../datelib/date-range'\nimport { DateMarker } from '../datelib/marker'\nimport { Seg } from '../component/DateComponent'\nimport { Dictionary } from '../options'\n\nexport interface DayTableSeg extends Seg {\n row: number\n firstCol: number\n lastCol: number\n}\n\nexport interface DayTableCell {\n key: string // probably just the serialized date, but could be other metadata if this col is specific to another entity\n date: DateMarker\n extraHookProps?: Dictionary\n extraDataAttrs?: Dictionary\n extraClassNames?: string[]\n extraDateSpan?: Dictionary\n}\n\nexport class DayTableModel {\n rowCnt: number\n colCnt: number\n cells: DayTableCell[][]\n headerDates: DateMarker[]\n\n private daySeries: DaySeriesModel\n\n constructor(daySeries: DaySeriesModel, 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 += 1) {\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 += 1) {\n let cells = []\n\n for (let col = 0; col < this.colCnt; col += 1) {\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): DayTableCell {\n let date = this.daySeries.dates[row * this.colCnt + col]\n return {\n key: date.toISOString(),\n date,\n }\n }\n\n private buildHeaderDates() {\n let dates = []\n\n for (let col = 0; col < this.colCnt; col += 1) {\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","import { DateRange } from '../datelib/date-range'\nimport { EventStore } from '../structs/event-store'\nimport { EventUiHash } from '../component/event-ui'\nimport { sliceEventStore, EventRenderRange } from '../component/event-rendering'\nimport { DateProfile } from '../DateProfileGenerator'\nimport { 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, addDays } from '../datelib/marker'\nimport { CalendarContext } from '../CalendarContext'\nimport { expandRecurring } from '../structs/recurring-event'\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<SegType extends Seg> {\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 abstract class Slicer<SegType extends Seg, ExtraArgs extends any[] = []> {\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 protected forceDayIfListItem = false // hack\n\n sliceProps(\n props: SliceableProps,\n dateProfile: DateProfile,\n nextDayThreshold: Duration | null,\n context: CalendarContext,\n ...extraArgs: ExtraArgs\n ): SlicedProps<SegType> {\n let { eventUiBases } = props\n let eventSegs = this.sliceEventStore(props.eventStore, eventUiBases, dateProfile, nextDayThreshold, ...extraArgs)\n\n return {\n dateSelectionSegs: this.sliceDateSelection(props.dateSelection, eventUiBases, context, ...extraArgs),\n businessHourSegs: this.sliceBusinessHours(props.businessHours, dateProfile, nextDayThreshold, context, ...extraArgs),\n fgEventSegs: eventSegs.fg,\n bgEventSegs: eventSegs.bg,\n eventDrag: this.sliceEventDrag(props.eventDrag, eventUiBases, dateProfile, nextDayThreshold, ...extraArgs),\n eventResize: this.sliceEventResize(props.eventResize, eventUiBases, dateProfile, nextDayThreshold, ...extraArgs),\n eventSelection: props.eventSelection,\n } // TODO: give interactionSegs?\n }\n\n sliceNowDate( // does not memoize\n date: DateMarker,\n context: CalendarContext,\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 context,\n ...extraArgs,\n )\n }\n\n private _sliceBusinessHours(\n businessHours: EventStore,\n dateProfile: DateProfile,\n nextDayThreshold: Duration | null,\n context: CalendarContext,\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 context,\n ),\n {},\n dateProfile,\n nextDayThreshold,\n ...extraArgs,\n ).bg\n }\n\n private _sliceEventStore(\n eventStore: EventStore,\n eventUiBases: EventUiHash,\n dateProfile: DateProfile,\n nextDayThreshold: Duration | null,\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, extraArgs),\n fg: this.sliceEventRanges(rangeRes.fg, extraArgs),\n }\n }\n return { bg: [], fg: [] }\n }\n\n private _sliceInteraction(\n interaction: EventInteractionState,\n eventUiBases: EventUiHash,\n dateProfile: DateProfile,\n nextDayThreshold: Duration | null,\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, extraArgs),\n affectedInstances: interaction.affectedEvents.instances,\n isEvent: interaction.isEvent,\n }\n }\n\n private _sliceDateSpan(\n dateSpan: DateSpan,\n eventUiBases: EventUiHash,\n context: CalendarContext,\n ...extraArgs: ExtraArgs\n ): SegType[] {\n if (!dateSpan) {\n return []\n }\n\n let eventRange = fabricateEventRange(dateSpan, eventUiBases, context)\n let segs = this.sliceRange(dateSpan.range, ...extraArgs)\n\n for (let seg of segs) {\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 extraArgs: ExtraArgs,\n ): SegType[] {\n let segs: SegType[] = []\n\n for (let eventRange of eventRanges) {\n segs.push(...this.sliceEventRange(eventRange, 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 extraArgs: ExtraArgs,\n ): SegType[] {\n let dateRange = eventRange.range\n\n // hack to make multi-day events that are being force-displayed as list-items to take up only one day\n if (this.forceDayIfListItem && eventRange.ui.display === 'list-item') {\n dateRange = {\n start: dateRange.start,\n end: addDays(dateRange.start, 1),\n }\n }\n\n let segs = this.sliceRange(dateRange, ...extraArgs)\n\n for (let seg of segs) {\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/*\nfor incorporating slotMinTime/slotMaxTime 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.slotMinTime.milliseconds),\n end: addMs(range.end, dateProfile.slotMaxTime.milliseconds - 864e5), // 864e5 = ms in a day\n }\n}\n","import { EventStore, filterEventStoreDefs } from './structs/event-store'\nimport { DateSpan } 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 { EventInteractionState } from './interactions/event-interaction-state'\nimport { SplittableProps } from './component/event-splitting'\nimport { mapHash } from './util/object'\nimport { CalendarContext } from './CalendarContext'\nimport { buildDateSpanApiWithContext } from './calendar-utils'\nimport { Constraint } from './structs/constraint'\nimport { expandRecurring } from './structs/recurring-event'\nimport { DateProfile } from './DateProfileGenerator'\n\n// high-level segmenting-aware tester functions\n// ------------------------------------------------------------------------------------------------------------------------\n\nexport function isInteractionValid(\n interaction: EventInteractionState,\n dateProfile: DateProfile,\n context: CalendarContext,\n) {\n let { instances } = interaction.mutatedEvents\n for (let instanceId in instances) {\n if (!rangeContainsRange(dateProfile.validRange, instances[instanceId].range)) {\n return false\n }\n }\n return isNewPropsValid({ eventDrag: interaction }, context) // HACK: the eventDrag props is used for ALL interactions\n}\n\nexport function isDateSelectionValid(\n dateSelection: DateSpan,\n dateProfile: DateProfile,\n context: CalendarContext,\n) {\n if (!rangeContainsRange(dateProfile.validRange, dateSelection.range)) {\n return false\n }\n return isNewPropsValid({ dateSelection }, context)\n}\n\nfunction isNewPropsValid(newProps, context: CalendarContext) {\n let calendarState = context.getCurrentData()\n\n let props = {\n businessHours: calendarState.businessHours,\n dateSelection: '',\n eventStore: calendarState.eventStore,\n eventUiBases: calendarState.eventUiBases,\n eventSelection: '',\n eventDrag: null,\n eventResize: null,\n ...newProps,\n }\n\n return (context.pluginHooks.isPropsValid || isPropsValid)(props, context)\n}\n\nexport function isPropsValid(state: SplittableProps, context: CalendarContext, dateSpanMeta = {}, filterConfig?): boolean {\n if (state.eventDrag && !isInteractionPropsValid(state, context, dateSpanMeta, filterConfig)) {\n return false\n }\n\n if (state.dateSelection && !isDateSelectionPropsValid(state, context, dateSpanMeta, filterConfig)) {\n return false\n }\n\n return true\n}\n\n// Moving Event Validation\n// ------------------------------------------------------------------------------------------------------------------------\n\nfunction isInteractionPropsValid(state: SplittableProps, context: CalendarContext, dateSpanMeta: any, filterConfig): boolean {\n let currentState = context.getCurrentData()\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 { '': currentState.selectionConfig }, // if not a real event, validate as a selection\n )\n\n if (filterConfig) {\n subjectConfigs = mapHash(subjectConfigs, filterConfig)\n }\n\n // exclude the subject events. TODO: exclude defs too?\n let otherEventStore = excludeInstances(state.eventStore, interaction.affectedEvents.instances)\n\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, context)) {\n return false\n }\n\n // overlap\n\n let { eventOverlap } = context.options\n let eventOverlapFunc = typeof eventOverlap === 'function' ? eventOverlap : 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 (eventOverlapFunc && !eventOverlapFunc(\n new EventApi(context, otherDefs[otherInstance.defId], otherInstance), // still event\n new EventApi(context, subjectDef, subjectInstance), // moving event\n )) {\n return false\n }\n }\n }\n\n // allow (a function)\n\n let calendarEventStore = currentState.eventStore // need global-to-calendar, not local to component (splittable)state\n\n for (let subjectAllow of subjectConfig.allows) {\n let subjectDateSpan: DateSpan = {\n ...dateSpanMeta,\n range: subjectInstance.range,\n allDay: subjectDef.allDay,\n }\n\n let origDef = calendarEventStore.defs[subjectDef.defId]\n let origInstance = calendarEventStore.instances[subjectInstanceId]\n let eventApi\n\n if (origDef) { // was previously in the calendar\n eventApi = new EventApi(context, origDef, origInstance)\n } else { // was an external event\n eventApi = new EventApi(context, subjectDef) // no instance, because had no dates\n }\n\n if (!subjectAllow(\n buildDateSpanApiWithContext(subjectDateSpan, context),\n eventApi,\n )) {\n return false\n }\n }\n }\n\n return true\n}\n\n// Date Selection Validation\n// ------------------------------------------------------------------------------------------------------------------------\n\nfunction isDateSelectionPropsValid(state: SplittableProps, context: CalendarContext, 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 } = context.getCurrentData()\n\n if (filterConfig) {\n selectionConfig = filterConfig(selectionConfig)\n }\n\n // constraint\n if (!allConstraintsPass(selectionConfig.constraints, selectionRange, relevantEventStore, state.businessHours, context)) {\n return false\n }\n\n // overlap\n\n let { selectOverlap } = context.options\n let selectOverlapFunc = typeof selectOverlap === 'function' ? selectOverlap : null\n\n for (let relevantInstanceId in relevantInstances) {\n let relevantInstance = relevantInstances[relevantInstanceId]\n\n // intersect! evaluate\n if (rangesIntersect(selectionRange, relevantInstance.range)) {\n if (selectionConfig.overlap === false) {\n return false\n }\n\n if (selectOverlapFunc && !selectOverlapFunc(\n new EventApi(context, relevantDefs[relevantInstance.defId], relevantInstance),\n null,\n )) {\n return false\n }\n }\n }\n\n // allow (a function)\n for (let selectionAllow of selectionConfig.allows) {\n let fullDateSpan = { ...dateSpanMeta, ...selection }\n\n if (!selectionAllow(\n buildDateSpanApiWithContext(fullDateSpan, context),\n null,\n )) {\n return false\n }\n }\n\n return true\n}\n\n// Constraint Utils\n// ------------------------------------------------------------------------------------------------------------------------\n\nfunction allConstraintsPass(\n constraints: Constraint[],\n subjectRange: DateRange,\n otherEventStore: EventStore,\n businessHoursUnexpanded: EventStore,\n context: CalendarContext,\n): boolean {\n for (let constraint of constraints) {\n if (!anyRangesContainRange(\n constraintToRanges(constraint, subjectRange, otherEventStore, businessHoursUnexpanded, context),\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 context: CalendarContext, // for expanding businesshours\n): OpenDateRange[] {\n if (constraint === 'businessHours') {\n return eventStoreToRanges(\n expandRecurring(businessHoursUnexpanded, subjectRange, context),\n )\n }\n\n if (typeof constraint === 'string') { // an group ID\n return eventStoreToRanges(\n filterEventStoreDefs(otherEventStore, (eventDef) => eventDef.groupId === constraint),\n )\n }\n\n if (typeof constraint === 'object' && constraint) { // non-null object\n return eventStoreToRanges(\n expandRecurring(constraint, subjectRange, context),\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 for (let outerRange of outerRanges) {\n if (rangeContainsRange(outerRange, innerRange)) {\n return true\n }\n }\n\n return false\n}\n","import { createElement, ComponentChildren, Ref } from '../vdom'\nimport { BaseComponent, setRef } from '../vdom-util'\nimport { CssDimValue, ScrollerLike } from './util'\n\nexport type OverflowValue = 'auto' | 'hidden' | 'scroll' | 'visible'\n\nexport interface ScrollerProps {\n overflowX: OverflowValue\n overflowY: OverflowValue\n overcomeLeft?: number\n overcomeRight?: number\n overcomeBottom?: number\n maxHeight?: CssDimValue\n liquid?: boolean\n liquidIsAbsolute?: boolean\n children?: ComponentChildren\n elRef?: Ref<HTMLElement>\n}\n\nconst VISIBLE_HIDDEN_RE = /^(visible|hidden)$/\n\nexport class Scroller extends BaseComponent<ScrollerProps> implements ScrollerLike {\n private el: HTMLElement // TODO: just use this.base?\n\n render() {\n let { props } = this\n let { liquid, liquidIsAbsolute } = props\n let isAbsolute = liquid && liquidIsAbsolute\n let className = ['fc-scroller']\n\n if (liquid) {\n if (liquidIsAbsolute) {\n className.push('fc-scroller-liquid-absolute')\n } else {\n className.push('fc-scroller-liquid')\n }\n }\n\n return (\n <div\n ref={this.handleEl}\n className={className.join(' ')}\n style={{\n overflowX: props.overflowX,\n overflowY: props.overflowY,\n left: (isAbsolute && -(props.overcomeLeft || 0)) || '',\n right: (isAbsolute && -(props.overcomeRight || 0)) || '',\n bottom: (isAbsolute && -(props.overcomeBottom || 0)) || '',\n marginLeft: (!isAbsolute && -(props.overcomeLeft || 0)) || '',\n marginRight: (!isAbsolute && -(props.overcomeRight || 0)) || '',\n marginBottom: (!isAbsolute && -(props.overcomeBottom || 0)) || '',\n maxHeight: props.maxHeight || '',\n }}\n >\n {props.children}\n </div>\n )\n }\n\n handleEl = (el: HTMLElement) => {\n this.el = el\n setRef(this.props.elRef, el)\n }\n\n needsXScrolling() {\n if (VISIBLE_HIDDEN_RE.test(this.props.overflowX)) {\n return false\n }\n\n // testing scrollWidth>clientWidth is unreliable cross-browser when pixel heights aren't integers.\n // much more reliable to see if children are taller than the scroller, even tho doesn't account for\n // inner-child margins and absolute positioning\n\n let { el } = this\n let realClientWidth = this.el.getBoundingClientRect().width - this.getYScrollbarWidth()\n let { children } = el\n\n for (let i = 0; i < children.length; i += 1) {\n let childEl = children[i]\n\n if (childEl.getBoundingClientRect().width > realClientWidth) {\n return true\n }\n }\n\n return false\n }\n\n needsYScrolling() {\n if (VISIBLE_HIDDEN_RE.test(this.props.overflowY)) {\n return false\n }\n\n // testing scrollHeight>clientHeight is unreliable cross-browser when pixel heights aren't integers.\n // much more reliable to see if children are taller than the scroller, even tho doesn't account for\n // inner-child margins and absolute positioning\n\n let { el } = this\n let realClientHeight = this.el.getBoundingClientRect().height - this.getXScrollbarWidth()\n let { children } = el\n\n for (let i = 0; i < children.length; i += 1) {\n let childEl = children[i]\n\n if (childEl.getBoundingClientRect().height > realClientHeight) {\n return true\n }\n }\n\n return false\n }\n\n getXScrollbarWidth() {\n if (VISIBLE_HIDDEN_RE.test(this.props.overflowX)) {\n return 0\n }\n return this.el.offsetHeight - this.el.clientHeight // only works because we guarantee no borders. TODO: add to CSS with important?\n }\n\n getYScrollbarWidth() {\n if (VISIBLE_HIDDEN_RE.test(this.props.overflowY)) {\n return 0\n }\n return this.el.offsetWidth - this.el.clientWidth // only works because we guarantee no borders. TODO: add to CSS with important?\n }\n}\n","import { hashValuesToArray, collectFromHash } from './object'\n\n/*\nTODO: somehow infer OtherArgs from masterCallback?\nTODO: infer RefType from masterCallback if provided\n*/\nexport class RefMap<RefType> {\n public currentMap: { [key: string]: RefType } = {}\n private depths: { [key: string]: number } = {}\n private callbackMap: { [key: string]: (val: RefType | null) => void } = {}\n\n constructor(public masterCallback?: (val: RefType | null, key: string) => void) {\n }\n\n createRef(key: string | number) {\n let refCallback = this.callbackMap[key]\n\n if (!refCallback) {\n refCallback = this.callbackMap[key] = (val: RefType | null) => {\n this.handleValue(val, String(key))\n }\n }\n\n return refCallback\n }\n\n handleValue = (val: RefType | null, key: string) => { // bind in case users want to pass it around\n let { depths, currentMap } = this\n let removed = false\n let added = false\n\n if (val !== null) {\n // for bug... ACTUALLY: can probably do away with this now that callers don't share numeric indices anymore\n removed = (key in currentMap)\n\n currentMap[key] = val\n depths[key] = (depths[key] || 0) + 1\n added = true\n } else {\n depths[key] -= 1\n\n if (!depths[key]) {\n delete currentMap[key]\n delete this.callbackMap[key]\n removed = true\n }\n }\n\n if (this.masterCallback) {\n if (removed) {\n this.masterCallback(null, String(key))\n }\n if (added) {\n this.masterCallback(val, String(key))\n }\n }\n }\n\n // TODO: check callers that don't care about order. should use getAll instead\n // NOTE: this method has become less valuable now that we are encouraged to map order by some other index\n // TODO: provide ONE array-export function, buildArray, which fails on non-numeric indexes. caller can manipulate and \"collect\"\n collect(\n startIndex?: number,\n endIndex?: number,\n step?: number,\n ) {\n return collectFromHash(this.currentMap, startIndex, endIndex, step)\n }\n\n getAll(): RefType[] { // returns in no partical order!\n return hashValuesToArray(this.currentMap)\n }\n}\n","import { VNode, createElement, Ref } from '../vdom'\nimport { findElements } from '../util/dom-manip'\nimport { ViewContext } from '../ViewContext'\nimport { computeSmallestCellWidth } from '../util/misc'\nimport { isPropsEqual } from '../util/object'\nimport { isArraysEqual } from '../util/array'\nimport { BaseOptionsRefined } from '../options'\n\nexport type CssDimValue = string | number // TODO: move to more general file\n\nexport interface ColProps {\n width?: CssDimValue\n minWidth?: CssDimValue\n span?: number\n}\n\nexport interface SectionConfig {\n outerContent?: VNode\n type: 'body' | 'header' | 'footer'\n className?: string\n maxHeight?: number\n liquid?: boolean\n expandRows?: boolean // TODO: how to get a bottom rule?\n syncRowHeights?: boolean // yuck\n isSticky?: boolean\n}\n\nexport type ChunkConfigContent = (contentProps: ChunkContentCallbackArgs) => VNode\nexport type ChunkConfigRowContent = VNode | ChunkConfigContent\n\nexport interface ChunkConfig {\n outerContent?: VNode\n content?: ChunkConfigContent\n rowContent?: ChunkConfigRowContent\n scrollerElRef?: Ref<HTMLDivElement>\n elRef?: Ref<HTMLTableCellElement>\n tableClassName?: string\n}\n\nexport interface ChunkContentCallbackArgs { // TODO: util for wrapping tables!?\n tableColGroupNode: VNode\n tableMinWidth: CssDimValue\n clientWidth: number | null // important to know whether 0 or not-yet-determined. for headless testing\n clientHeight: number | null //\n expandRows: boolean\n syncRowHeights: boolean\n rowSyncHeights: number[]\n reportRowHeightChange: (rowEl: HTMLElement, isStable: boolean) => void\n}\n\nexport function computeShrinkWidth(chunkEls: HTMLElement[]) { // all in same COL!\n let shrinkCells = findElements(chunkEls, '.fc-scrollgrid-shrink')\n let largestWidth = 0\n\n for (let shrinkCell of shrinkCells) {\n largestWidth = Math.max(\n largestWidth,\n computeSmallestCellWidth(shrinkCell),\n )\n }\n\n return Math.ceil(largestWidth) // <table> elements work best with integers. round up to ensure contents fits\n}\n\nexport interface ScrollerLike { // have scrollers implement?\n needsYScrolling(): boolean\n needsXScrolling(): boolean\n}\n\nexport function getSectionHasLiquidHeight(props: { liquid: boolean }, sectionConfig: SectionConfig) {\n return props.liquid && sectionConfig.liquid // does the section do liquid-height? (need to have whole scrollgrid liquid-height as well)\n}\n\nexport function getAllowYScrolling(props: { liquid: boolean }, sectionConfig: SectionConfig) {\n return sectionConfig.maxHeight != null || // if its possible for the height to max out, we might need scrollbars\n getSectionHasLiquidHeight(props, sectionConfig) // if the section is liquid height, it might condense enough to require scrollbars\n}\n\n// TODO: ONLY use `arg`. force out internal function to use same API\nexport function renderChunkContent(sectionConfig: SectionConfig, chunkConfig: ChunkConfig, arg: ChunkContentCallbackArgs) {\n let { expandRows } = arg\n\n let content: VNode = typeof chunkConfig.content === 'function' ?\n chunkConfig.content(arg) :\n createElement('table',\n {\n className: [\n chunkConfig.tableClassName,\n sectionConfig.syncRowHeights ? 'fc-scrollgrid-sync-table' : '',\n ].join(' '),\n style: {\n minWidth: arg.tableMinWidth, // because colMinWidths arent enough\n width: arg.clientWidth,\n height: expandRows ? arg.clientHeight : '', // css `height` on a <table> serves as a min-height\n },\n },\n arg.tableColGroupNode,\n createElement('tbody', {}, typeof chunkConfig.rowContent === 'function' ? chunkConfig.rowContent(arg) : chunkConfig.rowContent))\n\n return content\n}\n\nexport function isColPropsEqual(cols0: ColProps[], cols1: ColProps[]) {\n return isArraysEqual(cols0, cols1, isPropsEqual)\n}\n\nexport function renderMicroColGroup(cols: ColProps[], shrinkWidth?: number): VNode {\n let colNodes: VNode[] = []\n\n /*\n for ColProps with spans, it would have been great to make a single <col span=\"\">\n HOWEVER, Chrome was getting messing up distributing the width to <td>/<th> elements with colspans.\n SOLUTION: making individual <col> elements makes Chrome behave.\n */\n for (let colProps of cols) {\n let span = colProps.span || 1\n\n for (let i = 0; i < span; i += 1) {\n colNodes.push(\n <col\n style={{\n width: colProps.width === 'shrink' ? sanitizeShrinkWidth(shrinkWidth) : (colProps.width || ''),\n minWidth: colProps.minWidth || '',\n }}\n />,\n )\n }\n }\n\n return createElement('colgroup', {}, ...colNodes)\n}\n\nexport function sanitizeShrinkWidth(shrinkWidth?: number) {\n /* why 4? if we do 0, it will kill any border, which are needed for computeSmallestCellWidth\n 4 accounts for 2 2-pixel borders. TODO: better solution? */\n return shrinkWidth == null ? 4 : shrinkWidth\n}\n\nexport function hasShrinkWidth(cols: ColProps[]) {\n for (let col of cols) {\n if (col.width === 'shrink') {\n return true\n }\n }\n\n return false\n}\n\nexport function getScrollGridClassNames(liquid: boolean, context: ViewContext) {\n let classNames = [\n 'fc-scrollgrid',\n context.theme.getClass('table'),\n ]\n\n if (liquid) {\n classNames.push('fc-scrollgrid-liquid')\n }\n\n return classNames\n}\n\nexport function getSectionClassNames(sectionConfig: SectionConfig, wholeTableVGrow: boolean) {\n let classNames = [\n 'fc-scrollgrid-section',\n `fc-scrollgrid-section-${sectionConfig.type}`,\n sectionConfig.className, // used?\n ]\n\n if (wholeTableVGrow && sectionConfig.liquid && sectionConfig.maxHeight == null) {\n classNames.push('fc-scrollgrid-section-liquid')\n }\n\n if (sectionConfig.isSticky) {\n classNames.push('fc-scrollgrid-section-sticky')\n }\n\n return classNames\n}\n\nexport function renderScrollShim(arg: ChunkContentCallbackArgs) {\n return (\n <div\n className=\"fc-scrollgrid-sticky-shim\"\n style={{\n width: arg.clientWidth,\n minWidth: arg.tableMinWidth,\n }}\n />\n )\n}\n\nexport function getStickyHeaderDates(options: BaseOptionsRefined) {\n let { stickyHeaderDates } = options\n\n if (stickyHeaderDates == null || stickyHeaderDates === 'auto') {\n stickyHeaderDates = options.height === 'auto' || options.viewHeight === 'auto'\n }\n\n return stickyHeaderDates\n}\n\nexport function getStickyFooterScrollbar(options: BaseOptionsRefined) {\n let { stickyFooterScrollbar } = options\n\n if (stickyFooterScrollbar == null || stickyFooterScrollbar === 'auto') {\n stickyFooterScrollbar = options.height === 'auto' || options.viewHeight === 'auto'\n }\n\n return stickyFooterScrollbar\n}\n","import { VNode, createElement, Fragment } from '../vdom'\nimport { BaseComponent, setRef } from '../vdom-util'\nimport { Scroller, OverflowValue } from './Scroller'\nimport { RefMap } from '../util/RefMap'\nimport {\n ColProps, SectionConfig, renderMicroColGroup, computeShrinkWidth, getScrollGridClassNames, getSectionClassNames, getAllowYScrolling,\n renderChunkContent, getSectionHasLiquidHeight, ChunkConfig, hasShrinkWidth, CssDimValue,\n isColPropsEqual,\n} from './util'\nimport { getCanVGrowWithinCell } from '../util/table-styling'\nimport { memoize } from '../util/memoize'\nimport { isPropsEqual } from '../util/object'\nimport { getScrollbarWidths } from '../util/scrollbar-width'\n\nexport interface SimpleScrollGridProps {\n cols: ColProps[]\n sections: SimpleScrollGridSection[]\n liquid: boolean // liquid *height*\n collapsibleWidth: boolean // can ALL sections be fully collapsed in width?\n height?: CssDimValue // TODO: give to real ScrollGrid\n}\n\nexport interface SimpleScrollGridSection extends SectionConfig {\n key: string\n chunk?: ChunkConfig\n}\n\ninterface SimpleScrollGridState {\n shrinkWidth: number | null\n forceYScrollbars: boolean\n scrollerClientWidths: { [key: string]: number }\n scrollerClientHeights: { [key: string]: number }\n}\n\nexport class SimpleScrollGrid extends BaseComponent<SimpleScrollGridProps, SimpleScrollGridState> {\n processCols = memoize((a) => a, isColPropsEqual) // so we get same `cols` props every time\n\n // yucky to memoize VNodes, but much more efficient for consumers\n renderMicroColGroup: typeof renderMicroColGroup = memoize(renderMicroColGroup)\n\n scrollerRefs = new RefMap<Scroller>()\n scrollerElRefs = new RefMap<HTMLElement>(this._handleScrollerEl.bind(this))\n\n state: SimpleScrollGridState = {\n shrinkWidth: null,\n forceYScrollbars: false,\n scrollerClientWidths: {},\n scrollerClientHeights: {},\n }\n\n render(): VNode {\n let { props, state, context } = this\n let sectionConfigs = props.sections || []\n let cols = this.processCols(props.cols)\n\n let microColGroupNode = this.renderMicroColGroup(cols, state.shrinkWidth)\n let classNames = getScrollGridClassNames(props.liquid, context)\n\n if (props.collapsibleWidth) {\n classNames.push('fc-scrollgrid-collapsible')\n }\n\n // TODO: make DRY\n let configCnt = sectionConfigs.length\n let configI = 0\n let currentConfig: SimpleScrollGridSection\n let headSectionNodes: VNode[] = []\n let bodySectionNodes: VNode[] = []\n let footSectionNodes: VNode[] = []\n\n while (configI < configCnt && (currentConfig = sectionConfigs[configI]).type === 'header') {\n headSectionNodes.push(this.renderSection(currentConfig, microColGroupNode))\n configI += 1\n }\n\n while (configI < configCnt && (currentConfig = sectionConfigs[configI]).type === 'body') {\n bodySectionNodes.push(this.renderSection(currentConfig, microColGroupNode))\n configI += 1\n }\n\n while (configI < configCnt && (currentConfig = sectionConfigs[configI]).type === 'footer') {\n footSectionNodes.push(this.renderSection(currentConfig, microColGroupNode))\n configI += 1\n }\n\n // firefox bug: when setting height on table and there is a thead or tfoot,\n // the necessary height:100% on the liquid-height body section forces the *whole* table to be taller. (bug #5524)\n // use getCanVGrowWithinCell as a way to detect table-stupid firefox.\n // if so, use a simpler dom structure, jam everything into a lone tbody.\n let isBuggy = !getCanVGrowWithinCell()\n\n return createElement(\n 'table',\n {\n className: classNames.join(' '),\n style: { height: props.height },\n },\n Boolean(!isBuggy && headSectionNodes.length) && createElement('thead', {}, ...headSectionNodes),\n Boolean(!isBuggy && bodySectionNodes.length) && createElement('tbody', {}, ...bodySectionNodes),\n Boolean(!isBuggy && footSectionNodes.length) && createElement('tfoot', {}, ...footSectionNodes),\n isBuggy && createElement('tbody', {}, ...headSectionNodes, ...bodySectionNodes, ...footSectionNodes),\n )\n }\n\n renderSection(sectionConfig: SimpleScrollGridSection, microColGroupNode: VNode) {\n if ('outerContent' in sectionConfig) {\n return (\n <Fragment key={sectionConfig.key}>\n {sectionConfig.outerContent}\n </Fragment>\n )\n }\n\n return (\n <tr key={sectionConfig.key} className={getSectionClassNames(sectionConfig, this.props.liquid).join(' ')}>\n {this.renderChunkTd(sectionConfig, microColGroupNode, sectionConfig.chunk)}\n </tr>\n )\n }\n\n renderChunkTd(sectionConfig: SimpleScrollGridSection, microColGroupNode: VNode, chunkConfig: ChunkConfig) {\n if ('outerContent' in chunkConfig) {\n return chunkConfig.outerContent\n }\n\n let { props } = this\n let { forceYScrollbars, scrollerClientWidths, scrollerClientHeights } = this.state\n\n let needsYScrolling = getAllowYScrolling(props, sectionConfig) // TODO: do lazily. do in section config?\n let isLiquid = getSectionHasLiquidHeight(props, sectionConfig)\n\n // for `!props.liquid` - is WHOLE scrollgrid natural height?\n // TODO: do same thing in advanced scrollgrid? prolly not b/c always has horizontal scrollbars\n let overflowY: OverflowValue =\n !props.liquid ? 'visible' :\n forceYScrollbars ? 'scroll' :\n !needsYScrolling ? 'hidden' :\n 'auto'\n\n let sectionKey = sectionConfig.key\n let content = renderChunkContent(sectionConfig, chunkConfig, {\n tableColGroupNode: microColGroupNode,\n tableMinWidth: '',\n clientWidth: (!props.collapsibleWidth && scrollerClientWidths[sectionKey] !== undefined) ? scrollerClientWidths[sectionKey] : null,\n clientHeight: scrollerClientHeights[sectionKey] !== undefined ? scrollerClientHeights[sectionKey] : null,\n expandRows: sectionConfig.expandRows,\n syncRowHeights: false,\n rowSyncHeights: [],\n reportRowHeightChange: () => {},\n })\n\n return (\n <td ref={chunkConfig.elRef}>\n <div className={`fc-scroller-harness${isLiquid ? ' fc-scroller-harness-liquid' : ''}`}>\n <Scroller\n ref={this.scrollerRefs.createRef(sectionKey)}\n elRef={this.scrollerElRefs.createRef(sectionKey)}\n overflowY={overflowY}\n overflowX={!props.liquid ? 'visible' : 'hidden' /* natural height? */}\n maxHeight={sectionConfig.maxHeight}\n liquid={isLiquid}\n liquidIsAbsolute // because its within a harness\n >\n {content}\n </Scroller>\n </div>\n </td>\n )\n }\n\n _handleScrollerEl(scrollerEl: HTMLElement | null, key: string) {\n let section = getSectionByKey(this.props.sections, key)\n\n if (section) {\n setRef(section.chunk.scrollerElRef, scrollerEl)\n }\n }\n\n // TODO: can do a really simple print-view. dont need to join rows\n handleSizing = () => {\n this.setState({\n shrinkWidth: this.computeShrinkWidth(), // will create each chunk's <colgroup>. TODO: precompute hasShrinkWidth\n ...this.computeScrollerDims(),\n })\n }\n\n componentDidMount() {\n this.handleSizing()\n this.context.addResizeHandler(this.handleSizing)\n }\n\n componentDidUpdate() {\n // TODO: need better solution when state contains non-sizing things\n this.handleSizing()\n }\n\n componentWillUnmount() {\n this.context.removeResizeHandler(this.handleSizing)\n }\n\n computeShrinkWidth() {\n return hasShrinkWidth(this.props.cols)\n ? computeShrinkWidth(this.scrollerElRefs.getAll())\n : 0\n }\n\n computeScrollerDims() {\n let scrollbarWidth = getScrollbarWidths()\n let { scrollerRefs, scrollerElRefs } = this\n\n let forceYScrollbars = false\n let scrollerClientWidths: { [index: string]: number } = {}\n let scrollerClientHeights: { [index: string]: number } = {}\n\n for (let sectionKey in scrollerRefs.currentMap) {\n let scroller = scrollerRefs.currentMap[sectionKey]\n\n if (scroller && scroller.needsYScrolling()) {\n forceYScrollbars = true\n break\n }\n }\n\n for (let section of this.props.sections) {\n let sectionKey = section.key\n let scrollerEl = scrollerElRefs.currentMap[sectionKey]\n\n if (scrollerEl) {\n let harnessEl = scrollerEl.parentNode as HTMLElement // TODO: weird way to get this. need harness b/c doesn't include table borders\n\n scrollerClientWidths[sectionKey] = Math.floor(\n harnessEl.getBoundingClientRect().width - (\n forceYScrollbars\n ? scrollbarWidth.y // use global because scroller might not have scrollbars yet but will need them in future\n : 0\n ),\n )\n\n scrollerClientHeights[sectionKey] = Math.floor(\n harnessEl.getBoundingClientRect().height, // never has horizontal scrollbars\n )\n }\n }\n\n return { forceYScrollbars, scrollerClientWidths, scrollerClientHeights }\n }\n}\n\nSimpleScrollGrid.addStateEquality({\n scrollerClientWidths: isPropsEqual,\n scrollerClientHeights: isPropsEqual,\n})\n\nfunction getSectionByKey(sections: SimpleScrollGridSection[], key: string): SimpleScrollGridSection | null {\n for (let section of sections) {\n if (section.key === key) {\n return section\n }\n }\n\n return null\n}\n","import { Seg } from '../component/DateComponent'\nimport { ComponentChildren, createElement, Ref, createRef, RefObject } from '../vdom'\nimport { EventApi } from '../api/EventApi'\nimport {\n computeSegDraggable,\n computeSegStartResizable,\n computeSegEndResizable,\n setElSeg,\n EventContentArg,\n getEventClassNames,\n} from '../component/event-rendering'\nimport { RenderHook } from './render-hook'\nimport { BaseComponent } from '../vdom-util'\n\nexport interface MinimalEventProps {\n seg: Seg\n isDragging: boolean // rename to isMirrorDragging? make optional?\n isResizing: boolean // rename to isMirrorResizing? make optional?\n isDateSelecting: boolean // rename to isMirrorDateSelecting? make optional?\n isSelected: boolean\n isPast: boolean\n isFuture: boolean\n isToday: boolean\n}\n\nexport interface EventRootProps extends MinimalEventProps {\n timeText: string\n disableDragging?: boolean\n disableResizing?: boolean\n defaultContent: (hookProps: EventContentArg) => ComponentChildren\n children: (\n rootElRef: Ref<any>,\n classNames: string[],\n innerElRef: Ref<any>,\n innerContent: ComponentChildren,\n hookProps: EventContentArg\n ) => ComponentChildren\n}\n\nexport class EventRoot extends BaseComponent<EventRootProps> {\n elRef: RefObject<HTMLElement> = createRef<HTMLElement>()\n\n render() {\n let { props, context } = this\n let { options } = context\n let { seg } = props\n let { eventRange } = seg\n let { ui } = eventRange\n\n let hookProps: EventContentArg = {\n event: new EventApi(context, eventRange.def, eventRange.instance),\n view: context.viewApi,\n timeText: props.timeText,\n textColor: ui.textColor,\n backgroundColor: ui.backgroundColor,\n borderColor: ui.borderColor,\n isDraggable: !props.disableDragging && computeSegDraggable(seg, context),\n isStartResizable: !props.disableResizing && computeSegStartResizable(seg, context),\n isEndResizable: !props.disableResizing && computeSegEndResizable(seg, context),\n isMirror: Boolean(props.isDragging || props.isResizing || props.isDateSelecting),\n isStart: Boolean(seg.isStart),\n isEnd: Boolean(seg.isEnd),\n isPast: Boolean(props.isPast), // TODO: don't cast. getDateMeta does it\n isFuture: Boolean(props.isFuture), // TODO: don't cast. getDateMeta does it\n isToday: Boolean(props.isToday), // TODO: don't cast. getDateMeta does it\n isSelected: Boolean(props.isSelected),\n isDragging: Boolean(props.isDragging),\n isResizing: Boolean(props.isResizing),\n }\n\n let standardClassNames = getEventClassNames(hookProps).concat(ui.classNames)\n\n return (\n <RenderHook\n hookProps={hookProps}\n classNames={options.eventClassNames}\n content={options.eventContent}\n defaultContent={props.defaultContent}\n didMount={options.eventDidMount}\n willUnmount={options.eventWillUnmount}\n elRef={this.elRef}\n >\n {(rootElRef, customClassNames, innerElRef, innerContent) => props.children(\n rootElRef, standardClassNames.concat(customClassNames), innerElRef, innerContent, hookProps,\n )}\n </RenderHook>\n )\n }\n\n componentDidMount() {\n setElSeg(this.elRef.current, this.props.seg)\n }\n\n /*\n need to re-assign seg to the element if seg changes, even if the element is the same\n */\n componentDidUpdate(prevProps: EventRootProps) {\n let { seg } = this.props\n\n if (seg !== prevProps.seg) {\n setElSeg(this.elRef.current, seg)\n }\n }\n}\n","import { ComponentChildren, createElement, Fragment } from '../vdom'\nimport { BaseComponent } from '../vdom-util'\nimport { buildSegTimeText, EventContentArg } from '../component/event-rendering'\nimport { EventRoot, MinimalEventProps } from './EventRoot'\nimport { Seg } from '../component/DateComponent'\nimport { DateFormatter } from '../datelib/DateFormatter'\n\nexport interface StandardEventProps extends MinimalEventProps {\n extraClassNames: string[]\n defaultTimeFormat: DateFormatter\n defaultDisplayEventTime?: boolean // default true\n defaultDisplayEventEnd?: boolean // default true\n disableDragging?: boolean // default false\n disableResizing?: boolean // default false\n defaultContent?: (hookProps: EventContentArg) => ComponentChildren // not used by anyone yet\n}\n\n// should not be a purecomponent\nexport class StandardEvent extends BaseComponent<StandardEventProps> {\n render() {\n let { props, context } = this\n let { seg } = props\n let timeFormat = context.options.eventTimeFormat || props.defaultTimeFormat\n let timeText = buildSegTimeText(\n seg,\n timeFormat,\n context,\n props.defaultDisplayEventTime,\n props.defaultDisplayEventEnd,\n )\n\n return (\n <EventRoot\n seg={seg}\n timeText={timeText}\n disableDragging={props.disableDragging}\n disableResizing={props.disableResizing}\n defaultContent={props.defaultContent || renderInnerContent}\n isDragging={props.isDragging}\n isResizing={props.isResizing}\n isDateSelecting={props.isDateSelecting}\n isSelected={props.isSelected}\n isPast={props.isPast}\n isFuture={props.isFuture}\n isToday={props.isToday}\n >\n {(rootElRef, classNames, innerElRef, innerContent, hookProps) => (\n <a\n className={props.extraClassNames.concat(classNames).join(' ')}\n style={{\n borderColor: hookProps.borderColor,\n backgroundColor: hookProps.backgroundColor,\n }}\n ref={rootElRef}\n {...getSegAnchorAttrs(seg)}\n >\n <div className=\"fc-event-main\" ref={innerElRef} style={{ color: hookProps.textColor }}>\n {innerContent}\n </div>\n {hookProps.isStartResizable &&\n <div className=\"fc-event-resizer fc-event-resizer-start\" />}\n {hookProps.isEndResizable &&\n <div className=\"fc-event-resizer fc-event-resizer-end\" />}\n </a>\n )}\n </EventRoot>\n )\n }\n}\n\nfunction renderInnerContent(innerProps: EventContentArg) {\n return (\n <div className=\"fc-event-main-frame\">\n {innerProps.timeText && (\n <div className=\"fc-event-time\">{innerProps.timeText}</div>\n )}\n <div className=\"fc-event-title-container\">\n <div className=\"fc-event-title fc-sticky\">\n {innerProps.event.title || <Fragment>&nbsp;</Fragment>}\n </div>\n </div>\n </div>\n )\n}\n\nfunction getSegAnchorAttrs(seg: Seg) {\n let { url } = seg.eventRange.def\n return url ? { href: url } : {}\n}\n","import { RenderHook, RenderHookPropsChildren, MountArg } from './render-hook'\nimport { DateMarker } from '../datelib/marker'\nimport { ViewContext, ViewContextType } from '../ViewContext'\nimport { createElement } from '../vdom'\nimport { ViewApi } from '../ViewApi'\n\nexport interface NowIndicatorRootProps {\n isAxis: boolean\n date: DateMarker\n children: RenderHookPropsChildren\n}\n\nexport interface NowIndicatorContentArg {\n isAxis: boolean\n date: Date\n view: ViewApi\n}\n\nexport type NowIndicatorMountArg = MountArg<NowIndicatorContentArg>\n\nexport const NowIndicatorRoot = (props: NowIndicatorRootProps) => (\n <ViewContextType.Consumer>\n {(context: ViewContext) => {\n let { options } = context\n let hookProps: NowIndicatorContentArg = {\n isAxis: props.isAxis,\n date: context.dateEnv.toDate(props.date),\n view: context.viewApi,\n }\n\n return (\n <RenderHook\n hookProps={hookProps}\n classNames={options.nowIndicatorClassNames}\n content={options.nowIndicatorContent}\n didMount={options.nowIndicatorDidMount}\n willUnmount={options.nowIndicatorWillUnmount}\n >\n {props.children}\n </RenderHook>\n )\n }}\n </ViewContextType.Consumer>\n)\n","import { Ref, ComponentChildren, createElement } from '../vdom'\nimport { DateMarker } from '../datelib/marker'\nimport { DateRange } from '../datelib/date-range'\nimport { getDateMeta, DateMeta } from '../component/date-rendering'\nimport { createFormatter } from '../datelib/formatting'\nimport { ContentHook } from './render-hook'\nimport { ViewApi } from '../ViewApi'\nimport { BaseComponent } from '../vdom-util'\nimport { DateProfile } from '../DateProfileGenerator'\nimport { Dictionary } from '../options'\nimport { DateEnv } from '../datelib/env'\n\nconst DAY_NUM_FORMAT = createFormatter({ day: 'numeric' })\n\nexport interface DayCellContentProps {\n date: DateMarker\n dateProfile: DateProfile\n todayRange: DateRange\n showDayNumber?: boolean // defaults to false\n extraHookProps?: Dictionary\n defaultContent?: (hookProps: DayCellContentArg) => ComponentChildren\n children: (\n innerElRef: Ref<any>,\n innerContent: ComponentChildren\n ) => ComponentChildren\n}\n\nexport interface DayCellContentArg extends DateMeta {\n date: DateMarker // localized\n view: ViewApi\n dayNumberText: string\n [extraProp: string]: any // so can include a resource\n}\n\nexport interface DayCellHookPropsInput {\n date: DateMarker // generic\n dateProfile: DateProfile\n todayRange: DateRange\n dateEnv: DateEnv\n viewApi: ViewApi\n showDayNumber?: boolean // defaults to false\n extraProps?: Dictionary // so can include a resource\n}\n\nexport class DayCellContent extends BaseComponent<DayCellContentProps> {\n render() {\n let { props, context } = this\n let { options } = context\n let hookProps = refineDayCellHookProps({\n date: props.date,\n dateProfile: props.dateProfile,\n todayRange: props.todayRange,\n showDayNumber: props.showDayNumber,\n extraProps: props.extraHookProps,\n viewApi: context.viewApi,\n dateEnv: context.dateEnv,\n })\n\n return (\n <ContentHook\n hookProps={hookProps}\n content={options.dayCellContent}\n defaultContent={props.defaultContent}\n >\n {props.children}\n </ContentHook>\n )\n }\n}\n\nexport function refineDayCellHookProps(raw: DayCellHookPropsInput): DayCellContentArg {\n let { date, dateEnv } = raw\n let dayMeta = getDateMeta(date, raw.todayRange, null, raw.dateProfile)\n\n return {\n date: dateEnv.toDate(date),\n view: raw.viewApi,\n ...dayMeta,\n dayNumberText: raw.showDayNumber ? dateEnv.format(date, DAY_NUM_FORMAT) : '',\n ...raw.extraProps,\n }\n}\n","import { Ref, ComponentChildren, createElement } from '../vdom'\nimport { DateMarker } from '../datelib/marker'\nimport { DateRange } from '../datelib/date-range'\nimport { getDayClassNames, DateMeta } from '../component/date-rendering'\nimport { formatDayString } from '../datelib/formatting-utils'\nimport { buildClassNameNormalizer, MountHook, MountArg } from './render-hook'\nimport { ViewApi } from '../ViewApi'\nimport { BaseComponent } from '../vdom-util'\nimport { DateProfile } from '../DateProfileGenerator'\nimport { memoizeObjArg } from '../util/memoize'\nimport { Dictionary } from '../options'\nimport { refineDayCellHookProps } from './DayCellContent'\n\nexport interface DayCellContentArg extends DateMeta {\n date: DateMarker // localized\n view: ViewApi\n dayNumberText: string\n [extraProp: string]: any // so can include a resource\n}\nexport type DayCellMountArg = MountArg<DayCellContentArg>\n\nexport interface DayCellRootProps {\n elRef?: Ref<any>\n date: DateMarker\n dateProfile: DateProfile\n todayRange: DateRange\n showDayNumber?: boolean // defaults to false\n extraHookProps?: Dictionary\n children: (\n rootElRef: Ref<any>,\n classNames: string[],\n rootDataAttrs,\n isDisabled: boolean\n ) => ComponentChildren\n}\n\nexport class DayCellRoot extends BaseComponent<DayCellRootProps> {\n refineHookProps = memoizeObjArg(refineDayCellHookProps)\n normalizeClassNames = buildClassNameNormalizer<DayCellContentArg>()\n\n render() {\n let { props, context } = this\n let { options } = context\n let hookProps = this.refineHookProps({\n date: props.date,\n dateProfile: props.dateProfile,\n todayRange: props.todayRange,\n showDayNumber: props.showDayNumber,\n extraProps: props.extraHookProps,\n viewApi: context.viewApi,\n dateEnv: context.dateEnv,\n })\n\n let classNames = getDayClassNames(hookProps, context.theme).concat(\n hookProps.isDisabled\n ? [] // don't use custom classNames if disabled\n : this.normalizeClassNames(options.dayCellClassNames, hookProps),\n )\n\n let dataAttrs = hookProps.isDisabled ? {} : {\n 'data-date': formatDayString(props.date),\n }\n\n return (\n <MountHook\n hookProps={hookProps}\n didMount={options.dayCellDidMount}\n willUnmount={options.dayCellWillUnmount}\n elRef={props.elRef}\n >\n {(rootElRef) => props.children(rootElRef, classNames, dataAttrs, hookProps.isDisabled)}\n </MountHook>\n )\n }\n}\n","import { createElement } from '../vdom'\nimport { EventRoot } from './EventRoot'\nimport { Seg } from '../component/DateComponent'\nimport { EventContentArg } from '../component/event-rendering'\n\nexport function renderFill(fillType: string) {\n return (\n <div className={`fc-${fillType}`} />\n )\n}\n\nexport interface BgEventProps {\n seg: Seg\n isPast: boolean\n isFuture: boolean\n isToday: boolean\n}\n\nexport const BgEvent = (props: BgEventProps) => (\n <EventRoot\n defaultContent={renderInnerContent}\n seg={props.seg /* uselesss i think */}\n timeText=\"\"\n disableDragging\n disableResizing\n isDragging={false}\n isResizing={false}\n isDateSelecting={false}\n isSelected={false}\n isPast={props.isPast}\n isFuture={props.isFuture}\n isToday={props.isToday}\n >\n {(rootElRef, classNames, innerElRef, innerContent, hookProps) => (\n <div\n ref={rootElRef}\n className={['fc-bg-event'].concat(classNames).join(' ')}\n style={{\n backgroundColor: hookProps.backgroundColor,\n }}\n >\n {innerContent}\n </div>\n )}\n </EventRoot>\n)\n\nfunction renderInnerContent(props: EventContentArg) {\n let { title } = props.event\n\n return title && (\n <div className=\"fc-event-title\">{props.event.title}</div>\n )\n}\n","import { ViewContext, ViewContextType } from '../ViewContext'\nimport { DateMarker } from '../datelib/marker'\nimport { RenderHook, RenderHookPropsChildren, MountArg } from './render-hook'\nimport { createElement } from '../vdom'\nimport { DateFormatter } from '../datelib/DateFormatter'\n\nexport interface WeekNumberRootProps {\n date: DateMarker\n defaultFormat: DateFormatter\n children: RenderHookPropsChildren\n}\n\nexport interface WeekNumberContentArg {\n num: number\n text: string\n date: Date\n}\nexport type WeekNumberMountArg = MountArg<WeekNumberContentArg>\n\nexport const WeekNumberRoot = (props: WeekNumberRootProps) => (\n <ViewContextType.Consumer>\n {(context: ViewContext) => {\n let { dateEnv, options } = context\n let { date } = props\n let format = options.weekNumberFormat || props.defaultFormat\n let num = dateEnv.computeWeekNumber(date) // TODO: somehow use for formatting as well?\n let text = dateEnv.format(date, format)\n let hookProps: WeekNumberContentArg = { num, text, date }\n\n return (\n <RenderHook<WeekNumberContentArg> // why isn't WeekNumberContentArg being auto-detected?\n hookProps={hookProps}\n classNames={options.weekNumberClassNames}\n content={options.weekNumberContent}\n defaultContent={renderInner}\n didMount={options.weekNumberDidMount}\n willUnmount={options.weekNumberWillUnmount}\n >\n {props.children}\n </RenderHook>\n )\n }}\n </ViewContextType.Consumer>\n)\n\nfunction renderInner(innerProps) {\n return innerProps.text\n}\n","import { Dictionary } from '../options'\nimport { computeClippedClientRect } from '../util/dom-geom'\nimport { applyStyle, elementClosest, getEventTargetViaRoot } from '../util/dom-manip'\nimport { createElement, ComponentChildren, Ref, createPortal } from '../vdom'\nimport { BaseComponent, setRef } from '../vdom-util'\n\nexport interface PopoverProps {\n elRef?: Ref<HTMLElement>\n title: string\n extraClassNames?: string[]\n extraAttrs?: Dictionary\n parentEl: HTMLElement\n alignmentEl: HTMLElement\n alignGridTop?: boolean\n children?: ComponentChildren\n onClose?: () => void\n}\n\nconst PADDING_FROM_VIEWPORT = 10\n\nexport class Popover extends BaseComponent<PopoverProps> {\n private rootEl: HTMLElement\n\n render() {\n let { theme } = this.context\n let { props } = this\n let classNames = [\n 'fc-popover',\n theme.getClass('popover'),\n ].concat(\n props.extraClassNames || [],\n )\n\n return createPortal(\n <div className={classNames.join(' ')} {...props.extraAttrs} ref={this.handleRootEl}>\n <div className={'fc-popover-header ' + theme.getClass('popoverHeader')}>\n <span className=\"fc-popover-title\">\n {props.title}\n </span>\n <span className={'fc-popover-close ' + theme.getIconClass('close')} onClick={this.handleCloseClick} />\n </div>\n <div className={'fc-popover-body ' + theme.getClass('popoverContent')}>\n {props.children}\n </div>\n </div>,\n props.parentEl,\n )\n }\n\n componentDidMount() {\n document.addEventListener('mousedown', this.handleDocumentMousedown)\n this.updateSize()\n }\n\n componentWillUnmount() {\n document.removeEventListener('mousedown', this.handleDocumentMousedown)\n }\n\n handleRootEl = (el: HTMLElement | null) => {\n this.rootEl = el\n\n if (this.props.elRef) {\n setRef(this.props.elRef, el)\n }\n }\n\n // Triggered when the user clicks *anywhere* in the document, for the autoHide feature\n handleDocumentMousedown = (ev) => {\n // only hide the popover if the click happened outside the popover\n const target = getEventTargetViaRoot(ev) as HTMLElement\n if (!this.rootEl.contains(target)) {\n this.handleCloseClick()\n }\n }\n\n handleCloseClick = () => {\n let { onClose } = this.props\n if (onClose) {\n onClose()\n }\n }\n\n private updateSize() {\n let { isRtl } = this.context\n let { alignmentEl, alignGridTop } = this.props\n let { rootEl } = this\n\n let alignmentRect = computeClippedClientRect(alignmentEl)\n if (alignmentRect) {\n let popoverDims = rootEl.getBoundingClientRect()\n\n // position relative to viewport\n let popoverTop = alignGridTop\n ? elementClosest(alignmentEl, '.fc-scrollgrid').getBoundingClientRect().top\n : alignmentRect.top\n let popoverLeft = isRtl ? alignmentRect.right - popoverDims.width : alignmentRect.left\n\n // constrain\n popoverTop = Math.max(popoverTop, PADDING_FROM_VIEWPORT)\n popoverLeft = Math.min(popoverLeft, document.documentElement.clientWidth - PADDING_FROM_VIEWPORT - popoverDims.width)\n popoverLeft = Math.max(popoverLeft, PADDING_FROM_VIEWPORT)\n\n let origin = rootEl.offsetParent.getBoundingClientRect()\n applyStyle(rootEl, {\n top: popoverTop - origin.top,\n left: popoverLeft - origin.left,\n })\n }\n }\n}\n","import { DateComponent } from '../component/DateComponent'\nimport { DateRange } from '../datelib/date-range'\nimport { DateMarker } from '../datelib/marker'\nimport { DateProfile } from '../DateProfileGenerator'\nimport { Hit } from '../interactions/hit'\nimport { Dictionary } from '../options'\nimport { createElement, ComponentChildren } from '../vdom'\nimport { DayCellContent } from './DayCellContent'\nimport { DayCellRoot } from './DayCellRoot'\nimport { Popover } from './Popover'\n\nexport interface MorePopoverProps {\n startDate: DateMarker\n endDate: DateMarker\n dateProfile: DateProfile\n parentEl: HTMLElement\n alignmentEl: HTMLElement\n alignGridTop?: boolean\n todayRange: DateRange\n extraDateSpan: Dictionary\n children: ComponentChildren\n onClose?: () => void\n}\n\nexport class MorePopover extends DateComponent<MorePopoverProps> {\n rootEl: HTMLElement\n\n render() {\n let { options, dateEnv } = this.context\n let { props } = this\n let { startDate, todayRange, dateProfile } = props\n let title = dateEnv.format(startDate, options.dayPopoverFormat)\n return (\n <DayCellRoot date={startDate} dateProfile={dateProfile} todayRange={todayRange} elRef={this.handleRootEl}>\n {(rootElRef, dayClassNames, dataAttrs) => (\n <Popover\n elRef={rootElRef}\n title={title}\n extraClassNames={['fc-more-popover'].concat(dayClassNames)}\n extraAttrs={dataAttrs /* TODO: make these time-based when not whole-day? */}\n parentEl={props.parentEl}\n alignmentEl={props.alignmentEl}\n alignGridTop={props.alignGridTop}\n onClose={props.onClose}\n >\n <DayCellContent date={startDate} dateProfile={dateProfile} todayRange={todayRange}>\n {(innerElRef, innerContent) => (\n innerContent &&\n <div className=\"fc-more-popover-misc\" ref={innerElRef}>{innerContent}</div>\n )}\n </DayCellContent>\n {props.children}\n </Popover>\n )}\n </DayCellRoot>\n )\n }\n\n handleRootEl = (rootEl: HTMLDivElement | null) => {\n this.rootEl = rootEl\n if (rootEl) {\n this.context.registerInteractiveComponent(this, {\n el: rootEl,\n useEventCenter: false,\n })\n } else {\n this.context.unregisterInteractiveComponent(this)\n }\n }\n\n queryHit(positionLeft: number, positionTop: number, elWidth: number, elHeight: number): Hit {\n let { rootEl, props } = this\n\n if (\n positionLeft >= 0 && positionLeft < elWidth &&\n positionTop >= 0 && positionTop < elHeight\n ) {\n return {\n dateProfile: props.dateProfile,\n dateSpan: {\n allDay: true,\n range: {\n start: props.startDate,\n end: props.endDate,\n },\n ...props.extraDateSpan,\n },\n dayEl: rootEl,\n rect: {\n left: 0,\n top: 0,\n right: elWidth,\n bottom: elHeight,\n },\n layer: 1, // important when comparing with hits from other components\n }\n }\n\n return null\n }\n}\n","import { EventApi } from '../api/EventApi'\nimport { Seg } from '../component/DateComponent'\nimport { DateRange } from '../datelib/date-range'\nimport { addDays, DateMarker } from '../datelib/marker'\nimport { DateProfile } from '../DateProfileGenerator'\nimport { Dictionary } from '../options'\nimport { elementClosest } from '../util/dom-manip'\nimport { ComponentChildren, createElement, createRef, Fragment, Ref, RefObject, VNode } from '../vdom'\nimport { BaseComponent } from '../vdom-util'\nimport { ViewApi } from '../ViewApi'\nimport { ViewContext, ViewContextType } from '../ViewContext'\nimport { MorePopover } from './MorePopover'\nimport { MountArg, RenderHook } from './render-hook'\n\nexport type MoreLinkChildren = (\n rootElRef: Ref<any>,\n classNames: string[],\n innerElRef: Ref<any>,\n innerContent: ComponentChildren,\n handleClick: (ev: MouseEvent) => void,\n) => ComponentChildren\n\nexport interface MoreLinkRootProps { // what the MoreLinkRoot component receives\n dateProfile: DateProfile\n todayRange: DateRange\n allDayDate: DateMarker | null\n moreCnt: number // can't always derive from hiddenSegs. some hiddenSegs might be due to lack of dimensions\n allSegs: Seg[]\n hiddenSegs: Seg[]\n extraDateSpan?: Dictionary\n alignmentElRef: RefObject<HTMLElement> // for popover\n alignGridTop?: boolean // for popover\n topAlignmentElRef?: RefObject<HTMLElement>\n defaultContent?: (hookProps: MoreLinkContentArg) => ComponentChildren\n popoverContent: () => VNode\n children: MoreLinkChildren\n}\n\nexport interface MoreLinkContentArg { // what the render-hooks receive\n num: number\n text: string\n shortText: string\n view: ViewApi\n}\n\nexport type MoreLinkMountArg = MountArg<MoreLinkContentArg>\n\ninterface MoreLinkRootState {\n isPopoverOpen: boolean\n}\n\nexport class MoreLinkRoot extends BaseComponent<MoreLinkRootProps, MoreLinkRootState> {\n private linkElRef = createRef<HTMLElement>()\n private parentEl: HTMLElement\n\n state = {\n isPopoverOpen: false,\n }\n\n render() {\n let { props } = this\n return (\n <ViewContextType.Consumer>\n {(context: ViewContext) => {\n let { viewApi, options, calendarApi } = context\n let { moreLinkText } = options\n let { moreCnt } = props\n let range = computeRange(props)\n\n let hookProps: MoreLinkContentArg = {\n num: moreCnt,\n shortText: `+${moreCnt}`, // TODO: offer hook or i18n?\n text: typeof moreLinkText === 'function'\n ? moreLinkText.call(calendarApi, moreCnt)\n : `+${moreCnt} ${moreLinkText}`,\n view: viewApi,\n }\n\n return (\n <Fragment>\n {Boolean(props.moreCnt) && (\n <RenderHook<MoreLinkContentArg>\n elRef={this.linkElRef}\n hookProps={hookProps}\n classNames={options.moreLinkClassNames}\n content={options.moreLinkContent}\n defaultContent={props.defaultContent || renderMoreLinkInner}\n didMount={options.moreLinkDidMount}\n willUnmount={options.moreLinkWillUnmount}\n >\n {(rootElRef, customClassNames, innerElRef, innerContent) => props.children(\n rootElRef, ['fc-more-link'].concat(customClassNames), innerElRef, innerContent, this.handleClick,\n )}\n </RenderHook>\n )}\n {this.state.isPopoverOpen && (\n <MorePopover\n startDate={range.start}\n endDate={range.end}\n dateProfile={props.dateProfile}\n todayRange={props.todayRange}\n extraDateSpan={props.extraDateSpan}\n parentEl={this.parentEl}\n alignmentEl={props.alignmentElRef.current}\n alignGridTop={props.alignGridTop}\n onClose={this.handlePopoverClose}\n >\n {props.popoverContent()}\n </MorePopover>\n )}\n </Fragment>\n )\n }}\n </ViewContextType.Consumer>\n )\n }\n\n componentDidMount() {\n this.updateParentEl()\n }\n\n componentDidUpdate() {\n this.updateParentEl()\n }\n\n updateParentEl() {\n if (this.linkElRef.current) {\n this.parentEl = elementClosest(this.linkElRef.current, '.fc-view-harness')\n }\n }\n\n handleClick = (ev: MouseEvent) => {\n let { props, context } = this\n let { moreLinkClick } = context.options\n let date = computeRange(props).start\n\n function buildPublicSeg(seg: Seg) {\n let { def, instance, range } = seg.eventRange\n return {\n event: new EventApi(context, def, instance),\n start: context.dateEnv.toDate(range.start),\n end: context.dateEnv.toDate(range.end),\n isStart: seg.isStart,\n isEnd: seg.isEnd,\n }\n }\n\n if (typeof moreLinkClick === 'function') {\n moreLinkClick = moreLinkClick({\n date,\n allDay: Boolean(props.allDayDate),\n allSegs: props.allSegs.map(buildPublicSeg),\n hiddenSegs: props.hiddenSegs.map(buildPublicSeg),\n jsEvent: ev,\n view: context.viewApi,\n }) as string | undefined\n }\n\n if (!moreLinkClick || moreLinkClick === 'popover') {\n this.setState({ isPopoverOpen: true })\n } else if (typeof moreLinkClick === 'string') { // a view name\n context.calendarApi.zoomTo(date, moreLinkClick)\n }\n }\n\n handlePopoverClose = () => {\n this.setState({ isPopoverOpen: false })\n }\n}\n\nfunction renderMoreLinkInner(props: MoreLinkContentArg) {\n return props.text\n}\n\nfunction computeRange(props: MoreLinkRootProps): DateRange {\n if (props.allDayDate) {\n return {\n start: props.allDayDate,\n end: addDays(props.allDayDate, 1),\n }\n }\n\n let { hiddenSegs } = props\n return {\n start: computeEarliestSegStart(hiddenSegs),\n end: computeLatestSegEnd(hiddenSegs),\n }\n}\n\nexport function computeEarliestSegStart(segs: Seg[]): DateMarker {\n return segs.reduce(pickEarliestStart).eventRange.range.start\n}\n\nfunction pickEarliestStart(seg0: Seg, seg1: Seg): Seg {\n return seg0.eventRange.range.start < seg1.eventRange.range.start ? seg0 : seg1\n}\n\nfunction computeLatestSegEnd(segs: Seg[]): DateMarker {\n return segs.reduce(pickLatestEnd).eventRange.range.end\n}\n\nfunction pickLatestEnd(seg0: Seg, seg1: Seg): Seg {\n return seg0.eventRange.range.end > seg1.eventRange.range.end ? seg0 : seg1\n}\n","import './main.css'\n\n// exports\n// --------------------------------------------------------------------------------------------------\n\nexport const version: string = '<%= version %>' // important to type it, so .d.ts has generic string\n\n// explicit API\nexport { EventSourceApi } from './api/EventSourceApi'\nexport { EventApi, buildEventApis } from './api/EventApi'\nexport { CalendarApi } from './CalendarApi'\nexport { formatDate, formatRange, FormatDateOptions, FormatRangeOptions } from './formatting-api'\nexport { ViewApi } from './ViewApi'\nexport * from './api-type-deps'\n\nexport { // things for plugins. everything else is exported in api-type-deps\n BASE_OPTION_DEFAULTS, BASE_OPTION_REFINERS, identity, Identity, Dictionary, refineProps,\n BaseOptionRefiners, BaseOptionsRefined, CalendarOptionRefiners, CalendarOptionsRefined,\n ViewOptionRefiners, ViewOptionsRefined, RawOptionsFromRefiners, RefinedOptionsFromRefiners,\n CalendarListenerRefiners,\n} from './options'\n\nexport { EventDef, EventDefHash } from './structs/event-def'\nexport { EventInstance, EventInstanceHash, createEventInstance } from './structs/event-instance'\nexport { EventInput, EventRefined, parseEventDef, EventTuple, EventRefiners, refineEventDef } from './structs/event-parse'\nexport { BusinessHoursInput, parseBusinessHours } from './structs/business-hours'\n\nexport {\n padStart,\n isInt,\n parseFieldSpecs,\n compareByFieldSpecs,\n compareByFieldSpec,\n flexibleCompare,\n preventSelection, allowSelection, preventContextMenu, allowContextMenu,\n compareNumbers, enableCursor, disableCursor,\n guid,\n computeSmallestCellWidth,\n OrderSpec,\n} from './util/misc'\n\nexport {\n computeVisibleDayRange,\n isMultiDayRange,\n diffDates,\n} from './util/date'\n\nexport {\n removeExact,\n isArraysEqual,\n} from './util/array'\n\nexport { memoize, memoizeObjArg, memoizeArraylike, memoizeHashlike } from './util/memoize'\n\nexport {\n intersectRects,\n Rect, pointInsideRect,\n constrainPoint,\n getRectCenter, diffPoints, Point,\n translateRect,\n} from './util/geom'\n\nexport { mapHash, filterHash, isPropsEqual, compareObjs, buildHashFromArray, collectFromHash, getUnequalProps } from './util/object'\n\nexport {\n findElements,\n findDirectChildren,\n removeElement,\n applyStyle,\n applyStyleProp,\n elementMatches,\n elementClosest,\n getElRoot,\n getEventTargetViaRoot,\n} from './util/dom-manip'\nexport { parseClassNames } from './util/html'\n\nexport { getCanVGrowWithinCell } from './util/table-styling'\n\nexport {\n EventStore,\n filterEventStoreDefs,\n createEmptyEventStore,\n mergeEventStores,\n getRelevantEvents,\n eventTupleToStore,\n} from './structs/event-store'\nexport { EventUiHash, EventUi, combineEventUis, createEventUi } from './component/event-ui'\nexport { Splitter, SplittableProps } from './component/event-splitting'\nexport { getDayClassNames, getDateMeta, DateMeta, getSlotClassNames } from './component/date-rendering'\nexport { buildNavLinkData } from './common/nav-link'\n\nexport {\n preventDefault,\n listenBySelector,\n whenTransitionDone,\n} from './util/dom-event'\n\nexport {\n computeInnerRect,\n computeEdges,\n computeHeightAndMargins,\n getClippingParents,\n computeRect,\n} from './util/dom-geom'\n\nexport { unpromisify } from './util/promise'\n\nexport { Emitter } from './common/Emitter'\nexport { DateRange, rangeContainsMarker, intersectRanges, rangesEqual, rangesIntersect, rangeContainsRange } from './datelib/date-range'\nexport { PositionCache } from './common/PositionCache'\nexport { ScrollController, ElementScrollController, WindowScrollController } from './common/scroll-controller'\nexport { Theme } from './theme/Theme'\nexport { ViewContext, ViewContextType } from './ViewContext'\nexport { DateComponent, Seg, EventSegUiInteractionState } from './component/DateComponent'\nexport { CalendarData } from './reducers/data-types'\nexport { CalendarDataManager } from './reducers/CalendarDataManager'\nexport { CalendarDataProvider, CalendarDataProviderProps } from './component/CalendarDataProvider'\nexport { ViewProps, sliceEvents } from './View'\n\nexport { 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 {\n DateMarker,\n addDays,\n startOfDay,\n addMs,\n addWeeks,\n diffWeeks,\n diffWholeWeeks,\n diffWholeDays,\n diffDayAndTime,\n diffDays,\n isValidDate,\n} from './datelib/marker'\nexport {\n Duration, createDuration,\n asCleanDays, multiplyDuration, addDurations,\n asRoughMinutes, asRoughSeconds, asRoughMs,\n wholeDivideDurations, greatestDurationDenominator,\n} from './datelib/duration'\nexport { DateEnv, DateMarkerMeta } from './datelib/env'\n\nexport {\n createFormatter,\n FormatterInput,\n} from './datelib/formatting'\nexport {\n DateFormatter,\n VerboseFormattingArg,\n} from './datelib/DateFormatter'\nexport {\n formatIsoTimeString,\n formatDayString,\n buildIsoString,\n} from './datelib/formatting-utils'\nexport { NamedTimeZoneImpl } from './datelib/timezone'\nexport { parse as parseMarker } from './datelib/parsing'\nexport { LocaleInput } from './datelib/locale'\n\nexport { EventSourceDef } from './structs/event-source-def'\nexport { EventSource, EventSourceHash } from './structs/event-source'\nexport { EventSourceRefiners, EventSourceRefined } from './structs/event-source-parse'\n\nexport {\n SegSpan, SegRect, SegHierarchy, SegEntry, SegInsertion, buildEntryKey,\n getEntrySpanEnd, binarySearch, SegEntryGroup, groupIntersectingEntries,\n joinSpans, intersectSpans,\n} from './seg-hierarchy'\n\nexport {\n Interaction,\n InteractionSettings,\n interactionSettingsToStore,\n interactionSettingsStore,\n InteractionSettingsStore,\n} from './interactions/interaction'\nexport { PointerDragEvent } from './interactions/pointer'\nexport { Hit } from './interactions/hit'\nexport { dateSelectionJoinTransformer } from './interactions/date-selecting'\nexport { eventDragMutationMassager, EventDropTransformers } from './interactions/event-dragging'\nexport { ElementDragging } from './interactions/ElementDragging'\n\nexport { config } from './global-config'\nexport { globalLocales } from './global-locales'\n\nexport { RecurringType, ParsedRecurring } from './structs/recurring-event'\n\nexport { DragMetaInput, DragMeta, parseDragMeta } from './structs/drag-meta'\n\nexport { PluginDef, PluginDefInput, ViewPropsTransformer, ViewContainerAppend } from './plugin-system-struct'\nexport { createPlugin } from './plugin-system'\nexport { Action } from './reducers/Action'\nexport { CalendarContext } from './CalendarContext'\nexport { CalendarContentProps, CalendarContent } from './CalendarContent'\nexport { CalendarRoot } from './CalendarRoot'\n\nexport { DayHeader } from './common/DayHeader'\nexport { computeFallbackHeaderFormat } from './common/table-utils'\nexport { TableDateCell } from './common/TableDateCell'\nexport { TableDowCell } from './common/TableDowCell'\n\nexport { DaySeriesModel } from './common/DaySeriesModel'\n\nexport { EventInteractionState } from './interactions/event-interaction-state'\nexport {\n EventRenderRange, sliceEventStore, hasBgRendering, setElSeg, getElSeg,\n computeSegDraggable, computeSegStartResizable, computeSegEndResizable,\n getEventClassNames, buildSegTimeText,\n buildSegCompareObj, sortEventSegs,\n getSegMeta, EventContentArg, buildEventRangeKey,\n} from './component/event-rendering'\n\nexport { DayTableModel, DayTableSeg, DayTableCell } from './common/DayTableModel'\n\nexport { Slicer, SlicedProps } from './common/slicing-utils'\n\nexport { EventMutation, applyMutationToEventStore } from './structs/event-mutation'\nexport { Constraint, ConstraintInput, AllowFunc } from './structs/constraint'\nexport { isPropsValid, isInteractionValid, isDateSelectionValid } from './validation'\n\nexport { requestJson } from './util/requestJson'\n\nexport * from './vdom'\nexport { BaseComponent, setRef } from './vdom-util'\nexport { DelayedRunner } from './util/DelayedRunner'\n\nexport {\n ScrollGridProps,\n ScrollGridSectionConfig,\n ColGroupConfig,\n ScrollGridImpl,\n ScrollGridChunkConfig,\n} from './scrollgrid/ScrollGridImpl'\nexport { SimpleScrollGrid, SimpleScrollGridSection } from './scrollgrid/SimpleScrollGrid'\nexport {\n CssDimValue, ScrollerLike, SectionConfig, ColProps, ChunkConfig, hasShrinkWidth, renderMicroColGroup,\n getScrollGridClassNames, getSectionClassNames, getSectionHasLiquidHeight, getAllowYScrolling, renderChunkContent, computeShrinkWidth,\n ChunkContentCallbackArgs,\n sanitizeShrinkWidth,\n ChunkConfigRowContent, ChunkConfigContent,\n isColPropsEqual,\n renderScrollShim,\n getStickyFooterScrollbar,\n getStickyHeaderDates,\n} from './scrollgrid/util'\nexport { Scroller, ScrollerProps, OverflowValue } from './scrollgrid/Scroller'\nexport { getScrollbarWidths } from './util/scrollbar-width'\nexport { RefMap } from './util/RefMap'\nexport { getIsRtlScrollbarOnLeft } from './util/scrollbar-side'\n\nexport { NowTimer } from './NowTimer'\nexport { ScrollResponder, ScrollRequest } from './ScrollResponder'\nexport { globalPlugins } from './global-plugins'\nexport {\n RenderHook, RenderHookProps, RenderHookPropsChildren, MountHook, MountHookProps, buildClassNameNormalizer, ContentHook,\n CustomContentRenderContext, ClassNamesGenerator, CustomContentGenerator, DidMountHandler, WillUnmountHandler, MountArg,\n} from './common/render-hook'\nexport { StandardEvent, StandardEventProps } from './common/StandardEvent'\nexport { NowIndicatorRoot, NowIndicatorRootProps } from './common/NowIndicatorRoot'\n\nexport { DayCellRoot, DayCellRootProps, DayCellContentArg } from './common/DayCellRoot'\nexport { DayCellContent, DayCellContentProps } from './common/DayCellContent'\nexport { EventRoot, MinimalEventProps } from './common/EventRoot'\nexport { renderFill, BgEvent, BgEventProps } from './common/bg-fill'\nexport { WeekNumberRoot, WeekNumberRootProps } from './common/WeekNumberRoot'\nexport { MoreLinkRoot, MoreLinkRootProps, MoreLinkContentArg, MoreLinkMountArg, computeEarliestSegStart } from './common/MoreLinkRoot'\n\nexport { ViewRoot, ViewRootProps } from './common/ViewRoot'\nexport { triggerDateSelect, DatePointTransform, DateSpanTransform, DateSelectionApi, getDefaultEventEnd } from './calendar-utils'\n"],"names":["__assign_1","buildDateEnv","eventSourceDef","renderInner","renderInnerContent"],"mappings":";;;;;;;;;;;AAGA;AACA;;IAGE,wBACU,OAAwB,EACzB,mBAAqC;QADpC,YAAO,GAAP,OAAO,CAAiB;QACzB,wBAAmB,GAAnB,mBAAmB,CAAkB;KAE7C;IAED,+BAAM,GAAN;QACE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;YACpB,IAAI,EAAE,qBAAqB;YAC3B,QAAQ,EAAE,IAAI,CAAC,mBAAmB,CAAC,QAAQ;SAC5C,CAAC,CAAA;KACH;IAED,gCAAO,GAAP;QACE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;YACpB,IAAI,EAAE,qBAAqB;YAC3B,SAAS,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC;YAC9C,SAAS,EAAE,IAAI;SAChB,CAAC,CAAA;KACH;IAED,sBAAI,8BAAE;aAAN;YACE,OAAO,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAA;SACzC;;;OAAA;IAED,sBAAI,+BAAG;aAAP;YACE,OAAO,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAA;SACzC;;;OAAA;IAED,sBAAI,kCAAM;aAAV;YACE,OAAO,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAA;SAC5C;;;OAAA;IACH,qBAAC;AAAD,CAAC;;SCrCe,aAAa,CAAC,EAAe;IAC3C,IAAI,EAAE,CAAC,UAAU,EAAE;QACjB,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC,CAAA;KAC9B;AACH,CAAC;AAED;AACA;SAEgB,cAAc,CAAC,EAAe,EAAE,QAAgB;IAC9D,IAAI,EAAE,C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