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