New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@fullcalendar/interaction

Package Overview
Dependencies
Maintainers
1
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fullcalendar/interaction - npm Package Compare versions

Comparing version 5.11.2 to 6.0.0-beta.1

4

main.global.min.js
/*!
FullCalendar v5.11.2
FullCalendar v6.0.0-beta.1
Docs & License: https://fullcalendar.io/
(c) 2022 Adam Shaw
*/
var FullCalendarInteraction=function(e,t){"use strict";var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var i=function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};t.config.touchMouseIgnoreWait=500;var o=0,a=0,l=!1,s=function(){function e(e){var n=this;this.subjectEl=null,this.selector="",this.handleSelector="",this.shouldIgnoreMove=!1,this.shouldWatchScroll=!0,this.isDragging=!1,this.isTouchDragging=!1,this.wasTouchScroll=!1,this.handleMouseDown=function(e){if(!n.shouldIgnoreMouse()&&function(e){return 0===e.button&&!e.ctrlKey}(e)&&n.tryStart(e)){var t=n.createEventFromMouse(e,!0);n.emitter.trigger("pointerdown",t),n.initScrollWatch(t),n.shouldIgnoreMove||document.addEventListener("mousemove",n.handleMouseMove),document.addEventListener("mouseup",n.handleMouseUp)}},this.handleMouseMove=function(e){var t=n.createEventFromMouse(e);n.recordCoords(t),n.emitter.trigger("pointermove",t)},this.handleMouseUp=function(e){document.removeEventListener("mousemove",n.handleMouseMove),document.removeEventListener("mouseup",n.handleMouseUp),n.emitter.trigger("pointerup",n.createEventFromMouse(e)),n.cleanup()},this.handleTouchStart=function(e){if(n.tryStart(e)){n.isTouchDragging=!0;var t=n.createEventFromTouch(e,!0);n.emitter.trigger("pointerdown",t),n.initScrollWatch(t);var r=e.target;n.shouldIgnoreMove||r.addEventListener("touchmove",n.handleTouchMove),r.addEventListener("touchend",n.handleTouchEnd),r.addEventListener("touchcancel",n.handleTouchEnd),window.addEventListener("scroll",n.handleTouchScroll,!0)}},this.handleTouchMove=function(e){var t=n.createEventFromTouch(e);n.recordCoords(t),n.emitter.trigger("pointermove",t)},this.handleTouchEnd=function(e){if(n.isDragging){var r=e.target;r.removeEventListener("touchmove",n.handleTouchMove),r.removeEventListener("touchend",n.handleTouchEnd),r.removeEventListener("touchcancel",n.handleTouchEnd),window.removeEventListener("scroll",n.handleTouchScroll,!0),n.emitter.trigger("pointerup",n.createEventFromTouch(e)),n.cleanup(),n.isTouchDragging=!1,o+=1,setTimeout((function(){o-=1}),t.config.touchMouseIgnoreWait)}},this.handleTouchScroll=function(){n.wasTouchScroll=!0},this.handleScroll=function(e){if(!n.shouldIgnoreMove){var t=window.pageXOffset-n.prevScrollX+n.prevPageX,r=window.pageYOffset-n.prevScrollY+n.prevPageY;n.emitter.trigger("pointermove",{origEvent:e,isTouch:n.isTouchDragging,subjectEl:n.subjectEl,pageX:t,pageY:r,deltaX:t-n.origPageX,deltaY:r-n.origPageY})}},this.containerEl=e,this.emitter=new t.Emitter,e.addEventListener("mousedown",this.handleMouseDown),e.addEventListener("touchstart",this.handleTouchStart,{passive:!0}),1===(a+=1)&&window.addEventListener("touchmove",c,{passive:!1})}return e.prototype.destroy=function(){this.containerEl.removeEventListener("mousedown",this.handleMouseDown),this.containerEl.removeEventListener("touchstart",this.handleTouchStart,{passive:!0}),(a-=1)||window.removeEventListener("touchmove",c,{passive:!1})},e.prototype.tryStart=function(e){var n=this.querySubjectEl(e),r=e.target;return!(!n||this.handleSelector&&!t.elementClosest(r,this.handleSelector))&&(this.subjectEl=n,this.isDragging=!0,this.wasTouchScroll=!1,!0)},e.prototype.cleanup=function(){l=!1,this.isDragging=!1,this.subjectEl=null,this.destroyScrollWatch()},e.prototype.querySubjectEl=function(e){return this.selector?t.elementClosest(e.target,this.selector):this.containerEl},e.prototype.shouldIgnoreMouse=function(){return o||this.isTouchDragging},e.prototype.cancelTouchScroll=function(){this.isDragging&&(l=!0)},e.prototype.initScrollWatch=function(e){this.shouldWatchScroll&&(this.recordCoords(e),window.addEventListener("scroll",this.handleScroll,!0))},e.prototype.recordCoords=function(e){this.shouldWatchScroll&&(this.prevPageX=e.pageX,this.prevPageY=e.pageY,this.prevScrollX=window.pageXOffset,this.prevScrollY=window.pageYOffset)},e.prototype.destroyScrollWatch=function(){this.shouldWatchScroll&&window.removeEventListener("scroll",this.handleScroll,!0)},e.prototype.createEventFromMouse=function(e,t){var n=0,r=0;return t?(this.origPageX=e.pageX,this.origPageY=e.pageY):(n=e.pageX-this.origPageX,r=e.pageY-this.origPageY),{origEvent:e,isTouch:!1,subjectEl:this.subjectEl,pageX:e.pageX,pageY:e.pageY,deltaX:n,deltaY:r}},e.prototype.createEventFromTouch=function(e,t){var n,r,i=e.touches,o=0,a=0;return i&&i.length?(n=i[0].pageX,r=i[0].pageY):(n=e.pageX,r=e.pageY),t?(this.origPageX=n,this.origPageY=r):(o=n-this.origPageX,a=r-this.origPageY),{origEvent:e,isTouch:!0,subjectEl:this.subjectEl,pageX:n,pageY:r,deltaX:o,deltaY:a}},e}();function c(e){l&&e.preventDefault()}var g=function(){function e(){this.isVisible=!1,this.sourceEl=null,this.mirrorEl=null,this.sourceElRect=null,this.parentNode=document.body,this.zIndex=9999,this.revertDuration=0}return e.prototype.start=function(e,t,n){this.sourceEl=e,this.sourceElRect=this.sourceEl.getBoundingClientRect(),this.origScreenX=t-window.pageXOffset,this.origScreenY=n-window.pageYOffset,this.deltaX=0,this.deltaY=0,this.updateElPosition()},e.prototype.handleMove=function(e,t){this.deltaX=e-window.pageXOffset-this.origScreenX,this.deltaY=t-window.pageYOffset-this.origScreenY,this.updateElPosition()},e.prototype.setIsVisible=function(e){e?this.isVisible||(this.mirrorEl&&(this.mirrorEl.style.display=""),this.isVisible=e,this.updateElPosition()):this.isVisible&&(this.mirrorEl&&(this.mirrorEl.style.display="none"),this.isVisible=e)},e.prototype.stop=function(e,t){var n=this,r=function(){n.cleanup(),t()};e&&this.mirrorEl&&this.isVisible&&this.revertDuration&&(this.deltaX||this.deltaY)?this.doRevertAnimation(r,this.revertDuration):setTimeout(r,0)},e.prototype.doRevertAnimation=function(e,n){var r=this.mirrorEl,i=this.sourceEl.getBoundingClientRect();r.style.transition="top "+n+"ms,left "+n+"ms",t.applyStyle(r,{left:i.left,top:i.top}),t.whenTransitionDone(r,(function(){r.style.transition="",e()}))},e.prototype.cleanup=function(){this.mirrorEl&&(t.removeElement(this.mirrorEl),this.mirrorEl=null),this.sourceEl=null},e.prototype.updateElPosition=function(){this.sourceEl&&this.isVisible&&t.applyStyle(this.getMirrorEl(),{left:this.sourceElRect.left+this.deltaX,top:this.sourceElRect.top+this.deltaY})},e.prototype.getMirrorEl=function(){var e=this.sourceElRect,n=this.mirrorEl;return n||((n=this.mirrorEl=this.sourceEl.cloneNode(!0)).classList.add("fc-unselectable"),n.classList.add("fc-event-dragging"),t.applyStyle(n,{position:"fixed",zIndex:this.zIndex,visibility:"",boxSizing:"border-box",width:e.right-e.left,height:e.bottom-e.top,right:"auto",bottom:"auto",margin:0}),this.parentNode.appendChild(n)),n},e}(),d=function(e){function t(t,n){var r=e.call(this)||this;return r.handleScroll=function(){r.scrollTop=r.scrollController.getScrollTop(),r.scrollLeft=r.scrollController.getScrollLeft(),r.handleScrollChange()},r.scrollController=t,r.doesListening=n,r.scrollTop=r.origScrollTop=t.getScrollTop(),r.scrollLeft=r.origScrollLeft=t.getScrollLeft(),r.scrollWidth=t.getScrollWidth(),r.scrollHeight=t.getScrollHeight(),r.clientWidth=t.getClientWidth(),r.clientHeight=t.getClientHeight(),r.clientRect=r.computeClientRect(),r.doesListening&&r.getEventTarget().addEventListener("scroll",r.handleScroll),r}return r(t,e),t.prototype.destroy=function(){this.doesListening&&this.getEventTarget().removeEventListener("scroll",this.handleScroll)},t.prototype.getScrollTop=function(){return this.scrollTop},t.prototype.getScrollLeft=function(){return this.scrollLeft},t.prototype.setScrollTop=function(e){this.scrollController.setScrollTop(e),this.doesListening||(this.scrollTop=Math.max(Math.min(e,this.getMaxScrollTop()),0),this.handleScrollChange())},t.prototype.setScrollLeft=function(e){this.scrollController.setScrollLeft(e),this.doesListening||(this.scrollLeft=Math.max(Math.min(e,this.getMaxScrollLeft()),0),this.handleScrollChange())},t.prototype.getClientWidth=function(){return this.clientWidth},t.prototype.getClientHeight=function(){return this.clientHeight},t.prototype.getScrollWidth=function(){return this.scrollWidth},t.prototype.getScrollHeight=function(){return this.scrollHeight},t.prototype.handleScrollChange=function(){},t}(t.ScrollController),u=function(e){function n(n,r){return e.call(this,new t.ElementScrollController(n),r)||this}return r(n,e),n.prototype.getEventTarget=function(){return this.scrollController.el},n.prototype.computeClientRect=function(){return t.computeInnerRect(this.scrollController.el)},n}(d),h=function(e){function n(n){return e.call(this,new t.WindowScrollController,n)||this}return r(n,e),n.prototype.getEventTarget=function(){return window},n.prototype.computeClientRect=function(){return{left:this.scrollLeft,right:this.scrollLeft+this.clientWidth,top:this.scrollTop,bottom:this.scrollTop+this.clientHeight}},n.prototype.handleScrollChange=function(){this.clientRect=this.computeClientRect()},n}(d),p="function"==typeof performance?performance.now:Date.now,v=function(){function e(){var e=this;this.isEnabled=!0,this.scrollQuery=[window,".fc-scroller"],this.edgeThreshold=50,this.maxVelocity=300,this.pointerScreenX=null,this.pointerScreenY=null,this.isAnimating=!1,this.scrollCaches=null,this.everMovedUp=!1,this.everMovedDown=!1,this.everMovedLeft=!1,this.everMovedRight=!1,this.animate=function(){if(e.isAnimating){var t=e.computeBestEdge(e.pointerScreenX+window.pageXOffset,e.pointerScreenY+window.pageYOffset);if(t){var n=p();e.handleSide(t,(n-e.msSinceRequest)/1e3),e.requestAnimation(n)}else e.isAnimating=!1}}}return e.prototype.start=function(e,t,n){this.isEnabled&&(this.scrollCaches=this.buildCaches(n),this.pointerScreenX=null,this.pointerScreenY=null,this.everMovedUp=!1,this.everMovedDown=!1,this.everMovedLeft=!1,this.everMovedRight=!1,this.handleMove(e,t))},e.prototype.handleMove=function(e,t){if(this.isEnabled){var n=e-window.pageXOffset,r=t-window.pageYOffset,i=null===this.pointerScreenY?0:r-this.pointerScreenY,o=null===this.pointerScreenX?0:n-this.pointerScreenX;i<0?this.everMovedUp=!0:i>0&&(this.everMovedDown=!0),o<0?this.everMovedLeft=!0:o>0&&(this.everMovedRight=!0),this.pointerScreenX=n,this.pointerScreenY=r,this.isAnimating||(this.isAnimating=!0,this.requestAnimation(p()))}},e.prototype.stop=function(){if(this.isEnabled){this.isAnimating=!1;for(var e=0,t=this.scrollCaches;e<t.length;e++){t[e].destroy()}this.scrollCaches=null}},e.prototype.requestAnimation=function(e){this.msSinceRequest=e,requestAnimationFrame(this.animate)},e.prototype.handleSide=function(e,t){var n=e.scrollCache,r=this.edgeThreshold,i=r-e.distance,o=i*i/(r*r)*this.maxVelocity*t,a=1;switch(e.name){case"left":a=-1;case"right":n.setScrollLeft(n.getScrollLeft()+o*a);break;case"top":a=-1;case"bottom":n.setScrollTop(n.getScrollTop()+o*a)}},e.prototype.computeBestEdge=function(e,t){for(var n=this.edgeThreshold,r=null,i=0,o=this.scrollCaches||[];i<o.length;i++){var a=o[i],l=a.clientRect,s=e-l.left,c=l.right-e,g=t-l.top,d=l.bottom-t;s>=0&&c>=0&&g>=0&&d>=0&&(g<=n&&this.everMovedUp&&a.canScrollUp()&&(!r||r.distance>g)&&(r={scrollCache:a,name:"top",distance:g}),d<=n&&this.everMovedDown&&a.canScrollDown()&&(!r||r.distance>d)&&(r={scrollCache:a,name:"bottom",distance:d}),s<=n&&this.everMovedLeft&&a.canScrollLeft()&&(!r||r.distance>s)&&(r={scrollCache:a,name:"left",distance:s}),c<=n&&this.everMovedRight&&a.canScrollRight()&&(!r||r.distance>c)&&(r={scrollCache:a,name:"right",distance:c}))}return r},e.prototype.buildCaches=function(e){return this.queryScrollEls(e).map((function(e){return e===window?new h(!1):new u(e,!1)}))},e.prototype.queryScrollEls=function(e){for(var n=[],r=0,i=this.scrollQuery;r<i.length;r++){var o=i[r];"object"==typeof o?n.push(o):n.push.apply(n,Array.prototype.slice.call(t.getElRoot(e).querySelectorAll(o)))}return n},e}(),f=function(e){function n(n,r){var i=e.call(this,n)||this;i.containerEl=n,i.delay=null,i.minDistance=0,i.touchScrollAllowed=!0,i.mirrorNeedsRevert=!1,i.isInteracting=!1,i.isDragging=!1,i.isDelayEnded=!1,i.isDistanceSurpassed=!1,i.delayTimeoutId=null,i.onPointerDown=function(e){i.isDragging||(i.isInteracting=!0,i.isDelayEnded=!1,i.isDistanceSurpassed=!1,t.preventSelection(document.body),t.preventContextMenu(document.body),e.isTouch||e.origEvent.preventDefault(),i.emitter.trigger("pointerdown",e),i.isInteracting&&!i.pointer.shouldIgnoreMove&&(i.mirror.setIsVisible(!1),i.mirror.start(e.subjectEl,e.pageX,e.pageY),i.startDelay(e),i.minDistance||i.handleDistanceSurpassed(e)))},i.onPointerMove=function(e){if(i.isInteracting){if(i.emitter.trigger("pointermove",e),!i.isDistanceSurpassed){var t=i.minDistance,n=e.deltaX,r=e.deltaY;n*n+r*r>=t*t&&i.handleDistanceSurpassed(e)}i.isDragging&&("scroll"!==e.origEvent.type&&(i.mirror.handleMove(e.pageX,e.pageY),i.autoScroller.handleMove(e.pageX,e.pageY)),i.emitter.trigger("dragmove",e))}},i.onPointerUp=function(e){i.isInteracting&&(i.isInteracting=!1,t.allowSelection(document.body),t.allowContextMenu(document.body),i.emitter.trigger("pointerup",e),i.isDragging&&(i.autoScroller.stop(),i.tryStopDrag(e)),i.delayTimeoutId&&(clearTimeout(i.delayTimeoutId),i.delayTimeoutId=null))};var o=i.pointer=new s(n);return o.emitter.on("pointerdown",i.onPointerDown),o.emitter.on("pointermove",i.onPointerMove),o.emitter.on("pointerup",i.onPointerUp),r&&(o.selector=r),i.mirror=new g,i.autoScroller=new v,i}return r(n,e),n.prototype.destroy=function(){this.pointer.destroy(),this.onPointerUp({})},n.prototype.startDelay=function(e){var t=this;"number"==typeof this.delay?this.delayTimeoutId=setTimeout((function(){t.delayTimeoutId=null,t.handleDelayEnd(e)}),this.delay):this.handleDelayEnd(e)},n.prototype.handleDelayEnd=function(e){this.isDelayEnded=!0,this.tryStartDrag(e)},n.prototype.handleDistanceSurpassed=function(e){this.isDistanceSurpassed=!0,this.tryStartDrag(e)},n.prototype.tryStartDrag=function(e){this.isDelayEnded&&this.isDistanceSurpassed&&(this.pointer.wasTouchScroll&&!this.touchScrollAllowed||(this.isDragging=!0,this.mirrorNeedsRevert=!1,this.autoScroller.start(e.pageX,e.pageY,this.containerEl),this.emitter.trigger("dragstart",e),!1===this.touchScrollAllowed&&this.pointer.cancelTouchScroll()))},n.prototype.tryStopDrag=function(e){this.mirror.stop(this.mirrorNeedsRevert,this.stopDrag.bind(this,e))},n.prototype.stopDrag=function(e){this.isDragging=!1,this.emitter.trigger("dragend",e)},n.prototype.setIgnoreMove=function(e){this.pointer.shouldIgnoreMove=e},n.prototype.setMirrorIsVisible=function(e){this.mirror.setIsVisible(e)},n.prototype.setMirrorNeedsRevert=function(e){this.mirrorNeedsRevert=e},n.prototype.setAutoScrollEnabled=function(e){this.autoScroller.isEnabled=e},n}(t.ElementDragging),E=function(){function e(e){this.origRect=t.computeRect(e),this.scrollCaches=t.getClippingParents(e).map((function(e){return new u(e,!0)}))}return e.prototype.destroy=function(){for(var e=0,t=this.scrollCaches;e<t.length;e++){t[e].destroy()}},e.prototype.computeLeft=function(){for(var e=this.origRect.left,t=0,n=this.scrollCaches;t<n.length;t++){var r=n[t];e+=r.origScrollLeft-r.getScrollLeft()}return e},e.prototype.computeTop=function(){for(var e=this.origRect.top,t=0,n=this.scrollCaches;t<n.length;t++){var r=n[t];e+=r.origScrollTop-r.getScrollTop()}return e},e.prototype.isWithinClipping=function(e,n){for(var r,i,o={left:e,top:n},a=0,l=this.scrollCaches;a<l.length;a++){var s=l[a];if(r=s.getEventTarget(),i=void 0,"HTML"!==(i=r.tagName)&&"BODY"!==i&&!t.pointInsideRect(o,s.clientRect))return!1}return!0},e}();var m=function(){function e(e,n){var r=this;this.useSubjectCenter=!1,this.requireInitial=!0,this.initialHit=null,this.movingHit=null,this.finalHit=null,this.handlePointerDown=function(e){var t=r.dragging;r.initialHit=null,r.movingHit=null,r.finalHit=null,r.prepareHits(),r.processFirstCoord(e),r.initialHit||!r.requireInitial?(t.setIgnoreMove(!1),r.emitter.trigger("pointerdown",e)):t.setIgnoreMove(!0)},this.handleDragStart=function(e){r.emitter.trigger("dragstart",e),r.handleMove(e,!0)},this.handleDragMove=function(e){r.emitter.trigger("dragmove",e),r.handleMove(e)},this.handlePointerUp=function(e){r.releaseHits(),r.emitter.trigger("pointerup",e)},this.handleDragEnd=function(e){r.movingHit&&r.emitter.trigger("hitupdate",null,!0,e),r.finalHit=r.movingHit,r.movingHit=null,r.emitter.trigger("dragend",e)},this.droppableStore=n,e.emitter.on("pointerdown",this.handlePointerDown),e.emitter.on("dragstart",this.handleDragStart),e.emitter.on("dragmove",this.handleDragMove),e.emitter.on("pointerup",this.handlePointerUp),e.emitter.on("dragend",this.handleDragEnd),this.dragging=e,this.emitter=new t.Emitter}return e.prototype.processFirstCoord=function(e){var n,r={left:e.pageX,top:e.pageY},i=r,o=e.subjectEl;o instanceof HTMLElement&&(n=t.computeRect(o),i=t.constrainPoint(i,n));var a=this.initialHit=this.queryHitForOffset(i.left,i.top);if(a){if(this.useSubjectCenter&&n){var l=t.intersectRects(n,a.rect);l&&(i=t.getRectCenter(l))}this.coordAdjust=t.diffPoints(i,r)}else this.coordAdjust={left:0,top:0}},e.prototype.handleMove=function(e,t){var n=this.queryHitForOffset(e.pageX+this.coordAdjust.left,e.pageY+this.coordAdjust.top);!t&&S(this.movingHit,n)||(this.movingHit=n,this.emitter.trigger("hitupdate",n,!1,e))},e.prototype.prepareHits=function(){this.offsetTrackers=t.mapHash(this.droppableStore,(function(e){return e.component.prepareHits(),new E(e.el)}))},e.prototype.releaseHits=function(){var e=this.offsetTrackers;for(var t in e)e[t].destroy();this.offsetTrackers={}},e.prototype.queryHitForOffset=function(e,n){var r=this.droppableStore,i=this.offsetTrackers,o=null;for(var a in r){var l=r[a].component,s=i[a];if(s&&s.isWithinClipping(e,n)){var c=s.computeLeft(),g=s.computeTop(),d=e-c,u=n-g,h=s.origRect,p=h.right-h.left,v=h.bottom-h.top;if(d>=0&&d<p&&u>=0&&u<v){var f=l.queryHit(d,u,p,v);f&&t.rangeContainsRange(f.dateProfile.activeRange,f.dateSpan.range)&&(!o||f.layer>o.layer)&&(f.componentId=a,f.context=l.context,f.rect.left+=c,f.rect.right+=c,f.rect.top+=g,f.rect.bottom+=g,o=f)}}}return o},e}();function S(e,n){return!e&&!n||Boolean(e)===Boolean(n)&&t.isDateSpansEqual(e.dateSpan,n.dateSpan)}function y(e,t){for(var n,r,o={},a=0,l=t.pluginHooks.datePointTransforms;a<l.length;a++){var s=l[a];i(o,s(e,t))}return i(o,(n=e,{date:(r=t.dateEnv).toDate(n.range.start),dateStr:r.formatIso(n.range.start,{omitTime:n.allDay}),allDay:n.allDay})),o}var D=function(e){function n(n){var r=e.call(this,n)||this;r.handlePointerDown=function(e){var t=r.dragging,n=e.origEvent.target;t.setIgnoreMove(!r.component.isValidDateDownEl(n))},r.handleDragEnd=function(e){var t=r.component;if(!r.dragging.pointer.wasTouchScroll){var n=r.hitDragging,o=n.initialHit,a=n.finalHit;if(o&&a&&S(o,a)){var l=t.context,s=i(i({},y(o.dateSpan,l)),{dayEl:o.dayEl,jsEvent:e.origEvent,view:l.viewApi||l.calendarApi.view});l.emitter.trigger("dateClick",s)}}},r.dragging=new f(n.el),r.dragging.autoScroller.isEnabled=!1;var o=r.hitDragging=new m(r.dragging,t.interactionSettingsToStore(n));return o.emitter.on("pointerdown",r.handlePointerDown),o.emitter.on("dragend",r.handleDragEnd),r}return r(n,e),n.prototype.destroy=function(){this.dragging.destroy()},n}(t.Interaction),w=function(e){function n(n){var r=e.call(this,n)||this;r.dragSelection=null,r.handlePointerDown=function(e){var t=r,n=t.component,i=t.dragging,o=n.context.options.selectable&&n.isValidDateDownEl(e.origEvent.target);i.setIgnoreMove(!o),i.delay=e.isTouch?function(e){var t=e.context.options,n=t.selectLongPressDelay;null==n&&(n=t.longPressDelay);return n}(n):null},r.handleDragStart=function(e){r.component.context.calendarApi.unselect(e)},r.handleHitUpdate=function(e,n){var o=r.component.context,a=null,l=!1;if(e){var s=r.hitDragging.initialHit;e.componentId===s.componentId&&r.isHitComboAllowed&&!r.isHitComboAllowed(s,e)||(a=function(e,n,r){var o=e.dateSpan,a=n.dateSpan,l=[o.range.start,o.range.end,a.range.start,a.range.end];l.sort(t.compareNumbers);for(var s={},c=0,g=r;c<g.length;c++){var d=(0,g[c])(e,n);if(!1===d)return null;d&&i(s,d)}return s.range={start:l[0],end:l[3]},s.allDay=o.allDay,s}(s,e,o.pluginHooks.dateSelectionTransformers)),a&&t.isDateSelectionValid(a,e.dateProfile,o)||(l=!0,a=null)}a?o.dispatch({type:"SELECT_DATES",selection:a}):n||o.dispatch({type:"UNSELECT_DATES"}),l?t.disableCursor():t.enableCursor(),n||(r.dragSelection=a)},r.handlePointerUp=function(e){r.dragSelection&&(t.triggerDateSelect(r.dragSelection,e,r.component.context),r.dragSelection=null)};var o=n.component.context.options,a=r.dragging=new f(n.el);a.touchScrollAllowed=!1,a.minDistance=o.selectMinDistance||0,a.autoScroller.isEnabled=o.dragScroll;var l=r.hitDragging=new m(r.dragging,t.interactionSettingsToStore(n));return l.emitter.on("pointerdown",r.handlePointerDown),l.emitter.on("dragstart",r.handleDragStart),l.emitter.on("hitupdate",r.handleHitUpdate),l.emitter.on("pointerup",r.handlePointerUp),r}return r(n,e),n.prototype.destroy=function(){this.dragging.destroy()},n}(t.Interaction);var T=function(e){function n(r){var o=e.call(this,r)||this;o.subjectEl=null,o.subjectSeg=null,o.isDragging=!1,o.eventRange=null,o.relevantEvents=null,o.receivingContext=null,o.validMutation=null,o.mutatedRelevantEvents=null,o.handlePointerDown=function(e){var n=e.origEvent.target,r=o,i=r.component,a=r.dragging,l=a.mirror,s=i.context.options,c=i.context;o.subjectEl=e.subjectEl;var g=o.subjectSeg=t.getElSeg(e.subjectEl),d=(o.eventRange=g.eventRange).instance.instanceId;o.relevantEvents=t.getRelevantEvents(c.getCurrentData().eventStore,d),a.minDistance=e.isTouch?0:s.eventDragMinDistance,a.delay=e.isTouch&&d!==i.props.eventSelection?function(e){var t=e.context.options,n=t.eventLongPressDelay;null==n&&(n=t.longPressDelay);return n}(i):null,s.fixedMirrorParent?l.parentNode=s.fixedMirrorParent:l.parentNode=t.elementClosest(n,".fc"),l.revertDuration=s.dragRevertDuration;var u=i.isValidSegDownEl(n)&&!t.elementClosest(n,".fc-event-resizer");a.setIgnoreMove(!u),o.isDragging=u&&e.subjectEl.classList.contains("fc-event-draggable")},o.handleDragStart=function(e){var n=o.component.context,r=o.eventRange,i=r.instance.instanceId;e.isTouch?i!==o.component.props.eventSelection&&n.dispatch({type:"SELECT_EVENT",eventInstanceId:i}):n.dispatch({type:"UNSELECT_EVENT"}),o.isDragging&&(n.calendarApi.unselect(e),n.emitter.trigger("eventDragStart",{el:o.subjectEl,event:new t.EventApi(n,r.def,r.instance),jsEvent:e.origEvent,view:n.viewApi}))},o.handleHitUpdate=function(e,n){if(o.isDragging){var r=o.relevantEvents,i=o.hitDragging.initialHit,a=o.component.context,l=null,s=null,c=null,g=!1,d={affectedEvents:r,mutatedEvents:t.createEmptyEventStore(),isEvent:!0};if(e){var u=(l=e.context).options;a===l||u.editable&&u.droppable?(s=function(e,n,r){var i=e.dateSpan,o=n.dateSpan,a=i.range.start,l=o.range.start,s={};i.allDay!==o.allDay&&(s.allDay=o.allDay,s.hasEnd=n.context.options.allDayMaintainDuration,o.allDay&&(a=t.startOfDay(a)));var c=t.diffDates(a,l,e.context.dateEnv,e.componentId===n.componentId?e.largeUnit:null);c.milliseconds&&(s.allDay=!1);for(var g={datesDelta:c,standardProps:s},d=0,u=r;d<u.length;d++){(0,u[d])(g,e,n)}return g}(i,e,l.getCurrentData().pluginHooks.eventDragMutationMassagers))&&(c=t.applyMutationToEventStore(r,l.getCurrentData().eventUiBases,s,l),d.mutatedEvents=c,t.isInteractionValid(d,e.dateProfile,l)||(g=!0,s=null,c=null,d.mutatedEvents=t.createEmptyEventStore())):l=null}o.displayDrag(l,d),g?t.disableCursor():t.enableCursor(),n||(a===l&&S(i,e)&&(s=null),o.dragging.setMirrorNeedsRevert(!s),o.dragging.setMirrorIsVisible(!e||!t.getElRoot(o.subjectEl).querySelector(".fc-event-mirror")),o.receivingContext=l,o.validMutation=s,o.mutatedRelevantEvents=c)}},o.handlePointerUp=function(){o.isDragging||o.cleanup()},o.handleDragEnd=function(e){if(o.isDragging){var n=o.component.context,r=n.viewApi,a=o,l=a.receivingContext,s=a.validMutation,c=o.eventRange.def,g=o.eventRange.instance,d=new t.EventApi(n,c,g),u=o.relevantEvents,h=o.mutatedRelevantEvents,p=o.hitDragging.finalHit;if(o.clearDrag(),n.emitter.trigger("eventDragStop",{el:o.subjectEl,event:d,jsEvent:e.origEvent,view:r}),s){if(l===n){var v=new t.EventApi(n,h.defs[c.defId],g?h.instances[g.instanceId]:null);n.dispatch({type:"MERGE_EVENTS",eventStore:h});for(var f={oldEvent:d,event:v,relatedEvents:t.buildEventApis(h,n,g),revert:function(){n.dispatch({type:"MERGE_EVENTS",eventStore:u})}},E={},m=0,S=n.getCurrentData().pluginHooks.eventDropTransformers;m<S.length;m++){var D=S[m];i(E,D(s,n))}n.emitter.trigger("eventDrop",i(i(i({},f),E),{el:e.subjectEl,delta:s.datesDelta,jsEvent:e.origEvent,view:r})),n.emitter.trigger("eventChange",f)}else if(l){var w={event:d,relatedEvents:t.buildEventApis(u,n,g),revert:function(){n.dispatch({type:"MERGE_EVENTS",eventStore:u})}};n.emitter.trigger("eventLeave",i(i({},w),{draggedEl:e.subjectEl,view:r})),n.dispatch({type:"REMOVE_EVENTS",eventStore:u}),n.emitter.trigger("eventRemove",w);var T=h.defs[c.defId],M=h.instances[g.instanceId],b=new t.EventApi(l,T,M);l.dispatch({type:"MERGE_EVENTS",eventStore:h});var C={event:b,relatedEvents:t.buildEventApis(h,l,M),revert:function(){l.dispatch({type:"REMOVE_EVENTS",eventStore:h})}};l.emitter.trigger("eventAdd",C),e.isTouch&&l.dispatch({type:"SELECT_EVENT",eventInstanceId:g.instanceId}),l.emitter.trigger("drop",i(i({},y(p.dateSpan,l)),{draggedEl:e.subjectEl,jsEvent:e.origEvent,view:p.context.viewApi})),l.emitter.trigger("eventReceive",i(i({},C),{draggedEl:e.subjectEl,view:p.context.viewApi}))}}else n.emitter.trigger("_noEventDrop")}o.cleanup()};var a=o.component.context.options,l=o.dragging=new f(r.el);l.pointer.selector=n.SELECTOR,l.touchScrollAllowed=!1,l.autoScroller.isEnabled=a.dragScroll;var s=o.hitDragging=new m(o.dragging,t.interactionSettingsStore);return s.useSubjectCenter=r.useEventCenter,s.emitter.on("pointerdown",o.handlePointerDown),s.emitter.on("dragstart",o.handleDragStart),s.emitter.on("hitupdate",o.handleHitUpdate),s.emitter.on("pointerup",o.handlePointerUp),s.emitter.on("dragend",o.handleDragEnd),o}return r(n,e),n.prototype.destroy=function(){this.dragging.destroy()},n.prototype.displayDrag=function(e,n){var r=this.component.context,i=this.receivingContext;i&&i!==e&&(i===r?i.dispatch({type:"SET_EVENT_DRAG",state:{affectedEvents:n.affectedEvents,mutatedEvents:t.createEmptyEventStore(),isEvent:!0}}):i.dispatch({type:"UNSET_EVENT_DRAG"})),e&&e.dispatch({type:"SET_EVENT_DRAG",state:n})},n.prototype.clearDrag=function(){var e=this.component.context,t=this.receivingContext;t&&t.dispatch({type:"UNSET_EVENT_DRAG"}),e!==t&&e.dispatch({type:"UNSET_EVENT_DRAG"})},n.prototype.cleanup=function(){this.subjectSeg=null,this.isDragging=!1,this.eventRange=null,this.relevantEvents=null,this.receivingContext=null,this.validMutation=null,this.mutatedRelevantEvents=null},n.SELECTOR=".fc-event-draggable, .fc-event-resizable",n}(t.Interaction);var M=function(e){function n(n){var r=e.call(this,n)||this;r.draggingSegEl=null,r.draggingSeg=null,r.eventRange=null,r.relevantEvents=null,r.validMutation=null,r.mutatedRelevantEvents=null,r.handlePointerDown=function(e){var n=r.component,i=r.querySegEl(e),o=t.getElSeg(i),a=r.eventRange=o.eventRange;r.dragging.minDistance=n.context.options.eventDragMinDistance,r.dragging.setIgnoreMove(!r.component.isValidSegDownEl(e.origEvent.target)||e.isTouch&&r.component.props.eventSelection!==a.instance.instanceId)},r.handleDragStart=function(e){var n=r.component.context,i=r.eventRange;r.relevantEvents=t.getRelevantEvents(n.getCurrentData().eventStore,r.eventRange.instance.instanceId);var o=r.querySegEl(e);r.draggingSegEl=o,r.draggingSeg=t.getElSeg(o),n.calendarApi.unselect(),n.emitter.trigger("eventResizeStart",{el:o,event:new t.EventApi(n,i.def,i.instance),jsEvent:e.origEvent,view:n.viewApi})},r.handleHitUpdate=function(e,n,i){var o=r.component.context,a=r.relevantEvents,l=r.hitDragging.initialHit,s=r.eventRange.instance,c=null,g=null,d=!1,u={affectedEvents:a,mutatedEvents:t.createEmptyEventStore(),isEvent:!0};e&&(e.componentId===l.componentId&&r.isHitComboAllowed&&!r.isHitComboAllowed(l,e)||(c=function(e,n,r,i){var o=e.context.dateEnv,a=e.dateSpan.range.start,l=n.dateSpan.range.start,s=t.diffDates(a,l,o,e.largeUnit);if(r){if(o.add(i.start,s)<i.end)return{startDelta:s}}else if(o.add(i.end,s)>i.start)return{endDelta:s};return null}(l,e,i.subjectEl.classList.contains("fc-event-resizer-start"),s.range)));c&&(g=t.applyMutationToEventStore(a,o.getCurrentData().eventUiBases,c,o),u.mutatedEvents=g,t.isInteractionValid(u,e.dateProfile,o)||(d=!0,c=null,g=null,u.mutatedEvents=null)),g?o.dispatch({type:"SET_EVENT_RESIZE",state:u}):o.dispatch({type:"UNSET_EVENT_RESIZE"}),d?t.disableCursor():t.enableCursor(),n||(c&&S(l,e)&&(c=null),r.validMutation=c,r.mutatedRelevantEvents=g)},r.handleDragEnd=function(e){var n=r.component.context,o=r.eventRange.def,a=r.eventRange.instance,l=new t.EventApi(n,o,a),s=r.relevantEvents,c=r.mutatedRelevantEvents;if(n.emitter.trigger("eventResizeStop",{el:r.draggingSegEl,event:l,jsEvent:e.origEvent,view:n.viewApi}),r.validMutation){var g=new t.EventApi(n,c.defs[o.defId],a?c.instances[a.instanceId]:null);n.dispatch({type:"MERGE_EVENTS",eventStore:c});var d={oldEvent:l,event:g,relatedEvents:t.buildEventApis(c,n,a),revert:function(){n.dispatch({type:"MERGE_EVENTS",eventStore:s})}};n.emitter.trigger("eventResize",i(i({},d),{el:r.draggingSegEl,startDelta:r.validMutation.startDelta||t.createDuration(0),endDelta:r.validMutation.endDelta||t.createDuration(0),jsEvent:e.origEvent,view:n.viewApi})),n.emitter.trigger("eventChange",d)}else n.emitter.trigger("_noEventResize");r.draggingSeg=null,r.relevantEvents=null,r.validMutation=null};var o=n.component,a=r.dragging=new f(n.el);a.pointer.selector=".fc-event-resizer",a.touchScrollAllowed=!1,a.autoScroller.isEnabled=o.context.options.dragScroll;var l=r.hitDragging=new m(r.dragging,t.interactionSettingsToStore(n));return l.emitter.on("pointerdown",r.handlePointerDown),l.emitter.on("dragstart",r.handleDragStart),l.emitter.on("hitupdate",r.handleHitUpdate),l.emitter.on("dragend",r.handleDragEnd),r}return r(n,e),n.prototype.destroy=function(){this.dragging.destroy()},n.prototype.querySegEl=function(e){return t.elementClosest(e.subjectEl,".fc-event")},n}(t.Interaction);var b=function(){function e(e){var n=this;this.context=e,this.isRecentPointerDateSelect=!1,this.matchesCancel=!1,this.matchesEvent=!1,this.onSelect=function(e){e.jsEvent&&(n.isRecentPointerDateSelect=!0)},this.onDocumentPointerDown=function(e){var r=n.context.options.unselectCancel,i=t.getEventTargetViaRoot(e.origEvent);n.matchesCancel=!!t.elementClosest(i,r),n.matchesEvent=!!t.elementClosest(i,T.SELECTOR)},this.onDocumentPointerUp=function(e){var t=n.context,r=n.documentPointer,i=t.getCurrentData();if(!r.wasTouchScroll){if(i.dateSelection&&!n.isRecentPointerDateSelect){var o=t.options.unselectAuto;!o||o&&n.matchesCancel||t.calendarApi.unselect(e)}i.eventSelection&&!n.matchesEvent&&t.dispatch({type:"UNSELECT_EVENT"})}n.isRecentPointerDateSelect=!1};var r=this.documentPointer=new s(document);r.shouldIgnoreMove=!0,r.shouldWatchScroll=!1,r.emitter.on("pointerdown",this.onDocumentPointerDown),r.emitter.on("pointerup",this.onDocumentPointerUp),e.emitter.on("select",this.onSelect)}return e.prototype.destroy=function(){this.context.emitter.off("select",this.onSelect),this.documentPointer.destroy()},e}(),C={fixedMirrorParent:t.identity},R={dateClick:t.identity,eventDragStart:t.identity,eventDragStop:t.identity,eventDrop:t.identity,eventResizeStart:t.identity,eventResizeStop:t.identity,eventResize:t.identity,drop:t.identity,eventReceive:t.identity,eventLeave:t.identity},I=function(){function e(e,n){var r=this;this.receivingContext=null,this.droppableEvent=null,this.suppliedDragMeta=null,this.dragMeta=null,this.handleDragStart=function(e){r.dragMeta=r.buildDragMeta(e.subjectEl)},this.handleHitUpdate=function(e,n,o){var a=r.hitDragging.dragging,l=null,s=null,c=!1,g={affectedEvents:t.createEmptyEventStore(),mutatedEvents:t.createEmptyEventStore(),isEvent:r.dragMeta.create};e&&(l=e.context,r.canDropElOnCalendar(o.subjectEl,l)&&(s=function(e,n,r){for(var o=i({},n.leftoverProps),a=0,l=r.pluginHooks.externalDefTransforms;a<l.length;a++){var s=l[a];i(o,s(e,n))}var c=t.refineEventDef(o,r),g=c.refined,d=c.extra,u=t.parseEventDef(g,d,n.sourceId,e.allDay,r.options.forceEventDuration||Boolean(n.duration),r),h=e.range.start;e.allDay&&n.startTime&&(h=r.dateEnv.add(h,n.startTime));var p=n.duration?r.dateEnv.add(h,n.duration):t.getDefaultEventEnd(e.allDay,h,r),v=t.createEventInstance(u.defId,{start:h,end:p});return{def:u,instance:v}}(e.dateSpan,r.dragMeta,l),g.mutatedEvents=t.eventTupleToStore(s),(c=!t.isInteractionValid(g,e.dateProfile,l))&&(g.mutatedEvents=t.createEmptyEventStore(),s=null))),r.displayDrag(l,g),a.setMirrorIsVisible(n||!s||!document.querySelector(".fc-event-mirror")),c?t.disableCursor():t.enableCursor(),n||(a.setMirrorNeedsRevert(!s),r.receivingContext=l,r.droppableEvent=s)},this.handleDragEnd=function(e){var n=r,o=n.receivingContext,a=n.droppableEvent;if(r.clearDrag(),o&&a){var l=r.hitDragging.finalHit,s=l.context.viewApi,c=r.dragMeta;if(o.emitter.trigger("drop",i(i({},y(l.dateSpan,o)),{draggedEl:e.subjectEl,jsEvent:e.origEvent,view:s})),c.create){var g=t.eventTupleToStore(a);o.dispatch({type:"MERGE_EVENTS",eventStore:g}),e.isTouch&&o.dispatch({type:"SELECT_EVENT",eventInstanceId:a.instance.instanceId}),o.emitter.trigger("eventReceive",{event:new t.EventApi(o,a.def,a.instance),relatedEvents:[],revert:function(){o.dispatch({type:"REMOVE_EVENTS",eventStore:g})},draggedEl:e.subjectEl,view:s})}}r.receivingContext=null,r.droppableEvent=null};var o=this.hitDragging=new m(e,t.interactionSettingsStore);o.requireInitial=!1,o.emitter.on("dragstart",this.handleDragStart),o.emitter.on("hitupdate",this.handleHitUpdate),o.emitter.on("dragend",this.handleDragEnd),this.suppliedDragMeta=n}return e.prototype.buildDragMeta=function(e){return"object"==typeof this.suppliedDragMeta?t.parseDragMeta(this.suppliedDragMeta):"function"==typeof this.suppliedDragMeta?t.parseDragMeta(this.suppliedDragMeta(e)):(n=function(e,n){var r=t.config.dataAttrPrefix,i=(r?r+"-":"")+n;return e.getAttribute("data-"+i)||""}(e,"event"),r=n?JSON.parse(n):{create:!1},t.parseDragMeta(r));var n,r},e.prototype.displayDrag=function(e,t){var n=this.receivingContext;n&&n!==e&&n.dispatch({type:"UNSET_EVENT_DRAG"}),e&&e.dispatch({type:"SET_EVENT_DRAG",state:t})},e.prototype.clearDrag=function(){this.receivingContext&&this.receivingContext.dispatch({type:"UNSET_EVENT_DRAG"})},e.prototype.canDropElOnCalendar=function(e,n){var r=n.options.dropAccept;return"function"==typeof r?r.call(n.calendarApi,e):"string"!=typeof r||!r||Boolean(t.elementMatches(e,r))},e}();t.config.dataAttrPrefix="";var P=function(){function e(e,n){var r=this;void 0===n&&(n={}),this.handlePointerDown=function(e){var n=r.dragging,i=r.settings,o=i.minDistance,a=i.longPressDelay;n.minDistance=null!=o?o:e.isTouch?0:t.BASE_OPTION_DEFAULTS.eventDragMinDistance,n.delay=e.isTouch?null!=a?a:t.BASE_OPTION_DEFAULTS.longPressDelay:0},this.handleDragStart=function(e){e.isTouch&&r.dragging.delay&&e.subjectEl.classList.contains("fc-event")&&r.dragging.mirror.getMirrorEl().classList.add("fc-event-selected")},this.settings=n;var i=this.dragging=new f(e);i.touchScrollAllowed=!1,null!=n.itemSelector&&(i.pointer.selector=n.itemSelector),null!=n.appendTo&&(i.mirror.parentNode=n.appendTo),i.emitter.on("pointerdown",this.handlePointerDown),i.emitter.on("dragstart",this.handleDragStart),new I(i,n.eventData)}return e.prototype.destroy=function(){this.dragging.destroy()},e}(),A=function(e){function t(t){var n=e.call(this,t)||this;n.shouldIgnoreMove=!1,n.mirrorSelector="",n.currentMirrorEl=null,n.handlePointerDown=function(e){n.emitter.trigger("pointerdown",e),n.shouldIgnoreMove||n.emitter.trigger("dragstart",e)},n.handlePointerMove=function(e){n.shouldIgnoreMove||n.emitter.trigger("dragmove",e)},n.handlePointerUp=function(e){n.emitter.trigger("pointerup",e),n.shouldIgnoreMove||n.emitter.trigger("dragend",e)};var r=n.pointer=new s(t);return r.emitter.on("pointerdown",n.handlePointerDown),r.emitter.on("pointermove",n.handlePointerMove),r.emitter.on("pointerup",n.handlePointerUp),n}return r(t,e),t.prototype.destroy=function(){this.pointer.destroy()},t.prototype.setIgnoreMove=function(e){this.shouldIgnoreMove=e},t.prototype.setMirrorIsVisible=function(e){if(e)this.currentMirrorEl&&(this.currentMirrorEl.style.visibility="",this.currentMirrorEl=null);else{var t=this.mirrorSelector?document.querySelector(this.mirrorSelector):null;t&&(this.currentMirrorEl=t,t.style.visibility="hidden")}},t}(t.ElementDragging),L=function(){function e(e,t){var n=document;e===document||e instanceof Element?(n=e,t=t||{}):t=e||{};var r=this.dragging=new A(n);"string"==typeof t.itemSelector?r.pointer.selector=t.itemSelector:n===document&&(r.pointer.selector="[data-event]"),"string"==typeof t.mirrorSelector&&(r.mirrorSelector=t.mirrorSelector),new I(r,t.eventData)}return e.prototype.destroy=function(){this.dragging.destroy()},e}(),x=t.createPlugin({componentInteractions:[D,w,T,M],calendarInteractions:[b],elementDraggingImpl:f,optionRefiners:C,listenerRefiners:R});return t.globalPlugins.push(x),e.Draggable=P,e.FeaturefulElementDragging=f,e.PointerDragging=s,e.ThirdPartyDraggable=L,e.default=x,Object.defineProperty(e,"__esModule",{value:!0}),e}({},FullCalendar);
var FullCalendarInteraction=function(t,e){"use strict";e.config.touchMouseIgnoreWait=500;let i=0,n=0,r=!1;class s{constructor(t){this.subjectEl=null,this.selector="",this.handleSelector="",this.shouldIgnoreMove=!1,this.shouldWatchScroll=!0,this.isDragging=!1,this.isTouchDragging=!1,this.wasTouchScroll=!1,this.handleMouseDown=t=>{if(!this.shouldIgnoreMouse()&&function(t){return 0===t.button&&!t.ctrlKey}(t)&&this.tryStart(t)){let e=this.createEventFromMouse(t,!0);this.emitter.trigger("pointerdown",e),this.initScrollWatch(e),this.shouldIgnoreMove||document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp)}},this.handleMouseMove=t=>{let e=this.createEventFromMouse(t);this.recordCoords(e),this.emitter.trigger("pointermove",e)},this.handleMouseUp=t=>{document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),this.emitter.trigger("pointerup",this.createEventFromMouse(t)),this.cleanup()},this.handleTouchStart=t=>{if(this.tryStart(t)){this.isTouchDragging=!0;let e=this.createEventFromTouch(t,!0);this.emitter.trigger("pointerdown",e),this.initScrollWatch(e);let i=t.target;this.shouldIgnoreMove||i.addEventListener("touchmove",this.handleTouchMove),i.addEventListener("touchend",this.handleTouchEnd),i.addEventListener("touchcancel",this.handleTouchEnd),window.addEventListener("scroll",this.handleTouchScroll,!0)}},this.handleTouchMove=t=>{let e=this.createEventFromTouch(t);this.recordCoords(e),this.emitter.trigger("pointermove",e)},this.handleTouchEnd=t=>{if(this.isDragging){let n=t.target;n.removeEventListener("touchmove",this.handleTouchMove),n.removeEventListener("touchend",this.handleTouchEnd),n.removeEventListener("touchcancel",this.handleTouchEnd),window.removeEventListener("scroll",this.handleTouchScroll,!0),this.emitter.trigger("pointerup",this.createEventFromTouch(t)),this.cleanup(),this.isTouchDragging=!1,i+=1,setTimeout((()=>{i-=1}),e.config.touchMouseIgnoreWait)}},this.handleTouchScroll=()=>{this.wasTouchScroll=!0},this.handleScroll=t=>{if(!this.shouldIgnoreMove){let e=window.pageXOffset-this.prevScrollX+this.prevPageX,i=window.pageYOffset-this.prevScrollY+this.prevPageY;this.emitter.trigger("pointermove",{origEvent:t,isTouch:this.isTouchDragging,subjectEl:this.subjectEl,pageX:e,pageY:i,deltaX:e-this.origPageX,deltaY:i-this.origPageY})}},this.containerEl=t,this.emitter=new e.Emitter,t.addEventListener("mousedown",this.handleMouseDown),t.addEventListener("touchstart",this.handleTouchStart,{passive:!0}),n+=1,1===n&&window.addEventListener("touchmove",o,{passive:!1})}destroy(){this.containerEl.removeEventListener("mousedown",this.handleMouseDown),this.containerEl.removeEventListener("touchstart",this.handleTouchStart,{passive:!0}),n-=1,n||window.removeEventListener("touchmove",o,{passive:!1})}tryStart(t){let i=this.querySubjectEl(t),n=t.target;return!(!i||this.handleSelector&&!e.elementClosest(n,this.handleSelector))&&(this.subjectEl=i,this.isDragging=!0,this.wasTouchScroll=!1,!0)}cleanup(){r=!1,this.isDragging=!1,this.subjectEl=null,this.destroyScrollWatch()}querySubjectEl(t){return this.selector?e.elementClosest(t.target,this.selector):this.containerEl}shouldIgnoreMouse(){return i||this.isTouchDragging}cancelTouchScroll(){this.isDragging&&(r=!0)}initScrollWatch(t){this.shouldWatchScroll&&(this.recordCoords(t),window.addEventListener("scroll",this.handleScroll,!0))}recordCoords(t){this.shouldWatchScroll&&(this.prevPageX=t.pageX,this.prevPageY=t.pageY,this.prevScrollX=window.pageXOffset,this.prevScrollY=window.pageYOffset)}destroyScrollWatch(){this.shouldWatchScroll&&window.removeEventListener("scroll",this.handleScroll,!0)}createEventFromMouse(t,e){let i=0,n=0;return e?(this.origPageX=t.pageX,this.origPageY=t.pageY):(i=t.pageX-this.origPageX,n=t.pageY-this.origPageY),{origEvent:t,isTouch:!1,subjectEl:this.subjectEl,pageX:t.pageX,pageY:t.pageY,deltaX:i,deltaY:n}}createEventFromTouch(t,e){let i,n,r=t.touches,s=0,o=0;return r&&r.length?(i=r[0].pageX,n=r[0].pageY):(i=t.pageX,n=t.pageY),e?(this.origPageX=i,this.origPageY=n):(s=i-this.origPageX,o=n-this.origPageY),{origEvent:t,isTouch:!0,subjectEl:this.subjectEl,pageX:i,pageY:n,deltaX:s,deltaY:o}}}function o(t){r&&t.preventDefault()}class l{constructor(){this.isVisible=!1,this.sourceEl=null,this.mirrorEl=null,this.sourceElRect=null,this.parentNode=document.body,this.zIndex=9999,this.revertDuration=0}start(t,e,i){this.sourceEl=t,this.sourceElRect=this.sourceEl.getBoundingClientRect(),this.origScreenX=e-window.pageXOffset,this.origScreenY=i-window.pageYOffset,this.deltaX=0,this.deltaY=0,this.updateElPosition()}handleMove(t,e){this.deltaX=t-window.pageXOffset-this.origScreenX,this.deltaY=e-window.pageYOffset-this.origScreenY,this.updateElPosition()}setIsVisible(t){t?this.isVisible||(this.mirrorEl&&(this.mirrorEl.style.display=""),this.isVisible=t,this.updateElPosition()):this.isVisible&&(this.mirrorEl&&(this.mirrorEl.style.display="none"),this.isVisible=t)}stop(t,e){let i=()=>{this.cleanup(),e()};t&&this.mirrorEl&&this.isVisible&&this.revertDuration&&(this.deltaX||this.deltaY)?this.doRevertAnimation(i,this.revertDuration):setTimeout(i,0)}doRevertAnimation(t,i){let n=this.mirrorEl,r=this.sourceEl.getBoundingClientRect();n.style.transition="top "+i+"ms,left "+i+"ms",e.applyStyle(n,{left:r.left,top:r.top}),e.whenTransitionDone(n,(()=>{n.style.transition="",t()}))}cleanup(){this.mirrorEl&&(e.removeElement(this.mirrorEl),this.mirrorEl=null),this.sourceEl=null}updateElPosition(){this.sourceEl&&this.isVisible&&e.applyStyle(this.getMirrorEl(),{left:this.sourceElRect.left+this.deltaX,top:this.sourceElRect.top+this.deltaY})}getMirrorEl(){let t=this.sourceElRect,i=this.mirrorEl;return i||(i=this.mirrorEl=this.sourceEl.cloneNode(!0),i.classList.add("fc-unselectable"),i.classList.add("fc-event-dragging"),e.applyStyle(i,{position:"fixed",zIndex:this.zIndex,visibility:"",boxSizing:"border-box",width:t.right-t.left,height:t.bottom-t.top,right:"auto",bottom:"auto",margin:0}),this.parentNode.appendChild(i)),i}}class a extends e.ScrollController{constructor(t,e){super(),this.handleScroll=()=>{this.scrollTop=this.scrollController.getScrollTop(),this.scrollLeft=this.scrollController.getScrollLeft(),this.handleScrollChange()},this.scrollController=t,this.doesListening=e,this.scrollTop=this.origScrollTop=t.getScrollTop(),this.scrollLeft=this.origScrollLeft=t.getScrollLeft(),this.scrollWidth=t.getScrollWidth(),this.scrollHeight=t.getScrollHeight(),this.clientWidth=t.getClientWidth(),this.clientHeight=t.getClientHeight(),this.clientRect=this.computeClientRect(),this.doesListening&&this.getEventTarget().addEventListener("scroll",this.handleScroll)}destroy(){this.doesListening&&this.getEventTarget().removeEventListener("scroll",this.handleScroll)}getScrollTop(){return this.scrollTop}getScrollLeft(){return this.scrollLeft}setScrollTop(t){this.scrollController.setScrollTop(t),this.doesListening||(this.scrollTop=Math.max(Math.min(t,this.getMaxScrollTop()),0),this.handleScrollChange())}setScrollLeft(t){this.scrollController.setScrollLeft(t),this.doesListening||(this.scrollLeft=Math.max(Math.min(t,this.getMaxScrollLeft()),0),this.handleScrollChange())}getClientWidth(){return this.clientWidth}getClientHeight(){return this.clientHeight}getScrollWidth(){return this.scrollWidth}getScrollHeight(){return this.scrollHeight}handleScrollChange(){}}class h extends a{constructor(t,i){super(new e.ElementScrollController(t),i)}getEventTarget(){return this.scrollController.el}computeClientRect(){return e.computeInnerRect(this.scrollController.el)}}class c extends a{constructor(t){super(new e.WindowScrollController,t)}getEventTarget(){return window}computeClientRect(){return{left:this.scrollLeft,right:this.scrollLeft+this.clientWidth,top:this.scrollTop,bottom:this.scrollTop+this.clientHeight}}handleScrollChange(){this.clientRect=this.computeClientRect()}}const d="function"==typeof performance?performance.now:Date.now;class g{constructor(){this.isEnabled=!0,this.scrollQuery=[window,".fc-scroller"],this.edgeThreshold=50,this.maxVelocity=300,this.pointerScreenX=null,this.pointerScreenY=null,this.isAnimating=!1,this.scrollCaches=null,this.everMovedUp=!1,this.everMovedDown=!1,this.everMovedLeft=!1,this.everMovedRight=!1,this.animate=()=>{if(this.isAnimating){let t=this.computeBestEdge(this.pointerScreenX+window.pageXOffset,this.pointerScreenY+window.pageYOffset);if(t){let e=d();this.handleSide(t,(e-this.msSinceRequest)/1e3),this.requestAnimation(e)}else this.isAnimating=!1}}}start(t,e,i){this.isEnabled&&(this.scrollCaches=this.buildCaches(i),this.pointerScreenX=null,this.pointerScreenY=null,this.everMovedUp=!1,this.everMovedDown=!1,this.everMovedLeft=!1,this.everMovedRight=!1,this.handleMove(t,e))}handleMove(t,e){if(this.isEnabled){let i=t-window.pageXOffset,n=e-window.pageYOffset,r=null===this.pointerScreenY?0:n-this.pointerScreenY,s=null===this.pointerScreenX?0:i-this.pointerScreenX;r<0?this.everMovedUp=!0:r>0&&(this.everMovedDown=!0),s<0?this.everMovedLeft=!0:s>0&&(this.everMovedRight=!0),this.pointerScreenX=i,this.pointerScreenY=n,this.isAnimating||(this.isAnimating=!0,this.requestAnimation(d()))}}stop(){if(this.isEnabled){this.isAnimating=!1;for(let t of this.scrollCaches)t.destroy();this.scrollCaches=null}}requestAnimation(t){this.msSinceRequest=t,requestAnimationFrame(this.animate)}handleSide(t,e){let{scrollCache:i}=t,{edgeThreshold:n}=this,r=n-t.distance,s=r*r/(n*n)*this.maxVelocity*e,o=1;switch(t.name){case"left":o=-1;case"right":i.setScrollLeft(i.getScrollLeft()+s*o);break;case"top":o=-1;case"bottom":i.setScrollTop(i.getScrollTop()+s*o)}}computeBestEdge(t,e){let{edgeThreshold:i}=this,n=null,r=this.scrollCaches||[];for(let s of r){let r=s.clientRect,o=t-r.left,l=r.right-t,a=e-r.top,h=r.bottom-e;o>=0&&l>=0&&a>=0&&h>=0&&(a<=i&&this.everMovedUp&&s.canScrollUp()&&(!n||n.distance>a)&&(n={scrollCache:s,name:"top",distance:a}),h<=i&&this.everMovedDown&&s.canScrollDown()&&(!n||n.distance>h)&&(n={scrollCache:s,name:"bottom",distance:h}),o<=i&&this.everMovedLeft&&s.canScrollLeft()&&(!n||n.distance>o)&&(n={scrollCache:s,name:"left",distance:o}),l<=i&&this.everMovedRight&&s.canScrollRight()&&(!n||n.distance>l)&&(n={scrollCache:s,name:"right",distance:l}))}return n}buildCaches(t){return this.queryScrollEls(t).map((t=>t===window?new c(!1):new h(t,!1)))}queryScrollEls(t){let i=[];for(let n of this.scrollQuery)"object"==typeof n?i.push(n):i.push(...Array.prototype.slice.call(e.getElRoot(t).querySelectorAll(n)));return i}}class u extends e.ElementDragging{constructor(t,i){super(t),this.containerEl=t,this.delay=null,this.minDistance=0,this.touchScrollAllowed=!0,this.mirrorNeedsRevert=!1,this.isInteracting=!1,this.isDragging=!1,this.isDelayEnded=!1,this.isDistanceSurpassed=!1,this.delayTimeoutId=null,this.onPointerDown=t=>{this.isDragging||(this.isInteracting=!0,this.isDelayEnded=!1,this.isDistanceSurpassed=!1,e.preventSelection(document.body),e.preventContextMenu(document.body),t.isTouch||t.origEvent.preventDefault(),this.emitter.trigger("pointerdown",t),this.isInteracting&&!this.pointer.shouldIgnoreMove&&(this.mirror.setIsVisible(!1),this.mirror.start(t.subjectEl,t.pageX,t.pageY),this.startDelay(t),this.minDistance||this.handleDistanceSurpassed(t)))},this.onPointerMove=t=>{if(this.isInteracting){if(this.emitter.trigger("pointermove",t),!this.isDistanceSurpassed){let e,i=this.minDistance,{deltaX:n,deltaY:r}=t;e=n*n+r*r,e>=i*i&&this.handleDistanceSurpassed(t)}this.isDragging&&("scroll"!==t.origEvent.type&&(this.mirror.handleMove(t.pageX,t.pageY),this.autoScroller.handleMove(t.pageX,t.pageY)),this.emitter.trigger("dragmove",t))}},this.onPointerUp=t=>{this.isInteracting&&(this.isInteracting=!1,e.allowSelection(document.body),e.allowContextMenu(document.body),this.emitter.trigger("pointerup",t),this.isDragging&&(this.autoScroller.stop(),this.tryStopDrag(t)),this.delayTimeoutId&&(clearTimeout(this.delayTimeoutId),this.delayTimeoutId=null))};let n=this.pointer=new s(t);n.emitter.on("pointerdown",this.onPointerDown),n.emitter.on("pointermove",this.onPointerMove),n.emitter.on("pointerup",this.onPointerUp),i&&(n.selector=i),this.mirror=new l,this.autoScroller=new g}destroy(){this.pointer.destroy(),this.onPointerUp({})}startDelay(t){"number"==typeof this.delay?this.delayTimeoutId=setTimeout((()=>{this.delayTimeoutId=null,this.handleDelayEnd(t)}),this.delay):this.handleDelayEnd(t)}handleDelayEnd(t){this.isDelayEnded=!0,this.tryStartDrag(t)}handleDistanceSurpassed(t){this.isDistanceSurpassed=!0,this.tryStartDrag(t)}tryStartDrag(t){this.isDelayEnded&&this.isDistanceSurpassed&&(this.pointer.wasTouchScroll&&!this.touchScrollAllowed||(this.isDragging=!0,this.mirrorNeedsRevert=!1,this.autoScroller.start(t.pageX,t.pageY,this.containerEl),this.emitter.trigger("dragstart",t),!1===this.touchScrollAllowed&&this.pointer.cancelTouchScroll()))}tryStopDrag(t){this.mirror.stop(this.mirrorNeedsRevert,this.stopDrag.bind(this,t))}stopDrag(t){this.isDragging=!1,this.emitter.trigger("dragend",t)}setIgnoreMove(t){this.pointer.shouldIgnoreMove=t}setMirrorIsVisible(t){this.mirror.setIsVisible(t)}setMirrorNeedsRevert(t){this.mirrorNeedsRevert=t}setAutoScrollEnabled(t){this.autoScroller.isEnabled=t}}class p{constructor(t){this.origRect=e.computeRect(t),this.scrollCaches=e.getClippingParents(t).map((t=>new h(t,!0)))}destroy(){for(let t of this.scrollCaches)t.destroy()}computeLeft(){let t=this.origRect.left;for(let e of this.scrollCaches)t+=e.origScrollLeft-e.getScrollLeft();return t}computeTop(){let t=this.origRect.top;for(let e of this.scrollCaches)t+=e.origScrollTop-e.getScrollTop();return t}isWithinClipping(t,i){let n={left:t,top:i};for(let t of this.scrollCaches)if(!v(t.getEventTarget())&&!e.pointInsideRect(n,t.clientRect))return!1;return!0}}function v(t){let e=t.tagName;return"HTML"===e||"BODY"===e}class E{constructor(t,i){this.useSubjectCenter=!1,this.requireInitial=!0,this.initialHit=null,this.movingHit=null,this.finalHit=null,this.handlePointerDown=t=>{let{dragging:e}=this;this.initialHit=null,this.movingHit=null,this.finalHit=null,this.prepareHits(),this.processFirstCoord(t),this.initialHit||!this.requireInitial?(e.setIgnoreMove(!1),this.emitter.trigger("pointerdown",t)):e.setIgnoreMove(!0)},this.handleDragStart=t=>{this.emitter.trigger("dragstart",t),this.handleMove(t,!0)},this.handleDragMove=t=>{this.emitter.trigger("dragmove",t),this.handleMove(t)},this.handlePointerUp=t=>{this.releaseHits(),this.emitter.trigger("pointerup",t)},this.handleDragEnd=t=>{this.movingHit&&this.emitter.trigger("hitupdate",null,!0,t),this.finalHit=this.movingHit,this.movingHit=null,this.emitter.trigger("dragend",t)},this.droppableStore=i,t.emitter.on("pointerdown",this.handlePointerDown),t.emitter.on("dragstart",this.handleDragStart),t.emitter.on("dragmove",this.handleDragMove),t.emitter.on("pointerup",this.handlePointerUp),t.emitter.on("dragend",this.handleDragEnd),this.dragging=t,this.emitter=new e.Emitter}processFirstCoord(t){let i,n={left:t.pageX,top:t.pageY},r=n,s=t.subjectEl;s instanceof HTMLElement&&(i=e.computeRect(s),r=e.constrainPoint(r,i));let o=this.initialHit=this.queryHitForOffset(r.left,r.top);if(o){if(this.useSubjectCenter&&i){let t=e.intersectRects(i,o.rect);t&&(r=e.getRectCenter(t))}this.coordAdjust=e.diffPoints(r,n)}else this.coordAdjust={left:0,top:0}}handleMove(t,e){let i=this.queryHitForOffset(t.pageX+this.coordAdjust.left,t.pageY+this.coordAdjust.top);!e&&m(this.movingHit,i)||(this.movingHit=i,this.emitter.trigger("hitupdate",i,!1,t))}prepareHits(){this.offsetTrackers=e.mapHash(this.droppableStore,(t=>(t.component.prepareHits(),new p(t.el))))}releaseHits(){let{offsetTrackers:t}=this;for(let e in t)t[e].destroy();this.offsetTrackers={}}queryHitForOffset(t,i){let{droppableStore:n,offsetTrackers:r}=this,s=null;for(let o in n){let l=n[o].component,a=r[o];if(a&&a.isWithinClipping(t,i)){let n=a.computeLeft(),r=a.computeTop(),h=t-n,c=i-r,{origRect:d}=a,g=d.right-d.left,u=d.bottom-d.top;if(h>=0&&h<g&&c>=0&&c<u){let t=l.queryHit(h,c,g,u);t&&e.rangeContainsRange(t.dateProfile.activeRange,t.dateSpan.range)&&(!s||t.layer>s.layer)&&(t.componentId=o,t.context=l.context,t.rect.left+=n,t.rect.right+=n,t.rect.top+=r,t.rect.bottom+=r,s=t)}}}return s}}function m(t,i){return!t&&!i||Boolean(t)===Boolean(i)&&e.isDateSpansEqual(t.dateSpan,i.dateSpan)}var S=function(){return(S=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function f(t,e){let i={};for(let n of e.pluginHooks.datePointTransforms)S(i,n(t,e));var n,r;return S(i,(n=t,{date:(r=e.dateEnv).toDate(n.range.start),dateStr:r.formatIso(n.range.start,{omitTime:n.allDay}),allDay:n.allDay})),i}class D extends e.Interaction{constructor(t){super(t),this.handlePointerDown=t=>{let{dragging:e}=this,i=t.origEvent.target;e.setIgnoreMove(!this.component.isValidDateDownEl(i))},this.handleDragEnd=t=>{let{component:e}=this,{pointer:i}=this.dragging;if(!i.wasTouchScroll){let{initialHit:i,finalHit:n}=this.hitDragging;if(i&&n&&m(i,n)){let{context:n}=e,r=Object.assign(Object.assign({},f(i.dateSpan,n)),{dayEl:i.dayEl,jsEvent:t.origEvent,view:n.viewApi||n.calendarApi.view});n.emitter.trigger("dateClick",r)}}},this.dragging=new u(t.el),this.dragging.autoScroller.isEnabled=!1;let i=this.hitDragging=new E(this.dragging,e.interactionSettingsToStore(t));i.emitter.on("pointerdown",this.handlePointerDown),i.emitter.on("dragend",this.handleDragEnd)}destroy(){this.dragging.destroy()}}class y extends e.Interaction{constructor(t){super(t),this.dragSelection=null,this.handlePointerDown=t=>{let{component:e,dragging:i}=this,{options:n}=e.context,r=n.selectable&&e.isValidDateDownEl(t.origEvent.target);i.setIgnoreMove(!r),i.delay=t.isTouch?function(t){let{options:e}=t.context,i=e.selectLongPressDelay;null==i&&(i=e.longPressDelay);return i}(e):null},this.handleDragStart=t=>{this.component.context.calendarApi.unselect(t)},this.handleHitUpdate=(t,i)=>{let{context:n}=this.component,r=null,s=!1;if(t){let i=this.hitDragging.initialHit;t.componentId===i.componentId&&this.isHitComboAllowed&&!this.isHitComboAllowed(i,t)||(r=function(t,i,n){let r=t.dateSpan,s=i.dateSpan,o=[r.range.start,r.range.end,s.range.start,s.range.end];o.sort(e.compareNumbers);let l={};for(let e of n){let n=e(t,i);if(!1===n)return null;n&&S(l,n)}return l.range={start:o[0],end:o[3]},l.allDay=r.allDay,l}(i,t,n.pluginHooks.dateSelectionTransformers)),r&&e.isDateSelectionValid(r,t.dateProfile,n)||(s=!0,r=null)}r?n.dispatch({type:"SELECT_DATES",selection:r}):i||n.dispatch({type:"UNSELECT_DATES"}),s?e.disableCursor():e.enableCursor(),i||(this.dragSelection=r)},this.handlePointerUp=t=>{this.dragSelection&&(e.triggerDateSelect(this.dragSelection,t,this.component.context),this.dragSelection=null)};let{component:i}=t,{options:n}=i.context,r=this.dragging=new u(t.el);r.touchScrollAllowed=!1,r.minDistance=n.selectMinDistance||0,r.autoScroller.isEnabled=n.dragScroll;let s=this.hitDragging=new E(this.dragging,e.interactionSettingsToStore(t));s.emitter.on("pointerdown",this.handlePointerDown),s.emitter.on("dragstart",this.handleDragStart),s.emitter.on("hitupdate",this.handleHitUpdate),s.emitter.on("pointerup",this.handlePointerUp)}destroy(){this.dragging.destroy()}}class w extends e.Interaction{constructor(t){super(t),this.subjectEl=null,this.subjectSeg=null,this.isDragging=!1,this.eventRange=null,this.relevantEvents=null,this.receivingContext=null,this.validMutation=null,this.mutatedRelevantEvents=null,this.handlePointerDown=t=>{let i=t.origEvent.target,{component:n,dragging:r}=this,{mirror:s}=r,{options:o}=n.context,l=n.context;this.subjectEl=t.subjectEl;let a=this.subjectSeg=e.getElSeg(t.subjectEl),h=(this.eventRange=a.eventRange).instance.instanceId;this.relevantEvents=e.getRelevantEvents(l.getCurrentData().eventStore,h),r.minDistance=t.isTouch?0:o.eventDragMinDistance,r.delay=t.isTouch&&h!==n.props.eventSelection?function(t){let{options:e}=t.context,i=e.eventLongPressDelay;null==i&&(i=e.longPressDelay);return i}(n):null,o.fixedMirrorParent?s.parentNode=o.fixedMirrorParent:s.parentNode=e.elementClosest(i,".fc"),s.revertDuration=o.dragRevertDuration;let c=n.isValidSegDownEl(i)&&!e.elementClosest(i,".fc-event-resizer");r.setIgnoreMove(!c),this.isDragging=c&&t.subjectEl.classList.contains("fc-event-draggable")},this.handleDragStart=t=>{let i=this.component.context,n=this.eventRange,r=n.instance.instanceId;t.isTouch?r!==this.component.props.eventSelection&&i.dispatch({type:"SELECT_EVENT",eventInstanceId:r}):i.dispatch({type:"UNSELECT_EVENT"}),this.isDragging&&(i.calendarApi.unselect(t),i.emitter.trigger("eventDragStart",{el:this.subjectEl,event:new e.EventApi(i,n.def,n.instance),jsEvent:t.origEvent,view:i.viewApi}))},this.handleHitUpdate=(t,i)=>{if(!this.isDragging)return;let n=this.relevantEvents,r=this.hitDragging.initialHit,s=this.component.context,o=null,l=null,a=null,h=!1,c={affectedEvents:n,mutatedEvents:e.createEmptyEventStore(),isEvent:!0};if(t){o=t.context;let i=o.options;s===o||i.editable&&i.droppable?(l=function(t,i,n){let r=t.dateSpan,s=i.dateSpan,o=r.range.start,l=s.range.start,a={};r.allDay!==s.allDay&&(a.allDay=s.allDay,a.hasEnd=i.context.options.allDayMaintainDuration,s.allDay&&(o=e.startOfDay(o)));let h=e.diffDates(o,l,t.context.dateEnv,t.componentId===i.componentId?t.largeUnit:null);h.milliseconds&&(a.allDay=!1);let c={datesDelta:h,standardProps:a};for(let e of n)e(c,t,i);return c}(r,t,o.getCurrentData().pluginHooks.eventDragMutationMassagers),l&&(a=e.applyMutationToEventStore(n,o.getCurrentData().eventUiBases,l,o),c.mutatedEvents=a,e.isInteractionValid(c,t.dateProfile,o)||(h=!0,l=null,a=null,c.mutatedEvents=e.createEmptyEventStore()))):o=null}this.displayDrag(o,c),h?e.disableCursor():e.enableCursor(),i||(s===o&&m(r,t)&&(l=null),this.dragging.setMirrorNeedsRevert(!l),this.dragging.setMirrorIsVisible(!t||!e.getElRoot(this.subjectEl).querySelector(".fc-event-mirror")),this.receivingContext=o,this.validMutation=l,this.mutatedRelevantEvents=a)},this.handlePointerUp=()=>{this.isDragging||this.cleanup()},this.handleDragEnd=t=>{if(this.isDragging){let i=this.component.context,n=i.viewApi,{receivingContext:r,validMutation:s}=this,o=this.eventRange.def,l=this.eventRange.instance,a=new e.EventApi(i,o,l),h=this.relevantEvents,c=this.mutatedRelevantEvents,{finalHit:d}=this.hitDragging;if(this.clearDrag(),i.emitter.trigger("eventDragStop",{el:this.subjectEl,event:a,jsEvent:t.origEvent,view:n}),s){if(r===i){let r=new e.EventApi(i,c.defs[o.defId],l?c.instances[l.instanceId]:null);i.dispatch({type:"MERGE_EVENTS",eventStore:c});let d={oldEvent:a,event:r,relatedEvents:e.buildEventApis(c,i,l),revert(){i.dispatch({type:"MERGE_EVENTS",eventStore:h})}},g={};for(let t of i.getCurrentData().pluginHooks.eventDropTransformers)S(g,t(s,i));i.emitter.trigger("eventDrop",Object.assign(Object.assign(Object.assign({},d),g),{el:t.subjectEl,delta:s.datesDelta,jsEvent:t.origEvent,view:n})),i.emitter.trigger("eventChange",d)}else if(r){let s={event:a,relatedEvents:e.buildEventApis(h,i,l),revert(){i.dispatch({type:"MERGE_EVENTS",eventStore:h})}};i.emitter.trigger("eventLeave",Object.assign(Object.assign({},s),{draggedEl:t.subjectEl,view:n})),i.dispatch({type:"REMOVE_EVENTS",eventStore:h}),i.emitter.trigger("eventRemove",s);let g=c.defs[o.defId],u=c.instances[l.instanceId],p=new e.EventApi(r,g,u);r.dispatch({type:"MERGE_EVENTS",eventStore:c});let v={event:p,relatedEvents:e.buildEventApis(c,r,u),revert(){r.dispatch({type:"REMOVE_EVENTS",eventStore:c})}};r.emitter.trigger("eventAdd",v),t.isTouch&&r.dispatch({type:"SELECT_EVENT",eventInstanceId:l.instanceId}),r.emitter.trigger("drop",Object.assign(Object.assign({},f(d.dateSpan,r)),{draggedEl:t.subjectEl,jsEvent:t.origEvent,view:d.context.viewApi})),r.emitter.trigger("eventReceive",Object.assign(Object.assign({},v),{draggedEl:t.subjectEl,view:d.context.viewApi}))}}else i.emitter.trigger("_noEventDrop")}this.cleanup()};let{component:i}=this,{options:n}=i.context,r=this.dragging=new u(t.el);r.pointer.selector=w.SELECTOR,r.touchScrollAllowed=!1,r.autoScroller.isEnabled=n.dragScroll;let s=this.hitDragging=new E(this.dragging,e.interactionSettingsStore);s.useSubjectCenter=t.useEventCenter,s.emitter.on("pointerdown",this.handlePointerDown),s.emitter.on("dragstart",this.handleDragStart),s.emitter.on("hitupdate",this.handleHitUpdate),s.emitter.on("pointerup",this.handlePointerUp),s.emitter.on("dragend",this.handleDragEnd)}destroy(){this.dragging.destroy()}displayDrag(t,i){let n=this.component.context,r=this.receivingContext;r&&r!==t&&(r===n?r.dispatch({type:"SET_EVENT_DRAG",state:{affectedEvents:i.affectedEvents,mutatedEvents:e.createEmptyEventStore(),isEvent:!0}}):r.dispatch({type:"UNSET_EVENT_DRAG"})),t&&t.dispatch({type:"SET_EVENT_DRAG",state:i})}clearDrag(){let t=this.component.context,{receivingContext:e}=this;e&&e.dispatch({type:"UNSET_EVENT_DRAG"}),t!==e&&t.dispatch({type:"UNSET_EVENT_DRAG"})}cleanup(){this.subjectSeg=null,this.isDragging=!1,this.eventRange=null,this.relevantEvents=null,this.receivingContext=null,this.validMutation=null,this.mutatedRelevantEvents=null}}w.SELECTOR=".fc-event-draggable, .fc-event-resizable";class T extends e.Interaction{constructor(t){super(t),this.draggingSegEl=null,this.draggingSeg=null,this.eventRange=null,this.relevantEvents=null,this.validMutation=null,this.mutatedRelevantEvents=null,this.handlePointerDown=t=>{let{component:i}=this,n=this.querySegEl(t),r=e.getElSeg(n),s=this.eventRange=r.eventRange;this.dragging.minDistance=i.context.options.eventDragMinDistance,this.dragging.setIgnoreMove(!this.component.isValidSegDownEl(t.origEvent.target)||t.isTouch&&this.component.props.eventSelection!==s.instance.instanceId)},this.handleDragStart=t=>{let{context:i}=this.component,n=this.eventRange;this.relevantEvents=e.getRelevantEvents(i.getCurrentData().eventStore,this.eventRange.instance.instanceId);let r=this.querySegEl(t);this.draggingSegEl=r,this.draggingSeg=e.getElSeg(r),i.calendarApi.unselect(),i.emitter.trigger("eventResizeStart",{el:r,event:new e.EventApi(i,n.def,n.instance),jsEvent:t.origEvent,view:i.viewApi})},this.handleHitUpdate=(t,i,n)=>{let{context:r}=this.component,s=this.relevantEvents,o=this.hitDragging.initialHit,l=this.eventRange.instance,a=null,h=null,c=!1,d={affectedEvents:s,mutatedEvents:e.createEmptyEventStore(),isEvent:!0};if(t){t.componentId===o.componentId&&this.isHitComboAllowed&&!this.isHitComboAllowed(o,t)||(a=function(t,i,n,r){let s=t.context.dateEnv,o=t.dateSpan.range.start,l=i.dateSpan.range.start,a=e.diffDates(o,l,s,t.largeUnit);if(n){if(s.add(r.start,a)<r.end)return{startDelta:a}}else if(s.add(r.end,a)>r.start)return{endDelta:a};return null}(o,t,n.subjectEl.classList.contains("fc-event-resizer-start"),l.range))}a&&(h=e.applyMutationToEventStore(s,r.getCurrentData().eventUiBases,a,r),d.mutatedEvents=h,e.isInteractionValid(d,t.dateProfile,r)||(c=!0,a=null,h=null,d.mutatedEvents=null)),h?r.dispatch({type:"SET_EVENT_RESIZE",state:d}):r.dispatch({type:"UNSET_EVENT_RESIZE"}),c?e.disableCursor():e.enableCursor(),i||(a&&m(o,t)&&(a=null),this.validMutation=a,this.mutatedRelevantEvents=h)},this.handleDragEnd=t=>{let{context:i}=this.component,n=this.eventRange.def,r=this.eventRange.instance,s=new e.EventApi(i,n,r),o=this.relevantEvents,l=this.mutatedRelevantEvents;if(i.emitter.trigger("eventResizeStop",{el:this.draggingSegEl,event:s,jsEvent:t.origEvent,view:i.viewApi}),this.validMutation){let a=new e.EventApi(i,l.defs[n.defId],r?l.instances[r.instanceId]:null);i.dispatch({type:"MERGE_EVENTS",eventStore:l});let h={oldEvent:s,event:a,relatedEvents:e.buildEventApis(l,i,r),revert(){i.dispatch({type:"MERGE_EVENTS",eventStore:o})}};i.emitter.trigger("eventResize",Object.assign(Object.assign({},h),{el:this.draggingSegEl,startDelta:this.validMutation.startDelta||e.createDuration(0),endDelta:this.validMutation.endDelta||e.createDuration(0),jsEvent:t.origEvent,view:i.viewApi})),i.emitter.trigger("eventChange",h)}else i.emitter.trigger("_noEventResize");this.draggingSeg=null,this.relevantEvents=null,this.validMutation=null};let{component:i}=t,n=this.dragging=new u(t.el);n.pointer.selector=".fc-event-resizer",n.touchScrollAllowed=!1,n.autoScroller.isEnabled=i.context.options.dragScroll;let r=this.hitDragging=new E(this.dragging,e.interactionSettingsToStore(t));r.emitter.on("pointerdown",this.handlePointerDown),r.emitter.on("dragstart",this.handleDragStart),r.emitter.on("hitupdate",this.handleHitUpdate),r.emitter.on("dragend",this.handleDragEnd)}destroy(){this.dragging.destroy()}querySegEl(t){return e.elementClosest(t.subjectEl,".fc-event")}}const M={fixedMirrorParent:e.identity},b={dateClick:e.identity,eventDragStart:e.identity,eventDragStop:e.identity,eventDrop:e.identity,eventResizeStart:e.identity,eventResizeStop:e.identity,eventResize:e.identity,drop:e.identity,eventReceive:e.identity,eventLeave:e.identity};class C{constructor(t,i){this.receivingContext=null,this.droppableEvent=null,this.suppliedDragMeta=null,this.dragMeta=null,this.handleDragStart=t=>{this.dragMeta=this.buildDragMeta(t.subjectEl)},this.handleHitUpdate=(t,i,n)=>{let{dragging:r}=this.hitDragging,s=null,o=null,l=!1,a={affectedEvents:e.createEmptyEventStore(),mutatedEvents:e.createEmptyEventStore(),isEvent:this.dragMeta.create};t&&(s=t.context,this.canDropElOnCalendar(n.subjectEl,s)&&(o=function(t,i,n){let r=Object.assign({},i.leftoverProps);for(let e of n.pluginHooks.externalDefTransforms)S(r,e(t,i));let{refined:s,extra:o}=e.refineEventDef(r,n),l=e.parseEventDef(s,o,i.sourceId,t.allDay,n.options.forceEventDuration||Boolean(i.duration),n),a=t.range.start;t.allDay&&i.startTime&&(a=n.dateEnv.add(a,i.startTime));let h=i.duration?n.dateEnv.add(a,i.duration):e.getDefaultEventEnd(t.allDay,a,n),c=e.createEventInstance(l.defId,{start:a,end:h});return{def:l,instance:c}}(t.dateSpan,this.dragMeta,s),a.mutatedEvents=e.eventTupleToStore(o),l=!e.isInteractionValid(a,t.dateProfile,s),l&&(a.mutatedEvents=e.createEmptyEventStore(),o=null))),this.displayDrag(s,a),r.setMirrorIsVisible(i||!o||!document.querySelector(".fc-event-mirror")),l?e.disableCursor():e.enableCursor(),i||(r.setMirrorNeedsRevert(!o),this.receivingContext=s,this.droppableEvent=o)},this.handleDragEnd=t=>{let{receivingContext:i,droppableEvent:n}=this;if(this.clearDrag(),i&&n){let r=this.hitDragging.finalHit,s=r.context.viewApi,o=this.dragMeta;if(i.emitter.trigger("drop",Object.assign(Object.assign({},f(r.dateSpan,i)),{draggedEl:t.subjectEl,jsEvent:t.origEvent,view:s})),o.create){let r=e.eventTupleToStore(n);i.dispatch({type:"MERGE_EVENTS",eventStore:r}),t.isTouch&&i.dispatch({type:"SELECT_EVENT",eventInstanceId:n.instance.instanceId}),i.emitter.trigger("eventReceive",{event:new e.EventApi(i,n.def,n.instance),relatedEvents:[],revert(){i.dispatch({type:"REMOVE_EVENTS",eventStore:r})},draggedEl:t.subjectEl,view:s})}}this.receivingContext=null,this.droppableEvent=null};let n=this.hitDragging=new E(t,e.interactionSettingsStore);n.requireInitial=!1,n.emitter.on("dragstart",this.handleDragStart),n.emitter.on("hitupdate",this.handleHitUpdate),n.emitter.on("dragend",this.handleDragEnd),this.suppliedDragMeta=i}buildDragMeta(t){return"object"==typeof this.suppliedDragMeta?e.parseDragMeta(this.suppliedDragMeta):"function"==typeof this.suppliedDragMeta?e.parseDragMeta(this.suppliedDragMeta(t)):function(t){let i=function(t,i){let n=e.config.dataAttrPrefix,r=(n?n+"-":"")+i;return t.getAttribute("data-"+r)||""}(t,"event"),n=i?JSON.parse(i):{create:!1};return e.parseDragMeta(n)}(t)}displayDrag(t,e){let i=this.receivingContext;i&&i!==t&&i.dispatch({type:"UNSET_EVENT_DRAG"}),t&&t.dispatch({type:"SET_EVENT_DRAG",state:e})}clearDrag(){this.receivingContext&&this.receivingContext.dispatch({type:"UNSET_EVENT_DRAG"})}canDropElOnCalendar(t,i){let n=i.options.dropAccept;return"function"==typeof n?n.call(i.calendarApi,t):"string"!=typeof n||!n||Boolean(e.elementMatches(t,n))}}e.config.dataAttrPrefix="";class R extends e.ElementDragging{constructor(t){super(t),this.shouldIgnoreMove=!1,this.mirrorSelector="",this.currentMirrorEl=null,this.handlePointerDown=t=>{this.emitter.trigger("pointerdown",t),this.shouldIgnoreMove||this.emitter.trigger("dragstart",t)},this.handlePointerMove=t=>{this.shouldIgnoreMove||this.emitter.trigger("dragmove",t)},this.handlePointerUp=t=>{this.emitter.trigger("pointerup",t),this.shouldIgnoreMove||this.emitter.trigger("dragend",t)};let e=this.pointer=new s(t);e.emitter.on("pointerdown",this.handlePointerDown),e.emitter.on("pointermove",this.handlePointerMove),e.emitter.on("pointerup",this.handlePointerUp)}destroy(){this.pointer.destroy()}setIgnoreMove(t){this.shouldIgnoreMove=t}setMirrorIsVisible(t){if(t)this.currentMirrorEl&&(this.currentMirrorEl.style.visibility="",this.currentMirrorEl=null);else{let t=this.mirrorSelector?document.querySelector(this.mirrorSelector):null;t&&(this.currentMirrorEl=t,t.style.visibility="hidden")}}}var I=e.createPlugin({componentInteractions:[D,y,w,T],calendarInteractions:[class{constructor(t){this.context=t,this.isRecentPointerDateSelect=!1,this.matchesCancel=!1,this.matchesEvent=!1,this.onSelect=t=>{t.jsEvent&&(this.isRecentPointerDateSelect=!0)},this.onDocumentPointerDown=t=>{let i=this.context.options.unselectCancel,n=e.getEventTargetViaRoot(t.origEvent);this.matchesCancel=!!e.elementClosest(n,i),this.matchesEvent=!!e.elementClosest(n,w.SELECTOR)},this.onDocumentPointerUp=t=>{let{context:e}=this,{documentPointer:i}=this,n=e.getCurrentData();if(!i.wasTouchScroll){if(n.dateSelection&&!this.isRecentPointerDateSelect){let i=e.options.unselectAuto;!i||i&&this.matchesCancel||e.calendarApi.unselect(t)}n.eventSelection&&!this.matchesEvent&&e.dispatch({type:"UNSELECT_EVENT"})}this.isRecentPointerDateSelect=!1};let i=this.documentPointer=new s(document);i.shouldIgnoreMove=!0,i.shouldWatchScroll=!1,i.emitter.on("pointerdown",this.onDocumentPointerDown),i.emitter.on("pointerup",this.onDocumentPointerUp),t.emitter.on("select",this.onSelect)}destroy(){this.context.emitter.off("select",this.onSelect),this.documentPointer.destroy()}}],elementDraggingImpl:u,optionRefiners:M,listenerRefiners:b});return e.globalPlugins.push(I),t.Draggable=class{constructor(t,i={}){this.handlePointerDown=t=>{let{dragging:i}=this,{minDistance:n,longPressDelay:r}=this.settings;i.minDistance=null!=n?n:t.isTouch?0:e.BASE_OPTION_DEFAULTS.eventDragMinDistance,i.delay=t.isTouch?null!=r?r:e.BASE_OPTION_DEFAULTS.longPressDelay:0},this.handleDragStart=t=>{t.isTouch&&this.dragging.delay&&t.subjectEl.classList.contains("fc-event")&&this.dragging.mirror.getMirrorEl().classList.add("fc-event-selected")},this.settings=i;let n=this.dragging=new u(t);n.touchScrollAllowed=!1,null!=i.itemSelector&&(n.pointer.selector=i.itemSelector),null!=i.appendTo&&(n.mirror.parentNode=i.appendTo),n.emitter.on("pointerdown",this.handlePointerDown),n.emitter.on("dragstart",this.handleDragStart),new C(n,i.eventData)}destroy(){this.dragging.destroy()}},t.FeaturefulElementDragging=u,t.PointerDragging=s,t.ThirdPartyDraggable=class{constructor(t,e){let i=document;t===document||t instanceof Element?(i=t,e=e||{}):e=t||{};let n=this.dragging=new R(i);"string"==typeof e.itemSelector?n.pointer.selector=e.itemSelector:i===document&&(n.pointer.selector="[data-event]"),"string"==typeof e.mirrorSelector&&(n.mirrorSelector=e.mirrorSelector),new C(n,e.eventData)}destroy(){this.dragging.destroy()}},t.default=I,Object.defineProperty(t,"__esModule",{value:!0}),t}({},FullCalendar);
{
"name": "@fullcalendar/interaction",
"version": "5.11.2",
"version": "6.0.0-beta.1",
"title": "FullCalendar Interaction Plugin",

@@ -8,3 +8,3 @@ "description": "Provides functionality for event drag-n-drop, resizing, dateClick, and selectable actions",

"dependencies": {
"@fullcalendar/common": "~5.11.2",
"@fullcalendar/common": "6.0.0-beta.1",
"tslib": "^2.1.0"

@@ -31,4 +31,4 @@ },

"devDependencies": {
"@fullcalendar/core-preact": "5.11.2"
"@fullcalendar/core-preact": "6.0.0-beta.1"
}
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc