UNPKG

decap-cms-app

Version:

An extensible, open source, Git-based, React CMS for static sites. Reusable congiuration with React as peer.

2 lines 4.72 MB
/*! For license information please see decap-cms-app.js.LICENSE.txt */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define("DecapCmsApp",["react","react-dom"],t):"object"==typeof exports?exports.DecapCmsApp=t(require("react"),require("react-dom")):e.DecapCmsApp=t(e.React,e.ReactDOM)}(window,((__WEBPACK_EXTERNAL_MODULE__12244__,__WEBPACK_EXTERNAL_MODULE__53741__)=>(()=>{var __webpack_modules__={61540:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AutoScrollActivator:()=>xe,DndContext:()=>Xe,DragOverlay:()=>gt,KeyboardCode:()=>ae,KeyboardSensor:()=>de,MeasuringFrequency:()=>Se,MeasuringStrategy:()=>Ce,MouseSensor:()=>be,PointerSensor:()=>ge,TouchSensor:()=>_e,TraversalOrder:()=>Ee,applyModifiers:()=>Ke,closestCenter:()=>T,closestCorners:()=>O,defaultAnnouncements:()=>h,defaultCoordinates:()=>w,defaultDropAnimation:()=>pt,defaultDropAnimationSideEffects:()=>ft,defaultScreenReaderInstructions:()=>p,getClientRect:()=>B,getFirstCollision:()=>S,getScrollableAncestors:()=>z,pointerWithin:()=>D,rectIntersection:()=>R,useDndContext:()=>nt,useDndMonitor:()=>f,useDraggable:()=>tt,useDroppable:()=>ot,useSensor:()=>y,useSensors:()=>b});var r=n(12244),i=n.n(r),o=n(53741),a=n(82851);const s={display:"none"};function l(e){let{id:t,value:n}=e;return i().createElement("div",{id:t,style:s},n)}const u={position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};function c(e){let{id:t,announcement:n}=e;return i().createElement("div",{id:t,style:u,role:"status","aria-live":"assertive","aria-atomic":!0},n)}const d=(0,r.createContext)(null);function f(e){const t=(0,r.useContext)(d);(0,r.useEffect)((()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)}),[e,t])}const p={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},h={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function m(e){let{announcements:t=h,container:n,hiddenTextDescribedById:s,screenReaderInstructions:u=p}=e;const{announce:d,announcement:m}=function(){const[e,t]=(0,r.useState)("");return{announce:(0,r.useCallback)((e=>{null!=e&&t(e)}),[]),announcement:e}}(),g=(0,a.useUniqueId)("DndLiveRegion"),[v,y]=(0,r.useState)(!1);if((0,r.useEffect)((()=>{y(!0)}),[]),f((0,r.useMemo)((()=>({onDragStart(e){let{active:n}=e;d(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&d(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;d(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;d(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;d(t.onDragCancel({active:n,over:r}))}})),[d,t])),!v)return null;const b=i().createElement(i().Fragment,null,i().createElement(l,{id:s,value:u.draggable}),i().createElement(c,{id:g,announcement:m}));return n?(0,o.createPortal)(b,n):b}var g;function v(){}function y(e,t){return(0,r.useMemo)((()=>({sensor:e,options:null!=t?t:{}})),[e,t])}function b(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,r.useMemo)((()=>[...t].filter((e=>null!=e))),[...t])}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(g||(g={}));const w=Object.freeze({x:0,y:0});function _(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function x(e,t){const n=(0,a.getEventCoordinates)(e);return n?(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%":"0 0"}function E(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function k(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function C(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function S(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}function A(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const T=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=A(t,t.left,t.top),o=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=_(A(r),i);o.push({id:t,data:{droppableContainer:e,value:n}})}}return o.sort(E)},O=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=C(t),o=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=C(r),a=i.reduce(((e,t,r)=>e+_(n[r],t)),0),s=Number((a/4).toFixed(4));o.push({id:t,data:{droppableContainer:e,value:s}})}}return o.sort(E)};function P(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),a=i-r,s=o-n;if(r<i&&n<o){const n=t.width*t.height,r=e.width*e.height,i=a*s;return Number((i/(n+r-i)).toFixed(4))}return 0}const R=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const e of r){const{id:r}=e,o=n.get(r);if(o){const n=P(o,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(k)};function M(e,t){const{top:n,left:r,bottom:i,right:o}=t;return n<=e.y&&e.y<=i&&r<=e.x&&e.x<=o}const D=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(!r)return[];const i=[];for(const e of t){const{id:t}=e,o=n.get(t);if(o&&M(r,o)){const n=C(o).reduce(((e,t)=>e+_(r,t)),0),a=Number((n/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:a}})}}return i.sort(E)};function I(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:w}function L(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce(((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x})),{...t})}}const j=L(1);function N(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const F={ignoreTransform:!1};function B(e,t){void 0===t&&(t=F);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=(0,a.getWindow)(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=N(t);if(!r)return e;const{scaleX:i,scaleY:o,x:a,y:s}=r,l=e.left-a-(1-i)*parseFloat(n),u=e.top-s-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),c=i?e.width/i:e.width,d=o?e.height/o:e.height;return{width:c,height:d,top:u,right:l+c,bottom:u+d,left:l}}(n,t,r))}const{top:r,left:i,width:o,height:s,bottom:l,right:u}=n;return{top:r,left:i,width:o,height:s,bottom:l,right:u}}function U(e){return B(e,{ignoreTransform:!0})}function z(e,t){const n=[];return e?function r(i){if(null!=t&&n.length>=t)return n;if(!i)return n;if((0,a.isDocument)(i)&&null!=i.scrollingElement&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!(0,a.isHTMLElement)(i)||(0,a.isSVGElement)(i))return n;if(n.includes(i))return n;const o=(0,a.getWindow)(e).getComputedStyle(i);return i!==e&&function(e,t){void 0===t&&(t=(0,a.getWindow)(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((e=>{const r=t[e];return"string"==typeof r&&n.test(r)}))}(i,o)&&n.push(i),function(e,t){return void 0===t&&(t=(0,a.getWindow)(e).getComputedStyle(e)),"fixed"===t.position}(i,o)?n:r(i.parentNode)}(e):n}function q(e){const[t]=z(e,1);return null!=t?t:null}function W(e){return a.canUseDOM&&e?(0,a.isWindow)(e)?e:(0,a.isNode)(e)?(0,a.isDocument)(e)||e===(0,a.getOwnerDocument)(e).scrollingElement?window:(0,a.isHTMLElement)(e)?e:null:null:null}function $(e){return(0,a.isWindow)(e)?e.scrollX:e.scrollLeft}function H(e){return(0,a.isWindow)(e)?e.scrollY:e.scrollTop}function G(e){return{x:$(e),y:H(e)}}var V;function K(e){return!(!a.canUseDOM||!e)&&e===document.scrollingElement}function Z(e){const t={x:0,y:0},n=K(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(V||(V={}));const Y={x:.2,y:.2};function X(e,t,n,r,i){let{top:o,left:a,right:s,bottom:l}=n;void 0===r&&(r=10),void 0===i&&(i=Y);const{isTop:u,isBottom:c,isLeft:d,isRight:f}=Z(e),p={x:0,y:0},h={x:0,y:0},m=t.height*i.y,g=t.width*i.x;return!u&&o<=t.top+m?(p.y=V.Backward,h.y=r*Math.abs((t.top+m-o)/m)):!c&&l>=t.bottom-m&&(p.y=V.Forward,h.y=r*Math.abs((t.bottom-m-l)/m)),!f&&s>=t.right-g?(p.x=V.Forward,h.x=r*Math.abs((t.right-g-s)/g)):!d&&a<=t.left+g&&(p.x=V.Backward,h.x=r*Math.abs((t.left+g-a)/g)),{direction:p,speed:h}}function Q(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function J(e){return e.reduce(((e,t)=>(0,a.add)(e,G(t))),w)}function ee(e,t){if(void 0===t&&(t=B),!e)return;const{top:n,left:r,bottom:i,right:o}=t(e);q(e)&&(i<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const te=[["x",["left","right"],function(e){return e.reduce(((e,t)=>e+$(t)),0)}],["y",["top","bottom"],function(e){return e.reduce(((e,t)=>e+H(t)),0)}]];class ne{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=z(t),r=J(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,i]of te)for(const o of t)Object.defineProperty(this,o,{get:()=>{const t=i(n),a=r[e]-t;return this.rect[o]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class re{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)}))},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function ie(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var oe,ae;function se(e){e.preventDefault()}function le(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(oe||(oe={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"}(ae||(ae={}));const ue={start:[ae.Space,ae.Enter],cancel:[ae.Esc],end:[ae.Space,ae.Enter]},ce=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case ae.Right:return{...n,x:n.x+25};case ae.Left:return{...n,x:n.x-25};case ae.Down:return{...n,y:n.y+25};case ae.Up:return{...n,y:n.y-25}}};class de{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new re((0,a.getOwnerDocument)(t)),this.windowListeners=new re((0,a.getWindow)(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(oe.Resize,this.handleCancel),this.windowListeners.add(oe.VisibilityChange,this.handleCancel),setTimeout((()=>this.listeners.add(oe.Keydown,this.handleKeyDown)))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&ee(n),t(w)}handleKeyDown(e){if((0,a.isKeyboardEvent)(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:i=ue,coordinateGetter:o=ce,scrollBehavior:s="smooth"}=r,{code:l}=e;if(i.end.includes(l))return void this.handleEnd(e);if(i.cancel.includes(l))return void this.handleCancel(e);const{collisionRect:u}=n.current,c=u?{x:u.left,y:u.top}:w;this.referenceCoordinates||(this.referenceCoordinates=c);const d=o(e,{active:t,context:n.current,currentCoordinates:c});if(d){const t=(0,a.subtract)(d,c),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(const n of i){const i=e.code,{isTop:o,isRight:a,isLeft:l,isBottom:u,maxScroll:c,minScroll:f}=Z(n),p=Q(n),h={x:Math.min(i===ae.Right?p.right-p.width/2:p.right,Math.max(i===ae.Right?p.left:p.left+p.width/2,d.x)),y:Math.min(i===ae.Down?p.bottom-p.height/2:p.bottom,Math.max(i===ae.Down?p.top:p.top+p.height/2,d.y))},m=i===ae.Right&&!a||i===ae.Left&&!l,g=i===ae.Down&&!u||i===ae.Up&&!o;if(m&&h.x!==d.x){const e=n.scrollLeft+t.x,o=i===ae.Right&&e<=c.x||i===ae.Left&&e>=f.x;if(o&&!t.y)return void n.scrollTo({left:e,behavior:s});r.x=o?n.scrollLeft-e:i===ae.Right?n.scrollLeft-c.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:s});break}if(g&&h.y!==d.y){const e=n.scrollTop+t.y,o=i===ae.Down&&e<=c.y||i===ae.Up&&e>=f.y;if(o&&!t.x)return void n.scrollTo({top:e,behavior:s});r.y=o?n.scrollTop-e:i===ae.Down?n.scrollTop-c.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:s});break}}this.handleMove(e,(0,a.add)((0,a.subtract)(d,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function fe(e){return Boolean(e&&"distance"in e)}function pe(e){return Boolean(e&&"delay"in e)}de.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=ue,onActivation:i}=t,{active:o}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const t=o.activatorNode.current;return!(t&&e.target!==t||(e.preventDefault(),null==i||i({event:e.nativeEvent}),0))}return!1}}];class he{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=(0,a.getWindow)(e);return e instanceof t?e:(0,a.getOwnerDocument)(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:i}=e,{target:o}=i;this.props=e,this.events=t,this.document=(0,a.getOwnerDocument)(o),this.documentListeners=new re(this.document),this.listeners=new re(n),this.windowListeners=new re((0,a.getWindow)(o)),this.initialCoordinates=null!=(r=(0,a.getEventCoordinates)(i))?r:w,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),this.windowListeners.add(oe.Resize,this.handleCancel),this.windowListeners.add(oe.DragStart,se),this.windowListeners.add(oe.VisibilityChange,this.handleCancel),this.windowListeners.add(oe.ContextMenu,se),this.documentListeners.add(oe.Keydown,this.handleKeydown),t){if(fe(t))return;if(pe(t))return void(this.timeoutId=setTimeout(this.handleStart,t.delay))}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(oe.Click,le,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(oe.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:i}=this,{onMove:o,options:{activationConstraint:s}}=i;if(!r)return;const l=null!=(t=(0,a.getEventCoordinates)(e))?t:w,u=(0,a.subtract)(r,l);if(!n&&s){if(pe(s))return ie(u,s.tolerance)?this.handleCancel():void 0;if(fe(s))return null!=s.tolerance&&ie(u,s.tolerance)?this.handleCancel():ie(u,s.distance)?this.handleStart():void 0}e.cancelable&&e.preventDefault(),o(l)}handleEnd(){const{onEnd:e}=this.props;this.detach(),e()}handleCancel(){const{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===ae.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const me={move:{name:"pointermove"},end:{name:"pointerup"}};class ge extends he{constructor(e){const{event:t}=e,n=(0,a.getOwnerDocument)(t.target);super(e,me,n)}}ge.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button||(null==r||r({event:n}),0))}}];const ve={move:{name:"mousemove"},end:{name:"mouseup"}};var ye;!function(e){e[e.RightClick=2]="RightClick"}(ye||(ye={}));class be extends he{constructor(e){super(e,ve,(0,a.getOwnerDocument)(e.event.target))}}be.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==ye.RightClick&&(null==r||r({event:n}),!0)}}];const we={move:{name:"touchmove"},end:{name:"touchend"}};class _e extends he{constructor(e){super(e,we)}static setup(){return window.addEventListener(we.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(we.move.name,e)};function e(){}}}var xe,Ee;_e.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:i}=n;return!(i.length>1||(null==r||r({event:n}),0))}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(xe||(xe={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(Ee||(Ee={}));const ke={x:{[V.Backward]:!1,[V.Forward]:!1},y:{[V.Backward]:!1,[V.Forward]:!1}};var Ce,Se;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(Ce||(Ce={})),function(e){e.Optimized="optimized"}(Se||(Se={}));const Ae=new Map;function Te(e,t){return(0,a.useLazyMemo)((n=>e?n||("function"==typeof t?t(e):e):null),[t,e])}function Oe(e){let{callback:t,disabled:n}=e;const i=(0,a.useEvent)(t),o=(0,r.useMemo)((()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(i)}),[n]);return(0,r.useEffect)((()=>()=>null==o?void 0:o.disconnect()),[o]),o}function Pe(e){return new ne(B(e),e)}function Re(e,t,n){void 0===t&&(t=Pe);const[i,o]=(0,r.useReducer)((function(r){if(!e)return null;var i;if(!1===e.isConnected)return null!=(i=null!=r?r:n)?i:null;const o=t(e);return JSON.stringify(r)===JSON.stringify(o)?r:o}),null),s=function(e){let{callback:t,disabled:n}=e;const i=(0,a.useEvent)(t),o=(0,r.useMemo)((()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(i)}),[i,n]);return(0,r.useEffect)((()=>()=>null==o?void 0:o.disconnect()),[o]),o}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){o();break}}}}),l=Oe({callback:o});return(0,a.useIsomorphicLayoutEffect)((()=>{o(),e?(null==l||l.observe(e),null==s||s.observe(document.body,{childList:!0,subtree:!0})):(null==l||l.disconnect(),null==s||s.disconnect())}),[e]),i}const Me=[];function De(e,t){void 0===t&&(t=[]);const n=(0,r.useRef)(null);return(0,r.useEffect)((()=>{n.current=null}),t),(0,r.useEffect)((()=>{const t=e!==w;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)}),[e]),n.current?(0,a.subtract)(e,n.current):w}function Ie(e){return(0,r.useMemo)((()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null),[e])}const Le=[];function je(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return(0,a.isHTMLElement)(t)?t:e}const Ne=[{sensor:ge,options:{}},{sensor:de,options:{}}],Fe={current:{}},Be={draggable:{measure:U},droppable:{measure:U,strategy:Ce.WhileDragging,frequency:Se.Optimized},dragOverlay:{measure:B}};class Ue extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter((e=>{let{disabled:t}=e;return!t}))}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const ze={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Ue,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:v},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Be,measureDroppableContainers:v,windowRect:null,measuringScheduled:!1},qe={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:v,draggableNodes:new Map,over:null,measureDroppableContainers:v},We=(0,r.createContext)(qe),$e=(0,r.createContext)(ze);function He(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Ue}}}function Ge(e,t){switch(t.type){case g.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case g.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case g.DragEnd:case g.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case g.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new Ue(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case g.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const a=new Ue(e.droppable.containers);return a.set(n,{...o,disabled:i}),{...e,droppable:{...e.droppable,containers:a}}}case g.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new Ue(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function Ve(e){let{disabled:t}=e;const{active:n,activatorEvent:i,draggableNodes:o}=(0,r.useContext)(We),s=(0,a.usePrevious)(i),l=(0,a.usePrevious)(null==n?void 0:n.id);return(0,r.useEffect)((()=>{if(!t&&!i&&s&&null!=l){if(!(0,a.isKeyboardEvent)(s))return;if(document.activeElement===s.target)return;const e=o.get(l);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame((()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=(0,a.findFirstFocusableNode)(e);if(t){t.focus();break}}}))}}),[i,t,o,l,s]),null}function Ke(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce(((e,t)=>t({transform:e,...r})),n):n}const Ze=(0,r.createContext)({...w,scaleX:1,scaleY:1});var Ye;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(Ye||(Ye={}));const Xe=(0,r.memo)((function(e){var t,n,s,l;let{id:u,accessibility:c,autoScroll:f=!0,children:p,sensors:h=Ne,collisionDetection:v=R,measuring:y,modifiers:b,..._}=e;const x=(0,r.useReducer)(Ge,void 0,He),[E,k]=x,[C,A]=function(){const[e]=(0,r.useState)((()=>new Set)),t=(0,r.useCallback)((t=>(e.add(t),()=>e.delete(t))),[e]);return[(0,r.useCallback)((t=>{let{type:n,event:r}=t;e.forEach((e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)}))}),[e]),t]}(),[T,O]=(0,r.useState)(Ye.Uninitialized),P=T===Ye.Initialized,{draggable:{active:M,nodes:D,translate:L},droppable:{containers:N}}=E,F=M?D.get(M):null,U=(0,r.useRef)({initial:null,translated:null}),$=(0,r.useMemo)((()=>{var e;return null!=M?{id:M,data:null!=(e=null==F?void 0:F.data)?e:Fe,rect:U}:null}),[M,F]),H=(0,r.useRef)(null),[Z,Y]=(0,r.useState)(null),[Q,ee]=(0,r.useState)(null),te=(0,a.useLatestValue)(_,Object.values(_)),re=(0,a.useUniqueId)("DndDescribedBy",u),ie=(0,r.useMemo)((()=>N.getEnabled()),[N]),oe=(ae=y,(0,r.useMemo)((()=>({draggable:{...Be.draggable,...null==ae?void 0:ae.draggable},droppable:{...Be.droppable,...null==ae?void 0:ae.droppable},dragOverlay:{...Be.dragOverlay,...null==ae?void 0:ae.dragOverlay}})),[null==ae?void 0:ae.draggable,null==ae?void 0:ae.droppable,null==ae?void 0:ae.dragOverlay]));var ae;const{droppableRects:se,measureDroppableContainers:le,measuringScheduled:ue}=function(e,t){let{dragging:n,dependencies:i,config:o}=t;const[s,l]=(0,r.useState)(null),{frequency:u,measure:c,strategy:d}=o,f=(0,r.useRef)(e),p=function(){switch(d){case Ce.Always:return!1;case Ce.BeforeDragging:return n;default:return!n}}(),h=(0,a.useLatestValue)(p),m=(0,r.useCallback)((function(e){void 0===e&&(e=[]),h.current||l((t=>null===t?e:t.concat(e.filter((e=>!t.includes(e))))))}),[h]),g=(0,r.useRef)(null),v=(0,a.useLazyMemo)((t=>{if(p&&!n)return Ae;if(!t||t===Ae||f.current!==e||null!=s){const t=new Map;for(let n of e){if(!n)continue;if(s&&s.length>0&&!s.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new ne(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t}),[e,s,n,p,c]);return(0,r.useEffect)((()=>{f.current=e}),[e]),(0,r.useEffect)((()=>{p||m()}),[n,p]),(0,r.useEffect)((()=>{s&&s.length>0&&l(null)}),[JSON.stringify(s)]),(0,r.useEffect)((()=>{p||"number"!=typeof u||null!==g.current||(g.current=setTimeout((()=>{m(),g.current=null}),u))}),[u,p,m,...i]),{droppableRects:v,measureDroppableContainers:m,measuringScheduled:null!=s}}(ie,{dragging:P,dependencies:[L.x,L.y],config:oe.droppable}),ce=function(e,t){const n=null!==t?e.get(t):void 0,r=n?n.node.current:null;return(0,a.useLazyMemo)((e=>{var n;return null===t?null:null!=(n=null!=r?r:e)?n:null}),[r,t])}(D,M),de=(0,r.useMemo)((()=>Q?(0,a.getEventCoordinates)(Q):null),[Q]),fe=function(){const e=!1===(null==Z?void 0:Z.autoScrollEnabled),t="object"==typeof f?!1===f.enabled:!1===f,n=P&&!e&&!t;return"object"==typeof f?{...f,enabled:n}:{enabled:n}}(),pe=function(e,t){return Te(e,t)}(ce,oe.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:i,config:o=!0}=e;const s=(0,r.useRef)(!1),{x:l,y:u}="boolean"==typeof o?{x:o,y:o}:o;(0,a.useIsomorphicLayoutEffect)((()=>{if(!l&&!u||!t)return void(s.current=!1);if(s.current||!i)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const r=I(n(e),i);if(l||(r.x=0),u||(r.y=0),s.current=!0,Math.abs(r.x)>0||Math.abs(r.y)>0){const t=q(e);t&&t.scrollBy({top:r.y,left:r.x})}}),[t,l,u,i,n])}({activeNode:M?D.get(M):null,config:fe.layoutShiftCompensation,initialRect:pe,measure:oe.draggable.measure});const he=Re(ce,oe.draggable.measure,pe),me=Re(ce?ce.parentElement:null),ge=(0,r.useRef)({activatorEvent:null,active:null,activeNode:ce,collisionRect:null,collisions:null,droppableRects:se,draggableNodes:D,draggingNode:null,draggingNodeRect:null,droppableContainers:N,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ve=N.getNodeFor(null==(t=ge.current.over)?void 0:t.id),ye=function(e){let{measure:t}=e;const[n,i]=(0,r.useState)(null),o=Oe({callback:(0,r.useCallback)((e=>{for(const{target:n}of e)if((0,a.isHTMLElement)(n)){i((e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r}));break}}),[t])}),s=(0,r.useCallback)((e=>{const n=je(e);null==o||o.disconnect(),n&&(null==o||o.observe(n)),i(n?t(n):null)}),[t,o]),[l,u]=(0,a.useNodeRef)(s);return(0,r.useMemo)((()=>({nodeRef:l,rect:n,setRef:u})),[n,l,u])}({measure:oe.dragOverlay.measure}),be=null!=(n=ye.nodeRef.current)?n:ce,we=P?null!=(s=ye.rect)?s:he:null,_e=Boolean(ye.nodeRef.current&&ye.rect),Se=I(Pe=_e?null:he,Te(Pe));var Pe;const Ue=Ie(be?(0,a.getWindow)(be):null),ze=function(e){const t=(0,r.useRef)(e),n=(0,a.useLazyMemo)((n=>e?n&&n!==Me&&e&&t.current&&e.parentNode===t.current.parentNode?n:z(e):Me),[e]);return(0,r.useEffect)((()=>{t.current=e}),[e]),n}(P?null!=ve?ve:ce:null),qe=function(e,t){void 0===t&&(t=B);const[n]=e,i=Ie(n?(0,a.getWindow)(n):null),[o,s]=(0,r.useReducer)((function(){return e.length?e.map((e=>K(e)?i:new ne(t(e),e))):Le}),Le),l=Oe({callback:s});return e.length>0&&o===Le&&s(),(0,a.useIsomorphicLayoutEffect)((()=>{e.length?e.forEach((e=>null==l?void 0:l.observe(e))):(null==l||l.disconnect(),s())}),[e]),o}(ze),Xe=Ke(b,{transform:{x:L.x-Se.x,y:L.y-Se.y,scaleX:1,scaleY:1},activatorEvent:Q,active:$,activeNodeRect:he,containerNodeRect:me,draggingNodeRect:we,over:ge.current.over,overlayNodeRect:ye.rect,scrollableAncestors:ze,scrollableAncestorRects:qe,windowRect:Ue}),Qe=de?(0,a.add)(de,L):null,Je=function(e){const[t,n]=(0,r.useState)(null),i=(0,r.useRef)(e),o=(0,r.useCallback)((e=>{const t=W(e.target);t&&n((e=>e?(e.set(t,G(t)),new Map(e)):null))}),[]);return(0,r.useEffect)((()=>{const t=i.current;if(e!==t){r(t);const a=e.map((e=>{const t=W(e);return t?(t.addEventListener("scroll",o,{passive:!0}),[t,G(t)]):null})).filter((e=>null!=e));n(a.length?new Map(a):null),i.current=e}return()=>{r(e),r(t)};function r(e){e.forEach((e=>{const t=W(e);null==t||t.removeEventListener("scroll",o)}))}}),[o,e]),(0,r.useMemo)((()=>e.length?t?Array.from(t.values()).reduce(((e,t)=>(0,a.add)(e,t)),w):J(e):w),[e,t])}(ze),et=De(Je),tt=De(Je,[he]),nt=(0,a.add)(Xe,et),rt=we?j(we,Xe):null,it=$&&rt?v({active:$,collisionRect:rt,droppableRects:se,droppableContainers:ie,pointerCoordinates:Qe}):null,ot=S(it,"id"),[at,st]=(0,r.useState)(null),lt=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(_e?Xe:(0,a.add)(Xe,tt),null!=(l=null==at?void 0:at.rect)?l:null,he),ut=(0,r.useCallback)(((e,t)=>{let{sensor:n,options:r}=t;if(null==H.current)return;const i=D.get(H.current);if(!i)return;const a=e.nativeEvent,s=new n({active:H.current,activeNode:i,event:a,options:r,context:ge,onStart(e){const t=H.current;if(null==t)return;const n=D.get(t);if(!n)return;const{onDragStart:r}=te.current,i={active:{id:t,data:n.data,rect:U}};(0,o.unstable_batchedUpdates)((()=>{null==r||r(i),O(Ye.Initializing),k({type:g.DragStart,initialCoordinates:e,active:t}),C({type:"onDragStart",event:i})}))},onMove(e){k({type:g.DragMove,coordinates:e})},onEnd:l(g.DragEnd),onCancel:l(g.DragCancel)});function l(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=ge.current;let s=null;if(t&&i){const{cancelDrop:o}=te.current;s={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===g.DragEnd&&"function"==typeof o&&await Promise.resolve(o(s))&&(e=g.DragCancel)}H.current=null,(0,o.unstable_batchedUpdates)((()=>{k({type:e}),O(Ye.Uninitialized),st(null),Y(null),ee(null);const t=e===g.DragEnd?"onDragEnd":"onDragCancel";if(s){const e=te.current[t];null==e||e(s),C({type:t,event:s})}}))}}(0,o.unstable_batchedUpdates)((()=>{Y(s),ee(e.nativeEvent)}))}),[D]),ct=(0,r.useCallback)(((e,t)=>(n,r)=>{const i=n.nativeEvent,o=D.get(r);if(null!==H.current||!o||i.dndKit||i.defaultPrevented)return;const a={active:o};!0===e(n,t.options,a)&&(i.dndKit={capturedBy:t.sensor},H.current=r,ut(n,t))}),[D,ut]),dt=function(e,t){return(0,r.useMemo)((()=>e.reduce(((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map((e=>({eventName:e.eventName,handler:t(e.handler,n)})))]}),[])),[e,t])}(h,ct);!function(e){(0,r.useEffect)((()=>{if(!a.canUseDOM)return;const t=e.map((e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()}));return()=>{for(const e of t)null==e||e()}}),e.map((e=>{let{sensor:t}=e;return t})))}(h),(0,a.useIsomorphicLayoutEffect)((()=>{he&&T===Ye.Initializing&&O(Ye.Initialized)}),[he,T]),(0,r.useEffect)((()=>{const{onDragMove:e}=te.current,{active:t,activatorEvent:n,collisions:r,over:i}=ge.current;if(!t||!n)return;const a={active:t,activatorEvent:n,collisions:r,delta:{x:nt.x,y:nt.y},over:i};(0,o.unstable_batchedUpdates)((()=>{null==e||e(a),C({type:"onDragMove",event:a})}))}),[nt.x,nt.y]),(0,r.useEffect)((()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=ge.current;if(!e||null==H.current||!t||!i)return;const{onDragOver:a}=te.current,s=r.get(ot),l=s&&s.rect.current?{id:s.id,rect:s.rect.current,data:s.data,disabled:s.disabled}:null,u={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:l};(0,o.unstable_batchedUpdates)((()=>{st(l),null==a||a(u),C({type:"onDragOver",event:u})}))}),[ot]),(0,a.useIsomorphicLayoutEffect)((()=>{ge.current={activatorEvent:Q,active:$,activeNode:ce,collisionRect:rt,collisions:it,droppableRects:se,draggableNodes:D,draggingNode:be,draggingNodeRect:we,droppableContainers:N,over:at,scrollableAncestors:ze,scrollAdjustedTranslate:nt},U.current={initial:we,translated:rt}}),[$,ce,it,rt,D,be,we,se,N,at,ze,nt]),function(e){let{acceleration:t,activator:n=xe.Pointer,canScroll:i,draggingRect:o,enabled:s,interval:l=5,order:u=Ee.TreeOrder,pointerCoordinates:c,scrollableAncestors:d,scrollableAncestorRects:f,delta:p,threshold:h}=e;const m=function(e){let{delta:t,disabled:n}=e;const r=(0,a.usePrevious)(t);return(0,a.useLazyMemo)((e=>{if(n||!r||!e)return ke;const i=Math.sign(t.x-r.x),o=Math.sign(t.y-r.y);return{x:{[V.Backward]:e.x[V.Backward]||-1===i,[V.Forward]:e.x[V.Forward]||1===i},y:{[V.Backward]:e.y[V.Backward]||-1===o,[V.Forward]:e.y[V.Forward]||1===o}}}),[n,t,r])}({delta:p,disabled:!s}),[g,v]=(0,a.useInterval)(),y=(0,r.useRef)({x:0,y:0}),b=(0,r.useRef)({x:0,y:0}),w=(0,r.useMemo)((()=>{switch(n){case xe.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case xe.DraggableRect:return o}}),[n,o,c]),_=(0,r.useRef)(null),x=(0,r.useCallback)((()=>{const e=_.current;if(!e)return;const t=y.current.x*b.current.x,n=y.current.y*b.current.y;e.scrollBy(t,n)}),[]),E=(0,r.useMemo)((()=>u===Ee.TreeOrder?[...d].reverse():d),[u,d]);(0,r.useEffect)((()=>{if(s&&d.length&&w){for(const e of E){if(!1===(null==i?void 0:i(e)))continue;const n=d.indexOf(e),r=f[n];if(!r)continue;const{direction:o,speed:a}=X(e,r,w,t,h);for(const e of["x","y"])m[e][o[e]]||(a[e]=0,o[e]=0);if(a.x>0||a.y>0)return v(),_.current=e,g(x,l),y.current=a,void(b.current=o)}y.current={x:0,y:0},b.current={x:0,y:0},v()}else v()}),[t,x,i,v,s,l,JSON.stringify(w),JSON.stringify(m),g,d,E,f,JSON.stringify(h)])}({...fe,delta:L,draggingRect:rt,pointerCoordinates:Qe,scrollableAncestors:ze,scrollableAncestorRects:qe});const ft=(0,r.useMemo)((()=>({active:$,activeNode:ce,activeNodeRect:he,activatorEvent:Q,collisions:it,containerNodeRect:me,dragOverlay:ye,draggableNodes:D,droppableContainers:N,droppableRects:se,over:at,measureDroppableContainers:le,scrollableAncestors:ze,scrollableAncestorRects:qe,measuringConfiguration:oe,measuringScheduled:ue,windowRect:Ue})),[$,ce,he,Q,it,me,ye,D,N,se,at,le,ze,qe,oe,ue,Ue]),pt=(0,r.useMemo)((()=>({activatorEvent:Q,activators:dt,active:$,activeNodeRect:he,ariaDescribedById:{draggable:re},dispatch:k,draggableNodes:D,over:at,measureDroppableContainers:le})),[Q,dt,$,he,k,re,D,at,le]);return i().createElement(d.Provider,{value:A},i().createElement(We.Provider,{value:pt},i().createElement($e.Provider,{value:ft},i().createElement(Ze.Provider,{value:lt},p)),i().createElement(Ve,{disabled:!1===(null==c?void 0:c.restoreFocus)})),i().createElement(m,{...c,hiddenTextDescribedById:re}))})),Qe=(0,r.createContext)(null),Je="button",et="Droppable";function tt(e){let{id:t,data:n,disabled:i=!1,attributes:o}=e;const s=(0,a.useUniqueId)(et),{activators:l,activatorEvent:u,active:c,activeNodeRect:d,ariaDescribedById:f,draggableNodes:p,over:h}=(0,r.useContext)(We),{role:m=Je,roleDescription:g="draggable",tabIndex:v=0}=null!=o?o:{},y=(null==c?void 0:c.id)===t,b=(0,r.useContext)(y?Ze:Qe),[w,_]=(0,a.useNodeRef)(),[x,E]=(0,a.useNodeRef)(),k=function(e,t){return(0,r.useMemo)((()=>e.reduce(((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e}),{})),[e,t])}(l,t),C=(0,a.useLatestValue)(n);return(0,a.useIsomorphicLayoutEffect)((()=>(p.set(t,{id:t,key:s,node:w,activatorNode:x,data:C}),()=>{const e=p.get(t);e&&e.key===s&&p.delete(t)})),[p,t]),{active:c,activatorEvent:u,activeNodeRect:d,attributes:(0,r.useMemo)((()=>({role:m,tabIndex:v,"aria-disabled":i,"aria-pressed":!(!y||m!==Je)||void 0,"aria-roledescription":g,"aria-describedby":f.draggable})),[i,m,v,y,g,f.draggable]),isDragging:y,listeners:i?void 0:k,node:w,over:h,setNodeRef:_,setActivatorNodeRef:E,transform:b}}function nt(){return(0,r.useContext)($e)}const rt="Droppable",it={timeout:25};function ot(e){let{data:t,disabled:n=!1,id:i,resizeObserverConfig:o}=e;const s=(0,a.useUniqueId)(rt),{active:l,dispatch:u,over:c,measureDroppableContainers:d}=(0,r.useContext)(We),f=(0,r.useRef)({disabled:n}),p=(0,r.useRef)(!1),h=(0,r.useRef)(null),m=(0,r.useRef)(null),{disabled:v,updateMeasurementsFor:y,timeout:b}={...it,...o},w=(0,a.useLatestValue)(null!=y?y:i),_=Oe({callback:(0,r.useCallback)((()=>{p.current?(null!=m.current&&clearTimeout(m.current),m.current=setTimeout((()=>{d(Array.isArray(w.current)?w.current:[w.current]),m.current=null}),b)):p.current=!0}),[b]),disabled:v||!l}),x=(0,r.useCallback)(((e,t)=>{_&&(t&&(_.unobserve(t),p.current=!1),e&&_.observe(e))}),[_]),[E,k]=(0,a.useNodeRef)(x),C=(0,a.useLatestValue)(t);return(0,r.useEffect)((()=>{_&&E.current&&(_.disconnect(),p.current=!1,_.observe(E.current))}),[E,_]),(0,a.useIsomorphicLayoutEffect)((()=>(u({type:g.RegisterDroppable,element:{id:i,key:s,disabled:n,node:E,rect:h,data:C}}),()=>u({type:g.UnregisterDroppable,key:s,id:i}))),[i]),(0,r.useEffect)((()=>{n!==f.current.disabled&&(u({type:g.SetDroppableDisabled,id:i,key:s,disabled:n}),f.current.disabled=n)}),[i,s,n,u]),{active:l,rect:h,isOver:(null==c?void 0:c.id)===i,node:E,over:c,setNodeRef:k}}function at(e){let{animation:t,children:n}=e;const[o,s]=(0,r.useState)(null),[l,u]=(0,r.useState)(null),c=(0,a.usePrevious)(n);return n||o||!c||s(c),(0,a.useIsomorphicLayoutEffect)((()=>{if(!l)return;const e=null==o?void 0:o.key,n=null==o?void 0:o.props.id;null!=e&&null!=n?Promise.resolve(t(n,l)).then((()=>{s(null)})):s(null)}),[t,o,l]),i().createElement(i().Fragment,null,n,o?(0,r.cloneElement)(o,{ref:u}):null)}const st={x:0,y:0,scaleX:1,scaleY:1};function lt(e){let{children:t}=e;return i().createElement(We.Provider,{value:qe},i().createElement(Ze.Provider,{value:st},t))}const ut={position:"fixed",touchAction:"none"},ct=e=>(0,a.isKeyboardEvent)(e)?"transform 250ms ease":void 0,dt=(0,r.forwardRef)(((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:s,className:l,rect:u,style:c,transform:d,transition:f=ct}=e;if(!u)return null;const p=o?d:{...d,scaleX:1,scaleY:1},h={...ut,width:u.width,height:u.height,top:u.top,left:u.left,transform:a.CSS.Transform.toString(p),transformOrigin:o&&r?x(r,u):void 0,transition:"function"==typeof f?f(r):f,...c};return i().createElement(n,{className:l,style:h,ref:t},s)})),ft=e=>t=>{let{active:n,dragOverlay:r}=t;const i={},{styles:o,className:a}=e;if(null!=o&&o.active)for(const[e,t]of Object.entries(o.active))void 0!==t&&(i[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(null!=o&&o.dragOverlay)for(const[e,t]of Object.entries(o.dragOverlay))void 0!==t&&r.node.style.setProperty(e,t);return null!=a&&a.active&&n.node.classList.add(a.active),null!=a&&a.dragOverlay&&r.node.classList.add(a.dragOverlay),function(){for(const[e,t]of Object.entries(i))n.node.style.setProperty(e,t);null!=a&&a.active&&n.node.classList.remove(a.active)}},pt={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:a.CSS.Transform.toString(t)},{transform:a.CSS.Transform.toString(n)}]},sideEffects:ft({styles:{active:{opacity:"0"}}})};let ht=0;function mt(e){return(0,r.useMemo)((()=>{if(null!=e)return ht++,ht}),[e])}const gt=i().memo((e=>{let{adjustScale:t=!1,children:n,dropAnimation:o,style:s,transition:l,modifiers:u,wrapperElement:c="div",className:d,zIndex:f=999}=e;const{activatorEvent:p,active:h,activeNodeRect:m,containerNodeRect:g,draggableNodes:v,droppableContainers:y,dragOverlay:b,over:w,measuringConfiguration:_,scrollableAncestors:x,scrollableAncestorRects:E,windowRect:k}=nt(),C=(0,r.useContext)(Ze),S=mt(null==h?void 0:h.id),A=Ke(u,{activatorEvent:p,active:h,activeNodeRect:m,containerNodeRect:g,draggingNodeRect:b.rect,over:w,overlayNodeRect:b.rect,scrollableAncestors:x,scrollableAncestorRects:E,transform:C,windowRect:k}),T=Te(m),O=function(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return(0,a.useEvent)(((e,o)=>{if(null===t)return;const s=n.get(e);if(!s)return;const l=s.node.current;if(!l)return;const u=je(o);if(!u)return;const{transform:c}=(0,a.getWindow)(o).getComputedStyle(o),d=N(c);if(!d)return;const f="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:i}={...pt,...e};return e=>{let{active:o,dragOverlay:a,transform:s,...l}=e;if(!t)return;const u=a.rect.left-o.rect.left,c=a.rect.top-o.rect.top,d={scaleX:1!==s.scaleX?o.rect.width*s.scaleX/a.rect.width:1,scaleY:1!==s.scaleY?o.rect.height*s.scaleY/a.rect.height:1},f={x:s.x-u,y:s.y-c,...d},p=i({...l,active:o,dragOverlay:a,transform:{initial:s,final:f}}),[h]=p,m=p[p.length-1];if(JSON.stringify(h)===JSON.stringify(m))return;const g=null==r?void 0:r({active:o,dragOverlay:a,...l}),v=a.node.animate(p,{duration:t,easing:n,fill:"forwards"});return new Promise((e=>{v.onfinish=()=>{null==g||g(),e()}}))}}(t);return ee(l,i.draggable.measure),f({active:{id:e,data:s.data,node:l,rect:i.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:o,rect:i.dragOverlay.measure(u)},droppableContainers:r,measuringConfiguration:i,transform:d})}))}({config:o,draggableNodes:v,droppableContainers:y,measuringConfiguration:_}),P=T?b.setRef:void 0;return i().createElement(lt,null,i().createElement(at,{animation:O},h&&S?i().createElement(dt,{key:S,id:h.id,ref:P,as:c,activatorEvent:p,adjustScale:t,className:d,transition:l,rect:T,style:{zIndex:f,...s},transform:A},n):null))}))},88366:(e,t,n)=>{"use strict";n.r(t),n.d(t,{createSnapModifier:()=>i,restrictToFirstScrollableAncestor:()=>l,restrictToHorizontalAxis:()=>o,restrictToParentElement:()=>s,restrictToVerticalAxis:()=>u,restrictToWindowEdges:()=>c,snapCenterToCursor:()=>d});var r=n(82851);function i(e){return t=>{let{transform:n}=t;return{...n,x:Math.ceil(n.x/e)*e,y:Math.ceil(n.y/e)*e}}}const o=e=>{let{transform:t}=e;return{...t,y:0}};function a(e,t,n){const r={...e};return t.top+e.y<=n.top?r.y=n.top-t.top:t.bottom+e.y>=n.top+n.height&&(r.y=n.top+n.height-t.bottom),t.left+e.x<=n.left?r.x=n.left-t.left:t.right+e.x>=n.left+n.width&&(r.x=n.left+n.width-t.right),r}const s=e=>{let{containerNodeRect:t,draggingNodeRect:n,transform:r}=e;return n&&t?a(r,n,t):r},l=e=>{let{draggingNodeRect:t,transform:n,scrollableAncestorRects:r}=e;const i=r[0];return t&&i?a(n,t,i):n},u=e=>{let{transform:t}=e;return{...t,x:0}},c=e=>{let{transform:t,draggingNodeRect:n,windowRect:r}=e;return n&&r?a(t,n,r):t},d=e=>{let{activatorEvent:t,draggingNodeRect:n,transform:i}=e;if(n&&t){const e=(0,r.getEventCoordinates)(t);if(!e)return i;const o=e.x-n.left,a=e.y-n.top;return{...i,x:i.x+o-n.width/2,y:i.y+a-n.height/2}}return i}},66548:(e,t,n)=>{"use strict";n.r(t),n.d(t,{SortableContext:()=>b,arrayMove:()=>s,arraySwap:()=>l,defaultAnimateLayoutChanges:()=>_,defaultNewIndexGetter:()=>w,hasSortableData:()=>A,horizontalListSortingStrategy:()=>f,rectSortingStrategy:()=>p,rectSwappingStrategy:()=>h,sortableKeyboardCoordinates:()=>O,useSortable:()=>S,verticalListSortingStrategy:()=>g});var r=n(12244),i=n.n(r),o=n(61540),a=n(82851);function s(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function l(e,t,n){const r=e.slice();return r[t]=e[n],r[n]=e[t],r}function u(e,t){return e.reduce(((e,n,r)=>{const i=t.get(n);return i&&(e[r]=i),e}),Array(e.length))}function c(e){return null!==e&&e>=0}const d={scaleX:1,scaleY:1},f=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:i,overIndex:o,index:a}=e;const s=null!=(t=n[i])?t:r;if(!s)return null;const l=function(e,t,n){const r=e[t],i=e[t-1],o=e[t+1];return r&&(i||o)?n<t?i?r.left-(i.left+i.width):o.left-(r.left+r.width):o?o.left-(r.left+r.width):r.left-(i.left+i.width):0}(n,a,i);if(a===i){const e=n[o];return e?{x:i<o?e.left+e.width-(s.left+s.width):e.left-s.left,y:0,...d}:null}return a>i&&a<=o?{x:-s.width-l,y:0,...d}:a<i&&a>=o?{x:s.width+l,y:0,...d}:{x:0,y:0,...d}},p=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e;const o=s(t,r,n),a=t[i],l=o[i];return l&&a?{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}:null},h=e=>{let t,n,{activeIndex:r,index:i,rects:o,overIndex:a}=e;return i===r&&(t=o[i],n=o[a]),i===a&&(t=o[i],n=o[r]),n&&t?{x:n.left-t.left,y:n.top-t.top,scaleX:n.width/t.width,scaleY:n.height/t.height}:null},m={scaleX:1,scaleY:1},g=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:i,rects:o,overIndex:a}=e;const s=null!=(t=o[n])?t:r;if(!s)return null;if(i===n){const e=o[a];return e?{x:0,y:n<a?e.top+e.height-(s.top+s.height):e.top-s.top,...m}:null}const l=function(e,t,n){const r=e[t],i=e[t-1],o=e[t+1];return r?n<t?i?r.top-(i.top+i.height):o?o.top-(r.top+r.height):0:o?o.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}(o,i,n);return i>n&&i<=a?{x:0,y:-s.height-l,...m}:i<n&&i>=a?{x:0,y:s.height+l,...m}:{x:0,y:0,...m}},v="Sortable",y=i().createContext({activeIndex:-1,containerId:v,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:p,disabled:{draggable:!1,droppable:!1}});function b(e){let{children:t,id:n,items:s,strategy:l=p,disabled:c=!1}=e;const{active:d,dragOverlay:f,droppableRects:h,over:m,measureDroppableContainers:g}=(0,o.useDndContext)(),b=(0,a.useUniqueId)(v,n),w=Boolean(null!==f.rect),_=(0,r.useMemo)((()=>s.map((e=>"object"==typeof e&&"id"in e?e.id:e))),[s]),x=null!=d,E=d?_.indexOf(d.id):-1,k=m?_.indexOf(m.id):-1,C=(0,r.useRef)(_),S=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(_,C.current),A=-1!==k&&-1===E||S,T=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(c);(0,a.useIsomorphicLayoutEffect)((()=>{S&&x&&g(_)}),[S,_,x,g]),(0,r.useEffect)((()=>{C.current=_}),[_]);const O=(0,r.useMemo)((()=>({activeIndex:E,containerId:b,disabled:T,disableTransforms:A,items:_,overIndex:k,useDragOverlay:w,sortedRects:u(_,h),strategy:l})),[E,b,T.draggable,T.droppable,A,_,k,h,w,l]);return i().createElement(y.Provider,{value:O},t)}const w=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return s(n,r,i).indexOf(t)},_=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:o,newIndex:a,previousItems:s,previousContainerId:l,transition:u}=e;return!(!u||!r||s!==o&&i===a||!n&&(a===i||t!==l))},x={duration:200,easing:"ease"},E="transform",k=a.CSS.Transition.toString({property:E,duration:0,easing:"linear"}),C={roleDescription:"sortable"};function S(e){let{animateLayoutChanges:t=_,attributes:n,disabled:i,data:s,getNewIndex:l=w,id:u,strategy:d,resizeObserverConfig:f,transition:p=x}=e;const{items:h,containerId:m,activeIndex:g,disabled:v,disableTransforms:b,sortedRects:S,overIndex:A,useDragOverlay:T,strategy:O}=(0,r.useContext)(y),P=function(e,t){var n,r;return"boolean"==typeof e?{draggable:e,droppable:!1}:{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(r=null==e?void 0:e.droppable)?r:t.droppable}}(i,v),R=h.indexOf(u),M=(0,r.useMemo)((()=>({sortable:{containerId:m,index:R,items:h},...s})),[m,s,R,h]),D=(0,r.useMemo)((()=>h.slice(h.indexOf(u))),[h,u]),{rect:I,node:L,isOver:j,setNodeRef:N}=(0,o.useDroppable)({id:u,data:M,disabled:P.droppable,resizeObserverConfig:{updateMeasurementsFor:D,...f}}),{active:F,activatorEvent:B,activeNodeRect:U,attributes:z,setNodeRef:q,listeners:W,isDragging:$,over:H,setActivatorNodeRef:G,transform:V}=(0,o.useDraggable)({id:u,data:M,attributes:{...C,...n},disabled:P.draggable}),K=(0,a.useCombinedRefs)(N,q),Z=Boolean(F),Y=Z&&!b&&c(g)&&c(A),X=!T&&$,Q=X&&Y?V:null,J=Y?null!=Q?Q:(null!=d?d:O)({rects:S,activeNodeRect:U,activeIndex:g,overIndex:A,index:R}):null,ee=c(g)&&c(A)?l({id:u,items:h,activeIndex:g,overIndex:A}):R,te=null==F?void 0:F.id,ne=(0,r.useRef)({activeId:te,items:h,newIndex:ee,containerId:m}),re=h!==ne.current.items,ie=t({active:F,containerId:m,isDragging:$,isSorting:Z,id:u,index:R,items:h,newIndex:ne.current.newIndex,previousItems:ne.current.items,previousContainerId:ne.current.containerId,transition:p,wasDragging:null!=ne.current.activeId}),oe=function(e){let{disabled:t,index:n,node:i,rect:s}=e;const[l,u]=(0,r.useState)(null),c=(0,r.useRef)(n);return(0,a.useIsomorphicLayoutEffect)((()=>{if(!t&&n!==c.current&&i.current){const e=s.current;if(e){const t=(0,o.getClientRect)(i.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&u(n)}}n!==c.current&&(c.current=n)}),[t,n,i,s]),(0,r.useEffect)((()=>{l&&u(null)}),[l]),l}({disabled:!ie,index:R,node:L,rect:I});return(0,r.useEffect)((()=>{Z&&ne.current.newIndex!==ee&&(ne.current.newIndex=ee),m!==ne.current.containerId&&(ne.current.containerId=m),h!==ne.current.items&&(ne.current.items=h)}),[Z,ee,m,h]),(0,r.useEffect)((()=>{if(te===ne.current.activeId)return;if(te&&!ne.current.activeId)return void(ne.current.activeId=te);const e=setTimeout((()=>{ne.current.activeId=te}),50);return()=>clearTimeout(e)}),[te]),{active: