@minimalcorp/tsunagi 0.4.4 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/standalone/apps/web/.next/BUILD_ID +1 -1
- package/.next/standalone/apps/web/.next/build-manifest.json +3 -3
- package/.next/standalone/apps/web/.next/prerender-manifest.json +3 -3
- package/.next/standalone/apps/web/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/apps/web/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/apps/web/.next/server/app/_not-found.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/index.html +1 -1
- package/.next/standalone/apps/web/.next/server/app/index.rsc +2 -2
- package/.next/standalone/apps/web/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/apps/web/.next/server/app/index.segments/_full.segment.rsc +2 -2
- package/.next/standalone/apps/web/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/apps/web/.next/server/app/settings.html +1 -1
- package/.next/standalone/apps/web/.next/server/app/settings.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/settings.segments/_full.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/settings.segments/_head.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/settings.segments/_index.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/settings.segments/settings.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/tasks/[id]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/apps/web/.next/server/chunks/ssr/_0cll8v8._.js +1 -1
- package/.next/standalone/apps/web/.next/server/chunks/ssr/_0f-.2d8._.js +1 -1
- package/.next/standalone/apps/web/.next/server/chunks/ssr/_0gzw46w._.js +1 -1
- package/.next/standalone/apps/web/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/apps/web/.next/server/pages/404.html +1 -1
- package/.next/standalone/apps/web/.next/server/pages/500.html +1 -1
- package/.next/standalone/apps/web/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/apps/web/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/apps/web/.next/static/chunks/043fskg~m3moq.js +1 -0
- package/.next/standalone/apps/web/.next/static/chunks/0_ixxu__kjm8f.js +1 -0
- package/.next/standalone/apps/web/.next/static/chunks/{0w_b4db5lrkt8.js → 0~h.kur6whs12.js} +1 -1
- package/dist/server/lib/repositories/task.d.ts +5 -0
- package/dist/server/lib/repositories/task.js +7 -0
- package/dist/server/routes/tasks.js +33 -0
- package/npm-shrinkwrap.json +33 -29
- package/package.json +1 -1
- package/.next/standalone/apps/web/.next/static/chunks/0_8u4hou0pvbl.js +0 -1
- package/.next/standalone/apps/web/.next/static/chunks/162ni7xyo_8_-.js +0 -1
- /package/.next/standalone/apps/web/.next/static/{224zD8YM7ARX7LuhyyCln → KU7tuE9IjwYe9Ze1tvJLW}/_buildManifest.js +0 -0
- /package/.next/standalone/apps/web/.next/static/{224zD8YM7ARX7LuhyyCln → KU7tuE9IjwYe9Ze1tvJLW}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/apps/web/.next/static/{224zD8YM7ARX7LuhyyCln → KU7tuE9IjwYe9Ze1tvJLW}/_ssgManifest.js +0 -0
|
@@ -61,4 +61,4 @@ ${C.current.stack}
|
|
|
61
61
|
-moz-user-select: none;
|
|
62
62
|
-ms-user-select: none;
|
|
63
63
|
overflow-anchor: none;
|
|
64
|
-
`}}],"always"),resting:ng(i,"resting"),dragging:ng(i,"dragging"),dropAnimating:ng(i,"dropAnimating"),userCancel:ng(i,"userCancel")}},[I]),i=(0,q.useRef)(null),a=(0,q.useRef)(null),o=tp(tC(e=>{let t=a.current;t||tt(),t.textContent=e}),[]),nm(()=>{(i.current||a.current)&&tt();let e=nb(D),t=nb(D);return i.current=e,a.current=t,e.setAttribute(`${nd}-always`,I),t.setAttribute(`${nd}-dynamic`,I),nh().appendChild(e),nh().appendChild(t),s(l.always),o(l.resting),()=>{let e=e=>{let t=e.current;t||tt(),nh().removeChild(t),e.current=null};e(i),e(a)}},[D,s=tp(e=>{let t=i.current;t||tt(),t.textContent=e},[]),o,l.always,l.resting,I]),d=tp(()=>o(l.dragging),[o,l.dragging]),c=tp(e=>{"DROP"===e?o(l.dropAnimating):o(l.userCancel)},[o,l.dropAnimating,l.userCancel]),tu(()=>({dragging:d,dropping:c,resting:u}),[d,c,u=tp(()=>{a.current&&o(l.resting)},[o,l.resting])])),T=tp(e=>{nY(S).dispatch(e)},[]),B=tu(()=>ee({publishWhileDragging:ry,updateDroppableScroll:rw,updateDroppableIsEnabled:rI,updateDroppableIsCombineEnabled:rN,collectionStarting:rv},T),[T]),_=(p=tu(nI,[]),(0,q.useEffect)(()=>function(){p.clean()},[p]),p),M=tu(()=>{let e,t,r;return e=null,t=function({registry:e,callbacks:t}){let r=rZ(),n=null,l=()=>{n||(t.collectionStarting(),n=requestAnimationFrame(()=>{n=null,rp();let{additions:l,removals:i,modified:a}=r,o=Object.keys(l).map(t=>e.draggable.getById(t).getDimension(tf)).sort((e,t)=>e.descriptor.index-t.descriptor.index),s=Object.keys(a).map(t=>{let r=e.droppable.getById(t).callbacks.getScrollWhileDragging();return{droppableId:t,scroll:r}}),d={additions:o,removals:Object.keys(i),modified:s};r=rZ(),rf(),t.publish(d)}))};return{add:e=>{let t=e.descriptor.id;r.additions[t]=e,r.modified[e.descriptor.droppableId]=!0,r.removals[t]&&delete r.removals[t],l()},remove:e=>{let t=e.descriptor;r.removals[t.id]=!0,r.modified[t.droppableId]=!0,r.additions[t.id]&&delete r.additions[t.id],l()},stop:()=>{n&&(cancelAnimationFrame(n),n=null,r=rZ())}}}({callbacks:{publish:B.publishWhileDragging,collectionStarting:B.collectionStarting},registry:_}),r=r=>{e||tt();let n=e.critical.draggable;"ADDITION"===r.type&&r3(_,n,r.value)&&t.add(r.value),"REMOVAL"===r.type&&r3(_,n,r.value)&&t.remove(r.value)},{updateDroppableIsEnabled:(t,r)=>{_.droppable.exists(t)||tt(),e&&B.updateDroppableIsEnabled({id:t,isEnabled:r})},updateDroppableIsCombineEnabled:(t,r)=>{e&&(_.droppable.exists(t)||tt(),B.updateDroppableIsCombineEnabled({id:t,isCombineEnabled:r}))},scrollDroppable:(t,r)=>{e&&_.droppable.getById(t).callbacks.scroll(r)},updateDroppableScroll:(t,r)=>{e&&(_.droppable.exists(t)||tt(),B.updateDroppableScroll({id:t,newScroll:r}))},startPublishing:t=>{e&&tt();let n=_.draggable.getById(t.draggableId),l=_.droppable.getById(n.descriptor.droppableId),i={draggable:n.descriptor,droppable:l.descriptor};return e={critical:i,unsubscribe:_.subscribe(r)},(({critical:e,scrollOptions:t,registry:r})=>{let n,l,i,a,o,s;rp();let d=(n=rH(),l=r2(),i=n.y,a=n.x,s=(o=r1()).clientWidth,{frame:eY({top:i,left:a,right:a+s,bottom:i+o.clientHeight}),scroll:{initial:n,current:n,max:l,diff:{value:tf,displacement:tf}}}),c=d.scroll.current,u=e.droppable,p=r.droppable.getAllByType(u.type).map(e=>e.callbacks.getDimensionAndWatchScroll(c,t)),f={draggables:tP(r.draggable.getAllByType(e.draggable.type).map(e=>e.getDimension(c))),droppables:tS(p)};return rf(),{dimensions:f,critical:e,viewport:d}})({critical:i,registry:_,scrollOptions:t.scrollOptions})},stopPublishing:()=>{if(!e)return;t.stop();let r=e.critical.droppable;_.droppable.getAllByType(r.type).forEach(e=>e.callbacks.dragStopped()),e.unsubscribe(),e=null}}},[_,B]),L=tu(()=>(({scrollDroppable:e,scrollWindow:t,move:r,getAutoScrollerOptions:n})=>{let l=(({scrollWindow:e,scrollDroppable:t,getAutoScrollerOptions:r=()=>r6})=>{let n=e5(e),l=e5(t),i=null,a=e=>{i||tt();let{shouldUseTimeDampening:t,dragStartTime:a}=i;ns({state:e,scrollWindow:n,scrollDroppable:l,dragStartTime:a,shouldUseTimeDampening:t,getAutoScrollerOptions:r})};return{start:e=>{rp(),i&&tt();let t=Date.now(),n=!1,l=()=>{n=!0};ns({state:e,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:l,scrollDroppable:l,getAutoScrollerOptions:r}),i={dragStartTime:t,shouldUseTimeDampening:n},rf(),n&&a(e)},stop:()=>{i&&(n.cancel(),l.cancel(),i=null)},scroll:a}})({scrollWindow:t,scrollDroppable:e,getAutoScrollerOptions:n}),i=(({move:e,scrollDroppable:t,scrollWindow:r})=>n=>{let l=n.scrollJumpRequest;if(!l)return;let i=rt(n.impact);i||tt();let a=((e,r)=>{let n;if(!no(e,r))return r;let l=(n=e.frame)&&no(e,r)?nl({current:n.scroll.current,max:n.scroll.max,change:r}):null;if(!l)return t(e.descriptor.id,r),null;let i=tm(r,l);return t(e.descriptor.id,i),tm(r,i)})(n.dimensions.droppables[i],l);if(!a)return;let o=n.viewport,s=((e,t,n)=>{if(!e||!na(t,n))return n;let l=((e,t)=>{if(!na(e,t))return null;let r=e.scroll.max;return nl({current:e.scroll.current,max:r,change:t})})(t,n);if(!l)return r(n),null;let i=tm(n,l);return r(i),tm(n,i)})(n.isWindowScrollAllowed,o,a);s&&e({client:tg(n.current.client.selection,s)})})({move:r,scrollWindow:t,scrollDroppable:e});return{scroll:e=>{n().disabled||"DRAGGING"!==e.phase||("FLUID"===e.movementMode?l.scroll(e):e.scrollJumpRequest&&i(e))},start:l.start,stop:l.stop}})({scrollWindow:r4,scrollDroppable:M.scrollDroppable,getAutoScrollerOptions:R,...ee({move:rE},T)}),[M.scrollDroppable,T,R]),G=(f=(0,q.useRef)({}),g=(0,q.useRef)(null),m=(0,q.useRef)(null),h=(0,q.useRef)(!1),b=tp(function(e,t){let r={id:e,focus:t};return f.current[e]=r,function(){let t=f.current;t[e]!==r&&delete t[e]}},[]),x=tp(function(e){let t=nw(I,e);t&&t!==document.activeElement&&t.focus()},[I]),y=tp(function(e,t){g.current===e&&(g.current=t)},[]),v=tp(function(){m.current||h.current&&(m.current=requestAnimationFrame(()=>{m.current=null;let e=g.current;e&&x(e)}))},[x]),w=tp(function(e){g.current=null;let t=document.activeElement;t&&t.getAttribute(nc.draggableId)===e&&(g.current=e)},[]),nm(()=>(h.current=!0,function(){h.current=!1;let e=m.current;e&&cancelAnimationFrame(e)}),[]),tu(()=>({register:b,tryRecordFocus:w,tryRestoreFocusRecorded:v,tryShiftRecord:y}),[b,w,v,y])),$=tu(()=>(({dimensionMarshal:e,focusMarshal:t,styleMarshal:r,getResponders:n,announce:l,autoScroller:i})=>{let a,o,s,d,c,u;return function e(t,r,n){if("function"!=typeof t)throw Error(J(2));if("function"==typeof r&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw Error(J(0));if("function"==typeof r&&void 0===n&&(n=r,r=void 0),void 0!==n){if("function"!=typeof n)throw Error(J(1));return n(e)(t,r)}let l=t,i=r,a=new Map,o=a,s=0,d=!1;function c(){o===a&&(o=new Map,a.forEach((e,t)=>{o.set(t,e)}))}function u(){if(d)throw Error(J(3));return i}function p(e){if("function"!=typeof e)throw Error(J(4));if(d)throw Error(J(5));let t=!0;c();let r=s++;return o.set(r,e),function(){if(t){if(d)throw Error(J(6));t=!1,c(),o.delete(r),a=null}}}function f(e){if(!function(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}(e))throw Error(J(7));if(void 0===e.type)throw Error(J(8));if("string"!=typeof e.type)throw Error(J(17));if(d)throw Error(J(9));try{d=!0,i=l(i,e)}finally{d=!1}return(a=o).forEach(e=>{e()}),e}return f({type:Q.INIT}),{dispatch:f,subscribe:p,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw Error(J(10));l=e,f({type:Q.REPLACE})},[K]:function(){return{subscribe(e){if("object"!=typeof e||null===e)throw Error(J(11));function t(){e.next&&e.next(u())}return t(),{unsubscribe:p(t)}},[K](){return this}}}}}(rb,et(function(...e){return t=>(r,n)=>{let l=t(r,n),i=()=>{throw Error(J(15))},a={getState:l.getState,dispatch:(e,...t)=>i(e,...t)};return i=et(...e.map(e=>e(a)))(l.dispatch),{...l,dispatch:i}}}(()=>e=>t=>{rx(t,"INITIAL_PUBLISH")&&r.dragging(),rx(t,"DROP_ANIMATE")&&r.dropping(t.payload.completed.result.reason),(rx(t,"FLUSH")||rx(t,"DROP_COMPLETE"))&&r.resting(),e(t)},()=>t=>r=>{(rx(r,"DROP_COMPLETE")||rx(r,"FLUSH")||rx(r,"DROP_ANIMATE"))&&e.stopPublishing(),t(r)},({getState:t,dispatch:r})=>n=>l=>{if(!rx(l,"LIFT"))return void n(l);let{id:i,clientSelection:a,movementMode:o}=l.payload,s=t();"DROP_ANIMATING"===s.phase&&r(rR({completed:s.completed})),"IDLE"!==t().phase&&tt(),r(rO()),r({type:"BEFORE_INITIAL_CAPTURE",payload:{draggableId:i,movementMode:o}});let{critical:d,dimensions:c,viewport:u}=e.startPublishing({draggableId:i,scrollOptions:{shouldPublishImmediately:"SNAP"===o}});r({type:"INITIAL_PUBLISH",payload:{critical:d,dimensions:c,clientSelection:a,movementMode:o,viewport:u}})},rW,rK,rX,rQ,e=>t=>r=>{if(rx(r,"DROP_COMPLETE")||rx(r,"DROP_ANIMATE")||rx(r,"FLUSH")){i.stop(),t(r);return}if(rx(r,"INITIAL_PUBLISH")){t(r);let n=e.getState();"DRAGGING"!==n.phase&&tt(),i.start(n);return}t(r),i.scroll(e.getState())},rV,(a=!1,()=>e=>r=>{if(rx(r,"INITIAL_PUBLISH")){a=!0,t.tryRecordFocus(r.payload.critical.draggable.id),e(r),t.tryRestoreFocusRecorded();return}if(e(r),a){if(rx(r,"FLUSH")){a=!1,t.tryRestoreFocusRecorded();return}if(rx(r,"DROP_COMPLETE")){a=!1;let e=r.payload.completed.result;e.combine&&t.tryShiftRecord(e.draggableId,e.combine.draggableId),t.tryRestoreFocusRecorded()}}}),(o=[],s={add:e=>{let t=setTimeout(()=>(e=>{let t=o.findIndex(t=>t.timerId===e);-1===t&&tt();let[r]=o.splice(t,1);r.callback()})(t));o.push({timerId:t,callback:e})},flush:()=>{if(!o.length)return;let e=[...o];o.length=0,e.forEach(e=>{clearTimeout(e.timerId),e.callback()})}},d=null,u={beforeCapture:(e,t)=>{d&&tt(),rq("onBeforeCapture",()=>{let r=n().onBeforeCapture;r&&r({draggableId:e,mode:t})})},beforeStart:(e,t)=>{d&&tt(),rq("onBeforeDragStart",()=>{let r=n().onBeforeDragStart;r&&r(rY(e,t))})},start:(e,t)=>{d&&tt();let r=rY(e,t);d={mode:t,lastCritical:e,lastLocation:r.source,lastCombine:null},s.add(()=>{rq("onDragStart",()=>rJ(n().onDragStart,r,l,to))})},update:(e,t)=>{var r,i;let a=tA(t),o=tk(t);d||tt();let c=!((e,t)=>{if(e===t)return!0;let 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})(e,d.lastCritical);c&&(d.lastCritical=e);let u=(r=d.lastLocation,(null!=r||null!=a)&&(null==r||null==a||r.droppableId!==a.droppableId||r.index!==a.index));u&&(d.lastLocation=a);let p=(i=d.lastCombine,(null!=i||null!=o)&&(null==i||null==o||i.draggableId!==o.draggableId||i.droppableId!==o.droppableId));if(p&&(d.lastCombine=o),!c&&!u&&!p)return;let f={...rY(e,d.mode),combine:o,destination:a};s.add(()=>{rq("onDragUpdate",()=>rJ(n().onDragUpdate,f,l,ts))})},flush:()=>{d||tt(),s.flush()},drop:c=e=>{d||tt(),d=null,rq("onDragEnd",()=>rJ(n().onDragEnd,e,l,td))},abort:()=>{d&&c({...rY(d.lastCritical,d.mode),combine:null,destination:null,reason:"CANCEL"})}},e=>t=>r=>{if(rx(r,"BEFORE_INITIAL_CAPTURE"))return void u.beforeCapture(r.payload.draggableId,r.payload.movementMode);if(rx(r,"INITIAL_PUBLISH")){let e=r.payload.critical;u.beforeStart(e,r.payload.movementMode),t(r),u.start(e,r.payload.movementMode);return}if(rx(r,"DROP_COMPLETE")){let e=r.payload.completed.result;u.flush(),t(r),u.drop(e);return}if(t(r),rx(r,"FLUSH"))return void u.abort();let n=e.getState();"DRAGGING"===n.phase&&u.update(n.critical,n.impact)}))))})({announce:j,autoScroller:L,dimensionMarshal:M,focusMarshal:G,getResponders:O,styleMarshal:k}),[j,L,M,G,O,k]);S.current=$;let F=tp(()=>{let e=nY(S);"IDLE"!==e.getState().phase&&e.dispatch(rO())},[]),z=tp(()=>{let e=nY(S).getState();return"DROP_ANIMATING"===e.phase||"IDLE"!==e.phase&&e.isDragging},[]);N(tu(()=>({isDragging:z,tryAbort:F}),[z,F]));let U=tp(e=>r5(nY(S).getState(),e),[]),W=tp(()=>rr(nY(S).getState()),[]),H=tu(()=>({marshal:M,focus:G,contextId:I,canLift:U,isMovementAllowed:W,dragHandleUsageInstructionsId:A,registry:_}),[I,M,A,G,U,W,_]);return!function({contextId:e,store:t,registry:r,customSensors:n,enableDefaultSensors:l}){let i=[...l?nq:[],...n||[]],a=(0,q.useState)(()=>(function(){let e=null;function t(){e||tt(),e=null}return{isClaimed:function(){return!!e},isActive:function(t){return t===e},claim:function(t){e&&tt();let r={abandon:t};return e=r,r},release:t,tryAbandon:function(){e&&(e.abandon(),t())}}})())[0],o=tp(function(e,t){nT(e)&&!nT(t)&&a.tryAbandon()},[a]);nm(function(){let e=t.getState();return t.subscribe(()=>{let r=t.getState();o(e,r),e=r})},[a,t,o]),nm(()=>a.tryAbandon,[a.tryAbandon]);let s=tp(e=>nV({lockAPI:a,registry:r,store:t,draggableId:e}),[a,r,t]),d=tp((n,l,i)=>(function({lockAPI:e,contextId:t,store:r,registry:n,draggableId:l,forceSensorStop:i,sourceEvent:a}){var o;let s,d;if(!nV({lockAPI:e,store:r,registry:n,draggableId:l}))return null;let c=n.draggable.getById(l),u=(o=c.descriptor.id,(s=nx(document,`[${nu.contextId}="${t}"]`).find(e=>e.getAttribute(nu.id)===o))&&nv(s)?s:null);if(!u||a&&!c.options.canDragInteractiveElements&&nv(d=a.target)&&function e(t,r){if(null==r)return!1;if(nz.includes(r.tagName.toLowerCase()))return!0;let n=r.getAttribute("contenteditable");return"true"===n||""===n||r!==t&&e(t,r.parentElement)}(u,d))return null;let p=e.claim(i||e7),f="PRE_DRAG";function g(){return c.options.shouldRespectForcePress}function m(){return e.isActive(p)}let h=(function(e,t){nH({expected:e,phase:f,isLockActive:m,shouldWarn:!0})&&r.dispatch(t())}).bind(null,"DRAGGING");function b(t){function n(){e.release(),f="COMPLETED"}function l(e,i={shouldBlockNextClick:!1}){t.cleanup(),i.shouldBlockNextClick&&setTimeout(e9(window,[{eventName:"click",fn:nW,options:{once:!0,passive:!1,capture:!0}}])),n(),r.dispatch(rj({reason:e}))}return"PRE_DRAG"!==f&&(n(),tt()),r.dispatch({type:"LIFT",payload:t.liftActionArgs}),f="DRAGGING",{isActive:()=>nH({expected:"DRAGGING",phase:f,isLockActive:m,shouldWarn:!1}),shouldRespectForcePress:g,drop:e=>l("DROP",e),cancel:e=>l("CANCEL",e),...t.actions}}return{isActive:()=>nH({expected:"PRE_DRAG",phase:f,isLockActive:m,shouldWarn:!1}),shouldRespectForcePress:g,fluidLift:function(e){let t=e5(e=>{h(()=>rE({client:e}))});return{...b({liftActionArgs:{id:l,clientSelection:e,movementMode:"FLUID"},cleanup:()=>t.cancel(),actions:{move:t}}),move:t}},snapLift:function(){return b({liftActionArgs:{id:l,clientSelection:eY(u.getBoundingClientRect()).center,movementMode:"SNAP"},cleanup:e7,actions:{moveUp:()=>h(rD),moveRight:()=>h(rS),moveDown:()=>h(rC),moveLeft:()=>h(rP)}})},abort:function(){nH({expected:"PRE_DRAG",phase:f,isLockActive:m,shouldWarn:!0})&&e.release()}}})({lockAPI:a,registry:r,contextId:e,store:t,draggableId:n,forceSensorStop:l||null,sourceEvent:i&&i.sourceEvent?i.sourceEvent:null}),[e,a,r,t]),c=tp(t=>{let r;return(r=function(e,t){let r=t.target;if(!(r instanceof ny(r).Element))return null;let n=`[${nc.contextId}="${e}"]`,l=r.closest?r.closest(n):function e(t,r){return null==t?null:t[nU](r)?t:e(t.parentElement,r)}(r,n);return l&&nv(l)?l:null}(e,t))?r.getAttribute(nc.draggableId):null},[e]),u=tp(e=>{let t=r.draggable.findById(e);return t?t.options:null},[r.draggable]),p=tp(function(){a.isClaimed()&&(a.tryAbandon(),"IDLE"!==t.getState().phase&&t.dispatch(rO()))},[a,t]),f=tp(()=>a.isClaimed(),[a]),g=tu(()=>({canGetLock:s,tryGetLock:d,findClosestDraggableId:c,findOptionsForDraggable:u,tryReleaseLock:p,isLockClaimed:f}),[s,d,c,u,p,f]);nj(()=>{let e=nk(i);nA(()=>{e.current.length!==i.length&&tt(!1)})});for(let e=0;e<i.length;e++)i[e](g)}({contextId:I,store:$,registry:_,customSensors:E||null,enableDefaultSensors:!1!==e.enableDefaultSensors}),(0,q.useEffect)(()=>F,[F]),q.default.createElement(nP.Provider,{value:H},q.default.createElement(eH,{context:nN,store:$},e.children))}function nK(e){let t=q.default.useId(),r=e.dragHandleUsageInstructions||tn;return q.default.createElement(tr,null,n=>q.default.createElement(nJ,{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))}var nX=q.default.createContext(null);function nQ(e){e&&nv(e)||tt()}function nZ(e){let t=(0,q.useContext)(e);return t||tt(),t}function n0(e){e.preventDefault()}var n1=(e,t)=>e===t,n2=e=>{let{combine:t,destination:r}=e;return r?r.droppableId:t?t.droppableId:null};function n3(e=null){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}let n5={mapped:{type:"SECONDARY",offset:tf,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:n3(null)}},n4=eW(()=>{let e,t,r,n,l,i,a,o,s=(e=tC((e,t)=>({x:e,y:t})),t=tC((e,t,r=null,n=null,l=null)=>({isDragging:!0,isClone:t,isDropAnimating:!!l,dropAnimation:l,mode:e,draggingOver:r,combineWith:n,combineTargetFor:null})),r=tC((e,r,n,l,i=null,a=null,o=null)=>({mapped:{type:"DRAGGING",dropping:null,draggingOver:i,combineWith:a,mode:r,offset:e,dimension:n,forceShouldAnimate:o,snapshot:t(r,l,i,a,null)}})),(n,l)=>{if(nT(n)){let t;if(n.critical.draggable.id!==l.draggableId)return null;let i=n.current.client.offset,a=n.dimensions.draggables[l.draggableId],o=rt(n.impact),s=(t=n.impact).at&&"COMBINE"===t.at.type?t.at.combine.draggableId:null,d=n.forceShouldAnimate;return r(e(i.x,i.y),n.movementMode,a,l.isClone,o,s,d)}if("DROP_ANIMATING"===n.phase){let e=n.completed;if(e.result.draggableId!==l.draggableId)return null;let r=l.isClone,i=n.dimensions.draggables[l.draggableId],a=e.result,o=a.mode,s=n2(a),d=a.combine?a.combine.draggableId:null,c={duration:n.dropDuration,curve:rk,moveTo:n.newHomeClientOffset,opacity:d?rT:null,scale:d?r_:null};return{mapped:{type:"DRAGGING",offset:n.newHomeClientOffset,dimension:i,dropping:c,draggingOver:s,combineWith:d,mode:o,forceShouldAnimate:null,snapshot:t(o,r,s,d,c)}}}return null}),d=(n=tC((e,t)=>({x:e,y:t})),l=tC(n3),i=tC((e,t=null,r)=>({mapped:{type:"SECONDARY",offset:e,combineTargetFor:t,shouldAnimateDisplacement:r,snapshot:l(t)}})),a=e=>e?i(tf,e,!0):null,o=(e,t,r,l)=>{let o=r.displaced.visible[e],s=!!(l.inVirtualList&&l.effected[e]),d=tk(r),c=d&&d.draggableId===e?t:null;if(!o){if(!s)return a(c);if(r.displaced.invisible[e])return null;let t=tb(l.displacedBy.point);return i(n(t.x,t.y),c,!0)}if(s)return a(c);let u=r.displacedBy.point;return i(n(u.x,u.y),c,o.shouldAnimate)},(e,t)=>{if(nT(e))return e.critical.draggable.id===t.draggableId?null:o(t.draggableId,e.critical.draggable.id,e.impact,e.afterCritical);if("DROP_ANIMATING"===e.phase){let r=e.completed;return r.result.draggableId===t.draggableId?null:o(t.draggableId,r.result.draggableId,r.impact,r.afterCritical)}return null});return(e,t)=>s(e,t)||d(e,t)||n5},{dropAnimationFinished:rA},null,{context:nN,areStatePropsEqual:n1})(e=>{let t=(0,q.useRef)(null),r=tp((e=null)=>{t.current=e},[]),n=tp(()=>t.current,[]),{contextId:l,dragHandleUsageInstructionsId:i,registry:a}=nZ(nP),{type:o,droppableId:s}=nZ(nX),d=tu(()=>({id:e.draggableId,index:e.index,type:o,droppableId:s}),[e.draggableId,e.index,o,s]),{children:c,draggableId:u,isEnabled:p,shouldRespectForcePress:f,canDragInteractiveElements:g,isClone:m,mapped:h,dropAnimationFinished:b}=e;nA(()=>{let t=e.draggableId;t||tt(!1),"string"!=typeof t&&tt(!1),Number.isInteger(e.index)||tt(!1),"DRAGGING"!==e.mapped.type&&(nQ(n()),e.isEnabled&&(nw(l,t)||tt(!1)))}),nj(()=>{let e=(0,q.useRef)(m);nA(()=>{m!==e.current&&tt(!1)},[m])}),m||function(e){let t=nS("draggable"),{descriptor:r,registry:n,getDraggableRef:l,canDragInteractiveElements:i,shouldRespectForcePress:a,isEnabled:o}=e,s=tu(()=>({canDragInteractiveElements:i,shouldRespectForcePress:a,isEnabled:o}),[i,o,a]),d=tp(e=>{let t=l();return t||tt(),function(e,t,r=tf){let n=window.getComputedStyle(t),l=e2(t.getBoundingClientRect(),n),i=e1(l,r),a={client:l,tagName:t.tagName.toLowerCase(),display:n.display};return{descriptor:e,placeholder:a,displaceBy:{x:l.marginBox.width,y:l.marginBox.height},client:l,page:i}}(r,t,e)},[r,l]),c=tu(()=>({uniqueId:t,descriptor:r,options:s,getDimension:d}),[r,d,s,t]),u=(0,q.useRef)(c),p=(0,q.useRef)(!0);nm(()=>(n.draggable.register(u.current),()=>n.draggable.unregister(u.current)),[n.draggable]),nm(()=>{if(p.current){p.current=!1;return}let e=u.current;u.current=c,n.draggable.update(c,e)},[c,n.draggable])}(tu(()=>({descriptor:d,registry:a,getDraggableRef:n,canDragInteractiveElements:g,shouldRespectForcePress:f,isEnabled:p}),[d,a,n,g,f,p]));let x=tu(()=>p?{tabIndex:0,role:"button","aria-describedby":i,"data-rfd-drag-handle-draggable-id":u,"data-rfd-drag-handle-context-id":l,draggable:!1,onDragStart:n0}:null,[l,i,u,p]),y=tp(e=>{"DRAGGING"===h.type&&h.dropping&&"transform"===e.propertyName&&(0,Y.flushSync)(b)},[b,h]),v=tu(()=>{let e="DRAGGING"===h.type?function(e){let t=e.dimension.client,{offset:r,combineWith:n,dropping:l}=e,i=!!n,a=null!=e.forceShouldAnimate?e.forceShouldAnimate:"SNAP"===e.mode,o=!!l,s=o?((e,t)=>{let r=r$(e);if(r)return t?`${r} scale(${r_})`:r})(r,i):r$(r);return{position:"fixed",top:t.marginBox.top,left:t.marginBox.left,boxSizing:"border-box",width:t.borderBox.width,height:t.borderBox.height,transition:l?rG.drop(l.duration):a?rG.snap:rG.fluid,transform:s,opacity:((e,t)=>{if(e)return t?rT:rB})(i,o),zIndex:o?4500:5e3,pointerEvents:"none"}}(h):{transform:r$(h.offset),transition:h.shouldAnimateDisplacement?void 0:"none"};return{innerRef:r,draggableProps:{"data-rfd-draggable-context-id":l,"data-rfd-draggable-id":u,style:e,onTransitionEnd:"DRAGGING"===h.type&&h.dropping?y:void 0},dragHandleProps:x}},[l,x,u,h,y,r]),w=tu(()=>({draggableId:d.id,type:d.type,source:{index:d.index,droppableId:d.droppableId}}),[d.droppableId,d.id,d.index,d.type]);return q.default.createElement(q.default.Fragment,null,c(v,h.snapshot,w))});function n8(e){return nZ(nX).isUsingCloneFor!==e.draggableId||e.isClone?q.default.createElement(n4,e):null}function n6(e){let t="boolean"!=typeof e.isDragDisabled||!e.isDragDisabled,r=!!e.disableInteractiveElementBlocking,n=!!e.shouldRespectForcePress;return q.default.createElement(n8,e4({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:r,shouldRespectForcePress:n}))}let n7=e=>t=>e===t,n9=n7("scroll"),le=n7("auto");n7("visible");let lt=(e,t)=>t(e.overflowX)||t(e.overflowY),lr=e=>{let t,r;return null==e||e===document.body||e===document.documentElement?null:lt(r={overflowX:(t=window.getComputedStyle(e)).overflowX,overflowY:t.overflowY},n9)||lt(r,le)?e:lr(e.parentElement)};var ln=e=>({x:e.scrollLeft,y:e.scrollTop});let ll=e=>!!e&&("fixed"===window.getComputedStyle(e).position||ll(e.parentElement)),li={passive:!1},la={passive:!0};var lo=e=>e.shouldPublishImmediately?li:la;let ls=e=>e&&e.env.closestScrollable||null;function ld(){}let lc={width:0,height:0,margin:{top:0,right:0,bottom:0,left:0}};var lu=q.default.memo(e=>{let t=(0,q.useRef)(null),r=tp(()=>{t.current&&(clearTimeout(t.current),t.current=null)},[]),{animate:n,onTransitionEnd:l,onClose:i,contextId:a}=e,[o,s]=(0,q.useState)("open"===e.animate);(0,q.useEffect)(()=>o?"open"!==n?(r(),s(!1),ld):t.current?ld:(t.current=setTimeout(()=>{t.current=null,s(!1)}),r):ld,[n,o,r]);let d=tp(e=>{"height"===e.propertyName&&(l(),"close"===n&&i())},[n,i,l]),c=(({isAnimatingOpenOnMount:e,placeholder:t,animate:r})=>{let n=(({isAnimatingOpenOnMount:e,placeholder:t,animate:r})=>e||"close"===r?lc:{height:t.client.borderBox.height,width:t.client.borderBox.width,margin:t.client.margin})({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:"none"!==r?rG.placeholder:null}})({isAnimatingOpenOnMount:o,animate:e.animate,placeholder:e.placeholder});return q.default.createElement(e.placeholder.tagName,{style:c,"data-rfd-placeholder-context-id":a,onTransitionEnd:d,ref:e.innerRef})});function lp(e){return"boolean"==typeof e}function lf(e,t){t.forEach(t=>t(e))}let lg=[function({props:e}){e.droppableId||tt(),"string"!=typeof e.droppableId&&tt()},function({props:e}){lp(e.isDropDisabled)||tt(),lp(e.isCombineEnabled)||tt(),lp(e.ignoreContainerClipping)||tt()},function({getDroppableRef:e}){nQ(e())}],lm=[function({props:e,getPlaceholderRef:t}){if(!e.placeholder||t())return}],lh=[function({props:e}){e.renderClone||tt()},function({getPlaceholderRef:e}){e()&&tt()}];class lb extends q.default.PureComponent{constructor(...e){super(...e),this.state={isVisible:!!this.props.on,data:this.props.on,animate:this.props.shouldAnimate&&this.props.on?"open":"none"},this.onClose=()=>{"close"===this.state.animate&&this.setState({isVisible:!1})}}static getDerivedStateFromProps(e,t){return e.shouldAnimate?e.on?{isVisible:!0,data:e.on,animate:"open"}:t.isVisible?{isVisible:!0,data:t.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:!!e.on,data:e.on,animate:"none"}}render(){if(!this.state.isVisible)return null;let e={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(e)}}let lx={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:function(){return document.body||tt(),document.body}},ly=e=>{let t,r={...e};for(t in lx)void 0===e[t]&&(r={...r,[t]:lx[t]});return r},lv=(e,t)=>t.draggables[e.draggable.id],lw=eW(()=>{let e={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},t={...e,shouldAnimatePlaceholder:!1},r=tC(e=>({draggableId:e.id,type:e.type,source:{index:e.index,droppableId:e.droppableId}})),n=tC((n,l,i,a,o,s)=>{let d=o.descriptor.id;if(o.descriptor.droppableId===n){let e=s?{render:s,dragging:r(o.descriptor)}:null;return{placeholder:o.placeholder,shouldAnimatePlaceholder:!1,snapshot:{isDraggingOver:i,draggingOverWith:i?d:null,draggingFromThisWith:d,isUsingPlaceholder:!0},useClone:e}}return l?a?{placeholder:o.placeholder,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:i,draggingOverWith:d,draggingFromThisWith:null,isUsingPlaceholder:!0},useClone:null}:e:t});return(r,l)=>{let i=ly(l),a=i.droppableId,o=i.type,s=!i.isDropDisabled,d=i.renderClone;if(nT(r)){let e=r.critical;if(o!==e.droppable.type)return t;let l=lv(e,r.dimensions),i=rt(r.impact)===a;return n(a,s,i,i,l,d)}if("DROP_ANIMATING"===r.phase){let e=r.completed;if(o!==e.critical.droppable.type)return t;let l=lv(e.critical,r.dimensions);return n(a,s,n2(e.result)===a,rt(e.impact)===a,l,d)}if("IDLE"===r.phase&&r.completed&&!r.shouldFlush){let n=r.completed;if(o!==n.critical.droppable.type)return t;let l=rt(n.impact)===a,i=!!(n.impact.at&&"COMBINE"===n.impact.at.type),s=n.critical.droppable.id===a;if(l)return i?e:t;if(s)return e}return t}},{updateViewportMaxScroll:e=>({type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:e})},(e,t,r)=>({...ly(r),...e,...t}),{context:nN,areStatePropsEqual:n1})(e=>{var t;let r=(0,q.useContext)(nP);r||tt();let{contextId:n,isMovementAllowed:l}=r,i=(0,q.useRef)(null),a=(0,q.useRef)(null),{children:o,droppableId:s,type:d,mode:c,direction:u,ignoreContainerClipping:p,isDropDisabled:f,isCombineEnabled:g,snapshot:m,useClone:h,updateViewportMaxScroll:b,getContainerForClone:x}=e,y=tp(()=>i.current,[]),v=tp((e=null)=>{i.current=e},[]),w=tp(()=>a.current,[]),I=tp((e=null)=>{a.current=e},[]);t={props:e,getDroppableRef:y,getPlaceholderRef:w},nA(()=>{lf(t,lg),"standard"===t.props.mode&&lf(t,lm),"virtual"===t.props.mode&&lf(t,lh)});let N=tp(()=>{l()&&b({maxScroll:r2()})},[l,b]);!function(e){let t=(0,q.useRef)(null),r=nZ(nP),n=nS("droppable"),{registry:l,marshal:i}=r,a=nk(e),o=tu(()=>({id:e.droppableId,type:e.type,mode:e.mode}),[e.droppableId,e.mode,e.type]),s=(0,q.useRef)(o),d=tu(()=>tC((e,r)=>{t.current||tt(),i.updateDroppableScroll(o.id,{x:e,y:r})}),[o.id,i]),c=tp(()=>{let e=t.current;return e&&e.env.closestScrollable?ln(e.env.closestScrollable):tf},[]),u=tp(()=>{let e=c();d(e.x,e.y)},[c,d]),p=tu(()=>e5(u),[u]),f=tp(()=>{let e=t.current,r=ls(e);(e&&r||tt(),e.scrollOptions.shouldPublishImmediately)?u():p()},[p,u]),g=tp((e,n)=>{t.current&&tt();let l=a.current,i=l.getDroppableRef();i||tt();let s={closestScrollable:lr(i),isFixedOnPage:ll(i)},d={ref:i,descriptor:o,env:s,scrollOptions:n};t.current=d;let c=(({ref:e,descriptor:t,env:r,windowScroll:n,direction:l,isDropDisabled:i,isCombineEnabled:a,shouldClipSubject:o})=>{let s=r.closestScrollable,d=((e,t)=>{let r=e3(e);if(!t||e!==t)return r;let n=r.paddingBox.top-t.scrollTop,l=r.paddingBox.left-t.scrollLeft,i=n+t.scrollHeight;return eQ({borderBox:eJ({top:n,right:l+t.scrollWidth,bottom:i,left:l},r.border),margin:r.margin,border:r.border,padding:r.padding})})(e,s),c=e1(d,n),u=(()=>{if(!s)return null;let e=e3(s),t={scrollHeight:s.scrollHeight,scrollWidth:s.scrollWidth};return{client:e,page:e1(e,n),scroll:ln(s),scrollSize:t,shouldClipSubject:o}})();return(({descriptor:e,isEnabled:t,isCombineEnabled:r,isFixedOnPage:n,direction:l,client:i,page:a,closest:o})=>{let s=(()=>{if(!o)return null;let{scrollSize:e,client:t}=o,r=r0({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,height:t.paddingBox.height,width:t.paddingBox.width});return{pageMarginBox:o.page.marginBox,frameClient:t,scrollSize:e,shouldClipSubject:o.shouldClipSubject,scroll:{initial:o.scroll,current:o.scroll,max:r,diff:{value:tf,displacement:tf}}}})(),d="vertical"===l?tz:tU,c=tE({page:a,withPlaceholder:null,axis:d,frame:s});return{descriptor:e,isCombineEnabled:r,isFixedOnPage:n,axis:d,isEnabled:t,client:i,page:a,frame:s,subject:c}})({descriptor:t,isEnabled:!i,isCombineEnabled:a,isFixedOnPage:r.isFixedOnPage,direction:l,client:d,page:c,closest:u})})({ref:i,descriptor:o,env:s,windowScroll:e,direction:l.direction,isDropDisabled:l.isDropDisabled,isCombineEnabled:l.isCombineEnabled,shouldClipSubject:!l.ignoreContainerClipping}),u=s.closestScrollable;return u&&(u.setAttribute(nf.contextId,r.contextId),u.addEventListener("scroll",f,lo(d.scrollOptions))),c},[r.contextId,o,f,a]),m=tp(()=>{let e=t.current,r=ls(e);return e&&r||tt(),ln(r)},[]),h=tp(()=>{let e=t.current;e||tt();let r=ls(e);t.current=null,r&&(p.cancel(),r.removeAttribute(nf.contextId),r.removeEventListener("scroll",f,lo(e.scrollOptions)))},[f,p]),b=tp(e=>{let r=t.current;r||tt();let n=ls(r);n||tt(),n.scrollTop+=e.y,n.scrollLeft+=e.x},[]),x=tu(()=>({getDimensionAndWatchScroll:g,getScrollWhileDragging:m,dragStopped:h,scroll:b}),[h,g,m,b]),y=tu(()=>({uniqueId:n,descriptor:o,callbacks:x}),[x,o,n]);nm(()=>(s.current=y.descriptor,l.droppable.register(y),()=>{t.current&&h(),l.droppable.unregister(y)}),[x,o,h,y,i,l.droppable]),nm(()=>{t.current&&i.updateDroppableIsEnabled(s.current.id,!e.isDropDisabled)},[e.isDropDisabled,i]),nm(()=>{t.current&&i.updateDroppableIsCombineEnabled(s.current.id,e.isCombineEnabled)},[e.isCombineEnabled,i])}({droppableId:s,type:d,mode:c,direction:u,isDropDisabled:f,isCombineEnabled:g,ignoreContainerClipping:p,getDroppableRef:y});let E=tu(()=>q.default.createElement(lb,{on:e.placeholder,shouldAnimate:e.shouldAnimatePlaceholder},({onClose:e,data:t,animate:r})=>q.default.createElement(lu,{placeholder:t,onClose:e,innerRef:I,animate:r,contextId:n,onTransitionEnd:N})),[n,N,e.placeholder,e.shouldAnimatePlaceholder,I]),D=tu(()=>({innerRef:v,placeholder:E,droppableProps:{"data-rfd-droppable-id":s,"data-rfd-droppable-context-id":n}}),[n,s,E,v]),C=h?h.dragging.draggableId:null,S=tu(()=>({droppableId:s,type:d,isUsingCloneFor:C}),[s,C,d]);return q.default.createElement(nX.Provider,{value:S},o(D,m),function(){if(!h)return null;let{dragging:e,render:t}=h,r=q.default.createElement(n8,{draggableId:e.draggableId,index:e.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(r,n)=>t(r,n,e));return Y.default.createPortal(r,x())}())});var lI=e.i(74886),lN=e.i(55716);let lE=(0,c.default)("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var lD=e.i(31278),lC=e.i(86311),lS=e.i(95468),lP=e.i(73884),lO=e.i(45139),lR=e.i(77814),lj=e.i(63337);let lA={backlog:"bg-muted text-muted-foreground",planning:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300",coding:"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-300",reviewing:"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-300",done:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-300"},lk={success:{className:"bg-unread-success",label:"Finished, not opened yet"},error:{className:"bg-unread-error",label:"Failed, not opened yet"},waiting:{className:"bg-unread-waiting",label:"Waiting for your input"}};function lT({tabs:e}){if(!e||0===e.length)return null;let t=e.some(e=>"running"===e.status),r=e.some(e=>"waiting"===e.status),n=e.some(e=>"error"===e.status),l=e.length>0&&e.every(e=>"success"===e.status);return t?(0,o.jsx)("span",{className:"inline-flex items-center gap-1 text-xs text-primary",children:(0,o.jsx)(lD.Loader2,{className:"size-3 animate-spin"})}):r?(0,o.jsx)("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:(0,o.jsx)(lC.MessageSquare,{className:"size-3"})}):n?(0,o.jsx)("span",{className:"inline-flex items-center gap-1 text-xs text-destructive",children:(0,o.jsx)(lP.XCircle,{className:"size-3"})}):l?(0,o.jsx)("span",{className:"inline-flex items-center gap-1 text-xs text-success",children:(0,o.jsx)(lS.CheckCircle2,{className:"size-3"})}):null}function lB({task:e,dragHandleProps:t,tabTodosMap:r}){let n=(0,d.useRouter)(),[l,i]=(0,s.useState)(!1),a=(0,z.getRepoColor)(e.owner,e.repo),c=e.tabs??[],u=c.some(e=>"running"===e.status),p=(0,lO.unreadKind)(e),f=(0,lj.sumTodoProgress)(c.map(e=>r?.get(e.tab_id)??e.todos??[])),g=e.id.slice(0,5)+"…",m=(0,s.useCallback)(t=>{t.stopPropagation(),navigator.clipboard.writeText(e.id).then(()=>{i(!0),setTimeout(()=>i(!1),2e3)})},[e.id]);return(0,o.jsxs)("div",{...t,"data-task-id":e.id,onClick:()=>n.push(`/tasks/${e.id}`),className:(0,T.cn)("relative rounded-lg border border-border bg-card p-3 shadow-sm transition-shadow hover:shadow-md cursor-pointer",u&&"opacity-50"),children:[p&&(0,o.jsx)("span",{role:"img","aria-label":lk[p].label,title:lk[p].label,className:(0,T.cn)("absolute left-0 top-2.5 bottom-2.5 w-[3px] rounded-r-[3px]",lk[p].className)}),(0,o.jsxs)("div",{className:"space-y-2",children:[(0,o.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,o.jsxs)("div",{className:"flex items-center gap-1",children:[(0,o.jsx)(lT,{tabs:e.tabs}),(0,o.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:g}),(0,o.jsx)("button",{onClick:m,className:"size-5 inline-flex items-center justify-center rounded-sm hover:bg-accent transition-colors",title:"Copy task ID",children:l?(0,o.jsx)(E.Check,{className:"size-3 text-success"}):(0,o.jsx)(lI.Copy,{className:"size-3 text-muted-foreground"})})]}),(0,o.jsx)("span",{className:(0,T.cn)("inline-flex h-5 items-center rounded-full px-2 text-[0.625rem] font-medium",lA[e.status]),children:e.status})]}),(0,o.jsx)("p",{className:"text-sm font-medium text-foreground",children:e.title}),e.description&&(0,o.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2",children:e.description}),f.total>0&&(0,o.jsxs)("div",{className:"space-y-0.5",children:[(0,o.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,o.jsx)(lR.Progress,{value:Math.round(f.completed/f.total*100),className:"flex-1 gap-0 [&_[data-slot=progress-track]]:h-[3px]"}),(0,o.jsxs)("span",{className:"text-[10px] text-muted-foreground tabular-nums shrink-0",children:[f.completed,"/",f.total]})]}),f.current&&(0,o.jsx)("p",{className:"truncate text-[10px] text-muted-foreground",title:f.current,children:f.current})]}),(0,o.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,o.jsxs)("span",{className:(0,T.cn)("inline-flex h-5 items-center rounded-full px-2 text-[0.625rem] font-medium",a.bg,a.text),children:[e.owner,"/",e.repo]}),e.branch&&(0,o.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[(0,o.jsx)(lN.GitBranch,{className:"size-3"}),(0,o.jsx)("span",{className:"truncate max-w-[120px]",children:e.branch})]}),null!=e.effort&&e.effort>0&&(0,o.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[(0,o.jsx)(lE,{className:"size-3"}),e.effort,"h"]})]})]})]})}function l_({droppableId:e,tasks:t,onReorder:r,onDragStateChange:n,tabTodosMap:l}){let i=(0,s.useCallback)(()=>{n?.(!0)},[n]),a=(0,s.useCallback)(e=>{if(n?.(!1),!e.destination)return;let{source:l,destination:i}=e;if(l.index===i.index)return;let a=[...t],[o]=a.splice(l.index,1);a.splice(i.index,0,o),r(a.map((e,t)=>({...e,order:t})))},[t,r,n]);return(0,o.jsx)(nK,{onDragStart:i,onDragEnd:a,children:(0,o.jsx)(lw,{droppableId:e,children:e=>(0,o.jsxs)("div",{ref:e.innerRef,...e.droppableProps,className:"space-y-2",children:[t.map((e,t)=>(0,o.jsx)(n6,{draggableId:e.id,index:t,children:t=>(0,o.jsx)("div",{ref:t.innerRef,...t.draggableProps,children:(0,o.jsx)(lB,{task:e,dragHandleProps:t.dragHandleProps,tabTodosMap:l})})},e.id)),e.placeholder]})})})}function lM({owner:e,repo:t,tasks:r,filters:n,onFilterChange:l,onReorder:i,onAddTask:a,onMoveToFront:s,onDragStateChange:d,tabTodosMap:c}){let u=(0,z.getRepoColor)(e,t),p=r.filter(lO.hasUnreadResult).length;return(0,o.jsxs)("div",{className:"flex h-full flex-col",children:[(0,o.jsxs)("div",{className:"flex-shrink-0 flex items-center gap-2 px-4 pt-4",children:[(0,o.jsx)("span",{className:(0,T.cn)("inline-flex h-6 min-w-0 items-center rounded-full px-2.5 text-xs font-medium",u.bg,u.text),title:`${e}/${t}`,"data-repo":`${e}/${t}`,children:(0,o.jsxs)("span",{className:"truncate",children:[e,"/",t]})}),(0,o.jsx)("span",{className:"text-xs tabular-nums text-muted-foreground",children:r.length}),p>0&&(0,o.jsx)("span",{className:"inline-flex h-5 min-w-5 items-center justify-center rounded-full bg-primary px-1.5 text-[0.625rem] font-medium tabular-nums text-primary-foreground",title:`${p} unopened result${p>1?"s":""}`,children:p}),s&&(0,o.jsx)(x.Button,{variant:"ghost",size:"icon",onClick:s,className:"ml-auto size-6 flex-shrink-0 text-muted-foreground",title:"Move to front",children:(0,o.jsx)(_,{className:"size-3.5"})})]}),(0,o.jsx)("div",{className:"flex-shrink-0 px-4 pt-2",children:(0,o.jsx)(H,{repositories:[],filters:n,onFilterChange:l,onAddTask:a})}),(0,o.jsx)("div",{className:"flex-1 overflow-y-auto px-4 py-4",children:r.length>0?(0,o.jsx)(l_,{droppableId:`planner-task-list-${e}/${t}`,tasks:r,onReorder:i,onDragStateChange:d,tabTodosMap:c}):(0,o.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No tasks found"})})]})}var lL=e.i(92943);function lG(e,t){return`${e}/${t}`}let l$={statuses:[],repos:[],search:""},lF="h-full w-full flex-shrink-0 snap-start border-r border-border lg:w-[22.5rem]";function lz({repositories:e,tasksByRepo:t,filtersByRepo:r,onFilterChange:n,onReorder:l,onMoveRepositoryToFront:i,onAddTask:a,onCloneClick:d,isCloneOnboarding:c=!1,isCloneDialogOpen:u=!1,tabTodosMap:p,initialFocus:f}){let[g,m]=(0,s.useState)(!1),h=(0,s.useRef)(null),b=(0,s.useRef)(!1);(0,s.useLayoutEffect)(()=>{if(b.current||!f)return;b.current=!0,(0,lL.clearLastViewedTask)();let e=h.current;if(!e)return;let t=e.querySelector(`[data-task-id="${f.taskId}"]`),r=t?.closest("[data-repo-key]")??(f.repoKey?e.querySelector(`[data-repo-key="${f.repoKey}"]`):null);r?.scrollIntoView({block:"nearest",inline:"start",behavior:"instant"}),t?.scrollIntoView({block:"center",inline:"nearest",behavior:"instant"})},[f]);let x=(0,s.useMemo)(()=>[...e].sort((e,t)=>e.order-t.order),[e]);return(0,o.jsxs)("div",{ref:h,className:(0,T.cn)("flex flex-1 overflow-x-auto overflow-y-hidden overscroll-x-contain",!g&&"snap-x snap-mandatory"),children:[x.map((e,s)=>{let d=lG(e.owner,e.repo);return(0,o.jsx)("div",{className:lF,"data-repo-key":d,children:(0,o.jsx)(lM,{owner:e.owner,repo:e.repo,tasks:t.get(d)??[],filters:r[d]??l$,onFilterChange:e=>n(d,e),onReorder:l,onAddTask:()=>a({owner:e.owner,repo:e.repo}),onMoveToFront:0===s?void 0:()=>i(e.id),onDragStateChange:m,tabTodosMap:p})},e.id)}),(0,o.jsx)("div",{className:lF,children:(0,o.jsx)(B,{onCloneClick:d,isOnboarding:c,isCloneDialogOpen:u})})]})}var lU=e.i(70935),lW=e.i(95008),lH=e.i(801),lV=e.i(51846),lq=e.i(57024);let lY="tsunagi:column-filters",lJ={statuses:[],repos:[],search:""},lK=null,lX=null;e.s(["default",0,function(){let e,t=(0,d.useRouter)(),{tasks:r,setTasks:n,hasLoaded:l,reload:i}=(0,lH.useLiveTasks)({onTaskCreated:(e,t)=>{lq.toaster.create(t.length>0?{type:"warning",title:"Task created with warnings",description:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("p",{children:e.title}),t.map(e=>(0,o.jsx)("p",{children:e},e))]}),duration:1/0}:{type:"success",title:"Task created",description:e.title,duration:5e3})},onTaskUpdated:e=>{lq.toaster.create({type:"info",title:"Task updated",description:e.title,duration:5e3})},onTaskDeleted:(e,t)=>{t&&lq.toaster.create({type:"info",title:"Task deleted",description:t.title,duration:5e3})}}),[a,c]=(0,s.useState)(()=>lK??[]),[u,p]=(0,s.useState)(null!==lK),[f,g]=(0,s.useState)(lX);(0,s.useEffect)(()=>{u&&(lK=a)},[a,u]),(0,s.useEffect)(()=>{lX=f},[f]);let[m,h]=(0,s.useState)(!1),[b,x]=(0,s.useState)(null),[y,v]=(0,s.useState)(!1),[w,N]=(0,s.useState)(()=>{try{let e=sessionStorage.getItem(lY);if(e)return JSON.parse(e)}catch{}return{}}),[E]=(0,s.useState)(()=>(0,lL.peekLastViewedTask)()),S=(0,s.useMemo)(()=>{if(!E)return null;let e=r.find(e=>e.id===E);return{taskId:E,repoKey:e?lG(e.owner,e.repo):void 0}},[E,r]),P=(0,s.useMemo)(()=>r.filter(lO.hasUnreadResult).length,[r]);(0,lV.useDocumentTitle)((e=Object.entries(w).filter(([,e])=>e.statuses.length>0||!!e.search.trim()).map(([e,t])=>{let r=[];return t.search.trim()&&r.push(`"${t.search.trim()}"`),t.statuses.length&&r.push(t.statuses.join(", ")),`${e.split("/").pop()??e}: ${r.join(" / ")}`})).length?e.join(" | "):void 0,P),(0,s.useEffect)(()=>{try{sessionStorage.setItem(lY,JSON.stringify(w))}catch{}},[w]);let O=(0,s.useCallback)((e,t)=>{N(r=>({...r,[e]:t}))},[]),j=(0,s.useMemo)(()=>{let e,t={hasRepositories:a.length>0,hasAuth:!0===f,hasTasks:r.length>0};return e=!1===f?"env":t.hasRepositories?t.hasTasks?"complete":"task":"clone",{state:t,nextStep:e}},[a,f,r]),k=(0,s.useMemo)(()=>{let e=new Map;for(let t of r){let r=lG(t.owner,t.repo),n=w[r]??lJ;if(n.statuses.length>0&&!n.statuses.includes(t.status)||n.search&&!t.title.toLowerCase().includes(n.search.toLowerCase()))continue;let l=e.get(r);l?l.push(t):e.set(r,[t])}for(let t of e.values())t.sort((e,t)=>e.order-t.order);return e},[r,w]),T=async()=>{try{let e=(await fetch((0,lU.apiUrl)("/api/owners")).then(e=>e.json())).data.owners.flatMap(e=>e.repositories);c(e)}catch(e){console.error("Failed to load repositories:",e)}finally{p(!0)}},B=async()=>{try{let e=await fetch((0,lU.apiUrl)("/api/onboarding/status")).then(e=>e.json());g(!!e.data?.completed)}catch(e){console.error("Failed to load onboarding status:",e)}},_=()=>Promise.all([T(),B()]),M=async()=>{await Promise.all([i(),_()])};(0,s.useEffect)(()=>{_()},[]);let L=function(e){let[t,r]=(0,s.useState)(new Map),n=(0,s.useRef)(new Map);return(0,s.useEffect)(()=>{let e=(0,lW.getSharedSocket)(),t=({sessionId:e,todos:t})=>{r(r=>{let n=new Map(r);return n.set(e,t),n})};return e.on("todos-updated",t),()=>{e.off("todos-updated",t)}},[]),(0,s.useEffect)(()=>{(0,lW.syncRoomSubscriptions)(n.current,e.map(e=>`tab:${e}`))},[e]),(0,s.useEffect)(()=>{let e=n.current;return()=>{(0,lW.clearRoomSubscriptions)(e)}},[]),t}((0,s.useMemo)(()=>r.flatMap(e=>(e.tabs??[]).filter(e=>"running"===e.status).map(e=>e.tab_id)),[r])),{isDeleting:G,deletedCount:$,errorCount:F,totalCount:z,isCompleted:U,startBatchDelete:W,reset:H}=function(){let[e,t]=(0,s.useState)({batchId:null,totalCount:0,deletedCount:0,errorCount:0,isDeleting:!1,isCompleted:!1}),r=(0,s.useCallback)(async(e=7)=>{try{let r=await fetch((0,lU.apiUrl)("/api/tasks/batch-delete"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({daysAgo:e})});if(!r.ok)throw Error("Failed to start batch delete");let{batchId:n,totalCount:l}=(await r.json()).data;if(0===l)return{batchId:n,totalCount:l};return t({batchId:n,totalCount:l,deletedCount:l,errorCount:0,isDeleting:!1,isCompleted:!0}),{batchId:n,totalCount:l}}catch(e){throw console.error("Batch delete error:",e),e}},[]),n=(0,s.useCallback)(()=>{t({batchId:null,totalCount:0,deletedCount:0,errorCount:0,isDeleting:!1,isCompleted:!1})},[]);return{...e,startBatchDelete:r,reset:n}}();(0,s.useEffect)(()=>{(G||U)&&queueMicrotask(()=>{if(G){let e=F>0?`${$} / ${z} (${F} failed)`:`${$} / ${z}`;lq.toaster.update("batch-delete-progress",{type:"loading",title:"Deleting tasks...",description:e,duration:1/0})}if(U){lq.toaster.dismiss("batch-delete-progress");let e=F>0?`Deleted ${$} tasks (${F} failed)`:`Deleted ${$} tasks`;lq.toaster.create({type:F>0?"warning":"success",title:e,duration:5e3}),setTimeout(()=>{H()},5e3)}})},[G,U,$,F,z,H]);let V=(0,s.useCallback)(async e=>{n(t=>{let r=new Map(e.map(e=>[e.id,e]));return t.map(e=>r.get(e.id)??e)});try{await Promise.all(e.map((e,t)=>fetch((0,lU.apiUrl)(`/api/tasks/${e.id}`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({order:t})})))}catch(e){console.error("Failed to update task order:",e)}},[n]),q=(0,s.useCallback)(async e=>{let t=a.find(t=>t.id===e);if(!t)return;let r=[t,...a.filter(t=>t.id!==e).sort((e,t)=>e.order-t.order)].map((e,t)=>({...e,order:t}));c(r);try{await fetch((0,lU.apiUrl)("/api/repos/reorder"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({repoIds:r.map(e=>e.id)})})}catch(e){console.error("Failed to update repository order:",e)}},[a]),Y=async e=>{try{let t=await fetch((0,lU.apiUrl)("/api/clone"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){let e=await t.json().then(e=>e?.error).catch(()=>void 0);throw Error(e||`Failed to clone repository (HTTP ${t.status})`)}let r=await t.json();return c(e=>[...e,r.data.repository]),await M(),{cloneUrl:r.data.repository.cloneUrl,fallbackProtocol:r.data.fallbackProtocol??null}}catch(e){throw console.error("Failed to clone repository:",e),e}},J=async e=>{try{let t=await W(e);if(!t||0===t.totalCount)return void lq.toaster.create({type:"info",title:"No tasks to delete",description:`No tasks completed more than ${e} days ago`,duration:3e3});lq.toaster.create({id:"batch-delete-progress",type:"loading",title:"Deleting tasks...",description:`0 / ${t.totalCount}`,duration:1/0})}catch(e){console.error("Failed to start batch delete:",e),lq.toaster.create({type:"error",title:"Failed to delete tasks",description:String(e),duration:5e3})}};return l&&u?(0,o.jsxs)("div",{className:"h-screen flex flex-col",children:[(0,o.jsx)(I,{onSettingsClick:()=>t.push("/settings"),onReload:M,nextStep:j.nextStep}),(0,o.jsxs)("div",{className:"relative flex-1 overflow-hidden flex",children:[(0,o.jsx)(lz,{repositories:a,tasksByRepo:k,filtersByRepo:w,onFilterChange:O,onReorder:V,onMoveRepositoryToFront:q,onAddTask:x,onCloneClick:()=>h(!0),isCloneOnboarding:"clone"===j.nextStep,isCloneDialogOpen:m,tabTodosMap:L,initialFocus:S}),"env"===j.nextStep&&(0,o.jsx)(D,{hasRepositories:j.state.hasRepositories,hasEnvVars:j.state.hasAuth,hasTasks:j.state.hasTasks})]}),(0,o.jsx)(R,{isOpen:m,onClose:()=>h(!1),onClone:Y,isOnboarding:"clone"===j.nextStep}),(0,o.jsx)(C.LazyTaskDialog,{mode:"create",isOpen:null!==b,onClose:()=>x(null),repositories:a,defaultRepo:b??void 0}),(0,o.jsx)(A,{isOpen:y,onClose:()=>v(!1),onConfirm:J})]}):(0,o.jsx)("div",{className:"h-screen flex items-center justify-center bg-background",children:(0,o.jsx)("div",{className:"text-center",children:(0,o.jsx)("div",{className:"text-2xl text-foreground",children:"Loading..."})})})}],39798)}]);
|
|
64
|
+
`}}],"always"),resting:ng(i,"resting"),dragging:ng(i,"dragging"),dropAnimating:ng(i,"dropAnimating"),userCancel:ng(i,"userCancel")}},[I]),i=(0,q.useRef)(null),a=(0,q.useRef)(null),o=tp(tC(e=>{let t=a.current;t||tt(),t.textContent=e}),[]),nm(()=>{(i.current||a.current)&&tt();let e=nb(D),t=nb(D);return i.current=e,a.current=t,e.setAttribute(`${nd}-always`,I),t.setAttribute(`${nd}-dynamic`,I),nh().appendChild(e),nh().appendChild(t),s(l.always),o(l.resting),()=>{let e=e=>{let t=e.current;t||tt(),nh().removeChild(t),e.current=null};e(i),e(a)}},[D,s=tp(e=>{let t=i.current;t||tt(),t.textContent=e},[]),o,l.always,l.resting,I]),d=tp(()=>o(l.dragging),[o,l.dragging]),c=tp(e=>{"DROP"===e?o(l.dropAnimating):o(l.userCancel)},[o,l.dropAnimating,l.userCancel]),tu(()=>({dragging:d,dropping:c,resting:u}),[d,c,u=tp(()=>{a.current&&o(l.resting)},[o,l.resting])])),T=tp(e=>{nY(S).dispatch(e)},[]),B=tu(()=>ee({publishWhileDragging:ry,updateDroppableScroll:rw,updateDroppableIsEnabled:rI,updateDroppableIsCombineEnabled:rN,collectionStarting:rv},T),[T]),_=(p=tu(nI,[]),(0,q.useEffect)(()=>function(){p.clean()},[p]),p),M=tu(()=>{let e,t,r;return e=null,t=function({registry:e,callbacks:t}){let r=rZ(),n=null,l=()=>{n||(t.collectionStarting(),n=requestAnimationFrame(()=>{n=null,rp();let{additions:l,removals:i,modified:a}=r,o=Object.keys(l).map(t=>e.draggable.getById(t).getDimension(tf)).sort((e,t)=>e.descriptor.index-t.descriptor.index),s=Object.keys(a).map(t=>{let r=e.droppable.getById(t).callbacks.getScrollWhileDragging();return{droppableId:t,scroll:r}}),d={additions:o,removals:Object.keys(i),modified:s};r=rZ(),rf(),t.publish(d)}))};return{add:e=>{let t=e.descriptor.id;r.additions[t]=e,r.modified[e.descriptor.droppableId]=!0,r.removals[t]&&delete r.removals[t],l()},remove:e=>{let t=e.descriptor;r.removals[t.id]=!0,r.modified[t.droppableId]=!0,r.additions[t.id]&&delete r.additions[t.id],l()},stop:()=>{n&&(cancelAnimationFrame(n),n=null,r=rZ())}}}({callbacks:{publish:B.publishWhileDragging,collectionStarting:B.collectionStarting},registry:_}),r=r=>{e||tt();let n=e.critical.draggable;"ADDITION"===r.type&&r3(_,n,r.value)&&t.add(r.value),"REMOVAL"===r.type&&r3(_,n,r.value)&&t.remove(r.value)},{updateDroppableIsEnabled:(t,r)=>{_.droppable.exists(t)||tt(),e&&B.updateDroppableIsEnabled({id:t,isEnabled:r})},updateDroppableIsCombineEnabled:(t,r)=>{e&&(_.droppable.exists(t)||tt(),B.updateDroppableIsCombineEnabled({id:t,isCombineEnabled:r}))},scrollDroppable:(t,r)=>{e&&_.droppable.getById(t).callbacks.scroll(r)},updateDroppableScroll:(t,r)=>{e&&(_.droppable.exists(t)||tt(),B.updateDroppableScroll({id:t,newScroll:r}))},startPublishing:t=>{e&&tt();let n=_.draggable.getById(t.draggableId),l=_.droppable.getById(n.descriptor.droppableId),i={draggable:n.descriptor,droppable:l.descriptor};return e={critical:i,unsubscribe:_.subscribe(r)},(({critical:e,scrollOptions:t,registry:r})=>{let n,l,i,a,o,s;rp();let d=(n=rH(),l=r2(),i=n.y,a=n.x,s=(o=r1()).clientWidth,{frame:eY({top:i,left:a,right:a+s,bottom:i+o.clientHeight}),scroll:{initial:n,current:n,max:l,diff:{value:tf,displacement:tf}}}),c=d.scroll.current,u=e.droppable,p=r.droppable.getAllByType(u.type).map(e=>e.callbacks.getDimensionAndWatchScroll(c,t)),f={draggables:tP(r.draggable.getAllByType(e.draggable.type).map(e=>e.getDimension(c))),droppables:tS(p)};return rf(),{dimensions:f,critical:e,viewport:d}})({critical:i,registry:_,scrollOptions:t.scrollOptions})},stopPublishing:()=>{if(!e)return;t.stop();let r=e.critical.droppable;_.droppable.getAllByType(r.type).forEach(e=>e.callbacks.dragStopped()),e.unsubscribe(),e=null}}},[_,B]),L=tu(()=>(({scrollDroppable:e,scrollWindow:t,move:r,getAutoScrollerOptions:n})=>{let l=(({scrollWindow:e,scrollDroppable:t,getAutoScrollerOptions:r=()=>r6})=>{let n=e5(e),l=e5(t),i=null,a=e=>{i||tt();let{shouldUseTimeDampening:t,dragStartTime:a}=i;ns({state:e,scrollWindow:n,scrollDroppable:l,dragStartTime:a,shouldUseTimeDampening:t,getAutoScrollerOptions:r})};return{start:e=>{rp(),i&&tt();let t=Date.now(),n=!1,l=()=>{n=!0};ns({state:e,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:l,scrollDroppable:l,getAutoScrollerOptions:r}),i={dragStartTime:t,shouldUseTimeDampening:n},rf(),n&&a(e)},stop:()=>{i&&(n.cancel(),l.cancel(),i=null)},scroll:a}})({scrollWindow:t,scrollDroppable:e,getAutoScrollerOptions:n}),i=(({move:e,scrollDroppable:t,scrollWindow:r})=>n=>{let l=n.scrollJumpRequest;if(!l)return;let i=rt(n.impact);i||tt();let a=((e,r)=>{let n;if(!no(e,r))return r;let l=(n=e.frame)&&no(e,r)?nl({current:n.scroll.current,max:n.scroll.max,change:r}):null;if(!l)return t(e.descriptor.id,r),null;let i=tm(r,l);return t(e.descriptor.id,i),tm(r,i)})(n.dimensions.droppables[i],l);if(!a)return;let o=n.viewport,s=((e,t,n)=>{if(!e||!na(t,n))return n;let l=((e,t)=>{if(!na(e,t))return null;let r=e.scroll.max;return nl({current:e.scroll.current,max:r,change:t})})(t,n);if(!l)return r(n),null;let i=tm(n,l);return r(i),tm(n,i)})(n.isWindowScrollAllowed,o,a);s&&e({client:tg(n.current.client.selection,s)})})({move:r,scrollWindow:t,scrollDroppable:e});return{scroll:e=>{n().disabled||"DRAGGING"!==e.phase||("FLUID"===e.movementMode?l.scroll(e):e.scrollJumpRequest&&i(e))},start:l.start,stop:l.stop}})({scrollWindow:r4,scrollDroppable:M.scrollDroppable,getAutoScrollerOptions:R,...ee({move:rE},T)}),[M.scrollDroppable,T,R]),G=(f=(0,q.useRef)({}),g=(0,q.useRef)(null),m=(0,q.useRef)(null),h=(0,q.useRef)(!1),b=tp(function(e,t){let r={id:e,focus:t};return f.current[e]=r,function(){let t=f.current;t[e]!==r&&delete t[e]}},[]),x=tp(function(e){let t=nw(I,e);t&&t!==document.activeElement&&t.focus()},[I]),y=tp(function(e,t){g.current===e&&(g.current=t)},[]),v=tp(function(){m.current||h.current&&(m.current=requestAnimationFrame(()=>{m.current=null;let e=g.current;e&&x(e)}))},[x]),w=tp(function(e){g.current=null;let t=document.activeElement;t&&t.getAttribute(nc.draggableId)===e&&(g.current=e)},[]),nm(()=>(h.current=!0,function(){h.current=!1;let e=m.current;e&&cancelAnimationFrame(e)}),[]),tu(()=>({register:b,tryRecordFocus:w,tryRestoreFocusRecorded:v,tryShiftRecord:y}),[b,w,v,y])),$=tu(()=>(({dimensionMarshal:e,focusMarshal:t,styleMarshal:r,getResponders:n,announce:l,autoScroller:i})=>{let a,o,s,d,c,u;return function e(t,r,n){if("function"!=typeof t)throw Error(J(2));if("function"==typeof r&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw Error(J(0));if("function"==typeof r&&void 0===n&&(n=r,r=void 0),void 0!==n){if("function"!=typeof n)throw Error(J(1));return n(e)(t,r)}let l=t,i=r,a=new Map,o=a,s=0,d=!1;function c(){o===a&&(o=new Map,a.forEach((e,t)=>{o.set(t,e)}))}function u(){if(d)throw Error(J(3));return i}function p(e){if("function"!=typeof e)throw Error(J(4));if(d)throw Error(J(5));let t=!0;c();let r=s++;return o.set(r,e),function(){if(t){if(d)throw Error(J(6));t=!1,c(),o.delete(r),a=null}}}function f(e){if(!function(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}(e))throw Error(J(7));if(void 0===e.type)throw Error(J(8));if("string"!=typeof e.type)throw Error(J(17));if(d)throw Error(J(9));try{d=!0,i=l(i,e)}finally{d=!1}return(a=o).forEach(e=>{e()}),e}return f({type:Q.INIT}),{dispatch:f,subscribe:p,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw Error(J(10));l=e,f({type:Q.REPLACE})},[K]:function(){return{subscribe(e){if("object"!=typeof e||null===e)throw Error(J(11));function t(){e.next&&e.next(u())}return t(),{unsubscribe:p(t)}},[K](){return this}}}}}(rb,et(function(...e){return t=>(r,n)=>{let l=t(r,n),i=()=>{throw Error(J(15))},a={getState:l.getState,dispatch:(e,...t)=>i(e,...t)};return i=et(...e.map(e=>e(a)))(l.dispatch),{...l,dispatch:i}}}(()=>e=>t=>{rx(t,"INITIAL_PUBLISH")&&r.dragging(),rx(t,"DROP_ANIMATE")&&r.dropping(t.payload.completed.result.reason),(rx(t,"FLUSH")||rx(t,"DROP_COMPLETE"))&&r.resting(),e(t)},()=>t=>r=>{(rx(r,"DROP_COMPLETE")||rx(r,"FLUSH")||rx(r,"DROP_ANIMATE"))&&e.stopPublishing(),t(r)},({getState:t,dispatch:r})=>n=>l=>{if(!rx(l,"LIFT"))return void n(l);let{id:i,clientSelection:a,movementMode:o}=l.payload,s=t();"DROP_ANIMATING"===s.phase&&r(rR({completed:s.completed})),"IDLE"!==t().phase&&tt(),r(rO()),r({type:"BEFORE_INITIAL_CAPTURE",payload:{draggableId:i,movementMode:o}});let{critical:d,dimensions:c,viewport:u}=e.startPublishing({draggableId:i,scrollOptions:{shouldPublishImmediately:"SNAP"===o}});r({type:"INITIAL_PUBLISH",payload:{critical:d,dimensions:c,clientSelection:a,movementMode:o,viewport:u}})},rW,rK,rX,rQ,e=>t=>r=>{if(rx(r,"DROP_COMPLETE")||rx(r,"DROP_ANIMATE")||rx(r,"FLUSH")){i.stop(),t(r);return}if(rx(r,"INITIAL_PUBLISH")){t(r);let n=e.getState();"DRAGGING"!==n.phase&&tt(),i.start(n);return}t(r),i.scroll(e.getState())},rV,(a=!1,()=>e=>r=>{if(rx(r,"INITIAL_PUBLISH")){a=!0,t.tryRecordFocus(r.payload.critical.draggable.id),e(r),t.tryRestoreFocusRecorded();return}if(e(r),a){if(rx(r,"FLUSH")){a=!1,t.tryRestoreFocusRecorded();return}if(rx(r,"DROP_COMPLETE")){a=!1;let e=r.payload.completed.result;e.combine&&t.tryShiftRecord(e.draggableId,e.combine.draggableId),t.tryRestoreFocusRecorded()}}}),(o=[],s={add:e=>{let t=setTimeout(()=>(e=>{let t=o.findIndex(t=>t.timerId===e);-1===t&&tt();let[r]=o.splice(t,1);r.callback()})(t));o.push({timerId:t,callback:e})},flush:()=>{if(!o.length)return;let e=[...o];o.length=0,e.forEach(e=>{clearTimeout(e.timerId),e.callback()})}},d=null,u={beforeCapture:(e,t)=>{d&&tt(),rq("onBeforeCapture",()=>{let r=n().onBeforeCapture;r&&r({draggableId:e,mode:t})})},beforeStart:(e,t)=>{d&&tt(),rq("onBeforeDragStart",()=>{let r=n().onBeforeDragStart;r&&r(rY(e,t))})},start:(e,t)=>{d&&tt();let r=rY(e,t);d={mode:t,lastCritical:e,lastLocation:r.source,lastCombine:null},s.add(()=>{rq("onDragStart",()=>rJ(n().onDragStart,r,l,to))})},update:(e,t)=>{var r,i;let a=tA(t),o=tk(t);d||tt();let c=!((e,t)=>{if(e===t)return!0;let 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})(e,d.lastCritical);c&&(d.lastCritical=e);let u=(r=d.lastLocation,(null!=r||null!=a)&&(null==r||null==a||r.droppableId!==a.droppableId||r.index!==a.index));u&&(d.lastLocation=a);let p=(i=d.lastCombine,(null!=i||null!=o)&&(null==i||null==o||i.draggableId!==o.draggableId||i.droppableId!==o.droppableId));if(p&&(d.lastCombine=o),!c&&!u&&!p)return;let f={...rY(e,d.mode),combine:o,destination:a};s.add(()=>{rq("onDragUpdate",()=>rJ(n().onDragUpdate,f,l,ts))})},flush:()=>{d||tt(),s.flush()},drop:c=e=>{d||tt(),d=null,rq("onDragEnd",()=>rJ(n().onDragEnd,e,l,td))},abort:()=>{d&&c({...rY(d.lastCritical,d.mode),combine:null,destination:null,reason:"CANCEL"})}},e=>t=>r=>{if(rx(r,"BEFORE_INITIAL_CAPTURE"))return void u.beforeCapture(r.payload.draggableId,r.payload.movementMode);if(rx(r,"INITIAL_PUBLISH")){let e=r.payload.critical;u.beforeStart(e,r.payload.movementMode),t(r),u.start(e,r.payload.movementMode);return}if(rx(r,"DROP_COMPLETE")){let e=r.payload.completed.result;u.flush(),t(r),u.drop(e);return}if(t(r),rx(r,"FLUSH"))return void u.abort();let n=e.getState();"DRAGGING"===n.phase&&u.update(n.critical,n.impact)}))))})({announce:j,autoScroller:L,dimensionMarshal:M,focusMarshal:G,getResponders:O,styleMarshal:k}),[j,L,M,G,O,k]);S.current=$;let F=tp(()=>{let e=nY(S);"IDLE"!==e.getState().phase&&e.dispatch(rO())},[]),z=tp(()=>{let e=nY(S).getState();return"DROP_ANIMATING"===e.phase||"IDLE"!==e.phase&&e.isDragging},[]);N(tu(()=>({isDragging:z,tryAbort:F}),[z,F]));let U=tp(e=>r5(nY(S).getState(),e),[]),W=tp(()=>rr(nY(S).getState()),[]),H=tu(()=>({marshal:M,focus:G,contextId:I,canLift:U,isMovementAllowed:W,dragHandleUsageInstructionsId:A,registry:_}),[I,M,A,G,U,W,_]);return!function({contextId:e,store:t,registry:r,customSensors:n,enableDefaultSensors:l}){let i=[...l?nq:[],...n||[]],a=(0,q.useState)(()=>(function(){let e=null;function t(){e||tt(),e=null}return{isClaimed:function(){return!!e},isActive:function(t){return t===e},claim:function(t){e&&tt();let r={abandon:t};return e=r,r},release:t,tryAbandon:function(){e&&(e.abandon(),t())}}})())[0],o=tp(function(e,t){nT(e)&&!nT(t)&&a.tryAbandon()},[a]);nm(function(){let e=t.getState();return t.subscribe(()=>{let r=t.getState();o(e,r),e=r})},[a,t,o]),nm(()=>a.tryAbandon,[a.tryAbandon]);let s=tp(e=>nV({lockAPI:a,registry:r,store:t,draggableId:e}),[a,r,t]),d=tp((n,l,i)=>(function({lockAPI:e,contextId:t,store:r,registry:n,draggableId:l,forceSensorStop:i,sourceEvent:a}){var o;let s,d;if(!nV({lockAPI:e,store:r,registry:n,draggableId:l}))return null;let c=n.draggable.getById(l),u=(o=c.descriptor.id,(s=nx(document,`[${nu.contextId}="${t}"]`).find(e=>e.getAttribute(nu.id)===o))&&nv(s)?s:null);if(!u||a&&!c.options.canDragInteractiveElements&&nv(d=a.target)&&function e(t,r){if(null==r)return!1;if(nz.includes(r.tagName.toLowerCase()))return!0;let n=r.getAttribute("contenteditable");return"true"===n||""===n||r!==t&&e(t,r.parentElement)}(u,d))return null;let p=e.claim(i||e7),f="PRE_DRAG";function g(){return c.options.shouldRespectForcePress}function m(){return e.isActive(p)}let h=(function(e,t){nH({expected:e,phase:f,isLockActive:m,shouldWarn:!0})&&r.dispatch(t())}).bind(null,"DRAGGING");function b(t){function n(){e.release(),f="COMPLETED"}function l(e,i={shouldBlockNextClick:!1}){t.cleanup(),i.shouldBlockNextClick&&setTimeout(e9(window,[{eventName:"click",fn:nW,options:{once:!0,passive:!1,capture:!0}}])),n(),r.dispatch(rj({reason:e}))}return"PRE_DRAG"!==f&&(n(),tt()),r.dispatch({type:"LIFT",payload:t.liftActionArgs}),f="DRAGGING",{isActive:()=>nH({expected:"DRAGGING",phase:f,isLockActive:m,shouldWarn:!1}),shouldRespectForcePress:g,drop:e=>l("DROP",e),cancel:e=>l("CANCEL",e),...t.actions}}return{isActive:()=>nH({expected:"PRE_DRAG",phase:f,isLockActive:m,shouldWarn:!1}),shouldRespectForcePress:g,fluidLift:function(e){let t=e5(e=>{h(()=>rE({client:e}))});return{...b({liftActionArgs:{id:l,clientSelection:e,movementMode:"FLUID"},cleanup:()=>t.cancel(),actions:{move:t}}),move:t}},snapLift:function(){return b({liftActionArgs:{id:l,clientSelection:eY(u.getBoundingClientRect()).center,movementMode:"SNAP"},cleanup:e7,actions:{moveUp:()=>h(rD),moveRight:()=>h(rS),moveDown:()=>h(rC),moveLeft:()=>h(rP)}})},abort:function(){nH({expected:"PRE_DRAG",phase:f,isLockActive:m,shouldWarn:!0})&&e.release()}}})({lockAPI:a,registry:r,contextId:e,store:t,draggableId:n,forceSensorStop:l||null,sourceEvent:i&&i.sourceEvent?i.sourceEvent:null}),[e,a,r,t]),c=tp(t=>{let r;return(r=function(e,t){let r=t.target;if(!(r instanceof ny(r).Element))return null;let n=`[${nc.contextId}="${e}"]`,l=r.closest?r.closest(n):function e(t,r){return null==t?null:t[nU](r)?t:e(t.parentElement,r)}(r,n);return l&&nv(l)?l:null}(e,t))?r.getAttribute(nc.draggableId):null},[e]),u=tp(e=>{let t=r.draggable.findById(e);return t?t.options:null},[r.draggable]),p=tp(function(){a.isClaimed()&&(a.tryAbandon(),"IDLE"!==t.getState().phase&&t.dispatch(rO()))},[a,t]),f=tp(()=>a.isClaimed(),[a]),g=tu(()=>({canGetLock:s,tryGetLock:d,findClosestDraggableId:c,findOptionsForDraggable:u,tryReleaseLock:p,isLockClaimed:f}),[s,d,c,u,p,f]);nj(()=>{let e=nk(i);nA(()=>{e.current.length!==i.length&&tt(!1)})});for(let e=0;e<i.length;e++)i[e](g)}({contextId:I,store:$,registry:_,customSensors:E||null,enableDefaultSensors:!1!==e.enableDefaultSensors}),(0,q.useEffect)(()=>F,[F]),q.default.createElement(nP.Provider,{value:H},q.default.createElement(eH,{context:nN,store:$},e.children))}function nK(e){let t=q.default.useId(),r=e.dragHandleUsageInstructions||tn;return q.default.createElement(tr,null,n=>q.default.createElement(nJ,{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))}var nX=q.default.createContext(null);function nQ(e){e&&nv(e)||tt()}function nZ(e){let t=(0,q.useContext)(e);return t||tt(),t}function n0(e){e.preventDefault()}var n1=(e,t)=>e===t,n2=e=>{let{combine:t,destination:r}=e;return r?r.droppableId:t?t.droppableId:null};function n3(e=null){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}let n5={mapped:{type:"SECONDARY",offset:tf,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:n3(null)}},n4=eW(()=>{let e,t,r,n,l,i,a,o,s=(e=tC((e,t)=>({x:e,y:t})),t=tC((e,t,r=null,n=null,l=null)=>({isDragging:!0,isClone:t,isDropAnimating:!!l,dropAnimation:l,mode:e,draggingOver:r,combineWith:n,combineTargetFor:null})),r=tC((e,r,n,l,i=null,a=null,o=null)=>({mapped:{type:"DRAGGING",dropping:null,draggingOver:i,combineWith:a,mode:r,offset:e,dimension:n,forceShouldAnimate:o,snapshot:t(r,l,i,a,null)}})),(n,l)=>{if(nT(n)){let t;if(n.critical.draggable.id!==l.draggableId)return null;let i=n.current.client.offset,a=n.dimensions.draggables[l.draggableId],o=rt(n.impact),s=(t=n.impact).at&&"COMBINE"===t.at.type?t.at.combine.draggableId:null,d=n.forceShouldAnimate;return r(e(i.x,i.y),n.movementMode,a,l.isClone,o,s,d)}if("DROP_ANIMATING"===n.phase){let e=n.completed;if(e.result.draggableId!==l.draggableId)return null;let r=l.isClone,i=n.dimensions.draggables[l.draggableId],a=e.result,o=a.mode,s=n2(a),d=a.combine?a.combine.draggableId:null,c={duration:n.dropDuration,curve:rk,moveTo:n.newHomeClientOffset,opacity:d?rT:null,scale:d?r_:null};return{mapped:{type:"DRAGGING",offset:n.newHomeClientOffset,dimension:i,dropping:c,draggingOver:s,combineWith:d,mode:o,forceShouldAnimate:null,snapshot:t(o,r,s,d,c)}}}return null}),d=(n=tC((e,t)=>({x:e,y:t})),l=tC(n3),i=tC((e,t=null,r)=>({mapped:{type:"SECONDARY",offset:e,combineTargetFor:t,shouldAnimateDisplacement:r,snapshot:l(t)}})),a=e=>e?i(tf,e,!0):null,o=(e,t,r,l)=>{let o=r.displaced.visible[e],s=!!(l.inVirtualList&&l.effected[e]),d=tk(r),c=d&&d.draggableId===e?t:null;if(!o){if(!s)return a(c);if(r.displaced.invisible[e])return null;let t=tb(l.displacedBy.point);return i(n(t.x,t.y),c,!0)}if(s)return a(c);let u=r.displacedBy.point;return i(n(u.x,u.y),c,o.shouldAnimate)},(e,t)=>{if(nT(e))return e.critical.draggable.id===t.draggableId?null:o(t.draggableId,e.critical.draggable.id,e.impact,e.afterCritical);if("DROP_ANIMATING"===e.phase){let r=e.completed;return r.result.draggableId===t.draggableId?null:o(t.draggableId,r.result.draggableId,r.impact,r.afterCritical)}return null});return(e,t)=>s(e,t)||d(e,t)||n5},{dropAnimationFinished:rA},null,{context:nN,areStatePropsEqual:n1})(e=>{let t=(0,q.useRef)(null),r=tp((e=null)=>{t.current=e},[]),n=tp(()=>t.current,[]),{contextId:l,dragHandleUsageInstructionsId:i,registry:a}=nZ(nP),{type:o,droppableId:s}=nZ(nX),d=tu(()=>({id:e.draggableId,index:e.index,type:o,droppableId:s}),[e.draggableId,e.index,o,s]),{children:c,draggableId:u,isEnabled:p,shouldRespectForcePress:f,canDragInteractiveElements:g,isClone:m,mapped:h,dropAnimationFinished:b}=e;nA(()=>{let t=e.draggableId;t||tt(!1),"string"!=typeof t&&tt(!1),Number.isInteger(e.index)||tt(!1),"DRAGGING"!==e.mapped.type&&(nQ(n()),e.isEnabled&&(nw(l,t)||tt(!1)))}),nj(()=>{let e=(0,q.useRef)(m);nA(()=>{m!==e.current&&tt(!1)},[m])}),m||function(e){let t=nS("draggable"),{descriptor:r,registry:n,getDraggableRef:l,canDragInteractiveElements:i,shouldRespectForcePress:a,isEnabled:o}=e,s=tu(()=>({canDragInteractiveElements:i,shouldRespectForcePress:a,isEnabled:o}),[i,o,a]),d=tp(e=>{let t=l();return t||tt(),function(e,t,r=tf){let n=window.getComputedStyle(t),l=e2(t.getBoundingClientRect(),n),i=e1(l,r),a={client:l,tagName:t.tagName.toLowerCase(),display:n.display};return{descriptor:e,placeholder:a,displaceBy:{x:l.marginBox.width,y:l.marginBox.height},client:l,page:i}}(r,t,e)},[r,l]),c=tu(()=>({uniqueId:t,descriptor:r,options:s,getDimension:d}),[r,d,s,t]),u=(0,q.useRef)(c),p=(0,q.useRef)(!0);nm(()=>(n.draggable.register(u.current),()=>n.draggable.unregister(u.current)),[n.draggable]),nm(()=>{if(p.current){p.current=!1;return}let e=u.current;u.current=c,n.draggable.update(c,e)},[c,n.draggable])}(tu(()=>({descriptor:d,registry:a,getDraggableRef:n,canDragInteractiveElements:g,shouldRespectForcePress:f,isEnabled:p}),[d,a,n,g,f,p]));let x=tu(()=>p?{tabIndex:0,role:"button","aria-describedby":i,"data-rfd-drag-handle-draggable-id":u,"data-rfd-drag-handle-context-id":l,draggable:!1,onDragStart:n0}:null,[l,i,u,p]),y=tp(e=>{"DRAGGING"===h.type&&h.dropping&&"transform"===e.propertyName&&(0,Y.flushSync)(b)},[b,h]),v=tu(()=>{let e="DRAGGING"===h.type?function(e){let t=e.dimension.client,{offset:r,combineWith:n,dropping:l}=e,i=!!n,a=null!=e.forceShouldAnimate?e.forceShouldAnimate:"SNAP"===e.mode,o=!!l,s=o?((e,t)=>{let r=r$(e);if(r)return t?`${r} scale(${r_})`:r})(r,i):r$(r);return{position:"fixed",top:t.marginBox.top,left:t.marginBox.left,boxSizing:"border-box",width:t.borderBox.width,height:t.borderBox.height,transition:l?rG.drop(l.duration):a?rG.snap:rG.fluid,transform:s,opacity:((e,t)=>{if(e)return t?rT:rB})(i,o),zIndex:o?4500:5e3,pointerEvents:"none"}}(h):{transform:r$(h.offset),transition:h.shouldAnimateDisplacement?void 0:"none"};return{innerRef:r,draggableProps:{"data-rfd-draggable-context-id":l,"data-rfd-draggable-id":u,style:e,onTransitionEnd:"DRAGGING"===h.type&&h.dropping?y:void 0},dragHandleProps:x}},[l,x,u,h,y,r]),w=tu(()=>({draggableId:d.id,type:d.type,source:{index:d.index,droppableId:d.droppableId}}),[d.droppableId,d.id,d.index,d.type]);return q.default.createElement(q.default.Fragment,null,c(v,h.snapshot,w))});function n8(e){return nZ(nX).isUsingCloneFor!==e.draggableId||e.isClone?q.default.createElement(n4,e):null}function n6(e){let t="boolean"!=typeof e.isDragDisabled||!e.isDragDisabled,r=!!e.disableInteractiveElementBlocking,n=!!e.shouldRespectForcePress;return q.default.createElement(n8,e4({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:r,shouldRespectForcePress:n}))}let n7=e=>t=>e===t,n9=n7("scroll"),le=n7("auto");n7("visible");let lt=(e,t)=>t(e.overflowX)||t(e.overflowY),lr=e=>{let t,r;return null==e||e===document.body||e===document.documentElement?null:lt(r={overflowX:(t=window.getComputedStyle(e)).overflowX,overflowY:t.overflowY},n9)||lt(r,le)?e:lr(e.parentElement)};var ln=e=>({x:e.scrollLeft,y:e.scrollTop});let ll=e=>!!e&&("fixed"===window.getComputedStyle(e).position||ll(e.parentElement)),li={passive:!1},la={passive:!0};var lo=e=>e.shouldPublishImmediately?li:la;let ls=e=>e&&e.env.closestScrollable||null;function ld(){}let lc={width:0,height:0,margin:{top:0,right:0,bottom:0,left:0}};var lu=q.default.memo(e=>{let t=(0,q.useRef)(null),r=tp(()=>{t.current&&(clearTimeout(t.current),t.current=null)},[]),{animate:n,onTransitionEnd:l,onClose:i,contextId:a}=e,[o,s]=(0,q.useState)("open"===e.animate);(0,q.useEffect)(()=>o?"open"!==n?(r(),s(!1),ld):t.current?ld:(t.current=setTimeout(()=>{t.current=null,s(!1)}),r):ld,[n,o,r]);let d=tp(e=>{"height"===e.propertyName&&(l(),"close"===n&&i())},[n,i,l]),c=(({isAnimatingOpenOnMount:e,placeholder:t,animate:r})=>{let n=(({isAnimatingOpenOnMount:e,placeholder:t,animate:r})=>e||"close"===r?lc:{height:t.client.borderBox.height,width:t.client.borderBox.width,margin:t.client.margin})({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:"none"!==r?rG.placeholder:null}})({isAnimatingOpenOnMount:o,animate:e.animate,placeholder:e.placeholder});return q.default.createElement(e.placeholder.tagName,{style:c,"data-rfd-placeholder-context-id":a,onTransitionEnd:d,ref:e.innerRef})});function lp(e){return"boolean"==typeof e}function lf(e,t){t.forEach(t=>t(e))}let lg=[function({props:e}){e.droppableId||tt(),"string"!=typeof e.droppableId&&tt()},function({props:e}){lp(e.isDropDisabled)||tt(),lp(e.isCombineEnabled)||tt(),lp(e.ignoreContainerClipping)||tt()},function({getDroppableRef:e}){nQ(e())}],lm=[function({props:e,getPlaceholderRef:t}){if(!e.placeholder||t())return}],lh=[function({props:e}){e.renderClone||tt()},function({getPlaceholderRef:e}){e()&&tt()}];class lb extends q.default.PureComponent{constructor(...e){super(...e),this.state={isVisible:!!this.props.on,data:this.props.on,animate:this.props.shouldAnimate&&this.props.on?"open":"none"},this.onClose=()=>{"close"===this.state.animate&&this.setState({isVisible:!1})}}static getDerivedStateFromProps(e,t){return e.shouldAnimate?e.on?{isVisible:!0,data:e.on,animate:"open"}:t.isVisible?{isVisible:!0,data:t.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:!!e.on,data:e.on,animate:"none"}}render(){if(!this.state.isVisible)return null;let e={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(e)}}let lx={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:function(){return document.body||tt(),document.body}},ly=e=>{let t,r={...e};for(t in lx)void 0===e[t]&&(r={...r,[t]:lx[t]});return r},lv=(e,t)=>t.draggables[e.draggable.id],lw=eW(()=>{let e={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},t={...e,shouldAnimatePlaceholder:!1},r=tC(e=>({draggableId:e.id,type:e.type,source:{index:e.index,droppableId:e.droppableId}})),n=tC((n,l,i,a,o,s)=>{let d=o.descriptor.id;if(o.descriptor.droppableId===n){let e=s?{render:s,dragging:r(o.descriptor)}:null;return{placeholder:o.placeholder,shouldAnimatePlaceholder:!1,snapshot:{isDraggingOver:i,draggingOverWith:i?d:null,draggingFromThisWith:d,isUsingPlaceholder:!0},useClone:e}}return l?a?{placeholder:o.placeholder,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:i,draggingOverWith:d,draggingFromThisWith:null,isUsingPlaceholder:!0},useClone:null}:e:t});return(r,l)=>{let i=ly(l),a=i.droppableId,o=i.type,s=!i.isDropDisabled,d=i.renderClone;if(nT(r)){let e=r.critical;if(o!==e.droppable.type)return t;let l=lv(e,r.dimensions),i=rt(r.impact)===a;return n(a,s,i,i,l,d)}if("DROP_ANIMATING"===r.phase){let e=r.completed;if(o!==e.critical.droppable.type)return t;let l=lv(e.critical,r.dimensions);return n(a,s,n2(e.result)===a,rt(e.impact)===a,l,d)}if("IDLE"===r.phase&&r.completed&&!r.shouldFlush){let n=r.completed;if(o!==n.critical.droppable.type)return t;let l=rt(n.impact)===a,i=!!(n.impact.at&&"COMBINE"===n.impact.at.type),s=n.critical.droppable.id===a;if(l)return i?e:t;if(s)return e}return t}},{updateViewportMaxScroll:e=>({type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:e})},(e,t,r)=>({...ly(r),...e,...t}),{context:nN,areStatePropsEqual:n1})(e=>{var t;let r=(0,q.useContext)(nP);r||tt();let{contextId:n,isMovementAllowed:l}=r,i=(0,q.useRef)(null),a=(0,q.useRef)(null),{children:o,droppableId:s,type:d,mode:c,direction:u,ignoreContainerClipping:p,isDropDisabled:f,isCombineEnabled:g,snapshot:m,useClone:h,updateViewportMaxScroll:b,getContainerForClone:x}=e,y=tp(()=>i.current,[]),v=tp((e=null)=>{i.current=e},[]),w=tp(()=>a.current,[]),I=tp((e=null)=>{a.current=e},[]);t={props:e,getDroppableRef:y,getPlaceholderRef:w},nA(()=>{lf(t,lg),"standard"===t.props.mode&&lf(t,lm),"virtual"===t.props.mode&&lf(t,lh)});let N=tp(()=>{l()&&b({maxScroll:r2()})},[l,b]);!function(e){let t=(0,q.useRef)(null),r=nZ(nP),n=nS("droppable"),{registry:l,marshal:i}=r,a=nk(e),o=tu(()=>({id:e.droppableId,type:e.type,mode:e.mode}),[e.droppableId,e.mode,e.type]),s=(0,q.useRef)(o),d=tu(()=>tC((e,r)=>{t.current||tt(),i.updateDroppableScroll(o.id,{x:e,y:r})}),[o.id,i]),c=tp(()=>{let e=t.current;return e&&e.env.closestScrollable?ln(e.env.closestScrollable):tf},[]),u=tp(()=>{let e=c();d(e.x,e.y)},[c,d]),p=tu(()=>e5(u),[u]),f=tp(()=>{let e=t.current,r=ls(e);(e&&r||tt(),e.scrollOptions.shouldPublishImmediately)?u():p()},[p,u]),g=tp((e,n)=>{t.current&&tt();let l=a.current,i=l.getDroppableRef();i||tt();let s={closestScrollable:lr(i),isFixedOnPage:ll(i)},d={ref:i,descriptor:o,env:s,scrollOptions:n};t.current=d;let c=(({ref:e,descriptor:t,env:r,windowScroll:n,direction:l,isDropDisabled:i,isCombineEnabled:a,shouldClipSubject:o})=>{let s=r.closestScrollable,d=((e,t)=>{let r=e3(e);if(!t||e!==t)return r;let n=r.paddingBox.top-t.scrollTop,l=r.paddingBox.left-t.scrollLeft,i=n+t.scrollHeight;return eQ({borderBox:eJ({top:n,right:l+t.scrollWidth,bottom:i,left:l},r.border),margin:r.margin,border:r.border,padding:r.padding})})(e,s),c=e1(d,n),u=(()=>{if(!s)return null;let e=e3(s),t={scrollHeight:s.scrollHeight,scrollWidth:s.scrollWidth};return{client:e,page:e1(e,n),scroll:ln(s),scrollSize:t,shouldClipSubject:o}})();return(({descriptor:e,isEnabled:t,isCombineEnabled:r,isFixedOnPage:n,direction:l,client:i,page:a,closest:o})=>{let s=(()=>{if(!o)return null;let{scrollSize:e,client:t}=o,r=r0({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,height:t.paddingBox.height,width:t.paddingBox.width});return{pageMarginBox:o.page.marginBox,frameClient:t,scrollSize:e,shouldClipSubject:o.shouldClipSubject,scroll:{initial:o.scroll,current:o.scroll,max:r,diff:{value:tf,displacement:tf}}}})(),d="vertical"===l?tz:tU,c=tE({page:a,withPlaceholder:null,axis:d,frame:s});return{descriptor:e,isCombineEnabled:r,isFixedOnPage:n,axis:d,isEnabled:t,client:i,page:a,frame:s,subject:c}})({descriptor:t,isEnabled:!i,isCombineEnabled:a,isFixedOnPage:r.isFixedOnPage,direction:l,client:d,page:c,closest:u})})({ref:i,descriptor:o,env:s,windowScroll:e,direction:l.direction,isDropDisabled:l.isDropDisabled,isCombineEnabled:l.isCombineEnabled,shouldClipSubject:!l.ignoreContainerClipping}),u=s.closestScrollable;return u&&(u.setAttribute(nf.contextId,r.contextId),u.addEventListener("scroll",f,lo(d.scrollOptions))),c},[r.contextId,o,f,a]),m=tp(()=>{let e=t.current,r=ls(e);return e&&r||tt(),ln(r)},[]),h=tp(()=>{let e=t.current;e||tt();let r=ls(e);t.current=null,r&&(p.cancel(),r.removeAttribute(nf.contextId),r.removeEventListener("scroll",f,lo(e.scrollOptions)))},[f,p]),b=tp(e=>{let r=t.current;r||tt();let n=ls(r);n||tt(),n.scrollTop+=e.y,n.scrollLeft+=e.x},[]),x=tu(()=>({getDimensionAndWatchScroll:g,getScrollWhileDragging:m,dragStopped:h,scroll:b}),[h,g,m,b]),y=tu(()=>({uniqueId:n,descriptor:o,callbacks:x}),[x,o,n]);nm(()=>(s.current=y.descriptor,l.droppable.register(y),()=>{t.current&&h(),l.droppable.unregister(y)}),[x,o,h,y,i,l.droppable]),nm(()=>{t.current&&i.updateDroppableIsEnabled(s.current.id,!e.isDropDisabled)},[e.isDropDisabled,i]),nm(()=>{t.current&&i.updateDroppableIsCombineEnabled(s.current.id,e.isCombineEnabled)},[e.isCombineEnabled,i])}({droppableId:s,type:d,mode:c,direction:u,isDropDisabled:f,isCombineEnabled:g,ignoreContainerClipping:p,getDroppableRef:y});let E=tu(()=>q.default.createElement(lb,{on:e.placeholder,shouldAnimate:e.shouldAnimatePlaceholder},({onClose:e,data:t,animate:r})=>q.default.createElement(lu,{placeholder:t,onClose:e,innerRef:I,animate:r,contextId:n,onTransitionEnd:N})),[n,N,e.placeholder,e.shouldAnimatePlaceholder,I]),D=tu(()=>({innerRef:v,placeholder:E,droppableProps:{"data-rfd-droppable-id":s,"data-rfd-droppable-context-id":n}}),[n,s,E,v]),C=h?h.dragging.draggableId:null,S=tu(()=>({droppableId:s,type:d,isUsingCloneFor:C}),[s,C,d]);return q.default.createElement(nX.Provider,{value:S},o(D,m),function(){if(!h)return null;let{dragging:e,render:t}=h,r=q.default.createElement(n8,{draggableId:e.draggableId,index:e.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(r,n)=>t(r,n,e));return Y.default.createPortal(r,x())}())});var lI=e.i(74886),lN=e.i(55716);let lE=(0,c.default)("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var lD=e.i(31278),lC=e.i(86311),lS=e.i(95468),lP=e.i(73884),lO=e.i(45139),lR=e.i(77814),lj=e.i(63337);let lA={backlog:"bg-muted text-muted-foreground",planning:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300",coding:"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-300",reviewing:"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-300",done:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-300"},lk={success:{className:"bg-unread-success",label:"Finished, not opened yet"},error:{className:"bg-unread-error",label:"Failed, not opened yet"},waiting:{className:"bg-unread-waiting",label:"Waiting for your input"}};function lT({tabs:e}){if(!e||0===e.length)return null;let t=e.some(e=>"running"===e.status),r=e.some(e=>"waiting"===e.status),n=e.some(e=>"error"===e.status),l=e.length>0&&e.every(e=>"success"===e.status);return t?(0,o.jsx)("span",{className:"inline-flex items-center gap-1 text-xs text-primary",children:(0,o.jsx)(lD.Loader2,{className:"size-3 animate-spin"})}):r?(0,o.jsx)("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:(0,o.jsx)(lC.MessageSquare,{className:"size-3"})}):n?(0,o.jsx)("span",{className:"inline-flex items-center gap-1 text-xs text-destructive",children:(0,o.jsx)(lP.XCircle,{className:"size-3"})}):l?(0,o.jsx)("span",{className:"inline-flex items-center gap-1 text-xs text-success",children:(0,o.jsx)(lS.CheckCircle2,{className:"size-3"})}):null}function lB({task:e,dragHandleProps:t,tabTodosMap:r}){let n=(0,d.useRouter)(),[l,i]=(0,s.useState)(!1),a=(0,z.getRepoColor)(e.owner,e.repo),c=e.tabs??[],u=c.some(e=>"running"===e.status),p=(0,lO.unreadKind)(e),f=(0,lj.sumTodoProgress)(c.map(e=>r?.get(e.tab_id)??e.todos??[])),g=e.id.slice(0,5)+"…",m=(0,s.useCallback)(t=>{t.stopPropagation(),navigator.clipboard.writeText(e.id).then(()=>{i(!0),setTimeout(()=>i(!1),2e3)})},[e.id]);return(0,o.jsxs)("div",{...t,"data-task-id":e.id,onClick:()=>n.push(`/tasks/${e.id}`),className:(0,T.cn)("relative rounded-lg border border-border bg-card p-3 shadow-sm transition-shadow hover:shadow-md cursor-pointer",u&&"opacity-50"),children:[p&&(0,o.jsx)("span",{role:"img","aria-label":lk[p].label,title:lk[p].label,className:(0,T.cn)("absolute left-0 top-2.5 bottom-2.5 w-[3px] rounded-r-[3px]",lk[p].className)}),(0,o.jsxs)("div",{className:"space-y-2",children:[(0,o.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,o.jsxs)("div",{className:"flex items-center gap-1",children:[(0,o.jsx)(lT,{tabs:e.tabs}),(0,o.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:g}),(0,o.jsx)("button",{onClick:m,className:"size-5 inline-flex items-center justify-center rounded-sm hover:bg-accent transition-colors",title:"Copy task ID",children:l?(0,o.jsx)(E.Check,{className:"size-3 text-success"}):(0,o.jsx)(lI.Copy,{className:"size-3 text-muted-foreground"})})]}),(0,o.jsx)("span",{className:(0,T.cn)("inline-flex h-5 items-center rounded-full px-2 text-[0.625rem] font-medium",lA[e.status]),children:e.status})]}),(0,o.jsx)("p",{className:"text-sm font-medium text-foreground",children:e.title}),e.description&&(0,o.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2",children:e.description}),f.total>0&&(0,o.jsxs)("div",{className:"space-y-0.5",children:[(0,o.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,o.jsx)(lR.Progress,{value:Math.round(f.completed/f.total*100),className:"flex-1 gap-0 [&_[data-slot=progress-track]]:h-[3px]"}),(0,o.jsxs)("span",{className:"text-[10px] text-muted-foreground tabular-nums shrink-0",children:[f.completed,"/",f.total]})]}),f.current&&(0,o.jsx)("p",{className:"truncate text-[10px] text-muted-foreground",title:f.current,children:f.current})]}),(0,o.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,o.jsxs)("span",{className:(0,T.cn)("inline-flex h-5 items-center rounded-full px-2 text-[0.625rem] font-medium",a.bg,a.text),children:[e.owner,"/",e.repo]}),e.branch&&(0,o.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[(0,o.jsx)(lN.GitBranch,{className:"size-3"}),(0,o.jsx)("span",{className:"truncate max-w-[120px]",children:e.branch})]}),null!=e.effort&&e.effort>0&&(0,o.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[(0,o.jsx)(lE,{className:"size-3"}),e.effort,"h"]})]})]})]})}function l_({droppableId:e,tasks:t,onReorder:r,onDragStateChange:n,tabTodosMap:l}){let i=(0,s.useCallback)(()=>{n?.(!0)},[n]),a=(0,s.useCallback)(e=>{if(n?.(!1),!e.destination)return;let{source:l,destination:i}=e;if(l.index===i.index)return;let a=[...t],[o]=a.splice(l.index,1);a.splice(i.index,0,o),r(a.map((e,t)=>({...e,order:t})))},[t,r,n]);return(0,o.jsx)(nK,{onDragStart:i,onDragEnd:a,children:(0,o.jsx)(lw,{droppableId:e,children:e=>(0,o.jsxs)("div",{ref:e.innerRef,...e.droppableProps,className:"space-y-2",children:[t.map((e,t)=>(0,o.jsx)(n6,{draggableId:e.id,index:t,children:t=>(0,o.jsx)("div",{ref:t.innerRef,...t.draggableProps,children:(0,o.jsx)(lB,{task:e,dragHandleProps:t.dragHandleProps,tabTodosMap:l})})},e.id)),e.placeholder]})})})}function lM({owner:e,repo:t,tasks:r,filters:n,onFilterChange:l,onReorder:i,onAddTask:a,onMoveToFront:s,onDragStateChange:d,tabTodosMap:c}){let u=(0,z.getRepoColor)(e,t),p=r.filter(lO.hasUnreadResult).length;return(0,o.jsxs)("div",{className:"flex h-full flex-col",children:[(0,o.jsxs)("div",{className:"flex-shrink-0 flex items-center gap-2 px-4 pt-4",children:[(0,o.jsx)("span",{className:(0,T.cn)("inline-flex h-6 min-w-0 items-center rounded-full px-2.5 text-xs font-medium",u.bg,u.text),title:`${e}/${t}`,"data-repo":`${e}/${t}`,children:(0,o.jsxs)("span",{className:"truncate",children:[e,"/",t]})}),(0,o.jsx)("span",{className:"text-xs tabular-nums text-muted-foreground",children:r.length}),p>0&&(0,o.jsx)("span",{className:"inline-flex h-5 min-w-5 items-center justify-center rounded-full bg-primary px-1.5 text-[0.625rem] font-medium tabular-nums text-primary-foreground",title:`${p} unopened result${p>1?"s":""}`,children:p}),s&&(0,o.jsx)(x.Button,{variant:"ghost",size:"icon",onClick:s,className:"ml-auto size-6 flex-shrink-0 text-muted-foreground",title:"Move to front",children:(0,o.jsx)(_,{className:"size-3.5"})})]}),(0,o.jsx)("div",{className:"flex-shrink-0 px-4 pt-2",children:(0,o.jsx)(H,{repositories:[],filters:n,onFilterChange:l,onAddTask:a})}),(0,o.jsx)("div",{className:"flex-1 overflow-y-auto px-4 py-4",children:r.length>0?(0,o.jsx)(l_,{droppableId:`planner-task-list-${e}/${t}`,tasks:r,onReorder:i,onDragStateChange:d,tabTodosMap:c}):(0,o.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No tasks found"})})]})}var lL=e.i(92943);function lG(e,t){return`${e}/${t}`}let l$={statuses:[],repos:[],search:""},lF="h-full w-full flex-shrink-0 snap-start border-r border-border lg:w-[22.5rem]";function lz({repositories:e,tasksByRepo:t,filtersByRepo:r,onFilterChange:n,onReorder:l,onMoveRepositoryToFront:i,onAddTask:a,onCloneClick:d,isCloneOnboarding:c=!1,isCloneDialogOpen:u=!1,tabTodosMap:p,initialFocus:f}){let[g,m]=(0,s.useState)(!1),h=(0,s.useRef)(null),b=(0,s.useRef)(!1);(0,s.useLayoutEffect)(()=>{if(b.current||!f)return;b.current=!0,(0,lL.clearLastViewedTask)();let e=h.current;if(!e)return;let t=e.querySelector(`[data-task-id="${f.taskId}"]`),r=t?.closest("[data-repo-key]")??(f.repoKey?e.querySelector(`[data-repo-key="${f.repoKey}"]`):null);r?.scrollIntoView({block:"nearest",inline:"start",behavior:"instant"}),t?.scrollIntoView({block:"center",inline:"nearest",behavior:"instant"})},[f]);let x=(0,s.useMemo)(()=>[...e].sort((e,t)=>e.order-t.order),[e]);return(0,o.jsxs)("div",{ref:h,className:(0,T.cn)("flex flex-1 overflow-x-auto overflow-y-hidden overscroll-x-contain",!g&&"snap-x snap-mandatory"),children:[x.map((e,s)=>{let d=lG(e.owner,e.repo);return(0,o.jsx)("div",{className:lF,"data-repo-key":d,children:(0,o.jsx)(lM,{owner:e.owner,repo:e.repo,tasks:t.get(d)??[],filters:r[d]??l$,onFilterChange:e=>n(d,e),onReorder:l,onAddTask:()=>a({owner:e.owner,repo:e.repo}),onMoveToFront:0===s?void 0:()=>i(e.id),onDragStateChange:m,tabTodosMap:p})},e.id)}),(0,o.jsx)("div",{className:lF,children:(0,o.jsx)(B,{onCloneClick:d,isOnboarding:c,isCloneDialogOpen:u})})]})}var lU=e.i(70935),lW=e.i(95008),lH=e.i(801),lV=e.i(51846),lq=e.i(57024);let lY="tsunagi:column-filters",lJ={statuses:[],repos:[],search:""},lK=null,lX=null;e.s(["default",0,function(){let e,t=(0,d.useRouter)(),{tasks:r,setTasks:n,hasLoaded:l,reload:i}=(0,lH.useLiveTasks)({onTaskCreated:(e,t)=>{lq.toaster.create(t.length>0?{type:"warning",title:"Task created with warnings",description:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("p",{children:e.title}),t.map(e=>(0,o.jsx)("p",{children:e},e))]}),duration:1/0}:{type:"success",title:"Task created",description:e.title,duration:5e3})},onTaskUpdated:e=>{lq.toaster.create({type:"info",title:"Task updated",description:e.title,duration:5e3})},onTaskDeleted:(e,t)=>{t&&lq.toaster.create({type:"info",title:"Task deleted",description:t.title,duration:5e3})}}),[a,c]=(0,s.useState)(()=>lK??[]),[u,p]=(0,s.useState)(null!==lK),[f,g]=(0,s.useState)(lX);(0,s.useEffect)(()=>{u&&(lK=a)},[a,u]),(0,s.useEffect)(()=>{lX=f},[f]);let[m,h]=(0,s.useState)(!1),[b,x]=(0,s.useState)(null),[y,v]=(0,s.useState)(!1),[w,N]=(0,s.useState)(()=>{try{let e=sessionStorage.getItem(lY);if(e)return JSON.parse(e)}catch{}return{}}),[E]=(0,s.useState)(()=>(0,lL.peekLastViewedTask)()),S=(0,s.useMemo)(()=>{if(!E)return null;let e=r.find(e=>e.id===E);return{taskId:E,repoKey:e?lG(e.owner,e.repo):void 0}},[E,r]),P=(0,s.useMemo)(()=>r.filter(lO.hasUnreadResult).length,[r]);(0,lV.useDocumentTitle)((e=Object.entries(w).filter(([,e])=>e.statuses.length>0||!!e.search.trim()).map(([e,t])=>{let r=[];return t.search.trim()&&r.push(`"${t.search.trim()}"`),t.statuses.length&&r.push(t.statuses.join(", ")),`${e.split("/").pop()??e}: ${r.join(" / ")}`})).length?e.join(" | "):void 0,P),(0,s.useEffect)(()=>{try{sessionStorage.setItem(lY,JSON.stringify(w))}catch{}},[w]);let O=(0,s.useCallback)((e,t)=>{N(r=>({...r,[e]:t}))},[]),j=(0,s.useMemo)(()=>{let e,t={hasRepositories:a.length>0,hasAuth:!0===f,hasTasks:r.length>0};return e=!1===f?"env":t.hasRepositories?t.hasTasks?"complete":"task":"clone",{state:t,nextStep:e}},[a,f,r]),k=(0,s.useMemo)(()=>{let e=new Map;for(let t of r){let r=lG(t.owner,t.repo),n=w[r]??lJ;if(n.statuses.length>0&&!n.statuses.includes(t.status)||n.search&&!t.title.toLowerCase().includes(n.search.toLowerCase()))continue;let l=e.get(r);l?l.push(t):e.set(r,[t])}for(let t of e.values())t.sort((e,t)=>e.order-t.order);return e},[r,w]),T=async()=>{try{let e=(await fetch((0,lU.apiUrl)("/api/owners")).then(e=>e.json())).data.owners.flatMap(e=>e.repositories);c(e)}catch(e){console.error("Failed to load repositories:",e)}finally{p(!0)}},B=async()=>{try{let e=await fetch((0,lU.apiUrl)("/api/onboarding/status")).then(e=>e.json());g(!!e.data?.completed)}catch(e){console.error("Failed to load onboarding status:",e)}},_=()=>Promise.all([T(),B()]),M=async()=>{await Promise.all([i(),_()])};(0,s.useEffect)(()=>{_()},[]);let L=function(e){let[t,r]=(0,s.useState)(new Map),n=(0,s.useRef)(new Map);return(0,s.useEffect)(()=>{let e=(0,lW.getSharedSocket)(),t=({sessionId:e,todos:t})=>{r(r=>{let n=new Map(r);return n.set(e,t),n})};return e.on("todos-updated",t),()=>{e.off("todos-updated",t)}},[]),(0,s.useEffect)(()=>{(0,lW.syncRoomSubscriptions)(n.current,e.map(e=>`tab:${e}`))},[e]),(0,s.useEffect)(()=>{let e=n.current;return()=>{(0,lW.clearRoomSubscriptions)(e)}},[]),t}((0,s.useMemo)(()=>r.flatMap(e=>(e.tabs??[]).filter(e=>"running"===e.status).map(e=>e.tab_id)),[r])),{isDeleting:G,deletedCount:$,errorCount:F,totalCount:z,isCompleted:U,startBatchDelete:W,reset:H}=function(){let[e,t]=(0,s.useState)({batchId:null,totalCount:0,deletedCount:0,errorCount:0,isDeleting:!1,isCompleted:!1}),r=(0,s.useCallback)(async(e=7)=>{try{let r=await fetch((0,lU.apiUrl)("/api/tasks/batch-delete"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({daysAgo:e})});if(!r.ok)throw Error("Failed to start batch delete");let{batchId:n,totalCount:l}=(await r.json()).data;if(0===l)return{batchId:n,totalCount:l};return t({batchId:n,totalCount:l,deletedCount:l,errorCount:0,isDeleting:!1,isCompleted:!0}),{batchId:n,totalCount:l}}catch(e){throw console.error("Batch delete error:",e),e}},[]),n=(0,s.useCallback)(()=>{t({batchId:null,totalCount:0,deletedCount:0,errorCount:0,isDeleting:!1,isCompleted:!1})},[]);return{...e,startBatchDelete:r,reset:n}}();(0,s.useEffect)(()=>{(G||U)&&queueMicrotask(()=>{if(G){let e=F>0?`${$} / ${z} (${F} failed)`:`${$} / ${z}`;lq.toaster.update("batch-delete-progress",{type:"loading",title:"Deleting tasks...",description:e,duration:1/0})}if(U){lq.toaster.dismiss("batch-delete-progress");let e=F>0?`Deleted ${$} tasks (${F} failed)`:`Deleted ${$} tasks`;lq.toaster.create({type:F>0?"warning":"success",title:e,duration:5e3}),setTimeout(()=>{H()},5e3)}})},[G,U,$,F,z,H]);let V=(0,s.useCallback)(async e=>{n(t=>{let r=new Map(e.map(e=>[e.id,e]));return t.map(e=>r.get(e.id)??e)});try{if(!(await fetch((0,lU.apiUrl)("/api/tasks/reorder"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskIds:e.map(e=>e.id)})})).ok)throw Error("Failed to reorder tasks")}catch(e){console.error("Failed to update task order:",e),lq.toaster.create({type:"error",title:"Failed to reorder tasks",duration:5e3}),i()}},[n,i]),q=(0,s.useCallback)(async e=>{let t=a.find(t=>t.id===e);if(!t)return;let r=[t,...a.filter(t=>t.id!==e).sort((e,t)=>e.order-t.order)].map((e,t)=>({...e,order:t}));c(r);try{await fetch((0,lU.apiUrl)("/api/repos/reorder"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({repoIds:r.map(e=>e.id)})})}catch(e){console.error("Failed to update repository order:",e)}},[a]),Y=async e=>{try{let t=await fetch((0,lU.apiUrl)("/api/clone"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){let e=await t.json().then(e=>e?.error).catch(()=>void 0);throw Error(e||`Failed to clone repository (HTTP ${t.status})`)}let r=await t.json();return c(e=>[...e,r.data.repository]),await M(),{cloneUrl:r.data.repository.cloneUrl,fallbackProtocol:r.data.fallbackProtocol??null}}catch(e){throw console.error("Failed to clone repository:",e),e}},J=async e=>{try{let t=await W(e);if(!t||0===t.totalCount)return void lq.toaster.create({type:"info",title:"No tasks to delete",description:`No tasks completed more than ${e} days ago`,duration:3e3});lq.toaster.create({id:"batch-delete-progress",type:"loading",title:"Deleting tasks...",description:`0 / ${t.totalCount}`,duration:1/0})}catch(e){console.error("Failed to start batch delete:",e),lq.toaster.create({type:"error",title:"Failed to delete tasks",description:String(e),duration:5e3})}};return l&&u?(0,o.jsxs)("div",{className:"h-screen flex flex-col",children:[(0,o.jsx)(I,{onSettingsClick:()=>t.push("/settings"),onReload:M,nextStep:j.nextStep}),(0,o.jsxs)("div",{className:"relative flex-1 overflow-hidden flex",children:[(0,o.jsx)(lz,{repositories:a,tasksByRepo:k,filtersByRepo:w,onFilterChange:O,onReorder:V,onMoveRepositoryToFront:q,onAddTask:x,onCloneClick:()=>h(!0),isCloneOnboarding:"clone"===j.nextStep,isCloneDialogOpen:m,tabTodosMap:L,initialFocus:S}),"env"===j.nextStep&&(0,o.jsx)(D,{hasRepositories:j.state.hasRepositories,hasEnvVars:j.state.hasAuth,hasTasks:j.state.hasTasks})]}),(0,o.jsx)(R,{isOpen:m,onClose:()=>h(!1),onClone:Y,isOnboarding:"clone"===j.nextStep}),(0,o.jsx)(C.LazyTaskDialog,{mode:"create",isOpen:null!==b,onClose:()=>x(null),repositories:a,defaultRepo:b??void 0}),(0,o.jsx)(A,{isOpen:y,onClose:()=>v(!1),onConfirm:J})]}):(0,o.jsx)("div",{className:"h-screen flex items-center justify-center bg-background",children:(0,o.jsx)("div",{className:"text-center",children:(0,o.jsx)("div",{className:"text-2xl text-foreground",children:"Loading..."})})})}],39798)}]);
|
|
@@ -12,6 +12,11 @@ export declare function getTask(id: string): Promise<Task | null>;
|
|
|
12
12
|
export declare function createTask(task: Omit<Task, 'id' | 'deleted' | 'deletedAt' | 'createdAt' | 'updatedAt' | 'tabs'>, tx?: TxClient): Promise<Task>;
|
|
13
13
|
export declare function updateTask(id: string, updates: Partial<Omit<Task, 'id' | 'createdAt'>>): Promise<Task | null>;
|
|
14
14
|
export declare function bumpOrder(targetOrder: number, excludeTaskId?: string, tx?: TxClient): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* 表示順を一括更新する(ボードの1列分の並び替え)。
|
|
17
|
+
* 渡された id の並びをそのまま order 0..n-1 に割り当てるため、玉突き処理は不要。
|
|
18
|
+
*/
|
|
19
|
+
export declare function reorderTasks(taskIds: string[]): Promise<void>;
|
|
15
20
|
export declare function deleteTask(id: string): Promise<boolean>;
|
|
16
21
|
export declare function createTab(taskId: string, mode?: Tab['mode']): Promise<Tab | null>;
|
|
17
22
|
export declare function getTab(taskId: string, tab_id: string): Promise<Tab | null>;
|
|
@@ -95,6 +95,13 @@ export async function bumpOrder(targetOrder, excludeTaskId, tx) {
|
|
|
95
95
|
data: { order: { increment: 1 } },
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* 表示順を一括更新する(ボードの1列分の並び替え)。
|
|
100
|
+
* 渡された id の並びをそのまま order 0..n-1 に割り当てるため、玉突き処理は不要。
|
|
101
|
+
*/
|
|
102
|
+
export async function reorderTasks(taskIds) {
|
|
103
|
+
await prisma.$transaction(taskIds.map((id, index) => prisma.task.update({ where: { id }, data: { order: index } })));
|
|
104
|
+
}
|
|
98
105
|
// タスク論理削除
|
|
99
106
|
export async function deleteTask(id) {
|
|
100
107
|
try {
|
|
@@ -157,6 +157,39 @@ export async function tasksRoutes(fastify) {
|
|
|
157
157
|
return reply.status(500).send({ error: 'Failed to fetch task' });
|
|
158
158
|
}
|
|
159
159
|
});
|
|
160
|
+
// PUT /tasks/reorder - ボード1列分の並び順を一括更新する。
|
|
161
|
+
// タスクごとに task:updated を流すと1回の操作で通知が大量に出るため、操作単位で tasks:reordered を1回だけ流す
|
|
162
|
+
fastify.put('/tasks/reorder', async (request, reply) => {
|
|
163
|
+
try {
|
|
164
|
+
const { taskIds } = request.body ?? {};
|
|
165
|
+
if (!Array.isArray(taskIds) || taskIds.length === 0) {
|
|
166
|
+
return reply.status(400).send({ error: 'Missing required field: taskIds' });
|
|
167
|
+
}
|
|
168
|
+
if (new Set(taskIds).size !== taskIds.length) {
|
|
169
|
+
return reply.status(400).send({ error: 'Duplicate task ids' });
|
|
170
|
+
}
|
|
171
|
+
const existing = new Map((await taskRepo.getTasks()).map((t) => [t.id, t]));
|
|
172
|
+
const unknown = taskIds.filter((id) => !existing.has(id));
|
|
173
|
+
if (unknown.length > 0) {
|
|
174
|
+
return reply.status(404).send({ error: `Unknown task ids: ${unknown.join(', ')}` });
|
|
175
|
+
}
|
|
176
|
+
const repoKeys = new Set(taskIds.map((id) => {
|
|
177
|
+
const task = existing.get(id);
|
|
178
|
+
return `${task?.owner}/${task?.repo}`;
|
|
179
|
+
}));
|
|
180
|
+
if (repoKeys.size > 1) {
|
|
181
|
+
return reply.status(400).send({ error: 'Tasks must belong to the same repository' });
|
|
182
|
+
}
|
|
183
|
+
await taskRepo.reorderTasks(taskIds);
|
|
184
|
+
const orders = taskIds.map((id, order) => ({ id, order }));
|
|
185
|
+
io.emit('tasks:reordered', { orders });
|
|
186
|
+
return reply.status(200).send({ data: { orders } });
|
|
187
|
+
}
|
|
188
|
+
catch (error) {
|
|
189
|
+
fastify.log.error(error, 'PUT /tasks/reorder error');
|
|
190
|
+
return reply.status(500).send({ error: 'Failed to reorder tasks' });
|
|
191
|
+
}
|
|
192
|
+
});
|
|
160
193
|
// PUT /tasks/:id
|
|
161
194
|
fastify.put('/tasks/:id', async (request, reply) => {
|
|
162
195
|
try {
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@minimalcorp/tsunagi",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.5",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@minimalcorp/tsunagi",
|
|
9
|
-
"version": "0.4.
|
|
9
|
+
"version": "0.4.5",
|
|
10
10
|
"license": "SEE LICENSE IN LICENSE",
|
|
11
11
|
"os": [
|
|
12
12
|
"darwin",
|
|
@@ -101,9 +101,9 @@
|
|
|
101
101
|
"license": "BSD-3-Clause"
|
|
102
102
|
},
|
|
103
103
|
"node_modules/@fastify/busboy": {
|
|
104
|
-
"version": "3.2.
|
|
105
|
-
"resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-3.2.
|
|
106
|
-
"integrity": "sha512-
|
|
104
|
+
"version": "3.2.4",
|
|
105
|
+
"resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-3.2.4.tgz",
|
|
106
|
+
"integrity": "sha512-lQS8xcXT54rdJb+wlG/Q7SMSdtkZEpLPHooSDUZyyZm9LJD7X1kONPhVoPaHq+dsPtWUGGLIz9gBNhs9qKbylw==",
|
|
107
107
|
"license": "MIT"
|
|
108
108
|
},
|
|
109
109
|
"node_modules/@fastify/cors": {
|
|
@@ -127,9 +127,9 @@
|
|
|
127
127
|
}
|
|
128
128
|
},
|
|
129
129
|
"node_modules/@fastify/deepmerge": {
|
|
130
|
-
"version": "3.2.
|
|
131
|
-
"resolved": "https://registry.npmjs.org/@fastify/deepmerge/-/deepmerge-3.2.
|
|
132
|
-
"integrity": "sha512-
|
|
130
|
+
"version": "3.2.4",
|
|
131
|
+
"resolved": "https://registry.npmjs.org/@fastify/deepmerge/-/deepmerge-3.2.4.tgz",
|
|
132
|
+
"integrity": "sha512-kc8GQq5gX9RRhw0rov3DMrN8wS8yRlxJRdDzsYwwdBV/wazuVgc/1K7CKL90tlvu3RlHan6Y0R0aE3nJtBz2eQ==",
|
|
133
133
|
"funding": [
|
|
134
134
|
{
|
|
135
135
|
"type": "github",
|
|
@@ -235,9 +235,9 @@
|
|
|
235
235
|
}
|
|
236
236
|
},
|
|
237
237
|
"node_modules/@fastify/multipart": {
|
|
238
|
-
"version": "10.1.
|
|
239
|
-
"resolved": "https://registry.npmjs.org/@fastify/multipart/-/multipart-10.1.
|
|
240
|
-
"integrity": "sha512-
|
|
238
|
+
"version": "10.1.6",
|
|
239
|
+
"resolved": "https://registry.npmjs.org/@fastify/multipart/-/multipart-10.1.6.tgz",
|
|
240
|
+
"integrity": "sha512-5ykP7SkCbL06ek+j7fa4o1F8XASF4+KjqVLbuANqXunxXqjWdCQk0pw/+kWH3e8ho7Mw21EhuZp24EqtR04yKg==",
|
|
241
241
|
"funding": [
|
|
242
242
|
{
|
|
243
243
|
"type": "github",
|
|
@@ -1184,9 +1184,9 @@
|
|
|
1184
1184
|
"license": "MIT"
|
|
1185
1185
|
},
|
|
1186
1186
|
"node_modules/@types/lodash": {
|
|
1187
|
-
"version": "4.17.
|
|
1188
|
-
"resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.
|
|
1189
|
-
"integrity": "sha512-
|
|
1187
|
+
"version": "4.17.27",
|
|
1188
|
+
"resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.27.tgz",
|
|
1189
|
+
"integrity": "sha512-VenMRv/eKNrspX9v3H4dbmjsrnCOYdYBG3kxXKk3dG6X+urBGcj2Prww3xw1U5K4FV/mE4h5GbWd0szEKf+9ew==",
|
|
1190
1190
|
"license": "MIT"
|
|
1191
1191
|
},
|
|
1192
1192
|
"node_modules/@types/node": {
|
|
@@ -1463,18 +1463,18 @@
|
|
|
1463
1463
|
"license": "MIT"
|
|
1464
1464
|
},
|
|
1465
1465
|
"node_modules/body-parser": {
|
|
1466
|
-
"version": "2.
|
|
1467
|
-
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.
|
|
1468
|
-
"integrity": "sha512-
|
|
1466
|
+
"version": "2.4.0",
|
|
1467
|
+
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.4.0.tgz",
|
|
1468
|
+
"integrity": "sha512-Ifk1KcLrxaGt1occQagQNFNNOqRt1LFuehEnHHzB8Z6cRgIxRU1TBaiIsUiCdA+gy5PL7Y1IX31DNKkRmxtXjQ==",
|
|
1469
1469
|
"license": "MIT",
|
|
1470
1470
|
"dependencies": {
|
|
1471
1471
|
"bytes": "^3.1.2",
|
|
1472
|
-
"content-type": "^2.
|
|
1472
|
+
"content-type": "^2.1.0",
|
|
1473
1473
|
"debug": "^4.4.3",
|
|
1474
1474
|
"http-errors": "^2.0.1",
|
|
1475
|
-
"iconv-lite": "^0.7.
|
|
1475
|
+
"iconv-lite": "^0.7.3",
|
|
1476
1476
|
"on-finished": "^2.4.1",
|
|
1477
|
-
"qs": "^6.
|
|
1477
|
+
"qs": "^6.16.1",
|
|
1478
1478
|
"raw-body": "^3.0.2",
|
|
1479
1479
|
"type-is": "^2.1.0"
|
|
1480
1480
|
},
|
|
@@ -2322,9 +2322,9 @@
|
|
|
2322
2322
|
"license": "MIT"
|
|
2323
2323
|
},
|
|
2324
2324
|
"node_modules/fast-json-stringify": {
|
|
2325
|
-
"version": "7.1.
|
|
2326
|
-
"resolved": "https://registry.npmjs.org/fast-json-stringify/-/fast-json-stringify-7.1.
|
|
2327
|
-
"integrity": "sha512-
|
|
2325
|
+
"version": "7.1.3",
|
|
2326
|
+
"resolved": "https://registry.npmjs.org/fast-json-stringify/-/fast-json-stringify-7.1.3.tgz",
|
|
2327
|
+
"integrity": "sha512-5TDM1yOF/BDFOclKz2G6rs1RsIl5HXMCrg/npmdNIPNQCezshR5kIHjhwBNuMY67jhkTUAm9DguL8xkL/x0Wtw==",
|
|
2328
2328
|
"funding": [
|
|
2329
2329
|
{
|
|
2330
2330
|
"type": "github",
|
|
@@ -3193,15 +3193,19 @@
|
|
|
3193
3193
|
}
|
|
3194
3194
|
},
|
|
3195
3195
|
"node_modules/on-finished": {
|
|
3196
|
-
"version": "2.4.
|
|
3197
|
-
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.
|
|
3198
|
-
"integrity": "sha512-
|
|
3196
|
+
"version": "2.4.2",
|
|
3197
|
+
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.2.tgz",
|
|
3198
|
+
"integrity": "sha512-ATWUv387i+nLD49EiDoOft5scf32Vsdz3ktrQJG9bi7jRFmaXTssvyvj1EmeKVVgvesbqUtvQQvaS2TpTukAZQ==",
|
|
3199
3199
|
"license": "MIT",
|
|
3200
3200
|
"dependencies": {
|
|
3201
3201
|
"ee-first": "1.1.1"
|
|
3202
3202
|
},
|
|
3203
3203
|
"engines": {
|
|
3204
3204
|
"node": ">= 0.8"
|
|
3205
|
+
},
|
|
3206
|
+
"funding": {
|
|
3207
|
+
"type": "opencollective",
|
|
3208
|
+
"url": "https://opencollective.com/express"
|
|
3205
3209
|
}
|
|
3206
3210
|
},
|
|
3207
3211
|
"node_modules/once": {
|
|
@@ -3751,9 +3755,9 @@
|
|
|
3751
3755
|
}
|
|
3752
3756
|
},
|
|
3753
3757
|
"node_modules/set-cookie-parser": {
|
|
3754
|
-
"version": "3.1
|
|
3755
|
-
"resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-3.1.
|
|
3756
|
-
"integrity": "sha512-
|
|
3758
|
+
"version": "3.2.1",
|
|
3759
|
+
"resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-3.2.1.tgz",
|
|
3760
|
+
"integrity": "sha512-Npd1Pt+4zb3BrSZDPd2qFwRpS6b1EUEasRrO8xS0zMJi0fApXXK5YuzP0minyJnxwnFHoVoJwA55q0A0cu63gQ==",
|
|
3757
3761
|
"license": "MIT"
|
|
3758
3762
|
},
|
|
3759
3763
|
"node_modules/setprototypeof": {
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,31278,e=>{"use strict";var t=e.i(17521);e.s(["Loader2",()=>t.default])},18566,(e,t,r)=>{t.exports=e.r(76562)},95468,e=>{"use strict";var t=e.i(23287);e.s(["CheckCircle2",()=>t.default])},27612,e=>{"use strict";let t=(0,e.i(75254).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["Trash2",0,t],27612)},14683,e=>{"use strict";let t=(0,e.i(75254).default)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["Circle",0,t],14683)},86311,e=>{"use strict";let t=(0,e.i(75254).default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);e.s(["MessageSquare",0,t],86311)},73884,e=>{"use strict";let t=(0,e.i(75254).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["XCircle",0,t],73884)},2576,e=>{"use strict";var t=e.i(71645),r=e.i(95008);e.s(["useTaskEvents",0,function(e){let n=(0,t.useRef)(e);(0,t.useLayoutEffect)(()=>{n.current=e}),(0,t.useEffect)(()=>{let e=(0,r.getSharedSocket)(),t=({task:e,warnings:t})=>{n.current.onTaskCreated(e,t??[])},s=({task:e})=>{n.current.onTaskUpdated(e)},a=({taskId:e})=>{n.current.onTaskDeleted(e)},i=({task:e})=>{n.current.onTaskTabsChanged?.(e)};return e.on("task:created",t),e.on("task:updated",s),e.on("task:deleted",a),e.on("task:tabs-changed",i),()=>{e.off("task:created",t),e.off("task:updated",s),e.off("task:deleted",a),e.off("task:tabs-changed",i)}},[])}])},71698,e=>{"use strict";var t=e.i(71645),r=e.i(95008);e.s(["useTabStatusEvents",0,function(e,n){let s=(0,t.useRef)(new Map),a=(0,t.useRef)(n);(0,t.useEffect)(()=>{a.current=n}),(0,t.useEffect)(()=>{let e=(0,r.getSharedSocket)(),t=({sessionId:e,status:t})=>{let r=function(e){switch(e){case"running":return"running";case"waiting":return"waiting";case"success":return"success";case"failure":case"error":return"error";case"idle":return"idle";default:return null}}(t);null!==r&&a.current(e,r)};return e.on("status-changed",t),()=>{e.off("status-changed",t)}},[]),(0,t.useEffect)(()=>{(0,r.syncRoomSubscriptions)(s.current,e.map(e=>`tab:${e}`))},[e]),(0,t.useEffect)(()=>{let e=s.current;return()=>{(0,r.clearRoomSubscriptions)(e)}},[])}])},45139,801,e=>{"use strict";function t(e){return"success"===e||"error"===e||"running"!==e&&"idle"!==e&&void 0}function r(e){let t=e.tabs??[];if(0===t.length||t.some(e=>"running"===e.status))return null;if(t.some(e=>"waiting"===e.status))return"waiting";let r=t.filter(e=>e.unread);return r.some(e=>"error"===e.status)?"error":r.some(e=>"success"===e.status)?"success":null}e.s(["activityKind",0,function(e){return(e.tabs??[]).some(e=>"running"===e.status)?"running":r(e)},"hasUnreadResult",0,function(e){return null!==r(e)},"unreadForStatus",0,t,"unreadKind",0,r],45139);var n=e.i(71645),s=e.i(70935),a=e.i(2576),i=e.i(71698);let l=null;e.s(["useLiveTasks",0,function(e={}){let[r,o]=(0,n.useState)(()=>l??[]),[u,d]=(0,n.useState)(null!==l),[c,f]=(0,n.useState)(!0),h=(0,n.useRef)(e),m=(0,n.useRef)(r);(0,n.useEffect)(()=>{h.current=e,m.current=r}),(0,n.useEffect)(()=>{u&&(l=r)},[r,u]);let g=(0,n.useCallback)(async()=>{f(!0);try{let e=await fetch((0,s.apiUrl)("/api/tasks"));if(!e.ok)throw Error("Failed to fetch tasks");let t=await e.json();o(t.data.tasks),d(!0)}catch(e){console.error("Failed to load tasks:",e)}finally{f(!1)}},[]);(0,n.useEffect)(()=>{g()},[g]);let p=(0,n.useMemo)(()=>r.flatMap(e=>(e.tabs??[]).map(e=>e.tab_id)),[r]);return(0,i.useTabStatusEvents)(p,(e,r)=>{let n=t(r);o(t=>t.map(t=>({...t,tabs:(t.tabs??[]).map(t=>t.tab_id===e?{...t,status:r,...void 0!==n&&{unread:n}}:t)})))}),(0,a.useTaskEvents)({onTaskCreated:(e,t)=>{o(t=>t.some(t=>t.id===e.id)?t:[...t,e]),h.current.onTaskCreated?.(e,t)},onTaskUpdated:e=>{o(t=>t.map(t=>t.id===e.id?e:t)),h.current.onTaskUpdated?.(e)},onTaskDeleted:e=>{let t=m.current.find(t=>t.id===e);o(t=>t.filter(t=>t.id!==e)),h.current.onTaskDeleted?.(e,t)},onTaskTabsChanged:e=>{o(t=>t.map(t=>t.id===e.id?e:t))}}),{tasks:r,setTasks:o,isLoading:c,hasLoaded:u,reload:g}}],801)},22770,e=>{"use strict";var t=e.i(18050),r=e.i(18566),n=e.i(71645),s=e.i(95468),a=e.i(14683);let i=(0,e.i(75254).default)("list-x",[["path",{d:"M16 5H3",key:"m91uny"}],["path",{d:"M11 12H3",key:"51ecnj"}],["path",{d:"M16 19H3",key:"zzsher"}],["path",{d:"m15.5 9.5 5 5",key:"ytk86i"}],["path",{d:"m20.5 9.5-5 5",key:"17o44f"}]]);var l=e.i(31278),o=e.i(86311),u=e.i(73884),d=e.i(45139),c=e.i(801);let f="tsunagi:sidebar-tasks",h={shown:[],dismissed:{},hintSeen:!1},m=new Set,g=null,p=h;function v(){let e=function(){try{return localStorage.getItem(f)}catch{return null}}();if(e===g)return p;g=e;try{let t=e?JSON.parse(e):{};p={shown:Array.isArray(t.shown)?t.shown:[],dismissed:t.dismissed??{},hintSeen:!0===t.hintSeen}}catch{p=h}return p}function b(){return h}function x(e){m.add(e);let t=t=>{(t.key===f||null===t.key)&&e()};return window.addEventListener("storage",t),()=>{m.delete(e),window.removeEventListener("storage",t)}}function k(e){let t=v(),r=e(t);if(r!==t){try{localStorage.setItem(f,JSON.stringify(r))}catch{g=null,p=r}m.forEach(e=>e())}}var y=e.i(19805),w=e.i(27601),j=e.i(25913),N=e.i(52088);let S=(0,j.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-[0.625rem] font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-2.5!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border bg-input/20 text-foreground dark:bg-input/30 [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function T({className:e,variant:t="default",render:r,...n}){var s;return s={defaultTagName:"span",props:(0,y.mergeProps)({className:(0,N.cn)(S({variant:t}),e)},n),render:r,state:{slot:"badge",variant:t}},(0,w.useRenderElement)(s.defaultTagName??"div",s,s)}var C=e.i(85902),M=e.i(68995),E=e.i(69068),R=e.i(27612);function I({children:e,canSwipe:r,open:s,onOpenChange:a,onRemove:i,hint:l=!1,onHintEnd:o,onMouseEnter:u}){let d=(0,n.useRef)(null),c=(0,n.useRef)(null),f=(0,n.useRef)(null),h=(0,n.useRef)(!1),[m,g]=(0,n.useState)(null),[p,v]=(0,n.useState)(!1),b=m??(s?-64:0),x=l&&null===m&&!s&&!p;(0,n.useEffect)(()=>{if(!s)return;let e=e=>{d.current?.contains(e.target)||a(!1)};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[s,a]);let k=e=>{let t=c.current;if(!t)return i();v(!0),t.animate([{transform:`translateX(${e}px)`},{transform:"translateX(-100%)"}],{duration:200,easing:"ease-out",fill:"forwards"}).finished.then(i,i)};return(0,t.jsxs)("div",{ref:d,className:"relative touch-pan-y select-none overflow-hidden rounded-md",onPointerDown:e=>{h.current=!1,p||0!==e.button||(f.current={pointerId:e.pointerId,startX:e.clientX,startY:e.clientY,base:s?-64:0,dragging:!1,locked:!r(e.timeStamp)})},onPointerMove:e=>{let t=f.current;if(!t||t.pointerId!==e.pointerId)return;let r=e.clientX-t.startX,n=e.clientY-t.startY;if(!t.dragging){if(8>Math.abs(r)&&8>Math.abs(n))return;if(Math.abs(n)>=Math.abs(r)){f.current=null;return}if(t.dragging=!0,t.locked)return;l&&o?.(),e.currentTarget.setPointerCapture(e.pointerId)}t.locked||g(Math.min(0,Math.max(-e.currentTarget.offsetWidth,t.base+r)))},onPointerUp:e=>{let t=f.current;if(f.current=null,!t||t.pointerId!==e.pointerId||!t.dragging||(h.current=!0,t.locked))return;let r=-Math.min(0,t.base+e.clientX-t.startX);g(null),r>.6*e.currentTarget.offsetWidth?k(-r):a(r>32)},onPointerCancel:()=>{f.current=null,g(null)},onPointerEnter:e=>"mouse"===e.pointerType&&u?.(),onClickCapture:e=>{if(h.current){h.current=!1,e.preventDefault(),e.stopPropagation();return}s&&!e.target.closest("[data-swipe-action]")&&(e.preventDefault(),e.stopPropagation(),a(!1))},children:[(0!==b||x||p)&&(0,t.jsx)("div",{className:"absolute inset-0 flex justify-end bg-destructive",children:(0,t.jsx)("button",{type:"button","data-swipe-action":!0,tabIndex:s?0:-1,"aria-label":"Remove from list",title:"Remove from list",onClick:()=>k(b),style:{width:p?"100%":Math.max(64,-b)},className:(0,N.cn)("flex items-center pl-5 text-white",null===m&&"transition-[width] duration-200 ease-out"),children:(0,t.jsx)(R.Trash2,{className:"size-3.5"})})}),(0,t.jsx)("div",{ref:c,style:{transform:x?void 0:`translateX(${b}px)`},className:(0,N.cn)("relative bg-background dark:bg-card",null===m&&"transition-transform duration-200 ease-out",x&&"animate-swipe-hint"),onAnimationEnd:e=>e.target===e.currentTarget&&o?.(),children:e})]})}let K={waiting:0,error:1,success:2,running:3},P={running:{icon:l.Loader2,className:"text-primary animate-spin",label:"Running"},waiting:{icon:o.MessageSquare,className:"text-warning",label:"Waiting for your input"},error:{icon:u.XCircle,className:"text-destructive",label:"Failed"},success:{icon:s.CheckCircle2,className:"text-success",label:"Finished"}},L={icon:a.Circle,className:"text-muted-foreground",label:"Idle"},X={success:{className:"bg-unread-success",label:"Finished, not opened yet"},error:{className:"bg-unread-error",label:"Failed, not opened yet"},waiting:{className:"bg-unread-waiting",label:"Waiting for your input"}};function z(e){return"running"===e||"waiting"===e}function A(e,t){let r=new Set(t.map(e=>e.id)),n=e.shown.filter(e=>r.has(e)),s={};for(let r of t){let t=(0,d.activityKind)(r);if(r.id in e.dismissed&&e.dismissed[r.id]===t){s[r.id]=t;continue}t&&!n.includes(r.id)&&n.push(r.id)}return n.length===e.shown.length&&n.every((t,r)=>t===e.shown[r])&&Object.keys(s).length===Object.keys(e.dismissed).length?e:{...e,shown:n,dismissed:s}}function D(e){let t=window.matchMedia("(hover: hover)");return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}function O({currentTaskId:e}){let s=(0,r.useRouter)(),{tasks:a,isLoading:l}=(0,c.useLiveTasks)(),{state:o,update:u}={state:(0,n.useSyncExternalStore)(x,v,b),update:k},f=(0,n.useMemo)(()=>l?o:A(o,a),[l,o,a]);(0,n.useEffect)(()=>{f!==o&&u(e=>A(e,a))},[f,o,a,u]);let h=(0,n.useRef)(new Map),m=(0,n.useRef)(new Map);(0,n.useEffect)(()=>{for(let e of a){let t=(0,d.activityKind)(e);z(h.current.get(e.id)??null)&&!z(t)&&m.current.set(e.id,performance.now()),h.current.set(e.id,t)}},[a]);let{active:g,done:p}=(0,n.useMemo)(()=>{let t=new Map(a.map(e=>[e.id,e])),r=[],n=[];for(let s of f.shown){let a=t.get(s);if(!a)continue;let i=(0,d.activityKind)(a);i&&(a.id!==e||"success"!==i&&"error"!==i)?r.push({task:a,kind:i}):n.push(a)}let s=(e,t)=>e.order-t.order||e.createdAt.localeCompare(t.createdAt);return r.sort((e,t)=>K[e.kind]-K[t.kind]||s(e.task,t.task)),n.sort(s),{active:r,done:n}},[a,f.shown,e]),y=(0,n.useMemo)(()=>[...g.map(({task:e})=>e),...p],[g,p]),w=y.filter(e=>!z((0,d.activityKind)(e))),[j,S]=(0,n.useState)(null),[R,U]=(0,n.useState)(null),F=(0,n.useSyncExternalStore)(D,()=>window.matchMedia("(hover: hover)").matches,()=>!0),[B,H]=(0,n.useState)(null),W=f.hintSeen?null:F?w.some(e=>e.id===B)?B:null:w[0]?.id??null,q=(e,t)=>!z((0,d.activityKind)(e))&&t-(m.current.get(e.id)??0)>=3e3,V=e=>{let t=new Map(a.map(e=>[e.id,e]));u(r=>{let n={...r.dismissed};for(let r of e){let e=t.get(r);e&&(n[r]=(0,d.activityKind)(e))}return{...r,shown:r.shown.filter(t=>!e.includes(t)),dismissed:n}})},Y=r=>{var n;let a=r.id===e,i=z((0,d.activityKind)(r)),l=(n=r.tabs)&&0!==n.length?n.some(e=>"running"===e.status)?"running":n.some(e=>"waiting"===e.status)?"waiting":n.some(e=>"error"===e.status)?"error":n.every(e=>"success"===e.status)?"success":null:null,{icon:o,className:c,label:h}=l?P[l]:L,m=(0,d.unreadKind)(r);return a&&"waiting"!==m&&(m=null),(0,t.jsx)("li",{children:(0,t.jsxs)(I,{canSwipe:e=>q(r,e),open:j===r.id&&!i,onOpenChange:e=>S(t=>e?r.id:t===r.id?null:t),onRemove:()=>V([r.id]),hint:W===r.id,onHintEnd:()=>u(e=>({...e,hintSeen:!0})),onMouseEnter:()=>!f.hintSeen&&!i&&H(e=>e??r.id),children:[m&&(0,t.jsx)("span",{role:"img","aria-label":X[m].label,title:X[m].label,className:(0,N.cn)("absolute left-0 top-1.5 bottom-1.5 z-10 w-[3px] rounded-r-[3px]",X[m].className)}),(0,t.jsxs)("button",{type:"button",onClick:()=>s.replace(`/tasks/${r.id}`),"aria-current":a?"page":void 0,className:(0,N.cn)("flex w-full items-start gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-accent",a&&"bg-accent"),children:[(0,t.jsx)("span",{role:"img","aria-label":h,title:h,className:"mt-0.5 shrink-0",children:(0,t.jsx)(o,{className:(0,N.cn)("size-3.5",c)})}),(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"block truncate text-sm text-foreground",title:r.title,children:r.title}),(0,t.jsxs)("span",{className:"block truncate text-xs text-muted-foreground",children:[r.owner,"/",r.repo]})]})]})]})},r.id)},$=(e,r)=>r.length>0&&(0,t.jsxs)("section",{children:[(0,t.jsxs)("h2",{className:"px-2 pb-1 pt-2 text-xs font-medium text-muted-foreground",children:[e," ",(0,t.jsx)("span",{className:"tabular-nums",children:r.length})]}),(0,t.jsx)("ul",{className:"space-y-0.5",children:r.map(Y)})]});return(0,t.jsxs)("aside",{className:"hidden md:flex w-64 shrink-0 flex-col border-r border-border bg-background dark:bg-card",children:[(0,t.jsxs)("div",{className:"flex h-8 shrink-0 box-content items-center gap-2 border-b border-border bg-card p-4",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Tasks"}),(0,t.jsx)(T,{variant:"secondary",children:y.length}),(0,t.jsx)(C.Button,{variant:"ghost",size:"icon",className:"ml-auto text-muted-foreground hover:text-foreground","aria-label":"Clear list",title:"Clear list",disabled:0===w.length,onClick:e=>{let t=y.filter(t=>q(t,e.timeStamp)).map(e=>e.id);t.length>0&&U(t)},children:(0,t.jsx)(i,{})})]}),0===y.length?(0,t.jsx)("p",{className:"p-4 text-center text-xs text-muted-foreground",children:"No tasks"}):(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto px-2 pb-2",children:[$("Active",g.map(({task:e})=>e)),$("Done",p)]}),(0,t.jsx)(M.Dialog,{open:null!==R,onOpenChange:e=>!e.open&&U(null),title:"Clear list",maxWidth:"md",showCloseButton:!1,children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("p",{className:"text-foreground",children:["Remove ",R?.length," task",R?.length===1?"":"s"," from this list?"]}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Running or waiting tasks stay. The tasks themselves are not deleted."}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,t.jsx)(E.DialogClose,{render:(0,t.jsx)(C.Button,{variant:"outline",className:"cursor-pointer"}),children:"Cancel"}),(0,t.jsx)(C.Button,{variant:"destructive",className:"cursor-pointer",onClick:()=>{R&&V(R),U(null)},children:"Clear"})]})]})})]})}e.s(["default",0,function({children:e}){let{id:n}=(0,r.useParams)();return(0,t.jsxs)("div",{className:"h-screen flex bg-background",children:[(0,t.jsx)(O,{currentTaskId:n}),(0,t.jsx)("div",{className:"flex-1 min-w-0",children:e})]})}],22770)}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,50160,e=>{e.q("/_next/static/media/icon.0fkix7.hkmsz4.png")},31278,e=>{"use strict";var t=e.i(17521);e.s(["Loader2",()=>t.default])},18566,(e,t,r)=>{t.exports=e.r(76562)},27612,e=>{"use strict";let t=(0,e.i(75254).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["Trash2",0,t],27612)},95468,e=>{"use strict";var t=e.i(23287);e.s(["CheckCircle2",()=>t.default])},86311,e=>{"use strict";let t=(0,e.i(75254).default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);e.s(["MessageSquare",0,t],86311)},73884,e=>{"use strict";let t=(0,e.i(75254).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["XCircle",0,t],73884)},2576,e=>{"use strict";var t=e.i(71645),r=e.i(95008);e.s(["useTaskEvents",0,function(e){let n=(0,t.useRef)(e);(0,t.useLayoutEffect)(()=>{n.current=e}),(0,t.useEffect)(()=>{let e=(0,r.getSharedSocket)(),t=({task:e,warnings:t})=>{n.current.onTaskCreated(e,t??[])},s=({task:e})=>{n.current.onTaskUpdated(e)},u=({taskId:e})=>{n.current.onTaskDeleted(e)},a=({task:e})=>{n.current.onTaskTabsChanged?.(e)};return e.on("task:created",t),e.on("task:updated",s),e.on("task:deleted",u),e.on("task:tabs-changed",a),()=>{e.off("task:created",t),e.off("task:updated",s),e.off("task:deleted",u),e.off("task:tabs-changed",a)}},[])}])},71698,e=>{"use strict";var t=e.i(71645),r=e.i(95008);e.s(["useTabStatusEvents",0,function(e,n){let s=(0,t.useRef)(new Map),u=(0,t.useRef)(n);(0,t.useEffect)(()=>{u.current=n}),(0,t.useEffect)(()=>{let e=(0,r.getSharedSocket)(),t=({sessionId:e,status:t})=>{let r=function(e){switch(e){case"running":return"running";case"waiting":return"waiting";case"success":return"success";case"failure":case"error":return"error";case"idle":return"idle";default:return null}}(t);null!==r&&u.current(e,r)};return e.on("status-changed",t),()=>{e.off("status-changed",t)}},[]),(0,t.useEffect)(()=>{(0,r.syncRoomSubscriptions)(s.current,e.map(e=>`tab:${e}`))},[e]),(0,t.useEffect)(()=>{let e=s.current;return()=>{(0,r.clearRoomSubscriptions)(e)}},[])}])},45139,801,e=>{"use strict";function t(e){return"success"===e||"error"===e||"running"!==e&&"idle"!==e&&void 0}function r(e){let t=e.tabs??[];if(0===t.length||t.some(e=>"running"===e.status))return null;if(t.some(e=>"waiting"===e.status))return"waiting";let r=t.filter(e=>e.unread);return r.some(e=>"error"===e.status)?"error":r.some(e=>"success"===e.status)?"success":null}e.s(["activityKind",0,function(e){return(e.tabs??[]).some(e=>"running"===e.status)?"running":r(e)},"hasUnreadResult",0,function(e){return null!==r(e)},"unreadForStatus",0,t,"unreadKind",0,r],45139);var n=e.i(71645),s=e.i(70935),u=e.i(2576),a=e.i(71698);let l=null;e.s(["useLiveTasks",0,function(e={}){let[r,o]=(0,n.useState)(()=>l??[]),[i,c]=(0,n.useState)(null!==l),[d,f]=(0,n.useState)(!0),p=(0,n.useRef)(e),k=(0,n.useRef)(r);(0,n.useEffect)(()=>{p.current=e,k.current=r}),(0,n.useEffect)(()=>{i&&(l=r)},[r,i]);let y=(0,n.useCallback)(async()=>{f(!0);try{let e=await fetch((0,s.apiUrl)("/api/tasks"));if(!e.ok)throw Error("Failed to fetch tasks");let t=await e.json();o(t.data.tasks),c(!0)}catch(e){console.error("Failed to load tasks:",e)}finally{f(!1)}},[]);(0,n.useEffect)(()=>{y()},[y]);let m=(0,n.useMemo)(()=>r.flatMap(e=>(e.tabs??[]).map(e=>e.tab_id)),[r]);return(0,a.useTabStatusEvents)(m,(e,r)=>{let n=t(r);o(t=>t.map(t=>({...t,tabs:(t.tabs??[]).map(t=>t.tab_id===e?{...t,status:r,...void 0!==n&&{unread:n}}:t)})))}),(0,u.useTaskEvents)({onTaskCreated:(e,t)=>{o(t=>t.some(t=>t.id===e.id)?t:[...t,e]),p.current.onTaskCreated?.(e,t)},onTaskUpdated:e=>{o(t=>t.map(t=>t.id===e.id?e:t)),p.current.onTaskUpdated?.(e)},onTaskDeleted:e=>{let t=k.current.find(t=>t.id===e);o(t=>t.filter(t=>t.id!==e)),p.current.onTaskDeleted?.(e,t)},onTaskTabsChanged:e=>{o(t=>t.map(t=>t.id===e.id?e:t))}}),{tasks:r,setTasks:o,isLoading:d,hasLoaded:i,reload:y}}],801)},76165,e=>{"use strict";var t=e.i(85699);e.s(["useToast",0,()=>({loading:(e,r)=>{let n=crypto.randomUUID();return t.toast.loading(e,{id:n,description:r,duration:1/0}),n},success:(e,r,n)=>{if(e)return t.toast.success(r,{id:e,description:n,duration:5e3}),e;{let e=crypto.randomUUID();return t.toast.success(r,{id:e,description:n,duration:5e3}),e}},error:(e,r,n)=>{if(e)return t.toast.error(r,{id:e,description:n,duration:1/0}),e;{let e=crypto.randomUUID();return t.toast.error(r,{id:e,description:n,duration:1/0}),e}},info:(e,r)=>{let n=crypto.randomUUID();return t.toast.info(e,{id:n,description:r,duration:5e3}),n},dismiss:e=>{t.toast.dismiss(e)}})])},18581,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return s}});let n=e.r(71645);function s(e,t){let r=(0,n.useRef)(null),s=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=s.current;t&&(s.current=null,t())}else e&&(r.current=u(e,n)),t&&(s.current=u(t,n))},[e,t])}function u(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},67585,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"BailoutToCSR",{enumerable:!0,get:function(){return s}});let n=e.r(32061);function s({reason:e,children:t}){if("u"<typeof window)throw Object.defineProperty(new n.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t}},9885,(e,t,r)=>{"use strict";function n(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"encodeURIPath",{enumerable:!0,get:function(){return n}})},52157,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"PreloadChunks",{enumerable:!0,get:function(){return o}});let n=e.r(18050),s=e.r(74080),u=e.r(63599),a=e.r(9885),l=e.r(43369);function o({moduleIds:e}){if("u">typeof window)return null;let t=u.workAsyncStorage.getStore();if(void 0===t)return null;let r=[];if(t.reactLoadableManifest&&e){let n=t.reactLoadableManifest;for(let t of e){if(!n[t])continue;let e=n[t].files;r.push(...e)}}if(0===r.length)return null;let i=(0,l.getAssetTokenQuery)();return(0,n.jsx)(n.Fragment,{children:r.map(e=>{let r=`${t.assetPrefix}/_next/${(0,a.encodeURIPath)(e)}${i}`;return e.endsWith(".css")?(0,n.jsx)("link",{precedence:"dynamic",href:r,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,s.preload)(r,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},69093,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return i}});let n=e.r(18050),s=e.r(71645),u=e.r(67585),a=e.r(52157);function l(e){return{default:e&&"default"in e?e.default:e}}let o={loader:()=>Promise.resolve(l(()=>null)),loading:null,ssr:!0},i=function(e){let t={...o,...e},r=(0,s.lazy)(()=>t.loader().then(l)),i=t.loading;function c(e){let l=i?(0,n.jsx)(i,{isLoading:!0,pastDelay:!0,error:null}):null,o=!t.ssr||!!t.loading,c=o?s.Suspense:s.Fragment,d=t.ssr?(0,n.jsxs)(n.Fragment,{children:["u"<typeof window?(0,n.jsx)(a.PreloadChunks,{moduleIds:t.modules}):null,(0,n.jsx)(r,{...e})]}):(0,n.jsx)(u.BailoutToCSR,{reason:"next/dynamic",children:(0,n.jsx)(r,{...e})});return(0,n.jsx)(c,{...o?{fallback:l}:{},children:d})}return c.displayName="LoadableComponent",c}},70703,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return s}});let n=e.r(55682)._(e.r(69093));function s(e,t){let r={};"function"==typeof e&&(r.loader=e);let s={...r,...t};return(0,n.default)({...s,modules:s.loadableGenerated?.modules})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},30627,92943,e=>{"use strict";var t=e.i(18050),r=e.i(70703),n=e.i(71645);let s=(0,r.default)(()=>e.A(10338).then(e=>e.TaskDialog),{ssr:!1});e.s(["LazyTaskDialog",0,function(r){let[u,a]=(0,n.useState)(r.isOpen);return(r.isOpen&&!u&&a(!0),(0,n.useEffect)(()=>{if(u)return;if("function"!=typeof window.requestIdleCallback)return void e.A(10338);let t=window.requestIdleCallback(()=>void e.A(10338));return()=>window.cancelIdleCallback(t)},[u]),u)?(0,t.jsx)(s,{...r}):null}],30627);let u="tsunagi:last-viewed-task";e.s(["clearLastViewedTask",0,function(){try{sessionStorage.removeItem(u)}catch{}},"peekLastViewedTask",0,function(){try{return sessionStorage.getItem(u)}catch{return null}},"rememberLastViewedTask",0,function(e){try{sessionStorage.setItem(u,e)}catch{}}],92943)},10338,e=>{e.v(t=>Promise.all(["static/chunks/0fa94q8j1ob9n.js","static/chunks/16xeyatjk8-e0.js","static/chunks/0c2kbud31dfzp.js"].map(t=>e.l(t))).then(()=>t(10483)))}]);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|