@claudeye/linux-arm64 1.0.8 → 1.0.9

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 (128) hide show
  1. package/assets/standalone/.next/BUILD_ID +1 -1
  2. package/assets/standalone/.next/build-manifest.json +3 -3
  3. package/assets/standalone/.next/prerender-manifest.json +3 -3
  4. package/assets/standalone/.next/server/app/_global-error/page/server-reference-manifest.json +1 -1
  5. package/assets/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  6. package/assets/standalone/.next/server/app/_global-error.html +1 -1
  7. package/assets/standalone/.next/server/app/_global-error.rsc +7 -7
  8. package/assets/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
  9. package/assets/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
  10. package/assets/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +3 -3
  11. package/assets/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
  12. package/assets/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  13. package/assets/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +2 -2
  14. package/assets/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  15. package/assets/standalone/.next/server/app/_not-found.html +2 -2
  16. package/assets/standalone/.next/server/app/_not-found.rsc +15 -15
  17. package/assets/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +15 -15
  18. package/assets/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  19. package/assets/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +10 -10
  20. package/assets/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  21. package/assets/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  22. package/assets/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  23. package/assets/standalone/.next/server/app/dashboard/[viewName]/page/server-reference-manifest.json +5 -5
  24. package/assets/standalone/.next/server/app/dashboard/[viewName]/page_client-reference-manifest.js +1 -1
  25. package/assets/standalone/.next/server/app/dashboard/page/server-reference-manifest.json +5 -5
  26. package/assets/standalone/.next/server/app/dashboard/page_client-reference-manifest.js +1 -1
  27. package/assets/standalone/.next/server/app/index.html +1 -1
  28. package/assets/standalone/.next/server/app/index.rsc +15 -15
  29. package/assets/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  30. package/assets/standalone/.next/server/app/index.segments/_full.segment.rsc +15 -15
  31. package/assets/standalone/.next/server/app/index.segments/_head.segment.rsc +4 -4
  32. package/assets/standalone/.next/server/app/index.segments/_index.segment.rsc +10 -10
  33. package/assets/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  34. package/assets/standalone/.next/server/app/login/page/server-reference-manifest.json +3 -3
  35. package/assets/standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
  36. package/assets/standalone/.next/server/app/login.html +2 -2
  37. package/assets/standalone/.next/server/app/login.rsc +17 -17
  38. package/assets/standalone/.next/server/app/login.segments/_full.segment.rsc +17 -17
  39. package/assets/standalone/.next/server/app/login.segments/_head.segment.rsc +4 -4
  40. package/assets/standalone/.next/server/app/login.segments/_index.segment.rsc +10 -10
  41. package/assets/standalone/.next/server/app/login.segments/_tree.segment.rsc +1 -1
  42. package/assets/standalone/.next/server/app/login.segments/login/__PAGE__.segment.rsc +4 -4
  43. package/assets/standalone/.next/server/app/login.segments/login.segment.rsc +3 -3
  44. package/assets/standalone/.next/server/app/page/server-reference-manifest.json +2 -2
  45. package/assets/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  46. package/assets/standalone/.next/server/app/policies/page/server-reference-manifest.json +9 -9
  47. package/assets/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
  48. package/assets/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +2 -2
  49. package/assets/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
  50. package/assets/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
  51. package/assets/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +10 -10
  52. package/assets/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
  53. package/assets/standalone/.next/server/app/projects/page/server-reference-manifest.json +2 -2
  54. package/assets/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  55. package/assets/standalone/.next/server/app/queue/page/server-reference-manifest.json +4 -4
  56. package/assets/standalone/.next/server/app/queue/page_client-reference-manifest.js +1 -1
  57. package/assets/standalone/.next/server/chunks/[root-of-the-server]__0f_5ws6._.js +1 -1
  58. package/assets/standalone/.next/server/chunks/[root-of-the-server]__0g72weg._.js +1 -1
  59. package/assets/standalone/.next/server/chunks/[root-of-the-server]__0vfmej5._.js +2 -2
  60. package/assets/standalone/.next/server/chunks/_0aylu-q._.js +1 -1
  61. package/assets/standalone/.next/server/chunks/_0lq2_wn._.js +1 -1
  62. package/assets/standalone/.next/server/chunks/_0oqawqx._.js +1 -1
  63. package/assets/standalone/.next/server/chunks/_0vt409y._.js +1 -1
  64. package/assets/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_0l15kkr.js +1 -1
  65. package/assets/standalone/.next/server/chunks/package_json_[json]_cjs_0z7w.hh._.js +1 -1
  66. package/assets/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0sq7snp._.js → [root-of-the-server]__0-9w~bh._.js} +2 -2
  67. package/assets/standalone/.next/server/chunks/ssr/[root-of-the-server]__0-_oq51._.js +1 -1
  68. package/assets/standalone/.next/server/chunks/ssr/[root-of-the-server]__0-wbic0._.js +1 -1
  69. package/assets/standalone/.next/server/chunks/ssr/[root-of-the-server]__04qo1w2._.js +1 -1
  70. package/assets/standalone/.next/server/chunks/ssr/[root-of-the-server]__09y6src._.js +1 -1
  71. package/assets/standalone/.next/server/chunks/ssr/[root-of-the-server]__09y7ni.._.js +1 -1
  72. package/assets/standalone/.next/server/chunks/ssr/[root-of-the-server]__0bubgf_._.js +1 -1
  73. package/assets/standalone/.next/server/chunks/ssr/{[root-of-the-server]__07ifmkx._.js → [root-of-the-server]__0f7wkrr._.js} +2 -2
  74. package/assets/standalone/.next/server/chunks/ssr/[root-of-the-server]__0m0x9dt._.js +1 -1
  75. package/assets/standalone/.next/server/chunks/ssr/[root-of-the-server]__0pw0g9c._.js +1 -1
  76. package/assets/standalone/.next/server/chunks/ssr/[root-of-the-server]__0rm4qtt._.js +1 -1
  77. package/assets/standalone/.next/server/chunks/ssr/[root-of-the-server]__0spfsp5._.js +1 -1
  78. package/assets/standalone/.next/server/chunks/ssr/[root-of-the-server]__0x7-awk._.js +1 -1
  79. package/assets/standalone/.next/server/chunks/ssr/[root-of-the-server]__0zva2n_._.js +1 -1
  80. package/assets/standalone/.next/server/chunks/ssr/[root-of-the-server]__1370kzv._.js +1 -1
  81. package/assets/standalone/.next/server/chunks/ssr/_01fj_8s._.js +1 -1
  82. package/assets/standalone/.next/server/chunks/ssr/_04.u7zx._.js +1 -1
  83. package/assets/standalone/.next/server/chunks/ssr/_06383ya._.js +1 -1
  84. package/assets/standalone/.next/server/chunks/ssr/_06nq9qk._.js +1 -1
  85. package/assets/standalone/.next/server/chunks/ssr/_0i~.gk_._.js +1 -1
  86. package/assets/standalone/.next/server/chunks/ssr/_0kfjwwu._.js +1 -1
  87. package/assets/standalone/.next/server/chunks/ssr/_0km.fsf._.js +1 -1
  88. package/assets/standalone/.next/server/chunks/ssr/_0rr.uoo._.js +3 -3
  89. package/assets/standalone/.next/server/chunks/ssr/_0x26hbi._.js +1 -1
  90. package/assets/standalone/.next/server/chunks/ssr/_0xg44oj._.js +1 -1
  91. package/assets/standalone/.next/server/chunks/ssr/_11ou~_x._.js +1 -1
  92. package/assets/standalone/.next/server/chunks/ssr/_1207ol.._.js +1 -1
  93. package/assets/standalone/.next/server/chunks/ssr/app_04qfs8z._.js +1 -1
  94. package/assets/standalone/.next/server/chunks/ssr/app_05evmdg._.js +1 -1
  95. package/assets/standalone/.next/server/chunks/ssr/app_07izk21._.js +1 -1
  96. package/assets/standalone/.next/server/chunks/ssr/app_0uosk1e._.js +1 -1
  97. package/assets/standalone/.next/server/chunks/ssr/app_13f0ohr._.js +1 -1
  98. package/assets/standalone/.next/server/chunks/ssr/app_actions_compute-dashboard_ts_13cb_9d._.js +1 -1
  99. package/assets/standalone/.next/server/chunks/ssr/app_global-error_tsx_0xerkr6._.js +1 -1
  100. package/assets/standalone/.next/server/chunks/ssr/app_login_page_tsx_0z71ad3._.js +1 -1
  101. package/assets/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_0q-m0y-._.js +1 -1
  102. package/assets/standalone/.next/server/chunks/ssr/app_queue_queue-client_tsx_0c0olxv._.js +1 -1
  103. package/assets/standalone/.next/server/chunks/ssr/node_modules_next_0rd0oc-._.js +2 -2
  104. package/assets/standalone/.next/server/chunks/ssr/node_modules_next_dist_0h9llsw._.js +2 -2
  105. package/assets/standalone/.next/server/chunks/ssr/node_modules_next_dist_0~3yv~8._.js +1 -1
  106. package/assets/standalone/.next/server/middleware-build-manifest.js +3 -3
  107. package/assets/standalone/.next/server/pages/404.html +2 -2
  108. package/assets/standalone/.next/server/pages/500.html +1 -1
  109. package/assets/standalone/.next/server/server-reference-manifest.js +1 -1
  110. package/assets/standalone/.next/server/server-reference-manifest.json +23 -23
  111. package/assets/standalone/.next/static/chunks/0.llxyobdk9ao.js +1 -0
  112. package/assets/standalone/.next/static/chunks/{11nnvwnj7e__0.js → 013e6ucdn~oej.js} +1 -1
  113. package/assets/standalone/.next/static/chunks/{0y8d5uz5f1m~..js → 01i5gpaes1u49.js} +1 -1
  114. package/assets/standalone/.next/static/chunks/{0nc3no0r1i66_.js → 01z1mkd0jlg01.js} +1 -1
  115. package/assets/standalone/.next/static/chunks/{07tkt19hty~w~.js → 041yg1qijsts_.js} +1 -1
  116. package/assets/standalone/.next/static/chunks/{08eqdulekk8l-.js → 0eozapv72nxu9.js} +1 -1
  117. package/assets/standalone/.next/static/chunks/{0.~t6_2r7n04x.js → 0r-uj~~hfjn~d.js} +1 -1
  118. package/assets/standalone/.next/static/chunks/{0tp7ck~nhe8-g.js → 0r33ook0mzjdp.js} +2 -2
  119. package/assets/standalone/.next/static/chunks/{0h2.~bz5i.4.g.js → 0tdv9t00~jli0.js} +1 -1
  120. package/assets/standalone/.next/static/chunks/{162jxog7oodad.js → 0yby34zxp~u9y.js} +1 -1
  121. package/assets/standalone/.next/static/chunks/{0l8ej7oju~.oy.js → 16g-s3n9.r1ua.js} +1 -1
  122. package/assets/standalone/package.json +1 -1
  123. package/bin/claudeye +0 -0
  124. package/package.json +1 -1
  125. package/assets/standalone/.next/static/chunks/14trwlfhtz63l.js +0 -1
  126. /package/assets/standalone/.next/static/{5FBEWHgw7h8OR_JoJzccY → T2uFRf42cIG4zxcRtc0qK}/_buildManifest.js +0 -0
  127. /package/assets/standalone/.next/static/{5FBEWHgw7h8OR_JoJzccY → T2uFRf42cIG4zxcRtc0qK}/_clientMiddlewareManifest.js +0 -0
  128. /package/assets/standalone/.next/static/{5FBEWHgw7h8OR_JoJzccY → T2uFRf42cIG4zxcRtc0qK}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
1
  (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,36406,e=>{"use strict";var t=e.i(43476),s=e.i(71645),r=e.i(74080);function n(e,t,s){let r,n=s.initialDeps??[],a=!0;function i(){var i,l,o;let d,c;s.key&&(null==(i=s.debug)?void 0:i.call(s))&&(d=Date.now());let u=e();if(!(u.length!==n.length||u.some((e,t)=>n[t]!==e)))return r;if(n=u,s.key&&(null==(l=s.debug)?void 0:l.call(s))&&(c=Date.now()),r=t(...u),s.key&&(null==(o=s.debug)?void 0:o.call(s))){let e=Math.round((Date.now()-d)*100)/100,t=Math.round((Date.now()-c)*100)/100,r=t/16,n=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${n(t,5)} /${n(e,5)} ms`,`
2
2
  font-size: .6rem;
3
3
  font-weight: bold;
4
- color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,null==s?void 0:s.key)}return(null==s?void 0:s.onChange)&&!(a&&s.skipInitialOnChange)&&s.onChange(r),a=!1,r}return i.updateDeps=e=>{n=e},i}function a(e,t){if(void 0!==e)return e;throw Error(`Unexpected undefined${t?`: ${t}`:""}`)}e.i(47167);let i=e=>e,l=e=>{let t=Math.max(e.startIndex-e.overscan,0),s=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let e=t;e<=s;e++)r.push(e);return r},o={passive:!0},d=(e,t)=>{let s=e.scrollElement;if(!s)return;let r=()=>{t({width:s.innerWidth,height:s.innerHeight})};return r(),s.addEventListener("resize",r,o),()=>{s.removeEventListener("resize",r)}},c="u"<typeof window||"onscrollend"in window,u=(e,t)=>{var s,r;let n,a=e.scrollElement;if(!a)return;let i=e.targetWindow;if(!i)return;let l=0,d=e.options.useScrollendEvent&&c?()=>void 0:(s=()=>{t(l,!1)},r=e.options.isScrollingResetDelay,function(...e){i.clearTimeout(n),n=i.setTimeout(()=>s.apply(this,e),r)}),u=s=>()=>{l=a[e.options.horizontal?"scrollX":"scrollY"],d(),t(l,s)},m=u(!0),h=u(!1);a.addEventListener("scroll",m,o);let x=e.options.useScrollendEvent&&c;return x&&a.addEventListener("scrollend",h,o),()=>{a.removeEventListener("scroll",m),x&&a.removeEventListener("scrollend",h)}},m=(e,t,s)=>{if(null==t?void 0:t.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[s.options.horizontal?"inlineSize":"blockSize"])}return e[s.options.horizontal?"offsetWidth":"offsetHeight"]},h=(e,{adjustments:t=0,behavior:s},r)=>{var n,a;null==(a=null==(n=r.scrollElement)?void 0:n.scrollTo)||a.call(n,{[r.options.horizontal?"left":"top"]:e+t,behavior:s})};class x{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var e,t,s;return(null==(s=null==(t=null==(e=this.targetWindow)?void 0:e.performance)?void 0:t.now)?void 0:s.call(t))??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,s=this.indexFromElement(t);t.isConnected?this.shouldMeasureDuringScroll(s)&&this.resizeItem(s,this.options.measureElement(t,e,this)):this.observer.unobserve(t)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}):null);return{disconnect:()=>{var s;null==(s=t())||s.disconnect(),e=null},observe:e=>{var s;return null==(s=t())?void 0:s.observe(e,{box:"border-box"})},unobserve:e=>{var s;return null==(s=t())?void 0:s.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([t,s])=>{void 0===s&&delete e[t]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:i,rangeExtractor:l,onChange:()=>{},measureElement:m,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var t,s;null==(s=(t=this.options).onChange)||s.call(t,this,e)},this.maybeNotify=n(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),null!=this.rafId&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;let t=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==t){if(this.cleanup(),!t)return void this.maybeNotify();this.scrollElement=t,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(e=this.scrollElement)?void 0:e.window)??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?"forward":"backward":null,this.scrollOffset=e,this.isScrolling=t,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??("function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{let s=new Map,r=new Map;for(let n=t-1;n>=0;n--){let t=e[n];if(s.has(t.lane))continue;let a=r.get(t.lane);if(null==a||t.end>a.end?r.set(t.lane,t):t.end<a.end&&s.set(t.lane,!0),s.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=n(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(e,t,s,r,n,a)=>(void 0!==this.prevLanes&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:s,getItemKey:r,enabled:n,lanes:a}),{key:!1}),this.getMeasurements=n(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:s,getItemKey:r,enabled:n,lanes:a},i)=>{if(!n)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),0!==this.measurementsCache.length||this.lanesSettling||(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let l=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1);let o=this.measurementsCache.slice(0,l),d=Array(a).fill(void 0);for(let e=0;e<l;e++){let t=o[e];t&&(d[t.lane]=e)}for(let n=l;n<e;n++){let e,a,l=r(n),c=this.laneAssignments.get(n);if(void 0!==c&&this.options.lanes>1){let r=d[e=c],n=void 0!==r?o[r]:void 0;a=n?n.end+this.options.gap:t+s}else{let r=1===this.options.lanes?o[n-1]:this.getFurthestMeasurement(o,n);a=r?r.end+this.options.gap:t+s,e=r?r.lane:n%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(n,e)}let u=i.get(l),m="number"==typeof u?u:this.options.estimateSize(n),h=a+m;o[n]={index:n,start:a,size:m,end:h,key:l,lane:e},d[e]=n}return this.measurementsCache=o,o},{key:!1,debug:()=>this.options.debug}),this.calculateRange=n(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,s,r)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:s,lanes:r}){let n=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:n};let a=p(0,n,t=>e[t].start,s),i=a;if(1===r)for(;i<n&&e[i].end<s+t;)i++;else if(r>1){let l=Array(r).fill(0);for(;i<n&&l.some(e=>e<s+t);){let t=e[i];l[t.lane]=t.end,i++}let o=Array(r).fill(s+t);for(;a>=0&&o.some(e=>e>=s);){let t=e[a];o[t.lane]=t.start,a--}a=Math.max(0,a-a%r),i=Math.min(n,i+(r-1-i%r))}return{startIndex:a,endIndex:i}}({measurements:e,outerSize:t,scrollOffset:s,lanes:r}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=n(()=>{let e=null,t=null,s=this.calculateRange();return s&&(e=s.startIndex,t=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,s,r,n)=>null===r||null===n?[]:e({startIndex:r,endIndex:n,overscan:t,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,s=e.getAttribute(t);return s?parseInt(s,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{var t;if(!this.scrollState||"smooth"!==this.scrollState.behavior)return!0;let s=this.scrollState.index??(null==(t=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))?void 0:t.index);if(void 0!==s&&this.range){let t=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,s-t),n=Math.min(this.options.count-1,s+t);return e>=r&&e<=n}return!0},this.measureElement=e=>{if(!e)return void this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});let t=this.indexFromElement(e),s=this.options.getItemKey(t),r=this.elementsCache.get(s);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(s,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{var s;let r=this.measurementsCache[e];if(!r)return;let n=t-(this.itemSizeCache.get(r.key)??r.size);0!==n&&((null==(s=this.scrollState)?void 0:s.behavior)!=="smooth"&&(void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(r,n,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=n,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,t)),this.notify(!1))},this.getVirtualItems=n(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let s=[];for(let r=0,n=e.length;r<n;r++){let n=t[e[r]];s.push(n)}return s},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(0!==t.length)return a(t[p(0,t.length-1,e=>a(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(e,t,s=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),n=this.getScrollOffset();return"auto"===t&&(t=e>=n+r?"end":"start"),"center"===t?e+=(s-r)/2:"end"===t&&(e-=r),Math.max(Math.min(this.getMaxScrollOffset(),e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));let s=this.getSize(),r=this.getScrollOffset(),n=this.measurementsCache[e];if(!n)return;if("auto"===t)if(n.end>=r+s-this.options.scrollPaddingEnd)t="end";else{if(!(n.start<=r+this.options.scrollPaddingStart))return[r,t];t="start"}if("end"===t&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a="end"===t?n.end+this.options.scrollPaddingEnd:n.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,n.size),t]},this.scrollToOffset=(e,{align:t="start",behavior:s="auto"}={})=>{let r=this.getOffsetForAlignment(e,t),n=this.now();this.scrollState={index:null,align:t,behavior:s,startedAt:n,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t="auto",behavior:s="auto"}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[n,a]=r,i=this.now();this.scrollState={index:e,align:a,behavior:s,startedAt:i,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t="auto"}={})=>{let s=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:"start",behavior:t,startedAt:r,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var e;let t,s=this.getMeasurements();if(0===s.length)t=this.options.paddingStart;else if(1===this.options.lanes)t=(null==(e=s[s.length-1])?void 0:e.end)??0;else{let e=Array(this.options.lanes).fill(null),r=s.length-1;for(;r>=0&&e.some(e=>null===e);){let t=s[r];null===e[t.lane]&&(e[t.lane]=t.end),r--}t=Math.max(...e.filter(e=>null!==e))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:s})=>{this.options.scrollToFn(e,{behavior:s,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}null==this.rafId&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=null!=this.scrollState.index?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,t=e?e[0]:this.scrollState.lastTargetOffset,s=t!==this.scrollState.lastTargetOffset;if(!s&&1.01>Math.abs(t-this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.scrollState=null;return}}else this.scrollState.stableFrames=0,s&&(this.scrollState.lastTargetOffset=t,this.scrollState.behavior="auto",this._scrollToOffset(t,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}let p=(e,t,s,r)=>{for(;e<=t;){let n=(e+t)/2|0,a=s(n);if(a<r)e=n+1;else{if(!(a>r))return n;t=n-1}}return e>0?e-1:0},f="u">typeof document?s.useLayoutEffect:s.useEffect;var g=e.i(64659),b=e.i(75254);let y=(0,b.default)("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]),v=(0,b.default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),j=(0,b.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"}]]),N=(0,b.default)("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]),w=(0,b.default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);var k=e.i(86311);let S=(0,b.default)("workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]),M=s.default.memo(function({entries:e,compact:r=!1}){let n=(0,s.useMemo)(()=>(function(e){let t=0,s=0,r=0,n=0,a=0,i=new Set;for(let l of e)if("user"===l.type&&t++,"queue-operation"===l.type&&a++,"assistant"===l.type){for(let e of(s++,l.message.content))"tool_use"===e.type&&("Task"===e.name&&(e.subagentType||e.subagentId)?n++:r++);l.message.model&&i.add(l.message.model)}let l="";return e.length>=2&&(l=function(e){if(e<1e3)return`${e}ms`;let t=e/1e3;if(t<60)return`${t.toFixed(1)}s`;let s=Math.floor(t/60);if(s>=60){let e=Math.floor(s/60);return`${e}h ${s%60}m`}let r=(t%60).toFixed(0);return`${s}m ${r}s`}(e[e.length-1].timestampMs-e[0].timestampMs)),{turnCount:a,userCount:t,assistantCount:s,toolCallCount:r,subagentCount:n,duration:l,models:Array.from(i)}})(e),[e]),a=r?"w-3.5 h-3.5":"w-4 h-4",i=r?"text-xs font-medium":"text-sm font-medium",l=r?"text-[10px] text-muted-foreground":"text-xs text-muted-foreground",o=[...r?[]:[{Icon:k.MessageSquare,color:"text-primary",v:n.turnCount,l:"Turns"}],{Icon:v,color:"text-[color:var(--chart-1)]",v:n.userCount,l:"User"},{Icon:j,color:"text-[color:var(--chart-2)]",v:n.assistantCount,l:"Assistant"},{Icon:y,color:"text-[color:var(--chart-3)]",v:n.toolCallCount,l:r?"Tools":"Tool Calls"},{Icon:S,color:"text-[color:var(--chart-5)]",v:n.subagentCount,l:"Subagents"},{Icon:w,color:"text-[color:var(--chart-4)]",v:n.duration||"—",l:"Duration"},{Icon:N,color:"text-[color:var(--chart-5)]",v:n.models.length>0?n.models.join(", "):"—",l:r?"Model":"Model(s)"}];return(0,t.jsx)("div",{className:r?"bg-muted/30 border border-border/50 rounded-lg p-3 mb-3":"bg-card border border-border rounded-lg p-4",children:(0,t.jsx)("div",{className:`grid grid-cols-2 ${r?"sm:grid-cols-6 gap-3":"sm:grid-cols-4 lg:grid-cols-7 gap-4"}`,children:o.map(({Icon:e,color:s,v:r,l:n})=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(e,{className:`${a} ${s}`}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:`${i} truncate max-w-[120px]`,children:r}),(0,t.jsx)("div",{className:l,children:n})]})]},n))})})}),C=(0,b.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);var E=e.i(63059);function I(e){return JSON.stringify(e.raw,null,2)}let $=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0});function R(e){let t=new Date(e),s=$.format(t),r=t.getMilliseconds().toString().padStart(3,"0");return`${s}.${r}`}let T=s.default.memo(function({entry:e,isCollapsed:s,entryCount:r,onToggle:n}){let a="function"==typeof n,i=(0,t.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full bg-primary/10 border border-primary/20 text-primary text-xs font-medium${a?" group-hover:bg-primary/20 transition-colors":""}`,children:[a?(0,t.jsx)(E.ChevronRight,{className:`w-3 h-3 transition-transform ${s?"":"rotate-90"}`}):(0,t.jsx)(C,{className:"w-3 h-3"}),(0,t.jsx)("span",{children:e.label}),(0,t.jsx)("span",{className:"text-muted-foreground",children:R(e.timestampMs)}),a&&s&&"number"==typeof r&&(0,t.jsxs)("span",{className:"ml-1 px-1.5 py-0.5 rounded bg-primary/20 text-[10px] leading-none",children:[r," ",1===r?"entry":"entries"]})]});return a?(0,t.jsxs)("button",{type:"button",onClick:n,className:"group flex items-center gap-3 py-3 px-4 w-full cursor-pointer",children:[(0,t.jsx)("div",{className:"flex-1 h-px bg-primary/30"}),i,(0,t.jsx)("div",{className:"flex-1 h-px bg-primary/30"})]}):(0,t.jsxs)("div",{className:"flex items-center gap-3 py-3 px-4",children:[(0,t.jsx)("div",{className:"flex-1 h-px bg-primary/30"}),i,(0,t.jsx)("div",{className:"flex-1 h-px bg-primary/30"})]})});var O=e.i(47163);let A={user:"User",assistant:"Assistant","file-history-snapshot":"Snapshot",progress:"Progress",system:"System","queue-operation":"Queue"},D={user:"bg-[color:var(--chart-1)]/20 text-[color:var(--chart-1)] border-[color:var(--chart-1)]/30",assistant:"bg-[color:var(--chart-2)]/20 text-[color:var(--chart-2)] border-[color:var(--chart-2)]/30","file-history-snapshot":"bg-[color:var(--chart-3)]/20 text-[color:var(--chart-3)] border-[color:var(--chart-3)]/30",progress:"bg-[color:var(--chart-5)]/20 text-[color:var(--chart-5)] border-[color:var(--chart-5)]/30",system:"bg-[color:var(--chart-4)]/20 text-[color:var(--chart-4)] border-[color:var(--chart-4)]/30","queue-operation":"bg-primary/20 text-primary border-primary/30"},F={user:"border-l-[color:var(--chart-1)]",assistant:"border-l-[color:var(--chart-2)]","file-history-snapshot":"border-l-[color:var(--chart-3)]",progress:"border-l-[color:var(--chart-5)]",system:"border-l-[color:var(--chart-4)]","queue-operation":"border-l-primary"},z=(0,b.default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),_=(0,b.default)("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);var q=e.i(39616);function L({type:e}){let s="w-4 h-4";switch(e){case"user":return(0,t.jsx)(v,{className:s});case"assistant":return(0,t.jsx)(j,{className:s});case"file-history-snapshot":return(0,t.jsx)(z,{className:s});case"progress":return(0,t.jsx)(_,{className:s});case"system":return(0,t.jsx)(q.Settings,{className:s});case"queue-operation":return(0,t.jsx)(C,{className:s})}}function P({type:e}){return(0,t.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 text-xs font-mono rounded border ${D[e]}`,children:[(0,t.jsx)(L,{type:e}),A[e]]})}var U=e.i(24380);function W({block:e}){let r=(0,s.useMemo)(()=>JSON.stringify(e.input,null,2),[e]);return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("details",{open:!0,children:[(0,t.jsx)("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1",children:["Input",(0,t.jsx)(U.CopyButton,{text:r})]})}),(0,t.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words max-h-64 overflow-y-auto",children:r})]}),e.result?(0,t.jsxs)("div",{className:"border-l-2 border-primary/50 pl-3 space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"inline-block px-2 py-0.5 text-xs font-mono rounded border bg-primary/20 text-primary border-primary/30",children:"Result"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:R(new Date(e.result.timestamp).getTime())})]}),e.result.content&&(0,t.jsxs)("details",{open:!0,children:[(0,t.jsx)("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1",children:["Output",(0,t.jsx)(U.CopyButton,{text:e.result.content})]})}),(0,t.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words max-h-48 overflow-y-auto",children:e.result.content})]}),e.result.images?.map((e,s)=>(0,t.jsx)("img",{src:`data:${e.mediaType};base64,${e.base64}`,alt:`Tool result image ${s+1}`,className:"mt-2 max-w-full rounded border border-border"},s))]}):(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:"Tool did not return a result"})]})}let H=(0,b.default)("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);var V=e.i(1742);let B=(0,b.default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),J=(0,b.default)("chart-column",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);var K=e.i(16715),Q=e.i(95187);let X=(0,Q.createServerReference)("783ec766a9731c7649fcd08c76b778cfb7c83eb2f7",Q.callServer,void 0,Q.findSourceMapURL,"checkEvalCacheAndList");async function Y(e,t,s,r=!1,n){let a;try{a=await fetch("/api/queue-item",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"eval",projectName:e,sessionId:t,itemName:s,forceRefresh:r,...n&&{agentId:n.agentId,subagentType:n.subagentType,subagentDescription:n.subagentDescription}})})}catch(e){return{ok:!1,error:`Network error: ${e instanceof Error?e.message:String(e)}`}}return 202===a.status?{ok:!1,error:"__queued__"}:a.ok?a.json():{ok:!1,error:`Queue request failed: ${a.status}`}}let G=(0,Q.createServerReference)("60bc2c3f84977b1dad7705f1855f3788c5d4160c2b",Q.callServer,void 0,Q.findSourceMapURL,"clearAlertMarker"),Z=(0,Q.createServerReference)("7815012be79a0e8118abbc59954dd11c5c1b584c55",Q.callServer,void 0,Q.findSourceMapURL,"invalidateSessionItemCaches");function ee({score:e}){let s=Math.round(100*e);return(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"flex-1 h-2 bg-muted rounded-full overflow-hidden max-w-[80px]",children:(0,t.jsx)("div",{className:`h-full rounded-full transition-all ${e>=.8?"bg-green-500":e>=.5?"bg-yellow-500":"bg-red-500"}`,style:{width:`${s}%`}})}),(0,t.jsxs)("span",{className:"text-xs font-mono text-muted-foreground w-8",children:[s,"%"]})]})}function et({result:e}){return e.error?(0,t.jsx)(B,{className:"w-4 h-4 text-yellow-500"}):e.pass?(0,t.jsx)(H,{className:"w-4 h-4 text-green-500"}):(0,t.jsx)(V.XCircle,{className:"w-4 h-4 text-red-500"})}function es({name:e}){return(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,t.jsx)("div",{className:"w-4 h-4 rounded-full bg-muted animate-pulse"}),(0,t.jsx)("span",{className:"text-sm font-mono truncate max-w-[200px] text-muted-foreground",children:e}),(0,t.jsx)("div",{className:"flex-1 h-2 bg-muted rounded-full animate-pulse max-w-[80px]"})]})}function er({name:e,error:s}){return(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,t.jsx)(B,{className:"w-4 h-4 text-yellow-500"}),(0,t.jsx)("span",{className:"text-sm font-mono truncate max-w-[200px]",children:e}),(0,t.jsx)("span",{className:"text-xs text-yellow-500 truncate",children:s})]})}function en({result:e,cached:r,onRerun:n,globalLoading:a}){let[i,l]=(0,s.useState)(!1),[o,d]=(0,s.useState)(!1),c=e.error||e.message,u=!!c,m=async t=>{t.stopPropagation(),d(!0);try{await n(e.name)}finally{d(!1)}};return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:`flex items-center gap-3 px-3 py-2 rounded-md hover:bg-muted/30 transition-colors ${u?"cursor-pointer":""}`,onClick:()=>u&&l(e=>!e),children:[u&&(0,t.jsx)(E.ChevronRight,{className:`w-3.5 h-3.5 text-muted-foreground transition-transform ${i?"rotate-90":""}`}),(0,t.jsx)(et,{result:e}),(0,t.jsx)("span",{className:"text-sm font-mono truncate max-w-[200px]",children:e.name}),(0,t.jsx)(ee,{score:e.score}),r&&(0,t.jsx)("span",{className:"text-[10px] font-medium text-muted-foreground/70 bg-muted px-1 py-0.5 rounded",children:"cached"}),e.error&&(0,t.jsx)("span",{className:"text-xs text-yellow-500 flex-1 truncate min-w-0",children:e.error}),e.message&&!e.error&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground flex-1 truncate min-w-0",children:e.message}),(0,t.jsx)("button",{onClick:m,disabled:o||a,className:"ml-auto flex-shrink-0 p-1 rounded hover:bg-muted/50 transition-colors disabled:opacity-50",title:"Re-run this eval","aria-label":`Re-run eval ${e.name}`,children:(0,t.jsx)(K.RefreshCw,{className:`w-3.5 h-3.5 text-muted-foreground ${o?"animate-spin":""}`})})]}),i&&c&&(0,t.jsxs)("div",{className:"ml-10 mr-3 mb-2 relative group",children:[(0,t.jsx)("div",{className:"absolute top-1 right-1 opacity-0 group-hover:opacity-100 transition-opacity",children:(0,t.jsx)(U.CopyButton,{text:c})}),(0,t.jsx)("div",{className:"p-2 pr-8 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words select-text",children:c})]})]})}function ea({projectName:e,sessionId:r,agentId:n,subagentType:a,subagentDescription:i,compact:l}){let[o,d]=(0,s.useState)([]),[c,u]=(0,s.useState)(!0),[m,h]=(0,s.useState)(!1),[x,p]=(0,s.useState)(!1),[f,b]=(0,s.useState)(!1),[y,v]=(0,s.useState)(null),[j,N]=(0,s.useState)(!0),w=(0,s.useRef)(!0);(0,s.useEffect)(()=>{w.current=!0;let t=!1;return u(!0),v(null),h(!1),d([]),X(e,r,n,a).then(s=>{if(!t&&w.current){if(!s.ok){v(s.error),u(!1);return}if(!s.hasEvals){h(!0),u(!1);return}if(d(s.names.map(e=>{let t=s.cachedResults.find(t=>t.name===e);return t?{status:"done",name:e,result:t,cached:!0}:{status:"loading",name:e}})),p(0===s.uncachedNames.length),u(!1),s.uncachedNames.length>0){let l=n?{agentId:n,subagentType:a,subagentDescription:i}:void 0;Promise.all(s.uncachedNames.map(async s=>{try{let n=await Y(e,r,s,!1,l);if(t||!w.current||!n.ok&&"__queued__"===n.error)return;n.ok?d(e=>e.map(e=>e.name===s?{status:"done",name:s,result:n.result,cached:!1}:e)):d(e=>e.map(e=>e.name===s?{status:"error",name:s,error:n.error}:e))}catch(e){if(t||!w.current)return;d(t=>t.map(t=>t.name===s?{status:"error",name:s,error:e instanceof Error?e.message:"Failed"}:t))}}))}}}).catch(e=>{!t&&w.current&&(v(e instanceof Error?e.message:"Failed to load evals"),u(!1))}),()=>{t=!0,w.current=!1}},[e,r,n,a,i]),(0,s.useEffect)(()=>{if(0===o.filter(e=>"loading"===e.status).map(e=>e.name).length)return;let t=!1,s=setInterval(async()=>{try{let s=await X(e,r,n,a);if(t||!s.ok||!s.hasEvals)return;d(e=>{let t=!1,r=e.map(e=>{if("loading"!==e.status)return e;let r=s.cachedResults.find(t=>t.name===e.name);return r?(t=!0,{status:"done",name:e.name,result:r,cached:!1}):e});return t?r:e})}catch{}},3e3);return()=>{t=!0,clearInterval(s)}},[o,e,r,n,a]);let k=(0,s.useCallback)(async()=>{b(!0),d(e=>e.map(e=>({status:"loading",name:e.name})));let t=n?{agentId:n,subagentType:a,subagentDescription:i}:void 0;try{await Z("evals",e,r,n),await G(e,r);let s=o.map(e=>e.name);await Promise.all(s.map(async s=>{try{let n=await Y(e,r,s,!0,t);if(!w.current||!n.ok&&"__queued__"===n.error)return;n.ok?d(e=>e.map(e=>e.name===s?{status:"done",name:s,result:n.result,cached:!1}:e)):d(e=>e.map(e=>e.name===s?{status:"error",name:s,error:n.error}:e))}catch(e){if(!w.current)return;d(t=>t.map(t=>t.name===s?{status:"error",name:s,error:e instanceof Error?e.message:"Failed"}:t))}})),w.current&&p(!1)}finally{w.current&&b(!1)}},[e,r,n,a,i,o]),S=(0,s.useCallback)(async t=>{p(!1),d(e=>e.map(e=>e.name===t?{status:"loading",name:t}:e));let s=n?{agentId:n,subagentType:a,subagentDescription:i}:void 0;try{let n=await Y(e,r,t,!0,s);if(!w.current||!n.ok&&"__queued__"===n.error)return;n.ok?d(e=>e.map(e=>e.name===t?{status:"done",name:t,result:n.result,cached:!1}:e)):d(e=>e.map(e=>e.name===t?{status:"error",name:t,error:n.error}:e))}catch(e){if(!w.current)return;d(s=>s.map(s=>s.name===t?{status:"error",name:t,error:e instanceof Error?e.message:"Re-run failed"}:s))}},[e,r,n,a,i]),M=o.filter(e=>"done"===e.status),E=o.filter(e=>"loading"===e.status).length,I=M.map(e=>e.result).filter(e=>!e.skipped),$=I.filter(e=>!e.error&&e.pass).length,R=I.filter(e=>!e.error&&!e.pass).length,T=M.filter(e=>!!e.result.error).length+o.filter(e=>"error"===e.status).length,O=c||E>0||f;if(m)return null;let A=l?"p-2.5":"p-4",D=l?"text-xs":"text-sm";if(c)return(0,t.jsx)("div",{className:`bg-card border border-border rounded-lg ${A}`,children:(0,t.jsxs)("div",{className:`flex items-center gap-2 ${D} text-muted-foreground`,children:[(0,t.jsx)(K.RefreshCw,{className:"w-4 h-4 animate-spin"}),"Loading evals..."]})});if(y&&0===o.length)return(0,t.jsx)("div",{className:`bg-card border border-border rounded-lg ${A}`,children:(0,t.jsxs)("div",{className:`flex items-center gap-2 ${D} text-destructive`,children:[(0,t.jsx)(B,{className:"w-4 h-4"}),y]})});if(0===o.length)return null;let F=o.filter(e=>!("done"===e.status&&e.result.skipped)),z=o.filter(e=>"done"===e.status&&e.result.skipped).length;return(0,t.jsxs)("div",{className:`bg-card border border-border rounded-lg ${A} ${j?"":"space-y-3"}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("button",{onClick:()=>N(e=>!e),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,t.jsx)(g.ChevronDown,{className:`w-4 h-4 text-muted-foreground transition-transform ${j?"-rotate-90":""}`}),(0,t.jsx)(J,{className:"w-4 h-4 text-primary"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:"Eval Results"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 text-xs",children:[$>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(H,{className:"w-3.5 h-3.5 text-green-500"}),(0,t.jsx)("span",{className:"font-medium",children:$}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"passed"})]}),R>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(V.XCircle,{className:"w-3.5 h-3.5 text-red-500"}),(0,t.jsx)("span",{className:"font-medium",children:R}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"failed"})]}),T>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(B,{className:"w-3.5 h-3.5 text-yellow-500"}),(0,t.jsx)("span",{className:"font-medium",children:T}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"errored"})]}),E>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(K.RefreshCw,{className:"w-3.5 h-3.5 text-muted-foreground animate-spin"}),(0,t.jsxs)("span",{className:"text-muted-foreground",children:[E," running..."]})]}),z>0&&!O&&(0,t.jsxs)("span",{className:"text-[10px] font-medium text-muted-foreground/50 bg-muted px-1.5 py-0.5 rounded",children:[z," skipped"]}),x&&!O&&(0,t.jsx)("span",{className:"text-[10px] font-medium text-muted-foreground/70 bg-muted px-1.5 py-0.5 rounded",children:"cached"})]}),(0,t.jsxs)("button",{onClick:()=>k(),disabled:O,className:"inline-flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium rounded border border-primary/30 bg-primary/10 text-primary hover:bg-primary/20 transition-colors disabled:opacity-50",children:[f?(0,t.jsx)(K.RefreshCw,{className:"w-3 h-3 animate-spin"}):(0,t.jsx)(C,{className:"w-3 h-3"}),f?"Running...":"Re-run"]})]})]}),!j&&(0,t.jsx)("div",{className:"divide-y divide-border/50",children:F.map(e=>"loading"===e.status?(0,t.jsx)(es,{name:e.name},e.name):"error"===e.status?(0,t.jsx)(er,{name:e.name,error:e.error},e.name):(0,t.jsx)(en,{result:e.result,cached:e.cached,onRerun:S,globalLoading:f},e.name))})]})}let ei=(0,b.default)("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),el=(0,Q.createServerReference)("789694469db1ede24d48c35844641fdbe52758bba7",Q.callServer,void 0,Q.findSourceMapURL,"checkEnrichmentCacheAndList");async function eo(e,t,s,r=!1,n){let a;try{a=await fetch("/api/queue-item",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"enrichment",projectName:e,sessionId:t,itemName:s,forceRefresh:r,...n&&{agentId:n.agentId,subagentType:n.subagentType,subagentDescription:n.subagentDescription}})})}catch(e){return{ok:!1,error:`Network error: ${e instanceof Error?e.message:String(e)}`}}return 202===a.status?{ok:!1,error:"__queued__"}:a.ok?a.json():{ok:!1,error:`Queue request failed: ${a.status}`}}function ed({name:e}){return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-mono font-medium text-muted-foreground",children:e}),(0,t.jsx)("div",{className:"w-10 h-3 bg-muted rounded animate-pulse"})]}),(0,t.jsxs)("div",{className:"pl-1 space-y-1",children:[(0,t.jsx)("div",{className:"h-3 bg-muted rounded animate-pulse w-2/3"}),(0,t.jsx)("div",{className:"h-3 bg-muted rounded animate-pulse w-1/2"})]})]})}function ec({name:e,error:s}){return(0,t.jsx)("div",{className:"space-y-1.5",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(B,{className:"w-3.5 h-3.5 text-yellow-500"}),(0,t.jsx)("span",{className:"text-sm font-mono font-medium",children:e}),(0,t.jsx)("span",{className:"text-xs text-yellow-500 truncate",children:s})]})})}function eu({result:e,cached:s}){if(e.error)return(0,t.jsx)("div",{className:"space-y-1.5",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(B,{className:"w-3.5 h-3.5 text-yellow-500"}),(0,t.jsx)("span",{className:"text-sm font-mono font-medium",children:e.name}),(0,t.jsx)("span",{className:"text-xs text-yellow-500 truncate",title:e.error,children:e.error})]})});let r=Object.entries(e.data);return 0===r.length?null:(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-mono font-medium",children:e.name}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[e.durationMs,"ms"]}),s&&(0,t.jsx)("span",{className:"text-[10px] font-medium text-muted-foreground/70 bg-muted px-1 py-0.5 rounded",children:"cached"})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 gap-y-1 pl-1",children:r.map(([e,s])=>(0,t.jsxs)("div",{className:"flex items-baseline gap-2 min-w-0 flex-wrap",children:[(0,t.jsxs)("span",{className:"text-xs font-semibold text-primary/70 shrink-0",children:[e,":"]}),(0,t.jsx)("span",{className:"text-sm font-mono break-all",title:String(s),children:"boolean"==typeof s?s?"Yes":"No":"number"==typeof s?s.toLocaleString():String(s)})]},e))})]})}function em({projectName:e,sessionId:r,agentId:n,subagentType:a,subagentDescription:i,compact:l}){let[o,d]=(0,s.useState)([]),[c,u]=(0,s.useState)(!0),[m,h]=(0,s.useState)(!1),[x,p]=(0,s.useState)(!1),[f,b]=(0,s.useState)(!1),[y,v]=(0,s.useState)(null),[j,N]=(0,s.useState)(!0),w=(0,s.useRef)(!0);(0,s.useEffect)(()=>{w.current=!0;let t=!1;return u(!0),v(null),h(!1),d([]),el(e,r,n,a).then(s=>{if(!t&&w.current){if(!s.ok){v(s.error),u(!1);return}if(!s.hasEnrichers){h(!0),u(!1);return}if(d(s.names.map(e=>{let t=s.cachedResults.find(t=>t.name===e);return t?{status:"done",name:e,result:t,cached:!0}:{status:"loading",name:e}})),p(0===s.uncachedNames.length),u(!1),s.uncachedNames.length>0){let l=n?{agentId:n,subagentType:a,subagentDescription:i}:void 0;Promise.all(s.uncachedNames.map(async s=>{try{let n=await eo(e,r,s,!1,l);if(t||!w.current||!n.ok&&"__queued__"===n.error)return;n.ok?d(e=>e.map(e=>e.name===s?{status:"done",name:s,result:n.result,cached:!1}:e)):d(e=>e.map(e=>e.name===s?{status:"error",name:s,error:n.error}:e))}catch(e){if(t||!w.current)return;d(t=>t.map(t=>t.name===s?{status:"error",name:s,error:e instanceof Error?e.message:"Failed"}:t))}}))}}}).catch(e=>{!t&&w.current&&(v(e instanceof Error?e.message:"Failed to load enrichments"),u(!1))}),()=>{t=!0,w.current=!1}},[e,r,n,a,i]);let k=(0,s.useCallback)(async()=>{b(!0),d(e=>e.map(e=>({status:"loading",name:e.name})));let t=n?{agentId:n,subagentType:a,subagentDescription:i}:void 0;try{await Z("enrichments",e,r,n);let s=o.map(e=>e.name);await Promise.all(s.map(async s=>{try{let n=await eo(e,r,s,!0,t);if(!w.current||!n.ok&&"__queued__"===n.error)return;n.ok?d(e=>e.map(e=>e.name===s?{status:"done",name:s,result:n.result,cached:!1}:e)):d(e=>e.map(e=>e.name===s?{status:"error",name:s,error:n.error}:e))}catch(e){if(!w.current)return;d(t=>t.map(t=>t.name===s?{status:"error",name:s,error:e instanceof Error?e.message:"Failed"}:t))}})),w.current&&p(!1)}finally{w.current&&b(!1)}},[e,r,n,a,i,o]),S=o.filter(e=>"done"===e.status),M=o.filter(e=>"loading"===e.status).length,E=S.filter(e=>!!e.result.error).length+o.filter(e=>"error"===e.status).length,I=c||M>0||f;if(m)return null;let $=l?"p-2.5":"p-4",R=l?"text-xs":"text-sm";if(c)return(0,t.jsx)("div",{className:`bg-card border border-border rounded-lg ${$}`,children:(0,t.jsxs)("div",{className:`flex items-center gap-2 ${R} text-muted-foreground`,children:[(0,t.jsx)(K.RefreshCw,{className:"w-4 h-4 animate-spin"}),"Loading enrichments..."]})});if(y&&0===o.length)return(0,t.jsx)("div",{className:`bg-card border border-border rounded-lg ${$}`,children:(0,t.jsxs)("div",{className:`flex items-center gap-2 ${R} text-destructive`,children:[(0,t.jsx)(B,{className:"w-4 h-4"}),y]})});if(0===o.length)return null;let T=o.filter(e=>!("done"===e.status&&e.result.skipped)),O=o.filter(e=>"done"===e.status&&e.result.skipped).length;return(0,t.jsxs)("div",{className:`bg-card border border-border rounded-lg ${$} ${j?"":"space-y-3"}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("button",{onClick:()=>N(e=>!e),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,t.jsx)(g.ChevronDown,{className:`w-4 h-4 text-muted-foreground transition-transform ${j?"-rotate-90":""}`}),(0,t.jsx)(ei,{className:"w-4 h-4 text-primary"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:"Enrichment Data"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[E>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1 text-xs text-yellow-500",children:[(0,t.jsx)(B,{className:"w-3.5 h-3.5"}),(0,t.jsxs)("span",{children:[E," errored"]})]}),M>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,t.jsx)(K.RefreshCw,{className:"w-3.5 h-3.5 animate-spin"}),(0,t.jsxs)("span",{children:[M," running..."]})]}),O>0&&!I&&(0,t.jsxs)("span",{className:"text-[10px] font-medium text-muted-foreground/50 bg-muted px-1.5 py-0.5 rounded",children:[O," skipped"]}),x&&!I&&(0,t.jsx)("span",{className:"text-[10px] font-medium text-muted-foreground/70 bg-muted px-1.5 py-0.5 rounded",children:"cached"}),(0,t.jsxs)("button",{onClick:()=>k(),disabled:I,className:"inline-flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium rounded border border-primary/30 bg-primary/10 text-primary hover:bg-primary/20 transition-colors disabled:opacity-50",children:[f?(0,t.jsx)(K.RefreshCw,{className:"w-3 h-3 animate-spin"}):(0,t.jsx)(C,{className:"w-3 h-3"}),f?"Running...":"Re-run"]})]})]}),!j&&(0,t.jsx)("div",{className:"space-y-3 divide-y divide-border/50",children:T.map(e=>(0,t.jsxs)("div",{className:"pt-2 first:pt-0",children:["loading"===e.status&&(0,t.jsx)(ed,{name:e.name}),"error"===e.status&&(0,t.jsx)(ec,{name:e.name,error:e.error}),"done"===e.status&&(0,t.jsx)(eu,{result:e.result,cached:e.cached})]},e.name))})]})}let eh=(0,b.default)("brain",[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]),ex=s.default.memo(function({block:e,allEntries:s,projectName:r,sessionId:n,highlightedUuid:a,autoExpandForUuid:i}){switch(e.type){case"text":return(0,t.jsx)("p",{className:"whitespace-pre-wrap text-sm",children:e.text});case"tool_use":if("Task"===e.name&&(e.subagentType||e.subagentId)){let l=e.subagentId&&s?s.filter(t=>t._source===`agent-${e.subagentId}`):void 0;return(0,t.jsx)(ej,{block:e,subagentEntries:l,projectName:r,sessionId:n,highlightedUuid:a,autoExpandForUuid:i})}return(0,t.jsxs)("div",{className:"border border-border/50 rounded-lg p-3 bg-muted/10",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(y,{className:"w-4 h-4 text-primary flex-shrink-0"}),(0,t.jsx)("span",{className:"font-mono text-sm text-primary truncate min-w-0",children:e.name}),e.result&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground ml-auto flex-shrink-0",children:e.result.durationFormatted})]}),(0,t.jsx)(W,{block:e})]});case"thinking":return(0,t.jsx)("div",{className:"border border-[color:var(--chart-5)]/30 rounded-lg p-3 bg-[color:var(--chart-5)]/5",children:(0,t.jsxs)("details",{children:[(0,t.jsxs)("summary",{className:"flex items-center gap-2 text-xs cursor-pointer hover:text-foreground transition-colors text-[color:var(--chart-5)]",children:[(0,t.jsx)(eh,{className:"w-4 h-4"}),(0,t.jsx)("span",{children:"Thinking"}),(0,t.jsxs)("span",{className:"text-muted-foreground ml-1",children:["(",e.thinking.length.toLocaleString()," chars)"]})]}),(0,t.jsx)("p",{className:"mt-2 whitespace-pre-wrap text-xs text-muted-foreground p-2 bg-muted/30 rounded max-h-64 overflow-y-auto",children:e.thinking})]})})}});function ep({entry:e}){return(0,t.jsx)("div",{children:e.message.content&&(0,t.jsx)("p",{className:"whitespace-pre-wrap text-sm",children:e.message.content})})}let ef=s.default.memo(function({entry:e,allEntries:s,projectName:r,sessionId:n,highlightedUuid:a,autoExpandForUuid:i}){let{content:l}=e.message;return(0,t.jsx)("div",{className:"space-y-3",children:l.map((e,l)=>(0,t.jsx)(ex,{block:e,allEntries:s,projectName:r,sessionId:n,highlightedUuid:a,autoExpandForUuid:i},l))})}),eg=s.default.memo(function({entry:e}){let r=(0,s.useMemo)(()=>{if("progress"===e.type){let t=e.raw.data,s=t?.agentId;return[t?.type,s&&`agent:${s}`].filter(Boolean).join(" | ")}return"file-history-snapshot"===e.type?"File history snapshot":e.type},[e.type,e.raw]);return(0,t.jsxs)("div",{className:"text-sm",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:r}),(0,t.jsxs)("details",{className:"mt-1",children:[(0,t.jsx)("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:"Show raw JSON"}),(0,t.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words max-h-64 overflow-y-auto",children:I(e)})]})]})}),eb=(0,b.default)("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);var ey=e.i(55574);function ev({uuid:e}){let r=(0,s.useCallback)(async()=>{window.history.replaceState(null,"",`#entry-${e}`);try{await navigator.clipboard.writeText(window.location.href)}catch{let e=document.createElement("textarea");e.value=window.location.href,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)}(0,ey.toast)("Link copied")},[e]);return(0,t.jsx)("button",{onClick:r,title:"Copy link to entry",className:"inline-flex items-center justify-center rounded p-1 text-muted-foreground hover:text-foreground hover:bg-muted/80 transition-colors opacity-0 group-hover:opacity-100 transition-opacity",children:(0,t.jsx)(eb,{className:"w-3.5 h-3.5"})})}function ej({block:e,subagentEntries:r,projectName:n,sessionId:a,highlightedUuid:i,autoExpandForUuid:l}){let o=!!(l&&r?.some(e=>e.uuid===l)),[d,c]=(0,s.useState)(o);(0,s.useEffect)(()=>{if(!o)return;let e=requestAnimationFrame(()=>c(!0));return()=>cancelAnimationFrame(e)},[o]);let u=(0,s.useCallback)(()=>{c(e=>!e)},[]),m=r&&r.length>0;return(0,t.jsxs)("div",{className:"border border-border/50 rounded-lg p-3 bg-muted/10",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(S,{className:"w-4 h-4 text-[color:var(--chart-5)]"}),(0,t.jsx)("span",{className:"font-mono text-sm text-[color:var(--chart-5)]",children:"Subagent"}),e.subagentType&&(0,t.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 text-xs font-mono rounded border bg-[color:var(--chart-5)]/20 text-[color:var(--chart-5)] border-[color:var(--chart-5)]/30",children:e.subagentType}),e.result&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground ml-auto",children:e.result.durationFormatted})]}),e.subagentDescription&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.subagentDescription}),e.subagentId&&r&&(0,t.jsxs)("button",{onClick:u,className:"inline-flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium rounded border border-primary/30 bg-primary/10 text-primary hover:bg-primary/20 transition-colors mb-2",children:[(0,t.jsx)(E.ChevronRight,{className:(0,O.cn)("w-3 h-3 transition-transform",d&&"rotate-90")}),(0,t.jsxs)("span",{children:["agent-",e.subagentId]}),(0,t.jsx)("span",{className:"text-muted-foreground",children:d?"Collapse":"View subagent log"})]}),d&&(0,t.jsxs)("div",{className:"ml-4 pl-3 border-l-2 border-primary/30 mt-2 space-y-2",children:[r&&0===r.length&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground py-2",children:"No entries found in subagent log."}),m&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M,{entries:r,compact:!0}),(0,t.jsx)(ea,{projectName:n,sessionId:a,agentId:e.subagentId,subagentType:e.subagentType,subagentDescription:e.subagentDescription,compact:!0}),(0,t.jsx)(em,{projectName:n,sessionId:a,agentId:e.subagentId,subagentType:e.subagentType,subagentDescription:e.subagentDescription,compact:!0})]}),r&&r.map(e=>"queue-operation"===e.type?(0,t.jsx)(T,{entry:e},e.uuid||e.timestamp):(0,t.jsx)(ew,{entry:e,projectName:n,sessionId:a,isHighlighted:!!i&&e.uuid===i},e.uuid||e.timestamp))]}),(0,t.jsx)(W,{block:e})]})}function eN({entry:e,allEntries:s,projectName:r,sessionId:n,highlightedUuid:a,autoExpandForUuid:i}){switch(e.type){case"user":return(0,t.jsx)(ep,{entry:e});case"assistant":return(0,t.jsx)(ef,{entry:e,allEntries:s,projectName:r,sessionId:n,highlightedUuid:a,autoExpandForUuid:i});case"file-history-snapshot":case"progress":case"system":return(0,t.jsx)(eg,{entry:e})}}let ew=s.default.memo(function({entry:e,allEntries:s,projectName:r,sessionId:n,isHighlighted:a,highlightedUuid:i,autoExpandForUuid:l}){return(0,t.jsxs)("div",{id:e.uuid?`entry-${e.uuid}`:void 0,className:(0,O.cn)(`group border-l-4 ${F[e.type]} bg-card/50 rounded-r-lg mb-2 hover:bg-muted/30 transition-colors`,a&&"entry-highlighted"),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-border/30",children:[(0,t.jsx)(P,{type:e.type}),(0,t.jsxs)("div",{className:"flex items-center gap-1 ml-auto",children:[e.uuid&&(0,t.jsx)(ev,{uuid:e.uuid}),(0,t.jsx)(U.CopyButton,{text:function(e){switch(e.type){case"user":return e.message.content;case"assistant":return e.message.content.filter(e=>"text"===e.type).map(e=>e.text).join("\n");case"file-history-snapshot":case"progress":case"system":return I(e);case"queue-operation":return e.label}}(e)}),(0,t.jsx)("span",{className:"text-xs font-mono text-muted-foreground whitespace-nowrap",children:R(e.timestampMs)})]})]}),(0,t.jsx)("div",{className:"px-4 py-3",children:(0,t.jsx)(eN,{entry:e,allEntries:s,projectName:r,sessionId:n,highlightedUuid:i,autoExpandForUuid:l})})]})},(e,t)=>e.entry===t.entry&&e.allEntries===t.allEntries&&e.projectName===t.projectName&&e.sessionId===t.sessionId&&e.isHighlighted===t.isHighlighted&&e.highlightedUuid===t.highlightedUuid&&e.autoExpandForUuid===t.autoExpandForUuid),ek=(0,b.default)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),eS=(0,b.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),eM=(0,Q.createServerReference)("78124f10465fb939213042a0164f96519994ead85c",Q.callServer,void 0,Q.findSourceMapURL,"checkActionCacheAndList");async function eC(e,t,s,r=!1,n,a){let i;try{i=await fetch("/api/queue-item",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"action",projectName:e,sessionId:t,itemName:s,forceRefresh:r,...n&&{agentId:n.agentId,subagentType:n.subagentType,subagentDescription:n.subagentDescription},...a&&Object.keys(a).length>0&&{inputs:a}})})}catch(e){return{ok:!1,error:`Network error: ${e instanceof Error?e.message:String(e)}`}}return 202===i.status?{ok:!1,error:"__queued__"}:i.ok?i.json():{ok:!1,error:`Queue request failed: ${i.status}`}}let eE=(0,Q.createServerReference)("7c8a475d49d2b2dac79a6c4713a9087294dc06b0a0",Q.callServer,void 0,Q.findSourceMapURL,"invalidateSessionItemCache"),eI=(0,Q.createServerReference)("00f60216926d383038abdaae6e3901a7882a850715",Q.callServer,void 0,Q.findSourceMapURL,"getQueueStatusAction");function e$({name:e}){return(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,t.jsx)("div",{className:"w-4 h-4 rounded-full bg-muted animate-pulse"}),(0,t.jsx)("span",{className:"text-sm font-mono truncate max-w-[200px] text-muted-foreground",children:e}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"running..."})]})}function eR({name:e,error:s}){return(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,t.jsx)(B,{className:"w-4 h-4 text-yellow-500"}),(0,t.jsx)("span",{className:"text-sm font-mono truncate max-w-[200px]",children:e}),(0,t.jsx)("span",{className:"text-xs text-yellow-500 truncate",children:s})]})}function eT(e,t){let s={};for(let r of e)r.required&&(void 0===t[r.name]||""===t[r.name])&&(s[r.name]="Required");return s}function eO({actionName:e,fields:r,values:n,onChange:a,onSubmit:i,disabled:l}){let[o,d]=(0,s.useState)({});return(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault();let t=eT(r,n);Object.keys(t).length>0?d(t):(d({}),i())},id:`action-input-form-${e}`,className:"ml-7 mr-3 mb-2 p-3 bg-muted/20 rounded-md border border-border/40 animate-in fade-in-0 slide-in-from-top-1 duration-200",children:[(0,t.jsx)("div",{className:"space-y-2.5",children:r.map(e=>{let s=e.label??e.name,r=o[e.name],i=!!r;return(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("label",{className:"text-[11px] font-medium text-muted-foreground tracking-wide uppercase",children:[s,e.required&&(0,t.jsx)("span",{className:"text-destructive ml-0.5",children:"*"})]}),"boolean"===e.type?(0,t.jsxs)("label",{className:"group flex items-center gap-2 cursor-pointer py-1",children:[(0,t.jsx)("input",{type:"checkbox",checked:!!n[e.name],onChange:t=>a(e.name,t.target.checked),className:"h-4 w-4 rounded border-border bg-input text-primary focus:ring-ring focus:ring-offset-0 transition-colors cursor-pointer"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground group-hover:text-foreground transition-colors",children:n[e.name]?"Enabled":"Disabled"})]}):"select"===e.type&&e.options?(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("select",{value:String(n[e.name]??""),onChange:t=>a(e.name,t.target.value),className:"text-xs px-2.5 py-1.5 pr-7 rounded-md border border-border bg-input text-foreground appearance-none cursor-pointer hover:border-primary/50 focus:outline-none focus:ring-2 focus:ring-ring/40 focus:border-primary/60 transition-all w-full",children:e.options.map(e=>(0,t.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,t.jsx)(g.ChevronDown,{className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 w-3 h-3 text-muted-foreground"})]}):"number"===e.type?(0,t.jsx)("input",{type:"number",value:void 0!==n[e.name]?String(n[e.name]):"",onChange:t=>a(e.name,""===t.target.value?void 0:Number(t.target.value)),placeholder:s,className:`text-xs px-2.5 py-1.5 rounded-md border bg-input text-foreground font-mono tabular-nums placeholder:text-muted-foreground/50 hover:border-primary/50 focus:outline-none focus:ring-2 focus:ring-ring/40 focus:border-primary/60 transition-all w-32 ${i?"border-destructive/60 focus:ring-destructive/30":"border-border"}`}):(0,t.jsx)("input",{type:"text",value:String(n[e.name]??""),onChange:t=>a(e.name,t.target.value),placeholder:s,className:`text-xs px-2.5 py-1.5 rounded-md border bg-input text-foreground placeholder:text-muted-foreground/50 hover:border-primary/50 focus:outline-none focus:ring-2 focus:ring-ring/40 focus:border-primary/60 transition-all w-full ${i?"border-destructive/60 focus:ring-destructive/30":"border-border"}`}),r&&(0,t.jsxs)("div",{className:"flex items-center gap-1 text-[10px] text-destructive mt-0.5",children:[(0,t.jsx)(B,{className:"w-2.5 h-2.5 flex-shrink-0"}),(0,t.jsx)("span",{children:r})]})]},e.name)})}),(0,t.jsx)("div",{className:"flex items-center pt-2 mt-1 border-t border-border/30",children:(0,t.jsxs)("button",{type:"submit",disabled:l,className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-[11px] font-medium rounded-md bg-primary/15 text-primary border border-primary/25 hover:bg-primary/25 hover:border-primary/40 focus:outline-none focus:ring-2 focus:ring-ring/40 active:bg-primary/30 active:scale-[0.98] transition-all duration-150 disabled:opacity-50 disabled:cursor-not-allowed disabled:active:scale-100",children:[(0,t.jsx)(C,{className:"w-3 h-3"}),"Run"]})})]})}function eA({name:e,onRun:s,disabled:r,hasInputs:n,formOpen:a,onToggleForm:i}){let l=n?`action-input-form-${e}`:void 0;return(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,t.jsx)(eS,{className:"w-4 h-4 text-muted-foreground"}),(0,t.jsx)("span",{className:"text-sm font-mono truncate max-w-[200px] text-muted-foreground",children:e}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground/50",children:"not run"}),(0,t.jsxs)("button",{onClick:n?i:s,disabled:r,"aria-expanded":n?a:void 0,"aria-controls":n?l:void 0,className:"ml-auto flex-shrink-0 inline-flex items-center gap-1 px-2 py-0.5 text-[11px] font-medium rounded border border-primary/30 bg-primary/10 text-primary hover:bg-primary/20 transition-colors disabled:opacity-50",children:[(0,t.jsx)(C,{className:"w-2.5 h-2.5"}),"Run"]})]})}function eD({result:e,cached:r,onRerun:n,globalLoading:a}){let[i,l]=(0,s.useState)(!1),[o,d]=(0,s.useState)(!1),c=e.output||e.message,u=!!c,m=async t=>{t.stopPropagation(),d(!0);try{await n(e.name)}finally{d(!1)}};if(e.error)return(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,t.jsx)(B,{className:"w-4 h-4 text-yellow-500"}),(0,t.jsx)("span",{className:"text-sm font-mono truncate max-w-[200px]",children:e.name}),(0,t.jsx)("span",{className:"text-xs text-yellow-500 truncate",title:e.error,children:e.error}),(0,t.jsx)("button",{onClick:m,disabled:o||a,className:"ml-auto flex-shrink-0 p-1 rounded hover:bg-muted/50 transition-colors disabled:opacity-50",title:"Re-run this action","aria-label":`Re-run action ${e.name}`,children:(0,t.jsx)(K.RefreshCw,{className:`w-3.5 h-3.5 text-muted-foreground ${o?"animate-spin":""}`})})]});let h="success"===e.status?(0,t.jsx)(H,{className:"w-4 h-4 text-green-500"}):(0,t.jsx)(V.XCircle,{className:"w-4 h-4 text-red-500"}),x=`action-result-${e.name}`;return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2 rounded-md hover:bg-muted/30 transition-colors",children:[u&&(0,t.jsx)("button",{onClick:()=>l(e=>!e),"aria-expanded":i,"aria-controls":x,className:"flex-shrink-0 p-0 bg-transparent border-none cursor-pointer","aria-label":`Toggle details for ${e.name}`,children:(0,t.jsx)(E.ChevronRight,{className:`w-3.5 h-3.5 text-muted-foreground transition-transform ${i?"rotate-90":""}`})}),h,(0,t.jsx)("span",{className:"text-sm font-mono truncate max-w-[200px]",children:e.name}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[e.durationMs,"ms"]}),r&&(0,t.jsx)("span",{className:"text-[10px] font-medium text-muted-foreground/70 bg-muted px-1 py-0.5 rounded",children:"cached"}),e.message&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground flex-1 truncate min-w-0",children:e.message}),(0,t.jsx)("button",{onClick:m,disabled:o||a,className:"ml-auto flex-shrink-0 p-1 rounded hover:bg-muted/50 transition-colors disabled:opacity-50",title:"Re-run this action","aria-label":`Re-run action ${e.name}`,children:(0,t.jsx)(K.RefreshCw,{className:`w-3.5 h-3.5 text-muted-foreground ${o?"animate-spin":""}`})})]}),i&&c&&(0,t.jsxs)("div",{id:x,className:"ml-10 mr-3 mb-2 relative group",children:[(0,t.jsx)("div",{className:"absolute top-1 right-1 opacity-0 group-hover:opacity-100 transition-opacity",children:(0,t.jsx)(U.CopyButton,{text:c})}),(0,t.jsx)("div",{className:"p-2 pr-8 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words select-text",children:c})]})]})}function eF({projectName:e,sessionId:r,agentId:n,subagentType:a,subagentDescription:i,compact:l}){let[o,d]=(0,s.useState)([]),[c,u]=(0,s.useState)(!0),[m,h]=(0,s.useState)(!1),[x,p]=(0,s.useState)(!1),[f,b]=(0,s.useState)(!1),[y,v]=(0,s.useState)(null),[j,N]=(0,s.useState)(!0),[w,k]=(0,s.useState)({}),[S,M]=(0,s.useState)({}),[E,I]=(0,s.useState)(new Set),$=(0,s.useRef)(0);(0,s.useEffect)(()=>{let t=++$.current;return u(!0),v(null),h(!1),d([]),eM(e,r,n,a).then(async s=>{if(t!==$.current)return;if(!s.ok){v(s.error),u(!1);return}if(!s.hasActions){h(!0),u(!1);return}let a=new Set;if(s.uncachedNames.length>0)try{let s=await eI();if(t!==$.current)return;let i=n?`${r}/agent-${n}`:r;for(let t of[...s.pending,...s.processing])"action"===t.type&&t.projectName===e&&t.sessionId===i&&a.add(t.itemName)}catch{}k(s.inputDefinitions);let i={};for(let[e,t]of Object.entries(s.inputDefinitions)){let r=s.cachedResults.find(t=>t.name===e),n={};for(let e of t){let t=r?.inputs?.[e.name];void 0!==t?n[e.name]=t:void 0!==e.default&&(n[e.name]=e.default)}i[e]=n}M(i),d(s.names.map(e=>{let t=s.cachedResults.find(t=>t.name===e);return t?{status:"done",name:e,result:t,cached:!0}:a.has(e)?{status:"loading",name:e}:{status:"idle",name:e}})),p(0===s.uncachedNames.length),u(!1)}).catch(e=>{t===$.current&&(v(e instanceof Error?e.message:"Failed to load actions"),u(!1))}),()=>{}},[e,r,n,a]),(0,s.useEffect)(()=>{if(0===o.filter(e=>"loading"===e.status).map(e=>e.name).length)return;let t=!1,s=setInterval(async()=>{try{let s=await eM(e,r,n,a);if(t||!s.ok||!s.hasActions)return;d(e=>{let t=!1,r=e.map(e=>{if("loading"!==e.status)return e;let r=s.cachedResults.find(t=>t.name===e.name);return r?(t=!0,{status:"done",name:e.name,result:r,cached:!1}):e});return t?r:e})}catch{}},3e3);return()=>{t=!0,clearInterval(s)}},[o,e,r,n,a]);let R=(0,s.useCallback)(async(t,s=!1)=>{let l=$.current;d(e=>e.map(e=>e.name===t?{status:"loading",name:t}:e)),I(e=>{let s=new Set(e);return s.delete(t),s});let o=n?{agentId:n,subagentType:a,subagentDescription:i}:void 0,c=S[t],u=c&&Object.keys(c).length>0;try{s&&await eE("actions",e,r,t,n).catch(e=>console.error("Failed to invalidate action cache:",e));let a=await eC(e,r,t,s,o,u?c:void 0);if(l!==$.current||!a.ok&&"__queued__"===a.error)return;a.ok?d(e=>e.map(e=>e.name===t?{status:"done",name:t,result:a.result,cached:!1}:e)):d(e=>e.map(e=>e.name===t?{status:"error",name:t,error:a.error}:e))}catch(e){if(l!==$.current)return;d(s=>s.map(s=>s.name===t?{status:"error",name:t,error:e instanceof Error?e.message:"Failed"}:s))}},[e,r,n,a,i,S]),T=(0,s.useCallback)(async e=>{p(!1);let t=w[e];if(t&&t.length>0){d(t=>t.map(t=>t.name===e?{status:"idle",name:e}:t)),I(t=>new Set(t).add(e));return}await R(e,!0)},[R,w]),O=(0,s.useCallback)(async()=>{let t=o.filter(e=>"idle"===e.status||"done"===e.status||"error"===e.status).filter(e=>{let t=w[e.name];return t&&t.length>0}).filter(e=>!E.has(e.name));if(t.length>0){d(e=>e.map(e=>t.some(t=>t.name===e.name)&&("done"===e.status||"error"===e.status)?{status:"idle",name:e.name}:e)),I(e=>{let s=new Set(e);return t.forEach(e=>s.add(e.name)),s});return}for(let e of o.map(e=>e.name)){let t=w[e];if(t&&t.length>0&&Object.keys(eT(t,S[e]??{})).length>0)return void I(t=>new Set(t).add(e))}let s=$.current;b(!0),I(new Set);let l=o.map(e=>e.name);d(e=>e.map(e=>({status:"loading",name:e.name})));let c=n?{agentId:n,subagentType:a,subagentDescription:i}:void 0;try{try{await Z("actions",e,r,n)}catch(e){console.error("Failed to invalidate action caches:",e)}await Promise.all(l.map(async t=>{let n=S[t],a=n&&Object.keys(n).length>0;try{let i=await eC(e,r,t,!0,c,a?n:void 0);if(s!==$.current||!i.ok&&"__queued__"===i.error)return;i.ok?d(e=>e.map(e=>e.name===t?{status:"done",name:t,result:i.result,cached:!1}:e)):d(e=>e.map(e=>e.name===t?{status:"error",name:t,error:i.error}:e))}catch(e){if(s!==$.current)return;d(s=>s.map(s=>s.name===t?{status:"error",name:t,error:e instanceof Error?e.message:"Failed"}:s))}})),s===$.current&&p(!1)}finally{s===$.current&&b(!1)}},[e,r,n,a,i,o,S,w,E]),A=o.filter(e=>"done"===e.status),D=o.filter(e=>"loading"===e.status).length,F=o.filter(e=>"idle"===e.status).length,z=A.filter(e=>"error"===e.result.status||!!e.result.error).length+o.filter(e=>"error"===e.status).length,_=A.filter(e=>"success"===e.result.status&&!e.result.error).length,q=c||D>0||f;if(m)return null;let L=l?"p-2.5":"p-4",P=l?"text-xs":"text-sm";if(c)return(0,t.jsx)("div",{className:`bg-card border border-border rounded-lg ${L}`,children:(0,t.jsxs)("div",{className:`flex items-center gap-2 ${P} text-muted-foreground`,children:[(0,t.jsx)(K.RefreshCw,{className:"w-4 h-4 animate-spin"}),"Loading actions..."]})});if(y&&0===o.length)return(0,t.jsx)("div",{className:`bg-card border border-border rounded-lg ${L}`,children:(0,t.jsxs)("div",{className:`flex items-center gap-2 ${P} text-destructive`,children:[(0,t.jsx)(B,{className:"w-4 h-4"}),y]})});if(0===o.length)return null;let U=o.filter(e=>!("done"===e.status&&e.result.skipped)),W=o.filter(e=>"done"===e.status&&e.result.skipped).length;return(0,t.jsxs)("div",{className:`bg-card border border-border rounded-lg ${L} ${j?"":"space-y-3"}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("button",{onClick:()=>N(e=>!e),"aria-expanded":!j,"aria-controls":"action-results-content",className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,t.jsx)(g.ChevronDown,{className:`w-4 h-4 text-muted-foreground transition-transform ${j?"-rotate-90":""}`}),(0,t.jsx)(ek,{className:"w-4 h-4 text-primary"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:"Actions"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[_>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1 text-xs text-green-500",children:[(0,t.jsx)(H,{className:"w-3.5 h-3.5"}),(0,t.jsx)("span",{children:_})]}),z>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1 text-xs text-yellow-500",children:[(0,t.jsx)(B,{className:"w-3.5 h-3.5"}),(0,t.jsxs)("span",{children:[z," errored"]})]}),F>0&&!q&&(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground/50",children:[F," pending"]}),D>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,t.jsx)(K.RefreshCw,{className:"w-3.5 h-3.5 animate-spin"}),(0,t.jsxs)("span",{children:[D," running..."]})]}),W>0&&!q&&(0,t.jsxs)("span",{className:"text-[10px] font-medium text-muted-foreground/50 bg-muted px-1.5 py-0.5 rounded",children:[W," skipped"]}),x&&!q&&(0,t.jsx)("span",{className:"text-[10px] font-medium text-muted-foreground/70 bg-muted px-1.5 py-0.5 rounded",children:"cached"}),(0,t.jsxs)("button",{onClick:()=>O(),disabled:q,className:"inline-flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium rounded border border-primary/30 bg-primary/10 text-primary hover:bg-primary/20 transition-colors disabled:opacity-50",children:[f?(0,t.jsx)(K.RefreshCw,{className:"w-3 h-3 animate-spin"}):(0,t.jsx)(C,{className:"w-3 h-3"}),f?"Running...":"Run All"]})]})]}),!j&&(0,t.jsx)("div",{id:"action-results-content",className:"divide-y divide-border/50",children:U.map(e=>{let s=w[e.name],r=!!s&&s.length>0,n=E.has(e.name);return"idle"===e.status?(0,t.jsxs)("div",{children:[(0,t.jsx)(eA,{name:e.name,onRun:()=>R(e.name,!0),disabled:q,hasInputs:r,formOpen:n,onToggleForm:()=>I(t=>{let s=new Set(t);return s.has(e.name)?s.delete(e.name):s.add(e.name),s})}),r&&n&&(0,t.jsx)(eO,{actionName:e.name,fields:s,values:S[e.name]??{},onChange:(t,s)=>M(r=>{let n={...r[e.name]};return void 0===s?delete n[t]:n[t]=s,{...r,[e.name]:n}}),onSubmit:()=>R(e.name,!0),disabled:q})]},e.name):"loading"===e.status?(0,t.jsx)(e$,{name:e.name},e.name):"error"===e.status?(0,t.jsx)(eR,{name:e.name,error:e.error},e.name):(0,t.jsx)(eD,{result:e.result,cached:e.cached,onRerun:T,globalLoading:f},e.name)})})]})}var ez=e.i(62363),e_=e.i(81418),eq=e.i(88092),eL=e.i(51737),eP=e.i(98919),eU=e.i(74886),eW=e.i(43531),eH=e.i(73520),eV=e.i(85881);function eB({decision:e}){return"deny"===e?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-red-500/10 text-red-400 border border-red-500/20",children:[(0,t.jsx)(eq.ShieldX,{className:"h-3 w-3"}),"Deny"]}):"instruct"===e?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-amber-500/10 text-amber-400 border border-amber-500/20",children:[(0,t.jsx)(eL.ShieldAlert,{className:"h-3 w-3"}),"Instruct"]}):(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-emerald-500/10 text-emerald-400 border border-emerald-500/20",children:[(0,t.jsx)(e_.ShieldCheck,{className:"h-3 w-3"}),"Allow"]})}function eJ({eventType:e}){return(0,t.jsx)("span",{className:"inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium bg-muted text-muted-foreground border border-border/50",children:e})}function eK({mode:e}){let s="default"===e;return(0,t.jsx)("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium border ${s?"bg-sky-500/10 text-sky-400 border-sky-500/20":"bg-amber-500/10 text-amber-400 border-amber-500/20"}`,children:e})}function eQ({ms:e}){return(0,t.jsx)("span",{className:`font-mono text-[0.7rem] ${e>500?"text-red-400":e>100?"text-amber-400":"text-muted-foreground"}`,children:e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`})}function eX({text:e}){let[r,n]=(0,s.useState)(!1),a=async t=>{t.stopPropagation();try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)}catch{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t),n(!0),setTimeout(()=>n(!1),1500)}};return(0,t.jsx)("button",{onClick:a,className:"inline-flex items-center justify-center h-5 w-5 rounded hover:bg-muted/50 text-muted-foreground hover:text-foreground transition-colors",title:"Copy",children:r?(0,t.jsx)(eW.Check,{className:"h-3 w-3 text-emerald-400"}):(0,t.jsx)(eU.Copy,{className:"h-3 w-3"})})}function eY({value:e,onChange:s}){return(0,t.jsx)("div",{className:"inline-flex items-center rounded-md border border-border bg-muted/30 p-0.5",children:[{label:"All",value:""},{label:"Allow",value:"allow"},{label:"Instruct",value:"instruct"},{label:"Deny",value:"deny"}].map(r=>(0,t.jsx)("button",{onClick:()=>s(r.value),className:`px-2.5 py-1 text-[0.65rem] font-medium rounded transition-all ${e===r.value?"deny"===r.value?"bg-red-500/15 text-red-400 shadow-sm":"allow"===r.value?"bg-emerald-500/15 text-emerald-400 shadow-sm":"instruct"===r.value?"bg-amber-500/15 text-amber-400 shadow-sm":"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:r.label},r.value))})}function eG({item:e}){return(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:9,className:"px-0 py-0",children:(0,t.jsxs)("div",{className:"px-6 py-3 bg-muted/20 border-t border-border/30 space-y-2 text-xs animate-in fade-in slide-in-from-top-1 duration-150",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-1.5",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Session ID: "}),(0,t.jsx)("span",{className:"font-mono text-foreground",children:e.sessionId??"—"}),e.sessionId&&(0,t.jsx)(eX,{text:e.sessionId})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"CWD: "}),(0,t.jsx)("span",{className:"font-mono text-foreground",children:e.cwd??"—"}),e.cwd&&(0,t.jsx)(eX,{text:e.cwd})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Transcript: "}),(0,t.jsx)("span",{className:"font-mono text-foreground break-all",children:e.transcriptPath??"—"})]})]}),e.reason&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Full reason: "}),(0,t.jsx)("span",{className:"text-foreground",children:e.reason})]})]})})})}function eZ({sessionId:e,initialData:r}){let{intervalSec:n}=(0,eV.useAutoRefresh)(),[a,i]=(0,s.useState)(!1),[l,o]=(0,s.useState)(1),[d,c]=(0,s.useState)(r),[u,m]=(0,s.useState)(null),[h,x]=(0,s.useState)(""),[p,f]=(0,s.useState)(""),[b,y]=(0,s.useState)(""),v=(0,s.useRef)(null),j=(0,s.useRef)({filterDecision:h,filterEventType:p,filterPolicy:b});j.current={filterDecision:h,filterEventType:p,filterPolicy:b};let N=""!==h||""!==p||""!==b,w=(0,s.useCallback)(async t=>{try{let{filterDecision:s,filterEventType:r,filterPolicy:n}=j.current,a=await (0,ez.searchHookActivityAction)({sessionId:e,decision:s||void 0,eventType:r||void 0,policyName:n||void 0},t);c(a)}catch{}},[e]);(0,s.useEffect)(()=>{w(l);let e=setInterval(()=>w(l),n>0?1e3*n:5e3);return()=>clearInterval(e)},[l,w,n]),(0,s.useEffect)(()=>(v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{o(1),m(null),w(1)},300),()=>{v.current&&clearTimeout(v.current)}),[h,p,b]);let k=d.entries,S=d.totalPages;return(0,t.jsxs)("div",{children:[(0,t.jsxs)("button",{onClick:()=>i(e=>!e),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,t.jsx)(g.ChevronDown,{className:`w-4 h-4 text-muted-foreground transition-transform ${a?"-rotate-90":""}`}),(0,t.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Hook Logs"})]}),!a&&(0,t.jsxs)("div",{className:"mt-2 bg-card border border-border rounded-lg overflow-hidden shadow-sm",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4 py-2.5 border-b border-border bg-muted/20",children:[(0,t.jsx)(eY,{value:h,onChange:x}),(0,t.jsxs)("select",{value:p,onChange:e=>f(e.target.value),className:"h-7 rounded-md border border-border bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/40 transition-shadow",children:[(0,t.jsx)("option",{value:"",children:"All Events"}),(0,t.jsx)("option",{value:"PreToolUse",children:"PreToolUse"}),(0,t.jsx)("option",{value:"PostToolUse",children:"PostToolUse"}),(0,t.jsx)("option",{value:"SessionStart",children:"SessionStart"}),(0,t.jsx)("option",{value:"SessionEnd",children:"SessionEnd"}),(0,t.jsx)("option",{value:"UserPromptSubmit",children:"UserPromptSubmit"}),(0,t.jsx)("option",{value:"PermissionRequest",children:"PermissionRequest"})]}),(0,t.jsx)("div",{className:"relative",children:(0,t.jsx)("input",{type:"text",value:b,onChange:e=>y(e.target.value),placeholder:"Filter by policy…",className:"h-7 rounded-md border border-border bg-background px-2.5 text-xs text-foreground placeholder:text-muted-foreground w-44 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/40 transition-shadow"})})]}),0===k.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 px-4",children:[(0,t.jsx)(eP.Shield,{className:"h-10 w-10 text-muted-foreground/30"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-3",children:N?"No matching hook events.":"No hook events found."})]}):(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full text-xs",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"text-left text-muted-foreground border-b border-border bg-muted/30",children:[(0,t.jsx)("th",{className:"px-4 py-2.5 font-medium w-6"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Decision"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Event"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Tool"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Policy"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Reason"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Duration"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Mode"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium text-right",children:"Time"})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-border/30",children:k.map((e,r)=>{var n;let a,i="deny"===e.decision,l=u===r,o="instruct"===e.decision;return(0,t.jsxs)(s.default.Fragment,{children:[(0,t.jsxs)("tr",{onClick:()=>{m(e=>e===r?null:r)},className:`cursor-pointer transition-colors ${i?"bg-red-500/[0.03] hover:bg-red-500/[0.07] border-l-2 border-l-red-500/40":o?"bg-amber-500/[0.03] hover:bg-amber-500/[0.07] border-l-2 border-l-amber-500/40":r%2==0?"hover:bg-muted/30":"bg-muted/[0.04] hover:bg-muted/30"} ${l?"bg-muted/20":""}`,children:[(0,t.jsx)("td",{className:"px-4 py-2",children:(0,t.jsx)(g.ChevronDown,{className:`h-3.5 w-3.5 text-muted-foreground transition-transform duration-150 ${l?"rotate-0":"-rotate-90"}`})}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(eB,{decision:e.decision})}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(eJ,{eventType:e.eventType})}),(0,t.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:e.toolName??"—"}),(0,t.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:e.policyName??"—"}),(0,t.jsx)("td",{className:"px-3 py-2 text-muted-foreground truncate max-w-[240px]",title:e.reason??"",children:e.reason??"—"}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(eQ,{ms:e.durationMs})}),(0,t.jsx)("td",{className:"px-3 py-2",children:e.permissionMode?(0,t.jsx)(eK,{mode:e.permissionMode}):"—"}),(0,t.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground whitespace-nowrap",title:new Date(e.timestamp).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),children:(n=e.timestamp,(a=Date.now()-n)<6e4?`${Math.max(1,Math.floor(a/1e3))}s ago`:a<36e5?`${Math.floor(a/6e4)}m ago`:a<864e5?`${Math.floor(a/36e5)}h ago`:`${Math.floor(a/864e5)}d ago`)})]}),l&&(0,t.jsx)(eG,{item:e})]},`${e.timestamp}-${r}`)})})]})}),(0,t.jsx)(eH.default,{currentPage:l,totalPages:S,onPageChange:e=>{o(e),m(null)}})]})]})}function e0(e){let t=new Map;for(let s of e)if("assistant"===s.type)for(let e of s.message.content){if("tool_use"!==e.type||"Task"===e.name&&(e.subagentType||e.subagentId))continue;let s=t.get(e.name)||{count:0,totalDurationMs:0};s.count++,e.result?.durationMs&&(s.totalDurationMs+=e.result.durationMs),t.set(e.name,s)}return Array.from(t.entries()).map(([e,t])=>({name:e,...t})).sort((e,t)=>t.count-e.count)}function e1({tools:e,compact:s}){return(0,t.jsx)("div",{className:`bg-card border border-border rounded-lg ${s?"p-3":"p-4"}`,children:(0,t.jsx)("div",{className:`grid grid-cols-[repeat(auto-fit,minmax(200px,1fr))] ${s?"gap-2":"gap-3"}`,children:e.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,t.jsx)(y,{className:"w-3.5 h-3.5 text-muted-foreground flex-shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("div",{className:`${s?"text-xs":"text-sm"} font-mono font-medium truncate`,children:e.name}),(0,t.jsxs)("div",{className:"text-xs text-muted-foreground truncate",children:[e.count," call",1!==e.count?"s":"",e.totalDurationMs>0&&` \xb7 ${(e.totalDurationMs/1e3).toFixed(1)}s`]})]})]},e.name))})})}function e2(e){return`${e.uuid}-${e.timestampMs}`}function e5(){let e=window.location.hash;return e.startsWith("#entry-")?e.slice(7):null}function e3({entries:e,allEntries:n,projectName:a,sessionId:i}){let[l,o]=(0,s.useState)(new Set),[c,m]=(0,s.useState)(0),[p,g]=(0,s.useState)(()=>e5()),b=(0,s.useRef)(void 0),y=(0,s.useRef)(!1),v=(0,s.useCallback)(e=>{e&&m(e.offsetTop)},[]),j=(0,s.useMemo)(()=>(function(e){let t=new Map,s=null,r=0;for(let n of e)"queue-operation"===n.type?(null!==s&&t.set(s,r),s=e2(n),r=0):null!==s&&r++;return null!==s&&t.set(s,r),t})(e),[e]),N=(0,s.useMemo)(()=>{let t;return t=!1,e.filter(e=>"queue-operation"===e.type?(t=l.has(e2(e)),!0):!t)},[e,l]),w=(0,s.useMemo)(()=>{let e=new Map;return N.forEach((t,s)=>{t.uuid&&e.set(t.uuid,s)}),e},[N]),k=(0,s.useMemo)(()=>(function(e){let t=new Map;for(let s of e)if("assistant"===s.type&&s.uuid)for(let e of s.message.content)"tool_use"===e.type&&"Task"===e.name&&e.subagentId&&t.set(e.subagentId,s.uuid);let s=new Map;for(let r of e){if(!r._source?.startsWith("agent-")||!r.uuid)continue;let e=r._source.slice(6),n=t.get(e);n&&s.set(r.uuid,n)}return s})(n),[n]),S=(0,s.useMemo)(()=>p&&k.has(p)?p:null,[p,k]),M=S?k.get(S)??null:null;(0,s.useEffect)(()=>{if(p)return b.current=setTimeout(()=>g(null),4e3),()=>{b.current&&clearTimeout(b.current)}},[]),(0,s.useEffect)(()=>{let e=()=>{let e=e5();g(e),y.current=!1,b.current&&clearTimeout(b.current),e&&(b.current=setTimeout(()=>g(null),4e3))};return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[]);let C=(0,s.useMemo)(()=>{if(!p)return null;let t=M??p,s=e.some(e=>e.uuid===t),r=w.has(t);if(s&&!r){let s=null;for(let r of e)if("queue-operation"===r.type)s=e2(r);else if(r.uuid===t&&s)return s}return null},[p,M,e,w]);(0,s.useEffect)(()=>{if(!C)return;let e=requestAnimationFrame(()=>{o(e=>{if(!e.has(C))return e;let t=new Set(e);return t.delete(C),t})});return()=>cancelAnimationFrame(e)},[C]);let E=(0,s.useCallback)(e=>{o(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]),I=function({useFlushSync:e=!0,...t}){let n=s.useReducer(()=>({}),{})[1],a={...t,onChange:(s,a)=>{var i;e&&a?(0,r.flushSync)(n):n(),null==(i=t.onChange)||i.call(t,s,a)}},[i]=s.useState(()=>new x(a));return i.setOptions(a),f(()=>i._didMount(),[]),f(()=>i._willUpdate()),i}({getScrollElement:()=>"u">typeof document?window:null,observeElementRect:d,observeElementOffset:u,scrollToFn:h,initialOffset:()=>"u">typeof document?window.scrollY:0,...{count:N.length,estimateSize:e=>(function(e){switch(e.type){case"queue-operation":return 48;case"user":return 90;case"assistant":return 80+120*e.message.content.length;default:return 100}})(N[e]),overscan:5,scrollMargin:c}});return(0,s.useEffect)(()=>{if(!p||y.current)return;let e=M??p,t=w.get(e);null!=t&&(y.current=!0,requestAnimationFrame(()=>{I.scrollToIndex(t,{align:"center"})}))},[p,M,w,I]),(0,t.jsx)("div",{ref:v,children:(0,t.jsx)("div",{style:{height:`${I.getTotalSize()}px`,width:"100%",position:"relative"},children:I.getVirtualItems().map(e=>{let s=N[e.index],r=!!p&&s.uuid===(M??p);return(0,t.jsx)("div",{"data-index":e.index,ref:I.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${e.start-I.options.scrollMargin}px)`},children:"queue-operation"===s.type?(0,t.jsx)(T,{entry:s,isCollapsed:l.has(e2(s)),entryCount:j.get(e2(s))??0,onToggle:()=>E(e2(s))}):(0,t.jsx)(ew,{entry:s,allEntries:n,projectName:a,sessionId:i,isHighlighted:!S&&r,highlightedUuid:S,autoExpandForUuid:S})},"queue-operation"===s.type?e2(s):s.uuid||s.timestamp)})})})}e.s([],76248),e.i(76248),e.s(["default",0,function({entries:e,projectName:r,sessionId:n}){let a=(0,s.useMemo)(()=>e.filter(e=>"session"===e._source),[e]),i=(0,s.useMemo)(()=>(function(e){let t=new Map;for(let s of e)if("assistant"===s.type)for(let e of s.message.content)"tool_use"===e.type&&"Task"===e.name&&e.subagentId&&(t.has(e.subagentId)||t.set(e.subagentId,{id:e.subagentId,type:e.subagentType||"unknown",description:e.subagentDescription||""}));return Array.from(t.values())})(e),[e]),l=(0,s.useMemo)(()=>{let t=new Map;for(let s of i){let r=`agent-${s.id}`;t.set(s.id,e.filter(e=>e._source===r))}return t},[e,i]),o=(0,s.useMemo)(()=>e0(a),[a]),[d,c]=(0,s.useState)(!1),[u,m]=(0,s.useState)(new Set),[h,x]=(0,s.useState)(!1),[p,f]=(0,s.useState)(null);(0,s.useEffect)(()=>{(0,ez.searchHookActivityAction)({sessionId:n},1).then(e=>{e.entries.length>0&&f(e)}).catch(()=>{})},[n]),(0,s.useEffect)(()=>{let e=()=>{window.location.hash.startsWith("#entry-")&&x(!1)};return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[]);let b=(0,s.useCallback)(e=>{m(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]);return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(M,{entries:a}),p&&(0,t.jsx)(eZ,{sessionId:n,initialData:p},n),(0,t.jsx)(ea,{projectName:r,sessionId:n}),(0,t.jsx)(em,{projectName:r,sessionId:n}),(0,t.jsx)(eF,{projectName:r,sessionId:n}),i.length>0&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("button",{onClick:()=>c(e=>!e),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,t.jsx)(g.ChevronDown,{className:`w-4 h-4 text-muted-foreground transition-transform ${d?"-rotate-90":""}`}),(0,t.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Subagents"}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",i.length,")"]})]}),!d&&i.map(e=>{let s;return(0,t.jsxs)("div",{className:"pl-3 border-l-2 border-primary/30 space-y-2",children:[(0,t.jsxs)("button",{onClick:()=>b(e.id),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,t.jsx)(g.ChevronDown,{className:`w-3.5 h-3.5 text-muted-foreground transition-transform ${u.has(e.id)?"-rotate-90":""}`}),(0,t.jsx)("span",{className:"text-sm font-bold",children:e.type}),e.description&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground truncate max-w-[400px]",children:e.description})]}),!u.has(e.id)&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(M,{entries:l.get(e.id)||[],compact:!0}),p&&(0,t.jsx)(eZ,{sessionId:n,initialData:p},`hooks-${e.id}`),(0,t.jsx)(ea,{projectName:r,sessionId:n,agentId:e.id,subagentType:e.type,subagentDescription:e.description,compact:!0}),(0,t.jsx)(em,{projectName:r,sessionId:n,agentId:e.id,subagentType:e.type,subagentDescription:e.description,compact:!0}),(0,t.jsx)(eF,{projectName:r,sessionId:n,agentId:e.id,subagentType:e.type,subagentDescription:e.description,compact:!0}),(s=e0(l.get(e.id)||[])).length>0?(0,t.jsx)(e1,{tools:s,compact:!0}):null]})]},e.id)})]}),o.length>0&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Tools"}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",o.reduce((e,t)=>e+t.count,0),")"]})]}),(0,t.jsx)(e1,{tools:o})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("button",{onClick:()=>x(e=>!e),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,t.jsx)(g.ChevronDown,{className:`w-4 h-4 text-muted-foreground transition-transform ${h?"-rotate-90":""}`}),(0,t.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Logs"})]}),!h&&(0,t.jsx)("div",{className:"mt-2 bg-card border border-border rounded-lg p-4 shadow-sm",children:0===a.length?(0,t.jsx)("p",{className:"text-muted-foreground text-center py-8",children:"No entries found."}):(0,t.jsx)(e3,{entries:a,allEntries:e,projectName:r,sessionId:n})})]})]})}],36406)},5780,e=>{e.n(e.i(36406))}]);
4
+ color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,null==s?void 0:s.key)}return(null==s?void 0:s.onChange)&&!(a&&s.skipInitialOnChange)&&s.onChange(r),a=!1,r}return i.updateDeps=e=>{n=e},i}function a(e,t){if(void 0!==e)return e;throw Error(`Unexpected undefined${t?`: ${t}`:""}`)}e.i(47167);let i=e=>e,l=e=>{let t=Math.max(e.startIndex-e.overscan,0),s=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let e=t;e<=s;e++)r.push(e);return r},o={passive:!0},d=(e,t)=>{let s=e.scrollElement;if(!s)return;let r=()=>{t({width:s.innerWidth,height:s.innerHeight})};return r(),s.addEventListener("resize",r,o),()=>{s.removeEventListener("resize",r)}},c="u"<typeof window||"onscrollend"in window,u=(e,t)=>{var s,r;let n,a=e.scrollElement;if(!a)return;let i=e.targetWindow;if(!i)return;let l=0,d=e.options.useScrollendEvent&&c?()=>void 0:(s=()=>{t(l,!1)},r=e.options.isScrollingResetDelay,function(...e){i.clearTimeout(n),n=i.setTimeout(()=>s.apply(this,e),r)}),u=s=>()=>{l=a[e.options.horizontal?"scrollX":"scrollY"],d(),t(l,s)},m=u(!0),h=u(!1);a.addEventListener("scroll",m,o);let x=e.options.useScrollendEvent&&c;return x&&a.addEventListener("scrollend",h,o),()=>{a.removeEventListener("scroll",m),x&&a.removeEventListener("scrollend",h)}},m=(e,t,s)=>{if(null==t?void 0:t.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[s.options.horizontal?"inlineSize":"blockSize"])}return e[s.options.horizontal?"offsetWidth":"offsetHeight"]},h=(e,{adjustments:t=0,behavior:s},r)=>{var n,a;null==(a=null==(n=r.scrollElement)?void 0:n.scrollTo)||a.call(n,{[r.options.horizontal?"left":"top"]:e+t,behavior:s})};class x{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var e,t,s;return(null==(s=null==(t=null==(e=this.targetWindow)?void 0:e.performance)?void 0:t.now)?void 0:s.call(t))??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,s=this.indexFromElement(t);t.isConnected?this.shouldMeasureDuringScroll(s)&&this.resizeItem(s,this.options.measureElement(t,e,this)):this.observer.unobserve(t)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}):null);return{disconnect:()=>{var s;null==(s=t())||s.disconnect(),e=null},observe:e=>{var s;return null==(s=t())?void 0:s.observe(e,{box:"border-box"})},unobserve:e=>{var s;return null==(s=t())?void 0:s.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([t,s])=>{void 0===s&&delete e[t]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:i,rangeExtractor:l,onChange:()=>{},measureElement:m,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var t,s;null==(s=(t=this.options).onChange)||s.call(t,this,e)},this.maybeNotify=n(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),null!=this.rafId&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;let t=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==t){if(this.cleanup(),!t)return void this.maybeNotify();this.scrollElement=t,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(e=this.scrollElement)?void 0:e.window)??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?"forward":"backward":null,this.scrollOffset=e,this.isScrolling=t,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??("function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{let s=new Map,r=new Map;for(let n=t-1;n>=0;n--){let t=e[n];if(s.has(t.lane))continue;let a=r.get(t.lane);if(null==a||t.end>a.end?r.set(t.lane,t):t.end<a.end&&s.set(t.lane,!0),s.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=n(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(e,t,s,r,n,a)=>(void 0!==this.prevLanes&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:s,getItemKey:r,enabled:n,lanes:a}),{key:!1}),this.getMeasurements=n(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:s,getItemKey:r,enabled:n,lanes:a},i)=>{if(!n)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),0!==this.measurementsCache.length||this.lanesSettling||(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let l=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1);let o=this.measurementsCache.slice(0,l),d=Array(a).fill(void 0);for(let e=0;e<l;e++){let t=o[e];t&&(d[t.lane]=e)}for(let n=l;n<e;n++){let e,a,l=r(n),c=this.laneAssignments.get(n);if(void 0!==c&&this.options.lanes>1){let r=d[e=c],n=void 0!==r?o[r]:void 0;a=n?n.end+this.options.gap:t+s}else{let r=1===this.options.lanes?o[n-1]:this.getFurthestMeasurement(o,n);a=r?r.end+this.options.gap:t+s,e=r?r.lane:n%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(n,e)}let u=i.get(l),m="number"==typeof u?u:this.options.estimateSize(n),h=a+m;o[n]={index:n,start:a,size:m,end:h,key:l,lane:e},d[e]=n}return this.measurementsCache=o,o},{key:!1,debug:()=>this.options.debug}),this.calculateRange=n(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,s,r)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:s,lanes:r}){let n=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:n};let a=p(0,n,t=>e[t].start,s),i=a;if(1===r)for(;i<n&&e[i].end<s+t;)i++;else if(r>1){let l=Array(r).fill(0);for(;i<n&&l.some(e=>e<s+t);){let t=e[i];l[t.lane]=t.end,i++}let o=Array(r).fill(s+t);for(;a>=0&&o.some(e=>e>=s);){let t=e[a];o[t.lane]=t.start,a--}a=Math.max(0,a-a%r),i=Math.min(n,i+(r-1-i%r))}return{startIndex:a,endIndex:i}}({measurements:e,outerSize:t,scrollOffset:s,lanes:r}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=n(()=>{let e=null,t=null,s=this.calculateRange();return s&&(e=s.startIndex,t=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,s,r,n)=>null===r||null===n?[]:e({startIndex:r,endIndex:n,overscan:t,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,s=e.getAttribute(t);return s?parseInt(s,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{var t;if(!this.scrollState||"smooth"!==this.scrollState.behavior)return!0;let s=this.scrollState.index??(null==(t=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))?void 0:t.index);if(void 0!==s&&this.range){let t=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,s-t),n=Math.min(this.options.count-1,s+t);return e>=r&&e<=n}return!0},this.measureElement=e=>{if(!e)return void this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});let t=this.indexFromElement(e),s=this.options.getItemKey(t),r=this.elementsCache.get(s);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(s,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{var s;let r=this.measurementsCache[e];if(!r)return;let n=t-(this.itemSizeCache.get(r.key)??r.size);0!==n&&((null==(s=this.scrollState)?void 0:s.behavior)!=="smooth"&&(void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(r,n,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=n,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,t)),this.notify(!1))},this.getVirtualItems=n(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let s=[];for(let r=0,n=e.length;r<n;r++){let n=t[e[r]];s.push(n)}return s},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(0!==t.length)return a(t[p(0,t.length-1,e=>a(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(e,t,s=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),n=this.getScrollOffset();return"auto"===t&&(t=e>=n+r?"end":"start"),"center"===t?e+=(s-r)/2:"end"===t&&(e-=r),Math.max(Math.min(this.getMaxScrollOffset(),e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));let s=this.getSize(),r=this.getScrollOffset(),n=this.measurementsCache[e];if(!n)return;if("auto"===t)if(n.end>=r+s-this.options.scrollPaddingEnd)t="end";else{if(!(n.start<=r+this.options.scrollPaddingStart))return[r,t];t="start"}if("end"===t&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a="end"===t?n.end+this.options.scrollPaddingEnd:n.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,n.size),t]},this.scrollToOffset=(e,{align:t="start",behavior:s="auto"}={})=>{let r=this.getOffsetForAlignment(e,t),n=this.now();this.scrollState={index:null,align:t,behavior:s,startedAt:n,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t="auto",behavior:s="auto"}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[n,a]=r,i=this.now();this.scrollState={index:e,align:a,behavior:s,startedAt:i,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t="auto"}={})=>{let s=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:"start",behavior:t,startedAt:r,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var e;let t,s=this.getMeasurements();if(0===s.length)t=this.options.paddingStart;else if(1===this.options.lanes)t=(null==(e=s[s.length-1])?void 0:e.end)??0;else{let e=Array(this.options.lanes).fill(null),r=s.length-1;for(;r>=0&&e.some(e=>null===e);){let t=s[r];null===e[t.lane]&&(e[t.lane]=t.end),r--}t=Math.max(...e.filter(e=>null!==e))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:s})=>{this.options.scrollToFn(e,{behavior:s,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}null==this.rafId&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=null!=this.scrollState.index?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,t=e?e[0]:this.scrollState.lastTargetOffset,s=t!==this.scrollState.lastTargetOffset;if(!s&&1.01>Math.abs(t-this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.scrollState=null;return}}else this.scrollState.stableFrames=0,s&&(this.scrollState.lastTargetOffset=t,this.scrollState.behavior="auto",this._scrollToOffset(t,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}let p=(e,t,s,r)=>{for(;e<=t;){let n=(e+t)/2|0,a=s(n);if(a<r)e=n+1;else{if(!(a>r))return n;t=n-1}}return e>0?e-1:0},f="u">typeof document?s.useLayoutEffect:s.useEffect;var g=e.i(64659),b=e.i(75254);let y=(0,b.default)("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]),v=(0,b.default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),j=(0,b.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"}]]),N=(0,b.default)("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]),w=(0,b.default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);var k=e.i(86311);let S=(0,b.default)("workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]),M=s.default.memo(function({entries:e,compact:r=!1}){let n=(0,s.useMemo)(()=>(function(e){let t=0,s=0,r=0,n=0,a=0,i=new Set;for(let l of e)if("user"===l.type&&t++,"queue-operation"===l.type&&a++,"assistant"===l.type){for(let e of(s++,l.message.content))"tool_use"===e.type&&("Task"===e.name&&(e.subagentType||e.subagentId)?n++:r++);l.message.model&&i.add(l.message.model)}let l="";return e.length>=2&&(l=function(e){if(e<1e3)return`${e}ms`;let t=e/1e3;if(t<60)return`${t.toFixed(1)}s`;let s=Math.floor(t/60);if(s>=60){let e=Math.floor(s/60);return`${e}h ${s%60}m`}let r=(t%60).toFixed(0);return`${s}m ${r}s`}(e[e.length-1].timestampMs-e[0].timestampMs)),{turnCount:a,userCount:t,assistantCount:s,toolCallCount:r,subagentCount:n,duration:l,models:Array.from(i)}})(e),[e]),a=r?"w-3.5 h-3.5":"w-4 h-4",i=r?"text-xs font-medium":"text-sm font-medium",l=r?"text-[10px] text-muted-foreground":"text-xs text-muted-foreground",o=[...r?[]:[{Icon:k.MessageSquare,color:"text-primary",v:n.turnCount,l:"Turns"}],{Icon:v,color:"text-[color:var(--chart-1)]",v:n.userCount,l:"User"},{Icon:j,color:"text-[color:var(--chart-2)]",v:n.assistantCount,l:"Assistant"},{Icon:y,color:"text-[color:var(--chart-3)]",v:n.toolCallCount,l:r?"Tools":"Tool Calls"},{Icon:S,color:"text-[color:var(--chart-5)]",v:n.subagentCount,l:"Subagents"},{Icon:w,color:"text-[color:var(--chart-4)]",v:n.duration||"—",l:"Duration"},{Icon:N,color:"text-[color:var(--chart-5)]",v:n.models.length>0?n.models.join(", "):"—",l:r?"Model":"Model(s)"}];return(0,t.jsx)("div",{className:r?"bg-muted/30 border border-border/50 rounded-lg p-3 mb-3":"bg-card border border-border rounded-lg p-4",children:(0,t.jsx)("div",{className:`grid grid-cols-2 ${r?"sm:grid-cols-6 gap-3":"sm:grid-cols-4 lg:grid-cols-7 gap-4"}`,children:o.map(({Icon:e,color:s,v:r,l:n})=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(e,{className:`${a} ${s}`}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:`${i} truncate max-w-[120px]`,children:r}),(0,t.jsx)("div",{className:l,children:n})]})]},n))})})}),C=(0,b.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);var E=e.i(63059);function I(e){return JSON.stringify(e.raw,null,2)}let $=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0});function R(e){let t=new Date(e),s=$.format(t),r=t.getMilliseconds().toString().padStart(3,"0");return`${s}.${r}`}let T=s.default.memo(function({entry:e,isCollapsed:s,entryCount:r,onToggle:n}){let a="function"==typeof n,i=(0,t.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full bg-primary/10 border border-primary/20 text-primary text-xs font-medium${a?" group-hover:bg-primary/20 transition-colors":""}`,children:[a?(0,t.jsx)(E.ChevronRight,{className:`w-3 h-3 transition-transform ${s?"":"rotate-90"}`}):(0,t.jsx)(C,{className:"w-3 h-3"}),(0,t.jsx)("span",{children:e.label}),(0,t.jsx)("span",{className:"text-muted-foreground",children:R(e.timestampMs)}),a&&s&&"number"==typeof r&&(0,t.jsxs)("span",{className:"ml-1 px-1.5 py-0.5 rounded bg-primary/20 text-[10px] leading-none",children:[r," ",1===r?"entry":"entries"]})]});return a?(0,t.jsxs)("button",{type:"button",onClick:n,className:"group flex items-center gap-3 py-3 px-4 w-full cursor-pointer",children:[(0,t.jsx)("div",{className:"flex-1 h-px bg-primary/30"}),i,(0,t.jsx)("div",{className:"flex-1 h-px bg-primary/30"})]}):(0,t.jsxs)("div",{className:"flex items-center gap-3 py-3 px-4",children:[(0,t.jsx)("div",{className:"flex-1 h-px bg-primary/30"}),i,(0,t.jsx)("div",{className:"flex-1 h-px bg-primary/30"})]})});var O=e.i(47163);let A={user:"User",assistant:"Assistant","file-history-snapshot":"Snapshot",progress:"Progress",system:"System","queue-operation":"Queue"},D={user:"bg-[color:var(--chart-1)]/20 text-[color:var(--chart-1)] border-[color:var(--chart-1)]/30",assistant:"bg-[color:var(--chart-2)]/20 text-[color:var(--chart-2)] border-[color:var(--chart-2)]/30","file-history-snapshot":"bg-[color:var(--chart-3)]/20 text-[color:var(--chart-3)] border-[color:var(--chart-3)]/30",progress:"bg-[color:var(--chart-5)]/20 text-[color:var(--chart-5)] border-[color:var(--chart-5)]/30",system:"bg-[color:var(--chart-4)]/20 text-[color:var(--chart-4)] border-[color:var(--chart-4)]/30","queue-operation":"bg-primary/20 text-primary border-primary/30"},F={user:"border-l-[color:var(--chart-1)]",assistant:"border-l-[color:var(--chart-2)]","file-history-snapshot":"border-l-[color:var(--chart-3)]",progress:"border-l-[color:var(--chart-5)]",system:"border-l-[color:var(--chart-4)]","queue-operation":"border-l-primary"},z=(0,b.default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),_=(0,b.default)("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);var q=e.i(39616);function L({type:e}){let s="w-4 h-4";switch(e){case"user":return(0,t.jsx)(v,{className:s});case"assistant":return(0,t.jsx)(j,{className:s});case"file-history-snapshot":return(0,t.jsx)(z,{className:s});case"progress":return(0,t.jsx)(_,{className:s});case"system":return(0,t.jsx)(q.Settings,{className:s});case"queue-operation":return(0,t.jsx)(C,{className:s})}}function P({type:e}){return(0,t.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 text-xs font-mono rounded border ${D[e]}`,children:[(0,t.jsx)(L,{type:e}),A[e]]})}var U=e.i(24380);function W({block:e}){let r=(0,s.useMemo)(()=>JSON.stringify(e.input,null,2),[e]);return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("details",{open:!0,children:[(0,t.jsx)("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1",children:["Input",(0,t.jsx)(U.CopyButton,{text:r})]})}),(0,t.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words max-h-64 overflow-y-auto",children:r})]}),e.result?(0,t.jsxs)("div",{className:"border-l-2 border-primary/50 pl-3 space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"inline-block px-2 py-0.5 text-xs font-mono rounded border bg-primary/20 text-primary border-primary/30",children:"Result"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:R(new Date(e.result.timestamp).getTime())})]}),e.result.content&&(0,t.jsxs)("details",{open:!0,children:[(0,t.jsx)("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1",children:["Output",(0,t.jsx)(U.CopyButton,{text:e.result.content})]})}),(0,t.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words max-h-48 overflow-y-auto",children:e.result.content})]}),e.result.images?.map((e,s)=>(0,t.jsx)("img",{src:`data:${e.mediaType};base64,${e.base64}`,alt:`Tool result image ${s+1}`,className:"mt-2 max-w-full rounded border border-border"},s))]}):(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:"Tool did not return a result"})]})}let H=(0,b.default)("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);var V=e.i(1742);let B=(0,b.default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),J=(0,b.default)("chart-column",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);var K=e.i(16715),Q=e.i(95187);let X=(0,Q.createServerReference)("785915de030ea45e2100c31b7cfa5d56b8f4aab6ee",Q.callServer,void 0,Q.findSourceMapURL,"checkEvalCacheAndList");async function Y(e,t,s,r=!1,n){let a;try{a=await fetch("/api/queue-item",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"eval",projectName:e,sessionId:t,itemName:s,forceRefresh:r,...n&&{agentId:n.agentId,subagentType:n.subagentType,subagentDescription:n.subagentDescription}})})}catch(e){return{ok:!1,error:`Network error: ${e instanceof Error?e.message:String(e)}`}}return 202===a.status?{ok:!1,error:"__queued__"}:a.ok?a.json():{ok:!1,error:`Queue request failed: ${a.status}`}}let G=(0,Q.createServerReference)("6031e40db00f6818c1a0c91bc87d882d5d0b166986",Q.callServer,void 0,Q.findSourceMapURL,"clearAlertMarker"),Z=(0,Q.createServerReference)("78411e927859c091959424b08f0a5db41a78d57da2",Q.callServer,void 0,Q.findSourceMapURL,"invalidateSessionItemCaches");function ee({score:e}){let s=Math.round(100*e);return(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"flex-1 h-2 bg-muted rounded-full overflow-hidden max-w-[80px]",children:(0,t.jsx)("div",{className:`h-full rounded-full transition-all ${e>=.8?"bg-green-500":e>=.5?"bg-yellow-500":"bg-red-500"}`,style:{width:`${s}%`}})}),(0,t.jsxs)("span",{className:"text-xs font-mono text-muted-foreground w-8",children:[s,"%"]})]})}function et({result:e}){return e.error?(0,t.jsx)(B,{className:"w-4 h-4 text-yellow-500"}):e.pass?(0,t.jsx)(H,{className:"w-4 h-4 text-green-500"}):(0,t.jsx)(V.XCircle,{className:"w-4 h-4 text-red-500"})}function es({name:e}){return(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,t.jsx)("div",{className:"w-4 h-4 rounded-full bg-muted animate-pulse"}),(0,t.jsx)("span",{className:"text-sm font-mono truncate max-w-[200px] text-muted-foreground",children:e}),(0,t.jsx)("div",{className:"flex-1 h-2 bg-muted rounded-full animate-pulse max-w-[80px]"})]})}function er({name:e,error:s}){return(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,t.jsx)(B,{className:"w-4 h-4 text-yellow-500"}),(0,t.jsx)("span",{className:"text-sm font-mono truncate max-w-[200px]",children:e}),(0,t.jsx)("span",{className:"text-xs text-yellow-500 truncate",children:s})]})}function en({result:e,cached:r,onRerun:n,globalLoading:a}){let[i,l]=(0,s.useState)(!1),[o,d]=(0,s.useState)(!1),c=e.error||e.message,u=!!c,m=async t=>{t.stopPropagation(),d(!0);try{await n(e.name)}finally{d(!1)}};return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:`flex items-center gap-3 px-3 py-2 rounded-md hover:bg-muted/30 transition-colors ${u?"cursor-pointer":""}`,onClick:()=>u&&l(e=>!e),children:[u&&(0,t.jsx)(E.ChevronRight,{className:`w-3.5 h-3.5 text-muted-foreground transition-transform ${i?"rotate-90":""}`}),(0,t.jsx)(et,{result:e}),(0,t.jsx)("span",{className:"text-sm font-mono truncate max-w-[200px]",children:e.name}),(0,t.jsx)(ee,{score:e.score}),r&&(0,t.jsx)("span",{className:"text-[10px] font-medium text-muted-foreground/70 bg-muted px-1 py-0.5 rounded",children:"cached"}),e.error&&(0,t.jsx)("span",{className:"text-xs text-yellow-500 flex-1 truncate min-w-0",children:e.error}),e.message&&!e.error&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground flex-1 truncate min-w-0",children:e.message}),(0,t.jsx)("button",{onClick:m,disabled:o||a,className:"ml-auto flex-shrink-0 p-1 rounded hover:bg-muted/50 transition-colors disabled:opacity-50",title:"Re-run this eval","aria-label":`Re-run eval ${e.name}`,children:(0,t.jsx)(K.RefreshCw,{className:`w-3.5 h-3.5 text-muted-foreground ${o?"animate-spin":""}`})})]}),i&&c&&(0,t.jsxs)("div",{className:"ml-10 mr-3 mb-2 relative group",children:[(0,t.jsx)("div",{className:"absolute top-1 right-1 opacity-0 group-hover:opacity-100 transition-opacity",children:(0,t.jsx)(U.CopyButton,{text:c})}),(0,t.jsx)("div",{className:"p-2 pr-8 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words select-text",children:c})]})]})}function ea({projectName:e,sessionId:r,agentId:n,subagentType:a,subagentDescription:i,compact:l}){let[o,d]=(0,s.useState)([]),[c,u]=(0,s.useState)(!0),[m,h]=(0,s.useState)(!1),[x,p]=(0,s.useState)(!1),[f,b]=(0,s.useState)(!1),[y,v]=(0,s.useState)(null),[j,N]=(0,s.useState)(!0),w=(0,s.useRef)(!0);(0,s.useEffect)(()=>{w.current=!0;let t=!1;return u(!0),v(null),h(!1),d([]),X(e,r,n,a).then(s=>{if(!t&&w.current){if(!s.ok){v(s.error),u(!1);return}if(!s.hasEvals){h(!0),u(!1);return}if(d(s.names.map(e=>{let t=s.cachedResults.find(t=>t.name===e);return t?{status:"done",name:e,result:t,cached:!0}:{status:"loading",name:e}})),p(0===s.uncachedNames.length),u(!1),s.uncachedNames.length>0){let l=n?{agentId:n,subagentType:a,subagentDescription:i}:void 0;Promise.all(s.uncachedNames.map(async s=>{try{let n=await Y(e,r,s,!1,l);if(t||!w.current||!n.ok&&"__queued__"===n.error)return;n.ok?d(e=>e.map(e=>e.name===s?{status:"done",name:s,result:n.result,cached:!1}:e)):d(e=>e.map(e=>e.name===s?{status:"error",name:s,error:n.error}:e))}catch(e){if(t||!w.current)return;d(t=>t.map(t=>t.name===s?{status:"error",name:s,error:e instanceof Error?e.message:"Failed"}:t))}}))}}}).catch(e=>{!t&&w.current&&(v(e instanceof Error?e.message:"Failed to load evals"),u(!1))}),()=>{t=!0,w.current=!1}},[e,r,n,a,i]),(0,s.useEffect)(()=>{if(0===o.filter(e=>"loading"===e.status).map(e=>e.name).length)return;let t=!1,s=setInterval(async()=>{try{let s=await X(e,r,n,a);if(t||!s.ok||!s.hasEvals)return;d(e=>{let t=!1,r=e.map(e=>{if("loading"!==e.status)return e;let r=s.cachedResults.find(t=>t.name===e.name);return r?(t=!0,{status:"done",name:e.name,result:r,cached:!1}):e});return t?r:e})}catch{}},3e3);return()=>{t=!0,clearInterval(s)}},[o,e,r,n,a]);let k=(0,s.useCallback)(async()=>{b(!0),d(e=>e.map(e=>({status:"loading",name:e.name})));let t=n?{agentId:n,subagentType:a,subagentDescription:i}:void 0;try{await Z("evals",e,r,n),await G(e,r);let s=o.map(e=>e.name);await Promise.all(s.map(async s=>{try{let n=await Y(e,r,s,!0,t);if(!w.current||!n.ok&&"__queued__"===n.error)return;n.ok?d(e=>e.map(e=>e.name===s?{status:"done",name:s,result:n.result,cached:!1}:e)):d(e=>e.map(e=>e.name===s?{status:"error",name:s,error:n.error}:e))}catch(e){if(!w.current)return;d(t=>t.map(t=>t.name===s?{status:"error",name:s,error:e instanceof Error?e.message:"Failed"}:t))}})),w.current&&p(!1)}finally{w.current&&b(!1)}},[e,r,n,a,i,o]),S=(0,s.useCallback)(async t=>{p(!1),d(e=>e.map(e=>e.name===t?{status:"loading",name:t}:e));let s=n?{agentId:n,subagentType:a,subagentDescription:i}:void 0;try{let n=await Y(e,r,t,!0,s);if(!w.current||!n.ok&&"__queued__"===n.error)return;n.ok?d(e=>e.map(e=>e.name===t?{status:"done",name:t,result:n.result,cached:!1}:e)):d(e=>e.map(e=>e.name===t?{status:"error",name:t,error:n.error}:e))}catch(e){if(!w.current)return;d(s=>s.map(s=>s.name===t?{status:"error",name:t,error:e instanceof Error?e.message:"Re-run failed"}:s))}},[e,r,n,a,i]),M=o.filter(e=>"done"===e.status),E=o.filter(e=>"loading"===e.status).length,I=M.map(e=>e.result).filter(e=>!e.skipped),$=I.filter(e=>!e.error&&e.pass).length,R=I.filter(e=>!e.error&&!e.pass).length,T=M.filter(e=>!!e.result.error).length+o.filter(e=>"error"===e.status).length,O=c||E>0||f;if(m)return null;let A=l?"p-2.5":"p-4",D=l?"text-xs":"text-sm";if(c)return(0,t.jsx)("div",{className:`bg-card border border-border rounded-lg ${A}`,children:(0,t.jsxs)("div",{className:`flex items-center gap-2 ${D} text-muted-foreground`,children:[(0,t.jsx)(K.RefreshCw,{className:"w-4 h-4 animate-spin"}),"Loading evals..."]})});if(y&&0===o.length)return(0,t.jsx)("div",{className:`bg-card border border-border rounded-lg ${A}`,children:(0,t.jsxs)("div",{className:`flex items-center gap-2 ${D} text-destructive`,children:[(0,t.jsx)(B,{className:"w-4 h-4"}),y]})});if(0===o.length)return null;let F=o.filter(e=>!("done"===e.status&&e.result.skipped)),z=o.filter(e=>"done"===e.status&&e.result.skipped).length;return(0,t.jsxs)("div",{className:`bg-card border border-border rounded-lg ${A} ${j?"":"space-y-3"}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("button",{onClick:()=>N(e=>!e),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,t.jsx)(g.ChevronDown,{className:`w-4 h-4 text-muted-foreground transition-transform ${j?"-rotate-90":""}`}),(0,t.jsx)(J,{className:"w-4 h-4 text-primary"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:"Eval Results"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 text-xs",children:[$>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(H,{className:"w-3.5 h-3.5 text-green-500"}),(0,t.jsx)("span",{className:"font-medium",children:$}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"passed"})]}),R>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(V.XCircle,{className:"w-3.5 h-3.5 text-red-500"}),(0,t.jsx)("span",{className:"font-medium",children:R}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"failed"})]}),T>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(B,{className:"w-3.5 h-3.5 text-yellow-500"}),(0,t.jsx)("span",{className:"font-medium",children:T}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"errored"})]}),E>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(K.RefreshCw,{className:"w-3.5 h-3.5 text-muted-foreground animate-spin"}),(0,t.jsxs)("span",{className:"text-muted-foreground",children:[E," running..."]})]}),z>0&&!O&&(0,t.jsxs)("span",{className:"text-[10px] font-medium text-muted-foreground/50 bg-muted px-1.5 py-0.5 rounded",children:[z," skipped"]}),x&&!O&&(0,t.jsx)("span",{className:"text-[10px] font-medium text-muted-foreground/70 bg-muted px-1.5 py-0.5 rounded",children:"cached"})]}),(0,t.jsxs)("button",{onClick:()=>k(),disabled:O,className:"inline-flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium rounded border border-primary/30 bg-primary/10 text-primary hover:bg-primary/20 transition-colors disabled:opacity-50",children:[f?(0,t.jsx)(K.RefreshCw,{className:"w-3 h-3 animate-spin"}):(0,t.jsx)(C,{className:"w-3 h-3"}),f?"Running...":"Re-run"]})]})]}),!j&&(0,t.jsx)("div",{className:"divide-y divide-border/50",children:F.map(e=>"loading"===e.status?(0,t.jsx)(es,{name:e.name},e.name):"error"===e.status?(0,t.jsx)(er,{name:e.name,error:e.error},e.name):(0,t.jsx)(en,{result:e.result,cached:e.cached,onRerun:S,globalLoading:f},e.name))})]})}let ei=(0,b.default)("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),el=(0,Q.createServerReference)("787158c0dfe373a8cafc468cc315a42ea7abd4a92e",Q.callServer,void 0,Q.findSourceMapURL,"checkEnrichmentCacheAndList");async function eo(e,t,s,r=!1,n){let a;try{a=await fetch("/api/queue-item",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"enrichment",projectName:e,sessionId:t,itemName:s,forceRefresh:r,...n&&{agentId:n.agentId,subagentType:n.subagentType,subagentDescription:n.subagentDescription}})})}catch(e){return{ok:!1,error:`Network error: ${e instanceof Error?e.message:String(e)}`}}return 202===a.status?{ok:!1,error:"__queued__"}:a.ok?a.json():{ok:!1,error:`Queue request failed: ${a.status}`}}function ed({name:e}){return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-mono font-medium text-muted-foreground",children:e}),(0,t.jsx)("div",{className:"w-10 h-3 bg-muted rounded animate-pulse"})]}),(0,t.jsxs)("div",{className:"pl-1 space-y-1",children:[(0,t.jsx)("div",{className:"h-3 bg-muted rounded animate-pulse w-2/3"}),(0,t.jsx)("div",{className:"h-3 bg-muted rounded animate-pulse w-1/2"})]})]})}function ec({name:e,error:s}){return(0,t.jsx)("div",{className:"space-y-1.5",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(B,{className:"w-3.5 h-3.5 text-yellow-500"}),(0,t.jsx)("span",{className:"text-sm font-mono font-medium",children:e}),(0,t.jsx)("span",{className:"text-xs text-yellow-500 truncate",children:s})]})})}function eu({result:e,cached:s}){if(e.error)return(0,t.jsx)("div",{className:"space-y-1.5",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(B,{className:"w-3.5 h-3.5 text-yellow-500"}),(0,t.jsx)("span",{className:"text-sm font-mono font-medium",children:e.name}),(0,t.jsx)("span",{className:"text-xs text-yellow-500 truncate",title:e.error,children:e.error})]})});let r=Object.entries(e.data);return 0===r.length?null:(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-mono font-medium",children:e.name}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[e.durationMs,"ms"]}),s&&(0,t.jsx)("span",{className:"text-[10px] font-medium text-muted-foreground/70 bg-muted px-1 py-0.5 rounded",children:"cached"})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 gap-y-1 pl-1",children:r.map(([e,s])=>(0,t.jsxs)("div",{className:"flex items-baseline gap-2 min-w-0 flex-wrap",children:[(0,t.jsxs)("span",{className:"text-xs font-semibold text-primary/70 shrink-0",children:[e,":"]}),(0,t.jsx)("span",{className:"text-sm font-mono break-all",title:String(s),children:"boolean"==typeof s?s?"Yes":"No":"number"==typeof s?s.toLocaleString():String(s)})]},e))})]})}function em({projectName:e,sessionId:r,agentId:n,subagentType:a,subagentDescription:i,compact:l}){let[o,d]=(0,s.useState)([]),[c,u]=(0,s.useState)(!0),[m,h]=(0,s.useState)(!1),[x,p]=(0,s.useState)(!1),[f,b]=(0,s.useState)(!1),[y,v]=(0,s.useState)(null),[j,N]=(0,s.useState)(!0),w=(0,s.useRef)(!0);(0,s.useEffect)(()=>{w.current=!0;let t=!1;return u(!0),v(null),h(!1),d([]),el(e,r,n,a).then(s=>{if(!t&&w.current){if(!s.ok){v(s.error),u(!1);return}if(!s.hasEnrichers){h(!0),u(!1);return}if(d(s.names.map(e=>{let t=s.cachedResults.find(t=>t.name===e);return t?{status:"done",name:e,result:t,cached:!0}:{status:"loading",name:e}})),p(0===s.uncachedNames.length),u(!1),s.uncachedNames.length>0){let l=n?{agentId:n,subagentType:a,subagentDescription:i}:void 0;Promise.all(s.uncachedNames.map(async s=>{try{let n=await eo(e,r,s,!1,l);if(t||!w.current||!n.ok&&"__queued__"===n.error)return;n.ok?d(e=>e.map(e=>e.name===s?{status:"done",name:s,result:n.result,cached:!1}:e)):d(e=>e.map(e=>e.name===s?{status:"error",name:s,error:n.error}:e))}catch(e){if(t||!w.current)return;d(t=>t.map(t=>t.name===s?{status:"error",name:s,error:e instanceof Error?e.message:"Failed"}:t))}}))}}}).catch(e=>{!t&&w.current&&(v(e instanceof Error?e.message:"Failed to load enrichments"),u(!1))}),()=>{t=!0,w.current=!1}},[e,r,n,a,i]);let k=(0,s.useCallback)(async()=>{b(!0),d(e=>e.map(e=>({status:"loading",name:e.name})));let t=n?{agentId:n,subagentType:a,subagentDescription:i}:void 0;try{await Z("enrichments",e,r,n);let s=o.map(e=>e.name);await Promise.all(s.map(async s=>{try{let n=await eo(e,r,s,!0,t);if(!w.current||!n.ok&&"__queued__"===n.error)return;n.ok?d(e=>e.map(e=>e.name===s?{status:"done",name:s,result:n.result,cached:!1}:e)):d(e=>e.map(e=>e.name===s?{status:"error",name:s,error:n.error}:e))}catch(e){if(!w.current)return;d(t=>t.map(t=>t.name===s?{status:"error",name:s,error:e instanceof Error?e.message:"Failed"}:t))}})),w.current&&p(!1)}finally{w.current&&b(!1)}},[e,r,n,a,i,o]),S=o.filter(e=>"done"===e.status),M=o.filter(e=>"loading"===e.status).length,E=S.filter(e=>!!e.result.error).length+o.filter(e=>"error"===e.status).length,I=c||M>0||f;if(m)return null;let $=l?"p-2.5":"p-4",R=l?"text-xs":"text-sm";if(c)return(0,t.jsx)("div",{className:`bg-card border border-border rounded-lg ${$}`,children:(0,t.jsxs)("div",{className:`flex items-center gap-2 ${R} text-muted-foreground`,children:[(0,t.jsx)(K.RefreshCw,{className:"w-4 h-4 animate-spin"}),"Loading enrichments..."]})});if(y&&0===o.length)return(0,t.jsx)("div",{className:`bg-card border border-border rounded-lg ${$}`,children:(0,t.jsxs)("div",{className:`flex items-center gap-2 ${R} text-destructive`,children:[(0,t.jsx)(B,{className:"w-4 h-4"}),y]})});if(0===o.length)return null;let T=o.filter(e=>!("done"===e.status&&e.result.skipped)),O=o.filter(e=>"done"===e.status&&e.result.skipped).length;return(0,t.jsxs)("div",{className:`bg-card border border-border rounded-lg ${$} ${j?"":"space-y-3"}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("button",{onClick:()=>N(e=>!e),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,t.jsx)(g.ChevronDown,{className:`w-4 h-4 text-muted-foreground transition-transform ${j?"-rotate-90":""}`}),(0,t.jsx)(ei,{className:"w-4 h-4 text-primary"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:"Enrichment Data"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[E>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1 text-xs text-yellow-500",children:[(0,t.jsx)(B,{className:"w-3.5 h-3.5"}),(0,t.jsxs)("span",{children:[E," errored"]})]}),M>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,t.jsx)(K.RefreshCw,{className:"w-3.5 h-3.5 animate-spin"}),(0,t.jsxs)("span",{children:[M," running..."]})]}),O>0&&!I&&(0,t.jsxs)("span",{className:"text-[10px] font-medium text-muted-foreground/50 bg-muted px-1.5 py-0.5 rounded",children:[O," skipped"]}),x&&!I&&(0,t.jsx)("span",{className:"text-[10px] font-medium text-muted-foreground/70 bg-muted px-1.5 py-0.5 rounded",children:"cached"}),(0,t.jsxs)("button",{onClick:()=>k(),disabled:I,className:"inline-flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium rounded border border-primary/30 bg-primary/10 text-primary hover:bg-primary/20 transition-colors disabled:opacity-50",children:[f?(0,t.jsx)(K.RefreshCw,{className:"w-3 h-3 animate-spin"}):(0,t.jsx)(C,{className:"w-3 h-3"}),f?"Running...":"Re-run"]})]})]}),!j&&(0,t.jsx)("div",{className:"space-y-3 divide-y divide-border/50",children:T.map(e=>(0,t.jsxs)("div",{className:"pt-2 first:pt-0",children:["loading"===e.status&&(0,t.jsx)(ed,{name:e.name}),"error"===e.status&&(0,t.jsx)(ec,{name:e.name,error:e.error}),"done"===e.status&&(0,t.jsx)(eu,{result:e.result,cached:e.cached})]},e.name))})]})}let eh=(0,b.default)("brain",[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]),ex=s.default.memo(function({block:e,allEntries:s,projectName:r,sessionId:n,highlightedUuid:a,autoExpandForUuid:i}){switch(e.type){case"text":return(0,t.jsx)("p",{className:"whitespace-pre-wrap text-sm",children:e.text});case"tool_use":if("Task"===e.name&&(e.subagentType||e.subagentId)){let l=e.subagentId&&s?s.filter(t=>t._source===`agent-${e.subagentId}`):void 0;return(0,t.jsx)(ej,{block:e,subagentEntries:l,projectName:r,sessionId:n,highlightedUuid:a,autoExpandForUuid:i})}return(0,t.jsxs)("div",{className:"border border-border/50 rounded-lg p-3 bg-muted/10",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(y,{className:"w-4 h-4 text-primary flex-shrink-0"}),(0,t.jsx)("span",{className:"font-mono text-sm text-primary truncate min-w-0",children:e.name}),e.result&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground ml-auto flex-shrink-0",children:e.result.durationFormatted})]}),(0,t.jsx)(W,{block:e})]});case"thinking":return(0,t.jsx)("div",{className:"border border-[color:var(--chart-5)]/30 rounded-lg p-3 bg-[color:var(--chart-5)]/5",children:(0,t.jsxs)("details",{children:[(0,t.jsxs)("summary",{className:"flex items-center gap-2 text-xs cursor-pointer hover:text-foreground transition-colors text-[color:var(--chart-5)]",children:[(0,t.jsx)(eh,{className:"w-4 h-4"}),(0,t.jsx)("span",{children:"Thinking"}),(0,t.jsxs)("span",{className:"text-muted-foreground ml-1",children:["(",e.thinking.length.toLocaleString()," chars)"]})]}),(0,t.jsx)("p",{className:"mt-2 whitespace-pre-wrap text-xs text-muted-foreground p-2 bg-muted/30 rounded max-h-64 overflow-y-auto",children:e.thinking})]})})}});function ep({entry:e}){return(0,t.jsx)("div",{children:e.message.content&&(0,t.jsx)("p",{className:"whitespace-pre-wrap text-sm",children:e.message.content})})}let ef=s.default.memo(function({entry:e,allEntries:s,projectName:r,sessionId:n,highlightedUuid:a,autoExpandForUuid:i}){let{content:l}=e.message;return(0,t.jsx)("div",{className:"space-y-3",children:l.map((e,l)=>(0,t.jsx)(ex,{block:e,allEntries:s,projectName:r,sessionId:n,highlightedUuid:a,autoExpandForUuid:i},l))})}),eg=s.default.memo(function({entry:e}){let r=(0,s.useMemo)(()=>{if("progress"===e.type){let t=e.raw.data,s=t?.agentId;return[t?.type,s&&`agent:${s}`].filter(Boolean).join(" | ")}return"file-history-snapshot"===e.type?"File history snapshot":e.type},[e.type,e.raw]);return(0,t.jsxs)("div",{className:"text-sm",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:r}),(0,t.jsxs)("details",{className:"mt-1",children:[(0,t.jsx)("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:"Show raw JSON"}),(0,t.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words max-h-64 overflow-y-auto",children:I(e)})]})]})}),eb=(0,b.default)("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);var ey=e.i(55574);function ev({uuid:e}){let r=(0,s.useCallback)(async()=>{window.history.replaceState(null,"",`#entry-${e}`);try{await navigator.clipboard.writeText(window.location.href)}catch{let e=document.createElement("textarea");e.value=window.location.href,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)}(0,ey.toast)("Link copied")},[e]);return(0,t.jsx)("button",{onClick:r,title:"Copy link to entry",className:"inline-flex items-center justify-center rounded p-1 text-muted-foreground hover:text-foreground hover:bg-muted/80 transition-colors opacity-0 group-hover:opacity-100 transition-opacity",children:(0,t.jsx)(eb,{className:"w-3.5 h-3.5"})})}function ej({block:e,subagentEntries:r,projectName:n,sessionId:a,highlightedUuid:i,autoExpandForUuid:l}){let o=!!(l&&r?.some(e=>e.uuid===l)),[d,c]=(0,s.useState)(o);(0,s.useEffect)(()=>{if(!o)return;let e=requestAnimationFrame(()=>c(!0));return()=>cancelAnimationFrame(e)},[o]);let u=(0,s.useCallback)(()=>{c(e=>!e)},[]),m=r&&r.length>0;return(0,t.jsxs)("div",{className:"border border-border/50 rounded-lg p-3 bg-muted/10",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(S,{className:"w-4 h-4 text-[color:var(--chart-5)]"}),(0,t.jsx)("span",{className:"font-mono text-sm text-[color:var(--chart-5)]",children:"Subagent"}),e.subagentType&&(0,t.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 text-xs font-mono rounded border bg-[color:var(--chart-5)]/20 text-[color:var(--chart-5)] border-[color:var(--chart-5)]/30",children:e.subagentType}),e.result&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground ml-auto",children:e.result.durationFormatted})]}),e.subagentDescription&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.subagentDescription}),e.subagentId&&r&&(0,t.jsxs)("button",{onClick:u,className:"inline-flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium rounded border border-primary/30 bg-primary/10 text-primary hover:bg-primary/20 transition-colors mb-2",children:[(0,t.jsx)(E.ChevronRight,{className:(0,O.cn)("w-3 h-3 transition-transform",d&&"rotate-90")}),(0,t.jsxs)("span",{children:["agent-",e.subagentId]}),(0,t.jsx)("span",{className:"text-muted-foreground",children:d?"Collapse":"View subagent log"})]}),d&&(0,t.jsxs)("div",{className:"ml-4 pl-3 border-l-2 border-primary/30 mt-2 space-y-2",children:[r&&0===r.length&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground py-2",children:"No entries found in subagent log."}),m&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M,{entries:r,compact:!0}),(0,t.jsx)(ea,{projectName:n,sessionId:a,agentId:e.subagentId,subagentType:e.subagentType,subagentDescription:e.subagentDescription,compact:!0}),(0,t.jsx)(em,{projectName:n,sessionId:a,agentId:e.subagentId,subagentType:e.subagentType,subagentDescription:e.subagentDescription,compact:!0})]}),r&&r.map(e=>"queue-operation"===e.type?(0,t.jsx)(T,{entry:e},e.uuid||e.timestamp):(0,t.jsx)(ew,{entry:e,projectName:n,sessionId:a,isHighlighted:!!i&&e.uuid===i},e.uuid||e.timestamp))]}),(0,t.jsx)(W,{block:e})]})}function eN({entry:e,allEntries:s,projectName:r,sessionId:n,highlightedUuid:a,autoExpandForUuid:i}){switch(e.type){case"user":return(0,t.jsx)(ep,{entry:e});case"assistant":return(0,t.jsx)(ef,{entry:e,allEntries:s,projectName:r,sessionId:n,highlightedUuid:a,autoExpandForUuid:i});case"file-history-snapshot":case"progress":case"system":return(0,t.jsx)(eg,{entry:e})}}let ew=s.default.memo(function({entry:e,allEntries:s,projectName:r,sessionId:n,isHighlighted:a,highlightedUuid:i,autoExpandForUuid:l}){return(0,t.jsxs)("div",{id:e.uuid?`entry-${e.uuid}`:void 0,className:(0,O.cn)(`group border-l-4 ${F[e.type]} bg-card/50 rounded-r-lg mb-2 hover:bg-muted/30 transition-colors`,a&&"entry-highlighted"),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-border/30",children:[(0,t.jsx)(P,{type:e.type}),(0,t.jsxs)("div",{className:"flex items-center gap-1 ml-auto",children:[e.uuid&&(0,t.jsx)(ev,{uuid:e.uuid}),(0,t.jsx)(U.CopyButton,{text:function(e){switch(e.type){case"user":return e.message.content;case"assistant":return e.message.content.filter(e=>"text"===e.type).map(e=>e.text).join("\n");case"file-history-snapshot":case"progress":case"system":return I(e);case"queue-operation":return e.label}}(e)}),(0,t.jsx)("span",{className:"text-xs font-mono text-muted-foreground whitespace-nowrap",children:R(e.timestampMs)})]})]}),(0,t.jsx)("div",{className:"px-4 py-3",children:(0,t.jsx)(eN,{entry:e,allEntries:s,projectName:r,sessionId:n,highlightedUuid:i,autoExpandForUuid:l})})]})},(e,t)=>e.entry===t.entry&&e.allEntries===t.allEntries&&e.projectName===t.projectName&&e.sessionId===t.sessionId&&e.isHighlighted===t.isHighlighted&&e.highlightedUuid===t.highlightedUuid&&e.autoExpandForUuid===t.autoExpandForUuid),ek=(0,b.default)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),eS=(0,b.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),eM=(0,Q.createServerReference)("78c5648b7b5686436aa85f01f0bc2c587019f3551e",Q.callServer,void 0,Q.findSourceMapURL,"checkActionCacheAndList");async function eC(e,t,s,r=!1,n,a){let i;try{i=await fetch("/api/queue-item",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"action",projectName:e,sessionId:t,itemName:s,forceRefresh:r,...n&&{agentId:n.agentId,subagentType:n.subagentType,subagentDescription:n.subagentDescription},...a&&Object.keys(a).length>0&&{inputs:a}})})}catch(e){return{ok:!1,error:`Network error: ${e instanceof Error?e.message:String(e)}`}}return 202===i.status?{ok:!1,error:"__queued__"}:i.ok?i.json():{ok:!1,error:`Queue request failed: ${i.status}`}}let eE=(0,Q.createServerReference)("7c1819c09694c16625e7307fca58e4c3839ea8e477",Q.callServer,void 0,Q.findSourceMapURL,"invalidateSessionItemCache"),eI=(0,Q.createServerReference)("005b3463155f01f2e24b04194f5773bde728342532",Q.callServer,void 0,Q.findSourceMapURL,"getQueueStatusAction");function e$({name:e}){return(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,t.jsx)("div",{className:"w-4 h-4 rounded-full bg-muted animate-pulse"}),(0,t.jsx)("span",{className:"text-sm font-mono truncate max-w-[200px] text-muted-foreground",children:e}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"running..."})]})}function eR({name:e,error:s}){return(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,t.jsx)(B,{className:"w-4 h-4 text-yellow-500"}),(0,t.jsx)("span",{className:"text-sm font-mono truncate max-w-[200px]",children:e}),(0,t.jsx)("span",{className:"text-xs text-yellow-500 truncate",children:s})]})}function eT(e,t){let s={};for(let r of e)r.required&&(void 0===t[r.name]||""===t[r.name])&&(s[r.name]="Required");return s}function eO({actionName:e,fields:r,values:n,onChange:a,onSubmit:i,disabled:l}){let[o,d]=(0,s.useState)({});return(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault();let t=eT(r,n);Object.keys(t).length>0?d(t):(d({}),i())},id:`action-input-form-${e}`,className:"ml-7 mr-3 mb-2 p-3 bg-muted/20 rounded-md border border-border/40 animate-in fade-in-0 slide-in-from-top-1 duration-200",children:[(0,t.jsx)("div",{className:"space-y-2.5",children:r.map(e=>{let s=e.label??e.name,r=o[e.name],i=!!r;return(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("label",{className:"text-[11px] font-medium text-muted-foreground tracking-wide uppercase",children:[s,e.required&&(0,t.jsx)("span",{className:"text-destructive ml-0.5",children:"*"})]}),"boolean"===e.type?(0,t.jsxs)("label",{className:"group flex items-center gap-2 cursor-pointer py-1",children:[(0,t.jsx)("input",{type:"checkbox",checked:!!n[e.name],onChange:t=>a(e.name,t.target.checked),className:"h-4 w-4 rounded border-border bg-input text-primary focus:ring-ring focus:ring-offset-0 transition-colors cursor-pointer"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground group-hover:text-foreground transition-colors",children:n[e.name]?"Enabled":"Disabled"})]}):"select"===e.type&&e.options?(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("select",{value:String(n[e.name]??""),onChange:t=>a(e.name,t.target.value),className:"text-xs px-2.5 py-1.5 pr-7 rounded-md border border-border bg-input text-foreground appearance-none cursor-pointer hover:border-primary/50 focus:outline-none focus:ring-2 focus:ring-ring/40 focus:border-primary/60 transition-all w-full",children:e.options.map(e=>(0,t.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,t.jsx)(g.ChevronDown,{className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 w-3 h-3 text-muted-foreground"})]}):"number"===e.type?(0,t.jsx)("input",{type:"number",value:void 0!==n[e.name]?String(n[e.name]):"",onChange:t=>a(e.name,""===t.target.value?void 0:Number(t.target.value)),placeholder:s,className:`text-xs px-2.5 py-1.5 rounded-md border bg-input text-foreground font-mono tabular-nums placeholder:text-muted-foreground/50 hover:border-primary/50 focus:outline-none focus:ring-2 focus:ring-ring/40 focus:border-primary/60 transition-all w-32 ${i?"border-destructive/60 focus:ring-destructive/30":"border-border"}`}):(0,t.jsx)("input",{type:"text",value:String(n[e.name]??""),onChange:t=>a(e.name,t.target.value),placeholder:s,className:`text-xs px-2.5 py-1.5 rounded-md border bg-input text-foreground placeholder:text-muted-foreground/50 hover:border-primary/50 focus:outline-none focus:ring-2 focus:ring-ring/40 focus:border-primary/60 transition-all w-full ${i?"border-destructive/60 focus:ring-destructive/30":"border-border"}`}),r&&(0,t.jsxs)("div",{className:"flex items-center gap-1 text-[10px] text-destructive mt-0.5",children:[(0,t.jsx)(B,{className:"w-2.5 h-2.5 flex-shrink-0"}),(0,t.jsx)("span",{children:r})]})]},e.name)})}),(0,t.jsx)("div",{className:"flex items-center pt-2 mt-1 border-t border-border/30",children:(0,t.jsxs)("button",{type:"submit",disabled:l,className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-[11px] font-medium rounded-md bg-primary/15 text-primary border border-primary/25 hover:bg-primary/25 hover:border-primary/40 focus:outline-none focus:ring-2 focus:ring-ring/40 active:bg-primary/30 active:scale-[0.98] transition-all duration-150 disabled:opacity-50 disabled:cursor-not-allowed disabled:active:scale-100",children:[(0,t.jsx)(C,{className:"w-3 h-3"}),"Run"]})})]})}function eA({name:e,onRun:s,disabled:r,hasInputs:n,formOpen:a,onToggleForm:i}){let l=n?`action-input-form-${e}`:void 0;return(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,t.jsx)(eS,{className:"w-4 h-4 text-muted-foreground"}),(0,t.jsx)("span",{className:"text-sm font-mono truncate max-w-[200px] text-muted-foreground",children:e}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground/50",children:"not run"}),(0,t.jsxs)("button",{onClick:n?i:s,disabled:r,"aria-expanded":n?a:void 0,"aria-controls":n?l:void 0,className:"ml-auto flex-shrink-0 inline-flex items-center gap-1 px-2 py-0.5 text-[11px] font-medium rounded border border-primary/30 bg-primary/10 text-primary hover:bg-primary/20 transition-colors disabled:opacity-50",children:[(0,t.jsx)(C,{className:"w-2.5 h-2.5"}),"Run"]})]})}function eD({result:e,cached:r,onRerun:n,globalLoading:a}){let[i,l]=(0,s.useState)(!1),[o,d]=(0,s.useState)(!1),c=e.output||e.message,u=!!c,m=async t=>{t.stopPropagation(),d(!0);try{await n(e.name)}finally{d(!1)}};if(e.error)return(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,t.jsx)(B,{className:"w-4 h-4 text-yellow-500"}),(0,t.jsx)("span",{className:"text-sm font-mono truncate max-w-[200px]",children:e.name}),(0,t.jsx)("span",{className:"text-xs text-yellow-500 truncate",title:e.error,children:e.error}),(0,t.jsx)("button",{onClick:m,disabled:o||a,className:"ml-auto flex-shrink-0 p-1 rounded hover:bg-muted/50 transition-colors disabled:opacity-50",title:"Re-run this action","aria-label":`Re-run action ${e.name}`,children:(0,t.jsx)(K.RefreshCw,{className:`w-3.5 h-3.5 text-muted-foreground ${o?"animate-spin":""}`})})]});let h="success"===e.status?(0,t.jsx)(H,{className:"w-4 h-4 text-green-500"}):(0,t.jsx)(V.XCircle,{className:"w-4 h-4 text-red-500"}),x=`action-result-${e.name}`;return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2 rounded-md hover:bg-muted/30 transition-colors",children:[u&&(0,t.jsx)("button",{onClick:()=>l(e=>!e),"aria-expanded":i,"aria-controls":x,className:"flex-shrink-0 p-0 bg-transparent border-none cursor-pointer","aria-label":`Toggle details for ${e.name}`,children:(0,t.jsx)(E.ChevronRight,{className:`w-3.5 h-3.5 text-muted-foreground transition-transform ${i?"rotate-90":""}`})}),h,(0,t.jsx)("span",{className:"text-sm font-mono truncate max-w-[200px]",children:e.name}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[e.durationMs,"ms"]}),r&&(0,t.jsx)("span",{className:"text-[10px] font-medium text-muted-foreground/70 bg-muted px-1 py-0.5 rounded",children:"cached"}),e.message&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground flex-1 truncate min-w-0",children:e.message}),(0,t.jsx)("button",{onClick:m,disabled:o||a,className:"ml-auto flex-shrink-0 p-1 rounded hover:bg-muted/50 transition-colors disabled:opacity-50",title:"Re-run this action","aria-label":`Re-run action ${e.name}`,children:(0,t.jsx)(K.RefreshCw,{className:`w-3.5 h-3.5 text-muted-foreground ${o?"animate-spin":""}`})})]}),i&&c&&(0,t.jsxs)("div",{id:x,className:"ml-10 mr-3 mb-2 relative group",children:[(0,t.jsx)("div",{className:"absolute top-1 right-1 opacity-0 group-hover:opacity-100 transition-opacity",children:(0,t.jsx)(U.CopyButton,{text:c})}),(0,t.jsx)("div",{className:"p-2 pr-8 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words select-text",children:c})]})]})}function eF({projectName:e,sessionId:r,agentId:n,subagentType:a,subagentDescription:i,compact:l}){let[o,d]=(0,s.useState)([]),[c,u]=(0,s.useState)(!0),[m,h]=(0,s.useState)(!1),[x,p]=(0,s.useState)(!1),[f,b]=(0,s.useState)(!1),[y,v]=(0,s.useState)(null),[j,N]=(0,s.useState)(!0),[w,k]=(0,s.useState)({}),[S,M]=(0,s.useState)({}),[E,I]=(0,s.useState)(new Set),$=(0,s.useRef)(0);(0,s.useEffect)(()=>{let t=++$.current;return u(!0),v(null),h(!1),d([]),eM(e,r,n,a).then(async s=>{if(t!==$.current)return;if(!s.ok){v(s.error),u(!1);return}if(!s.hasActions){h(!0),u(!1);return}let a=new Set;if(s.uncachedNames.length>0)try{let s=await eI();if(t!==$.current)return;let i=n?`${r}/agent-${n}`:r;for(let t of[...s.pending,...s.processing])"action"===t.type&&t.projectName===e&&t.sessionId===i&&a.add(t.itemName)}catch{}k(s.inputDefinitions);let i={};for(let[e,t]of Object.entries(s.inputDefinitions)){let r=s.cachedResults.find(t=>t.name===e),n={};for(let e of t){let t=r?.inputs?.[e.name];void 0!==t?n[e.name]=t:void 0!==e.default&&(n[e.name]=e.default)}i[e]=n}M(i),d(s.names.map(e=>{let t=s.cachedResults.find(t=>t.name===e);return t?{status:"done",name:e,result:t,cached:!0}:a.has(e)?{status:"loading",name:e}:{status:"idle",name:e}})),p(0===s.uncachedNames.length),u(!1)}).catch(e=>{t===$.current&&(v(e instanceof Error?e.message:"Failed to load actions"),u(!1))}),()=>{}},[e,r,n,a]),(0,s.useEffect)(()=>{if(0===o.filter(e=>"loading"===e.status).map(e=>e.name).length)return;let t=!1,s=setInterval(async()=>{try{let s=await eM(e,r,n,a);if(t||!s.ok||!s.hasActions)return;d(e=>{let t=!1,r=e.map(e=>{if("loading"!==e.status)return e;let r=s.cachedResults.find(t=>t.name===e.name);return r?(t=!0,{status:"done",name:e.name,result:r,cached:!1}):e});return t?r:e})}catch{}},3e3);return()=>{t=!0,clearInterval(s)}},[o,e,r,n,a]);let R=(0,s.useCallback)(async(t,s=!1)=>{let l=$.current;d(e=>e.map(e=>e.name===t?{status:"loading",name:t}:e)),I(e=>{let s=new Set(e);return s.delete(t),s});let o=n?{agentId:n,subagentType:a,subagentDescription:i}:void 0,c=S[t],u=c&&Object.keys(c).length>0;try{s&&await eE("actions",e,r,t,n).catch(e=>console.error("Failed to invalidate action cache:",e));let a=await eC(e,r,t,s,o,u?c:void 0);if(l!==$.current||!a.ok&&"__queued__"===a.error)return;a.ok?d(e=>e.map(e=>e.name===t?{status:"done",name:t,result:a.result,cached:!1}:e)):d(e=>e.map(e=>e.name===t?{status:"error",name:t,error:a.error}:e))}catch(e){if(l!==$.current)return;d(s=>s.map(s=>s.name===t?{status:"error",name:t,error:e instanceof Error?e.message:"Failed"}:s))}},[e,r,n,a,i,S]),T=(0,s.useCallback)(async e=>{p(!1);let t=w[e];if(t&&t.length>0){d(t=>t.map(t=>t.name===e?{status:"idle",name:e}:t)),I(t=>new Set(t).add(e));return}await R(e,!0)},[R,w]),O=(0,s.useCallback)(async()=>{let t=o.filter(e=>"idle"===e.status||"done"===e.status||"error"===e.status).filter(e=>{let t=w[e.name];return t&&t.length>0}).filter(e=>!E.has(e.name));if(t.length>0){d(e=>e.map(e=>t.some(t=>t.name===e.name)&&("done"===e.status||"error"===e.status)?{status:"idle",name:e.name}:e)),I(e=>{let s=new Set(e);return t.forEach(e=>s.add(e.name)),s});return}for(let e of o.map(e=>e.name)){let t=w[e];if(t&&t.length>0&&Object.keys(eT(t,S[e]??{})).length>0)return void I(t=>new Set(t).add(e))}let s=$.current;b(!0),I(new Set);let l=o.map(e=>e.name);d(e=>e.map(e=>({status:"loading",name:e.name})));let c=n?{agentId:n,subagentType:a,subagentDescription:i}:void 0;try{try{await Z("actions",e,r,n)}catch(e){console.error("Failed to invalidate action caches:",e)}await Promise.all(l.map(async t=>{let n=S[t],a=n&&Object.keys(n).length>0;try{let i=await eC(e,r,t,!0,c,a?n:void 0);if(s!==$.current||!i.ok&&"__queued__"===i.error)return;i.ok?d(e=>e.map(e=>e.name===t?{status:"done",name:t,result:i.result,cached:!1}:e)):d(e=>e.map(e=>e.name===t?{status:"error",name:t,error:i.error}:e))}catch(e){if(s!==$.current)return;d(s=>s.map(s=>s.name===t?{status:"error",name:t,error:e instanceof Error?e.message:"Failed"}:s))}})),s===$.current&&p(!1)}finally{s===$.current&&b(!1)}},[e,r,n,a,i,o,S,w,E]),A=o.filter(e=>"done"===e.status),D=o.filter(e=>"loading"===e.status).length,F=o.filter(e=>"idle"===e.status).length,z=A.filter(e=>"error"===e.result.status||!!e.result.error).length+o.filter(e=>"error"===e.status).length,_=A.filter(e=>"success"===e.result.status&&!e.result.error).length,q=c||D>0||f;if(m)return null;let L=l?"p-2.5":"p-4",P=l?"text-xs":"text-sm";if(c)return(0,t.jsx)("div",{className:`bg-card border border-border rounded-lg ${L}`,children:(0,t.jsxs)("div",{className:`flex items-center gap-2 ${P} text-muted-foreground`,children:[(0,t.jsx)(K.RefreshCw,{className:"w-4 h-4 animate-spin"}),"Loading actions..."]})});if(y&&0===o.length)return(0,t.jsx)("div",{className:`bg-card border border-border rounded-lg ${L}`,children:(0,t.jsxs)("div",{className:`flex items-center gap-2 ${P} text-destructive`,children:[(0,t.jsx)(B,{className:"w-4 h-4"}),y]})});if(0===o.length)return null;let U=o.filter(e=>!("done"===e.status&&e.result.skipped)),W=o.filter(e=>"done"===e.status&&e.result.skipped).length;return(0,t.jsxs)("div",{className:`bg-card border border-border rounded-lg ${L} ${j?"":"space-y-3"}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("button",{onClick:()=>N(e=>!e),"aria-expanded":!j,"aria-controls":"action-results-content",className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,t.jsx)(g.ChevronDown,{className:`w-4 h-4 text-muted-foreground transition-transform ${j?"-rotate-90":""}`}),(0,t.jsx)(ek,{className:"w-4 h-4 text-primary"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:"Actions"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[_>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1 text-xs text-green-500",children:[(0,t.jsx)(H,{className:"w-3.5 h-3.5"}),(0,t.jsx)("span",{children:_})]}),z>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1 text-xs text-yellow-500",children:[(0,t.jsx)(B,{className:"w-3.5 h-3.5"}),(0,t.jsxs)("span",{children:[z," errored"]})]}),F>0&&!q&&(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground/50",children:[F," pending"]}),D>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,t.jsx)(K.RefreshCw,{className:"w-3.5 h-3.5 animate-spin"}),(0,t.jsxs)("span",{children:[D," running..."]})]}),W>0&&!q&&(0,t.jsxs)("span",{className:"text-[10px] font-medium text-muted-foreground/50 bg-muted px-1.5 py-0.5 rounded",children:[W," skipped"]}),x&&!q&&(0,t.jsx)("span",{className:"text-[10px] font-medium text-muted-foreground/70 bg-muted px-1.5 py-0.5 rounded",children:"cached"}),(0,t.jsxs)("button",{onClick:()=>O(),disabled:q,className:"inline-flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium rounded border border-primary/30 bg-primary/10 text-primary hover:bg-primary/20 transition-colors disabled:opacity-50",children:[f?(0,t.jsx)(K.RefreshCw,{className:"w-3 h-3 animate-spin"}):(0,t.jsx)(C,{className:"w-3 h-3"}),f?"Running...":"Run All"]})]})]}),!j&&(0,t.jsx)("div",{id:"action-results-content",className:"divide-y divide-border/50",children:U.map(e=>{let s=w[e.name],r=!!s&&s.length>0,n=E.has(e.name);return"idle"===e.status?(0,t.jsxs)("div",{children:[(0,t.jsx)(eA,{name:e.name,onRun:()=>R(e.name,!0),disabled:q,hasInputs:r,formOpen:n,onToggleForm:()=>I(t=>{let s=new Set(t);return s.has(e.name)?s.delete(e.name):s.add(e.name),s})}),r&&n&&(0,t.jsx)(eO,{actionName:e.name,fields:s,values:S[e.name]??{},onChange:(t,s)=>M(r=>{let n={...r[e.name]};return void 0===s?delete n[t]:n[t]=s,{...r,[e.name]:n}}),onSubmit:()=>R(e.name,!0),disabled:q})]},e.name):"loading"===e.status?(0,t.jsx)(e$,{name:e.name},e.name):"error"===e.status?(0,t.jsx)(eR,{name:e.name,error:e.error},e.name):(0,t.jsx)(eD,{result:e.result,cached:e.cached,onRerun:T,globalLoading:f},e.name)})})]})}var ez=e.i(72131),e_=e.i(81418),eq=e.i(88092),eL=e.i(51737),eP=e.i(98919),eU=e.i(74886),eW=e.i(43531),eH=e.i(73520),eV=e.i(85881);function eB({decision:e}){return"deny"===e?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-red-500/10 text-red-400 border border-red-500/20",children:[(0,t.jsx)(eq.ShieldX,{className:"h-3 w-3"}),"Deny"]}):"instruct"===e?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-amber-500/10 text-amber-400 border border-amber-500/20",children:[(0,t.jsx)(eL.ShieldAlert,{className:"h-3 w-3"}),"Instruct"]}):(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-emerald-500/10 text-emerald-400 border border-emerald-500/20",children:[(0,t.jsx)(e_.ShieldCheck,{className:"h-3 w-3"}),"Allow"]})}function eJ({eventType:e}){return(0,t.jsx)("span",{className:"inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium bg-muted text-muted-foreground border border-border/50",children:e})}function eK({mode:e}){let s="default"===e;return(0,t.jsx)("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium border ${s?"bg-sky-500/10 text-sky-400 border-sky-500/20":"bg-amber-500/10 text-amber-400 border-amber-500/20"}`,children:e})}function eQ({ms:e}){return(0,t.jsx)("span",{className:`font-mono text-[0.7rem] ${e>500?"text-red-400":e>100?"text-amber-400":"text-muted-foreground"}`,children:e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`})}function eX({text:e}){let[r,n]=(0,s.useState)(!1),a=async t=>{t.stopPropagation();try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)}catch{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t),n(!0),setTimeout(()=>n(!1),1500)}};return(0,t.jsx)("button",{onClick:a,className:"inline-flex items-center justify-center h-5 w-5 rounded hover:bg-muted/50 text-muted-foreground hover:text-foreground transition-colors",title:"Copy",children:r?(0,t.jsx)(eW.Check,{className:"h-3 w-3 text-emerald-400"}):(0,t.jsx)(eU.Copy,{className:"h-3 w-3"})})}function eY({value:e,onChange:s}){return(0,t.jsx)("div",{className:"inline-flex items-center rounded-md border border-border bg-muted/30 p-0.5",children:[{label:"All",value:""},{label:"Allow",value:"allow"},{label:"Instruct",value:"instruct"},{label:"Deny",value:"deny"}].map(r=>(0,t.jsx)("button",{onClick:()=>s(r.value),className:`px-2.5 py-1 text-[0.65rem] font-medium rounded transition-all ${e===r.value?"deny"===r.value?"bg-red-500/15 text-red-400 shadow-sm":"allow"===r.value?"bg-emerald-500/15 text-emerald-400 shadow-sm":"instruct"===r.value?"bg-amber-500/15 text-amber-400 shadow-sm":"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:r.label},r.value))})}function eG({item:e}){return(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:9,className:"px-0 py-0",children:(0,t.jsxs)("div",{className:"px-6 py-3 bg-muted/20 border-t border-border/30 space-y-2 text-xs animate-in fade-in slide-in-from-top-1 duration-150",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-1.5",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Session ID: "}),(0,t.jsx)("span",{className:"font-mono text-foreground",children:e.sessionId??"—"}),e.sessionId&&(0,t.jsx)(eX,{text:e.sessionId})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"CWD: "}),(0,t.jsx)("span",{className:"font-mono text-foreground",children:e.cwd??"—"}),e.cwd&&(0,t.jsx)(eX,{text:e.cwd})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Transcript: "}),(0,t.jsx)("span",{className:"font-mono text-foreground break-all",children:e.transcriptPath??"—"})]})]}),e.reason&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Full reason: "}),(0,t.jsx)("span",{className:"text-foreground",children:e.reason})]})]})})})}function eZ({sessionId:e,initialData:r}){let{intervalSec:n}=(0,eV.useAutoRefresh)(),[a,i]=(0,s.useState)(!1),[l,o]=(0,s.useState)(1),[d,c]=(0,s.useState)(r),[u,m]=(0,s.useState)(null),[h,x]=(0,s.useState)(""),[p,f]=(0,s.useState)(""),[b,y]=(0,s.useState)(""),v=(0,s.useRef)(null),j=(0,s.useRef)({filterDecision:h,filterEventType:p,filterPolicy:b});j.current={filterDecision:h,filterEventType:p,filterPolicy:b};let N=""!==h||""!==p||""!==b,w=(0,s.useCallback)(async t=>{try{let{filterDecision:s,filterEventType:r,filterPolicy:n}=j.current,a=await (0,ez.searchHookActivityAction)({sessionId:e,decision:s||void 0,eventType:r||void 0,policyName:n||void 0},t);c(a)}catch{}},[e]);(0,s.useEffect)(()=>{w(l);let e=setInterval(()=>w(l),n>0?1e3*n:5e3);return()=>clearInterval(e)},[l,w,n]),(0,s.useEffect)(()=>(v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{o(1),m(null),w(1)},300),()=>{v.current&&clearTimeout(v.current)}),[h,p,b]);let k=d.entries,S=d.totalPages;return(0,t.jsxs)("div",{children:[(0,t.jsxs)("button",{onClick:()=>i(e=>!e),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,t.jsx)(g.ChevronDown,{className:`w-4 h-4 text-muted-foreground transition-transform ${a?"-rotate-90":""}`}),(0,t.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Hook Logs"})]}),!a&&(0,t.jsxs)("div",{className:"mt-2 bg-card border border-border rounded-lg overflow-hidden shadow-sm",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4 py-2.5 border-b border-border bg-muted/20",children:[(0,t.jsx)(eY,{value:h,onChange:x}),(0,t.jsxs)("select",{value:p,onChange:e=>f(e.target.value),className:"h-7 rounded-md border border-border bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/40 transition-shadow",children:[(0,t.jsx)("option",{value:"",children:"All Events"}),(0,t.jsx)("option",{value:"PreToolUse",children:"PreToolUse"}),(0,t.jsx)("option",{value:"PostToolUse",children:"PostToolUse"}),(0,t.jsx)("option",{value:"SessionStart",children:"SessionStart"}),(0,t.jsx)("option",{value:"SessionEnd",children:"SessionEnd"}),(0,t.jsx)("option",{value:"UserPromptSubmit",children:"UserPromptSubmit"}),(0,t.jsx)("option",{value:"PermissionRequest",children:"PermissionRequest"})]}),(0,t.jsx)("div",{className:"relative",children:(0,t.jsx)("input",{type:"text",value:b,onChange:e=>y(e.target.value),placeholder:"Filter by policy…",className:"h-7 rounded-md border border-border bg-background px-2.5 text-xs text-foreground placeholder:text-muted-foreground w-44 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/40 transition-shadow"})})]}),0===k.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 px-4",children:[(0,t.jsx)(eP.Shield,{className:"h-10 w-10 text-muted-foreground/30"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-3",children:N?"No matching hook events.":"No hook events found."})]}):(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full text-xs",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"text-left text-muted-foreground border-b border-border bg-muted/30",children:[(0,t.jsx)("th",{className:"px-4 py-2.5 font-medium w-6"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Decision"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Event"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Tool"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Policy"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Reason"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Duration"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Mode"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium text-right",children:"Time"})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-border/30",children:k.map((e,r)=>{var n;let a,i="deny"===e.decision,l=u===r,o="instruct"===e.decision;return(0,t.jsxs)(s.default.Fragment,{children:[(0,t.jsxs)("tr",{onClick:()=>{m(e=>e===r?null:r)},className:`cursor-pointer transition-colors ${i?"bg-red-500/[0.03] hover:bg-red-500/[0.07] border-l-2 border-l-red-500/40":o?"bg-amber-500/[0.03] hover:bg-amber-500/[0.07] border-l-2 border-l-amber-500/40":r%2==0?"hover:bg-muted/30":"bg-muted/[0.04] hover:bg-muted/30"} ${l?"bg-muted/20":""}`,children:[(0,t.jsx)("td",{className:"px-4 py-2",children:(0,t.jsx)(g.ChevronDown,{className:`h-3.5 w-3.5 text-muted-foreground transition-transform duration-150 ${l?"rotate-0":"-rotate-90"}`})}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(eB,{decision:e.decision})}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(eJ,{eventType:e.eventType})}),(0,t.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:e.toolName??"—"}),(0,t.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:e.policyName??"—"}),(0,t.jsx)("td",{className:"px-3 py-2 text-muted-foreground truncate max-w-[240px]",title:e.reason??"",children:e.reason??"—"}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(eQ,{ms:e.durationMs})}),(0,t.jsx)("td",{className:"px-3 py-2",children:e.permissionMode?(0,t.jsx)(eK,{mode:e.permissionMode}):"—"}),(0,t.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground whitespace-nowrap",title:new Date(e.timestamp).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),children:(n=e.timestamp,(a=Date.now()-n)<6e4?`${Math.max(1,Math.floor(a/1e3))}s ago`:a<36e5?`${Math.floor(a/6e4)}m ago`:a<864e5?`${Math.floor(a/36e5)}h ago`:`${Math.floor(a/864e5)}d ago`)})]}),l&&(0,t.jsx)(eG,{item:e})]},`${e.timestamp}-${r}`)})})]})}),(0,t.jsx)(eH.default,{currentPage:l,totalPages:S,onPageChange:e=>{o(e),m(null)}})]})]})}function e0(e){let t=new Map;for(let s of e)if("assistant"===s.type)for(let e of s.message.content){if("tool_use"!==e.type||"Task"===e.name&&(e.subagentType||e.subagentId))continue;let s=t.get(e.name)||{count:0,totalDurationMs:0};s.count++,e.result?.durationMs&&(s.totalDurationMs+=e.result.durationMs),t.set(e.name,s)}return Array.from(t.entries()).map(([e,t])=>({name:e,...t})).sort((e,t)=>t.count-e.count)}function e1({tools:e,compact:s}){return(0,t.jsx)("div",{className:`bg-card border border-border rounded-lg ${s?"p-3":"p-4"}`,children:(0,t.jsx)("div",{className:`grid grid-cols-[repeat(auto-fit,minmax(200px,1fr))] ${s?"gap-2":"gap-3"}`,children:e.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,t.jsx)(y,{className:"w-3.5 h-3.5 text-muted-foreground flex-shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("div",{className:`${s?"text-xs":"text-sm"} font-mono font-medium truncate`,children:e.name}),(0,t.jsxs)("div",{className:"text-xs text-muted-foreground truncate",children:[e.count," call",1!==e.count?"s":"",e.totalDurationMs>0&&` \xb7 ${(e.totalDurationMs/1e3).toFixed(1)}s`]})]})]},e.name))})})}function e2(e){return`${e.uuid}-${e.timestampMs}`}function e5(){let e=window.location.hash;return e.startsWith("#entry-")?e.slice(7):null}function e3({entries:e,allEntries:n,projectName:a,sessionId:i}){let[l,o]=(0,s.useState)(new Set),[c,m]=(0,s.useState)(0),[p,g]=(0,s.useState)(()=>e5()),b=(0,s.useRef)(void 0),y=(0,s.useRef)(!1),v=(0,s.useCallback)(e=>{e&&m(e.offsetTop)},[]),j=(0,s.useMemo)(()=>(function(e){let t=new Map,s=null,r=0;for(let n of e)"queue-operation"===n.type?(null!==s&&t.set(s,r),s=e2(n),r=0):null!==s&&r++;return null!==s&&t.set(s,r),t})(e),[e]),N=(0,s.useMemo)(()=>{let t;return t=!1,e.filter(e=>"queue-operation"===e.type?(t=l.has(e2(e)),!0):!t)},[e,l]),w=(0,s.useMemo)(()=>{let e=new Map;return N.forEach((t,s)=>{t.uuid&&e.set(t.uuid,s)}),e},[N]),k=(0,s.useMemo)(()=>(function(e){let t=new Map;for(let s of e)if("assistant"===s.type&&s.uuid)for(let e of s.message.content)"tool_use"===e.type&&"Task"===e.name&&e.subagentId&&t.set(e.subagentId,s.uuid);let s=new Map;for(let r of e){if(!r._source?.startsWith("agent-")||!r.uuid)continue;let e=r._source.slice(6),n=t.get(e);n&&s.set(r.uuid,n)}return s})(n),[n]),S=(0,s.useMemo)(()=>p&&k.has(p)?p:null,[p,k]),M=S?k.get(S)??null:null;(0,s.useEffect)(()=>{if(p)return b.current=setTimeout(()=>g(null),4e3),()=>{b.current&&clearTimeout(b.current)}},[]),(0,s.useEffect)(()=>{let e=()=>{let e=e5();g(e),y.current=!1,b.current&&clearTimeout(b.current),e&&(b.current=setTimeout(()=>g(null),4e3))};return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[]);let C=(0,s.useMemo)(()=>{if(!p)return null;let t=M??p,s=e.some(e=>e.uuid===t),r=w.has(t);if(s&&!r){let s=null;for(let r of e)if("queue-operation"===r.type)s=e2(r);else if(r.uuid===t&&s)return s}return null},[p,M,e,w]);(0,s.useEffect)(()=>{if(!C)return;let e=requestAnimationFrame(()=>{o(e=>{if(!e.has(C))return e;let t=new Set(e);return t.delete(C),t})});return()=>cancelAnimationFrame(e)},[C]);let E=(0,s.useCallback)(e=>{o(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]),I=function({useFlushSync:e=!0,...t}){let n=s.useReducer(()=>({}),{})[1],a={...t,onChange:(s,a)=>{var i;e&&a?(0,r.flushSync)(n):n(),null==(i=t.onChange)||i.call(t,s,a)}},[i]=s.useState(()=>new x(a));return i.setOptions(a),f(()=>i._didMount(),[]),f(()=>i._willUpdate()),i}({getScrollElement:()=>"u">typeof document?window:null,observeElementRect:d,observeElementOffset:u,scrollToFn:h,initialOffset:()=>"u">typeof document?window.scrollY:0,...{count:N.length,estimateSize:e=>(function(e){switch(e.type){case"queue-operation":return 48;case"user":return 90;case"assistant":return 80+120*e.message.content.length;default:return 100}})(N[e]),overscan:5,scrollMargin:c}});return(0,s.useEffect)(()=>{if(!p||y.current)return;let e=M??p,t=w.get(e);null!=t&&(y.current=!0,requestAnimationFrame(()=>{I.scrollToIndex(t,{align:"center"})}))},[p,M,w,I]),(0,t.jsx)("div",{ref:v,children:(0,t.jsx)("div",{style:{height:`${I.getTotalSize()}px`,width:"100%",position:"relative"},children:I.getVirtualItems().map(e=>{let s=N[e.index],r=!!p&&s.uuid===(M??p);return(0,t.jsx)("div",{"data-index":e.index,ref:I.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${e.start-I.options.scrollMargin}px)`},children:"queue-operation"===s.type?(0,t.jsx)(T,{entry:s,isCollapsed:l.has(e2(s)),entryCount:j.get(e2(s))??0,onToggle:()=>E(e2(s))}):(0,t.jsx)(ew,{entry:s,allEntries:n,projectName:a,sessionId:i,isHighlighted:!S&&r,highlightedUuid:S,autoExpandForUuid:S})},"queue-operation"===s.type?e2(s):s.uuid||s.timestamp)})})})}e.s([],76248),e.i(76248),e.s(["default",0,function({entries:e,projectName:r,sessionId:n}){let a=(0,s.useMemo)(()=>e.filter(e=>"session"===e._source),[e]),i=(0,s.useMemo)(()=>(function(e){let t=new Map;for(let s of e)if("assistant"===s.type)for(let e of s.message.content)"tool_use"===e.type&&"Task"===e.name&&e.subagentId&&(t.has(e.subagentId)||t.set(e.subagentId,{id:e.subagentId,type:e.subagentType||"unknown",description:e.subagentDescription||""}));return Array.from(t.values())})(e),[e]),l=(0,s.useMemo)(()=>{let t=new Map;for(let s of i){let r=`agent-${s.id}`;t.set(s.id,e.filter(e=>e._source===r))}return t},[e,i]),o=(0,s.useMemo)(()=>e0(a),[a]),[d,c]=(0,s.useState)(!1),[u,m]=(0,s.useState)(new Set),[h,x]=(0,s.useState)(!1),[p,f]=(0,s.useState)(null);(0,s.useEffect)(()=>{(0,ez.searchHookActivityAction)({sessionId:n},1).then(e=>{e.entries.length>0&&f(e)}).catch(()=>{})},[n]),(0,s.useEffect)(()=>{let e=()=>{window.location.hash.startsWith("#entry-")&&x(!1)};return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[]);let b=(0,s.useCallback)(e=>{m(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]);return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(M,{entries:a}),p&&(0,t.jsx)(eZ,{sessionId:n,initialData:p},n),(0,t.jsx)(ea,{projectName:r,sessionId:n}),(0,t.jsx)(em,{projectName:r,sessionId:n}),(0,t.jsx)(eF,{projectName:r,sessionId:n}),i.length>0&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("button",{onClick:()=>c(e=>!e),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,t.jsx)(g.ChevronDown,{className:`w-4 h-4 text-muted-foreground transition-transform ${d?"-rotate-90":""}`}),(0,t.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Subagents"}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",i.length,")"]})]}),!d&&i.map(e=>{let s;return(0,t.jsxs)("div",{className:"pl-3 border-l-2 border-primary/30 space-y-2",children:[(0,t.jsxs)("button",{onClick:()=>b(e.id),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,t.jsx)(g.ChevronDown,{className:`w-3.5 h-3.5 text-muted-foreground transition-transform ${u.has(e.id)?"-rotate-90":""}`}),(0,t.jsx)("span",{className:"text-sm font-bold",children:e.type}),e.description&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground truncate max-w-[400px]",children:e.description})]}),!u.has(e.id)&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(M,{entries:l.get(e.id)||[],compact:!0}),p&&(0,t.jsx)(eZ,{sessionId:n,initialData:p},`hooks-${e.id}`),(0,t.jsx)(ea,{projectName:r,sessionId:n,agentId:e.id,subagentType:e.type,subagentDescription:e.description,compact:!0}),(0,t.jsx)(em,{projectName:r,sessionId:n,agentId:e.id,subagentType:e.type,subagentDescription:e.description,compact:!0}),(0,t.jsx)(eF,{projectName:r,sessionId:n,agentId:e.id,subagentType:e.type,subagentDescription:e.description,compact:!0}),(s=e0(l.get(e.id)||[])).length>0?(0,t.jsx)(e1,{tools:s,compact:!0}):null]})]},e.id)})]}),o.length>0&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Tools"}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",o.reduce((e,t)=>e+t.count,0),")"]})]}),(0,t.jsx)(e1,{tools:o})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("button",{onClick:()=>x(e=>!e),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,t.jsx)(g.ChevronDown,{className:`w-4 h-4 text-muted-foreground transition-transform ${h?"-rotate-90":""}`}),(0,t.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Logs"})]}),!h&&(0,t.jsx)("div",{className:"mt-2 bg-card border border-border rounded-lg p-4 shadow-sm",children:0===a.length?(0,t.jsx)("p",{className:"text-muted-foreground text-center py-8",children:"No entries found."}):(0,t.jsx)(e3,{entries:a,allEntries:e,projectName:r,sessionId:n})})]})]})}],36406)},5780,e=>{e.n(e.i(36406))}]);