@minimalcorp/tsunagi 0.1.16 → 0.1.18

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.
Files changed (66) hide show
  1. package/.next/standalone/apps/web/.next/BUILD_ID +1 -1
  2. package/.next/standalone/apps/web/.next/build-manifest.json +3 -3
  3. package/.next/standalone/apps/web/.next/prerender-manifest.json +3 -3
  4. package/.next/standalone/apps/web/.next/server/app/_global-error.html +1 -1
  5. package/.next/standalone/apps/web/.next/server/app/_global-error.rsc +1 -1
  6. package/.next/standalone/apps/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  7. package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  8. package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  9. package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  10. package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  11. package/.next/standalone/apps/web/.next/server/app/_not-found.html +1 -1
  12. package/.next/standalone/apps/web/.next/server/app/_not-found.rsc +1 -1
  13. package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  14. package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  15. package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  16. package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  17. package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  18. package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  19. package/.next/standalone/apps/web/.next/server/app/index.html +1 -1
  20. package/.next/standalone/apps/web/.next/server/app/index.rsc +2 -2
  21. package/.next/standalone/apps/web/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  22. package/.next/standalone/apps/web/.next/server/app/index.segments/_full.segment.rsc +2 -2
  23. package/.next/standalone/apps/web/.next/server/app/index.segments/_head.segment.rsc +1 -1
  24. package/.next/standalone/apps/web/.next/server/app/index.segments/_index.segment.rsc +1 -1
  25. package/.next/standalone/apps/web/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  26. package/.next/standalone/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
  27. package/.next/standalone/apps/web/.next/server/app/settings.html +1 -1
  28. package/.next/standalone/apps/web/.next/server/app/settings.rsc +1 -1
  29. package/.next/standalone/apps/web/.next/server/app/settings.segments/_full.segment.rsc +1 -1
  30. package/.next/standalone/apps/web/.next/server/app/settings.segments/_head.segment.rsc +1 -1
  31. package/.next/standalone/apps/web/.next/server/app/settings.segments/_index.segment.rsc +1 -1
  32. package/.next/standalone/apps/web/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
  33. package/.next/standalone/apps/web/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +1 -1
  34. package/.next/standalone/apps/web/.next/server/app/settings.segments/settings.segment.rsc +1 -1
  35. package/.next/standalone/apps/web/.next/server/app/tasks/[id]/page_client-reference-manifest.js +1 -1
  36. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__05isylw._.js +2 -2
  37. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0ro8-ey._.js +2 -2
  38. package/.next/standalone/apps/web/.next/server/chunks/ssr/_0g.cd6a._.js +1 -1
  39. package/.next/standalone/apps/web/.next/server/chunks/ssr/apps_web_src_app_tasks_[id]_page_tsx_0jshsm2._.js +1 -1
  40. package/.next/standalone/apps/web/.next/server/middleware-build-manifest.js +3 -3
  41. package/.next/standalone/apps/web/.next/server/pages/404.html +1 -1
  42. package/.next/standalone/apps/web/.next/server/pages/500.html +1 -1
  43. package/.next/standalone/apps/web/.next/server/server-reference-manifest.js +1 -1
  44. package/.next/standalone/apps/web/.next/server/server-reference-manifest.json +1 -1
  45. package/.next/standalone/apps/web/.next/static/chunks/09ik3f_4bui.6.js +3 -0
  46. package/.next/standalone/apps/web/.next/static/chunks/{0zf.4.k6hxz~b.js → 0e9ktynfbcnuu.js} +2 -2
  47. package/.next/standalone/apps/web/.next/static/chunks/{03lw1.jf3nzsp.js → 10i6zv0moo8jf.js} +1 -1
  48. package/.next/standalone/apps/web/.next/static/chunks/{0jaki2nicisbt.js → 1145l.gbs9mp0.js} +2 -2
  49. package/dist/server/generated/prisma/internal/class.js +4 -4
  50. package/dist/server/generated/prisma/internal/prismaNamespace.d.ts +1 -0
  51. package/dist/server/generated/prisma/internal/prismaNamespace.js +1 -0
  52. package/dist/server/generated/prisma/internal/prismaNamespaceBrowser.d.ts +1 -0
  53. package/dist/server/generated/prisma/internal/prismaNamespaceBrowser.js +1 -0
  54. package/dist/server/generated/prisma/models/Tab.d.ts +36 -1
  55. package/dist/server/lib/repositories/task.d.ts +1 -1
  56. package/dist/server/lib/repositories/task.js +3 -1
  57. package/dist/server/routes/tasks.js +2 -1
  58. package/dist/server/routes/terminal.js +27 -1
  59. package/npm-shrinkwrap.json +23 -18
  60. package/package.json +1 -1
  61. package/prisma/migrations/20260629000000_add_tab_mode/migration.sql +4 -0
  62. package/prisma/schema.prisma +1 -0
  63. package/.next/standalone/apps/web/.next/static/chunks/0kpkmh5umvk_l.js +0 -3
  64. /package/.next/standalone/apps/web/.next/static/{ZuFNfLCNNHQAu9ChQjnK7 → 36-cU0G0900-sCM9SPr1i}/_buildManifest.js +0 -0
  65. /package/.next/standalone/apps/web/.next/static/{ZuFNfLCNNHQAu9ChQjnK7 → 36-cU0G0900-sCM9SPr1i}/_clientMiddlewareManifest.js +0 -0
  66. /package/.next/standalone/apps/web/.next/static/{ZuFNfLCNNHQAu9ChQjnK7 → 36-cU0G0900-sCM9SPr1i}/_ssgManifest.js +0 -0
@@ -61,4 +61,4 @@ ${D.current.stack}
61
61
  -moz-user-select: none;
62
62
  -ms-user-select: none;
63
63
  overflow-anchor: none;
64
- `}}],"always"),resting:nc(i,"resting"),dragging:nc(i,"dragging"),dropAnimating:nc(i,"dropAnimating"),userCancel:nc(i,"userCancel")}},[I]),i=(0,W.useRef)(null),a=(0,W.useRef)(null),o=td(tN(e=>{let t=a.current;t||e7(),t.textContent=e}),[]),np(()=>{(i.current||a.current)&&e7();let e=ng(C),t=ng(C);return i.current=e,a.current=t,e.setAttribute(`${na}-always`,I),t.setAttribute(`${na}-dynamic`,I),nf().appendChild(e),nf().appendChild(t),s(l.always),o(l.resting),()=>{let e=e=>{let t=e.current;t||e7(),nf().removeChild(t),e.current=null};e(i),e(a)}},[C,s=td(e=>{let t=i.current;t||e7(),t.textContent=e},[]),o,l.always,l.resting,I]),d=td(()=>o(l.dragging),[o,l.dragging]),u=td(e=>{"DROP"===e?o(l.dropAnimating):o(l.userCancel)},[o,l.dropAnimating,l.userCancel]),ts(()=>({dragging:d,dropping:u,resting:c}),[d,u,c=td(()=>{a.current&&o(l.resting)},[o,l.resting])])),T=td(e=>{nH(S).dispatch(e)},[]),_=ts(()=>X({publishWhileDragging:rh,updateDroppableScroll:rx,updateDroppableIsEnabled:ry,updateDroppableIsCombineEnabled:rv,collectionStarting:rb},T),[T]),B=(p=ts(ny,[]),(0,W.useEffect)(()=>function(){p.clean()},[p]),p),M=ts(()=>{let e,t,r;return e=null,t=function({registry:e,callbacks:t}){let r=rK(),n=null,l=()=>{n||(t.collectionStarting(),n=requestAnimationFrame(()=>{n=null,rd();let{additions:l,removals:i,modified:a}=r,o=Object.keys(l).map(t=>e.draggable.getById(t).getDimension(tu)).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=rK(),ru(),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=rK())}}}({callbacks:{publish:_.publishWhileDragging,collectionStarting:_.collectionStarting},registry:B}),r=r=>{e||e7();let n=e.critical.draggable;"ADDITION"===r.type&&r0(B,n,r.value)&&t.add(r.value),"REMOVAL"===r.type&&r0(B,n,r.value)&&t.remove(r.value)},{updateDroppableIsEnabled:(t,r)=>{B.droppable.exists(t)||e7(),e&&_.updateDroppableIsEnabled({id:t,isEnabled:r})},updateDroppableIsCombineEnabled:(t,r)=>{e&&(B.droppable.exists(t)||e7(),_.updateDroppableIsCombineEnabled({id:t,isCombineEnabled:r}))},scrollDroppable:(t,r)=>{e&&B.droppable.getById(t).callbacks.scroll(r)},updateDroppableScroll:(t,r)=>{e&&(B.droppable.exists(t)||e7(),_.updateDroppableScroll({id:t,newScroll:r}))},startPublishing:t=>{e&&e7();let n=B.draggable.getById(t.draggableId),l=B.droppable.getById(n.descriptor.droppableId),i={draggable:n.descriptor,droppable:l.descriptor};return e={critical:i,unsubscribe:B.subscribe(r)},(({critical:e,scrollOptions:t,registry:r})=>{let n,l,i,a,o,s;rd();let d=(n=rz(),l=rZ(),i=n.y,a=n.x,s=(o=rQ()).clientWidth,{frame:eH({top:i,left:a,right:a+s,bottom:i+o.clientHeight}),scroll:{initial:n,current:n,max:l,diff:{value:tu,displacement:tu}}}),u=d.scroll.current,c=e.droppable,p=r.droppable.getAllByType(c.type).map(e=>e.callbacks.getDimensionAndWatchScroll(u,t)),f={draggables:tC(r.draggable.getAllByType(e.draggable.type).map(e=>e.getDimension(u))),droppables:tE(p)};return ru(),{dimensions:f,critical:e,viewport:d}})({critical:i,registry:B,scrollOptions:t.scrollOptions})},stopPublishing:()=>{if(!e)return;t.stop();let r=e.critical.droppable;B.droppable.getAllByType(r.type).forEach(e=>e.callbacks.dragStopped()),e.unsubscribe(),e=null}}},[B,_]),L=ts(()=>(({scrollDroppable:e,scrollWindow:t,move:r,getAutoScrollerOptions:n})=>{let l=(({scrollWindow:e,scrollDroppable:t,getAutoScrollerOptions:r=()=>r5})=>{let n=e1(e),l=e1(t),i=null,a=e=>{i||e7();let{shouldUseTimeDampening:t,dragStartTime:a}=i;ni({state:e,scrollWindow:n,scrollDroppable:l,dragStartTime:a,shouldUseTimeDampening:t,getAutoScrollerOptions:r})};return{start:e=>{rd(),i&&e7();let t=Date.now(),n=!1,l=()=>{n=!0};ni({state:e,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:l,scrollDroppable:l,getAutoScrollerOptions:r}),i={dragStartTime:t,shouldUseTimeDampening:n},ru(),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=t7(n.impact);i||e7();let a=((e,r)=>{let n;if(!nl(e,r))return r;let l=(n=e.frame)&&nl(e,r)?nt({current:n.scroll.current,max:n.scroll.max,change:r}):null;if(!l)return t(e.descriptor.id,r),null;let i=tp(r,l);return t(e.descriptor.id,i),tp(r,i)})(n.dimensions.droppables[i],l);if(!a)return;let o=n.viewport,s=((e,t,n)=>{if(!e||!nn(t,n))return n;let l=((e,t)=>{if(!nn(e,t))return null;let r=e.scroll.max;return nt({current:e.scroll.current,max:r,change:t})})(t,n);if(!l)return r(n),null;let i=tp(n,l);return r(i),tp(n,i)})(n.isWindowScrollAllowed,o,a);s&&e({client:tc(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:r2,scrollDroppable:M.scrollDroppable,getAutoScrollerOptions:j,...X({move:rw},T)}),[M.scrollDroppable,T,j]),G=(f=(0,W.useRef)({}),g=(0,W.useRef)(null),m=(0,W.useRef)(null),h=(0,W.useRef)(!1),b=td(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=td(function(e){let t=nx(I,e);t&&t!==document.activeElement&&t.focus()},[I]),y=td(function(e,t){g.current===e&&(g.current=t)},[]),v=td(function(){m.current||h.current&&(m.current=requestAnimationFrame(()=>{m.current=null;let e=g.current;e&&x(e)}))},[x]),w=td(function(e){g.current=null;let t=document.activeElement;t&&t.getAttribute(no.draggableId)===e&&(g.current=e)},[]),np(()=>(h.current=!0,function(){h.current=!1;let e=m.current;e&&cancelAnimationFrame(e)}),[]),ts(()=>({register:b,tryRecordFocus:w,tryRestoreFocusRecorded:v,tryShiftRecord:y}),[b,w,v,y])),$=ts(()=>(({dimensionMarshal:e,focusMarshal:t,styleMarshal:r,getResponders:n,announce:l,autoScroller:i})=>{let a,o,s,d,u,c;return function e(t,r,n){if("function"!=typeof t)throw Error(V(2));if("function"==typeof r&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw Error(V(0));if("function"==typeof r&&void 0===n&&(n=r,r=void 0),void 0!==n){if("function"!=typeof n)throw Error(V(1));return n(e)(t,r)}let l=t,i=r,a=new Map,o=a,s=0,d=!1;function u(){o===a&&(o=new Map,a.forEach((e,t)=>{o.set(t,e)}))}function c(){if(d)throw Error(V(3));return i}function p(e){if("function"!=typeof e)throw Error(V(4));if(d)throw Error(V(5));let t=!0;u();let r=s++;return o.set(r,e),function(){if(t){if(d)throw Error(V(6));t=!1,u(),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(V(7));if(void 0===e.type)throw Error(V(8));if("string"!=typeof e.type)throw Error(V(17));if(d)throw Error(V(9));try{d=!0,i=l(i,e)}finally{d=!1}return(a=o).forEach(e=>{e()}),e}return f({type:J.INIT}),{dispatch:f,subscribe:p,getState:c,replaceReducer:function(e){if("function"!=typeof e)throw Error(V(10));l=e,f({type:J.REPLACE})},[q]:function(){return{subscribe(e){if("object"!=typeof e||null===e)throw Error(V(11));function t(){e.next&&e.next(c())}return t(),{unsubscribe:p(t)}},[q](){return this}}}}}(rg,Q(function(...e){return t=>(r,n)=>{let l=t(r,n),i=()=>{throw Error(V(15))},a={getState:l.getState,dispatch:(e,...t)=>i(e,...t)};return i=Q(...e.map(e=>e(a)))(l.dispatch),{...l,dispatch:i}}}(()=>e=>t=>{rm(t,"INITIAL_PUBLISH")&&r.dragging(),rm(t,"DROP_ANIMATE")&&r.dropping(t.payload.completed.result.reason),(rm(t,"FLUSH")||rm(t,"DROP_COMPLETE"))&&r.resting(),e(t)},()=>t=>r=>{(rm(r,"DROP_COMPLETE")||rm(r,"FLUSH")||rm(r,"DROP_ANIMATE"))&&e.stopPublishing(),t(r)},({getState:t,dispatch:r})=>n=>l=>{if(!rm(l,"LIFT"))return void n(l);let{id:i,clientSelection:a,movementMode:o}=l.payload,s=t();"DROP_ANIMATING"===s.phase&&r(rS({completed:s.completed})),"IDLE"!==t().phase&&e7(),r(rD()),r({type:"BEFORE_INITIAL_CAPTURE",payload:{draggableId:i,movementMode:o}});let{critical:d,dimensions:u,viewport:c}=e.startPublishing({draggableId:i,scrollOptions:{shouldPublishImmediately:"SNAP"===o}});r({type:"INITIAL_PUBLISH",payload:{critical:d,dimensions:u,clientSelection:a,movementMode:o,viewport:c}})},rF,rq,rY,rJ,e=>t=>r=>{if(rm(r,"DROP_COMPLETE")||rm(r,"DROP_ANIMATE")||rm(r,"FLUSH")){i.stop(),t(r);return}if(rm(r,"INITIAL_PUBLISH")){t(r);let n=e.getState();"DRAGGING"!==n.phase&&e7(),i.start(n);return}t(r),i.scroll(e.getState())},rU,(a=!1,()=>e=>r=>{if(rm(r,"INITIAL_PUBLISH")){a=!0,t.tryRecordFocus(r.payload.critical.draggable.id),e(r),t.tryRestoreFocusRecorded();return}if(e(r),a){if(rm(r,"FLUSH")){a=!1,t.tryRestoreFocusRecorded();return}if(rm(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&&e7();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,c={beforeCapture:(e,t)=>{d&&e7(),rW("onBeforeCapture",()=>{let r=n().onBeforeCapture;r&&r({draggableId:e,mode:t})})},beforeStart:(e,t)=>{d&&e7(),rW("onBeforeDragStart",()=>{let r=n().onBeforeDragStart;r&&r(rH(e,t))})},start:(e,t)=>{d&&e7();let r=rH(e,t);d={mode:t,lastCritical:e,lastLocation:r.source,lastCombine:null},s.add(()=>{rW("onDragStart",()=>rV(n().onDragStart,r,l,tl))})},update:(e,t)=>{var r,i;let a=tO(t),o=tj(t);d||e7();let u=!((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);u&&(d.lastCritical=e);let c=(r=d.lastLocation,(null!=r||null!=a)&&(null==r||null==a||r.droppableId!==a.droppableId||r.index!==a.index));c&&(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),!u&&!c&&!p)return;let f={...rH(e,d.mode),combine:o,destination:a};s.add(()=>{rW("onDragUpdate",()=>rV(n().onDragUpdate,f,l,ti))})},flush:()=>{d||e7(),s.flush()},drop:u=e=>{d||e7(),d=null,rW("onDragEnd",()=>rV(n().onDragEnd,e,l,ta))},abort:()=>{d&&u({...rH(d.lastCritical,d.mode),combine:null,destination:null,reason:"CANCEL"})}},e=>t=>r=>{if(rm(r,"BEFORE_INITIAL_CAPTURE"))return void c.beforeCapture(r.payload.draggableId,r.payload.movementMode);if(rm(r,"INITIAL_PUBLISH")){let e=r.payload.critical;c.beforeStart(e,r.payload.movementMode),t(r),c.start(e,r.payload.movementMode);return}if(rm(r,"DROP_COMPLETE")){let e=r.payload.completed.result;c.flush(),t(r),c.drop(e);return}if(t(r),rm(r,"FLUSH"))return void c.abort();let n=e.getState();"DRAGGING"===n.phase&&c.update(n.critical,n.impact)}))))})({announce:A,autoScroller:L,dimensionMarshal:M,focusMarshal:G,getResponders:O,styleMarshal:k}),[A,L,M,G,O,k]);S.current=$;let F=td(()=>{let e=nH(S);"IDLE"!==e.getState().phase&&e.dispatch(rD())},[]),z=td(()=>{let e=nH(S).getState();return"DROP_ANIMATING"===e.phase||"IDLE"!==e.phase&&e.isDragging},[]);N(ts(()=>({isDragging:z,tryAbort:F}),[z,F]));let U=td(e=>r1(nH(S).getState(),e),[]),Y=td(()=>t9(nH(S).getState()),[]),K=ts(()=>({marshal:M,focus:G,contextId:I,canLift:U,isMovementAllowed:Y,dragHandleUsageInstructionsId:R,registry:B}),[I,M,R,G,U,Y,B]);return!function({contextId:e,store:t,registry:r,customSensors:n,enableDefaultSensors:l}){let i=[...l?nW:[],...n||[]],a=(0,W.useState)(()=>(function(){let e=null;function t(){e||e7(),e=null}return{isClaimed:function(){return!!e},isActive:function(t){return t===e},claim:function(t){e&&e7();let r={abandon:t};return e=r,r},release:t,tryAbandon:function(){e&&(e.abandon(),t())}}})())[0],o=td(function(e,t){nA(e)&&!nA(t)&&a.tryAbandon()},[a]);np(function(){let e=t.getState();return t.subscribe(()=>{let r=t.getState();o(e,r),e=r})},[a,t,o]),np(()=>a.tryAbandon,[a.tryAbandon]);let s=td(e=>nU({lockAPI:a,registry:r,store:t,draggableId:e}),[a,r,t]),d=td((n,l,i)=>(function({lockAPI:e,contextId:t,store:r,registry:n,draggableId:l,forceSensorStop:i,sourceEvent:a}){var o;let s,d;if(!nU({lockAPI:e,store:r,registry:n,draggableId:l}))return null;let u=n.draggable.getById(l),c=(o=u.descriptor.id,(s=nm(document,`[${ns.contextId}="${t}"]`).find(e=>e.getAttribute(ns.id)===o))&&nb(s)?s:null);if(!c||a&&!u.options.canDragInteractiveElements&&nb(d=a.target)&&function e(t,r){if(null==r)return!1;if(nG.includes(r.tagName.toLowerCase()))return!0;let n=r.getAttribute("contenteditable");return"true"===n||""===n||r!==t&&e(t,r.parentElement)}(c,d))return null;let p=e.claim(i||e4),f="PRE_DRAG";function g(){return u.options.shouldRespectForcePress}function m(){return e.isActive(p)}let h=(function(e,t){nz({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(e8(window,[{eventName:"click",fn:nF,options:{once:!0,passive:!1,capture:!0}}])),n(),r.dispatch(rP({reason:e}))}return"PRE_DRAG"!==f&&(n(),e7()),r.dispatch({type:"LIFT",payload:t.liftActionArgs}),f="DRAGGING",{isActive:()=>nz({expected:"DRAGGING",phase:f,isLockActive:m,shouldWarn:!1}),shouldRespectForcePress:g,drop:e=>l("DROP",e),cancel:e=>l("CANCEL",e),...t.actions}}return{isActive:()=>nz({expected:"PRE_DRAG",phase:f,isLockActive:m,shouldWarn:!1}),shouldRespectForcePress:g,fluidLift:function(e){let t=e1(e=>{h(()=>rw({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:eH(c.getBoundingClientRect()).center,movementMode:"SNAP"},cleanup:e4,actions:{moveUp:()=>h(rI),moveRight:()=>h(rE),moveDown:()=>h(rN),moveLeft:()=>h(rC)}})},abort:function(){nz({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]),u=td(t=>{let r;return(r=function(e,t){let r=t.target;if(!(r instanceof nh(r).Element))return null;let n=`[${no.contextId}="${e}"]`,l=r.closest?r.closest(n):function e(t,r){return null==t?null:t[n$](r)?t:e(t.parentElement,r)}(r,n);return l&&nb(l)?l:null}(e,t))?r.getAttribute(no.draggableId):null},[e]),c=td(e=>{let t=r.draggable.findById(e);return t?t.options:null},[r.draggable]),p=td(function(){a.isClaimed()&&(a.tryAbandon(),"IDLE"!==t.getState().phase&&t.dispatch(rD()))},[a,t]),f=td(()=>a.isClaimed(),[a]),g=ts(()=>({canGetLock:s,tryGetLock:d,findClosestDraggableId:u,findOptionsForDraggable:c,tryReleaseLock:p,isLockClaimed:f}),[s,d,u,c,p,f]);nP(()=>{let e=nj(i);nO(()=>{e.current.length!==i.length&&e7(!1)})});for(let e=0;e<i.length;e++)i[e](g)}({contextId:I,store:$,registry:B,customSensors:E||null,enableDefaultSensors:!1!==e.enableDefaultSensors}),(0,W.useEffect)(()=>F,[F]),W.default.createElement(nC.Provider,{value:K},W.default.createElement(ez,{context:nv,store:$},e.children))}function nq(e){let t=W.default.useId(),r=e.dragHandleUsageInstructions||te;return W.default.createElement(e9,null,n=>W.default.createElement(nV,{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 nY=W.default.createContext(null);function nJ(e){e&&nb(e)||e7()}function nK(e){let t=(0,W.useContext)(e);return t||e7(),t}function nX(e){e.preventDefault()}var nQ=(e,t)=>e===t,nZ=e=>{let{combine:t,destination:r}=e;return r?r.droppableId:t?t.droppableId:null};function n0(e=null){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}let n1={mapped:{type:"SECONDARY",offset:tu,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:n0(null)}},n2=eF(()=>{let e,t,r,n,l,i,a,o,s=(e=tN((e,t)=>({x:e,y:t})),t=tN((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=tN((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(nA(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=t7(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=nZ(a),d=a.combine?a.combine.draggableId:null,u={duration:n.dropDuration,curve:rj,moveTo:n.newHomeClientOffset,opacity:d?rA:null,scale:d?rk:null};return{mapped:{type:"DRAGGING",offset:n.newHomeClientOffset,dimension:i,dropping:u,draggingOver:s,combineWith:d,mode:o,forceShouldAnimate:null,snapshot:t(o,r,s,d,u)}}}return null}),d=(n=tN((e,t)=>({x:e,y:t})),l=tN(n0),i=tN((e,t=null,r)=>({mapped:{type:"SECONDARY",offset:e,combineTargetFor:t,shouldAnimateDisplacement:r,snapshot:l(t)}})),a=e=>e?i(tu,e,!0):null,o=(e,t,r,l)=>{let o=r.displaced.visible[e],s=!!(l.inVirtualList&&l.effected[e]),d=tj(r),u=d&&d.draggableId===e?t:null;if(!o){if(!s)return a(u);if(r.displaced.invisible[e])return null;let t=tg(l.displacedBy.point);return i(n(t.x,t.y),u,!0)}if(s)return a(u);let c=r.displacedBy.point;return i(n(c.x,c.y),u,o.shouldAnimate)},(e,t)=>{if(nA(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)||n1},{dropAnimationFinished:rO},null,{context:nv,areStatePropsEqual:nQ})(e=>{let t=(0,W.useRef)(null),r=td((e=null)=>{t.current=e},[]),n=td(()=>t.current,[]),{contextId:l,dragHandleUsageInstructionsId:i,registry:a}=nK(nC),{type:o,droppableId:s}=nK(nY),d=ts(()=>({id:e.draggableId,index:e.index,type:o,droppableId:s}),[e.draggableId,e.index,o,s]),{children:u,draggableId:c,isEnabled:p,shouldRespectForcePress:f,canDragInteractiveElements:g,isClone:m,mapped:h,dropAnimationFinished:b}=e;nO(()=>{let t=e.draggableId;t||e7(!1),"string"!=typeof t&&e7(!1),Number.isInteger(e.index)||e7(!1),"DRAGGING"!==e.mapped.type&&(nJ(n()),e.isEnabled&&(nx(l,t)||e7(!1)))}),nP(()=>{let e=(0,W.useRef)(m);nO(()=>{m!==e.current&&e7(!1)},[m])}),m||function(e){let t=nE("draggable"),{descriptor:r,registry:n,getDraggableRef:l,canDragInteractiveElements:i,shouldRespectForcePress:a,isEnabled:o}=e,s=ts(()=>({canDragInteractiveElements:i,shouldRespectForcePress:a,isEnabled:o}),[i,o,a]),d=td(e=>{let t=l();return t||e7(),function(e,t,r=tu){let n=window.getComputedStyle(t),l=eZ(t.getBoundingClientRect(),n),i=eQ(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]),u=ts(()=>({uniqueId:t,descriptor:r,options:s,getDimension:d}),[r,d,s,t]),c=(0,W.useRef)(u),p=(0,W.useRef)(!0);np(()=>(n.draggable.register(c.current),()=>n.draggable.unregister(c.current)),[n.draggable]),np(()=>{if(p.current){p.current=!1;return}let e=c.current;c.current=u,n.draggable.update(u,e)},[u,n.draggable])}(ts(()=>({descriptor:d,registry:a,getDraggableRef:n,canDragInteractiveElements:g,shouldRespectForcePress:f,isEnabled:p}),[d,a,n,g,f,p]));let x=ts(()=>p?{tabIndex:0,role:"button","aria-describedby":i,"data-rfd-drag-handle-draggable-id":c,"data-rfd-drag-handle-context-id":l,draggable:!1,onDragStart:nX}:null,[l,i,c,p]),y=td(e=>{"DRAGGING"===h.type&&h.dropping&&"transform"===e.propertyName&&(0,H.flushSync)(b)},[b,h]),v=ts(()=>{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=rM(e);if(r)return t?`${r} scale(${rk})`:r})(r,i):rM(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?rB.drop(l.duration):a?rB.snap:rB.fluid,transform:s,opacity:((e,t)=>{if(e)return t?rA:rR})(i,o),zIndex:o?4500:5e3,pointerEvents:"none"}}(h):{transform:rM(h.offset),transition:h.shouldAnimateDisplacement?void 0:"none"};return{innerRef:r,draggableProps:{"data-rfd-draggable-context-id":l,"data-rfd-draggable-id":c,style:e,onTransitionEnd:"DRAGGING"===h.type&&h.dropping?y:void 0},dragHandleProps:x}},[l,x,c,h,y,r]),w=ts(()=>({draggableId:d.id,type:d.type,source:{index:d.index,droppableId:d.droppableId}}),[d.droppableId,d.id,d.index,d.type]);return W.default.createElement(W.default.Fragment,null,u(v,h.snapshot,w))});function n3(e){return nK(nY).isUsingCloneFor!==e.draggableId||e.isClone?W.default.createElement(n2,e):null}function n5(e){let t="boolean"!=typeof e.isDragDisabled||!e.isDragDisabled,r=!!e.disableInteractiveElementBlocking,n=!!e.shouldRespectForcePress;return W.default.createElement(n3,e2({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:r,shouldRespectForcePress:n}))}let n4=e=>t=>e===t,n8=n4("scroll"),n6=n4("auto");n4("visible");let n7=(e,t)=>t(e.overflowX)||t(e.overflowY),n9=e=>{let t,r;return null==e||e===document.body||e===document.documentElement?null:n7(r={overflowX:(t=window.getComputedStyle(e)).overflowX,overflowY:t.overflowY},n8)||n7(r,n6)?e:n9(e.parentElement)};var le=e=>({x:e.scrollLeft,y:e.scrollTop});let lt=e=>!!e&&("fixed"===window.getComputedStyle(e).position||lt(e.parentElement)),lr={passive:!1},ln={passive:!0};var ll=e=>e.shouldPublishImmediately?lr:ln;let li=e=>e&&e.env.closestScrollable||null;function la(){}let lo={width:0,height:0,margin:{top:0,right:0,bottom:0,left:0}};var ls=W.default.memo(e=>{let t=(0,W.useRef)(null),r=td(()=>{t.current&&(clearTimeout(t.current),t.current=null)},[]),{animate:n,onTransitionEnd:l,onClose:i,contextId:a}=e,[o,s]=(0,W.useState)("open"===e.animate);(0,W.useEffect)(()=>o?"open"!==n?(r(),s(!1),la):t.current?la:(t.current=setTimeout(()=>{t.current=null,s(!1)}),r):la,[n,o,r]);let d=td(e=>{"height"===e.propertyName&&(l(),"close"===n&&i())},[n,i,l]),u=(({isAnimatingOpenOnMount:e,placeholder:t,animate:r})=>{let n=(({isAnimatingOpenOnMount:e,placeholder:t,animate:r})=>e||"close"===r?lo:{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?rB.placeholder:null}})({isAnimatingOpenOnMount:o,animate:e.animate,placeholder:e.placeholder});return W.default.createElement(e.placeholder.tagName,{style:u,"data-rfd-placeholder-context-id":a,onTransitionEnd:d,ref:e.innerRef})});function ld(e){return"boolean"==typeof e}function lu(e,t){t.forEach(t=>t(e))}let lc=[function({props:e}){e.droppableId||e7(),"string"!=typeof e.droppableId&&e7()},function({props:e}){ld(e.isDropDisabled)||e7(),ld(e.isCombineEnabled)||e7(),ld(e.ignoreContainerClipping)||e7()},function({getDroppableRef:e}){nJ(e())}],lp=[function({props:e,getPlaceholderRef:t}){if(!e.placeholder||t())return}],lf=[function({props:e}){e.renderClone||e7()},function({getPlaceholderRef:e}){e()&&e7()}];class lg extends W.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 lm={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:function(){return document.body||e7(),document.body}},lh=e=>{let t,r={...e};for(t in lm)void 0===e[t]&&(r={...r,[t]:lm[t]});return r},lb=(e,t)=>t.draggables[e.draggable.id],lx=eF(()=>{let e={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},t={...e,shouldAnimatePlaceholder:!1},r=tN(e=>({draggableId:e.id,type:e.type,source:{index:e.index,droppableId:e.droppableId}})),n=tN((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=lh(l),a=i.droppableId,o=i.type,s=!i.isDropDisabled,d=i.renderClone;if(nA(r)){let e=r.critical;if(o!==e.droppable.type)return t;let l=lb(e,r.dimensions),i=t7(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=lb(e.critical,r.dimensions);return n(a,s,nZ(e.result)===a,t7(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=t7(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)=>({...lh(r),...e,...t}),{context:nv,areStatePropsEqual:nQ})(e=>{var t;let r=(0,W.useContext)(nC);r||e7();let{contextId:n,isMovementAllowed:l}=r,i=(0,W.useRef)(null),a=(0,W.useRef)(null),{children:o,droppableId:s,type:d,mode:u,direction:c,ignoreContainerClipping:p,isDropDisabled:f,isCombineEnabled:g,snapshot:m,useClone:h,updateViewportMaxScroll:b,getContainerForClone:x}=e,y=td(()=>i.current,[]),v=td((e=null)=>{i.current=e},[]),w=td(()=>a.current,[]),I=td((e=null)=>{a.current=e},[]);t={props:e,getDroppableRef:y,getPlaceholderRef:w},nO(()=>{lu(t,lc),"standard"===t.props.mode&&lu(t,lp),"virtual"===t.props.mode&&lu(t,lf)});let N=td(()=>{l()&&b({maxScroll:rZ()})},[l,b]);!function(e){let t=(0,W.useRef)(null),r=nK(nC),n=nE("droppable"),{registry:l,marshal:i}=r,a=nj(e),o=ts(()=>({id:e.droppableId,type:e.type,mode:e.mode}),[e.droppableId,e.mode,e.type]),s=(0,W.useRef)(o),d=ts(()=>tN((e,r)=>{t.current||e7(),i.updateDroppableScroll(o.id,{x:e,y:r})}),[o.id,i]),u=td(()=>{let e=t.current;return e&&e.env.closestScrollable?le(e.env.closestScrollable):tu},[]),c=td(()=>{let e=u();d(e.x,e.y)},[u,d]),p=ts(()=>e1(c),[c]),f=td(()=>{let e=t.current,r=li(e);(e&&r||e7(),e.scrollOptions.shouldPublishImmediately)?c():p()},[p,c]),g=td((e,n)=>{t.current&&e7();let l=a.current,i=l.getDroppableRef();i||e7();let s={closestScrollable:n9(i),isFixedOnPage:lt(i)},d={ref:i,descriptor:o,env:s,scrollOptions:n};t.current=d;let u=(({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=e0(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 eJ({borderBox:eV({top:n,right:l+t.scrollWidth,bottom:i,left:l},r.border),margin:r.margin,border:r.border,padding:r.padding})})(e,s),u=eQ(d,n),c=(()=>{if(!s)return null;let e=e0(s),t={scrollHeight:s.scrollHeight,scrollWidth:s.scrollWidth};return{client:e,page:eQ(e,n),scroll:le(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=rX({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:tu,displacement:tu}}}})(),d="vertical"===l?tG:t$,u=tw({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:u}})({descriptor:t,isEnabled:!i,isCombineEnabled:a,isFixedOnPage:r.isFixedOnPage,direction:l,client:d,page:u,closest:c})})({ref:i,descriptor:o,env:s,windowScroll:e,direction:l.direction,isDropDisabled:l.isDropDisabled,isCombineEnabled:l.isCombineEnabled,shouldClipSubject:!l.ignoreContainerClipping}),c=s.closestScrollable;return c&&(c.setAttribute(nu.contextId,r.contextId),c.addEventListener("scroll",f,ll(d.scrollOptions))),u},[r.contextId,o,f,a]),m=td(()=>{let e=t.current,r=li(e);return e&&r||e7(),le(r)},[]),h=td(()=>{let e=t.current;e||e7();let r=li(e);t.current=null,r&&(p.cancel(),r.removeAttribute(nu.contextId),r.removeEventListener("scroll",f,ll(e.scrollOptions)))},[f,p]),b=td(e=>{let r=t.current;r||e7();let n=li(r);n||e7(),n.scrollTop+=e.y,n.scrollLeft+=e.x},[]),x=ts(()=>({getDimensionAndWatchScroll:g,getScrollWhileDragging:m,dragStopped:h,scroll:b}),[h,g,m,b]),y=ts(()=>({uniqueId:n,descriptor:o,callbacks:x}),[x,o,n]);np(()=>(s.current=y.descriptor,l.droppable.register(y),()=>{t.current&&h(),l.droppable.unregister(y)}),[x,o,h,y,i,l.droppable]),np(()=>{t.current&&i.updateDroppableIsEnabled(s.current.id,!e.isDropDisabled)},[e.isDropDisabled,i]),np(()=>{t.current&&i.updateDroppableIsCombineEnabled(s.current.id,e.isCombineEnabled)},[e.isCombineEnabled,i])}({droppableId:s,type:d,mode:u,direction:c,isDropDisabled:f,isCombineEnabled:g,ignoreContainerClipping:p,getDroppableRef:y});let E=ts(()=>W.default.createElement(lg,{on:e.placeholder,shouldAnimate:e.shouldAnimatePlaceholder},({onClose:e,data:t,animate:r})=>W.default.createElement(ls,{placeholder:t,onClose:e,innerRef:I,animate:r,contextId:n,onTransitionEnd:N})),[n,N,e.placeholder,e.shouldAnimatePlaceholder,I]),C=ts(()=>({innerRef:v,placeholder:E,droppableProps:{"data-rfd-droppable-id":s,"data-rfd-droppable-context-id":n}}),[n,s,E,v]),D=h?h.dragging.draggableId:null,S=ts(()=>({droppableId:s,type:d,isUsingCloneFor:D}),[s,D,d]);return W.default.createElement(nY.Provider,{value:S},o(C,m),function(){if(!h)return null;let{dragging:e,render:t}=h,r=W.default.createElement(n3,{draggableId:e.draggableId,index:e.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(r,n)=>t(r,n,e));return H.default.createPortal(r,x())}())});var ly=e.i(74886),lv=e.i(55716);let lw=(0,u.default)("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var lI=e.i(31278),lN=e.i(86311),lE=e.i(95468),lC=e.i(73884),lD=e.i(77814);let lS={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"};function lP({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)(lI.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)(lN.MessageSquare,{className:"size-3"})}):n?(0,o.jsx)("span",{className:"inline-flex items-center gap-1 text-xs text-destructive",children:(0,o.jsx)(lC.XCircle,{className:"size-3"})}):l?(0,o.jsx)("span",{className:"inline-flex items-center gap-1 text-xs text-success",children:(0,o.jsx)(lE.CheckCircle2,{className:"size-3"})}):null}function lO({task:e,dragHandleProps:t,tabTodosMap:r}){let n=(0,d.useRouter)(),[l,i]=(0,s.useState)(!1),a=(0,L.getRepoColor)(e.owner,e.repo),u=e.tabs??[],c=u.some(e=>"running"===e.status),p=((r?u.map(e=>r.get(e.tab_id)).find(e=>void 0!==e):void 0)??u.flatMap(e=>e.todos??[])).filter(e=>"deleted"!==e.status),f=p.filter(e=>"completed"===e.status).length,g=p.length,m=e.id.slice(0,5)+"…",h=(0,s.useCallback)(t=>{t.stopPropagation(),navigator.clipboard.writeText(e.id).then(()=>{i(!0),setTimeout(()=>i(!1),2e3)})},[e.id]);return(0,o.jsx)("div",{...t,onClick:()=>n.push(`/tasks/${e.id}`),className:(0,G.cn)("rounded-lg border border-border bg-card p-3 shadow-sm transition-shadow hover:shadow-md cursor-pointer",c&&"opacity-50"),children:(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)(lP,{tabs:e.tabs}),(0,o.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:m}),(0,o.jsx)("button",{onClick:h,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)(ly.Copy,{className:"size-3 text-muted-foreground"})})]}),(0,o.jsx)("span",{className:(0,G.cn)("inline-flex h-5 items-center rounded-full px-2 text-[0.625rem] font-medium",lS[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}),g>0&&(0,o.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,o.jsx)(lD.Progress,{value:f,max:g,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,"/",g]})]}),(0,o.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,o.jsxs)("span",{className:(0,G.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)(lv.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)(lw,{className:"size-3"}),e.effort,"h"]})]})]})})}function lj({tasks:e,onReorder:t,tabTodosMap:r}){let n=(0,s.useCallback)(r=>{if(!r.destination)return;let{source:n,destination:l}=r;if(n.index===l.index)return;let i=[...e],[a]=i.splice(n.index,1);i.splice(l.index,0,a),t(i.map((e,t)=>({...e,order:t})))},[e,t]);return(0,o.jsx)(nq,{onDragEnd:n,children:(0,o.jsx)(lx,{droppableId:"planner-task-list",children:t=>(0,o.jsxs)("div",{ref:t.innerRef,...t.droppableProps,className:"space-y-2",children:[e.map((e,t)=>(0,o.jsx)(n5,{draggableId:e.id,index:t,children:t=>(0,o.jsx)("div",{ref:t.innerRef,...t.draggableProps,children:(0,o.jsx)(lO,{task:e,dragHandleProps:t.dragHandleProps,tabTodosMap:r})})},e.id)),t.placeholder]})})})}function lA({tasks:e,repositories:t,filters:r,onFilterChange:n,onReorder:l,onAddTask:i,tabTodosMap:a}){return(0,o.jsxs)("div",{className:"flex h-full flex-col",children:[(0,o.jsx)("div",{className:"flex-shrink-0 px-4 pt-4",children:(0,o.jsx)(z,{repositories:t,filters:r,onFilterChange:n,onAddTask:i})}),(0,o.jsx)("div",{className:"flex-1 overflow-y-auto px-4 py-4",children:e.length>0?(0,o.jsx)(lj,{tasks:e,onReorder:l,tabTodosMap:a}):(0,o.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No tasks found"})})]})}var lR=e.i(30939),lk=e.i(67211),lT=e.i(70935);function l_(){let[e,t]=(0,s.useState)([]),[r,n]=(0,s.useState)(),[l,i]=(0,s.useState)(new Set),[a,d]=(0,s.useState)(new Map),[u,c]=(0,s.useState)(new Map),[p,f]=(0,s.useState)(!1),[g,m]=(0,s.useState)(),h=(0,s.useRef)(new Map);(0,s.useEffect)(()=>{(async()=>{try{let[e,r]=await Promise.all([fetch((0,lT.apiUrl)("/api/planner/config")).then(e=>e.json()),fetch((0,lT.apiUrl)("/api/planner/tabs")).then(e=>e.json())]);if(e.data?.cwd&&m(e.data.cwd),r.data?.tabs&&(t(r.data.tabs),r.data.tabs.length>0)){let e=r.data.tabs[0].tab_id;n(e),i(new Set([e]))}}catch(e){console.error("Failed to load planner config/tabs:",e)}finally{f(!0)}})()},[]),(0,s.useEffect)(()=>{r&&h.current.get(r)?.focus()},[r]);let b=(0,s.useCallback)(async r=>{let l=crypto.randomUUID(),a=new Date().toISOString(),o={tab_id:l,order:e.length,status:"idle",startedAt:a,updatedAt:a};try{await fetch((0,lT.apiUrl)("/api/planner/tabs"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tabId:l})})}catch(e){console.error("Failed to persist planner tab:",e)}t(e=>[...e,o]),n(l),i(e=>{let t=new Set(e);return t.add(l),t}),c(e=>{let t=new Map(e);return t.set(l,r),t})},[e.length]),x=(0,s.useCallback)(()=>b("claude"),[b]),v=(0,s.useCallback)(e=>{i(t=>{if(t.has(e))return t;let r=new Set(t);return r.add(e),r}),n(e)},[]),w=(0,s.useCallback)(async e=>{try{await fetch((0,lT.apiUrl)(`/api/planner/tabs?tabId=${e}`),{method:"DELETE"})}catch(e){console.error("Failed to delete planner tab:",e)}t(t=>{let l=t.filter(t=>t.tab_id!==e);if(r===e){let e=l.length>0?l[l.length-1].tab_id:void 0;setTimeout(()=>n(e),0)}return l}),i(t=>{let r=new Set(t);return r.delete(e),r}),d(t=>{let r=new Map(t);return r.delete(e),r}),c(t=>{let r=new Map(t);return r.delete(e),r}),h.current.delete(e)},[r]),I=(0,s.useCallback)((e,t,r)=>{d(n=>{let l=new Map(n);return l.set(e,{terminal:t,claude:r}),l})},[]);return p?(0,o.jsxs)("div",{className:"flex flex-col flex-1 min-h-0",children:[(0,o.jsx)("div",{className:"px-4 pt-4 flex-shrink-0",children:e.length>0?(0,o.jsx)(lR.SessionTabs,{tabs:e,activeTabId:r,onTabChange:v,onTabCreateClaude:x,onTabDelete:w,tabStatusMap:a}):(0,o.jsxs)("div",{className:"text-center py-8",children:[(0,o.jsx)("p",{className:"text-muted-foreground mb-4",children:"No planner sessions"}),(0,o.jsx)(y.Button,{size:"lg",onClick:x,children:"+ Create Planner Session"})]})}),(0,o.jsxs)("div",{className:"flex-1 min-h-0 relative",children:[e.map(e=>{let t=l.has(e.tab_id),n=e.tab_id===r;return t?(0,o.jsx)("div",{className:"absolute inset-0 flex flex-col px-4 pb-4 pt-2",style:{visibility:n?"visible":"hidden",pointerEvents:n?"auto":"none"},children:(0,o.jsx)(lk.TerminalView,{ref:t=>{t?h.current.set(e.tab_id,t):h.current.delete(e.tab_id)},tabId:e.tab_id,isActive:n,cwd:g,command:"terminal"!==u.get(e.tab_id)?`claude --dangerously-skip-permissions --resume ${e.tab_id} 2>/dev/null || claude --dangerously-skip-permissions --session-id ${e.tab_id}`:void 0,className:"h-full",onStatusChange:I})},e.tab_id):null}),e.length>0&&!r&&(0,o.jsx)("div",{className:"h-full flex items-center justify-center text-muted-foreground text-sm",children:"Select a tab to view terminal"})]})]}):(0,o.jsx)("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:"Loading..."})}var lB=e.i(96085),lM=e.i(2576),lL=e.i(51846),lG=e.i(85699);function l$(e){let{type:t,title:r,description:n,duration:l}=e,i=e.id??crypto.randomUUID(),a={id:i,description:n,duration:l};switch(t){case"loading":lG.toast.loading(r,a);break;case"success":lG.toast.success(r,a);break;case"error":lG.toast.error(r,a);break;case"warning":lG.toast.warning(r,a);break;case"info":lG.toast.info(r,a);break;default:(0,lG.toast)(r,a)}return i}e.s(["default",0,function(){var e;let t,r,n,l,i,a=(0,d.useRouter)(),[u,c]=(0,s.useState)([]),[p,f]=(0,s.useState)([]),[g,m]=(0,s.useState)({}),[h,b]=(0,s.useState)(!0),[x,y]=(0,s.useState)(!1),[v,w]=(0,s.useState)(!1),[N,E]=(0,s.useState)(!1),[S,P]=(0,s.useState)(()=>{try{let e=sessionStorage.getItem("tsunagi:task-filters");if(e)return JSON.parse(e)}catch{}return{statuses:[],repos:[],search:""}});(0,lL.useDocumentTitle)((t=[],S.search.trim()&&t.push(`"${S.search.trim()}"`),S.statuses.length&&t.push(S.statuses.join(", ")),S.repos.length&&t.push(S.repos.map(e=>e.split("/").pop()??e).join(", ")),t.length?t.join(" / "):void 0)),(0,s.useEffect)(()=>{try{sessionStorage.setItem("tsunagi:task-filters",JSON.stringify(S))}catch{}},[S]);let[O,A]=(0,s.useState)(380),[k,T]=(0,s.useState)(!1),_=(0,s.useMemo)(()=>{let e,t={hasRepositories:p.length>0,hasAnthropicApiKey:!!g.ANTHROPIC_API_KEY,hasClaudeCodeToken:!!g.CLAUDE_CODE_OAUTH_TOKEN,hasTasks:u.length>0};return e=t.hasAnthropicApiKey||t.hasClaudeCodeToken?t.hasRepositories?t.hasTasks?"complete":"task":"clone":"env",{state:t,nextStep:e}},[p,g,u]),B=(0,s.useMemo)(()=>u.filter(e=>{if(S.statuses.length>0&&!S.statuses.includes(e.status))return!1;if(S.repos.length>0){let t=`${e.owner}/${e.repo}`;if(!S.repos.includes(t))return!1}return!S.search||!!e.title.toLowerCase().includes(S.search.toLowerCase())}).sort((e,t)=>e.order-t.order),[u,S]),M=async()=>{b(!0);try{let[e,t,r]=await Promise.all([fetch((0,lT.apiUrl)("/api/tasks")).then(e=>e.json()),fetch((0,lT.apiUrl)("/api/owners")).then(e=>e.json()),fetch((0,lT.apiUrl)("/api/env")).then(e=>e.json())]);c(e.data.tasks);let n=t.data.owners.flatMap(e=>e.repositories);f(n),m(r.data.env)}catch(e){console.error("Failed to load data:",e)}finally{b(!1)}},[L,G]=(0,s.useState)(!0);(0,s.useEffect)(()=>{L&&(M(),G(!1))},[]);let $=(0,s.useMemo)(()=>u.flatMap(e=>(e.tabs??[]).map(e=>e.tab_id)),[u]),F=function(e){let[t,r]=(0,s.useState)(new Map),n=(0,s.useRef)(null),l=(0,s.useRef)(new Set);return(0,s.useEffect)(()=>{if(!n.current){let e=(0,lB.io)((0,lT.getServerUrl)(),{transports:["polling","websocket"]});n.current=e,e.on("todos-updated",({sessionId:e,todos:t})=>{r(r=>{let n=new Map(r);return n.set(e,t),n})}),e.on("status-changed",({sessionId:e,status:t})=>{("idle"===t||"error"===t)&&r(t=>{let r=new Map(t);return r.delete(e),r})}),e.on("connect",()=>{for(let t of l.current)e.emit("join",{room:t,mode:"subscribe"})})}let t=n.current;for(let r of e){let e=`tab:${r}`;l.current.has(e)||(t.emit("join",{room:e,mode:"subscribe"}),l.current.add(e))}for(let r of l.current){let n=r.replace("tab:","");e.includes(n)||(t.emit("leave",{room:r}),l.current.delete(r))}},[e]),(0,s.useEffect)(()=>{let e=l.current;return()=>{n.current?.disconnect(),n.current=null,e.clear()}},[]),t}((0,s.useMemo)(()=>u.flatMap(e=>(e.tabs??[]).filter(e=>"running"===e.status).map(e=>e.tab_id)),[u]));e=(e,t)=>{c(r=>r.map(r=>({...r,tabs:(r.tabs??[]).map(r=>r.tab_id===e?{...r,status:t}:r)})))},r=(0,s.useRef)(null),n=(0,s.useRef)(new Set),l=(0,s.useRef)(e),(0,s.useEffect)(()=>{l.current=e}),i=(0,s.useCallback)(()=>{if(!r.current){let e=(0,lB.io)((0,lT.getServerUrl)(),{transports:["polling","websocket"]});r.current=e,e.on("status-changed",({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&&l.current(e,r)}),e.on("connect",()=>{for(let t of n.current)e.emit("join",{room:t,mode:"subscribe"})})}return r.current},[]),(0,s.useEffect)(()=>{if(0===$.length)return;let e=i();for(let t of $){let r=`tab:${t}`;n.current.has(r)||(e.emit("join",{room:r,mode:"subscribe"}),n.current.add(r))}let t=new Set($);for(let r of n.current){let l=r.replace("tab:","");t.has(l)||(e.emit("leave",{room:r}),n.current.delete(r))}},[$,i]),(0,s.useEffect)(()=>{let e=n.current;return()=>{r.current?.disconnect(),r.current=null,e.clear()}},[]),(0,lM.useTaskEvents)({onTaskCreated:e=>{c(t=>t.some(t=>t.id===e.id)?t:[...t,e]),l$({type:"success",title:"Task created",description:e.title,duration:5e3})},onTaskUpdated:e=>{c(t=>t.map(t=>t.id===e.id?e:t)),l$({type:"info",title:"Task updated",description:e.title,duration:5e3})},onTaskDeleted:e=>{let t=u.find(t=>t.id===e)?.title;c(t=>t.filter(t=>t.id!==e)),t&&l$({type:"info",title:"Task deleted",description:t,duration:5e3})}});let{isDeleting:z,deletedCount:U,errorCount:W,totalCount:H,isCompleted:V,startBatchDelete:q,reset:Y}=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,lT.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)(()=>{(z||V)&&queueMicrotask(()=>{if(z&&((e,t)=>{l$({...t,id:e})})("batch-delete-progress",{type:"loading",title:"Deleting tasks...",description:W>0?`${U} / ${H} (${W} failed)`:`${U} / ${H}`,duration:1/0}),V){var e;e="batch-delete-progress",lG.toast.dismiss(e);let t=W>0?`Deleted ${U} tasks (${W} failed)`:`Deleted ${U} tasks`;l$({type:W>0?"warning":"success",title:t,duration:5e3}),setTimeout(()=>{Y()},5e3)}})},[z,V,U,W,H,Y]);let J=(0,s.useCallback)(async e=>{c(t=>{let r=new Set(e.map(e=>e.id));return[...e,...t.filter(e=>!r.has(e.id))]});try{await Promise.all(e.map((e,t)=>fetch((0,lT.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)}},[]),K=async e=>{try{let t=await fetch((0,lT.apiUrl)("/api/clone"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw Error("Failed to clone repository");let r=await t.json();f(e=>[...e,r.data.repository]),await M()}catch(e){throw console.error("Failed to clone repository:",e),e}},X=async e=>{try{let t,r=await q(e);if(!r||0===r.totalCount){let t;return void(t={type:"info",title:"No tasks to delete",description:`No tasks completed more than ${e} days ago`,duration:3e3},l$(t))}t={id:"batch-delete-progress",type:"loading",title:"Deleting tasks...",description:`0 / ${r.totalCount}`,duration:1/0},l$(t)}catch(e){console.error("Failed to start batch delete:",e),l$({type:"error",title:"Failed to delete tasks",description:String(e),duration:5e3})}},Q=(0,s.useCallback)(()=>{T(!0)},[]);return((0,s.useEffect)(()=>{if(!k)return;let e=e=>{A(Math.max(280,Math.min(600,e.clientX)))},t=()=>{T(!1)};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[k]),h&&0===u.length)?(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..."})})}):(0,o.jsxs)("div",{className:"h-screen flex flex-col",children:[(0,o.jsx)(I,{onCloneClick:()=>y(!0),onSettingsClick:()=>a.push("/settings"),onReload:M,nextStep:_.nextStep,isCloneDialogOpen:x}),(0,o.jsxs)("div",{className:"relative flex-1 overflow-hidden flex",children:[(0,o.jsx)("div",{className:"hidden lg:flex flex-col border-r border-border flex-shrink-0",style:{width:O},children:(0,o.jsx)(lA,{tasks:B,repositories:p,filters:S,onFilterChange:P,onReorder:J,onAddTask:()=>w(!0),tabTodosMap:F})}),(0,o.jsx)("div",{className:"hidden lg:flex w-1 cursor-col-resize items-center justify-center hover:bg-accent active:bg-accent flex-shrink-0",onMouseDown:Q,style:{userSelect:k?"none":void 0},children:(0,o.jsx)("div",{className:"w-px h-8 bg-border"})}),(0,o.jsx)("div",{className:"flex-1 min-w-0 h-full flex flex-col",children:(0,o.jsx)(l_,{})}),"env"===_.nextStep&&(0,o.jsx)(C,{hasRepositories:_.state.hasRepositories,hasEnvVars:_.state.hasAnthropicApiKey||_.state.hasClaudeCodeToken,hasTasks:_.state.hasTasks})]}),(0,o.jsx)(j,{isOpen:x,onClose:()=>y(!1),onClone:K,isOnboarding:"clone"===_.nextStep}),(0,o.jsx)(D.TaskDialog,{mode:"create",isOpen:v,onClose:()=>w(!1),repositories:p}),(0,o.jsx)(R,{isOpen:N,onClose:()=>E(!1),onConfirm:X})]})}],39798)}]);
64
+ `}}],"always"),resting:nc(i,"resting"),dragging:nc(i,"dragging"),dropAnimating:nc(i,"dropAnimating"),userCancel:nc(i,"userCancel")}},[I]),i=(0,W.useRef)(null),a=(0,W.useRef)(null),o=td(tN(e=>{let t=a.current;t||e7(),t.textContent=e}),[]),np(()=>{(i.current||a.current)&&e7();let e=ng(C),t=ng(C);return i.current=e,a.current=t,e.setAttribute(`${na}-always`,I),t.setAttribute(`${na}-dynamic`,I),nf().appendChild(e),nf().appendChild(t),s(l.always),o(l.resting),()=>{let e=e=>{let t=e.current;t||e7(),nf().removeChild(t),e.current=null};e(i),e(a)}},[C,s=td(e=>{let t=i.current;t||e7(),t.textContent=e},[]),o,l.always,l.resting,I]),d=td(()=>o(l.dragging),[o,l.dragging]),u=td(e=>{"DROP"===e?o(l.dropAnimating):o(l.userCancel)},[o,l.dropAnimating,l.userCancel]),ts(()=>({dragging:d,dropping:u,resting:c}),[d,u,c=td(()=>{a.current&&o(l.resting)},[o,l.resting])])),T=td(e=>{nH(S).dispatch(e)},[]),_=ts(()=>X({publishWhileDragging:rh,updateDroppableScroll:rx,updateDroppableIsEnabled:ry,updateDroppableIsCombineEnabled:rv,collectionStarting:rb},T),[T]),B=(p=ts(ny,[]),(0,W.useEffect)(()=>function(){p.clean()},[p]),p),M=ts(()=>{let e,t,r;return e=null,t=function({registry:e,callbacks:t}){let r=rK(),n=null,l=()=>{n||(t.collectionStarting(),n=requestAnimationFrame(()=>{n=null,rd();let{additions:l,removals:i,modified:a}=r,o=Object.keys(l).map(t=>e.draggable.getById(t).getDimension(tu)).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=rK(),ru(),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=rK())}}}({callbacks:{publish:_.publishWhileDragging,collectionStarting:_.collectionStarting},registry:B}),r=r=>{e||e7();let n=e.critical.draggable;"ADDITION"===r.type&&r0(B,n,r.value)&&t.add(r.value),"REMOVAL"===r.type&&r0(B,n,r.value)&&t.remove(r.value)},{updateDroppableIsEnabled:(t,r)=>{B.droppable.exists(t)||e7(),e&&_.updateDroppableIsEnabled({id:t,isEnabled:r})},updateDroppableIsCombineEnabled:(t,r)=>{e&&(B.droppable.exists(t)||e7(),_.updateDroppableIsCombineEnabled({id:t,isCombineEnabled:r}))},scrollDroppable:(t,r)=>{e&&B.droppable.getById(t).callbacks.scroll(r)},updateDroppableScroll:(t,r)=>{e&&(B.droppable.exists(t)||e7(),_.updateDroppableScroll({id:t,newScroll:r}))},startPublishing:t=>{e&&e7();let n=B.draggable.getById(t.draggableId),l=B.droppable.getById(n.descriptor.droppableId),i={draggable:n.descriptor,droppable:l.descriptor};return e={critical:i,unsubscribe:B.subscribe(r)},(({critical:e,scrollOptions:t,registry:r})=>{let n,l,i,a,o,s;rd();let d=(n=rz(),l=rZ(),i=n.y,a=n.x,s=(o=rQ()).clientWidth,{frame:eH({top:i,left:a,right:a+s,bottom:i+o.clientHeight}),scroll:{initial:n,current:n,max:l,diff:{value:tu,displacement:tu}}}),u=d.scroll.current,c=e.droppable,p=r.droppable.getAllByType(c.type).map(e=>e.callbacks.getDimensionAndWatchScroll(u,t)),f={draggables:tC(r.draggable.getAllByType(e.draggable.type).map(e=>e.getDimension(u))),droppables:tE(p)};return ru(),{dimensions:f,critical:e,viewport:d}})({critical:i,registry:B,scrollOptions:t.scrollOptions})},stopPublishing:()=>{if(!e)return;t.stop();let r=e.critical.droppable;B.droppable.getAllByType(r.type).forEach(e=>e.callbacks.dragStopped()),e.unsubscribe(),e=null}}},[B,_]),L=ts(()=>(({scrollDroppable:e,scrollWindow:t,move:r,getAutoScrollerOptions:n})=>{let l=(({scrollWindow:e,scrollDroppable:t,getAutoScrollerOptions:r=()=>r5})=>{let n=e1(e),l=e1(t),i=null,a=e=>{i||e7();let{shouldUseTimeDampening:t,dragStartTime:a}=i;ni({state:e,scrollWindow:n,scrollDroppable:l,dragStartTime:a,shouldUseTimeDampening:t,getAutoScrollerOptions:r})};return{start:e=>{rd(),i&&e7();let t=Date.now(),n=!1,l=()=>{n=!0};ni({state:e,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:l,scrollDroppable:l,getAutoScrollerOptions:r}),i={dragStartTime:t,shouldUseTimeDampening:n},ru(),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=t7(n.impact);i||e7();let a=((e,r)=>{let n;if(!nl(e,r))return r;let l=(n=e.frame)&&nl(e,r)?nt({current:n.scroll.current,max:n.scroll.max,change:r}):null;if(!l)return t(e.descriptor.id,r),null;let i=tp(r,l);return t(e.descriptor.id,i),tp(r,i)})(n.dimensions.droppables[i],l);if(!a)return;let o=n.viewport,s=((e,t,n)=>{if(!e||!nn(t,n))return n;let l=((e,t)=>{if(!nn(e,t))return null;let r=e.scroll.max;return nt({current:e.scroll.current,max:r,change:t})})(t,n);if(!l)return r(n),null;let i=tp(n,l);return r(i),tp(n,i)})(n.isWindowScrollAllowed,o,a);s&&e({client:tc(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:r2,scrollDroppable:M.scrollDroppable,getAutoScrollerOptions:j,...X({move:rw},T)}),[M.scrollDroppable,T,j]),G=(f=(0,W.useRef)({}),g=(0,W.useRef)(null),m=(0,W.useRef)(null),h=(0,W.useRef)(!1),b=td(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=td(function(e){let t=nx(I,e);t&&t!==document.activeElement&&t.focus()},[I]),y=td(function(e,t){g.current===e&&(g.current=t)},[]),v=td(function(){m.current||h.current&&(m.current=requestAnimationFrame(()=>{m.current=null;let e=g.current;e&&x(e)}))},[x]),w=td(function(e){g.current=null;let t=document.activeElement;t&&t.getAttribute(no.draggableId)===e&&(g.current=e)},[]),np(()=>(h.current=!0,function(){h.current=!1;let e=m.current;e&&cancelAnimationFrame(e)}),[]),ts(()=>({register:b,tryRecordFocus:w,tryRestoreFocusRecorded:v,tryShiftRecord:y}),[b,w,v,y])),$=ts(()=>(({dimensionMarshal:e,focusMarshal:t,styleMarshal:r,getResponders:n,announce:l,autoScroller:i})=>{let a,o,s,d,u,c;return function e(t,r,n){if("function"!=typeof t)throw Error(V(2));if("function"==typeof r&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw Error(V(0));if("function"==typeof r&&void 0===n&&(n=r,r=void 0),void 0!==n){if("function"!=typeof n)throw Error(V(1));return n(e)(t,r)}let l=t,i=r,a=new Map,o=a,s=0,d=!1;function u(){o===a&&(o=new Map,a.forEach((e,t)=>{o.set(t,e)}))}function c(){if(d)throw Error(V(3));return i}function p(e){if("function"!=typeof e)throw Error(V(4));if(d)throw Error(V(5));let t=!0;u();let r=s++;return o.set(r,e),function(){if(t){if(d)throw Error(V(6));t=!1,u(),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(V(7));if(void 0===e.type)throw Error(V(8));if("string"!=typeof e.type)throw Error(V(17));if(d)throw Error(V(9));try{d=!0,i=l(i,e)}finally{d=!1}return(a=o).forEach(e=>{e()}),e}return f({type:J.INIT}),{dispatch:f,subscribe:p,getState:c,replaceReducer:function(e){if("function"!=typeof e)throw Error(V(10));l=e,f({type:J.REPLACE})},[q]:function(){return{subscribe(e){if("object"!=typeof e||null===e)throw Error(V(11));function t(){e.next&&e.next(c())}return t(),{unsubscribe:p(t)}},[q](){return this}}}}}(rg,Q(function(...e){return t=>(r,n)=>{let l=t(r,n),i=()=>{throw Error(V(15))},a={getState:l.getState,dispatch:(e,...t)=>i(e,...t)};return i=Q(...e.map(e=>e(a)))(l.dispatch),{...l,dispatch:i}}}(()=>e=>t=>{rm(t,"INITIAL_PUBLISH")&&r.dragging(),rm(t,"DROP_ANIMATE")&&r.dropping(t.payload.completed.result.reason),(rm(t,"FLUSH")||rm(t,"DROP_COMPLETE"))&&r.resting(),e(t)},()=>t=>r=>{(rm(r,"DROP_COMPLETE")||rm(r,"FLUSH")||rm(r,"DROP_ANIMATE"))&&e.stopPublishing(),t(r)},({getState:t,dispatch:r})=>n=>l=>{if(!rm(l,"LIFT"))return void n(l);let{id:i,clientSelection:a,movementMode:o}=l.payload,s=t();"DROP_ANIMATING"===s.phase&&r(rS({completed:s.completed})),"IDLE"!==t().phase&&e7(),r(rD()),r({type:"BEFORE_INITIAL_CAPTURE",payload:{draggableId:i,movementMode:o}});let{critical:d,dimensions:u,viewport:c}=e.startPublishing({draggableId:i,scrollOptions:{shouldPublishImmediately:"SNAP"===o}});r({type:"INITIAL_PUBLISH",payload:{critical:d,dimensions:u,clientSelection:a,movementMode:o,viewport:c}})},rF,rq,rY,rJ,e=>t=>r=>{if(rm(r,"DROP_COMPLETE")||rm(r,"DROP_ANIMATE")||rm(r,"FLUSH")){i.stop(),t(r);return}if(rm(r,"INITIAL_PUBLISH")){t(r);let n=e.getState();"DRAGGING"!==n.phase&&e7(),i.start(n);return}t(r),i.scroll(e.getState())},rU,(a=!1,()=>e=>r=>{if(rm(r,"INITIAL_PUBLISH")){a=!0,t.tryRecordFocus(r.payload.critical.draggable.id),e(r),t.tryRestoreFocusRecorded();return}if(e(r),a){if(rm(r,"FLUSH")){a=!1,t.tryRestoreFocusRecorded();return}if(rm(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&&e7();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,c={beforeCapture:(e,t)=>{d&&e7(),rW("onBeforeCapture",()=>{let r=n().onBeforeCapture;r&&r({draggableId:e,mode:t})})},beforeStart:(e,t)=>{d&&e7(),rW("onBeforeDragStart",()=>{let r=n().onBeforeDragStart;r&&r(rH(e,t))})},start:(e,t)=>{d&&e7();let r=rH(e,t);d={mode:t,lastCritical:e,lastLocation:r.source,lastCombine:null},s.add(()=>{rW("onDragStart",()=>rV(n().onDragStart,r,l,tl))})},update:(e,t)=>{var r,i;let a=tO(t),o=tj(t);d||e7();let u=!((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);u&&(d.lastCritical=e);let c=(r=d.lastLocation,(null!=r||null!=a)&&(null==r||null==a||r.droppableId!==a.droppableId||r.index!==a.index));c&&(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),!u&&!c&&!p)return;let f={...rH(e,d.mode),combine:o,destination:a};s.add(()=>{rW("onDragUpdate",()=>rV(n().onDragUpdate,f,l,ti))})},flush:()=>{d||e7(),s.flush()},drop:u=e=>{d||e7(),d=null,rW("onDragEnd",()=>rV(n().onDragEnd,e,l,ta))},abort:()=>{d&&u({...rH(d.lastCritical,d.mode),combine:null,destination:null,reason:"CANCEL"})}},e=>t=>r=>{if(rm(r,"BEFORE_INITIAL_CAPTURE"))return void c.beforeCapture(r.payload.draggableId,r.payload.movementMode);if(rm(r,"INITIAL_PUBLISH")){let e=r.payload.critical;c.beforeStart(e,r.payload.movementMode),t(r),c.start(e,r.payload.movementMode);return}if(rm(r,"DROP_COMPLETE")){let e=r.payload.completed.result;c.flush(),t(r),c.drop(e);return}if(t(r),rm(r,"FLUSH"))return void c.abort();let n=e.getState();"DRAGGING"===n.phase&&c.update(n.critical,n.impact)}))))})({announce:A,autoScroller:L,dimensionMarshal:M,focusMarshal:G,getResponders:O,styleMarshal:k}),[A,L,M,G,O,k]);S.current=$;let F=td(()=>{let e=nH(S);"IDLE"!==e.getState().phase&&e.dispatch(rD())},[]),z=td(()=>{let e=nH(S).getState();return"DROP_ANIMATING"===e.phase||"IDLE"!==e.phase&&e.isDragging},[]);N(ts(()=>({isDragging:z,tryAbort:F}),[z,F]));let U=td(e=>r1(nH(S).getState(),e),[]),Y=td(()=>t9(nH(S).getState()),[]),K=ts(()=>({marshal:M,focus:G,contextId:I,canLift:U,isMovementAllowed:Y,dragHandleUsageInstructionsId:R,registry:B}),[I,M,R,G,U,Y,B]);return!function({contextId:e,store:t,registry:r,customSensors:n,enableDefaultSensors:l}){let i=[...l?nW:[],...n||[]],a=(0,W.useState)(()=>(function(){let e=null;function t(){e||e7(),e=null}return{isClaimed:function(){return!!e},isActive:function(t){return t===e},claim:function(t){e&&e7();let r={abandon:t};return e=r,r},release:t,tryAbandon:function(){e&&(e.abandon(),t())}}})())[0],o=td(function(e,t){nA(e)&&!nA(t)&&a.tryAbandon()},[a]);np(function(){let e=t.getState();return t.subscribe(()=>{let r=t.getState();o(e,r),e=r})},[a,t,o]),np(()=>a.tryAbandon,[a.tryAbandon]);let s=td(e=>nU({lockAPI:a,registry:r,store:t,draggableId:e}),[a,r,t]),d=td((n,l,i)=>(function({lockAPI:e,contextId:t,store:r,registry:n,draggableId:l,forceSensorStop:i,sourceEvent:a}){var o;let s,d;if(!nU({lockAPI:e,store:r,registry:n,draggableId:l}))return null;let u=n.draggable.getById(l),c=(o=u.descriptor.id,(s=nm(document,`[${ns.contextId}="${t}"]`).find(e=>e.getAttribute(ns.id)===o))&&nb(s)?s:null);if(!c||a&&!u.options.canDragInteractiveElements&&nb(d=a.target)&&function e(t,r){if(null==r)return!1;if(nG.includes(r.tagName.toLowerCase()))return!0;let n=r.getAttribute("contenteditable");return"true"===n||""===n||r!==t&&e(t,r.parentElement)}(c,d))return null;let p=e.claim(i||e4),f="PRE_DRAG";function g(){return u.options.shouldRespectForcePress}function m(){return e.isActive(p)}let h=(function(e,t){nz({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(e8(window,[{eventName:"click",fn:nF,options:{once:!0,passive:!1,capture:!0}}])),n(),r.dispatch(rP({reason:e}))}return"PRE_DRAG"!==f&&(n(),e7()),r.dispatch({type:"LIFT",payload:t.liftActionArgs}),f="DRAGGING",{isActive:()=>nz({expected:"DRAGGING",phase:f,isLockActive:m,shouldWarn:!1}),shouldRespectForcePress:g,drop:e=>l("DROP",e),cancel:e=>l("CANCEL",e),...t.actions}}return{isActive:()=>nz({expected:"PRE_DRAG",phase:f,isLockActive:m,shouldWarn:!1}),shouldRespectForcePress:g,fluidLift:function(e){let t=e1(e=>{h(()=>rw({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:eH(c.getBoundingClientRect()).center,movementMode:"SNAP"},cleanup:e4,actions:{moveUp:()=>h(rI),moveRight:()=>h(rE),moveDown:()=>h(rN),moveLeft:()=>h(rC)}})},abort:function(){nz({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]),u=td(t=>{let r;return(r=function(e,t){let r=t.target;if(!(r instanceof nh(r).Element))return null;let n=`[${no.contextId}="${e}"]`,l=r.closest?r.closest(n):function e(t,r){return null==t?null:t[n$](r)?t:e(t.parentElement,r)}(r,n);return l&&nb(l)?l:null}(e,t))?r.getAttribute(no.draggableId):null},[e]),c=td(e=>{let t=r.draggable.findById(e);return t?t.options:null},[r.draggable]),p=td(function(){a.isClaimed()&&(a.tryAbandon(),"IDLE"!==t.getState().phase&&t.dispatch(rD()))},[a,t]),f=td(()=>a.isClaimed(),[a]),g=ts(()=>({canGetLock:s,tryGetLock:d,findClosestDraggableId:u,findOptionsForDraggable:c,tryReleaseLock:p,isLockClaimed:f}),[s,d,u,c,p,f]);nP(()=>{let e=nj(i);nO(()=>{e.current.length!==i.length&&e7(!1)})});for(let e=0;e<i.length;e++)i[e](g)}({contextId:I,store:$,registry:B,customSensors:E||null,enableDefaultSensors:!1!==e.enableDefaultSensors}),(0,W.useEffect)(()=>F,[F]),W.default.createElement(nC.Provider,{value:K},W.default.createElement(ez,{context:nv,store:$},e.children))}function nq(e){let t=W.default.useId(),r=e.dragHandleUsageInstructions||te;return W.default.createElement(e9,null,n=>W.default.createElement(nV,{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 nY=W.default.createContext(null);function nJ(e){e&&nb(e)||e7()}function nK(e){let t=(0,W.useContext)(e);return t||e7(),t}function nX(e){e.preventDefault()}var nQ=(e,t)=>e===t,nZ=e=>{let{combine:t,destination:r}=e;return r?r.droppableId:t?t.droppableId:null};function n0(e=null){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}let n1={mapped:{type:"SECONDARY",offset:tu,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:n0(null)}},n2=eF(()=>{let e,t,r,n,l,i,a,o,s=(e=tN((e,t)=>({x:e,y:t})),t=tN((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=tN((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(nA(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=t7(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=nZ(a),d=a.combine?a.combine.draggableId:null,u={duration:n.dropDuration,curve:rj,moveTo:n.newHomeClientOffset,opacity:d?rA:null,scale:d?rk:null};return{mapped:{type:"DRAGGING",offset:n.newHomeClientOffset,dimension:i,dropping:u,draggingOver:s,combineWith:d,mode:o,forceShouldAnimate:null,snapshot:t(o,r,s,d,u)}}}return null}),d=(n=tN((e,t)=>({x:e,y:t})),l=tN(n0),i=tN((e,t=null,r)=>({mapped:{type:"SECONDARY",offset:e,combineTargetFor:t,shouldAnimateDisplacement:r,snapshot:l(t)}})),a=e=>e?i(tu,e,!0):null,o=(e,t,r,l)=>{let o=r.displaced.visible[e],s=!!(l.inVirtualList&&l.effected[e]),d=tj(r),u=d&&d.draggableId===e?t:null;if(!o){if(!s)return a(u);if(r.displaced.invisible[e])return null;let t=tg(l.displacedBy.point);return i(n(t.x,t.y),u,!0)}if(s)return a(u);let c=r.displacedBy.point;return i(n(c.x,c.y),u,o.shouldAnimate)},(e,t)=>{if(nA(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)||n1},{dropAnimationFinished:rO},null,{context:nv,areStatePropsEqual:nQ})(e=>{let t=(0,W.useRef)(null),r=td((e=null)=>{t.current=e},[]),n=td(()=>t.current,[]),{contextId:l,dragHandleUsageInstructionsId:i,registry:a}=nK(nC),{type:o,droppableId:s}=nK(nY),d=ts(()=>({id:e.draggableId,index:e.index,type:o,droppableId:s}),[e.draggableId,e.index,o,s]),{children:u,draggableId:c,isEnabled:p,shouldRespectForcePress:f,canDragInteractiveElements:g,isClone:m,mapped:h,dropAnimationFinished:b}=e;nO(()=>{let t=e.draggableId;t||e7(!1),"string"!=typeof t&&e7(!1),Number.isInteger(e.index)||e7(!1),"DRAGGING"!==e.mapped.type&&(nJ(n()),e.isEnabled&&(nx(l,t)||e7(!1)))}),nP(()=>{let e=(0,W.useRef)(m);nO(()=>{m!==e.current&&e7(!1)},[m])}),m||function(e){let t=nE("draggable"),{descriptor:r,registry:n,getDraggableRef:l,canDragInteractiveElements:i,shouldRespectForcePress:a,isEnabled:o}=e,s=ts(()=>({canDragInteractiveElements:i,shouldRespectForcePress:a,isEnabled:o}),[i,o,a]),d=td(e=>{let t=l();return t||e7(),function(e,t,r=tu){let n=window.getComputedStyle(t),l=eZ(t.getBoundingClientRect(),n),i=eQ(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]),u=ts(()=>({uniqueId:t,descriptor:r,options:s,getDimension:d}),[r,d,s,t]),c=(0,W.useRef)(u),p=(0,W.useRef)(!0);np(()=>(n.draggable.register(c.current),()=>n.draggable.unregister(c.current)),[n.draggable]),np(()=>{if(p.current){p.current=!1;return}let e=c.current;c.current=u,n.draggable.update(u,e)},[u,n.draggable])}(ts(()=>({descriptor:d,registry:a,getDraggableRef:n,canDragInteractiveElements:g,shouldRespectForcePress:f,isEnabled:p}),[d,a,n,g,f,p]));let x=ts(()=>p?{tabIndex:0,role:"button","aria-describedby":i,"data-rfd-drag-handle-draggable-id":c,"data-rfd-drag-handle-context-id":l,draggable:!1,onDragStart:nX}:null,[l,i,c,p]),y=td(e=>{"DRAGGING"===h.type&&h.dropping&&"transform"===e.propertyName&&(0,H.flushSync)(b)},[b,h]),v=ts(()=>{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=rM(e);if(r)return t?`${r} scale(${rk})`:r})(r,i):rM(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?rB.drop(l.duration):a?rB.snap:rB.fluid,transform:s,opacity:((e,t)=>{if(e)return t?rA:rR})(i,o),zIndex:o?4500:5e3,pointerEvents:"none"}}(h):{transform:rM(h.offset),transition:h.shouldAnimateDisplacement?void 0:"none"};return{innerRef:r,draggableProps:{"data-rfd-draggable-context-id":l,"data-rfd-draggable-id":c,style:e,onTransitionEnd:"DRAGGING"===h.type&&h.dropping?y:void 0},dragHandleProps:x}},[l,x,c,h,y,r]),w=ts(()=>({draggableId:d.id,type:d.type,source:{index:d.index,droppableId:d.droppableId}}),[d.droppableId,d.id,d.index,d.type]);return W.default.createElement(W.default.Fragment,null,u(v,h.snapshot,w))});function n3(e){return nK(nY).isUsingCloneFor!==e.draggableId||e.isClone?W.default.createElement(n2,e):null}function n5(e){let t="boolean"!=typeof e.isDragDisabled||!e.isDragDisabled,r=!!e.disableInteractiveElementBlocking,n=!!e.shouldRespectForcePress;return W.default.createElement(n3,e2({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:r,shouldRespectForcePress:n}))}let n4=e=>t=>e===t,n8=n4("scroll"),n6=n4("auto");n4("visible");let n7=(e,t)=>t(e.overflowX)||t(e.overflowY),n9=e=>{let t,r;return null==e||e===document.body||e===document.documentElement?null:n7(r={overflowX:(t=window.getComputedStyle(e)).overflowX,overflowY:t.overflowY},n8)||n7(r,n6)?e:n9(e.parentElement)};var le=e=>({x:e.scrollLeft,y:e.scrollTop});let lt=e=>!!e&&("fixed"===window.getComputedStyle(e).position||lt(e.parentElement)),lr={passive:!1},ln={passive:!0};var ll=e=>e.shouldPublishImmediately?lr:ln;let li=e=>e&&e.env.closestScrollable||null;function la(){}let lo={width:0,height:0,margin:{top:0,right:0,bottom:0,left:0}};var ls=W.default.memo(e=>{let t=(0,W.useRef)(null),r=td(()=>{t.current&&(clearTimeout(t.current),t.current=null)},[]),{animate:n,onTransitionEnd:l,onClose:i,contextId:a}=e,[o,s]=(0,W.useState)("open"===e.animate);(0,W.useEffect)(()=>o?"open"!==n?(r(),s(!1),la):t.current?la:(t.current=setTimeout(()=>{t.current=null,s(!1)}),r):la,[n,o,r]);let d=td(e=>{"height"===e.propertyName&&(l(),"close"===n&&i())},[n,i,l]),u=(({isAnimatingOpenOnMount:e,placeholder:t,animate:r})=>{let n=(({isAnimatingOpenOnMount:e,placeholder:t,animate:r})=>e||"close"===r?lo:{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?rB.placeholder:null}})({isAnimatingOpenOnMount:o,animate:e.animate,placeholder:e.placeholder});return W.default.createElement(e.placeholder.tagName,{style:u,"data-rfd-placeholder-context-id":a,onTransitionEnd:d,ref:e.innerRef})});function ld(e){return"boolean"==typeof e}function lu(e,t){t.forEach(t=>t(e))}let lc=[function({props:e}){e.droppableId||e7(),"string"!=typeof e.droppableId&&e7()},function({props:e}){ld(e.isDropDisabled)||e7(),ld(e.isCombineEnabled)||e7(),ld(e.ignoreContainerClipping)||e7()},function({getDroppableRef:e}){nJ(e())}],lp=[function({props:e,getPlaceholderRef:t}){if(!e.placeholder||t())return}],lf=[function({props:e}){e.renderClone||e7()},function({getPlaceholderRef:e}){e()&&e7()}];class lg extends W.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 lm={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:function(){return document.body||e7(),document.body}},lh=e=>{let t,r={...e};for(t in lm)void 0===e[t]&&(r={...r,[t]:lm[t]});return r},lb=(e,t)=>t.draggables[e.draggable.id],lx=eF(()=>{let e={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},t={...e,shouldAnimatePlaceholder:!1},r=tN(e=>({draggableId:e.id,type:e.type,source:{index:e.index,droppableId:e.droppableId}})),n=tN((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=lh(l),a=i.droppableId,o=i.type,s=!i.isDropDisabled,d=i.renderClone;if(nA(r)){let e=r.critical;if(o!==e.droppable.type)return t;let l=lb(e,r.dimensions),i=t7(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=lb(e.critical,r.dimensions);return n(a,s,nZ(e.result)===a,t7(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=t7(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)=>({...lh(r),...e,...t}),{context:nv,areStatePropsEqual:nQ})(e=>{var t;let r=(0,W.useContext)(nC);r||e7();let{contextId:n,isMovementAllowed:l}=r,i=(0,W.useRef)(null),a=(0,W.useRef)(null),{children:o,droppableId:s,type:d,mode:u,direction:c,ignoreContainerClipping:p,isDropDisabled:f,isCombineEnabled:g,snapshot:m,useClone:h,updateViewportMaxScroll:b,getContainerForClone:x}=e,y=td(()=>i.current,[]),v=td((e=null)=>{i.current=e},[]),w=td(()=>a.current,[]),I=td((e=null)=>{a.current=e},[]);t={props:e,getDroppableRef:y,getPlaceholderRef:w},nO(()=>{lu(t,lc),"standard"===t.props.mode&&lu(t,lp),"virtual"===t.props.mode&&lu(t,lf)});let N=td(()=>{l()&&b({maxScroll:rZ()})},[l,b]);!function(e){let t=(0,W.useRef)(null),r=nK(nC),n=nE("droppable"),{registry:l,marshal:i}=r,a=nj(e),o=ts(()=>({id:e.droppableId,type:e.type,mode:e.mode}),[e.droppableId,e.mode,e.type]),s=(0,W.useRef)(o),d=ts(()=>tN((e,r)=>{t.current||e7(),i.updateDroppableScroll(o.id,{x:e,y:r})}),[o.id,i]),u=td(()=>{let e=t.current;return e&&e.env.closestScrollable?le(e.env.closestScrollable):tu},[]),c=td(()=>{let e=u();d(e.x,e.y)},[u,d]),p=ts(()=>e1(c),[c]),f=td(()=>{let e=t.current,r=li(e);(e&&r||e7(),e.scrollOptions.shouldPublishImmediately)?c():p()},[p,c]),g=td((e,n)=>{t.current&&e7();let l=a.current,i=l.getDroppableRef();i||e7();let s={closestScrollable:n9(i),isFixedOnPage:lt(i)},d={ref:i,descriptor:o,env:s,scrollOptions:n};t.current=d;let u=(({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=e0(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 eJ({borderBox:eV({top:n,right:l+t.scrollWidth,bottom:i,left:l},r.border),margin:r.margin,border:r.border,padding:r.padding})})(e,s),u=eQ(d,n),c=(()=>{if(!s)return null;let e=e0(s),t={scrollHeight:s.scrollHeight,scrollWidth:s.scrollWidth};return{client:e,page:eQ(e,n),scroll:le(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=rX({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:tu,displacement:tu}}}})(),d="vertical"===l?tG:t$,u=tw({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:u}})({descriptor:t,isEnabled:!i,isCombineEnabled:a,isFixedOnPage:r.isFixedOnPage,direction:l,client:d,page:u,closest:c})})({ref:i,descriptor:o,env:s,windowScroll:e,direction:l.direction,isDropDisabled:l.isDropDisabled,isCombineEnabled:l.isCombineEnabled,shouldClipSubject:!l.ignoreContainerClipping}),c=s.closestScrollable;return c&&(c.setAttribute(nu.contextId,r.contextId),c.addEventListener("scroll",f,ll(d.scrollOptions))),u},[r.contextId,o,f,a]),m=td(()=>{let e=t.current,r=li(e);return e&&r||e7(),le(r)},[]),h=td(()=>{let e=t.current;e||e7();let r=li(e);t.current=null,r&&(p.cancel(),r.removeAttribute(nu.contextId),r.removeEventListener("scroll",f,ll(e.scrollOptions)))},[f,p]),b=td(e=>{let r=t.current;r||e7();let n=li(r);n||e7(),n.scrollTop+=e.y,n.scrollLeft+=e.x},[]),x=ts(()=>({getDimensionAndWatchScroll:g,getScrollWhileDragging:m,dragStopped:h,scroll:b}),[h,g,m,b]),y=ts(()=>({uniqueId:n,descriptor:o,callbacks:x}),[x,o,n]);np(()=>(s.current=y.descriptor,l.droppable.register(y),()=>{t.current&&h(),l.droppable.unregister(y)}),[x,o,h,y,i,l.droppable]),np(()=>{t.current&&i.updateDroppableIsEnabled(s.current.id,!e.isDropDisabled)},[e.isDropDisabled,i]),np(()=>{t.current&&i.updateDroppableIsCombineEnabled(s.current.id,e.isCombineEnabled)},[e.isCombineEnabled,i])}({droppableId:s,type:d,mode:u,direction:c,isDropDisabled:f,isCombineEnabled:g,ignoreContainerClipping:p,getDroppableRef:y});let E=ts(()=>W.default.createElement(lg,{on:e.placeholder,shouldAnimate:e.shouldAnimatePlaceholder},({onClose:e,data:t,animate:r})=>W.default.createElement(ls,{placeholder:t,onClose:e,innerRef:I,animate:r,contextId:n,onTransitionEnd:N})),[n,N,e.placeholder,e.shouldAnimatePlaceholder,I]),C=ts(()=>({innerRef:v,placeholder:E,droppableProps:{"data-rfd-droppable-id":s,"data-rfd-droppable-context-id":n}}),[n,s,E,v]),D=h?h.dragging.draggableId:null,S=ts(()=>({droppableId:s,type:d,isUsingCloneFor:D}),[s,D,d]);return W.default.createElement(nY.Provider,{value:S},o(C,m),function(){if(!h)return null;let{dragging:e,render:t}=h,r=W.default.createElement(n3,{draggableId:e.draggableId,index:e.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(r,n)=>t(r,n,e));return H.default.createPortal(r,x())}())});var ly=e.i(74886),lv=e.i(55716);let lw=(0,u.default)("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var lI=e.i(31278),lN=e.i(86311),lE=e.i(95468),lC=e.i(73884),lD=e.i(77814);let lS={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"};function lP({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)(lI.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)(lN.MessageSquare,{className:"size-3"})}):n?(0,o.jsx)("span",{className:"inline-flex items-center gap-1 text-xs text-destructive",children:(0,o.jsx)(lC.XCircle,{className:"size-3"})}):l?(0,o.jsx)("span",{className:"inline-flex items-center gap-1 text-xs text-success",children:(0,o.jsx)(lE.CheckCircle2,{className:"size-3"})}):null}function lO({task:e,dragHandleProps:t,tabTodosMap:r}){let n=(0,d.useRouter)(),[l,i]=(0,s.useState)(!1),a=(0,L.getRepoColor)(e.owner,e.repo),u=e.tabs??[],c=u.some(e=>"running"===e.status),p=((r?u.map(e=>r.get(e.tab_id)).find(e=>void 0!==e):void 0)??u.flatMap(e=>e.todos??[])).filter(e=>"deleted"!==e.status),f=p.filter(e=>"completed"===e.status).length,g=p.length,m=e.id.slice(0,5)+"…",h=(0,s.useCallback)(t=>{t.stopPropagation(),navigator.clipboard.writeText(e.id).then(()=>{i(!0),setTimeout(()=>i(!1),2e3)})},[e.id]);return(0,o.jsx)("div",{...t,onClick:()=>n.push(`/tasks/${e.id}`),className:(0,G.cn)("rounded-lg border border-border bg-card p-3 shadow-sm transition-shadow hover:shadow-md cursor-pointer",c&&"opacity-50"),children:(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)(lP,{tabs:e.tabs}),(0,o.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:m}),(0,o.jsx)("button",{onClick:h,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)(ly.Copy,{className:"size-3 text-muted-foreground"})})]}),(0,o.jsx)("span",{className:(0,G.cn)("inline-flex h-5 items-center rounded-full px-2 text-[0.625rem] font-medium",lS[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}),g>0&&(0,o.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,o.jsx)(lD.Progress,{value:f,max:g,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,"/",g]})]}),(0,o.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,o.jsxs)("span",{className:(0,G.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)(lv.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)(lw,{className:"size-3"}),e.effort,"h"]})]})]})})}function lj({tasks:e,onReorder:t,tabTodosMap:r}){let n=(0,s.useCallback)(r=>{if(!r.destination)return;let{source:n,destination:l}=r;if(n.index===l.index)return;let i=[...e],[a]=i.splice(n.index,1);i.splice(l.index,0,a),t(i.map((e,t)=>({...e,order:t})))},[e,t]);return(0,o.jsx)(nq,{onDragEnd:n,children:(0,o.jsx)(lx,{droppableId:"planner-task-list",children:t=>(0,o.jsxs)("div",{ref:t.innerRef,...t.droppableProps,className:"space-y-2",children:[e.map((e,t)=>(0,o.jsx)(n5,{draggableId:e.id,index:t,children:t=>(0,o.jsx)("div",{ref:t.innerRef,...t.draggableProps,children:(0,o.jsx)(lO,{task:e,dragHandleProps:t.dragHandleProps,tabTodosMap:r})})},e.id)),t.placeholder]})})})}function lA({tasks:e,repositories:t,filters:r,onFilterChange:n,onReorder:l,onAddTask:i,tabTodosMap:a}){return(0,o.jsxs)("div",{className:"flex h-full flex-col",children:[(0,o.jsx)("div",{className:"flex-shrink-0 px-4 pt-4",children:(0,o.jsx)(z,{repositories:t,filters:r,onFilterChange:n,onAddTask:i})}),(0,o.jsx)("div",{className:"flex-1 overflow-y-auto px-4 py-4",children:e.length>0?(0,o.jsx)(lj,{tasks:e,onReorder:l,tabTodosMap:a}):(0,o.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No tasks found"})})]})}var lR=e.i(30939),lk=e.i(67211),lT=e.i(70935);function l_(){let[e,t]=(0,s.useState)([]),[r,n]=(0,s.useState)(),[l,i]=(0,s.useState)(new Set),[a,d]=(0,s.useState)(new Map),[u,c]=(0,s.useState)(new Map),[p,f]=(0,s.useState)(!1),[g,m]=(0,s.useState)(),h=(0,s.useRef)(new Map);(0,s.useEffect)(()=>{(async()=>{try{let[e,r]=await Promise.all([fetch((0,lT.apiUrl)("/api/planner/config")).then(e=>e.json()),fetch((0,lT.apiUrl)("/api/planner/tabs")).then(e=>e.json())]);if(e.data?.cwd&&m(e.data.cwd),r.data?.tabs&&(t(r.data.tabs),r.data.tabs.length>0)){let e=r.data.tabs[0].tab_id;n(e),i(new Set([e]))}}catch(e){console.error("Failed to load planner config/tabs:",e)}finally{f(!0)}})()},[]),(0,s.useEffect)(()=>{r&&h.current.get(r)?.focus()},[r]);let b=(0,s.useCallback)(async r=>{let l=crypto.randomUUID(),a=new Date().toISOString(),o={tab_id:l,order:e.length,status:"idle",mode:r,startedAt:a,updatedAt:a};try{await fetch((0,lT.apiUrl)("/api/planner/tabs"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tabId:l})})}catch(e){console.error("Failed to persist planner tab:",e)}t(e=>[...e,o]),n(l),i(e=>{let t=new Set(e);return t.add(l),t}),c(e=>{let t=new Map(e);return t.set(l,r),t})},[e.length]),x=(0,s.useCallback)(()=>b("claude"),[b]),v=(0,s.useCallback)(e=>{i(t=>{if(t.has(e))return t;let r=new Set(t);return r.add(e),r}),n(e)},[]),w=(0,s.useCallback)(async e=>{try{await fetch((0,lT.apiUrl)(`/api/planner/tabs?tabId=${e}`),{method:"DELETE"})}catch(e){console.error("Failed to delete planner tab:",e)}t(t=>{let l=t.filter(t=>t.tab_id!==e);if(r===e){let e=l.length>0?l[l.length-1].tab_id:void 0;setTimeout(()=>n(e),0)}return l}),i(t=>{let r=new Set(t);return r.delete(e),r}),d(t=>{let r=new Map(t);return r.delete(e),r}),c(t=>{let r=new Map(t);return r.delete(e),r}),h.current.delete(e)},[r]),I=(0,s.useCallback)((e,t,r)=>{d(n=>{let l=new Map(n);return l.set(e,{terminal:t,claude:r}),l})},[]);return p?(0,o.jsxs)("div",{className:"flex flex-col flex-1 min-h-0",children:[(0,o.jsx)("div",{className:"px-4 pt-4 flex-shrink-0",children:e.length>0?(0,o.jsx)(lR.SessionTabs,{tabs:e,activeTabId:r,onTabChange:v,onTabCreateClaude:x,onTabDelete:w,tabStatusMap:a}):(0,o.jsxs)("div",{className:"text-center py-8",children:[(0,o.jsx)("p",{className:"text-muted-foreground mb-4",children:"No planner sessions"}),(0,o.jsx)(y.Button,{size:"lg",onClick:x,children:"+ Create Planner Session"})]})}),(0,o.jsxs)("div",{className:"flex-1 min-h-0 relative",children:[e.map(e=>{let t=l.has(e.tab_id),n=e.tab_id===r;return t?(0,o.jsx)("div",{className:"absolute inset-0 flex flex-col px-4 pb-4 pt-2",style:{visibility:n?"visible":"hidden",pointerEvents:n?"auto":"none"},children:(0,o.jsx)(lk.TerminalView,{ref:t=>{t?h.current.set(e.tab_id,t):h.current.delete(e.tab_id)},tabId:e.tab_id,isActive:n,cwd:g,command:"terminal"!==u.get(e.tab_id)?`claude --dangerously-skip-permissions --resume ${e.tab_id} 2>/dev/null || claude --dangerously-skip-permissions --session-id ${e.tab_id}`:void 0,className:"h-full",onStatusChange:I})},e.tab_id):null}),e.length>0&&!r&&(0,o.jsx)("div",{className:"h-full flex items-center justify-center text-muted-foreground text-sm",children:"Select a tab to view terminal"})]})]}):(0,o.jsx)("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:"Loading..."})}var lB=e.i(96085),lM=e.i(2576),lL=e.i(51846),lG=e.i(85699);function l$(e){let{type:t,title:r,description:n,duration:l}=e,i=e.id??crypto.randomUUID(),a={id:i,description:n,duration:l};switch(t){case"loading":lG.toast.loading(r,a);break;case"success":lG.toast.success(r,a);break;case"error":lG.toast.error(r,a);break;case"warning":lG.toast.warning(r,a);break;case"info":lG.toast.info(r,a);break;default:(0,lG.toast)(r,a)}return i}e.s(["default",0,function(){var e;let t,r,n,l,i,a=(0,d.useRouter)(),[u,c]=(0,s.useState)([]),[p,f]=(0,s.useState)([]),[g,m]=(0,s.useState)({}),[h,b]=(0,s.useState)(!0),[x,y]=(0,s.useState)(!1),[v,w]=(0,s.useState)(!1),[N,E]=(0,s.useState)(!1),[S,P]=(0,s.useState)(()=>{try{let e=sessionStorage.getItem("tsunagi:task-filters");if(e)return JSON.parse(e)}catch{}return{statuses:[],repos:[],search:""}});(0,lL.useDocumentTitle)((t=[],S.search.trim()&&t.push(`"${S.search.trim()}"`),S.statuses.length&&t.push(S.statuses.join(", ")),S.repos.length&&t.push(S.repos.map(e=>e.split("/").pop()??e).join(", ")),t.length?t.join(" / "):void 0)),(0,s.useEffect)(()=>{try{sessionStorage.setItem("tsunagi:task-filters",JSON.stringify(S))}catch{}},[S]);let[O,A]=(0,s.useState)(380),[k,T]=(0,s.useState)(!1),_=(0,s.useMemo)(()=>{let e,t={hasRepositories:p.length>0,hasAnthropicApiKey:!!g.ANTHROPIC_API_KEY,hasClaudeCodeToken:!!g.CLAUDE_CODE_OAUTH_TOKEN,hasTasks:u.length>0};return e=t.hasAnthropicApiKey||t.hasClaudeCodeToken?t.hasRepositories?t.hasTasks?"complete":"task":"clone":"env",{state:t,nextStep:e}},[p,g,u]),B=(0,s.useMemo)(()=>u.filter(e=>{if(S.statuses.length>0&&!S.statuses.includes(e.status))return!1;if(S.repos.length>0){let t=`${e.owner}/${e.repo}`;if(!S.repos.includes(t))return!1}return!S.search||!!e.title.toLowerCase().includes(S.search.toLowerCase())}).sort((e,t)=>e.order-t.order),[u,S]),M=async()=>{b(!0);try{let[e,t,r]=await Promise.all([fetch((0,lT.apiUrl)("/api/tasks")).then(e=>e.json()),fetch((0,lT.apiUrl)("/api/owners")).then(e=>e.json()),fetch((0,lT.apiUrl)("/api/env")).then(e=>e.json())]);c(e.data.tasks);let n=t.data.owners.flatMap(e=>e.repositories);f(n),m(r.data.env)}catch(e){console.error("Failed to load data:",e)}finally{b(!1)}},[L,G]=(0,s.useState)(!0);(0,s.useEffect)(()=>{L&&(M(),G(!1))},[]);let $=(0,s.useMemo)(()=>u.flatMap(e=>(e.tabs??[]).map(e=>e.tab_id)),[u]),F=function(e){let[t,r]=(0,s.useState)(new Map),n=(0,s.useRef)(null),l=(0,s.useRef)(new Set);return(0,s.useEffect)(()=>{if(!n.current){let e=(0,lB.io)((0,lT.getServerUrl)(),{transports:["polling","websocket"]});n.current=e,e.on("todos-updated",({sessionId:e,todos:t})=>{r(r=>{let n=new Map(r);return n.set(e,t),n})}),e.on("status-changed",({sessionId:e,status:t})=>{("idle"===t||"error"===t)&&r(t=>{let r=new Map(t);return r.delete(e),r})}),e.on("connect",()=>{for(let t of l.current)e.emit("join",{room:t,mode:"subscribe"})})}let t=n.current;for(let r of e){let e=`tab:${r}`;l.current.has(e)||(t.emit("join",{room:e,mode:"subscribe"}),l.current.add(e))}for(let r of l.current){let n=r.replace("tab:","");e.includes(n)||(t.emit("leave",{room:r}),l.current.delete(r))}},[e]),(0,s.useEffect)(()=>{let e=l.current;return()=>{n.current?.disconnect(),n.current=null,e.clear()}},[]),t}((0,s.useMemo)(()=>u.flatMap(e=>(e.tabs??[]).filter(e=>"running"===e.status).map(e=>e.tab_id)),[u]));e=(e,t)=>{c(r=>r.map(r=>({...r,tabs:(r.tabs??[]).map(r=>r.tab_id===e?{...r,status:t}:r)})))},r=(0,s.useRef)(null),n=(0,s.useRef)(new Set),l=(0,s.useRef)(e),(0,s.useEffect)(()=>{l.current=e}),i=(0,s.useCallback)(()=>{if(!r.current){let e=(0,lB.io)((0,lT.getServerUrl)(),{transports:["polling","websocket"]});r.current=e,e.on("status-changed",({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&&l.current(e,r)}),e.on("connect",()=>{for(let t of n.current)e.emit("join",{room:t,mode:"subscribe"})})}return r.current},[]),(0,s.useEffect)(()=>{if(0===$.length)return;let e=i();for(let t of $){let r=`tab:${t}`;n.current.has(r)||(e.emit("join",{room:r,mode:"subscribe"}),n.current.add(r))}let t=new Set($);for(let r of n.current){let l=r.replace("tab:","");t.has(l)||(e.emit("leave",{room:r}),n.current.delete(r))}},[$,i]),(0,s.useEffect)(()=>{let e=n.current;return()=>{r.current?.disconnect(),r.current=null,e.clear()}},[]),(0,lM.useTaskEvents)({onTaskCreated:e=>{c(t=>t.some(t=>t.id===e.id)?t:[...t,e]),l$({type:"success",title:"Task created",description:e.title,duration:5e3})},onTaskUpdated:e=>{c(t=>t.map(t=>t.id===e.id?e:t)),l$({type:"info",title:"Task updated",description:e.title,duration:5e3})},onTaskDeleted:e=>{let t=u.find(t=>t.id===e)?.title;c(t=>t.filter(t=>t.id!==e)),t&&l$({type:"info",title:"Task deleted",description:t,duration:5e3})}});let{isDeleting:z,deletedCount:U,errorCount:W,totalCount:H,isCompleted:V,startBatchDelete:q,reset:Y}=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,lT.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)(()=>{(z||V)&&queueMicrotask(()=>{if(z&&((e,t)=>{l$({...t,id:e})})("batch-delete-progress",{type:"loading",title:"Deleting tasks...",description:W>0?`${U} / ${H} (${W} failed)`:`${U} / ${H}`,duration:1/0}),V){var e;e="batch-delete-progress",lG.toast.dismiss(e);let t=W>0?`Deleted ${U} tasks (${W} failed)`:`Deleted ${U} tasks`;l$({type:W>0?"warning":"success",title:t,duration:5e3}),setTimeout(()=>{Y()},5e3)}})},[z,V,U,W,H,Y]);let J=(0,s.useCallback)(async e=>{c(t=>{let r=new Set(e.map(e=>e.id));return[...e,...t.filter(e=>!r.has(e.id))]});try{await Promise.all(e.map((e,t)=>fetch((0,lT.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)}},[]),K=async e=>{try{let t=await fetch((0,lT.apiUrl)("/api/clone"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw Error("Failed to clone repository");let r=await t.json();f(e=>[...e,r.data.repository]),await M()}catch(e){throw console.error("Failed to clone repository:",e),e}},X=async e=>{try{let t,r=await q(e);if(!r||0===r.totalCount){let t;return void(t={type:"info",title:"No tasks to delete",description:`No tasks completed more than ${e} days ago`,duration:3e3},l$(t))}t={id:"batch-delete-progress",type:"loading",title:"Deleting tasks...",description:`0 / ${r.totalCount}`,duration:1/0},l$(t)}catch(e){console.error("Failed to start batch delete:",e),l$({type:"error",title:"Failed to delete tasks",description:String(e),duration:5e3})}},Q=(0,s.useCallback)(()=>{T(!0)},[]);return((0,s.useEffect)(()=>{if(!k)return;let e=e=>{A(Math.max(280,Math.min(600,e.clientX)))},t=()=>{T(!1)};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[k]),h&&0===u.length)?(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..."})})}):(0,o.jsxs)("div",{className:"h-screen flex flex-col",children:[(0,o.jsx)(I,{onCloneClick:()=>y(!0),onSettingsClick:()=>a.push("/settings"),onReload:M,nextStep:_.nextStep,isCloneDialogOpen:x}),(0,o.jsxs)("div",{className:"relative flex-1 overflow-hidden flex",children:[(0,o.jsx)("div",{className:"hidden lg:flex flex-col border-r border-border flex-shrink-0",style:{width:O},children:(0,o.jsx)(lA,{tasks:B,repositories:p,filters:S,onFilterChange:P,onReorder:J,onAddTask:()=>w(!0),tabTodosMap:F})}),(0,o.jsx)("div",{className:"hidden lg:flex w-1 cursor-col-resize items-center justify-center hover:bg-accent active:bg-accent flex-shrink-0",onMouseDown:Q,style:{userSelect:k?"none":void 0},children:(0,o.jsx)("div",{className:"w-px h-8 bg-border"})}),(0,o.jsx)("div",{className:"flex-1 min-w-0 h-full flex flex-col",children:(0,o.jsx)(l_,{})}),"env"===_.nextStep&&(0,o.jsx)(C,{hasRepositories:_.state.hasRepositories,hasEnvVars:_.state.hasAnthropicApiKey||_.state.hasClaudeCodeToken,hasTasks:_.state.hasTasks})]}),(0,o.jsx)(j,{isOpen:x,onClose:()=>y(!1),onClone:K,isOnboarding:"clone"===_.nextStep}),(0,o.jsx)(D.TaskDialog,{mode:"create",isOpen:v,onClose:()=>w(!1),repositories:p}),(0,o.jsx)(R,{isOpen:N,onClose:()=>E(!1),onConfirm:X})]})}],39798)}]);
@@ -8,10 +8,10 @@ ${e.themeCSS}`),void 0!==e.fontFamily&&(r+=`
8
8
 
9
9
  If you want to hide the \`${i.titleName}\`, you can wrap it with our VisuallyHidden component.
10
10
 
11
- For more information, see https://radix-ui.com/primitives/docs/components/${i.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},ug=({contentRef:e,descriptionId:i})=>{let r=uf("DialogDescriptionWarning"),n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${r.contentName}}.`;return m.useEffect(()=>{let r=e.current?.getAttribute("aria-describedby");i&&r&&(document.getElementById(i)||console.warn(n))},[n,e,i]),null},um=Symbol.for("react.lazy"),u_=m[" use ".trim().toString()];function uv(e){var i;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===um&&"_payload"in e&&"object"==typeof(i=e._payload)&&null!==i&&"then"in i}var uy=Symbol("radix.slottable");function ub(e){return m.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===uy}var uS=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,i)=>{var r,n;let s,o,a,l=(n=r=`Primitive.${i}`,(s=m.forwardRef((e,i)=>{let{children:r,...n}=e;if(uv(r)&&"function"==typeof u_&&(r=u_(r._payload)),m.isValidElement(r)){var s;let e,o,a=(s=r,(o=(e=Object.getOwnPropertyDescriptor(s.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.ref:(o=(e=Object.getOwnPropertyDescriptor(s,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.props.ref:s.props.ref||s.ref),l=function(e,i){let r={...i};for(let n in i){let s=e[n],o=i[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...e)=>{let i=o(...e);return s(...e),i}:s&&(r[n]=s):"style"===n?r[n]={...s,...o}:"className"===n&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==m.Fragment&&(l.ref=i?cB(i,a):a),m.cloneElement(r,l)}return m.Children.count(r)>1?m.Children.only(null):null})).displayName=`${n}.SlotClone`,o=s,(a=m.forwardRef((e,i)=>{let{children:r,...n}=e;uv(r)&&"function"==typeof u_&&(r=u_(r._payload));let s=m.Children.toArray(r),a=s.find(ub);if(a){let e=a.props.children,r=s.map(i=>i!==a?i:m.Children.count(e)>1?m.Children.only(null):m.isValidElement(e)?e.props.children:null);return(0,g.jsx)(o,{...n,ref:i,children:m.isValidElement(e)?m.cloneElement(e,void 0,r):null})}return(0,g.jsx)(o,{...n,ref:i,children:r})})).displayName=`${r}.Slot`,a),c=m.forwardRef((e,r)=>{let{asChild:n,...s}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,g.jsx)(n?l:i,{...s,ref:r})});return c.displayName=`Primitive.${i}`,{...e,[i]:c}},{}),uw='[cmdk-group=""]',ux='[cmdk-group-items=""]',uC='[cmdk-item=""]',uk=`${uC}:not([aria-disabled="true"])`,uE="cmdk-item-select",uR="data-value",uT=(e,i,r)=>{var n;return n=e,function e(i,r,n,s,o,a,l){if(a===r.length)return o===i.length?1:.99;var c=`${o},${a}`;if(void 0!==l[c])return l[c];for(var h,u,d,f,p=s.charAt(a),g=n.indexOf(p,o),m=0;g>=0;)(h=e(i,r,n,s,g+1,a+1,l))>m&&(g===o?h*=1:cT.test(i.charAt(g-1))?(h*=.8,(d=i.slice(o,g-1).match(cD))&&o>0&&(h*=Math.pow(.999,d.length))):cL.test(i.charAt(g-1))?(h*=.9,(f=i.slice(o,g-1).match(cA))&&o>0&&(h*=Math.pow(.999,f.length))):(h*=.17,o>0&&(h*=Math.pow(.999,g-o))),i.charAt(g)!==r.charAt(a)&&(h*=.9999)),(h<.1&&n.charAt(g-1)===s.charAt(a+1)||s.charAt(a+1)===s.charAt(a)&&n.charAt(g-1)!==s.charAt(a))&&.1*(u=e(i,r,n,s,g+1,a+2,l))>h&&(h=.1*u),h>m&&(m=h),g=n.indexOf(p,g+1);return l[c]=m,m}(n=r&&r.length>0?`${n+" "+r.join(" ")}`:n,i,cM(n),cM(i),0,0,{})},uD=m.createContext(void 0),uL=m.createContext(void 0),uA=m.createContext(void 0),uM=m.forwardRef((e,i)=>{let r=uW(()=>{var i,r;return{search:"",value:null!=(r=null!=(i=e.value)?i:e.defaultValue)?r:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=uW(()=>new Set),s=uW(()=>new Map),o=uW(()=>new Map),a=uW(()=>new Set),l=uH(e),{label:c,children:h,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:g,disablePointerSelection:_=!1,vimBindings:v=!0,...y}=e,b=cH(),S=cH(),w=cH(),x=m.useRef(null),C=uq();uj(()=>{if(void 0!==u){let e=u.trim();r.current.value=e,k.emit()}},[u]),uj(()=>{C(6,A)},[]);let k=m.useMemo(()=>({subscribe:e=>(a.current.add(e),()=>a.current.delete(e)),snapshot:()=>r.current,setState:(e,i,n)=>{var s,o,a,c;if(!Object.is(r.current[e],i)){if(r.current[e]=i,"search"===e)L(),T(),C(1,D);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(w);e?e.focus():null==(s=document.getElementById(b))||s.focus()}if(C(7,()=>{var e;r.current.selectedItemId=null==(e=M())?void 0:e.id,k.emit()}),n||C(5,A),(null==(o=l.current)?void 0:o.value)!==void 0){null==(c=(a=l.current).onValueChange)||c.call(a,null!=i?i:"");return}}k.emit()}},emit:()=>{a.current.forEach(e=>e())}}),[]),E=m.useMemo(()=>({value:(e,i,n)=>{var s;i!==(null==(s=o.current.get(e))?void 0:s.value)&&(o.current.set(e,{value:i,keywords:n}),r.current.filtered.items.set(e,R(i,n)),C(2,()=>{T(),k.emit()}))},item:(e,i)=>(n.current.add(e),i&&(s.current.has(i)?s.current.get(i).add(e):s.current.set(i,new Set([e]))),C(3,()=>{L(),T(),r.current.value||D(),k.emit()}),()=>{o.current.delete(e),n.current.delete(e),r.current.filtered.items.delete(e);let i=M();C(4,()=>{L(),(null==i?void 0:i.getAttribute("id"))===e&&D(),k.emit()})}),group:e=>(s.current.has(e)||s.current.set(e,new Set),()=>{o.current.delete(e),s.current.delete(e)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:w,labelId:S,listInnerRef:x}),[]);function R(e,i){var n,s;let o=null!=(s=null==(n=l.current)?void 0:n.filter)?s:uT;return e?o(e,r.current.search,i):0}function T(){if(!r.current.search||!1===l.current.shouldFilter)return;let e=r.current.filtered.items,i=[];r.current.filtered.groups.forEach(r=>{let n=s.current.get(r),o=0;n.forEach(i=>{o=Math.max(e.get(i),o)}),i.push([r,o])});let n=x.current;P().sort((i,r)=>{var n,s;let o=i.getAttribute("id"),a=r.getAttribute("id");return(null!=(n=e.get(a))?n:0)-(null!=(s=e.get(o))?s:0)}).forEach(e=>{let i=e.closest(ux);i?i.appendChild(e.parentElement===i?e:e.closest(`${ux} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${ux} > *`))}),i.sort((e,i)=>i[1]-e[1]).forEach(e=>{var i;let r=null==(i=x.current)?void 0:i.querySelector(`${uw}[${uR}="${encodeURIComponent(e[0])}"]`);null==r||r.parentElement.appendChild(r)})}function D(){let e=P().find(e=>"true"!==e.getAttribute("aria-disabled")),i=null==e?void 0:e.getAttribute(uR);k.setState("value",i||void 0)}function L(){var e,i,a,c;if(!r.current.search||!1===l.current.shouldFilter){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let h=0;for(let s of n.current){let n=R(null!=(i=null==(e=o.current.get(s))?void 0:e.value)?i:"",null!=(c=null==(a=o.current.get(s))?void 0:a.keywords)?c:[]);r.current.filtered.items.set(s,n),n>0&&h++}for(let[e,i]of s.current)for(let n of i)if(r.current.filtered.items.get(n)>0){r.current.filtered.groups.add(e);break}r.current.filtered.count=h}function A(){var e,i,r;let n=M();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(i=n.closest(uw))?void 0:i.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function M(){var e;return null==(e=x.current)?void 0:e.querySelector(`${uC}[aria-selected="true"]`)}function P(){var e;return Array.from((null==(e=x.current)?void 0:e.querySelectorAll(uk))||[])}function O(e){let i=P()[e];i&&k.setState("value",i.getAttribute(uR))}function B(e){var i;let r=M(),n=P(),s=n.findIndex(e=>e===r),o=n[s+e];null!=(i=l.current)&&i.loop&&(o=s+e<0?n[n.length-1]:s+e===n.length?n[0]:n[s+e]),o&&k.setState("value",o.getAttribute(uR))}function N(e){let i=M(),r=null==i?void 0:i.closest(uw),n;for(;r&&!n;)n=null==(r=e>0?function(e,i){let r=e.nextElementSibling;for(;r;){if(r.matches(i))return r;r=r.nextElementSibling}}(r,uw):function(e,i){let r=e.previousElementSibling;for(;r;){if(r.matches(i))return r;r=r.previousElementSibling}}(r,uw))?void 0:r.querySelector(uk);n?k.setState("value",n.getAttribute(uR)):B(e)}let I=()=>O(P().length-1),F=e=>{e.preventDefault(),e.metaKey?I():e.altKey?N(1):B(1)},z=e=>{e.preventDefault(),e.metaKey?O(0):e.altKey?N(-1):B(-1)};return m.createElement(uS.div,{ref:i,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:e=>{var i;null==(i=y.onKeyDown)||i.call(y,e);let r=e.nativeEvent.isComposing||229===e.keyCode;if(!(e.defaultPrevented||r))switch(e.key){case"n":case"j":v&&e.ctrlKey&&F(e);break;case"ArrowDown":F(e);break;case"p":case"k":v&&e.ctrlKey&&z(e);break;case"ArrowUp":z(e);break;case"Home":e.preventDefault(),O(0);break;case"End":e.preventDefault(),I();break;case"Enter":{e.preventDefault();let i=M();if(i){let e=new Event(uE);i.dispatchEvent(e)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:uK},c),uV(e,e=>m.createElement(uL.Provider,{value:k},m.createElement(uD.Provider,{value:E},e))))}),uP=m.forwardRef((e,i)=>{var r,n;let s=cH(),o=m.useRef(null),a=m.useContext(uA),l=m.useContext(uD),c=uH(e),h=null!=(n=null==(r=c.current)?void 0:r.forceMount)?n:null==a?void 0:a.forceMount;uj(()=>{if(!h)return l.item(s,null==a?void 0:a.id)},[h]);let u=uU(s,o,[e.value,e.children,o],e.keywords),d=m.useContext(uL),f=u$(e=>e.value&&e.value===u.current),p=u$(e=>!!h||!1===l.filter()||!e.search||e.filtered.items.get(s)>0);function g(){var e,i;_(),null==(i=(e=c.current).onSelect)||i.call(e,u.current)}function _(){d.setState("value",u.current,!0)}if(m.useEffect(()=>{let i=o.current;if(!(!i||e.disabled))return i.addEventListener(uE,g),()=>i.removeEventListener(uE,g)},[p,e.onSelect,e.disabled]),!p)return null;let{disabled:v,value:y,onSelect:b,forceMount:S,keywords:w,...x}=e;return m.createElement(uS.div,{ref:cB(o,i),...x,id:s,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!f,"data-disabled":!!v,"data-selected":!!f,onPointerMove:v||l.getDisablePointerSelection()?void 0:_,onClick:v?void 0:g},e.children)}),uO=m.forwardRef((e,i)=>{let{heading:r,children:n,forceMount:s,...o}=e,a=cH(),l=m.useRef(null),c=m.useRef(null),h=cH(),u=m.useContext(uD),d=u$(e=>!!s||!1===u.filter()||!e.search||e.filtered.groups.has(a));uj(()=>u.group(a),[]),uU(a,l,[e.value,e.heading,c]);let f=m.useMemo(()=>({id:a,forceMount:s}),[s]);return m.createElement(uS.div,{ref:cB(l,i),...o,"cmdk-group":"",role:"presentation",hidden:!d||void 0},r&&m.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:h},r),uV(e,e=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?h:void 0},m.createElement(uA.Provider,{value:f},e))))}),uB=m.forwardRef((e,i)=>{let{alwaysRender:r,...n}=e,s=m.useRef(null),o=u$(e=>!e.search);return r||o?m.createElement(uS.div,{ref:cB(s,i),...n,"cmdk-separator":"",role:"separator"}):null}),uN=m.forwardRef((e,i)=>{let{onValueChange:r,...n}=e,s=null!=e.value,o=m.useContext(uL),a=u$(e=>e.search),l=u$(e=>e.selectedItemId),c=m.useContext(uD);return m.useEffect(()=>{null!=e.value&&o.setState("search",e.value)},[e.value]),m.createElement(uS.input,{ref:i,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:s?e.value:a,onChange:e=>{s||o.setState("search",e.target.value),null==r||r(e.target.value)}})}),uI=m.forwardRef((e,i)=>{let{children:r,label:n="Suggestions",...s}=e,o=m.useRef(null),a=m.useRef(null),l=u$(e=>e.selectedItemId),c=m.useContext(uD);return m.useEffect(()=>{if(a.current&&o.current){let e=a.current,i=o.current,r,n=new ResizeObserver(()=>{r=requestAnimationFrame(()=>{let r=e.offsetHeight;i.style.setProperty("--cmdk-list-height",r.toFixed(1)+"px")})});return n.observe(e),()=>{cancelAnimationFrame(r),n.unobserve(e)}}},[]),m.createElement(uS.div,{ref:cB(o,i),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":n,id:c.listId},uV(e,e=>m.createElement("div",{ref:cB(a,c.listInnerRef),"cmdk-list-sizer":""},e)))}),uF=m.forwardRef((e,i)=>{let{open:r,onOpenChange:n,overlayClassName:s,contentClassName:o,container:a,...l}=e;return m.createElement(h2,{open:r,onOpenChange:n},m.createElement(h9,{container:a},m.createElement(h7,{"cmdk-overlay":"",className:s}),m.createElement(ur,{"aria-label":e.label,"cmdk-dialog":"",className:o},m.createElement(uM,{ref:i,...l}))))}),uz=Object.assign(uM,{List:uI,Item:uP,Input:uN,Group:uO,Separator:uB,Dialog:uF,Empty:m.forwardRef((e,i)=>u$(e=>0===e.filtered.count)?m.createElement(uS.div,{ref:i,...e,"cmdk-empty":"",role:"presentation"}):null),Loading:m.forwardRef((e,i)=>{let{progress:r,children:n,label:s="Loading...",...o}=e;return m.createElement(uS.div,{ref:i,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},uV(e,e=>m.createElement("div",{"aria-hidden":!0},e)))})});function uH(e){let i=m.useRef(e);return uj(()=>{i.current=e}),i}var uj="u"<typeof window?m.useEffect:m.useLayoutEffect;function uW(e){let i=m.useRef();return void 0===i.current&&(i.current=e()),i}function u$(e){let i=m.useContext(uL),r=()=>e(i.snapshot());return m.useSyncExternalStore(i.subscribe,r,r)}function uU(e,i,r,n=[]){let s=m.useRef(),o=m.useContext(uD);return uj(()=>{var a;let l=(()=>{var e;for(let i of r){if("string"==typeof i)return i.trim();if("object"==typeof i&&"current"in i)return i.current?null==(e=i.current.textContent)?void 0:e.trim():s.current}})(),c=n.map(e=>e.trim());o.value(e,l,c),null==(a=i.current)||a.setAttribute(uR,l),s.current=l}),s}var uq=()=>{let[e,i]=m.useState(),r=uW(()=>new Map);return uj(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),i({})}};function uV({asChild:e,children:i},r){let n;return e&&m.isValidElement(i)?m.cloneElement("function"==typeof(n=i.type)?n(i.props):"render"in n?n.render(i.props):i,{ref:i.ref},r(i.props.children)):r(i)}var uK={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};e.i(69068);var uY=e.i(25913),uX=e.i(10012);function uG({className:e,...i}){return(0,g.jsx)("textarea",{"data-slot":"textarea",className:(0,cC.cn)("flex field-sizing-content min-h-16 w-full resize-none rounded-md border border-input bg-input/20 px-2 py-2 text-sm transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 md:text-xs/relaxed dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...i})}function uJ({className:e,...i}){return(0,g.jsx)("div",{"data-slot":"input-group",role:"group",className:(0,cC.cn)("group/input-group relative flex h-7 w-full min-w-0 items-center rounded-md border border-input bg-input/20 transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-data-[align=block-end]:rounded-md has-data-[align=block-start]:rounded-md has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-2 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-2 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[textarea]:rounded-md has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",e),...i})}let uZ=(0,uY.cva)("flex h-auto cursor-text items-center justify-center gap-1 py-2 text-xs/relaxed font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:bg-muted-foreground/10 **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.275rem] has-[>kbd]:ml-[-0.275rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.275rem] has-[>kbd]:mr-[-0.275rem]","block-start":"order-first w-full justify-start px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function uQ({className:e,align:i="inline-start",...r}){return(0,g.jsx)("div",{role:"group","data-slot":"input-group-addon","data-align":i,className:(0,cC.cn)(uZ({align:i}),e),onClick:e=>{e.target.closest("button")||e.currentTarget.parentElement?.querySelector("input")?.focus()},...r})}(0,uY.cva)("flex items-center gap-2 rounded-md text-xs/relaxed shadow-none",{variants:{size:{xs:"h-5 gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1 [&>svg:not([class*='size-'])]:size-3",sm:"gap-1","icon-xs":"size-6 p-0 has-[>svg]:p-0","icon-sm":"size-7 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});let u0=(0,r0.default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["default",0,u0],54943);var u1=e.i(78745);e.s(["CheckIcon",()=>u1.default],78784);var u1=u1;function u2({className:e,...i}){return(0,g.jsx)(uz,{"data-slot":"command",className:(0,cC.cn)("flex size-full flex-col overflow-hidden rounded-xl bg-popover p-1 text-popover-foreground",e),...i})}function u5({className:e,...i}){return(0,g.jsx)("div",{"data-slot":"command-input-wrapper",className:"p-1 pb-0",children:(0,g.jsxs)(uJ,{className:"h-8! bg-input/20 dark:bg-input/30",children:[(0,g.jsx)(uz.Input,{"data-slot":"command-input",className:(0,cC.cn)("w-full text-xs/relaxed outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...i}),(0,g.jsx)(uQ,{children:(0,g.jsx)(u0,{className:"size-3.5 shrink-0 opacity-50"})})]})})}function u3({className:e,...i}){return(0,g.jsx)(uz.List,{"data-slot":"command-list",className:(0,cC.cn)("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",e),...i})}function u4({className:e,...i}){return(0,g.jsx)(uz.Empty,{"data-slot":"command-empty",className:(0,cC.cn)("py-6 text-center text-xs/relaxed",e),...i})}function u6({className:e,...i}){return(0,g.jsx)(uz.Group,{"data-slot":"command-group",className:(0,cC.cn)("overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2.5 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground",e),...i})}function u9({className:e,children:i,...r}){return(0,g.jsxs)(uz.Item,{"data-slot":"command-item",className:(0,cC.cn)("group/command-item relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2.5 py-1.5 text-xs/relaxed outline-hidden select-none in-data-[slot=dialog-content]:rounded-md data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-selected:*:[svg]:text-foreground",e),...r,children:[i,(0,g.jsx)(u1.default,{className:"ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"})]})}function u8({options:e,value:i,onChange:r,placeholder:n="Select option",disabled:s=!1,className:o="",allowCustomValue:a=!1,multiple:l=!1,onClear:c,showClearButton:h=!1}){let[u,d]=(0,m.useState)(!1),[f,p]=(0,m.useState)(""),_=(0,m.useRef)(null),v=(0,m.useMemo)(()=>Array.isArray(i)?i:[i],[i]),y=(0,m.useMemo)(()=>{if(l){if(1===v.length&&"all"===v[0]){let i=e.find(e=>"all"===e.value);return i?.label||""}return v.filter(e=>"all"!==e).map(i=>e.find(e=>e.value===i)?.label).filter(Boolean).join(", ")}return v.map(i=>e.find(e=>e.value===i)?.label).filter(Boolean).join(", ")},[v,e,l]),b=(0,m.useMemo)(()=>{let i={};for(let r of e){let e=r.group||"Other";i[e]||(i[e]=[]),i[e].push(r)}return i},[e]),S=(0,m.useMemo)(()=>Object.keys(b).length>1||!b.Other,[b]),w=e=>{if(l){let i=[...v],n=i.indexOf(e);n>=0?i.splice(n,1):i.push(e),r(i.length>0?i:[])}else r(e),d(!1)},x=()=>{a&&f&&!l&&(r(f),d(!1))};return(0,g.jsxs)(ck,{open:u,onOpenChange:e=>{d(e),e||p("")},children:[(0,g.jsxs)("div",{className:`relative ${o}`,children:[(0,g.jsx)(cE,{ref:_,disabled:s,className:`flex h-9 w-full items-center justify-between pl-3 ${h?"pr-16":"pr-10"} border border-input rounded-md text-sm bg-input/20 dark:bg-input/30 text-foreground transition-colors outline-none hover:border-ring focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 data-[state=open]:border-ring data-[state=open]:ring-2 data-[state=open]:ring-ring/30 disabled:opacity-50 disabled:cursor-not-allowed disabled:pointer-events-none cursor-pointer overflow-hidden text-ellipsis whitespace-nowrap text-left shadow-xs`,children:(0,g.jsx)("span",{className:"truncate",children:y||(0,g.jsx)("span",{className:"text-muted-foreground",children:n})})}),h&&c&&(0,g.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),c()},className:"absolute right-8 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors cursor-pointer z-10","aria-label":"Clear selection",children:(0,g.jsx)(ad.X,{className:"w-4 h-4"})}),(0,g.jsx)(au,{className:"absolute right-2 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground pointer-events-none"})]}),(0,g.jsx)(cR,{className:"w-[var(--anchor-width)] p-0",align:"start",sideOffset:4,children:(0,g.jsxs)(u2,{filter:(i,r)=>{let n=e.find(e=>e.value===i);return n?+!!`${n.label} ${n.group||""}`.toLowerCase().includes(r.toLowerCase()):0},children:[(0,g.jsx)(u5,{placeholder:"Search...",value:f,onValueChange:p,onKeyDown:e=>{"Enter"===e.key&&a&&x()}}),(0,g.jsxs)(u3,{children:[(0,g.jsx)(u4,{children:a&&f?(0,g.jsxs)("button",{type:"button",className:"w-full px-2 py-1.5 text-left text-xs cursor-pointer hover:bg-accent rounded",onClick:x,children:['Use "',f,'"']}):"No options found"}),S?Object.entries(b).map(([e,i])=>(0,g.jsx)(u6,{heading:e,children:i.map(e=>(0,g.jsx)(u9,{value:e.value,"data-checked":v.includes(e.value),onSelect:()=>w(e.value),children:(0,g.jsx)("span",{className:"truncate",children:e.label})},e.value))},e)):(0,g.jsx)(u6,{children:e.map(e=>(0,g.jsx)(u9,{value:e.value,"data-checked":v.includes(e.value),onSelect:()=>w(e.value),children:(0,g.jsx)("span",{className:"truncate",children:e.label})},e.value))})]})]})})]})}let u7=(0,r0.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);var de=e.i(86536),dt=e.i(70935);function di({value:e,onChange:i,editorRef:r,theme:n,activeTab:s,onTabChange:o,disabled:a,onFocusChange:l}){let c=(0,m.useCallback)(e=>{i(e??"")},[i]),h=(0,g.jsx)("div",{className:"border border-border rounded overflow-hidden h-full",children:(0,g.jsx)(_.Editor,{height:"100%",defaultLanguage:"markdown",value:e,onChange:c,onMount:e=>{r.current=e,e.layout(),e.onDidFocusEditorText(()=>l?.(!0)),e.onDidBlurEditorText(()=>l?.(!1))},options:{minimap:{enabled:!1},lineNumbers:"on",wordWrap:"on",fontSize:13,scrollBeyondLastLine:!1,readOnly:a},theme:"dark"===n?"vs-dark":"vs-light"})}),u=(0,g.jsx)("div",{className:"border border-border rounded overflow-y-auto h-full p-4 prose prose-sm prose-slate dark:prose-invert max-w-none",children:e?(0,g.jsx)(iW,{remarkPlugins:[rQ],components:as,children:e}):(0,g.jsx)("p",{className:"text-muted-foreground italic",children:"No content"})});return(0,g.jsxs)("div",{className:"flex flex-col flex-1 min-h-0",children:[(0,g.jsxs)("div",{className:"flex gap-1 mb-2 md:hidden flex-shrink-0",children:[(0,g.jsxs)(r3.Button,{type:"button",variant:"editor"===s?"default":"outline",size:"sm",onClick:()=>o("editor"),children:[(0,g.jsx)(u7,{className:"w-4 h-4 mr-1"}),"Editor"]}),(0,g.jsxs)(r3.Button,{type:"button",variant:"preview"===s?"default":"outline",size:"sm",onClick:()=>o("preview"),children:[(0,g.jsx)(de.Eye,{className:"w-4 h-4 mr-1"}),"Preview"]})]}),(0,g.jsxs)("div",{className:"hidden md:grid md:grid-cols-2 md:gap-4 flex-1 min-h-0",children:[h,u]}),(0,g.jsx)("div",{className:"md:hidden flex-1 min-h-0",children:"editor"===s?h:u})]})}e.s(["TaskDialog",0,function({mode:e,isOpen:i,onClose:r,repositories:n=[],task:s,onUpdate:o}){let a=ac(),[l,c]=(0,m.useState)(""),[h,u]=(0,m.useState)([]),[d,f]=(0,m.useState)(""),[p,_]=(0,m.useState)(!1),[v,y]=(0,m.useState)(""),[b,S]=(0,m.useState)({title:"",description:"",owner:"",repo:"",branch:"",baseBranch:"",status:"backlog",effort:void 0,order:void 0}),[w,x]=(0,m.useState)(!1),[C,k]=(0,m.useState)({}),[E,R]=(0,m.useState)("editor"),[T,D]=(0,m.useState)(!1),L=(0,m.useRef)(null),{effectiveTheme:A}=(0,ao.useTheme)();(0,m.useEffect)(()=>{"edit"===e&&s&&S({title:s.title,description:s.description,owner:s.owner,repo:s.repo,branch:s.branch,baseBranch:"",status:s.status,effort:s.effort,order:s.order})},[e,s,i]);let M=(0,m.useMemo)(()=>n.map(e=>({value:`${e.owner}/${e.repo}`,label:`${e.owner}/${e.repo}`})),[n]),P=(0,m.useMemo)(()=>h.map(e=>({value:e,label:e===d?`${e} (default)`:e})),[h,d]);(0,m.useEffect)(()=>{if("create"===e){if(!l){u([]),f(""),S(e=>({...e,baseBranch:""}));return}(async()=>{_(!0),y("");try{let[e,i]=l.split("/"),r=await fetch((0,dt.apiUrl)(`/api/repos/${e}/${i}/branches`));if(!r.ok)throw Error("Failed to fetch branches");let n=await r.json();u(n.data.branches),f(n.data.defaultBranch),S(e=>({...e,baseBranch:n.data.defaultBranch}))}catch(e){console.error("Failed to fetch branches:",e),y("Failed to load branches. Repository may not be initialized."),u([]),f("")}finally{_(!1)}})()}},[l,e]);let O=async i=>{if(i.preventDefault(),k({}),"create"===e){x(!0);try{let e=await fetch((0,dt.apiUrl)("/api/tasks/validate"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:b.title,owner:b.owner,repo:b.repo,branch:b.branch})}),i=await e.json();if(!i.valid){let e={};i.errors.forEach(i=>{e[i.field]=i.message}),k(e),x(!1);return}let n={title:b.title,description:b.description,owner:b.owner,repo:b.repo,branch:b.branch,baseBranch:b.baseBranch};r(),c(""),S({title:"",description:"",owner:"",repo:"",branch:"",baseBranch:"",status:"backlog",effort:void 0,order:void 0}),x(!1);let s=a.loading("Creating task...",n.title);try{if(!(await fetch((0,dt.apiUrl)("/api/tasks"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})).ok)throw Error("Failed to create task");a.dismiss(s)}catch(i){let e=i instanceof Error?i.message:"Unknown error";a.error(s,"Failed to create task",e)}}catch(i){x(!1);let e=i instanceof Error?i.message:"Validation failed";a.error(void 0,"Validation failed",e)}}else if("edit"===e&&o&&s){x(!0);try{let e=await o(s.id,{title:b.title,description:b.description,status:b.status,effort:b.effort,order:b.order});if(e.success)r();else if(e.errors){let i={};e.errors.forEach(e=>{i[e.field]=e.message}),k(i)}}catch(e){console.error("Failed to update task:",e),k({global:e instanceof Error?e.message:"Failed to update task. Please try again."})}finally{x(!1)}}},B="create"===e,N=B?"Add New Task":"Edit Task",I=B?"Create":"Save";return(0,g.jsxs)(ah.Dialog,{open:i,onOpenChange:e=>{e.open||w||r()},title:N,maxWidth:B?"2xl":"6xl",fullScreen:!B,showCloseButton:!w,dismissOnEsc:!T,children:[w&&(0,g.jsx)("div",{className:"absolute inset-0 bg-card bg-opacity-90 rounded-lg flex items-center justify-center z-10",children:(0,g.jsx)(aa.LoadingSpinner,{size:"lg",message:B?"Creating task...":"Saving task..."})}),C.global&&(0,g.jsx)("div",{className:"mb-4 p-3 bg-destructive/10 border border-destructive/50 rounded text-destructive text-sm",children:C.global}),(0,g.jsxs)("form",{onSubmit:O,className:B?"space-y-4":"flex flex-col gap-4 flex-1 min-h-0 overflow-hidden",children:[B&&(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Repository *"}),(0,g.jsx)(u8,{options:M,value:l,onChange:e=>{let i=Array.isArray(e)?e[0]||"":e;if(c(i),i){let[e,r]=i.split("/");S(i=>({...i,owner:e,repo:r,baseBranch:""}))}else S(e=>({...e,owner:"",repo:"",baseBranch:""}))},placeholder:"Select repository",disabled:w})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Title *"}),(0,g.jsx)(uX.Input,{type:"text",required:!0,maxLength:200,value:b.title,onChange:e=>S({...b,title:e.target.value}),className:"w-full",disabled:w})]}),!B&&s&&(0,g.jsxs)("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 p-3 bg-muted/50 rounded-md text-sm",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:"Repository"}),(0,g.jsxs)("p",{className:"text-muted-foreground",children:[s.owner,"/",s.repo]})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:"Branch"}),(0,g.jsx)("p",{className:"text-muted-foreground",children:s.branch})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:"Base Branch"}),(0,g.jsx)("p",{className:"text-muted-foreground",children:s.baseBranch||"N/A"})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:"Worktree"}),(0,g.jsx)("p",{className:"text-muted-foreground capitalize",children:s.worktreeStatus})]})]}),(0,g.jsxs)("div",{className:B?"":"flex flex-col flex-1 min-h-0",children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground flex-shrink-0",children:"Description"}),B?(0,g.jsx)(uG,{maxLength:5e3,value:b.description,onChange:e=>S({...b,description:e.target.value}),className:"min-h-24 w-full",disabled:w}):(0,g.jsx)(di,{value:b.description,onChange:e=>S(i=>({...i,description:e})),editorRef:L,theme:A,activeTab:E,onTabChange:R,disabled:w,onFocusChange:D})]}),!B&&(0,g.jsxs)("div",{className:"grid grid-cols-3 gap-4 flex-shrink-0",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Status"}),(0,g.jsxs)("select",{value:b.status,onChange:e=>S({...b,status:e.target.value}),className:"w-full h-9 pl-3 pr-10 py-1 rounded-md border border-input bg-transparent text-sm shadow-xs text-foreground",disabled:w,children:[(0,g.jsx)("option",{value:"backlog",children:"Backlog"}),(0,g.jsx)("option",{value:"planning",children:"Planning"}),(0,g.jsx)("option",{value:"tasking",children:"Tasking"}),(0,g.jsx)("option",{value:"coding",children:"Coding"}),(0,g.jsx)("option",{value:"reviewing",children:"Reviewing"}),(0,g.jsx)("option",{value:"done",children:"Done"})]})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Effort (h)"}),(0,g.jsx)(uX.Input,{type:"number",step:"0.5",min:"0.5",max:"40",value:b.effort??"",onChange:e=>S({...b,effort:parseFloat(e.target.value)||void 0}),className:"w-full",placeholder:"2.5",disabled:w})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Order"}),(0,g.jsx)(uX.Input,{type:"number",min:"0",value:b.order??"",onChange:e=>S({...b,order:parseInt(e.target.value)||void 0}),className:"w-full",placeholder:"0",disabled:w})]})]}),B&&(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Base Branch *"}),p?(0,g.jsxs)("div",{className:"w-full h-9 px-3 rounded-md border border-input bg-transparent text-muted-foreground flex items-center gap-2",children:[(0,g.jsx)(aa.LoadingSpinner,{size:"sm"}),(0,g.jsx)("span",{className:"text-xs",children:"Loading branches..."})]}):h.length>0?(0,g.jsx)(u8,{options:P,value:b.baseBranch,onChange:e=>{let i=Array.isArray(e)?e[0]||"":e;S({...b,baseBranch:i})},placeholder:"Select base branch",disabled:w}):(0,g.jsx)("div",{className:"w-full h-9 px-3 rounded-md border border-input bg-transparent text-sm text-muted-foreground flex items-center",children:v||"Select repository first"}),(0,g.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Your new branch will be created from this branch"})]}),B&&(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"New Branch Name *"}),(0,g.jsx)(uX.Input,{type:"text",required:!0,maxLength:255,value:b.branch,onChange:e=>S({...b,branch:e.target.value}),className:`w-full ${C.branch?"border-destructive":""}`,placeholder:"feature/new-feature",disabled:w,"aria-invalid":!!C.branch}),C.branch&&(0,g.jsx)("p",{className:"text-xs text-destructive mt-1",children:C.branch}),!C.branch&&(0,g.jsxs)("p",{className:"text-xs text-muted-foreground mt-1",children:["Will be created from ",b.baseBranch||"base branch"]})]}),(0,g.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,g.jsx)(r3.Button,{type:"button",variant:"outline",size:"lg",onClick:r,className:"active:scale-95",disabled:w,children:"Cancel"}),(0,g.jsx)(r3.Button,{type:"submit",size:"lg",className:"active:scale-95",disabled:w||B&&p,children:I})]})]})]})}],10483)},86311,e=>{"use strict";let i=(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,i],86311)},95468,73884,e=>{"use strict";var i=e.i(23287);e.s(["CheckCircle2",()=>i.default],95468);let r=(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,r],73884)},77814,e=>{"use strict";var i,r=e.i(18050);e.s([],33847),e.i(33847),e.i(47167);var n=e.i(71645),s=e.i(231),o=e.i(62372);let a=new Map;function l(e,i,r){return null==e?"":(function(e,i){let r=JSON.stringify({locale:e,options:i}),n=a.get(r);if(n)return n;let s=new Intl.NumberFormat(e,i);return a.set(r,s),s})(i,r).format(e)}var c=e.i(27601),h=e.i(67805);let u=n.createContext(void 0);function d(){let e=n.useContext(u);if(void 0===e)throw Error((0,h.default)(51));return e}let f=((i={}).complete="data-complete",i.indeterminate="data-indeterminate",i.progressing="data-progressing",i),p={status:e=>"progressing"===e?{[f.progressing]:""}:"complete"===e?{[f.complete]:""}:"indeterminate"===e?{[f.indeterminate]:""}:null};function g(e,i){return null==i?"indeterminate progress":e||`${i}%`}let m=n.forwardRef(function(e,i){var a;let{format:h,getAriaValueText:d=g,locale:f,max:m=100,min:_=0,value:v,render:y,className:b,children:S,...w}=e,[x,C]=n.useState(),k=(0,s.useValueAsRef)(h),E="indeterminate";Number.isFinite(v)&&(E=v===m?"complete":"progressing");let R=(a=k.current,null==v?"":a?l(v,f,a):l(v/100,f,{style:"percent"})),T=n.useMemo(()=>({status:E}),[E]),D={"aria-labelledby":x,"aria-valuemax":m,"aria-valuemin":_,"aria-valuenow":v??void 0,"aria-valuetext":d(R,v),role:"progressbar",children:(0,r.jsxs)(n.Fragment,{children:[S,(0,r.jsx)("span",{role:"presentation",style:o.visuallyHidden,children:"x"})]})},L=n.useMemo(()=>({formattedValue:R,max:m,min:_,setLabelId:C,state:T,status:E,value:v}),[R,m,_,C,T,E,v]),A=(0,c.useRenderElement)("div",e,{state:T,ref:i,props:[D,w],stateAttributesMapping:p});return(0,r.jsx)(u.Provider,{value:L,children:A})}),_=n.forwardRef(function(e,i){let{render:r,className:n,...s}=e,{state:o}=d();return(0,c.useRenderElement)("div",e,{state:o,ref:i,props:s,stateAttributesMapping:p})}),v=n.forwardRef(function(e,i){let{render:r,className:s,...o}=e,{max:a,min:l,value:h,state:u}=d(),f=Number.isFinite(h)&&null!==h?(h-l)*100/(a-l):null,g=n.useCallback(()=>null==f?{}:{insetInlineStart:0,height:"inherit",width:`${f}%`},[f]);return(0,c.useRenderElement)("div",e,{state:u,ref:i,props:[{style:g()},o],stateAttributesMapping:p})}),y=n.forwardRef(function(e,i){let{className:r,render:n,children:s,...o}=e,{value:a,formattedValue:l,state:h}=d(),u=null==a?"indeterminate":l,f=null==a?null:l;return(0,c.useRenderElement)("span",e,{state:h,ref:i,props:[{"aria-hidden":!0,children:"function"==typeof s?s(u,a):f},o],stateAttributesMapping:p})});var b=e.i(24564);let S=n.forwardRef(function(e,i){let{render:r,className:n,id:s,...o}=e,{setLabelId:a,state:l}=d(),h=(0,b.useRegisteredLabelId)(s,a);return(0,c.useRenderElement)("span",e,{state:l,ref:i,props:[{id:h,role:"presentation"},o],stateAttributesMapping:p})});e.s(["Indicator",0,v,"Label",0,S,"Root",0,m,"Track",0,_,"Value",0,y],45929);var w=e.i(45929),w=w,x=e.i(52088);function C({className:e,...i}){return(0,r.jsx)(w.Track,{className:(0,x.cn)("relative flex h-1 w-full items-center overflow-x-hidden rounded-md bg-muted",e),"data-slot":"progress-track",...i})}function k({className:e,...i}){return(0,r.jsx)(w.Indicator,{"data-slot":"progress-indicator",className:(0,x.cn)("h-full bg-primary",e),style:{transition:"width 500ms ease-in-out"},...i})}e.s(["Progress",0,function({className:e,children:i,value:n,...s}){return(0,r.jsxs)(w.Root,{value:n,"data-slot":"progress",className:(0,x.cn)("flex flex-wrap gap-3",e),...s,children:[i,(0,r.jsx)(C,{children:(0,r.jsx)(k,{})})]})}],77814)},48214,31245,e=>{"use strict";var i=e.i(75254);let r=(0,i.default)("circle-pause",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]]);e.s(["CirclePause",0,r],48214);let n=(0,i.default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);e.s(["Bot",0,n],31245)},68054,e=>{"use strict";let i=(0,e.i(75254).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",0,i],68054)},57212,e=>{"use strict";let i=(0,e.i(75254).default)("wifi-off",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);e.s(["WifiOff",0,i],57212)},30939,99894,93309,e=>{"use strict";let i,r,n,s,o,a,l,c,h,u,d,f;var p=e.i(18050),g=e.i(71645),m=e.i(37727),_=e.i(31278),v=e.i(48214),y=e.i(31245),b=e.i(68054),S=e.i(63209),w=e.i(57212),x=e.i(95468),C=e.i(73884),k=e.i(86311),E=e.i(68995),R=e.i(85902);function T({entry:e}){if(!e||"idle"===e.terminal)return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,p.jsx)(v.CirclePause,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"idle"})]});if("connecting"===e.terminal)return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,p.jsx)(_.Loader2,{className:"w-3 h-3 animate-spin"}),(0,p.jsx)("span",{children:"connecting"})]});if("error"===e.terminal)return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-destructive",children:[(0,p.jsx)(S.AlertCircle,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"error"})]});if("exited"===e.terminal||"paused"===e.terminal)return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,p.jsx)(w.WifiOff,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:e.terminal})]});switch(e.claude){case"running":return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-primary",children:[(0,p.jsx)(_.Loader2,{className:"w-3 h-3 animate-spin"}),(0,p.jsx)("span",{children:"running"})]});case"waiting":return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-warning",children:[(0,p.jsx)(k.MessageSquare,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"waiting"})]});case"success":return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-success",children:[(0,p.jsx)(x.CheckCircle2,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"success"})]});case"failure":case"error":return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-destructive",children:[(0,p.jsx)(C.XCircle,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"failure"===e.claude?"failure":"error"})]});default:return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,p.jsx)(v.CirclePause,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"idle"})]})}}e.s(["SessionTabs",0,function({tabs:e,activeTabId:i,onTabChange:r,onTabCreateTerminal:n,onTabCreateClaude:s,onTabDelete:o,tabStatusMap:a}){let l=(0,g.useRef)([]),[c,h]=(0,g.useState)({left:0,width:0}),[u,d]=(0,g.useState)(null);return(0,g.useEffect)(()=>{let r=e.findIndex(e=>e.tab_id===i);if(-1!==r&&l.current[r]){let e=l.current[r];e&&h({left:e.offsetLeft,width:e.offsetWidth})}},[i,e]),(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(E.ConfirmDialog,{open:null!==u,onOpenChange:e=>{e.open||d(null)},title:"Delete Tab",message:u?.isRunning?"This tab is running. Are you sure you want to delete it?":"Delete this tab?",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{u&&o(u.tabId)},variant:"danger"}),(0,p.jsxs)("div",{className:"relative flex items-center gap-2 overflow-x-auto border-b border-border pb-1",children:[e.map((n,s)=>{let o=i===n.tab_id,c=a?.get(n.tab_id),h=(c?.claude==="running"||c?.claude==="waiting")&&c?.terminal==="connected";return(0,p.jsxs)("div",{ref:e=>{l.current[s]=e},onClick:()=>r(n.tab_id),className:`
11
+ For more information, see https://radix-ui.com/primitives/docs/components/${i.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},ug=({contentRef:e,descriptionId:i})=>{let r=uf("DialogDescriptionWarning"),n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${r.contentName}}.`;return m.useEffect(()=>{let r=e.current?.getAttribute("aria-describedby");i&&r&&(document.getElementById(i)||console.warn(n))},[n,e,i]),null},um=Symbol.for("react.lazy"),u_=m[" use ".trim().toString()];function uv(e){var i;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===um&&"_payload"in e&&"object"==typeof(i=e._payload)&&null!==i&&"then"in i}var uy=Symbol("radix.slottable");function ub(e){return m.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===uy}var uS=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,i)=>{var r,n;let s,o,a,l=(n=r=`Primitive.${i}`,(s=m.forwardRef((e,i)=>{let{children:r,...n}=e;if(uv(r)&&"function"==typeof u_&&(r=u_(r._payload)),m.isValidElement(r)){var s;let e,o,a=(s=r,(o=(e=Object.getOwnPropertyDescriptor(s.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.ref:(o=(e=Object.getOwnPropertyDescriptor(s,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.props.ref:s.props.ref||s.ref),l=function(e,i){let r={...i};for(let n in i){let s=e[n],o=i[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...e)=>{let i=o(...e);return s(...e),i}:s&&(r[n]=s):"style"===n?r[n]={...s,...o}:"className"===n&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==m.Fragment&&(l.ref=i?cB(i,a):a),m.cloneElement(r,l)}return m.Children.count(r)>1?m.Children.only(null):null})).displayName=`${n}.SlotClone`,o=s,(a=m.forwardRef((e,i)=>{let{children:r,...n}=e;uv(r)&&"function"==typeof u_&&(r=u_(r._payload));let s=m.Children.toArray(r),a=s.find(ub);if(a){let e=a.props.children,r=s.map(i=>i!==a?i:m.Children.count(e)>1?m.Children.only(null):m.isValidElement(e)?e.props.children:null);return(0,g.jsx)(o,{...n,ref:i,children:m.isValidElement(e)?m.cloneElement(e,void 0,r):null})}return(0,g.jsx)(o,{...n,ref:i,children:r})})).displayName=`${r}.Slot`,a),c=m.forwardRef((e,r)=>{let{asChild:n,...s}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,g.jsx)(n?l:i,{...s,ref:r})});return c.displayName=`Primitive.${i}`,{...e,[i]:c}},{}),uw='[cmdk-group=""]',ux='[cmdk-group-items=""]',uC='[cmdk-item=""]',uk=`${uC}:not([aria-disabled="true"])`,uE="cmdk-item-select",uR="data-value",uT=(e,i,r)=>{var n;return n=e,function e(i,r,n,s,o,a,l){if(a===r.length)return o===i.length?1:.99;var c=`${o},${a}`;if(void 0!==l[c])return l[c];for(var h,u,d,f,p=s.charAt(a),g=n.indexOf(p,o),m=0;g>=0;)(h=e(i,r,n,s,g+1,a+1,l))>m&&(g===o?h*=1:cT.test(i.charAt(g-1))?(h*=.8,(d=i.slice(o,g-1).match(cD))&&o>0&&(h*=Math.pow(.999,d.length))):cL.test(i.charAt(g-1))?(h*=.9,(f=i.slice(o,g-1).match(cA))&&o>0&&(h*=Math.pow(.999,f.length))):(h*=.17,o>0&&(h*=Math.pow(.999,g-o))),i.charAt(g)!==r.charAt(a)&&(h*=.9999)),(h<.1&&n.charAt(g-1)===s.charAt(a+1)||s.charAt(a+1)===s.charAt(a)&&n.charAt(g-1)!==s.charAt(a))&&.1*(u=e(i,r,n,s,g+1,a+2,l))>h&&(h=.1*u),h>m&&(m=h),g=n.indexOf(p,g+1);return l[c]=m,m}(n=r&&r.length>0?`${n+" "+r.join(" ")}`:n,i,cM(n),cM(i),0,0,{})},uD=m.createContext(void 0),uL=m.createContext(void 0),uA=m.createContext(void 0),uM=m.forwardRef((e,i)=>{let r=uW(()=>{var i,r;return{search:"",value:null!=(r=null!=(i=e.value)?i:e.defaultValue)?r:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=uW(()=>new Set),s=uW(()=>new Map),o=uW(()=>new Map),a=uW(()=>new Set),l=uH(e),{label:c,children:h,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:g,disablePointerSelection:_=!1,vimBindings:v=!0,...y}=e,b=cH(),S=cH(),w=cH(),x=m.useRef(null),C=uq();uj(()=>{if(void 0!==u){let e=u.trim();r.current.value=e,k.emit()}},[u]),uj(()=>{C(6,A)},[]);let k=m.useMemo(()=>({subscribe:e=>(a.current.add(e),()=>a.current.delete(e)),snapshot:()=>r.current,setState:(e,i,n)=>{var s,o,a,c;if(!Object.is(r.current[e],i)){if(r.current[e]=i,"search"===e)L(),T(),C(1,D);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(w);e?e.focus():null==(s=document.getElementById(b))||s.focus()}if(C(7,()=>{var e;r.current.selectedItemId=null==(e=M())?void 0:e.id,k.emit()}),n||C(5,A),(null==(o=l.current)?void 0:o.value)!==void 0){null==(c=(a=l.current).onValueChange)||c.call(a,null!=i?i:"");return}}k.emit()}},emit:()=>{a.current.forEach(e=>e())}}),[]),E=m.useMemo(()=>({value:(e,i,n)=>{var s;i!==(null==(s=o.current.get(e))?void 0:s.value)&&(o.current.set(e,{value:i,keywords:n}),r.current.filtered.items.set(e,R(i,n)),C(2,()=>{T(),k.emit()}))},item:(e,i)=>(n.current.add(e),i&&(s.current.has(i)?s.current.get(i).add(e):s.current.set(i,new Set([e]))),C(3,()=>{L(),T(),r.current.value||D(),k.emit()}),()=>{o.current.delete(e),n.current.delete(e),r.current.filtered.items.delete(e);let i=M();C(4,()=>{L(),(null==i?void 0:i.getAttribute("id"))===e&&D(),k.emit()})}),group:e=>(s.current.has(e)||s.current.set(e,new Set),()=>{o.current.delete(e),s.current.delete(e)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:w,labelId:S,listInnerRef:x}),[]);function R(e,i){var n,s;let o=null!=(s=null==(n=l.current)?void 0:n.filter)?s:uT;return e?o(e,r.current.search,i):0}function T(){if(!r.current.search||!1===l.current.shouldFilter)return;let e=r.current.filtered.items,i=[];r.current.filtered.groups.forEach(r=>{let n=s.current.get(r),o=0;n.forEach(i=>{o=Math.max(e.get(i),o)}),i.push([r,o])});let n=x.current;P().sort((i,r)=>{var n,s;let o=i.getAttribute("id"),a=r.getAttribute("id");return(null!=(n=e.get(a))?n:0)-(null!=(s=e.get(o))?s:0)}).forEach(e=>{let i=e.closest(ux);i?i.appendChild(e.parentElement===i?e:e.closest(`${ux} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${ux} > *`))}),i.sort((e,i)=>i[1]-e[1]).forEach(e=>{var i;let r=null==(i=x.current)?void 0:i.querySelector(`${uw}[${uR}="${encodeURIComponent(e[0])}"]`);null==r||r.parentElement.appendChild(r)})}function D(){let e=P().find(e=>"true"!==e.getAttribute("aria-disabled")),i=null==e?void 0:e.getAttribute(uR);k.setState("value",i||void 0)}function L(){var e,i,a,c;if(!r.current.search||!1===l.current.shouldFilter){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let h=0;for(let s of n.current){let n=R(null!=(i=null==(e=o.current.get(s))?void 0:e.value)?i:"",null!=(c=null==(a=o.current.get(s))?void 0:a.keywords)?c:[]);r.current.filtered.items.set(s,n),n>0&&h++}for(let[e,i]of s.current)for(let n of i)if(r.current.filtered.items.get(n)>0){r.current.filtered.groups.add(e);break}r.current.filtered.count=h}function A(){var e,i,r;let n=M();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(i=n.closest(uw))?void 0:i.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function M(){var e;return null==(e=x.current)?void 0:e.querySelector(`${uC}[aria-selected="true"]`)}function P(){var e;return Array.from((null==(e=x.current)?void 0:e.querySelectorAll(uk))||[])}function O(e){let i=P()[e];i&&k.setState("value",i.getAttribute(uR))}function B(e){var i;let r=M(),n=P(),s=n.findIndex(e=>e===r),o=n[s+e];null!=(i=l.current)&&i.loop&&(o=s+e<0?n[n.length-1]:s+e===n.length?n[0]:n[s+e]),o&&k.setState("value",o.getAttribute(uR))}function N(e){let i=M(),r=null==i?void 0:i.closest(uw),n;for(;r&&!n;)n=null==(r=e>0?function(e,i){let r=e.nextElementSibling;for(;r;){if(r.matches(i))return r;r=r.nextElementSibling}}(r,uw):function(e,i){let r=e.previousElementSibling;for(;r;){if(r.matches(i))return r;r=r.previousElementSibling}}(r,uw))?void 0:r.querySelector(uk);n?k.setState("value",n.getAttribute(uR)):B(e)}let I=()=>O(P().length-1),F=e=>{e.preventDefault(),e.metaKey?I():e.altKey?N(1):B(1)},z=e=>{e.preventDefault(),e.metaKey?O(0):e.altKey?N(-1):B(-1)};return m.createElement(uS.div,{ref:i,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:e=>{var i;null==(i=y.onKeyDown)||i.call(y,e);let r=e.nativeEvent.isComposing||229===e.keyCode;if(!(e.defaultPrevented||r))switch(e.key){case"n":case"j":v&&e.ctrlKey&&F(e);break;case"ArrowDown":F(e);break;case"p":case"k":v&&e.ctrlKey&&z(e);break;case"ArrowUp":z(e);break;case"Home":e.preventDefault(),O(0);break;case"End":e.preventDefault(),I();break;case"Enter":{e.preventDefault();let i=M();if(i){let e=new Event(uE);i.dispatchEvent(e)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:uK},c),uV(e,e=>m.createElement(uL.Provider,{value:k},m.createElement(uD.Provider,{value:E},e))))}),uP=m.forwardRef((e,i)=>{var r,n;let s=cH(),o=m.useRef(null),a=m.useContext(uA),l=m.useContext(uD),c=uH(e),h=null!=(n=null==(r=c.current)?void 0:r.forceMount)?n:null==a?void 0:a.forceMount;uj(()=>{if(!h)return l.item(s,null==a?void 0:a.id)},[h]);let u=uU(s,o,[e.value,e.children,o],e.keywords),d=m.useContext(uL),f=u$(e=>e.value&&e.value===u.current),p=u$(e=>!!h||!1===l.filter()||!e.search||e.filtered.items.get(s)>0);function g(){var e,i;_(),null==(i=(e=c.current).onSelect)||i.call(e,u.current)}function _(){d.setState("value",u.current,!0)}if(m.useEffect(()=>{let i=o.current;if(!(!i||e.disabled))return i.addEventListener(uE,g),()=>i.removeEventListener(uE,g)},[p,e.onSelect,e.disabled]),!p)return null;let{disabled:v,value:y,onSelect:b,forceMount:S,keywords:w,...x}=e;return m.createElement(uS.div,{ref:cB(o,i),...x,id:s,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!f,"data-disabled":!!v,"data-selected":!!f,onPointerMove:v||l.getDisablePointerSelection()?void 0:_,onClick:v?void 0:g},e.children)}),uO=m.forwardRef((e,i)=>{let{heading:r,children:n,forceMount:s,...o}=e,a=cH(),l=m.useRef(null),c=m.useRef(null),h=cH(),u=m.useContext(uD),d=u$(e=>!!s||!1===u.filter()||!e.search||e.filtered.groups.has(a));uj(()=>u.group(a),[]),uU(a,l,[e.value,e.heading,c]);let f=m.useMemo(()=>({id:a,forceMount:s}),[s]);return m.createElement(uS.div,{ref:cB(l,i),...o,"cmdk-group":"",role:"presentation",hidden:!d||void 0},r&&m.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:h},r),uV(e,e=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?h:void 0},m.createElement(uA.Provider,{value:f},e))))}),uB=m.forwardRef((e,i)=>{let{alwaysRender:r,...n}=e,s=m.useRef(null),o=u$(e=>!e.search);return r||o?m.createElement(uS.div,{ref:cB(s,i),...n,"cmdk-separator":"",role:"separator"}):null}),uN=m.forwardRef((e,i)=>{let{onValueChange:r,...n}=e,s=null!=e.value,o=m.useContext(uL),a=u$(e=>e.search),l=u$(e=>e.selectedItemId),c=m.useContext(uD);return m.useEffect(()=>{null!=e.value&&o.setState("search",e.value)},[e.value]),m.createElement(uS.input,{ref:i,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:s?e.value:a,onChange:e=>{s||o.setState("search",e.target.value),null==r||r(e.target.value)}})}),uI=m.forwardRef((e,i)=>{let{children:r,label:n="Suggestions",...s}=e,o=m.useRef(null),a=m.useRef(null),l=u$(e=>e.selectedItemId),c=m.useContext(uD);return m.useEffect(()=>{if(a.current&&o.current){let e=a.current,i=o.current,r,n=new ResizeObserver(()=>{r=requestAnimationFrame(()=>{let r=e.offsetHeight;i.style.setProperty("--cmdk-list-height",r.toFixed(1)+"px")})});return n.observe(e),()=>{cancelAnimationFrame(r),n.unobserve(e)}}},[]),m.createElement(uS.div,{ref:cB(o,i),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":n,id:c.listId},uV(e,e=>m.createElement("div",{ref:cB(a,c.listInnerRef),"cmdk-list-sizer":""},e)))}),uF=m.forwardRef((e,i)=>{let{open:r,onOpenChange:n,overlayClassName:s,contentClassName:o,container:a,...l}=e;return m.createElement(h2,{open:r,onOpenChange:n},m.createElement(h9,{container:a},m.createElement(h7,{"cmdk-overlay":"",className:s}),m.createElement(ur,{"aria-label":e.label,"cmdk-dialog":"",className:o},m.createElement(uM,{ref:i,...l}))))}),uz=Object.assign(uM,{List:uI,Item:uP,Input:uN,Group:uO,Separator:uB,Dialog:uF,Empty:m.forwardRef((e,i)=>u$(e=>0===e.filtered.count)?m.createElement(uS.div,{ref:i,...e,"cmdk-empty":"",role:"presentation"}):null),Loading:m.forwardRef((e,i)=>{let{progress:r,children:n,label:s="Loading...",...o}=e;return m.createElement(uS.div,{ref:i,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},uV(e,e=>m.createElement("div",{"aria-hidden":!0},e)))})});function uH(e){let i=m.useRef(e);return uj(()=>{i.current=e}),i}var uj="u"<typeof window?m.useEffect:m.useLayoutEffect;function uW(e){let i=m.useRef();return void 0===i.current&&(i.current=e()),i}function u$(e){let i=m.useContext(uL),r=()=>e(i.snapshot());return m.useSyncExternalStore(i.subscribe,r,r)}function uU(e,i,r,n=[]){let s=m.useRef(),o=m.useContext(uD);return uj(()=>{var a;let l=(()=>{var e;for(let i of r){if("string"==typeof i)return i.trim();if("object"==typeof i&&"current"in i)return i.current?null==(e=i.current.textContent)?void 0:e.trim():s.current}})(),c=n.map(e=>e.trim());o.value(e,l,c),null==(a=i.current)||a.setAttribute(uR,l),s.current=l}),s}var uq=()=>{let[e,i]=m.useState(),r=uW(()=>new Map);return uj(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),i({})}};function uV({asChild:e,children:i},r){let n;return e&&m.isValidElement(i)?m.cloneElement("function"==typeof(n=i.type)?n(i.props):"render"in n?n.render(i.props):i,{ref:i.ref},r(i.props.children)):r(i)}var uK={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};e.i(69068);var uY=e.i(25913),uX=e.i(10012);function uG({className:e,...i}){return(0,g.jsx)("textarea",{"data-slot":"textarea",className:(0,cC.cn)("flex field-sizing-content min-h-16 w-full resize-none rounded-md border border-input bg-input/20 px-2 py-2 text-sm transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 md:text-xs/relaxed dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...i})}function uJ({className:e,...i}){return(0,g.jsx)("div",{"data-slot":"input-group",role:"group",className:(0,cC.cn)("group/input-group relative flex h-7 w-full min-w-0 items-center rounded-md border border-input bg-input/20 transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-data-[align=block-end]:rounded-md has-data-[align=block-start]:rounded-md has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-2 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-2 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[textarea]:rounded-md has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",e),...i})}let uZ=(0,uY.cva)("flex h-auto cursor-text items-center justify-center gap-1 py-2 text-xs/relaxed font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:bg-muted-foreground/10 **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.275rem] has-[>kbd]:ml-[-0.275rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.275rem] has-[>kbd]:mr-[-0.275rem]","block-start":"order-first w-full justify-start px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function uQ({className:e,align:i="inline-start",...r}){return(0,g.jsx)("div",{role:"group","data-slot":"input-group-addon","data-align":i,className:(0,cC.cn)(uZ({align:i}),e),onClick:e=>{e.target.closest("button")||e.currentTarget.parentElement?.querySelector("input")?.focus()},...r})}(0,uY.cva)("flex items-center gap-2 rounded-md text-xs/relaxed shadow-none",{variants:{size:{xs:"h-5 gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1 [&>svg:not([class*='size-'])]:size-3",sm:"gap-1","icon-xs":"size-6 p-0 has-[>svg]:p-0","icon-sm":"size-7 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});let u0=(0,r0.default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["default",0,u0],54943);var u1=e.i(78745);e.s(["CheckIcon",()=>u1.default],78784);var u1=u1;function u2({className:e,...i}){return(0,g.jsx)(uz,{"data-slot":"command",className:(0,cC.cn)("flex size-full flex-col overflow-hidden rounded-xl bg-popover p-1 text-popover-foreground",e),...i})}function u5({className:e,...i}){return(0,g.jsx)("div",{"data-slot":"command-input-wrapper",className:"p-1 pb-0",children:(0,g.jsxs)(uJ,{className:"h-8! bg-input/20 dark:bg-input/30",children:[(0,g.jsx)(uz.Input,{"data-slot":"command-input",className:(0,cC.cn)("w-full text-xs/relaxed outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...i}),(0,g.jsx)(uQ,{children:(0,g.jsx)(u0,{className:"size-3.5 shrink-0 opacity-50"})})]})})}function u3({className:e,...i}){return(0,g.jsx)(uz.List,{"data-slot":"command-list",className:(0,cC.cn)("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",e),...i})}function u4({className:e,...i}){return(0,g.jsx)(uz.Empty,{"data-slot":"command-empty",className:(0,cC.cn)("py-6 text-center text-xs/relaxed",e),...i})}function u6({className:e,...i}){return(0,g.jsx)(uz.Group,{"data-slot":"command-group",className:(0,cC.cn)("overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2.5 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground",e),...i})}function u9({className:e,children:i,...r}){return(0,g.jsxs)(uz.Item,{"data-slot":"command-item",className:(0,cC.cn)("group/command-item relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2.5 py-1.5 text-xs/relaxed outline-hidden select-none in-data-[slot=dialog-content]:rounded-md data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-selected:*:[svg]:text-foreground",e),...r,children:[i,(0,g.jsx)(u1.default,{className:"ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"})]})}function u8({options:e,value:i,onChange:r,placeholder:n="Select option",disabled:s=!1,className:o="",allowCustomValue:a=!1,multiple:l=!1,onClear:c,showClearButton:h=!1}){let[u,d]=(0,m.useState)(!1),[f,p]=(0,m.useState)(""),_=(0,m.useRef)(null),v=(0,m.useMemo)(()=>Array.isArray(i)?i:[i],[i]),y=(0,m.useMemo)(()=>{if(l){if(1===v.length&&"all"===v[0]){let i=e.find(e=>"all"===e.value);return i?.label||""}return v.filter(e=>"all"!==e).map(i=>e.find(e=>e.value===i)?.label).filter(Boolean).join(", ")}return v.map(i=>e.find(e=>e.value===i)?.label).filter(Boolean).join(", ")},[v,e,l]),b=(0,m.useMemo)(()=>{let i={};for(let r of e){let e=r.group||"Other";i[e]||(i[e]=[]),i[e].push(r)}return i},[e]),S=(0,m.useMemo)(()=>Object.keys(b).length>1||!b.Other,[b]),w=e=>{if(l){let i=[...v],n=i.indexOf(e);n>=0?i.splice(n,1):i.push(e),r(i.length>0?i:[])}else r(e),d(!1)},x=()=>{a&&f&&!l&&(r(f),d(!1))};return(0,g.jsxs)(ck,{open:u,onOpenChange:e=>{d(e),e||p("")},children:[(0,g.jsxs)("div",{className:`relative ${o}`,children:[(0,g.jsx)(cE,{ref:_,disabled:s,className:`flex h-9 w-full items-center justify-between pl-3 ${h?"pr-16":"pr-10"} border border-input rounded-md text-sm bg-input/20 dark:bg-input/30 text-foreground transition-colors outline-none hover:border-ring focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 data-[state=open]:border-ring data-[state=open]:ring-2 data-[state=open]:ring-ring/30 disabled:opacity-50 disabled:cursor-not-allowed disabled:pointer-events-none cursor-pointer overflow-hidden text-ellipsis whitespace-nowrap text-left shadow-xs`,children:(0,g.jsx)("span",{className:"truncate",children:y||(0,g.jsx)("span",{className:"text-muted-foreground",children:n})})}),h&&c&&(0,g.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),c()},className:"absolute right-8 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors cursor-pointer z-10","aria-label":"Clear selection",children:(0,g.jsx)(ad.X,{className:"w-4 h-4"})}),(0,g.jsx)(au,{className:"absolute right-2 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground pointer-events-none"})]}),(0,g.jsx)(cR,{className:"w-[var(--anchor-width)] p-0",align:"start",sideOffset:4,children:(0,g.jsxs)(u2,{filter:(i,r)=>{let n=e.find(e=>e.value===i);return n?+!!`${n.label} ${n.group||""}`.toLowerCase().includes(r.toLowerCase()):0},children:[(0,g.jsx)(u5,{placeholder:"Search...",value:f,onValueChange:p,onKeyDown:e=>{"Enter"===e.key&&a&&x()}}),(0,g.jsxs)(u3,{children:[(0,g.jsx)(u4,{children:a&&f?(0,g.jsxs)("button",{type:"button",className:"w-full px-2 py-1.5 text-left text-xs cursor-pointer hover:bg-accent rounded",onClick:x,children:['Use "',f,'"']}):"No options found"}),S?Object.entries(b).map(([e,i])=>(0,g.jsx)(u6,{heading:e,children:i.map(e=>(0,g.jsx)(u9,{value:e.value,"data-checked":v.includes(e.value),onSelect:()=>w(e.value),children:(0,g.jsx)("span",{className:"truncate",children:e.label})},e.value))},e)):(0,g.jsx)(u6,{children:e.map(e=>(0,g.jsx)(u9,{value:e.value,"data-checked":v.includes(e.value),onSelect:()=>w(e.value),children:(0,g.jsx)("span",{className:"truncate",children:e.label})},e.value))})]})]})})]})}let u7=(0,r0.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);var de=e.i(86536),dt=e.i(70935);function di({value:e,onChange:i,editorRef:r,theme:n,activeTab:s,onTabChange:o,disabled:a,onFocusChange:l}){let c=(0,m.useCallback)(e=>{i(e??"")},[i]),h=(0,g.jsx)("div",{className:"border border-border rounded overflow-hidden h-full",children:(0,g.jsx)(_.Editor,{height:"100%",defaultLanguage:"markdown",value:e,onChange:c,onMount:e=>{r.current=e,e.layout(),e.onDidFocusEditorText(()=>l?.(!0)),e.onDidBlurEditorText(()=>l?.(!1))},options:{minimap:{enabled:!1},lineNumbers:"on",wordWrap:"on",fontSize:13,scrollBeyondLastLine:!1,readOnly:a},theme:"dark"===n?"vs-dark":"vs-light"})}),u=(0,g.jsx)("div",{className:"border border-border rounded overflow-y-auto h-full p-4 prose prose-sm prose-slate dark:prose-invert max-w-none",children:e?(0,g.jsx)(iW,{remarkPlugins:[rQ],components:as,children:e}):(0,g.jsx)("p",{className:"text-muted-foreground italic",children:"No content"})});return(0,g.jsxs)("div",{className:"flex flex-col flex-1 min-h-0",children:[(0,g.jsxs)("div",{className:"flex gap-1 mb-2 md:hidden flex-shrink-0",children:[(0,g.jsxs)(r3.Button,{type:"button",variant:"editor"===s?"default":"outline",size:"sm",onClick:()=>o("editor"),children:[(0,g.jsx)(u7,{className:"w-4 h-4 mr-1"}),"Editor"]}),(0,g.jsxs)(r3.Button,{type:"button",variant:"preview"===s?"default":"outline",size:"sm",onClick:()=>o("preview"),children:[(0,g.jsx)(de.Eye,{className:"w-4 h-4 mr-1"}),"Preview"]})]}),(0,g.jsxs)("div",{className:"hidden md:grid md:grid-cols-2 md:gap-4 flex-1 min-h-0",children:[h,u]}),(0,g.jsx)("div",{className:"md:hidden flex-1 min-h-0",children:"editor"===s?h:u})]})}e.s(["TaskDialog",0,function({mode:e,isOpen:i,onClose:r,repositories:n=[],task:s,onUpdate:o}){let a=ac(),[l,c]=(0,m.useState)(""),[h,u]=(0,m.useState)([]),[d,f]=(0,m.useState)(""),[p,_]=(0,m.useState)(!1),[v,y]=(0,m.useState)(""),[b,S]=(0,m.useState)({title:"",description:"",owner:"",repo:"",branch:"",baseBranch:"",status:"backlog",effort:void 0,order:void 0}),[w,x]=(0,m.useState)(!1),[C,k]=(0,m.useState)({}),[E,R]=(0,m.useState)("editor"),[T,D]=(0,m.useState)(!1),L=(0,m.useRef)(null),{effectiveTheme:A}=(0,ao.useTheme)();(0,m.useEffect)(()=>{"edit"===e&&s&&S({title:s.title,description:s.description,owner:s.owner,repo:s.repo,branch:s.branch,baseBranch:"",status:s.status,effort:s.effort,order:s.order})},[e,s,i]);let M=(0,m.useMemo)(()=>n.map(e=>({value:`${e.owner}/${e.repo}`,label:`${e.owner}/${e.repo}`})),[n]),P=(0,m.useMemo)(()=>h.map(e=>({value:e,label:e===d?`${e} (default)`:e})),[h,d]);(0,m.useEffect)(()=>{if("create"===e){if(!l){u([]),f(""),S(e=>({...e,baseBranch:""}));return}(async()=>{_(!0),y("");try{let[e,i]=l.split("/"),r=await fetch((0,dt.apiUrl)(`/api/repos/${e}/${i}/branches`));if(!r.ok)throw Error("Failed to fetch branches");let n=await r.json();u(n.data.branches),f(n.data.defaultBranch),S(e=>({...e,baseBranch:n.data.defaultBranch}))}catch(e){console.error("Failed to fetch branches:",e),y("Failed to load branches. Repository may not be initialized."),u([]),f("")}finally{_(!1)}})()}},[l,e]);let O=async i=>{if(i.preventDefault(),k({}),"create"===e){x(!0);try{let e=await fetch((0,dt.apiUrl)("/api/tasks/validate"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:b.title,owner:b.owner,repo:b.repo,branch:b.branch})}),i=await e.json();if(!i.valid){let e={};i.errors.forEach(i=>{e[i.field]=i.message}),k(e),x(!1);return}let n={title:b.title,description:b.description,owner:b.owner,repo:b.repo,branch:b.branch,baseBranch:b.baseBranch};r(),c(""),S({title:"",description:"",owner:"",repo:"",branch:"",baseBranch:"",status:"backlog",effort:void 0,order:void 0}),x(!1);let s=a.loading("Creating task...",n.title);try{if(!(await fetch((0,dt.apiUrl)("/api/tasks"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})).ok)throw Error("Failed to create task");a.dismiss(s)}catch(i){let e=i instanceof Error?i.message:"Unknown error";a.error(s,"Failed to create task",e)}}catch(i){x(!1);let e=i instanceof Error?i.message:"Validation failed";a.error(void 0,"Validation failed",e)}}else if("edit"===e&&o&&s){x(!0);try{let e=await o(s.id,{title:b.title,description:b.description,status:b.status,effort:b.effort,order:b.order});if(e.success)r();else if(e.errors){let i={};e.errors.forEach(e=>{i[e.field]=e.message}),k(i)}}catch(e){console.error("Failed to update task:",e),k({global:e instanceof Error?e.message:"Failed to update task. Please try again."})}finally{x(!1)}}},B="create"===e,N=B?"Add New Task":"Edit Task",I=B?"Create":"Save";return(0,g.jsxs)(ah.Dialog,{open:i,onOpenChange:e=>{e.open||w||r()},title:N,maxWidth:B?"2xl":"6xl",fullScreen:!B,showCloseButton:!w,dismissOnEsc:!T,children:[w&&(0,g.jsx)("div",{className:"absolute inset-0 bg-card bg-opacity-90 rounded-lg flex items-center justify-center z-10",children:(0,g.jsx)(aa.LoadingSpinner,{size:"lg",message:B?"Creating task...":"Saving task..."})}),C.global&&(0,g.jsx)("div",{className:"mb-4 p-3 bg-destructive/10 border border-destructive/50 rounded text-destructive text-sm",children:C.global}),(0,g.jsxs)("form",{onSubmit:O,className:B?"space-y-4":"flex flex-col gap-4 flex-1 min-h-0 overflow-hidden",children:[B&&(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Repository *"}),(0,g.jsx)(u8,{options:M,value:l,onChange:e=>{let i=Array.isArray(e)?e[0]||"":e;if(c(i),i){let[e,r]=i.split("/");S(i=>({...i,owner:e,repo:r,baseBranch:""}))}else S(e=>({...e,owner:"",repo:"",baseBranch:""}))},placeholder:"Select repository",disabled:w})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Title *"}),(0,g.jsx)(uX.Input,{type:"text",required:!0,maxLength:200,value:b.title,onChange:e=>S({...b,title:e.target.value}),className:"w-full",disabled:w})]}),!B&&s&&(0,g.jsxs)("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 p-3 bg-muted/50 rounded-md text-sm",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:"Repository"}),(0,g.jsxs)("p",{className:"text-muted-foreground",children:[s.owner,"/",s.repo]})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:"Branch"}),(0,g.jsx)("p",{className:"text-muted-foreground",children:s.branch})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:"Base Branch"}),(0,g.jsx)("p",{className:"text-muted-foreground",children:s.baseBranch||"N/A"})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:"Worktree"}),(0,g.jsx)("p",{className:"text-muted-foreground capitalize",children:s.worktreeStatus})]})]}),(0,g.jsxs)("div",{className:B?"":"flex flex-col flex-1 min-h-0",children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground flex-shrink-0",children:"Description"}),B?(0,g.jsx)(uG,{maxLength:5e3,value:b.description,onChange:e=>S({...b,description:e.target.value}),className:"min-h-24 w-full",disabled:w}):(0,g.jsx)(di,{value:b.description,onChange:e=>S(i=>({...i,description:e})),editorRef:L,theme:A,activeTab:E,onTabChange:R,disabled:w,onFocusChange:D})]}),!B&&(0,g.jsxs)("div",{className:"grid grid-cols-3 gap-4 flex-shrink-0",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Status"}),(0,g.jsxs)("select",{value:b.status,onChange:e=>S({...b,status:e.target.value}),className:"w-full h-9 pl-3 pr-10 py-1 rounded-md border border-input bg-transparent text-sm shadow-xs text-foreground",disabled:w,children:[(0,g.jsx)("option",{value:"backlog",children:"Backlog"}),(0,g.jsx)("option",{value:"planning",children:"Planning"}),(0,g.jsx)("option",{value:"tasking",children:"Tasking"}),(0,g.jsx)("option",{value:"coding",children:"Coding"}),(0,g.jsx)("option",{value:"reviewing",children:"Reviewing"}),(0,g.jsx)("option",{value:"done",children:"Done"})]})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Effort (h)"}),(0,g.jsx)(uX.Input,{type:"number",step:"0.5",min:"0.5",max:"40",value:b.effort??"",onChange:e=>S({...b,effort:parseFloat(e.target.value)||void 0}),className:"w-full",placeholder:"2.5",disabled:w})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Order"}),(0,g.jsx)(uX.Input,{type:"number",min:"0",value:b.order??"",onChange:e=>S({...b,order:parseInt(e.target.value)||void 0}),className:"w-full",placeholder:"0",disabled:w})]})]}),B&&(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Base Branch *"}),p?(0,g.jsxs)("div",{className:"w-full h-9 px-3 rounded-md border border-input bg-transparent text-muted-foreground flex items-center gap-2",children:[(0,g.jsx)(aa.LoadingSpinner,{size:"sm"}),(0,g.jsx)("span",{className:"text-xs",children:"Loading branches..."})]}):h.length>0?(0,g.jsx)(u8,{options:P,value:b.baseBranch,onChange:e=>{let i=Array.isArray(e)?e[0]||"":e;S({...b,baseBranch:i})},placeholder:"Select base branch",disabled:w}):(0,g.jsx)("div",{className:"w-full h-9 px-3 rounded-md border border-input bg-transparent text-sm text-muted-foreground flex items-center",children:v||"Select repository first"}),(0,g.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Your new branch will be created from this branch"})]}),B&&(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"New Branch Name *"}),(0,g.jsx)(uX.Input,{type:"text",required:!0,maxLength:255,value:b.branch,onChange:e=>S({...b,branch:e.target.value}),className:`w-full ${C.branch?"border-destructive":""}`,placeholder:"feature/new-feature",disabled:w,"aria-invalid":!!C.branch}),C.branch&&(0,g.jsx)("p",{className:"text-xs text-destructive mt-1",children:C.branch}),!C.branch&&(0,g.jsxs)("p",{className:"text-xs text-muted-foreground mt-1",children:["Will be created from ",b.baseBranch||"base branch"]})]}),(0,g.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,g.jsx)(r3.Button,{type:"button",variant:"outline",size:"lg",onClick:r,className:"active:scale-95",disabled:w,children:"Cancel"}),(0,g.jsx)(r3.Button,{type:"submit",size:"lg",className:"active:scale-95",disabled:w||B&&p,children:I})]})]})]})}],10483)},86311,e=>{"use strict";let i=(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,i],86311)},95468,73884,e=>{"use strict";var i=e.i(23287);e.s(["CheckCircle2",()=>i.default],95468);let r=(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,r],73884)},77814,e=>{"use strict";var i,r=e.i(18050);e.s([],33847),e.i(33847),e.i(47167);var n=e.i(71645),s=e.i(231),o=e.i(62372);let a=new Map;function l(e,i,r){return null==e?"":(function(e,i){let r=JSON.stringify({locale:e,options:i}),n=a.get(r);if(n)return n;let s=new Intl.NumberFormat(e,i);return a.set(r,s),s})(i,r).format(e)}var c=e.i(27601),h=e.i(67805);let u=n.createContext(void 0);function d(){let e=n.useContext(u);if(void 0===e)throw Error((0,h.default)(51));return e}let f=((i={}).complete="data-complete",i.indeterminate="data-indeterminate",i.progressing="data-progressing",i),p={status:e=>"progressing"===e?{[f.progressing]:""}:"complete"===e?{[f.complete]:""}:"indeterminate"===e?{[f.indeterminate]:""}:null};function g(e,i){return null==i?"indeterminate progress":e||`${i}%`}let m=n.forwardRef(function(e,i){var a;let{format:h,getAriaValueText:d=g,locale:f,max:m=100,min:_=0,value:v,render:y,className:b,children:S,...w}=e,[x,C]=n.useState(),k=(0,s.useValueAsRef)(h),E="indeterminate";Number.isFinite(v)&&(E=v===m?"complete":"progressing");let R=(a=k.current,null==v?"":a?l(v,f,a):l(v/100,f,{style:"percent"})),T=n.useMemo(()=>({status:E}),[E]),D={"aria-labelledby":x,"aria-valuemax":m,"aria-valuemin":_,"aria-valuenow":v??void 0,"aria-valuetext":d(R,v),role:"progressbar",children:(0,r.jsxs)(n.Fragment,{children:[S,(0,r.jsx)("span",{role:"presentation",style:o.visuallyHidden,children:"x"})]})},L=n.useMemo(()=>({formattedValue:R,max:m,min:_,setLabelId:C,state:T,status:E,value:v}),[R,m,_,C,T,E,v]),A=(0,c.useRenderElement)("div",e,{state:T,ref:i,props:[D,w],stateAttributesMapping:p});return(0,r.jsx)(u.Provider,{value:L,children:A})}),_=n.forwardRef(function(e,i){let{render:r,className:n,...s}=e,{state:o}=d();return(0,c.useRenderElement)("div",e,{state:o,ref:i,props:s,stateAttributesMapping:p})}),v=n.forwardRef(function(e,i){let{render:r,className:s,...o}=e,{max:a,min:l,value:h,state:u}=d(),f=Number.isFinite(h)&&null!==h?(h-l)*100/(a-l):null,g=n.useCallback(()=>null==f?{}:{insetInlineStart:0,height:"inherit",width:`${f}%`},[f]);return(0,c.useRenderElement)("div",e,{state:u,ref:i,props:[{style:g()},o],stateAttributesMapping:p})}),y=n.forwardRef(function(e,i){let{className:r,render:n,children:s,...o}=e,{value:a,formattedValue:l,state:h}=d(),u=null==a?"indeterminate":l,f=null==a?null:l;return(0,c.useRenderElement)("span",e,{state:h,ref:i,props:[{"aria-hidden":!0,children:"function"==typeof s?s(u,a):f},o],stateAttributesMapping:p})});var b=e.i(24564);let S=n.forwardRef(function(e,i){let{render:r,className:n,id:s,...o}=e,{setLabelId:a,state:l}=d(),h=(0,b.useRegisteredLabelId)(s,a);return(0,c.useRenderElement)("span",e,{state:l,ref:i,props:[{id:h,role:"presentation"},o],stateAttributesMapping:p})});e.s(["Indicator",0,v,"Label",0,S,"Root",0,m,"Track",0,_,"Value",0,y],45929);var w=e.i(45929),w=w,x=e.i(52088);function C({className:e,...i}){return(0,r.jsx)(w.Track,{className:(0,x.cn)("relative flex h-1 w-full items-center overflow-x-hidden rounded-md bg-muted",e),"data-slot":"progress-track",...i})}function k({className:e,...i}){return(0,r.jsx)(w.Indicator,{"data-slot":"progress-indicator",className:(0,x.cn)("h-full bg-primary",e),style:{transition:"width 500ms ease-in-out"},...i})}e.s(["Progress",0,function({className:e,children:i,value:n,...s}){return(0,r.jsxs)(w.Root,{value:n,"data-slot":"progress",className:(0,x.cn)("flex flex-wrap gap-3",e),...s,children:[i,(0,r.jsx)(C,{children:(0,r.jsx)(k,{})})]})}],77814)},48214,31245,e=>{"use strict";var i=e.i(75254);let r=(0,i.default)("circle-pause",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]]);e.s(["CirclePause",0,r],48214);let n=(0,i.default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);e.s(["Bot",0,n],31245)},68054,e=>{"use strict";let i=(0,e.i(75254).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",0,i],68054)},57212,e=>{"use strict";let i=(0,e.i(75254).default)("wifi-off",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);e.s(["WifiOff",0,i],57212)},30939,99894,93309,e=>{"use strict";let i,r,n,s,o,a,l,c,h,u,d,f;var p=e.i(18050),g=e.i(71645),m=e.i(37727),_=e.i(31278),v=e.i(48214),y=e.i(31245),b=e.i(68054),S=e.i(63209),w=e.i(57212),x=e.i(95468),C=e.i(73884),k=e.i(86311),E=e.i(68995),R=e.i(85902);function T({entry:e}){if(!e||"idle"===e.terminal)return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,p.jsx)(v.CirclePause,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"idle"})]});if("connecting"===e.terminal)return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,p.jsx)(_.Loader2,{className:"w-3 h-3 animate-spin"}),(0,p.jsx)("span",{children:"connecting"})]});if("error"===e.terminal)return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-destructive",children:[(0,p.jsx)(S.AlertCircle,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"error"})]});if("exited"===e.terminal||"paused"===e.terminal)return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,p.jsx)(w.WifiOff,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:e.terminal})]});switch(e.claude){case"running":return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-primary",children:[(0,p.jsx)(_.Loader2,{className:"w-3 h-3 animate-spin"}),(0,p.jsx)("span",{children:"running"})]});case"waiting":return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-warning",children:[(0,p.jsx)(k.MessageSquare,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"waiting"})]});case"success":return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-success",children:[(0,p.jsx)(x.CheckCircle2,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"success"})]});case"failure":case"error":return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-destructive",children:[(0,p.jsx)(C.XCircle,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"failure"===e.claude?"failure":"error"})]});default:return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,p.jsx)(v.CirclePause,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"idle"})]})}}e.s(["SessionTabs",0,function({tabs:e,activeTabId:i,onTabChange:r,onTabCreateTerminal:n,onTabCreateClaude:s,onTabDelete:o,tabStatusMap:a}){let l=(0,g.useRef)([]),[c,h]=(0,g.useState)({left:0,width:0}),[u,d]=(0,g.useState)(null);(0,g.useEffect)(()=>{let r=e.findIndex(e=>e.tab_id===i);if(-1!==r&&l.current[r]){let e=l.current[r];e&&h({left:e.offsetLeft,width:e.offsetWidth})}},[i,e]);let f=new Map,_=0;for(let i of e)"terminal"===i.mode&&(_+=1,f.set(i.tab_id,_));return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(E.ConfirmDialog,{open:null!==u,onOpenChange:e=>{e.open||d(null)},title:"Delete Tab",message:u?.isRunning?"This tab is running. Are you sure you want to delete it?":"Delete this tab?",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{u&&o(u.tabId)},variant:"danger"}),(0,p.jsxs)("div",{className:"relative flex items-center gap-2 overflow-x-auto border-b border-border pb-1",children:[e.map((n,s)=>{let o=i===n.tab_id,c=a?.get(n.tab_id),h=(c?.claude==="running"||c?.claude==="waiting")&&c?.terminal==="connected";return(0,p.jsxs)("div",{ref:e=>{l.current[s]=e},onClick:()=>r(n.tab_id),className:`
12
12
  flex items-center gap-2 px-4 pt-1 pb-2 h-10 flex-shrink-0 transition-colors cursor-pointer
13
13
  ${o?"text-primary":h?"text-primary-light":"text-muted-foreground hover:text-foreground"}
14
- `,children:[(0,p.jsx)("div",{className:"font-medium flex items-center gap-2",children:(0,p.jsx)(T,{entry:c})}),e.length>1&&(0,p.jsx)(R.Button,{variant:"ghost",size:"icon-xs",onClick:e=>{e.stopPropagation(),d({tabId:n.tab_id,isRunning:h})},children:(0,p.jsx)(m.X,{className:"w-4 h-4"})})]},n.tab_id)}),(0,p.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0 ml-auto",children:[(0,p.jsx)("div",{className:"w-px self-stretch bg-theme"}),n&&(0,p.jsx)(R.Button,{size:"icon",onClick:n,title:"Open terminal",children:(0,p.jsx)(b.Terminal,{className:"w-4 h-4"})}),(0,p.jsx)(R.Button,{size:"icon",onClick:s,title:"Open terminal with Claude",children:(0,p.jsx)(y.Bot,{className:"w-4 h-4"})})]}),(0,p.jsx)("div",{className:"absolute bottom-0 h-0.5 bg-primary transition-[left,width]",style:{left:`${c.left}px`,width:`${c.width}px`}})]})]})}],30939);var D=e.i(47167),L=Object.defineProperty,A=Object.getOwnPropertyDescriptor,M=(e,i,r,n)=>{for(var s,o=n>1?void 0:n?A(i,r):i,a=e.length-1;a>=0;a--)(s=e[a])&&(o=(n?s(i,r,o):s(o))||o);return n&&o&&L(i,r,o),o},P=(e,i)=>(r,n)=>i(r,n,e),O="Terminal input",B="Too much output to announce, navigate to rows manually to read";function N(e,i,r,n){var s;s=e=e.replace(/\r?\n/g,"\r"),e=r.decPrivateModes.bracketedPasteMode&&!0!==n.rawOptions.ignoreBracketedPasteMode?"\x1b[200~"+s+"\x1b[201~":s,r.triggerDataEvent(e,!0),i.value=""}function I(e,i,r){let n=r.getBoundingClientRect(),s=e.clientX-n.left-10,o=e.clientY-n.top-10;i.style.width="20px",i.style.height="20px",i.style.left=`${s}px`,i.style.top=`${o}px`,i.style.zIndex="1000",i.focus()}function F(e,i,r,n,s){I(e,i,r),s&&n.rightClickSelect(e),i.value=n.selectionText,i.select()}function z(e){return e>65535?String.fromCharCode(((e-=65536)>>10)+55296)+String.fromCharCode(e%1024+56320):String.fromCharCode(e)}function H(e,i=0,r=e.length){let n="";for(let s=i;s<r;++s){let i=e[s];i>65535?(i-=65536,n+=String.fromCharCode((i>>10)+55296)+String.fromCharCode(i%1024+56320)):n+=String.fromCharCode(i)}return n}var j=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,i){let r=e.length;if(!r)return 0;let n=0,s=0;if(this._interim){let r=e.charCodeAt(s++);56320<=r&&r<=57343?i[n++]=(this._interim-55296)*1024+r-56320+65536:(i[n++]=this._interim,i[n++]=r),this._interim=0}for(let o=s;o<r;++o){let s=e.charCodeAt(o);if(55296<=s&&s<=56319){if(++o>=r)return this._interim=s,n;let a=e.charCodeAt(o);56320<=a&&a<=57343?i[n++]=(s-55296)*1024+a-56320+65536:(i[n++]=s,i[n++]=a);continue}65279!==s&&(i[n++]=s)}return n}},W=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,i){let r=e.length;if(!r)return 0;let n=0,s,o,a,l,c=0,h=0;if(this.interim[0]){let s=!1,o=this.interim[0];o&=(224&o)==192?31:(240&o)==224?15:7;let a=0,l;for(;(l=63&this.interim[++a])&&a<4;)o<<=6,o|=l;let c=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,u=c-a;for(;h<u;){if(h>=r)return 0;if((192&(l=e[h++]))!=128){h--,s=!0;break}this.interim[a++]=l,o<<=6,o|=63&l}s||(2===c?o<128?h--:i[n++]=o:3===c?o<2048||o>=55296&&o<=57343||65279===o||(i[n++]=o):o<65536||o>1114111||(i[n++]=o)),this.interim.fill(0)}let u=r-4,d=h;for(;d<r;){for(;d<u&&!(128&(s=e[d]))&&!(128&(o=e[d+1]))&&!(128&(a=e[d+2]))&&!(128&(l=e[d+3]));)i[n++]=s,i[n++]=o,i[n++]=a,i[n++]=l,d+=4;if((s=e[d++])<128)i[n++]=s;else if((224&s)==192){if(d>=r)return this.interim[0]=s,n;if((192&(o=e[d++]))!=128||(c=(31&s)<<6|63&o)<128){d--;continue}i[n++]=c}else if((240&s)==224){if(d>=r)return this.interim[0]=s,n;if((192&(o=e[d++]))!=128){d--;continue}if(d>=r)return this.interim[0]=s,this.interim[1]=o,n;if((192&(a=e[d++]))!=128){d--;continue}if((c=(15&s)<<12|(63&o)<<6|63&a)<2048||c>=55296&&c<=57343||65279===c)continue;i[n++]=c}else if((248&s)==240){if(d>=r)return this.interim[0]=s,n;if((192&(o=e[d++]))!=128){d--;continue}if(d>=r)return this.interim[0]=s,this.interim[1]=o,n;if((192&(a=e[d++]))!=128){d--;continue}if(d>=r)return this.interim[0]=s,this.interim[1]=o,this.interim[2]=a,n;if((192&(l=e[d++]))!=128){d--;continue}if((c=(7&s)<<18|(63&o)<<12|(63&a)<<6|63&l)<65536||c>1114111)continue;i[n++]=c}}return n}},$=class e{constructor(){this.fg=0,this.bg=0,this.extended=new U}static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}clone(){let i=new e;return i.fg=this.fg,i.bg=this.bg,i.extended=this.extended.clone(),i}isInverse(){return 0x4000000&this.fg}isBold(){return 0x8000000&this.fg}isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underlineStyle?1:0x10000000&this.fg}isBlink(){return 0x20000000&this.fg}isInvisible(){return 0x40000000&this.fg}isItalic(){return 0x4000000&this.bg}isDim(){return 0x8000000&this.bg}isStrikethrough(){return 0x80000000&this.fg}isProtected(){return 0x20000000&this.bg}isOverline(){return 0x40000000&this.bg}getFgColorMode(){return 0x3000000&this.fg}getBgColorMode(){return 0x3000000&this.bg}isFgRGB(){return(0x3000000&this.fg)==0x3000000}isBgRGB(){return(0x3000000&this.bg)==0x3000000}isFgPalette(){return(0x3000000&this.fg)==0x1000000||(0x3000000&this.fg)==0x2000000}isBgPalette(){return(0x3000000&this.bg)==0x1000000||(0x3000000&this.bg)==0x2000000}isFgDefault(){return(0x3000000&this.fg)==0}isBgDefault(){return(0x3000000&this.bg)==0}isAttributeDefault(){return 0===this.fg&&0===this.bg}getFgColor(){switch(0x3000000&this.fg){case 0x1000000:case 0x2000000:return 255&this.fg;case 0x3000000:return 0xffffff&this.fg;default:return -1}}getBgColor(){switch(0x3000000&this.bg){case 0x1000000:case 0x2000000:return 255&this.bg;case 0x3000000:return 0xffffff&this.bg;default:return -1}}hasExtendedAttrs(){return 0x10000000&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-0x10000001:this.bg|=0x10000000}getUnderlineColor(){if(0x10000000&this.bg&&~this.extended.underlineColor)switch(0x3000000&this.extended.underlineColor){case 0x1000000:case 0x2000000:return 255&this.extended.underlineColor;case 0x3000000:return 0xffffff&this.extended.underlineColor}return this.getFgColor()}getUnderlineColorMode(){return 0x10000000&this.bg&&~this.extended.underlineColor?0x3000000&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0x3000000:this.isFgRGB()}isUnderlineColorPalette(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0x1000000||(0x3000000&this.extended.underlineColor)==0x2000000:this.isFgPalette()}isUnderlineColorDefault(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 0x10000000&this.fg?0x10000000&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},U=class e{constructor(e=0,i=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=i}get ext(){return this._urlId?-0x1c000001&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(0x1c000000&this._ext)>>26}set underlineStyle(e){this._ext&=-0x1c000001,this._ext|=e<<26&0x1c000000}get underlineColor(){return 0x3ffffff&this._ext}set underlineColor(e){this._ext&=-0x4000000,this._ext|=0x3ffffff&e}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(0xe0000000&this._ext)>>29;return e<0?0xfffffff8^e:e}set underlineVariantOffset(e){this._ext&=0x1fffffff,this._ext|=e<<29&0xe0000000}clone(){return new e(this._ext,this._urlId)}isEmpty(){return 0===this.underlineStyle&&0===this._urlId}},q=class e extends ${constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new U,this.combinedData=""}static fromCharData(i){let r=new e;return r.setFromCharData(i),r}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?z(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(e){this.fg=e[0],this.bg=0;let i=!1;if(e[1].length>2)i=!0;else if(2===e[1].length){let r=e[1].charCodeAt(0);if(55296<=r&&r<=56319){let n=e[1].charCodeAt(1);56320<=n&&n<=57343?this.content=(r-55296)*1024+n-56320+65536|e[2]<<22:i=!0}else i=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;i&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},V="di$target",K="di$dependencies",Y=new Map;function X(e){if(Y.has(e))return Y.get(e);let i=function(e,r,n){var s,o,a;if(3!=arguments.length)throw Error("@IServiceName-decorator can only be used to decorate a parameter");s=i,o=e,a=n,o[V]===o?o[K].push({id:s,index:a}):(o[K]=[{id:s,index:a}],o[V]=o)};return i._id=e,Y.set(e,i),i}var G=X("BufferService"),J=X("CoreMouseService"),Z=X("CoreService"),Q=X("CharsetService"),ee=X("InstantiationService"),et=X("LogService"),ei=X("OptionsService"),er=X("OscLinkService"),en=X("UnicodeService"),es=X("DecorationService"),eo=class{constructor(e,i,r){this._bufferService=e,this._optionsService=i,this._oscLinkService=r}provideLinks(e,i){let r=this._bufferService.buffer.lines.get(e-1);if(!r)return void i(void 0);let n=[],s=this._optionsService.rawOptions.linkHandler,o=new q,a=r.getTrimmedLength(),l=-1,c=-1,h=!1;for(let i=0;i<a;i++)if(!(-1===c&&!r.hasContent(i))){if(r.loadCell(i,o),o.hasExtendedAttrs()&&o.extended.urlId)if(-1===c){c=i,l=o.extended.urlId;continue}else h=o.extended.urlId!==l;else -1!==c&&(h=!0);if(h||-1!==c&&i===a-1){let r=this._oscLinkService.getLinkData(l)?.uri;if(r){let o={start:{x:c+1,y:e},end:{x:i+ +(!h&&i===a-1),y:e}},l=!1;if(!s?.allowNonHttpProtocols)try{let e=new URL(r);["http:","https:"].includes(e.protocol)||(l=!0)}catch{l=!0}l||n.push({text:r,range:o,activate:(e,i)=>s?s.activate(e,i,o):function(e){if(confirm(`Do you want to navigate to ${e}?
14
+ `,children:[(0,p.jsx)("div",{className:"font-medium flex items-center gap-2",children:"terminal"===n.mode?(0,p.jsxs)("span",{className:"text-xs",children:["terminal ",f.get(n.tab_id)]}):(0,p.jsx)(T,{entry:c})}),e.length>1&&(0,p.jsx)(R.Button,{variant:"ghost",size:"icon-xs",onClick:e=>{e.stopPropagation(),d({tabId:n.tab_id,isRunning:h})},children:(0,p.jsx)(m.X,{className:"w-4 h-4"})})]},n.tab_id)}),(0,p.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0 ml-auto",children:[(0,p.jsx)("div",{className:"w-px self-stretch bg-theme"}),n&&(0,p.jsx)(R.Button,{size:"icon",onClick:n,title:"Open terminal",children:(0,p.jsx)(b.Terminal,{className:"w-4 h-4"})}),(0,p.jsx)(R.Button,{size:"icon",onClick:s,title:"Open terminal with Claude",children:(0,p.jsx)(y.Bot,{className:"w-4 h-4"})})]}),(0,p.jsx)("div",{className:"absolute bottom-0 h-0.5 bg-primary transition-[left,width]",style:{left:`${c.left}px`,width:`${c.width}px`}})]})]})}],30939);var D=e.i(47167),L=Object.defineProperty,A=Object.getOwnPropertyDescriptor,M=(e,i,r,n)=>{for(var s,o=n>1?void 0:n?A(i,r):i,a=e.length-1;a>=0;a--)(s=e[a])&&(o=(n?s(i,r,o):s(o))||o);return n&&o&&L(i,r,o),o},P=(e,i)=>(r,n)=>i(r,n,e),O="Terminal input",B="Too much output to announce, navigate to rows manually to read";function N(e,i,r,n){var s;s=e=e.replace(/\r?\n/g,"\r"),e=r.decPrivateModes.bracketedPasteMode&&!0!==n.rawOptions.ignoreBracketedPasteMode?"\x1b[200~"+s+"\x1b[201~":s,r.triggerDataEvent(e,!0),i.value=""}function I(e,i,r){let n=r.getBoundingClientRect(),s=e.clientX-n.left-10,o=e.clientY-n.top-10;i.style.width="20px",i.style.height="20px",i.style.left=`${s}px`,i.style.top=`${o}px`,i.style.zIndex="1000",i.focus()}function F(e,i,r,n,s){I(e,i,r),s&&n.rightClickSelect(e),i.value=n.selectionText,i.select()}function z(e){return e>65535?String.fromCharCode(((e-=65536)>>10)+55296)+String.fromCharCode(e%1024+56320):String.fromCharCode(e)}function H(e,i=0,r=e.length){let n="";for(let s=i;s<r;++s){let i=e[s];i>65535?(i-=65536,n+=String.fromCharCode((i>>10)+55296)+String.fromCharCode(i%1024+56320)):n+=String.fromCharCode(i)}return n}var j=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,i){let r=e.length;if(!r)return 0;let n=0,s=0;if(this._interim){let r=e.charCodeAt(s++);56320<=r&&r<=57343?i[n++]=(this._interim-55296)*1024+r-56320+65536:(i[n++]=this._interim,i[n++]=r),this._interim=0}for(let o=s;o<r;++o){let s=e.charCodeAt(o);if(55296<=s&&s<=56319){if(++o>=r)return this._interim=s,n;let a=e.charCodeAt(o);56320<=a&&a<=57343?i[n++]=(s-55296)*1024+a-56320+65536:(i[n++]=s,i[n++]=a);continue}65279!==s&&(i[n++]=s)}return n}},W=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,i){let r=e.length;if(!r)return 0;let n=0,s,o,a,l,c=0,h=0;if(this.interim[0]){let s=!1,o=this.interim[0];o&=(224&o)==192?31:(240&o)==224?15:7;let a=0,l;for(;(l=63&this.interim[++a])&&a<4;)o<<=6,o|=l;let c=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,u=c-a;for(;h<u;){if(h>=r)return 0;if((192&(l=e[h++]))!=128){h--,s=!0;break}this.interim[a++]=l,o<<=6,o|=63&l}s||(2===c?o<128?h--:i[n++]=o:3===c?o<2048||o>=55296&&o<=57343||65279===o||(i[n++]=o):o<65536||o>1114111||(i[n++]=o)),this.interim.fill(0)}let u=r-4,d=h;for(;d<r;){for(;d<u&&!(128&(s=e[d]))&&!(128&(o=e[d+1]))&&!(128&(a=e[d+2]))&&!(128&(l=e[d+3]));)i[n++]=s,i[n++]=o,i[n++]=a,i[n++]=l,d+=4;if((s=e[d++])<128)i[n++]=s;else if((224&s)==192){if(d>=r)return this.interim[0]=s,n;if((192&(o=e[d++]))!=128||(c=(31&s)<<6|63&o)<128){d--;continue}i[n++]=c}else if((240&s)==224){if(d>=r)return this.interim[0]=s,n;if((192&(o=e[d++]))!=128){d--;continue}if(d>=r)return this.interim[0]=s,this.interim[1]=o,n;if((192&(a=e[d++]))!=128){d--;continue}if((c=(15&s)<<12|(63&o)<<6|63&a)<2048||c>=55296&&c<=57343||65279===c)continue;i[n++]=c}else if((248&s)==240){if(d>=r)return this.interim[0]=s,n;if((192&(o=e[d++]))!=128){d--;continue}if(d>=r)return this.interim[0]=s,this.interim[1]=o,n;if((192&(a=e[d++]))!=128){d--;continue}if(d>=r)return this.interim[0]=s,this.interim[1]=o,this.interim[2]=a,n;if((192&(l=e[d++]))!=128){d--;continue}if((c=(7&s)<<18|(63&o)<<12|(63&a)<<6|63&l)<65536||c>1114111)continue;i[n++]=c}}return n}},$=class e{constructor(){this.fg=0,this.bg=0,this.extended=new U}static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}clone(){let i=new e;return i.fg=this.fg,i.bg=this.bg,i.extended=this.extended.clone(),i}isInverse(){return 0x4000000&this.fg}isBold(){return 0x8000000&this.fg}isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underlineStyle?1:0x10000000&this.fg}isBlink(){return 0x20000000&this.fg}isInvisible(){return 0x40000000&this.fg}isItalic(){return 0x4000000&this.bg}isDim(){return 0x8000000&this.bg}isStrikethrough(){return 0x80000000&this.fg}isProtected(){return 0x20000000&this.bg}isOverline(){return 0x40000000&this.bg}getFgColorMode(){return 0x3000000&this.fg}getBgColorMode(){return 0x3000000&this.bg}isFgRGB(){return(0x3000000&this.fg)==0x3000000}isBgRGB(){return(0x3000000&this.bg)==0x3000000}isFgPalette(){return(0x3000000&this.fg)==0x1000000||(0x3000000&this.fg)==0x2000000}isBgPalette(){return(0x3000000&this.bg)==0x1000000||(0x3000000&this.bg)==0x2000000}isFgDefault(){return(0x3000000&this.fg)==0}isBgDefault(){return(0x3000000&this.bg)==0}isAttributeDefault(){return 0===this.fg&&0===this.bg}getFgColor(){switch(0x3000000&this.fg){case 0x1000000:case 0x2000000:return 255&this.fg;case 0x3000000:return 0xffffff&this.fg;default:return -1}}getBgColor(){switch(0x3000000&this.bg){case 0x1000000:case 0x2000000:return 255&this.bg;case 0x3000000:return 0xffffff&this.bg;default:return -1}}hasExtendedAttrs(){return 0x10000000&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-0x10000001:this.bg|=0x10000000}getUnderlineColor(){if(0x10000000&this.bg&&~this.extended.underlineColor)switch(0x3000000&this.extended.underlineColor){case 0x1000000:case 0x2000000:return 255&this.extended.underlineColor;case 0x3000000:return 0xffffff&this.extended.underlineColor}return this.getFgColor()}getUnderlineColorMode(){return 0x10000000&this.bg&&~this.extended.underlineColor?0x3000000&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0x3000000:this.isFgRGB()}isUnderlineColorPalette(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0x1000000||(0x3000000&this.extended.underlineColor)==0x2000000:this.isFgPalette()}isUnderlineColorDefault(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 0x10000000&this.fg?0x10000000&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},U=class e{constructor(e=0,i=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=i}get ext(){return this._urlId?-0x1c000001&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(0x1c000000&this._ext)>>26}set underlineStyle(e){this._ext&=-0x1c000001,this._ext|=e<<26&0x1c000000}get underlineColor(){return 0x3ffffff&this._ext}set underlineColor(e){this._ext&=-0x4000000,this._ext|=0x3ffffff&e}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(0xe0000000&this._ext)>>29;return e<0?0xfffffff8^e:e}set underlineVariantOffset(e){this._ext&=0x1fffffff,this._ext|=e<<29&0xe0000000}clone(){return new e(this._ext,this._urlId)}isEmpty(){return 0===this.underlineStyle&&0===this._urlId}},q=class e extends ${constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new U,this.combinedData=""}static fromCharData(i){let r=new e;return r.setFromCharData(i),r}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?z(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(e){this.fg=e[0],this.bg=0;let i=!1;if(e[1].length>2)i=!0;else if(2===e[1].length){let r=e[1].charCodeAt(0);if(55296<=r&&r<=56319){let n=e[1].charCodeAt(1);56320<=n&&n<=57343?this.content=(r-55296)*1024+n-56320+65536|e[2]<<22:i=!0}else i=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;i&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},V="di$target",K="di$dependencies",Y=new Map;function X(e){if(Y.has(e))return Y.get(e);let i=function(e,r,n){var s,o,a;if(3!=arguments.length)throw Error("@IServiceName-decorator can only be used to decorate a parameter");s=i,o=e,a=n,o[V]===o?o[K].push({id:s,index:a}):(o[K]=[{id:s,index:a}],o[V]=o)};return i._id=e,Y.set(e,i),i}var G=X("BufferService"),J=X("CoreMouseService"),Z=X("CoreService"),Q=X("CharsetService"),ee=X("InstantiationService"),et=X("LogService"),ei=X("OptionsService"),er=X("OscLinkService"),en=X("UnicodeService"),es=X("DecorationService"),eo=class{constructor(e,i,r){this._bufferService=e,this._optionsService=i,this._oscLinkService=r}provideLinks(e,i){let r=this._bufferService.buffer.lines.get(e-1);if(!r)return void i(void 0);let n=[],s=this._optionsService.rawOptions.linkHandler,o=new q,a=r.getTrimmedLength(),l=-1,c=-1,h=!1;for(let i=0;i<a;i++)if(!(-1===c&&!r.hasContent(i))){if(r.loadCell(i,o),o.hasExtendedAttrs()&&o.extended.urlId)if(-1===c){c=i,l=o.extended.urlId;continue}else h=o.extended.urlId!==l;else -1!==c&&(h=!0);if(h||-1!==c&&i===a-1){let r=this._oscLinkService.getLinkData(l)?.uri;if(r){let o={start:{x:c+1,y:e},end:{x:i+ +(!h&&i===a-1),y:e}},l=!1;if(!s?.allowNonHttpProtocols)try{let e=new URL(r);["http:","https:"].includes(e.protocol)||(l=!0)}catch{l=!0}l||n.push({text:r,range:o,activate:(e,i)=>s?s.activate(e,i,o):function(e){if(confirm(`Do you want to navigate to ${e}?
15
15
 
16
16
  WARNING: This link could potentially be dangerous`)){let i=window.open();if(i){try{i.opener=null}catch{}i.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}}(i),hover:(e,i)=>s?.hover?.(e,i,o),leave:(e,i)=>s?.leave?.(e,i,o)})}h=!1,o.hasExtendedAttrs()&&o.extended.urlId?(c=i,l=o.extended.urlId):(c=-1,l=-1)}}i(n)}};eo=M([P(0,G),P(1,ei),P(2,er)],eo);var ea=X("CharSizeService"),el=X("CoreBrowserService"),ec=X("MouseService"),eh=X("RenderService"),eu=X("SelectionService"),ed=X("CharacterJoinerService"),ef=X("ThemeService"),ep=X("LinkProviderService"),eg=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?ey.isErrorNoTelemetry(e)?new ey(e.message+`
17
17