{"version":3,"file":"services-2f-5NaoN.js","sources":["../../../node_modules/svelte/src/runtime/internal/globals.js","../../../node_modules/@event-calendar/interaction/index.js","../../../app/frontend/entrypoints/controllers/ticket/overview/show/services.ts"],"sourcesContent":["/** @type {typeof globalThis} */\nexport const globals =\n\ttypeof window !== 'undefined'\n\t\t? window\n\t\t: typeof globalThis !== 'undefined'\n\t\t? globalThis\n\t\t: // @ts-ignore Node typings have this\n\t\t global;\n","import { writable } from 'svelte/store';\nimport { SvelteComponent, init, safe_not_equal, noop, listen, is_function, run_all, component_subscribe, globals, set_store_value, bubble, empty, insert, detach, element, attr, create_component, space, mount_component, transition_in, group_outros, transition_out, check_outros, destroy_component, binding_callbacks } from 'svelte/internal';\nimport { getContext } from 'svelte';\nimport { max, min, cloneDate, addDuration, listView, getElementWithPayload, getPayload, ancestor, createDuration, subtractDuration, toEventWithLocalDates, toISOString, toViewWithLocalDates, cloneEvent, assign, toLocalDate, rect, addDay, floor, bgEvent, helperEvent } from '@event-calendar/core';\n\nlet busy = false;\nfunction animate(fn) {\n if (!busy) {\n busy = true;\n window.requestAnimationFrame(() => {\n fn();\n busy = false;\n });\n }\n}\n\nfunction limit(value, minLimit, maxLimit) {\n return max(minLimit, min(maxLimit, value));\n}\n\n/* packages/interaction/src/Action.svelte generated by Svelte v4.2.8 */\n\nconst { window: window_1 } = globals;\n\nfunction create_fragment$3(ctx) {\n\tlet mounted;\n\tlet dispose;\n\n\treturn {\n\t\tc: noop,\n\t\tm(target, anchor) {\n\t\t\tif (!mounted) {\n\t\t\t\tdispose = [\n\t\t\t\t\tlisten(window_1, \"pointermove\", /*handlePointerMove*/ ctx[31]),\n\t\t\t\t\tlisten(window_1, \"pointerup\", /*handlePointerUp*/ ctx[32]),\n\t\t\t\t\tlisten(window_1, \"pointercancel\", /*handlePointerUp*/ ctx[32]),\n\t\t\t\t\tlisten(window_1, \"scroll\", /*handleScroll*/ ctx[0]),\n\t\t\t\t\tlisten(window_1, \"selectstart\", createPreventDefaultHandler(/*complexAction*/ ctx[33])),\n\t\t\t\t\tlisten(window_1, \"contextmenu\", function () {\n\t\t\t\t\t\tif (is_function(createPreventDefaultHandler(/*contextmenu_handler*/ ctx[41]))) createPreventDefaultHandler(/*contextmenu_handler*/ ctx[41]).apply(this, arguments);\n\t\t\t\t\t}),\n\t\t\t\t\tlisten(window_1, \"touchstart\", /*handleTouchStart*/ ctx[34]),\n\t\t\t\t\tlisten(window_1, \"touchmove\", /*touchmove_handler*/ ctx[40], { passive: false })\n\t\t\t\t];\n\n\t\t\t\tmounted = true;\n\t\t\t}\n\t\t},\n\t\tp(new_ctx, dirty) {\n\t\t\tctx = new_ctx;\n\t\t},\n\t\ti: noop,\n\t\to: noop,\n\t\td(detaching) {\n\t\t\tmounted = false;\n\t\t\trun_all(dispose);\n\t\t}\n\t};\n}\n\nconst ACTION_DRAG = 1;\nconst ACTION_RESIZE = 2;\nconst ACTION_SELECT = 3;\nconst ACTION_CLICK = 4;\nconst ACTION_NO_ACTION = 5;\n\nfunction validJsEvent(jsEvent) {\n\treturn jsEvent.isPrimary && (jsEvent.pointerType !== 'mouse' || jsEvent.buttons & 1);\n}\n\nfunction createPreventDefaultHandler(condition) {\n\treturn jsEvent => {\n\t\tif (condition()) {\n\t\t\tjsEvent.preventDefault();\n\t\t}\n\t};\n}\n\nfunction instance$3($$self, $$props, $$invalidate) {\n\tlet $_view;\n\tlet $unselectFn;\n\tlet $_events;\n\tlet $_iEvents;\n\tlet $selectBackgroundColor;\n\tlet $_dayGrid;\n\tlet $_iClass;\n\tlet $dateClick;\n\tlet $eventDrop;\n\tlet $eventResize;\n\tlet $eventDragStop;\n\tlet $eventResizeStop;\n\tlet $selectFn;\n\tlet $unselectCancel;\n\tlet $unselectAuto;\n\tlet $slotHeight;\n\tlet $dragScroll;\n\tlet $eventDragStart;\n\tlet $eventResizeStart;\n\tlet $eventDragMinDistance;\n\tlet $selectMinDistance;\n\tlet $longPressDelay;\n\tlet $eventLongPressDelay;\n\tlet $selectLongPressDelay;\n\tlet $datesAboveResources;\n\tlet $slotDuration;\n\tlet $view;\n\tlet $selectable;\n\tlet $_draggable;\n\tlet { _iEvents, _iClass, _events, _view, _dayGrid, _draggable, dateClick, dragScroll, datesAboveResources, eventDragMinDistance, eventDragStart, eventDragStop, eventDrop, eventLongPressDelay, eventResizeStart, eventResizeStop, eventResize, longPressDelay, selectable, select: selectFn, selectBackgroundColor, selectLongPressDelay, selectMinDistance, slotDuration, slotHeight, unselect: unselectFn, unselectAuto, unselectCancel, view } = getContext('state');\n\tcomponent_subscribe($$self, _iEvents, value => $$invalidate(69, $_iEvents = value));\n\tcomponent_subscribe($$self, _iClass, value => $$invalidate(72, $_iClass = value));\n\tcomponent_subscribe($$self, _events, value => $$invalidate(68, $_events = value));\n\tcomponent_subscribe($$self, _view, value => $$invalidate(66, $_view = value));\n\tcomponent_subscribe($$self, _dayGrid, value => $$invalidate(71, $_dayGrid = value));\n\tcomponent_subscribe($$self, _draggable, value => $$invalidate(94, $_draggable = value));\n\tcomponent_subscribe($$self, dateClick, value => $$invalidate(73, $dateClick = value));\n\tcomponent_subscribe($$self, dragScroll, value => $$invalidate(82, $dragScroll = value));\n\tcomponent_subscribe($$self, datesAboveResources, value => $$invalidate(90, $datesAboveResources = value));\n\tcomponent_subscribe($$self, eventDragMinDistance, value => $$invalidate(85, $eventDragMinDistance = value));\n\tcomponent_subscribe($$self, eventDragStart, value => $$invalidate(83, $eventDragStart = value));\n\tcomponent_subscribe($$self, eventDragStop, value => $$invalidate(76, $eventDragStop = value));\n\tcomponent_subscribe($$self, eventDrop, value => $$invalidate(74, $eventDrop = value));\n\tcomponent_subscribe($$self, eventLongPressDelay, value => $$invalidate(88, $eventLongPressDelay = value));\n\tcomponent_subscribe($$self, eventResizeStart, value => $$invalidate(84, $eventResizeStart = value));\n\tcomponent_subscribe($$self, eventResizeStop, value => $$invalidate(77, $eventResizeStop = value));\n\tcomponent_subscribe($$self, eventResize, value => $$invalidate(75, $eventResize = value));\n\tcomponent_subscribe($$self, longPressDelay, value => $$invalidate(87, $longPressDelay = value));\n\tcomponent_subscribe($$self, selectable, value => $$invalidate(93, $selectable = value));\n\tcomponent_subscribe($$self, selectFn, value => $$invalidate(78, $selectFn = value));\n\tcomponent_subscribe($$self, selectBackgroundColor, value => $$invalidate(70, $selectBackgroundColor = value));\n\tcomponent_subscribe($$self, selectLongPressDelay, value => $$invalidate(89, $selectLongPressDelay = value));\n\tcomponent_subscribe($$self, selectMinDistance, value => $$invalidate(86, $selectMinDistance = value));\n\tcomponent_subscribe($$self, slotDuration, value => $$invalidate(91, $slotDuration = value));\n\tcomponent_subscribe($$self, slotHeight, value => $$invalidate(81, $slotHeight = value));\n\tcomponent_subscribe($$self, unselectFn, value => $$invalidate(67, $unselectFn = value));\n\tcomponent_subscribe($$self, unselectAuto, value => $$invalidate(80, $unselectAuto = value));\n\tcomponent_subscribe($$self, unselectCancel, value => $$invalidate(79, $unselectCancel = value));\n\tcomponent_subscribe($$self, view, value => $$invalidate(92, $view = value));\n\tlet action;\n\tlet interacting;\n\tlet event;\n\tlet display;\n\tlet date, newDate;\n\tlet resource, newResource;\n\tlet fromX, fromY;\n\tlet toX, toY;\n\tlet bodyEl, bodyRect, clipEl, clipRect;\n\tlet delta;\n\tlet allDay;\n\tlet iClass;\n\tlet minEnd; // minimum end time when resizing\n\tlet selectStep; // minimum selection step\n\tlet selected; // whether selection has been made\n\tlet noDateClick; // do not perform date click\n\tlet timer; // timer for long press delays\n\tlet viewport;\n\n\tfunction drag(eventToDrag, jsEvent, resize, forceDate) {\n\t\tif (!action) {\n\t\t\taction = validJsEvent(jsEvent)\n\t\t\t? resize\n\t\t\t\t? ACTION_RESIZE\n\t\t\t\t: $_draggable(eventToDrag)\n\t\t\t\t\t? ACTION_DRAG\n\t\t\t\t\t: ACTION_NO_ACTION\n\t\t\t: ACTION_NO_ACTION;\n\n\t\t\tif (complexAction()) {\n\t\t\t\tevent = eventToDrag;\n\t\t\t\tcommon(jsEvent);\n\n\t\t\t\tif (forceDate) {\n\t\t\t\t\t// Force date in popup\n\t\t\t\t\tdate = forceDate;\n\t\t\t\t}\n\n\t\t\t\tiClass = resize ? allDay ? 'resizingX' : 'resizingY' : 'dragging';\n\n\t\t\t\tif (resize) {\n\t\t\t\t\tminEnd = cloneDate(event.start);\n\n\t\t\t\t\tif (allDay) {\n\t\t\t\t\t\tminEnd.setUTCHours(event.end.getUTCHours(), event.end.getUTCMinutes(), event.end.getUTCSeconds(), 0);\n\n\t\t\t\t\t\tif (minEnd < event.start) {\n\t\t\t\t\t\t\taddDay(minEnd);\n\t\t\t\t\t\t} // minEnd = addDuration(cloneDate(event.start), $slotDuration); alternative version\n\t\t\t\t\t} else {\n\t\t\t\t\t\taddDuration(minEnd, $slotDuration);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tmove(jsEvent);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction select(jsEvent) {\n\t\tif (!action) {\n\t\t\taction = validJsEvent(jsEvent)\n\t\t\t? $selectable && !listView($view)\n\t\t\t\t? ACTION_SELECT\n\t\t\t\t: ACTION_CLICK\n\t\t\t: ACTION_NO_ACTION;\n\n\t\t\tif (complexAction()) {\n\t\t\t\tcommon(jsEvent);\n\t\t\t\tiClass = 'selecting';\n\t\t\t\tselectStep = allDay ? createDuration({ day: 1 }) : $slotDuration;\n\n\t\t\t\t// Create dummy source event\n\t\t\t\tevent = {\n\t\t\t\t\tallDay,\n\t\t\t\t\tstart: date,\n\t\t\t\t\tend: addDuration(cloneDate(date), selectStep),\n\t\t\t\t\tresourceIds: resource ? [resource.id] : []\n\t\t\t\t};\n\n\t\t\t\tmove(jsEvent);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction noAction() {\n\t\tif (!action) {\n\t\t\taction = ACTION_NO_ACTION;\n\t\t}\n\t}\n\n\tfunction common(jsEvent) {\n\t\twindow.getSelection().removeAllRanges();\n\t\tfromX = toX = jsEvent.clientX;\n\t\tfromY = toY = jsEvent.clientY;\n\t\tlet dayEl = getElementWithPayload(toX, toY);\n\t\t({ allDay, date, resource } = getPayload(dayEl)(toY));\n\t\tbodyEl = ancestor(dayEl, resource ? 4 : 3);\n\t\tclipEl = ancestor(dayEl, resource && (dragging() || $datesAboveResources) ? 2 : 1);\n\t\tcalcViewport();\n\n\t\tif (jsEvent.pointerType !== 'mouse') {\n\t\t\t// For touch devices init long press delay\n\t\t\t$$invalidate(1, timer = setTimeout(\n\t\t\t\t() => {\n\t\t\t\t\tif (action) {\n\t\t\t\t\t\tinteracting = true;\n\t\t\t\t\t\tmove(jsEvent);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t(selecting()\n\t\t\t\t? $selectLongPressDelay\n\t\t\t\t: $eventLongPressDelay) ?? $longPressDelay\n\t\t\t));\n\t\t}\n\t}\n\n\tfunction move(jsEvent) {\n\t\tif (interacting || jsEvent && jsEvent.pointerType === 'mouse' && distance() >= (selecting() ? $selectMinDistance : $eventDragMinDistance)) {\n\t\t\tinteracting = true;\n\t\t\tunselect(jsEvent);\n\t\t\tset_store_value(_iClass, $_iClass = iClass, $_iClass);\n\n\t\t\tif (!$_iEvents[0]) {\n\t\t\t\tif (selecting()) {\n\t\t\t\t\tcreateIEventSelect();\n\t\t\t\t} else {\n\t\t\t\t\tcreateIEvent(jsEvent, resizing() ? $eventResizeStart : $eventDragStart);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet dayEl = findDayEl();\n\n\t\t\tif (dayEl) {\n\t\t\t\tlet newAllDay;\n\t\t\t\t({ allDay: newAllDay, date: newDate, resource: newResource } = getPayload(dayEl)(toY));\n\n\t\t\t\tif (newAllDay === allDay) {\n\t\t\t\t\tdelta = createDuration((newDate - date) / 1000);\n\t\t\t\t\tset_store_value(_iEvents, $_iEvents[0].end = addDuration(cloneDate(event.end), delta), $_iEvents);\n\n\t\t\t\t\tif (resizing()) {\n\t\t\t\t\t\t// Resizing\n\t\t\t\t\t\tif ($_iEvents[0].end < minEnd) {\n\t\t\t\t\t\t\tset_store_value(_iEvents, $_iEvents[0].end = minEnd, $_iEvents);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (selecting()) {\n\t\t\t\t\t\t// Selecting\n\t\t\t\t\t\tif ($_iEvents[0].end < event.end) {\n\t\t\t\t\t\t\tset_store_value(_iEvents, $_iEvents[0].start = subtractDuration($_iEvents[0].end, selectStep), $_iEvents);\n\t\t\t\t\t\t\tset_store_value(_iEvents, $_iEvents[0].end = event.end, $_iEvents);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tset_store_value(_iEvents, $_iEvents[0].start = event.start, $_iEvents);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Dragging\n\t\t\t\t\t\tset_store_value(_iEvents, $_iEvents[0].start = addDuration(cloneDate(event.start), delta), $_iEvents);\n\n\t\t\t\t\t\tif (resource) {\n\t\t\t\t\t\t\tset_store_value(_iEvents, $_iEvents[0].resourceIds = event.resourceIds.filter(id => id !== resource.id), $_iEvents);\n\t\t\t\t\t\t\t$_iEvents[0].resourceIds.push(newResource.id);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($dragScroll) {\n\t\t\tlet threshold = $slotHeight * 2;\n\n\t\t\tanimate(() => {\n\t\t\t\tif (bodyEl) {\n\t\t\t\t\tif (toY < threshold) {\n\t\t\t\t\t\twindow.scrollBy(0, max(-10, (toY - threshold) / 3));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (toY < bodyRect.top + threshold) {\n\t\t\t\t\t\tbodyEl.scrollTop += max(-10, (toY - bodyRect.top - threshold) / 3);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (toY > window.innerHeight - threshold) {\n\t\t\t\t\t\twindow.scrollBy(0, min(10, (toY - window.innerHeight + threshold) / 3));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (toY > bodyRect.bottom - threshold) {\n\t\t\t\t\t\tbodyEl.scrollTop += min(10, (toY - bodyRect.bottom + threshold) / 3);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tfunction handleScroll() {\n\t\tif (complexAction()) {\n\t\t\tcalcViewport();\n\t\t\tmove();\n\t\t}\n\t}\n\n\tfunction handlePointerMove(jsEvent) {\n\t\tif (complexAction() && jsEvent.isPrimary) {\n\t\t\ttoX = jsEvent.clientX;\n\t\t\ttoY = jsEvent.clientY;\n\t\t\tmove(jsEvent);\n\t\t}\n\t}\n\n\tfunction handlePointerUp(jsEvent) {\n\t\tif (selected && $unselectAuto && !($unselectCancel && jsEvent.target.closest($unselectCancel))) {\n\t\t\tunselect(jsEvent);\n\t\t}\n\n\t\tif (action && jsEvent.isPrimary) {\n\t\t\tif (interacting) {\n\t\t\t\tif (selecting()) {\n\t\t\t\t\tselected = true;\n\n\t\t\t\t\tif (is_function($selectFn)) {\n\t\t\t\t\t\tlet { start, end } = toEventWithLocalDates($_iEvents[0]);\n\n\t\t\t\t\t\t$selectFn({\n\t\t\t\t\t\t\tstart,\n\t\t\t\t\t\t\tend,\n\t\t\t\t\t\t\tstartStr: toISOString($_iEvents[0].start),\n\t\t\t\t\t\t\tendStr: toISOString($_iEvents[0].end),\n\t\t\t\t\t\t\tallDay,\n\t\t\t\t\t\t\tjsEvent,\n\t\t\t\t\t\t\tview: toViewWithLocalDates($_view),\n\t\t\t\t\t\t\tresource\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tevent.display = display;\n\t\t\t\t\tlet callback = resizing() ? $eventResizeStop : $eventDragStop;\n\n\t\t\t\t\tif (is_function(callback)) {\n\t\t\t\t\t\tcallback({\n\t\t\t\t\t\t\tevent: toEventWithLocalDates(event),\n\t\t\t\t\t\t\tjsEvent,\n\t\t\t\t\t\t\tview: toViewWithLocalDates($_view)\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tlet oldEvent = cloneEvent(event);\n\t\t\t\t\tupdateEvent(event, $_iEvents[0]);\n\t\t\t\t\tdestroyIEvent();\n\t\t\t\t\tcallback = resizing() ? $eventResize : $eventDrop;\n\n\t\t\t\t\tif (is_function(callback)) {\n\t\t\t\t\t\tlet eventRef = event;\n\t\t\t\t\t\tlet info;\n\n\t\t\t\t\t\tif (resizing()) {\n\t\t\t\t\t\t\tinfo = { endDelta: delta };\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tinfo = {\n\t\t\t\t\t\t\t\tdelta,\n\t\t\t\t\t\t\t\toldResource: resource !== newResource ? resource : undefined,\n\t\t\t\t\t\t\t\tnewResource: resource !== newResource ? newResource : undefined\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcallback(assign(info, {\n\t\t\t\t\t\t\tevent: toEventWithLocalDates(event),\n\t\t\t\t\t\t\toldEvent: toEventWithLocalDates(oldEvent),\n\t\t\t\t\t\t\tjsEvent,\n\t\t\t\t\t\t\tview: toViewWithLocalDates($_view),\n\t\t\t\t\t\t\trevert() {\n\t\t\t\t\t\t\t\tupdateEvent(eventRef, oldEvent);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (clicking() || selecting()) {\n\t\t\t\t\t// Perform date click\n\t\t\t\t\tif (is_function($dateClick) && !noDateClick) {\n\t\t\t\t\t\ttoX = jsEvent.clientX;\n\t\t\t\t\t\ttoY = jsEvent.clientY;\n\t\t\t\t\t\tlet dayEl = getElementWithPayload(toX, toY);\n\n\t\t\t\t\t\tif (dayEl) {\n\t\t\t\t\t\t\tlet { allDay, date, resource } = getPayload(dayEl)(toY);\n\n\t\t\t\t\t\t\t$dateClick({\n\t\t\t\t\t\t\t\tallDay,\n\t\t\t\t\t\t\t\tdate: toLocalDate(date),\n\t\t\t\t\t\t\t\tdateStr: toISOString(date),\n\t\t\t\t\t\t\t\tdayEl,\n\t\t\t\t\t\t\t\tjsEvent,\n\t\t\t\t\t\t\t\tview: toViewWithLocalDates($_view),\n\t\t\t\t\t\t\t\tresource\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tinteracting = false;\n\t\t\taction = fromX = fromY = toX = toY = event = display = date = newDate = resource = newResource = delta = allDay = set_store_value(_iClass, $_iClass = minEnd = selectStep = undefined, $_iClass);\n\t\t\tbodyEl = clipEl = bodyRect = clipRect = undefined;\n\n\t\t\tif (timer) {\n\t\t\t\tclearTimeout(timer);\n\t\t\t\t$$invalidate(1, timer = undefined);\n\t\t\t}\n\t\t}\n\n\t\tnoDateClick = false;\n\t}\n\n\tfunction findDayEl() {\n\t\t// Limit coordinates to viewport\n\t\treturn getElementWithPayload(limit(toX, viewport[0], viewport[1]), limit(toY, viewport[2], viewport[3]));\n\t}\n\n\tfunction calcViewport() {\n\t\tbodyRect = rect(bodyEl);\n\t\tclipRect = rect(clipEl);\n\n\t\tviewport = [\n\t\t\tmax(0, clipRect.left + ($_dayGrid ? 0 : 8)),\n\t\t\tmin(\n\t\t\t\tdocument.documentElement.clientWidth,\n\t\t\t\tclipRect.right\n\t\t\t) - 2,\n\t\t\tmax(\n\t\t\t\t0,\n\t\t\t\tbodyRect.top // top\n\t\t\t),\n\t\t\tmin(document.documentElement.clientHeight, bodyRect.bottom) - 2\n\t\t]; // bottom\n\t}\n\n\tfunction createIEvent(jsEvent, callback) {\n\t\tif (is_function(callback)) {\n\t\t\tcallback({\n\t\t\t\tevent: toEventWithLocalDates(event),\n\t\t\t\tjsEvent,\n\t\t\t\tview: toViewWithLocalDates($_view)\n\t\t\t});\n\t\t}\n\n\t\tdisplay = event.display;\n\t\tevent.display = 'preview';\n\t\tset_store_value(_iEvents, $_iEvents[0] = cloneEvent(event), $_iEvents);\n\t\tevent.display = 'ghost';\n\t\t_events.set($_events);\n\t}\n\n\tfunction createIEventSelect() {\n\t\tset_store_value(\n\t\t\t_iEvents,\n\t\t\t$_iEvents[0] = {\n\t\t\t\tid: '{select}',\n\t\t\t\tallDay: event.allDay,\n\t\t\t\tstart: event.start,\n\t\t\t\ttitle: '',\n\t\t\t\tdisplay: 'preview',\n\t\t\t\textendedProps: {},\n\t\t\t\tbackgroundColor: $selectBackgroundColor,\n\t\t\t\tresourceIds: event.resourceIds\n\t\t\t},\n\t\t\t$_iEvents\n\t\t);\n\t}\n\n\tfunction destroyIEvent() {\n\t\tset_store_value(_iEvents, $_iEvents[0] = null, $_iEvents);\n\t}\n\n\tfunction updateEvent(target, source) {\n\t\ttarget.start = source.start;\n\t\ttarget.end = source.end;\n\t\ttarget.resourceIds = source.resourceIds;\n\t\t_events.set($_events);\n\t}\n\n\tfunction distance() {\n\t\treturn Math.sqrt(Math.pow(toX - fromX, 2) + Math.pow(toY - fromY, 2));\n\t}\n\n\tfunction dragging() {\n\t\treturn action === ACTION_DRAG;\n\t}\n\n\tfunction resizing() {\n\t\treturn action === ACTION_RESIZE;\n\t}\n\n\tfunction clicking() {\n\t\treturn action === ACTION_CLICK;\n\t}\n\n\tfunction selecting() {\n\t\treturn action === ACTION_SELECT;\n\t}\n\n\tfunction complexAction() {\n\t\treturn action && action < ACTION_CLICK;\n\t}\n\n\tfunction unselect(jsEvent) {\n\t\tif (selected) {\n\t\t\tselected = false;\n\t\t\tdestroyIEvent();\n\n\t\t\tif (is_function($unselectFn)) {\n\t\t\t\t$unselectFn({\n\t\t\t\t\tjsEvent,\n\t\t\t\t\tview: toViewWithLocalDates($_view)\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction noClick() {\n\t\tnoDateClick = true;\n\t}\n\n\t// Clear selection on view params change\n\t_view.subscribe(unselect);\n\n\tfunction handleTouchStart(jsEvent) {\n\t\tif (complexAction()) {\n\t\t\tlet target = jsEvent.target;\n\t\t\tlet stops = [];\n\t\t\tlet stop = () => run_all(stops);\n\t\t\tstops.push(listen(target, 'touchmove', createPreventDefaultHandler(() => interacting)));\n\t\t\tstops.push(listen(target, 'touchend', stop));\n\t\t\tstops.push(listen(target, 'touchcancel', stop));\n\t\t}\n\t}\n\n\tfunction touchmove_handler(event) {\n\t\tbubble.call(this, $$self, event);\n\t}\n\n\tconst contextmenu_handler = () => timer;\n\n\treturn [\n\t\thandleScroll,\n\t\ttimer,\n\t\t_iEvents,\n\t\t_iClass,\n\t\t_events,\n\t\t_view,\n\t\t_dayGrid,\n\t\t_draggable,\n\t\tdateClick,\n\t\tdragScroll,\n\t\tdatesAboveResources,\n\t\teventDragMinDistance,\n\t\teventDragStart,\n\t\teventDragStop,\n\t\teventDrop,\n\t\teventLongPressDelay,\n\t\teventResizeStart,\n\t\teventResizeStop,\n\t\teventResize,\n\t\tlongPressDelay,\n\t\tselectable,\n\t\tselectFn,\n\t\tselectBackgroundColor,\n\t\tselectLongPressDelay,\n\t\tselectMinDistance,\n\t\tslotDuration,\n\t\tslotHeight,\n\t\tunselectFn,\n\t\tunselectAuto,\n\t\tunselectCancel,\n\t\tview,\n\t\thandlePointerMove,\n\t\thandlePointerUp,\n\t\tcomplexAction,\n\t\thandleTouchStart,\n\t\tdrag,\n\t\tselect,\n\t\tnoAction,\n\t\tunselect,\n\t\tnoClick,\n\t\ttouchmove_handler,\n\t\tcontextmenu_handler\n\t];\n}\n\nclass Action extends SvelteComponent {\n\tconstructor(options) {\n\t\tsuper();\n\n\t\tinit(\n\t\t\tthis,\n\t\t\toptions,\n\t\t\tinstance$3,\n\t\t\tcreate_fragment$3,\n\t\t\tsafe_not_equal,\n\t\t\t{\n\t\t\t\tdrag: 35,\n\t\t\t\tselect: 36,\n\t\t\t\tnoAction: 37,\n\t\t\t\thandleScroll: 0,\n\t\t\t\tunselect: 38,\n\t\t\t\tnoClick: 39\n\t\t\t},\n\t\t\tnull,\n\t\t\t[-1, -1, -1, -1]\n\t\t);\n\t}\n\n\tget drag() {\n\t\treturn this.$$.ctx[35];\n\t}\n\n\tget select() {\n\t\treturn this.$$.ctx[36];\n\t}\n\n\tget noAction() {\n\t\treturn this.$$.ctx[37];\n\t}\n\n\tget handleScroll() {\n\t\treturn this.$$.ctx[0];\n\t}\n\n\tget unselect() {\n\t\treturn this.$$.ctx[38];\n\t}\n\n\tget noClick() {\n\t\treturn this.$$.ctx[39];\n\t}\n}\n\n/* packages/interaction/src/Pointer.svelte generated by Svelte v4.2.8 */\n\nfunction create_fragment$2(ctx) {\n\tlet mounted;\n\tlet dispose;\n\n\treturn {\n\t\tc: noop,\n\t\tm(target, anchor) {\n\t\t\tif (!mounted) {\n\t\t\t\tdispose = [\n\t\t\t\t\tlisten(window, \"pointermove\", /*handlePointerMove*/ ctx[5]),\n\t\t\t\t\tlisten(window, \"scroll\", /*handleScroll*/ ctx[0])\n\t\t\t\t];\n\n\t\t\t\tmounted = true;\n\t\t\t}\n\t\t},\n\t\tp: noop,\n\t\ti: noop,\n\t\to: noop,\n\t\td(detaching) {\n\t\t\tmounted = false;\n\t\t\trun_all(dispose);\n\t\t}\n\t};\n}\n\nfunction validEvent(jsEvent) {\n\treturn jsEvent.isPrimary && jsEvent.pointerType === 'mouse';\n}\n\nfunction instance$2($$self, $$props, $$invalidate) {\n\tlet $_iEvents;\n\tlet $slotDuration;\n\tlet $slotHeight;\n\tlet $_slotTimeLimits;\n\tlet { _iEvents, _events, _viewDates, _slotTimeLimits, slotDuration, slotHeight, hiddenDays, _view, datesAboveResources, theme } = getContext('state');\n\tcomponent_subscribe($$self, _iEvents, value => $$invalidate(9, $_iEvents = value));\n\tcomponent_subscribe($$self, _slotTimeLimits, value => $$invalidate(18, $_slotTimeLimits = value));\n\tcomponent_subscribe($$self, slotDuration, value => $$invalidate(16, $slotDuration = value));\n\tcomponent_subscribe($$self, slotHeight, value => $$invalidate(17, $slotHeight = value));\n\tlet y;\n\tlet colDate;\n\tlet colEl;\n\tlet colRect;\n\tlet resource;\n\tlet date;\n\n\tfunction enterTimeGrid(date, el, jsEvent, resourceObj) {\n\t\tif (validEvent(jsEvent)) {\n\t\t\tcolDate = date;\n\t\t\tcolEl = el;\n\t\t\tcolRect = rect(colEl);\n\t\t\ty = jsEvent.clientY;\n\t\t\tresource = resourceObj;\n\t\t}\n\t}\n\n\tfunction enterDayGrid(date, jsEvent) {\n\t\tif (validEvent(jsEvent)) {\n\t\t\tcolDate = date;\n\t\t\tcolEl = null;\n\t\t\ty = resource = undefined;\n\t\t}\n\t}\n\n\tfunction leave(jsEvent) {\n\t\tif (validEvent(jsEvent)) {\n\t\t\tremovePointerEvent();\n\t\t}\n\t}\n\n\tfunction move() {\n\t\tif (!colDate) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (colEl) {\n\t\t\t// timeGrid\n\t\t\tlet ry = y - colRect.top;\n\n\t\t\tdate = addDuration(addDuration(cloneDate(colDate), $_slotTimeLimits.min), $slotDuration, floor(ry / $slotHeight));\n\t\t} else {\n\t\t\t// dayGrid\n\t\t\tdate = colDate;\n\t\t}\n\n\t\tif (!$_iEvents[1]) {\n\t\t\tcreatePointerEvent();\n\t\t}\n\n\t\tset_store_value(_iEvents, $_iEvents[1].start = date, $_iEvents);\n\t\tset_store_value(_iEvents, $_iEvents[1].end = addDuration(cloneDate(date), $slotDuration), $_iEvents);\n\t\tset_store_value(_iEvents, $_iEvents[1].resourceIds = resource ? [resource.id] : [], $_iEvents);\n\t}\n\n\tfunction handleScroll() {\n\t\tif (colEl) {\n\t\t\tcolRect = rect(colEl);\n\t\t\tmove();\n\t\t}\n\t}\n\n\tfunction handlePointerMove(jsEvent) {\n\t\tif (validEvent(jsEvent)) {\n\t\t\ty = jsEvent.clientY;\n\t\t\tmove();\n\t\t}\n\t}\n\n\tfunction createPointerEvent() {\n\t\tset_store_value(\n\t\t\t_iEvents,\n\t\t\t$_iEvents[1] = {\n\t\t\t\tid: '{pointer}',\n\t\t\t\ttitle: '',\n\t\t\t\tdisplay: 'pointer',\n\t\t\t\textendedProps: {},\n\t\t\t\tbackgroundColor: 'transparent'\n\t\t\t},\n\t\t\t$_iEvents\n\t\t);\n\t}\n\n\tfunction removePointerEvent() {\n\t\tcolDate = colEl = set_store_value(_iEvents, $_iEvents[1] = null, $_iEvents);\n\t}\n\n\t$$self.$$.update = () => {\n\t\tif ($$self.$$.dirty & /*$_iEvents*/ 512) {\n\t\t\tif ($_iEvents[0]) {\n\t\t\t\tremovePointerEvent();\n\t\t\t}\n\t\t}\n\t};\n\n\treturn [\n\t\thandleScroll,\n\t\t_iEvents,\n\t\t_slotTimeLimits,\n\t\tslotDuration,\n\t\tslotHeight,\n\t\thandlePointerMove,\n\t\tenterTimeGrid,\n\t\tenterDayGrid,\n\t\tleave,\n\t\t$_iEvents\n\t];\n}\n\nclass Pointer extends SvelteComponent {\n\tconstructor(options) {\n\t\tsuper();\n\n\t\tinit(this, options, instance$2, create_fragment$2, safe_not_equal, {\n\t\t\tenterTimeGrid: 6,\n\t\t\tenterDayGrid: 7,\n\t\t\tleave: 8,\n\t\t\thandleScroll: 0\n\t\t});\n\t}\n\n\tget enterTimeGrid() {\n\t\treturn this.$$.ctx[6];\n\t}\n\n\tget enterDayGrid() {\n\t\treturn this.$$.ctx[7];\n\t}\n\n\tget leave() {\n\t\treturn this.$$.ctx[8];\n\t}\n\n\tget handleScroll() {\n\t\treturn this.$$.ctx[0];\n\t}\n}\n\n/* packages/interaction/src/Resizer.svelte generated by Svelte v4.2.8 */\n\nfunction create_if_block$1(ctx) {\n\tlet div;\n\tlet div_class_value;\n\tlet mounted;\n\tlet dispose;\n\n\treturn {\n\t\tc() {\n\t\t\tdiv = element(\"div\");\n\t\t\tattr(div, \"class\", div_class_value = /*$theme*/ ctx[1].resizer);\n\t\t},\n\t\tm(target, anchor) {\n\t\t\tinsert(target, div, anchor);\n\n\t\t\tif (!mounted) {\n\t\t\t\tdispose = listen(div, \"pointerdown\", /*pointerdown_handler*/ ctx[8]);\n\t\t\t\tmounted = true;\n\t\t\t}\n\t\t},\n\t\tp(ctx, dirty) {\n\t\t\tif (dirty & /*$theme*/ 2 && div_class_value !== (div_class_value = /*$theme*/ ctx[1].resizer)) {\n\t\t\t\tattr(div, \"class\", div_class_value);\n\t\t\t}\n\t\t},\n\t\td(detaching) {\n\t\t\tif (detaching) {\n\t\t\t\tdetach(div);\n\t\t\t}\n\n\t\t\tmounted = false;\n\t\t\tdispose();\n\t\t}\n\t};\n}\n\nfunction create_fragment$1(ctx) {\n\tlet if_block_anchor;\n\tlet if_block = /*resizable*/ ctx[0] && create_if_block$1(ctx);\n\n\treturn {\n\t\tc() {\n\t\t\tif (if_block) if_block.c();\n\t\t\tif_block_anchor = empty();\n\t\t},\n\t\tm(target, anchor) {\n\t\t\tif (if_block) if_block.m(target, anchor);\n\t\t\tinsert(target, if_block_anchor, anchor);\n\t\t},\n\t\tp(ctx, [dirty]) {\n\t\t\tif (/*resizable*/ ctx[0]) {\n\t\t\t\tif (if_block) {\n\t\t\t\t\tif_block.p(ctx, dirty);\n\t\t\t\t} else {\n\t\t\t\t\tif_block = create_if_block$1(ctx);\n\t\t\t\t\tif_block.c();\n\t\t\t\t\tif_block.m(if_block_anchor.parentNode, if_block_anchor);\n\t\t\t\t}\n\t\t\t} else if (if_block) {\n\t\t\t\tif_block.d(1);\n\t\t\t\tif_block = null;\n\t\t\t}\n\t\t},\n\t\ti: noop,\n\t\to: noop,\n\t\td(detaching) {\n\t\t\tif (detaching) {\n\t\t\t\tdetach(if_block_anchor);\n\t\t\t}\n\n\t\t\tif (if_block) if_block.d(detaching);\n\t\t}\n\t};\n}\n\nfunction instance$1($$self, $$props, $$invalidate) {\n\tlet $editable;\n\tlet $eventDurationEditable;\n\tlet $theme;\n\tlet { event } = $$props;\n\tlet { theme, eventDurationEditable, editable } = getContext('state');\n\tcomponent_subscribe($$self, theme, value => $$invalidate(1, $theme = value));\n\tcomponent_subscribe($$self, eventDurationEditable, value => $$invalidate(7, $eventDurationEditable = value));\n\tcomponent_subscribe($$self, editable, value => $$invalidate(6, $editable = value));\n\tlet resizable;\n\n\tfunction pointerdown_handler(event) {\n\t\tbubble.call(this, $$self, event);\n\t}\n\n\t$$self.$$set = $$props => {\n\t\tif ('event' in $$props) $$invalidate(5, event = $$props.event);\n\t};\n\n\t$$self.$$.update = () => {\n\t\tif ($$self.$$.dirty & /*event, $eventDurationEditable, $editable*/ 224) {\n\t\t\t$$invalidate(0, resizable = !bgEvent(event.display) && !helperEvent(event.display) && ((event.durationEditable ?? $eventDurationEditable) || (event.editable ?? $editable)));\n\t\t}\n\t};\n\n\treturn [\n\t\tresizable,\n\t\t$theme,\n\t\ttheme,\n\t\teventDurationEditable,\n\t\teditable,\n\t\tevent,\n\t\t$editable,\n\t\t$eventDurationEditable,\n\t\tpointerdown_handler\n\t];\n}\n\nclass Resizer extends SvelteComponent {\n\tconstructor(options) {\n\t\tsuper();\n\t\tinit(this, options, instance$1, create_fragment$1, safe_not_equal, { event: 5 });\n\t}\n}\n\n/* packages/interaction/src/Auxiliary.svelte generated by Svelte v4.2.8 */\n\nfunction create_if_block(ctx) {\n\tlet pointer_1;\n\tlet current;\n\tlet pointer_1_props = {};\n\tpointer_1 = new Pointer({ props: pointer_1_props });\n\t/*pointer_1_binding*/ ctx[16](pointer_1);\n\n\treturn {\n\t\tc() {\n\t\t\tcreate_component(pointer_1.$$.fragment);\n\t\t},\n\t\tm(target, anchor) {\n\t\t\tmount_component(pointer_1, target, anchor);\n\t\t\tcurrent = true;\n\t\t},\n\t\tp(ctx, dirty) {\n\t\t\tconst pointer_1_changes = {};\n\t\t\tpointer_1.$set(pointer_1_changes);\n\t\t},\n\t\ti(local) {\n\t\t\tif (current) return;\n\t\t\ttransition_in(pointer_1.$$.fragment, local);\n\t\t\tcurrent = true;\n\t\t},\n\t\to(local) {\n\t\t\ttransition_out(pointer_1.$$.fragment, local);\n\t\t\tcurrent = false;\n\t\t},\n\t\td(detaching) {\n\t\t\t/*pointer_1_binding*/ ctx[16](null);\n\t\t\tdestroy_component(pointer_1, detaching);\n\t\t}\n\t};\n}\n\nfunction create_fragment(ctx) {\n\tlet action;\n\tlet t;\n\tlet if_block_anchor;\n\tlet current;\n\tlet action_props = {};\n\taction = new Action({ props: action_props });\n\t/*action_binding*/ ctx[15](action);\n\tlet if_block = /*$pointer*/ ctx[1] && create_if_block(ctx);\n\n\treturn {\n\t\tc() {\n\t\t\tcreate_component(action.$$.fragment);\n\t\t\tt = space();\n\t\t\tif (if_block) if_block.c();\n\t\t\tif_block_anchor = empty();\n\t\t},\n\t\tm(target, anchor) {\n\t\t\tmount_component(action, target, anchor);\n\t\t\tinsert(target, t, anchor);\n\t\t\tif (if_block) if_block.m(target, anchor);\n\t\t\tinsert(target, if_block_anchor, anchor);\n\t\t\tcurrent = true;\n\t\t},\n\t\tp(ctx, [dirty]) {\n\t\t\tconst action_changes = {};\n\t\t\taction.$set(action_changes);\n\n\t\t\tif (/*$pointer*/ ctx[1]) {\n\t\t\t\tif (if_block) {\n\t\t\t\t\tif_block.p(ctx, dirty);\n\n\t\t\t\t\tif (dirty & /*$pointer*/ 2) {\n\t\t\t\t\t\ttransition_in(if_block, 1);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif_block = create_if_block(ctx);\n\t\t\t\t\tif_block.c();\n\t\t\t\t\ttransition_in(if_block, 1);\n\t\t\t\t\tif_block.m(if_block_anchor.parentNode, if_block_anchor);\n\t\t\t\t}\n\t\t\t} else if (if_block) {\n\t\t\t\tgroup_outros();\n\n\t\t\t\ttransition_out(if_block, 1, 1, () => {\n\t\t\t\t\tif_block = null;\n\t\t\t\t});\n\n\t\t\t\tcheck_outros();\n\t\t\t}\n\t\t},\n\t\ti(local) {\n\t\t\tif (current) return;\n\t\t\ttransition_in(action.$$.fragment, local);\n\t\t\ttransition_in(if_block);\n\t\t\tcurrent = true;\n\t\t},\n\t\to(local) {\n\t\t\ttransition_out(action.$$.fragment, local);\n\t\t\ttransition_out(if_block);\n\t\t\tcurrent = false;\n\t\t},\n\t\td(detaching) {\n\t\t\tif (detaching) {\n\t\t\t\tdetach(t);\n\t\t\t\tdetach(if_block_anchor);\n\t\t\t}\n\n\t\t\t/*action_binding*/ ctx[15](null);\n\t\t\tdestroy_component(action, detaching);\n\t\t\tif (if_block) if_block.d(detaching);\n\t\t}\n\t};\n}\n\nfunction instance($$self, $$props, $$invalidate) {\n\tlet $_interaction;\n\tlet $_bodyEl;\n\tlet $theme;\n\tlet $_draggable;\n\tlet $_iClasses;\n\tlet $editable;\n\tlet $eventStartEditable;\n\tlet $pointer;\n\tlet { theme, editable, eventStartEditable, eventDurationEditable, pointer, _bodyEl, _interaction, _iClasses, _draggable } = getContext('state');\n\tcomponent_subscribe($$self, theme, value => $$invalidate(11, $theme = value));\n\tcomponent_subscribe($$self, editable, value => $$invalidate(13, $editable = value));\n\tcomponent_subscribe($$self, eventStartEditable, value => $$invalidate(14, $eventStartEditable = value));\n\tcomponent_subscribe($$self, pointer, value => $$invalidate(1, $pointer = value));\n\tcomponent_subscribe($$self, _bodyEl, value => $$invalidate(10, $_bodyEl = value));\n\tcomponent_subscribe($$self, _interaction, value => $$invalidate(0, $_interaction = value));\n\tcomponent_subscribe($$self, _iClasses, value => $$invalidate(17, $_iClasses = value));\n\tcomponent_subscribe($$self, _draggable, value => $$invalidate(12, $_draggable = value));\n\tset_store_value(_interaction, $_interaction.resizer = Resizer, $_interaction);\n\n\tfunction bodyScrollHandler() {\n\t\tfor (let component of Object.values($_interaction)) {\n\t\t\tcomponent?.handleScroll?.();\n\t\t}\n\t}\n\n\tfunction action_binding($$value) {\n\t\tbinding_callbacks[$$value ? 'unshift' : 'push'](() => {\n\t\t\t$_interaction.action = $$value;\n\t\t\t_interaction.set($_interaction);\n\t\t});\n\t}\n\n\tfunction pointer_1_binding($$value) {\n\t\tbinding_callbacks[$$value ? 'unshift' : 'push'](() => {\n\t\t\t$_interaction.pointer = $$value;\n\t\t\t_interaction.set($_interaction);\n\t\t});\n\t}\n\n\t$$self.$$.update = () => {\n\t\tif ($$self.$$.dirty & /*$eventStartEditable, $editable*/ 24576) {\n\t\t\tset_store_value(_draggable, $_draggable = event => (event.startEditable ?? $eventStartEditable) || (event.editable ?? $editable), $_draggable);\n\t\t}\n\n\t\tif ($$self.$$.dirty & /*$theme, $_draggable*/ 6144) {\n\t\t\tset_store_value(\n\t\t\t\t_iClasses,\n\t\t\t\t$_iClasses = (className, event) => {\n\t\t\t\t\tlet { display } = event;\n\n\t\t\t\t\treturn helperEvent(display)\n\t\t\t\t\t? [$theme[display]]\n\t\t\t\t\t: !bgEvent(display) && $_draggable(event)\n\t\t\t\t\t\t? [$theme.draggable]\n\t\t\t\t\t\t: [];\n\t\t\t\t},\n\t\t\t\t$_iClasses\n\t\t\t);\n\t\t}\n\n\t\tif ($$self.$$.dirty & /*$_bodyEl*/ 1024) {\n\t\t\tif ($_bodyEl) {\n\t\t\t\tlisten($_bodyEl, 'scroll', bodyScrollHandler);\n\t\t\t}\n\t\t}\n\t};\n\n\treturn [\n\t\t$_interaction,\n\t\t$pointer,\n\t\ttheme,\n\t\teditable,\n\t\teventStartEditable,\n\t\tpointer,\n\t\t_bodyEl,\n\t\t_interaction,\n\t\t_iClasses,\n\t\t_draggable,\n\t\t$_bodyEl,\n\t\t$theme,\n\t\t$_draggable,\n\t\t$editable,\n\t\t$eventStartEditable,\n\t\taction_binding,\n\t\tpointer_1_binding\n\t];\n}\n\nclass Auxiliary extends SvelteComponent {\n\tconstructor(options) {\n\t\tsuper();\n\t\tinit(this, options, instance, create_fragment, safe_not_equal, {});\n\t}\n}\n\nvar index = {\n\tcreateOptions(options) {\n\t\toptions.dateClick = undefined;\n\t\toptions.dragScroll = true;\n\t\toptions.editable = false;\n\t\toptions.eventDragMinDistance = 5;\n\t\toptions.eventDragStart = undefined;\n\t\toptions.eventDragStop = undefined;\n\t\toptions.eventDrop = undefined;\n\t\toptions.eventDurationEditable = true;\n\t\toptions.eventLongPressDelay = undefined;\n\t\toptions.eventResizeStart = undefined;\n\t\toptions.eventResizeStop = undefined;\n\t\toptions.eventResize = undefined;\n\t\toptions.eventStartEditable = true;\n\t\toptions.longPressDelay = 1000;\n\t\toptions.pointer = false;\n\t\toptions.select = undefined;\n\t\toptions.selectBackgroundColor = undefined; // ec option\n\t\toptions.selectLongPressDelay = undefined;\n\t\toptions.selectMinDistance = 5;\n\t\toptions.unselect = undefined;\n\t\toptions.unselectAuto = true;\n\t\toptions.unselectCancel = '';\n\t\toptions.theme.draggable = 'ec-draggable';\n\t\toptions.theme.ghost = 'ec-ghost';\n\t\toptions.theme.preview = 'ec-preview';\n\t\toptions.theme.pointer = 'ec-pointer';\n\t\toptions.theme.resizer = 'ec-resizer';\n\t\toptions.theme.dragging = 'ec-dragging';\n\t\toptions.theme.resizingY = 'ec-resizing-y';\n\t\toptions.theme.resizingX = 'ec-resizing-x';\n\t\toptions.theme.selecting = 'ec-selecting';\n\t},\n\n\tcreateStores(state) {\n\t\tstate._draggable = writable(noop);\n\t\tstate._auxiliary.update($_auxiliary => [...$_auxiliary, Auxiliary]);\n\t}\n};\n\nexport { index as default };\n","import jQuery from 'jquery/dist/jquery';\nimport Swal from 'sweetalert2';\nimport * as bootstrap from 'bootstrap'\nimport Utils from '../../../../utils'\nimport TicketServiceMapEntity from \"../../../ticket_service_map/entity\";\nimport Calendar from '@event-calendar/core';\nimport TimeGrid from '@event-calendar/time-grid';\nimport Interaction from '@event-calendar/interaction';\n\n\nexport default class TicketShowServices {\n private parent: any;\n private tableElem: any;\n private datatable: any;\n private entity = \"services\";\n private toastr: any;\n private editModal: bootstrap.Modal;\n private ulUserList: any;\n private calendar: Calendar | undefined;\n protected calendarDropdown: HTMLElement | undefined;\n protected calendarCurrentUserId = \"\";\n protected calendarCurrentServiceId = \"\";\n private calendarResources: any[] = [];\n\n protected calendarAppointmentList: any = {}\n protected calendarDropdownActive = false;\n protected calendarDropdownActiveEvent = {}\n\n\n constructor(parent: any) {\n this.parent = parent\n this.toastr = parent.toastr\n this.tableElem = jQuery('.contract_show_services')\n this.ulUserList = jQuery('#ticket_service_user_list')\n if (document.querySelector(\"#editTicketServiceMap\")) {\n this.editModal = new bootstrap.Modal((document.querySelector(\"#editTicketServiceMap\") as HTMLElement));\n this.calendarDropdown = (document.querySelector(\"#ticket_service_dropdown\") as HTMLElement);\n this.createTable();\n this.bindListeners();\n }\n }\n\n getEntityData(elem: any) {\n return {...TicketServiceMapEntity.getEntityData(elem), ticket_id: this.parent.id}\n }\n\n bindListeners() {\n (document.querySelector(\"#ticket_service_save_book\") as HTMLButtonElement).addEventListener(\"click\", async (e) => {\n e.preventDefault();\n const uuid = await this.saveRecord();\n setTimeout(() => {\n const a = document.querySelector(`a.edit-record[data-id='${uuid}']`) as HTMLElement;\n console.log(\"uuid\", uuid, a)\n if (a) {\n a.click();\n }\n }, 400);\n });\n (document.querySelector(\"#ticket_service_dropdown_delete\") as HTMLElement).addEventListener(\"click\", async (e) => {\n e.preventDefault();\n // @ts-ignore\n const id = this.calendarDropdownActiveEvent.id\n await Utils.entity.destroy(id, 'calendar_appointments')\n await this.datatable.ajax.reload();\n if (this.calendar) {\n this.calendar.removeEventById(id)\n }\n })\n document.body.addEventListener(\"click\", (e) => {\n const target = e.target as HTMLElement;\n if (this.calendarDropdown && this.calendarDropdown.classList.contains(\"show\") && !target.classList.contains(\"ec-event-body\")) {\n this.calendarDropdown.classList.remove(\"show\");\n }\n })\n this.tableElem.delegate(\".delete-record\", \"click\", async (e: any) => {\n const confirm = await Swal.fire({\n title: 'Are you sure?',\n text: \"You won't be able to revert this!\",\n icon: 'warning',\n showCancelButton: true,\n confirmButtonText: 'Yes, delete it!',\n customClass: {\n confirmButton: 'btn btn-primary me-3',\n cancelButton: 'btn btn-label-secondary'\n },\n buttonsStyling: false\n })\n if(confirm.value === true) {\n e.preventDefault();\n const id = e.currentTarget.getAttribute(\"data-id\")\n const r = await Utils.entity.destroy(id, this.entity, this.parent.id, this.parent.entity)\n if (r.status === 200) {\n this.toastr.success(`${Utils.translate('ticket_service_map.name')} ${Utils.translate('generic.deleted')}`, `${Utils.translate('generic.success')}`)\n } else {\n this.toastr.error(`${Utils.translate('ticket_service_map.name')} ${Utils.translate('generic.messages.not_deleted')}`, `${Utils.translate('generic.error')}`)\n }\n this.datatable.ajax.reload();\n }\n });\n\n this.ulUserList.delegate(\"li\", \"click\", (e: any) => {\n this.onUserClick(e);\n });\n\n this.tableElem.delegate(\".edit-record\", \"click\", async (e: any) => {\n const id = e.currentTarget.getAttribute(\"data-id\")\n const requestData = await Utils.entity.get(id, this.entity, this.parent.id, this.parent.entity)\n if (requestData.status === 200) {\n this.calendarCurrentServiceId = id;\n const data = requestData.data[0]\n const form = (document.querySelector(\"#editTicketServiceMapForm\") as HTMLFormElement);\n await Utils.updateElements(data, '', (document.querySelector(\"#editTicketServiceMap\") as HTMLElement));\n this.editModal.show();\n\n this.calendarResources = [];\n this.calendarAppointmentList = {};\n data.service.workPackage.capableUsers.forEach((u: any, i: number) => {\n this.calendarResources.push({id: i + 1, title: u.name, color: `#${Utils.genCalendarColor(i)}`, uuid: u.uuid})\n })\n\n this.ulUserList.html(\"\");\n for (const resource of this.calendarResources) {\n this.calendarAppointmentList[resource.uuid] = [];\n this.ulUserList.html(this.ulUserList.html() + `