mirror of https://github.com/kcal-app/kcal.git
1 line
59 KiB
JavaScript
1 line
59 KiB
JavaScript
(()=>{var t={5458:(t,e,r)=>{"use strict";r.r(e),r.d(e,{BaseEvent:()=>i,BasePlugin:()=>o,Draggable:()=>Ue,Droppable:()=>hr,Plugins:()=>s,Sensors:()=>n,Sortable:()=>Tr,Swappable:()=>Er});var n={};r.r(n),r.d(n,{DragMoveSensorEvent:()=>g,DragPressureSensorEvent:()=>p,DragSensor:()=>B,DragStartSensorEvent:()=>u,DragStopSensorEvent:()=>m,ForceTouchSensor:()=>V,MouseSensor:()=>S,Sensor:()=>l,SensorEvent:()=>d,TouchSensor:()=>M});var s={};r.r(s),r.d(s,{Collidable:()=>et,ResizeMirror:()=>Ft,Snappable:()=>$t,SortAnimation:()=>Vt,SwapAnimation:()=>jt,defaultResizeMirrorOptions:()=>Ot,defaultSortAnimationOptions:()=>Wt,defaultSwapAnimationOptions:()=>qt});class i{constructor(t){this._canceled=!1,this.data=t}get type(){return this.constructor.type}get cancelable(){return this.constructor.cancelable}cancel(){this._canceled=!0}canceled(){return this._canceled}clone(t){return new this.constructor({...this.data,...t})}}i.type="event",i.cancelable=!1;class o{constructor(t){this.draggable=t}attach(){throw new Error("Not Implemented")}detach(){throw new Error("Not Implemented")}}const a={mouse:0,drag:0,touch:100};class l{constructor(t=[],e={}){this.containers=[...t],this.options={...e},this.dragging=!1,this.currentContainer=null,this.originalSource=null,this.startEvent=null,this.delay=function(t){const e={};if(void 0===t)return{...a};if("number"==typeof t){for(const r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=t);return e}for(const r in a)Object.prototype.hasOwnProperty.call(a,r)&&(void 0===t[r]?e[r]=a[r]:e[r]=t[r]);return e}(e.delay)}attach(){return this}detach(){return this}addContainer(...t){this.containers=[...this.containers,...t]}removeContainer(...t){this.containers=this.containers.filter((e=>!t.includes(e)))}trigger(t,e){const r=document.createEvent("Event");return r.detail=e,r.initEvent(e.type,!0,!0),t.dispatchEvent(r),this.lastEvent=e,e}}function c(t,e){if(null==t)return null;function r(t){return null!=t&&null!=e&&(function(t){return Boolean("string"==typeof t)}(e)?Element.prototype.matches.call(t,e):function(t){return Boolean(t instanceof NodeList||t instanceof Array)}(e)?[...e].includes(t):function(t){return Boolean(t instanceof Node)}(e)?e===t:!!function(t){return Boolean("function"==typeof t)}(e)&&e(t))}let n=t;do{if(n=n.correspondingUseElement||n.correspondingElement||n,r(n))return n;n=n?.parentNode||null}while(null!=n&&n!==document.body&&n!==document);return null}function h(t,e,r,n){return Math.sqrt((r-t)**2+(n-e)**2)}class d extends i{get originalEvent(){return this.data.originalEvent}get clientX(){return this.data.clientX}get clientY(){return this.data.clientY}get target(){return this.data.target}get container(){return this.data.container}get originalSource(){return this.data.originalSource}get pressure(){return this.data.pressure}}class u extends d{}u.type="drag:start";class g extends d{}g.type="drag:move";class m extends d{}m.type="drag:stop";class p extends d{}p.type="drag:pressure";const v=Symbol("onContextMenuWhileDragging"),f=Symbol("onMouseDown"),b=Symbol("onMouseMove"),y=Symbol("onMouseUp"),E=Symbol("startDrag"),C=Symbol("onDistanceChange");class S extends l{constructor(t=[],e={}){super(t,e),this.mouseDownTimeout=null,this.pageX=null,this.pageY=null,this[v]=this[v].bind(this),this[f]=this[f].bind(this),this[b]=this[b].bind(this),this[y]=this[y].bind(this),this[E]=this[E].bind(this),this[C]=this[C].bind(this)}attach(){document.addEventListener("mousedown",this[f],!0)}detach(){document.removeEventListener("mousedown",this[f],!0)}[f](t){if(0!==t.button||t.ctrlKey||t.metaKey)return;const e=c(t.target,this.containers);if(!e)return;if(this.options.handle&&t.target&&!c(t.target,this.options.handle))return;const r=c(t.target,this.options.draggable);if(!r)return;const{delay:n}=this,{pageX:s,pageY:i}=t;Object.assign(this,{pageX:s,pageY:i}),this.onMouseDownAt=Date.now(),this.startEvent=t,this.currentContainer=e,this.originalSource=r,document.addEventListener("mouseup",this[y]),document.addEventListener("dragstart",w),document.addEventListener("mousemove",this[C]),this.mouseDownTimeout=window.setTimeout((()=>{this[C]({pageX:this.pageX,pageY:this.pageY})}),n.mouse)}[E](){const t=this.startEvent,e=this.currentContainer,r=this.originalSource,n=new u({clientX:t.clientX,clientY:t.clientY,target:t.target,container:e,originalSource:r,originalEvent:t});this.trigger(this.currentContainer,n),this.dragging=!n.canceled(),this.dragging&&(document.addEventListener("contextmenu",this[v],!0),document.addEventListener("mousemove",this[b]))}[C](t){const{pageX:e,pageY:r}=t,{distance:n}=this.options,{startEvent:s,delay:i}=this;if(Object.assign(this,{pageX:e,pageY:r}),!this.currentContainer)return;const o=Date.now()-this.onMouseDownAt,a=h(s.pageX,s.pageY,e,r)||0;clearTimeout(this.mouseDownTimeout),o<i.mouse?document.removeEventListener("mousemove",this[C]):a>=n&&(document.removeEventListener("mousemove",this[C]),this[E]())}[b](t){if(!this.dragging)return;const e=document.elementFromPoint(t.clientX,t.clientY),r=new g({clientX:t.clientX,clientY:t.clientY,target:e,container:this.currentContainer,originalEvent:t});this.trigger(this.currentContainer,r)}[y](t){if(clearTimeout(this.mouseDownTimeout),0!==t.button)return;if(document.removeEventListener("mouseup",this[y]),document.removeEventListener("dragstart",w),document.removeEventListener("mousemove",this[C]),!this.dragging)return;const e=document.elementFromPoint(t.clientX,t.clientY),r=new m({clientX:t.clientX,clientY:t.clientY,target:e,container:this.currentContainer,originalEvent:t});this.trigger(this.currentContainer,r),document.removeEventListener("contextmenu",this[v],!0),document.removeEventListener("mousemove",this[b]),this.currentContainer=null,this.dragging=!1,this.startEvent=null}[v](t){t.preventDefault()}}function w(t){t.preventDefault()}function x(t){const{touches:e,changedTouches:r}=t;return e&&e[0]||r&&r[0]}const D=Symbol("onTouchStart"),L=Symbol("onTouchEnd"),O=Symbol("onTouchMove"),F=Symbol("startDrag"),X=Symbol("onDistanceChange");let Y=!1;window.addEventListener("touchmove",(t=>{Y&&t.preventDefault()}),{passive:!1});class M extends l{constructor(t=[],e={}){super(t,e),this.currentScrollableParent=null,this.tapTimeout=null,this.touchMoved=!1,this.pageX=null,this.pageY=null,this[D]=this[D].bind(this),this[L]=this[L].bind(this),this[O]=this[O].bind(this),this[F]=this[F].bind(this),this[X]=this[X].bind(this)}attach(){document.addEventListener("touchstart",this[D])}detach(){document.removeEventListener("touchstart",this[D])}[D](t){const e=c(t.target,this.containers);if(!e)return;if(this.options.handle&&t.target&&!c(t.target,this.options.handle))return;const r=c(t.target,this.options.draggable);if(!r)return;const{distance:n=0}=this.options,{delay:s}=this,{pageX:i,pageY:o}=x(t);Object.assign(this,{pageX:i,pageY:o}),this.onTouchStartAt=Date.now(),this.startEvent=t,this.currentContainer=e,this.originalSource=r,document.addEventListener("touchend",this[L]),document.addEventListener("touchcancel",this[L]),document.addEventListener("touchmove",this[X]),e.addEventListener("contextmenu",T),n&&(Y=!0),this.tapTimeout=window.setTimeout((()=>{this[X]({touches:[{pageX:this.pageX,pageY:this.pageY}]})}),s.touch)}[F](){const t=this.startEvent,e=this.currentContainer,r=x(t),n=this.originalSource,s=new u({clientX:r.pageX,clientY:r.pageY,target:t.target,container:e,originalSource:n,originalEvent:t});this.trigger(this.currentContainer,s),this.dragging=!s.canceled(),this.dragging&&document.addEventListener("touchmove",this[O]),Y=this.dragging}[X](t){const{distance:e}=this.options,{startEvent:r,delay:n}=this,s=x(r),i=x(t),o=Date.now()-this.onTouchStartAt,a=h(s.pageX,s.pageY,i.pageX,i.pageY);Object.assign(this,i),clearTimeout(this.tapTimeout),o<n.touch?document.removeEventListener("touchmove",this[X]):a>=e&&(document.removeEventListener("touchmove",this[X]),this[F]())}[O](t){if(!this.dragging)return;const{pageX:e,pageY:r}=x(t),n=document.elementFromPoint(e-window.scrollX,r-window.scrollY),s=new g({clientX:e,clientY:r,target:n,container:this.currentContainer,originalEvent:t});this.trigger(this.currentContainer,s)}[L](t){if(clearTimeout(this.tapTimeout),Y=!1,document.removeEventListener("touchend",this[L]),document.removeEventListener("touchcancel",this[L]),document.removeEventListener("touchmove",this[X]),this.currentContainer&&this.currentContainer.removeEventListener("contextmenu",T),!this.dragging)return;document.removeEventListener("touchmove",this[O]);const{pageX:e,pageY:r}=x(t),n=document.elementFromPoint(e-window.scrollX,r-window.scrollY);t.preventDefault();const s=new m({clientX:e,clientY:r,target:n,container:this.currentContainer,originalEvent:t});this.trigger(this.currentContainer,s),this.currentContainer=null,this.dragging=!1,this.startEvent=null}}function T(t){t.preventDefault(),t.stopPropagation()}const A=Symbol("onMouseDown"),N=Symbol("onMouseUp"),z=Symbol("onDragStart"),P=Symbol("onDragOver"),I=Symbol("onDragEnd"),$=Symbol("onDrop"),k=Symbol("reset");class B extends l{constructor(t=[],e={}){super(t,e),this.mouseDownTimeout=null,this.draggableElement=null,this.nativeDraggableElement=null,this[A]=this[A].bind(this),this[N]=this[N].bind(this),this[z]=this[z].bind(this),this[P]=this[P].bind(this),this[I]=this[I].bind(this),this[$]=this[$].bind(this)}attach(){document.addEventListener("mousedown",this[A],!0)}detach(){document.removeEventListener("mousedown",this[A],!0)}[z](t){t.dataTransfer.setData("text",""),t.dataTransfer.effectAllowed=this.options.type;const e=document.elementFromPoint(t.clientX,t.clientY),r=this.draggableElement;if(!r)return;const n=new u({clientX:t.clientX,clientY:t.clientY,target:e,originalSource:r,container:this.currentContainer,originalEvent:t});setTimeout((()=>{this.trigger(this.currentContainer,n),n.canceled()?this.dragging=!1:this.dragging=!0}),0)}[P](t){if(!this.dragging)return;const e=document.elementFromPoint(t.clientX,t.clientY),r=this.currentContainer,n=new g({clientX:t.clientX,clientY:t.clientY,target:e,container:r,originalEvent:t});this.trigger(r,n),n.canceled()||(t.preventDefault(),t.dataTransfer.dropEffect=this.options.type)}[I](t){if(!this.dragging)return;document.removeEventListener("mouseup",this[N],!0);const e=document.elementFromPoint(t.clientX,t.clientY),r=this.currentContainer,n=new m({clientX:t.clientX,clientY:t.clientY,target:e,container:r,originalEvent:t});this.trigger(r,n),this.dragging=!1,this.startEvent=null,this[k]()}[$](t){t.preventDefault()}[A](t){if(t.target&&(t.target.form||t.target.contenteditable))return;const e=t.target;if(this.currentContainer=c(e,this.containers),!this.currentContainer)return;if(this.options.handle&&e&&!c(e,this.options.handle))return;const r=c(e,this.options.draggable);if(!r)return;const n=c(t.target,(t=>t.draggable));n&&(n.draggable=!1,this.nativeDraggableElement=n),document.addEventListener("mouseup",this[N],!0),document.addEventListener("dragstart",this[z],!1),document.addEventListener("dragover",this[P],!1),document.addEventListener("dragend",this[I],!1),document.addEventListener("drop",this[$],!1),this.startEvent=t,this.mouseDownTimeout=setTimeout((()=>{r.draggable=!0,this.draggableElement=r}),this.delay.drag)}[N](){this[k]()}[k](){clearTimeout(this.mouseDownTimeout),document.removeEventListener("mouseup",this[N],!0),document.removeEventListener("dragstart",this[z],!1),document.removeEventListener("dragover",this[P],!1),document.removeEventListener("dragend",this[I],!1),document.removeEventListener("drop",this[$],!1),this.nativeDraggableElement&&(this.nativeDraggableElement.draggable=!0,this.nativeDraggableElement=null),this.draggableElement&&(this.draggableElement.draggable=!1,this.draggableElement=null)}}const q=Symbol("onMouseForceWillBegin"),j=Symbol("onMouseForceDown"),H=Symbol("onMouseDown"),R=Symbol("onMouseForceChange"),_=Symbol("onMouseMove"),U=Symbol("onMouseUp"),W=Symbol("onMouseForceGlobalChange");class V extends l{constructor(t=[],e={}){super(t,e),this.mightDrag=!1,this[q]=this[q].bind(this),this[j]=this[j].bind(this),this[H]=this[H].bind(this),this[R]=this[R].bind(this),this[_]=this[_].bind(this),this[U]=this[U].bind(this)}attach(){for(const t of this.containers)t.addEventListener("webkitmouseforcewillbegin",this[q],!1),t.addEventListener("webkitmouseforcedown",this[j],!1),t.addEventListener("mousedown",this[H],!0),t.addEventListener("webkitmouseforcechanged",this[R],!1);document.addEventListener("mousemove",this[_]),document.addEventListener("mouseup",this[U])}detach(){for(const t of this.containers)t.removeEventListener("webkitmouseforcewillbegin",this[q],!1),t.removeEventListener("webkitmouseforcedown",this[j],!1),t.removeEventListener("mousedown",this[H],!0),t.removeEventListener("webkitmouseforcechanged",this[R],!1);document.removeEventListener("mousemove",this[_]),document.removeEventListener("mouseup",this[U])}[q](t){t.preventDefault(),this.mightDrag=!0}[j](t){if(this.dragging)return;const e=document.elementFromPoint(t.clientX,t.clientY),r=t.currentTarget;if(this.options.handle&&e&&!c(e,this.options.handle))return;const n=c(e,this.options.draggable);if(!n)return;const s=new u({clientX:t.clientX,clientY:t.clientY,target:e,container:r,originalSource:n,originalEvent:t});this.trigger(r,s),this.currentContainer=r,this.dragging=!s.canceled(),this.mightDrag=!1}[U](t){if(!this.dragging)return;const e=new m({clientX:t.clientX,clientY:t.clientY,target:null,container:this.currentContainer,originalEvent:t});this.trigger(this.currentContainer,e),this.currentContainer=null,this.dragging=!1,this.mightDrag=!1}[H](t){this.mightDrag&&(t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault())}[_](t){if(!this.dragging)return;const e=document.elementFromPoint(t.clientX,t.clientY),r=new g({clientX:t.clientX,clientY:t.clientY,target:e,container:this.currentContainer,originalEvent:t});this.trigger(this.currentContainer,r)}[R](t){if(this.dragging)return;const e=t.target,r=t.currentTarget,n=new p({pressure:t.webkitForce,clientX:t.clientX,clientY:t.clientY,target:e,container:r,originalEvent:t});this.trigger(r,n)}[W](t){if(!this.dragging)return;const e=t.target,r=new p({pressure:t.webkitForce,clientX:t.clientX,clientY:t.clientY,target:e,container:this.currentContainer,originalEvent:t});this.trigger(this.currentContainer,r)}}class G extends i{constructor(t){super(t),this.data=t}get dragEvent(){return this.data.dragEvent}}G.type="collidable";class K extends G{get collidingElement(){return this.data.collidingElement}}K.type="collidable:in";class Z extends G{get collidingElement(){return this.data.collidingElement}}Z.type="collidable:out";const J=Symbol("onDragMove"),Q=Symbol("onDragStop"),tt=Symbol("onRequestAnimationFrame");class et extends o{constructor(t){super(t),this.currentlyCollidingElement=null,this.lastCollidingElement=null,this.currentAnimationFrame=null,this[J]=this[J].bind(this),this[Q]=this[Q].bind(this),this[tt]=this[tt].bind(this)}attach(){this.draggable.on("drag:move",this[J]).on("drag:stop",this[Q])}detach(){this.draggable.off("drag:move",this[J]).off("drag:stop",this[Q])}getCollidables(){const t=this.draggable.options.collidables;return"string"==typeof t?Array.prototype.slice.call(document.querySelectorAll(t)):t instanceof NodeList||t instanceof Array?Array.prototype.slice.call(t):t instanceof HTMLElement?[t]:"function"==typeof t?t():[]}[J](t){const e=t.sensorEvent.target;this.currentAnimationFrame=requestAnimationFrame(this[tt](e)),this.currentlyCollidingElement&&t.cancel();const r=new K({dragEvent:t,collidingElement:this.currentlyCollidingElement}),n=new Z({dragEvent:t,collidingElement:this.lastCollidingElement}),s=Boolean(this.currentlyCollidingElement&&this.lastCollidingElement!==this.currentlyCollidingElement),i=Boolean(!this.currentlyCollidingElement&&this.lastCollidingElement);s?(this.lastCollidingElement&&this.draggable.trigger(n),this.draggable.trigger(r)):i&&this.draggable.trigger(n),this.lastCollidingElement=this.currentlyCollidingElement}[Q](t){const e=this.currentlyCollidingElement||this.lastCollidingElement,r=new Z({dragEvent:t,collidingElement:e});e&&this.draggable.trigger(r),this.lastCollidingElement=null,this.currentlyCollidingElement=null}[tt](t){return()=>{const e=this.getCollidables();this.currentlyCollidingElement=c(t,(t=>e.includes(t)))}}}function rt(t,e){return function(r){(function(t,e){if(t.v)throw new Error("attempted to call "+e+" after decoration was finished")})(e,"addInitializer"),it(r,"An initializer"),t.push(r)}}function nt(t,e){if(!t(e))throw new TypeError("Attempted to access private element on non-instance")}function st(t,e,r,n,s,i,o,a,l,c,h){var d;switch(i){case 1:d="accessor";break;case 2:d="method";break;case 3:d="getter";break;case 4:d="setter";break;default:d="field"}var u,g,m={kind:d,name:a?"#"+r:r,static:o,private:a,metadata:h},p={v:!1};if(0!==i&&(m.addInitializer=rt(s,p)),a||0!==i&&2!==i)if(2===i)u=function(t){return nt(c,t),n.value};else{var v=0===i||1===i;(v||3===i)&&(u=a?function(t){return nt(c,t),n.get.call(t)}:function(t){return n.get.call(t)}),(v||4===i)&&(g=a?function(t,e){nt(c,t),n.set.call(t,e)}:function(t,e){n.set.call(t,e)})}else u=function(t){return t[r]},0===i&&(g=function(t,e){t[r]=e});var f=a?c.bind():function(t){return r in t};m.access=u&&g?{get:u,set:g,has:f}:u?{get:u,has:f}:{set:g,has:f};try{return t.call(e,l,m)}finally{p.v=!0}}function it(t,e){if("function"!=typeof t)throw new TypeError(e+" must be a function")}function ot(t,e){var r=typeof e;if(1===t){if("object"!==r||null===e)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");void 0!==e.get&&it(e.get,"accessor.get"),void 0!==e.set&&it(e.set,"accessor.set"),void 0!==e.init&&it(e.init,"accessor.init")}else if("function"!==r){throw new TypeError((0===t?"field":5===t?"class":"method")+" decorators must return a function or void 0")}}function at(t){return function(){return t(this)}}function lt(t){return function(e){t(this,e)}}function ct(t,e,r,n,s,i,o,a,l,c,h){var d,u,g,m,p,v,f=r[0];n||Array.isArray(f)||(f=[f]),a?d=0===i||1===i?{get:at(r[3]),set:lt(r[4])}:3===i?{get:r[3]}:4===i?{set:r[3]}:{value:r[3]}:0!==i&&(d=Object.getOwnPropertyDescriptor(e,s)),1===i?g={get:d.get,set:d.set}:2===i?g=d.value:3===i?g=d.get:4===i&&(g=d.set);for(var b=n?2:1,y=f.length-1;y>=0;y-=b){var E;void 0!==(m=st(f[y],n?f[y-1]:void 0,s,d,l,i,o,a,g,c,h))&&(ot(i,m),0===i?E=m:1===i?(E=m.init,p=m.get||g.get,v=m.set||g.set,g={get:p,set:v}):g=m,void 0!==E&&(void 0===u?u=E:"function"==typeof u?u=[u,E]:u.push(E)))}if(0===i||1===i){if(void 0===u)u=function(t,e){return e};else if("function"!=typeof u){var C=u;u=function(t,e){for(var r=e,n=C.length-1;n>=0;n--)r=C[n].call(t,r);return r}}else{var S=u;u=function(t,e){return S.call(t,e)}}t.push(u)}0!==i&&(1===i?(d.get=g.get,d.set=g.set):2===i?d.value=g:3===i?d.get=g:4===i&&(d.set=g),a?1===i?(t.push((function(t,e){return g.get.call(t,e)})),t.push((function(t,e){return g.set.call(t,e)}))):2===i?t.push(g):t.push((function(t,e){return g.call(t,e)})):Object.defineProperty(e,s,d))}function ht(t,e){e&&t.push((function(t){for(var r=0;r<e.length;r++)e[r].call(t);return t}))}function dt(t,e){return Object.defineProperty(t,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:e})}function ut(t,e,r,n,s,i){if(arguments.length>=6)var o=i[Symbol.metadata||Symbol.for("Symbol.metadata")];var a=Object.create(void 0===o?null:o),l=function(t,e,r,n){for(var s,i,o,a=[],l=new Map,c=new Map,h=0;h<e.length;h++){var d=e[h];if(Array.isArray(d)){var u,g,m=d[1],p=d[2],v=d.length>3,f=16&m,b=!!(8&m),y=r;if(m&=7,b?(u=t,0!==m&&(g=i=i||[]),v&&!o&&(o=function(e){return gt(e)===t}),y=o):(u=t.prototype,0!==m&&(g=s=s||[])),0!==m&&!v){var E=b?c:l,C=E.get(p)||0;if(!0===C||3===C&&4!==m||4===C&&3!==m)throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+p);E.set(p,!(!C&&m>2)||m)}ct(a,u,d,f,p,m,b,v,g,y,n)}}return ht(a,s),ht(a,i),a}(t,e,s,a);return r.length||dt(t,a),{e:l,get c(){return function(t,e,r,n){if(e.length){for(var s=[],i=t,o=t.name,a=r?2:1,l=e.length-1;l>=0;l-=a){var c={v:!1};try{var h=e[l].call(r?e[l-1]:void 0,i,{kind:"class",name:o,addInitializer:rt(s,c),metadata:n})}finally{c.v=!0}void 0!==h&&(ot(5,h),i=h)}return[dt(i,n),function(){for(var t=0;t<s.length;t++)s[t].call(i)}]}}(t,r,n,a)}}}function gt(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(null!==t?typeof t:"null"));return t}function mt(t,{name:e,addInitializer:r}){r((function(){this[e]=t.bind(this)}))}class pt extends i{constructor(t){super(t),this.data=t}get source(){return this.data.source}get originalSource(){return this.data.originalSource}get mirror(){return this.data.mirror}get sourceContainer(){return this.data.sourceContainer}get sensorEvent(){return this.data.sensorEvent}get originalEvent(){return this.sensorEvent?this.sensorEvent.originalEvent:null}}pt.type="drag";class vt extends pt{}vt.type="drag:start",vt.cancelable=!0;class ft extends pt{}ft.type="drag:move";class bt extends pt{get overContainer(){return this.data.overContainer}get over(){return this.data.over}}bt.type="drag:over",bt.cancelable=!0;class yt extends pt{get overContainer(){return this.data.overContainer}get over(){return this.data.over}}yt.type="drag:out";class Et extends pt{get overContainer(){return this.data.overContainer}}Et.type="drag:over:container";class Ct extends pt{get overContainer(){return this.data.overContainer}}Ct.type="drag:out:container";class St extends pt{get pressure(){return this.data.pressure}}St.type="drag:pressure";class wt extends pt{}wt.type="drag:stop",wt.cancelable=!0;class xt extends pt{}var Dt,Lt;xt.type="drag:stopped";const Ot={};class Ft extends o{constructor(t){Dt(super(t)),this.lastWidth=0,this.lastHeight=0,this.mirror=null}attach(){this.draggable.on("mirror:created",this.onMirrorCreated).on("drag:over",this.onDragOver).on("drag:over:container",this.onDragOver)}detach(){this.draggable.off("mirror:created",this.onMirrorCreated).off("mirror:destroy",this.onMirrorDestroy).off("drag:over",this.onDragOver).off("drag:over:container",this.onDragOver)}getOptions(){return this.draggable.options.resizeMirror||{}}onMirrorCreated({mirror:t}){this.mirror=t}onMirrorDestroy(){this.mirror=null}onDragOver(t){this.resize(t)}resize(t){requestAnimationFrame((()=>{let e=null;const{overContainer:r}=t;if(null==this.mirror||null==this.mirror.parentNode)return;this.mirror.parentNode!==r&&r.appendChild(this.mirror),t.type===bt.type&&(e=t.over);const n=e||this.draggable.getDraggableElementsForContainer(r)[0];var s;n&&(s=()=>{const t=n.getBoundingClientRect();null==this.mirror||this.lastHeight===t.height&&this.lastWidth===t.width||(this.mirror.style.width=`${t.width}px`,this.mirror.style.height=`${t.height}px`,this.lastWidth=t.width,this.lastHeight=t.height)},requestAnimationFrame((()=>{requestAnimationFrame(s)})))}))}}Lt=Ft,[Dt]=ut(Lt,[[mt,2,"onMirrorCreated"],[mt,2,"onMirrorDestroy"],[mt,2,"onDragOver"]],[],0,void 0,o).e;class Xt extends i{get dragEvent(){return this.data.dragEvent}get snappable(){return this.data.snappable}}Xt.type="snap";class Yt extends Xt{}Yt.type="snap:in",Yt.cancelable=!0;class Mt extends Xt{}Mt.type="snap:out",Mt.cancelable=!0;const Tt=Symbol("onDragStart"),At=Symbol("onDragStop"),Nt=Symbol("onDragOver"),zt=Symbol("onDragOut"),Pt=Symbol("onMirrorCreated"),It=Symbol("onMirrorDestroy");class $t extends o{constructor(t){super(t),this.firstSource=null,this.mirror=null,this[Tt]=this[Tt].bind(this),this[At]=this[At].bind(this),this[Nt]=this[Nt].bind(this),this[zt]=this[zt].bind(this),this[Pt]=this[Pt].bind(this),this[It]=this[It].bind(this)}attach(){this.draggable.on("drag:start",this[Tt]).on("drag:stop",this[At]).on("drag:over",this[Nt]).on("drag:out",this[zt]).on("droppable:over",this[Nt]).on("droppable:out",this[zt]).on("mirror:created",this[Pt]).on("mirror:destroy",this[It])}detach(){this.draggable.off("drag:start",this[Tt]).off("drag:stop",this[At]).off("drag:over",this[Nt]).off("drag:out",this[zt]).off("droppable:over",this[Nt]).off("droppable:out",this[zt]).off("mirror:created",this[Pt]).off("mirror:destroy",this[It])}[Tt](t){t.canceled()||(this.firstSource=t.source)}[At](){this.firstSource=null}[Nt](t){if(t.canceled())return;const e=t.source||t.dragEvent.source;if(e===this.firstSource)return void(this.firstSource=null);const r=new Yt({dragEvent:t,snappable:t.over||t.droppable});this.draggable.trigger(r),r.canceled()||(this.mirror&&(this.mirror.style.display="none"),e.classList.remove(...this.draggable.getClassNamesFor("source:dragging")),e.classList.add(...this.draggable.getClassNamesFor("source:placed")),setTimeout((()=>{e.classList.remove(...this.draggable.getClassNamesFor("source:placed"))}),this.draggable.options.placedTimeout))}[zt](t){if(t.canceled())return;const e=t.source||t.dragEvent.source,r=new Mt({dragEvent:t,snappable:t.over||t.droppable});this.draggable.trigger(r),r.canceled()||(this.mirror&&(this.mirror.style.display=""),e.classList.add(...this.draggable.getClassNamesFor("source:dragging")))}[Pt]({mirror:t}){this.mirror=t}[It](){this.mirror=null}}var kt,Bt;const qt={duration:150,easingFunction:"ease-in-out",horizontal:!1};class jt extends o{constructor(t){kt(super(t)),this.options={...qt,...this.getOptions()},this.lastAnimationFrame=null}attach(){this.draggable.on("sortable:sorted",this.onSortableSorted)}detach(){this.draggable.off("sortable:sorted",this.onSortableSorted)}getOptions(){return this.draggable.options.swapAnimation||{}}onSortableSorted({oldIndex:t,newIndex:e,dragEvent:r}){const{source:n,over:s}=r;this.lastAnimationFrame&&cancelAnimationFrame(this.lastAnimationFrame),this.lastAnimationFrame=requestAnimationFrame((()=>{t>=e?Ht(n,s,this.options):Ht(s,n,this.options)}))}}function Ht(t,e,{duration:r,easingFunction:n,horizontal:s}){for(const r of[t,e])r.style.pointerEvents="none";if(s){const r=t.offsetWidth;t.style.transform=`translate3d(${r}px, 0, 0)`,e.style.transform=`translate3d(-${r}px, 0, 0)`}else{const r=t.offsetHeight;t.style.transform=`translate3d(0, ${r}px, 0)`,e.style.transform=`translate3d(0, -${r}px, 0)`}requestAnimationFrame((()=>{for(const s of[t,e])s.addEventListener("transitionend",Rt),s.style.transition=`transform ${r}ms ${n}`,s.style.transform=""}))}function Rt(t){var e;null!=t.target&&(e=t.target,Boolean("style"in e))&&(t.target.style.transition="",t.target.style.pointerEvents="",t.target.removeEventListener("transitionend",Rt))}Bt=jt,[kt]=ut(Bt,[[mt,2,"onSortableSorted"]],[],0,void 0,o).e;const _t=Symbol("onSortableSorted"),Ut=Symbol("onSortableSort"),Wt={duration:150,easingFunction:"ease-in-out"};class Vt extends o{constructor(t){super(t),this.options={...Wt,...this.getOptions()},this.lastAnimationFrame=null,this.lastElements=[],this[_t]=this[_t].bind(this),this[Ut]=this[Ut].bind(this)}attach(){this.draggable.on("sortable:sort",this[Ut]),this.draggable.on("sortable:sorted",this[_t])}detach(){this.draggable.off("sortable:sort",this[Ut]),this.draggable.off("sortable:sorted",this[_t])}getOptions(){return this.draggable.options.sortAnimation||{}}[Ut]({dragEvent:t}){const{sourceContainer:e}=t,r=this.draggable.getDraggableElementsForContainer(e);this.lastElements=Array.from(r).map((t=>({domEl:t,offsetTop:t.offsetTop,offsetLeft:t.offsetLeft})))}[_t]({oldIndex:t,newIndex:e}){if(t===e)return;const r=[];let n,s,i;t>e?(n=e,s=t-1,i=1):(n=t+1,s=e,i=-1);for(let t=n;t<=s;t++){const e=this.lastElements[t],n=this.lastElements[t+i];r.push({from:e,to:n})}cancelAnimationFrame(this.lastAnimationFrame),this.lastAnimationFrame=requestAnimationFrame((()=>{r.forEach((t=>function({from:t,to:e},{duration:r,easingFunction:n}){const s=t.domEl,i=t.offsetLeft-e.offsetLeft,o=t.offsetTop-e.offsetTop;s.style.pointerEvents="none",s.style.transform=`translate3d(${i}px, ${o}px, 0)`,requestAnimationFrame((()=>{s.addEventListener("transitionend",Gt),s.style.transition=`transform ${r}ms ${n}`,s.style.transform=""}))}(t,this.options)))}))}}function Gt(t){t.target.style.transition="",t.target.style.pointerEvents="",t.target.removeEventListener("transitionend",Gt)}const Kt=Symbol("onInitialize"),Zt=Symbol("onDestroy"),Jt=Symbol("announceEvent"),Qt=Symbol("announceMessage"),te={expire:7e3};const ee=function(){const t=document.createElement("div");return t.setAttribute("id","draggable-live-region"),t.setAttribute("aria-relevant","additions"),t.setAttribute("aria-atomic","true"),t.setAttribute("aria-live","assertive"),t.setAttribute("role","log"),t.style.position="fixed",t.style.width="1px",t.style.height="1px",t.style.top="-1px",t.style.overflow="hidden",t}();document.addEventListener("DOMContentLoaded",(()=>{document.body.appendChild(ee)}));const re=Symbol("onInitialize"),ne=Symbol("onDestroy"),se={};const ie=[];class oe extends i{constructor(t){super(t),this.data=t}get source(){return this.data.source}get originalSource(){return this.data.originalSource}get sourceContainer(){return this.data.sourceContainer}get sensorEvent(){return this.data.sensorEvent}get dragEvent(){return this.data.dragEvent}get originalEvent(){return this.sensorEvent?this.sensorEvent.originalEvent:null}}class ae extends oe{}ae.type="mirror:create";class le extends oe{get mirror(){return this.data.mirror}}le.type="mirror:created";class ce extends oe{get mirror(){return this.data.mirror}}ce.type="mirror:attached";class he extends oe{get mirror(){return this.data.mirror}get passedThreshX(){return this.data.passedThreshX}get passedThreshY(){return this.data.passedThreshY}}he.type="mirror:move",he.cancelable=!0;class de extends oe{get mirror(){return this.data.mirror}get passedThreshX(){return this.data.passedThreshX}get passedThreshY(){return this.data.passedThreshY}}de.type="mirror:moved";class ue extends oe{get mirror(){return this.data.mirror}}ue.type="mirror:destroy",ue.cancelable=!0;const ge=Symbol("onDragStart"),me=Symbol("onDragMove"),pe=Symbol("onDragStop"),ve=Symbol("onMirrorCreated"),fe=Symbol("onMirrorMove"),be=Symbol("onScroll"),ye=Symbol("getAppendableContainer"),Ee={constrainDimensions:!1,xAxis:!0,yAxis:!0,cursorOffsetX:null,cursorOffsetY:null,thresholdX:null,thresholdY:null};function Ce({source:t,...e}){return Oe((r=>{const n=t.getBoundingClientRect();r({source:t,sourceRect:n,...e})}))}function Se({sensorEvent:t,sourceRect:e,options:r,...n}){return Oe((s=>{const i=null===r.cursorOffsetY?t.clientY-e.top:r.cursorOffsetY,o=null===r.cursorOffsetX?t.clientX-e.left:r.cursorOffsetX;s({sensorEvent:t,sourceRect:e,mirrorOffset:{top:i,left:o},options:r,...n})}))}function we({mirror:t,source:e,options:r,...n}){return Oe((s=>{let i,o;if(r.constrainDimensions){const t=getComputedStyle(e);i=t.getPropertyValue("height"),o=t.getPropertyValue("width")}t.style.display=null,t.style.position="fixed",t.style.pointerEvents="none",t.style.top=0,t.style.left=0,t.style.margin=0,r.constrainDimensions&&(t.style.height=i,t.style.width=o),s({mirror:t,source:e,options:r,...n})}))}function xe({mirror:t,mirrorClasses:e,...r}){return Oe((n=>{t.classList.add(...e),n({mirror:t,mirrorClasses:e,...r})}))}function De({mirror:t,...e}){return Oe((r=>{t.removeAttribute("id"),delete t.id,r({mirror:t,...e})}))}function Le({withFrame:t=!1,initial:e=!1}={}){return({mirror:r,sensorEvent:n,mirrorOffset:s,initialY:i,initialX:o,scrollOffset:a,options:l,passedThreshX:c,passedThreshY:h,lastMovedX:d,lastMovedY:u,...g})=>Oe((t=>{const m={mirror:r,sensorEvent:n,mirrorOffset:s,options:l,...g};if(s){const t=c?Math.round((n.clientX-s.left-a.x)/(l.thresholdX||1))*(l.thresholdX||1):Math.round(d),g=h?Math.round((n.clientY-s.top-a.y)/(l.thresholdY||1))*(l.thresholdY||1):Math.round(u);l.xAxis&&l.yAxis||e?r.style.transform=`translate3d(${t}px, ${g}px, 0)`:l.xAxis&&!l.yAxis?r.style.transform=`translate3d(${t}px, ${i}px, 0)`:l.yAxis&&!l.xAxis&&(r.style.transform=`translate3d(${o}px, ${g}px, 0)`),e&&(m.initialX=t,m.initialY=g),m.lastMovedX=t,m.lastMovedY=g}t(m)}),{frame:t})}function Oe(t,{raf:e=!1}={}){return new Promise(((r,n)=>{e?requestAnimationFrame((()=>{t(r,n)})):t(r,n)}))}const Fe=Symbol("onDragStart"),Xe=Symbol("onDragMove"),Ye=Symbol("onDragStop"),Me=Symbol("scroll"),Te={speed:6,sensitivity:50,scrollableElements:[]};function Ae(){return document.scrollingElement||document.documentElement}class Ne{constructor(){this.callbacks={}}on(t,...e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(...e),this}off(t,e){if(!this.callbacks[t])return null;const r=this.callbacks[t].slice(0);for(let n=0;n<r.length;n++)e===r[n]&&this.callbacks[t].splice(n,1);return this}trigger(t){if(!this.callbacks[t.type])return null;const e=[...this.callbacks[t.type]],r=[];for(let n=e.length-1;n>=0;n--){const s=e[n];try{s(t)}catch(t){r.push(t)}}return r.length&&console.error(`Draggable caught errors while triggering '${t.type}'`,r),this}}class ze extends i{get draggable(){return this.data.draggable}}ze.type="draggable";class Pe extends ze{}Pe.type="draggable:initialize";class Ie extends ze{}Ie.type="draggable:destroy";const $e=Symbol("onDragStart"),ke=Symbol("onDragMove"),Be=Symbol("onDragStop"),qe=Symbol("onDragPressure"),je=Symbol("dragStop"),He={"drag:start":t=>`Picked up ${t.source.textContent.trim()||t.source.id||"draggable element"}`,"drag:stop":t=>`Released ${t.source.textContent.trim()||t.source.id||"draggable element"}`},Re={"container:dragging":"draggable-container--is-dragging","source:dragging":"draggable-source--is-dragging","source:placed":"draggable-source--placed","container:placed":"draggable-container--placed","body:dragging":"draggable--is-dragging","draggable:over":"draggable--over","container:over":"draggable-container--over","source:original":"draggable--original",mirror:"draggable-mirror"},_e={draggable:".draggable-source",handle:null,delay:{},distance:0,placedTimeout:800,plugins:[],sensors:[],exclude:{plugins:[],sensors:[]}};class Ue{constructor(t=[document.body],e={}){if(t instanceof NodeList||t instanceof Array)this.containers=[...t];else{if(!(t instanceof HTMLElement))throw new Error("Draggable containers are expected to be of type `NodeList`, `HTMLElement[]` or `HTMLElement`");this.containers=[t]}this.options={..._e,...e,classes:{...Re,...e.classes||{}},announcements:{...He,...e.announcements||{}},exclude:{plugins:e.exclude&&e.exclude.plugins||[],sensors:e.exclude&&e.exclude.sensors||[]}},this.emitter=new Ne,this.dragging=!1,this.plugins=[],this.sensors=[],this[$e]=this[$e].bind(this),this[ke]=this[ke].bind(this),this[Be]=this[Be].bind(this),this[qe]=this[qe].bind(this),this[je]=this[je].bind(this),document.addEventListener("drag:start",this[$e],!0),document.addEventListener("drag:move",this[ke],!0),document.addEventListener("drag:stop",this[Be],!0),document.addEventListener("drag:pressure",this[qe],!0);const r=Object.values(Ue.Plugins).filter((t=>!this.options.exclude.plugins.includes(t))),n=Object.values(Ue.Sensors).filter((t=>!this.options.exclude.sensors.includes(t)));this.addPlugin(...r,...this.options.plugins),this.addSensor(...n,...this.options.sensors);const s=new Pe({draggable:this});this.on("mirror:created",(({mirror:t})=>this.mirror=t)),this.on("mirror:destroy",(()=>this.mirror=null)),this.trigger(s)}destroy(){document.removeEventListener("drag:start",this[$e],!0),document.removeEventListener("drag:move",this[ke],!0),document.removeEventListener("drag:stop",this[Be],!0),document.removeEventListener("drag:pressure",this[qe],!0);const t=new Ie({draggable:this});this.trigger(t),this.removePlugin(...this.plugins.map((t=>t.constructor))),this.removeSensor(...this.sensors.map((t=>t.constructor)))}addPlugin(...t){const e=t.map((t=>new t(this)));return e.forEach((t=>t.attach())),this.plugins=[...this.plugins,...e],this}removePlugin(...t){return this.plugins.filter((e=>t.includes(e.constructor))).forEach((t=>t.detach())),this.plugins=this.plugins.filter((e=>!t.includes(e.constructor))),this}addSensor(...t){const e=t.map((t=>new t(this.containers,this.options)));return e.forEach((t=>t.attach())),this.sensors=[...this.sensors,...e],this}removeSensor(...t){return this.sensors.filter((e=>t.includes(e.constructor))).forEach((t=>t.detach())),this.sensors=this.sensors.filter((e=>!t.includes(e.constructor))),this}addContainer(...t){return this.containers=[...this.containers,...t],this.sensors.forEach((e=>e.addContainer(...t))),this}removeContainer(...t){return this.containers=this.containers.filter((e=>!t.includes(e))),this.sensors.forEach((e=>e.removeContainer(...t))),this}on(t,...e){return this.emitter.on(t,...e),this}off(t,e){return this.emitter.off(t,e),this}trigger(t){return this.emitter.trigger(t),this}getClassNameFor(t){return this.getClassNamesFor(t)[0]}getClassNamesFor(t){const e=this.options.classes[t];return e instanceof Array?e:"string"==typeof e||e instanceof String?[e]:[]}isDragging(){return Boolean(this.dragging)}getDraggableElements(){return this.containers.reduce(((t,e)=>[...t,...this.getDraggableElementsForContainer(e)]),[])}getDraggableElementsForContainer(t){return[...t.querySelectorAll(this.options.draggable)].filter((t=>t!==this.originalSource&&t!==this.mirror))}cancel(){this[je]()}[$e](t){const e=We(t),{target:r,container:n,originalSource:s}=e;if(!this.containers.includes(n))return;if(this.options.handle&&r&&!c(r,this.options.handle))return void e.cancel();this.originalSource=s,this.sourceContainer=n,this.lastPlacedSource&&this.lastPlacedContainer&&(clearTimeout(this.placedTimeoutID),this.lastPlacedSource.classList.remove(...this.getClassNamesFor("source:placed")),this.lastPlacedContainer.classList.remove(...this.getClassNamesFor("container:placed"))),this.source=this.originalSource.cloneNode(!0),this.originalSource.parentNode.insertBefore(this.source,this.originalSource),this.originalSource.style.display="none";const i=new vt({source:this.source,originalSource:this.originalSource,sourceContainer:n,sensorEvent:e});if(this.trigger(i),this.dragging=!i.canceled(),i.canceled())return this.source.remove(),void(this.originalSource.style.display=null);this.originalSource.classList.add(...this.getClassNamesFor("source:original")),this.source.classList.add(...this.getClassNamesFor("source:dragging")),this.sourceContainer.classList.add(...this.getClassNamesFor("container:dragging")),document.body.classList.add(...this.getClassNamesFor("body:dragging")),Ve(document.body,"none"),requestAnimationFrame((()=>{const e=We(t).clone({target:this.source});this[ke]({...t,detail:e})}))}[ke](t){if(!this.dragging)return;const e=We(t),{container:r}=e;let n=e.target;const s=new ft({source:this.source,originalSource:this.originalSource,sourceContainer:r,sensorEvent:e});this.trigger(s),s.canceled()&&e.cancel(),n=c(n,this.options.draggable);const i=c(e.target,this.containers),o=e.overContainer||i,a=this.currentOverContainer&&o!==this.currentOverContainer,l=this.currentOver&&n!==this.currentOver,h=o&&this.currentOverContainer!==o,d=i&&n&&this.currentOver!==n;if(l){const t=new yt({source:this.source,originalSource:this.originalSource,sourceContainer:r,sensorEvent:e,over:this.currentOver,overContainer:this.currentOverContainer});this.currentOver.classList.remove(...this.getClassNamesFor("draggable:over")),this.currentOver=null,this.trigger(t)}if(a){const t=new Ct({source:this.source,originalSource:this.originalSource,sourceContainer:r,sensorEvent:e,overContainer:this.currentOverContainer});this.currentOverContainer.classList.remove(...this.getClassNamesFor("container:over")),this.currentOverContainer=null,this.trigger(t)}if(h){o.classList.add(...this.getClassNamesFor("container:over"));const t=new Et({source:this.source,originalSource:this.originalSource,sourceContainer:r,sensorEvent:e,overContainer:o});this.currentOverContainer=o,this.trigger(t)}if(d){n.classList.add(...this.getClassNamesFor("draggable:over"));const t=new bt({source:this.source,originalSource:this.originalSource,sourceContainer:r,sensorEvent:e,overContainer:o,over:n});this.currentOver=n,this.trigger(t)}}[je](t){if(!this.dragging)return;this.dragging=!1;const e=new wt({source:this.source,originalSource:this.originalSource,sensorEvent:t?t.sensorEvent:null,sourceContainer:this.sourceContainer});this.trigger(e),e.canceled()||this.source.parentNode.insertBefore(this.originalSource,this.source),this.source.remove(),this.originalSource.style.display="",this.source.classList.remove(...this.getClassNamesFor("source:dragging")),this.originalSource.classList.remove(...this.getClassNamesFor("source:original")),this.originalSource.classList.add(...this.getClassNamesFor("source:placed")),this.sourceContainer.classList.add(...this.getClassNamesFor("container:placed")),this.sourceContainer.classList.remove(...this.getClassNamesFor("container:dragging")),document.body.classList.remove(...this.getClassNamesFor("body:dragging")),Ve(document.body,""),this.currentOver&&this.currentOver.classList.remove(...this.getClassNamesFor("draggable:over")),this.currentOverContainer&&this.currentOverContainer.classList.remove(...this.getClassNamesFor("container:over")),this.lastPlacedSource=this.originalSource,this.lastPlacedContainer=this.sourceContainer,this.placedTimeoutID=setTimeout((()=>{this.lastPlacedSource&&this.lastPlacedSource.classList.remove(...this.getClassNamesFor("source:placed")),this.lastPlacedContainer&&this.lastPlacedContainer.classList.remove(...this.getClassNamesFor("container:placed")),this.lastPlacedSource=null,this.lastPlacedContainer=null}),this.options.placedTimeout);const r=new xt({source:this.source,originalSource:this.originalSource,sensorEvent:t?t.sensorEvent:null,sourceContainer:this.sourceContainer});this.trigger(r),this.source=null,this.originalSource=null,this.currentOverContainer=null,this.currentOver=null,this.sourceContainer=null}[Be](t){this[je](t)}[qe](t){if(!this.dragging)return;const e=We(t),r=this.source||c(e.originalEvent.target,this.options.draggable),n=new St({sensorEvent:e,source:r,pressure:e.pressure});this.trigger(n)}}function We(t){return t.detail}function Ve(t,e){t.style.webkitUserSelect=e,t.style.mozUserSelect=e,t.style.msUserSelect=e,t.style.oUserSelect=e,t.style.userSelect=e}Ue.Plugins={Announcement:class extends o{constructor(t){super(t),this.options={...te,...this.getOptions()},this.originalTriggerMethod=this.draggable.trigger,this[Kt]=this[Kt].bind(this),this[Zt]=this[Zt].bind(this)}attach(){this.draggable.on("draggable:initialize",this[Kt])}detach(){this.draggable.off("draggable:destroy",this[Zt])}getOptions(){return this.draggable.options.announcements||{}}[Jt](t){const e=this.options[t.type];e&&"string"==typeof e&&this[Qt](e),e&&"function"==typeof e&&this[Qt](e(t))}[Qt](t){!function(t,{expire:e}){const r=document.createElement("div");r.textContent=t,ee.appendChild(r),setTimeout((()=>{ee.removeChild(r)}),e)}(t,{expire:this.options.expire})}[Kt](){this.draggable.trigger=t=>{try{this[Jt](t)}finally{this.originalTriggerMethod.call(this.draggable,t)}}}[Zt](){this.draggable.trigger=this.originalTriggerMethod}},Focusable:class extends o{constructor(t){super(t),this.options={...se,...this.getOptions()},this[re]=this[re].bind(this),this[ne]=this[ne].bind(this)}attach(){this.draggable.on("draggable:initialize",this[re]).on("draggable:destroy",this[ne])}detach(){this.draggable.off("draggable:initialize",this[re]).off("draggable:destroy",this[ne]),this[ne]()}getOptions(){return this.draggable.options.focusable||{}}getElements(){return[...this.draggable.containers,...this.draggable.getDraggableElements()]}[re](){requestAnimationFrame((()=>{this.getElements().forEach((t=>function(t){const e=Boolean(!t.getAttribute("tabindex")&&-1===t.tabIndex);e&&(ie.push(t),t.tabIndex=0)}(t)))}))}[ne](){requestAnimationFrame((()=>{this.getElements().forEach((t=>function(t){const e=ie.indexOf(t);-1!==e&&(t.tabIndex=-1,ie.splice(e,1))}(t)))}))}},Mirror:class extends o{constructor(t){super(t),this.options={...Ee,...this.getOptions()},this.scrollOffset={x:0,y:0},this.initialScrollOffset={x:window.scrollX,y:window.scrollY},this[ge]=this[ge].bind(this),this[me]=this[me].bind(this),this[pe]=this[pe].bind(this),this[ve]=this[ve].bind(this),this[fe]=this[fe].bind(this),this[be]=this[be].bind(this)}attach(){this.draggable.on("drag:start",this[ge]).on("drag:move",this[me]).on("drag:stop",this[pe]).on("mirror:created",this[ve]).on("mirror:move",this[fe])}detach(){this.draggable.off("drag:start",this[ge]).off("drag:move",this[me]).off("drag:stop",this[pe]).off("mirror:created",this[ve]).off("mirror:move",this[fe])}getOptions(){return this.draggable.options.mirror||{}}[ge](t){if(t.canceled())return;"ontouchstart"in window&&document.addEventListener("scroll",this[be],!0),this.initialScrollOffset={x:window.scrollX,y:window.scrollY};const{source:e,originalSource:r,sourceContainer:n,sensorEvent:s}=t;this.lastMirrorMovedClient={x:s.clientX,y:s.clientY};const i=new ae({source:e,originalSource:r,sourceContainer:n,sensorEvent:s,dragEvent:t});if(this.draggable.trigger(i),function(t){return/^drag/.test(t.originalEvent.type)}(s)||i.canceled())return;const o=this[ye](e)||n;this.mirror=e.cloneNode(!0);const a=new le({source:e,originalSource:r,sourceContainer:n,sensorEvent:s,dragEvent:t,mirror:this.mirror}),l=new ce({source:e,originalSource:r,sourceContainer:n,sensorEvent:s,dragEvent:t,mirror:this.mirror});this.draggable.trigger(a),o.appendChild(this.mirror),this.draggable.trigger(l)}[me](t){if(!this.mirror||t.canceled())return;const{source:e,originalSource:r,sourceContainer:n,sensorEvent:s}=t;let i=!0,o=!0;if(this.options.thresholdX||this.options.thresholdY){const{x:t,y:e}=this.lastMirrorMovedClient;if(Math.abs(t-s.clientX)<this.options.thresholdX?i=!1:this.lastMirrorMovedClient.x=s.clientX,Math.abs(e-s.clientY)<this.options.thresholdY?o=!1:this.lastMirrorMovedClient.y=s.clientY,!i&&!o)return}const a=new he({source:e,originalSource:r,sourceContainer:n,sensorEvent:s,dragEvent:t,mirror:this.mirror,passedThreshX:i,passedThreshY:o});this.draggable.trigger(a)}[pe](t){if("ontouchstart"in window&&document.removeEventListener("scroll",this[be],!0),this.initialScrollOffset={x:0,y:0},this.scrollOffset={x:0,y:0},!this.mirror)return;const{source:e,sourceContainer:r,sensorEvent:n}=t,s=new ue({source:e,mirror:this.mirror,sourceContainer:r,sensorEvent:n,dragEvent:t});this.draggable.trigger(s),s.canceled()||this.mirror.remove()}[be](){this.scrollOffset={x:window.scrollX-this.initialScrollOffset.x,y:window.scrollY-this.initialScrollOffset.y}}[ve]({mirror:t,source:e,sensorEvent:r}){const n=this.draggable.getClassNamesFor("mirror");t.style.display="none";const s={mirror:t,source:e,sensorEvent:r,mirrorClasses:n,scrollOffset:this.scrollOffset,options:this.options,passedThreshX:!0,passedThreshY:!0};return Promise.resolve(s).then(Ce).then(Se).then(we).then(xe).then(Le({initial:!0})).then(De).then((({mirrorOffset:t,initialX:e,initialY:r,...n})=>(this.mirrorOffset=t,this.initialX=e,this.initialY=r,this.lastMovedX=e,this.lastMovedY=r,{mirrorOffset:t,initialX:e,initialY:r,...n})))}[fe](t){if(t.canceled())return null;const e={mirror:t.mirror,sensorEvent:t.sensorEvent,mirrorOffset:this.mirrorOffset,options:this.options,initialX:this.initialX,initialY:this.initialY,scrollOffset:this.scrollOffset,passedThreshX:t.passedThreshX,passedThreshY:t.passedThreshY,lastMovedX:this.lastMovedX,lastMovedY:this.lastMovedY};return Promise.resolve(e).then(Le({raf:!0})).then((({lastMovedX:t,lastMovedY:e,...r})=>(this.lastMovedX=t,this.lastMovedY=e,{lastMovedX:t,lastMovedY:e,...r}))).then((e=>{const r=new de({source:t.source,originalSource:t.originalSource,sourceContainer:t.sourceContainer,sensorEvent:t.sensorEvent,dragEvent:t.dragEvent,mirror:this.mirror,passedThreshX:t.passedThreshX,passedThreshY:t.passedThreshY});return this.draggable.trigger(r),e}))}[ye](t){const e=this.options.appendTo;return"string"==typeof e?document.querySelector(e):e instanceof HTMLElement?e:"function"==typeof e?e(t):t.parentNode}},Scrollable:class extends o{constructor(t){super(t),this.options={...Te,...this.getOptions()},this.currentMousePosition=null,this.scrollAnimationFrame=null,this.scrollableElement=null,this.findScrollableElementFrame=null,this[Fe]=this[Fe].bind(this),this[Xe]=this[Xe].bind(this),this[Ye]=this[Ye].bind(this),this[Me]=this[Me].bind(this)}attach(){this.draggable.on("drag:start",this[Fe]).on("drag:move",this[Xe]).on("drag:stop",this[Ye])}detach(){this.draggable.off("drag:start",this[Fe]).off("drag:move",this[Xe]).off("drag:stop",this[Ye])}getOptions(){return this.draggable.options.scrollable||{}}getScrollableElement(t){return this.hasDefinedScrollableElements()?c(t,this.options.scrollableElements)||document.documentElement:function(t){if(!t)return Ae();const e=getComputedStyle(t).getPropertyValue("position"),r="absolute"===e,n=c(t,(t=>(!r||!function(t){const e=getComputedStyle(t).getPropertyValue("position");return"static"===e}(t))&&function(t){const e=/(auto|scroll)/,r=getComputedStyle(t,null),n=r.getPropertyValue("overflow")+r.getPropertyValue("overflow-y")+r.getPropertyValue("overflow-x");return e.test(n)}(t)));return"fixed"!==e&&n?n:Ae()}(t)}hasDefinedScrollableElements(){return Boolean(0!==this.options.scrollableElements.length)}[Fe](t){this.findScrollableElementFrame=requestAnimationFrame((()=>{this.scrollableElement=this.getScrollableElement(t.source)}))}[Xe](t){if(this.findScrollableElementFrame=requestAnimationFrame((()=>{this.scrollableElement=this.getScrollableElement(t.sensorEvent.target)})),!this.scrollableElement)return;const e=t.sensorEvent,r={x:0,y:0};"ontouchstart"in window&&(r.y=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,r.x=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0),this.currentMousePosition={clientX:e.clientX-r.x,clientY:e.clientY-r.y},this.scrollAnimationFrame=requestAnimationFrame(this[Me])}[Ye](){cancelAnimationFrame(this.scrollAnimationFrame),cancelAnimationFrame(this.findScrollableElementFrame),this.scrollableElement=null,this.scrollAnimationFrame=null,this.findScrollableElementFrame=null,this.currentMousePosition=null}[Me](){if(!this.scrollableElement||!this.currentMousePosition)return;cancelAnimationFrame(this.scrollAnimationFrame);const{speed:t,sensitivity:e}=this.options,r=this.scrollableElement.getBoundingClientRect(),n=r.bottom>window.innerHeight,s=r.top<0||n,i=Ae(),o=this.scrollableElement,a=this.currentMousePosition.clientX,l=this.currentMousePosition.clientY;if(o===document.body||o===document.documentElement||s){const{innerHeight:r,innerWidth:n}=window;l<e?i.scrollTop-=t:r-l<e&&(i.scrollTop+=t),a<e?i.scrollLeft-=t:n-a<e&&(i.scrollLeft+=t)}else{const{offsetHeight:n,offsetWidth:s}=o;r.top+n-l<e?o.scrollTop+=t:l-r.top<e&&(o.scrollTop-=t),r.left+s-a<e?o.scrollLeft+=t:a-r.left<e&&(o.scrollLeft-=t)}this.scrollAnimationFrame=requestAnimationFrame(this[Me])}}},Ue.Sensors={MouseSensor:S,TouchSensor:M};class Ge extends i{constructor(t){super(t),this.data=t}get dragEvent(){return this.data.dragEvent}}Ge.type="droppable";class Ke extends Ge{get dropzone(){return this.data.dropzone}}Ke.type="droppable:start",Ke.cancelable=!0;class Ze extends Ge{get dropzone(){return this.data.dropzone}}Ze.type="droppable:dropped",Ze.cancelable=!0;class Je extends Ge{get dropzone(){return this.data.dropzone}}Je.type="droppable:returned",Je.cancelable=!0;class Qe extends Ge{get dropzone(){return this.data.dropzone}}Qe.type="droppable:stop",Qe.cancelable=!0;const tr=Symbol("onDragStart"),er=Symbol("onDragMove"),rr=Symbol("onDragStop"),nr=Symbol("dropInDropZone"),sr=Symbol("returnToOriginalDropzone"),ir=Symbol("closestDropzone"),or=Symbol("getDropzones");const ar={"droppable:dropped":function({dragEvent:t,dropzone:e}){return`Dropped ${t.source.textContent.trim()||t.source.id||"draggable element"} into ${e.textContent.trim()||e.id||"droppable element"}`},"droppable:returned":function({dragEvent:t,dropzone:e}){return`Returned ${t.source.textContent.trim()||t.source.id||"draggable element"} from ${e.textContent.trim()||e.id||"droppable element"}`}},lr={"droppable:active":"draggable-dropzone--active","droppable:occupied":"draggable-dropzone--occupied"},cr={dropzone:".draggable-droppable"};class hr extends Ue{constructor(t=[],e={}){super(t,{...cr,...e,classes:{...lr,...e.classes||{}},announcements:{...ar,...e.announcements||{}}}),this.dropzones=null,this.lastDropzone=null,this.initialDropzone=null,this[tr]=this[tr].bind(this),this[er]=this[er].bind(this),this[rr]=this[rr].bind(this),this.on("drag:start",this[tr]).on("drag:move",this[er]).on("drag:stop",this[rr])}destroy(){super.destroy(),this.off("drag:start",this[tr]).off("drag:move",this[er]).off("drag:stop",this[rr])}[tr](t){if(t.canceled())return;this.dropzones=[...this[or]()];const e=c(t.sensorEvent.target,this.options.dropzone);if(!e)return void t.cancel();const r=new Ke({dragEvent:t,dropzone:e});if(this.trigger(r),r.canceled())t.cancel();else{this.initialDropzone=e;for(const t of this.dropzones)t.classList.contains(this.getClassNameFor("droppable:occupied"))||t.classList.add(...this.getClassNamesFor("droppable:active"))}}[er](t){if(t.canceled())return;const e=this[ir](t.sensorEvent.target);e&&!e.classList.contains(this.getClassNameFor("droppable:occupied"))&&this[nr](t,e)?this.lastDropzone=e:e&&e!==this.initialDropzone||!this.lastDropzone||(this[sr](t),this.lastDropzone=null)}[rr](t){const e=new Qe({dragEvent:t,dropzone:this.lastDropzone||this.initialDropzone});this.trigger(e);const r=this.getClassNamesFor("droppable:occupied");for(const t of this.dropzones)t.classList.remove(...this.getClassNamesFor("droppable:active"));this.lastDropzone&&this.lastDropzone!==this.initialDropzone&&this.initialDropzone.classList.remove(...r),this.dropzones=null,this.lastDropzone=null,this.initialDropzone=null}[nr](t,e){const r=new Ze({dragEvent:t,dropzone:e});if(this.trigger(r),r.canceled())return!1;const n=this.getClassNamesFor("droppable:occupied");return this.lastDropzone&&this.lastDropzone.classList.remove(...n),e.appendChild(t.source),e.classList.add(...n),!0}[sr](t){const e=new Je({dragEvent:t,dropzone:this.lastDropzone});this.trigger(e),e.canceled()||(this.initialDropzone.appendChild(t.source),this.lastDropzone.classList.remove(...this.getClassNamesFor("droppable:occupied")))}[ir](t){return this.dropzones?c(t,this.dropzones):null}[or](){const t=this.options.dropzone;return"string"==typeof t?document.querySelectorAll(t):t instanceof NodeList||t instanceof Array?t:"function"==typeof t?t():[]}}class dr extends i{constructor(t){super(t),this.data=t}get dragEvent(){return this.data.dragEvent}}dr.type="swappable";class ur extends dr{}ur.type="swappable:start",ur.cancelable=!0;class gr extends dr{get over(){return this.data.over}get overContainer(){return this.data.overContainer}}gr.type="swappable:swap",gr.cancelable=!0;class mr extends dr{get swappedElement(){return this.data.swappedElement}}mr.type="swappable:swapped";class pr extends dr{}pr.type="swappable:stop";const vr=Symbol("onDragStart"),fr=Symbol("onDragOver"),br=Symbol("onDragStop");const yr={"swappabled:swapped":function({dragEvent:t,swappedElement:e}){return`Swapped ${t.source.textContent.trim()||t.source.id||"swappable element"} with ${e.textContent.trim()||e.id||"swappable element"}`}};class Er extends Ue{constructor(t=[],e={}){super(t,{...e,announcements:{...yr,...e.announcements||{}}}),this.lastOver=null,this[vr]=this[vr].bind(this),this[fr]=this[fr].bind(this),this[br]=this[br].bind(this),this.on("drag:start",this[vr]).on("drag:over",this[fr]).on("drag:stop",this[br])}destroy(){super.destroy(),this.off("drag:start",this._onDragStart).off("drag:over",this._onDragOver).off("drag:stop",this._onDragStop)}[vr](t){const e=new ur({dragEvent:t});this.trigger(e),e.canceled()&&t.cancel()}[fr](t){if(t.over===t.originalSource||t.over===t.source||t.canceled())return;const e=new gr({dragEvent:t,over:t.over,overContainer:t.overContainer});if(this.trigger(e),e.canceled())return;this.lastOver&&this.lastOver!==t.over&&Cr(this.lastOver,t.source),this.lastOver===t.over?this.lastOver=null:this.lastOver=t.over,Cr(t.source,t.over);const r=new mr({dragEvent:t,swappedElement:t.over});this.trigger(r)}[br](t){const e=new pr({dragEvent:t});this.trigger(e),this.lastOver=null}}function Cr(t,e){const r=e.parentNode,n=t.parentNode;!function(t){const e=document.createElement("div");t(e),e.remove()}((s=>{n.insertBefore(s,t),r.insertBefore(t,e),n.insertBefore(e,s)}))}class Sr extends i{constructor(t){super(t),this.data=t}get dragEvent(){return this.data.dragEvent}}Sr.type="sortable";class wr extends Sr{get startIndex(){return this.data.startIndex}get startContainer(){return this.data.startContainer}}wr.type="sortable:start",wr.cancelable=!0;class xr extends Sr{get currentIndex(){return this.data.currentIndex}get over(){return this.data.over}get overContainer(){return this.data.dragEvent.overContainer}}xr.type="sortable:sort",xr.cancelable=!0;class Dr extends Sr{get oldIndex(){return this.data.oldIndex}get newIndex(){return this.data.newIndex}get oldContainer(){return this.data.oldContainer}get newContainer(){return this.data.newContainer}}Dr.type="sortable:sorted";class Lr extends Sr{get oldIndex(){return this.data.oldIndex}get newIndex(){return this.data.newIndex}get oldContainer(){return this.data.oldContainer}get newContainer(){return this.data.newContainer}}Lr.type="sortable:stop";const Or=Symbol("onDragStart"),Fr=Symbol("onDragOverContainer"),Xr=Symbol("onDragOver"),Yr=Symbol("onDragStop");const Mr={"sortable:sorted":function({dragEvent:t}){const e=t.source.textContent.trim()||t.source.id||"sortable element";if(t.over){const r=t.over.textContent.trim()||t.over.id||"sortable element";return t.source.compareDocumentPosition(t.over)&Node.DOCUMENT_POSITION_FOLLOWING?`Placed ${e} after ${r}`:`Placed ${e} before ${r}`}return`Placed ${e} into a different container`}};class Tr extends Ue{constructor(t=[],e={}){super(t,{...e,announcements:{...Mr,...e.announcements||{}}}),this.startIndex=null,this.startContainer=null,this[Or]=this[Or].bind(this),this[Fr]=this[Fr].bind(this),this[Xr]=this[Xr].bind(this),this[Yr]=this[Yr].bind(this),this.on("drag:start",this[Or]).on("drag:over:container",this[Fr]).on("drag:over",this[Xr]).on("drag:stop",this[Yr])}destroy(){super.destroy(),this.off("drag:start",this[Or]).off("drag:over:container",this[Fr]).off("drag:over",this[Xr]).off("drag:stop",this[Yr])}index(t){return this.getSortableElementsForContainer(t.parentNode).indexOf(t)}getSortableElementsForContainer(t){return[...t.querySelectorAll(this.options.draggable)].filter((e=>e!==this.originalSource&&e!==this.mirror&&e.parentNode===t))}[Or](t){this.startContainer=t.source.parentNode,this.startIndex=this.index(t.source);const e=new wr({dragEvent:t,startIndex:this.startIndex,startContainer:this.startContainer});this.trigger(e),e.canceled()&&t.cancel()}[Fr](t){if(t.canceled())return;const{source:e,over:r,overContainer:n}=t,s=this.index(e),i=new xr({dragEvent:t,currentIndex:s,source:e,over:r});if(this.trigger(i),i.canceled())return;const o=Nr({source:e,over:r,overContainer:n,children:this.getSortableElementsForContainer(n)});if(!o)return;const{oldContainer:a,newContainer:l}=o,c=this.index(t.source),h=new Dr({dragEvent:t,oldIndex:s,newIndex:c,oldContainer:a,newContainer:l});this.trigger(h)}[Xr](t){if(t.over===t.originalSource||t.over===t.source)return;const{source:e,over:r,overContainer:n}=t,s=this.index(e),i=new xr({dragEvent:t,currentIndex:s,source:e,over:r});if(this.trigger(i),i.canceled())return;const o=Nr({source:e,over:r,overContainer:n,children:this.getDraggableElementsForContainer(n)});if(!o)return;const{oldContainer:a,newContainer:l}=o,c=this.index(e),h=new Dr({dragEvent:t,oldIndex:s,newIndex:c,oldContainer:a,newContainer:l});this.trigger(h)}[Yr](t){const e=new Lr({dragEvent:t,oldIndex:this.startIndex,newIndex:this.index(t.source),oldContainer:this.startContainer,newContainer:t.source.parentNode});this.trigger(e),this.startIndex=null,this.startContainer=null}}function Ar(t){return Array.prototype.indexOf.call(t.parentNode.children,t)}function Nr({source:t,over:e,overContainer:r,children:n}){const s=!n.length,i=t.parentNode!==r,o=e&&t.parentNode===e.parentNode;return s?function(t,e){const r=t.parentNode;return e.appendChild(t),{oldContainer:r,newContainer:e}}(t,r):o?function(t,e){const r=Ar(t),n=Ar(e);r<n?t.parentNode.insertBefore(t,e.nextElementSibling):t.parentNode.insertBefore(t,e);return{oldContainer:t.parentNode,newContainer:t.parentNode}}(t,e):i?function(t,e,r){const n=t.parentNode;e?e.parentNode.insertBefore(t,e):r.appendChild(t);return{oldContainer:n,newContainer:t.parentNode}}(t,e,r):null}}},e={};function r(n){var s=e[n];if(void 0!==s)return s.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},window.Draggable=r(5458)})(); |