g(x,c))a[d]=x,a[n]=c,d=n;else break a}}return b}\nfunction g(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}if(\"object\"===typeof performance&&\"function\"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()}}else{var p=Date,q=p.now();exports.unstable_now=function(){return p.now()-q}}var r=[],t=[],u=1,v=null,y=3,z=!1,A=!1,B=!1,D=\"function\"===typeof setTimeout?setTimeout:null,E=\"function\"===typeof clearTimeout?clearTimeout:null,F=\"undefined\"!==typeof setImmediate?setImmediate:null;\n\"undefined\"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function G(a){for(var b=h(t);null!==b;){if(null===b.callback)k(t);else if(b.startTime<=a)k(t),b.sortIndex=b.expirationTime,f(r,b);else break;b=h(t)}}function H(a){B=!1;G(a);if(!A)if(null!==h(r))A=!0,I(J);else{var b=h(t);null!==b&&K(H,b.startTime-a)}}\nfunction J(a,b){A=!1;B&&(B=!1,E(L),L=-1);z=!0;var c=y;try{G(b);for(v=h(r);null!==v&&(!(v.expirationTime>b)||a&&!M());){var d=v.callback;if(\"function\"===typeof d){v.callback=null;y=v.priorityLevel;var e=d(v.expirationTime<=b);b=exports.unstable_now();\"function\"===typeof e?v.callback=e:v===h(r)&&k(r);G(b)}else k(r);v=h(r)}if(null!==v)var w=!0;else{var m=h(t);null!==m&&K(H,m.startTime-b);w=!1}return w}finally{v=null,y=c,z=!1}}var N=!1,O=null,L=-1,P=5,Q=-1;\nfunction M(){return exports.unstable_now()-Qa||125d?(a.sortIndex=c,f(t,a),null===h(r)&&a===h(t)&&(B?(E(L),L=-1):B=!0,K(H,c-d))):(a.sortIndex=e,f(r,a),A||z||(A=!0,I(J)));return a};\nexports.unstable_shouldYield=M;exports.unstable_wrapCallback=function(a){var b=y;return function(){var c=y;y=b;try{return a.apply(this,arguments)}finally{y=c}}};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler.production.min.js');\n} else {\n module.exports = require('./cjs/scheduler.development.js');\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","import defineProperty from \"./defineProperty.js\";\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n enumerableOnly && (symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n })), keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nexport default function _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = null != arguments[i] ? arguments[i] : {};\n i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {\n defineProperty(target, key, source[key]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n\n return target;\n}","export default function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}","import arrayWithHoles from \"./arrayWithHoles.js\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableRest from \"./nonIterableRest.js\";\nexport default function _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}","export default function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}","export default function _iterableToArrayLimit(arr, i) {\n var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"];\n\n if (_i == null) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n\n var _s, _e;\n\n try {\n for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}","export default function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","export enum ViewMode {\n Hour = \"Hour\",\n QuarterDay = \"Quarter Day\",\n HalfDay = \"Half Day\",\n Day = \"Day\",\n /** ISO-8601 week */\n Week = \"Week\",\n Month = \"Month\",\n Year = \"Year\",\n}\nexport type TaskType = \"task\" | \"milestone\" | \"project\";\n\nexport type LinkType = \"EndToStart\" | \"EndToEnd\" | \"StartToStart\" | \"StartToEnd\";\n\nexport interface Link {\n target: string;\n type: LinkType;\n}\nexport interface Task {\n id: string;\n type: TaskType;\n name: string;\n start: Date;\n end: Date;\n /**\n * From 0 to 100\n */\n progress: number;\n styles?: {\n backgroundColor?: string;\n backgroundSelectedColor?: string;\n progressColor?: string;\n progressSelectedColor?: string;\n };\n isDisabled?: boolean;\n project?: string;\n dependencies?: string[];\n links?: Array;\n hideChildren?: boolean;\n displayOrder?: number;\n}\n\nexport interface EventOption {\n /**\n * Time step value for date changes.\n */\n timeStep?: number;\n /**\n * Invokes on bar select on unselect.\n */\n onSelect?: (task: Task, isSelected: boolean) => void;\n /**\n * Invokes on bar double click.\n */\n onDoubleClick?: (task: Task) => void;\n /**\n * Invokes on bar click.\n */\n onClick?: (task: Task) => void;\n /**\n * Invokes on bar click.\n */\n onClickLine?: (tasks: Task[]) => void;\n /**\n * Invokes on end and start time change. Chart undoes operation if method return false or error.\n */\n onDateChange?: (\n task: Task,\n children: Task[]\n ) => void | boolean | Promise | Promise;\n /**\n * Invokes on progress change. Chart undoes operation if method return false or error.\n */\n onProgressChange?: (\n task: Task,\n children: Task[]\n ) => void | boolean | Promise | Promise;\n /**\n * Invokes on delete selected task. Chart undoes operation if method return false or error.\n */\n onDelete?: (task: Task) => void | boolean | Promise | Promise;\n /**\n * Invokes on expander on task list\n */\n onExpanderClick?: (task: Task) => void;\n /**\n * Allow project date change\n */\n allowProjectDateChange?: boolean;\n}\n\nexport interface DisplayOption {\n viewMode?: ViewMode;\n viewDate?: Date;\n preStepsCount?: number;\n /**\n * Specifies the month name language. Able formats: ISO 639-2, Java Locale\n */\n locale?: string;\n rtl?: boolean;\n days?: string;\n duration?: string;\n progress?: string;\n}\n\nexport interface StylingOption {\n headerHeight?: number;\n columnWidth?: number;\n listCellWidth?: string;\n rowHeight?: number;\n ganttHeight?: number;\n barCornerRadius?: number;\n handleWidth?: number;\n fontFamily?: string;\n fontSize?: string;\n /**\n * How many of row width can be taken by task.\n * From 0 to 100\n */\n barFill?: number;\n barProgressColor?: string;\n barProgressSelectedColor?: string;\n barBackgroundColor?: string;\n barBackgroundSelectedColor?: string;\n projectProgressColor?: string;\n projectProgressSelectedColor?: string;\n projectBackgroundColor?: string;\n projectBackgroundSelectedColor?: string;\n milestoneBackgroundColor?: string;\n milestoneBackgroundSelectedColor?: string;\n arrowColor?: string;\n arrowIndent?: number;\n todayColor?: string;\n weekendColor?: string;\n TooltipContent?: React.FC<{\n task: Task;\n fontSize: string;\n fontFamily: string;\n locale: string;\n days: string;\n duration: string;\n progress: string;\n }>;\n TaskListHeader?: React.FC<{\n headerHeight: number;\n rowWidth: string;\n fontFamily: string;\n fontSize: string;\n }>;\n TaskListTable?: React.FC<{\n rowHeight: number;\n rowWidth: string;\n fontFamily: string;\n fontSize: string;\n locale: string;\n tasks: Task[];\n selectedTaskId: string;\n /**\n * Sets selected task by id\n */\n setSelectedTask: (taskId: string) => void;\n onExpanderClick: (task: Task) => void;\n }>;\n}\n\nexport interface GanttProps extends EventOption, DisplayOption, StylingOption {\n tasks: Task[];\n}\n","import { Task, ViewMode } from \"../types/public-types\";\nimport DateTimeFormatOptions = Intl.DateTimeFormatOptions;\nimport DateTimeFormat = Intl.DateTimeFormat;\n\ntype DateHelperScales =\n | \"year\"\n | \"month\"\n | \"day\"\n | \"hour\"\n | \"minute\"\n | \"second\"\n | \"millisecond\";\n\nconst intlDTCache = {};\nexport const getCachedDateTimeFormat = (\n locString: string | string[],\n opts: DateTimeFormatOptions = {}\n): DateTimeFormat => {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlDTCache[key];\n if (!dtf) {\n dtf = new Intl.DateTimeFormat(locString, opts);\n intlDTCache[key] = dtf;\n }\n return dtf;\n};\n\nexport const addToDate = (\n date: Date,\n quantity: number,\n scale: DateHelperScales\n) => {\n const newDate = new Date(\n date.getFullYear() + (scale === \"year\" ? quantity : 0),\n date.getMonth() + (scale === \"month\" ? quantity : 0),\n date.getDate() + (scale === \"day\" ? quantity : 0),\n date.getHours() + (scale === \"hour\" ? quantity : 0),\n date.getMinutes() + (scale === \"minute\" ? quantity : 0),\n date.getSeconds() + (scale === \"second\" ? quantity : 0),\n date.getMilliseconds() + (scale === \"millisecond\" ? quantity : 0)\n );\n return newDate;\n};\n\nexport const startOfDate = (date: Date, scale: DateHelperScales) => {\n const scores = [\n \"millisecond\",\n \"second\",\n \"minute\",\n \"hour\",\n \"day\",\n \"month\",\n \"year\",\n ];\n\n const shouldReset = (_scale: DateHelperScales) => {\n const maxScore = scores.indexOf(scale);\n return scores.indexOf(_scale) <= maxScore;\n };\n const newDate = new Date(\n date.getFullYear(),\n shouldReset(\"year\") ? 0 : date.getMonth(),\n shouldReset(\"month\") ? 1 : date.getDate(),\n shouldReset(\"day\") ? 0 : date.getHours(),\n shouldReset(\"hour\") ? 0 : date.getMinutes(),\n shouldReset(\"minute\") ? 0 : date.getSeconds(),\n shouldReset(\"second\") ? 0 : date.getMilliseconds()\n );\n return newDate;\n};\n\nexport const ganttDateRange = (\n tasks: Task[],\n viewMode: ViewMode,\n preStepsCount: number\n) => {\n let newStartDate: Date = tasks[0].start;\n let newEndDate: Date = tasks[0].start;\n for (const task of tasks) {\n if (task.start < newStartDate) {\n newStartDate = task.start;\n }\n if (task.end > newEndDate) {\n newEndDate = task.end;\n }\n }\n switch (viewMode) {\n case ViewMode.Year:\n newStartDate = addToDate(newStartDate, -1, \"year\");\n newStartDate = startOfDate(newStartDate, \"year\");\n newEndDate = addToDate(newEndDate, 1, \"year\");\n newEndDate = startOfDate(newEndDate, \"year\");\n break;\n case ViewMode.Month:\n newStartDate = addToDate(newStartDate, -1 * preStepsCount, \"month\");\n newStartDate = startOfDate(newStartDate, \"month\");\n newEndDate = addToDate(newEndDate, 1, \"year\");\n newEndDate = startOfDate(newEndDate, \"year\");\n break;\n case ViewMode.Week:\n newStartDate = startOfDate(newStartDate, \"day\");\n newStartDate = addToDate(\n getMonday(newStartDate),\n -7 * preStepsCount,\n \"day\"\n );\n newEndDate = startOfDate(newEndDate, \"day\");\n newEndDate = addToDate(newEndDate, 1.5, \"month\");\n break;\n case ViewMode.Day:\n newStartDate = startOfDate(newStartDate, \"day\");\n newStartDate = addToDate(newStartDate, -1 * preStepsCount, \"day\");\n newEndDate = startOfDate(newEndDate, \"day\");\n newEndDate = addToDate(newEndDate, 19, \"day\");\n break;\n case ViewMode.QuarterDay:\n newStartDate = startOfDate(newStartDate, \"day\");\n newStartDate = addToDate(newStartDate, -1 * preStepsCount, \"day\");\n newEndDate = startOfDate(newEndDate, \"day\");\n newEndDate = addToDate(newEndDate, 66, \"hour\"); // 24(1 day)*3 - 6\n break;\n case ViewMode.HalfDay:\n newStartDate = startOfDate(newStartDate, \"day\");\n newStartDate = addToDate(newStartDate, -1 * preStepsCount, \"day\");\n newEndDate = startOfDate(newEndDate, \"day\");\n newEndDate = addToDate(newEndDate, 108, \"hour\"); // 24(1 day)*5 - 12\n break;\n case ViewMode.Hour:\n newStartDate = startOfDate(newStartDate, \"hour\");\n newStartDate = addToDate(newStartDate, -1 * preStepsCount, \"hour\");\n newEndDate = startOfDate(newEndDate, \"day\");\n newEndDate = addToDate(newEndDate, 1, \"day\");\n break;\n }\n return [newStartDate, newEndDate];\n};\n\nexport const seedDates = (\n startDate: Date,\n endDate: Date,\n viewMode: ViewMode\n) => {\n let currentDate: Date = new Date(startDate);\n const dates: Date[] = [currentDate];\n while (currentDate < endDate) {\n switch (viewMode) {\n case ViewMode.Year:\n currentDate = addToDate(currentDate, 1, \"year\");\n break;\n case ViewMode.Month:\n currentDate = addToDate(currentDate, 1, \"month\");\n break;\n case ViewMode.Week:\n currentDate = addToDate(currentDate, 7, \"day\");\n break;\n case ViewMode.Day:\n currentDate = addToDate(currentDate, 1, \"day\");\n break;\n case ViewMode.HalfDay:\n currentDate = addToDate(currentDate, 12, \"hour\");\n break;\n case ViewMode.QuarterDay:\n currentDate = addToDate(currentDate, 6, \"hour\");\n break;\n case ViewMode.Hour:\n currentDate = addToDate(currentDate, 1, \"hour\");\n break;\n }\n dates.push(currentDate);\n }\n return dates;\n};\n\nexport const getLocaleMonth = (date: Date, locale: string) => {\n let bottomValue = getCachedDateTimeFormat(locale, {\n month: \"long\",\n }).format(date);\n bottomValue = bottomValue.replace(\n bottomValue[0],\n bottomValue[0].toLocaleUpperCase()\n );\n return bottomValue;\n};\n\nexport const getLocalDayOfWeek = (\n date: Date,\n locale: string,\n format?: \"long\" | \"short\" | \"narrow\" | undefined\n) => {\n let bottomValue = getCachedDateTimeFormat(locale, {\n weekday: format,\n }).format(date);\n bottomValue = bottomValue.replace(\n bottomValue[0],\n bottomValue[0].toLocaleUpperCase()\n );\n return bottomValue;\n};\n\n/**\n * Returns monday of current week\n * @param date date for modify\n */\nconst getMonday = (date: Date) => {\n const day = date.getDay();\n const diff = date.getDate() - day + (day === 0 ? -6 : 1); // adjust when day is sunday\n return new Date(date.setDate(diff));\n};\n\nexport const getWeekNumberISO8601 = (date: Date) => {\n const tmpDate = new Date(date.valueOf());\n const dayNumber = (tmpDate.getDay() + 6) % 7;\n tmpDate.setDate(tmpDate.getDate() - dayNumber + 3);\n const firstThursday = tmpDate.valueOf();\n tmpDate.setMonth(0, 1);\n if (tmpDate.getDay() !== 4) {\n tmpDate.setMonth(0, 1 + ((4 - tmpDate.getDay() + 7) % 7));\n }\n const weekNumber = (\n 1 + Math.ceil((firstThursday - tmpDate.valueOf()) / 604800000)\n ).toString();\n\n if (weekNumber.length === 1) {\n return `0${weekNumber}`;\n } else {\n return weekNumber;\n }\n};\n\nexport const getDaysInMonth = (month: number, year: number) => {\n return new Date(year, month + 1, 0).getDate();\n};\n","import React from \"react\";\nimport styles from \"./task-list-header.module.css\";\n\nexport const TaskListHeaderDefault: React.FC<{\n headerHeight: number;\n rowWidth: string;\n fontFamily: string;\n fontSize: string;\n}> = ({ headerHeight, fontFamily, fontSize, rowWidth }) => {\n return (\n \n
\n
\n Name\n
\n
\n
\n From\n
\n
\n
\n To\n
\n
\n
\n );\n};\n","import React, { useMemo } from \"react\";\nimport styles from \"./task-list-table.module.css\";\nimport { Task } from \"../../types/public-types\";\n\nconst localeDateStringCache = {};\nconst toLocaleDateStringFactory =\n (locale: string) =>\n (date: Date, dateTimeOptions: Intl.DateTimeFormatOptions) => {\n const key = date.toString();\n let lds = localeDateStringCache[key];\n if (!lds) {\n lds = date.toLocaleDateString(locale, dateTimeOptions);\n localeDateStringCache[key] = lds;\n }\n return lds;\n };\nconst dateTimeOptions: Intl.DateTimeFormatOptions = {\n weekday: \"short\",\n year: \"numeric\",\n month: \"long\",\n day: \"numeric\",\n};\n\nexport const TaskListTableDefault: React.FC<{\n rowHeight: number;\n rowWidth: string;\n fontFamily: string;\n fontSize: string;\n locale: string;\n tasks: Task[];\n selectedTaskId: string;\n setSelectedTask: (taskId: string) => void;\n onExpanderClick: (task: Task) => void;\n}> = ({\n rowHeight,\n rowWidth,\n tasks,\n fontFamily,\n fontSize,\n locale,\n onExpanderClick,\n}) => {\n const toLocaleDateString = useMemo(\n () => toLocaleDateStringFactory(locale),\n [locale]\n );\n\n return (\n \n {tasks.map(t => {\n let expanderSymbol = \"\";\n if (t.hideChildren === false) {\n expanderSymbol = \"â–¼\";\n } else if (t.hideChildren === true) {\n expanderSymbol = \"â–¶\";\n }\n\n return (\n
\n
\n
\n
onExpanderClick(t)}\n >\n {expanderSymbol}\n
\n
{t.name}
\n
\n
\n
\n {toLocaleDateString(t.start, dateTimeOptions)}\n
\n
\n {toLocaleDateString(t.end, dateTimeOptions)}\n
\n
\n );\n })}\n
\n );\n};\n","import React, { useRef, useEffect, useState } from \"react\";\nimport { Task } from \"../../types/public-types\";\nimport { BarTask } from \"../../types/bar-task\";\nimport styles from \"./tooltip.module.css\";\n\nexport type TooltipProps = {\n task: BarTask;\n arrowIndent: number;\n rtl: boolean;\n svgContainerHeight: number;\n svgContainerWidth: number;\n svgWidth: number;\n headerHeight: number;\n taskListWidth: number;\n scrollX: number;\n scrollY: number;\n rowHeight: number;\n fontSize: string;\n fontFamily: string;\n locale: string;\n days: string;\n duration: string;\n progress: string;\n TooltipContent: React.FC<{\n task: Task;\n fontSize: string;\n fontFamily: string;\n locale: string;\n days: string;\n duration: string;\n progress: string;\n }>;\n};\nexport const Tooltip: React.FC = ({\n task,\n rowHeight,\n rtl,\n svgContainerHeight,\n svgContainerWidth,\n scrollX,\n scrollY,\n arrowIndent,\n fontSize,\n fontFamily,\n locale,\n days,\n duration,\n progress,\n headerHeight,\n taskListWidth,\n TooltipContent,\n}) => {\n const tooltipRef = useRef(null);\n const [relatedY, setRelatedY] = useState(0);\n const [relatedX, setRelatedX] = useState(0);\n useEffect(() => {\n if (tooltipRef.current) {\n const tooltipHeight = tooltipRef.current.offsetHeight * 1.1;\n const tooltipWidth = tooltipRef.current.offsetWidth * 1.1;\n\n let newRelatedY = task.index * rowHeight - scrollY + headerHeight;\n let newRelatedX: number;\n if (rtl) {\n newRelatedX = task.x1 - arrowIndent * 1.5 - tooltipWidth - scrollX;\n if (newRelatedX < 0) {\n newRelatedX = task.x2 + arrowIndent * 1.5 - scrollX;\n }\n const tooltipLeftmostPoint = tooltipWidth + newRelatedX;\n if (tooltipLeftmostPoint > svgContainerWidth) {\n newRelatedX = svgContainerWidth - tooltipWidth;\n newRelatedY += rowHeight;\n }\n } else {\n newRelatedX = task.x2 + arrowIndent * 1.5 + taskListWidth - scrollX;\n const tooltipLeftmostPoint = tooltipWidth + newRelatedX;\n const fullChartWidth = taskListWidth + svgContainerWidth;\n if (tooltipLeftmostPoint > fullChartWidth) {\n newRelatedX =\n task.x1 +\n taskListWidth -\n arrowIndent * 1.5 -\n scrollX -\n tooltipWidth;\n }\n if (newRelatedX < taskListWidth) {\n newRelatedX = svgContainerWidth + taskListWidth - tooltipWidth;\n newRelatedY += rowHeight;\n }\n }\n\n const tooltipLowerPoint = tooltipHeight + newRelatedY - scrollY;\n if (tooltipLowerPoint > svgContainerHeight - scrollY) {\n newRelatedY = svgContainerHeight - tooltipHeight;\n }\n setRelatedY(newRelatedY);\n setRelatedX(newRelatedX);\n }\n }, [\n tooltipRef,\n task,\n arrowIndent,\n scrollX,\n scrollY,\n headerHeight,\n taskListWidth,\n rowHeight,\n svgContainerHeight,\n svgContainerWidth,\n rtl,\n ]);\n\n return (\n \n \n
\n );\n};\n\nexport interface TooltipContentProps {\n task: Task;\n fontSize: string;\n fontFamily: string;\n locale: string;\n days: string;\n duration: string;\n progress: string;\n};\n\nexport const StandardTooltipContent: React.FC = ({ \n task, \n fontSize, \n fontFamily, \n locale,\n days,\n duration,\n progress \n}) => {\n const style = {\n fontSize,\n fontFamily,\n };\n\n const dateTimeOptions: Intl.DateTimeFormatOptions = {\n weekday: \"short\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"numeric\",\n };\n\n const formaDate = (date: Date) => date.toLocaleDateString(locale, dateTimeOptions);\n\n return (\n \n
{task.name}: {formaDate(task.start)} - {formaDate(task.end)}\n {task.end.getTime() - task.start.getTime() !== 0 && (\n
{`${duration}: ${(\n (task.end.getTime() - task.start.getTime()) /\n (1000 * 60 * 60 * 24)\n )} ${days}(s)`}
\n )}\n\n
\n {!!task.progress && `${progress}: ${task.progress} %`}\n
\n
\n );\n};","import React, { SyntheticEvent, useRef, useEffect } from \"react\";\nimport styles from \"./vertical-scroll.module.css\";\n\nexport const VerticalScroll: React.FC<{\n scroll: number;\n ganttHeight: number;\n ganttFullHeight: number;\n headerHeight: number;\n rtl: boolean;\n onScroll: (event: SyntheticEvent) => void;\n}> = ({\n scroll,\n ganttHeight,\n ganttFullHeight,\n headerHeight,\n rtl,\n onScroll,\n}) => {\n const scrollRef = useRef(null);\n\n useEffect(() => {\n if (scrollRef.current) {\n scrollRef.current.scrollTop = scroll;\n }\n }, [scroll]);\n\n return (\n \n );\n};\n","import React, { useEffect, useRef } from \"react\";\nimport { BarTask } from \"../../types/bar-task\";\nimport { Task } from \"../../types/public-types\";\n\nexport type TaskListProps = {\n headerHeight: number;\n rowWidth: string;\n fontFamily: string;\n fontSize: string;\n rowHeight: number;\n ganttHeight: number;\n scrollY: number;\n locale: string;\n tasks: Task[];\n taskListRef: React.RefObject;\n horizontalContainerClass?: string;\n selectedTask: BarTask | undefined;\n setSelectedTask: (task: string) => void;\n onExpanderClick: (task: Task) => void;\n TaskListHeader: React.FC<{\n headerHeight: number;\n rowWidth: string;\n fontFamily: string;\n fontSize: string;\n }>;\n TaskListTable: React.FC<{\n rowHeight: number;\n rowWidth: string;\n fontFamily: string;\n fontSize: string;\n locale: string;\n tasks: Task[];\n selectedTaskId: string;\n setSelectedTask: (taskId: string) => void;\n onExpanderClick: (task: Task) => void;\n }>;\n};\n\nexport const TaskList: React.FC = ({\n headerHeight,\n fontFamily,\n fontSize,\n rowWidth,\n rowHeight,\n scrollY,\n tasks,\n selectedTask,\n setSelectedTask,\n onExpanderClick,\n locale,\n ganttHeight,\n taskListRef,\n horizontalContainerClass,\n TaskListHeader,\n TaskListTable,\n}) => {\n const horizontalContainerRef = useRef(null);\n useEffect(() => {\n if (horizontalContainerRef.current) {\n horizontalContainerRef.current.scrollTop = scrollY;\n }\n }, [scrollY]);\n\n const headerProps = {\n headerHeight,\n fontFamily,\n fontSize,\n rowWidth,\n };\n const selectedTaskId = selectedTask ? selectedTask.id : \"\";\n const tableProps = {\n rowHeight,\n rowWidth,\n fontFamily,\n fontSize,\n tasks,\n locale,\n selectedTaskId: selectedTaskId,\n setSelectedTask,\n onExpanderClick,\n };\n\n return (\n \n );\n};\n","import React, { ReactChild } from \"react\";\nimport { Task } from \"../../types/public-types\";\nimport { addToDate } from \"../../helpers/date-helper\";\nimport styles from \"./grid.module.css\";\n\nexport type GridBodyProps = {\n tasks: Task[];\n dates: Date[];\n svgWidth: number;\n rowHeight: number;\n columnWidth: number;\n todayColor: string;\n weekendColor: string;\n rtl: boolean;\n};\nexport const GridBody: React.FC = ({\n tasks,\n dates,\n rowHeight,\n svgWidth,\n columnWidth,\n todayColor,\n weekendColor,\n rtl,\n}) => {\n let y = 0;\n const gridRows: ReactChild[] = [];\n const rowLines: ReactChild[] = [\n ,\n ];\n for (const task of tasks) {\n gridRows.push(\n \n );\n rowLines.push(\n \n );\n y += rowHeight;\n }\n\n const now = new Date();\n let tickX = 0;\n const ticks: ReactChild[] = [];\n const weekends: ReactChild[] = [];\n let today: ReactChild = ;\n for (let i = 0; i < dates.length; i++) {\n const date = dates[i];\n ticks.push(\n \n );\n\n if (weekendColor !== \"transparent\" && dates[i + 1] && [0,6].includes(dates[i + 1].getDay())) {\n weekends.push(\n \n );\n }\n\n if (\n (i + 1 !== dates.length &&\n date.getTime() < now.getTime() &&\n dates[i + 1].getTime() >= now.getTime()) ||\n // if current date is last\n (i !== 0 &&\n i + 1 === dates.length &&\n date.getTime() < now.getTime() &&\n addToDate(\n date,\n date.getTime() - dates[i - 1].getTime(),\n \"millisecond\"\n ).getTime() >= now.getTime())\n ) {\n today = (\n \n );\n }\n // rtl for today\n if (\n rtl &&\n i + 1 !== dates.length &&\n date.getTime() >= now.getTime() &&\n dates[i + 1].getTime() < now.getTime()\n ) {\n today = (\n \n );\n }\n\n tickX += columnWidth;\n }\n return (\n \n {gridRows}\n {rowLines}\n {ticks}\n {weekends}\n {today}\n \n );\n};\n","import React from \"react\";\nimport { GridBody, GridBodyProps } from \"./grid-body\";\n\nexport type GridProps = GridBodyProps;\nexport const Grid: React.FC = props => {\n return (\n \n \n \n );\n};\n","import React from \"react\";\nimport styles from \"./calendar.module.css\";\n\ntype TopPartOfCalendarProps = {\n value: string;\n x1Line: number;\n y1Line: number;\n y2Line: number;\n xText: number;\n yText: number;\n};\n\nexport const TopPartOfCalendar: React.FC = ({\n value,\n x1Line,\n y1Line,\n y2Line,\n xText,\n yText,\n}) => {\n return (\n \n \n \n {value}\n \n \n );\n};\n","import React, { ReactChild } from \"react\";\nimport { ViewMode } from \"../../types/public-types\";\nimport { TopPartOfCalendar } from \"./top-part-of-calendar\";\nimport {\n getCachedDateTimeFormat,\n getDaysInMonth,\n getLocalDayOfWeek,\n getLocaleMonth,\n getWeekNumberISO8601,\n} from \"../../helpers/date-helper\";\nimport { DateSetup } from \"../../types/date-setup\";\nimport styles from \"./calendar.module.css\";\n\nexport type CalendarProps = {\n dateSetup: DateSetup;\n locale: string;\n viewMode: ViewMode;\n rtl: boolean;\n headerHeight: number;\n columnWidth: number;\n fontFamily: string;\n fontSize: string;\n};\n\nexport const Calendar: React.FC = ({\n dateSetup,\n locale,\n viewMode,\n rtl,\n headerHeight,\n columnWidth,\n fontFamily,\n fontSize,\n}) => {\n const getCalendarValuesForYear = () => {\n const topValues: ReactChild[] = [];\n const bottomValues: ReactChild[] = [];\n const topDefaultHeight = headerHeight * 0.5;\n for (let i = 0; i < dateSetup.dates.length; i++) {\n const date = dateSetup.dates[i];\n const bottomValue = date.getFullYear();\n bottomValues.push(\n \n {bottomValue}\n \n );\n if (\n i === 0 ||\n date.getFullYear() !== dateSetup.dates[i - 1].getFullYear()\n ) {\n const topValue = date.getFullYear().toString();\n let xText: number;\n if (rtl) {\n xText = (6 + i + date.getFullYear() + 1) * columnWidth;\n } else {\n xText = (6 + i - date.getFullYear()) * columnWidth;\n }\n topValues.push(\n \n );\n }\n }\n return [topValues, bottomValues];\n };\n\n const getCalendarValuesForMonth = () => {\n const topValues: ReactChild[] = [];\n const bottomValues: ReactChild[] = [];\n const topDefaultHeight = headerHeight * 0.5;\n for (let i = 0; i < dateSetup.dates.length; i++) {\n const date = dateSetup.dates[i];\n const bottomValue = getLocaleMonth(date, locale);\n bottomValues.push(\n \n {bottomValue}\n \n );\n if (\n i === 0 ||\n date.getFullYear() !== dateSetup.dates[i - 1].getFullYear()\n ) {\n const topValue = date.getFullYear().toString();\n let xText: number;\n if (rtl) {\n xText = (6 + i + date.getMonth() + 1) * columnWidth;\n } else {\n xText = (6 + i - date.getMonth()) * columnWidth;\n }\n topValues.push(\n \n );\n }\n }\n return [topValues, bottomValues];\n };\n\n const getCalendarValuesForWeek = () => {\n const topValues: ReactChild[] = [];\n const bottomValues: ReactChild[] = [];\n let weeksCount: number = 1;\n const topDefaultHeight = headerHeight * 0.5;\n const dates = dateSetup.dates;\n for (let i = dates.length - 1; i >= 0; i--) {\n const date = dates[i];\n let topValue = \"\";\n if (i === 0 || date.getMonth() !== dates[i - 1].getMonth()) {\n // top\n topValue = `${getLocaleMonth(date, locale)}, ${date.getFullYear()}`;\n }\n // bottom\n const bottomValue = `W${getWeekNumberISO8601(date)}`;\n\n bottomValues.push(\n \n {bottomValue}\n \n );\n\n if (topValue) {\n // if last day is new month\n if (i !== dates.length - 1) {\n topValues.push(\n \n );\n }\n weeksCount = 0;\n }\n weeksCount++;\n }\n return [topValues, bottomValues];\n };\n\n const getCalendarValuesForDay = () => {\n const topValues: ReactChild[] = [];\n const bottomValues: ReactChild[] = [];\n const topDefaultHeight = headerHeight * 0.5;\n const dates = dateSetup.dates;\n for (let i = 0; i < dates.length; i++) {\n const date = dates[i];\n const bottomValue = `${getLocalDayOfWeek(date, locale, \"short\")}, ${date\n .getDate()\n .toString()}`;\n\n bottomValues.push(\n \n {bottomValue}\n \n );\n if (\n i + 1 !== dates.length &&\n date.getMonth() !== dates[i + 1].getMonth()\n ) {\n const topValue = getLocaleMonth(date, locale);\n\n topValues.push(\n \n );\n }\n }\n return [topValues, bottomValues];\n };\n\n const getCalendarValuesForPartOfDay = () => {\n const topValues: ReactChild[] = [];\n const bottomValues: ReactChild[] = [];\n const ticks = viewMode === ViewMode.HalfDay ? 2 : 4;\n const topDefaultHeight = headerHeight * 0.5;\n const dates = dateSetup.dates;\n for (let i = 0; i < dates.length; i++) {\n const date = dates[i];\n const bottomValue = getCachedDateTimeFormat(locale, {\n hour: \"numeric\",\n }).format(date);\n\n bottomValues.push(\n \n {bottomValue}\n \n );\n if (i === 0 || date.getDate() !== dates[i - 1].getDate()) {\n const topValue = `${getLocalDayOfWeek(\n date,\n locale,\n \"short\"\n )}, ${date.getDate()} ${getLocaleMonth(date, locale)}`;\n topValues.push(\n \n );\n }\n }\n\n return [topValues, bottomValues];\n };\n\n const getCalendarValuesForHour = () => {\n const topValues: ReactChild[] = [];\n const bottomValues: ReactChild[] = [];\n const topDefaultHeight = headerHeight * 0.5;\n const dates = dateSetup.dates;\n for (let i = 0; i < dates.length; i++) {\n const date = dates[i];\n const bottomValue = getCachedDateTimeFormat(locale, {\n hour: \"numeric\",\n }).format(date);\n\n bottomValues.push(\n \n {bottomValue}\n \n );\n if (i !== 0 && date.getDate() !== dates[i - 1].getDate()) {\n const displayDate = dates[i - 1];\n const topValue = `${getLocalDayOfWeek(\n displayDate,\n locale,\n \"long\"\n )}, ${displayDate.getDate()} ${getLocaleMonth(displayDate, locale)}`;\n const topPosition = (date.getHours() - 24) / 2;\n topValues.push(\n \n );\n }\n }\n\n return [topValues, bottomValues];\n };\n\n let topValues: ReactChild[] = [];\n let bottomValues: ReactChild[] = [];\n switch (dateSetup.viewMode) {\n case ViewMode.Year:\n [topValues, bottomValues] = getCalendarValuesForYear();\n break;\n case ViewMode.Month:\n [topValues, bottomValues] = getCalendarValuesForMonth();\n break;\n case ViewMode.Week:\n [topValues, bottomValues] = getCalendarValuesForWeek();\n break;\n case ViewMode.Day:\n [topValues, bottomValues] = getCalendarValuesForDay();\n break;\n case ViewMode.QuarterDay:\n case ViewMode.HalfDay:\n [topValues, bottomValues] = getCalendarValuesForPartOfDay();\n break;\n case ViewMode.Hour:\n [topValues, bottomValues] = getCalendarValuesForHour();\n }\n return (\n \n \n {bottomValues} {topValues}\n \n );\n};\n","// A type of promise-like that resolves synchronously and supports only one observer\nexport const _Pact = /*#__PURE__*/(function() {\n\tfunction _Pact() {}\n\t_Pact.prototype.then = function(onFulfilled, onRejected) {\n\t\tconst result = new _Pact();\n\t\tconst state = this.s;\n\t\tif (state) {\n\t\t\tconst callback = state & 1 ? onFulfilled : onRejected;\n\t\t\tif (callback) {\n\t\t\t\ttry {\n\t\t\t\t\t_settle(result, 1, callback(this.v));\n\t\t\t\t} catch (e) {\n\t\t\t\t\t_settle(result, 2, e);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t} else {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\t\tthis.o = function(_this) {\n\t\t\ttry {\n\t\t\t\tconst value = _this.v;\n\t\t\t\tif (_this.s & 1) {\n\t\t\t\t\t_settle(result, 1, onFulfilled ? onFulfilled(value) : value);\n\t\t\t\t} else if (onRejected) {\n\t\t\t\t\t_settle(result, 1, onRejected(value));\n\t\t\t\t} else {\n\t\t\t\t\t_settle(result, 2, value);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t_settle(result, 2, e);\n\t\t\t}\n\t\t};\n\t\treturn result;\n\t}\n\treturn _Pact;\n})();\n\n// Settles a pact synchronously\nexport function _settle(pact, state, value) {\n\tif (!pact.s) {\n\t\tif (value instanceof _Pact) {\n\t\t\tif (value.s) {\n\t\t\t\tif (state & 1) {\n\t\t\t\t\tstate = value.s;\n\t\t\t\t}\n\t\t\t\tvalue = value.v;\n\t\t\t} else {\n\t\t\t\tvalue.o = _settle.bind(null, pact, state);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (value && value.then) {\n\t\t\tvalue.then(_settle.bind(null, pact, state), _settle.bind(null, pact, 2));\n\t\t\treturn;\n\t\t}\n\t\tpact.s = state;\n\t\tpact.v = value;\n\t\tconst observer = pact.o;\n\t\tif (observer) {\n\t\t\tobserver(pact);\n\t\t}\n\t}\n}\n\nexport function _isSettledPact(thenable) {\n\treturn thenable instanceof _Pact && thenable.s & 1;\n}\n\n// Converts argument to a function that always returns a Promise\nexport function _async(f) {\n\treturn function() {\n\t\tfor (var args = [], i = 0; i < arguments.length; i++) {\n\t\t\targs[i] = arguments[i];\n\t\t}\n\t\ttry {\n\t\t\treturn Promise.resolve(f.apply(this, args));\n\t\t} catch(e) {\n\t\t\treturn Promise.reject(e);\n\t\t}\n\t}\n}\n\n// Awaits on a value that may or may not be a Promise (equivalent to the await keyword in ES2015, with continuations passed explicitly)\nexport function _await(value, then, direct) {\n\tif (direct) {\n\t\treturn then ? then(value) : value;\n\t}\n\tif (!value || !value.then) {\n\t\tvalue = Promise.resolve(value);\n\t}\n\treturn then ? value.then(then) : value;\n}\n\n// Awaits on a value that may or may not be a Promise, then ignores it\nexport function _awaitIgnored(value, direct) {\n\tif (!direct) {\n\t\treturn value && value.then ? value.then(_empty) : Promise.resolve();\n\t}\n}\n\n// Proceeds after a value has resolved, or proceeds immediately if the value is not thenable\nexport function _continue(value, then) {\n\treturn value && value.then ? value.then(then) : then(value);\n}\n\n// Proceeds after a value has resolved, or proceeds immediately if the value is not thenable\nexport function _continueIgnored(value) {\n\tif (value && value.then) {\n\t\treturn value.then(_empty);\n\t}\n}\n\n// Asynchronously iterate through an object that has a length property, passing the index as the first argument to the callback (even as the length property changes)\nexport function _forTo(array, body, check) {\n\tvar i = -1, pact, reject;\n\tfunction _cycle(result) {\n\t\ttry {\n\t\t\twhile (++i < array.length && (!check || !check())) {\n\t\t\t\tresult = body(i);\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (pact) {\n\t\t\t\t_settle(pact, 1, result);\n\t\t\t} else {\n\t\t\t\tpact = result;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\t_settle(pact || (pact = new _Pact()), 2, e);\n\t\t}\n\t}\n\t_cycle();\n\treturn pact;\n}\n\n// Asynchronously iterate through an object's properties (including properties inherited from the prototype)\n// Uses a snapshot of the object's properties\nexport function _forIn(target, body, check) {\n\tvar keys = [];\n\tfor (var key in target) {\n\t\tkeys.push(key);\n\t}\n\treturn _forTo(keys, function(i) { return body(keys[i]); }, check);\n}\n\n// Asynchronously iterate through an object's own properties (excluding properties inherited from the prototype)\n// Uses a snapshot of the object's properties\nexport function _forOwn(target, body, check) {\n\tvar keys = [];\n\tfor (var key in target) {\n\t\tif (Object.prototype.hasOwnProperty.call(target, key)) {\n\t\t\tkeys.push(key);\n\t\t}\n\t}\n\treturn _forTo(keys, function(i) { return body(keys[i]); }, check);\n}\n\nexport const _iteratorSymbol = /*#__PURE__*/ typeof Symbol !== \"undefined\" ? (Symbol.iterator || (Symbol.iterator = Symbol(\"Symbol.iterator\"))) : \"@@iterator\";\n\n// Asynchronously iterate through an object's values\n// Uses for...of if the runtime supports it, otherwise iterates until length on a copy\nexport function _forOf(target, body, check) {\n\tif (typeof target[_iteratorSymbol] === \"function\") {\n\t\tvar iterator = target[_iteratorSymbol](), step, pact, reject;\n\t\tfunction _cycle(result) {\n\t\t\ttry {\n\t\t\t\twhile (!(step = iterator.next()).done && (!check || !check())) {\n\t\t\t\t\tresult = body(step.value);\n\t\t\t\t\tif (result && result.then) {\n\t\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresult.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (pact) {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t} else {\n\t\t\t\t\tpact = result;\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t_settle(pact || (pact = new _Pact()), 2, e);\n\t\t\t}\n\t\t}\n\t\t_cycle();\n\t\tif (iterator.return) {\n\t\t\tvar _fixup = function(value) {\n\t\t\t\ttry {\n\t\t\t\t\tif (!step.done) {\n\t\t\t\t\t\titerator.return();\n\t\t\t\t\t}\n\t\t\t\t} catch(e) {\n\t\t\t\t}\n\t\t\t\treturn value;\n\t\t\t}\n\t\t\tif (pact && pact.then) {\n\t\t\t\treturn pact.then(_fixup, function(e) {\n\t\t\t\t\tthrow _fixup(e);\n\t\t\t\t});\n\t\t\t}\n\t\t\t_fixup();\n\t\t}\n\t\treturn pact;\n\t}\n\t// No support for Symbol.iterator\n\tif (!(\"length\" in target)) {\n\t\tthrow new TypeError(\"Object is not iterable\");\n\t}\n\t// Handle live collections properly\n\tvar values = [];\n\tfor (var i = 0; i < target.length; i++) {\n\t\tvalues.push(target[i]);\n\t}\n\treturn _forTo(values, function(i) { return body(values[i]); }, check);\n}\n\nexport const _asyncIteratorSymbol = /*#__PURE__*/ typeof Symbol !== \"undefined\" ? (Symbol.asyncIterator || (Symbol.asyncIterator = Symbol(\"Symbol.asyncIterator\"))) : \"@@asyncIterator\";\n\n// Asynchronously iterate on a value using it's async iterator if present, or its synchronous iterator if missing\nexport function _forAwaitOf(target, body, check) {\n\tif (typeof target[_asyncIteratorSymbol] === \"function\") {\n\t\tvar pact = new _Pact();\n\t\tvar iterator = target[_asyncIteratorSymbol]();\n\t\titerator.next().then(_resumeAfterNext).then(void 0, _reject);\n\t\treturn pact;\n\t\tfunction _resumeAfterBody(result) {\n\t\t\tif (check && check()) {\n\t\t\t\treturn _settle(pact, 1, iterator.return ? iterator.return().then(function() { return result; }) : result);\n\t\t\t}\n\t\t\titerator.next().then(_resumeAfterNext).then(void 0, _reject);\n\t\t}\n\t\tfunction _resumeAfterNext(step) {\n\t\t\tif (step.done) {\n\t\t\t\t_settle(pact, 1);\n\t\t\t} else {\n\t\t\t\tPromise.resolve(body(step.value)).then(_resumeAfterBody).then(void 0, _reject);\n\t\t\t}\n\t\t}\n\t\tfunction _reject(error) {\n\t\t\t_settle(pact, 2, iterator.return ? iterator.return().then(function() { return error; }) : error);\n\t\t}\n\t}\n\treturn Promise.resolve(_forOf(target, function(value) { return Promise.resolve(value).then(body); }, check));\n}\n\n// Asynchronously implement a generic for loop\nexport function _for(test, update, body) {\n\tvar stage;\n\tfor (;;) {\n\t\tvar shouldContinue = test();\n\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\tshouldContinue = shouldContinue.v;\n\t\t}\n\t\tif (!shouldContinue) {\n\t\t\treturn result;\n\t\t}\n\t\tif (shouldContinue.then) {\n\t\t\tstage = 0;\n\t\t\tbreak;\n\t\t}\n\t\tvar result = body();\n\t\tif (result && result.then) {\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.s;\n\t\t\t} else {\n\t\t\t\tstage = 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (update) {\n\t\t\tvar updateValue = update();\n\t\t\tif (updateValue && updateValue.then && !_isSettledPact(updateValue)) {\n\t\t\t\tstage = 2;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tvar pact = new _Pact();\n\tvar reject = _settle.bind(null, pact, 2);\n\t(stage === 0 ? shouldContinue.then(_resumeAfterTest) : stage === 1 ? result.then(_resumeAfterBody) : updateValue.then(_resumeAfterUpdate)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterBody(value) {\n\t\tresult = value;\n\t\tdo {\n\t\t\tif (update) {\n\t\t\t\tupdateValue = update();\n\t\t\t\tif (updateValue && updateValue.then && !_isSettledPact(updateValue)) {\n\t\t\t\t\tupdateValue.then(_resumeAfterUpdate).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tshouldContinue = test();\n\t\t\tif (!shouldContinue || (_isSettledPact(shouldContinue) && !shouldContinue.v)) {\n\t\t\t\t_settle(pact, 1, result);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.v;\n\t\t\t}\n\t\t} while (!result || !result.then);\n\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t}\n\tfunction _resumeAfterTest(shouldContinue) {\n\t\tif (shouldContinue) {\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t} else {\n\t\t\t\t_resumeAfterBody(result);\n\t\t\t}\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n\tfunction _resumeAfterUpdate() {\n\t\tif (shouldContinue = test()) {\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t} else {\n\t\t\t\t_resumeAfterTest(shouldContinue);\n\t\t\t}\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n}\n\n// Asynchronously implement a do ... while loop\nexport function _do(body, test) {\n\tvar awaitBody;\n\tdo {\n\t\tvar result = body();\n\t\tif (result && result.then) {\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.v;\n\t\t\t} else {\n\t\t\t\tawaitBody = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tvar shouldContinue = test();\n\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\tshouldContinue = shouldContinue.v;\n\t\t}\n\t\tif (!shouldContinue) {\n\t\t\treturn result;\n\t\t}\n\t} while (!shouldContinue.then);\n\tconst pact = new _Pact();\n\tconst reject = _settle.bind(null, pact, 2);\n\t(awaitBody ? result.then(_resumeAfterBody) : shouldContinue.then(_resumeAfterTest)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterBody(value) {\n\t\tresult = value;\n\t\tfor (;;) {\n\t\t\tshouldContinue = test();\n\t\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\t\tshouldContinue = shouldContinue.v;\n\t\t\t}\n\t\t\tif (!shouldContinue) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\tresult = result.v;\n\t\t\t\t} else {\n\t\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t_settle(pact, 1, result);\n\t}\n\tfunction _resumeAfterTest(shouldContinue) {\n\t\tif (shouldContinue) {\n\t\t\tdo {\n\t\t\t\tresult = body();\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tshouldContinue = test();\n\t\t\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\t\t\tshouldContinue = shouldContinue.v;\n\t\t\t\t}\n\t\t\t\tif (!shouldContinue) {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} while (!shouldContinue.then);\n\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n}\n\n// Asynchronously implement a switch statement\nexport function _switch(discriminant, cases) {\n\tvar dispatchIndex = -1;\n\tvar awaitBody;\n\touter: {\n\t\tfor (var i = 0; i < cases.length; i++) {\n\t\t\tvar test = cases[i][0];\n\t\t\tif (test) {\n\t\t\t\tvar testValue = test();\n\t\t\t\tif (testValue && testValue.then) {\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\t\t\t\tif (testValue === discriminant) {\n\t\t\t\t\tdispatchIndex = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Found the default case, set it as the pending dispatch case\n\t\t\t\tdispatchIndex = i;\n\t\t\t}\n\t\t}\n\t\tif (dispatchIndex !== -1) {\n\t\t\tdo {\n\t\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\t\twhile (!body) {\n\t\t\t\t\tdispatchIndex++;\n\t\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t\t}\n\t\t\t\tvar result = body();\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tawaitBody = true;\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\t\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\t\tdispatchIndex++;\n\t\t\t} while (fallthroughCheck && !fallthroughCheck());\n\t\t\treturn result;\n\t\t}\n\t}\n\tconst pact = new _Pact();\n\tconst reject = _settle.bind(null, pact, 2);\n\t(awaitBody ? result.then(_resumeAfterBody) : testValue.then(_resumeAfterTest)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterTest(value) {\n\t\tfor (;;) {\n\t\t\tif (value === discriminant) {\n\t\t\t\tdispatchIndex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (++i === cases.length) {\n\t\t\t\tif (dispatchIndex !== -1) {\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttest = cases[i][0];\n\t\t\tif (test) {\n\t\t\t\tvalue = test();\n\t\t\t\tif (value && value.then) {\n\t\t\t\t\tvalue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdispatchIndex = i;\n\t\t\t}\n\t\t}\n\t\tdo {\n\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\twhile (!body) {\n\t\t\t\tdispatchIndex++;\n\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t}\n\t\t\tvar result = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\tdispatchIndex++;\n\t\t} while (fallthroughCheck && !fallthroughCheck());\n\t\t_settle(pact, 1, result);\n\t}\n\tfunction _resumeAfterBody(result) {\n\t\tfor (;;) {\n\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\tif (!fallthroughCheck || fallthroughCheck()) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdispatchIndex++;\n\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\twhile (!body) {\n\t\t\t\tdispatchIndex++;\n\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t_settle(pact, 1, result);\n\t}\n}\n\n// Asynchronously call a function and pass the result to explicitly passed continuations\nexport function _call(body, then, direct) {\n\tif (direct) {\n\t\treturn then ? then(body()) : body();\n\t}\n\ttry {\n\t\tvar result = Promise.resolve(body());\n\t\treturn then ? result.then(then) : result;\n\t} catch (e) {\n\t\treturn Promise.reject(e);\n\t}\n}\n\n// Asynchronously call a function and swallow the result\nexport function _callIgnored(body, direct) {\n\treturn _call(body, _empty, direct);\n}\n\n// Asynchronously call a function and pass the result to explicitly passed continuations\nexport function _invoke(body, then) {\n\tvar result = body();\n\tif (result && result.then) {\n\t\treturn result.then(then);\n\t}\n\treturn then(result);\n}\n\n// Asynchronously call a function and swallow the result\nexport function _invokeIgnored(body) {\n\tvar result = body();\n\tif (result && result.then) {\n\t\treturn result.then(_empty);\n\t}\n}\n\n// Asynchronously call a function and send errors to recovery continuation\nexport function _catch(body, recover) {\n\ttry {\n\t\tvar result = body();\n\t} catch(e) {\n\t\treturn recover(e);\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(void 0, recover);\n\t}\n\treturn result;\n}\n\n// Asynchronously await a promise and pass the result to a finally continuation\nexport function _finallyRethrows(body, finalizer) {\n\ttry {\n\t\tvar result = body();\n\t} catch (e) {\n\t\treturn finalizer(true, e);\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(finalizer.bind(null, false), finalizer.bind(null, true));\n\t}\n\treturn finalizer(false, result);\n}\n\n// Asynchronously await a promise and invoke a finally continuation that always overrides the result\nexport function _finally(body, finalizer) {\n\ttry {\n\t\tvar result = body();\n\t} catch (e) {\n\t\treturn finalizer();\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(finalizer, finalizer);\n\t}\n\treturn finalizer();\n}\n\n// Rethrow or return a value from a finally continuation\nexport function _rethrow(thrown, value) {\n\tif (thrown)\n\t\tthrow value;\n\treturn value;\n}\n\n// Empty function to implement break and other control flow that ignores asynchronous results\nexport function _empty() {\n}\n\n// Sentinel value for early returns in generators \nexport const _earlyReturn = /*#__PURE__*/ {};\n\n// Asynchronously call a function and send errors to recovery continuation, skipping early returns\nexport function _catchInGenerator(body, recover) {\n\treturn _catch(body, function(e) {\n\t\tif (e === _earlyReturn) {\n\t\t\tthrow e;\n\t\t}\n\t\treturn recover(e);\n\t});\n}\n\n// Asynchronous generator class; accepts the entrypoint of the generator, to which it passes itself when the generator should start\nexport const _AsyncGenerator = /*#__PURE__*/(function() {\n\tfunction _AsyncGenerator(entry) {\n\t\tthis._entry = entry;\n\t\tthis._pact = null;\n\t\tthis._resolve = null;\n\t\tthis._return = null;\n\t\tthis._promise = null;\n\t}\n\n\tfunction _wrapReturnedValue(value) {\n\t\treturn { value: value, done: true };\n\t}\n\tfunction _wrapYieldedValue(value) {\n\t\treturn { value: value, done: false };\n\t}\n\n\t_AsyncGenerator.prototype._yield = function(value) {\n\t\t// Yield the value to the pending next call\n\t\tthis._resolve(value && value.then ? value.then(_wrapYieldedValue) : _wrapYieldedValue(value));\n\t\t// Return a pact for an upcoming next/return/throw call\n\t\treturn this._pact = new _Pact();\n\t};\n\t_AsyncGenerator.prototype.next = function(value) {\n\t\t// Advance the generator, starting it if it has yet to be started\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tconst _entry = _this._entry;\n\t\t\t\tif (_entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the next call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Start the generator\n\t\t\t\t_this._entry = null;\n\t\t\t\t_this._resolve = resolve;\n\t\t\t\tfunction returnValue(value) {\n\t\t\t\t\t_this._resolve(value && value.then ? value.then(_wrapReturnedValue) : _wrapReturnedValue(value));\n\t\t\t\t\t_this._pact = null;\n\t\t\t\t\t_this._resolve = null;\n\t\t\t\t}\n\t\t\t\tvar result = _entry(_this);\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tresult.then(returnValue, function(error) {\n\t\t\t\t\t\tif (error === _earlyReturn) {\n\t\t\t\t\t\t\treturnValue(_this._return);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst pact = new _Pact();\n\t\t\t\t\t\t\t_this._resolve(pact);\n\t\t\t\t\t\t\t_this._pact = null;\n\t\t\t\t\t\t\t_this._resolve = null;\n\t\t\t\t\t\t\t_resolve(pact, 2, error);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\treturnValue(result);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Generator is started and a yield expression is pending, settle it\n\t\t\t\t_this._pact = null;\n\t\t\t\t_this._resolve = resolve;\n\t\t\t\t_settle(_pact, 1, value);\n\t\t\t}\n\t\t});\n\t};\n\t_AsyncGenerator.prototype.return = function(value) {\n\t\t// Early return from the generator if started, otherwise abandons the generator\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tif (_this._entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the return call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Generator is not started, abandon it and return the specified value\n\t\t\t\t_this._entry = null;\n\t\t\t\treturn resolve(value && value.then ? value.then(_wrapReturnedValue) : _wrapReturnedValue(value));\n\t\t\t}\n\t\t\t// Settle the yield expression with a rejected \"early return\" value\n\t\t\t_this._return = value;\n\t\t\t_this._resolve = resolve;\n\t\t\t_this._pact = null;\n\t\t\t_settle(_pact, 2, _earlyReturn);\n\t\t});\n\t};\n\t_AsyncGenerator.prototype.throw = function(error) {\n\t\t// Inject an exception into the pending yield expression\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve, reject) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tif (_this._entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the throw call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Generator is not started, abandon it and return a rejected Promise containing the error\n\t\t\t\t_this._entry = null;\n\t\t\t\treturn reject(error);\n\t\t\t}\n\t\t\t// Settle the yield expression with the value as a rejection\n\t\t\t_this._resolve = resolve;\n\t\t\t_this._pact = null;\n\t\t\t_settle(_pact, 2, error);\n\t\t});\n\t};\n\n\t_AsyncGenerator.prototype[_asyncIteratorSymbol] = function() {\n\t\treturn this;\n\t};\n\t\n\treturn _AsyncGenerator;\n})();\n","import React, { useState } from \"react\";\nimport { BarTask } from \"../../types/bar-task\";\nimport { Link } from \"../../types/public-types\";\n\ntype ArrowProps = {\n taskFrom: BarTask;\n taskTo: BarTask;\n rowHeight: number;\n taskHeight: number;\n arrowIndent: number;\n rtl: boolean;\n onClickLine?: (tasks: BarTask[]) => void;\n};\nexport const Arrow: React.FC = ({\n taskFrom,\n taskTo,\n rowHeight,\n taskHeight,\n arrowIndent,\n rtl,\n onClickLine,\n}) => {\n let path: string;\n let trianglePoints: string;\n const strokeWidthDefault = \"1.5\";\n const [strokeWidth, setStrokeWidth] = useState(strokeWidthDefault);\n \n if (rtl) {\n [path, trianglePoints] = drownPathAndTriangleRTL(\n taskFrom,\n taskTo,\n rowHeight,\n taskHeight,\n arrowIndent\n );\n } else {\n [path, trianglePoints] = drownPathAndTriangle(\n taskFrom,\n taskTo,\n rowHeight,\n taskHeight,\n arrowIndent\n );\n }\n\n const clickLine = () => {\n if (onClickLine) {\n onClickLine([taskFrom, taskTo]);\n }\n }\n\n return (\n setStrokeWidth(\"2\")} \n onMouseLeave={() => setStrokeWidth(strokeWidthDefault)} \n onClick={clickLine}>\n \n \n \n );\n};\n\nconst arrowToStart = (\n taskTo: BarTask,\n taskToEndPosition: number,\n ) => {\n return `${taskTo.x1},${taskToEndPosition} \n ${taskTo.x1 - 5},${taskToEndPosition - 5} \n ${taskTo.x1 - 5},${taskToEndPosition + 5}`;\n}\n\nconst arrowToEnd = (\n task: BarTask,\n taskToEndPosition: number,\n) => {\n return `${task.x2},${taskToEndPosition} \n ${task.x2 + 5},${taskToEndPosition + 5} \n ${task.x2 + 5},${taskToEndPosition - 5}`;\n}\n\nconst drownPathAndTriangle = (\n taskFrom: BarTask,\n taskTo: BarTask,\n rowHeight: number,\n taskHeight: number,\n arrowIndent: number\n) => {\n const indexCompare = taskFrom.index > taskTo.index ? -1 : 1;\n const taskToEndPosition = taskTo.y + taskHeight / 2;\n const taskFromEndPosition = taskFrom.x2 + arrowIndent * 2;\n const taskFromHorizontalOffsetValue =\n taskFromEndPosition < taskTo.x1 ? \"\" : `H ${taskTo.x1 - arrowIndent}`;\n const taskToHorizontalOffsetValue =\n taskFromEndPosition > taskTo.x1\n ? arrowIndent\n : taskTo.x1 - taskFrom.x2 - arrowIndent;\n\n const endToStartPath = () => {\n return `M ${taskFrom.x2} ${taskFrom.y + taskHeight / 2} \n h ${arrowIndent} \n v ${(indexCompare * rowHeight) / 2} \n ${taskFromHorizontalOffsetValue}\n V ${taskToEndPosition} \n h ${taskToHorizontalOffsetValue}`;\n }\n \n const startToEndPath = () => {\n return `M ${taskFrom.x1} ${taskFrom.y + taskHeight / 2} \n h ${-arrowIndent} \n v ${(indexCompare * rowHeight) / 2} \n ${taskFromEndPosition > taskTo.x2 + arrowIndent + 10 ? \"\" : `H ${taskTo.x2 + arrowIndent}`}\n V ${taskToEndPosition} \n h ${taskFromEndPosition < taskTo.x2\n ? -arrowIndent\n : taskTo.x2 - taskFrom.x1 - arrowIndent}`;\n }\n \n const endToEndPath = () => {\n return `M ${taskFrom.x2} ${taskFrom.y + taskHeight / 2} \n h ${arrowIndent} \n v ${(indexCompare * rowHeight) / 2} \n ${taskFromEndPosition > taskTo.x2 + arrowIndent + 10 ? \"\" : `H ${taskTo.x2 + arrowIndent}`}\n V ${taskToEndPosition} \n h ${taskFromEndPosition < taskTo.x2\n ? -arrowIndent\n : taskTo.x1 - taskFrom.x2 - arrowIndent}`;\n }\n \n const startToStartPath = () => {\n return `M ${taskFrom.x1} ${taskFrom.y + taskHeight / 2} \n h ${-arrowIndent} \n v ${(indexCompare * rowHeight) / 2} \n ${taskFromHorizontalOffsetValue}\n V ${taskToEndPosition} \n h ${taskFromEndPosition > taskTo.x1\n ? arrowIndent\n : taskTo.x2 - taskFrom.x1 - arrowIndent}`;\n }\n\n // default endToStart\n let trianglePoints = arrowToStart(taskTo, taskToEndPosition);\n let path = endToStartPath();\n\n if (taskTo?.links) {\n const startToEnd = taskTo?.links.find((link: Link) => link.type === \"StartToEnd\");\n const endToEnd = taskTo?.links.find((link: Link) => link.type === \"EndToEnd\");\n const startToStart = taskTo?.links.find((link: Link) => link.type === \"StartToStart\");\n\n if (startToEnd) {\n trianglePoints = arrowToEnd(taskTo, taskToEndPosition);\n path = startToEndPath();\n }\n\n if (endToEnd) {\n trianglePoints = arrowToEnd(taskTo, taskToEndPosition);\n path = endToEndPath();\n }\n\n if (startToStart) {\n trianglePoints = arrowToStart(taskTo, taskToEndPosition);\n path = startToStartPath();\n }\n\n }\n\n return [path, trianglePoints];\n};\n\nconst drownPathAndTriangleRTL = (\n taskFrom: BarTask,\n taskTo: BarTask,\n rowHeight: number,\n taskHeight: number,\n arrowIndent: number\n) => {\n const indexCompare = taskFrom.index > taskTo.index ? -1 : 1;\n const taskToEndPosition = taskTo.y + taskHeight / 2;\n const taskFromEndPosition = taskFrom.x1 - arrowIndent * 2;\n const taskFromHorizontalOffsetValue =\n taskFromEndPosition > taskTo.x2 ? \"\" : `H ${taskTo.x2 + arrowIndent}`;\n const taskToHorizontalOffsetValue =\n taskFromEndPosition < taskTo.x2\n ? -arrowIndent\n : taskTo.x2 - taskFrom.x1 + arrowIndent;\n\n const path = `M ${taskFrom.x1} ${taskFrom.y + taskHeight / 2} \n h ${-arrowIndent} \n v ${(indexCompare * rowHeight) / 2} \n ${taskFromHorizontalOffsetValue}\n V ${taskToEndPosition} \n h ${taskToHorizontalOffsetValue}`;\n\n const trianglePoints = `${taskTo.x2},${taskToEndPosition} \n ${taskTo.x2 + 5},${taskToEndPosition + 5} \n ${taskTo.x2 + 5},${taskToEndPosition - 5}`;\n return [path, trianglePoints];\n};\n","import { Task } from \"../types/public-types\";\nimport { BarTask, TaskTypeInternal } from \"../types/bar-task\";\nimport { BarMoveAction } from \"../types/gantt-task-actions\";\n\nexport const convertToBarTasks = (\n tasks: Task[],\n dates: Date[],\n columnWidth: number,\n rowHeight: number,\n taskHeight: number,\n barCornerRadius: number,\n handleWidth: number,\n rtl: boolean,\n barProgressColor: string,\n barProgressSelectedColor: string,\n barBackgroundColor: string,\n barBackgroundSelectedColor: string,\n projectProgressColor: string,\n projectProgressSelectedColor: string,\n projectBackgroundColor: string,\n projectBackgroundSelectedColor: string,\n milestoneBackgroundColor: string,\n milestoneBackgroundSelectedColor: string\n) => {\n let barTasks = tasks.map((t, i) => {\n return convertToBarTask(\n t,\n i,\n dates,\n columnWidth,\n rowHeight,\n taskHeight,\n barCornerRadius,\n handleWidth,\n rtl,\n barProgressColor,\n barProgressSelectedColor,\n barBackgroundColor,\n barBackgroundSelectedColor,\n projectProgressColor,\n projectProgressSelectedColor,\n projectBackgroundColor,\n projectBackgroundSelectedColor,\n milestoneBackgroundColor,\n milestoneBackgroundSelectedColor\n );\n });\n\n // set dependencies\n barTasks = barTasks.map(task => {\n const dependencies = task.dependencies || [];\n for (let j = 0; j < dependencies.length; j++) {\n const dependence = barTasks.findIndex(\n value => value.id === dependencies[j]\n );\n if (dependence !== -1) barTasks[dependence].barChildren.push(task);\n }\n return task;\n });\n\n return barTasks;\n};\n\nconst convertToBarTask = (\n task: Task,\n index: number,\n dates: Date[],\n columnWidth: number,\n rowHeight: number,\n taskHeight: number,\n barCornerRadius: number,\n handleWidth: number,\n rtl: boolean,\n barProgressColor: string,\n barProgressSelectedColor: string,\n barBackgroundColor: string,\n barBackgroundSelectedColor: string,\n projectProgressColor: string,\n projectProgressSelectedColor: string,\n projectBackgroundColor: string,\n projectBackgroundSelectedColor: string,\n milestoneBackgroundColor: string,\n milestoneBackgroundSelectedColor: string\n): BarTask => {\n let barTask: BarTask;\n switch (task.type) {\n case \"milestone\":\n barTask = convertToMilestone(\n task,\n index,\n dates,\n columnWidth,\n rowHeight,\n taskHeight,\n barCornerRadius,\n handleWidth,\n milestoneBackgroundColor,\n milestoneBackgroundSelectedColor\n );\n break;\n case \"project\":\n barTask = convertToBar(\n task,\n index,\n dates,\n columnWidth,\n rowHeight,\n taskHeight,\n barCornerRadius,\n handleWidth,\n rtl,\n projectProgressColor,\n projectProgressSelectedColor,\n projectBackgroundColor,\n projectBackgroundSelectedColor\n );\n break;\n default:\n barTask = convertToBar(\n task,\n index,\n dates,\n columnWidth,\n rowHeight,\n taskHeight,\n barCornerRadius,\n handleWidth,\n rtl,\n barProgressColor,\n barProgressSelectedColor,\n barBackgroundColor,\n barBackgroundSelectedColor\n );\n break;\n }\n return barTask;\n};\n\nconst convertToBar = (\n task: Task,\n index: number,\n dates: Date[],\n columnWidth: number,\n rowHeight: number,\n taskHeight: number,\n barCornerRadius: number,\n handleWidth: number,\n rtl: boolean,\n barProgressColor: string,\n barProgressSelectedColor: string,\n barBackgroundColor: string,\n barBackgroundSelectedColor: string\n): BarTask => {\n let x1: number;\n let x2: number;\n if (rtl) {\n x2 = taskXCoordinateRTL(task.start, dates, columnWidth);\n x1 = taskXCoordinateRTL(task.end, dates, columnWidth);\n } else {\n x1 = taskXCoordinate(task.start, dates, columnWidth);\n x2 = taskXCoordinate(task.end, dates, columnWidth);\n }\n let typeInternal: TaskTypeInternal = task.type;\n if (typeInternal === \"task\" && x2 - x1 < handleWidth * 2) {\n typeInternal = \"smalltask\";\n x2 = x1 + handleWidth * 2;\n }\n\n const [progressWidth, progressX] = progressWithByParams(\n x1,\n x2,\n task.progress,\n rtl\n );\n const y = taskYCoordinate(index, rowHeight, taskHeight);\n const hideChildren = task.type === \"project\" ? task.hideChildren : undefined;\n\n const styles = {\n backgroundColor: barBackgroundColor,\n backgroundSelectedColor: barBackgroundSelectedColor,\n progressColor: barProgressColor,\n progressSelectedColor: barProgressSelectedColor,\n ...task.styles,\n };\n return {\n ...task,\n typeInternal,\n x1,\n x2,\n y,\n index,\n progressX,\n progressWidth,\n barCornerRadius,\n handleWidth,\n hideChildren,\n height: taskHeight,\n barChildren: [],\n styles,\n };\n};\n\nconst convertToMilestone = (\n task: Task,\n index: number,\n dates: Date[],\n columnWidth: number,\n rowHeight: number,\n taskHeight: number,\n barCornerRadius: number,\n handleWidth: number,\n milestoneBackgroundColor: string,\n milestoneBackgroundSelectedColor: string\n): BarTask => {\n const x = taskXCoordinate(task.start, dates, columnWidth);\n const y = taskYCoordinate(index, rowHeight, taskHeight);\n\n const x1 = x - taskHeight * 0.5;\n const x2 = x + taskHeight * 0.5;\n\n const rotatedHeight = taskHeight / 1.414;\n const styles = {\n backgroundColor: milestoneBackgroundColor,\n backgroundSelectedColor: milestoneBackgroundSelectedColor,\n progressColor: \"\",\n progressSelectedColor: \"\",\n ...task.styles,\n };\n return {\n ...task,\n end: task.start,\n x1,\n x2,\n y,\n index,\n progressX: 0,\n progressWidth: 0,\n barCornerRadius,\n handleWidth,\n typeInternal: task.type,\n progress: 0,\n height: rotatedHeight,\n hideChildren: undefined,\n barChildren: [],\n styles,\n };\n};\n\nconst taskXCoordinate = (xDate: Date, dates: Date[], columnWidth: number) => {\n const index = dates.findIndex(d => d.getTime() >= xDate.getTime()) - 1;\n\n const remainderMillis = xDate.getTime() - dates[index].getTime();\n const percentOfInterval =\n remainderMillis / (dates[index + 1].getTime() - dates[index].getTime());\n const x = index * columnWidth + percentOfInterval * columnWidth;\n return x;\n};\nconst taskXCoordinateRTL = (\n xDate: Date,\n dates: Date[],\n columnWidth: number\n) => {\n let x = taskXCoordinate(xDate, dates, columnWidth);\n x += columnWidth;\n return x;\n};\nconst taskYCoordinate = (\n index: number,\n rowHeight: number,\n taskHeight: number\n) => {\n const y = index * rowHeight + (rowHeight - taskHeight) / 2;\n return y;\n};\n\nexport const progressWithByParams = (\n taskX1: number,\n taskX2: number,\n progress: number,\n rtl: boolean\n) => {\n const progressWidth = (taskX2 - taskX1) * progress * 0.01;\n let progressX: number;\n if (rtl) {\n progressX = taskX2 - progressWidth;\n } else {\n progressX = taskX1;\n }\n return [progressWidth, progressX];\n};\n\nexport const progressByProgressWidth = (\n progressWidth: number,\n barTask: BarTask\n) => {\n const barWidth = barTask.x2 - barTask.x1;\n const progressPercent = Math.round((progressWidth * 100) / barWidth);\n if (progressPercent >= 100) return 100;\n else if (progressPercent <= 0) return 0;\n else return progressPercent;\n};\n\nconst progressByX = (x: number, task: BarTask) => {\n if (x >= task.x2) return 100;\n else if (x <= task.x1) return 0;\n else {\n const barWidth = task.x2 - task.x1;\n const progressPercent = Math.round(((x - task.x1) * 100) / barWidth);\n return progressPercent;\n }\n};\nconst progressByXRTL = (x: number, task: BarTask) => {\n if (x >= task.x2) return 0;\n else if (x <= task.x1) return 100;\n else {\n const barWidth = task.x2 - task.x1;\n const progressPercent = Math.round(((task.x2 - x) * 100) / barWidth);\n return progressPercent;\n }\n};\n\nexport const getProgressPoint = (\n progressX: number,\n taskY: number,\n taskHeight: number\n) => {\n const point = [\n progressX - 5,\n taskY + taskHeight,\n progressX + 5,\n taskY + taskHeight,\n progressX,\n taskY + taskHeight - 8.66,\n ];\n return point.join(\",\");\n};\n\nconst startByX = (x: number, xStep: number, task: BarTask) => {\n if (x >= task.x2 - task.handleWidth * 2) {\n x = task.x2 - task.handleWidth * 2;\n }\n const steps = Math.round((x - task.x1) / xStep);\n const additionalXValue = steps * xStep;\n const newX = task.x1 + additionalXValue;\n return newX;\n};\n\nconst endByX = (x: number, xStep: number, task: BarTask) => {\n if (x <= task.x1 + task.handleWidth * 2) {\n x = task.x1 + task.handleWidth * 2;\n }\n const steps = Math.round((x - task.x2) / xStep);\n const additionalXValue = steps * xStep;\n const newX = task.x2 + additionalXValue;\n return newX;\n};\n\nconst moveByX = (x: number, xStep: number, task: BarTask) => {\n const steps = Math.round((x - task.x1) / xStep);\n const additionalXValue = steps * xStep;\n const newX1 = task.x1 + additionalXValue;\n const newX2 = newX1 + task.x2 - task.x1;\n return [newX1, newX2];\n};\n\nconst dateByX = (\n x: number,\n taskX: number,\n taskDate: Date,\n xStep: number,\n timeStep: number\n) => {\n let newDate = new Date(((x - taskX) / xStep) * timeStep + taskDate.getTime());\n newDate = new Date(\n newDate.getTime() +\n (newDate.getTimezoneOffset() - taskDate.getTimezoneOffset()) * 60000\n );\n return newDate;\n};\n\n/**\n * Method handles event in real time(mousemove) and on finish(mouseup)\n */\nexport const handleTaskBySVGMouseEvent = (\n svgX: number,\n action: BarMoveAction,\n selectedTask: BarTask,\n xStep: number,\n timeStep: number,\n initEventX1Delta: number,\n rtl: boolean\n): { isChanged: boolean; changedTask: BarTask } => {\n let result: { isChanged: boolean; changedTask: BarTask };\n switch (selectedTask.type) {\n case \"milestone\":\n result = handleTaskBySVGMouseEventForMilestone(\n svgX,\n action,\n selectedTask,\n xStep,\n timeStep,\n initEventX1Delta\n );\n break;\n default:\n result = handleTaskBySVGMouseEventForBar(\n svgX,\n action,\n selectedTask,\n xStep,\n timeStep,\n initEventX1Delta,\n rtl\n );\n break;\n }\n return result;\n};\n\nconst handleTaskBySVGMouseEventForBar = (\n svgX: number,\n action: BarMoveAction,\n selectedTask: BarTask,\n xStep: number,\n timeStep: number,\n initEventX1Delta: number,\n rtl: boolean\n): { isChanged: boolean; changedTask: BarTask } => {\n const changedTask: BarTask = { ...selectedTask };\n let isChanged = false;\n switch (action) {\n case \"progress\":\n if (rtl) {\n changedTask.progress = progressByXRTL(svgX, selectedTask);\n } else {\n changedTask.progress = progressByX(svgX, selectedTask);\n }\n isChanged = changedTask.progress !== selectedTask.progress;\n if (isChanged) {\n const [progressWidth, progressX] = progressWithByParams(\n changedTask.x1,\n changedTask.x2,\n changedTask.progress,\n rtl\n );\n changedTask.progressWidth = progressWidth;\n changedTask.progressX = progressX;\n }\n break;\n case \"start\": {\n const newX1 = startByX(svgX, xStep, selectedTask);\n changedTask.x1 = newX1;\n isChanged = changedTask.x1 !== selectedTask.x1;\n if (isChanged) {\n if (rtl) {\n changedTask.end = dateByX(\n newX1,\n selectedTask.x1,\n selectedTask.end,\n xStep,\n timeStep\n );\n } else {\n changedTask.start = dateByX(\n newX1,\n selectedTask.x1,\n selectedTask.start,\n xStep,\n timeStep\n );\n }\n const [progressWidth, progressX] = progressWithByParams(\n changedTask.x1,\n changedTask.x2,\n changedTask.progress,\n rtl\n );\n changedTask.progressWidth = progressWidth;\n changedTask.progressX = progressX;\n }\n break;\n }\n case \"end\": {\n const newX2 = endByX(svgX, xStep, selectedTask);\n changedTask.x2 = newX2;\n isChanged = changedTask.x2 !== selectedTask.x2;\n if (isChanged) {\n if (rtl) {\n changedTask.start = dateByX(\n newX2,\n selectedTask.x2,\n selectedTask.start,\n xStep,\n timeStep\n );\n } else {\n changedTask.end = dateByX(\n newX2,\n selectedTask.x2,\n selectedTask.end,\n xStep,\n timeStep\n );\n }\n const [progressWidth, progressX] = progressWithByParams(\n changedTask.x1,\n changedTask.x2,\n changedTask.progress,\n rtl\n );\n changedTask.progressWidth = progressWidth;\n changedTask.progressX = progressX;\n }\n break;\n }\n case \"move\": {\n const [newMoveX1, newMoveX2] = moveByX(\n svgX - initEventX1Delta,\n xStep,\n selectedTask\n );\n isChanged = newMoveX1 !== selectedTask.x1;\n if (isChanged) {\n changedTask.start = dateByX(\n newMoveX1,\n selectedTask.x1,\n selectedTask.start,\n xStep,\n timeStep\n );\n changedTask.end = dateByX(\n newMoveX2,\n selectedTask.x2,\n selectedTask.end,\n xStep,\n timeStep\n );\n changedTask.x1 = newMoveX1;\n changedTask.x2 = newMoveX2;\n const [progressWidth, progressX] = progressWithByParams(\n changedTask.x1,\n changedTask.x2,\n changedTask.progress,\n rtl\n );\n changedTask.progressWidth = progressWidth;\n changedTask.progressX = progressX;\n }\n break;\n }\n }\n return { isChanged, changedTask };\n};\n\nconst handleTaskBySVGMouseEventForMilestone = (\n svgX: number,\n action: BarMoveAction,\n selectedTask: BarTask,\n xStep: number,\n timeStep: number,\n initEventX1Delta: number\n): { isChanged: boolean; changedTask: BarTask } => {\n const changedTask: BarTask = { ...selectedTask };\n let isChanged = false;\n switch (action) {\n case \"move\": {\n const [newMoveX1, newMoveX2] = moveByX(\n svgX - initEventX1Delta,\n xStep,\n selectedTask\n );\n isChanged = newMoveX1 !== selectedTask.x1;\n if (isChanged) {\n changedTask.start = dateByX(\n newMoveX1,\n selectedTask.x1,\n selectedTask.start,\n xStep,\n timeStep\n );\n changedTask.end = changedTask.start;\n changedTask.x1 = newMoveX1;\n changedTask.x2 = newMoveX2;\n }\n break;\n }\n }\n return { isChanged, changedTask };\n};\n","import { BarTask } from \"../types/bar-task\";\nimport { Task } from \"../types/public-types\";\n\nexport function isKeyboardEvent(\n event: React.MouseEvent | React.KeyboardEvent | React.FocusEvent\n): event is React.KeyboardEvent {\n return (event as React.KeyboardEvent).key !== undefined;\n}\n\nexport function isMouseEvent(\n event: React.MouseEvent | React.KeyboardEvent | React.FocusEvent\n): event is React.MouseEvent {\n return (event as React.MouseEvent).clientX !== undefined;\n}\n\nexport function isBarTask(task: Task | BarTask): task is BarTask {\n return (task as BarTask).x1 !== undefined;\n}\n\nexport function removeHiddenTasks(tasks: Task[]) {\n const groupedTasks = tasks.filter(\n t => t.hideChildren && t.type === \"project\"\n );\n if (groupedTasks.length > 0) {\n for (let i = 0; groupedTasks.length > i; i++) {\n const groupedTask = groupedTasks[i];\n const children = getChildren(tasks, groupedTask);\n tasks = tasks.filter(t => children.indexOf(t) === -1);\n }\n }\n return tasks;\n}\n\nfunction getChildren(taskList: Task[], task: Task) {\n let tasks: Task[] = [];\n if (task.type !== \"project\") {\n tasks = taskList.filter(\n t => t.dependencies && t.dependencies.indexOf(task.id) !== -1\n );\n } else {\n tasks = taskList.filter(t => t.project && t.project === task.id);\n }\n var taskChildren: Task[] = [];\n tasks.forEach(t => {\n taskChildren.push(...getChildren(taskList, t));\n })\n tasks = tasks.concat(tasks, taskChildren);\n return tasks;\n}\n\nexport const sortTasks = (taskA: Task, taskB: Task) => {\n const orderA = taskA.displayOrder || Number.MAX_VALUE;\n const orderB = taskB.displayOrder || Number.MAX_VALUE;\n if (orderA > orderB) {\n return 1;\n } else if (orderA < orderB) {\n return -1;\n } else {\n return 0;\n }\n};\n","import React from \"react\";\nimport style from \"./bar.module.css\";\n\ntype BarDisplayProps = {\n x: number;\n y: number;\n width: number;\n height: number;\n isSelected: boolean;\n /* progress start point */\n progressX: number;\n progressWidth: number;\n barCornerRadius: number;\n styles: {\n backgroundColor: string;\n backgroundSelectedColor: string;\n progressColor: string;\n progressSelectedColor: string;\n };\n onMouseDown: (event: React.MouseEvent) => void;\n};\nexport const BarDisplay: React.FC = ({\n x,\n y,\n width,\n height,\n isSelected,\n progressX,\n progressWidth,\n barCornerRadius,\n styles,\n onMouseDown,\n}) => {\n const getProcessColor = () => {\n return isSelected ? styles.progressSelectedColor : styles.progressColor;\n };\n\n const getBarColor = () => {\n return isSelected ? styles.backgroundSelectedColor : styles.backgroundColor;\n };\n\n return (\n \n \n \n \n );\n};\n","import React from \"react\";\nimport styles from \"./bar.module.css\";\n\ntype BarDateHandleProps = {\n x: number;\n y: number;\n width: number;\n height: number;\n barCornerRadius: number;\n onMouseDown: (event: React.MouseEvent) => void;\n};\nexport const BarDateHandle: React.FC = ({\n x,\n y,\n width,\n height,\n barCornerRadius,\n onMouseDown,\n}) => {\n return (\n \n );\n};\n","import React from \"react\";\nimport styles from \"./bar.module.css\";\n\ntype BarProgressHandleProps = {\n progressPoint: string;\n onMouseDown: (event: React.MouseEvent) => void;\n};\nexport const BarProgressHandle: React.FC = ({\n progressPoint,\n onMouseDown,\n}) => {\n return (\n \n );\n};\n","import React from \"react\";\nimport { getProgressPoint } from \"../../../helpers/bar-helper\";\nimport { BarDisplay } from \"./bar-display\";\nimport { BarDateHandle } from \"./bar-date-handle\";\nimport { BarProgressHandle } from \"./bar-progress-handle\";\nimport { TaskItemProps } from \"../task-item\";\nimport styles from \"./bar.module.css\";\n\nexport const Bar: React.FC = ({\n task,\n isProgressChangeable,\n isDateChangeable,\n rtl,\n onEventStart,\n isSelected,\n}) => {\n const progressPoint = getProgressPoint(\n +!rtl * task.progressWidth + task.progressX,\n task.y,\n task.height\n );\n const handleHeight = task.height - 2;\n return (\n \n {\n isDateChangeable && onEventStart(\"move\", task, e);\n }}\n />\n \n {isDateChangeable && (\n \n {/* left */}\n {\n onEventStart(\"start\", task, e);\n }}\n />\n {/* right */}\n {\n onEventStart(\"end\", task, e);\n }}\n />\n \n )}\n {isProgressChangeable && (\n {\n onEventStart(\"progress\", task, e);\n }}\n />\n )}\n \n \n );\n};\n","import React from \"react\";\nimport { getProgressPoint } from \"../../../helpers/bar-helper\";\nimport { BarDisplay } from \"./bar-display\";\nimport { BarProgressHandle } from \"./bar-progress-handle\";\nimport { TaskItemProps } from \"../task-item\";\nimport styles from \"./bar.module.css\";\n\nexport const BarSmall: React.FC = ({\n task,\n isProgressChangeable,\n isDateChangeable,\n onEventStart,\n isSelected,\n}) => {\n const progressPoint = getProgressPoint(\n task.progressWidth + task.x1,\n task.y,\n task.height\n );\n return (\n \n {\n isDateChangeable && onEventStart(\"move\", task, e);\n }}\n />\n \n {isProgressChangeable && (\n {\n onEventStart(\"progress\", task, e);\n }}\n />\n )}\n \n \n );\n};\n","import React from \"react\";\nimport { TaskItemProps } from \"../task-item\";\nimport styles from \"./milestone.module.css\";\n\nexport const Milestone: React.FC = ({\n task,\n isDateChangeable,\n onEventStart,\n isSelected,\n}) => {\n const transform = `rotate(45 ${task.x1 + task.height * 0.356} \n ${task.y + task.height * 0.85})`;\n const getBarColor = () => {\n return isSelected\n ? task.styles.backgroundSelectedColor\n : task.styles.backgroundColor;\n };\n\n return (\n \n {\n isDateChangeable && onEventStart(\"move\", task, e);\n }}\n />\n \n );\n};\n","import React from \"react\";\nimport { TaskItemProps } from \"../task-item\";\nimport styles from \"./project.module.css\";\n\nexport const Project: React.FC = ({ task, isSelected, onMouseDown }) => {\n const barColor = isSelected\n ? task.styles.backgroundSelectedColor\n : task.styles.backgroundColor;\n const processColor = isSelected\n ? task.styles.progressSelectedColor\n : task.styles.progressColor;\n const projectWith = task.x2 - task.x1;\n\n const projectLeftTriangle = [\n task.x1,\n task.y + task.height / 2 - 1,\n task.x1,\n task.y + task.height,\n task.x1 + 15,\n task.y + task.height / 2 - 1,\n ].join(\",\");\n const projectRightTriangle = [\n task.x2,\n task.y + task.height / 2 - 1,\n task.x2,\n task.y + task.height,\n task.x2 - 15,\n task.y + task.height / 2 - 1,\n ].join(\",\");\n\n return (\n \n \n \n \n \n \n \n );\n};\n","import React, { useEffect, useRef, useState } from \"react\";\nimport { BarTask } from \"../../types/bar-task\";\nimport { GanttContentMoveAction } from \"../../types/gantt-task-actions\";\nimport { Bar } from \"./bar/bar\";\nimport { BarSmall } from \"./bar/bar-small\";\nimport { Milestone } from \"./milestone/milestone\";\nimport { Project } from \"./project/project\";\nimport style from \"./task-list.module.css\";\n\nexport type TaskItemProps = {\n task: BarTask;\n arrowIndent: number;\n taskHeight: number;\n isProgressChangeable: boolean;\n isDateChangeable: boolean;\n isDelete: boolean;\n isSelected: boolean;\n rtl: boolean;\n allowProjectDateChange?: boolean;\n onEventStart: (\n action: GanttContentMoveAction,\n selectedTask: BarTask,\n event?: React.MouseEvent | React.KeyboardEvent\n ) => any;\n onMouseDown?: (event: React.MouseEvent) => void;\n};\n\nexport const TaskItem: React.FC = props => {\n const {\n task,\n arrowIndent,\n isDelete,\n taskHeight,\n isSelected,\n isDateChangeable,\n rtl,\n allowProjectDateChange,\n onEventStart,\n } = {\n ...props,\n };\n const textRef = useRef(null);\n const [taskItem, setTaskItem] = useState();\n const [isTextInside, setIsTextInside] = useState(true);\n\n useEffect(() => {\n switch (task.typeInternal) {\n case \"milestone\":\n setTaskItem();\n break;\n case \"project\":\n setTaskItem( \n isDateChangeable && allowProjectDateChange && onEventStart(\"move\", task, e)\n } {...props} />);\n break;\n case \"smalltask\":\n setTaskItem();\n break;\n default:\n setTaskItem();\n break;\n }\n }, [task, isSelected]);\n\n useEffect(() => {\n if (textRef.current) {\n setIsTextInside(textRef.current.getBBox().width < task.x2 - task.x1);\n }\n }, [textRef, task]);\n\n const getX = () => {\n const width = task.x2 - task.x1;\n const hasChild = task.barChildren.length > 0;\n if (isTextInside) {\n return task.x1 + width * 0.5;\n }\n if (rtl && textRef.current) {\n return (\n task.x1 -\n textRef.current.getBBox().width -\n arrowIndent * +hasChild -\n arrowIndent * 0.2\n );\n } else {\n return task.x1 + width + arrowIndent * +hasChild + arrowIndent * 0.2;\n }\n };\n\n return (\n {\n switch (e.key) {\n case \"Delete\": {\n if (isDelete) onEventStart(\"delete\", task, e);\n break;\n }\n }\n e.stopPropagation();\n }}\n onMouseEnter={e => {\n onEventStart(\"mouseenter\", task, e);\n }}\n onMouseLeave={e => {\n onEventStart(\"mouseleave\", task, e);\n }}\n onDoubleClick={e => {\n onEventStart(\"dblclick\", task, e);\n }}\n onClick={e => {\n onEventStart(\"click\", task, e);\n }}\n onFocus={() => {\n onEventStart(\"select\", task);\n }}\n >\n {taskItem}\n \n {task.name}\n \n \n );\n};\n","import React, { useEffect, useState } from \"react\";\nimport { EventOption } from \"../../types/public-types\";\nimport { BarTask } from \"../../types/bar-task\";\nimport { Arrow } from \"../other/arrow\";\nimport { handleTaskBySVGMouseEvent } from \"../../helpers/bar-helper\";\nimport { isKeyboardEvent } from \"../../helpers/other-helper\";\nimport { TaskItem } from \"../task-item/task-item\";\nimport {\n BarMoveAction,\n GanttContentMoveAction,\n GanttEvent,\n} from \"../../types/gantt-task-actions\";\n\nexport type TaskGanttContentProps = {\n tasks: BarTask[];\n dates: Date[];\n ganttEvent: GanttEvent;\n selectedTask: BarTask | undefined;\n rowHeight: number;\n columnWidth: number;\n timeStep: number;\n svg?: React.RefObject;\n svgWidth: number;\n taskHeight: number;\n arrowColor: string;\n arrowIndent: number;\n fontSize: string;\n fontFamily: string;\n rtl: boolean;\n setGanttEvent: (value: GanttEvent) => void;\n setFailedTask: (value: BarTask | null) => void;\n setSelectedTask: (taskId: string) => void;\n} & EventOption;\n\nexport const TaskGanttContent: React.FC = ({\n tasks,\n dates,\n ganttEvent,\n selectedTask,\n rowHeight,\n columnWidth,\n timeStep,\n svg,\n taskHeight,\n arrowColor,\n arrowIndent,\n fontFamily,\n fontSize,\n rtl,\n setGanttEvent,\n setFailedTask,\n setSelectedTask,\n onDateChange,\n onProgressChange,\n onDoubleClick,\n onClick,\n onClickLine,\n onDelete,\n allowProjectDateChange,\n}) => {\n const point = svg?.current?.createSVGPoint();\n const [xStep, setXStep] = useState(0);\n const [initEventX1Delta, setInitEventX1Delta] = useState(0);\n const [isMoving, setIsMoving] = useState(false);\n\n // create xStep\n useEffect(() => {\n const dateDelta =\n dates[1].getTime() -\n dates[0].getTime() -\n dates[1].getTimezoneOffset() * 60 * 1000 +\n dates[0].getTimezoneOffset() * 60 * 1000;\n const newXStep = (timeStep * columnWidth) / dateDelta;\n setXStep(newXStep);\n }, [columnWidth, dates, timeStep]);\n\n useEffect(() => {\n const handleMouseMove = async (event: MouseEvent) => {\n if (!ganttEvent.changedTask || !point || !svg?.current) return;\n event.preventDefault();\n\n point.x = event.clientX;\n const cursor = point.matrixTransform(\n svg?.current.getScreenCTM()?.inverse()\n );\n\n const { isChanged, changedTask } = handleTaskBySVGMouseEvent(\n cursor.x,\n ganttEvent.action as BarMoveAction,\n ganttEvent.changedTask,\n xStep,\n timeStep,\n initEventX1Delta,\n rtl\n );\n if (isChanged) {\n setGanttEvent({ action: ganttEvent.action, changedTask });\n }\n };\n\n const handleMouseUp = async (event: MouseEvent) => {\n const { action, originalSelectedTask, changedTask } = ganttEvent;\n if (!changedTask || !point || !svg?.current || !originalSelectedTask)\n return;\n event.preventDefault();\n\n point.x = event.clientX;\n const cursor = point.matrixTransform(\n svg?.current.getScreenCTM()?.inverse()\n );\n const { changedTask: newChangedTask } = handleTaskBySVGMouseEvent(\n cursor.x,\n action as BarMoveAction,\n changedTask,\n xStep,\n timeStep,\n initEventX1Delta,\n rtl\n );\n\n const isNotLikeOriginal =\n originalSelectedTask.start !== newChangedTask.start ||\n originalSelectedTask.end !== newChangedTask.end ||\n originalSelectedTask.progress !== newChangedTask.progress;\n\n // remove listeners\n svg.current.removeEventListener(\"mousemove\", handleMouseMove);\n svg.current.removeEventListener(\"mouseup\", handleMouseUp);\n setGanttEvent({ action: \"\" });\n setIsMoving(false);\n\n // custom operation start\n let operationSuccess = true;\n if (\n (action === \"move\" || action === \"end\" || action === \"start\") &&\n onDateChange &&\n isNotLikeOriginal\n ) {\n try {\n const result = await onDateChange(\n newChangedTask,\n newChangedTask.barChildren\n );\n if (result !== undefined) {\n operationSuccess = result;\n }\n } catch (error) {\n operationSuccess = false;\n }\n } else if (onProgressChange && isNotLikeOriginal) {\n try {\n const result = await onProgressChange(\n newChangedTask,\n newChangedTask.barChildren\n );\n if (result !== undefined) {\n operationSuccess = result;\n }\n } catch (error) {\n operationSuccess = false;\n }\n }\n\n // If operation is failed - return old state\n if (!operationSuccess) {\n setFailedTask(originalSelectedTask);\n }\n };\n\n if (\n !isMoving &&\n (ganttEvent.action === \"move\" ||\n ganttEvent.action === \"end\" ||\n ganttEvent.action === \"start\" ||\n ganttEvent.action === \"progress\") &&\n svg?.current\n ) {\n svg.current.addEventListener(\"mousemove\", handleMouseMove);\n svg.current.addEventListener(\"mouseup\", handleMouseUp);\n setIsMoving(true);\n }\n }, [\n ganttEvent,\n xStep,\n initEventX1Delta,\n onProgressChange,\n timeStep,\n onDateChange,\n svg,\n isMoving,\n point,\n rtl,\n setFailedTask,\n setGanttEvent,\n ]);\n\n /**\n * Method is Start point of task change\n */\n const handleBarEventStart = async (\n action: GanttContentMoveAction,\n task: BarTask,\n event?: React.MouseEvent | React.KeyboardEvent\n ) => {\n if (!event) {\n if (action === \"select\") {\n setSelectedTask(task.id);\n }\n }\n // Keyboard events\n else if (isKeyboardEvent(event)) {\n if (action === \"delete\") {\n if (onDelete) {\n try {\n const result = await onDelete(task);\n if (result !== undefined && result) {\n setGanttEvent({ action, changedTask: task });\n }\n } catch (error) {\n console.error(\"Error on Delete. \" + error);\n }\n }\n }\n }\n // Mouse Events\n else if (action === \"mouseenter\") {\n if (!ganttEvent.action) {\n setGanttEvent({\n action,\n changedTask: task,\n originalSelectedTask: task,\n });\n }\n } else if (action === \"mouseleave\") {\n if (ganttEvent.action === \"mouseenter\") {\n setGanttEvent({ action: \"\" });\n }\n } else if (action === \"dblclick\") {\n !!onDoubleClick && onDoubleClick(task);\n } else if (action === \"click\") {\n !!onClick && onClick(task);\n }\n // Change task event start\n else if (action === \"move\") {\n if (!svg?.current || !point) return;\n point.x = event.clientX;\n const cursor = point.matrixTransform(\n svg.current.getScreenCTM()?.inverse()\n );\n setInitEventX1Delta(cursor.x - task.x1);\n setGanttEvent({\n action,\n changedTask: task,\n originalSelectedTask: task,\n });\n } else {\n setGanttEvent({\n action,\n changedTask: task,\n originalSelectedTask: task,\n });\n }\n };\n\n return (\n \n \n {tasks.map(task => {\n return task.barChildren.map(child => {\n return (\n onClickLine ? onClickLine(tasks) : null}\n key={`Arrow from ${task.id} to ${tasks[child.index].id}`}\n taskFrom={task}\n taskTo={tasks[child.index]}\n rowHeight={rowHeight}\n taskHeight={taskHeight}\n arrowIndent={arrowIndent}\n rtl={rtl}\n />\n );\n });\n })}\n \n \n {tasks.map(task => {\n return (\n \n );\n })}\n \n \n );\n};\n","import React, { useRef, useEffect } from \"react\";\nimport { GridProps, Grid } from \"../grid/grid\";\nimport { CalendarProps, Calendar } from \"../calendar/calendar\";\nimport { TaskGanttContentProps, TaskGanttContent } from \"./task-gantt-content\";\nimport styles from \"./gantt.module.css\";\n\nexport type TaskGanttProps = {\n gridProps: GridProps;\n calendarProps: CalendarProps;\n barProps: TaskGanttContentProps;\n ganttHeight: number;\n scrollY: number;\n scrollX: number;\n};\nexport const TaskGantt: React.FC = ({\n gridProps,\n calendarProps,\n barProps,\n ganttHeight,\n scrollY,\n scrollX,\n}) => {\n const ganttSVGRef = useRef(null);\n const horizontalContainerRef = useRef(null);\n const verticalGanttContainerRef = useRef(null);\n const newBarProps = { ...barProps, svg: ganttSVGRef };\n\n useEffect(() => {\n if (horizontalContainerRef.current) {\n horizontalContainerRef.current.scrollTop = scrollY;\n }\n }, [scrollY]);\n\n useEffect(() => {\n if (verticalGanttContainerRef.current) {\n verticalGanttContainerRef.current.scrollLeft = scrollX;\n }\n }, [scrollX]);\n\n return (\n \n
\n
\n \n
\n
\n );\n};\n","import React, { SyntheticEvent, useRef, useEffect } from \"react\";\nimport styles from \"./horizontal-scroll.module.css\";\n\nexport const HorizontalScroll: React.FC<{\n scroll: number;\n svgWidth: number;\n taskListWidth: number;\n rtl: boolean;\n onScroll: (event: SyntheticEvent) => void;\n}> = ({ scroll, svgWidth, taskListWidth, rtl, onScroll }) => {\n const scrollRef = useRef(null);\n\n useEffect(() => {\n if (scrollRef.current) {\n scrollRef.current.scrollLeft = scroll;\n }\n }, [scroll]);\n\n return (\n \n );\n};\n","import React, {\n useState,\n SyntheticEvent,\n useRef,\n useEffect,\n useMemo,\n} from \"react\";\nimport { ViewMode, GanttProps, Task } from \"../../types/public-types\";\nimport { GridProps } from \"../grid/grid\";\nimport { ganttDateRange, seedDates } from \"../../helpers/date-helper\";\nimport { CalendarProps } from \"../calendar/calendar\";\nimport { TaskGanttContentProps } from \"./task-gantt-content\";\nimport { TaskListHeaderDefault } from \"../task-list/task-list-header\";\nimport { TaskListTableDefault } from \"../task-list/task-list-table\";\nimport { StandardTooltipContent, Tooltip } from \"../other/tooltip\";\nimport { VerticalScroll } from \"../other/vertical-scroll\";\nimport { TaskListProps, TaskList } from \"../task-list/task-list\";\nimport { TaskGantt } from \"./task-gantt\";\nimport { BarTask } from \"../../types/bar-task\";\nimport { convertToBarTasks } from \"../../helpers/bar-helper\";\nimport { GanttEvent } from \"../../types/gantt-task-actions\";\nimport { DateSetup } from \"../../types/date-setup\";\nimport { HorizontalScroll } from \"../other/horizontal-scroll\";\nimport { removeHiddenTasks, sortTasks } from \"../../helpers/other-helper\";\nimport styles from \"./gantt.module.css\";\n\nexport const Gantt: React.FunctionComponent = ({\n tasks,\n headerHeight = 50,\n columnWidth = 60,\n listCellWidth = \"155px\",\n rowHeight = 50,\n ganttHeight = 0,\n viewMode = ViewMode.Day,\n preStepsCount = 1,\n locale = \"en-GB\",\n days = \"Days\",\n duration = \"Duration\",\n progress = \"Progress\",\n barFill = 60,\n barCornerRadius = 3,\n barProgressColor = \"#a3a3ff\",\n barProgressSelectedColor = \"#8282f5\",\n barBackgroundColor = \"#b8c2cc\",\n barBackgroundSelectedColor = \"#aeb8c2\",\n projectProgressColor = \"#7db59a\",\n projectProgressSelectedColor = \"#59a985\",\n projectBackgroundColor = \"#fac465\",\n projectBackgroundSelectedColor = \"#f7bb53\",\n milestoneBackgroundColor = \"#f1c453\",\n milestoneBackgroundSelectedColor = \"#f29e4c\",\n rtl = false,\n handleWidth = 8,\n timeStep = 300000,\n arrowColor = \"grey\",\n fontFamily = \"Arial, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue\",\n fontSize = \"14px\",\n arrowIndent = 20,\n todayColor = \"rgba(252, 248, 227, 1)\",\n weekendColor = \"transparent\",\n viewDate,\n TooltipContent = StandardTooltipContent,\n TaskListHeader = TaskListHeaderDefault,\n TaskListTable = TaskListTableDefault,\n onDateChange,\n onProgressChange,\n onDoubleClick,\n onClick,\n onClickLine,\n onDelete,\n onSelect,\n onExpanderClick,\n allowProjectDateChange,\n}) => {\n const wrapperRef = useRef(null);\n const taskListRef = useRef(null);\n const [dateSetup, setDateSetup] = useState(() => {\n const [startDate, endDate] = ganttDateRange(tasks, viewMode, preStepsCount);\n return { viewMode, dates: seedDates(startDate, endDate, viewMode) };\n });\n const [currentViewDate, setCurrentViewDate] = useState(\n undefined\n );\n\n const [taskListWidth, setTaskListWidth] = useState(0);\n const [svgContainerWidth, setSvgContainerWidth] = useState(0);\n const [svgContainerHeight, setSvgContainerHeight] = useState(ganttHeight);\n const [barTasks, setBarTasks] = useState([]);\n const [ganttEvent, setGanttEvent] = useState({\n action: \"\",\n });\n const taskHeight = useMemo(\n () => (rowHeight * barFill) / 100,\n [rowHeight, barFill]\n );\n\n const [selectedTask, setSelectedTask] = useState();\n const [failedTask, setFailedTask] = useState(null);\n\n const svgWidth = dateSetup.dates.length * columnWidth;\n const ganttFullHeight = barTasks.length * rowHeight;\n\n const [scrollY, setScrollY] = useState(0);\n const [scrollX, setScrollX] = useState(-1);\n const [ignoreScrollEvent, setIgnoreScrollEvent] = useState(false);\n\n // task change events\n useEffect(() => {\n let filteredTasks: Task[];\n if (onExpanderClick) {\n filteredTasks = removeHiddenTasks(tasks);\n } else {\n filteredTasks = tasks;\n }\n filteredTasks = filteredTasks.sort(sortTasks);\n const [startDate, endDate] = ganttDateRange(\n filteredTasks,\n viewMode,\n preStepsCount\n );\n let newDates = seedDates(startDate, endDate, viewMode);\n if (rtl) {\n newDates = newDates.reverse();\n if (scrollX === -1) {\n setScrollX(newDates.length * columnWidth);\n }\n }\n setDateSetup({ dates: newDates, viewMode });\n setBarTasks(\n convertToBarTasks(\n filteredTasks,\n newDates,\n columnWidth,\n rowHeight,\n taskHeight,\n barCornerRadius,\n handleWidth,\n rtl,\n barProgressColor,\n barProgressSelectedColor,\n barBackgroundColor,\n barBackgroundSelectedColor,\n projectProgressColor,\n projectProgressSelectedColor,\n projectBackgroundColor,\n projectBackgroundSelectedColor,\n milestoneBackgroundColor,\n milestoneBackgroundSelectedColor\n )\n );\n }, [\n tasks,\n viewMode,\n preStepsCount,\n rowHeight,\n barCornerRadius,\n columnWidth,\n taskHeight,\n handleWidth,\n barProgressColor,\n barProgressSelectedColor,\n barBackgroundColor,\n barBackgroundSelectedColor,\n projectProgressColor,\n projectProgressSelectedColor,\n projectBackgroundColor,\n projectBackgroundSelectedColor,\n milestoneBackgroundColor,\n milestoneBackgroundSelectedColor,\n rtl,\n scrollX,\n onExpanderClick,\n ]);\n\n useEffect(() => {\n if (\n viewMode === dateSetup.viewMode &&\n ((viewDate && !currentViewDate) ||\n (viewDate && currentViewDate?.valueOf() !== viewDate.valueOf()))\n ) {\n const dates = dateSetup.dates;\n const index = dates.findIndex(\n (d, i) =>\n viewDate.valueOf() >= d.valueOf() &&\n i + 1 !== dates.length &&\n viewDate.valueOf() < dates[i + 1].valueOf()\n );\n if (index === -1) {\n return;\n }\n setCurrentViewDate(viewDate);\n setScrollX(columnWidth * index);\n }\n }, [\n viewDate,\n columnWidth,\n dateSetup.dates,\n dateSetup.viewMode,\n viewMode,\n currentViewDate,\n setCurrentViewDate,\n ]);\n\n useEffect(() => {\n const { changedTask, action } = ganttEvent;\n if (changedTask) {\n if (action === \"delete\") {\n setGanttEvent({ action: \"\" });\n setBarTasks(barTasks.filter(t => t.id !== changedTask.id));\n } else if (\n action === \"move\" ||\n action === \"end\" ||\n action === \"start\" ||\n action === \"progress\"\n ) {\n const prevStateTask = barTasks.find(t => t.id === changedTask.id);\n if (\n prevStateTask &&\n (prevStateTask.start.getTime() !== changedTask.start.getTime() ||\n prevStateTask.end.getTime() !== changedTask.end.getTime() ||\n prevStateTask.progress !== changedTask.progress)\n ) {\n // actions for change\n const newTaskList = barTasks.map(t =>\n t.id === changedTask.id ? changedTask : t\n );\n setBarTasks(newTaskList);\n }\n }\n }\n }, [ganttEvent, barTasks]);\n\n useEffect(() => {\n if (failedTask) {\n setBarTasks(barTasks.map(t => (t.id !== failedTask.id ? t : failedTask)));\n setFailedTask(null);\n }\n }, [failedTask, barTasks]);\n\n useEffect(() => {\n if (!listCellWidth) {\n setTaskListWidth(0);\n }\n if (taskListRef.current) {\n setTaskListWidth(taskListRef.current.offsetWidth);\n }\n }, [taskListRef, listCellWidth]);\n\n useEffect(() => {\n if (wrapperRef.current) {\n setSvgContainerWidth(wrapperRef.current.offsetWidth - taskListWidth);\n }\n }, [wrapperRef, taskListWidth]);\n\n useEffect(() => {\n if (ganttHeight) {\n setSvgContainerHeight(ganttHeight + headerHeight);\n } else {\n setSvgContainerHeight(tasks.length * rowHeight + headerHeight);\n }\n }, [ganttHeight, tasks, headerHeight, rowHeight]);\n\n // scroll events\n useEffect(() => {\n const handleWheel = (event: WheelEvent) => {\n if (event.shiftKey || event.deltaX) {\n const scrollMove = event.deltaX ? event.deltaX : event.deltaY;\n let newScrollX = scrollX + scrollMove;\n if (newScrollX < 0) {\n newScrollX = 0;\n } else if (newScrollX > svgWidth) {\n newScrollX = svgWidth;\n }\n setScrollX(newScrollX);\n event.preventDefault();\n } else if (ganttHeight) {\n let newScrollY = scrollY + event.deltaY;\n if (newScrollY < 0) {\n newScrollY = 0;\n } else if (newScrollY > ganttFullHeight - ganttHeight) {\n newScrollY = ganttFullHeight - ganttHeight;\n }\n if (newScrollY !== scrollY) {\n setScrollY(newScrollY);\n event.preventDefault();\n }\n }\n\n setIgnoreScrollEvent(true);\n };\n\n // subscribe if scroll is necessary\n wrapperRef.current?.addEventListener(\"wheel\", handleWheel, {\n passive: false,\n });\n return () => {\n wrapperRef.current?.removeEventListener(\"wheel\", handleWheel);\n };\n }, [\n wrapperRef,\n scrollY,\n scrollX,\n ganttHeight,\n svgWidth,\n rtl,\n ganttFullHeight,\n ]);\n\n const handleScrollY = (event: SyntheticEvent) => {\n if (scrollY !== event.currentTarget.scrollTop && !ignoreScrollEvent) {\n setScrollY(event.currentTarget.scrollTop);\n setIgnoreScrollEvent(true);\n } else {\n setIgnoreScrollEvent(false);\n }\n };\n\n const handleScrollX = (event: SyntheticEvent) => {\n if (scrollX !== event.currentTarget.scrollLeft && !ignoreScrollEvent) {\n setScrollX(event.currentTarget.scrollLeft);\n setIgnoreScrollEvent(true);\n } else {\n setIgnoreScrollEvent(false);\n }\n };\n\n /**\n * Handles arrow keys events and transform it to new scroll\n */\n const handleKeyDown = (event: React.KeyboardEvent) => {\n event.preventDefault();\n let newScrollY = scrollY;\n let newScrollX = scrollX;\n let isX = true;\n switch (event.key) {\n case \"Down\": // IE/Edge specific value\n case \"ArrowDown\":\n newScrollY += rowHeight;\n isX = false;\n break;\n case \"Up\": // IE/Edge specific value\n case \"ArrowUp\":\n newScrollY -= rowHeight;\n isX = false;\n break;\n case \"Left\":\n case \"ArrowLeft\":\n newScrollX -= columnWidth;\n break;\n case \"Right\": // IE/Edge specific value\n case \"ArrowRight\":\n newScrollX += columnWidth;\n break;\n }\n if (isX) {\n if (newScrollX < 0) {\n newScrollX = 0;\n } else if (newScrollX > svgWidth) {\n newScrollX = svgWidth;\n }\n setScrollX(newScrollX);\n } else {\n if (newScrollY < 0) {\n newScrollY = 0;\n } else if (newScrollY > ganttFullHeight - ganttHeight) {\n newScrollY = ganttFullHeight - ganttHeight;\n }\n setScrollY(newScrollY);\n }\n setIgnoreScrollEvent(true);\n };\n\n /**\n * Task select event\n */\n const handleSelectedTask = (taskId: string) => {\n const newSelectedTask = barTasks.find(t => t.id === taskId);\n const oldSelectedTask = barTasks.find(\n t => !!selectedTask && t.id === selectedTask.id\n );\n if (onSelect) {\n if (oldSelectedTask) {\n onSelect(oldSelectedTask, false);\n }\n if (newSelectedTask) {\n onSelect(newSelectedTask, true);\n }\n }\n setSelectedTask(newSelectedTask);\n };\n const handleExpanderClick = (task: Task) => {\n if (onExpanderClick && task.hideChildren !== undefined) {\n onExpanderClick({ ...task, hideChildren: !task.hideChildren });\n }\n };\n const gridProps: GridProps = {\n columnWidth,\n svgWidth,\n tasks: tasks,\n rowHeight,\n dates: dateSetup.dates,\n todayColor,\n weekendColor,\n rtl,\n };\n const calendarProps: CalendarProps = {\n dateSetup,\n locale,\n viewMode,\n headerHeight,\n columnWidth,\n fontFamily,\n fontSize,\n rtl,\n };\n const barProps: TaskGanttContentProps = {\n tasks: barTasks,\n dates: dateSetup.dates,\n ganttEvent,\n selectedTask,\n rowHeight,\n taskHeight,\n columnWidth,\n arrowColor,\n timeStep,\n fontFamily,\n fontSize,\n arrowIndent,\n svgWidth,\n rtl,\n setGanttEvent,\n setFailedTask,\n setSelectedTask: handleSelectedTask,\n onDateChange,\n onProgressChange,\n onDoubleClick,\n onClick,\n onClickLine,\n onDelete,\n allowProjectDateChange\n };\n\n const tableProps: TaskListProps = {\n rowHeight,\n rowWidth: listCellWidth,\n fontFamily,\n fontSize,\n tasks: barTasks,\n locale,\n headerHeight,\n scrollY,\n ganttHeight,\n horizontalContainerClass: styles.horizontalContainer,\n selectedTask,\n taskListRef,\n setSelectedTask: handleSelectedTask,\n onExpanderClick: handleExpanderClick,\n TaskListHeader,\n TaskListTable,\n };\n return (\n \n
\n {listCellWidth && }\n \n {ganttEvent.changedTask && (\n \n )}\n \n
\n
\n
\n );\n};\n","import React from \"react\";\nimport \"gantt-task-react/dist/index.css\";\nimport { ViewMode } from \"gantt-task-react\";\ntype ViewSwitcherProps = {\n isChecked: boolean;\n onViewListChange: (isChecked: boolean) => void;\n onViewModeChange: (viewMode: ViewMode) => void;\n};\nexport const ViewSwitcher: React.FC = ({\n onViewModeChange,\n onViewListChange,\n isChecked,\n}) => {\n return (\n \n
\n
\n
\n
\n
\n
\n
\n
\n \n Show Task List\n
\n
\n );\n};\n","import React from \"react\";\nimport { Task, ViewMode, Gantt } from \"gantt-task-react\";\nimport { ViewSwitcher } from \"./components/view-switcher\";\nimport { getStartEndDateForProject, initTasks } from \"./helper\";\nimport \"gantt-task-react/dist/index.css\";\n\n// Init\nconst App = () => {\n const [view, setView] = React.useState(ViewMode.Day);\n const [tasks, setTasks] = React.useState(initTasks());\n const [isChecked, setIsChecked] = React.useState(true);\n let columnWidth = 65;\n if (view === ViewMode.Year) {\n columnWidth = 350;\n } else if (view === ViewMode.Month) {\n columnWidth = 300;\n } else if (view === ViewMode.Week) {\n columnWidth = 250;\n }\n\n const handleTaskChange = (task: Task) => {\n console.log(\"On date change Id:\" + task.id);\n let newTasks = tasks.map(t => (t.id === task.id ? task : t));\n if (task.project) {\n const [start, end] = getStartEndDateForProject(newTasks, task.project);\n const project = newTasks[newTasks.findIndex(t => t.id === task.project)];\n if (\n project.start.getTime() !== start.getTime() ||\n project.end.getTime() !== end.getTime()\n ) {\n const changedProject = { ...project, start, end };\n newTasks = newTasks.map(t =>\n t.id === task.project ? changedProject : t\n );\n }\n }\n setTasks(newTasks);\n };\n\n const handleTaskDelete = (task: Task) => {\n const conf = window.confirm(\"Are you sure about \" + task.name + \" ?\");\n if (conf) {\n setTasks(tasks.filter(t => t.id !== task.id));\n }\n return conf;\n };\n\n const handleProgressChange = async (task: Task) => {\n setTasks(tasks.map(t => (t.id === task.id ? task : t)));\n console.log(\"On progress change Id:\" + task.id);\n };\n\n const handleDblClick = (task: Task) => {\n alert(\"On Double Click event Id:\" + task.id);\n };\n\n const handleClick = (task: Task) => {\n console.log(\"On Click event Id:\" + task.id);\n };\n\n const handleSelect = (task: Task, isSelected: boolean) => {\n console.log(task.name + \" has \" + (isSelected ? \"selected\" : \"unselected\"));\n };\n\n const handleExpanderClick = (task: Task) => {\n setTasks(tasks.map(t => (t.id === task.id ? task : t)));\n console.log(\"On expander click Id:\" + task.id);\n };\n\n return (\n \n setView(viewMode)}\n onViewListChange={setIsChecked}\n isChecked={isChecked}\n />\n Gantt With Unlimited Height
\n \n Gantt With Limited Height
\n \n
\n );\n};\n\nexport default App;\n","import { Task } from \"../../dist/types/public-types\";\n\nexport function initTasks() {\n const currentDate = new Date();\n const tasks: Task[] = [\n {\n start: new Date(currentDate.getFullYear(), currentDate.getMonth(), 1),\n end: new Date(currentDate.getFullYear(), currentDate.getMonth(), 15),\n name: \"Some Project\",\n id: \"ProjectSample\",\n progress: 25,\n type: \"project\",\n hideChildren: false,\n displayOrder: 1,\n },\n {\n start: new Date(currentDate.getFullYear(), currentDate.getMonth(), 1),\n end: new Date(\n currentDate.getFullYear(),\n currentDate.getMonth(),\n 2,\n 12,\n 28\n ),\n name: \"Idea\",\n id: \"Task 0\",\n progress: 45,\n type: \"task\",\n project: \"ProjectSample\",\n displayOrder: 2,\n },\n {\n start: new Date(currentDate.getFullYear(), currentDate.getMonth(), 2),\n end: new Date(currentDate.getFullYear(), currentDate.getMonth(), 4, 0, 0),\n name: \"Research\",\n id: \"Task 1\",\n progress: 25,\n dependencies: [\"Task 0\"],\n links: [{\n target: \"Task 0\",\n type: \"EndToStart\"\n }],\n type: \"task\",\n project: \"ProjectSample\",\n displayOrder: 3,\n },\n {\n start: new Date(currentDate.getFullYear(), currentDate.getMonth(), 4),\n end: new Date(currentDate.getFullYear(), currentDate.getMonth(), 8, 0, 0),\n name: \"Discussion with team\",\n id: \"Task 2\",\n progress: 10,\n dependencies: [\"Task 1\"],\n links: [{\n target: \"Task 1\",\n type: \"StartToEnd\"\n }],\n type: \"task\",\n project: \"ProjectSample\",\n displayOrder: 4,\n },\n {\n start: new Date(currentDate.getFullYear(), currentDate.getMonth(), 8),\n end: new Date(currentDate.getFullYear(), currentDate.getMonth(), 9, 0, 0),\n name: \"Developing\",\n id: \"Task 3\",\n progress: 2,\n dependencies: [\"Task 2\"],\n links: [{\n target: \"Task 2\",\n type: \"EndToEnd\"\n }],\n type: \"task\",\n project: \"ProjectSample\",\n displayOrder: 5,\n },\n {\n start: new Date(currentDate.getFullYear(), currentDate.getMonth(), 8),\n end: new Date(currentDate.getFullYear(), currentDate.getMonth(), 10),\n name: \"Review\",\n id: \"Task 4\",\n type: \"task\",\n progress: 70,\n dependencies: [\"Task 2\"],\n links: [{\n target: \"Task 2\",\n type: \"StartToStart\"\n }],\n project: \"ProjectSample\",\n displayOrder: 6,\n },\n {\n start: new Date(currentDate.getFullYear(), currentDate.getMonth(), 15),\n end: new Date(currentDate.getFullYear(), currentDate.getMonth(), 15),\n name: \"Release\",\n id: \"Task 6\",\n progress: currentDate.getMonth(),\n type: \"milestone\",\n dependencies: [\"Task 4\"],\n project: \"ProjectSample\",\n displayOrder: 7,\n },\n {\n start: new Date(currentDate.getFullYear(), currentDate.getMonth(), 18),\n end: new Date(currentDate.getFullYear(), currentDate.getMonth(), 19),\n name: \"Party Time\",\n id: \"Task 9\",\n progress: 0,\n isDisabled: true,\n type: \"task\",\n },\n ];\n return tasks;\n}\n\nexport function getStartEndDateForProject(tasks: Task[], projectId: string) {\n const projectTasks = tasks.filter(t => t.project === projectId);\n let start = projectTasks[0].start;\n let end = projectTasks[0].end;\n\n for (let i = 0; i < projectTasks.length; i++) {\n const task = projectTasks[i];\n if (start.getTime() > task.start.getTime()) {\n start = task.start;\n }\n if (end.getTime() < task.end.getTime()) {\n end = task.end;\n }\n }\n return [start, end];\n}\n","import \"./index.css\";\n\nimport React from \"react\";\nimport { createRoot } from \"react-dom/client\";\nimport App from \"./App\";\n\nconst container = document.getElementById(\"root\");\nconst root = createRoot(container!);\nroot.render();\n"],"names":["module","exports","aa","require","ca","p","a","b","c","arguments","length","encodeURIComponent","da","Set","ea","fa","ha","add","ia","window","document","createElement","ja","Object","prototype","hasOwnProperty","ka","la","ma","v","d","e","f","g","this","acceptsBooleans","attributeName","attributeNamespace","mustUseProperty","propertyName","type","sanitizeURL","removeEmptyString","z","split","forEach","toLowerCase","ra","sa","toUpperCase","ta","slice","pa","isNaN","qa","call","test","oa","removeAttribute","setAttribute","setAttributeNS","replace","xlinkHref","ua","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","va","Symbol","for","wa","ya","za","Aa","Ba","Ca","Da","Ea","Fa","Ga","Ha","Ia","Ja","iterator","Ka","La","A","assign","Ma","Error","stack","trim","match","Na","Oa","prepareStackTrace","defineProperty","set","Reflect","construct","l","h","k","displayName","includes","name","Pa","tag","render","Qa","$$typeof","_context","_payload","_init","Ra","Sa","Ta","nodeName","Va","_valueTracker","getOwnPropertyDescriptor","constructor","get","configurable","enumerable","getValue","setValue","stopTracking","Ua","Wa","checked","value","Xa","activeElement","body","Ya","defaultChecked","defaultValue","_wrapperState","initialChecked","Za","initialValue","controlled","ab","bb","cb","db","ownerDocument","eb","Array","isArray","fb","options","selected","defaultSelected","disabled","gb","dangerouslySetInnerHTML","children","hb","ib","jb","textContent","kb","lb","mb","nb","namespaceURI","innerHTML","valueOf","toString","firstChild","removeChild","appendChild","MSApp","execUnsafeLocalFunction","ob","lastChild","nodeType","nodeValue","pb","animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","columns","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridArea","gridRow","gridRowEnd","gridRowSpan","gridRowStart","gridColumn","gridColumnEnd","gridColumnSpan","gridColumnStart","fontWeight","lineClamp","lineHeight","opacity","order","orphans","tabSize","widows","zIndex","zoom","fillOpacity","floodOpacity","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","qb","rb","sb","style","indexOf","setProperty","keys","charAt","substring","tb","menuitem","area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr","ub","vb","is","wb","xb","target","srcElement","correspondingUseElement","parentNode","yb","zb","Ab","Bb","Cb","stateNode","Db","Eb","push","Fb","Gb","Hb","Ib","Jb","Kb","Lb","Mb","addEventListener","removeEventListener","Nb","apply","m","onError","Ob","Pb","Qb","Rb","Sb","Tb","Vb","alternate","return","flags","Wb","memoizedState","dehydrated","Xb","Zb","child","sibling","current","Yb","$b","ac","unstable_scheduleCallback","bc","unstable_cancelCallback","cc","unstable_shouldYield","dc","unstable_requestPaint","B","unstable_now","ec","unstable_getCurrentPriorityLevel","fc","unstable_ImmediatePriority","gc","unstable_UserBlockingPriority","hc","unstable_NormalPriority","ic","unstable_LowPriority","jc","unstable_IdlePriority","kc","lc","oc","Math","clz32","pc","qc","log","LN2","rc","sc","tc","uc","pendingLanes","suspendedLanes","pingedLanes","entangledLanes","entanglements","vc","xc","yc","zc","Ac","eventTimes","Cc","C","Dc","Ec","Fc","Gc","Hc","Ic","Jc","Kc","Lc","Mc","Nc","Oc","Map","Pc","Qc","Rc","Sc","delete","pointerId","Tc","nativeEvent","blockedOn","domEventName","eventSystemFlags","targetContainers","Vc","Wc","priority","isDehydrated","containerInfo","Xc","Yc","dispatchEvent","shift","Zc","$c","ad","bd","cd","ReactCurrentBatchConfig","dd","ed","transition","fd","gd","hd","id","Uc","stopPropagation","jd","kd","ld","md","nd","od","keyCode","charCode","pd","qd","rd","_reactName","_targetInst","currentTarget","isDefaultPrevented","defaultPrevented","returnValue","isPropagationStopped","preventDefault","cancelBubble","persist","isPersistent","wd","xd","yd","sd","eventPhase","bubbles","cancelable","timeStamp","Date","now","isTrusted","td","ud","view","detail","vd","Ad","screenX","screenY","clientX","clientY","pageX","pageY","ctrlKey","shiftKey","altKey","metaKey","getModifierState","zd","button","buttons","relatedTarget","fromElement","toElement","movementX","movementY","Bd","Dd","dataTransfer","Fd","Hd","animationName","elapsedTime","pseudoElement","Id","clipboardData","Jd","Ld","data","Md","Esc","Spacebar","Left","Up","Right","Down","Del","Win","Menu","Apps","Scroll","MozPrintableKey","Nd","Od","Alt","Control","Meta","Shift","Pd","Qd","key","String","fromCharCode","code","location","repeat","locale","which","Rd","Td","width","height","pressure","tangentialPressure","tiltX","tiltY","twist","pointerType","isPrimary","Vd","touches","targetTouches","changedTouches","Xd","Yd","deltaX","wheelDeltaX","deltaY","wheelDeltaY","wheelDelta","deltaZ","deltaMode","Zd","$d","ae","be","documentMode","ce","de","ee","fe","ge","he","ie","le","color","date","datetime","email","month","number","password","range","search","tel","text","time","url","week","me","ne","oe","event","listeners","pe","qe","re","se","te","ue","ve","we","xe","ye","ze","oninput","Ae","detachEvent","Be","Ce","attachEvent","De","Ee","Fe","He","Ie","Je","Ke","node","offset","nextSibling","Le","contains","compareDocumentPosition","Me","HTMLIFrameElement","contentWindow","href","Ne","contentEditable","Oe","focusedElem","selectionRange","documentElement","start","end","selectionStart","selectionEnd","min","defaultView","getSelection","extend","rangeCount","anchorNode","anchorOffset","focusNode","focusOffset","createRange","setStart","removeAllRanges","addRange","setEnd","element","left","scrollLeft","top","scrollTop","focus","Pe","Qe","Re","Se","Te","Ue","Ve","We","animationend","animationiteration","animationstart","transitionend","Xe","Ye","Ze","animation","$e","af","bf","cf","df","ef","ff","gf","hf","lf","mf","concat","nf","Ub","instance","listener","D","of","has","pf","qf","rf","random","sf","bind","capture","passive","n","t","J","x","u","w","F","tf","uf","parentWindow","vf","wf","na","xa","$a","ba","je","char","ke","unshift","xf","yf","zf","Af","Bf","Cf","Df","Ef","__html","Ff","setTimeout","Gf","clearTimeout","Hf","Promise","Jf","queueMicrotask","resolve","then","catch","If","Kf","Lf","Mf","previousSibling","Nf","Of","Pf","Qf","Rf","Sf","Tf","Uf","E","G","Vf","H","Wf","Xf","Yf","contextTypes","__reactInternalMemoizedUnmaskedChildContext","__reactInternalMemoizedMaskedChildContext","Zf","childContextTypes","$f","ag","bg","getChildContext","cg","__reactInternalMemoizedMergedChildContext","dg","eg","fg","gg","hg","jg","kg","lg","mg","ng","og","pg","qg","rg","sg","tg","ug","vg","wg","xg","yg","I","zg","Ag","Bg","elementType","deletions","Cg","pendingProps","overflow","treeContext","retryLane","Dg","mode","Eg","Fg","Gg","memoizedProps","Hg","Ig","Jg","Kg","Lg","defaultProps","Mg","Ng","Og","Pg","Qg","Rg","_currentValue","Sg","childLanes","Tg","dependencies","firstContext","lanes","Ug","Vg","context","memoizedValue","next","Wg","Xg","Yg","interleaved","Zg","$g","ah","updateQueue","baseState","firstBaseUpdate","lastBaseUpdate","shared","pending","effects","bh","ch","eventTime","lane","payload","callback","dh","K","eh","fh","gh","q","r","y","hh","ih","jh","Component","refs","kh","nh","isMounted","_reactInternals","enqueueSetState","L","lh","mh","enqueueReplaceState","enqueueForceUpdate","oh","shouldComponentUpdate","isPureReactComponent","ph","contextType","state","updater","qh","componentWillReceiveProps","UNSAFE_componentWillReceiveProps","rh","props","getDerivedStateFromProps","getSnapshotBeforeUpdate","UNSAFE_componentWillMount","componentWillMount","componentDidMount","sh","ref","_owner","_stringRef","th","join","uh","vh","index","wh","xh","yh","implementation","zh","Ah","done","Bh","Ch","Dh","Eh","Fh","Gh","Hh","Ih","tagName","Jh","Kh","Lh","M","Mh","revealOrder","Nh","Oh","_workInProgressVersionPrimary","Ph","ReactCurrentDispatcher","Qh","Rh","N","O","P","Sh","Th","Uh","Vh","Q","Wh","Xh","Yh","Zh","$h","ai","bi","ci","baseQueue","queue","di","ei","fi","lastRenderedReducer","action","hasEagerState","eagerState","lastRenderedState","dispatch","gi","hi","ii","ji","ki","getSnapshot","li","mi","R","ni","lastEffect","stores","oi","pi","qi","ri","create","destroy","deps","si","ti","ui","vi","wi","xi","yi","zi","Ai","Bi","Ci","Di","Ei","Fi","Gi","Hi","Ii","Ji","readContext","useCallback","useContext","useEffect","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo","useReducer","useRef","useState","useDebugValue","useDeferredValue","useTransition","useMutableSource","useSyncExternalStore","useId","unstable_isNewReconciler","identifierPrefix","Ki","message","digest","Li","Mi","console","error","Ni","WeakMap","Oi","Pi","Qi","Ri","getDerivedStateFromError","componentDidCatch","Si","componentStack","Ti","pingCache","Ui","Vi","Wi","Xi","ReactCurrentOwner","Yi","Zi","$i","aj","bj","compare","cj","dj","ej","baseLanes","cachePool","transitions","fj","gj","hj","ij","jj","UNSAFE_componentWillUpdate","componentWillUpdate","componentDidUpdate","kj","lj","pendingContext","mj","Aj","Cj","Dj","nj","oj","pj","fallback","qj","rj","tj","dataset","dgst","uj","vj","_reactRetry","sj","subtreeFlags","wj","xj","isBackwards","rendering","renderingStartTime","last","tail","tailMode","yj","Ej","S","Fj","Gj","wasMultiple","multiple","suppressHydrationWarning","onClick","onclick","size","createElementNS","autoFocus","createTextNode","T","Hj","Ij","Jj","Kj","U","Lj","WeakSet","V","Mj","W","Nj","Oj","Qj","Rj","Sj","Tj","Uj","Vj","Wj","insertBefore","_reactRootContainer","Xj","X","Yj","Zj","ak","onCommitFiberUnmount","componentWillUnmount","bk","ck","dk","ek","fk","isHidden","gk","hk","display","ik","jk","kk","lk","__reactInternalSnapshotBeforeUpdate","src","Wk","mk","ceil","nk","ok","pk","Y","Z","qk","rk","sk","tk","uk","Infinity","vk","wk","xk","yk","zk","Ak","Bk","Ck","Dk","Ek","callbackNode","expirationTimes","expiredLanes","wc","callbackPriority","ig","Fk","Gk","Hk","Ik","Jk","Kk","Lk","Mk","Nk","Ok","Pk","finishedWork","finishedLanes","Qk","timeoutHandle","Rk","Sk","Tk","Uk","Vk","mutableReadLanes","Bc","Pj","onCommitFiberRoot","mc","onRecoverableError","Xk","onPostCommitFiberRoot","Yk","Zk","al","isReactComponent","pendingChildren","bl","mutableSourceEagerHydrationData","cl","cache","pendingSuspenseBoundaries","dl","el","fl","gl","hl","il","jl","zj","$k","ll","reportError","ml","_internalRoot","nl","ol","pl","ql","sl","rl","unmount","unstable_scheduleHydration","splice","querySelectorAll","JSON","stringify","form","tl","usingClientEntryPoint","Events","ul","findFiberByHostInstance","bundleType","version","rendererPackageName","vl","rendererConfig","overrideHookState","overrideHookStateDeletePath","overrideHookStateRenamePath","overrideProps","overridePropsDeletePath","overridePropsRenamePath","setErrorHandler","setSuspenseHandler","scheduleUpdate","currentDispatcherRef","findHostInstanceByFiber","findHostInstancesForRefresh","scheduleRefresh","scheduleRoot","setRefreshHandler","getCurrentFiber","reconcilerVersion","__REACT_DEVTOOLS_GLOBAL_HOOK__","wl","isDisabled","supportsFiber","inject","createPortal","createRoot","unstable_strictMode","findDOMNode","flushSync","hydrate","hydrateRoot","hydratedSources","_getVersion","_source","unmountComponentAtNode","unstable_batchedUpdates","unstable_renderSubtreeIntoContainer","checkDCE","err","__self","__source","jsx","jsxs","setState","forceUpdate","escape","_status","_result","default","Children","map","count","toArray","only","Fragment","Profiler","PureComponent","StrictMode","Suspense","cloneElement","createContext","_currentValue2","_threadCount","Provider","Consumer","_defaultValue","_globalName","createFactory","createRef","forwardRef","isValidElement","lazy","memo","startTransition","unstable_act","runtime","undefined","Op","hasOwn","$Symbol","iteratorSymbol","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","obj","writable","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","Context","_invoke","GenStateSuspendedStart","method","arg","GenStateExecuting","GenStateCompleted","doneResult","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","GenStateSuspendedYield","makeInvokeMethod","fn","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","AsyncIterator","PromiseImpl","invoke","reject","result","__await","unwrapped","previousPromise","callInvokeWithMethodAndArg","TypeError","info","resultName","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","reset","iterable","iteratorMethod","i","isGeneratorFunction","genFun","ctor","mark","setPrototypeOf","__proto__","awrap","async","iter","object","reverse","pop","skipTempReset","prev","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","regeneratorRuntime","accidentalStrictMode","globalThis","Function","sortIndex","performance","setImmediate","startTime","expirationTime","priorityLevel","navigator","scheduling","isInputPending","MessageChannel","port2","port1","onmessage","postMessage","unstable_Profiling","unstable_continueExecution","unstable_forceFrameRate","floor","unstable_getFirstCallbackNode","unstable_next","unstable_pauseExecution","unstable_runWithPriority","delay","unstable_wrapCallback","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","definition","o","prop","asyncGeneratorStep","gen","_next","_throw","_defineProperty","ownKeys","enumerableOnly","getOwnPropertySymbols","symbols","filter","sym","_objectSpread2","getOwnPropertyDescriptors","defineProperties","_arrayLikeToArray","arr","len","arr2","_slicedToArray","_i","_s","_e","_arr","_n","_d","minLen","from","ViewMode","intlDTCache","getCachedDateTimeFormat","locString","opts","dtf","Intl","DateTimeFormat","addToDate","quantity","scale","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","getMilliseconds","startOfDate","scores","shouldReset","_scale","maxScore","ganttDateRange","tasks","viewMode","preStepsCount","newStartDate","newEndDate","task","Year","Month","Week","getMonday","Day","QuarterDay","HalfDay","Hour","seedDates","startDate","endDate","currentDate","dates","getLocaleMonth","bottomValue","format","toLocaleUpperCase","getLocalDayOfWeek","weekday","day","getDay","diff","setDate","getWeekNumberISO8601","tmpDate","dayNumber","firstThursday","setMonth","weekNumber","TaskListHeaderDefault","headerHeight","fontFamily","fontSize","rowWidth","React","className","styles","minWidth","marginTop","localeDateStringCache","dateTimeOptions","year","TaskListTableDefault","rowHeight","onExpanderClick","toLocaleDateString","lds","toLocaleDateStringFactory","expanderSymbol","hideChildren","maxWidth","title","Tooltip","rtl","svgContainerHeight","svgContainerWidth","scrollX","scrollY","arrowIndent","days","duration","progress","taskListWidth","TooltipContent","tooltipRef","relatedY","setRelatedY","relatedX","setRelatedX","newRelatedX","tooltipHeight","offsetHeight","tooltipWidth","offsetWidth","newRelatedY","x1","x2","StandardTooltipContent","formaDate","getTime","VerticalScroll","scroll","ganttHeight","ganttFullHeight","onScroll","scrollRef","marginLeft","TaskList","selectedTask","setSelectedTask","taskListRef","horizontalContainerClass","TaskListHeader","TaskListTable","horizontalContainerRef","headerProps","tableProps","selectedTaskId","GridBody","svgWidth","columnWidth","todayColor","weekendColor","gridRows","rowLines","y1","y2","tickX","ticks","weekends","today","fill","Grid","TopPartOfCalendar","x1Line","y1Line","y2Line","xText","yText","Calendar","dateSetup","topValues","bottomValues","topDefaultHeight","topValue","getCalendarValuesForYear","getCalendarValuesForMonth","weeksCount","getCalendarValuesForWeek","getCalendarValuesForDay","hour","getCalendarValuesForPartOfDay","displayDate","topPosition","getCalendarValuesForHour","_catch","recover","Arrow","path","trianglePoints","taskFrom","taskTo","taskHeight","onClickLine","setStrokeWidth","drownPathAndTriangleRTL","drownPathAndTriangle","stroke","onMouseEnter","onMouseLeave","points","arrowToStart","taskToEndPosition","arrowToEnd","indexCompare","taskFromEndPosition","taskFromHorizontalOffsetValue","taskToHorizontalOffsetValue","links","startToEnd","find","endToEnd","startToStart","convertToBarTask","barCornerRadius","handleWidth","barProgressColor","barProgressSelectedColor","barBackgroundColor","barBackgroundSelectedColor","projectProgressColor","projectProgressSelectedColor","projectBackgroundColor","projectBackgroundSelectedColor","milestoneBackgroundColor","milestoneBackgroundSelectedColor","barTask","convertToMilestone","convertToBar","taskXCoordinateRTL","taskXCoordinate","typeInternal","progressWithByParams","progressWidth","progressX","taskYCoordinate","backgroundColor","backgroundSelectedColor","progressColor","progressSelectedColor","barChildren","rotatedHeight","xDate","findIndex","taskX1","taskX2","getProgressPoint","taskY","moveByX","xStep","additionalXValue","round","newX1","dateByX","taskX","taskDate","timeStep","newDate","getTimezoneOffset","handleTaskBySVGMouseEvent","svgX","initEventX1Delta","handleTaskBySVGMouseEventForMilestone","handleTaskBySVGMouseEventForBar","changedTask","isChanged","barWidth","progressByXRTL","progressByX","startByX","newX2","endByX","newMoveX1","newMoveX2","removeHiddenTasks","groupedTasks","groupedTask","getChildren","_loop","taskList","project","taskChildren","sortTasks","taskA","taskB","orderA","displayOrder","Number","MAX_VALUE","orderB","BarDisplay","isSelected","onMouseDown","ry","rx","BarDateHandle","BarProgressHandle","progressPoint","Bar","isProgressChangeable","isDateChangeable","onEventStart","handleHeight","tabIndex","BarSmall","Milestone","transform","Project","barColor","processColor","projectWith","projectLeftTriangle","projectRightTriangle","TaskItem","isDelete","allowProjectDateChange","textRef","taskItem","setTaskItem","isTextInside","setIsTextInside","getBBox","onKeyDown","onDoubleClick","onFocus","hasChild","getX","TaskGanttContent","ganttEvent","svg","arrowColor","setGanttEvent","setFailedTask","onDateChange","onProgressChange","onDelete","point","_svg$current","createSVGPoint","setXStep","setInitEventX1Delta","isMoving","setIsMoving","dateDelta","handleMouseMove","cursor","matrixTransform","getScreenCTM","_svg$current$getScree","inverse","handleMouseUp","operationSuccess","originalSelectedTask","_svg$current$getScree2","newChangedTask","isNotLikeOriginal","handleBarEventStart","isKeyboardEvent","_svg$current$getScree3","TaskGantt","gridProps","calendarProps","barProps","ganttSVGRef","verticalGanttContainerRef","newBarProps","dir","xmlns","HorizontalScroll","margin","Gantt","_ref$headerHeight","_ref$columnWidth","listCellWidth","_ref$listCellWidth","_ref$rowHeight","_ref$ganttHeight","_ref$preStepsCount","_ref$locale","_ref$days","_ref$duration","_ref$progress","barFill","_ref$barFill","_ref$barCornerRadius","_ref$barProgressColor","_ref$barProgressSelec","_ref$barBackgroundCol","_ref$barBackgroundSel","_ref$projectProgressC","_ref$projectProgressS","_ref$projectBackgroun","_ref$projectBackgroun2","_ref$milestoneBackgro","_ref$milestoneBackgro2","_ref$rtl","_ref$handleWidth","_ref$timeStep","_ref$arrowColor","_ref$fontFamily","_ref$fontSize","_ref$arrowIndent","_ref$todayColor","_ref$weekendColor","viewDate","onSelect","wrapperRef","setDateSetup","currentViewDate","setCurrentViewDate","setTaskListWidth","setSvgContainerWidth","setSvgContainerHeight","barTasks","setBarTasks","failedTask","setScrollY","setScrollX","ignoreScrollEvent","setIgnoreScrollEvent","filteredTasks","sort","newDates","j","dependence","convertToBarTasks","prevStateTask","newTaskList","handleWheel","scrollMove","newScrollX","newScrollY","handleSelectedTask","taskId","newSelectedTask","oldSelectedTask","isX","ViewSwitcher","onViewModeChange","onViewListChange","isChecked","setView","initTasks","setTasks","setIsChecked","handleTaskChange","newTasks","projectId","projectTasks","getStartEndDateForProject","changedProject","handleTaskDelete","conf","confirm","handleProgressChange","args","handleDblClick","alert","handleClick","handleSelect","handleExpanderClick","container","getElementById"],"sourceRoot":""}
\ No newline at end of file