{"version":3,"file":"dx-scheduler-core.umd.cjs","sources":["../src/utils.ts","../src/constants.ts","../src/plugins/common/helpers.ts","../src/plugins/common/computeds.ts","../src/plugins/appointments/helpers.ts","../src/plugins/week-view/helpers.ts","../src/plugins/week-view/computeds.ts","../src/plugins/vertical-rect/helpers.ts","../src/plugins/all-day-panel/helpers.ts","../src/plugins/appointment-form/constants.ts","../src/plugins/month-view/helpers.ts","../src/plugins/horizontal-rect/helpers.ts","../src/plugins/month-view/computeds.ts","../src/plugins/all-day-panel/computeds.ts","../src/plugins/integrated-grouping/helpers.ts","../src/plugins/integrated-grouping/computeds.ts","../src/plugins/common/calculate-rects.ts","../src/plugins/scheduler-core/helpers.ts","../src/plugins/scheduler-core/computeds.ts","../src/plugins/grouping-panel/utils.ts","../src/plugins/week-view/utils.ts","../src/plugins/view-state/reducers.ts","../src/plugins/appointment-tooltip/reducers.ts","../src/plugins/appointment-tooltip/constants.ts","../src/plugins/appointment-form/reducers.ts","../src/plugins/appointment-form/utils.ts","../src/plugins/appointment-form/helpers.ts","../src/plugins/editing-state/reducers.ts","../src/plugins/editing-state/computeds.ts","../src/plugins/editing-state/helpers.ts","../src/plugins/drag-drop-provider/helpers.ts","../src/plugins/current-time-indicator/helpers.tsx","../src/plugins/resources/helpers.ts","../src/plugins/resources/computeds.ts","../src/plugins/grouping-state/reducers.ts","../src/plugins/common/utils.ts","../src/plugins/date-navigator/helpers.ts","../src/types/appointment-form.types.ts"],"sourcesContent":["import moment from 'moment';\nimport { CustomFunction, PureComputed } from '@devexpress/dx-core';\nimport { RRule, RRuleSet } from 'rrule';\nimport {\n  ComputedHelperFn, ViewPredicateFn,\n  CalculateFirstDateOfWeekFn, AppointmentMoment,\n  Interval, Rect, AppointmentKey,\n} from './types';\n\nexport const computed: ComputedHelperFn = (getters, viewName, baseComputed, defaultValue) => {\n  if (getters.currentView.name !== viewName && !!defaultValue) {\n    return defaultValue;\n  }\n  return baseComputed(getters, viewName);\n};\n\nexport const toPercentage: PureComputed<\n  [number, number]\n> = (value, total) => (value * 100) / total;\n\nconst createExcludedInterval: CustomFunction<\n  [number, moment.Moment], Interval\n> = (day, start) => {\n  const leftBound = moment(start.day(day));\n  return [\n    leftBound,\n    moment(leftBound).hour(start.hour()).endOf('day'),\n  ];\n};\n\nexport const excludedIntervals: PureComputed<\n  [number[], moment.Moment], Interval[]\n> = (excludedDays, start) => excludedDays\n  .map(day => (day === 0 ? 7 : day))\n  .sort((a, b) => a - b)\n  .reduce((acc, day, i, allDays) => {\n    if (i && day === allDays[i - 1] + 1) {\n      acc[acc.length - 1][1].day(day);\n    } else {\n      acc.push(createExcludedInterval(day, start));\n    }\n    return acc;\n  }, [] as Interval[]);\n\nconst inInterval = (\n  date: moment.Moment, interval: Interval,\n) => date.isBetween(interval[0], interval[1], undefined, '[]');\n\nexport const viewPredicate: ViewPredicateFn = (\n  appointment, left, right,\n  excludedDays = [],\n  removeAllDayAppointments = false,\n) => {\n  const { start, end } = appointment;\n  const isAppointmentInBoundary = end.isAfter(left as Date)\n    && start.isBefore(right as Date);\n\n  const isAppointmentInExcludedDays = !!excludedIntervals(excludedDays, moment(left as Date))\n    .find(interval => (inInterval(start, interval) && inInterval(end, interval)));\n  const considerAllDayAppointment = removeAllDayAppointments\n    ? moment(end).diff(start, 'hours') < 24 && !appointment.allDay\n    : true;\n\n  return isAppointmentInBoundary && !isAppointmentInExcludedDays && considerAllDayAppointment;\n};\n\nexport const calculateFirstDateOfWeek: CalculateFirstDateOfWeekFn = (\n  currentDate, firstDayOfWeek, excludedDays = [],\n) => {\n  const currentLocale = moment.locale();\n  moment.updateLocale('tmp-locale', {\n    week: { dow: firstDayOfWeek, doy: 1 }, // `doy` is required for TS using\n  });\n  const firstDateOfWeek = moment(currentDate as Date).startOf('week');\n  if (excludedDays.indexOf(firstDayOfWeek) !== -1) {\n    excludedDays.slice().sort().forEach((day) => {\n      if (day === firstDateOfWeek.day()) {\n        firstDateOfWeek.add(1, 'days');\n      }\n    });\n  }\n  moment.locale(currentLocale);\n\n  return firstDateOfWeek.toDate();\n};\n\nexport const getAppointmentStyle: PureComputed<\n  [Rect], React.CSSProperties\n> = ({\n  top, left,\n  width, height,\n}) => {\n  const transform = `translateY(${top}px)` as any;\n  return ({\n    height,\n    width: `${width}%`,\n    transform,\n    msTransform: transform,\n    left: `${left}%`,\n    position: 'absolute',\n  });\n};\n\nconst expandRecurrenceAppointment = (\n  appointment: AppointmentMoment, leftBound: Date, rightBound: Date,\n) => {\n  const rightBoundUTC = moment(getUTCDate(rightBound)).toDate();\n  const leftBoundUTC = moment(getUTCDate(leftBound)).toDate();\n  const appointmentStartDate = moment(appointment.start).toDate();\n  const options = {\n    ...RRule.parseString(appointment.rRule),\n    dtstart: moment(getUTCDate(appointmentStartDate)).toDate(),\n  };\n  const correctedOptions = options.until\n    ? { ...options, until: moment(getUTCDate(options.until)).toDate() }\n    : options;\n\n  const rruleSet = getRRuleSetWithExDates(appointment.exDate);\n\n  rruleSet.rrule(new RRule(correctedOptions));\n\n  // According to https://github.com/jakubroztocil/rrule#important-use-utc-dates\n  // we have to format the dates we get from RRuleSet to get local dates\n  const datesInBoundaries = rruleSet.between(leftBoundUTC as Date, rightBoundUTC as Date, true)\n    .map(formatDateToString);\n  if (datesInBoundaries.length === 0) return [];\n\n  const appointmentDuration = moment(appointment.end)\n    .diff(appointment.start, 'minutes');\n\n  return datesInBoundaries.map((startDate, index) => ({\n    ...appointment,\n    dataItem: {\n      ...appointment.dataItem,\n      startDate: moment(startDate).toDate(),\n      endDate: moment(startDate).add(appointmentDuration, 'minutes').toDate(),\n      parentData: appointment.dataItem,\n    },\n    start: moment(startDate),\n    end: moment(startDate).add(appointmentDuration, 'minutes'),\n    key: `${appointment.key}_rec_${index}`,\n  }));\n};\n\nexport const filterByViewBoundaries: PureComputed<\n  [AppointmentMoment, Date, Date, number[], boolean], AppointmentMoment[]\n> = (appointment, leftBound, rightBound, excludedDays, removeAllDay) => {\n  let appointments = [appointment];\n  if (appointment.rRule) {\n    appointments = expandRecurrenceAppointment(\n      appointment as AppointmentMoment, leftBound as Date, rightBound as Date,\n    );\n  }\n  return appointments.filter(appt => viewPredicate(\n    appt, leftBound, rightBound, excludedDays, removeAllDay,\n  ));\n};\n\nexport const getUTCDate: PureComputed<[Date], number> = date =>\n  Date.UTC(\n    date.getFullYear(),\n    date.getMonth(),\n    date.getDate(),\n    date.getHours(),\n    date.getMinutes(),\n);\n\nexport const getRRuleSetWithExDates: PureComputed<\n  [string | undefined], RRuleSet\n> = (exDate) => {\n  const rruleSet = new RRuleSet();\n  if (exDate) {\n    exDate.split(',').map((date: string) => {\n      const currentExDate = moment(date).toDate();\n      rruleSet.exdate(moment(getUTCDate(currentExDate)).toDate());\n    });\n  }\n  return rruleSet;\n};\n\nexport const formatDateToString = (date: Date | string | number) => moment.utc(date).format('YYYY-MM-DDTHH:mm');\n\nexport const addDateToKey: PureComputed<\n  [AppointmentKey, moment.Moment], AppointmentKey\n> = (prevKey, momentDate) => `${prevKey}_${momentDate.toDate().toString()}`;\n","import { GroupOrientation } from './types';\n\nexport const VERTICAL_TYPE = 'vertical';\nexport const HORIZONTAL_TYPE = 'horizontal';\n\nexport const SCROLL_OFFSET = 50;\nexport const SCROLL_SPEED_PX = 15;\n\nexport const SECONDS = 'seconds';\nexport const MINUTES = 'minutes';\nexport const HOURS = 'hours';\n\nexport const RESIZE_TOP = 'resize-start';\nexport const RESIZE_BOTTOM = 'resize-end';\n\nexport const POSITION_START = 'start';\nexport const POSITION_END = 'end';\n\nexport const AUTO_HEIGHT = 'auto';\n\nexport const DAY_OPTIONS = { day: 'numeric' } as const;\nexport const WEEK_DAY_OPTIONS = { weekday: 'short' } as const;\nexport const SHORT_MONTH_OPTIONS = { month: 'short' } as const;\nexport const HOUR_MINUTE_OPTIONS = { hour: 'numeric', minute: 'numeric' } as const;\nexport const MONTH_YEAR_OPTIONS = { month: 'long', year: 'numeric' } as const;\nexport const DAY_SHORT_MONTH_OPTIONS = { day: 'numeric', month: 'short' } as const;\nexport const SHORT_MONTH_LONG_YEAR_OPTIONS = { month: 'short', year: 'numeric' } as const;\nexport const SHORT_MONTH_SHORT_YEAR_OPTIONS = { month: 'short', year: '2-digit' } as const;\nexport const DAY_LONG_MONTH_LONG_YEAR_OPTIONS = {\n  day: 'numeric', month: 'long', year: 'numeric',\n} as const;\nexport const DAY_SHORT_MONTH_LONG_YEAR_OPTIONS = {\n  day: 'numeric', month: 'short', year: 'numeric',\n} as const;\nexport const DAY_SHORT_MONTH_SHORT_YEAR_OPTIONS = {\n  day: 'numeric', month: 'short', year: '2-digit',\n} as const;\nexport const LONG_WEEK_DAY_OPTIONS = { weekday: 'long' } as const;\nexport const LONG_MONTH_OPTIONS = { month: 'long' } as const;\nexport const DAY_LONG_MONTH_OPTIONS = { day: 'numeric', month: 'long' } as const;\nexport const EMPTY_OPTIONS = {} as const;\n\nexport const RECURRENCE_EDIT_SCOPE = {\n  ALL: 'all',\n  CURRENT_AND_FOLLOWING: 'currentAndFollowing',\n  CURRENT: 'current',\n} as const;\n\nexport const TOGGLE_APPOINTMENT_FORM_VISIBILITY = 'toggleAppointmentFormVisibility';\nexport const TOGGLE_APPOINTMENT_TOOLTIP_VISIBILITY = 'toggleAppointmentTooltipVisibility';\n\nexport const WEEKDAY_INTERVAL = 'weekdayInterval';\n\nexport const VERTICAL_VIEW_LEFT_OFFSET = 80;\nexport const HORIZONTAL_VIEW_LEFT_OFFSET = 0;\n\nexport const VERTICAL_GROUP_ORIENTATION = 'Vertical' as GroupOrientation;\nexport const HORIZONTAL_GROUP_ORIENTATION = 'Horizontal' as GroupOrientation;\n\nexport const VIEW_TYPES = {\n  MONTH: 'month',\n  WEEK: 'week',\n  DAY: 'day',\n  ALL_DAY_PANEL: 'allDayPanel',\n} as const;\n","import moment from 'moment';\nimport { PureComputed } from '@devexpress/dx-core';\nimport {\n  VERTICAL_TYPE, HORIZONTAL_TYPE, DAY_OPTIONS, SHORT_MONTH_OPTIONS,\n  DAY_SHORT_MONTH_OPTIONS, SHORT_MONTH_LONG_YEAR_OPTIONS,\n  SHORT_MONTH_SHORT_YEAR_OPTIONS, MONTH_YEAR_OPTIONS,\n  DAY_LONG_MONTH_LONG_YEAR_OPTIONS, DAY_SHORT_MONTH_SHORT_YEAR_OPTIONS,\n  DAY_SHORT_MONTH_LONG_YEAR_OPTIONS, LONG_WEEK_DAY_OPTIONS, EMPTY_OPTIONS,\n  WEEKDAY_INTERVAL,\n} from '../../constants';\nimport {\n  ViewBoundTextFn, FormatterFn, ViewCell,\n  AppointmentMoment, Group, SchedulerDateTime, CellElementsMeta,\n} from '../../types';\n\nconst MONTH_TYPE = 'month';\n\nexport const getViewType: PureComputed<[string], string> = (currentViewType) => {\n  if (currentViewType === MONTH_TYPE) return HORIZONTAL_TYPE;\n  return VERTICAL_TYPE;\n};\n\nexport const isMidnight: PureComputed<\n  [Date], boolean\n> = (date) => {\n  const momentDate = moment(date as Date);\n  return momentDate.hours() === 0 && momentDate.minutes() === 0 && momentDate.seconds() === 0;\n};\n\nconst calculateTextByDays: PureComputed<\n  [Date, Date, FormatterFn, object], string\n> = (startViewDate, endViewDate, formatDate, additionalOptions) => {\n  const momentStartViewDate = moment(startViewDate as Date);\n  const momentEndViewDate = moment(endViewDate as Date);\n\n  if (momentStartViewDate.isSame(momentEndViewDate, 'day')) {\n    return formatDate(momentStartViewDate.toDate(), {\n      ...DAY_LONG_MONTH_LONG_YEAR_OPTIONS, ...additionalOptions,\n    });\n  }\n  if (momentStartViewDate.isSame(momentEndViewDate, 'year')) {\n    if (momentStartViewDate.isSame(momentEndViewDate, 'month')) {\n      return `${\n        formatDate(momentStartViewDate.toDate(), DAY_OPTIONS)\n      }-${\n        formatDate(momentEndViewDate.toDate(), DAY_OPTIONS)\n      } ${\n        formatDate(momentEndViewDate.toDate(), MONTH_YEAR_OPTIONS)\n      }`;\n    }\n    return `${\n      formatDate(momentStartViewDate.toDate(), DAY_SHORT_MONTH_OPTIONS)\n    } - ${\n      formatDate(momentEndViewDate.toDate(), DAY_SHORT_MONTH_LONG_YEAR_OPTIONS)\n    }`;\n  }\n  return `${\n    formatDate(momentStartViewDate.toDate(), DAY_SHORT_MONTH_SHORT_YEAR_OPTIONS)\n  } - ${\n    formatDate(momentEndViewDate.toDate(), DAY_SHORT_MONTH_SHORT_YEAR_OPTIONS)\n  }`;\n};\n\nconst calculateTextByMonths: PureComputed<\n  [Date, number, FormatterFn], string\n> = (currentDate, intervalCount, formatDate) => {\n  const momentCurrentDate = moment(currentDate as Date);\n\n  if (intervalCount === 1) {\n    return formatDate(momentCurrentDate.toDate(), MONTH_YEAR_OPTIONS);\n  }\n  const lastMonth = momentCurrentDate.clone().add(intervalCount - 1, 'month');\n  if (momentCurrentDate.isSame(lastMonth, 'year')) {\n    return `${\n      formatDate(momentCurrentDate.toDate(), SHORT_MONTH_OPTIONS)\n    }-${\n      formatDate(lastMonth.toDate(), SHORT_MONTH_LONG_YEAR_OPTIONS)\n    }`;\n  }\n  return `${\n    formatDate(momentCurrentDate.toDate(), SHORT_MONTH_SHORT_YEAR_OPTIONS)\n  } - ${\n    formatDate(lastMonth.toDate(), SHORT_MONTH_SHORT_YEAR_OPTIONS)\n  }`;\n};\n\nexport const viewBoundText: ViewBoundTextFn = (\n  startViewDate, endViewDate, type, currentDate, intervalCount, formatDate,\n) => (type !== 'month'\n  ? calculateTextByDays(\n    startViewDate, endViewDate, formatDate,\n    type === WEEKDAY_INTERVAL ? LONG_WEEK_DAY_OPTIONS : EMPTY_OPTIONS,\n  )\n  : calculateTextByMonths(currentDate, intervalCount, formatDate)\n);\n\nexport const checkCellGroupingInfo: PureComputed<\n  [ViewCell, AppointmentMoment], boolean\n> = (cell, appointment) => cell.groupingInfo\n  ? cell.groupingInfo.every((group: Group) => (\n    group.id === appointment[group.fieldName]\n  ))\n  : true;\n\nexport const isDateValid: PureComputed<\n  [Date], boolean\n> = date => moment(date as Date).isValid();\n\nexport const convertToMoment: PureComputed<\n  [SchedulerDateTime], moment.Moment\n> = date => moment(date as SchedulerDateTime);\n\nexport const areDatesSame: PureComputed<\n  [SchedulerDateTime, SchedulerDateTime], boolean\n> = (firstDate, secondDate) => moment(firstDate as SchedulerDateTime)\n  .isSame(secondDate as SchedulerDateTime, 'date');\n\nexport const getTimeTableHeight: PureComputed<\n  [CellElementsMeta], number | undefined\n> = timeTableElementsMeta => timeTableElementsMeta.parentRect?.().height;\n\nexport const containsDSTChange = (date: SchedulerDateTime) => {\n  const momentDate = moment(date);\n  momentDate.startOf('day');\n  const isStartDST = momentDate.isDST();\n\n  momentDate.endOf('day');\n  const isEndDst = momentDate.isDST();\n\n  return (isStartDST && !isEndDst) || (!isStartDST && isEndDst);\n};\n","import moment from 'moment';\nimport { PureComputed } from '@devexpress/dx-core';\nimport {\n  TimeScale, SchedulerDateTime, ViewCell,\n  DayScaleFn, TimeScaleFn, ViewCellsDataFn, AllDayCell,\n  SchedulerView,\n} from '../../types';\nimport { calculateFirstDateOfWeek } from '../../utils';\nimport {\n  isMidnight,\n  containsDSTChange,\n} from './helpers';\n\nconst subtractSecond: PureComputed<\n  [Date]\n> = date => moment(date as Date).subtract(1, 'second').toDate();\n\nexport const dayScale: DayScaleFn = (\n  currentDate,\n  firstDayOfWeek,\n  dayCount,\n  excluded = [],\n) => {\n  const result: Date[] = [];\n  const date = firstDayOfWeek !== undefined\n    ? moment(calculateFirstDateOfWeek(currentDate, firstDayOfWeek, excluded) as Date)\n    : moment(currentDate as Date);\n  for (let index = 0; index < dayCount; index += 1) {\n    if (excluded.findIndex(item => item === date.day()) === -1) {\n      result.push(date.toDate());\n    }\n    date.add(1, 'days');\n  }\n  return result;\n};\n\nexport const timeScale: TimeScaleFn = (\n  currentDate,\n  firstDayOfWeek,\n  startDayHour,\n  endDayHour,\n  cellDuration,\n  excludedDays,\n) => {\n  const result: TimeScale[] = [];\n  const startDateOfView = firstDayOfWeek !== undefined\n    ? calculateFirstDateOfWeek(currentDate, firstDayOfWeek, excludedDays)\n    : currentDate;\n\n  const isDSTChange = containsDSTChange(startDateOfView as Date);\n  const validDate = moment(startDateOfView as Date);\n  if (isDSTChange) {\n    validDate.subtract(1, 'day');\n  }\n\n  const left = moment(validDate)\n    .startOf('day')\n    .add(startDayHour, 'hour');\n  const right = moment(validDate)\n    .startOf('day')\n    .add(endDayHour, 'hour');\n\n  while (left.isBefore(right)) {\n    const startDate = left.toDate();\n    left.add(cellDuration, 'minutes');\n    result.push({ start: startDate, end: left.toDate() });\n  }\n\n  const timeScaleLastIndex = result.length - 1;\n  if (isMidnight(result[timeScaleLastIndex].end)) {\n    result[timeScaleLastIndex].end = subtractSecond(result[timeScaleLastIndex].end) as Date;\n  }\n  return result;\n};\n\nexport const availableViews: PureComputed<\n  [SchedulerView[], string, string], SchedulerView[]\n> = (views, viewName, viewDisplayName) => {\n  if (!views) return [{ name: viewName, displayName: viewDisplayName }];\n  if (views.findIndex(view => viewName === view.name) === -1) {\n    const nextViews = views.slice();\n    nextViews.push({ name: viewName, displayName: viewDisplayName });\n    return nextViews;\n  }\n  return views;\n};\n\nexport const viewCellsData: ViewCellsDataFn = (\n  currentDate, firstDayOfWeek,\n  dayCount, excludedDays,\n  startDayHour, endDayHour,\n  cellDuration, currTime,\n) => {\n  const days = dayScale(currentDate, firstDayOfWeek!, dayCount!, excludedDays);\n  const times = timeScale(\n    currentDate, firstDayOfWeek!, startDayHour, endDayHour, cellDuration, excludedDays,\n  );\n  const currentTime = moment(currTime as SchedulerDateTime);\n  return times.reduce((cellsAcc, time) => {\n    const start = moment(time.start);\n    const end = moment(time.end);\n    const rowCells = days.reduce((rowAcc, day) => {\n      const startDate = moment(day).hours(start.hours()).minutes(start.minutes()).toDate();\n      const endDate = moment(day).hours(end.hours()).minutes(end.minutes()).toDate();\n      const today = currentTime.isSame(startDate, 'day');\n      rowAcc.push({ startDate, endDate, today });\n      return rowAcc;\n    }, [] as ViewCell[]);\n    cellsAcc.push(rowCells);\n    return cellsAcc;\n  }, [] as ViewCell[][]);\n};\n\nexport const timeCellsData: PureComputed<\n  [ViewCell[][], number, number, number, number], ViewCell[][]\n> = (\n  cellsData, startDayHour, endDayHour, cellDuration, currentTime,\n) => {\n  const { startDate: firstViewDate } = cellsData[0][0];\n  if (!containsDSTChange(firstViewDate)) {\n    return cellsData;\n  }\n\n  const nextDay = moment(firstViewDate)\n    .add(1, 'day')\n    .toDate();\n  const validCellsData = viewCellsData(\n    nextDay, undefined, 1, [], startDayHour, endDayHour, cellDuration, currentTime,\n  );\n\n  return validCellsData;\n};\n\nexport const allDayCells: PureComputed<\n  [ViewCell[][]], AllDayCell[][]\n> = viewCells => [viewCells[0].map(cell => ({\n  startDate: moment(cell.startDate).startOf('day').toDate(),\n  endDate: moment(cell.startDate).add(1, 'day').startOf('day').toDate(),\n  groupingInfo: cell.groupingInfo,\n  endOfGroup: cell.endOfGroup,\n}))];\n\nexport const startViewDate: PureComputed<\n  [ViewCell[][]], Date\n> = viewCells => moment(viewCells[0][0].startDate).toDate();\n\nexport const endViewDate: PureComputed<\n  [ViewCell[][]], Date\n> = (viewCells) => {\n  const lastRowIndex = viewCells.length - 1;\n  const lastCellIndex = viewCells[lastRowIndex].length - 1;\n  return subtractSecond(viewCells[lastRowIndex][lastCellIndex].endDate!);\n};\n","import { PureComputed, CustomFunction } from '@devexpress/dx-core';\nimport {\n  ViewCell, CellElementsMeta, GroupOrientation, AppointmentMoment,\n  AppointmentUnwrappedGroup, ViewMetaData, ElementRect, AppointmentGroup,\n  AppointmentForestRoots, CalculatedTreeNode, TreeNodeWithOverlappingSubTreeRoots,\n  TreeNodeInBlock, AppointmentBlock, IncludedBlock, BlockWithChildren, CalculatedBlock,\n  GroupedIntoBlocksForest, AppointmentIndex,\n\n  VisitRootsFn, CalculateRectByDateAndGroupIntervalsFn, CreateAppointmentForestFn,\n  VisitChildFn, VisitAllChildrenFn, IsPossibleChildFn, FindMaxReduceValueFn,\n  CalculateAppointmentsMetaDataFn, CalulateRootsMetaDataFn, CalculateChildMetaDataFn,\n  CalculateChildrenMetaDataFn, CalculateAppointmentLeftAndWidthFn, PrepareToGroupIntoBlocksFn,\n  IsOverlappingSubTreeRootFn, FindChildrenMaxEndDateFn, GroupAppointmentsIntoBlocksFn,\n  CalculateBlockSizeBEndDateFn, FindBlockIndexByAppointmentFn, FindIncludedBlocksFn,\n  IsIncludedBlockFn, FindChildBlocksFn, IsChildBlockFn, AdjustByBlocksFn,\n  CalculateBlockDimensionsFn, AlignBlocksWithPreviousFn, AdjustAppointemntsByBlocksFn,\n  RedistributeBlocksFn, CalculateIncludedBlockMaxRightFn, CalculateBlocksTotalSizeFn,\n  CalculateSingleBlockTotalSizeFn, CalculateBlocksLeftLimitFn, CalculateSingleBlockLeftLimitFn,\n  UpdateBlocksProportionsFn, UpdateBlocksLeftFn, CreateAndAdjustAppointmentForestFn,\n} from '../../types';\nimport { HORIZONTAL_GROUP_ORIENTATION, HORIZONTAL_TYPE, VERTICAL_TYPE } from '../../constants';\nimport { toPercentage } from '../../utils';\nimport moment from 'moment';\n\nconst MAX_WIDTH = 1;\nconst INDIRECT_CHILD_LEFT_OFFSET = 0.05;\n\nexport const isAllDayElementsMetaActual: PureComputed<\n  [ViewCell[][], CellElementsMeta, GroupOrientation, number], boolean\n> = (viewCellsData, allDayElementsMeta, groupOrientation, groupCount) => {\n  const numberOfRows = groupOrientation === HORIZONTAL_GROUP_ORIENTATION ? 1 : groupCount;\n  return isElementsMetaActual(viewCellsData, allDayElementsMeta, numberOfRows);\n};\n\nexport const isTimeTableElementsMetaActual: PureComputed<\n  [ViewCell[][], CellElementsMeta], boolean\n> = (viewCellsData, timeTableElementsMeta) => isElementsMetaActual(\n  viewCellsData, timeTableElementsMeta, viewCellsData.length,\n);\n\nconst isElementsMetaActual: PureComputed<\n  [ViewCell[][], CellElementsMeta, number], boolean\n> = (viewCellsData, elementsMeta, numberOfRows) => {\n  if (!elementsMeta?.getCellRects) {\n    return false;\n  }\n\n  const tableSize = numberOfRows * viewCellsData[0].length;\n  return tableSize === elementsMeta.getCellRects.length;\n};\n\nconst appointmentHeightType = (appointment: AppointmentMoment, cellDuration: number) => {\n  const durationRatio = appointment.end.clone().diff(appointment.start, 'minutes') / cellDuration;\n  if (durationRatio === 1) return 'middle';\n  if (durationRatio > 1) return 'long';\n  return 'short';\n};\n\nconst horizontalRectCalculator: CustomFunction<\n  [AppointmentUnwrappedGroup, ViewMetaData, any], ElementRect\n> = (\n  appointment,\n  viewMetaData,\n  {\n    rectByDates: getRectByAppointment,\n    multiline,\n    rectByDatesMeta: {\n      cellElementsMeta,\n      viewCellsData,\n    },\n  },\n) => {\n  const {\n    top, left,\n    width, height, parentWidth,\n  } = getRectByAppointment(\n    appointment,\n    viewMetaData,\n    {\n      multiline,\n      cellElementsMeta,\n      viewCellsData,\n    },\n  );\n\n  return {\n    resources: appointment.resources,\n    top: top + ((height / appointment.reduceValue) * appointment.offset),\n    height: height / appointment.reduceValue,\n    left: toPercentage(left, parentWidth),\n    width: toPercentage(width, parentWidth),\n    dataItem: appointment.dataItem,\n    fromPrev: appointment.fromPrev,\n    toNext: appointment.toNext,\n    type: HORIZONTAL_TYPE,\n    key: appointment.key,\n  };\n};\n\nconst verticalRectCalculator: CustomFunction<\n  [AppointmentUnwrappedGroup, ViewMetaData, any], ElementRect\n> = (\n  appointment,\n  viewMetaData,\n  {\n    rectByDates: getRectByAppointment,\n    multiline,\n    rectByDatesMeta: {\n      viewCellsData,\n      cellDuration,\n      cellElementsMeta,\n      excludedDays,\n    },\n  },\n) => {\n  const {\n    top, left,\n    width, height, parentWidth,\n  } = getRectByAppointment(\n    appointment,\n    viewMetaData,\n    {\n      multiline,\n      viewCellsData,\n      cellDuration,\n      excludedDays,\n      cellElementsMeta,\n    },\n  );\n\n  const { offset, width: relativeWidth, left: relativeLeft  } = appointment;\n  const widthMultiplier = (relativeWidth! * 5 / 3 + relativeLeft!) <= 1 ? 5 / 3 : 1;\n  let validWidth = widthMultiplier === 5 / 3\n    ? widthMultiplier * relativeWidth! : relativeWidth! + 0.02;\n  if (validWidth + relativeLeft! > 1) {\n    validWidth = 1 - relativeLeft!;\n  }\n\n  return {\n    resources: appointment.resources,\n    top,\n    height,\n    left: toPercentage(left + relativeLeft! * width, parentWidth),\n    width: toPercentage(validWidth! * width, parentWidth),\n    dataItem: appointment.dataItem,\n    fromPrev: appointment.fromPrev,\n    toNext: appointment.toNext,\n    durationType: appointmentHeightType(appointment, cellDuration),\n    type: VERTICAL_TYPE,\n    offset,\n    key: appointment.key,\n  };\n};\n\nconst oldVerticalRectCalculator: CustomFunction<\n  [AppointmentUnwrappedGroup, ViewMetaData, any], ElementRect\n> = (\n  appointment,\n  viewMetaData,\n  {\n    rectByDates: getRectByAppointment,\n    multiline,\n    rectByDatesMeta: {\n      viewCellsData,\n      cellDuration,\n      cellElementsMeta,\n      excludedDays,\n      placeAppointmentsNextToEachOther,\n    },\n  },\n) => {\n  const {\n    top, left,\n    width, height, parentWidth,\n  } = getRectByAppointment(\n    appointment,\n    viewMetaData,\n    {\n      multiline,\n      viewCellsData,\n      cellDuration,\n      excludedDays,\n      cellElementsMeta,\n      placeAppointmentsNextToEachOther,\n    },\n  );\n\n  const widthInPx = width / appointment.reduceValue;\n\n  return {\n    resources: appointment.resources,\n    top,\n    height,\n    left: toPercentage(left + (widthInPx * appointment.offset), parentWidth),\n    width: toPercentage(widthInPx, parentWidth),\n    dataItem: appointment.dataItem,\n    fromPrev: appointment.fromPrev,\n    toNext: appointment.toNext,\n    durationType: appointmentHeightType(appointment, cellDuration),\n    type: VERTICAL_TYPE,\n    key: appointment.key,\n  };\n};\n\nconst compareByDay: PureComputed<\n  [AppointmentMoment, AppointmentMoment], number\n> = (first, second) => {\n  if (first.start.isBefore(second.start, 'day')) return -1;\n  if (first.start.isAfter(second.start, 'day')) return 1;\n  return 0;\n};\n\nconst compareByAllDay: PureComputed<\n  [AppointmentMoment, AppointmentMoment], number\n> = (first, second) => {\n  if (first.allDay && !second.allDay) return -1;\n  if (!first.allDay && second.allDay) return 1;\n  return 0;\n};\n\nconst compareByTime: PureComputed<\n  [AppointmentMoment, AppointmentMoment], number\n> = (first, second) => {\n  if (first.start.isBefore(second.start)) return -1;\n  if (first.start.isAfter(second.start)) return 1;\n  if (first.end.isBefore(second.end)) return 1;\n  if (first.end.isAfter(second.end)) return -1;\n  return 0;\n};\n\nexport const sortAppointments: PureComputed<\n  [AppointmentMoment[]], AppointmentMoment[]\n> = appointments => appointments\n  .slice().sort((a, b) => compareByDay(a, b) || compareByAllDay(a, b) || compareByTime(a, b));\n\nconst byDayPredicate: PureComputed<\n  [moment.Moment, moment.Moment], boolean\n> = (boundary, date) => (\n  boundary.isSameOrAfter(date, 'day')\n  && !boundary.isSame(boundary.clone().startOf('day'))\n);\n\nexport const findOverlappedAppointments: CustomFunction<\n  [AppointmentMoment[], boolean], any[]\n> = (sortedAppointments, byDay = false) => {\n  const appointments = sortedAppointments.slice();\n  const groups: AppointmentMoment[][] = [];\n  let totalIndex = 0;\n\n  while (totalIndex < appointments.length) {\n    groups.push([]);\n    const current = appointments[totalIndex];\n    const currentGroup = groups[groups.length - 1];\n    let next = appointments[totalIndex + 1];\n    let maxBoundary = current.end;\n\n    currentGroup.push(current);\n    totalIndex += 1;\n    while (next && (maxBoundary.isAfter(next.start)\n      || (byDay && byDayPredicate(maxBoundary, next.start)))) {\n      currentGroup.push(next);\n      if (maxBoundary.isBefore(next.end)) maxBoundary = next.end;\n      totalIndex += 1;\n      next = appointments[totalIndex];\n    }\n  }\n  return groups;\n};\n\nconst isMidnight: PureComputed<\n  [moment.Moment], boolean\n> = date => date.isSame(date.clone().startOf('day'));\n\nconst maxBoundaryPredicate: PureComputed<\n  [moment.Moment, Date], boolean\n> = (maxBoundary, startDate) => ((maxBoundary.isBefore(startDate as Date, 'day'))\n  || (isMidnight(maxBoundary) && maxBoundary.isSame(startDate as Date, 'day')));\n\nexport const calculateAppointmentOffsets: CustomFunction<\n  [any[], boolean], AppointmentGroup[]\n> = (groups, byDay = false) => groups.map((items) => {\n  let offset = 0;\n  let reduceValue = 1;\n  const appointments = items.map((appointment: any) => ({ ...appointment }));\n  const groupLength = appointments.length;\n  for (let startIndex = 0; startIndex < groupLength; startIndex += 1) {\n    const appointment = appointments[startIndex];\n    if (appointment.offset === undefined) {\n      let maxBoundary = appointment.end;\n      appointment.offset = offset;\n      for (let index = startIndex + 1; index < groupLength; index += 1) {\n        if (appointments[index].offset === undefined) {\n          if ((!byDay && maxBoundary.isSameOrBefore(appointments[index].start))\n            || (byDay && maxBoundaryPredicate(maxBoundary, appointments[index].start))) {\n            maxBoundary = appointments[index].end;\n            appointments[index].offset = offset;\n          }\n        }\n      }\n\n      offset += 1;\n      if (reduceValue < offset) reduceValue = offset;\n    }\n  }\n  return { items: appointments, reduceValue };\n});\n\nconst unwrapAppointmentForest: PureComputed<\n  [GroupedIntoBlocksForest[]], AppointmentUnwrappedGroup[]\n> = (appointmentForests) => {\n  const forestUnwrapped = appointmentForests.map(({ items, reduceValue }) => ({\n    reduceValue,\n    items: items.map(({ data }) => ({ ...data })),\n  }));\n  return unwrapGroups(forestUnwrapped);\n};\n\nexport const unwrapGroups: PureComputed<\n  [AppointmentGroup[]], AppointmentUnwrappedGroup[]\n> = groups => groups.reduce((acc, { items, reduceValue }) => {\n  acc.push(...items.map(({ start, end, dataItem, offset, resources, key, ...restProps }) => ({\n    start, end, dataItem, offset, reduceValue, resources,\n    fromPrev: moment(start).diff(dataItem.startDate, 'minutes') > 1,\n    toNext: moment(dataItem.endDate).diff(end, 'minutes') > 1,\n    key,\n    ...restProps,\n  })));\n  return acc;\n}, [] as AppointmentUnwrappedGroup[]);\n\nexport const intervalIncludes: PureComputed<\n  [moment.Moment, moment.Moment, moment.Moment], boolean\n> = (intervalStart, intervalEnd, date) => date\n  .isBetween(intervalStart, intervalEnd, undefined, '[)');\n\nexport const createAppointmentForest: CreateAppointmentForestFn = (\n  appointmentGroups, cellDuration,\n) => appointmentGroups.map((appointmentGroup) => {\n  const { items } = appointmentGroup;\n  let nextItems;\n  let roots;\n  if (items.length === 1) {\n    nextItems = [{\n      data: items[0], children: [], treeDepth: 0, isDirectChild: false, hasDirectChild: false,\n    }];\n    roots = [0];\n  } else {\n    const {\n      appointments, roots: appointmentTreeRoots,\n    } = visitRoots(items, cellDuration) as AppointmentForestRoots;\n    nextItems = appointments;\n    roots = appointmentTreeRoots;\n  }\n  return {\n    ...appointmentGroup,\n    items: nextItems,\n    roots,\n  };\n});\n\nconst visitRoots: VisitRootsFn = (appointmentItems, cellDuration) => {\n  const appointmentNodes: any[] = appointmentItems.map(props => ({\n    data: props,\n  }));\n\n  const roots = appointmentNodes.reduce((acc, appointment, appointmentIndex) => {\n    const { offset: appointmentOffset } = appointment.data;\n\n    if (appointmentOffset === 0) {\n      if (appointmentIndex + 1 === appointmentNodes.length) {\n        appointment.children = [];\n        appointment.hasDirectChild = false;\n        appointment.treeDepth = 0;\n      } else {\n        appointment.treeDepth = visitAllChildren(\n          appointmentNodes, appointmentIndex, cellDuration, 0,\n        );\n      }\n\n      appointment.parent = undefined;\n      appointment.isDirectChild = false;\n      return [...acc, appointmentIndex];\n    }\n    return acc;\n  }, []);\n  return { appointments: appointmentNodes, roots };\n};\n\nconst visitChild: VisitChildFn = (\n  appointmentNodes, index, parentAppointmentIndex, cellDuration, isDirectChild, treeDepth,\n) => {\n  const appointmentNode = appointmentNodes[index];\n  appointmentNode.isDirectChild = isDirectChild;\n  appointmentNode.parent = parentAppointmentIndex;\n  const nextTreeDepth = treeDepth + 1;\n  const { end } = appointmentNode.data;\n\n  if (index === appointmentNodes.length - 1\n    || end.isSameOrBefore(appointmentNodes[index + 1].data.start)) {\n    appointmentNode.children = [];\n    appointmentNode.treeDepth = 0;\n    appointmentNode.hasDirectChild = false;\n    return nextTreeDepth;\n  }\n\n  const calculatedTreeDepth = visitAllChildren(\n    appointmentNodes, index, cellDuration, treeDepth,\n  );\n\n  appointmentNode.treeDepth = calculatedTreeDepth;\n  return calculatedTreeDepth + 1;\n};\n\nconst visitAllChildren: VisitAllChildrenFn = (\n  appointmentNodes, appointmentIndex, cellDuration, treeDepth,\n) => {\n  const appointment = appointmentNodes[appointmentIndex];\n  const { end, offset: appointmentOffset, start } = appointment.data;\n  const directChildTimeLimit = moment(start).add(cellDuration, 'minutes');\n  let maxAppointmentTreeDepth = 0;\n  const children = [] as AppointmentIndex[];\n\n  let nextChildIndex = appointmentIndex + 1;\n  while (isPossibleChild(appointmentNodes, nextChildIndex, end, appointmentOffset)) {\n    const nextAppointment = appointmentNodes[nextChildIndex];\n    const { offset: nextOffset, start: nextStart } = nextAppointment.data;\n\n    if (nextOffset === appointmentOffset + 1) {\n      const isDirectChild = intervalIncludes(start, directChildTimeLimit, nextStart);\n      const nextTreeDepth = visitChild(\n        appointmentNodes, nextChildIndex, appointmentIndex, cellDuration, isDirectChild, treeDepth,\n      );\n\n      if (maxAppointmentTreeDepth < nextTreeDepth) {\n        maxAppointmentTreeDepth = nextTreeDepth;\n      }\n      children.push(nextChildIndex);\n    }\n    nextChildIndex += 1;\n  }\n  appointment.hasDirectChild = children.length !== 0 && appointmentNodes[children[0]].isDirectChild;\n  appointment.children = children;\n\n  return maxAppointmentTreeDepth;\n};\n\nexport const isPossibleChild: IsPossibleChildFn = (\n  appointments, possibleChildIndex, parentEnd, parentOffset,\n) => {\n  const possibleChild = appointments[possibleChildIndex];\n  return (\n    possibleChildIndex < appointments.length\n    && possibleChild.data.offset !== parentOffset\n    && possibleChild.data.start.isBefore(parentEnd)\n  );\n};\n\nexport const findMaxReduceValue: FindMaxReduceValueFn =\n  appointmentGroups => appointmentGroups.reduce((maxReduceValue, group) => {\n    const currentReduceValue = group.reduceValue;\n    return maxReduceValue > currentReduceValue ? maxReduceValue : currentReduceValue;\n  }, 1);\n\nexport const calculateAppointmentsMetaData: CalculateAppointmentsMetaDataFn = (\n  appointmentGroups, indirectChildLeftOffset,\n) => appointmentGroups.map((appointmentForest) => {\n  const { items, roots } = appointmentForest;\n  const firstNode = items[0];\n  return {\n    ...appointmentForest,\n    items: items.length === 1\n      ? [{\n        ...firstNode,\n        data: {\n          ...firstNode.data,\n          left: 0,\n          width: 1,\n        },\n      }]\n      : calculateRootsMetaData(items, roots, indirectChildLeftOffset) as CalculatedTreeNode[],\n  };\n});\n\nconst calculateRootsMetaData: CalulateRootsMetaDataFn = (\n  appointmentNodes, roots, indirectChildLeftOffset,\n) => {\n  const appointments = appointmentNodes.map(props => ({ ...props })) as CalculatedTreeNode[];\n\n  roots.forEach((appointmentIndex) => {\n    const appointment = appointments[appointmentIndex];\n    const { left, width } = calculateAppointmentLeftAndWidth(\n      appointments, undefined, appointment, MAX_WIDTH, indirectChildLeftOffset, undefined,\n    );\n    appointment.data.left = left;\n    appointment.data.width = width;\n    calculateChildrenMetaData(appointments, appointment, MAX_WIDTH, indirectChildLeftOffset);\n  });\n  return appointments;\n};\n\nconst calculateChildMetaData: CalculateChildMetaDataFn = (\n  appointmentNodes, appointmentIndex, maxWidth, indirectChildLeftOffset,\n) => {\n  const appointment = appointmentNodes[appointmentIndex];\n  const { left, width } = calculateAppointmentLeftAndWidth(\n    appointmentNodes, undefined, appointment, maxWidth, indirectChildLeftOffset, undefined,\n  );\n  appointment.data.left = left;\n  appointment.data.width = width;\n\n  calculateChildrenMetaData(\n    appointmentNodes, appointment, maxWidth, indirectChildLeftOffset,\n  );\n};\n\nconst calculateChildrenMetaData: CalculateChildrenMetaDataFn = (\n  appointmentNodes, appointmentNode, maxWidth, indirectChildLeftOffset,\n) => {\n  appointmentNode.children.forEach((childIndex) => {\n    calculateChildMetaData(appointmentNodes, childIndex, maxWidth, indirectChildLeftOffset);\n  });\n};\n\nexport const calculateAppointmentLeftAndWidth: CalculateAppointmentLeftAndWidthFn = (\n  appointmentNodes, blocks, appointmentNode, maxRight, indirectChildLeftOffset, defaultLeft,\n) => {\n  const {\n    hasDirectChild, treeDepth, isDirectChild, parent: parentIndex, children, blockIndex,\n  } = appointmentNode as TreeNodeInBlock;\n  const firstChild = appointmentNodes[children[0]];\n  const firstChildBlockIndex = (firstChild as TreeNodeInBlock)?.blockIndex;\n\n  const hasDirectChildAndInSameBlock = hasDirectChild\n    && (firstChildBlockIndex === undefined || (blockIndex === firstChildBlockIndex\n      || blocks![firstChildBlockIndex].includedInto === blockIndex\n      || maxRight === 1));\n\n  if (parentIndex === undefined) {\n    return ({\n      width: hasDirectChildAndInSameBlock ? maxRight / (treeDepth + 1) : maxRight,\n      left: 0,\n    });\n  }\n\n  const parent = appointmentNodes[parentIndex];\n  const {\n    width: parentWidth,\n    left: parentLeft,\n  } = parent.data;\n  const calculatedLeft = isDirectChild\n    ? parentLeft + parentWidth : parentLeft + indirectChildLeftOffset;\n  const left = defaultLeft !== undefined ? Math.max(defaultLeft, calculatedLeft) : calculatedLeft;\n  const unoccupiedSpace = maxRight - left;\n\n  return ({\n    width: hasDirectChildAndInSameBlock ? unoccupiedSpace / (treeDepth + 1) : unoccupiedSpace,\n    left,\n  });\n};\n\nexport const prepareToGroupIntoBlocks: PrepareToGroupIntoBlocksFn =\n  appointments => appointments.map((appointmentForest) => {\n    const { items: nodes } = appointmentForest;\n    const appointmentNodes = nodes.map(props => ({\n      ...props,\n    })) as TreeNodeWithOverlappingSubTreeRoots[];\n\n    appointmentNodes.forEach((appointmentNode, index) => {\n      if (index === 0) {\n        appointmentNode.overlappingSubTreeRoots = [];\n        return;\n      }\n      const overlappingSubTreeRoots = [] as any[];\n      const { offset: appointmentOffset, end } = appointmentNode.data;\n\n      let nextChildIndex = index + 1;\n      let currentBlockEnd;\n      while (isPossibleChild(appointmentNodes, nextChildIndex, end, appointmentOffset)) {\n        const nextAppointment = appointmentNodes[nextChildIndex];\n        if (nextAppointment.data.offset < appointmentOffset\n          && nextAppointment.maxOffset === undefined) {\n          nextAppointment.maxOffset = appointmentOffset;\n        }\n\n        const previousSubTreeRoot = overlappingSubTreeRoots.length > 0\n          ? appointmentNodes[overlappingSubTreeRoots[overlappingSubTreeRoots.length - 1]]\n          : undefined;\n        if (isOverlappingSubTreeRoot(\n          appointmentNode, nextAppointment, previousSubTreeRoot, currentBlockEnd,\n        )) {\n          overlappingSubTreeRoots.push(nextChildIndex);\n          nextAppointment.overlappingSubTreeRoot = true;\n          const maxChildDate = findChildrenMaxEndDate(appointmentNodes, nextAppointment);\n          if (!currentBlockEnd || currentBlockEnd.isBefore(maxChildDate)) {\n            currentBlockEnd = maxChildDate;\n          }\n        }\n        nextChildIndex += 1;\n      }\n      appointmentNode.overlappingSubTreeRoots = overlappingSubTreeRoots;\n    });\n    return {\n      ...appointmentForest,\n      items: appointmentNodes,\n    };\n  });\n\nexport const isOverlappingSubTreeRoot: IsOverlappingSubTreeRootFn = (\n  appointmentNode, nextAppointment, previousSubTreeRoot, previousEndDate,\n) => {\n  const {\n    overlappingSubTreeRoot, maxOffset, data: nextData,\n  } = nextAppointment;\n  const { offset: nextOffset, start: nextStart } = nextData;\n  const { offset } = appointmentNode.data;\n\n  return (\n    nextOffset < offset\n      && !overlappingSubTreeRoot\n      && (maxOffset === undefined || maxOffset >= offset)\n      && (!previousSubTreeRoot\n        || (previousSubTreeRoot.data.offset >= nextOffset\n        && nextStart.isSameOrAfter(previousEndDate)))\n  );\n};\n\nexport const findChildrenMaxEndDate: FindChildrenMaxEndDateFn = (\n  appointmentNodes, appointmentNode,\n) => {\n  const { children, data } = appointmentNode;\n  const { end } = data;\n\n  const maxDate = children.reduce((currentMaxDate, childIndex) => {\n    const child = appointmentNodes[childIndex];\n    const maxChildrenDate = findChildrenMaxEndDate(appointmentNodes, child);\n    if (maxChildrenDate.isAfter(currentMaxDate)) {\n      return maxChildrenDate;\n    }\n    return currentMaxDate;\n  }, end);\n  return maxDate;\n};\n\nexport const groupAppointmentsIntoBlocks: GroupAppointmentsIntoBlocksFn =\n  appointmentForests => appointmentForests.map((appointmentForest) => {\n    const { items, reduceValue } = appointmentForest;\n    const { blocks: nextBlocks, appointments } = items.reduce((acc, appointment, index) => {\n      const blocks = acc.blocks.slice();\n      const {\n        treeDepth, data, overlappingSubTreeRoots,\n      } = appointment;\n      const { offset, start, end } = data;\n      let blockIndex = findBlockIndexByAppointment(blocks, appointment);\n\n      if (blockIndex < 0) {\n        blocks.push({\n          start, end, minOffset: offset, maxOffset: offset + treeDepth,\n          size: treeDepth + 1, items: [], endForChildren: end,\n        });\n        blockIndex = blocks.length - 1;\n      }\n\n      blocks[blockIndex].items.push(index);\n\n      overlappingSubTreeRoots.forEach((subTreeRootIndex) => {\n        const subTreeRoot = items[subTreeRootIndex];\n        const { data: subTreeRootData } = subTreeRoot;\n        blocks.push({\n          start: subTreeRootData.start, end,\n          minOffset: subTreeRootData.offset, maxOffset: offset - 1,\n          size: calculateBlockSizeByEndDate(items, subTreeRoot, end), items: [],\n          endForChildren: subTreeRootData.end,\n        });\n      });\n      const appointmentInBlock = { ...appointment, blockIndex };\n\n      return {\n        blocks,\n        appointments: [...acc.appointments, appointmentInBlock],\n      };\n    }, {\n      blocks: [{\n        start: items[0].data.start,\n        end: items[0].data.end,\n        minOffset: 0,\n        maxOffset: reduceValue - 1,\n        size: reduceValue,\n        items: [],\n        endForChildren: items[0].data.end,\n      }] as AppointmentBlock[],\n      appointments: [] as TreeNodeInBlock[],\n    });\n    return {\n      blocks: nextBlocks,\n      appointmentForest: {\n        ...appointmentForest,\n        items: appointments,\n      },\n    };\n  });\n\nconst calculateBlockSizeByEndDate: CalculateBlockSizeBEndDateFn = (\n  appointmentNodes, subTreeRoot, blockEndDate,\n) => {\n  const { children, data } = subTreeRoot;\n  const { start } = data;\n\n  if (children.length === 0) {\n    if (blockEndDate.isAfter(start)) {\n      return 1;\n    }\n    return 0;\n  }\n  const maxSize = Math.max(\n    ...children.map(childIndex => calculateBlockSizeByEndDate(\n      appointmentNodes, appointmentNodes[childIndex], blockEndDate),\n    ),\n  );\n\n  if (blockEndDate.isSameOrBefore(start) && maxSize === 0) {\n    return 0;\n  }\n  return maxSize + 1;\n};\n\nexport const findBlockIndexByAppointment: FindBlockIndexByAppointmentFn = (\n  blocks, appointment,\n) => {\n  const { start, offset } = appointment.data;\n\n  let blockIndex = blocks.length - 1;\n  while (blockIndex >= 0) {\n    const currentBlock = blocks[blockIndex];\n    if (intervalIncludes(currentBlock.start, currentBlock.end, start)\n      && offset >= currentBlock.minOffset && offset <= currentBlock.maxOffset &&\n      (!appointment.overlappingSubTreeRoot ||\n        appointment.overlappingSubTreeRoot && !currentBlock.items.length)\n    ) {\n      break;\n    }\n    blockIndex -= 1;\n  }\n\n  return blockIndex;\n};\n\nexport const findIncludedBlocks: FindIncludedBlocksFn = (groupedIntoBlocks) => {\n  return groupedIntoBlocks.map(({ blocks, appointmentForest }) => {\n    const nextBlocks = blocks.map(props => ({ ...props })) as IncludedBlock[];\n\n    nextBlocks.forEach((block, blockIndex) => {\n      block.includedBlocks = [];\n      for (\n        let currentBlockIndex = blockIndex + 1;\n        currentBlockIndex < nextBlocks.length;\n        currentBlockIndex += 1\n      ) {\n        const currentBlock = nextBlocks[currentBlockIndex];\n        if (isIncludedBlock(block, currentBlock)) {\n          block.includedBlocks.push(currentBlockIndex);\n          currentBlock.includedInto = blockIndex;\n        }\n      }\n    });\n    return {\n      blocks: nextBlocks, appointmentForest,\n    };\n  });\n};\n\nconst isIncludedBlock: IsIncludedBlockFn = (block, possibleIncludedBlock) => {\n  const { start, end, minOffset, maxOffset } = block;\n  const {\n    start: possibleIncludedStart, end: possibleIncludedEnd,\n    minOffset: possibleMinOffset, maxOffset: possibleMaxOffset,\n  } = possibleIncludedBlock;\n  return intervalIncludes(start, end, possibleIncludedStart)\n    && intervalIncludes(start, end, possibleIncludedEnd)\n    && possibleMaxOffset <= maxOffset && possibleMinOffset >= minOffset;\n};\n\nexport const findChildBlocks: FindChildBlocksFn = (groupedIntoBlocks) => {\n  return groupedIntoBlocks.map(({ blocks, appointmentForest }) => {\n    const nextBlocks = blocks.map(props => ({ ...props })) as BlockWithChildren[];\n\n    nextBlocks.forEach((block, index) => {\n      block.children = [];\n      for (let currentIndex = index + 1; currentIndex < nextBlocks.length; currentIndex += 1) {\n        const nextBlock = nextBlocks[currentIndex];\n\n        if (isChildBlock(block, nextBlock)) {\n          block.children.push(currentIndex);\n          nextBlock.parent = index;\n        }\n      }\n      return block;\n    });\n    return {\n      appointmentForest, blocks: nextBlocks,\n    };\n  });\n};\n\nconst isChildBlock: IsChildBlockFn = (block, possibleChildBlock) => {\n  const { start, endForChildren, minOffset, includedInto } = block;\n  const {\n    start: childStart, includedInto: childIncludedInto, maxOffset: childMaxOffset,\n  } = possibleChildBlock;\n  return intervalIncludes(start, endForChildren, childStart)\n    && childMaxOffset + 1 === minOffset\n    && (\n      childIncludedInto === undefined\n      || childIncludedInto === includedInto\n    );\n};\n\nexport const adjustByBlocks: AdjustByBlocksFn = (\n  groupedIntoBlocks, indirectChildLeftOffset,\n) => {\n  const updatedBlocks = groupedIntoBlocks.map(({ blocks, appointmentForest }) => {\n    const dimensionsCalculated = calculateBlocksDimensions(blocks, appointmentForest.items);\n\n    return {\n      blocks: alignBlocksWithPrevious(dimensionsCalculated, appointmentForest.items),\n      appointmentForest,\n    };\n  });\n  const adjustedByBlocks = updatedBlocks.map(({ blocks, appointmentForest }) => {\n    return {\n      ...appointmentForest,\n      items: adjustAppointmentsByBlocks(\n        appointmentForest.items, blocks, indirectChildLeftOffset,\n        ) as TreeNodeInBlock[],\n    };\n  });\n  return adjustedByBlocks;\n};\n\nconst calculateBlocksDimensions: CalculateBlockDimensionsFn = (\n  blocks, appointments,\n) => updateBlocksProportions(calculateBlocksLeftLimit(\n  calculateBlocksTotalSize(blocks), appointments,\n));\n\nconst alignBlocksWithPrevious: AlignBlocksWithPreviousFn = (blocks, appointments) => {\n  const nextBlocks = blocks.map(({ right, ...restProps }) => ({ ...restProps }));\n\n  const leftLimitCalculated = calculateBlocksLeftLimit(\n    updateBlocksLeft(nextBlocks as CalculatedBlock[], appointments), appointments,\n  );\n  return updateBlocksProportions(leftLimitCalculated);\n};\n\nconst adjustAppointmentsByBlocks: AdjustAppointemntsByBlocksFn = (\n  appointments, blocks, indirectChildLeftOffset,\n) => {\n  const nextAppointments = appointments.map(props => ({ ...props }));\n  const nextBlocks = blocks.map(props => ({ ...props }));\n\n  nextBlocks.forEach((block, index) => {\n    if (index !== 0) {\n      const { items, left: blockLeft, right, children } = block;\n      const maxRight = calculateIncludedBlockMaxRight(nextBlocks, block);\n      const finalMaxRight = maxRight * right;\n      const defaultLeft = blockLeft! * maxRight;\n\n      items.forEach((appointmentIndex, itemIndex) => {\n        const appointment = nextAppointments[appointmentIndex];\n        if (itemIndex === 0) {\n          const { left, width } = calculateAppointmentLeftAndWidth(\n            nextAppointments, nextBlocks, appointment,\n            finalMaxRight, indirectChildLeftOffset, defaultLeft,\n          );\n          appointment.data.left = left;\n          appointment.data.width = width;\n          if (defaultLeft !== left) {\n            children.forEach((childIndex) => {\n              redistributeChildBlocks(nextBlocks, childIndex, left / maxRight);\n            });\n          }\n        } else {\n          const {\n            left, width,\n          } = calculateAppointmentLeftAndWidth(\n            nextAppointments, nextBlocks, appointment,\n            finalMaxRight, indirectChildLeftOffset, undefined,\n          );\n          appointment.data.left = left;\n          appointment.data.width = width;\n        }\n      });\n    }\n  });\n  blocks[0].items.forEach((appointmentIndex) => {\n    const appointment = nextAppointments[appointmentIndex];\n    const {\n      left, width,\n    } = calculateAppointmentLeftAndWidth(\n      nextAppointments, blocks, appointment, 1, indirectChildLeftOffset, undefined,\n    );\n    appointment.data.left = left;\n    appointment.data.width = width;\n  });\n  return nextAppointments;\n};\n\nconst redistributeChildBlocks: RedistributeBlocksFn = (blocks, blockIndex, right) => {\n  const block = blocks[blockIndex];\n  const { leftOffset, size, leftLimit, children } = block;\n  block.right = right;\n  const width = size + leftOffset;\n  const relativeWidth = right - leftLimit;\n  const left = right - relativeWidth * size / width;\n  block.left = left;\n  children.forEach((childIndex) => {\n    redistributeChildBlocks(blocks, childIndex, left);\n  });\n};\n\nexport const calculateIncludedBlockMaxRight: CalculateIncludedBlockMaxRightFn = (\n  blocks, includedBlock,\n) => {\n  const { includedInto: includedIntoIndex } = includedBlock;\n  if (includedIntoIndex === undefined) {\n    return 1;\n  }\n\n  const includedInto = blocks[includedIntoIndex];\n  const currentMaxRight = includedInto.right;\n  return currentMaxRight * calculateIncludedBlockMaxRight(blocks, includedInto);\n\n};\n\nexport const calculateBlocksTotalSize: CalculateBlocksTotalSizeFn = (blocks) => {\n  const result = blocks.map((block) => {\n    const totalSize = calculateSingleBlockTotalSize(blocks, block);\n    return {\n      ...block,\n      totalSize,\n      leftOffset: totalSize - block.size,\n    };\n  });\n  return result;\n};\n\nconst calculateSingleBlockTotalSize: CalculateSingleBlockTotalSizeFn = (\n  blocks, block,\n) => {\n  const { children, size } = block;\n  if (children.length === 0) {\n    return size;\n  }\n  return Math.max(\n    ...children.map(childIndex => calculateSingleBlockTotalSize(blocks, blocks[childIndex])),\n  ) + size;\n};\n\nexport const calculateBlocksLeftLimit: CalculateBlocksLeftLimitFn = (\n  blocks, appointments,\n) => (blocks as CalculatedBlock[]).map((block) => {\n  const leftLimit = calculateSingleBlockLeftLimit(blocks, appointments, block);\n  return {\n    ...block,\n    leftLimit,\n  };\n});\n\nconst calculateSingleBlockLeftLimit: CalculateSingleBlockLeftLimitFn = (\n  blocks, appointments, block,\n) => {\n  const { children, items, left } = block as CalculatedBlock;\n  if (children.length === 0) {\n    return left !== undefined\n      ? Math.min(left, appointments[items[0]].data.left)\n      : appointments[items[0]].data.left;\n  }\n  return Math.min(\n    ...children.map(childIndex => calculateSingleBlockLeftLimit(\n      blocks, appointments, blocks[childIndex],\n    )),\n  );\n};\n\nexport const updateBlocksProportions: UpdateBlocksProportionsFn = (blocks) => {\n  const nextBlocks = (blocks as CalculatedBlock[]).map(props => ({ ...props }));\n\n  nextBlocks.forEach((block) => {\n    const { parent: parentIndex, leftLimit, leftOffset, totalSize } = block;\n    if (parentIndex === undefined) {\n      block.right = 1;\n      block.left = (1 - leftLimit) * leftOffset / totalSize + leftLimit;\n      return;\n    }\n\n    const parent = nextBlocks[parentIndex];\n    const { left: parentLeft, totalSize: parentTotalSize } = parent as CalculatedBlock;\n    block.totalSize = parentTotalSize;\n    block.right = parentLeft as number;\n    block.left = (1 - leftLimit) * leftOffset / parentTotalSize + leftLimit;\n  });\n\n  return nextBlocks;\n};\n\nexport const updateBlocksLeft: UpdateBlocksLeftFn = (\n  blocks, appointments,\n) => blocks.map((block) => {\n  const { items, left } = block;\n  const firstItem = appointments[items[0]];\n  const { parent: firstItemParentIndex } = firstItem;\n  if (firstItemParentIndex === undefined) {\n    return block;\n  }\n\n  const firstItemParent = appointments[firstItemParentIndex];\n  const parentBlock = blocks[firstItemParent.blockIndex];\n\n  return {\n    ...block,\n    left: parentBlock.parent === undefined ? left : blocks[parentBlock.parent].left,\n  };\n});\n\nconst createAndAdjustAppointmentForest: CreateAndAdjustAppointmentForestFn = (\n  appointmentGroups, cellDuration,\n) => {\n  const appointmentForest = createAppointmentForest(appointmentGroups, cellDuration);\n  const indirectChildLeftOffset = Math.min(\n    1 / findMaxReduceValue(appointmentForest),\n    INDIRECT_CHILD_LEFT_OFFSET,\n  );\n  const baseCalculated = calculateAppointmentsMetaData(\n    appointmentForest, indirectChildLeftOffset,\n  );\n\n  const preparedToGroupIntoBlocks = prepareToGroupIntoBlocks(baseCalculated);\n  const groupedIntoBlocks = groupAppointmentsIntoBlocks(preparedToGroupIntoBlocks);\n  const blocksWithIncluded = findIncludedBlocks(groupedIntoBlocks);\n  const blocksWithParents = findChildBlocks(blocksWithIncluded);\n  return adjustByBlocks(blocksWithParents, indirectChildLeftOffset);\n};\n\nexport const calculateRectByDateAndGroupIntervals: CalculateRectByDateAndGroupIntervalsFn = (\n  type, intervals, rectByDates, rectByDatesMeta, viewMetaData,\n) => {\n  const { growDirection, multiline } = type;\n  const isHorizontal = growDirection === HORIZONTAL_TYPE;\n\n  const sorted = intervals.map(sortAppointments);\n  const grouped = sorted.reduce(((acc, sortedGroup) => [\n    ...acc,\n    ...findOverlappedAppointments(sortedGroup as AppointmentMoment[], isHorizontal),\n  ]), [] as AppointmentMoment[]);\n\n  const { cellDuration, placeAppointmentsNextToEachOther } = rectByDatesMeta;\n  const rectCalculator = isHorizontal\n    ? horizontalRectCalculator\n    : placeAppointmentsNextToEachOther ? oldVerticalRectCalculator : verticalRectCalculator;\n\n  const groupsCalculated = calculateAppointmentOffsets(\n    grouped as any[], isHorizontal,\n  );\n  const isAppointmentForestNeeded = !isHorizontal && !placeAppointmentsNextToEachOther;\n  let appointmentForest: GroupedIntoBlocksForest[];\n\n  if (isAppointmentForestNeeded) {\n    appointmentForest = createAndAdjustAppointmentForest(\n      groupsCalculated as AppointmentGroup[], cellDuration,\n    ) as GroupedIntoBlocksForest[];\n  }\n\n  const unwrappedAppointments = isAppointmentForestNeeded\n    ? unwrapAppointmentForest(appointmentForest!)\n    : unwrapGroups(groupsCalculated);\n  const rects = unwrappedAppointments.map(appointment => rectCalculator(\n    appointment, viewMetaData,\n    { rectByDates, multiline, rectByDatesMeta },\n  ));\n  return rects.sort((first, second) => first.offset! >= second.offset! ? 1 : -1);\n};\n","import moment from 'moment';\nimport { PureComputed } from '@devexpress/dx-core';\nimport {\n  AppointmentMoment, DayBoundaryPredicateFn,\n  ReduceAppointmentByDayBoundsFn, NormalizeAppointmentDurationFn, ViewCell, SchedulerDateTime,\n} from '../../types';\nimport { checkCellGroupingInfo } from '../common/helpers';\nimport { addDateToKey } from '../../utils';\n\nexport const sliceAppointmentByDay: PureComputed<\n  [AppointmentMoment, number], AppointmentMoment[]\n> = (appointment, cellDuration) => {\n  const { start, end, dataItem, key } = appointment;\n  if (start.isSame(end, 'day')) return [appointment];\n\n  const minDuration = cellDuration / 2;\n  const isShortOnFirstDay = start.clone().endOf('day').diff(start, 'minutes') < minDuration;\n  const isShortOnSecondDay = end.clone().diff(end.clone().startOf('day'), 'minutes') < minDuration;\n  const firstAppointmentKey = addDateToKey(key, start);\n  const secondAppointmentKey = addDateToKey(key, end);\n\n  return [\n    isShortOnFirstDay ? {\n      start: start.clone().endOf('day').add(-minDuration, 'minutes'),\n      end: start.clone().endOf('day'),\n      dataItem,\n      key: firstAppointmentKey,\n    } : {\n      start, end: start.clone().endOf('day'), dataItem,\n      key: firstAppointmentKey,\n    },\n    isShortOnSecondDay ? {\n      start: end.clone().startOf('day'),\n      end: end.clone().startOf('day').add(minDuration, 'minutes'),\n      dataItem,\n      key: secondAppointmentKey,\n    } : {\n      start: end.clone().startOf('day'), end, dataItem,\n      key: secondAppointmentKey,\n    },\n  ];\n};\n\nexport const dayBoundaryPredicate: DayBoundaryPredicateFn = (\n  appointment,\n  leftBound, rightBound,\n  excludedDays = [],\n) => {\n  const dayStart = moment(leftBound as Date);\n  const dayEnd = moment(rightBound as Date);\n  const startDayTime = moment(appointment.start)\n    .hour(dayStart.hour())\n    .minutes(dayStart.minutes());\n  const endDayTime = moment(appointment.start)\n    .hour(dayEnd.hour())\n    .minutes(dayEnd.minutes());\n\n  if (appointment.end.isBefore(dayStart) || appointment.start.isAfter(dayEnd)) return false;\n  if (excludedDays.findIndex(day => day === moment(appointment.start).day()) !== -1) return false;\n  return (appointment.end.isAfter(startDayTime)\n    && appointment.start.isBefore(endDayTime));\n};\n\nexport const reduceAppointmentByDayBounds: ReduceAppointmentByDayBoundsFn = (\n  appointment, leftBound, rightBound, cellDuration,\n) => {\n  const dayStart = moment(leftBound as Date);\n  const dayEnd = moment(rightBound as Date);\n  const startDayTime = moment(appointment.start)\n    .hour(dayStart.hour())\n    .minutes(dayStart.minutes())\n    .seconds(dayStart.seconds());\n  const endDayTime = moment(appointment.start)\n    .hour(dayEnd.hour())\n    .minutes(dayEnd.minutes())\n    .seconds(dayEnd.seconds());\n\n  const minDuration = cellDuration / 2;\n  const isShortOnFirstDay = endDayTime.clone().diff(appointment.start, 'minutes') < minDuration;\n  const isShortOnSecondDay = appointment.end.clone().diff(startDayTime, 'minutes') < minDuration;\n\n  if (isShortOnFirstDay) {\n    return {\n      ...appointment, start: endDayTime.clone().add(-minDuration, 'minutes'), end: endDayTime,\n    };\n  }\n\n  if (isShortOnSecondDay) {\n    return {\n      ...appointment, start: startDayTime, end: startDayTime.clone().add(minDuration, 'minutes'),\n    };\n  }\n\n  return {\n    ...appointment,\n    ...(appointment.start.isSameOrBefore(startDayTime) ? { start: startDayTime } : null),\n    ...(appointment.end.isSameOrAfter(endDayTime) ? { end: endDayTime } : null),\n  };\n};\n\nexport const normalizeAppointmentDuration: NormalizeAppointmentDurationFn = (\n  appointment, cellDuration,\n) => {\n  const minDuration = cellDuration / 2;\n  const start = moment(appointment.start as Date);\n  const end = moment(appointment.end as Date);\n\n  if (end.diff(start, 'minutes') > minDuration) {\n    return { ...appointment, start, end };\n  }\n\n  if (end.isSame(start.clone().add(minDuration, 'minutes'), 'day')) {\n    return { ...appointment, start, end: start.clone().add(minDuration, 'minutes') };\n  }\n\n  return {\n    ...appointment,\n    start: start.clone().endOf('day').add(-minDuration, 'minutes'),\n    end: start.clone().endOf('day'),\n  };\n};\n\nexport const getWeekVerticallyGroupedColumnIndex: PureComputed<\n  [ViewCell[][], SchedulerDateTime], number\n> = (viewCellsData, date) =>  viewCellsData[0].findIndex((\n  timeCell: ViewCell,\n) => moment(date as SchedulerDateTime).isSame(timeCell.startDate, 'date'));\n\nexport const getWeekHorizontallyGroupedColumnIndex: PureComputed<\n  [ViewCell[][], AppointmentMoment, SchedulerDateTime], number\n> = (viewCellsData, appointment, date) => viewCellsData[0].findIndex((timeCell: ViewCell) => {\n  const isCorrectGroup = checkCellGroupingInfo(timeCell, appointment);\n  return moment(date as SchedulerDateTime).isSame(timeCell.startDate, 'date') && isCorrectGroup;\n});\n\nexport const getWeekVerticallyGroupedRowIndex: PureComputed<\n  [ViewCell[][], AppointmentMoment, SchedulerDateTime, number, boolean, number], number\n> = (viewCellsData, appointment, date, columnIndex, takePrev, groupCount) => {\n  const timeTableHeight = viewCellsData.length / groupCount;\n  let timeTableRowIndex = getWeekHorizontallyGroupedRowIndex(\n    viewCellsData, date, columnIndex, takePrev,\n  );\n\n  if (!viewCellsData[0][0].groupingInfo) return timeTableRowIndex;\n\n  let isWrongCell = !checkCellGroupingInfo(\n    viewCellsData[timeTableRowIndex][columnIndex], appointment,\n  );\n  while (isWrongCell) {\n    timeTableRowIndex += timeTableHeight;\n    isWrongCell = !checkCellGroupingInfo(\n      viewCellsData[timeTableRowIndex][columnIndex], appointment,\n    );\n  }\n  return timeTableRowIndex;\n};\n\nexport const getWeekHorizontallyGroupedRowIndex: PureComputed<\n  [ViewCell[][], SchedulerDateTime, number, boolean], number\n> = (viewCellsData, date, columnIndex, takePrev) => viewCellsData.findIndex(\n  timeCell => moment(date as SchedulerDateTime)\n    .isBetween(\n      timeCell[columnIndex].startDate,\n      timeCell[columnIndex].endDate,\n      'seconds',\n      takePrev ? '(]' : '[)'),\n    );\n","import { CalculateWeekDateIntervalsFn, AppointmentMoment } from '../../types';\nimport {\n  sliceAppointmentByDay, dayBoundaryPredicate, reduceAppointmentByDayBounds,\n  normalizeAppointmentDuration,\n} from './helpers';\nimport { filterByViewBoundaries } from '../../utils';\n\nexport const calculateWeekDateIntervals: CalculateWeekDateIntervalsFn = (\n  appointments,\n  leftBound, rightBound, // startViewDate, endViewDate\n  excludedDays,\n  cellDuration,\n) => [\n  appointments\n    .map(appointment => normalizeAppointmentDuration(appointment, cellDuration))\n    .reduce((acc, appointment) =>\n      [...acc, ...filterByViewBoundaries(appointment, leftBound, rightBound, excludedDays, true)],\n      [] as AppointmentMoment[],\n    )\n    .reduce((acc, appointment) => (\n      [...acc, ...sliceAppointmentByDay(appointment, cellDuration)]), [] as AppointmentMoment[],\n    )\n    .filter(appointment => dayBoundaryPredicate(appointment, leftBound, rightBound, excludedDays))\n    .map(appointment => reduceAppointmentByDayBounds(\n      appointment, leftBound, rightBound, cellDuration,\n    )),\n];\n","import moment from 'moment';\nimport {\n  GetCellByAppointmentDataFn, GetVerticalRectByAppointmentDataFn,\n  GetCellRectVerticalFn, SchedulerDateTime,\n} from '../../types';\nimport { VERTICAL_GROUP_ORIENTATION } from '../../constants';\nimport {\n  getWeekHorizontallyGroupedRowIndex, getWeekVerticallyGroupedRowIndex,\n  getWeekHorizontallyGroupedColumnIndex, getWeekVerticallyGroupedColumnIndex,\n} from '../week-view/helpers';\n\nconst CELL_GAP_PX = 10;\nconst CELL_BOUND_HORIZONTAL_OFFSET_PX = 1;\nconst CELL_BOUND_VERTICAL_OFFSET_PX = 4;\n\nexport const getVerticalCellIndexByAppointmentData: GetCellByAppointmentDataFn = (\n  appointment, viewCellsData, viewMetaData, date, takePrev = false,\n) => {\n  const { groupOrientation, groupCount } = viewMetaData;\n\n  const columnIndex = groupOrientation === VERTICAL_GROUP_ORIENTATION\n    ? getWeekVerticallyGroupedColumnIndex(viewCellsData, date)\n    : getWeekHorizontallyGroupedColumnIndex(viewCellsData, appointment, date);\n  const rowIndex = groupOrientation === VERTICAL_GROUP_ORIENTATION\n    ? getWeekVerticallyGroupedRowIndex(\n      viewCellsData, appointment, date, columnIndex, takePrev, groupCount,\n    ) : getWeekHorizontallyGroupedRowIndex(viewCellsData, date, columnIndex, takePrev);\n\n  const cellIndex = (rowIndex * viewCellsData[0].length) + columnIndex;\n  return {\n    index: cellIndex,\n    startDate: viewCellsData[rowIndex][columnIndex].startDate,\n  };\n};\n\nconst getCellRect: GetCellRectVerticalFn = (\n  date, appointment, viewCellsData, cellDuration,\n  cellElementsMeta, takePrev, viewMetaData,\n) => {\n  const {\n    index: cellIndex,\n    startDate: cellStartDate,\n  } = getVerticalCellIndexByAppointmentData(\n    appointment, viewCellsData, viewMetaData, date, takePrev,\n  );\n\n  const {\n    top,\n    left,\n    width,\n    height: cellHeight,\n  } = cellElementsMeta.getCellRects[cellIndex]();\n  const timeOffset = moment(date as SchedulerDateTime).diff(cellStartDate as Date, 'minutes');\n  const topOffset = cellHeight * (timeOffset / cellDuration);\n  const parentRect = cellElementsMeta.parentRect();\n\n  return {\n    top,\n    left,\n    width,\n    topOffset,\n    parentRect,\n  };\n};\n\nexport const getVerticalRectByAppointmentData: GetVerticalRectByAppointmentDataFn = (\n  appointment,\n  viewMetaData,\n  {\n    viewCellsData,\n    cellDuration,\n    cellElementsMeta,\n    placeAppointmentsNextToEachOther,\n  },\n) => {\n  const firstCellRect = getCellRect(\n    appointment.start.toDate(), appointment, viewCellsData,\n    cellDuration, cellElementsMeta, false, viewMetaData,\n  );\n  const lastCellRect = getCellRect(\n    appointment.end.toDate(), appointment, viewCellsData,\n    cellDuration, cellElementsMeta, true, viewMetaData,\n  );\n\n  const top = firstCellRect.top + firstCellRect.topOffset;\n  const height = (lastCellRect.top + lastCellRect.topOffset) - top;\n\n  return {\n    width: firstCellRect.width - CELL_GAP_PX - CELL_BOUND_HORIZONTAL_OFFSET_PX,\n    top: top - firstCellRect.parentRect.top + CELL_BOUND_HORIZONTAL_OFFSET_PX,\n    left: firstCellRect.left - firstCellRect.parentRect.left + CELL_BOUND_HORIZONTAL_OFFSET_PX,\n    parentWidth: firstCellRect.parentRect.width,\n    height: placeAppointmentsNextToEachOther ? height - CELL_BOUND_VERTICAL_OFFSET_PX : height,\n  };\n};\n","import moment from 'moment';\nimport { PureComputed } from '@devexpress/dx-core';\nimport {\n  AppointmentMoment, GetAllDayCellIndexByAppointmentDataFn,\n  SliceAppointmentsByBoundariesFn, SchedulerDateTime, ViewCell,\n} from '../../types';\nimport { HORIZONTAL_GROUP_ORIENTATION } from '../../constants';\nimport { checkCellGroupingInfo } from '../common/helpers';\n\nexport const allDayPredicate: PureComputed<[AppointmentMoment], boolean> = appointment => (\n  appointment.end.diff(appointment.start, 'hours') > 23\n  || !!appointment.allDay\n);\n\nexport const getAllDayCellIndexByAppointmentData: GetAllDayCellIndexByAppointmentDataFn = (\n  viewCellsData, viewMetaData, date, appointment, takePrev,\n) => {\n  const currentDate = moment(date as SchedulerDateTime);\n  const { groupOrientation, groupCount } = viewMetaData;\n\n  const columnIndex = groupOrientation === HORIZONTAL_GROUP_ORIENTATION\n    ? getAllDayHorizontallyGroupedColumnIndex(viewCellsData, currentDate, appointment)\n    : getAllDayVerticallyGroupedColumnIndex(viewCellsData, currentDate);\n  const rowIndex = groupOrientation === HORIZONTAL_GROUP_ORIENTATION\n    ? 0 : getAllDayVerticallyGroupedRowIndex(viewCellsData, appointment, groupCount);\n\n  let cellIndex = rowIndex * viewCellsData[0].length + columnIndex;\n  if (takePrev && currentDate.format() === currentDate.startOf('day').format()) {\n    cellIndex -= 1;\n  }\n  return cellIndex;\n};\n\nexport const getAllDayVerticallyGroupedColumnIndex: PureComputed<\n  [ViewCell[][], moment.Moment], number\n> = (viewCellsData, date) => viewCellsData[0].findIndex((timeCell) => {\n  return date.isSame(timeCell.startDate, 'date');\n});\n\nexport const getAllDayHorizontallyGroupedColumnIndex: PureComputed<\n  [ViewCell[][], moment.Moment, AppointmentMoment], number\n> = (viewCellsData, date, appointment) => viewCellsData[0].findIndex(timeCell => (\n  date.isSame(timeCell.startDate, 'date') && checkCellGroupingInfo(timeCell, appointment)\n));\n\nexport const getAllDayVerticallyGroupedRowIndex: PureComputed<\n  [ViewCell[][], AppointmentMoment, number], number\n> = (viewCellsData, appointment, groupCount) => {\n  const index = viewCellsData.findIndex(viewCellsDataRow => checkCellGroupingInfo(\n    viewCellsDataRow[0], appointment,\n  ));\n  return index * groupCount / viewCellsData.length;\n};\n\nexport const sliceAppointmentsByBoundaries: SliceAppointmentsByBoundariesFn = (\n  appointment, left, right, excludedDays = [],\n) => {\n  const startDate = appointment.start.clone();\n  const endDate = appointment.end.clone();\n  let nextStart = startDate.clone();\n  let nextEnd = endDate.clone();\n\n  if (startDate.isBefore(left as Date)) {\n    nextStart = moment(left as Date);\n    nextStart.startOf('day');\n  }\n  if (endDate.isAfter(right as Date)) {\n    nextEnd = moment(right as Date);\n    nextEnd.endOf('day');\n  }\n  if (excludedDays.findIndex(day => day === startDate.day()) !== -1) {\n    while (excludedDays.findIndex(day => day === nextStart.day()) !== -1\n      && nextStart.isSameOrBefore(endDate, 'day')) {\n      nextStart.add(1, 'days').startOf('day');\n    }\n  }\n  if (excludedDays.findIndex(day => day === endDate.day()) !== -1) {\n    while (excludedDays.findIndex(day => day === nextEnd.day()) !== -1\n      && nextStart.isSameOrAfter(startDate, 'day')) {\n      nextEnd.add(-1, 'days').endOf('day');\n    }\n  }\n  return [{ ...appointment, start: nextStart, end: nextEnd }];\n};\n\nexport const sliceAppointmentsByDays: PureComputed<\n  [AppointmentMoment, number[]], AppointmentMoment[]\n> = (appointment, excludedDays = []) => {\n  const startDate = appointment.start;\n  const endDate = appointment.end;\n  let nextStart = startDate.clone();\n  const appointments = [] as AppointmentMoment[];\n\n  while (nextStart.isBefore(endDate)) {\n    if (excludedDays.findIndex(day => day === nextStart.day()) === - 1) {\n      appointments.push({\n        ...appointment,\n        start: nextStart,\n        end: moment(nextStart).endOf('day'),\n      });\n    }\n    nextStart = moment(nextStart).add(1, 'day');\n  }\n  return appointments;\n};\n","import { RRule } from 'rrule';\n\nexport const DEFAULT_RULE_OBJECT = {\n  interval: 1,\n};\n\nexport const DAYS_OF_WEEK = {\n  MONDAY: 0,\n  TUESDAY: 1,\n  WEDNESDAY: 2,\n  THURSDAY: 3,\n  FRIDAY: 4,\n  SATURDAY: 5,\n  SUNDAY: 6,\n};\n\nexport const RRULE_DAYS_OF_WEEK = [\n  RRule.MO,\n  RRule.TU,\n  RRule.WE,\n  RRule.TH,\n  RRule.FR,\n  RRule.SA,\n  RRule.SU,\n];\n\nexport const DAYS_IN_WEEK = 7;\n\nexport const DAYS_OF_WEEK_ARRAY = [\n  DAYS_OF_WEEK.SUNDAY, DAYS_OF_WEEK.MONDAY, DAYS_OF_WEEK.TUESDAY, DAYS_OF_WEEK.WEDNESDAY,\n  DAYS_OF_WEEK.THURSDAY, DAYS_OF_WEEK.FRIDAY, DAYS_OF_WEEK.SATURDAY,\n];\n\nexport const MONTHS = {\n  JANUARY: 1,\n  FEBRUARY: 2,\n  MARCH: 3,\n  APRIL: 4,\n  MAY: 5,\n  JUNE: 6,\n  JULY: 7,\n  AUGUST: 8,\n  SEPTEMBER: 9,\n  OCTOBER: 10,\n  NOVEMBER: 11,\n  DECEMBER: 12,\n};\n\nexport const RRULE_REPEAT_TYPES = {\n  YEARLY: RRule.YEARLY as number,\n  MONTHLY: RRule.MONTHLY as number,\n  WEEKLY: RRule.WEEKLY as number,\n  DAILY: RRule.DAILY as number,\n  HOURLY: RRule.HOURLY as number,\n  MINUTELY: RRule.MINUTELY as number,\n};\n\nexport const REPEAT_TYPES = {\n  DAILY: 'daily',\n  WEEKLY: 'weekly',\n  MONTHLY: 'monthly',\n  YEARLY: 'yearly',\n  NEVER: 'never',\n};\n\nexport const REPEAT_TYPES_ARRAY = [\n  REPEAT_TYPES.DAILY, REPEAT_TYPES.WEEKLY, REPEAT_TYPES.MONTHLY, REPEAT_TYPES.YEARLY,\n];\n\nexport const WEEK_NUMBER_LABELS = [\n  'firstLabel', 'secondLabel', 'thirdLabel', 'fourthLabel', 'lastLabel',\n];\n\nexport const END_REPEAT_RADIO_GROUP = 'endRepeat';\nexport const MONTHLY_RADIO_GROUP = 'monthlyRadioGroup';\nexport const YEARLY_RADIO_GROUP = 'yearlyRadioGroup';\n\nexport const TITLE_TEXT_EDITOR = 'titleTextEditor';\nexport const MULTILINE_TEXT_EDITOR = 'multilineTextEditor';\nexport const ORDINARY_TEXT_EDITOR = 'ordinaryTextEditor';\nexport const NUMBER_EDITOR = 'numberEditor';\n\nexport const TITLE = 'title';\nexport const ORDINARY_LABEL = 'ordinaryLabel';\n\nexport const SAVE_BUTTON = 'saveButton';\nexport const DELETE_BUTTON = 'deleteButton';\nexport const CANCEL_BUTTON = 'cancelButton';\n\nexport const OUTLINED_SELECT = 'outlinedSelect';\nexport const STANDARD_SELECT = 'standardSelect';\n\nexport const SUNDAY_DATE = new Date(2019, 7, 11);\nexport const MONDAY_DATE = new Date(2019, 7, 12);\nexport const TUESDAY_DATE = new Date(2019, 7, 13);\nexport const WEDNESDAY_DATE = new Date(2019, 7, 14);\nexport const THURSDAY_DATE = new Date(2019, 7, 15);\nexport const FRIDAY_DATE = new Date(2019, 7, 16);\nexport const SATURDAY_DATE = new Date(2019, 7, 17);\n\nexport const DAYS_OF_WEEK_DATES = [\n  SUNDAY_DATE, MONDAY_DATE, TUESDAY_DATE, WEDNESDAY_DATE,\n  THURSDAY_DATE, FRIDAY_DATE, SATURDAY_DATE,\n];\n\nexport const JANUARY_DATE = new Date(2019, 0, 1);\nexport const FEBRUARY_DATE = new Date(2019, 1, 1);\nexport const MARCH_DATE = new Date(2019, 2, 1);\nexport const APRIL_DATE = new Date(2019, 3, 1);\nexport const MAY_DATE = new Date(2019, 4, 1);\nexport const JUNE_DATE = new Date(2019, 5, 1);\nexport const JULY_DATE = new Date(2019, 6, 1);\nexport const AUGUST_DATE = new Date(2019, 7, 1);\nexport const SEPTEMBER_DATE = new Date(2019, 8, 1);\nexport const OCTOBER_DATE = new Date(2019, 9, 1);\nexport const NOVEMBER_DATE = new Date(2019, 10, 1);\nexport const DECEMBER_DATE = new Date(2019, 11, 1);\n\nexport const MONTHS_DATES = [\n  JANUARY_DATE, FEBRUARY_DATE, MARCH_DATE, APRIL_DATE, MAY_DATE, JUNE_DATE,\n  JULY_DATE, AUGUST_DATE, SEPTEMBER_DATE, OCTOBER_DATE, NOVEMBER_DATE, DECEMBER_DATE,\n];\n\nexport const FIRST_WEEK = 0;\nexport const SECOND_WEEK = 1;\nexport const THIRD_WEEK = 2;\nexport const FOURTH_WEEK = 3;\nexport const LAST_WEEK = 4;\n\nexport const BASIC_YEALY_COUNT = 5;\nexport const BASIC_MONTHLY_COUNT = 12;\nexport const BASIC_WEEKLY_COUNT = 13;\nexport const BASIC_DAILY_COUNT = 30;\n","import moment from 'moment';\nimport {\n  SliceAppointmentByWeekFn, GetMonthCellIndexByAppointmentDataFn,\n  SchedulerDateTime, AppointmentMoment, ViewCell,\n} from '../../types';\nimport { DAYS_IN_WEEK } from '../appointment-form/constants';\nimport { PureComputed } from '@devexpress/dx-core';\nimport { HORIZONTAL_GROUP_ORIENTATION } from '../../constants';\nimport { checkCellGroupingInfo } from '../common/helpers';\nimport { addDateToKey } from '../../utils';\n\nexport const sliceAppointmentByWeek: SliceAppointmentByWeekFn = (timeBounds, appointment, step) => {\n  const { left, right } = timeBounds;\n  const pieces: AppointmentMoment[] = [];\n  const { start, end, key, ...restFields } = appointment;\n  let apptStart = start;\n  let apptEnd = end;\n  if (apptStart.isBefore(left)) apptStart = left.clone();\n  if (apptEnd.isAfter(right)) apptEnd = right.clone();\n  let pieceFrom = apptStart.clone();\n  let pieceTo = apptStart.clone();\n  let i = 0;\n  while (pieceTo.isBefore(apptEnd)) {\n    const currentRightBound = left.clone().add(step * i, 'days').subtract(1, 'second');\n    if (currentRightBound.isAfter(apptStart)) {\n      pieceTo = apptStart.clone().add(step * i, 'days');\n      if (pieceTo.isAfter(currentRightBound)) {\n        pieceTo = currentRightBound.clone();\n      }\n      if (pieceTo.isAfter(apptEnd)) {\n        pieceTo = apptEnd.clone();\n      }\n      if (!pieceFrom.isSameOrAfter(pieceTo)) {\n        pieces.push({\n          start: pieceFrom,\n          end: pieceTo,\n          key: addDateToKey(key, pieceFrom),\n          ...restFields,\n        });\n        pieceFrom = pieceTo.clone().add(1, 'second');\n      }\n    }\n    i += 1;\n  }\n  return pieces;\n};\n\nexport const getMonthCellIndexByAppointmentData: GetMonthCellIndexByAppointmentDataFn = (\n  viewCellsData, viewMetaData, date, appointment, takePrev = false,\n) => {\n  const {\n    groupOrientation,\n    groupedByDate,\n    groupCount,\n  } = viewMetaData;\n\n  const startViewDate = moment(viewCellsData[0][0].startDate);\n  const currentDate = moment(date as SchedulerDateTime);\n  let dayNumber = currentDate.diff(startViewDate, 'days');\n  if (takePrev && currentDate.format() === currentDate.startOf('day').format()) {\n    dayNumber -= 1;\n  }\n  const weekNumber = Math.floor(dayNumber / DAYS_IN_WEEK);\n  const dayOfWeek = dayNumber % DAYS_IN_WEEK;\n\n  const columnIndex = groupOrientation === HORIZONTAL_GROUP_ORIENTATION\n    ? getMonthHorizontallyGroupedColumnIndex(\n      viewCellsData, appointment, weekNumber, dayOfWeek, groupCount, groupedByDate,\n    )\n    : dayOfWeek;\n  const rowIndex = groupOrientation === HORIZONTAL_GROUP_ORIENTATION\n    ? weekNumber\n    : getMonthVerticallyGroupedRowIndex(\n      viewCellsData, appointment, weekNumber, dayOfWeek, groupCount,\n    );\n\n  const totalCellIndex = rowIndex * viewCellsData[0].length + columnIndex;\n  return totalCellIndex;\n};\n\nexport const getMonthHorizontallyGroupedColumnIndex: PureComputed<\n  [ViewCell[][], AppointmentMoment, number, number, number, boolean], number\n> = (viewCellsData, appointment, weekNumber, dayOfWeek, groupCount, groupByDate) => {\n  let columnIndex = -1;\n  let currentColumnIndex = groupByDate ? dayOfWeek * groupCount : dayOfWeek;\n  const cellsInGroupRow = groupByDate ? 1 : DAYS_IN_WEEK;\n\n  while (columnIndex === -1) {\n    const isCorrectCell = checkCellGroupingInfo(\n      viewCellsData[weekNumber][currentColumnIndex], appointment,\n    );\n    if (isCorrectCell) {\n      columnIndex = currentColumnIndex;\n    }\n    currentColumnIndex += cellsInGroupRow;\n  }\n  return columnIndex;\n};\n\nexport const getMonthVerticallyGroupedRowIndex: PureComputed<\n  [ViewCell[][], AppointmentMoment, number, number, number], number\n> = (viewCellsData, appointment, weekNumber, dayOfWeek, groupCount) => {\n  const rowsInOneGroup = viewCellsData.length / groupCount;\n  let rowIndex = -1;\n  let currentRowIndex = weekNumber;\n  while (rowIndex === -1) {\n    const isCorrectCell = checkCellGroupingInfo(\n      viewCellsData[currentRowIndex][dayOfWeek], appointment,\n    );\n    if (isCorrectCell) {\n      rowIndex = currentRowIndex;\n    }\n    currentRowIndex += rowsInOneGroup;\n  }\n  return rowIndex;\n};\n","import { GetCellRectHorizontalFn, GetHorizontalRectByAppointmentDataFn } from '../../types';\nimport { getAllDayCellIndexByAppointmentData } from '../all-day-panel/helpers';\nimport { getMonthCellIndexByAppointmentData } from '../month-view/helpers';\n\nconst TOP_CELL_OFFSET = 0.32;\nconst CELL_BOUND_OFFSET_PX = 1;\n\nconst getCellRect: GetCellRectHorizontalFn = (\n  date, appointment, viewCellsData, viewMetaData, cellElementsMeta, takePrev, multiline,\n) => {\n  const cellIndex = multiline\n    ? getMonthCellIndexByAppointmentData(\n      viewCellsData, viewMetaData, date, appointment, takePrev,\n    ) : getAllDayCellIndexByAppointmentData(\n      viewCellsData, viewMetaData, date, appointment, takePrev,\n    );\n\n  const {\n    top,\n    left,\n    width,\n    height,\n  } = cellElementsMeta.getCellRects[cellIndex]();\n  const parentRect = cellElementsMeta.parentRect();\n  return {\n    top,\n    left,\n    width,\n    height,\n    parentRect,\n  };\n};\n\nexport const getHorizontalRectByAppointmentData: GetHorizontalRectByAppointmentDataFn = (\n  appointment,\n  viewMetaData,\n  {\n    multiline,\n    viewCellsData,\n    cellElementsMeta,\n  },\n) => {\n  const firstCellRect = getCellRect(\n    appointment.start.toDate(), appointment, viewCellsData,\n    viewMetaData, cellElementsMeta, false, multiline,\n  );\n  const lastCellRect = getCellRect(\n    appointment.end.toDate(), appointment, viewCellsData,\n    viewMetaData, cellElementsMeta, true, multiline,\n  );\n\n  const top = firstCellRect.top + (firstCellRect.height * TOP_CELL_OFFSET);\n  const height = firstCellRect.height - (firstCellRect.height * TOP_CELL_OFFSET);\n\n  return {\n    top: top - firstCellRect.parentRect.top,\n    left: (firstCellRect.left - firstCellRect.parentRect.left) + CELL_BOUND_OFFSET_PX,\n    width: ((lastCellRect.left - firstCellRect.left) + firstCellRect.width) - CELL_BOUND_OFFSET_PX,\n    height,\n    parentWidth: firstCellRect.parentRect.width,\n  };\n};\n","import moment from 'moment';\nimport {\n  MonthCellsDataComputedFn, MonthCellData,\n  CalculateMonthDateIntervalsFn, AppointmentMoment,\n} from '../../types';\nimport { filterByViewBoundaries } from '../../utils';\nimport { sliceAppointmentByWeek } from './helpers';\n\nconst DAY_COUNT = 7;\nconst MONTH_LENGTH = 31;\n\nexport const monthCellsData: MonthCellsDataComputedFn = (\n  currentDate,\n  firstDayOfWeek,\n  intervalCount = 1,\n  today,\n) => {\n  const targetDate = moment(currentDate as Date);\n  const currentMonths = [targetDate.month()];\n  while (currentMonths.length < intervalCount) {\n    currentMonths.push(targetDate.add(1, 'months').month());\n  }\n  const firstMonthDate = moment(currentDate as Date).date(1);\n  const firstMonthDay = firstMonthDate.day() - firstDayOfWeek;\n  const prevMonthDayCount = firstMonthDate.day(firstMonthDay).day() || DAY_COUNT;\n  const prevMonth = moment(currentDate as Date).subtract(1, 'months');\n  const prevMonthStartDay = prevMonth.daysInMonth() - (prevMonthDayCount - 1);\n  const from = moment()\n    .year(prevMonth.year())\n    .month(prevMonth.month())\n    .date(prevMonthStartDay)\n    .startOf('day');\n\n  const result: MonthCellData[][] = [];\n  while (result.length < (Math.trunc((MONTH_LENGTH * intervalCount) / DAY_COUNT) + 2)) {\n    const week: MonthCellData[] = [];\n    while (week.length < DAY_COUNT) {\n      week.push({\n        startDate: from.toDate(),\n        endDate: from.clone().add(1, 'day').toDate(),\n        otherMonth: currentMonths.findIndex(month => month === from.month()) === -1,\n        today: today ? moment(today as Date).isSame(from, 'date') : false,\n      });\n      from.add(1, 'day');\n    }\n    result.push(week);\n  }\n  return result;\n};\n\nexport const calculateMonthDateIntervals: CalculateMonthDateIntervalsFn = (\n  appointments, leftBound, rightBound,\n) => [\n  appointments\n    .map(({ start, end, ...restArgs }) => ({ start: moment(start), end: moment(end), ...restArgs }))\n    .reduce((acc, appointment) =>\n      [...acc, ...filterByViewBoundaries(appointment, leftBound, rightBound, [], false)],\n      [] as AppointmentMoment[],\n    )\n    .reduce((acc, appointment) => ([\n      ...acc,\n      ...sliceAppointmentByWeek(\n        { left: moment(leftBound as Date), right: moment(rightBound as Date) },\n        appointment,\n        DAY_COUNT,\n      ),\n    ]), [] as AppointmentMoment[]),\n];\n","import moment from 'moment';\nimport {\n  AppointmentMoment, CalculateAllDayDateIntervalsFn,\n} from '../../types';\nimport { allDayPredicate, sliceAppointmentsByBoundaries } from './helpers';\nimport { filterByViewBoundaries } from '../../utils';\n\nexport const calculateAllDayDateIntervals: CalculateAllDayDateIntervalsFn = (\n  appointments,\n  leftBound, rightBound,\n  excludedDays,\n) => [\n  appointments\n    .map(({ start, end, ...restArgs }) => ({ start: moment(start), end: moment(end), ...restArgs }))\n    .reduce((acc, appointment) =>\n      [...acc, ...filterByViewBoundaries(appointment, leftBound, rightBound, excludedDays, false)],\n      [] as AppointmentMoment[],\n    )\n    .filter(appointment => allDayPredicate(appointment))\n    .reduce((acc, appointment) => ([\n      ...acc,\n      ...sliceAppointmentsByBoundaries(appointment, leftBound, rightBound, excludedDays),\n    ]), [] as AppointmentMoment[]),\n];\n","import { PureComputed } from '@devexpress/dx-core';\nimport {\n  ValidResourceInstance, Group, ViewCell, ValidResource,\n  AppointmentMoment, Grouping, GroupOrientation, AppointmentKey,\n} from '../../types';\nimport { HORIZONTAL_GROUP_ORIENTATION } from '../../constants';\n\nexport const getGroupFromResourceInstance: PureComputed<\n  [ValidResourceInstance], Group\n> = resourceInstance => ({\n  id: resourceInstance.id,\n  fieldName: resourceInstance.fieldName,\n  text: resourceInstance.text,\n});\n\nexport const addGroupInfoToCells: PureComputed<\n  [Group, Group[][], ValidResource[],\n  ViewCell[], number, boolean, GroupOrientation], ViewCell[]\n> = (\n  currentGroup, groups, sortedResources, viewCellRow, index, endOfGroup, groupOrientation,\n) => viewCellRow.map((\n    viewCell: ViewCell, cellIndex: number,\n  ) => {\n  const groupedCell = addGroupInfoToCell(\n    currentGroup, groups, sortedResources, viewCell, index, endOfGroup, groupOrientation,\n  ) as ViewCell;\n  return cellIndex === viewCellRow.length - 1 && groupOrientation === HORIZONTAL_GROUP_ORIENTATION\n    ? { ...groupedCell, endOfGroup: true }\n    : groupedCell;\n});\n\nexport const addGroupInfoToCell: PureComputed<\n  [Group, Group[][], ValidResource[],\n  ViewCell, number, boolean, GroupOrientation], ViewCell\n> = (currentGroup, groups, sortedResources, viewCell, index, endOfGroup, groupOrientation) => {\n  let previousIndex = index;\n  const groupingInfo = groups.reduceRight((\n    acc: Group[], group: Group[], currentIndex: number,\n  ) => {\n    if (currentIndex === groups.length - 1) return acc;\n    const previousResourceLength = sortedResources[currentIndex + 1].instances.length;\n    const currentGroupingInstance = group[Math.floor(\n      previousIndex / previousResourceLength,\n    )];\n    previousIndex = currentIndex;\n    return [...acc, currentGroupingInstance];\n  }, [currentGroup]);\n  return { ...viewCell, groupingInfo, endOfGroup, groupOrientation };\n};\n\nconst getCurrentGroup: PureComputed<\n  [Group[][], ValidResource[], number, Group], Group[]\n> = (groups, resources, index, group) => {\n  let currentIndex = index;\n  return groups.reduceRight((groupAcc, groupsRow, rowIndex) => {\n    if (rowIndex === groups!.length - 1) {\n      return groupAcc;\n    }\n    currentIndex = Math.floor(currentIndex / resources[rowIndex + 1].instances.length);\n    const currentInstance = groupsRow[currentIndex];\n    return [\n      ...groupAcc,\n      currentInstance,\n    ];\n  }, [group]);\n};\n\nexport const groupAppointments: PureComputed<\n  [AppointmentMoment[], ValidResource[] | undefined,\n  Group[][] | undefined], AppointmentMoment[][]\n> = (appointments, resources, groups) => {\n  if (!resources || !groups) return [appointments.slice()];\n  const mainResource = resources.find(resource => resource.isMain);\n  return groups![groups!.length - 1].map((group, index) => {\n    const currentGroup = getCurrentGroup(groups, resources, index, group);\n\n    return appointments.reduce((acc, appointment) => {\n      const belongsToGroup = currentGroup.reduce((isBelonging, groupItem) => (\n        isBelonging && groupItem.id === appointment[groupItem.fieldName]\n      ), true);\n      if (!belongsToGroup) return acc;\n      const currentMainResourceId = currentGroup.find(\n        groupItem => groupItem.fieldName === mainResource!.fieldName,\n      )!.id;\n\n      const updatedAppointment = {\n        ...appointment,\n        dataItem: {\n          ...appointment.dataItem,\n          [mainResource!.fieldName]: rearrangeResourceIds(\n            mainResource!, appointment, currentMainResourceId,\n          ),\n        },\n        resources: appointment.resources && rearrangeResources(\n          mainResource!, appointment, currentMainResourceId,\n        ),\n      };\n      return [...acc, updatedAppointment];\n    }, [] as AppointmentMoment[]);\n  });\n};\n\nconst rearrangeResourceIds: PureComputed<\n  [ValidResource, AppointmentMoment, any], any[] | any\n> = (mainResource, appointment, mainResourceId) => {\n  if (!mainResource.allowMultiple) {\n    return mainResourceId;\n  }\n  return [\n    mainResourceId,\n    ...appointment.dataItem[mainResource!.fieldName].filter((id: any) => id !== mainResourceId),\n  ];\n};\n\nexport const rearrangeResources: PureComputed<\n  [ValidResource, AppointmentMoment, any], ValidResourceInstance[]\n> = (mainResource, appointment, currentResourceInstanceId) => {\n  if (!mainResource.allowMultiple) {\n    return appointment.resources;\n  }\n  const resources = appointment.resources.slice();\n  const firstMainResource = resources.findIndex((el: ValidResourceInstance) => el.isMain);\n  const currentResourceIndex = resources.findIndex(\n    (el: ValidResourceInstance) => el.isMain && el.id === currentResourceInstanceId,\n  );\n  [resources[firstMainResource], resources[currentResourceIndex]] =\n    [resources[currentResourceIndex], resources[firstMainResource]];\n  return resources;\n};\n\nexport const expandGroupedAppointment: PureComputed<\n  [AppointmentMoment, Grouping[], ValidResource[]], AppointmentMoment[]\n> = (appointment, grouping, resources) => {\n  if (!resources || !grouping) {\n    return [appointment];\n  }\n  return resources\n    .reduce((acc: AppointmentMoment[], resource: ValidResource) => {\n      const isGroupedByResource = grouping.find(\n        group => group.resourceName === resource.fieldName,\n      ) !== undefined;\n      if (!isGroupedByResource) return acc;\n      const resourceField = resource.fieldName;\n      if (!resource.allowMultiple) {\n        return acc.reduce((accumulatedAppointments, currentAppointment) => [\n          ...accumulatedAppointments,\n          { ...currentAppointment, [resourceField]: currentAppointment.dataItem[resourceField] },\n        ], [] as AppointmentMoment[]);\n      }\n      return acc.reduce((accumulatedAppointments, currentAppointment) => [\n        ...accumulatedAppointments,\n        ...currentAppointment.dataItem[resourceField].map(\n          (resourceValue: number | string) => ({\n            ...currentAppointment,\n            [resourceField]: resourceValue,\n            key: generateMultipleResourceKey(currentAppointment.key, resourceValue),\n          }),\n        ),\n      ], [] as AppointmentMoment[]);\n    }, [appointment] as AppointmentMoment[]);\n};\n\nconst generateMultipleResourceKey: PureComputed<\n  [AppointmentKey, number | string], AppointmentKey\n> = (previousKey, resourceValue) => `${previousKey}_${resourceValue}`;\n\nexport const getGroupingInfoFromGroups: PureComputed<\n  [Group[][], number], Group[]\n> = (groups, groupIndex) => {\n  let previousIndex = groupIndex;\n  return groups.reduceRight((acc, currentGroups, currentIndex) => {\n    if (currentIndex === groups.length - 1) return acc;\n    const previousResourceLength = groups[currentIndex + 1].length / currentGroups.length;\n    const currentGroupingInstance = currentGroups[Math.floor(\n      previousIndex / previousResourceLength,\n    )];\n    previousIndex = currentIndex;\n    return [...acc, currentGroupingInstance];\n  }, [getGroupsLastRow(groups)[groupIndex]]);\n};\n\nexport const getGroupsLastRow: PureComputed<\n  [Group[][]], Group[]\n> = groups => groups[groups.length - 1];\n","import { PureComputed } from '@devexpress/dx-core';\nimport {\n  Grouping, ValidResourceInstance, ViewCell, ValidResource,\n  Group, AppointmentMoment, ExpandGroupingPanelCellFn, GroupOrientation,\n  CellElementsMeta, SchedulerView,\n} from '../../types';\nimport {\n  getGroupFromResourceInstance, addGroupInfoToCells,\n  groupAppointments, expandGroupedAppointment, addGroupInfoToCell, getGroupsLastRow,\n} from './helpers';\nimport { sliceAppointmentsByDays } from '../all-day-panel/helpers';\nimport { HORIZONTAL_GROUP_ORIENTATION, VERTICAL_GROUP_ORIENTATION } from '../../constants';\nimport { containsDSTChange } from '../common/helpers';\n\nexport const filterResourcesByGrouping: PureComputed<\n  [Array<ValidResource>, Array<Grouping>], Array<ValidResource>\n> = (resources, grouping) => resources.filter(\n  resource => grouping.find(resourceId => resource.fieldName === resourceId.resourceName),\n);\n\nexport const sortFilteredResources: PureComputed<\n  [Array<ValidResource>, Array<Grouping>], Array<ValidResource>\n> = (resources, grouping) => grouping.map(({ resourceName }: Grouping) => (\n  resources.find(resource => resource.fieldName === resourceName) as ValidResource\n));\n\nexport const getGroupsFromResources: PureComputed<\n  [Array<ValidResource>], Array<Array<Group>>\n> = sortedAndFilteredResources => sortedAndFilteredResources.reduce((\n    acc: Array<Array<Group>>, resource: ValidResource, index: number,\n  ) => {\n  if (index === 0) {\n    return [resource.instances.map(instance => getGroupFromResourceInstance(instance))];\n  }\n\n  return [\n    ...acc,\n    acc[index - 1].reduce((currentResourceNames: Array<Group>) => [\n      ...currentResourceNames,\n      ...resource.instances.map(\n        (instance: ValidResourceInstance) => getGroupFromResourceInstance(instance),\n      ),\n    ], []),\n  ];\n}, []);\n\nexport const expandViewCellsDataWithGroups: PureComputed<\n  [ViewCell[][], Group[][], ValidResource[], boolean, GroupOrientation], ViewCell[][]\n> = (viewCellsData, groups, sortedResources, groupByDate, groupOrientation) => {\n  if (groups.length === 0) return viewCellsData;\n  if (groupByDate) {\n    return expandCellsWithGroupedByDateData(viewCellsData, groups, sortedResources);\n  }\n  if (groupOrientation === HORIZONTAL_GROUP_ORIENTATION) {\n    return expandHorizontallyGroupedCells(viewCellsData, groups, sortedResources);\n  }\n  return expandVerticallyGroupedCells(viewCellsData, groups, sortedResources);\n};\n\nconst expandCellsWithGroupedByDateData: ExpandGroupingPanelCellFn = (\n  viewCellsData, groups, sortedResources,\n) => viewCellsData.map(\n  (cellsRow: ViewCell[]) => cellsRow.reduce((acc: ViewCell[], viewCell: ViewCell) => {\n    const groupedCells = getGroupsLastRow(groups).map((\n      group: Group, index: number,\n    ) => addGroupInfoToCell(\n      group, groups, sortedResources, viewCell, index,\n      false, HORIZONTAL_GROUP_ORIENTATION,\n    ));\n    groupedCells[groupedCells.length - 1] = {\n      ...groupedCells[groupedCells.length - 1],\n      endOfGroup: true,\n    };\n    return [...acc, ...groupedCells] as ViewCell[];\n  }, [] as ViewCell[]),\n);\n\nconst expandHorizontallyGroupedCells: ExpandGroupingPanelCellFn = (\n  viewCellsData, groups, sortedResources,\n) => getGroupsLastRow(groups).reduce((\n  acc: ViewCell[][], group: Group, index: number,\n) => {\n  if (index === 0) {\n    return viewCellsData.map((viewCellsRow: ViewCell[]) =>\n      addGroupInfoToCells(\n        group, groups, sortedResources, viewCellsRow, index,\n        false, HORIZONTAL_GROUP_ORIENTATION,\n      ) as ViewCell[],\n    );\n  }\n  return acc.map((item: ViewCell[], id: number) => [\n    ...item,\n    ...addGroupInfoToCells(\n      group, groups, sortedResources, viewCellsData[id], index,\n      false, HORIZONTAL_GROUP_ORIENTATION,\n    ),\n  ]);\n}, [[]] as ViewCell[][]);\n\nconst expandVerticallyGroupedCells: ExpandGroupingPanelCellFn = (\n  viewCellsData, groups, sortedResources,\n) => getGroupsLastRow(groups).reduce((\n  acc: ViewCell[][], group: Group, index: number,\n) => {\n  if (index === 0) {\n    return viewCellsData.map((\n      viewCellsRow: ViewCell[], viewRowIndex: number,\n    ) => addGroupInfoToCells(\n        group, groups, sortedResources, viewCellsRow,\n        index, viewRowIndex === viewCellsData.length - 1, VERTICAL_GROUP_ORIENTATION,\n      ) as ViewCell[]);\n  }\n  return [\n    ...acc,\n    ...viewCellsData.map((viewCellsRow: ViewCell[], viewRowIndex: number) =>\n      addGroupInfoToCells(\n        group, groups, sortedResources, viewCellsRow,\n        index, viewRowIndex === viewCellsData.length - 1, VERTICAL_GROUP_ORIENTATION,\n      ) as ViewCell[],\n    ),\n  ];\n}, [[]] as ViewCell[][]);\n\nexport const updateGroupingWithMainResource: PureComputed<\n  [Grouping[] | undefined, ValidResource[]], Grouping[]\n> = (grouping, resources) => grouping\n  || [{ resourceName: resources.find(resource => resource.isMain)!.fieldName }];\n\nexport const expandGroups: PureComputed<\n  [AppointmentMoment[][], Grouping[], ValidResource[],\n  Group[][], number[], boolean], AppointmentMoment[][]\n> = (appointments, grouping, resources, groups, excludedDays, sliceByDay = false) => {\n  const slicedAppointments = sliceByDay ?\n    appointments[0].reduce((acc: AppointmentMoment[], appointment: AppointmentMoment) => ([\n      ...acc,\n      ...sliceAppointmentsByDays(appointment, excludedDays),\n    ]), [] as AppointmentMoment[]) : appointments[0];\n\n  const expandedAppointments = (slicedAppointments as AppointmentMoment[])\n    .reduce((acc: AppointmentMoment[], appointment: AppointmentMoment) => [\n      ...acc,\n      ...expandGroupedAppointment(appointment, grouping, resources),\n    ], [] as AppointmentMoment[]);\n  return groupAppointments(expandedAppointments, resources, groups);\n};\n\nexport const updateTimeTableCellElementsMeta: PureComputed<\n  [CellElementsMeta, (viewName: string) => GroupOrientation, Group[][],\n  boolean, ViewCell[][], SchedulerView], CellElementsMeta\n> = (\n  timeTableElementsMeta, groupOrientation, groups, allDayPanelExists, viewCellsData, currentView,\n) => {\n  if (checkCellElementsMeta(\n    timeTableElementsMeta, groupOrientation, currentView, allDayPanelExists,\n  )) {\n    return timeTableElementsMeta;\n  }\n\n  const {\n    groupCount, timeTableWidth, groupSize, validGetCellRects,\n  } = initializeCellElementsData(timeTableElementsMeta, viewCellsData, groups);\n  let allDayPanelsLeft = groupCount;\n\n  while (allDayPanelsLeft > 0) {\n    allDayPanelsLeft -= 1;\n    validGetCellRects.splice(allDayPanelsLeft * (timeTableWidth + groupSize), timeTableWidth);\n  }\n\n  return {\n    parentRect: timeTableElementsMeta.parentRect,\n    getCellRects: validGetCellRects,\n  };\n};\n\nexport const updateAllDayCellElementsMeta: PureComputed<\n  [CellElementsMeta, CellElementsMeta, (viewName: string) => GroupOrientation, Group[][],\n  boolean, ViewCell[][], SchedulerView], CellElementsMeta\n> = (\n  allDayElementsMeta, timeTableElementsMeta, groupOrientation, groups,\n  allDayPanelExists, viewCellsData, currentView,\n) => {\n  if (checkCellElementsMeta(\n    timeTableElementsMeta, groupOrientation, currentView, allDayPanelExists,\n  )) {\n    return allDayElementsMeta;\n  }\n\n  const {\n    groupCount, timeTableWidth, groupSize, validGetCellRects,\n  } = initializeCellElementsData(timeTableElementsMeta, viewCellsData, groups);\n  let allDayPanelsLeft = groupCount;\n\n  while (allDayPanelsLeft > 0) {\n    allDayPanelsLeft -= 1;\n    validGetCellRects.splice(\n      groupSize * allDayPanelsLeft + timeTableWidth * (allDayPanelsLeft + 1), groupSize,\n    );\n  }\n\n  return {\n    parentRect: timeTableElementsMeta.parentRect,\n    getCellRects: validGetCellRects,\n  };\n};\n\nconst checkCellElementsMeta: PureComputed<\n  [CellElementsMeta, (viewName: string) => GroupOrientation, SchedulerView, boolean], boolean\n> = (\n  cellElementsMeta, groupOrientation, currentView, allDayPanelExists,\n) => groupOrientation(currentView.name) === HORIZONTAL_GROUP_ORIENTATION\n  || !allDayPanelExists || !cellElementsMeta.getCellRects;\n\nconst initializeCellElementsData: PureComputed<\n  [CellElementsMeta, ViewCell[][], Group[][]], any\n> = (cellElementsMeta, viewCellsData, groups) => {\n  const timeTableWidth = viewCellsData[0].length;\n  const groupCount = getGroupsLastRow(groups).length;\n  const groupHeight = viewCellsData.length / groupCount;\n  return {\n    groupCount,\n    timeTableWidth,\n    groupSize: timeTableWidth * groupHeight,\n    validGetCellRects: cellElementsMeta.getCellRects.slice(),\n  };\n};\n\nexport const updateTimeCellsData: PureComputed<\n  [ViewCell[][], ViewCell[][], Group[][], ValidResource[], GroupOrientation], ViewCell[][]\n> = (viewCellsData, timeCellsData, groups, sortedResources, groupOrientation) => {\n  const { startDate: firstViewDate } = viewCellsData[0][0];\n  if (!containsDSTChange(firstViewDate)) {\n    return viewCellsData;\n  }\n\n  if (groupOrientation !== VERTICAL_GROUP_ORIENTATION) {\n    return timeCellsData;\n  }\n\n  return expandVerticallyGroupedCells(timeCellsData, groups, sortedResources);\n};\n","import {\n  AllDayRects, VerticalRects, HorizontalRects,\n} from '../../types';\nimport {\n  VERTICAL_TYPE, HORIZONTAL_TYPE,\n} from '../../constants';\nimport { calculateRectByDateAndGroupIntervals } from '../appointments/helpers';\nimport { calculateWeekDateIntervals } from '../week-view/computeds';\nimport { getVerticalRectByAppointmentData } from '../vertical-rect/helpers';\nimport { getHorizontalRectByAppointmentData } from '../horizontal-rect/helpers';\nimport { calculateMonthDateIntervals } from '../month-view/computeds';\nimport { calculateAllDayDateIntervals } from '../all-day-panel/computeds';\nimport { expandGroups } from '../integrated-grouping/computeds';\nimport { getGroupsLastRow } from '../integrated-grouping/helpers';\n\nexport const allDayRects: AllDayRects = (\n  appointments, startViewDate, endViewDate,\n  excludedDays, viewCellsData, cellElementsMeta,\n  grouping, resources, groups, groupOrientation, sliceAppointments,\n) => {\n  const intervals = calculateAllDayDateIntervals(\n    appointments, startViewDate, endViewDate, excludedDays,\n  );\n  const groupedIntervals = expandGroups(\n    intervals, grouping, resources, groups, excludedDays, sliceAppointments,\n  );\n\n  return calculateRectByDateAndGroupIntervals(\n    {\n      growDirection: HORIZONTAL_TYPE,\n      multiline: false,\n    },\n    groupedIntervals,\n    getHorizontalRectByAppointmentData,\n    {\n      startViewDate,\n      endViewDate,\n      viewCellsData,\n      cellElementsMeta,\n      excludedDays,\n    },\n    {\n      groupOrientation,\n      groupedByDate: sliceAppointments,\n      groupCount: groups ? getGroupsLastRow(groups).length : 1,\n    },\n  );\n};\n\nexport const verticalTimeTableRects: VerticalRects = (\n  appointments, startViewDate, endViewDate, excludedDays, viewCellsData,\n  cellDuration, cellElementsMeta, grouping, resources, groups,  groupOrientation, groupByDate,\n) => {\n  const intervals = calculateWeekDateIntervals(\n    appointments, startViewDate, endViewDate, excludedDays, cellDuration,\n  );\n  const groupedIntervals = expandGroups(\n    intervals, grouping, resources, groups, excludedDays, false,\n  );\n\n  return calculateRectByDateAndGroupIntervals(\n    {\n      growDirection: VERTICAL_TYPE,\n      multiline: false,\n    },\n    groupedIntervals,\n    getVerticalRectByAppointmentData,\n    {\n      startViewDate,\n      endViewDate,\n      viewCellsData,\n      cellDuration,\n      cellElementsMeta,\n    },\n    {\n      groupOrientation,\n      groupedByDate: groupByDate,\n      groupCount: groups ? getGroupsLastRow(groups).length : 1,\n    },\n  );\n};\n\nexport const horizontalTimeTableRects: HorizontalRects = (\n  appointments, startViewDate, endViewDate, viewCellsData,\n  cellElementsMeta, grouping, resources, groups, groupOrientation, sliceAppointments,\n) => {\n  const intervals = calculateMonthDateIntervals(\n    appointments, startViewDate, endViewDate,\n  );\n  const groupedIntervals = expandGroups(\n    intervals, grouping, resources, groups, [], sliceAppointments,\n  );\n\n  return calculateRectByDateAndGroupIntervals(\n    {\n      growDirection: HORIZONTAL_TYPE,\n      multiline: true,\n    },\n    groupedIntervals,\n    getHorizontalRectByAppointmentData,\n    {\n      startViewDate,\n      endViewDate,\n      viewCellsData,\n      cellElementsMeta,\n    },\n    {\n      groupOrientation,\n      groupedByDate: sliceAppointments,\n      groupCount: groups ? getGroupsLastRow(groups).length : 1,\n    },\n  );\n};\n","import { DateTimeFormatInstanceFn } from '../../types';\n\nexport const dateTimeFormatInstance: DateTimeFormatInstanceFn = (\n  locale, formatOptions,\n) => new Intl.DateTimeFormat(locale, formatOptions);\n","import { PureComputed } from '@devexpress/dx-core';\nimport { AppointmentModel, Appointment, FormatDateTimeGetterFn, FormatterFn } from '../../types';\nimport { convertToMoment } from '../common/helpers';\nimport { dateTimeFormatInstance } from './helpers';\n\nexport const appointments: PureComputed<\n  [AppointmentModel[]], Appointment[]\n> = data => data.map((appointment, index) => ({\n  dataItem: appointment,\n  start: appointment.startDate,\n  ...appointment.endDate !== undefined ? {\n    end: appointment.endDate,\n  } : {\n    end: appointment.startDate,\n    dataItem: { ...appointment, endDate: appointment.startDate },\n  },\n  ...appointment.allDay !== undefined && {\n    allDay: appointment.allDay,\n  },\n  ...appointment.rRule !== undefined && {\n    rRule: appointment.rRule,\n  },\n  ...appointment.exDate !== undefined && {\n    exDate: appointment.exDate,\n  },\n  key: appointment.id || index,\n}));\n\nexport const formatDateTimeGetter: FormatDateTimeGetterFn = (locale) => {\n  const cache = new Map<Intl.DateTimeFormatOptions, Intl.DateTimeFormat>(); // any -> type\n\n  const formatter: FormatterFn = (nextDate, nextOptions) => {\n    if (nextDate === undefined) return '';\n    const date = convertToMoment(nextDate).toDate();\n    let formatInstance = cache.get(nextOptions);\n\n    if (!formatInstance) {\n      formatInstance = dateTimeFormatInstance(locale, nextOptions);\n      cache.set(nextOptions, formatInstance);\n    }\n\n    return formatInstance.format(date);\n  };\n  return formatter;\n};\n","import { PureComputed } from '@devexpress/dx-core';\nimport { Group, HorizontalGroupingCellData, VerticalGroupingCellData } from '../../types';\nimport { getGroupsLastRow } from '../integrated-grouping/helpers';\n\nexport const getCellKey: PureComputed<\n  [Group[][], number, number], string\n> = (groups, groupIndex, rowNumber) => {\n  let currentIndex = groupIndex;\n  return groups.reduceRight((acc: string, groupRow: Group[], rowIndex: number) => {\n    if (rowNumber < rowIndex) return acc;\n    const currentKey = groupRow[currentIndex].id;\n    if (rowIndex > 0) {\n      const currentRowLength = groups[rowIndex].length / groups[rowIndex - 1].length;\n      currentIndex = Math.floor(currentIndex / currentRowLength);\n    }\n    return acc + currentKey;\n  }, '' as string);\n};\n\nexport const getRowFromGroups: PureComputed<\n  [number, Group[], any, Group[][], number], HorizontalGroupingCellData[]\n> = (width, groupRow, cellStyle, groups, rowIndex) => {\n  let row = [] as any[];\n  const currentRowLength = groupRow.length;\n  const standardWidth = width / getGroupsLastRow(groups).length;\n  const colSpan = getGroupsLastRow(groups).length / currentRowLength;\n  for (let i = 0; i < standardWidth; i += 1) {\n    row = [...row, ...groupRow.reduce((acc, group, index) => [\n      ...acc,\n      {\n        group,\n        colSpan,\n        key: getCellKey(groups, index, rowIndex) + i,\n        left: cellStyle.left,\n        endOfGroup: index === currentRowLength - 1,\n      },\n    ], [] as any[])];\n  }\n  return row;\n};\n\nexport const getVerticalRowFromGroups: PureComputed<\n  [Group[][], number, number, number, boolean, number], VerticalGroupingCellData[]\n> = (\n  groups, groupIndex, groupingPanelRowSpan,\n  timeTableCellHeight, addAllDayHeight, allDayCellHeight,\n) => groups.reduce((\n  acc, groupColumn, columnIndex,\n) => {\n  const groupSpan = getGroupsLastRow(groups).length / groupColumn.length;\n  const cellIndex = groupIndex / groupSpan;\n  const baseHeight = (groupingPanelRowSpan * groupSpan * timeTableCellHeight)\n    / getGroupsLastRow(groups).length;\n  const allDayHeight = groupSpan * allDayCellHeight;\n\n  return groupIndex % groupSpan !== 0 ? acc : [\n    ...acc,\n    {\n      group: groupColumn[cellIndex],\n      rowSpan: groupSpan,\n      height: addAllDayHeight ? baseHeight + allDayHeight : baseHeight,\n      key: getCellKey(groups, cellIndex, columnIndex),\n    },\n  ];\n}, [] as VerticalGroupingCellData[]);\n","import { PureComputed } from '@devexpress/dx-core';\nimport { HORIZONTAL_GROUP_ORIENTATION } from '../../constants';\nimport { ViewCell, Group, GroupOrientation, TimeScaleLabelData, AllDayCell } from '../../types';\nimport { getCellKey } from '../grouping-panel/utils';\nimport { getGroupsLastRow } from '../integrated-grouping/helpers';\n\nconst getLabelsForSingleGroup: PureComputed<\n  [Group[][], ViewCell[][], number, number], TimeScaleLabelData[]\n> = (groups, cellsData, groupIndex, groupHeight) => {\n  const currentGroupIndex = groupIndex * groupHeight;\n  const nextGroupIndex = currentGroupIndex + groupHeight;\n\n  return cellsData.slice(currentGroupIndex, nextGroupIndex - 1).reduce((\n    acc: TimeScaleLabelData[], days: ViewCell[],\n  ) => (([\n    ...acc,\n    {\n      startDate: days[0].startDate,\n      endDate: days[0].endDate,\n      key: days[0].endDate + getCellKey(groups, groupIndex, groups.length - 1),\n      groupingInfo: days[0].groupingInfo,\n    },\n  ])), [] as TimeScaleLabelData[]);\n};\n\nexport const getLabelsForAllGroups: PureComputed<\n  [ViewCell[][], Group[][], GroupOrientation], TimeScaleLabelData[][]\n> = (cellsData, groups, groupOrientation) => {\n  if (groupOrientation === HORIZONTAL_GROUP_ORIENTATION) {\n    return [cellsData.map(cellsRow => ({\n      startDate: cellsRow[0].startDate,\n      endDate: cellsRow[0].endDate,\n      groupingInfo: cellsRow[0].groupingInfo,\n      key: cellsRow[0].endDate,\n    }))];\n  }\n\n  const groupCount = getGroupsLastRow(groups).length;\n  const singleGroupHeight = cellsData.length / groupCount;\n\n  return getGroupsLastRow(groups).reduce((\n    acc: TimeScaleLabelData[][], group: Group, groupIndex: number,\n  ) => [\n    ...acc,\n    getLabelsForSingleGroup(\n      groups, cellsData, groupIndex, singleGroupHeight,\n    ) as TimeScaleLabelData[],\n  ], [] as TimeScaleLabelData[][]);\n};\n\nexport const prepareVerticalViewCellsData: PureComputed<\n  [ViewCell[][], AllDayCell[][]], ViewCell[][][]\n> = (cellsData, allDayCellsData) => {\n  const groupCount = allDayCellsData?.length || 1;\n  const validCellsData = [] as ViewCell[][][];\n  const groupHeight = cellsData.length / groupCount;\n  for (let i = 0; i < groupCount; i += 1) {\n    validCellsData.push(cellsData.slice(i * groupHeight, (i + 1) * groupHeight));\n  }\n  return validCellsData;\n};\n","import moment from 'moment';\nimport { PureReducer } from '@devexpress/dx-core';\nimport { ChangeCurrentDatePayload } from '../../types';\n\nexport const changeCurrentDate: PureReducer<Date, ChangeCurrentDatePayload> = (\n  currentDate, {\n  nextDate, step, amount, direction,\n}) => (\n  nextDate\n  || moment(currentDate as Date)[direction === 'back' ? 'subtract' : 'add'](amount, step)\n    .toDate()\n  || moment().subtract(amount, step)\n);\n\nexport const setCurrentViewName: PureReducer<\n  string, string, string\n> = (currentViewName, nextViewName) => nextViewName;\n","import { PureReducer } from '@devexpress/dx-core';\nimport { AppointmentMeta } from '../../types';\n\nexport const setAppointmentMeta: PureReducer<AppointmentMeta, AppointmentMeta> = (\n  prevAppointmentMeta,\n  { target, data },\n) => ({ target, data });\n","export const OPEN_COMMAND_BUTTON = 'open';\nexport const CLOSE_COMMAND_BUTTON = 'close';\nexport const DELETE_COMMAND_BUTTON = 'delete';\nexport const CANCEL_COMMAND_BUTTON = 'cancel';\nexport const COMMIT_COMMAND_BUTTON = 'commit';\n","import { PureReducer } from '@devexpress/dx-core';\nimport { AppointmentModel, AppointmentDataPayload } from '../../types';\n\nexport const setAppointmentData: PureReducer<\n  AppointmentModel, AppointmentDataPayload\n> = (prevAppointmentData, { appointmentData }) => appointmentData;\n","import {\n  LONG_WEEK_DAY_OPTIONS, DAY_LONG_MONTH_OPTIONS,\n  LONG_MONTH_OPTIONS,\n} from '@devexpress/dx-scheduler-core';\nimport { PureComputed } from '@devexpress/dx-core';\nimport {\n  SelectOption, OptionsFormatterFn, DateFormatterFn, RecurrenceFrequency,\n} from '../../types';\nimport {\n  MONTHS_DATES, REPEAT_TYPES_ARRAY, WEEK_NUMBER_LABELS, DAYS_IN_WEEK, RRULE_REPEAT_TYPES,\n  BASIC_YEALY_COUNT, BASIC_MONTHLY_COUNT, BASIC_WEEKLY_COUNT, BASIC_DAILY_COUNT,\n} from './constants';\nimport { getDaysOfWeekDates, getDaysOfWeekArray } from './helpers';\n\nexport const getWeekNumberLabels: OptionsFormatterFn = getMessage =>\n  WEEK_NUMBER_LABELS.map((weekNumberLabel, index) => ({\n    text: getMessage(weekNumberLabel),\n    id: index,\n  }));\n\nexport const getDaysOfWeek: PureComputed<\n  [(date: Date, formatOptions: object) => string, number], Array<SelectOption>\n> = (formatDate, firstDayOfWeek) => {\n  const daysOfWeekArray = getDaysOfWeekArray(firstDayOfWeek);\n  const daysOfWeekDates = getDaysOfWeekDates(firstDayOfWeek);\n  return daysOfWeekDates.map(\n    (day, index) => ({\n      text: getDayOfWeek(day, formatDate),\n      id: index + 1 < DAYS_IN_WEEK ? daysOfWeekArray[index + 1] : daysOfWeekArray[0],\n    }),\n  );\n};\n\nexport const getMonths: DateFormatterFn = formatDate => MONTHS_DATES.map((month, index) => ({\n  text: getMonth(month, formatDate),\n  id: getMonthId(index),\n}));\n\nexport const getMonthsWithOf: PureComputed<\n  [(messageKey: string) => string, (date: Date, formatOptions: object) => string],\n    Array<SelectOption>\n> = (getMessage, formatDate) => MONTHS_DATES.map((month, index) => ({\n  text: getMonthWithOf(month, getMessage, formatDate),\n  id: getMonthId(index),\n}));\n\nconst getMonthWithOf = (\n  date: Date,\n  getMessage: (messageKey: string) => string,\n  formatDate: (date: Date, formatOptions: object) => string,\n) => getMessage('ofLabel')\n  + formatDate(date, DAY_LONG_MONTH_OPTIONS).replace(/[\\d.,]/g, '').toString();\n\nconst getMonth = (\n  date: Date,\n  formatDate: (date: Date, formatOptions: object) => string,\n) => formatDate(date, LONG_MONTH_OPTIONS);\n\nconst getDayOfWeek = (\n  date: Date,\n  formatDate: (date: Date, formatOptions: object) => string,\n) => formatDate(date, LONG_WEEK_DAY_OPTIONS);\n\nconst getMonthId: PureComputed<\n  [number], number\n> = index => index + 1;\n\nexport const getAvailableRecurrenceOptions: OptionsFormatterFn = getMessage =>\n  REPEAT_TYPES_ARRAY.map(type => ({\n    text: getMessage(type),\n    id: type,\n  }));\n\nexport const getCountDependingOnRecurrenceType = (frequency: RecurrenceFrequency) => {\n  let count;\n  switch (frequency) {\n    case RRULE_REPEAT_TYPES.YEARLY:\n      count = BASIC_YEALY_COUNT;\n      break;\n    case RRULE_REPEAT_TYPES.MONTHLY:\n      count = BASIC_MONTHLY_COUNT;\n      break;\n    case RRULE_REPEAT_TYPES.WEEKLY:\n      count = BASIC_WEEKLY_COUNT;\n      break;\n    case RRULE_REPEAT_TYPES.DAILY:\n      count = BASIC_DAILY_COUNT;\n      break;\n  }\n  return count;\n};\n\nexport const checkIsNaturalNumber: PureComputed<\n  [number], boolean\n> = number => number > 0 && number <= Number.MAX_SAFE_INTEGER;\n","import moment from 'moment';\nimport { PureComputed } from '@devexpress/dx-core';\nimport { RRule, Options, Weekday } from 'rrule';\nimport {\n  Action,\n  StartDate,\n  EndDate,\n  RadioGroupDisplayData,\n  ValidResource,\n} from '../../types';\nimport {\n  DEFAULT_RULE_OBJECT, RRULE_REPEAT_TYPES, REPEAT_TYPES, LAST_WEEK,\n  DAYS_OF_WEEK_ARRAY, DAYS_IN_WEEK, DAYS_OF_WEEK_DATES, RRULE_DAYS_OF_WEEK,\n} from './constants';\nimport { getCountDependingOnRecurrenceType } from './utils';\n\nexport const callActionIfExists: PureComputed<[Action, object], void> = (action, payload) => {\n  if (action) {\n    action(payload);\n  }\n};\n\nexport const isAllDayCell: PureComputed<\n  [StartDate, EndDate], boolean\n> = (\n  startDate, endDate,\n) => moment(endDate as EndDate).diff(moment(startDate as StartDate), 'days') >= 1;\n\nexport const changeRecurrenceFrequency: PureComputed<\n  [string, number, Date], string\n> = (\n  rule, freq, startDate,\n) => {\n  if (!rule) {\n    if (freq === RRULE_REPEAT_TYPES.MONTHLY) {\n      return (new RRule({\n        ...DEFAULT_RULE_OBJECT,\n        freq,\n        bymonthday: [startDate.getDate()],\n        count: getCountDependingOnRecurrenceType(freq),\n      })).toString();\n    }\n    if (freq === RRULE_REPEAT_TYPES.YEARLY) {\n      return (new RRule({\n        ...DEFAULT_RULE_OBJECT,\n        freq,\n        bymonthday: [startDate.getDate()],\n        bymonth: startDate.getMonth() + 1,\n        count: getCountDependingOnRecurrenceType(freq),\n      })).toString();\n    }\n    return (new RRule({\n      ...DEFAULT_RULE_OBJECT, freq, count: getCountDependingOnRecurrenceType(freq),\n    })).toString();\n  }\n\n  const options = RRule.parseString(rule);\n  if (options.freq === freq) return rule;\n\n  options.freq = freq;\n  options.count = getCountDependingOnRecurrenceType(freq);\n  if (freq === RRULE_REPEAT_TYPES.MONTHLY || freq === RRULE_REPEAT_TYPES.YEARLY) {\n    options.bymonthday = startDate.getDate();\n  }\n  if (freq === RRULE_REPEAT_TYPES.YEARLY) {\n    options.bymonth = startDate.getMonth() + 1;\n  }\n  if (freq === RRULE_REPEAT_TYPES.DAILY || freq === RRULE_REPEAT_TYPES.WEEKLY) {\n    options.bymonthday = undefined;\n  }\n  options.byweekday = undefined;\n  const nextRule = new RRule(options);\n  return nextRule.toString();\n};\n\nexport const getRecurrenceOptions: PureComputed<\n  [string | undefined], Partial<Options> | null\n> = rule => !rule ? null : RRule.parseString(rule);\n\nexport const changeRecurrenceOptions = (options: Partial<Options>) => {\n  return options ? (new RRule({ ...options })).toString() : undefined;\n};\n\nexport const handleStartDateChange = (nextStartDay: number, options: Partial<Options>) => {\n  if (nextStartDay <= 31) {\n    const nextOptions = { ...options, bymonthday: nextStartDay };\n    return changeRecurrenceOptions(nextOptions);\n  }\n  return changeRecurrenceOptions(options);\n};\n\nexport const handleToDayOfWeekChange = (\n  weekNumber: number, dayOfWeek: number, options: Partial<Options>,\n) => {\n  const validDayOfWeek = dayOfWeek > 0 ? dayOfWeek - 1 : 6;\n  const validWeekNumber = weekNumber === 4 ? -1 : weekNumber + 1;\n  const rruleDayOfWeek = RRULE_DAYS_OF_WEEK[validDayOfWeek];\n\n  const nextOptions = {\n    ...options,\n    byweekday: [rruleDayOfWeek.nth(validWeekNumber)],\n    bymonthday: undefined,\n  };\n\n  return changeRecurrenceOptions(nextOptions);\n};\n\nexport const getRRuleFrequency: PureComputed<\n  [string], number\n> = repeatType => RRULE_REPEAT_TYPES[repeatType.toUpperCase()];\n\nexport const getFrequencyString: PureComputed<\n  [number], string\n> = (rRuleFrequency) => {\n  if (rRuleFrequency === RRULE_REPEAT_TYPES.DAILY) return REPEAT_TYPES.DAILY;\n  if (rRuleFrequency === RRULE_REPEAT_TYPES.WEEKLY) return REPEAT_TYPES.WEEKLY;\n  if (rRuleFrequency === RRULE_REPEAT_TYPES.MONTHLY) return REPEAT_TYPES.MONTHLY;\n  if (rRuleFrequency === RRULE_REPEAT_TYPES.YEARLY) return REPEAT_TYPES.YEARLY;\n  return REPEAT_TYPES.NEVER;\n};\n\nexport const getRadioGroupDisplayData: PureComputed<\n  [Partial<Options>, number, number, number, string, string], RadioGroupDisplayData\n> = (\n  recurrenceOptions, stateDayOfWeek, stateWeekNumber, stateDayNumber, firstOption, secondOption,\n) => {\n  if (recurrenceOptions.bymonthday && !Array.isArray(recurrenceOptions.bymonthday)) {\n    return {\n      dayNumberTextField: (recurrenceOptions.bymonthday as number),\n      weekNumber: stateWeekNumber,\n      dayOfWeek: stateDayOfWeek,\n      radioGroupValue: firstOption,\n    };\n  }\n  if (!recurrenceOptions.byweekday) {\n    return {\n      dayOfWeek: stateDayOfWeek,\n      weekNumber: stateWeekNumber,\n      radioGroupValue: secondOption,\n      dayNumberTextField: stateDayNumber,\n    };\n  }\n  const dayOfWeek = recurrenceOptions.byweekday[0].weekday < 6\n    ? recurrenceOptions.byweekday[0].weekday + 1 : 0;\n  const weekNumber = recurrenceOptions.byweekday[0].n === -1\n    ? LAST_WEEK\n    : recurrenceOptions.byweekday[0].n - 1;\n\n  return {\n    dayOfWeek,\n    weekNumber,\n    radioGroupValue: secondOption,\n    dayNumberTextField: stateDayNumber,\n  };\n};\n\nexport const handleChangeFrequency: PureComputed<\n  [string, string, Date, Action], void\n> = (repeatType, rRule, startDate, action) => {\n  const rruleRepeatType = getRRuleFrequency(repeatType);\n  let nextRRule;\n  if (rruleRepeatType !== undefined) {\n    nextRRule = changeRecurrenceFrequency(\n      rRule,\n      rruleRepeatType,\n      startDate,\n    );\n  }\n  action({ rRule: nextRRule });\n};\n\nexport const handleWeekDaysChange: PureComputed<\n[Partial<Options>, number], void\n> = (options, currentWeekDay) => {\n  const byWeekDay = options.byweekday || [];\n  const index = (byWeekDay as Weekday[]).findIndex(({ weekday }) => weekday === currentWeekDay);\n\n  const isAdded = index === -1;\n\n  if (isAdded) {\n    (byWeekDay as Weekday[]).push(RRULE_DAYS_OF_WEEK[currentWeekDay]);\n  } else if (index > -1) {\n    (byWeekDay as Weekday[]).splice(index, 1);\n  }\n  if (byWeekDay === 0) return { ...options, byweekday: undefined };\n  return { ...options, byweekday: byWeekDay };\n};\n\nexport const getDaysOfWeekArray: PureComputed<[number], Array<number>> = (firstDayOfWeek) => {\n  const firstPart = DAYS_OF_WEEK_ARRAY.filter(\n    dayOfWeek => dayOfWeek >= firstDayOfWeek - 1 && dayOfWeek < DAYS_IN_WEEK - 1,\n  );\n  const secondPart = DAYS_OF_WEEK_ARRAY.filter(\n    dayOfWeek => dayOfWeek < firstDayOfWeek - 1 || dayOfWeek >= DAYS_IN_WEEK - 1,\n  );\n  return firstDayOfWeek !== 0 ? [...firstPart, ...secondPart] : [...secondPart, ...firstPart];\n};\n\nexport const getDaysOfWeekDates: PureComputed<[number], Array<Date>> = (firstDayOfWeek) => {\n  const firstPart = DAYS_OF_WEEK_DATES.slice(firstDayOfWeek, DAYS_OF_WEEK_DATES.length);\n  const secondPart = DAYS_OF_WEEK_DATES.slice(0, firstDayOfWeek);\n  return [...firstPart, ...secondPart];\n};\n\nexport const checkMultipleResourceFields: PureComputed<\n  [object, ValidResource[]], object\n> = (resourceFields, resources) => resources.reduce((acc, resource) => {\n  if (!resource.allowMultiple) {\n    return acc;\n  }\n\n  const fieldName = resource.fieldName;\n  const field = resourceFields[fieldName];\n  return {\n    ...acc,\n    [fieldName]: Array.isArray(field) ? field : [field],\n  };\n}, resourceFields);\n","import { PureReducer } from '@devexpress/dx-core';\nimport {\n  AddedAppointmentDataPayload, AppointmentModel, Changes, EditAppointmentPayload,\n} from '../../types';\n\nexport const addAppointment: PureReducer<\n  AppointmentModel, AddedAppointmentDataPayload, AppointmentModel | {}\n> = (\n  addedAppointmentData, { appointmentData } = { appointmentData:  {} },\n) => appointmentData;\n\nexport const cancelAddedAppointment = () => ({});\n\nexport const startEditAppointment: PureReducer<\n  Partial<AppointmentModel>, EditAppointmentPayload\n> = (prevEditingAppointment, appointmentData) => appointmentData;\n\nexport const stopEditAppointment = () => null;\n\nexport const changeAppointment: PureReducer<\nAppointmentModel, Changes\n> = (\n  appointment, { change },\n) => ({ ...appointment, ...change });\n\nexport const cancelChanges = () => ({});\n","import { PureComputed } from '@devexpress/dx-core';\nimport { AppointmentId, AppointmentChanges, Changes } from '../../types';\n\nexport const changedAppointmentById: PureComputed<\n  [Changes, AppointmentId], AppointmentChanges\n> = (changes, appointmentId) => (\n  { [appointmentId]: changes }\n);\n","import moment from 'moment';\nimport { RRule, RRuleSet } from 'rrule';\nimport {\n  AppointmentModel, PreCommitChangesFn, Changes, MakeDateSequenceFn, EditFn, DeleteFn, ChangeFn,\n} from '../../types';\nimport { RECURRENCE_EDIT_SCOPE } from '../../constants';\nimport { getUTCDate, getRRuleSetWithExDates, formatDateToString } from '../../utils';\n\nconst mergeNewChanges = (\n  appointmentData: Partial<AppointmentModel>, changes: Changes,\n) => {\n  const appointment = {\n    ...appointmentData,\n  };\n  delete appointment.id;\n  delete appointment.rRule;\n  delete appointment.exDate;\n  delete appointment.parentData;\n  return { ...appointment, ...changes };\n};\n\nconst reduceExDate = (prevExDate: string, boundDate: Date) => {\n  if (prevExDate.length > 0) {\n    return prevExDate.split(',').reduce((acc: string[], date: string) => {\n      const momentDate = moment.utc(date);\n      if (momentDate.isBefore(boundDate)) {\n        return [...acc, date];\n      }\n      return acc;\n    }, []).join(',');\n  }\n  return undefined;\n};\n\nconst configureExDate = (exDate: string | undefined, date: Date) => {\n  const currentExDate = `${moment.utc(date).format('YYYYMMDDTHHmmss')}Z`;\n  return exDate\n    ? `${exDate},${currentExDate}`\n    : currentExDate;\n};\n\nconst configureDateSequence: MakeDateSequenceFn = (rRule, exDate, prevStartDate, nextStartDate) => {\n  const rruleSet = getRRuleSetWithExDates(exDate);\n\n  const currentOptions = RRule.parseString(rRule as string);\n  const correctedOptions = currentOptions.until\n    ? { ...currentOptions, until: moment(getUTCDate(currentOptions.until)).toDate() }\n    : currentOptions;\n  const prevStartDateUTC = moment(getUTCDate(prevStartDate!)).toDate();\n  rruleSet.rrule(new RRule({\n    ...correctedOptions,\n    dtstart: prevStartDateUTC,\n  }));\n  if (currentOptions.count || currentOptions.until) {\n    return {\n      options: currentOptions,\n      dates: rruleSet.all()\n      // we shouldn't use `new Date(string)` because this function has different results in Safari\n      .map(nextDate => moment(formatDateToString(nextDate)).toDate()),\n    };\n  }\n  const leftBound = prevStartDateUTC;\n  const rightBound = moment(getUTCDate(nextStartDate!)).toDate();\n  return {\n    options: currentOptions,\n    dates: rruleSet.between(leftBound, rightBound, true)\n    .map(nextDate => moment(formatDateToString(nextDate)).toDate()),\n  };\n};\n\nconst configureICalendarRules = (rRule: string | undefined, options: object) => {\n  const rruleSet = new RRuleSet();\n  rruleSet.rrule(new RRule({\n    ...RRule.parseString(rRule as string),\n    ...options,\n  }));\n  return rruleSet.valueOf();\n};\n\nconst changeCurrentAndFollowing: ChangeFn = (appointmentData, changes, changeAllAction) => {\n  const { rRule, startDate, parentData, exDate: prevExDate = '', id } = appointmentData;\n\n  const { initialSequence, currentChildIndex } = getAppointmentSequenceData(\n    parentData.startDate, moment.utc(startDate as Date).toDate(), prevExDate, rRule,\n  );\n\n  if (currentChildIndex === 0) return changeAllAction(appointmentData, changes);\n\n  const changedRules = configureICalendarRules(rRule as string, {\n    dtstart: moment.utc(parentData.startDate).toDate(),\n    until: moment.utc(initialSequence[currentChildIndex - 1]).toDate(),\n    count: null,\n  });\n\n  const nextExDate = reduceExDate(prevExDate, startDate as Date);\n  return {\n    changed: {\n      [id!]: {\n        rRule: changedRules[1].slice(6),\n        ...nextExDate && prevExDate !== nextExDate ? { exDate: nextExDate } : {},\n      },\n    },\n  };\n};\n\nconst getAppointmentSequenceData = (\n  prevStartDate: Date, startDate: Date, exDate: string, rRule: string | undefined,\n) => {\n  const initialSequence = configureDateSequence(rRule, exDate,\n    moment.utc(prevStartDate).toDate(), moment.utc(startDate).toDate(),\n  ).dates;\n  const currentChildIndex = initialSequence\n    .findIndex(date => moment(date).isSame(startDate as Date));\n  return { initialSequence, currentChildIndex };\n};\n\nexport const deleteCurrent: DeleteFn = (appointmentData) => {\n  const { options, dates } = configureDateSequence(\n    appointmentData.rRule, appointmentData.exDate,\n    moment.utc(appointmentData.parentData.startDate).toDate(),\n    moment.utc(appointmentData.startDate).toDate(),\n  );\n\n  if ((options.count || options.until) && dates.length === 1) {\n    return deleteAll(appointmentData);\n  }\n\n  const nextExDate = configureExDate(appointmentData.exDate, appointmentData.startDate as Date);\n  return { changed: { [appointmentData.id!]: { exDate: nextExDate } } };\n};\n\nexport const deleteAll: DeleteFn = (appointmentData) => {\n  return { deleted: appointmentData.id };\n};\n\nexport const deleteCurrentAndFollowing: DeleteFn = appointmentData => changeCurrentAndFollowing(\n  appointmentData, {}, deleteAll,\n);\n\nconst getParentChanges = (\n  appointmentData: Partial<AppointmentModel>, changes: Changes,\n): Partial<AppointmentModel> => {\n  let parentChanges: Changes = {};\n\n  const convert = (\n    date: Date, prevDate: Date, parentDate: Date,\n  ): Date => {\n    const diff = moment.utc(date).diff(prevDate);\n\n    return moment(parentDate).add(diff).toDate();\n  };\n\n  if (changes.startDate) {\n    parentChanges = {\n      ...parentChanges,\n      startDate: convert(\n        changes.startDate as Date,\n        appointmentData.startDate as Date,\n        appointmentData.parentData.startDate as Date,\n      ),\n    };\n  }\n\n  if (changes.endDate) {\n    parentChanges = {\n      ...parentChanges,\n      endDate: convert(\n        changes.endDate as Date,\n        appointmentData.endDate as Date,\n        appointmentData.parentData.endDate as Date,\n      ),\n    };\n  }\n\n  return parentChanges;\n};\n\nexport const editAll: EditFn = (appointmentData, changes) => {\n  const { rRule, id } = appointmentData;\n\n  const initialRule = new RRule(RRule.parseString(rRule as string));\n  if (changes.startDate\n    && moment.utc(changes.startDate as Date).isAfter(initialRule.options.until!)) {\n    return {\n      changed: {\n        [id!]: {\n          ...changes,\n          rRule: 'FREQ=DAILY;COUNT=1',\n          exDate: '',\n        },\n      },\n    };\n  }\n\n  return {\n    changed: {\n      [appointmentData.id!]: {\n        ...changes,\n        ...getParentChanges(appointmentData, changes),\n      },\n    },\n  };\n};\n\nexport const editCurrent: EditFn = (appointmentData, changes) => ({\n  changed: {\n    [appointmentData.id!]: {\n      exDate: configureExDate(appointmentData.exDate, appointmentData.startDate as Date),\n    },\n  },\n  added: mergeNewChanges(appointmentData as Partial<AppointmentModel>, changes as Changes),\n});\n\nexport const editCurrentAndFollowing: EditFn = (appointmentData, changes) => {\n  const { rRule, startDate, exDate: prevExDate = '', parentData } = appointmentData;\n  const initialRule = new RRule(RRule.parseString(rRule as string));\n\n  const { initialSequence, currentChildIndex } = getAppointmentSequenceData(\n    parentData.startDate, moment.utc(startDate as Date).toDate(),  prevExDate, rRule,\n  );\n  if (currentChildIndex === 0) return editAll(appointmentData, changes);\n\n  const addedOptions = initialRule.options.count || initialRule.options.until\n    ? { count: initialSequence.length - currentChildIndex }\n    : {};\n  const addedRules = configureICalendarRules(appointmentData.rRule as string, {\n    dtstart: moment.utc(startDate as Date).toDate(),\n    ...addedOptions,\n  });\n\n  const addedAppointment = moment.utc(changes.startDate as Date).isAfter(initialRule.options.until!)\n    ? { rRule: 'FREQ=DAILY;COUNT=1', exDate: '' } : { rRule: addedRules[1].slice(6) };\n\n  return {\n    changed: changeCurrentAndFollowing(appointmentData, changes, editAll).changed,\n    added: {\n      ...addedAppointment, ...mergeNewChanges(appointmentData, changes),\n    },\n  };\n};\n\nexport const preCommitChanges: PreCommitChangesFn = (\n  changes, appointmentData, editType,\n) => {\n  if (changes === null) {\n    switch (editType) {\n      case RECURRENCE_EDIT_SCOPE.ALL: {\n        return deleteAll(appointmentData);\n      }\n      case RECURRENCE_EDIT_SCOPE.CURRENT: {\n        return deleteCurrent(appointmentData);\n      }\n      case RECURRENCE_EDIT_SCOPE.CURRENT_AND_FOLLOWING: {\n        return deleteCurrentAndFollowing(appointmentData);\n      }\n    }\n  } else {\n    switch (editType) {\n      case RECURRENCE_EDIT_SCOPE.ALL: {\n        return editAll(appointmentData, changes);\n      }\n      case RECURRENCE_EDIT_SCOPE.CURRENT: {\n        return editCurrent(appointmentData, changes);\n      }\n      case RECURRENCE_EDIT_SCOPE.CURRENT_AND_FOLLOWING: {\n        return editCurrentAndFollowing(appointmentData, changes);\n      }\n    }\n  }\n  return {};\n};\n","import moment from 'moment';\nimport { PureComputed } from '@devexpress/dx-core';\nimport {\n  ViewCell, ClientOffset, TimeType, ScrollingStrategy,\n  AllDayCell, CalculateAppointmentTimeBoundaries,\n  TimeBoundariesByDrag, TimeBoundariesByResize, AppointmentModel,\n  CellElementsMeta, Grouping, ValidResource, Group, SchedulerDateTime, GroupOrientation,\n} from '../../types';\nimport {\n  VERTICAL_TYPE, HORIZONTAL_TYPE, SCROLL_OFFSET, MINUTES,\n  SECONDS, RESIZE_TOP, RESIZE_BOTTOM, HOURS,\n} from '../../constants';\nimport {\n  allDayRects, horizontalTimeTableRects, verticalTimeTableRects,\n} from '../common/calculate-rects';\n\nconst clamp: PureComputed<\n  [number, number, number]\n> = (value, min, max) => Math.max(Math.min(value, max), min);\n\nconst calculateInsideOffset: PureComputed<\n  [string, number, number], number\n> = (targetType, insidePart, cellDurationMinutes) => targetType === VERTICAL_TYPE\n  ? insidePart * cellDurationMinutes * 60 / 2 : 0;\n\nexport const cellType: PureComputed<\n  [ViewCell | AllDayCell], string\n> = data => moment(data.startDate as Date)\n  .isSame(data.endDate as Date, 'day') ? VERTICAL_TYPE : HORIZONTAL_TYPE;\n\nexport const intervalDuration: PureComputed<\n  [ViewCell | AllDayCell, TimeType], number\n> = (data, type) => moment(data.endDate as Date).diff(data.startDate as Date, type);\n\nexport const cellIndex: PureComputed<\n  [Array<() => ClientRect>, ClientOffset], number\n> = (getCellRects, clientOffset) => getCellRects.findIndex((getCellRect) => {\n  const { left, top, right, bottom } = getCellRect();\n  const isOver = clientOffset\n      && clamp(clientOffset.x, left, right) === clientOffset.x\n      && clamp(clientOffset.y, top, bottom) === clientOffset.y;\n  return isOver;\n});\n\nexport const cellData: PureComputed<\n  [number, number, ViewCell[][], ViewCell[][]], ViewCell | AllDayCell\n> = (timeTableIndex, allDayIndex, viewCellsData, allDayCellsData) => {\n  const cellsData = allDayIndex !== -1 ? allDayCellsData : viewCellsData;\n  const currentIndex = allDayIndex !== -1 ? allDayIndex : timeTableIndex;\n  const tableWidth = cellsData[0].length;\n\n  const rowIndex = Math.floor(currentIndex / tableWidth);\n  const columnIndex = currentIndex % tableWidth;\n  return cellsData[rowIndex][columnIndex];\n};\n\nexport const autoScroll: PureComputed<\n  [ClientOffset, ScrollingStrategy, number], void\n> = (clientOffset, scrollingStrategy, scrollSpeed) => {\n  scroll(\n    clientOffset.y, scrollingStrategy.topBoundary, scrollingStrategy.bottomBoundary,\n    scrollingStrategy.changeVerticalScroll, scrollSpeed,\n  );\n  scroll(\n    clientOffset.x, scrollingStrategy.leftBoundary, scrollingStrategy.rightBoundary,\n    scrollingStrategy.changeHorizontalScroll, scrollSpeed,\n  );\n};\n\nconst scroll: PureComputed<\n  [number, number, number, (value: number) => void, number], void\n> = (offset, firstBoundary, secondBoundary, changeScroll, scrollSpeed) => {\n  if ((offset < firstBoundary + SCROLL_OFFSET) && (offset > firstBoundary)) {\n    changeScroll(-scrollSpeed);\n  }\n  if (secondBoundary - SCROLL_OFFSET < offset) {\n    changeScroll(+scrollSpeed);\n  }\n};\n\nexport const timeBoundariesByResize: TimeBoundariesByResize = (\n  payload, targetData, targetType, cellDurationMinutes, insidePart,\n) => {\n  if (targetType !== payload.appointmentType) {\n    return { appointmentStartTime: undefined, appointmentEndTime: undefined };\n  }\n\n  let appointmentStartTime;\n  let appointmentEndTime;\n  const sourceType = payload.type;\n\n  if (sourceType === RESIZE_TOP) {\n    const insideTopOffset = calculateInsideOffset(targetType, insidePart, cellDurationMinutes);\n    appointmentStartTime = moment(targetData.startDate as Date)\n      .add(insideTopOffset, SECONDS).toDate();\n    appointmentEndTime = moment(payload.endDate as Date).toDate();\n  }\n  if (sourceType === RESIZE_BOTTOM) {\n    const insideBottomOffset = insidePart === 0 && targetType === VERTICAL_TYPE\n      ? cellDurationMinutes * 60 / 2 : 0;\n    appointmentEndTime = moment(targetData.endDate as Date)\n      .add(-insideBottomOffset, SECONDS).toDate();\n    appointmentStartTime = moment(payload.startDate as Date).toDate();\n  }\n  // keep origin appointment duration if coordinates are wrong\n  if (moment(appointmentEndTime).diff(appointmentStartTime, MINUTES) < 1) {\n    appointmentStartTime = moment(payload.startDate as Date).toDate();\n    appointmentEndTime = moment(payload.endDate as Date).toDate();\n  }\n  return { appointmentStartTime, appointmentEndTime };\n};\n\nexport const timeBoundariesByDrag: TimeBoundariesByDrag = (\n  payload, targetData, targetType,\n  cellDurationMinutes, insidePart, offsetTimeTopBase,\n) => {\n  if (targetType === HORIZONTAL_TYPE\n    && intervalDuration(payload, SECONDS) < intervalDuration(targetData, SECONDS)) {\n    return {\n      appointmentStartTime: targetData.startDate as Date,\n      appointmentEndTime: targetData.endDate as Date,\n      offsetTimeTop: 0,\n    };\n  }\n  let offsetTimeTop;\n  let appointmentStartTime;\n  let appointmentEndTime;\n\n  const insideOffset = calculateInsideOffset(targetType, insidePart, cellDurationMinutes);\n  const start = moment(targetData.startDate as Date).add(insideOffset, SECONDS);\n\n  if (offsetTimeTopBase === null) {\n    offsetTimeTop = moment(targetData.startDate as Date)\n      .diff(payload.startDate as Date, SECONDS) + insideOffset;\n  } else {\n    offsetTimeTop = offsetTimeTopBase;\n  }\n\n  if (payload.type === targetType) {\n    const appointmentDurationSeconds = intervalDuration(payload, SECONDS);\n    appointmentStartTime = moment(start).add((offsetTimeTop) * (-1), SECONDS).toDate();\n    appointmentEndTime = moment(start)\n      .add((appointmentDurationSeconds - offsetTimeTop), SECONDS).toDate();\n  } else {\n    appointmentStartTime = moment(targetData.startDate as Date)\n      .add(insideOffset, SECONDS).toDate();\n    appointmentEndTime = moment(targetData.endDate as Date).add(insideOffset, SECONDS).toDate();\n  }\n\n  return { appointmentStartTime, appointmentEndTime, offsetTimeTop };\n};\n\nexport const calculateAppointmentTimeBoundaries: CalculateAppointmentTimeBoundaries = (\n  payload, targetData, targetType,\n  cellDurationMinutes, insidePart, offsetTimeTopBase,\n) => {\n  const isDragging = (payload.type === VERTICAL_TYPE || payload.type === HORIZONTAL_TYPE);\n\n  return(isDragging\n    ? timeBoundariesByDrag(\n        payload, targetData as AppointmentModel, targetType,\n        cellDurationMinutes, insidePart, offsetTimeTopBase,\n      )\n    : timeBoundariesByResize(\n        payload, targetData as AppointmentModel, targetType, cellDurationMinutes, insidePart,\n      )\n  );\n};\n\nexport const calculateInsidePart: PureComputed<\n  [number, Array<() => ClientRect>, number]\n> = (top, timeTableCellsRects, timeTableIndex) => {\n  if (timeTableIndex !== undefined && timeTableIndex !== -1) {\n    const cellRect = timeTableCellsRects[timeTableIndex]();\n    return top > cellRect.top + cellRect.height / 2 ? 1 : 0;\n  }\n  return 0;\n};\n\nexport const calculateDraftAppointments = (\n  allDayIndex: number, draftAppointments: any, startViewDate: Date,\n  endViewDate: Date, excludedDays: number[], viewCellsData: any,\n  getAllDayCellsElementRects: CellElementsMeta,\n  targetType: string, cellDurationMinutes: number,\n  getTableCellElementRects: CellElementsMeta,\n  grouping: Grouping[], resources: ValidResource[], groups: Group[][],\n  groupOrientation: GroupOrientation, groupedByDate: boolean,\n) => {\n  if (allDayIndex !== -1 || (targetType === VERTICAL_TYPE\n    && getAllDayCellsElementRects.getCellRects.length\n    && intervalDuration(draftAppointments[0].dataItem, HOURS) > 23)) {\n    const allDayDrafts = draftAppointments.map((draftAppt: any) => ({\n      ...draftAppt,\n      allDay: true,\n    }));\n\n    return {\n      allDayDraftAppointments: allDayRects(\n        allDayDrafts, startViewDate, endViewDate,\n        excludedDays, viewCellsData, getAllDayCellsElementRects,\n        grouping, resources, groups, groupOrientation, groupedByDate,\n      ),\n      timeTableDraftAppointments: [],\n    };\n  }\n\n  if (targetType === VERTICAL_TYPE || allDayIndex !== -1) {\n    return {\n      allDayDraftAppointments: [],\n      timeTableDraftAppointments: verticalTimeTableRects(\n        draftAppointments, startViewDate, endViewDate,\n        excludedDays, viewCellsData, cellDurationMinutes, getTableCellElementRects,\n        grouping, resources, groups, groupOrientation, groupedByDate,\n      ),\n    };\n  }\n  return {\n    allDayDraftAppointments: [],\n    timeTableDraftAppointments: horizontalTimeTableRects(\n      draftAppointments, startViewDate, endViewDate,\n      viewCellsData, getTableCellElementRects,\n      grouping, resources, groups, groupOrientation, groupedByDate,\n    ),\n  };\n};\n\nexport const calculateAppointmentGroups: PureComputed<\n  [Array<Group> | undefined, Array<ValidResource>, AppointmentModel], any\n> = (cellGroupingInfo, resources, appointmentData) => {\n  if (!cellGroupingInfo) return {};\n  return cellGroupingInfo.reduce((acc, group: Group) => {\n    const isMultipleResource = resources.find(\n      resource => (resource.fieldName === group.fieldName),\n    )!.allowMultiple;\n    return {\n      ...acc,\n      [group.fieldName]: isMultipleResource\n        ? updateMultipleResourceInfo(group, appointmentData) : group.id,\n    };\n  }, {});\n};\n\nconst updateMultipleResourceInfo: PureComputed<\n  [Group, AppointmentModel], any\n> = (cellResource, appointmentData) => {\n  const appointmentGroupItems = appointmentData[cellResource.fieldName];\n  if (appointmentGroupItems.findIndex((groupItem: any) => groupItem === cellResource.id) !== -1) {\n    return appointmentGroupItems;\n  }\n  return [cellResource.id];\n};\n\nexport const appointmentDragged: PureComputed<\n  [SchedulerDateTime, SchedulerDateTime, SchedulerDateTime, SchedulerDateTime, any, any], boolean\n> = (start, startPrev, end, endPrev, groupingInfo, groupingInfoPrev) => {\n  if (moment(start as Date).isSame(startPrev as Date)\n      && moment(end as Date).isSame(endPrev as Date)\n      && groupingInfoNotChanged(groupingInfo, groupingInfoPrev)) {\n    return false;\n  }\n  return true;\n};\n\nconst groupingInfoNotChanged: PureComputed<\n  [any, any], boolean\n> = (groupingInfo, groupingInfoPrev) => {\n  const fields = Object.getOwnPropertyNames(groupingInfo);\n  return fields.every((field) => {\n    if (Array.isArray(groupingInfo[field]) && Array.isArray(groupingInfoPrev[field])) {\n      return groupingInfo[field].every((item: any, index: number) => (\n        item === groupingInfoPrev[field][index]\n      ));\n    }\n    return groupingInfo[field] === groupingInfoPrev[field];\n  });\n};\n","import { PureComputed } from '@devexpress/dx-core';\nimport moment from 'moment';\nimport {\n  IsCellShadedFn, IsShadedAppointment,\n  GetCurrentTimeIndicatorTopFn,\n} from '../../types';\n\nexport const isMonthCell: PureComputed<\n  [boolean | undefined], boolean\n> = otherMonth => otherMonth !== undefined;\n\nexport const isShadedAppointment: IsShadedAppointment = (\n  { data: appointmentData }, currentTime, shadePreviousAppointments,\n) => {\n  const momentCurrentDate = moment(currentTime);\n  if (appointmentData.allDay) {\n    return momentCurrentDate.isAfter(appointmentData.endDate as Date, 'day')\n    && shadePreviousAppointments;\n  }\n  if (momentCurrentDate.isAfter(appointmentData.endDate as Date)) {\n    return shadePreviousAppointments;\n  }\n  return false;\n};\n\nexport const getCurrentTimeIndicatorTop: GetCurrentTimeIndicatorTopFn = (\n  cellData, currentTime,\n) => {\n  const top = ((currentTime - cellData.startDate.getTime()) * 100)\n  / (cellData.endDate.getTime() - cellData.startDate.getTime());\n  return (top < 0 || top > 100) ? undefined : `${top}%`;\n};\n\nexport const isCellShaded: IsCellShadedFn = (\n  { startDate, endDate, otherMonth }, currentTime, shadePreviousCells,\n) => {\n  const monthCell = isMonthCell(otherMonth);\n  return ((startDate.getTime() < currentTime && !monthCell)\n    || endDate.getTime() < currentTime && monthCell) && shadePreviousCells;\n};\n","import { GetAppointmentResources, ValidResourceInstance, ValidResource } from '../../types';\nimport { PureComputed } from '@devexpress/dx-core';\n\nexport const getAppointmentResources: GetAppointmentResources = (\n  appointment, resources, plainResources,\n) => {\n  if (\n    !resources || resources.length === 0\n    || !plainResources || plainResources.length === 0\n  ) return [];\n\n  return resources.reduce((acc, resource) => {\n    const appointmentResourceId = appointment[resource.fieldName];\n    if (appointmentResourceId === undefined) return acc;\n\n    if (resource.allowMultiple && !Array.isArray(appointmentResourceId)\n    || !resource.allowMultiple && Array.isArray(appointmentResourceId)) {\n      // throw error\n      return acc;\n    }\n\n    if (resource.allowMultiple) {\n      return [\n        ...acc,\n        ...(appointmentResourceId as Array<number | string>)\n        .reduce((prevResources, itemId) => addResourceToAppointmentResources(\n          plainResources, prevResources, resource, itemId,\n        ) as Array<ValidResourceInstance>, [] as Array<ValidResourceInstance>),\n      ];\n    }\n\n    return addResourceToAppointmentResources(\n      plainResources, acc, resource, appointmentResourceId,\n    ) as Array<ValidResourceInstance>;\n  }, [] as Array<ValidResourceInstance>);\n};\n\nconst addResourceToAppointmentResources: PureComputed<\n  [Array<ValidResourceInstance>, Array<ValidResourceInstance>, ValidResource,\n  number | string], Array<ValidResourceInstance>\n> = (plainResources, appointmentResources, resource, resourceId) => {\n  const currentResource = plainResources.find(\n    plainItem => resource.fieldName === plainItem.fieldName && plainItem.id === resourceId,\n  );\n\n  return currentResource ? [\n    ...appointmentResources,\n    currentResource!,\n  ] : appointmentResources;\n};\n","import {\n  ConvertResourcesToPlain, ValidateResources, ValidResourceInstance, AddResourcesToAppointments,\n} from '../../types';\nimport { getAppointmentResources } from './helpers';\n\nexport const convertResourcesToPlain: ConvertResourcesToPlain = (validResources) => {\n  return validResources.reduce((acc, resource) => [\n    ...acc,\n    ...resource.instances.map(item => item),\n  ], [] as Array<ValidResourceInstance>);\n};\n\nexport const validateResources: ValidateResources = (resources, mainResourceName, palette) => {\n  const isMainResourceDefined = !!mainResourceName;\n  let currentPaletteIndex = 0;\n  return resources.map((resource, groupIndex) => {\n    const fieldName = resource.fieldName;\n    const isMain = isMainResourceDefined && mainResourceName === fieldName\n      || groupIndex === 0 && !isMainResourceDefined;\n    const title = resource.title || fieldName;\n    const allowMultiple = !!resource.allowMultiple;\n    return {\n      fieldName,\n      isMain,\n      title,\n      allowMultiple,\n      instances: resource.instances.map((resourceItem) => {\n        const color = resourceItem.color || palette[currentPaletteIndex % palette.length];\n        if (!resourceItem.color) currentPaletteIndex += 1;\n\n        return ({\n          id: resourceItem.id,\n          color,\n          fieldName,\n          text: resourceItem.text || title || fieldName,\n          title,\n          allowMultiple,\n          isMain,\n        });\n      }),\n    };\n  });\n};\n\nexport const addResourcesToAppointments: AddResourcesToAppointments = (\n  appointments, resources, plainResources,\n) => [\n  appointments.map(appointment => ({\n    ...appointment,\n    resources: getAppointmentResources(appointment.dataItem, resources, plainResources),\n  })),\n];\n","import { PureReducer, slice } from '@devexpress/dx-core';\nimport {\n  ResourceGroupingState, ToggleGroupPayload,\n} from '../../types';\n\nexport const toggleExpandedGroups: PureReducer<ResourceGroupingState, ToggleGroupPayload> = (\n  state, { groupKey },\n) => {\n  const expandedGroups = slice(state.expandedGroups);\n  const groupKeyIndex = expandedGroups.indexOf(groupKey);\n\n  if (groupKeyIndex > -1) {\n    expandedGroups.splice(groupKeyIndex, 1);\n  } else {\n    expandedGroups.push(groupKey);\n  }\n\n  return { expandedGroups };\n};\n","import moment, { Moment } from 'moment';\nimport { ViewCell } from '../../types';\nimport { PureComputed } from '@devexpress/dx-core';\n\nexport const getDayScaleCellColSpan: PureComputed<\n  [ViewCell[][]], number\n> = (cellsData) => {\n  const firstDate = cellsData[0][0].startDate;\n  let count = 1;\n  while (cellsData[0][count] && moment(cellsData[0][count].startDate).isSame(firstDate, 'day')) {\n    count += 1;\n  }\n  return count;\n};\n\nexport const getDayScaleCells: PureComputed<\n[ViewCell[][], boolean], ViewCell[]\n> = (cellsData, groupedByDate) => {\n  if (!groupedByDate) {\n    return cellsData[0].map(({\n      startDate, endDate, today, endOfGroup, groupingInfo,\n    }, index) => ({\n      key: index.toString(),\n      startDate, endDate, today, endOfGroup, groupingInfo,\n    }));\n  }\n  let prevDate: Moment;\n  const colSpan = getDayScaleCellColSpan(cellsData);\n  return cellsData[0].reduce((acc, { startDate, endDate, today }, index) => {\n    const currentDate = moment(startDate);\n    if (currentDate.isSame(prevDate)) {\n      return acc;\n    }\n    prevDate = currentDate;\n    return [\n      ...acc, {\n        key: index.toString(),\n        startDate, endDate, today, colSpan,\n        endOfGroup: true,\n      },\n    ];\n  }, [] as ViewCell[]);\n};\n","import { PureComputed } from '@devexpress/dx-core';\nimport { SchedulerDateTime } from '../../types';\nimport moment from 'moment';\n\nexport const navigateByOneMonth: PureComputed<\n  [SchedulerDateTime, boolean], Date\n> = (currentDate, isBackward) => moment(currentDate as SchedulerDateTime)\n  [isBackward ? 'subtract' : 'add'](1, 'month').toDate();\n","import { AppointmentModel, SchedulerDateTime } from './scheduler-core.types';\nimport { PureComputed } from '@devexpress/dx-core';\nimport { RRULE_REPEAT_TYPES } from '../plugins/appointment-form/constants';\n\n/** @internal */\nexport type Action = ([fieldName]?: any) => void;\n/** @internal */\nexport type StartDate = SchedulerDateTime;\n/** @internal */\nexport type EndDate = SchedulerDateTime;\n/** @internal */\nexport type AppointmentDataPayload = {\n  appointmentData: AppointmentModel;\n};\n/** @internal */\nexport type AddedAppointmentDataPayload = {\n  appointmentData: AppointmentModel | {};\n};\n/** @internal */\nexport type RadioGroupDisplayData = {\n  weekNumber: number;\n  dayNumberTextField: number;\n  dayOfWeek: number;\n  radioGroupValue: string;\n};\n/** An option in the Select editor. */\nexport type SelectOption = {\n  /** The option's text. */\n  text: string;\n  /** The option's id. */\n  id: number | string;\n};\n/** @internal */\nexport type OptionsFormatterFn = PureComputed<\n  [(messageKey: string) => string], Array<SelectOption>\n>;\n/** @internal */\nexport type DateFormatterFn = PureComputed<\n  [(date: Date, formatOptions: object) => string], Array<SelectOption>\n>;\n/** @internal */\nexport enum RecurrenceFrequency {\n  Daily = RRULE_REPEAT_TYPES.DAILY,\n  Weekly = RRULE_REPEAT_TYPES.WEEKLY,\n  Monthly = RRULE_REPEAT_TYPES.MONTHLY,\n  Yearly = RRULE_REPEAT_TYPES.YEARLY,\n}\n"],"names":["RRule","RRuleSet","isMidnight","getCellRect","slice","RecurrenceFrequency"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QASa,QAAQ,GAAqB,UAAC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY;QACtF,IAAI,OAAO,CAAC,WAAW,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,CAAC,YAAY,EAAE;YAC3D,OAAO,YAAY,CAAC;SACrB;QACD,OAAO,YAAY,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IACzC,EAAE;QAEW,YAAY,GAErB,UAAC,KAAK,EAAE,KAAK,IAAK,OAAA,CAAC,KAAK,GAAG,GAAG,IAAI,KAAK,IAAC;IAE5C,IAAM,sBAAsB,GAExB,UAAC,GAAG,EAAE,KAAK;QACb,IAAM,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;QACzC,OAAO;YACL,SAAS;YACT,MAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC;SAClD,CAAC;IACJ,CAAC,CAAC;QAEW,iBAAiB,GA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