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