fleetlens 0.13.1 → 0.13.2

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 (94) hide show
  1. package/app/apps/web/.next/BUILD_ID +1 -1
  2. package/app/apps/web/.next/build-manifest.json +3 -3
  3. package/app/apps/web/.next/prerender-manifest.json +3 -3
  4. package/app/apps/web/.next/server/app/_global-error.html +1 -1
  5. package/app/apps/web/.next/server/app/_global-error.rsc +1 -1
  6. package/app/apps/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  7. package/app/apps/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  8. package/app/apps/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  9. package/app/apps/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  10. package/app/apps/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  11. package/app/apps/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  12. package/app/apps/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  13. package/app/apps/web/.next/server/app/api/ask/route.js.nft.json +1 -1
  14. package/app/apps/web/.next/server/app/api/digest/day/[date]/route.js.nft.json +1 -1
  15. package/app/apps/web/.next/server/app/api/digest/month/[yearMonth]/route.js.nft.json +1 -1
  16. package/app/apps/web/.next/server/app/api/digest/month-index/route.js.nft.json +1 -1
  17. package/app/apps/web/.next/server/app/api/digest/week/[startDate]/route.js.nft.json +1 -1
  18. package/app/apps/web/.next/server/app/api/digest/week-index/route.js.nft.json +1 -1
  19. package/app/apps/web/.next/server/app/api/events/route.js.nft.json +1 -1
  20. package/app/apps/web/.next/server/app/api/jobs/route.js.nft.json +1 -1
  21. package/app/apps/web/.next/server/app/api/pdf/[key]/route.js.nft.json +1 -1
  22. package/app/apps/web/.next/server/app/api/runs/[runId]/route.js.nft.json +1 -1
  23. package/app/apps/web/.next/server/app/api/runs/[runId]/stream/route.js.nft.json +1 -1
  24. package/app/apps/web/.next/server/app/api/runs/route.js.nft.json +1 -1
  25. package/app/apps/web/.next/server/app/api/settings/route.js.nft.json +1 -1
  26. package/app/apps/web/.next/server/app/api/team-config/route.js.nft.json +1 -1
  27. package/app/apps/web/.next/server/app/api/workflow-agent/route.js.nft.json +1 -1
  28. package/app/apps/web/.next/server/app/changelog/page.js.nft.json +1 -1
  29. package/app/apps/web/.next/server/app/changelog/page_client-reference-manifest.js +1 -1
  30. package/app/apps/web/.next/server/app/day/[date]/page.js.nft.json +1 -1
  31. package/app/apps/web/.next/server/app/day/[date]/page_client-reference-manifest.js +1 -1
  32. package/app/apps/web/.next/server/app/day/page.js.nft.json +1 -1
  33. package/app/apps/web/.next/server/app/day/page_client-reference-manifest.js +1 -1
  34. package/app/apps/web/.next/server/app/digest/[date]/page.js.nft.json +1 -1
  35. package/app/apps/web/.next/server/app/digest/[date]/page_client-reference-manifest.js +1 -1
  36. package/app/apps/web/.next/server/app/digest/page.js.nft.json +1 -1
  37. package/app/apps/web/.next/server/app/digest/page_client-reference-manifest.js +1 -1
  38. package/app/apps/web/.next/server/app/insights/[key]/page.js.nft.json +1 -1
  39. package/app/apps/web/.next/server/app/insights/[key]/page_client-reference-manifest.js +1 -1
  40. package/app/apps/web/.next/server/app/insights/page.js.nft.json +1 -1
  41. package/app/apps/web/.next/server/app/insights/page_client-reference-manifest.js +1 -1
  42. package/app/apps/web/.next/server/app/page.js.nft.json +1 -1
  43. package/app/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
  44. package/app/apps/web/.next/server/app/parallelism/page.js.nft.json +1 -1
  45. package/app/apps/web/.next/server/app/parallelism/page_client-reference-manifest.js +1 -1
  46. package/app/apps/web/.next/server/app/print/[key]/page.js.nft.json +1 -1
  47. package/app/apps/web/.next/server/app/print/[key]/page_client-reference-manifest.js +1 -1
  48. package/app/apps/web/.next/server/app/projects/[slug]/page.js.nft.json +1 -1
  49. package/app/apps/web/.next/server/app/projects/[slug]/page_client-reference-manifest.js +1 -1
  50. package/app/apps/web/.next/server/app/projects/page.js.nft.json +1 -1
  51. package/app/apps/web/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  52. package/app/apps/web/.next/server/app/runs/page.js.nft.json +1 -1
  53. package/app/apps/web/.next/server/app/runs/page_client-reference-manifest.js +1 -1
  54. package/app/apps/web/.next/server/app/sessions/[id]/page.js.nft.json +1 -1
  55. package/app/apps/web/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
  56. package/app/apps/web/.next/server/app/sessions/page.js.nft.json +1 -1
  57. package/app/apps/web/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  58. package/app/apps/web/.next/server/app/settings/page.js.nft.json +1 -1
  59. package/app/apps/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  60. package/app/apps/web/.next/server/app/team/page.js.nft.json +1 -1
  61. package/app/apps/web/.next/server/app/team/page_client-reference-manifest.js +1 -1
  62. package/app/apps/web/.next/server/app/usage/page.js.nft.json +1 -1
  63. package/app/apps/web/.next/server/app/usage/page_client-reference-manifest.js +1 -1
  64. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0n-ax-5._.js +1 -1
  65. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0~.f_3z._.js +3 -3
  66. package/app/apps/web/.next/server/chunks/ssr/_0xu2pvc._.js +1 -1
  67. package/app/apps/web/.next/server/chunks/ssr/apps_web_app_day_[date]_day-view_tsx_0wjoe1u._.js +1 -1
  68. package/app/apps/web/.next/server/chunks/ssr/apps_web_lib_changelog_ts_0n7_p1d._.js +1 -1
  69. package/app/apps/web/.next/server/chunks/ssr/apps_web_lib_changelog_ts_0nb5_-s._.js +1 -1
  70. package/app/apps/web/.next/server/middleware-build-manifest.js +3 -3
  71. package/app/apps/web/.next/server/middleware-manifest.json +5 -5
  72. package/app/apps/web/.next/server/pages/500.html +1 -1
  73. package/app/apps/web/.next/server/server-reference-manifest.js +1 -1
  74. package/app/apps/web/.next/server/server-reference-manifest.json +1 -1
  75. package/app/apps/web/.next/static/chunks/{0vz4~a~~hq399.js → 02xxpexzk3rf-.js} +1 -1
  76. package/app/apps/web/.next/static/chunks/0uyctl-m8iydb.js +1 -0
  77. package/app/apps/web/.next/static/chunks/0~qdw1b2uz._5.js +10 -0
  78. package/app/apps/web/app/parallelism/gantt-chart.tsx +8 -1
  79. package/app/apps/web/app/sessions/[id]/session-view/minimap.tsx +1587 -0
  80. package/app/apps/web/app/sessions/[id]/session-view/workflows-panel.tsx +944 -0
  81. package/app/apps/web/app/sessions/[id]/session-view.tsx +909 -3223
  82. package/app/apps/web/components/tail-mode.tsx +7 -1
  83. package/app/apps/web/lib/changelog-data.generated.ts +1 -1
  84. package/app/apps/web/lib/format.ts +17 -0
  85. package/app/apps/web/package.json +1 -1
  86. package/app/apps/web/tsconfig.tsbuildinfo +1 -1
  87. package/dist/daemon-worker.js +4 -4
  88. package/dist/index.js +11 -11
  89. package/package.json +1 -1
  90. package/app/apps/web/.next/static/chunks/02bv_ejzhhzvp.js +0 -10
  91. package/app/apps/web/.next/static/chunks/0q8dg4txlzno0.js +0 -1
  92. /package/app/apps/web/.next/static/{VEfemGVAQ0xCHjj15orZU → bZs5UyzsYBqC6MFY5n-M_}/_buildManifest.js +0 -0
  93. /package/app/apps/web/.next/static/{VEfemGVAQ0xCHjj15orZU → bZs5UyzsYBqC6MFY5n-M_}/_clientMiddlewareManifest.js +0 -0
  94. /package/app/apps/web/.next/static/{VEfemGVAQ0xCHjj15orZU → bZs5UyzsYBqC6MFY5n-M_}/_ssgManifest.js +0 -0
@@ -1,3 +1,3 @@
1
- module.exports=[63681,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={RequestCookies:function(){return f.RequestCookies},ResponseCookies:function(){return f.ResponseCookies},stringifyCookie:function(){return f.stringifyCookie}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(36226)},51409,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"ReflectAdapter",{enumerable:!0,get:function(){return d}});class d{static get(a,b,c){let d=Reflect.get(a,b,c);return"function"==typeof d?d.bind(a):d}static set(a,b,c,d){return Reflect.set(a,b,c,d)}static has(a,b){return Reflect.has(a,b)}static deleteProperty(a,b){return Reflect.deleteProperty(a,b)}}},4712,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={ActionDidNotRevalidate:function(){return f},ActionDidRevalidateDynamicOnly:function(){return h},ActionDidRevalidateStaticAndDynamic:function(){return g}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=0,g=1,h=2},14896,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={MutableRequestCookiesAdapter:function(){return o},ReadonlyRequestCookiesError:function(){return j},RequestCookiesAdapter:function(){return k},appendMutableCookies:function(){return n},areCookiesMutableInCurrentPhase:function(){return q},createCookiesWithMutableAccessCheck:function(){return p},getModifiedCookieValues:function(){return m},responseCookiesToRequestCookies:function(){return s}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(63681),g=a.r(51409),h=a.r(56704),i=a.r(4712);class j extends Error{constructor(){super("Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#options")}static callable(){throw new j}}class k{static seal(a){return new Proxy(a,{get(a,b,c){switch(b){case"clear":case"delete":case"set":return j.callable;default:return g.ReflectAdapter.get(a,b,c)}}})}}let l=Symbol.for("next.mutated.cookies");function m(a){let b=a[l];return b&&Array.isArray(b)&&0!==b.length?b:[]}function n(a,b){let c=m(b);if(0===c.length)return!1;let d=new f.ResponseCookies(a),e=d.getAll();for(let a of c)d.set(a);for(let a of e)d.set(a);return!0}class o{static wrap(a,b){let c=new f.ResponseCookies(new Headers);for(let b of a.getAll())c.set(b);let d=[],e=new Set,j=()=>{let a=h.workAsyncStorage.getStore();if(a&&(a.pathWasRevalidated=i.ActionDidRevalidateStaticAndDynamic),d=c.getAll().filter(a=>e.has(a.name)),b){let a=[];for(let b of d){let c=new f.ResponseCookies(new Headers);c.set(b),a.push(c.toString())}b(a)}},k=new Proxy(c,{get(a,b,c){switch(b){case l:return d;case"delete":return function(...b){e.add("string"==typeof b[0]?b[0]:b[0].name);try{return a.delete(...b),k}finally{j()}};case"set":return function(...b){e.add("string"==typeof b[0]?b[0]:b[0].name);try{return a.set(...b),k}finally{j()}};default:return g.ReflectAdapter.get(a,b,c)}}});return k}}function p(a){let b=new Proxy(a.mutableCookies,{get(c,d,e){switch(d){case"delete":return function(...d){return r(a,"cookies().delete"),c.delete(...d),b};case"set":return function(...d){return r(a,"cookies().set"),c.set(...d),b};default:return g.ReflectAdapter.get(c,d,e)}}});return b}function q(a){return"action"===a.phase}function r(a,b){if(!q(a))throw new j}function s(a){let b=new f.RequestCookies(new Headers);for(let c of a.getAll())b.set(c);return b}},8018,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"createDedupedByCallsiteServerErrorLoggerDev",{enumerable:!0,get:function(){return i}});let d=function(a){if(a&&a.__esModule)return a;if(null===a||"object"!=typeof a&&"function"!=typeof a)return{default:a};var b=e(void 0);if(b&&b.has(a))return b.get(a);var c={__proto__:null},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in a)if("default"!==f&&Object.prototype.hasOwnProperty.call(a,f)){var g=d?Object.getOwnPropertyDescriptor(a,f):null;g&&(g.get||g.set)?Object.defineProperty(c,f,g):c[f]=a[f]}return c.default=a,b&&b.set(a,c),c}(a.r(717));function e(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(e=function(a){return a?c:b})(a)}let f={current:null},g="function"==typeof d.cache?d.cache:a=>a,h=console.warn;function i(a){return function(...b){h(a(...b))}}g(a=>{try{h(f.current)}finally{f.current=null}})},86309,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={isRequestAPICallableInsideAfter:function(){return j},throwForSearchParamsAccessInUseCache:function(){return i},throwWithStaticGenerationBailoutErrorWithDynamicError:function(){return h}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(60312),g=a.r(24725);function h(a,b){throw Object.defineProperty(new f.StaticGenBailoutError(`Route ${a} with \`dynamic = "error"\` couldn't be rendered statically because it used ${b}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E543",enumerable:!1,configurable:!0})}function i(a,b){let c=Object.defineProperty(Error(`Route ${a.route} used \`searchParams\` inside "use cache". Accessing dynamic request data inside a cache scope is not supported. If you need some search params inside a cached function await \`searchParams\` outside of the cached function and pass only the required search params as arguments to the cached function. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E842",enumerable:!1,configurable:!0});throw Error.captureStackTrace(c,b),a.invalidDynamicUsageError??=c,c}function j(){let a=g.afterTaskAsyncStorage.getStore();return(null==a?void 0:a.rootTaskSpawnPhase)==="action"}},81740,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"cookies",{enumerable:!0,get:function(){return n}});let d=a.r(14896),e=a.r(63681),f=a.r(56704),g=a.r(32319),h=a.r(60384),i=a.r(60312),j=a.r(13091),k=a.r(8018),l=a.r(86309),m=a.r(50640);function n(){let a="cookies",b=f.workAsyncStorage.getStore(),c=g.workUnitAsyncStorage.getStore();if(b){if(c&&"after"===c.phase&&!(0,l.isRequestAPICallableInsideAfter)())throw Object.defineProperty(Error(`Route ${b.route} used \`cookies()\` inside \`after()\`. This is not supported. If you need this data inside an \`after()\` callback, use \`cookies()\` outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E843",enumerable:!1,configurable:!0});if(b.forceStatic)return p(d.RequestCookiesAdapter.seal(new e.RequestCookies(new Headers({}))));if(b.dynamicShouldError)throw Object.defineProperty(new i.StaticGenBailoutError(`Route ${b.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`cookies()\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E849",enumerable:!1,configurable:!0});if(c)switch(c.type){case"cache":let f=Object.defineProperty(Error(`Route ${b.route} used \`cookies()\` inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`cookies()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E831",enumerable:!1,configurable:!0});throw Error.captureStackTrace(f,n),b.invalidDynamicUsageError??=f,f;case"unstable-cache":throw Object.defineProperty(Error(`Route ${b.route} used \`cookies()\` inside a function cached with \`unstable_cache()\`. Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`cookies()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E846",enumerable:!1,configurable:!0});case"generate-static-params":throw Object.defineProperty(Error(`Route ${b.route} used \`cookies()\` inside \`generateStaticParams\`. This is not supported because \`generateStaticParams\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`),"__NEXT_ERROR_CODE",{value:"E1123",enumerable:!1,configurable:!0});case"prerender":var k=b,q=c;let r=o.get(q);if(r)return r;let s=(0,j.makeHangingPromise)(q.renderSignal,k.route,"`cookies()`");return o.set(q,s),s;case"prerender-client":case"validation-client":let t="`cookies`";throw Object.defineProperty(new m.InvariantError(`${t} must not be used within a Client Component. Next.js should be preventing ${t} from being included in Client Components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E1037",enumerable:!1,configurable:!0});case"prerender-ppr":return(0,h.postponeWithTracking)(b.route,a,c.dynamicTracking);case"prerender-legacy":return(0,h.throwToInterruptStaticGeneration)(a,b,c);case"prerender-runtime":return(0,j.delayUntilRuntimeStage)(c,p(c.cookies));case"private-cache":return p(c.cookies);case"request":let u;if((0,h.trackDynamicDataInDynamicRender)(c),u=(0,d.areCookiesMutableInCurrentPhase)(c)?c.userspaceMutableCookies:c.cookies,!c.asyncApiPromises)return p(u);{let a=(0,g.isInEarlyRenderStage)(c);if(u===c.mutableCookies)return a?c.asyncApiPromises.earlyMutableCookies:c.asyncApiPromises.mutableCookies;return a?c.asyncApiPromises.earlyCookies:c.asyncApiPromises.cookies}}}(0,g.throwForMissingRequestStore)(a)}a.r(31382);let o=new WeakMap;function p(a){let b=o.get(a);if(b)return b;let c=Promise.resolve(a);return o.set(a,c),c}(0,k.createDedupedByCallsiteServerErrorLoggerDev)(function(a,b){let c=a?`Route "${a}" `:"This route ";return Object.defineProperty(Error(`${c}used ${b}. \`cookies()\` returns a Promise and must be unwrapped with \`await\` or \`React.use()\` before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`),"__NEXT_ERROR_CODE",{value:"E830",enumerable:!1,configurable:!0})})},29927,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={HeadersAdapter:function(){return h},ReadonlyHeadersError:function(){return g}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(51409);class g extends Error{constructor(){super("Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers")}static callable(){throw new g}}class h extends Headers{constructor(a){super(),this.headers=new Proxy(a,{get(b,c,d){if("symbol"==typeof c)return f.ReflectAdapter.get(b,c,d);let e=c.toLowerCase(),g=Object.keys(a).find(a=>a.toLowerCase()===e);if(void 0!==g)return f.ReflectAdapter.get(b,g,d)},set(b,c,d,e){if("symbol"==typeof c)return f.ReflectAdapter.set(b,c,d,e);let g=c.toLowerCase(),h=Object.keys(a).find(a=>a.toLowerCase()===g);return f.ReflectAdapter.set(b,h??c,d,e)},has(b,c){if("symbol"==typeof c)return f.ReflectAdapter.has(b,c);let d=c.toLowerCase(),e=Object.keys(a).find(a=>a.toLowerCase()===d);return void 0!==e&&f.ReflectAdapter.has(b,e)},deleteProperty(b,c){if("symbol"==typeof c)return f.ReflectAdapter.deleteProperty(b,c);let d=c.toLowerCase(),e=Object.keys(a).find(a=>a.toLowerCase()===d);return void 0===e||f.ReflectAdapter.deleteProperty(b,e)}})}static seal(a){return new Proxy(a,{get(a,b,c){switch(b){case"append":case"delete":case"set":return g.callable;default:return f.ReflectAdapter.get(a,b,c)}}})}merge(a){return Array.isArray(a)?a.join(", "):a}static from(a){return a instanceof Headers?a:new h(a)}append(a,b){let c=this.headers[a];"string"==typeof c?this.headers[a]=[c,b]:Array.isArray(c)?c.push(b):this.headers[a]=b}delete(a){delete this.headers[a]}get(a){let b=this.headers[a];return void 0!==b?this.merge(b):null}has(a){return void 0!==this.headers[a]}set(a,b){this.headers[a]=b}forEach(a,b){for(let[c,d]of this.entries())a.call(b,d,c,this)}*entries(){for(let a of Object.keys(this.headers)){let b=a.toLowerCase(),c=this.get(b);yield[b,c]}}*keys(){for(let a of Object.keys(this.headers)){let b=a.toLowerCase();yield b}}*values(){for(let a of Object.keys(this.headers)){let b=this.get(a);yield b}}[Symbol.iterator](){return this.entries()}}},35754,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"headers",{enumerable:!0,get:function(){return m}});let d=a.r(29927),e=a.r(56704),f=a.r(32319),g=a.r(60384),h=a.r(60312),i=a.r(13091),j=a.r(8018),k=a.r(86309),l=a.r(50640);function m(){let a="headers",b=e.workAsyncStorage.getStore(),c=f.workUnitAsyncStorage.getStore();if(b){if(c&&"after"===c.phase&&!(0,k.isRequestAPICallableInsideAfter)())throw Object.defineProperty(Error(`Route ${b.route} used \`headers()\` inside \`after()\`. This is not supported. If you need this data inside an \`after()\` callback, use \`headers()\` outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E839",enumerable:!1,configurable:!0});if(b.forceStatic)return o(d.HeadersAdapter.seal(new Headers({})));if(c)switch(c.type){case"cache":{let a=Object.defineProperty(Error(`Route ${b.route} used \`headers()\` inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`headers()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E833",enumerable:!1,configurable:!0});throw Error.captureStackTrace(a,m),b.invalidDynamicUsageError??=a,a}case"unstable-cache":throw Object.defineProperty(Error(`Route ${b.route} used \`headers()\` inside a function cached with \`unstable_cache()\`. Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`headers()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E838",enumerable:!1,configurable:!0});case"generate-static-params":throw Object.defineProperty(Error(`Route ${b.route} used \`headers()\` inside \`generateStaticParams\`. This is not supported because \`generateStaticParams\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`),"__NEXT_ERROR_CODE",{value:"E1134",enumerable:!1,configurable:!0})}if(b.dynamicShouldError)throw Object.defineProperty(new h.StaticGenBailoutError(`Route ${b.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`headers()\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E828",enumerable:!1,configurable:!0});if(c)switch(c.type){case"prerender":var j=b,p=c;let e=n.get(p);if(e)return e;let q=(0,i.makeHangingPromise)(p.renderSignal,j.route,"`headers()`");return n.set(p,q),q;case"prerender-client":case"validation-client":let r="`headers`";throw Object.defineProperty(new l.InvariantError(`${r} must not be used within a client component. Next.js should be preventing ${r} from being included in client components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E1017",enumerable:!1,configurable:!0});case"prerender-ppr":return(0,g.postponeWithTracking)(b.route,a,c.dynamicTracking);case"prerender-legacy":return(0,g.throwToInterruptStaticGeneration)(a,b,c);case"prerender-runtime":return(0,i.delayUntilRuntimeStage)(c,o(c.headers));case"private-cache":return o(c.headers);case"request":if((0,g.trackDynamicDataInDynamicRender)(c),c.asyncApiPromises)return(0,f.isInEarlyRenderStage)(c)?c.asyncApiPromises.earlyHeaders:c.asyncApiPromises.headers;return o(c.headers)}}(0,f.throwForMissingRequestStore)(a)}a.r(31382);let n=new WeakMap;function o(a){let b=n.get(a);if(b)return b;let c=Promise.resolve(a);return n.set(a,c),c}(0,j.createDedupedByCallsiteServerErrorLoggerDev)(function(a,b){let c=a?`Route "${a}" `:"This route ";return Object.defineProperty(Error(`${c}used ${b}. \`headers()\` returns a Promise and must be unwrapped with \`await\` or \`React.use()\` before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`),"__NEXT_ERROR_CODE",{value:"E836",enumerable:!1,configurable:!0})})},51125,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"draftMode",{enumerable:!0,get:function(){return l}});let d=a.r(32319),e=a.r(56704),f=a.r(60384),g=a.r(8018),h=a.r(60312),i=a.r(96556),j=a.r(50640),k=a.r(13091);function l(){let a="draftMode",b=e.workAsyncStorage.getStore(),c=d.workUnitAsyncStorage.getStore();switch((!b||!c)&&(0,d.throwForMissingRequestStore)(a),c.type){case"prerender-runtime":return(0,k.delayUntilRuntimeStage)(c,m(c.draftMode,b));case"request":return m(c.draftMode,b);case"cache":case"private-cache":case"unstable-cache":let f=(0,d.getDraftModeProviderForCacheScope)(b,c);if(f)return m(f,b);case"prerender":case"prerender-ppr":case"prerender-legacy":return m(null,b);case"prerender-client":case"validation-client":{let a="`draftMode`";throw Object.defineProperty(new j.InvariantError(`${a} must not be used within a Client Component. Next.js should be preventing ${a} from being included in Client Components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E1046",enumerable:!1,configurable:!0})}case"generate-static-params":throw Object.defineProperty(Error(`Route ${b.route} used \`${a}()\` inside \`generateStaticParams\`. This is not supported because \`generateStaticParams\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`),"__NEXT_ERROR_CODE",{value:"E1132",enumerable:!1,configurable:!0});default:return c}}function m(a,b){let c=o.get(a??n);return c||Promise.resolve(new p(a))}a.r(51409);let n={},o=new WeakMap;class p{constructor(a){this._provider=a}get isEnabled(){return null!==this._provider&&this._provider.isEnabled}enable(){q("draftMode().enable()",this.enable),null!==this._provider&&this._provider.enable()}disable(){q("draftMode().disable()",this.disable),null!==this._provider&&this._provider.disable()}}function q(a,b){let c=e.workAsyncStorage.getStore(),g=d.workUnitAsyncStorage.getStore();if(c){if((null==g?void 0:g.phase)==="after")throw Object.defineProperty(Error(`Route ${c.route} used "${a}" inside \`after()\`. The enabled status of \`draftMode()\` can be read inside \`after()\` but you cannot enable or disable \`draftMode()\`. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E845",enumerable:!1,configurable:!0});if(c.dynamicShouldError)throw Object.defineProperty(new h.StaticGenBailoutError(`Route ${c.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${a}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E553",enumerable:!1,configurable:!0});if(g)switch(g.type){case"cache":case"private-cache":{let d=Object.defineProperty(Error(`Route ${c.route} used "${a}" inside "use cache". The enabled status of \`draftMode()\` can be read in caches but you must not enable or disable \`draftMode()\` inside a cache. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E829",enumerable:!1,configurable:!0});throw Error.captureStackTrace(d,b),c.invalidDynamicUsageError??=d,d}case"unstable-cache":throw Object.defineProperty(Error(`Route ${c.route} used "${a}" inside a function cached with \`unstable_cache()\`. The enabled status of \`draftMode()\` can be read in caches but you must not enable or disable \`draftMode()\` inside a cache. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E844",enumerable:!1,configurable:!0});case"prerender":case"prerender-runtime":{let b=Object.defineProperty(Error(`Route ${c.route} used ${a} without first calling \`await connection()\`. See more info here: https://nextjs.org/docs/messages/next-prerender-sync-headers`),"__NEXT_ERROR_CODE",{value:"E126",enumerable:!1,configurable:!0});return(0,f.abortAndThrowOnSynchronousRequestDataAccess)(c.route,a,b,g)}case"prerender-client":case"validation-client":let d="`draftMode`";throw Object.defineProperty(new j.InvariantError(`${d} must not be used within a Client Component. Next.js should be preventing ${d} from being included in Client Components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E1046",enumerable:!1,configurable:!0});case"prerender-ppr":return(0,f.postponeWithTracking)(c.route,a,g.dynamicTracking);case"prerender-legacy":g.revalidate=0;let e=Object.defineProperty(new i.DynamicServerError(`Route ${c.route} couldn't be rendered statically because it used \`${a}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`),"__NEXT_ERROR_CODE",{value:"E558",enumerable:!1,configurable:!0});throw c.dynamicUsageDescription=a,c.dynamicUsageStack=e.stack,e;case"request":(0,f.trackDynamicDataInDynamicRender)(g);break;case"generate-static-params":throw Object.defineProperty(Error(`Route ${c.route} used \`${a}\` inside \`generateStaticParams\`. This is not supported because \`generateStaticParams\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`),"__NEXT_ERROR_CODE",{value:"E1121",enumerable:!1,configurable:!0})}}}(0,g.createDedupedByCallsiteServerErrorLoggerDev)(function(a,b){let c=a?`Route "${a}" `:"This route ";return Object.defineProperty(Error(`${c}used ${b}. \`draftMode()\` returns a Promise and must be unwrapped with \`await\` or \`React.use()\` before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`),"__NEXT_ERROR_CODE",{value:"E835",enumerable:!1,configurable:!0})})},5246,(a,b,c)=>{b.exports.cookies=a.r(81740).cookies,b.exports.headers=a.r(35754).headers,b.exports.draftMode=a.r(51125).draftMode},45017,a=>{"use strict";a.s(["Sidebar",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call Sidebar() from the server but Sidebar is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/apps/web/components/sidebar.tsx <module evaluation>","Sidebar")},10398,a=>{"use strict";a.s(["Sidebar",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call Sidebar() from the server but Sidebar is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/apps/web/components/sidebar.tsx","Sidebar")},23604,a=>{"use strict";a.i(45017);var b=a.i(10398);a.n(b)},59969,a=>{"use strict";a.s(["LiveRefresher",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call LiveRefresher() from the server but LiveRefresher is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/apps/web/components/live-refresher.tsx <module evaluation>","LiveRefresher")},11272,a=>{"use strict";a.s(["LiveRefresher",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call LiveRefresher() from the server but LiveRefresher is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/apps/web/components/live-refresher.tsx","LiveRefresher")},30642,a=>{"use strict";a.i(59969);var b=a.i(11272);a.n(b)},99153,a=>{"use strict";a.s(["LiveSessionsWidget",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call LiveSessionsWidget() from the server but LiveSessionsWidget is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/apps/web/components/live-sessions-widget.tsx <module evaluation>","LiveSessionsWidget")},62615,a=>{"use strict";a.s(["LiveSessionsWidget",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call LiveSessionsWidget() from the server but LiveSessionsWidget is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/apps/web/components/live-sessions-widget.tsx","LiveSessionsWidget")},9647,a=>{"use strict";a.i(99153);var b=a.i(62615);a.n(b)},14022,a=>{"use strict";a.s(["JobQueueWidget",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call JobQueueWidget() from the server but JobQueueWidget is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/apps/web/components/job-queue-widget.tsx <module evaluation>","JobQueueWidget")},5900,a=>{"use strict";a.s(["JobQueueWidget",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call JobQueueWidget() from the server but JobQueueWidget is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/apps/web/components/job-queue-widget.tsx","JobQueueWidget")},84829,a=>{"use strict";a.i(14022);var b=a.i(5900);a.n(b)},28992,a=>{"use strict";var b=a.i(7997),c=a.i(5246),d=a.i(23604),e=a.i(30642),f=a.i(9647),g=a.i(84829);a.i(9117);var h=a.i(48024),i=a.i(67116),j=a.i(70709),k=a.i(60511),l=a.i(76597),m=a.i(40095);async function n({children:a}){let o=await (0,c.headers)();if((o.get("x-fleetlens-pathname")??"").startsWith("/print/")){let d=o.get("x-fleetlens-theme"),e=await (0,c.cookies)(),f=e.get("claude-lens-theme")?.value;return(0,b.jsx)("html",{lang:"en","data-theme":"light"===d||"dark"===d?d:"light"===f||"dark"===f?f:"dark",suppressHydrationWarning:!0,children:(0,b.jsx)("body",{children:a})})}let[p,q]=await Promise.all([(0,i.listSessions)(),(0,l.buildEntriesIndex)()]),r=p.slice(0,20),s=p.length,t=(0,h.groupByProject)(p).map(a=>({projectDir:a.projectDir,projectName:a.projectName,sessionCount:a.sessions.length,lastActiveMs:a.lastActiveMs,worktreeCount:a.worktreeCount})),u=(0,j.latestUsageSnapshot)(),v=(0,k.readTeamConnection)(),w=r.map(a=>({id:a.id,projectName:a.projectName,firstUserPreview:a.firstUserPreview,lastUserPreview:a.lastUserPreview,lastAgentPreview:a.lastAgentPreview,firstTimestamp:a.firstTimestamp,lastTimestamp:a.lastTimestamp,lastActivityMs:a.lastActivityMs,teamName:a.teamName,agentName:a.agentName,agent:a.agent})),x={};for(let a of r){let b=q.bySession.get(a.id)??[];if(0===b.length)continue;let c=b[b.length-1];x[a.id]={outcome:c.enrichment.outcome??null,enrichmentStatus:c.enrichment.status,localDay:c.local_day}}let y=await (0,c.cookies)(),z=y.get("claude-lens-theme")?.value;return(0,b.jsx)("html",{lang:"en","data-theme":"light"===z||"dark"===z?z:"dark",suppressHydrationWarning:!0,children:(0,b.jsxs)("body",{children:[(0,b.jsx)(e.LiveRefresher,{}),(0,b.jsxs)("div",{style:{display:"flex",height:"100vh"},children:[(0,b.jsx)(d.Sidebar,{projects:t,totalSessions:s,currentUsage:u,version:"0.13.1",latestChangelogVersion:m.LATEST_VERSION,teamConnection:v}),(0,b.jsx)("main",{style:{flex:1,minWidth:0,minHeight:0,padding:0,overflow:"auto"},children:a})]}),(0,b.jsx)(f.LiveSessionsWidget,{sessions:w,entrySummaries:x}),(0,b.jsx)(g.JobQueueWidget,{})]})})}a.s(["default",0,n,"dynamic",0,"force-dynamic","metadata",0,{title:"Fleetlens",description:"Multi-agent fleet analytics — local-only dashboard for Claude Code, Codex, and other coding-agent sessions."}],28992)},44665,a=>{a.n(a.i(28992))}];
1
+ module.exports=[63681,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={RequestCookies:function(){return f.RequestCookies},ResponseCookies:function(){return f.ResponseCookies},stringifyCookie:function(){return f.stringifyCookie}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(36226)},51409,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"ReflectAdapter",{enumerable:!0,get:function(){return d}});class d{static get(a,b,c){let d=Reflect.get(a,b,c);return"function"==typeof d?d.bind(a):d}static set(a,b,c,d){return Reflect.set(a,b,c,d)}static has(a,b){return Reflect.has(a,b)}static deleteProperty(a,b){return Reflect.deleteProperty(a,b)}}},4712,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={ActionDidNotRevalidate:function(){return f},ActionDidRevalidateDynamicOnly:function(){return h},ActionDidRevalidateStaticAndDynamic:function(){return g}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=0,g=1,h=2},14896,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={MutableRequestCookiesAdapter:function(){return o},ReadonlyRequestCookiesError:function(){return j},RequestCookiesAdapter:function(){return k},appendMutableCookies:function(){return n},areCookiesMutableInCurrentPhase:function(){return q},createCookiesWithMutableAccessCheck:function(){return p},getModifiedCookieValues:function(){return m},responseCookiesToRequestCookies:function(){return s}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(63681),g=a.r(51409),h=a.r(56704),i=a.r(4712);class j extends Error{constructor(){super("Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#options")}static callable(){throw new j}}class k{static seal(a){return new Proxy(a,{get(a,b,c){switch(b){case"clear":case"delete":case"set":return j.callable;default:return g.ReflectAdapter.get(a,b,c)}}})}}let l=Symbol.for("next.mutated.cookies");function m(a){let b=a[l];return b&&Array.isArray(b)&&0!==b.length?b:[]}function n(a,b){let c=m(b);if(0===c.length)return!1;let d=new f.ResponseCookies(a),e=d.getAll();for(let a of c)d.set(a);for(let a of e)d.set(a);return!0}class o{static wrap(a,b){let c=new f.ResponseCookies(new Headers);for(let b of a.getAll())c.set(b);let d=[],e=new Set,j=()=>{let a=h.workAsyncStorage.getStore();if(a&&(a.pathWasRevalidated=i.ActionDidRevalidateStaticAndDynamic),d=c.getAll().filter(a=>e.has(a.name)),b){let a=[];for(let b of d){let c=new f.ResponseCookies(new Headers);c.set(b),a.push(c.toString())}b(a)}},k=new Proxy(c,{get(a,b,c){switch(b){case l:return d;case"delete":return function(...b){e.add("string"==typeof b[0]?b[0]:b[0].name);try{return a.delete(...b),k}finally{j()}};case"set":return function(...b){e.add("string"==typeof b[0]?b[0]:b[0].name);try{return a.set(...b),k}finally{j()}};default:return g.ReflectAdapter.get(a,b,c)}}});return k}}function p(a){let b=new Proxy(a.mutableCookies,{get(c,d,e){switch(d){case"delete":return function(...d){return r(a,"cookies().delete"),c.delete(...d),b};case"set":return function(...d){return r(a,"cookies().set"),c.set(...d),b};default:return g.ReflectAdapter.get(c,d,e)}}});return b}function q(a){return"action"===a.phase}function r(a,b){if(!q(a))throw new j}function s(a){let b=new f.RequestCookies(new Headers);for(let c of a.getAll())b.set(c);return b}},8018,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"createDedupedByCallsiteServerErrorLoggerDev",{enumerable:!0,get:function(){return i}});let d=function(a){if(a&&a.__esModule)return a;if(null===a||"object"!=typeof a&&"function"!=typeof a)return{default:a};var b=e(void 0);if(b&&b.has(a))return b.get(a);var c={__proto__:null},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in a)if("default"!==f&&Object.prototype.hasOwnProperty.call(a,f)){var g=d?Object.getOwnPropertyDescriptor(a,f):null;g&&(g.get||g.set)?Object.defineProperty(c,f,g):c[f]=a[f]}return c.default=a,b&&b.set(a,c),c}(a.r(717));function e(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(e=function(a){return a?c:b})(a)}let f={current:null},g="function"==typeof d.cache?d.cache:a=>a,h=console.warn;function i(a){return function(...b){h(a(...b))}}g(a=>{try{h(f.current)}finally{f.current=null}})},86309,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={isRequestAPICallableInsideAfter:function(){return j},throwForSearchParamsAccessInUseCache:function(){return i},throwWithStaticGenerationBailoutErrorWithDynamicError:function(){return h}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(60312),g=a.r(24725);function h(a,b){throw Object.defineProperty(new f.StaticGenBailoutError(`Route ${a} with \`dynamic = "error"\` couldn't be rendered statically because it used ${b}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E543",enumerable:!1,configurable:!0})}function i(a,b){let c=Object.defineProperty(Error(`Route ${a.route} used \`searchParams\` inside "use cache". Accessing dynamic request data inside a cache scope is not supported. If you need some search params inside a cached function await \`searchParams\` outside of the cached function and pass only the required search params as arguments to the cached function. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E842",enumerable:!1,configurable:!0});throw Error.captureStackTrace(c,b),a.invalidDynamicUsageError??=c,c}function j(){let a=g.afterTaskAsyncStorage.getStore();return(null==a?void 0:a.rootTaskSpawnPhase)==="action"}},81740,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"cookies",{enumerable:!0,get:function(){return n}});let d=a.r(14896),e=a.r(63681),f=a.r(56704),g=a.r(32319),h=a.r(60384),i=a.r(60312),j=a.r(13091),k=a.r(8018),l=a.r(86309),m=a.r(50640);function n(){let a="cookies",b=f.workAsyncStorage.getStore(),c=g.workUnitAsyncStorage.getStore();if(b){if(c&&"after"===c.phase&&!(0,l.isRequestAPICallableInsideAfter)())throw Object.defineProperty(Error(`Route ${b.route} used \`cookies()\` inside \`after()\`. This is not supported. If you need this data inside an \`after()\` callback, use \`cookies()\` outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E843",enumerable:!1,configurable:!0});if(b.forceStatic)return p(d.RequestCookiesAdapter.seal(new e.RequestCookies(new Headers({}))));if(b.dynamicShouldError)throw Object.defineProperty(new i.StaticGenBailoutError(`Route ${b.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`cookies()\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E849",enumerable:!1,configurable:!0});if(c)switch(c.type){case"cache":let f=Object.defineProperty(Error(`Route ${b.route} used \`cookies()\` inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`cookies()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E831",enumerable:!1,configurable:!0});throw Error.captureStackTrace(f,n),b.invalidDynamicUsageError??=f,f;case"unstable-cache":throw Object.defineProperty(Error(`Route ${b.route} used \`cookies()\` inside a function cached with \`unstable_cache()\`. Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`cookies()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E846",enumerable:!1,configurable:!0});case"generate-static-params":throw Object.defineProperty(Error(`Route ${b.route} used \`cookies()\` inside \`generateStaticParams\`. This is not supported because \`generateStaticParams\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`),"__NEXT_ERROR_CODE",{value:"E1123",enumerable:!1,configurable:!0});case"prerender":var k=b,q=c;let r=o.get(q);if(r)return r;let s=(0,j.makeHangingPromise)(q.renderSignal,k.route,"`cookies()`");return o.set(q,s),s;case"prerender-client":case"validation-client":let t="`cookies`";throw Object.defineProperty(new m.InvariantError(`${t} must not be used within a Client Component. Next.js should be preventing ${t} from being included in Client Components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E1037",enumerable:!1,configurable:!0});case"prerender-ppr":return(0,h.postponeWithTracking)(b.route,a,c.dynamicTracking);case"prerender-legacy":return(0,h.throwToInterruptStaticGeneration)(a,b,c);case"prerender-runtime":return(0,j.delayUntilRuntimeStage)(c,p(c.cookies));case"private-cache":return p(c.cookies);case"request":let u;if((0,h.trackDynamicDataInDynamicRender)(c),u=(0,d.areCookiesMutableInCurrentPhase)(c)?c.userspaceMutableCookies:c.cookies,!c.asyncApiPromises)return p(u);{let a=(0,g.isInEarlyRenderStage)(c);if(u===c.mutableCookies)return a?c.asyncApiPromises.earlyMutableCookies:c.asyncApiPromises.mutableCookies;return a?c.asyncApiPromises.earlyCookies:c.asyncApiPromises.cookies}}}(0,g.throwForMissingRequestStore)(a)}a.r(31382);let o=new WeakMap;function p(a){let b=o.get(a);if(b)return b;let c=Promise.resolve(a);return o.set(a,c),c}(0,k.createDedupedByCallsiteServerErrorLoggerDev)(function(a,b){let c=a?`Route "${a}" `:"This route ";return Object.defineProperty(Error(`${c}used ${b}. \`cookies()\` returns a Promise and must be unwrapped with \`await\` or \`React.use()\` before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`),"__NEXT_ERROR_CODE",{value:"E830",enumerable:!1,configurable:!0})})},29927,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={HeadersAdapter:function(){return h},ReadonlyHeadersError:function(){return g}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(51409);class g extends Error{constructor(){super("Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers")}static callable(){throw new g}}class h extends Headers{constructor(a){super(),this.headers=new Proxy(a,{get(b,c,d){if("symbol"==typeof c)return f.ReflectAdapter.get(b,c,d);let e=c.toLowerCase(),g=Object.keys(a).find(a=>a.toLowerCase()===e);if(void 0!==g)return f.ReflectAdapter.get(b,g,d)},set(b,c,d,e){if("symbol"==typeof c)return f.ReflectAdapter.set(b,c,d,e);let g=c.toLowerCase(),h=Object.keys(a).find(a=>a.toLowerCase()===g);return f.ReflectAdapter.set(b,h??c,d,e)},has(b,c){if("symbol"==typeof c)return f.ReflectAdapter.has(b,c);let d=c.toLowerCase(),e=Object.keys(a).find(a=>a.toLowerCase()===d);return void 0!==e&&f.ReflectAdapter.has(b,e)},deleteProperty(b,c){if("symbol"==typeof c)return f.ReflectAdapter.deleteProperty(b,c);let d=c.toLowerCase(),e=Object.keys(a).find(a=>a.toLowerCase()===d);return void 0===e||f.ReflectAdapter.deleteProperty(b,e)}})}static seal(a){return new Proxy(a,{get(a,b,c){switch(b){case"append":case"delete":case"set":return g.callable;default:return f.ReflectAdapter.get(a,b,c)}}})}merge(a){return Array.isArray(a)?a.join(", "):a}static from(a){return a instanceof Headers?a:new h(a)}append(a,b){let c=this.headers[a];"string"==typeof c?this.headers[a]=[c,b]:Array.isArray(c)?c.push(b):this.headers[a]=b}delete(a){delete this.headers[a]}get(a){let b=this.headers[a];return void 0!==b?this.merge(b):null}has(a){return void 0!==this.headers[a]}set(a,b){this.headers[a]=b}forEach(a,b){for(let[c,d]of this.entries())a.call(b,d,c,this)}*entries(){for(let a of Object.keys(this.headers)){let b=a.toLowerCase(),c=this.get(b);yield[b,c]}}*keys(){for(let a of Object.keys(this.headers)){let b=a.toLowerCase();yield b}}*values(){for(let a of Object.keys(this.headers)){let b=this.get(a);yield b}}[Symbol.iterator](){return this.entries()}}},35754,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"headers",{enumerable:!0,get:function(){return m}});let d=a.r(29927),e=a.r(56704),f=a.r(32319),g=a.r(60384),h=a.r(60312),i=a.r(13091),j=a.r(8018),k=a.r(86309),l=a.r(50640);function m(){let a="headers",b=e.workAsyncStorage.getStore(),c=f.workUnitAsyncStorage.getStore();if(b){if(c&&"after"===c.phase&&!(0,k.isRequestAPICallableInsideAfter)())throw Object.defineProperty(Error(`Route ${b.route} used \`headers()\` inside \`after()\`. This is not supported. If you need this data inside an \`after()\` callback, use \`headers()\` outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E839",enumerable:!1,configurable:!0});if(b.forceStatic)return o(d.HeadersAdapter.seal(new Headers({})));if(c)switch(c.type){case"cache":{let a=Object.defineProperty(Error(`Route ${b.route} used \`headers()\` inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`headers()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E833",enumerable:!1,configurable:!0});throw Error.captureStackTrace(a,m),b.invalidDynamicUsageError??=a,a}case"unstable-cache":throw Object.defineProperty(Error(`Route ${b.route} used \`headers()\` inside a function cached with \`unstable_cache()\`. Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \`headers()\` outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E838",enumerable:!1,configurable:!0});case"generate-static-params":throw Object.defineProperty(Error(`Route ${b.route} used \`headers()\` inside \`generateStaticParams\`. This is not supported because \`generateStaticParams\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`),"__NEXT_ERROR_CODE",{value:"E1134",enumerable:!1,configurable:!0})}if(b.dynamicShouldError)throw Object.defineProperty(new h.StaticGenBailoutError(`Route ${b.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`headers()\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E828",enumerable:!1,configurable:!0});if(c)switch(c.type){case"prerender":var j=b,p=c;let e=n.get(p);if(e)return e;let q=(0,i.makeHangingPromise)(p.renderSignal,j.route,"`headers()`");return n.set(p,q),q;case"prerender-client":case"validation-client":let r="`headers`";throw Object.defineProperty(new l.InvariantError(`${r} must not be used within a client component. Next.js should be preventing ${r} from being included in client components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E1017",enumerable:!1,configurable:!0});case"prerender-ppr":return(0,g.postponeWithTracking)(b.route,a,c.dynamicTracking);case"prerender-legacy":return(0,g.throwToInterruptStaticGeneration)(a,b,c);case"prerender-runtime":return(0,i.delayUntilRuntimeStage)(c,o(c.headers));case"private-cache":return o(c.headers);case"request":if((0,g.trackDynamicDataInDynamicRender)(c),c.asyncApiPromises)return(0,f.isInEarlyRenderStage)(c)?c.asyncApiPromises.earlyHeaders:c.asyncApiPromises.headers;return o(c.headers)}}(0,f.throwForMissingRequestStore)(a)}a.r(31382);let n=new WeakMap;function o(a){let b=n.get(a);if(b)return b;let c=Promise.resolve(a);return n.set(a,c),c}(0,j.createDedupedByCallsiteServerErrorLoggerDev)(function(a,b){let c=a?`Route "${a}" `:"This route ";return Object.defineProperty(Error(`${c}used ${b}. \`headers()\` returns a Promise and must be unwrapped with \`await\` or \`React.use()\` before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`),"__NEXT_ERROR_CODE",{value:"E836",enumerable:!1,configurable:!0})})},51125,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"draftMode",{enumerable:!0,get:function(){return l}});let d=a.r(32319),e=a.r(56704),f=a.r(60384),g=a.r(8018),h=a.r(60312),i=a.r(96556),j=a.r(50640),k=a.r(13091);function l(){let a="draftMode",b=e.workAsyncStorage.getStore(),c=d.workUnitAsyncStorage.getStore();switch((!b||!c)&&(0,d.throwForMissingRequestStore)(a),c.type){case"prerender-runtime":return(0,k.delayUntilRuntimeStage)(c,m(c.draftMode,b));case"request":return m(c.draftMode,b);case"cache":case"private-cache":case"unstable-cache":let f=(0,d.getDraftModeProviderForCacheScope)(b,c);if(f)return m(f,b);case"prerender":case"prerender-ppr":case"prerender-legacy":return m(null,b);case"prerender-client":case"validation-client":{let a="`draftMode`";throw Object.defineProperty(new j.InvariantError(`${a} must not be used within a Client Component. Next.js should be preventing ${a} from being included in Client Components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E1046",enumerable:!1,configurable:!0})}case"generate-static-params":throw Object.defineProperty(Error(`Route ${b.route} used \`${a}()\` inside \`generateStaticParams\`. This is not supported because \`generateStaticParams\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`),"__NEXT_ERROR_CODE",{value:"E1132",enumerable:!1,configurable:!0});default:return c}}function m(a,b){let c=o.get(a??n);return c||Promise.resolve(new p(a))}a.r(51409);let n={},o=new WeakMap;class p{constructor(a){this._provider=a}get isEnabled(){return null!==this._provider&&this._provider.isEnabled}enable(){q("draftMode().enable()",this.enable),null!==this._provider&&this._provider.enable()}disable(){q("draftMode().disable()",this.disable),null!==this._provider&&this._provider.disable()}}function q(a,b){let c=e.workAsyncStorage.getStore(),g=d.workUnitAsyncStorage.getStore();if(c){if((null==g?void 0:g.phase)==="after")throw Object.defineProperty(Error(`Route ${c.route} used "${a}" inside \`after()\`. The enabled status of \`draftMode()\` can be read inside \`after()\` but you cannot enable or disable \`draftMode()\`. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E845",enumerable:!1,configurable:!0});if(c.dynamicShouldError)throw Object.defineProperty(new h.StaticGenBailoutError(`Route ${c.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${a}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E553",enumerable:!1,configurable:!0});if(g)switch(g.type){case"cache":case"private-cache":{let d=Object.defineProperty(Error(`Route ${c.route} used "${a}" inside "use cache". The enabled status of \`draftMode()\` can be read in caches but you must not enable or disable \`draftMode()\` inside a cache. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E829",enumerable:!1,configurable:!0});throw Error.captureStackTrace(d,b),c.invalidDynamicUsageError??=d,d}case"unstable-cache":throw Object.defineProperty(Error(`Route ${c.route} used "${a}" inside a function cached with \`unstable_cache()\`. The enabled status of \`draftMode()\` can be read in caches but you must not enable or disable \`draftMode()\` inside a cache. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E844",enumerable:!1,configurable:!0});case"prerender":case"prerender-runtime":{let b=Object.defineProperty(Error(`Route ${c.route} used ${a} without first calling \`await connection()\`. See more info here: https://nextjs.org/docs/messages/next-prerender-sync-headers`),"__NEXT_ERROR_CODE",{value:"E126",enumerable:!1,configurable:!0});return(0,f.abortAndThrowOnSynchronousRequestDataAccess)(c.route,a,b,g)}case"prerender-client":case"validation-client":let d="`draftMode`";throw Object.defineProperty(new j.InvariantError(`${d} must not be used within a Client Component. Next.js should be preventing ${d} from being included in Client Components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E1046",enumerable:!1,configurable:!0});case"prerender-ppr":return(0,f.postponeWithTracking)(c.route,a,g.dynamicTracking);case"prerender-legacy":g.revalidate=0;let e=Object.defineProperty(new i.DynamicServerError(`Route ${c.route} couldn't be rendered statically because it used \`${a}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`),"__NEXT_ERROR_CODE",{value:"E558",enumerable:!1,configurable:!0});throw c.dynamicUsageDescription=a,c.dynamicUsageStack=e.stack,e;case"request":(0,f.trackDynamicDataInDynamicRender)(g);break;case"generate-static-params":throw Object.defineProperty(Error(`Route ${c.route} used \`${a}\` inside \`generateStaticParams\`. This is not supported because \`generateStaticParams\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`),"__NEXT_ERROR_CODE",{value:"E1121",enumerable:!1,configurable:!0})}}}(0,g.createDedupedByCallsiteServerErrorLoggerDev)(function(a,b){let c=a?`Route "${a}" `:"This route ";return Object.defineProperty(Error(`${c}used ${b}. \`draftMode()\` returns a Promise and must be unwrapped with \`await\` or \`React.use()\` before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`),"__NEXT_ERROR_CODE",{value:"E835",enumerable:!1,configurable:!0})})},5246,(a,b,c)=>{b.exports.cookies=a.r(81740).cookies,b.exports.headers=a.r(35754).headers,b.exports.draftMode=a.r(51125).draftMode},45017,a=>{"use strict";a.s(["Sidebar",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call Sidebar() from the server but Sidebar is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/apps/web/components/sidebar.tsx <module evaluation>","Sidebar")},10398,a=>{"use strict";a.s(["Sidebar",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call Sidebar() from the server but Sidebar is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/apps/web/components/sidebar.tsx","Sidebar")},23604,a=>{"use strict";a.i(45017);var b=a.i(10398);a.n(b)},59969,a=>{"use strict";a.s(["LiveRefresher",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call LiveRefresher() from the server but LiveRefresher is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/apps/web/components/live-refresher.tsx <module evaluation>","LiveRefresher")},11272,a=>{"use strict";a.s(["LiveRefresher",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call LiveRefresher() from the server but LiveRefresher is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/apps/web/components/live-refresher.tsx","LiveRefresher")},30642,a=>{"use strict";a.i(59969);var b=a.i(11272);a.n(b)},99153,a=>{"use strict";a.s(["LiveSessionsWidget",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call LiveSessionsWidget() from the server but LiveSessionsWidget is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/apps/web/components/live-sessions-widget.tsx <module evaluation>","LiveSessionsWidget")},62615,a=>{"use strict";a.s(["LiveSessionsWidget",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call LiveSessionsWidget() from the server but LiveSessionsWidget is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/apps/web/components/live-sessions-widget.tsx","LiveSessionsWidget")},9647,a=>{"use strict";a.i(99153);var b=a.i(62615);a.n(b)},14022,a=>{"use strict";a.s(["JobQueueWidget",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call JobQueueWidget() from the server but JobQueueWidget is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/apps/web/components/job-queue-widget.tsx <module evaluation>","JobQueueWidget")},5900,a=>{"use strict";a.s(["JobQueueWidget",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call JobQueueWidget() from the server but JobQueueWidget is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/apps/web/components/job-queue-widget.tsx","JobQueueWidget")},84829,a=>{"use strict";a.i(14022);var b=a.i(5900);a.n(b)},28992,a=>{"use strict";var b=a.i(7997),c=a.i(5246),d=a.i(23604),e=a.i(30642),f=a.i(9647),g=a.i(84829);a.i(9117);var h=a.i(48024),i=a.i(67116),j=a.i(70709),k=a.i(60511),l=a.i(76597),m=a.i(40095);async function n({children:a}){let o=await (0,c.headers)();if((o.get("x-fleetlens-pathname")??"").startsWith("/print/")){let d=o.get("x-fleetlens-theme"),e=await (0,c.cookies)(),f=e.get("claude-lens-theme")?.value;return(0,b.jsx)("html",{lang:"en","data-theme":"light"===d||"dark"===d?d:"light"===f||"dark"===f?f:"dark",suppressHydrationWarning:!0,children:(0,b.jsx)("body",{children:a})})}let[p,q]=await Promise.all([(0,i.listSessions)(),(0,l.buildEntriesIndex)()]),r=p.slice(0,20),s=p.length,t=(0,h.groupByProject)(p).map(a=>({projectDir:a.projectDir,projectName:a.projectName,sessionCount:a.sessions.length,lastActiveMs:a.lastActiveMs,worktreeCount:a.worktreeCount})),u=(0,j.latestUsageSnapshot)(),v=(0,k.readTeamConnection)(),w=r.map(a=>({id:a.id,projectName:a.projectName,firstUserPreview:a.firstUserPreview,lastUserPreview:a.lastUserPreview,lastAgentPreview:a.lastAgentPreview,firstTimestamp:a.firstTimestamp,lastTimestamp:a.lastTimestamp,lastActivityMs:a.lastActivityMs,teamName:a.teamName,agentName:a.agentName,agent:a.agent})),x={};for(let a of r){let b=q.bySession.get(a.id)??[];if(0===b.length)continue;let c=b[b.length-1];x[a.id]={outcome:c.enrichment.outcome??null,enrichmentStatus:c.enrichment.status,localDay:c.local_day}}let y=await (0,c.cookies)(),z=y.get("claude-lens-theme")?.value;return(0,b.jsx)("html",{lang:"en","data-theme":"light"===z||"dark"===z?z:"dark",suppressHydrationWarning:!0,children:(0,b.jsxs)("body",{children:[(0,b.jsx)(e.LiveRefresher,{}),(0,b.jsxs)("div",{style:{display:"flex",height:"100vh"},children:[(0,b.jsx)(d.Sidebar,{projects:t,totalSessions:s,currentUsage:u,version:"0.13.2",latestChangelogVersion:m.LATEST_VERSION,teamConnection:v}),(0,b.jsx)("main",{style:{flex:1,minWidth:0,minHeight:0,padding:0,overflow:"auto"},children:a})]}),(0,b.jsx)(f.LiveSessionsWidget,{sessions:w,entrySummaries:x}),(0,b.jsx)(g.JobQueueWidget,{})]})})}a.s(["default",0,n,"dynamic",0,"force-dynamic","metadata",0,{title:"Fleetlens",description:"Multi-agent fleet analytics — local-only dashboard for Claude Code, Codex, and other coding-agent sessions."}],28992)},44665,a=>{a.n(a.i(28992))}];
2
2
 
3
3
  //# sourceMappingURL=_0xu2pvc._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[94561,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(5784),e=a.i(50522);let f=(0,a.i(70106).default)("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);var g=a.i(44220),h=a.i(68381);let i={"spec-review-loop":"Spec-review loop","chunk-implementation":"Chunk implementation","research-then-build":"Research-then-build","reviewer-triad":"Reviewer triad","background-coordinated":"Background-coordinated","solo-continuation":"Solo continuation","solo-design":"Solo design","solo-build":"Solo build",mixed:"Mixed"},j={teammate:"<teammate-message>","task-notification":"<task-notification>","local-command-caveat":"<local-command-caveat>","image-attached":"[Image #N]","slash-command":"/command","handoff-prose":"Handoff prose"};function k({digest:a,entries:f,aiEnabled:i,actions:j}){let[p,q]=(0,c.useState)(!1),s=new Date(`${a.key}T12:00:00`).toLocaleDateString("en-US",{weekday:"long",month:"short",day:"numeric",year:"numeric"}),t=a.agent_min/60,u=t>=1?`${t.toFixed(1)}h`:`${Math.round(a.agent_min)}m`,v=[...f].sort((a,b)=>Date.parse(b.start_iso)-Date.parse(a.start_iso));return(0,b.jsxs)("div",{style:{maxWidth:980,margin:"0 auto",padding:"24px 40px"},children:[(0,b.jsxs)("header",{style:{marginBottom:28},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:8,fontSize:12,color:"var(--af-text-tertiary)",fontWeight:500,flexWrap:"wrap"},children:[(0,b.jsx)("span",{children:s}),(0,b.jsx)(g.OutcomePill,{outcome:a.outcome_day,size:"lg"}),(0,b.jsx)("span",{style:{color:"var(--af-text-tertiary)"},children:"·"}),(0,b.jsxs)("span",{style:{fontFamily:"var(--font-mono)",color:"var(--af-text-secondary)"},children:[u," agent time · ",a.projects.length," project",1===a.projects.length?"":"s"," · ",a.shipped.length," PR",1===a.shipped.length?"":"s"," shipped",a.concurrency_peak>1&&` \xb7 peak concurrency \xd7${a.concurrency_peak}`]}),j&&(0,b.jsx)("div",{style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",gap:8},children:j})]}),a.headline?(0,b.jsx)("h1",{style:{fontSize:26,fontWeight:700,lineHeight:1.3,letterSpacing:"-0.02em",margin:"0 0 8px",maxWidth:820,color:"var(--af-text)"},children:a.headline}):(0,b.jsx)("h1",{style:{fontSize:20,color:"var(--af-text-secondary)",margin:"0 0 14px"},children:i?"No narrative yet — click Regenerate.":`Worked ${u} across ${a.projects.length} project${1===a.projects.length?"":"s"}.`}),a.day_signature&&(0,b.jsx)("p",{style:{margin:"0 0 14px",fontSize:14,fontStyle:"italic",color:"var(--af-text-secondary)",maxWidth:820,lineHeight:1.5},children:a.day_signature})]}),!i&&(0,b.jsxs)("div",{style:{padding:14,marginBottom:24,background:"var(--af-accent-subtle)",borderRadius:8,fontSize:13,color:"var(--af-text)"},children:["Enable AI features in ",(0,b.jsx)("a",{href:"/settings",style:{color:"var(--af-accent)"},children:"Settings"})," to see daily narratives."]}),a.day_signals&&(0,b.jsx)(o,{signals:a.day_signals}),(a.what_went_well||a.what_hit_friction)&&(0,b.jsxs)("section",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:24,marginBottom:28},children:[(0,b.jsx)(m,{glyph:"✓",color:"#48bb78",text:a.what_went_well,emptyLabel:"(smooth)"}),(0,b.jsx)(m,{glyph:"⚠",color:"#ed8936",text:a.what_hit_friction,emptyLabel:"(no friction)"})]}),a.narrative&&(0,b.jsx)("section",{style:{marginBottom:28,padding:"4px 0",fontSize:15,lineHeight:1.6,color:"var(--af-text)",maxWidth:760},children:a.narrative}),(0,b.jsx)("div",{style:{marginBottom:18},children:(0,b.jsxs)("button",{type:"button",onClick:()=>q(a=>!a),style:{display:"inline-flex",alignItems:"center",gap:6,padding:"5px 10px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:11,color:"var(--af-text-secondary)",cursor:"pointer"},children:[p?(0,b.jsx)(d.ChevronDown,{size:12}):(0,b.jsx)(e.ChevronRight,{size:12}),p?"Hide details":"Show more details"]})}),p&&(0,b.jsxs)(b.Fragment,{children:[a.suggestion&&(0,b.jsxs)("section",{style:{borderLeft:"3px solid var(--af-accent)",paddingLeft:16,marginBottom:32},children:[(0,b.jsx)("div",{style:{fontSize:11,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.06em",fontWeight:600,marginBottom:6},children:"Tomorrow"}),(0,b.jsx)("div",{style:{fontSize:15,fontWeight:600,marginBottom:4,color:"var(--af-text)"},children:a.suggestion.headline}),(0,b.jsx)("div",{style:{fontSize:13,color:"var(--af-text-secondary)",lineHeight:1.5,maxWidth:760},children:a.suggestion.body})]}),a.projects.length>0&&(0,b.jsxs)("section",{style:{marginBottom:32},children:[(0,b.jsx)(l,{children:"Work breakdown"}),(0,b.jsx)("div",{style:{display:"grid",gap:6},children:a.projects.map(c=>{let d=a.shipped.filter(a=>a.project===c.display_name);return(0,b.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"140px 1fr 56px 72px",gap:12,alignItems:"center",padding:"6px 0",borderBottom:"1px solid var(--af-border-subtle)",fontSize:13},children:[(0,b.jsx)("span",{title:c.name,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c.display_name}),(0,b.jsx)(n,{pct:c.share_pct}),(0,b.jsxs)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,color:"var(--af-text-tertiary)",textAlign:"right"},children:[c.share_pct.toFixed(0),"%"]}),(0,b.jsx)("span",{style:{fontSize:11,color:"var(--af-text-tertiary)",textAlign:"right"},children:d.length>0?`${d.length} PR${1===d.length?"":"s"}`:"—"})]},c.name)})})]}),a.shipped.length>0&&(0,b.jsxs)("section",{style:{marginBottom:32},children:[(0,b.jsx)(l,{children:"Shipped"}),(0,b.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none"},children:a.shipped.map((a,c)=>(0,b.jsxs)("li",{style:{padding:"6px 0",fontSize:13,borderBottom:"1px solid var(--af-border-subtle)",display:"flex",gap:10,alignItems:"baseline"},children:[(0,b.jsx)("span",{style:{color:"#48bb78",fontSize:12},children:"✓"}),(0,b.jsx)("span",{style:{flex:1},children:a.title}),(0,b.jsx)("span",{style:{fontSize:11,color:"var(--af-text-tertiary)"},children:a.project})]},c))})]}),v.length>0&&(0,b.jsxs)("section",{style:{marginBottom:32},children:[(0,b.jsxs)(l,{children:["Sessions · ",v.length]}),(0,b.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:v.map(a=>(0,b.jsx)(r,{entry:a},a.session_id))})]}),a.top_goal_categories.length>0&&(0,b.jsxs)("section",{style:{marginTop:40,paddingTop:20,borderTop:"1px solid var(--af-border-subtle)"},children:[(0,b.jsx)("div",{style:{fontSize:11,color:"var(--af-text-tertiary)",marginBottom:6},children:"Goal mix"}),(0,b.jsx)(h.GoalBar,{goals:a.top_goal_categories,total:a.agent_min})]})]})]})}function l({children:a}){return(0,b.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:600,marginBottom:10},children:a})}function m({glyph:a,color:c,text:d,emptyLabel:e}){return(0,b.jsxs)("div",{style:{fontSize:14,lineHeight:1.55,display:"flex",gap:8,alignItems:"flex-start"},children:[(0,b.jsx)("span",{style:{fontSize:16,color:c,lineHeight:1.4,flexShrink:0},children:a}),d?(0,b.jsx)("span",{style:{color:"var(--af-text)"},children:d}):(0,b.jsx)("span",{style:{color:"var(--af-text-tertiary)",fontStyle:"italic"},children:e})]})}function n({pct:a}){return(0,b.jsx)("div",{style:{height:6,background:"var(--af-border-subtle)",borderRadius:99,overflow:"hidden"},children:(0,b.jsx)("div",{style:{width:`${Math.min(100,Math.max(0,a))}%`,height:"100%",background:"var(--af-accent)",transition:"width 0.2s"}})})}function o({signals:a}){let c=null!==a.dominant_shape,d=Object.keys(a.shape_distribution).length>0,e=a.user_authored_subagents_used.length>0||Object.keys(a.shape_distribution).length>0,f=a.skills_loaded.filter(a=>"stock"===a.origin),g=a.skills_loaded.filter(a=>"user"===a.origin),h=a.prompt_frames.filter(a=>"claude-feature"===a.origin),k=a.prompt_frames.filter(a=>"personal-habit"===a.origin),l=a.comm_style,m=l.verbosity_distribution.short+l.verbosity_distribution.medium+l.verbosity_distribution.long+l.verbosity_distribution.very_long,n=l.steering.interrupts+l.steering.frustrated+l.steering.dissatisfied;return c||d||0!==f.length||0!==g.length||0!==a.user_authored_subagents_used.length||0!==h.length||0!==k.length||0!==m||0!==l.external_refs.length||0!==n||0!==a.brainstorm_warmup_session_count||0!==a.todo_ops_total||a.plan_mode_used?(0,b.jsxs)("section",{style:{marginBottom:28,padding:"14px 16px",borderRadius:8,background:"var(--af-surface)",border:"1px solid var(--af-border-subtle)"},children:[(0,b.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:600,marginBottom:10},children:"How today worked"}),c&&(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap",marginBottom:8},children:[(0,b.jsx)("span",{style:{display:"inline-flex",alignItems:"center",padding:"3px 10px",borderRadius:999,fontSize:12,fontWeight:600,background:"var(--af-accent-subtle)",color:"var(--af-accent)"},children:i[a.dominant_shape]??a.dominant_shape}),d&&(0,b.jsx)("span",{style:{fontSize:12,color:"var(--af-text-secondary)",fontFamily:"var(--font-mono)"},children:Object.entries(a.shape_distribution).sort((a,b)=>b[1]-a[1]).map(([a,b])=>`${b} ${a}`).join(" · ")})]}),e&&a.user_authored_subagents_used.length>0&&(0,b.jsx)(p,{label:"Your subagents",children:a.user_authored_subagents_used.slice(0,4).map(a=>(0,b.jsxs)(q,{title:a.sample_prompt_preview,children:[a.type,a.count>1?` \xd7${a.count}`:""]},a.type))}),(f.length>0||g.length>0)&&(0,b.jsxs)(p,{label:"Skills loaded",children:[g.slice(0,4).map(a=>(0,b.jsxs)(q,{tone:"user",children:[a.skill,a.count>1?` \xd7${a.count}`:""]},a.skill)),f.slice(0,4).map(a=>(0,b.jsxs)(q,{tone:"stock",children:[a.skill,a.count>1?` \xd7${a.count}`:""]},a.skill))]}),(h.length>0||k.length>0)&&(0,b.jsxs)(p,{label:"Prompt frames",children:[k.map(a=>(0,b.jsxs)(q,{tone:"user",children:[j[a.frame]??a.frame,a.count>1?` \xd7${a.count}`:""]},a.frame)),h.map(a=>(0,b.jsxs)(q,{tone:"stock",children:[j[a.frame]??a.frame,a.count>1?` \xd7${a.count}`:""]},a.frame))]}),(m>0||l.external_refs.length>0||n>0)&&(0,b.jsxs)(p,{label:"Comm style",children:[m>0&&(0,b.jsx)("span",{style:{fontSize:12,color:"var(--af-text-secondary)",fontFamily:"var(--font-mono)"},children:[l.verbosity_distribution.short&&`${l.verbosity_distribution.short} short`,l.verbosity_distribution.medium&&`${l.verbosity_distribution.medium} med`,l.verbosity_distribution.long&&`${l.verbosity_distribution.long} long`,l.verbosity_distribution.very_long&&`${l.verbosity_distribution.very_long} v.long`].filter(Boolean).join(" · ")}),l.external_refs.length>0&&(0,b.jsxs)(q,{children:[l.external_refs.length," external ref",1===l.external_refs.length?"":"s"]}),l.steering.interrupts>0&&(0,b.jsxs)(q,{children:[l.steering.interrupts," interrupts"]}),l.steering.sessions_with_mid_run_redirect>0&&(0,b.jsxs)(q,{children:[l.steering.sessions_with_mid_run_redirect," mid-run redirect",1===l.steering.sessions_with_mid_run_redirect?"":"s"]})]}),(a.brainstorm_warmup_session_count>0||a.todo_ops_total>0||a.plan_mode_used)&&(0,b.jsxs)(p,{label:"Discipline",children:[a.brainstorm_warmup_session_count>0&&(0,b.jsxs)(q,{children:["brainstorm warmup ×",a.brainstorm_warmup_session_count]}),a.todo_ops_total>0&&(0,b.jsxs)(q,{children:[a.todo_ops_total," TodoWrite ops"]}),a.plan_mode_used&&(0,b.jsx)(q,{tone:"user",children:"Plan Mode used"})]})]}):null}function p({label:a,children:c}){return(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap",padding:"4px 0",fontSize:12},children:[(0,b.jsx)("span",{style:{minWidth:100,color:"var(--af-text-tertiary)",fontWeight:500,fontSize:11,textTransform:"uppercase",letterSpacing:"0.04em"},children:a}),(0,b.jsx)("div",{style:{display:"flex",gap:6,flexWrap:"wrap",flex:1},children:c})]})}function q({children:a,tone:c,title:d}){return(0,b.jsx)("span",{title:d,style:{display:"inline-flex",alignItems:"center",padding:"2px 8px",borderRadius:999,fontSize:11,fontFamily:"var(--font-mono)",background:"user"===c?"var(--af-accent-subtle)":"var(--af-border-subtle)",color:"user"===c?"var(--af-accent)":"var(--af-text-secondary)",whiteSpace:"nowrap",maxWidth:280,overflow:"hidden",textOverflow:"ellipsis"},children:a})}function r({entry:a}){let c=new Date(a.start_iso).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1}),d=Math.round(a.numbers.active_min),e=a.project.split("/").filter(Boolean).slice(-1)[0]??a.project,f=a.enrichment.outcome,h=a.enrichment.brief_summary;return(0,b.jsxs)("a",{href:`/sessions/${a.session_id}`,style:{display:"block",padding:"8px 0",borderBottom:"1px solid var(--af-border-subtle)",fontSize:13,color:"var(--af-text)",textDecoration:"none"},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10},children:[(0,b.jsx)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,color:"var(--af-text-tertiary)",width:48},children:c}),(0,b.jsx)("span",{style:{fontSize:11,color:"var(--af-text-tertiary)",minWidth:110,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),(0,b.jsxs)("span",{style:{fontSize:11,fontFamily:"var(--font-mono)",color:"var(--af-text-tertiary)",width:40,textAlign:"right"},children:[d,"m"]}),f&&(0,b.jsx)(g.OutcomePill,{outcome:f,size:"sm",label:"text",agent:a.agent})]}),h&&(0,b.jsx)("div",{style:{marginTop:3,marginLeft:58,fontSize:13,color:"var(--af-text-secondary)",lineHeight:1.45,maxWidth:820},children:h})]})}function s({initial:a,entries:d,date:e,aiEnabled:f}){let[g,h]=(0,c.useState)(a),[i,j]=(0,c.useState)("idle"),[l,m]=(0,c.useState)(""),n=(0,c.useCallback)(async(a=!1)=>{j("streaming"),m("Starting...");let b=`/api/digest/day/${e}${a?"?force=1":""}`,c=await fetch(b,{method:"POST"});if(!c.ok||!c.body){j("error"),m(`Error ${c.status}`);return}let d=c.body.getReader(),f=new TextDecoder,g="";for(;;){let{done:a,value:b}=await d.read();if(a)break;let c=(g+=f.decode(b,{stream:!0})).split("\n\n");for(let a of(g=c.pop()??"",c)){let b=a.split("\n").find(a=>a.startsWith("data: "));if(b)try{let a=JSON.parse(b.slice(6));if("status"===a.type)m(a.text);else if("entry"===a.type)m(`Enriching ${a.index}/${a.total}${a.cost_usd?` \xb7 $${a.cost_usd.toFixed(4)}`:""}...`);else if("progress"===a.type){let b=Math.round(a.elapsed_ms/1e3),c=(a.bytes/1024).toFixed(1);m(`Claude composing… ${a.bytes.toLocaleString()} chars (${c} KB \xb7 ${b}s)`)}else if("digest"===a.type)h(a.digest),m("Rendering...");else if("saved"===a.type)m("Saved.");else if("error"===a.type){j("error"),m(a.message);return}}catch{}}}j("done"),m("")},[e]),o="streaming"===i,p=!!g?.headline,q=(0,c.useMemo)(()=>0!==d.length&&d.every(a=>"skipped_trivial"===a.enrichment.status),[d]),r=0===d.length,t=null;return(r||q||(t=r||q||p?(0,b.jsxs)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)",display:"inline-flex",alignItems:"center",gap:6},children:["✓ Up to date",(0,b.jsx)("button",{onClick:()=>n(!0),disabled:o,title:"Re-roll the narrative without re-enriching capsules",style:{padding:"2px 7px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:4,fontSize:10,color:"var(--af-text-secondary)",cursor:o?"default":"pointer",opacity:o?.6:1},children:o?"...":"Re-roll"})]}):(0,b.jsx)("button",{onClick:()=>n(!1),disabled:o,style:{padding:"4px 10px",background:"var(--af-accent)",color:"white",border:"none",borderRadius:5,cursor:o?"default":"pointer",fontSize:11,fontWeight:600,opacity:o?.6:1},children:o?"Generating...":g?"Generate (catch up)":"Generate digest"}),l&&(t=(0,b.jsxs)(b.Fragment,{children:[t,(0,b.jsx)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)"},children:l})]}))),g)?(0,b.jsx)(k,{digest:g,entries:d,aiEnabled:f,actions:t}):(0,b.jsxs)(b.Fragment,{children:[t&&(0,b.jsx)("div",{style:{display:"flex",gap:10,padding:"14px 40px 0",alignItems:"center",flexWrap:"wrap"},children:t}),r?(0,b.jsx)("div",{style:{padding:28,textAlign:"center",color:"var(--af-text-tertiary)",fontSize:13},children:"No entries on this day."}):q?(0,b.jsx)("div",{style:{padding:28,textAlign:"center",color:"var(--af-text-tertiary)",fontSize:13},children:"💤 Warm-up only — every session was under a minute. No narrative needed."}):(0,b.jsx)("div",{style:{padding:28,textAlign:"center",color:"var(--af-text-secondary)",fontSize:13},children:"No digest generated yet — click Generate above."})]})}var t=a.i(38246);a.i(99417);var u=a.i(12544),v=a.i(3444),w=a.i(2405);let x=["rgba(45, 212, 191, 0.75)","rgba(167, 139, 250, 0.75)","rgba(248, 113, 113, 0.75)","rgba(52, 211, 153, 0.75)","rgba(251, 191, 36, 0.75)","rgba(236, 72, 153, 0.75)","rgba(34, 211, 238, 0.75)","rgba(168, 85, 247, 0.75)","rgba(244, 114, 82, 0.75)","rgba(96, 165, 250, 0.75)"];function y(a){let b=0;for(let c=0;c<a.length;c++)b=(b<<5)-b+a.charCodeAt(c)|0;return x[Math.abs(b)%x.length]}function z(a){return y((0,u.canonicalProjectName)(a.projectName))}function A(a){return a.replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim()}function B(a){let b=new Date(a);return`${b.getHours().toString().padStart(2,"0")}:${b.getMinutes().toString().padStart(2,"0")}`}function C({onClose:a}){return(0,c.useEffect)(()=>{let b=b=>{"Escape"===b.key&&a()};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[a]),(0,b.jsx)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"concurrency-modal-title",onClick:a,style:{position:"fixed",inset:0,zIndex:200,background:"rgba(0, 0, 0, 0.5)",backdropFilter:"blur(4px)",WebkitBackdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",padding:20},children:(0,b.jsxs)("div",{onClick:a=>a.stopPropagation(),style:{background:"var(--af-surface-elevated)",border:"1px solid var(--af-border-subtle)",borderRadius:12,maxWidth:560,width:"100%",maxHeight:"85vh",overflow:"auto",boxShadow:"0 16px 48px rgba(0, 0, 0, 0.3)"},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"18px 22px",borderBottom:"1px solid var(--af-border-subtle)"},children:[(0,b.jsx)("h2",{id:"concurrency-modal-title",style:{margin:0,fontSize:16,fontWeight:700,letterSpacing:"-0.01em"},children:"How concurrency is measured"}),(0,b.jsx)("button",{type:"button",onClick:a,"aria-label":"Close",style:{background:"transparent",border:"none",color:"var(--af-text-tertiary)",fontSize:22,lineHeight:1,cursor:"pointer",padding:0,width:28,height:28},children:"×"})]}),(0,b.jsxs)("div",{style:{padding:"18px 22px",fontSize:13,color:"var(--af-text-secondary)",lineHeight:1.55},children:[(0,b.jsxs)("p",{style:{margin:"0 0 14px"},children:["A ",(0,b.jsx)("strong",{style:{color:"var(--af-text)"},children:"concurrency burst"})," ","is a window of time when two or more Claude Code sessions were actively working in parallel. The goal is to surface moments when you were running a multi-agent fleet — not every accidental tab overlap."]}),(0,b.jsx)("h3",{style:{margin:"18px 0 8px",fontSize:12,fontWeight:700,color:"var(--af-text)",textTransform:"uppercase",letterSpacing:"0.04em"},children:'1. What counts as "active"'}),(0,b.jsxs)("p",{style:{margin:"0 0 6px"},children:["Each session's events are split into"," ",(0,b.jsx)("strong",{style:{color:"var(--af-text)"},children:"active segments"})," — stretches of time where no gap between consecutive events exceeds"," ",(0,b.jsx)("strong",{style:{color:"var(--af-text)"},children:"3 minutes"}),". Any longer gap (walked away, laptop closed, thinking) splits the session into separate segments."]}),(0,b.jsx)("p",{style:{margin:"0 0 6px",fontSize:12,color:"var(--af-text-tertiary)"},children:'This is the same definition used for the "active time" metric on the dashboard, so numbers stay consistent.'}),(0,b.jsx)("h3",{style:{margin:"18px 0 8px",fontSize:12,fontWeight:700,color:"var(--af-text)",textTransform:"uppercase",letterSpacing:"0.04em"},children:"2. Detecting overlap"}),(0,b.jsxs)("p",{style:{margin:"0 0 6px"},children:["A sweep-line walks every segment start/end across all sessions. Whenever the active count is ≥2, that stretch becomes a raw overlap. The ",(0,b.jsx)("strong",{style:{color:"var(--af-text)"},children:"peak"})," ","reported on each burst is the maximum active count reached anywhere inside it."]}),(0,b.jsx)("h3",{style:{margin:"18px 0 8px",fontSize:12,fontWeight:700,color:"var(--af-text)",textTransform:"uppercase",letterSpacing:"0.04em"},children:"3. Cleaning up noise"}),(0,b.jsx)("p",{style:{margin:"0 0 6px"},children:"Raw overlaps are noisy — a typical day produces dozens of sub-minute artifacts from switching between sessions. Two rules collapse them into human-readable bursts:"}),(0,b.jsxs)("ul",{style:{margin:"6px 0 0 0",paddingLeft:22},children:[(0,b.jsxs)("li",{style:{marginBottom:4},children:[(0,b.jsx)("strong",{style:{color:"var(--af-text)"},children:"Drop under 1 minute"})," — overlaps shorter than that are almost always tab-switch artifacts, not real parallel work."]}),(0,b.jsxs)("li",{children:[(0,b.jsx)("strong",{style:{color:"var(--af-text)"},children:"Merge within 10 minutes"})," — two overlaps separated by less than 10 minutes of idle time fuse into a single burst. A morning of back-and-forth agent work becomes one burst, not forty."]})]}),(0,b.jsx)("h3",{style:{margin:"18px 0 8px",fontSize:12,fontWeight:700,color:"var(--af-text)",textTransform:"uppercase",letterSpacing:"0.04em"},children:"4. Same-project vs cross-project"}),(0,b.jsxs)("p",{style:{margin:"0 0 6px"},children:["Bursts are colored by whether the involved sessions span more than one project directory."," ",(0,b.jsx)("span",{style:{color:"rgba(167, 139, 250, 1)",fontWeight:600},children:"Purple = cross-project"})," ","— different repos running at once, usually genuine fleet work."," ",(0,b.jsx)("span",{style:{color:"rgba(45, 212, 191, 1)",fontWeight:600},children:"Teal = same-project"})," ","— multiple sessions in one repo, usually context-switching inside a single task."]}),(0,b.jsx)("h3",{style:{margin:"18px 0 8px",fontSize:12,fontWeight:700,color:"var(--af-text)",textTransform:"uppercase",letterSpacing:"0.04em"},children:"Why bursts, not runs"}),(0,b.jsx)("p",{style:{margin:"0 0 6px"},children:'An earlier version reported every raw overlap as a separate "parallel run". On a busy day that produced 40–80 entries, most of them seconds long, most of them meaningless. Bursts are the unit humans actually think in: "this morning I was running 3 agents at once for about 20 minutes."'})]})]})})}function D({burst:a,gantt:d,sessionEntries:e,onClose:f,onShowInTimeline:h}){(0,c.useEffect)(()=>{let a=a=>{"Escape"===a.key&&f()};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[f]);let[i,j]=(0,c.useState)(null),k=(0,c.useRef)(new Map),l=(0,c.useMemo)(()=>{let a=new Map;for(let b of d.sessions)a.set(b.id,b);return a},[d]),m=a.sessionIds.map(a=>l.get(a)).filter(a=>!!a);m.sort((a,b)=>a.startMs-b.startMs);let n=a=>{j(a);let b=k.current.get(a);b&&b.scrollIntoView({behavior:"smooth",block:"center"})},o=Math.min(a.startMs,...m.map(a=>a.startMs)),p=Math.max(a.endMs,...m.map(a=>a.endMs)),q=o-9e5,r=p+9e5,s=r-q,u=22+(25*m.length-3)+6,w=a=>(a-q)/s*510,x=[];{let a=new Date(q);for(a.setMinutes(0,0,0),a.getTime()<q&&a.setHours(a.getHours()+1);a.getTime()<=r;)x.push(a.getTime()),a.setHours(a.getHours()+1)}let y=w(a.startMs),C=w(a.endMs),E=a.endMs-a.startMs;return(0,b.jsx)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"burst-detail-title",onClick:f,style:{position:"fixed",inset:0,zIndex:200,background:"rgba(0, 0, 0, 0.55)",backdropFilter:"blur(4px)",WebkitBackdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",padding:20},children:(0,b.jsxs)("div",{onClick:a=>a.stopPropagation(),style:{background:"var(--af-surface-elevated)",border:"1px solid var(--af-border-subtle)",borderRadius:12,width:"min(720px, 100%)",maxHeight:"90vh",display:"flex",flexDirection:"column",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.4)"},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,padding:"16px 22px",borderBottom:"1px solid var(--af-border-subtle)"},children:[(0,b.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:4},children:[(0,b.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",padding:"3px 10px",borderRadius:10,fontFamily:"var(--font-mono)",fontSize:11,fontWeight:700,color:"white",background:a.crossProject?"rgba(167, 139, 250, 0.95)":"rgba(45, 212, 191, 0.95)"},children:["×",a.peak," peak"]}),a.crossProject&&(0,b.jsx)("span",{style:{fontSize:9,color:"rgba(167, 139, 250, 1)",textTransform:"uppercase",letterSpacing:"0.05em",fontWeight:700},children:"cross-project"})]}),(0,b.jsxs)("h2",{id:"burst-detail-title",style:{margin:0,fontSize:16,fontWeight:700,letterSpacing:"-0.01em",display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[(0,b.jsxs)("span",{style:{fontFamily:"var(--font-mono)"},children:[B(a.startMs),"–",B(a.endMs)]}),(0,b.jsx)("span",{style:{fontSize:12,fontWeight:400,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},children:(0,v.formatDuration)(E)}),(0,b.jsxs)("span",{style:{fontSize:12,fontWeight:400,color:"var(--af-text-tertiary)"},children:["· ",m.length," session",1===m.length?"":"s"]})]})]}),(0,b.jsx)("button",{type:"button",onClick:h,style:{padding:"6px 12px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:11,color:"var(--af-text-secondary)",cursor:"pointer",fontWeight:500,whiteSpace:"nowrap"},title:"Pin this burst on the main timeline and close",children:"Show in timeline →"}),(0,b.jsx)("button",{type:"button",onClick:f,"aria-label":"Close",style:{background:"transparent",border:"none",color:"var(--af-text-tertiary)",fontSize:24,lineHeight:1,cursor:"pointer",padding:0,width:28,height:28},children:"×"})]}),(0,b.jsxs)("div",{style:{overflow:"auto",padding:"18px 22px"},children:[(0,b.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.05em",marginBottom:8,fontWeight:600},children:"Timeline (shaded = burst window)"}),(0,b.jsx)("div",{style:{background:"var(--af-surface)",border:"1px solid var(--af-border-subtle)",borderRadius:8,padding:"8px 10px",overflow:"auto"},children:(0,b.jsxs)("svg",{width:534,height:u,style:{display:"block"},children:[m.map((a,c)=>{let d=22+25*c+11,e=z(a),f=i===a.id;return(0,b.jsxs)("g",{onClick:()=>n(a.id),style:{cursor:"pointer"},children:[(0,b.jsx)("title",{children:`Track ${c+1} — click to focus in list below`}),(0,b.jsx)("circle",{cx:12,cy:d,r:9,fill:f?e:"var(--af-surface-elevated)",stroke:e,strokeWidth:f?2:1.5}),(0,b.jsx)("text",{x:12,y:d+3.5,textAnchor:"middle",fontSize:10,fontWeight:700,fill:f?"#fff":"var(--af-text)",style:{pointerEvents:"none"},children:c+1})]},`num-${a.id}`)}),(0,b.jsxs)("g",{transform:"translate(24, 0)",children:[(0,b.jsx)("rect",{x:y,y:0,width:Math.max(C-y,2),height:u,fill:a.crossProject?"rgba(167, 139, 250, 0.14)":"rgba(45, 212, 191, 0.14)"}),(0,b.jsx)("line",{x1:y,x2:y,y1:0,y2:u,stroke:a.crossProject?"rgba(167, 139, 250, 0.7)":"rgba(45, 212, 191, 0.7)",strokeWidth:1,strokeDasharray:"3 2"}),(0,b.jsx)("line",{x1:C,x2:C,y1:0,y2:u,stroke:a.crossProject?"rgba(167, 139, 250, 0.7)":"rgba(45, 212, 191, 0.7)",strokeWidth:1,strokeDasharray:"3 2"}),x.map(a=>{let c=w(a);return(0,b.jsxs)("g",{children:[(0,b.jsx)("line",{x1:c,x2:c,y1:22,y2:u,stroke:"var(--af-border-subtle)",strokeWidth:.5,strokeDasharray:"2 3"}),(0,b.jsx)("text",{x:c,y:16,textAnchor:"middle",fontSize:9,fill:"var(--af-text-tertiary)",children:B(a)})]},`mini-hm-${a}`)}),m.map((a,c)=>{let d=22+25*c,e=z(a),f=i===a.id;return(0,b.jsxs)("g",{children:[(0,b.jsx)("rect",{x:0,y:d,width:510,height:22,fill:f?"rgba(255,255,255,0.05)":"transparent",onClick:()=>n(a.id),style:{cursor:"pointer"}}),a.segments.map((a,c)=>{let g=w(a.startMs),h=Math.max(w(a.endMs)-g,2);return(0,b.jsx)("rect",{x:g,y:d+3,width:h,height:16,fill:e,rx:2,stroke:f?"var(--af-text)":"none",strokeWidth:+!!f,style:{pointerEvents:"none"}},`mini-seg-${c}`)})]},`mini-row-${a.id}`)})]})]})}),(0,b.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.05em",margin:"18px 0 8px",fontWeight:600},children:"Sessions in this burst"}),(0,b.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:m.map((c,d)=>{let f,h,j,l=z(c),m=(b=>{let c=0;for(let d of b.segments){let b=Math.max(d.startMs,a.startMs),e=Math.min(d.endMs,a.endMs);e>b&&(c+=e-b)}return c})(c),n=E>0?Math.round(m/E*100):0,o=i===c.id;return(0,b.jsx)(t.default,{href:`/sessions/${c.id}`,ref:a=>{a?k.current.set(c.id,a):k.current.delete(c.id)},style:{display:"block",padding:"11px 14px",background:o?"var(--af-surface-hover)":"var(--af-surface)",border:o?"1px solid var(--af-text-tertiary)":"1px solid var(--af-border-subtle)",borderLeft:`3px solid ${l}`,borderRadius:8,textDecoration:"none",color:"var(--af-text)",fontSize:12,lineHeight:1.45,transition:"background 0.15s, border-color 0.15s",boxShadow:o?`0 0 0 2px ${l}`:"none"},children:(0,b.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:10},children:[(0,b.jsx)("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:20,height:20,borderRadius:"50%",background:o?l:"transparent",border:`1.5px solid ${l}`,color:o?"#fff":"var(--af-text)",fontSize:10,fontWeight:700,flexShrink:0,marginTop:2},"aria-label":`Track ${d+1}`,children:d+1}),(0,b.jsxs)("div",{style:{minWidth:0,flex:1},children:[(0,b.jsx)("div",{style:{fontSize:11,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",marginBottom:3,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:(0,v.prettyProjectName)(c.projectName),children:(h=(f=(0,v.prettyProjectName)(c.projectName)).split("/").filter(Boolean)).length>2?"…/"+h.slice(-2).join("/"):f}),(0,b.jsx)("div",{style:{fontWeight:500,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:A(c.firstUserPreview??""),children:A(c.firstUserPreview??"")||(0,b.jsx)("em",{style:{color:"var(--af-text-tertiary)"},children:"(no user message)"})}),c.lastAgentPreview&&(0,b.jsxs)("div",{style:{fontSize:11,color:"var(--af-text-secondary)",marginTop:3,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontStyle:"italic"},title:A(c.lastAgentPreview),children:["↳ ",A(c.lastAgentPreview)]})]}),(0,b.jsxs)("div",{style:{fontFamily:"var(--font-mono)",fontSize:10,color:"var(--af-text-tertiary)",textAlign:"right",whiteSpace:"nowrap",flexShrink:0,display:"flex",flexDirection:"column",alignItems:"flex-end",gap:4},children:[(j=e[c.id],j?.outcome?(0,b.jsx)(g.OutcomePill,{outcome:j.outcome,size:"sm",label:"text",agent:c.agent}):null),(0,b.jsxs)("div",{style:{color:"var(--af-text-secondary)"},children:[(0,v.formatDuration)(m)," ",(0,b.jsxs)("span",{style:{opacity:.6},children:["(",n,"%)"]})]}),(0,b.jsx)("div",{style:{fontSize:9,marginTop:2},children:"in burst"})]})]})},`burst-session-${c.id}`)})})]})]})})}function E({gantt:a,bursts:d=[],sessionEntries:e={}}){let f,[h,i]=(0,c.useState)(null),[j,k]=(0,c.useState)(null),[l,m]=(0,c.useState)(null),[n,o]=(0,c.useState)(!1),[p,q]=(0,c.useState)(null),[r,s]=(0,c.useState)(!1),x=(0,c.useRef)(null),F=l??j,G=(0,c.useMemo)(()=>{if(null===F)return null;let a=d[F];return a?new Set(a.sessionIds):null},[F,d]),H=(0,c.useMemo)(()=>{let b=new Map;for(let c of a.sessions){let a=(0,u.canonicalProjectName)(c.projectName),d=b.get(a);d?d.count++:b.set(a,{name:(0,v.prettyProjectName)(a),color:y(a),count:1})}return Array.from(b.values()).sort((a,b)=>b.count-a.count)},[a.sessions]),{rangeStartMs:I,rangeEndMs:J,hourMarks:K}=(0,c.useMemo)(()=>{if(0===a.sessions.length)return{rangeStartMs:a.dayStartMs,rangeEndMs:a.dayEndMs,hourMarks:[]};let b=1/0,c=-1/0;for(let d of a.sessions)for(let a of d.segments)a.startMs<b&&(b=a.startMs),a.endMs>c&&(c=a.endMs);let d=c+18e5,e=new Date(b-18e5);e.setMinutes(0,0,0);let f=new Date(d);f.setMinutes(0,0,0),f.setHours(f.getHours()+1);let g=Math.max(e.getTime(),a.dayStartMs),h=Math.min(f.getTime(),a.dayEndMs),i=[],j=new Date(g);for(j.setMinutes(0,0,0),j.getTime()<g&&j.setHours(j.getHours()+1);j.getTime()<=h;)i.push(j.getTime()),j.setHours(j.getHours()+1);return{rangeStartMs:g,rangeEndMs:h,hourMarks:i}},[a]),L=J-I,M=Math.max(700,Math.ceil(L/36e5*80)),N=33*a.sessions.length+3+8,O=a=>(a-I)/L*M,P="var(--af-surface)",Q=r?d:d.slice(0,3),R=d.length-Q.length;return(0,b.jsxs)(b.Fragment,{children:[d.length>0&&(0,b.jsxs)("div",{className:"af-panel",style:{marginBottom:16},children:[(0,b.jsxs)("div",{className:"af-panel-header",children:[(0,b.jsx)("span",{children:"Concurrency"}),(0,b.jsx)("span",{style:{fontSize:11,color:"var(--af-text-tertiary)",fontWeight:400},children:"periods when ≥2 agents were actively working at once"}),(0,b.jsxs)("button",{type:"button",onClick:()=>o(!0),"aria-label":"How concurrency is detected",style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",gap:5,padding:"3px 9px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:100,fontSize:10,color:"var(--af-text-tertiary)",cursor:"pointer",fontWeight:500},children:[(0,b.jsx)("span",{style:{fontSize:11,lineHeight:1},children:"ⓘ"}),"How this is measured"]})]}),(0,b.jsxs)("div",{children:[Q.map((c,d)=>{let e=l===d,f=j===d,g=c.projectDirs.map(b=>{let c=a.sessions.find(a=>a.projectDir===b);return c?(0,v.prettyProjectName)(c.projectName):b}).map(a=>{let b=a.split("/").filter(Boolean);return b.length>2?"…/"+b.slice(-2).join("/"):a});return(0,b.jsxs)("div",{onMouseEnter:()=>k(d),onMouseLeave:()=>k(null),onClick:()=>q(d),style:{display:"grid",gridTemplateColumns:"auto auto auto 1fr auto",gap:14,padding:"10px 18px",fontSize:12,borderBottom:"1px solid var(--af-border-subtle)",cursor:"pointer",background:e||f?"var(--af-surface-hover)":"transparent",alignItems:"center",transition:"background 0.12s"},title:"Open burst detail",children:[(0,b.jsxs)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,color:"var(--af-text-secondary)",minWidth:110},children:[B(c.startMs),"–",B(c.endMs)]}),(0,b.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",padding:"2px 8px",borderRadius:10,fontFamily:"var(--font-mono)",fontSize:10,fontWeight:700,color:"white",background:c.crossProject?"rgba(167, 139, 250, 0.9)":"rgba(45, 212, 191, 0.9)",minWidth:28,justifyContent:"center"},children:["×",c.peak]}),c.crossProject?(0,b.jsx)("span",{style:{fontSize:9,color:"rgba(167, 139, 250, 1)",textTransform:"uppercase",letterSpacing:"0.04em",fontWeight:600},children:"cross-project"}):(0,b.jsx)("span",{}),(0,b.jsx)("span",{style:{fontSize:11,color:"var(--af-text-tertiary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:g.join(", "),children:g.join(" · ")}),(0,b.jsx)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,color:"var(--af-text-secondary)",minWidth:60,textAlign:"right"},children:(0,v.formatDuration)(c.endMs-c.startMs)})]},`burst-row-${d}`)}),d.length>3&&(0,b.jsx)("button",{type:"button",onClick:()=>s(a=>!a),style:{width:"100%",padding:"10px 18px",background:"transparent",border:"none",borderTop:"1px solid var(--af-border-subtle)",fontSize:11,color:"var(--af-text-secondary)",cursor:"pointer",fontWeight:500,textAlign:"center"},children:r?"Show fewer (first 3) ↑":`Show all ${d.length} bursts (+${R} more) ↓`})]})]}),(0,b.jsxs)("div",{className:"af-panel",style:{overflow:"hidden"},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,padding:"10px 16px",borderBottom:"1px solid var(--af-border-subtle)",fontSize:11,color:"var(--af-text-secondary)",flexWrap:"wrap"},children:[H.map(a=>{let c=a.name.split("/").filter(Boolean),d=c.length>2?"…/"+c.slice(-2).join("/"):a.name;return(0,b.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:5,cursor:"default"},title:`${a.name} — ${a.count} session${1===a.count?"":"s"} on this day`,children:[(0,b.jsx)("span",{style:{width:8,height:8,borderRadius:2,background:a.color,flexShrink:0}}),(0,b.jsx)("span",{style:{maxWidth:160,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d}),(0,b.jsxs)("span",{style:{color:"var(--af-text-tertiary)",fontSize:10},children:["(",a.count,")"]})]},a.name)}),(0,b.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:5,marginLeft:8,color:"var(--af-text-tertiary)",cursor:"default"},title:"Idle gap — the session was open but the agent was not actively working (gap > 3 minutes between events)",children:[(0,b.jsx)("span",{style:{width:16,height:8,borderRadius:2,background:"repeating-linear-gradient(45deg, var(--af-surface-hover), var(--af-surface-hover) 2px, var(--af-border-subtle) 2px, var(--af-border-subtle) 4px)",flexShrink:0}}),"idle"]})]}),(0,b.jsxs)("div",{ref:x,style:{overflow:"auto",maxHeight:"calc(100vh - 240px)",position:"relative"},onMouseLeave:()=>i(null),children:[(0,b.jsxs)("div",{style:{display:"grid",gridTemplateColumns:`220px ${M}px`,gridTemplateRows:`50px ${N}px`,width:220+M},children:[(0,b.jsxs)("div",{style:{position:"sticky",top:0,left:0,zIndex:3,background:P,borderBottom:"1px solid var(--af-border-subtle)",borderRight:"1px solid var(--af-border-subtle)",display:"flex",flexDirection:"column"},children:[(0,b.jsx)("div",{style:{height:24,display:"flex",alignItems:"center",justifyContent:"flex-end",padding:"0 10px",fontSize:9,color:"var(--af-text-tertiary)",letterSpacing:"0.04em",textTransform:"uppercase",fontWeight:600},children:d.length>0?"Concurrency":""}),(0,b.jsx)("div",{style:{height:26}})]}),(0,b.jsxs)("div",{style:{position:"sticky",top:0,zIndex:2,background:P,borderBottom:"1px solid var(--af-border-subtle)"},children:[(0,b.jsx)("svg",{width:M,height:24,style:{display:"block"},children:d.map((a,c)=>{let d=O(a.startMs),e=O(a.endMs)-d,f=Math.max(e,26),g=e<26?d+e/2-13:d,h=F===c,i=null!==F&&!h,m=a.crossProject?"rgba(167, 139, 250, 0.9)":"rgba(45, 212, 191, 0.9)";return(0,b.jsxs)("g",{children:[(0,b.jsx)("rect",{x:g,y:4,width:f,height:14,fill:m,rx:4,opacity:i?.3:1,stroke:l===c?"var(--af-text)":j===c?"var(--af-text-secondary)":"none",strokeWidth:l===c?1.5:1,style:{cursor:"pointer",transition:"opacity 0.12s"},onMouseEnter:()=>k(c),onMouseLeave:()=>k(null),onClick:()=>q(c),children:(0,b.jsx)("title",{children:`\xd7${a.peak} ${a.crossProject?"cross-project":"same-project"} \xb7 ${B(a.startMs)}–${B(a.endMs)} \xb7 ${(0,v.formatDuration)(a.endMs-a.startMs)} — click for detail`})}),(0,b.jsxs)("text",{x:g+f/2,y:15,textAnchor:"middle",fontSize:9,fontWeight:700,fill:"white",opacity:i?.3:1,style:{pointerEvents:"none"},children:["×",a.peak]})]},`burst-${c}`)})}),(0,b.jsx)("svg",{width:M,height:26,style:{display:"block"},children:K.map(a=>{let c=O(a),d=new Date(a).getHours()%3==0;return(0,b.jsx)("text",{x:c,y:18,textAnchor:"middle",fontSize:10,fill:d?"var(--af-text-secondary)":"var(--af-text-tertiary)",fontWeight:d?600:400,children:B(a)},a)})})]}),(0,b.jsx)("div",{style:{position:"sticky",left:0,zIndex:1,background:P,borderRight:"1px solid var(--af-border-subtle)"},children:(0,b.jsx)("div",{style:{paddingTop:3},children:a.sessions.map((a,c)=>{let d=z(a),e=a.firstUserPreview?A(a.firstUserPreview).slice(0,45):(0,v.prettyProjectName)(a.projectName),f=(0,v.prettyProjectName)(a.projectName),g=null!==G&&!G.has(a.id);return(0,b.jsxs)("div",{style:{height:30,marginBottom:3,display:"flex",alignItems:"center",gap:6,padding:"0 8px 0 6px",background:c%2==1?"var(--af-surface-hover)":"transparent",opacity:g?.3:1,transition:"opacity 0.12s"},children:[(0,b.jsx)("span",{style:{width:6,height:6,borderRadius:2,background:d,flexShrink:0}}),(0,b.jsx)(w.AgentIcon,{agent:a.agent,size:11}),(0,b.jsx)(t.default,{href:`/sessions/${a.id}`,style:{fontSize:10.5,color:"var(--af-text)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",lineHeight:1.2,textDecoration:"none"},title:`${A(a.firstUserPreview??"")} — ${f}`,children:e})]},`label-${a.id}-${c}`)})})}),(0,b.jsx)("div",{children:(0,b.jsxs)("svg",{width:M,height:N,style:{display:"block"},children:[(0,b.jsx)("defs",{children:(0,b.jsxs)("pattern",{id:"gantt-idle-stripes",patternUnits:"userSpaceOnUse",width:"6",height:"6",patternTransform:"rotate(45)",children:[(0,b.jsx)("rect",{width:"6",height:"6",fill:"var(--af-surface-hover)"}),(0,b.jsx)("line",{x1:"0",y1:"0",x2:"0",y2:"6",stroke:"var(--af-border-subtle)",strokeWidth:"1.5"})]})}),K.map(a=>{let c=O(a),d=new Date(a).getHours()%3==0;return(0,b.jsx)("line",{x1:c,y1:0,x2:c,y2:N,stroke:"var(--af-border-subtle)",strokeWidth:d?.8:.4,strokeDasharray:d?void 0:"2 4"},a)}),a.sessions.map((a,c)=>{let d=33*c+3,e=z(a),f=null!==G&&!G.has(a.id);return(0,b.jsxs)("g",{opacity:f?.25:1,style:{transition:"opacity 0.12s"},children:[c%2==1&&(0,b.jsx)("rect",{x:0,y:d,width:M,height:30,fill:"var(--af-surface-hover)",opacity:.25}),a.segments.map((c,f)=>{let g=O(c.startMs),h=Math.max(O(c.endMs)-g,4);return(0,b.jsx)("rect",{x:g,y:d+5,width:h,height:20,fill:e,rx:3,style:{cursor:"pointer"},onMouseEnter:b=>{let c=b.currentTarget.closest("svg").getBoundingClientRect();i({session:a,x:b.clientX-c.left+220,y:d+30+24+26+4})}},f)}),a.segments.length>1&&a.segments.slice(0,-1).map((c,e)=>{let f=a.segments[e+1],g=O(c.endMs),h=O(f.startMs);return h-g<4?null:(0,b.jsx)("rect",{x:g+1,y:d+7,width:h-g-2,height:16,fill:"url(#gantt-idle-stripes)",rx:2,opacity:.7},`idle-${e}`)}),(0,b.jsxs)("text",{x:Math.min(O(a.endMs)+8,M-100),y:d+15+3.5,fontSize:9,fill:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",children:[(0,v.formatDuration)(a.activeMs)," · ",B(a.startMs),"–",B(a.endMs)]})]},`row-${a.id}-${c}`)})]})})]}),h&&(0,b.jsxs)("div",{style:{position:"absolute",left:Math.max(8,Math.min(h.x,220+M-340)),top:Math.min(h.y,50+N-100),zIndex:50,background:"var(--af-surface-elevated)",border:"1px solid var(--af-border-subtle)",borderRadius:8,padding:"10px 14px",fontSize:11,color:"var(--af-text)",pointerEvents:"none",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",maxWidth:340,lineHeight:1.45},children:[(f=e[h.session.id])?f.outcome?(0,b.jsx)("div",{style:{marginBottom:6},children:(0,b.jsx)(g.OutcomePill,{outcome:f.outcome,size:"sm",agent:h.session.agent})}):"done"!==f.enrichmentStatus&&"skipped_trivial"!==f.enrichmentStatus?(0,b.jsx)("div",{style:{marginBottom:6},children:(0,b.jsx)(g.OutcomePill,{outcome:null,pending:!0,sessionId:h.session.id,localDay:f.localDay,size:"sm",agent:h.session.agent})}):null:null,(0,b.jsx)("div",{style:{fontWeight:600,marginBottom:4},children:e[h.session.id]?.briefSummary||A(h.session.firstUserPreview??"").slice(0,100)||(0,v.prettyProjectName)(h.session.projectName)}),(0,b.jsxs)("div",{style:{fontSize:10,color:"var(--af-text-secondary)",marginBottom:6,fontFamily:"var(--font-mono)"},children:[(0,v.prettyProjectName)(h.session.projectName),h.session.model&&` \xb7 ${h.session.model}`]}),(0,b.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"3px 12px",fontSize:10,color:"var(--af-text-secondary)"},children:[(0,b.jsxs)("span",{children:["Active: ",(0,b.jsx)("strong",{children:(0,v.formatDuration)(h.session.activeMs)})]}),(0,b.jsxs)("span",{children:["Segments: ",h.session.segments.length]}),(0,b.jsxs)("span",{children:["Range: ",B(h.session.startMs),"–",B(h.session.endMs)]}),(0,b.jsxs)("span",{children:["Tokens:"," ",(0,v.formatTokens)(h.session.totalUsage.input+h.session.totalUsage.cacheRead+h.session.totalUsage.cacheWrite),"/",(0,v.formatTokens)(h.session.totalUsage.output)]})]})]})]})]}),n&&(0,b.jsx)(C,{onClose:()=>o(!1)}),null!==p&&d[p]&&(0,b.jsx)(D,{burst:d[p],gantt:a,sessionEntries:e,onClose:()=>q(null),onShowInTimeline:()=>{q(null),null!==p&&(a=>{m(b=>b===a?null:a);let b=d[a],c=x.current;if(!b||!c)return;let e=220+(O(b.startMs)+O(b.endMs))/2-c.clientWidth/2;c.scrollTo({left:Math.max(0,e),behavior:"smooth"})})(p)}})]})}function F({open:a,onClose:d,rows:e,aiEnabled:f}){let[g,h]=(0,c.useState)(new Set),[i,j]=(0,c.useState)(!1),[k,l]=(0,c.useState)(!1);(0,c.useEffect)(()=>{if(!a)return;let b=a=>{"Escape"===a.key&&d()};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[a,d]);let m=async()=>{if(0===g.size)return;j(!0);let a=Array.from(g).sort().reverse();try{for(let b of a){let a=`/api/digest/day/${b}${k?"?force=1":""}`,c=await fetch(a,{method:"POST"});if(c.body){let a=c.body.getReader();for(;!(await a.read()).done;);}}}finally{j(!1),h(new Set)}};return a?(0,b.jsx)("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.4)",zIndex:200,display:"flex",justifyContent:"flex-end"},onClick:d,children:(0,b.jsxs)("div",{onClick:a=>a.stopPropagation(),style:{width:"min(440px, 100%)",height:"100%",background:"var(--af-surface-elevated)",borderLeft:"1px solid var(--af-border-subtle)",display:"flex",flexDirection:"column",boxShadow:"-12px 0 32px rgba(0,0,0,0.25)"},children:[(0,b.jsxs)("header",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 18px",borderBottom:"1px solid var(--af-border-subtle)"},children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{style:{fontSize:15,fontWeight:700,margin:0},children:"Backfill digests"}),(0,b.jsx)("p",{style:{fontSize:11,color:"var(--af-text-tertiary)",margin:"2px 0 0"},children:"Each selected day enqueues a job. You can close this drawer."})]}),(0,b.jsx)("button",{type:"button",onClick:d,"aria-label":"Close",style:{background:"transparent",border:"none",color:"var(--af-text-tertiary)",fontSize:22,cursor:"pointer"},children:"×"})]}),!f&&(0,b.jsx)("div",{style:{padding:12,margin:18,background:"rgba(237,137,54,0.1)",borderRadius:6,fontSize:12,color:"var(--af-text)"},children:"AI features are off — only deterministic digests will be written. Enable AI in Settings to generate narratives."}),(0,b.jsxs)("div",{style:{display:"flex",gap:6,padding:"10px 18px",borderBottom:"1px solid var(--af-border-subtle)",flexWrap:"wrap",fontSize:11},children:[(0,b.jsx)(G,{onClick:()=>h(new Set(e.filter(a=>"pending"===a.status).map(a=>a.date))),children:"Select pending"}),(0,b.jsx)(G,{onClick:()=>h(new Set(e.filter(a=>"empty"!==a.status).map(a=>a.date))),children:"Select all with entries"}),(0,b.jsx)(G,{onClick:()=>h(new Set),children:"Clear"}),(0,b.jsxs)("label",{style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",gap:4,fontSize:11,color:"var(--af-text-secondary)",cursor:"pointer"},children:[(0,b.jsx)("input",{type:"checkbox",checked:k,onChange:a=>l(a.target.checked)}),"force regen"]})]}),(0,b.jsx)("div",{style:{flex:1,overflowY:"auto"},children:e.map(a=>(0,b.jsxs)("label",{style:{display:"grid",gridTemplateColumns:"auto 110px 80px 1fr",gap:10,alignItems:"center",padding:"8px 18px",borderBottom:"1px solid var(--af-border-subtle)",fontSize:12,cursor:"empty"===a.status?"default":"pointer",opacity:"empty"===a.status?.5:1},children:[(0,b.jsx)("input",{type:"checkbox",disabled:"empty"===a.status,checked:g.has(a.date),onChange:()=>{var b;return b=a.date,void h(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})}}),(0,b.jsx)("span",{children:a.day_label}),(0,b.jsx)("span",{style:{fontSize:10,color:"generated"===a.status?"#48bb78":"pending"===a.status?"#ed8936":"var(--af-text-tertiary)"},children:"generated"===a.status?"✓ ready":"pending"===a.status?"• pending":"—"}),(0,b.jsxs)("span",{style:{fontFamily:"var(--font-mono)",fontSize:10,color:"var(--af-text-tertiary)",textAlign:"right"},children:[a.entry_count>0?`${a.entry_count} sess`:"",a.pr_count>0?` \xb7 ${a.pr_count} PR`:""]})]},a.date))}),(0,b.jsxs)("footer",{style:{padding:"12px 18px",borderTop:"1px solid var(--af-border-subtle)",display:"flex",gap:10,alignItems:"center"},children:[(0,b.jsxs)("span",{style:{fontSize:12,color:"var(--af-text-secondary)",flex:1},children:[g.size," day",1===g.size?"":"s"," selected"]}),(0,b.jsx)("button",{type:"button",onClick:d,style:{padding:"6px 12px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:12,cursor:"pointer"},children:"Cancel"}),(0,b.jsx)("button",{type:"button",onClick:m,disabled:i||0===g.size,style:{padding:"6px 14px",background:"var(--af-accent)",color:"white",border:"none",borderRadius:6,fontSize:12,fontWeight:600,cursor:i||0===g.size?"default":"pointer",opacity:i||0===g.size?.6:1},children:i?`Enqueueing… (${g.size})`:`Generate ${g.size}`})]})]})}):null}function G({onClick:a,children:c}){return(0,b.jsx)("button",{type:"button",onClick:a,style:{padding:"3px 10px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:5,fontSize:11,color:"var(--af-text-secondary)",cursor:"pointer"},children:c})}var H=a.i(50944);function I(a){if(a<6e4)return`${Math.round(a/1e3)}s`;let b=Math.round(a/6e4);if(b<60)return`${b}m`;let c=Math.floor(b/60),d=b%60;return d?`${c}h ${d}m`:`${c}h`}function J({date:a,today:d,prevDay:e,nextDay:f,dayStats:g,hrefForDate:h=a=>`/day/${a}`}){let i,j,k,l,m,n,o=(0,H.useRouter)(),[p,q]=(0,c.useState)(!1),[r,s]=(0,c.useMemo)(()=>{let[b,c]=a.split("-").map(Number);return[b,c]},[a]),[u,v]=(0,c.useState)(r),[w,x]=(0,c.useState)(s),[y,z]=(0,c.useState)(null),[A,B]=(0,c.useState)(null),C=(0,c.useMemo)(()=>{let a=new Map;for(let b of g)a.set(b.date,b);return a},[g]),D=(0,c.useMemo)(()=>{let a=new Date(u,w-1,1).getDay(),b=new Date(u,w,0).getDate(),c=[];for(let b=0;b<a;b++)c.push(null);for(let a=1;a<=b;a++){let b=String(w).padStart(2,"0"),d=String(a).padStart(2,"0");c.push(`${u}-${b}-${d}`)}return c},[u,w]),E=(0,c.useMemo)(()=>{let a=0;for(let b of g)b.airTimeMs>a&&(a=b.airTimeMs);return a},[g]),F=new Date(u,w-1).toLocaleString(void 0,{month:"long",year:"numeric"}),G=a=>{let b=w+a,c=u;b<1&&(b=12,c--),b>12&&(b=1,c++),x(b),v(c)};return(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap",position:"relative"},children:[e?(0,b.jsx)(t.default,{href:h(e),style:{padding:"5px 10px",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:11,color:"var(--af-text-secondary)"},children:"←"}):(0,b.jsx)("span",{style:{padding:"5px 10px",opacity:.3,fontSize:11,color:"var(--af-text-tertiary)"},children:"←"}),(0,b.jsx)("button",{type:"button",onClick:()=>{v(r),x(s),q(a=>!a)},style:{padding:"5px 12px",fontSize:12,fontFamily:"var(--font-mono)",border:"1px solid var(--af-border-subtle)",borderRadius:6,background:p?"var(--af-accent-subtle)":"transparent",color:p?"var(--af-accent)":"var(--af-text)",cursor:"pointer",fontWeight:500,minWidth:120,textAlign:"center"},children:a}),f?(0,b.jsx)(t.default,{href:h(f),style:{padding:"5px 10px",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:11,color:"var(--af-text-secondary)"},children:"→"}):(0,b.jsx)("span",{style:{padding:"5px 10px",opacity:.3,fontSize:11,color:"var(--af-text-tertiary)"},children:"→"}),(0,b.jsx)(t.default,{href:h(d),style:{padding:"5px 12px",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:11,color:a===d?"var(--af-accent)":"var(--af-text-secondary)",background:a===d?"var(--af-accent-subtle)":"transparent",fontWeight:500},children:"Today"}),p&&(0,b.jsxs)("div",{style:{position:"absolute",top:"calc(100% + 8px)",left:0,zIndex:60,background:"var(--af-surface)",border:"1px solid var(--af-border-subtle)",borderRadius:10,padding:"12px 14px",boxShadow:"0 8px 28px rgba(0,0,0,0.18)",minWidth:300},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:10},children:[(0,b.jsx)("button",{type:"button",onClick:()=>G(-1),style:{background:"transparent",border:"none",cursor:"pointer",color:"var(--af-text-secondary)",fontSize:14,padding:"2px 8px",borderRadius:4},children:"‹"}),(0,b.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"var(--af-text)"},children:F}),(0,b.jsx)("button",{type:"button",onClick:()=>G(1),style:{background:"transparent",border:"none",cursor:"pointer",color:"var(--af-text-secondary)",fontSize:14,padding:"2px 8px",borderRadius:4},children:"›"})]}),(0,b.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:2,marginBottom:4},children:["Su","Mo","Tu","We","Th","Fr","Sa"].map(a=>(0,b.jsx)("div",{style:{textAlign:"center",fontSize:9,color:"var(--af-text-tertiary)",fontWeight:600,padding:"2px 0"},children:a},a))}),(0,b.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:2},children:D.map((c,e)=>{if(!c)return(0,b.jsx)("div",{},`blank-${e}`);let f=C.get(c),g=f?.airTimeMs??0,i=f?.burstCount??0,j=c===a,k=c===d,l=c>d,m=g>0&&E>0?Math.min(1,g/E):0,n=parseInt(c.split("-")[2],10);return(0,b.jsxs)("button",{type:"button",onClick:()=>{q(!1),o.push(h(c))},disabled:l,onMouseEnter:a=>{if(l)return;let b=a.currentTarget.getBoundingClientRect(),d=a.currentTarget.offsetParent?.getBoundingClientRect()??b;z(c),B({x:b.left-d.left+b.width/2,y:b.bottom-d.top+6})},onMouseLeave:()=>{z(null),B(null)},style:{position:"relative",width:40,height:40,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:1,border:j?"2px solid var(--af-accent)":k?"1px solid var(--af-text-tertiary)":"1px solid transparent",borderRadius:6,background:m>0?`rgba(45, 212, 191, ${.08+.35*m})`:"transparent",color:l?"var(--af-text-tertiary)":j?"var(--af-accent)":"var(--af-text)",cursor:l?"not-allowed":"pointer",fontSize:11,fontWeight:j?700:400,fontFamily:"var(--font-mono)",padding:0,opacity:l?.4:1},children:[(0,b.jsx)("span",{style:{lineHeight:1},children:n}),g>0&&(0,b.jsx)("span",{style:{fontSize:8,color:j?"var(--af-accent)":"var(--af-text-tertiary)",lineHeight:1,fontWeight:600,marginTop:2},children:I(g)}),i>0&&(0,b.jsx)("span",{style:{position:"absolute",top:3,right:3,width:5,height:5,borderRadius:"50%",background:"rgba(167, 139, 250, 0.95)",boxShadow:"0 0 0 1px var(--af-surface)"}})]},c)})}),(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginTop:10,paddingTop:8,borderTop:"1px solid var(--af-border-subtle)",fontSize:9,color:"var(--af-text-tertiary)"},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:5},children:[(0,b.jsx)("span",{children:"less"}),(0,b.jsx)("div",{style:{display:"flex",gap:2},children:[0,.15,.3,.5,.8].map((a,c)=>(0,b.jsx)("span",{style:{width:10,height:10,borderRadius:2,background:0===a?"var(--af-border-subtle)":`rgba(45, 212, 191, ${.08+.35*a})`}},c))}),(0,b.jsx)("span",{children:"more active"})]}),(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:5},title:"Days with at least one concurrency burst",children:[(0,b.jsx)("span",{style:{width:5,height:5,borderRadius:"50%",background:"rgba(167, 139, 250, 0.95)"}}),"parallel"]})]}),y&&A&&(i=C.get(y),j=i?.sessions??0,k=i?.airTimeMs??0,l=i?.parallelMs??0,m=i?.burstCount??0,n=i?.peakConcurrency??0,(0,b.jsxs)("div",{style:{position:"absolute",left:Math.max(10,Math.min(A.x-110,290)),top:A.y,width:220,pointerEvents:"none",background:"var(--af-surface-elevated)",border:"1px solid var(--af-border-subtle)",borderRadius:8,padding:"9px 12px",boxShadow:"0 6px 22px rgba(0,0,0,0.22)",fontSize:11,color:"var(--af-text)",zIndex:65,lineHeight:1.5},children:[(0,b.jsx)("div",{style:{fontFamily:"var(--font-mono)",fontWeight:700,fontSize:11,marginBottom:4},children:y}),0===j&&0===k&&0===l?(0,b.jsx)("div",{style:{color:"var(--af-text-tertiary)",fontSize:10},children:"no activity"}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(K,{label:"sessions",value:String(j)}),(0,b.jsx)(K,{label:"active time",value:k>0?I(k):"—"}),l>0&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{style:{marginTop:4,paddingTop:4,borderTop:"1px dashed var(--af-border-subtle)"}}),(0,b.jsx)(K,{label:"parallel time",value:I(l)}),(0,b.jsx)(K,{label:"peak concurrency",value:`\xd7${n}`,accent:!0}),(0,b.jsx)(K,{label:"bursts",value:String(m)})]})]})]}))]})]})}function K({label:a,value:c,accent:d}){return(0,b.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",color:"var(--af-text-secondary)",fontSize:10},children:[(0,b.jsx)("span",{children:a}),(0,b.jsx)("strong",{style:{color:d?"rgba(167, 139, 250, 1)":"var(--af-text)"},children:c})]})}function L({label:a,defaultOpen:f=!0,children:g}){let[h,i]=(0,c.useState)(f);return(0,b.jsxs)("div",{style:{borderBottom:"1px solid var(--af-border-subtle)"},children:[(0,b.jsxs)("button",{type:"button",onClick:()=>i(a=>!a),style:{width:"100%",padding:"12px 40px",background:"transparent",border:"none",textAlign:"left",display:"flex",alignItems:"center",gap:8,cursor:"pointer",fontSize:11,fontWeight:700,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.08em"},children:[h?(0,b.jsx)(d.ChevronDown,{size:13}):(0,b.jsx)(e.ChevronRight,{size:13}),a]}),h&&(0,b.jsx)("div",{children:g})]})}a.s(["DayView",0,function({date:a,today:d,prev:e,next:g,initial:h,entries:i,aiEnabled:j,gantt:k,bursts:l,sessionEntries:m,backfillRows:n,dayStats:o}){let[p,q]=(0,c.useState)(!1),r=i.length>0&&i.every(a=>"skipped_trivial"===a.enrichment.status),t=i.length>0&&!r,u=k.sessions.length>0,v=new Date(`${a}T12:00:00`).toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric"}),w=n.filter(a=>"pending"===a.status).length;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("nav",{style:{padding:"14px 40px",display:"flex",gap:12,fontSize:12,borderBottom:"1px solid var(--af-border-subtle)",alignItems:"center",flexWrap:"wrap"},children:[(0,b.jsx)(J,{date:a,today:d,prevDay:e,nextDay:g??void 0,dayStats:o}),(0,b.jsxs)("button",{type:"button",onClick:()=>q(!0),style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",gap:5,padding:"5px 10px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:11,color:"var(--af-text-secondary)",cursor:"pointer"},title:"Open the backfill multi-select drawer",children:[(0,b.jsx)(f,{size:12}),"Backfill digests",w>0&&(0,b.jsx)("span",{style:{fontSize:10,color:"#ed8936",fontWeight:700},children:w})]})]}),t||u?(0,b.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[t&&(0,b.jsx)(L,{label:"Narrative",defaultOpen:!0,children:(0,b.jsx)(s,{initial:h,entries:i,date:a,aiEnabled:j})}),u&&(0,b.jsx)(L,{label:"Timeline & concurrency",defaultOpen:!0,children:(0,b.jsx)("div",{style:{padding:"8px 40px 40px"},children:(0,b.jsx)(E,{gantt:k,bursts:l,sessionEntries:m})})})]}):(0,b.jsxs)("div",{style:{padding:"60px 40px",textAlign:"center",color:"var(--af-text-secondary)"},children:[(0,b.jsx)("div",{style:{fontSize:14,marginBottom:6},children:v}),(0,b.jsx)("div",{style:{fontSize:13,color:"var(--af-text-tertiary)"},children:"No Claude Code activity on this day."})]}),(0,b.jsx)(F,{open:p,onClose:()=>q(!1),rows:n,aiEnabled:j})]})}],94561)}];
1
+ module.exports=[94561,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(5784),e=a.i(50522);let f=(0,a.i(70106).default)("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);var g=a.i(44220),h=a.i(68381);let i={"spec-review-loop":"Spec-review loop","chunk-implementation":"Chunk implementation","research-then-build":"Research-then-build","reviewer-triad":"Reviewer triad","background-coordinated":"Background-coordinated","solo-continuation":"Solo continuation","solo-design":"Solo design","solo-build":"Solo build",mixed:"Mixed"},j={teammate:"<teammate-message>","task-notification":"<task-notification>","local-command-caveat":"<local-command-caveat>","image-attached":"[Image #N]","slash-command":"/command","handoff-prose":"Handoff prose"};function k({digest:a,entries:f,aiEnabled:i,actions:j}){let[p,q]=(0,c.useState)(!1),s=new Date(`${a.key}T12:00:00`).toLocaleDateString("en-US",{weekday:"long",month:"short",day:"numeric",year:"numeric"}),t=a.agent_min/60,u=t>=1?`${t.toFixed(1)}h`:`${Math.round(a.agent_min)}m`,v=[...f].sort((a,b)=>Date.parse(b.start_iso)-Date.parse(a.start_iso));return(0,b.jsxs)("div",{style:{maxWidth:980,margin:"0 auto",padding:"24px 40px"},children:[(0,b.jsxs)("header",{style:{marginBottom:28},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:8,fontSize:12,color:"var(--af-text-tertiary)",fontWeight:500,flexWrap:"wrap"},children:[(0,b.jsx)("span",{children:s}),(0,b.jsx)(g.OutcomePill,{outcome:a.outcome_day,size:"lg"}),(0,b.jsx)("span",{style:{color:"var(--af-text-tertiary)"},children:"·"}),(0,b.jsxs)("span",{style:{fontFamily:"var(--font-mono)",color:"var(--af-text-secondary)"},children:[u," agent time · ",a.projects.length," project",1===a.projects.length?"":"s"," · ",a.shipped.length," PR",1===a.shipped.length?"":"s"," shipped",a.concurrency_peak>1&&` \xb7 peak concurrency \xd7${a.concurrency_peak}`]}),j&&(0,b.jsx)("div",{style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",gap:8},children:j})]}),a.headline?(0,b.jsx)("h1",{style:{fontSize:26,fontWeight:700,lineHeight:1.3,letterSpacing:"-0.02em",margin:"0 0 8px",maxWidth:820,color:"var(--af-text)"},children:a.headline}):(0,b.jsx)("h1",{style:{fontSize:20,color:"var(--af-text-secondary)",margin:"0 0 14px"},children:i?"No narrative yet — click Regenerate.":`Worked ${u} across ${a.projects.length} project${1===a.projects.length?"":"s"}.`}),a.day_signature&&(0,b.jsx)("p",{style:{margin:"0 0 14px",fontSize:14,fontStyle:"italic",color:"var(--af-text-secondary)",maxWidth:820,lineHeight:1.5},children:a.day_signature})]}),!i&&(0,b.jsxs)("div",{style:{padding:14,marginBottom:24,background:"var(--af-accent-subtle)",borderRadius:8,fontSize:13,color:"var(--af-text)"},children:["Enable AI features in ",(0,b.jsx)("a",{href:"/settings",style:{color:"var(--af-accent)"},children:"Settings"})," to see daily narratives."]}),a.day_signals&&(0,b.jsx)(o,{signals:a.day_signals}),(a.what_went_well||a.what_hit_friction)&&(0,b.jsxs)("section",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:24,marginBottom:28},children:[(0,b.jsx)(m,{glyph:"✓",color:"#48bb78",text:a.what_went_well,emptyLabel:"(smooth)"}),(0,b.jsx)(m,{glyph:"⚠",color:"#ed8936",text:a.what_hit_friction,emptyLabel:"(no friction)"})]}),a.narrative&&(0,b.jsx)("section",{style:{marginBottom:28,padding:"4px 0",fontSize:15,lineHeight:1.6,color:"var(--af-text)",maxWidth:760},children:a.narrative}),(0,b.jsx)("div",{style:{marginBottom:18},children:(0,b.jsxs)("button",{type:"button",onClick:()=>q(a=>!a),style:{display:"inline-flex",alignItems:"center",gap:6,padding:"5px 10px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:11,color:"var(--af-text-secondary)",cursor:"pointer"},children:[p?(0,b.jsx)(d.ChevronDown,{size:12}):(0,b.jsx)(e.ChevronRight,{size:12}),p?"Hide details":"Show more details"]})}),p&&(0,b.jsxs)(b.Fragment,{children:[a.suggestion&&(0,b.jsxs)("section",{style:{borderLeft:"3px solid var(--af-accent)",paddingLeft:16,marginBottom:32},children:[(0,b.jsx)("div",{style:{fontSize:11,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.06em",fontWeight:600,marginBottom:6},children:"Tomorrow"}),(0,b.jsx)("div",{style:{fontSize:15,fontWeight:600,marginBottom:4,color:"var(--af-text)"},children:a.suggestion.headline}),(0,b.jsx)("div",{style:{fontSize:13,color:"var(--af-text-secondary)",lineHeight:1.5,maxWidth:760},children:a.suggestion.body})]}),a.projects.length>0&&(0,b.jsxs)("section",{style:{marginBottom:32},children:[(0,b.jsx)(l,{children:"Work breakdown"}),(0,b.jsx)("div",{style:{display:"grid",gap:6},children:a.projects.map(c=>{let d=a.shipped.filter(a=>a.project===c.display_name);return(0,b.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"140px 1fr 56px 72px",gap:12,alignItems:"center",padding:"6px 0",borderBottom:"1px solid var(--af-border-subtle)",fontSize:13},children:[(0,b.jsx)("span",{title:c.name,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c.display_name}),(0,b.jsx)(n,{pct:c.share_pct}),(0,b.jsxs)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,color:"var(--af-text-tertiary)",textAlign:"right"},children:[c.share_pct.toFixed(0),"%"]}),(0,b.jsx)("span",{style:{fontSize:11,color:"var(--af-text-tertiary)",textAlign:"right"},children:d.length>0?`${d.length} PR${1===d.length?"":"s"}`:"—"})]},c.name)})})]}),a.shipped.length>0&&(0,b.jsxs)("section",{style:{marginBottom:32},children:[(0,b.jsx)(l,{children:"Shipped"}),(0,b.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none"},children:a.shipped.map((a,c)=>(0,b.jsxs)("li",{style:{padding:"6px 0",fontSize:13,borderBottom:"1px solid var(--af-border-subtle)",display:"flex",gap:10,alignItems:"baseline"},children:[(0,b.jsx)("span",{style:{color:"#48bb78",fontSize:12},children:"✓"}),(0,b.jsx)("span",{style:{flex:1},children:a.title}),(0,b.jsx)("span",{style:{fontSize:11,color:"var(--af-text-tertiary)"},children:a.project})]},c))})]}),v.length>0&&(0,b.jsxs)("section",{style:{marginBottom:32},children:[(0,b.jsxs)(l,{children:["Sessions · ",v.length]}),(0,b.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:v.map(a=>(0,b.jsx)(r,{entry:a},a.session_id))})]}),a.top_goal_categories.length>0&&(0,b.jsxs)("section",{style:{marginTop:40,paddingTop:20,borderTop:"1px solid var(--af-border-subtle)"},children:[(0,b.jsx)("div",{style:{fontSize:11,color:"var(--af-text-tertiary)",marginBottom:6},children:"Goal mix"}),(0,b.jsx)(h.GoalBar,{goals:a.top_goal_categories,total:a.agent_min})]})]})]})}function l({children:a}){return(0,b.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:600,marginBottom:10},children:a})}function m({glyph:a,color:c,text:d,emptyLabel:e}){return(0,b.jsxs)("div",{style:{fontSize:14,lineHeight:1.55,display:"flex",gap:8,alignItems:"flex-start"},children:[(0,b.jsx)("span",{style:{fontSize:16,color:c,lineHeight:1.4,flexShrink:0},children:a}),d?(0,b.jsx)("span",{style:{color:"var(--af-text)"},children:d}):(0,b.jsx)("span",{style:{color:"var(--af-text-tertiary)",fontStyle:"italic"},children:e})]})}function n({pct:a}){return(0,b.jsx)("div",{style:{height:6,background:"var(--af-border-subtle)",borderRadius:99,overflow:"hidden"},children:(0,b.jsx)("div",{style:{width:`${Math.min(100,Math.max(0,a))}%`,height:"100%",background:"var(--af-accent)",transition:"width 0.2s"}})})}function o({signals:a}){let c=null!==a.dominant_shape,d=Object.keys(a.shape_distribution).length>0,e=a.user_authored_subagents_used.length>0||Object.keys(a.shape_distribution).length>0,f=a.skills_loaded.filter(a=>"stock"===a.origin),g=a.skills_loaded.filter(a=>"user"===a.origin),h=a.prompt_frames.filter(a=>"claude-feature"===a.origin),k=a.prompt_frames.filter(a=>"personal-habit"===a.origin),l=a.comm_style,m=l.verbosity_distribution.short+l.verbosity_distribution.medium+l.verbosity_distribution.long+l.verbosity_distribution.very_long,n=l.steering.interrupts+l.steering.frustrated+l.steering.dissatisfied;return c||d||0!==f.length||0!==g.length||0!==a.user_authored_subagents_used.length||0!==h.length||0!==k.length||0!==m||0!==l.external_refs.length||0!==n||0!==a.brainstorm_warmup_session_count||0!==a.todo_ops_total||a.plan_mode_used?(0,b.jsxs)("section",{style:{marginBottom:28,padding:"14px 16px",borderRadius:8,background:"var(--af-surface)",border:"1px solid var(--af-border-subtle)"},children:[(0,b.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:600,marginBottom:10},children:"How today worked"}),c&&(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap",marginBottom:8},children:[(0,b.jsx)("span",{style:{display:"inline-flex",alignItems:"center",padding:"3px 10px",borderRadius:999,fontSize:12,fontWeight:600,background:"var(--af-accent-subtle)",color:"var(--af-accent)"},children:i[a.dominant_shape]??a.dominant_shape}),d&&(0,b.jsx)("span",{style:{fontSize:12,color:"var(--af-text-secondary)",fontFamily:"var(--font-mono)"},children:Object.entries(a.shape_distribution).sort((a,b)=>b[1]-a[1]).map(([a,b])=>`${b} ${a}`).join(" · ")})]}),e&&a.user_authored_subagents_used.length>0&&(0,b.jsx)(p,{label:"Your subagents",children:a.user_authored_subagents_used.slice(0,4).map(a=>(0,b.jsxs)(q,{title:a.sample_prompt_preview,children:[a.type,a.count>1?` \xd7${a.count}`:""]},a.type))}),(f.length>0||g.length>0)&&(0,b.jsxs)(p,{label:"Skills loaded",children:[g.slice(0,4).map(a=>(0,b.jsxs)(q,{tone:"user",children:[a.skill,a.count>1?` \xd7${a.count}`:""]},a.skill)),f.slice(0,4).map(a=>(0,b.jsxs)(q,{tone:"stock",children:[a.skill,a.count>1?` \xd7${a.count}`:""]},a.skill))]}),(h.length>0||k.length>0)&&(0,b.jsxs)(p,{label:"Prompt frames",children:[k.map(a=>(0,b.jsxs)(q,{tone:"user",children:[j[a.frame]??a.frame,a.count>1?` \xd7${a.count}`:""]},a.frame)),h.map(a=>(0,b.jsxs)(q,{tone:"stock",children:[j[a.frame]??a.frame,a.count>1?` \xd7${a.count}`:""]},a.frame))]}),(m>0||l.external_refs.length>0||n>0)&&(0,b.jsxs)(p,{label:"Comm style",children:[m>0&&(0,b.jsx)("span",{style:{fontSize:12,color:"var(--af-text-secondary)",fontFamily:"var(--font-mono)"},children:[l.verbosity_distribution.short&&`${l.verbosity_distribution.short} short`,l.verbosity_distribution.medium&&`${l.verbosity_distribution.medium} med`,l.verbosity_distribution.long&&`${l.verbosity_distribution.long} long`,l.verbosity_distribution.very_long&&`${l.verbosity_distribution.very_long} v.long`].filter(Boolean).join(" · ")}),l.external_refs.length>0&&(0,b.jsxs)(q,{children:[l.external_refs.length," external ref",1===l.external_refs.length?"":"s"]}),l.steering.interrupts>0&&(0,b.jsxs)(q,{children:[l.steering.interrupts," interrupts"]}),l.steering.sessions_with_mid_run_redirect>0&&(0,b.jsxs)(q,{children:[l.steering.sessions_with_mid_run_redirect," mid-run redirect",1===l.steering.sessions_with_mid_run_redirect?"":"s"]})]}),(a.brainstorm_warmup_session_count>0||a.todo_ops_total>0||a.plan_mode_used)&&(0,b.jsxs)(p,{label:"Discipline",children:[a.brainstorm_warmup_session_count>0&&(0,b.jsxs)(q,{children:["brainstorm warmup ×",a.brainstorm_warmup_session_count]}),a.todo_ops_total>0&&(0,b.jsxs)(q,{children:[a.todo_ops_total," TodoWrite ops"]}),a.plan_mode_used&&(0,b.jsx)(q,{tone:"user",children:"Plan Mode used"})]})]}):null}function p({label:a,children:c}){return(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap",padding:"4px 0",fontSize:12},children:[(0,b.jsx)("span",{style:{minWidth:100,color:"var(--af-text-tertiary)",fontWeight:500,fontSize:11,textTransform:"uppercase",letterSpacing:"0.04em"},children:a}),(0,b.jsx)("div",{style:{display:"flex",gap:6,flexWrap:"wrap",flex:1},children:c})]})}function q({children:a,tone:c,title:d}){return(0,b.jsx)("span",{title:d,style:{display:"inline-flex",alignItems:"center",padding:"2px 8px",borderRadius:999,fontSize:11,fontFamily:"var(--font-mono)",background:"user"===c?"var(--af-accent-subtle)":"var(--af-border-subtle)",color:"user"===c?"var(--af-accent)":"var(--af-text-secondary)",whiteSpace:"nowrap",maxWidth:280,overflow:"hidden",textOverflow:"ellipsis"},children:a})}function r({entry:a}){let c=new Date(a.start_iso).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1}),d=Math.round(a.numbers.active_min),e=a.project.split("/").filter(Boolean).slice(-1)[0]??a.project,f=a.enrichment.outcome,h=a.enrichment.brief_summary;return(0,b.jsxs)("a",{href:`/sessions/${a.session_id}`,style:{display:"block",padding:"8px 0",borderBottom:"1px solid var(--af-border-subtle)",fontSize:13,color:"var(--af-text)",textDecoration:"none"},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10},children:[(0,b.jsx)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,color:"var(--af-text-tertiary)",width:48},children:c}),(0,b.jsx)("span",{style:{fontSize:11,color:"var(--af-text-tertiary)",minWidth:110,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),(0,b.jsxs)("span",{style:{fontSize:11,fontFamily:"var(--font-mono)",color:"var(--af-text-tertiary)",width:40,textAlign:"right"},children:[d,"m"]}),f&&(0,b.jsx)(g.OutcomePill,{outcome:f,size:"sm",label:"text",agent:a.agent})]}),h&&(0,b.jsx)("div",{style:{marginTop:3,marginLeft:58,fontSize:13,color:"var(--af-text-secondary)",lineHeight:1.45,maxWidth:820},children:h})]})}function s({initial:a,entries:d,date:e,aiEnabled:f}){let[g,h]=(0,c.useState)(a),[i,j]=(0,c.useState)("idle"),[l,m]=(0,c.useState)(""),n=(0,c.useCallback)(async(a=!1)=>{j("streaming"),m("Starting...");let b=`/api/digest/day/${e}${a?"?force=1":""}`,c=await fetch(b,{method:"POST"});if(!c.ok||!c.body){j("error"),m(`Error ${c.status}`);return}let d=c.body.getReader(),f=new TextDecoder,g="";for(;;){let{done:a,value:b}=await d.read();if(a)break;let c=(g+=f.decode(b,{stream:!0})).split("\n\n");for(let a of(g=c.pop()??"",c)){let b=a.split("\n").find(a=>a.startsWith("data: "));if(b)try{let a=JSON.parse(b.slice(6));if("status"===a.type)m(a.text);else if("entry"===a.type)m(`Enriching ${a.index}/${a.total}${a.cost_usd?` \xb7 $${a.cost_usd.toFixed(4)}`:""}...`);else if("progress"===a.type){let b=Math.round(a.elapsed_ms/1e3),c=(a.bytes/1024).toFixed(1);m(`Claude composing… ${a.bytes.toLocaleString()} chars (${c} KB \xb7 ${b}s)`)}else if("digest"===a.type)h(a.digest),m("Rendering...");else if("saved"===a.type)m("Saved.");else if("error"===a.type){j("error"),m(a.message);return}}catch{}}}j("done"),m("")},[e]),o="streaming"===i,p=!!g?.headline,q=(0,c.useMemo)(()=>0!==d.length&&d.every(a=>"skipped_trivial"===a.enrichment.status),[d]),r=0===d.length,t=null;return(r||q||(t=r||q||p?(0,b.jsxs)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)",display:"inline-flex",alignItems:"center",gap:6},children:["✓ Up to date",(0,b.jsx)("button",{onClick:()=>n(!0),disabled:o,title:"Re-roll the narrative without re-enriching capsules",style:{padding:"2px 7px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:4,fontSize:10,color:"var(--af-text-secondary)",cursor:o?"default":"pointer",opacity:o?.6:1},children:o?"...":"Re-roll"})]}):(0,b.jsx)("button",{onClick:()=>n(!1),disabled:o,style:{padding:"4px 10px",background:"var(--af-accent)",color:"white",border:"none",borderRadius:5,cursor:o?"default":"pointer",fontSize:11,fontWeight:600,opacity:o?.6:1},children:o?"Generating...":g?"Generate (catch up)":"Generate digest"}),l&&(t=(0,b.jsxs)(b.Fragment,{children:[t,(0,b.jsx)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)"},children:l})]}))),g)?(0,b.jsx)(k,{digest:g,entries:d,aiEnabled:f,actions:t}):(0,b.jsxs)(b.Fragment,{children:[t&&(0,b.jsx)("div",{style:{display:"flex",gap:10,padding:"14px 40px 0",alignItems:"center",flexWrap:"wrap"},children:t}),r?(0,b.jsx)("div",{style:{padding:28,textAlign:"center",color:"var(--af-text-tertiary)",fontSize:13},children:"No entries on this day."}):q?(0,b.jsx)("div",{style:{padding:28,textAlign:"center",color:"var(--af-text-tertiary)",fontSize:13},children:"💤 Warm-up only — every session was under a minute. No narrative needed."}):(0,b.jsx)("div",{style:{padding:28,textAlign:"center",color:"var(--af-text-secondary)",fontSize:13},children:"No digest generated yet — click Generate above."})]})}var t=a.i(38246);a.i(99417);var u=a.i(12544),v=a.i(3444),w=a.i(2405);let x=["rgba(45, 212, 191, 0.75)","rgba(167, 139, 250, 0.75)","rgba(248, 113, 113, 0.75)","rgba(52, 211, 153, 0.75)","rgba(251, 191, 36, 0.75)","rgba(236, 72, 153, 0.75)","rgba(34, 211, 238, 0.75)","rgba(168, 85, 247, 0.75)","rgba(244, 114, 82, 0.75)","rgba(96, 165, 250, 0.75)"];function y(a){let b=0;for(let c=0;c<a.length;c++)b=(b<<5)-b+a.charCodeAt(c)|0;return x[Math.abs(b)%x.length]}function z(a){return y((0,u.canonicalProjectName)(a.projectName))}function A(a){return a.replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim()}function B(a){let b=new Date(a);return`${b.getHours().toString().padStart(2,"0")}:${b.getMinutes().toString().padStart(2,"0")}`}function C({onClose:a}){return(0,c.useEffect)(()=>{let b=b=>{"Escape"===b.key&&a()};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[a]),(0,b.jsx)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"concurrency-modal-title",onClick:a,style:{position:"fixed",inset:0,zIndex:200,background:"rgba(0, 0, 0, 0.5)",backdropFilter:"blur(4px)",WebkitBackdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",padding:20},children:(0,b.jsxs)("div",{onClick:a=>a.stopPropagation(),style:{background:"var(--af-surface-elevated)",border:"1px solid var(--af-border-subtle)",borderRadius:12,maxWidth:560,width:"100%",maxHeight:"85vh",overflow:"auto",boxShadow:"0 16px 48px rgba(0, 0, 0, 0.3)"},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"18px 22px",borderBottom:"1px solid var(--af-border-subtle)"},children:[(0,b.jsx)("h2",{id:"concurrency-modal-title",style:{margin:0,fontSize:16,fontWeight:700,letterSpacing:"-0.01em"},children:"How concurrency is measured"}),(0,b.jsx)("button",{type:"button",onClick:a,"aria-label":"Close",style:{background:"transparent",border:"none",color:"var(--af-text-tertiary)",fontSize:22,lineHeight:1,cursor:"pointer",padding:0,width:28,height:28},children:"×"})]}),(0,b.jsxs)("div",{style:{padding:"18px 22px",fontSize:13,color:"var(--af-text-secondary)",lineHeight:1.55},children:[(0,b.jsxs)("p",{style:{margin:"0 0 14px"},children:["A ",(0,b.jsx)("strong",{style:{color:"var(--af-text)"},children:"concurrency burst"})," ","is a window of time when two or more Claude Code sessions were actively working in parallel. The goal is to surface moments when you were running a multi-agent fleet — not every accidental tab overlap."]}),(0,b.jsx)("h3",{style:{margin:"18px 0 8px",fontSize:12,fontWeight:700,color:"var(--af-text)",textTransform:"uppercase",letterSpacing:"0.04em"},children:'1. What counts as "active"'}),(0,b.jsxs)("p",{style:{margin:"0 0 6px"},children:["Each session's events are split into"," ",(0,b.jsx)("strong",{style:{color:"var(--af-text)"},children:"active segments"})," — stretches of time where no gap between consecutive events exceeds"," ",(0,b.jsx)("strong",{style:{color:"var(--af-text)"},children:"3 minutes"}),". Any longer gap (walked away, laptop closed, thinking) splits the session into separate segments."]}),(0,b.jsx)("p",{style:{margin:"0 0 6px",fontSize:12,color:"var(--af-text-tertiary)"},children:'This is the same definition used for the "active time" metric on the dashboard, so numbers stay consistent.'}),(0,b.jsx)("h3",{style:{margin:"18px 0 8px",fontSize:12,fontWeight:700,color:"var(--af-text)",textTransform:"uppercase",letterSpacing:"0.04em"},children:"2. Detecting overlap"}),(0,b.jsxs)("p",{style:{margin:"0 0 6px"},children:["A sweep-line walks every segment start/end across all sessions. Whenever the active count is ≥2, that stretch becomes a raw overlap. The ",(0,b.jsx)("strong",{style:{color:"var(--af-text)"},children:"peak"})," ","reported on each burst is the maximum active count reached anywhere inside it."]}),(0,b.jsx)("h3",{style:{margin:"18px 0 8px",fontSize:12,fontWeight:700,color:"var(--af-text)",textTransform:"uppercase",letterSpacing:"0.04em"},children:"3. Cleaning up noise"}),(0,b.jsx)("p",{style:{margin:"0 0 6px"},children:"Raw overlaps are noisy — a typical day produces dozens of sub-minute artifacts from switching between sessions. Two rules collapse them into human-readable bursts:"}),(0,b.jsxs)("ul",{style:{margin:"6px 0 0 0",paddingLeft:22},children:[(0,b.jsxs)("li",{style:{marginBottom:4},children:[(0,b.jsx)("strong",{style:{color:"var(--af-text)"},children:"Drop under 1 minute"})," — overlaps shorter than that are almost always tab-switch artifacts, not real parallel work."]}),(0,b.jsxs)("li",{children:[(0,b.jsx)("strong",{style:{color:"var(--af-text)"},children:"Merge within 10 minutes"})," — two overlaps separated by less than 10 minutes of idle time fuse into a single burst. A morning of back-and-forth agent work becomes one burst, not forty."]})]}),(0,b.jsx)("h3",{style:{margin:"18px 0 8px",fontSize:12,fontWeight:700,color:"var(--af-text)",textTransform:"uppercase",letterSpacing:"0.04em"},children:"4. Same-project vs cross-project"}),(0,b.jsxs)("p",{style:{margin:"0 0 6px"},children:["Bursts are colored by whether the involved sessions span more than one project directory."," ",(0,b.jsx)("span",{style:{color:"rgba(167, 139, 250, 1)",fontWeight:600},children:"Purple = cross-project"})," ","— different repos running at once, usually genuine fleet work."," ",(0,b.jsx)("span",{style:{color:"rgba(45, 212, 191, 1)",fontWeight:600},children:"Teal = same-project"})," ","— multiple sessions in one repo, usually context-switching inside a single task."]}),(0,b.jsx)("h3",{style:{margin:"18px 0 8px",fontSize:12,fontWeight:700,color:"var(--af-text)",textTransform:"uppercase",letterSpacing:"0.04em"},children:"Why bursts, not runs"}),(0,b.jsx)("p",{style:{margin:"0 0 6px"},children:'An earlier version reported every raw overlap as a separate "parallel run". On a busy day that produced 40–80 entries, most of them seconds long, most of them meaningless. Bursts are the unit humans actually think in: "this morning I was running 3 agents at once for about 20 minutes."'})]})]})})}function D({burst:a,gantt:d,sessionEntries:e,onClose:f,onShowInTimeline:h}){(0,c.useEffect)(()=>{let a=a=>{"Escape"===a.key&&f()};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[f]);let[i,j]=(0,c.useState)(null),k=(0,c.useRef)(new Map),l=(0,c.useMemo)(()=>{let a=new Map;for(let b of d.sessions)a.set(b.id,b);return a},[d]),m=a.sessionIds.map(a=>l.get(a)).filter(a=>!!a);m.sort((a,b)=>a.startMs-b.startMs);let n=a=>{j(a);let b=k.current.get(a);b&&b.scrollIntoView({behavior:"smooth",block:"center"})},o=Math.min(a.startMs,...m.map(a=>a.startMs)),p=Math.max(a.endMs,...m.map(a=>a.endMs)),q=o-9e5,r=p+9e5,s=r-q,u=22+(25*m.length-3)+6,w=a=>(a-q)/s*510,x=[];{let a=new Date(q);for(a.setMinutes(0,0,0),a.getTime()<q&&a.setHours(a.getHours()+1);a.getTime()<=r;)x.push(a.getTime()),a.setHours(a.getHours()+1)}let y=w(a.startMs),C=w(a.endMs),E=a.endMs-a.startMs;return(0,b.jsx)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"burst-detail-title",onClick:f,style:{position:"fixed",inset:0,zIndex:200,background:"rgba(0, 0, 0, 0.55)",backdropFilter:"blur(4px)",WebkitBackdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",padding:20},children:(0,b.jsxs)("div",{onClick:a=>a.stopPropagation(),style:{background:"var(--af-surface-elevated)",border:"1px solid var(--af-border-subtle)",borderRadius:12,width:"min(720px, 100%)",maxHeight:"90vh",display:"flex",flexDirection:"column",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.4)"},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,padding:"16px 22px",borderBottom:"1px solid var(--af-border-subtle)"},children:[(0,b.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:4},children:[(0,b.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",padding:"3px 10px",borderRadius:10,fontFamily:"var(--font-mono)",fontSize:11,fontWeight:700,color:"white",background:a.crossProject?"rgba(167, 139, 250, 0.95)":"rgba(45, 212, 191, 0.95)"},children:["×",a.peak," peak"]}),a.crossProject&&(0,b.jsx)("span",{style:{fontSize:9,color:"rgba(167, 139, 250, 1)",textTransform:"uppercase",letterSpacing:"0.05em",fontWeight:700},children:"cross-project"})]}),(0,b.jsxs)("h2",{id:"burst-detail-title",style:{margin:0,fontSize:16,fontWeight:700,letterSpacing:"-0.01em",display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[(0,b.jsxs)("span",{style:{fontFamily:"var(--font-mono)"},children:[B(a.startMs),"–",B(a.endMs)]}),(0,b.jsx)("span",{style:{fontSize:12,fontWeight:400,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},children:(0,v.formatDuration)(E)}),(0,b.jsxs)("span",{style:{fontSize:12,fontWeight:400,color:"var(--af-text-tertiary)"},children:["· ",m.length," session",1===m.length?"":"s"]})]})]}),(0,b.jsx)("button",{type:"button",onClick:h,style:{padding:"6px 12px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:11,color:"var(--af-text-secondary)",cursor:"pointer",fontWeight:500,whiteSpace:"nowrap"},title:"Pin this burst on the main timeline and close",children:"Show in timeline →"}),(0,b.jsx)("button",{type:"button",onClick:f,"aria-label":"Close",style:{background:"transparent",border:"none",color:"var(--af-text-tertiary)",fontSize:24,lineHeight:1,cursor:"pointer",padding:0,width:28,height:28},children:"×"})]}),(0,b.jsxs)("div",{style:{overflow:"auto",padding:"18px 22px"},children:[(0,b.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.05em",marginBottom:8,fontWeight:600},children:"Timeline (shaded = burst window)"}),(0,b.jsx)("div",{style:{background:"var(--af-surface)",border:"1px solid var(--af-border-subtle)",borderRadius:8,padding:"8px 10px",overflow:"auto"},children:(0,b.jsxs)("svg",{width:534,height:u,style:{display:"block"},children:[m.map((a,c)=>{let d=22+25*c+11,e=z(a),f=i===a.id;return(0,b.jsxs)("g",{onClick:()=>n(a.id),style:{cursor:"pointer"},children:[(0,b.jsx)("title",{children:`Track ${c+1} — click to focus in list below`}),(0,b.jsx)("circle",{cx:12,cy:d,r:9,fill:f?e:"var(--af-surface-elevated)",stroke:e,strokeWidth:f?2:1.5}),(0,b.jsx)("text",{x:12,y:d+3.5,textAnchor:"middle",fontSize:10,fontWeight:700,fill:f?"#fff":"var(--af-text)",style:{pointerEvents:"none"},children:c+1})]},`num-${a.id}`)}),(0,b.jsxs)("g",{transform:"translate(24, 0)",children:[(0,b.jsx)("rect",{x:y,y:0,width:Math.max(C-y,2),height:u,fill:a.crossProject?"rgba(167, 139, 250, 0.14)":"rgba(45, 212, 191, 0.14)"}),(0,b.jsx)("line",{x1:y,x2:y,y1:0,y2:u,stroke:a.crossProject?"rgba(167, 139, 250, 0.7)":"rgba(45, 212, 191, 0.7)",strokeWidth:1,strokeDasharray:"3 2"}),(0,b.jsx)("line",{x1:C,x2:C,y1:0,y2:u,stroke:a.crossProject?"rgba(167, 139, 250, 0.7)":"rgba(45, 212, 191, 0.7)",strokeWidth:1,strokeDasharray:"3 2"}),x.map(a=>{let c=w(a);return(0,b.jsxs)("g",{children:[(0,b.jsx)("line",{x1:c,x2:c,y1:22,y2:u,stroke:"var(--af-border-subtle)",strokeWidth:.5,strokeDasharray:"2 3"}),(0,b.jsx)("text",{x:c,y:16,textAnchor:"middle",fontSize:9,fill:"var(--af-text-tertiary)",children:B(a)})]},`mini-hm-${a}`)}),m.map((a,c)=>{let d=22+25*c,e=z(a),f=i===a.id;return(0,b.jsxs)("g",{children:[(0,b.jsx)("rect",{x:0,y:d,width:510,height:22,fill:f?"rgba(255,255,255,0.05)":"transparent",onClick:()=>n(a.id),style:{cursor:"pointer"}}),a.segments.map((a,c)=>{let g=w(a.startMs),h=Math.max(w(a.endMs)-g,2);return(0,b.jsx)("rect",{x:g,y:d+3,width:h,height:16,fill:e,rx:2,stroke:f?"var(--af-text)":"none",strokeWidth:+!!f,style:{pointerEvents:"none"}},`mini-seg-${c}`)})]},`mini-row-${a.id}`)})]})]})}),(0,b.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.05em",margin:"18px 0 8px",fontWeight:600},children:"Sessions in this burst"}),(0,b.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:m.map((c,d)=>{let f,h,j,l=z(c),m=(b=>{let c=0;for(let d of b.segments){let b=Math.max(d.startMs,a.startMs),e=Math.min(d.endMs,a.endMs);e>b&&(c+=e-b)}return c})(c),n=E>0?Math.round(m/E*100):0,o=i===c.id;return(0,b.jsx)(t.default,{href:`/sessions/${c.id}`,ref:a=>{a?k.current.set(c.id,a):k.current.delete(c.id)},style:{display:"block",padding:"11px 14px",background:o?"var(--af-surface-hover)":"var(--af-surface)",border:o?"1px solid var(--af-text-tertiary)":"1px solid var(--af-border-subtle)",borderLeft:`3px solid ${l}`,borderRadius:8,textDecoration:"none",color:"var(--af-text)",fontSize:12,lineHeight:1.45,transition:"background 0.15s, border-color 0.15s",boxShadow:o?`0 0 0 2px ${l}`:"none"},children:(0,b.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:10},children:[(0,b.jsx)("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:20,height:20,borderRadius:"50%",background:o?l:"transparent",border:`1.5px solid ${l}`,color:o?"#fff":"var(--af-text)",fontSize:10,fontWeight:700,flexShrink:0,marginTop:2},"aria-label":`Track ${d+1}`,children:d+1}),(0,b.jsxs)("div",{style:{minWidth:0,flex:1},children:[(0,b.jsx)("div",{style:{fontSize:11,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",marginBottom:3,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:(0,v.prettyProjectName)(c.projectName),children:(h=(f=(0,v.prettyProjectName)(c.projectName)).split("/").filter(Boolean)).length>2?"…/"+h.slice(-2).join("/"):f}),(0,b.jsx)("div",{style:{fontWeight:500,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:A(c.firstUserPreview??""),children:A(c.firstUserPreview??"")||(0,b.jsx)("em",{style:{color:"var(--af-text-tertiary)"},children:"(no user message)"})}),c.lastAgentPreview&&(0,b.jsxs)("div",{style:{fontSize:11,color:"var(--af-text-secondary)",marginTop:3,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontStyle:"italic"},title:A(c.lastAgentPreview),children:["↳ ",A(c.lastAgentPreview)]})]}),(0,b.jsxs)("div",{style:{fontFamily:"var(--font-mono)",fontSize:10,color:"var(--af-text-tertiary)",textAlign:"right",whiteSpace:"nowrap",flexShrink:0,display:"flex",flexDirection:"column",alignItems:"flex-end",gap:4},children:[(j=e[c.id],j?.outcome?(0,b.jsx)(g.OutcomePill,{outcome:j.outcome,size:"sm",label:"text",agent:c.agent}):null),(0,b.jsxs)("div",{style:{color:"var(--af-text-secondary)"},children:[(0,v.formatDuration)(m)," ",(0,b.jsxs)("span",{style:{opacity:.6},children:["(",n,"%)"]})]}),(0,b.jsx)("div",{style:{fontSize:9,marginTop:2},children:"in burst"})]})]})},`burst-session-${c.id}`)})})]})]})})}function E({gantt:a,bursts:d=[],sessionEntries:e={}}){let f,h=a.date,[i,j]=(0,c.useState)(null),[k,l]=(0,c.useState)(null),[m,n]=(0,c.useState)(null),[o,p]=(0,c.useState)(!1),[q,r]=(0,c.useState)(null),[s,x]=(0,c.useState)(!1),F=(0,c.useRef)(null),G=m??k,H=(0,c.useMemo)(()=>{if(null===G)return null;let a=d[G];return a?new Set(a.sessionIds):null},[G,d]),I=(0,c.useMemo)(()=>{let b=new Map;for(let c of a.sessions){let a=(0,u.canonicalProjectName)(c.projectName),d=b.get(a);d?d.count++:b.set(a,{name:(0,v.prettyProjectName)(a),color:y(a),count:1})}return Array.from(b.values()).sort((a,b)=>b.count-a.count)},[a.sessions]),{rangeStartMs:J,rangeEndMs:K,hourMarks:L}=(0,c.useMemo)(()=>{if(0===a.sessions.length)return{rangeStartMs:a.dayStartMs,rangeEndMs:a.dayEndMs,hourMarks:[]};let b=1/0,c=-1/0;for(let d of a.sessions)for(let a of d.segments)a.startMs<b&&(b=a.startMs),a.endMs>c&&(c=a.endMs);let d=c+18e5,e=new Date(b-18e5);e.setMinutes(0,0,0);let f=new Date(d);f.setMinutes(0,0,0),f.setHours(f.getHours()+1);let g=Math.max(e.getTime(),a.dayStartMs),h=Math.min(f.getTime(),a.dayEndMs),i=[],j=new Date(g);for(j.setMinutes(0,0,0),j.getTime()<g&&j.setHours(j.getHours()+1);j.getTime()<=h;)i.push(j.getTime()),j.setHours(j.getHours()+1);return{rangeStartMs:g,rangeEndMs:h,hourMarks:i}},[a]),M=K-J,N=Math.max(700,Math.ceil(M/36e5*80)),O=33*a.sessions.length+3+8,P=a=>(a-J)/M*N,Q="var(--af-surface)",R=s?d:d.slice(0,3),S=d.length-R.length;return(0,b.jsxs)(b.Fragment,{children:[d.length>0&&(0,b.jsxs)("div",{className:"af-panel",style:{marginBottom:16},children:[(0,b.jsxs)("div",{className:"af-panel-header",children:[(0,b.jsx)("span",{children:"Concurrency"}),(0,b.jsx)("span",{style:{fontSize:11,color:"var(--af-text-tertiary)",fontWeight:400},children:"periods when ≥2 agents were actively working at once"}),(0,b.jsxs)("button",{type:"button",onClick:()=>p(!0),"aria-label":"How concurrency is detected",style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",gap:5,padding:"3px 9px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:100,fontSize:10,color:"var(--af-text-tertiary)",cursor:"pointer",fontWeight:500},children:[(0,b.jsx)("span",{style:{fontSize:11,lineHeight:1},children:"ⓘ"}),"How this is measured"]})]}),(0,b.jsxs)("div",{children:[R.map((c,d)=>{let e=m===d,f=k===d,g=c.projectDirs.map(b=>{let c=a.sessions.find(a=>a.projectDir===b);return c?(0,v.prettyProjectName)(c.projectName):b}).map(a=>{let b=a.split("/").filter(Boolean);return b.length>2?"…/"+b.slice(-2).join("/"):a});return(0,b.jsxs)("div",{onMouseEnter:()=>l(d),onMouseLeave:()=>l(null),onClick:()=>r(d),style:{display:"grid",gridTemplateColumns:"auto auto auto 1fr auto",gap:14,padding:"10px 18px",fontSize:12,borderBottom:"1px solid var(--af-border-subtle)",cursor:"pointer",background:e||f?"var(--af-surface-hover)":"transparent",alignItems:"center",transition:"background 0.12s"},title:"Open burst detail",children:[(0,b.jsxs)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,color:"var(--af-text-secondary)",minWidth:110},children:[B(c.startMs),"–",B(c.endMs)]}),(0,b.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",padding:"2px 8px",borderRadius:10,fontFamily:"var(--font-mono)",fontSize:10,fontWeight:700,color:"white",background:c.crossProject?"rgba(167, 139, 250, 0.9)":"rgba(45, 212, 191, 0.9)",minWidth:28,justifyContent:"center"},children:["×",c.peak]}),c.crossProject?(0,b.jsx)("span",{style:{fontSize:9,color:"rgba(167, 139, 250, 1)",textTransform:"uppercase",letterSpacing:"0.04em",fontWeight:600},children:"cross-project"}):(0,b.jsx)("span",{}),(0,b.jsx)("span",{style:{fontSize:11,color:"var(--af-text-tertiary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:g.join(", "),children:g.join(" · ")}),(0,b.jsx)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,color:"var(--af-text-secondary)",minWidth:60,textAlign:"right"},children:(0,v.formatDuration)(c.endMs-c.startMs)})]},`burst-row-${d}`)}),d.length>3&&(0,b.jsx)("button",{type:"button",onClick:()=>x(a=>!a),style:{width:"100%",padding:"10px 18px",background:"transparent",border:"none",borderTop:"1px solid var(--af-border-subtle)",fontSize:11,color:"var(--af-text-secondary)",cursor:"pointer",fontWeight:500,textAlign:"center"},children:s?"Show fewer (first 3) ↑":`Show all ${d.length} bursts (+${S} more) ↓`})]})]}),(0,b.jsxs)("div",{className:"af-panel",style:{overflow:"hidden"},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,padding:"10px 16px",borderBottom:"1px solid var(--af-border-subtle)",fontSize:11,color:"var(--af-text-secondary)",flexWrap:"wrap"},children:[I.map(a=>{let c=a.name.split("/").filter(Boolean),d=c.length>2?"…/"+c.slice(-2).join("/"):a.name;return(0,b.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:5,cursor:"default"},title:`${a.name} — ${a.count} session${1===a.count?"":"s"} on this day`,children:[(0,b.jsx)("span",{style:{width:8,height:8,borderRadius:2,background:a.color,flexShrink:0}}),(0,b.jsx)("span",{style:{maxWidth:160,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d}),(0,b.jsxs)("span",{style:{color:"var(--af-text-tertiary)",fontSize:10},children:["(",a.count,")"]})]},a.name)}),(0,b.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:5,marginLeft:8,color:"var(--af-text-tertiary)",cursor:"default"},title:"Idle gap — the session was open but the agent was not actively working (gap > 3 minutes between events)",children:[(0,b.jsx)("span",{style:{width:16,height:8,borderRadius:2,background:"repeating-linear-gradient(45deg, var(--af-surface-hover), var(--af-surface-hover) 2px, var(--af-border-subtle) 2px, var(--af-border-subtle) 4px)",flexShrink:0}}),"idle"]})]}),(0,b.jsxs)("div",{ref:F,style:{overflow:"auto",maxHeight:"calc(100vh - 240px)",position:"relative"},onMouseLeave:()=>j(null),children:[(0,b.jsxs)("div",{style:{display:"grid",gridTemplateColumns:`220px ${N}px`,gridTemplateRows:`50px ${O}px`,width:220+N},children:[(0,b.jsxs)("div",{style:{position:"sticky",top:0,left:0,zIndex:3,background:Q,borderBottom:"1px solid var(--af-border-subtle)",borderRight:"1px solid var(--af-border-subtle)",display:"flex",flexDirection:"column"},children:[(0,b.jsx)("div",{style:{height:24,display:"flex",alignItems:"center",justifyContent:"flex-end",padding:"0 10px",fontSize:9,color:"var(--af-text-tertiary)",letterSpacing:"0.04em",textTransform:"uppercase",fontWeight:600},children:d.length>0?"Concurrency":""}),(0,b.jsx)("div",{style:{height:26}})]}),(0,b.jsxs)("div",{style:{position:"sticky",top:0,zIndex:2,background:Q,borderBottom:"1px solid var(--af-border-subtle)"},children:[(0,b.jsx)("svg",{width:N,height:24,style:{display:"block"},children:d.map((a,c)=>{let d=P(a.startMs),e=P(a.endMs)-d,f=Math.max(e,26),g=e<26?d+e/2-13:d,h=G===c,i=null!==G&&!h,j=a.crossProject?"rgba(167, 139, 250, 0.9)":"rgba(45, 212, 191, 0.9)";return(0,b.jsxs)("g",{children:[(0,b.jsx)("rect",{x:g,y:4,width:f,height:14,fill:j,rx:4,opacity:i?.3:1,stroke:m===c?"var(--af-text)":k===c?"var(--af-text-secondary)":"none",strokeWidth:m===c?1.5:1,style:{cursor:"pointer",transition:"opacity 0.12s"},onMouseEnter:()=>l(c),onMouseLeave:()=>l(null),onClick:()=>r(c),children:(0,b.jsx)("title",{children:`\xd7${a.peak} ${a.crossProject?"cross-project":"same-project"} \xb7 ${B(a.startMs)}–${B(a.endMs)} \xb7 ${(0,v.formatDuration)(a.endMs-a.startMs)} — click for detail`})}),(0,b.jsxs)("text",{x:g+f/2,y:15,textAnchor:"middle",fontSize:9,fontWeight:700,fill:"white",opacity:i?.3:1,style:{pointerEvents:"none"},children:["×",a.peak]})]},`burst-${c}`)})}),(0,b.jsx)("svg",{width:N,height:26,style:{display:"block"},children:L.map(a=>{let c=P(a),d=new Date(a).getHours()%3==0;return(0,b.jsx)("text",{x:c,y:18,textAnchor:"middle",fontSize:10,fill:d?"var(--af-text-secondary)":"var(--af-text-tertiary)",fontWeight:d?600:400,children:B(a)},a)})})]}),(0,b.jsx)("div",{style:{position:"sticky",left:0,zIndex:1,background:Q,borderRight:"1px solid var(--af-border-subtle)"},children:(0,b.jsx)("div",{style:{paddingTop:3},children:a.sessions.map((a,c)=>{let d=z(a),e=a.firstUserPreview?A(a.firstUserPreview).slice(0,45):(0,v.prettyProjectName)(a.projectName),f=(0,v.prettyProjectName)(a.projectName),g=null!==H&&!H.has(a.id);return(0,b.jsxs)("div",{style:{height:30,marginBottom:3,display:"flex",alignItems:"center",gap:6,padding:"0 8px 0 6px",background:c%2==1?"var(--af-surface-hover)":"transparent",opacity:g?.3:1,transition:"opacity 0.12s"},children:[(0,b.jsx)("span",{style:{width:6,height:6,borderRadius:2,background:d,flexShrink:0}}),(0,b.jsx)(w.AgentIcon,{agent:a.agent,size:11}),(0,b.jsx)(t.default,{href:`/sessions/${a.id}?day=${h}`,style:{fontSize:10.5,color:"var(--af-text)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",lineHeight:1.2,textDecoration:"none"},title:`${A(a.firstUserPreview??"")} — ${f}`,children:e})]},`label-${a.id}-${c}`)})})}),(0,b.jsx)("div",{children:(0,b.jsxs)("svg",{width:N,height:O,style:{display:"block"},children:[(0,b.jsx)("defs",{children:(0,b.jsxs)("pattern",{id:"gantt-idle-stripes",patternUnits:"userSpaceOnUse",width:"6",height:"6",patternTransform:"rotate(45)",children:[(0,b.jsx)("rect",{width:"6",height:"6",fill:"var(--af-surface-hover)"}),(0,b.jsx)("line",{x1:"0",y1:"0",x2:"0",y2:"6",stroke:"var(--af-border-subtle)",strokeWidth:"1.5"})]})}),L.map(a=>{let c=P(a),d=new Date(a).getHours()%3==0;return(0,b.jsx)("line",{x1:c,y1:0,x2:c,y2:O,stroke:"var(--af-border-subtle)",strokeWidth:d?.8:.4,strokeDasharray:d?void 0:"2 4"},a)}),a.sessions.map((a,c)=>{let d=33*c+3,e=z(a),f=null!==H&&!H.has(a.id);return(0,b.jsxs)("g",{opacity:f?.25:1,style:{transition:"opacity 0.12s"},children:[c%2==1&&(0,b.jsx)("rect",{x:0,y:d,width:N,height:30,fill:"var(--af-surface-hover)",opacity:.25}),a.segments.map((c,f)=>{let g=P(c.startMs),h=Math.max(P(c.endMs)-g,4);return(0,b.jsx)("rect",{x:g,y:d+5,width:h,height:20,fill:e,rx:3,style:{cursor:"pointer"},onMouseEnter:b=>{let c=b.currentTarget.closest("svg").getBoundingClientRect();j({session:a,x:b.clientX-c.left+220,y:d+30+24+26+4})}},f)}),a.segments.length>1&&a.segments.slice(0,-1).map((c,e)=>{let f=a.segments[e+1],g=P(c.endMs),h=P(f.startMs);return h-g<4?null:(0,b.jsx)("rect",{x:g+1,y:d+7,width:h-g-2,height:16,fill:"url(#gantt-idle-stripes)",rx:2,opacity:.7},`idle-${e}`)}),(0,b.jsxs)("text",{x:Math.min(P(a.endMs)+8,N-100),y:d+15+3.5,fontSize:9,fill:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",children:[(0,v.formatDuration)(a.activeMs)," · ",B(a.startMs),"–",B(a.endMs)]})]},`row-${a.id}-${c}`)})]})})]}),i&&(0,b.jsxs)("div",{style:{position:"absolute",left:Math.max(8,Math.min(i.x,220+N-340)),top:Math.min(i.y,50+O-100),zIndex:50,background:"var(--af-surface-elevated)",border:"1px solid var(--af-border-subtle)",borderRadius:8,padding:"10px 14px",fontSize:11,color:"var(--af-text)",pointerEvents:"none",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",maxWidth:340,lineHeight:1.45},children:[(f=e[i.session.id])?f.outcome?(0,b.jsx)("div",{style:{marginBottom:6},children:(0,b.jsx)(g.OutcomePill,{outcome:f.outcome,size:"sm",agent:i.session.agent})}):"done"!==f.enrichmentStatus&&"skipped_trivial"!==f.enrichmentStatus?(0,b.jsx)("div",{style:{marginBottom:6},children:(0,b.jsx)(g.OutcomePill,{outcome:null,pending:!0,sessionId:i.session.id,localDay:f.localDay,size:"sm",agent:i.session.agent})}):null:null,(0,b.jsx)("div",{style:{fontWeight:600,marginBottom:4},children:e[i.session.id]?.briefSummary||A(i.session.firstUserPreview??"").slice(0,100)||(0,v.prettyProjectName)(i.session.projectName)}),(0,b.jsxs)("div",{style:{fontSize:10,color:"var(--af-text-secondary)",marginBottom:6,fontFamily:"var(--font-mono)"},children:[(0,v.prettyProjectName)(i.session.projectName),i.session.model&&` \xb7 ${i.session.model}`]}),(0,b.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"3px 12px",fontSize:10,color:"var(--af-text-secondary)"},children:[(0,b.jsxs)("span",{children:["Active: ",(0,b.jsx)("strong",{children:(0,v.formatDuration)(i.session.activeMs)})]}),(0,b.jsxs)("span",{children:["Segments: ",i.session.segments.length]}),(0,b.jsxs)("span",{children:["Range: ",B(i.session.startMs),"–",B(i.session.endMs)]}),(0,b.jsxs)("span",{children:["Tokens:"," ",(0,v.formatTokens)(i.session.totalUsage.input+i.session.totalUsage.cacheRead+i.session.totalUsage.cacheWrite),"/",(0,v.formatTokens)(i.session.totalUsage.output)]})]})]})]})]}),o&&(0,b.jsx)(C,{onClose:()=>p(!1)}),null!==q&&d[q]&&(0,b.jsx)(D,{burst:d[q],gantt:a,sessionEntries:e,onClose:()=>r(null),onShowInTimeline:()=>{r(null),null!==q&&(a=>{n(b=>b===a?null:a);let b=d[a],c=F.current;if(!b||!c)return;let e=220+(P(b.startMs)+P(b.endMs))/2-c.clientWidth/2;c.scrollTo({left:Math.max(0,e),behavior:"smooth"})})(q)}})]})}function F({open:a,onClose:d,rows:e,aiEnabled:f}){let[g,h]=(0,c.useState)(new Set),[i,j]=(0,c.useState)(!1),[k,l]=(0,c.useState)(!1);(0,c.useEffect)(()=>{if(!a)return;let b=a=>{"Escape"===a.key&&d()};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[a,d]);let m=async()=>{if(0===g.size)return;j(!0);let a=Array.from(g).sort().reverse();try{for(let b of a){let a=`/api/digest/day/${b}${k?"?force=1":""}`,c=await fetch(a,{method:"POST"});if(c.body){let a=c.body.getReader();for(;!(await a.read()).done;);}}}finally{j(!1),h(new Set)}};return a?(0,b.jsx)("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.4)",zIndex:200,display:"flex",justifyContent:"flex-end"},onClick:d,children:(0,b.jsxs)("div",{onClick:a=>a.stopPropagation(),style:{width:"min(440px, 100%)",height:"100%",background:"var(--af-surface-elevated)",borderLeft:"1px solid var(--af-border-subtle)",display:"flex",flexDirection:"column",boxShadow:"-12px 0 32px rgba(0,0,0,0.25)"},children:[(0,b.jsxs)("header",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 18px",borderBottom:"1px solid var(--af-border-subtle)"},children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{style:{fontSize:15,fontWeight:700,margin:0},children:"Backfill digests"}),(0,b.jsx)("p",{style:{fontSize:11,color:"var(--af-text-tertiary)",margin:"2px 0 0"},children:"Each selected day enqueues a job. You can close this drawer."})]}),(0,b.jsx)("button",{type:"button",onClick:d,"aria-label":"Close",style:{background:"transparent",border:"none",color:"var(--af-text-tertiary)",fontSize:22,cursor:"pointer"},children:"×"})]}),!f&&(0,b.jsx)("div",{style:{padding:12,margin:18,background:"rgba(237,137,54,0.1)",borderRadius:6,fontSize:12,color:"var(--af-text)"},children:"AI features are off — only deterministic digests will be written. Enable AI in Settings to generate narratives."}),(0,b.jsxs)("div",{style:{display:"flex",gap:6,padding:"10px 18px",borderBottom:"1px solid var(--af-border-subtle)",flexWrap:"wrap",fontSize:11},children:[(0,b.jsx)(G,{onClick:()=>h(new Set(e.filter(a=>"pending"===a.status).map(a=>a.date))),children:"Select pending"}),(0,b.jsx)(G,{onClick:()=>h(new Set(e.filter(a=>"empty"!==a.status).map(a=>a.date))),children:"Select all with entries"}),(0,b.jsx)(G,{onClick:()=>h(new Set),children:"Clear"}),(0,b.jsxs)("label",{style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",gap:4,fontSize:11,color:"var(--af-text-secondary)",cursor:"pointer"},children:[(0,b.jsx)("input",{type:"checkbox",checked:k,onChange:a=>l(a.target.checked)}),"force regen"]})]}),(0,b.jsx)("div",{style:{flex:1,overflowY:"auto"},children:e.map(a=>(0,b.jsxs)("label",{style:{display:"grid",gridTemplateColumns:"auto 110px 80px 1fr",gap:10,alignItems:"center",padding:"8px 18px",borderBottom:"1px solid var(--af-border-subtle)",fontSize:12,cursor:"empty"===a.status?"default":"pointer",opacity:"empty"===a.status?.5:1},children:[(0,b.jsx)("input",{type:"checkbox",disabled:"empty"===a.status,checked:g.has(a.date),onChange:()=>{var b;return b=a.date,void h(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})}}),(0,b.jsx)("span",{children:a.day_label}),(0,b.jsx)("span",{style:{fontSize:10,color:"generated"===a.status?"#48bb78":"pending"===a.status?"#ed8936":"var(--af-text-tertiary)"},children:"generated"===a.status?"✓ ready":"pending"===a.status?"• pending":"—"}),(0,b.jsxs)("span",{style:{fontFamily:"var(--font-mono)",fontSize:10,color:"var(--af-text-tertiary)",textAlign:"right"},children:[a.entry_count>0?`${a.entry_count} sess`:"",a.pr_count>0?` \xb7 ${a.pr_count} PR`:""]})]},a.date))}),(0,b.jsxs)("footer",{style:{padding:"12px 18px",borderTop:"1px solid var(--af-border-subtle)",display:"flex",gap:10,alignItems:"center"},children:[(0,b.jsxs)("span",{style:{fontSize:12,color:"var(--af-text-secondary)",flex:1},children:[g.size," day",1===g.size?"":"s"," selected"]}),(0,b.jsx)("button",{type:"button",onClick:d,style:{padding:"6px 12px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:12,cursor:"pointer"},children:"Cancel"}),(0,b.jsx)("button",{type:"button",onClick:m,disabled:i||0===g.size,style:{padding:"6px 14px",background:"var(--af-accent)",color:"white",border:"none",borderRadius:6,fontSize:12,fontWeight:600,cursor:i||0===g.size?"default":"pointer",opacity:i||0===g.size?.6:1},children:i?`Enqueueing… (${g.size})`:`Generate ${g.size}`})]})]})}):null}function G({onClick:a,children:c}){return(0,b.jsx)("button",{type:"button",onClick:a,style:{padding:"3px 10px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:5,fontSize:11,color:"var(--af-text-secondary)",cursor:"pointer"},children:c})}var H=a.i(50944);function I(a){if(a<6e4)return`${Math.round(a/1e3)}s`;let b=Math.round(a/6e4);if(b<60)return`${b}m`;let c=Math.floor(b/60),d=b%60;return d?`${c}h ${d}m`:`${c}h`}function J({date:a,today:d,prevDay:e,nextDay:f,dayStats:g,hrefForDate:h=a=>`/day/${a}`}){let i,j,k,l,m,n,o=(0,H.useRouter)(),[p,q]=(0,c.useState)(!1),[r,s]=(0,c.useMemo)(()=>{let[b,c]=a.split("-").map(Number);return[b,c]},[a]),[u,v]=(0,c.useState)(r),[w,x]=(0,c.useState)(s),[y,z]=(0,c.useState)(null),[A,B]=(0,c.useState)(null),C=(0,c.useMemo)(()=>{let a=new Map;for(let b of g)a.set(b.date,b);return a},[g]),D=(0,c.useMemo)(()=>{let a=new Date(u,w-1,1).getDay(),b=new Date(u,w,0).getDate(),c=[];for(let b=0;b<a;b++)c.push(null);for(let a=1;a<=b;a++){let b=String(w).padStart(2,"0"),d=String(a).padStart(2,"0");c.push(`${u}-${b}-${d}`)}return c},[u,w]),E=(0,c.useMemo)(()=>{let a=0;for(let b of g)b.airTimeMs>a&&(a=b.airTimeMs);return a},[g]),F=new Date(u,w-1).toLocaleString(void 0,{month:"long",year:"numeric"}),G=a=>{let b=w+a,c=u;b<1&&(b=12,c--),b>12&&(b=1,c++),x(b),v(c)};return(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap",position:"relative"},children:[e?(0,b.jsx)(t.default,{href:h(e),style:{padding:"5px 10px",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:11,color:"var(--af-text-secondary)"},children:"←"}):(0,b.jsx)("span",{style:{padding:"5px 10px",opacity:.3,fontSize:11,color:"var(--af-text-tertiary)"},children:"←"}),(0,b.jsx)("button",{type:"button",onClick:()=>{v(r),x(s),q(a=>!a)},style:{padding:"5px 12px",fontSize:12,fontFamily:"var(--font-mono)",border:"1px solid var(--af-border-subtle)",borderRadius:6,background:p?"var(--af-accent-subtle)":"transparent",color:p?"var(--af-accent)":"var(--af-text)",cursor:"pointer",fontWeight:500,minWidth:120,textAlign:"center"},children:a}),f?(0,b.jsx)(t.default,{href:h(f),style:{padding:"5px 10px",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:11,color:"var(--af-text-secondary)"},children:"→"}):(0,b.jsx)("span",{style:{padding:"5px 10px",opacity:.3,fontSize:11,color:"var(--af-text-tertiary)"},children:"→"}),(0,b.jsx)(t.default,{href:h(d),style:{padding:"5px 12px",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:11,color:a===d?"var(--af-accent)":"var(--af-text-secondary)",background:a===d?"var(--af-accent-subtle)":"transparent",fontWeight:500},children:"Today"}),p&&(0,b.jsxs)("div",{style:{position:"absolute",top:"calc(100% + 8px)",left:0,zIndex:60,background:"var(--af-surface)",border:"1px solid var(--af-border-subtle)",borderRadius:10,padding:"12px 14px",boxShadow:"0 8px 28px rgba(0,0,0,0.18)",minWidth:300},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:10},children:[(0,b.jsx)("button",{type:"button",onClick:()=>G(-1),style:{background:"transparent",border:"none",cursor:"pointer",color:"var(--af-text-secondary)",fontSize:14,padding:"2px 8px",borderRadius:4},children:"‹"}),(0,b.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"var(--af-text)"},children:F}),(0,b.jsx)("button",{type:"button",onClick:()=>G(1),style:{background:"transparent",border:"none",cursor:"pointer",color:"var(--af-text-secondary)",fontSize:14,padding:"2px 8px",borderRadius:4},children:"›"})]}),(0,b.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:2,marginBottom:4},children:["Su","Mo","Tu","We","Th","Fr","Sa"].map(a=>(0,b.jsx)("div",{style:{textAlign:"center",fontSize:9,color:"var(--af-text-tertiary)",fontWeight:600,padding:"2px 0"},children:a},a))}),(0,b.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:2},children:D.map((c,e)=>{if(!c)return(0,b.jsx)("div",{},`blank-${e}`);let f=C.get(c),g=f?.airTimeMs??0,i=f?.burstCount??0,j=c===a,k=c===d,l=c>d,m=g>0&&E>0?Math.min(1,g/E):0,n=parseInt(c.split("-")[2],10);return(0,b.jsxs)("button",{type:"button",onClick:()=>{q(!1),o.push(h(c))},disabled:l,onMouseEnter:a=>{if(l)return;let b=a.currentTarget.getBoundingClientRect(),d=a.currentTarget.offsetParent?.getBoundingClientRect()??b;z(c),B({x:b.left-d.left+b.width/2,y:b.bottom-d.top+6})},onMouseLeave:()=>{z(null),B(null)},style:{position:"relative",width:40,height:40,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:1,border:j?"2px solid var(--af-accent)":k?"1px solid var(--af-text-tertiary)":"1px solid transparent",borderRadius:6,background:m>0?`rgba(45, 212, 191, ${.08+.35*m})`:"transparent",color:l?"var(--af-text-tertiary)":j?"var(--af-accent)":"var(--af-text)",cursor:l?"not-allowed":"pointer",fontSize:11,fontWeight:j?700:400,fontFamily:"var(--font-mono)",padding:0,opacity:l?.4:1},children:[(0,b.jsx)("span",{style:{lineHeight:1},children:n}),g>0&&(0,b.jsx)("span",{style:{fontSize:8,color:j?"var(--af-accent)":"var(--af-text-tertiary)",lineHeight:1,fontWeight:600,marginTop:2},children:I(g)}),i>0&&(0,b.jsx)("span",{style:{position:"absolute",top:3,right:3,width:5,height:5,borderRadius:"50%",background:"rgba(167, 139, 250, 0.95)",boxShadow:"0 0 0 1px var(--af-surface)"}})]},c)})}),(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginTop:10,paddingTop:8,borderTop:"1px solid var(--af-border-subtle)",fontSize:9,color:"var(--af-text-tertiary)"},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:5},children:[(0,b.jsx)("span",{children:"less"}),(0,b.jsx)("div",{style:{display:"flex",gap:2},children:[0,.15,.3,.5,.8].map((a,c)=>(0,b.jsx)("span",{style:{width:10,height:10,borderRadius:2,background:0===a?"var(--af-border-subtle)":`rgba(45, 212, 191, ${.08+.35*a})`}},c))}),(0,b.jsx)("span",{children:"more active"})]}),(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:5},title:"Days with at least one concurrency burst",children:[(0,b.jsx)("span",{style:{width:5,height:5,borderRadius:"50%",background:"rgba(167, 139, 250, 0.95)"}}),"parallel"]})]}),y&&A&&(i=C.get(y),j=i?.sessions??0,k=i?.airTimeMs??0,l=i?.parallelMs??0,m=i?.burstCount??0,n=i?.peakConcurrency??0,(0,b.jsxs)("div",{style:{position:"absolute",left:Math.max(10,Math.min(A.x-110,290)),top:A.y,width:220,pointerEvents:"none",background:"var(--af-surface-elevated)",border:"1px solid var(--af-border-subtle)",borderRadius:8,padding:"9px 12px",boxShadow:"0 6px 22px rgba(0,0,0,0.22)",fontSize:11,color:"var(--af-text)",zIndex:65,lineHeight:1.5},children:[(0,b.jsx)("div",{style:{fontFamily:"var(--font-mono)",fontWeight:700,fontSize:11,marginBottom:4},children:y}),0===j&&0===k&&0===l?(0,b.jsx)("div",{style:{color:"var(--af-text-tertiary)",fontSize:10},children:"no activity"}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(K,{label:"sessions",value:String(j)}),(0,b.jsx)(K,{label:"active time",value:k>0?I(k):"—"}),l>0&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{style:{marginTop:4,paddingTop:4,borderTop:"1px dashed var(--af-border-subtle)"}}),(0,b.jsx)(K,{label:"parallel time",value:I(l)}),(0,b.jsx)(K,{label:"peak concurrency",value:`\xd7${n}`,accent:!0}),(0,b.jsx)(K,{label:"bursts",value:String(m)})]})]})]}))]})]})}function K({label:a,value:c,accent:d}){return(0,b.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",color:"var(--af-text-secondary)",fontSize:10},children:[(0,b.jsx)("span",{children:a}),(0,b.jsx)("strong",{style:{color:d?"rgba(167, 139, 250, 1)":"var(--af-text)"},children:c})]})}function L({label:a,defaultOpen:f=!0,children:g}){let[h,i]=(0,c.useState)(f);return(0,b.jsxs)("div",{style:{borderBottom:"1px solid var(--af-border-subtle)"},children:[(0,b.jsxs)("button",{type:"button",onClick:()=>i(a=>!a),style:{width:"100%",padding:"12px 40px",background:"transparent",border:"none",textAlign:"left",display:"flex",alignItems:"center",gap:8,cursor:"pointer",fontSize:11,fontWeight:700,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.08em"},children:[h?(0,b.jsx)(d.ChevronDown,{size:13}):(0,b.jsx)(e.ChevronRight,{size:13}),a]}),h&&(0,b.jsx)("div",{children:g})]})}a.s(["DayView",0,function({date:a,today:d,prev:e,next:g,initial:h,entries:i,aiEnabled:j,gantt:k,bursts:l,sessionEntries:m,backfillRows:n,dayStats:o}){let[p,q]=(0,c.useState)(!1),r=i.length>0&&i.every(a=>"skipped_trivial"===a.enrichment.status),t=i.length>0&&!r,u=k.sessions.length>0,v=new Date(`${a}T12:00:00`).toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric"}),w=n.filter(a=>"pending"===a.status).length;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("nav",{style:{padding:"14px 40px",display:"flex",gap:12,fontSize:12,borderBottom:"1px solid var(--af-border-subtle)",alignItems:"center",flexWrap:"wrap"},children:[(0,b.jsx)(J,{date:a,today:d,prevDay:e,nextDay:g??void 0,dayStats:o}),(0,b.jsxs)("button",{type:"button",onClick:()=>q(!0),style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",gap:5,padding:"5px 10px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:11,color:"var(--af-text-secondary)",cursor:"pointer"},title:"Open the backfill multi-select drawer",children:[(0,b.jsx)(f,{size:12}),"Backfill digests",w>0&&(0,b.jsx)("span",{style:{fontSize:10,color:"#ed8936",fontWeight:700},children:w})]})]}),t||u?(0,b.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[t&&(0,b.jsx)(L,{label:"Narrative",defaultOpen:!0,children:(0,b.jsx)(s,{initial:h,entries:i,date:a,aiEnabled:j})}),u&&(0,b.jsx)(L,{label:"Timeline & concurrency",defaultOpen:!0,children:(0,b.jsx)("div",{style:{padding:"8px 40px 40px"},children:(0,b.jsx)(E,{gantt:k,bursts:l,sessionEntries:m})})})]}):(0,b.jsxs)("div",{style:{padding:"60px 40px",textAlign:"center",color:"var(--af-text-secondary)"},children:[(0,b.jsx)("div",{style:{fontSize:14,marginBottom:6},children:v}),(0,b.jsx)("div",{style:{fontSize:13,color:"var(--af-text-tertiary)"},children:"No Claude Code activity on this day."})]}),(0,b.jsx)(F,{open:p,onClose:()=>q(!1),rows:n,aiEnabled:j})]})}],94561)}];
2
2
 
3
3
  //# sourceMappingURL=apps_web_app_day_%5Bdate%5D_day-view_tsx_0wjoe1u._.js.map