From b0390421040d6c8a5dfe1e18ab705c35e52f668d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Glasn=C3=A1k?= Date: Thu, 15 Jan 2026 05:33:02 +0100 Subject: [PATCH] build(dev): minor timeline fixes --- app/dist/js/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/dist/js/index.js b/app/dist/js/index.js index f155eea..099961e 100644 --- a/app/dist/js/index.js +++ b/app/dist/js/index.js @@ -851,7 +851,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _no /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js */ \"./node_modules/css-loader/dist/runtime/noSourceMaps.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);\n// Imports\n\n\nvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".timeline-scroll[data-v-5ca7dec4] {\\n overflow-x: auto;\\n overflow-y: hidden;\\n position: relative;\\n width: 100%;\\n scrollbar-width: none;\\n cursor: crosshair;\\n}\\n.timeline-scroll[data-v-5ca7dec4]::-webkit-scrollbar {\\n display: none;\\n}\\n.timeline-bar[data-v-5ca7dec4] {\\n position: relative;\\n height: 30px;\\n width: 1440px;\\n background: #fafafa;\\n border-radius: 4px;\\n}\\n@media (max-width: 768px) {\\n.timeline-bar[data-v-5ca7dec4] {\\n width: 1200px;\\n}\\n}\\n.non-working-hours[data-v-5ca7dec4] {\\n position: absolute;\\n top: 0;\\n height: 100%;\\n background: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(224, 224, 224, 0.3) 10px, rgba(224, 224, 224, 0.3) 20px);\\n z-index: 1;\\n pointer-events: none;\\n}\\n.work-hours-bar[data-v-5ca7dec4] {\\n position: absolute;\\n top: 0;\\n height: 100%;\\n background: transparent;\\n z-index: 1;\\n pointer-events: none;\\n}\\n.weekend-overlay[data-v-5ca7dec4] {\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%;\\n background: rgba(255, 124, 124, 0.3) !important;\\n z-index: 1;\\n pointer-events: none;\\n border-radius: 4px;\\n}\\n.scheduled-block[data-v-5ca7dec4] {\\n position: absolute;\\n top: 5px;\\n height: 22px;\\n background: #7f39fb;\\n border: 1px solid #6a1bf7;\\n opacity: 0.6;\\n border-radius: 2px;\\n z-index: 2;\\n pointer-events: none;\\n}\\n.scheduled-block--blocker[data-v-5ca7dec4] {\\n background: rgb(176, 0, 32);\\n border: 1px solid rgb(156, 0, 28);\\n opacity: 0.7;\\n}\\n.other-timeblock[data-v-5ca7dec4] {\\n position: absolute;\\n top: 5px;\\n height: 22px;\\n background: #FFA726;\\n opacity: 0.5;\\n border: 2px dashed #FF9800;\\n border-radius: 2px;\\n z-index: 2;\\n pointer-events: none;\\n}\\n.preview-block[data-v-5ca7dec4] {\\n position: absolute;\\n top: 5px;\\n height: 22px;\\n background: #4CAF50;\\n opacity: 0.6;\\n border: 2px dashed #388E3C;\\n border-radius: 2px;\\n z-index: 5;\\n cursor: crosshair;\\n transition: opacity 0.2s, box-shadow 0.2s;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n pointer-events: none;\\n}\\n.preview-block[data-v-5ca7dec4]:hover {\\n opacity: 0.8;\\n box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);\\n}\\n.preview-block.is-stretching[data-v-5ca7dec4] {\\n opacity: 0.8;\\n box-shadow: 0 4px 12px rgba(76, 175, 80, 0.6);\\n cursor: ew-resize;\\n}\\n.preview-time-label[data-v-5ca7dec4] {\\n font-size: 11px;\\n font-weight: 600;\\n color: white;\\n text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);\\n white-space: nowrap;\\n pointer-events: none;\\n -webkit-user-select: none;\\n -moz-user-select: none;\\n user-select: none;\\n}\\n.current-timeblock[data-v-5ca7dec4] {\\n position: absolute;\\n top: 5px;\\n height: 22px;\\n background: #2196F3;\\n opacity: 0.7;\\n border: 2px solid #1976D2;\\n border-radius: 2px;\\n z-index: 3;\\n transition: box-shadow 0.2s;\\n}\\n.current-timeblock.has-collision[data-v-5ca7dec4] {\\n border-color: #ff5252;\\n}\\n.current-timeblock.outside-working-hours[data-v-5ca7dec4] {\\n border-color: #ff0000;\\n}\\n.current-timeblock.is-resizing[data-v-5ca7dec4] {\\n opacity: 0.8;\\n box-shadow: 0 4px 12px rgba(33, 150, 243, 0.6);\\n z-index: 6;\\n}\\n.resize-handle[data-v-5ca7dec4] {\\n position: absolute;\\n top: 0;\\n width: 8px;\\n height: 100%;\\n cursor: ew-resize;\\n z-index: 4;\\n}\\n.resize-handle[data-v-5ca7dec4]:hover {\\n background: rgba(255, 255, 255, 0.3);\\n}\\n.resize-handle--left[data-v-5ca7dec4] {\\n left: 0;\\n border-top-left-radius: 2px;\\n border-bottom-left-radius: 2px;\\n}\\n.resize-handle--right[data-v-5ca7dec4] {\\n right: 0;\\n border-top-right-radius: 2px;\\n border-bottom-right-radius: 2px;\\n}\\n.collision-segment[data-v-5ca7dec4] {\\n position: absolute;\\n top: 5px;\\n height: 22px;\\n background: #ff5252;\\n opacity: 0.6;\\n border-radius: 2px;\\n z-index: 4;\\n pointer-events: none;\\n}\\n.timeline-cursor[data-v-5ca7dec4] {\\n position: absolute;\\n top: 0;\\n bottom: 0;\\n width: 2px;\\n background: rgba(0, 0, 0, 0.3);\\n z-index: 10;\\n pointer-events: none;\\n}\\n.timeblock-duration[data-v-5ca7dec4] {\\n position: absolute;\\n top: 50%;\\n left: 50%;\\n transform: translate(-50%, -50%);\\n font-size: 14px;\\n font-weight: bold;\\n color: white;\\n text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);\\n pointer-events: none;\\n -webkit-user-select: none;\\n -moz-user-select: none;\\n user-select: none;\\n}\\n.timeline-loading[data-v-5ca7dec4] {\\n height: 60px;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n font-size: 14px;\\n opacity: 0.5;\\n}\", \"\"]);\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (___CSS_LOADER_EXPORT___);\n\n\n//# sourceURL=webpack://jandl/./src/plugins/tm@modal/task/_components/employees/a-employee-timeblock-timeline.vue?./node_modules/css-loader/dist/cjs.js??clonedRuleSet-27.use%5B1%5D!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-27.use%5B2%5D!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-27.use%5B3%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D\n}"); +eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js */ \"./node_modules/css-loader/dist/runtime/noSourceMaps.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);\n// Imports\n\n\nvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".timeline-scroll[data-v-5ca7dec4] {\\n overflow-x: auto;\\n overflow-y: hidden;\\n position: relative;\\n width: 100%;\\n scrollbar-width: none;\\n cursor: crosshair;\\n}\\n.timeline-scroll[data-v-5ca7dec4]::-webkit-scrollbar {\\n display: none;\\n}\\n.timeline-bar[data-v-5ca7dec4] {\\n position: relative;\\n height: 30px;\\n width: 1440px;\\n background: #fafafa;\\n border-radius: 4px;\\n}\\n@media (max-width: 768px) {\\n.timeline-bar[data-v-5ca7dec4] {\\n width: 1200px;\\n}\\n}\\n.non-working-hours[data-v-5ca7dec4] {\\n position: absolute;\\n top: 0;\\n height: 100%;\\n background: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(224, 224, 224, 0.3) 10px, rgba(224, 224, 224, 0.3) 20px);\\n z-index: 1;\\n pointer-events: none;\\n}\\n.work-hours-bar[data-v-5ca7dec4] {\\n position: absolute;\\n top: 0;\\n height: 100%;\\n background: transparent;\\n z-index: 1;\\n pointer-events: none;\\n}\\n.weekend-overlay[data-v-5ca7dec4] {\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%;\\n background: rgba(255, 124, 124, 0.3) !important;\\n z-index: 1;\\n pointer-events: none;\\n border-radius: 4px;\\n}\\n.scheduled-block[data-v-5ca7dec4] {\\n position: absolute;\\n top: 5px;\\n height: 22px;\\n background: #7f39fb;\\n border: 1px solid #6a1bf7;\\n opacity: 0.6;\\n border-radius: 2px;\\n z-index: 2;\\n pointer-events: none;\\n}\\n.scheduled-block--blocker[data-v-5ca7dec4] {\\n background: rgb(176, 0, 32);\\n border: 1px solid rgb(156, 0, 28);\\n opacity: 0.7;\\n}\\n.scheduled-block--concept[data-v-5ca7dec4] {\\n background: repeating-linear-gradient(135deg, transparent, transparent 10px, rgba(127, 57, 251, 0.3) 10px, rgba(127, 57, 251, 0.3) 20px);\\n}\\n.other-timeblock[data-v-5ca7dec4] {\\n position: absolute;\\n top: 5px;\\n height: 22px;\\n background: #FFA726;\\n opacity: 0.5;\\n border: 2px dashed #FF9800;\\n border-radius: 2px;\\n z-index: 2;\\n pointer-events: none;\\n}\\n.preview-block[data-v-5ca7dec4] {\\n position: absolute;\\n top: 5px;\\n height: 22px;\\n background: #4CAF50;\\n opacity: 0.6;\\n border: 2px dashed #388E3C;\\n border-radius: 2px;\\n z-index: 5;\\n cursor: crosshair;\\n transition: opacity 0.2s, box-shadow 0.2s;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n pointer-events: none;\\n}\\n.preview-block[data-v-5ca7dec4]:hover {\\n opacity: 0.8;\\n box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);\\n}\\n.preview-block.is-stretching[data-v-5ca7dec4] {\\n opacity: 0.8;\\n box-shadow: 0 4px 12px rgba(76, 175, 80, 0.6);\\n cursor: ew-resize;\\n}\\n.preview-time-label[data-v-5ca7dec4] {\\n font-size: 11px;\\n font-weight: 600;\\n color: white;\\n text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);\\n white-space: nowrap;\\n pointer-events: none;\\n -webkit-user-select: none;\\n -moz-user-select: none;\\n user-select: none;\\n}\\n.current-timeblock[data-v-5ca7dec4] {\\n position: absolute;\\n top: 5px;\\n height: 22px;\\n background: #2196F3;\\n opacity: 0.7;\\n border: 2px solid #1976D2;\\n border-radius: 2px;\\n z-index: 3;\\n transition: box-shadow 0.2s;\\n}\\n.current-timeblock.has-collision[data-v-5ca7dec4] {\\n border-color: #ff5252;\\n}\\n.current-timeblock.outside-working-hours[data-v-5ca7dec4] {\\n border-color: #ff0000;\\n}\\n.current-timeblock.is-resizing[data-v-5ca7dec4] {\\n opacity: 0.8;\\n box-shadow: 0 4px 12px rgba(33, 150, 243, 0.6);\\n z-index: 6;\\n}\\n.resize-handle[data-v-5ca7dec4] {\\n position: absolute;\\n top: 0;\\n width: 8px;\\n height: 100%;\\n cursor: ew-resize;\\n z-index: 4;\\n}\\n.resize-handle[data-v-5ca7dec4]:hover {\\n background: rgba(255, 255, 255, 0.3);\\n}\\n.resize-handle--left[data-v-5ca7dec4] {\\n left: 0;\\n border-top-left-radius: 2px;\\n border-bottom-left-radius: 2px;\\n}\\n.resize-handle--right[data-v-5ca7dec4] {\\n right: 0;\\n border-top-right-radius: 2px;\\n border-bottom-right-radius: 2px;\\n}\\n.collision-segment[data-v-5ca7dec4] {\\n position: absolute;\\n top: 5px;\\n height: 22px;\\n background: #ff5252;\\n opacity: 0.6;\\n border-radius: 2px;\\n z-index: 4;\\n pointer-events: none;\\n}\\n.timeline-cursor[data-v-5ca7dec4] {\\n position: absolute;\\n top: 0;\\n bottom: 0;\\n width: 2px;\\n background: rgba(0, 0, 0, 0.3);\\n z-index: 10;\\n pointer-events: none;\\n}\\n.timeblock-duration[data-v-5ca7dec4] {\\n position: absolute;\\n top: 50%;\\n left: 50%;\\n transform: translate(-50%, -50%);\\n font-size: 14px;\\n font-weight: bold;\\n color: white;\\n text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);\\n pointer-events: none;\\n -webkit-user-select: none;\\n -moz-user-select: none;\\n user-select: none;\\n}\\n.timeline-loading[data-v-5ca7dec4] {\\n height: 60px;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n font-size: 14px;\\n opacity: 0.5;\\n}\", \"\"]);\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (___CSS_LOADER_EXPORT___);\n\n\n//# sourceURL=webpack://jandl/./src/plugins/tm@modal/task/_components/employees/a-employee-timeblock-timeline.vue?./node_modules/css-loader/dist/cjs.js??clonedRuleSet-27.use%5B1%5D!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-27.use%5B2%5D!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-27.use%5B3%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D\n}"); /***/ }), @@ -1274,7 +1274,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var cor /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/esnext.iterator.constructor.js */ \"./node_modules/core-js/modules/esnext.iterator.constructor.js\");\n/* harmony import */ var core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_esnext_iterator_filter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/esnext.iterator.filter.js */ \"./node_modules/core-js/modules/esnext.iterator.filter.js\");\n/* harmony import */ var core_js_modules_esnext_iterator_filter_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_esnext_iterator_filter_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/esnext.iterator.map.js */ \"./node_modules/core-js/modules/esnext.iterator.map.js\");\n/* harmony import */ var core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.runtime.esm-bundler.js\");\n/* harmony import */ var _vuelidate_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @vuelidate/core */ \"./node_modules/@vuelidate/core/dist/index.esm.js\");\n/* harmony import */ var _vuelidate_validators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @vuelidate/validators */ \"./node_modules/@vuelidate/validators/dist/index.esm.js\");\n/* harmony import */ var _plugins_tm_utils_useEmployeeTimeline__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/plugins/tm@_utils/useEmployeeTimeline */ \"./src/plugins/tm@_utils/useEmployeeTimeline.ts\");\n/* harmony import */ var _plugins_tm_utils_timeblock_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/plugins/tm@_utils/timeblock.utils */ \"./src/plugins/tm@_utils/timeblock.utils.ts\");\n/* harmony import */ var _a_employee_timeblock_header_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./a-employee-timeblock-header.vue */ \"./src/plugins/tm@modal/task/_components/employees/a-employee-timeblock-header.vue\");\n/* harmony import */ var _a_employee_timeblock_timeline_vue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./a-employee-timeblock-timeline.vue */ \"./src/plugins/tm@modal/task/_components/employees/a-employee-timeblock-timeline.vue\");\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\");\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_10__);\n/* provided dependency */ var console = __webpack_require__(/*! ./node_modules/console-browserify/index.js */ \"./node_modules/console-browserify/index.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n// Configuration: Set to false to allow editing timeblocks with existing IDs\nconst ALLOW_EDITING_EXISTING_TIMEBLOCKS = true;\nconst HOUR_WIDTH = 60; // pixels per hour (desktop)\nconst HOUR_WIDTH_MOBILE = 50; // pixels per hour (mobile)\nconst START_HOUR = 0; // Start from midnight\nconst END_HOUR = 24; // End at midnight\n// Check if mobile\n/* harmony default export */ __webpack_exports__[\"default\"] = (/*@__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_3__.defineComponent)({\n __name: 'a-employee-timeblock',\n props: {\n modelValue: {\n type: Object,\n required: true\n },\n employee: {\n type: [Object, null],\n required: true\n },\n allEmployeeTimeblocks: {\n type: Array,\n required: false,\n default: () => []\n },\n allTimeblocks: {\n type: Array,\n required: false,\n default: () => []\n },\n deletedTimeblockIds: {\n type: Array,\n required: false,\n default: () => []\n },\n currentIndex: {\n type: Number,\n required: false,\n default: 0\n },\n deletable: {\n type: Boolean,\n required: false,\n default: false\n },\n index: {\n type: Number,\n required: false,\n default: 0\n }\n },\n emits: [\"update:modelValue\", \"addTimeblock\", \"removeTimeblock\"],\n setup(__props, {\n expose: __expose,\n emit: __emit\n }) {\n const props = __props;\n const emit = __emit;\n const timelineRef = (0,vue__WEBPACK_IMPORTED_MODULE_3__.ref)(null);\n // Check if timeblock is editable (based on whether it has an ID)\n const isEditable = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n if (ALLOW_EDITING_EXISTING_TIMEBLOCKS) return true;\n return !props.modelValue.id;\n });\n // Minimum date is today (no past dates)\n const minDate = (0,vue__WEBPACK_IMPORTED_MODULE_3__.ref)(new Date());\n // Timeline configuration\n const isMobile = (0,vue__WEBPACK_IMPORTED_MODULE_3__.ref)(false);\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.onMounted)(() => {\n isMobile.value = window.innerWidth <= 768;\n window.addEventListener('resize', () => {\n isMobile.value = window.innerWidth <= 768;\n });\n // Center timeline on mount\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.nextTick)(() => {\n centerTimeline();\n });\n });\n const hourWidth = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => isMobile.value ? HOUR_WIDTH_MOBILE : HOUR_WIDTH);\n // Custom validator for time range\n const timeRangeValid = (value, siblings) => {\n if (!siblings.starts_at_time || !siblings.ends_at_time || !siblings.date) {\n return true;\n }\n const {\n start,\n end\n } = (0,_plugins_tm_utils_timeblock_utils__WEBPACK_IMPORTED_MODULE_7__.timeblockToDateRange)(siblings);\n if (!start || !end) return true;\n return end > start;\n };\n // Custom validator: field is required when start OR end time is filled\n // Uses siblings to check the current state of all fields\n // const requiredWhenHasTime = (value: any, siblings: any) => {\n // // Check if timeblock has any TIME data (start or end time)\n // const hasStart = !!siblings.starts_at_time;\n // const hasEnd = !!siblings.ends_at_time;\n // const hasAnyTimeData = hasStart || hasEnd;\n // // If no time data, no validation needed\n // if (!hasAnyTimeData) return true;\n // // When time data exists, field must have value (not null, undefined, or empty string)\n // return value !== null && value !== undefined && value !== '';\n // };\n // Vuelidate rules - if start OR end is filled, all three fields are required\n const rules = {\n date: {\n requiredWhenHasTime: _vuelidate_validators__WEBPACK_IMPORTED_MODULE_5__.helpers.withMessage('Vyberte dátum', _vuelidate_validators__WEBPACK_IMPORTED_MODULE_5__.required)\n },\n starts_at_time: {\n requiredWhenHasTime: _vuelidate_validators__WEBPACK_IMPORTED_MODULE_5__.helpers.withMessage('Zadajte začiatok', _vuelidate_validators__WEBPACK_IMPORTED_MODULE_5__.required)\n },\n ends_at_time: {\n requiredWhenHasTime: _vuelidate_validators__WEBPACK_IMPORTED_MODULE_5__.helpers.withMessage('Zadajte koniec', _vuelidate_validators__WEBPACK_IMPORTED_MODULE_5__.required),\n timeRangeValid: _vuelidate_validators__WEBPACK_IMPORTED_MODULE_5__.helpers.withMessage('Koniec musí byť po začiatku', timeRangeValid)\n }\n };\n const v$ = (0,_vuelidate_core__WEBPACK_IMPORTED_MODULE_4__.useVuelidate)(rules, props.modelValue, {\n $autoDirty: true\n });\n // Error visibility logic: show errors if field is dirty OR if the opposite time field is filled\n const hasStartTimeError = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n // Show error if field is dirty and has error\n if (v$.value.starts_at_time.$dirty && v$.value.starts_at_time.$error) {\n return true;\n }\n // OR if end time is filled but start is not\n if (props.modelValue.ends_at_time && !props.modelValue.starts_at_time) {\n return v$.value.starts_at_time.$error;\n }\n return false;\n });\n const hasEndTimeError = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n // Show error if field is dirty and has error\n if (v$.value.ends_at_time.$dirty && v$.value.ends_at_time.$error) {\n return true;\n }\n // OR if start time is filled but end is not\n if (props.modelValue.starts_at_time && !props.modelValue.ends_at_time) {\n return v$.value.ends_at_time.$error;\n }\n return false;\n });\n const endTimeErrorMessage = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n if (hasEndTimeError.value) {\n return v$.value.ends_at_time.$errors.map(e => e.$message).join(', ');\n }\n return '';\n });\n // Reactive refs for composable\n const employeeRef = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => props.employee);\n const dateRef = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => props.modelValue.date);\n const timeblockRef = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => props.modelValue);\n // Get other timeblocks for the same date (excluding current one)\n // This includes timeblocks from both the current employee and other employees\n const otherTimeblocksForSameDate = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n if (!props.modelValue.date) return [];\n const currentDate = moment__WEBPACK_IMPORTED_MODULE_10___default()(props.modelValue.date).format('YYYY-MM-DD');\n // Use allEmployeeTimeblocks which contains timeblocks for this specific employee\n // Filter out the current timeblock by comparing index directly\n return props.allEmployeeTimeblocks.filter((tb, index) => {\n // Skip current timeblock by index\n if (index === props.currentIndex) {\n return false;\n }\n // Must have required fields\n if (!tb.date || !tb.starts_at_time || !tb.ends_at_time) return false;\n // Must be the same date\n return moment__WEBPACK_IMPORTED_MODULE_10___default()(tb.date).format('YYYY-MM-DD') === currentDate;\n });\n });\n // Use timeline composable\n const {\n isLoading,\n timelineTasks,\n scheduledTime: _scheduledTime,\n freeTime: _freeTime,\n timeblockDuration,\n refetch\n } = (0,_plugins_tm_utils_useEmployeeTimeline__WEBPACK_IMPORTED_MODULE_6__.useEmployeeTimeline)(employeeRef, dateRef, timeblockRef, otherTimeblocksForSameDate);\n // Force refetch when date changes\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.watch)(() => props.modelValue.date, () => {\n if (props.modelValue.date && props.employee?.id) {\n refetch();\n }\n });\n // All tasks from timelineTasks are already filtered for the selected date\n // Filter out timeblocks that are being edited or deleted locally\n const scheduledBlocks = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n // Combine IDs that should be filtered: edited locally or deleted\n const hiddenTimeblockIds = new Set([\n // Timeblock IDs being edited locally\n ...props.allTimeblocks.filter(tb => tb.id).map(tb => tb.id),\n // Timeblock IDs that have been deleted\n ...(props.deletedTimeblockIds || [])]);\n // Filter out tasks whose timeblock IDs should be hidden\n return timelineTasks.value.filter(task => !task._timeblock_id || !hiddenTimeblockIds.has(task._timeblock_id));\n });\n // Convert other unsaved timeblocks to task format for collision detection\n const otherTimeblocksAsTasks = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n return otherTimeblocksForSameDate.value.map(tb => {\n const {\n start,\n end\n } = (0,_plugins_tm_utils_timeblock_utils__WEBPACK_IMPORTED_MODULE_7__.timeblockToDateRange)(tb);\n if (!start || !end) return null;\n return {\n _real_start: start,\n _real_end: end,\n _timeblock_id: tb.id || null\n };\n }).filter(task => task !== null);\n });\n // Combine scheduled blocks with other unsaved timeblocks for collision detection\n const allBlocksForCollisionCheck = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n return [...scheduledBlocks.value, ...otherTimeblocksAsTasks.value];\n });\n // Recalculate collision using filtered scheduled blocks AND other unsaved timeblocks\n // This prevents false collisions with timeblocks being edited, but catches collisions with other unsaved timeblocks\n const collision = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n return (0,_plugins_tm_utils_timeblock_utils__WEBPACK_IMPORTED_MODULE_7__.detectCollision)(props.modelValue, allBlocksForCollisionCheck.value);\n });\n // Recalculate collision segments using filtered scheduled blocks AND other unsaved timeblocks\n const collisionSegments = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n return (0,_plugins_tm_utils_timeblock_utils__WEBPACK_IMPORTED_MODULE_7__.getCollisionSegments)(props.modelValue, allBlocksForCollisionCheck.value);\n });\n // Get current timeblock range\n const currentTimeblockRange = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n const {\n start,\n end\n } = (0,_plugins_tm_utils_timeblock_utils__WEBPACK_IMPORTED_MODULE_7__.timeblockToDateRange)(props.modelValue);\n return {\n start,\n end\n };\n });\n // Validate that end time is after start time\n const isTimeRangeValid = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n if (!props.modelValue.starts_at_time || !props.modelValue.ends_at_time) {\n return true; // Don't show error if fields are empty\n }\n const {\n start,\n end\n } = currentTimeblockRange.value;\n if (!start || !end) return true;\n return end > start;\n });\n // Center timeline around middle of work hours\n const centerTimeline = () => {\n if (!timelineRef.value?.timelineScroll) return;\n // Calculate the middle of work hours\n const workStart = props.employee?.work_start ?? 8;\n const workEnd = props.employee?.work_end ?? 17;\n const centerHour = (workStart + workEnd) / 2;\n const centerPosition = (centerHour - START_HOUR) * hourWidth.value;\n const containerWidth = timelineRef.value.timelineScroll.clientWidth;\n timelineRef.value.timelineScroll.scrollLeft = centerPosition - containerWidth / 2;\n };\n // Watch for date changes or employee changes to re-center\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.watch)(() => [props.modelValue.date, props.employee?.id], () => {\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.nextTick)(() => {\n centerTimeline();\n });\n });\n // Watch for timeline ref to become available and center it\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.watch)(timelineRef, newRef => {\n if (newRef?.timelineScroll) {\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.nextTick)(() => {\n centerTimeline();\n });\n }\n });\n // Watch for loading state - when data finishes loading, center the timeline\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.watch)(isLoading, (newIsLoading, oldIsLoading) => {\n // When loading changes from true to false, timeline is re-rendered\n if (oldIsLoading && !newIsLoading) {\n // Wait for DOM to update, then center\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.nextTick)(() => {\n setTimeout(() => {\n centerTimeline();\n }, 0); // Small delay to ensure DOM is fully rendered\n });\n }\n });\n // Date navigation\n const previousDay = () => {\n if (!props.modelValue.date) return;\n const currentDate = moment__WEBPACK_IMPORTED_MODULE_10___default()(props.modelValue.date);\n const newDate = currentDate.clone().subtract(1, 'day').toDate();\n // Don't allow going to past dates\n if (moment__WEBPACK_IMPORTED_MODULE_10___default()(newDate).isBefore(moment__WEBPACK_IMPORTED_MODULE_10___default()(), 'day')) return;\n updateDate(newDate);\n };\n const nextDay = () => {\n if (!props.modelValue.date) return;\n const currentDate = moment__WEBPACK_IMPORTED_MODULE_10___default()(props.modelValue.date);\n const newDate = currentDate.clone().add(1, 'day').toDate();\n updateDate(newDate);\n };\n // Update handlers\n const updateDate = date => {\n emit('update:modelValue', {\n ...props.modelValue,\n date\n });\n };\n const updateStartTime = event => {\n const target = event.target;\n emit('update:modelValue', {\n ...props.modelValue,\n starts_at_time: target.value\n });\n };\n const updateEndTime = event => {\n const target = event.target;\n emit('update:modelValue', {\n ...props.modelValue,\n ends_at_time: target.value\n });\n };\n // Handle timeblock updated from timeline (drag/drop or quick add)\n const handleTimeblockUpdated = payload => {\n const {\n starts_at_time\n } = payload;\n let {\n ends_at_time\n } = payload;\n // Fix accidental same start/end time by adding 1 hour to end\n if (starts_at_time === ends_at_time) {\n const [hours, minutes] = starts_at_time.split(':').map(Number);\n const newEndHour = (hours + 1) % 24; // Wrap around at midnight\n ends_at_time = `${String(newEndHour).padStart(2, '0')}:${String(minutes).padStart(2, '0')}`;\n }\n emit('update:modelValue', {\n ...props.modelValue,\n starts_at_time,\n ends_at_time\n });\n // Trigger validation after timeline update\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.nextTick)(() => {\n v$.value.$touch();\n });\n };\n // Expose validate method\n const validate = async () => {\n v$.value.$touch();\n const isValid = await v$.value.$validate();\n return isValid && isTimeRangeValid.value;\n };\n __expose({\n validate\n });\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.watch)(() => props.modelValue.ends_at_time, () => {\n if (v$.value.ends_at_time.$model !== props.modelValue.ends_at_time) {\n v$.value.ends_at_time.$model = props.modelValue.ends_at_time;\n }\n });\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.watch)(() => props.modelValue.starts_at_time, () => {\n if (v$.value.starts_at_time.$model !== props.modelValue.starts_at_time) {\n v$.value.starts_at_time.$model = props.modelValue.starts_at_time;\n console.log('starts_at_time changed', v$.value.starts_at_time.$model);\n }\n });\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.watch)(() => props.modelValue.date, () => {\n if (v$.value.date.$model !== props.modelValue.date) {\n v$.value.date.$model = props.modelValue.date;\n }\n });\n const __returned__ = {\n ALLOW_EDITING_EXISTING_TIMEBLOCKS,\n props,\n emit,\n timelineRef,\n isEditable,\n minDate,\n HOUR_WIDTH,\n HOUR_WIDTH_MOBILE,\n START_HOUR,\n END_HOUR,\n isMobile,\n hourWidth,\n timeRangeValid,\n rules,\n v$,\n hasStartTimeError,\n hasEndTimeError,\n endTimeErrorMessage,\n employeeRef,\n dateRef,\n timeblockRef,\n otherTimeblocksForSameDate,\n isLoading,\n timelineTasks,\n _scheduledTime,\n _freeTime,\n timeblockDuration,\n refetch,\n scheduledBlocks,\n otherTimeblocksAsTasks,\n allBlocksForCollisionCheck,\n collision,\n collisionSegments,\n currentTimeblockRange,\n isTimeRangeValid,\n centerTimeline,\n previousDay,\n nextDay,\n updateDate,\n updateStartTime,\n updateEndTime,\n handleTimeblockUpdated,\n validate,\n AEmployeeTimeblockHeader: _a_employee_timeblock_header_vue__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n AEmployeeTimeblockTimeline: _a_employee_timeblock_timeline_vue__WEBPACK_IMPORTED_MODULE_9__[\"default\"]\n };\n Object.defineProperty(__returned__, '__isScriptSetup', {\n enumerable: false,\n value: true\n });\n return __returned__;\n }\n}));\n\n//# sourceURL=webpack://jandl/./src/plugins/tm@modal/task/_components/employees/a-employee-timeblock.vue?./node_modules/webpack-plugin-vuetify/dist/scriptLoader.js!./node_modules/babel-loader/lib/index.js!./node_modules/ts-loader/index.js??clonedRuleSet-41.use%5B1%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D\n}"); +eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/esnext.iterator.constructor.js */ \"./node_modules/core-js/modules/esnext.iterator.constructor.js\");\n/* harmony import */ var core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_esnext_iterator_filter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/esnext.iterator.filter.js */ \"./node_modules/core-js/modules/esnext.iterator.filter.js\");\n/* harmony import */ var core_js_modules_esnext_iterator_filter_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_esnext_iterator_filter_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/esnext.iterator.map.js */ \"./node_modules/core-js/modules/esnext.iterator.map.js\");\n/* harmony import */ var core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.runtime.esm-bundler.js\");\n/* harmony import */ var _vuelidate_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @vuelidate/core */ \"./node_modules/@vuelidate/core/dist/index.esm.js\");\n/* harmony import */ var _vuelidate_validators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @vuelidate/validators */ \"./node_modules/@vuelidate/validators/dist/index.esm.js\");\n/* harmony import */ var _plugins_tm_utils_useEmployeeTimeline__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/plugins/tm@_utils/useEmployeeTimeline */ \"./src/plugins/tm@_utils/useEmployeeTimeline.ts\");\n/* harmony import */ var _plugins_tm_utils_timeblock_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/plugins/tm@_utils/timeblock.utils */ \"./src/plugins/tm@_utils/timeblock.utils.ts\");\n/* harmony import */ var _a_employee_timeblock_header_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./a-employee-timeblock-header.vue */ \"./src/plugins/tm@modal/task/_components/employees/a-employee-timeblock-header.vue\");\n/* harmony import */ var _a_employee_timeblock_timeline_vue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./a-employee-timeblock-timeline.vue */ \"./src/plugins/tm@modal/task/_components/employees/a-employee-timeblock-timeline.vue\");\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\");\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_10__);\n/* provided dependency */ var console = __webpack_require__(/*! ./node_modules/console-browserify/index.js */ \"./node_modules/console-browserify/index.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n// Configuration: Set to false to allow editing timeblocks with existing IDs\nconst ALLOW_EDITING_EXISTING_TIMEBLOCKS = true;\nconst HOUR_WIDTH = 60; // pixels per hour (desktop)\nconst HOUR_WIDTH_MOBILE = 50; // pixels per hour (mobile)\nconst START_HOUR = 0; // Start from midnight\nconst END_HOUR = 24; // End at midnight\n// Check if mobile\n/* harmony default export */ __webpack_exports__[\"default\"] = (/*@__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_3__.defineComponent)({\n __name: 'a-employee-timeblock',\n props: {\n modelValue: {\n type: Object,\n required: true\n },\n employee: {\n type: [Object, null],\n required: true\n },\n allEmployeeTimeblocks: {\n type: Array,\n required: false,\n default: () => []\n },\n allTimeblocks: {\n type: Array,\n required: false,\n default: () => []\n },\n deletedTimeblockIds: {\n type: Array,\n required: false,\n default: () => []\n },\n currentIndex: {\n type: Number,\n required: false,\n default: 0\n },\n deletable: {\n type: Boolean,\n required: false,\n default: false\n },\n index: {\n type: Number,\n required: false,\n default: 0\n }\n },\n emits: [\"update:modelValue\", \"addTimeblock\", \"removeTimeblock\"],\n setup(__props, {\n expose: __expose,\n emit: __emit\n }) {\n const props = __props;\n const emit = __emit;\n const timelineRef = (0,vue__WEBPACK_IMPORTED_MODULE_3__.ref)(null);\n // Check if timeblock is editable (based on whether it has an ID)\n const isEditable = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n if (ALLOW_EDITING_EXISTING_TIMEBLOCKS) return true;\n return !props.modelValue.id;\n });\n // Minimum date is today (no past dates)\n const minDate = (0,vue__WEBPACK_IMPORTED_MODULE_3__.ref)(new Date());\n // Timeline configuration\n const isMobile = (0,vue__WEBPACK_IMPORTED_MODULE_3__.ref)(false);\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.onMounted)(() => {\n isMobile.value = window.innerWidth <= 768;\n window.addEventListener('resize', () => {\n isMobile.value = window.innerWidth <= 768;\n });\n // Center timeline on mount\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.nextTick)(() => {\n centerTimeline();\n });\n });\n const hourWidth = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => isMobile.value ? HOUR_WIDTH_MOBILE : HOUR_WIDTH);\n // Custom validator for time range\n const timeRangeValid = (value, siblings) => {\n if (!siblings.starts_at_time || !siblings.ends_at_time || !siblings.date) {\n return true;\n }\n const {\n start,\n end\n } = (0,_plugins_tm_utils_timeblock_utils__WEBPACK_IMPORTED_MODULE_7__.timeblockToDateRange)(siblings);\n if (!start || !end) return true;\n return end > start;\n };\n // Custom validator: field is required when start OR end time is filled\n // Uses siblings to check the current state of all fields\n // const requiredWhenHasTime = (value: any, siblings: any) => {\n // // Check if timeblock has any TIME data (start or end time)\n // const hasStart = !!siblings.starts_at_time;\n // const hasEnd = !!siblings.ends_at_time;\n // const hasAnyTimeData = hasStart || hasEnd;\n // // If no time data, no validation needed\n // if (!hasAnyTimeData) return true;\n // // When time data exists, field must have value (not null, undefined, or empty string)\n // return value !== null && value !== undefined && value !== '';\n // };\n // Vuelidate rules - if start OR end is filled, all three fields are required\n const rules = {\n date: {\n requiredWhenHasTime: _vuelidate_validators__WEBPACK_IMPORTED_MODULE_5__.helpers.withMessage('Vyberte dátum', _vuelidate_validators__WEBPACK_IMPORTED_MODULE_5__.required)\n },\n starts_at_time: {\n requiredWhenHasTime: _vuelidate_validators__WEBPACK_IMPORTED_MODULE_5__.helpers.withMessage('Zadajte začiatok', _vuelidate_validators__WEBPACK_IMPORTED_MODULE_5__.required)\n },\n ends_at_time: {\n requiredWhenHasTime: _vuelidate_validators__WEBPACK_IMPORTED_MODULE_5__.helpers.withMessage('Zadajte koniec', _vuelidate_validators__WEBPACK_IMPORTED_MODULE_5__.required),\n timeRangeValid: _vuelidate_validators__WEBPACK_IMPORTED_MODULE_5__.helpers.withMessage('Koniec musí byť po začiatku', timeRangeValid)\n }\n };\n const v$ = (0,_vuelidate_core__WEBPACK_IMPORTED_MODULE_4__.useVuelidate)(rules, props.modelValue, {\n $autoDirty: true\n });\n // Error visibility logic: show errors if field is dirty OR if the opposite time field is filled\n const hasStartTimeError = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n // Show error if field is dirty and has error\n if (v$.value.starts_at_time.$dirty && v$.value.starts_at_time.$error) {\n return true;\n }\n // OR if end time is filled but start is not\n if (props.modelValue.ends_at_time && !props.modelValue.starts_at_time) {\n return v$.value.starts_at_time.$error;\n }\n return false;\n });\n const hasEndTimeError = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n // Show error if field is dirty and has error\n if (v$.value.ends_at_time.$dirty && v$.value.ends_at_time.$error) {\n return true;\n }\n // OR if start time is filled but end is not\n if (props.modelValue.starts_at_time && !props.modelValue.ends_at_time) {\n return v$.value.ends_at_time.$error;\n }\n return false;\n });\n const endTimeErrorMessage = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n if (hasEndTimeError.value) {\n return v$.value.ends_at_time.$errors.map(e => e.$message).join(', ');\n }\n return '';\n });\n // Reactive refs for composable\n const employeeRef = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => props.employee);\n const dateRef = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => props.modelValue.date);\n const timeblockRef = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => props.modelValue);\n // Get other timeblocks for the same date (excluding current one)\n // This includes timeblocks from both the current employee and other employees\n const otherTimeblocksForSameDate = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n if (!props.modelValue.date) return [];\n const currentDate = moment__WEBPACK_IMPORTED_MODULE_10___default()(props.modelValue.date).format('YYYY-MM-DD');\n // Use allEmployeeTimeblocks which contains timeblocks for this specific employee\n // Filter out the current timeblock by comparing index directly\n return props.allEmployeeTimeblocks.filter((tb, index) => {\n // Skip current timeblock by index\n if (index === props.currentIndex) {\n return false;\n }\n // Must have required fields\n if (!tb.date || !tb.starts_at_time || !tb.ends_at_time) return false;\n // Must be the same date\n return moment__WEBPACK_IMPORTED_MODULE_10___default()(tb.date).format('YYYY-MM-DD') === currentDate;\n });\n });\n // Use timeline composable\n const {\n isLoading,\n timelineTasks,\n scheduledTime: _scheduledTime,\n freeTime: _freeTime,\n timeblockDuration,\n refetch,\n conceptTasksRefetch\n } = (0,_plugins_tm_utils_useEmployeeTimeline__WEBPACK_IMPORTED_MODULE_6__.useEmployeeTimeline)(employeeRef, dateRef, timeblockRef, otherTimeblocksForSameDate);\n // Force refetch when date changes\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.watch)(() => props.modelValue.date, () => {\n if (props.modelValue.date && props.employee?.id) {\n refetch();\n conceptTasksRefetch();\n }\n });\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.onMounted)(() => {\n refetch();\n conceptTasksRefetch();\n });\n // All tasks from timelineTasks are already filtered for the selected date\n // Filter out timeblocks that are being edited or deleted locally\n const scheduledBlocks = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n // Combine IDs that should be filtered: edited locally or deleted\n const hiddenTimeblockIds = new Set([\n // Timeblock IDs being edited locally\n ...props.allTimeblocks.filter(tb => tb.id).map(tb => tb.id),\n // Timeblock IDs that have been deleted\n ...(props.deletedTimeblockIds || [])]);\n // Filter out tasks whose timeblock IDs should be hidden\n return timelineTasks.value.filter(task => !task._timeblock_id || !hiddenTimeblockIds.has(task._timeblock_id));\n });\n // Convert other unsaved timeblocks to task format for collision detection\n const otherTimeblocksAsTasks = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n return otherTimeblocksForSameDate.value.map(tb => {\n const {\n start,\n end\n } = (0,_plugins_tm_utils_timeblock_utils__WEBPACK_IMPORTED_MODULE_7__.timeblockToDateRange)(tb);\n if (!start || !end) return null;\n return {\n _real_start: start,\n _real_end: end,\n _timeblock_id: tb.id || null\n };\n }).filter(task => task !== null);\n });\n // Combine scheduled blocks with other unsaved timeblocks for collision detection\n const allBlocksForCollisionCheck = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n return [...scheduledBlocks.value, ...otherTimeblocksAsTasks.value];\n });\n // Recalculate collision using filtered scheduled blocks AND other unsaved timeblocks\n // This prevents false collisions with timeblocks being edited, but catches collisions with other unsaved timeblocks\n const collision = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n return (0,_plugins_tm_utils_timeblock_utils__WEBPACK_IMPORTED_MODULE_7__.detectCollision)(props.modelValue, allBlocksForCollisionCheck.value);\n });\n // Recalculate collision segments using filtered scheduled blocks AND other unsaved timeblocks\n const collisionSegments = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n return (0,_plugins_tm_utils_timeblock_utils__WEBPACK_IMPORTED_MODULE_7__.getCollisionSegments)(props.modelValue, allBlocksForCollisionCheck.value);\n });\n // Get current timeblock range\n const currentTimeblockRange = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n const {\n start,\n end\n } = (0,_plugins_tm_utils_timeblock_utils__WEBPACK_IMPORTED_MODULE_7__.timeblockToDateRange)(props.modelValue);\n return {\n start,\n end\n };\n });\n // Validate that end time is after start time\n const isTimeRangeValid = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n if (!props.modelValue.starts_at_time || !props.modelValue.ends_at_time) {\n return true; // Don't show error if fields are empty\n }\n const {\n start,\n end\n } = currentTimeblockRange.value;\n if (!start || !end) return true;\n return end > start;\n });\n // Center timeline around middle of work hours\n const centerTimeline = () => {\n if (!timelineRef.value?.timelineScroll) return;\n // Calculate the middle of work hours\n const workStart = props.employee?.work_start ?? 8;\n const workEnd = props.employee?.work_end ?? 17;\n const centerHour = (workStart + workEnd) / 2;\n const centerPosition = (centerHour - START_HOUR) * hourWidth.value;\n const containerWidth = timelineRef.value.timelineScroll.clientWidth;\n timelineRef.value.timelineScroll.scrollLeft = centerPosition - containerWidth / 2;\n };\n // Watch for date changes or employee changes to re-center\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.watch)(() => [props.modelValue.date, props.employee?.id], () => {\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.nextTick)(() => {\n centerTimeline();\n });\n });\n // Watch for timeline ref to become available and center it\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.watch)(timelineRef, newRef => {\n if (newRef?.timelineScroll) {\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.nextTick)(() => {\n centerTimeline();\n });\n }\n });\n // Watch for loading state - when data finishes loading, center the timeline\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.watch)(isLoading, (newIsLoading, oldIsLoading) => {\n // When loading changes from true to false, timeline is re-rendered\n if (oldIsLoading && !newIsLoading) {\n // Wait for DOM to update, then center\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.nextTick)(() => {\n setTimeout(() => {\n centerTimeline();\n }, 0); // Small delay to ensure DOM is fully rendered\n });\n }\n });\n // Date navigation\n const previousDay = () => {\n if (!props.modelValue.date) return;\n const currentDate = moment__WEBPACK_IMPORTED_MODULE_10___default()(props.modelValue.date);\n const newDate = currentDate.clone().subtract(1, 'day').toDate();\n // Don't allow going to past dates\n if (moment__WEBPACK_IMPORTED_MODULE_10___default()(newDate).isBefore(moment__WEBPACK_IMPORTED_MODULE_10___default()(), 'day')) return;\n updateDate(newDate);\n };\n const nextDay = () => {\n if (!props.modelValue.date) return;\n const currentDate = moment__WEBPACK_IMPORTED_MODULE_10___default()(props.modelValue.date);\n const newDate = currentDate.clone().add(1, 'day').toDate();\n updateDate(newDate);\n };\n // Update handlers\n const updateDate = date => {\n emit('update:modelValue', {\n ...props.modelValue,\n date\n });\n };\n const updateStartTime = event => {\n const target = event.target;\n emit('update:modelValue', {\n ...props.modelValue,\n starts_at_time: target.value\n });\n };\n const updateEndTime = event => {\n const target = event.target;\n emit('update:modelValue', {\n ...props.modelValue,\n ends_at_time: target.value\n });\n };\n // Handle timeblock updated from timeline (drag/drop or quick add)\n const handleTimeblockUpdated = payload => {\n const {\n starts_at_time\n } = payload;\n let {\n ends_at_time\n } = payload;\n // Fix accidental same start/end time by adding 1 hour to end\n if (starts_at_time === ends_at_time) {\n const [hours, minutes] = starts_at_time.split(':').map(Number);\n const newEndHour = (hours + 1) % 24; // Wrap around at midnight\n ends_at_time = `${String(newEndHour).padStart(2, '0')}:${String(minutes).padStart(2, '0')}`;\n }\n emit('update:modelValue', {\n ...props.modelValue,\n starts_at_time,\n ends_at_time\n });\n // Trigger validation after timeline update\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.nextTick)(() => {\n v$.value.$touch();\n });\n };\n // Expose validate method\n const validate = async () => {\n v$.value.$touch();\n const isValid = await v$.value.$validate();\n return isValid && isTimeRangeValid.value;\n };\n __expose({\n validate\n });\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.watch)(() => props.modelValue.ends_at_time, () => {\n if (v$.value.ends_at_time.$model !== props.modelValue.ends_at_time) {\n v$.value.ends_at_time.$model = props.modelValue.ends_at_time;\n }\n });\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.watch)(() => props.modelValue.starts_at_time, () => {\n if (v$.value.starts_at_time.$model !== props.modelValue.starts_at_time) {\n v$.value.starts_at_time.$model = props.modelValue.starts_at_time;\n console.log('starts_at_time changed', v$.value.starts_at_time.$model);\n }\n });\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.watch)(() => props.modelValue.date, () => {\n if (v$.value.date.$model !== props.modelValue.date) {\n v$.value.date.$model = props.modelValue.date;\n }\n });\n const __returned__ = {\n ALLOW_EDITING_EXISTING_TIMEBLOCKS,\n props,\n emit,\n timelineRef,\n isEditable,\n minDate,\n HOUR_WIDTH,\n HOUR_WIDTH_MOBILE,\n START_HOUR,\n END_HOUR,\n isMobile,\n hourWidth,\n timeRangeValid,\n rules,\n v$,\n hasStartTimeError,\n hasEndTimeError,\n endTimeErrorMessage,\n employeeRef,\n dateRef,\n timeblockRef,\n otherTimeblocksForSameDate,\n isLoading,\n timelineTasks,\n _scheduledTime,\n _freeTime,\n timeblockDuration,\n refetch,\n conceptTasksRefetch,\n scheduledBlocks,\n otherTimeblocksAsTasks,\n allBlocksForCollisionCheck,\n collision,\n collisionSegments,\n currentTimeblockRange,\n isTimeRangeValid,\n centerTimeline,\n previousDay,\n nextDay,\n updateDate,\n updateStartTime,\n updateEndTime,\n handleTimeblockUpdated,\n validate,\n AEmployeeTimeblockHeader: _a_employee_timeblock_header_vue__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n AEmployeeTimeblockTimeline: _a_employee_timeblock_timeline_vue__WEBPACK_IMPORTED_MODULE_9__[\"default\"]\n };\n Object.defineProperty(__returned__, '__isScriptSetup', {\n enumerable: false,\n value: true\n });\n return __returned__;\n }\n}));\n\n//# sourceURL=webpack://jandl/./src/plugins/tm@modal/task/_components/employees/a-employee-timeblock.vue?./node_modules/webpack-plugin-vuetify/dist/scriptLoader.js!./node_modules/babel-loader/lib/index.js!./node_modules/ts-loader/index.js??clonedRuleSet-41.use%5B1%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D\n}"); /***/ }), @@ -1340,7 +1340,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ render: function() { return /* binding */ render; }\n/* harmony export */ });\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.runtime.esm-bundler.js\");\n\nconst _hoisted_1 = {\n class: \"timeline\"\n};\nconst _hoisted_2 = {\n key: 0,\n class: \"timeline-loading\"\n};\nconst _hoisted_3 = {\n key: 1,\n ref: \"timelineContainer\",\n class: \"timeline__content\"\n};\nconst _hoisted_4 = {\n ref: \"timelineBar\",\n class: \"timeline-bar\"\n};\nconst _hoisted_5 = {\n key: 0,\n class: \"weekend-overlay\"\n};\nconst _hoisted_6 = [\"title\"];\nconst _hoisted_7 = {\n class: \"preview-time-label\"\n};\nconst _hoisted_8 = {\n key: 0\n};\nconst _hoisted_9 = {\n key: 1\n};\nconst _hoisted_10 = {\n key: 0,\n class: \"timeblock-duration\"\n};\nconst _hoisted_11 = {\n key: 0,\n class: \"preview-time-label\"\n};\nconst _hoisted_12 = {\n key: 1,\n class: \"preview-time-label\"\n};\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", _hoisted_1, [$props.isLoading ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", _hoisted_2, [...(_cache[2] || (_cache[2] = [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"span\", null, \"Načítavam...\", -1 /* CACHED */)]))])) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", {\n ref: \"timelineScroll\",\n class: \"timeline-scroll\",\n onMousemove: $setup.handleMouseMove,\n onMouseleave: $setup.handleMouseLeave,\n onMousedown: $setup.handleTimelineMouseDown\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup[\"AEmployeeTimeblockTimelineHeader\"], {\n \"start-hour\": $props.startHour,\n \"end-hour\": $props.endHour,\n \"hour-width\": $props.hourWidth\n }, null, 8 /* PROPS */, [\"start-hour\", \"end-hour\", \"hour-width\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_4, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" Non-working hours - before work \"), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", {\n class: \"non-working-hours\",\n style: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeStyle)({\n left: '0px',\n width: `${$setup.getHourPosition($props.employee.work_start)}px`\n })\n }, null, 4 /* STYLE */), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" Non-working hours - after work \"), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", {\n class: \"non-working-hours\",\n style: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeStyle)({\n left: `${$setup.getHourPosition($props.employee.work_end)}px`,\n width: `${$setup.getHourWidth(24 - $props.employee.work_end)}px`\n })\n }, null, 4 /* STYLE */), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" Work hours background (transparent/white) \"), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", {\n class: \"work-hours-bar\",\n style: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeStyle)({\n left: `${$setup.getHourPosition($props.employee.work_start)}px`,\n width: `${$setup.getHourWidth($props.employee.work_end - $props.employee.work_start)}px`\n })\n }, null, 4 /* STYLE */), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" Weekend background overlay \"), $setup.isWeekend ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", _hoisted_5)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\"v-if\", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" Existing scheduled blocks \"), ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.scheduledBlocks, (task, index) => {\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", {\n key: `task-${index}`,\n class: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([\"scheduled-block\", {\n 'scheduled-block--blocker': ['blocker', 'adhoc', 'home_office', 'vacation', 'free_day', 'office365_blocker'].includes(task.type)\n }]),\n style: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeStyle)({\n left: `${$setup.getTimePosition(task._real_start)}px`,\n width: `${$setup.getTimeWidth(task._real_start, task._real_end)}px`\n }),\n title: `${task.subtask?.title || task.blocker?.type || 'Task'}`\n }, null, 14 /* CLASS, STYLE, PROPS */, _hoisted_6);\n }), 128 /* KEYED_FRAGMENT */)), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" Other timeblocks for same date \"), ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($setup.otherTimeblocksRendered, (timeblock, index) => {\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", {\n key: `other-${index}`,\n class: \"other-timeblock\",\n style: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeStyle)({\n left: `${$setup.getTimePosition(timeblock._start)}px`,\n width: `${$setup.getTimeWidth(timeblock._start, timeblock._end)}px`\n }),\n title: `Other timeblock`\n }, null, 4 /* STYLE */);\n }), 128 /* KEYED_FRAGMENT */)), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" Hover preview block \"), $setup.showPreview && $setup.previewBlock ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", {\n key: 1,\n class: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([\"preview-block\", {\n 'is-stretching': $setup.dragState.isStretching\n }]),\n style: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeStyle)({\n left: `${$setup.getTimePosition($setup.previewBlock.start)}px`,\n width: `${$setup.getTimeWidth($setup.previewBlock.start, $setup.previewBlock.end)}px`\n })\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_7, [$setup.getTimeWidth($setup.previewBlock.start, $setup.previewBlock.end) <= 58 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", _hoisted_8, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($setup.formatTime($setup.previewBlock.start)), 1 /* TEXT */)) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", _hoisted_9, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($setup.formatTime($setup.previewBlock.start)) + \" - \" + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($setup.formatTime($setup.previewBlock.end)), 1 /* TEXT */))])], 6 /* CLASS, STYLE */)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\"v-if\", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" Current timeblock (if valid) \"), $props.currentTimeblockRange.start && $props.currentTimeblockRange.end && !$setup.dragState.isResizingCurrent ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", {\n key: 2,\n class: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([\"current-timeblock\", {\n 'has-collision': $props.collision.hasCollision,\n 'outside-working-hours': $setup.isOutsideWorkingHours\n }]),\n style: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeStyle)({\n left: `${$setup.getTimePosition($props.currentTimeblockRange.start)}px`,\n width: `${$setup.getTimeWidth($props.currentTimeblockRange.start, $props.currentTimeblockRange.end)}px`\n })\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" Duration display (centered in current timeblock) \"), $props.timeblockDuration > 0 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", _hoisted_10, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.timeblockDuration.toFixed(2)) + \"h \", 1 /* TEXT */)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\"v-if\", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" Resize handles \"), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", {\n class: \"resize-handle resize-handle--left\",\n onMousedown: _cache[0] || (_cache[0] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)($event => $setup.handleResizeMouseDown($event, 'left'), [\"stop\"]))\n }, null, 32 /* NEED_HYDRATION */), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", {\n class: \"resize-handle resize-handle--right\",\n onMousedown: _cache[1] || (_cache[1] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)($event => $setup.handleResizeMouseDown($event, 'right'), [\"stop\"]))\n }, null, 32 /* NEED_HYDRATION */)], 6 /* CLASS, STYLE */)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\"v-if\", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" Resizing current timeblock preview \"), $setup.dragState.isResizingCurrent && $setup.resizedCurrentBlock ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", {\n key: 3,\n class: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([\"current-timeblock is-resizing\", {\n 'has-collision': $props.collision.hasCollision,\n 'outside-working-hours': $setup.isOutsideWorkingHours\n }]),\n style: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeStyle)({\n left: `${$setup.getTimePosition($setup.resizedCurrentBlock.start)}px`,\n width: `${$setup.getTimeWidth($setup.resizedCurrentBlock.start, $setup.resizedCurrentBlock.end)}px`\n })\n }, [$setup.getTimeWidth($setup.resizedCurrentBlock.start, $setup.resizedCurrentBlock.end) <= 58 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", _hoisted_11, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($setup.formatTime($setup.resizedCurrentBlock.start)), 1 /* TEXT */)) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", _hoisted_12, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($setup.formatTime($setup.resizedCurrentBlock.start)) + \" - \" + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($setup.formatTime($setup.resizedCurrentBlock.end)), 1 /* TEXT */))], 6 /* CLASS, STYLE */)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\"v-if\", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" Collision segments \"), ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.collisionSegments, (segment, index) => {\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", {\n key: `collision-${index}`,\n class: \"collision-segment\",\n style: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeStyle)({\n left: `${$setup.getTimePosition(segment.start)}px`,\n width: `${$setup.getTimeWidth(segment.start, segment.end)}px`\n })\n }, null, 4 /* STYLE */);\n }), 128 /* KEYED_FRAGMENT */)), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" Cursor line (snapped to 15-min intervals) \"), $setup.showCursor && $setup.cursorPosition ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", {\n key: 4,\n class: \"timeline-cursor\",\n style: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeStyle)({\n left: `${$setup.getTimePosition($setup.cursorPosition)}px`\n })\n }, null, 4 /* STYLE */)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\"v-if\", true)], 512 /* NEED_PATCH */)], 544 /* NEED_HYDRATION, NEED_PATCH */)], 512 /* NEED_PATCH */))]);\n}\n\n//# sourceURL=webpack://jandl/./src/plugins/tm@modal/task/_components/employees/a-employee-timeblock-timeline.vue?./node_modules/webpack-plugin-vuetify/dist/scriptLoader.js!./node_modules/babel-loader/lib/index.js!./node_modules/ts-loader/index.js??clonedRuleSet-41.use%5B1%5D!./node_modules/vue-loader/dist/templateLoader.js??ruleSet%5B1%5D.rules%5B5%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D\n}"); +eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ render: function() { return /* binding */ render; }\n/* harmony export */ });\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.runtime.esm-bundler.js\");\n\nconst _hoisted_1 = {\n class: \"timeline\"\n};\nconst _hoisted_2 = {\n key: 0,\n class: \"timeline-loading\"\n};\nconst _hoisted_3 = {\n key: 1,\n ref: \"timelineContainer\",\n class: \"timeline__content\"\n};\nconst _hoisted_4 = {\n ref: \"timelineBar\",\n class: \"timeline-bar\"\n};\nconst _hoisted_5 = {\n key: 0,\n class: \"weekend-overlay\"\n};\nconst _hoisted_6 = [\"title\"];\nconst _hoisted_7 = {\n class: \"preview-time-label\"\n};\nconst _hoisted_8 = {\n key: 0\n};\nconst _hoisted_9 = {\n key: 1\n};\nconst _hoisted_10 = {\n key: 0,\n class: \"timeblock-duration\"\n};\nconst _hoisted_11 = {\n key: 0,\n class: \"preview-time-label\"\n};\nconst _hoisted_12 = {\n key: 1,\n class: \"preview-time-label\"\n};\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", _hoisted_1, [$props.isLoading ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", _hoisted_2, [...(_cache[2] || (_cache[2] = [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"span\", null, \"Načítavam...\", -1 /* CACHED */)]))])) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", {\n ref: \"timelineScroll\",\n class: \"timeline-scroll\",\n onMousemove: $setup.handleMouseMove,\n onMouseleave: $setup.handleMouseLeave,\n onMousedown: $setup.handleTimelineMouseDown\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup[\"AEmployeeTimeblockTimelineHeader\"], {\n \"start-hour\": $props.startHour,\n \"end-hour\": $props.endHour,\n \"hour-width\": $props.hourWidth\n }, null, 8 /* PROPS */, [\"start-hour\", \"end-hour\", \"hour-width\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_4, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" Non-working hours - before work \"), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", {\n class: \"non-working-hours\",\n style: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeStyle)({\n left: '0px',\n width: `${$setup.getHourPosition($props.employee.work_start)}px`\n })\n }, null, 4 /* STYLE */), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" Non-working hours - after work \"), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", {\n class: \"non-working-hours\",\n style: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeStyle)({\n left: `${$setup.getHourPosition($props.employee.work_end)}px`,\n width: `${$setup.getHourWidth(24 - $props.employee.work_end)}px`\n })\n }, null, 4 /* STYLE */), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" Work hours background (transparent/white) \"), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", {\n class: \"work-hours-bar\",\n style: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeStyle)({\n left: `${$setup.getHourPosition($props.employee.work_start)}px`,\n width: `${$setup.getHourWidth($props.employee.work_end - $props.employee.work_start)}px`\n })\n }, null, 4 /* STYLE */), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" Weekend background overlay \"), $setup.isWeekend ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", _hoisted_5)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\"v-if\", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" Existing scheduled blocks \"), ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.scheduledBlocks, (task, index) => {\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", {\n key: `task-${index}`,\n class: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([\"scheduled-block\", {\n 'scheduled-block--blocker': ['blocker', 'adhoc', 'home_office', 'vacation', 'free_day', 'office365_blocker'].includes(task.type),\n 'scheduled-block--concept': task.is_draft === true\n }]),\n style: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeStyle)({\n left: `${$setup.getTimePosition(task._real_start)}px`,\n width: `${$setup.getTimeWidth(task._real_start, task._real_end)}px`\n }),\n title: `${task.subtask?.title || task.blocker?.type || 'Task'}`\n }, null, 14 /* CLASS, STYLE, PROPS */, _hoisted_6);\n }), 128 /* KEYED_FRAGMENT */)), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" Other timeblocks for same date \"), ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($setup.otherTimeblocksRendered, (timeblock, index) => {\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", {\n key: `other-${index}`,\n class: \"other-timeblock\",\n style: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeStyle)({\n left: `${$setup.getTimePosition(timeblock._start)}px`,\n width: `${$setup.getTimeWidth(timeblock._start, timeblock._end)}px`\n }),\n title: `Other timeblock`\n }, null, 4 /* STYLE */);\n }), 128 /* KEYED_FRAGMENT */)), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" Hover preview block \"), $setup.showPreview && $setup.previewBlock ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", {\n key: 1,\n class: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([\"preview-block\", {\n 'is-stretching': $setup.dragState.isStretching\n }]),\n style: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeStyle)({\n left: `${$setup.getTimePosition($setup.previewBlock.start)}px`,\n width: `${$setup.getTimeWidth($setup.previewBlock.start, $setup.previewBlock.end)}px`\n })\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_7, [$setup.getTimeWidth($setup.previewBlock.start, $setup.previewBlock.end) <= 58 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", _hoisted_8, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($setup.formatTime($setup.previewBlock.start)), 1 /* TEXT */)) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", _hoisted_9, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($setup.formatTime($setup.previewBlock.start)) + \" - \" + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($setup.formatTime($setup.previewBlock.end)), 1 /* TEXT */))])], 6 /* CLASS, STYLE */)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\"v-if\", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" Current timeblock (if valid) \"), $props.currentTimeblockRange.start && $props.currentTimeblockRange.end && !$setup.dragState.isResizingCurrent ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", {\n key: 2,\n class: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([\"current-timeblock\", {\n 'has-collision': $props.collision.hasCollision,\n 'outside-working-hours': $setup.isOutsideWorkingHours\n }]),\n style: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeStyle)({\n left: `${$setup.getTimePosition($props.currentTimeblockRange.start)}px`,\n width: `${$setup.getTimeWidth($props.currentTimeblockRange.start, $props.currentTimeblockRange.end)}px`\n })\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" Duration display (centered in current timeblock) \"), $props.timeblockDuration > 0 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", _hoisted_10, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.timeblockDuration.toFixed(2)) + \"h \", 1 /* TEXT */)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\"v-if\", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" Resize handles \"), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", {\n class: \"resize-handle resize-handle--left\",\n onMousedown: _cache[0] || (_cache[0] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)($event => $setup.handleResizeMouseDown($event, 'left'), [\"stop\"]))\n }, null, 32 /* NEED_HYDRATION */), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", {\n class: \"resize-handle resize-handle--right\",\n onMousedown: _cache[1] || (_cache[1] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)($event => $setup.handleResizeMouseDown($event, 'right'), [\"stop\"]))\n }, null, 32 /* NEED_HYDRATION */)], 6 /* CLASS, STYLE */)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\"v-if\", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" Resizing current timeblock preview \"), $setup.dragState.isResizingCurrent && $setup.resizedCurrentBlock ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", {\n key: 3,\n class: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([\"current-timeblock is-resizing\", {\n 'has-collision': $props.collision.hasCollision,\n 'outside-working-hours': $setup.isOutsideWorkingHours\n }]),\n style: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeStyle)({\n left: `${$setup.getTimePosition($setup.resizedCurrentBlock.start)}px`,\n width: `${$setup.getTimeWidth($setup.resizedCurrentBlock.start, $setup.resizedCurrentBlock.end)}px`\n })\n }, [$setup.getTimeWidth($setup.resizedCurrentBlock.start, $setup.resizedCurrentBlock.end) <= 58 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", _hoisted_11, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($setup.formatTime($setup.resizedCurrentBlock.start)), 1 /* TEXT */)) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", _hoisted_12, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($setup.formatTime($setup.resizedCurrentBlock.start)) + \" - \" + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($setup.formatTime($setup.resizedCurrentBlock.end)), 1 /* TEXT */))], 6 /* CLASS, STYLE */)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\"v-if\", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" Collision segments \"), ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.collisionSegments, (segment, index) => {\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", {\n key: `collision-${index}`,\n class: \"collision-segment\",\n style: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeStyle)({\n left: `${$setup.getTimePosition(segment.start)}px`,\n width: `${$setup.getTimeWidth(segment.start, segment.end)}px`\n })\n }, null, 4 /* STYLE */);\n }), 128 /* KEYED_FRAGMENT */)), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" Cursor line (snapped to 15-min intervals) \"), $setup.showCursor && $setup.cursorPosition ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", {\n key: 4,\n class: \"timeline-cursor\",\n style: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeStyle)({\n left: `${$setup.getTimePosition($setup.cursorPosition)}px`\n })\n }, null, 4 /* STYLE */)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\"v-if\", true)], 512 /* NEED_PATCH */)], 544 /* NEED_HYDRATION, NEED_PATCH */)], 512 /* NEED_PATCH */))]);\n}\n\n//# sourceURL=webpack://jandl/./src/plugins/tm@modal/task/_components/employees/a-employee-timeblock-timeline.vue?./node_modules/webpack-plugin-vuetify/dist/scriptLoader.js!./node_modules/babel-loader/lib/index.js!./node_modules/ts-loader/index.js??clonedRuleSet-41.use%5B1%5D!./node_modules/vue-loader/dist/templateLoader.js??ruleSet%5B1%5D.rules%5B5%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D\n}"); /***/ }), @@ -2699,7 +2699,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var cor /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ useEmployeeTimeline: function() { return /* binding */ useEmployeeTimeline; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/esnext.iterator.constructor.js */ \"./node_modules/core-js/modules/esnext.iterator.constructor.js\");\n/* harmony import */ var core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/esnext.iterator.for-each.js */ \"./node_modules/core-js/modules/esnext.iterator.for-each.js\");\n/* harmony import */ var core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _tanstack_vue_query__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @tanstack/vue-query */ \"./node_modules/@tanstack/vue-query/build/modern/useQuery.js\");\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.runtime.esm-bundler.js\");\n/* harmony import */ var _plugins_w_custom_axios_models_axios__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/plugins/w@custom/axios/models/axios */ \"./src/plugins/w@custom/axios/models/axios.ts\");\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\");\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _plugins_tm_dashboard_tasks_utils_timeline_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/plugins/tm@dashboard/tasks/_utils/timeline.utils */ \"./src/plugins/tm@dashboard/tasks/_utils/timeline.utils.ts\");\n/* harmony import */ var _timeblock_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./timeblock.utils */ \"./src/plugins/tm@_utils/timeblock.utils.ts\");\n/* provided dependency */ var console = __webpack_require__(/*! ./node_modules/console-browserify/index.js */ \"./node_modules/console-browserify/index.js\");\n\n\n\n\n\n\n\n\n\nfunction useEmployeeTimeline(employee, date, currentTimeblock, otherLocalTimeblocks) {\n // Fetch employee's tasks for the selected date\n const {\n data: tasksData,\n isLoading,\n error,\n refetch\n } = (0,_tanstack_vue_query__WEBPACK_IMPORTED_MODULE_3__.useQuery)({\n queryKey: (0,vue__WEBPACK_IMPORTED_MODULE_4__.computed)(() => ['employee-timeline', (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(employee)?.id, (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(date) ? moment__WEBPACK_IMPORTED_MODULE_6___default()((0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(date)).format('YYYY-MM-DD') : null]),\n queryFn: async () => {\n const emp = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(employee);\n const d = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(date);\n if (!emp?.id || !d) {\n return null;\n }\n const dateStr = moment__WEBPACK_IMPORTED_MODULE_6___default()(d).format('YYYY-MM-DD');\n const queryParams = new URLSearchParams({\n start: dateStr,\n end: dateStr,\n employee_id: emp.id.toString()\n }).toString();\n const response = await _plugins_w_custom_axios_models_axios__WEBPACK_IMPORTED_MODULE_5__[\"default\"].get_auth(`v1/subtasks?${queryParams}`);\n return response;\n },\n enabled: (0,vue__WEBPACK_IMPORTED_MODULE_4__.computed)(() => {\n const emp = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(employee);\n const d = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(date);\n return !!(emp?.id && d);\n })\n });\n // Generate timeline tasks from fetched data\n const timelineTasks = (0,vue__WEBPACK_IMPORTED_MODULE_4__.computed)(() => {\n const data = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(tasksData);\n const emp = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(employee);\n const d = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(date);\n if (!data || !emp || !d) {\n return [];\n }\n const subtasks = [...(data.subtasks || []), ...(data.blockers || [])];\n const selectedDateStr = moment__WEBPACK_IMPORTED_MODULE_6___default()(d).format('YYYY-MM-DD');\n try {\n // Process timeblocks directly instead of using timeline utils\n // which is designed for multi-day views\n const tasks = [];\n subtasks.forEach(subtask => {\n // Check if this is a blocker/adhoc/etc with direct start/end fields (no timeblocks array)\n if (!subtask.timeblocks && subtask.start && subtask.end && ['blocker', 'adhoc', 'home_office', 'vacation', 'free_day', 'office365_blocker'].includes(subtask.type)) {\n const blockerDateStr = moment__WEBPACK_IMPORTED_MODULE_6___default()(subtask.start).format('YYYY-MM-DD');\n if (blockerDateStr === selectedDateStr) {\n const type = subtask.type;\n const task = {\n id: subtask.id,\n start: new Date(subtask.start),\n end: new Date(subtask.end),\n master_task: null,\n date: new Date(subtask.start),\n project_code: null,\n subtask: subtask,\n blocker: subtask,\n type,\n _timeblock_id: null,\n _timeblock_is_finished: subtask.is_finished || false,\n _real_start: new Date(subtask.start),\n _real_end: new Date(subtask.end)\n };\n tasks.push(task);\n }\n } else {\n // Process regular subtasks with timeblocks array\n subtask.timeblocks?.forEach(timeblock => {\n const timeblockDateStr = moment__WEBPACK_IMPORTED_MODULE_6___default()(timeblock.start).format('YYYY-MM-DD');\n // Only include timeblocks for the selected date\n if (timeblockDateStr === selectedDateStr) {\n let type = 'subtask';\n if (subtask.type === 'office365') type = 'office365';\n const task = {\n id: subtask.id,\n start: new Date(timeblock.start),\n end: new Date(timeblock.end),\n master_task: subtask.master_task,\n date: new Date(timeblock.start),\n project_code: subtask.project_code,\n subtask: subtask,\n blocker: undefined,\n type,\n _timeblock_id: timeblock.id,\n _timeblock_is_finished: timeblock.is_finished,\n _real_start: new Date(timeblock.start),\n _real_end: new Date(timeblock.end)\n };\n tasks.push(task);\n }\n });\n }\n });\n return tasks;\n } catch (error) {\n console.error('Error generating timeline tasks:', error);\n return [];\n }\n });\n // Calculate scheduled time for the day (in hours)\n const scheduledTime = (0,vue__WEBPACK_IMPORTED_MODULE_4__.computed)(() => {\n const tasks = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(timelineTasks);\n const d = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(date);\n if (!tasks || !d) return 0;\n let totalMinutes = 0;\n tasks.forEach(task => {\n if (task.type === 'non-working-hours' || task.subtask?.is_finished || task.blocker?.is_finished) {\n return;\n }\n totalMinutes += _plugins_tm_dashboard_tasks_utils_timeline_utils__WEBPACK_IMPORTED_MODULE_7__[\"default\"]._getDifferenceInMinutes(task._real_end, task._real_start);\n });\n return (totalMinutes / 60).toFixed(1);\n });\n // Calculate free/unscheduled time for the day (in hours)\n const freeTime = (0,vue__WEBPACK_IMPORTED_MODULE_4__.computed)(() => {\n const emp = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(employee);\n const d = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(date);\n const scheduled = parseFloat(String((0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(scheduledTime)));\n if (!emp || !d) return '0';\n // Calculate duration of other local unsaved timeblocks for the same date\n let localTimeblocksHours = 0;\n if (otherLocalTimeblocks) {\n const localTbs = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(otherLocalTimeblocks) || [];\n localTbs.forEach(tb => {\n // Only count timeblocks with complete time data\n if (tb.starts_at_time && tb.ends_at_time) {\n localTimeblocksHours += (0,_timeblock_utils__WEBPACK_IMPORTED_MODULE_8__.calculateTimeblockDuration)(tb);\n }\n });\n }\n // Also include the current timeblock if it has both start and end times\n const currentTb = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(currentTimeblock);\n if (currentTb?.starts_at_time && currentTb?.ends_at_time) {\n localTimeblocksHours += (0,_timeblock_utils__WEBPACK_IMPORTED_MODULE_8__.calculateTimeblockDuration)(currentTb);\n }\n const dailyCapacityHours = emp.work_end - emp.work_start;\n return (dailyCapacityHours - scheduled - localTimeblocksHours).toFixed(1);\n });\n // Detect collisions with current timeblock\n const collision = (0,vue__WEBPACK_IMPORTED_MODULE_4__.computed)(() => {\n const timeblock = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(currentTimeblock);\n const tasks = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(timelineTasks);\n if (!timeblock || !tasks) {\n return {\n hasCollision: false,\n startCollides: false,\n endCollides: false,\n collidingTasks: []\n };\n }\n return (0,_timeblock_utils__WEBPACK_IMPORTED_MODULE_8__.detectCollision)(timeblock, tasks);\n });\n // Get collision segments for timeline visualization\n const collisionSegments = (0,vue__WEBPACK_IMPORTED_MODULE_4__.computed)(() => {\n const timeblock = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(currentTimeblock);\n const tasks = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(timelineTasks);\n if (!timeblock || !tasks) {\n return [];\n }\n return (0,_timeblock_utils__WEBPACK_IMPORTED_MODULE_8__.getCollisionSegments)(timeblock, tasks);\n });\n // Calculate current timeblock duration\n const timeblockDuration = (0,vue__WEBPACK_IMPORTED_MODULE_4__.computed)(() => {\n const timeblock = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(currentTimeblock);\n if (!timeblock) return 0;\n return (0,_timeblock_utils__WEBPACK_IMPORTED_MODULE_8__.calculateTimeblockDuration)(timeblock);\n });\n return {\n // Query states\n isLoading,\n error,\n refetch,\n // Timeline data\n timelineTasks,\n scheduledTime,\n freeTime,\n // Collision detection\n collision,\n collisionSegments,\n timeblockDuration\n };\n}\n\n//# sourceURL=webpack://jandl/./src/plugins/tm@_utils/useEmployeeTimeline.ts?\n}"); +eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ useEmployeeTimeline: function() { return /* binding */ useEmployeeTimeline; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/esnext.iterator.constructor.js */ \"./node_modules/core-js/modules/esnext.iterator.constructor.js\");\n/* harmony import */ var core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/esnext.iterator.for-each.js */ \"./node_modules/core-js/modules/esnext.iterator.for-each.js\");\n/* harmony import */ var core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _tanstack_vue_query__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @tanstack/vue-query */ \"./node_modules/@tanstack/vue-query/build/modern/useQuery.js\");\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.runtime.esm-bundler.js\");\n/* harmony import */ var _plugins_w_custom_axios_models_axios__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/plugins/w@custom/axios/models/axios */ \"./src/plugins/w@custom/axios/models/axios.ts\");\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\");\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _plugins_tm_dashboard_tasks_utils_timeline_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/plugins/tm@dashboard/tasks/_utils/timeline.utils */ \"./src/plugins/tm@dashboard/tasks/_utils/timeline.utils.ts\");\n/* harmony import */ var _timeblock_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./timeblock.utils */ \"./src/plugins/tm@_utils/timeblock.utils.ts\");\n/* provided dependency */ var console = __webpack_require__(/*! ./node_modules/console-browserify/index.js */ \"./node_modules/console-browserify/index.js\");\n\n\n\n\n\n\n\n\n\nfunction useEmployeeTimeline(employee, date, currentTimeblock, otherLocalTimeblocks) {\n // Fetch employee's tasks for the selected date\n const {\n data: tasksData,\n isLoading,\n error,\n refetch\n } = (0,_tanstack_vue_query__WEBPACK_IMPORTED_MODULE_3__.useQuery)({\n queryKey: (0,vue__WEBPACK_IMPORTED_MODULE_4__.computed)(() => ['employee-timeline', (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(employee)?.id, (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(date) ? moment__WEBPACK_IMPORTED_MODULE_6___default()((0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(date)).format('YYYY-MM-DD') : null]),\n queryFn: async () => {\n const emp = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(employee);\n const d = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(date);\n if (!emp?.id || !d) {\n return null;\n }\n const dateStr = moment__WEBPACK_IMPORTED_MODULE_6___default()(d).format('YYYY-MM-DD');\n const queryParams = new URLSearchParams({\n start: dateStr,\n end: dateStr,\n employee_id: emp.id.toString()\n }).toString();\n const response = await _plugins_w_custom_axios_models_axios__WEBPACK_IMPORTED_MODULE_5__[\"default\"].get_auth(`v1/subtasks?${queryParams}`);\n return response;\n },\n enabled: (0,vue__WEBPACK_IMPORTED_MODULE_4__.computed)(() => {\n const emp = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(employee);\n const d = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(date);\n return !!(emp?.id && d);\n })\n });\n const {\n data: conceptTasksData,\n isLoading: conceptTasksLoading,\n error: conceptTasksError,\n refetch: conceptTasksRefetch\n } = (0,_tanstack_vue_query__WEBPACK_IMPORTED_MODULE_3__.useQuery)({\n queryKey: (0,vue__WEBPACK_IMPORTED_MODULE_4__.computed)(() => ['concept-employee-timeline', (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(employee)?.id, (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(date) ? moment__WEBPACK_IMPORTED_MODULE_6___default()((0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(date)).format('YYYY-MM-DD') : null]),\n queryFn: async () => {\n const emp = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(employee);\n const d = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(date);\n if (!emp?.id || !d) {\n return null;\n }\n const dateStr = moment__WEBPACK_IMPORTED_MODULE_6___default()(d).format('YYYY-MM-DD');\n const queryParams = new URLSearchParams({\n start: dateStr,\n end: dateStr,\n employee_id: emp.id.toString(),\n type: 'draft'\n }).toString();\n const response = await _plugins_w_custom_axios_models_axios__WEBPACK_IMPORTED_MODULE_5__[\"default\"].get_auth(`v1/subtasks?${queryParams}`);\n return response;\n },\n enabled: (0,vue__WEBPACK_IMPORTED_MODULE_4__.computed)(() => {\n const emp = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(employee);\n const d = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(date);\n return !!(emp?.id && d);\n })\n });\n // Generate timeline tasks from fetched data\n const timelineTasks = (0,vue__WEBPACK_IMPORTED_MODULE_4__.computed)(() => {\n const data = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(tasksData);\n const conceptData = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(conceptTasksData);\n const emp = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(employee);\n const d = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(date);\n if (!data || !conceptData || !emp || !d) {\n return [];\n }\n const subtasks = [...(data.subtasks || []), ...(data.blockers || []), ...(conceptData.subtasks || [])];\n const selectedDateStr = moment__WEBPACK_IMPORTED_MODULE_6___default()(d).format('YYYY-MM-DD');\n try {\n // Process timeblocks directly instead of using timeline utils\n // which is designed for multi-day views\n const tasks = [];\n subtasks.forEach(subtask => {\n // Check if this is a blocker/adhoc/etc with direct start/end fields (no timeblocks array)\n if (!subtask.timeblocks && subtask.start && subtask.end && ['blocker', 'adhoc', 'home_office', 'vacation', 'free_day', 'office365_blocker'].includes(subtask.type)) {\n const blockerDateStr = moment__WEBPACK_IMPORTED_MODULE_6___default()(subtask.start).format('YYYY-MM-DD');\n if (blockerDateStr === selectedDateStr) {\n const type = subtask.type;\n const task = {\n id: subtask.id,\n start: new Date(subtask.start),\n end: new Date(subtask.end),\n master_task: null,\n date: new Date(subtask.start),\n project_code: null,\n subtask: subtask,\n is_draft: !!subtask.is_draft,\n blocker: subtask,\n type,\n _timeblock_id: null,\n _timeblock_is_finished: subtask.is_finished || false,\n _real_start: new Date(subtask.start),\n _real_end: new Date(subtask.end)\n };\n tasks.push(task);\n }\n } else {\n // Process regular subtasks with timeblocks array\n subtask.timeblocks?.forEach(timeblock => {\n const timeblockDateStr = moment__WEBPACK_IMPORTED_MODULE_6___default()(timeblock.start).format('YYYY-MM-DD');\n // Only include timeblocks for the selected date\n if (timeblockDateStr === selectedDateStr) {\n let type = 'subtask';\n if (subtask.type === 'office365') type = 'office365';\n const task = {\n id: subtask.id,\n start: new Date(timeblock.start),\n end: new Date(timeblock.end),\n master_task: subtask.master_task,\n date: new Date(timeblock.start),\n project_code: subtask.project_code,\n subtask: subtask,\n is_draft: !!subtask.is_draft,\n blocker: undefined,\n type,\n _timeblock_id: timeblock.id,\n _timeblock_is_finished: timeblock.is_finished,\n _real_start: new Date(timeblock.start),\n _real_end: new Date(timeblock.end)\n };\n tasks.push(task);\n }\n });\n }\n });\n return tasks;\n } catch (error) {\n console.error('Error generating timeline tasks:', error);\n return [];\n }\n });\n // Calculate scheduled time for the day (in hours)\n const scheduledTime = (0,vue__WEBPACK_IMPORTED_MODULE_4__.computed)(() => {\n const tasks = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(timelineTasks);\n const d = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(date);\n if (!tasks || !d) return 0;\n let totalMinutes = 0;\n tasks.forEach(task => {\n if (task.type === 'non-working-hours' || task.subtask?.is_finished || task.blocker?.is_finished) {\n return;\n }\n totalMinutes += _plugins_tm_dashboard_tasks_utils_timeline_utils__WEBPACK_IMPORTED_MODULE_7__[\"default\"]._getDifferenceInMinutes(task._real_end, task._real_start);\n });\n return (totalMinutes / 60).toFixed(1);\n });\n // Calculate free/unscheduled time for the day (in hours)\n const freeTime = (0,vue__WEBPACK_IMPORTED_MODULE_4__.computed)(() => {\n const emp = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(employee);\n const d = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(date);\n const scheduled = parseFloat(String((0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(scheduledTime)));\n if (!emp || !d) return '0';\n // Calculate duration of other local unsaved timeblocks for the same date\n let localTimeblocksHours = 0;\n if (otherLocalTimeblocks) {\n const localTbs = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(otherLocalTimeblocks) || [];\n localTbs.forEach(tb => {\n // Only count timeblocks with complete time data\n if (tb.starts_at_time && tb.ends_at_time) {\n localTimeblocksHours += (0,_timeblock_utils__WEBPACK_IMPORTED_MODULE_8__.calculateTimeblockDuration)(tb);\n }\n });\n }\n // Also include the current timeblock if it has both start and end times\n const currentTb = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(currentTimeblock);\n if (currentTb?.starts_at_time && currentTb?.ends_at_time) {\n localTimeblocksHours += (0,_timeblock_utils__WEBPACK_IMPORTED_MODULE_8__.calculateTimeblockDuration)(currentTb);\n }\n const dailyCapacityHours = emp.work_end - emp.work_start;\n return (dailyCapacityHours - scheduled - localTimeblocksHours).toFixed(1);\n });\n // Detect collisions with current timeblock\n const collision = (0,vue__WEBPACK_IMPORTED_MODULE_4__.computed)(() => {\n const timeblock = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(currentTimeblock);\n const tasks = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(timelineTasks);\n if (!timeblock || !tasks) {\n return {\n hasCollision: false,\n startCollides: false,\n endCollides: false,\n collidingTasks: []\n };\n }\n return (0,_timeblock_utils__WEBPACK_IMPORTED_MODULE_8__.detectCollision)(timeblock, tasks);\n });\n // Get collision segments for timeline visualization\n const collisionSegments = (0,vue__WEBPACK_IMPORTED_MODULE_4__.computed)(() => {\n const timeblock = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(currentTimeblock);\n const tasks = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(timelineTasks);\n if (!timeblock || !tasks) {\n return [];\n }\n return (0,_timeblock_utils__WEBPACK_IMPORTED_MODULE_8__.getCollisionSegments)(timeblock, tasks);\n });\n // Calculate current timeblock duration\n const timeblockDuration = (0,vue__WEBPACK_IMPORTED_MODULE_4__.computed)(() => {\n const timeblock = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(currentTimeblock);\n if (!timeblock) return 0;\n return (0,_timeblock_utils__WEBPACK_IMPORTED_MODULE_8__.calculateTimeblockDuration)(timeblock);\n });\n return {\n // Query states\n isLoading,\n error,\n refetch,\n conceptTasksLoading,\n conceptTasksError,\n conceptTasksRefetch,\n // Timeline data\n timelineTasks,\n scheduledTime,\n freeTime,\n // Collision detection\n collision,\n collisionSegments,\n timeblockDuration\n };\n}\n\n//# sourceURL=webpack://jandl/./src/plugins/tm@_utils/useEmployeeTimeline.ts?\n}"); /***/ }),