failproofai 1.0.12-beta.0 → 1.0.12-beta.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 (214) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/build-manifest.json +3 -3
  3. package/.next/standalone/.next/prerender-manifest.json +3 -3
  4. package/.next/standalone/.next/required-server-files.json +1 -1
  5. package/.next/standalone/.next/server/app/_global-error/page/server-reference-manifest.json +1 -1
  6. package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
  7. package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.rsc +2 -2
  10. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
  11. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +2 -2
  12. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  13. package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  14. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  15. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  16. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  17. package/.next/standalone/.next/server/app/_not-found.rsc +3 -3
  18. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  19. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  20. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  21. package/.next/standalone/.next/server/app/api/audit/invite/route.js.nft.json +1 -1
  22. package/.next/standalone/.next/server/app/api/audit/run/route.js +22 -22
  23. package/.next/standalone/.next/server/app/api/audit/run/route.js.nft.json +1 -1
  24. package/.next/standalone/.next/server/app/api/audit/status/route.js.nft.json +1 -1
  25. package/.next/standalone/.next/server/app/api/auth/login-request/route.js.nft.json +1 -1
  26. package/.next/standalone/.next/server/app/api/auth/login-verify/route.js.nft.json +1 -1
  27. package/.next/standalone/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
  28. package/.next/standalone/.next/server/app/api/auth/status/route.js.nft.json +1 -1
  29. package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js.nft.json +1 -1
  30. package/.next/standalone/.next/server/app/audit/page/server-reference-manifest.json +2 -2
  31. package/.next/standalone/.next/server/app/audit/page.js +1 -1
  32. package/.next/standalone/.next/server/app/audit/page.js.nft.json +1 -1
  33. package/.next/standalone/.next/server/app/audit/page_client-reference-manifest.js +1 -1
  34. package/.next/standalone/.next/server/app/index.html +1 -1
  35. package/.next/standalone/.next/server/app/index.rsc +3 -3
  36. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  37. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +3 -3
  38. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  39. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
  40. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  41. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  42. package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +14 -14
  43. package/.next/standalone/.next/server/app/policies/page.js +4 -4
  44. package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
  45. package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
  46. package/.next/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
  47. package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
  48. package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
  49. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
  50. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +2 -2
  51. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
  52. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
  53. package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
  54. package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
  55. package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  56. package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +8 -8
  57. package/.next/standalone/.next/server/app/settings/page.js +7 -7
  58. package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
  59. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  60. package/.next/standalone/.next/server/chunks/{[externals]__0-ha5ydqq0mws._.js → [externals]__0vt9i6fqinjne._.js} +1 -1
  61. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__20xe05hm5u8_1._.js → [root-of-the-server]__0f_4g-vazrvxv._.js} +1 -1
  62. package/.next/standalone/.next/server/chunks/_0hf5q4xzyg40j._.js +1 -1
  63. package/.next/standalone/.next/server/chunks/_0tovk6q0miud6._.js +1 -1
  64. package/.next/standalone/.next/server/chunks/_0trp3ycqv17cl._.js +1 -1
  65. package/.next/standalone/.next/server/chunks/_19011-u44143j._.js +1 -1
  66. package/.next/standalone/.next/server/chunks/_1ek68lnh2daur._.js +2 -2
  67. package/.next/standalone/.next/server/chunks/{_0kc-piux3hady._.js → _1y590mjzpkbos._.js} +2 -2
  68. package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_1nxcc4vkpxxu7._.js +1 -1
  69. package/.next/standalone/.next/server/chunks/src_hooks_0_em82s16zfym._.js +5 -0
  70. package/.next/standalone/.next/server/chunks/src_hooks_builtin-policies_ts_1yq5ybgx1v98e._.js +3 -0
  71. package/.next/standalone/.next/server/chunks/src_hooks_custom-hooks-loader_ts_0lnb3n3h94wnn._.js +1 -1
  72. package/.next/standalone/.next/server/chunks/src_hooks_daemon-client_ts_0il_yu1zc0291._.js +1 -1
  73. package/.next/standalone/.next/server/chunks/src_hooks_fp-home_ts_09kv0bn_4twyh._.js +1 -1
  74. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0ts0fg5yih1c1._.js → [root-of-the-server]__00l2u6j86cb8y._.js} +2 -2
  75. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__08ch3staq3ejw._.js +1 -1
  76. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0bigvy9xmv2ka._.js +1 -1
  77. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h86bl2qf0k_o._.js +1 -1
  78. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1_xbg2kx30wp-._.js → [root-of-the-server]__0naevg4bcoh54._.js} +1 -1
  79. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0pia5h3p8re4c._.js +1 -1
  80. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0pwj2h2efe5f-._.js +1 -1
  81. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1-ey9fgesfbc0._.js +1 -1
  82. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__15usvs-ms-0hf._.js +1 -1
  83. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__16gb3_92zvk5x._.js +1 -1
  84. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1avi2kypusyb_._.js +1 -1
  85. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1r7drlqli-ado._.js +1 -1
  86. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0vcyntk4snf0f._.js → [root-of-the-server]__1vofkb2oq7p7e._.js} +1 -1
  87. package/.next/standalone/.next/server/chunks/ssr/_0bseae9u7g98r._.js +1 -1
  88. package/.next/standalone/.next/server/chunks/ssr/_0eoura3_9gjb-._.js +1 -1
  89. package/.next/standalone/.next/server/chunks/ssr/_0mouhaflye1ro._.js +1 -1
  90. package/.next/standalone/.next/server/chunks/ssr/{_1gb0ifpkowwub._.js → _0ouu886szh6yj._.js} +10 -9
  91. package/.next/standalone/.next/server/chunks/ssr/_0pedwblqdoh58._.js +1 -1
  92. package/.next/standalone/.next/server/chunks/ssr/_1djqs9i27e4kg._.js +1 -1
  93. package/.next/standalone/.next/server/chunks/ssr/{_1ve8y151ua7qx._.js → _1fw0_nzkae5ao._.js} +2 -2
  94. package/.next/standalone/.next/server/chunks/ssr/_20hn4gn87nsjc._.js +1 -1
  95. package/.next/standalone/.next/server/chunks/ssr/_next-internal_server_app_policies_page_actions_1sp2-yo5_vm5f.js +2 -2
  96. package/.next/standalone/.next/server/chunks/ssr/app_actions_get-scheduled-audit_ts_0ei9snixb5fd-._.js +1 -1
  97. package/.next/standalone/.next/server/chunks/ssr/app_audit__components_audit-dashboard_tsx_0p9ud47q0xq5w._.js +1 -1
  98. package/.next/standalone/.next/server/chunks/ssr/app_components_project-list_tsx_1ke6anr0vt64h._.js +1 -1
  99. package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_1kp6l3x33jqb6._.js +1 -1
  100. package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_19dqvpcz0uxur._.js +2 -2
  101. package/.next/standalone/.next/server/chunks/ssr/app_settings_02tf1h47jmhhd._.js +1 -1
  102. package/.next/standalone/.next/server/chunks/ssr/{node_modules_html-to-image_es_index_00jxj8foxqz5t.js → node_modules_html-to-image_es_index_1fv03uigni8s5.js} +1 -1
  103. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_0janj0i6dqko7._.js +1 -1
  104. package/.next/standalone/.next/server/chunks/ssr/package_json_[json]_cjs_013tntikdft59._.js +1 -1
  105. package/.next/standalone/.next/server/chunks/ssr/src_hooks_06kzv9ddabn3_._.js +1 -1
  106. package/.next/standalone/.next/server/chunks/ssr/src_hooks_0agdmptetetdt._.js +5 -0
  107. package/.next/standalone/.next/server/chunks/ssr/src_hooks_0mdwgjisv4fub._.js +5 -0
  108. package/.next/standalone/.next/server/chunks/ssr/src_hooks_1cv9_c4l1tzrm._.js +1 -1
  109. package/.next/standalone/.next/server/chunks/ssr/src_hooks_daemon-client_ts_0k41_i7jg6ndv._.js +1 -1
  110. package/.next/standalone/.next/server/chunks/ssr/src_hooks_fp-config_ts_04t589gp4p60j._.js +1 -1
  111. package/.next/standalone/.next/server/chunks/ssr/src_hooks_pack-cli_ts_0t7me658zqmh_._.js +1 -1
  112. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  113. package/.next/standalone/.next/server/pages/404.html +1 -1
  114. package/.next/standalone/.next/server/pages/500.html +1 -1
  115. package/.next/standalone/.next/server/preview-props.json +3 -3
  116. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  117. package/.next/standalone/.next/server/server-reference-manifest.json +23 -23
  118. package/.next/standalone/.next/static/chunks/{0pjxnp927y7_j.js → 0ay__-d2h1xb5.js} +1 -1
  119. package/.next/standalone/.next/static/chunks/{2znt1784j9gd9.js → 0tbm3vjm62h-2.js} +1 -1
  120. package/.next/standalone/.next/static/chunks/1c_jf6g5wnslk.js +1 -0
  121. package/.next/standalone/.next/static/chunks/{3tn1bzk094e8e.js → 1my3-5p47t7r-.js} +1 -1
  122. package/.next/standalone/.next/static/chunks/20py8k1gd_i1m.js +1 -0
  123. package/.next/standalone/.next/static/chunks/21hckpmsc4g70.js +6 -0
  124. package/.next/standalone/.next/static/chunks/2hmex93ppj1ke.js +1 -0
  125. package/.next/standalone/.next/static/chunks/2o6d37j425uci.js +1 -0
  126. package/.next/standalone/.next/static/chunks/40oworn_-x12p.js +1 -0
  127. package/.next/standalone/.next/static/chunks/{2qz5piiir-qqm.js → 42xptz88mtq3x.js} +1 -1
  128. package/.next/standalone/app/actions/update-jev-config.ts +5 -3
  129. package/.next/standalone/app/settings/jev-panel.tsx +1 -1
  130. package/.next/standalone/fp-cloud-cli/CHANGELOG.md +32 -0
  131. package/.next/standalone/fp-cloud-cli/README.md +40 -1
  132. package/.next/standalone/fp-cloud-cli/fp_cli/client.py +91 -12
  133. package/.next/standalone/fp-cloud-cli/fp_cli/commands/fleet_cmds.py +78 -16
  134. package/.next/standalone/fp-cloud-cli/fp_cli/commands/policies_cmds.py +84 -18
  135. package/.next/standalone/fp-cloud-cli/fp_cli/enforcement.py +124 -6
  136. package/.next/standalone/fp-cloud-cli/fp_cli/models.py +89 -6
  137. package/.next/standalone/fp-cloud-cli/fp_cli/output.py +189 -20
  138. package/.next/standalone/fp-cloud-cli/fp_cli/policy_check.py +8 -5
  139. package/.next/standalone/fp-cloud-cli/skill/SKILL.md +2 -2
  140. package/.next/standalone/fp-cloud-cli/skill/references/commands.md +14 -7
  141. package/.next/standalone/fp-cloud-cli/tests/test_cloud_jev.py +527 -0
  142. package/.next/standalone/fp-cloud-cli/tests/test_enforcement_logic.py +46 -0
  143. package/.next/standalone/fp-cloud-cli/tests/test_output.py +23 -0
  144. package/.next/standalone/hermes-plugin/README.md +6 -4
  145. package/.next/standalone/hermes-plugin/__init__.py +27 -0
  146. package/.next/standalone/hermes-plugin/client.py +5 -1
  147. package/.next/standalone/hermes-plugin/plugin.yaml +1 -1
  148. package/.next/standalone/package.json +11 -10
  149. package/.next/standalone/sdk/python/uv.lock +31 -8
  150. package/.next/standalone/server.js +1 -1
  151. package/bin/failproofai.mjs +17 -1
  152. package/dist/cli.mjs +3507 -1250
  153. package/dist/worker.mjs +1779 -169
  154. package/hermes-plugin/README.md +6 -4
  155. package/hermes-plugin/__init__.py +27 -0
  156. package/hermes-plugin/client.py +5 -1
  157. package/hermes-plugin/plugin.yaml +1 -1
  158. package/package.json +11 -10
  159. package/src/audit/open-browser.ts +6 -7
  160. package/src/hooks/agent-roster.ts +180 -0
  161. package/src/hooks/agent-skill.ts +203 -0
  162. package/src/hooks/agent-targets.ts +60 -0
  163. package/src/hooks/cloud-connection.ts +91 -45
  164. package/src/hooks/cloud-enrollment-cli.ts +7 -4
  165. package/src/hooks/cloud-login.ts +6 -3
  166. package/src/hooks/cloud-managed-policies.ts +430 -20
  167. package/src/hooks/cloud-policy-errors.ts +481 -0
  168. package/src/hooks/codex-system-hooks.ts +10 -4
  169. package/src/hooks/config-status.ts +10 -4
  170. package/src/hooks/configure-wizard.ts +54 -26
  171. package/src/hooks/custom-hooks-loader.ts +26 -3
  172. package/src/hooks/daemon-client.ts +9 -4
  173. package/src/hooks/daemon-service.ts +2 -1
  174. package/src/hooks/delivery-health.ts +47 -2
  175. package/src/hooks/effective-reviewers.ts +36 -1
  176. package/src/hooks/fp-config.ts +19 -0
  177. package/src/hooks/fp-home.ts +6 -0
  178. package/src/hooks/handler.ts +255 -19
  179. package/src/hooks/health-probe.ts +15 -0
  180. package/src/hooks/hook-activity-store.ts +7 -1
  181. package/src/hooks/integrations.ts +36 -14
  182. package/src/hooks/jev-activity.ts +117 -1
  183. package/src/hooks/jev-cli.ts +196 -1
  184. package/src/hooks/jev-cloud-connection.ts +92 -0
  185. package/src/hooks/manager.ts +174 -34
  186. package/src/hooks/pack-failclosed.ts +2 -0
  187. package/src/hooks/pack-manifest.ts +8 -1
  188. package/src/hooks/policy-evaluator.ts +22 -1
  189. package/src/hooks/policy-registry.ts +3 -2
  190. package/src/hooks/policy-reviewability.ts +23 -5
  191. package/src/hooks/semantic/cloud-jev-health.ts +227 -0
  192. package/src/hooks/semantic/cloud-jev.ts +868 -0
  193. package/src/hooks/semantic/combine.ts +26 -1
  194. package/src/hooks/semantic/jev-client.ts +19 -2
  195. package/src/hooks/semantic/jev-config.ts +179 -30
  196. package/src/hooks/semantic/jev-review.ts +217 -10
  197. package/src/hooks/semantic/pack-policies.ts +2 -1
  198. package/src/hooks/semantic/types.ts +8 -0
  199. package/src/hooks/session-pause-cli.ts +1 -1
  200. package/src/hooks/tui.ts +13 -4
  201. package/src/hooks/uninstall-cli.ts +12 -1
  202. package/src/hooks/worker-server.ts +5 -1
  203. package/.next/standalone/.next/server/chunks/src_hooks_1aveq0uhs2t1b._.js +0 -5
  204. package/.next/standalone/.next/server/chunks/src_hooks_1eem5a7cyqlb2._.js +0 -3
  205. package/.next/standalone/.next/server/chunks/ssr/src_hooks_effective-reviewers_ts_1h4wtvo55j16x._.js +0 -5
  206. package/.next/standalone/.next/static/chunks/0a-ccsp3xmypz.js +0 -1
  207. package/.next/standalone/.next/static/chunks/13jv-xvabeb62.js +0 -6
  208. package/.next/standalone/.next/static/chunks/2ank2u3apy8m6.js +0 -1
  209. package/.next/standalone/.next/static/chunks/2meqb9kygrncb.js +0 -1
  210. package/.next/standalone/.next/static/chunks/2ohktp_-lkv3x.js +0 -1
  211. package/.next/standalone/.next/static/chunks/2py0eldhwz8ay.js +0 -1
  212. /package/.next/standalone/.next/static/{SNr7o_-G4kNBQTR-iLZMM → LHCtFxVG0mdvd4lsXAOFC}/_buildManifest.js +0 -0
  213. /package/.next/standalone/.next/static/{SNr7o_-G4kNBQTR-iLZMM → LHCtFxVG0mdvd4lsXAOFC}/_clientMiddlewareManifest.js +0 -0
  214. /package/.next/standalone/.next/static/{SNr7o_-G4kNBQTR-iLZMM → LHCtFxVG0mdvd4lsXAOFC}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,36406,e=>{"use strict";let t,s;var n=e.i(43476),r=e.i(71645),l=e.i(74080);function i(e,t,s){let n,r=s.initialDeps??[],l=!0;function i(){let i=e();return(i.length!==r.length||i.some((e,t)=>r[t]!==e))&&(r=i,n=t(...i),(null==s?void 0:s.onChange)&&!(l&&s.skipInitialOnChange)&&s.onChange(n),l=!1),n}return i.updateDeps=e=>{r=e},i}function o(e,t){if(void 0!==e)return e;throw Error(`Unexpected undefined${t?`: ${t}`:""}`)}let a=(e,t)=>1.01>Math.abs(e-t),h=()=>{if(void 0!==t)return t;if("u"<typeof navigator)return t=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return t=!0;let e=navigator.maxTouchPoints;return t="MacIntel"===navigator.platform&&void 0!==e&&e>0},d={capture:!0,passive:!0};class c{constructor(e){this.host=e,this._touch=null,this.inMotion=()=>null!==this._touch&&"lateFling"!==this._touch.phase,this.dragging=()=>{var e;return(null==(e=this._touch)?void 0:e.phase)==="down"&&this._touch.moved},this.tail=()=>{var e;return(null==(e=this._touch)?void 0:e.phase)==="tail"?this._touch.moved?"fling":"tap":null},this.onScroll=({isScrolling:e,ownReadBack:t,moved:s,external:n})=>{var r,l,i;return e&&(null==(r=this._touch)?void 0:r.phase)==="tail"?this._openTail(this._touch.moved||!t,!1):(null==(l=this._touch)?void 0:l.phase)==="lateFling"&&(this.host.now()>this._touch.until?this._touch=null:n&&e&&s&&this._openTail(!0,!1)),!t&&!!e&&!!s&&(null==(i=this._touch)?void 0:i.phase)==="down"&&(this._touch.moved=!0,!0)},this.touchStart=()=>{this.end(),this._touch={phase:"down",moved:!1}},this.touchEnd=()=>{var e;let t=(null==(e=this._touch)?void 0:e.phase)==="down"&&this._touch.moved;this.end(),this._openTail(t,t)},this.end=()=>{var e;let t=this.host.getWindow();(null==(e=this._touch)?void 0:e.phase)==="tail"&&null!=t&&t.clearTimeout(this._touch.timerId),this._touch=null},this.listen=e=>{let t=()=>this.touchStart(),s=()=>this.touchEnd();return e.addEventListener("touchstart",t,d),e.addEventListener("touchend",s,d),e.addEventListener("touchcancel",s,d),()=>{e.removeEventListener("touchstart",t,d),e.removeEventListener("touchend",s,d),e.removeEventListener("touchcancel",s,d),this.end()}},this._openTail=(e,t)=>{let s=this.host.getWindow();if(!h()||null==s)return;this.end();let n={phase:"tail",moved:e,awaitingFling:t,timerId:s.setTimeout(()=>{this.host.tailStillMoving()?this._openTail(n.moved,n.awaitingFling):(this._touch=n.awaitingFling?{phase:"lateFling",until:this.host.now()+1e3}:null,this.host.onTailClosed())},150)};this._touch=n}}get touch(){return this._touch}}let u=e=>e,m=e=>{let t=e.overscan*Math.max(e.lanes??1,1),s=Math.max(e.startIndex-t,0),n=Math.min(e.endIndex+t,e.count-1)-s+1,r=Array(n);for(let e=0;e<n;e++)r[e]=s+e;return r},f={passive:!0},p=(e,t)=>{let s=e.scrollElement;if(!s)return;let n=()=>{t({width:s.innerWidth,height:s.innerHeight})};return n(),s.addEventListener("resize",n,f),()=>{s.removeEventListener("resize",n)}},g="u"<typeof window||"onscrollend"in window,x=(e,t)=>((e,t,s)=>{var n,r;let l,i=e.scrollElement;if(!i)return;let o=e.targetWindow;if(!o)return;let a=e.options.useScrollendEvent&&g,h=0,d=a?null:(n=()=>t(s(i),!1),r=e.options.isScrollingResetDelay,Object.assign(function(...e){o.clearTimeout(l),l=o.setTimeout(()=>n.apply(this,e),r)},{cancel:()=>{o.clearTimeout(l)}})),c=e=>()=>{h=s(i),null==d||d(),t(h,e)},u=c(!0),m=c(!1);return i.addEventListener("scroll",u,f),a&&i.addEventListener("scrollend",m,f),()=>{i.removeEventListener("scroll",u),a&&i.removeEventListener("scrollend",m),null==d||d.cancel()}})(e,t,t=>e.options.horizontal?t.scrollX:t.scrollY),y=(e,t,s)=>{if(s.options.useCachedMeasurements){let t=s.indexFromElement(e),n=s.options.getItemKey(t);return s.itemSizeCache.get(n)??s.options.estimateSize(t)}if(null==t?void 0:t.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[s.options.horizontal?"inlineSize":"blockSize"])}if(!t){let t=s.indexFromElement(e),n=s.options.getItemKey(t),r=s.itemSizeCache.get(n);if(void 0!==r)return r}return e[s.options.horizontal?"offsetWidth":"offsetHeight"]},v=(e,{adjustments:t=0,behavior:s},n)=>{var r,l;null==(l=null==(r=n.scrollElement)?void 0:r.scrollTo)||l.call(r,{[n.options.horizontal?"left":"top"]:e+t,behavior:s})},b=(e,t)=>"smooth"===e?t?"smoothLanded":"smooth":"instant",S=e=>(null==e?void 0:e.phase)==="smooth"||(null==e?void 0:e.phase)==="smoothLanded";class j{constructor(e){let t,s,n,r;this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this._holdOffset=0,this._reportedOverscroll=!1,this._iosGesture=new c({getWindow:()=>this.targetWindow,now:()=>this.now(),tailStillMoving:()=>{let e=this.scrollState;if((null==e?void 0:e.phase)!=="queued"||null!==this.pendingWrite)return!1;let t=this._readElementOffset();return!(null===t||null===this._lastElementOffset||1>Math.abs(t-this._lastElementOffset))&&(this._lastElementOffset=t,e.samples=[...e.samples??[],{t:this.now(),offset:t}],!0)},onTailClosed:()=>{let e=this.scrollState;(null==e?void 0:e.phase)==="queued"&&function(e){let t=e[e.length-1];if(void 0===t)return!1;let s=e.length-2;for(;s>=0&&t.t-e[s].t<40;)s--;if(s<0)return!1;let n=e[s];return Math.abs(t.offset-n.offset)/(t.t-n.t)>=.05}(e.samples??[])&&(this.scrollState=null),this._flushHoldIfReady(!0),this._writeAwaitingCommand()}}),this._lastElementOffset=null,this.pendingWrite=null,this._clampedAdjustment=null,this.elementsCache=new Map,this._resizeBatch=null,this.now=()=>{var e,t,s;return(null==(s=null==(t=null==(e=this.targetWindow)?void 0:e.performance)?void 0:t.now)?void 0:s.call(t))??Date.now()},this.observer=(t=null,s=null,n=()=>{let e;if(t)return t;let n=this.targetWindow;if(!n||!n.ResizeObserver)return null;let l=(e=new Set,s={schedule:t=>{let s=n.requestAnimationFrame(()=>{e.delete(s),t()});e.add(s)},cancel:()=>{e.forEach(e=>n.cancelAnimationFrame(e)),e.clear()}});return t=new n.ResizeObserver(e=>{let t=()=>{let t={sync:!1};this._resizeBatch=t;try{e.forEach(r)}finally{this._resizeBatch=null,t.notify&&(this.notify(t.sync),this._noteClampMax(),this._flushHoldIfReady(!0),this._retryClampedAdjustment())}};this.options.useAnimationFrameWithResizeObserver?l.schedule(t):t()})},r=e=>{let t=e.target,s=this.indexFromElement(t);if(!t.isConnected){for(let[e,s]of(this.observer.unobserve(t),this.elementsCache))if(s===t){this.elementsCache.delete(e);break}return}this.isIndexInRange(s)&&this.shouldMeasureDuringScroll(s)&&this.resizeItem(s,this.options.measureElement(t,e,this))},{disconnect:()=>{var e;null==(e=n())||e.disconnect(),null==s||s.cancel(),t=null,s=null},observe:e=>{var t;return null==(t=n())?void 0:t.observe(e,{box:"border-box"})},unobserve:e=>{var t;return null==(t=n())?void 0:t.unobserve(e)}}),this.range=null,this.setOptions=e=>{var t;let s={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:u,rangeExtractor:m,onChange:()=>{},measureElement:y,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(let t in e){let n=e[t];void 0!==n&&(s[t]=n)}let n=this.options,r=null,l=null,i=!1;if(void 0!==n&&n.enabled&&s.enabled&&"end"===s.anchorTo&&null!==this.scrollElement){let e=n.count,o=s.count,a=this.getMeasurements(),h=(null==(t=this._singleLaneMeasurements)?void 0:t.items)??a,d=e=>{var t;return"object"==typeof(t=h[e])?t.key:t},c=e>0?d(0):null,u=e>0?d(e-1):null;if(o!==e||e>0&&o>0&&(s.getItemKey(0)!==c||s.getItemKey(o-1)!==u)){i=!0;let t=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??a[0]:null;t&&(r=[t.key,this.getScrollOffset()-t.start]);let h=!0===s.followOnAppend?"auto":s.followOnAppend||null;h&&o>0&&this.isAtEnd(n.scrollEndThreshold)&&(0===e||s.getItemKey(o-1)!==u)&&(o>e||function(e,t,s,n){if(0===t)return!1;let r=n(0),l=new Set,i=0;for(;i<e;){let e=s(i);if(e===r)break;l.add(e),i++}let o=e-i;if(0===o||o>=t)return!1;for(let e=0;e<o;e++)if(n(e)!==s(i+e))return!1;for(let e=o;e<t;e++)if(l.has(n(e)))return!1;return!0}(e,o,d,s.getItemKey))&&(l=h)}}this.options=s,i&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=null;if(r&&null!==this.scrollOffset&&!this._awaitingCommandReadBack()){let[e,t]=r,s=this.getMeasurements(),{count:n,getItemKey:i}=this.options,a=0;for(;a<n&&i(a)!==e;)a++;if(a<n){let e=s[a];if(e){let s=Math.max(0,e.start+t);l||s===this.scrollOffset||(o=s-this.scrollOffset,this.scrollOffset=s)}}}l?this.pendingScrollAnchor={kind:"follow",behavior:l}:null!==o&&(this._canWriteScroll()?this.pendingScrollAnchor={kind:"anchor",delta:o}:(this._holdOffset+=o,this._followOffsetTarget(o)))},this.notify=e=>{var t,s;null==(s=(t=this.options).onChange)||s.call(t,this,e)},this.maybeNotify=i(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{var e;this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),null!=this.rafId&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,null==(e=this._momentumStop)||e.restore(),this._momentumStop=null,this.isScrolling=!1,this.scrollDirection=null,this._holdOffset=0,this._reportedOverscroll=!1,this._clampedAdjustment=null,this.pendingWrite=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;let t=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==t){if(this.cleanup(),!t)return void this.maybeNotify();this.scrollElement=t,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(e=this.scrollElement)?void 0:e.window)??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{var s,n,r,l;let i=t?this._elementMaxScrollOffset():null,o=this._reportedOverscroll;this._reportedOverscroll=e<0||null!==i&&e>i+1;let h=e;this._lastElementOffset=h,e=this._toLayoutOffset(e);let d=this._classifyScrollEvent(e,t,i);if("spurious"===d)return;"readBack"===d?e=this.pendingWrite.target:"clampedReadBack"===d&&(null==(s=this.scrollState)?void 0:s.index)!=null&&e<this.getMaxScrollOffset()-1.5?this.scrollState.lastTargetOffset=e:function({kind:e,offset:t,command:s,target:n}){let r;return"spurious"!==e&&"readBack"!==e&&"clampedReadBack"!==e&&(null==s?void 0:s.index)!=null&&"queued"!==s.phase&&"smooth"!==(r=s.phase)&&"smoothFinishing"!==r&&!a(t,s.lastTargetOffset)&&!a(t,n())&&"clampedEcho"!==e}({kind:d,offset:e,command:this.scrollState,target:()=>this.getScrollStateTarget(this.scrollState)})&&(this.scrollState=null),this.pendingWrite=null,null!==this._clampedAdjustment&&Math.abs(e-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null);let c=this.getScrollOffset(),u=this.scrollDirection;this.scrollDirection=t?c===e?this.scrollDirection:c<e?"forward":"backward":null,this.scrollOffset=e,this.isScrolling=t;let m=this.scrollState;if((null==m?void 0:m.phase)==="queued"&&"external"===d&&t)if(o||this._reportedOverscroll)m.samples=[];else{let e=this.now();m.samples=[...(m.samples??[]).filter(t=>e-t.t<=200),{t:e,offset:h}],(null!==u&&this.scrollDirection!==u||function(e){let t=e[e.length-1];if(void 0===t)return!1;let s=e.length-2;for(;s>=0&&t.t-e[s].t<40;)s--;if(s<0)return!1;let n=e[s],r=s-1;for(;r>=0&&n.t-e[r].t<40;)r--;if(r<0)return!1;let l=e[r],i=(t.offset-n.offset)/(t.t-n.t),o=(n.offset-l.offset)/(n.t-l.t);return i*o>=0&&Math.abs(i)>=2*Math.abs(o)&&Math.abs(i)-Math.abs(o)>=.8}(m.samples))&&(this.scrollState=null)}this._iosGesture.onScroll({isScrolling:t,ownReadBack:"readBack"===d,moved:e!==c,external:"external"===d&&(null==(n=this.scrollState)?void 0:n.phase)!=="smooth"&&(null==(r=this.scrollState)?void 0:r.phase)!=="smoothFinishing"})&&(null==(l=this.scrollState)?void 0:l.phase)==="queued"&&(this.scrollState=null),this._flushHoldIfReady(!0),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement&&this.unsubs.push(this._iosGesture.listen(this.scrollElement)),this._scrollToOffset(this.getScrollOffset())}this._noteClampMax();let s=this.pendingScrollAnchor;this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled&&("anchor"===s.kind?this._canWriteScroll()?S(this.scrollState)&&!a(this.getScrollOffset()-s.delta,this.scrollState.lastTargetOffset)||(this._followOffsetTarget(s.delta),this._scrollToOffset(this.getScrollOffset())):(this._holdOffset+=s.delta,this._followOffsetTarget(s.delta),this.notify(!1)):this.scrollToEnd({behavior:s.behavior})),this._flushHoldIfReady(!1),this._retryClampedAdjustment()},this._classifyScrollEvent=(e,t,s)=>{var n;return function({offset:e,isScrolling:t,elementMax:s,holdOffset:n,scrollOffset:r,pendingWrite:l,clampedMaxAtWrite:i}){var o;return t&&null===l&&e===r?"spurious":null!==l&&1.5>Math.abs(e-l.target)?"readBack":null!==l&&!l.smooth&&null!==s&&l.target>s+n+.5&&1.5>Math.abs(e-(s+n))||null!==l&&!l.smooth&&(null==(o=l.lowMaxes)?void 0:o.some(t=>1.5>Math.abs(e-t)))?"clampedReadBack":null!==i&&1.5>Math.abs(e-i)?"clampedEcho":"external"}({offset:e,isScrolling:t,elementMax:s,holdOffset:this._holdOffset,scrollOffset:this.scrollOffset,pendingWrite:this.pendingWrite,clampedMaxAtWrite:(null==(n=this._clampedAdjustment)?void 0:n.maxAtWrite)??null})},this._retryClampedAdjustment=()=>{if(null===this._clampedAdjustment||!this.scrollElement||!this.options.enabled)return;let{target:e,maxAtWrite:t}=this._clampedAdjustment,s=this.getMaxScrollOffset();s>t+.5&&(this._clampedAdjustment=e>s+.5?{target:e,maxAtWrite:s}:null,this._scrollToOffset(e))},this._writeAwaitingCommand=()=>{let e=this.scrollState;if(null===e||"queued"!==e.phase)return;let{behavior:t}=e;this.getMeasurements();let s=this.getScrollStateTarget(e);e.lastTargetOffset=s,this._clampedAdjustment=null,e.phase=b(t,null!=e.index&&a(s,this.getScrollOffset())),this._scrollToOffset(s,{behavior:t}),this.scheduleScrollReconcile()},this._readElementOffset=()=>{let e=this.scrollElement;if(null==e)return null;let{horizontal:t,isRtl:s}=this.options;return"number"==typeof e.scrollTop?t?e.scrollLeft*(s&&-1||1):e.scrollTop:"number"==typeof e.scrollY?t?e.scrollX:e.scrollY:null},this._canWriteScroll=()=>!(h()&&this._iosGesture.inMotion())&&!this._reportedOverscroll,this._flushHoldIfReady=e=>{var t;if(0===this._holdOffset||!this.scrollElement||!this.options.enabled||!this._canWriteScroll()||(null==(t=this.scrollState)?void 0:t.phase)==="smooth")return;this._holdOffset=0,null!==this.scrollOffset&&this.scrollOffset<0&&(this.scrollOffset=0),this.notify(e);let s=this.getCommandWrittenOffset()??this.getScrollOffset();this._clampedAdjustment=this._clampedBy(s),this._scrollToOffset(s)},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??("function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=i(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,s,n,r,l,i,o)=>(void 0!==this.prevLanes&&this.prevLanes!==l&&(this.lanesChangedFlag=!0),this.prevLanes=l,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:s,getItemKey:n,enabled:r,lanes:l,laneAssignmentMode:i,gap:o}),{key:!1}),this.isIndexInRange=e=>e>=0&&e<this.options.count,this.getMeasurements=i(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:s,getItemKey:n,enabled:r,lanes:l,laneAssignmentMode:i,gap:o},a)=>{var h,d;let c=this.itemSizeCache;if(!r)return this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),0!==this.measurementsCache.length||this.lanesSettling||(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),1===l){let r,l,i=2*e,a=null==(h=this._singleLaneMeasurements)?void 0:h.flat;if(!a||a.length<i){let e=new Float64Array(i);a&&u>0&&e.set(a.subarray(0,2*u)),a=e}let m=0===u?Array(e):this._singleLaneMeasurements.items.slice();if(0===u)r=t+s;else{let e=u-1;r=a[2*e]+a[2*e+1]+o}for(let t=u;t<e;t++){let e=n(t);m[t]=e;let s=c.get(e),l="number"==typeof s?s:this.options.estimateSize(t);a[2*t]=r,a[2*t+1]=l,r+=l+o}this._singleLaneMeasurements={flat:a,items:m};let f=(d=a,l=m.length,new Proxy(m,{get(e,t,s){if("string"==typeof t){let s=t.charCodeAt(0);if(s>=48&&s<=57){let s=+t;if(Number.isInteger(s)&&s>=0&&s<l){let t=e[s];if("object"!=typeof t){let n=d[2*s];t=e[s]={index:s,key:t,start:n,size:d[2*s+1],end:n+d[2*s+1],lane:0}}return t}}if("length"===t)return l}return Reflect.get(e,t,s)}}));return this.measurementsCache=f,f}let m=this.measurementsCache.slice(0,u),f=Array(l).fill(void 0),p=new Float64Array(l),g=0;for(let e=0;e<u;e++){let t=m[e];t&&(void 0===f[t.lane]&&g++,f[t.lane]=e,p[t.lane]=t.end)}for(let r=u;r<e;r++){let e,a,h=n(r),d=this.laneAssignments.get(r),u="estimate"===i||c.has(h);if(void 0!==d&&this.options.lanes>1){let n=f[e=d],r=void 0!==n?m[n]:void 0;a=r?r.end+o:t+s}else if(g===l){let t=0,s=p[0],n=f[0];for(let e=1;e<l;e++){let r=p[e];(r<s||r===s&&f[e]<n)&&(t=e,s=r,n=f[e])}e=t,a=s+o,u&&this.laneAssignments.set(r,e)}else e=r%this.options.lanes,a=t+s,u&&this.laneAssignments.set(r,e);let x=c.get(h),y="number"==typeof x?x:this.options.estimateSize(r),v=a+y;m[r]={index:r,start:a,size:y,end:v,key:h,lane:e},void 0===f[e]&&g++,f[e]=r,p[e]=v}return this.measurementsCache=m,m},{key:!1,debug:()=>this.options.debug}),this.calculateRange=i(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,s,n)=>0===e.length||0===t?(this.range=null,null):(this.range=function(e,t,s,n,r){let l=e.length-1;if(e.length<=n)return{startIndex:0,endIndex:l};if(1===n&&null!==r){let e=function(e,t,s){let n=0;for(;n<=t;){let r=(n+t)/2|0,l=e[2*r];if(l<s)n=r+1;else{if(!(l>s))return r;t=r-1}}return n>0?n-1:0}(r,l,s),n=e,i=s+t;for(;n<l&&r[2*n]+r[2*n+1]<i;)n++;return{startIndex:e,endIndex:n}}let i=w(0,l,t=>e[t].start,s),o=i;if(1===n)for(;o<l&&e[o].end<s+t;)o++;else if(n>1){let r=Array(n).fill(0);for(;o<l&&r.some(e=>e<s+t);){let t=e[o];r[t.lane]=t.end,o++}let a=Array(n).fill(s+t);for(;i>=0&&a.some(e=>e>=s);){let t=e[i];a[t.lane]=t.start,i--}i=Math.max(0,i-i%n),o=Math.min(l,o+(n-1-o%n))}return{startIndex:i,endIndex:o}}(e,t,s,n,1===n&&null!==this._singleLaneMeasurements?this._singleLaneMeasurements.flat:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=i(()=>{let e=null,t=null,s=this.calculateRange();return s&&(e=s.startIndex,t=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t,this.options.lanes]},(e,t,s,n,r,l)=>null===n||null===r?[]:e({startIndex:n,endIndex:r,overscan:t,count:s,lanes:l}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,s=e.getAttribute(t);return s?parseInt(s,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{var t;if(!S(this.scrollState))return!0;let s=this.scrollState.index??(null==(t=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))?void 0:t.index);if(void 0!==s&&this.range){let t=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),n=Math.max(0,s-t),r=Math.min(this.options.count-1,s+t);return e>=n&&e<=r}return!0},this.measureElement=e=>{if(!e)return void this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});let t=this.indexFromElement(e);if(!this.isIndexInRange(t))return;let s=this.options.getItemKey(t),n=this.elementsCache.get(s);n!==e&&(n&&this.observer.unobserve(n),this.observer.observe(e),this.elementsCache.set(s,e)),e.isConnected&&(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{var s,n,r;let l,i,o;if(!this.isIndexInRange(e))return;(null==(s=this._resizeBatch)?void 0:s.sync)&&this.getMeasurements();let a=null==(n=this._singleLaneMeasurements)?void 0:n.flat;if(1===this.options.lanes&&null!=a)o=this.options.getItemKey(e),i=a[2*e],l=a[2*e+1];else{let t=this.measurementsCache[e];if(!t)return;o=t.key,i=t.start,l=t.size}let h=this.itemSizeCache.get(o)??l,d=t-h;if(0!==d){let s="end"===this.options.anchorTo&&!S(this.scrollState)&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,n=s?this._getLayoutTotalSize():0,a=this.getScrollOffset(),c=this.itemSizeCache.has(o)?i+h<=a&&"backward"!==this.scrollDirection:i<a,u=!S(this.scrollState)&&(void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:o,start:i,size:l,end:i+l,lane:0},d,this):c);(null===this.pendingMin||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(o,t),this.itemSizeCacheVersion++;let m=!1;if(!this._awaitingCommandReadBack()&&(s?m=this.applyScrollAdjustment(this._getLayoutTotalSize()-n):u&&(m=this.applyScrollAdjustment(d))),this._resizeBatch){this._resizeBatch.notify=!0,(r=this._resizeBatch).sync||(r.sync=m);return}this.notify(m),this._noteClampMax(),this._flushHoldIfReady(!0),this._retryClampedAdjustment()}},this.getVirtualItems=i(()=>[this.getVirtualIndexes(),this.getMeasurements(),this._holdOffset],(e,t,s)=>{let n=[];for(let r=0,l=e.length;r<l;r++){let l=t[e[r]];n.push(0===s?l:{...l,start:l.start-s,end:l.end-s})}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{var t;let s=this.getMeasurements();if(0===s.length)return;let n=null==(t=this._singleLaneMeasurements)?void 0:t.flat,r=1===this.options.lanes&&null!=n,l=w(0,s.length-1,r?e=>n[2*e]:e=>o(s[e]).start,e);return o(s[l])},this._noteClampMax=()=>{if(!this._awaitingCommandReadBack())return;let e=this._elementMaxScrollOffset();if(null===e)return;let t=this.pendingWrite,s=Math.max(e,0)+this._holdOffset;if(s>=t.target)return;let n=t.lowMaxes??(t.lowMaxes=[]);n[n.length-1]!==s&&n.push(s)},this.getMaxScrollOffset=()=>(this._elementMaxScrollOffset()??0)+this._holdOffset,this._toLayoutOffset=e=>{var t;let s=e+this._holdOffset;return(null==(t=this.pendingScrollAnchor)?void 0:t.kind)==="anchor"&&(s+=this.pendingScrollAnchor.delta),s},this._elementMaxScrollOffset=()=>{let e=this.scrollElement;if(null===e)return null;if("scrollHeight"in e)return this.options.horizontal?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight;if("document"in e){let t=e.document.documentElement;return this.options.horizontal?t.scrollWidth-e.innerWidth:t.scrollHeight-e.innerHeight}return null},this._momentumStop=null,this._stopMomentum=e=>{let t=this.scrollElement,s=this.targetWindow;if(null===t||null===s)return;let n="document"in t?t.document.scrollingElement:t;if(!(null==n?void 0:n.style))return;if(this._momentumStop){this._momentumStop.done=e;return}let{style:r}=n,l=this.options.horizontal?"overflow-x":"overflow-y",i=r.getPropertyValue(l),o=r.getPropertyPriority(l);r.setProperty(l,"hidden","important");let a={restore:()=>"hidden"===r.getPropertyValue(l)&&"important"===r.getPropertyPriority(l)&&(r.setProperty(l,i,o),!0),done:e};this._momentumStop=a,s.requestAnimationFrame(()=>s.requestAnimationFrame(()=>{this._momentumStop===a&&(this._momentumStop=null,a.restore()&&a.done())}))},this._clampedBy=e=>{let t=this._elementMaxScrollOffset();if(null===t)return null;let s=t+this._holdOffset;return e>s+.5?{target:e,maxAtWrite:s}:null},this.getVirtualDistanceFromEnd=()=>Math.max(this._getLayoutTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,s=0)=>{if(!this.scrollElement)return 0;let n=this.getSize(),r=this.getScrollOffset();return"auto"===t&&(t=e>=r+n?"end":"start"),"center"===t?e+=(s-n)/2:"end"===t&&(e-=n),Math.max(Math.min(this.getMaxScrollOffset(),e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));let s=this.getSize(),n=this.getScrollOffset(),r=this.measurementsCache[e];if(!r)return;if("auto"===t)if(r.end>=n+s-this.options.scrollPaddingEnd)t="end";else{if(!(r.start<=n+this.options.scrollPaddingStart))return[n,t];t="start"}if("end"===t&&e===this.options.count-1){let e=this.getMaxScrollOffset();return[Math.max(Math.min(e-this.options.paddingEnd+this.options.scrollPaddingEnd,e),0),t]}let l="end"===t?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(l,t,r.size),t]},this.scrollToOffset=(e,{align:t="start",behavior:s="auto"}={})=>{this._startScroll({index:null,align:t},this.getOffsetForAlignment(e,t),s,"absolute")},this.scrollToIndex=(e,{align:t="auto",behavior:s="auto"}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getOffsetForIndex(e,t);if(!n)return;let[r,l]=n;this._startScroll({index:e,align:l},r,s,"absolute")},this.scrollBy=(e,{behavior:t="auto"}={})=>{let s=this.getOffsetForAlignment((this.getCommandWrittenOffset()??this.getScrollOffset())+e,"start");this._startScroll({index:null,align:"start"},s,t,"relative")},this.scrollToEnd=({behavior:e="auto"}={})=>{this.options.count>0?this._startScroll({index:this.options.count-1,align:"end",toEnd:!0},Math.max(this.getMaxScrollOffset(),0),e,"absolute"):this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.cancelScroll=()=>{null!=this.rafId&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null},this.getTotalSize=()=>Math.max(this._getLayoutTotalSize()-this._holdOffset,0),this._getLayoutTotalSize=()=>{var e,t;let s,n=this.getMeasurements();if(0===n.length)s=this.options.paddingStart;else if(1===this.options.lanes){let r=n.length-1,l=null==(e=this._singleLaneMeasurements)?void 0:e.flat;s=null!=l?l[2*r]+l[2*r+1]:(null==(t=n[r])?void 0:t.end)??0}else{let e=Array(this.options.lanes).fill(null),t=n.length-1;for(;t>=0&&e.some(e=>null===e);){let s=n[t];null===e[s.lane]&&(e[s.lane]=s.end),t--}s=Math.max(...e.filter(e=>null!==e))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(0===this.itemSizeCache.size)return e;for(let t of this.getMeasurements())t&&this.itemSizeCache.has(t.key)&&e.push({index:t.index,key:t.key,start:t.start,size:t.size,end:t.end,lane:t.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:s}={})=>{let n={target:e+(t??0),smooth:"smooth"===s};return this.pendingWrite=n,this.options.scrollToFn(e-this._holdOffset,{behavior:s,adjustments:t},this),n},this.getCommandWrittenOffset=()=>null===this.scrollState||null===this.pendingWrite||this.pendingWrite.smooth?null:this.pendingWrite.target,this._awaitingCommandReadBack=()=>{let e=this.getCommandWrittenOffset();return!(h()&&this._iosGesture.dragging())&&null!==e&&!a(e,this.getScrollOffset())},this._followOffsetTarget=e=>{null!==this.scrollState&&null==this.scrollState.index&&(this.scrollState.lastTargetOffset+=e)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}get scrollAdjustments(){return 0}applyScrollAdjustment(e,t){if(0===e)return!1;if(this._followOffsetTarget(e),!this._canWriteScroll())return this._holdOffset+=e,null!==this.scrollOffset&&(this.scrollOffset+=e),!0;{let s=this.getScrollOffset();this._clampedAdjustment=this._clampedBy(s+e);let n=this._scrollToOffset(s,{adjustments:e,behavior:t});return null!==this.scrollOffset&&(this.pendingWrite===n&&(this.scrollOffset+=e),this.scrollOffset<0&&(this.scrollOffset=0)),!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}null==this.rafId&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}getScrollStateTarget(e){let t=e.toEnd?[Math.max(this.getMaxScrollOffset(),0)]:null!=e.index?this.getOffsetForIndex(e.index,e.align):void 0;return t?t[0]:e.lastTargetOffset}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}if("queued"===this.scrollState.phase)return void this.scheduleScrollReconcile();this.getMeasurements();let e=this.getScrollStateTarget(this.scrollState),t=null==this.scrollState.index?1:this.options.useAnimationFrameWithResizeObserver?3:2,s=e!==this.scrollState.lastTargetOffset;if(!s&&a(e,this.getScrollOffset())){if("smooth"===this.scrollState.phase?this.scrollState.phase="smoothLanded":"smoothFinishing"===this.scrollState.phase&&(this.scrollState.phase="instant"),this.scrollState.stableFrames++,this.scrollState.stableFrames>=t){this.getScrollOffset()!==e&&this._scrollToOffset(e,{behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,s){let t=this.getSize()||600,s=Math.abs(e-this.getScrollOffset()),n=S(this.scrollState)&&s>t;this.scrollState.lastTargetOffset=e,n?this.scrollState.phase="smooth":"smooth"===this.scrollState.phase?this.scrollState.phase="smoothFinishing":"smoothLanded"===this.scrollState.phase&&(this.scrollState.phase="instant"),this._scrollToOffset(e,{behavior:n?"smooth":"auto"})}this.scheduleScrollReconcile()}_startScroll(e,t,n,r){let l=this._iosGesture.tail();if("absolute"===r&&null!==l){if("fling"===l&&(void 0!==s?s:s=h()&&"u">typeof CSS&&"function"==typeof CSS.supports&&CSS.supports("overflow-anchor: auto"))){this._stopMomentum(()=>{let e=this.scrollState;(null==e?void 0:e.phase)!=="queued"||"fling"!==this._iosGesture.tail()||this._reportedOverscroll||(this._iosGesture.end(),this._flushHoldIfReady(!0),this._writeAwaitingCommand())}),this.scrollState={...e,startedAt:this.now(),lastTargetOffset:t,stableFrames:0,phase:"queued",behavior:n,samples:[]},this.scheduleScrollReconcile();return}this._iosGesture.end()}this.scrollState={...e,startedAt:this.now(),lastTargetOffset:t,stableFrames:0,behavior:n,phase:b(n,null!=e.index&&a(t,this.getScrollOffset()))},this._scrollToOffset(t,{behavior:n}),this.scheduleScrollReconcile()}}let w=(e,t,s,n)=>{for(;e<=t;){let r=(e+t)/2|0,l=s(r);if(l<n)e=r+1;else{if(!(l>n))return r;t=r-1}}return e>0?e-1:0},M="u">typeof document?r.useLayoutEffect:r.useEffect;var N=e.i(16327),_=e.i(56420);let O={name:"wrench",size:24,node:[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]};O.node;let k=(0,_.f)(O);function E(e){let t=new Map,s=new Map;for(let n of e){let e=n.uuid||`${n._source}:${n.timestamp}`,r=s.get(e)??0;s.set(e,r+1),t.set(n,0===r?e:`${e}#${r}`)}return t}let C={name:"user",size:24,node:[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]};C.node;let I=(0,_.f)(C),T={name:"bot",size:24,node:[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]};T.node;let z=(0,_.f)(T),A={name:"cpu",size:24,node:[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]};A.node;let F=(0,_.f)(A),R={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};R.node;let W=(0,_.f)(R),L={name:"message-square",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]};L.node;let $=(0,_.f)(L),D={name:"workflow",size:24,node:[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]};D.node;let B=(0,_.f)(D);var P=e.i(34713);let q=r.default.memo(function({entries:e,compact:t=!1}){let s=(0,r.useMemo)(()=>(function(e){let t=0,s=0,n=0,r=0,l=0,i=new Set;for(let o of e)if("user"===o.type&&t++,"queue-operation"===o.type&&l++,"assistant"===o.type){for(let e of(s++,o.message.content))"tool_use"===e.type&&("Task"===e.name&&(e.subagentType||e.subagentId)?r++:n++);o.message.model&&i.add(o.message.model)}let o="";if(e.length>=2){let t=e[e.length-1].timestampMs-e[0].timestampMs;o=(0,P.M)(t)}return{turnCount:l,userCount:t,assistantCount:s,toolCallCount:n,subagentCount:r,duration:o,models:Array.from(i)}})(e),[e]),l=t?"w-3.5 h-3.5":"w-4 h-4",i=t?"text-xs font-medium":"text-sm font-medium",o=t?"text-[10px] text-muted-foreground":"text-xs text-muted-foreground",a=[...t?[]:[{Icon:$,color:"text-primary",v:s.turnCount,l:"Turns"}],{Icon:I,color:"text-[color:var(--chart-1)]",v:s.userCount,l:"User"},{Icon:z,color:"text-[color:var(--chart-2)]",v:s.assistantCount,l:"Assistant"},{Icon:k,color:"text-[color:var(--chart-3)]",v:s.toolCallCount,l:t?"Tools":"Tool Calls"},{Icon:B,color:"text-[color:var(--chart-5)]",v:s.subagentCount,l:"Subagents"},{Icon:W,color:"text-[color:var(--chart-4)]",v:s.duration||"—",l:"Duration"},{Icon:F,color:"text-[color:var(--chart-5)]",v:s.models.length>0?s.models.join(", "):"—",l:t?"Model":"Model(s)"}];return(0,n.jsx)("div",{className:t?"bg-muted/30 border border-border/50 rounded-lg p-3 mb-3":"bg-card border border-border rounded-lg p-4",children:(0,n.jsx)("div",{className:`grid grid-cols-2 ${t?"sm:grid-cols-6 gap-3":"sm:grid-cols-4 lg:grid-cols-7 gap-4"}`,children:a.map(({Icon:e,color:t,v:s,l:r})=>(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(e,{className:`${l} ${t}`}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:`${i} truncate max-w-[120px]`,children:s}),(0,n.jsx)("div",{className:o,children:r})]})]},r))})})}),U={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};U.node;let H=(0,_.f)(U);var V=e.i(67927);function K(e){return JSON.stringify(e.raw,null,2)}let G=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0});function Y(e){let t=new Date(e),s=G.format(t),n=t.getMilliseconds().toString().padStart(3,"0");return`${s}.${n}`}let J=r.default.memo(function({entry:e,isCollapsed:t,entryCount:s,onToggle:r}){let l="function"==typeof r,i=(0,n.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full bg-primary/10 border border-primary/20 text-primary text-xs font-medium${l?" group-hover:bg-primary/20 transition-colors":""}`,children:[l?(0,n.jsx)(V.f,{className:`w-3 h-3 transition-transform ${t?"":"rotate-90"}`}):(0,n.jsx)(H,{className:"w-3 h-3"}),(0,n.jsx)("span",{children:e.label}),(0,n.jsx)("span",{className:"text-muted-foreground",children:Y(e.timestampMs)}),l&&t&&"number"==typeof s&&(0,n.jsxs)("span",{className:"ml-1 px-1.5 py-0.5 rounded bg-primary/20 text-[10px] leading-none",children:[s," ",1===s?"entry":"entries"]})]});return l?(0,n.jsxs)("button",{type:"button",onClick:r,className:"group flex items-center gap-3 py-3 px-4 w-full cursor-pointer",children:[(0,n.jsx)("div",{className:"flex-1 h-px bg-primary/30"}),i,(0,n.jsx)("div",{className:"flex-1 h-px bg-primary/30"})]}):(0,n.jsxs)("div",{className:"flex items-center gap-3 py-3 px-4",children:[(0,n.jsx)("div",{className:"flex-1 h-px bg-primary/30"}),i,(0,n.jsx)("div",{className:"flex-1 h-px bg-primary/30"})]})});var X=e.i(47163);let Q={user:"User",assistant:"Assistant","file-history-snapshot":"Snapshot",progress:"Progress",system:"System","queue-operation":"Queue"},Z={user:"bg-[color:var(--chart-1)]/20 text-[color:var(--chart-1)] border-[color:var(--chart-1)]/30",assistant:"bg-[color:var(--chart-2)]/20 text-[color:var(--chart-2)] border-[color:var(--chart-2)]/30","file-history-snapshot":"bg-[color:var(--chart-3)]/20 text-[color:var(--chart-3)] border-[color:var(--chart-3)]/30",progress:"bg-[color:var(--chart-5)]/20 text-[color:var(--chart-5)] border-[color:var(--chart-5)]/30",system:"bg-[color:var(--chart-4)]/20 text-[color:var(--chart-4)] border-[color:var(--chart-4)]/30","queue-operation":"bg-primary/20 text-primary border-primary/30"},ee={user:"border-l-[color:var(--chart-1)]",assistant:"border-l-[color:var(--chart-2)]","file-history-snapshot":"border-l-[color:var(--chart-3)]",progress:"border-l-[color:var(--chart-5)]",system:"border-l-[color:var(--chart-4)]","queue-operation":"border-l-primary"},et={name:"file-text",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]};et.node;let es=(0,_.f)(et),en={name:"activity",size:24,node:[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]};en.node;let er=(0,_.f)(en);var el=e.i(66794);function ei({type:e}){let t="w-4 h-4";switch(e){case"user":return(0,n.jsx)(I,{className:t});case"assistant":return(0,n.jsx)(z,{className:t});case"file-history-snapshot":return(0,n.jsx)(es,{className:t});case"progress":return(0,n.jsx)(er,{className:t});case"system":return(0,n.jsx)(el.f,{className:t});case"queue-operation":return(0,n.jsx)(H,{className:t})}}function eo({type:e}){return(0,n.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 text-xs font-mono rounded border ${Z[e]}`,children:[(0,n.jsx)(ei,{type:e}),Q[e]]})}var ea=e.i(24380);function eh({block:e}){let t=(0,r.useMemo)(()=>JSON.stringify(e.input,null,2),[e]);return(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("details",{open:!0,children:[(0,n.jsx)("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:(0,n.jsxs)("span",{className:"inline-flex items-center gap-1",children:["Input",(0,n.jsx)(ea.CopyButton,{text:t})]})}),(0,n.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words max-h-64 overflow-y-auto",children:t})]}),e.result?(0,n.jsxs)("div",{className:"border-l-2 border-primary/50 pl-3 space-y-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"inline-block px-2 py-0.5 text-xs font-mono rounded border bg-primary/20 text-primary border-primary/30",children:"Result"}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:Y(new Date(e.result.timestamp).getTime())})]}),e.result.content&&(0,n.jsxs)("details",{open:!0,children:[(0,n.jsx)("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:(0,n.jsxs)("span",{className:"inline-flex items-center gap-1",children:["Output",(0,n.jsx)(ea.CopyButton,{text:e.result.content})]})}),(0,n.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words max-h-48 overflow-y-auto",children:e.result.content})]}),e.result.images?.map((e,t)=>(0,n.jsx)("img",{src:`data:${e.mediaType};base64,${e.base64}`,alt:`Tool result image ${t+1}`,className:"mt-2 max-w-full rounded border border-border"},t))]}):(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:"Tool did not return a result"})]})}let ed={name:"brain",size:24,node:[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]};ed.node;let ec=(0,_.f)(ed),eu=r.default.memo(function({block:e,entriesBySource:t,projectName:s,sessionId:r,highlightedUuid:l,autoExpandForUuid:i}){switch(e.type){case"text":return(0,n.jsx)("p",{className:"whitespace-pre-wrap text-sm",children:e.text});case"tool_use":if("Task"===e.name&&(e.subagentType||e.subagentId)){let o=e.subagentId&&t?t.get(`agent-${e.subagentId}`):void 0;return(0,n.jsx)(eb,{block:e,subagentEntries:o,projectName:s,sessionId:r,highlightedUuid:l,autoExpandForUuid:i})}return(0,n.jsxs)("div",{className:"border border-border/50 rounded-lg p-3 bg-muted/10",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,n.jsx)(k,{className:"w-4 h-4 text-primary flex-shrink-0"}),(0,n.jsx)("span",{className:"font-mono text-sm text-primary truncate min-w-0",children:e.name}),e.result&&(0,n.jsx)("span",{className:"text-xs text-muted-foreground ml-auto flex-shrink-0",children:e.result.durationFormatted})]}),(0,n.jsx)(eh,{block:e})]});case"thinking":return(0,n.jsx)("div",{className:"border border-[color:var(--chart-5)]/30 rounded-lg p-3 bg-[color:var(--chart-5)]/5",children:(0,n.jsxs)("details",{children:[(0,n.jsxs)("summary",{className:"flex items-center gap-2 text-xs cursor-pointer hover:text-foreground transition-colors text-[color:var(--chart-5)]",children:[(0,n.jsx)(ec,{className:"w-4 h-4"}),(0,n.jsx)("span",{children:"Thinking"}),(0,n.jsxs)("span",{className:"text-muted-foreground ml-1",children:["(",e.thinking.length.toLocaleString()," chars)"]})]}),(0,n.jsx)("p",{className:"mt-2 whitespace-pre-wrap text-xs text-muted-foreground p-2 bg-muted/30 rounded max-h-64 overflow-y-auto",children:e.thinking})]})})}});function em({entry:e}){return(0,n.jsx)("div",{children:e.message.content&&(0,n.jsx)("p",{className:"whitespace-pre-wrap text-sm",children:e.message.content})})}let ef=r.default.memo(function({entry:e,entriesBySource:t,projectName:s,sessionId:r,highlightedUuid:l,autoExpandForUuid:i}){let{content:o}=e.message;return(0,n.jsx)("div",{className:"space-y-3",children:o.map((e,o)=>(0,n.jsx)(eu,{block:e,entriesBySource:t,projectName:s,sessionId:r,highlightedUuid:l,autoExpandForUuid:i},o))})}),ep=r.default.memo(function({entry:e}){let t=(0,r.useMemo)(()=>{if("progress"===e.type){let t=e.raw.data,s=t?.agentId;return[t?.type,s&&`agent:${s}`].filter(Boolean).join(" | ")}return"file-history-snapshot"===e.type?"File history snapshot":e.type},[e.type,e.raw]);return(0,n.jsxs)("div",{className:"text-sm",children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:t}),(0,n.jsxs)("details",{className:"mt-1",children:[(0,n.jsx)("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:"Show raw JSON"}),(0,n.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words max-h-64 overflow-y-auto",children:K(e)})]})]})}),eg={name:"link-2",size:24,node:[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]};eg.node;let ex=(0,_.f)(eg);var ey=e.i(55574);function ev({uuid:e}){let t=(0,r.useCallback)(async()=>{window.history.replaceState(null,"",`#entry-${e}`);try{await navigator.clipboard.writeText(window.location.href)}catch{let e=document.createElement("textarea");e.value=window.location.href,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)}(0,ey.toast)("Link copied")},[e]);return(0,n.jsx)("button",{onClick:t,title:"Copy link to entry",className:"inline-flex items-center justify-center rounded p-1 text-muted-foreground hover:text-foreground hover:bg-muted/80 transition-colors opacity-0 group-hover:opacity-100 transition-opacity",children:(0,n.jsx)(ex,{className:"w-3.5 h-3.5"})})}function eb({block:e,subagentEntries:t,projectName:s,sessionId:l,highlightedUuid:i,autoExpandForUuid:o}){let a=!!(o&&t?.some(e=>e.uuid===o)),[h,d]=(0,r.useState)(a);(0,r.useEffect)(()=>{if(!a)return;let e=requestAnimationFrame(()=>d(!0));return()=>cancelAnimationFrame(e)},[a]);let c=(0,r.useCallback)(()=>{d(e=>!e)},[]),u=t&&t.length>0,m=(0,r.useMemo)(()=>E(t??[]),[t]);return(0,n.jsxs)("div",{className:"border border-border/50 rounded-lg p-3 bg-muted/10",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,n.jsx)(B,{className:"w-4 h-4 text-[color:var(--chart-5)]"}),(0,n.jsx)("span",{className:"font-mono text-sm text-[color:var(--chart-5)]",children:"Subagent"}),e.subagentType&&(0,n.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 text-xs font-mono rounded border bg-[color:var(--chart-5)]/20 text-[color:var(--chart-5)] border-[color:var(--chart-5)]/30",children:e.subagentType}),e.result&&(0,n.jsx)("span",{className:"text-xs text-muted-foreground ml-auto",children:e.result.durationFormatted})]}),e.subagentDescription&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.subagentDescription}),e.subagentId&&t&&(0,n.jsxs)("button",{onClick:c,className:"inline-flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium rounded border border-primary/30 bg-primary/10 text-primary hover:bg-primary/20 transition-colors mb-2",children:[(0,n.jsx)(V.f,{className:(0,X.f)("w-3 h-3 transition-transform",h&&"rotate-90")}),(0,n.jsxs)("span",{children:["agent-",e.subagentId]}),(0,n.jsx)("span",{className:"text-muted-foreground",children:h?"Collapse":"View subagent log"})]}),h&&(0,n.jsxs)("div",{className:"ml-4 pl-3 border-l-2 border-primary/30 mt-2 space-y-2",children:[t&&0===t.length&&(0,n.jsx)("div",{className:"text-xs text-muted-foreground py-2",children:"No entries found in subagent log."}),u&&(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(q,{entries:t,compact:!0})}),t&&t.map(e=>"queue-operation"===e.type?(0,n.jsx)(J,{entry:e},m.get(e)):(0,n.jsx)(ej,{entry:e,projectName:s,sessionId:l,isHighlighted:!!i&&e.uuid===i},m.get(e)))]}),(0,n.jsx)(eh,{block:e})]})}function eS({entry:e,entriesBySource:t,projectName:s,sessionId:r,highlightedUuid:l,autoExpandForUuid:i}){switch(e.type){case"user":return(0,n.jsx)(em,{entry:e});case"assistant":return(0,n.jsx)(ef,{entry:e,entriesBySource:t,projectName:s,sessionId:r,highlightedUuid:l,autoExpandForUuid:i});case"file-history-snapshot":case"progress":case"system":return(0,n.jsx)(ep,{entry:e})}}let ej=r.default.memo(function({entry:e,entriesBySource:t,projectName:s,sessionId:r,isHighlighted:l,highlightedUuid:i,autoExpandForUuid:o}){return(0,n.jsxs)("div",{id:e.uuid?`entry-${e.uuid}`:void 0,className:(0,X.f)(`group border-l-4 ${ee[e.type]} bg-card/50 rounded-r-lg mb-2 hover:bg-muted/30 transition-colors`,l&&"entry-highlighted"),children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-border/30",children:[(0,n.jsx)(eo,{type:e.type}),(0,n.jsxs)("div",{className:"flex items-center gap-1 ml-auto",children:[e.uuid&&(0,n.jsx)(ev,{uuid:e.uuid}),(0,n.jsx)(ea.CopyButton,{text:function(e){switch(e.type){case"user":return e.message.content;case"assistant":return e.message.content.filter(e=>"text"===e.type).map(e=>e.text).join("\n");case"file-history-snapshot":case"progress":case"system":return K(e);case"queue-operation":return e.label}}(e)}),(0,n.jsx)("span",{className:"text-xs font-mono text-muted-foreground whitespace-nowrap",children:Y(e.timestampMs)})]})]}),(0,n.jsx)("div",{className:"px-4 py-3",children:(0,n.jsx)(eS,{entry:e,entriesBySource:t,projectName:s,sessionId:r,highlightedUuid:i,autoExpandForUuid:o})})]})},(e,t)=>e.entry===t.entry&&e.entriesBySource===t.entriesBySource&&e.projectName===t.projectName&&e.sessionId===t.sessionId&&e.isHighlighted===t.isHighlighted&&e.highlightedUuid===t.highlightedUuid&&e.autoExpandForUuid===t.autoExpandForUuid);var ew=e.i(23417),eM=e.i(84026),eN=e.i(29407),e_=e.i(16306),eO=e.i(82954),ek=e.i(73520),eE=e.i(85881);function eC({decision:e}){return"deny"===e?(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-red-500/10 text-red-400 border border-red-500/20",children:[(0,n.jsx)(eN.f,{className:"h-3 w-3"}),"Deny"]}):"instruct"===e?(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-amber-500/10 text-amber-400 border border-amber-500/20",children:[(0,n.jsx)(e_.f,{className:"h-3 w-3"}),"Instruct"]}):(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-emerald-500/10 text-emerald-400 border border-emerald-500/20",children:[(0,n.jsx)(eM.f,{className:"h-3 w-3"}),"Allow"]})}function eI({eventType:e}){return(0,n.jsx)("span",{className:"inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium bg-muted text-muted-foreground border border-border/50",children:e})}function eT({mode:e}){let t="default"===e;return(0,n.jsx)("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium border ${t?"bg-sky-500/10 text-sky-400 border-sky-500/20":"bg-amber-500/10 text-amber-400 border-amber-500/20"}`,children:e})}function ez({ms:e}){return(0,n.jsx)("span",{className:`font-mono text-[0.7rem] ${e>500?"text-red-400":e>100?"text-amber-400":"text-muted-foreground"}`,children:e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`})}function eA({value:e,onChange:t}){return(0,n.jsx)("div",{className:"inline-flex items-center rounded-md border border-border bg-muted/30 p-0.5",children:[{label:"All",value:""},{label:"Allow",value:"allow"},{label:"Instruct",value:"instruct"},{label:"Deny",value:"deny"}].map(s=>(0,n.jsx)("button",{onClick:()=>t(s.value),className:`px-2.5 py-1 text-[0.65rem] font-medium rounded transition-all ${e===s.value?"deny"===s.value?"bg-red-500/15 text-red-400 shadow-sm":"allow"===s.value?"bg-emerald-500/15 text-emerald-400 shadow-sm":"instruct"===s.value?"bg-amber-500/15 text-amber-400 shadow-sm":"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:s.label},s.value))})}function eF({item:e}){return(0,n.jsx)("tr",{children:(0,n.jsx)("td",{colSpan:9,className:"px-0 py-0",children:(0,n.jsxs)("div",{className:"px-6 py-3 bg-muted/20 border-t border-border/30 space-y-2 text-xs animate-expand",children:[(0,n.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-1.5",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Session ID: "}),(0,n.jsx)("span",{className:"font-mono text-foreground",children:e.sessionId??"—"}),e.sessionId&&(0,n.jsx)(ea.CopyButton,{text:e.sessionId})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"CWD: "}),(0,n.jsx)("span",{className:"font-mono text-foreground",children:e.cwd??"—"}),e.cwd&&(0,n.jsx)(ea.CopyButton,{text:e.cwd})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Transcript: "}),(0,n.jsx)("span",{className:"font-mono text-foreground break-all",children:e.transcriptPath??"—"}),e.transcriptPath?.startsWith("opencode-db://")&&(0,n.jsx)("span",{className:"text-muted-foreground ml-1",children:"(stored in opencode DB)"})]})]}),e.policyNames&&e.policyNames.length>1&&(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Policies: "}),(0,n.jsx)("span",{className:"font-mono text-foreground",children:e.policyNames.join(", ")})]}),e.reason&&(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Full reason: "}),(0,n.jsx)("span",{className:"text-foreground",children:e.reason})]})]})})})}function eR({sessionId:e,initialData:t}){let{intervalSec:s}=(0,eE.useAutoRefresh)(),[l,i]=(0,r.useState)(!1),[o,a]=(0,r.useState)(1),[h,d]=(0,r.useState)(t),[c,u]=(0,r.useState)(null),[m,f]=(0,r.useState)(""),[p,g]=(0,r.useState)(""),[x,y]=(0,r.useState)(""),v=(0,r.useRef)(null),b=(0,r.useRef)({filterDecision:m,filterEventType:p,filterPolicy:x});b.current={filterDecision:m,filterEventType:p,filterPolicy:x};let S=""!==m||""!==p||""!==x,j=(0,r.useCallback)(async t=>{try{let{filterDecision:s,filterEventType:n,filterPolicy:r}=b.current,l=await (0,ew.f)({sessionId:e,decision:s||void 0,eventType:n||void 0,policyName:r||void 0},t);d(l)}catch{}},[e]);(0,r.useEffect)(()=>{j(o);let e=setInterval(()=>j(o),s>0?1e3*s:5e3);return()=>clearInterval(e)},[o,j,s]),(0,r.useEffect)(()=>(v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{a(1),u(null),j(1)},300),()=>{v.current&&clearTimeout(v.current)}),[m,p,x]);let w=h.entries,M=h.totalPages;return(0,n.jsxs)("div",{children:[(0,n.jsxs)("button",{onClick:()=>i(e=>!e),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,n.jsx)(N.f,{className:`w-4 h-4 text-muted-foreground transition-transform ${l?"-rotate-90":""}`}),(0,n.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Hook Logs"})]}),!l&&(0,n.jsxs)("div",{className:"mt-2 bg-card border border-border rounded-lg overflow-hidden shadow-sm",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4 py-2.5 border-b border-border bg-muted/20",children:[(0,n.jsx)(eA,{value:m,onChange:f}),(0,n.jsxs)("select",{value:p,onChange:e=>g(e.target.value),className:"h-7 rounded-md border border-border bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/40 transition-shadow",children:[(0,n.jsx)("option",{value:"",children:"All Events"}),(0,n.jsx)("option",{value:"PreToolUse",children:"PreToolUse"}),(0,n.jsx)("option",{value:"PostToolUse",children:"PostToolUse"}),(0,n.jsx)("option",{value:"SessionStart",children:"SessionStart"}),(0,n.jsx)("option",{value:"SessionEnd",children:"SessionEnd"}),(0,n.jsx)("option",{value:"UserPromptSubmit",children:"UserPromptSubmit"}),(0,n.jsx)("option",{value:"PermissionRequest",children:"PermissionRequest"})]}),(0,n.jsx)("div",{className:"relative",children:(0,n.jsx)("input",{type:"text",value:x,onChange:e=>y(e.target.value),placeholder:"Filter by policy…",className:"h-7 rounded-md border border-border bg-background px-2.5 text-xs text-foreground placeholder:text-muted-foreground w-44 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/40 transition-shadow"})})]}),0===w.length?(0,n.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 px-4",children:[(0,n.jsx)(eO.f,{className:"h-10 w-10 text-muted-foreground/30"}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground mt-3",children:S?"No matching hook events.":"No hook events found."})]}):(0,n.jsx)("div",{className:"overflow-x-auto",children:(0,n.jsxs)("table",{className:"w-full text-xs",children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{className:"text-left text-muted-foreground border-b border-border bg-muted/30",children:[(0,n.jsx)("th",{className:"px-4 py-2.5 font-medium w-6"}),(0,n.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Decision"}),(0,n.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Event"}),(0,n.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Tool"}),(0,n.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Policy"}),(0,n.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Reason"}),(0,n.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Duration"}),(0,n.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Mode"}),(0,n.jsx)("th",{className:"px-3 py-2.5 font-medium text-right",children:"Time"})]})}),(0,n.jsx)("tbody",{className:"divide-y divide-border/30",children:w.map((e,t)=>{let s="deny"===e.decision,l=c===t,i="instruct"===e.decision;return(0,n.jsxs)(r.default.Fragment,{children:[(0,n.jsxs)("tr",{onClick:()=>{u(e=>e===t?null:t)},className:`cursor-pointer transition-colors ${s?"bg-red-500/[0.03] hover:bg-red-500/[0.07] border-l-2 border-l-red-500/40":i?"bg-amber-500/[0.03] hover:bg-amber-500/[0.07] border-l-2 border-l-amber-500/40":t%2==0?"hover:bg-muted/30":"bg-muted/[0.04] hover:bg-muted/30"} ${l?"bg-muted/20":""}`,children:[(0,n.jsx)("td",{className:"px-4 py-2",children:(0,n.jsx)(N.f,{className:`h-3.5 w-3.5 text-muted-foreground transition-transform duration-150 ${l?"rotate-0":"-rotate-90"}`})}),(0,n.jsx)("td",{className:"px-3 py-2",children:(0,n.jsx)(eC,{decision:e.decision})}),(0,n.jsx)("td",{className:"px-3 py-2",children:(0,n.jsx)(eI,{eventType:e.eventType})}),(0,n.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:e.toolName??"—"}),(0,n.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:e.policyNames&&e.policyNames.length>1?(0,n.jsxs)("span",{title:e.policyNames.join(", "),children:[e.policyNames[0],(0,n.jsxs)("span",{className:"text-muted-foreground text-[0.6rem]",children:[" +",e.policyNames.length-1]})]}):e.policyName??"—"}),(0,n.jsx)("td",{className:"px-3 py-2 text-muted-foreground truncate max-w-[240px]",title:e.reason??"",children:e.reason??"—"}),(0,n.jsx)("td",{className:"px-3 py-2",children:(0,n.jsx)(ez,{ms:e.durationMs})}),(0,n.jsx)("td",{className:"px-3 py-2",children:e.permissionMode?(0,n.jsx)(eT,{mode:e.permissionMode}):"—"}),(0,n.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground whitespace-nowrap",title:new Date(e.timestamp).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),children:(0,P.g)(e.timestamp)})]}),l&&(0,n.jsx)(eF,{item:e})]},`${e.timestamp}-${t}`)})})]})}),(0,n.jsx)(ek.f,{currentPage:o,totalPages:M,onPageChange:e=>{a(e),u(null)}})]})]})}function eW(e){let t=new Map;for(let s of e)if("assistant"===s.type)for(let e of s.message.content){if("tool_use"!==e.type||"Task"===e.name&&(e.subagentType||e.subagentId))continue;let s=t.get(e.name)||{count:0,totalDurationMs:0};s.count++,e.result?.durationMs&&(s.totalDurationMs+=e.result.durationMs),t.set(e.name,s)}return Array.from(t.entries()).map(([e,t])=>({name:e,...t})).sort((e,t)=>t.count-e.count)}function eL({tools:e,compact:t}){return(0,n.jsx)("div",{className:`bg-card border border-border rounded-lg ${t?"p-3":"p-4"}`,children:(0,n.jsx)("div",{className:`grid grid-cols-[repeat(auto-fit,minmax(200px,1fr))] ${t?"gap-2":"gap-3"}`,children:e.map(e=>(0,n.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,n.jsx)(k,{className:"w-3.5 h-3.5 text-muted-foreground flex-shrink-0"}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("div",{className:`${t?"text-xs":"text-sm"} font-mono font-medium truncate`,children:e.name}),(0,n.jsxs)("div",{className:"text-xs text-muted-foreground truncate",children:[e.count," call",1!==e.count?"s":"",e.totalDurationMs>0&&` \xb7 ${(e.totalDurationMs/1e3).toFixed(1)}s`]})]})]},e.name))})})}function e$(e,t){return t.get(e)??`${e.uuid}-${e.timestampMs}`}function eD(){let e=window.location.hash;return e.startsWith("#entry-")?e.slice(7):null}function eB({entries:e,entriesBySource:t,projectName:s,sessionId:i}){let o=(0,r.useMemo)(()=>Array.from(t.values()).flat(),[t]),[a,h]=(0,r.useState)(new Set),[d,c]=(0,r.useState)(0),[u,m]=(0,r.useState)(()=>eD()),f=(0,r.useRef)(void 0),g=(0,r.useRef)(!1),y=(0,r.useRef)(null);(0,r.useLayoutEffect)(()=>{let e=y.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect().top+window.scrollY;c(e=>e===t?e:t)};t();let s=new ResizeObserver(t);return s.observe(document.body),window.addEventListener("resize",t),()=>{s.disconnect(),window.removeEventListener("resize",t)}},[]);let b=(0,r.useMemo)(()=>E(e),[e]),S=(0,r.useMemo)(()=>(function(e,t){let s=new Map,n=null,r=0;for(let l of e)"queue-operation"===l.type?(null!==n&&s.set(n,r),n=e$(l,t),r=0):null!==n&&r++;return null!==n&&s.set(n,r),s})(e,b),[e,b]),w=(0,r.useMemo)(()=>{let t;return t=!1,e.filter(e=>"queue-operation"===e.type?(t=a.has(e$(e,b)),!0):!t)},[e,a,b]),N=(0,r.useMemo)(()=>{let e=new Map;return w.forEach((t,s)=>{t.uuid&&e.set(t.uuid,s)}),e},[w]),_=(0,r.useMemo)(()=>(function(e){let t=new Map;for(let s of e)if("assistant"===s.type&&s.uuid)for(let e of s.message.content)"tool_use"===e.type&&"Task"===e.name&&e.subagentId&&t.set(e.subagentId,s.uuid);let s=new Map;for(let n of e){if(!n._source?.startsWith("agent-")||!n.uuid)continue;let e=n._source.slice(6),r=t.get(e);r&&s.set(n.uuid,r)}return s})(o),[o]),O=(0,r.useMemo)(()=>u&&_.has(u)?u:null,[u,_]),k=O?_.get(O)??null:null;(0,r.useEffect)(()=>{if(u)return f.current=setTimeout(()=>m(null),4e3),()=>{f.current&&clearTimeout(f.current)}},[]),(0,r.useEffect)(()=>{let e=()=>{let e=eD();m(e),g.current=!1,f.current&&clearTimeout(f.current),e&&(f.current=setTimeout(()=>m(null),4e3))};return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[]);let C=(0,r.useMemo)(()=>{if(!u)return null;let t=k??u,s=e.some(e=>e.uuid===t),n=N.has(t);if(s&&!n){let s=null;for(let n of e)if("queue-operation"===n.type)s=e$(n,b);else if(n.uuid===t&&s)return s}return null},[u,k,e,N,b]);(0,r.useEffect)(()=>{if(!C)return;let e=requestAnimationFrame(()=>{h(e=>{if(!e.has(C))return e;let t=new Set(e);return t.delete(C),t})});return()=>cancelAnimationFrame(e)},[C]);let I=(0,r.useCallback)(e=>{h(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]),T=(0,r.useCallback)(e=>b.get(w[e])??e,[b,w]),z=function({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:s="transform",...n}){let i=r.useReducer(e=>e+1,0)[1],o=r.useRef({enabled:t,mode:s,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});o.current.enabled=t,o.current.mode=s;let a=r.useRef(!1),h=e=>{let t=o.current;if(!t.enabled||!t.container)return;let s=e.getTotalSize();if(s!==t.lastSize){t.lastSize=s;let n=e.options.horizontal?"width":"height";t.container.style[n]=`${s}px`}},d=(e,t,s)=>{let n=o.current,r=!!e.options.horizontal,l=t.start-e.options.scrollMargin;n.lastPositions.get(s)!==l&&(n.lastPositions.set(s,l),"transform"===n.mode?s.style.transform=r?`translate3d(${l}px, 0, 0)`:`translate3d(0, ${l}px, 0)`:s.style[r?"left":"top"]=`${l}px`)},c=e=>{let t=o.current;if(t.enabled&&t.container)for(let t of(h(e),e.getVirtualItems())){let s=e.elementsCache.get(t.key);s&&d(e,t,s)}},u={...n,onChange:(t,s)=>{var r;let h=o.current,d=!0;if(h.enabled){c(t);let e=t.range,s=h.prevRange;(d=!s||s.isScrolling!==t.isScrolling||s.startIndex!==(null==e?void 0:e.startIndex)||s.endIndex!==(null==e?void 0:e.endIndex))&&(h.prevRange=e?{startIndex:e.startIndex,endIndex:e.endIndex,isScrolling:t.isScrolling}:null)}d&&(e&&s&&!a.current?(0,l.flushSync)(i):i()),null==(r=n.onChange)||r.call(n,t,s)}},[m]=r.useState(()=>{let e=new j(u),t=e.measureElement;return e.measureElement=s=>{a.current=!0;try{t(s)}finally{a.current=!1}let n=o.current;if(null!==s&&n.enabled&&n.container){let t=e.measurementsCache[e.indexFromElement(s)];t&&d(e,t,s)}},Object.assign(e,{containerRef:t=>{let s=o.current;s.container=t,s.lastSize=null,null!==t&&c(e)}})});return m.setOptions(u),M(()=>m._didMount(),[]),M(()=>(h(m),m._willUpdate())),M(()=>{c(m)}),m}({getScrollElement:()=>"u">typeof document?window:null,observeElementRect:p,observeElementOffset:x,scrollToFn:v,initialOffset:()=>"u">typeof document?window.scrollY:0,...{count:w.length,estimateSize:e=>(function(e){switch(e.type){case"queue-operation":return 48;case"user":return 90;case"assistant":return 80+120*e.message.content.length;default:return 100}})(w[e]),getItemKey:T,overscan:5,scrollMargin:d}});return(0,r.useEffect)(()=>{if(!u||g.current)return;let e=k??u,t=N.get(e);null!=t&&(g.current=!0,requestAnimationFrame(()=>{z.scrollToIndex(t,{align:"center"})}))},[u,k,N,z]),(0,n.jsx)("div",{ref:y,children:(0,n.jsx)("div",{style:{height:`${z.getTotalSize()}px`,width:"100%",position:"relative"},children:z.getVirtualItems().map(e=>{let r=w[e.index],l=!!u&&r.uuid===(k??u);return(0,n.jsx)("div",{"data-index":e.index,ref:z.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${e.start-z.options.scrollMargin}px)`},children:"queue-operation"===r.type?(0,n.jsx)(J,{entry:r,isCollapsed:a.has(e$(r,b)),entryCount:S.get(e$(r,b))??0,onToggle:()=>I(e$(r,b))}):(0,n.jsx)(ej,{entry:r,entriesBySource:t,projectName:s,sessionId:i,isHighlighted:!O&&l,highlightedUuid:O,autoExpandForUuid:O})},e.key)})})})}let eP=[];e.s(["default",0,function({entries:e,projectName:t,sessionId:s}){let l=(0,r.useMemo)(()=>{let t=new Map;for(let s of e){let e=t.get(s._source);e?e.push(s):t.set(s._source,[s])}return t},[e]),i=l.get("session")??eP,o=(0,r.useMemo)(()=>(function(e){let t=new Map;for(let s of e)if("assistant"===s.type)for(let e of s.message.content)"tool_use"===e.type&&"Task"===e.name&&e.subagentId&&(t.has(e.subagentId)||t.set(e.subagentId,{id:e.subagentId,type:e.subagentType||"unknown",description:e.subagentDescription||""}));return Array.from(t.values())})(e),[e]),a=(0,r.useMemo)(()=>eW(i),[i]),[h,d]=(0,r.useState)(!1),[c,u]=(0,r.useState)(new Set),[m,f]=(0,r.useState)(!1),[p,g]=(0,r.useState)(null);(0,r.useEffect)(()=>{(0,ew.f)({sessionId:s},1).then(e=>{e.entries.length>0&&g(e)}).catch(()=>{})},[s]),(0,r.useEffect)(()=>{let e=()=>{window.location.hash.startsWith("#entry-")&&f(!1)};return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[]);let x=(0,r.useCallback)(e=>{u(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]);return(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsx)(q,{entries:i}),p&&(0,n.jsx)(eR,{sessionId:s,initialData:p},s),o.length>0&&(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("button",{onClick:()=>d(e=>!e),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,n.jsx)(N.f,{className:`w-4 h-4 text-muted-foreground transition-transform ${h?"-rotate-90":""}`}),(0,n.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Subagents"}),(0,n.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",o.length,")"]})]}),!h&&o.map(e=>{let t;return(0,n.jsxs)("div",{className:"pl-3 border-l-2 border-primary/30 space-y-2",children:[(0,n.jsxs)("button",{onClick:()=>x(e.id),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,n.jsx)(N.f,{className:`w-3.5 h-3.5 text-muted-foreground transition-transform ${c.has(e.id)?"-rotate-90":""}`}),(0,n.jsx)("span",{className:"text-sm font-bold",children:e.type}),e.description&&(0,n.jsx)("span",{className:"text-xs text-muted-foreground truncate max-w-[400px]",children:e.description})]}),!c.has(e.id)&&(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(q,{entries:l.get(`agent-${e.id}`)||[],compact:!0}),(t=eW(l.get(`agent-${e.id}`)||[])).length>0?(0,n.jsx)(eL,{tools:t,compact:!0}):null]})]},e.id)})]}),a.length>0&&(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Tools"}),(0,n.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",a.reduce((e,t)=>e+t.count,0),")"]})]}),(0,n.jsx)(eL,{tools:a})]}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("button",{onClick:()=>f(e=>!e),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,n.jsx)(N.f,{className:`w-4 h-4 text-muted-foreground transition-transform ${m?"-rotate-90":""}`}),(0,n.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Logs"})]}),!m&&(0,n.jsx)("div",{className:"mt-2 bg-card border border-border rounded-lg p-4 shadow-sm",children:0===i.length?(0,n.jsx)("p",{className:"text-muted-foreground text-center py-8",children:"No entries found."}):(0,n.jsx)(eB,{entries:i,entriesBySource:l,projectName:t,sessionId:s})})]})]})}],36406)},5780,function(e){e.n(e.i(36406))}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,36406,e=>{"use strict";let t,s;var n=e.i(43476),r=e.i(71645),l=e.i(74080);function i(e,t,s){let n,r=s.initialDeps??[],l=!0;function i(){let i=e();return(i.length!==r.length||i.some((e,t)=>r[t]!==e))&&(r=i,n=t(...i),(null==s?void 0:s.onChange)&&!(l&&s.skipInitialOnChange)&&s.onChange(n),l=!1),n}return i.updateDeps=e=>{r=e},i}function o(e,t){if(void 0!==e)return e;throw Error(`Unexpected undefined${t?`: ${t}`:""}`)}let a=(e,t)=>1.01>Math.abs(e-t),h=()=>{if(void 0!==t)return t;if("u"<typeof navigator)return t=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return t=!0;let e=navigator.maxTouchPoints;return t="MacIntel"===navigator.platform&&void 0!==e&&e>0},d={capture:!0,passive:!0};class c{constructor(e){this.host=e,this._touch=null,this.inMotion=()=>null!==this._touch&&"lateFling"!==this._touch.phase,this.dragging=()=>{var e;return(null==(e=this._touch)?void 0:e.phase)==="down"&&this._touch.moved},this.tail=()=>{var e;return(null==(e=this._touch)?void 0:e.phase)==="tail"?this._touch.moved?"fling":"tap":null},this.onScroll=({isScrolling:e,ownReadBack:t,moved:s,external:n})=>{var r,l,i;return e&&(null==(r=this._touch)?void 0:r.phase)==="tail"?this._openTail(this._touch.moved||!t,!1):(null==(l=this._touch)?void 0:l.phase)==="lateFling"&&(this.host.now()>this._touch.until?this._touch=null:n&&e&&s&&this._openTail(!0,!1)),!t&&!!e&&!!s&&(null==(i=this._touch)?void 0:i.phase)==="down"&&(this._touch.moved=!0,!0)},this.touchStart=()=>{this.end(),this._touch={phase:"down",moved:!1}},this.touchEnd=()=>{var e;let t=(null==(e=this._touch)?void 0:e.phase)==="down"&&this._touch.moved;this.end(),this._openTail(t,t)},this.end=()=>{var e;let t=this.host.getWindow();(null==(e=this._touch)?void 0:e.phase)==="tail"&&null!=t&&t.clearTimeout(this._touch.timerId),this._touch=null},this.listen=e=>{let t=()=>this.touchStart(),s=()=>this.touchEnd();return e.addEventListener("touchstart",t,d),e.addEventListener("touchend",s,d),e.addEventListener("touchcancel",s,d),()=>{e.removeEventListener("touchstart",t,d),e.removeEventListener("touchend",s,d),e.removeEventListener("touchcancel",s,d),this.end()}},this._openTail=(e,t)=>{let s=this.host.getWindow();if(!h()||null==s)return;this.end();let n={phase:"tail",moved:e,awaitingFling:t,timerId:s.setTimeout(()=>{this.host.tailStillMoving()?this._openTail(n.moved,n.awaitingFling):(this._touch=n.awaitingFling?{phase:"lateFling",until:this.host.now()+1e3}:null,this.host.onTailClosed())},150)};this._touch=n}}get touch(){return this._touch}}let u=e=>e,m=e=>{let t=e.overscan*Math.max(e.lanes??1,1),s=Math.max(e.startIndex-t,0),n=Math.min(e.endIndex+t,e.count-1)-s+1,r=Array(n);for(let e=0;e<n;e++)r[e]=s+e;return r},f={passive:!0},p=(e,t)=>{let s=e.scrollElement;if(!s)return;let n=()=>{t({width:s.innerWidth,height:s.innerHeight})};return n(),s.addEventListener("resize",n,f),()=>{s.removeEventListener("resize",n)}},g="u"<typeof window||"onscrollend"in window,x=(e,t)=>((e,t,s)=>{var n,r;let l,i=e.scrollElement;if(!i)return;let o=e.targetWindow;if(!o)return;let a=e.options.useScrollendEvent&&g,h=0,d=a?null:(n=()=>t(s(i),!1),r=e.options.isScrollingResetDelay,Object.assign(function(...e){o.clearTimeout(l),l=o.setTimeout(()=>n.apply(this,e),r)},{cancel:()=>{o.clearTimeout(l)}})),c=e=>()=>{h=s(i),null==d||d(),t(h,e)},u=c(!0),m=c(!1);return i.addEventListener("scroll",u,f),a&&i.addEventListener("scrollend",m,f),()=>{i.removeEventListener("scroll",u),a&&i.removeEventListener("scrollend",m),null==d||d.cancel()}})(e,t,t=>e.options.horizontal?t.scrollX:t.scrollY),y=(e,t,s)=>{if(s.options.useCachedMeasurements){let t=s.indexFromElement(e),n=s.options.getItemKey(t);return s.itemSizeCache.get(n)??s.options.estimateSize(t)}if(null==t?void 0:t.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[s.options.horizontal?"inlineSize":"blockSize"])}if(!t){let t=s.indexFromElement(e),n=s.options.getItemKey(t),r=s.itemSizeCache.get(n);if(void 0!==r)return r}return e[s.options.horizontal?"offsetWidth":"offsetHeight"]},v=(e,{adjustments:t=0,behavior:s},n)=>{var r,l;null==(l=null==(r=n.scrollElement)?void 0:r.scrollTo)||l.call(r,{[n.options.horizontal?"left":"top"]:e+t,behavior:s})},b=(e,t)=>"smooth"===e?t?"smoothLanded":"smooth":"instant",S=e=>(null==e?void 0:e.phase)==="smooth"||(null==e?void 0:e.phase)==="smoothLanded";class j{constructor(e){let t,s,n,r;this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this._holdOffset=0,this._reportedOverscroll=!1,this._iosGesture=new c({getWindow:()=>this.targetWindow,now:()=>this.now(),tailStillMoving:()=>{let e=this.scrollState;if((null==e?void 0:e.phase)!=="queued"||null!==this.pendingWrite)return!1;let t=this._readElementOffset();return!(null===t||null===this._lastElementOffset||1>Math.abs(t-this._lastElementOffset))&&(this._lastElementOffset=t,e.samples=[...e.samples??[],{t:this.now(),offset:t}],!0)},onTailClosed:()=>{let e=this.scrollState;(null==e?void 0:e.phase)==="queued"&&function(e){let t=e[e.length-1];if(void 0===t)return!1;let s=e.length-2;for(;s>=0&&t.t-e[s].t<40;)s--;if(s<0)return!1;let n=e[s];return Math.abs(t.offset-n.offset)/(t.t-n.t)>=.05}(e.samples??[])&&(this.scrollState=null),this._flushHoldIfReady(!0),this._writeAwaitingCommand()}}),this._lastElementOffset=null,this.pendingWrite=null,this._clampedAdjustment=null,this.elementsCache=new Map,this._resizeBatch=null,this.now=()=>{var e,t,s;return(null==(s=null==(t=null==(e=this.targetWindow)?void 0:e.performance)?void 0:t.now)?void 0:s.call(t))??Date.now()},this.observer=(t=null,s=null,n=()=>{let e;if(t)return t;let n=this.targetWindow;if(!n||!n.ResizeObserver)return null;let l=(e=new Set,s={schedule:t=>{let s=n.requestAnimationFrame(()=>{e.delete(s),t()});e.add(s)},cancel:()=>{e.forEach(e=>n.cancelAnimationFrame(e)),e.clear()}});return t=new n.ResizeObserver(e=>{let t=()=>{let t={sync:!1};this._resizeBatch=t;try{e.forEach(r)}finally{this._resizeBatch=null,t.notify&&(this.notify(t.sync),this._noteClampMax(),this._flushHoldIfReady(!0),this._retryClampedAdjustment())}};this.options.useAnimationFrameWithResizeObserver?l.schedule(t):t()})},r=e=>{let t=e.target,s=this.indexFromElement(t);if(!t.isConnected){for(let[e,s]of(this.observer.unobserve(t),this.elementsCache))if(s===t){this.elementsCache.delete(e);break}return}this.isIndexInRange(s)&&this.shouldMeasureDuringScroll(s)&&this.resizeItem(s,this.options.measureElement(t,e,this))},{disconnect:()=>{var e;null==(e=n())||e.disconnect(),null==s||s.cancel(),t=null,s=null},observe:e=>{var t;return null==(t=n())?void 0:t.observe(e,{box:"border-box"})},unobserve:e=>{var t;return null==(t=n())?void 0:t.unobserve(e)}}),this.range=null,this.setOptions=e=>{var t;let s={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:u,rangeExtractor:m,onChange:()=>{},measureElement:y,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(let t in e){let n=e[t];void 0!==n&&(s[t]=n)}let n=this.options,r=null,l=null,i=!1;if(void 0!==n&&n.enabled&&s.enabled&&"end"===s.anchorTo&&null!==this.scrollElement){let e=n.count,o=s.count,a=this.getMeasurements(),h=(null==(t=this._singleLaneMeasurements)?void 0:t.items)??a,d=e=>{var t;return"object"==typeof(t=h[e])?t.key:t},c=e>0?d(0):null,u=e>0?d(e-1):null;if(o!==e||e>0&&o>0&&(s.getItemKey(0)!==c||s.getItemKey(o-1)!==u)){i=!0;let t=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??a[0]:null;t&&(r=[t.key,this.getScrollOffset()-t.start]);let h=!0===s.followOnAppend?"auto":s.followOnAppend||null;h&&o>0&&this.isAtEnd(n.scrollEndThreshold)&&(0===e||s.getItemKey(o-1)!==u)&&(o>e||function(e,t,s,n){if(0===t)return!1;let r=n(0),l=new Set,i=0;for(;i<e;){let e=s(i);if(e===r)break;l.add(e),i++}let o=e-i;if(0===o||o>=t)return!1;for(let e=0;e<o;e++)if(n(e)!==s(i+e))return!1;for(let e=o;e<t;e++)if(l.has(n(e)))return!1;return!0}(e,o,d,s.getItemKey))&&(l=h)}}this.options=s,i&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=null;if(r&&null!==this.scrollOffset&&!this._awaitingCommandReadBack()){let[e,t]=r,s=this.getMeasurements(),{count:n,getItemKey:i}=this.options,a=0;for(;a<n&&i(a)!==e;)a++;if(a<n){let e=s[a];if(e){let s=Math.max(0,e.start+t);l||s===this.scrollOffset||(o=s-this.scrollOffset,this.scrollOffset=s)}}}l?this.pendingScrollAnchor={kind:"follow",behavior:l}:null!==o&&(this._canWriteScroll()?this.pendingScrollAnchor={kind:"anchor",delta:o}:(this._holdOffset+=o,this._followOffsetTarget(o)))},this.notify=e=>{var t,s;null==(s=(t=this.options).onChange)||s.call(t,this,e)},this.maybeNotify=i(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{var e;this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),null!=this.rafId&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,null==(e=this._momentumStop)||e.restore(),this._momentumStop=null,this.isScrolling=!1,this.scrollDirection=null,this._holdOffset=0,this._reportedOverscroll=!1,this._clampedAdjustment=null,this.pendingWrite=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;let t=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==t){if(this.cleanup(),!t)return void this.maybeNotify();this.scrollElement=t,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(e=this.scrollElement)?void 0:e.window)??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{var s,n,r,l;let i=t?this._elementMaxScrollOffset():null,o=this._reportedOverscroll;this._reportedOverscroll=e<0||null!==i&&e>i+1;let h=e;this._lastElementOffset=h,e=this._toLayoutOffset(e);let d=this._classifyScrollEvent(e,t,i);if("spurious"===d)return;"readBack"===d?e=this.pendingWrite.target:"clampedReadBack"===d&&(null==(s=this.scrollState)?void 0:s.index)!=null&&e<this.getMaxScrollOffset()-1.5?this.scrollState.lastTargetOffset=e:function({kind:e,offset:t,command:s,target:n}){let r;return"spurious"!==e&&"readBack"!==e&&"clampedReadBack"!==e&&(null==s?void 0:s.index)!=null&&"queued"!==s.phase&&"smooth"!==(r=s.phase)&&"smoothFinishing"!==r&&!a(t,s.lastTargetOffset)&&!a(t,n())&&"clampedEcho"!==e}({kind:d,offset:e,command:this.scrollState,target:()=>this.getScrollStateTarget(this.scrollState)})&&(this.scrollState=null),this.pendingWrite=null,null!==this._clampedAdjustment&&Math.abs(e-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null);let c=this.getScrollOffset(),u=this.scrollDirection;this.scrollDirection=t?c===e?this.scrollDirection:c<e?"forward":"backward":null,this.scrollOffset=e,this.isScrolling=t;let m=this.scrollState;if((null==m?void 0:m.phase)==="queued"&&"external"===d&&t)if(o||this._reportedOverscroll)m.samples=[];else{let e=this.now();m.samples=[...(m.samples??[]).filter(t=>e-t.t<=200),{t:e,offset:h}],(null!==u&&this.scrollDirection!==u||function(e){let t=e[e.length-1];if(void 0===t)return!1;let s=e.length-2;for(;s>=0&&t.t-e[s].t<40;)s--;if(s<0)return!1;let n=e[s],r=s-1;for(;r>=0&&n.t-e[r].t<40;)r--;if(r<0)return!1;let l=e[r],i=(t.offset-n.offset)/(t.t-n.t),o=(n.offset-l.offset)/(n.t-l.t);return i*o>=0&&Math.abs(i)>=2*Math.abs(o)&&Math.abs(i)-Math.abs(o)>=.8}(m.samples))&&(this.scrollState=null)}this._iosGesture.onScroll({isScrolling:t,ownReadBack:"readBack"===d,moved:e!==c,external:"external"===d&&(null==(n=this.scrollState)?void 0:n.phase)!=="smooth"&&(null==(r=this.scrollState)?void 0:r.phase)!=="smoothFinishing"})&&(null==(l=this.scrollState)?void 0:l.phase)==="queued"&&(this.scrollState=null),this._flushHoldIfReady(!0),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement&&this.unsubs.push(this._iosGesture.listen(this.scrollElement)),this._scrollToOffset(this.getScrollOffset())}this._noteClampMax();let s=this.pendingScrollAnchor;this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled&&("anchor"===s.kind?this._canWriteScroll()?S(this.scrollState)&&!a(this.getScrollOffset()-s.delta,this.scrollState.lastTargetOffset)||(this._followOffsetTarget(s.delta),this._scrollToOffset(this.getScrollOffset())):(this._holdOffset+=s.delta,this._followOffsetTarget(s.delta),this.notify(!1)):this.scrollToEnd({behavior:s.behavior})),this._flushHoldIfReady(!1),this._retryClampedAdjustment()},this._classifyScrollEvent=(e,t,s)=>{var n;return function({offset:e,isScrolling:t,elementMax:s,holdOffset:n,scrollOffset:r,pendingWrite:l,clampedMaxAtWrite:i}){var o;return t&&null===l&&e===r?"spurious":null!==l&&1.5>Math.abs(e-l.target)?"readBack":null!==l&&!l.smooth&&null!==s&&l.target>s+n+.5&&1.5>Math.abs(e-(s+n))||null!==l&&!l.smooth&&(null==(o=l.lowMaxes)?void 0:o.some(t=>1.5>Math.abs(e-t)))?"clampedReadBack":null!==i&&1.5>Math.abs(e-i)?"clampedEcho":"external"}({offset:e,isScrolling:t,elementMax:s,holdOffset:this._holdOffset,scrollOffset:this.scrollOffset,pendingWrite:this.pendingWrite,clampedMaxAtWrite:(null==(n=this._clampedAdjustment)?void 0:n.maxAtWrite)??null})},this._retryClampedAdjustment=()=>{if(null===this._clampedAdjustment||!this.scrollElement||!this.options.enabled)return;let{target:e,maxAtWrite:t}=this._clampedAdjustment,s=this.getMaxScrollOffset();s>t+.5&&(this._clampedAdjustment=e>s+.5?{target:e,maxAtWrite:s}:null,this._scrollToOffset(e))},this._writeAwaitingCommand=()=>{let e=this.scrollState;if(null===e||"queued"!==e.phase)return;let{behavior:t}=e;this.getMeasurements();let s=this.getScrollStateTarget(e);e.lastTargetOffset=s,this._clampedAdjustment=null,e.phase=b(t,null!=e.index&&a(s,this.getScrollOffset())),this._scrollToOffset(s,{behavior:t}),this.scheduleScrollReconcile()},this._readElementOffset=()=>{let e=this.scrollElement;if(null==e)return null;let{horizontal:t,isRtl:s}=this.options;return"number"==typeof e.scrollTop?t?e.scrollLeft*(s&&-1||1):e.scrollTop:"number"==typeof e.scrollY?t?e.scrollX:e.scrollY:null},this._canWriteScroll=()=>!(h()&&this._iosGesture.inMotion())&&!this._reportedOverscroll,this._flushHoldIfReady=e=>{var t;if(0===this._holdOffset||!this.scrollElement||!this.options.enabled||!this._canWriteScroll()||(null==(t=this.scrollState)?void 0:t.phase)==="smooth")return;this._holdOffset=0,null!==this.scrollOffset&&this.scrollOffset<0&&(this.scrollOffset=0),this.notify(e);let s=this.getCommandWrittenOffset()??this.getScrollOffset();this._clampedAdjustment=this._clampedBy(s),this._scrollToOffset(s)},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??("function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=i(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,s,n,r,l,i,o)=>(void 0!==this.prevLanes&&this.prevLanes!==l&&(this.lanesChangedFlag=!0),this.prevLanes=l,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:s,getItemKey:n,enabled:r,lanes:l,laneAssignmentMode:i,gap:o}),{key:!1}),this.isIndexInRange=e=>e>=0&&e<this.options.count,this.getMeasurements=i(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:s,getItemKey:n,enabled:r,lanes:l,laneAssignmentMode:i,gap:o},a)=>{var h,d;let c=this.itemSizeCache;if(!r)return this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),0!==this.measurementsCache.length||this.lanesSettling||(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),1===l){let r,l,i=2*e,a=null==(h=this._singleLaneMeasurements)?void 0:h.flat;if(!a||a.length<i){let e=new Float64Array(i);a&&u>0&&e.set(a.subarray(0,2*u)),a=e}let m=0===u?Array(e):this._singleLaneMeasurements.items.slice();if(0===u)r=t+s;else{let e=u-1;r=a[2*e]+a[2*e+1]+o}for(let t=u;t<e;t++){let e=n(t);m[t]=e;let s=c.get(e),l="number"==typeof s?s:this.options.estimateSize(t);a[2*t]=r,a[2*t+1]=l,r+=l+o}this._singleLaneMeasurements={flat:a,items:m};let f=(d=a,l=m.length,new Proxy(m,{get(e,t,s){if("string"==typeof t){let s=t.charCodeAt(0);if(s>=48&&s<=57){let s=+t;if(Number.isInteger(s)&&s>=0&&s<l){let t=e[s];if("object"!=typeof t){let n=d[2*s];t=e[s]={index:s,key:t,start:n,size:d[2*s+1],end:n+d[2*s+1],lane:0}}return t}}if("length"===t)return l}return Reflect.get(e,t,s)}}));return this.measurementsCache=f,f}let m=this.measurementsCache.slice(0,u),f=Array(l).fill(void 0),p=new Float64Array(l),g=0;for(let e=0;e<u;e++){let t=m[e];t&&(void 0===f[t.lane]&&g++,f[t.lane]=e,p[t.lane]=t.end)}for(let r=u;r<e;r++){let e,a,h=n(r),d=this.laneAssignments.get(r),u="estimate"===i||c.has(h);if(void 0!==d&&this.options.lanes>1){let n=f[e=d],r=void 0!==n?m[n]:void 0;a=r?r.end+o:t+s}else if(g===l){let t=0,s=p[0],n=f[0];for(let e=1;e<l;e++){let r=p[e];(r<s||r===s&&f[e]<n)&&(t=e,s=r,n=f[e])}e=t,a=s+o,u&&this.laneAssignments.set(r,e)}else e=r%this.options.lanes,a=t+s,u&&this.laneAssignments.set(r,e);let x=c.get(h),y="number"==typeof x?x:this.options.estimateSize(r),v=a+y;m[r]={index:r,start:a,size:y,end:v,key:h,lane:e},void 0===f[e]&&g++,f[e]=r,p[e]=v}return this.measurementsCache=m,m},{key:!1,debug:()=>this.options.debug}),this.calculateRange=i(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,s,n)=>0===e.length||0===t?(this.range=null,null):(this.range=function(e,t,s,n,r){let l=e.length-1;if(e.length<=n)return{startIndex:0,endIndex:l};if(1===n&&null!==r){let e=function(e,t,s){let n=0;for(;n<=t;){let r=(n+t)/2|0,l=e[2*r];if(l<s)n=r+1;else{if(!(l>s))return r;t=r-1}}return n>0?n-1:0}(r,l,s),n=e,i=s+t;for(;n<l&&r[2*n]+r[2*n+1]<i;)n++;return{startIndex:e,endIndex:n}}let i=w(0,l,t=>e[t].start,s),o=i;if(1===n)for(;o<l&&e[o].end<s+t;)o++;else if(n>1){let r=Array(n).fill(0);for(;o<l&&r.some(e=>e<s+t);){let t=e[o];r[t.lane]=t.end,o++}let a=Array(n).fill(s+t);for(;i>=0&&a.some(e=>e>=s);){let t=e[i];a[t.lane]=t.start,i--}i=Math.max(0,i-i%n),o=Math.min(l,o+(n-1-o%n))}return{startIndex:i,endIndex:o}}(e,t,s,n,1===n&&null!==this._singleLaneMeasurements?this._singleLaneMeasurements.flat:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=i(()=>{let e=null,t=null,s=this.calculateRange();return s&&(e=s.startIndex,t=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t,this.options.lanes]},(e,t,s,n,r,l)=>null===n||null===r?[]:e({startIndex:n,endIndex:r,overscan:t,count:s,lanes:l}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,s=e.getAttribute(t);return s?parseInt(s,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{var t;if(!S(this.scrollState))return!0;let s=this.scrollState.index??(null==(t=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))?void 0:t.index);if(void 0!==s&&this.range){let t=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),n=Math.max(0,s-t),r=Math.min(this.options.count-1,s+t);return e>=n&&e<=r}return!0},this.measureElement=e=>{if(!e)return void this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});let t=this.indexFromElement(e);if(!this.isIndexInRange(t))return;let s=this.options.getItemKey(t),n=this.elementsCache.get(s);n!==e&&(n&&this.observer.unobserve(n),this.observer.observe(e),this.elementsCache.set(s,e)),e.isConnected&&(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{var s,n,r;let l,i,o;if(!this.isIndexInRange(e))return;(null==(s=this._resizeBatch)?void 0:s.sync)&&this.getMeasurements();let a=null==(n=this._singleLaneMeasurements)?void 0:n.flat;if(1===this.options.lanes&&null!=a)o=this.options.getItemKey(e),i=a[2*e],l=a[2*e+1];else{let t=this.measurementsCache[e];if(!t)return;o=t.key,i=t.start,l=t.size}let h=this.itemSizeCache.get(o)??l,d=t-h;if(0!==d){let s="end"===this.options.anchorTo&&!S(this.scrollState)&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,n=s?this._getLayoutTotalSize():0,a=this.getScrollOffset(),c=this.itemSizeCache.has(o)?i+h<=a&&"backward"!==this.scrollDirection:i<a,u=!S(this.scrollState)&&(void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:o,start:i,size:l,end:i+l,lane:0},d,this):c);(null===this.pendingMin||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(o,t),this.itemSizeCacheVersion++;let m=!1;if(!this._awaitingCommandReadBack()&&(s?m=this.applyScrollAdjustment(this._getLayoutTotalSize()-n):u&&(m=this.applyScrollAdjustment(d))),this._resizeBatch){this._resizeBatch.notify=!0,(r=this._resizeBatch).sync||(r.sync=m);return}this.notify(m),this._noteClampMax(),this._flushHoldIfReady(!0),this._retryClampedAdjustment()}},this.getVirtualItems=i(()=>[this.getVirtualIndexes(),this.getMeasurements(),this._holdOffset],(e,t,s)=>{let n=[];for(let r=0,l=e.length;r<l;r++){let l=t[e[r]];n.push(0===s?l:{...l,start:l.start-s,end:l.end-s})}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{var t;let s=this.getMeasurements();if(0===s.length)return;let n=null==(t=this._singleLaneMeasurements)?void 0:t.flat,r=1===this.options.lanes&&null!=n,l=w(0,s.length-1,r?e=>n[2*e]:e=>o(s[e]).start,e);return o(s[l])},this._noteClampMax=()=>{if(!this._awaitingCommandReadBack())return;let e=this._elementMaxScrollOffset();if(null===e)return;let t=this.pendingWrite,s=Math.max(e,0)+this._holdOffset;if(s>=t.target)return;let n=t.lowMaxes??(t.lowMaxes=[]);n[n.length-1]!==s&&n.push(s)},this.getMaxScrollOffset=()=>(this._elementMaxScrollOffset()??0)+this._holdOffset,this._toLayoutOffset=e=>{var t;let s=e+this._holdOffset;return(null==(t=this.pendingScrollAnchor)?void 0:t.kind)==="anchor"&&(s+=this.pendingScrollAnchor.delta),s},this._elementMaxScrollOffset=()=>{let e=this.scrollElement;if(null===e)return null;if("scrollHeight"in e)return this.options.horizontal?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight;if("document"in e){let t=e.document.documentElement;return this.options.horizontal?t.scrollWidth-e.innerWidth:t.scrollHeight-e.innerHeight}return null},this._momentumStop=null,this._stopMomentum=e=>{let t=this.scrollElement,s=this.targetWindow;if(null===t||null===s)return;let n="document"in t?t.document.scrollingElement:t;if(!(null==n?void 0:n.style))return;if(this._momentumStop){this._momentumStop.done=e;return}let{style:r}=n,l=this.options.horizontal?"overflow-x":"overflow-y",i=r.getPropertyValue(l),o=r.getPropertyPriority(l);r.setProperty(l,"hidden","important");let a={restore:()=>"hidden"===r.getPropertyValue(l)&&"important"===r.getPropertyPriority(l)&&(r.setProperty(l,i,o),!0),done:e};this._momentumStop=a,s.requestAnimationFrame(()=>s.requestAnimationFrame(()=>{this._momentumStop===a&&(this._momentumStop=null,a.restore()&&a.done())}))},this._clampedBy=e=>{let t=this._elementMaxScrollOffset();if(null===t)return null;let s=t+this._holdOffset;return e>s+.5?{target:e,maxAtWrite:s}:null},this.getVirtualDistanceFromEnd=()=>Math.max(this._getLayoutTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,s=0)=>{if(!this.scrollElement)return 0;let n=this.getSize(),r=this.getScrollOffset();return"auto"===t&&(t=e>=r+n?"end":"start"),"center"===t?e+=(s-n)/2:"end"===t&&(e-=n),Math.max(Math.min(this.getMaxScrollOffset(),e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));let s=this.getSize(),n=this.getScrollOffset(),r=this.measurementsCache[e];if(!r)return;if("auto"===t)if(r.end>=n+s-this.options.scrollPaddingEnd)t="end";else{if(!(r.start<=n+this.options.scrollPaddingStart))return[n,t];t="start"}if("end"===t&&e===this.options.count-1){let e=this.getMaxScrollOffset();return[Math.max(Math.min(e-this.options.paddingEnd+this.options.scrollPaddingEnd,e),0),t]}let l="end"===t?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(l,t,r.size),t]},this.scrollToOffset=(e,{align:t="start",behavior:s="auto"}={})=>{this._startScroll({index:null,align:t},this.getOffsetForAlignment(e,t),s,"absolute")},this.scrollToIndex=(e,{align:t="auto",behavior:s="auto"}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getOffsetForIndex(e,t);if(!n)return;let[r,l]=n;this._startScroll({index:e,align:l},r,s,"absolute")},this.scrollBy=(e,{behavior:t="auto"}={})=>{let s=this.getOffsetForAlignment((this.getCommandWrittenOffset()??this.getScrollOffset())+e,"start");this._startScroll({index:null,align:"start"},s,t,"relative")},this.scrollToEnd=({behavior:e="auto"}={})=>{this.options.count>0?this._startScroll({index:this.options.count-1,align:"end",toEnd:!0},Math.max(this.getMaxScrollOffset(),0),e,"absolute"):this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.cancelScroll=()=>{null!=this.rafId&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null},this.getTotalSize=()=>Math.max(this._getLayoutTotalSize()-this._holdOffset,0),this._getLayoutTotalSize=()=>{var e,t;let s,n=this.getMeasurements();if(0===n.length)s=this.options.paddingStart;else if(1===this.options.lanes){let r=n.length-1,l=null==(e=this._singleLaneMeasurements)?void 0:e.flat;s=null!=l?l[2*r]+l[2*r+1]:(null==(t=n[r])?void 0:t.end)??0}else{let e=Array(this.options.lanes).fill(null),t=n.length-1;for(;t>=0&&e.some(e=>null===e);){let s=n[t];null===e[s.lane]&&(e[s.lane]=s.end),t--}s=Math.max(...e.filter(e=>null!==e))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(0===this.itemSizeCache.size)return e;for(let t of this.getMeasurements())t&&this.itemSizeCache.has(t.key)&&e.push({index:t.index,key:t.key,start:t.start,size:t.size,end:t.end,lane:t.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:s}={})=>{let n={target:e+(t??0),smooth:"smooth"===s};return this.pendingWrite=n,this.options.scrollToFn(e-this._holdOffset,{behavior:s,adjustments:t},this),n},this.getCommandWrittenOffset=()=>null===this.scrollState||null===this.pendingWrite||this.pendingWrite.smooth?null:this.pendingWrite.target,this._awaitingCommandReadBack=()=>{let e=this.getCommandWrittenOffset();return!(h()&&this._iosGesture.dragging())&&null!==e&&!a(e,this.getScrollOffset())},this._followOffsetTarget=e=>{null!==this.scrollState&&null==this.scrollState.index&&(this.scrollState.lastTargetOffset+=e)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}get scrollAdjustments(){return 0}applyScrollAdjustment(e,t){if(0===e)return!1;if(this._followOffsetTarget(e),!this._canWriteScroll())return this._holdOffset+=e,null!==this.scrollOffset&&(this.scrollOffset+=e),!0;{let s=this.getScrollOffset();this._clampedAdjustment=this._clampedBy(s+e);let n=this._scrollToOffset(s,{adjustments:e,behavior:t});return null!==this.scrollOffset&&(this.pendingWrite===n&&(this.scrollOffset+=e),this.scrollOffset<0&&(this.scrollOffset=0)),!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}null==this.rafId&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}getScrollStateTarget(e){let t=e.toEnd?[Math.max(this.getMaxScrollOffset(),0)]:null!=e.index?this.getOffsetForIndex(e.index,e.align):void 0;return t?t[0]:e.lastTargetOffset}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}if("queued"===this.scrollState.phase)return void this.scheduleScrollReconcile();this.getMeasurements();let e=this.getScrollStateTarget(this.scrollState),t=null==this.scrollState.index?1:this.options.useAnimationFrameWithResizeObserver?3:2,s=e!==this.scrollState.lastTargetOffset;if(!s&&a(e,this.getScrollOffset())){if("smooth"===this.scrollState.phase?this.scrollState.phase="smoothLanded":"smoothFinishing"===this.scrollState.phase&&(this.scrollState.phase="instant"),this.scrollState.stableFrames++,this.scrollState.stableFrames>=t){this.getScrollOffset()!==e&&this._scrollToOffset(e,{behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,s){let t=this.getSize()||600,s=Math.abs(e-this.getScrollOffset()),n=S(this.scrollState)&&s>t;this.scrollState.lastTargetOffset=e,n?this.scrollState.phase="smooth":"smooth"===this.scrollState.phase?this.scrollState.phase="smoothFinishing":"smoothLanded"===this.scrollState.phase&&(this.scrollState.phase="instant"),this._scrollToOffset(e,{behavior:n?"smooth":"auto"})}this.scheduleScrollReconcile()}_startScroll(e,t,n,r){let l=this._iosGesture.tail();if("absolute"===r&&null!==l){if("fling"===l&&(void 0!==s?s:s=h()&&"u">typeof CSS&&"function"==typeof CSS.supports&&CSS.supports("overflow-anchor: auto"))){this._stopMomentum(()=>{let e=this.scrollState;(null==e?void 0:e.phase)!=="queued"||"fling"!==this._iosGesture.tail()||this._reportedOverscroll||(this._iosGesture.end(),this._flushHoldIfReady(!0),this._writeAwaitingCommand())}),this.scrollState={...e,startedAt:this.now(),lastTargetOffset:t,stableFrames:0,phase:"queued",behavior:n,samples:[]},this.scheduleScrollReconcile();return}this._iosGesture.end()}this.scrollState={...e,startedAt:this.now(),lastTargetOffset:t,stableFrames:0,behavior:n,phase:b(n,null!=e.index&&a(t,this.getScrollOffset()))},this._scrollToOffset(t,{behavior:n}),this.scheduleScrollReconcile()}}let w=(e,t,s,n)=>{for(;e<=t;){let r=(e+t)/2|0,l=s(r);if(l<n)e=r+1;else{if(!(l>n))return r;t=r-1}}return e>0?e-1:0},M="u">typeof document?r.useLayoutEffect:r.useEffect;var N=e.i(16327),_=e.i(56420);let O={name:"wrench",size:24,node:[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]};O.node;let k=(0,_.f)(O);function E(e){let t=new Map,s=new Map;for(let n of e){let e=n.uuid||`${n._source}:${n.timestamp}`,r=s.get(e)??0;s.set(e,r+1),t.set(n,0===r?e:`${e}#${r}`)}return t}let C={name:"user",size:24,node:[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]};C.node;let I=(0,_.f)(C),T={name:"bot",size:24,node:[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]};T.node;let z=(0,_.f)(T),A={name:"cpu",size:24,node:[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]};A.node;let F=(0,_.f)(A),R={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};R.node;let W=(0,_.f)(R),L={name:"message-square",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]};L.node;let $=(0,_.f)(L),D={name:"workflow",size:24,node:[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]};D.node;let B=(0,_.f)(D);var P=e.i(34713);let q=r.default.memo(function({entries:e,compact:t=!1}){let s=(0,r.useMemo)(()=>(function(e){let t=0,s=0,n=0,r=0,l=0,i=new Set;for(let o of e)if("user"===o.type&&t++,"queue-operation"===o.type&&l++,"assistant"===o.type){for(let e of(s++,o.message.content))"tool_use"===e.type&&("Task"===e.name&&(e.subagentType||e.subagentId)?r++:n++);o.message.model&&i.add(o.message.model)}let o="";if(e.length>=2){let t=e[e.length-1].timestampMs-e[0].timestampMs;o=(0,P.M)(t)}return{turnCount:l,userCount:t,assistantCount:s,toolCallCount:n,subagentCount:r,duration:o,models:Array.from(i)}})(e),[e]),l=t?"w-3.5 h-3.5":"w-4 h-4",i=t?"text-xs font-medium":"text-sm font-medium",o=t?"text-[10px] text-muted-foreground":"text-xs text-muted-foreground",a=[...t?[]:[{Icon:$,color:"text-primary",v:s.turnCount,l:"Turns"}],{Icon:I,color:"text-[color:var(--chart-1)]",v:s.userCount,l:"User"},{Icon:z,color:"text-[color:var(--chart-2)]",v:s.assistantCount,l:"Assistant"},{Icon:k,color:"text-[color:var(--chart-3)]",v:s.toolCallCount,l:t?"Tools":"Tool Calls"},{Icon:B,color:"text-[color:var(--chart-5)]",v:s.subagentCount,l:"Subagents"},{Icon:W,color:"text-[color:var(--chart-4)]",v:s.duration||"—",l:"Duration"},{Icon:F,color:"text-[color:var(--chart-5)]",v:s.models.length>0?s.models.join(", "):"—",l:t?"Model":"Model(s)"}];return(0,n.jsx)("div",{className:t?"bg-muted/30 border border-border/50 rounded-lg p-3 mb-3":"bg-card border border-border rounded-lg p-4",children:(0,n.jsx)("div",{className:`grid grid-cols-2 ${t?"sm:grid-cols-6 gap-3":"sm:grid-cols-4 lg:grid-cols-7 gap-4"}`,children:a.map(({Icon:e,color:t,v:s,l:r})=>(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(e,{className:`${l} ${t}`}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:`${i} truncate max-w-[120px]`,children:s}),(0,n.jsx)("div",{className:o,children:r})]})]},r))})})}),U={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};U.node;let H=(0,_.f)(U);var V=e.i(67927);function K(e){return JSON.stringify(e.raw,null,2)}let G=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0});function Y(e){let t=new Date(e),s=G.format(t),n=t.getMilliseconds().toString().padStart(3,"0");return`${s}.${n}`}let J=r.default.memo(function({entry:e,isCollapsed:t,entryCount:s,onToggle:r}){let l="function"==typeof r,i=(0,n.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full bg-primary/10 border border-primary/20 text-primary text-xs font-medium${l?" group-hover:bg-primary/20 transition-colors":""}`,children:[l?(0,n.jsx)(V.f,{className:`w-3 h-3 transition-transform ${t?"":"rotate-90"}`}):(0,n.jsx)(H,{className:"w-3 h-3"}),(0,n.jsx)("span",{children:e.label}),(0,n.jsx)("span",{className:"text-muted-foreground",children:Y(e.timestampMs)}),l&&t&&"number"==typeof s&&(0,n.jsxs)("span",{className:"ml-1 px-1.5 py-0.5 rounded bg-primary/20 text-[10px] leading-none",children:[s," ",1===s?"entry":"entries"]})]});return l?(0,n.jsxs)("button",{type:"button",onClick:r,className:"group flex items-center gap-3 py-3 px-4 w-full cursor-pointer",children:[(0,n.jsx)("div",{className:"flex-1 h-px bg-primary/30"}),i,(0,n.jsx)("div",{className:"flex-1 h-px bg-primary/30"})]}):(0,n.jsxs)("div",{className:"flex items-center gap-3 py-3 px-4",children:[(0,n.jsx)("div",{className:"flex-1 h-px bg-primary/30"}),i,(0,n.jsx)("div",{className:"flex-1 h-px bg-primary/30"})]})});var X=e.i(47163);let Q={user:"User",assistant:"Assistant","file-history-snapshot":"Snapshot",progress:"Progress",system:"System","queue-operation":"Queue"},Z={user:"bg-[color:var(--chart-1)]/20 text-[color:var(--chart-1)] border-[color:var(--chart-1)]/30",assistant:"bg-[color:var(--chart-2)]/20 text-[color:var(--chart-2)] border-[color:var(--chart-2)]/30","file-history-snapshot":"bg-[color:var(--chart-3)]/20 text-[color:var(--chart-3)] border-[color:var(--chart-3)]/30",progress:"bg-[color:var(--chart-5)]/20 text-[color:var(--chart-5)] border-[color:var(--chart-5)]/30",system:"bg-[color:var(--chart-4)]/20 text-[color:var(--chart-4)] border-[color:var(--chart-4)]/30","queue-operation":"bg-primary/20 text-primary border-primary/30"},ee={user:"border-l-[color:var(--chart-1)]",assistant:"border-l-[color:var(--chart-2)]","file-history-snapshot":"border-l-[color:var(--chart-3)]",progress:"border-l-[color:var(--chart-5)]",system:"border-l-[color:var(--chart-4)]","queue-operation":"border-l-primary"},et={name:"file-text",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]};et.node;let es=(0,_.f)(et),en={name:"activity",size:24,node:[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]};en.node;let er=(0,_.f)(en);var el=e.i(66794);function ei({type:e}){let t="w-4 h-4";switch(e){case"user":return(0,n.jsx)(I,{className:t});case"assistant":return(0,n.jsx)(z,{className:t});case"file-history-snapshot":return(0,n.jsx)(es,{className:t});case"progress":return(0,n.jsx)(er,{className:t});case"system":return(0,n.jsx)(el.f,{className:t});case"queue-operation":return(0,n.jsx)(H,{className:t})}}function eo({type:e}){return(0,n.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 text-xs font-mono rounded border ${Z[e]}`,children:[(0,n.jsx)(ei,{type:e}),Q[e]]})}var ea=e.i(24380);function eh({block:e}){let t=(0,r.useMemo)(()=>JSON.stringify(e.input,null,2),[e]);return(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("details",{open:!0,children:[(0,n.jsx)("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:(0,n.jsxs)("span",{className:"inline-flex items-center gap-1",children:["Input",(0,n.jsx)(ea.CopyButton,{text:t})]})}),(0,n.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words max-h-64 overflow-y-auto",children:t})]}),e.result?(0,n.jsxs)("div",{className:"border-l-2 border-primary/50 pl-3 space-y-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"inline-block px-2 py-0.5 text-xs font-mono rounded border bg-primary/20 text-primary border-primary/30",children:"Result"}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:Y(new Date(e.result.timestamp).getTime())})]}),e.result.content&&(0,n.jsxs)("details",{open:!0,children:[(0,n.jsx)("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:(0,n.jsxs)("span",{className:"inline-flex items-center gap-1",children:["Output",(0,n.jsx)(ea.CopyButton,{text:e.result.content})]})}),(0,n.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words max-h-48 overflow-y-auto",children:e.result.content})]}),e.result.images?.map((e,t)=>(0,n.jsx)("img",{src:`data:${e.mediaType};base64,${e.base64}`,alt:`Tool result image ${t+1}`,className:"mt-2 max-w-full rounded border border-border"},t))]}):(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:"Tool did not return a result"})]})}let ed={name:"brain",size:24,node:[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]};ed.node;let ec=(0,_.f)(ed),eu=r.default.memo(function({block:e,entriesBySource:t,projectName:s,sessionId:r,highlightedUuid:l,autoExpandForUuid:i}){switch(e.type){case"text":return(0,n.jsx)("p",{className:"whitespace-pre-wrap text-sm",children:e.text});case"tool_use":if("Task"===e.name&&(e.subagentType||e.subagentId)){let o=e.subagentId&&t?t.get(`agent-${e.subagentId}`):void 0;return(0,n.jsx)(eb,{block:e,subagentEntries:o,projectName:s,sessionId:r,highlightedUuid:l,autoExpandForUuid:i})}return(0,n.jsxs)("div",{className:"border border-border/50 rounded-lg p-3 bg-muted/10",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,n.jsx)(k,{className:"w-4 h-4 text-primary flex-shrink-0"}),(0,n.jsx)("span",{className:"font-mono text-sm text-primary truncate min-w-0",children:e.name}),e.result&&(0,n.jsx)("span",{className:"text-xs text-muted-foreground ml-auto flex-shrink-0",children:e.result.durationFormatted})]}),(0,n.jsx)(eh,{block:e})]});case"thinking":return(0,n.jsx)("div",{className:"border border-[color:var(--chart-5)]/30 rounded-lg p-3 bg-[color:var(--chart-5)]/5",children:(0,n.jsxs)("details",{children:[(0,n.jsxs)("summary",{className:"flex items-center gap-2 text-xs cursor-pointer hover:text-foreground transition-colors text-[color:var(--chart-5)]",children:[(0,n.jsx)(ec,{className:"w-4 h-4"}),(0,n.jsx)("span",{children:"Thinking"}),(0,n.jsxs)("span",{className:"text-muted-foreground ml-1",children:["(",e.thinking.length.toLocaleString()," chars)"]})]}),(0,n.jsx)("p",{className:"mt-2 whitespace-pre-wrap text-xs text-muted-foreground p-2 bg-muted/30 rounded max-h-64 overflow-y-auto",children:e.thinking})]})})}});function em({entry:e}){return(0,n.jsx)("div",{children:e.message.content&&(0,n.jsx)("p",{className:"whitespace-pre-wrap text-sm",children:e.message.content})})}let ef=r.default.memo(function({entry:e,entriesBySource:t,projectName:s,sessionId:r,highlightedUuid:l,autoExpandForUuid:i}){let{content:o}=e.message;return(0,n.jsx)("div",{className:"space-y-3",children:o.map((e,o)=>(0,n.jsx)(eu,{block:e,entriesBySource:t,projectName:s,sessionId:r,highlightedUuid:l,autoExpandForUuid:i},o))})}),ep=r.default.memo(function({entry:e}){let t=(0,r.useMemo)(()=>{if("progress"===e.type){let t=e.raw.data,s=t?.agentId;return[t?.type,s&&`agent:${s}`].filter(Boolean).join(" | ")}return"file-history-snapshot"===e.type?"File history snapshot":e.type},[e.type,e.raw]);return(0,n.jsxs)("div",{className:"text-sm",children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:t}),(0,n.jsxs)("details",{className:"mt-1",children:[(0,n.jsx)("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:"Show raw JSON"}),(0,n.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words max-h-64 overflow-y-auto",children:K(e)})]})]})}),eg={name:"link-2",size:24,node:[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]};eg.node;let ex=(0,_.f)(eg);var ey=e.i(55574);function ev({uuid:e}){let t=(0,r.useCallback)(async()=>{window.history.replaceState(null,"",`#entry-${e}`);try{await navigator.clipboard.writeText(window.location.href)}catch{let e=document.createElement("textarea");e.value=window.location.href,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)}(0,ey.toast)("Link copied")},[e]);return(0,n.jsx)("button",{onClick:t,title:"Copy link to entry",className:"inline-flex items-center justify-center rounded p-1 text-muted-foreground hover:text-foreground hover:bg-muted/80 transition-colors opacity-0 group-hover:opacity-100 transition-opacity",children:(0,n.jsx)(ex,{className:"w-3.5 h-3.5"})})}function eb({block:e,subagentEntries:t,projectName:s,sessionId:l,highlightedUuid:i,autoExpandForUuid:o}){let a=!!(o&&t?.some(e=>e.uuid===o)),[h,d]=(0,r.useState)(a);(0,r.useEffect)(()=>{if(!a)return;let e=requestAnimationFrame(()=>d(!0));return()=>cancelAnimationFrame(e)},[a]);let c=(0,r.useCallback)(()=>{d(e=>!e)},[]),u=t&&t.length>0,m=(0,r.useMemo)(()=>E(t??[]),[t]);return(0,n.jsxs)("div",{className:"border border-border/50 rounded-lg p-3 bg-muted/10",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,n.jsx)(B,{className:"w-4 h-4 text-[color:var(--chart-5)]"}),(0,n.jsx)("span",{className:"font-mono text-sm text-[color:var(--chart-5)]",children:"Subagent"}),e.subagentType&&(0,n.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 text-xs font-mono rounded border bg-[color:var(--chart-5)]/20 text-[color:var(--chart-5)] border-[color:var(--chart-5)]/30",children:e.subagentType}),e.result&&(0,n.jsx)("span",{className:"text-xs text-muted-foreground ml-auto",children:e.result.durationFormatted})]}),e.subagentDescription&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.subagentDescription}),e.subagentId&&t&&(0,n.jsxs)("button",{onClick:c,className:"inline-flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium rounded border border-primary/30 bg-primary/10 text-primary hover:bg-primary/20 transition-colors mb-2",children:[(0,n.jsx)(V.f,{className:(0,X.f)("w-3 h-3 transition-transform",h&&"rotate-90")}),(0,n.jsxs)("span",{children:["agent-",e.subagentId]}),(0,n.jsx)("span",{className:"text-muted-foreground",children:h?"Collapse":"View subagent log"})]}),h&&(0,n.jsxs)("div",{className:"ml-4 pl-3 border-l-2 border-primary/30 mt-2 space-y-2",children:[t&&0===t.length&&(0,n.jsx)("div",{className:"text-xs text-muted-foreground py-2",children:"No entries found in subagent log."}),u&&(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(q,{entries:t,compact:!0})}),t&&t.map(e=>"queue-operation"===e.type?(0,n.jsx)(J,{entry:e},m.get(e)):(0,n.jsx)(ej,{entry:e,projectName:s,sessionId:l,isHighlighted:!!i&&e.uuid===i},m.get(e)))]}),(0,n.jsx)(eh,{block:e})]})}function eS({entry:e,entriesBySource:t,projectName:s,sessionId:r,highlightedUuid:l,autoExpandForUuid:i}){switch(e.type){case"user":return(0,n.jsx)(em,{entry:e});case"assistant":return(0,n.jsx)(ef,{entry:e,entriesBySource:t,projectName:s,sessionId:r,highlightedUuid:l,autoExpandForUuid:i});case"file-history-snapshot":case"progress":case"system":return(0,n.jsx)(ep,{entry:e})}}let ej=r.default.memo(function({entry:e,entriesBySource:t,projectName:s,sessionId:r,isHighlighted:l,highlightedUuid:i,autoExpandForUuid:o}){return(0,n.jsxs)("div",{id:e.uuid?`entry-${e.uuid}`:void 0,className:(0,X.f)(`group border-l-4 ${ee[e.type]} bg-card/50 rounded-r-lg mb-2 hover:bg-muted/30 transition-colors`,l&&"entry-highlighted"),children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-border/30",children:[(0,n.jsx)(eo,{type:e.type}),(0,n.jsxs)("div",{className:"flex items-center gap-1 ml-auto",children:[e.uuid&&(0,n.jsx)(ev,{uuid:e.uuid}),(0,n.jsx)(ea.CopyButton,{text:function(e){switch(e.type){case"user":return e.message.content;case"assistant":return e.message.content.filter(e=>"text"===e.type).map(e=>e.text).join("\n");case"file-history-snapshot":case"progress":case"system":return K(e);case"queue-operation":return e.label}}(e)}),(0,n.jsx)("span",{className:"text-xs font-mono text-muted-foreground whitespace-nowrap",children:Y(e.timestampMs)})]})]}),(0,n.jsx)("div",{className:"px-4 py-3",children:(0,n.jsx)(eS,{entry:e,entriesBySource:t,projectName:s,sessionId:r,highlightedUuid:i,autoExpandForUuid:o})})]})},(e,t)=>e.entry===t.entry&&e.entriesBySource===t.entriesBySource&&e.projectName===t.projectName&&e.sessionId===t.sessionId&&e.isHighlighted===t.isHighlighted&&e.highlightedUuid===t.highlightedUuid&&e.autoExpandForUuid===t.autoExpandForUuid);var ew=e.i(3967),eM=e.i(84026),eN=e.i(29407),e_=e.i(16306),eO=e.i(82954),ek=e.i(73520),eE=e.i(85881);function eC({decision:e}){return"deny"===e?(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-red-500/10 text-red-400 border border-red-500/20",children:[(0,n.jsx)(eN.f,{className:"h-3 w-3"}),"Deny"]}):"instruct"===e?(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-amber-500/10 text-amber-400 border border-amber-500/20",children:[(0,n.jsx)(e_.f,{className:"h-3 w-3"}),"Instruct"]}):(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-emerald-500/10 text-emerald-400 border border-emerald-500/20",children:[(0,n.jsx)(eM.f,{className:"h-3 w-3"}),"Allow"]})}function eI({eventType:e}){return(0,n.jsx)("span",{className:"inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium bg-muted text-muted-foreground border border-border/50",children:e})}function eT({mode:e}){let t="default"===e;return(0,n.jsx)("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium border ${t?"bg-sky-500/10 text-sky-400 border-sky-500/20":"bg-amber-500/10 text-amber-400 border-amber-500/20"}`,children:e})}function ez({ms:e}){return(0,n.jsx)("span",{className:`font-mono text-[0.7rem] ${e>500?"text-red-400":e>100?"text-amber-400":"text-muted-foreground"}`,children:e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`})}function eA({value:e,onChange:t}){return(0,n.jsx)("div",{className:"inline-flex items-center rounded-md border border-border bg-muted/30 p-0.5",children:[{label:"All",value:""},{label:"Allow",value:"allow"},{label:"Instruct",value:"instruct"},{label:"Deny",value:"deny"}].map(s=>(0,n.jsx)("button",{onClick:()=>t(s.value),className:`px-2.5 py-1 text-[0.65rem] font-medium rounded transition-all ${e===s.value?"deny"===s.value?"bg-red-500/15 text-red-400 shadow-sm":"allow"===s.value?"bg-emerald-500/15 text-emerald-400 shadow-sm":"instruct"===s.value?"bg-amber-500/15 text-amber-400 shadow-sm":"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:s.label},s.value))})}function eF({item:e}){return(0,n.jsx)("tr",{children:(0,n.jsx)("td",{colSpan:9,className:"px-0 py-0",children:(0,n.jsxs)("div",{className:"px-6 py-3 bg-muted/20 border-t border-border/30 space-y-2 text-xs animate-expand",children:[(0,n.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-1.5",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Session ID: "}),(0,n.jsx)("span",{className:"font-mono text-foreground",children:e.sessionId??"—"}),e.sessionId&&(0,n.jsx)(ea.CopyButton,{text:e.sessionId})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"CWD: "}),(0,n.jsx)("span",{className:"font-mono text-foreground",children:e.cwd??"—"}),e.cwd&&(0,n.jsx)(ea.CopyButton,{text:e.cwd})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Transcript: "}),(0,n.jsx)("span",{className:"font-mono text-foreground break-all",children:e.transcriptPath??"—"}),e.transcriptPath?.startsWith("opencode-db://")&&(0,n.jsx)("span",{className:"text-muted-foreground ml-1",children:"(stored in opencode DB)"})]})]}),e.policyNames&&e.policyNames.length>1&&(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Policies: "}),(0,n.jsx)("span",{className:"font-mono text-foreground",children:e.policyNames.join(", ")})]}),e.reason&&(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Full reason: "}),(0,n.jsx)("span",{className:"text-foreground",children:e.reason})]})]})})})}function eR({sessionId:e,initialData:t}){let{intervalSec:s}=(0,eE.useAutoRefresh)(),[l,i]=(0,r.useState)(!1),[o,a]=(0,r.useState)(1),[h,d]=(0,r.useState)(t),[c,u]=(0,r.useState)(null),[m,f]=(0,r.useState)(""),[p,g]=(0,r.useState)(""),[x,y]=(0,r.useState)(""),v=(0,r.useRef)(null),b=(0,r.useRef)({filterDecision:m,filterEventType:p,filterPolicy:x});b.current={filterDecision:m,filterEventType:p,filterPolicy:x};let S=""!==m||""!==p||""!==x,j=(0,r.useCallback)(async t=>{try{let{filterDecision:s,filterEventType:n,filterPolicy:r}=b.current,l=await (0,ew.f)({sessionId:e,decision:s||void 0,eventType:n||void 0,policyName:r||void 0},t);d(l)}catch{}},[e]);(0,r.useEffect)(()=>{j(o);let e=setInterval(()=>j(o),s>0?1e3*s:5e3);return()=>clearInterval(e)},[o,j,s]),(0,r.useEffect)(()=>(v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{a(1),u(null),j(1)},300),()=>{v.current&&clearTimeout(v.current)}),[m,p,x]);let w=h.entries,M=h.totalPages;return(0,n.jsxs)("div",{children:[(0,n.jsxs)("button",{onClick:()=>i(e=>!e),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,n.jsx)(N.f,{className:`w-4 h-4 text-muted-foreground transition-transform ${l?"-rotate-90":""}`}),(0,n.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Hook Logs"})]}),!l&&(0,n.jsxs)("div",{className:"mt-2 bg-card border border-border rounded-lg overflow-hidden shadow-sm",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4 py-2.5 border-b border-border bg-muted/20",children:[(0,n.jsx)(eA,{value:m,onChange:f}),(0,n.jsxs)("select",{value:p,onChange:e=>g(e.target.value),className:"h-7 rounded-md border border-border bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/40 transition-shadow",children:[(0,n.jsx)("option",{value:"",children:"All Events"}),(0,n.jsx)("option",{value:"PreToolUse",children:"PreToolUse"}),(0,n.jsx)("option",{value:"PostToolUse",children:"PostToolUse"}),(0,n.jsx)("option",{value:"SessionStart",children:"SessionStart"}),(0,n.jsx)("option",{value:"SessionEnd",children:"SessionEnd"}),(0,n.jsx)("option",{value:"UserPromptSubmit",children:"UserPromptSubmit"}),(0,n.jsx)("option",{value:"PermissionRequest",children:"PermissionRequest"})]}),(0,n.jsx)("div",{className:"relative",children:(0,n.jsx)("input",{type:"text",value:x,onChange:e=>y(e.target.value),placeholder:"Filter by policy…",className:"h-7 rounded-md border border-border bg-background px-2.5 text-xs text-foreground placeholder:text-muted-foreground w-44 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/40 transition-shadow"})})]}),0===w.length?(0,n.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 px-4",children:[(0,n.jsx)(eO.f,{className:"h-10 w-10 text-muted-foreground/30"}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground mt-3",children:S?"No matching hook events.":"No hook events found."})]}):(0,n.jsx)("div",{className:"overflow-x-auto",children:(0,n.jsxs)("table",{className:"w-full text-xs",children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{className:"text-left text-muted-foreground border-b border-border bg-muted/30",children:[(0,n.jsx)("th",{className:"px-4 py-2.5 font-medium w-6"}),(0,n.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Decision"}),(0,n.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Event"}),(0,n.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Tool"}),(0,n.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Policy"}),(0,n.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Reason"}),(0,n.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Duration"}),(0,n.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Mode"}),(0,n.jsx)("th",{className:"px-3 py-2.5 font-medium text-right",children:"Time"})]})}),(0,n.jsx)("tbody",{className:"divide-y divide-border/30",children:w.map((e,t)=>{let s="deny"===e.decision,l=c===t,i="instruct"===e.decision;return(0,n.jsxs)(r.default.Fragment,{children:[(0,n.jsxs)("tr",{onClick:()=>{u(e=>e===t?null:t)},className:`cursor-pointer transition-colors ${s?"bg-red-500/[0.03] hover:bg-red-500/[0.07] border-l-2 border-l-red-500/40":i?"bg-amber-500/[0.03] hover:bg-amber-500/[0.07] border-l-2 border-l-amber-500/40":t%2==0?"hover:bg-muted/30":"bg-muted/[0.04] hover:bg-muted/30"} ${l?"bg-muted/20":""}`,children:[(0,n.jsx)("td",{className:"px-4 py-2",children:(0,n.jsx)(N.f,{className:`h-3.5 w-3.5 text-muted-foreground transition-transform duration-150 ${l?"rotate-0":"-rotate-90"}`})}),(0,n.jsx)("td",{className:"px-3 py-2",children:(0,n.jsx)(eC,{decision:e.decision})}),(0,n.jsx)("td",{className:"px-3 py-2",children:(0,n.jsx)(eI,{eventType:e.eventType})}),(0,n.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:e.toolName??"—"}),(0,n.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:e.policyNames&&e.policyNames.length>1?(0,n.jsxs)("span",{title:e.policyNames.join(", "),children:[e.policyNames[0],(0,n.jsxs)("span",{className:"text-muted-foreground text-[0.6rem]",children:[" +",e.policyNames.length-1]})]}):e.policyName??"—"}),(0,n.jsx)("td",{className:"px-3 py-2 text-muted-foreground truncate max-w-[240px]",title:e.reason??"",children:e.reason??"—"}),(0,n.jsx)("td",{className:"px-3 py-2",children:(0,n.jsx)(ez,{ms:e.durationMs})}),(0,n.jsx)("td",{className:"px-3 py-2",children:e.permissionMode?(0,n.jsx)(eT,{mode:e.permissionMode}):"—"}),(0,n.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground whitespace-nowrap",title:new Date(e.timestamp).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),children:(0,P.g)(e.timestamp)})]}),l&&(0,n.jsx)(eF,{item:e})]},`${e.timestamp}-${t}`)})})]})}),(0,n.jsx)(ek.f,{currentPage:o,totalPages:M,onPageChange:e=>{a(e),u(null)}})]})]})}function eW(e){let t=new Map;for(let s of e)if("assistant"===s.type)for(let e of s.message.content){if("tool_use"!==e.type||"Task"===e.name&&(e.subagentType||e.subagentId))continue;let s=t.get(e.name)||{count:0,totalDurationMs:0};s.count++,e.result?.durationMs&&(s.totalDurationMs+=e.result.durationMs),t.set(e.name,s)}return Array.from(t.entries()).map(([e,t])=>({name:e,...t})).sort((e,t)=>t.count-e.count)}function eL({tools:e,compact:t}){return(0,n.jsx)("div",{className:`bg-card border border-border rounded-lg ${t?"p-3":"p-4"}`,children:(0,n.jsx)("div",{className:`grid grid-cols-[repeat(auto-fit,minmax(200px,1fr))] ${t?"gap-2":"gap-3"}`,children:e.map(e=>(0,n.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,n.jsx)(k,{className:"w-3.5 h-3.5 text-muted-foreground flex-shrink-0"}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("div",{className:`${t?"text-xs":"text-sm"} font-mono font-medium truncate`,children:e.name}),(0,n.jsxs)("div",{className:"text-xs text-muted-foreground truncate",children:[e.count," call",1!==e.count?"s":"",e.totalDurationMs>0&&` \xb7 ${(e.totalDurationMs/1e3).toFixed(1)}s`]})]})]},e.name))})})}function e$(e,t){return t.get(e)??`${e.uuid}-${e.timestampMs}`}function eD(){let e=window.location.hash;return e.startsWith("#entry-")?e.slice(7):null}function eB({entries:e,entriesBySource:t,projectName:s,sessionId:i}){let o=(0,r.useMemo)(()=>Array.from(t.values()).flat(),[t]),[a,h]=(0,r.useState)(new Set),[d,c]=(0,r.useState)(0),[u,m]=(0,r.useState)(()=>eD()),f=(0,r.useRef)(void 0),g=(0,r.useRef)(!1),y=(0,r.useRef)(null);(0,r.useLayoutEffect)(()=>{let e=y.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect().top+window.scrollY;c(e=>e===t?e:t)};t();let s=new ResizeObserver(t);return s.observe(document.body),window.addEventListener("resize",t),()=>{s.disconnect(),window.removeEventListener("resize",t)}},[]);let b=(0,r.useMemo)(()=>E(e),[e]),S=(0,r.useMemo)(()=>(function(e,t){let s=new Map,n=null,r=0;for(let l of e)"queue-operation"===l.type?(null!==n&&s.set(n,r),n=e$(l,t),r=0):null!==n&&r++;return null!==n&&s.set(n,r),s})(e,b),[e,b]),w=(0,r.useMemo)(()=>{let t;return t=!1,e.filter(e=>"queue-operation"===e.type?(t=a.has(e$(e,b)),!0):!t)},[e,a,b]),N=(0,r.useMemo)(()=>{let e=new Map;return w.forEach((t,s)=>{t.uuid&&e.set(t.uuid,s)}),e},[w]),_=(0,r.useMemo)(()=>(function(e){let t=new Map;for(let s of e)if("assistant"===s.type&&s.uuid)for(let e of s.message.content)"tool_use"===e.type&&"Task"===e.name&&e.subagentId&&t.set(e.subagentId,s.uuid);let s=new Map;for(let n of e){if(!n._source?.startsWith("agent-")||!n.uuid)continue;let e=n._source.slice(6),r=t.get(e);r&&s.set(n.uuid,r)}return s})(o),[o]),O=(0,r.useMemo)(()=>u&&_.has(u)?u:null,[u,_]),k=O?_.get(O)??null:null;(0,r.useEffect)(()=>{if(u)return f.current=setTimeout(()=>m(null),4e3),()=>{f.current&&clearTimeout(f.current)}},[]),(0,r.useEffect)(()=>{let e=()=>{let e=eD();m(e),g.current=!1,f.current&&clearTimeout(f.current),e&&(f.current=setTimeout(()=>m(null),4e3))};return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[]);let C=(0,r.useMemo)(()=>{if(!u)return null;let t=k??u,s=e.some(e=>e.uuid===t),n=N.has(t);if(s&&!n){let s=null;for(let n of e)if("queue-operation"===n.type)s=e$(n,b);else if(n.uuid===t&&s)return s}return null},[u,k,e,N,b]);(0,r.useEffect)(()=>{if(!C)return;let e=requestAnimationFrame(()=>{h(e=>{if(!e.has(C))return e;let t=new Set(e);return t.delete(C),t})});return()=>cancelAnimationFrame(e)},[C]);let I=(0,r.useCallback)(e=>{h(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]),T=(0,r.useCallback)(e=>b.get(w[e])??e,[b,w]),z=function({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:s="transform",...n}){let i=r.useReducer(e=>e+1,0)[1],o=r.useRef({enabled:t,mode:s,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});o.current.enabled=t,o.current.mode=s;let a=r.useRef(!1),h=e=>{let t=o.current;if(!t.enabled||!t.container)return;let s=e.getTotalSize();if(s!==t.lastSize){t.lastSize=s;let n=e.options.horizontal?"width":"height";t.container.style[n]=`${s}px`}},d=(e,t,s)=>{let n=o.current,r=!!e.options.horizontal,l=t.start-e.options.scrollMargin;n.lastPositions.get(s)!==l&&(n.lastPositions.set(s,l),"transform"===n.mode?s.style.transform=r?`translate3d(${l}px, 0, 0)`:`translate3d(0, ${l}px, 0)`:s.style[r?"left":"top"]=`${l}px`)},c=e=>{let t=o.current;if(t.enabled&&t.container)for(let t of(h(e),e.getVirtualItems())){let s=e.elementsCache.get(t.key);s&&d(e,t,s)}},u={...n,onChange:(t,s)=>{var r;let h=o.current,d=!0;if(h.enabled){c(t);let e=t.range,s=h.prevRange;(d=!s||s.isScrolling!==t.isScrolling||s.startIndex!==(null==e?void 0:e.startIndex)||s.endIndex!==(null==e?void 0:e.endIndex))&&(h.prevRange=e?{startIndex:e.startIndex,endIndex:e.endIndex,isScrolling:t.isScrolling}:null)}d&&(e&&s&&!a.current?(0,l.flushSync)(i):i()),null==(r=n.onChange)||r.call(n,t,s)}},[m]=r.useState(()=>{let e=new j(u),t=e.measureElement;return e.measureElement=s=>{a.current=!0;try{t(s)}finally{a.current=!1}let n=o.current;if(null!==s&&n.enabled&&n.container){let t=e.measurementsCache[e.indexFromElement(s)];t&&d(e,t,s)}},Object.assign(e,{containerRef:t=>{let s=o.current;s.container=t,s.lastSize=null,null!==t&&c(e)}})});return m.setOptions(u),M(()=>m._didMount(),[]),M(()=>(h(m),m._willUpdate())),M(()=>{c(m)}),m}({getScrollElement:()=>"u">typeof document?window:null,observeElementRect:p,observeElementOffset:x,scrollToFn:v,initialOffset:()=>"u">typeof document?window.scrollY:0,...{count:w.length,estimateSize:e=>(function(e){switch(e.type){case"queue-operation":return 48;case"user":return 90;case"assistant":return 80+120*e.message.content.length;default:return 100}})(w[e]),getItemKey:T,overscan:5,scrollMargin:d}});return(0,r.useEffect)(()=>{if(!u||g.current)return;let e=k??u,t=N.get(e);null!=t&&(g.current=!0,requestAnimationFrame(()=>{z.scrollToIndex(t,{align:"center"})}))},[u,k,N,z]),(0,n.jsx)("div",{ref:y,children:(0,n.jsx)("div",{style:{height:`${z.getTotalSize()}px`,width:"100%",position:"relative"},children:z.getVirtualItems().map(e=>{let r=w[e.index],l=!!u&&r.uuid===(k??u);return(0,n.jsx)("div",{"data-index":e.index,ref:z.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${e.start-z.options.scrollMargin}px)`},children:"queue-operation"===r.type?(0,n.jsx)(J,{entry:r,isCollapsed:a.has(e$(r,b)),entryCount:S.get(e$(r,b))??0,onToggle:()=>I(e$(r,b))}):(0,n.jsx)(ej,{entry:r,entriesBySource:t,projectName:s,sessionId:i,isHighlighted:!O&&l,highlightedUuid:O,autoExpandForUuid:O})},e.key)})})})}let eP=[];e.s(["default",0,function({entries:e,projectName:t,sessionId:s}){let l=(0,r.useMemo)(()=>{let t=new Map;for(let s of e){let e=t.get(s._source);e?e.push(s):t.set(s._source,[s])}return t},[e]),i=l.get("session")??eP,o=(0,r.useMemo)(()=>(function(e){let t=new Map;for(let s of e)if("assistant"===s.type)for(let e of s.message.content)"tool_use"===e.type&&"Task"===e.name&&e.subagentId&&(t.has(e.subagentId)||t.set(e.subagentId,{id:e.subagentId,type:e.subagentType||"unknown",description:e.subagentDescription||""}));return Array.from(t.values())})(e),[e]),a=(0,r.useMemo)(()=>eW(i),[i]),[h,d]=(0,r.useState)(!1),[c,u]=(0,r.useState)(new Set),[m,f]=(0,r.useState)(!1),[p,g]=(0,r.useState)(null);(0,r.useEffect)(()=>{(0,ew.f)({sessionId:s},1).then(e=>{e.entries.length>0&&g(e)}).catch(()=>{})},[s]),(0,r.useEffect)(()=>{let e=()=>{window.location.hash.startsWith("#entry-")&&f(!1)};return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[]);let x=(0,r.useCallback)(e=>{u(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]);return(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsx)(q,{entries:i}),p&&(0,n.jsx)(eR,{sessionId:s,initialData:p},s),o.length>0&&(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("button",{onClick:()=>d(e=>!e),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,n.jsx)(N.f,{className:`w-4 h-4 text-muted-foreground transition-transform ${h?"-rotate-90":""}`}),(0,n.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Subagents"}),(0,n.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",o.length,")"]})]}),!h&&o.map(e=>{let t;return(0,n.jsxs)("div",{className:"pl-3 border-l-2 border-primary/30 space-y-2",children:[(0,n.jsxs)("button",{onClick:()=>x(e.id),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,n.jsx)(N.f,{className:`w-3.5 h-3.5 text-muted-foreground transition-transform ${c.has(e.id)?"-rotate-90":""}`}),(0,n.jsx)("span",{className:"text-sm font-bold",children:e.type}),e.description&&(0,n.jsx)("span",{className:"text-xs text-muted-foreground truncate max-w-[400px]",children:e.description})]}),!c.has(e.id)&&(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(q,{entries:l.get(`agent-${e.id}`)||[],compact:!0}),(t=eW(l.get(`agent-${e.id}`)||[])).length>0?(0,n.jsx)(eL,{tools:t,compact:!0}):null]})]},e.id)})]}),a.length>0&&(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Tools"}),(0,n.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",a.reduce((e,t)=>e+t.count,0),")"]})]}),(0,n.jsx)(eL,{tools:a})]}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("button",{onClick:()=>f(e=>!e),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,n.jsx)(N.f,{className:`w-4 h-4 text-muted-foreground transition-transform ${m?"-rotate-90":""}`}),(0,n.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Logs"})]}),!m&&(0,n.jsx)("div",{className:"mt-2 bg-card border border-border rounded-lg p-4 shadow-sm",children:0===i.length?(0,n.jsx)("p",{className:"text-muted-foreground text-center py-8",children:"No entries found."}):(0,n.jsx)(eB,{entries:i,entriesBySource:l,projectName:t,sessionId:s})})]})]})}],36406)},5780,function(e){e.n(e.i(36406))}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,[41146,e=>{var t=e.i(95187);let r=(0,t.createServerReference)("00728227e41042729b3182aad2fe4c5d77f021b514",t.callServer,void 0,t.findSourceMapURL,"getTelemetryConfig");e.s(["f",0,r])},97917,e=>{var t=e.i(71645),r=e.i(9969);let n=/\b[\w-]+-extension:\/\//i;function o(e){return"app"===function({stack:e,filename:t,appOrigin:r}){let o=[t,e].filter(Boolean).join("\n");return o.trim()?n.test(o)?"extension":r&&o.includes(r)?"app":"unknown":"unknown"}(e)}e.s(["GlobalErrorListeners",0,function(){return(0,t.useEffect)(()=>{let e=e=>{o({stack:e.error?.stack,filename:e.filename,appOrigin:window.location.origin})&&(0,r.L)("unhandled_exception",{error_message:e.message,error_name:e.error?.name,error_filename:e.filename,error_lineno:e.lineno,error_colno:e.colno})},t=e=>{let t=e.reason;o({stack:t instanceof Error?t.stack:void 0,appOrigin:window.location.origin})&&(0,r.L)("unhandled_rejection",{error_message:t instanceof Error?t.message:String(t),error_name:t instanceof Error?t.name:void 0})};return window.addEventListener("error",e),window.addEventListener("unhandledrejection",t),()=>{window.removeEventListener("error",e),window.removeEventListener("unhandledrejection",t)}},[]),null}],97917)},55574,e=>{var t=e.i(43476),r=e.i(71645);let n=[],o=0,a=new Set;function i(){for(let e of a)e()}function s(e){return a.add(e),()=>a.delete(e)}function l(){return n}function u({message:e}){let[n,o]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{requestAnimationFrame(()=>o(!0));let e=setTimeout(()=>o(!1),2e3);return()=>clearTimeout(e)},[]),(0,t.jsx)("div",{className:`bg-card border border-border text-foreground text-sm px-4 py-2 rounded-lg shadow-lg transition-opacity duration-300 ${n?"opacity-100":"opacity-0"}`,children:e})}e.s(["Toaster",0,function(){let e=(0,r.useSyncExternalStore)(s,l,l);return(0,t.jsx)("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col gap-2",children:e.map(e=>(0,t.jsx)(u,{message:e.message},e.id))})},"toast",0,function(e){let t=o++;n=[...n,{id:t,message:e}],i(),setTimeout(()=>{n=n.filter(e=>e.id!==t),i()},2500)}])},63780,e=>{var t=e.i(43476),r=e.i(22016),n=e.i(18566),o=e.i(66794),a=e.i(71645),i=e.i(56420);let s={name:"git-branch",size:24,node:[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]]};s.node;let l=(0,i.f)(s);var u=e.i(16327);let c={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};c.node;let d=(0,i.f)(c),f={name:"book-open",size:24,node:[["path",{d:"M12 5v16",key:"1f6ucr"}],["path",{d:"M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z",key:"1fyvmf"}]]};f.node;let h=(0,i.f)(f),p={name:"message-circle",size:24,node:[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]};p.node;let m=(0,i.f)(p),g={name:"messages-square",size:24,node:[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]]};g.node;let b=(0,i.f)(g),v={name:"message-square-warning",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M12 15h.01",key:"q59x07"}],["path",{d:"M12 7v4",key:"xawao1"}]]};v.node;let y=(0,i.f)(v);var x=e.i(67881);let w="failproofai@exosphere.host",k=[{label:"Star us on GitHub",icon:d,href:"https://github.com/failproofai/failproofai",color:"#f5c842",bg:"rgba(245,200,66,0.08)"},{label:"Documentation",icon:h,href:"https://docs.befailproof.ai/introduction",color:"#60a5fa",bg:"rgba(96,165,250,0.08)"},{label:"Join our Discord",icon:m,href:"https://discord.befailproof.ai/",color:"#5865f2",bg:"rgba(88,101,242,0.08)"},{label:"Join r/failproofai",icon:b,href:"https://www.reddit.com/r/failproofai/",color:"#ff4500",bg:"rgba(255,69,0,0.08)"},{label:"Feedback & Issues",icon:y,href:"https://github.com/FailproofAI/failproofai/issues/new/choose",color:"#34d399",bg:"rgba(52,211,153,0.08)"}],j=()=>{let[e,r]=(0,a.useState)(!1),n=(0,a.useCallback)(()=>r(!1),[]),o=(0,a.useCallback)(e=>{"Escape"===e.key&&r(!1)},[]);return(0,t.jsxs)("div",{className:"relative",onKeyDown:o,children:[e&&(0,t.jsx)("div",{className:"fixed inset-0 z-40",onClick:n,"aria-hidden":"true"}),(0,t.jsxs)(x.f,{type:"button",variant:"ghost",size:"sm",onClick:()=>r(e=>!e),"aria-expanded":e,"aria-haspopup":"true",className:"relative z-50 flex items-center gap-1.5 text-muted-foreground hover:text-foreground",children:[(0,t.jsx)(l,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"hidden sm:inline text-xs whitespace-nowrap",children:"Reach Us"}),(0,t.jsx)(u.f,{className:`h-3 w-3 transition-transform ${e?"rotate-180":""}`})]}),e&&(0,t.jsxs)("div",{className:"absolute right-0 mt-2 w-60 rounded-lg border border-border bg-card shadow-xl z-50",role:"menu",style:{boxShadow:"0 8px 32px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.04)"},children:[(0,t.jsxs)("div",{className:"px-3 py-2.5 border-b border-border",style:{background:"linear-gradient(135deg, rgba(236,72,153,0.12) 0%, rgba(139,92,246,0.08) 100%)"},children:[(0,t.jsx)("p",{className:"text-xs font-semibold",style:{color:"#e879f9",letterSpacing:"0.06em"},children:"Reach Developers"}),(0,t.jsx)("p",{className:"text-[0.65rem] text-muted-foreground mt-0.5",children:"We'd love to hear from you"})]}),(0,t.jsx)("div",{className:"py-1",children:k.map(({label:e,icon:r,href:o,color:a,bg:i})=>(0,t.jsxs)("a",{href:o,target:"_blank",rel:"noopener noreferrer",role:"menuitem",className:"flex items-center gap-2.5 px-3 py-2 text-xs transition-colors",style:{color:"var(--muted-foreground)"},onMouseEnter:e=>{e.currentTarget.style.background=i,e.currentTarget.style.color=a},onMouseLeave:e=>{e.currentTarget.style.background="",e.currentTarget.style.color=""},onClick:n,children:[(0,t.jsx)(r,{className:"h-3.5 w-3.5 flex-shrink-0",style:{color:a}}),e]},e))}),(0,t.jsx)("div",{className:"px-3 py-2 border-t border-border",style:{background:"rgba(0,0,0,0.2)"},children:(0,t.jsxs)("p",{className:"text-[0.65rem] text-muted-foreground",children:["or email"," ",(0,t.jsx)("a",{href:`mailto:${w}`,className:"transition-colors",style:{color:"#e879f9"},onMouseEnter:e=>e.currentTarget.style.opacity="0.75",onMouseLeave:e=>e.currentTarget.style.opacity="1",children:w})]})})]})]})},N={name:"refresh-cw",size:24,node:[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]};N.node;let S=(0,i.f)(N);var _=e.i(47163),P=e.i(85881);let E=[{label:"Off",value:0},{label:"5s",value:5},{label:"10s",value:10},{label:"30s",value:30}];function C({className:e}){let r=(0,n.useRouter)(),[o,i]=(0,a.useTransition)(),{intervalSec:s,setIntervalSec:l}=(0,P.useAutoRefresh)(),u=(0,a.useCallback)(()=>{i(()=>r.refresh())},[r]);(0,a.useEffect)(()=>{if(s<=0)return;let e=setInterval(u,1e3*s);return()=>clearInterval(e)},[s,u]);let c=s>0;return(0,t.jsxs)("div",{className:(0,_.f)("inline-flex items-center rounded-lg border border-border bg-muted/50 p-0.5 gap-0.5",e),children:[(0,t.jsx)("button",{onClick:u,title:"Refresh",className:(0,_.f)("inline-flex items-center justify-center rounded-md p-1.5 transition-colors",c?"text-primary hover:bg-primary/10":"text-muted-foreground hover:text-foreground hover:bg-muted"),children:(0,t.jsx)(S,{className:(0,_.f)("w-3.5 h-3.5",o&&"animate-spin")})}),(0,t.jsx)("div",{className:"w-px h-4 bg-border"}),(0,t.jsx)("div",{className:"inline-flex items-center gap-0.5",role:"group","aria-label":"Auto-refresh interval",children:E.map(e=>(0,t.jsx)("button",{onClick:()=>l(e.value),"aria-pressed":s===e.value,className:(0,_.f)("px-2 py-1 text-[11px] font-medium rounded-md transition-colors",s===e.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground hover:bg-muted"),children:e.label},e.value))})]})}var L=e.i(12344);let M=[{href:"/projects",label:"projects"},{href:"/policies",label:"policies"},{href:"/audit",label:"audit"}];e.s(["Navbar",0,({disabledPages:e=[]})=>{let a=(0,n.usePathname)(),{capture:i}=(0,L.usePostHog)(),s=a.startsWith("/policies")?"policies":a.startsWith("/audit")?"audit":a.startsWith("/settings")?"settings":a.startsWith("/projects")||a.startsWith("/project/")?"projects":"";return(0,t.jsxs)("header",{className:"app-header",children:[(0,t.jsx)("a",{href:"https://github.com/failproofai/failproofai",target:"_blank",rel:"noopener noreferrer",className:"h-brand",style:{flex:"none"},"aria-label":"failproof ai · GitHub",children:(0,t.jsx)("img",{src:"/logo.svg",alt:"failproof_ai",style:{height:18,display:"block",flexShrink:0}})}),(0,t.jsx)("nav",{className:"tabs",style:{border:"none",padding:0,gap:0},children:M.filter(({href:t})=>{let r=t.slice(1);return!e.includes(r)}).map(({href:e,label:n})=>{let o="/projects"===e?"/projects"===a||a.startsWith("/project/"):a.startsWith(e);return(0,t.jsx)(r.default,{href:e,className:`tab${o?" is-active":""}`,"aria-current":o?"page":void 0,onClick:()=>{"/audit"===e&&i("audit_nav_clicked",{from_path:a,is_active_tab:o})},children:n},e)})}),(0,t.jsx)("div",{style:{flex:1}}),(0,t.jsxs)("div",{className:"h-meta",children:[(0,t.jsxs)("span",{className:"h-version",children:["v","1.0.12-beta.2"]}),s&&(0,t.jsx)("span",{className:"h-brand-sep","aria-hidden":"true",children:"·"}),s&&(0,t.jsx)("span",{className:"h-brand-section",children:s})]}),(0,t.jsxs)("div",{className:"h-actions",children:[(0,t.jsx)(C,{}),(0,t.jsx)("span",{style:{width:1,height:18,background:"var(--line)",margin:"0 6px"}}),!e.includes("settings")&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.default,{href:"/settings",className:`h-icon-btn${a.startsWith("/settings")?" is-active":""}`,"aria-label":"settings","aria-current":a.startsWith("/settings")?"page":void 0,title:"settings",children:(0,t.jsx)(o.f,{className:"w-3.5 h-3.5",strokeWidth:1.75,"aria-hidden":"true"})}),(0,t.jsx)("span",{style:{width:1,height:18,background:"var(--line)",margin:"0 6px"}})]}),(0,t.jsx)(j,{})]})]})}],63780)},67881,e=>{var t=e.i(43476),r=e.i(71645),n=e.i(47163);let o=r.forwardRef(({className:e,variant:r="default",size:o="default",...a},i)=>(0,t.jsx)("button",{className:(0,n.f)("inline-flex items-center justify-center rounded-md text-sm font-medium transition-[background-color,color,box-shadow,border-color] duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:opacity-50 disabled:pointer-events-none",{"bg-primary text-primary-foreground hover:bg-primary/90 hover:shadow-[0_0_0_1px_var(--primary)]":"default"===r,"text-foreground hover:bg-muted":"ghost"===r,"border border-border bg-transparent hover:border-primary/60 hover:bg-card":"outline"===r,"h-10 py-2 px-4":"default"===o,"h-10 w-10":"icon"===o,"h-9 px-3":"sm"===o,"h-11 px-8":"lg"===o},e),ref:i,...a}));o.displayName="Button",e.s(["f",0,o])},85881,e=>{var t=e.i(43476),r=e.i(71645);let n=(0,r.createContext)(void 0);e.s(["AutoRefreshProvider",0,function({children:e}){let[o,a]=(0,r.useState)(0);return(0,t.jsx)(n.Provider,{value:{intervalSec:o,setIntervalSec:a},children:e})},"useAutoRefresh",0,function(){let e=(0,r.useContext)(n);if(!e)throw Error("useAutoRefresh must be used within AutoRefreshProvider");return e}])},12344,e=>{var t=e.i(43476),r=e.i(71645),n=e.i(18566),o=e.i(41146),a=e.i(9969);let i=(0,r.createContext)(void 0);e.s(["PostHogProvider",0,function({children:e}){let s=(0,n.usePathname)(),l=(0,r.useRef)(null),u=(0,r.useRef)(!1);(0,r.useEffect)(()=>{let e=!1;return(0,o.f)().then(t=>{e||((0,a.$)(t),u.current=!0,(0,a.L)("$pageview"),l.current=window.location.pathname)}),()=>{e=!0}},[]),(0,r.useEffect)(()=>{u.current&&l.current!==s&&(l.current=s,(0,a.L)("$pageview"))},[s]);let c=r.default.useCallback((e,t)=>{(0,a.L)(e,t)},[]);return(0,t.jsx)(i.Provider,{value:{capture:c},children:e})},"usePostHog",0,function(){let e=(0,r.useContext)(i);if(void 0===e)throw Error("usePostHog must be used within a PostHogProvider");return e}])},9969,e=>{let t=null;e.s(["L",0,function(e,r){if(!t||!t.enabled)return;let n=JSON.stringify({api_key:t.apiKey,event:e,distinct_id:t.distinctId,properties:{...r,$lib:"failproofai-web",failproofai_version:t.version,product:"failproofai-oss",$current_url:window.location.href,$pathname:window.location.pathname}});fetch(t.host.replace(/\/+$/,"")+"/capture/",{method:"POST",headers:{"Content-Type":"application/json"},body:n,keepalive:!0,signal:AbortSignal.timeout(5e3)}).catch(()=>{})},"$",0,function(e){t=e}],9969)},5014,e=>{var t=e.i(71645);let r=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"},o=(0,t.createContext)({}),a=(0,t.forwardRef)(({color:e,size:a,width:i,height:s,strokeWidth:l,absoluteStrokeWidth:u,nonScalingStroke:c,className:d="",children:f,iconNode:h=[],icon:p={node:h,aliases:[],size:24},...m},g)=>{let{size:b=24,strokeWidth:v=2,absoluteStrokeWidth:y=!1,nonScalingStroke:x=!1,color:w="currentColor",className:k=""}=(0,t.useContext)(o)??{},j=!!f||(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(m),[N,S,_=[]]=function(e,t={}){return function(e,t={}){let o=t.attributeNames??{},a=e=>o[e]??e,i=e.size??e.width??n.width,s=e.size??e.height??n.height,l=e.aliases?.filter(e=>"string"==typeof e&&""!==e.trim()).map(e=>`lucide-${e}`)??[],u=[...e.name?[`lucide-${e.name}`]:[],...l],c=t.className?.split(" ").filter(Boolean)??[],d=!1===t.includeDefaultClasses?r(...c):r("lucide",...u,...c),f=t.absoluteStrokeWidth?Number(t.strokeWidth??n["stroke-width"])*Number(e.size??e.width??n.width)/Number(t.size??t.width??n.width):t.strokeWidth??n["stroke-width"];return["svg",{...Object.entries(n).reduce((e,[t,r])=>(e[a(t)]=r,e),{}),..."color"in t&&t.color&&{[a("stroke")]:t.color},..."size"in t&&null!=t.size&&{[a("width")]:t.size,[a("height")]:t.size},..."width"in t&&null!=t.width&&{[a("width")]:t.width},..."height"in t&&null!=t.height&&{[a("height")]:t.height},[a("stroke-width")]:f,...d&&{[a("class")]:d},[a("viewBox")]:`0 0 ${i} ${s}`,...!1===t.hasA11yProp?{[a("aria-hidden")]:"true"}:{},..."attributes"in t&&t.attributes},e.node.map(e=>{let[r,n,o]=e,i=t.nonScalingStroke?{[a("vector-effect")]:"non-scaling-stroke",...n}:n;return o?[r,i,o]:[r,i]})]}(e,{...t,attributeNames:{...t.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}(p,{color:e??w,width:i??a??b,height:s??a??b,strokeWidth:l??v,absoluteStrokeWidth:u??y,nonScalingStroke:c??x,className:r(k,d),hasA11yProp:j,attributes:m});return(0,t.createElement)(N,{ref:g,...S},[..._.map(([e,r])=>(0,t.createElement)(e,r)),...Array.isArray(f)?f:[f]])});e.s(["default",0,a],5014)},56420,e=>{var t=e.i(71645),r=e.i(5014);e.s(["f",0,function(e,n=[],o=[]){let a,i="string"==typeof e?function(e,t,r=[]){if(null==t)throw Error("[lucide]: iconNode is required when icon name is used");return{name:e?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),size:24,node:t,...r.length>0?{aliases:r}:{}}}(e,n,o):e,s=(0,t.forwardRef)(({className:e,...n},o)=>(0,t.createElement)(r.default,{ref:o,icon:i,className:e,...n}));return i.name&&(s.displayName=(a=(e=>{let t="",r=!1;for(let n of e){if("-"===n||"_"===n||n<=" "){r=t.length>0;continue}0===t.length?t+=n.toLowerCase():t+=r?n.toUpperCase():n,r=!1}return t})(i.name)).charAt(0).toUpperCase()+a.slice(1)),s}],56420)},16327,e=>{var t=e.i(56420);let r={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],16327)},66794,e=>{var t=e.i(56420);let r={name:"settings",size:24,node:[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],66794)},95187,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0});var n={callServer:function(){return a.callServer},createServerReference:function(){return s.createServerReference},findSourceMapURL:function(){return i.findSourceMapURL}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=e.r(32120),i=e.r(92245),s=e.r(35326)},22016,(e,t,r)=>{e.i(47167),Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return b},useLinkStatus:function(){return y}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=e.r(90809),i=e.r(43476),s=a._(e.r(71645)),l=e.r(95057),u=e.r(8372),c=e.r(18581),d=e.r(18967),f=e.r(5550),h=e.r(88540),p=e.r(91949),m=e.r(73668),g=e.r(9396);function b(t){var r;let n,o,a,[b,y]=(0,s.useOptimistic)(p.IDLE_LINK_STATUS),x=(0,s.useRef)(null),{href:w,as:k,children:j,prefetch:N=null,passHref:S,replace:_,shallow:P,scroll:E,onClick:C,onMouseEnter:L,onTouchStart:M,legacyBehavior:R=!1,onNavigate:T,transitionTypes:z,ref:A,unstable_dynamicOnHover:$,...O}=t;n=j,R&&("string"==typeof n||"number"==typeof n)&&(n=(0,i.jsx)("a",{children:n}));let U=s.default.useContext(u.AppRouterContext),W=!1!==N,I=!1===N?"none":!0===N?"full":"auto",B="none"!==I?"auto"===I?g.FetchStrategy.PPR:g.FetchStrategy.Full:g.FetchStrategy.PPR,F="string"==typeof(r=k||w)?r:(0,l.formatUrl)(r);if(R){if(n?.$$typeof===Symbol.for("react.lazy"))throw Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag.");o=s.default.Children.only(n)}let D=R?o&&"object"==typeof o&&o.ref:A,H,q=s.default.useCallback(e=>(null!==U&&(x.current=(0,p.mountLinkInstance)(e,F,U,B,W,y,H)),()=>{x.current&&((0,p.unmountLinkForCurrentNavigation)(x.current),x.current=null),(0,p.unmountPrefetchableInstance)(e)}),[W,F,U,B,y,H]),K={ref:(0,c.useMergedRef)(q,D),onClick(t){R||"function"!=typeof C||C(t),R&&o.props&&"function"==typeof o.props.onClick&&o.props.onClick(t),!U||t.defaultPrevented||function(t,r,n,o,a,i,s,l="none"){if("u">typeof window){let u,{nodeName:c}=t.currentTarget;if("A"===c.toUpperCase()&&((u=t.currentTarget.getAttribute("target"))&&"_self"!==u||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,m.isLocalURL)(r)){o&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),i){let e=!1;if(i({preventDefault:()=>{e=!0}}),e)return}let{navigate:d}=e.r(32916);d(r,o?"replace":"push",!1===a?h.ScrollBehavior.NoScroll:h.ScrollBehavior.Default,n.current,s,l)}}(t,F,x,_,E,T,z,I)},onMouseEnter(e){R||"function"!=typeof L||L(e),R&&o.props&&"function"==typeof o.props.onMouseEnter&&o.props.onMouseEnter(e),U&&W&&(0,p.onNavigationIntent)(e.currentTarget,!0===$)},onTouchStart:function(e){R||"function"!=typeof M||M(e),R&&o.props&&"function"==typeof o.props.onTouchStart&&o.props.onTouchStart(e),U&&W&&(0,p.onNavigationIntent)(e.currentTarget,!0===$)}};return(0,d.isAbsoluteUrl)(F)?K.href=F:R&&!S&&("a"!==o.type||"href"in o.props)||(K.href=(0,f.addBasePath)(F)),a=R?s.default.cloneElement(o,K):(0,i.jsx)("a",{...O,...K,children:n}),(0,i.jsx)(v.Provider,{value:b,children:a})}let v=(0,s.createContext)(p.IDLE_LINK_STATUS),y=()=>(0,s.useContext)(v);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},18581,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return o}});let n=e.r(71645);function o(e,t){let r=(0,n.useRef)(null),o=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=o.current;t&&(o.current=null,t())}else e&&(r.current=a(e,n)),t&&(o.current=a(t,n))},[e,t])}function a(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},95057,(e,t,r)=>{e.i(47167),Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return s},formatWithValidation:function(){return u},urlObjectKeys:function(){return l}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=e.r(90809)._(e.r(98183)),i=/https?|ftp|gopher|file/;function s(e){let{auth:t,hostname:r}=e,n=e.protocol||"",o=e.pathname||"",s=e.hash||"",l=e.query||"",u=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?u=t+e.host:r&&(u=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(u+=":"+e.port)),l&&"object"==typeof l&&(l=String(a.urlQueryToSearchParams(l)));let c=e.search||l&&`?${l}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||i.test(n))&&!1!==u?(u="//"+(u||""),o&&"/"!==o[0]&&(o="/"+o)):u||(u=""),s&&"#"!==s[0]&&(s="#"+s),c&&"?"!==c[0]&&(c="?"+c),o=o.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${n}${u}${o}${c}${s}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function u(e){return s(e)}},73668,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return a}});let n=e.r(18967),o=e.r(52817);function a(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,o.hasBasePath)(r.pathname)}catch(e){return!1}}},18967,(e,t,r)=>{e.i(47167),Object.defineProperty(r,"__esModule",{value:!0});var n={DecodeError:function(){return b},MiddlewareNotFoundError:function(){return w},MissingStaticPage:function(){return x},NormalizeError:function(){return v},PageNotFoundError:function(){return y},SP:function(){return m},ST:function(){return g},WEB_VITALS:function(){return a},execOnce:function(){return i},getDisplayName:function(){return d},getLocationOrigin:function(){return u},getURL:function(){return c},isAbsoluteUrl:function(){return l},isResSent:function(){return f},loadGetInitialProps:function(){return p},normalizeRepeatedSlashes:function(){return h},stringifyError:function(){return k}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=["CLS","FCP","INP","LCP","TTFB"];function i(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let s=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,l=e=>{let t=e.charCodeAt(0);return!!(t>=65&&t<=90||t>=97&&t<=122)&&s.test(e)};function u(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function c(){let{href:e}=window.location,t=u();return e.substring(t.length)}function d(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function f(e){return e.finished||e.headersSent}function h(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function p(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await p(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&f(r))return n;if(!n)throw Error(`"${d(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`);return n}let m="u">typeof performance,g=m&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class b extends Error{}class v extends Error{}class y extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class x extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class w extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function k(e){return JSON.stringify({message:e.message,stack:e.stack})}}],18566,(e,t,r)=>{t.exports=e.r(76562)}]);