import{r as I,cM as Zt,b3 as P,b5 as en,cN as Ct,cO as ur,cP as pr,cQ as fr,cR as gr,cS as mr,cT as tn,b as Pe,j as y,B as nn,cU as br,a0 as nt,o as rt,F as Ke,q as hr,A as vr,bX as rn,S as on,x as Dr,b8 as yr,v as xr,cs as Ir,cV as Sr,cW as _e,V as Cr,u as Er,P as Ar,a as wr}from"./index-n-59FgrC.js";import{E as Rr}from"./useTaskTypesData-CgG6u01U.js";import{g as Pr}from"./tasks-CZQGFm5u.js";import{G as Br,u as Or,T as Nr}from"./useDnd-BLM6vUjp.js";import{u as Tr,A as Lr,N as Gr,a as Mr,S as Fr,b as Wr,c as _r,d as $r,E as kr}from"./useSprintPage--OQBPn1w.js";import"./get-env-uyVen0u2.js";import"./useTasksData-B6wVLlCr.js";import"./TasksSearchInput-5LSyivTU.js";import"./GenericViewSettings-0aFJmnZF.js";import"./IconChevronLeft-CyT72r93.js";import"./IconGripVertical-Ce_4nROx.js";import"./IconUser-BvK8eLe8.js";import"./modifiers.esm-V6KF7boE.js";import"./IconSortDescending-DCVZ-bvF.js";import"./const-C6xp0SqX.js";function Hr(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function sn(e,t){var n=I.useState(function(){return{inputs:t,result:e()}})[0],r=I.useRef(!0),o=I.useRef(n),i=r.current||!!(t&&o.current.inputs&&Hr(t,o.current.inputs)),s=i?o.current:{inputs:t,result:e()};return I.useEffect(function(){r.current=!1,o.current=s},[s]),s.result}function jr(e,t){return sn(function(){return e},t)}var A=sn,v=jr,Vr="Invariant failed";function Ur(e,t){throw new Error(Vr)}var U=function(t){var n=t.top,r=t.right,o=t.bottom,i=t.left,s=r-i,l=o-n,c={top:n,right:r,bottom:o,left:i,width:s,height:l,x:i,y:n,center:{x:(r+i)/2,y:(o+n)/2}};return c},ot=function(t,n){return{top:t.top-n.top,left:t.left-n.left,bottom:t.bottom+n.bottom,right:t.right+n.right}},Et=function(t,n){return{top:t.top+n.top,left:t.left+n.left,bottom:t.bottom-n.bottom,right:t.right-n.right}},zr=function(t,n){return{top:t.top+n.y,left:t.left+n.x,bottom:t.bottom+n.y,right:t.right+n.x}},$e={top:0,right:0,bottom:0,left:0},it=function(t){var n=t.borderBox,r=t.margin,o=r===void 0?$e:r,i=t.border,s=i===void 0?$e:i,l=t.padding,c=l===void 0?$e:l,u=U(ot(n,o)),p=U(Et(n,s)),a=U(Et(p,c));return{marginBox:u,borderBox:U(n),paddingBox:p,contentBox:a,margin:o,border:s,padding:c}},H=function(t){var n=t.slice(0,-2),r=t.slice(-2);if(r!=="px")return 0;var o=Number(n);return isNaN(o)&&Ur(),o},qr=function(){return{x:window.pageXOffset,y:window.pageYOffset}},Ie=function(t,n){var r=t.borderBox,o=t.border,i=t.margin,s=t.padding,l=zr(r,n);return it({borderBox:l,border:o,margin:i,padding:s})},Se=function(t,n){return n===void 0&&(n=qr()),Ie(t,n)},ln=function(t,n){var r={top:H(n.marginTop),right:H(n.marginRight),bottom:H(n.marginBottom),left:H(n.marginLeft)},o={top:H(n.paddingTop),right:H(n.paddingRight),bottom:H(n.paddingBottom),left:H(n.paddingLeft)},i={top:H(n.borderTopWidth),right:H(n.borderRightWidth),bottom:H(n.borderBottomWidth),left:H(n.borderLeftWidth)};return it({borderBox:t,margin:r,padding:o,border:i})},an=function(t){var n=t.getBoundingClientRect(),r=window.getComputedStyle(t);return ln(n,r)},At=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Yr(e,t){return!!(e===t||At(e)&&At(t))}function Kr(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Yr(e[n],t[n]))return!1;return!0}function N(e,t){t===void 0&&(t=Kr);var n=null;function r(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];if(n&&n.lastThis===this&&t(o,n.lastArgs))return n.lastResult;var s=e.apply(this,o);return n={lastResult:s,lastArgs:o,lastThis:this},s}return r.clear=function(){n=null},r}var ce=function(t){var n=[],r=null,o=function(){for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];n=l,!r&&(r=requestAnimationFrame(function(){r=null,t.apply(void 0,n)}))};return o.cancel=function(){r&&(cancelAnimationFrame(r),r=null)},o};function cn(e,t){}cn.bind(null,"warn");cn.bind(null,"error");function z(){}function Jr(e,t){return{...e,...t}}function j(e,t,n){const r=t.map(o=>{const i=Jr(n,o.options);return e.addEventListener(o.eventName,o.fn,i),function(){e.removeEventListener(o.eventName,o.fn,i)}});return function(){r.forEach(i=>{i()})}}const Xr="Invariant failed";class Ce extends Error{}Ce.prototype.toString=function(){return this.message};function b(e,t){throw new Ce(Xr)}class Qr extends P.Component{constructor(...t){super(...t),this.callbacks=null,this.unbind=z,this.onWindowError=n=>{const r=this.getCallbacks();r.isDragging()&&r.tryAbort(),n.error instanceof Ce&&n.preventDefault()},this.getCallbacks=()=>{if(!this.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return this.callbacks},this.setCallbacks=n=>{this.callbacks=n}}componentDidMount(){this.unbind=j(window,[{eventName:"error",fn:this.onWindowError}])}componentDidCatch(t){if(t instanceof Ce){this.setState({});return}throw t}componentWillUnmount(){this.unbind()}render(){return this.props.children(this.setCallbacks)}}const Zr=`
  Press space bar to start a drag.
  When dragging you can use the arrow keys to move the item around and escape to cancel.
  Some screen readers may require you to be in focus mode or to use your pass through key
`,Ee=e=>e+1,eo=e=>`
  You have lifted an item in position ${Ee(e.source.index)}
`,dn=(e,t)=>{const n=e.droppableId===t.droppableId,r=Ee(e.index),o=Ee(t.index);return n?`
      You have moved the item from position ${r}
      to position ${o}
    `:`
    You have moved the item from position ${r}
    in list ${e.droppableId}
    to list ${t.droppableId}
    in position ${o}
  `},un=(e,t,n)=>t.droppableId===n.droppableId?`
      The item ${e}
      has been combined with ${n.draggableId}`:`
      The item ${e}
      in list ${t.droppableId}
      has been combined with ${n.draggableId}
      in list ${n.droppableId}
    `,to=e=>{const t=e.destination;if(t)return dn(e.source,t);const n=e.combine;return n?un(e.draggableId,e.source,n):"You are over an area that cannot be dropped on"},wt=e=>`
  The item has returned to its starting position
  of ${Ee(e.index)}
`,no=e=>{if(e.reason==="CANCEL")return`
      Movement cancelled.
      ${wt(e.source)}
    `;const t=e.destination,n=e.combine;return t?`
      You have dropped the item.
      ${dn(e.source,t)}
    `:n?`
      You have dropped the item.
      ${un(e.draggableId,e.source,n)}
    `:`
    The item has been dropped while not over a drop area.
    ${wt(e.source)}
  `},xe={dragHandleUsageInstructions:Zr,onDragStart:eo,onDragUpdate:to,onDragEnd:no},T={x:0,y:0},L=(e,t)=>({x:e.x+t.x,y:e.y+t.y}),W=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),q=(e,t)=>e.x===t.x&&e.y===t.y,te=e=>({x:e.x!==0?-e.x:0,y:e.y!==0?-e.y:0}),X=(e,t,n=0)=>e==="x"?{x:t,y:n}:{x:n,y:t},de=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),Rt=(e,t)=>Math.min(...t.map(n=>de(e,n))),pn=e=>t=>({x:e(t.x),y:e(t.y)});var ro=(e,t)=>{const n=U({top:Math.max(t.top,e.top),right:Math.min(t.right,e.right),bottom:Math.min(t.bottom,e.bottom),left:Math.max(t.left,e.left)});return n.width<=0||n.height<=0?null:n};const be=(e,t)=>({top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}),Pt=e=>[{x:e.left,y:e.top},{x:e.right,y:e.top},{x:e.left,y:e.bottom},{x:e.right,y:e.bottom}],oo={top:0,right:0,bottom:0,left:0},io=(e,t)=>t?be(e,t.scroll.diff.displacement):e,so=(e,t,n)=>n&&n.increasedBy?{...e,[t.end]:e[t.end]+n.increasedBy[t.line]}:e,lo=(e,t)=>t&&t.shouldClipSubject?ro(t.pageMarginBox,e):U(e);var Q=({page:e,withPlaceholder:t,axis:n,frame:r})=>{const o=io(e.marginBox,r),i=so(o,n,t),s=lo(i,r);return{page:e,withPlaceholder:t,active:s}},st=(e,t)=>{e.frame||b();const n=e.frame,r=W(t,n.scroll.initial),o=te(r),i={...n,scroll:{initial:n.scroll.initial,current:t,diff:{value:r,displacement:o},max:n.scroll.max}},s=Q({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:i});return{...e,frame:i,subject:s}};const fn=N(e=>e.reduce((t,n)=>(t[n.descriptor.id]=n,t),{})),gn=N(e=>e.reduce((t,n)=>(t[n.descriptor.id]=n,t),{})),Be=N(e=>Object.values(e)),ao=N(e=>Object.values(e));var ne=N((e,t)=>ao(t).filter(r=>e===r.descriptor.droppableId).sort((r,o)=>r.descriptor.index-o.descriptor.index));function lt(e){return e.at&&e.at.type==="REORDER"?e.at.destination:null}function Oe(e){return e.at&&e.at.type==="COMBINE"?e.at.combine:null}var Ne=N((e,t)=>t.filter(n=>n.descriptor.id!==e.descriptor.id)),co=({isMovingForward:e,draggable:t,destination:n,insideDestination:r,previousImpact:o})=>{if(!n.isCombineEnabled||!lt(o))return null;function s(f){const g={type:"COMBINE",combine:{draggableId:f,droppableId:n.descriptor.id}};return{...o,at:g}}const l=o.displaced.all,c=l.length?l[0]:null;if(e)return c?s(c):null;const u=Ne(t,r);if(!c){if(!u.length)return null;const f=u[u.length-1];return s(f.descriptor.id)}const p=u.findIndex(f=>f.descriptor.id===c);p===-1&&b();const a=p-1;if(a<0)return null;const d=u[a];return s(d.descriptor.id)},re=(e,t)=>e.descriptor.droppableId===t.descriptor.id;const mn={point:T,value:0},ue={invisible:{},visible:{},all:[]},uo={displaced:ue,displacedBy:mn,at:null};var V=(e,t)=>n=>e<=n&&n<=t,bn=e=>{const t=V(e.top,e.bottom),n=V(e.left,e.right);return r=>{if(t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right))return!0;const i=t(r.top)||t(r.bottom),s=n(r.left)||n(r.right);if(i&&s)return!0;const c=r.top<e.top&&r.bottom>e.bottom,u=r.left<e.left&&r.right>e.right;return c&&u?!0:c&&s||u&&i}},po=e=>{const t=V(e.top,e.bottom),n=V(e.left,e.right);return r=>t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right)};const at={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},hn={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"};var fo=e=>t=>{const n=V(t.top,t.bottom),r=V(t.left,t.right);return o=>e===at?n(o.top)&&n(o.bottom):r(o.left)&&r(o.right)};const go=(e,t)=>{const n=t.frame?t.frame.scroll.diff.displacement:T;return be(e,n)},mo=(e,t,n)=>t.subject.active?n(t.subject.active)(e):!1,bo=(e,t,n)=>n(t)(e),ct=({target:e,destination:t,viewport:n,withDroppableDisplacement:r,isVisibleThroughFrameFn:o})=>{const i=r?go(e,t):e;return mo(i,t,o)&&bo(i,n,o)},ho=e=>ct({...e,isVisibleThroughFrameFn:bn}),vn=e=>ct({...e,isVisibleThroughFrameFn:po}),vo=e=>ct({...e,isVisibleThroughFrameFn:fo(e.destination.axis)}),Do=(e,t,n)=>{if(typeof n=="boolean")return n;if(!t)return!0;const{invisible:r,visible:o}=t;if(r[e])return!1;const i=o[e];return i?i.shouldAnimate:!0};function yo(e,t){const n=e.page.marginBox,r={top:t.point.y,right:0,bottom:0,left:t.point.x};return U(ot(n,r))}function pe({afterDragging:e,destination:t,displacedBy:n,viewport:r,forceShouldAnimate:o,last:i}){return e.reduce(function(l,c){const u=yo(c,n),p=c.descriptor.id;if(l.all.push(p),!ho({target:u,destination:t,viewport:r,withDroppableDisplacement:!0}))return l.invisible[c.descriptor.id]=!0,l;const d=Do(p,i,o),f={draggableId:p,shouldAnimate:d};return l.visible[p]=f,l},{all:[],visible:{},invisible:{}})}function xo(e,t){if(!e.length)return 0;const n=e[e.length-1].descriptor.index;return t.inHomeList?n:n+1}function Bt({insideDestination:e,inHomeList:t,displacedBy:n,destination:r}){const o=xo(e,{inHomeList:t});return{displaced:ue,displacedBy:n,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:o}}}}function Ae({draggable:e,insideDestination:t,destination:n,viewport:r,displacedBy:o,last:i,index:s,forceShouldAnimate:l}){const c=re(e,n);if(s==null)return Bt({insideDestination:t,inHomeList:c,displacedBy:o,destination:n});const u=t.find(g=>g.descriptor.index===s);if(!u)return Bt({insideDestination:t,inHomeList:c,displacedBy:o,destination:n});const p=Ne(e,t),a=t.indexOf(u),d=p.slice(a);return{displaced:pe({afterDragging:d,destination:n,displacedBy:o,last:i,viewport:r.frame,forceShouldAnimate:l}),displacedBy:o,at:{type:"REORDER",destination:{droppableId:n.descriptor.id,index:s}}}}function Y(e,t){return!!t.effected[e]}var Io=({isMovingForward:e,destination:t,draggables:n,combine:r,afterCritical:o})=>{if(!t.isCombineEnabled)return null;const i=r.draggableId,l=n[i].descriptor.index;return Y(i,o)?e?l:l-1:e?l+1:l},So=({isMovingForward:e,isInHomeList:t,insideDestination:n,location:r})=>{if(!n.length)return null;const o=r.index,i=e?o+1:o-1,s=n[0].descriptor.index,l=n[n.length-1].descriptor.index,c=t?l:l+1;return i<s||i>c?null:i},Co=({isMovingForward:e,isInHomeList:t,draggable:n,draggables:r,destination:o,insideDestination:i,previousImpact:s,viewport:l,afterCritical:c})=>{const u=s.at;if(u||b(),u.type==="REORDER"){const a=So({isMovingForward:e,isInHomeList:t,location:u.destination,insideDestination:i});return a==null?null:Ae({draggable:n,insideDestination:i,destination:o,viewport:l,last:s.displaced,displacedBy:s.displacedBy,index:a})}const p=Io({isMovingForward:e,destination:o,displaced:s.displaced,draggables:r,combine:u.combine,afterCritical:c});return p==null?null:Ae({draggable:n,insideDestination:i,destination:o,viewport:l,last:s.displaced,displacedBy:s.displacedBy,index:p})},Eo=({displaced:e,afterCritical:t,combineWith:n,displacedBy:r})=>{const o=!!(e.visible[n]||e.invisible[n]);return Y(n,t)?o?T:te(r.point):o?r.point:T},Ao=({afterCritical:e,impact:t,draggables:n})=>{const r=Oe(t);r||b();const o=r.draggableId,i=n[o].page.borderBox.center,s=Eo({displaced:t.displaced,afterCritical:e,combineWith:o,displacedBy:t.displacedBy});return L(i,s)};const Dn=(e,t)=>t.margin[e.start]+t.borderBox[e.size]/2,wo=(e,t)=>t.margin[e.end]+t.borderBox[e.size]/2,dt=(e,t,n)=>t[e.crossAxisStart]+n.margin[e.crossAxisStart]+n.borderBox[e.crossAxisSize]/2,Ot=({axis:e,moveRelativeTo:t,isMoving:n})=>X(e.line,t.marginBox[e.end]+Dn(e,n),dt(e,t.marginBox,n)),Nt=({axis:e,moveRelativeTo:t,isMoving:n})=>X(e.line,t.marginBox[e.start]-wo(e,n),dt(e,t.marginBox,n)),Ro=({axis:e,moveInto:t,isMoving:n})=>X(e.line,t.contentBox[e.start]+Dn(e,n),dt(e,t.contentBox,n));var Po=({impact:e,draggable:t,draggables:n,droppable:r,afterCritical:o})=>{const i=ne(r.descriptor.id,n),s=t.page,l=r.axis;if(!i.length)return Ro({axis:l,moveInto:r.page,isMoving:s});const{displaced:c,displacedBy:u}=e,p=c.all[0];if(p){const d=n[p];if(Y(p,o))return Nt({axis:l,moveRelativeTo:d.page,isMoving:s});const f=Ie(d.page,u.point);return Nt({axis:l,moveRelativeTo:f,isMoving:s})}const a=i[i.length-1];if(a.descriptor.id===t.descriptor.id)return s.borderBox.center;if(Y(a.descriptor.id,o)){const d=Ie(a.page,te(o.displacedBy.point));return Ot({axis:l,moveRelativeTo:d,isMoving:s})}return Ot({axis:l,moveRelativeTo:a.page,isMoving:s})},Je=(e,t)=>{const n=e.frame;return n?L(t,n.scroll.diff.displacement):t};const Bo=({impact:e,draggable:t,droppable:n,draggables:r,afterCritical:o})=>{const i=t.page.borderBox.center,s=e.at;return!n||!s?i:s.type==="REORDER"?Po({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:o}):Ao({impact:e,draggables:r,afterCritical:o})};var Te=e=>{const t=Bo(e),n=e.droppable;return n?Je(n,t):t},yn=(e,t)=>{const n=W(t,e.scroll.initial),r=te(n);return{frame:U({top:t.y,bottom:t.y+e.frame.height,left:t.x,right:t.x+e.frame.width}),scroll:{initial:e.scroll.initial,max:e.scroll.max,current:t,diff:{value:n,displacement:r}}}};function Tt(e,t){return e.map(n=>t[n])}function Oo(e,t){for(let n=0;n<t.length;n++){const r=t[n].visible[e];if(r)return r}return null}var No=({impact:e,viewport:t,destination:n,draggables:r,maxScrollChange:o})=>{const i=yn(t,L(t.scroll.current,o)),s=n.frame?st(n,L(n.frame.scroll.current,o)):n,l=e.displaced,c=pe({afterDragging:Tt(l.all,r),destination:n,displacedBy:e.displacedBy,viewport:i.frame,last:l,forceShouldAnimate:!1}),u=pe({afterDragging:Tt(l.all,r),destination:s,displacedBy:e.displacedBy,viewport:t.frame,last:l,forceShouldAnimate:!1}),p={},a={},d=[l,c,u];return l.all.forEach(g=>{const m=Oo(g,d);if(m){a[g]=m;return}p[g]=!0}),{...e,displaced:{all:l.all,invisible:p,visible:a}}},To=(e,t)=>L(e.scroll.diff.displacement,t),ut=({pageBorderBoxCenter:e,draggable:t,viewport:n})=>{const r=To(n,e),o=W(r,t.page.borderBox.center);return L(t.client.borderBox.center,o)},xn=({draggable:e,destination:t,newPageBorderBoxCenter:n,viewport:r,withDroppableDisplacement:o,onlyOnMainAxis:i=!1})=>{const s=W(n,e.page.borderBox.center),c={target:be(e.page.borderBox,s),destination:t,withDroppableDisplacement:o,viewport:r};return i?vo(c):vn(c)},Lo=({isMovingForward:e,draggable:t,destination:n,draggables:r,previousImpact:o,viewport:i,previousPageBorderBoxCenter:s,previousClientSelection:l,afterCritical:c})=>{if(!n.isEnabled)return null;const u=ne(n.descriptor.id,r),p=re(t,n),a=co({isMovingForward:e,draggable:t,destination:n,insideDestination:u,previousImpact:o})||Co({isMovingForward:e,isInHomeList:p,draggable:t,draggables:r,destination:n,insideDestination:u,previousImpact:o,viewport:i,afterCritical:c});if(!a)return null;const d=Te({impact:a,draggable:t,droppable:n,draggables:r,afterCritical:c});if(xn({draggable:t,destination:n,newPageBorderBoxCenter:d,viewport:i.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:ut({pageBorderBoxCenter:d,draggable:t,viewport:i}),impact:a,scrollJumpRequest:null};const g=W(d,s),m=No({impact:a,viewport:i,destination:n,draggables:r,maxScrollChange:g});return{clientSelection:l,impact:m,scrollJumpRequest:g}};const M=e=>{const t=e.subject.active;return t||b(),t};var Go=({isMovingForward:e,pageBorderBoxCenter:t,source:n,droppables:r,viewport:o})=>{const i=n.subject.active;if(!i)return null;const s=n.axis,l=V(i[s.start],i[s.end]),c=Be(r).filter(p=>p!==n).filter(p=>p.isEnabled).filter(p=>!!p.subject.active).filter(p=>bn(o.frame)(M(p))).filter(p=>{const a=M(p);return e?i[s.crossAxisEnd]<a[s.crossAxisEnd]:a[s.crossAxisStart]<i[s.crossAxisStart]}).filter(p=>{const a=M(p),d=V(a[s.start],a[s.end]);return l(a[s.start])||l(a[s.end])||d(i[s.start])||d(i[s.end])}).sort((p,a)=>{const d=M(p)[s.crossAxisStart],f=M(a)[s.crossAxisStart];return e?d-f:f-d}).filter((p,a,d)=>M(p)[s.crossAxisStart]===M(d[0])[s.crossAxisStart]);if(!c.length)return null;if(c.length===1)return c[0];const u=c.filter(p=>V(M(p)[s.start],M(p)[s.end])(t[s.line]));return u.length===1?u[0]:u.length>1?u.sort((p,a)=>M(p)[s.start]-M(a)[s.start])[0]:c.sort((p,a)=>{const d=Rt(t,Pt(M(p))),f=Rt(t,Pt(M(a)));return d!==f?d-f:M(p)[s.start]-M(a)[s.start]})[0]};const Lt=(e,t)=>{const n=e.page.borderBox.center;return Y(e.descriptor.id,t)?W(n,t.displacedBy.point):n},Mo=(e,t)=>{const n=e.page.borderBox;return Y(e.descriptor.id,t)?be(n,te(t.displacedBy.point)):n};var Fo=({pageBorderBoxCenter:e,viewport:t,destination:n,insideDestination:r,afterCritical:o})=>r.filter(s=>vn({target:Mo(s,o),destination:n,viewport:t.frame,withDroppableDisplacement:!0})).sort((s,l)=>{const c=de(e,Je(n,Lt(s,o))),u=de(e,Je(n,Lt(l,o)));return c<u?-1:u<c?1:s.descriptor.index-l.descriptor.index})[0]||null,he=N(function(t,n){const r=n[t.line];return{value:r,point:X(t.line,r)}});const Wo=(e,t,n)=>{const r=e.axis;if(e.descriptor.mode==="virtual")return X(r.line,t[r.line]);const o=e.subject.page.contentBox[r.size],c=ne(e.descriptor.id,n).reduce((u,p)=>u+p.client.marginBox[r.size],0)+t[r.line]-o;return c<=0?null:X(r.line,c)},In=(e,t)=>({...e,scroll:{...e.scroll,max:t}}),Sn=(e,t,n)=>{const r=e.frame;re(t,e)&&b(),e.subject.withPlaceholder&&b();const o=he(e.axis,t.displaceBy).point,i=Wo(e,o,n),s={placeholderSize:o,increasedBy:i,oldFrameMaxScroll:e.frame?e.frame.scroll.max:null};if(!r){const p=Q({page:e.subject.page,withPlaceholder:s,axis:e.axis,frame:e.frame});return{...e,subject:p}}const l=i?L(r.scroll.max,i):r.scroll.max,c=In(r,l),u=Q({page:e.subject.page,withPlaceholder:s,axis:e.axis,frame:c});return{...e,subject:u,frame:c}},_o=e=>{const t=e.subject.withPlaceholder;t||b();const n=e.frame;if(!n){const s=Q({page:e.subject.page,axis:e.axis,frame:null,withPlaceholder:null});return{...e,subject:s}}const r=t.oldFrameMaxScroll;r||b();const o=In(n,r),i=Q({page:e.subject.page,axis:e.axis,frame:o,withPlaceholder:null});return{...e,subject:i,frame:o}};var $o=({previousPageBorderBoxCenter:e,moveRelativeTo:t,insideDestination:n,draggable:r,draggables:o,destination:i,viewport:s,afterCritical:l})=>{if(!t){if(n.length)return null;const a={displaced:ue,displacedBy:mn,at:{type:"REORDER",destination:{droppableId:i.descriptor.id,index:0}}},d=Te({impact:a,draggable:r,droppable:i,draggables:o,afterCritical:l}),f=re(r,i)?i:Sn(i,r,o);return xn({draggable:r,destination:f,newPageBorderBoxCenter:d,viewport:s.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0})?a:null}const c=e[i.axis.line]<=t.page.borderBox.center[i.axis.line],u=(()=>{const a=t.descriptor.index;return t.descriptor.id===r.descriptor.id||c?a:a+1})(),p=he(i.axis,r.displaceBy);return Ae({draggable:r,insideDestination:n,destination:i,viewport:s,displacedBy:p,last:ue,index:u})},ko=({isMovingForward:e,previousPageBorderBoxCenter:t,draggable:n,isOver:r,draggables:o,droppables:i,viewport:s,afterCritical:l})=>{const c=Go({isMovingForward:e,pageBorderBoxCenter:t,source:r,droppables:i,viewport:s});if(!c)return null;const u=ne(c.descriptor.id,o),p=Fo({pageBorderBoxCenter:t,viewport:s,destination:c,insideDestination:u,afterCritical:l}),a=$o({previousPageBorderBoxCenter:t,destination:c,draggable:n,draggables:o,moveRelativeTo:p,insideDestination:u,viewport:s,afterCritical:l});if(!a)return null;const d=Te({impact:a,draggable:n,droppable:c,draggables:o,afterCritical:l});return{clientSelection:ut({pageBorderBoxCenter:d,draggable:n,viewport:s}),impact:a,scrollJumpRequest:null}},_=e=>{const t=e.at;return t?t.type==="REORDER"?t.destination.droppableId:t.combine.droppableId:null};const Ho=(e,t)=>{const n=_(e);return n?t[n]:null};var jo=({state:e,type:t})=>{const n=Ho(e.impact,e.dimensions.droppables),r=!!n,o=e.dimensions.droppables[e.critical.droppable.id],i=n||o,s=i.axis.direction,l=s==="vertical"&&(t==="MOVE_UP"||t==="MOVE_DOWN")||s==="horizontal"&&(t==="MOVE_LEFT"||t==="MOVE_RIGHT");if(l&&!r)return null;const c=t==="MOVE_DOWN"||t==="MOVE_RIGHT",u=e.dimensions.draggables[e.critical.draggable.id],p=e.current.page.borderBoxCenter,{draggables:a,droppables:d}=e.dimensions;return l?Lo({isMovingForward:c,previousPageBorderBoxCenter:p,draggable:u,destination:i,draggables:a,viewport:e.viewport,previousClientSelection:e.current.client.selection,previousImpact:e.impact,afterCritical:e.afterCritical}):ko({isMovingForward:c,previousPageBorderBoxCenter:p,draggable:u,isOver:i,draggables:a,droppables:d,viewport:e.viewport,afterCritical:e.afterCritical})};function J(e){return e.phase==="DRAGGING"||e.phase==="COLLECTING"}function Cn(e){const t=V(e.top,e.bottom),n=V(e.left,e.right);return function(o){return t(o.y)&&n(o.x)}}function Vo(e,t){return e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top}function Uo({pageBorderBox:e,draggable:t,candidates:n}){const r=t.page.borderBox.center,o=n.map(i=>{const s=i.axis,l=X(i.axis.line,e.center[s.line],i.page.borderBox.center[s.crossAxisLine]);return{id:i.descriptor.id,distance:de(r,l)}}).sort((i,s)=>s.distance-i.distance);return o[0]?o[0].id:null}function zo({pageBorderBox:e,draggable:t,droppables:n}){const r=Be(n).filter(o=>{if(!o.isEnabled)return!1;const i=o.subject.active;if(!i||!Vo(e,i))return!1;if(Cn(i)(e.center))return!0;const s=o.axis,l=i.center[s.crossAxisLine],c=e[s.crossAxisStart],u=e[s.crossAxisEnd],p=V(i[s.crossAxisStart],i[s.crossAxisEnd]),a=p(c),d=p(u);return!a&&!d?!0:a?c<l:u>l});return r.length?r.length===1?r[0].descriptor.id:Uo({pageBorderBox:e,draggable:t,candidates:r}):null}const En=(e,t)=>U(be(e,t));var qo=(e,t)=>{const n=e.frame;return n?En(t,n.scroll.diff.value):t};function An({displaced:e,id:t}){return!!(e.visible[t]||e.invisible[t])}function Yo({draggable:e,closest:t,inHomeList:n}){return t?n&&t.descriptor.index>e.descriptor.index?t.descriptor.index-1:t.descriptor.index:null}var Ko=({pageBorderBoxWithDroppableScroll:e,draggable:t,destination:n,insideDestination:r,last:o,viewport:i,afterCritical:s})=>{const l=n.axis,c=he(n.axis,t.displaceBy),u=c.value,p=e[l.start],a=e[l.end],f=Ne(t,r).find(m=>{const h=m.descriptor.id,x=m.page.borderBox.center[l.line],C=Y(h,s),R=An({displaced:o,id:h});return C?R?a<=x:p<x-u:R?a<=x+u:p<x})||null,g=Yo({draggable:t,closest:f,inHomeList:re(t,n)});return Ae({draggable:t,insideDestination:r,destination:n,viewport:i,last:o,displacedBy:c,index:g})};const Jo=4;var Xo=({draggable:e,pageBorderBoxWithDroppableScroll:t,previousImpact:n,destination:r,insideDestination:o,afterCritical:i})=>{if(!r.isCombineEnabled)return null;const s=r.axis,l=he(r.axis,e.displaceBy),c=l.value,u=t[s.start],p=t[s.end],d=Ne(e,o).find(g=>{const m=g.descriptor.id,h=g.page.borderBox,C=h[s.size]/Jo,R=Y(m,i),D=An({displaced:n.displaced,id:m});return R?D?p>h[s.start]+C&&p<h[s.end]-C:u>h[s.start]-c+C&&u<h[s.end]-c-C:D?p>h[s.start]+c+C&&p<h[s.end]+c-C:u>h[s.start]+C&&u<h[s.end]-C});return d?{displacedBy:l,displaced:n.displaced,at:{type:"COMBINE",combine:{draggableId:d.descriptor.id,droppableId:r.descriptor.id}}}:null},wn=({pageOffset:e,draggable:t,draggables:n,droppables:r,previousImpact:o,viewport:i,afterCritical:s})=>{const l=En(t.page.borderBox,e),c=zo({pageBorderBox:l,draggable:t,droppables:r});if(!c)return uo;const u=r[c],p=ne(u.descriptor.id,n),a=qo(u,l);return Xo({pageBorderBoxWithDroppableScroll:a,draggable:t,previousImpact:o,destination:u,insideDestination:p,afterCritical:s})||Ko({pageBorderBoxWithDroppableScroll:a,draggable:t,destination:u,insideDestination:p,last:o.displaced,viewport:i,afterCritical:s})},pt=(e,t)=>({...e,[t.descriptor.id]:t});const Qo=({previousImpact:e,impact:t,droppables:n})=>{const r=_(e),o=_(t);if(!r||r===o)return n;const i=n[r];if(!i.subject.withPlaceholder)return n;const s=_o(i);return pt(n,s)};var Zo=({draggable:e,draggables:t,droppables:n,previousImpact:r,impact:o})=>{const i=Qo({previousImpact:r,impact:o,droppables:n}),s=_(o);if(!s)return i;const l=n[s];if(re(e,l)||l.subject.withPlaceholder)return i;const c=Sn(l,e,t);return pt(i,c)},le=({state:e,clientSelection:t,dimensions:n,viewport:r,impact:o,scrollJumpRequest:i})=>{const s=r||e.viewport,l=n||e.dimensions,c=t||e.current.client.selection,u=W(c,e.initial.client.selection),p={offset:u,selection:c,borderBoxCenter:L(e.initial.client.borderBoxCenter,u)},a={selection:L(p.selection,s.scroll.current),borderBoxCenter:L(p.borderBoxCenter,s.scroll.current),offset:L(p.offset,s.scroll.diff.value)},d={client:p,page:a};if(e.phase==="COLLECTING")return{...e,dimensions:l,viewport:s,current:d};const f=l.draggables[e.critical.draggable.id],g=o||wn({pageOffset:a.offset,draggable:f,draggables:l.draggables,droppables:l.droppables,previousImpact:e.impact,viewport:s,afterCritical:e.afterCritical}),m=Zo({draggable:f,impact:g,previousImpact:e.impact,draggables:l.draggables,droppables:l.droppables});return{...e,current:d,dimensions:{draggables:l.draggables,droppables:m},impact:g,viewport:s,scrollJumpRequest:i||null,forceShouldAnimate:i?!1:null}};function ei(e,t){return e.map(n=>t[n])}var Rn=({impact:e,viewport:t,draggables:n,destination:r,forceShouldAnimate:o})=>{const i=e.displaced,s=ei(i.all,n),l=pe({afterDragging:s,destination:r,displacedBy:e.displacedBy,viewport:t.frame,forceShouldAnimate:o,last:i});return{...e,displaced:l}},Pn=({impact:e,draggable:t,droppable:n,draggables:r,viewport:o,afterCritical:i})=>{const s=Te({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:i});return ut({pageBorderBoxCenter:s,draggable:t,viewport:o})},Bn=({state:e,dimensions:t,viewport:n})=>{e.movementMode!=="SNAP"&&b();const r=e.impact,o=n||e.viewport,i=t||e.dimensions,{draggables:s,droppables:l}=i,c=s[e.critical.draggable.id],u=_(r);u||b();const p=l[u],a=Rn({impact:r,viewport:o,destination:p,draggables:s}),d=Pn({impact:a,draggable:c,droppable:p,draggables:s,viewport:o,afterCritical:e.afterCritical});return le({impact:a,clientSelection:d,state:e,dimensions:i,viewport:o})},ti=e=>({index:e.index,droppableId:e.droppableId}),On=({draggable:e,home:t,draggables:n,viewport:r})=>{const o=he(t.axis,e.displaceBy),i=ne(t.descriptor.id,n),s=i.indexOf(e);s===-1&&b();const l=i.slice(s+1),c=l.reduce((d,f)=>(d[f.descriptor.id]=!0,d),{}),u={inVirtualList:t.descriptor.mode==="virtual",displacedBy:o,effected:c};return{impact:{displaced:pe({afterDragging:l,destination:t,displacedBy:o,last:null,viewport:r.frame,forceShouldAnimate:!1}),displacedBy:o,at:{type:"REORDER",destination:ti(e.descriptor)}},afterCritical:u}},ni=(e,t)=>({draggables:e.draggables,droppables:pt(e.droppables,t)}),ri=({draggable:e,offset:t,initialWindowScroll:n})=>{const r=Ie(e.client,t),o=Se(r,n);return{...e,placeholder:{...e.placeholder,client:r},client:r,page:o}},oi=e=>{const t=e.frame;return t||b(),t},ii=({additions:e,updatedDroppables:t,viewport:n})=>{const r=n.scroll.diff.value;return e.map(o=>{const i=o.descriptor.droppableId,s=t[i],c=oi(s).scroll.diff.value,u=L(r,c);return ri({draggable:o,offset:u,initialWindowScroll:n.scroll.initial})})},si=({state:e,published:t})=>{const n=t.modified.map(x=>{const C=e.dimensions.droppables[x.droppableId];return st(C,x.scroll)}),r={...e.dimensions.droppables,...fn(n)},o=gn(ii({additions:t.additions,updatedDroppables:r,viewport:e.viewport})),i={...e.dimensions.draggables,...o};t.removals.forEach(x=>{delete i[x]});const s={droppables:r,draggables:i},l=_(e.impact),c=l?s.droppables[l]:null,u=s.draggables[e.critical.draggable.id],p=s.droppables[e.critical.droppable.id],{impact:a,afterCritical:d}=On({draggable:u,home:p,draggables:i,viewport:e.viewport}),f=c&&c.isCombineEnabled?e.impact:a,g=wn({pageOffset:e.current.page.offset,draggable:s.draggables[e.critical.draggable.id],draggables:s.draggables,droppables:s.droppables,previousImpact:f,viewport:e.viewport,afterCritical:d}),m={...e,phase:"DRAGGING",impact:g,onLiftImpact:a,dimensions:s,afterCritical:d,forceShouldAnimate:!1};return e.phase==="COLLECTING"?m:{...m,phase:"DROP_PENDING",reason:e.reason,isWaiting:!1}};const Xe=e=>e.movementMode==="SNAP",ke=(e,t,n)=>{const r=ni(e.dimensions,t);return!Xe(e)||n?le({state:e,dimensions:r}):Bn({state:e,dimensions:r})};function He(e){return e.isDragging&&e.movementMode==="SNAP"?{...e,scrollJumpRequest:null}:e}const Gt={phase:"IDLE",completed:null,shouldFlush:!1};var li=(e=Gt,t)=>{if(t.type==="FLUSH")return{...Gt,shouldFlush:!0};if(t.type==="INITIAL_PUBLISH"){e.phase!=="IDLE"&&b();const{critical:n,clientSelection:r,viewport:o,dimensions:i,movementMode:s}=t.payload,l=i.draggables[n.draggable.id],c=i.droppables[n.droppable.id],u={selection:r,borderBoxCenter:l.client.borderBox.center,offset:T},p={client:u,page:{selection:L(u.selection,o.scroll.initial),borderBoxCenter:L(u.selection,o.scroll.initial),offset:L(u.selection,o.scroll.diff.value)}},a=Be(i.droppables).every(m=>!m.isFixedOnPage),{impact:d,afterCritical:f}=On({draggable:l,home:c,draggables:i.draggables,viewport:o});return{phase:"DRAGGING",isDragging:!0,critical:n,movementMode:s,dimensions:i,initial:p,current:p,isWindowScrollAllowed:a,impact:d,afterCritical:f,onLiftImpact:d,viewport:o,scrollJumpRequest:null,forceShouldAnimate:null}}if(t.type==="COLLECTION_STARTING")return e.phase==="COLLECTING"||e.phase==="DROP_PENDING"?e:(e.phase!=="DRAGGING"&&b(),{...e,phase:"COLLECTING"});if(t.type==="PUBLISH_WHILE_DRAGGING")return e.phase==="COLLECTING"||e.phase==="DROP_PENDING"||b(),si({state:e,published:t.payload});if(t.type==="MOVE"){if(e.phase==="DROP_PENDING")return e;J(e)||b();const{client:n}=t.payload;return q(n,e.current.client.selection)?e:le({state:e,clientSelection:n,impact:Xe(e)?e.impact:null})}if(t.type==="UPDATE_DROPPABLE_SCROLL"){if(e.phase==="DROP_PENDING"||e.phase==="COLLECTING")return He(e);J(e)||b();const{id:n,newScroll:r}=t.payload,o=e.dimensions.droppables[n];if(!o)return e;const i=st(o,r);return ke(e,i,!1)}if(t.type==="UPDATE_DROPPABLE_IS_ENABLED"){if(e.phase==="DROP_PENDING")return e;J(e)||b();const{id:n,isEnabled:r}=t.payload,o=e.dimensions.droppables[n];o||b(),o.isEnabled===r&&b();const i={...o,isEnabled:r};return ke(e,i,!0)}if(t.type==="UPDATE_DROPPABLE_IS_COMBINE_ENABLED"){if(e.phase==="DROP_PENDING")return e;J(e)||b();const{id:n,isCombineEnabled:r}=t.payload,o=e.dimensions.droppables[n];o||b(),o.isCombineEnabled===r&&b();const i={...o,isCombineEnabled:r};return ke(e,i,!0)}if(t.type==="MOVE_BY_WINDOW_SCROLL"){if(e.phase==="DROP_PENDING"||e.phase==="DROP_ANIMATING")return e;J(e)||b(),e.isWindowScrollAllowed||b();const n=t.payload.newScroll;if(q(e.viewport.scroll.current,n))return He(e);const r=yn(e.viewport,n);return Xe(e)?Bn({state:e,viewport:r}):le({state:e,viewport:r})}if(t.type==="UPDATE_VIEWPORT_MAX_SCROLL"){if(!J(e))return e;const n=t.payload.maxScroll;if(q(n,e.viewport.scroll.max))return e;const r={...e.viewport,scroll:{...e.viewport.scroll,max:n}};return{...e,viewport:r}}if(t.type==="MOVE_UP"||t.type==="MOVE_DOWN"||t.type==="MOVE_LEFT"||t.type==="MOVE_RIGHT"){if(e.phase==="COLLECTING"||e.phase==="DROP_PENDING")return e;e.phase!=="DRAGGING"&&b();const n=jo({state:e,type:t.type});return n?le({state:e,impact:n.impact,clientSelection:n.clientSelection,scrollJumpRequest:n.scrollJumpRequest}):e}if(t.type==="DROP_PENDING"){const n=t.payload.reason;return e.phase!=="COLLECTING"&&b(),{...e,phase:"DROP_PENDING",isWaiting:!0,reason:n}}if(t.type==="DROP_ANIMATE"){const{completed:n,dropDuration:r,newHomeClientOffset:o}=t.payload;return e.phase==="DRAGGING"||e.phase==="DROP_PENDING"||b(),{phase:"DROP_ANIMATING",completed:n,dropDuration:r,newHomeClientOffset:o,dimensions:e.dimensions}}if(t.type==="DROP_COMPLETE"){const{completed:n}=t.payload;return{phase:"IDLE",completed:n,shouldFlush:!1}}return e};function w(e,t){return e instanceof Object&&"type"in e&&e.type===t}const ai=e=>({type:"BEFORE_INITIAL_CAPTURE",payload:e}),ci=e=>({type:"LIFT",payload:e}),di=e=>({type:"INITIAL_PUBLISH",payload:e}),ui=e=>({type:"PUBLISH_WHILE_DRAGGING",payload:e}),pi=()=>({type:"COLLECTION_STARTING",payload:null}),fi=e=>({type:"UPDATE_DROPPABLE_SCROLL",payload:e}),gi=e=>({type:"UPDATE_DROPPABLE_IS_ENABLED",payload:e}),mi=e=>({type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:e}),Nn=e=>({type:"MOVE",payload:e}),bi=e=>({type:"MOVE_BY_WINDOW_SCROLL",payload:e}),hi=e=>({type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:e}),vi=()=>({type:"MOVE_UP",payload:null}),Di=()=>({type:"MOVE_DOWN",payload:null}),yi=()=>({type:"MOVE_RIGHT",payload:null}),xi=()=>({type:"MOVE_LEFT",payload:null}),ft=()=>({type:"FLUSH",payload:null}),Ii=e=>({type:"DROP_ANIMATE",payload:e}),gt=e=>({type:"DROP_COMPLETE",payload:e}),Tn=e=>({type:"DROP",payload:e}),Si=e=>({type:"DROP_PENDING",payload:e}),Ln=()=>({type:"DROP_ANIMATION_FINISHED",payload:null});var Ci=e=>({getState:t,dispatch:n})=>r=>o=>{if(!w(o,"LIFT")){r(o);return}const{id:i,clientSelection:s,movementMode:l}=o.payload,c=t();c.phase==="DROP_ANIMATING"&&n(gt({completed:c.completed})),t().phase!=="IDLE"&&b(),n(ft()),n(ai({draggableId:i,movementMode:l}));const p={draggableId:i,scrollOptions:{shouldPublishImmediately:l==="SNAP"}},{critical:a,dimensions:d,viewport:f}=e.startPublishing(p);n(di({critical:a,dimensions:d,clientSelection:s,movementMode:l,viewport:f}))},Ei=e=>()=>t=>n=>{w(n,"INITIAL_PUBLISH")&&e.dragging(),w(n,"DROP_ANIMATE")&&e.dropping(n.payload.completed.result.reason),(w(n,"FLUSH")||w(n,"DROP_COMPLETE"))&&e.resting(),t(n)};const mt={outOfTheWay:"cubic-bezier(0.2, 0, 0, 1)",drop:"cubic-bezier(.2,1,.1,1)"},fe={opacity:{drop:0,combining:.7},scale:{drop:.75}},Gn={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},K=`${Gn.outOfTheWay}s ${mt.outOfTheWay}`,ae={fluid:`opacity ${K}`,snap:`transform ${K}, opacity ${K}`,drop:e=>{const t=`${e}s ${mt.drop}`;return`transform ${t}, opacity ${t}`},outOfTheWay:`transform ${K}`,placeholder:`height ${K}, width ${K}, margin ${K}`},Mt=e=>q(e,T)?void 0:`translate(${e.x}px, ${e.y}px)`,Qe={moveTo:Mt,drop:(e,t)=>{const n=Mt(e);if(n)return t?`${n} scale(${fe.scale.drop})`:n}},{minDropTime:Ze,maxDropTime:Mn}=Gn,Ai=Mn-Ze,Ft=1500,wi=.6;var Ri=({current:e,destination:t,reason:n})=>{const r=de(e,t);if(r<=0)return Ze;if(r>=Ft)return Mn;const o=r/Ft,i=Ze+Ai*o,s=n==="CANCEL"?i*wi:i;return Number(s.toFixed(2))},Pi=({impact:e,draggable:t,dimensions:n,viewport:r,afterCritical:o})=>{const{draggables:i,droppables:s}=n,l=_(e),c=l?s[l]:null,u=s[t.descriptor.droppableId],p=Pn({impact:e,draggable:t,draggables:i,afterCritical:o,droppable:c||u,viewport:r});return W(p,t.client.borderBox.center)},Bi=({draggables:e,reason:t,lastImpact:n,home:r,viewport:o,onLiftImpact:i})=>!n.at||t!=="DROP"?{impact:Rn({draggables:e,impact:i,destination:r,viewport:o,forceShouldAnimate:!0}),didDropInsideDroppable:!1}:n.at.type==="REORDER"?{impact:n,didDropInsideDroppable:!0}:{impact:{...n,displaced:ue},didDropInsideDroppable:!0};const Oi=({getState:e,dispatch:t})=>n=>r=>{if(!w(r,"DROP")){n(r);return}const o=e(),i=r.payload.reason;if(o.phase==="COLLECTING"){t(Si({reason:i}));return}if(o.phase==="IDLE")return;o.phase==="DROP_PENDING"&&o.isWaiting&&b(),o.phase==="DRAGGING"||o.phase==="DROP_PENDING"||b();const l=o.critical,c=o.dimensions,u=c.draggables[o.critical.draggable.id],{impact:p,didDropInsideDroppable:a}=Bi({reason:i,lastImpact:o.impact,afterCritical:o.afterCritical,onLiftImpact:o.onLiftImpact,home:o.dimensions.droppables[o.critical.droppable.id],viewport:o.viewport,draggables:o.dimensions.draggables}),d=a?lt(p):null,f=a?Oe(p):null,g={index:l.draggable.index,droppableId:l.droppable.id},m={draggableId:u.descriptor.id,type:u.descriptor.type,source:g,reason:i,mode:o.movementMode,destination:d,combine:f},h=Pi({impact:p,draggable:u,dimensions:c,viewport:o.viewport,afterCritical:o.afterCritical}),x={critical:o.critical,afterCritical:o.afterCritical,result:m,impact:p};if(!(!q(o.current.client.offset,h)||!!m.combine)){t(gt({completed:x}));return}const R=Ri({current:o.current.client.offset,destination:h,reason:i});t(Ii({newHomeClientOffset:h,dropDuration:R,completed:x}))};var Fn=()=>({x:window.pageXOffset,y:window.pageYOffset});function Ni(e){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:t=>{t.target!==window&&t.target!==window.document||e()}}}function Ti({onWindowScroll:e}){function t(){e(Fn())}const n=ce(t),r=Ni(n);let o=z;function i(){return o!==z}function s(){i()&&b(),o=j(window,[r])}function l(){i()||b(),n.cancel(),o(),o=z}return{start:s,stop:l,isActive:i}}const Li=e=>w(e,"DROP_COMPLETE")||w(e,"DROP_ANIMATE")||w(e,"FLUSH"),Gi=e=>{const t=Ti({onWindowScroll:n=>{e.dispatch(bi({newScroll:n}))}});return n=>r=>{!t.isActive()&&w(r,"INITIAL_PUBLISH")&&t.start(),t.isActive()&&Li(r)&&t.stop(),n(r)}};var Mi=e=>{let t=!1,n=!1;const r=setTimeout(()=>{n=!0}),o=i=>{t||n||(t=!0,e(i),clearTimeout(r))};return o.wasCalled=()=>t,o},Fi=()=>{const e=[],t=o=>{const i=e.findIndex(l=>l.timerId===o);i===-1&&b();const[s]=e.splice(i,1);s.callback()};return{add:o=>{const i=setTimeout(()=>t(i)),s={timerId:i,callback:o};e.push(s)},flush:()=>{if(!e.length)return;const o=[...e];e.length=0,o.forEach(i=>{clearTimeout(i.timerId),i.callback()})}}};const Wi=(e,t)=>e==null&&t==null?!0:e==null||t==null?!1:e.droppableId===t.droppableId&&e.index===t.index,_i=(e,t)=>e==null&&t==null?!0:e==null||t==null?!1:e.draggableId===t.draggableId&&e.droppableId===t.droppableId,$i=(e,t)=>{if(e===t)return!0;const n=e.draggable.id===t.draggable.id&&e.draggable.droppableId===t.draggable.droppableId&&e.draggable.type===t.draggable.type&&e.draggable.index===t.draggable.index,r=e.droppable.id===t.droppable.id&&e.droppable.type===t.droppable.type;return n&&r},oe=(e,t)=>{t()},ve=(e,t)=>({draggableId:e.draggable.id,type:e.droppable.type,source:{droppableId:e.droppable.id,index:e.draggable.index},mode:t});function je(e,t,n,r){if(!e){n(r(t));return}const o=Mi(n);e(t,{announce:o}),o.wasCalled()||n(r(t))}var ki=(e,t)=>{const n=Fi();let r=null;const o=(a,d)=>{r&&b(),oe("onBeforeCapture",()=>{const f=e().onBeforeCapture;f&&f({draggableId:a,mode:d})})},i=(a,d)=>{r&&b(),oe("onBeforeDragStart",()=>{const f=e().onBeforeDragStart;f&&f(ve(a,d))})},s=(a,d)=>{r&&b();const f=ve(a,d);r={mode:d,lastCritical:a,lastLocation:f.source,lastCombine:null},n.add(()=>{oe("onDragStart",()=>je(e().onDragStart,f,t,xe.onDragStart))})},l=(a,d)=>{const f=lt(d),g=Oe(d);r||b();const m=!$i(a,r.lastCritical);m&&(r.lastCritical=a);const h=!Wi(r.lastLocation,f);h&&(r.lastLocation=f);const x=!_i(r.lastCombine,g);if(x&&(r.lastCombine=g),!m&&!h&&!x)return;const C={...ve(a,r.mode),combine:g,destination:f};n.add(()=>{oe("onDragUpdate",()=>je(e().onDragUpdate,C,t,xe.onDragUpdate))})},c=()=>{r||b(),n.flush()},u=a=>{r||b(),r=null,oe("onDragEnd",()=>je(e().onDragEnd,a,t,xe.onDragEnd))};return{beforeCapture:o,beforeStart:i,start:s,update:l,flush:c,drop:u,abort:()=>{if(!r)return;const a={...ve(r.lastCritical,r.mode),combine:null,destination:null,reason:"CANCEL"};u(a)}}},Hi=(e,t)=>{const n=ki(e,t);return r=>o=>i=>{if(w(i,"BEFORE_INITIAL_CAPTURE")){n.beforeCapture(i.payload.draggableId,i.payload.movementMode);return}if(w(i,"INITIAL_PUBLISH")){const l=i.payload.critical;n.beforeStart(l,i.payload.movementMode),o(i),n.start(l,i.payload.movementMode);return}if(w(i,"DROP_COMPLETE")){const l=i.payload.completed.result;n.flush(),o(i),n.drop(l);return}if(o(i),w(i,"FLUSH")){n.abort();return}const s=r.getState();s.phase==="DRAGGING"&&n.update(s.critical,s.impact)}};const ji=e=>t=>n=>{if(!w(n,"DROP_ANIMATION_FINISHED")){t(n);return}const r=e.getState();r.phase!=="DROP_ANIMATING"&&b(),e.dispatch(gt({completed:r.completed}))},Vi=e=>{let t=null,n=null;function r(){n&&(cancelAnimationFrame(n),n=null),t&&(t(),t=null)}return o=>i=>{if((w(i,"FLUSH")||w(i,"DROP_COMPLETE")||w(i,"DROP_ANIMATION_FINISHED"))&&r(),o(i),!w(i,"DROP_ANIMATE"))return;const s={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){e.getState().phase==="DROP_ANIMATING"&&e.dispatch(Ln())}};n=requestAnimationFrame(()=>{n=null,t=j(window,[s])})}};var Ui=e=>()=>t=>n=>{(w(n,"DROP_COMPLETE")||w(n,"FLUSH")||w(n,"DROP_ANIMATE"))&&e.stopPublishing(),t(n)},zi=e=>{let t=!1;return()=>n=>r=>{if(w(r,"INITIAL_PUBLISH")){t=!0,e.tryRecordFocus(r.payload.critical.draggable.id),n(r),e.tryRestoreFocusRecorded();return}if(n(r),!!t){if(w(r,"FLUSH")){t=!1,e.tryRestoreFocusRecorded();return}if(w(r,"DROP_COMPLETE")){t=!1;const o=r.payload.completed.result;o.combine&&e.tryShiftRecord(o.draggableId,o.combine.draggableId),e.tryRestoreFocusRecorded()}}}};const qi=e=>w(e,"DROP_COMPLETE")||w(e,"DROP_ANIMATE")||w(e,"FLUSH");var Yi=e=>t=>n=>r=>{if(qi(r)){e.stop(),n(r);return}if(w(r,"INITIAL_PUBLISH")){n(r);const o=t.getState();o.phase!=="DRAGGING"&&b(),e.start(o);return}n(r),e.scroll(t.getState())};const Ki=e=>t=>n=>{if(t(n),!w(n,"PUBLISH_WHILE_DRAGGING"))return;const r=e.getState();r.phase==="DROP_PENDING"&&(r.isWaiting||e.dispatch(Tn({reason:r.reason})))},Ji=gr;var Xi=({dimensionMarshal:e,focusMarshal:t,styleMarshal:n,getResponders:r,announce:o,autoScroller:i})=>pr(li,Ji(mr(Ei(n),Ui(e),Ci(e),Oi,ji,Vi,Ki,Yi(i),Gi,zi(t),Hi(r,o))));const Ve=()=>({additions:{},removals:{},modified:{}});function Qi({registry:e,callbacks:t}){let n=Ve(),r=null;const o=()=>{r||(t.collectionStarting(),r=requestAnimationFrame(()=>{r=null;const{additions:c,removals:u,modified:p}=n,a=Object.keys(c).map(g=>e.draggable.getById(g).getDimension(T)).sort((g,m)=>g.descriptor.index-m.descriptor.index),d=Object.keys(p).map(g=>{const h=e.droppable.getById(g).callbacks.getScrollWhileDragging();return{droppableId:g,scroll:h}}),f={additions:a,removals:Object.keys(u),modified:d};n=Ve(),t.publish(f)}))};return{add:c=>{const u=c.descriptor.id;n.additions[u]=c,n.modified[c.descriptor.droppableId]=!0,n.removals[u]&&delete n.removals[u],o()},remove:c=>{const u=c.descriptor;n.removals[u.id]=!0,n.modified[u.droppableId]=!0,n.additions[u.id]&&delete n.additions[u.id],o()},stop:()=>{r&&(cancelAnimationFrame(r),r=null,n=Ve())}}}var Wn=({scrollHeight:e,scrollWidth:t,height:n,width:r})=>{const o=W({x:t,y:e},{x:r,y:n});return{x:Math.max(0,o.x),y:Math.max(0,o.y)}},_n=()=>{const e=document.documentElement;return e||b(),e},$n=()=>{const e=_n();return Wn({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight})},Zi=()=>{const e=Fn(),t=$n(),n=e.y,r=e.x,o=_n(),i=o.clientWidth,s=o.clientHeight,l=r+i,c=n+s;return{frame:U({top:n,left:r,right:l,bottom:c}),scroll:{initial:e,current:e,max:t,diff:{value:T,displacement:T}}}},es=({critical:e,scrollOptions:t,registry:n})=>{const r=Zi(),o=r.scroll.current,i=e.droppable,s=n.droppable.getAllByType(i.type).map(p=>p.callbacks.getDimensionAndWatchScroll(o,t)),l=n.draggable.getAllByType(e.draggable.type).map(p=>p.getDimension(o));return{dimensions:{draggables:gn(l),droppables:fn(s)},critical:e,viewport:r}};function Wt(e,t,n){return!(n.descriptor.id===t.id||n.descriptor.type!==t.type||e.droppable.getById(n.descriptor.droppableId).descriptor.mode!=="virtual")}var ts=(e,t)=>{let n=null;const r=Qi({callbacks:{publish:t.publishWhileDragging,collectionStarting:t.collectionStarting},registry:e}),o=(d,f)=>{e.droppable.exists(d)||b(),n&&t.updateDroppableIsEnabled({id:d,isEnabled:f})},i=(d,f)=>{n&&(e.droppable.exists(d)||b(),t.updateDroppableIsCombineEnabled({id:d,isCombineEnabled:f}))},s=(d,f)=>{n&&(e.droppable.exists(d)||b(),t.updateDroppableScroll({id:d,newScroll:f}))},l=(d,f)=>{n&&e.droppable.getById(d).callbacks.scroll(f)},c=()=>{if(!n)return;r.stop();const d=n.critical.droppable;e.droppable.getAllByType(d.type).forEach(f=>f.callbacks.dragStopped()),n.unsubscribe(),n=null},u=d=>{n||b();const f=n.critical.draggable;d.type==="ADDITION"&&Wt(e,f,d.value)&&r.add(d.value),d.type==="REMOVAL"&&Wt(e,f,d.value)&&r.remove(d.value)};return{updateDroppableIsEnabled:o,updateDroppableIsCombineEnabled:i,scrollDroppable:l,updateDroppableScroll:s,startPublishing:d=>{n&&b();const f=e.draggable.getById(d.draggableId),g=e.droppable.getById(f.descriptor.droppableId),m={draggable:f.descriptor,droppable:g.descriptor},h=e.subscribe(u);return n={critical:m,unsubscribe:h},es({critical:m,registry:e,scrollOptions:d.scrollOptions})},stopPublishing:c}},kn=(e,t)=>e.phase==="IDLE"?!0:e.phase!=="DROP_ANIMATING"||e.completed.result.draggableId===t?!1:e.completed.result.reason==="DROP",ns=e=>{window.scrollBy(e.x,e.y)};const rs=N(e=>Be(e).filter(t=>!(!t.isEnabled||!t.frame))),os=(e,t)=>rs(t).find(r=>(r.frame||b(),Cn(r.frame.pageMarginBox)(e)))||null;var is=({center:e,destination:t,droppables:n})=>{if(t){const o=n[t];return o.frame?o:null}return os(e,n)};const ge={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:e=>e**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360},disabled:!1};var ss=(e,t,n=()=>ge)=>{const r=n(),o=e[t.size]*r.startFromPercentage,i=e[t.size]*r.maxScrollAtPercentage;return{startScrollingFrom:o,maxScrollValueAt:i}},Hn=({startOfRange:e,endOfRange:t,current:n})=>{const r=t-e;return r===0?0:(n-e)/r},bt=1,ls=(e,t,n=()=>ge)=>{const r=n();if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return r.maxPixelScroll;if(e===t.startScrollingFrom)return bt;const i=1-Hn({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e}),s=r.maxPixelScroll*r.ease(i);return Math.ceil(s)},as=(e,t,n)=>{const r=n(),o=r.durationDampening.accelerateAt,i=r.durationDampening.stopDampeningAt,s=t,l=i,u=Date.now()-s;if(u>=i)return e;if(u<o)return bt;const p=Hn({startOfRange:o,endOfRange:l,current:u}),a=e*r.ease(p);return Math.ceil(a)},_t=({distanceToEdge:e,thresholds:t,dragStartTime:n,shouldUseTimeDampening:r,getAutoScrollerOptions:o})=>{const i=ls(e,t,o);return i===0?0:r?Math.max(as(i,n,o),bt):i},$t=({container:e,distanceToEdges:t,dragStartTime:n,axis:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const s=ss(e,r,i);return t[r.end]<t[r.start]?_t({distanceToEdge:t[r.end],thresholds:s,dragStartTime:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i}):-1*_t({distanceToEdge:t[r.start],thresholds:s,dragStartTime:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i})},cs=({container:e,subject:t,proposedScroll:n})=>{const r=t.height>e.height,o=t.width>e.width;return!o&&!r?n:o&&r?null:{x:o?0:n.x,y:r?0:n.y}};const ds=pn(e=>e===0?0:e);var jn=({dragStartTime:e,container:t,subject:n,center:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const s={top:r.y-t.top,right:t.right-r.x,bottom:t.bottom-r.y,left:r.x-t.left},l=$t({container:t,distanceToEdges:s,dragStartTime:e,axis:at,shouldUseTimeDampening:o,getAutoScrollerOptions:i}),c=$t({container:t,distanceToEdges:s,dragStartTime:e,axis:hn,shouldUseTimeDampening:o,getAutoScrollerOptions:i}),u=ds({x:c,y:l});if(q(u,T))return null;const p=cs({container:t,subject:n,proposedScroll:u});return p?q(p,T)?null:p:null};const us=pn(e=>e===0?0:e>0?1:-1),ht=(()=>{const e=(t,n)=>t<0?t:t>n?t-n:0;return({current:t,max:n,change:r})=>{const o=L(t,r),i={x:e(o.x,n.x),y:e(o.y,n.y)};return q(i,T)?null:i}})(),Vn=({max:e,current:t,change:n})=>{const r={x:Math.max(t.x,e.x),y:Math.max(t.y,e.y)},o=us(n),i=ht({max:r,current:t,change:o});return!i||o.x!==0&&i.x===0||o.y!==0&&i.y===0},vt=(e,t)=>Vn({current:e.scroll.current,max:e.scroll.max,change:t}),ps=(e,t)=>{if(!vt(e,t))return null;const n=e.scroll.max,r=e.scroll.current;return ht({current:r,max:n,change:t})},Dt=(e,t)=>{const n=e.frame;return n?Vn({current:n.scroll.current,max:n.scroll.max,change:t}):!1},fs=(e,t)=>{const n=e.frame;return!n||!Dt(e,t)?null:ht({current:n.scroll.current,max:n.scroll.max,change:t})};var gs=({viewport:e,subject:t,center:n,dragStartTime:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const s=jn({dragStartTime:r,container:e.frame,subject:t,center:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i});return s&&vt(e,s)?s:null},ms=({droppable:e,subject:t,center:n,dragStartTime:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const s=e.frame;if(!s)return null;const l=jn({dragStartTime:r,container:s.pageMarginBox,subject:t,center:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i});return l&&Dt(e,l)?l:null},kt=({state:e,dragStartTime:t,shouldUseTimeDampening:n,scrollWindow:r,scrollDroppable:o,getAutoScrollerOptions:i})=>{const s=e.current.page.borderBoxCenter,c=e.dimensions.draggables[e.critical.draggable.id].page.marginBox;if(e.isWindowScrollAllowed){const a=e.viewport,d=gs({dragStartTime:t,viewport:a,subject:c,center:s,shouldUseTimeDampening:n,getAutoScrollerOptions:i});if(d){r(d);return}}const u=is({center:s,destination:_(e.impact),droppables:e.dimensions.droppables});if(!u)return;const p=ms({dragStartTime:t,droppable:u,subject:c,center:s,shouldUseTimeDampening:n,getAutoScrollerOptions:i});p&&o(u.descriptor.id,p)},bs=({scrollWindow:e,scrollDroppable:t,getAutoScrollerOptions:n=()=>ge})=>{const r=ce(e),o=ce(t);let i=null;const s=u=>{i||b();const{shouldUseTimeDampening:p,dragStartTime:a}=i;kt({state:u,scrollWindow:r,scrollDroppable:o,dragStartTime:a,shouldUseTimeDampening:p,getAutoScrollerOptions:n})};return{start:u=>{i&&b();const p=Date.now();let a=!1;const d=()=>{a=!0};kt({state:u,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:d,scrollDroppable:d,getAutoScrollerOptions:n}),i={dragStartTime:p,shouldUseTimeDampening:a},a&&s(u)},stop:()=>{i&&(r.cancel(),o.cancel(),i=null)},scroll:s}},hs=({move:e,scrollDroppable:t,scrollWindow:n})=>{const r=(l,c)=>{const u=L(l.current.client.selection,c);e({client:u})},o=(l,c)=>{if(!Dt(l,c))return c;const u=fs(l,c);if(!u)return t(l.descriptor.id,c),null;const p=W(c,u);return t(l.descriptor.id,p),W(c,p)},i=(l,c,u)=>{if(!l||!vt(c,u))return u;const p=ps(c,u);if(!p)return n(u),null;const a=W(u,p);return n(a),W(u,a)};return l=>{const c=l.scrollJumpRequest;if(!c)return;const u=_(l.impact);u||b();const p=o(l.dimensions.droppables[u],c);if(!p)return;const a=l.viewport,d=i(l.isWindowScrollAllowed,a,p);d&&r(l,d)}},vs=({scrollDroppable:e,scrollWindow:t,move:n,getAutoScrollerOptions:r})=>{const o=bs({scrollWindow:t,scrollDroppable:e,getAutoScrollerOptions:r}),i=hs({move:n,scrollWindow:t,scrollDroppable:e});return{scroll:c=>{if(!(r().disabled||c.phase!=="DRAGGING")){if(c.movementMode==="FLUID"){o.scroll(c);return}c.scrollJumpRequest&&i(c)}},start:o.start,stop:o.stop}};const Z="data-rfd",ee=(()=>{const e=`${Z}-drag-handle`;return{base:e,draggableId:`${e}-draggable-id`,contextId:`${e}-context-id`}})(),et=(()=>{const e=`${Z}-draggable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),Ds=(()=>{const e=`${Z}-droppable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),Ht={contextId:`${Z}-scroll-container-context-id`},ys=e=>t=>`[${t}="${e}"]`,ie=(e,t)=>e.map(n=>{const r=n.styles[t];return r?`${n.selector} { ${r} }`:""}).join(" "),xs="pointer-events: none;";var Is=e=>{const t=ys(e),n=(()=>{const l=`
      cursor: -webkit-grab;
      cursor: grab;
    `;return{selector:t(ee.contextId),styles:{always:`
          -webkit-touch-callout: none;
          -webkit-tap-highlight-color: rgba(0,0,0,0);
          touch-action: manipulation;
        `,resting:l,dragging:xs,dropAnimating:l}}})(),r=(()=>{const l=`
      transition: ${ae.outOfTheWay};
    `;return{selector:t(et.contextId),styles:{dragging:l,dropAnimating:l,userCancel:l}}})(),o={selector:t(Ds.contextId),styles:{always:"overflow-anchor: none;"}},s=[r,n,o,{selector:"body",styles:{dragging:`
        cursor: grabbing;
        cursor: -webkit-grabbing;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        overflow-anchor: none;
      `}}];return{always:ie(s,"always"),resting:ie(s,"resting"),dragging:ie(s,"dragging"),dropAnimating:ie(s,"dropAnimating"),userCancel:ie(s,"userCancel")}};const $=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?I.useLayoutEffect:I.useEffect,Ue=()=>{const e=document.querySelector("head");return e||b(),e},jt=e=>{const t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.type="text/css",t};function Ss(e,t){const n=A(()=>Is(e),[e]),r=I.useRef(null),o=I.useRef(null),i=v(N(a=>{const d=o.current;d||b(),d.textContent=a}),[]),s=v(a=>{const d=r.current;d||b(),d.textContent=a},[]);$(()=>{!r.current&&!o.current||b();const a=jt(t),d=jt(t);return r.current=a,o.current=d,a.setAttribute(`${Z}-always`,e),d.setAttribute(`${Z}-dynamic`,e),Ue().appendChild(a),Ue().appendChild(d),s(n.always),i(n.resting),()=>{const f=g=>{const m=g.current;m||b(),Ue().removeChild(m),g.current=null};f(r),f(o)}},[t,s,i,n.always,n.resting,e]);const l=v(()=>i(n.dragging),[i,n.dragging]),c=v(a=>{if(a==="DROP"){i(n.dropAnimating);return}i(n.userCancel)},[i,n.dropAnimating,n.userCancel]),u=v(()=>{o.current&&i(n.resting)},[i,n.resting]);return A(()=>({dragging:l,dropping:c,resting:u}),[l,c,u])}function Un(e,t){return Array.from(e.querySelectorAll(t))}var zn=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:window;function Le(e){return e instanceof zn(e).HTMLElement}function Cs(e,t){const n=`[${ee.contextId}="${e}"]`,r=Un(document,n);if(!r.length)return null;const o=r.find(i=>i.getAttribute(ee.draggableId)===t);return!o||!Le(o)?null:o}function Es(e){const t=I.useRef({}),n=I.useRef(null),r=I.useRef(null),o=I.useRef(!1),i=v(function(d,f){const g={id:d,focus:f};return t.current[d]=g,function(){const h=t.current;h[d]!==g&&delete h[d]}},[]),s=v(function(d){const f=Cs(e,d);f&&f!==document.activeElement&&f.focus()},[e]),l=v(function(d,f){n.current===d&&(n.current=f)},[]),c=v(function(){r.current||o.current&&(r.current=requestAnimationFrame(()=>{r.current=null;const d=n.current;d&&s(d)}))},[s]),u=v(function(d){n.current=null;const f=document.activeElement;f&&f.getAttribute(ee.draggableId)===d&&(n.current=d)},[]);return $(()=>(o.current=!0,function(){o.current=!1;const d=r.current;d&&cancelAnimationFrame(d)}),[]),A(()=>({register:i,tryRecordFocus:u,tryRestoreFocusRecorded:c,tryShiftRecord:l}),[i,u,c,l])}function As(){const e={draggables:{},droppables:{}},t=[];function n(a){return t.push(a),function(){const f=t.indexOf(a);f!==-1&&t.splice(f,1)}}function r(a){t.length&&t.forEach(d=>d(a))}function o(a){return e.draggables[a]||null}function i(a){const d=o(a);return d||b(),d}const s={register:a=>{e.draggables[a.descriptor.id]=a,r({type:"ADDITION",value:a})},update:(a,d)=>{const f=e.draggables[d.descriptor.id];f&&f.uniqueId===a.uniqueId&&(delete e.draggables[d.descriptor.id],e.draggables[a.descriptor.id]=a)},unregister:a=>{const d=a.descriptor.id,f=o(d);f&&a.uniqueId===f.uniqueId&&(delete e.draggables[d],e.droppables[a.descriptor.droppableId]&&r({type:"REMOVAL",value:a}))},getById:i,findById:o,exists:a=>!!o(a),getAllByType:a=>Object.values(e.draggables).filter(d=>d.descriptor.type===a)};function l(a){return e.droppables[a]||null}function c(a){const d=l(a);return d||b(),d}const u={register:a=>{e.droppables[a.descriptor.id]=a},unregister:a=>{const d=l(a.descriptor.id);d&&a.uniqueId===d.uniqueId&&delete e.droppables[a.descriptor.id]},getById:c,findById:l,exists:a=>!!l(a),getAllByType:a=>Object.values(e.droppables).filter(d=>d.descriptor.type===a)};function p(){e.draggables={},e.droppables={},t.length=0}return{draggable:s,droppable:u,subscribe:n,clean:p}}function ws(){const e=A(As,[]);return I.useEffect(()=>function(){e.clean()},[e]),e}var yt=P.createContext(null),we=()=>{const e=document.body;return e||b(),e};const Rs={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},Ps=e=>`rfd-announcement-${e}`;function Bs(e){const t=A(()=>Ps(e),[e]),n=I.useRef(null);return I.useEffect(function(){const i=document.createElement("div");return n.current=i,i.id=t,i.setAttribute("aria-live","assertive"),i.setAttribute("aria-atomic","true"),en(i.style,Rs),we().appendChild(i),function(){setTimeout(function(){const c=we();c.contains(i)&&c.removeChild(i),i===n.current&&(n.current=null)})}},[t]),v(o=>{const i=n.current;if(i){i.textContent=o;return}},[])}const Os={separator:"::"};function xt(e,t=Os){const n=P.useId();return A(()=>`${e}${t.separator}${n}`,[t.separator,e,n])}function Ns({contextId:e,uniqueId:t}){return`rfd-hidden-text-${e}-${t}`}function Ts({contextId:e,text:t}){const n=xt("hidden-text",{separator:"-"}),r=A(()=>Ns({contextId:e,uniqueId:n}),[n,e]);return I.useEffect(function(){const i=document.createElement("div");return i.id=r,i.textContent=t,i.style.display="none",we().appendChild(i),function(){const l=we();l.contains(i)&&l.removeChild(i)}},[r,t]),r}var Ge=P.createContext(null);function qn(e){const t=I.useRef(e);return I.useEffect(()=>{t.current=e}),t}function Ls(){let e=null;function t(){return!!e}function n(s){return s===e}function r(s){e&&b();const l={abandon:s};return e=l,l}function o(){e||b(),e=null}function i(){e&&(e.abandon(),o())}return{isClaimed:t,isActive:n,claim:r,release:o,tryAbandon:i}}function me(e){return e.phase==="IDLE"||e.phase==="DROP_ANIMATING"?!1:e.isDragging}const Gs=9,Ms=13,It=27,Yn=32,Fs=33,Ws=34,_s=35,$s=36,ks=37,Hs=38,js=39,Vs=40,Us={[Ms]:!0,[Gs]:!0};var Kn=e=>{Us[e.keyCode]&&e.preventDefault()};const Me=(()=>{const e="visibilitychange";return typeof document>"u"?e:[e,`ms${e}`,`webkit${e}`,`moz${e}`,`o${e}`].find(r=>`on${r}`in document)||e})(),Jn=0,Vt=5;function zs(e,t){return Math.abs(t.x-e.x)>=Vt||Math.abs(t.y-e.y)>=Vt}const Ut={type:"IDLE"};function qs({cancel:e,completed:t,getPhase:n,setPhase:r}){return[{eventName:"mousemove",fn:o=>{const{button:i,clientX:s,clientY:l}=o;if(i!==Jn)return;const c={x:s,y:l},u=n();if(u.type==="DRAGGING"){o.preventDefault(),u.actions.move(c);return}u.type!=="PENDING"&&b();const p=u.point;if(!zs(p,c))return;o.preventDefault();const a=u.actions.fluidLift(c);r({type:"DRAGGING",actions:a})}},{eventName:"mouseup",fn:o=>{const i=n();if(i.type!=="DRAGGING"){e();return}o.preventDefault(),i.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"mousedown",fn:o=>{n().type==="DRAGGING"&&o.preventDefault(),e()}},{eventName:"keydown",fn:o=>{if(n().type==="PENDING"){e();return}if(o.keyCode===It){o.preventDefault(),e();return}Kn(o)}},{eventName:"resize",fn:e},{eventName:"scroll",options:{passive:!0,capture:!1},fn:()=>{n().type==="PENDING"&&e()}},{eventName:"webkitmouseforcedown",fn:o=>{const i=n();if(i.type==="IDLE"&&b(),i.actions.shouldRespectForcePress()){e();return}o.preventDefault()}},{eventName:Me,fn:e}]}function Ys(e){const t=I.useRef(Ut),n=I.useRef(z),r=A(()=>({eventName:"mousedown",fn:function(a){if(a.defaultPrevented||a.button!==Jn||a.ctrlKey||a.metaKey||a.shiftKey||a.altKey)return;const d=e.findClosestDraggableId(a);if(!d)return;const f=e.tryGetLock(d,s,{sourceEvent:a});if(!f)return;a.preventDefault();const g={x:a.clientX,y:a.clientY};n.current(),u(f,g)}}),[e]),o=A(()=>({eventName:"webkitmouseforcewillbegin",fn:p=>{if(p.defaultPrevented)return;const a=e.findClosestDraggableId(p);if(!a)return;const d=e.findOptionsForDraggable(a);d&&(d.shouldRespectForcePress||e.canGetLock(a)&&p.preventDefault())}}),[e]),i=v(function(){const a={passive:!1,capture:!0};n.current=j(window,[o,r],a)},[o,r]),s=v(()=>{t.current.type!=="IDLE"&&(t.current=Ut,n.current(),i())},[i]),l=v(()=>{const p=t.current;s(),p.type==="DRAGGING"&&p.actions.cancel({shouldBlockNextClick:!0}),p.type==="PENDING"&&p.actions.abort()},[s]),c=v(function(){const a={capture:!0,passive:!1},d=qs({cancel:l,completed:s,getPhase:()=>t.current,setPhase:f=>{t.current=f}});n.current=j(window,d,a)},[l,s]),u=v(function(a,d){t.current.type!=="IDLE"&&b(),t.current={type:"PENDING",point:d,actions:a},c()},[c]);$(function(){return i(),function(){n.current()}},[i])}function Ks(){}const Js={[Ws]:!0,[Fs]:!0,[$s]:!0,[_s]:!0};function Xs(e,t){function n(){t(),e.cancel()}function r(){t(),e.drop()}return[{eventName:"keydown",fn:o=>{if(o.keyCode===It){o.preventDefault(),n();return}if(o.keyCode===Yn){o.preventDefault(),r();return}if(o.keyCode===Vs){o.preventDefault(),e.moveDown();return}if(o.keyCode===Hs){o.preventDefault(),e.moveUp();return}if(o.keyCode===js){o.preventDefault(),e.moveRight();return}if(o.keyCode===ks){o.preventDefault(),e.moveLeft();return}if(Js[o.keyCode]){o.preventDefault();return}Kn(o)}},{eventName:"mousedown",fn:n},{eventName:"mouseup",fn:n},{eventName:"click",fn:n},{eventName:"touchstart",fn:n},{eventName:"resize",fn:n},{eventName:"wheel",fn:n,options:{passive:!0}},{eventName:Me,fn:n}]}function Qs(e){const t=I.useRef(Ks),n=A(()=>({eventName:"keydown",fn:function(i){if(i.defaultPrevented||i.keyCode!==Yn)return;const s=e.findClosestDraggableId(i);if(!s)return;const l=e.tryGetLock(s,p,{sourceEvent:i});if(!l)return;i.preventDefault();let c=!0;const u=l.snapLift();t.current();function p(){c||b(),c=!1,t.current(),r()}t.current=j(window,Xs(u,p),{capture:!0,passive:!1})}}),[e]),r=v(function(){const i={passive:!1,capture:!0};t.current=j(window,[n],i)},[n]);$(function(){return r(),function(){t.current()}},[r])}const ze={type:"IDLE"},Zs=120,el=.15;function tl({cancel:e,getPhase:t}){return[{eventName:"orientationchange",fn:e},{eventName:"resize",fn:e},{eventName:"contextmenu",fn:n=>{n.preventDefault()}},{eventName:"keydown",fn:n=>{if(t().type!=="DRAGGING"){e();return}n.keyCode===It&&n.preventDefault(),e()}},{eventName:Me,fn:e}]}function nl({cancel:e,completed:t,getPhase:n}){return[{eventName:"touchmove",options:{capture:!1},fn:r=>{const o=n();if(o.type!=="DRAGGING"){e();return}o.hasMoved=!0;const{clientX:i,clientY:s}=r.touches[0],l={x:i,y:s};r.preventDefault(),o.actions.move(l)}},{eventName:"touchend",fn:r=>{const o=n();if(o.type!=="DRAGGING"){e();return}r.preventDefault(),o.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"touchcancel",fn:r=>{if(n().type!=="DRAGGING"){e();return}r.preventDefault(),e()}},{eventName:"touchforcechange",fn:r=>{const o=n();o.type==="IDLE"&&b();const i=r.touches[0];if(!i||!(i.force>=el))return;const l=o.actions.shouldRespectForcePress();if(o.type==="PENDING"){l&&e();return}if(l){if(o.hasMoved){r.preventDefault();return}e();return}r.preventDefault()}},{eventName:Me,fn:e}]}function rl(e){const t=I.useRef(ze),n=I.useRef(z),r=v(function(){return t.current},[]),o=v(function(f){t.current=f},[]),i=A(()=>({eventName:"touchstart",fn:function(f){if(f.defaultPrevented)return;const g=e.findClosestDraggableId(f);if(!g)return;const m=e.tryGetLock(g,l,{sourceEvent:f});if(!m)return;const h=f.touches[0],{clientX:x,clientY:C}=h,R={x,y:C};n.current(),a(m,R)}}),[e]),s=v(function(){const f={capture:!0,passive:!1};n.current=j(window,[i],f)},[i]),l=v(()=>{const d=t.current;d.type!=="IDLE"&&(d.type==="PENDING"&&clearTimeout(d.longPressTimerId),o(ze),n.current(),s())},[s,o]),c=v(()=>{const d=t.current;l(),d.type==="DRAGGING"&&d.actions.cancel({shouldBlockNextClick:!0}),d.type==="PENDING"&&d.actions.abort()},[l]),u=v(function(){const f={capture:!0,passive:!1},g={cancel:c,completed:l,getPhase:r},m=j(window,nl(g),f),h=j(window,tl(g),f);n.current=function(){m(),h()}},[c,r,l]),p=v(function(){const f=r();f.type!=="PENDING"&&b();const g=f.actions.fluidLift(f.point);o({type:"DRAGGING",actions:g,hasMoved:!1})},[r,o]),a=v(function(f,g){r().type!=="IDLE"&&b();const m=setTimeout(p,Zs);o({type:"PENDING",point:g,actions:f,longPressTimerId:m}),u()},[u,r,o,p]);$(function(){return s(),function(){n.current();const g=r();g.type==="PENDING"&&(clearTimeout(g.longPressTimerId),o(ze))}},[r,s,o]),$(function(){return j(window,[{eventName:"touchmove",fn:()=>{},options:{capture:!1,passive:!1}}])},[])}const ol=["input","button","textarea","select","option","optgroup","video","audio"];function Xn(e,t){if(t==null)return!1;if(ol.includes(t.tagName.toLowerCase()))return!0;const r=t.getAttribute("contenteditable");return r==="true"||r===""?!0:t===e?!1:Xn(e,t.parentElement)}function il(e,t){const n=t.target;return Le(n)?Xn(e,n):!1}var sl=e=>U(e.getBoundingClientRect()).center;function ll(e){return e instanceof zn(e).Element}const al=(()=>{const e="matches";return typeof document>"u"?e:[e,"msMatchesSelector","webkitMatchesSelector"].find(r=>r in Element.prototype)||e})();function Qn(e,t){return e==null?null:e[al](t)?e:Qn(e.parentElement,t)}function cl(e,t){return e.closest?e.closest(t):Qn(e,t)}function dl(e){return`[${ee.contextId}="${e}"]`}function ul(e,t){const n=t.target;if(!ll(n))return null;const r=dl(e),o=cl(n,r);return!o||!Le(o)?null:o}function pl(e,t){const n=ul(e,t);return n?n.getAttribute(ee.draggableId):null}function fl(e,t){const n=`[${et.contextId}="${e}"]`,o=Un(document,n).find(i=>i.getAttribute(et.id)===t);return!o||!Le(o)?null:o}function gl(e){e.preventDefault()}function De({expected:e,phase:t,isLockActive:n,shouldWarn:r}){return!(!n()||e!==t)}function Zn({lockAPI:e,store:t,registry:n,draggableId:r}){if(e.isClaimed())return!1;const o=n.draggable.findById(r);return!(!o||!o.options.isEnabled||!kn(t.getState(),r))}function ml({lockAPI:e,contextId:t,store:n,registry:r,draggableId:o,forceSensorStop:i,sourceEvent:s}){if(!Zn({lockAPI:e,store:n,registry:r,draggableId:o}))return null;const c=r.draggable.getById(o),u=fl(t,c.descriptor.id);if(!u||s&&!c.options.canDragInteractiveElements&&il(u,s))return null;const p=e.claim(i||z);let a="PRE_DRAG";function d(){return c.options.shouldRespectForcePress}function f(){return e.isActive(p)}function g(S,E){De({expected:S,phase:a,isLockActive:f,shouldWarn:!0})&&n.dispatch(E())}const m=g.bind(null,"DRAGGING");function h(S){function E(){e.release(),a="COMPLETED"}a!=="PRE_DRAG"&&(E(),b()),n.dispatch(ci(S.liftActionArgs)),a="DRAGGING";function B(O,k={shouldBlockNextClick:!1}){if(S.cleanup(),k.shouldBlockNextClick){const G=j(window,[{eventName:"click",fn:gl,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(G)}E(),n.dispatch(Tn({reason:O}))}return{isActive:()=>De({expected:"DRAGGING",phase:a,isLockActive:f,shouldWarn:!1}),shouldRespectForcePress:d,drop:O=>B("DROP",O),cancel:O=>B("CANCEL",O),...S.actions}}function x(S){const E=ce(O=>{m(()=>Nn({client:O}))});return{...h({liftActionArgs:{id:o,clientSelection:S,movementMode:"FLUID"},cleanup:()=>E.cancel(),actions:{move:E}}),move:E}}function C(){const S={moveUp:()=>m(vi),moveRight:()=>m(yi),moveDown:()=>m(Di),moveLeft:()=>m(xi)};return h({liftActionArgs:{id:o,clientSelection:sl(u),movementMode:"SNAP"},cleanup:z,actions:S})}function R(){De({expected:"PRE_DRAG",phase:a,isLockActive:f,shouldWarn:!0})&&e.release()}return{isActive:()=>De({expected:"PRE_DRAG",phase:a,isLockActive:f,shouldWarn:!1}),shouldRespectForcePress:d,fluidLift:x,snapLift:C,abort:R}}const bl=[Ys,Qs,rl];function hl({contextId:e,store:t,registry:n,customSensors:r,enableDefaultSensors:o}){const i=[...o?bl:[],...r||[]],s=I.useState(()=>Ls())[0],l=v(function(h,x){me(h)&&!me(x)&&s.tryAbandon()},[s]);$(function(){let h=t.getState();return t.subscribe(()=>{const C=t.getState();l(h,C),h=C})},[s,t,l]),$(()=>s.tryAbandon,[s.tryAbandon]);const c=v(m=>Zn({lockAPI:s,registry:n,store:t,draggableId:m}),[s,n,t]),u=v((m,h,x)=>ml({lockAPI:s,registry:n,contextId:e,store:t,draggableId:m,forceSensorStop:h||null,sourceEvent:x&&x.sourceEvent?x.sourceEvent:null}),[e,s,n,t]),p=v(m=>pl(e,m),[e]),a=v(m=>{const h=n.draggable.findById(m);return h?h.options:null},[n.draggable]),d=v(function(){s.isClaimed()&&(s.tryAbandon(),t.getState().phase!=="IDLE"&&t.dispatch(ft()))},[s,t]),f=v(()=>s.isClaimed(),[s]),g=A(()=>({canGetLock:c,tryGetLock:u,findClosestDraggableId:p,findOptionsForDraggable:a,tryReleaseLock:d,isLockClaimed:f}),[c,u,p,a,d,f]);for(let m=0;m<i.length;m++)i[m](g)}const vl=e=>({onBeforeCapture:t=>{const n=()=>{e.onBeforeCapture&&e.onBeforeCapture(t)};tn.flushSync(n)},onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragEnd:e.onDragEnd,onDragUpdate:e.onDragUpdate}),Dl=e=>({...ge,...e.autoScrollerOptions,durationDampening:{...ge.durationDampening,...e.autoScrollerOptions}});function se(e){return e.current||b(),e.current}function yl(e){const{contextId:t,setCallbacks:n,sensors:r,nonce:o,dragHandleUsageInstructions:i}=e,s=I.useRef(null),l=qn(e),c=v(()=>vl(l.current),[l]),u=v(()=>Dl(l.current),[l]),p=Bs(t),a=Ts({contextId:t,text:i}),d=Ss(t,o),f=v(G=>{se(s).dispatch(G)},[]),g=A(()=>Ct({publishWhileDragging:ui,updateDroppableScroll:fi,updateDroppableIsEnabled:gi,updateDroppableIsCombineEnabled:mi,collectionStarting:pi},f),[f]),m=ws(),h=A(()=>ts(m,g),[m,g]),x=A(()=>vs({scrollWindow:ns,scrollDroppable:h.scrollDroppable,getAutoScrollerOptions:u,...Ct({move:Nn},f)}),[h.scrollDroppable,f,u]),C=Es(t),R=A(()=>Xi({announce:p,autoScroller:x,dimensionMarshal:h,focusMarshal:C,getResponders:c,styleMarshal:d}),[p,x,h,C,c,d]);s.current=R;const D=v(()=>{const G=se(s);G.getState().phase!=="IDLE"&&G.dispatch(ft())},[]),S=v(()=>{const G=se(s).getState();return G.phase==="DROP_ANIMATING"?!0:G.phase==="IDLE"?!1:G.isDragging},[]),E=A(()=>({isDragging:S,tryAbort:D}),[S,D]);n(E);const B=v(G=>kn(se(s).getState(),G),[]),O=v(()=>J(se(s).getState()),[]),k=A(()=>({marshal:h,focus:C,contextId:t,canLift:B,isMovementAllowed:O,dragHandleUsageInstructionsId:a,registry:m}),[t,h,a,C,B,O,m]);return hl({contextId:t,store:R,registry:m,customSensors:r||null,enableDefaultSensors:e.enableDefaultSensors!==!1}),I.useEffect(()=>D,[D]),P.createElement(Ge.Provider,{value:k},P.createElement(ur,{context:yt,store:R},e.children))}function xl(){return P.useId()}function Il(e){const t=xl(),n=e.dragHandleUsageInstructions||xe.dragHandleUsageInstructions;return P.createElement(Qr,null,r=>P.createElement(yl,{nonce:e.nonce,contextId:t,setCallbacks:r,dragHandleUsageInstructions:n,enableDefaultSensors:e.enableDefaultSensors,sensors:e.sensors,onBeforeCapture:e.onBeforeCapture,onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragUpdate:e.onDragUpdate,onDragEnd:e.onDragEnd,autoScrollerOptions:e.autoScrollerOptions},e.children))}const zt={dragging:5e3,dropAnimating:4500},Sl=(e,t)=>t?ae.drop(t.duration):e?ae.snap:ae.fluid,Cl=(e,t)=>{if(e)return t?fe.opacity.drop:fe.opacity.combining},El=e=>e.forceShouldAnimate!=null?e.forceShouldAnimate:e.mode==="SNAP";function Al(e){const n=e.dimension.client,{offset:r,combineWith:o,dropping:i}=e,s=!!o,l=El(e),c=!!i,u=c?Qe.drop(r,s):Qe.moveTo(r);return{position:"fixed",top:n.marginBox.top,left:n.marginBox.left,boxSizing:"border-box",width:n.borderBox.width,height:n.borderBox.height,transition:Sl(l,i),transform:u,opacity:Cl(s,c),zIndex:c?zt.dropAnimating:zt.dragging,pointerEvents:"none"}}function wl(e){return{transform:Qe.moveTo(e.offset),transition:e.shouldAnimateDisplacement?void 0:"none"}}function Rl(e){return e.type==="DRAGGING"?Al(e):wl(e)}function Pl(e,t,n=T){const r=window.getComputedStyle(t),o=t.getBoundingClientRect(),i=ln(o,r),s=Se(i,n),l={client:i,tagName:t.tagName.toLowerCase(),display:r.display},c={x:i.marginBox.width,y:i.marginBox.height};return{descriptor:e,placeholder:l,displaceBy:c,client:i,page:s}}function Bl(e){const t=xt("draggable"),{descriptor:n,registry:r,getDraggableRef:o,canDragInteractiveElements:i,shouldRespectForcePress:s,isEnabled:l}=e,c=A(()=>({canDragInteractiveElements:i,shouldRespectForcePress:s,isEnabled:l}),[i,l,s]),u=v(f=>{const g=o();return g||b(),Pl(n,g,f)},[n,o]),p=A(()=>({uniqueId:t,descriptor:n,options:c,getDimension:u}),[n,u,c,t]),a=I.useRef(p),d=I.useRef(!0);$(()=>(r.draggable.register(a.current),()=>r.draggable.unregister(a.current)),[r.draggable]),$(()=>{if(d.current){d.current=!1;return}const f=a.current;a.current=p,r.draggable.update(p,f)},[p,r.draggable])}var St=P.createContext(null);function Re(e){const t=I.useContext(e);return t||b(),t}function Ol(e){e.preventDefault()}const Nl=e=>{const t=I.useRef(null),n=v((E=null)=>{t.current=E},[]),r=v(()=>t.current,[]),{contextId:o,dragHandleUsageInstructionsId:i,registry:s}=Re(Ge),{type:l,droppableId:c}=Re(St),u=A(()=>({id:e.draggableId,index:e.index,type:l,droppableId:c}),[e.draggableId,e.index,l,c]),{children:p,draggableId:a,isEnabled:d,shouldRespectForcePress:f,canDragInteractiveElements:g,isClone:m,mapped:h,dropAnimationFinished:x}=e;if(!m){const E=A(()=>({descriptor:u,registry:s,getDraggableRef:r,canDragInteractiveElements:g,shouldRespectForcePress:f,isEnabled:d}),[u,s,r,g,f,d]);Bl(E)}const C=A(()=>d?{tabIndex:0,role:"button","aria-describedby":i,"data-rfd-drag-handle-draggable-id":a,"data-rfd-drag-handle-context-id":o,draggable:!1,onDragStart:Ol}:null,[o,i,a,d]),R=v(E=>{h.type==="DRAGGING"&&h.dropping&&E.propertyName==="transform"&&tn.flushSync(x)},[x,h]),D=A(()=>{const E=Rl(h),B=h.type==="DRAGGING"&&h.dropping?R:void 0;return{innerRef:n,draggableProps:{"data-rfd-draggable-context-id":o,"data-rfd-draggable-id":a,style:E,onTransitionEnd:B},dragHandleProps:C}},[o,C,a,h,R,n]),S=A(()=>({draggableId:u.id,type:u.type,source:{index:u.index,droppableId:u.droppableId}}),[u.droppableId,u.id,u.index,u.type]);return P.createElement(P.Fragment,null,p(D,h.snapshot,S))};var er=(e,t)=>e===t,tr=e=>{const{combine:t,destination:n}=e;return n?n.droppableId:t?t.droppableId:null};const Tl=e=>e.combine?e.combine.draggableId:null,Ll=e=>e.at&&e.at.type==="COMBINE"?e.at.combine.draggableId:null;function Gl(){const e=N((o,i)=>({x:o,y:i})),t=N((o,i,s=null,l=null,c=null)=>({isDragging:!0,isClone:i,isDropAnimating:!!c,dropAnimation:c,mode:o,draggingOver:s,combineWith:l,combineTargetFor:null})),n=N((o,i,s,l,c=null,u=null,p=null)=>({mapped:{type:"DRAGGING",dropping:null,draggingOver:c,combineWith:u,mode:i,offset:o,dimension:s,forceShouldAnimate:p,snapshot:t(i,l,c,u,null)}}));return(o,i)=>{if(me(o)){if(o.critical.draggable.id!==i.draggableId)return null;const s=o.current.client.offset,l=o.dimensions.draggables[i.draggableId],c=_(o.impact),u=Ll(o.impact),p=o.forceShouldAnimate;return n(e(s.x,s.y),o.movementMode,l,i.isClone,c,u,p)}if(o.phase==="DROP_ANIMATING"){const s=o.completed;if(s.result.draggableId!==i.draggableId)return null;const l=i.isClone,c=o.dimensions.draggables[i.draggableId],u=s.result,p=u.mode,a=tr(u),d=Tl(u),g={duration:o.dropDuration,curve:mt.drop,moveTo:o.newHomeClientOffset,opacity:d?fe.opacity.drop:null,scale:d?fe.scale.drop:null};return{mapped:{type:"DRAGGING",offset:o.newHomeClientOffset,dimension:c,dropping:g,draggingOver:a,combineWith:d,mode:p,forceShouldAnimate:null,snapshot:t(p,l,a,d,g)}}}return null}}function nr(e=null){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}const Ml={mapped:{type:"SECONDARY",offset:T,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:nr(null)}};function Fl(){const e=N((s,l)=>({x:s,y:l})),t=N(nr),n=N((s,l=null,c)=>({mapped:{type:"SECONDARY",offset:s,combineTargetFor:l,shouldAnimateDisplacement:c,snapshot:t(l)}})),r=s=>s?n(T,s,!0):null,o=(s,l,c,u)=>{const p=c.displaced.visible[s],a=!!(u.inVirtualList&&u.effected[s]),d=Oe(c),f=d&&d.draggableId===s?l:null;if(!p){if(!a)return r(f);if(c.displaced.invisible[s])return null;const h=te(u.displacedBy.point),x=e(h.x,h.y);return n(x,f,!0)}if(a)return r(f);const g=c.displacedBy.point,m=e(g.x,g.y);return n(m,f,p.shouldAnimate)};return(s,l)=>{if(me(s))return s.critical.draggable.id===l.draggableId?null:o(l.draggableId,s.critical.draggable.id,s.impact,s.afterCritical);if(s.phase==="DROP_ANIMATING"){const c=s.completed;return c.result.draggableId===l.draggableId?null:o(l.draggableId,c.result.draggableId,c.impact,c.afterCritical)}return null}}const Wl=()=>{const e=Gl(),t=Fl();return(r,o)=>e(r,o)||t(r,o)||Ml},_l={dropAnimationFinished:Ln},$l=Zt(Wl,_l,null,{context:yt,areStatePropsEqual:er})(Nl);function rr(e){return Re(St).isUsingCloneFor===e.draggableId&&!e.isClone?null:P.createElement($l,e)}function kl(e){const t=typeof e.isDragDisabled=="boolean"?!e.isDragDisabled:!0,n=!!e.disableInteractiveElementBlocking,r=!!e.shouldRespectForcePress;return P.createElement(rr,en({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:n,shouldRespectForcePress:r}))}const or=e=>t=>e===t,Hl=or("scroll"),jl=or("auto"),qt=(e,t)=>t(e.overflowX)||t(e.overflowY),Vl=e=>{const t=window.getComputedStyle(e),n={overflowX:t.overflowX,overflowY:t.overflowY};return qt(n,Hl)||qt(n,jl)},Ul=()=>!1,ir=e=>e==null?null:e===document.body?Ul()?e:null:e===document.documentElement?null:Vl(e)?e:ir(e.parentElement);var tt=e=>({x:e.scrollLeft,y:e.scrollTop});const sr=e=>e?window.getComputedStyle(e).position==="fixed"?!0:sr(e.parentElement):!1;var zl=e=>{const t=ir(e),n=sr(e);return{closestScrollable:t,isFixedOnPage:n}},ql=({descriptor:e,isEnabled:t,isCombineEnabled:n,isFixedOnPage:r,direction:o,client:i,page:s,closest:l})=>{const c=(()=>{if(!l)return null;const{scrollSize:d,client:f}=l,g=Wn({scrollHeight:d.scrollHeight,scrollWidth:d.scrollWidth,height:f.paddingBox.height,width:f.paddingBox.width});return{pageMarginBox:l.page.marginBox,frameClient:f,scrollSize:d,shouldClipSubject:l.shouldClipSubject,scroll:{initial:l.scroll,current:l.scroll,max:g,diff:{value:T,displacement:T}}}})(),u=o==="vertical"?at:hn,p=Q({page:s,withPlaceholder:null,axis:u,frame:c});return{descriptor:e,isCombineEnabled:n,isFixedOnPage:r,axis:u,isEnabled:t,client:i,page:s,frame:c,subject:p}};const Yl=(e,t)=>{const n=an(e);if(!t||e!==t)return n;const r=n.paddingBox.top-t.scrollTop,o=n.paddingBox.left-t.scrollLeft,i=r+t.scrollHeight,s=o+t.scrollWidth,c=ot({top:r,right:s,bottom:i,left:o},n.border);return it({borderBox:c,margin:n.margin,border:n.border,padding:n.padding})};var Kl=({ref:e,descriptor:t,env:n,windowScroll:r,direction:o,isDropDisabled:i,isCombineEnabled:s,shouldClipSubject:l})=>{const c=n.closestScrollable,u=Yl(e,c),p=Se(u,r),a=(()=>{if(!c)return null;const f=an(c),g={scrollHeight:c.scrollHeight,scrollWidth:c.scrollWidth};return{client:f,page:Se(f,r),scroll:tt(c),scrollSize:g,shouldClipSubject:l}})();return ql({descriptor:t,isEnabled:!i,isCombineEnabled:s,isFixedOnPage:n.isFixedOnPage,direction:o,client:u,page:p,closest:a})};const Jl={passive:!1},Xl={passive:!0};var Yt=e=>e.shouldPublishImmediately?Jl:Xl;const ye=e=>e&&e.env.closestScrollable||null;function Ql(e){const t=I.useRef(null),n=Re(Ge),r=xt("droppable"),{registry:o,marshal:i}=n,s=qn(e),l=A(()=>({id:e.droppableId,type:e.type,mode:e.mode}),[e.droppableId,e.mode,e.type]),c=I.useRef(l),u=A(()=>N((D,S)=>{t.current||b();const E={x:D,y:S};i.updateDroppableScroll(l.id,E)}),[l.id,i]),p=v(()=>{const D=t.current;return!D||!D.env.closestScrollable?T:tt(D.env.closestScrollable)},[]),a=v(()=>{const D=p();u(D.x,D.y)},[p,u]),d=A(()=>ce(a),[a]),f=v(()=>{const D=t.current,S=ye(D);if(D&&S||b(),D.scrollOptions.shouldPublishImmediately){a();return}d()},[d,a]),g=v((D,S)=>{t.current&&b();const E=s.current,B=E.getDroppableRef();B||b();const O=zl(B),k={ref:B,descriptor:l,env:O,scrollOptions:S};t.current=k;const G=Kl({ref:B,descriptor:l,env:O,windowScroll:D,direction:E.direction,isDropDisabled:E.isDropDisabled,isCombineEnabled:E.isCombineEnabled,shouldClipSubject:!E.ignoreContainerClipping}),F=O.closestScrollable;return F&&(F.setAttribute(Ht.contextId,n.contextId),F.addEventListener("scroll",f,Yt(k.scrollOptions))),G},[n.contextId,l,f,s]),m=v(()=>{const D=t.current,S=ye(D);return D&&S||b(),tt(S)},[]),h=v(()=>{const D=t.current;D||b();const S=ye(D);t.current=null,S&&(d.cancel(),S.removeAttribute(Ht.contextId),S.removeEventListener("scroll",f,Yt(D.scrollOptions)))},[f,d]),x=v(D=>{const S=t.current;S||b();const E=ye(S);E||b(),E.scrollTop+=D.y,E.scrollLeft+=D.x},[]),C=A(()=>({getDimensionAndWatchScroll:g,getScrollWhileDragging:m,dragStopped:h,scroll:x}),[h,g,m,x]),R=A(()=>({uniqueId:r,descriptor:l,callbacks:C}),[C,l,r]);$(()=>(c.current=R.descriptor,o.droppable.register(R),()=>{t.current&&h(),o.droppable.unregister(R)}),[C,l,h,R,i,o.droppable]),$(()=>{t.current&&i.updateDroppableIsEnabled(c.current.id,!e.isDropDisabled)},[e.isDropDisabled,i]),$(()=>{t.current&&i.updateDroppableIsCombineEnabled(c.current.id,e.isCombineEnabled)},[e.isCombineEnabled,i])}function qe(){}const Kt={width:0,height:0,margin:oo},Zl=({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>e||n==="close"?Kt:{height:t.client.borderBox.height,width:t.client.borderBox.width,margin:t.client.margin},ea=({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>{const r=Zl({isAnimatingOpenOnMount:e,placeholder:t,animate:n});return{display:t.display,boxSizing:"border-box",width:r.width,height:r.height,marginTop:r.margin.top,marginRight:r.margin.right,marginBottom:r.margin.bottom,marginLeft:r.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:n!=="none"?ae.placeholder:null}},ta=e=>{const t=I.useRef(null),n=v(()=>{t.current&&(clearTimeout(t.current),t.current=null)},[]),{animate:r,onTransitionEnd:o,onClose:i,contextId:s}=e,[l,c]=I.useState(e.animate==="open");I.useEffect(()=>l?r!=="open"?(n(),c(!1),qe):t.current?qe:(t.current=setTimeout(()=>{t.current=null,c(!1)}),n):qe,[r,l,n]);const u=v(a=>{a.propertyName==="height"&&(o(),r==="close"&&i())},[r,i,o]),p=ea({isAnimatingOpenOnMount:l,animate:e.animate,placeholder:e.placeholder});return P.createElement(e.placeholder.tagName,{style:p,"data-rfd-placeholder-context-id":s,onTransitionEnd:u,ref:e.innerRef})};var na=P.memo(ta);class ra extends P.PureComponent{constructor(...t){super(...t),this.state={isVisible:!!this.props.on,data:this.props.on,animate:this.props.shouldAnimate&&this.props.on?"open":"none"},this.onClose=()=>{this.state.animate==="close"&&this.setState({isVisible:!1})}}static getDerivedStateFromProps(t,n){return t.shouldAnimate?t.on?{isVisible:!0,data:t.on,animate:"open"}:n.isVisible?{isVisible:!0,data:n.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:!!t.on,data:t.on,animate:"none"}}render(){if(!this.state.isVisible)return null;const t={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(t)}}const oa=e=>{const t=I.useContext(Ge);t||b();const{contextId:n,isMovementAllowed:r}=t,o=I.useRef(null),i=I.useRef(null),{children:s,droppableId:l,type:c,mode:u,direction:p,ignoreContainerClipping:a,isDropDisabled:d,isCombineEnabled:f,snapshot:g,useClone:m,updateViewportMaxScroll:h,getContainerForClone:x}=e,C=v(()=>o.current,[]),R=v((F=null)=>{o.current=F},[]);v(()=>i.current,[]);const D=v((F=null)=>{i.current=F},[]),S=v(()=>{r()&&h({maxScroll:$n()})},[r,h]);Ql({droppableId:l,type:c,mode:u,direction:p,isDropDisabled:d,isCombineEnabled:f,ignoreContainerClipping:a,getDroppableRef:C});const E=A(()=>P.createElement(ra,{on:e.placeholder,shouldAnimate:e.shouldAnimatePlaceholder},({onClose:F,data:Fe,animate:We})=>P.createElement(na,{placeholder:Fe,onClose:F,innerRef:D,animate:We,contextId:n,onTransitionEnd:S})),[n,S,e.placeholder,e.shouldAnimatePlaceholder,D]),B=A(()=>({innerRef:R,placeholder:E,droppableProps:{"data-rfd-droppable-id":l,"data-rfd-droppable-context-id":n}}),[n,l,E,R]),O=m?m.dragging.draggableId:null,k=A(()=>({droppableId:l,type:c,isUsingCloneFor:O}),[l,O,c]);function G(){if(!m)return null;const{dragging:F,render:Fe}=m,We=P.createElement(rr,{draggableId:F.draggableId,index:F.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(cr,dr)=>Fe(cr,dr,F));return fr.createPortal(We,x())}return P.createElement(St.Provider,{value:k},s(B,g),G())};function ia(){return document.body||b(),document.body}const Jt={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:ia},lr=e=>{let t={...e},n;for(n in Jt)e[n]===void 0&&(t={...t,[n]:Jt[n]});return t},Ye=(e,t)=>e===t.droppable.type,Xt=(e,t)=>t.draggables[e.draggable.id],sa=()=>{const e={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},t={...e,shouldAnimatePlaceholder:!1},n=N(i=>({draggableId:i.id,type:i.type,source:{index:i.index,droppableId:i.droppableId}})),r=N((i,s,l,c,u,p)=>{const a=u.descriptor.id;if(u.descriptor.droppableId===i){const g=p?{render:p,dragging:n(u.descriptor)}:null,m={isDraggingOver:l,draggingOverWith:l?a:null,draggingFromThisWith:a,isUsingPlaceholder:!0};return{placeholder:u.placeholder,shouldAnimatePlaceholder:!1,snapshot:m,useClone:g}}if(!s)return t;if(!c)return e;const f={isDraggingOver:l,draggingOverWith:a,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:u.placeholder,shouldAnimatePlaceholder:!0,snapshot:f,useClone:null}});return(i,s)=>{const l=lr(s),c=l.droppableId,u=l.type,p=!l.isDropDisabled,a=l.renderClone;if(me(i)){const d=i.critical;if(!Ye(u,d))return t;const f=Xt(d,i.dimensions),g=_(i.impact)===c;return r(c,p,g,g,f,a)}if(i.phase==="DROP_ANIMATING"){const d=i.completed;if(!Ye(u,d.critical))return t;const f=Xt(d.critical,i.dimensions);return r(c,p,tr(d.result)===c,_(d.impact)===c,f,a)}if(i.phase==="IDLE"&&i.completed&&!i.shouldFlush){const d=i.completed;if(!Ye(u,d.critical))return t;const f=_(d.impact)===c,g=!!(d.impact.at&&d.impact.at.type==="COMBINE"),m=d.critical.droppable.id===c;return f?g?e:t:m?e:t}return t}},la={updateViewportMaxScroll:hi},aa=Zt(sa,la,(e,t,n)=>({...lr(n),...e,...t}),{context:yt,areStatePropsEqual:er})(oa);var ca=aa;const da=({sprint:e,...t})=>{const{t:n}=Pe();return y.jsx(nn,{fullWidth:!0,leftSection:y.jsx(nt,{size:12}),size:"xs",variant:"subtle",color:"gray.8",justify:"flex-start",onClick:()=>br(e,"statuses"),...t,children:n("entitySettings.statusSection.addStatus")})},ua=({defaultValues:e,...t})=>{const{t:n}=Pe();return y.jsx(nn,{fullWidth:!0,leftSection:y.jsx(nt,{size:12}),size:"xs",variant:"transparent",justify:"flex-start",fw:400,color:"blue.5",onClick:()=>rt({defaultValues:{...e}}),...t,children:n("sidebar.action.addTask")})},pa="_root_1cbze_1",fa="_header_1cbze_9",ar={root:pa,header:fa},ga=({group:e,count:t,onCreateTask:n})=>{const{t:r}=Pe();return y.jsxs(Ke,{gap:8,py:8,px:6,justify:"space-between",className:ar.header,children:[y.jsxs(Ke,{gap:8,miw:0,children:[y.jsx(Br,{group:e}),y.jsx(hr,{size:"sm",c:"dark.2",style:{whiteSpace:"nowrap"},children:r("createTask.taskCount",{count:t})})]}),n&&y.jsx(vr,{size:24,variant:"subtle",color:"gray.7",onClick:n,children:y.jsx(nt,{size:18})})]})},ma=({count:e,sprint:t,order:n,group:r,defaultValues:o,children:i})=>{const s=rn(t.rootProjectId),l=()=>{rt({defaultValues:{...o,Order:n}})};return y.jsxs(y.Fragment,{children:[y.jsx(ga,{group:r,count:e,onCreateTask:s.tasks.create?l:void 0}),y.jsx("div",{className:ar.root,children:y.jsx(on,{gap:0,p:6,children:i})})]})},ba=I.memo(({sprint:e,tasks:t,isError:n,isLoading:r,emptyState:o=null})=>{const{t:i}=Pe(),s=rn(e.rootProjectId),[l,c]=I.useState(!1),{statuses:u}=Dr(e),{types:p}=yr(e.rootProjectId),a=xr(D=>{var S;return(S=D.settingsSlice.sprints)==null?void 0:S[e.Id]}),d=(a==null?void 0:a.groupBy)??"status",f=(a==null?void 0:a.sortOrder)??"asc",g=(a==null?void 0:a.sortBy)??null,m=(a==null?void 0:a.sortByOrder)??"asc",{groupedData:h,onDragEnd:x}=Or({tasks:t,statuses:u,projectId:e.rootProjectId,groupByType:d,groupSortOrder:f,sortBy:g,sortByOrder:m,includeAllGroups:!0}),C=I.useCallback(()=>{c(!0)},[]),R=I.useCallback((D,S)=>{c(!1),x(D,S)},[x]);return n?y.jsx(Ir,{message:i("notification.error.getSprint")}):r?y.jsx(Sr,{}):t!=null&&t.length?y.jsxs("div",{className:`${_e.root} ${l?_e.dragging:""}`,style:{gridTemplateColumns:`repeat(${h.length}, minmax(300px, 420px)) ${s.sprints.edit?"300px":""}`},children:[y.jsx(Il,{onDragStart:C,onDragEnd:R,children:h.map(D=>{const S=Pr(D,e,{order:Qt(D.tasks,"last")});return y.jsx(ca,{droppableId:D.Id,children:E=>y.jsx("div",{ref:E.innerRef,...E.droppableProps,children:y.jsxs(ma,{count:D.tasks.length,sprint:e,order:Qt(D.tasks),group:D,defaultValues:S,children:[D.tasks.map((B,O)=>y.jsx(kl,{draggableId:B.Id.toString(),index:O,isDragDisabled:!s.tasks.edit,children:k=>y.jsx("div",{ref:k.innerRef,...k.draggableProps,...k.dragHandleProps,children:y.jsx(Nr,{task:B,types:p,statuses:u,groupBy:d,my:3},B.Id)})},B.Id)),E.placeholder,s.tasks.create&&y.jsx(ua,{className:_e.createTaskKanban,defaultValues:S,my:3,w:"fit-content"})]})})},D.Id)})}),s.sprints.edit&&y.jsx("div",{children:y.jsx("div",{style:{backgroundColor:"light-dark(var(--mantine-color-gray-0), var(--mantine-color-dark-8))",borderRadius:4,position:"sticky",top:0},children:y.jsx(Cr,{label:i("entitySettings.statusSection.onlyForStatusGrouping"),disabled:d==="status",children:y.jsx("div",{children:y.jsx(da,{sprint:e,py:3,disabled:d!=="status"})})})})})]}):y.jsx(y.Fragment,{children:o})}),Qt=(e,t="first")=>{const n=e.at(t==="first"?0:-1);if(n)return n.Order+(t==="first"?-1:1)},Ta=()=>{const{factSprint:e,sprint:t}=Tr(),{project:n,isFetching:r}=Er(t==null?void 0:t.ProjectId);return r?y.jsx(Ar,{h:"calc(100vh - 81px)"}):!t||!n?e?y.jsx(Lr,{}):y.jsx(Gr,{}):y.jsx(wr,{projectId:n.Id,children:y.jsx(ha,{sprintData:t,projectData:n})})},ha=e=>{const{sprintData:t,search:n,setSearch:r,error:o,performerIds:i,handleAssign:s,handleFiltersApply:l,isFetching:c,isError:u,isLoading:p,groupedBySprint:a,withFilters:d}=Mr(e),[f,g]=I.useState([]),m=()=>{s([]),r(""),g([]),l(kr)};return u?y.jsx(Rr,{error:o}):y.jsxs(y.Fragment,{children:[y.jsx(Fr,{sprint:t}),y.jsxs(on,{gap:"lg",flex:1,children:[y.jsx(Wr,{sprintData:t,search:n,setSearch:r,performerIds:i,setPerformerIds:s,loading:c,onFiltersApply:l,filters:f,setFilters:g}),y.jsx(Ke,{pos:"relative",flex:1,children:y.jsx(ba,{sprint:t,isError:u,isLoading:p,tasks:a[t.Id],emptyState:d?y.jsx(_r,{onClick:m}):y.jsx($r,{onClick:()=>rt({defaultValues:{sprint:t}})})})})]})]})};export{Ta as default};
