@yancyyu/openhermit 1.6.7 → 1.6.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/bin/hermit.mjs +11 -1
  2. package/dist-renderer/assets/{ProjectEditorOverlay-B-_Kp7vz.js → ProjectEditorOverlay-OZg4lWtu.js} +1 -1
  3. package/dist-renderer/assets/{TeamGraphOverlay-DeBN5lDT.js → TeamGraphOverlay-C6fVnVBE.js} +1 -1
  4. package/dist-renderer/assets/{_basePickBy-CyWYwgZE.js → _basePickBy-DQinQ-IU.js} +1 -1
  5. package/dist-renderer/assets/{_baseUniq-D2y5qmGJ.js → _baseUniq-DOq99lQv.js} +1 -1
  6. package/dist-renderer/assets/{arc-CpofsFTN.js → arc-EJpSy40u.js} +1 -1
  7. package/dist-renderer/assets/{architectureDiagram-VXUJARFQ-CVnLH_nx.js → architectureDiagram-VXUJARFQ-C3jinRFQ.js} +1 -1
  8. package/dist-renderer/assets/{blockDiagram-VD42YOAC-CxEdXgIy.js → blockDiagram-VD42YOAC-Ds1sLqQU.js} +1 -1
  9. package/dist-renderer/assets/{c4Diagram-YG6GDRKO-butp85gz.js → c4Diagram-YG6GDRKO-Dkq6gEV3.js} +1 -1
  10. package/dist-renderer/assets/channel-CnnIQ09m.js +1 -0
  11. package/dist-renderer/assets/{chunk-4BX2VUAB-Zq6cOe4S.js → chunk-4BX2VUAB-DfoR1Eth.js} +1 -1
  12. package/dist-renderer/assets/{chunk-55IACEB6-BKUQ31tm.js → chunk-55IACEB6-1yTo8HC1.js} +1 -1
  13. package/dist-renderer/assets/{chunk-B4BG7PRW-k5mPNt7M.js → chunk-B4BG7PRW-DeRFv4o-.js} +1 -1
  14. package/dist-renderer/assets/{chunk-DI55MBZ5-6zG7Gtm5.js → chunk-DI55MBZ5-DnuRLtXa.js} +1 -1
  15. package/dist-renderer/assets/{chunk-FMBD7UC4-CQULjxYE.js → chunk-FMBD7UC4-DY4SGm2Q.js} +1 -1
  16. package/dist-renderer/assets/{chunk-QN33PNHL-B-1HVvnD.js → chunk-QN33PNHL-Co0YKXbF.js} +1 -1
  17. package/dist-renderer/assets/{chunk-QZHKN3VN-CEIVELZP.js → chunk-QZHKN3VN-D6B1yje9.js} +1 -1
  18. package/dist-renderer/assets/{chunk-TZMSLE5B-D3RvJeK7.js → chunk-TZMSLE5B-BhWYPtuV.js} +1 -1
  19. package/dist-renderer/assets/classDiagram-2ON5EDUG-Z8mpHhup.js +1 -0
  20. package/dist-renderer/assets/classDiagram-v2-WZHVMYZB-Z8mpHhup.js +1 -0
  21. package/dist-renderer/assets/clone-CuR_cT-j.js +1 -0
  22. package/dist-renderer/assets/{cose-bilkent-S5V4N54A-BSNpaBjf.js → cose-bilkent-S5V4N54A-BCVE3XIz.js} +1 -1
  23. package/dist-renderer/assets/{dagre-6UL2VRFP-B5RSyejY.js → dagre-6UL2VRFP-C4GYV0TR.js} +1 -1
  24. package/dist-renderer/assets/{diagram-PSM6KHXK-CUpooxWa.js → diagram-PSM6KHXK-Bp5VcXOv.js} +1 -1
  25. package/dist-renderer/assets/{diagram-QEK2KX5R-C6IgPHXC.js → diagram-QEK2KX5R-CufQjflj.js} +1 -1
  26. package/dist-renderer/assets/{diagram-S2PKOQOG-DEF8UYeX.js → diagram-S2PKOQOG-CVPTloYp.js} +1 -1
  27. package/dist-renderer/assets/{erDiagram-Q2GNP2WA-A67Ainvm.js → erDiagram-Q2GNP2WA-CnYGIQmC.js} +1 -1
  28. package/dist-renderer/assets/{flowDiagram-NV44I4VS-BSxdxCYS.js → flowDiagram-NV44I4VS-1hZTMKh3.js} +1 -1
  29. package/dist-renderer/assets/{ganttDiagram-JELNMOA3-D0g_cUWu.js → ganttDiagram-JELNMOA3-BCfQhN9i.js} +1 -1
  30. package/dist-renderer/assets/{gitGraphDiagram-V2S2FVAM-TQkc-xrr.js → gitGraphDiagram-V2S2FVAM-Cu8GBTLw.js} +1 -1
  31. package/dist-renderer/assets/{graph-D1X6Z0ly.js → graph-BQSJy80Y.js} +1 -1
  32. package/dist-renderer/assets/{index-C-G8_qWC.js → index-BKaFIpCM.js} +1 -1
  33. package/dist-renderer/assets/{index-DTOb68GH.js → index-BRqo7Dsl.js} +1 -1
  34. package/dist-renderer/assets/{index-Bc8Snhtz.js → index-BgayBDco.js} +1 -1
  35. package/dist-renderer/assets/{index-BWj2xsQa.js → index-CF8SnlXr.js} +8 -8
  36. package/dist-renderer/assets/{index-CxkxUGEC.js → index-DtQcKlpQ.js} +1 -1
  37. package/dist-renderer/assets/{index-B0vke9OS.js → index-S1N6sZeQ.js} +1 -1
  38. package/dist-renderer/assets/{infoDiagram-HS3SLOUP-DQMl9_wt.js → infoDiagram-HS3SLOUP-B_GZXitE.js} +1 -1
  39. package/dist-renderer/assets/{journeyDiagram-XKPGCS4Q-CykZgvZw.js → journeyDiagram-XKPGCS4Q-DrjII-BL.js} +1 -1
  40. package/dist-renderer/assets/{kanban-definition-3W4ZIXB7-BTME6mxG.js → kanban-definition-3W4ZIXB7-CXj7EbX_.js} +1 -1
  41. package/dist-renderer/assets/{layout-hvnehCFs.js → layout-BhnMVMCe.js} +1 -1
  42. package/dist-renderer/assets/{linear-DXy7Cp5s.js → linear-D36AAy17.js} +1 -1
  43. package/dist-renderer/assets/{mindmap-definition-VGOIOE7T-vFLgNrGn.js → mindmap-definition-VGOIOE7T-Clu7da1H.js} +1 -1
  44. package/dist-renderer/assets/{pieDiagram-ADFJNKIX-Biwi_J05.js → pieDiagram-ADFJNKIX-CXEOHmBN.js} +1 -1
  45. package/dist-renderer/assets/{quadrantDiagram-AYHSOK5B-DQKMslKQ.js → quadrantDiagram-AYHSOK5B-B8ZBsI5N.js} +1 -1
  46. package/dist-renderer/assets/{requirementDiagram-UZGBJVZJ-DO5EY0UC.js → requirementDiagram-UZGBJVZJ-CxzUq46_.js} +1 -1
  47. package/dist-renderer/assets/{sankeyDiagram-TZEHDZUN-DOMdB3JA.js → sankeyDiagram-TZEHDZUN-DSnCrwsn.js} +1 -1
  48. package/dist-renderer/assets/{sequenceDiagram-WL72ISMW-DFLXESpb.js → sequenceDiagram-WL72ISMW-CtyLJiua.js} +1 -1
  49. package/dist-renderer/assets/{stateDiagram-FKZM4ZOC-C56epGkN.js → stateDiagram-FKZM4ZOC-8rkEWYLZ.js} +1 -1
  50. package/dist-renderer/assets/{stateDiagram-v2-4FDKWEC3-Bvha5qjw.js → stateDiagram-v2-4FDKWEC3-DZnIb-vO.js} +1 -1
  51. package/dist-renderer/assets/{timeline-definition-IT6M3QCI-D-LvEkyb.js → timeline-definition-IT6M3QCI-DLAkMAGP.js} +1 -1
  52. package/dist-renderer/assets/treemap-GDKQZRPO-Deu2fbVx.js +162 -0
  53. package/dist-renderer/assets/{xychartDiagram-PRI3JC2R-asoyMZsR.js → xychartDiagram-PRI3JC2R-DygAqeR5.js} +1 -1
  54. package/dist-renderer/index.html +1 -1
  55. package/package.json +1 -1
  56. package/dist-renderer/assets/channel-D6Xqzll6.js +0 -1
  57. package/dist-renderer/assets/classDiagram-2ON5EDUG-qoCOCmX0.js +0 -1
  58. package/dist-renderer/assets/classDiagram-v2-WZHVMYZB-qoCOCmX0.js +0 -1
  59. package/dist-renderer/assets/clone-PZsoVHPy.js +0 -1
  60. package/dist-renderer/assets/treemap-GDKQZRPO-BEzf9w34.js +0 -162
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-C-G8_qWC.js","assets/splashScene-C8lWNnm4.js","assets/index-CxkxUGEC.js","assets/index-B0vke9OS.js","assets/dockerfile-BKs6k2Af.js","assets/simple-mode-GW_nhZxv.js","assets/factor-kuTfRLto.js","assets/nsis-LdVXkNf5.js","assets/pug-DukmZTjD.js","assets/javascript-qCveANmP.js","assets/index-DTOb68GH.js","assets/index-Bc8Snhtz.js","assets/dagre-6UL2VRFP-B5RSyejY.js","assets/graph-D1X6Z0ly.js","assets/_baseUniq-D2y5qmGJ.js","assets/layout-hvnehCFs.js","assets/_basePickBy-CyWYwgZE.js","assets/clone-PZsoVHPy.js","assets/cose-bilkent-S5V4N54A-BSNpaBjf.js","assets/cytoscape.esm-DsxaTqgk.js","assets/c4Diagram-YG6GDRKO-butp85gz.js","assets/chunk-TZMSLE5B-D3RvJeK7.js","assets/flowDiagram-NV44I4VS-BSxdxCYS.js","assets/chunk-FMBD7UC4-CQULjxYE.js","assets/chunk-55IACEB6-BKUQ31tm.js","assets/chunk-QN33PNHL-B-1HVvnD.js","assets/channel-D6Xqzll6.js","assets/erDiagram-Q2GNP2WA-A67Ainvm.js","assets/gitGraphDiagram-V2S2FVAM-TQkc-xrr.js","assets/chunk-4BX2VUAB-Zq6cOe4S.js","assets/chunk-QZHKN3VN-CEIVELZP.js","assets/treemap-GDKQZRPO-BEzf9w34.js","assets/ganttDiagram-JELNMOA3-D0g_cUWu.js","assets/linear-DXy7Cp5s.js","assets/init-Gi6I4Gst.js","assets/defaultLocale-DX6XiGOO.js","assets/infoDiagram-HS3SLOUP-DQMl9_wt.js","assets/pieDiagram-ADFJNKIX-Biwi_J05.js","assets/arc-CpofsFTN.js","assets/ordinal-Cboi1Yqb.js","assets/quadrantDiagram-AYHSOK5B-DQKMslKQ.js","assets/xychartDiagram-PRI3JC2R-asoyMZsR.js","assets/requirementDiagram-UZGBJVZJ-DO5EY0UC.js","assets/sequenceDiagram-WL72ISMW-DFLXESpb.js","assets/classDiagram-2ON5EDUG-qoCOCmX0.js","assets/chunk-B4BG7PRW-k5mPNt7M.js","assets/classDiagram-v2-WZHVMYZB-qoCOCmX0.js","assets/stateDiagram-FKZM4ZOC-C56epGkN.js","assets/chunk-DI55MBZ5-6zG7Gtm5.js","assets/stateDiagram-v2-4FDKWEC3-Bvha5qjw.js","assets/journeyDiagram-XKPGCS4Q-CykZgvZw.js","assets/timeline-definition-IT6M3QCI-D-LvEkyb.js","assets/mindmap-definition-VGOIOE7T-vFLgNrGn.js","assets/kanban-definition-3W4ZIXB7-BTME6mxG.js","assets/sankeyDiagram-TZEHDZUN-DOMdB3JA.js","assets/diagram-S2PKOQOG-DEF8UYeX.js","assets/diagram-QEK2KX5R-C6IgPHXC.js","assets/blockDiagram-VD42YOAC-CxEdXgIy.js","assets/architectureDiagram-VXUJARFQ-CVnLH_nx.js","assets/diagram-PSM6KHXK-CUpooxWa.js","assets/TeamGraphOverlay-DeBN5lDT.js","assets/ProjectEditorOverlay-B-_Kp7vz.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BKaFIpCM.js","assets/splashScene-C8lWNnm4.js","assets/index-DtQcKlpQ.js","assets/index-S1N6sZeQ.js","assets/dockerfile-BKs6k2Af.js","assets/simple-mode-GW_nhZxv.js","assets/factor-kuTfRLto.js","assets/nsis-LdVXkNf5.js","assets/pug-DukmZTjD.js","assets/javascript-qCveANmP.js","assets/index-BRqo7Dsl.js","assets/index-BgayBDco.js","assets/dagre-6UL2VRFP-C4GYV0TR.js","assets/graph-BQSJy80Y.js","assets/_baseUniq-DOq99lQv.js","assets/layout-BhnMVMCe.js","assets/_basePickBy-DQinQ-IU.js","assets/clone-CuR_cT-j.js","assets/cose-bilkent-S5V4N54A-BCVE3XIz.js","assets/cytoscape.esm-DsxaTqgk.js","assets/c4Diagram-YG6GDRKO-Dkq6gEV3.js","assets/chunk-TZMSLE5B-BhWYPtuV.js","assets/flowDiagram-NV44I4VS-1hZTMKh3.js","assets/chunk-FMBD7UC4-DY4SGm2Q.js","assets/chunk-55IACEB6-1yTo8HC1.js","assets/chunk-QN33PNHL-Co0YKXbF.js","assets/channel-CnnIQ09m.js","assets/erDiagram-Q2GNP2WA-CnYGIQmC.js","assets/gitGraphDiagram-V2S2FVAM-Cu8GBTLw.js","assets/chunk-4BX2VUAB-DfoR1Eth.js","assets/chunk-QZHKN3VN-D6B1yje9.js","assets/treemap-GDKQZRPO-Deu2fbVx.js","assets/ganttDiagram-JELNMOA3-BCfQhN9i.js","assets/linear-D36AAy17.js","assets/init-Gi6I4Gst.js","assets/defaultLocale-DX6XiGOO.js","assets/infoDiagram-HS3SLOUP-B_GZXitE.js","assets/pieDiagram-ADFJNKIX-CXEOHmBN.js","assets/arc-EJpSy40u.js","assets/ordinal-Cboi1Yqb.js","assets/quadrantDiagram-AYHSOK5B-B8ZBsI5N.js","assets/xychartDiagram-PRI3JC2R-DygAqeR5.js","assets/requirementDiagram-UZGBJVZJ-CxzUq46_.js","assets/sequenceDiagram-WL72ISMW-CtyLJiua.js","assets/classDiagram-2ON5EDUG-Z8mpHhup.js","assets/chunk-B4BG7PRW-DeRFv4o-.js","assets/classDiagram-v2-WZHVMYZB-Z8mpHhup.js","assets/stateDiagram-FKZM4ZOC-8rkEWYLZ.js","assets/chunk-DI55MBZ5-DnuRLtXa.js","assets/stateDiagram-v2-4FDKWEC3-DZnIb-vO.js","assets/journeyDiagram-XKPGCS4Q-DrjII-BL.js","assets/timeline-definition-IT6M3QCI-DLAkMAGP.js","assets/mindmap-definition-VGOIOE7T-Clu7da1H.js","assets/kanban-definition-3W4ZIXB7-CXj7EbX_.js","assets/sankeyDiagram-TZEHDZUN-DSnCrwsn.js","assets/diagram-S2PKOQOG-CVPTloYp.js","assets/diagram-QEK2KX5R-CufQjflj.js","assets/blockDiagram-VD42YOAC-Ds1sLqQU.js","assets/architectureDiagram-VXUJARFQ-C3jinRFQ.js","assets/diagram-PSM6KHXK-Bp5VcXOv.js","assets/TeamGraphOverlay-C6fVnVBE.js","assets/ProjectEditorOverlay-OZg4lWtu.js"])))=>i.map(i=>d[i]);
2
2
  import{L as K2,g as pPe,P as fPe,s as Kst}from"./splashScene-C8lWNnm4.js";function Jst(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();const eit="modulepreload",tit=function(e){return"/"+e},cue={},Me=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=o?.nonce||o?.getAttribute("nonce");s=Promise.allSettled(n.map(c=>{if(c=tit(c),c in cue)return;cue[c]=!0;const l=c.endsWith(".css"),d=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const p=document.createElement("link");if(p.rel=l?"stylesheet":eit,l||(p.as="script"),p.crossOrigin="",p.href=c,a&&p.setAttribute("nonce",a),document.head.appendChild(p),l)return new Promise((f,h)=>{p.addEventListener("load",f),p.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&i(a.reason);return t().catch(i)})};if(window.location.protocol!=="file:"){const{startSplashScene:e}=await Me(async()=>{const{startSplashScene:n}=await import("./splashScene-C8lWNnm4.js").then(r=>r.a);return{startSplashScene:n}},[]),t=document.getElementById("splash");t&&!window.__claudeTeamsSplashScene&&(window.__claudeTeamsSplashScene=e(t))}window.setTimeout(function(){var e=document.getElementById("splash"),t=document.getElementById("root"),n=document.getElementById("splash-loading-hint");e&&t&&t.childElementCount===0&&n&&(n.classList.add("splash-error"),n.textContent="启动脚本加载时间过长。请重新打开应用;如果仍停在这里,请使用新版安装包覆盖安装。")},12e3);var qC=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function If(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function j7n(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:function(){return e[r]}})}),n}var hPe={exports:{}},CX={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.js
@@ -962,7 +962,7 @@ Url: ${BD(e)}`),!0}return!1}function $_t(e,t){return t?.length?rQe(e).some(n=>Gh
962
962
  Type: ${e}
963
963
  Name: ${mm(r)}
964
964
  Error:`,s)}}function V0t(){return A0t(e=>{N$("cls",{metric:e}),vQe=e},{reportAllChanges:!0})}function q0t(){return z0t(e=>{N$("lcp",{metric:e}),TQe=e},{reportAllChanges:!0})}function W0t(){return F0t(e=>{N$("ttfb",{metric:e}),EQe=e})}function G0t(){return j0t(e=>{N$("inp",{metric:e}),wQe=e})}function xU(e,t,n,r,s=!1){CQe(e,t);let i;return WD[e]||(i=n(),WD[e]=!0),r&&t({metric:r}),RQe(e,t,s?i:void 0)}function H0t(e){const t={};e==="event"&&(t.durationThreshold=0),_E(e,n=>{N$(e,{entries:n})},t)}function CQe(e,t){jk[e]=jk[e]||[],jk[e].push(t)}function RQe(e,t,n){return()=>{n&&n();const r=jk[e];if(!r)return;const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}function Z0t(e){return"duration"in e}const K0t=e=>{const t=n=>{(n.type==="pagehide"||Gn.document?.visibilityState==="hidden")&&e(n)};Tg("visibilitychange",t,{capture:!0,once:!0}),Tg("pagehide",t,{capture:!0,once:!0})};function z4(e){return typeof e=="number"&&isFinite(e)}function Fg(e,t,n,{...r}){const s=ss(e).start_timestamp;return s&&s>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),XMe(e,()=>{const i=Cy({startTime:t,...r});return i&&i.end(n),i})}function cre(e){const t=ns();if(!t)return;const{name:n,transaction:r,attributes:s,startTime:i}=e,{release:o,environment:a,sendDefaultPii:c}=t.getOptions(),d=t.getIntegrationByName("Replay")?.getReplayId(),p=Es(),f=p.getUser(),h=f!==void 0?f.email||f.id||f.ip_address:void 0;let m;try{m=p.getScopeData().contexts.profile.profile_id}catch{}const O={release:o,environment:a,user:h||void 0,profile_id:m||void 0,replay_id:d||void 0,transaction:r,"user_agent.original":Gn.navigator?.userAgent,"client.address":c?"{{auto}}":void 0,...s};return Cy({name:n,attributes:O,startTime:i,experimental:{standalone:!0}})}function A$(){return Gn.addEventListener&&Gn.performance}function Fs(e){return e/1e3}function J0t(e){let t="unknown",n="unknown",r="";for(const s of e){if(s==="/"){[t,n]=e.split("/");break}if(!isNaN(Number(s))){t=r==="h"?"http":r,n=e.split(r)[1];break}r+=s}return r===e&&(t=r),{name:t,version:n}}function SU(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function vU(e,t){let n,r=!1;function s(a){!r&&n&&t(a,n.spanContext().spanId,n),r=!0}K0t(()=>{s("pagehide")});const i=e.on("beforeStartNavigationSpan",(a,c)=>{c?.isRedirect||(s("navigation"),i(),o())}),o=e.on("afterStartPageLoadSpan",a=>{n=a,o()})}function ebt(e){let t=0,n;if(!SU("layout-shift"))return;const r=are(({metric:s})=>{const i=s.entries[s.entries.length-1];i&&(t=s.value,n=i)},!0);vU(e,(s,i)=>{tbt(t,n,i,s),r()})}function tbt(e,t,n,r){Lm&&It.log(`Sending CLS span (${e})`);const s=t?Fs((Ma()||0)+t.startTime):uo(),i=Es().getScopeData().transactionName,o=t?da(t.sources[0]?.node):"Layout shift",a={[fo]:"auto.http.browser.cls",[Kd]:"ui.webvital.cls",[g_]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t?.sources&&t.sources.forEach((l,d)=>{a[`cls.source.${d+1}`]=da(l.node)});const c=cre({name:o,transaction:i,attributes:a,startTime:s});c&&(c.addEvent("cls",{[E$]:"",[w$]:e}),c.end(s))}const nbt=6e4;function I$(e){return e!=null&&e>0&&e<=nbt}function rbt(e){let t=0,n;if(!SU("largest-contentful-paint"))return;const r=lre(({metric:s})=>{const i=s.entries[s.entries.length-1];!i||!I$(s.value)||(t=s.value,n=i)},!0);vU(e,(s,i)=>{sbt(t,n,i,s),r()})}function sbt(e,t,n,r){if(!I$(e))return;Lm&&It.log(`Sending LCP span (${e})`);const s=Fs((Ma()||0)+(t?.startTime||0)),i=Es().getScopeData().transactionName,o=t?da(t.element):"Largest contentful paint",a={[fo]:"auto.http.browser.lcp",[Kd]:"ui.webvital.lcp",[g_]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(a["lcp.element"]=da(t.element)),t.id&&(a["lcp.id"]=t.id),t.url&&(a["lcp.url"]=t.url),t.loadTime!=null&&(a["lcp.loadTime"]=t.loadTime),t.renderTime!=null&&(a["lcp.renderTime"]=t.renderTime),t.size!=null&&(a["lcp.size"]=t.size));const c=cre({name:o,transaction:i,attributes:a,startTime:s});c&&(c.addEvent("lcp",{[E$]:"millisecond",[w$]:e}),c.end(s))}function nu(e){return e&&((Ma()||performance.timeOrigin)+e)/1e3}function PQe(e){const t={};if(e.nextHopProtocol!=null){const{name:n,version:r}=J0t(e.nextHopProtocol);t["network.protocol.version"]=r,t["network.protocol.name"]=n}return Ma()||A$()?.timeOrigin?ibt({...t,"http.request.redirect_start":nu(e.redirectStart),"http.request.redirect_end":nu(e.redirectEnd),"http.request.worker_start":nu(e.workerStart),"http.request.fetch_start":nu(e.fetchStart),"http.request.domain_lookup_start":nu(e.domainLookupStart),"http.request.domain_lookup_end":nu(e.domainLookupEnd),"http.request.connect_start":nu(e.connectStart),"http.request.secure_connection_start":nu(e.secureConnectionStart),"http.request.connection_end":nu(e.connectEnd),"http.request.request_start":nu(e.requestStart),"http.request.response_start":nu(e.responseStart),"http.request.response_end":nu(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0}):t}function ibt(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}const obt=2147483647;let lfe=0,qa={},Nl,GD;function abt({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){const r=A$();if(r&&Ma()){r.mark&&Gn.performance.mark("sentry-tracing-init");const s=t?rbt(n):t===!1?pbt():void 0,i=e?ebt(n):e===!1?dbt():void 0,o=fbt();return()=>{o(),s?.(),i?.()}}return()=>{}}function lbt(){SR("longtask",({entries:e})=>{const t=Gc();if(!t)return;const{op:n,start_timestamp:r}=ss(t);for(const s of e){const i=Fs(Ma()+s.startTime),o=Fs(s.duration);n==="navigation"&&r&&i<r||Fg(t,i,i+o,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[fo]:"auto.ui.browser.metrics"}})}})}function cbt(){new PerformanceObserver(t=>{const n=Gc();if(n)for(const r of t.getEntries()){if(!r.scripts[0])continue;const s=Fs(Ma()+r.startTime),{start_timestamp:i,op:o}=ss(n);if(o==="navigation"&&i&&s<i)continue;const a=Fs(r.duration),c={[fo]:"auto.ui.browser.metrics"},l=r.scripts[0],{invoker:d,invokerType:p,sourceURL:f,sourceFunctionName:h,sourceCharPosition:m}=l;c["browser.script.invoker"]=d,c["browser.script.invoker_type"]=p,f&&(c["code.filepath"]=f),h&&(c["code.function"]=h),m!==-1&&(c["browser.script.source_char_position"]=m),Fg(n,s,s+a,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:c})}}).observe({type:"long-animation-frame",buffered:!0})}function ubt(){SR("event",({entries:e})=>{const t=Gc();if(t){for(const n of e)if(n.name==="click"){const r=Fs(Ma()+n.startTime),s=Fs(n.duration),i={name:da(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[fo]:"auto.ui.browser.metrics"}},o=aMe(n.target);o&&(i.attributes["ui.component_name"]=o),Fg(t,r,r+s,i)}}})}function dbt(){return are(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(qa.cls={value:e.value,unit:""},GD=t)},!0)}function pbt(){return lre(({metric:e})=>{const t=e.entries[e.entries.length-1];!t||!I$(e.value)||(qa.lcp={value:e.value,unit:"millisecond"},Nl=t)},!0)}function fbt(){return Y0t(({metric:e})=>{e.entries[e.entries.length-1]&&(qa.ttfb={value:e.value,unit:"millisecond"})})}function hbt(e,t){const n=A$(),r=Ma();if(!n?.getEntries||!r)return;const{spanStreamingEnabled:s,ignorePerformanceApiSpans:i,ignoreResourceSpans:o,recordClsOnPageloadSpan:a,recordLcpOnPageloadSpan:c}=t,l=Fs(r),d=n.getEntries(),{op:p,start_timestamp:f}=ss(e);if(d.slice(lfe).forEach(h=>{const m=Fs(h.startTime),O=Fs(Math.max(0,h.duration));if(!(p==="navigation"&&f&&l+m<f))switch(h.entryType){case"navigation":{_bt(e,h,l);break}case"mark":case"paint":case"measure":{Obt(e,h,m,O,l,i);const _=P$(),b=h.startTime<_.firstHiddenTime;h.name==="first-paint"&&b&&(qa.fp={value:h.startTime,unit:"millisecond"}),h.name==="first-contentful-paint"&&b&&(qa.fcp={value:h.startTime,unit:"millisecond"});break}case"resource":{xbt(e,h,h.name,m,O,l,o);break}}}),lfe=Math.max(d.length-1,0),Sbt(e,s),p==="pageload"){if(Ebt(qa),s){const h=(m,O,_)=>{const b=_??`browser.web_vital.${m}.value`;e.setAttribute(b,O),Lm&&It.log("Setting web vital attribute",{[b]:O},"on pageload span")};["ttfb","fp","fcp"].forEach(m=>{qa[m]&&h(m,qa[m].value)}),qa["ttfb.requestTime"]&&h("ttfb.requestTime",qa["ttfb.requestTime"].value,"browser.web_vital.ttfb.request_time")}else a||delete qa.cls,c||delete qa.lcp,Object.entries(qa).forEach(([h,m])=>{tgt(h,m.value,m.unit)}),vbt(e,t);e.setAttribute(s?"browser.performance.time_origin":"performance.timeOrigin",l),e.setAttribute(s?"browser.performance.navigation.activation_start":"performance.activationStart",gE())}Nl=void 0,GD=void 0,qa={}}function mbt(e){if(e?.entryType==="measure")try{return e.detail.devtools.track==="Components ⚛"}catch{return}}function Obt(e,t,n,r,s,i){if(mbt(t)||["mark","measure"].includes(t.entryType)&&Gh(t.name,i))return;const o=R$(!1),a=Fs(o?o.requestStart:0),c=s+Math.max(n,a),l=s+n,d=l+r,p={[fo]:"auto.resource.browser.metrics"};c!==l&&(p["sentry.browser.measure_happened_before_request"]=!0,p["sentry.browser.measure_start_time"]=c),gbt(p,t),c<=d&&Fg(e,c,d,{name:t.name,op:t.entryType,attributes:p})}function gbt(e,t){try{const n=t.detail;if(!n)return;if(typeof n=="object"){for(const[r,s]of Object.entries(n))if(s&&Fv(s))e[`sentry.browser.measure.detail.${r}`]=s;else if(s!==void 0)try{e[`sentry.browser.measure.detail.${r}`]=JSON.stringify(s)}catch{}return}if(Fv(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function _bt(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{RA(e,t,r,n)}),RA(e,t,"secureConnection",n,"TLS/SSL"),RA(e,t,"fetch",n,"cache"),RA(e,t,"domainLookup",n,"DNS"),ybt(e,t,n)}function RA(e,t,n,r,s=n){const i=bbt(n),o=t[i],a=t[`${n}Start`];!a||!o||Fg(e,r+Fs(a),r+Fs(o),{op:`browser.${s}`,name:t.name,attributes:{[fo]:"auto.ui.browser.metrics",...n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function bbt(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function ybt(e,t,n){const r=n+Fs(t.requestStart),s=n+Fs(t.responseEnd),i=n+Fs(t.responseStart);t.responseEnd&&(Fg(e,r,s,{op:"browser.request",name:t.name,attributes:{[fo]:"auto.ui.browser.metrics"}}),Fg(e,i,s,{op:"browser.response",name:t.name,attributes:{[fo]:"auto.ui.browser.metrics"}}))}function xbt(e,t,n,r,s,i,o){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;const a=t.initiatorType?`resource.${t.initiatorType}`:"resource.other";if(o?.includes(a))return;const c={[fo]:"auto.resource.browser.metrics"},l=pb(n);l.protocol&&(c["url.scheme"]=l.protocol.split(":").pop()),l.host&&(c["server.address"]=l.host),c["url.same_origin"]=n.includes(Gn.location.origin),Tbt(t,c,[["responseStatus","http.response.status_code"],["transferSize","http.response_transfer_size"],["encodedBodySize","http.response_content_length"],["decodedBodySize","http.decoded_response_content_length"],["renderBlockingStatus","resource.render_blocking_status"],["deliveryType","http.response_delivery_type"]]);const d={...c,...PQe(t)},p=i+r,f=p+s;Fg(e,p,f,{name:n.replace(Gn.location.origin,""),op:a,attributes:d})}function Sbt(e,t){const n=Gn.navigator;if(!n)return;const r=n.connection;r&&(r.effectiveType&&e.setAttribute(t?"network.connection.effective_type":"effectiveConnectionType",r.effectiveType),r.type&&e.setAttribute(t?"network.connection.type":"connectionType",r.type),z4(r.rtt)&&(qa["connection.rtt"]={value:r.rtt,unit:"millisecond"},t&&e.setAttribute("network.connection.rtt",r.rtt))),z4(n.deviceMemory)&&(t?e.setAttribute("device.memory.estimated_capacity",n.deviceMemory):e.setAttribute("deviceMemory",`${n.deviceMemory} GB`)),z4(n.hardwareConcurrency)&&(t?e.setAttribute("device.processor_count",n.hardwareConcurrency):e.setAttribute("hardwareConcurrency",String(n.hardwareConcurrency)))}function vbt(e,t){Nl&&t.recordLcpOnPageloadSpan&&(Nl.element&&e.setAttribute("lcp.element",da(Nl.element)),Nl.id&&e.setAttribute("lcp.id",Nl.id),Nl.url&&e.setAttribute("lcp.url",Nl.url.trim().slice(0,200)),Nl.loadTime!=null&&e.setAttribute("lcp.loadTime",Nl.loadTime),Nl.renderTime!=null&&e.setAttribute("lcp.renderTime",Nl.renderTime),e.setAttribute("lcp.size",Nl.size)),GD?.sources&&t.recordClsOnPageloadSpan&&GD.sources.forEach((n,r)=>e.setAttribute(`cls.source.${r+1}`,da(n.node)))}function Tbt(e,t,n){n.forEach(([r,s])=>{const i=e[r];i!=null&&(typeof i=="number"&&i<obt||typeof i=="string")&&(t[s]=i)})}function Ebt(e){const t=R$(!1);if(!t)return;const{responseStart:n,requestStart:r}=t;r<=n&&(e["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}const B4=[],Xk=new Map,ox=new Map,$Qe=60;function wbt(){if(A$()&&Ma()){const t=kbt();return()=>{t()}}return()=>{}}const vR={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"};function kbt(){return kQe(Cbt)}const Cbt=({metric:e})=>{if(e.value==null)return;const t=Fs(e.value);if(t>$Qe)return;const n=e.entries.find(m=>m.duration===e.value&&vR[m.name]);if(!n)return;const{interactionId:r}=n,s=vR[n.name],i=Fs(Ma()+n.startTime),o=Gc(),a=o?Ta(o):void 0,c=r!=null?Xk.get(r):void 0,l=c?.span||a,d=l?ss(l).description:Es().getScopeData().transactionName,p=c?.elementName||da(n.target),f={[fo]:"auto.http.browser.inp",[Kd]:`ui.interaction.${s}`,[g_]:n.duration},h=cre({name:p,transaction:d,attributes:f,startTime:i});h&&(h.addEvent("inp",{[E$]:"millisecond",[w$]:e.value}),h.end(i+t))};function Rbt(e){return e!=null?Xk.get(e):void 0}function Pbt(){const e=Object.keys(vR);bU()&&e.forEach(s=>{Gn.addEventListener(s,t,{capture:!0,passive:!0})});function t(s){const i=s.target;if(!i)return;const o=da(i),a=Math.round(s.timeStamp);if(ox.set(a,o),ox.size>50){const c=ox.keys().next().value;c!==void 0&&ox.delete(c)}}function n(s){const i=Math.round(s.startTime);let o=ox.get(i);if(!o)for(let a=-5;a<=5;a++){const c=ox.get(i+a);if(c){o=c;break}}return o||"<unknown>"}const r=({entries:s})=>{const i=Gc(),o=i&&Ta(i);s.forEach(a=>{if(!Z0t(a))return;const c=a.interactionId;if(c==null||Xk.has(c))return;const l=a.target?da(a.target):n(a);if(B4.length>10){const d=B4.shift();Xk.delete(d)}B4.push(c),Xk.set(c,{span:o,elementName:l})})};SR("event",r),SR("first-input",r)}function ure(e){const{name:t,op:n,origin:r,metricName:s,value:i,attributes:o,parentSpan:a,reportEvent:c,startTime:l,endTime:d}=e,p=Es().getScopeData().transactionName,f={[fo]:r,[Kd]:n,[g_]:0,[`browser.web_vital.${s}.value`]:i,"sentry.transaction":p,"user_agent.original":Gn.navigator?.userAgent,...o};a&&wMe(a).attributes?.[Kd]==="pageload"&&(f["sentry.pageload.span_id"]=a.spanContext().spanId),c&&(f[`browser.web_vital.${s}.report_event`]=c);const h=Cy({name:t,attributes:f,startTime:l,parentSpan:a});h&&h.end(d??l)}function $bt(e){let t=0,n;if(!SU("largest-contentful-paint"))return;const r=lre(({metric:s})=>{const i=s.entries[s.entries.length-1];!i||!I$(s.value)||(t=s.value,n=i)},!0);vU(e,(s,i,o)=>{Nbt(t,n,o,s),r()})}function Nbt(e,t,n,r){if(!I$(e))return;Lm&&It.log(`Sending LCP span (${e})`);const s=Ma()||0,i=Fs(s),o=Fs(s+(t?.startTime||0)),a=t?da(t.element):"Largest contentful paint",c={};t?.element&&(c["browser.web_vital.lcp.element"]=da(t.element)),t?.id&&(c["browser.web_vital.lcp.id"]=t.id),t?.url&&(c["browser.web_vital.lcp.url"]=t.url),t?.loadTime!=null&&(c["browser.web_vital.lcp.load_time"]=t.loadTime),t?.renderTime!=null&&(c["browser.web_vital.lcp.render_time"]=t.renderTime),t?.size!=null&&(c["browser.web_vital.lcp.size"]=t.size),ure({name:a,op:"ui.webvital.lcp",origin:"auto.http.browser.lcp",metricName:"lcp",value:e,attributes:c,parentSpan:n,reportEvent:r,startTime:i,endTime:o})}function Abt(e){let t=0,n;if(!SU("layout-shift"))return;const r=are(({metric:s})=>{const i=s.entries[s.entries.length-1];i&&(t=s.value,n=i)},!0);vU(e,(s,i,o)=>{Ibt(t,n,o,s),r()})}function Ibt(e,t,n,r){Lm&&It.log(`Sending CLS span (${e})`);const s=t?Fs((Ma()||0)+t.startTime):uo(),i=t?da(t.sources[0]?.node):"Layout shift",o={};t?.sources&&t.sources.forEach((a,c)=>{o[`browser.web_vital.cls.source.${c+1}`]=da(a.node)}),ure({name:i,op:"ui.webvital.cls",origin:"auto.http.browser.cls",metricName:"cls",value:e,attributes:o,parentSpan:n,reportEvent:r,startTime:s})}function Mbt(){if(!A$()||!Ma())return;kQe(({metric:n})=>{if(n.value==null||Fs(n.value)>$Qe)return;const s=n.entries.find(i=>i.duration===n.value&&vR[i.name]);s&&Qbt(n.value,s)})}function Qbt(e,t){Lm&&It.log(`Sending INP span (${e})`);const n=Fs(Ma()+t.startTime),r=Fs(e),s=vR[t.name],i=Rbt(t.interactionId),o=Gc(),a=o?Ta(o):void 0,c=i?.span||a,l=c?wMe(c).name:Es().getScopeData().transactionName,d=i?.elementName||da(t.target);ure({name:d,op:`ui.interaction.${s}`,origin:"auto.http.browser.inp",metricName:"inp",value:e,attributes:{[g_]:t.duration,"sentry.transaction":l},startTime:n,endTime:n+r,parentSpan:c})}const Dbt=1e3;let cfe,XH,UH;function Lbt(e){const t="dom";m_(t,e),O_(t,jbt)}function jbt(){if(!Gn.document)return;const e=Du.bind(null,"dom"),t=ufe(e,!0);Gn.document.addEventListener("click",t,!1),Gn.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{const s=Gn[n]?.prototype;s?.hasOwnProperty?.("addEventListener")&&(Cc(s,"addEventListener",function(i){return function(o,a,c){if(o==="click"||o=="keypress")try{const l=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},d=l[o]=l[o]||{refCount:0};if(!d.handler){const p=ufe(e);d.handler=p,i.call(this,o,p,c)}d.refCount++}catch{}return i.call(this,o,a,c)}}),Cc(s,"removeEventListener",function(i){return function(o,a,c){if(o==="click"||o=="keypress")try{const l=this.__sentry_instrumentation_handlers__||{},d=l[o];d&&(d.refCount--,d.refCount<=0&&(i.call(this,o,d.handler,c),d.handler=void 0,delete l[o]),Object.keys(l).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return i.call(this,o,a,c)}}))})}function Xbt(e){if(e.type!==XH)return!1;try{if(!e.target||e.target._sentryId!==UH)return!1}catch{}return!0}function Ubt(e,t){return e!=="keypress"?!1:t?.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function ufe(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=zbt(n);if(Ubt(n.type,r))return;sc(n,"_sentryCaptured",!0),r&&!r._sentryId&&sc(r,"_sentryId",Lu());const s=n.type==="keypress"?"input":n.type;Xbt(n)||(e({event:n,name:s,global:t}),XH=n.type,UH=r?r._sentryId:void 0),clearTimeout(cfe),cfe=Gn.setTimeout(()=>{UH=void 0,XH=void 0},Dbt)}}function zbt(e){try{return e.target}catch{return null}}let PA;function dre(e){const t="history";m_(t,e),O_(t,Bbt)}function Bbt(){if(Gn.addEventListener("popstate",()=>{const t=Gn.location.href,n=PA;if(PA=t,n===t)return;Du("history",{from:n,to:t})}),!s0t())return;function e(t){return function(...n){const r=n.length>2?n[2]:void 0;if(r){const s=PA,i=Fbt(String(r));if(PA=i,s===i)return t.apply(this,n);Du("history",{from:s,to:i})}return t.apply(this,n)}}Cc(Gn.history,"pushState",e),Cc(Gn.history,"replaceState",e)}function Fbt(e){try{return new URL(e,Gn.location.origin).toString()}catch{return e}}const TQ={};function Ybt(e){const t=TQ[e];if(t)return t;let n=Gn[e];if(MH(n))return TQ[e]=n.bind(Gn);const r=Gn.document;if(r&&typeof r.createElement=="function")try{const s=r.createElement("iframe");s.hidden=!0,r.head.appendChild(s);const i=s.contentWindow;i?.[e]&&(n=i[e]),r.head.removeChild(s)}catch(s){Lm&&It.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,s)}return n&&(TQ[e]=n.bind(Gn))}function Vbt(e){TQ[e]=void 0}const SS="__sentry_xhr_v3__";function NQe(e){const t="xhr";m_(t,e),O_(t,qbt)}function qbt(){if(!Gn.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){const s=new Error,i=uo()*1e3,o=Wh(r[0])?r[0].toUpperCase():void 0,a=Wbt(r[1]);if(!o||!a)return t.apply(n,r);n[SS]={method:o,url:a,request_headers:{}},o==="POST"&&a.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const c=()=>{const l=n[SS];if(l&&n.readyState===4){try{l.status_code=n.status}catch{}const d={endTimestamp:uo()*1e3,startTimestamp:i,xhr:n,virtualError:s};Du("xhr",d)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(l,d,p){return c(),l.apply(d,p)}}):n.addEventListener("readystatechange",c),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(l,d,p){const[f,h]=p,m=d[SS];return m&&Wh(f)&&Wh(h)&&(m.request_headers[f.toLowerCase()]=h),l.apply(d,p)}}),t.apply(n,r)}}),e.send=new Proxy(e.send,{apply(t,n,r){const s=n[SS];if(!s)return t.apply(n,r);r[0]!==void 0&&(s.body=r[0]);const i={startTimestamp:uo()*1e3,xhr:n};return Du("xhr",i),t.apply(n,r)}})}function Wbt(e){if(Wh(e))return e;try{return e.toString()}catch{}}function Gbt(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return Lm&&It.error(n,"Failed to get xhr response headers",e),{}}return t?t.split(`\r
965
- `).reduce((n,r)=>{const[s,i]=r.split(": ");return i&&(n[s.toLowerCase()]=i),n},{}):{}}const Hbt=40;function Zbt(e,t=Ybt("fetch")){let n=0,r=0;async function s(i){const o=i.body.length;n+=o,r++;const a={body:i.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{const c=await t(e.url,a);return{statusCode:c.status,headers:{"x-sentry-rate-limits":c.headers.get("X-Sentry-Rate-Limits"),"retry-after":c.headers.get("Retry-After")}}}catch(c){throw Vbt("fetch"),c}finally{n-=o,r--}}return a_t(e,s,tre(e.bufferSize||Hbt))}const Mc=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Kbt=30,Jbt=50;function zH(e,t,n,r){const s={filename:e,function:t==="<anonymous>"?Ab:t,in_app:!0};return n!==void 0&&(s.lineno=n),r!==void 0&&(s.colno=r),s}const eyt=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,tyt=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,nyt=/\((\S*)(?::(\d+))(?::(\d+))\)/,ryt=/at (.+?) ?\(data:(.+?),/,syt=e=>{const t=e.match(ryt);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=eyt.exec(e);if(n){const[,s,i,o]=n;return zH(s,Ab,+i,+o)}const r=tyt.exec(e);if(r){if(r[2]?.indexOf("eval")===0){const a=nyt.exec(r[2]);a&&(r[2]=a[1],r[3]=a[2],r[4]=a[3])}const[i,o]=AQe(r[1]||Ab,r[2]);return zH(o,i,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},iyt=[Kbt,syt],oyt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ayt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,lyt=e=>{const t=oyt.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const i=ayt.exec(t[3]);i&&(t[1]=t[1]||"eval",t[3]=i[1],t[4]=i[2],t[5]="")}let r=t[3],s=t[1]||Ab;return[s,r]=AQe(s,r),zH(r,s,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},cyt=[Jbt,lyt],uyt=[iyt,cyt],dyt=eMe(...uyt),AQe=(e,t)=>{const n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:Ab,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},$A=1024,pyt="Breadcrumbs",fyt=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:pyt,setup(n){t.console&&j_t(gyt(n)),t.dom&&Lbt(Oyt(n,t.dom)),t.xhr&&NQe(_yt(n)),t.fetch&&hQe(byt(n)),t.history&&dre(yyt(n)),t.sentry&&n.on("beforeSendEvent",myt(n))}}},hyt=fyt;function myt(e){return function(n){ns()===e&&Bg({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:y0(n)},{event:n})}}function Oyt(e,t){return function(r){if(ns()!==e)return;let s,i,o=typeof t=="object"?t.serializeAttribute:void 0,a=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;a&&a>$A&&(Mc&&It.warn(`\`dom.maxStringLength\` cannot exceed ${$A}, but a value of ${a} was configured. Sentry will use ${$A} instead.`),a=$A),typeof o=="string"&&(o=[o]);try{const l=r.event,d=xyt(l)?l.target:l;s=da(d,{keyAttrs:o,maxStringLength:a}),i=aMe(d)}catch{s="<unknown>"}if(s.length===0)return;const c={category:`ui.${r.name}`,message:s};i&&(c.data={"ui.component_name":i}),Bg(c,{event:r.event,name:r.name,global:r.global})}}function gyt(e){return function(n){if(ns()!==e)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:U_t(n.level),message:_pe(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${_pe(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;Bg(r,{input:n.args,level:n.level})}}function _yt(e){return function(n){if(ns()!==e)return;const{startTimestamp:r,endTimestamp:s}=n,i=n.xhr[SS];if(!r||!s||!i)return;const{method:o,url:a,status_code:c,body:l}=i,d={method:o,url:a,status_code:c},p={xhr:n.xhr,input:l,startTimestamp:r,endTimestamp:s},f={category:"xhr",data:d,type:"http",level:fQe(c)};e.emit("beforeOutgoingRequestBreadcrumb",f,p),Bg(f,p)}}function byt(e){return function(n){if(ns()!==e)return;const{startTimestamp:r,endTimestamp:s}=n;if(s&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){const i={data:n.error,input:n.args,startTimestamp:r,endTimestamp:s},o={category:"fetch",data:n.fetchData,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",o,i),Bg(o,i)}else{const i=n.response,o={...n.fetchData,status_code:i?.status},a={input:n.args,response:i,startTimestamp:r,endTimestamp:s},c={category:"fetch",data:o,type:"http",level:fQe(o.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",c,a),Bg(c,a)}}}function yyt(e){return function(n){if(ns()!==e)return;let r=n.from,s=n.to;const i=pb(hr.location.href);let o=r?pb(r):void 0;const a=pb(s);o?.path||(o=i),i.protocol===a.protocol&&i.host===a.host&&(s=a.relative),i.protocol===o.protocol&&i.host===o.host&&(r=o.relative),Bg({category:"navigation",data:{from:r,to:s}})}}function xyt(e){return!!e&&!!e.target}const Syt="EventTarget,Window,Node,ApplicationCache,AudioTrackList,BroadcastChannel,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(","),vyt="BrowserApiErrors",Tyt=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:vyt,setupOnce(){t.setTimeout&&Cc(hr,"setTimeout",dfe),t.setInterval&&Cc(hr,"setInterval",dfe),t.requestAnimationFrame&&Cc(hr,"requestAnimationFrame",wyt),t.XMLHttpRequest&&"XMLHttpRequest"in hr&&Cc(XMLHttpRequest.prototype,"send",kyt);const n=t.eventTarget;n&&(Array.isArray(n)?n:Syt).forEach(s=>Cyt(s,t))}}},Eyt=Tyt;function dfe(e){return function(...t){const n=t[0];return t[0]=Wv(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${mm(e)}`}}),e.apply(this,t)}}function wyt(e){return function(t){return e.apply(this,[Wv(t,{mechanism:{data:{handler:mm(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function kyt(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(s=>{s in n&&typeof n[s]=="function"&&Cc(n,s,function(i){const o={mechanism:{data:{handler:mm(i)},handled:!1,type:`auto.browser.browserapierrors.xhr.${s}`}},a=Wne(i);return a&&(o.mechanism.data.handler=mm(a)),Wv(i,o)})}),e.apply(this,t)}}function Cyt(e,t){const r=hr[e]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(Cc(r,"addEventListener",function(s){return function(i,o,a){try{Ryt(o)&&(o.handleEvent=Wv(o.handleEvent,{mechanism:{data:{handler:mm(o),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&Pyt(this,i,o),s.apply(this,[i,Wv(o,{mechanism:{data:{handler:mm(o),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),a])}}),Cc(r,"removeEventListener",function(s){return function(i,o,a){try{const c=o.__sentry_wrapped__;c&&s.call(this,i,c,a)}catch{}return s.call(this,i,o,a)}}))}function Ryt(e){return typeof e.handleEvent=="function"}function Pyt(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}const $yt=(e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof hr.document>"u"){Mc&&It.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}zpe({ignoreDuration:!0}),Q4();const n=Lf();let r=n.getUser();n.addScopeListener(s=>{const i=s.getUser();(r?.id!==i?.id||r?.ip_address!==i?.ip_address)&&(Q4(),r=i)}),t==="route"&&dre(({from:s,to:i})=>{s!==i&&(zpe({ignoreDuration:!0}),Q4())})}}},Nyt="CultureContext",Ayt=()=>({name:Nyt,preprocessEvent(e){const t=pfe();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})},processSegmentSpan(e){const t=pfe();t&&VMe(e,{"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar})}}),Iyt=Ayt;function pfe(){try{const e=hr.Intl;if(!e)return;const t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}const Myt="GlobalHandlers",Qyt=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:Myt,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(Lyt(n),ffe("onerror")),t.onunhandledrejection&&(jyt(n),ffe("onunhandledrejection"))}}},Dyt=Qyt;function Lyt(e){nMe(t=>{const{stackParser:n,attachStacktrace:r}=IQe();if(ns()!==e||OQe())return;const{msg:s,url:i,line:o,column:a,error:c}=t,l=zyt(sre(n,c||s,void 0,r,!1),i,o,a);l.level="error",WMe(l,{originalException:c,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function jyt(e){rMe(t=>{const{stackParser:n,attachStacktrace:r}=IQe();if(ns()!==e||OQe())return;const s=Xyt(t),i=Fv(s)?Uyt(s):sre(n,s,void 0,r,!0);i.level="error",WMe(i,{originalException:s,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function Xyt(e){if(Fv(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}function Uyt(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function zyt(e,t,n,r){const s=e.exception=e.exception||{},i=s.values=s.values||[],o=i[0]=i[0]||{},a=o.stacktrace=o.stacktrace||{},c=a.frames=a.frames||[];return c.length===0&&c.push({colno:r,lineno:n,filename:Byt(t)??x$(),function:Ab,in_app:!0}),e}function ffe(e){Mc&&It.log(`Global Handler attached: ${e}`)}function IQe(){return ns()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function Byt(e){if(!(!Wh(e)||e.length===0))return e.startsWith("data:")?`<${vg(e,!1)}>`:e}const Fyt=()=>({name:"HttpContext",preprocessEvent(e){if(!hr.navigator&&!hr.location&&!hr.document)return;const t=FD(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}},processSegmentSpan(e){if(!hr.navigator&&!hr.location&&!hr.document)return;const t=FD();VMe(e,{"url.full":t.url||void 0,"http.request.header.user_agent":t.headers["User-Agent"],"http.request.header.referer":t.headers.Referer})}}),Yyt="cause",Vyt=5,qyt="LinkedErrors",Wyt=(e={})=>{const t=e.limit||Vyt,n=e.key||Yyt;return{name:qyt,preprocessEvent(r,s,i){const o=i.getOptions();D_t(nre,o.stackParser,n,t,r,s)}}},Gyt=Wyt;function Hyt(){return Zyt()?(Mc&&Ey(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0):!1}function Zyt(){if(typeof hr.window>"u")return!1;const e=hr;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;const n=x$();return!(hr===hr.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}function Kyt(e){return[R_t(),E_t(),H_t(),Eyt(),hyt(),Dyt(),Gyt(),F_t(),Fyt(),Iyt(),$yt()]}function Jyt(e={}){const t=!e.skipBrowserExtensionCheck&&Hyt();let n=e.defaultIntegrations==null?Kyt():e.defaultIntegrations;const r={...e,enabled:t?!1:e.enabled,stackParser:vmt(e.stackParser||dyt),integrations:zgt({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||Zbt};return g_t(T0t,r)}function ext(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function MQe(e){try{return new URL(e,hr.location.origin).href}catch{return}}function txt(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function QQe(e){try{return new Headers(e)}catch{return}}const hfe=new WeakMap,F4=new Map,DQe={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function nxt(e,t){const{traceFetch:n,traceXHR:r,trackFetchStreamPerformance:s,shouldCreateSpanForRequest:i,enableHTTPTimings:o,tracePropagationTargets:a,onRequestSpanStart:c,onRequestSpanEnd:l}={...DQe,...t},d=typeof i=="function"?i:m=>!0,p=m=>sxt(m,a),f={},h=e.getOptions().propagateTraceparent;n&&(e.addEventProcessor(m=>(m.type==="transaction"&&m.spans&&m.spans.forEach(O=>{if(O.op==="http.client"){const _=F4.get(O.span_id);_&&(O.timestamp=_/1e3,F4.delete(O.span_id))}}),m)),s&&a0t(m=>{if(m.response){const O=hfe.get(m.response);O&&m.endTimestamp&&F4.set(O,m.endTimestamp)}}),hQe(m=>{const O=Z_t(m,d,p,f,{propagateTraceparent:h,onRequestSpanEnd:l});if(m.response&&m.fetchData.__span&&hfe.set(m.response,m.fetchData.__span),O){const _=MQe(m.fetchData.url),b=_?pb(_).host:void 0;O.setAttributes({"http.url":_?vg(_):void 0,"server.address":b}),o&&mfe(O,e),c?.(O,{headers:m.headers})}})),r&&NQe(m=>{const O=ixt(m,d,p,f,h,l);O&&(o&&mfe(O,e),c?.(O,{headers:QQe(m.xhr.__sentry_xhr_v3__?.request_headers)}))})}const rxt=300;function mfe(e,t){const{url:n}=ss(e).data;if(!n||typeof n!="string")return;let r=()=>void setTimeout(s);if(Ef(t)){const i=e.end.bind(e);e.end=o=>{const a=o??uo();let c=!1;const l=()=>{c||(c=!0,setTimeout(s),i(a),clearTimeout(d))};r=l;const d=setTimeout(l,rxt)}}const s=SR("resource",({entries:i})=>{i.forEach(o=>{txt(o)&&o.name.endsWith(n)&&(e.setAttributes(PQe(o)),r())})})}function sxt(e,t){const n=x$();if(n){let r,s;try{r=new URL(e,n),s=new URL(n).origin}catch{return!1}const i=r.origin===s;return t?Gh(r.toString(),t)||i&&Gh(r.pathname,t):i}else{const r=!!e.match(/^\/(?!\/)/);return t?Gh(e,t):r}}function ixt(e,t,n,r,s,i){const o=e.xhr,a=o?.[SS];if(!o||o.__sentry_own_request__||!a)return;const{url:c,method:l}=a,d=Ud()&&t(c);if(e.endTimestamp){const y=o.__sentry_xhr_span_id__;if(!y)return;const x=r[y];x&&(d&&a.status_code!==void 0&&(mMe(x,a.status_code),x.end(),i?.(x,{headers:QQe(Gbt(o)),error:e.error})),delete r[y]);return}const p=MQe(c),f=pb(p||c),h=vg(Tgt(c)),m=ns(),_=!!Gc()||!!m&&Ef(m),b=d&&_?Cy({name:`${l} ${h}`,attributes:{url:vg(c),type:"xhr","http.method":l,"http.url":p?vg(p):void 0,"server.address":f?.host,[fo]:"auto.http.browser",[Kd]:"http.client",...f?.search&&{"http.query":f?.search},...f?.hash&&{"http.fragment":f?.hash}}}):new mf;return d&&!_&&m?.recordDroppedEvent("no_parent_span","span"),o.__sentry_xhr_span_id__=b.spanContext().spanId,r[o.__sentry_xhr_span_id__]=b,n(c)&&oxt(o,Ud()&&_?b:void 0,s),m&&m.emit("beforeOutgoingRequestSpan",b,e),b}function oxt(e,t,n){const{"sentry-trace":r,baggage:s,traceparent:i}=cQe({span:t,propagateTraceparent:n});r&&axt(e,r,s,i)}function axt(e,t,n,r){const s=e.__sentry_xhr_v3__?.request_headers;if(!(s?.["sentry-trace"]||!e.setRequestHeader))try{if(e.setRequestHeader("sentry-trace",t),r&&!s?.traceparent&&e.setRequestHeader("traceparent",r),n){const i=s?.baggage;(!i||!ext(i))&&e.setRequestHeader("baggage",n)}}catch{}}function lxt(){hr.document?hr.document.addEventListener("visibilitychange",()=>{const e=Gc();if(!e)return;const t=Ta(e);if(hr.document.hidden&&t){const n="cancelled",{op:r,status:s}=ss(t);Mc&&It.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),s||t.setStatus({code:vo,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):Mc&&It.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const cxt=3600,LQe="sentry_previous_trace",uxt="sentry.previous_trace";function dxt(e,{linkPreviousTrace:t,consistentTraceSampling:n}){const r=t==="session-storage";let s=r?hxt():void 0;e.on("spanStart",o=>{if(Ta(o)!==o)return;const a=Es().getPropagationContext();s=pxt(s,o,a),r&&fxt(s)});let i=!0;n&&e.on("beforeSampling",o=>{if(!s)return;const a=Es(),c=a.getPropagationContext();if(i&&c.parentSpanId){i=!1;return}a.setPropagationContext({...c,dsc:{...c.dsc,sample_rate:String(s.sampleRate),sampled:String(BH(s.spanContext))},sampleRand:s.sampleRand}),o.parentSampled=BH(s.spanContext),o.parentSampleRate=s.sampleRate,o.spanAttributes={...o.spanAttributes,[fMe]:s.sampleRate}})}function pxt(e,t,n){const r=ss(t);function s(){try{return Number(n.dsc?.sample_rate)??Number(r.data?.[Gne])}catch{return 0}}const i={spanContext:t.spanContext(),startTimestamp:r.start_timestamp,sampleRate:s(),sampleRand:n.sampleRand};if(!e)return i;const o=e.spanContext;return o.traceId===r.trace_id?e:(Date.now()/1e3-e.startTimestamp<=cxt&&(Mc&&It.log(`Adding previous_trace \`${JSON.stringify(o)}\` link to span \`${JSON.stringify({op:r.op,...t.spanContext()})}\``),t.addLink({context:o,attributes:{[nOt]:"previous_trace"}}),t.setAttribute(uxt,`${o.traceId}-${o.spanId}-${BH(o)?1:0}`)),i)}function fxt(e){try{hr.sessionStorage.setItem(LQe,JSON.stringify(e))}catch(t){Mc&&It.warn("Could not store previous trace in sessionStorage",t)}}function hxt(){try{const e=hr.sessionStorage?.getItem(LQe);return JSON.parse(e)}catch{return}}function BH(e){return e.traceFlags===1}const mxt="BrowserTracing",Oxt=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function gxt(){const e=hr.navigator;return e?.userAgent?Oxt.test(e.userAgent):!1}const _xt={...yQ,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...DQe},bxt=(e={})=>{"enableElementTiming"in e&&Ey(()=>{console.warn("[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.")});const t={name:void 0,source:void 0},n=hr.document,{enableInp:r,enableLongTask:s,enableLongAnimationFrame:i,_experiments:{enableInteractions:o,enableStandaloneClsSpans:a,enableStandaloneLcpSpans:c},beforeStartSpan:l,idleTimeout:d,finalTimeout:p,childSpanTimeout:f,markBackgroundSpan:h,traceFetch:m,traceXHR:O,trackFetchStreamPerformance:_,shouldCreateSpanForRequest:b,enableHTTPTimings:y,ignoreResourceSpans:x,ignorePerformanceApiSpans:S,instrumentPageLoad:v,instrumentNavigation:T,detectRedirects:E,linkPreviousTrace:w,consistentTraceSampling:P,enableReportPageLoaded:k,onRequestSpanStart:C,onRequestSpanEnd:M}={..._xt,...e},I=gxt();let $,R,N;function j(Q,U,A=!0){const V=U.op==="pageload",z=U.name,L=l?l(U):U,q=L.attributes||{};if(z!==L.name&&(q[jh]="custom",L.attributes=q),!A){const te=wy();Cy({...L,startTime:te}).end(te);return}t.name=L.name,t.source=q[jh];const Y=zMe(L,{idleTimeout:d,finalTimeout:p,childSpanTimeout:f,disableAutoFinish:V,beforeSpanEnd:te=>{$?.();const G=Ef(Q);hbt(te,{recordClsOnPageloadSpan:!G&&!a,recordLcpOnPageloadSpan:!G&&!c,ignoreResourceSpans:x,ignorePerformanceApiSpans:S,spanStreamingEnabled:G}),_fe(Q,void 0);const Z=Es(),oe=Z.getPropagationContext();Z.setPropagationContext({...oe,traceId:Y.spanContext().traceId,sampled:__(Y),dsc:zg(te)}),V&&(N=void 0)},trimIdleSpanEndTimestamp:!k});V&&k&&(N=Y),_fe(Q,Y);function ne(){n&&["interactive","complete"].includes(n.readyState)&&Q.emit("idleSpanEnableAutoFinish",Y)}V&&!k&&n&&(n.addEventListener("readystatechange",()=>{ne()}),ne())}return{name:mxt,setup(Q){if(I){Mc&&It.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}ROt();const U=Ef(Q);if($=abt({recordClsStandaloneSpans:U?void 0:a||!1,recordLcpStandaloneSpans:U?void 0:c||!1,client:Q}),U?($bt(Q),Abt(Q),r&&Mbt()):r&&wbt(),i&&Xr.PerformanceObserver&&PerformanceObserver.supportedEntryTypes?.includes("long-animation-frame")?cbt():s&&lbt(),o&&ubt(),E&&n){const V=()=>{R=uo()};addEventListener("click",V,{capture:!0}),addEventListener("keydown",V,{capture:!0,passive:!0})}function A(){const V=TR(Q);V&&!ss(V).timestamp&&(Mc&&It.log(`[Tracing] Finishing current active span with op: ${ss(V).op}`),V.setAttribute(gR,"cancelled"),V.end())}Q.on("startNavigationSpan",(V,z)=>{if(ns()!==Q)return;if(z?.isRedirect){Mc&&It.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),j(Q,{op:"navigation.redirect",...V},!1);return}R=void 0,A(),Lf().setPropagationContext({traceId:gm(),sampleRand:Math.random(),propagationSpanId:Ud()?void 0:Hh()});const L=Es();L.setPropagationContext({traceId:gm(),sampleRand:Math.random(),propagationSpanId:Ud()?void 0:Hh()}),L.setSDKProcessingMetadata({normalizedRequest:void 0}),j(Q,{op:"navigation",...V,parentSpan:null,forceTransaction:!0})}),Q.on("startPageLoadSpan",(V,z={})=>{if(ns()!==Q)return;A();const L=z.sentryTrace||Ofe("sentry-trace")||gfe("sentry-trace"),q=z.baggage||Ofe("baggage")||gfe("baggage"),Y=xOt(L,q),ne=Es();ne.setPropagationContext(Y),Ud()||(ne.getPropagationContext().propagationSpanId=Hh()),ne.setSDKProcessingMetadata({normalizedRequest:FD()}),j(Q,{op:"pageload",...V})}),Q.on("endPageloadSpan",()=>{k&&N&&(N.setAttribute(gR,"reportPageLoaded"),N.end())})},afterAllSetup(Q){if(I)return;let U=x$();if(w!=="off"&&dxt(Q,{linkPreviousTrace:w,consistentTraceSampling:P}),hr.location){if(v){const A=Ma();yxt(Q,{name:hr.location.pathname,startTime:A?A/1e3:void 0,attributes:{[jh]:"url",[fo]:"auto.pageload.browser"}})}T&&dre(({to:A,from:V})=>{if(V===void 0&&U?.indexOf(A)!==-1){U=void 0;return}U=void 0;const z=YMe(A),L=TR(Q),q=L&&E&&vxt(L,R);xxt(Q,{name:z?.pathname||hr.location.pathname,attributes:{[jh]:"url",[fo]:"auto.navigation.browser"}},{url:A,isRedirect:q})})}h&&lxt(),o&&Sxt(Q,d,p,f,t),r&&Pbt(),nxt(Q,{traceFetch:m,traceXHR:O,trackFetchStreamPerformance:_,tracePropagationTargets:Q.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:b,enableHTTPTimings:y,onRequestSpanStart:C,onRequestSpanEnd:M})}}};function yxt(e,t,n){e.emit("startPageLoadSpan",t,n),Es().setTransactionName(t.name);const r=TR(e);return r&&e.emit("afterStartPageLoadSpan",r),r}function xxt(e,t,n){const{url:r,isRedirect:s}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:s}),e.emit("startNavigationSpan",t,{isRedirect:s});const i=Es();return i.setTransactionName(t.name),r&&!s&&i.setSDKProcessingMetadata({normalizedRequest:{...FD(),url:r}}),TR(e)}function Ofe(e){return hr.document?.querySelector(`meta[name=${e}]`)?.getAttribute("content")||void 0}function gfe(e){return hr.performance?.getEntriesByType?.("navigation")[0]?.serverTiming?.find(r=>r.name===e)?.description}function Sxt(e,t,n,r,s){const i=hr.document;let o;const a=()=>{const c="ui.action.click",l=TR(e);if(l){const d=ss(l).op;if(["navigation","pageload"].includes(d)){Mc&&It.warn(`[Tracing] Did not create ${c} span because a pageload or navigation span is in progress.`);return}}if(o&&(o.setAttribute(gR,"interactionInterrupted"),o.end(),o=void 0),!s.name){Mc&&It.warn(`[Tracing] Did not create ${c} transaction because _latestRouteName is missing.`);return}o=zMe({name:s.name,op:c,attributes:{[jh]:s.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})};i&&addEventListener("click",a,{capture:!0})}const jQe="_sentry_idleSpan";function TR(e){return e[jQe]}function _fe(e,t){sc(e,jQe,t)}const bfe=1.5;function vxt(e,t){const n=ss(e),r=wy(),s=n.start_timestamp;return!(r-s>bfe||t&&r-t<=bfe)}function Txt(e){const t={...e};return lQe(t,"react"),Igt("react",{version:g.version}),Jyt(t)}const Ext="hermit@1.6.7",wxt="production",kxt=.1;function Cxt(e){return e.length>0&&e.startsWith("https://")}let XQe=!0,ER=!1;function UQe(e){XQe=e}function Rxt(){if(ER)return;const e="";if(!Cxt(e))return;Txt({...{dsn:e,release:Ext,environment:wxt,tracesSampleRate:kxt,sendDefaultPii:!1},beforeSend:r=>XQe?r:null,integrations:[bxt()]}),ER=!0}function Pxt(){return ER}function $xt(e,t){ER&&Bg({category:"navigation",message:`Tab: ${e} → ${t}`,level:"info"})}function Nxt(e,t){ER&&mU(n=>{t&&n.setContext("react",t),qMe(e)})}function bE(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function Axt(e,t){let n;const r=()=>{if(n)return n;const s=indexedDB.open(e);return s.onupgradeneeded=()=>s.result.createObjectStore(t),n=bE(s),n.then(i=>{i.onclose=()=>n=void 0},()=>{}),n};return(s,i)=>r().then(o=>i(o.transaction(t,s).objectStore(t)))}let Y4;function TU(){return Y4||(Y4=Axt("keyval-store","keyval")),Y4}function zd(e,t=TU()){return t("readonly",n=>bE(n.get(e)))}function Ry(e,t,n=TU()){return n("readwrite",r=>(r.put(t,e),bE(r.transaction)))}function Za(e,t=TU()){return t("readwrite",n=>(n.delete(e),bE(n.transaction)))}function Ixt(e,t){return e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},bE(e.transaction)}function zQe(e=TU()){return e("readonly",t=>{if(t.getAllKeys)return bE(t.getAllKeys());const n=[];return Ixt(t,r=>n.push(r.key)).then(()=>n)})}const pre="comment-read-state-v2",BQe="comment-read-state-v2",Mxt="comment-read-state",Qxt="comment-read-state",Dxt=300,Lxt=30*24*60*60*1e3;function jxt(){try{const e=localStorage.getItem(BQe);if(!e)return null;const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?null:t}catch{return null}}function FQe(e){try{localStorage.setItem(BQe,JSON.stringify(e))}catch{}}function Xxt(){try{const e=localStorage.getItem(Qxt);if(!e)return null;const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return null;const n=Object.entries(t);return n.length>0&&typeof n[0][1]=="number"?t:null}catch{return null}}function YQe(e){const t={};for(const[n,r]of Object.entries(e))typeof r=="number"&&r>0&&(t[n]={readIds:[],lastUpdated:r});return t}let sa={};const V4=jxt();if(V4&&Object.keys(V4).length>0)sa=V4;else{const e=Xxt();e&&Object.keys(e).length>0&&(sa=YQe(e))}let FH=Object.keys(sa).length>0,Gv=!0,NA=null;const YH=new Set;function VQe(e){return YH.add(e),FH||Yxt(),()=>{YH.delete(e)}}function qQe(){return sa}function Uxt(e,t,n){if(n.length===0)return;const r=`${e}/${t}`,s=sa[r],i=new Set(s?.readIds??[]);let o=!1;for(const a of n)i.has(a)||(i.add(a),o=!0);o&&(sa={...sa,[r]:{readIds:Array.from(i),lastUpdated:Date.now()}},HD(),Fxt())}function WQe(e,t,n,r){if(!r||r.length===0)return 0;const s=`${t}/${n}`,i=e[s];if(!i)return r.length;const o=new Set(i.readIds),a=o.size===0?i.lastUpdated:0;let c=0;for(const l of r)l.id&&o.has(l.id)||a>0&&new Date(l.createdAt).getTime()<=a||c++;return c}function zxt(e,t){const n=`${e}/${t}`,r=sa[n];return new Set(r?.readIds??[])}function Bxt(e,t){const n=`${e}/${t}`,r=sa[n];return!r||r.readIds.length>0?0:r.lastUpdated}function fre(){return typeof indexedDB<"u"}function HD(){YH.forEach(e=>e())}function Fxt(){NA&&clearTimeout(NA),NA=setTimeout(()=>{NA=null,Vxt()},Dxt)}async function Yxt(){if(!FH){if(fre()&&Gv)try{const e=await zd(pre);if(e&&typeof e=="object"){const t={...sa};for(const[n,r]of Object.entries(e)){if(!r||typeof r!="object")continue;const s=r,i=t[n];if(!i)t[n]=s;else{const o=new Set([...i.readIds,...s.readIds]);t[n]={readIds:Array.from(o),lastUpdated:Math.max(i.lastUpdated,s.lastUpdated)}}}sa=t,HD()}else{const t=await zd(Mxt);if(t&&typeof t=="object"){const n=YQe(t),r={...sa};for(const[s,i]of Object.entries(n))r[s]?r[s]={readIds:[...new Set([...r[s].readIds,...i.readIds])],lastUpdated:Math.max(r[s].lastUpdated,i.lastUpdated)}:r[s]=i;sa=r,HD()}}}catch{Gv=!1}FH=!0}}async function Vxt(){if(FQe(sa),Gv&&fre())try{await Ry(pre,sa)}catch{Gv=!1}}async function qxt(){const e=Date.now();let t=!1;const n={};for(const[r,s]of Object.entries(sa))e-s.lastUpdated<Lxt?n[r]=s:t=!0;if(t&&(sa=n,HD(),FQe(n),Gv&&fre()))try{await Ry(pre,n)}catch{Gv=!1}}function fr(e){let t=e.replace(/\\/g,"/");if(t!=="/"&&!/^[A-Za-z]:\/$/.test(t))for(;t.endsWith("/");)t=t.slice(0,-1);return t.toLowerCase()}function hre(e,t){return t==="pending"?{...e,pending:e.pending+1}:t==="in_progress"?{...e,inProgress:e.inProgress+1}:t==="completed"?{...e,completed:e.completed+1}:e}function Wxt(e){const t=new Map;for(const n of e){if(!n.projectPath)continue;const r=fr(n.projectPath),s=t.get(r)??{pending:0,inProgress:0,completed:0};t.set(r,hre(s,n.status))}return t}function Gxt(e){const t=new Map;for(const n of e){const r=n.teamName,s=t.get(r)??{pending:0,inProgress:0,completed:0};t.set(r,hre(s,n.status))}return t}function Hxt(e){const t=new Map;for(const n of e){const r=n.owner?.trim();if(!r||n.status==="deleted")continue;const s=r.toLowerCase(),i=t.get(s)??{pending:0,inProgress:0,completed:0};t.set(s,hre(i,n.status))}return t}function Yg({multimodelEnabled:e,bootstrapCliStatus:t,fetchCliStatus:n}){return e?t({multimodelEnabled:!0}):n()}const Zxt=2*60*1e3;function Kxt(e){if(!e)return;const t=[];if(typeof e.createdAt=="string"&&e.createdAt.length>0&&t.push(e.createdAt),Array.isArray(e.workIntervals))for(const o of e.workIntervals)typeof o?.startedAt=="string"&&o.startedAt.length>0&&t.push(o.startedAt);if(Array.isArray(e.historyEvents))for(const o of e.historyEvents)typeof o?.timestamp=="string"&&o.timestamp.length>0&&t.push(o.timestamp);if(t.length===0)return;const[n,...r]=t,s=r.reduce((o,a)=>o<a?o:a,n),i=new Date(s);return i.setTime(i.getTime()-Zxt),i.toISOString()}function Jxt(e){return Array.isArray(e.historyEvents)?e.historyEvents:[]}function eSt(e){const t=Jxt(e);for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.type==="review_requested"||r.type==="review_changes_requested"||r.type==="review_approved"||r.type==="review_started")return r.to;if(r.type==="status_changed"&&(r.to==="in_progress"||r.to==="deleted"))return"none";if(r.type==="status_changed"&&r.to==="pending"){for(let s=n-1;s>=0;s--){const i=t[s];if(i.type==="review_requested"||i.type==="review_changes_requested"||i.type==="review_approved"||i.type==="review_started")return i.to==="needsFix"?"needsFix":"none";if(i.type==="task_created"||i.type==="status_changed"&&(i.to==="in_progress"||i.to==="pending"||i.to==="deleted"))return"none"}return"none"}}return null}function tSt(e){return e==="review"||e==="needsFix"||e==="approved"?e:"none"}function GQe(e){if(Array.isArray(e.historyEvents)&&e.historyEvents.length>0){const s=eSt({historyEvents:e.historyEvents});if(s)return s}const t=typeof e.status=="string"?e.status:null,n=s=>{const i=tSt(s);return i==="none"?null:t==="in_progress"||t==="deleted"?"none":t==="pending"?i==="needsFix"?"needsFix":"none":t==="completed"?i==="review"||i==="approved"?i:"none":i},r=n(e.reviewState);return r||(e.kanbanColumn==="review"||e.kanbanColumn==="approved"?n(e.kanbanColumn)??"none":"none")}function nSt(e){return e==="review"||e==="approved"?e:void 0}function Vg(e){return nSt(GQe(e))}function rSt(e){return GQe(e)}function mre(e){const t=rSt(e);return t==="approved"?"approved":t==="review"?"review":e.status==="completed"?"completed":"active"}function sSt(e){const t=typeof e=="string"?e:mre(e);return t==="completed"||t==="approved"}function iSt(e){return typeof e=="string"?e!=="active":mre(e)!=="active"?!0:e.status==="in_progress"}function HQe(e){return Kxt(e)}function Fc(e,t){return{...{owner:e.owner,status:e.status,intervals:e.workIntervals,since:HQe(e),stateBucket:mre(e)},...t}}function ZQe(e){const t=typeof e.owner=="string"?e.owner.trim():"",n=typeof e.status=="string"?e.status.trim():"",r=typeof e.since=="string"?e.since:"",s=typeof e.stateBucket=="string"?e.stateBucket:"active",i=Array.isArray(e.intervals)?e.intervals.map(o=>({startedAt:o.startedAt,completedAt:o.completedAt??""})):[];return JSON.stringify({owner:t,status:n,since:r,stateBucket:s,intervals:i})}function Ed(e,t,n){return`${e}:${t}:${ZQe(n)}`}function KQe(e){switch(e?.stateBucket){case"approved":case"review":case"completed":return e.stateBucket;default:return"active"}}function q4(e){return sSt(KQe(e))}function Ore(e){return KQe(e)!=="active"?!0:e?.status==="in_progress"}class wO{constructor(t){this.namespace=t}static level=3;debug(...t){wO.level<=0&&console.debug(`[${this.namespace}]`,...t)}info(...t){wO.level<=1&&console.log(`[${this.namespace}]`,...t)}warn(...t){wO.level<=2&&console.warn(`[${this.namespace}]`,...t)}error(...t){wO.level<=3&&console.error(`[${this.namespace}]`,...t)}static setLevel(t){wO.level=t}static getLevel(){return wO.level}}function Hi(e){return new wO(e)}const oSt={},yfe=e=>{let t;const n=new Set,r=(d,p)=>{const f=typeof d=="function"?d(t):d;if(!Object.is(f,t)){const h=t;t=p??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(m=>m(t,h))}},s=()=>t,c={setState:r,getState:s,getInitialState:()=>l,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(oSt?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},l=t=e(r,s,c);return c},aSt=e=>e?yfe(e):yfe;var JQe={exports:{}},e2e={},t2e={exports:{}},n2e={};/**
965
+ `).reduce((n,r)=>{const[s,i]=r.split(": ");return i&&(n[s.toLowerCase()]=i),n},{}):{}}const Hbt=40;function Zbt(e,t=Ybt("fetch")){let n=0,r=0;async function s(i){const o=i.body.length;n+=o,r++;const a={body:i.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{const c=await t(e.url,a);return{statusCode:c.status,headers:{"x-sentry-rate-limits":c.headers.get("X-Sentry-Rate-Limits"),"retry-after":c.headers.get("Retry-After")}}}catch(c){throw Vbt("fetch"),c}finally{n-=o,r--}}return a_t(e,s,tre(e.bufferSize||Hbt))}const Mc=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Kbt=30,Jbt=50;function zH(e,t,n,r){const s={filename:e,function:t==="<anonymous>"?Ab:t,in_app:!0};return n!==void 0&&(s.lineno=n),r!==void 0&&(s.colno=r),s}const eyt=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,tyt=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,nyt=/\((\S*)(?::(\d+))(?::(\d+))\)/,ryt=/at (.+?) ?\(data:(.+?),/,syt=e=>{const t=e.match(ryt);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=eyt.exec(e);if(n){const[,s,i,o]=n;return zH(s,Ab,+i,+o)}const r=tyt.exec(e);if(r){if(r[2]?.indexOf("eval")===0){const a=nyt.exec(r[2]);a&&(r[2]=a[1],r[3]=a[2],r[4]=a[3])}const[i,o]=AQe(r[1]||Ab,r[2]);return zH(o,i,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},iyt=[Kbt,syt],oyt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ayt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,lyt=e=>{const t=oyt.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const i=ayt.exec(t[3]);i&&(t[1]=t[1]||"eval",t[3]=i[1],t[4]=i[2],t[5]="")}let r=t[3],s=t[1]||Ab;return[s,r]=AQe(s,r),zH(r,s,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},cyt=[Jbt,lyt],uyt=[iyt,cyt],dyt=eMe(...uyt),AQe=(e,t)=>{const n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:Ab,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},$A=1024,pyt="Breadcrumbs",fyt=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:pyt,setup(n){t.console&&j_t(gyt(n)),t.dom&&Lbt(Oyt(n,t.dom)),t.xhr&&NQe(_yt(n)),t.fetch&&hQe(byt(n)),t.history&&dre(yyt(n)),t.sentry&&n.on("beforeSendEvent",myt(n))}}},hyt=fyt;function myt(e){return function(n){ns()===e&&Bg({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:y0(n)},{event:n})}}function Oyt(e,t){return function(r){if(ns()!==e)return;let s,i,o=typeof t=="object"?t.serializeAttribute:void 0,a=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;a&&a>$A&&(Mc&&It.warn(`\`dom.maxStringLength\` cannot exceed ${$A}, but a value of ${a} was configured. Sentry will use ${$A} instead.`),a=$A),typeof o=="string"&&(o=[o]);try{const l=r.event,d=xyt(l)?l.target:l;s=da(d,{keyAttrs:o,maxStringLength:a}),i=aMe(d)}catch{s="<unknown>"}if(s.length===0)return;const c={category:`ui.${r.name}`,message:s};i&&(c.data={"ui.component_name":i}),Bg(c,{event:r.event,name:r.name,global:r.global})}}function gyt(e){return function(n){if(ns()!==e)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:U_t(n.level),message:_pe(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${_pe(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;Bg(r,{input:n.args,level:n.level})}}function _yt(e){return function(n){if(ns()!==e)return;const{startTimestamp:r,endTimestamp:s}=n,i=n.xhr[SS];if(!r||!s||!i)return;const{method:o,url:a,status_code:c,body:l}=i,d={method:o,url:a,status_code:c},p={xhr:n.xhr,input:l,startTimestamp:r,endTimestamp:s},f={category:"xhr",data:d,type:"http",level:fQe(c)};e.emit("beforeOutgoingRequestBreadcrumb",f,p),Bg(f,p)}}function byt(e){return function(n){if(ns()!==e)return;const{startTimestamp:r,endTimestamp:s}=n;if(s&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){const i={data:n.error,input:n.args,startTimestamp:r,endTimestamp:s},o={category:"fetch",data:n.fetchData,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",o,i),Bg(o,i)}else{const i=n.response,o={...n.fetchData,status_code:i?.status},a={input:n.args,response:i,startTimestamp:r,endTimestamp:s},c={category:"fetch",data:o,type:"http",level:fQe(o.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",c,a),Bg(c,a)}}}function yyt(e){return function(n){if(ns()!==e)return;let r=n.from,s=n.to;const i=pb(hr.location.href);let o=r?pb(r):void 0;const a=pb(s);o?.path||(o=i),i.protocol===a.protocol&&i.host===a.host&&(s=a.relative),i.protocol===o.protocol&&i.host===o.host&&(r=o.relative),Bg({category:"navigation",data:{from:r,to:s}})}}function xyt(e){return!!e&&!!e.target}const Syt="EventTarget,Window,Node,ApplicationCache,AudioTrackList,BroadcastChannel,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(","),vyt="BrowserApiErrors",Tyt=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:vyt,setupOnce(){t.setTimeout&&Cc(hr,"setTimeout",dfe),t.setInterval&&Cc(hr,"setInterval",dfe),t.requestAnimationFrame&&Cc(hr,"requestAnimationFrame",wyt),t.XMLHttpRequest&&"XMLHttpRequest"in hr&&Cc(XMLHttpRequest.prototype,"send",kyt);const n=t.eventTarget;n&&(Array.isArray(n)?n:Syt).forEach(s=>Cyt(s,t))}}},Eyt=Tyt;function dfe(e){return function(...t){const n=t[0];return t[0]=Wv(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${mm(e)}`}}),e.apply(this,t)}}function wyt(e){return function(t){return e.apply(this,[Wv(t,{mechanism:{data:{handler:mm(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function kyt(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(s=>{s in n&&typeof n[s]=="function"&&Cc(n,s,function(i){const o={mechanism:{data:{handler:mm(i)},handled:!1,type:`auto.browser.browserapierrors.xhr.${s}`}},a=Wne(i);return a&&(o.mechanism.data.handler=mm(a)),Wv(i,o)})}),e.apply(this,t)}}function Cyt(e,t){const r=hr[e]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(Cc(r,"addEventListener",function(s){return function(i,o,a){try{Ryt(o)&&(o.handleEvent=Wv(o.handleEvent,{mechanism:{data:{handler:mm(o),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&Pyt(this,i,o),s.apply(this,[i,Wv(o,{mechanism:{data:{handler:mm(o),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),a])}}),Cc(r,"removeEventListener",function(s){return function(i,o,a){try{const c=o.__sentry_wrapped__;c&&s.call(this,i,c,a)}catch{}return s.call(this,i,o,a)}}))}function Ryt(e){return typeof e.handleEvent=="function"}function Pyt(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}const $yt=(e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof hr.document>"u"){Mc&&It.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}zpe({ignoreDuration:!0}),Q4();const n=Lf();let r=n.getUser();n.addScopeListener(s=>{const i=s.getUser();(r?.id!==i?.id||r?.ip_address!==i?.ip_address)&&(Q4(),r=i)}),t==="route"&&dre(({from:s,to:i})=>{s!==i&&(zpe({ignoreDuration:!0}),Q4())})}}},Nyt="CultureContext",Ayt=()=>({name:Nyt,preprocessEvent(e){const t=pfe();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})},processSegmentSpan(e){const t=pfe();t&&VMe(e,{"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar})}}),Iyt=Ayt;function pfe(){try{const e=hr.Intl;if(!e)return;const t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}const Myt="GlobalHandlers",Qyt=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:Myt,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(Lyt(n),ffe("onerror")),t.onunhandledrejection&&(jyt(n),ffe("onunhandledrejection"))}}},Dyt=Qyt;function Lyt(e){nMe(t=>{const{stackParser:n,attachStacktrace:r}=IQe();if(ns()!==e||OQe())return;const{msg:s,url:i,line:o,column:a,error:c}=t,l=zyt(sre(n,c||s,void 0,r,!1),i,o,a);l.level="error",WMe(l,{originalException:c,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function jyt(e){rMe(t=>{const{stackParser:n,attachStacktrace:r}=IQe();if(ns()!==e||OQe())return;const s=Xyt(t),i=Fv(s)?Uyt(s):sre(n,s,void 0,r,!0);i.level="error",WMe(i,{originalException:s,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function Xyt(e){if(Fv(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}function Uyt(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function zyt(e,t,n,r){const s=e.exception=e.exception||{},i=s.values=s.values||[],o=i[0]=i[0]||{},a=o.stacktrace=o.stacktrace||{},c=a.frames=a.frames||[];return c.length===0&&c.push({colno:r,lineno:n,filename:Byt(t)??x$(),function:Ab,in_app:!0}),e}function ffe(e){Mc&&It.log(`Global Handler attached: ${e}`)}function IQe(){return ns()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function Byt(e){if(!(!Wh(e)||e.length===0))return e.startsWith("data:")?`<${vg(e,!1)}>`:e}const Fyt=()=>({name:"HttpContext",preprocessEvent(e){if(!hr.navigator&&!hr.location&&!hr.document)return;const t=FD(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}},processSegmentSpan(e){if(!hr.navigator&&!hr.location&&!hr.document)return;const t=FD();VMe(e,{"url.full":t.url||void 0,"http.request.header.user_agent":t.headers["User-Agent"],"http.request.header.referer":t.headers.Referer})}}),Yyt="cause",Vyt=5,qyt="LinkedErrors",Wyt=(e={})=>{const t=e.limit||Vyt,n=e.key||Yyt;return{name:qyt,preprocessEvent(r,s,i){const o=i.getOptions();D_t(nre,o.stackParser,n,t,r,s)}}},Gyt=Wyt;function Hyt(){return Zyt()?(Mc&&Ey(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0):!1}function Zyt(){if(typeof hr.window>"u")return!1;const e=hr;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;const n=x$();return!(hr===hr.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}function Kyt(e){return[R_t(),E_t(),H_t(),Eyt(),hyt(),Dyt(),Gyt(),F_t(),Fyt(),Iyt(),$yt()]}function Jyt(e={}){const t=!e.skipBrowserExtensionCheck&&Hyt();let n=e.defaultIntegrations==null?Kyt():e.defaultIntegrations;const r={...e,enabled:t?!1:e.enabled,stackParser:vmt(e.stackParser||dyt),integrations:zgt({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||Zbt};return g_t(T0t,r)}function ext(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function MQe(e){try{return new URL(e,hr.location.origin).href}catch{return}}function txt(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function QQe(e){try{return new Headers(e)}catch{return}}const hfe=new WeakMap,F4=new Map,DQe={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function nxt(e,t){const{traceFetch:n,traceXHR:r,trackFetchStreamPerformance:s,shouldCreateSpanForRequest:i,enableHTTPTimings:o,tracePropagationTargets:a,onRequestSpanStart:c,onRequestSpanEnd:l}={...DQe,...t},d=typeof i=="function"?i:m=>!0,p=m=>sxt(m,a),f={},h=e.getOptions().propagateTraceparent;n&&(e.addEventProcessor(m=>(m.type==="transaction"&&m.spans&&m.spans.forEach(O=>{if(O.op==="http.client"){const _=F4.get(O.span_id);_&&(O.timestamp=_/1e3,F4.delete(O.span_id))}}),m)),s&&a0t(m=>{if(m.response){const O=hfe.get(m.response);O&&m.endTimestamp&&F4.set(O,m.endTimestamp)}}),hQe(m=>{const O=Z_t(m,d,p,f,{propagateTraceparent:h,onRequestSpanEnd:l});if(m.response&&m.fetchData.__span&&hfe.set(m.response,m.fetchData.__span),O){const _=MQe(m.fetchData.url),b=_?pb(_).host:void 0;O.setAttributes({"http.url":_?vg(_):void 0,"server.address":b}),o&&mfe(O,e),c?.(O,{headers:m.headers})}})),r&&NQe(m=>{const O=ixt(m,d,p,f,h,l);O&&(o&&mfe(O,e),c?.(O,{headers:QQe(m.xhr.__sentry_xhr_v3__?.request_headers)}))})}const rxt=300;function mfe(e,t){const{url:n}=ss(e).data;if(!n||typeof n!="string")return;let r=()=>void setTimeout(s);if(Ef(t)){const i=e.end.bind(e);e.end=o=>{const a=o??uo();let c=!1;const l=()=>{c||(c=!0,setTimeout(s),i(a),clearTimeout(d))};r=l;const d=setTimeout(l,rxt)}}const s=SR("resource",({entries:i})=>{i.forEach(o=>{txt(o)&&o.name.endsWith(n)&&(e.setAttributes(PQe(o)),r())})})}function sxt(e,t){const n=x$();if(n){let r,s;try{r=new URL(e,n),s=new URL(n).origin}catch{return!1}const i=r.origin===s;return t?Gh(r.toString(),t)||i&&Gh(r.pathname,t):i}else{const r=!!e.match(/^\/(?!\/)/);return t?Gh(e,t):r}}function ixt(e,t,n,r,s,i){const o=e.xhr,a=o?.[SS];if(!o||o.__sentry_own_request__||!a)return;const{url:c,method:l}=a,d=Ud()&&t(c);if(e.endTimestamp){const y=o.__sentry_xhr_span_id__;if(!y)return;const x=r[y];x&&(d&&a.status_code!==void 0&&(mMe(x,a.status_code),x.end(),i?.(x,{headers:QQe(Gbt(o)),error:e.error})),delete r[y]);return}const p=MQe(c),f=pb(p||c),h=vg(Tgt(c)),m=ns(),_=!!Gc()||!!m&&Ef(m),b=d&&_?Cy({name:`${l} ${h}`,attributes:{url:vg(c),type:"xhr","http.method":l,"http.url":p?vg(p):void 0,"server.address":f?.host,[fo]:"auto.http.browser",[Kd]:"http.client",...f?.search&&{"http.query":f?.search},...f?.hash&&{"http.fragment":f?.hash}}}):new mf;return d&&!_&&m?.recordDroppedEvent("no_parent_span","span"),o.__sentry_xhr_span_id__=b.spanContext().spanId,r[o.__sentry_xhr_span_id__]=b,n(c)&&oxt(o,Ud()&&_?b:void 0,s),m&&m.emit("beforeOutgoingRequestSpan",b,e),b}function oxt(e,t,n){const{"sentry-trace":r,baggage:s,traceparent:i}=cQe({span:t,propagateTraceparent:n});r&&axt(e,r,s,i)}function axt(e,t,n,r){const s=e.__sentry_xhr_v3__?.request_headers;if(!(s?.["sentry-trace"]||!e.setRequestHeader))try{if(e.setRequestHeader("sentry-trace",t),r&&!s?.traceparent&&e.setRequestHeader("traceparent",r),n){const i=s?.baggage;(!i||!ext(i))&&e.setRequestHeader("baggage",n)}}catch{}}function lxt(){hr.document?hr.document.addEventListener("visibilitychange",()=>{const e=Gc();if(!e)return;const t=Ta(e);if(hr.document.hidden&&t){const n="cancelled",{op:r,status:s}=ss(t);Mc&&It.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),s||t.setStatus({code:vo,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):Mc&&It.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const cxt=3600,LQe="sentry_previous_trace",uxt="sentry.previous_trace";function dxt(e,{linkPreviousTrace:t,consistentTraceSampling:n}){const r=t==="session-storage";let s=r?hxt():void 0;e.on("spanStart",o=>{if(Ta(o)!==o)return;const a=Es().getPropagationContext();s=pxt(s,o,a),r&&fxt(s)});let i=!0;n&&e.on("beforeSampling",o=>{if(!s)return;const a=Es(),c=a.getPropagationContext();if(i&&c.parentSpanId){i=!1;return}a.setPropagationContext({...c,dsc:{...c.dsc,sample_rate:String(s.sampleRate),sampled:String(BH(s.spanContext))},sampleRand:s.sampleRand}),o.parentSampled=BH(s.spanContext),o.parentSampleRate=s.sampleRate,o.spanAttributes={...o.spanAttributes,[fMe]:s.sampleRate}})}function pxt(e,t,n){const r=ss(t);function s(){try{return Number(n.dsc?.sample_rate)??Number(r.data?.[Gne])}catch{return 0}}const i={spanContext:t.spanContext(),startTimestamp:r.start_timestamp,sampleRate:s(),sampleRand:n.sampleRand};if(!e)return i;const o=e.spanContext;return o.traceId===r.trace_id?e:(Date.now()/1e3-e.startTimestamp<=cxt&&(Mc&&It.log(`Adding previous_trace \`${JSON.stringify(o)}\` link to span \`${JSON.stringify({op:r.op,...t.spanContext()})}\``),t.addLink({context:o,attributes:{[nOt]:"previous_trace"}}),t.setAttribute(uxt,`${o.traceId}-${o.spanId}-${BH(o)?1:0}`)),i)}function fxt(e){try{hr.sessionStorage.setItem(LQe,JSON.stringify(e))}catch(t){Mc&&It.warn("Could not store previous trace in sessionStorage",t)}}function hxt(){try{const e=hr.sessionStorage?.getItem(LQe);return JSON.parse(e)}catch{return}}function BH(e){return e.traceFlags===1}const mxt="BrowserTracing",Oxt=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function gxt(){const e=hr.navigator;return e?.userAgent?Oxt.test(e.userAgent):!1}const _xt={...yQ,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...DQe},bxt=(e={})=>{"enableElementTiming"in e&&Ey(()=>{console.warn("[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.")});const t={name:void 0,source:void 0},n=hr.document,{enableInp:r,enableLongTask:s,enableLongAnimationFrame:i,_experiments:{enableInteractions:o,enableStandaloneClsSpans:a,enableStandaloneLcpSpans:c},beforeStartSpan:l,idleTimeout:d,finalTimeout:p,childSpanTimeout:f,markBackgroundSpan:h,traceFetch:m,traceXHR:O,trackFetchStreamPerformance:_,shouldCreateSpanForRequest:b,enableHTTPTimings:y,ignoreResourceSpans:x,ignorePerformanceApiSpans:S,instrumentPageLoad:v,instrumentNavigation:T,detectRedirects:E,linkPreviousTrace:w,consistentTraceSampling:P,enableReportPageLoaded:k,onRequestSpanStart:C,onRequestSpanEnd:M}={..._xt,...e},I=gxt();let $,R,N;function j(Q,U,A=!0){const V=U.op==="pageload",z=U.name,L=l?l(U):U,q=L.attributes||{};if(z!==L.name&&(q[jh]="custom",L.attributes=q),!A){const te=wy();Cy({...L,startTime:te}).end(te);return}t.name=L.name,t.source=q[jh];const Y=zMe(L,{idleTimeout:d,finalTimeout:p,childSpanTimeout:f,disableAutoFinish:V,beforeSpanEnd:te=>{$?.();const G=Ef(Q);hbt(te,{recordClsOnPageloadSpan:!G&&!a,recordLcpOnPageloadSpan:!G&&!c,ignoreResourceSpans:x,ignorePerformanceApiSpans:S,spanStreamingEnabled:G}),_fe(Q,void 0);const Z=Es(),oe=Z.getPropagationContext();Z.setPropagationContext({...oe,traceId:Y.spanContext().traceId,sampled:__(Y),dsc:zg(te)}),V&&(N=void 0)},trimIdleSpanEndTimestamp:!k});V&&k&&(N=Y),_fe(Q,Y);function ne(){n&&["interactive","complete"].includes(n.readyState)&&Q.emit("idleSpanEnableAutoFinish",Y)}V&&!k&&n&&(n.addEventListener("readystatechange",()=>{ne()}),ne())}return{name:mxt,setup(Q){if(I){Mc&&It.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}ROt();const U=Ef(Q);if($=abt({recordClsStandaloneSpans:U?void 0:a||!1,recordLcpStandaloneSpans:U?void 0:c||!1,client:Q}),U?($bt(Q),Abt(Q),r&&Mbt()):r&&wbt(),i&&Xr.PerformanceObserver&&PerformanceObserver.supportedEntryTypes?.includes("long-animation-frame")?cbt():s&&lbt(),o&&ubt(),E&&n){const V=()=>{R=uo()};addEventListener("click",V,{capture:!0}),addEventListener("keydown",V,{capture:!0,passive:!0})}function A(){const V=TR(Q);V&&!ss(V).timestamp&&(Mc&&It.log(`[Tracing] Finishing current active span with op: ${ss(V).op}`),V.setAttribute(gR,"cancelled"),V.end())}Q.on("startNavigationSpan",(V,z)=>{if(ns()!==Q)return;if(z?.isRedirect){Mc&&It.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),j(Q,{op:"navigation.redirect",...V},!1);return}R=void 0,A(),Lf().setPropagationContext({traceId:gm(),sampleRand:Math.random(),propagationSpanId:Ud()?void 0:Hh()});const L=Es();L.setPropagationContext({traceId:gm(),sampleRand:Math.random(),propagationSpanId:Ud()?void 0:Hh()}),L.setSDKProcessingMetadata({normalizedRequest:void 0}),j(Q,{op:"navigation",...V,parentSpan:null,forceTransaction:!0})}),Q.on("startPageLoadSpan",(V,z={})=>{if(ns()!==Q)return;A();const L=z.sentryTrace||Ofe("sentry-trace")||gfe("sentry-trace"),q=z.baggage||Ofe("baggage")||gfe("baggage"),Y=xOt(L,q),ne=Es();ne.setPropagationContext(Y),Ud()||(ne.getPropagationContext().propagationSpanId=Hh()),ne.setSDKProcessingMetadata({normalizedRequest:FD()}),j(Q,{op:"pageload",...V})}),Q.on("endPageloadSpan",()=>{k&&N&&(N.setAttribute(gR,"reportPageLoaded"),N.end())})},afterAllSetup(Q){if(I)return;let U=x$();if(w!=="off"&&dxt(Q,{linkPreviousTrace:w,consistentTraceSampling:P}),hr.location){if(v){const A=Ma();yxt(Q,{name:hr.location.pathname,startTime:A?A/1e3:void 0,attributes:{[jh]:"url",[fo]:"auto.pageload.browser"}})}T&&dre(({to:A,from:V})=>{if(V===void 0&&U?.indexOf(A)!==-1){U=void 0;return}U=void 0;const z=YMe(A),L=TR(Q),q=L&&E&&vxt(L,R);xxt(Q,{name:z?.pathname||hr.location.pathname,attributes:{[jh]:"url",[fo]:"auto.navigation.browser"}},{url:A,isRedirect:q})})}h&&lxt(),o&&Sxt(Q,d,p,f,t),r&&Pbt(),nxt(Q,{traceFetch:m,traceXHR:O,trackFetchStreamPerformance:_,tracePropagationTargets:Q.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:b,enableHTTPTimings:y,onRequestSpanStart:C,onRequestSpanEnd:M})}}};function yxt(e,t,n){e.emit("startPageLoadSpan",t,n),Es().setTransactionName(t.name);const r=TR(e);return r&&e.emit("afterStartPageLoadSpan",r),r}function xxt(e,t,n){const{url:r,isRedirect:s}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:s}),e.emit("startNavigationSpan",t,{isRedirect:s});const i=Es();return i.setTransactionName(t.name),r&&!s&&i.setSDKProcessingMetadata({normalizedRequest:{...FD(),url:r}}),TR(e)}function Ofe(e){return hr.document?.querySelector(`meta[name=${e}]`)?.getAttribute("content")||void 0}function gfe(e){return hr.performance?.getEntriesByType?.("navigation")[0]?.serverTiming?.find(r=>r.name===e)?.description}function Sxt(e,t,n,r,s){const i=hr.document;let o;const a=()=>{const c="ui.action.click",l=TR(e);if(l){const d=ss(l).op;if(["navigation","pageload"].includes(d)){Mc&&It.warn(`[Tracing] Did not create ${c} span because a pageload or navigation span is in progress.`);return}}if(o&&(o.setAttribute(gR,"interactionInterrupted"),o.end(),o=void 0),!s.name){Mc&&It.warn(`[Tracing] Did not create ${c} transaction because _latestRouteName is missing.`);return}o=zMe({name:s.name,op:c,attributes:{[jh]:s.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})};i&&addEventListener("click",a,{capture:!0})}const jQe="_sentry_idleSpan";function TR(e){return e[jQe]}function _fe(e,t){sc(e,jQe,t)}const bfe=1.5;function vxt(e,t){const n=ss(e),r=wy(),s=n.start_timestamp;return!(r-s>bfe||t&&r-t<=bfe)}function Txt(e){const t={...e};return lQe(t,"react"),Igt("react",{version:g.version}),Jyt(t)}const Ext="hermit@1.6.9",wxt="production",kxt=.1;function Cxt(e){return e.length>0&&e.startsWith("https://")}let XQe=!0,ER=!1;function UQe(e){XQe=e}function Rxt(){if(ER)return;const e="";if(!Cxt(e))return;Txt({...{dsn:e,release:Ext,environment:wxt,tracesSampleRate:kxt,sendDefaultPii:!1},beforeSend:r=>XQe?r:null,integrations:[bxt()]}),ER=!0}function Pxt(){return ER}function $xt(e,t){ER&&Bg({category:"navigation",message:`Tab: ${e} → ${t}`,level:"info"})}function Nxt(e,t){ER&&mU(n=>{t&&n.setContext("react",t),qMe(e)})}function bE(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function Axt(e,t){let n;const r=()=>{if(n)return n;const s=indexedDB.open(e);return s.onupgradeneeded=()=>s.result.createObjectStore(t),n=bE(s),n.then(i=>{i.onclose=()=>n=void 0},()=>{}),n};return(s,i)=>r().then(o=>i(o.transaction(t,s).objectStore(t)))}let Y4;function TU(){return Y4||(Y4=Axt("keyval-store","keyval")),Y4}function zd(e,t=TU()){return t("readonly",n=>bE(n.get(e)))}function Ry(e,t,n=TU()){return n("readwrite",r=>(r.put(t,e),bE(r.transaction)))}function Za(e,t=TU()){return t("readwrite",n=>(n.delete(e),bE(n.transaction)))}function Ixt(e,t){return e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},bE(e.transaction)}function zQe(e=TU()){return e("readonly",t=>{if(t.getAllKeys)return bE(t.getAllKeys());const n=[];return Ixt(t,r=>n.push(r.key)).then(()=>n)})}const pre="comment-read-state-v2",BQe="comment-read-state-v2",Mxt="comment-read-state",Qxt="comment-read-state",Dxt=300,Lxt=30*24*60*60*1e3;function jxt(){try{const e=localStorage.getItem(BQe);if(!e)return null;const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?null:t}catch{return null}}function FQe(e){try{localStorage.setItem(BQe,JSON.stringify(e))}catch{}}function Xxt(){try{const e=localStorage.getItem(Qxt);if(!e)return null;const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return null;const n=Object.entries(t);return n.length>0&&typeof n[0][1]=="number"?t:null}catch{return null}}function YQe(e){const t={};for(const[n,r]of Object.entries(e))typeof r=="number"&&r>0&&(t[n]={readIds:[],lastUpdated:r});return t}let sa={};const V4=jxt();if(V4&&Object.keys(V4).length>0)sa=V4;else{const e=Xxt();e&&Object.keys(e).length>0&&(sa=YQe(e))}let FH=Object.keys(sa).length>0,Gv=!0,NA=null;const YH=new Set;function VQe(e){return YH.add(e),FH||Yxt(),()=>{YH.delete(e)}}function qQe(){return sa}function Uxt(e,t,n){if(n.length===0)return;const r=`${e}/${t}`,s=sa[r],i=new Set(s?.readIds??[]);let o=!1;for(const a of n)i.has(a)||(i.add(a),o=!0);o&&(sa={...sa,[r]:{readIds:Array.from(i),lastUpdated:Date.now()}},HD(),Fxt())}function WQe(e,t,n,r){if(!r||r.length===0)return 0;const s=`${t}/${n}`,i=e[s];if(!i)return r.length;const o=new Set(i.readIds),a=o.size===0?i.lastUpdated:0;let c=0;for(const l of r)l.id&&o.has(l.id)||a>0&&new Date(l.createdAt).getTime()<=a||c++;return c}function zxt(e,t){const n=`${e}/${t}`,r=sa[n];return new Set(r?.readIds??[])}function Bxt(e,t){const n=`${e}/${t}`,r=sa[n];return!r||r.readIds.length>0?0:r.lastUpdated}function fre(){return typeof indexedDB<"u"}function HD(){YH.forEach(e=>e())}function Fxt(){NA&&clearTimeout(NA),NA=setTimeout(()=>{NA=null,Vxt()},Dxt)}async function Yxt(){if(!FH){if(fre()&&Gv)try{const e=await zd(pre);if(e&&typeof e=="object"){const t={...sa};for(const[n,r]of Object.entries(e)){if(!r||typeof r!="object")continue;const s=r,i=t[n];if(!i)t[n]=s;else{const o=new Set([...i.readIds,...s.readIds]);t[n]={readIds:Array.from(o),lastUpdated:Math.max(i.lastUpdated,s.lastUpdated)}}}sa=t,HD()}else{const t=await zd(Mxt);if(t&&typeof t=="object"){const n=YQe(t),r={...sa};for(const[s,i]of Object.entries(n))r[s]?r[s]={readIds:[...new Set([...r[s].readIds,...i.readIds])],lastUpdated:Math.max(r[s].lastUpdated,i.lastUpdated)}:r[s]=i;sa=r,HD()}}}catch{Gv=!1}FH=!0}}async function Vxt(){if(FQe(sa),Gv&&fre())try{await Ry(pre,sa)}catch{Gv=!1}}async function qxt(){const e=Date.now();let t=!1;const n={};for(const[r,s]of Object.entries(sa))e-s.lastUpdated<Lxt?n[r]=s:t=!0;if(t&&(sa=n,HD(),FQe(n),Gv&&fre()))try{await Ry(pre,n)}catch{Gv=!1}}function fr(e){let t=e.replace(/\\/g,"/");if(t!=="/"&&!/^[A-Za-z]:\/$/.test(t))for(;t.endsWith("/");)t=t.slice(0,-1);return t.toLowerCase()}function hre(e,t){return t==="pending"?{...e,pending:e.pending+1}:t==="in_progress"?{...e,inProgress:e.inProgress+1}:t==="completed"?{...e,completed:e.completed+1}:e}function Wxt(e){const t=new Map;for(const n of e){if(!n.projectPath)continue;const r=fr(n.projectPath),s=t.get(r)??{pending:0,inProgress:0,completed:0};t.set(r,hre(s,n.status))}return t}function Gxt(e){const t=new Map;for(const n of e){const r=n.teamName,s=t.get(r)??{pending:0,inProgress:0,completed:0};t.set(r,hre(s,n.status))}return t}function Hxt(e){const t=new Map;for(const n of e){const r=n.owner?.trim();if(!r||n.status==="deleted")continue;const s=r.toLowerCase(),i=t.get(s)??{pending:0,inProgress:0,completed:0};t.set(s,hre(i,n.status))}return t}function Yg({multimodelEnabled:e,bootstrapCliStatus:t,fetchCliStatus:n}){return e?t({multimodelEnabled:!0}):n()}const Zxt=2*60*1e3;function Kxt(e){if(!e)return;const t=[];if(typeof e.createdAt=="string"&&e.createdAt.length>0&&t.push(e.createdAt),Array.isArray(e.workIntervals))for(const o of e.workIntervals)typeof o?.startedAt=="string"&&o.startedAt.length>0&&t.push(o.startedAt);if(Array.isArray(e.historyEvents))for(const o of e.historyEvents)typeof o?.timestamp=="string"&&o.timestamp.length>0&&t.push(o.timestamp);if(t.length===0)return;const[n,...r]=t,s=r.reduce((o,a)=>o<a?o:a,n),i=new Date(s);return i.setTime(i.getTime()-Zxt),i.toISOString()}function Jxt(e){return Array.isArray(e.historyEvents)?e.historyEvents:[]}function eSt(e){const t=Jxt(e);for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.type==="review_requested"||r.type==="review_changes_requested"||r.type==="review_approved"||r.type==="review_started")return r.to;if(r.type==="status_changed"&&(r.to==="in_progress"||r.to==="deleted"))return"none";if(r.type==="status_changed"&&r.to==="pending"){for(let s=n-1;s>=0;s--){const i=t[s];if(i.type==="review_requested"||i.type==="review_changes_requested"||i.type==="review_approved"||i.type==="review_started")return i.to==="needsFix"?"needsFix":"none";if(i.type==="task_created"||i.type==="status_changed"&&(i.to==="in_progress"||i.to==="pending"||i.to==="deleted"))return"none"}return"none"}}return null}function tSt(e){return e==="review"||e==="needsFix"||e==="approved"?e:"none"}function GQe(e){if(Array.isArray(e.historyEvents)&&e.historyEvents.length>0){const s=eSt({historyEvents:e.historyEvents});if(s)return s}const t=typeof e.status=="string"?e.status:null,n=s=>{const i=tSt(s);return i==="none"?null:t==="in_progress"||t==="deleted"?"none":t==="pending"?i==="needsFix"?"needsFix":"none":t==="completed"?i==="review"||i==="approved"?i:"none":i},r=n(e.reviewState);return r||(e.kanbanColumn==="review"||e.kanbanColumn==="approved"?n(e.kanbanColumn)??"none":"none")}function nSt(e){return e==="review"||e==="approved"?e:void 0}function Vg(e){return nSt(GQe(e))}function rSt(e){return GQe(e)}function mre(e){const t=rSt(e);return t==="approved"?"approved":t==="review"?"review":e.status==="completed"?"completed":"active"}function sSt(e){const t=typeof e=="string"?e:mre(e);return t==="completed"||t==="approved"}function iSt(e){return typeof e=="string"?e!=="active":mre(e)!=="active"?!0:e.status==="in_progress"}function HQe(e){return Kxt(e)}function Fc(e,t){return{...{owner:e.owner,status:e.status,intervals:e.workIntervals,since:HQe(e),stateBucket:mre(e)},...t}}function ZQe(e){const t=typeof e.owner=="string"?e.owner.trim():"",n=typeof e.status=="string"?e.status.trim():"",r=typeof e.since=="string"?e.since:"",s=typeof e.stateBucket=="string"?e.stateBucket:"active",i=Array.isArray(e.intervals)?e.intervals.map(o=>({startedAt:o.startedAt,completedAt:o.completedAt??""})):[];return JSON.stringify({owner:t,status:n,since:r,stateBucket:s,intervals:i})}function Ed(e,t,n){return`${e}:${t}:${ZQe(n)}`}function KQe(e){switch(e?.stateBucket){case"approved":case"review":case"completed":return e.stateBucket;default:return"active"}}function q4(e){return sSt(KQe(e))}function Ore(e){return KQe(e)!=="active"?!0:e?.status==="in_progress"}class wO{constructor(t){this.namespace=t}static level=3;debug(...t){wO.level<=0&&console.debug(`[${this.namespace}]`,...t)}info(...t){wO.level<=1&&console.log(`[${this.namespace}]`,...t)}warn(...t){wO.level<=2&&console.warn(`[${this.namespace}]`,...t)}error(...t){wO.level<=3&&console.error(`[${this.namespace}]`,...t)}static setLevel(t){wO.level=t}static getLevel(){return wO.level}}function Hi(e){return new wO(e)}const oSt={},yfe=e=>{let t;const n=new Set,r=(d,p)=>{const f=typeof d=="function"?d(t):d;if(!Object.is(f,t)){const h=t;t=p??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(m=>m(t,h))}},s=()=>t,c={setState:r,getState:s,getInitialState:()=>l,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(oSt?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},l=t=e(r,s,c);return c},aSt=e=>e?yfe(e):yfe;var JQe={exports:{}},e2e={},t2e={exports:{}},n2e={};/**
966
966
  * @license React
967
967
  * use-sync-external-store-shim.production.js
968
968
  *
@@ -1034,11 +1034,11 @@ Error:`,s)}}function V0t(){return A0t(e=>{N$("cls",{metric:e}),vQe=e},{reportAll
1034
1034
  `;)i--;this.fragmentEnd=i?i-1:0}let r=this.cursor;r||(r=this.cursor=this.fragment.tree.cursor(),r.firstChild());let s=t+this.fragment.offset;for(;r.to<=s;)if(!r.parent())return!1;for(;;){if(r.from>=s)return this.fragment.from<=n;if(!r.childAfter(s))return!1}}matches(t){let n=this.cursor.tree;return n&&n.prop(Un.contextHash)==t}takeNodes(t){let n=this.cursor,r=this.fragment.offset,s=this.fragmentEnd-(this.fragment.openEnd?1:0),i=t.absoluteLineStart,o=i,a=t.block.children.length,c=o,l=a;for(;;){if(n.to-r>s){if(n.type.isAnonymous&&n.firstChild())continue;break}let d=j5e(n.from-r,t.ranges);if(n.to-r<=t.ranges[t.rangeI].to)t.addNode(n.tree,d);else{let p=new yr(t.parser.nodeSet.types[$t.Paragraph],[],[],0,t.block.hashProp);t.reusePlaceholders.set(p,n.tree),t.addNode(p,d)}if(n.type.is("Block")&&(GPt.indexOf(n.type.id)<0?(o=n.to-r,a=t.block.children.length):(o=c,a=l),c=n.to-r,l=t.block.children.length),!n.nextSibling())break}for(;t.block.children.length>a;)t.block.children.pop(),t.block.positions.pop();return o-i}}function j5e(e,t){let n=e;for(let r=1;r<t.length;r++){let s=t[r-1].to,i=t[r].from;s<e&&(n-=i-s)}return n}const ZPt=go({"Blockquote/...":X.quote,HorizontalRule:X.contentSeparator,"ATXHeading1/... SetextHeading1/...":X.heading1,"ATXHeading2/... SetextHeading2/...":X.heading2,"ATXHeading3/...":X.heading3,"ATXHeading4/...":X.heading4,"ATXHeading5/...":X.heading5,"ATXHeading6/...":X.heading6,"Comment CommentBlock":X.comment,Escape:X.escape,Entity:X.character,"Emphasis/...":X.emphasis,"StrongEmphasis/...":X.strong,"Link/... Image/...":X.link,"OrderedList/... BulletList/...":X.list,"BlockQuote/...":X.quote,"InlineCode CodeText":X.monospace,"URL Autolink":X.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":X.processingInstruction,"CodeInfo LinkLabel":X.labelName,LinkTitle:X.string,Paragraph:X.content}),KPt=new JU(new yE($5e).extend(ZPt),Object.keys(iI).map(e=>iI[e]),Object.keys(iI).map(e=>R5e[e]),Object.keys(iI),YPt,y5e,Object.keys(jF).map(e=>jF[e]),Object.keys(jF),[]);function JPt(e,t,n){let r=[];for(let s=e.firstChild,i=t;;s=s.nextSibling){let o=s?s.from:n;if(o>i&&r.push({from:i,to:o}),!s)break;i=s.to}return r}function e$t(e){let{codeParser:t,htmlParser:n}=e;return{wrap:MU((s,i)=>{let o=s.type.id;if(t&&(o==$t.CodeBlock||o==$t.FencedCode)){let a="";if(o==$t.FencedCode){let l=s.node.getChild($t.CodeInfo);l&&(a=i.read(l.from,l.to))}let c=t(a);if(c)return{parser:c,overlay:l=>l.type.id==$t.CodeText,bracketed:o==$t.FencedCode}}else if(n&&(o==$t.HTMLBlock||o==$t.HTMLTag||o==$t.CommentBlock))return{parser:n,overlay:JPt(s.node,s.from,s.to)};return null})}}const t$t={resolve:"Strikethrough",mark:"StrikethroughMark"},n$t={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":X.strikethrough}},{name:"StrikethroughMark",style:X.processingInstruction}],parseInline:[{name:"Strikethrough",parse(e,t,n){if(t!=126||e.char(n+1)!=126||e.char(n+2)==126)return-1;let r=e.slice(n-1,n),s=e.slice(n+2,n+3),i=/\s|^$/.test(r),o=/\s|^$/.test(s),a=WR.test(r),c=WR.test(s);return e.addDelimiter(t$t,n,n+2,!o&&(!c||i||a),!i&&(!a||o||c))},after:"Emphasis"}]};function Hk(e,t,n=0,r,s=0){let i=0,o=!0,a=-1,c=-1,l=!1,d=()=>{r.push(e.elt("TableCell",s+a,s+c,e.parser.parseInline(t.slice(a,c),s+a)))};for(let p=n;p<t.length;p++){let f=t.charCodeAt(p);f==124&&!l?((!o||a>-1)&&i++,o=!1,r&&(a>-1&&d(),r.push(e.elt("TableDelimiter",p+s,p+s+1))),a=c=-1):(l||f!=32&&f!=9)&&(a<0&&(a=p),c=p+1),l=!l&&f==92}return a>-1&&(i++,r&&d()),i}function zme(e,t){for(let n=t;n<e.length;n++){let r=e.charCodeAt(n);if(r==124)return!0;r==92&&n++}return!1}const X5e=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class Bme{constructor(){this.rows=null}nextLine(t,n,r){if(this.rows==null){this.rows=!1;let s;if((n.next==45||n.next==58||n.next==124)&&X5e.test(s=n.text.slice(n.pos))){let i=[];Hk(t,r.content,0,i,r.start)==Hk(t,s,n.pos)&&(this.rows=[t.elt("TableHeader",r.start,r.start+r.content.length,i),t.elt("TableDelimiter",t.lineStart+n.pos,t.lineStart+n.text.length)])}}else if(this.rows){let s=[];Hk(t,n.text,n.pos,s,t.lineStart),this.rows.push(t.elt("TableRow",t.lineStart+n.pos,t.lineStart+n.text.length,s))}return!1}finish(t,n){return this.rows?(t.addLeafElement(n,t.elt("Table",n.start,n.start+n.content.length,this.rows)),!0):!1}}const r$t={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":X.heading}},"TableRow",{name:"TableCell",style:X.content},{name:"TableDelimiter",style:X.processingInstruction}],parseBlock:[{name:"Table",leaf(e,t){return zme(t.content,0)?new Bme:null},endLeaf(e,t,n){if(n.parsers.some(s=>s instanceof Bme)||!zme(t.text,t.basePos))return!1;let r=e.peekLine();return X5e.test(r)&&Hk(e,t.text,t.basePos)==Hk(e,r,t.basePos)},before:"SetextHeading"}]};class s$t{nextLine(){return!1}finish(t,n){return t.addLeafElement(n,t.elt("Task",n.start,n.start+n.content.length,[t.elt("TaskMarker",n.start,n.start+3),...t.parser.parseInline(n.content.slice(3),n.start+3)])),!0}}const i$t={defineNodes:[{name:"Task",block:!0,style:X.list},{name:"TaskMarker",style:X.atom}],parseBlock:[{name:"TaskList",leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name=="ListItem"?new s$t:null},after:"SetextHeading"}]},Fme=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,Yme=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,o$t=/[\w-]+\.[\w-]+($|\/)/,Vme=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,qme=/\/[a-zA-Z\d@.]+/gy;function Wme(e,t,n,r){let s=0;for(let i=t;i<n;i++)e[i]==r&&s++;return s}function a$t(e,t){Yme.lastIndex=t;let n=Yme.exec(e);if(!n||o$t.exec(n[0])[0].indexOf("_")>-1)return-1;let r=t+n[0].length;for(;;){let s=e[r-1],i;if(/[?!.,:*_~]/.test(s)||s==")"&&Wme(e,t,r,")")>Wme(e,t,r,"("))r--;else if(s==";"&&(i=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,r))))r=t+i.index;else break}return r}function Gme(e,t){Vme.lastIndex=t;let n=Vme.exec(e);if(!n)return-1;let r=n[0][n[0].length-1];return r=="_"||r=="-"?-1:t+n[0].length-(r=="."?1:0)}const l$t={parseInline:[{name:"Autolink",parse(e,t,n){let r=n-e.offset;if(r&&/\w/.test(e.text[r-1]))return-1;Fme.lastIndex=r;let s=Fme.exec(e.text),i=-1;if(!s)return-1;if(s[1]||s[2]){if(i=a$t(e.text,r+s[0].length),i>-1&&e.hasOpenLink){let o=/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(r,i));i=r+o[0].length}}else s[3]?i=Gme(e.text,r):(i=Gme(e.text,r+s[0].length),i>-1&&s[0]=="xmpp:"&&(qme.lastIndex=i,s=qme.exec(e.text),s&&(i=s.index+s[0].length)));return i<0?-1:(e.addElement(e.elt("URL",n,i+e.offset)),i+e.offset)}}]},c$t=[r$t,i$t,n$t,l$t];function U5e(e,t,n){return(r,s,i)=>{if(s!=e||r.char(i+1)==e)return-1;let o=[r.elt(n,i,i+1)];for(let a=i+1;a<r.end;a++){let c=r.char(a);if(c==e)return r.addElement(r.elt(t,i,a+1,o.concat(r.elt(n,a,a+1))));if(c==92&&o.push(r.elt("Escape",a,a+++2)),nd(c))break}return-1}}const u$t={defineNodes:[{name:"Superscript",style:X.special(X.content)},{name:"SuperscriptMark",style:X.processingInstruction}],parseInline:[{name:"Superscript",parse:U5e(94,"Superscript","SuperscriptMark")}]},d$t={defineNodes:[{name:"Subscript",style:X.special(X.content)},{name:"SubscriptMark",style:X.processingInstruction}],parseInline:[{name:"Subscript",parse:U5e(126,"Subscript","SubscriptMark")}]},p$t={defineNodes:[{name:"Emoji",style:X.character}],parseInline:[{name:"Emoji",parse(e,t,n){let r;return t!=58||!(r=/^[a-zA-Z_0-9]+:/.exec(e.slice(n+1,e.end)))?-1:e.addElement(e.elt("Emoji",n,n+1+r[0].length))}}]},z5e=FU({commentTokens:{block:{open:"<!--",close:"-->"}}}),B5e=new Un,F5e=KPt.configure({props:[bo.add(e=>!e.is("Block")||e.is("Document")||q7(e)!=null||f$t(e)?void 0:(t,n)=>({from:n.doc.lineAt(t.from).to,to:t.to})),B5e.add(q7),_o.add({Document:()=>null}),JO.add({Document:z5e})]});function q7(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function f$t(e){return e.name=="OrderedList"||e.name=="BulletList"}function h$t(e,t){let n=e;for(;;){let r=n.nextSibling,s;if(!r||(s=q7(r.type))!=null&&s<=t)break;n=r}return n.to}const m$t=nLe.of((e,t,n)=>{for(let r=rs(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let s=r.type.prop(B5e);if(s==null)continue;let i=h$t(r,s);if(i>n)return{from:n,to:i}}return null});function dse(e){return new Rc(z5e,e,[],"markdown")}const Y5e=dse(F5e),O$t=F5e.configure([c$t,d$t,u$t,p$t,{props:[bo.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),GR=dse(O$t);function g$t(e,t){return n=>{if(n&&e){let r=null;if(n=/\S*/.exec(n)[0],typeof e=="function"?r=e(n):r=qe.matchLanguageName(e,n,!0),r instanceof qe)return r.support?r.support.language.parser:fL.getSkippingParser(r.load());if(r)return r.parser}return t?t.parser:null}}let XF=class{constructor(t,n,r,s,i,o,a){this.node=t,this.from=n,this.to=r,this.spaceBefore=s,this.spaceAfter=i,this.type=o,this.item=a}blank(t,n=!0){let r=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(t!=null){for(;r.length<t;)r+=" ";return r}else{for(let s=this.to-this.from-r.length-this.spaceAfter.length;s>0;s--)r+=" ";return r+(n?this.spaceAfter:"")}}marker(t,n){let r=this.node.name=="OrderedList"?String(+q5e(this.item,t)[2]+n):"";return this.spaceBefore+r+this.type+this.spaceAfter}};function V5e(e,t){let n=[],r=[];for(let s=e;s;s=s.parent){if(s.name=="FencedCode")return r;(s.name=="ListItem"||s.name=="Blockquote")&&n.push(s)}for(let s=n.length-1;s>=0;s--){let i=n[s],o,a=t.lineAt(i.from),c=i.from-a.from;if(i.name=="Blockquote"&&(o=/^ *>( ?)/.exec(a.text.slice(c))))r.push(new XF(i,c,c+o[0].length,"",o[1],">",null));else if(i.name=="ListItem"&&i.parent.name=="OrderedList"&&(o=/^( *)\d+([.)])( *)/.exec(a.text.slice(c)))){let l=o[3],d=o[0].length;l.length>=4&&(l=l.slice(0,l.length-4),d-=4),r.push(new XF(i.parent,c,c+d,o[1],l,o[2],i))}else if(i.name=="ListItem"&&i.parent.name=="BulletList"&&(o=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(a.text.slice(c)))){let l=o[4],d=o[0].length;l.length>4&&(l=l.slice(0,l.length-4),d-=4);let p=o[2];o[3]&&(p+=o[3].replace(/[xX]/," ")),r.push(new XF(i.parent,c,c+d,o[1],l,p,i))}}return r}function q5e(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function UF(e,t,n,r=0){for(let s=-1,i=e;;){if(i.name=="ListItem"){let a=q5e(i,t),c=+a[2];if(s>=0){if(c!=s+1)return;n.push({from:i.from+a[1].length,to:i.from+a[0].length,insert:String(s+2+r)})}s=c}let o=i.nextSibling;if(!o)break;i=o}}function pse(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(j$)!=" ")return e;let r=bm(e,4,n),s="";for(let i=r;i>0;)i>=4?(s+=" ",i-=4):(s+=" ",i--);return s+e.slice(n)}const W5e=(e={})=>({state:t,dispatch:n})=>{let r=rs(t),{doc:s}=t,i=null,o=t.changeByRange(a=>{if(!a.empty||!GR.isActiveAt(t,a.from,-1)&&!GR.isActiveAt(t,a.from,1))return i={range:a};let c=a.from,l=s.lineAt(c),d=V5e(r.resolveInner(c,-1),s);for(;d.length&&d[d.length-1].from>c-l.from;)d.pop();if(!d.length)return i={range:a};let p=d[d.length-1];if(p.to-p.spaceAfter.length>c-l.from)return i={range:a};let f=c>=p.to-p.spaceAfter.length&&!/\S/.test(l.text.slice(p.to));if(p.item&&f){let b=p.node.firstChild,y=p.node.getChild("ListItem","ListItem");if(b.to>=c||y&&y.to<c||l.from>0&&!/[^\s>]/.test(s.lineAt(l.from-1).text)||e.nonTightLists===!1){let x=d.length>1?d[d.length-2]:null,S,v="";x&&x.item?(S=l.from+x.from,v=x.marker(s,1)):S=l.from+(x?x.to:0);let T=[{from:S,to:c,insert:v}];return p.node.name=="OrderedList"&&UF(p.item,s,T,-2),x&&x.node.name=="OrderedList"&&UF(x.item,s,T),{range:ft.cursor(S+v.length),changes:T}}else{let x=Zme(d,t,l);return{range:ft.cursor(c+x.length+1),changes:{from:l.from,insert:x+t.lineBreak}}}}if(p.node.name=="Blockquote"&&f&&l.from){let b=s.lineAt(l.from-1),y=/>\s*$/.exec(b.text);if(y&&y.index==p.from){let x=t.changes([{from:b.from+y.index,to:b.to},{from:l.from+p.from,to:l.to}]);return{range:a.map(x),changes:x}}}let h=[];p.node.name=="OrderedList"&&UF(p.item,s,h);let m=p.item&&p.item.from<l.from,O="";if(!m||/^[\s\d.)\-+*>]*/.exec(l.text)[0].length>=p.to)for(let b=0,y=d.length-1;b<=y;b++)O+=b==y&&!m?d[b].marker(s,1):d[b].blank(b<y?bm(l.text,4,d[b+1].from)-O.length:null);let _=c;for(;_>l.from&&/\s/.test(l.text.charAt(_-l.from-1));)_--;return O=pse(O,t),_$t(p.node,t.doc)&&(O=Zme(d,t,l)+t.lineBreak+O),h.push({from:_,to:c,insert:t.lineBreak+O}),{range:ft.cursor(_+O.length+1),changes:h}});return i?!1:(n(t.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)},G5e=W5e();function Hme(e){return e.name=="QuoteMark"||e.name=="ListMark"}function _$t(e,t){if(e.name!="OrderedList"&&e.name!="BulletList")return!1;let n=e.firstChild,r=e.getChild("ListItem","ListItem");if(!r)return!1;let s=t.lineAt(n.to),i=t.lineAt(r.from),o=/^[\s>]*$/.test(s.text);return s.number+(o?0:1)<i.number}function Zme(e,t,n){let r="";for(let s=0,i=e.length-2;s<=i;s++)r+=e[s].blank(s<i?bm(n.text,4,e[s+1].from)-r.length:null,s<i);return pse(r,t)}function b$t(e,t){let n=e.resolveInner(t,-1),r=t;Hme(n)&&(r=n.from,n=n.parent);for(let s;s=n.childBefore(r);)if(Hme(s))r=s.from;else if(s.name=="OrderedList"||s.name=="BulletList")n=s.lastChild,r=n.to;else break;return n}const H5e=({state:e,dispatch:t})=>{let n=rs(e),r=null,s=e.changeByRange(i=>{let o=i.from,{doc:a}=e;if(i.empty&&GR.isActiveAt(e,i.from)){let c=a.lineAt(o),l=V5e(b$t(n,o),a);if(l.length){let d=l[l.length-1],p=d.to-d.spaceAfter.length+(d.spaceAfter?1:0);if(o-c.from>p&&!/\S/.test(c.text.slice(p,o-c.from)))return{range:ft.cursor(c.from+p),changes:{from:c.from+p,to:o}};if(o-c.from==p&&(!d.item||c.from<=d.item.from||!/\S/.test(c.text.slice(0,d.to)))){let f=c.from+d.from;if(d.item&&d.node.from<d.item.from&&/\S/.test(c.text.slice(d.from,d.to))){let h=d.blank(bm(c.text,4,d.to)-bm(c.text,4,d.from));return f==c.from&&(h=pse(h,e)),{range:ft.cursor(f+h.length),changes:{from:f,to:c.from+d.to,insert:h}}}if(f<o)return{range:ft.cursor(f),changes:{from:f,to:o}}}}}return r={range:i}});return r?!1:(t(e.update(s,{scrollIntoView:!0,userEvent:"delete"})),!0)},Z5e=[{key:"Enter",run:G5e},{key:"Backspace",run:H5e}],K5e=KU({matchClosingTags:!1});function J5e(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:s}=Y5e,completeHTMLTags:i=!0,pasteURLAsLink:o=!0,htmlTagLanguage:a=K5e}=e;if(!(s instanceof JU))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],l=[a.support,m$t],d;o&&l.push(eje),n instanceof qi?(l.push(n.support),d=n.language):n&&(d=n);let p=t||d?g$t(t,d):void 0;c.push(e$t({codeParser:p,htmlParser:a.language.parser})),r&&l.push(xE.high(zU.of(Z5e)));let f=dse(s.configure(c));return i&&l.push(f.data.of({autocomplete:y$t})),new qi(f,l)}function y$t(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let s=rs(t).resolveInner(n,-1);for(;s&&!s.type.isTop;){if(s.name=="CodeBlock"||s.name=="FencedCode"||s.name=="ProcessingInstructionBlock"||s.name=="CommentBlock"||s.name=="Link"||s.name=="Image")return null;s=s.parent}return{from:n-r[0].length,to:n,options:x$t(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let zF=null;function x$t(){if(zF)return zF;let e=a5e(new ECt(ei.create({extensions:K5e}),0,!0));return zF=e?e.options:[]}const S$t=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,eje=Kt.domEventHandlers({paste:(e,t)=>{var n;let{main:r}=t.state.selection;if(r.empty)return!1;let s=(n=e.clipboardData)===null||n===void 0?void 0:n.getData("text/plain");if(!s||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(s)||(/^www\./.test(s)&&(s="https://"+s),!GR.isActiveAt(t.state,r.from,1)))return!1;let i=rs(t.state),o=!1;return i.iterate({from:r.from,to:r.to,enter:a=>{(a.from>r.from||S$t.test(a.name))&&(o=!0)},leave:a=>{a.to<r.to&&(o=!0)}}),o?!1:(t.dispatch({changes:[{from:r.from,insert:"["},{from:r.to,insert:`](${s})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),v$t=Object.freeze(Object.defineProperty({__proto__:null,commonmarkLanguage:Y5e,deleteMarkupBackward:H5e,insertNewlineContinueMarkup:G5e,insertNewlineContinueMarkupCommand:W5e,markdown:J5e,markdownKeymap:Z5e,markdownLanguage:GR,pasteURLAsLink:eje},Symbol.toStringTag,{value:"Module"})),T$t=1,E$t=2,w$t=275,k$t=3,C$t=276,Kme=277,R$t=278,P$t=4,$$t=5,N$t=6,A$t=7,Jme=8,I$t=9,M$t=10,Q$t=11,D$t=12,L$t=13,j$t=14,X$t=15,U$t=16,z$t=17,B$t=18,F$t=19,Y$t=20,V$t=21,q$t=22,W$t=23,G$t=24,H$t=25,Z$t=26,K$t=27,J$t=28,eNt=29,tNt=30,nNt=31,rNt=32,sNt=33,iNt=34,oNt=35,aNt=36,lNt=37,cNt=38,uNt=39,dNt=40,pNt=41,fNt=42,hNt=43,mNt=44,ONt=45,gNt=46,_Nt=47,bNt=48,yNt=49,xNt=50,SNt=51,vNt=52,TNt=53,ENt=54,wNt=55,kNt=56,CNt=57,RNt=58,PNt=59,$Nt=60,NNt=61,ANt=62,BF=63,INt=64,MNt=65,QNt=66,DNt={abstract:P$t,and:$$t,array:N$t,as:A$t,true:Jme,false:Jme,break:I$t,case:M$t,catch:Q$t,clone:D$t,const:L$t,continue:j$t,declare:U$t,default:X$t,do:z$t,echo:B$t,else:F$t,elseif:Y$t,enddeclare:V$t,endfor:q$t,endforeach:W$t,endif:G$t,endswitch:H$t,endwhile:Z$t,enum:K$t,extends:J$t,final:eNt,finally:tNt,fn:nNt,for:rNt,foreach:sNt,from:iNt,function:oNt,global:aNt,goto:lNt,if:cNt,implements:uNt,include:dNt,include_once:pNt,instanceof:fNt,insteadof:hNt,interface:mNt,list:ONt,match:gNt,namespace:_Nt,new:bNt,null:yNt,or:xNt,print:SNt,readonly:vNt,require:TNt,require_once:ENt,return:wNt,switch:kNt,throw:CNt,trait:RNt,try:PNt,unset:$Nt,use:NNt,var:ANt,public:BF,private:BF,protected:BF,while:INt,xor:MNt,yield:QNt,__proto__:null};function eOe(e){let t=DNt[e.toLowerCase()];return t??-1}function tOe(e){return e==9||e==10||e==13||e==32}function tje(e){return e>=97&&e<=122||e>=65&&e<=90}function Zk(e){return e==95||e>=128||tje(e)}function FF(e){return e>=48&&e<=55||e>=97&&e<=102||e>=65&&e<=70}const LNt={int:!0,integer:!0,bool:!0,boolean:!0,float:!0,double:!0,real:!0,string:!0,array:!0,object:!0,unset:!0,__proto__:null},jNt=new Vn(e=>{if(e.next==40){e.advance();let t=0;for(;tOe(e.peek(t));)t++;let n="",r;for(;tje(r=e.peek(t));)n+=String.fromCharCode(r),t++;for(;tOe(e.peek(t));)t++;e.peek(t)==41&&LNt[n.toLowerCase()]&&e.acceptToken(T$t)}else if(e.next==60&&e.peek(1)==60&&e.peek(2)==60){for(let r=0;r<3;r++)e.advance();for(;e.next==32||e.next==9;)e.advance();let t=e.next==39;if(t&&e.advance(),!Zk(e.next))return;let n=String.fromCharCode(e.next);for(;e.advance(),!(!Zk(e.next)&&!(e.next>=48&&e.next<=55));)n+=String.fromCharCode(e.next);if(t){if(e.next!=39)return;e.advance()}if(e.next!=10&&e.next!=13)return;for(;;){let r=e.next==10||e.next==13;if(e.advance(),e.next<0)return;if(r){for(;e.next==32||e.next==9;)e.advance();let s=!0;for(let i=0;i<n.length;i++){if(e.next!=n.charCodeAt(i)){s=!1;break}e.advance()}if(s)return e.acceptToken(E$t)}}}}),XNt=new Vn(e=>{e.next<0&&e.acceptToken(R$t)}),UNt=new Vn((e,t)=>{e.next==63&&t.canShift(Kme)&&e.peek(1)==62&&e.acceptToken(Kme)});function zNt(e){let t=e.peek(1);if(t==110||t==114||t==116||t==118||t==101||t==102||t==92||t==36||t==34||t==123)return 2;if(t>=48&&t<=55){let n=2,r;for(;n<5&&(r=e.peek(n))>=48&&r<=55;)n++;return n}if(t==120&&FF(e.peek(2)))return FF(e.peek(3))?4:3;if(t==117&&e.peek(2)==123)for(let n=3;;n++){let r=e.peek(n);if(r==125)return n==2?0:n+1;if(!FF(r))break}return 0}const BNt=new Vn((e,t)=>{let n=!1;for(;!(e.next==34||e.next<0||e.next==36&&(Zk(e.peek(1))||e.peek(1)==123)||e.next==123&&e.peek(1)==36);n=!0){if(e.next==92){let r=zNt(e);if(r){if(n)break;return e.acceptToken(k$t,r)}}else if(!n&&(e.next==91||e.next==45&&e.peek(1)==62&&Zk(e.peek(2))||e.next==63&&e.peek(1)==45&&e.peek(2)==62&&Zk(e.peek(3)))&&t.canShift(C$t))break;e.advance()}n&&e.acceptToken(w$t)}),FNt=go({"Visibility abstract final static":X.modifier,"for foreach while do if else elseif switch try catch finally return throw break continue default case":X.controlKeyword,"endif endfor endforeach endswitch endwhile declare enddeclare goto match":X.controlKeyword,"and or xor yield unset clone instanceof insteadof":X.operatorKeyword,"function fn class trait implements extends const enum global interface use var":X.definitionKeyword,"include include_once require require_once namespace":X.moduleKeyword,"new from echo print array list as":X.keyword,null:X.null,Boolean:X.bool,VariableName:X.variableName,"NamespaceName/...":X.namespace,"NamedType/...":X.typeName,Name:X.name,"CallExpression/Name":X.function(X.variableName),"LabelStatement/Name":X.labelName,"MemberExpression/Name":X.propertyName,"MemberExpression/VariableName":X.special(X.propertyName),"ScopedExpression/ClassMemberName/Name":X.propertyName,"ScopedExpression/ClassMemberName/VariableName":X.special(X.propertyName),"CallExpression/MemberExpression/Name":X.function(X.propertyName),"CallExpression/ScopedExpression/ClassMemberName/Name":X.function(X.propertyName),"MethodDeclaration/Name":X.function(X.definition(X.variableName)),"FunctionDefinition/Name":X.function(X.definition(X.variableName)),"ClassDeclaration/Name":X.definition(X.className),UpdateOp:X.updateOperator,ArithOp:X.arithmeticOperator,"LogicOp IntersectionType/&":X.logicOperator,BitOp:X.bitwiseOperator,CompareOp:X.compareOperator,ControlOp:X.controlOperator,AssignOp:X.definitionOperator,"$ ConcatOp":X.operator,LineComment:X.lineComment,BlockComment:X.blockComment,Integer:X.integer,Float:X.float,String:X.string,ShellExpression:X.special(X.string),"=> ->":X.punctuation,"( )":X.paren,"#[ [ ]":X.squareBracket,"${ { }":X.brace,"-> ?->":X.derefOperator,", ; :: : \\":X.separator,"PhpOpen PhpClose":X.processingInstruction}),YNt={__proto__:null,static:325,STATIC:325,class:351,CLASS:351},VNt=ho.deserialize({version:14,states:"%#[Q`OWOOQhQaOOP%oO`OOOOO#t'#Hh'#HhO%tO#|O'#DuOOO#u'#Dx'#DxQ&SOWO'#DxO&XO$VOOOOQ#u'#Dy'#DyO&lQaO'#D}O'[QdO'#EQO+QQdO'#IqO+_QdO'#ERO-RQaO'#EXO/bQ`O'#EUO/gQ`O'#E_O2UQaO'#E_O2]Q`O'#EgO2bQ`O'#EqO-RQaO'#EqO2mQpO'#FOO2rQ`O'#FOOOQS'#Iq'#IqO2wQ`O'#ExOOQS'#Ih'#IhO5SQdO'#IeO9UQeO'#F]O-RQaO'#FlO-RQaO'#FmO-RQaO'#FnO-RQaO'#FoO-RQaO'#FoO-RQaO'#FrOOQO'#Ir'#IrO9cQ`O'#FxOOQO'#Ht'#HtO9kQ`O'#HXO:VQ`O'#FsO:bQ`O'#HfO:mQ`O'#GPO:uQaO'#GQO-RQaO'#G`O-RQaO'#GcO;bOrO'#GfOOQS'#JP'#JPOOQS'#JO'#JOOOQS'#Ie'#IeO/bQ`O'#GmO/bQ`O'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7c7o7x7y7z7{7|7}8O8P8Q8R8S8T8U8V8W8X8Y8Z8[8]8^8_8`8a8b8d8e8f8g8h8s9T9W9Z9^9_9a9c9f9h9o9p9s9u9v:Q:R:S:T:U:V:W:X:Y:Z:[:]:^:_:`:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:q:r:s:u:v:w;S;e;i;j;k;n;u;v;z;|;}<P<Q<R<S<T<U<V<W<X<Y<Z<[<]<^<_<`<a<b<c<d<e<f<g<h<i<j<k<l<m<n<o<p<q<r<s<t<u<v<w<x<y<z<{<|=O=P=Q=R=S=T=U=a=b>V>W>[>]>^>c>h>i>l>n>o>p>q>v?^?_T$x{$|Q(q%QQ(v%TQ(y%VR2b1WQ%c!]Q(u%SQ,d(tQ/W,cQ/Y,eQ1Q/XR2_1RQ%q!fR)m%rR/p-O",nodeNames:"⚠ ( HeredocString EscapeSequence abstract LogicOp array as Boolean break case catch clone const continue default declare do echo else elseif enddeclare endfor endforeach endif endswitch endwhile enum extends final finally fn for foreach from function global goto if implements include include_once LogicOp insteadof interface list match namespace new null LogicOp print readonly require require_once return switch throw trait try unset use var Visibility while LogicOp yield LineComment BlockComment TextInterpolation PhpClose Text PhpOpen Template TextInterpolation EmptyStatement ; } { Block : LabelStatement Name ExpressionStatement ConditionalExpression LogicOp MatchExpression ) ( ParenthesizedExpression MatchBlock MatchArm , => AssignmentExpression ArrayExpression ValueList & VariadicUnpacking ... Pair [ ] ListExpression ValueList Pair Pair SubscriptExpression MemberExpression -> ?-> Name VariableName DynamicVariable $ ${ CallExpression ArgList NamedArgument SpreadArgument CastExpression UnionType LogicOp IntersectionType OptionalType NamedType QualifiedName \\ NamespaceName Name NamespaceName Name ScopedExpression :: ClassMemberName DynamicMemberName AssignOp UpdateExpression UpdateOp YieldExpression BinaryExpression LogicOp LogicOp LogicOp BitOp BitOp BitOp CompareOp CompareOp BitOp ArithOp ConcatOp ArithOp ArithOp IncludeExpression RequireExpression CloneExpression UnaryExpression ControlOp LogicOp PrintIntrinsic FunctionExpression static ParamList Parameter #[ Attributes Attribute VariadicParameter PropertyParameter PropertyHooks PropertyHook UseList ArrowFunction NewExpression class BaseClause ClassInterfaceClause DeclarationList ConstDeclaration VariableDeclarator PropertyDeclaration VariableDeclarator MethodDeclaration UseDeclaration UseList UseInsteadOfClause UseAsClause UpdateExpression ArithOp ShellExpression ThrowExpression Integer Float String MemberExpression SubscriptExpression UnaryExpression ArithOp Interpolation String IfStatement ColonBlock SwitchStatement Block CaseStatement DefaultStatement ColonBlock WhileStatement EmptyStatement DoStatement ForStatement ForSpec SequenceExpression ForeachStatement ForSpec Pair GotoStatement ContinueStatement BreakStatement ReturnStatement TryStatement CatchDeclarator DeclareStatement EchoStatement UnsetStatement ConstDeclaration FunctionDefinition ClassDeclaration InterfaceDeclaration TraitDeclaration EnumDeclaration EnumBody EnumCase NamespaceDefinition NamespaceUseDeclaration UseGroup UseClause UseClause GlobalDeclaration FunctionStaticDeclaration Program",maxTerm:318,nodeProps:[["group",-36,2,8,49,82,84,86,89,94,95,103,107,108,112,113,116,120,126,132,137,139,140,154,155,156,157,160,161,173,174,188,190,191,192,193,194,200,"Expression",-28,75,79,81,83,201,203,208,210,211,214,217,218,219,220,221,223,224,225,226,227,228,229,230,231,234,235,239,240,"Statement",-4,121,123,124,125,"Type"],["isolate",-4,67,68,71,200,""],["openedBy",70,"phpOpen",77,"{",87,"(",102,"#["],["closedBy",72,"phpClose",78,"}",88,")",165,"]"]],propSources:[FNt],skippedNodes:[0],repeatNodeCount:32,tokenData:"!GQ_R!]OX$zXY&^YZ'sZ]$z]^&^^p$zpq&^qr)Rrs+Pst+otu2buv5evw6rwx8Vxy>]yz>yz{?g{|@}|}Bb}!OCO!O!PDh!P!QKT!Q!R!!o!R![!$q![!]!,P!]!^!-a!^!_!-}!_!`!1S!`!a!2d!a!b!3t!b!c!7^!c!d!7z!d!e!9Y!e!}!7z!}#O!;b#O#P!<O#P#Q!<l#Q#R!=Y#R#S!7z#S#T!=y#T#U!7z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$zR!E}V!oQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!FkV$eQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$z",tokenizers:[jNt,BNt,UNt,0,1,2,3,XNt],topRules:{Template:[0,73],Program:[1,241]},dynamicPrecedences:{298:1},specialized:[{term:284,get:(e,t)=>eOe(e)<<1,external:eOe},{term:284,get:e=>YNt[e]||-1}],tokenPrec:29889}),nje=mo.define({name:"php",parser:VNt.configure({props:[_o.add({IfStatement:vi({except:/^\s*({|else\b|elseif\b|endif\b)/}),TryStatement:vi({except:/^\s*({|catch\b|finally\b)/}),SwitchBody:e=>{let t=e.textAfter,n=/^\s*\}/.test(t),r=/^\s*(case|default)\b/.test(t);return e.baseIndent+(n?0:r?1:2)*e.unit},ColonBlock:e=>e.baseIndent+e.unit,"Block EnumBody DeclarationList":_f({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"String BlockComment":()=>null,Statement:vi({except:/^({|end(for|foreach|switch|while)\b)/})}),bo.add({"Block EnumBody DeclarationList SwitchBody ArrayExpression ValueList":td,ColonBlock(e){return{from:e.from+1,to:e.to}},BlockComment(e){return{from:e.from+2,to:e.to-2}}})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"},line:"//"},indentOnInput:/^\s*(?:case |default:|end(?:if|for(?:each)?|switch|while)|else(?:if)?|\{|\})$/,wordChars:"$",closeBrackets:{stringPrefixes:["b","B"]}}});function rje(e={}){let t=[],n;if(e.baseLanguage!==null)if(e.baseLanguage)n=e.baseLanguage;else{let r=KU({matchClosingTags:!1});t.push(r.support),n=r.language}return new qi(nje.configure({wrap:n&&MU(r=>r.type.isTop?{parser:n.parser,overlay:s=>s.name=="Text"}:null),top:e.plain?"Program":"Template"}),t)}const qNt=Object.freeze(Object.defineProperty({__proto__:null,php:rje,phpLanguage:nje},Symbol.toStringTag,{value:"Module"})),WNt=1,sje=194,ije=195,GNt=196,nOe=197,HNt=198,ZNt=199,KNt=200,JNt=2,oje=3,rOe=201,eAt=24,tAt=25,nAt=49,rAt=50,sAt=55,iAt=56,oAt=57,aAt=59,lAt=60,cAt=61,uAt=62,dAt=63,pAt=65,fAt=238,hAt=71,mAt=241,OAt=242,gAt=243,_At=244,bAt=245,yAt=246,xAt=247,SAt=248,aje=72,vAt=249,TAt=250,EAt=251,wAt=252,kAt=253,CAt=254,RAt=255,PAt=256,$At=73,NAt=77,AAt=263,IAt=112,MAt=130,QAt=151,DAt=152,LAt=155,jb=10,HR=13,fse=32,ez=9,hse=35,jAt=40,XAt=46,W7=123,sOe=125,lje=39,cje=34,iOe=92,UAt=111,zAt=120,BAt=78,FAt=117,YAt=85,VAt=new Set([tAt,nAt,rAt,AAt,pAt,MAt,iAt,oAt,fAt,uAt,dAt,aje,$At,NAt,lAt,cAt,QAt,DAt,LAt,IAt]);function YF(e){return e==jb||e==HR}function VF(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}const qAt=new Vn((e,t)=>{let n;if(e.next<0)e.acceptToken(ZNt);else if(t.context.flags&DQ)YF(e.next)&&e.acceptToken(HNt,1);else if(((n=e.peek(-1))<0||YF(n))&&t.canShift(nOe)){let r=0;for(;e.next==fse||e.next==ez;)e.advance(),r++;(e.next==jb||e.next==HR||e.next==hse)&&e.acceptToken(nOe,-r)}else YF(e.next)&&e.acceptToken(GNt,1)},{contextual:!0}),WAt=new Vn((e,t)=>{let n=t.context;if(n.flags)return;let r=e.peek(-1);if(r==jb||r==HR){let s=0,i=0;for(;;){if(e.next==fse)s++;else if(e.next==ez)s+=8-s%8;else break;e.advance(),i++}s!=n.indent&&e.next!=jb&&e.next!=HR&&e.next!=hse&&(s<n.indent?e.acceptToken(ije,-i):e.acceptToken(sje))}}),DQ=1,uje=2,uh=4,dh=8,ph=16,fh=32;function LQ(e,t,n){this.parent=e,this.indent=t,this.flags=n,this.hash=(e?e.hash+e.hash<<8:0)+t+(t<<4)+n+(n<<6)}const GAt=new LQ(null,0,0);function HAt(e){let t=0;for(let n=0;n<e.length;n++)t+=e.charCodeAt(n)==ez?8-t%8:1;return t}const oOe=new Map([[mAt,0],[OAt,uh],[gAt,dh],[_At,dh|uh],[bAt,ph],[yAt,ph|uh],[xAt,ph|dh],[SAt,ph|dh|uh],[vAt,fh],[TAt,fh|uh],[EAt,fh|dh],[wAt,fh|dh|uh],[kAt,fh|ph],[CAt,fh|ph|uh],[RAt,fh|ph|dh],[PAt,fh|ph|dh|uh]].map(([e,t])=>[e,t|uje])),ZAt=new Ny({start:GAt,reduce(e,t,n,r){return e.flags&DQ&&VAt.has(t)||(t==hAt||t==aje)&&e.flags&uje?e.parent:e},shift(e,t,n,r){return t==sje?new LQ(e,HAt(r.read(r.pos,n.pos)),0):t==ije?e.parent:t==eAt||t==sAt||t==aAt||t==oje?new LQ(e,0,DQ):oOe.has(t)?new LQ(e,0,oOe.get(t)|e.flags&DQ):e},hash(e){return e.hash}}),KAt=new Vn(e=>{for(let t=0;t<5;t++){if(e.next!="print".charCodeAt(t))return;e.advance()}if(!/\w/.test(String.fromCharCode(e.next)))for(let t=0;;t++){let n=e.peek(t);if(!(n==fse||n==ez)){n!=jAt&&n!=XAt&&n!=jb&&n!=HR&&n!=hse&&e.acceptToken(WNt);return}}}),JAt=new Vn((e,t)=>{let{flags:n}=t.context,r=n&uh?cje:lje,s=(n&dh)>0,i=!(n&ph),o=(n&fh)>0,a=e.pos;for(;!(e.next<0);)if(o&&e.next==W7)if(e.peek(1)==W7)e.advance(2);else{if(e.pos==a){e.acceptToken(oje,1);return}break}else if(i&&e.next==iOe){if(e.pos==a){e.advance();let c=e.next;c>=0&&(e.advance(),eIt(e,c)),e.acceptToken(JNt);return}break}else if(e.next==iOe&&!i&&e.peek(1)>-1)e.advance(2);else if(e.next==r&&(!s||e.peek(1)==r&&e.peek(2)==r)){if(e.pos==a){e.acceptToken(rOe,s?3:1);return}break}else if(e.next==jb){if(s)e.advance();else if(e.pos==a){e.acceptToken(rOe);return}break}else e.advance();e.pos>a&&e.acceptToken(KNt)});function eIt(e,t){if(t==UAt)for(let n=0;n<2&&e.next>=48&&e.next<=55;n++)e.advance();else if(t==zAt)for(let n=0;n<2&&VF(e.next);n++)e.advance();else if(t==FAt)for(let n=0;n<4&&VF(e.next);n++)e.advance();else if(t==YAt)for(let n=0;n<8&&VF(e.next);n++)e.advance();else if(t==BAt&&e.next==W7){for(e.advance();e.next>=0&&e.next!=sOe&&e.next!=lje&&e.next!=cje&&e.next!=jb;)e.advance();e.next==sOe&&e.advance()}}const tIt=go({'async "*" "**" FormatConversion FormatSpec':X.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":X.controlKeyword,"in not and or is del":X.operatorKeyword,"from def class global nonlocal lambda":X.definitionKeyword,import:X.moduleKeyword,"with as print":X.keyword,Boolean:X.bool,None:X.null,VariableName:X.variableName,"CallExpression/VariableName":X.function(X.variableName),"FunctionDefinition/VariableName":X.function(X.definition(X.variableName)),"ClassDefinition/VariableName":X.definition(X.className),PropertyName:X.propertyName,"CallExpression/MemberExpression/PropertyName":X.function(X.propertyName),Comment:X.lineComment,Number:X.number,String:X.string,FormatString:X.special(X.string),Escape:X.escape,UpdateOp:X.updateOperator,"ArithOp!":X.arithmeticOperator,BitOp:X.bitwiseOperator,CompareOp:X.compareOperator,AssignOp:X.definitionOperator,Ellipsis:X.punctuation,At:X.meta,"( )":X.paren,"[ ]":X.squareBracket,"{ }":X.brace,".":X.derefOperator,", ;":X.separator}),nIt={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},rIt=ho.deserialize({version:14,states:"##jO`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HT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ithOp @ ArithOp ** UnaryExpression ArithOp BitOp AwaitExpression await ) ( ParenthesizedExpression BinaryExpression or and CompareOp in not is UnaryExpression ConditionalExpression if else LambdaExpression lambda ParamList VariableName AssignOp , : NamedExpression AssignOp YieldExpression yield from TupleExpression ComprehensionExpression async for LambdaExpression ] [ ArrayExpression ArrayComprehensionExpression } { DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression CallExpression ArgList AssignOp MemberExpression . PropertyName Number String FormatString FormatReplacement FormatSelfDoc FormatConversion FormatSpec FormatReplacement FormatSelfDoc ContinuedString Ellipsis None Boolean TypeDef AssignOp UpdateStatement UpdateOp ExpressionStatement DeleteStatement del PassStatement pass BreakStatement break ContinueStatement continue ReturnStatement return YieldStatement PrintStatement RaiseStatement raise ImportStatement import as ScopeStatement global nonlocal AssertStatement assert TypeDefinition type TypeParamList TypeParam StatementGroup ; IfStatement Body elif WhileStatement while ForStatement TryStatement try except finally WithStatement with FunctionDefinition def ParamList AssignOp TypeDef ClassDefinition class DecoratedStatement Decorator At MatchStatement match MatchBody MatchClause case CapturePattern LiteralPattern ArithOp ArithOp AsPattern OrPattern LogicOp AttributePattern SequencePattern MappingPattern StarPattern ClassPattern PatternArgList KeywordPattern KeywordPattern Guard",maxTerm:277,context:ZAt,nodeProps:[["isolate",-5,4,71,72,73,77,""],["group",-15,6,85,87,88,90,92,94,96,98,99,100,102,105,108,110,"Statement Statement",-22,8,18,21,25,40,49,50,56,57,60,61,62,63,64,67,70,71,72,79,80,81,82,"Expression",-10,114,116,119,121,122,126,128,133,135,138,"Statement",-9,143,144,147,148,150,151,152,153,154,"Pattern"],["openedBy",23,"(",54,"[",58,"{"],["closedBy",24,")",55,"]",59,"}"]],propSources:[tIt],skippedNodes:[0,4],repeatNodeCount:34,tokenData:"!2|~R!`OX%TXY%oY[%T[]%o]p%Tpq%oqr'ars)Yst*xtu%Tuv,dvw-hwx.Uxy/tyz0[z{0r{|2S|}2p}!O3W!O!P4_!P!Q:Z!Q!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U!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[KAt,WAt,qAt,JAt,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:e=>nIt[e]||-1}],tokenPrec:7668}),aOe=new AU,dje=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function aI(e){return(t,n,r)=>{if(r)return!1;let s=t.node.getChild("VariableName");return s&&n(s,e),!0}}const sIt={FunctionDefinition:aI("function"),ClassDefinition:aI("class"),ForStatement(e,t,n){if(n){for(let r=e.node.firstChild;r;r=r.nextSibling)if(r.name=="VariableName")t(r,"variable");else if(r.name=="in")break}},ImportStatement(e,t){var n,r;let{node:s}=e,i=((n=s.firstChild)===null||n===void 0?void 0:n.name)=="from";for(let o=s.getChild("import");o;o=o.nextSibling)o.name=="VariableName"&&((r=o.nextSibling)===null||r===void 0?void 0:r.name)!="as"&&t(o,i?"variable":"namespace")},AssignStatement(e,t){for(let n=e.node.firstChild;n;n=n.nextSibling)if(n.name=="VariableName")t(n,"variable");else if(n.name==":"||n.name=="AssignOp")break},ParamList(e,t){for(let n=null,r=e.node.firstChild;r;r=r.nextSibling)r.name=="VariableName"&&(!n||!/\*|AssignOp/.test(n.name))&&t(r,"variable"),n=r},CapturePattern:aI("variable"),AsPattern:aI("variable"),__proto__:null};function pje(e,t){let n=aOe.get(t);if(n)return n;let r=[],s=!0;function i(o,a){let c=e.sliceString(o.from,o.to);r.push({label:c,type:a})}return t.cursor(Yr.IncludeAnonymous).iterate(o=>{if(o.name){let a=sIt[o.name];if(a&&a(o,i,s)||!s&&dje.has(o.name))return!1;s=!1}else if(o.to-o.from>8192){for(let a of pje(e,o.node))r.push(a);return!1}}),aOe.set(t,r),r}const lOe=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,fje=["String","FormatString","Comment","PropertyName"];function hje(e){let t=rs(e.state).resolveInner(e.pos,-1);if(fje.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&lOe.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let r=[];for(let s=t;s;s=s.parent)dje.has(s.name)&&(r=r.concat(pje(e.state.doc,s)));return{options:r,from:n?t.from:e.pos,validFor:lOe}}const iIt=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(e=>({label:e,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(e=>({label:e,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(e=>({label:e,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(e=>({label:e,type:"function"}))),oIt=[_r("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),_r("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),_r("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),_r("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),_r(`if \${}:
1035
1035
 
1036
1036
  `,{label:"if",detail:"block",type:"keyword"}),_r("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),_r("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),_r("import ${module}",{label:"import",detail:"statement",type:"keyword"}),_r("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],mje=ZU(fje,HU(iIt.concat(oIt)));function qF(e){let{node:t,pos:n}=e,r=e.lineIndent(n,-1),s=null;for(;;){let i=t.childBefore(n);if(i)if(i.name=="Comment")n=i.from;else if(i.name=="Body"||i.name=="MatchBody")e.baseIndentFor(i)+e.unit<=r&&(s=i),t=i;else if(i.name=="MatchClause")t=i;else if(i.type.is("Statement"))t=i;else break;else break}return s}function WF(e,t){let n=e.baseIndentFor(t),r=e.lineAt(e.pos,-1),s=r.from+r.text.length;return/^\s*($|#)/.test(r.text)&&e.node.to<s+100&&!/\S/.test(e.state.sliceDoc(s,e.node.to))&&e.lineIndent(e.pos,-1)<=n||/^\s*(else:|elif |except |finally:|case\s+[^=:]+:)/.test(e.textAfter)&&e.lineIndent(e.pos,-1)>n?null:n+e.unit}const jQ=mo.define({name:"python",parser:rIt.configure({props:[_o.add({Body:e=>{var t;let n=/^\s*(#|$)/.test(e.textAfter)&&qF(e)||e.node;return(t=WF(e,n))!==null&&t!==void 0?t:e.continue()},MatchBody:e=>{var t;let n=qF(e);return(t=WF(e,n||e.node))!==null&&t!==void 0?t:e.continue()},IfStatement:e=>/^\s*(else:|elif )/.test(e.textAfter)?e.baseIndent:e.continue(),"ForStatement WhileStatement":e=>/^\s*else:/.test(e.textAfter)?e.baseIndent:e.continue(),TryStatement:e=>/^\s*(except[ :]|finally:|else:)/.test(e.textAfter)?e.baseIndent:e.continue(),MatchStatement:e=>/^\s*case /.test(e.textAfter)?e.baseIndent+e.unit:e.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":_f({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":_f({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":_f({closing:"]"}),MemberExpression:e=>e.baseIndent+e.unit,"String FormatString":()=>null,Script:e=>{var t;let n=qF(e);return(t=n&&WF(e,n))!==null&&t!==void 0?t:e.continue()}}),bo.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":td,Body:(e,t)=>({from:e.from+1,to:e.to-(e.to==t.doc.length?0:1)}),"String FormatString":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});function Oje(){return new qi(jQ,[jQ.data.of({autocomplete:hje}),jQ.data.of({autocomplete:mje})])}const aIt=Object.freeze(Object.defineProperty({__proto__:null,globalCompletion:mje,localCompletionSource:hje,python:Oje,pythonLanguage:jQ},Symbol.toStringTag,{value:"Module"})),lIt=1,cIt=2,uIt=3,dIt=4,pIt=5,cOe=98,fIt=101,hIt=102,uOe=114,mIt=69,lI=48,dOe=46,OIt=43,gIt=45,pOe=35,fOe=34,_It=124,bIt=60,yIt=62;function G7(e){return e>=48&&e<=57}function cI(e){return G7(e)||e==95}const xIt=new Vn((e,t)=>{if(G7(e.next)){let n=!1;do e.advance();while(cI(e.next));if(e.next==dOe){if(n=!0,e.advance(),G7(e.next))do e.advance();while(cI(e.next));else if(e.next==dOe||e.next>127||/\w/.test(String.fromCharCode(e.next)))return}if(e.next==fIt||e.next==mIt){if(n=!0,e.advance(),(e.next==OIt||e.next==gIt)&&e.advance(),!cI(e.next))return;do e.advance();while(cI(e.next))}if(e.next==hIt){let r=e.peek(1);if(r==lI+3&&e.peek(2)==lI+2||r==lI+6&&e.peek(2)==lI+4)e.advance(3),n=!0;else return}n&&e.acceptToken(pIt)}else if(e.next==cOe||e.next==uOe){if(e.next==cOe&&e.advance(),e.next!=uOe)return;e.advance();let n=0;for(;e.next==pOe;)n++,e.advance();if(e.next!=fOe)return;e.advance();e:for(;;){if(e.next<0)return;let r=e.next==fOe;if(e.advance(),r){for(let s=0;s<n;s++){if(e.next!=pOe)continue e;e.advance()}e.acceptToken(dIt);return}}}}),SIt=new Vn(e=>{e.next==_It&&e.acceptToken(lIt,1)}),vIt=new Vn(e=>{e.next==bIt?e.acceptToken(cIt,1):e.next==yIt&&e.acceptToken(uIt,1)}),TIt=go({"const macro_rules struct union enum type fn impl trait let static":X.definitionKeyword,"mod use crate":X.moduleKeyword,"pub unsafe async mut extern default move":X.modifier,"for if else loop while match continue break return await":X.controlKeyword,"as in ref":X.operatorKeyword,"where _ crate super dyn":X.keyword,self:X.self,String:X.string,Char:X.character,RawString:X.special(X.string),Boolean:X.bool,Identifier:X.variableName,"CallExpression/Identifier":X.function(X.variableName),BoundIdentifier:X.definition(X.variableName),"FunctionItem/BoundIdentifier":X.function(X.definition(X.variableName)),LoopLabel:X.labelName,FieldIdentifier:X.propertyName,"CallExpression/FieldExpression/FieldIdentifier":X.function(X.propertyName),Lifetime:X.special(X.variableName),ScopeIdentifier:X.namespace,TypeIdentifier:X.typeName,"MacroInvocation/Identifier MacroInvocation/ScopedIdentifier/Identifier":X.macroName,"MacroInvocation/TypeIdentifier MacroInvocation/ScopedIdentifier/TypeIdentifier":X.macroName,'"!"':X.macroName,UpdateOp:X.updateOperator,LineComment:X.lineComment,BlockComment:X.blockComment,Integer:X.integer,Float:X.float,ArithOp:X.arithmeticOperator,LogicOp:X.logicOperator,BitOp:X.bitwiseOperator,CompareOp:X.compareOperator,"=":X.definitionOperator,".. ... => ->":X.punctuation,"( )":X.paren,"[ ]":X.squareBracket,"{ }":X.brace,". DerefOp":X.derefOperator,"&":X.operator,", ; ::":X.separator,"Attribute/...":X.meta}),EIt={__proto__:null,self:28,super:32,crate:34,impl:46,true:72,false:72,pub:88,in:92,const:96,unsafe:104,async:108,move:110,if:114,let:118,ref:142,mut:144,_:198,else:200,match:204,as:248,return:252,await:262,break:270,continue:276,while:312,loop:316,for:320,macro_rules:327,mod:334,extern:342,struct:346,where:364,union:379,enum:382,type:390,default:395,fn:396,trait:412,use:420,static:438,dyn:476},wIt=ho.deserialize({version:14,states:"$2xQ]Q_OOP$wOWOOO&sQWO'#CnO)WQWO'#I`OOQP'#I`'#I`OOQQ'#Ie'#IeO)hO`O'#C}OOQR'#Ih'#IhO)sQWO'#IuOOQO'#Hk'#HkO)xQWO'#DpOOQR'#Iw'#IwO)xQWO'#DpO*ZQWO'#DpOOQO'#Iv'#IvO,SQWO'#J`O,ZQWO'#EiOOQV'#Hp'#HpO,cQYO'#F{OOQV'#El'#ElOOQV'#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3n3q5UQ,m'jQ.u)uR8_6f`,b'b'c'd,c,f,h1_5UQ1e,lX3l/m/n3n3qj,a'b'c'd,c,f,h,l/m/n1_3n3q5UQ7j5TR8s7k^uO!O!P!T%_%b)i$`#afgilmp!Y!Z![!_!`#e#o#p#q#r#s#t#u#v#w#x#y#z#}$T$W&Y&['}(W(Y(|*i*l+n,s,z-m.}/^0}1h1|3a3h3k4W4v4|5g5t7S7g7{8k8|9u9v9w9x9z9{:O:P:Q:R:S:T:U:V:W:X:Y:Z:e:fQ6Z3_Q8U6]Q9Q8WQ9S8XQ9f9UR9l9hR(Q#zR(P#zQ$SlR(]$TR$ooR$noR)Q$vR)P$vQ)O$vR2O-ohwOb!O!P!T$y%_%b)S)U)i-t$l!lz!Q!n$O$u$|%f%n%o%p%q%y%{&P&o&p&r'](q)s)v)x)y*O*P*R*V*[*^*e*n*w*x+U+V+h+o+}-i-v.U.`.p.t.x.y/Z/[/{/}0`0r0w1O1Y1Z1y2a2h2j2m2s2v3V3u3{3|4R4U4_4e4t5`5d5v6R6Y6p6v6x7c7r8gR${xR0b+UR0W*xR0U*xR6{4PR/y*vR/x*vR0P*wR0O*wR0_+QR0^+Q%XyObxz!O!P!Q!T!n$O$u$y$|%_%b%f%n%o%p%q%y%{&P&o&p&r'](q)S)U)i)s)v)x)y*O*P*R*V*[*^*e*n*w*x+U+V+h+o+}-i-t-v.U.`.p.t.x.y/Z/[/{/}0`0r0w1O1Y1Z1y2a2h2j2m2s2v3V3u3{3|4R4U4_4e4t5`5d5v6R6Y6p6v6x7c7r8gR0k+ZR0j+ZQ'R!qQ)c%XQ+w&|R4y1PX'Q!q%X&|1PR+y&|R+x&|T/S*S4TT/R*S4TR.o)sR.n)sR){%p",nodeNames:"⚠ | < > RawString Float LineComment BlockComment SourceFile ] InnerAttribute ! [ MetaItem self Metavariable super crate Identifier ScopedIdentifier :: QualifiedScope AbstractType impl SelfType MetaType TypeIdentifier ScopedTypeIdentifier ScopeIdentifier TypeArgList TypeBinding = Lifetime String Escape Char Boolean Integer } { Block ; ConstItem Vis pub ( in ) const BoundIdentifier : UnsafeBlock unsafe AsyncBlock async move IfExpression if LetDeclaration let LiteralPattern ArithOp MetaPattern SelfPattern ScopedIdentifier TuplePattern ScopedTypeIdentifier , StructPattern FieldPatternList FieldPattern ref mut FieldIdentifier .. RefPattern SlicePattern CapturedPattern ReferencePattern & MutPattern RangePattern ... OrPattern MacroPattern ParenthesizedTokens TokenBinding Identifier TokenRepetition ArithOp BitOp LogicOp UpdateOp CompareOp -> => ArithOp BracketedTokens BracedTokens _ else MatchExpression match MatchBlock MatchArm Attribute Guard UnaryExpression ArithOp DerefOp LogicOp ReferenceExpression TryExpression BinaryExpression ArithOp ArithOp BitOp BitOp BitOp BitOp LogicOp LogicOp AssignmentExpression TypeCastExpression as ReturnExpression return RangeExpression CallExpression ArgList AwaitExpression await FieldExpression GenericFunction BreakExpression break LoopLabel ContinueExpression continue IndexExpression ArrayExpression TupleExpression MacroInvocation UnitExpression ClosureExpression ParamList Parameter Parameter ParenthesizedExpression StructExpression FieldInitializerList ShorthandFieldInitializer FieldInitializer BaseFieldInitializer MatchArm WhileExpression while LoopExpression loop ForExpression for MacroInvocation MacroDefinition macro_rules MacroRule EmptyStatement ModItem mod DeclarationList AttributeItem ForeignModItem extern StructItem struct TypeParamList ConstrainedTypeParameter TraitBounds HigherRankedTraitBound RemovedTraitBound OptionalTypeParameter ConstParameter WhereClause where LifetimeClause TypeBoundClause FieldDeclarationList FieldDeclaration OrderedFieldDeclarationList UnionItem union EnumItem enum EnumVariantList EnumVariant TypeItem type FunctionItem default fn ParamList Parameter SelfParameter VariadicParameter VariadicParameter ImplItem TraitItem trait AssociatedType LetDeclaration UseDeclaration use ScopedIdentifier UseAsClause ScopedIdentifier UseList ScopedUseList UseWildcard ExternCrateDeclaration StaticItem static ExpressionStatement ExpressionStatement GenericType FunctionType ForLifetimes ParamList VariadicParameter Parameter VariadicParameter Parameter ReferenceType PointerType TupleType UnitType ArrayType MacroInvocation EmptyType DynamicType dyn BoundedType",maxTerm:359,nodeProps:[["isolate",-4,4,6,7,33,""],["group",-42,4,5,14,15,16,17,18,19,33,35,36,37,40,51,53,56,101,107,111,112,113,122,123,125,127,128,130,132,133,134,137,139,140,141,142,143,144,148,149,155,157,159,"Expression",-16,22,24,25,26,27,222,223,230,231,232,233,234,235,236,237,239,"Type",-20,42,161,162,165,166,169,170,172,188,190,194,196,204,205,207,208,209,217,218,220,"Statement",-17,49,60,62,63,64,65,68,74,75,76,77,78,80,81,83,84,99,"Pattern"],["openedBy",9,"[",38,"{",47,"("],["closedBy",12,"]",39,"}",45,")"]],propSources:[TIt],skippedNodes:[0,6,7,240],repeatNodeCount:32,tokenData:"$%h_R!XOX$nXY5gYZ6iZ]$n]^5g^p$npq5gqr7Xrs9cst:Rtu;Tuv>vvwAQwxCbxy!+Tyz!,Vz{!-X{|!/_|}!0g}!O!1i!O!P!3v!P!Q!8[!Q!R!Bw!R![!Dr![!]#+q!]!^#-{!^!_#.}!_!`#1b!`!a#3o!a!b#6S!b!c#7U!c!}#8W!}#O#:T#O#P#;V#P#Q#Cb#Q#R#Dd#R#S#8W#S#T$n#T#U#8W#U#V#El#V#f#8W#f#g#Ic#g#o#8W#o#p$ S#p#q$!U#q#r$$f#r${$n${$|#8W$|4w$n4w5b#8W5b5i$n5i6S#8W6S;'S$n;'S;=`4s<%lO$nU$u]'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$nU%uV'_Q'OSOz&[z{&v{!P&[!P!Q'x!Q;'S&[;'S;=`*s<%lO&[S&aV'OSOz&[z{&v{!P&[!P!Q'x!Q;'S&[;'S;=`*s<%lO&[S&yVOz'`z{&v{!P'`!P!Q*y!Q;'S'`;'S;=`*m<%lO'`S'cVOz&[z{&v{!P&[!P!Q'x!Q;'S&[;'S;=`*s<%lO&[S'{UOz'`{!P'`!P!Q(_!Q;'S'`;'S;=`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#O#P&[#P#R$n#R#S#MX#S#T$n#T#o#MX#o${$n${$|#MX$|4w$n4w5b#MX5b5i$n5i6S#MX6S;'S$n;'S;=`4s<%lO$n_$ ]]wX'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n_$!_a'rX'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q!_$n!_!`@O!`#O$n#O#P&[#P#p$n#p#q$#d#q;'S$n;'S;=`4s<%lO$n_$#m]'|X'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n_$$o]vX'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n",tokenizers:[SIt,vIt,xIt,0,1,2,3],topRules:{SourceFile:[0,8]},specialized:[{term:281,get:e=>EIt[e]||-1}],tokenPrec:15596}),gje=mo.define({name:"rust",parser:wIt.configure({props:[_o.add({IfExpression:vi({except:/^\s*({|else\b)/}),"String BlockComment":()=>null,AttributeItem:e=>e.continue(),"Statement MatchArm":vi()}),bo.add(e=>{if(/(Block|edTokens|List)$/.test(e.name))return td;if(e.name=="BlockComment")return t=>({from:t.from+2,to:t.to-2})})]}),languageData:{commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:\{|\})$/,closeBrackets:{stringPrefixes:["b","r","br"]}}});function _je(){return new qi(gje)}const kIt=Object.freeze(Object.defineProperty({__proto__:null,rust:_je,rustLanguage:gje},Symbol.toStringTag,{value:"Module"})),bje=168,H7=169,CIt=170,RIt=1,PIt=2,hOe=3,$It=171,NIt=172,mOe=4,OOe=173,AIt=5,IIt=174,gOe=175,_Oe=176,GF=177,bOe=6,yOe=7,MIt=8,QIt=9,tz=0,Uh=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],DIt=58,LIt=40,mse=95,jIt=91,Kk=45,XIt=46,Ose=35,UIt=37,yje=123,zIt=125,Jk=47,eC=42,ku=10,xOe=61,BIt=43,FIt=38;function cT(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function gse(e){return e>=48&&e<=57}function _se(e){let t;return e.next==Jk&&((t=e.peek(1))==Jk||t==eC)}const YIt=new Vn((e,t)=>{if(t.dialectEnabled(tz)){let n;if(e.next<0&&t.canShift(_Oe))e.acceptToken(_Oe);else if(((n=e.peek(-1))==ku||n<0)&&t.canShift(gOe)){let r=0;for(;e.next!=ku&&Uh.includes(e.next);)e.advance(),r++;e.next==ku||_se(e)?e.acceptToken(gOe,-r):r&&e.acceptToken(GF)}else if(e.next==ku)e.acceptToken(IIt,1);else if(Uh.includes(e.next)){for(e.advance();e.next!=ku&&Uh.includes(e.next);)e.advance();e.acceptToken(GF)}}else{let n=0;for(;Uh.includes(e.next);)e.advance(),n++;n&&e.acceptToken(GF)}},{contextual:!0}),VIt=new Vn((e,t)=>{if(_se(e)){if(e.advance(),t.dialectEnabled(tz)){let n=-1;for(let r=1;;r++){let s=e.peek(-r-1);if(s==ku||s<0){n=r+1;break}else if(!Uh.includes(s))break}if(n>-1){let r=e.next==eC,s=0;for(e.advance();e.next>=0;)if(e.next==ku){e.advance();let i=0;for(;e.next!=ku&&Uh.includes(e.next);)i++,e.advance();if(i<n){s=-i-1;break}}else if(r&&e.next==eC&&e.peek(1)==Jk){s=2;break}else e.advance();e.acceptToken(r?yOe:bOe,s);return}}if(e.next==Jk){for(;e.next!=ku&&e.next>=0;)e.advance();e.acceptToken(bOe)}else{for(e.advance();e.next>=0;){let{next:n}=e;if(e.advance(),n==eC&&e.next==Jk){e.advance();break}}e.acceptToken(yOe)}}}),qIt=new Vn((e,t)=>{(e.next==BIt||e.next==xOe)&&t.dialectEnabled(tz)&&e.acceptToken(e.next==xOe?MIt:QIt,1)}),WIt=new Vn((e,t)=>{if(!t.dialectEnabled(tz))return;let n=t.context.depth;if(e.next<0&&n){e.acceptToken(H7);return}if(e.peek(-1)==ku){let s=0;for(;e.next!=ku&&Uh.includes(e.next);)e.advance(),s++;s!=n&&e.next!=ku&&!_se(e)&&(s<n?e.acceptToken(H7,-s):e.acceptToken(bje))}}),GIt=new Vn((e,t)=>{for(let n=!1,r=0,s=0;;s++){let{next:i}=e;if(cT(i)||i==Kk||i==mse||n&&gse(i))!n&&(i!=Kk||s>0)&&(n=!0),r===s&&i==Kk&&r++,e.advance();else if(i==Ose&&e.peek(1)==yje){e.acceptToken(AIt,2);break}else{n&&e.acceptToken(r==2&&t.canShift(mOe)?mOe:t.canShift(OOe)?OOe:i==LIt?$It:NIt);break}}}),HIt=new Vn(e=>{if(e.next==zIt){for(e.advance();cT(e.next)||e.next==Kk||e.next==mse||gse(e.next);)e.advance();e.next==Ose&&e.peek(1)==yje?e.acceptToken(PIt,2):e.acceptToken(RIt)}}),ZIt=new Vn(e=>{if(Uh.includes(e.peek(-1))){let{next:t}=e;(cT(t)||t==mse||t==Ose||t==XIt||t==jIt||t==DIt&&cT(e.peek(1))||t==Kk||t==FIt||t==eC)&&e.acceptToken(CIt)}}),KIt=new Vn(e=>{if(!Uh.includes(e.peek(-1))){let{next:t}=e;if(t==UIt&&(e.advance(),e.acceptToken(hOe)),cT(t)){do e.advance();while(cT(e.next)||gse(e.next));e.acceptToken(hOe)}}});function xje(e,t){this.parent=e,this.depth=t,this.hash=(e?e.hash+e.hash<<8:0)+t+(t<<4)}const JIt=new xje(null,0),eMt=new Ny({start:JIt,shift(e,t,n,r){return t==bje?new xje(e,n.pos-r.pos):t==H7?e.parent:e},hash(e){return e.hash}}),tMt=go({"AtKeyword import charset namespace keyframes media supports include mixin use forward extend at-root":X.definitionKeyword,"Keyword selector":X.keyword,ControlKeyword:X.controlKeyword,NamespaceName:X.namespace,KeyframeName:X.labelName,KeyframeRangeName:X.operatorKeyword,TagName:X.tagName,"ClassName Suffix":X.className,PseudoClassName:X.constant(X.className),IdName:X.labelName,"FeatureName PropertyName":X.propertyName,AttributeName:X.attributeName,NumberLiteral:X.number,KeywordQuery:X.keyword,UnaryQueryOp:X.operatorKeyword,"CallTag ValueName":X.atom,VariableName:X.variableName,SassVariableName:X.special(X.variableName),Callee:X.operatorKeyword,Unit:X.unit,"UniversalSelector NestingSelector IndentedMixin IndentedInclude":X.definitionOperator,MatchOp:X.compareOperator,"ChildOp SiblingOp, LogicOp":X.logicOperator,BinOp:X.arithmeticOperator,"Important Global Default":X.modifier,Comment:X.blockComment,LineComment:X.lineComment,ColorLiteral:X.color,"ParenthesizedContent StringLiteral":X.string,"InterpolationStart InterpolationContinue InterpolationEnd":X.meta,': "..."':X.punctuation,"PseudoOp #":X.derefOperator,"; ,":X.separator,"( )":X.paren,"[ ]":X.squareBracket,"{ }":X.brace}),nMt={__proto__:null,not:62,using:197,as:207,with:211,without:211,hide:225,show:225,if:263,from:269,to:271,through:273,in:279},rMt={__proto__:null,url:82,"url-prefix":82,domain:82,regexp:82,lang:104,"nth-child":104,"nth-last-child":104,"nth-of-type":104,"nth-last-of-type":104,dir:104,"host-context":104},sMt={__proto__:null,"@import":162,"@include":194,"@mixin":200,"@function":200,"@use":204,"@extend":214,"@at-root":218,"@forward":222,"@media":228,"@charset":232,"@namespace":236,"@keyframes":242,"@supports":254,"@if":258,"@else":260,"@for":266,"@each":276,"@while":282,"@debug":286,"@warn":286,"@error":286,"@return":286},iMt={__proto__:null,layer:166,not:184,only:184,selector:190},oMt=ho.deserialize({version:14,states:"!$WQ`Q+tOOO#fQ+tOOP#mOpOOOOQ#U'#Ch'#ChO#rQ(pO'#CjOOQ#U'#Ci'#CiO%_Q)QO'#GXO%rQ.jO'#CnO&mQ#dO'#D]O'dQ(pO'#CgO'kQ)OO'#D_O'vQ#dO'#DfO'{Q#dO'#DiO(QQ#dO'#DqOOQ#U'#GX'#GXO(VQ(pO'#GXO(^Q(nO'#DuO%rQ.jO'#D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(`'bQ(h'qQ(t(QR(u(SR%x$OR&R$aR&P$`QzPQ$^!fR%}$_X#ly#j#m%eQ#VhQ#_mQ$h!uR&^$iW#Rhm!u$iQ#^lQ$|#QQ%S#SQ&m%PQ&n%QQ'p&dR(f'oQ%O#QQ'v&kR)R(nQ#apQ$k!vQ$n!xQ$q!zQ$v#OQ%V#WQ%W#YQ%]#_Q%d#hQ&]$hQ&f$uQ&q%XQ'k&^Q'l&_S'm&`&bQ(k'sQ(}(eR)Q(jR&h$wR#ft",nodeNames:"⚠ InterpolationEnd InterpolationContinue Unit VariableName InterpolationStart LineComment Comment IndentedMixin IndentedInclude StyleSheet RuleSet UniversalSelector TagSelector TagName NestingSelector SuffixedSelector Suffix Interpolation SassVariableName ValueName ) ( ParenthesizedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp LogicOp UnaryExpression LogicOp NamespacedValue . CallExpression Callee ArgList : ... , CallLiteral CallTag ParenthesizedContent ] [ LineNames LineName ClassSelector ClassName PseudoClassSelector :: PseudoClassName PseudoClassName ArgList PseudoClassName ArgList IdSelector # IdName AttributeSelector AttributeName MatchOp ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp PlaceholderSelector ClassName Block { Declaration PropertyName Map Important Global Default ; } ImportStatement AtKeyword import Layer layer LayerName KeywordQuery FeatureQuery FeatureName BinaryQuery ComparisonQuery CompareOp UnaryQuery LogicOp ParenthesizedQuery SelectorQuery selector IncludeStatement include Keyword MixinStatement mixin UseStatement use Keyword Star Keyword ExtendStatement extend RootStatement at-root ForwardStatement forward Keyword MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports IfStatement ControlKeyword ControlKeyword Keyword ForStatement ControlKeyword Keyword Keyword Keyword EachStatement ControlKeyword Keyword WhileStatement ControlKeyword OutputStatement ControlKeyword AtRule Styles",maxTerm:196,context:eMt,nodeProps:[["openedBy",1,"InterpolationStart",5,"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UOy$Rz#b$R#b#c! ^#c;'S$R;'S;=`$d<%lO$Rk! cUzWOy$Rz#W$R#W#X! u#X;'S$R;'S;=`$d<%lO$Rk! |SmczWOy$Rz;'S$R;'S;=`$d<%lO$Rk!!]UOy$Rz#f$R#f#g! u#g;'S$R;'S;=`$d<%lO$RZ!!tS!hROy$Rz;'S$R;'S;=`$d<%lO$RZ!#VS!pROy$Rz;'S$R;'S;=`$d<%lO$R]!#hU!dPOy$Rz!_$R!_!`;T!`;'S$R;'S;=`$d<%lO$RW!#}P;=`<%l#r",tokenizers:[WIt,ZIt,HIt,KIt,GIt,YIt,VIt,qIt,0,1,2,3,4],topRules:{StyleSheet:[0,10],Styles:[1,145]},dialects:{indented:0},specialized:[{term:172,get:e=>nMt[e]||-1},{term:171,get:e=>rMt[e]||-1},{term:80,get:e=>sMt[e]||-1},{term:173,get:e=>iMt[e]||-1}],tokenPrec:3217}),xL=mo.define({name:"sass",parser:oMt.configure({props:[bo.add({Block:td,Comment(e,t){return{from:e.from+2,to:t.sliceDoc(e.to-2,e.to)=="*/"?e.to-2:e.to}}}),_o.add({Declaration:vi()})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"},line:"//"},indentOnInput:/^\s*\}$/,wordChars:"$-"}}),aMt=xL.configure({dialect:"indented",props:[_o.add({"Block RuleSet":e=>e.baseIndent+e.unit}),bo.add({Block:e=>({from:e.from,to:e.to})})]}),Sje=GU(e=>e.name=="VariableName"||e.name=="SassVariableName");function Z7(e){return new qi(e?.indented?aMt:xL,xL.data.of({autocomplete:Sje}))}const SOe=Object.freeze(Object.defineProperty({__proto__:null,sass:Z7,sassCompletionSource:Sje,sassLanguage:xL},Symbol.toStringTag,{value:"Module"})),lMt=36,vOe=1,cMt=2,px=3,HF=4,uMt=5,dMt=6,pMt=7,fMt=8,hMt=9,mMt=10,OMt=11,gMt=12,_Mt=13,bMt=14,yMt=15,xMt=16,SMt=17,TOe=18,vMt=19,vje=20,Tje=21,EOe=22,TMt=23,EMt=24;function K7(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57}function wMt(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function u0(e,t,n){for(let r=!1;;){if(e.next<0)return;if(e.next==t&&!r){e.advance();return}r=n&&!r&&e.next==92,e.advance()}}function kMt(e,t){e:for(;;){if(e.next<0)return;if(e.next==36){e.advance();for(let n=0;n<t.length;n++){if(e.next!=t.charCodeAt(n))continue e;e.advance()}if(e.next==36){e.advance();return}}else e.advance()}}function CMt(e,t){let n="[{<(".indexOf(String.fromCharCode(t)),r=n<0?t:"]}>)".charCodeAt(n);for(;;){if(e.next<0)return;if(e.next==r&&e.peek(1)==39){e.advance(2);return}e.advance()}}function J7(e,t){for(;!(e.next!=95&&!K7(e.next));)t!=null&&(t+=String.fromCharCode(e.next)),e.advance();return t}function RMt(e){if(e.next==39||e.next==34||e.next==96){let t=e.next;e.advance(),u0(e,t,!1)}else J7(e)}function wOe(e,t){for(;e.next==48||e.next==49;)e.advance();t&&e.next==t&&e.advance()}function kOe(e,t){for(;;){if(e.next==46){if(t)break;t=!0}else if(e.next<48||e.next>57)break;e.advance()}if(e.next==69||e.next==101)for(e.advance(),(e.next==43||e.next==45)&&e.advance();e.next>=48&&e.next<=57;)e.advance()}function COe(e){for(;!(e.next<0||e.next==10);)e.advance()}function Y_(e,t){for(let n=0;n<t.length;n++)if(t.charCodeAt(n)==e)return!0;return!1}const ZF=` \r
1037
- `;function Eje(e,t,n){let r=Object.create(null);r.true=r.false=uMt,r.null=r.unknown=dMt;for(let s of e.split(" "))s&&(r[s]=vje);for(let s of t.split(" "))s&&(r[s]=Tje);for(let s of(n||"").split(" "))s&&(r[s]=EMt);return r}const Ay="array binary bit boolean char character clob date decimal double float int integer interval large national nchar nclob numeric object precision real smallint time timestamp varchar varying ",Iy="absolute action add after all allocate alter and any are as asc assertion at authorization before begin between both breadth by call cascade cascaded case cast catalog check close collate collation column commit condition connect connection constraint constraints constructor continue corresponding count create cross cube current current_date current_default_transform_group current_transform_group_for_type current_path current_role current_time current_timestamp current_user cursor cycle data day deallocate declare default deferrable deferred delete depth deref desc describe descriptor deterministic diagnostics disconnect distinct do domain drop dynamic each else elseif end end-exec equals escape except exception exec execute exists exit external fetch first for foreign found from free full function general get global go goto grant group grouping handle having hold hour identity if immediate in indicator initially inner inout input insert intersect into is isolation join key language last lateral leading leave left level like limit local localtime localtimestamp locator loop map match method minute modifies module month names natural nesting new next no none not of old on only open option or order ordinality out outer output overlaps pad parameter partial path prepare preserve primary prior privileges procedure public read reads recursive redo ref references referencing relative release repeat resignal restrict result return returns revoke right role rollback rollup routine row rows savepoint schema scroll search second section select session session_user set sets signal similar size some space specific specifictype sql sqlexception sqlstate sqlwarning start state static system_user table temporary then timezone_hour timezone_minute to trailing transaction translation treat trigger under undo union unique unnest until update usage user using value values view when whenever where while with without work write year zone ",eZ={backslashEscapes:!1,hashComments:!1,spaceAfterDashes:!1,slashComments:!1,doubleQuotedStrings:!1,doubleDollarQuotedStrings:!1,unquotedBitLiterals:!1,treatBitsAsBytes:!1,charSetCasts:!1,plsqlQuotingMechanism:!1,operatorChars:"*+-%<>!=&|~^/",specialVar:"?",identifierQuotes:'"',caseInsensitiveIdentifiers:!1,words:Eje(Iy,Ay)};function PMt(e,t,n,r){let s={};for(let i in eZ)s[i]=(e.hasOwnProperty(i)?e:eZ)[i];return t&&(s.words=Eje(t,n||"",r)),s}function wje(e){return new Vn(t=>{var n;let{next:r}=t;if(t.advance(),Y_(r,ZF)){for(;Y_(t.next,ZF);)t.advance();t.acceptToken(lMt)}else if(r==36&&e.doubleDollarQuotedStrings){let s=J7(t,"");t.next==36&&(t.advance(),kMt(t,s),t.acceptToken(px))}else if(r==39||r==34&&e.doubleQuotedStrings)u0(t,r,e.backslashEscapes),t.acceptToken(px);else if(r==35&&e.hashComments||r==47&&t.next==47&&e.slashComments)COe(t),t.acceptToken(vOe);else if(r==45&&t.next==45&&(!e.spaceAfterDashes||t.peek(1)==32))COe(t),t.acceptToken(vOe);else if(r==47&&t.next==42){t.advance();for(let s=1;;){let i=t.next;if(t.next<0)break;if(t.advance(),i==42&&t.next==47){if(s--,t.advance(),!s)break}else i==47&&t.next==42&&(s++,t.advance())}t.acceptToken(cMt)}else if((r==101||r==69)&&t.next==39)t.advance(),u0(t,39,!0),t.acceptToken(px);else if((r==110||r==78)&&t.next==39&&e.charSetCasts)t.advance(),u0(t,39,e.backslashEscapes),t.acceptToken(px);else if(r==95&&e.charSetCasts)for(let s=0;;s++){if(t.next==39&&s>1){t.advance(),u0(t,39,e.backslashEscapes),t.acceptToken(px);break}if(!K7(t.next))break;t.advance()}else if(e.plsqlQuotingMechanism&&(r==113||r==81)&&t.next==39&&t.peek(1)>0&&!Y_(t.peek(1),ZF)){let s=t.peek(1);t.advance(2),CMt(t,s),t.acceptToken(px)}else if(Y_(r,e.identifierQuotes)){const s=r==91?93:r;u0(t,s,!1),t.acceptToken(vMt)}else if(r==40)t.acceptToken(pMt);else if(r==41)t.acceptToken(fMt);else if(r==123)t.acceptToken(hMt);else if(r==125)t.acceptToken(mMt);else if(r==91)t.acceptToken(OMt);else if(r==93)t.acceptToken(gMt);else if(r==59)t.acceptToken(_Mt);else if(e.unquotedBitLiterals&&r==48&&t.next==98)t.advance(),wOe(t),t.acceptToken(EOe);else if((r==98||r==66)&&(t.next==39||t.next==34)){const s=t.next;t.advance(),e.treatBitsAsBytes?(u0(t,s,e.backslashEscapes),t.acceptToken(TMt)):(wOe(t,s),t.acceptToken(EOe))}else if(r==48&&(t.next==120||t.next==88)||(r==120||r==88)&&t.next==39){let s=t.next==39;for(t.advance();wMt(t.next);)t.advance();s&&t.next==39&&t.advance(),t.acceptToken(HF)}else if(r==46&&t.next>=48&&t.next<=57)kOe(t,!0),t.acceptToken(HF);else if(r==46)t.acceptToken(bMt);else if(r>=48&&r<=57)kOe(t,!1),t.acceptToken(HF);else if(Y_(r,e.operatorChars)){for(;Y_(t.next,e.operatorChars);)t.advance();t.acceptToken(yMt)}else if(Y_(r,e.specialVar))t.next==r&&t.advance(),RMt(t),t.acceptToken(SMt);else if(r==58||r==44)t.acceptToken(xMt);else if(K7(r)){let s=J7(t,String.fromCharCode(r));t.acceptToken(t.next==46||t.peek(-s.length-1)==46?TOe:(n=e.words[s.toLowerCase()])!==null&&n!==void 0?n:TOe)}})}const kje=wje(eZ),$Mt=ho.deserialize({version:14,states:"%vQ]QQOOO#wQRO'#DSO$OQQO'#CwO%eQQO'#CxO%lQQO'#CyO%sQQO'#CzOOQQ'#DS'#DSOOQQ'#C}'#C}O'UQRO'#C{OOQQ'#Cv'#CvOOQQ'#C|'#C|Q]QQOOQOQQOOO'`QQO'#DOO(xQRO,59cO)PQQO,59cO)UQQO'#DSOOQQ,59d,59dO)cQQO,59dOOQQ,59e,59eO)jQQO,59eOOQQ,59f,59fO)qQQO,59fOOQQ-E6{-E6{OOQQ,59b,59bOOQQ-E6z-E6zOOQQ,59j,59jOOQQ-E6|-E6|O+VQRO1G.}O+^QQO,59cOOQQ1G/O1G/OOOQQ1G/P1G/POOQQ1G/Q1G/QP+kQQO'#C}O+rQQO1G.}O)PQQO,59cO,PQQO'#Cw",stateData:",[~OtOSPOSQOS~ORUOSUOTUOUUOVROXSOZTO]XO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O^]ORvXSvXTvXUvXVvXXvXZvX]vX_vX`vXavXbvXcvXdvXevXfvXgvXhvX~OsvX~P!jOa_Ob_Oc_O~ORUOSUOTUOUUOVROXSOZTO^tO_UO`UOa`Ob`Oc`OdUOeUOfUOgUOhUO~OWaO~P$ZOYcO~P$ZO[eO~P$ZORUOSUOTUOUUOVROXSOZTO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O]hOsoX~P%zOajObjOcjO~O^]ORkaSkaTkaUkaVkaXkaZka]ka_ka`kaakabkackadkaekafkagkahka~Oska~P'kO^]O~OWvXYvX[vX~P!jOWnO~P$ZOYoO~P$ZO[pO~P$ZO^]ORkiSkiTkiUkiVkiXkiZki]ki_ki`kiakibkickidkiekifkigkihki~Oski~P)xOWkaYka[ka~P'kO]hO~P$ZOWkiYki[ki~P)xOasObsOcsO~O",goto:"#hwPPPPPPPPPPPPPPPPPPPPPPPPPPx||||!Y!^!d!xPPP#[TYOZeUORSTWZbdfqT[OZQZORiZSWOZQbRQdSQfTZgWbdfqQ^PWk^lmrQl_Qm`RrseVORSTWZbdfq",nodeNames:"⚠ LineComment BlockComment String Number Bool Null ( ) { } [ ] ; . Operator Punctuation SpecialVar Identifier QuotedIdentifier Keyword Type Bits Bytes Builtin Script Statement CompositeIdentifier Parens Braces Brackets Statement",maxTerm:38,nodeProps:[["isolate",-4,1,2,3,19,""]],skippedNodes:[0,1,2],repeatNodeCount:3,tokenData:"RORO",tokenizers:[0,kje],topRules:{Script:[0,25]},tokenPrec:0});function tZ(e){let t=e.cursor().moveTo(e.from,-1);for(;/Comment/.test(t.name);)t.moveTo(t.from,-1);return t.node}function ZR(e,t){let n=e.sliceString(t.from,t.to),r=/^([`'"\[])(.*)([`'"\]])$/.exec(n);return r?r[2]:n}function SL(e){return e&&(e.name=="Identifier"||e.name=="QuotedIdentifier")}function NMt(e,t){if(t.name=="CompositeIdentifier"){let n=[];for(let r=t.firstChild;r;r=r.nextSibling)SL(r)&&n.push(ZR(e,r));return n}return[ZR(e,t)]}function ROe(e,t){for(let n=[];;){if(!t||t.name!=".")return n;let r=tZ(t);if(!SL(r))return n;n.unshift(ZR(e,r)),t=tZ(r)}}function AMt(e,t){let n=rs(e).resolveInner(t,-1),r=MMt(e.doc,n);return n.name=="Identifier"||n.name=="QuotedIdentifier"||n.name=="Keyword"?{from:n.from,quoted:n.name=="QuotedIdentifier"?e.doc.sliceString(n.from,n.from+1):null,parents:ROe(e.doc,tZ(n)),aliases:r}:n.name=="."?{from:t,quoted:null,parents:ROe(e.doc,n),aliases:r}:{from:t,quoted:null,parents:[],empty:!0,aliases:r}}const IMt=new Set("where group having order union intersect except all distinct limit offset fetch for".split(" "));function MMt(e,t){let n;for(let s=t;!n;s=s.parent){if(!s)return null;s.name=="Statement"&&(n=s)}let r=null;for(let s=n.firstChild,i=!1,o=null;s;s=s.nextSibling){let a=s.name=="Keyword"?e.sliceString(s.from,s.to).toLowerCase():null,c=null;if(!i)i=a=="from";else if(a=="as"&&o&&SL(s.nextSibling))c=ZR(e,s.nextSibling);else{if(a&&IMt.has(a))break;o&&SL(s)&&(c=ZR(e,s))}c&&(r||(r=Object.create(null)),r[c]=NMt(e,o)),o=/Identifier$/.test(s.name)?s:null}return r}function QMt(e,t,n){return n.map(r=>({...r,label:r.label[0]==e?r.label:e+r.label+t,apply:void 0}))}const DMt=/^\w*$/,LMt=/^[`'"\[]?\w*[`'"\]]?$/;function POe(e){return e.self&&typeof e.self.label=="string"}class bse{constructor(t,n){this.idQuote=t,this.idCaseInsensitive=n,this.list=[],this.children=void 0}child(t){let n=this.children||(this.children=Object.create(null)),r=n[t];return r||(t&&!this.list.some(s=>s.label==t)&&this.list.push($Oe(t,"type",this.idQuote,this.idCaseInsensitive)),n[t]=new bse(this.idQuote,this.idCaseInsensitive))}maybeChild(t){return this.children?this.children[t]:null}addCompletion(t){let n=this.list.findIndex(r=>r.label==t.label);n>-1?this.list[n]=t:this.list.push(t)}addCompletions(t){for(let n of t)this.addCompletion(typeof n=="string"?$Oe(n,"property",this.idQuote,this.idCaseInsensitive):n)}addNamespace(t){Array.isArray(t)?this.addCompletions(t):POe(t)?this.addNamespace(t.children):this.addNamespaceObject(t)}addNamespaceObject(t){for(let n of Object.keys(t)){let r=t[n],s=null,i=n.replace(/\\?\./g,a=>a=="."?"\0":a).split("\0"),o=this;POe(r)&&(s=r.self,r=r.children);for(let a=0;a<i.length;a++)s&&a==i.length-1&&o.addCompletion(s),o=o.child(i[a].replace(/\\\./g,"."));o.addNamespace(r)}}}function $Oe(e,t,n,r){return new RegExp("^[a-z_][a-z_\\d]*$",r?"i":"").test(e)?{label:e,type:t}:{label:e,type:t,apply:n+e+Cje(n)}}function Cje(e){return e==="["?"]":e}function jMt(e,t,n,r,s,i){var o;let a=((o=i?.spec.identifierQuotes)===null||o===void 0?void 0:o[0])||'"',c=new bse(a,!!i?.spec.caseInsensitiveIdentifiers),l=s?c.child(s):null;return c.addNamespace(e),t&&(l||c).addCompletions(t),n&&c.addCompletions(n),l&&c.addCompletions(l.list),r&&c.addCompletions((l||c).child(r).list),d=>{let{parents:p,from:f,quoted:h,empty:m,aliases:O}=AMt(d.state,d.pos);if(m&&!d.explicit)return null;O&&p.length==1&&(p=O[p[0]]||p);let _=c;for(let y of p){for(;!_.children||!_.children[y];)if(_==c&&l)_=l;else if(_==l&&r)_=_.child(r);else return null;let x=_.maybeChild(y);if(!x)return null;_=x}let b=_.list;if(_==c&&O&&(b=b.concat(Object.keys(O).map(y=>({label:y,type:"constant"})))),h){let y=h[0],x=Cje(y),S=d.state.sliceDoc(d.pos,d.pos+1)==x;return{from:f,to:S?d.pos+1:void 0,options:QMt(y,x,b),validFor:LMt}}else return{from:f,options:b,validFor:DMt}}}function XMt(e){return e==Tje?"type":e==vje?"keyword":"variable"}function UMt(e,t,n){let r=Object.keys(e).map(s=>n(t?s.toUpperCase():s,XMt(e[s])));return ZU(["QuotedIdentifier","String","LineComment","BlockComment","."],HU(r))}let zMt=$Mt.configure({props:[_o.add({Statement:vi()}),bo.add({Statement(e,t){return{from:Math.min(e.from+100,t.doc.lineAt(e.from).to),to:e.to}},BlockComment(e){return{from:e.from+2,to:e.to-2}}}),go({Keyword:X.keyword,Type:X.typeName,Builtin:X.standard(X.name),Bits:X.number,Bytes:X.string,Bool:X.bool,Null:X.null,Number:X.number,String:X.string,Identifier:X.name,QuotedIdentifier:X.special(X.string),SpecialVar:X.special(X.name),LineComment:X.lineComment,BlockComment:X.blockComment,Operator:X.operator,"Semi Punctuation":X.punctuation,"( )":X.paren,"{ }":X.brace,"[ ]":X.squareBracket})]});class Wu{constructor(t,n,r){this.dialect=t,this.language=n,this.spec=r}get extension(){return this.language.extension}configureLanguage(t,n){return new Wu(this.dialect,this.language.configure(t,n),this.spec)}static define(t){let n=PMt(t,t.keywords,t.types,t.builtin),r=mo.define({name:"sql",parser:zMt.configure({tokenizers:[{from:kje,to:wje(n)}]}),languageData:{commentTokens:{line:"--",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}});return new Wu(n,r,t)}}function BMt(e,t){return{label:e,type:t,boost:-1}}function Rje(e,t=!1,n){return UMt(e.dialect.words,t,n||BMt)}function Pje(e){return e.schema?jMt(e.schema,e.tables,e.schemas,e.defaultTable,e.defaultSchema,e.dialect||nz):()=>null}function FMt(e){return e.schema?(e.dialect||nz).language.data.of({autocomplete:Pje(e)}):[]}function $je(e={}){let t=e.dialect||nz;return new qi(t.language,[FMt(e),t.language.data.of({autocomplete:Rje(t,e.upperCaseKeywords,e.keywordCompletion)})])}const nz=Wu.define({}),YMt=Wu.define({charSetCasts:!0,doubleDollarQuotedStrings:!0,operatorChars:"+-*/<>=~!@#%^&|`?",specialVar:"",keywords:Iy+"abort abs absent access according ada admin aggregate alias also always analyse analyze array_agg array_max_cardinality asensitive assert assignment asymmetric atomic attach attribute attributes avg backward base64 begin_frame begin_partition bernoulli bit_length blocked bom cache called cardinality catalog_name ceil ceiling chain char_length character_length character_set_catalog character_set_name character_set_schema characteristics characters checkpoint class class_origin cluster coalesce cobol collation_catalog collation_name collation_schema collect column_name columns command_function command_function_code comment comments committed concurrently condition_number configuration conflict connection_name constant constraint_catalog constraint_name constraint_schema contains content control conversion convert copy corr cost covar_pop covar_samp csv cume_dist current_catalog current_row current_schema cursor_name database datalink datatype datetime_interval_code datetime_interval_precision db debug defaults defined definer degree delimiter delimiters dense_rank depends derived detach detail dictionary disable discard dispatch dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue document dump dynamic_function dynamic_function_code element elsif empty enable encoding encrypted end_frame end_partition endexec enforced enum errcode error event every exclude excluding exclusive exp explain expression extension extract family file filter final first_value flag floor following force foreach fortran forward frame_row freeze fs functions fusion generated granted greatest groups handler header hex hierarchy hint id ignore ilike immediately immutable implementation implicit import include including increment indent index indexes info inherit inherits inline insensitive instance instantiable instead integrity intersection invoker isnull key_member key_type label lag last_value lead leakproof least length library like_regex link listen ln load location lock locked log logged lower mapping matched materialized max max_cardinality maxvalue member merge message message_length message_octet_length message_text min minvalue mod mode more move multiset mumps name namespace nfc nfd nfkc nfkd nil normalize normalized nothing notice notify notnull nowait nth_value ntile nullable nullif nulls number occurrences_regex octet_length octets off offset oids operator options ordering others over overlay overriding owned owner parallel parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partition pascal passing passthrough password percent percent_rank percentile_cont percentile_disc perform period permission pg_context pg_datatype_name pg_exception_context pg_exception_detail pg_exception_hint placing plans pli policy portion position position_regex power precedes preceding prepared print_strict_params procedural procedures program publication query quote raise range rank reassign recheck recovery refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex rename repeatable replace replica requiring reset respect restart restore result_oid returned_cardinality returned_length returned_octet_length returned_sqlstate returning reverse routine_catalog routine_name routine_schema routines row_count row_number rowtype rule scale schema_name schemas scope scope_catalog scope_name scope_schema security selective self sensitive sequence sequences serializable server server_name setof share show simple skip slice snapshot source specific_name sqlcode sqlerror sqrt stable stacked standalone statement statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset subscription substring substring_regex succeeds sum symmetric sysid system system_time table_name tables tablesample tablespace temp template ties token top_level_count transaction_active transactions_committed transactions_rolled_back transform transforms translate translate_regex trigger_catalog trigger_name trigger_schema trim trim_array truncate trusted type types uescape unbounded uncommitted unencrypted unlink unlisten unlogged unnamed untyped upper uri use_column use_variable user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema vacuum valid validate validator value_of var_pop var_samp varbinary variable_conflict variadic verbose version versioning views volatile warning whitespace width_bucket window within wrapper xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate yes",types:Ay+"bigint int8 bigserial serial8 varbit bool box bytea cidr circle precision float8 inet int4 json jsonb line lseg macaddr macaddr8 money numeric pg_lsn point polygon float4 int2 smallserial serial2 serial serial4 text timetz timestamptz tsquery tsvector txid_snapshot uuid xml"}),Nje="accessible algorithm analyze asensitive authors auto_increment autocommit avg avg_row_length binlog btree cache catalog_name chain change changed checkpoint checksum class_origin client_statistics coalesce code collations columns comment committed completion concurrent consistent contains contributors convert database databases day_hour day_microsecond day_minute day_second delay_key_write delayed delimiter des_key_file dev_pop dev_samp deviance directory disable discard distinctrow div dual dumpfile enable enclosed ends engine engines enum errors escaped even event events every explain extended fast field fields flush force found_rows fulltext grants handler hash high_priority hosts hour_microsecond hour_minute hour_second ignore ignore_server_ids import index index_statistics infile innodb insensitive insert_method install invoker iterate keys kill linear lines list load lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modify mutex mysql_errno no_write_to_binlog offline offset one online optimize optionally outfile pack_keys parser partition partitions password phase plugin plugins prev processlist profile profiles purge query quick range read_write rebuild recover regexp relaylog remove rename reorganize repair repeatable replace require resume rlike row_format rtree schedule schema_name schemas second_microsecond security sensitive separator serializable server share show slave slow snapshot soname spatial sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result ssl starting starts std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace terminated triggers truncate uncommitted uninstall unlock upgrade use use_frm user_resources user_statistics utc_date utc_time utc_timestamp variables views warnings xa xor year_month zerofill",Aje=Ay+"bool blob long longblob longtext medium mediumblob mediumint mediumtext tinyblob tinyint tinytext text bigint int1 int2 int3 int4 int8 float4 float8 varbinary varcharacter precision datetime unsigned signed",Ije="charset clear edit ego help nopager notee nowarning pager print prompt quit rehash source status system tee",VMt=Wu.define({operatorChars:"*+-%<>!=&|^",charSetCasts:!0,doubleQuotedStrings:!0,unquotedBitLiterals:!0,hashComments:!0,spaceAfterDashes:!0,specialVar:"@?",identifierQuotes:"`",keywords:Iy+"group_concat "+Nje,types:Aje,builtin:Ije}),qMt=Wu.define({operatorChars:"*+-%<>!=&|^",charSetCasts:!0,doubleQuotedStrings:!0,unquotedBitLiterals:!0,hashComments:!0,spaceAfterDashes:!0,specialVar:"@?",identifierQuotes:"`",keywords:Iy+"always generated groupby_concat hard persistent shutdown soft virtual "+Nje,types:Aje,builtin:Ije});let WMt="approx_count_distinct approx_percentile_cont approx_percentile_disc avg checksum_agg count count_big grouping grouping_id max min product stdev stdevp sum var varp ai_generate_embeddings ai_generate_chunks cume_dist first_value lag last_value lead percentile_cont percentile_disc percent_rank left_shift right_shift bit_count get_bit set_bit collationproperty tertiary_weights @@datefirst @@dbts @@langid @@language @@lock_timeout @@max_connections @@max_precision @@nestlevel @@options @@remserver @@servername @@servicename @@spid @@textsize @@version cast convert parse try_cast try_convert try_parse asymkey_id asymkeyproperty certproperty cert_id crypt_gen_random decryptbyasymkey decryptbycert decryptbykey decryptbykeyautoasymkey decryptbykeyautocert decryptbypassphrase encryptbyasymkey encryptbycert encryptbykey encryptbypassphrase hashbytes is_objectsigned key_guid key_id key_name signbyasymkey signbycert symkeyproperty verifysignedbycert verifysignedbyasymkey @@cursor_rows @@fetch_status cursor_status datalength ident_current ident_incr ident_seed identity sql_variant_property @@datefirst current_timestamp current_timezone current_timezone_id date_bucket dateadd datediff datediff_big datefromparts datename datepart datetime2fromparts datetimefromparts datetimeoffsetfromparts datetrunc day eomonth getdate getutcdate isdate month smalldatetimefromparts switchoffset sysdatetime sysdatetimeoffset sysutcdatetime timefromparts todatetimeoffset year edit_distance edit_distance_similarity jaro_winkler_distance jaro_winkler_similarity edge_id_from_parts graph_id_from_edge_id graph_id_from_node_id node_id_from_parts object_id_from_edge_id object_id_from_node_id json isjson json_array json_contains json_modify json_object json_path_exists json_query json_value regexp_like regexp_replace regexp_substr regexp_instr regexp_count regexp_matches regexp_split_to_table abs acos asin atan atn2 ceiling cos cot degrees exp floor log log10 pi power radians rand round sign sin sqrt square tan choose greatest iif least @@procid app_name applock_mode applock_test assemblyproperty col_length col_name columnproperty databasepropertyex db_id db_name file_id file_idex file_name filegroup_id filegroup_name filegroupproperty fileproperty filepropertyex fulltextcatalogproperty fulltextserviceproperty index_col indexkey_property indexproperty next value for object_definition object_id object_name object_schema_name objectproperty objectpropertyex original_db_name parsename schema_id schema_name scope_identity serverproperty stats_date type_id type_name typeproperty dense_rank ntile rank row_number publishingservername certenclosed certprivatekey current_user database_principal_id has_dbaccess has_perms_by_name is_member is_rolemember is_srvrolemember loginproperty original_login permissions pwdencrypt pwdcompare session_user sessionproperty suser_id suser_name suser_sid suser_sname system_user user user_id user_name ascii char charindex concat concat_ws difference format left len lower ltrim nchar patindex quotename replace replicate reverse right rtrim soundex space str string_agg string_escape stuff substring translate trim unicode upper $partition @@error @@identity @@pack_received @@rowcount @@trancount binary_checksum checksum compress connectionproperty context_info current_request_id current_transaction_id decompress error_line error_message error_number error_procedure error_severity error_state formatmessage get_filestream_transaction_context getansinull host_id host_name isnull isnumeric min_active_rowversion newid newsequentialid rowcount_big session_context xact_state @@connections @@cpu_busy @@idle @@io_busy @@pack_sent @@packet_errors @@timeticks @@total_errors @@total_read @@total_write textptr textvalid columns_updated eventdata trigger_nestlevel vector_distance vectorproperty vector_search generate_series opendatasource openjson openquery openrowset openxml predict string_split coalesce nullif apply catch filter force include keep keepfixed modify optimize parameterization parameters partition recompile sequence set";const GMt=Wu.define({keywords:Iy+"add external procedure all fetch public alter file raiserror and fillfactor read any for readtext as foreign reconfigure asc freetext references authorization freetexttable replication backup from restore begin full restrict between function return break goto revert browse grant revoke bulk group right by having rollback cascade holdlock rowcount case identity rowguidcol check identity_insert rule checkpoint identitycol save close if schema clustered in securityaudit coalesce index select collate inner semantickeyphrasetable column insert semanticsimilaritydetailstable commit intersect semanticsimilaritytable compute into session_user constraint is set contains join setuser containstable key shutdown continue kill some convert left statistics create like system_user cross lineno table current load tablesample current_date merge textsize current_time national then current_timestamp nocheck to current_user nonclustered top cursor not tran database null transaction dbcc nullif trigger deallocate of truncate declare off try_convert default offsets tsequal delete on union deny open unique desc opendatasource unpivot disk openquery update distinct openrowset updatetext distributed openxml use double option user drop or values dump order varying else outer view end over waitfor errlvl percent when escape pivot where except plan while exec precision with execute primary within group exists print writetext exit proc noexpand index forceseek forcescan holdlock nolock nowait paglock readcommitted readcommittedlock readpast readuncommitted repeatableread rowlock serializable snapshot spatial_window_max_cells tablock tablockx updlock xlock keepidentity keepdefaults ignore_constraints ignore_triggers",types:Ay+"smalldatetime datetimeoffset datetime2 datetime bigint smallint smallmoney tinyint money real text nvarchar ntext varbinary image hierarchyid uniqueidentifier sql_variant xml",builtin:WMt,operatorChars:"*+-%<>!=^&|/",specialVar:"@",identifierQuotes:'"['}),HMt=Wu.define({keywords:Iy+"abort analyze attach autoincrement conflict database detach exclusive fail glob ignore index indexed instead isnull notnull offset plan pragma query raise regexp reindex rename replace temp vacuum virtual",types:Ay+"bool blob long longblob longtext medium mediumblob mediumint mediumtext tinyblob tinyint tinytext text bigint int2 int8 unsigned signed real",builtin:"auth backup bail changes clone databases dbinfo dump echo eqp explain fullschema headers help import imposter indexes iotrace lint load log mode nullvalue once print prompt quit restore save scanstats separator shell show stats system tables testcase timeout timer trace vfsinfo vfslist vfsname width",operatorChars:"*+-%<>!=&|/~",identifierQuotes:'`"',specialVar:"@:?$"}),ZMt=Wu.define({keywords:"add all allow alter and any apply as asc authorize batch begin by clustering columnfamily compact consistency count create custom delete desc distinct drop each_quorum exists filtering from grant if in index insert into key keyspace keyspaces level limit local_one local_quorum modify nan norecursive nosuperuser not of on one order password permission permissions primary quorum rename revoke schema select set storage superuser table three to token truncate ttl two type unlogged update use user users using values where with writetime infinity NaN",types:Ay+"ascii bigint blob counter frozen inet list map static text timeuuid tuple uuid varint",slashComments:!0}),KMt=Wu.define({keywords:Iy+"abort accept access add all alter and any arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body by case cast char_base check close cluster clusters colauth column comment commit compress connected constant constraint crash create current currval cursor data_base database dba deallocate debugoff debugon declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry exception exception_init exchange exclusive exists external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base of off offline on online only option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw rebuild record ref references refresh rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work",builtin:"appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define echo editfile embedded feedback flagger flush heading headsep instance linesize lno loboffset logsource longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar repfooter repheader serveroutput shiftinout show showmode spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout timing trimout trimspool ttitle underline verify version wrap",types:Ay+"ascii bfile bfilename bigserial bit blob dec long number nvarchar nvarchar2 serial smallint string text uid varchar2 xml",operatorChars:"*/+-%<>!=~",doubleQuotedStrings:!0,charSetCasts:!0,plsqlQuotingMechanism:!0}),JMt=Object.freeze(Object.defineProperty({__proto__:null,Cassandra:ZMt,MSSQL:GMt,MariaSQL:qMt,MySQL:VMt,PLSQL:KMt,PostgreSQL:YMt,SQLDialect:Wu,SQLite:HMt,StandardSQL:nz,keywordCompletionSource:Rje,schemaCompletionSource:Pje,sql:$je},Symbol.toStringTag,{value:"Module"})),nZ=1,eQt=2,tQt=3,nQt=4,rQt=5,sQt=36,iQt=37,oQt=38,aQt=11,lQt=13;function cQt(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function uQt(e){return e==9||e==10||e==13||e==32}let NOe=null,AOe=null,IOe=0;function rZ(e,t){let n=e.pos+t;if(AOe==e&&IOe==n)return NOe;for(;uQt(e.peek(t));)t++;let r="";for(;;){let s=e.peek(t);if(!cQt(s))break;r+=String.fromCharCode(s),t++}return AOe=e,IOe=n,NOe=r||null}function MOe(e,t){this.name=e,this.parent=t}const dQt=new Ny({start:null,shift(e,t,n,r){return t==nZ?new MOe(rZ(r,1)||"",e):e},reduce(e,t){return t==aQt&&e?e.parent:e},reuse(e,t,n,r){let s=t.type.id;return s==nZ||s==lQt?new MOe(rZ(r,1)||"",e):e},strict:!1}),pQt=new Vn((e,t)=>{if(e.next==60){if(e.advance(),e.next==47){e.advance();let n=rZ(e,0);if(!n)return e.acceptToken(rQt);if(t.context&&n==t.context.name)return e.acceptToken(eQt);for(let r=t.context;r;r=r.parent)if(r.name==n)return e.acceptToken(tQt,-2);e.acceptToken(nQt)}else if(e.next!=33&&e.next!=63)return e.acceptToken(nZ)}},{contextual:!0});function yse(e,t){return new Vn(n=>{let r=0,s=t.charCodeAt(0);e:for(;!(n.next<0);n.advance(),r++)if(n.next==s){for(let i=1;i<t.length;i++)if(n.peek(i)!=t.charCodeAt(i))continue e;break}r&&n.acceptToken(e)})}const fQt=yse(sQt,"-->"),hQt=yse(iQt,"?>"),mQt=yse(oQt,"]]>"),OQt=go({Text:X.content,"StartTag StartCloseTag EndTag SelfCloseEndTag":X.angleBracket,TagName:X.tagName,"MismatchedCloseTag/TagName":[X.tagName,X.invalid],AttributeName:X.attributeName,AttributeValue:X.attributeValue,Is:X.definitionOperator,"EntityReference CharacterReference":X.character,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OO-E6x-E6xOOOO1G.t1G.tOOOO-E6y-E6y",stateData:")z~OPQOSVOTWOVWOWWOXWOiXOyPO!QTO!SUO~OvZOx]O~O^`Oz^O~OPQOQcOSVOTWOVWOWWOXWOyPO!QTO!SUO~ORdO~P!SOteO!PgO~OuhO!RjO~O^lOz^O~OvZOxoO~O^qOz^O~O[vO`sOdwOz^O~ORyO~P!SO^{Oz^O~OteO!P}O~OuhO!R!PO~O^!QOz^O~O[!SOz^O~O[!VO`sOd!WOz^O~Oa!YOz^O~Oz^O[mX`mXdmX~O[!VO`sOd!WO~O^!]Oz^O~O[!_Oz^O~O[!aOz^O~O[!cO`sOd!dOz^O~O[!cO`sOd!dO~Oa!eOz^O~Oz^O{!gO}!hO~Oz^O[ma`madma~O[!kOz^O~O[!lOz^O~O[!mO`sOd!nO~OW!qOX!qO{!sO|!qO~OW!tOX!tO}!sO!O!tO~O[!vOz^O~OW!qOX!qO{!yO|!qO~OW!tOX!tO}!yO!O!tO~O",goto:"%cxPPPPPPPPPPyyP!PP!VPP!`!jP!pyyyP!v!|#S$[$k$q$w$}%TPPPP%ZXWORYbXRORYb_t`qru!T!U!bQ!i!YS!p!e!fR!w!oQdRRybXSORYbQYORmYQ[PRn[Q_QQkVjp_krz!R!T!X!Z!^!`!f!j!oQr`QzcQ!RlQ!TqQ!XsQ!ZtQ!^{Q!`!QQ!f!YQ!j!]R!o!eQu`S!UqrU![u!U!bR!b!TQ!r!gR!x!rQ!u!hR!z!uQbRRxbQfTR|fQiUR!OiSXOYTaRb",nodeNames:"⚠ StartTag StartCloseTag MissingCloseTag StartCloseTag StartCloseTag Document Text EntityReference CharacterReference Cdata Element EndTag OpenTag TagName Attribute AttributeName Is AttributeValue CloseTag SelfCloseEndTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag DoctypeDecl",maxTerm:50,context:dQt,nodeProps:[["closedBy",1,"SelfCloseEndTag EndTag",13,"CloseTag MissingCloseTag"],["openedBy",12,"StartTag StartCloseTag",19,"OpenT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!^!_(o!_;'S$q;'S;=`)c<%lO$qk!%mZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!&`!a;'S$q;'S;=`)c<%lO$qk!&kX!RQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!'aZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_#P$q#P#Q!(S#Q;'S$q;'S;=`)c<%lO$qk!(]ZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!)O!a;'S$q;'S;=`)c<%lO$qk!)ZXxQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$q",tokenizers:[pQt,fQt,hQt,mQt,0,1,2,3,4],topRules:{Document:[0,6]},tokenPrec:0});function XQ(e,t){let n=t&&t.getChild("TagName");return n?e.sliceString(n.from,n.to):""}function KF(e,t){let n=t&&t.firstChild;return!n||n.name!="OpenTag"?"":XQ(e,n)}function _Qt(e,t,n){let r=t&&t.getChildren("Attribute").find(i=>i.from<=n&&i.to>=n),s=r&&r.getChild("AttributeName");return s?e.sliceString(s.from,s.to):""}function JF(e){for(let t=e&&e.parent;t;t=t.parent)if(t.name=="Element")return t;return null}function bQt(e,t){var n;let r=rs(e).resolveInner(t,-1),s=null;for(let i=r;!s&&i.parent;i=i.parent)(i.name=="OpenTag"||i.name=="CloseTag"||i.name=="SelfClosingTag"||i.name=="MismatchedCloseTag")&&(s=i);if(s&&(s.to>t||s.lastChild.type.isError)){let i=s.parent;if(r.name=="TagName")return s.name=="CloseTag"||s.name=="MismatchedCloseTag"?{type:"closeTag",from:r.from,context:i}:{type:"openTag",from:r.from,context:JF(i)};if(r.name=="AttributeName")return{type:"attrName",from:r.from,context:s};if(r.name=="AttributeValue")return{type:"attrValue",from:r.from,context:s};let o=r==s||r.name=="Attribute"?r.childBefore(t):r;return o?.name=="StartTag"?{type:"openTag",from:t,context:JF(i)}:o?.name=="StartCloseTag"&&o.to<=t?{type:"closeTag",from:t,context:i}:o?.name=="Is"?{type:"attrValue",from:t,context:s}:o?{type:"attrName",from:t,context:s}:null}else if(r.name=="StartCloseTag")return{type:"closeTag",from:t,context:r.parent};for(;r.parent&&r.to==t&&!(!((n=r.lastChild)===null||n===void 0)&&n.type.isError);)r=r.parent;return r.name=="Element"||r.name=="Text"||r.name=="Document"?{type:"tag",from:t,context:r.name=="Element"?r:JF(r)}:null}let yQt=class{constructor(t,n,r){this.attrs=n,this.attrValues=r,this.children=[],this.name=t.name,this.completion=Object.assign(Object.assign({type:"type"},t.completion||{}),{label:this.name}),this.openCompletion=Object.assign(Object.assign({},this.completion),{label:"<"+this.name}),this.closeCompletion=Object.assign(Object.assign({},this.completion),{label:"</"+this.name+">",boost:2}),this.closeNameCompletion=Object.assign(Object.assign({},this.completion),{label:this.name+">"}),this.text=t.textContent?t.textContent.map(s=>({label:s,type:"text"})):[]}};const eY=/^[:\-\.\w\u00b7-\uffff]*$/;function QOe(e){return Object.assign(Object.assign({type:"property"},e.completion||{}),{label:e.name})}function DOe(e){return typeof e=="string"?{label:`"${e}"`,type:"constant"}:/^"/.test(e.label)?e:Object.assign(Object.assign({},e),{label:`"${e.label}"`})}function Mje(e,t){let n=[],r=[],s=Object.create(null);for(let c of t){let l=QOe(c);n.push(l),c.global&&r.push(l),c.values&&(s[c.name]=c.values.map(DOe))}let i=[],o=[],a=Object.create(null);for(let c of e){let l=r,d=s;c.attributes&&(l=l.concat(c.attributes.map(f=>typeof f=="string"?n.find(h=>h.label==f)||{label:f,type:"property"}:(f.values&&(d==s&&(d=Object.create(d)),d[f.name]=f.values.map(DOe)),QOe(f)))));let p=new yQt(c,l,d);a[p.name]=p,i.push(p),c.top&&o.push(p)}o.length||(o=i);for(let c=0;c<i.length;c++){let l=e[c],d=i[c];if(l.children)for(let p of l.children)a[p]&&d.children.push(a[p]);else d.children=i}return c=>{var l;let{doc:d}=c.state,p=bQt(c.state,c.pos);if(!p||p.type=="tag"&&!c.explicit)return null;let{type:f,from:h,context:m}=p;if(f=="openTag"){let O=o,_=KF(d,m);if(_){let b=a[_];O=b?.children||i}return{from:h,options:O.map(b=>b.completion),validFor:eY}}else if(f=="closeTag"){let O=KF(d,m);return O?{from:h,to:c.pos+(d.sliceString(c.pos,c.pos+1)==">"?1:0),options:[((l=a[O])===null||l===void 0?void 0:l.closeNameCompletion)||{label:O+">",type:"type"}],validFor:eY}:null}else if(f=="attrName"){let O=a[XQ(d,m)];return{from:h,options:O?.attrs||r,validFor:eY}}else if(f=="attrValue"){let O=_Qt(d,m,h);if(!O)return null;let _=a[XQ(d,m)],b=(_?.attrValues||s)[O];return!b||!b.length?null:{from:h,to:c.pos+(d.sliceString(c.pos,c.pos+1)=='"'?1:0),options:b,validFor:/^"[^"]*"?$/}}else if(f=="tag"){let O=KF(d,m),_=a[O],b=[],y=m&&m.lastChild;O&&(!y||y.name!="CloseTag"||XQ(d,y)!=O)&&b.push(_?_.closeCompletion:{label:"</"+O+">",type:"type",boost:2});let x=b.concat((_?.children||(m?i:o)).map(S=>S.openCompletion));if(m&&_?.text.length){let S=m.firstChild;S.to>c.pos-20&&!/\S/.test(c.state.sliceDoc(S.to,c.pos))&&(x=x.concat(_.text))}return{from:h,options:x,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}else return null}}const vL=mo.define({name:"xml",parser:gQt.configure({props:[_o.add({Element(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),bo.add({Element(e){let t=e.firstChild,n=e.lastChild;return!t||t.name!="OpenTag"?null:{from:t.to,to:n.name=="CloseTag"?n.from:e.to}}}),zre.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/$/}});function Qje(e={}){let t=[vL.data.of({autocomplete:Mje(e.elements||[],e.attributes||[])})];return e.autoCloseTags!==!1&&t.push(Dje),new qi(vL,t)}function LOe(e,t,n=e.length){if(!t)return"";let r=t.firstChild,s=r&&r.getChild("TagName");return s?e.sliceString(s.from,Math.min(s.to,n)):""}const Dje=Kt.inputHandler.of((e,t,n,r,s)=>{if(e.composing||e.state.readOnly||t!=n||r!=">"&&r!="/"||!vL.isActiveAt(e.state,t,-1))return!1;let i=s(),{state:o}=i,a=o.changeByRange(c=>{var l,d,p;let{head:f}=c,h=o.doc.sliceString(f-1,f)==r,m=rs(o).resolveInner(f,-1),O;if(h&&r==">"&&m.name=="EndTag"){let _=m.parent;if(((d=(l=_.parent)===null||l===void 0?void 0:l.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(O=LOe(o.doc,_.parent,f))){let b=f+(o.doc.sliceString(f,f+1)===">"?1:0),y=`</${O}>`;return{range:c,changes:{from:f,to:b,insert:y}}}}else if(h&&r=="/"&&m.name=="StartCloseTag"){let _=m.parent;if(m.from==f-2&&((p=_.lastChild)===null||p===void 0?void 0:p.name)!="CloseTag"&&(O=LOe(o.doc,_,f))){let b=f+(o.doc.sliceString(f,f+1)===">"?1:0),y=`${O}>`;return{range:ft.cursor(f+y.length,-1),changes:{from:f,to:b,insert:y}}}}return{range:c}});return a.changes.empty?!1:(e.dispatch([i,o.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),xQt=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:Dje,completeFromSchema:Mje,xml:Qje,xmlLanguage:vL},Symbol.toStringTag,{value:"Module"})),Gx=63,jOe=64,SQt=1,vQt=2,Lje=3,TQt=4,jje=5,EQt=6,wQt=7,Xje=65,kQt=66,CQt=8,RQt=9,PQt=10,$Qt=11,NQt=12,Uje=13,AQt=19,IQt=20,MQt=29,QQt=33,DQt=34,LQt=47,jQt=0,xse=1,sZ=2,KR=3,iZ=4;let v0=class{constructor(t,n,r){this.parent=t,this.depth=n,this.type=r,this.hash=(t?t.hash+t.hash<<8:0)+n+(n<<4)+r}};v0.top=new v0(null,-1,jQt);function tC(e,t){for(let n=0,r=t-e.pos-1;;r--,n++){let s=e.peek(r);if(vm(s)||s==-1)return n}}function oZ(e){return e==32||e==9}function vm(e){return e==10||e==13}function zje(e){return oZ(e)||vm(e)}function Q0(e){return e<0||zje(e)}const XQt=new Ny({start:v0.top,reduce(e,t){return e.type==KR&&(t==IQt||t==DQt)?e.parent:e},shift(e,t,n,r){if(t==Lje)return new v0(e,tC(r,r.pos),xse);if(t==Xje||t==jje)return new v0(e,tC(r,r.pos),sZ);if(t==Gx)return e.parent;if(t==AQt||t==QQt)return new v0(e,0,KR);if(t==Uje&&e.type==iZ)return e.parent;if(t==LQt){let s=/[1-9]/.exec(r.read(r.pos,n.pos));if(s)return new v0(e,e.depth+ +s[0],iZ)}return e},hash(e){return e.hash}});function uT(e,t,n=0){return e.peek(n)==t&&e.peek(n+1)==t&&e.peek(n+2)==t&&Q0(e.peek(n+3))}const UQt=new Vn((e,t)=>{if(e.next==-1&&t.canShift(jOe))return e.acceptToken(jOe);let n=e.peek(-1);if((vm(n)||n<0)&&t.context.type!=KR){if(uT(e,45))if(t.canShift(Gx))e.acceptToken(Gx);else return e.acceptToken(SQt,3);if(uT(e,46))if(t.canShift(Gx))e.acceptToken(Gx);else return e.acceptToken(vQt,3);let r=0;for(;e.next==32;)r++,e.advance();(r<t.context.depth||r==t.context.depth&&t.context.type==xse&&(e.next!=45||!Q0(e.peek(1))))&&e.next!=-1&&!vm(e.next)&&e.next!=35&&e.acceptToken(Gx,-r)}},{contextual:!0}),zQt=new Vn((e,t)=>{if(t.context.type==KR){e.next==63&&(e.advance(),Q0(e.next)&&e.acceptToken(wQt));return}if(e.next==45)e.advance(),Q0(e.next)&&e.acceptToken(t.context.type==xse&&t.context.depth==tC(e,e.pos-1)?TQt:Lje);else if(e.next==63)e.advance(),Q0(e.next)&&e.acceptToken(t.context.type==sZ&&t.context.depth==tC(e,e.pos-1)?EQt:jje);else{let n=e.pos;for(;;)if(oZ(e.next)){if(e.pos==n)return;e.advance()}else if(e.next==33)Bje(e);else if(e.next==38)aZ(e);else if(e.next==42){aZ(e);break}else if(e.next==39||e.next==34){if(Sse(e,!0))break;return}else if(e.next==91||e.next==123){if(!FQt(e))return;break}else{Fje(e,!0,!1,0);break}for(;oZ(e.next);)e.advance();if(e.next==58){if(e.pos==n&&t.canShift(MQt))return;let r=e.peek(1);Q0(r)&&e.acceptTokenTo(t.context.type==sZ&&t.context.depth==tC(e,n)?kQt:Xje,n)}}},{contextual:!0});function BQt(e){return e>32&&e<127&&e!=34&&e!=37&&e!=44&&e!=60&&e!=62&&e!=92&&e!=94&&e!=96&&e!=123&&e!=124&&e!=125}function XOe(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function UOe(e,t){return e.next==37?(e.advance(),XOe(e.next)&&e.advance(),XOe(e.next)&&e.advance(),!0):BQt(e.next)||t&&e.next==44?(e.advance(),!0):!1}function Bje(e){if(e.advance(),e.next==60){for(e.advance();;)if(!UOe(e,!0)){e.next==62&&e.advance();break}}else for(;UOe(e,!1););}function aZ(e){for(e.advance();!Q0(e.next)&&TL(e.next)!="f";)e.advance()}function Sse(e,t){let n=e.next,r=!1,s=e.pos;for(e.advance();;){let i=e.next;if(i<0)break;if(e.advance(),i==n)if(i==39)if(e.next==39)e.advance();else break;else break;else if(i==92&&n==34)e.next>=0&&e.advance();else if(vm(i)){if(t)return!1;r=!0}else if(t&&e.pos>=s+1024)return!1}return!r}function FQt(e){for(let t=[],n=e.pos+1024;;)if(e.next==91||e.next==123)t.push(e.next),e.advance();else if(e.next==39||e.next==34){if(!Sse(e,!0))return!1}else if(e.next==93||e.next==125){if(t[t.length-1]!=e.next-2)return!1;if(t.pop(),e.advance(),!t.length)return!0}else{if(e.next<0||e.pos>n||vm(e.next))return!1;e.advance()}}const YQt="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function TL(e){return e<33?"u":e>125?"s":YQt[e-33]}function tY(e,t){let n=TL(e);return n!="u"&&!(t&&n=="f")}function Fje(e,t,n,r){if(TL(e.next)=="s"||(e.next==63||e.next==58||e.next==45)&&tY(e.peek(1),n))e.advance();else return!1;let s=e.pos;for(;;){let i=e.next,o=0,a=r+1;for(;zje(i);){if(vm(i)){if(t)return!1;a=0}else a++;i=e.peek(++o)}if(!(i>=0&&(i==58?tY(e.peek(o+1),n):i==35?e.peek(o-1)!=32:tY(i,n)))||!n&&a<=r||a==0&&!n&&(uT(e,45,o)||uT(e,46,o)))break;if(t&&TL(i)=="f")return!1;for(let l=o;l>=0;l--)e.advance();if(t&&e.pos>s+1024)return!1}return!0}const VQt=new Vn((e,t)=>{if(e.next==33)Bje(e),e.acceptToken(NQt);else if(e.next==38||e.next==42){let n=e.next==38?PQt:$Qt;aZ(e),e.acceptToken(n)}else e.next==39||e.next==34?(Sse(e,!1),e.acceptToken(RQt)):Fje(e,!1,t.context.type==KR,t.context.depth)&&e.acceptToken(CQt)}),qQt=new Vn((e,t)=>{let n=t.context.type==iZ?t.context.depth:-1,r=e.pos;e:for(;;){let s=0,i=e.next;for(;i==32;)i=e.peek(++s);if(!s&&(uT(e,45,s)||uT(e,46,s))||!vm(i)&&(n<0&&(n=Math.max(t.context.depth+1,s)),s<n))break;for(;;){if(e.next<0)break e;let o=vm(e.next);if(e.advance(),o)continue e;r=e.pos}}e.acceptTokenTo(Uje,r)}),WQt=go({DirectiveName:X.keyword,DirectiveContent:X.attributeValue,"DirectiveEnd DocEnd":X.meta,QuotedLiteral:X.string,BlockLiteralHeader:X.special(X.string),BlockLiteralContent:X.content,Literal:X.content,"Key/Literal Key/QuotedLiteral":X.definition(X.propertyName),"Anchor Alias":X.labelName,Tag:X.typeName,Comment:X.lineComment,": , -":X.separator,"?":X.punctuation,"[ ]":X.squareBracket,"{ }":X.brace}),GQt=ho.deserialize({version:14,states:"5lQ!ZQgOOO#PQfO'#CpO#uQfO'#DOOOQR'#Dv'#DvO$qQgO'#DRO%gQ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!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm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%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[UQt,zQt,VQt,qQt,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),HQt=ho.deserialize({version:14,states:"!vOQOPOOO]OPO'#C_OhOPO'#C^OOOO'#Cc'#CcOpOPO'#CaQOOOOOO{OPOOOOOO'#Cb'#CbO!WOPO'#C`O!`OPO,58xOOOO-E6a-E6aOOOO-E6`-E6`OOOO'#C_'#C_OOOO1G.d1G.d",stateData:"!h~OXPOYROWTP~OWVXXRXYRX~OYVOXSP~OXROYROWTX~OXROYROWTP~OYVOXSX~OX[O~OXY~",goto:"vWPPX[beioRUOQQOR]XRXQTTOUQWQRZWSSOURYS",nodeNames:"⚠ Document Frontmatter DashLine FrontmatterContent Body",maxTerm:10,skippedNodes:[0],repeatNodeCount:2,tokenData:"$z~RXOYnYZ!^Z]n]^!^^}n}!O!i!O;'Sn;'S;=`!c<%lOn~qXOYnYZ!^Z]n]^!^^;'Sn;'S;=`!c<%l~n~On~~!^~!cOY~~!fP;=`<%ln~!lZOYnYZ!^Z]n]^!^^}n}!O#_!O;'Sn;'S;=`!c<%l~n~On~~!^~#bZOYnYZ!^Z]n]^!^^}n}!O$T!O;'Sn;'S;=`!c<%l~n~On~~!^~$WXOYnYZ$sZ]n]^$s^;'Sn;'S;=`!c<%l~n~On~~$s~$zOX~Y~",tokenizers:[0],topRules:{Document:[0,1]},tokenPrec:67}),vse=mo.define({name:"yaml",parser:GQt.configure({props:[_o.add({Stream:e=>{for(let t=e.node.resolve(e.pos,-1);t&&t.to>=e.pos;t=t.parent){if(t.name=="BlockLiteralContent"&&t.from<t.to)return e.baseIndentFor(t);if(t.name=="BlockLiteral")return e.baseIndentFor(t)+e.unit;if(t.name=="BlockSequence"||t.name=="BlockMapping")return e.column(t.from,1);if(t.name=="QuotedLiteral")return null;if(t.name=="Literal"){let n=e.column(t.from,1);if(n==e.lineIndent(t.from,1))return n;if(t.to>e.pos)return null}}return null},FlowMapping:_f({closing:"}"}),FlowSequence:_f({closing:"]"})}),bo.add({"FlowMapping FlowSequence":td,"Item Pair BlockLiteral":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function Yje(){return new qi(vse)}const ZQt=mo.define({name:"yaml-frontmatter",parser:HQt.configure({props:[go({DashLine:X.meta})]})});function KQt(e){let{language:t,support:n}=e.content instanceof qi?e.content:{language:e.content,support:[]};return new qi(ZQt.configure({wrap:MU(r=>r.name=="FrontmatterContent"?{parser:vse.parser}:r.name=="Body"?{parser:t.parser}:null)}),n)}const JQt=Object.freeze(Object.defineProperty({__proto__:null,yaml:Yje,yamlFrontmatter:KQt,yamlLanguage:vse},Symbol.toStringTag,{value:"Module"}));function pt(e){return new qi(Bre.define(e))}function lO(e){return Me(()=>Promise.resolve().then(()=>JMt),void 0).then(t=>t.sql({dialect:t[e]}))}const e2t=[qe.of({name:"C",extensions:["c","h","ino"],load(){return Me(()=>Promise.resolve().then(()=>dme),void 0).then(e=>e.cpp())}}),qe.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return Me(()=>Promise.resolve().then(()=>dme),void 0).then(e=>e.cpp())}}),qe.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return lO("Cassandra")}}),qe.of({name:"CSS",extensions:["css"],load(){return Me(()=>Promise.resolve().then(()=>Kkt),void 0).then(e=>e.css())}}),qe.of({name:"Go",extensions:["go"],load(){return Me(()=>Promise.resolve().then(()=>FCt),void 0).then(e=>e.go())}}),qe.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return Me(()=>Promise.resolve().then(()=>yPt),void 0).then(e=>e.html())}}),qe.of({name:"Java",extensions:["java"],load(){return Me(()=>Promise.resolve().then(()=>TPt),void 0).then(e=>e.java())}}),qe.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return Me(()=>Promise.resolve().then(()=>sI),void 0).then(e=>e.javascript())}}),qe.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return Me(()=>import("./index-C-G8_qWC.js"),__vite__mapDeps([0,1])).then(e=>e.jinja())}}),qe.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return Me(()=>Promise.resolve().then(()=>RPt),void 0).then(e=>e.json())}}),qe.of({name:"JSX",extensions:["jsx"],load(){return Me(()=>Promise.resolve().then(()=>sI),void 0).then(e=>e.javascript({jsx:!0}))}}),qe.of({name:"LESS",extensions:["less"],load(){return Me(()=>Promise.resolve().then(()=>XPt),void 0).then(e=>e.less())}}),qe.of({name:"Liquid",extensions:["liquid"],load(){return Me(()=>import("./index-CxkxUGEC.js"),__vite__mapDeps([2,1])).then(e=>e.liquid())}}),qe.of({name:"MariaDB SQL",load(){return lO("MariaSQL")}}),qe.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return Me(()=>Promise.resolve().then(()=>v$t),void 0).then(e=>e.markdown())}}),qe.of({name:"MS SQL",load(){return lO("MSSQL")}}),qe.of({name:"MySQL",load(){return lO("MySQL")}}),qe.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return Me(()=>Promise.resolve().then(()=>qNt),void 0).then(e=>e.php())}}),qe.of({name:"PLSQL",extensions:["pls"],load(){return lO("PLSQL")}}),qe.of({name:"PostgreSQL",load(){return lO("PostgreSQL")}}),qe.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return Me(()=>Promise.resolve().then(()=>aIt),void 0).then(e=>e.python())}}),qe.of({name:"Rust",extensions:["rs"],load(){return Me(()=>Promise.resolve().then(()=>kIt),void 0).then(e=>e.rust())}}),qe.of({name:"Sass",extensions:["sass"],load(){return Me(()=>Promise.resolve().then(()=>SOe),void 0).then(e=>e.sass({indented:!0}))}}),qe.of({name:"SCSS",extensions:["scss"],load(){return Me(()=>Promise.resolve().then(()=>SOe),void 0).then(e=>e.sass())}}),qe.of({name:"SQL",extensions:["sql"],load(){return lO("StandardSQL")}}),qe.of({name:"SQLite",load(){return lO("SQLite")}}),qe.of({name:"TSX",extensions:["tsx"],load(){return Me(()=>Promise.resolve().then(()=>sI),void 0).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),qe.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return Me(()=>Promise.resolve().then(()=>sI),void 0).then(e=>e.javascript({typescript:!0}))}}),qe.of({name:"WebAssembly",extensions:["wat","wast"],load(){return Me(()=>import("./index-B0vke9OS.js"),__vite__mapDeps([3,1])).then(e=>e.wast())}}),qe.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return Me(()=>Promise.resolve().then(()=>xQt),void 0).then(e=>e.xml())}}),qe.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return Me(()=>Promise.resolve().then(()=>JQt),void 0).then(e=>e.yaml())}}),qe.of({name:"APL",extensions:["dyalog","apl"],load(){return Me(()=>import("./apl-B4CMkyY2.js"),[]).then(e=>pt(e.apl))}}),qe.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return Me(()=>import("./asciiarmor-Df11BRmG.js"),[]).then(e=>pt(e.asciiArmor))}}),qe.of({name:"ASN.1",extensions:["asn","asn1"],load(){return Me(()=>import("./asn1-EdZsLKOL.js"),[]).then(e=>pt(e.asn1({})))}}),qe.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return Me(()=>import("./asterisk-B-8jnY81.js"),[]).then(e=>pt(e.asterisk))}}),qe.of({name:"Brainfuck",extensions:["b","bf"],load(){return Me(()=>import("./brainfuck-C4LP7Hcl.js"),[]).then(e=>pt(e.brainfuck))}}),qe.of({name:"Cobol",extensions:["cob","cpy"],load(){return Me(()=>import("./cobol-CWcv1MsR.js"),[]).then(e=>pt(e.cobol))}}),qe.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return Me(()=>import("./clike-B9uivgTg.js"),[]).then(e=>pt(e.csharp))}}),qe.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return Me(()=>import("./clojure-BMjYHr_A.js"),[]).then(e=>pt(e.clojure))}}),qe.of({name:"ClojureScript",extensions:["cljs"],load(){return Me(()=>import("./clojure-BMjYHr_A.js"),[]).then(e=>pt(e.clojure))}}),qe.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return Me(()=>import("./css-BnMrqG3P.js"),[]).then(e=>pt(e.gss))}}),qe.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return Me(()=>import("./cmake-BQqOBYOt.js"),[]).then(e=>pt(e.cmake))}}),qe.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return Me(()=>import("./coffeescript-S37ZYGWr.js"),[]).then(e=>pt(e.coffeeScript))}}),qe.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return Me(()=>import("./commonlisp-DBKNyK5s.js"),[]).then(e=>pt(e.commonLisp))}}),qe.of({name:"Cypher",extensions:["cyp","cypher"],load(){return Me(()=>import("./cypher-C_CwsFkJ.js"),[]).then(e=>pt(e.cypher))}}),qe.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return Me(()=>import("./python-BuPzkPfP.js"),[]).then(e=>pt(e.cython))}}),qe.of({name:"Crystal",extensions:["cr"],load(){return Me(()=>import("./crystal-SjHAIU92.js"),[]).then(e=>pt(e.crystal))}}),qe.of({name:"D",extensions:["d"],load(){return Me(()=>import("./d-pRatUO7H.js"),[]).then(e=>pt(e.d))}}),qe.of({name:"Dart",extensions:["dart"],load(){return Me(()=>import("./clike-B9uivgTg.js"),[]).then(e=>pt(e.dart))}}),qe.of({name:"diff",extensions:["diff","patch"],load(){return Me(()=>import("./diff-DbItnlRl.js"),[]).then(e=>pt(e.diff))}}),qe.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return Me(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([4,5])).then(e=>pt(e.dockerFile))}}),qe.of({name:"DTD",extensions:["dtd"],load(){return Me(()=>import("./dtd-DF_7sFjM.js"),[]).then(e=>pt(e.dtd))}}),qe.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return Me(()=>import("./dylan-DwRh75JA.js"),[]).then(e=>pt(e.dylan))}}),qe.of({name:"EBNF",load(){return Me(()=>import("./ebnf-CDyGwa7X.js"),[]).then(e=>pt(e.ebnf))}}),qe.of({name:"ECL",extensions:["ecl"],load(){return Me(()=>import("./ecl-Cabwm37j.js"),[]).then(e=>pt(e.ecl))}}),qe.of({name:"edn",extensions:["edn"],load(){return Me(()=>import("./clojure-BMjYHr_A.js"),[]).then(e=>pt(e.clojure))}}),qe.of({name:"Eiffel",extensions:["e"],load(){return Me(()=>import("./eiffel-CnydiIhH.js"),[]).then(e=>pt(e.eiffel))}}),qe.of({name:"Elm",extensions:["elm"],load(){return Me(()=>import("./elm-vLlmbW-K.js"),[]).then(e=>pt(e.elm))}}),qe.of({name:"Erlang",extensions:["erl"],load(){return Me(()=>import("./erlang-BNw1qcRV.js"),[]).then(e=>pt(e.erlang))}}),qe.of({name:"Esper",load(){return Me(()=>import("./sql-D0XecflT.js"),[]).then(e=>pt(e.esper))}}),qe.of({name:"Factor",extensions:["factor"],load(){return Me(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([6,5])).then(e=>pt(e.factor))}}),qe.of({name:"FCL",load(){return Me(()=>import("./fcl-Kvtd6kyn.js"),[]).then(e=>pt(e.fcl))}}),qe.of({name:"Forth",extensions:["forth","fth","4th"],load(){return Me(()=>import("./forth-Ffai-XNe.js"),[]).then(e=>pt(e.forth))}}),qe.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return Me(()=>import("./fortran-DYz_wnZ1.js"),[]).then(e=>pt(e.fortran))}}),qe.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return Me(()=>import("./mllike-CXdrOF99.js"),[]).then(e=>pt(e.fSharp))}}),qe.of({name:"Gas",extensions:["s"],load(){return Me(()=>import("./gas-Bneqetm1.js"),[]).then(e=>pt(e.gas))}}),qe.of({name:"Gherkin",extensions:["feature"],load(){return Me(()=>import("./gherkin-heZmZLOM.js"),[]).then(e=>pt(e.gherkin))}}),qe.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return Me(()=>import("./groovy-D9Dt4D0W.js"),[]).then(e=>pt(e.groovy))}}),qe.of({name:"Haskell",extensions:["hs"],load(){return Me(()=>import("./haskell-BWDZoCOh.js"),[]).then(e=>pt(e.haskell))}}),qe.of({name:"Haxe",extensions:["hx"],load(){return Me(()=>import("./haxe-H-WmDvRZ.js"),[]).then(e=>pt(e.haxe))}}),qe.of({name:"HXML",extensions:["hxml"],load(){return Me(()=>import("./haxe-H-WmDvRZ.js"),[]).then(e=>pt(e.hxml))}}),qe.of({name:"HTTP",load(){return Me(()=>import("./http-DBlCnlav.js"),[]).then(e=>pt(e.http))}}),qe.of({name:"IDL",extensions:["pro"],load(){return Me(()=>import("./idl-BEugSyMb.js"),[]).then(e=>pt(e.idl))}}),qe.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return Me(()=>import("./javascript-qCveANmP.js"),[]).then(e=>pt(e.jsonld))}}),qe.of({name:"Julia",extensions:["jl"],load(){return Me(()=>import("./julia-DuME0IfC.js"),[]).then(e=>pt(e.julia))}}),qe.of({name:"Kotlin",extensions:["kt","kts"],load(){return Me(()=>import("./clike-B9uivgTg.js"),[]).then(e=>pt(e.kotlin))}}),qe.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return Me(()=>import("./livescript-BwQOo05w.js"),[]).then(e=>pt(e.liveScript))}}),qe.of({name:"Lua",extensions:["lua"],load(){return Me(()=>import("./lua-BgMRiT3U.js"),[]).then(e=>pt(e.lua))}}),qe.of({name:"mIRC",extensions:["mrc"],load(){return Me(()=>import("./mirc-CjQqDB4T.js"),[]).then(e=>pt(e.mirc))}}),qe.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return Me(()=>import("./mathematica-DTrFuWx2.js"),[]).then(e=>pt(e.mathematica))}}),qe.of({name:"Modelica",extensions:["mo"],load(){return Me(()=>import("./modelica-Dc1JOy9r.js"),[]).then(e=>pt(e.modelica))}}),qe.of({name:"MUMPS",extensions:["mps"],load(){return Me(()=>import("./mumps-BT43cFF4.js"),[]).then(e=>pt(e.mumps))}}),qe.of({name:"Mbox",extensions:["mbox"],load(){return Me(()=>import("./mbox-CNhZ1qSd.js"),[]).then(e=>pt(e.mbox))}}),qe.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return Me(()=>import("./nginx-DdIZxoE0.js"),[]).then(e=>pt(e.nginx))}}),qe.of({name:"NSIS",extensions:["nsh","nsi"],load(){return Me(()=>import("./nsis-LdVXkNf5.js"),__vite__mapDeps([7,5])).then(e=>pt(e.nsis))}}),qe.of({name:"NTriples",extensions:["nt","nq"],load(){return Me(()=>import("./ntriples-BfvgReVJ.js"),[]).then(e=>pt(e.ntriples))}}),qe.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return Me(()=>import("./clike-B9uivgTg.js"),[]).then(e=>pt(e.objectiveC))}}),qe.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return Me(()=>import("./clike-B9uivgTg.js"),[]).then(e=>pt(e.objectiveCpp))}}),qe.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return Me(()=>import("./mllike-CXdrOF99.js"),[]).then(e=>pt(e.oCaml))}}),qe.of({name:"Octave",extensions:["m"],load(){return Me(()=>import("./octave-Ck1zUtKM.js"),[]).then(e=>pt(e.octave))}}),qe.of({name:"Oz",extensions:["oz"],load(){return Me(()=>import("./oz-BzwKVEFT.js"),[]).then(e=>pt(e.oz))}}),qe.of({name:"Pascal",extensions:["p","pas"],load(){return Me(()=>import("./pascal--L3eBynH.js"),[]).then(e=>pt(e.pascal))}}),qe.of({name:"Perl",extensions:["pl","pm"],load(){return Me(()=>import("./perl-CdXCOZ3F.js"),[]).then(e=>pt(e.perl))}}),qe.of({name:"Pig",extensions:["pig"],load(){return Me(()=>import("./pig-CevX1Tat.js"),[]).then(e=>pt(e.pig))}}),qe.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return Me(()=>import("./powershell-CFHJl5sT.js"),[]).then(e=>pt(e.powerShell))}}),qe.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return Me(()=>import("./properties-C78fOPTZ.js"),[]).then(e=>pt(e.properties))}}),qe.of({name:"ProtoBuf",extensions:["proto"],load(){return Me(()=>import("./protobuf-ChK-085T.js"),[]).then(e=>pt(e.protobuf))}}),qe.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return Me(()=>import("./pug-DukmZTjD.js"),__vite__mapDeps([8,9])).then(e=>pt(e.pug))}}),qe.of({name:"Puppet",extensions:["pp"],load(){return Me(()=>import("./puppet-DMA9R1ak.js"),[]).then(e=>pt(e.puppet))}}),qe.of({name:"Q",extensions:["q"],load(){return Me(()=>import("./q-pXgVlZs6.js"),[]).then(e=>pt(e.q))}}),qe.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return Me(()=>import("./r-DUYO_cvP.js"),[]).then(e=>pt(e.r))}}),qe.of({name:"RPM Changes",load(){return Me(()=>import("./rpm-CTu-6PCP.js"),[]).then(e=>pt(e.rpmChanges))}}),qe.of({name:"RPM Spec",extensions:["spec"],load(){return Me(()=>import("./rpm-CTu-6PCP.js"),[]).then(e=>pt(e.rpmSpec))}}),qe.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return Me(()=>import("./ruby-B2Rjki9n.js"),[]).then(e=>pt(e.ruby))}}),qe.of({name:"SAS",extensions:["sas"],load(){return Me(()=>import("./sas-B4kiWyti.js"),[]).then(e=>pt(e.sas))}}),qe.of({name:"Scala",extensions:["scala"],load(){return Me(()=>import("./clike-B9uivgTg.js"),[]).then(e=>pt(e.scala))}}),qe.of({name:"Scheme",extensions:["scm","ss"],load(){return Me(()=>import("./scheme-C41bIUwD.js"),[]).then(e=>pt(e.scheme))}}),qe.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return Me(()=>import("./shell-CjFT_Tl9.js"),[]).then(e=>pt(e.shell))}}),qe.of({name:"Sieve",extensions:["siv","sieve"],load(){return Me(()=>import("./sieve-C3Gn_uJK.js"),[]).then(e=>pt(e.sieve))}}),qe.of({name:"Smalltalk",extensions:["st"],load(){return Me(()=>import("./smalltalk-CnHTOXQT.js"),[]).then(e=>pt(e.smalltalk))}}),qe.of({name:"Solr",load(){return Me(()=>import("./solr-DehyRSwq.js"),[]).then(e=>pt(e.solr))}}),qe.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return Me(()=>import("./mllike-CXdrOF99.js"),[]).then(e=>pt(e.sml))}}),qe.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return Me(()=>import("./sparql-DkYu6x3z.js"),[]).then(e=>pt(e.sparql))}}),qe.of({name:"Spreadsheet",alias:["excel","formula"],load(){return Me(()=>import("./spreadsheet-BCZA_wO0.js"),[]).then(e=>pt(e.spreadsheet))}}),qe.of({name:"Squirrel",extensions:["nut"],load(){return Me(()=>import("./clike-B9uivgTg.js"),[]).then(e=>pt(e.squirrel))}}),qe.of({name:"Stylus",extensions:["styl"],load(){return Me(()=>import("./stylus-B533Al4x.js"),[]).then(e=>pt(e.stylus))}}),qe.of({name:"Swift",extensions:["swift"],load(){return Me(()=>import("./swift-BzpIVaGY.js"),[]).then(e=>pt(e.swift))}}),qe.of({name:"sTeX",load(){return Me(()=>import("./stex-C3f8Ysf7.js"),[]).then(e=>pt(e.stex))}}),qe.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return Me(()=>import("./stex-C3f8Ysf7.js"),[]).then(e=>pt(e.stex))}}),qe.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return Me(()=>import("./verilog-C6RDOZhf.js"),[]).then(e=>pt(e.verilog))}}),qe.of({name:"Tcl",extensions:["tcl"],load(){return Me(()=>import("./tcl-DVfN8rqt.js"),[]).then(e=>pt(e.tcl))}}),qe.of({name:"Textile",extensions:["textile"],load(){return Me(()=>import("./textile-CnDTJFAw.js"),[]).then(e=>pt(e.textile))}}),qe.of({name:"TiddlyWiki",load(){return Me(()=>import("./tiddlywiki-DO-Gjzrf.js"),[]).then(e=>pt(e.tiddlyWiki))}}),qe.of({name:"Tiki wiki",load(){return Me(()=>import("./tiki-DGYXhP31.js"),[]).then(e=>pt(e.tiki))}}),qe.of({name:"TOML",extensions:["toml"],load(){return Me(()=>import("./toml-Bm5Em-hy.js"),[]).then(e=>pt(e.toml))}}),qe.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return Me(()=>import("./troff-wAsdV37c.js"),[]).then(e=>pt(e.troff))}}),qe.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return Me(()=>import("./ttcn-CfJYG6tj.js"),[]).then(e=>pt(e.ttcn))}}),qe.of({name:"TTCN_CFG",extensions:["cfg"],load(){return Me(()=>import("./ttcn-cfg-B9xdYoR4.js"),[]).then(e=>pt(e.ttcnCfg))}}),qe.of({name:"Turtle",extensions:["ttl"],load(){return Me(()=>import("./turtle-B1tBg_DP.js"),[]).then(e=>pt(e.turtle))}}),qe.of({name:"Web IDL",extensions:["webidl"],load(){return Me(()=>import("./webidl-ZXfAyPTL.js"),[]).then(e=>pt(e.webIDL))}}),qe.of({name:"VB.NET",extensions:["vb"],load(){return Me(()=>import("./vb-CmGdzxic.js"),[]).then(e=>pt(e.vb))}}),qe.of({name:"VBScript",extensions:["vbs"],load(){return Me(()=>import("./vbscript-BuJXcnF6.js"),[]).then(e=>pt(e.vbScript))}}),qe.of({name:"Velocity",extensions:["vtl"],load(){return Me(()=>import("./velocity-D8B20fx6.js"),[]).then(e=>pt(e.velocity))}}),qe.of({name:"Verilog",extensions:["v"],load(){return Me(()=>import("./verilog-C6RDOZhf.js"),[]).then(e=>pt(e.verilog))}}),qe.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return Me(()=>import("./vhdl-lSbBsy5d.js"),[]).then(e=>pt(e.vhdl))}}),qe.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return Me(()=>import("./xquery-CQfU5ijd.js"),[]).then(e=>pt(e.xQuery))}}),qe.of({name:"Yacas",extensions:["ys"],load(){return Me(()=>import("./yacas-BJ4BC0dw.js"),[]).then(e=>pt(e.yacas))}}),qe.of({name:"Z80",extensions:["z80"],load(){return Me(()=>import("./z80-Hz9HOZM7.js"),[]).then(e=>pt(e.z80))}}),qe.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return Me(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(e=>pt(e.mscgen))}}),qe.of({name:"Xù",extensions:["xu"],load(){return Me(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(e=>pt(e.xu))}}),qe.of({name:"MsGenny",extensions:["msgenny"],load(){return Me(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(e=>pt(e.msgenny))}}),qe.of({name:"Vue",extensions:["vue"],load(){return Me(()=>import("./index-DTOb68GH.js"),__vite__mapDeps([10,1])).then(e=>e.vue())}}),qe.of({name:"Angular Template",load(){return Me(()=>import("./index-Bc8Snhtz.js"),__vite__mapDeps([11,1])).then(e=>e.angular())}})];function Vje(e){const t=e.split(".").pop()?.toLowerCase();switch(t){case"ts":case"tsx":case"js":case"jsx":case"mjs":case"cjs":return ise({jsx:t==="tsx"||t==="jsx",typescript:t==="ts"||t==="tsx"});case"py":return Oje();case"json":case"jsonl":return O5e();case"css":return qre();case"scss":return Z7({indented:!1});case"sass":return Z7({indented:!0});case"less":return b5e();case"html":case"htm":return KU();case"xml":case"svg":return Qje();case"md":case"mdx":case"markdown":return J5e();case"yaml":case"yml":return Yje();case"rs":return _je();case"go":return MLe();case"java":return h5e();case"c":case"h":case"cpp":case"cxx":case"cc":case"hpp":return xLe();case"php":return rje();case"sql":return $je();default:return null}}function oZn(e){return qe.matchFilename(e2t,e)}function nY(e){const t=e.split(".").pop()?.toLowerCase();return{ts:"TypeScript",tsx:"TypeScript (JSX)",js:"JavaScript",jsx:"JavaScript (JSX)",mjs:"JavaScript",cjs:"JavaScript",py:"Python",json:"JSON",jsonl:"JSON Lines",css:"CSS",scss:"SCSS",sass:"Sass",less:"Less",html:"HTML",htm:"HTML",xml:"XML",svg:"SVG",md:"Markdown",mdx:"MDX",markdown:"Markdown",yaml:"YAML",yml:"YAML",rs:"Rust",go:"Go",java:"Java",c:"C",h:"C/C++ Header",cpp:"C++",cxx:"C++",cc:"C++",hpp:"C++ Header",php:"PHP",sql:"SQL",sh:"Shell",bash:"Bash",zsh:"Zsh",toml:"TOML",ini:"INI",conf:"Config",txt:"Plain Text"}[t??""]??"Plain Text"}let bp=null,V_=null,fx=null;const kp={register(e,t,n){bp=e,V_=t,fx=n},unregister(){bp=null,V_=null,fx=null},get isRegistered(){return bp!==null},getContent(e){return bp?.get(e)?.doc.toString()??null},getAllModifiedContent(e){const t=new Map;for(const n of Object.keys(e)){if(!e[n])continue;const r=bp?.get(n)?.doc.toString();r!==void 0&&t.set(n,r)}return t},deleteState(e){bp?.delete(e),V_?.delete(e)},destroy(){fx?.destroy(),bp?.clear(),V_?.clear(),fx=null},remapState(e,t){const n=bp?.get(e);n&&(bp.delete(e),bp.set(t,n));const r=V_?.get(e);r!==void 0&&(V_.delete(e),V_.set(t,r))},updateView(e){fx=e},getView(){return fx}},t2t=1e4;let nC=null;const lZ=new Set;function n2t(e){return lZ.add(e),()=>lZ.delete(e)}function r2t(){nC=null,lZ.forEach(e=>e())}function Vw(e){return nC?.projectPath===e&&Date.now()-nC.timestamp<t2t?{files:nC.files}:null}function qje(e,t){nC={files:t,projectPath:e,timestamp:Date.now()}}function uI(e){if(e.length===0)return e;if(e.length===1){const r=e[0];return r.disambiguatedLabel===void 0?e:[{...r,disambiguatedLabel:void 0}]}const t=new Map;for(const r of e){const s=t.get(r.fileName);s?s.push(r):t.set(r.fileName,[r])}const n=new Map;for(const[,r]of t){if(r.length<=1){for(const a of r)n.set(a.id,void 0);continue}const s=r.map(a=>{const c=el(a.filePath);return c.pop(),c});let i=1;const o=Math.max(...s.map(a=>a.length));for(;i<=o;){const a=s.map(l=>{const d=Math.max(0,l.length-i);return l.slice(d).join("/")});if(new Set(a).size===a.length){for(let l=0;l<r.length;l++)n.set(r[l].id,`(${a[l]})`);break}i++}if(i>o)for(let a=0;a<r.length;a++){const c=s[a].join("/");n.set(r[a].id,`(${c})`)}}return e.map(r=>{const s=n.get(r.id);return s===r.disambiguatedLabel?r:{...r,disambiguatedLabel:s}})}const _s=Hi("Store:editor");function li(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}const od=new Map,s2t=2e3;let rY=null;const i2t=1500,sY=new Map,o2t=350;let iY=null,dI={change:0,create:0,delete:0},D0=null,EL="",L0=null,wL="";const a2t=250,l2t=120;function R1(e){const t=e();if(!t.editorWatcherEnabled)return;const n=t.editorProjectPath;if(!n)return;const r=t.editorOpenTabs.map(i=>i.filePath).filter(Boolean);r.sort((i,o)=>i.localeCompare(o));const s=`${n}
1037
+ `;function Eje(e,t,n){let r=Object.create(null);r.true=r.false=uMt,r.null=r.unknown=dMt;for(let s of e.split(" "))s&&(r[s]=vje);for(let s of t.split(" "))s&&(r[s]=Tje);for(let s of(n||"").split(" "))s&&(r[s]=EMt);return r}const Ay="array binary bit boolean char character clob date decimal double float int integer interval large national nchar nclob numeric object precision real smallint time timestamp varchar varying ",Iy="absolute action add after all allocate alter and any are as asc assertion at authorization before begin between both breadth by call cascade cascaded case cast catalog check close collate collation column commit condition connect connection constraint constraints constructor continue corresponding count create cross cube current current_date current_default_transform_group current_transform_group_for_type current_path current_role current_time current_timestamp current_user cursor cycle data day deallocate declare default deferrable deferred delete depth deref desc describe descriptor deterministic diagnostics disconnect distinct do domain drop dynamic each else elseif end end-exec equals escape except exception exec execute exists exit external fetch first for foreign found from free full function general get global go goto grant group grouping handle having hold hour identity if immediate in indicator initially inner inout input insert intersect into is isolation join key language last lateral leading leave left level like limit local localtime localtimestamp locator loop map match method minute modifies module month names natural nesting new next no none not of old on only open option or order ordinality out outer output overlaps pad parameter partial path prepare preserve primary prior privileges procedure public read reads recursive redo ref references referencing relative release repeat resignal restrict result return returns revoke right role rollback rollup routine row rows savepoint schema scroll search second section select session session_user set sets signal similar size some space specific specifictype sql sqlexception sqlstate sqlwarning start state static system_user table temporary then timezone_hour timezone_minute to trailing transaction translation treat trigger under undo union unique unnest until update usage user using value values view when whenever where while with without work write year zone ",eZ={backslashEscapes:!1,hashComments:!1,spaceAfterDashes:!1,slashComments:!1,doubleQuotedStrings:!1,doubleDollarQuotedStrings:!1,unquotedBitLiterals:!1,treatBitsAsBytes:!1,charSetCasts:!1,plsqlQuotingMechanism:!1,operatorChars:"*+-%<>!=&|~^/",specialVar:"?",identifierQuotes:'"',caseInsensitiveIdentifiers:!1,words:Eje(Iy,Ay)};function PMt(e,t,n,r){let s={};for(let i in eZ)s[i]=(e.hasOwnProperty(i)?e:eZ)[i];return t&&(s.words=Eje(t,n||"",r)),s}function wje(e){return new Vn(t=>{var n;let{next:r}=t;if(t.advance(),Y_(r,ZF)){for(;Y_(t.next,ZF);)t.advance();t.acceptToken(lMt)}else if(r==36&&e.doubleDollarQuotedStrings){let s=J7(t,"");t.next==36&&(t.advance(),kMt(t,s),t.acceptToken(px))}else if(r==39||r==34&&e.doubleQuotedStrings)u0(t,r,e.backslashEscapes),t.acceptToken(px);else if(r==35&&e.hashComments||r==47&&t.next==47&&e.slashComments)COe(t),t.acceptToken(vOe);else if(r==45&&t.next==45&&(!e.spaceAfterDashes||t.peek(1)==32))COe(t),t.acceptToken(vOe);else if(r==47&&t.next==42){t.advance();for(let s=1;;){let i=t.next;if(t.next<0)break;if(t.advance(),i==42&&t.next==47){if(s--,t.advance(),!s)break}else i==47&&t.next==42&&(s++,t.advance())}t.acceptToken(cMt)}else if((r==101||r==69)&&t.next==39)t.advance(),u0(t,39,!0),t.acceptToken(px);else if((r==110||r==78)&&t.next==39&&e.charSetCasts)t.advance(),u0(t,39,e.backslashEscapes),t.acceptToken(px);else if(r==95&&e.charSetCasts)for(let s=0;;s++){if(t.next==39&&s>1){t.advance(),u0(t,39,e.backslashEscapes),t.acceptToken(px);break}if(!K7(t.next))break;t.advance()}else if(e.plsqlQuotingMechanism&&(r==113||r==81)&&t.next==39&&t.peek(1)>0&&!Y_(t.peek(1),ZF)){let s=t.peek(1);t.advance(2),CMt(t,s),t.acceptToken(px)}else if(Y_(r,e.identifierQuotes)){const s=r==91?93:r;u0(t,s,!1),t.acceptToken(vMt)}else if(r==40)t.acceptToken(pMt);else if(r==41)t.acceptToken(fMt);else if(r==123)t.acceptToken(hMt);else if(r==125)t.acceptToken(mMt);else if(r==91)t.acceptToken(OMt);else if(r==93)t.acceptToken(gMt);else if(r==59)t.acceptToken(_Mt);else if(e.unquotedBitLiterals&&r==48&&t.next==98)t.advance(),wOe(t),t.acceptToken(EOe);else if((r==98||r==66)&&(t.next==39||t.next==34)){const s=t.next;t.advance(),e.treatBitsAsBytes?(u0(t,s,e.backslashEscapes),t.acceptToken(TMt)):(wOe(t,s),t.acceptToken(EOe))}else if(r==48&&(t.next==120||t.next==88)||(r==120||r==88)&&t.next==39){let s=t.next==39;for(t.advance();wMt(t.next);)t.advance();s&&t.next==39&&t.advance(),t.acceptToken(HF)}else if(r==46&&t.next>=48&&t.next<=57)kOe(t,!0),t.acceptToken(HF);else if(r==46)t.acceptToken(bMt);else if(r>=48&&r<=57)kOe(t,!1),t.acceptToken(HF);else if(Y_(r,e.operatorChars)){for(;Y_(t.next,e.operatorChars);)t.advance();t.acceptToken(yMt)}else if(Y_(r,e.specialVar))t.next==r&&t.advance(),RMt(t),t.acceptToken(SMt);else if(r==58||r==44)t.acceptToken(xMt);else if(K7(r)){let s=J7(t,String.fromCharCode(r));t.acceptToken(t.next==46||t.peek(-s.length-1)==46?TOe:(n=e.words[s.toLowerCase()])!==null&&n!==void 0?n:TOe)}})}const kje=wje(eZ),$Mt=ho.deserialize({version:14,states:"%vQ]QQOOO#wQRO'#DSO$OQQO'#CwO%eQQO'#CxO%lQQO'#CyO%sQQO'#CzOOQQ'#DS'#DSOOQQ'#C}'#C}O'UQRO'#C{OOQQ'#Cv'#CvOOQQ'#C|'#C|Q]QQOOQOQQOOO'`QQO'#DOO(xQRO,59cO)PQQO,59cO)UQQO'#DSOOQQ,59d,59dO)cQQO,59dOOQQ,59e,59eO)jQQO,59eOOQQ,59f,59fO)qQQO,59fOOQQ-E6{-E6{OOQQ,59b,59bOOQQ-E6z-E6zOOQQ,59j,59jOOQQ-E6|-E6|O+VQRO1G.}O+^QQO,59cOOQQ1G/O1G/OOOQQ1G/P1G/POOQQ1G/Q1G/QP+kQQO'#C}O+rQQO1G.}O)PQQO,59cO,PQQO'#Cw",stateData:",[~OtOSPOSQOS~ORUOSUOTUOUUOVROXSOZTO]XO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O^]ORvXSvXTvXUvXVvXXvXZvX]vX_vX`vXavXbvXcvXdvXevXfvXgvXhvX~OsvX~P!jOa_Ob_Oc_O~ORUOSUOTUOUUOVROXSOZTO^tO_UO`UOa`Ob`Oc`OdUOeUOfUOgUOhUO~OWaO~P$ZOYcO~P$ZO[eO~P$ZORUOSUOTUOUUOVROXSOZTO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O]hOsoX~P%zOajObjOcjO~O^]ORkaSkaTkaUkaVkaXkaZka]ka_ka`kaakabkackadkaekafkagkahka~Oska~P'kO^]O~OWvXYvX[vX~P!jOWnO~P$ZOYoO~P$ZO[pO~P$ZO^]ORkiSkiTkiUkiVkiXkiZki]ki_ki`kiakibkickidkiekifkigkihki~Oski~P)xOWkaYka[ka~P'kO]hO~P$ZOWkiYki[ki~P)xOasObsOcsO~O",goto:"#hwPPPPPPPPPPPPPPPPPPPPPPPPPPx||||!Y!^!d!xPPP#[TYOZeUORSTWZbdfqT[OZQZORiZSWOZQbRQdSQfTZgWbdfqQ^PWk^lmrQl_Qm`RrseVORSTWZbdfq",nodeNames:"⚠ LineComment BlockComment String Number Bool Null ( ) { } [ ] ; . Operator Punctuation SpecialVar Identifier QuotedIdentifier Keyword Type Bits Bytes Builtin Script Statement CompositeIdentifier Parens Braces Brackets Statement",maxTerm:38,nodeProps:[["isolate",-4,1,2,3,19,""]],skippedNodes:[0,1,2],repeatNodeCount:3,tokenData:"RORO",tokenizers:[0,kje],topRules:{Script:[0,25]},tokenPrec:0});function tZ(e){let t=e.cursor().moveTo(e.from,-1);for(;/Comment/.test(t.name);)t.moveTo(t.from,-1);return t.node}function ZR(e,t){let n=e.sliceString(t.from,t.to),r=/^([`'"\[])(.*)([`'"\]])$/.exec(n);return r?r[2]:n}function SL(e){return e&&(e.name=="Identifier"||e.name=="QuotedIdentifier")}function NMt(e,t){if(t.name=="CompositeIdentifier"){let n=[];for(let r=t.firstChild;r;r=r.nextSibling)SL(r)&&n.push(ZR(e,r));return n}return[ZR(e,t)]}function ROe(e,t){for(let n=[];;){if(!t||t.name!=".")return n;let r=tZ(t);if(!SL(r))return n;n.unshift(ZR(e,r)),t=tZ(r)}}function AMt(e,t){let n=rs(e).resolveInner(t,-1),r=MMt(e.doc,n);return n.name=="Identifier"||n.name=="QuotedIdentifier"||n.name=="Keyword"?{from:n.from,quoted:n.name=="QuotedIdentifier"?e.doc.sliceString(n.from,n.from+1):null,parents:ROe(e.doc,tZ(n)),aliases:r}:n.name=="."?{from:t,quoted:null,parents:ROe(e.doc,n),aliases:r}:{from:t,quoted:null,parents:[],empty:!0,aliases:r}}const IMt=new Set("where group having order union intersect except all distinct limit offset fetch for".split(" "));function MMt(e,t){let n;for(let s=t;!n;s=s.parent){if(!s)return null;s.name=="Statement"&&(n=s)}let r=null;for(let s=n.firstChild,i=!1,o=null;s;s=s.nextSibling){let a=s.name=="Keyword"?e.sliceString(s.from,s.to).toLowerCase():null,c=null;if(!i)i=a=="from";else if(a=="as"&&o&&SL(s.nextSibling))c=ZR(e,s.nextSibling);else{if(a&&IMt.has(a))break;o&&SL(s)&&(c=ZR(e,s))}c&&(r||(r=Object.create(null)),r[c]=NMt(e,o)),o=/Identifier$/.test(s.name)?s:null}return r}function QMt(e,t,n){return n.map(r=>({...r,label:r.label[0]==e?r.label:e+r.label+t,apply:void 0}))}const DMt=/^\w*$/,LMt=/^[`'"\[]?\w*[`'"\]]?$/;function POe(e){return e.self&&typeof e.self.label=="string"}class bse{constructor(t,n){this.idQuote=t,this.idCaseInsensitive=n,this.list=[],this.children=void 0}child(t){let n=this.children||(this.children=Object.create(null)),r=n[t];return r||(t&&!this.list.some(s=>s.label==t)&&this.list.push($Oe(t,"type",this.idQuote,this.idCaseInsensitive)),n[t]=new bse(this.idQuote,this.idCaseInsensitive))}maybeChild(t){return this.children?this.children[t]:null}addCompletion(t){let n=this.list.findIndex(r=>r.label==t.label);n>-1?this.list[n]=t:this.list.push(t)}addCompletions(t){for(let n of t)this.addCompletion(typeof n=="string"?$Oe(n,"property",this.idQuote,this.idCaseInsensitive):n)}addNamespace(t){Array.isArray(t)?this.addCompletions(t):POe(t)?this.addNamespace(t.children):this.addNamespaceObject(t)}addNamespaceObject(t){for(let n of Object.keys(t)){let r=t[n],s=null,i=n.replace(/\\?\./g,a=>a=="."?"\0":a).split("\0"),o=this;POe(r)&&(s=r.self,r=r.children);for(let a=0;a<i.length;a++)s&&a==i.length-1&&o.addCompletion(s),o=o.child(i[a].replace(/\\\./g,"."));o.addNamespace(r)}}}function $Oe(e,t,n,r){return new RegExp("^[a-z_][a-z_\\d]*$",r?"i":"").test(e)?{label:e,type:t}:{label:e,type:t,apply:n+e+Cje(n)}}function Cje(e){return e==="["?"]":e}function jMt(e,t,n,r,s,i){var o;let a=((o=i?.spec.identifierQuotes)===null||o===void 0?void 0:o[0])||'"',c=new bse(a,!!i?.spec.caseInsensitiveIdentifiers),l=s?c.child(s):null;return c.addNamespace(e),t&&(l||c).addCompletions(t),n&&c.addCompletions(n),l&&c.addCompletions(l.list),r&&c.addCompletions((l||c).child(r).list),d=>{let{parents:p,from:f,quoted:h,empty:m,aliases:O}=AMt(d.state,d.pos);if(m&&!d.explicit)return null;O&&p.length==1&&(p=O[p[0]]||p);let _=c;for(let y of p){for(;!_.children||!_.children[y];)if(_==c&&l)_=l;else if(_==l&&r)_=_.child(r);else return null;let x=_.maybeChild(y);if(!x)return null;_=x}let b=_.list;if(_==c&&O&&(b=b.concat(Object.keys(O).map(y=>({label:y,type:"constant"})))),h){let y=h[0],x=Cje(y),S=d.state.sliceDoc(d.pos,d.pos+1)==x;return{from:f,to:S?d.pos+1:void 0,options:QMt(y,x,b),validFor:LMt}}else return{from:f,options:b,validFor:DMt}}}function XMt(e){return e==Tje?"type":e==vje?"keyword":"variable"}function UMt(e,t,n){let r=Object.keys(e).map(s=>n(t?s.toUpperCase():s,XMt(e[s])));return ZU(["QuotedIdentifier","String","LineComment","BlockComment","."],HU(r))}let zMt=$Mt.configure({props:[_o.add({Statement:vi()}),bo.add({Statement(e,t){return{from:Math.min(e.from+100,t.doc.lineAt(e.from).to),to:e.to}},BlockComment(e){return{from:e.from+2,to:e.to-2}}}),go({Keyword:X.keyword,Type:X.typeName,Builtin:X.standard(X.name),Bits:X.number,Bytes:X.string,Bool:X.bool,Null:X.null,Number:X.number,String:X.string,Identifier:X.name,QuotedIdentifier:X.special(X.string),SpecialVar:X.special(X.name),LineComment:X.lineComment,BlockComment:X.blockComment,Operator:X.operator,"Semi Punctuation":X.punctuation,"( )":X.paren,"{ }":X.brace,"[ ]":X.squareBracket})]});class Wu{constructor(t,n,r){this.dialect=t,this.language=n,this.spec=r}get extension(){return this.language.extension}configureLanguage(t,n){return new Wu(this.dialect,this.language.configure(t,n),this.spec)}static define(t){let n=PMt(t,t.keywords,t.types,t.builtin),r=mo.define({name:"sql",parser:zMt.configure({tokenizers:[{from:kje,to:wje(n)}]}),languageData:{commentTokens:{line:"--",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}});return new Wu(n,r,t)}}function BMt(e,t){return{label:e,type:t,boost:-1}}function Rje(e,t=!1,n){return UMt(e.dialect.words,t,n||BMt)}function Pje(e){return e.schema?jMt(e.schema,e.tables,e.schemas,e.defaultTable,e.defaultSchema,e.dialect||nz):()=>null}function FMt(e){return e.schema?(e.dialect||nz).language.data.of({autocomplete:Pje(e)}):[]}function $je(e={}){let t=e.dialect||nz;return new qi(t.language,[FMt(e),t.language.data.of({autocomplete:Rje(t,e.upperCaseKeywords,e.keywordCompletion)})])}const nz=Wu.define({}),YMt=Wu.define({charSetCasts:!0,doubleDollarQuotedStrings:!0,operatorChars:"+-*/<>=~!@#%^&|`?",specialVar:"",keywords:Iy+"abort abs absent access according ada admin aggregate alias also always analyse analyze array_agg array_max_cardinality asensitive assert assignment asymmetric atomic attach attribute attributes avg backward base64 begin_frame begin_partition bernoulli bit_length blocked bom cache called cardinality catalog_name ceil ceiling chain char_length character_length character_set_catalog character_set_name character_set_schema characteristics characters checkpoint class class_origin cluster coalesce cobol collation_catalog collation_name collation_schema collect column_name columns command_function command_function_code comment comments committed concurrently condition_number configuration conflict connection_name constant constraint_catalog constraint_name constraint_schema contains content control conversion convert copy corr cost covar_pop covar_samp csv cume_dist current_catalog current_row current_schema cursor_name database datalink datatype datetime_interval_code datetime_interval_precision db debug defaults defined definer degree delimiter delimiters dense_rank depends derived detach detail dictionary disable discard dispatch dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue document dump dynamic_function dynamic_function_code element elsif empty enable encoding encrypted end_frame end_partition endexec enforced enum errcode error event every exclude excluding exclusive exp explain expression extension extract family file filter final first_value flag floor following force foreach fortran forward frame_row freeze fs functions fusion generated granted greatest groups handler header hex hierarchy hint id ignore ilike immediately immutable implementation implicit import include including increment indent index indexes info inherit inherits inline insensitive instance instantiable instead integrity intersection invoker isnull key_member key_type label lag last_value lead leakproof least length library like_regex link listen ln load location lock locked log logged lower mapping matched materialized max max_cardinality maxvalue member merge message message_length message_octet_length message_text min minvalue mod mode more move multiset mumps name namespace nfc nfd nfkc nfkd nil normalize normalized nothing notice notify notnull nowait nth_value ntile nullable nullif nulls number occurrences_regex octet_length octets off offset oids operator options ordering others over overlay overriding owned owner parallel parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partition pascal passing passthrough password percent percent_rank percentile_cont percentile_disc perform period permission pg_context pg_datatype_name pg_exception_context pg_exception_detail pg_exception_hint placing plans pli policy portion position position_regex power precedes preceding prepared print_strict_params procedural procedures program publication query quote raise range rank reassign recheck recovery refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex rename repeatable replace replica requiring reset respect restart restore result_oid returned_cardinality returned_length returned_octet_length returned_sqlstate returning reverse routine_catalog routine_name routine_schema routines row_count row_number rowtype rule scale schema_name schemas scope scope_catalog scope_name scope_schema security selective self sensitive sequence sequences serializable server server_name setof share show simple skip slice snapshot source specific_name sqlcode sqlerror sqrt stable stacked standalone statement statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset subscription substring substring_regex succeeds sum symmetric sysid system system_time table_name tables tablesample tablespace temp template ties token top_level_count transaction_active transactions_committed transactions_rolled_back transform transforms translate translate_regex trigger_catalog trigger_name trigger_schema trim trim_array truncate trusted type types uescape unbounded uncommitted unencrypted unlink unlisten unlogged unnamed untyped upper uri use_column use_variable user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema vacuum valid validate validator value_of var_pop var_samp varbinary variable_conflict variadic verbose version versioning views volatile warning whitespace width_bucket window within wrapper xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate yes",types:Ay+"bigint int8 bigserial serial8 varbit bool box bytea cidr circle precision float8 inet int4 json jsonb line lseg macaddr macaddr8 money numeric pg_lsn point polygon float4 int2 smallserial serial2 serial serial4 text timetz timestamptz tsquery tsvector txid_snapshot uuid xml"}),Nje="accessible algorithm analyze asensitive authors auto_increment autocommit avg avg_row_length binlog btree cache catalog_name chain change changed checkpoint checksum class_origin client_statistics coalesce code collations columns comment committed completion concurrent consistent contains contributors convert database databases day_hour day_microsecond day_minute day_second delay_key_write delayed delimiter des_key_file dev_pop dev_samp deviance directory disable discard distinctrow div dual dumpfile enable enclosed ends engine engines enum errors escaped even event events every explain extended fast field fields flush force found_rows fulltext grants handler hash high_priority hosts hour_microsecond hour_minute hour_second ignore ignore_server_ids import index index_statistics infile innodb insensitive insert_method install invoker iterate keys kill linear lines list load lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modify mutex mysql_errno no_write_to_binlog offline offset one online optimize optionally outfile pack_keys parser partition partitions password phase plugin plugins prev processlist profile profiles purge query quick range read_write rebuild recover regexp relaylog remove rename reorganize repair repeatable replace require resume rlike row_format rtree schedule schema_name schemas second_microsecond security sensitive separator serializable server share show slave slow snapshot soname spatial sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result ssl starting starts std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace terminated triggers truncate uncommitted uninstall unlock upgrade use use_frm user_resources user_statistics utc_date utc_time utc_timestamp variables views warnings xa xor year_month zerofill",Aje=Ay+"bool blob long longblob longtext medium mediumblob mediumint mediumtext tinyblob tinyint tinytext text bigint int1 int2 int3 int4 int8 float4 float8 varbinary varcharacter precision datetime unsigned signed",Ije="charset clear edit ego help nopager notee nowarning pager print prompt quit rehash source status system tee",VMt=Wu.define({operatorChars:"*+-%<>!=&|^",charSetCasts:!0,doubleQuotedStrings:!0,unquotedBitLiterals:!0,hashComments:!0,spaceAfterDashes:!0,specialVar:"@?",identifierQuotes:"`",keywords:Iy+"group_concat "+Nje,types:Aje,builtin:Ije}),qMt=Wu.define({operatorChars:"*+-%<>!=&|^",charSetCasts:!0,doubleQuotedStrings:!0,unquotedBitLiterals:!0,hashComments:!0,spaceAfterDashes:!0,specialVar:"@?",identifierQuotes:"`",keywords:Iy+"always generated groupby_concat hard persistent shutdown soft virtual "+Nje,types:Aje,builtin:Ije});let WMt="approx_count_distinct approx_percentile_cont approx_percentile_disc avg checksum_agg count count_big grouping grouping_id max min product stdev stdevp sum var varp ai_generate_embeddings ai_generate_chunks cume_dist first_value lag last_value lead percentile_cont percentile_disc percent_rank left_shift right_shift bit_count get_bit set_bit collationproperty tertiary_weights @@datefirst @@dbts @@langid @@language @@lock_timeout @@max_connections @@max_precision @@nestlevel @@options @@remserver @@servername @@servicename @@spid @@textsize @@version cast convert parse try_cast try_convert try_parse asymkey_id asymkeyproperty certproperty cert_id crypt_gen_random decryptbyasymkey decryptbycert decryptbykey decryptbykeyautoasymkey decryptbykeyautocert decryptbypassphrase encryptbyasymkey encryptbycert encryptbykey encryptbypassphrase hashbytes is_objectsigned key_guid key_id key_name signbyasymkey signbycert symkeyproperty verifysignedbycert verifysignedbyasymkey @@cursor_rows @@fetch_status cursor_status datalength ident_current ident_incr ident_seed identity sql_variant_property @@datefirst current_timestamp current_timezone current_timezone_id date_bucket dateadd datediff datediff_big datefromparts datename datepart datetime2fromparts datetimefromparts datetimeoffsetfromparts datetrunc day eomonth getdate getutcdate isdate month smalldatetimefromparts switchoffset sysdatetime sysdatetimeoffset sysutcdatetime timefromparts todatetimeoffset year edit_distance edit_distance_similarity jaro_winkler_distance jaro_winkler_similarity edge_id_from_parts graph_id_from_edge_id graph_id_from_node_id node_id_from_parts object_id_from_edge_id object_id_from_node_id json isjson json_array json_contains json_modify json_object json_path_exists json_query json_value regexp_like regexp_replace regexp_substr regexp_instr regexp_count regexp_matches regexp_split_to_table abs acos asin atan atn2 ceiling cos cot degrees exp floor log log10 pi power radians rand round sign sin sqrt square tan choose greatest iif least @@procid app_name applock_mode applock_test assemblyproperty col_length col_name columnproperty databasepropertyex db_id db_name file_id file_idex file_name filegroup_id filegroup_name filegroupproperty fileproperty filepropertyex fulltextcatalogproperty fulltextserviceproperty index_col indexkey_property indexproperty next value for object_definition object_id object_name object_schema_name objectproperty objectpropertyex original_db_name parsename schema_id schema_name scope_identity serverproperty stats_date type_id type_name typeproperty dense_rank ntile rank row_number publishingservername certenclosed certprivatekey current_user database_principal_id has_dbaccess has_perms_by_name is_member is_rolemember is_srvrolemember loginproperty original_login permissions pwdencrypt pwdcompare session_user sessionproperty suser_id suser_name suser_sid suser_sname system_user user user_id user_name ascii char charindex concat concat_ws difference format left len lower ltrim nchar patindex quotename replace replicate reverse right rtrim soundex space str string_agg string_escape stuff substring translate trim unicode upper $partition @@error @@identity @@pack_received @@rowcount @@trancount binary_checksum checksum compress connectionproperty context_info current_request_id current_transaction_id decompress error_line error_message error_number error_procedure error_severity error_state formatmessage get_filestream_transaction_context getansinull host_id host_name isnull isnumeric min_active_rowversion newid newsequentialid rowcount_big session_context xact_state @@connections @@cpu_busy @@idle @@io_busy @@pack_sent @@packet_errors @@timeticks @@total_errors @@total_read @@total_write textptr textvalid columns_updated eventdata trigger_nestlevel vector_distance vectorproperty vector_search generate_series opendatasource openjson openquery openrowset openxml predict string_split coalesce nullif apply catch filter force include keep keepfixed modify optimize parameterization parameters partition recompile sequence set";const GMt=Wu.define({keywords:Iy+"add external procedure all fetch public alter file raiserror and fillfactor read any for readtext as foreign reconfigure asc freetext references authorization freetexttable replication backup from restore begin full restrict between function return break goto revert browse grant revoke bulk group right by having rollback cascade holdlock rowcount case identity rowguidcol check identity_insert rule checkpoint identitycol save close if schema clustered in securityaudit coalesce index select collate inner semantickeyphrasetable column insert semanticsimilaritydetailstable commit intersect semanticsimilaritytable compute into session_user constraint is set contains join setuser containstable key shutdown continue kill some convert left statistics create like system_user cross lineno table current load tablesample current_date merge textsize current_time national then current_timestamp nocheck to current_user nonclustered top cursor not tran database null transaction dbcc nullif trigger deallocate of truncate declare off try_convert default offsets tsequal delete on union deny open unique desc opendatasource unpivot disk openquery update distinct openrowset updatetext distributed openxml use double option user drop or values dump order varying else outer view end over waitfor errlvl percent when escape pivot where except plan while exec precision with execute primary within group exists print writetext exit proc noexpand index forceseek forcescan holdlock nolock nowait paglock readcommitted readcommittedlock readpast readuncommitted repeatableread rowlock serializable snapshot spatial_window_max_cells tablock tablockx updlock xlock keepidentity keepdefaults ignore_constraints ignore_triggers",types:Ay+"smalldatetime datetimeoffset datetime2 datetime bigint smallint smallmoney tinyint money real text nvarchar ntext varbinary image hierarchyid uniqueidentifier sql_variant xml",builtin:WMt,operatorChars:"*+-%<>!=^&|/",specialVar:"@",identifierQuotes:'"['}),HMt=Wu.define({keywords:Iy+"abort analyze attach autoincrement conflict database detach exclusive fail glob ignore index indexed instead isnull notnull offset plan pragma query raise regexp reindex rename replace temp vacuum virtual",types:Ay+"bool blob long longblob longtext medium mediumblob mediumint mediumtext tinyblob tinyint tinytext text bigint int2 int8 unsigned signed real",builtin:"auth backup bail changes clone databases dbinfo dump echo eqp explain fullschema headers help import imposter indexes iotrace lint load log mode nullvalue once print prompt quit restore save scanstats separator shell show stats system tables testcase timeout timer trace vfsinfo vfslist vfsname width",operatorChars:"*+-%<>!=&|/~",identifierQuotes:'`"',specialVar:"@:?$"}),ZMt=Wu.define({keywords:"add all allow alter and any apply as asc authorize batch begin by clustering columnfamily compact consistency count create custom delete desc distinct drop each_quorum exists filtering from grant if in index insert into key keyspace keyspaces level limit local_one local_quorum modify nan norecursive nosuperuser not of on one order password permission permissions primary quorum rename revoke schema select set storage superuser table three to token truncate ttl two type unlogged update use user users using values where with writetime infinity NaN",types:Ay+"ascii bigint blob counter frozen inet list map static text timeuuid tuple uuid varint",slashComments:!0}),KMt=Wu.define({keywords:Iy+"abort accept access add all alter and any arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body by case cast char_base check close cluster clusters colauth column comment commit compress connected constant constraint crash create current currval cursor data_base database dba deallocate debugoff debugon declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry exception exception_init exchange exclusive exists external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base of off offline on online only option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw rebuild record ref references refresh rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work",builtin:"appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define echo editfile embedded feedback flagger flush heading headsep instance linesize lno loboffset logsource longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar repfooter repheader serveroutput shiftinout show showmode spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout timing trimout trimspool ttitle underline verify version wrap",types:Ay+"ascii bfile bfilename bigserial bit blob dec long number nvarchar nvarchar2 serial smallint string text uid varchar2 xml",operatorChars:"*/+-%<>!=~",doubleQuotedStrings:!0,charSetCasts:!0,plsqlQuotingMechanism:!0}),JMt=Object.freeze(Object.defineProperty({__proto__:null,Cassandra:ZMt,MSSQL:GMt,MariaSQL:qMt,MySQL:VMt,PLSQL:KMt,PostgreSQL:YMt,SQLDialect:Wu,SQLite:HMt,StandardSQL:nz,keywordCompletionSource:Rje,schemaCompletionSource:Pje,sql:$je},Symbol.toStringTag,{value:"Module"})),nZ=1,eQt=2,tQt=3,nQt=4,rQt=5,sQt=36,iQt=37,oQt=38,aQt=11,lQt=13;function cQt(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function uQt(e){return e==9||e==10||e==13||e==32}let NOe=null,AOe=null,IOe=0;function rZ(e,t){let n=e.pos+t;if(AOe==e&&IOe==n)return NOe;for(;uQt(e.peek(t));)t++;let r="";for(;;){let s=e.peek(t);if(!cQt(s))break;r+=String.fromCharCode(s),t++}return AOe=e,IOe=n,NOe=r||null}function MOe(e,t){this.name=e,this.parent=t}const dQt=new Ny({start:null,shift(e,t,n,r){return t==nZ?new MOe(rZ(r,1)||"",e):e},reduce(e,t){return t==aQt&&e?e.parent:e},reuse(e,t,n,r){let s=t.type.id;return s==nZ||s==lQt?new MOe(rZ(r,1)||"",e):e},strict:!1}),pQt=new Vn((e,t)=>{if(e.next==60){if(e.advance(),e.next==47){e.advance();let n=rZ(e,0);if(!n)return e.acceptToken(rQt);if(t.context&&n==t.context.name)return e.acceptToken(eQt);for(let r=t.context;r;r=r.parent)if(r.name==n)return e.acceptToken(tQt,-2);e.acceptToken(nQt)}else if(e.next!=33&&e.next!=63)return e.acceptToken(nZ)}},{contextual:!0});function yse(e,t){return new Vn(n=>{let r=0,s=t.charCodeAt(0);e:for(;!(n.next<0);n.advance(),r++)if(n.next==s){for(let i=1;i<t.length;i++)if(n.peek(i)!=t.charCodeAt(i))continue e;break}r&&n.acceptToken(e)})}const fQt=yse(sQt,"-->"),hQt=yse(iQt,"?>"),mQt=yse(oQt,"]]>"),OQt=go({Text:X.content,"StartTag StartCloseTag EndTag SelfCloseEndTag":X.angleBracket,TagName:X.tagName,"MismatchedCloseTag/TagName":[X.tagName,X.invalid],AttributeName:X.attributeName,AttributeValue:X.attributeValue,Is:X.definitionOperator,"EntityReference CharacterReference":X.character,Comment:X.blockComment,ProcessingInst:X.processingInstruction,DoctypeDecl:X.documentMeta,Cdata:X.special(X.string)}),gQt=ho.deserialize({version:14,states:",lO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]O~O^`Oz^O~OPQOQcOSVOTWOVWOWWOXWOyPO!QTO!SUO~ORdO~P!SOteO!PgO~OuhO!RjO~O^lOz^O~OvZOxoO~O^qOz^O~O[vO`sOdwOz^O~ORyO~P!SO^{Oz^O~OteO!P}O~OuhO!R!PO~O^!QOz^O~O[!SOz^O~O[!VO`sOd!WOz^O~Oa!YOz^O~Oz^O[mX`mXdmX~O[!VO`sOd!WO~O^!]Oz^O~O[!_Oz^O~O[!aOz^O~O[!cO`sOd!dOz^O~O[!cO`sOd!dO~Oa!eOz^O~Oz^O{!gO}!hO~Oz^O[ma`madma~O[!kOz^O~O[!lOz^O~O[!mO`sOd!nO~OW!qOX!qO{!sO|!qO~OW!tOX!tO}!sO!O!tO~O[!vOz^O~OW!qOX!qO{!yO|!qO~OW!tOX!tO}!yO!O!tO~O",goto:"%cxPPPPPPPPPPyyP!PP!VPP!`!jP!pyyyP!v!|#S$[$k$q$w$}%TPPPP%ZXWORYbXRORYb_t`qru!T!U!bQ!i!YS!p!e!fR!w!oQdRRybXSORYbQYORmYQ[PRn[Q_QQkVjp_krz!R!T!X!Z!^!`!f!j!oQr`QzcQ!RlQ!TqQ!XsQ!ZtQ!^{Q!`!QQ!f!YQ!j!]R!o!eQu`S!UqrU![u!U!bR!b!TQ!r!gR!x!rQ!u!hR!z!uQbRRxbQfTR|fQiUR!OiSXOYTaRb",nodeNames:"⚠ StartTag StartCloseTag MissingCloseTag StartCloseTag StartCloseTag Document Text EntityReference CharacterReference Cdata Element EndTag OpenTag TagName Attribute AttributeName Is AttributeValue CloseTag SelfCloseEndTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag DoctypeDecl",maxTerm:50,context:dQt,nodeProps:[["closedBy",1,"SelfCloseEndTag EndTag",13,"CloseTag MissingCloseTag"],["openedBy",12,"StartTag StartCloseTag",19,"OpenTag",20,"StartTag"],["isolate",-6,13,18,19,21,22,24,""]],propSources:[OQt],skippedNodes:[0],repeatNodeCount:9,tokenData:"!)v~R!YOX$q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;'S$q;'S;=`)c<%lO$qk!&kX!RQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!'aZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_#P$q#P#Q!(S#Q;'S$q;'S;=`)c<%lO$qk!(]ZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!)O!a;'S$q;'S;=`)c<%lO$qk!)ZXxQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$q",tokenizers:[pQt,fQt,hQt,mQt,0,1,2,3,4],topRules:{Document:[0,6]},tokenPrec:0});function XQ(e,t){let n=t&&t.getChild("TagName");return n?e.sliceString(n.from,n.to):""}function KF(e,t){let n=t&&t.firstChild;return!n||n.name!="OpenTag"?"":XQ(e,n)}function _Qt(e,t,n){let r=t&&t.getChildren("Attribute").find(i=>i.from<=n&&i.to>=n),s=r&&r.getChild("AttributeName");return s?e.sliceString(s.from,s.to):""}function JF(e){for(let t=e&&e.parent;t;t=t.parent)if(t.name=="Element")return t;return null}function bQt(e,t){var n;let r=rs(e).resolveInner(t,-1),s=null;for(let i=r;!s&&i.parent;i=i.parent)(i.name=="OpenTag"||i.name=="CloseTag"||i.name=="SelfClosingTag"||i.name=="MismatchedCloseTag")&&(s=i);if(s&&(s.to>t||s.lastChild.type.isError)){let i=s.parent;if(r.name=="TagName")return s.name=="CloseTag"||s.name=="MismatchedCloseTag"?{type:"closeTag",from:r.from,context:i}:{type:"openTag",from:r.from,context:JF(i)};if(r.name=="AttributeName")return{type:"attrName",from:r.from,context:s};if(r.name=="AttributeValue")return{type:"attrValue",from:r.from,context:s};let o=r==s||r.name=="Attribute"?r.childBefore(t):r;return o?.name=="StartTag"?{type:"openTag",from:t,context:JF(i)}:o?.name=="StartCloseTag"&&o.to<=t?{type:"closeTag",from:t,context:i}:o?.name=="Is"?{type:"attrValue",from:t,context:s}:o?{type:"attrName",from:t,context:s}:null}else if(r.name=="StartCloseTag")return{type:"closeTag",from:t,context:r.parent};for(;r.parent&&r.to==t&&!(!((n=r.lastChild)===null||n===void 0)&&n.type.isError);)r=r.parent;return r.name=="Element"||r.name=="Text"||r.name=="Document"?{type:"tag",from:t,context:r.name=="Element"?r:JF(r)}:null}let yQt=class{constructor(t,n,r){this.attrs=n,this.attrValues=r,this.children=[],this.name=t.name,this.completion=Object.assign(Object.assign({type:"type"},t.completion||{}),{label:this.name}),this.openCompletion=Object.assign(Object.assign({},this.completion),{label:"<"+this.name}),this.closeCompletion=Object.assign(Object.assign({},this.completion),{label:"</"+this.name+">",boost:2}),this.closeNameCompletion=Object.assign(Object.assign({},this.completion),{label:this.name+">"}),this.text=t.textContent?t.textContent.map(s=>({label:s,type:"text"})):[]}};const eY=/^[:\-\.\w\u00b7-\uffff]*$/;function QOe(e){return Object.assign(Object.assign({type:"property"},e.completion||{}),{label:e.name})}function DOe(e){return typeof e=="string"?{label:`"${e}"`,type:"constant"}:/^"/.test(e.label)?e:Object.assign(Object.assign({},e),{label:`"${e.label}"`})}function Mje(e,t){let n=[],r=[],s=Object.create(null);for(let c of t){let l=QOe(c);n.push(l),c.global&&r.push(l),c.values&&(s[c.name]=c.values.map(DOe))}let i=[],o=[],a=Object.create(null);for(let c of e){let l=r,d=s;c.attributes&&(l=l.concat(c.attributes.map(f=>typeof f=="string"?n.find(h=>h.label==f)||{label:f,type:"property"}:(f.values&&(d==s&&(d=Object.create(d)),d[f.name]=f.values.map(DOe)),QOe(f)))));let p=new yQt(c,l,d);a[p.name]=p,i.push(p),c.top&&o.push(p)}o.length||(o=i);for(let c=0;c<i.length;c++){let l=e[c],d=i[c];if(l.children)for(let p of l.children)a[p]&&d.children.push(a[p]);else d.children=i}return c=>{var l;let{doc:d}=c.state,p=bQt(c.state,c.pos);if(!p||p.type=="tag"&&!c.explicit)return null;let{type:f,from:h,context:m}=p;if(f=="openTag"){let O=o,_=KF(d,m);if(_){let b=a[_];O=b?.children||i}return{from:h,options:O.map(b=>b.completion),validFor:eY}}else if(f=="closeTag"){let O=KF(d,m);return O?{from:h,to:c.pos+(d.sliceString(c.pos,c.pos+1)==">"?1:0),options:[((l=a[O])===null||l===void 0?void 0:l.closeNameCompletion)||{label:O+">",type:"type"}],validFor:eY}:null}else if(f=="attrName"){let O=a[XQ(d,m)];return{from:h,options:O?.attrs||r,validFor:eY}}else if(f=="attrValue"){let O=_Qt(d,m,h);if(!O)return null;let _=a[XQ(d,m)],b=(_?.attrValues||s)[O];return!b||!b.length?null:{from:h,to:c.pos+(d.sliceString(c.pos,c.pos+1)=='"'?1:0),options:b,validFor:/^"[^"]*"?$/}}else if(f=="tag"){let O=KF(d,m),_=a[O],b=[],y=m&&m.lastChild;O&&(!y||y.name!="CloseTag"||XQ(d,y)!=O)&&b.push(_?_.closeCompletion:{label:"</"+O+">",type:"type",boost:2});let x=b.concat((_?.children||(m?i:o)).map(S=>S.openCompletion));if(m&&_?.text.length){let S=m.firstChild;S.to>c.pos-20&&!/\S/.test(c.state.sliceDoc(S.to,c.pos))&&(x=x.concat(_.text))}return{from:h,options:x,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}else return null}}const vL=mo.define({name:"xml",parser:gQt.configure({props:[_o.add({Element(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),bo.add({Element(e){let t=e.firstChild,n=e.lastChild;return!t||t.name!="OpenTag"?null:{from:t.to,to:n.name=="CloseTag"?n.from:e.to}}}),zre.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/$/}});function Qje(e={}){let t=[vL.data.of({autocomplete:Mje(e.elements||[],e.attributes||[])})];return e.autoCloseTags!==!1&&t.push(Dje),new qi(vL,t)}function LOe(e,t,n=e.length){if(!t)return"";let r=t.firstChild,s=r&&r.getChild("TagName");return s?e.sliceString(s.from,Math.min(s.to,n)):""}const Dje=Kt.inputHandler.of((e,t,n,r,s)=>{if(e.composing||e.state.readOnly||t!=n||r!=">"&&r!="/"||!vL.isActiveAt(e.state,t,-1))return!1;let i=s(),{state:o}=i,a=o.changeByRange(c=>{var l,d,p;let{head:f}=c,h=o.doc.sliceString(f-1,f)==r,m=rs(o).resolveInner(f,-1),O;if(h&&r==">"&&m.name=="EndTag"){let _=m.parent;if(((d=(l=_.parent)===null||l===void 0?void 0:l.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(O=LOe(o.doc,_.parent,f))){let b=f+(o.doc.sliceString(f,f+1)===">"?1:0),y=`</${O}>`;return{range:c,changes:{from:f,to:b,insert:y}}}}else if(h&&r=="/"&&m.name=="StartCloseTag"){let _=m.parent;if(m.from==f-2&&((p=_.lastChild)===null||p===void 0?void 0:p.name)!="CloseTag"&&(O=LOe(o.doc,_,f))){let b=f+(o.doc.sliceString(f,f+1)===">"?1:0),y=`${O}>`;return{range:ft.cursor(f+y.length,-1),changes:{from:f,to:b,insert:y}}}}return{range:c}});return a.changes.empty?!1:(e.dispatch([i,o.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),xQt=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:Dje,completeFromSchema:Mje,xml:Qje,xmlLanguage:vL},Symbol.toStringTag,{value:"Module"})),Gx=63,jOe=64,SQt=1,vQt=2,Lje=3,TQt=4,jje=5,EQt=6,wQt=7,Xje=65,kQt=66,CQt=8,RQt=9,PQt=10,$Qt=11,NQt=12,Uje=13,AQt=19,IQt=20,MQt=29,QQt=33,DQt=34,LQt=47,jQt=0,xse=1,sZ=2,KR=3,iZ=4;let v0=class{constructor(t,n,r){this.parent=t,this.depth=n,this.type=r,this.hash=(t?t.hash+t.hash<<8:0)+n+(n<<4)+r}};v0.top=new v0(null,-1,jQt);function tC(e,t){for(let n=0,r=t-e.pos-1;;r--,n++){let s=e.peek(r);if(vm(s)||s==-1)return n}}function oZ(e){return e==32||e==9}function vm(e){return e==10||e==13}function zje(e){return oZ(e)||vm(e)}function Q0(e){return e<0||zje(e)}const XQt=new Ny({start:v0.top,reduce(e,t){return e.type==KR&&(t==IQt||t==DQt)?e.parent:e},shift(e,t,n,r){if(t==Lje)return new v0(e,tC(r,r.pos),xse);if(t==Xje||t==jje)return new v0(e,tC(r,r.pos),sZ);if(t==Gx)return e.parent;if(t==AQt||t==QQt)return new v0(e,0,KR);if(t==Uje&&e.type==iZ)return e.parent;if(t==LQt){let s=/[1-9]/.exec(r.read(r.pos,n.pos));if(s)return new v0(e,e.depth+ +s[0],iZ)}return e},hash(e){return e.hash}});function uT(e,t,n=0){return e.peek(n)==t&&e.peek(n+1)==t&&e.peek(n+2)==t&&Q0(e.peek(n+3))}const UQt=new Vn((e,t)=>{if(e.next==-1&&t.canShift(jOe))return e.acceptToken(jOe);let n=e.peek(-1);if((vm(n)||n<0)&&t.context.type!=KR){if(uT(e,45))if(t.canShift(Gx))e.acceptToken(Gx);else return e.acceptToken(SQt,3);if(uT(e,46))if(t.canShift(Gx))e.acceptToken(Gx);else return e.acceptToken(vQt,3);let r=0;for(;e.next==32;)r++,e.advance();(r<t.context.depth||r==t.context.depth&&t.context.type==xse&&(e.next!=45||!Q0(e.peek(1))))&&e.next!=-1&&!vm(e.next)&&e.next!=35&&e.acceptToken(Gx,-r)}},{contextual:!0}),zQt=new Vn((e,t)=>{if(t.context.type==KR){e.next==63&&(e.advance(),Q0(e.next)&&e.acceptToken(wQt));return}if(e.next==45)e.advance(),Q0(e.next)&&e.acceptToken(t.context.type==xse&&t.context.depth==tC(e,e.pos-1)?TQt:Lje);else if(e.next==63)e.advance(),Q0(e.next)&&e.acceptToken(t.context.type==sZ&&t.context.depth==tC(e,e.pos-1)?EQt:jje);else{let n=e.pos;for(;;)if(oZ(e.next)){if(e.pos==n)return;e.advance()}else if(e.next==33)Bje(e);else if(e.next==38)aZ(e);else if(e.next==42){aZ(e);break}else if(e.next==39||e.next==34){if(Sse(e,!0))break;return}else if(e.next==91||e.next==123){if(!FQt(e))return;break}else{Fje(e,!0,!1,0);break}for(;oZ(e.next);)e.advance();if(e.next==58){if(e.pos==n&&t.canShift(MQt))return;let r=e.peek(1);Q0(r)&&e.acceptTokenTo(t.context.type==sZ&&t.context.depth==tC(e,n)?kQt:Xje,n)}}},{contextual:!0});function BQt(e){return e>32&&e<127&&e!=34&&e!=37&&e!=44&&e!=60&&e!=62&&e!=92&&e!=94&&e!=96&&e!=123&&e!=124&&e!=125}function XOe(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function UOe(e,t){return e.next==37?(e.advance(),XOe(e.next)&&e.advance(),XOe(e.next)&&e.advance(),!0):BQt(e.next)||t&&e.next==44?(e.advance(),!0):!1}function Bje(e){if(e.advance(),e.next==60){for(e.advance();;)if(!UOe(e,!0)){e.next==62&&e.advance();break}}else for(;UOe(e,!1););}function aZ(e){for(e.advance();!Q0(e.next)&&TL(e.next)!="f";)e.advance()}function Sse(e,t){let n=e.next,r=!1,s=e.pos;for(e.advance();;){let i=e.next;if(i<0)break;if(e.advance(),i==n)if(i==39)if(e.next==39)e.advance();else break;else break;else if(i==92&&n==34)e.next>=0&&e.advance();else if(vm(i)){if(t)return!1;r=!0}else if(t&&e.pos>=s+1024)return!1}return!r}function FQt(e){for(let t=[],n=e.pos+1024;;)if(e.next==91||e.next==123)t.push(e.next),e.advance();else if(e.next==39||e.next==34){if(!Sse(e,!0))return!1}else if(e.next==93||e.next==125){if(t[t.length-1]!=e.next-2)return!1;if(t.pop(),e.advance(),!t.length)return!0}else{if(e.next<0||e.pos>n||vm(e.next))return!1;e.advance()}}const YQt="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function TL(e){return e<33?"u":e>125?"s":YQt[e-33]}function tY(e,t){let n=TL(e);return n!="u"&&!(t&&n=="f")}function Fje(e,t,n,r){if(TL(e.next)=="s"||(e.next==63||e.next==58||e.next==45)&&tY(e.peek(1),n))e.advance();else return!1;let s=e.pos;for(;;){let i=e.next,o=0,a=r+1;for(;zje(i);){if(vm(i)){if(t)return!1;a=0}else a++;i=e.peek(++o)}if(!(i>=0&&(i==58?tY(e.peek(o+1),n):i==35?e.peek(o-1)!=32:tY(i,n)))||!n&&a<=r||a==0&&!n&&(uT(e,45,o)||uT(e,46,o)))break;if(t&&TL(i)=="f")return!1;for(let l=o;l>=0;l--)e.advance();if(t&&e.pos>s+1024)return!1}return!0}const VQt=new Vn((e,t)=>{if(e.next==33)Bje(e),e.acceptToken(NQt);else if(e.next==38||e.next==42){let n=e.next==38?PQt:$Qt;aZ(e),e.acceptToken(n)}else e.next==39||e.next==34?(Sse(e,!1),e.acceptToken(RQt)):Fje(e,!1,t.context.type==KR,t.context.depth)&&e.acceptToken(CQt)}),qQt=new Vn((e,t)=>{let n=t.context.type==iZ?t.context.depth:-1,r=e.pos;e:for(;;){let s=0,i=e.next;for(;i==32;)i=e.peek(++s);if(!s&&(uT(e,45,s)||uT(e,46,s))||!vm(i)&&(n<0&&(n=Math.max(t.context.depth+1,s)),s<n))break;for(;;){if(e.next<0)break e;let o=vm(e.next);if(e.advance(),o)continue e;r=e.pos}}e.acceptTokenTo(Uje,r)}),WQt=go({DirectiveName:X.keyword,DirectiveContent:X.attributeValue,"DirectiveEnd DocEnd":X.meta,QuotedLiteral:X.string,BlockLiteralHeader:X.special(X.string),BlockLiteralContent:X.content,Literal:X.content,"Key/Literal Key/QuotedLiteral":X.definition(X.propertyName),"Anchor Alias":X.labelName,Tag:X.typeName,Comment:X.lineComment,": , -":X.separator,"?":X.punctuation,"[ ]":X.squareBracket,"{ }":X.brace}),GQt=ho.deserialize({version:14,states:"5lQ!ZQgOOO#PQfO'#CpO#uQfO'#DOOOQR'#Dv'#DvO$qQgO'#DRO%gQdO'#DUO%nQgO'#DUO&ROaO'#D[OOQR'#Du'#DuO&{QgO'#D^O'rQgO'#D`OOQR'#Dt'#DtO(iOqO'#Db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R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:XQt,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[WQt],skippedNod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stream:[0,15]},tokenPrec:0}),HQt=ho.deserialize({version:14,states:"!vOQOPOOO]OPO'#C_OhOPO'#C^OOOO'#Cc'#CcOpOPO'#CaQOOOOOO{OPOOOOOO'#Cb'#CbO!WOPO'#C`O!`OPO,58xOOOO-E6a-E6aOOOO-E6`-E6`OOOO'#C_'#C_OOOO1G.d1G.d",stateData:"!h~OXPOYROWTP~OWVXXRXYRX~OYVOXSP~OXROYROWTX~OXROYROWTP~OYVOXSX~OX[O~OXY~",goto:"vWPPX[beioRUOQQOR]XRXQTTOUQWQRZWSSOURYS",nodeNames:"⚠ Document Frontmatter DashLine FrontmatterContent Body",maxTerm:10,skippedNodes:[0],repeatNodeCount:2,tokenData:"$z~RXOYnYZ!^Z]n]^!^^}n}!O!i!O;'Sn;'S;=`!c<%lOn~qXOYnYZ!^Z]n]^!^^;'Sn;'S;=`!c<%l~n~On~~!^~!cOY~~!fP;=`<%ln~!lZOYnYZ!^Z]n]^!^^}n}!O#_!O;'Sn;'S;=`!c<%l~n~On~~!^~#bZOYnYZ!^Z]n]^!^^}n}!O$T!O;'Sn;'S;=`!c<%l~n~On~~!^~$WXOYnYZ$sZ]n]^$s^;'Sn;'S;=`!c<%l~n~On~~$s~$zOX~Y~",tokenizers:[0],topRules:{Document:[0,1]},tokenPrec:67}),vse=mo.define({name:"yaml",parser:GQt.configure({props:[_o.add({Stream:e=>{for(let t=e.node.resolve(e.pos,-1);t&&t.to>=e.pos;t=t.parent){if(t.name=="BlockLiteralContent"&&t.from<t.to)return e.baseIndentFor(t);if(t.name=="BlockLiteral")return e.baseIndentFor(t)+e.unit;if(t.name=="BlockSequence"||t.name=="BlockMapping")return e.column(t.from,1);if(t.name=="QuotedLiteral")return null;if(t.name=="Literal"){let n=e.column(t.from,1);if(n==e.lineIndent(t.from,1))return n;if(t.to>e.pos)return null}}return null},FlowMapping:_f({closing:"}"}),FlowSequence:_f({closing:"]"})}),bo.add({"FlowMapping FlowSequence":td,"Item Pair BlockLiteral":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function Yje(){return new qi(vse)}const ZQt=mo.define({name:"yaml-frontmatter",parser:HQt.configure({props:[go({DashLine:X.meta})]})});function KQt(e){let{language:t,support:n}=e.content instanceof qi?e.content:{language:e.content,support:[]};return new qi(ZQt.configure({wrap:MU(r=>r.name=="FrontmatterContent"?{parser:vse.parser}:r.name=="Body"?{parser:t.parser}:null)}),n)}const JQt=Object.freeze(Object.defineProperty({__proto__:null,yaml:Yje,yamlFrontmatter:KQt,yamlLanguage:vse},Symbol.toStringTag,{value:"Module"}));function pt(e){return new qi(Bre.define(e))}function lO(e){return Me(()=>Promise.resolve().then(()=>JMt),void 0).then(t=>t.sql({dialect:t[e]}))}const e2t=[qe.of({name:"C",extensions:["c","h","ino"],load(){return Me(()=>Promise.resolve().then(()=>dme),void 0).then(e=>e.cpp())}}),qe.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return Me(()=>Promise.resolve().then(()=>dme),void 0).then(e=>e.cpp())}}),qe.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return lO("Cassandra")}}),qe.of({name:"CSS",extensions:["css"],load(){return Me(()=>Promise.resolve().then(()=>Kkt),void 0).then(e=>e.css())}}),qe.of({name:"Go",extensions:["go"],load(){return Me(()=>Promise.resolve().then(()=>FCt),void 0).then(e=>e.go())}}),qe.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return Me(()=>Promise.resolve().then(()=>yPt),void 0).then(e=>e.html())}}),qe.of({name:"Java",extensions:["java"],load(){return Me(()=>Promise.resolve().then(()=>TPt),void 0).then(e=>e.java())}}),qe.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return Me(()=>Promise.resolve().then(()=>sI),void 0).then(e=>e.javascript())}}),qe.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return Me(()=>import("./index-BKaFIpCM.js"),__vite__mapDeps([0,1])).then(e=>e.jinja())}}),qe.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return Me(()=>Promise.resolve().then(()=>RPt),void 0).then(e=>e.json())}}),qe.of({name:"JSX",extensions:["jsx"],load(){return Me(()=>Promise.resolve().then(()=>sI),void 0).then(e=>e.javascript({jsx:!0}))}}),qe.of({name:"LESS",extensions:["less"],load(){return Me(()=>Promise.resolve().then(()=>XPt),void 0).then(e=>e.less())}}),qe.of({name:"Liquid",extensions:["liquid"],load(){return Me(()=>import("./index-DtQcKlpQ.js"),__vite__mapDeps([2,1])).then(e=>e.liquid())}}),qe.of({name:"MariaDB SQL",load(){return lO("MariaSQL")}}),qe.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return Me(()=>Promise.resolve().then(()=>v$t),void 0).then(e=>e.markdown())}}),qe.of({name:"MS SQL",load(){return lO("MSSQL")}}),qe.of({name:"MySQL",load(){return lO("MySQL")}}),qe.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return Me(()=>Promise.resolve().then(()=>qNt),void 0).then(e=>e.php())}}),qe.of({name:"PLSQL",extensions:["pls"],load(){return lO("PLSQL")}}),qe.of({name:"PostgreSQL",load(){return lO("PostgreSQL")}}),qe.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return Me(()=>Promise.resolve().then(()=>aIt),void 0).then(e=>e.python())}}),qe.of({name:"Rust",extensions:["rs"],load(){return Me(()=>Promise.resolve().then(()=>kIt),void 0).then(e=>e.rust())}}),qe.of({name:"Sass",extensions:["sass"],load(){return Me(()=>Promise.resolve().then(()=>SOe),void 0).then(e=>e.sass({indented:!0}))}}),qe.of({name:"SCSS",extensions:["scss"],load(){return Me(()=>Promise.resolve().then(()=>SOe),void 0).then(e=>e.sass())}}),qe.of({name:"SQL",extensions:["sql"],load(){return lO("StandardSQL")}}),qe.of({name:"SQLite",load(){return lO("SQLite")}}),qe.of({name:"TSX",extensions:["tsx"],load(){return Me(()=>Promise.resolve().then(()=>sI),void 0).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),qe.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return Me(()=>Promise.resolve().then(()=>sI),void 0).then(e=>e.javascript({typescript:!0}))}}),qe.of({name:"WebAssembly",extensions:["wat","wast"],load(){return Me(()=>import("./index-S1N6sZeQ.js"),__vite__mapDeps([3,1])).then(e=>e.wast())}}),qe.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return Me(()=>Promise.resolve().then(()=>xQt),void 0).then(e=>e.xml())}}),qe.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return Me(()=>Promise.resolve().then(()=>JQt),void 0).then(e=>e.yaml())}}),qe.of({name:"APL",extensions:["dyalog","apl"],load(){return Me(()=>import("./apl-B4CMkyY2.js"),[]).then(e=>pt(e.apl))}}),qe.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return Me(()=>import("./asciiarmor-Df11BRmG.js"),[]).then(e=>pt(e.asciiArmor))}}),qe.of({name:"ASN.1",extensions:["asn","asn1"],load(){return Me(()=>import("./asn1-EdZsLKOL.js"),[]).then(e=>pt(e.asn1({})))}}),qe.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return Me(()=>import("./asterisk-B-8jnY81.js"),[]).then(e=>pt(e.asterisk))}}),qe.of({name:"Brainfuck",extensions:["b","bf"],load(){return Me(()=>import("./brainfuck-C4LP7Hcl.js"),[]).then(e=>pt(e.brainfuck))}}),qe.of({name:"Cobol",extensions:["cob","cpy"],load(){return Me(()=>import("./cobol-CWcv1MsR.js"),[]).then(e=>pt(e.cobol))}}),qe.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return Me(()=>import("./clike-B9uivgTg.js"),[]).then(e=>pt(e.csharp))}}),qe.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return Me(()=>import("./clojure-BMjYHr_A.js"),[]).then(e=>pt(e.clojure))}}),qe.of({name:"ClojureScript",extensions:["cljs"],load(){return Me(()=>import("./clojure-BMjYHr_A.js"),[]).then(e=>pt(e.clojure))}}),qe.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return Me(()=>import("./css-BnMrqG3P.js"),[]).then(e=>pt(e.gss))}}),qe.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return Me(()=>import("./cmake-BQqOBYOt.js"),[]).then(e=>pt(e.cmake))}}),qe.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return Me(()=>import("./coffeescript-S37ZYGWr.js"),[]).then(e=>pt(e.coffeeScript))}}),qe.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return Me(()=>import("./commonlisp-DBKNyK5s.js"),[]).then(e=>pt(e.commonLisp))}}),qe.of({name:"Cypher",extensions:["cyp","cypher"],load(){return Me(()=>import("./cypher-C_CwsFkJ.js"),[]).then(e=>pt(e.cypher))}}),qe.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return Me(()=>import("./python-BuPzkPfP.js"),[]).then(e=>pt(e.cython))}}),qe.of({name:"Crystal",extensions:["cr"],load(){return Me(()=>import("./crystal-SjHAIU92.js"),[]).then(e=>pt(e.crystal))}}),qe.of({name:"D",extensions:["d"],load(){return Me(()=>import("./d-pRatUO7H.js"),[]).then(e=>pt(e.d))}}),qe.of({name:"Dart",extensions:["dart"],load(){return Me(()=>import("./clike-B9uivgTg.js"),[]).then(e=>pt(e.dart))}}),qe.of({name:"diff",extensions:["diff","patch"],load(){return Me(()=>import("./diff-DbItnlRl.js"),[]).then(e=>pt(e.diff))}}),qe.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return Me(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([4,5])).then(e=>pt(e.dockerFile))}}),qe.of({name:"DTD",extensions:["dtd"],load(){return Me(()=>import("./dtd-DF_7sFjM.js"),[]).then(e=>pt(e.dtd))}}),qe.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return Me(()=>import("./dylan-DwRh75JA.js"),[]).then(e=>pt(e.dylan))}}),qe.of({name:"EBNF",load(){return Me(()=>import("./ebnf-CDyGwa7X.js"),[]).then(e=>pt(e.ebnf))}}),qe.of({name:"ECL",extensions:["ecl"],load(){return Me(()=>import("./ecl-Cabwm37j.js"),[]).then(e=>pt(e.ecl))}}),qe.of({name:"edn",extensions:["edn"],load(){return Me(()=>import("./clojure-BMjYHr_A.js"),[]).then(e=>pt(e.clojure))}}),qe.of({name:"Eiffel",extensions:["e"],load(){return Me(()=>import("./eiffel-CnydiIhH.js"),[]).then(e=>pt(e.eiffel))}}),qe.of({name:"Elm",extensions:["elm"],load(){return Me(()=>import("./elm-vLlmbW-K.js"),[]).then(e=>pt(e.elm))}}),qe.of({name:"Erlang",extensions:["erl"],load(){return Me(()=>import("./erlang-BNw1qcRV.js"),[]).then(e=>pt(e.erlang))}}),qe.of({name:"Esper",load(){return Me(()=>import("./sql-D0XecflT.js"),[]).then(e=>pt(e.esper))}}),qe.of({name:"Factor",extensions:["factor"],load(){return Me(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([6,5])).then(e=>pt(e.factor))}}),qe.of({name:"FCL",load(){return Me(()=>import("./fcl-Kvtd6kyn.js"),[]).then(e=>pt(e.fcl))}}),qe.of({name:"Forth",extensions:["forth","fth","4th"],load(){return Me(()=>import("./forth-Ffai-XNe.js"),[]).then(e=>pt(e.forth))}}),qe.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return Me(()=>import("./fortran-DYz_wnZ1.js"),[]).then(e=>pt(e.fortran))}}),qe.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return Me(()=>import("./mllike-CXdrOF99.js"),[]).then(e=>pt(e.fSharp))}}),qe.of({name:"Gas",extensions:["s"],load(){return Me(()=>import("./gas-Bneqetm1.js"),[]).then(e=>pt(e.gas))}}),qe.of({name:"Gherkin",extensions:["feature"],load(){return Me(()=>import("./gherkin-heZmZLOM.js"),[]).then(e=>pt(e.gherkin))}}),qe.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return Me(()=>import("./groovy-D9Dt4D0W.js"),[]).then(e=>pt(e.groovy))}}),qe.of({name:"Haskell",extensions:["hs"],load(){return Me(()=>import("./haskell-BWDZoCOh.js"),[]).then(e=>pt(e.haskell))}}),qe.of({name:"Haxe",extensions:["hx"],load(){return Me(()=>import("./haxe-H-WmDvRZ.js"),[]).then(e=>pt(e.haxe))}}),qe.of({name:"HXML",extensions:["hxml"],load(){return Me(()=>import("./haxe-H-WmDvRZ.js"),[]).then(e=>pt(e.hxml))}}),qe.of({name:"HTTP",load(){return Me(()=>import("./http-DBlCnlav.js"),[]).then(e=>pt(e.http))}}),qe.of({name:"IDL",extensions:["pro"],load(){return Me(()=>import("./idl-BEugSyMb.js"),[]).then(e=>pt(e.idl))}}),qe.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return Me(()=>import("./javascript-qCveANmP.js"),[]).then(e=>pt(e.jsonld))}}),qe.of({name:"Julia",extensions:["jl"],load(){return Me(()=>import("./julia-DuME0IfC.js"),[]).then(e=>pt(e.julia))}}),qe.of({name:"Kotlin",extensions:["kt","kts"],load(){return Me(()=>import("./clike-B9uivgTg.js"),[]).then(e=>pt(e.kotlin))}}),qe.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return Me(()=>import("./livescript-BwQOo05w.js"),[]).then(e=>pt(e.liveScript))}}),qe.of({name:"Lua",extensions:["lua"],load(){return Me(()=>import("./lua-BgMRiT3U.js"),[]).then(e=>pt(e.lua))}}),qe.of({name:"mIRC",extensions:["mrc"],load(){return Me(()=>import("./mirc-CjQqDB4T.js"),[]).then(e=>pt(e.mirc))}}),qe.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return Me(()=>import("./mathematica-DTrFuWx2.js"),[]).then(e=>pt(e.mathematica))}}),qe.of({name:"Modelica",extensions:["mo"],load(){return Me(()=>import("./modelica-Dc1JOy9r.js"),[]).then(e=>pt(e.modelica))}}),qe.of({name:"MUMPS",extensions:["mps"],load(){return Me(()=>import("./mumps-BT43cFF4.js"),[]).then(e=>pt(e.mumps))}}),qe.of({name:"Mbox",extensions:["mbox"],load(){return Me(()=>import("./mbox-CNhZ1qSd.js"),[]).then(e=>pt(e.mbox))}}),qe.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return Me(()=>import("./nginx-DdIZxoE0.js"),[]).then(e=>pt(e.nginx))}}),qe.of({name:"NSIS",extensions:["nsh","nsi"],load(){return Me(()=>import("./nsis-LdVXkNf5.js"),__vite__mapDeps([7,5])).then(e=>pt(e.nsis))}}),qe.of({name:"NTriples",extensions:["nt","nq"],load(){return Me(()=>import("./ntriples-BfvgReVJ.js"),[]).then(e=>pt(e.ntriples))}}),qe.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return Me(()=>import("./clike-B9uivgTg.js"),[]).then(e=>pt(e.objectiveC))}}),qe.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return Me(()=>import("./clike-B9uivgTg.js"),[]).then(e=>pt(e.objectiveCpp))}}),qe.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return Me(()=>import("./mllike-CXdrOF99.js"),[]).then(e=>pt(e.oCaml))}}),qe.of({name:"Octave",extensions:["m"],load(){return Me(()=>import("./octave-Ck1zUtKM.js"),[]).then(e=>pt(e.octave))}}),qe.of({name:"Oz",extensions:["oz"],load(){return Me(()=>import("./oz-BzwKVEFT.js"),[]).then(e=>pt(e.oz))}}),qe.of({name:"Pascal",extensions:["p","pas"],load(){return Me(()=>import("./pascal--L3eBynH.js"),[]).then(e=>pt(e.pascal))}}),qe.of({name:"Perl",extensions:["pl","pm"],load(){return Me(()=>import("./perl-CdXCOZ3F.js"),[]).then(e=>pt(e.perl))}}),qe.of({name:"Pig",extensions:["pig"],load(){return Me(()=>import("./pig-CevX1Tat.js"),[]).then(e=>pt(e.pig))}}),qe.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return Me(()=>import("./powershell-CFHJl5sT.js"),[]).then(e=>pt(e.powerShell))}}),qe.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return Me(()=>import("./properties-C78fOPTZ.js"),[]).then(e=>pt(e.properties))}}),qe.of({name:"ProtoBuf",extensions:["proto"],load(){return Me(()=>import("./protobuf-ChK-085T.js"),[]).then(e=>pt(e.protobuf))}}),qe.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return Me(()=>import("./pug-DukmZTjD.js"),__vite__mapDeps([8,9])).then(e=>pt(e.pug))}}),qe.of({name:"Puppet",extensions:["pp"],load(){return Me(()=>import("./puppet-DMA9R1ak.js"),[]).then(e=>pt(e.puppet))}}),qe.of({name:"Q",extensions:["q"],load(){return Me(()=>import("./q-pXgVlZs6.js"),[]).then(e=>pt(e.q))}}),qe.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return Me(()=>import("./r-DUYO_cvP.js"),[]).then(e=>pt(e.r))}}),qe.of({name:"RPM Changes",load(){return Me(()=>import("./rpm-CTu-6PCP.js"),[]).then(e=>pt(e.rpmChanges))}}),qe.of({name:"RPM Spec",extensions:["spec"],load(){return Me(()=>import("./rpm-CTu-6PCP.js"),[]).then(e=>pt(e.rpmSpec))}}),qe.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return Me(()=>import("./ruby-B2Rjki9n.js"),[]).then(e=>pt(e.ruby))}}),qe.of({name:"SAS",extensions:["sas"],load(){return Me(()=>import("./sas-B4kiWyti.js"),[]).then(e=>pt(e.sas))}}),qe.of({name:"Scala",extensions:["scala"],load(){return Me(()=>import("./clike-B9uivgTg.js"),[]).then(e=>pt(e.scala))}}),qe.of({name:"Scheme",extensions:["scm","ss"],load(){return Me(()=>import("./scheme-C41bIUwD.js"),[]).then(e=>pt(e.scheme))}}),qe.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return Me(()=>import("./shell-CjFT_Tl9.js"),[]).then(e=>pt(e.shell))}}),qe.of({name:"Sieve",extensions:["siv","sieve"],load(){return Me(()=>import("./sieve-C3Gn_uJK.js"),[]).then(e=>pt(e.sieve))}}),qe.of({name:"Smalltalk",extensions:["st"],load(){return Me(()=>import("./smalltalk-CnHTOXQT.js"),[]).then(e=>pt(e.smalltalk))}}),qe.of({name:"Solr",load(){return Me(()=>import("./solr-DehyRSwq.js"),[]).then(e=>pt(e.solr))}}),qe.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return Me(()=>import("./mllike-CXdrOF99.js"),[]).then(e=>pt(e.sml))}}),qe.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return Me(()=>import("./sparql-DkYu6x3z.js"),[]).then(e=>pt(e.sparql))}}),qe.of({name:"Spreadsheet",alias:["excel","formula"],load(){return Me(()=>import("./spreadsheet-BCZA_wO0.js"),[]).then(e=>pt(e.spreadsheet))}}),qe.of({name:"Squirrel",extensions:["nut"],load(){return Me(()=>import("./clike-B9uivgTg.js"),[]).then(e=>pt(e.squirrel))}}),qe.of({name:"Stylus",extensions:["styl"],load(){return Me(()=>import("./stylus-B533Al4x.js"),[]).then(e=>pt(e.stylus))}}),qe.of({name:"Swift",extensions:["swift"],load(){return Me(()=>import("./swift-BzpIVaGY.js"),[]).then(e=>pt(e.swift))}}),qe.of({name:"sTeX",load(){return Me(()=>import("./stex-C3f8Ysf7.js"),[]).then(e=>pt(e.stex))}}),qe.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return Me(()=>import("./stex-C3f8Ysf7.js"),[]).then(e=>pt(e.stex))}}),qe.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return Me(()=>import("./verilog-C6RDOZhf.js"),[]).then(e=>pt(e.verilog))}}),qe.of({name:"Tcl",extensions:["tcl"],load(){return Me(()=>import("./tcl-DVfN8rqt.js"),[]).then(e=>pt(e.tcl))}}),qe.of({name:"Textile",extensions:["textile"],load(){return Me(()=>import("./textile-CnDTJFAw.js"),[]).then(e=>pt(e.textile))}}),qe.of({name:"TiddlyWiki",load(){return Me(()=>import("./tiddlywiki-DO-Gjzrf.js"),[]).then(e=>pt(e.tiddlyWiki))}}),qe.of({name:"Tiki wiki",load(){return Me(()=>import("./tiki-DGYXhP31.js"),[]).then(e=>pt(e.tiki))}}),qe.of({name:"TOML",extensions:["toml"],load(){return Me(()=>import("./toml-Bm5Em-hy.js"),[]).then(e=>pt(e.toml))}}),qe.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return Me(()=>import("./troff-wAsdV37c.js"),[]).then(e=>pt(e.troff))}}),qe.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return Me(()=>import("./ttcn-CfJYG6tj.js"),[]).then(e=>pt(e.ttcn))}}),qe.of({name:"TTCN_CFG",extensions:["cfg"],load(){return Me(()=>import("./ttcn-cfg-B9xdYoR4.js"),[]).then(e=>pt(e.ttcnCfg))}}),qe.of({name:"Turtle",extensions:["ttl"],load(){return Me(()=>import("./turtle-B1tBg_DP.js"),[]).then(e=>pt(e.turtle))}}),qe.of({name:"Web IDL",extensions:["webidl"],load(){return Me(()=>import("./webidl-ZXfAyPTL.js"),[]).then(e=>pt(e.webIDL))}}),qe.of({name:"VB.NET",extensions:["vb"],load(){return Me(()=>import("./vb-CmGdzxic.js"),[]).then(e=>pt(e.vb))}}),qe.of({name:"VBScript",extensions:["vbs"],load(){return Me(()=>import("./vbscript-BuJXcnF6.js"),[]).then(e=>pt(e.vbScript))}}),qe.of({name:"Velocity",extensions:["vtl"],load(){return Me(()=>import("./velocity-D8B20fx6.js"),[]).then(e=>pt(e.velocity))}}),qe.of({name:"Verilog",extensions:["v"],load(){return Me(()=>import("./verilog-C6RDOZhf.js"),[]).then(e=>pt(e.verilog))}}),qe.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return Me(()=>import("./vhdl-lSbBsy5d.js"),[]).then(e=>pt(e.vhdl))}}),qe.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return Me(()=>import("./xquery-CQfU5ijd.js"),[]).then(e=>pt(e.xQuery))}}),qe.of({name:"Yacas",extensions:["ys"],load(){return Me(()=>import("./yacas-BJ4BC0dw.js"),[]).then(e=>pt(e.yacas))}}),qe.of({name:"Z80",extensions:["z80"],load(){return Me(()=>import("./z80-Hz9HOZM7.js"),[]).then(e=>pt(e.z80))}}),qe.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return Me(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(e=>pt(e.mscgen))}}),qe.of({name:"Xù",extensions:["xu"],load(){return Me(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(e=>pt(e.xu))}}),qe.of({name:"MsGenny",extensions:["msgenny"],load(){return Me(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(e=>pt(e.msgenny))}}),qe.of({name:"Vue",extensions:["vue"],load(){return Me(()=>import("./index-BRqo7Dsl.js"),__vite__mapDeps([10,1])).then(e=>e.vue())}}),qe.of({name:"Angular Template",load(){return Me(()=>import("./index-BgayBDco.js"),__vite__mapDeps([11,1])).then(e=>e.angular())}})];function Vje(e){const t=e.split(".").pop()?.toLowerCase();switch(t){case"ts":case"tsx":case"js":case"jsx":case"mjs":case"cjs":return ise({jsx:t==="tsx"||t==="jsx",typescript:t==="ts"||t==="tsx"});case"py":return Oje();case"json":case"jsonl":return O5e();case"css":return qre();case"scss":return Z7({indented:!1});case"sass":return Z7({indented:!0});case"less":return b5e();case"html":case"htm":return KU();case"xml":case"svg":return Qje();case"md":case"mdx":case"markdown":return J5e();case"yaml":case"yml":return Yje();case"rs":return _je();case"go":return MLe();case"java":return h5e();case"c":case"h":case"cpp":case"cxx":case"cc":case"hpp":return xLe();case"php":return rje();case"sql":return $je();default:return null}}function oZn(e){return qe.matchFilename(e2t,e)}function nY(e){const t=e.split(".").pop()?.toLowerCase();return{ts:"TypeScript",tsx:"TypeScript (JSX)",js:"JavaScript",jsx:"JavaScript (JSX)",mjs:"JavaScript",cjs:"JavaScript",py:"Python",json:"JSON",jsonl:"JSON Lines",css:"CSS",scss:"SCSS",sass:"Sass",less:"Less",html:"HTML",htm:"HTML",xml:"XML",svg:"SVG",md:"Markdown",mdx:"MDX",markdown:"Markdown",yaml:"YAML",yml:"YAML",rs:"Rust",go:"Go",java:"Java",c:"C",h:"C/C++ Header",cpp:"C++",cxx:"C++",cc:"C++",hpp:"C++ Header",php:"PHP",sql:"SQL",sh:"Shell",bash:"Bash",zsh:"Zsh",toml:"TOML",ini:"INI",conf:"Config",txt:"Plain Text"}[t??""]??"Plain Text"}let bp=null,V_=null,fx=null;const kp={register(e,t,n){bp=e,V_=t,fx=n},unregister(){bp=null,V_=null,fx=null},get isRegistered(){return bp!==null},getContent(e){return bp?.get(e)?.doc.toString()??null},getAllModifiedContent(e){const t=new Map;for(const n of Object.keys(e)){if(!e[n])continue;const r=bp?.get(n)?.doc.toString();r!==void 0&&t.set(n,r)}return t},deleteState(e){bp?.delete(e),V_?.delete(e)},destroy(){fx?.destroy(),bp?.clear(),V_?.clear(),fx=null},remapState(e,t){const n=bp?.get(e);n&&(bp.delete(e),bp.set(t,n));const r=V_?.get(e);r!==void 0&&(V_.delete(e),V_.set(t,r))},updateView(e){fx=e},getView(){return fx}},t2t=1e4;let nC=null;const lZ=new Set;function n2t(e){return lZ.add(e),()=>lZ.delete(e)}function r2t(){nC=null,lZ.forEach(e=>e())}function Vw(e){return nC?.projectPath===e&&Date.now()-nC.timestamp<t2t?{files:nC.files}:null}function qje(e,t){nC={files:t,projectPath:e,timestamp:Date.now()}}function uI(e){if(e.length===0)return e;if(e.length===1){const r=e[0];return r.disambiguatedLabel===void 0?e:[{...r,disambiguatedLabel:void 0}]}const t=new Map;for(const r of e){const s=t.get(r.fileName);s?s.push(r):t.set(r.fileName,[r])}const n=new Map;for(const[,r]of t){if(r.length<=1){for(const a of r)n.set(a.id,void 0);continue}const s=r.map(a=>{const c=el(a.filePath);return c.pop(),c});let i=1;const o=Math.max(...s.map(a=>a.length));for(;i<=o;){const a=s.map(l=>{const d=Math.max(0,l.length-i);return l.slice(d).join("/")});if(new Set(a).size===a.length){for(let l=0;l<r.length;l++)n.set(r[l].id,`(${a[l]})`);break}i++}if(i>o)for(let a=0;a<r.length;a++){const c=s[a].join("/");n.set(r[a].id,`(${c})`)}}return e.map(r=>{const s=n.get(r.id);return s===r.disambiguatedLabel?r:{...r,disambiguatedLabel:s}})}const _s=Hi("Store:editor");function li(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}const od=new Map,s2t=2e3;let rY=null;const i2t=1500,sY=new Map,o2t=350;let iY=null,dI={change:0,create:0,delete:0},D0=null,EL="",L0=null,wL="";const a2t=250,l2t=120;function R1(e){const t=e();if(!t.editorWatcherEnabled)return;const n=t.editorProjectPath;if(!n)return;const r=t.editorOpenTabs.map(i=>i.filePath).filter(Boolean);r.sort((i,o)=>i.localeCompare(o));const s=`${n}
1038
1038
  ${r.join(`
1039
1039
  `)}`;s!==EL&&(EL=s,D0&&clearTimeout(D0),D0=setTimeout(()=>{D0=null,K.editor.setWatchedFiles(r)},150))}function oY(e){const t=e();if(!t.editorWatcherEnabled)return;const n=t.editorProjectPath;if(!n)return;const r=Object.entries(t.editorExpandedDirs).filter(([,o])=>o===!0).map(([o])=>o),s=[n,...r].slice(0,l2t);s.sort((o,a)=>o.localeCompare(a));const i=`${n}
1040
1040
  ${s.join(`
1041
- `)}`;i!==wL&&(wL=i,L0&&clearTimeout(L0),L0=setTimeout(()=>{L0=null,K.editor.setWatchedDirs(s)},a2t))}let q_=0;const hx=new Map,c2t=2e3;function u2t(e){try{const t=window.requestIdleCallback;if(typeof t=="function"){t(e,{timeout:2e3});return}}catch{}setTimeout(e,150)}const d2t=(e,t)=>({editorProjectPath:null,editorFileTree:null,editorFileTreeLoading:!1,editorFileTreeError:null,editorExpandedDirs:{},editorOpenTabs:[],editorActiveTabId:null,editorFileLoading:{},editorModifiedFiles:{},editorSaving:{},editorSaveError:{},editorCreating:!1,editorCreateError:null,editorGitFiles:[],editorGitBranch:null,editorIsGitRepo:!1,editorGitLoading:!1,editorWatcherEnabled:!1,editorLineWrap:(()=>{try{return localStorage.getItem("editor-line-wrap")==="true"}catch{return!1}})(),editorExternalChanges:{},editorFileMtimes:{},editorConflictFile:null,editorPendingGoToLine:null,editorPendingRevealFile:null,setPendingGoToLine:n=>e({editorPendingGoToLine:n}),revealFileInEditor:n=>{e({editorPendingRevealFile:n})},revealFolderInEditor:n=>{e({editorPendingRevealFile:n});const{editorProjectPath:r,editorFileTree:s,expandDirectory:i}=t();if(!r||!s)return;const o=kR(r),a=el(o),c=el(n),l=Qc(o),d=(f,h)=>l?f.toLowerCase()===h.toLowerCase():f===h;if(c.length>=a.length&&a.every((f,h)=>d(f,c[h]))){const f=c.slice(a.length);let h=o;(async()=>{for(const O of f)h=ZD(h,O),await i(h);e({editorPendingRevealFile:null})})()}},clearPendingRevealFile:()=>{e({editorPendingRevealFile:null})},revealAndOpenFile:async n=>{const{editorProjectPath:r,editorFileTree:s,expandDirectory:i,openFile:o}=t();if(!r)return;if(!s){_s.info("revealAndOpenFile: tree not loaded yet, deferring reveal");return}const a=kR(r),c=el(a),l=el(n),d=Qc(a),p=(h,m)=>d?h.toLowerCase()===m.toLowerCase():h===m;if(l.length>=c.length&&c.every((h,m)=>p(h,l[m]))){const h=l.slice(c.length);let m=a;for(let O=0;O<h.length-1;O++)m=ZD(m,h[O]??""),await i(m)}o(n),e({editorPendingRevealFile:null})},openEditor:async n=>{const r=++q_;e({editorProjectPath:n,editorFileTree:null,editorFileTreeLoading:!0,editorFileTreeError:null,editorExpandedDirs:{},editorOpenTabs:[],editorActiveTabId:null,editorFileLoading:{},editorModifiedFiles:{},editorSaving:{},editorSaveError:{},editorCreating:!1,editorCreateError:null,editorGitFiles:[],editorGitBranch:null,editorIsGitRepo:!1,editorGitLoading:!1,editorWatcherEnabled:!1,editorExternalChanges:{},editorFileMtimes:{},editorConflictFile:null,editorPendingGoToLine:null});try{const s=performance.now();await K.editor.open(n);const i=performance.now()-s;if(q_!==r||t().editorProjectPath!==n)return;const o=performance.now(),a=await K.editor.readDir(n),c=performance.now()-o;if(q_!==r||t().editorProjectPath!==n)return;const l=performance.now();e({editorFileTree:a.entries,editorFileTreeLoading:!1});const d=performance.now()-l;_s.info(`[perf] openEditor: open=${i.toFixed(1)}ms, readDir=${c.toFixed(1)}ms, set=${d.toFixed(1)}ms, entries=${a.entries.length}`);const p=(()=>{try{return localStorage.getItem("editor-watcher-enabled")!=="false"}catch{return!0}})();u2t(()=>{q_!==r||t().editorProjectPath!==n||(p&&t().toggleWatcher(!0),setTimeout(()=>{q_!==r||t().editorProjectPath!==n||t().fetchGitStatus()},1200))})}catch(s){if(q_!==r||t().editorProjectPath!==n)return;const i=s instanceof Error?s.message:String(s);_s.error("Failed to open editor:",i),e({editorFileTreeLoading:!1,editorFileTreeError:i})}},closeEditor:()=>{q_++,D0&&(clearTimeout(D0),D0=null),L0&&(clearTimeout(L0),L0=null),EL="",wL="",od.clear(),hx.clear(),K.editor.close().catch(n=>{_s.error("editor:close failed:",n)}),kp.destroy(),e({editorProjectPath:null,editorFileTree:null,editorFileTreeLoading:!1,editorFileTreeError:null,editorExpandedDirs:{},editorOpenTabs:[],editorActiveTabId:null,editorFileLoading:{},editorModifiedFiles:{},editorSaving:{},editorSaveError:{},editorCreating:!1,editorCreateError:null,editorGitFiles:[],editorGitBranch:null,editorIsGitRepo:!1,editorGitLoading:!1,editorWatcherEnabled:!1,editorExternalChanges:{},editorFileMtimes:{},editorConflictFile:null,editorPendingGoToLine:null})},loadFileTree:async n=>{e({editorFileTreeLoading:!0,editorFileTreeError:null});try{const r=performance.now(),s=await K.editor.readDir(n),i=performance.now()-r,o=performance.now();e({editorFileTree:s.entries,editorFileTreeLoading:!1});const a=performance.now()-o;_s.info(`[perf] loadFileTree: IPC=${i.toFixed(1)}ms, set=${a.toFixed(1)}ms, entries=${s.entries.length}`)}catch(r){const s=r instanceof Error?r.message:String(r);_s.error("Failed to load file tree:",s),e({editorFileTreeLoading:!1,editorFileTreeError:s})}},expandDirectory:async n=>{const{editorExpandedDirs:r}=t(),s=!!r[n];s||(e({editorExpandedDirs:{...r,[n]:!0}}),oY(t));try{const i=performance.now(),o=await K.editor.readDir(n),a=performance.now()-i,c=t().editorFileTree,l=performance.now(),d=Tse(c??[],n,o.entries),p=performance.now()-l,f=performance.now();e({editorFileTree:d});const h=performance.now()-f;_s.info(`[perf] expandDirectory: IPC=${a.toFixed(1)}ms, merge=${p.toFixed(1)}ms, set=${h.toFixed(1)}ms, entries=${o.entries.length}, wasExpanded=${s}`)}catch(i){const o=i instanceof Error?i.message:String(i);_s.error("Failed to expand directory:",o);const a=t().editorExpandedDirs;e({editorExpandedDirs:li(a,n)})}},collapseDirectory:n=>{const{editorExpandedDirs:r}=t();e({editorExpandedDirs:li(r,n)}),oY(t)},openFile:n=>{const{editorOpenTabs:r}=t(),s=r.find(l=>l.filePath===n);if(s){e({editorActiveTabId:s.id});return}const i=Of(n)||"file",o=nY(i),a={id:n,filePath:n,fileName:i,language:o},c=uI([...r,a]);e({editorOpenTabs:c,editorActiveTabId:a.id}),R1(t)},closeEditorTab:n=>{const{editorOpenTabs:r,editorActiveTabId:s,editorModifiedFiles:i,editorSaveError:o}=t(),a=r.filter(f=>f.id!==n),c=li(i,n),l=li(o,n);kp.deleteState(n);try{localStorage.removeItem(`editor-draft:${n}`)}catch{}let d=s;if(s===n){const f=r.findIndex(h=>h.id===n);a.length>0?d=a[Math.min(f,a.length-1)].id:d=null}const p=uI(a);e({editorOpenTabs:p,editorActiveTabId:d,editorModifiedFiles:c,editorSaveError:l}),R1(t)},closeOtherEditorTabs:n=>{const{editorOpenTabs:r}=t(),s=r.filter(i=>i.id!==n);for(const i of s)t().closeEditorTab(i.id)},closeEditorTabsToLeft:n=>{const{editorOpenTabs:r}=t(),s=r.findIndex(o=>o.id===n);if(s<=0)return;const i=r.slice(0,s);for(const o of i)t().closeEditorTab(o.id)},closeEditorTabsToRight:n=>{const{editorOpenTabs:r}=t(),s=r.findIndex(o=>o.id===n);if(s<0||s>=r.length-1)return;const i=r.slice(s+1);for(const o of i)t().closeEditorTab(o.id)},closeAllEditorTabs:()=>{const{editorOpenTabs:n}=t();for(const r of[...n])t().closeEditorTab(r.id)},setActiveEditorTab:n=>{e({editorActiveTabId:n})},reorderEditorTabs:(n,r)=>{if(n===r)return;const{editorOpenTabs:s}=t(),i=s.findIndex(l=>l.id===n),o=s.findIndex(l=>l.id===r);if(i===-1||o===-1)return;const a=[...s],[c]=a.splice(i,1);a.splice(o,0,c),e({editorOpenTabs:a})},markFileModified:n=>{const{editorModifiedFiles:r}=t();r[n]||e({editorModifiedFiles:{...r,[n]:!0}})},markFileSaved:n=>{const{editorModifiedFiles:r}=t();e({editorModifiedFiles:li(r,n)})},saveFile:async n=>{const r=kp.getContent(n);if(r===null){_s.error("saveFile: no content available for",n);return}e(s=>({editorSaving:{...s.editorSaving,[n]:!0},editorSaveError:li(s.editorSaveError,n)}));try{const s=t().editorFileMtimes[n],i=await K.editor.writeFile(n,r,s);od.set(n,Date.now()),e(o=>({editorModifiedFiles:li(o.editorModifiedFiles,n),editorSaving:li(o.editorSaving,n),editorFileMtimes:{...o.editorFileMtimes,[n]:i.mtimeMs},editorExternalChanges:li(o.editorExternalChanges,n)}));try{localStorage.removeItem(`editor-draft:${n}`)}catch{}}catch(s){const i=s instanceof Error?s.message:String(s);if(i.startsWith("CONFLICT")){_s.error("Save conflict detected:",n),e(o=>({editorSaving:li(o.editorSaving,n),editorConflictFile:n}));return}_s.error("Failed to save file:",i),e(o=>({editorSaving:li(o.editorSaving,n),editorSaveError:{...o.editorSaveError,[n]:i}}))}},saveAllFiles:async()=>{const{editorModifiedFiles:n}=t(),r=kp.getAllModifiedContent(n),s=[];for(const[i,o]of r)s.push((async()=>{e(a=>({editorSaving:{...a.editorSaving,[i]:!0}}));try{const a=t().editorFileMtimes[i],c=await K.editor.writeFile(i,o,a);od.set(i,Date.now()),e(l=>({editorModifiedFiles:li(l.editorModifiedFiles,i),editorSaving:li(l.editorSaving,i),editorFileMtimes:{...l.editorFileMtimes,[i]:c.mtimeMs},editorExternalChanges:li(l.editorExternalChanges,i)}));try{localStorage.removeItem(`editor-draft:${i}`)}catch{}}catch(a){const c=a instanceof Error?a.message:String(a);if(c.startsWith("CONFLICT")){_s.error("Save conflict detected:",i),e(l=>({editorSaving:li(l.editorSaving,i),editorConflictFile:i}));return}_s.error("Failed to save file:",i,c),e(l=>({editorSaving:li(l.editorSaving,i),editorSaveError:{...l.editorSaveError,[i]:c}}))}})());await Promise.allSettled(s)},discardChanges:n=>{const{editorModifiedFiles:r,editorSaveError:s}=t();e({editorModifiedFiles:li(r,n),editorSaveError:li(s,n)});try{localStorage.removeItem(`editor-draft:${n}`)}catch{}},hasUnsavedChanges:()=>Object.keys(t().editorModifiedFiles).length>0,createFileInTree:async(n,r)=>{e({editorCreating:!0,editorCreateError:null});try{const s=await K.editor.createFile(n,r);return await W_(t,e,n),e({editorCreating:!1}),s.filePath}catch(s){const i=s instanceof Error?s.message:String(s);return _s.error("Failed to create file:",i),e({editorCreating:!1,editorCreateError:i}),null}},createDirInTree:async(n,r)=>{e({editorCreating:!0,editorCreateError:null});try{const s=await K.editor.createDir(n,r);return await W_(t,e,n),e({editorCreating:!1}),s.dirPath}catch(s){const i=s instanceof Error?s.message:String(s);return _s.error("Failed to create directory:",i),e({editorCreating:!1,editorCreateError:i}),null}},deleteFileFromTree:async n=>{try{await K.editor.deleteFile(n);const{editorOpenTabs:r}=t(),s=r.filter(o=>ISt(n,o.filePath));for(const o of s)t().closeEditorTab(o.id);const i=n.substring(0,I0(n));return i&&await W_(t,e,i),!0}catch(r){const s=r instanceof Error?r.message:String(r);return _s.error("Failed to delete file:",s),!1}},moveFileInTree:async(n,r)=>{const{editorSaving:s}=t();if(s[n])return _s.error("moveFileInTree: blocked — file is being saved:",n),!1;try{const i=await K.editor.moveFile(n,r),{newPath:o,isDirectory:a}=i,c=n.substring(0,I0(n));hx.set(n,Date.now()),hx.set(o,Date.now()),e(d=>{const p=d.editorOpenTabs.map(f=>{const h=hh(f.filePath,n,o);if(h===f.filePath)return f;const m=Of(h)||"file";return{...f,id:h,filePath:h,fileName:m,language:nY(m)}});return{editorOpenTabs:uI(p),editorActiveTabId:hh(d.editorActiveTabId??"",n,o)||d.editorActiveTabId,editorModifiedFiles:wl(d.editorModifiedFiles,n,o),editorSaving:wl(d.editorSaving,n,o),editorSaveError:wl(d.editorSaveError,n,o),editorFileLoading:wl(d.editorFileLoading,n,o),editorExternalChanges:wl(d.editorExternalChanges,n,o),editorFileMtimes:wl(d.editorFileMtimes,n,o),editorExpandedDirs:wl(d.editorExpandedDirs,n,o)}}),R1(t);const{editorOpenTabs:l}=t();for(const d of l){const p=zOe(d.filePath,n,o);p!==d.filePath&&kp.remapState(p,d.filePath)}a||kp.remapState(n,o);try{for(let d=0;d<localStorage.length;d++){const p=localStorage.key(d);if(p?.startsWith("editor-draft:")){const f=p.slice(13),h=hh(f,n,o);if(h!==f){const m=localStorage.getItem(p);localStorage.removeItem(p),m!==null&&localStorage.setItem(`editor-draft:${h}`,m)}}}}catch{}for(const[d,p]of[...od.entries()]){const f=hh(d,n,o);f!==d&&(od.delete(d),od.set(f,p))}return W_(t,e,c),W_(t,e,r),t().fetchGitStatus(),!0}catch(i){const o=i instanceof Error?i.message:String(i);return _s.error("moveFileInTree failed:",o),!1}},renameFileInTree:async(n,r)=>{const{editorSaving:s}=t();if(s[n])return _s.error("renameFileInTree: blocked — file is being saved:",n),!1;try{const i=await K.editor.renameFile(n,r),{newPath:o,isDirectory:a}=i,c=n.substring(0,I0(n));hx.set(n,Date.now()),hx.set(o,Date.now()),e(d=>{const p=d.editorOpenTabs.map(f=>{const h=hh(f.filePath,n,o);if(h===f.filePath)return f;const m=Of(h)||"file";return{...f,id:h,filePath:h,fileName:m,language:nY(m)}});return{editorOpenTabs:uI(p),editorActiveTabId:hh(d.editorActiveTabId??"",n,o)||d.editorActiveTabId,editorModifiedFiles:wl(d.editorModifiedFiles,n,o),editorSaving:wl(d.editorSaving,n,o),editorSaveError:wl(d.editorSaveError,n,o),editorFileLoading:wl(d.editorFileLoading,n,o),editorExternalChanges:wl(d.editorExternalChanges,n,o),editorFileMtimes:wl(d.editorFileMtimes,n,o),editorExpandedDirs:wl(d.editorExpandedDirs,n,o)}}),R1(t);const{editorOpenTabs:l}=t();for(const d of l){const p=zOe(d.filePath,n,o);p!==d.filePath&&kp.remapState(p,d.filePath)}a||kp.remapState(n,o);try{for(let d=0;d<localStorage.length;d++){const p=localStorage.key(d);if(p?.startsWith("editor-draft:")){const f=p.slice(13),h=hh(f,n,o);if(h!==f){const m=localStorage.getItem(p);localStorage.removeItem(p),m!==null&&localStorage.setItem(`editor-draft:${h}`,m)}}}}catch{}for(const[d,p]of[...od.entries()]){const f=hh(d,n,o);f!==d&&(od.delete(d),od.set(f,p))}return W_(t,e,c),t().fetchGitStatus(),!0}catch(i){const o=i instanceof Error?i.message:String(i);return _s.error("renameFileInTree failed:",o),!1}},fetchGitStatus:async()=>{e({editorGitLoading:!0});try{const n=performance.now(),r=await K.editor.gitStatus(),s=performance.now()-n,i=performance.now();e({editorGitFiles:r.files,editorGitBranch:r.branch,editorIsGitRepo:r.isGitRepo,editorGitLoading:!1});const o=performance.now()-i;_s.info(`[perf] fetchGitStatus: IPC=${s.toFixed(1)}ms, set=${o.toFixed(1)}ms, files=${r.files.length}`)}catch(n){_s.error("Failed to fetch git status:",n),e({editorGitLoading:!1})}},toggleWatcher:async n=>{try{await K.editor.watchDir(n),e({editorWatcherEnabled:n});try{localStorage.setItem("editor-watcher-enabled",String(n))}catch{}n?(R1(t),oY(t)):(EL="",wL="",K.editor.setWatchedFiles([]),K.editor.setWatchedDirs([]))}catch(r){_s.error("Failed to toggle watcher:",r)}},toggleLineWrap:()=>{e(n=>{const r=!n.editorLineWrap;try{localStorage.setItem("editor-line-wrap",String(r))}catch{}return{editorLineWrap:r}})},handleExternalFileChange:n=>{dI[n.type]=(dI[n.type]??0)+1,iY||(iY=setTimeout(()=>{iY=null;const l=dI;dI={change:0,create:0,delete:0},_s.info(`[perf] editor watcher events (2s): change=${l.change}, create=${l.create}, delete=${l.delete}`)},2e3));const{editorOpenTabs:r,editorProjectPath:s,editorSaving:i}=t();if(i[n.path])return;const o=od.get(n.path);if(o&&Date.now()-o<s2t)return;const a=hx.get(n.path);if(a&&Date.now()-a<c2t)return;if((r.some(l=>l.filePath===n.path)||n.type==="delete")&&e(l=>({editorExternalChanges:{...l.editorExternalChanges,[n.path]:n.type}})),rY||(rY=setTimeout(()=>{rY=null,t().fetchGitStatus()},i2t)),n.type==="create"||n.type==="delete"){r2t();const l=n.path.substring(0,I0(n.path));if(l&&s){const d=sY.get(l);d&&clearTimeout(d);const p=setTimeout(()=>{sY.delete(l),W_(t,e,l)},o2t);sY.set(l,p)}}},clearExternalChange:n=>{e(r=>({editorExternalChanges:li(r.editorExternalChanges,n)}))},setFileMtime:(n,r)=>{e(s=>({editorFileMtimes:{...s.editorFileMtimes,[n]:r}}))},forceOverwrite:async n=>{const r=kp.getContent(n);if(r===null){_s.error("forceOverwrite: no content available for",n);return}e(s=>({editorSaving:{...s.editorSaving,[n]:!0},editorConflictFile:null}));try{const s=await K.editor.writeFile(n,r);od.set(n,Date.now()),e(i=>({editorModifiedFiles:li(i.editorModifiedFiles,n),editorSaving:li(i.editorSaving,n),editorFileMtimes:{...i.editorFileMtimes,[n]:s.mtimeMs},editorExternalChanges:li(i.editorExternalChanges,n)}));try{localStorage.removeItem(`editor-draft:${n}`)}catch{}}catch(s){const i=s instanceof Error?s.message:String(s);_s.error("Failed to force overwrite:",i),e(o=>({editorSaving:li(o.editorSaving,n),editorSaveError:{...o.editorSaveError,[n]:i}}))}},resolveConflict:()=>{e({editorConflictFile:null})}});async function W_(e,t,n){try{const r=performance.now(),s=await K.editor.readDir(n);_s.info(`[perf] refreshDirectory: IPC=${(performance.now()-r).toFixed(1)}ms, entries=${s.entries.length}, dir=${Of(n)}`);const i=e().editorFileTree;if(!i)return;const o=e().editorProjectPath;if(n===o){const a=new Map;for(const l of i)a.set(l.path,l);const c=s.entries.map(l=>{const d=a.get(l.path);return d?.children&&l.type==="directory"?{...l,children:d.children}:l});t({editorFileTree:c})}else{const a=Tse(i,n,s.entries);t({editorFileTree:a})}}catch(r){_s.error("Failed to refresh directory:",r)}}function hh(e,t,n){const r=el(t),s=el(e);if(r.length===0)return e;const i=Qc(t)||Qc(e)||Qc(n),o=(l,d)=>i?l.toLowerCase()===d.toLowerCase():l===d;if(!(s.length>=r.length&&r.every((l,d)=>o(l,s[d]))))return e;const c=s.slice(r.length);return c.length>0?ZD(n,...c):n}function zOe(e,t,n){const r=el(n),s=el(e);if(r.length===0)return e;const i=Qc(t)||Qc(e)||Qc(n),o=(l,d)=>i?l.toLowerCase()===d.toLowerCase():l===d;if(!(s.length>=r.length&&r.every((l,d)=>o(l,s[d]))))return e;const c=s.slice(r.length);return c.length>0?ZD(t,...c):t}function wl(e,t,n){const r={};let s=!1;for(const[i,o]of Object.entries(e)){const a=hh(i,t,n);a!==i&&(s=!0),r[a]=o}return s?r:e}function Tse(e,t,n){let r=!1;const s=e.map(i=>{if(i.path===t&&i.type==="directory")return r=!0,{...i,children:n};if(i.children){const o=Tse(i.children,t,n);if(o!==i.children)return r=!0,{...i,children:o}}return i});return r?s:e}function BOe(e,t,n){return t==="project"||t==="local"?`plugin:${e}:${t}:${dT(n)}`:`plugin:${e}:${t}`}function JR(e,t,n){return t==="project"||t==="local"?`mcp:${e}:${t}:${dT(n)}`:`mcp:${e}:${t}`}function UQ(e,t){return t?`mcp-diagnostic:${t}:${e}`:`mcp-diagnostic:${e}`}function dT(e){return e??"__global__"}function p2t(e){if(e.length===0)return null;if(e.length>1)return`已安装到 ${e.length} 个范围`;switch(e[0]){case"global":case"user":return"已全局安装";case"project":return"已安装到项目";case"local":return"已安装到本地";default:return"已安装"}}const FOe={local:0,project:1,global:2,user:2};function Wje(e){return e.length===0?null:[...e].sort((t,n)=>FOe[t.scope]-FOe[n.scope])[0]}function Gje(e){const t=Array.from(new Set(e.map(n=>n.scope)));return p2t(t)}function FO(e){const{isInstalled:t,cliStatus:n,cliStatusLoading:r,section:s="plugins"}=e;if(n===null)return r?"正在检查运行时状态...":"正在检查运行时可用性...";if(n.installed===!1)return n.binaryPath&&n.launchError?"已找到配置的运行时,但启动失败。请打开首页修复或重新安装。":"需要配置的运行时。请从首页安装或修复。";const i=n.providers??[],o=n.flavor==="agent_teams_orchestrator";if(s==="mcp")return!o||i.filter(p=>Rfe(IA(p,"mcp"))).length>0?null:i.map(p=>IA(p,"mcp").reason).find(p=>typeof p=="string"&&p.trim().length>0)??"当前运行时不支持 MCP 管理。";if(!o)return!t&&!n.authLoggedIn?"Claude CLI 已安装但尚未登录。请打开首页登录。":null;const a=i.filter(l=>Rfe(IA(l,"plugins")));return a.length===0?i.map(d=>IA(d,"plugins").reason).find(d=>typeof d=="string"&&d.trim().length>0)??"当前运行时不支持安装插件。":t||a.find(l=>l.authenticated)?null:`${a[0]?.displayName??"Anthropic"} 未连接。请打开首页登录。`}function kL(e){return e.toLowerCase().replace(/\s+/g,"-").replace(/[^\w.-]/g,"")}function Ese(e){return e==="agent_teams_orchestrator"?"global":"user"}function Hje(e){return e==="user"||e==="global"}function bu(e){return e==="project"||e==="local"}function cZ(e,t){switch(e){case"global":return"全局";case"user":return t==="agent_teams_orchestrator"?"用户(旧版)":"用户(全局)";case"project":return"项目";case"local":return"本地";default:return e}}function Ql(e,t){return e.panes.find(n=>n.id===t)}function kh(e,t){return e.panes.find(n=>n.tabs.some(r=>r.id===t))}function eo(e,t){return{...e,panes:e.panes.map(n=>n.id===t.id?t:n)}}function qw(e,t){const n=e.panes.findIndex(l=>l.id===t);if(n===-1||e.panes.length<=1)return e;const r=e.panes[n],s=e.panes.filter(l=>l.id!==t),i=n>0?n-1:0,o=s.map((l,d)=>d===i?{...l,widthFraction:l.widthFraction+r.widthFraction}:l),a=Zje(o);let c=e.focusedPaneId;return e.focusedPaneId===t&&(c=a[Math.min(n,a.length-1)].id),{panes:a,focusedPaneId:c}}function YOe(e,t,n,r){const s=e.panes.findIndex(a=>a.id===t);if(s===-1)return e;const i=r==="right"?s+1:s,o=[...e.panes];return o.splice(i,0,n),{...e,panes:Zje(o)}}function Zje(e){if(e.length===0)return e;const t=1/e.length;return e.map(n=>({...n,widthFraction:t}))}function Kje(e){const t=Ql(e,e.focusedPaneId);return t?{openTabs:t.tabs,activeTabId:t.activeTabId,selectedTabIds:t.selectedTabIds}:{openTabs:[],activeTabId:null,selectedTabIds:[]}}function fu(e){return e.panes.flatMap(t=>t.tabs)}function VOe(e){return{id:e,tabs:[],activeTabId:null,selectedTabIds:[],widthFraction:0}}let mx=null,aY=0;const eP=new Map,tP=new Map,lY=new Map;let f2t=0,h2t=0;const cY=new Map,uY=new Map,m2t="__user__";function dY(e){return Object.values(e).some(Boolean)}function O2t(e){return e??"__user__"}function pI(e){return new Set(e.map(t=>t.pluginId))}function uZ(e,t){return e.startsWith(`plugin:${t}:`)}function qOe(e,t,n){if(e.size===0)return{pluginInstallProgress:t,installErrors:n};const r={...t},s={...n},i=Array.from(e);for(const o of Object.keys(r))i.some(a=>uZ(o,a))&&delete r[o];for(const o of Object.keys(s))i.some(a=>uZ(o,a))&&delete s[o];return{pluginInstallProgress:r,installErrors:s}}function xh(e){const t=eP.get(e);t&&(clearTimeout(t),eP.delete(e))}function WOe(e){const t=Array.from(e);for(const n of Array.from(eP.keys()))t.some(r=>uZ(n,r))&&xh(n)}function GOe(e,t){xh(e);const n=setTimeout(()=>{eP.delete(e),t(r=>r.pluginInstallProgress[e]!=="success"?{}:{pluginInstallProgress:{...r.pluginInstallProgress,[e]:"idle"}})},Jje);eP.set(e,n)}function g2t(e,t,n){return t==="project"||t==="local"?`mcp-custom:${e}:${t}:${dT(n)}`:`mcp-custom:${e}:${t}`}function dZ(e){return e.includes(":project:")||e.endsWith(":project")||e.includes(":local:")||e.endsWith(":local")}function cu(e){const t=tP.get(e);t&&(clearTimeout(t),tP.delete(e))}function pY(e,t){cu(e);const n=setTimeout(()=>{tP.delete(e),t(r=>r.mcpInstallProgress[e]!=="success"?{}:{mcpInstallProgress:{...r.mcpInstallProgress,[e]:"idle"}})},Jje);tP.set(e,n)}function _2t(e,t){const n={...e},r={...t};for(const s of Object.keys(n))(s.startsWith("mcp:")||s.startsWith("mcp-custom:"))&&dZ(s)&&delete n[s];for(const s of Object.keys(r))(s.startsWith("mcp:")||s.startsWith("mcp-custom:"))&&dZ(s)&&delete r[s];return{mcpInstallProgress:n,installErrors:r}}function b2t(){for(const e of Array.from(tP.keys()))dZ(e)&&cu(e)}function y2t(e){return e??m2t}function x2t(e,t){const n=e.filter(r=>r.id!==t.id);return[t,...n]}const Jje=2e3,HOe="Project- and local-scoped plugins require an active project in the Extensions tab.";function G_(e){return Yg({multimodelEnabled:e.appConfig?.general?.multimodelEnabled??!1,bootstrapCliStatus:e.bootstrapCliStatus,fetchCliStatus:e.fetchCliStatus})}function P1(e){return{cliStatus:e.cliStatus,cliStatusLoading:e.cliStatus===null&&e.cliStatusLoading}}const S2t=(e,t)=>({pluginCatalog:[],pluginCatalogLoading:!1,pluginCatalogError:null,pluginCatalogProjectPath:null,pluginReadmes:{},pluginReadmeLoading:{},mcpBrowseCatalog:[],mcpBrowseNextCursor:void 0,mcpBrowseLoading:!1,mcpBrowseError:null,mcpInstalledServers:[],mcpInstalledServersByProjectPath:{},mcpInstalledProjectPath:null,mcpDiagnostics:{},mcpDiagnosticsByProjectPath:{},mcpDiagnosticsLoading:!1,mcpDiagnosticsLoadingByProjectPath:{},mcpDiagnosticsError:null,mcpDiagnosticsErrorByProjectPath:{},mcpDiagnosticsLastCheckedAt:null,mcpDiagnosticsLastCheckedAtByProjectPath:{},pluginInstallProgress:{},mcpInstallProgress:{},installErrors:{},apiKeys:[],apiKeysLoading:!1,apiKeysError:null,apiKeySaving:!1,apiKeyStorageStatus:null,skillsUserCatalog:[],skillsProjectCatalogByProjectPath:{},skillsCatalogLoadingByProjectPath:{},skillsCatalogErrorByProjectPath:{},skillsLoading:!1,skillsError:null,skillsDetailsById:{},skillsDetailLoadingById:{},skillsDetailErrorById:{},skillsMutationLoading:!1,skillsMutationError:null,mcpGitHubStars:{},fetchPluginCatalog:async(n,r)=>{if(!K.plugins)return;const s=O2t(n);if(mx&&!r&&mx.key===s){await mx.promise;return}const i=++aY,o=Symbol("pluginCatalogRequest");e({pluginCatalogLoading:!0,pluginCatalogError:null});let a=null;a=(async()=>{try{const c=await K.plugins.getAll(n,r);e(l=>{if(i!==aY)return{};const d=n??null,f=l.pluginCatalogProjectPath===d?new Set:new Set([...pI(l.pluginCatalog),...pI(c)]),h=qOe(f,l.pluginInstallProgress,l.installErrors);return WOe(f),{pluginCatalog:c,pluginCatalogLoading:!1,pluginCatalogError:null,pluginCatalogProjectPath:d,pluginInstallProgress:h.pluginInstallProgress,installErrors:h.installErrors}})}catch(c){e(l=>{if(i!==aY)return{};const d=n??null,p=l.pluginCatalogProjectPath===d,f=qOe(p?new Set:pI(l.pluginCatalog),l.pluginInstallProgress,l.installErrors);return WOe(p?new Set:pI(l.pluginCatalog)),{pluginCatalog:p?l.pluginCatalog:[],pluginCatalogLoading:!1,pluginCatalogError:c instanceof Error?c.message:"Failed to load plugins",pluginCatalogProjectPath:d,pluginInstallProgress:f.pluginInstallProgress,installErrors:f.installErrors}})}finally{mx?.token===o&&(mx=null)}})(),mx={key:s,promise:a,token:o},await a},fetchPluginReadme:n=>{if(!K.plugins)return;const r=t(),s=r.pluginReadmes[n];s!=null||r.pluginReadmeLoading[n]||(e(i=>({pluginReadmeLoading:{...i.pluginReadmeLoading,[n]:!0}})),K.plugins.getReadme(n).then(i=>{e(o=>({pluginReadmes:{...o.pluginReadmes,[n]:i},pluginReadmeLoading:{...o.pluginReadmeLoading,[n]:!1}}))},()=>{e(i=>({pluginReadmes:{...i.pluginReadmes,[n]:null},pluginReadmeLoading:{...i.pluginReadmeLoading,[n]:!1}}))}))},mcpBrowse:async n=>{if(K.mcpRegistry){e({mcpBrowseLoading:!0,mcpBrowseError:null});try{const r=await K.mcpRegistry.browse(n);e(s=>{if(!n)return{mcpBrowseCatalog:r.servers,mcpBrowseNextCursor:r.nextCursor,mcpBrowseLoading:!1};const i=new Set(s.mcpBrowseCatalog.map(a=>a.id)),o=r.servers.filter(a=>!i.has(a.id));return{mcpBrowseCatalog:[...s.mcpBrowseCatalog,...o],mcpBrowseNextCursor:r.nextCursor,mcpBrowseLoading:!1}})}catch(r){e({mcpBrowseLoading:!1,mcpBrowseError:r instanceof Error?r.message:"Failed to browse MCP servers"})}}},mcpFetchInstalled:async n=>{if(K.mcpRegistry)try{const r=await K.mcpRegistry.getInstalled(n);e(s=>{const i=n??null,o=dT(i),a=s.mcpInstalledProjectPath===i,c=a?{mcpInstallProgress:s.mcpInstallProgress,installErrors:s.installErrors}:_2t(s.mcpInstallProgress,s.installErrors);return a||b2t(),{mcpInstalledServers:r,mcpInstalledServersByProjectPath:{...s.mcpInstalledServersByProjectPath,[o]:r},mcpInstalledProjectPath:i,mcpInstallProgress:c.mcpInstallProgress,installErrors:c.installErrors}})}catch{}},runMcpDiagnostics:async n=>{const r=K.mcpRegistry;if(!r)return;const s=dT(n),i=lY.get(s);if(i){await i;return}e(a=>({mcpDiagnosticsLoading:!0,mcpDiagnosticsError:null,mcpDiagnosticsLoadingByProjectPath:{...a.mcpDiagnosticsLoadingByProjectPath,[s]:!0},mcpDiagnosticsErrorByProjectPath:{...a.mcpDiagnosticsErrorByProjectPath,[s]:null}}));const o=(async()=>{try{const a=await r.diagnose(n),c=Object.fromEntries(a.map(d=>[UQ(d.name,d.scope),d])),l=Date.now();e({mcpDiagnostics:c,mcpDiagnosticsLoading:!1,mcpDiagnosticsByProjectPath:{...t().mcpDiagnosticsByProjectPath,[s]:c},mcpDiagnosticsLoadingByProjectPath:{...t().mcpDiagnosticsLoadingByProjectPath,[s]:!1},mcpDiagnosticsLastCheckedAt:l,mcpDiagnosticsLastCheckedAtByProjectPath:{...t().mcpDiagnosticsLastCheckedAtByProjectPath,[s]:l}})}catch(a){const c=a instanceof Error?a.message:"Failed to check MCP server health";e({mcpDiagnosticsLoading:!1,mcpDiagnosticsError:c,mcpDiagnosticsLoadingByProjectPath:{...t().mcpDiagnosticsLoadingByProjectPath,[s]:!1},mcpDiagnosticsErrorByProjectPath:{...t().mcpDiagnosticsErrorByProjectPath,[s]:c}})}finally{lY.delete(s)}})();lY.set(s,o),await o},fetchSkillsCatalog:async n=>{if(!K.skills)return;const r=y2t(n),s=++f2t;cY.set(r,s),e(i=>{const o={...i.skillsCatalogLoadingByProjectPath,[r]:!0};return{skillsCatalogLoadingByProjectPath:o,skillsCatalogErrorByProjectPath:{...i.skillsCatalogErrorByProjectPath,[r]:null},skillsLoading:dY(o),skillsError:null}});try{const i=await K.skills.list(n);if(cY.get(r)!==s)return;e(o=>({skillsCatalogLoadingByProjectPath:{...o.skillsCatalogLoadingByProjectPath,[r]:!1},skillsCatalogErrorByProjectPath:{...o.skillsCatalogErrorByProjectPath,[r]:null},skillsLoading:dY({...o.skillsCatalogLoadingByProjectPath,[r]:!1}),skillsError:null,skillsUserCatalog:i.filter(a=>a.scope==="user"),skillsProjectCatalogByProjectPath:n?{...o.skillsProjectCatalogByProjectPath,[n]:i.filter(a=>a.scope==="project")}:o.skillsProjectCatalogByProjectPath}))}catch(i){if(cY.get(r)!==s)return;const o=i instanceof Error?i.message:"Failed to load skills";e(a=>({skillsCatalogLoadingByProjectPath:{...a.skillsCatalogLoadingByProjectPath,[r]:!1},skillsCatalogErrorByProjectPath:{...a.skillsCatalogErrorByProjectPath,[r]:o},skillsLoading:dY({...a.skillsCatalogLoadingByProjectPath,[r]:!1}),skillsError:o}))}},fetchSkillDetail:async(n,r)=>{if(!K.skills)return;const s=++h2t;uY.set(n,s),e(i=>({skillsDetailLoadingById:{...i.skillsDetailLoadingById,[n]:!0},skillsDetailErrorById:{...i.skillsDetailErrorById,[n]:null}}));try{const i=await K.skills.getDetail(n,r);if(uY.get(n)!==s)return;e(o=>({skillsDetailsById:{...o.skillsDetailsById,[n]:i},skillsDetailLoadingById:{...o.skillsDetailLoadingById,[n]:!1},skillsDetailErrorById:{...o.skillsDetailErrorById,[n]:null}}))}catch(i){if(uY.get(n)!==s)return;const o=i instanceof Error?i.message:"Failed to load skill details";throw e(a=>({skillsDetailLoadingById:{...a.skillsDetailLoadingById,[n]:!1},skillsDetailErrorById:{...a.skillsDetailErrorById,[n]:o}})),i}},previewSkillUpsert:async n=>{if(!K.skills)throw new Error("Skills API is not available");e({skillsMutationLoading:!0,skillsMutationError:null});try{const r=await K.skills.previewUpsert(n);return e({skillsMutationLoading:!1}),r}catch(r){const s=r instanceof Error?r.message:"Failed to review skill changes";throw e({skillsMutationLoading:!1,skillsMutationError:s}),r}},applySkillUpsert:async n=>{if(!K.skills)throw new Error("Skills API is not available");e({skillsMutationLoading:!0,skillsMutationError:null});try{const r=await K.skills.applyUpsert(n);return await t().fetchSkillsCatalog(n.projectPath),e(s=>({skillsMutationLoading:!1,skillsDetailsById:r?.item.id?{...s.skillsDetailsById,[r.item.id]:r}:s.skillsDetailsById})),r}catch(r){const s=r instanceof Error?r.message:"Failed to save skill";throw e({skillsMutationLoading:!1,skillsMutationError:s}),r}},previewSkillImport:async n=>{if(!K.skills)throw new Error("Skills API is not available");e({skillsMutationLoading:!0,skillsMutationError:null});try{const r=await K.skills.previewImport(n);return e({skillsMutationLoading:!1}),r}catch(r){const s=r instanceof Error?r.message:"Failed to review import changes";throw e({skillsMutationLoading:!1,skillsMutationError:s}),r}},applySkillImport:async n=>{if(!K.skills)throw new Error("Skills API is not available");e({skillsMutationLoading:!0,skillsMutationError:null});try{const r=await K.skills.applyImport(n);return await t().fetchSkillsCatalog(n.projectPath),e(s=>({skillsMutationLoading:!1,skillsDetailsById:r?.item.id?{...s.skillsDetailsById,[r.item.id]:r}:s.skillsDetailsById})),r}catch(r){const s=r instanceof Error?r.message:"Failed to import skill";throw e({skillsMutationLoading:!1,skillsMutationError:s}),r}},deleteSkill:async n=>{if(!K.skills)throw new Error("Skills API is not available");e({skillsMutationLoading:!0,skillsMutationError:null});try{await K.skills.deleteSkill(n),await t().fetchSkillsCatalog(n.projectPath),e(r=>{const s={...r.skillsDetailsById};return delete s[n.skillId],{skillsMutationLoading:!1,skillsDetailsById:s}})}catch(r){const s=r instanceof Error?r.message:"Failed to delete skill";throw e({skillsMutationLoading:!1,skillsMutationError:s}),r}},installPlugin:async n=>{if(!K.plugins)return;const r=t().pluginCatalogProjectPath??void 0,s=n.scope!=="user"?n.projectPath??t().pluginCatalogProjectPath??void 0:n.projectPath,i=BOe(n.pluginId,n.scope,s),o=s===n.projectPath?n:{...n,projectPath:s},a=t();if(a.cliStatus===null)try{await G_(a)}catch{}const c=P1(t()),l=o.scope!=="user"&&!o.projectPath?HOe:FO({isInstalled:!1,...c,section:"plugins"});if(l){xh(i),e(d=>({pluginInstallProgress:{...d.pluginInstallProgress,[i]:"error"},installErrors:{...d.installErrors,[i]:l}}));return}xh(i),e(d=>({pluginInstallProgress:{...d.pluginInstallProgress,[i]:"pending"},installErrors:{...d.installErrors,[i]:""}}));try{const d=await K.plugins.install(o);if(d.state==="error"){e(p=>({pluginInstallProgress:{...p.pluginInstallProgress,[i]:"error"},installErrors:{...p.installErrors,[i]:d.error??"Install failed"}}));return}e(p=>({pluginInstallProgress:{...p.pluginInstallProgress,[i]:"success"}})),t().fetchPluginCatalog(o.scope!=="user"?o.projectPath:r,!0),GOe(i,e)}catch(d){xh(i);const p=d instanceof Error?d.message:"Install failed";e(f=>({pluginInstallProgress:{...f.pluginInstallProgress,[i]:"error"},installErrors:{...f.installErrors,[i]:p}}))}},uninstallPlugin:async(n,r,s)=>{if(!K.plugins)return;const i=t().pluginCatalogProjectPath??void 0,o=r??"user",a=o!=="user"?s??t().pluginCatalogProjectPath??void 0:s,c=BOe(n,o,a);if(o!=="user"&&!a){xh(c),e(p=>({pluginInstallProgress:{...p.pluginInstallProgress,[c]:"error"},installErrors:{...p.installErrors,[c]:HOe}}));return}const l=t();if(l.cliStatus===null)try{await G_(l)}catch{}const d=FO({isInstalled:!0,...P1(t()),section:"plugins"});if(d){xh(c),e(p=>({pluginInstallProgress:{...p.pluginInstallProgress,[c]:"error"},installErrors:{...p.installErrors,[c]:d}}));return}xh(c),e(p=>({pluginInstallProgress:{...p.pluginInstallProgress,[c]:"pending"}}));try{const p=await K.plugins.uninstall(n,r,a);if(p.state==="error"){e(f=>({pluginInstallProgress:{...f.pluginInstallProgress,[c]:"error"},installErrors:{...f.installErrors,[c]:p.error??"Uninstall failed"}}));return}e(f=>({pluginInstallProgress:{...f.pluginInstallProgress,[c]:"success"}})),t().fetchPluginCatalog(o!=="user"?a:i,!0),GOe(c,e)}catch(p){xh(c);const f=p instanceof Error?p.message:"Uninstall failed";e(h=>({pluginInstallProgress:{...h.pluginInstallProgress,[c]:"error"},installErrors:{...h.installErrors,[c]:f}}))}},installMcpServer:async n=>{const r=JR(n.registryId,n.scope,n.projectPath);if(!K.mcpRegistry){cu(r),e(o=>({mcpInstallProgress:{...o.mcpInstallProgress,[r]:"error"},installErrors:{...o.installErrors,[r]:"MCP Registry not available"}}));return}const s=t();if(s.cliStatus===null)try{await G_(s)}catch{}const i=FO({isInstalled:!1,...P1(t()),section:"mcp"});if(i){cu(r),e(o=>({mcpInstallProgress:{...o.mcpInstallProgress,[r]:"error"},installErrors:{...o.installErrors,[r]:i}}));return}cu(r),e(o=>({mcpInstallProgress:{...o.mcpInstallProgress,[r]:"pending"}}));try{const o=await K.mcpRegistry.install(n);if(o.state==="error"){e(a=>({mcpInstallProgress:{...a.mcpInstallProgress,[r]:"error"},installErrors:{...a.installErrors,[r]:o.error??"Install failed"}}));return}await Promise.all([t().mcpFetchInstalled(n.projectPath),t().runMcpDiagnostics(n.projectPath)]),e(a=>({mcpInstallProgress:{...a.mcpInstallProgress,[r]:"success"}})),pY(r,e)}catch(o){cu(r);const a=o instanceof Error?o.message:"Install failed";e(c=>({mcpInstallProgress:{...c.mcpInstallProgress,[r]:"error"},installErrors:{...c.installErrors,[r]:a}}))}},installCustomMcpServer:async n=>{const r=n.scope,s=g2t(n.serverName,r,n.projectPath);try{if(!K.mcpRegistry)throw new Error("MCP Registry not available");const i=t();if(i.cliStatus===null)try{await G_(i)}catch{}const o=FO({isInstalled:!1,...P1(t()),section:"mcp"});if(o)throw new Error(o);cu(s),e(c=>({mcpInstallProgress:{...c.mcpInstallProgress,[s]:"pending"}}));const a=await K.mcpRegistry.installCustom(n);if(a.state==="error")throw new Error(a.error??"Install failed");await Promise.all([t().mcpFetchInstalled(n.projectPath),t().runMcpDiagnostics(n.projectPath)]),e(c=>({mcpInstallProgress:{...c.mcpInstallProgress,[s]:"success"}})),pY(s,e)}catch(i){cu(s);const o=i instanceof Error?i.message:"Install failed";throw e(a=>({mcpInstallProgress:{...a.mcpInstallProgress,[s]:"error"},installErrors:{...a.installErrors,[s]:o}})),i instanceof Error?i:new Error(o)}},uninstallMcpServer:async(n,r,s,i)=>{const o=s==="global"||s==="user"||bu(s)?s:"user",a=JR(n,o,i);if(!K.mcpRegistry){cu(a),e(d=>({mcpInstallProgress:{...d.mcpInstallProgress,[a]:"error"},installErrors:{...d.installErrors,[a]:"MCP Registry not available"}}));return}const c=t();if(c.cliStatus===null)try{await G_(c)}catch{}const l=FO({isInstalled:!0,...P1(t()),section:"mcp"});if(l){cu(a),e(d=>({mcpInstallProgress:{...d.mcpInstallProgress,[a]:"error"},installErrors:{...d.installErrors,[a]:l}}));return}cu(a),e(d=>({mcpInstallProgress:{...d.mcpInstallProgress,[a]:"pending"}}));try{const d=await K.mcpRegistry.uninstall(r,s,i);if(d.state==="error"){e(p=>({mcpInstallProgress:{...p.mcpInstallProgress,[a]:"error"},installErrors:{...p.installErrors,[a]:d.error??"Uninstall failed"}}));return}await Promise.all([t().mcpFetchInstalled(i),t().runMcpDiagnostics(i)]),e(p=>({mcpInstallProgress:{...p.mcpInstallProgress,[a]:"success"}})),pY(a,e)}catch(d){cu(a);const p=d instanceof Error?d.message:"Uninstall failed";e(f=>({mcpInstallProgress:{...f.mcpInstallProgress,[a]:"error"},installErrors:{...f.installErrors,[a]:p}}))}},fetchApiKeys:async()=>{if(K.apiKeys){e({apiKeysLoading:!0,apiKeysError:null});try{const n=await K.apiKeys.list();e({apiKeys:n,apiKeysLoading:!1})}catch(n){e({apiKeysLoading:!1,apiKeysError:n instanceof Error?n.message:"Failed to load API keys"})}}},fetchApiKeyStorageStatus:async()=>{if(K.apiKeys)try{const n=await K.apiKeys.getStorageStatus();e({apiKeyStorageStatus:n})}catch{}},saveApiKey:async n=>{if(K.apiKeys){e({apiKeySaving:!0,apiKeysError:null});try{const r=await K.apiKeys.save(n),s=[];try{const o=await K.apiKeys.list();e({apiKeys:o})}catch(o){s.push(o instanceof Error?`API key saved, but failed to refresh key list. ${o.message}`:"API key saved, but failed to refresh key list."),e(a=>({apiKeys:x2t(a.apiKeys,r)}))}await G_(t());const i=t().cliStatusError;i&&s.push(`API key saved, but failed to refresh provider status. ${i}`),e({apiKeySaving:!1,apiKeysError:s.length>0?s.join(" "):null})}catch(r){throw e({apiKeySaving:!1,apiKeysError:r instanceof Error?r.message:"Failed to save API key"}),r}}},deleteApiKey:async n=>{if(K.apiKeys)try{await K.apiKeys.delete(n),e(s=>({apiKeys:s.apiKeys.filter(i=>i.id!==n)})),await G_(t());const r=t().cliStatusError;e({apiKeysError:r?`API key deleted, but failed to refresh provider status. ${r}`:null})}catch(r){throw e({apiKeysError:r instanceof Error?r.message:"Failed to delete API key"}),r}},openExtensionsTab:()=>{const n=t(),r=n.selectedProjectId??n.activeProjectId??void 0,i=n.paneLayout.panes.find(o=>o.id===n.paneLayout.focusedPaneId)?.tabs.find(o=>o.type==="extensions");if(i){if(i.projectId!==r||i.label!=="扩展"){const o=kh(n.paneLayout,i.id);o&&e({paneLayout:eo(n.paneLayout,{...o,tabs:o.tabs.map(a=>a.id===i.id?{...a,label:"扩展",projectId:r}:a)})})}n.setActiveTab(i.id);return}n.openTab({type:"extensions",label:"扩展",projectId:r})},fetchMcpGitHubStars:n=>{!K.mcpRegistry||n.length===0||K.mcpRegistry.githubStars(n).then(r=>{Object.keys(r).length>0&&e(s=>({mcpGitHubStars:{...s.mcpGitHubStars,...r}}))}).catch(()=>{})}}),ZOe=50;function pZ(e,t){return e.find(n=>n.type==="session"&&n.sessionId===t)}function eXe(e,t,n){return e.find(r=>r.type==="session"&&r.sessionId===t&&r.projectId===n)}function fZ(e){return e.length<=ZOe?e:e.slice(0,ZOe-1)+"…"}function v2t(e,t="notification",n){return{id:crypto.randomUUID(),kind:"error",source:t,highlight:n??"red",payload:e}}function KOe(e){return{id:crypto.randomUUID(),kind:"search",source:"commandPalette",highlight:"yellow",payload:e}}function T2t(e){return e.kind==="error"}function E2t(e){return e.kind==="search"}const fI=Hi("Store:notification"),w2t=200,k2t=(e,t)=>({notifications:[],unreadCount:0,notificationsLoading:!1,notificationsError:null,fetchNotifications:async()=>{e({notificationsLoading:!0,notificationsError:null});try{const n=await K.notifications.get({limit:w2t,offset:0}),r=n.notifications||[],s=typeof n.unreadCount=="number"&&Number.isFinite(n.unreadCount)?Math.max(0,Math.floor(n.unreadCount)):r.filter(i=>!i.isRead).length;e({notifications:r,unreadCount:s,notificationsLoading:!1})}catch(n){e({notificationsError:n instanceof Error?n.message:"Failed to fetch notifications",notificationsLoading:!1})}},markNotificationRead:async n=>{try{if(!await K.notifications.markRead(n)){await t().fetchNotifications();return}e(s=>{const i=s.notifications.map(a=>a.id===n?{...a,isRead:!0}:a),o=i.filter(a=>!a.isRead).length;return{notifications:i,unreadCount:o}})}catch(r){fI.error("Failed to mark notification as read:",r)}},markAllNotificationsRead:async n=>{try{if(n!==void 0){const{notifications:r}=t(),s=r.filter(a=>(a.triggerName??"Other")===n&&!a.isRead);if(s.length===0)return;if((await Promise.all(s.map(a=>K.notifications.markRead(a.id)))).some(a=>!a)){await t().fetchNotifications();return}const o=new Set(s.map(a=>a.id));e(a=>{const c=a.notifications.map(l=>o.has(l.id)?{...l,isRead:!0}:l);return{notifications:c,unreadCount:c.filter(l=>!l.isRead).length}})}else{if(!await K.notifications.markAllRead()){await t().fetchNotifications();return}e(s=>({notifications:s.notifications.map(i=>({...i,isRead:!0})),unreadCount:0}))}}catch(r){fI.error("Failed to mark all notifications as read:",r)}},deleteNotification:async n=>{try{if(!await K.notifications.delete(n)){await t().fetchNotifications();return}e(s=>{const i=s.notifications.filter(a=>a.id!==n),o=i.filter(a=>!a.isRead).length;return{notifications:i,unreadCount:o}})}catch(r){fI.error("Failed to delete notification:",r)}},clearNotifications:async n=>{try{if(n!==void 0){const{notifications:r}=t(),s=r.filter(a=>(a.triggerName??"Other")===n);if(s.length===0)return;if((await Promise.all(s.map(a=>K.notifications.delete(a.id)))).some(a=>!a)){await t().fetchNotifications();return}const o=new Set(s.map(a=>a.id));e(a=>{const c=a.notifications.filter(l=>!o.has(l.id));return{notifications:c,unreadCount:c.filter(l=>!l.isRead).length}})}else{if(!await K.notifications.clear()){await t().fetchNotifications();return}e({notifications:[],unreadCount:0})}}catch(r){fI.error("Failed to clear notifications:",r)}},navigateToError:n=>{const r=t();if(r.markNotificationRead(n.id),n.sessionId.startsWith("team:")){const a=n.sessionId.slice(5);r.openTeamTab(a,n.context.cwd);return}const s=v2t({errorId:n.id,errorTimestamp:n.timestamp,toolUseId:n.toolUseId,subagentId:n.subagentId,lineNumber:n.lineNumber},"notification",n.triggerColor),i=fu(r.paneLayout),o=eXe(i,n.sessionId,n.projectId);if(o)r.setActiveTab(o.id),r.enqueueTabNavigation(o.id,s);else{r.openTab({type:"session",label:"Loading...",projectId:n.projectId,sessionId:n.sessionId});const a=t().activeTabId;a&&(r.enqueueTabNavigation(a,s),t().setActiveTab(a))}},openNotificationsTab:()=>{const n=t(),s=n.paneLayout.panes.find(i=>i.id===n.paneLayout.focusedPaneId)?.tabs.find(i=>i.type==="notifications");if(s){n.setActiveTab(s.id),n.fetchNotifications();return}n.openTab({type:"notifications",label:"Notifications"})}}),CL=4;function Ox(e){const t=Kje(e);return{paneLayout:e,openTabs:t.openTabs,activeTabId:t.activeTabId,selectedTabIds:t.selectedTabIds}}const C2t=(e,t)=>({paneLayout:{panes:[{id:"pane-default",tabs:[],activeTabId:null,selectedTabIds:[],widthFraction:1}],focusedPaneId:"pane-default"},focusPane:n=>{const r=t(),{paneLayout:s}=r;if(s.focusedPaneId===n)return;const i=Ql(s,n);if(!i)return;const o={...s,focusedPaneId:n};e(Ox(o)),i.activeTabId&&t().setActiveTab(i.activeTabId)},splitPane:(n,r,s)=>{const i=t(),{paneLayout:o}=i;if(o.panes.length>=CL)return;const a=Ql(o,n);if(!a)return;const c=a.tabs.find(O=>O.id===r);if(!c)return;const l=a.tabs.filter(O=>O.id!==r);let d=a.activeTabId;if(a.activeTabId===r){const O=a.tabs.findIndex(_=>_.id===r);d=l[O]?.id??l[O-1]?.id??null}const p={...a,tabs:l,activeTabId:d,selectedTabIds:a.selectedTabIds.filter(O=>O!==r)},f=crypto.randomUUID(),h={...VOe(f),tabs:[c],activeTabId:c.id};let m=eo(o,p);l.length===0&&o.panes.length>1&&(m=qw(m,n)),m=YOe(m,p.id!==n?o.panes[0].id:n,h,s),m={...m,focusedPaneId:f},e(Ox(m)),c.type==="session"&&t().setActiveTab(c.id)},closePane:n=>{const r=t(),{paneLayout:s}=r;if(s.panes.length<=1)return;const i=Ql(s,n);if(!i)return;for(const c of i.tabs)r.cleanupTabUIState(c.id),r.cleanupTabSessionData(c.id);const o=qw(s,n);e(Ox(o));const a=Ql(o,o.focusedPaneId);a?.activeTabId&&t().setActiveTab(a.activeTabId)},moveTabToPane:(n,r,s,i)=>{const o=t(),{paneLayout:a}=o;if(r===s)return;const c=Ql(a,r),l=Ql(a,s);if(!c||!l)return;const d=c.tabs.find(O=>O.id===n);if(!d)return;const p=c.tabs.filter(O=>O.id!==n);let f=c.activeTabId;if(c.activeTabId===n){const O=c.tabs.findIndex(_=>_.id===n);f=p[O]?.id??p[O-1]?.id??null}const h=[...l.tabs];i!==void 0&&i>=0&&i<=h.length?h.splice(i,0,d):h.push(d);let m=eo(a,{...c,tabs:p,activeTabId:f,selectedTabIds:c.selectedTabIds.filter(O=>O!==n)});m=eo(m,{...l,tabs:h,activeTabId:d.id}),p.length===0&&m.panes.length>1&&(m=qw(m,r)),m={...m,focusedPaneId:s},e(Ox(m))},moveTabToNewPane:(n,r,s,i)=>{const o=t(),{paneLayout:a}=o;if(a.panes.length>=CL)return;const c=Ql(a,r);if(!c)return;const l=c.tabs.find(O=>O.id===n);if(!l)return;const d=c.tabs.filter(O=>O.id!==n);let p=c.activeTabId;if(c.activeTabId===n){const O=c.tabs.findIndex(_=>_.id===n);p=d[O]?.id??d[O-1]?.id??null}const f=crypto.randomUUID(),h={...VOe(f),tabs:[l],activeTabId:l.id};let m=eo(a,{...c,tabs:d,activeTabId:p,selectedTabIds:c.selectedTabIds.filter(O=>O!==n)});d.length===0&&m.panes.length>1&&(m=qw(m,r)),m=YOe(m,s,h,i),m={...m,focusedPaneId:f},e(Ox(m))},reorderTabInPane:(n,r,s)=>{const{paneLayout:i}=t(),o=Ql(i,n);if(!o||r<0||r>=o.tabs.length||s<0||s>=o.tabs.length||r===s)return;const a=[...o.tabs],[c]=a.splice(r,1);a.splice(s,0,c);const l=eo(i,{...o,tabs:a});e(Ox(l))},resizePanes:(n,r)=>{const{paneLayout:s}=t(),i=s.panes.findIndex(h=>h.id===n);if(i===-1||i>=s.panes.length-1)return;const o=.1,a=Math.max(o,Math.min(1-o*(s.panes.length-1),r)),c=s.panes[i],l=s.panes[i+1],p=c.widthFraction+l.widthFraction-a;if(p<o)return;const f=s.panes.map((h,m)=>m===i?{...h,widthFraction:a}:m===i+1?{...h,widthFraction:p}:h);e({paneLayout:{...s,panes:f}})},getPaneForTab:n=>kh(t().paneLayout,n)?.id??null,getAllPaneTabs:()=>fu(t().paneLayout)}),R2t=(e,t)=>({projects:[],selectedProjectId:null,projectsLoading:!1,projectsError:null,fetchProjects:async()=>{if(!t().projectsLoading){e({projectsLoading:!0,projectsError:null});try{const r=[...await K.getProjects()].sort((s,i)=>(i.mostRecentSession??0)-(s.mostRecentSession??0));e({projects:r,projectsLoading:!1})}catch(n){e({projectsError:n instanceof Error?n.message:"Failed to fetch projects",projectsLoading:!1})}}},selectProject:n=>{e({selectedProjectId:n,...Xh()}),t().fetchSessionsInitial(n)}}),fY=Hi("Store:repository"),P2t=3e4;async function $2t(e,t,n){let r=null;const s=new Promise((i,o)=>{r=setTimeout(()=>o(new Error(`${n} timed out after ${t}ms`)),t)});try{return await Promise.race([e,s])}finally{r&&clearTimeout(r)}}const N2t=(e,t)=>({repositoryGroups:[],selectedRepositoryId:null,selectedWorktreeId:null,repositoryGroupsLoading:!1,repositoryGroupsError:null,viewMode:"grouped",fetchRepositoryGroups:async()=>{if(t().repositoryGroupsLoading)return;const n=Date.now();e({repositoryGroupsLoading:!0,repositoryGroupsError:null});try{const r=await $2t(K.getRepositoryGroups(),P2t,"get-repository-groups");e({repositoryGroups:r,repositoryGroupsLoading:!1});const s=Date.now()-n;s>=2e3&&fY.warn(`fetchRepositoryGroups slow ms=${s} count=${r.length}`)}catch(r){const s=Date.now()-n;fY.warn(`fetchRepositoryGroups failed ms=${s}: ${r instanceof Error?r.message:String(r)}`),e({repositoryGroupsError:r instanceof Error?r.message:"Failed to fetch repository groups",repositoryGroupsLoading:!1})}},selectRepository:n=>{const{repositoryGroups:r}=t(),s=r.find(a=>a.id===n);if(!s){fY.warn("Repository not found:",n);return}const o=s.worktrees.find(a=>a.isMainWorktree)??s.worktrees[0];o?(e({selectedRepositoryId:n,selectedWorktreeId:o.id,selectedProjectId:o.id,activeProjectId:o.id,...Xh()}),t().fetchSessionsInitial(o.id)):e({selectedRepositoryId:n,selectedWorktreeId:null,...Xh()})},selectWorktree:n=>{e({selectedWorktreeId:n,selectedProjectId:n,activeProjectId:n,...Xh()}),t().fetchSessionsInitial(n)},setViewMode:n=>{e({viewMode:n,selectedRepositoryId:null,selectedWorktreeId:null,selectedProjectId:null,...Xh()}),n==="grouped"?t().fetchRepositoryGroups():t().fetchProjects()}}),hI=Hi("scheduleSlice"),A2t=(e,t)=>({schedules:[],schedulesLoading:!1,schedulesError:null,scheduleRuns:{},scheduleRunsLoading:{},async fetchSchedules(){if(!t().schedulesLoading){e({schedulesLoading:!0,schedulesError:null});try{const n=await K.schedules.list();e({schedules:n,schedulesLoading:!1})}catch(n){const r=n instanceof Error?n.message:"Failed to fetch schedules";hI.error("fetchSchedules failed:",r),e({schedulesError:r,schedulesLoading:!1})}}},async createSchedule(n){const r=await K.schedules.create(n);return e(s=>({schedules:[...s.schedules,r]})),r},async updateSchedule(n,r){const s=await K.schedules.update(n,r);return e(i=>({schedules:i.schedules.map(o=>o.id===n?s:o)})),s},async deleteSchedule(n){const r=t().schedules,s=t().scheduleRuns;e(i=>({schedules:i.schedules.filter(o=>o.id!==n),scheduleRuns:Object.fromEntries(Object.entries(i.scheduleRuns).filter(([o])=>o!==n)),schedulesError:null}));try{await K.schedules.delete(n)}catch(i){const o=i instanceof Error?i.message:"删除计划失败";throw hI.error("deleteSchedule failed:",o),e({schedules:r,scheduleRuns:s,schedulesError:o,schedulesLoading:!1}),await t().fetchSchedules(),i}e(i=>({schedules:i.schedules.filter(o=>o.id!==n),scheduleRuns:Object.fromEntries(Object.entries(i.scheduleRuns).filter(([o])=>o!==n)),schedulesError:null})),e({schedulesLoading:!1}),await t().fetchSchedules(),window.setTimeout(()=>{t().fetchSchedules()},800)},async pauseSchedule(n){await K.schedules.pause(n),e(r=>({schedules:r.schedules.map(s=>s.id===n?{...s,status:"paused",updatedAt:new Date().toISOString()}:s)})),await t().fetchSchedules()},async resumeSchedule(n){await K.schedules.resume(n),e(r=>({schedules:r.schedules.map(s=>s.id===n?{...s,status:"active",updatedAt:new Date().toISOString()}:s)})),await t().fetchSchedules()},async triggerNow(n){const r=new Date().toISOString();e(i=>({scheduleRuns:{...i.scheduleRuns,[n]:[{id:`pending-${Date.now()}`,scheduleId:n,teamName:i.schedules.find(o=>o.id===n)?.teamName??"",status:"running",scheduledFor:r,startedAt:r,executionStartedAt:r,retryCount:0,summary:"正在触发 cc-connect runtime..."},...i.scheduleRuns[n]??[]]}}));const s=await K.schedules.triggerNow(n);return e(i=>({scheduleRuns:{...i.scheduleRuns,[n]:[s,...(i.scheduleRuns[n]??[]).filter(o=>!o.id.startsWith("pending-"))]}})),s},async fetchRunHistory(n){if(!t().scheduleRunsLoading[n]){e(r=>({scheduleRunsLoading:{...r.scheduleRunsLoading,[n]:!0}}));try{const r=await K.schedules.getRuns(n);e(s=>({scheduleRuns:{...s.scheduleRuns,[n]:r},scheduleRunsLoading:{...s.scheduleRunsLoading,[n]:!1}}))}catch(r){hI.error(`fetchRunHistory(${n}) failed:`,r),e(s=>({scheduleRunsLoading:{...s.scheduleRunsLoading,[n]:!1}}))}}},async applyScheduleChange(n){try{const r=await K.schedules.get(n);if(e(s=>r?{schedules:s.schedules.some(o=>o.id===n)?s.schedules.map(o=>o.id===n?r:o):[...s.schedules,r]}:{schedules:s.schedules.filter(o=>o.id!==n)}),t().scheduleRuns[n]){const s=await K.schedules.getRuns(n);e(i=>({scheduleRuns:{...i.scheduleRuns,[n]:s}}))}}catch(r){hI.error("applyScheduleChange failed:",r)}},openSchedulesTab:()=>{const n=t(),s=n.paneLayout.panes.find(i=>i.id===n.paneLayout.focusedPaneId)?.tabs.find(i=>i.type==="schedules");if(s){n.setActiveTab(s.id);return}n.openTab({type:"schedules",label:"Schedules"}),t().fetchSchedules()}});function I2t(e){return"chunkType"in e&&e.chunkType==="ai"}function M2t(e){return I2t(e)&&"semanticSteps"in e}function Q2t(e){return e.type==="assistant"}function D2t(e){return"chunkType"in e&&e.chunkType==="user"&&"rawMessages"in e}function L2t(e){return"chunkType"in e&&e.chunkType==="system"&&"rawMessages"in e}function j2t(e){return"chunkType"in e&&e.chunkType==="compact"&&"rawMessages"in e}function X2t(e){return"chunkType"in e&&"rawMessages"in e}function pT(e){return e.length===0?[]:X2t(e[0])?e:null}const rz=/[\\/]/;function bc(e){const t=e.split(rz);return t[t.length-1]||""}function U2t(e){return e.split(rz).filter(Boolean)[0]??""}function z2t(e){return e.split(rz).filter(Boolean)}function B2t(e){return rz.test(e)}function F2t(e){return/^\.\.?[\\/]/.test(e)}const Y2t=Hi("Util:groupTransformer"),JOe=/\/([a-z][a-z-]{0,50})(?:\s+(\S[^\n]{0,1000}))?$/gim,ege=100;function nP(e,t,n=!1){if(!e||e.length===0)return{sessionId:"",items:[],totalUserGroups:0,totalSystemGroups:0,totalAIGroups:0,totalCompactGroups:0};const r=[];let s=0,i=0,o=0,a=0;for(const l of e)if(D2t(l))r.push({type:"user",group:V2t(l,s++)});else if(L2t(l))r.push({type:"system",group:eDt(l)}),i++;else if(M2t(l))r.push({type:"ai",group:nDt(l,o)}),o++;else if(j2t(l))r.push({type:"compact",group:tDt(l)}),a++;else{const d="chunkType"in l?l.chunkType:"unknown";Y2t.warn("Unhandled chunk type:",d)}let c=1;for(let l=0;l<r.length;l++)if(r[l].type==="compact"){c++;const d=r[l];d.group.startingPhaseNumber=c;const p=oDt(r,l),f=aDt(r,l);if(p&&f){const h=lDt(p),m=cDt(f);h!==void 0&&m!==void 0&&(d.group.tokenDelta={preCompactionTokens:h,postCompactionTokens:m,delta:m-h})}}if(n&&o>0)for(let l=r.length-1;l>=0;l--){const d=r[l];if(d.type==="ai"){d.group.status!=="interrupted"&&(d.group.isOngoing=!0,d.group.status="in_progress");break}}return{sessionId:e[0]?.id??"unknown",items:r,totalUserGroups:s,totalSystemGroups:i,totalAIGroups:o,totalCompactGroups:a}}function V2t(e,t){return q2t(e.userMessage,t)}function q2t(e,t){const n=W2t(e);return{id:`user-${e.uuid}`,message:e,timestamp:e.timestamp,content:n,index:t}}function W2t(e){let t="";const n=[],r=[];if(typeof e.content=="string")t=e.content;else if(Array.isArray(e.content))for(const c of e.content)c.type==="text"&&c.text&&(t+=c.text);const s=Pvt(t),i=PU(t),o=i?[]:G2t(s);r.push(...kse(s));let a=s;if(!i)for(const c of o)a=a.replace(c.raw,"").trim();return{text:a||void 0,rawText:s,commands:o,images:n,fileReferences:r}}function G2t(e){if(!e)return[];const t=[];let n;for(JOe.lastIndex=0;(n=JOe.exec(e))!==null;){const[r,s,i]=n;t.push({name:s,args:i?.trim(),raw:r,startIndex:n.index,endIndex:n.index+r.length})}return t}const H2t=new Set(["src","apps","app","lib","types","packages","components","utils","services","hooks","store","public","assets","config","tests","test","specs","spec","e2e","docs","scripts","screens","features","pages","views","models","controllers","routes","middleware","api","common","core","modules","client","server","web","mobile","native","electron","node_modules"]),Z2t=/[\s,)}\]]/;function K2t(e){if(/^[A-Za-z]:[\\/]/.test(e)||e.startsWith("\\\\")||F2t(e))return!0;const t=U2t(e);return!!(H2t.has(t)||B2t(e)&&e.length>2&&(z2t(e).length>2||/\.[a-zA-Z0-9]+$/.test(e)))}function J2t(e,t){const n=t+1,r=e[n];if(!r)return null;let s="",i=n;if(r==='"'||r==="'"){const o=r,a=n+1,c=e.indexOf(o,a);if(c<0)return null;s=e.slice(a,c),i=c+1}else{for(;i<e.length&&!Z2t.test(e[i]);)i+=1;s=e.slice(n,i)}return!s||!K2t(s)?null:{path:s,raw:e.slice(t,i),startIndex:t,endIndex:i}}function wse(e){if(!e)return[];const t=[];let n=0;for(;n<e.length;){const r=e.indexOf("@",n);if(r<0)break;const s=J2t(e,r);s?(t.push(s),n=s.endIndex):n=r+1}return t}function kse(e){return wse(e).map(({path:t,raw:n})=>({path:t,raw:n}))}function eDt(e){return{id:e.id,message:e.message,timestamp:e.startTime,commandOutput:e.commandOutput}}function tDt(e){return{id:e.id,timestamp:e.startTime,message:e.message}}function nDt(e,t){const n=e.semanticSteps,r=n.length>0?n[0].startTime:e.startTime,s=n.length>0?n[n.length-1].endTime??n[n.length-1].startTime:e.endTime,i=s.getTime()-r.getTime(),o=e.responses.find(d=>Q2t(d))??null,a=rDt(n,o),c=sDt(n),l=iDt(n);return{id:e.id,turnIndex:t,startTime:r,endTime:s,durationMs:i,steps:n,tokens:a,summary:c,status:l,processes:e.processes,chunkId:e.id,metrics:e.metrics,responses:e.responses}}function rDt(e,t){let n=0,r=0,s=0,i=0;for(const o of e)o.tokens&&(n+=o.tokens.input??0,r+=o.tokens.output??0,s+=o.tokens.cached??0),o.tokenBreakdown&&(n+=o.tokenBreakdown.input??0,r+=o.tokenBreakdown.output??0,s+=o.tokenBreakdown.cacheRead??0),o.type==="thinking"&&o.tokens?.output&&(i+=o.tokens.output);return t?.usage&&(n=t.usage.input_tokens??0,r=t.usage.output_tokens??0,s=t.usage.cache_read_input_tokens??0),{input:n,output:r,cached:s,thinking:i}}function sDt(e){let t,n=0,r=0,s=0,i=0,o=0,a=0,c=0;for(const l of e){if(!t&&l.type==="thinking"&&l.content.thinkingText){const d=l.content.thinkingText;t=d.length>ege?d.slice(0,ege)+"...":d}l.type==="tool_call"&&n++,l.type==="output"&&r++,l.type==="subagent"&&s++,i+=l.durationMs??0,l.tokens&&(o+=(l.tokens.input??0)+(l.tokens.output??0),a+=l.tokens.output??0,c+=l.tokens.cached??0),l.tokenBreakdown&&(o+=l.tokenBreakdown.input+l.tokenBreakdown.output,a+=l.tokenBreakdown.output,c+=l.tokenBreakdown.cacheRead)}return{thinkingPreview:t,toolCallCount:n,outputMessageCount:r,subagentCount:s,totalDurationMs:i,totalTokens:o,outputTokens:a,cachedTokens:c}}function iDt(e){return e.length===0?"error":e.some(s=>s.type==="interruption")?"interrupted":e.some(s=>s.type==="tool_result"&&s.content.isError)?"error":e.some(s=>!s.endTime)?"in_progress":"complete"}function oDt(e,t){for(let n=t-1;n>=0;n--)if(e[n].type==="ai")return e[n].group;return null}function aDt(e,t){for(let n=t+1;n<e.length;n++)if(e[n].type==="ai")return e[n].group;return null}function lDt(e){const t=e.responses||[];for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.type==="assistant"&&r.usage)return(r.usage.input_tokens??0)+(r.usage.output_tokens??0)+(r.usage.cache_read_input_tokens??0)+(r.usage.cache_creation_input_tokens??0)}}function cDt(e){const t=e.responses||[];for(const n of t)if(n.type==="assistant"&&n.usage)return(n.usage.input_tokens??0)+(n.usage.output_tokens??0)+(n.usage.cache_read_input_tokens??0)+(n.usage.cache_creation_input_tokens??0)}const tXe=500,uDt="CLAUDE.md",tge="project-memory";function Mp(e){let t=0;for(let r=0;r<e.length;r++){const s=e.charCodeAt(r);t=(t<<5)-t+s,t=t&t}return`cmd-${Math.abs(t).toString(16)}`}function Qp(e,t){return e}function Cse(e){return e.startsWith("/")||e.startsWith("\\\\")||/^[a-zA-Z]:[\\/]/.test(e)}function kS(e,t){if(Cse(t))return t;const n=dDt(e);let r=t;r.startsWith("@")&&(r=r.slice(1)),r.startsWith("./")&&(r=r.slice(2));const s=n.includes("\\")?"\\":"/",i=n.startsWith("/"),o=n.startsWith("\\\\"),a=pDt(r,s),c=fDt(n);let l=a;for(;l.startsWith(`..${s}`);)l=l.slice(3),c.length>1&&c.pop();let d=c.join(s);return i&&!d.startsWith("/")&&(d=`/${d}`),o&&!d.startsWith("\\\\")&&(d=`\\\\${d}`),l?`${d}${s}${l}`:d}function dDt(e){let t=e.length;for(;t>0;){const n=e[t-1];if(n!=="/"&&n!=="\\")break;t--}return e.slice(0,t)}function pDt(e,t){let n="",r=!1;for(const s of e)s==="/"||s==="\\"?(r||(n+=t),r=!0):(n+=s,r=!1);return n}function fDt(e){return el(e)}function RO(e){return e.replace(/\\/g,"/")}function hDt(e){const t=I0(e);return t===-1?"":e.slice(0,t)}function mDt(e){const t=I0(e);return t<=0?null:e.slice(0,t)}function ODt(e,t){const n=RO(e).replace(/\/$/,""),r=RO(t).replace(/\/$/,"");return r===n||r.startsWith(n+"/")}function nXe(e){const t=[];for(const n of e)if(n.type==="tool_call"&&n.content.toolName==="Read"){const r=n.content.toolInput;r&&typeof r.file_path=="string"&&t.push(r.file_path)}return t}function rXe(e,t){if(!e)return[];const n=e.content.fileReferences||[],r=[];for(const s of n)if(s.path){const i=Cse(s.path)?s.path:kS(t,s.path);r.push(i)}return r}function sXe(e){const t=[];for(const n of e){if(n.type!=="user")continue;let r="";if(typeof n.content=="string")r=n.content;else if(Array.isArray(n.content))for(const s of n.content)s.type==="text"&&s.text&&(r+=s.text);r&&t.push(...kse(r))}return t}function iXe(e,t){const n=[],r=e.includes("\\")?"\\":"/";let s=hDt(e);for(;s&&ODt(t,s);){const i=`${s}${r}${uDt}`;n.push(i);const o=mDt(s);if(!o||o===s)break;s=o}return n}function oXe(e,t,n){const r=[],s=v=>n?.[v]?.estimatedTokens??tXe,i=n?.enterprise?.path??"/Library/Application Support/ClaudeCode/CLAUDE.md",o=s("enterprise");o>0&&r.push({id:Mp(i),path:i,source:"enterprise",displayName:Qp(i),isGlobal:!0,estimatedTokens:o,firstSeenInGroup:t});const a="~/.claude/CLAUDE.md",c=s("user");c>0&&r.push({id:Mp(a),path:a,source:"user-memory",displayName:Qp(a),isGlobal:!0,estimatedTokens:c,firstSeenInGroup:t});const l=kS(e,"CLAUDE.md"),d=kS(e,".claude/CLAUDE.md"),p=s("project");p>0&&r.push({id:Mp(l),path:l,source:tge,displayName:Qp(l),isGlobal:!0,estimatedTokens:p,firstSeenInGroup:t});const f=s("project-alt");f>0&&r.push({id:Mp(d),path:d,source:tge,displayName:Qp(d),isGlobal:!0,estimatedTokens:f,firstSeenInGroup:t});const h=kS(e,".claude/rules/*.md"),m=s("project-rules");m>0&&r.push({id:Mp(h),path:h,source:"project-rules",displayName:Qp(h),isGlobal:!0,estimatedTokens:m,firstSeenInGroup:t});const O=kS(e,"CLAUDE.local.md"),_=s("project-local");_>0&&r.push({id:Mp(O),path:O,source:"project-local",displayName:Qp(O),isGlobal:!0,estimatedTokens:_,firstSeenInGroup:t});const b="~/.claude/rules/**/*.md",y=s("user-rules");y>0&&r.push({id:Mp(b),path:b,source:"user-rules",displayName:Qp(b),isGlobal:!0,estimatedTokens:y,firstSeenInGroup:t});const x=n?.["auto-memory"]?.path??"~/.claude/projects/.../memory/MEMORY.md",S=s("auto-memory");return S>0&&r.push({id:Mp(x),path:x,source:"auto-memory",displayName:Qp(x),isGlobal:!0,estimatedTokens:S,firstSeenInGroup:t}),r}function gDt(e,t){return{id:Mp(e),path:e,source:"directory",displayName:Qp(e),isGlobal:!1,estimatedTokens:tXe,firstSeenInGroup:t}}function _Dt(e){const{aiGroup:t,userGroup:n,isFirstGroup:r,previousInjections:s,projectRoot:i,contextTokens:o,tokenData:a}=e,c=[],l=new Set(s.map(y=>y.path)),d=`ai-${t.turnIndex}`;if(r){const y=oXe(i,d,a);for(const x of y)l.has(x.path)||(c.push(x),l.add(x.path))}const p=[],f=nXe(t.steps);p.push(...f);const h=rXe(n,i);p.push(...h);const m=sXe(t.responses);for(const y of m)if(y.path){const x=Cse(y.path)?y.path:kS(i,y.path);p.push(x)}for(const y of p){const x=iXe(y,i);for(const S of x){if(l.has(S)||RO(S)===`${RO(i)}/CLAUDE.md`||RO(S)===`${RO(i)}/.claude/CLAUDE.md`||RO(S)===`${RO(i)}/CLAUDE.local.md`)continue;const T=gDt(S,d);c.push(T),l.add(S)}}const O=[...s,...c],_=O.reduce((y,x)=>y+x.estimatedTokens,0),b=o>0?_/o*100:0;return{newInjections:c,accumulatedInjections:O,totalEstimatedTokens:_,percentageOfContext:b,newCount:c.length,accumulatedCount:O.length}}function bDt(e,t,n){const r=new Map;let s=[],i=!0,o=null;for(const a of e){if(a.type==="user"){o=a.group;continue}if(a.type==="compact"){s=[],i=!0,o=null;continue}if(a.type==="ai"){const c=a.group,l=c.tokens.input||0,d=_Dt({aiGroup:c,userGroup:o,isFirstGroup:i,previousInjections:s,projectRoot:t,contextTokens:l,tokenData:n});r.set(c.id,d),s=d.accumulatedInjections,i=!1,o=null}}return r}const nge=25e3,zQ="mentioned-file",aXe=new Set(["SendMessage","TeamCreate","TeamDelete","TaskCreate","TaskUpdate","TaskList","TaskGet"]);function yDt(e){let t=0;for(let r=0;r<e.length;r++){const s=e.charCodeAt(r);t=(t<<5)-t+s,t=t&t}return`mf-${Math.abs(t).toString(16)}`}function xDt(e){return`tool-output-ai-${e}`}function SDt(e){return`thinking-text-ai-${e}`}function vDt(e){return`task-coord-ai-${e}`}function TDt(e){return`user-msg-ai-${e}`}function hY(e){return{...e,category:"claude-md"}}function rge(e){return{id:yDt(e.path),category:zQ,path:e.path,displayName:e.displayName,estimatedTokens:e.estimatedTokens,firstSeenTurnIndex:e.turnIndex,firstSeenInGroup:e.aiGroupId,exists:e.exists??!0}}function EDt(e,t,n,r){const s=[];let i=0;for(const o of e.values()){if(aXe.has(o.name))continue;const a=o.callTokens??0,c=o.result?.tokenCount??0,l=o.skillInstructionsTokenCount??0,d=a+c+l;if(d>0){const p=o.name==="Task"?"Task (Subagent)":o.name;s.push({toolName:p,tokenCount:d,isError:o.result?.isError??!1,toolUseId:o.id}),i+=d}}if(r)for(const o of r)o.type==="slash"&&o.slash.instructionsTokenCount&&(s.push({toolName:`/${o.slash.name}`,tokenCount:o.slash.instructionsTokenCount,isError:!1}),i+=o.slash.instructionsTokenCount);return i===0?null:{id:xDt(t),category:"tool-output",turnIndex:t,aiGroupId:n,estimatedTokens:i,toolCount:s.length,toolBreakdown:s}}function wDt(e,t,n,r){const s=[];let i=0;for(const o of e.values()){if(!aXe.has(o.name))continue;const a=o.callTokens??0,c=o.result?.tokenCount??0,l=o.skillInstructionsTokenCount??0,d=a+c+l;if(d>0){let p=o.name;if(o.name==="SendMessage"&&o.input){const f=o.input.recipient;f&&(p=`SendMessage → ${f}`)}s.push({type:o.name==="SendMessage"?"send-message":"task-tool",toolName:o.name,tokenCount:d,label:p}),i+=d}}if(r)for(const o of r)o.type==="teammate_message"&&o.teammateMessage.tokenCount&&(s.push({type:"teammate-message",tokenCount:o.teammateMessage.tokenCount,label:o.teammateMessage.teammateId}),i+=o.teammateMessage.tokenCount);return i===0?null:{id:vDt(t),category:"task-coordination",turnIndex:t,aiGroupId:n,estimatedTokens:i,breakdown:s}}function kDt(e,t,n){const r=e.content.rawText??e.content.text??"";if(!r)return null;const s=No(r);if(s===0)return null;const i=r.length>80?r.slice(0,80)+"…":r;return{id:TDt(t),category:"user-message",turnIndex:t,aiGroupId:n,estimatedTokens:s,textPreview:i}}function CDt(e,t,n){const r=[];let s=0,i=0,o=0;for(const a of e)a.type==="thinking"&&a.tokenCount&&a.tokenCount>0?(i+=a.tokenCount,s+=a.tokenCount):a.type==="output"&&a.tokenCount&&a.tokenCount>0&&(o+=a.tokenCount,s+=a.tokenCount);return i>0&&r.push({type:"thinking",tokenCount:i}),o>0&&r.push({type:"text",tokenCount:o}),s===0?null:{id:SDt(t),category:"thinking-text",turnIndex:t,aiGroupId:n,estimatedTokens:s,breakdown:r}}function BQ(e){return e.startsWith("/")||e.startsWith("~/")||e.startsWith("~\\")||e==="~"||e.startsWith("\\\\")||/^[a-zA-Z]:[\\/]/.test(e)}function mY(e,t){if(BQ(t))return t;const n=RDt(e);let r=t;r.startsWith("@")&&(r=r.slice(1)),r.startsWith("./")&&(r=r.slice(2));const s=n.includes("\\")?"\\":"/",i=n.startsWith("/"),o=n.startsWith("\\\\"),a=PDt(r,s),c=$Dt(n);let l=a;for(;l.startsWith(`..${s}`);)l=l.slice(3),c.length>1&&c.pop();let d=c.join(s);return i&&!d.startsWith("/")&&(d=`/${d}`),o&&!d.startsWith("\\\\")&&(d=`\\\\${d}`),l?`${d}${s}${l}`:d}function RDt(e){let t=e.length;for(;t>0;){const n=e[t-1];if(n!=="/"&&n!=="\\")break;t--}return e.slice(0,t)}function PDt(e,t){let n="",r=!1;for(const s of e)s==="/"||s==="\\"?(r||(n+=t),r=!0):(n+=s,r=!1);return n}function $Dt(e){const t=[];let n="";for(const r of e)r==="/"||r==="\\"?n.length>0&&(t.push(n),n=""):n+=r;return n.length>0&&t.push(n),t}function gx(e){return e.replace(/\\/g,"/")}function sge(e,t){return{id:Mp(e),path:e,source:"directory",displayName:Qp(e),isGlobal:!1,estimatedTokens:500,firstSeenInGroup:t}}function NDt(e){const{aiGroup:t,userGroup:n,linkedTools:r,displayItems:s,isFirstGroup:i,previousInjections:o,projectRoot:a,claudeMdTokenData:c,mentionedFileTokenData:l,directoryTokenData:d}=e,p=[],f=new Set(o.filter(w=>w.category==="claude-md"||w.category===zQ).map(w=>w.path)),h=`ai-${t.turnIndex}`;if(i){const w=oXe(a,h,c);for(const P of w)f.has(P.path)||(p.push(hY(P)),f.add(P.path))}const m=[],O=nXe(t.steps);m.push(...O);const _=rXe(n,a);m.push(..._);const b=sXe(t.responses);for(const w of b)if(w.path){const P=BQ(w.path)?w.path:mY(a,w.path);m.push(P)}for(const w of m){const P=iXe(w,a);for(const k of P)if(!(f.has(k)||gx(k)===`${gx(a)}/CLAUDE.md`||gx(k)===`${gx(a)}/.claude/CLAUDE.md`||gx(k)===`${gx(a)}/CLAUDE.local.md`))if(d){const M=d[k];if(!M||!M.exists||M.estimatedTokens<=0)continue;const I=sge(k,h);I.estimatedTokens=M.estimatedTokens,p.push(hY(I)),f.add(k)}else{const M=sge(k,h);p.push(hY(M)),f.add(k)}}if(n?.content.fileReferences)for(const w of n.content.fileReferences){if(!w.path)continue;const P=BQ(w.path)?w.path:mY(a,w.path);if(f.has(P))continue;const k=l?.get(P);if(k&&k.exists&&k.estimatedTokens<=nge){const C=rge({path:P,displayName:w.path,estimatedTokens:k.estimatedTokens,turnIndex:t.turnIndex,aiGroupId:h,exists:k.exists});p.push(C),f.add(P)}}for(const w of b){if(!w.path)continue;const P=BQ(w.path)?w.path:mY(a,w.path);if(f.has(P))continue;const k=l?.get(P);if(k&&k.exists&&k.estimatedTokens<=nge){const C=rge({path:P,displayName:w.path,estimatedTokens:k.estimatedTokens,turnIndex:t.turnIndex,aiGroupId:h,exists:k.exists});p.push(C),f.add(P)}}const y=EDt(r,t.turnIndex,h,s);y&&p.push(y);const x=wDt(r,t.turnIndex,h,s);if(x&&p.push(x),n){const w=kDt(n,t.turnIndex,h);w&&p.push(w)}if(s){const w=CDt(s,t.turnIndex,h);w&&p.push(w)}const S=[...o,...p],v={claudeMd:0,mentionedFiles:0,toolOutputs:0,thinkingText:0,taskCoordination:0,userMessages:0},T={claudeMd:0,mentionedFiles:0,toolOutputs:0,thinkingText:0,taskCoordination:0,userMessages:0};for(const w of p)switch(w.category){case"claude-md":T.claudeMd++;break;case zQ:T.mentionedFiles++;break;case"tool-output":T.toolOutputs+=w.toolCount;break;case"thinking-text":T.thinkingText++;break;case"task-coordination":T.taskCoordination+=w.breakdown.length;break;case"user-message":T.userMessages++;break}for(const w of S)switch(w.category){case"claude-md":v.claudeMd+=w.estimatedTokens;break;case zQ:v.mentionedFiles+=w.estimatedTokens;break;case"tool-output":v.toolOutputs+=w.estimatedTokens;break;case"thinking-text":v.thinkingText+=w.estimatedTokens;break;case"task-coordination":v.taskCoordination+=w.estimatedTokens;break;case"user-message":v.userMessages+=w.estimatedTokens;break}const E=v.claudeMd+v.mentionedFiles+v.toolOutputs+v.thinkingText+v.taskCoordination+v.userMessages;return{newInjections:p,accumulatedInjections:S,totalEstimatedTokens:E,tokensByCategory:v,newCounts:T}}function ADt(e){const t=e.responses||[];for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.type==="assistant"&&r.usage)return(r.usage.input_tokens??0)+(r.usage.output_tokens??0)+(r.usage.cache_read_input_tokens??0)+(r.usage.cache_creation_input_tokens??0)}}function IDt(e){const t=e.responses||[];for(const n of t)if(n.type==="assistant"&&n.usage)return(n.usage.input_tokens??0)+(n.usage.output_tokens??0)+(n.usage.cache_read_input_tokens??0)+(n.usage.cache_creation_input_tokens??0)}function MDt(e,t,n,r,s){const i=new Map;let o=[],a=!0,c=null,l=1;const d=[],p=new Map,f=new Map;let h=null,m=null,O=null,_=null;for(const y of e){if(y.type==="user"){c=y.group;continue}if(y.type==="compact"){h&&m&&d.push({phaseNumber:l,firstAIGroupId:h,lastAIGroupId:m,compactGroupId:O}),o=[],a=!0,c=null,l++,O=y.group.id,h=null,m=null;continue}if(y.type==="ai"){const x=y.group;let S=x.linkedTools;(!S||S.size===0)&&(S=bre(x.steps,x.responses));let v=x.displayItems;if(!v&&x.steps&&x.steps.length>0){const E=yre(x.steps,x.isOngoing??!1);v=g2e(x.steps,E,x.processes||[],x.responses)}const T=NDt({aiGroup:x,userGroup:c,linkedTools:S,displayItems:v,isFirstGroup:a,previousInjections:o,projectRoot:t,claudeMdTokenData:n,mentionedFileTokenData:r,directoryTokenData:s});if(T.phaseNumber=l,a&&O&&_){const E=ADt(_),w=IDt(x);E!==void 0&&w!==void 0&&f.set(O,{preCompactionTokens:E,postCompactionTokens:w,delta:w-E})}i.set(x.id,T),p.set(x.id,l),h||(h=x.id),m=x.id,_=x,o=T.accumulatedInjections,a=!1,c=null}}h&&m&&d.push({phaseNumber:l,firstAIGroupId:h,lastAIGroupId:m,compactGroupId:O});const b={phases:d,compactionCount:l-1,aiGroupPhaseMap:p,compactionTokenDeltas:f};return{statsMap:i,phaseInfo:b}}function hZ(e,t){if(QDt(t))return t;const n=DDt(e);let r=t;if(r.startsWith("@")&&(r=r.slice(1)),r.startsWith("~/")||r.startsWith("~\\")||r==="~")return r;r.startsWith("./")&&(r=r.slice(2));const s=n.includes("\\")?"\\":"/",i=n.startsWith("/"),o=n.startsWith("\\\\"),a=LDt(r,s),c=jDt(n);let l=a;for(;l.startsWith(`..${s}`);)l=l.slice(3),c.length>1&&c.pop();let d=c.join(s);return i&&!d.startsWith("/")&&(d=`/${d}`),o&&!d.startsWith("\\\\")&&(d=`\\\\${d}`),l?`${d}${s}${l}`:d}function QDt(e){return e.startsWith("/")||e.startsWith("\\\\")||/^[a-zA-Z]:[\\/]/.test(e)}function DDt(e){let t=e.length;for(;t>0;){const n=e[t-1];if(n!=="/"&&n!=="\\")break;t--}return e.slice(0,t)}function LDt(e,t){let n="",r=!1;for(const s of e)s==="/"||s==="\\"?(r||(n+=t),r=!0):(n+=s,r=!1);return n}function jDt(e){const t=[];let n="";for(const r of e)r==="/"||r==="\\"?n.length>0&&(t.push(n),n=""):n+=r;return n.length>0&&t.push(n),t}const _x=Hi("Store:sessionDetail"),OY=new Map,gY=new Set,_Y=new Set,RL=new Map;function XDt(e){const t=e??"__global__",n=(RL.get(t)??0)+1;return RL.set(t,n),n}function bx(e,t){return RL.get(t??"__global__")===e}let bY="";function ige(){return{sessionDetail:null,conversation:null,conversationLoading:!1,sessionDetailLoading:!1,sessionDetailError:null,sessionClaudeMdStats:null,sessionContextStats:null,sessionPhaseInfo:null,visibleAIGroupId:null,selectedAIGroup:null}}const UDt=(e,t)=>({sessionDetail:null,sessionDetailLoading:!1,sessionDetailError:null,conversation:null,conversationLoading:!1,sessionClaudeMdStats:null,sessionContextStats:null,sessionPhaseInfo:null,agentConfigs:{},visibleAIGroupId:null,selectedAIGroup:null,tabSessionData:{},fetchSessionDetail:async(n,r,s,i)=>{const o=XDt(s);if(i?.silent||e({sessionDetailLoading:!0,sessionDetailError:null,conversationLoading:!0}),s&&!i?.silent){const a=t().tabSessionData;e({tabSessionData:{...a,[s]:{...a[s]??ige(),sessionDetailLoading:!0,sessionDetailError:null,conversationLoading:!0}}})}try{const a=await K.getSessionDetail(n,r);if(!bx(o,s))return;const c=a?.session?.isOngoing??!1,l=a?pT(a.chunks):null,d=a&&l?nP(l,a.processes,c):null,p=d?.items?.find(w=>w.type==="ai"),f=p?.type==="ai"?p.group.id:null,h=p?.type==="ai"?p.group:null,m=a?.session?.projectPath??"",{connectionMode:O}=t();let _=null,b=null,y=null;if(O!=="ssh"&&m&&m!==bY&&(bY=m,K.readAgentConfigs(m).then(w=>{e({agentConfigs:w})}).catch(w=>{_x.error("Failed to read agent configs:",w),bY=""})),O!=="ssh"&&d?.items){let w={};try{if(w=await K.readClaudeMdFiles(m),!bx(o,s))return}catch($){_x.error("Failed to read CLAUDE.md files:",$)}_=bDt(d.items,m,w);const P={};if(_&&_.size>0){const $=new Set;for(const R of _.values())for(const N of R.accumulatedInjections)N.source==="directory"&&$.add(N.path);if($.size>0){const R=new Map,N=new Set,j=await Promise.all(Array.from($).map(async Q=>{try{const U=Q.replace(/[\\/]CLAUDE\.md$/,""),A=await K.readDirectoryClaudeMd(U);return{fullPath:Q,fileInfo:A,error:!1}}catch(U){return _x.error("Failed to read directory CLAUDE.md:",Q,U),{fullPath:Q,fileInfo:null,error:!0}}}));if(!bx(o,s))return;for(const{fullPath:Q,fileInfo:U,error:A}of j)A||!U?N.add(Q):U.exists&&U.estimatedTokens>0?(R.set(Q,U.estimatedTokens),P[Q]=U):N.add(Q);for(const[,Q]of _.entries()){Q.accumulatedInjections=Q.accumulatedInjections.filter(U=>U.source!=="directory"||!N.has(U.path)),Q.newInjections=Q.newInjections.filter(U=>U.source!=="directory"||!N.has(U.path));for(const U of Q.accumulatedInjections)U.source==="directory"&&R.has(U.path)&&(U.estimatedTokens=R.get(U.path));for(const U of Q.newInjections)U.source==="directory"&&R.has(U.path)&&(U.estimatedTokens=R.get(U.path));Q.totalEstimatedTokens=Q.accumulatedInjections.reduce((U,A)=>U+A.estimatedTokens,0),Q.accumulatedCount=Q.accumulatedInjections.length,Q.newCount=Q.newInjections.length}}}const k=new Set;for(const $ of d.items)if($.type==="user"&&$.group.content.fileReferences)for(const R of $.group.content.fileReferences){const N=hZ(m,R.path);k.add(N)}for(const $ of d.items)if($.type==="ai")for(const R of $.group.responses){if(R.type!=="user")continue;let N="";if(typeof R.content=="string")N=R.content;else if(Array.isArray(R.content))for(const j of R.content)j.type==="text"&&j.text&&(N+=j.text);if(N)for(const j of kse(N)){const Q=hZ(m,j.path);k.add(Q)}}const C=new Map,M=await Promise.all(Array.from(k).map(async $=>{try{const R=await K.readMentionedFile($,m);return{filePath:$,fileInfo:R}}catch(R){return _x.error("Failed to read mentioned file:",$,R),{filePath:$,fileInfo:null}}}));if(!bx(o,s))return;for(const{filePath:$,fileInfo:R}of M)R&&C.set($,R);const I=MDt(d.items,m,w,C,P);b=I.statsMap,y=I.phaseInfo}const x=t();if(!bx(o,s))return;const S=fu(x.paneLayout),v=pZ(S,r);if(v&&a){const w=a.session.firstMessage?fZ(a.session.firstMessage):`Session ${r.slice(0,8)}`;x.updateTabLabel(v.id,w)}if(s&&d?.items&&t().appConfig?.general?.autoExpandAIGroups)for(const w of d.items)w.type==="ai"&&t().expandAIGroupForTab(s,w.group.id);if(s){const w=t().tabSessionData;e({tabSessionData:{...w,[s]:{sessionDetail:a,conversation:d,conversationLoading:!1,sessionDetailLoading:!1,sessionDetailError:null,sessionClaudeMdStats:_,sessionContextStats:b,sessionPhaseInfo:y,visibleAIGroupId:f,selectedAIGroup:h}}})}const T=x.getActiveTab();x.selectedSessionId===r||T?.type==="session"&&T.sessionId===r&&T.projectId===n?e({sessionDetail:a,sessionDetailLoading:!1,conversation:d,conversationLoading:!1,visibleAIGroupId:f,selectedAIGroup:h,sessionClaudeMdStats:_,sessionContextStats:b,sessionPhaseInfo:y}):i?.silent||e({sessionDetailLoading:!1,conversationLoading:!1})}catch(a){if(_x.error("fetchSessionDetail error:",a),!bx(o,s))return;const c=a instanceof Error?a.message:"获取会话详情失败";if(i?.silent||e({sessionDetailError:c,sessionDetailLoading:!1,conversationLoading:!1}),s&&!i?.silent){const l=t().tabSessionData;e({tabSessionData:{...l,[s]:{...l[s]??ige(),sessionDetailError:c,sessionDetailLoading:!1,conversationLoading:!1}}})}}},refreshSessionInPlace:async(n,r)=>{const s=t(),o=fu(s.paneLayout).filter(l=>l.type==="session"&&l.sessionId===r);if(s.selectedSessionId!==r&&o.length===0)return;const a=`${n}/${r}`;if(gY.has(a)){_Y.add(a);return}const c=(OY.get(a)??0)+1;OY.set(a,c),gY.add(a);try{const l=await K.getSessionDetail(n,r);if(OY.get(a)!==c||!l)return;const d=l.session?.isOngoing??!1,p=pT(l.chunks);if(!p)return;const f=nP(p,l.processes,d);if(!f)return;const h=t(),m=fu(h.paneLayout);if(!(h.selectedSessionId===r||m.some(T=>T.type==="session"&&T.sessionId===r)))return;const _=s.visibleAIGroupId,b=s.selectedAIGroup,y=_&&f.items.some(T=>T.type==="ai"&&T.group.id===_);let x=b;if(y&&_){const T=f.items.find(E=>E.type==="ai"&&E.group.id===_);T?.type==="ai"&&(x=T.group)}const S=new Set((h.conversation?.items??[]).filter(T=>T.type==="ai").map(T=>T.group.id));if(e(T=>({sessionDetail:l,conversation:f,sessions:T.sessions.map(E=>E.id===r?{...E,isOngoing:l.session?.isOngoing??!1}:E),...y?{selectedAIGroup:x}:{}})),t().appConfig?.general?.autoExpandAIGroups){const T=S,E=f.items.filter(w=>w.type==="ai"&&!T.has(w.group.id)).map(w=>w.group.id);if(E.length>0){for(const w of m)if(w.type==="session"&&w.sessionId===r)for(const P of E)t().expandAIGroupForTab(w.id,P)}}const v={...t().tabSessionData};for(const T of m)if(T.type==="session"&&T.sessionId===r&&v[T.id]){const E=v[T.id],w=E.visibleAIGroupId,P=w&&f.items.some(C=>C.type==="ai"&&C.group.id===w);let k=E.selectedAIGroup;if(P&&w){const C=f.items.find(M=>M.type==="ai"&&M.group.id===w);C?.type==="ai"&&(k=C.group)}v[T.id]={...E,sessionDetail:l,conversation:f,...P?{selectedAIGroup:k}:{}}}e({tabSessionData:v})}catch(l){_x.error("refreshSessionInPlace error:",l)}finally{gY.delete(a),_Y.has(a)&&(_Y.delete(a),t().refreshSessionInPlace(n,r))}},setVisibleAIGroup:n=>{const r=t();if(n===r.visibleAIGroupId)return;let s=null;if(n&&r.conversation){for(const i of r.conversation.items)if(i.type==="ai"&&i.group.id===n){s=i.group;break}}e({visibleAIGroupId:n,selectedAIGroup:s})},setTabVisibleAIGroup:(n,r)=>{const s=t(),i=s.tabSessionData[n];if(!i||r===i.visibleAIGroupId)return;let o=null;if(r&&i.conversation){for(const a of i.conversation.items)if(a.type==="ai"&&a.group.id===r){o=a.group;break}}e({tabSessionData:{...s.tabSessionData,[n]:{...i,visibleAIGroupId:r,selectedAIGroup:o}}})},cleanupTabSessionData:n=>{RL.delete(n);const r=t().tabSessionData;if(!(n in r))return;const s={...r};delete s[n],e({tabSessionData:s})}}),ad=Hi("Store:session"),zDt=150;function BDt(e){const t=e instanceof Error?e.message:String(e??"");return t.includes("Error invoking remote method 'get-sessions-paginated': reply was never sent")||t.includes("No handler registered for 'get-sessions-paginated'")}const yY=new Map,FDt=(e,t)=>({sessions:[],selectedSessionId:null,sessionsLoading:!1,sessionsError:null,sessionsCursor:null,sessionsHasMore:!1,sessionsTotalCount:0,sessionsLoadingMore:!1,pinnedSessionIds:[],hiddenSessionIds:[],showHiddenSessions:!1,sidebarSelectedSessionIds:[],sidebarMultiSelectActive:!1,sessionSortMode:"recent",fetchSessions:async n=>{e({sessionsLoading:!0,sessionsError:null});try{const s=[...await K.getSessions(n)].sort((i,o)=>o.createdAt-i.createdAt);e({sessions:s,sessionsLoading:!1})}catch(r){e({sessionsError:r instanceof Error?r.message:"Failed to fetch sessions",sessionsLoading:!1})}},fetchSessionsInitial:async n=>{e({sessionsLoading:!0,sessionsError:null,sessions:[],sessionsCursor:null,sessionsHasMore:!1,sessionsTotalCount:0});try{const{connectionMode:r}=t(),s=await K.getSessionsPaginated(n,null,20,{includeTotalCount:!1,prefilterAll:!1,metadataLevel:r==="ssh"?"light":"deep"});e({sessions:s.sessions,sessionsCursor:s.nextCursor,sessionsHasMore:s.hasMore,sessionsTotalCount:s.totalCount,sessionsLoading:!1}),t().loadPinnedSessions(),t().loadHiddenSessions()}catch(r){e({sessionsError:r instanceof Error?r.message:"Failed to fetch sessions",sessionsLoading:!1})}},fetchSessionsMore:async()=>{const n=t(),{selectedProjectId:r,sessionsCursor:s,sessionsHasMore:i,sessionsLoadingMore:o}=n;if(!(!r||!i||o||!s)){e({sessionsLoadingMore:!0});try{const{connectionMode:a}=t(),c=await K.getSessionsPaginated(r,s,20,{includeTotalCount:!1,prefilterAll:!1,metadataLevel:a==="ssh"?"light":"deep"}),l=new Set(t().sessions.map(p=>p.id)),d=c.sessions.filter(p=>!l.has(p.id));e(p=>{const f=[...p.sessions,...d],h=f.length+(c.hasMore?1:0),m=Math.max(p.sessionsTotalCount,c.totalCount,h);return{sessions:f,sessionsCursor:c.nextCursor,sessionsHasMore:c.hasMore,sessionsTotalCount:m,sessionsLoadingMore:!1}})}catch(a){e({sessionsError:a instanceof Error?a.message:"Failed to fetch more sessions",sessionsLoadingMore:!1})}}},resetSessionsPagination:()=>{e({sessions:[],sessionsCursor:null,sessionsHasMore:!1,sessionsTotalCount:0,sessionsLoadingMore:!1,sessionsError:null})},selectSession:n=>{e({selectedSessionId:n,sessionDetail:null,sessionContextStats:null,sessionDetailError:null});const r=t(),s=r.selectedProjectId;if(s){const i=r.activeTabId??void 0;r.fetchSessionDetail(s,n,i)}else ad.warn("Cannot fetch session detail: no project selected")},clearSelection:()=>{e({selectedProjectId:null,selectedSessionId:null,sessions:[],sessionDetail:null,sessionContextStats:null})},refreshSessionsInPlace:async n=>{if(t().selectedProjectId!==n)return;const s=(yY.get(n)??0)+1;yY.set(n,s);const i=async()=>{const{connectionMode:a}=t();return K.getSessionsPaginated(n,null,20,{includeTotalCount:!1,prefilterAll:!1,metadataLevel:a==="ssh"?"light":"deep"})},o=a=>{yY.get(n)===s&&e({sessions:a.sessions,sessionsCursor:a.nextCursor,sessionsHasMore:a.hasMore,sessionsTotalCount:a.totalCount})};try{const a=await i();o(a)}catch(a){if(BDt(a)&&t().selectedProjectId===n){ad.warn("refreshSessionsInPlace transient IPC error - retrying once");try{if(await new Promise(l=>setTimeout(l,zDt)),t().selectedProjectId!==n)return;const c=await i();o(c);return}catch(c){ad.error("refreshSessionsInPlace retry error:",c);return}}ad.error("refreshSessionsInPlace error:",a)}},togglePinSession:async n=>{const r=t(),s=r.selectedProjectId;if(!s)return;const i=r.pinnedSessionIds.includes(n),o=r.pinnedSessionIds;e(i?{pinnedSessionIds:o.filter(a=>a!==n)}:{pinnedSessionIds:[n,...o]});try{i?await K.config.unpinSession(s,n):await K.config.pinSession(s,n)}catch(a){e({pinnedSessionIds:o}),ad.error("togglePinSession error:",a)}},loadPinnedSessions:async()=>{const r=t().selectedProjectId;if(!r){e({pinnedSessionIds:[]});return}try{const{connectionMode:s}=t(),a=((await K.config.get()).sessions?.pinnedSessions?.[r]??[]).map(p=>p.sessionId);e({pinnedSessionIds:a});const c=t().sessions,l=new Set(c.map(p=>p.id)),d=a.filter(p=>!l.has(p));if(d.length>0){const p=await K.getSessionsByIds(r,d,{metadataLevel:s==="ssh"?"light":"deep"});if(p.length>0){const f=t().sessions,h=new Set(f.map(O=>O.id)),m=p.filter(O=>!h.has(O.id));m.length>0&&e({sessions:[...f,...m]})}}}catch(s){ad.error("loadPinnedSessions error:",s),e({pinnedSessionIds:[]})}},setSessionSortMode:n=>{e({sessionSortMode:n})},toggleHideSession:async n=>{const r=t(),s=r.selectedProjectId;if(!s)return;const i=r.hiddenSessionIds.includes(n),o=r.hiddenSessionIds;e(i?{hiddenSessionIds:o.filter(a=>a!==n)}:{hiddenSessionIds:[n,...o]});try{i?await K.config.unhideSession(s,n):await K.config.hideSession(s,n)}catch(a){e({hiddenSessionIds:o}),ad.error("toggleHideSession error:",a)}},hideMultipleSessions:async n=>{const r=t(),s=r.selectedProjectId;if(!s||n.length===0)return;const i=r.hiddenSessionIds,o=new Set(i),a=n.filter(c=>!o.has(c));e({hiddenSessionIds:[...a,...i]});try{await K.config.hideSessions(s,n)}catch(c){e({hiddenSessionIds:i}),ad.error("hideMultipleSessions error:",c)}},unhideMultipleSessions:async n=>{const r=t(),s=r.selectedProjectId;if(!s||n.length===0)return;const i=r.hiddenSessionIds,o=new Set(n);e({hiddenSessionIds:i.filter(a=>!o.has(a))});try{await K.config.unhideSessions(s,n)}catch(a){e({hiddenSessionIds:i}),ad.error("unhideMultipleSessions error:",a)}},loadHiddenSessions:async()=>{const r=t().selectedProjectId;if(!r){e({hiddenSessionIds:[]});return}try{const o=((await K.config.get()).sessions?.hiddenSessions?.[r]??[]).map(a=>a.sessionId);e({hiddenSessionIds:o})}catch(s){ad.error("loadHiddenSessions error:",s),e({hiddenSessionIds:[]})}},toggleShowHiddenSessions:()=>{e(n=>({showHiddenSessions:!n.showHiddenSessions}))},toggleSidebarSessionSelection:n=>{e(r=>{const s=r.sidebarSelectedSessionIds;return s.includes(n)?{sidebarSelectedSessionIds:s.filter(i=>i!==n)}:{sidebarSelectedSessionIds:[...s,n],sidebarMultiSelectActive:!0}})},clearSidebarSelection:()=>{e({sidebarSelectedSessionIds:[],sidebarMultiSelectActive:!1})},toggleSidebarMultiSelect:()=>{e(n=>n.sidebarMultiSelectActive?{sidebarMultiSelectActive:!1,sidebarSelectedSessionIds:[]}:{sidebarMultiSelectActive:!0})},pinMultipleSessions:async n=>{const r=t(),s=r.selectedProjectId;if(!s||n.length===0)return;const i=r.pinnedSessionIds,o=new Set(i),a=n.filter(c=>!o.has(c));e({pinnedSessionIds:[...a,...i]});try{await Promise.all(a.map(c=>K.config.pinSession(s,c)))}catch(c){e({pinnedSessionIds:i}),ad.error("pinMultipleSessions error:",c)}}}),YDt=(e,t)=>({drillDownStack:[],currentSubagentDetail:null,subagentDetailLoading:!1,subagentDetailError:null,drillDownSubagent:async(n,r,s,i)=>{e({subagentDetailLoading:!0,subagentDetailError:null});try{const o=await K.getSubagentDetail(n,r,s);if(!o){e({subagentDetailError:"Failed to load subagent details",subagentDetailLoading:!1});return}const a=t().drillDownStack;e({drillDownStack:[...a,{id:s,description:i}],currentSubagentDetail:o,subagentDetailLoading:!1})}catch(o){e({subagentDetailError:o instanceof Error?o.message:"Failed to load subagent",subagentDetailLoading:!1})}},navigateToBreadcrumb:n=>{const r=t();if(n<=0){e({drillDownStack:[],currentSubagentDetail:null,subagentDetailError:null});return}const s=r.drillDownStack.slice(0,n);if(s.length===0){e({drillDownStack:[],currentSubagentDetail:null,subagentDetailError:null});return}const i=s[s.length-1],o=r.selectedProjectId,a=r.selectedSessionId;!o||!a||(e({subagentDetailLoading:!0,subagentDetailError:null}),K.getSubagentDetail(o,a,i.id).then(c=>{e(c?{drillDownStack:s,currentSubagentDetail:c,subagentDetailLoading:!1}:{subagentDetailError:"Failed to load subagent details",subagentDetailLoading:!1})}).catch(c=>{e({subagentDetailError:c instanceof Error?c.message:"Failed to load subagent",subagentDetailLoading:!1})}))},closeSubagentModal:()=>{e({drillDownStack:[],currentSubagentDetail:null,subagentDetailError:null})}});function xo(e){const t=Kje(e);return{paneLayout:e,openTabs:t.openTabs,activeTabId:t.activeTabId,selectedTabIds:t.selectedTabIds}}function $1(e,t,n){const r=kh(e,t);return r?eo(e,{...r,tabs:r.tabs.map(s=>s.id===t?n(s):s)}):e}const VDt=(e,t)=>({openTabs:[],activeTabId:null,selectedTabIds:[],activeProjectId:null,openTab:(n,r)=>{const s=t(),{paneLayout:i}=s,o=Ql(i,i.focusedPaneId);if(!o)return;if(n.type==="session"&&n.sessionId&&!r?.forceNewTab){const d=fu(i),p=pZ(d,n.sessionId);if(p){s.setActiveTab(p.id);return}const f=o.tabs.find(h=>h.id===o.activeTabId);if(f&&(r?.replaceActiveTab||f.type==="dashboard")){f.type==="session"&&(s.cleanupTabUIState(f.id),s.cleanupTabSessionData(f.id));const h={...n,id:f.id,label:fZ(n.label),createdAt:Date.now()},m={...o,tabs:o.tabs.map(_=>_.id===f.id?h:_),activeTabId:h.id},O=eo(i,m);e(xo(O));return}}const a={...n,id:crypto.randomUUID(),label:fZ(n.label),createdAt:Date.now()},c={...o,tabs:[...o.tabs,a],activeTabId:a.id},l=eo(i,c);e(xo(l))},closeTab:n=>{const r=t(),{paneLayout:s}=r,i=kh(s,n);if(!i)return;const o=i.tabs.findIndex(f=>f.id===n);if(o===-1)return;r.cleanupTabUIState(n),r.cleanupTabSessionData(n);const a=i.tabs.filter(f=>f.id!==n);let c=i.activeTabId;if(i.activeTabId===n&&(c=a[o]?.id??a[o-1]?.id??null),a.length===0&&s.panes.length>1){r.closePane(i.id);return}const l=s.panes.filter(f=>f.id!==i.id).flatMap(f=>f.tabs);if(a.length===0&&l.length===0){const f={...i,tabs:[],activeTabId:null,selectedTabIds:[]},h=eo(s,f);e({...xo(h),...Kv()});return}const d={...i,tabs:a,activeTabId:c,selectedTabIds:i.selectedTabIds.filter(f=>f!==n)},p=eo(s,d);e(xo(p)),c&&t().setActiveTab(c)},setActiveTab:n=>{const r=t(),{paneLayout:s}=r,i=r.getActiveTab(),a=kh(s,n)?.tabs.find(f=>f.id===n);i?.id!==n&&$xt(i?.label??"none",a?.label??n);const c=kh(s,n);if(!c)return;const l=c.tabs.find(f=>f.id===n);if(!l)return;const d={...c,activeTabId:n};let p=eo(s,d);if(p={...p,focusedPaneId:c.id},e(xo(p)),l.type==="session"&&l.sessionId&&l.projectId){const f=l.sessionId,h=l.projectId,m=r.selectedSessionId!==f,O=r.tabSessionData[n],_=O?.conversation!=null;let b=null,y=null;for(const S of r.repositoryGroups){for(const v of S.worktrees)if(v.id===h){b=S.id,y=v.id;break}if(b)break}if(b&&y){const S=r.selectedWorktreeId!==y;e({selectedRepositoryId:b,selectedWorktreeId:y,selectedSessionId:f,activeProjectId:y,selectedProjectId:y}),S&&t().fetchSessionsInitial(y),m&&(_?e({sessionDetail:O.sessionDetail,conversation:O.conversation,conversationLoading:!1,sessionDetailLoading:!1,sessionDetailError:null,sessionClaudeMdStats:O.sessionClaudeMdStats,sessionContextStats:O.sessionContextStats,sessionPhaseInfo:O.sessionPhaseInfo,visibleAIGroupId:O.visibleAIGroupId,selectedAIGroup:O.selectedAIGroup}):t().fetchSessionDetail(y,f,n));return}const x=r.projects.find(S=>S.id===h||S.sessions.includes(f));if(x){const S=r.selectedProjectId!==x.id;e({activeProjectId:x.id,selectedProjectId:x.id,selectedSessionId:f}),S&&t().fetchSessionsInitial(x.id),m&&(_?e({sessionDetail:O.sessionDetail,conversation:O.conversation,conversationLoading:!1,sessionDetailLoading:!1,sessionDetailError:null,sessionClaudeMdStats:O.sessionClaudeMdStats,sessionContextStats:O.sessionContextStats,sessionPhaseInfo:O.sessionPhaseInfo,visibleAIGroupId:O.visibleAIGroupId,selectedAIGroup:O.selectedAIGroup}):t().fetchSessionDetail(x.id,f,n));return}}if((l.type==="team"||l.type==="graph")&&l.teamName)if(r.selectedTeamName!==l.teamName)r.selectTeam(l.teamName);else{const h=r.selectedTeamData?.config.projectPath;if(h){const m=fr(h),O=r.projects.find(_=>fr(_.path)===m);if(O&&r.selectedProjectId!==O.id)r.selectProject(O.id);else if(!O)for(const _ of r.repositoryGroups){const b=_.worktrees.find(y=>fr(y.path)===m);if(b&&r.selectedWorktreeId!==b.id){e(kU(_.id,b.id)),t().fetchSessionsInitial(b.id);break}}}}},openDashboard:()=>{const n=t(),{paneLayout:r}=n,s=fu(r).find(l=>l.type==="dashboard");if(s){const l=kh(r,s.id);if(l){const d=l.tabs.findIndex(f=>f.id===s.id),p=l.tabs.length-1;if(d!==-1&&d!==p){const f=[...l.tabs],[h]=f.splice(d,1);f.push(h);const m={...l,tabs:f,activeTabId:s.id},O=eo(r,m);e(xo(O));return}}n.setActiveTab(s.id);return}const i=Ql(r,r.focusedPaneId);if(!i)return;const o={id:crypto.randomUUID(),type:"dashboard",label:"首页",createdAt:Date.now()},a={...i,tabs:[...i.tabs,o],activeTabId:o.id},c=eo(r,a);e(xo(c))},openSessionReport:n=>{const r=t(),i=fu(r.paneLayout).find(l=>l.id===n);if(i?.type!=="session"||!i.sessionId||!i.projectId)return;const a=r.tabSessionData[n]?.sessionDetail?.session.firstMessage,c=a?`Report: ${a.slice(0,30)}${a.length>30?"…":""}`:"Session Report";r.openTab({type:"report",label:c,projectId:i.projectId,sessionId:i.sessionId})},getActiveTab:()=>{const n=t(),r=Ql(n.paneLayout,n.paneLayout.focusedPaneId);return r?.activeTabId?r.tabs.find(s=>s.id===r.activeTabId)??null:null},isSessionOpen:n=>fu(t().paneLayout).some(s=>s.type==="session"&&s.sessionId===n),enqueueTabNavigation:(n,r)=>{const{paneLayout:s}=t(),i=$1(s,n,o=>({...o,pendingNavigation:r}));e(xo(i))},consumeTabNavigation:(n,r)=>{const{paneLayout:s}=t(),i=$1(s,n,o=>o.pendingNavigation?.id===r?{...o,pendingNavigation:void 0,lastConsumedNavigationId:r}:o);e(xo(i))},saveTabScrollPosition:(n,r)=>{const{paneLayout:s}=t(),i=$1(s,n,o=>({...o,savedScrollTop:r}));e(xo(i))},updateTabLabel:(n,r)=>{const{paneLayout:s}=t(),i=$1(s,n,o=>({...o,label:r}));e(xo(i))},setTabContextPanelVisible:(n,r)=>{const{paneLayout:s}=t(),i=$1(s,n,o=>({...o,showContextPanel:r}));e(xo(i))},setSelectedTabIds:n=>{const{paneLayout:r}=t(),s=Ql(r,r.focusedPaneId);if(!s)return;const i={...s,selectedTabIds:n},o=eo(r,i);e(xo(o))},clearTabSelection:()=>{const{paneLayout:n}=t(),r=Ql(n,n.focusedPaneId);if(!r)return;const s={...r,selectedTabIds:[]},i=eo(n,s);e(xo(i))},closeOtherTabs:n=>{const r=t(),{paneLayout:s}=r,i=kh(s,n);if(!i)return;const o=i.tabs.filter(d=>d.id!==n);for(const d of o)r.cleanupTabUIState(d.id),r.cleanupTabSessionData(d.id);const a=i.tabs.find(d=>d.id===n);if(!a)return;const c={...i,tabs:[a],activeTabId:n,selectedTabIds:[]},l=eo(s,c);e(xo(l)),t().setActiveTab(n)},closeTabsToRight:n=>{const r=t(),{paneLayout:s}=r,i=kh(s,n);if(!i)return;const o=i.tabs.findIndex(h=>h.id===n);if(o===-1)return;const a=i.tabs.slice(o+1);for(const h of a)r.cleanupTabUIState(h.id),r.cleanupTabSessionData(h.id);const c=i.tabs.slice(0,o+1),d=c.some(h=>h.id===i.activeTabId)?i.activeTabId:n,p={...i,tabs:c,activeTabId:d,selectedTabIds:[]},f=eo(s,p);e(xo(f)),d&&t().setActiveTab(d)},closeAllTabs:()=>{const n=t(),r=fu(n.paneLayout);for(const o of r)n.cleanupTabUIState(o.id),n.cleanupTabSessionData(o.id);const s=n.paneLayout.panes[0]?.id??"pane-default";e({...xo({panes:[{id:s,tabs:[],activeTabId:null,selectedTabIds:[],widthFraction:1}],focusedPaneId:s}),...Kv()})},closeTabs:n=>{const r=t(),s=new Set(n);for(const l of s)r.cleanupTabUIState(l),r.cleanupTabSessionData(l);let{paneLayout:i}=r;const o=[];for(const l of i.panes){const d=l.tabs.filter(f=>!s.has(f.id));if(d.length===l.tabs.length)continue;if(d.length===0&&i.panes.length>1){o.push(l.id);continue}let p=l.activeTabId;if(p&&s.has(p)){const f=l.tabs.findIndex(h=>h.id===p);p=null;for(let h=f;h<l.tabs.length;h++)if(!s.has(l.tabs[h].id)){p=l.tabs[h].id;break}if(!p){for(let h=f-1;h>=0;h--)if(!s.has(l.tabs[h].id)){p=l.tabs[h].id;break}}p=p??d[0]?.id??null}i=eo(i,{...l,tabs:d,activeTabId:p,selectedTabIds:l.selectedTabIds.filter(f=>!s.has(f))})}if(fu(i).length===0){r.closeAllTabs();return}for(const l of o)i=qw(i,l);e(xo(i));const c=t().activeTabId;c&&t().setActiveTab(c)},setActiveProject:n=>{e({activeProjectId:n}),t().selectProject(n)},clearActiveProject:()=>{e({activeProjectId:null,selectedProjectId:null,selectedRepositoryId:null,selectedWorktreeId:null,...Xh()})},navigateToSession:(n,r,s=!1,i)=>{const o=t(),a=fu(o.paneLayout),c=eXe(a,r,n)??pZ(a,r);if(c){if(o.setActiveTab(c.id),i){const l={query:i.query,messageTimestamp:i.messageTimestamp,matchedText:i.matchedText,...i.targetGroupId!==void 0?{targetGroupId:i.targetGroupId}:{},...i.targetMatchIndexInItem!==void 0?{targetMatchIndexInItem:i.targetMatchIndexInItem}:{},...i.targetMatchStartOffset!==void 0?{targetMatchStartOffset:i.targetMatchStartOffset}:{},...i.targetMessageUuid!==void 0?{targetMessageUuid:i.targetMessageUuid}:{}},d=KOe({...l});o.enqueueTabNavigation(c.id,d)}}else{if(o.openTab({type:"session",label:"Loading...",projectId:n,sessionId:r,fromSearch:s}),i){const p=t().activeTabId;if(p){o.setActiveTab(p);const f={query:i.query,messageTimestamp:i.messageTimestamp,matchedText:i.matchedText,...i.targetGroupId!==void 0?{targetGroupId:i.targetGroupId}:{},...i.targetMatchIndexInItem!==void 0?{targetMatchIndexInItem:i.targetMatchIndexInItem}:{},...i.targetMatchStartOffset!==void 0?{targetMatchStartOffset:i.targetMatchStartOffset}:{},...i.targetMessageUuid!==void 0?{targetMessageUuid:i.targetMessageUuid}:{}},h=KOe({...f});o.enqueueTabNavigation(p,h)}}const l=t().activeTabId??void 0;o.fetchSessionDetail(n,r,l)}}});function yp(){return{expandedAIGroupIds:new Set,expandedDisplayItemIds:new Map,expandedSubagentTraceIds:new Set,showContextPanel:!1,selectedContextPhase:null,savedScrollTop:void 0}}const qDt=(e,t)=>({tabUIStates:new Map,initTabUIState:n=>{const r=t();if(r.tabUIStates.has(n))return;const s=new Map(r.tabUIStates);s.set(n,yp()),e({tabUIStates:s})},cleanupTabUIState:n=>{const r=t();if(!r.tabUIStates.has(n))return;const s=new Map(r.tabUIStates);s.delete(n),e({tabUIStates:s})},toggleAIGroupExpansionForTab:(n,r)=>{const s=t(),i=new Map(s.tabUIStates),o=i.get(n)??yp(),a=new Set(o.expandedAIGroupIds);a.has(r)?a.delete(r):a.add(r),i.set(n,{...o,expandedAIGroupIds:a}),e({tabUIStates:i})},isAIGroupExpandedForTab:(n,r)=>t().tabUIStates.get(n)?.expandedAIGroupIds.has(r)??!1,expandAIGroupForTab:(n,r)=>{const s=t();if(s.tabUIStates.get(n)?.expandedAIGroupIds.has(r))return;const o=new Map(s.tabUIStates),a=o.get(n)??yp(),c=new Set(a.expandedAIGroupIds);c.add(r),o.set(n,{...a,expandedAIGroupIds:c}),e({tabUIStates:o})},toggleDisplayItemExpansionForTab:(n,r,s)=>{const i=t(),o=new Map(i.tabUIStates),a=o.get(n)??yp(),c=new Map(a.expandedDisplayItemIds),l=c.get(r)??new Set,d=new Set(l);d.has(s)?d.delete(s):d.add(s),c.set(r,d),o.set(n,{...a,expandedDisplayItemIds:c}),e({tabUIStates:o})},getExpandedDisplayItemIdsForTab:(n,r)=>t().tabUIStates.get(n)?.expandedDisplayItemIds.get(r)??new Set,expandDisplayItemForTab:(n,r,s)=>{const i=t();if(i.tabUIStates.get(n)?.expandedDisplayItemIds.get(r)?.has(s))return;const c=new Map(i.tabUIStates),l=c.get(n)??yp(),d=new Map(l.expandedDisplayItemIds),p=new Set(d.get(r)??new Set);p.add(s),d.set(r,p),c.set(n,{...l,expandedDisplayItemIds:d}),e({tabUIStates:c})},toggleSubagentTraceExpansionForTab:(n,r)=>{const s=t(),i=new Map(s.tabUIStates),o=i.get(n)??yp(),a=new Set(o.expandedSubagentTraceIds);a.has(r)?a.delete(r):a.add(r),i.set(n,{...o,expandedSubagentTraceIds:a}),e({tabUIStates:i})},expandSubagentTraceForTab:(n,r)=>{const s=t(),i=s.tabUIStates.get(n)??yp();if(i.expandedSubagentTraceIds.has(r))return;const o=new Set(i.expandedSubagentTraceIds);o.add(r);const a=new Map(s.tabUIStates);a.set(n,{...i,expandedSubagentTraceIds:o}),e({tabUIStates:a})},isSubagentTraceExpandedForTab:(n,r)=>t().tabUIStates.get(n)?.expandedSubagentTraceIds.has(r)??!1,setContextPanelVisibleForTab:(n,r)=>{const s=t(),i=new Map(s.tabUIStates),o=i.get(n)??yp();i.set(n,{...o,showContextPanel:r}),e({tabUIStates:i})},isContextPanelVisibleForTab:n=>t().tabUIStates.get(n)?.showContextPanel??!1,setSelectedContextPhaseForTab:(n,r)=>{const s=t(),i=new Map(s.tabUIStates),o=i.get(n)??yp();i.set(n,{...o,selectedContextPhase:r}),e({tabUIStates:i})},saveScrollPositionForTab:(n,r)=>{const s=t(),i=new Map(s.tabUIStates),o=i.get(n)??yp();i.set(n,{...o,savedScrollTop:r}),e({tabUIStates:i})},getScrollPositionForTab:n=>t().tabUIStates.get(n)?.savedScrollTop}),WDt=80;function As(e){if(typeof e.messageId=="string"&&e.messageId.trim().length>0)return e.messageId;const t=(e.text??"").slice(0,WDt);return`${e.timestamp}-${e.from}-${t}`}function GDt(e,t){const n=Date.parse(t.timestamp)-Date.parse(e.timestamp);return n!==0?n:As(e).localeCompare(As(t))}function mZ(...e){const t=new Map;for(const n of e)for(const r of n)t.set(As(r),r);return Array.from(t.values()).sort(GDt)}const HDt="OpenCode runtime delivery is still being checked. Message was saved and will be retried if needed.",ZDt="OpenCode runtime delivery failed. Message was saved to inbox, but live delivery did not complete.";function KDt(e){const t=e.runtimeDelivery;if(t?.attempted!==!0)return{warning:null,debugDetails:null};const n=t.delivered===!1,r=t.responsePending===!0;return!n&&!r?{warning:null,debugDetails:null}:{warning:n?ZDt:HDt,debugDetails:{messageId:e.messageId,providerId:t.providerId,delivered:typeof t.delivered=="boolean"?t.delivered:null,responsePending:typeof t.responsePending=="boolean"?t.responsePending:null,responseState:t.responseState??null,ledgerStatus:t.ledgerStatus??null,acceptanceUnknown:typeof t.acceptanceUnknown=="boolean"?t.acceptanceUnknown:null,reason:t.reason??null,diagnostics:t.diagnostics??[]}}}function JDt(e){return JSON.stringify({messageId:e.messageId,providerId:e.providerId,delivered:e.delivered,responsePending:e.responsePending,responseState:e.responseState,ledgerStatus:e.ledgerStatus,acceptanceUnknown:e.acceptanceUnknown,reason:e.reason,diagnostics:e.diagnostics},null,2)}const eLt=/^(?<source>[a-z0-9-]+)\/(?<model>\S.*)$/i,tLt={anthropic:"Anthropic",azure:"Azure",bedrock:"Bedrock",deepseek:"DeepSeek",gemini:"Gemini",google:"Google",groq:"Groq",minimax:"MiniMax",mistral:"Mistral",moonshot:"Moonshot",ollama:"Ollama",opencode:"OpenCode",openai:"OpenAI","openai-compatible":"OpenAI Compatible",openrouter:"OpenRouter",together:"Together",vertex:"Vertex",xai:"xAI","z-ai":"Z.AI"};function nLt(e){const t=e.trim().toLowerCase();if(!t)return e;const n=tLt[t];return n||t.split("-").filter(Boolean).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")}function PL(e){const t=e?.trim();if(!t)return null;const n=eLt.exec(t);return!n?.groups?.source||!n.groups.model?null:{raw:t,sourceId:n.groups.source.toLowerCase(),modelId:n.groups.model}}function rLt(e){const t=PL(e);return t?nLt(t.sourceId):null}function Ww(e){return e==="anthropic"||e==="codex"||e==="gemini"||e==="opencode"}function xa(e){return Ww(e)?e:void 0}function Eg(e){const t=e?.trim().toLowerCase();if(!t)return;const n=t.replace(/(?:\[1m\])+$/,"");if(t.startsWith("opencode/")||n.startsWith("opencode/"))return"opencode";if(t.startsWith("gpt-")||t.startsWith("codex")||n.startsWith("gpt-")||n.startsWith("codex"))return"codex";if(t.startsWith("gemini")||n.startsWith("gemini"))return"gemini";if(t.startsWith("claude")||n.startsWith("claude")||t==="opus"||n==="opus"||t==="sonnet"||n==="sonnet"||t==="haiku"||n==="haiku")return"anthropic";if(PL(t)||PL(n))return"opencode"}function oge(e){const t=e?.trim();if(t)return t.replace(/(?:\[1m\])+$/,"")||void 0}function Rse(e,t){const n=e?.trim();return n?(t??Eg(n)??Eg(oge(n)))!=="anthropic"?n:oge(n):void 0}const age=Hi("Renderer:unwrapIpc");class Ch extends Error{constructor(t,n,r){super(n),this.operation=t,this.causeError=r,this.name="IpcError"}}const sLt=["TEAM_PROVISIONING","TEAM_DRAFT"];async function nr(e,t){try{return await t()}catch(n){const r=n instanceof Error?n.message:String(n);throw sLt.some(s=>r.includes(s))?age.debug(`[${e}] ${r}`):age.error(`[${e}] ${r}`),new Ch(e,r,n)}}const j0={autoAllowAll:!1,autoAllowFileEdits:!1,autoAllowSafeBash:!1,timeoutAction:"wait",timeoutSeconds:30},iLt=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function oLt(e){return iLt.test(e.trim())}function to(e){const t=e.trim();return t&&(oLt(t)?t.slice(0,8).toLowerCase():t)}function Jg(e){return e.displayId?.trim()||to(e.id)}function Gr(e){return`#${Jg(e)}`}function Gw(e,t){if(!t)return!1;const n=t.trim();return n?e.id===n||Jg(e)===n:!1}const sz="team-lead",lXe="lead",aLt="负责人",lLt=new Set([sz,lXe]),cLt=new Set([sz,lXe,"orchestrator"]),uLt=new Set(["lead"]);function Pse(e){return e?.trim().toLowerCase()??""}function e_(e){return lLt.has(Pse(e))}function dLt(e){return cLt.has(Pse(e))}function pLt(e){return uLt.has(Pse(e))}function Yn(e){const t=typeof e.role=="string"?e.role:null;if(pLt(t))return!0;const n=typeof e.agentType=="string"?e.agentType:null;if(dLt(n))return!0;const r=typeof e.name=="string"?e.name:null;return e_(r)}function FQ(e){const t=e.agentId?.trim();return t||e.name.trim()}const fLt=[[],[{ringIndex:0,sectorIndex:0}],[{ringIndex:0,sectorIndex:0},{ringIndex:0,sectorIndex:1}],[{ringIndex:0,sectorIndex:0},{ringIndex:0,sectorIndex:1},{ringIndex:0,sectorIndex:2}],[{ringIndex:0,sectorIndex:0},{ringIndex:0,sectorIndex:1},{ringIndex:0,sectorIndex:2},{ringIndex:0,sectorIndex:3}]];function cXe(e,t=[]){const n=e.filter(a=>!a.removedAt&&!Yn(a));if(n.length===0)return[];const r=new Map(n.map(a=>[FQ(a),a])),s=[],i=new Set;for(const a of t){if(a.removedAt||Yn(a))continue;const c=FQ(a);!r.has(c)||i.has(c)||(s.push(c),i.add(c))}const o=n.map(a=>FQ(a)).filter(a=>!i.has(a)).toSorted((a,c)=>a.localeCompare(c));return s.push(...o),s}function YQ(e,t=[]){const n=cXe(e,t),r=n.length>0?n.join("|"):null,s=fLt[n.length],i={};return s?.length===n.length&&n.forEach((o,a)=>{i[o]=s[a]}),{orderedVisibleOwnerIds:n,signature:r,assignments:i}}const ru="stable-slots-v1",Cp=Hi("teamSlice"),uXe=3e4,lge=3e4,hLt=5e3,mLt=4e3,OLt=2e3,X0=new Map,fT=new Map,$L=new Set,Hx=new Map,Zx=new Map,d0=new Map,OZ=new Set,Hw=new Map,gZ=new Set,rC=new Map,U0=new Map,NL=new Map,dXe=new Map;let N1=null,xY=!1;const VQ=new Map,_Z=new Map,bZ=new Map;function SY(e){return X0.has(e)||(fT.get(e)?.size??0)>0||$L.has(e)}function cge(e){return NL.get(e)}function gLt(e){return(U0.get(e)?.size??0)>0}function _Lt(){return new Set(Array.from(U0.entries()).filter(([,e])=>e.size>0).map(([e])=>e))}function bLt(e){vZ.delete(e),TZ.delete(e);const t=`${e}:`;for(const n of ML.keys())n.startsWith(t)&&ML.delete(n);for(const n of QL.keys())n.startsWith(t)&&QL.delete(n)}function A1(e){X0.delete(e),fT.delete(e),$L.delete(e),Hx.delete(e),Zx.delete(e),d0.delete(e),OZ.delete(e),Hw.delete(e),gZ.delete(e),NL.delete(e),VQ.delete(e),_Z.delete(e),bZ.delete(e),bLt(e)}function uge(e,t){const n=e.teamMessagesByName[t],r=n&&(n.loadingHead||n.loadingOlder)?{...e.teamMessagesByName,[t]:{...n,loadingHead:!1,loadingOlder:!1}}:null,s=e.selectedTeamName===t&&(e.selectedTeamLoading||e.selectedTeamError!=null);return{...r?{teamMessagesByName:r}:{},...s?{selectedTeamLoading:!1,selectedTeamError:null}:{}}}function pa(e,t){if(!(t in e))return null;const n={...e};return delete n[t],n}function vY(e,t){const n=Object.fromEntries(Object.entries(e.provisioningRuns).filter(([,x])=>x.teamName!==t)),r=pa(e.teamDataCacheByName,t),s=pa(e.teamAgentRuntimeByTeam,t),i=pa(e.teamMessagesByName,t),o=pa(e.memberActivityMetaByTeam,t),a=pa(e.provisioningSnapshotByTeam,t),c=pa(e.currentProvisioningRunIdByTeam,t),l=pa(e.currentRuntimeRunIdByTeam,t),d=pa(e.provisioningStartedAtFloorByTeam,t),p=pa(e.leadActivityByTeam,t),f=pa(e.leadContextByTeam,t),h=pa(e.activeToolsByTeam,t),m=pa(e.finishedVisibleByTeam,t),O=pa(e.toolHistoryByTeam,t),_=pa(e.memberSpawnStatusesByTeam,t),b=pa(e.memberSpawnSnapshotsByTeam,t),y=pa(e.provisioningErrorByTeam,t);return{...Object.keys(n).length!==Object.keys(e.provisioningRuns).length?{provisioningRuns:n}:{},...r?{teamDataCacheByName:r}:{},...s?{teamAgentRuntimeByTeam:s}:{},...i?{teamMessagesByName:i}:{},...o?{memberActivityMetaByTeam:o}:{},...a?{provisioningSnapshotByTeam:a}:{},...c?{currentProvisioningRunIdByTeam:c}:{},...l?{currentRuntimeRunIdByTeam:l}:{},...d?{provisioningStartedAtFloorByTeam:d}:{},...p?{leadActivityByTeam:p}:{},...f?{leadContextByTeam:f}:{},...h?{activeToolsByTeam:h}:{},...m?{finishedVisibleByTeam:m}:{},...O?{toolHistoryByTeam:O}:{},..._?{memberSpawnStatusesByTeam:_}:{},...b?{memberSpawnSnapshotsByTeam:b}:{},...y?{provisioningErrorByTeam:y}:{}}}function dge(e,t,n){const r={...e.ignoredProvisioningRunIds},s={...e.ignoredRuntimeRunIds},i=e.currentProvisioningRunIdByTeam[t],o=e.currentRuntimeRunIdByTeam[t];return i&&(r[i]=t),o&&(s[o]=t),{ignoredProvisioningRunIds:r,ignoredRuntimeRunIds:s,provisioningStartedAtFloorByTeam:{...e.provisioningStartedAtFloorByTeam,[t]:n}}}function Sh(e){return dXe.get(e)??0}function pc(e,t){return Sh(e)===t}function I1(e){dXe.set(e,Sh(e)+1)}function yLt(e){const t=Symbol(e),n=fT.get(e);return n?(n.add(t),t):(fT.set(e,new Set([t])),t)}function xLt(e,t){const n=fT.get(e);n&&(n.delete(t),n.size===0&&fT.delete(e))}function M1(){return new Date().toISOString()}function SLt(e){return new Promise(t=>setTimeout(t,e))}function pge(e){if(e==null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function yZ(e,t){if(Object.is(e,t))return e;if(Array.isArray(e)&&Array.isArray(t)){let n=e.length!==t.length;const r=t.map((s,i)=>{const o=yZ(e[i],s);return Object.is(o,e[i])||(n=!0),o});return n?r:e}if(pge(e)&&pge(t)){const n=e,r=t,s=Object.keys(n),i=Object.keys(r);let o=s.length!==i.length;const a={};for(const c of i){Object.prototype.hasOwnProperty.call(n,c)||(o=!0);const l=yZ(n[c],r[c]);Object.is(l,n[c])||(o=!0),a[c]=l}return o?a:e}return t}function fge(e,t){return e?yZ(e,t):t}const vLt=new Set(["validating","spawning","configuring","assembling","finalizing","verifying"]),AL=new Set(["ready","failed","disconnected","cancelled"]);function hge(e){return e.startsWith("pending:")}function TLt(e){return(e instanceof Error?e.message:String(e)).includes("Unknown runId")}function IL(e,t,n){let r;const s=new Promise((i,o)=>{r=setTimeout(()=>{o(new Error(`Timeout after ${t}ms: ${n}`))},t)});return Promise.race([e,s]).finally(()=>{r&&clearTimeout(r)})}function mge(e){const t=X0.get(e);if(t)return t;const n=IL(nr("team:getData",()=>K.teams.getData(e)),uXe,`team:getData(${e})`).finally(()=>{X0.get(e)===n&&X0.delete(e)});return X0.set(e,n),n}function ELt(e){return IL(nr("team:getData",()=>K.teams.getData(e)),uXe,`team:getData(${e})`)}function wLt(e){const t=Date.now(),n=_Z.get(e)??{windowStartedAt:t,count:0,lastWarnAt:0};return t-n.windowStartedAt>mLt&&(n.windowStartedAt=t,n.count=0),n.count+=1,_Z.set(e,n),n.count}function kLt(e,t){return e===t?!0:!e||!t?e===t:e.confirmedCount===t.confirmedCount&&e.pendingCount===t.pendingCount&&e.failedCount===t.failedCount&&e.skippedCount===t.skippedCount&&e.runtimeAlivePendingCount===t.runtimeAlivePendingCount&&e.shellOnlyPendingCount===t.shellOnlyPendingCount&&e.runtimeProcessPendingCount===t.runtimeProcessPendingCount&&e.runtimeCandidatePendingCount===t.runtimeCandidatePendingCount&&e.noRuntimePendingCount===t.noRuntimePendingCount&&e.permissionPendingCount===t.permissionPendingCount}function CLt(e,t){if(e===t)return!0;if(!e||!t)return e===t;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function RLt(e,t){if(e===t)return!0;if(!e||!t)return e===t;const n=[...e.pendingPermissionRequestIds??[]].sort(),r=[...t.pendingPermissionRequestIds??[]].sort();return e.status===t.status&&e.launchState===t.launchState&&e.error===t.error&&e.hardFailureReason===t.hardFailureReason&&e.skippedForLaunch===t.skippedForLaunch&&e.skipReason===t.skipReason&&e.skippedAt===t.skippedAt&&e.livenessSource===t.livenessSource&&e.runtimeAlive===t.runtimeAlive&&e.runtimeModel===t.runtimeModel&&e.livenessKind===t.livenessKind&&e.runtimeDiagnostic===t.runtimeDiagnostic&&e.runtimeDiagnosticSeverity===t.runtimeDiagnosticSeverity&&e.bootstrapConfirmed===t.bootstrapConfirmed&&e.hardFailure===t.hardFailure&&n.length===r.length&&n.every((s,i)=>s===r[i])}function PLt(e,t){if(e===t)return!0;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const s of n)if(!(s in t)||!RLt(e[s],t[s]))return!1;return!0}function $Lt(e,t){return e?e.runId===t.runId&&e.teamLaunchState===t.teamLaunchState&&e.launchPhase===t.launchPhase&&e.source===t.source&&CLt(e.expectedMembers,t.expectedMembers)&&kLt(e.summary,t.summary)&&PLt(e.statuses,t.statuses):!1}function NLt(e){return e.teamLaunchState==="clean_success"&&e.launchPhase==="finished"&&(e.summary?.confirmedCount??0)>0&&(e.summary?.pendingCount??0)===0&&(e.summary?.failedCount??0)===0&&(e.summary?.skippedCount??0)===0}function ALt(e,t){const n=Date.now(),r=bZ.get(e)??0;n-r<OLt||(bZ.set(e,n),Cp.debug(`[perf] member-spawn snapshot suppressed team=${e} runId=${t??"none"} reason=member-spawn-ui-equal`))}function ILt(e,t){if(e===t)return!0;if(!e||!t)return e===t;const n=e.diagnostics??[],r=t.diagnostics??[];return e.memberName===t.memberName&&e.alive===t.alive&&e.restartable===t.restartable&&e.backendType===t.backendType&&e.providerId===t.providerId&&e.providerBackendId===t.providerBackendId&&e.laneId===t.laneId&&e.laneKind===t.laneKind&&e.pid===t.pid&&e.runtimeModel===t.runtimeModel&&e.rssBytes===t.rssBytes&&e.livenessKind===t.livenessKind&&e.pidSource===t.pidSource&&e.processCommand===t.processCommand&&e.paneId===t.paneId&&e.panePid===t.panePid&&e.paneCurrentCommand===t.paneCurrentCommand&&e.runtimePid===t.runtimePid&&e.runtimeSessionId===t.runtimeSessionId&&e.runtimeDiagnostic===t.runtimeDiagnostic&&e.runtimeDiagnosticSeverity===t.runtimeDiagnosticSeverity&&e.runtimeLastSeenAt===t.runtimeLastSeenAt&&e.historicalBootstrapConfirmed===t.historicalBootstrapConfirmed&&n.length===r.length&&n.every((s,i)=>s===r[i])}function MLt(e,t){if(!e||e.teamName!==t.teamName||e.runId!==t.runId)return!1;const n=Object.keys(e.members),r=Object.keys(t.members);if(n.length!==r.length)return!1;for(const s of n)if(!(s in t.members)||!ILt(e.members[s],t.members[s]))return!1;return!0}function QLt(e,t){const n=Date.parse(e.timestamp),r=Date.parse(t.timestamp),s=Number.isFinite(n),i=Number.isFinite(r);if(s&&i&&n!==r)return n-r;if(s!==i)return s?-1:1;const o=typeof e.messageId=="string"?e.messageId:"",a=typeof t.messageId=="string"?t.messageId:"";return o.localeCompare(a)}const DLt={canonicalMessages:[],optimisticMessages:[],feedRevision:null,nextCursor:null,hasMore:!1,lastFetchedAt:null,loadingHead:!1,loadingOlder:!1,headHydrated:!1,olderHydrated:!1};function Yo(e,t){return e.teamMessagesByName[t]??DLt}function LLt(e,t){const n=[...e.optimisticMessages],r=typeof t.messageId=="string"?t.messageId.trim():"";if(r.length>0){const s=n.findIndex(i=>typeof i.messageId=="string"&&i.messageId.trim()===r);s>=0?n[s]={...n[s],...t}:n.push(t)}else n.push(t);return n.sort(QLt),{...e,optimisticMessages:n}}function jLt(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1){const r=e[n],s=t[n];if(r.messageId!==s.messageId||r.timestamp!==s.timestamp||r.from!==s.from||r.to!==s.to||r.text!==s.text||r.summary!==s.summary||r.read!==s.read||r.actionMode!==s.actionMode||r.commentId!==s.commentId||r.relayOfMessageId!==s.relayOfMessageId||r.source!==s.source||r.leadSessionId!==s.leadSessionId||r.messageKind!==s.messageKind||JSON.stringify(r.taskRefs??null)!==JSON.stringify(s.taskRefs??null))return!1}return!0}function XLt(e,t){if(e.length===0)return[];const n=new Set(t.map(r=>typeof r.messageId=="string"?r.messageId.trim():"").filter(r=>r.length>0));return e.filter(r=>{const s=typeof r.messageId=="string"?r.messageId.trim():"";return!s||!n.has(s)})}function yx(e){const t=rC.get(e);t!=null&&(clearTimeout(t),rC.delete(e))}function Q1(e){U0.delete(e)}function ULt(e,t,n){if(n){const s=U0.get(e)??new Set;return s.add(t),U0.set(e,s),!0}const r=U0.get(e);return r?(r.delete(t),r.size===0?(U0.delete(e),!1):!0):!1}function zLt(e,t){return t<=0?[]:e.slice(0,t)}function BLt(e,t){if(e.length===0)return[];if(t.length===0)return null;const n=new Set(t.map(o=>As(o)));let r=!1;for(const o of e)if(!n.has(As(o))){r=!0;break}if(!r)return[];const s=As(t[t.length-1]),i=e.findIndex(o=>As(o)===s);return i<0?null:e.slice(i+1).filter(o=>!n.has(As(o)))}async function mI(e,t,n){const r=e();if(r.selectedTeamName!==t||!r.selectedTeamData)return;const s=r.selectedTeamData.tasks.find(a=>a.id===n);if(!s)return;const i=Fc(s);if(!Ore(i)||typeof r.invalidateTaskChangePresence!="function"||typeof r.checkTaskHasChanges!="function")return;const o=Ed(t,n,i);r.invalidateTaskChangePresence([o]);try{await r.checkTaskHasChanges(t,n,i)}catch{}}async function Oge(e,t,n){let s=500;for(let i=1;i<=60;i++){const o=e(),a=o.provisioningRuns[t];if(a&&AL.has(a.state))return;try{const c=await o.getProvisioningStatus(t);if(AL.has(c.state))return}catch(c){if(TLt(c)){o.clearMissingProvisioningRun(t);return}}await SLt(s),s=Math.min(1500,Math.round(s*1.5))}}const qQ=new Set,CS=new Set,xZ=new Set,SZ=new Set,Zw=new Set;let gge=!0;function FLt(e,t,n){for(const r of t){const s=`${r.teamName}:${r.id}`;r.needsClarification==="user"?e.find(o=>o.teamName===r.teamName&&o.id===r.id)?.needsClarification!=="user"&&!qQ.has(s)&&(qQ.add(s),YLt(r,!n)):qQ.delete(s)}}function YLt(e,t){const n=e.comments?.length?e.comments[e.comments.length-1]:void 0,r=n?.text||e.description||`${Gr(e)}: ${e.subject}`,s=Ea(r).trim();K.teams?.showMessageNotification({teamName:e.teamName,teamDisplayName:e.teamDisplayName,from:n?.author||"lead",to:"user",summary:`Clarification needed — Task ${Gr(e)}`,body:s,teamEventType:"task_clarification",dedupeKey:`clarification:${e.teamName}:${e.id}:${e.updatedAt??Date.now()}`,suppressToast:t}).catch(()=>{})}function VLt(e,t,n,r){const s=!!n?.notifications?.notifyOnStatusChange&&!!n.notifications.enabled,i=n?.notifications?.statusChangeStatuses??["in_progress","completed"];if(i.length===0)return;const o=n?.notifications?.statusChangeOnlySolo??!0;for(const a of t){const c=e.find(y=>y.teamName===a.teamName&&y.id===a.id);if(!c)continue;const l=Vg(a),d=Vg(c),p=l==="approved"&&d!=="approved",f=l==="review"&&d!=="review",h=a.reviewState==="needsFix"&&c.reviewState!=="needsFix";if(!(c.status!==a.status)&&!p&&!f&&!h)continue;if(o){const y=r[a.teamName];if(y&&y.memberCount>0)continue}const O=p?"approved":f?"review":h?"needsFix":a.status;if(!i.includes(O))continue;const _=`${a.teamName}:${a.id}:${O}`;if(CS.has(_))continue;CS.add(_);const b=p||f?"Completed":c.status;qLt(a,b,p?"approved":f?"review":h?"needsFix":void 0,!s)}}function qLt(e,t,n,r){const s={pending:"Pending",in_progress:"In Progress",completed:"Completed",deleted:"Deleted",review:"Review",needsFix:"Needs Fixes",approved:"Approved"},i=s[t]??t,o=n??e.status,a=s[o]??o;K.teams?.showMessageNotification({teamName:e.teamName,teamDisplayName:e.teamDisplayName,from:e.owner??"system",to:"user",summary:`Task ${Gr(e)}: ${i} → ${a}`,body:e.subject,teamEventType:"task_status_change",dedupeKey:`status:${e.teamName}:${e.id}:${t}:${o}:${e.updatedAt??Date.now()}`,suppressToast:r}).catch(()=>{})}function WLt(e,t,n){const r=new Map(e.map(s=>[`${s.teamName}:${s.id}`,s]));for(const s of t){const i=`${s.teamName}:${s.id}`,a=r.get(i)?.comments?.length??0;if((s.comments?.length??0)<=a)continue;const l=(s.comments??[]).slice(a);for(const d of l){if(d.author==="user"||d.type==="review_request"||d.type==="review_approved")continue;const p=`${s.teamName}:${s.id}:${d.id}`;xZ.has(p)||(xZ.add(p),GLt(s,d,!n))}}}function GLt(e,t,n){if(t.author==="user")return;const r=Ea(t.text).trim(),s=r.length>100?r.slice(0,100)+"...":r;K.teams?.showMessageNotification({teamName:e.teamName,teamDisplayName:e.teamDisplayName,from:t.author,to:"user",summary:`Comment on ${Gr(e)}: ${e.subject}`,body:s,teamEventType:"task_comment",dedupeKey:`comment:${e.teamName}:${e.id}:${t.id}`,suppressToast:n}).catch(()=>{})}function HLt(e,t,n){const r=new Set(e.map(s=>`${s.teamName}:${s.id}`));for(const s of t){const i=`${s.teamName}:${s.id}`;r.has(i)||SZ.has(i)||(SZ.add(i),ZLt(s,!n))}}function ZLt(e,t){K.teams?.showMessageNotification({teamName:e.teamName,teamDisplayName:e.teamDisplayName,from:e.owner??"system",to:"user",summary:`New task ${Gr(e)}: ${e.subject}`,body:Ea(e.description||e.subject).trim(),teamEventType:"task_created",dedupeKey:`created:${e.teamName}:${e.id}`,suppressToast:t}).catch(()=>{})}function KLt(e,t,n){const r=new Map;for(const s of t){const i=r.get(s.teamName)??[];i.push(s),r.set(s.teamName,i)}for(const[s,i]of r){if(i.length===0)continue;if(!i.every(l=>l.status==="completed"||l.status==="deleted")){Zw.delete(s);continue}if(Zw.has(s))continue;const a=e.filter(l=>l.teamName===s);if(a.length>0&&a.every(l=>l.status==="completed"||l.status==="deleted")){Zw.add(s);continue}Zw.add(s),JLt(i[0],i.length,!n)}}function JLt(e,t,n){K.teams?.showMessageNotification({teamName:e.teamName,teamDisplayName:e.teamDisplayName,from:"system",to:"user",summary:`All ${t} tasks completed`,body:`All tasks in team "${e.teamDisplayName}" are done`,teamEventType:"all_tasks_completed",dedupeKey:`all-done:${e.teamName}:${Date.now()}`,suppressToast:n}).catch(()=>{})}function _ge(e,t,n){const r=new Set(n.map(o=>Ed(e,o.id,Fc(o)))),s=[],i=new Set;for(const o of t){const a=Ed(e,o.id,Fc(o));r.has(a)||(s.push(a),i.add(o.id))}return{cacheKeys:s,taskIds:[...i]}}function bge(e,t,n){if(!Array.isArray(t)||t.length===0||n.length===0)return n;const r=new Map(t.map(o=>[o.id,o]));let s=!1;const i=n.map(o=>{if(o.changePresence&&o.changePresence!=="unknown")return o;const a=r.get(o.id);if(!a?.changePresence||a.changePresence==="unknown")return o;const c=Ed(e,a.id,Fc(a)),l=Ed(e,o.id,Fc(o));return c!==l?o:(s=!0,{...o,changePresence:a.changePresence})});return s?i:n}function yge(e){const t=e instanceof Ch||e instanceof Error?e.message:"";return t.includes("Failed to verify inbox write")?"Message was written but not verified (race). Please try again.":t||"Failed to send message"}function xge(e){const t=e instanceof Ch||e instanceof Error?e.message:"";return t.includes("Task status update verification failed")?"Failed to update task status (possible agent conflict).":t||"Failed to perform review action"}const vZ=new Map,ML=new Map,TZ=new Map,e5t=[],t5t=[],QL=new Map;function n5t(e,t){if(t?.latestAuthoredMessageSignalsTermination)return"terminated";if(!t?.lastAuthoredMessageAt)return e.currentTaskId?"active":"idle";const n=Date.now()-Date.parse(t.lastAuthoredMessageAt);return Number.isNaN(n)?"unknown":n<5*60*1e3?"active":"idle"}function r5t(e,t){return e.map(n=>pXe(n,t?.members[n.name]))}function pXe(e,t){return{...e,status:n5t(e,t),messageCount:t?.messageCountExact??0,lastActiveAt:t?.lastAuthoredMessageAt??null}}function s5t(e,t){return e?e.memberName===t.memberName&&e.lastAuthoredMessageAt===t.lastAuthoredMessageAt&&e.messageCountExact===t.messageCountExact&&e.latestAuthoredMessageSignalsTermination===t.latestAuthoredMessageSignalsTermination:!1}function i5t(e,t){if(!e)return t;const n=Object.keys(t),r=Object.keys(e);let s=n.length!==r.length;const i={};for(const o of n){const a=t[o],c=e[o];if(!s5t(c,a)){s=!0,i[o]=a;continue}i[o]=c}return s?i:e}function wi(e,t){return t?e.teamDataCacheByName[t]??(e.selectedTeamName===t?e.selectedTeamData:null):null}function Sl(e,t){const n=wi(e,t);if(!n||!t)return[];const r=e.memberActivityMetaByTeam[t],s=r?.members,i=vZ.get(t);if(i?.snapshotRef===n.members&&i.metaMembersRef===s)return i.result;const o=r5t(n.members,r);return vZ.set(t,{snapshotRef:n.members,metaMembersRef:s,result:o}),o}function fXe(e,t,n){const r=wi(e,t);if(!r||!t||!n)return null;const s=r.members.find(l=>l.name===n);if(!s)return null;const i=e.memberActivityMetaByTeam[t]?.members[n],o=`${t}:${n}`,a=ML.get(o);if(a?.snapshotMemberRef===s&&a.metaEntryRef===i)return a.result;const c=pXe(s,i);return ML.set(o,{snapshotMemberRef:s,metaEntryRef:i,result:c}),c}function $se(e,t){return wi(e,t)?.members??e5t}function o5t(e,t){return wi(e,t)?.tasks??t5t}function a5t(e,t){return wi(e,t)?.isAlive}function iz(e,t){if(!t)return[];const n=Yo(e,t),r=TZ.get(t);if(r?.canonicalRef===n.canonicalMessages&&r.optimisticRef===n.optimisticMessages)return r.result;const s=mZ(n.canonicalMessages,n.optimisticMessages);return TZ.set(t,{canonicalRef:n.canonicalMessages,optimisticRef:n.optimisticMessages,result:s}),s}function hXe(e,t,n){if(!t||!n)return[];const r=iz(e,t),s=`${t}:${n}`,i=QL.get(s);if(i?.messagesRef===r)return i.result;const o=r.filter(a=>a.from===n||a.to===n);return QL.set(s,{messagesRef:r,result:o}),o}function Sge(e,t){const n=e.memberActivityMetaByTeam[t],r=Yo(e,t).feedRevision;return n?r?n.feedRevision!==r:!1:!0}function OI(e,t){const n=Object.entries(e??{}),r=Object.entries(t??{});if(n.length!==r.length)return!1;for(const[s,i]of n){const o=t?.[s];if(o?.ringIndex!==i.ringIndex||o.sectorIndex!==i.sectorIndex)return!1}return!0}function l5t(e,t){if(t.length===0||!e)return{};const n={};for(const r of t){const s=e[r];s&&(n[r]=s)}return n}function c5t(e,t){const n=l5t(e,t);return Object.keys(n).length>0?n:void 0}function u5t(e,t){const n=new Set(t),r=[],s=new Set;for(const i of e??[])!n.has(i)||s.has(i)||(r.push(i),s.add(i));for(const i of t)s.has(i)||(r.push(i),s.add(i));return r}function vge(e,t){return t?e.paneLayout.panes.some(n=>{if(!n.activeTabId)return!1;const r=n.tabs.find(s=>s.id===n.activeTabId);return(r?.type==="team"||r?.type==="graph")&&r.teamName===t}):!1}function d5t(e,t){return t==="TEAM_DRAFT"||t.includes("TEAM_DRAFT")||t===`Team not found: ${e}`||t==="Team config not found"}const EZ="team:launchParams:";function wf(e,t){const n=e.currentProvisioningRunIdByTeam[t];return n?e.provisioningRuns[n]??null:null}function My(e,t){const n=wf(e,t);return n!=null&&vLt.has(n.state)}function p5t(){const e={};try{const t=localStorage;if(!t)return e;for(let n=0;n<t.length;n++){const r=t.key(n);if(r?.startsWith(EZ)){const s=r.slice(EZ.length),i=JSON.parse(t.getItem(r));i&&typeof i=="object"&&(e[s]=i)}}}catch{}return e}function Tge(e,t){try{localStorage?.setItem?.(EZ+e,JSON.stringify(t))}catch{}}function Ege(e,t){return Rse(e,t)}const mXe="team:toolApprovalSettings:";function OXe(e){if(!e)return j0;try{const t=JSON.parse(e),n=j0;return{autoAllowAll:typeof t.autoAllowAll=="boolean"?t.autoAllowAll:n.autoAllowAll,autoAllowFileEdits:typeof t.autoAllowFileEdits=="boolean"?t.autoAllowFileEdits:n.autoAllowFileEdits,autoAllowSafeBash:typeof t.autoAllowSafeBash=="boolean"?t.autoAllowSafeBash:n.autoAllowSafeBash,timeoutAction:typeof t.timeoutAction=="string"&&["allow","deny","wait"].includes(t.timeoutAction)?t.timeoutAction:n.timeoutAction,timeoutSeconds:typeof t.timeoutSeconds=="number"&&Number.isFinite(t.timeoutSeconds)&&t.timeoutSeconds>=5&&t.timeoutSeconds<=300?t.timeoutSeconds:n.timeoutSeconds}}catch{return j0}}function f5t(e){return OXe(localStorage?.getItem?.(mXe+e)??null)}function TY(e,t){try{localStorage?.setItem?.(mXe+e,JSON.stringify(t))}catch{}}function h5t(){return OXe(localStorage?.getItem?.("team:toolApprovalSettings")??null)}const m5t=(e,t)=>({teams:[],teamByName:{},teamBySessionId:{},branchByPath:{},teamsLoading:!1,teamsError:null,globalTasks:[],globalTasksLoading:!1,globalTasksInitialized:!1,globalTasksError:null,selectedTeamName:null,selectedTeamData:null,teamDataCacheByName:{},slotLayoutVersion:ru,graphLayoutModeByTeam:{},gridOwnerOrderByTeam:{},slotAssignmentsByTeam:{},teamMessagesByName:{},memberActivityMetaByTeam:{},graphLayoutSessionByTeam:{},selectedTeamLoading:!1,selectedTeamLoadNonce:0,selectedTeamError:null,sendingMessage:!1,sendMessageError:null,sendMessageWarning:null,sendMessageDebugDetails:null,lastSendMessageResult:null,crossTeamTargets:[],crossTeamTargetsLoading:!1,reviewActionError:null,provisioningRuns:{},provisioningSnapshotByTeam:{},currentProvisioningRunIdByTeam:{},currentRuntimeRunIdByTeam:{},ignoredProvisioningRunIds:{},ignoredRuntimeRunIds:{},provisioningStartedAtFloorByTeam:{},leadActivityByTeam:{},leadContextByTeam:{},activeToolsByTeam:{},finishedVisibleByTeam:{},toolHistoryByTeam:{},memberSpawnStatusesByTeam:{},memberSpawnSnapshotsByTeam:{},teamAgentRuntimeByTeam:{},provisioningErrorByTeam:{},clearProvisioningError:n=>e(r=>{if(!n)return{provisioningErrorByTeam:{}};if(!(n in r.provisioningErrorByTeam))return{};const s={...r.provisioningErrorByTeam};return delete s[n],{provisioningErrorByTeam:s}}),launchParamsByTeam:p5t(),fetchMemberSpawnStatuses:async n=>{if(!(!K.teams?.getMemberSpawnStatuses||(VQ.get(n)??0)>Date.now()))try{const s=await K.teams.getMemberSpawnStatuses(n);VQ.delete(n),e(i=>{const o=NLt(s);if(s.runId!=null&&i.ignoredRuntimeRunIds[s.runId]===n&&!o)return{};if(i.currentRuntimeRunIdByTeam[n]==null&&i.leadActivityByTeam[n]==="offline"&&s.runId!=null&&!o)return{};if(s.runId!=null&&i.currentRuntimeRunIdByTeam[n]!=null&&i.currentRuntimeRunIdByTeam[n]!==s.runId&&!o)return{};const a=s.runId==null||i.currentRuntimeRunIdByTeam[n]!=null?i.currentRuntimeRunIdByTeam:{...i.currentRuntimeRunIdByTeam,[n]:s.runId},c=i.memberSpawnSnapshotsByTeam[n];return $Lt(c,s)?(ALt(n,s.runId),a===i.currentRuntimeRunIdByTeam?{}:{currentRuntimeRunIdByTeam:a}):{currentRuntimeRunIdByTeam:a,memberSpawnStatusesByTeam:{...i.memberSpawnStatusesByTeam,[n]:s.statuses},memberSpawnSnapshotsByTeam:{...i.memberSpawnSnapshotsByTeam,[n]:s}}})}catch(s){(s instanceof Error?s.message:String(s)).includes("No handler registered for 'team:memberSpawnStatuses'")&&VQ.set(n,Date.now()+hLt)}},fetchTeamAgentRuntime:async n=>{if(K.teams?.getTeamAgentRuntime)try{const r=await K.teams.getTeamAgentRuntime(n);e(s=>{if(r.runId!=null&&s.ignoredRuntimeRunIds[r.runId]===n)return{};if(r.runId!=null&&s.currentRuntimeRunIdByTeam[n]!=null&&s.currentRuntimeRunIdByTeam[n]!==r.runId)return{};const i=s.teamAgentRuntimeByTeam[n];return MLt(i,r)?{}:{teamAgentRuntimeByTeam:{...s.teamAgentRuntimeByTeam,[n]:r}}})}catch{}},kanbanFilterQuery:null,globalTaskDetail:null,pendingMemberProfile:null,openMemberProfile:n=>e({pendingMemberProfile:n}),closeMemberProfile:()=>e({pendingMemberProfile:null}),pendingReviewRequest:null,setPendingReviewRequest:n=>e({pendingReviewRequest:n}),openGlobalTaskDetail:(n,r)=>{e({globalTaskDetail:{teamName:n,taskId:r}})},closeGlobalTaskDetail:()=>e({globalTaskDetail:null}),addingComment:!1,addCommentError:null,provisioningProgressUnsubscribe:null,deletedTasks:[],deletedTasksLoading:!1,pendingApprovals:[],resolvedApprovals:new Map,toolApprovalSettings:h5t(),messagesPanelMode:"sidebar",messagesPanelWidth:340,sidebarLogsHeight:213,setMessagesPanelMode:n=>e({messagesPanelMode:n}),setMessagesPanelWidth:n=>e({messagesPanelWidth:n}),setSidebarLogsHeight:n=>e({sidebarLogsHeight:n}),fetchBranches:async n=>{const r=await Promise.all(n.map(async i=>{try{const o=await K.teams.getProjectBranch(i);return[fr(i),o]}catch{return[fr(i),null]}})),s=Object.fromEntries(r);Object.keys(s).length>0&&e(i=>{let o=!1;for(const[a,c]of Object.entries(s))if(i.branchByPath[a]!==c){o=!0;break}return o?{branchByPath:{...i.branchByPath,...s}}:{}})},fetchTeams:async()=>{if(t().teamsLoading)return;const n=t().teams.length===0;n&&e({teamsLoading:!0,teamsError:null});try{const r=await IL(nr("team:list",()=>K.teams.list()),lge,"fetchTeams"),s={},i={};for(const o of r)if(s[o.teamName]=o,o.leadSessionId&&(i[o.leadSessionId]=o),Array.isArray(o.sessionHistory))for(const a of o.sessionHistory)typeof a=="string"&&a&&(i[a]=o);e(o=>{const a={...o.provisioningSnapshotByTeam};for(const c of r)delete a[c.teamName];return{teams:r,teamByName:s,teamBySessionId:i,teamsLoading:!1,teamsError:null,provisioningSnapshotByTeam:a}})}catch(r){e({teamsLoading:!1,teamsError:n?r instanceof Ch||r instanceof Error?r.message:"Failed to fetch teams":null})}},fetchAllTasks:async()=>{if(N1){xY=!0,await N1;return}const r=(async()=>{do{xY=!1;const s=!t().globalTasksInitialized;s&&e({globalTasksLoading:!0,globalTasksError:null});const i=t().globalTasks,o=gge;gge=!1;try{const a=await IL(nr("team:getAllTasks",()=>K.teams.getAllTasks()),lge,"fetchAllTasks");if(o){for(const l of a){l.needsClarification==="user"&&qQ.add(`${l.teamName}:${l.id}`),CS.add(`${l.teamName}:${l.id}:${l.status}`),l.reviewState==="needsFix"&&CS.add(`${l.teamName}:${l.id}:needsFix`),Vg(l)==="approved"&&CS.add(`${l.teamName}:${l.id}:approved`),Vg(l)==="review"&&CS.add(`${l.teamName}:${l.id}:review`);for(const d of l.comments??[])xZ.add(`${l.teamName}:${l.id}:${d.id}`);SZ.add(`${l.teamName}:${l.id}`)}const c=new Map;for(const l of a){const d=c.get(l.teamName)??[];d.push(l),c.set(l.teamName,d)}for(const[l,d]of c)d.every(p=>p.status==="completed"||p.status==="deleted")&&Zw.add(l)}else{const c=t().appConfig?.notifications?.notifyOnClarifications??!0;FLt(i,a,c),VLt(i,a,t().appConfig,t().teamByName);const l=t().appConfig?.notifications?.notifyOnTaskComments??!0;WLt(i,a,l);const d=t().appConfig?.notifications?.notifyOnTaskCreated??!0;HLt(i,a,d);const p=t().appConfig?.notifications?.notifyOnAllTasksCompleted??!0;KLt(i,a,p)}e({globalTasks:a,globalTasksLoading:!1,globalTasksInitialized:!0,globalTasksError:null})}catch(a){e({globalTasksLoading:!1,globalTasksInitialized:!0,globalTasksError:s?a instanceof Ch||a instanceof Error?a.message:"Failed to fetch tasks":null})}}while(xY)})().finally(()=>{N1===r&&(N1=null)});N1=r,await r},openTeamsTab:()=>{const n=t(),s=n.paneLayout.panes.find(i=>i.id===n.paneLayout.focusedPaneId)?.tabs.find(i=>i.type==="teams");if(s){n.setActiveTab(s.id);return}n.openTab({type:"teams",label:"团队"})},openTeamTab:(n,r,s)=>{if(!n.trim())return;if(r){const p=t(),f=fr(r),h=p.projects.find(m=>fr(m.path)===f);h&&p.selectedProjectId!==h.id&&p.selectProject(h.id)}const i=t(),o=i.teamByName[n],a=i.selectedTeamName===n?i.selectedTeamData?.config.name:void 0,c=o?.displayName||a||n,d=i.getAllPaneTabs().find(p=>p.type==="team"&&p.teamName===n);d?(i.setActiveTab(d.id),d.label!==c&&i.updateTabLabel(d.id,c)):i.openTab({type:"team",label:c,teamName:n})},clearKanbanFilter:()=>{e({kanbanFilterQuery:null})},ensureTeamGraphSlotAssignments:(n,r,s=[])=>{e(i=>{const o={};let a=!1,c=i.slotAssignmentsByTeam,l=i.graphLayoutSessionByTeam;i.slotLayoutVersion!==ru&&(o.slotLayoutVersion=ru,c={},l={},a=!0);const d=YQ(r,s),p=c5t(c[n],d.orderedVisibleOwnerIds),f=l[n];return f?.mode==="manual"?OI(c[n],p)||(c={...c},p?c[n]=p:delete c[n],a=!0):((!OI(c[n],p)||!OI(p,d.assignments))&&(c={...c},Object.keys(d.assignments).length===0?delete c[n]:c[n]=d.assignments,a=!0),(f?.mode!=="default"||f?.signature!==d.signature)&&(l={...l,[n]:{mode:"default",signature:d.signature}},a=!0)),a?(o.slotAssignmentsByTeam=c,o.graphLayoutSessionByTeam=l,o):{}})},setTeamGraphOwnerSlotAssignment:(n,r,s)=>{e(i=>{const o=i.slotAssignmentsByTeam[n]??{},a=o[r],c=Object.entries(o).find(([l,d])=>l!==r&&d.ringIndex===s.ringIndex&&d.sectorIndex===s.sectorIndex);return a?.ringIndex===s.ringIndex&&a?.sectorIndex===s.sectorIndex&&i.slotLayoutVersion===ru?{}:c?(Cp.warn(`[graph-layout] refusing occupied slot assignment team=${n} owner=${r} target=${s.ringIndex}:${s.sectorIndex} occupiedBy=${c[0]}`),{}):{slotLayoutVersion:ru,slotAssignmentsByTeam:{...i.slotAssignmentsByTeam,[n]:{...o,[r]:s}},graphLayoutSessionByTeam:{...i.graphLayoutSessionByTeam,[n]:{mode:"manual",signature:i.graphLayoutSessionByTeam[n]?.signature??null}}}})},commitTeamGraphOwnerSlotDrop:(n,r,s,i,o)=>{e(a=>{const c=a.slotAssignmentsByTeam[n]??{},l=c[r],d={...c,[r]:s};if(l?.ringIndex===s.ringIndex&&l?.sectorIndex===s.sectorIndex&&!i&&a.slotLayoutVersion===ru)return{};i&&o&&(d[i]=o);const p=Object.entries(d).find(([f,h])=>f===r||f===i?!1:h.ringIndex===s.ringIndex&&h.sectorIndex===s.sectorIndex||h.ringIndex===o?.ringIndex&&h.sectorIndex===o.sectorIndex);return p?(Cp.warn(`[graph-layout] refusing slot drop team=${n} owner=${r} target=${s.ringIndex}:${s.sectorIndex} conflict=${p[0]}`),{}):{slotLayoutVersion:ru,slotAssignmentsByTeam:{...a.slotAssignmentsByTeam,[n]:d},graphLayoutSessionByTeam:{...a.graphLayoutSessionByTeam,[n]:{mode:"manual",signature:a.graphLayoutSessionByTeam[n]?.signature??null}}}})},setTeamGraphLayoutMode:(n,r)=>{e(s=>(s.graphLayoutModeByTeam[n]??"radial")===r?{}:{graphLayoutModeByTeam:{...s.graphLayoutModeByTeam,[n]:r}})},swapTeamGraphGridOwners:(n,r,s)=>{r!==s&&e(i=>{const o=wi(i,n),a=[...i.gridOwnerOrderByTeam[n]??[]];for(const h of[r,s])a.includes(h)||a.push(h);const c=o?YQ(o.members,o.config.members??[]).orderedVisibleOwnerIds:a,l=u5t(i.gridOwnerOrderByTeam[n],c),d=l.indexOf(r),p=l.indexOf(s);if(d<0||p<0)return{};const f=[...l];return f[d]=s,f[p]=r,{gridOwnerOrderByTeam:{...i.gridOwnerOrderByTeam,[n]:f}}})},swapTeamGraphOwnerSlots:(n,r,s)=>{r!==s&&e(i=>{const o=i.slotAssignmentsByTeam[n]??{},a=o[r],c=o[s];return!a||!c?{}:{slotLayoutVersion:ru,slotAssignmentsByTeam:{...i.slotAssignmentsByTeam,[n]:{...o,[r]:c,[s]:a}},graphLayoutSessionByTeam:{...i.graphLayoutSessionByTeam,[n]:{mode:"manual",signature:i.graphLayoutSessionByTeam[n]?.signature??null}}}})},clearTeamGraphSlotAssignments:n=>{e(r=>{if(!n)return Object.keys(r.slotAssignmentsByTeam).length===0&&r.slotLayoutVersion===ru&&Object.keys(r.graphLayoutSessionByTeam).length===0?{}:{slotLayoutVersion:ru,slotAssignmentsByTeam:{},graphLayoutSessionByTeam:{}};if(!(n in r.slotAssignmentsByTeam)&&!(n in r.graphLayoutSessionByTeam))return{};const s={...r.slotAssignmentsByTeam},i={...r.graphLayoutSessionByTeam};return delete s[n],delete i[n],{slotLayoutVersion:ru,slotAssignmentsByTeam:s,graphLayoutSessionByTeam:i}})},resetTeamGraphSlotAssignmentsToDefaults:n=>{e(r=>{const s=wi(r,n),i=s?YQ(s.members,s.config.members??[]):{signature:null,assignments:{}},o=r.slotAssignmentsByTeam[n],a=r.graphLayoutSessionByTeam[n];if(OI(o,i.assignments)&&a?.mode==="default"&&a.signature===i.signature)return{};const c={...r.slotAssignmentsByTeam};return Object.keys(i.assignments).length===0?delete c[n]:c[n]=i.assignments,{slotLayoutVersion:ru,slotAssignmentsByTeam:c,graphLayoutSessionByTeam:{...r.graphLayoutSessionByTeam,[n]:{mode:"default",signature:i.signature}}}})},setSelectedTeamTaskChangePresence:(n,r,s)=>{e(i=>{const o=wi(i,n);let a=!1;const c=o?{...o,tasks:o.tasks.map(p=>p.id!==r||p.changePresence===s?p:(a=!0,{...p,changePresence:s}))}:null;let l=!1;const d=i.globalTasks.map(p=>p.teamName!==n||p.id!==r||p.changePresence===s?p:(l=!0,{...p,changePresence:s}));return!a&&!l?{}:{...a&&c?{teamDataCacheByName:{...i.teamDataCacheByName,[n]:c}}:{},...a&&i.selectedTeamName===n&&c?{selectedTeamData:c}:{},...l?{globalTasks:d}:{}}})},refreshTeamChangePresence:async n=>{if(wi(t(),n))try{const s=await nr("team:getTaskChangePresence",()=>K.teams.getTaskChangePresence(n));e(i=>{const o=wi(i,n);if(!o)return{};let a=!1;const c=o.tasks.map(d=>{const p=s[d.id]??"unknown";return d.changePresence===p?d:(a=!0,{...d,changePresence:p})});if(!a)return{};const l={...o,tasks:c};return{teamDataCacheByName:{...i.teamDataCacheByName,[n]:l},...i.selectedTeamName===n?{selectedTeamData:l}:{}}})}catch{}},selectTeam:async(n,r)=>{const s=Sh(n),i=r?.allowReloadWhileProvisioning===!0;if(t().selectedTeamLoading&&t().selectedTeamName===n&&!i)return;const o=t().selectedTeamLoadNonce+1,a=wi(t(),n);e({selectedTeamName:n,selectedTeamData:a,selectedTeamLoading:!0,selectedTeamLoadNonce:o,selectedTeamError:null,reviewActionError:null,toolApprovalSettings:f5t(n)});try{const c=await mge(n);if(!pc(n,s)||t().selectedTeamName!==n||t().selectedTeamLoadNonce!==o)return;const l=t().teamByName,d=l[n],p=c.config.color;if(p&&(!d||d?.color!==p)){const S=d?{...d,color:p,displayName:c.config.name||n}:{teamName:n,displayName:c.config.name||n,description:c.config.description??"",color:p,memberCount:c.members.length,taskCount:0,lastActivity:null};e({teamByName:{...l,[n]:S}})}const f=a?{...c,tasks:bge(n,a.tasks,c.tasks)}:c,h=fge(a,f);e(S=>{const v=S.teamDataCacheByName[n]===h?S.teamDataCacheByName:{...S.teamDataCacheByName,[n]:h};return{selectedTeamName:n,selectedTeamData:h,teamDataCacheByName:v,selectedTeamLoading:!1,selectedTeamError:null}}),NL.set(n,Date.now());const m=a?_ge(n,a.tasks,c.tasks):{cacheKeys:[],taskIds:[]};m.cacheKeys.length>0&&t().invalidateTaskChangePresence(m.cacheKeys),m.taskIds.length>0&&await K.review.invalidateTaskChangeSummaries(n,m.taskIds);const O=c.config.name||n,b=t().getAllPaneTabs().filter(S=>(S.type==="team"||S.type==="graph")&&S.teamName===n);for(const S of b){const v=S.type==="graph"?`${O} Graph`:O;S.label!==v&&t().updateTabLabel(S.id,v)}if(((await t().refreshTeamMessagesHead(n)).feedChanged||Sge(t(),n))&&await t().refreshMemberActivityMeta(n),r?.skipProjectAutoSelect)return;const x=c.config.projectPath;if(x){const S=t(),v=fr(x),T=S.projects.find(E=>fr(E.path)===v);if(T&&S.selectedProjectId!==T.id)S.selectProject(T.id);else if(!T)for(const E of S.repositoryGroups){const w=E.worktrees.find(P=>fr(P.path)===v);if(w){S.selectedWorktreeId!==w.id&&(e(kU(E.id,w.id)),t().fetchSessionsInitial(w.id));break}}}}catch(c){if(!pc(n,s))return;const l=t();if(l.selectedTeamName!==n||l.selectedTeamLoadNonce!==o)return;const d=My(l,n),p=c instanceof Error?c.message:String(c);if(p==="TEAM_PROVISIONING"||p.includes("TEAM_PROVISIONING")&&d){e({selectedTeamLoading:!0,selectedTeamData:null,selectedTeamError:null});return}if(p==="TEAM_DRAFT"||p.includes("TEAM_DRAFT")){e({selectedTeamLoading:!1,selectedTeamData:null,selectedTeamError:"TEAM_DRAFT"});return}const f=c instanceof Ch||c instanceof Error?c.message:"Failed to fetch team data";e({selectedTeamLoading:!1,selectedTeamData:null,selectedTeamError:f})}},refreshTeamData:async(n,r)=>{const s=Sh(n),i=yLt(n),o=r?.withDedup===!0&&X0.has(n);wLt(n),o&&$L.add(n);try{const a=wi(t(),n),c=r?.withDedup?await mge(n):await ELt(n);if(!pc(n,s))return;const l=a?{...c,tasks:bge(n,a.tasks,c.tasks)}:c,d=fge(a,l);e(f=>{const h=f.teamDataCacheByName[n]===d?f.teamDataCacheByName:{...f.teamDataCacheByName,[n]:d},m=f.selectedTeamName===n?{selectedTeamData:d,selectedTeamError:null}:{};return h===f.teamDataCacheByName&&(f.selectedTeamName!==n||f.selectedTeamData===d&&f.selectedTeamError==null)?{}:{teamDataCacheByName:h,...m}}),NL.set(n,Date.now());const p=a?_ge(n,a.tasks,c.tasks):{cacheKeys:[],taskIds:[]};p.cacheKeys.length>0&&t().invalidateTaskChangePresence(p.cacheKeys),p.taskIds.length>0&&await K.review.invalidateTaskChangeSummaries(n,p.taskIds)}catch(a){if(!pc(n,s))return;const c=a instanceof Ch||a instanceof Error?a.message:"Failed to refresh team data";if(c==="TEAM_PROVISIONING"||c.includes("TEAM_PROVISIONING")){Cp.debug(`refreshTeamData(${n}) skipped: team is still provisioning`),t().selectedTeamName===n&&e({selectedTeamError:null});return}if(d5t(n,c)){e(l=>{const d=l.teamDataCacheByName[n]?{...l.teamDataCacheByName}:null;return d&&delete d[n],l.selectedTeamName!==n&&!d?{}:{...d?{teamDataCacheByName:d}:{},...l.selectedTeamName===n?{selectedTeamLoading:!1,selectedTeamData:null,selectedTeamError:c==="TEAM_DRAFT"||c.includes("TEAM_DRAFT")?"TEAM_DRAFT":c}:{}}});return}if(t().selectedTeamName!==n)return;if(Cp.warn(`refreshTeamData(${n}) failed: ${c}`),t().selectedTeamData){Cp.debug(`refreshTeamData(${n}) preserving existing data after transient error`),e({selectedTeamError:null});return}e({selectedTeamError:c})}finally{xLt(n,i),o&&$L.delete(n)&&t().refreshTeamData(n)}},refreshTeamMessagesHead:async n=>{const r=Hx.get(n);if(r)return OZ.add(n),r;const s=d0.get(n);if(s)return s;const i=Zx.get(n);if(i){const c=Sh(n),l=i.then(()=>{if(!pc(n,c))return{feedChanged:!1,headChanged:!1,feedRevision:null};if(d0.get(n)===l)d0.delete(n);else return{feedChanged:!1,headChanged:!1,feedRevision:null};return t().refreshTeamMessagesHead(n)}).finally(()=>{d0.get(n)===l&&d0.delete(n)});return d0.set(n,l),l}const o={current:null};o.current=(async()=>{const c=Sh(n);e(l=>({teamMessagesByName:{...l.teamMessagesByName,[n]:{...Yo(l,n),loadingHead:!0}}}));try{const l=await nr("team:getMessagesPage",()=>K.teams.getMessagesPage(n,{limit:50}));if(!pc(n,c))return{feedChanged:!1,headChanged:!1,feedRevision:null};const d=Yo(t(),n),p=!d.headHydrated||d.feedRevision!==l.feedRevision,f=zLt(d.canonicalMessages,l.messages.length),h=!jLt(f,l.messages);return e(m=>{const O=Yo(m,n),_=BLt(O.canonicalMessages,l.messages),b=O.olderHydrated&&Array.isArray(_)&&_.length>0,y=h?b?mZ(_,l.messages):l.messages:O.canonicalMessages,x=XLt(O.optimisticMessages,y),S={...O,canonicalMessages:y,optimisticMessages:x,feedRevision:l.feedRevision,nextCursor:b?O.nextCursor:l.nextCursor,hasMore:b?O.hasMore:l.hasMore,lastFetchedAt:Date.now(),loadingHead:!1,headHydrated:!0,olderHydrated:b?O.olderHydrated:!1};return{teamMessagesByName:{...m.teamMessagesByName,[n]:S}}}),{feedChanged:p,headChanged:h,feedRevision:l.feedRevision}}catch(l){if(!pc(n,c))return{feedChanged:!1,headChanged:!1,feedRevision:null};throw e(d=>({teamMessagesByName:{...d.teamMessagesByName,[n]:{...Yo(d,n),loadingHead:!1}}})),l}finally{Hx.get(n)===o.current&&(Hx.delete(n),OZ.delete(n)&&t().refreshTeamMessagesHead(n))}})();const a=o.current;return Hx.set(n,a),a},loadOlderTeamMessages:async n=>{const r=Sh(n),s=Zx.get(n);if(s)return s;const i=Hx.get(n);if(i&&(await i,!pc(n,r)))return;let o=Yo(t(),n);if(!o.headHydrated){if(await t().refreshTeamMessagesHead(n),!pc(n,r))return;o=Yo(t(),n)}if(!o.headHydrated||!o.nextCursor||o.loadingOlder||o.loadingHead)return;const a={current:null};a.current=(async()=>{const l=Sh(n);e(d=>({teamMessagesByName:{...d.teamMessagesByName,[n]:{...Yo(d,n),loadingOlder:!0}}}));try{const d=o.feedRevision,p=await nr("team:getMessagesPage",()=>K.teams.getMessagesPage(n,{cursor:o.nextCursor,limit:50}));if(!pc(n,l))return;const f=Yo(t(),n);if(f.feedRevision!==d){e(h=>({teamMessagesByName:{...h.teamMessagesByName,[n]:{...Yo(h,n),loadingOlder:!1}}})),await t().refreshTeamMessagesHead(n);return}if(f.feedRevision&&f.feedRevision!==p.feedRevision){e(h=>({teamMessagesByName:{...h.teamMessagesByName,[n]:{...Yo(h,n),loadingOlder:!1}}})),await t().refreshTeamMessagesHead(n);return}e(h=>{const m=Yo(h,n),O=mZ(m.canonicalMessages,p.messages);return{teamMessagesByName:{...h.teamMessagesByName,[n]:{...m,canonicalMessages:O,nextCursor:p.nextCursor,hasMore:p.hasMore,feedRevision:p.feedRevision,loadingOlder:!1,olderHydrated:!0}}}})}catch{if(!pc(n,l))return;e(d=>({teamMessagesByName:{...d.teamMessagesByName,[n]:{...Yo(d,n),loadingOlder:!1}}}))}finally{Zx.get(n)===a.current&&Zx.delete(n)}})();const c=a.current;return Zx.set(n,c),c},refreshMemberActivityMeta:async n=>{if(!Yo(t(),n).headHydrated)return;const s=Hw.get(n);if(s)return gZ.add(n),s;const i={current:null};i.current=(async()=>{const a=Sh(n);try{const c=await nr("team:getMemberActivityMeta",()=>K.teams.getMemberActivityMeta(n));if(!pc(n,a))return;e(l=>{const d=Yo(l,n).feedRevision;if(d&&c.feedRevision!==d)return{};const p=l.memberActivityMetaByTeam[n];if(p?.feedRevision===c.feedRevision)return{};const f=i5t(p?.members,c.members),h=p?.members===f&&p.feedRevision===c.feedRevision&&p.computedAt===c.computedAt?p:{...c,members:f};return{memberActivityMetaByTeam:{...l.memberActivityMetaByTeam,[n]:h}}})}catch(c){if(!pc(n,a))return;throw c}finally{Hw.get(n)===i.current&&(Hw.delete(n),gZ.delete(n)&&t().refreshMemberActivityMeta(n))}})();const o=i.current;return Hw.set(n,o),o},syncTeamPendingReplyRefresh:(n,r,s,i=1e4)=>{if(yx(n),!ULt(n,r,s))return;const a=setTimeout(()=>{rC.get(n)===a&&(rC.delete(n),(async()=>{try{((await t().refreshTeamMessagesHead(n)).feedChanged||Sge(t(),n))&&await t().refreshMemberActivityMeta(n)}catch{}})())},i);rC.set(n,a)},updateKanban:async(n,r,s)=>{try{e({reviewActionError:null}),await nr("team:updateKanban",()=>K.teams.updateKanban(n,r,s)),await t().refreshTeamData(n)}catch(i){throw e({reviewActionError:xge(i)}),i}},updateKanbanColumnOrder:async(n,r,s)=>{await nr("team:updateKanbanColumnOrder",()=>K.teams.updateKanbanColumnOrder(n,r,s)),await t().refreshTeamData(n)},sendTeamMessage:async(n,r)=>{e({sendingMessage:!0,sendMessageError:null,sendMessageWarning:null,sendMessageDebugDetails:null,lastSendMessageResult:null});try{const s=await nr("team:sendMessage",()=>K.teams.sendMessage(n,r)),i=s.runtimeDelivery?.attempted===!0&&s.runtimeDelivery.delivered===!1,o=KDt(s),a={from:r.from??"user",to:r.to??r.member,text:r.text,timestamp:r.timestamp??M1(),read:!0,taskRefs:r.taskRefs?.length?r.taskRefs:void 0,actionMode:r.actionMode,summary:r.summary,color:r.color,messageId:s.messageId,relayOfMessageId:r.relayOfMessageId,source:r.source??"user_sent",attachments:r.attachments?.length?r.attachments:void 0,leadSessionId:r.leadSessionId,conversationId:r.conversationId,replyToConversationId:r.replyToConversationId,toolSummary:r.toolSummary,toolCalls:r.toolCalls,messageKind:r.messageKind,slashCommand:r.slashCommand,commandOutput:r.commandOutput};return e(c=>({sendingMessage:!1,sendMessageError:null,sendMessageWarning:o.warning,sendMessageDebugDetails:o.debugDetails,lastSendMessageResult:i?null:s,teamMessagesByName:{...c.teamMessagesByName,[n]:LLt(Yo(c,n),a)}})),await t().refreshTeamMessagesHead(n),s}catch(s){throw e({sendingMessage:!1,lastSendMessageResult:null,sendMessageWarning:null,sendMessageDebugDetails:null,sendMessageError:yge(s)}),s}},fetchCrossTeamTargets:async()=>{e({crossTeamTargetsLoading:!0});try{const n=await K.crossTeam.listTargets();e({crossTeamTargets:n,crossTeamTargetsLoading:!1})}catch(n){Cp.error("fetchCrossTeamTargets failed",n),e({crossTeamTargets:[],crossTeamTargetsLoading:!1})}},sendCrossTeamMessage:async n=>{e({sendingMessage:!0,sendMessageError:null,sendMessageWarning:null,sendMessageDebugDetails:null,lastSendMessageResult:null});try{const r=await K.crossTeam.send(n);e({sendingMessage:!1,sendMessageError:null,sendMessageWarning:null,sendMessageDebugDetails:null,lastSendMessageResult:{messageId:r.messageId,deliveredToInbox:r.deliveredToInbox,deduplicated:r.deduplicated}}),await t().refreshTeamMessagesHead(n.fromTeam)}catch(r){e({sendingMessage:!1,lastSendMessageResult:null,sendMessageWarning:null,sendMessageDebugDetails:null,sendMessageError:yge(r)})}},requestReview:async(n,r)=>{try{e({reviewActionError:null}),await nr("team:requestReview",()=>K.teams.requestReview(n,r)),await t().refreshTeamData(n),mI(t,n,r)}catch(s){throw e({reviewActionError:xge(s)}),s}},createTeamTask:async(n,r)=>{const s=await nr("team:createTask",()=>K.teams.createTask(n,r));return await t().refreshTeamData(n),s},startTask:async(n,r)=>{const s=await nr("team:startTask",()=>K.teams.startTask(n,r));return await t().refreshTeamData(n),mI(t,n,r),s},startTaskByUser:async(n,r)=>{const s=await nr("team:startTaskByUser",()=>K.teams.startTaskByUser(n,r));return await t().refreshTeamData(n),mI(t,n,r),s},updateTaskStatus:async(n,r,s)=>{await nr("team:updateTaskStatus",()=>K.teams.updateTaskStatus(n,r,s)),await t().refreshTeamData(n),mI(t,n,r)},updateTaskOwner:async(n,r,s)=>{await nr("team:updateTaskOwner",()=>K.teams.updateTaskOwner(n,r,s)),await t().refreshTeamData(n)},updateTaskFields:async(n,r,s)=>{await nr("team:updateTaskFields",()=>K.teams.updateTaskFields(n,r,s)),await t().refreshTeamData(n)},addTaskRelationship:async(n,r,s,i)=>{await nr("team:addTaskRelationship",()=>K.teams.addTaskRelationship(n,r,s,i)),await t().refreshTeamData(n)},removeTaskRelationship:async(n,r,s,i)=>{await nr("team:removeTaskRelationship",()=>K.teams.removeTaskRelationship(n,r,s,i)),await t().refreshTeamData(n)},setTaskNeedsClarification:async(n,r,s)=>{await nr("team:setTaskClarification",()=>K.teams.setTaskClarification(n,r,s)),await t().refreshTeamData(n),await t().fetchAllTasks()},saveTaskAttachment:async(n,r,s)=>{const i=crypto.randomUUID();await nr("team:saveTaskAttachment",()=>K.teams.saveTaskAttachment(n,r,i,s.name,s.type,s.base64)),await t().refreshTeamData(n)},deleteTaskAttachment:async(n,r,s,i)=>{await nr("team:deleteTaskAttachment",()=>K.teams.deleteTaskAttachment(n,r,s,i)),await t().refreshTeamData(n)},getTaskAttachmentData:async(n,r,s,i)=>nr("team:getTaskAttachment",()=>K.teams.getTaskAttachment(n,r,s,i)),addTaskComment:async(n,r,s)=>{e({addingComment:!0,addCommentError:null});try{const i=await nr("team:addTaskComment",()=>K.teams.addTaskComment(n,r,s));return e({addingComment:!1}),await t().refreshTeamData(n),i}catch(i){const o=i instanceof Error?i.message:"Failed to add comment";throw e({addingComment:!1,addCommentError:o}),i}},addMember:async(n,r)=>{await nr("team:addMember",()=>K.teams.addMember(n,r)),await Promise.allSettled([t().refreshTeamData(n),t().fetchMemberSpawnStatuses(n),t().fetchTeamAgentRuntime(n)])},restartMember:async(n,r)=>{try{await nr("team:restartMember",()=>K.teams.restartMember(n,r))}finally{await Promise.allSettled([t().fetchMemberSpawnStatuses(n),t().fetchTeamAgentRuntime(n)])}},skipMemberForLaunch:async(n,r)=>{try{await nr("team:skipMemberForLaunch",()=>K.teams.skipMemberForLaunch(n,r))}finally{await Promise.allSettled([t().fetchMemberSpawnStatuses(n),t().fetchTeamAgentRuntime(n),t().fetchTeams()])}},removeMember:async(n,r)=>{await nr("team:removeMember",()=>K.teams.removeMember(n,r)),await t().refreshTeamData(n)},updateMemberRole:async(n,r,s)=>{await nr("team:updateMemberRole",()=>K.teams.updateMemberRole(n,r,s)),await t().refreshTeamData(n)},softDeleteTask:async(n,r)=>{await nr("team:softDeleteTask",()=>K.teams.softDeleteTask(n,r)),e(s=>{const i=a=>({...a,tasks:a.tasks.filter(c=>c.id!==r),kanbanState:{...a.kanbanState,tasks:Object.fromEntries(Object.entries(a.kanbanState.tasks).filter(([c])=>c!==r))}}),o=s.teamDataCacheByName[n];return{...o?{teamDataCacheByName:{...s.teamDataCacheByName,[n]:i(o)}}:{},...s.selectedTeamName===n&&s.selectedTeamData?{selectedTeamData:i(s.selectedTeamData)}:{},globalTasks:s.globalTasks.filter(a=>!(a.teamName===n&&a.id===r))}}),await t().refreshTeamData(n),await t().fetchDeletedTasks(n)},restoreTask:async(n,r)=>{await nr("team:restoreTask",()=>K.teams.restoreTask(n,r)),await t().refreshTeamData(n),await t().fetchDeletedTasks(n)},fetchDeletedTasks:async n=>{e({deletedTasksLoading:!0});try{const r=await nr("team:getDeletedTasks",()=>K.teams.getDeletedTasks(n));e({deletedTasks:r,deletedTasksLoading:!1})}catch(r){Cp.error("Failed to fetch deleted tasks:",r),e({deletedTasks:[],deletedTasksLoading:!1})}},deleteTeam:async n=>{const r=await nr("team:deleteTeam",()=>K.teams.deleteTeam(n));return I1(n),yx(n),Q1(n),A1(n),e(s=>({...vY(s,n),teams:s.teams.filter(i=>i.teamName!==n),selectedTeamName:s.selectedTeamName===n?null:s.selectedTeamName,selectedTeamData:s.selectedTeamName===n?null:s.selectedTeamData,selectedTeamError:s.selectedTeamName===n?null:s.selectedTeamError,selectedTeamLoading:s.selectedTeamName===n?!1:s.selectedTeamLoading})),await t().fetchTeams(),await t().fetchAllTasks(),r},restoreTeam:async n=>{await nr("team:restoreTeam",()=>K.teams.restoreTeam(n)),I1(n),yx(n),Q1(n),A1(n),e(r=>{const s=vY(r,n),i=dge(r,n,M1());return Object.keys(s).length===0?i:{...s,...i}}),await t().fetchTeams(),await t().fetchAllTasks()},permanentlyDeleteTeam:async n=>{await nr("team:permanentlyDeleteTeam",()=>K.teams.permanentlyDeleteTeam(n)),I1(n),yx(n),Q1(n),A1(n);const r=t(),s=vY(r,n),i=dge(r,n,M1());r.selectedTeamName===n?e({selectedTeamName:null,selectedTeamData:null,selectedTeamError:null,...s,...i}):Object.keys(s).length>0?e({...s,...i}):e(i),await t().fetchTeams(),await t().fetchAllTasks()},createTeam:async n=>{t().subscribeProvisioningProgress(),I1(n.teamName),yx(n.teamName),Q1(n.teamName),A1(n.teamName);const r=M1();e(o=>({provisioningStartedAtFloorByTeam:{...o.provisioningStartedAtFloorByTeam,[n.teamName]:r}})),e(o=>{const a={...o.provisioningRuns};for(const[x,S]of Object.entries(a))S.teamName===n.teamName&&delete a[x];const c={...o.provisioningErrorByTeam};delete c[n.teamName];const l={...o.memberSpawnStatusesByTeam};delete l[n.teamName];const d={...o.memberSpawnSnapshotsByTeam};delete d[n.teamName];const p={...o.teamAgentRuntimeByTeam};delete p[n.teamName];const f={...o.activeToolsByTeam};delete f[n.teamName];const h={...o.finishedVisibleByTeam};delete h[n.teamName];const m={...o.toolHistoryByTeam};delete m[n.teamName];const O={...o.currentRuntimeRunIdByTeam},_=O[n.teamName];delete O[n.teamName];const b=_?{...o.ignoredRuntimeRunIds,[_]:n.teamName}:o.ignoredRuntimeRunIds,y=uge(o,n.teamName);return{provisioningRuns:a,provisioningErrorByTeam:c,memberSpawnStatusesByTeam:l,memberSpawnSnapshotsByTeam:d,teamAgentRuntimeByTeam:p,activeToolsByTeam:f,finishedVisibleByTeam:h,toolHistoryByTeam:m,currentRuntimeRunIdByTeam:O,ignoredProvisioningRunIds:o.ignoredProvisioningRunIds,ignoredRuntimeRunIds:b,...y}});const s=`pending:${n.teamName}:${Date.now()}`;e(o=>({provisioningRuns:{...o.provisioningRuns,[s]:{runId:s,teamName:n.teamName,state:"spawning",message:"正在启动 Claude CLI 进程...",startedAt:r,updatedAt:r}},currentProvisioningRunIdByTeam:{...o.currentProvisioningRunIdByTeam,[n.teamName]:s},provisioningSnapshotByTeam:{...o.provisioningSnapshotByTeam,[n.teamName]:{teamName:n.teamName,displayName:n.displayName||n.teamName,description:n.description||"",color:n.color,memberCount:n.members.length,members:n.members.map(a=>({name:a.name,role:a.role})),taskCount:0,lastActivity:null,projectPath:n.cwd||void 0}}}));const i=n.skipPermissions===!1?j0:{...j0,autoAllowAll:!0};TY(n.teamName,i),e({toolApprovalSettings:i});try{if(typeof K.teams.createTeam!="function")throw new Error("Current preload version does not support team:create. Restart the dev app.");const o=await nr("team:create",()=>K.teams.createTeam(n)),a=Ege(n.model,n.providerId),c={providerId:n.providerId??"anthropic",providerBackendId:n.providerBackendId,model:a||"default",effort:n.effort,fastMode:n.fastMode,limitContext:n.limitContext??!1};Tge(n.teamName,c),e(l=>({launchParamsByTeam:{...l.launchParamsByTeam,[n.teamName]:c}})),e(l=>{const d={...l.provisioningRuns},p=d[s],f=o.runId in d;return p&&(delete d[s],f||(d[o.runId]={...p,runId:o.runId})),{provisioningRuns:d,currentProvisioningRunIdByTeam:{...l.currentProvisioningRunIdByTeam,[n.teamName]:o.runId},currentRuntimeRunIdByTeam:{...l.currentRuntimeRunIdByTeam,[n.teamName]:o.runId}}});try{await t().getProvisioningStatus(o.runId)}catch{}return t().fetchTeams(),t().selectedTeamName===n.teamName&&t().selectTeam(n.teamName,{allowReloadWhileProvisioning:!0}),window.setTimeout(()=>{t().fetchTeams(),t().selectedTeamName===n.teamName&&t().selectTeam(n.teamName,{allowReloadWhileProvisioning:!0})},1200),Oge(t,o.runId),o.runId}catch(o){const a=o instanceof Ch||o instanceof Error?o.message:"Failed to create team";throw e(c=>{const l={...c.provisioningRuns};delete l[s];const d={...c.currentProvisioningRunIdByTeam};return d[n.teamName]===s&&delete d[n.teamName],{provisioningRuns:l,currentProvisioningRunIdByTeam:d,provisioningErrorByTeam:{...c.provisioningErrorByTeam,[n.teamName]:a}}}),o}},launchTeam:async n=>{t().subscribeProvisioningProgress(),I1(n.teamName),yx(n.teamName),Q1(n.teamName),A1(n.teamName);const r=M1();e(i=>({provisioningStartedAtFloorByTeam:{...i.provisioningStartedAtFloorByTeam,[n.teamName]:r}})),e(i=>{const o={...i.provisioningRuns};for(const[y,x]of Object.entries(o))x.teamName===n.teamName&&delete o[y];const a={...i.provisioningErrorByTeam};delete a[n.teamName];const c={...i.memberSpawnStatusesByTeam};delete c[n.teamName];const l={...i.memberSpawnSnapshotsByTeam};delete l[n.teamName];const d={...i.teamAgentRuntimeByTeam};delete d[n.teamName];const p={...i.activeToolsByTeam};delete p[n.teamName];const f={...i.finishedVisibleByTeam};delete f[n.teamName];const h={...i.toolHistoryByTeam};delete h[n.teamName];const m={...i.currentRuntimeRunIdByTeam},O=m[n.teamName];delete m[n.teamName];const _=O?{...i.ignoredRuntimeRunIds,[O]:n.teamName}:i.ignoredRuntimeRunIds,b=uge(i,n.teamName);return{provisioningRuns:o,provisioningErrorByTeam:a,memberSpawnStatusesByTeam:c,memberSpawnSnapshotsByTeam:l,teamAgentRuntimeByTeam:d,activeToolsByTeam:p,finishedVisibleByTeam:f,toolHistoryByTeam:h,currentRuntimeRunIdByTeam:m,ignoredProvisioningRunIds:i.ignoredProvisioningRunIds,ignoredRuntimeRunIds:_,...b}});const s=`pending:${n.teamName}:${Date.now()}`;e(i=>({provisioningRuns:{...i.provisioningRuns,[s]:{runId:s,teamName:n.teamName,state:"spawning",message:"正在启动 Claude CLI 进程...",startedAt:r,updatedAt:r}},currentProvisioningRunIdByTeam:{...i.currentProvisioningRunIdByTeam,[n.teamName]:s}}));{const i=n.skipPermissions===!1?j0:{...j0,autoAllowAll:!0};TY(n.teamName,i),e({toolApprovalSettings:i})}try{const i=await nr("team:launch",()=>K.teams.launchTeam(n)),o=Ege(n.model,n.providerId),a={providerId:n.providerId??"anthropic",providerBackendId:n.providerBackendId,model:o||"default",effort:n.effort,fastMode:n.fastMode,limitContext:n.limitContext??!1};Tge(n.teamName,a),e(c=>({launchParamsByTeam:{...c.launchParamsByTeam,[n.teamName]:a}})),e(c=>{const l={...c.provisioningRuns},d=l[s],p=i.runId in l;return d&&(delete l[s],p||(l[i.runId]={...d,runId:i.runId})),{provisioningRuns:l,currentProvisioningRunIdByTeam:{...c.currentProvisioningRunIdByTeam,[n.teamName]:i.runId},currentRuntimeRunIdByTeam:{...c.currentRuntimeRunIdByTeam,[n.teamName]:i.runId}}});try{await t().getProvisioningStatus(i.runId)}catch{}return Oge(t,i.runId),i.runId}catch(i){const o=i instanceof Ch||i instanceof Error?i.message:"Failed to launch team";throw e(a=>{const c={...a.provisioningRuns};delete c[s];const l={...a.currentProvisioningRunIdByTeam};return l[n.teamName]===s&&delete l[n.teamName],{provisioningRuns:c,currentProvisioningRunIdByTeam:l,provisioningErrorByTeam:{...a.provisioningErrorByTeam,[n.teamName]:o}}}),i}},getProvisioningStatus:async n=>{const r=await nr("team:provisioningStatus",()=>K.teams.getProvisioningStatus(n));return t().onProvisioningProgress(r),r},clearMissingProvisioningRun:n=>{e(r=>{const s=r.provisioningRuns[n];if(!s)return{};const i={...r.provisioningRuns};delete i[n];const o={...r.currentProvisioningRunIdByTeam},a=o[s.teamName]===n;a&&delete o[s.teamName];const c={...r.currentRuntimeRunIdByTeam};c[s.teamName]===n&&delete c[s.teamName];const l={...r.ignoredProvisioningRunIds,[n]:s.teamName},d=r.currentRuntimeRunIdByTeam[s.teamName]===n?{...r.ignoredRuntimeRunIds,[n]:s.teamName}:r.ignoredRuntimeRunIds,p={...r.memberSpawnStatusesByTeam},f={...r.memberSpawnSnapshotsByTeam},h={...r.teamAgentRuntimeByTeam};a&&(delete p[s.teamName],delete f[s.teamName],delete h[s.teamName]);const m={...r.activeToolsByTeam},O={...r.finishedVisibleByTeam},_={...r.toolHistoryByTeam};return a&&(delete m[s.teamName],delete O[s.teamName],delete _[s.teamName]),{provisioningRuns:i,currentProvisioningRunIdByTeam:o,currentRuntimeRunIdByTeam:c,memberSpawnStatusesByTeam:p,memberSpawnSnapshotsByTeam:f,teamAgentRuntimeByTeam:h,activeToolsByTeam:m,finishedVisibleByTeam:O,toolHistoryByTeam:_,ignoredProvisioningRunIds:l,ignoredRuntimeRunIds:d}})},cancelProvisioning:async n=>{await nr("team:cancelProvisioning",()=>K.teams.cancelProvisioning(n))},cancelCurrentProvisioning:async(n,r)=>{const s=t(),a=s.currentProvisioningRunIdByTeam[n]??s.currentRuntimeRunIdByTeam[n]??r??(Object.values(t().provisioningRuns).filter(l=>l.teamName===n&&!AL.has(l.state)).sort((l,d)=>Date.parse(d.updatedAt)-Date.parse(l.updatedAt))[0]?.runId??null);if(a){await t().cancelProvisioning(a);return}await nr("team:stop",()=>K.teams.stop(n))},onProvisioningProgress:n=>{if(t().ignoredProvisioningRunIds[n.runId]===n.teamName||t().ignoredRuntimeRunIds[n.runId]===n.teamName)return;const r=t().provisioningStartedAtFloorByTeam[n.teamName];if(r&&n.startedAt<r)return;const s=t().currentProvisioningRunIdByTeam[n.teamName],i=t().provisioningRuns[n.runId],o=n.configReady===!0&&i?.configReady!==!0;if(i?.updatedAt===n.updatedAt&&i?.state===n.state&&i?.message===n.message&&i?.error===n.error&&i?.pid===n.pid&&s===n.runId)return;e(d=>{const p={...d.provisioningRuns},f={...d.currentProvisioningRunIdByTeam},h=f[n.teamName];let m=!1;if(!h||h===n.runId?(f[n.teamName]=n.runId,m=!0):hge(h)&&!hge(n.runId)&&(delete p[h],f[n.teamName]=n.runId,m=!0),h||(m=!0),!m)return n.runId in d.provisioningRuns?(delete p[n.runId],{provisioningRuns:p}):{};p[n.runId]=n;for(const[b,y]of Object.entries(p))b!==n.runId&&y.teamName===n.teamName&&delete p[b];const O={...d.provisioningErrorByTeam};n.state==="failed"?O[n.teamName]=n.error??n.message:delete O[n.teamName];const _=n.state==="failed"||n.state==="cancelled"?(()=>{const b={...d.provisioningSnapshotByTeam};return delete b[n.teamName],b})():d.provisioningSnapshotByTeam;return{provisioningRuns:p,currentProvisioningRunIdByTeam:f,currentRuntimeRunIdByTeam:{...d.currentRuntimeRunIdByTeam,[n.teamName]:n.runId},provisioningErrorByTeam:O,provisioningSnapshotByTeam:_}});const c=t().currentProvisioningRunIdByTeam[n.teamName]===n.runId;if(c&&n.memberSpawnSnapshot){const d=n.memberSpawnSnapshot;e(p=>({currentRuntimeRunIdByTeam:d.runId==null?p.currentRuntimeRunIdByTeam:{...p.currentRuntimeRunIdByTeam,[n.teamName]:d.runId},memberSpawnStatusesByTeam:{...p.memberSpawnStatusesByTeam,[n.teamName]:d.statuses},memberSpawnSnapshotsByTeam:{...p.memberSpawnSnapshotsByTeam,[n.teamName]:d}}))}let l=!1;if(c&&o){const d=t();vge(d,n.teamName)&&(d.selectedTeamName===n.teamName&&d.selectedTeamData==null?d.selectTeam(n.teamName,{allowReloadWhileProvisioning:!0}):d.refreshTeamData(n.teamName,{withDedup:!0}),l=!0)}if(c&&AL.has(n.state)&&e(d=>{const p={...d.memberSpawnStatusesByTeam},f={...d.memberSpawnSnapshotsByTeam},h={...d.teamAgentRuntimeByTeam},m=p[n.teamName];if(!m)return n.state!=="ready"&&delete h[n.teamName],{memberSpawnStatusesByTeam:p,memberSpawnSnapshotsByTeam:f,teamAgentRuntimeByTeam:h};if(n.state==="ready")return p[n.teamName]=m,{memberSpawnStatusesByTeam:p,memberSpawnSnapshotsByTeam:f,teamAgentRuntimeByTeam:h};const O=Object.fromEntries(Object.entries(m).filter(([,_])=>_.status==="error"));return Object.keys(O).length>0?p[n.teamName]=O:(delete p[n.teamName],delete f[n.teamName]),delete h[n.teamName],{memberSpawnStatusesByTeam:p,memberSpawnSnapshotsByTeam:f,teamAgentRuntimeByTeam:h}}),c&&(n.state==="ready"||n.state==="disconnected")){if(t().fetchMemberSpawnStatuses(n.teamName),t().fetchTeams(),l)return;const d=t();if(!vge(d,n.teamName))return;d.selectedTeamName===n.teamName?d.selectTeam(n.teamName):d.refreshTeamData(n.teamName,{withDedup:!0})}},subscribeProvisioningProgress:()=>{if(t().provisioningProgressUnsubscribe||!K.teams?.onProvisioningProgress)return;const r=K.teams.onProvisioningProgress((s,i)=>{t().onProvisioningProgress(i)});e({provisioningProgressUnsubscribe:r})},updateToolApprovalSettings:async(n,r)=>{const s=r??t().selectedTeamName,o={...t().toolApprovalSettings,...n};if(e({toolApprovalSettings:o}),s)TY(s,o);else try{localStorage?.setItem?.("team:toolApprovalSettings",JSON.stringify(o))}catch{}try{await K.teams.updateToolApprovalSettings(s??"__global__",o)}catch(a){Cp.warn("Failed to sync tool approval settings to main:",a)}},respondToToolApproval:async(n,r,s,i,o)=>{try{await K.teams.respondToToolApproval(n,r,s,i,o),e(a=>{const c=new Map(a.resolvedApprovals);return c.set(s,i),{pendingApprovals:a.pendingApprovals.filter(l=>!(l.runId===r&&l.requestId===s)),resolvedApprovals:c}})}catch(a){const c=a instanceof Error?a.message:String(a);throw Cp.error(`respondToToolApproval failed for ${n}/${s}: ${c}`),a}},unsubscribeProvisioningProgress:()=>{const n=t().provisioningProgressUnsubscribe;n&&(n(),e({provisioningProgressUnsubscribe:null}))}}),O5t=e=>({commandPaletteOpen:!1,sidebarCollapsed:!1,openCommandPalette:()=>{e({commandPaletteOpen:!0})},closeCommandPalette:()=>{e({commandPaletteOpen:!1})},toggleSidebar:()=>{e(t=>({sidebarCollapsed:!t.sidebarCollapsed}))}}),g5t=1e4,_5t=1500,b5t=6,y5t=4e3,x5t=8,S5t=2e3,v5t=1e4,T5t=3e4,E5t=1e4,w5t=Hi("Store:index"),k5t=new Set(["task","config","inbox","lead-message","lead-context","lead-activity","process","member-spawn"]),wge=new Map;function C5t(e,t,n){if(!n)return;const r=Date.now(),s=wge.get(e)??{windowStartedAt:r,count:0,lastWarnAt:0,countsByType:{}};r-s.windowStartedAt>y5t&&(s.windowStartedAt=r,s.count=0,s.countsByType={}),s.count+=1,s.countsByType[t]=(s.countsByType[t]??0)+1,s.count>=x5t&&r-s.lastWarnAt>=S5t&&(s.lastWarnAt=r),wge.set(e,s)}const le=$St()((...e)=>({...R2t(...e),...N2t(...e),...FDt(...e),...UDt(...e),...YDt(...e),...m5t(...e),...Vvt(...e),...VDt(...e),...qDt(...e),...C2t(...e),...O5t(...e),...k2t(...e),...lvt(...e),...uvt(...e),...yvt(...e),...JSt(...e),...ovt(...e),...d2t(...e),...A2t(...e),...S2t(...e)}));function R5t(){qxt();const e=[];let t=null;le.getState().subscribeProvisioningProgress(),e.push(()=>{le.getState().unsubscribeProvisioningProgress()}),(async()=>{await le.getState().fetchConfig();const J=le.getState().appConfig;UQe(J?.general?.telemetryEnabled??!0),K.cliInstaller&&(t=setTimeout(()=>{le.getState().appConfig?.general?.multimodelEnabled??!1?le.getState().bootstrapCliStatus({multimodelEnabled:!0}):le.getState().fetchCliStatus(),t=null},3e3)),await Promise.all([le.getState().fetchRepositoryGroups(),le.getState().fetchAllTasks(),le.getState().fetchTeams(),le.getState().fetchNotifications(),le.getState().fetchSchedules()])})(),e.push(()=>{t&&clearTimeout(t)});const n=setInterval(()=>{q()},g5t);e.push(()=>{clearInterval(n)});const r=new Map,s=new Map,i=new Map,o=new Map;let a=new Map,c=new Map,l=new Map,d=new Map,p=new Map,f=new Map,h=!1,m=!1;const O=new Map;let _=null,b=null;const y=150,x=300,S=800,v=400,T=500,E=2e3,w=500,P=async J=>{if(!J||!oe(J))return;const F=le.getState();try{const W=await F.refreshTeamMessagesHead(J),ue=le.getState(),ae=ue.memberActivityMetaByTeam[J];(W.feedChanged||ae?.feedRevision!==W.feedRevision)&&await ue.refreshMemberActivityMeta(J)}catch{}},k=J=>{if(!J||!Z(J)||d.has(J))return;const F=setTimeout(()=>{d.delete(J),le.getState().fetchMemberSpawnStatuses(J)},T);d.set(J,F)},C=J=>{if(!J||!Z(J)||p.has(J))return;const F=setTimeout(()=>{p.delete(J),le.getState().fetchTeamAgentRuntime(J)},T);p.set(J,F)},M=J=>{if(!J||!oe(J)||c.has(J))return;const F=setTimeout(()=>{c.delete(J),P(J)},S);c.set(J,F)},I=(J,F,W,ue)=>`${J}:${F}:${W}:${ue}`,$=(J,F,W,ue)=>{const ae=I(J,F,W,ue),ce=f.get(ae);ce&&(clearTimeout(ce),f.delete(ae))},R=(J,F,W,ue,ae,ce)=>{$(J,F,W,ue);const H=I(J,F,W,ue),pe=setTimeout(()=>{f.delete(H),ce()},ae);f.set(H,pe)},N=J=>{for(const[F,W]of f.entries())F.startsWith(`${J}:`)&&(clearTimeout(W),f.delete(F))},j=(J,F)=>{const W={...J.activeToolsByTeam},ue={...J.finishedVisibleByTeam},ae={...J.toolHistoryByTeam};return delete W[F],delete ue[F],delete ae[F],{activeToolsByTeam:W,finishedVisibleByTeam:ue,toolHistoryByTeam:ae}},Q=(J,F,W)=>{const ue={...J[F]??{}},ae=ue[W.memberName]??[];return ue[W.memberName]=[W,...ae.filter(ce=>ce.toolUseId!==W.toolUseId)].slice(0,b5t),{...J,[F]:ue}},U=(J,F)=>({...J??{},[F.memberName]:{...(J??{})[F.memberName]??{},[F.toolUseId]:F}}),A=(J,F,W)=>{if(!J?.[F]?.[W])return J??{};const ue={...J??{}},ae={...ue[F]??{}};return delete ae[W],Object.keys(ae).length===0?delete ue[F]:ue[F]=ae,ue},V=(J,F)=>{if(!J?.[F])return J??{};const W={...J??{}};return delete W[F],W},z=(J,F,W)=>{if(!J?.[F]||W.length===0)return J??{};let ue=J??{},ae=!1;for(const ce of W)ue[F]?.[ce]&&(ue=A(ue,F,ce),ae=!0);return ae?ue:J??{}},L=J=>{if(!J)return null;const F=J.indexOf("::");return F>=0?J.slice(0,F):J},q=async()=>{if(h)return;const J=le.getState(),F=Array.from(G(J));if(F.length!==0){if(O.size>50){const W=new Set(le.getState().teams.map(ue=>ue.teamName));for(const ue of O.keys())W.has(ue)||O.delete(ue)}h=!0;try{for(const W of F){const ue=wi(J,W);if(ue?.teamName!==W){SY(W)||J.refreshTeamData(W,{withDedup:!0});continue}const ae=ue.tasks.filter(xt=>xt.status!=="in_progress"?!1:Ore(Fc(xt)));if(ae.length===0){O.delete(W);continue}const ce=O.get(W)??0,H=ae.filter(xt=>xt.changePresence==="unknown"),pe=H.length>0?H:ae,Ee=pe[ce%pe.length];O.set(W,(ce+1)%pe.length);const we=le.getState();if(!Z(W))continue;const $e=wi(we,W);if($e?.teamName!==W){SY(W)||we.refreshTeamData(W,{withDedup:!0});continue}const Ze=$e.tasks.find(xt=>xt.id===Ee.id);if(Ze?.status!=="in_progress")continue;const lt=Fc(Ze),yt=Ed(W,Ze.id,lt);we.invalidateTaskChangePresence([yt]),await we.checkTaskHasChanges(W,Ze.id,lt)}}catch{}finally{h=!1}}},Y=(J,F)=>{const W=`${J}/${F}`;if(r.has(W))return;const ue=setTimeout(()=>{r.delete(W),le.getState().refreshSessionInPlace(J,F)},y);r.set(W,ue)},ne=J=>{const F=s.get(J);F&&clearTimeout(F);const W=setTimeout(()=>{s.delete(J),le.getState().refreshSessionsInPlace(J)},x);s.set(J,W)};if(K.notifications?.onNew){const J=K.notifications.onNew((F,W)=>{const ue=W;ue?.id&&le.setState(ae=>ae.notifications.some(ce=>ce.id===ue.id)?{}:{notifications:[ue,...ae.notifications].slice(0,200)})});typeof J=="function"&&e.push(J)}if(K.notifications?.onUpdated){const J=K.notifications.onUpdated((F,W)=>{const ue=typeof W.unreadCount=="number"&&Number.isFinite(W.unreadCount)?Math.max(0,Math.floor(W.unreadCount)):0;le.setState({unreadCount:ue})});typeof J=="function"&&e.push(J)}if(K.notifications?.onClicked){const J=K.notifications.onClicked((F,W)=>{const ue=W;ue?.id&&ue?.sessionId&&ue?.projectId&&le.getState().navigateToError(ue)});typeof J=="function"&&e.push(J)}const te=J=>{const{paneLayout:F}=le.getState();return F.panes.some(W=>W.activeTabId!=null&&W.tabs.some(ue=>ue.id===W.activeTabId&&ue.type==="session"&&ue.sessionId===J))},G=(J=le.getState())=>{const{paneLayout:F}=J,W=new Set;for(const ue of F.panes){if(!ue.activeTabId)continue;const ae=ue.tabs.find(ce=>ce.id===ue.activeTabId);(ae?.type==="team"||ae?.type==="graph")&&ae.teamName!=null&&W.add(ae.teamName)}return W},Z=J=>G().has(J),oe=J=>Z(J)||gLt(J),re=()=>{const J=G();for(const F of _Lt())J.add(F);return J},se=()=>G(),he=(J,F=Date.now())=>{i.set(J,F)},Te=()=>{const J=le.getState(),F=J.paneLayout.panes.find(ue=>ue.id===J.paneLayout.focusedPaneId);if(!F?.activeTabId)return null;const W=F.tabs.find(ue=>ue.id===F.activeTabId);return W?.type!=="team"&&W?.type!=="graph"||!W.teamName||!wi(J,W.teamName)?null:W.teamName},ee=async()=>{if(m)return;const J=re();if(J.size!==0){m=!0;try{await Promise.allSettled(Array.from(J,F=>P(F)))}finally{m=!1}}},ye=async()=>{if(typeof document<"u"&&document.visibilityState==="hidden")return;const J=le.getState(),F=Te();if(!F||!Z(F)||J.selectedTeamName===F&&J.selectedTeamLoading||SY(F))return;const W=i.get(F)??0,ue=cge(F)??0,ae=Math.max(W,ue);if(ae===0)return;const ce=Date.now();if(!(ce-ae<T5t||(o.get(F)??0)>=ae)){w5t.warn(`[perf] idle-watchdog refresh team=${F} idleMs=${ce-ae}`);try{await J.refreshTeamData(F,{withDedup:!0})}finally{o.set(F,Math.max(cge(F)??0,ae,Date.now()))}}};if(K.teams?.setToolActivityTracking){let J=new Set;const F=()=>{const ue=se();for(const ae of ue)J.has(ae)||K.teams.setToolActivityTracking(ae,!0).catch(()=>{});for(const ae of J)ue.has(ae)||K.teams.setToolActivityTracking(ae,!1).catch(()=>{});J=ue};F();const W=le.subscribe((ue,ae)=>{ue.paneLayout!==ae.paneLayout&&F()});e.push(()=>{W();for(const ue of J)K.teams.setToolActivityTracking(ue,!1).catch(()=>{});J.clear()})}if(K.onTodoChange){const J=K.onTodoChange(F=>{if(!F.sessionId||F.type==="unlink")return;const W=le.getState();if(W.selectedSessionId===F.sessionId||te(F.sessionId)){const pe=W.getAllPaneTabs().find(Ee=>Ee.type==="session"&&Ee.sessionId===F.sessionId);pe?.projectId&&Y(pe.projectId,F.sessionId)}const ae=W.getActiveTab(),ce=ae?.type==="session"&&typeof ae.projectId=="string"?ae.projectId:null;ce&&ce===W.selectedProjectId&&ne(ce)});typeof J=="function"&&e.push(J)}if(K.onFileChange){const J=K.onFileChange(F=>{if(F.type==="unlink")return;const W=le.getState(),ue=W.selectedProjectId,ae=L(ue),ce=L(F.projectId),H=!!ue&&(ce==null||ae===ce),pe=!F.isSubagent,Ee=F.sessionId==null||!W.sessions.some($e=>$e.id===F.sessionId);if(pe&&H&&Ee&&(F.type==="add"||W.connectionMode==="local"&&F.type==="change")&&H&&ue&&ne(ue),(F.type==="change"||F.type==="add")&&ue){const $e=W.selectedSessionId,Ze=F.sessionId,xt=(!!Ze&&($e===Ze||te(Ze))?Ze:null)??(H&&!Ze&&!!$e?$e:null);if(xt){const Lt=W.getAllPaneTabs().find(ct=>ct.type==="session"&&ct.sessionId===xt)?.projectId??ue;Y(Lt,xt)}}});typeof J=="function"&&e.push(J)}const Oe=setInterval(()=>{ye()},v5t);e.push(()=>{clearInterval(Oe)});const ie=setInterval(()=>{ee()},E5t);if(e.push(()=>{clearInterval(ie)}),K.teams?.onTeamChange){const J=K.teams.onTeamChange((F,W)=>{const ue=!!W.teamName&&oe(W.teamName);if(C5t(W.teamName,W.type,ue),(()=>{if(!W.runId)return!1;const we=le.getState();return we.ignoredProvisioningRunIds[W.runId]===W.teamName||we.ignoredRuntimeRunIds[W.runId]===W.teamName})())return;const ce=(()=>{if(!W.runId)return!1;const we=le.getState().currentRuntimeRunIdByTeam[W.teamName];return we!=null&&we!==W.runId})(),H=()=>{if(!W.runId)return;le.getState().currentRuntimeRunIdByTeam[W.teamName]==null&&le.setState($e=>({currentRuntimeRunIdByTeam:{...$e.currentRuntimeRunIdByTeam,[W.teamName]:W.runId??null},ignoredRuntimeRunIds:Object.fromEntries(Object.entries($e.ignoredRuntimeRunIds).filter(([,Ze])=>Ze!==W.teamName))}))};if(k5t.has(W.type)&&!ce&&he(W.teamName),W.type==="lead-activity"&&W.detail){if(ce)return;H();const we=W.detail;le.setState($e=>{const Ze={leadActivityByTeam:{...$e.leadActivityByTeam,[W.teamName]:we}},lt=$e.teamDataCacheByName[W.teamName]??($e.selectedTeamName===W.teamName?$e.selectedTeamData:null),yt=lt&&lt.isAlive!==(we!=="offline")?{...lt,isAlive:we!=="offline"}:lt;return yt&&(Ze.teamDataCacheByName={...$e.teamDataCacheByName,[W.teamName]:yt}),$e.selectedTeamName===W.teamName&&yt&&(Ze.selectedTeamData=yt),we==="offline"&&(Ze.leadContextByTeam={...$e.leadContextByTeam},delete Ze.leadContextByTeam[W.teamName],Object.assign(Ze,j($e,W.teamName)),Ze.currentRuntimeRunIdByTeam={...$e.currentRuntimeRunIdByTeam},delete Ze.currentRuntimeRunIdByTeam[W.teamName],Ze.ignoredRuntimeRunIds=W.runId?{...$e.ignoredRuntimeRunIds,[W.runId]:W.teamName}:$e.ignoredRuntimeRunIds,N(W.teamName)),Ze});return}if(W.type==="lead-context"&&W.detail){if(ce)return;H();try{const we=JSON.parse(W.detail);le.setState($e=>({...$e,leadContextByTeam:{...$e.leadContextByTeam,[W.teamName]:we}}))}catch{}return}if(W.type==="tool-activity"&&W.detail){if(ce)return;H();try{const we=JSON.parse(W.detail);if(we.action==="start"&&we.activity){const $e={memberName:we.activity.memberName,toolUseId:we.activity.toolUseId,toolName:we.activity.toolName,preview:we.activity.preview,startedAt:we.activity.startedAt,source:we.activity.source,state:"running"};le.setState(Ze=>({activeToolsByTeam:{...Ze.activeToolsByTeam,[W.teamName]:U(Ze.activeToolsByTeam[W.teamName],$e)}}))}else if(we.action==="finish"&&we.memberName&&we.toolUseId){const $e=we.memberName,Ze=we.toolUseId;le.setState(lt=>{const yt=lt.activeToolsByTeam[W.teamName]?.[$e]?.[Ze];if(!yt)return{};const xt={...yt,state:we.isError?"error":"complete",finishedAt:we.finishedAt??new Date().toISOString(),resultPreview:we.resultPreview};return R(W.teamName,$e,Ze,"fade",_5t,()=>{le.setState(Ge=>Ge.finishedVisibleByTeam[W.teamName]?.[$e]?.[Ze]?{finishedVisibleByTeam:{...Ge.finishedVisibleByTeam,[W.teamName]:A(Ge.finishedVisibleByTeam[W.teamName],$e,Ze)}}:{})}),{activeToolsByTeam:{...lt.activeToolsByTeam,[W.teamName]:A(lt.activeToolsByTeam[W.teamName],$e,Ze)},finishedVisibleByTeam:{...lt.finishedVisibleByTeam,[W.teamName]:U(lt.finishedVisibleByTeam[W.teamName],xt)},toolHistoryByTeam:Q(lt.toolHistoryByTeam,W.teamName,xt)}})}else if(we.action==="reset")if(we.memberName){const $e=we.memberName,Ze=Array.isArray(we.toolUseIds)&&we.toolUseIds.length>0?we.toolUseIds:null;le.setState(lt=>lt.activeToolsByTeam[W.teamName]?.[$e]?{activeToolsByTeam:{...lt.activeToolsByTeam,[W.teamName]:Ze?z(lt.activeToolsByTeam[W.teamName],$e,Ze):V(lt.activeToolsByTeam[W.teamName],$e)}}:{})}else le.setState($e=>({activeToolsByTeam:{...$e.activeToolsByTeam,[W.teamName]:{}}}))}catch{}return}if(W.type==="member-spawn"){if(ce)return;H(),k(W.teamName),C(W.teamName);return}if(W.type==="inbox"){M(W.teamName);return}if(W.type==="lead-message"){if(ce)return;H(),M(W.teamName);return}if(W.type==="log-source-change"){if(!W?.teamName||!Z(W.teamName)||l.has(W.teamName))return;const we=setTimeout(()=>{l.delete(W.teamName),le.getState().refreshTeamChangePresence(W.teamName)},v);l.set(W.teamName,we);return}if(_||(_=setTimeout(()=>{_=null,le.getState().fetchTeams()},E)),(W.type==="task"||W.type==="config")&&!b&&(b=setTimeout(()=>{b=null,le.getState().fetchAllTasks()},w)),!W?.teamName||!Z(W.teamName)||a.has(W.teamName))return;const Ee=setTimeout(()=>{a.delete(W.teamName),le.getState().refreshTeamData(W.teamName,{withDedup:!0})},S);a.set(W.teamName,Ee)});typeof J=="function"&&e.push(()=>{J();for(const F of a.values())clearTimeout(F);a=new Map;for(const F of c.values())clearTimeout(F);c=new Map;for(const F of l.values())clearTimeout(F);l=new Map;for(const F of d.values())clearTimeout(F);d=new Map;for(const F of p.values())clearTimeout(F);p=new Map;for(const F of f.values())clearTimeout(F);f=new Map,i.clear(),o.clear(),_&&(clearTimeout(_),_=null),b&&(clearTimeout(b),b=null)})}if(K.teams?.onProjectBranchChange){const J=K.teams.onProjectBranchChange((F,W)=>{if(!W?.projectPath)return;const ue=fr(W.projectPath);ue&&le.setState(ae=>ae.branchByPath[ue]===W.branch?{}:{branchByPath:{...ae.branchByPath,[ue]:W.branch}})});typeof J=="function"&&e.push(J)}if(K.teams?.onToolApprovalEvent){const J=K.teams.onToolApprovalEvent((ue,ae)=>{const ce=ae;if("autoResolved"in ce&&ce.autoResolved){const H=ce.reason!=="timeout_deny";le.setState(pe=>{const Ee=new Map(pe.resolvedApprovals);return Ee.set(ce.requestId,H),{pendingApprovals:pe.pendingApprovals.filter(we=>!(we.runId===ce.runId&&we.requestId===ce.requestId)),resolvedApprovals:Ee}})}else if("dismissed"in ce&&ce.dismissed){const H=ce;le.setState(pe=>({pendingApprovals:pe.pendingApprovals.filter(Ee=>!(Ee.teamName===H.teamName&&Ee.runId===H.runId))}))}else{const H=ce;le.setState(pe=>({pendingApprovals:[...pe.pendingApprovals,H]}))}});typeof J=="function"&&e.push(J);const F=le.getState().toolApprovalSettings,W=le.getState().selectedTeamName??"__global__";K.teams.updateToolApprovalSettings?.(W,F).catch(()=>{})}if(K.editor?.onEditorChange){const J=K.editor.onEditorChange(F=>{const W=le.getState();W.editorProjectPath&&W.handleExternalFileChange(F)});typeof J=="function"&&e.push(J)}if(K.schedules?.onScheduleChange){const J=K.schedules.onScheduleChange((F,W)=>{const ue=W;ue?.scheduleId&&le.getState().applyScheduleChange(ue.scheduleId)});typeof J=="function"&&e.push(J)}let ge=null;if(K.cliInstaller?.onProgress){const J=K.cliInstaller.onProgress((F,W)=>{const ue=W;ue.type!=="completed"&&ge&&(clearTimeout(ge),ge=null);const ae=ue.detail??null;switch(ue.type){case"checking":le.setState({cliInstallerState:"checking",cliInstallerDetail:ae});break;case"downloading":le.setState({cliInstallerState:"downloading",cliDownloadProgress:ue.percent??0,cliDownloadTransferred:ue.transferred??0,cliDownloadTotal:ue.total??0,cliInstallerDetail:ae});break;case"verifying":le.setState({cliInstallerState:"verifying",cliInstallerDetail:ae});break;case"installing":{const ce=le.getState().cliInstallerLogs,H=le.getState().cliInstallerRawChunks,pe=ae?[...ce,ae].slice(-50):ce,Ee=ue.rawChunk?[...H,ue.rawChunk].slice(-200):H;le.setState({cliInstallerState:"installing",cliInstallerDetail:ae,cliInstallerLogs:pe,cliInstallerRawChunks:Ee});break}case"completed":{const ce=le.getState().appConfig?.general?.multimodelEnabled??!1;Yg({multimodelEnabled:ce,bootstrapCliStatus:le.getState().bootstrapCliStatus,fetchCliStatus:le.getState().fetchCliStatus})}le.setState({cliInstallerState:"completed",cliCompletedVersion:ue.version??null,cliInstallerDetail:null}),ge=setTimeout(()=>{ge=null,le.getState().cliInstallerState==="completed"&&le.setState({cliInstallerState:"idle"})},3e3);break;case"error":le.setState({cliInstallerState:"error",cliInstallerError:ue.error??"Unknown error"});break;case"status":if(ue.status){let ce=[];le.setState(H=>{const pe=wQ(H.cliStatus,ue.status),Ee=tvt(pe);return ce=nvt(pe),{cliStatus:pe,cliProviderStatusLoading:Ee.length>0?{...H.cliProviderStatusLoading,...Object.fromEntries(Ee.map(we=>[we,!0]))}:H.cliProviderStatusLoading}});for(const H of ce)le.getState().fetchCliProviderStatus(H,{silent:!1})}break}});typeof J=="function"&&e.push(()=>{J(),ge&&(clearTimeout(ge),ge=null)})}if(K.ssh?.onStatus){const J=K.ssh.onStatus((F,W)=>{const ue=W;le.getState().setConnectionStatus(ue.state,ue.host,ue.error)});typeof J=="function"&&e.push(J)}if(K.context?.onChanged){const J=K.context.onChanged((F,W)=>{const{id:ue}=W,ae=le.getState().activeContextId;ue!==ae&&le.getState().switchContext(ue)});typeof J=="function"&&e.push(J)}return()=>{for(const J of r.values())clearTimeout(J);r.clear();for(const J of s.values())clearTimeout(J);s.clear(),e.forEach(J=>J())}}const P5t=()=>{const e=le(r=>r.isContextSwitching),t=le(r=>r.targetContextId);if(!e)return null;const n=t==="local"?"本地":t?.replace(/^ssh-/,"")??"未知";return u.jsx("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-surface",children:u.jsxs("div",{className:"flex flex-col items-center gap-4",children:[u.jsx("div",{className:"size-8 animate-spin rounded-full border-4 border-text border-t-transparent"}),u.jsxs("div",{className:"flex flex-col items-center gap-1",children:[u.jsxs("p",{className:"text-text",children:["正在切换到 ",n,"..."]}),u.jsx("p",{className:"text-sm text-text-secondary",children:"正在加载工作区"})]})]})})},$5t="1.6.7",N5t={version:$5t},A5t="https://github.com/yancyuu/Hermit/issues/new",I5t=120,M5t=1800,Q5t=1200,D5t=12e3,L5t=8e3,wZ=(e,t)=>e.length<=t?e:`${e.slice(0,t)}
1041
+ `)}`;i!==wL&&(wL=i,L0&&clearTimeout(L0),L0=setTimeout(()=>{L0=null,K.editor.setWatchedDirs(s)},a2t))}let q_=0;const hx=new Map,c2t=2e3;function u2t(e){try{const t=window.requestIdleCallback;if(typeof t=="function"){t(e,{timeout:2e3});return}}catch{}setTimeout(e,150)}const d2t=(e,t)=>({editorProjectPath:null,editorFileTree:null,editorFileTreeLoading:!1,editorFileTreeError:null,editorExpandedDirs:{},editorOpenTabs:[],editorActiveTabId:null,editorFileLoading:{},editorModifiedFiles:{},editorSaving:{},editorSaveError:{},editorCreating:!1,editorCreateError:null,editorGitFiles:[],editorGitBranch:null,editorIsGitRepo:!1,editorGitLoading:!1,editorWatcherEnabled:!1,editorLineWrap:(()=>{try{return localStorage.getItem("editor-line-wrap")==="true"}catch{return!1}})(),editorExternalChanges:{},editorFileMtimes:{},editorConflictFile:null,editorPendingGoToLine:null,editorPendingRevealFile:null,setPendingGoToLine:n=>e({editorPendingGoToLine:n}),revealFileInEditor:n=>{e({editorPendingRevealFile:n})},revealFolderInEditor:n=>{e({editorPendingRevealFile:n});const{editorProjectPath:r,editorFileTree:s,expandDirectory:i}=t();if(!r||!s)return;const o=kR(r),a=el(o),c=el(n),l=Qc(o),d=(f,h)=>l?f.toLowerCase()===h.toLowerCase():f===h;if(c.length>=a.length&&a.every((f,h)=>d(f,c[h]))){const f=c.slice(a.length);let h=o;(async()=>{for(const O of f)h=ZD(h,O),await i(h);e({editorPendingRevealFile:null})})()}},clearPendingRevealFile:()=>{e({editorPendingRevealFile:null})},revealAndOpenFile:async n=>{const{editorProjectPath:r,editorFileTree:s,expandDirectory:i,openFile:o}=t();if(!r)return;if(!s){_s.info("revealAndOpenFile: tree not loaded yet, deferring reveal");return}const a=kR(r),c=el(a),l=el(n),d=Qc(a),p=(h,m)=>d?h.toLowerCase()===m.toLowerCase():h===m;if(l.length>=c.length&&c.every((h,m)=>p(h,l[m]))){const h=l.slice(c.length);let m=a;for(let O=0;O<h.length-1;O++)m=ZD(m,h[O]??""),await i(m)}o(n),e({editorPendingRevealFile:null})},openEditor:async n=>{const r=++q_;e({editorProjectPath:n,editorFileTree:null,editorFileTreeLoading:!0,editorFileTreeError:null,editorExpandedDirs:{},editorOpenTabs:[],editorActiveTabId:null,editorFileLoading:{},editorModifiedFiles:{},editorSaving:{},editorSaveError:{},editorCreating:!1,editorCreateError:null,editorGitFiles:[],editorGitBranch:null,editorIsGitRepo:!1,editorGitLoading:!1,editorWatcherEnabled:!1,editorExternalChanges:{},editorFileMtimes:{},editorConflictFile:null,editorPendingGoToLine:null});try{const s=performance.now();await K.editor.open(n);const i=performance.now()-s;if(q_!==r||t().editorProjectPath!==n)return;const o=performance.now(),a=await K.editor.readDir(n),c=performance.now()-o;if(q_!==r||t().editorProjectPath!==n)return;const l=performance.now();e({editorFileTree:a.entries,editorFileTreeLoading:!1});const d=performance.now()-l;_s.info(`[perf] openEditor: open=${i.toFixed(1)}ms, readDir=${c.toFixed(1)}ms, set=${d.toFixed(1)}ms, entries=${a.entries.length}`);const p=(()=>{try{return localStorage.getItem("editor-watcher-enabled")!=="false"}catch{return!0}})();u2t(()=>{q_!==r||t().editorProjectPath!==n||(p&&t().toggleWatcher(!0),setTimeout(()=>{q_!==r||t().editorProjectPath!==n||t().fetchGitStatus()},1200))})}catch(s){if(q_!==r||t().editorProjectPath!==n)return;const i=s instanceof Error?s.message:String(s);_s.error("Failed to open editor:",i),e({editorFileTreeLoading:!1,editorFileTreeError:i})}},closeEditor:()=>{q_++,D0&&(clearTimeout(D0),D0=null),L0&&(clearTimeout(L0),L0=null),EL="",wL="",od.clear(),hx.clear(),K.editor.close().catch(n=>{_s.error("editor:close failed:",n)}),kp.destroy(),e({editorProjectPath:null,editorFileTree:null,editorFileTreeLoading:!1,editorFileTreeError:null,editorExpandedDirs:{},editorOpenTabs:[],editorActiveTabId:null,editorFileLoading:{},editorModifiedFiles:{},editorSaving:{},editorSaveError:{},editorCreating:!1,editorCreateError:null,editorGitFiles:[],editorGitBranch:null,editorIsGitRepo:!1,editorGitLoading:!1,editorWatcherEnabled:!1,editorExternalChanges:{},editorFileMtimes:{},editorConflictFile:null,editorPendingGoToLine:null})},loadFileTree:async n=>{e({editorFileTreeLoading:!0,editorFileTreeError:null});try{const r=performance.now(),s=await K.editor.readDir(n),i=performance.now()-r,o=performance.now();e({editorFileTree:s.entries,editorFileTreeLoading:!1});const a=performance.now()-o;_s.info(`[perf] loadFileTree: IPC=${i.toFixed(1)}ms, set=${a.toFixed(1)}ms, entries=${s.entries.length}`)}catch(r){const s=r instanceof Error?r.message:String(r);_s.error("Failed to load file tree:",s),e({editorFileTreeLoading:!1,editorFileTreeError:s})}},expandDirectory:async n=>{const{editorExpandedDirs:r}=t(),s=!!r[n];s||(e({editorExpandedDirs:{...r,[n]:!0}}),oY(t));try{const i=performance.now(),o=await K.editor.readDir(n),a=performance.now()-i,c=t().editorFileTree,l=performance.now(),d=Tse(c??[],n,o.entries),p=performance.now()-l,f=performance.now();e({editorFileTree:d});const h=performance.now()-f;_s.info(`[perf] expandDirectory: IPC=${a.toFixed(1)}ms, merge=${p.toFixed(1)}ms, set=${h.toFixed(1)}ms, entries=${o.entries.length}, wasExpanded=${s}`)}catch(i){const o=i instanceof Error?i.message:String(i);_s.error("Failed to expand directory:",o);const a=t().editorExpandedDirs;e({editorExpandedDirs:li(a,n)})}},collapseDirectory:n=>{const{editorExpandedDirs:r}=t();e({editorExpandedDirs:li(r,n)}),oY(t)},openFile:n=>{const{editorOpenTabs:r}=t(),s=r.find(l=>l.filePath===n);if(s){e({editorActiveTabId:s.id});return}const i=Of(n)||"file",o=nY(i),a={id:n,filePath:n,fileName:i,language:o},c=uI([...r,a]);e({editorOpenTabs:c,editorActiveTabId:a.id}),R1(t)},closeEditorTab:n=>{const{editorOpenTabs:r,editorActiveTabId:s,editorModifiedFiles:i,editorSaveError:o}=t(),a=r.filter(f=>f.id!==n),c=li(i,n),l=li(o,n);kp.deleteState(n);try{localStorage.removeItem(`editor-draft:${n}`)}catch{}let d=s;if(s===n){const f=r.findIndex(h=>h.id===n);a.length>0?d=a[Math.min(f,a.length-1)].id:d=null}const p=uI(a);e({editorOpenTabs:p,editorActiveTabId:d,editorModifiedFiles:c,editorSaveError:l}),R1(t)},closeOtherEditorTabs:n=>{const{editorOpenTabs:r}=t(),s=r.filter(i=>i.id!==n);for(const i of s)t().closeEditorTab(i.id)},closeEditorTabsToLeft:n=>{const{editorOpenTabs:r}=t(),s=r.findIndex(o=>o.id===n);if(s<=0)return;const i=r.slice(0,s);for(const o of i)t().closeEditorTab(o.id)},closeEditorTabsToRight:n=>{const{editorOpenTabs:r}=t(),s=r.findIndex(o=>o.id===n);if(s<0||s>=r.length-1)return;const i=r.slice(s+1);for(const o of i)t().closeEditorTab(o.id)},closeAllEditorTabs:()=>{const{editorOpenTabs:n}=t();for(const r of[...n])t().closeEditorTab(r.id)},setActiveEditorTab:n=>{e({editorActiveTabId:n})},reorderEditorTabs:(n,r)=>{if(n===r)return;const{editorOpenTabs:s}=t(),i=s.findIndex(l=>l.id===n),o=s.findIndex(l=>l.id===r);if(i===-1||o===-1)return;const a=[...s],[c]=a.splice(i,1);a.splice(o,0,c),e({editorOpenTabs:a})},markFileModified:n=>{const{editorModifiedFiles:r}=t();r[n]||e({editorModifiedFiles:{...r,[n]:!0}})},markFileSaved:n=>{const{editorModifiedFiles:r}=t();e({editorModifiedFiles:li(r,n)})},saveFile:async n=>{const r=kp.getContent(n);if(r===null){_s.error("saveFile: no content available for",n);return}e(s=>({editorSaving:{...s.editorSaving,[n]:!0},editorSaveError:li(s.editorSaveError,n)}));try{const s=t().editorFileMtimes[n],i=await K.editor.writeFile(n,r,s);od.set(n,Date.now()),e(o=>({editorModifiedFiles:li(o.editorModifiedFiles,n),editorSaving:li(o.editorSaving,n),editorFileMtimes:{...o.editorFileMtimes,[n]:i.mtimeMs},editorExternalChanges:li(o.editorExternalChanges,n)}));try{localStorage.removeItem(`editor-draft:${n}`)}catch{}}catch(s){const i=s instanceof Error?s.message:String(s);if(i.startsWith("CONFLICT")){_s.error("Save conflict detected:",n),e(o=>({editorSaving:li(o.editorSaving,n),editorConflictFile:n}));return}_s.error("Failed to save file:",i),e(o=>({editorSaving:li(o.editorSaving,n),editorSaveError:{...o.editorSaveError,[n]:i}}))}},saveAllFiles:async()=>{const{editorModifiedFiles:n}=t(),r=kp.getAllModifiedContent(n),s=[];for(const[i,o]of r)s.push((async()=>{e(a=>({editorSaving:{...a.editorSaving,[i]:!0}}));try{const a=t().editorFileMtimes[i],c=await K.editor.writeFile(i,o,a);od.set(i,Date.now()),e(l=>({editorModifiedFiles:li(l.editorModifiedFiles,i),editorSaving:li(l.editorSaving,i),editorFileMtimes:{...l.editorFileMtimes,[i]:c.mtimeMs},editorExternalChanges:li(l.editorExternalChanges,i)}));try{localStorage.removeItem(`editor-draft:${i}`)}catch{}}catch(a){const c=a instanceof Error?a.message:String(a);if(c.startsWith("CONFLICT")){_s.error("Save conflict detected:",i),e(l=>({editorSaving:li(l.editorSaving,i),editorConflictFile:i}));return}_s.error("Failed to save file:",i,c),e(l=>({editorSaving:li(l.editorSaving,i),editorSaveError:{...l.editorSaveError,[i]:c}}))}})());await Promise.allSettled(s)},discardChanges:n=>{const{editorModifiedFiles:r,editorSaveError:s}=t();e({editorModifiedFiles:li(r,n),editorSaveError:li(s,n)});try{localStorage.removeItem(`editor-draft:${n}`)}catch{}},hasUnsavedChanges:()=>Object.keys(t().editorModifiedFiles).length>0,createFileInTree:async(n,r)=>{e({editorCreating:!0,editorCreateError:null});try{const s=await K.editor.createFile(n,r);return await W_(t,e,n),e({editorCreating:!1}),s.filePath}catch(s){const i=s instanceof Error?s.message:String(s);return _s.error("Failed to create file:",i),e({editorCreating:!1,editorCreateError:i}),null}},createDirInTree:async(n,r)=>{e({editorCreating:!0,editorCreateError:null});try{const s=await K.editor.createDir(n,r);return await W_(t,e,n),e({editorCreating:!1}),s.dirPath}catch(s){const i=s instanceof Error?s.message:String(s);return _s.error("Failed to create directory:",i),e({editorCreating:!1,editorCreateError:i}),null}},deleteFileFromTree:async n=>{try{await K.editor.deleteFile(n);const{editorOpenTabs:r}=t(),s=r.filter(o=>ISt(n,o.filePath));for(const o of s)t().closeEditorTab(o.id);const i=n.substring(0,I0(n));return i&&await W_(t,e,i),!0}catch(r){const s=r instanceof Error?r.message:String(r);return _s.error("Failed to delete file:",s),!1}},moveFileInTree:async(n,r)=>{const{editorSaving:s}=t();if(s[n])return _s.error("moveFileInTree: blocked — file is being saved:",n),!1;try{const i=await K.editor.moveFile(n,r),{newPath:o,isDirectory:a}=i,c=n.substring(0,I0(n));hx.set(n,Date.now()),hx.set(o,Date.now()),e(d=>{const p=d.editorOpenTabs.map(f=>{const h=hh(f.filePath,n,o);if(h===f.filePath)return f;const m=Of(h)||"file";return{...f,id:h,filePath:h,fileName:m,language:nY(m)}});return{editorOpenTabs:uI(p),editorActiveTabId:hh(d.editorActiveTabId??"",n,o)||d.editorActiveTabId,editorModifiedFiles:wl(d.editorModifiedFiles,n,o),editorSaving:wl(d.editorSaving,n,o),editorSaveError:wl(d.editorSaveError,n,o),editorFileLoading:wl(d.editorFileLoading,n,o),editorExternalChanges:wl(d.editorExternalChanges,n,o),editorFileMtimes:wl(d.editorFileMtimes,n,o),editorExpandedDirs:wl(d.editorExpandedDirs,n,o)}}),R1(t);const{editorOpenTabs:l}=t();for(const d of l){const p=zOe(d.filePath,n,o);p!==d.filePath&&kp.remapState(p,d.filePath)}a||kp.remapState(n,o);try{for(let d=0;d<localStorage.length;d++){const p=localStorage.key(d);if(p?.startsWith("editor-draft:")){const f=p.slice(13),h=hh(f,n,o);if(h!==f){const m=localStorage.getItem(p);localStorage.removeItem(p),m!==null&&localStorage.setItem(`editor-draft:${h}`,m)}}}}catch{}for(const[d,p]of[...od.entries()]){const f=hh(d,n,o);f!==d&&(od.delete(d),od.set(f,p))}return W_(t,e,c),W_(t,e,r),t().fetchGitStatus(),!0}catch(i){const o=i instanceof Error?i.message:String(i);return _s.error("moveFileInTree failed:",o),!1}},renameFileInTree:async(n,r)=>{const{editorSaving:s}=t();if(s[n])return _s.error("renameFileInTree: blocked — file is being saved:",n),!1;try{const i=await K.editor.renameFile(n,r),{newPath:o,isDirectory:a}=i,c=n.substring(0,I0(n));hx.set(n,Date.now()),hx.set(o,Date.now()),e(d=>{const p=d.editorOpenTabs.map(f=>{const h=hh(f.filePath,n,o);if(h===f.filePath)return f;const m=Of(h)||"file";return{...f,id:h,filePath:h,fileName:m,language:nY(m)}});return{editorOpenTabs:uI(p),editorActiveTabId:hh(d.editorActiveTabId??"",n,o)||d.editorActiveTabId,editorModifiedFiles:wl(d.editorModifiedFiles,n,o),editorSaving:wl(d.editorSaving,n,o),editorSaveError:wl(d.editorSaveError,n,o),editorFileLoading:wl(d.editorFileLoading,n,o),editorExternalChanges:wl(d.editorExternalChanges,n,o),editorFileMtimes:wl(d.editorFileMtimes,n,o),editorExpandedDirs:wl(d.editorExpandedDirs,n,o)}}),R1(t);const{editorOpenTabs:l}=t();for(const d of l){const p=zOe(d.filePath,n,o);p!==d.filePath&&kp.remapState(p,d.filePath)}a||kp.remapState(n,o);try{for(let d=0;d<localStorage.length;d++){const p=localStorage.key(d);if(p?.startsWith("editor-draft:")){const f=p.slice(13),h=hh(f,n,o);if(h!==f){const m=localStorage.getItem(p);localStorage.removeItem(p),m!==null&&localStorage.setItem(`editor-draft:${h}`,m)}}}}catch{}for(const[d,p]of[...od.entries()]){const f=hh(d,n,o);f!==d&&(od.delete(d),od.set(f,p))}return W_(t,e,c),t().fetchGitStatus(),!0}catch(i){const o=i instanceof Error?i.message:String(i);return _s.error("renameFileInTree failed:",o),!1}},fetchGitStatus:async()=>{e({editorGitLoading:!0});try{const n=performance.now(),r=await K.editor.gitStatus(),s=performance.now()-n,i=performance.now();e({editorGitFiles:r.files,editorGitBranch:r.branch,editorIsGitRepo:r.isGitRepo,editorGitLoading:!1});const o=performance.now()-i;_s.info(`[perf] fetchGitStatus: IPC=${s.toFixed(1)}ms, set=${o.toFixed(1)}ms, files=${r.files.length}`)}catch(n){_s.error("Failed to fetch git status:",n),e({editorGitLoading:!1})}},toggleWatcher:async n=>{try{await K.editor.watchDir(n),e({editorWatcherEnabled:n});try{localStorage.setItem("editor-watcher-enabled",String(n))}catch{}n?(R1(t),oY(t)):(EL="",wL="",K.editor.setWatchedFiles([]),K.editor.setWatchedDirs([]))}catch(r){_s.error("Failed to toggle watcher:",r)}},toggleLineWrap:()=>{e(n=>{const r=!n.editorLineWrap;try{localStorage.setItem("editor-line-wrap",String(r))}catch{}return{editorLineWrap:r}})},handleExternalFileChange:n=>{dI[n.type]=(dI[n.type]??0)+1,iY||(iY=setTimeout(()=>{iY=null;const l=dI;dI={change:0,create:0,delete:0},_s.info(`[perf] editor watcher events (2s): change=${l.change}, create=${l.create}, delete=${l.delete}`)},2e3));const{editorOpenTabs:r,editorProjectPath:s,editorSaving:i}=t();if(i[n.path])return;const o=od.get(n.path);if(o&&Date.now()-o<s2t)return;const a=hx.get(n.path);if(a&&Date.now()-a<c2t)return;if((r.some(l=>l.filePath===n.path)||n.type==="delete")&&e(l=>({editorExternalChanges:{...l.editorExternalChanges,[n.path]:n.type}})),rY||(rY=setTimeout(()=>{rY=null,t().fetchGitStatus()},i2t)),n.type==="create"||n.type==="delete"){r2t();const l=n.path.substring(0,I0(n.path));if(l&&s){const d=sY.get(l);d&&clearTimeout(d);const p=setTimeout(()=>{sY.delete(l),W_(t,e,l)},o2t);sY.set(l,p)}}},clearExternalChange:n=>{e(r=>({editorExternalChanges:li(r.editorExternalChanges,n)}))},setFileMtime:(n,r)=>{e(s=>({editorFileMtimes:{...s.editorFileMtimes,[n]:r}}))},forceOverwrite:async n=>{const r=kp.getContent(n);if(r===null){_s.error("forceOverwrite: no content available for",n);return}e(s=>({editorSaving:{...s.editorSaving,[n]:!0},editorConflictFile:null}));try{const s=await K.editor.writeFile(n,r);od.set(n,Date.now()),e(i=>({editorModifiedFiles:li(i.editorModifiedFiles,n),editorSaving:li(i.editorSaving,n),editorFileMtimes:{...i.editorFileMtimes,[n]:s.mtimeMs},editorExternalChanges:li(i.editorExternalChanges,n)}));try{localStorage.removeItem(`editor-draft:${n}`)}catch{}}catch(s){const i=s instanceof Error?s.message:String(s);_s.error("Failed to force overwrite:",i),e(o=>({editorSaving:li(o.editorSaving,n),editorSaveError:{...o.editorSaveError,[n]:i}}))}},resolveConflict:()=>{e({editorConflictFile:null})}});async function W_(e,t,n){try{const r=performance.now(),s=await K.editor.readDir(n);_s.info(`[perf] refreshDirectory: IPC=${(performance.now()-r).toFixed(1)}ms, entries=${s.entries.length}, dir=${Of(n)}`);const i=e().editorFileTree;if(!i)return;const o=e().editorProjectPath;if(n===o){const a=new Map;for(const l of i)a.set(l.path,l);const c=s.entries.map(l=>{const d=a.get(l.path);return d?.children&&l.type==="directory"?{...l,children:d.children}:l});t({editorFileTree:c})}else{const a=Tse(i,n,s.entries);t({editorFileTree:a})}}catch(r){_s.error("Failed to refresh directory:",r)}}function hh(e,t,n){const r=el(t),s=el(e);if(r.length===0)return e;const i=Qc(t)||Qc(e)||Qc(n),o=(l,d)=>i?l.toLowerCase()===d.toLowerCase():l===d;if(!(s.length>=r.length&&r.every((l,d)=>o(l,s[d]))))return e;const c=s.slice(r.length);return c.length>0?ZD(n,...c):n}function zOe(e,t,n){const r=el(n),s=el(e);if(r.length===0)return e;const i=Qc(t)||Qc(e)||Qc(n),o=(l,d)=>i?l.toLowerCase()===d.toLowerCase():l===d;if(!(s.length>=r.length&&r.every((l,d)=>o(l,s[d]))))return e;const c=s.slice(r.length);return c.length>0?ZD(t,...c):t}function wl(e,t,n){const r={};let s=!1;for(const[i,o]of Object.entries(e)){const a=hh(i,t,n);a!==i&&(s=!0),r[a]=o}return s?r:e}function Tse(e,t,n){let r=!1;const s=e.map(i=>{if(i.path===t&&i.type==="directory")return r=!0,{...i,children:n};if(i.children){const o=Tse(i.children,t,n);if(o!==i.children)return r=!0,{...i,children:o}}return i});return r?s:e}function BOe(e,t,n){return t==="project"||t==="local"?`plugin:${e}:${t}:${dT(n)}`:`plugin:${e}:${t}`}function JR(e,t,n){return t==="project"||t==="local"?`mcp:${e}:${t}:${dT(n)}`:`mcp:${e}:${t}`}function UQ(e,t){return t?`mcp-diagnostic:${t}:${e}`:`mcp-diagnostic:${e}`}function dT(e){return e??"__global__"}function p2t(e){if(e.length===0)return null;if(e.length>1)return`已安装到 ${e.length} 个范围`;switch(e[0]){case"global":case"user":return"已全局安装";case"project":return"已安装到项目";case"local":return"已安装到本地";default:return"已安装"}}const FOe={local:0,project:1,global:2,user:2};function Wje(e){return e.length===0?null:[...e].sort((t,n)=>FOe[t.scope]-FOe[n.scope])[0]}function Gje(e){const t=Array.from(new Set(e.map(n=>n.scope)));return p2t(t)}function FO(e){const{isInstalled:t,cliStatus:n,cliStatusLoading:r,section:s="plugins"}=e;if(n===null)return r?"正在检查运行时状态...":"正在检查运行时可用性...";if(n.installed===!1)return n.binaryPath&&n.launchError?"已找到配置的运行时,但启动失败。请打开首页修复或重新安装。":"需要配置的运行时。请从首页安装或修复。";const i=n.providers??[],o=n.flavor==="agent_teams_orchestrator";if(s==="mcp")return!o||i.filter(p=>Rfe(IA(p,"mcp"))).length>0?null:i.map(p=>IA(p,"mcp").reason).find(p=>typeof p=="string"&&p.trim().length>0)??"当前运行时不支持 MCP 管理。";if(!o)return!t&&!n.authLoggedIn?"Claude CLI 已安装但尚未登录。请打开首页登录。":null;const a=i.filter(l=>Rfe(IA(l,"plugins")));return a.length===0?i.map(d=>IA(d,"plugins").reason).find(d=>typeof d=="string"&&d.trim().length>0)??"当前运行时不支持安装插件。":t||a.find(l=>l.authenticated)?null:`${a[0]?.displayName??"Anthropic"} 未连接。请打开首页登录。`}function kL(e){return e.toLowerCase().replace(/\s+/g,"-").replace(/[^\w.-]/g,"")}function Ese(e){return e==="agent_teams_orchestrator"?"global":"user"}function Hje(e){return e==="user"||e==="global"}function bu(e){return e==="project"||e==="local"}function cZ(e,t){switch(e){case"global":return"全局";case"user":return t==="agent_teams_orchestrator"?"用户(旧版)":"用户(全局)";case"project":return"项目";case"local":return"本地";default:return e}}function Ql(e,t){return e.panes.find(n=>n.id===t)}function kh(e,t){return e.panes.find(n=>n.tabs.some(r=>r.id===t))}function eo(e,t){return{...e,panes:e.panes.map(n=>n.id===t.id?t:n)}}function qw(e,t){const n=e.panes.findIndex(l=>l.id===t);if(n===-1||e.panes.length<=1)return e;const r=e.panes[n],s=e.panes.filter(l=>l.id!==t),i=n>0?n-1:0,o=s.map((l,d)=>d===i?{...l,widthFraction:l.widthFraction+r.widthFraction}:l),a=Zje(o);let c=e.focusedPaneId;return e.focusedPaneId===t&&(c=a[Math.min(n,a.length-1)].id),{panes:a,focusedPaneId:c}}function YOe(e,t,n,r){const s=e.panes.findIndex(a=>a.id===t);if(s===-1)return e;const i=r==="right"?s+1:s,o=[...e.panes];return o.splice(i,0,n),{...e,panes:Zje(o)}}function Zje(e){if(e.length===0)return e;const t=1/e.length;return e.map(n=>({...n,widthFraction:t}))}function Kje(e){const t=Ql(e,e.focusedPaneId);return t?{openTabs:t.tabs,activeTabId:t.activeTabId,selectedTabIds:t.selectedTabIds}:{openTabs:[],activeTabId:null,selectedTabIds:[]}}function fu(e){return e.panes.flatMap(t=>t.tabs)}function VOe(e){return{id:e,tabs:[],activeTabId:null,selectedTabIds:[],widthFraction:0}}let mx=null,aY=0;const eP=new Map,tP=new Map,lY=new Map;let f2t=0,h2t=0;const cY=new Map,uY=new Map,m2t="__user__";function dY(e){return Object.values(e).some(Boolean)}function O2t(e){return e??"__user__"}function pI(e){return new Set(e.map(t=>t.pluginId))}function uZ(e,t){return e.startsWith(`plugin:${t}:`)}function qOe(e,t,n){if(e.size===0)return{pluginInstallProgress:t,installErrors:n};const r={...t},s={...n},i=Array.from(e);for(const o of Object.keys(r))i.some(a=>uZ(o,a))&&delete r[o];for(const o of Object.keys(s))i.some(a=>uZ(o,a))&&delete s[o];return{pluginInstallProgress:r,installErrors:s}}function xh(e){const t=eP.get(e);t&&(clearTimeout(t),eP.delete(e))}function WOe(e){const t=Array.from(e);for(const n of Array.from(eP.keys()))t.some(r=>uZ(n,r))&&xh(n)}function GOe(e,t){xh(e);const n=setTimeout(()=>{eP.delete(e),t(r=>r.pluginInstallProgress[e]!=="success"?{}:{pluginInstallProgress:{...r.pluginInstallProgress,[e]:"idle"}})},Jje);eP.set(e,n)}function g2t(e,t,n){return t==="project"||t==="local"?`mcp-custom:${e}:${t}:${dT(n)}`:`mcp-custom:${e}:${t}`}function dZ(e){return e.includes(":project:")||e.endsWith(":project")||e.includes(":local:")||e.endsWith(":local")}function cu(e){const t=tP.get(e);t&&(clearTimeout(t),tP.delete(e))}function pY(e,t){cu(e);const n=setTimeout(()=>{tP.delete(e),t(r=>r.mcpInstallProgress[e]!=="success"?{}:{mcpInstallProgress:{...r.mcpInstallProgress,[e]:"idle"}})},Jje);tP.set(e,n)}function _2t(e,t){const n={...e},r={...t};for(const s of Object.keys(n))(s.startsWith("mcp:")||s.startsWith("mcp-custom:"))&&dZ(s)&&delete n[s];for(const s of Object.keys(r))(s.startsWith("mcp:")||s.startsWith("mcp-custom:"))&&dZ(s)&&delete r[s];return{mcpInstallProgress:n,installErrors:r}}function b2t(){for(const e of Array.from(tP.keys()))dZ(e)&&cu(e)}function y2t(e){return e??m2t}function x2t(e,t){const n=e.filter(r=>r.id!==t.id);return[t,...n]}const Jje=2e3,HOe="Project- and local-scoped plugins require an active project in the Extensions tab.";function G_(e){return Yg({multimodelEnabled:e.appConfig?.general?.multimodelEnabled??!1,bootstrapCliStatus:e.bootstrapCliStatus,fetchCliStatus:e.fetchCliStatus})}function P1(e){return{cliStatus:e.cliStatus,cliStatusLoading:e.cliStatus===null&&e.cliStatusLoading}}const S2t=(e,t)=>({pluginCatalog:[],pluginCatalogLoading:!1,pluginCatalogError:null,pluginCatalogProjectPath:null,pluginReadmes:{},pluginReadmeLoading:{},mcpBrowseCatalog:[],mcpBrowseNextCursor:void 0,mcpBrowseLoading:!1,mcpBrowseError:null,mcpInstalledServers:[],mcpInstalledServersByProjectPath:{},mcpInstalledProjectPath:null,mcpDiagnostics:{},mcpDiagnosticsByProjectPath:{},mcpDiagnosticsLoading:!1,mcpDiagnosticsLoadingByProjectPath:{},mcpDiagnosticsError:null,mcpDiagnosticsErrorByProjectPath:{},mcpDiagnosticsLastCheckedAt:null,mcpDiagnosticsLastCheckedAtByProjectPath:{},pluginInstallProgress:{},mcpInstallProgress:{},installErrors:{},apiKeys:[],apiKeysLoading:!1,apiKeysError:null,apiKeySaving:!1,apiKeyStorageStatus:null,skillsUserCatalog:[],skillsProjectCatalogByProjectPath:{},skillsCatalogLoadingByProjectPath:{},skillsCatalogErrorByProjectPath:{},skillsLoading:!1,skillsError:null,skillsDetailsById:{},skillsDetailLoadingById:{},skillsDetailErrorById:{},skillsMutationLoading:!1,skillsMutationError:null,mcpGitHubStars:{},fetchPluginCatalog:async(n,r)=>{if(!K.plugins)return;const s=O2t(n);if(mx&&!r&&mx.key===s){await mx.promise;return}const i=++aY,o=Symbol("pluginCatalogRequest");e({pluginCatalogLoading:!0,pluginCatalogError:null});let a=null;a=(async()=>{try{const c=await K.plugins.getAll(n,r);e(l=>{if(i!==aY)return{};const d=n??null,f=l.pluginCatalogProjectPath===d?new Set:new Set([...pI(l.pluginCatalog),...pI(c)]),h=qOe(f,l.pluginInstallProgress,l.installErrors);return WOe(f),{pluginCatalog:c,pluginCatalogLoading:!1,pluginCatalogError:null,pluginCatalogProjectPath:d,pluginInstallProgress:h.pluginInstallProgress,installErrors:h.installErrors}})}catch(c){e(l=>{if(i!==aY)return{};const d=n??null,p=l.pluginCatalogProjectPath===d,f=qOe(p?new Set:pI(l.pluginCatalog),l.pluginInstallProgress,l.installErrors);return WOe(p?new Set:pI(l.pluginCatalog)),{pluginCatalog:p?l.pluginCatalog:[],pluginCatalogLoading:!1,pluginCatalogError:c instanceof Error?c.message:"Failed to load plugins",pluginCatalogProjectPath:d,pluginInstallProgress:f.pluginInstallProgress,installErrors:f.installErrors}})}finally{mx?.token===o&&(mx=null)}})(),mx={key:s,promise:a,token:o},await a},fetchPluginReadme:n=>{if(!K.plugins)return;const r=t(),s=r.pluginReadmes[n];s!=null||r.pluginReadmeLoading[n]||(e(i=>({pluginReadmeLoading:{...i.pluginReadmeLoading,[n]:!0}})),K.plugins.getReadme(n).then(i=>{e(o=>({pluginReadmes:{...o.pluginReadmes,[n]:i},pluginReadmeLoading:{...o.pluginReadmeLoading,[n]:!1}}))},()=>{e(i=>({pluginReadmes:{...i.pluginReadmes,[n]:null},pluginReadmeLoading:{...i.pluginReadmeLoading,[n]:!1}}))}))},mcpBrowse:async n=>{if(K.mcpRegistry){e({mcpBrowseLoading:!0,mcpBrowseError:null});try{const r=await K.mcpRegistry.browse(n);e(s=>{if(!n)return{mcpBrowseCatalog:r.servers,mcpBrowseNextCursor:r.nextCursor,mcpBrowseLoading:!1};const i=new Set(s.mcpBrowseCatalog.map(a=>a.id)),o=r.servers.filter(a=>!i.has(a.id));return{mcpBrowseCatalog:[...s.mcpBrowseCatalog,...o],mcpBrowseNextCursor:r.nextCursor,mcpBrowseLoading:!1}})}catch(r){e({mcpBrowseLoading:!1,mcpBrowseError:r instanceof Error?r.message:"Failed to browse MCP servers"})}}},mcpFetchInstalled:async n=>{if(K.mcpRegistry)try{const r=await K.mcpRegistry.getInstalled(n);e(s=>{const i=n??null,o=dT(i),a=s.mcpInstalledProjectPath===i,c=a?{mcpInstallProgress:s.mcpInstallProgress,installErrors:s.installErrors}:_2t(s.mcpInstallProgress,s.installErrors);return a||b2t(),{mcpInstalledServers:r,mcpInstalledServersByProjectPath:{...s.mcpInstalledServersByProjectPath,[o]:r},mcpInstalledProjectPath:i,mcpInstallProgress:c.mcpInstallProgress,installErrors:c.installErrors}})}catch{}},runMcpDiagnostics:async n=>{const r=K.mcpRegistry;if(!r)return;const s=dT(n),i=lY.get(s);if(i){await i;return}e(a=>({mcpDiagnosticsLoading:!0,mcpDiagnosticsError:null,mcpDiagnosticsLoadingByProjectPath:{...a.mcpDiagnosticsLoadingByProjectPath,[s]:!0},mcpDiagnosticsErrorByProjectPath:{...a.mcpDiagnosticsErrorByProjectPath,[s]:null}}));const o=(async()=>{try{const a=await r.diagnose(n),c=Object.fromEntries(a.map(d=>[UQ(d.name,d.scope),d])),l=Date.now();e({mcpDiagnostics:c,mcpDiagnosticsLoading:!1,mcpDiagnosticsByProjectPath:{...t().mcpDiagnosticsByProjectPath,[s]:c},mcpDiagnosticsLoadingByProjectPath:{...t().mcpDiagnosticsLoadingByProjectPath,[s]:!1},mcpDiagnosticsLastCheckedAt:l,mcpDiagnosticsLastCheckedAtByProjectPath:{...t().mcpDiagnosticsLastCheckedAtByProjectPath,[s]:l}})}catch(a){const c=a instanceof Error?a.message:"Failed to check MCP server health";e({mcpDiagnosticsLoading:!1,mcpDiagnosticsError:c,mcpDiagnosticsLoadingByProjectPath:{...t().mcpDiagnosticsLoadingByProjectPath,[s]:!1},mcpDiagnosticsErrorByProjectPath:{...t().mcpDiagnosticsErrorByProjectPath,[s]:c}})}finally{lY.delete(s)}})();lY.set(s,o),await o},fetchSkillsCatalog:async n=>{if(!K.skills)return;const r=y2t(n),s=++f2t;cY.set(r,s),e(i=>{const o={...i.skillsCatalogLoadingByProjectPath,[r]:!0};return{skillsCatalogLoadingByProjectPath:o,skillsCatalogErrorByProjectPath:{...i.skillsCatalogErrorByProjectPath,[r]:null},skillsLoading:dY(o),skillsError:null}});try{const i=await K.skills.list(n);if(cY.get(r)!==s)return;e(o=>({skillsCatalogLoadingByProjectPath:{...o.skillsCatalogLoadingByProjectPath,[r]:!1},skillsCatalogErrorByProjectPath:{...o.skillsCatalogErrorByProjectPath,[r]:null},skillsLoading:dY({...o.skillsCatalogLoadingByProjectPath,[r]:!1}),skillsError:null,skillsUserCatalog:i.filter(a=>a.scope==="user"),skillsProjectCatalogByProjectPath:n?{...o.skillsProjectCatalogByProjectPath,[n]:i.filter(a=>a.scope==="project")}:o.skillsProjectCatalogByProjectPath}))}catch(i){if(cY.get(r)!==s)return;const o=i instanceof Error?i.message:"Failed to load skills";e(a=>({skillsCatalogLoadingByProjectPath:{...a.skillsCatalogLoadingByProjectPath,[r]:!1},skillsCatalogErrorByProjectPath:{...a.skillsCatalogErrorByProjectPath,[r]:o},skillsLoading:dY({...a.skillsCatalogLoadingByProjectPath,[r]:!1}),skillsError:o}))}},fetchSkillDetail:async(n,r)=>{if(!K.skills)return;const s=++h2t;uY.set(n,s),e(i=>({skillsDetailLoadingById:{...i.skillsDetailLoadingById,[n]:!0},skillsDetailErrorById:{...i.skillsDetailErrorById,[n]:null}}));try{const i=await K.skills.getDetail(n,r);if(uY.get(n)!==s)return;e(o=>({skillsDetailsById:{...o.skillsDetailsById,[n]:i},skillsDetailLoadingById:{...o.skillsDetailLoadingById,[n]:!1},skillsDetailErrorById:{...o.skillsDetailErrorById,[n]:null}}))}catch(i){if(uY.get(n)!==s)return;const o=i instanceof Error?i.message:"Failed to load skill details";throw e(a=>({skillsDetailLoadingById:{...a.skillsDetailLoadingById,[n]:!1},skillsDetailErrorById:{...a.skillsDetailErrorById,[n]:o}})),i}},previewSkillUpsert:async n=>{if(!K.skills)throw new Error("Skills API is not available");e({skillsMutationLoading:!0,skillsMutationError:null});try{const r=await K.skills.previewUpsert(n);return e({skillsMutationLoading:!1}),r}catch(r){const s=r instanceof Error?r.message:"Failed to review skill changes";throw e({skillsMutationLoading:!1,skillsMutationError:s}),r}},applySkillUpsert:async n=>{if(!K.skills)throw new Error("Skills API is not available");e({skillsMutationLoading:!0,skillsMutationError:null});try{const r=await K.skills.applyUpsert(n);return await t().fetchSkillsCatalog(n.projectPath),e(s=>({skillsMutationLoading:!1,skillsDetailsById:r?.item.id?{...s.skillsDetailsById,[r.item.id]:r}:s.skillsDetailsById})),r}catch(r){const s=r instanceof Error?r.message:"Failed to save skill";throw e({skillsMutationLoading:!1,skillsMutationError:s}),r}},previewSkillImport:async n=>{if(!K.skills)throw new Error("Skills API is not available");e({skillsMutationLoading:!0,skillsMutationError:null});try{const r=await K.skills.previewImport(n);return e({skillsMutationLoading:!1}),r}catch(r){const s=r instanceof Error?r.message:"Failed to review import changes";throw e({skillsMutationLoading:!1,skillsMutationError:s}),r}},applySkillImport:async n=>{if(!K.skills)throw new Error("Skills API is not available");e({skillsMutationLoading:!0,skillsMutationError:null});try{const r=await K.skills.applyImport(n);return await t().fetchSkillsCatalog(n.projectPath),e(s=>({skillsMutationLoading:!1,skillsDetailsById:r?.item.id?{...s.skillsDetailsById,[r.item.id]:r}:s.skillsDetailsById})),r}catch(r){const s=r instanceof Error?r.message:"Failed to import skill";throw e({skillsMutationLoading:!1,skillsMutationError:s}),r}},deleteSkill:async n=>{if(!K.skills)throw new Error("Skills API is not available");e({skillsMutationLoading:!0,skillsMutationError:null});try{await K.skills.deleteSkill(n),await t().fetchSkillsCatalog(n.projectPath),e(r=>{const s={...r.skillsDetailsById};return delete s[n.skillId],{skillsMutationLoading:!1,skillsDetailsById:s}})}catch(r){const s=r instanceof Error?r.message:"Failed to delete skill";throw e({skillsMutationLoading:!1,skillsMutationError:s}),r}},installPlugin:async n=>{if(!K.plugins)return;const r=t().pluginCatalogProjectPath??void 0,s=n.scope!=="user"?n.projectPath??t().pluginCatalogProjectPath??void 0:n.projectPath,i=BOe(n.pluginId,n.scope,s),o=s===n.projectPath?n:{...n,projectPath:s},a=t();if(a.cliStatus===null)try{await G_(a)}catch{}const c=P1(t()),l=o.scope!=="user"&&!o.projectPath?HOe:FO({isInstalled:!1,...c,section:"plugins"});if(l){xh(i),e(d=>({pluginInstallProgress:{...d.pluginInstallProgress,[i]:"error"},installErrors:{...d.installErrors,[i]:l}}));return}xh(i),e(d=>({pluginInstallProgress:{...d.pluginInstallProgress,[i]:"pending"},installErrors:{...d.installErrors,[i]:""}}));try{const d=await K.plugins.install(o);if(d.state==="error"){e(p=>({pluginInstallProgress:{...p.pluginInstallProgress,[i]:"error"},installErrors:{...p.installErrors,[i]:d.error??"Install failed"}}));return}e(p=>({pluginInstallProgress:{...p.pluginInstallProgress,[i]:"success"}})),t().fetchPluginCatalog(o.scope!=="user"?o.projectPath:r,!0),GOe(i,e)}catch(d){xh(i);const p=d instanceof Error?d.message:"Install failed";e(f=>({pluginInstallProgress:{...f.pluginInstallProgress,[i]:"error"},installErrors:{...f.installErrors,[i]:p}}))}},uninstallPlugin:async(n,r,s)=>{if(!K.plugins)return;const i=t().pluginCatalogProjectPath??void 0,o=r??"user",a=o!=="user"?s??t().pluginCatalogProjectPath??void 0:s,c=BOe(n,o,a);if(o!=="user"&&!a){xh(c),e(p=>({pluginInstallProgress:{...p.pluginInstallProgress,[c]:"error"},installErrors:{...p.installErrors,[c]:HOe}}));return}const l=t();if(l.cliStatus===null)try{await G_(l)}catch{}const d=FO({isInstalled:!0,...P1(t()),section:"plugins"});if(d){xh(c),e(p=>({pluginInstallProgress:{...p.pluginInstallProgress,[c]:"error"},installErrors:{...p.installErrors,[c]:d}}));return}xh(c),e(p=>({pluginInstallProgress:{...p.pluginInstallProgress,[c]:"pending"}}));try{const p=await K.plugins.uninstall(n,r,a);if(p.state==="error"){e(f=>({pluginInstallProgress:{...f.pluginInstallProgress,[c]:"error"},installErrors:{...f.installErrors,[c]:p.error??"Uninstall failed"}}));return}e(f=>({pluginInstallProgress:{...f.pluginInstallProgress,[c]:"success"}})),t().fetchPluginCatalog(o!=="user"?a:i,!0),GOe(c,e)}catch(p){xh(c);const f=p instanceof Error?p.message:"Uninstall failed";e(h=>({pluginInstallProgress:{...h.pluginInstallProgress,[c]:"error"},installErrors:{...h.installErrors,[c]:f}}))}},installMcpServer:async n=>{const r=JR(n.registryId,n.scope,n.projectPath);if(!K.mcpRegistry){cu(r),e(o=>({mcpInstallProgress:{...o.mcpInstallProgress,[r]:"error"},installErrors:{...o.installErrors,[r]:"MCP Registry not available"}}));return}const s=t();if(s.cliStatus===null)try{await G_(s)}catch{}const i=FO({isInstalled:!1,...P1(t()),section:"mcp"});if(i){cu(r),e(o=>({mcpInstallProgress:{...o.mcpInstallProgress,[r]:"error"},installErrors:{...o.installErrors,[r]:i}}));return}cu(r),e(o=>({mcpInstallProgress:{...o.mcpInstallProgress,[r]:"pending"}}));try{const o=await K.mcpRegistry.install(n);if(o.state==="error"){e(a=>({mcpInstallProgress:{...a.mcpInstallProgress,[r]:"error"},installErrors:{...a.installErrors,[r]:o.error??"Install failed"}}));return}await Promise.all([t().mcpFetchInstalled(n.projectPath),t().runMcpDiagnostics(n.projectPath)]),e(a=>({mcpInstallProgress:{...a.mcpInstallProgress,[r]:"success"}})),pY(r,e)}catch(o){cu(r);const a=o instanceof Error?o.message:"Install failed";e(c=>({mcpInstallProgress:{...c.mcpInstallProgress,[r]:"error"},installErrors:{...c.installErrors,[r]:a}}))}},installCustomMcpServer:async n=>{const r=n.scope,s=g2t(n.serverName,r,n.projectPath);try{if(!K.mcpRegistry)throw new Error("MCP Registry not available");const i=t();if(i.cliStatus===null)try{await G_(i)}catch{}const o=FO({isInstalled:!1,...P1(t()),section:"mcp"});if(o)throw new Error(o);cu(s),e(c=>({mcpInstallProgress:{...c.mcpInstallProgress,[s]:"pending"}}));const a=await K.mcpRegistry.installCustom(n);if(a.state==="error")throw new Error(a.error??"Install failed");await Promise.all([t().mcpFetchInstalled(n.projectPath),t().runMcpDiagnostics(n.projectPath)]),e(c=>({mcpInstallProgress:{...c.mcpInstallProgress,[s]:"success"}})),pY(s,e)}catch(i){cu(s);const o=i instanceof Error?i.message:"Install failed";throw e(a=>({mcpInstallProgress:{...a.mcpInstallProgress,[s]:"error"},installErrors:{...a.installErrors,[s]:o}})),i instanceof Error?i:new Error(o)}},uninstallMcpServer:async(n,r,s,i)=>{const o=s==="global"||s==="user"||bu(s)?s:"user",a=JR(n,o,i);if(!K.mcpRegistry){cu(a),e(d=>({mcpInstallProgress:{...d.mcpInstallProgress,[a]:"error"},installErrors:{...d.installErrors,[a]:"MCP Registry not available"}}));return}const c=t();if(c.cliStatus===null)try{await G_(c)}catch{}const l=FO({isInstalled:!0,...P1(t()),section:"mcp"});if(l){cu(a),e(d=>({mcpInstallProgress:{...d.mcpInstallProgress,[a]:"error"},installErrors:{...d.installErrors,[a]:l}}));return}cu(a),e(d=>({mcpInstallProgress:{...d.mcpInstallProgress,[a]:"pending"}}));try{const d=await K.mcpRegistry.uninstall(r,s,i);if(d.state==="error"){e(p=>({mcpInstallProgress:{...p.mcpInstallProgress,[a]:"error"},installErrors:{...p.installErrors,[a]:d.error??"Uninstall failed"}}));return}await Promise.all([t().mcpFetchInstalled(i),t().runMcpDiagnostics(i)]),e(p=>({mcpInstallProgress:{...p.mcpInstallProgress,[a]:"success"}})),pY(a,e)}catch(d){cu(a);const p=d instanceof Error?d.message:"Uninstall failed";e(f=>({mcpInstallProgress:{...f.mcpInstallProgress,[a]:"error"},installErrors:{...f.installErrors,[a]:p}}))}},fetchApiKeys:async()=>{if(K.apiKeys){e({apiKeysLoading:!0,apiKeysError:null});try{const n=await K.apiKeys.list();e({apiKeys:n,apiKeysLoading:!1})}catch(n){e({apiKeysLoading:!1,apiKeysError:n instanceof Error?n.message:"Failed to load API keys"})}}},fetchApiKeyStorageStatus:async()=>{if(K.apiKeys)try{const n=await K.apiKeys.getStorageStatus();e({apiKeyStorageStatus:n})}catch{}},saveApiKey:async n=>{if(K.apiKeys){e({apiKeySaving:!0,apiKeysError:null});try{const r=await K.apiKeys.save(n),s=[];try{const o=await K.apiKeys.list();e({apiKeys:o})}catch(o){s.push(o instanceof Error?`API key saved, but failed to refresh key list. ${o.message}`:"API key saved, but failed to refresh key list."),e(a=>({apiKeys:x2t(a.apiKeys,r)}))}await G_(t());const i=t().cliStatusError;i&&s.push(`API key saved, but failed to refresh provider status. ${i}`),e({apiKeySaving:!1,apiKeysError:s.length>0?s.join(" "):null})}catch(r){throw e({apiKeySaving:!1,apiKeysError:r instanceof Error?r.message:"Failed to save API key"}),r}}},deleteApiKey:async n=>{if(K.apiKeys)try{await K.apiKeys.delete(n),e(s=>({apiKeys:s.apiKeys.filter(i=>i.id!==n)})),await G_(t());const r=t().cliStatusError;e({apiKeysError:r?`API key deleted, but failed to refresh provider status. ${r}`:null})}catch(r){throw e({apiKeysError:r instanceof Error?r.message:"Failed to delete API key"}),r}},openExtensionsTab:()=>{const n=t(),r=n.selectedProjectId??n.activeProjectId??void 0,i=n.paneLayout.panes.find(o=>o.id===n.paneLayout.focusedPaneId)?.tabs.find(o=>o.type==="extensions");if(i){if(i.projectId!==r||i.label!=="扩展"){const o=kh(n.paneLayout,i.id);o&&e({paneLayout:eo(n.paneLayout,{...o,tabs:o.tabs.map(a=>a.id===i.id?{...a,label:"扩展",projectId:r}:a)})})}n.setActiveTab(i.id);return}n.openTab({type:"extensions",label:"扩展",projectId:r})},fetchMcpGitHubStars:n=>{!K.mcpRegistry||n.length===0||K.mcpRegistry.githubStars(n).then(r=>{Object.keys(r).length>0&&e(s=>({mcpGitHubStars:{...s.mcpGitHubStars,...r}}))}).catch(()=>{})}}),ZOe=50;function pZ(e,t){return e.find(n=>n.type==="session"&&n.sessionId===t)}function eXe(e,t,n){return e.find(r=>r.type==="session"&&r.sessionId===t&&r.projectId===n)}function fZ(e){return e.length<=ZOe?e:e.slice(0,ZOe-1)+"…"}function v2t(e,t="notification",n){return{id:crypto.randomUUID(),kind:"error",source:t,highlight:n??"red",payload:e}}function KOe(e){return{id:crypto.randomUUID(),kind:"search",source:"commandPalette",highlight:"yellow",payload:e}}function T2t(e){return e.kind==="error"}function E2t(e){return e.kind==="search"}const fI=Hi("Store:notification"),w2t=200,k2t=(e,t)=>({notifications:[],unreadCount:0,notificationsLoading:!1,notificationsError:null,fetchNotifications:async()=>{e({notificationsLoading:!0,notificationsError:null});try{const n=await K.notifications.get({limit:w2t,offset:0}),r=n.notifications||[],s=typeof n.unreadCount=="number"&&Number.isFinite(n.unreadCount)?Math.max(0,Math.floor(n.unreadCount)):r.filter(i=>!i.isRead).length;e({notifications:r,unreadCount:s,notificationsLoading:!1})}catch(n){e({notificationsError:n instanceof Error?n.message:"Failed to fetch notifications",notificationsLoading:!1})}},markNotificationRead:async n=>{try{if(!await K.notifications.markRead(n)){await t().fetchNotifications();return}e(s=>{const i=s.notifications.map(a=>a.id===n?{...a,isRead:!0}:a),o=i.filter(a=>!a.isRead).length;return{notifications:i,unreadCount:o}})}catch(r){fI.error("Failed to mark notification as read:",r)}},markAllNotificationsRead:async n=>{try{if(n!==void 0){const{notifications:r}=t(),s=r.filter(a=>(a.triggerName??"Other")===n&&!a.isRead);if(s.length===0)return;if((await Promise.all(s.map(a=>K.notifications.markRead(a.id)))).some(a=>!a)){await t().fetchNotifications();return}const o=new Set(s.map(a=>a.id));e(a=>{const c=a.notifications.map(l=>o.has(l.id)?{...l,isRead:!0}:l);return{notifications:c,unreadCount:c.filter(l=>!l.isRead).length}})}else{if(!await K.notifications.markAllRead()){await t().fetchNotifications();return}e(s=>({notifications:s.notifications.map(i=>({...i,isRead:!0})),unreadCount:0}))}}catch(r){fI.error("Failed to mark all notifications as read:",r)}},deleteNotification:async n=>{try{if(!await K.notifications.delete(n)){await t().fetchNotifications();return}e(s=>{const i=s.notifications.filter(a=>a.id!==n),o=i.filter(a=>!a.isRead).length;return{notifications:i,unreadCount:o}})}catch(r){fI.error("Failed to delete notification:",r)}},clearNotifications:async n=>{try{if(n!==void 0){const{notifications:r}=t(),s=r.filter(a=>(a.triggerName??"Other")===n);if(s.length===0)return;if((await Promise.all(s.map(a=>K.notifications.delete(a.id)))).some(a=>!a)){await t().fetchNotifications();return}const o=new Set(s.map(a=>a.id));e(a=>{const c=a.notifications.filter(l=>!o.has(l.id));return{notifications:c,unreadCount:c.filter(l=>!l.isRead).length}})}else{if(!await K.notifications.clear()){await t().fetchNotifications();return}e({notifications:[],unreadCount:0})}}catch(r){fI.error("Failed to clear notifications:",r)}},navigateToError:n=>{const r=t();if(r.markNotificationRead(n.id),n.sessionId.startsWith("team:")){const a=n.sessionId.slice(5);r.openTeamTab(a,n.context.cwd);return}const s=v2t({errorId:n.id,errorTimestamp:n.timestamp,toolUseId:n.toolUseId,subagentId:n.subagentId,lineNumber:n.lineNumber},"notification",n.triggerColor),i=fu(r.paneLayout),o=eXe(i,n.sessionId,n.projectId);if(o)r.setActiveTab(o.id),r.enqueueTabNavigation(o.id,s);else{r.openTab({type:"session",label:"Loading...",projectId:n.projectId,sessionId:n.sessionId});const a=t().activeTabId;a&&(r.enqueueTabNavigation(a,s),t().setActiveTab(a))}},openNotificationsTab:()=>{const n=t(),s=n.paneLayout.panes.find(i=>i.id===n.paneLayout.focusedPaneId)?.tabs.find(i=>i.type==="notifications");if(s){n.setActiveTab(s.id),n.fetchNotifications();return}n.openTab({type:"notifications",label:"Notifications"})}}),CL=4;function Ox(e){const t=Kje(e);return{paneLayout:e,openTabs:t.openTabs,activeTabId:t.activeTabId,selectedTabIds:t.selectedTabIds}}const C2t=(e,t)=>({paneLayout:{panes:[{id:"pane-default",tabs:[],activeTabId:null,selectedTabIds:[],widthFraction:1}],focusedPaneId:"pane-default"},focusPane:n=>{const r=t(),{paneLayout:s}=r;if(s.focusedPaneId===n)return;const i=Ql(s,n);if(!i)return;const o={...s,focusedPaneId:n};e(Ox(o)),i.activeTabId&&t().setActiveTab(i.activeTabId)},splitPane:(n,r,s)=>{const i=t(),{paneLayout:o}=i;if(o.panes.length>=CL)return;const a=Ql(o,n);if(!a)return;const c=a.tabs.find(O=>O.id===r);if(!c)return;const l=a.tabs.filter(O=>O.id!==r);let d=a.activeTabId;if(a.activeTabId===r){const O=a.tabs.findIndex(_=>_.id===r);d=l[O]?.id??l[O-1]?.id??null}const p={...a,tabs:l,activeTabId:d,selectedTabIds:a.selectedTabIds.filter(O=>O!==r)},f=crypto.randomUUID(),h={...VOe(f),tabs:[c],activeTabId:c.id};let m=eo(o,p);l.length===0&&o.panes.length>1&&(m=qw(m,n)),m=YOe(m,p.id!==n?o.panes[0].id:n,h,s),m={...m,focusedPaneId:f},e(Ox(m)),c.type==="session"&&t().setActiveTab(c.id)},closePane:n=>{const r=t(),{paneLayout:s}=r;if(s.panes.length<=1)return;const i=Ql(s,n);if(!i)return;for(const c of i.tabs)r.cleanupTabUIState(c.id),r.cleanupTabSessionData(c.id);const o=qw(s,n);e(Ox(o));const a=Ql(o,o.focusedPaneId);a?.activeTabId&&t().setActiveTab(a.activeTabId)},moveTabToPane:(n,r,s,i)=>{const o=t(),{paneLayout:a}=o;if(r===s)return;const c=Ql(a,r),l=Ql(a,s);if(!c||!l)return;const d=c.tabs.find(O=>O.id===n);if(!d)return;const p=c.tabs.filter(O=>O.id!==n);let f=c.activeTabId;if(c.activeTabId===n){const O=c.tabs.findIndex(_=>_.id===n);f=p[O]?.id??p[O-1]?.id??null}const h=[...l.tabs];i!==void 0&&i>=0&&i<=h.length?h.splice(i,0,d):h.push(d);let m=eo(a,{...c,tabs:p,activeTabId:f,selectedTabIds:c.selectedTabIds.filter(O=>O!==n)});m=eo(m,{...l,tabs:h,activeTabId:d.id}),p.length===0&&m.panes.length>1&&(m=qw(m,r)),m={...m,focusedPaneId:s},e(Ox(m))},moveTabToNewPane:(n,r,s,i)=>{const o=t(),{paneLayout:a}=o;if(a.panes.length>=CL)return;const c=Ql(a,r);if(!c)return;const l=c.tabs.find(O=>O.id===n);if(!l)return;const d=c.tabs.filter(O=>O.id!==n);let p=c.activeTabId;if(c.activeTabId===n){const O=c.tabs.findIndex(_=>_.id===n);p=d[O]?.id??d[O-1]?.id??null}const f=crypto.randomUUID(),h={...VOe(f),tabs:[l],activeTabId:l.id};let m=eo(a,{...c,tabs:d,activeTabId:p,selectedTabIds:c.selectedTabIds.filter(O=>O!==n)});d.length===0&&m.panes.length>1&&(m=qw(m,r)),m=YOe(m,s,h,i),m={...m,focusedPaneId:f},e(Ox(m))},reorderTabInPane:(n,r,s)=>{const{paneLayout:i}=t(),o=Ql(i,n);if(!o||r<0||r>=o.tabs.length||s<0||s>=o.tabs.length||r===s)return;const a=[...o.tabs],[c]=a.splice(r,1);a.splice(s,0,c);const l=eo(i,{...o,tabs:a});e(Ox(l))},resizePanes:(n,r)=>{const{paneLayout:s}=t(),i=s.panes.findIndex(h=>h.id===n);if(i===-1||i>=s.panes.length-1)return;const o=.1,a=Math.max(o,Math.min(1-o*(s.panes.length-1),r)),c=s.panes[i],l=s.panes[i+1],p=c.widthFraction+l.widthFraction-a;if(p<o)return;const f=s.panes.map((h,m)=>m===i?{...h,widthFraction:a}:m===i+1?{...h,widthFraction:p}:h);e({paneLayout:{...s,panes:f}})},getPaneForTab:n=>kh(t().paneLayout,n)?.id??null,getAllPaneTabs:()=>fu(t().paneLayout)}),R2t=(e,t)=>({projects:[],selectedProjectId:null,projectsLoading:!1,projectsError:null,fetchProjects:async()=>{if(!t().projectsLoading){e({projectsLoading:!0,projectsError:null});try{const r=[...await K.getProjects()].sort((s,i)=>(i.mostRecentSession??0)-(s.mostRecentSession??0));e({projects:r,projectsLoading:!1})}catch(n){e({projectsError:n instanceof Error?n.message:"Failed to fetch projects",projectsLoading:!1})}}},selectProject:n=>{e({selectedProjectId:n,...Xh()}),t().fetchSessionsInitial(n)}}),fY=Hi("Store:repository"),P2t=3e4;async function $2t(e,t,n){let r=null;const s=new Promise((i,o)=>{r=setTimeout(()=>o(new Error(`${n} timed out after ${t}ms`)),t)});try{return await Promise.race([e,s])}finally{r&&clearTimeout(r)}}const N2t=(e,t)=>({repositoryGroups:[],selectedRepositoryId:null,selectedWorktreeId:null,repositoryGroupsLoading:!1,repositoryGroupsError:null,viewMode:"grouped",fetchRepositoryGroups:async()=>{if(t().repositoryGroupsLoading)return;const n=Date.now();e({repositoryGroupsLoading:!0,repositoryGroupsError:null});try{const r=await $2t(K.getRepositoryGroups(),P2t,"get-repository-groups");e({repositoryGroups:r,repositoryGroupsLoading:!1});const s=Date.now()-n;s>=2e3&&fY.warn(`fetchRepositoryGroups slow ms=${s} count=${r.length}`)}catch(r){const s=Date.now()-n;fY.warn(`fetchRepositoryGroups failed ms=${s}: ${r instanceof Error?r.message:String(r)}`),e({repositoryGroupsError:r instanceof Error?r.message:"Failed to fetch repository groups",repositoryGroupsLoading:!1})}},selectRepository:n=>{const{repositoryGroups:r}=t(),s=r.find(a=>a.id===n);if(!s){fY.warn("Repository not found:",n);return}const o=s.worktrees.find(a=>a.isMainWorktree)??s.worktrees[0];o?(e({selectedRepositoryId:n,selectedWorktreeId:o.id,selectedProjectId:o.id,activeProjectId:o.id,...Xh()}),t().fetchSessionsInitial(o.id)):e({selectedRepositoryId:n,selectedWorktreeId:null,...Xh()})},selectWorktree:n=>{e({selectedWorktreeId:n,selectedProjectId:n,activeProjectId:n,...Xh()}),t().fetchSessionsInitial(n)},setViewMode:n=>{e({viewMode:n,selectedRepositoryId:null,selectedWorktreeId:null,selectedProjectId:null,...Xh()}),n==="grouped"?t().fetchRepositoryGroups():t().fetchProjects()}}),hI=Hi("scheduleSlice"),A2t=(e,t)=>({schedules:[],schedulesLoading:!1,schedulesError:null,scheduleRuns:{},scheduleRunsLoading:{},async fetchSchedules(){if(!t().schedulesLoading){e({schedulesLoading:!0,schedulesError:null});try{const n=await K.schedules.list();e({schedules:n,schedulesLoading:!1})}catch(n){const r=n instanceof Error?n.message:"Failed to fetch schedules";hI.error("fetchSchedules failed:",r),e({schedulesError:r,schedulesLoading:!1})}}},async createSchedule(n){const r=await K.schedules.create(n);return e(s=>({schedules:[...s.schedules,r]})),r},async updateSchedule(n,r){const s=await K.schedules.update(n,r);return e(i=>({schedules:i.schedules.map(o=>o.id===n?s:o)})),s},async deleteSchedule(n){const r=t().schedules,s=t().scheduleRuns;e(i=>({schedules:i.schedules.filter(o=>o.id!==n),scheduleRuns:Object.fromEntries(Object.entries(i.scheduleRuns).filter(([o])=>o!==n)),schedulesError:null}));try{await K.schedules.delete(n)}catch(i){const o=i instanceof Error?i.message:"删除计划失败";throw hI.error("deleteSchedule failed:",o),e({schedules:r,scheduleRuns:s,schedulesError:o,schedulesLoading:!1}),await t().fetchSchedules(),i}e(i=>({schedules:i.schedules.filter(o=>o.id!==n),scheduleRuns:Object.fromEntries(Object.entries(i.scheduleRuns).filter(([o])=>o!==n)),schedulesError:null})),e({schedulesLoading:!1}),await t().fetchSchedules(),window.setTimeout(()=>{t().fetchSchedules()},800)},async pauseSchedule(n){await K.schedules.pause(n),e(r=>({schedules:r.schedules.map(s=>s.id===n?{...s,status:"paused",updatedAt:new Date().toISOString()}:s)})),await t().fetchSchedules()},async resumeSchedule(n){await K.schedules.resume(n),e(r=>({schedules:r.schedules.map(s=>s.id===n?{...s,status:"active",updatedAt:new Date().toISOString()}:s)})),await t().fetchSchedules()},async triggerNow(n){const r=new Date().toISOString();e(i=>({scheduleRuns:{...i.scheduleRuns,[n]:[{id:`pending-${Date.now()}`,scheduleId:n,teamName:i.schedules.find(o=>o.id===n)?.teamName??"",status:"running",scheduledFor:r,startedAt:r,executionStartedAt:r,retryCount:0,summary:"正在触发 cc-connect runtime..."},...i.scheduleRuns[n]??[]]}}));const s=await K.schedules.triggerNow(n);return e(i=>({scheduleRuns:{...i.scheduleRuns,[n]:[s,...(i.scheduleRuns[n]??[]).filter(o=>!o.id.startsWith("pending-"))]}})),s},async fetchRunHistory(n){if(!t().scheduleRunsLoading[n]){e(r=>({scheduleRunsLoading:{...r.scheduleRunsLoading,[n]:!0}}));try{const r=await K.schedules.getRuns(n);e(s=>({scheduleRuns:{...s.scheduleRuns,[n]:r},scheduleRunsLoading:{...s.scheduleRunsLoading,[n]:!1}}))}catch(r){hI.error(`fetchRunHistory(${n}) failed:`,r),e(s=>({scheduleRunsLoading:{...s.scheduleRunsLoading,[n]:!1}}))}}},async applyScheduleChange(n){try{const r=await K.schedules.get(n);if(e(s=>r?{schedules:s.schedules.some(o=>o.id===n)?s.schedules.map(o=>o.id===n?r:o):[...s.schedules,r]}:{schedules:s.schedules.filter(o=>o.id!==n)}),t().scheduleRuns[n]){const s=await K.schedules.getRuns(n);e(i=>({scheduleRuns:{...i.scheduleRuns,[n]:s}}))}}catch(r){hI.error("applyScheduleChange failed:",r)}},openSchedulesTab:()=>{const n=t(),s=n.paneLayout.panes.find(i=>i.id===n.paneLayout.focusedPaneId)?.tabs.find(i=>i.type==="schedules");if(s){n.setActiveTab(s.id);return}n.openTab({type:"schedules",label:"Schedules"}),t().fetchSchedules()}});function I2t(e){return"chunkType"in e&&e.chunkType==="ai"}function M2t(e){return I2t(e)&&"semanticSteps"in e}function Q2t(e){return e.type==="assistant"}function D2t(e){return"chunkType"in e&&e.chunkType==="user"&&"rawMessages"in e}function L2t(e){return"chunkType"in e&&e.chunkType==="system"&&"rawMessages"in e}function j2t(e){return"chunkType"in e&&e.chunkType==="compact"&&"rawMessages"in e}function X2t(e){return"chunkType"in e&&"rawMessages"in e}function pT(e){return e.length===0?[]:X2t(e[0])?e:null}const rz=/[\\/]/;function bc(e){const t=e.split(rz);return t[t.length-1]||""}function U2t(e){return e.split(rz).filter(Boolean)[0]??""}function z2t(e){return e.split(rz).filter(Boolean)}function B2t(e){return rz.test(e)}function F2t(e){return/^\.\.?[\\/]/.test(e)}const Y2t=Hi("Util:groupTransformer"),JOe=/\/([a-z][a-z-]{0,50})(?:\s+(\S[^\n]{0,1000}))?$/gim,ege=100;function nP(e,t,n=!1){if(!e||e.length===0)return{sessionId:"",items:[],totalUserGroups:0,totalSystemGroups:0,totalAIGroups:0,totalCompactGroups:0};const r=[];let s=0,i=0,o=0,a=0;for(const l of e)if(D2t(l))r.push({type:"user",group:V2t(l,s++)});else if(L2t(l))r.push({type:"system",group:eDt(l)}),i++;else if(M2t(l))r.push({type:"ai",group:nDt(l,o)}),o++;else if(j2t(l))r.push({type:"compact",group:tDt(l)}),a++;else{const d="chunkType"in l?l.chunkType:"unknown";Y2t.warn("Unhandled chunk type:",d)}let c=1;for(let l=0;l<r.length;l++)if(r[l].type==="compact"){c++;const d=r[l];d.group.startingPhaseNumber=c;const p=oDt(r,l),f=aDt(r,l);if(p&&f){const h=lDt(p),m=cDt(f);h!==void 0&&m!==void 0&&(d.group.tokenDelta={preCompactionTokens:h,postCompactionTokens:m,delta:m-h})}}if(n&&o>0)for(let l=r.length-1;l>=0;l--){const d=r[l];if(d.type==="ai"){d.group.status!=="interrupted"&&(d.group.isOngoing=!0,d.group.status="in_progress");break}}return{sessionId:e[0]?.id??"unknown",items:r,totalUserGroups:s,totalSystemGroups:i,totalAIGroups:o,totalCompactGroups:a}}function V2t(e,t){return q2t(e.userMessage,t)}function q2t(e,t){const n=W2t(e);return{id:`user-${e.uuid}`,message:e,timestamp:e.timestamp,content:n,index:t}}function W2t(e){let t="";const n=[],r=[];if(typeof e.content=="string")t=e.content;else if(Array.isArray(e.content))for(const c of e.content)c.type==="text"&&c.text&&(t+=c.text);const s=Pvt(t),i=PU(t),o=i?[]:G2t(s);r.push(...kse(s));let a=s;if(!i)for(const c of o)a=a.replace(c.raw,"").trim();return{text:a||void 0,rawText:s,commands:o,images:n,fileReferences:r}}function G2t(e){if(!e)return[];const t=[];let n;for(JOe.lastIndex=0;(n=JOe.exec(e))!==null;){const[r,s,i]=n;t.push({name:s,args:i?.trim(),raw:r,startIndex:n.index,endIndex:n.index+r.length})}return t}const H2t=new Set(["src","apps","app","lib","types","packages","components","utils","services","hooks","store","public","assets","config","tests","test","specs","spec","e2e","docs","scripts","screens","features","pages","views","models","controllers","routes","middleware","api","common","core","modules","client","server","web","mobile","native","electron","node_modules"]),Z2t=/[\s,)}\]]/;function K2t(e){if(/^[A-Za-z]:[\\/]/.test(e)||e.startsWith("\\\\")||F2t(e))return!0;const t=U2t(e);return!!(H2t.has(t)||B2t(e)&&e.length>2&&(z2t(e).length>2||/\.[a-zA-Z0-9]+$/.test(e)))}function J2t(e,t){const n=t+1,r=e[n];if(!r)return null;let s="",i=n;if(r==='"'||r==="'"){const o=r,a=n+1,c=e.indexOf(o,a);if(c<0)return null;s=e.slice(a,c),i=c+1}else{for(;i<e.length&&!Z2t.test(e[i]);)i+=1;s=e.slice(n,i)}return!s||!K2t(s)?null:{path:s,raw:e.slice(t,i),startIndex:t,endIndex:i}}function wse(e){if(!e)return[];const t=[];let n=0;for(;n<e.length;){const r=e.indexOf("@",n);if(r<0)break;const s=J2t(e,r);s?(t.push(s),n=s.endIndex):n=r+1}return t}function kse(e){return wse(e).map(({path:t,raw:n})=>({path:t,raw:n}))}function eDt(e){return{id:e.id,message:e.message,timestamp:e.startTime,commandOutput:e.commandOutput}}function tDt(e){return{id:e.id,timestamp:e.startTime,message:e.message}}function nDt(e,t){const n=e.semanticSteps,r=n.length>0?n[0].startTime:e.startTime,s=n.length>0?n[n.length-1].endTime??n[n.length-1].startTime:e.endTime,i=s.getTime()-r.getTime(),o=e.responses.find(d=>Q2t(d))??null,a=rDt(n,o),c=sDt(n),l=iDt(n);return{id:e.id,turnIndex:t,startTime:r,endTime:s,durationMs:i,steps:n,tokens:a,summary:c,status:l,processes:e.processes,chunkId:e.id,metrics:e.metrics,responses:e.responses}}function rDt(e,t){let n=0,r=0,s=0,i=0;for(const o of e)o.tokens&&(n+=o.tokens.input??0,r+=o.tokens.output??0,s+=o.tokens.cached??0),o.tokenBreakdown&&(n+=o.tokenBreakdown.input??0,r+=o.tokenBreakdown.output??0,s+=o.tokenBreakdown.cacheRead??0),o.type==="thinking"&&o.tokens?.output&&(i+=o.tokens.output);return t?.usage&&(n=t.usage.input_tokens??0,r=t.usage.output_tokens??0,s=t.usage.cache_read_input_tokens??0),{input:n,output:r,cached:s,thinking:i}}function sDt(e){let t,n=0,r=0,s=0,i=0,o=0,a=0,c=0;for(const l of e){if(!t&&l.type==="thinking"&&l.content.thinkingText){const d=l.content.thinkingText;t=d.length>ege?d.slice(0,ege)+"...":d}l.type==="tool_call"&&n++,l.type==="output"&&r++,l.type==="subagent"&&s++,i+=l.durationMs??0,l.tokens&&(o+=(l.tokens.input??0)+(l.tokens.output??0),a+=l.tokens.output??0,c+=l.tokens.cached??0),l.tokenBreakdown&&(o+=l.tokenBreakdown.input+l.tokenBreakdown.output,a+=l.tokenBreakdown.output,c+=l.tokenBreakdown.cacheRead)}return{thinkingPreview:t,toolCallCount:n,outputMessageCount:r,subagentCount:s,totalDurationMs:i,totalTokens:o,outputTokens:a,cachedTokens:c}}function iDt(e){return e.length===0?"error":e.some(s=>s.type==="interruption")?"interrupted":e.some(s=>s.type==="tool_result"&&s.content.isError)?"error":e.some(s=>!s.endTime)?"in_progress":"complete"}function oDt(e,t){for(let n=t-1;n>=0;n--)if(e[n].type==="ai")return e[n].group;return null}function aDt(e,t){for(let n=t+1;n<e.length;n++)if(e[n].type==="ai")return e[n].group;return null}function lDt(e){const t=e.responses||[];for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.type==="assistant"&&r.usage)return(r.usage.input_tokens??0)+(r.usage.output_tokens??0)+(r.usage.cache_read_input_tokens??0)+(r.usage.cache_creation_input_tokens??0)}}function cDt(e){const t=e.responses||[];for(const n of t)if(n.type==="assistant"&&n.usage)return(n.usage.input_tokens??0)+(n.usage.output_tokens??0)+(n.usage.cache_read_input_tokens??0)+(n.usage.cache_creation_input_tokens??0)}const tXe=500,uDt="CLAUDE.md",tge="project-memory";function Mp(e){let t=0;for(let r=0;r<e.length;r++){const s=e.charCodeAt(r);t=(t<<5)-t+s,t=t&t}return`cmd-${Math.abs(t).toString(16)}`}function Qp(e,t){return e}function Cse(e){return e.startsWith("/")||e.startsWith("\\\\")||/^[a-zA-Z]:[\\/]/.test(e)}function kS(e,t){if(Cse(t))return t;const n=dDt(e);let r=t;r.startsWith("@")&&(r=r.slice(1)),r.startsWith("./")&&(r=r.slice(2));const s=n.includes("\\")?"\\":"/",i=n.startsWith("/"),o=n.startsWith("\\\\"),a=pDt(r,s),c=fDt(n);let l=a;for(;l.startsWith(`..${s}`);)l=l.slice(3),c.length>1&&c.pop();let d=c.join(s);return i&&!d.startsWith("/")&&(d=`/${d}`),o&&!d.startsWith("\\\\")&&(d=`\\\\${d}`),l?`${d}${s}${l}`:d}function dDt(e){let t=e.length;for(;t>0;){const n=e[t-1];if(n!=="/"&&n!=="\\")break;t--}return e.slice(0,t)}function pDt(e,t){let n="",r=!1;for(const s of e)s==="/"||s==="\\"?(r||(n+=t),r=!0):(n+=s,r=!1);return n}function fDt(e){return el(e)}function RO(e){return e.replace(/\\/g,"/")}function hDt(e){const t=I0(e);return t===-1?"":e.slice(0,t)}function mDt(e){const t=I0(e);return t<=0?null:e.slice(0,t)}function ODt(e,t){const n=RO(e).replace(/\/$/,""),r=RO(t).replace(/\/$/,"");return r===n||r.startsWith(n+"/")}function nXe(e){const t=[];for(const n of e)if(n.type==="tool_call"&&n.content.toolName==="Read"){const r=n.content.toolInput;r&&typeof r.file_path=="string"&&t.push(r.file_path)}return t}function rXe(e,t){if(!e)return[];const n=e.content.fileReferences||[],r=[];for(const s of n)if(s.path){const i=Cse(s.path)?s.path:kS(t,s.path);r.push(i)}return r}function sXe(e){const t=[];for(const n of e){if(n.type!=="user")continue;let r="";if(typeof n.content=="string")r=n.content;else if(Array.isArray(n.content))for(const s of n.content)s.type==="text"&&s.text&&(r+=s.text);r&&t.push(...kse(r))}return t}function iXe(e,t){const n=[],r=e.includes("\\")?"\\":"/";let s=hDt(e);for(;s&&ODt(t,s);){const i=`${s}${r}${uDt}`;n.push(i);const o=mDt(s);if(!o||o===s)break;s=o}return n}function oXe(e,t,n){const r=[],s=v=>n?.[v]?.estimatedTokens??tXe,i=n?.enterprise?.path??"/Library/Application Support/ClaudeCode/CLAUDE.md",o=s("enterprise");o>0&&r.push({id:Mp(i),path:i,source:"enterprise",displayName:Qp(i),isGlobal:!0,estimatedTokens:o,firstSeenInGroup:t});const a="~/.claude/CLAUDE.md",c=s("user");c>0&&r.push({id:Mp(a),path:a,source:"user-memory",displayName:Qp(a),isGlobal:!0,estimatedTokens:c,firstSeenInGroup:t});const l=kS(e,"CLAUDE.md"),d=kS(e,".claude/CLAUDE.md"),p=s("project");p>0&&r.push({id:Mp(l),path:l,source:tge,displayName:Qp(l),isGlobal:!0,estimatedTokens:p,firstSeenInGroup:t});const f=s("project-alt");f>0&&r.push({id:Mp(d),path:d,source:tge,displayName:Qp(d),isGlobal:!0,estimatedTokens:f,firstSeenInGroup:t});const h=kS(e,".claude/rules/*.md"),m=s("project-rules");m>0&&r.push({id:Mp(h),path:h,source:"project-rules",displayName:Qp(h),isGlobal:!0,estimatedTokens:m,firstSeenInGroup:t});const O=kS(e,"CLAUDE.local.md"),_=s("project-local");_>0&&r.push({id:Mp(O),path:O,source:"project-local",displayName:Qp(O),isGlobal:!0,estimatedTokens:_,firstSeenInGroup:t});const b="~/.claude/rules/**/*.md",y=s("user-rules");y>0&&r.push({id:Mp(b),path:b,source:"user-rules",displayName:Qp(b),isGlobal:!0,estimatedTokens:y,firstSeenInGroup:t});const x=n?.["auto-memory"]?.path??"~/.claude/projects/.../memory/MEMORY.md",S=s("auto-memory");return S>0&&r.push({id:Mp(x),path:x,source:"auto-memory",displayName:Qp(x),isGlobal:!0,estimatedTokens:S,firstSeenInGroup:t}),r}function gDt(e,t){return{id:Mp(e),path:e,source:"directory",displayName:Qp(e),isGlobal:!1,estimatedTokens:tXe,firstSeenInGroup:t}}function _Dt(e){const{aiGroup:t,userGroup:n,isFirstGroup:r,previousInjections:s,projectRoot:i,contextTokens:o,tokenData:a}=e,c=[],l=new Set(s.map(y=>y.path)),d=`ai-${t.turnIndex}`;if(r){const y=oXe(i,d,a);for(const x of y)l.has(x.path)||(c.push(x),l.add(x.path))}const p=[],f=nXe(t.steps);p.push(...f);const h=rXe(n,i);p.push(...h);const m=sXe(t.responses);for(const y of m)if(y.path){const x=Cse(y.path)?y.path:kS(i,y.path);p.push(x)}for(const y of p){const x=iXe(y,i);for(const S of x){if(l.has(S)||RO(S)===`${RO(i)}/CLAUDE.md`||RO(S)===`${RO(i)}/.claude/CLAUDE.md`||RO(S)===`${RO(i)}/CLAUDE.local.md`)continue;const T=gDt(S,d);c.push(T),l.add(S)}}const O=[...s,...c],_=O.reduce((y,x)=>y+x.estimatedTokens,0),b=o>0?_/o*100:0;return{newInjections:c,accumulatedInjections:O,totalEstimatedTokens:_,percentageOfContext:b,newCount:c.length,accumulatedCount:O.length}}function bDt(e,t,n){const r=new Map;let s=[],i=!0,o=null;for(const a of e){if(a.type==="user"){o=a.group;continue}if(a.type==="compact"){s=[],i=!0,o=null;continue}if(a.type==="ai"){const c=a.group,l=c.tokens.input||0,d=_Dt({aiGroup:c,userGroup:o,isFirstGroup:i,previousInjections:s,projectRoot:t,contextTokens:l,tokenData:n});r.set(c.id,d),s=d.accumulatedInjections,i=!1,o=null}}return r}const nge=25e3,zQ="mentioned-file",aXe=new Set(["SendMessage","TeamCreate","TeamDelete","TaskCreate","TaskUpdate","TaskList","TaskGet"]);function yDt(e){let t=0;for(let r=0;r<e.length;r++){const s=e.charCodeAt(r);t=(t<<5)-t+s,t=t&t}return`mf-${Math.abs(t).toString(16)}`}function xDt(e){return`tool-output-ai-${e}`}function SDt(e){return`thinking-text-ai-${e}`}function vDt(e){return`task-coord-ai-${e}`}function TDt(e){return`user-msg-ai-${e}`}function hY(e){return{...e,category:"claude-md"}}function rge(e){return{id:yDt(e.path),category:zQ,path:e.path,displayName:e.displayName,estimatedTokens:e.estimatedTokens,firstSeenTurnIndex:e.turnIndex,firstSeenInGroup:e.aiGroupId,exists:e.exists??!0}}function EDt(e,t,n,r){const s=[];let i=0;for(const o of e.values()){if(aXe.has(o.name))continue;const a=o.callTokens??0,c=o.result?.tokenCount??0,l=o.skillInstructionsTokenCount??0,d=a+c+l;if(d>0){const p=o.name==="Task"?"Task (Subagent)":o.name;s.push({toolName:p,tokenCount:d,isError:o.result?.isError??!1,toolUseId:o.id}),i+=d}}if(r)for(const o of r)o.type==="slash"&&o.slash.instructionsTokenCount&&(s.push({toolName:`/${o.slash.name}`,tokenCount:o.slash.instructionsTokenCount,isError:!1}),i+=o.slash.instructionsTokenCount);return i===0?null:{id:xDt(t),category:"tool-output",turnIndex:t,aiGroupId:n,estimatedTokens:i,toolCount:s.length,toolBreakdown:s}}function wDt(e,t,n,r){const s=[];let i=0;for(const o of e.values()){if(!aXe.has(o.name))continue;const a=o.callTokens??0,c=o.result?.tokenCount??0,l=o.skillInstructionsTokenCount??0,d=a+c+l;if(d>0){let p=o.name;if(o.name==="SendMessage"&&o.input){const f=o.input.recipient;f&&(p=`SendMessage → ${f}`)}s.push({type:o.name==="SendMessage"?"send-message":"task-tool",toolName:o.name,tokenCount:d,label:p}),i+=d}}if(r)for(const o of r)o.type==="teammate_message"&&o.teammateMessage.tokenCount&&(s.push({type:"teammate-message",tokenCount:o.teammateMessage.tokenCount,label:o.teammateMessage.teammateId}),i+=o.teammateMessage.tokenCount);return i===0?null:{id:vDt(t),category:"task-coordination",turnIndex:t,aiGroupId:n,estimatedTokens:i,breakdown:s}}function kDt(e,t,n){const r=e.content.rawText??e.content.text??"";if(!r)return null;const s=No(r);if(s===0)return null;const i=r.length>80?r.slice(0,80)+"…":r;return{id:TDt(t),category:"user-message",turnIndex:t,aiGroupId:n,estimatedTokens:s,textPreview:i}}function CDt(e,t,n){const r=[];let s=0,i=0,o=0;for(const a of e)a.type==="thinking"&&a.tokenCount&&a.tokenCount>0?(i+=a.tokenCount,s+=a.tokenCount):a.type==="output"&&a.tokenCount&&a.tokenCount>0&&(o+=a.tokenCount,s+=a.tokenCount);return i>0&&r.push({type:"thinking",tokenCount:i}),o>0&&r.push({type:"text",tokenCount:o}),s===0?null:{id:SDt(t),category:"thinking-text",turnIndex:t,aiGroupId:n,estimatedTokens:s,breakdown:r}}function BQ(e){return e.startsWith("/")||e.startsWith("~/")||e.startsWith("~\\")||e==="~"||e.startsWith("\\\\")||/^[a-zA-Z]:[\\/]/.test(e)}function mY(e,t){if(BQ(t))return t;const n=RDt(e);let r=t;r.startsWith("@")&&(r=r.slice(1)),r.startsWith("./")&&(r=r.slice(2));const s=n.includes("\\")?"\\":"/",i=n.startsWith("/"),o=n.startsWith("\\\\"),a=PDt(r,s),c=$Dt(n);let l=a;for(;l.startsWith(`..${s}`);)l=l.slice(3),c.length>1&&c.pop();let d=c.join(s);return i&&!d.startsWith("/")&&(d=`/${d}`),o&&!d.startsWith("\\\\")&&(d=`\\\\${d}`),l?`${d}${s}${l}`:d}function RDt(e){let t=e.length;for(;t>0;){const n=e[t-1];if(n!=="/"&&n!=="\\")break;t--}return e.slice(0,t)}function PDt(e,t){let n="",r=!1;for(const s of e)s==="/"||s==="\\"?(r||(n+=t),r=!0):(n+=s,r=!1);return n}function $Dt(e){const t=[];let n="";for(const r of e)r==="/"||r==="\\"?n.length>0&&(t.push(n),n=""):n+=r;return n.length>0&&t.push(n),t}function gx(e){return e.replace(/\\/g,"/")}function sge(e,t){return{id:Mp(e),path:e,source:"directory",displayName:Qp(e),isGlobal:!1,estimatedTokens:500,firstSeenInGroup:t}}function NDt(e){const{aiGroup:t,userGroup:n,linkedTools:r,displayItems:s,isFirstGroup:i,previousInjections:o,projectRoot:a,claudeMdTokenData:c,mentionedFileTokenData:l,directoryTokenData:d}=e,p=[],f=new Set(o.filter(w=>w.category==="claude-md"||w.category===zQ).map(w=>w.path)),h=`ai-${t.turnIndex}`;if(i){const w=oXe(a,h,c);for(const P of w)f.has(P.path)||(p.push(hY(P)),f.add(P.path))}const m=[],O=nXe(t.steps);m.push(...O);const _=rXe(n,a);m.push(..._);const b=sXe(t.responses);for(const w of b)if(w.path){const P=BQ(w.path)?w.path:mY(a,w.path);m.push(P)}for(const w of m){const P=iXe(w,a);for(const k of P)if(!(f.has(k)||gx(k)===`${gx(a)}/CLAUDE.md`||gx(k)===`${gx(a)}/.claude/CLAUDE.md`||gx(k)===`${gx(a)}/CLAUDE.local.md`))if(d){const M=d[k];if(!M||!M.exists||M.estimatedTokens<=0)continue;const I=sge(k,h);I.estimatedTokens=M.estimatedTokens,p.push(hY(I)),f.add(k)}else{const M=sge(k,h);p.push(hY(M)),f.add(k)}}if(n?.content.fileReferences)for(const w of n.content.fileReferences){if(!w.path)continue;const P=BQ(w.path)?w.path:mY(a,w.path);if(f.has(P))continue;const k=l?.get(P);if(k&&k.exists&&k.estimatedTokens<=nge){const C=rge({path:P,displayName:w.path,estimatedTokens:k.estimatedTokens,turnIndex:t.turnIndex,aiGroupId:h,exists:k.exists});p.push(C),f.add(P)}}for(const w of b){if(!w.path)continue;const P=BQ(w.path)?w.path:mY(a,w.path);if(f.has(P))continue;const k=l?.get(P);if(k&&k.exists&&k.estimatedTokens<=nge){const C=rge({path:P,displayName:w.path,estimatedTokens:k.estimatedTokens,turnIndex:t.turnIndex,aiGroupId:h,exists:k.exists});p.push(C),f.add(P)}}const y=EDt(r,t.turnIndex,h,s);y&&p.push(y);const x=wDt(r,t.turnIndex,h,s);if(x&&p.push(x),n){const w=kDt(n,t.turnIndex,h);w&&p.push(w)}if(s){const w=CDt(s,t.turnIndex,h);w&&p.push(w)}const S=[...o,...p],v={claudeMd:0,mentionedFiles:0,toolOutputs:0,thinkingText:0,taskCoordination:0,userMessages:0},T={claudeMd:0,mentionedFiles:0,toolOutputs:0,thinkingText:0,taskCoordination:0,userMessages:0};for(const w of p)switch(w.category){case"claude-md":T.claudeMd++;break;case zQ:T.mentionedFiles++;break;case"tool-output":T.toolOutputs+=w.toolCount;break;case"thinking-text":T.thinkingText++;break;case"task-coordination":T.taskCoordination+=w.breakdown.length;break;case"user-message":T.userMessages++;break}for(const w of S)switch(w.category){case"claude-md":v.claudeMd+=w.estimatedTokens;break;case zQ:v.mentionedFiles+=w.estimatedTokens;break;case"tool-output":v.toolOutputs+=w.estimatedTokens;break;case"thinking-text":v.thinkingText+=w.estimatedTokens;break;case"task-coordination":v.taskCoordination+=w.estimatedTokens;break;case"user-message":v.userMessages+=w.estimatedTokens;break}const E=v.claudeMd+v.mentionedFiles+v.toolOutputs+v.thinkingText+v.taskCoordination+v.userMessages;return{newInjections:p,accumulatedInjections:S,totalEstimatedTokens:E,tokensByCategory:v,newCounts:T}}function ADt(e){const t=e.responses||[];for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.type==="assistant"&&r.usage)return(r.usage.input_tokens??0)+(r.usage.output_tokens??0)+(r.usage.cache_read_input_tokens??0)+(r.usage.cache_creation_input_tokens??0)}}function IDt(e){const t=e.responses||[];for(const n of t)if(n.type==="assistant"&&n.usage)return(n.usage.input_tokens??0)+(n.usage.output_tokens??0)+(n.usage.cache_read_input_tokens??0)+(n.usage.cache_creation_input_tokens??0)}function MDt(e,t,n,r,s){const i=new Map;let o=[],a=!0,c=null,l=1;const d=[],p=new Map,f=new Map;let h=null,m=null,O=null,_=null;for(const y of e){if(y.type==="user"){c=y.group;continue}if(y.type==="compact"){h&&m&&d.push({phaseNumber:l,firstAIGroupId:h,lastAIGroupId:m,compactGroupId:O}),o=[],a=!0,c=null,l++,O=y.group.id,h=null,m=null;continue}if(y.type==="ai"){const x=y.group;let S=x.linkedTools;(!S||S.size===0)&&(S=bre(x.steps,x.responses));let v=x.displayItems;if(!v&&x.steps&&x.steps.length>0){const E=yre(x.steps,x.isOngoing??!1);v=g2e(x.steps,E,x.processes||[],x.responses)}const T=NDt({aiGroup:x,userGroup:c,linkedTools:S,displayItems:v,isFirstGroup:a,previousInjections:o,projectRoot:t,claudeMdTokenData:n,mentionedFileTokenData:r,directoryTokenData:s});if(T.phaseNumber=l,a&&O&&_){const E=ADt(_),w=IDt(x);E!==void 0&&w!==void 0&&f.set(O,{preCompactionTokens:E,postCompactionTokens:w,delta:w-E})}i.set(x.id,T),p.set(x.id,l),h||(h=x.id),m=x.id,_=x,o=T.accumulatedInjections,a=!1,c=null}}h&&m&&d.push({phaseNumber:l,firstAIGroupId:h,lastAIGroupId:m,compactGroupId:O});const b={phases:d,compactionCount:l-1,aiGroupPhaseMap:p,compactionTokenDeltas:f};return{statsMap:i,phaseInfo:b}}function hZ(e,t){if(QDt(t))return t;const n=DDt(e);let r=t;if(r.startsWith("@")&&(r=r.slice(1)),r.startsWith("~/")||r.startsWith("~\\")||r==="~")return r;r.startsWith("./")&&(r=r.slice(2));const s=n.includes("\\")?"\\":"/",i=n.startsWith("/"),o=n.startsWith("\\\\"),a=LDt(r,s),c=jDt(n);let l=a;for(;l.startsWith(`..${s}`);)l=l.slice(3),c.length>1&&c.pop();let d=c.join(s);return i&&!d.startsWith("/")&&(d=`/${d}`),o&&!d.startsWith("\\\\")&&(d=`\\\\${d}`),l?`${d}${s}${l}`:d}function QDt(e){return e.startsWith("/")||e.startsWith("\\\\")||/^[a-zA-Z]:[\\/]/.test(e)}function DDt(e){let t=e.length;for(;t>0;){const n=e[t-1];if(n!=="/"&&n!=="\\")break;t--}return e.slice(0,t)}function LDt(e,t){let n="",r=!1;for(const s of e)s==="/"||s==="\\"?(r||(n+=t),r=!0):(n+=s,r=!1);return n}function jDt(e){const t=[];let n="";for(const r of e)r==="/"||r==="\\"?n.length>0&&(t.push(n),n=""):n+=r;return n.length>0&&t.push(n),t}const _x=Hi("Store:sessionDetail"),OY=new Map,gY=new Set,_Y=new Set,RL=new Map;function XDt(e){const t=e??"__global__",n=(RL.get(t)??0)+1;return RL.set(t,n),n}function bx(e,t){return RL.get(t??"__global__")===e}let bY="";function ige(){return{sessionDetail:null,conversation:null,conversationLoading:!1,sessionDetailLoading:!1,sessionDetailError:null,sessionClaudeMdStats:null,sessionContextStats:null,sessionPhaseInfo:null,visibleAIGroupId:null,selectedAIGroup:null}}const UDt=(e,t)=>({sessionDetail:null,sessionDetailLoading:!1,sessionDetailError:null,conversation:null,conversationLoading:!1,sessionClaudeMdStats:null,sessionContextStats:null,sessionPhaseInfo:null,agentConfigs:{},visibleAIGroupId:null,selectedAIGroup:null,tabSessionData:{},fetchSessionDetail:async(n,r,s,i)=>{const o=XDt(s);if(i?.silent||e({sessionDetailLoading:!0,sessionDetailError:null,conversationLoading:!0}),s&&!i?.silent){const a=t().tabSessionData;e({tabSessionData:{...a,[s]:{...a[s]??ige(),sessionDetailLoading:!0,sessionDetailError:null,conversationLoading:!0}}})}try{const a=await K.getSessionDetail(n,r);if(!bx(o,s))return;const c=a?.session?.isOngoing??!1,l=a?pT(a.chunks):null,d=a&&l?nP(l,a.processes,c):null,p=d?.items?.find(w=>w.type==="ai"),f=p?.type==="ai"?p.group.id:null,h=p?.type==="ai"?p.group:null,m=a?.session?.projectPath??"",{connectionMode:O}=t();let _=null,b=null,y=null;if(O!=="ssh"&&m&&m!==bY&&(bY=m,K.readAgentConfigs(m).then(w=>{e({agentConfigs:w})}).catch(w=>{_x.error("Failed to read agent configs:",w),bY=""})),O!=="ssh"&&d?.items){let w={};try{if(w=await K.readClaudeMdFiles(m),!bx(o,s))return}catch($){_x.error("Failed to read CLAUDE.md files:",$)}_=bDt(d.items,m,w);const P={};if(_&&_.size>0){const $=new Set;for(const R of _.values())for(const N of R.accumulatedInjections)N.source==="directory"&&$.add(N.path);if($.size>0){const R=new Map,N=new Set,j=await Promise.all(Array.from($).map(async Q=>{try{const U=Q.replace(/[\\/]CLAUDE\.md$/,""),A=await K.readDirectoryClaudeMd(U);return{fullPath:Q,fileInfo:A,error:!1}}catch(U){return _x.error("Failed to read directory CLAUDE.md:",Q,U),{fullPath:Q,fileInfo:null,error:!0}}}));if(!bx(o,s))return;for(const{fullPath:Q,fileInfo:U,error:A}of j)A||!U?N.add(Q):U.exists&&U.estimatedTokens>0?(R.set(Q,U.estimatedTokens),P[Q]=U):N.add(Q);for(const[,Q]of _.entries()){Q.accumulatedInjections=Q.accumulatedInjections.filter(U=>U.source!=="directory"||!N.has(U.path)),Q.newInjections=Q.newInjections.filter(U=>U.source!=="directory"||!N.has(U.path));for(const U of Q.accumulatedInjections)U.source==="directory"&&R.has(U.path)&&(U.estimatedTokens=R.get(U.path));for(const U of Q.newInjections)U.source==="directory"&&R.has(U.path)&&(U.estimatedTokens=R.get(U.path));Q.totalEstimatedTokens=Q.accumulatedInjections.reduce((U,A)=>U+A.estimatedTokens,0),Q.accumulatedCount=Q.accumulatedInjections.length,Q.newCount=Q.newInjections.length}}}const k=new Set;for(const $ of d.items)if($.type==="user"&&$.group.content.fileReferences)for(const R of $.group.content.fileReferences){const N=hZ(m,R.path);k.add(N)}for(const $ of d.items)if($.type==="ai")for(const R of $.group.responses){if(R.type!=="user")continue;let N="";if(typeof R.content=="string")N=R.content;else if(Array.isArray(R.content))for(const j of R.content)j.type==="text"&&j.text&&(N+=j.text);if(N)for(const j of kse(N)){const Q=hZ(m,j.path);k.add(Q)}}const C=new Map,M=await Promise.all(Array.from(k).map(async $=>{try{const R=await K.readMentionedFile($,m);return{filePath:$,fileInfo:R}}catch(R){return _x.error("Failed to read mentioned file:",$,R),{filePath:$,fileInfo:null}}}));if(!bx(o,s))return;for(const{filePath:$,fileInfo:R}of M)R&&C.set($,R);const I=MDt(d.items,m,w,C,P);b=I.statsMap,y=I.phaseInfo}const x=t();if(!bx(o,s))return;const S=fu(x.paneLayout),v=pZ(S,r);if(v&&a){const w=a.session.firstMessage?fZ(a.session.firstMessage):`Session ${r.slice(0,8)}`;x.updateTabLabel(v.id,w)}if(s&&d?.items&&t().appConfig?.general?.autoExpandAIGroups)for(const w of d.items)w.type==="ai"&&t().expandAIGroupForTab(s,w.group.id);if(s){const w=t().tabSessionData;e({tabSessionData:{...w,[s]:{sessionDetail:a,conversation:d,conversationLoading:!1,sessionDetailLoading:!1,sessionDetailError:null,sessionClaudeMdStats:_,sessionContextStats:b,sessionPhaseInfo:y,visibleAIGroupId:f,selectedAIGroup:h}}})}const T=x.getActiveTab();x.selectedSessionId===r||T?.type==="session"&&T.sessionId===r&&T.projectId===n?e({sessionDetail:a,sessionDetailLoading:!1,conversation:d,conversationLoading:!1,visibleAIGroupId:f,selectedAIGroup:h,sessionClaudeMdStats:_,sessionContextStats:b,sessionPhaseInfo:y}):i?.silent||e({sessionDetailLoading:!1,conversationLoading:!1})}catch(a){if(_x.error("fetchSessionDetail error:",a),!bx(o,s))return;const c=a instanceof Error?a.message:"获取会话详情失败";if(i?.silent||e({sessionDetailError:c,sessionDetailLoading:!1,conversationLoading:!1}),s&&!i?.silent){const l=t().tabSessionData;e({tabSessionData:{...l,[s]:{...l[s]??ige(),sessionDetailError:c,sessionDetailLoading:!1,conversationLoading:!1}}})}}},refreshSessionInPlace:async(n,r)=>{const s=t(),o=fu(s.paneLayout).filter(l=>l.type==="session"&&l.sessionId===r);if(s.selectedSessionId!==r&&o.length===0)return;const a=`${n}/${r}`;if(gY.has(a)){_Y.add(a);return}const c=(OY.get(a)??0)+1;OY.set(a,c),gY.add(a);try{const l=await K.getSessionDetail(n,r);if(OY.get(a)!==c||!l)return;const d=l.session?.isOngoing??!1,p=pT(l.chunks);if(!p)return;const f=nP(p,l.processes,d);if(!f)return;const h=t(),m=fu(h.paneLayout);if(!(h.selectedSessionId===r||m.some(T=>T.type==="session"&&T.sessionId===r)))return;const _=s.visibleAIGroupId,b=s.selectedAIGroup,y=_&&f.items.some(T=>T.type==="ai"&&T.group.id===_);let x=b;if(y&&_){const T=f.items.find(E=>E.type==="ai"&&E.group.id===_);T?.type==="ai"&&(x=T.group)}const S=new Set((h.conversation?.items??[]).filter(T=>T.type==="ai").map(T=>T.group.id));if(e(T=>({sessionDetail:l,conversation:f,sessions:T.sessions.map(E=>E.id===r?{...E,isOngoing:l.session?.isOngoing??!1}:E),...y?{selectedAIGroup:x}:{}})),t().appConfig?.general?.autoExpandAIGroups){const T=S,E=f.items.filter(w=>w.type==="ai"&&!T.has(w.group.id)).map(w=>w.group.id);if(E.length>0){for(const w of m)if(w.type==="session"&&w.sessionId===r)for(const P of E)t().expandAIGroupForTab(w.id,P)}}const v={...t().tabSessionData};for(const T of m)if(T.type==="session"&&T.sessionId===r&&v[T.id]){const E=v[T.id],w=E.visibleAIGroupId,P=w&&f.items.some(C=>C.type==="ai"&&C.group.id===w);let k=E.selectedAIGroup;if(P&&w){const C=f.items.find(M=>M.type==="ai"&&M.group.id===w);C?.type==="ai"&&(k=C.group)}v[T.id]={...E,sessionDetail:l,conversation:f,...P?{selectedAIGroup:k}:{}}}e({tabSessionData:v})}catch(l){_x.error("refreshSessionInPlace error:",l)}finally{gY.delete(a),_Y.has(a)&&(_Y.delete(a),t().refreshSessionInPlace(n,r))}},setVisibleAIGroup:n=>{const r=t();if(n===r.visibleAIGroupId)return;let s=null;if(n&&r.conversation){for(const i of r.conversation.items)if(i.type==="ai"&&i.group.id===n){s=i.group;break}}e({visibleAIGroupId:n,selectedAIGroup:s})},setTabVisibleAIGroup:(n,r)=>{const s=t(),i=s.tabSessionData[n];if(!i||r===i.visibleAIGroupId)return;let o=null;if(r&&i.conversation){for(const a of i.conversation.items)if(a.type==="ai"&&a.group.id===r){o=a.group;break}}e({tabSessionData:{...s.tabSessionData,[n]:{...i,visibleAIGroupId:r,selectedAIGroup:o}}})},cleanupTabSessionData:n=>{RL.delete(n);const r=t().tabSessionData;if(!(n in r))return;const s={...r};delete s[n],e({tabSessionData:s})}}),ad=Hi("Store:session"),zDt=150;function BDt(e){const t=e instanceof Error?e.message:String(e??"");return t.includes("Error invoking remote method 'get-sessions-paginated': reply was never sent")||t.includes("No handler registered for 'get-sessions-paginated'")}const yY=new Map,FDt=(e,t)=>({sessions:[],selectedSessionId:null,sessionsLoading:!1,sessionsError:null,sessionsCursor:null,sessionsHasMore:!1,sessionsTotalCount:0,sessionsLoadingMore:!1,pinnedSessionIds:[],hiddenSessionIds:[],showHiddenSessions:!1,sidebarSelectedSessionIds:[],sidebarMultiSelectActive:!1,sessionSortMode:"recent",fetchSessions:async n=>{e({sessionsLoading:!0,sessionsError:null});try{const s=[...await K.getSessions(n)].sort((i,o)=>o.createdAt-i.createdAt);e({sessions:s,sessionsLoading:!1})}catch(r){e({sessionsError:r instanceof Error?r.message:"Failed to fetch sessions",sessionsLoading:!1})}},fetchSessionsInitial:async n=>{e({sessionsLoading:!0,sessionsError:null,sessions:[],sessionsCursor:null,sessionsHasMore:!1,sessionsTotalCount:0});try{const{connectionMode:r}=t(),s=await K.getSessionsPaginated(n,null,20,{includeTotalCount:!1,prefilterAll:!1,metadataLevel:r==="ssh"?"light":"deep"});e({sessions:s.sessions,sessionsCursor:s.nextCursor,sessionsHasMore:s.hasMore,sessionsTotalCount:s.totalCount,sessionsLoading:!1}),t().loadPinnedSessions(),t().loadHiddenSessions()}catch(r){e({sessionsError:r instanceof Error?r.message:"Failed to fetch sessions",sessionsLoading:!1})}},fetchSessionsMore:async()=>{const n=t(),{selectedProjectId:r,sessionsCursor:s,sessionsHasMore:i,sessionsLoadingMore:o}=n;if(!(!r||!i||o||!s)){e({sessionsLoadingMore:!0});try{const{connectionMode:a}=t(),c=await K.getSessionsPaginated(r,s,20,{includeTotalCount:!1,prefilterAll:!1,metadataLevel:a==="ssh"?"light":"deep"}),l=new Set(t().sessions.map(p=>p.id)),d=c.sessions.filter(p=>!l.has(p.id));e(p=>{const f=[...p.sessions,...d],h=f.length+(c.hasMore?1:0),m=Math.max(p.sessionsTotalCount,c.totalCount,h);return{sessions:f,sessionsCursor:c.nextCursor,sessionsHasMore:c.hasMore,sessionsTotalCount:m,sessionsLoadingMore:!1}})}catch(a){e({sessionsError:a instanceof Error?a.message:"Failed to fetch more sessions",sessionsLoadingMore:!1})}}},resetSessionsPagination:()=>{e({sessions:[],sessionsCursor:null,sessionsHasMore:!1,sessionsTotalCount:0,sessionsLoadingMore:!1,sessionsError:null})},selectSession:n=>{e({selectedSessionId:n,sessionDetail:null,sessionContextStats:null,sessionDetailError:null});const r=t(),s=r.selectedProjectId;if(s){const i=r.activeTabId??void 0;r.fetchSessionDetail(s,n,i)}else ad.warn("Cannot fetch session detail: no project selected")},clearSelection:()=>{e({selectedProjectId:null,selectedSessionId:null,sessions:[],sessionDetail:null,sessionContextStats:null})},refreshSessionsInPlace:async n=>{if(t().selectedProjectId!==n)return;const s=(yY.get(n)??0)+1;yY.set(n,s);const i=async()=>{const{connectionMode:a}=t();return K.getSessionsPaginated(n,null,20,{includeTotalCount:!1,prefilterAll:!1,metadataLevel:a==="ssh"?"light":"deep"})},o=a=>{yY.get(n)===s&&e({sessions:a.sessions,sessionsCursor:a.nextCursor,sessionsHasMore:a.hasMore,sessionsTotalCount:a.totalCount})};try{const a=await i();o(a)}catch(a){if(BDt(a)&&t().selectedProjectId===n){ad.warn("refreshSessionsInPlace transient IPC error - retrying once");try{if(await new Promise(l=>setTimeout(l,zDt)),t().selectedProjectId!==n)return;const c=await i();o(c);return}catch(c){ad.error("refreshSessionsInPlace retry error:",c);return}}ad.error("refreshSessionsInPlace error:",a)}},togglePinSession:async n=>{const r=t(),s=r.selectedProjectId;if(!s)return;const i=r.pinnedSessionIds.includes(n),o=r.pinnedSessionIds;e(i?{pinnedSessionIds:o.filter(a=>a!==n)}:{pinnedSessionIds:[n,...o]});try{i?await K.config.unpinSession(s,n):await K.config.pinSession(s,n)}catch(a){e({pinnedSessionIds:o}),ad.error("togglePinSession error:",a)}},loadPinnedSessions:async()=>{const r=t().selectedProjectId;if(!r){e({pinnedSessionIds:[]});return}try{const{connectionMode:s}=t(),a=((await K.config.get()).sessions?.pinnedSessions?.[r]??[]).map(p=>p.sessionId);e({pinnedSessionIds:a});const c=t().sessions,l=new Set(c.map(p=>p.id)),d=a.filter(p=>!l.has(p));if(d.length>0){const p=await K.getSessionsByIds(r,d,{metadataLevel:s==="ssh"?"light":"deep"});if(p.length>0){const f=t().sessions,h=new Set(f.map(O=>O.id)),m=p.filter(O=>!h.has(O.id));m.length>0&&e({sessions:[...f,...m]})}}}catch(s){ad.error("loadPinnedSessions error:",s),e({pinnedSessionIds:[]})}},setSessionSortMode:n=>{e({sessionSortMode:n})},toggleHideSession:async n=>{const r=t(),s=r.selectedProjectId;if(!s)return;const i=r.hiddenSessionIds.includes(n),o=r.hiddenSessionIds;e(i?{hiddenSessionIds:o.filter(a=>a!==n)}:{hiddenSessionIds:[n,...o]});try{i?await K.config.unhideSession(s,n):await K.config.hideSession(s,n)}catch(a){e({hiddenSessionIds:o}),ad.error("toggleHideSession error:",a)}},hideMultipleSessions:async n=>{const r=t(),s=r.selectedProjectId;if(!s||n.length===0)return;const i=r.hiddenSessionIds,o=new Set(i),a=n.filter(c=>!o.has(c));e({hiddenSessionIds:[...a,...i]});try{await K.config.hideSessions(s,n)}catch(c){e({hiddenSessionIds:i}),ad.error("hideMultipleSessions error:",c)}},unhideMultipleSessions:async n=>{const r=t(),s=r.selectedProjectId;if(!s||n.length===0)return;const i=r.hiddenSessionIds,o=new Set(n);e({hiddenSessionIds:i.filter(a=>!o.has(a))});try{await K.config.unhideSessions(s,n)}catch(a){e({hiddenSessionIds:i}),ad.error("unhideMultipleSessions error:",a)}},loadHiddenSessions:async()=>{const r=t().selectedProjectId;if(!r){e({hiddenSessionIds:[]});return}try{const o=((await K.config.get()).sessions?.hiddenSessions?.[r]??[]).map(a=>a.sessionId);e({hiddenSessionIds:o})}catch(s){ad.error("loadHiddenSessions error:",s),e({hiddenSessionIds:[]})}},toggleShowHiddenSessions:()=>{e(n=>({showHiddenSessions:!n.showHiddenSessions}))},toggleSidebarSessionSelection:n=>{e(r=>{const s=r.sidebarSelectedSessionIds;return s.includes(n)?{sidebarSelectedSessionIds:s.filter(i=>i!==n)}:{sidebarSelectedSessionIds:[...s,n],sidebarMultiSelectActive:!0}})},clearSidebarSelection:()=>{e({sidebarSelectedSessionIds:[],sidebarMultiSelectActive:!1})},toggleSidebarMultiSelect:()=>{e(n=>n.sidebarMultiSelectActive?{sidebarMultiSelectActive:!1,sidebarSelectedSessionIds:[]}:{sidebarMultiSelectActive:!0})},pinMultipleSessions:async n=>{const r=t(),s=r.selectedProjectId;if(!s||n.length===0)return;const i=r.pinnedSessionIds,o=new Set(i),a=n.filter(c=>!o.has(c));e({pinnedSessionIds:[...a,...i]});try{await Promise.all(a.map(c=>K.config.pinSession(s,c)))}catch(c){e({pinnedSessionIds:i}),ad.error("pinMultipleSessions error:",c)}}}),YDt=(e,t)=>({drillDownStack:[],currentSubagentDetail:null,subagentDetailLoading:!1,subagentDetailError:null,drillDownSubagent:async(n,r,s,i)=>{e({subagentDetailLoading:!0,subagentDetailError:null});try{const o=await K.getSubagentDetail(n,r,s);if(!o){e({subagentDetailError:"Failed to load subagent details",subagentDetailLoading:!1});return}const a=t().drillDownStack;e({drillDownStack:[...a,{id:s,description:i}],currentSubagentDetail:o,subagentDetailLoading:!1})}catch(o){e({subagentDetailError:o instanceof Error?o.message:"Failed to load subagent",subagentDetailLoading:!1})}},navigateToBreadcrumb:n=>{const r=t();if(n<=0){e({drillDownStack:[],currentSubagentDetail:null,subagentDetailError:null});return}const s=r.drillDownStack.slice(0,n);if(s.length===0){e({drillDownStack:[],currentSubagentDetail:null,subagentDetailError:null});return}const i=s[s.length-1],o=r.selectedProjectId,a=r.selectedSessionId;!o||!a||(e({subagentDetailLoading:!0,subagentDetailError:null}),K.getSubagentDetail(o,a,i.id).then(c=>{e(c?{drillDownStack:s,currentSubagentDetail:c,subagentDetailLoading:!1}:{subagentDetailError:"Failed to load subagent details",subagentDetailLoading:!1})}).catch(c=>{e({subagentDetailError:c instanceof Error?c.message:"Failed to load subagent",subagentDetailLoading:!1})}))},closeSubagentModal:()=>{e({drillDownStack:[],currentSubagentDetail:null,subagentDetailError:null})}});function xo(e){const t=Kje(e);return{paneLayout:e,openTabs:t.openTabs,activeTabId:t.activeTabId,selectedTabIds:t.selectedTabIds}}function $1(e,t,n){const r=kh(e,t);return r?eo(e,{...r,tabs:r.tabs.map(s=>s.id===t?n(s):s)}):e}const VDt=(e,t)=>({openTabs:[],activeTabId:null,selectedTabIds:[],activeProjectId:null,openTab:(n,r)=>{const s=t(),{paneLayout:i}=s,o=Ql(i,i.focusedPaneId);if(!o)return;if(n.type==="session"&&n.sessionId&&!r?.forceNewTab){const d=fu(i),p=pZ(d,n.sessionId);if(p){s.setActiveTab(p.id);return}const f=o.tabs.find(h=>h.id===o.activeTabId);if(f&&(r?.replaceActiveTab||f.type==="dashboard")){f.type==="session"&&(s.cleanupTabUIState(f.id),s.cleanupTabSessionData(f.id));const h={...n,id:f.id,label:fZ(n.label),createdAt:Date.now()},m={...o,tabs:o.tabs.map(_=>_.id===f.id?h:_),activeTabId:h.id},O=eo(i,m);e(xo(O));return}}const a={...n,id:crypto.randomUUID(),label:fZ(n.label),createdAt:Date.now()},c={...o,tabs:[...o.tabs,a],activeTabId:a.id},l=eo(i,c);e(xo(l))},closeTab:n=>{const r=t(),{paneLayout:s}=r,i=kh(s,n);if(!i)return;const o=i.tabs.findIndex(f=>f.id===n);if(o===-1)return;r.cleanupTabUIState(n),r.cleanupTabSessionData(n);const a=i.tabs.filter(f=>f.id!==n);let c=i.activeTabId;if(i.activeTabId===n&&(c=a[o]?.id??a[o-1]?.id??null),a.length===0&&s.panes.length>1){r.closePane(i.id);return}const l=s.panes.filter(f=>f.id!==i.id).flatMap(f=>f.tabs);if(a.length===0&&l.length===0){const f={...i,tabs:[],activeTabId:null,selectedTabIds:[]},h=eo(s,f);e({...xo(h),...Kv()});return}const d={...i,tabs:a,activeTabId:c,selectedTabIds:i.selectedTabIds.filter(f=>f!==n)},p=eo(s,d);e(xo(p)),c&&t().setActiveTab(c)},setActiveTab:n=>{const r=t(),{paneLayout:s}=r,i=r.getActiveTab(),a=kh(s,n)?.tabs.find(f=>f.id===n);i?.id!==n&&$xt(i?.label??"none",a?.label??n);const c=kh(s,n);if(!c)return;const l=c.tabs.find(f=>f.id===n);if(!l)return;const d={...c,activeTabId:n};let p=eo(s,d);if(p={...p,focusedPaneId:c.id},e(xo(p)),l.type==="session"&&l.sessionId&&l.projectId){const f=l.sessionId,h=l.projectId,m=r.selectedSessionId!==f,O=r.tabSessionData[n],_=O?.conversation!=null;let b=null,y=null;for(const S of r.repositoryGroups){for(const v of S.worktrees)if(v.id===h){b=S.id,y=v.id;break}if(b)break}if(b&&y){const S=r.selectedWorktreeId!==y;e({selectedRepositoryId:b,selectedWorktreeId:y,selectedSessionId:f,activeProjectId:y,selectedProjectId:y}),S&&t().fetchSessionsInitial(y),m&&(_?e({sessionDetail:O.sessionDetail,conversation:O.conversation,conversationLoading:!1,sessionDetailLoading:!1,sessionDetailError:null,sessionClaudeMdStats:O.sessionClaudeMdStats,sessionContextStats:O.sessionContextStats,sessionPhaseInfo:O.sessionPhaseInfo,visibleAIGroupId:O.visibleAIGroupId,selectedAIGroup:O.selectedAIGroup}):t().fetchSessionDetail(y,f,n));return}const x=r.projects.find(S=>S.id===h||S.sessions.includes(f));if(x){const S=r.selectedProjectId!==x.id;e({activeProjectId:x.id,selectedProjectId:x.id,selectedSessionId:f}),S&&t().fetchSessionsInitial(x.id),m&&(_?e({sessionDetail:O.sessionDetail,conversation:O.conversation,conversationLoading:!1,sessionDetailLoading:!1,sessionDetailError:null,sessionClaudeMdStats:O.sessionClaudeMdStats,sessionContextStats:O.sessionContextStats,sessionPhaseInfo:O.sessionPhaseInfo,visibleAIGroupId:O.visibleAIGroupId,selectedAIGroup:O.selectedAIGroup}):t().fetchSessionDetail(x.id,f,n));return}}if((l.type==="team"||l.type==="graph")&&l.teamName)if(r.selectedTeamName!==l.teamName)r.selectTeam(l.teamName);else{const h=r.selectedTeamData?.config.projectPath;if(h){const m=fr(h),O=r.projects.find(_=>fr(_.path)===m);if(O&&r.selectedProjectId!==O.id)r.selectProject(O.id);else if(!O)for(const _ of r.repositoryGroups){const b=_.worktrees.find(y=>fr(y.path)===m);if(b&&r.selectedWorktreeId!==b.id){e(kU(_.id,b.id)),t().fetchSessionsInitial(b.id);break}}}}},openDashboard:()=>{const n=t(),{paneLayout:r}=n,s=fu(r).find(l=>l.type==="dashboard");if(s){const l=kh(r,s.id);if(l){const d=l.tabs.findIndex(f=>f.id===s.id),p=l.tabs.length-1;if(d!==-1&&d!==p){const f=[...l.tabs],[h]=f.splice(d,1);f.push(h);const m={...l,tabs:f,activeTabId:s.id},O=eo(r,m);e(xo(O));return}}n.setActiveTab(s.id);return}const i=Ql(r,r.focusedPaneId);if(!i)return;const o={id:crypto.randomUUID(),type:"dashboard",label:"首页",createdAt:Date.now()},a={...i,tabs:[...i.tabs,o],activeTabId:o.id},c=eo(r,a);e(xo(c))},openSessionReport:n=>{const r=t(),i=fu(r.paneLayout).find(l=>l.id===n);if(i?.type!=="session"||!i.sessionId||!i.projectId)return;const a=r.tabSessionData[n]?.sessionDetail?.session.firstMessage,c=a?`Report: ${a.slice(0,30)}${a.length>30?"…":""}`:"Session Report";r.openTab({type:"report",label:c,projectId:i.projectId,sessionId:i.sessionId})},getActiveTab:()=>{const n=t(),r=Ql(n.paneLayout,n.paneLayout.focusedPaneId);return r?.activeTabId?r.tabs.find(s=>s.id===r.activeTabId)??null:null},isSessionOpen:n=>fu(t().paneLayout).some(s=>s.type==="session"&&s.sessionId===n),enqueueTabNavigation:(n,r)=>{const{paneLayout:s}=t(),i=$1(s,n,o=>({...o,pendingNavigation:r}));e(xo(i))},consumeTabNavigation:(n,r)=>{const{paneLayout:s}=t(),i=$1(s,n,o=>o.pendingNavigation?.id===r?{...o,pendingNavigation:void 0,lastConsumedNavigationId:r}:o);e(xo(i))},saveTabScrollPosition:(n,r)=>{const{paneLayout:s}=t(),i=$1(s,n,o=>({...o,savedScrollTop:r}));e(xo(i))},updateTabLabel:(n,r)=>{const{paneLayout:s}=t(),i=$1(s,n,o=>({...o,label:r}));e(xo(i))},setTabContextPanelVisible:(n,r)=>{const{paneLayout:s}=t(),i=$1(s,n,o=>({...o,showContextPanel:r}));e(xo(i))},setSelectedTabIds:n=>{const{paneLayout:r}=t(),s=Ql(r,r.focusedPaneId);if(!s)return;const i={...s,selectedTabIds:n},o=eo(r,i);e(xo(o))},clearTabSelection:()=>{const{paneLayout:n}=t(),r=Ql(n,n.focusedPaneId);if(!r)return;const s={...r,selectedTabIds:[]},i=eo(n,s);e(xo(i))},closeOtherTabs:n=>{const r=t(),{paneLayout:s}=r,i=kh(s,n);if(!i)return;const o=i.tabs.filter(d=>d.id!==n);for(const d of o)r.cleanupTabUIState(d.id),r.cleanupTabSessionData(d.id);const a=i.tabs.find(d=>d.id===n);if(!a)return;const c={...i,tabs:[a],activeTabId:n,selectedTabIds:[]},l=eo(s,c);e(xo(l)),t().setActiveTab(n)},closeTabsToRight:n=>{const r=t(),{paneLayout:s}=r,i=kh(s,n);if(!i)return;const o=i.tabs.findIndex(h=>h.id===n);if(o===-1)return;const a=i.tabs.slice(o+1);for(const h of a)r.cleanupTabUIState(h.id),r.cleanupTabSessionData(h.id);const c=i.tabs.slice(0,o+1),d=c.some(h=>h.id===i.activeTabId)?i.activeTabId:n,p={...i,tabs:c,activeTabId:d,selectedTabIds:[]},f=eo(s,p);e(xo(f)),d&&t().setActiveTab(d)},closeAllTabs:()=>{const n=t(),r=fu(n.paneLayout);for(const o of r)n.cleanupTabUIState(o.id),n.cleanupTabSessionData(o.id);const s=n.paneLayout.panes[0]?.id??"pane-default";e({...xo({panes:[{id:s,tabs:[],activeTabId:null,selectedTabIds:[],widthFraction:1}],focusedPaneId:s}),...Kv()})},closeTabs:n=>{const r=t(),s=new Set(n);for(const l of s)r.cleanupTabUIState(l),r.cleanupTabSessionData(l);let{paneLayout:i}=r;const o=[];for(const l of i.panes){const d=l.tabs.filter(f=>!s.has(f.id));if(d.length===l.tabs.length)continue;if(d.length===0&&i.panes.length>1){o.push(l.id);continue}let p=l.activeTabId;if(p&&s.has(p)){const f=l.tabs.findIndex(h=>h.id===p);p=null;for(let h=f;h<l.tabs.length;h++)if(!s.has(l.tabs[h].id)){p=l.tabs[h].id;break}if(!p){for(let h=f-1;h>=0;h--)if(!s.has(l.tabs[h].id)){p=l.tabs[h].id;break}}p=p??d[0]?.id??null}i=eo(i,{...l,tabs:d,activeTabId:p,selectedTabIds:l.selectedTabIds.filter(f=>!s.has(f))})}if(fu(i).length===0){r.closeAllTabs();return}for(const l of o)i=qw(i,l);e(xo(i));const c=t().activeTabId;c&&t().setActiveTab(c)},setActiveProject:n=>{e({activeProjectId:n}),t().selectProject(n)},clearActiveProject:()=>{e({activeProjectId:null,selectedProjectId:null,selectedRepositoryId:null,selectedWorktreeId:null,...Xh()})},navigateToSession:(n,r,s=!1,i)=>{const o=t(),a=fu(o.paneLayout),c=eXe(a,r,n)??pZ(a,r);if(c){if(o.setActiveTab(c.id),i){const l={query:i.query,messageTimestamp:i.messageTimestamp,matchedText:i.matchedText,...i.targetGroupId!==void 0?{targetGroupId:i.targetGroupId}:{},...i.targetMatchIndexInItem!==void 0?{targetMatchIndexInItem:i.targetMatchIndexInItem}:{},...i.targetMatchStartOffset!==void 0?{targetMatchStartOffset:i.targetMatchStartOffset}:{},...i.targetMessageUuid!==void 0?{targetMessageUuid:i.targetMessageUuid}:{}},d=KOe({...l});o.enqueueTabNavigation(c.id,d)}}else{if(o.openTab({type:"session",label:"Loading...",projectId:n,sessionId:r,fromSearch:s}),i){const p=t().activeTabId;if(p){o.setActiveTab(p);const f={query:i.query,messageTimestamp:i.messageTimestamp,matchedText:i.matchedText,...i.targetGroupId!==void 0?{targetGroupId:i.targetGroupId}:{},...i.targetMatchIndexInItem!==void 0?{targetMatchIndexInItem:i.targetMatchIndexInItem}:{},...i.targetMatchStartOffset!==void 0?{targetMatchStartOffset:i.targetMatchStartOffset}:{},...i.targetMessageUuid!==void 0?{targetMessageUuid:i.targetMessageUuid}:{}},h=KOe({...f});o.enqueueTabNavigation(p,h)}}const l=t().activeTabId??void 0;o.fetchSessionDetail(n,r,l)}}});function yp(){return{expandedAIGroupIds:new Set,expandedDisplayItemIds:new Map,expandedSubagentTraceIds:new Set,showContextPanel:!1,selectedContextPhase:null,savedScrollTop:void 0}}const qDt=(e,t)=>({tabUIStates:new Map,initTabUIState:n=>{const r=t();if(r.tabUIStates.has(n))return;const s=new Map(r.tabUIStates);s.set(n,yp()),e({tabUIStates:s})},cleanupTabUIState:n=>{const r=t();if(!r.tabUIStates.has(n))return;const s=new Map(r.tabUIStates);s.delete(n),e({tabUIStates:s})},toggleAIGroupExpansionForTab:(n,r)=>{const s=t(),i=new Map(s.tabUIStates),o=i.get(n)??yp(),a=new Set(o.expandedAIGroupIds);a.has(r)?a.delete(r):a.add(r),i.set(n,{...o,expandedAIGroupIds:a}),e({tabUIStates:i})},isAIGroupExpandedForTab:(n,r)=>t().tabUIStates.get(n)?.expandedAIGroupIds.has(r)??!1,expandAIGroupForTab:(n,r)=>{const s=t();if(s.tabUIStates.get(n)?.expandedAIGroupIds.has(r))return;const o=new Map(s.tabUIStates),a=o.get(n)??yp(),c=new Set(a.expandedAIGroupIds);c.add(r),o.set(n,{...a,expandedAIGroupIds:c}),e({tabUIStates:o})},toggleDisplayItemExpansionForTab:(n,r,s)=>{const i=t(),o=new Map(i.tabUIStates),a=o.get(n)??yp(),c=new Map(a.expandedDisplayItemIds),l=c.get(r)??new Set,d=new Set(l);d.has(s)?d.delete(s):d.add(s),c.set(r,d),o.set(n,{...a,expandedDisplayItemIds:c}),e({tabUIStates:o})},getExpandedDisplayItemIdsForTab:(n,r)=>t().tabUIStates.get(n)?.expandedDisplayItemIds.get(r)??new Set,expandDisplayItemForTab:(n,r,s)=>{const i=t();if(i.tabUIStates.get(n)?.expandedDisplayItemIds.get(r)?.has(s))return;const c=new Map(i.tabUIStates),l=c.get(n)??yp(),d=new Map(l.expandedDisplayItemIds),p=new Set(d.get(r)??new Set);p.add(s),d.set(r,p),c.set(n,{...l,expandedDisplayItemIds:d}),e({tabUIStates:c})},toggleSubagentTraceExpansionForTab:(n,r)=>{const s=t(),i=new Map(s.tabUIStates),o=i.get(n)??yp(),a=new Set(o.expandedSubagentTraceIds);a.has(r)?a.delete(r):a.add(r),i.set(n,{...o,expandedSubagentTraceIds:a}),e({tabUIStates:i})},expandSubagentTraceForTab:(n,r)=>{const s=t(),i=s.tabUIStates.get(n)??yp();if(i.expandedSubagentTraceIds.has(r))return;const o=new Set(i.expandedSubagentTraceIds);o.add(r);const a=new Map(s.tabUIStates);a.set(n,{...i,expandedSubagentTraceIds:o}),e({tabUIStates:a})},isSubagentTraceExpandedForTab:(n,r)=>t().tabUIStates.get(n)?.expandedSubagentTraceIds.has(r)??!1,setContextPanelVisibleForTab:(n,r)=>{const s=t(),i=new Map(s.tabUIStates),o=i.get(n)??yp();i.set(n,{...o,showContextPanel:r}),e({tabUIStates:i})},isContextPanelVisibleForTab:n=>t().tabUIStates.get(n)?.showContextPanel??!1,setSelectedContextPhaseForTab:(n,r)=>{const s=t(),i=new Map(s.tabUIStates),o=i.get(n)??yp();i.set(n,{...o,selectedContextPhase:r}),e({tabUIStates:i})},saveScrollPositionForTab:(n,r)=>{const s=t(),i=new Map(s.tabUIStates),o=i.get(n)??yp();i.set(n,{...o,savedScrollTop:r}),e({tabUIStates:i})},getScrollPositionForTab:n=>t().tabUIStates.get(n)?.savedScrollTop}),WDt=80;function As(e){if(typeof e.messageId=="string"&&e.messageId.trim().length>0)return e.messageId;const t=(e.text??"").slice(0,WDt);return`${e.timestamp}-${e.from}-${t}`}function GDt(e,t){const n=Date.parse(t.timestamp)-Date.parse(e.timestamp);return n!==0?n:As(e).localeCompare(As(t))}function mZ(...e){const t=new Map;for(const n of e)for(const r of n)t.set(As(r),r);return Array.from(t.values()).sort(GDt)}const HDt="OpenCode runtime delivery is still being checked. Message was saved and will be retried if needed.",ZDt="OpenCode runtime delivery failed. Message was saved to inbox, but live delivery did not complete.";function KDt(e){const t=e.runtimeDelivery;if(t?.attempted!==!0)return{warning:null,debugDetails:null};const n=t.delivered===!1,r=t.responsePending===!0;return!n&&!r?{warning:null,debugDetails:null}:{warning:n?ZDt:HDt,debugDetails:{messageId:e.messageId,providerId:t.providerId,delivered:typeof t.delivered=="boolean"?t.delivered:null,responsePending:typeof t.responsePending=="boolean"?t.responsePending:null,responseState:t.responseState??null,ledgerStatus:t.ledgerStatus??null,acceptanceUnknown:typeof t.acceptanceUnknown=="boolean"?t.acceptanceUnknown:null,reason:t.reason??null,diagnostics:t.diagnostics??[]}}}function JDt(e){return JSON.stringify({messageId:e.messageId,providerId:e.providerId,delivered:e.delivered,responsePending:e.responsePending,responseState:e.responseState,ledgerStatus:e.ledgerStatus,acceptanceUnknown:e.acceptanceUnknown,reason:e.reason,diagnostics:e.diagnostics},null,2)}const eLt=/^(?<source>[a-z0-9-]+)\/(?<model>\S.*)$/i,tLt={anthropic:"Anthropic",azure:"Azure",bedrock:"Bedrock",deepseek:"DeepSeek",gemini:"Gemini",google:"Google",groq:"Groq",minimax:"MiniMax",mistral:"Mistral",moonshot:"Moonshot",ollama:"Ollama",opencode:"OpenCode",openai:"OpenAI","openai-compatible":"OpenAI Compatible",openrouter:"OpenRouter",together:"Together",vertex:"Vertex",xai:"xAI","z-ai":"Z.AI"};function nLt(e){const t=e.trim().toLowerCase();if(!t)return e;const n=tLt[t];return n||t.split("-").filter(Boolean).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")}function PL(e){const t=e?.trim();if(!t)return null;const n=eLt.exec(t);return!n?.groups?.source||!n.groups.model?null:{raw:t,sourceId:n.groups.source.toLowerCase(),modelId:n.groups.model}}function rLt(e){const t=PL(e);return t?nLt(t.sourceId):null}function Ww(e){return e==="anthropic"||e==="codex"||e==="gemini"||e==="opencode"}function xa(e){return Ww(e)?e:void 0}function Eg(e){const t=e?.trim().toLowerCase();if(!t)return;const n=t.replace(/(?:\[1m\])+$/,"");if(t.startsWith("opencode/")||n.startsWith("opencode/"))return"opencode";if(t.startsWith("gpt-")||t.startsWith("codex")||n.startsWith("gpt-")||n.startsWith("codex"))return"codex";if(t.startsWith("gemini")||n.startsWith("gemini"))return"gemini";if(t.startsWith("claude")||n.startsWith("claude")||t==="opus"||n==="opus"||t==="sonnet"||n==="sonnet"||t==="haiku"||n==="haiku")return"anthropic";if(PL(t)||PL(n))return"opencode"}function oge(e){const t=e?.trim();if(t)return t.replace(/(?:\[1m\])+$/,"")||void 0}function Rse(e,t){const n=e?.trim();return n?(t??Eg(n)??Eg(oge(n)))!=="anthropic"?n:oge(n):void 0}const age=Hi("Renderer:unwrapIpc");class Ch extends Error{constructor(t,n,r){super(n),this.operation=t,this.causeError=r,this.name="IpcError"}}const sLt=["TEAM_PROVISIONING","TEAM_DRAFT"];async function nr(e,t){try{return await t()}catch(n){const r=n instanceof Error?n.message:String(n);throw sLt.some(s=>r.includes(s))?age.debug(`[${e}] ${r}`):age.error(`[${e}] ${r}`),new Ch(e,r,n)}}const j0={autoAllowAll:!1,autoAllowFileEdits:!1,autoAllowSafeBash:!1,timeoutAction:"wait",timeoutSeconds:30},iLt=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function oLt(e){return iLt.test(e.trim())}function to(e){const t=e.trim();return t&&(oLt(t)?t.slice(0,8).toLowerCase():t)}function Jg(e){return e.displayId?.trim()||to(e.id)}function Gr(e){return`#${Jg(e)}`}function Gw(e,t){if(!t)return!1;const n=t.trim();return n?e.id===n||Jg(e)===n:!1}const sz="team-lead",lXe="lead",aLt="负责人",lLt=new Set([sz,lXe]),cLt=new Set([sz,lXe,"orchestrator"]),uLt=new Set(["lead"]);function Pse(e){return e?.trim().toLowerCase()??""}function e_(e){return lLt.has(Pse(e))}function dLt(e){return cLt.has(Pse(e))}function pLt(e){return uLt.has(Pse(e))}function Yn(e){const t=typeof e.role=="string"?e.role:null;if(pLt(t))return!0;const n=typeof e.agentType=="string"?e.agentType:null;if(dLt(n))return!0;const r=typeof e.name=="string"?e.name:null;return e_(r)}function FQ(e){const t=e.agentId?.trim();return t||e.name.trim()}const fLt=[[],[{ringIndex:0,sectorIndex:0}],[{ringIndex:0,sectorIndex:0},{ringIndex:0,sectorIndex:1}],[{ringIndex:0,sectorIndex:0},{ringIndex:0,sectorIndex:1},{ringIndex:0,sectorIndex:2}],[{ringIndex:0,sectorIndex:0},{ringIndex:0,sectorIndex:1},{ringIndex:0,sectorIndex:2},{ringIndex:0,sectorIndex:3}]];function cXe(e,t=[]){const n=e.filter(a=>!a.removedAt&&!Yn(a));if(n.length===0)return[];const r=new Map(n.map(a=>[FQ(a),a])),s=[],i=new Set;for(const a of t){if(a.removedAt||Yn(a))continue;const c=FQ(a);!r.has(c)||i.has(c)||(s.push(c),i.add(c))}const o=n.map(a=>FQ(a)).filter(a=>!i.has(a)).toSorted((a,c)=>a.localeCompare(c));return s.push(...o),s}function YQ(e,t=[]){const n=cXe(e,t),r=n.length>0?n.join("|"):null,s=fLt[n.length],i={};return s?.length===n.length&&n.forEach((o,a)=>{i[o]=s[a]}),{orderedVisibleOwnerIds:n,signature:r,assignments:i}}const ru="stable-slots-v1",Cp=Hi("teamSlice"),uXe=3e4,lge=3e4,hLt=5e3,mLt=4e3,OLt=2e3,X0=new Map,fT=new Map,$L=new Set,Hx=new Map,Zx=new Map,d0=new Map,OZ=new Set,Hw=new Map,gZ=new Set,rC=new Map,U0=new Map,NL=new Map,dXe=new Map;let N1=null,xY=!1;const VQ=new Map,_Z=new Map,bZ=new Map;function SY(e){return X0.has(e)||(fT.get(e)?.size??0)>0||$L.has(e)}function cge(e){return NL.get(e)}function gLt(e){return(U0.get(e)?.size??0)>0}function _Lt(){return new Set(Array.from(U0.entries()).filter(([,e])=>e.size>0).map(([e])=>e))}function bLt(e){vZ.delete(e),TZ.delete(e);const t=`${e}:`;for(const n of ML.keys())n.startsWith(t)&&ML.delete(n);for(const n of QL.keys())n.startsWith(t)&&QL.delete(n)}function A1(e){X0.delete(e),fT.delete(e),$L.delete(e),Hx.delete(e),Zx.delete(e),d0.delete(e),OZ.delete(e),Hw.delete(e),gZ.delete(e),NL.delete(e),VQ.delete(e),_Z.delete(e),bZ.delete(e),bLt(e)}function uge(e,t){const n=e.teamMessagesByName[t],r=n&&(n.loadingHead||n.loadingOlder)?{...e.teamMessagesByName,[t]:{...n,loadingHead:!1,loadingOlder:!1}}:null,s=e.selectedTeamName===t&&(e.selectedTeamLoading||e.selectedTeamError!=null);return{...r?{teamMessagesByName:r}:{},...s?{selectedTeamLoading:!1,selectedTeamError:null}:{}}}function pa(e,t){if(!(t in e))return null;const n={...e};return delete n[t],n}function vY(e,t){const n=Object.fromEntries(Object.entries(e.provisioningRuns).filter(([,x])=>x.teamName!==t)),r=pa(e.teamDataCacheByName,t),s=pa(e.teamAgentRuntimeByTeam,t),i=pa(e.teamMessagesByName,t),o=pa(e.memberActivityMetaByTeam,t),a=pa(e.provisioningSnapshotByTeam,t),c=pa(e.currentProvisioningRunIdByTeam,t),l=pa(e.currentRuntimeRunIdByTeam,t),d=pa(e.provisioningStartedAtFloorByTeam,t),p=pa(e.leadActivityByTeam,t),f=pa(e.leadContextByTeam,t),h=pa(e.activeToolsByTeam,t),m=pa(e.finishedVisibleByTeam,t),O=pa(e.toolHistoryByTeam,t),_=pa(e.memberSpawnStatusesByTeam,t),b=pa(e.memberSpawnSnapshotsByTeam,t),y=pa(e.provisioningErrorByTeam,t);return{...Object.keys(n).length!==Object.keys(e.provisioningRuns).length?{provisioningRuns:n}:{},...r?{teamDataCacheByName:r}:{},...s?{teamAgentRuntimeByTeam:s}:{},...i?{teamMessagesByName:i}:{},...o?{memberActivityMetaByTeam:o}:{},...a?{provisioningSnapshotByTeam:a}:{},...c?{currentProvisioningRunIdByTeam:c}:{},...l?{currentRuntimeRunIdByTeam:l}:{},...d?{provisioningStartedAtFloorByTeam:d}:{},...p?{leadActivityByTeam:p}:{},...f?{leadContextByTeam:f}:{},...h?{activeToolsByTeam:h}:{},...m?{finishedVisibleByTeam:m}:{},...O?{toolHistoryByTeam:O}:{},..._?{memberSpawnStatusesByTeam:_}:{},...b?{memberSpawnSnapshotsByTeam:b}:{},...y?{provisioningErrorByTeam:y}:{}}}function dge(e,t,n){const r={...e.ignoredProvisioningRunIds},s={...e.ignoredRuntimeRunIds},i=e.currentProvisioningRunIdByTeam[t],o=e.currentRuntimeRunIdByTeam[t];return i&&(r[i]=t),o&&(s[o]=t),{ignoredProvisioningRunIds:r,ignoredRuntimeRunIds:s,provisioningStartedAtFloorByTeam:{...e.provisioningStartedAtFloorByTeam,[t]:n}}}function Sh(e){return dXe.get(e)??0}function pc(e,t){return Sh(e)===t}function I1(e){dXe.set(e,Sh(e)+1)}function yLt(e){const t=Symbol(e),n=fT.get(e);return n?(n.add(t),t):(fT.set(e,new Set([t])),t)}function xLt(e,t){const n=fT.get(e);n&&(n.delete(t),n.size===0&&fT.delete(e))}function M1(){return new Date().toISOString()}function SLt(e){return new Promise(t=>setTimeout(t,e))}function pge(e){if(e==null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function yZ(e,t){if(Object.is(e,t))return e;if(Array.isArray(e)&&Array.isArray(t)){let n=e.length!==t.length;const r=t.map((s,i)=>{const o=yZ(e[i],s);return Object.is(o,e[i])||(n=!0),o});return n?r:e}if(pge(e)&&pge(t)){const n=e,r=t,s=Object.keys(n),i=Object.keys(r);let o=s.length!==i.length;const a={};for(const c of i){Object.prototype.hasOwnProperty.call(n,c)||(o=!0);const l=yZ(n[c],r[c]);Object.is(l,n[c])||(o=!0),a[c]=l}return o?a:e}return t}function fge(e,t){return e?yZ(e,t):t}const vLt=new Set(["validating","spawning","configuring","assembling","finalizing","verifying"]),AL=new Set(["ready","failed","disconnected","cancelled"]);function hge(e){return e.startsWith("pending:")}function TLt(e){return(e instanceof Error?e.message:String(e)).includes("Unknown runId")}function IL(e,t,n){let r;const s=new Promise((i,o)=>{r=setTimeout(()=>{o(new Error(`Timeout after ${t}ms: ${n}`))},t)});return Promise.race([e,s]).finally(()=>{r&&clearTimeout(r)})}function mge(e){const t=X0.get(e);if(t)return t;const n=IL(nr("team:getData",()=>K.teams.getData(e)),uXe,`team:getData(${e})`).finally(()=>{X0.get(e)===n&&X0.delete(e)});return X0.set(e,n),n}function ELt(e){return IL(nr("team:getData",()=>K.teams.getData(e)),uXe,`team:getData(${e})`)}function wLt(e){const t=Date.now(),n=_Z.get(e)??{windowStartedAt:t,count:0,lastWarnAt:0};return t-n.windowStartedAt>mLt&&(n.windowStartedAt=t,n.count=0),n.count+=1,_Z.set(e,n),n.count}function kLt(e,t){return e===t?!0:!e||!t?e===t:e.confirmedCount===t.confirmedCount&&e.pendingCount===t.pendingCount&&e.failedCount===t.failedCount&&e.skippedCount===t.skippedCount&&e.runtimeAlivePendingCount===t.runtimeAlivePendingCount&&e.shellOnlyPendingCount===t.shellOnlyPendingCount&&e.runtimeProcessPendingCount===t.runtimeProcessPendingCount&&e.runtimeCandidatePendingCount===t.runtimeCandidatePendingCount&&e.noRuntimePendingCount===t.noRuntimePendingCount&&e.permissionPendingCount===t.permissionPendingCount}function CLt(e,t){if(e===t)return!0;if(!e||!t)return e===t;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function RLt(e,t){if(e===t)return!0;if(!e||!t)return e===t;const n=[...e.pendingPermissionRequestIds??[]].sort(),r=[...t.pendingPermissionRequestIds??[]].sort();return e.status===t.status&&e.launchState===t.launchState&&e.error===t.error&&e.hardFailureReason===t.hardFailureReason&&e.skippedForLaunch===t.skippedForLaunch&&e.skipReason===t.skipReason&&e.skippedAt===t.skippedAt&&e.livenessSource===t.livenessSource&&e.runtimeAlive===t.runtimeAlive&&e.runtimeModel===t.runtimeModel&&e.livenessKind===t.livenessKind&&e.runtimeDiagnostic===t.runtimeDiagnostic&&e.runtimeDiagnosticSeverity===t.runtimeDiagnosticSeverity&&e.bootstrapConfirmed===t.bootstrapConfirmed&&e.hardFailure===t.hardFailure&&n.length===r.length&&n.every((s,i)=>s===r[i])}function PLt(e,t){if(e===t)return!0;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const s of n)if(!(s in t)||!RLt(e[s],t[s]))return!1;return!0}function $Lt(e,t){return e?e.runId===t.runId&&e.teamLaunchState===t.teamLaunchState&&e.launchPhase===t.launchPhase&&e.source===t.source&&CLt(e.expectedMembers,t.expectedMembers)&&kLt(e.summary,t.summary)&&PLt(e.statuses,t.statuses):!1}function NLt(e){return e.teamLaunchState==="clean_success"&&e.launchPhase==="finished"&&(e.summary?.confirmedCount??0)>0&&(e.summary?.pendingCount??0)===0&&(e.summary?.failedCount??0)===0&&(e.summary?.skippedCount??0)===0}function ALt(e,t){const n=Date.now(),r=bZ.get(e)??0;n-r<OLt||(bZ.set(e,n),Cp.debug(`[perf] member-spawn snapshot suppressed team=${e} runId=${t??"none"} reason=member-spawn-ui-equal`))}function ILt(e,t){if(e===t)return!0;if(!e||!t)return e===t;const n=e.diagnostics??[],r=t.diagnostics??[];return e.memberName===t.memberName&&e.alive===t.alive&&e.restartable===t.restartable&&e.backendType===t.backendType&&e.providerId===t.providerId&&e.providerBackendId===t.providerBackendId&&e.laneId===t.laneId&&e.laneKind===t.laneKind&&e.pid===t.pid&&e.runtimeModel===t.runtimeModel&&e.rssBytes===t.rssBytes&&e.livenessKind===t.livenessKind&&e.pidSource===t.pidSource&&e.processCommand===t.processCommand&&e.paneId===t.paneId&&e.panePid===t.panePid&&e.paneCurrentCommand===t.paneCurrentCommand&&e.runtimePid===t.runtimePid&&e.runtimeSessionId===t.runtimeSessionId&&e.runtimeDiagnostic===t.runtimeDiagnostic&&e.runtimeDiagnosticSeverity===t.runtimeDiagnosticSeverity&&e.runtimeLastSeenAt===t.runtimeLastSeenAt&&e.historicalBootstrapConfirmed===t.historicalBootstrapConfirmed&&n.length===r.length&&n.every((s,i)=>s===r[i])}function MLt(e,t){if(!e||e.teamName!==t.teamName||e.runId!==t.runId)return!1;const n=Object.keys(e.members),r=Object.keys(t.members);if(n.length!==r.length)return!1;for(const s of n)if(!(s in t.members)||!ILt(e.members[s],t.members[s]))return!1;return!0}function QLt(e,t){const n=Date.parse(e.timestamp),r=Date.parse(t.timestamp),s=Number.isFinite(n),i=Number.isFinite(r);if(s&&i&&n!==r)return n-r;if(s!==i)return s?-1:1;const o=typeof e.messageId=="string"?e.messageId:"",a=typeof t.messageId=="string"?t.messageId:"";return o.localeCompare(a)}const DLt={canonicalMessages:[],optimisticMessages:[],feedRevision:null,nextCursor:null,hasMore:!1,lastFetchedAt:null,loadingHead:!1,loadingOlder:!1,headHydrated:!1,olderHydrated:!1};function Yo(e,t){return e.teamMessagesByName[t]??DLt}function LLt(e,t){const n=[...e.optimisticMessages],r=typeof t.messageId=="string"?t.messageId.trim():"";if(r.length>0){const s=n.findIndex(i=>typeof i.messageId=="string"&&i.messageId.trim()===r);s>=0?n[s]={...n[s],...t}:n.push(t)}else n.push(t);return n.sort(QLt),{...e,optimisticMessages:n}}function jLt(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1){const r=e[n],s=t[n];if(r.messageId!==s.messageId||r.timestamp!==s.timestamp||r.from!==s.from||r.to!==s.to||r.text!==s.text||r.summary!==s.summary||r.read!==s.read||r.actionMode!==s.actionMode||r.commentId!==s.commentId||r.relayOfMessageId!==s.relayOfMessageId||r.source!==s.source||r.leadSessionId!==s.leadSessionId||r.messageKind!==s.messageKind||JSON.stringify(r.taskRefs??null)!==JSON.stringify(s.taskRefs??null))return!1}return!0}function XLt(e,t){if(e.length===0)return[];const n=new Set(t.map(r=>typeof r.messageId=="string"?r.messageId.trim():"").filter(r=>r.length>0));return e.filter(r=>{const s=typeof r.messageId=="string"?r.messageId.trim():"";return!s||!n.has(s)})}function yx(e){const t=rC.get(e);t!=null&&(clearTimeout(t),rC.delete(e))}function Q1(e){U0.delete(e)}function ULt(e,t,n){if(n){const s=U0.get(e)??new Set;return s.add(t),U0.set(e,s),!0}const r=U0.get(e);return r?(r.delete(t),r.size===0?(U0.delete(e),!1):!0):!1}function zLt(e,t){return t<=0?[]:e.slice(0,t)}function BLt(e,t){if(e.length===0)return[];if(t.length===0)return null;const n=new Set(t.map(o=>As(o)));let r=!1;for(const o of e)if(!n.has(As(o))){r=!0;break}if(!r)return[];const s=As(t[t.length-1]),i=e.findIndex(o=>As(o)===s);return i<0?null:e.slice(i+1).filter(o=>!n.has(As(o)))}async function mI(e,t,n){const r=e();if(r.selectedTeamName!==t||!r.selectedTeamData)return;const s=r.selectedTeamData.tasks.find(a=>a.id===n);if(!s)return;const i=Fc(s);if(!Ore(i)||typeof r.invalidateTaskChangePresence!="function"||typeof r.checkTaskHasChanges!="function")return;const o=Ed(t,n,i);r.invalidateTaskChangePresence([o]);try{await r.checkTaskHasChanges(t,n,i)}catch{}}async function Oge(e,t,n){let s=500;for(let i=1;i<=60;i++){const o=e(),a=o.provisioningRuns[t];if(a&&AL.has(a.state))return;try{const c=await o.getProvisioningStatus(t);if(AL.has(c.state))return}catch(c){if(TLt(c)){o.clearMissingProvisioningRun(t);return}}await SLt(s),s=Math.min(1500,Math.round(s*1.5))}}const qQ=new Set,CS=new Set,xZ=new Set,SZ=new Set,Zw=new Set;let gge=!0;function FLt(e,t,n){for(const r of t){const s=`${r.teamName}:${r.id}`;r.needsClarification==="user"?e.find(o=>o.teamName===r.teamName&&o.id===r.id)?.needsClarification!=="user"&&!qQ.has(s)&&(qQ.add(s),YLt(r,!n)):qQ.delete(s)}}function YLt(e,t){const n=e.comments?.length?e.comments[e.comments.length-1]:void 0,r=n?.text||e.description||`${Gr(e)}: ${e.subject}`,s=Ea(r).trim();K.teams?.showMessageNotification({teamName:e.teamName,teamDisplayName:e.teamDisplayName,from:n?.author||"lead",to:"user",summary:`Clarification needed — Task ${Gr(e)}`,body:s,teamEventType:"task_clarification",dedupeKey:`clarification:${e.teamName}:${e.id}:${e.updatedAt??Date.now()}`,suppressToast:t}).catch(()=>{})}function VLt(e,t,n,r){const s=!!n?.notifications?.notifyOnStatusChange&&!!n.notifications.enabled,i=n?.notifications?.statusChangeStatuses??["in_progress","completed"];if(i.length===0)return;const o=n?.notifications?.statusChangeOnlySolo??!0;for(const a of t){const c=e.find(y=>y.teamName===a.teamName&&y.id===a.id);if(!c)continue;const l=Vg(a),d=Vg(c),p=l==="approved"&&d!=="approved",f=l==="review"&&d!=="review",h=a.reviewState==="needsFix"&&c.reviewState!=="needsFix";if(!(c.status!==a.status)&&!p&&!f&&!h)continue;if(o){const y=r[a.teamName];if(y&&y.memberCount>0)continue}const O=p?"approved":f?"review":h?"needsFix":a.status;if(!i.includes(O))continue;const _=`${a.teamName}:${a.id}:${O}`;if(CS.has(_))continue;CS.add(_);const b=p||f?"Completed":c.status;qLt(a,b,p?"approved":f?"review":h?"needsFix":void 0,!s)}}function qLt(e,t,n,r){const s={pending:"Pending",in_progress:"In Progress",completed:"Completed",deleted:"Deleted",review:"Review",needsFix:"Needs Fixes",approved:"Approved"},i=s[t]??t,o=n??e.status,a=s[o]??o;K.teams?.showMessageNotification({teamName:e.teamName,teamDisplayName:e.teamDisplayName,from:e.owner??"system",to:"user",summary:`Task ${Gr(e)}: ${i} → ${a}`,body:e.subject,teamEventType:"task_status_change",dedupeKey:`status:${e.teamName}:${e.id}:${t}:${o}:${e.updatedAt??Date.now()}`,suppressToast:r}).catch(()=>{})}function WLt(e,t,n){const r=new Map(e.map(s=>[`${s.teamName}:${s.id}`,s]));for(const s of t){const i=`${s.teamName}:${s.id}`,a=r.get(i)?.comments?.length??0;if((s.comments?.length??0)<=a)continue;const l=(s.comments??[]).slice(a);for(const d of l){if(d.author==="user"||d.type==="review_request"||d.type==="review_approved")continue;const p=`${s.teamName}:${s.id}:${d.id}`;xZ.has(p)||(xZ.add(p),GLt(s,d,!n))}}}function GLt(e,t,n){if(t.author==="user")return;const r=Ea(t.text).trim(),s=r.length>100?r.slice(0,100)+"...":r;K.teams?.showMessageNotification({teamName:e.teamName,teamDisplayName:e.teamDisplayName,from:t.author,to:"user",summary:`Comment on ${Gr(e)}: ${e.subject}`,body:s,teamEventType:"task_comment",dedupeKey:`comment:${e.teamName}:${e.id}:${t.id}`,suppressToast:n}).catch(()=>{})}function HLt(e,t,n){const r=new Set(e.map(s=>`${s.teamName}:${s.id}`));for(const s of t){const i=`${s.teamName}:${s.id}`;r.has(i)||SZ.has(i)||(SZ.add(i),ZLt(s,!n))}}function ZLt(e,t){K.teams?.showMessageNotification({teamName:e.teamName,teamDisplayName:e.teamDisplayName,from:e.owner??"system",to:"user",summary:`New task ${Gr(e)}: ${e.subject}`,body:Ea(e.description||e.subject).trim(),teamEventType:"task_created",dedupeKey:`created:${e.teamName}:${e.id}`,suppressToast:t}).catch(()=>{})}function KLt(e,t,n){const r=new Map;for(const s of t){const i=r.get(s.teamName)??[];i.push(s),r.set(s.teamName,i)}for(const[s,i]of r){if(i.length===0)continue;if(!i.every(l=>l.status==="completed"||l.status==="deleted")){Zw.delete(s);continue}if(Zw.has(s))continue;const a=e.filter(l=>l.teamName===s);if(a.length>0&&a.every(l=>l.status==="completed"||l.status==="deleted")){Zw.add(s);continue}Zw.add(s),JLt(i[0],i.length,!n)}}function JLt(e,t,n){K.teams?.showMessageNotification({teamName:e.teamName,teamDisplayName:e.teamDisplayName,from:"system",to:"user",summary:`All ${t} tasks completed`,body:`All tasks in team "${e.teamDisplayName}" are done`,teamEventType:"all_tasks_completed",dedupeKey:`all-done:${e.teamName}:${Date.now()}`,suppressToast:n}).catch(()=>{})}function _ge(e,t,n){const r=new Set(n.map(o=>Ed(e,o.id,Fc(o)))),s=[],i=new Set;for(const o of t){const a=Ed(e,o.id,Fc(o));r.has(a)||(s.push(a),i.add(o.id))}return{cacheKeys:s,taskIds:[...i]}}function bge(e,t,n){if(!Array.isArray(t)||t.length===0||n.length===0)return n;const r=new Map(t.map(o=>[o.id,o]));let s=!1;const i=n.map(o=>{if(o.changePresence&&o.changePresence!=="unknown")return o;const a=r.get(o.id);if(!a?.changePresence||a.changePresence==="unknown")return o;const c=Ed(e,a.id,Fc(a)),l=Ed(e,o.id,Fc(o));return c!==l?o:(s=!0,{...o,changePresence:a.changePresence})});return s?i:n}function yge(e){const t=e instanceof Ch||e instanceof Error?e.message:"";return t.includes("Failed to verify inbox write")?"Message was written but not verified (race). Please try again.":t||"Failed to send message"}function xge(e){const t=e instanceof Ch||e instanceof Error?e.message:"";return t.includes("Task status update verification failed")?"Failed to update task status (possible agent conflict).":t||"Failed to perform review action"}const vZ=new Map,ML=new Map,TZ=new Map,e5t=[],t5t=[],QL=new Map;function n5t(e,t){if(t?.latestAuthoredMessageSignalsTermination)return"terminated";if(!t?.lastAuthoredMessageAt)return e.currentTaskId?"active":"idle";const n=Date.now()-Date.parse(t.lastAuthoredMessageAt);return Number.isNaN(n)?"unknown":n<5*60*1e3?"active":"idle"}function r5t(e,t){return e.map(n=>pXe(n,t?.members[n.name]))}function pXe(e,t){return{...e,status:n5t(e,t),messageCount:t?.messageCountExact??0,lastActiveAt:t?.lastAuthoredMessageAt??null}}function s5t(e,t){return e?e.memberName===t.memberName&&e.lastAuthoredMessageAt===t.lastAuthoredMessageAt&&e.messageCountExact===t.messageCountExact&&e.latestAuthoredMessageSignalsTermination===t.latestAuthoredMessageSignalsTermination:!1}function i5t(e,t){if(!e)return t;const n=Object.keys(t),r=Object.keys(e);let s=n.length!==r.length;const i={};for(const o of n){const a=t[o],c=e[o];if(!s5t(c,a)){s=!0,i[o]=a;continue}i[o]=c}return s?i:e}function wi(e,t){return t?e.teamDataCacheByName[t]??(e.selectedTeamName===t?e.selectedTeamData:null):null}function Sl(e,t){const n=wi(e,t);if(!n||!t)return[];const r=e.memberActivityMetaByTeam[t],s=r?.members,i=vZ.get(t);if(i?.snapshotRef===n.members&&i.metaMembersRef===s)return i.result;const o=r5t(n.members,r);return vZ.set(t,{snapshotRef:n.members,metaMembersRef:s,result:o}),o}function fXe(e,t,n){const r=wi(e,t);if(!r||!t||!n)return null;const s=r.members.find(l=>l.name===n);if(!s)return null;const i=e.memberActivityMetaByTeam[t]?.members[n],o=`${t}:${n}`,a=ML.get(o);if(a?.snapshotMemberRef===s&&a.metaEntryRef===i)return a.result;const c=pXe(s,i);return ML.set(o,{snapshotMemberRef:s,metaEntryRef:i,result:c}),c}function $se(e,t){return wi(e,t)?.members??e5t}function o5t(e,t){return wi(e,t)?.tasks??t5t}function a5t(e,t){return wi(e,t)?.isAlive}function iz(e,t){if(!t)return[];const n=Yo(e,t),r=TZ.get(t);if(r?.canonicalRef===n.canonicalMessages&&r.optimisticRef===n.optimisticMessages)return r.result;const s=mZ(n.canonicalMessages,n.optimisticMessages);return TZ.set(t,{canonicalRef:n.canonicalMessages,optimisticRef:n.optimisticMessages,result:s}),s}function hXe(e,t,n){if(!t||!n)return[];const r=iz(e,t),s=`${t}:${n}`,i=QL.get(s);if(i?.messagesRef===r)return i.result;const o=r.filter(a=>a.from===n||a.to===n);return QL.set(s,{messagesRef:r,result:o}),o}function Sge(e,t){const n=e.memberActivityMetaByTeam[t],r=Yo(e,t).feedRevision;return n?r?n.feedRevision!==r:!1:!0}function OI(e,t){const n=Object.entries(e??{}),r=Object.entries(t??{});if(n.length!==r.length)return!1;for(const[s,i]of n){const o=t?.[s];if(o?.ringIndex!==i.ringIndex||o.sectorIndex!==i.sectorIndex)return!1}return!0}function l5t(e,t){if(t.length===0||!e)return{};const n={};for(const r of t){const s=e[r];s&&(n[r]=s)}return n}function c5t(e,t){const n=l5t(e,t);return Object.keys(n).length>0?n:void 0}function u5t(e,t){const n=new Set(t),r=[],s=new Set;for(const i of e??[])!n.has(i)||s.has(i)||(r.push(i),s.add(i));for(const i of t)s.has(i)||(r.push(i),s.add(i));return r}function vge(e,t){return t?e.paneLayout.panes.some(n=>{if(!n.activeTabId)return!1;const r=n.tabs.find(s=>s.id===n.activeTabId);return(r?.type==="team"||r?.type==="graph")&&r.teamName===t}):!1}function d5t(e,t){return t==="TEAM_DRAFT"||t.includes("TEAM_DRAFT")||t===`Team not found: ${e}`||t==="Team config not found"}const EZ="team:launchParams:";function wf(e,t){const n=e.currentProvisioningRunIdByTeam[t];return n?e.provisioningRuns[n]??null:null}function My(e,t){const n=wf(e,t);return n!=null&&vLt.has(n.state)}function p5t(){const e={};try{const t=localStorage;if(!t)return e;for(let n=0;n<t.length;n++){const r=t.key(n);if(r?.startsWith(EZ)){const s=r.slice(EZ.length),i=JSON.parse(t.getItem(r));i&&typeof i=="object"&&(e[s]=i)}}}catch{}return e}function Tge(e,t){try{localStorage?.setItem?.(EZ+e,JSON.stringify(t))}catch{}}function Ege(e,t){return Rse(e,t)}const mXe="team:toolApprovalSettings:";function OXe(e){if(!e)return j0;try{const t=JSON.parse(e),n=j0;return{autoAllowAll:typeof t.autoAllowAll=="boolean"?t.autoAllowAll:n.autoAllowAll,autoAllowFileEdits:typeof t.autoAllowFileEdits=="boolean"?t.autoAllowFileEdits:n.autoAllowFileEdits,autoAllowSafeBash:typeof t.autoAllowSafeBash=="boolean"?t.autoAllowSafeBash:n.autoAllowSafeBash,timeoutAction:typeof t.timeoutAction=="string"&&["allow","deny","wait"].includes(t.timeoutAction)?t.timeoutAction:n.timeoutAction,timeoutSeconds:typeof t.timeoutSeconds=="number"&&Number.isFinite(t.timeoutSeconds)&&t.timeoutSeconds>=5&&t.timeoutSeconds<=300?t.timeoutSeconds:n.timeoutSeconds}}catch{return j0}}function f5t(e){return OXe(localStorage?.getItem?.(mXe+e)??null)}function TY(e,t){try{localStorage?.setItem?.(mXe+e,JSON.stringify(t))}catch{}}function h5t(){return OXe(localStorage?.getItem?.("team:toolApprovalSettings")??null)}const m5t=(e,t)=>({teams:[],teamByName:{},teamBySessionId:{},branchByPath:{},teamsLoading:!1,teamsError:null,globalTasks:[],globalTasksLoading:!1,globalTasksInitialized:!1,globalTasksError:null,selectedTeamName:null,selectedTeamData:null,teamDataCacheByName:{},slotLayoutVersion:ru,graphLayoutModeByTeam:{},gridOwnerOrderByTeam:{},slotAssignmentsByTeam:{},teamMessagesByName:{},memberActivityMetaByTeam:{},graphLayoutSessionByTeam:{},selectedTeamLoading:!1,selectedTeamLoadNonce:0,selectedTeamError:null,sendingMessage:!1,sendMessageError:null,sendMessageWarning:null,sendMessageDebugDetails:null,lastSendMessageResult:null,crossTeamTargets:[],crossTeamTargetsLoading:!1,reviewActionError:null,provisioningRuns:{},provisioningSnapshotByTeam:{},currentProvisioningRunIdByTeam:{},currentRuntimeRunIdByTeam:{},ignoredProvisioningRunIds:{},ignoredRuntimeRunIds:{},provisioningStartedAtFloorByTeam:{},leadActivityByTeam:{},leadContextByTeam:{},activeToolsByTeam:{},finishedVisibleByTeam:{},toolHistoryByTeam:{},memberSpawnStatusesByTeam:{},memberSpawnSnapshotsByTeam:{},teamAgentRuntimeByTeam:{},provisioningErrorByTeam:{},clearProvisioningError:n=>e(r=>{if(!n)return{provisioningErrorByTeam:{}};if(!(n in r.provisioningErrorByTeam))return{};const s={...r.provisioningErrorByTeam};return delete s[n],{provisioningErrorByTeam:s}}),launchParamsByTeam:p5t(),fetchMemberSpawnStatuses:async n=>{if(!(!K.teams?.getMemberSpawnStatuses||(VQ.get(n)??0)>Date.now()))try{const s=await K.teams.getMemberSpawnStatuses(n);VQ.delete(n),e(i=>{const o=NLt(s);if(s.runId!=null&&i.ignoredRuntimeRunIds[s.runId]===n&&!o)return{};if(i.currentRuntimeRunIdByTeam[n]==null&&i.leadActivityByTeam[n]==="offline"&&s.runId!=null&&!o)return{};if(s.runId!=null&&i.currentRuntimeRunIdByTeam[n]!=null&&i.currentRuntimeRunIdByTeam[n]!==s.runId&&!o)return{};const a=s.runId==null||i.currentRuntimeRunIdByTeam[n]!=null?i.currentRuntimeRunIdByTeam:{...i.currentRuntimeRunIdByTeam,[n]:s.runId},c=i.memberSpawnSnapshotsByTeam[n];return $Lt(c,s)?(ALt(n,s.runId),a===i.currentRuntimeRunIdByTeam?{}:{currentRuntimeRunIdByTeam:a}):{currentRuntimeRunIdByTeam:a,memberSpawnStatusesByTeam:{...i.memberSpawnStatusesByTeam,[n]:s.statuses},memberSpawnSnapshotsByTeam:{...i.memberSpawnSnapshotsByTeam,[n]:s}}})}catch(s){(s instanceof Error?s.message:String(s)).includes("No handler registered for 'team:memberSpawnStatuses'")&&VQ.set(n,Date.now()+hLt)}},fetchTeamAgentRuntime:async n=>{if(K.teams?.getTeamAgentRuntime)try{const r=await K.teams.getTeamAgentRuntime(n);e(s=>{if(r.runId!=null&&s.ignoredRuntimeRunIds[r.runId]===n)return{};if(r.runId!=null&&s.currentRuntimeRunIdByTeam[n]!=null&&s.currentRuntimeRunIdByTeam[n]!==r.runId)return{};const i=s.teamAgentRuntimeByTeam[n];return MLt(i,r)?{}:{teamAgentRuntimeByTeam:{...s.teamAgentRuntimeByTeam,[n]:r}}})}catch{}},kanbanFilterQuery:null,globalTaskDetail:null,pendingMemberProfile:null,openMemberProfile:n=>e({pendingMemberProfile:n}),closeMemberProfile:()=>e({pendingMemberProfile:null}),pendingReviewRequest:null,setPendingReviewRequest:n=>e({pendingReviewRequest:n}),openGlobalTaskDetail:(n,r)=>{e({globalTaskDetail:{teamName:n,taskId:r}})},closeGlobalTaskDetail:()=>e({globalTaskDetail:null}),addingComment:!1,addCommentError:null,provisioningProgressUnsubscribe:null,deletedTasks:[],deletedTasksLoading:!1,pendingApprovals:[],resolvedApprovals:new Map,toolApprovalSettings:h5t(),messagesPanelMode:"sidebar",messagesPanelWidth:340,sidebarLogsHeight:213,setMessagesPanelMode:n=>e({messagesPanelMode:n}),setMessagesPanelWidth:n=>e({messagesPanelWidth:n}),setSidebarLogsHeight:n=>e({sidebarLogsHeight:n}),fetchBranches:async n=>{const r=await Promise.all(n.map(async i=>{try{const o=await K.teams.getProjectBranch(i);return[fr(i),o]}catch{return[fr(i),null]}})),s=Object.fromEntries(r);Object.keys(s).length>0&&e(i=>{let o=!1;for(const[a,c]of Object.entries(s))if(i.branchByPath[a]!==c){o=!0;break}return o?{branchByPath:{...i.branchByPath,...s}}:{}})},fetchTeams:async()=>{if(t().teamsLoading)return;const n=t().teams.length===0;n&&e({teamsLoading:!0,teamsError:null});try{const r=await IL(nr("team:list",()=>K.teams.list()),lge,"fetchTeams"),s={},i={};for(const o of r)if(s[o.teamName]=o,o.leadSessionId&&(i[o.leadSessionId]=o),Array.isArray(o.sessionHistory))for(const a of o.sessionHistory)typeof a=="string"&&a&&(i[a]=o);e(o=>{const a={...o.provisioningSnapshotByTeam};for(const c of r)delete a[c.teamName];return{teams:r,teamByName:s,teamBySessionId:i,teamsLoading:!1,teamsError:null,provisioningSnapshotByTeam:a}})}catch(r){e({teamsLoading:!1,teamsError:n?r instanceof Ch||r instanceof Error?r.message:"Failed to fetch teams":null})}},fetchAllTasks:async()=>{if(N1){xY=!0,await N1;return}const r=(async()=>{do{xY=!1;const s=!t().globalTasksInitialized;s&&e({globalTasksLoading:!0,globalTasksError:null});const i=t().globalTasks,o=gge;gge=!1;try{const a=await IL(nr("team:getAllTasks",()=>K.teams.getAllTasks()),lge,"fetchAllTasks");if(o){for(const l of a){l.needsClarification==="user"&&qQ.add(`${l.teamName}:${l.id}`),CS.add(`${l.teamName}:${l.id}:${l.status}`),l.reviewState==="needsFix"&&CS.add(`${l.teamName}:${l.id}:needsFix`),Vg(l)==="approved"&&CS.add(`${l.teamName}:${l.id}:approved`),Vg(l)==="review"&&CS.add(`${l.teamName}:${l.id}:review`);for(const d of l.comments??[])xZ.add(`${l.teamName}:${l.id}:${d.id}`);SZ.add(`${l.teamName}:${l.id}`)}const c=new Map;for(const l of a){const d=c.get(l.teamName)??[];d.push(l),c.set(l.teamName,d)}for(const[l,d]of c)d.every(p=>p.status==="completed"||p.status==="deleted")&&Zw.add(l)}else{const c=t().appConfig?.notifications?.notifyOnClarifications??!0;FLt(i,a,c),VLt(i,a,t().appConfig,t().teamByName);const l=t().appConfig?.notifications?.notifyOnTaskComments??!0;WLt(i,a,l);const d=t().appConfig?.notifications?.notifyOnTaskCreated??!0;HLt(i,a,d);const p=t().appConfig?.notifications?.notifyOnAllTasksCompleted??!0;KLt(i,a,p)}e({globalTasks:a,globalTasksLoading:!1,globalTasksInitialized:!0,globalTasksError:null})}catch(a){e({globalTasksLoading:!1,globalTasksInitialized:!0,globalTasksError:s?a instanceof Ch||a instanceof Error?a.message:"Failed to fetch tasks":null})}}while(xY)})().finally(()=>{N1===r&&(N1=null)});N1=r,await r},openTeamsTab:()=>{const n=t(),s=n.paneLayout.panes.find(i=>i.id===n.paneLayout.focusedPaneId)?.tabs.find(i=>i.type==="teams");if(s){n.setActiveTab(s.id);return}n.openTab({type:"teams",label:"团队"})},openTeamTab:(n,r,s)=>{if(!n.trim())return;if(r){const p=t(),f=fr(r),h=p.projects.find(m=>fr(m.path)===f);h&&p.selectedProjectId!==h.id&&p.selectProject(h.id)}const i=t(),o=i.teamByName[n],a=i.selectedTeamName===n?i.selectedTeamData?.config.name:void 0,c=o?.displayName||a||n,d=i.getAllPaneTabs().find(p=>p.type==="team"&&p.teamName===n);d?(i.setActiveTab(d.id),d.label!==c&&i.updateTabLabel(d.id,c)):i.openTab({type:"team",label:c,teamName:n})},clearKanbanFilter:()=>{e({kanbanFilterQuery:null})},ensureTeamGraphSlotAssignments:(n,r,s=[])=>{e(i=>{const o={};let a=!1,c=i.slotAssignmentsByTeam,l=i.graphLayoutSessionByTeam;i.slotLayoutVersion!==ru&&(o.slotLayoutVersion=ru,c={},l={},a=!0);const d=YQ(r,s),p=c5t(c[n],d.orderedVisibleOwnerIds),f=l[n];return f?.mode==="manual"?OI(c[n],p)||(c={...c},p?c[n]=p:delete c[n],a=!0):((!OI(c[n],p)||!OI(p,d.assignments))&&(c={...c},Object.keys(d.assignments).length===0?delete c[n]:c[n]=d.assignments,a=!0),(f?.mode!=="default"||f?.signature!==d.signature)&&(l={...l,[n]:{mode:"default",signature:d.signature}},a=!0)),a?(o.slotAssignmentsByTeam=c,o.graphLayoutSessionByTeam=l,o):{}})},setTeamGraphOwnerSlotAssignment:(n,r,s)=>{e(i=>{const o=i.slotAssignmentsByTeam[n]??{},a=o[r],c=Object.entries(o).find(([l,d])=>l!==r&&d.ringIndex===s.ringIndex&&d.sectorIndex===s.sectorIndex);return a?.ringIndex===s.ringIndex&&a?.sectorIndex===s.sectorIndex&&i.slotLayoutVersion===ru?{}:c?(Cp.warn(`[graph-layout] refusing occupied slot assignment team=${n} owner=${r} target=${s.ringIndex}:${s.sectorIndex} occupiedBy=${c[0]}`),{}):{slotLayoutVersion:ru,slotAssignmentsByTeam:{...i.slotAssignmentsByTeam,[n]:{...o,[r]:s}},graphLayoutSessionByTeam:{...i.graphLayoutSessionByTeam,[n]:{mode:"manual",signature:i.graphLayoutSessionByTeam[n]?.signature??null}}}})},commitTeamGraphOwnerSlotDrop:(n,r,s,i,o)=>{e(a=>{const c=a.slotAssignmentsByTeam[n]??{},l=c[r],d={...c,[r]:s};if(l?.ringIndex===s.ringIndex&&l?.sectorIndex===s.sectorIndex&&!i&&a.slotLayoutVersion===ru)return{};i&&o&&(d[i]=o);const p=Object.entries(d).find(([f,h])=>f===r||f===i?!1:h.ringIndex===s.ringIndex&&h.sectorIndex===s.sectorIndex||h.ringIndex===o?.ringIndex&&h.sectorIndex===o.sectorIndex);return p?(Cp.warn(`[graph-layout] refusing slot drop team=${n} owner=${r} target=${s.ringIndex}:${s.sectorIndex} conflict=${p[0]}`),{}):{slotLayoutVersion:ru,slotAssignmentsByTeam:{...a.slotAssignmentsByTeam,[n]:d},graphLayoutSessionByTeam:{...a.graphLayoutSessionByTeam,[n]:{mode:"manual",signature:a.graphLayoutSessionByTeam[n]?.signature??null}}}})},setTeamGraphLayoutMode:(n,r)=>{e(s=>(s.graphLayoutModeByTeam[n]??"radial")===r?{}:{graphLayoutModeByTeam:{...s.graphLayoutModeByTeam,[n]:r}})},swapTeamGraphGridOwners:(n,r,s)=>{r!==s&&e(i=>{const o=wi(i,n),a=[...i.gridOwnerOrderByTeam[n]??[]];for(const h of[r,s])a.includes(h)||a.push(h);const c=o?YQ(o.members,o.config.members??[]).orderedVisibleOwnerIds:a,l=u5t(i.gridOwnerOrderByTeam[n],c),d=l.indexOf(r),p=l.indexOf(s);if(d<0||p<0)return{};const f=[...l];return f[d]=s,f[p]=r,{gridOwnerOrderByTeam:{...i.gridOwnerOrderByTeam,[n]:f}}})},swapTeamGraphOwnerSlots:(n,r,s)=>{r!==s&&e(i=>{const o=i.slotAssignmentsByTeam[n]??{},a=o[r],c=o[s];return!a||!c?{}:{slotLayoutVersion:ru,slotAssignmentsByTeam:{...i.slotAssignmentsByTeam,[n]:{...o,[r]:c,[s]:a}},graphLayoutSessionByTeam:{...i.graphLayoutSessionByTeam,[n]:{mode:"manual",signature:i.graphLayoutSessionByTeam[n]?.signature??null}}}})},clearTeamGraphSlotAssignments:n=>{e(r=>{if(!n)return Object.keys(r.slotAssignmentsByTeam).length===0&&r.slotLayoutVersion===ru&&Object.keys(r.graphLayoutSessionByTeam).length===0?{}:{slotLayoutVersion:ru,slotAssignmentsByTeam:{},graphLayoutSessionByTeam:{}};if(!(n in r.slotAssignmentsByTeam)&&!(n in r.graphLayoutSessionByTeam))return{};const s={...r.slotAssignmentsByTeam},i={...r.graphLayoutSessionByTeam};return delete s[n],delete i[n],{slotLayoutVersion:ru,slotAssignmentsByTeam:s,graphLayoutSessionByTeam:i}})},resetTeamGraphSlotAssignmentsToDefaults:n=>{e(r=>{const s=wi(r,n),i=s?YQ(s.members,s.config.members??[]):{signature:null,assignments:{}},o=r.slotAssignmentsByTeam[n],a=r.graphLayoutSessionByTeam[n];if(OI(o,i.assignments)&&a?.mode==="default"&&a.signature===i.signature)return{};const c={...r.slotAssignmentsByTeam};return Object.keys(i.assignments).length===0?delete c[n]:c[n]=i.assignments,{slotLayoutVersion:ru,slotAssignmentsByTeam:c,graphLayoutSessionByTeam:{...r.graphLayoutSessionByTeam,[n]:{mode:"default",signature:i.signature}}}})},setSelectedTeamTaskChangePresence:(n,r,s)=>{e(i=>{const o=wi(i,n);let a=!1;const c=o?{...o,tasks:o.tasks.map(p=>p.id!==r||p.changePresence===s?p:(a=!0,{...p,changePresence:s}))}:null;let l=!1;const d=i.globalTasks.map(p=>p.teamName!==n||p.id!==r||p.changePresence===s?p:(l=!0,{...p,changePresence:s}));return!a&&!l?{}:{...a&&c?{teamDataCacheByName:{...i.teamDataCacheByName,[n]:c}}:{},...a&&i.selectedTeamName===n&&c?{selectedTeamData:c}:{},...l?{globalTasks:d}:{}}})},refreshTeamChangePresence:async n=>{if(wi(t(),n))try{const s=await nr("team:getTaskChangePresence",()=>K.teams.getTaskChangePresence(n));e(i=>{const o=wi(i,n);if(!o)return{};let a=!1;const c=o.tasks.map(d=>{const p=s[d.id]??"unknown";return d.changePresence===p?d:(a=!0,{...d,changePresence:p})});if(!a)return{};const l={...o,tasks:c};return{teamDataCacheByName:{...i.teamDataCacheByName,[n]:l},...i.selectedTeamName===n?{selectedTeamData:l}:{}}})}catch{}},selectTeam:async(n,r)=>{const s=Sh(n),i=r?.allowReloadWhileProvisioning===!0;if(t().selectedTeamLoading&&t().selectedTeamName===n&&!i)return;const o=t().selectedTeamLoadNonce+1,a=wi(t(),n);e({selectedTeamName:n,selectedTeamData:a,selectedTeamLoading:!0,selectedTeamLoadNonce:o,selectedTeamError:null,reviewActionError:null,toolApprovalSettings:f5t(n)});try{const c=await mge(n);if(!pc(n,s)||t().selectedTeamName!==n||t().selectedTeamLoadNonce!==o)return;const l=t().teamByName,d=l[n],p=c.config.color;if(p&&(!d||d?.color!==p)){const S=d?{...d,color:p,displayName:c.config.name||n}:{teamName:n,displayName:c.config.name||n,description:c.config.description??"",color:p,memberCount:c.members.length,taskCount:0,lastActivity:null};e({teamByName:{...l,[n]:S}})}const f=a?{...c,tasks:bge(n,a.tasks,c.tasks)}:c,h=fge(a,f);e(S=>{const v=S.teamDataCacheByName[n]===h?S.teamDataCacheByName:{...S.teamDataCacheByName,[n]:h};return{selectedTeamName:n,selectedTeamData:h,teamDataCacheByName:v,selectedTeamLoading:!1,selectedTeamError:null}}),NL.set(n,Date.now());const m=a?_ge(n,a.tasks,c.tasks):{cacheKeys:[],taskIds:[]};m.cacheKeys.length>0&&t().invalidateTaskChangePresence(m.cacheKeys),m.taskIds.length>0&&await K.review.invalidateTaskChangeSummaries(n,m.taskIds);const O=c.config.name||n,b=t().getAllPaneTabs().filter(S=>(S.type==="team"||S.type==="graph")&&S.teamName===n);for(const S of b){const v=S.type==="graph"?`${O} Graph`:O;S.label!==v&&t().updateTabLabel(S.id,v)}if(((await t().refreshTeamMessagesHead(n)).feedChanged||Sge(t(),n))&&await t().refreshMemberActivityMeta(n),r?.skipProjectAutoSelect)return;const x=c.config.projectPath;if(x){const S=t(),v=fr(x),T=S.projects.find(E=>fr(E.path)===v);if(T&&S.selectedProjectId!==T.id)S.selectProject(T.id);else if(!T)for(const E of S.repositoryGroups){const w=E.worktrees.find(P=>fr(P.path)===v);if(w){S.selectedWorktreeId!==w.id&&(e(kU(E.id,w.id)),t().fetchSessionsInitial(w.id));break}}}}catch(c){if(!pc(n,s))return;const l=t();if(l.selectedTeamName!==n||l.selectedTeamLoadNonce!==o)return;const d=My(l,n),p=c instanceof Error?c.message:String(c);if(p==="TEAM_PROVISIONING"||p.includes("TEAM_PROVISIONING")&&d){e({selectedTeamLoading:!0,selectedTeamData:null,selectedTeamError:null});return}if(p==="TEAM_DRAFT"||p.includes("TEAM_DRAFT")){e({selectedTeamLoading:!1,selectedTeamData:null,selectedTeamError:"TEAM_DRAFT"});return}const f=c instanceof Ch||c instanceof Error?c.message:"Failed to fetch team data";e({selectedTeamLoading:!1,selectedTeamData:null,selectedTeamError:f})}},refreshTeamData:async(n,r)=>{const s=Sh(n),i=yLt(n),o=r?.withDedup===!0&&X0.has(n);wLt(n),o&&$L.add(n);try{const a=wi(t(),n),c=r?.withDedup?await mge(n):await ELt(n);if(!pc(n,s))return;const l=a?{...c,tasks:bge(n,a.tasks,c.tasks)}:c,d=fge(a,l);e(f=>{const h=f.teamDataCacheByName[n]===d?f.teamDataCacheByName:{...f.teamDataCacheByName,[n]:d},m=f.selectedTeamName===n?{selectedTeamData:d,selectedTeamError:null}:{};return h===f.teamDataCacheByName&&(f.selectedTeamName!==n||f.selectedTeamData===d&&f.selectedTeamError==null)?{}:{teamDataCacheByName:h,...m}}),NL.set(n,Date.now());const p=a?_ge(n,a.tasks,c.tasks):{cacheKeys:[],taskIds:[]};p.cacheKeys.length>0&&t().invalidateTaskChangePresence(p.cacheKeys),p.taskIds.length>0&&await K.review.invalidateTaskChangeSummaries(n,p.taskIds)}catch(a){if(!pc(n,s))return;const c=a instanceof Ch||a instanceof Error?a.message:"Failed to refresh team data";if(c==="TEAM_PROVISIONING"||c.includes("TEAM_PROVISIONING")){Cp.debug(`refreshTeamData(${n}) skipped: team is still provisioning`),t().selectedTeamName===n&&e({selectedTeamError:null});return}if(d5t(n,c)){e(l=>{const d=l.teamDataCacheByName[n]?{...l.teamDataCacheByName}:null;return d&&delete d[n],l.selectedTeamName!==n&&!d?{}:{...d?{teamDataCacheByName:d}:{},...l.selectedTeamName===n?{selectedTeamLoading:!1,selectedTeamData:null,selectedTeamError:c==="TEAM_DRAFT"||c.includes("TEAM_DRAFT")?"TEAM_DRAFT":c}:{}}});return}if(t().selectedTeamName!==n)return;if(Cp.warn(`refreshTeamData(${n}) failed: ${c}`),t().selectedTeamData){Cp.debug(`refreshTeamData(${n}) preserving existing data after transient error`),e({selectedTeamError:null});return}e({selectedTeamError:c})}finally{xLt(n,i),o&&$L.delete(n)&&t().refreshTeamData(n)}},refreshTeamMessagesHead:async n=>{const r=Hx.get(n);if(r)return OZ.add(n),r;const s=d0.get(n);if(s)return s;const i=Zx.get(n);if(i){const c=Sh(n),l=i.then(()=>{if(!pc(n,c))return{feedChanged:!1,headChanged:!1,feedRevision:null};if(d0.get(n)===l)d0.delete(n);else return{feedChanged:!1,headChanged:!1,feedRevision:null};return t().refreshTeamMessagesHead(n)}).finally(()=>{d0.get(n)===l&&d0.delete(n)});return d0.set(n,l),l}const o={current:null};o.current=(async()=>{const c=Sh(n);e(l=>({teamMessagesByName:{...l.teamMessagesByName,[n]:{...Yo(l,n),loadingHead:!0}}}));try{const l=await nr("team:getMessagesPage",()=>K.teams.getMessagesPage(n,{limit:50}));if(!pc(n,c))return{feedChanged:!1,headChanged:!1,feedRevision:null};const d=Yo(t(),n),p=!d.headHydrated||d.feedRevision!==l.feedRevision,f=zLt(d.canonicalMessages,l.messages.length),h=!jLt(f,l.messages);return e(m=>{const O=Yo(m,n),_=BLt(O.canonicalMessages,l.messages),b=O.olderHydrated&&Array.isArray(_)&&_.length>0,y=h?b?mZ(_,l.messages):l.messages:O.canonicalMessages,x=XLt(O.optimisticMessages,y),S={...O,canonicalMessages:y,optimisticMessages:x,feedRevision:l.feedRevision,nextCursor:b?O.nextCursor:l.nextCursor,hasMore:b?O.hasMore:l.hasMore,lastFetchedAt:Date.now(),loadingHead:!1,headHydrated:!0,olderHydrated:b?O.olderHydrated:!1};return{teamMessagesByName:{...m.teamMessagesByName,[n]:S}}}),{feedChanged:p,headChanged:h,feedRevision:l.feedRevision}}catch(l){if(!pc(n,c))return{feedChanged:!1,headChanged:!1,feedRevision:null};throw e(d=>({teamMessagesByName:{...d.teamMessagesByName,[n]:{...Yo(d,n),loadingHead:!1}}})),l}finally{Hx.get(n)===o.current&&(Hx.delete(n),OZ.delete(n)&&t().refreshTeamMessagesHead(n))}})();const a=o.current;return Hx.set(n,a),a},loadOlderTeamMessages:async n=>{const r=Sh(n),s=Zx.get(n);if(s)return s;const i=Hx.get(n);if(i&&(await i,!pc(n,r)))return;let o=Yo(t(),n);if(!o.headHydrated){if(await t().refreshTeamMessagesHead(n),!pc(n,r))return;o=Yo(t(),n)}if(!o.headHydrated||!o.nextCursor||o.loadingOlder||o.loadingHead)return;const a={current:null};a.current=(async()=>{const l=Sh(n);e(d=>({teamMessagesByName:{...d.teamMessagesByName,[n]:{...Yo(d,n),loadingOlder:!0}}}));try{const d=o.feedRevision,p=await nr("team:getMessagesPage",()=>K.teams.getMessagesPage(n,{cursor:o.nextCursor,limit:50}));if(!pc(n,l))return;const f=Yo(t(),n);if(f.feedRevision!==d){e(h=>({teamMessagesByName:{...h.teamMessagesByName,[n]:{...Yo(h,n),loadingOlder:!1}}})),await t().refreshTeamMessagesHead(n);return}if(f.feedRevision&&f.feedRevision!==p.feedRevision){e(h=>({teamMessagesByName:{...h.teamMessagesByName,[n]:{...Yo(h,n),loadingOlder:!1}}})),await t().refreshTeamMessagesHead(n);return}e(h=>{const m=Yo(h,n),O=mZ(m.canonicalMessages,p.messages);return{teamMessagesByName:{...h.teamMessagesByName,[n]:{...m,canonicalMessages:O,nextCursor:p.nextCursor,hasMore:p.hasMore,feedRevision:p.feedRevision,loadingOlder:!1,olderHydrated:!0}}}})}catch{if(!pc(n,l))return;e(d=>({teamMessagesByName:{...d.teamMessagesByName,[n]:{...Yo(d,n),loadingOlder:!1}}}))}finally{Zx.get(n)===a.current&&Zx.delete(n)}})();const c=a.current;return Zx.set(n,c),c},refreshMemberActivityMeta:async n=>{if(!Yo(t(),n).headHydrated)return;const s=Hw.get(n);if(s)return gZ.add(n),s;const i={current:null};i.current=(async()=>{const a=Sh(n);try{const c=await nr("team:getMemberActivityMeta",()=>K.teams.getMemberActivityMeta(n));if(!pc(n,a))return;e(l=>{const d=Yo(l,n).feedRevision;if(d&&c.feedRevision!==d)return{};const p=l.memberActivityMetaByTeam[n];if(p?.feedRevision===c.feedRevision)return{};const f=i5t(p?.members,c.members),h=p?.members===f&&p.feedRevision===c.feedRevision&&p.computedAt===c.computedAt?p:{...c,members:f};return{memberActivityMetaByTeam:{...l.memberActivityMetaByTeam,[n]:h}}})}catch(c){if(!pc(n,a))return;throw c}finally{Hw.get(n)===i.current&&(Hw.delete(n),gZ.delete(n)&&t().refreshMemberActivityMeta(n))}})();const o=i.current;return Hw.set(n,o),o},syncTeamPendingReplyRefresh:(n,r,s,i=1e4)=>{if(yx(n),!ULt(n,r,s))return;const a=setTimeout(()=>{rC.get(n)===a&&(rC.delete(n),(async()=>{try{((await t().refreshTeamMessagesHead(n)).feedChanged||Sge(t(),n))&&await t().refreshMemberActivityMeta(n)}catch{}})())},i);rC.set(n,a)},updateKanban:async(n,r,s)=>{try{e({reviewActionError:null}),await nr("team:updateKanban",()=>K.teams.updateKanban(n,r,s)),await t().refreshTeamData(n)}catch(i){throw e({reviewActionError:xge(i)}),i}},updateKanbanColumnOrder:async(n,r,s)=>{await nr("team:updateKanbanColumnOrder",()=>K.teams.updateKanbanColumnOrder(n,r,s)),await t().refreshTeamData(n)},sendTeamMessage:async(n,r)=>{e({sendingMessage:!0,sendMessageError:null,sendMessageWarning:null,sendMessageDebugDetails:null,lastSendMessageResult:null});try{const s=await nr("team:sendMessage",()=>K.teams.sendMessage(n,r)),i=s.runtimeDelivery?.attempted===!0&&s.runtimeDelivery.delivered===!1,o=KDt(s),a={from:r.from??"user",to:r.to??r.member,text:r.text,timestamp:r.timestamp??M1(),read:!0,taskRefs:r.taskRefs?.length?r.taskRefs:void 0,actionMode:r.actionMode,summary:r.summary,color:r.color,messageId:s.messageId,relayOfMessageId:r.relayOfMessageId,source:r.source??"user_sent",attachments:r.attachments?.length?r.attachments:void 0,leadSessionId:r.leadSessionId,conversationId:r.conversationId,replyToConversationId:r.replyToConversationId,toolSummary:r.toolSummary,toolCalls:r.toolCalls,messageKind:r.messageKind,slashCommand:r.slashCommand,commandOutput:r.commandOutput};return e(c=>({sendingMessage:!1,sendMessageError:null,sendMessageWarning:o.warning,sendMessageDebugDetails:o.debugDetails,lastSendMessageResult:i?null:s,teamMessagesByName:{...c.teamMessagesByName,[n]:LLt(Yo(c,n),a)}})),await t().refreshTeamMessagesHead(n),s}catch(s){throw e({sendingMessage:!1,lastSendMessageResult:null,sendMessageWarning:null,sendMessageDebugDetails:null,sendMessageError:yge(s)}),s}},fetchCrossTeamTargets:async()=>{e({crossTeamTargetsLoading:!0});try{const n=await K.crossTeam.listTargets();e({crossTeamTargets:n,crossTeamTargetsLoading:!1})}catch(n){Cp.error("fetchCrossTeamTargets failed",n),e({crossTeamTargets:[],crossTeamTargetsLoading:!1})}},sendCrossTeamMessage:async n=>{e({sendingMessage:!0,sendMessageError:null,sendMessageWarning:null,sendMessageDebugDetails:null,lastSendMessageResult:null});try{const r=await K.crossTeam.send(n);e({sendingMessage:!1,sendMessageError:null,sendMessageWarning:null,sendMessageDebugDetails:null,lastSendMessageResult:{messageId:r.messageId,deliveredToInbox:r.deliveredToInbox,deduplicated:r.deduplicated}}),await t().refreshTeamMessagesHead(n.fromTeam)}catch(r){e({sendingMessage:!1,lastSendMessageResult:null,sendMessageWarning:null,sendMessageDebugDetails:null,sendMessageError:yge(r)})}},requestReview:async(n,r)=>{try{e({reviewActionError:null}),await nr("team:requestReview",()=>K.teams.requestReview(n,r)),await t().refreshTeamData(n),mI(t,n,r)}catch(s){throw e({reviewActionError:xge(s)}),s}},createTeamTask:async(n,r)=>{const s=await nr("team:createTask",()=>K.teams.createTask(n,r));return await t().refreshTeamData(n),s},startTask:async(n,r)=>{const s=await nr("team:startTask",()=>K.teams.startTask(n,r));return await t().refreshTeamData(n),mI(t,n,r),s},startTaskByUser:async(n,r)=>{const s=await nr("team:startTaskByUser",()=>K.teams.startTaskByUser(n,r));return await t().refreshTeamData(n),mI(t,n,r),s},updateTaskStatus:async(n,r,s)=>{await nr("team:updateTaskStatus",()=>K.teams.updateTaskStatus(n,r,s)),await t().refreshTeamData(n),mI(t,n,r)},updateTaskOwner:async(n,r,s)=>{await nr("team:updateTaskOwner",()=>K.teams.updateTaskOwner(n,r,s)),await t().refreshTeamData(n)},updateTaskFields:async(n,r,s)=>{await nr("team:updateTaskFields",()=>K.teams.updateTaskFields(n,r,s)),await t().refreshTeamData(n)},addTaskRelationship:async(n,r,s,i)=>{await nr("team:addTaskRelationship",()=>K.teams.addTaskRelationship(n,r,s,i)),await t().refreshTeamData(n)},removeTaskRelationship:async(n,r,s,i)=>{await nr("team:removeTaskRelationship",()=>K.teams.removeTaskRelationship(n,r,s,i)),await t().refreshTeamData(n)},setTaskNeedsClarification:async(n,r,s)=>{await nr("team:setTaskClarification",()=>K.teams.setTaskClarification(n,r,s)),await t().refreshTeamData(n),await t().fetchAllTasks()},saveTaskAttachment:async(n,r,s)=>{const i=crypto.randomUUID();await nr("team:saveTaskAttachment",()=>K.teams.saveTaskAttachment(n,r,i,s.name,s.type,s.base64)),await t().refreshTeamData(n)},deleteTaskAttachment:async(n,r,s,i)=>{await nr("team:deleteTaskAttachment",()=>K.teams.deleteTaskAttachment(n,r,s,i)),await t().refreshTeamData(n)},getTaskAttachmentData:async(n,r,s,i)=>nr("team:getTaskAttachment",()=>K.teams.getTaskAttachment(n,r,s,i)),addTaskComment:async(n,r,s)=>{e({addingComment:!0,addCommentError:null});try{const i=await nr("team:addTaskComment",()=>K.teams.addTaskComment(n,r,s));return e({addingComment:!1}),await t().refreshTeamData(n),i}catch(i){const o=i instanceof Error?i.message:"Failed to add comment";throw e({addingComment:!1,addCommentError:o}),i}},addMember:async(n,r)=>{await nr("team:addMember",()=>K.teams.addMember(n,r)),await Promise.allSettled([t().refreshTeamData(n),t().fetchMemberSpawnStatuses(n),t().fetchTeamAgentRuntime(n)])},restartMember:async(n,r)=>{try{await nr("team:restartMember",()=>K.teams.restartMember(n,r))}finally{await Promise.allSettled([t().fetchMemberSpawnStatuses(n),t().fetchTeamAgentRuntime(n)])}},skipMemberForLaunch:async(n,r)=>{try{await nr("team:skipMemberForLaunch",()=>K.teams.skipMemberForLaunch(n,r))}finally{await Promise.allSettled([t().fetchMemberSpawnStatuses(n),t().fetchTeamAgentRuntime(n),t().fetchTeams()])}},removeMember:async(n,r)=>{await nr("team:removeMember",()=>K.teams.removeMember(n,r)),await t().refreshTeamData(n)},updateMemberRole:async(n,r,s)=>{await nr("team:updateMemberRole",()=>K.teams.updateMemberRole(n,r,s)),await t().refreshTeamData(n)},softDeleteTask:async(n,r)=>{await nr("team:softDeleteTask",()=>K.teams.softDeleteTask(n,r)),e(s=>{const i=a=>({...a,tasks:a.tasks.filter(c=>c.id!==r),kanbanState:{...a.kanbanState,tasks:Object.fromEntries(Object.entries(a.kanbanState.tasks).filter(([c])=>c!==r))}}),o=s.teamDataCacheByName[n];return{...o?{teamDataCacheByName:{...s.teamDataCacheByName,[n]:i(o)}}:{},...s.selectedTeamName===n&&s.selectedTeamData?{selectedTeamData:i(s.selectedTeamData)}:{},globalTasks:s.globalTasks.filter(a=>!(a.teamName===n&&a.id===r))}}),await t().refreshTeamData(n),await t().fetchDeletedTasks(n)},restoreTask:async(n,r)=>{await nr("team:restoreTask",()=>K.teams.restoreTask(n,r)),await t().refreshTeamData(n),await t().fetchDeletedTasks(n)},fetchDeletedTasks:async n=>{e({deletedTasksLoading:!0});try{const r=await nr("team:getDeletedTasks",()=>K.teams.getDeletedTasks(n));e({deletedTasks:r,deletedTasksLoading:!1})}catch(r){Cp.error("Failed to fetch deleted tasks:",r),e({deletedTasks:[],deletedTasksLoading:!1})}},deleteTeam:async n=>{const r=await nr("team:deleteTeam",()=>K.teams.deleteTeam(n));return I1(n),yx(n),Q1(n),A1(n),e(s=>({...vY(s,n),teams:s.teams.filter(i=>i.teamName!==n),selectedTeamName:s.selectedTeamName===n?null:s.selectedTeamName,selectedTeamData:s.selectedTeamName===n?null:s.selectedTeamData,selectedTeamError:s.selectedTeamName===n?null:s.selectedTeamError,selectedTeamLoading:s.selectedTeamName===n?!1:s.selectedTeamLoading})),await t().fetchTeams(),await t().fetchAllTasks(),r},restoreTeam:async n=>{await nr("team:restoreTeam",()=>K.teams.restoreTeam(n)),I1(n),yx(n),Q1(n),A1(n),e(r=>{const s=vY(r,n),i=dge(r,n,M1());return Object.keys(s).length===0?i:{...s,...i}}),await t().fetchTeams(),await t().fetchAllTasks()},permanentlyDeleteTeam:async n=>{await nr("team:permanentlyDeleteTeam",()=>K.teams.permanentlyDeleteTeam(n)),I1(n),yx(n),Q1(n),A1(n);const r=t(),s=vY(r,n),i=dge(r,n,M1());r.selectedTeamName===n?e({selectedTeamName:null,selectedTeamData:null,selectedTeamError:null,...s,...i}):Object.keys(s).length>0?e({...s,...i}):e(i),await t().fetchTeams(),await t().fetchAllTasks()},createTeam:async n=>{t().subscribeProvisioningProgress(),I1(n.teamName),yx(n.teamName),Q1(n.teamName),A1(n.teamName);const r=M1();e(o=>({provisioningStartedAtFloorByTeam:{...o.provisioningStartedAtFloorByTeam,[n.teamName]:r}})),e(o=>{const a={...o.provisioningRuns};for(const[x,S]of Object.entries(a))S.teamName===n.teamName&&delete a[x];const c={...o.provisioningErrorByTeam};delete c[n.teamName];const l={...o.memberSpawnStatusesByTeam};delete l[n.teamName];const d={...o.memberSpawnSnapshotsByTeam};delete d[n.teamName];const p={...o.teamAgentRuntimeByTeam};delete p[n.teamName];const f={...o.activeToolsByTeam};delete f[n.teamName];const h={...o.finishedVisibleByTeam};delete h[n.teamName];const m={...o.toolHistoryByTeam};delete m[n.teamName];const O={...o.currentRuntimeRunIdByTeam},_=O[n.teamName];delete O[n.teamName];const b=_?{...o.ignoredRuntimeRunIds,[_]:n.teamName}:o.ignoredRuntimeRunIds,y=uge(o,n.teamName);return{provisioningRuns:a,provisioningErrorByTeam:c,memberSpawnStatusesByTeam:l,memberSpawnSnapshotsByTeam:d,teamAgentRuntimeByTeam:p,activeToolsByTeam:f,finishedVisibleByTeam:h,toolHistoryByTeam:m,currentRuntimeRunIdByTeam:O,ignoredProvisioningRunIds:o.ignoredProvisioningRunIds,ignoredRuntimeRunIds:b,...y}});const s=`pending:${n.teamName}:${Date.now()}`;e(o=>({provisioningRuns:{...o.provisioningRuns,[s]:{runId:s,teamName:n.teamName,state:"spawning",message:"正在启动 Claude CLI 进程...",startedAt:r,updatedAt:r}},currentProvisioningRunIdByTeam:{...o.currentProvisioningRunIdByTeam,[n.teamName]:s},provisioningSnapshotByTeam:{...o.provisioningSnapshotByTeam,[n.teamName]:{teamName:n.teamName,displayName:n.displayName||n.teamName,description:n.description||"",color:n.color,memberCount:n.members.length,members:n.members.map(a=>({name:a.name,role:a.role})),taskCount:0,lastActivity:null,projectPath:n.cwd||void 0}}}));const i=n.skipPermissions===!1?j0:{...j0,autoAllowAll:!0};TY(n.teamName,i),e({toolApprovalSettings:i});try{if(typeof K.teams.createTeam!="function")throw new Error("Current preload version does not support team:create. Restart the dev app.");const o=await nr("team:create",()=>K.teams.createTeam(n)),a=Ege(n.model,n.providerId),c={providerId:n.providerId??"anthropic",providerBackendId:n.providerBackendId,model:a||"default",effort:n.effort,fastMode:n.fastMode,limitContext:n.limitContext??!1};Tge(n.teamName,c),e(l=>({launchParamsByTeam:{...l.launchParamsByTeam,[n.teamName]:c}})),e(l=>{const d={...l.provisioningRuns},p=d[s],f=o.runId in d;return p&&(delete d[s],f||(d[o.runId]={...p,runId:o.runId})),{provisioningRuns:d,currentProvisioningRunIdByTeam:{...l.currentProvisioningRunIdByTeam,[n.teamName]:o.runId},currentRuntimeRunIdByTeam:{...l.currentRuntimeRunIdByTeam,[n.teamName]:o.runId}}});try{await t().getProvisioningStatus(o.runId)}catch{}return t().fetchTeams(),t().selectedTeamName===n.teamName&&t().selectTeam(n.teamName,{allowReloadWhileProvisioning:!0}),window.setTimeout(()=>{t().fetchTeams(),t().selectedTeamName===n.teamName&&t().selectTeam(n.teamName,{allowReloadWhileProvisioning:!0})},1200),Oge(t,o.runId),o.runId}catch(o){const a=o instanceof Ch||o instanceof Error?o.message:"Failed to create team";throw e(c=>{const l={...c.provisioningRuns};delete l[s];const d={...c.currentProvisioningRunIdByTeam};return d[n.teamName]===s&&delete d[n.teamName],{provisioningRuns:l,currentProvisioningRunIdByTeam:d,provisioningErrorByTeam:{...c.provisioningErrorByTeam,[n.teamName]:a}}}),o}},launchTeam:async n=>{t().subscribeProvisioningProgress(),I1(n.teamName),yx(n.teamName),Q1(n.teamName),A1(n.teamName);const r=M1();e(i=>({provisioningStartedAtFloorByTeam:{...i.provisioningStartedAtFloorByTeam,[n.teamName]:r}})),e(i=>{const o={...i.provisioningRuns};for(const[y,x]of Object.entries(o))x.teamName===n.teamName&&delete o[y];const a={...i.provisioningErrorByTeam};delete a[n.teamName];const c={...i.memberSpawnStatusesByTeam};delete c[n.teamName];const l={...i.memberSpawnSnapshotsByTeam};delete l[n.teamName];const d={...i.teamAgentRuntimeByTeam};delete d[n.teamName];const p={...i.activeToolsByTeam};delete p[n.teamName];const f={...i.finishedVisibleByTeam};delete f[n.teamName];const h={...i.toolHistoryByTeam};delete h[n.teamName];const m={...i.currentRuntimeRunIdByTeam},O=m[n.teamName];delete m[n.teamName];const _=O?{...i.ignoredRuntimeRunIds,[O]:n.teamName}:i.ignoredRuntimeRunIds,b=uge(i,n.teamName);return{provisioningRuns:o,provisioningErrorByTeam:a,memberSpawnStatusesByTeam:c,memberSpawnSnapshotsByTeam:l,teamAgentRuntimeByTeam:d,activeToolsByTeam:p,finishedVisibleByTeam:f,toolHistoryByTeam:h,currentRuntimeRunIdByTeam:m,ignoredProvisioningRunIds:i.ignoredProvisioningRunIds,ignoredRuntimeRunIds:_,...b}});const s=`pending:${n.teamName}:${Date.now()}`;e(i=>({provisioningRuns:{...i.provisioningRuns,[s]:{runId:s,teamName:n.teamName,state:"spawning",message:"正在启动 Claude CLI 进程...",startedAt:r,updatedAt:r}},currentProvisioningRunIdByTeam:{...i.currentProvisioningRunIdByTeam,[n.teamName]:s}}));{const i=n.skipPermissions===!1?j0:{...j0,autoAllowAll:!0};TY(n.teamName,i),e({toolApprovalSettings:i})}try{const i=await nr("team:launch",()=>K.teams.launchTeam(n)),o=Ege(n.model,n.providerId),a={providerId:n.providerId??"anthropic",providerBackendId:n.providerBackendId,model:o||"default",effort:n.effort,fastMode:n.fastMode,limitContext:n.limitContext??!1};Tge(n.teamName,a),e(c=>({launchParamsByTeam:{...c.launchParamsByTeam,[n.teamName]:a}})),e(c=>{const l={...c.provisioningRuns},d=l[s],p=i.runId in l;return d&&(delete l[s],p||(l[i.runId]={...d,runId:i.runId})),{provisioningRuns:l,currentProvisioningRunIdByTeam:{...c.currentProvisioningRunIdByTeam,[n.teamName]:i.runId},currentRuntimeRunIdByTeam:{...c.currentRuntimeRunIdByTeam,[n.teamName]:i.runId}}});try{await t().getProvisioningStatus(i.runId)}catch{}return Oge(t,i.runId),i.runId}catch(i){const o=i instanceof Ch||i instanceof Error?i.message:"Failed to launch team";throw e(a=>{const c={...a.provisioningRuns};delete c[s];const l={...a.currentProvisioningRunIdByTeam};return l[n.teamName]===s&&delete l[n.teamName],{provisioningRuns:c,currentProvisioningRunIdByTeam:l,provisioningErrorByTeam:{...a.provisioningErrorByTeam,[n.teamName]:o}}}),i}},getProvisioningStatus:async n=>{const r=await nr("team:provisioningStatus",()=>K.teams.getProvisioningStatus(n));return t().onProvisioningProgress(r),r},clearMissingProvisioningRun:n=>{e(r=>{const s=r.provisioningRuns[n];if(!s)return{};const i={...r.provisioningRuns};delete i[n];const o={...r.currentProvisioningRunIdByTeam},a=o[s.teamName]===n;a&&delete o[s.teamName];const c={...r.currentRuntimeRunIdByTeam};c[s.teamName]===n&&delete c[s.teamName];const l={...r.ignoredProvisioningRunIds,[n]:s.teamName},d=r.currentRuntimeRunIdByTeam[s.teamName]===n?{...r.ignoredRuntimeRunIds,[n]:s.teamName}:r.ignoredRuntimeRunIds,p={...r.memberSpawnStatusesByTeam},f={...r.memberSpawnSnapshotsByTeam},h={...r.teamAgentRuntimeByTeam};a&&(delete p[s.teamName],delete f[s.teamName],delete h[s.teamName]);const m={...r.activeToolsByTeam},O={...r.finishedVisibleByTeam},_={...r.toolHistoryByTeam};return a&&(delete m[s.teamName],delete O[s.teamName],delete _[s.teamName]),{provisioningRuns:i,currentProvisioningRunIdByTeam:o,currentRuntimeRunIdByTeam:c,memberSpawnStatusesByTeam:p,memberSpawnSnapshotsByTeam:f,teamAgentRuntimeByTeam:h,activeToolsByTeam:m,finishedVisibleByTeam:O,toolHistoryByTeam:_,ignoredProvisioningRunIds:l,ignoredRuntimeRunIds:d}})},cancelProvisioning:async n=>{await nr("team:cancelProvisioning",()=>K.teams.cancelProvisioning(n))},cancelCurrentProvisioning:async(n,r)=>{const s=t(),a=s.currentProvisioningRunIdByTeam[n]??s.currentRuntimeRunIdByTeam[n]??r??(Object.values(t().provisioningRuns).filter(l=>l.teamName===n&&!AL.has(l.state)).sort((l,d)=>Date.parse(d.updatedAt)-Date.parse(l.updatedAt))[0]?.runId??null);if(a){await t().cancelProvisioning(a);return}await nr("team:stop",()=>K.teams.stop(n))},onProvisioningProgress:n=>{if(t().ignoredProvisioningRunIds[n.runId]===n.teamName||t().ignoredRuntimeRunIds[n.runId]===n.teamName)return;const r=t().provisioningStartedAtFloorByTeam[n.teamName];if(r&&n.startedAt<r)return;const s=t().currentProvisioningRunIdByTeam[n.teamName],i=t().provisioningRuns[n.runId],o=n.configReady===!0&&i?.configReady!==!0;if(i?.updatedAt===n.updatedAt&&i?.state===n.state&&i?.message===n.message&&i?.error===n.error&&i?.pid===n.pid&&s===n.runId)return;e(d=>{const p={...d.provisioningRuns},f={...d.currentProvisioningRunIdByTeam},h=f[n.teamName];let m=!1;if(!h||h===n.runId?(f[n.teamName]=n.runId,m=!0):hge(h)&&!hge(n.runId)&&(delete p[h],f[n.teamName]=n.runId,m=!0),h||(m=!0),!m)return n.runId in d.provisioningRuns?(delete p[n.runId],{provisioningRuns:p}):{};p[n.runId]=n;for(const[b,y]of Object.entries(p))b!==n.runId&&y.teamName===n.teamName&&delete p[b];const O={...d.provisioningErrorByTeam};n.state==="failed"?O[n.teamName]=n.error??n.message:delete O[n.teamName];const _=n.state==="failed"||n.state==="cancelled"?(()=>{const b={...d.provisioningSnapshotByTeam};return delete b[n.teamName],b})():d.provisioningSnapshotByTeam;return{provisioningRuns:p,currentProvisioningRunIdByTeam:f,currentRuntimeRunIdByTeam:{...d.currentRuntimeRunIdByTeam,[n.teamName]:n.runId},provisioningErrorByTeam:O,provisioningSnapshotByTeam:_}});const c=t().currentProvisioningRunIdByTeam[n.teamName]===n.runId;if(c&&n.memberSpawnSnapshot){const d=n.memberSpawnSnapshot;e(p=>({currentRuntimeRunIdByTeam:d.runId==null?p.currentRuntimeRunIdByTeam:{...p.currentRuntimeRunIdByTeam,[n.teamName]:d.runId},memberSpawnStatusesByTeam:{...p.memberSpawnStatusesByTeam,[n.teamName]:d.statuses},memberSpawnSnapshotsByTeam:{...p.memberSpawnSnapshotsByTeam,[n.teamName]:d}}))}let l=!1;if(c&&o){const d=t();vge(d,n.teamName)&&(d.selectedTeamName===n.teamName&&d.selectedTeamData==null?d.selectTeam(n.teamName,{allowReloadWhileProvisioning:!0}):d.refreshTeamData(n.teamName,{withDedup:!0}),l=!0)}if(c&&AL.has(n.state)&&e(d=>{const p={...d.memberSpawnStatusesByTeam},f={...d.memberSpawnSnapshotsByTeam},h={...d.teamAgentRuntimeByTeam},m=p[n.teamName];if(!m)return n.state!=="ready"&&delete h[n.teamName],{memberSpawnStatusesByTeam:p,memberSpawnSnapshotsByTeam:f,teamAgentRuntimeByTeam:h};if(n.state==="ready")return p[n.teamName]=m,{memberSpawnStatusesByTeam:p,memberSpawnSnapshotsByTeam:f,teamAgentRuntimeByTeam:h};const O=Object.fromEntries(Object.entries(m).filter(([,_])=>_.status==="error"));return Object.keys(O).length>0?p[n.teamName]=O:(delete p[n.teamName],delete f[n.teamName]),delete h[n.teamName],{memberSpawnStatusesByTeam:p,memberSpawnSnapshotsByTeam:f,teamAgentRuntimeByTeam:h}}),c&&(n.state==="ready"||n.state==="disconnected")){if(t().fetchMemberSpawnStatuses(n.teamName),t().fetchTeams(),l)return;const d=t();if(!vge(d,n.teamName))return;d.selectedTeamName===n.teamName?d.selectTeam(n.teamName):d.refreshTeamData(n.teamName,{withDedup:!0})}},subscribeProvisioningProgress:()=>{if(t().provisioningProgressUnsubscribe||!K.teams?.onProvisioningProgress)return;const r=K.teams.onProvisioningProgress((s,i)=>{t().onProvisioningProgress(i)});e({provisioningProgressUnsubscribe:r})},updateToolApprovalSettings:async(n,r)=>{const s=r??t().selectedTeamName,o={...t().toolApprovalSettings,...n};if(e({toolApprovalSettings:o}),s)TY(s,o);else try{localStorage?.setItem?.("team:toolApprovalSettings",JSON.stringify(o))}catch{}try{await K.teams.updateToolApprovalSettings(s??"__global__",o)}catch(a){Cp.warn("Failed to sync tool approval settings to main:",a)}},respondToToolApproval:async(n,r,s,i,o)=>{try{await K.teams.respondToToolApproval(n,r,s,i,o),e(a=>{const c=new Map(a.resolvedApprovals);return c.set(s,i),{pendingApprovals:a.pendingApprovals.filter(l=>!(l.runId===r&&l.requestId===s)),resolvedApprovals:c}})}catch(a){const c=a instanceof Error?a.message:String(a);throw Cp.error(`respondToToolApproval failed for ${n}/${s}: ${c}`),a}},unsubscribeProvisioningProgress:()=>{const n=t().provisioningProgressUnsubscribe;n&&(n(),e({provisioningProgressUnsubscribe:null}))}}),O5t=e=>({commandPaletteOpen:!1,sidebarCollapsed:!1,openCommandPalette:()=>{e({commandPaletteOpen:!0})},closeCommandPalette:()=>{e({commandPaletteOpen:!1})},toggleSidebar:()=>{e(t=>({sidebarCollapsed:!t.sidebarCollapsed}))}}),g5t=1e4,_5t=1500,b5t=6,y5t=4e3,x5t=8,S5t=2e3,v5t=1e4,T5t=3e4,E5t=1e4,w5t=Hi("Store:index"),k5t=new Set(["task","config","inbox","lead-message","lead-context","lead-activity","process","member-spawn"]),wge=new Map;function C5t(e,t,n){if(!n)return;const r=Date.now(),s=wge.get(e)??{windowStartedAt:r,count:0,lastWarnAt:0,countsByType:{}};r-s.windowStartedAt>y5t&&(s.windowStartedAt=r,s.count=0,s.countsByType={}),s.count+=1,s.countsByType[t]=(s.countsByType[t]??0)+1,s.count>=x5t&&r-s.lastWarnAt>=S5t&&(s.lastWarnAt=r),wge.set(e,s)}const le=$St()((...e)=>({...R2t(...e),...N2t(...e),...FDt(...e),...UDt(...e),...YDt(...e),...m5t(...e),...Vvt(...e),...VDt(...e),...qDt(...e),...C2t(...e),...O5t(...e),...k2t(...e),...lvt(...e),...uvt(...e),...yvt(...e),...JSt(...e),...ovt(...e),...d2t(...e),...A2t(...e),...S2t(...e)}));function R5t(){qxt();const e=[];let t=null;le.getState().subscribeProvisioningProgress(),e.push(()=>{le.getState().unsubscribeProvisioningProgress()}),(async()=>{await le.getState().fetchConfig();const J=le.getState().appConfig;UQe(J?.general?.telemetryEnabled??!0),K.cliInstaller&&(t=setTimeout(()=>{le.getState().appConfig?.general?.multimodelEnabled??!1?le.getState().bootstrapCliStatus({multimodelEnabled:!0}):le.getState().fetchCliStatus(),t=null},3e3)),await Promise.all([le.getState().fetchRepositoryGroups(),le.getState().fetchAllTasks(),le.getState().fetchTeams(),le.getState().fetchNotifications(),le.getState().fetchSchedules()])})(),e.push(()=>{t&&clearTimeout(t)});const n=setInterval(()=>{q()},g5t);e.push(()=>{clearInterval(n)});const r=new Map,s=new Map,i=new Map,o=new Map;let a=new Map,c=new Map,l=new Map,d=new Map,p=new Map,f=new Map,h=!1,m=!1;const O=new Map;let _=null,b=null;const y=150,x=300,S=800,v=400,T=500,E=2e3,w=500,P=async J=>{if(!J||!oe(J))return;const F=le.getState();try{const W=await F.refreshTeamMessagesHead(J),ue=le.getState(),ae=ue.memberActivityMetaByTeam[J];(W.feedChanged||ae?.feedRevision!==W.feedRevision)&&await ue.refreshMemberActivityMeta(J)}catch{}},k=J=>{if(!J||!Z(J)||d.has(J))return;const F=setTimeout(()=>{d.delete(J),le.getState().fetchMemberSpawnStatuses(J)},T);d.set(J,F)},C=J=>{if(!J||!Z(J)||p.has(J))return;const F=setTimeout(()=>{p.delete(J),le.getState().fetchTeamAgentRuntime(J)},T);p.set(J,F)},M=J=>{if(!J||!oe(J)||c.has(J))return;const F=setTimeout(()=>{c.delete(J),P(J)},S);c.set(J,F)},I=(J,F,W,ue)=>`${J}:${F}:${W}:${ue}`,$=(J,F,W,ue)=>{const ae=I(J,F,W,ue),ce=f.get(ae);ce&&(clearTimeout(ce),f.delete(ae))},R=(J,F,W,ue,ae,ce)=>{$(J,F,W,ue);const H=I(J,F,W,ue),pe=setTimeout(()=>{f.delete(H),ce()},ae);f.set(H,pe)},N=J=>{for(const[F,W]of f.entries())F.startsWith(`${J}:`)&&(clearTimeout(W),f.delete(F))},j=(J,F)=>{const W={...J.activeToolsByTeam},ue={...J.finishedVisibleByTeam},ae={...J.toolHistoryByTeam};return delete W[F],delete ue[F],delete ae[F],{activeToolsByTeam:W,finishedVisibleByTeam:ue,toolHistoryByTeam:ae}},Q=(J,F,W)=>{const ue={...J[F]??{}},ae=ue[W.memberName]??[];return ue[W.memberName]=[W,...ae.filter(ce=>ce.toolUseId!==W.toolUseId)].slice(0,b5t),{...J,[F]:ue}},U=(J,F)=>({...J??{},[F.memberName]:{...(J??{})[F.memberName]??{},[F.toolUseId]:F}}),A=(J,F,W)=>{if(!J?.[F]?.[W])return J??{};const ue={...J??{}},ae={...ue[F]??{}};return delete ae[W],Object.keys(ae).length===0?delete ue[F]:ue[F]=ae,ue},V=(J,F)=>{if(!J?.[F])return J??{};const W={...J??{}};return delete W[F],W},z=(J,F,W)=>{if(!J?.[F]||W.length===0)return J??{};let ue=J??{},ae=!1;for(const ce of W)ue[F]?.[ce]&&(ue=A(ue,F,ce),ae=!0);return ae?ue:J??{}},L=J=>{if(!J)return null;const F=J.indexOf("::");return F>=0?J.slice(0,F):J},q=async()=>{if(h)return;const J=le.getState(),F=Array.from(G(J));if(F.length!==0){if(O.size>50){const W=new Set(le.getState().teams.map(ue=>ue.teamName));for(const ue of O.keys())W.has(ue)||O.delete(ue)}h=!0;try{for(const W of F){const ue=wi(J,W);if(ue?.teamName!==W){SY(W)||J.refreshTeamData(W,{withDedup:!0});continue}const ae=ue.tasks.filter(xt=>xt.status!=="in_progress"?!1:Ore(Fc(xt)));if(ae.length===0){O.delete(W);continue}const ce=O.get(W)??0,H=ae.filter(xt=>xt.changePresence==="unknown"),pe=H.length>0?H:ae,Ee=pe[ce%pe.length];O.set(W,(ce+1)%pe.length);const we=le.getState();if(!Z(W))continue;const $e=wi(we,W);if($e?.teamName!==W){SY(W)||we.refreshTeamData(W,{withDedup:!0});continue}const Ze=$e.tasks.find(xt=>xt.id===Ee.id);if(Ze?.status!=="in_progress")continue;const lt=Fc(Ze),yt=Ed(W,Ze.id,lt);we.invalidateTaskChangePresence([yt]),await we.checkTaskHasChanges(W,Ze.id,lt)}}catch{}finally{h=!1}}},Y=(J,F)=>{const W=`${J}/${F}`;if(r.has(W))return;const ue=setTimeout(()=>{r.delete(W),le.getState().refreshSessionInPlace(J,F)},y);r.set(W,ue)},ne=J=>{const F=s.get(J);F&&clearTimeout(F);const W=setTimeout(()=>{s.delete(J),le.getState().refreshSessionsInPlace(J)},x);s.set(J,W)};if(K.notifications?.onNew){const J=K.notifications.onNew((F,W)=>{const ue=W;ue?.id&&le.setState(ae=>ae.notifications.some(ce=>ce.id===ue.id)?{}:{notifications:[ue,...ae.notifications].slice(0,200)})});typeof J=="function"&&e.push(J)}if(K.notifications?.onUpdated){const J=K.notifications.onUpdated((F,W)=>{const ue=typeof W.unreadCount=="number"&&Number.isFinite(W.unreadCount)?Math.max(0,Math.floor(W.unreadCount)):0;le.setState({unreadCount:ue})});typeof J=="function"&&e.push(J)}if(K.notifications?.onClicked){const J=K.notifications.onClicked((F,W)=>{const ue=W;ue?.id&&ue?.sessionId&&ue?.projectId&&le.getState().navigateToError(ue)});typeof J=="function"&&e.push(J)}const te=J=>{const{paneLayout:F}=le.getState();return F.panes.some(W=>W.activeTabId!=null&&W.tabs.some(ue=>ue.id===W.activeTabId&&ue.type==="session"&&ue.sessionId===J))},G=(J=le.getState())=>{const{paneLayout:F}=J,W=new Set;for(const ue of F.panes){if(!ue.activeTabId)continue;const ae=ue.tabs.find(ce=>ce.id===ue.activeTabId);(ae?.type==="team"||ae?.type==="graph")&&ae.teamName!=null&&W.add(ae.teamName)}return W},Z=J=>G().has(J),oe=J=>Z(J)||gLt(J),re=()=>{const J=G();for(const F of _Lt())J.add(F);return J},se=()=>G(),he=(J,F=Date.now())=>{i.set(J,F)},Te=()=>{const J=le.getState(),F=J.paneLayout.panes.find(ue=>ue.id===J.paneLayout.focusedPaneId);if(!F?.activeTabId)return null;const W=F.tabs.find(ue=>ue.id===F.activeTabId);return W?.type!=="team"&&W?.type!=="graph"||!W.teamName||!wi(J,W.teamName)?null:W.teamName},ee=async()=>{if(m)return;const J=re();if(J.size!==0){m=!0;try{await Promise.allSettled(Array.from(J,F=>P(F)))}finally{m=!1}}},ye=async()=>{if(typeof document<"u"&&document.visibilityState==="hidden")return;const J=le.getState(),F=Te();if(!F||!Z(F)||J.selectedTeamName===F&&J.selectedTeamLoading||SY(F))return;const W=i.get(F)??0,ue=cge(F)??0,ae=Math.max(W,ue);if(ae===0)return;const ce=Date.now();if(!(ce-ae<T5t||(o.get(F)??0)>=ae)){w5t.warn(`[perf] idle-watchdog refresh team=${F} idleMs=${ce-ae}`);try{await J.refreshTeamData(F,{withDedup:!0})}finally{o.set(F,Math.max(cge(F)??0,ae,Date.now()))}}};if(K.teams?.setToolActivityTracking){let J=new Set;const F=()=>{const ue=se();for(const ae of ue)J.has(ae)||K.teams.setToolActivityTracking(ae,!0).catch(()=>{});for(const ae of J)ue.has(ae)||K.teams.setToolActivityTracking(ae,!1).catch(()=>{});J=ue};F();const W=le.subscribe((ue,ae)=>{ue.paneLayout!==ae.paneLayout&&F()});e.push(()=>{W();for(const ue of J)K.teams.setToolActivityTracking(ue,!1).catch(()=>{});J.clear()})}if(K.onTodoChange){const J=K.onTodoChange(F=>{if(!F.sessionId||F.type==="unlink")return;const W=le.getState();if(W.selectedSessionId===F.sessionId||te(F.sessionId)){const pe=W.getAllPaneTabs().find(Ee=>Ee.type==="session"&&Ee.sessionId===F.sessionId);pe?.projectId&&Y(pe.projectId,F.sessionId)}const ae=W.getActiveTab(),ce=ae?.type==="session"&&typeof ae.projectId=="string"?ae.projectId:null;ce&&ce===W.selectedProjectId&&ne(ce)});typeof J=="function"&&e.push(J)}if(K.onFileChange){const J=K.onFileChange(F=>{if(F.type==="unlink")return;const W=le.getState(),ue=W.selectedProjectId,ae=L(ue),ce=L(F.projectId),H=!!ue&&(ce==null||ae===ce),pe=!F.isSubagent,Ee=F.sessionId==null||!W.sessions.some($e=>$e.id===F.sessionId);if(pe&&H&&Ee&&(F.type==="add"||W.connectionMode==="local"&&F.type==="change")&&H&&ue&&ne(ue),(F.type==="change"||F.type==="add")&&ue){const $e=W.selectedSessionId,Ze=F.sessionId,xt=(!!Ze&&($e===Ze||te(Ze))?Ze:null)??(H&&!Ze&&!!$e?$e:null);if(xt){const Lt=W.getAllPaneTabs().find(ct=>ct.type==="session"&&ct.sessionId===xt)?.projectId??ue;Y(Lt,xt)}}});typeof J=="function"&&e.push(J)}const Oe=setInterval(()=>{ye()},v5t);e.push(()=>{clearInterval(Oe)});const ie=setInterval(()=>{ee()},E5t);if(e.push(()=>{clearInterval(ie)}),K.teams?.onTeamChange){const J=K.teams.onTeamChange((F,W)=>{const ue=!!W.teamName&&oe(W.teamName);if(C5t(W.teamName,W.type,ue),(()=>{if(!W.runId)return!1;const we=le.getState();return we.ignoredProvisioningRunIds[W.runId]===W.teamName||we.ignoredRuntimeRunIds[W.runId]===W.teamName})())return;const ce=(()=>{if(!W.runId)return!1;const we=le.getState().currentRuntimeRunIdByTeam[W.teamName];return we!=null&&we!==W.runId})(),H=()=>{if(!W.runId)return;le.getState().currentRuntimeRunIdByTeam[W.teamName]==null&&le.setState($e=>({currentRuntimeRunIdByTeam:{...$e.currentRuntimeRunIdByTeam,[W.teamName]:W.runId??null},ignoredRuntimeRunIds:Object.fromEntries(Object.entries($e.ignoredRuntimeRunIds).filter(([,Ze])=>Ze!==W.teamName))}))};if(k5t.has(W.type)&&!ce&&he(W.teamName),W.type==="lead-activity"&&W.detail){if(ce)return;H();const we=W.detail;le.setState($e=>{const Ze={leadActivityByTeam:{...$e.leadActivityByTeam,[W.teamName]:we}},lt=$e.teamDataCacheByName[W.teamName]??($e.selectedTeamName===W.teamName?$e.selectedTeamData:null),yt=lt&&lt.isAlive!==(we!=="offline")?{...lt,isAlive:we!=="offline"}:lt;return yt&&(Ze.teamDataCacheByName={...$e.teamDataCacheByName,[W.teamName]:yt}),$e.selectedTeamName===W.teamName&&yt&&(Ze.selectedTeamData=yt),we==="offline"&&(Ze.leadContextByTeam={...$e.leadContextByTeam},delete Ze.leadContextByTeam[W.teamName],Object.assign(Ze,j($e,W.teamName)),Ze.currentRuntimeRunIdByTeam={...$e.currentRuntimeRunIdByTeam},delete Ze.currentRuntimeRunIdByTeam[W.teamName],Ze.ignoredRuntimeRunIds=W.runId?{...$e.ignoredRuntimeRunIds,[W.runId]:W.teamName}:$e.ignoredRuntimeRunIds,N(W.teamName)),Ze});return}if(W.type==="lead-context"&&W.detail){if(ce)return;H();try{const we=JSON.parse(W.detail);le.setState($e=>({...$e,leadContextByTeam:{...$e.leadContextByTeam,[W.teamName]:we}}))}catch{}return}if(W.type==="tool-activity"&&W.detail){if(ce)return;H();try{const we=JSON.parse(W.detail);if(we.action==="start"&&we.activity){const $e={memberName:we.activity.memberName,toolUseId:we.activity.toolUseId,toolName:we.activity.toolName,preview:we.activity.preview,startedAt:we.activity.startedAt,source:we.activity.source,state:"running"};le.setState(Ze=>({activeToolsByTeam:{...Ze.activeToolsByTeam,[W.teamName]:U(Ze.activeToolsByTeam[W.teamName],$e)}}))}else if(we.action==="finish"&&we.memberName&&we.toolUseId){const $e=we.memberName,Ze=we.toolUseId;le.setState(lt=>{const yt=lt.activeToolsByTeam[W.teamName]?.[$e]?.[Ze];if(!yt)return{};const xt={...yt,state:we.isError?"error":"complete",finishedAt:we.finishedAt??new Date().toISOString(),resultPreview:we.resultPreview};return R(W.teamName,$e,Ze,"fade",_5t,()=>{le.setState(Ge=>Ge.finishedVisibleByTeam[W.teamName]?.[$e]?.[Ze]?{finishedVisibleByTeam:{...Ge.finishedVisibleByTeam,[W.teamName]:A(Ge.finishedVisibleByTeam[W.teamName],$e,Ze)}}:{})}),{activeToolsByTeam:{...lt.activeToolsByTeam,[W.teamName]:A(lt.activeToolsByTeam[W.teamName],$e,Ze)},finishedVisibleByTeam:{...lt.finishedVisibleByTeam,[W.teamName]:U(lt.finishedVisibleByTeam[W.teamName],xt)},toolHistoryByTeam:Q(lt.toolHistoryByTeam,W.teamName,xt)}})}else if(we.action==="reset")if(we.memberName){const $e=we.memberName,Ze=Array.isArray(we.toolUseIds)&&we.toolUseIds.length>0?we.toolUseIds:null;le.setState(lt=>lt.activeToolsByTeam[W.teamName]?.[$e]?{activeToolsByTeam:{...lt.activeToolsByTeam,[W.teamName]:Ze?z(lt.activeToolsByTeam[W.teamName],$e,Ze):V(lt.activeToolsByTeam[W.teamName],$e)}}:{})}else le.setState($e=>({activeToolsByTeam:{...$e.activeToolsByTeam,[W.teamName]:{}}}))}catch{}return}if(W.type==="member-spawn"){if(ce)return;H(),k(W.teamName),C(W.teamName);return}if(W.type==="inbox"){M(W.teamName);return}if(W.type==="lead-message"){if(ce)return;H(),M(W.teamName);return}if(W.type==="log-source-change"){if(!W?.teamName||!Z(W.teamName)||l.has(W.teamName))return;const we=setTimeout(()=>{l.delete(W.teamName),le.getState().refreshTeamChangePresence(W.teamName)},v);l.set(W.teamName,we);return}if(_||(_=setTimeout(()=>{_=null,le.getState().fetchTeams()},E)),(W.type==="task"||W.type==="config")&&!b&&(b=setTimeout(()=>{b=null,le.getState().fetchAllTasks()},w)),!W?.teamName||!Z(W.teamName)||a.has(W.teamName))return;const Ee=setTimeout(()=>{a.delete(W.teamName),le.getState().refreshTeamData(W.teamName,{withDedup:!0})},S);a.set(W.teamName,Ee)});typeof J=="function"&&e.push(()=>{J();for(const F of a.values())clearTimeout(F);a=new Map;for(const F of c.values())clearTimeout(F);c=new Map;for(const F of l.values())clearTimeout(F);l=new Map;for(const F of d.values())clearTimeout(F);d=new Map;for(const F of p.values())clearTimeout(F);p=new Map;for(const F of f.values())clearTimeout(F);f=new Map,i.clear(),o.clear(),_&&(clearTimeout(_),_=null),b&&(clearTimeout(b),b=null)})}if(K.teams?.onProjectBranchChange){const J=K.teams.onProjectBranchChange((F,W)=>{if(!W?.projectPath)return;const ue=fr(W.projectPath);ue&&le.setState(ae=>ae.branchByPath[ue]===W.branch?{}:{branchByPath:{...ae.branchByPath,[ue]:W.branch}})});typeof J=="function"&&e.push(J)}if(K.teams?.onToolApprovalEvent){const J=K.teams.onToolApprovalEvent((ue,ae)=>{const ce=ae;if("autoResolved"in ce&&ce.autoResolved){const H=ce.reason!=="timeout_deny";le.setState(pe=>{const Ee=new Map(pe.resolvedApprovals);return Ee.set(ce.requestId,H),{pendingApprovals:pe.pendingApprovals.filter(we=>!(we.runId===ce.runId&&we.requestId===ce.requestId)),resolvedApprovals:Ee}})}else if("dismissed"in ce&&ce.dismissed){const H=ce;le.setState(pe=>({pendingApprovals:pe.pendingApprovals.filter(Ee=>!(Ee.teamName===H.teamName&&Ee.runId===H.runId))}))}else{const H=ce;le.setState(pe=>({pendingApprovals:[...pe.pendingApprovals,H]}))}});typeof J=="function"&&e.push(J);const F=le.getState().toolApprovalSettings,W=le.getState().selectedTeamName??"__global__";K.teams.updateToolApprovalSettings?.(W,F).catch(()=>{})}if(K.editor?.onEditorChange){const J=K.editor.onEditorChange(F=>{const W=le.getState();W.editorProjectPath&&W.handleExternalFileChange(F)});typeof J=="function"&&e.push(J)}if(K.schedules?.onScheduleChange){const J=K.schedules.onScheduleChange((F,W)=>{const ue=W;ue?.scheduleId&&le.getState().applyScheduleChange(ue.scheduleId)});typeof J=="function"&&e.push(J)}let ge=null;if(K.cliInstaller?.onProgress){const J=K.cliInstaller.onProgress((F,W)=>{const ue=W;ue.type!=="completed"&&ge&&(clearTimeout(ge),ge=null);const ae=ue.detail??null;switch(ue.type){case"checking":le.setState({cliInstallerState:"checking",cliInstallerDetail:ae});break;case"downloading":le.setState({cliInstallerState:"downloading",cliDownloadProgress:ue.percent??0,cliDownloadTransferred:ue.transferred??0,cliDownloadTotal:ue.total??0,cliInstallerDetail:ae});break;case"verifying":le.setState({cliInstallerState:"verifying",cliInstallerDetail:ae});break;case"installing":{const ce=le.getState().cliInstallerLogs,H=le.getState().cliInstallerRawChunks,pe=ae?[...ce,ae].slice(-50):ce,Ee=ue.rawChunk?[...H,ue.rawChunk].slice(-200):H;le.setState({cliInstallerState:"installing",cliInstallerDetail:ae,cliInstallerLogs:pe,cliInstallerRawChunks:Ee});break}case"completed":{const ce=le.getState().appConfig?.general?.multimodelEnabled??!1;Yg({multimodelEnabled:ce,bootstrapCliStatus:le.getState().bootstrapCliStatus,fetchCliStatus:le.getState().fetchCliStatus})}le.setState({cliInstallerState:"completed",cliCompletedVersion:ue.version??null,cliInstallerDetail:null}),ge=setTimeout(()=>{ge=null,le.getState().cliInstallerState==="completed"&&le.setState({cliInstallerState:"idle"})},3e3);break;case"error":le.setState({cliInstallerState:"error",cliInstallerError:ue.error??"Unknown error"});break;case"status":if(ue.status){let ce=[];le.setState(H=>{const pe=wQ(H.cliStatus,ue.status),Ee=tvt(pe);return ce=nvt(pe),{cliStatus:pe,cliProviderStatusLoading:Ee.length>0?{...H.cliProviderStatusLoading,...Object.fromEntries(Ee.map(we=>[we,!0]))}:H.cliProviderStatusLoading}});for(const H of ce)le.getState().fetchCliProviderStatus(H,{silent:!1})}break}});typeof J=="function"&&e.push(()=>{J(),ge&&(clearTimeout(ge),ge=null)})}if(K.ssh?.onStatus){const J=K.ssh.onStatus((F,W)=>{const ue=W;le.getState().setConnectionStatus(ue.state,ue.host,ue.error)});typeof J=="function"&&e.push(J)}if(K.context?.onChanged){const J=K.context.onChanged((F,W)=>{const{id:ue}=W,ae=le.getState().activeContextId;ue!==ae&&le.getState().switchContext(ue)});typeof J=="function"&&e.push(J)}return()=>{for(const J of r.values())clearTimeout(J);r.clear();for(const J of s.values())clearTimeout(J);s.clear(),e.forEach(J=>J())}}const P5t=()=>{const e=le(r=>r.isContextSwitching),t=le(r=>r.targetContextId);if(!e)return null;const n=t==="local"?"本地":t?.replace(/^ssh-/,"")??"未知";return u.jsx("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-surface",children:u.jsxs("div",{className:"flex flex-col items-center gap-4",children:[u.jsx("div",{className:"size-8 animate-spin rounded-full border-4 border-text border-t-transparent"}),u.jsxs("div",{className:"flex flex-col items-center gap-1",children:[u.jsxs("p",{className:"text-text",children:["正在切换到 ",n,"..."]}),u.jsx("p",{className:"text-sm text-text-secondary",children:"正在加载工作区"})]})]})})},$5t="1.6.9",N5t={version:$5t},A5t="https://github.com/yancyuu/Hermit/issues/new",I5t=120,M5t=1800,Q5t=1200,D5t=12e3,L5t=8e3,wZ=(e,t)=>e.length<=t?e:`${e.slice(0,t)}
1042
1042
  ...[truncated]`,j5t=e=>{const t=e?`[BUG] ${e.name}: ${e.message}`:"[BUG] Application crash";return wZ(t,I5t)},X5t=()=>"Web browser",xp=e=>{if(!e)return"Not available";const t=e.trim();return t.length>0?t:"Not available"},U5t=()=>{const{userAgent:e}=window.navigator;return e.includes("Mac OS X")?"macOS":e.includes("Windows")?"Windows":e.includes("Linux")?"Linux":"Unknown"},kge=e=>e?.activeTabType?e.activeTabLabel?`${e.activeTabType} (${e.activeTabLabel})`:e.activeTabType:"Not available",gXe=({error:e,componentStack:t,context:n},r)=>{const s=e?.message??"Unknown application crash",i=e?.stack?wZ(e.stack,r.js):"Not available",o=t?wZ(t,r.react):"Not available";return["**Describe the bug**","The app crashed and showed the global error screen.","","**What happened**",`- Error: \`${s}\``,`- Error type: \`${e?.name??"UnknownError"}\``,`- Active tab: ${kge(n)}`,`- Active team tab: ${xp(n?.activeTeamName)}`,`- Selected team: ${xp(n?.selectedTeamName)}`,`- Current task: ${xp(n?.taskId)}`,`- Session ID: ${xp(n?.sessionId)}`,`- Project ID: ${xp(n?.projectId)}`,"","**Steps to reproduce**","1. Open the app and navigate to the screen where the crash happened.","2. Repeat the action that triggered the error.","3. Observe the global error screen.","","**Expected behavior**","The app should continue working instead of crashing.","","**Screenshots**","Attach a screenshot if you have one.","","**Environment**",`- OS: ${U5t()}`,`- Runtime: ${X5t()}`,`- App version: ${N5t.version}`,"","**Diagnostics**","```text",`Timestamp: ${new Date().toISOString()}`,`Current URL: ${window.location.href}`,`User Agent: ${window.navigator.userAgent}`,`Error name: ${e?.name??"UnknownError"}`,`Error message: ${s}`,`Active tab: ${kge(n)}`,`Active team tab: ${xp(n?.activeTeamName)}`,`Selected team: ${xp(n?.selectedTeamName)}`,`Current task: ${xp(n?.taskId)}`,`Session ID: ${xp(n?.sessionId)}`,`Project ID: ${xp(n?.projectId)}`,"```","","**JavaScript stack trace**","```text",i,"```","","**React component stack**","```text",o,"```"].join(`
1043
1043
  `)},z5t=e=>gXe(e,{js:D5t,react:L5t}),B5t=e=>{const t=new URLSearchParams({template:"bug_report.md",labels:"bug",title:j5t(e.error),body:gXe(e,{js:M5t,react:Q5t})});return`${A5t}?${t.toString()}`},Cge=Hi("Component:ErrorBoundary");class F5t extends g.Component{copyResetTimeout=null;constructor(t){super(t),this.state={hasError:!1,copiedReport:!1,error:null,errorInfo:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){Cge.error("ErrorBoundary caught an error:",t,n),this.setState({errorInfo:n}),Pxt()&&Nxt(t,{componentStack:n.componentStack,...this.getBugReportContext()})}handleReload=()=>{window.location.reload()};handleReset=()=>{this.copyResetTimeout&&(clearTimeout(this.copyResetTimeout),this.copyResetTimeout=null),this.setState({hasError:!1,copiedReport:!1,error:null,errorInfo:null})};componentWillUnmount(){this.copyResetTimeout&&(clearTimeout(this.copyResetTimeout),this.copyResetTimeout=null)}getBugReportContext=()=>{const t=le.getState(),n=t.getActiveTab();return{activeTabType:n?.type??null,activeTabLabel:n?.label??null,activeTeamName:n?.teamName??null,selectedTeamName:t.selectedTeamName,taskId:t.globalTaskDetail?.taskId??t.pendingReviewRequest?.taskId??null,sessionId:n?.sessionId??null,projectId:n?.projectId??t.activeProjectId}};handleCreateGitHubIssue=()=>{const t=B5t({error:this.state.error,componentStack:this.state.errorInfo?.componentStack??null,context:this.getBugReportContext()});K.openExternal(t)};handleCopyErrorDetails=async()=>{try{await navigator.clipboard.writeText(z5t({error:this.state.error,componentStack:this.state.errorInfo?.componentStack??null,context:this.getBugReportContext()})),this.copyResetTimeout&&clearTimeout(this.copyResetTimeout),this.setState({copiedReport:!0}),this.copyResetTimeout=setTimeout(()=>{this.setState({copiedReport:!1}),this.copyResetTimeout=null},2e3)}catch(t){Cge.warn("Failed to copy error details:",t)}};render(){const{hasError:t,copiedReport:n,error:r,errorInfo:s}=this.state,{children:i,fallback:o}=this.props;return t?o||u.jsxs("div",{className:"flex h-screen flex-col items-center justify-center bg-claude-dark-bg p-8 text-claude-dark-text",children:[u.jsxs("div",{className:"mb-6 flex items-center gap-3",children:[u.jsx(qn,{className:"size-10 text-red-500"}),u.jsx("h1",{className:"text-2xl font-semibold",children:"出错了"})]}),u.jsx("p",{className:"mb-6 max-w-md text-center text-claude-dark-text-secondary",children:"应用发生了意外错误。你可以尝试重新加载页面,或重置错误状态。"}),r&&u.jsxs("div",{className:"mb-6 w-full max-w-2xl overflow-auto rounded-lg border border-claude-dark-border bg-claude-dark-surface p-4",children:[u.jsx("p",{className:"mb-2 font-mono text-sm text-red-400",children:r.message}),s?.componentStack&&u.jsxs("details",{className:"mt-2",children:[u.jsx("summary",{className:"cursor-pointer text-xs text-claude-dark-text-secondary hover:text-claude-dark-text",children:"组件堆栈"}),u.jsx("pre",{className:"mt-2 whitespace-pre-wrap text-xs text-claude-dark-text-secondary",children:s.componentStack})]})]}),u.jsxs("div",{className:"flex flex-wrap justify-center gap-4",children:[u.jsx("button",{onClick:this.handleReset,className:"flex items-center gap-2 rounded-lg border border-claude-dark-border bg-claude-dark-surface px-4 py-2 transition-colors hover:bg-claude-dark-border",children:"重试"}),u.jsxs("button",{onClick:()=>void this.handleCopyErrorDetails(),className:"flex items-center gap-2 rounded-lg border border-claude-dark-border bg-claude-dark-surface px-4 py-2 transition-colors hover:bg-claude-dark-border",children:[n?u.jsx(es,{className:"size-4 text-green-400"}):u.jsx(uE,{className:"size-4"}),n?"已复制":"复制错误详情"]}),u.jsxs("button",{onClick:this.handleCreateGitHubIssue,className:"flex items-center gap-2 rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-2 text-red-300 transition-colors hover:bg-red-500/20",children:[u.jsx($Ie,{className:"size-4"}),"在 GitHub 上报告问题"]}),u.jsxs("button",{onClick:this.handleReload,className:"flex items-center gap-2 rounded-lg bg-blue-600 px-4 py-2 transition-colors hover:bg-blue-700",children:[u.jsx(ua,{className:"size-4"}),"重新加载应用"]})]}),u.jsx("p",{className:"mt-4 max-w-md text-center text-xs text-claude-dark-text-secondary",children:"GitHub 问题报告和复制的诊断信息会包含错误消息、堆栈、应用版本、当前标签页、所选团队、任务上下文和环境详情。"})]}):i}}function Y5t(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return g.useMemo(()=>r=>{t.forEach(s=>s(r))},t)}const oz=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function TE(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Nse(e){return"nodeType"in e}function vl(e){var t,n;return e?TE(e)?e:Nse(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Ase(e){const{Document:t}=vl(e);return e instanceof t}function z$(e){return TE(e)?!1:e instanceof vl(e).HTMLElement}function _Xe(e){return e instanceof vl(e).SVGElement}function EE(e){return e?TE(e)?e.document:Nse(e)?Ase(e)?e:z$(e)||_Xe(e)?e.ownerDocument:document:document:document}const ep=oz?g.useLayoutEffect:g.useEffect;function az(e){const t=g.useRef(e);return ep(()=>{t.current=e}),g.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return t.current==null?void 0:t.current(...r)},[])}function V5t(){const e=g.useRef(null),t=g.useCallback((r,s)=>{e.current=setInterval(r,s)},[]),n=g.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function rP(e,t){t===void 0&&(t=[e]);const n=g.useRef(e);return ep(()=>{n.current!==e&&(n.current=e)},t),n}function B$(e,t){const n=g.useRef();return g.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function DL(e){const t=az(e),n=g.useRef(null),r=g.useCallback(s=>{s!==n.current&&t?.(s,n.current),n.current=s},[]);return[n,r]}function LL(e){const t=g.useRef();return g.useEffect(()=>{t.current=e},[e]),t.current}let EY={};function F$(e,t){return g.useMemo(()=>{if(t)return t;const n=EY[e]==null?0:EY[e]+1;return EY[e]=n,e+"-"+n},[e,t])}function bXe(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return r.reduce((i,o)=>{const a=Object.entries(o);for(const[c,l]of a){const d=i[c];d!=null&&(i[c]=d+e*l)}return i},{...t})}}const av=bXe(1),jL=bXe(-1);function q5t(e){return"clientX"in e&&"clientY"in e}function lz(e){if(!e)return!1;const{KeyboardEvent:t}=vl(e.target);return t&&e instanceof t}function W5t(e){if(!e)return!1;const{TouchEvent:t}=vl(e.target);return t&&e instanceof t}function XL(e){if(W5t(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return q5t(e)?{x:e.clientX,y:e.clientY}:null}const Tm=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Tm.Translate.toString(e),Tm.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Rge="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function G5t(e){return e.matches(Rge)?e:e.querySelector(Rge)}const H5t={display:"none"};function Z5t(e){let{id:t,value:n}=e;return Je.createElement("div",{id:t,style:H5t},n)}function K5t(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Je.createElement("div",{id:t,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function J5t(){const[e,t]=g.useState("");return{announce:g.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const yXe=g.createContext(null);function ejt(e){const t=g.useContext(yXe);g.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function tjt(){const[e]=g.useState(()=>new Set),t=g.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[g.useCallback(r=>{let{type:s,event:i}=r;e.forEach(o=>{var a;return(a=o[s])==null?void 0:a.call(o,i)})},[e]),t]}const njt={draggable:`
1044
1044
  To pick up a draggable item, press the space bar.
@@ -1324,8 +1324,8 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
1324
1324
  node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const r=e.x,s=e.y,i=Math.abs(r-n.x),o=e.width/2;let a=n.x<t.x?o-i:o+i;const c=e.height/2,l=Math.abs(t.y-n.y),d=Math.abs(t.x-n.x);if(Math.abs(s-t.y)*o>Math.abs(r-t.x)*c){let p=n.y<t.y?t.y-c-s:s-c-t.y;a=d*p/l;const f={x:n.x<t.x?n.x+a:n.x-d+a,y:n.y<t.y?n.y+l-p:n.y-l+p};return a===0&&(f.x=t.x,f.y=t.y),d===0&&(f.x=t.x),l===0&&(f.y=t.y),dt.debug(`abc89 top/bottom calc, Q ${l}, q ${p}, R ${d}, r ${a}`,f),f}else{n.x<t.x?a=t.x-o-r:a=r-o-t.x;let p=l*a/d,f=n.x<t.x?n.x+d-a:n.x-d+a,h=n.y<t.y?n.y+p:n.y-p;return dt.debug(`sides calc abc89, Q ${l}, q ${p}, R ${d}, r ${a}`,{_x:f,_y:h}),a===0&&(f=t.x,h=t.y),d===0&&(f=t.x),l===0&&(h=t.y),{x:f,y:h}}},"intersection"),cye=B((e,t)=>{dt.warn("abc88 cutPathAtIntersect",e,t);let n=[],r=e[0],s=!1;return e.forEach(i=>{if(dt.info("abc88 checking point",i,t),!yln(t,i)&&!s){const o=xln(t,r,i);dt.debug("abc88 inside",i,r,o),dt.debug("abc88 intersection",o,t);let a=!1;n.forEach(c=>{a=a||c.x===o.x&&c.y===o.y}),n.some(c=>c.x===o.x&&c.y===o.y)?dt.warn("abc88 no intersect",o,n):n.push(o),s=!0}else dt.warn("abc88 outside",i,r),r=i,s||n.push(i)}),dt.debug("returning points",n),n},"cutPathAtIntersect");function Pqe(e){const t=[],n=[];for(let r=1;r<e.length-1;r++){const s=e[r-1],i=e[r],o=e[r+1];(s.x===i.x&&i.y===o.y&&Math.abs(i.x-o.x)>5&&Math.abs(i.y-s.y)>5||s.y===i.y&&i.x===o.x&&Math.abs(i.x-s.x)>5&&Math.abs(i.y-o.y)>5)&&(t.push(i),n.push(r))}return{cornerPoints:t,cornerPointPositions:n}}B(Pqe,"extractCornerPoints");var uye=B(function(e,t,n){const r=t.x-e.x,s=t.y-e.y,i=Math.sqrt(r*r+s*s),o=n/i;return{x:t.x-o*r,y:t.y-o*s}},"findAdjacentPoint"),Sln=B(function(e){const{cornerPointPositions:t}=Pqe(e),n=[];for(let r=0;r<e.length;r++)if(t.includes(r)){const s=e[r-1],i=e[r+1],o=e[r],a=uye(s,o,5),c=uye(i,o,5),l=c.x-a.x,d=c.y-a.y;n.push(a);const p=Math.sqrt(2)*2;let f={x:o.x,y:o.y};if(Math.abs(i.x-s.x)>10&&Math.abs(i.y-s.y)>=10){dt.debug("Corner point fixing",Math.abs(i.x-s.x),Math.abs(i.y-s.y));const h=5;o.x===a.x?f={x:l<0?a.x-h+p:a.x+h-p,y:d<0?a.y-p:a.y+p}:f={x:l<0?a.x-p:a.x+p,y:d<0?a.y-h+p:a.y+h-p}}else dt.debug("Corner point skipping fixing",Math.abs(i.x-s.x),Math.abs(i.y-s.y));n.push(f,c)}else n.push(e[r]);return n},"fixCorners"),vln=B((e,t,n)=>{const r=e-t-n,s=2,i=2,o=s+i,a=Math.floor(r/o),c=Array(a).fill(`${s} ${i}`).join(" ");return`0 ${t} ${c} ${n}`},"generateDashArray"),Tln=B(function(e,t,n,r,s,i,o,a=!1){const{handDrawnSeed:c}=is();let l=t.points,d=!1;const p=s;var f=i;const h=[];for(const $ in t.cssCompiledStyles)oYe($)||h.push(t.cssCompiledStyles[$]);dt.debug("UIO intersect check",t.points,f.x,p.x),f.intersect&&p.intersect&&!a&&(l=l.slice(1,t.points.length-1),l.unshift(p.intersect(l[0])),dt.debug("Last point UIO",t.start,"-->",t.end,l[l.length-1],f,f.intersect(l[l.length-1])),l.push(f.intersect(l[l.length-1])));const m=btoa(JSON.stringify(l));t.toCluster&&(dt.info("to cluster abc88",n.get(t.toCluster)),l=cye(t.points,n.get(t.toCluster).node),d=!0),t.fromCluster&&(dt.debug("from cluster abc88",n.get(t.fromCluster),JSON.stringify(l,null,2)),l=cye(l.reverse(),n.get(t.fromCluster).node).reverse(),d=!0);let O=l.filter($=>!Number.isNaN($.y));O=Sln(O);let _=a2;switch(_=g5,t.curve){case"linear":_=g5;break;case"basis":_=a2;break;case"cardinal":_=u4e;break;case"bumpX":_=i4e;break;case"bumpY":_=o4e;break;case"catmullRom":_=p4e;break;case"monotoneX":_=_4e;break;case"monotoneY":_=b4e;break;case"natural":_=x4e;break;case"step":_=S4e;break;case"stepAfter":_=T4e;break;case"stepBefore":_=v4e;break;default:_=a2}const{x:b,y}=yrn(t),x=rnn().x(b).y(y).curve(_);let S;switch(t.thickness){case"normal":S="edge-thickness-normal";break;case"thick":S="edge-thickness-thick";break;case"invisible":S="edge-thickness-invisible";break;default:S="edge-thickness-normal"}switch(t.pattern){case"solid":S+=" edge-pattern-solid";break;case"dotted":S+=" edge-pattern-dotted";break;case"dashed":S+=" edge-pattern-dashed";break;default:S+=" edge-pattern-solid"}let v,T=t.curve==="rounded"?$qe(Nqe(O,t),5):x(O);const E=Array.isArray(t.style)?t.style:[t.style];let w=E.find($=>$?.startsWith("stroke:")),P=!1;if(t.look==="handDrawn"){const $=ln.svg(e);Object.assign([],O);const R=$.path(T,{roughness:.3,seed:c});S+=" transition",v=Mr(R).select("path").attr("id",t.id).attr("class"," "+S+(t.classes?" "+t.classes:"")).attr("style",E?E.reduce((j,Q)=>j+";"+Q,""):"");let N=v.attr("d");v.attr("d",N),e.node().appendChild(v.node())}else{const $=h.join(";"),R=E?E.reduce((z,L)=>z+L+";",""):"";let N="";t.animate&&(N=" edge-animation-fast"),t.animation&&(N=" edge-animation-"+t.animation);const j=($?$+";"+R+";":R)+";"+(E?E.reduce((z,L)=>z+";"+L,""):"");v=e.append("path").attr("d",T).attr("id",t.id).attr("class"," "+S+(t.classes?" "+t.classes:"")+(N??"")).attr("style",j),w=j.match(/stroke:([^;]+)/)?.[1],P=t.animate===!0||!!t.animation||$.includes("animation");const Q=v.node(),U=typeof Q.getTotalLength=="function"?Q.getTotalLength():0,A=kbe[t.arrowTypeStart]||0,V=kbe[t.arrowTypeEnd]||0;if(t.look==="neo"&&!P){const L=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?vln(U,A,V):`0 ${A} ${U-A-V} ${V}`}; stroke-dashoffset: 0;`;v.attr("style",L+v.attr("style"))}}v.attr("data-edge",!0),v.attr("data-et","edge"),v.attr("data-id",t.id),v.attr("data-points",m),t.showPoints&&O.forEach($=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",$.x).attr("cy",$.y)});let k="";(is().flowchart.arrowMarkerAbsolute||is().state.arrowMarkerAbsolute)&&(k=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,k=k.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),dt.info("arrowTypeStart",t.arrowTypeStart),dt.info("arrowTypeEnd",t.arrowTypeEnd),Oln(v,t,k,o,r,w);const C=Math.floor(l.length/2),M=l[C];Cd.isLabelCoordinateInPath(M,v.attr("d"))||(d=!0);let I={};return d&&(I.updatedPath=l),I.originalPath=t.points,I},"insertEdge");function $qe(e,t){if(e.length<2)return"";let n="";const r=e.length,s=1e-5;for(let i=0;i<r;i++){const o=e[i],a=e[i-1],c=e[i+1];if(i===0)n+=`M${o.x},${o.y}`;else if(i===r-1)n+=`L${o.x},${o.y}`;else{const l=o.x-a.x,d=o.y-a.y,p=c.x-o.x,f=c.y-o.y,h=Math.hypot(l,d),m=Math.hypot(p,f);if(h<s||m<s){n+=`L${o.x},${o.y}`;continue}const O=l/h,_=d/h,b=p/m,y=f/m,x=O*b+_*y,S=Math.max(-1,Math.min(1,x)),v=Math.acos(S);if(v<s||Math.abs(Math.PI-v)<s){n+=`L${o.x},${o.y}`;continue}const T=Math.min(t/Math.sin(v/2),h/2,m/2),E=o.x-O*T,w=o.y-_*T,P=o.x+b*T,k=o.y+y*T;n+=`L${E},${w}`,n+=`Q${o.x},${o.y} ${P},${k}`}}return n}B($qe,"generateRoundedPath");function VK(e,t){if(!e||!t)return{angle:0,deltaX:0,deltaY:0};const n=t.x-e.x,r=t.y-e.y;return{angle:Math.atan2(r,n),deltaX:n,deltaY:r}}B(VK,"calculateDeltaAndAngle");function Nqe(e,t){const n=e.map(s=>({...s}));if(e.length>=2&&Oa[t.arrowTypeStart]){const s=Oa[t.arrowTypeStart],i=e[0],o=e[1],{angle:a}=VK(i,o),c=s*Math.cos(a),l=s*Math.sin(a);n[0].x=i.x+c,n[0].y=i.y+l}const r=e.length;if(r>=2&&Oa[t.arrowTypeEnd]){const s=Oa[t.arrowTypeEnd],i=e[r-1],o=e[r-2],{angle:a}=VK(o,i),c=s*Math.cos(a),l=s*Math.sin(a);n[r-1].x=i.x-c,n[r-1].y=i.y-l}return n}B(Nqe,"applyMarkerOffsetsToPoints");var Eln=B((e,t,n,r)=>{t.forEach(s=>{Uln[s](e,n,r)})},"insertMarkers"),wln=B((e,t,n)=>{dt.trace("Making markers for ",n),e.append("defs").append("marker").attr("id",n+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",n+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),kln=B((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",n+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),Cln=B((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",n+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),Rln=B((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",n+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),Pln=B((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",n+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),$ln=B((e,t,n)=>{e.append("marker").attr("id",n+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",n+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),Nln=B((e,t,n)=>{e.append("marker").attr("id",n+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",n+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),Aln=B((e,t,n)=>{e.append("marker").attr("id",n+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",n+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),Iln=B((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),Mln=B((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),e.append("defs").append("marker").attr("id",n+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),Qln=B((e,t,n)=>{const r=e.append("defs").append("marker").attr("id",n+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");r.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),r.append("path").attr("d","M9,0 L9,18");const s=e.append("defs").append("marker").attr("id",n+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");s.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),s.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),Dln=B((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),e.append("defs").append("marker").attr("id",n+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),Lln=B((e,t,n)=>{const r=e.append("defs").append("marker").attr("id",n+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");r.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),r.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const s=e.append("defs").append("marker").attr("id",n+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");s.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),s.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),jln=B((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0
1325
1325
  L20,10
1326
1326
  M20,10
1327
- L0,20`)},"requirement_arrow"),Xln=B((e,t,n)=>{const r=e.append("defs").append("marker").attr("id",n+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");r.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),r.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),r.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),Uln={extension:wln,composition:kln,aggregation:Cln,dependency:Rln,lollipop:Pln,point:$ln,circle:Nln,cross:Aln,barb:Iln,only_one:Mln,zero_or_one:Qln,one_or_more:Dln,zero_or_more:Lln,requirement_arrow:jln,requirement_contains:Xln},zln=Eln,Bln={common:IE,getConfig:Ra,insertCluster:Zan,insertEdge:Tln,insertEdgeLabel:_ln,insertMarkers:zln,insertNode:Rqe,interpolateToCurve:uoe,labelHelper:Nn,log:dt,positionEdgeLabel:bln},EP={},Aqe=B(e=>{for(const t of e)EP[t.name]=t},"registerLayoutLoaders"),Fln=B(()=>{Aqe([{name:"dagre",loader:B(async()=>await Me(()=>import("./dagre-6UL2VRFP-B5RSyejY.js"),__vite__mapDeps([12,13,14,15,16,17,1])),"loader")},{name:"cose-bilkent",loader:B(async()=>await Me(()=>import("./cose-bilkent-S5V4N54A-BSNpaBjf.js"),__vite__mapDeps([18,19,1])),"loader")}])},"registerDefaultLayoutLoaders");Fln();var UZn=B(async(e,t)=>{if(!(e.layoutAlgorithm in EP))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);const n=EP[e.layoutAlgorithm];return(await n.loader()).render(e,t,Bln,{algorithm:n.algorithm})},"render"),zZn=B((e="",{fallback:t="dagre"}={})=>{if(e in EP)return e;if(t in EP)return dt.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm"),Iqe="comm",Mqe="rule",Qqe="decl",Yln="@import",Vln="@namespace",qln="@keyframes",Wln="@layer",Dqe=Math.abs,Poe=String.fromCharCode;function Lqe(e){return e.trim()}function p2(e,t,n){return e.replace(t,n)}function Gln(e,t,n){return e.indexOf(t,n)}function fv(e,t){return e.charCodeAt(t)|0}function RT(e,t,n){return e.slice(t,n)}function zp(e){return e.length}function Hln(e){return e.length}function UI(e,t){return t.push(e),e}var o3=1,PT=1,jqe=0,Zu=0,Xi=0,jE="";function $oe(e,t,n,r,s,i,o,a){return{value:e,root:t,parent:n,type:r,props:s,children:i,line:o3,column:PT,length:o,return:"",siblings:a}}function Zln(){return Xi}function Kln(){return Xi=Zu>0?fv(jE,--Zu):0,PT--,Xi===10&&(PT=1,o3--),Xi}function Vd(){return Xi=Zu<jqe?fv(jE,Zu++):0,PT++,Xi===10&&(PT=1,o3++),Xi}function ng(){return fv(jE,Zu)}function f2(){return Zu}function a3(e,t){return RT(jE,e,t)}function wP(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Jln(e){return o3=PT=1,jqe=zp(jE=e),Zu=0,[]}function ecn(e){return jE="",e}function bV(e){return Lqe(a3(Zu-1,qK(e===91?e+2:e===40?e+1:e)))}function tcn(e){for(;(Xi=ng())&&Xi<33;)Vd();return wP(e)>2||wP(Xi)>3?"":" "}function ncn(e,t){for(;--t&&Vd()&&!(Xi<48||Xi>102||Xi>57&&Xi<65||Xi>70&&Xi<97););return a3(e,f2()+(t<6&&ng()==32&&Vd()==32))}function qK(e){for(;Vd();)switch(Xi){case e:return Zu;case 34:case 39:e!==34&&e!==39&&qK(Xi);break;case 40:e===41&&qK(e);break;case 92:Vd();break}return Zu}function rcn(e,t){for(;Vd()&&e+Xi!==57;)if(e+Xi===84&&ng()===47)break;return"/*"+a3(t,Zu-1)+"*"+Poe(e===47?e:Vd())}function scn(e){for(;!wP(ng());)Vd();return a3(e,Zu)}function icn(e){return ecn(h2("",null,null,null,[""],e=Jln(e),0,[0],e))}function h2(e,t,n,r,s,i,o,a,c){for(var l=0,d=0,p=o,f=0,h=0,m=0,O=1,_=1,b=1,y=0,x="",S=s,v=i,T=r,E=x;_;)switch(m=y,y=Vd()){case 40:if(m!=108&&fv(E,p-1)==58){Gln(E+=p2(bV(y),"&","&\f"),"&\f",Dqe(l?a[l-1]:0))!=-1&&(b=-1);break}case 34:case 39:case 91:E+=bV(y);break;case 9:case 10:case 13:case 32:E+=tcn(m);break;case 92:E+=ncn(f2()-1,7);continue;case 47:switch(ng()){case 42:case 47:UI(ocn(rcn(Vd(),f2()),t,n,c),c),(wP(m||1)==5||wP(ng()||1)==5)&&zp(E)&&RT(E,-1,void 0)!==" "&&(E+=" ");break;default:E+="/"}break;case 123*O:a[l++]=zp(E)*b;case 125*O:case 59:case 0:switch(y){case 0:case 125:_=0;case 59+d:b==-1&&(E=p2(E,/\f/g,"")),h>0&&(zp(E)-p||O===0&&m===47)&&UI(h>32?pye(E+";",r,n,p-1,c):pye(p2(E," ","")+";",r,n,p-2,c),c);break;case 59:E+=";";default:if(UI(T=dye(E,t,n,l,d,s,a,x,S=[],v=[],p,i),i),y===123)if(d===0)h2(E,t,T,T,S,i,p,a,v);else{switch(f){case 99:if(fv(E,3)===110)break;case 108:if(fv(E,2)===97)break;default:d=0;case 100:case 109:case 115:}d?h2(e,T,T,r&&UI(dye(e,T,T,0,0,s,a,x,s,S=[],p,v),v),s,v,p,a,r?S:v):h2(E,T,T,T,[""],v,0,a,v)}}l=d=h=0,O=b=1,x=E="",p=o;break;case 58:p=1+zp(E),h=m;default:if(O<1){if(y==123)--O;else if(y==125&&O++==0&&Kln()==125)continue}switch(E+=Poe(y),y*O){case 38:b=d>0?1:(E+="\f",-1);break;case 44:a[l++]=(zp(E)-1)*b,b=1;break;case 64:ng()===45&&(E+=bV(Vd())),f=ng(),d=p=zp(x=E+=scn(f2())),y++;break;case 45:m===45&&zp(E)==2&&(O=0)}}return i}function dye(e,t,n,r,s,i,o,a,c,l,d,p){for(var f=s-1,h=s===0?i:[""],m=Hln(h),O=0,_=0,b=0;O<r;++O)for(var y=0,x=RT(e,f+1,f=Dqe(_=o[O])),S=e;y<m;++y)(S=Lqe(_>0?h[y]+" "+x:p2(x,/&\f/g,h[y])))&&(c[b++]=S);return $oe(e,t,n,s===0?Mqe:a,c,l,d,p)}function ocn(e,t,n,r){return $oe(e,t,n,Iqe,Poe(Zln()),RT(e,2,-2),0,r)}function pye(e,t,n,r,s){return $oe(e,t,n,Qqe,RT(e,0,r),RT(e,r+1,-1),r,s)}function WK(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function acn(e,t,n,r){switch(e.type){case Wln:if(e.children.length)break;case Yln:case Vln:case Qqe:return e.return=e.return||e.value;case Iqe:return"";case qln:return e.return=e.value+"{"+WK(e.children,r)+"}";case Mqe:if(!zp(e.value=e.props.join(",")))return""}return zp(n=WK(e.children,r))?e.return=e.value+"{"+n+"}":""}var lcn=dYe(Object.keys,Object),ccn=Object.prototype,ucn=ccn.hasOwnProperty;function dcn(e){if(!Hz(e))return lcn(e);var t=[];for(var n in Object(e))ucn.call(e,n)&&n!="constructor"&&t.push(n);return t}var GK=zy(zf,"DataView"),HK=zy(zf,"Promise"),ZK=zy(zf,"Set"),KK=zy(zf,"WeakMap"),fye="[object Map]",pcn="[object Object]",hye="[object Promise]",mye="[object Set]",Oye="[object WeakMap]",gye="[object DataView]",fcn=Uy(GK),hcn=Uy(vP),mcn=Uy(HK),Ocn=Uy(ZK),gcn=Uy(KK),m0=QE;(GK&&m0(new GK(new ArrayBuffer(1)))!=gye||vP&&m0(new vP)!=fye||HK&&m0(HK.resolve())!=hye||ZK&&m0(new ZK)!=mye||KK&&m0(new KK)!=Oye)&&(m0=function(e){var t=QE(e),n=t==pcn?e.constructor:void 0,r=n?Uy(n):"";if(r)switch(r){case fcn:return gye;case hcn:return fye;case mcn:return hye;case Ocn:return mye;case gcn:return Oye}return t});var _cn="[object Map]",bcn="[object Set]",ycn=Object.prototype,xcn=ycn.hasOwnProperty;function _ye(e){if(e==null)return!0;if(Zz(e)&&(P5(e)||typeof e=="string"||typeof e.splice=="function"||loe(e)||coe(e)||R5(e)))return!e.length;var t=m0(e);if(t==_cn||t==bcn)return!e.size;if(Hz(e))return!dcn(e).length;for(var n in e)if(xcn.call(e,n))return!1;return!0}var Xqe="c4",Scn=B(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),vcn=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./c4Diagram-YG6GDRKO-butp85gz.js");return{diagram:t}},__vite__mapDeps([20,21,1]));return{id:Xqe,diagram:e}},"loader"),Tcn={id:Xqe,detector:Scn,loader:vcn},Ecn=Tcn,Uqe="flowchart",wcn=B((e,t)=>t?.flowchart?.defaultRenderer==="dagre-wrapper"||t?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(e),"detector"),kcn=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-BSxdxCYS.js");return{diagram:t}},__vite__mapDeps([22,23,24,25,26,1]));return{id:Uqe,diagram:e}},"loader"),Ccn={id:Uqe,detector:wcn,loader:kcn},Rcn=Ccn,zqe="flowchart-v2",Pcn=B((e,t)=>t?.flowchart?.defaultRenderer==="dagre-d3"?!1:(t?.flowchart?.defaultRenderer==="elk"&&(t.layout="elk"),/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer==="dagre-wrapper"?!0:/^\s*flowchart/.test(e)),"detector"),$cn=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-BSxdxCYS.js");return{diagram:t}},__vite__mapDeps([22,23,24,25,26,1]));return{id:zqe,diagram:e}},"loader"),Ncn={id:zqe,detector:Pcn,loader:$cn},Acn=Ncn,Bqe="er",Icn=B(e=>/^\s*erDiagram/.test(e),"detector"),Mcn=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./erDiagram-Q2GNP2WA-A67Ainvm.js");return{diagram:t}},__vite__mapDeps([27,24,25,26,1]));return{id:Bqe,diagram:e}},"loader"),Qcn={id:Bqe,detector:Icn,loader:Mcn},Dcn=Qcn,Fqe="gitGraph",Lcn=B(e=>/^\s*gitGraph/.test(e),"detector"),jcn=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./gitGraphDiagram-V2S2FVAM-TQkc-xrr.js");return{diagram:t}},__vite__mapDeps([28,29,30,31,14,16,17,1]));return{id:Fqe,diagram:e}},"loader"),Xcn={id:Fqe,detector:Lcn,loader:jcn},Ucn=Xcn,Yqe="gantt",zcn=B(e=>/^\s*gantt/.test(e),"detector"),Bcn=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./ganttDiagram-JELNMOA3-D0g_cUWu.js");return{diagram:t}},__vite__mapDeps([32,33,34,35,1]));return{id:Yqe,diagram:e}},"loader"),Fcn={id:Yqe,detector:zcn,loader:Bcn},Ycn=Fcn,Vqe="info",Vcn=B(e=>/^\s*info/.test(e),"detector"),qcn=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./infoDiagram-HS3SLOUP-DQMl9_wt.js");return{diagram:t}},__vite__mapDeps([36,31,14,16,17,1]));return{id:Vqe,diagram:e}},"loader"),Wcn={id:Vqe,detector:Vcn,loader:qcn},qqe="pie",Gcn=B(e=>/^\s*pie/.test(e),"detector"),Hcn=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./pieDiagram-ADFJNKIX-Biwi_J05.js");return{diagram:t}},__vite__mapDeps([37,29,31,14,16,17,38,39,34,1]));return{id:qqe,diagram:e}},"loader"),Zcn={id:qqe,detector:Gcn,loader:Hcn},Wqe="quadrantChart",Kcn=B(e=>/^\s*quadrantChart/.test(e),"detector"),Jcn=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./quadrantDiagram-AYHSOK5B-DQKMslKQ.js");return{diagram:t}},__vite__mapDeps([40,33,34,35,1]));return{id:Wqe,diagram:e}},"loader"),eun={id:Wqe,detector:Kcn,loader:Jcn},tun=eun,Gqe="xychart",nun=B(e=>/^\s*xychart(-beta)?/.test(e),"detector"),run=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./xychartDiagram-PRI3JC2R-asoyMZsR.js");return{diagram:t}},__vite__mapDeps([41,34,39,33,35,1]));return{id:Gqe,diagram:e}},"loader"),sun={id:Gqe,detector:nun,loader:run},iun=sun,Hqe="requirement",oun=B(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),aun=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./requirementDiagram-UZGBJVZJ-DO5EY0UC.js");return{diagram:t}},__vite__mapDeps([42,24,25,1]));return{id:Hqe,diagram:e}},"loader"),lun={id:Hqe,detector:oun,loader:aun},cun=lun,Zqe="sequence",uun=B(e=>/^\s*sequenceDiagram/.test(e),"detector"),dun=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./sequenceDiagram-WL72ISMW-DFLXESpb.js");return{diagram:t}},__vite__mapDeps([43,21,30,1]));return{id:Zqe,diagram:e}},"loader"),pun={id:Zqe,detector:uun,loader:dun},fun=pun,Kqe="class",hun=B((e,t)=>t?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e),"detector"),mun=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./classDiagram-2ON5EDUG-qoCOCmX0.js");return{diagram:t}},__vite__mapDeps([44,45,23,24,25,1]));return{id:Kqe,diagram:e}},"loader"),Oun={id:Kqe,detector:hun,loader:mun},gun=Oun,Jqe="classDiagram",_un=B((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e),"detector"),bun=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./classDiagram-v2-WZHVMYZB-qoCOCmX0.js");return{diagram:t}},__vite__mapDeps([46,45,23,24,25,1]));return{id:Jqe,diagram:e}},"loader"),yun={id:Jqe,detector:_un,loader:bun},xun=yun,e6e="state",Sun=B((e,t)=>t?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e),"detector"),vun=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./stateDiagram-FKZM4ZOC-C56epGkN.js");return{diagram:t}},__vite__mapDeps([47,48,24,25,13,14,15,16,1]));return{id:e6e,diagram:e}},"loader"),Tun={id:e6e,detector:Sun,loader:vun},Eun=Tun,t6e="stateDiagram",wun=B((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer==="dagre-wrapper"),"detector"),kun=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./stateDiagram-v2-4FDKWEC3-Bvha5qjw.js");return{diagram:t}},__vite__mapDeps([49,48,24,25,1]));return{id:t6e,diagram:e}},"loader"),Cun={id:t6e,detector:wun,loader:kun},Run=Cun,n6e="journey",Pun=B(e=>/^\s*journey/.test(e),"detector"),$un=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./journeyDiagram-XKPGCS4Q-CykZgvZw.js");return{diagram:t}},__vite__mapDeps([50,21,23,38,1]));return{id:n6e,diagram:e}},"loader"),Nun={id:n6e,detector:Pun,loader:$un},Aun=Nun,Iun=B((e,t,n)=>{dt.debug(`rendering svg for syntax error
1328
- `);const r=pnn(t),s=r.append("g");r.attr("viewBox","0 0 2412 512"),CBe(r,100,512,!0),s.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),s.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),s.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),s.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),s.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),s.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),s.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),s.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${n}`)},"draw"),r6e={draw:Iun},Mun=r6e,Qun={db:{},renderer:r6e,parser:{parse:B(()=>{},"parse")}},Dun=Qun,s6e="flowchart-elk",Lun=B((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk"?(t.layout="elk",!0):!1,"detector"),jun=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-BSxdxCYS.js");return{diagram:t}},__vite__mapDeps([22,23,24,25,26,1]));return{id:s6e,diagram:e}},"loader"),Xun={id:s6e,detector:Lun,loader:jun},Uun=Xun,i6e="timeline",zun=B(e=>/^\s*timeline/.test(e),"detector"),Bun=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./timeline-definition-IT6M3QCI-D-LvEkyb.js");return{diagram:t}},__vite__mapDeps([51,38,1]));return{id:i6e,diagram:e}},"loader"),Fun={id:i6e,detector:zun,loader:Bun},Yun=Fun,o6e="mindmap",Vun=B(e=>/^\s*mindmap/.test(e),"detector"),qun=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./mindmap-definition-VGOIOE7T-vFLgNrGn.js");return{diagram:t}},__vite__mapDeps([52,24,25,1]));return{id:o6e,diagram:e}},"loader"),Wun={id:o6e,detector:Vun,loader:qun},Gun=Wun,a6e="kanban",Hun=B(e=>/^\s*kanban/.test(e),"detector"),Zun=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./kanban-definition-3W4ZIXB7-BTME6mxG.js");return{diagram:t}},__vite__mapDeps([53,23,1]));return{id:a6e,diagram:e}},"loader"),Kun={id:a6e,detector:Hun,loader:Zun},Jun=Kun,l6e="sankey",edn=B(e=>/^\s*sankey(-beta)?/.test(e),"detector"),tdn=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./sankeyDiagram-TZEHDZUN-DOMdB3JA.js");return{diagram:t}},__vite__mapDeps([54,39,34,1]));return{id:l6e,diagram:e}},"loader"),ndn={id:l6e,detector:edn,loader:tdn},rdn=ndn,c6e="packet",sdn=B(e=>/^\s*packet(-beta)?/.test(e),"detector"),idn=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./diagram-S2PKOQOG-DEF8UYeX.js");return{diagram:t}},__vite__mapDeps([55,29,31,14,16,17,1]));return{id:c6e,diagram:e}},"loader"),odn={id:c6e,detector:sdn,loader:idn},u6e="radar",adn=B(e=>/^\s*radar-beta/.test(e),"detector"),ldn=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./diagram-QEK2KX5R-C6IgPHXC.js");return{diagram:t}},__vite__mapDeps([56,29,31,14,16,17,1]));return{id:u6e,diagram:e}},"loader"),cdn={id:u6e,detector:adn,loader:ldn},d6e="block",udn=B(e=>/^\s*block(-beta)?/.test(e),"detector"),ddn=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./blockDiagram-VD42YOAC-CxEdXgIy.js");return{diagram:t}},__vite__mapDeps([57,23,17,14,13,26,1]));return{id:d6e,diagram:e}},"loader"),pdn={id:d6e,detector:udn,loader:ddn},fdn=pdn,p6e="architecture",hdn=B(e=>/^\s*architecture/.test(e),"detector"),mdn=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./architectureDiagram-VXUJARFQ-CVnLH_nx.js");return{diagram:t}},__vite__mapDeps([58,29,31,14,16,17,19,1]));return{id:p6e,diagram:e}},"loader"),Odn={id:p6e,detector:hdn,loader:mdn},gdn=Odn,f6e="treemap",_dn=B(e=>/^\s*treemap/.test(e),"detector"),bdn=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./diagram-PSM6KHXK-CUpooxWa.js");return{diagram:t}},__vite__mapDeps([59,25,29,31,14,16,17,35,39,34,1]));return{id:f6e,diagram:e}},"loader"),ydn={id:f6e,detector:_dn,loader:bdn},bye=!1,l3=B(()=>{bye||(bye=!0,u5("error",Dun,e=>e.toLowerCase().trim()==="error"),u5("---",{db:{clear:B(()=>{},"clear")},styles:{},renderer:{draw:B(()=>{},"draw")},parser:{parse:B(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:B(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),iK(Uun,Gun,gdn),iK(Ecn,Jun,xun,gun,Dcn,Ycn,Wcn,Zcn,cun,fun,Acn,Rcn,Yun,Ucn,Run,Eun,Aun,tun,rdn,odn,iun,fdn,cdn,ydn))},"addDiagrams"),xdn=B(async()=>{dt.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(qb).map(async([n,{detector:r,loader:s}])=>{if(s)try{cK(n)}catch{try{const{diagram:i,id:o}=await s();u5(o,i,r)}catch(i){throw dt.error(`Failed to load external diagram with key ${n}. Removing from detectors.`),delete qb[n],i}}}))).filter(n=>n.status==="rejected");if(t.length>0){dt.error(`Failed to load ${t.length} external diagrams`);for(const n of t)dt.error(n);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),Sdn="graphics-document document";function h6e(e,t){e.attr("role",Sdn),t!==""&&e.attr("aria-roledescription",t)}B(h6e,"setA11yDiagramInfo");function m6e(e,t,n,r){if(e.insert!==void 0){if(n){const s=`chart-desc-${r}`;e.attr("aria-describedby",s),e.insert("desc",":first-child").attr("id",s).text(n)}if(t){const s=`chart-title-${r}`;e.attr("aria-labelledby",s),e.insert("title",":first-child").attr("id",s).text(t)}}}B(m6e,"addSVGa11yTitleDescription");var JK=class O6e{constructor(t,n,r,s,i){this.type=t,this.text=n,this.db=r,this.parser=s,this.renderer=i}static{B(this,"Diagram")}static async fromText(t,n={}){const r=Ra(),s=Aie(t,r);t=yon(t)+`
1327
+ L0,20`)},"requirement_arrow"),Xln=B((e,t,n)=>{const r=e.append("defs").append("marker").attr("id",n+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");r.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),r.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),r.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),Uln={extension:wln,composition:kln,aggregation:Cln,dependency:Rln,lollipop:Pln,point:$ln,circle:Nln,cross:Aln,barb:Iln,only_one:Mln,zero_or_one:Qln,one_or_more:Dln,zero_or_more:Lln,requirement_arrow:jln,requirement_contains:Xln},zln=Eln,Bln={common:IE,getConfig:Ra,insertCluster:Zan,insertEdge:Tln,insertEdgeLabel:_ln,insertMarkers:zln,insertNode:Rqe,interpolateToCurve:uoe,labelHelper:Nn,log:dt,positionEdgeLabel:bln},EP={},Aqe=B(e=>{for(const t of e)EP[t.name]=t},"registerLayoutLoaders"),Fln=B(()=>{Aqe([{name:"dagre",loader:B(async()=>await Me(()=>import("./dagre-6UL2VRFP-C4GYV0TR.js"),__vite__mapDeps([12,13,14,15,16,17,1])),"loader")},{name:"cose-bilkent",loader:B(async()=>await Me(()=>import("./cose-bilkent-S5V4N54A-BCVE3XIz.js"),__vite__mapDeps([18,19,1])),"loader")}])},"registerDefaultLayoutLoaders");Fln();var UZn=B(async(e,t)=>{if(!(e.layoutAlgorithm in EP))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);const n=EP[e.layoutAlgorithm];return(await n.loader()).render(e,t,Bln,{algorithm:n.algorithm})},"render"),zZn=B((e="",{fallback:t="dagre"}={})=>{if(e in EP)return e;if(t in EP)return dt.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm"),Iqe="comm",Mqe="rule",Qqe="decl",Yln="@import",Vln="@namespace",qln="@keyframes",Wln="@layer",Dqe=Math.abs,Poe=String.fromCharCode;function Lqe(e){return e.trim()}function p2(e,t,n){return e.replace(t,n)}function Gln(e,t,n){return e.indexOf(t,n)}function fv(e,t){return e.charCodeAt(t)|0}function RT(e,t,n){return e.slice(t,n)}function zp(e){return e.length}function Hln(e){return e.length}function UI(e,t){return t.push(e),e}var o3=1,PT=1,jqe=0,Zu=0,Xi=0,jE="";function $oe(e,t,n,r,s,i,o,a){return{value:e,root:t,parent:n,type:r,props:s,children:i,line:o3,column:PT,length:o,return:"",siblings:a}}function Zln(){return Xi}function Kln(){return Xi=Zu>0?fv(jE,--Zu):0,PT--,Xi===10&&(PT=1,o3--),Xi}function Vd(){return Xi=Zu<jqe?fv(jE,Zu++):0,PT++,Xi===10&&(PT=1,o3++),Xi}function ng(){return fv(jE,Zu)}function f2(){return Zu}function a3(e,t){return RT(jE,e,t)}function wP(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Jln(e){return o3=PT=1,jqe=zp(jE=e),Zu=0,[]}function ecn(e){return jE="",e}function bV(e){return Lqe(a3(Zu-1,qK(e===91?e+2:e===40?e+1:e)))}function tcn(e){for(;(Xi=ng())&&Xi<33;)Vd();return wP(e)>2||wP(Xi)>3?"":" "}function ncn(e,t){for(;--t&&Vd()&&!(Xi<48||Xi>102||Xi>57&&Xi<65||Xi>70&&Xi<97););return a3(e,f2()+(t<6&&ng()==32&&Vd()==32))}function qK(e){for(;Vd();)switch(Xi){case e:return Zu;case 34:case 39:e!==34&&e!==39&&qK(Xi);break;case 40:e===41&&qK(e);break;case 92:Vd();break}return Zu}function rcn(e,t){for(;Vd()&&e+Xi!==57;)if(e+Xi===84&&ng()===47)break;return"/*"+a3(t,Zu-1)+"*"+Poe(e===47?e:Vd())}function scn(e){for(;!wP(ng());)Vd();return a3(e,Zu)}function icn(e){return ecn(h2("",null,null,null,[""],e=Jln(e),0,[0],e))}function h2(e,t,n,r,s,i,o,a,c){for(var l=0,d=0,p=o,f=0,h=0,m=0,O=1,_=1,b=1,y=0,x="",S=s,v=i,T=r,E=x;_;)switch(m=y,y=Vd()){case 40:if(m!=108&&fv(E,p-1)==58){Gln(E+=p2(bV(y),"&","&\f"),"&\f",Dqe(l?a[l-1]:0))!=-1&&(b=-1);break}case 34:case 39:case 91:E+=bV(y);break;case 9:case 10:case 13:case 32:E+=tcn(m);break;case 92:E+=ncn(f2()-1,7);continue;case 47:switch(ng()){case 42:case 47:UI(ocn(rcn(Vd(),f2()),t,n,c),c),(wP(m||1)==5||wP(ng()||1)==5)&&zp(E)&&RT(E,-1,void 0)!==" "&&(E+=" ");break;default:E+="/"}break;case 123*O:a[l++]=zp(E)*b;case 125*O:case 59:case 0:switch(y){case 0:case 125:_=0;case 59+d:b==-1&&(E=p2(E,/\f/g,"")),h>0&&(zp(E)-p||O===0&&m===47)&&UI(h>32?pye(E+";",r,n,p-1,c):pye(p2(E," ","")+";",r,n,p-2,c),c);break;case 59:E+=";";default:if(UI(T=dye(E,t,n,l,d,s,a,x,S=[],v=[],p,i),i),y===123)if(d===0)h2(E,t,T,T,S,i,p,a,v);else{switch(f){case 99:if(fv(E,3)===110)break;case 108:if(fv(E,2)===97)break;default:d=0;case 100:case 109:case 115:}d?h2(e,T,T,r&&UI(dye(e,T,T,0,0,s,a,x,s,S=[],p,v),v),s,v,p,a,r?S:v):h2(E,T,T,T,[""],v,0,a,v)}}l=d=h=0,O=b=1,x=E="",p=o;break;case 58:p=1+zp(E),h=m;default:if(O<1){if(y==123)--O;else if(y==125&&O++==0&&Kln()==125)continue}switch(E+=Poe(y),y*O){case 38:b=d>0?1:(E+="\f",-1);break;case 44:a[l++]=(zp(E)-1)*b,b=1;break;case 64:ng()===45&&(E+=bV(Vd())),f=ng(),d=p=zp(x=E+=scn(f2())),y++;break;case 45:m===45&&zp(E)==2&&(O=0)}}return i}function dye(e,t,n,r,s,i,o,a,c,l,d,p){for(var f=s-1,h=s===0?i:[""],m=Hln(h),O=0,_=0,b=0;O<r;++O)for(var y=0,x=RT(e,f+1,f=Dqe(_=o[O])),S=e;y<m;++y)(S=Lqe(_>0?h[y]+" "+x:p2(x,/&\f/g,h[y])))&&(c[b++]=S);return $oe(e,t,n,s===0?Mqe:a,c,l,d,p)}function ocn(e,t,n,r){return $oe(e,t,n,Iqe,Poe(Zln()),RT(e,2,-2),0,r)}function pye(e,t,n,r,s){return $oe(e,t,n,Qqe,RT(e,0,r),RT(e,r+1,-1),r,s)}function WK(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function acn(e,t,n,r){switch(e.type){case Wln:if(e.children.length)break;case Yln:case Vln:case Qqe:return e.return=e.return||e.value;case Iqe:return"";case qln:return e.return=e.value+"{"+WK(e.children,r)+"}";case Mqe:if(!zp(e.value=e.props.join(",")))return""}return zp(n=WK(e.children,r))?e.return=e.value+"{"+n+"}":""}var lcn=dYe(Object.keys,Object),ccn=Object.prototype,ucn=ccn.hasOwnProperty;function dcn(e){if(!Hz(e))return lcn(e);var t=[];for(var n in Object(e))ucn.call(e,n)&&n!="constructor"&&t.push(n);return t}var GK=zy(zf,"DataView"),HK=zy(zf,"Promise"),ZK=zy(zf,"Set"),KK=zy(zf,"WeakMap"),fye="[object Map]",pcn="[object Object]",hye="[object Promise]",mye="[object Set]",Oye="[object WeakMap]",gye="[object DataView]",fcn=Uy(GK),hcn=Uy(vP),mcn=Uy(HK),Ocn=Uy(ZK),gcn=Uy(KK),m0=QE;(GK&&m0(new GK(new ArrayBuffer(1)))!=gye||vP&&m0(new vP)!=fye||HK&&m0(HK.resolve())!=hye||ZK&&m0(new ZK)!=mye||KK&&m0(new KK)!=Oye)&&(m0=function(e){var t=QE(e),n=t==pcn?e.constructor:void 0,r=n?Uy(n):"";if(r)switch(r){case fcn:return gye;case hcn:return fye;case mcn:return hye;case Ocn:return mye;case gcn:return Oye}return t});var _cn="[object Map]",bcn="[object Set]",ycn=Object.prototype,xcn=ycn.hasOwnProperty;function _ye(e){if(e==null)return!0;if(Zz(e)&&(P5(e)||typeof e=="string"||typeof e.splice=="function"||loe(e)||coe(e)||R5(e)))return!e.length;var t=m0(e);if(t==_cn||t==bcn)return!e.size;if(Hz(e))return!dcn(e).length;for(var n in e)if(xcn.call(e,n))return!1;return!0}var Xqe="c4",Scn=B(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),vcn=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./c4Diagram-YG6GDRKO-Dkq6gEV3.js");return{diagram:t}},__vite__mapDeps([20,21,1]));return{id:Xqe,diagram:e}},"loader"),Tcn={id:Xqe,detector:Scn,loader:vcn},Ecn=Tcn,Uqe="flowchart",wcn=B((e,t)=>t?.flowchart?.defaultRenderer==="dagre-wrapper"||t?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(e),"detector"),kcn=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-1hZTMKh3.js");return{diagram:t}},__vite__mapDeps([22,23,24,25,26,1]));return{id:Uqe,diagram:e}},"loader"),Ccn={id:Uqe,detector:wcn,loader:kcn},Rcn=Ccn,zqe="flowchart-v2",Pcn=B((e,t)=>t?.flowchart?.defaultRenderer==="dagre-d3"?!1:(t?.flowchart?.defaultRenderer==="elk"&&(t.layout="elk"),/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer==="dagre-wrapper"?!0:/^\s*flowchart/.test(e)),"detector"),$cn=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-1hZTMKh3.js");return{diagram:t}},__vite__mapDeps([22,23,24,25,26,1]));return{id:zqe,diagram:e}},"loader"),Ncn={id:zqe,detector:Pcn,loader:$cn},Acn=Ncn,Bqe="er",Icn=B(e=>/^\s*erDiagram/.test(e),"detector"),Mcn=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./erDiagram-Q2GNP2WA-CnYGIQmC.js");return{diagram:t}},__vite__mapDeps([27,24,25,26,1]));return{id:Bqe,diagram:e}},"loader"),Qcn={id:Bqe,detector:Icn,loader:Mcn},Dcn=Qcn,Fqe="gitGraph",Lcn=B(e=>/^\s*gitGraph/.test(e),"detector"),jcn=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./gitGraphDiagram-V2S2FVAM-Cu8GBTLw.js");return{diagram:t}},__vite__mapDeps([28,29,30,31,14,16,17,1]));return{id:Fqe,diagram:e}},"loader"),Xcn={id:Fqe,detector:Lcn,loader:jcn},Ucn=Xcn,Yqe="gantt",zcn=B(e=>/^\s*gantt/.test(e),"detector"),Bcn=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./ganttDiagram-JELNMOA3-BCfQhN9i.js");return{diagram:t}},__vite__mapDeps([32,33,34,35,1]));return{id:Yqe,diagram:e}},"loader"),Fcn={id:Yqe,detector:zcn,loader:Bcn},Ycn=Fcn,Vqe="info",Vcn=B(e=>/^\s*info/.test(e),"detector"),qcn=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./infoDiagram-HS3SLOUP-B_GZXitE.js");return{diagram:t}},__vite__mapDeps([36,31,14,16,17,1]));return{id:Vqe,diagram:e}},"loader"),Wcn={id:Vqe,detector:Vcn,loader:qcn},qqe="pie",Gcn=B(e=>/^\s*pie/.test(e),"detector"),Hcn=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./pieDiagram-ADFJNKIX-CXEOHmBN.js");return{diagram:t}},__vite__mapDeps([37,29,31,14,16,17,38,39,34,1]));return{id:qqe,diagram:e}},"loader"),Zcn={id:qqe,detector:Gcn,loader:Hcn},Wqe="quadrantChart",Kcn=B(e=>/^\s*quadrantChart/.test(e),"detector"),Jcn=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./quadrantDiagram-AYHSOK5B-B8ZBsI5N.js");return{diagram:t}},__vite__mapDeps([40,33,34,35,1]));return{id:Wqe,diagram:e}},"loader"),eun={id:Wqe,detector:Kcn,loader:Jcn},tun=eun,Gqe="xychart",nun=B(e=>/^\s*xychart(-beta)?/.test(e),"detector"),run=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./xychartDiagram-PRI3JC2R-DygAqeR5.js");return{diagram:t}},__vite__mapDeps([41,34,39,33,35,1]));return{id:Gqe,diagram:e}},"loader"),sun={id:Gqe,detector:nun,loader:run},iun=sun,Hqe="requirement",oun=B(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),aun=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./requirementDiagram-UZGBJVZJ-CxzUq46_.js");return{diagram:t}},__vite__mapDeps([42,24,25,1]));return{id:Hqe,diagram:e}},"loader"),lun={id:Hqe,detector:oun,loader:aun},cun=lun,Zqe="sequence",uun=B(e=>/^\s*sequenceDiagram/.test(e),"detector"),dun=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./sequenceDiagram-WL72ISMW-CtyLJiua.js");return{diagram:t}},__vite__mapDeps([43,21,30,1]));return{id:Zqe,diagram:e}},"loader"),pun={id:Zqe,detector:uun,loader:dun},fun=pun,Kqe="class",hun=B((e,t)=>t?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e),"detector"),mun=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./classDiagram-2ON5EDUG-Z8mpHhup.js");return{diagram:t}},__vite__mapDeps([44,45,23,24,25,1]));return{id:Kqe,diagram:e}},"loader"),Oun={id:Kqe,detector:hun,loader:mun},gun=Oun,Jqe="classDiagram",_un=B((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e),"detector"),bun=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./classDiagram-v2-WZHVMYZB-Z8mpHhup.js");return{diagram:t}},__vite__mapDeps([46,45,23,24,25,1]));return{id:Jqe,diagram:e}},"loader"),yun={id:Jqe,detector:_un,loader:bun},xun=yun,e6e="state",Sun=B((e,t)=>t?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e),"detector"),vun=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./stateDiagram-FKZM4ZOC-8rkEWYLZ.js");return{diagram:t}},__vite__mapDeps([47,48,24,25,13,14,15,16,1]));return{id:e6e,diagram:e}},"loader"),Tun={id:e6e,detector:Sun,loader:vun},Eun=Tun,t6e="stateDiagram",wun=B((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer==="dagre-wrapper"),"detector"),kun=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./stateDiagram-v2-4FDKWEC3-DZnIb-vO.js");return{diagram:t}},__vite__mapDeps([49,48,24,25,1]));return{id:t6e,diagram:e}},"loader"),Cun={id:t6e,detector:wun,loader:kun},Run=Cun,n6e="journey",Pun=B(e=>/^\s*journey/.test(e),"detector"),$un=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./journeyDiagram-XKPGCS4Q-DrjII-BL.js");return{diagram:t}},__vite__mapDeps([50,21,23,38,1]));return{id:n6e,diagram:e}},"loader"),Nun={id:n6e,detector:Pun,loader:$un},Aun=Nun,Iun=B((e,t,n)=>{dt.debug(`rendering svg for syntax error
1328
+ `);const r=pnn(t),s=r.append("g");r.attr("viewBox","0 0 2412 512"),CBe(r,100,512,!0),s.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),s.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),s.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),s.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),s.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),s.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),s.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),s.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${n}`)},"draw"),r6e={draw:Iun},Mun=r6e,Qun={db:{},renderer:r6e,parser:{parse:B(()=>{},"parse")}},Dun=Qun,s6e="flowchart-elk",Lun=B((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk"?(t.layout="elk",!0):!1,"detector"),jun=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-1hZTMKh3.js");return{diagram:t}},__vite__mapDeps([22,23,24,25,26,1]));return{id:s6e,diagram:e}},"loader"),Xun={id:s6e,detector:Lun,loader:jun},Uun=Xun,i6e="timeline",zun=B(e=>/^\s*timeline/.test(e),"detector"),Bun=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./timeline-definition-IT6M3QCI-DLAkMAGP.js");return{diagram:t}},__vite__mapDeps([51,38,1]));return{id:i6e,diagram:e}},"loader"),Fun={id:i6e,detector:zun,loader:Bun},Yun=Fun,o6e="mindmap",Vun=B(e=>/^\s*mindmap/.test(e),"detector"),qun=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./mindmap-definition-VGOIOE7T-Clu7da1H.js");return{diagram:t}},__vite__mapDeps([52,24,25,1]));return{id:o6e,diagram:e}},"loader"),Wun={id:o6e,detector:Vun,loader:qun},Gun=Wun,a6e="kanban",Hun=B(e=>/^\s*kanban/.test(e),"detector"),Zun=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./kanban-definition-3W4ZIXB7-CXj7EbX_.js");return{diagram:t}},__vite__mapDeps([53,23,1]));return{id:a6e,diagram:e}},"loader"),Kun={id:a6e,detector:Hun,loader:Zun},Jun=Kun,l6e="sankey",edn=B(e=>/^\s*sankey(-beta)?/.test(e),"detector"),tdn=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./sankeyDiagram-TZEHDZUN-DSnCrwsn.js");return{diagram:t}},__vite__mapDeps([54,39,34,1]));return{id:l6e,diagram:e}},"loader"),ndn={id:l6e,detector:edn,loader:tdn},rdn=ndn,c6e="packet",sdn=B(e=>/^\s*packet(-beta)?/.test(e),"detector"),idn=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./diagram-S2PKOQOG-CVPTloYp.js");return{diagram:t}},__vite__mapDeps([55,29,31,14,16,17,1]));return{id:c6e,diagram:e}},"loader"),odn={id:c6e,detector:sdn,loader:idn},u6e="radar",adn=B(e=>/^\s*radar-beta/.test(e),"detector"),ldn=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./diagram-QEK2KX5R-CufQjflj.js");return{diagram:t}},__vite__mapDeps([56,29,31,14,16,17,1]));return{id:u6e,diagram:e}},"loader"),cdn={id:u6e,detector:adn,loader:ldn},d6e="block",udn=B(e=>/^\s*block(-beta)?/.test(e),"detector"),ddn=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./blockDiagram-VD42YOAC-Ds1sLqQU.js");return{diagram:t}},__vite__mapDeps([57,23,17,14,13,26,1]));return{id:d6e,diagram:e}},"loader"),pdn={id:d6e,detector:udn,loader:ddn},fdn=pdn,p6e="architecture",hdn=B(e=>/^\s*architecture/.test(e),"detector"),mdn=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./architectureDiagram-VXUJARFQ-C3jinRFQ.js");return{diagram:t}},__vite__mapDeps([58,29,31,14,16,17,19,1]));return{id:p6e,diagram:e}},"loader"),Odn={id:p6e,detector:hdn,loader:mdn},gdn=Odn,f6e="treemap",_dn=B(e=>/^\s*treemap/.test(e),"detector"),bdn=B(async()=>{const{diagram:e}=await Me(async()=>{const{diagram:t}=await import("./diagram-PSM6KHXK-Bp5VcXOv.js");return{diagram:t}},__vite__mapDeps([59,25,29,31,14,16,17,35,39,34,1]));return{id:f6e,diagram:e}},"loader"),ydn={id:f6e,detector:_dn,loader:bdn},bye=!1,l3=B(()=>{bye||(bye=!0,u5("error",Dun,e=>e.toLowerCase().trim()==="error"),u5("---",{db:{clear:B(()=>{},"clear")},styles:{},renderer:{draw:B(()=>{},"draw")},parser:{parse:B(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:B(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),iK(Uun,Gun,gdn),iK(Ecn,Jun,xun,gun,Dcn,Ycn,Wcn,Zcn,cun,fun,Acn,Rcn,Yun,Ucn,Run,Eun,Aun,tun,rdn,odn,iun,fdn,cdn,ydn))},"addDiagrams"),xdn=B(async()=>{dt.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(qb).map(async([n,{detector:r,loader:s}])=>{if(s)try{cK(n)}catch{try{const{diagram:i,id:o}=await s();u5(o,i,r)}catch(i){throw dt.error(`Failed to load external diagram with key ${n}. Removing from detectors.`),delete qb[n],i}}}))).filter(n=>n.status==="rejected");if(t.length>0){dt.error(`Failed to load ${t.length} external diagrams`);for(const n of t)dt.error(n);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),Sdn="graphics-document document";function h6e(e,t){e.attr("role",Sdn),t!==""&&e.attr("aria-roledescription",t)}B(h6e,"setA11yDiagramInfo");function m6e(e,t,n,r){if(e.insert!==void 0){if(n){const s=`chart-desc-${r}`;e.attr("aria-describedby",s),e.insert("desc",":first-child").attr("id",s).text(n)}if(t){const s=`chart-title-${r}`;e.attr("aria-labelledby",s),e.insert("title",":first-child").attr("id",s).text(t)}}}B(m6e,"addSVGa11yTitleDescription");var JK=class O6e{constructor(t,n,r,s,i){this.type=t,this.text=n,this.db=r,this.parser=s,this.renderer=i}static{B(this,"Diagram")}static async fromText(t,n={}){const r=Ra(),s=Aie(t,r);t=yon(t)+`
1329
1329
  `;try{cK(s)}catch{const l=zZt(s);if(!l)throw new OBe(`Diagram ${s} not found.`);const{id:d,diagram:p}=await l();u5(d,p)}const{db:i,parser:o,renderer:a,init:c}=cK(s);return o.parser&&(o.parser.yy=i),i.clear?.(),c?.(r),n.title&&i.setDiagramTitle?.(n.title),await o.parse(t),new O6e(s,t,i,o,a)}async render(t,n){await this.renderer.draw(this.text,t,n,this)}getParser(){return this.parser}getType(){return this.type}},yye=[],vdn=B(()=>{yye.forEach(e=>{e()}),yye=[]},"attachFunctions"),Tdn=B(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function g6e(e){const t=e.match(mBe);if(!t)return{text:e,metadata:{}};let n=brn(t[1],{schema:_rn})??{};n=typeof n=="object"&&!Array.isArray(n)?n:{};const r={};return n.displayMode&&(r.displayMode=n.displayMode.toString()),n.title&&(r.title=n.title.toString()),n.config&&(r.config=n.config),{text:e.slice(t[0].length),metadata:r}}B(g6e,"extractFrontMatter");var Edn=B(e=>e.replace(/\r\n?/g,`
1330
1330
  `).replace(/<(\w+)([^>]*)>/g,(t,n,r)=>"<"+n+r.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),wdn=B(e=>{const{text:t,metadata:n}=g6e(e),{displayMode:r,title:s,config:i={}}=n;return r&&(i.gantt||(i.gantt={}),i.gantt.displayMode=r),{title:s,config:i,text:t}},"processFrontmatter"),kdn=B(e=>{const t=Cd.detectInit(e)??{},n=Cd.detectDirective(e,"wrap");return Array.isArray(n)?t.wrap=n.some(({type:r})=>r==="wrap"):n?.type==="wrap"&&(t.wrap=!0),{text:aon(e),directive:t}},"processDirectives");function Noe(e){const t=Edn(e),n=wdn(t),r=kdn(n.text),s=moe(n.config,r.directive);return e=Tdn(r.text),{code:e,title:n.title,config:s}}B(Noe,"preprocessDiagram");function _6e(e){const t=new TextEncoder().encode(e),n=Array.from(t,r=>String.fromCodePoint(r)).join("");return btoa(n)}B(_6e,"toBase64");var Cdn=5e4,Rdn="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",Pdn="sandbox",$dn="loose",Ndn="http://www.w3.org/2000/svg",Adn="http://www.w3.org/1999/xlink",Idn="http://www.w3.org/1999/xhtml",Mdn="100%",Qdn="100%",Ddn="border:0;margin:0;",Ldn="margin:0",jdn="allow-top-navigation-by-user-activation allow-popups",Xdn='The "iframe" tag is not supported by your browser.',Udn=["foreignobject"],zdn=["dominant-baseline"];function Aoe(e){const t=Noe(e);return l5(),sKt(t.config??{}),t}B(Aoe,"processAndSetConfigs");async function b6e(e,t){l3();try{const{code:n,config:r}=Aoe(e);return{diagramType:(await x6e(n)).type,config:r}}catch(n){if(t?.suppressErrors)return!1;throw n}}B(b6e,"parse");var xye=B((e,t,n=[])=>`
1331
1331
  .${e} ${t} { ${n.join(" !important; ")} !important; }`,"cssImportantStyles"),Bdn=B((e,t=new Map)=>{let n="";if(e.themeCSS!==void 0&&(n+=`
@@ -1646,7 +1646,7 @@ ${xe}`.slice(0,2e3);f?.(Re,Fe)},[_n,e.from,e.summary,e,f,$,I]),jt=L&&x,Nt=jt&&!T
1646
1646
 
1647
1647
  已隐藏 CLI 流中的原始载荷,因为其中包含编码或类似二进制的内容。
1648
1648
 
1649
- 请展开下面的 **CLI 日志** 查看可读诊断。`:null}const WQn=({title:e,message:t,messageSeverity:n,tone:r="default",defaultLiveOutputOpen:s=!0,defaultLogsOpen:i,currentStepIndex:o,errorStepIndex:a,loading:c=!1,onCancel:l,successMessage:d,successMessageSeverity:p="success",onDismiss:f,startedAt:h,pid:m,cliLogsTail:O,assistantOutput:_,launchDiagnostics:b,surface:y="raised",className:x})=>{const S=VQn(h,c),[v,T]=g.useState(()=>i??!1),[E,w]=g.useState(!1),[P,k]=g.useState(s),C=g.useRef(null),M=r==="error",I=qQn(_,M),$=b?.filter(R=>R.severity==="warning"||R.severity==="error")??[];return g.useEffect(()=>{P&&C.current&&(C.current.scrollTop=C.current.scrollHeight)},[_,P]),g.useEffect(()=>{k(s)},[s]),g.useEffect(()=>{i!==void 0&&T(i)},[i]),g.useEffect(()=>{M&&O&&(T(!0),k(!1))},[M,O]),u.jsxs("div",{className:at(y==="flat"?"rounded-none border-0 bg-transparent p-0":"rounded-md border border-[var(--color-border)] bg-[var(--color-surface-raised)] px-3 py-2",M&&"border-red-500/40 bg-red-500/10",x),children:[d?u.jsxs("div",{className:"mb-1.5 flex items-center gap-2",children:[p==="warning"?u.jsx(qn,{size:14,className:"shrink-0 text-amber-400"}):p==="info"?u.jsx(Ks,{size:14,className:"shrink-0 text-sky-400"}):u.jsx(pl,{size:14,className:"shrink-0 text-[var(--step-done-text)]"}),u.jsx("p",{className:at("flex-1 text-xs",p==="warning"?"text-amber-400":p==="info"?"text-sky-400":"text-[var(--step-success-text)]"),children:d}),f?u.jsx(Xe,{variant:"ghost",size:"sm",className:"size-6 shrink-0 p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text)]",onClick:f,children:u.jsx(Ar,{size:12})}):null]}):f?u.jsx("div",{className:"flex justify-end",children:u.jsx(Xe,{variant:"ghost",size:"sm",className:"size-6 shrink-0 p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text)]",onClick:f,children:u.jsx(Ar,{size:12})})}):null,u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[c?u.jsx(Ht,{className:"size-3.5 shrink-0 animate-spin text-[var(--color-text-muted)]"}):null,u.jsx("p",{className:"text-xs font-medium text-[var(--color-text)]",children:e}),S!==null?u.jsxs("span",{className:"text-[10px] tabular-nums text-[var(--color-text-muted)]",children:["已运行 ",S]}):null,m!==void 0?u.jsxs("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:["PID ",m]}):null]}),l?u.jsx(Xe,{variant:"outline",size:"sm",className:"h-6 shrink-0 px-2 text-xs",onClick:l,children:"取消"}):null]}),t?u.jsx("p",{className:at("mt-1.5 text-xs",M||n==="error"?"text-red-400":n==="warning"?"text-amber-400":n==="info"?"text-sky-400":"text-[var(--color-text-muted)]"),children:t}):null,u.jsx("div",{className:"mt-2 px-2",children:u.jsx(WZe,{steps:FQn,currentIndex:o,errorIndex:a})}),$.length>0?u.jsxs("div",{className:"mt-2",children:[u.jsxs("button",{type:"button",className:"flex items-center gap-1 text-[11px] text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:()=>w(R=>!R),children:[E?u.jsx(Dr,{size:12}):u.jsx(jn,{size:12}),"诊断"]}),E?u.jsx("div",{className:"mt-1 space-y-1 rounded border border-[var(--color-border)] bg-[var(--color-surface)] p-2",children:$.map(R=>u.jsxs("div",{className:"text-[11px]",children:[u.jsx("div",{className:at(R.severity==="error"?"text-red-400":R.severity==="warning"?"text-amber-400":"text-[var(--color-text-secondary)]"),children:R.label}),R.detail?u.jsx("div",{className:"mt-0.5 text-[10px] text-[var(--color-text-muted)]",children:R.detail}):null]},R.id))}):null]}):null,u.jsxs("div",{className:"mt-2",children:[u.jsxs("button",{type:"button",className:"flex items-center gap-1 text-[11px] text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:()=>k(R=>!R),children:[P?u.jsx(Dr,{size:12}):u.jsx(jn,{size:12}),"实时输出"]}),P?u.jsx("div",{ref:C,className:at("mt-1 h-40 overflow-y-auto rounded border border-[var(--color-border)] bg-[var(--color-surface)] p-2",M&&"border-red-500/40"),children:I?u.jsx(ri,{content:I,bare:!0,maxHeight:"max-h-none"}):u.jsx("p",{className:at("text-[11px]",M?"text-[var(--step-error-text-dim)]":"text-[var(--color-text-muted)]"),children:"暂无输出。"})}):null]}),O?u.jsxs("div",{className:"mt-2",children:[u.jsxs("button",{type:"button",className:"flex items-center gap-1 text-[11px] text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:()=>T(R=>!R),children:[v?u.jsx(Dr,{size:12}):u.jsx(jn,{size:12}),"CLI 日志"]}),v?u.jsx(JZe,{cliLogsTail:O,order:"newest-first",className:"mt-1"}):null]}):null]})};function eKe(e){const{progress:t,cancelProvisioning:n,cancelCurrentProvisioning:r,teamMembers:s,memberSpawnStatuses:i,memberSpawnSnapshot:o}=le(Et(c=>({progress:wf(c,e),cancelProvisioning:c.cancelProvisioning,cancelCurrentProvisioning:c.cancelCurrentProvisioning,teamMembers:$se(c,e),memberSpawnStatuses:c.memberSpawnStatusesByTeam[e],memberSpawnSnapshot:c.memberSpawnSnapshotsByTeam[e]})));return{presentation:g.useMemo(()=>Sle({progress:t,members:s,memberSpawnStatuses:i,memberSpawnSnapshot:o}),[o,i,t,s]),cancelProvisioning:n,cancelCurrentProvisioning:r,runInstanceKey:t?`${e}:${t.runId}:${t.startedAt}`:null}}const tKe=g.memo(function({teamName:t,surface:n="flat",dismissible:r=!1,className:s,defaultLogsOpen:i}){const{presentation:o,cancelProvisioning:a,cancelCurrentProvisioning:c,runInstanceKey:l}=eKe(t),[d,p]=g.useState(!1),f=g.useRef(-1);if(g.useEffect(()=>{p(!1)},[l]),!o||d)return null;o.currentStepIndex>=0&&!o.isFailed&&(f.current=o.currentStepIndex);const h=o.isActive||o.hasMembersStillJoining,m=u.jsx(WQn,{title:o.panelTitle,message:o.panelMessage,messageSeverity:o.panelMessageSeverity,tone:o.panelTone,surface:n,currentStepIndex:o.currentStepIndex,errorStepIndex:o.isFailed?f.current>=0?f.current:0:void 0,loading:h,startedAt:o.progress.startedAt,pid:o.progress.pid,cliLogsTail:o.progress.cliLogsTail,assistantOutput:o.progress.assistantOutput,launchDiagnostics:o.progress.launchDiagnostics,defaultLiveOutputOpen:o.defaultLiveOutputOpen,defaultLogsOpen:i,onCancel:o.canCancel&&(c??a)?()=>{(c??a)?.(t,o.progress.runId)}:null,successMessage:o.successMessage,successMessageSeverity:o.successMessageSeverity,onDismiss:r&&o.isReady?()=>{p(!0)}:null,className:o.isFailed?void 0:s},o.progress.runId);return o.isFailed?u.jsxs("div",{className:at("space-y-2",s),children:[u.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-red-500/40 bg-red-500/10 px-3 py-2",children:[u.jsx("p",{className:"flex-1 text-xs text-[var(--step-error-text)]",children:o.progress.message}),r?u.jsx(Xe,{variant:"outline",size:"sm",className:"h-6 shrink-0 border-red-500/40 px-2 text-xs text-[var(--step-error-text)] hover:bg-red-500/10",onClick:()=>p(!0),children:u.jsx(Ar,{size:12})}):null]}),m]}):m}),GQn=lie.map(e=>({key:e.key,label:e.label})),HQn={"--stepper-done":"#22c55e","--stepper-done-glow":"rgba(34, 197, 94, 0.24)","--stepper-current":"#22c55e","--stepper-current-ring":"rgba(34, 197, 94, 0.18)","--stepper-pending":"rgba(148, 163, 184, 0.08)","--stepper-pending-text":"#cbd5e1","--stepper-pending-border":"rgba(148, 163, 184, 0.2)","--stepper-line":"rgba(148, 163, 184, 0.14)","--stepper-line-done":"#22c55e","--stepper-label":"#94a3b8","--stepper-label-active":"#e2e8f0","--stepper-error":"#ef4444","--stepper-error-glow":"rgba(239, 68, 68, 0.22)","--stepper-label-error":"#fca5a5"};function ZQn(e){return e!=null&&(e.isActive||e.isFailed)}const KQn=({teamName:e,enabled:t=!0})=>{const{presentation:n,runInstanceKey:r}=eKe(e),s=g.useRef(-1),[i,o]=g.useState(!1),a=t&&ZQn(n),c=n?.isFailed?s.current>=0?s.current:0:void 0;g.useEffect(()=>{o(!1),s.current=-1},[r,e]),g.useEffect(()=>{n&&!n.isFailed&&n.currentStepIndex>=0&&(s.current=n.currentStepIndex)},[n]);const l=g.useMemo(()=>[n?.compactTitle,n?.compactDetail].filter(Boolean).join(" - ")||"Open launch details",[n?.compactDetail,n?.compactTitle]);return!a||!n?null:u.jsxs(u.Fragment,{children:[u.jsxs("button",{type:"button",className:"focus-visible:ring-white/18 w-full touch-none select-none rounded-xl bg-transparent px-1 py-0.5 text-left text-slate-100 transition-opacity hover:opacity-95 focus-visible:outline-none focus-visible:ring-1",onClick:()=>o(!0),onMouseDown:d=>d.preventDefault(),onDragStart:d=>d.preventDefault(),"aria-label":l,children:[u.jsx("div",{className:"px-1 py-0.5",style:HQn,children:u.jsx(WZe,{steps:GQn,currentIndex:n.currentStepIndex,errorIndex:c,className:"w-full origin-top scale-[0.88]"})}),u.jsx("span",{className:"sr-only",children:l})]}),u.jsx(Os,{open:i,onOpenChange:o,children:u.jsxs(ls,{className:"w-[min(1120px,92vw)] max-w-5xl p-0",children:[u.jsxs(gs,{className:"sr-only",children:[u.jsx(cs,{children:"启动详情"}),u.jsx(Ti,{children:"查看团队启动进度、实时输出和 CLI 日志。"})]}),u.jsx("div",{className:"max-h-[85vh] overflow-y-auto p-4",children:u.jsx(tKe,{teamName:e,surface:"flat",defaultLogsOpen:!0})})]})})]})};function JQn(e,t){if(t.relatedTaskId)return[{taskId:t.relatedTaskId,displayId:t.relatedTaskDisplayId??t.relatedTaskId.slice(0,8),teamName:e}]}function e2n(e){const t=e.preview?.trim();return t||(e.kind==="task_assign"&&e.relatedTaskDisplayId?`Task ${e.relatedTaskDisplayId} assigned`:e.kind==="task_comment"&&e.relatedTaskDisplayId?`${e.relatedTaskDisplayId} updated`:`${e.sourceLabel} -> ${e.destinationLabel}`)}function t2n(e){const t=e.preview?.trim();switch(e.kind){case"task_assign":return`New task assigned to you: ${e.relatedTaskDisplayId??e.relatedTaskId??"task"}${t?` - ${t}`:""}`;case"task_comment":return t??`${e.sourceLabel} added a comment`;case"review_request":return t??`Review requested by ${e.sourceLabel}`;case"review_response":return t??`Review response from ${e.sourceLabel}`;case"inbox_message":default:return t??`${e.sourceLabel} -> ${e.destinationLabel}`}}function n2n(e,t){const n=t.kind==="task_comment"?"task_comment_notification":"default",r=JQn(e,t);return{from:t.sourceLabel,to:t.destinationLabel,text:t2n(t),timestamp:new Date(t.updatedAt*1e3).toISOString(),read:!0,summary:e2n(t),color:t.color,messageId:`graph-handoff:${t.key}`,source:"inbox",messageKind:n,taskRefs:r}}const Ewe=Pd.width,r2n=72,s2n=10,i2n=({teamName:e,getTransientHandoffSnapshot:t=()=>({cards:[],time:0}),getCameraZoom:n=()=>1,worldToScreen:r,getNodeWorldPosition:s=()=>null,focusNodeIds:i,focusEdgeIds:o,enabled:a=!0})=>{const c=g.useRef(null),l=g.useRef(new Map),d=g.useRef(""),[p,f]=g.useState([]),{teamData:h,teams:m}=XN(e),O=g.useMemo(()=>QN(h?.members),[h?.members]),{teamNames:_,teamColorByName:b}=Lle(m);g.useEffect(()=>{d.current="",f([])},[e]),g.useLayoutEffect(()=>{if(!a){f([]);return}let x=0;const S=()=>{const v=t({focusNodeIds:i,focusEdgeIds:o}),T=v.cards.filter(k=>k.anchorKind==="lead"||k.anchorKind==="member"),E=T.map(k=>`${k.key}:${k.count}:${k.updatedAt}:${k.anchorNodeId}`).join("|");E!==d.current&&(d.current=E,f(T));const w=c.current;if(w&&r){const k=r(0,0),C=Math.max(n(),.001);w.style.transform=`translate(${Math.round(k.x)}px, ${Math.round(k.y)}px) scale(${C.toFixed(3)})`}const P=new Map;for(const k of T){const C=l.current.get(k.key);if(!C)continue;const M=s(k.anchorNodeId),I=Y7e(k,v.time);if(!M||!r||I<=.001){C.style.opacity="0";continue}const $=P.get(k.anchorNodeId)??0;P.set(k.anchorNodeId,$+1);const R=$*(r2n*.34+s2n),N=.94+I*.06;C.style.left=`${Math.round(M.x)}px`,C.style.top=`${Math.round(M.y)}px`,C.style.opacity=String(I),C.style.transform=`translate(-50%, calc(-50% - ${R.toFixed(1)}px)) scale(${N.toFixed(3)})`}x=window.requestAnimationFrame(S)};return S(),()=>{window.cancelAnimationFrame(x)}},[a,o,i,n,s,t,r]);const y=g.useMemo(()=>p.map((x,S)=>({card:x,message:n2n(e,x),zebraShade:S%2===1})),[p,e]);return!a||!h||p.length===0?null:u.jsx("div",{ref:c,className:"pointer-events-none absolute left-0 top-0 z-[9] origin-top-left select-none",children:y.map(({card:x,message:S,zebraShade:v})=>u.jsx("div",{ref:T=>{l.current.set(x.key,T)},className:"pointer-events-none absolute z-[9] origin-center opacity-0 transition-opacity duration-150 ease-out",style:{width:`${Ewe}px`,maxWidth:`${Ewe}px`},onDragStart:T=>{T.preventDefault()},children:u.jsx(VZe,{message:S,teamName:e,messageContext:O,teamNames:_,teamColorByName:b,zebraShade:v,className:"pointer-events-none drop-shadow-[0_0_22px_rgba(94,234,212,0.12)]"})},x.key))})},o2n=g.lazy(()=>Me(()=>import("./TeamGraphOverlay-DeBN5lDT.js"),__vite__mapDeps([60,1])).then(e=>({default:e.TeamGraphOverlay}))),a2n=({teamName:e,isActive:t=!0,isPaneFocused:n=!1})=>{const r=bMn(e),{openTeamPage:s,commitOwnerSlotDrop:i,commitOwnerGridOrderDrop:o,setLayoutMode:a}=yMn(e),[c,l]=g.useState(!1),{sidebarVisible:d,toggleSidebarVisible:p}=_Mn(),{dialog:f,openCreateTaskDialog:h}=OMn(e),m=g.useCallback(M=>window.dispatchEvent(new CustomEvent("graph:open-task",{detail:{teamName:e,taskId:M}})),[e]),O=g.useCallback(M=>window.dispatchEvent(new CustomEvent("graph:send-message",{detail:{teamName:e,memberName:M}})),[e]),_=g.useCallback((M,I)=>window.dispatchEvent(new CustomEvent("graph:open-profile",{detail:{teamName:e,memberName:M,...I}})),[e]),b=g.useCallback(()=>{h("")},[h]),y=g.useCallback(M=>I=>window.dispatchEvent(new CustomEvent(`graph:${M}`,{detail:{teamName:e,taskId:I}})),[e]),x=g.useMemo(()=>y("start-task"),[y]),S=g.useMemo(()=>y("complete-task"),[y]),v=g.useMemo(()=>y("approve-task"),[y]),T=g.useMemo(()=>y("request-review"),[y]),E=g.useMemo(()=>y("request-changes"),[y]),w=g.useMemo(()=>y("cancel-task"),[y]),P=g.useMemo(()=>y("move-back-to-done"),[y]),k=g.useMemo(()=>y("delete-task"),[y]),C={onNodeDoubleClick:g.useCallback(M=>{M.kind==="task"?m(M.taskId):M.kind==="member"&&_(M.memberName)},[m,_]),onSendMessage:O,onOpenTaskDetail:m,onOpenMemberProfile:g.useCallback(M=>{_(M)},[_])};return u.jsxs("div",{className:"flex size-full overflow-hidden",style:{background:"#050510"},children:[d?u.jsx(cMn,{teamName:e,surface:"graph-tab",isActive:t,isFocused:n}):null,u.jsx("div",{className:"min-w-0 flex-1",children:u.jsx(KIn,{data:r,events:C,className:"team-graph-view size-full",suspendAnimation:!t,isSurfaceActive:t,onRequestFullscreen:()=>l(!0),onOpenTeamPage:s,onCreateTask:b,onToggleSidebar:p,isSidebarVisible:d,renderTopToolbarContent:()=>u.jsx(KQn,{teamName:e,enabled:t}),onLayoutModeChange:a,onOwnerSlotDrop:i,onOwnerGridOrderDrop:o,renderHud:M=>{const I=M,{getViewportSize:$,focusNodeIds:R,filters:N}=I;return u.jsxs(u.Fragment,{children:[u.jsx(i2n,{teamName:e,getTransientHandoffSnapshot:I.getTransientHandoffSnapshot,getCameraZoom:I.getCameraZoom,worldToScreen:I.worldToScreen,getNodeWorldPosition:I.getNodeWorldPosition,focusNodeIds:R,focusEdgeIds:I.focusEdgeIds??null,enabled:t}),u.jsx(bQn,{teamName:e,nodes:r.nodes,getActivityWorldRect:I.getActivityWorldRect,getCameraZoom:I.getCameraZoom,worldToScreen:I.worldToScreen,getNodeWorldPosition:I.getNodeWorldPosition,getViewportSize:$,focusNodeIds:R,enabled:t&&(N?.showActivity??!0),onOpenTaskDetail:m,onOpenMemberProfile:_})]})},renderEdgeOverlay:({edge:M,sourceNode:I,targetNode:$,onClose:R,onSelectNode:N})=>u.jsx(yQn,{teamName:e,edge:M,sourceNode:I,targetNode:$,onClose:R,onSelectNode:N,onOpenTaskDetail:m}),renderOverlay:({node:M,onClose:I})=>u.jsx($Qn,{node:M,teamName:e,onClose:I,onSendMessage:O,onOpenTaskDetail:m,onOpenMemberProfile:_,onCreateTask:h,onStartTask:x,onCompleteTask:S,onApproveTask:v,onRequestReview:T,onRequestChanges:E,onCancelTask:w,onMoveBackToDone:P,onDeleteTask:k})})}),f,c&&u.jsx(g.Suspense,{fallback:null,children:u.jsx(o2n,{teamName:e,onClose:()=>l(!1),sidebarVisible:d,onToggleSidebar:p,onSendMessage:O,onOpenTaskDetail:m,onOpenMemberProfile:_})})]})};function cee(e){return/^[A-Za-z]:[/\\]/.test(e)||e.startsWith("\\\\")||e.startsWith("//")}function l2n(e){return e.includes("\\")&&!e.includes("/")?"\\":"/"}function wwe(e,t){const n=l2n(e);return e.replace(/[/\\]$/,"")+n+t.replace(/[/\\]/g,n)}function XP(e,t,n=40){let r=e;if(t){const l=t.replace(/[/\\]$/,""),d=cee(r)||cee(l),p=d?r.toLowerCase():r,f=d?l.toLowerCase():l;(p.startsWith(f+"/")||p.startsWith(f+"\\"))&&(r=r.slice(l.length+1))}if(r=r.replace(/^\/Users\/[^/]+/,"~").replace(/^\/home\/[^/]+/,"~").replace(/^[A-Z]:\\Users\\[^\\]+/i,"~"),r.length<=n)return r;const s=r.includes("\\")?"\\":"/",i=r.split(s);let o=0;if((i[0]===""||i[0]==="~")&&(o=1),i.length-o<=3)return r;const a=i.slice(0,o+1).join(s),c=i.slice(-2).join(s);return`${a}${s}…${s}${c}`}function c2n(e){return(/^(\/Users\/[^/]+)/.exec(e)??/^(\/home\/[^/]+)/.exec(e)??/^([A-Z]:\\Users\\[^\\]+)/i.exec(e))?.[1]??null}function uee(e){const t=e.replace(/\\/g,"/");if(t.startsWith("/Users/")||t.startsWith("/home/")){const n=el(t);if(n.length>=2){const r=n.slice(2).join("/");return r?`~/${r}`:"~"}}if(u2n(e)){const n=el(t);if(n.length>=3){const r=n.slice(3).join("/");return r?`~/${r}`:"~"}}return t}function u2n(e){if(e.length<10)return!1;const t=e.charCodeAt(0);return(t>=65&&t<=90||t>=97&&t<=122)&&e[1]===":"&&e.slice(2,9).toLowerCase()==="\\users\\"}function Hj(e,t){let n=e;if((n.startsWith("~/")||n.startsWith("~\\"))&&t){const r=c2n(t);r&&(n=wwe(r,n.slice(2)))}return t&&!n.startsWith("/")&&!n.startsWith("~")&&!cee(n)&&(n=wwe(t,n)),n}const kwe=["anthropic","codex","gemini"];function d2n(e){return[...e].sort((t,n)=>kwe.indexOf(t)-kwe.indexOf(n))}function p2n(e,t){const n=e.associatedPaths.reduce((r,s)=>{const i=t.get(fr(s));return i?{pending:r.pending+i.pending,inProgress:r.inProgress+i.inProgress,completed:r.completed+i.completed}:r},{pending:0,inProgress:0,completed:0});return n.pending>0||n.inProgress>0||n.completed>0?n:void 0}function f2n(e,t){const n=new Set,r=[];for(const s of e.associatedPaths){const i=t.get(fr(s));if(i)for(const o of i)n.has(o.teamName)||(n.add(o.teamName),r.push(o))}return r.length>0?r:void 0}function h2n(e){const t=[e.primaryPath,...e.associatedPaths].filter(Boolean),n=Array.from(new Set(t));if(!(n.length<=1))return{badgeLabel:`${n.length} 个路径`,description:"此卡片合并了相关 worktree 和项目路径的最近活动。",paths:n.map((r,s)=>({label:s===0?"主路径":`相关路径 ${s}`,fullPath:r}))}}function m2n({projects:e,taskCountsByProject:t,activeTeamsByProject:n,tasksLoading:r}){return e.map(s=>({id:s.id,project:s,name:s.name,formattedPath:uee(s.primaryPath),lastActivityLabel:Ub(new Date(s.mostRecentActivity),{addSuffix:!0,locale:HXe}),providerIds:d2n(s.providerIds),primaryBranch:s.primaryBranch,taskCounts:p2n(s,t),tasksLoading:r,activeTeams:f2n(s,n),additionalPathCount:Math.max(0,s.associatedPaths.length-1),pathSummary:h2n(s)}))}function O2n({teams:e,aliveTeamNames:t,provisioningTeamNames:n,provisioningSnapshotByTeam:r}){const s=new Set([...t,...n]);if(s.size===0)return new Map;const i=new Set(e.map(l=>l.teamName)),o=n.filter(l=>!i.has(l)).map(l=>r[l]).filter(l=>!!l),a=new Map,c=o.length>0?[...e,...o]:e;for(const l of c){if(!l.projectPath||!s.has(l.teamName))continue;const d=fr(l.projectPath),p=a.get(d);p?p.push(l):a.set(d,[l])}return a}const nKe="tmp",g2n=`/${nKe}/`,_2n=`/private/${nKe}/`;function b2n(e){return e.trim().replace(/\\/g,"/").toLowerCase()}function y2n(e){const t=e.split("/").filter(Boolean);return t[t.length-1]??""}function x2n(e){return e.startsWith("/private/var/folders/")||e.startsWith("/var/folders/")||e.startsWith(_2n)||e.startsWith(g2n)||e.includes("/appdata/local/temp/")||e.includes("/appdata/locallow/temp/")}function Ul(e){const t=b2n(e??"");return t?t.includes("rendered_mcp_")||t.includes("rendered_mcp_config")||t.includes("/portable-mcp-live")?!0:y2n(t).startsWith("codex-agent-teams-appstyle-")&&x2n(t):!1}const rKe="recent-projects:open-history",dee="recent-projects:open-history-changed",S2n=1e3*60*60*48,v2n=120;function sKe(){return typeof window<"u"&&typeof window.localStorage<"u"}function iB(e){let t=e.trim().replace(/\\/g,"/");if(!t||Ul(t))return null;if(t!=="/"&&!/^[A-Za-z]:\/$/.test(t))for(;t.endsWith("/");)t=t.slice(0,-1);return t}function iKe(e){return e.toLowerCase()}function oKe(){if(!sKe())return{version:1,entries:[]};try{const e=window.localStorage.getItem(rKe);if(!e)return{version:1,entries:[]};const t=JSON.parse(e);return{version:1,entries:(Array.isArray(t.entries)?t.entries:[]).filter(r=>!!r&&typeof r.path=="string"&&typeof r.openedAt=="number"&&Number.isFinite(r.openedAt)).map(r=>({path:r.path,openedAt:r.openedAt}))}}catch{return{version:1,entries:[]}}}function T2n(e){const t=new Map;for(const n of e){const r=iB(n.path);r&&t.set(r,Math.max(t.get(r)??0,n.openedAt))}return Array.from(t.entries()).map(([n,r])=>({path:n,openedAt:r})).sort((n,r)=>r.openedAt-n.openedAt).slice(0,v2n)}function E2n(e){if(!sKe())return;const t={version:1,entries:T2n(e)};try{window.localStorage.setItem(rKe,JSON.stringify(t)),window.dispatchEvent(new CustomEvent(dee))}catch{}}function w2n(){const e=new Map,t=new Map;for(const n of oKe().entries){const r=iB(n.path);if(!r)continue;e.set(r,Math.max(e.get(r)??0,n.openedAt));const s=iKe(r),i=t.get(s);i?(i.openedAt=Math.max(i.openedAt,n.openedAt),i.exactPaths.add(r)):t.set(s,{openedAt:n.openedAt,exactPaths:new Set([r])})}return{exact:e,folded:t}}function k2n(e,t){const n=iB(t);if(!n)return 0;const r=e.exact.get(n);if(r!=null)return r;const s=e.folded.get(iKe(n));return s?.exactPaths.size!==1?0:s.openedAt}function Cwe(e,t){return[t.primaryPath,...t.associatedPaths].reduce((n,r)=>Math.max(n,k2n(e,r)),0)}function Zj(e,t=Date.now()){const n=Array.from(new Set(e.map(s=>iB(s)).filter(s=>!!s)));if(n.length===0)return;const r=oKe().entries;E2n([...r,...n.map(s=>({path:s,openedAt:t}))])}function C2n(e,t=Date.now()){const n=w2n(),r=s=>s>0&&t-s<=S2n;return[...e].sort((s,i)=>{const o=Cwe(n,s),a=Cwe(n,i),c=r(o),l=r(a);return c!==l?c?-1:1:c&&l&&o!==a?a-o:s.mostRecentActivity!==i.mostRecentActivity?i.mostRecentActivity-s.mostRecentActivity:o!==a?a-o:s.name.localeCompare(i.name)})}function R2n(e){if(typeof window>"u")return()=>{};const t=()=>e();return window.addEventListener(dee,t),()=>{window.removeEventListener(dee,t)}}function aKe(e){return e?Array.isArray(e)?{projects:e,degraded:!1}:Array.isArray(e.projects)?{projects:e.projects,degraded:e.degraded===!0}:null:null}const P2n=15e3,$2n=3e4;let M2=null,pee=0,_w=null;function Q2(){const e=aKe(M2);if(!e)return null;M2!==e&&(M2=e);const t=e.degraded?$2n:P2n;return{payload:e,fetchedAt:pee,isStale:Date.now()-pee>t}}async function N2n(e,t){const n=t?.force??!1,r=Q2();if(!n&&r&&!r.isStale)return r.payload;if(_w)return _w;const s=e().then(i=>{const o=aKe(i);return M2=o,pee=Date.now(),o??{projects:[],degraded:!0}}).finally(()=>{_w===s&&(_w=null)});return _w=s,s}function Rwe(e,t){const n=new Set(t.map(r=>fr(r)));for(const r of e)for(const s of r.worktrees)if(n.has(fr(s.path)))return{repoId:r.id,worktreeId:s.id};return null}function lKe(e){if(!e)return"";const t=e.replace(/[/\\]/g,"-"),n=/^([a-zA-Z]):-(.*)$/.exec(t);return n?`${n[1].toUpperCase()}--${n[2]}`:t.startsWith("-")?t:`-${t}`}function A2n(e){const t=lKe(e),n=e.split(/[/\\]/).filter(Boolean).pop()??e,r=Date.now();return{id:t,identity:null,worktrees:[{id:t,path:e,name:n,isMainWorktree:!0,source:"unknown",sessions:[],totalSessions:0,createdAt:r}],name:n,mostRecentSession:void 0,totalSessions:0}}const bw=Hi("Feature:RecentProjects:open");function I2n(){const{repositoryGroups:e,fetchRepositoryGroups:t,openTeamsTab:n}=le(Et(l=>({repositoryGroups:l.repositoryGroups,fetchRepositoryGroups:l.fetchRepositoryGroups,openTeamsTab:l.openTeamsTab}))),r=g.useCallback(l=>{le.setState(kU(l.repoId,l.worktreeId)),le.getState().fetchSessionsInitial(l.worktreeId),n()},[n]),s=g.useCallback(async(l,d)=>{const f=(d.length>0?d:[l]).filter(b=>!Ul(b));if(f.length===0){bw.warn("Skipped ephemeral recent project path",{path:l});return}const h=Rwe(e,f);if(h){r(h);return}await t();const m=le.getState().repositoryGroups,O=Rwe(m,f);if(O){r(O);return}if(Ul(l)){bw.warn("Skipped adding ephemeral recent project path",{path:l});return}await K.config.addCustomProjectPath(l),le.setState(b=>({repositoryGroups:[A2n(l),...b.repositoryGroups]}));const _=lKe(l);r({repoId:_,worktreeId:_})},[t,r,e]),i=g.useCallback(async(l,d)=>{if(l.type==="existing-worktree"){r({repoId:l.repositoryId,worktreeId:l.worktreeId});return}await s(l.path,d)},[r,s]),o=g.useCallback(async l=>{try{await i(l.openTarget,l.associatedPaths),Zj([l.primaryPath,...l.associatedPaths])}catch(d){bw.error("Failed to open recent project",d)}},[i]),a=g.useCallback(async l=>{try{await K.openPath(l,l)}catch(d){bw.error("Failed to open project path",d)}},[]),c=g.useCallback(async()=>{try{const d=(await K.config.selectFolders())[0];if(!d)return;await s(d,[d]),Zj([d])}catch(l){bw.error("Failed to select project folder",l)}},[s]);return{openRecentProject:o,openProjectPath:a,selectProjectFolder:c}}const M2n=11,Q2n=8,D2n=3e4,L2n=12e4,j2n=3,X2n=8e3;function U2n(e){return new Promise((t,n)=>{const r=window.setTimeout(()=>{n(new Error("最近项目加载超时,请稍后重试。"))},X2n);e.then(s=>{window.clearTimeout(r),t(s)},s=>{window.clearTimeout(r),n(s)})})}function z2n(e,t){if(!t)return!0;const n=t.trim().toLowerCase();return n?e.name.toLowerCase().includes(n)||e.primaryPath.toLowerCase().includes(n)||e.associatedPaths.some(r=>r.toLowerCase().includes(n))||e.primaryBranch?.toLowerCase().includes(n)===!0:!0}function B2n(e,t=M2n){const{globalTasks:n,globalTasksInitialized:r,globalTasksLoading:s,fetchAllTasks:i,teams:o,provisioningRuns:a,currentProvisioningRunIdByTeam:c,provisioningSnapshotByTeam:l}=le(Et(Y=>({globalTasks:Y.globalTasks,globalTasksInitialized:Y.globalTasksInitialized,globalTasksLoading:Y.globalTasksLoading,fetchAllTasks:Y.fetchAllTasks,teams:Y.teams,provisioningRuns:Y.provisioningRuns,currentProvisioningRunIdByTeam:Y.currentProvisioningRunIdByTeam,provisioningSnapshotByTeam:Y.provisioningSnapshotByTeam}))),d=g.useMemo(()=>Q2(),[]),{openRecentProject:p,openProjectPath:f,selectProjectFolder:h}=I2n(),[m,O]=g.useState(d?.payload.projects??[]),[_,b]=g.useState(d?.payload.degraded??!1),[y,x]=g.useState(d?.payload.degraded?1:0),[S,v]=g.useState(d==null),[T,E]=g.useState(null),[w,P]=g.useState(t),[k,C]=g.useState([]),[M,I]=g.useState(0),$=g.useRef(r),R=g.useRef(d?.payload.projects??[]),N=g.useMemo(()=>({currentProvisioningRunIdByTeam:c,provisioningRuns:a}),[c,a]),j=g.useMemo(()=>Object.keys(c).filter(Y=>My(N,Y)),[c,N]),Q=g.useMemo(()=>[...j].sort().join("\0"),[j]);g.useEffect(()=>{R.current=m},[m]);const U=g.useCallback(async Y=>{R.current.length>0||Q2()!=null||v(!0),E(null);try{const te=await U2n(N2n(()=>K.getDashboardRecentProjects(),Y));O(te.projects),b(te.degraded),x(G=>te.degraded?G+1:0)}catch(te){E(te instanceof Error?te.message:"最近项目加载失败")}finally{v(!1)}},[]);g.useEffect(()=>{const Y=Q2();Y&&!Y.isStale||U({force:Y!=null})},[U]),g.useEffect(()=>{if(!_)return;const Y=y<=j2n?D2n:L2n,ne=window.setTimeout(()=>{U({force:!0})},Y);return()=>{window.clearTimeout(ne)}},[y,_,U]),g.useEffect(()=>{if(m.length===0||$.current||r){$.current=$.current||r;return}$.current=!0,i()},[i,r,m.length]),g.useEffect(()=>{let Y=!1;return K.teams.aliveList().then(ne=>{Y||C(ne)}).catch(()=>{}),()=>{Y=!0}},[Q,o]),g.useEffect(()=>{e.trim()||P(t)},[t,e]),g.useEffect(()=>R2n(()=>I(Y=>Y+1)),[]);const A=g.useMemo(()=>Wxt(n),[n]),V=g.useMemo(()=>O2n({teams:o,aliveTeamNames:k,provisioningTeamNames:j,provisioningSnapshotByTeam:l}),[k,l,j,o]),z=g.useMemo(()=>m2n({projects:C2n(m),taskCountsByProject:A,activeTeamsByProject:V,tasksLoading:s}),[V,s,M,m,A]),L=g.useMemo(()=>z.filter(Y=>z2n(Y.project,e)),[z,e]);return{cards:g.useMemo(()=>e.trim()?L:L.slice(0,w),[L,e,w]),loading:S,error:T,canLoadMore:!e.trim()&&L.length>w,isElectron:!1,loadMore:()=>P(Y=>Y+Q2n),reload:U,openRecentProject:p,openProjectPath:f,selectProjectFolder:h}}const F2n=({card:e,onClick:t,onOpenPath:n})=>{const r=g.useMemo(()=>q9t(e.name),[e.name]),[s,i]=g.useState(!1);return u.jsxs("button",{onClick:t,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),className:"bg-surface/50 group relative flex min-h-[120px] flex-col overflow-hidden rounded-lg border border-l-[3px] border-border p-4 text-left transition-all duration-300 hover:border-border-emphasis hover:bg-surface-raised",style:{borderLeftColor:r.border,boxShadow:s?`inset 3px 0 12px -4px ${r.glow}`:void 0},children:[e.activeTeams&&e.activeTeams.length>0&&u.jsxs("span",{className:"absolute right-3 top-3 inline-flex size-2.5",children:[u.jsx("span",{className:"absolute inline-flex size-full animate-ping rounded-full bg-emerald-400 opacity-50"}),u.jsx("span",{className:"relative inline-flex size-2.5 rounded-full bg-emerald-500"})]}),u.jsxs("div",{className:"mb-1 flex items-center gap-2.5",children:[u.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-md border border-border bg-surface-overlay transition-colors duration-300 group-hover:border-border-emphasis",children:u.jsx(zv,{className:"size-4 transition-colors group-hover:text-text",style:{color:r.icon}})}),u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx("h3",{className:"min-w-0 truncate text-sm font-medium text-text transition-colors duration-200 group-hover:text-text",children:e.name}),e.pathSummary&&u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx("span",{className:"inline-flex shrink-0 items-center rounded-full bg-surface-overlay px-1.5 py-0.5 text-[9px] font-medium text-text-muted",children:e.pathSummary.badgeLabel})}),u.jsx(nt,{side:"bottom",align:"start",className:"max-w-sm",children:u.jsxs("div",{className:"space-y-2",children:[u.jsx("p",{className:"text-[11px] leading-relaxed text-text-secondary",children:e.pathSummary.description}),u.jsx("div",{className:"space-y-1.5",children:e.pathSummary.paths.map(o=>u.jsxs("div",{className:"space-y-0.5",children:[u.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-text-muted",children:o.label}),u.jsx("p",{className:"font-mono text-[11px] text-text",children:o.fullPath})]},`${o.label}:${o.fullPath}`))})]})})]})]}),u.jsx("div",{className:"mt-1 flex items-center gap-1.5",children:e.providerIds.map(o=>u.jsx("span",{className:"bg-surface-overlay/80 inline-flex items-center rounded-full border border-border p-1",title:o,children:u.jsx(kE,{providerId:o,className:"size-3.5"})},o))})]})]}),u.jsxs("div",{className:"flex w-full min-w-0 items-center gap-1 font-mono text-[10px] text-text-muted",children:[u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx("div",{role:"button",tabIndex:0,onClick:o=>{o.stopPropagation(),n()},onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),o.stopPropagation(),n())},className:"shrink-0 cursor-pointer rounded p-0.5 transition-colors hover:bg-white/5 hover:text-text-secondary",children:u.jsx(Bc,{className:"size-3"})})}),u.jsx(nt,{side:"bottom",children:"打开"})]}),u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx("span",{className:"truncate",children:e.formattedPath})}),u.jsx(nt,{side:"bottom",align:"start",children:u.jsx("p",{className:"font-mono text-[11px]",children:e.project.primaryPath})})]})]}),e.primaryBranch?u.jsxs("div",{className:"mb-auto mt-1 flex items-center gap-1.5 truncate",children:[u.jsx(b$,{className:"size-3 shrink-0 text-text-muted"}),u.jsx("span",{className:"truncate text-[10px] text-text-secondary",children:e.primaryBranch})]}):u.jsx("div",{className:"mb-auto"}),u.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[e.taskCounts&&(e.taskCounts.pending>0||e.taskCounts.inProgress>0||e.taskCounts.completed>0)&&u.jsxs(u.Fragment,{children:[e.taskCounts.inProgress>0&&u.jsxs("span",{className:"inline-flex items-center rounded-full bg-blue-500/15 px-1.5 py-0.5 text-[10px] font-medium text-blue-600 dark:text-blue-400",children:["进行中 ",e.taskCounts.inProgress]}),e.taskCounts.pending>0&&u.jsxs("span",{className:"inline-flex items-center rounded-full bg-yellow-500/15 px-1.5 py-0.5 text-[10px] font-medium text-yellow-400",children:["待处理 ",e.taskCounts.pending]}),e.taskCounts.completed>0&&u.jsxs("span",{className:"inline-flex items-center rounded-full bg-green-500/15 px-1.5 py-0.5 text-[10px] font-medium text-green-400",children:["已完成 ",e.taskCounts.completed]}),u.jsx("span",{className:"text-text-muted",children:"·"})]}),u.jsx("span",{className:"text-[10px] text-text-muted",children:e.lastActivityLabel})]}),e.tasksLoading?u.jsx("div",{className:"mt-2 w-full",children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("div",{className:"h-1.5 flex-1 animate-pulse overflow-hidden rounded-full bg-[var(--color-surface-raised)]"}),u.jsx("div",{className:"h-2.5 w-6 animate-pulse rounded bg-[var(--color-surface-raised)]"})]})}):e.taskCounts&&(()=>{const o=e.taskCounts.pending??0,a=e.taskCounts.inProgress??0,c=e.taskCounts.completed??0,l=o+a+c;if(l===0)return null;const d=Math.round(c/l*100);return u.jsx("div",{className:"mt-2 w-full space-y-1",children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("div",{className:"h-1.5 flex-1 overflow-hidden rounded-full bg-[var(--color-surface-raised)]",role:"progressbar","aria-valuenow":c,"aria-valuemin":0,"aria-valuemax":l,"aria-label":`任务完成 ${c}/${l}`,children:u.jsx("div",{className:"h-full rounded-full bg-emerald-500 transition-all duration-200",style:{width:`${d}%`}})}),u.jsxs("span",{className:"shrink-0 text-[10px] font-medium tracking-tight text-[var(--color-text-muted)]",children:[c,"/",l]})]})})})(),e.activeTeams&&e.activeTeams.length>0&&u.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 border-t border-border pt-2",children:[u.jsx(Io,{className:"size-3 shrink-0 text-emerald-400"}),e.activeTeams.map(o=>u.jsx("span",{className:"inline-flex items-center rounded-full bg-emerald-500/10 px-1.5 py-0.5 text-[9px] font-medium text-emerald-400",children:o.displayName},o.teamName))]})]})},Y2n=[60,66,50,55,75,45,40,65],V2n=[80,75,85,66,70,80,60,72],q2n=({searchQuery:e})=>{const{cards:t,loading:n,error:r,canLoadMore:s,isElectron:i,loadMore:o,reload:a,openRecentProject:c,openProjectPath:l}=B2n(e);return n?u.jsx("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-3 xl:grid-cols-4",children:Array.from({length:8}).map((d,p)=>u.jsxs("div",{className:"skeleton-card flex min-h-[120px] flex-col rounded-sm border border-border p-4",style:{animationDelay:`${p*80}ms`,backgroundColor:"var(--skeleton-base)"},children:[u.jsx("div",{className:"mb-3 size-8 rounded-sm",style:{backgroundColor:"var(--skeleton-base-light)"}}),u.jsx("div",{className:"mb-2 h-3.5 rounded-sm",style:{width:`${Y2n[p]}%`,backgroundColor:"var(--skeleton-base-light)"}}),u.jsx("div",{className:"mb-auto h-2.5 rounded-sm",style:{width:`${V2n[p]}%`,backgroundColor:"var(--skeleton-base-dim)"}}),u.jsxs("div",{className:"mt-3 flex gap-2",children:[u.jsx("div",{className:"h-2.5 w-16 rounded-sm",style:{backgroundColor:"var(--skeleton-base-dim)"}}),u.jsx("div",{className:"h-2.5 w-12 rounded-sm",style:{backgroundColor:"var(--skeleton-base-dim)"}})]})]},p))}):r&&t.length===0?u.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 rounded-sm border border-dashed border-border px-8 py-16",children:[u.jsx("div",{className:"mb-1 flex size-12 items-center justify-center rounded-sm border border-border bg-surface-raised",children:u.jsx(zv,{className:"size-6 text-text-muted"})}),u.jsxs("div",{className:"text-center",children:[u.jsx("p",{className:"mb-1 text-sm text-text-secondary",children:"项目加载失败"}),u.jsx("p",{className:"max-w-xl text-xs text-text-muted",children:r})]}),u.jsx("button",{onClick:()=>void a(),className:"rounded-sm border border-border bg-surface-raised px-3 py-1.5 text-xs text-text-secondary transition-colors hover:border-border-emphasis hover:text-text",children:"重试"})]}):t.length===0&&e.trim()?u.jsxs("div",{className:"flex flex-col items-center justify-center rounded-sm border border-dashed border-border px-8 py-16",children:[u.jsx("div",{className:"mb-4 flex size-12 items-center justify-center rounded-sm border border-border bg-surface-raised",children:u.jsx($i,{className:"size-6 text-text-muted"})}),u.jsx("p",{className:"mb-1 text-sm text-text-secondary",children:"未找到项目"}),u.jsxs("p",{className:"text-xs text-text-muted",children:["没有匹配“",e,"”的结果"]})]}):t.length===0?u.jsxs("div",{className:"flex flex-col items-center justify-center rounded-sm border border-dashed border-border px-8 py-16",children:[u.jsx("div",{className:"mb-4 flex size-12 items-center justify-center rounded-sm border border-border bg-surface-raised",children:u.jsx(zv,{className:"size-6 text-text-muted"})}),u.jsx("p",{className:"mb-1 text-sm text-text-secondary",children:"暂无最近项目"}),u.jsx("p",{className:"text-xs text-text-muted",children:"最近的 Claude 和 Codex 活动会显示在这里。"})]}):u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-3 xl:grid-cols-4",children:[!e.trim()&&i,t.map(d=>u.jsx(F2n,{card:d,onClick:()=>void c(d.project),onOpenPath:()=>void l(d.project.primaryPath)},d.id))]}),s&&u.jsx("div",{className:"flex justify-center",children:u.jsx(Xe,{variant:"outline",size:"sm",onClick:o,children:"加载更多"})})]})},Ble=typeof window<"u"&&window.navigator.userAgent.includes("Macintosh"),o8=Ble?"⌘":"Ctrl+",Pwe=Ble?"⇧":"Shift+";function Ig(e,t){return t?.shift?Ble?`${Pwe}${o8}${e}`:`${o8}${Pwe}${e}`:`${o8}${e}`}const W2n=["Claude Code","Cursor","Codex","Gemini","OpenCode","DeepSeek / IM"],G2n=["Feishu","Slack","Discord","DingTalk","WeCom","Telegram","Webhook / API"],H2n=({value:e,onChange:t})=>{const[n,r]=g.useState(!1),s=g.useRef(null),{openCommandPalette:i,selectedProjectId:o}=le(Et(a=>({openCommandPalette:a.openCommandPalette,selectedProjectId:a.selectedProjectId})));return g.useEffect(()=>{const a=c=>{(c.metaKey||c.ctrlKey)&&c.code==="KeyK"&&(c.preventDefault(),i())};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[i]),g.useLayoutEffect(()=>{const a=s.current;if(!a)return;a.focus({preventScroll:!0});const c=window.setTimeout(()=>{document.activeElement!==a&&a.focus({preventScroll:!0})},50);return()=>window.clearTimeout(c)},[]),u.jsx("div",{className:"relative w-full",children:u.jsxs("div",{className:`relative flex items-center gap-3 rounded-sm border bg-surface-raised px-4 py-3 transition-all duration-200 ${n?"border-zinc-500 shadow-[0_0_20px_rgba(255,255,255,0.04)] ring-1 ring-zinc-600/30":"border-border hover:border-zinc-600"} `,children:[u.jsx($i,{className:"size-4 shrink-0 text-text-muted"}),u.jsx("input",{ref:s,type:"text",value:e,onChange:a=>t(a.target.value),placeholder:"搜索项目...",className:"flex-1 bg-transparent text-sm text-text outline-none placeholder:text-text-muted",onFocus:()=>r(!0),onBlur:()=>r(!1)}),u.jsxs("button",{onClick:()=>i(),className:"flex shrink-0 items-center gap-1 transition-opacity hover:opacity-80",title:o?`搜索会话(${Ig("K")})`:`搜索项目(${Ig("K")})`,children:[u.jsx("kbd",{className:"flex h-5 items-center justify-center rounded border border-border bg-surface-overlay px-1.5 text-[10px] font-medium text-text-muted",children:u.jsx(N0,{className:"size-2.5"})}),u.jsx("kbd",{className:"flex size-5 items-center justify-center rounded border border-border bg-surface-overlay text-[10px] font-medium text-text-muted",children:"K"})]})]})})},Z2n=()=>{const[e,t]=g.useState(""),{openTeamsTab:n,openSettingsTab:r,teams:s,teamsLoading:i}=le(Et(a=>({openTeamsTab:a.openTeamsTab,openSettingsTab:a.openSettingsTab,teams:a.teams,teamsLoading:a.teamsLoading}))),o=e.trim().length===0&&!i&&s.length===0;return u.jsxs("div",{className:"relative flex-1 overflow-auto bg-surface",children:[u.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 h-[600px] bg-[radial-gradient(ellipse_80%_50%_at_50%_-20%,rgba(99,102,241,0.08),transparent)]","aria-hidden":"true"}),u.jsxs("div",{className:"relative mx-auto max-w-5xl px-8 py-12",children:[u.jsxs("section",{className:"mb-8 overflow-hidden rounded-xl border border-border bg-surface-raised",children:[u.jsxs("div",{className:"border-b border-border px-6 py-5",children:[u.jsxs("div",{className:"mb-2 inline-flex items-center gap-2 rounded-full border border-border bg-surface px-3 py-1 text-[11px] text-text-muted",children:[u.jsx(Qht,{className:"size-3.5"}),"一人公司优先"]}),u.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-text",children:"Hermit:一人公司的 AI 团队控制台"}),u.jsx("p",{className:"mt-2 text-sm text-text-secondary",children:"几乎覆盖所有主流 Harness,支持全渠道接入,把团队编排、消息协作、任务推进和运行状态放在同一个工作台。"})]}),u.jsxs("div",{className:"grid gap-4 px-6 py-5 md:grid-cols-3",children:[u.jsxs("div",{className:"rounded-lg border border-border bg-surface px-4 py-3",children:[u.jsxs("div",{className:"mb-2 inline-flex items-center gap-1.5 text-xs font-medium text-text-secondary",children:[u.jsx(imt,{className:"size-3.5"}),"Harness 覆盖"]}),u.jsx("p",{className:"text-xs text-text-muted",children:"几乎所有主流运行时都能接入统一团队控制台。"}),u.jsx("div",{className:"mt-3 flex flex-wrap gap-1.5",children:W2n.map(a=>u.jsx("span",{className:"rounded-md border border-border bg-surface-overlay px-2 py-1 text-[11px] text-text-secondary",children:a},a))})]}),u.jsxs("div",{className:"rounded-lg border border-border bg-surface px-4 py-3",children:[u.jsxs("div",{className:"mb-2 inline-flex items-center gap-1.5 text-xs font-medium text-text-secondary",children:[u.jsx(YIe,{className:"size-3.5"}),"渠道接入"]}),u.jsx("p",{className:"text-xs text-text-muted",children:"统一托管企业 IM、社区渠道和 Webhook/API,消息流和任务流自动对齐。"}),u.jsx("div",{className:"mt-3 flex flex-wrap gap-1.5",children:G2n.map(a=>u.jsx("span",{className:"rounded-md border border-border bg-surface-overlay px-2 py-1 text-[11px] text-text-secondary",children:a},a))})]}),u.jsxs("div",{className:"rounded-lg border border-border bg-surface px-4 py-3",children:[u.jsxs("div",{className:"mb-2 inline-flex items-center gap-1.5 text-xs font-medium text-text-secondary",children:[u.jsx(rc,{className:"size-3.5"}),"一人公司工作流"]}),u.jsx("p",{className:"text-xs text-text-muted",children:"你负责决策,Hermit 负责动态拉起子 agent、分发任务、跟踪执行和回收结果。"}),u.jsx("div",{className:"mt-3 rounded-md border border-border bg-surface-overlay px-2.5 py-2 text-[11px] text-text-muted",children:"需求输入 → 任务拆解 → 动态执行 → 结果汇总"})]})]})]}),u.jsxs("div",{className:"mb-12 flex items-center justify-center gap-3",children:[u.jsxs("button",{onClick:n,className:"flex shrink-0 items-center gap-2 rounded-sm border border-border bg-surface-raised px-4 py-3 text-sm text-text-secondary transition-all duration-200 hover:border-zinc-500 hover:text-text",children:[u.jsx(rc,{className:"size-4"}),"选择团队"]}),u.jsx("span",{className:"shrink-0 text-xs text-text-muted",children:"或"}),u.jsx("div",{className:"flex-1",children:u.jsx(H2n,{value:e,onChange:t})})]}),o?u.jsxs("section",{className:"rounded-xl border border-border bg-surface-raised p-5",children:[u.jsx("h2",{className:"text-sm font-semibold text-text",children:"快速开始(3 步)"}),u.jsx("p",{className:"mt-1 text-xs text-text-muted",children:"首次使用会看到空白首页。按下面步骤配置后,就会出现团队和项目内容。"}),u.jsxs("div",{className:"mt-4 grid gap-3 md:grid-cols-3",children:[u.jsxs("button",{type:"button",onClick:()=>r("harness"),className:"rounded-lg border border-border bg-surface px-3 py-3 text-left transition-colors hover:bg-surface-overlay",children:[u.jsx("p",{className:"text-[11px] font-medium text-text-muted",children:"第 1 步"}),u.jsx("p",{className:"mt-1 text-sm font-medium text-text",children:"配置 Harness"}),u.jsx("p",{className:"mt-1 text-xs text-text-muted",children:"连接 Claude/Codex/Gemini 等运行时"})]}),u.jsxs("button",{type:"button",onClick:()=>r("channels"),className:"rounded-lg border border-border bg-surface px-3 py-3 text-left transition-colors hover:bg-surface-overlay",children:[u.jsx("p",{className:"text-[11px] font-medium text-text-muted",children:"第 2 步"}),u.jsx("p",{className:"mt-1 text-sm font-medium text-text",children:"配置渠道"}),u.jsx("p",{className:"mt-1 text-xs text-text-muted",children:"接入飞书/Slack/Telegram/Webhook"})]}),u.jsxs("button",{type:"button",onClick:n,className:"rounded-lg border border-border bg-surface px-3 py-3 text-left transition-colors hover:bg-surface-overlay",children:[u.jsx("p",{className:"text-[11px] font-medium text-text-muted",children:"第 3 步"}),u.jsx("p",{className:"mt-1 text-sm font-medium text-text",children:"创建团队并启动"}),u.jsx("p",{className:"mt-1 text-xs text-text-muted",children:"设置工作目录后即可开始分发任务"})]})]})]}):u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[u.jsx("h2",{className:"text-xs font-medium uppercase tracking-wider text-text-muted",children:e.trim()?"搜索结果":"最近项目"}),e.trim()&&u.jsx("button",{onClick:()=>t(""),className:"text-xs text-text-muted transition-colors hover:text-text-secondary",children:"清除搜索"})]}),u.jsx(q2n,{searchQuery:e})]})]})]})},$we={search:"",categories:[],capabilities:[],installedOnly:!1};function K2n(){const[e,t]=g.useState("mcp-servers"),[n,r]=g.useState($we),[s,i]=g.useState({field:"popularity",order:"desc"}),[o,a]=g.useState(null),[c,l]=g.useState(""),[d,p]=g.useState([]),[f,h]=g.useState(!1),[m,O]=g.useState([]),[_,b]=g.useState(null),[y,x]=g.useState(""),[S]=g.useState(!1),[v,T]=g.useState("name-asc"),[E,w]=g.useState(null),P=g.useRef(null),k=g.useRef(0);g.useEffect(()=>()=>{P.current&&clearTimeout(P.current),k.current+=1},[]),g.useEffect(()=>{e!=="plugins"&&o!==null&&a(null),e!=="mcp-servers"&&_!==null&&b(null),e!=="skills"&&E!==null&&w(null)},[e,_,o,E]);const C=g.useCallback(Q=>{l(Q);const U=++k.current;if(P.current&&clearTimeout(P.current),!Q.trim()){p([]),O([]),h(!1);return}h(!0),P.current=setTimeout(()=>{if(!K.mcpRegistry){k.current===U&&h(!1);return}K.mcpRegistry.search(Q).then(A=>{k.current===U&&(p(A.servers),O(A.warnings),h(!1))},()=>{k.current===U&&(h(!1),O(["Search failed"]))})},300)},[]),M=g.useCallback(Q=>{r(U=>({...U,search:Q}))},[]),I=g.useCallback(Q=>{r(U=>({...U,categories:U.categories.includes(Q)?U.categories.filter(A=>A!==Q):[...U.categories,Q]}))},[]),$=g.useCallback(Q=>{r(U=>({...U,capabilities:U.capabilities.includes(Q)?U.capabilities.filter(A=>A!==Q):[...U.capabilities,Q]}))},[]),R=g.useCallback(()=>{r(Q=>({...Q,installedOnly:!Q.installedOnly}))},[]),N=g.useCallback(()=>{r($we)},[]),j=g.useMemo(()=>n.search!==""||n.categories.length>0||n.capabilities.length>0||n.installedOnly,[n]);return{activeSubTab:e,setActiveSubTab:t,pluginFilters:n,pluginSort:s,setPluginSort:i,selectedPluginId:o,setSelectedPluginId:a,updatePluginSearch:M,toggleCategory:I,toggleCapability:$,toggleInstalledOnly:R,clearFilters:N,hasActiveFilters:j,mcpSearchQuery:c,mcpSearch:C,mcpSearchResults:d,mcpSearchLoading:f,mcpSearchWarnings:m,selectedMcpServerId:_,setSelectedMcpServerId:b,skillsSearchQuery:y,setSkillsSearchQuery:x,skillsInstalledOnly:S,skillsSort:v,setSkillsSort:T,selectedSkillId:E,setSelectedSkillId:w}}function J2n(e){return Use(e)}function eDn(e){return e?.flavor==="agent_teams_orchestrator"}function tDn(e){switch(e){case"supported":return"支持";case"read-only":return"只读";default:return"不支持"}}function nDn(e,t,n){if(!e)return null;const r=t.find(s=>s.path===e);if(r)return r.id;for(const s of n){const i=s.worktrees.find(o=>o.path===e);if(i)return i.id}return null}function cKe(e,t,n){if(!e)return null;const r=t.find(s=>s.id===e);if(r)return{path:r.path,name:r.name};for(const s of n){const i=s.worktrees.find(o=>o.id===e);if(i)return{path:i.path,name:i.name}}return null}const Nwe="Agent CLI";function Fle(e,t=!1){return e?.flavor==="agent_teams_orchestrator"?!e.displayName||e.displayName==="agent_teams_orchestrator"?Nwe:e.displayName:e?.displayName?e.displayName:t?Nwe:"Agent CLI"}function Awe(e,[t,n]){return Math.min(n,Math.max(t,e))}var rDn=[" ","Enter","ArrowUp","ArrowDown"],sDn=[" ","Enter"],fy="Select",[oB,aB,iDn]=mWe(fy),[YE]=sp(fy,[iDn,f_]),lB=f_(),[oDn,P_]=YE(fy),[aDn,lDn]=YE(fy),uKe=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:i,value:o,defaultValue:a,onValueChange:c,dir:l,name:d,autoComplete:p,disabled:f,required:h,form:m}=e,O=lB(t),[_,b]=g.useState(null),[y,x]=g.useState(null),[S,v]=g.useState(!1),T=qoe(l),[E,w]=fm({prop:r,defaultProp:s??!1,onChange:i,caller:fy}),[P,k]=fm({prop:o,defaultProp:a,onChange:c,caller:fy}),C=g.useRef(null),M=_?m||!!_.closest("form"):!0,[I,$]=g.useState(new Set),R=Array.from(I).map(N=>N.props.value).join(";");return u.jsx(tU,{...O,children:u.jsxs(oDn,{required:h,scope:t,trigger:_,onTriggerChange:b,valueNode:y,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:v,contentId:ka(),value:P,onValueChange:k,open:E,onOpenChange:w,dir:T,triggerPointerDownPosRef:C,disabled:f,children:[u.jsx(oB.Provider,{scope:t,children:u.jsx(aDn,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback(N=>{$(j=>new Set(j).add(N))},[]),onNativeOptionRemove:g.useCallback(N=>{$(j=>{const Q=new Set(j);return Q.delete(N),Q})},[]),children:n})}),M?u.jsxs(IKe,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:p,value:P,onChange:N=>k(N.target.value),disabled:f,form:m,children:[P===void 0?u.jsx("option",{value:""}):null,Array.from(I)]},R):null]})})};uKe.displayName=fy;var dKe="SelectTrigger",pKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,i=lB(n),o=P_(dKe,n),a=o.disabled||r,c=ts(t,o.onTriggerChange),l=aB(n),d=g.useRef("touch"),[p,f,h]=QKe(O=>{const _=l().filter(x=>!x.disabled),b=_.find(x=>x.value===o.value),y=DKe(_,O,b);y!==void 0&&o.onValueChange(y.value)}),m=O=>{a||(o.onOpenChange(!0),h()),O&&(o.triggerPointerDownPosRef.current={x:Math.round(O.pageX),y:Math.round(O.pageY)})};return u.jsx(O$,{asChild:!0,...i,children:u.jsx(Or.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":MKe(o.value)?"":void 0,...s,ref:c,onClick:xn(s.onClick,O=>{O.currentTarget.focus(),d.current!=="mouse"&&m(O)}),onPointerDown:xn(s.onPointerDown,O=>{d.current=O.pointerType;const _=O.target;_.hasPointerCapture(O.pointerId)&&_.releasePointerCapture(O.pointerId),O.button===0&&O.ctrlKey===!1&&O.pointerType==="mouse"&&(m(O),O.preventDefault())}),onKeyDown:xn(s.onKeyDown,O=>{const _=p.current!=="";!(O.ctrlKey||O.altKey||O.metaKey)&&O.key.length===1&&f(O.key),!(_&&O.key===" ")&&rDn.includes(O.key)&&(m(),O.preventDefault())})})})});pKe.displayName=dKe;var fKe="SelectValue",hKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:i,placeholder:o="",...a}=e,c=P_(fKe,n),{onValueNodeHasChildrenChange:l}=c,d=i!==void 0,p=ts(t,c.onValueNodeChange);return Aa(()=>{l(d)},[l,d]),u.jsx(Or.span,{...a,ref:p,style:{pointerEvents:"none"},children:MKe(c.value)?u.jsx(u.Fragment,{children:o}):i})});hKe.displayName=fKe;var cDn="SelectIcon",mKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return u.jsx(Or.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});mKe.displayName=cDn;var uDn="SelectPortal",OKe=e=>u.jsx(lE,{asChild:!0,...e});OKe.displayName=uDn;var hy="SelectContent",gKe=g.forwardRef((e,t)=>{const n=P_(hy,e.__scopeSelect),[r,s]=g.useState();if(Aa(()=>{s(new DocumentFragment)},[]),!n.open){const i=r;return i?xi.createPortal(u.jsx(_Ke,{scope:e.__scopeSelect,children:u.jsx(oB.Slot,{scope:e.__scopeSelect,children:u.jsx("div",{children:e.children})})}),i):null}return u.jsx(bKe,{...e,ref:t})});gKe.displayName=hy;var Od=10,[_Ke,$_]=YE(hy),dDn="SelectContentImpl",pDn=Qv("SelectContent.RemoveScroll"),bKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:o,side:a,sideOffset:c,align:l,alignOffset:d,arrowPadding:p,collisionBoundary:f,collisionPadding:h,sticky:m,hideWhenDetached:O,avoidCollisions:_,...b}=e,y=P_(hy,n),[x,S]=g.useState(null),[v,T]=g.useState(null),E=ts(t,te=>S(te)),[w,P]=g.useState(null),[k,C]=g.useState(null),M=aB(n),[I,$]=g.useState(!1),R=g.useRef(!1);g.useEffect(()=>{if(x)return rae(x)},[x]),nae();const N=g.useCallback(te=>{const[G,...Z]=M().map(se=>se.ref.current),[oe]=Z.slice(-1),re=document.activeElement;for(const se of te)if(se===re||(se?.scrollIntoView({block:"nearest"}),se===G&&v&&(v.scrollTop=0),se===oe&&v&&(v.scrollTop=v.scrollHeight),se?.focus(),document.activeElement!==re))return},[M,v]),j=g.useCallback(()=>N([w,x]),[N,w,x]);g.useEffect(()=>{I&&j()},[I,j]);const{onOpenChange:Q,triggerPointerDownPosRef:U}=y;g.useEffect(()=>{if(x){let te={x:0,y:0};const G=oe=>{te={x:Math.abs(Math.round(oe.pageX)-(U.current?.x??0)),y:Math.abs(Math.round(oe.pageY)-(U.current?.y??0))}},Z=oe=>{te.x<=10&&te.y<=10?oe.preventDefault():x.contains(oe.target)||Q(!1),document.removeEventListener("pointermove",G),U.current=null};return U.current!==null&&(document.addEventListener("pointermove",G),document.addEventListener("pointerup",Z,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",G),document.removeEventListener("pointerup",Z,{capture:!0})}}},[x,Q,U]),g.useEffect(()=>{const te=()=>Q(!1);return window.addEventListener("blur",te),window.addEventListener("resize",te),()=>{window.removeEventListener("blur",te),window.removeEventListener("resize",te)}},[Q]);const[A,V]=QKe(te=>{const G=M().filter(re=>!re.disabled),Z=G.find(re=>re.ref.current===document.activeElement),oe=DKe(G,te,Z);oe&&setTimeout(()=>oe.ref.current.focus())}),z=g.useCallback((te,G,Z)=>{const oe=!R.current&&!Z;(y.value!==void 0&&y.value===G||oe)&&(P(te),oe&&(R.current=!0))},[y.value]),L=g.useCallback(()=>x?.focus(),[x]),q=g.useCallback((te,G,Z)=>{const oe=!R.current&&!Z;(y.value!==void 0&&y.value===G||oe)&&C(te)},[y.value]),Y=r==="popper"?fee:yKe,ne=Y===fee?{side:a,sideOffset:c,align:l,alignOffset:d,arrowPadding:p,collisionBoundary:f,collisionPadding:h,sticky:m,hideWhenDetached:O,avoidCollisions:_}:{};return u.jsx(_Ke,{scope:n,content:x,viewport:v,onViewportChange:T,itemRefCallback:z,selectedItem:w,onItemLeave:L,itemTextRefCallback:q,focusSelectedItem:j,selectedItemText:k,position:r,isPositioned:I,searchRef:A,children:u.jsx(E3,{as:pDn,allowPinchZoom:!0,children:u.jsx(v3,{asChild:!0,trapped:y.open,onMountAutoFocus:te=>{te.preventDefault()},onUnmountAutoFocus:xn(s,te=>{y.trigger?.focus({preventScroll:!0}),te.preventDefault()}),children:u.jsx(oE,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:te=>te.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:u.jsx(Y,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:te=>te.preventDefault(),...b,...ne,onPlaced:()=>$(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:xn(b.onKeyDown,te=>{const G=te.ctrlKey||te.altKey||te.metaKey;if(te.key==="Tab"&&te.preventDefault(),!G&&te.key.length===1&&V(te.key),["ArrowUp","ArrowDown","Home","End"].includes(te.key)){let oe=M().filter(re=>!re.disabled).map(re=>re.ref.current);if(["ArrowUp","End"].includes(te.key)&&(oe=oe.slice().reverse()),["ArrowUp","ArrowDown"].includes(te.key)){const re=te.target,se=oe.indexOf(re);oe=oe.slice(se+1)}setTimeout(()=>N(oe)),te.preventDefault()}})})})})})})});bKe.displayName=dDn;var fDn="SelectItemAlignedPosition",yKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,i=P_(hy,n),o=$_(hy,n),[a,c]=g.useState(null),[l,d]=g.useState(null),p=ts(t,E=>d(E)),f=aB(n),h=g.useRef(!1),m=g.useRef(!0),{viewport:O,selectedItem:_,selectedItemText:b,focusSelectedItem:y}=o,x=g.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&l&&O&&_&&b){const E=i.trigger.getBoundingClientRect(),w=l.getBoundingClientRect(),P=i.valueNode.getBoundingClientRect(),k=b.getBoundingClientRect();if(i.dir!=="rtl"){const re=k.left-w.left,se=P.left-re,he=E.left-se,Te=E.width+he,ee=Math.max(Te,w.width),ye=window.innerWidth-Od,Oe=Awe(se,[Od,Math.max(Od,ye-ee)]);a.style.minWidth=Te+"px",a.style.left=Oe+"px"}else{const re=w.right-k.right,se=window.innerWidth-P.right-re,he=window.innerWidth-E.right-se,Te=E.width+he,ee=Math.max(Te,w.width),ye=window.innerWidth-Od,Oe=Awe(se,[Od,Math.max(Od,ye-ee)]);a.style.minWidth=Te+"px",a.style.right=Oe+"px"}const C=f(),M=window.innerHeight-Od*2,I=O.scrollHeight,$=window.getComputedStyle(l),R=parseInt($.borderTopWidth,10),N=parseInt($.paddingTop,10),j=parseInt($.borderBottomWidth,10),Q=parseInt($.paddingBottom,10),U=R+N+I+Q+j,A=Math.min(_.offsetHeight*5,U),V=window.getComputedStyle(O),z=parseInt(V.paddingTop,10),L=parseInt(V.paddingBottom,10),q=E.top+E.height/2-Od,Y=M-q,ne=_.offsetHeight/2,te=_.offsetTop+ne,G=R+N+te,Z=U-G;if(G<=q){const re=C.length>0&&_===C[C.length-1].ref.current;a.style.bottom="0px";const se=l.clientHeight-O.offsetTop-O.offsetHeight,he=Math.max(Y,ne+(re?L:0)+se+j),Te=G+he;a.style.height=Te+"px"}else{const re=C.length>0&&_===C[0].ref.current;a.style.top="0px";const he=Math.max(q,R+O.offsetTop+(re?z:0)+ne)+Z;a.style.height=he+"px",O.scrollTop=G-q+O.offsetTop}a.style.margin=`${Od}px 0`,a.style.minHeight=A+"px",a.style.maxHeight=M+"px",r?.(),requestAnimationFrame(()=>h.current=!0)}},[f,i.trigger,i.valueNode,a,l,O,_,b,i.dir,r]);Aa(()=>x(),[x]);const[S,v]=g.useState();Aa(()=>{l&&v(window.getComputedStyle(l).zIndex)},[l]);const T=g.useCallback(E=>{E&&m.current===!0&&(x(),y?.(),m.current=!1)},[x,y]);return u.jsx(mDn,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:T,children:u.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:u.jsx(Or.div,{...s,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});yKe.displayName=fDn;var hDn="SelectPopperPosition",fee=g.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=Od,...i}=e,o=lB(n);return u.jsx(nU,{...o,...i,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});fee.displayName=hDn;var[mDn,Yle]=YE(hy,{}),hee="SelectViewport",xKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,i=$_(hee,n),o=Yle(hee,n),a=ts(t,i.onViewportChange),c=g.useRef(0);return u.jsxs(u.Fragment,{children:[u.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),u.jsx(oB.Slot,{scope:n,children:u.jsx(Or.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:xn(s.onScroll,l=>{const d=l.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:f}=o;if(f?.current&&p){const h=Math.abs(c.current-d.scrollTop);if(h>0){const m=window.innerHeight-Od*2,O=parseFloat(p.style.minHeight),_=parseFloat(p.style.height),b=Math.max(O,_);if(b<m){const y=b+h,x=Math.min(m,y),S=y-x;p.style.height=x+"px",p.style.bottom==="0px"&&(d.scrollTop=S>0?S:0,p.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});xKe.displayName=hee;var SKe="SelectGroup",[ODn,gDn]=YE(SKe),_Dn=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=ka();return u.jsx(ODn,{scope:n,id:s,children:u.jsx(Or.div,{role:"group","aria-labelledby":s,...r,ref:t})})});_Dn.displayName=SKe;var vKe="SelectLabel",TKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=gDn(vKe,n);return u.jsx(Or.div,{id:s.id,...r,ref:t})});TKe.displayName=vKe;var Kj="SelectItem",[bDn,EKe]=YE(Kj),wKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:i,...o}=e,a=P_(Kj,n),c=$_(Kj,n),l=a.value===r,[d,p]=g.useState(i??""),[f,h]=g.useState(!1),m=ts(t,y=>c.itemRefCallback?.(y,r,s)),O=ka(),_=g.useRef("touch"),b=()=>{s||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return u.jsx(bDn,{scope:n,value:r,disabled:s,textId:O,isSelected:l,onItemTextChange:g.useCallback(y=>{p(x=>x||(y?.textContent??"").trim())},[]),children:u.jsx(oB.ItemSlot,{scope:n,value:r,disabled:s,textValue:d,children:u.jsx(Or.div,{role:"option","aria-labelledby":O,"data-highlighted":f?"":void 0,"aria-selected":l&&f,"data-state":l?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...o,ref:m,onFocus:xn(o.onFocus,()=>h(!0)),onBlur:xn(o.onBlur,()=>h(!1)),onClick:xn(o.onClick,()=>{_.current!=="mouse"&&b()}),onPointerUp:xn(o.onPointerUp,()=>{_.current==="mouse"&&b()}),onPointerDown:xn(o.onPointerDown,y=>{_.current=y.pointerType}),onPointerMove:xn(o.onPointerMove,y=>{_.current=y.pointerType,s?c.onItemLeave?.():_.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:xn(o.onPointerLeave,y=>{y.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:xn(o.onKeyDown,y=>{c.searchRef?.current!==""&&y.key===" "||(sDn.includes(y.key)&&b(),y.key===" "&&y.preventDefault())})})})})});wKe.displayName=Kj;var Ok="SelectItemText",kKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...i}=e,o=P_(Ok,n),a=$_(Ok,n),c=EKe(Ok,n),l=lDn(Ok,n),[d,p]=g.useState(null),f=ts(t,b=>p(b),c.onItemTextChange,b=>a.itemTextRefCallback?.(b,c.value,c.disabled)),h=d?.textContent,m=g.useMemo(()=>u.jsx("option",{value:c.value,disabled:c.disabled,children:h},c.value),[c.disabled,c.value,h]),{onNativeOptionAdd:O,onNativeOptionRemove:_}=l;return Aa(()=>(O(m),()=>_(m)),[O,_,m]),u.jsxs(u.Fragment,{children:[u.jsx(Or.span,{id:c.textId,...i,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?xi.createPortal(i.children,o.valueNode):null]})});kKe.displayName=Ok;var CKe="SelectItemIndicator",RKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return EKe(CKe,n).isSelected?u.jsx(Or.span,{"aria-hidden":!0,...r,ref:t}):null});RKe.displayName=CKe;var mee="SelectScrollUpButton",PKe=g.forwardRef((e,t)=>{const n=$_(mee,e.__scopeSelect),r=Yle(mee,e.__scopeSelect),[s,i]=g.useState(!1),o=ts(t,r.onScrollButtonChange);return Aa(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollTop>0;i(l)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?u.jsx(NKe,{...e,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});PKe.displayName=mee;var Oee="SelectScrollDownButton",$Ke=g.forwardRef((e,t)=>{const n=$_(Oee,e.__scopeSelect),r=Yle(Oee,e.__scopeSelect),[s,i]=g.useState(!1),o=ts(t,r.onScrollButtonChange);return Aa(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<l;i(d)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?u.jsx(NKe,{...e,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});$Ke.displayName=Oee;var NKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,i=$_("SelectScrollButton",n),o=g.useRef(null),a=aB(n),c=g.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return g.useEffect(()=>()=>c(),[c]),Aa(()=>{a().find(d=>d.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),u.jsx(Or.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:xn(s.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:xn(s.onPointerMove,()=>{i.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:xn(s.onPointerLeave,()=>{c()})})}),yDn="SelectSeparator",AKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return u.jsx(Or.div,{"aria-hidden":!0,...r,ref:t})});AKe.displayName=yDn;var gee="SelectArrow",xDn=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=lB(n),i=P_(gee,n),o=$_(gee,n);return i.open&&o.position==="popper"?u.jsx(rU,{...s,...r,ref:t}):null});xDn.displayName=gee;var SDn="SelectBubbleInput",IKe=g.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=g.useRef(null),i=ts(r,s),o=TZe(t);return g.useEffect(()=>{const a=s.current;if(!a)return;const c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==t&&d){const p=new Event("change",{bubbles:!0});d.call(a,t),a.dispatchEvent(p)}},[o,t]),u.jsx(Or.select,{...n,style:{...WAe,...n.style},ref:i,defaultValue:t})});IKe.displayName=SDn;function MKe(e){return e===""||e===void 0}function QKe(e){const t=Xg(e),n=g.useRef(""),r=g.useRef(0),s=g.useCallback(o=>{const a=n.current+o;t(a),function c(l){n.current=l,window.clearTimeout(r.current),l!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(a)},[t]),i=g.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,i]}function DKe(e,t,n){const s=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=vDn(e,Math.max(i,0));s.length===1&&(o=o.filter(l=>l!==n));const c=o.find(l=>l.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function vDn(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var TDn=uKe,LKe=pKe,EDn=hKe,wDn=mKe,kDn=OKe,jKe=gKe,CDn=xKe,XKe=TKe,UKe=wKe,RDn=kKe,PDn=RKe,zKe=PKe,BKe=$Ke,FKe=AKe;const Kl=TDn,Jl=EDn,ul=g.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(LKe,{ref:r,className:at("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-[var(--color-border)] bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-[var(--color-surface)] placeholder:text-[var(--color-text-muted)] focus:outline-none focus:ring-1 focus:ring-[var(--color-border-emphasis)] disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,u.jsx(wDn,{asChild:!0,children:u.jsx(Dr,{className:"size-4 opacity-50"})})]}));ul.displayName=LKe.displayName;const YKe=g.forwardRef(({className:e,...t},n)=>u.jsx(zKe,{ref:n,className:at("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(cE,{className:"size-4"})}));YKe.displayName=zKe.displayName;const VKe=g.forwardRef(({className:e,...t},n)=>u.jsx(BKe,{ref:n,className:at("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(Dr,{className:"size-4"})}));VKe.displayName=BKe.displayName;const dl=g.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>u.jsx(kDn,{children:u.jsxs(jKe,{ref:s,className:at("relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border border-[var(--color-border)] bg-[var(--color-surface)] text-[var(--color-text)] shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[u.jsx(YKe,{}),u.jsx(CDn,{className:at("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),u.jsx(VKe,{})]})}));dl.displayName=jKe.displayName;const $Dn=g.forwardRef(({className:e,...t},n)=>u.jsx(XKe,{ref:n,className:at("px-2 py-1.5 text-sm font-semibold text-[var(--color-text-muted)]",e),...t}));$Dn.displayName=XKe.displayName;const Ui=g.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(UKe,{ref:r,className:at("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-[var(--color-surface-raised)] focus:text-[var(--color-text)] data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[u.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:u.jsx(PDn,{children:u.jsx(es,{className:"size-4"})})}),u.jsx(RDn,{children:t})]}));Ui.displayName=UKe.displayName;const NDn=g.forwardRef(({className:e,...t},n)=>u.jsx(FKe,{ref:n,className:at("-mx-1 my-1 h-px bg-[var(--color-border)]",e),...t}));NDn.displayName=FKe.displayName;const ADn=/^[\w.-]{1,100}$/,IDn=[{value:"streamable-http",label:"Streamable HTTP"},{value:"sse",label:"SSE"},{value:"http",label:"HTTP"}],MDn=({open:e,onClose:t,projectPath:n,cliStatus:r,cliStatusLoading:s})=>{const i=le(se=>se.installCustomMcpServer),o=le(se=>se.cliStatus),a=le(se=>se.cliStatusLoading),c=r??o,l=s??a,d=Ese(c?.flavor),p=[{value:d,label:cZ(d,c?.flavor)},{value:"project",label:"Project"},{value:"local",label:"Local"}],[f,h]=g.useState(""),[m,O]=g.useState("stdio"),[_,b]=g.useState(d),[y,x]=g.useState(""),[S,v]=g.useState(""),[T,E]=g.useState(""),[w,P]=g.useState("streamable-http"),[k,C]=g.useState([]),[M,I]=g.useState([]),[$,R]=g.useState(null),[N,j]=g.useState(!1),Q=g.useRef({}),U=g.useRef(!1),A=g.useRef(d),V=M.map(se=>se.key.trim()).filter(Boolean).sort().join("\0"),z=bu(_)?n??void 0:void 0,L=FO({isInstalled:!1,cliStatus:c,cliStatusLoading:l,section:"mcp"});g.useEffect(()=>{e&&!U.current&&(h(""),O("stdio"),b(d),x(""),v(""),E(""),P("streamable-http"),C([]),I([]),R(null),j(!1),Q.current={}),U.current=e,e||(A.current=d)},[d,e]),g.useEffect(()=>{if(!e){A.current=d;return}const se=A.current;se!==d&&_===se&&Hje(_)&&b(d),A.current=d},[d,e,_]),g.useEffect(()=>{e&&bu(_)&&!n&&b(d)},[d,e,n,_]),g.useEffect(()=>{if(!e||M.length===0||!K.apiKeys)return;const se=M.map(he=>he.key.trim()).filter(Boolean);se.length!==0&&K.apiKeys.lookup(se,z).then(he=>{const Te=Q.current,ee=Object.fromEntries(he.map(ye=>[ye.envVarName,ye.value]));I(ye=>{let Oe=!1;const ie=ye.map(ge=>{const J=ge.key.trim();if(!J)return ge;const F=Te[J],W=ee[J];return W?(!ge.value||ge.value===F)&&ge.value!==W?(Oe=!0,{...ge,value:W}):ge:F&&ge.value===F?(Oe=!0,{...ge,value:""}):ge});return Oe?ie:ye}),Q.current=ee},()=>{})},[z,V,e]);const q=async()=>{if(R(null),L){R(L);return}if(!f.trim()){R("Server name is required");return}if(!ADn.test(f)){R("Invalid server name. Use alphanumeric characters, dashes, underscores, dots.");return}let se;if(m==="stdio"){if(!y.trim()){R("npm package name is required");return}se={type:"stdio",npmPackage:y.trim(),npmVersion:S.trim()||void 0}}else{if(!T.trim()){R("Server URL is required");return}se={type:"http",url:T.trim(),transportType:w}}const he={};for(const ee of M)ee.key.trim()&&ee.value&&(he[ee.key.trim()]=ee.value);const Te={serverName:f,scope:_,projectPath:bu(_)?n??void 0:void 0,installSpec:se,envValues:he,headers:k.filter(ee=>ee.key.trim()&&ee.value.trim())};j(!0);try{await i(Te),t()}catch(ee){R(ee instanceof Error?ee.message:"安装失败")}finally{j(!1)}},Y=()=>I(se=>[...se,{key:"",value:""}]),ne=se=>I(he=>he.filter((Te,ee)=>ee!==se)),te=(se,he,Te)=>I(ee=>ee.map((ye,Oe)=>Oe===se?{...ye,[he]:Te}:ye)),G=()=>C(se=>[...se,{key:"",value:""}]),Z=se=>C(he=>he.filter((Te,ee)=>ee!==se)),oe=(se,he,Te)=>C(ee=>ee.map((ye,Oe)=>Oe===se?{...ye,[he]:Te}:ye)),re=f.trim()&&(m==="stdio"?y.trim():T.trim())&&!(bu(_)&&!n)&&!L&&!N;return u.jsx(Os,{open:e,onOpenChange:se=>!se&&t(),children:u.jsxs(ls,{className:"max-h-[85vh] max-w-lg overflow-y-auto",children:[u.jsx(gs,{children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("div",{className:"flex size-8 items-center justify-center rounded-lg border border-border bg-surface-raised",children:u.jsx(uU,{className:"size-4 text-text-muted"})}),u.jsxs("div",{children:[u.jsx(cs,{children:"添加自定义 MCP 服务器"}),u.jsx(Ti,{children:"不通过目录,手动添加一个服务器。"})]})]})}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(nn,{htmlFor:"custom-name",className:"text-xs",children:"服务器名称"}),u.jsx(Mn,{id:"custom-name",value:f,onChange:se=>h(se.target.value),placeholder:"my-server",className:"h-8 text-sm",autoFocus:!0})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(nn,{className:"text-xs",children:"传输方式"}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(Xe,{type:"button",variant:m==="stdio"?"default":"outline",size:"sm",onClick:()=>O("stdio"),children:"Stdio (npm)"}),u.jsx(Xe,{type:"button",variant:m==="http"?"default":"outline",size:"sm",onClick:()=>O("http"),children:"HTTP / SSE"})]})]}),m==="stdio"&&u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(nn,{htmlFor:"custom-npm",className:"text-xs",children:"npm 包"}),u.jsx(Mn,{id:"custom-npm",value:y,onChange:se=>x(se.target.value),placeholder:"@example/mcp-server",className:"h-8 font-mono text-sm"})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(nn,{htmlFor:"custom-version",className:"text-xs",children:"版本(可选)"}),u.jsx(Mn,{id:"custom-version",value:S,onChange:se=>v(se.target.value),placeholder:"latest",className:"h-8 text-sm"})]})]}),m==="http"&&u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(nn,{htmlFor:"custom-url",className:"text-xs",children:"服务器 URL"}),u.jsx(Mn,{id:"custom-url",value:T,onChange:se=>E(se.target.value),placeholder:"https://api.example.com/mcp",className:"h-8 text-sm"})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(nn,{className:"text-xs",children:"传输类型"}),u.jsxs(Kl,{value:w,onValueChange:se=>P(se),children:[u.jsx(ul,{className:"h-8 text-sm",children:u.jsx(Jl,{})}),u.jsx(dl,{children:IDn.map(se=>u.jsx(Ui,{value:se.value,children:se.label},se.value))})]})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(nn,{className:"text-xs",children:"请求头"}),u.jsxs(Xe,{variant:"ghost",size:"sm",onClick:G,className:"h-6 px-1.5 text-xs",children:[u.jsx(fl,{className:"mr-1 size-3"}),"添加"]})]}),k.length>0&&u.jsx("div",{className:"space-y-2",children:k.map((se,he)=>u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Mn,{value:se.key,onChange:Te=>oe(he,"key",Te.target.value),className:"h-7 w-32 text-xs",placeholder:"Header-Name"}),u.jsx(Mn,{value:se.value,onChange:Te=>oe(he,"value",Te.target.value),className:"h-7 flex-1 text-xs",placeholder:"value"}),u.jsx(Xe,{variant:"ghost",size:"icon",className:"size-7 text-red-400 hover:bg-red-500/10",onClick:()=>Z(he),children:u.jsx(Si,{className:"size-3"})})]},he))})]})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(nn,{className:"text-xs",children:"作用域"}),u.jsxs(Kl,{value:_,onValueChange:se=>b(se),children:[u.jsx(ul,{className:"h-8 text-sm",children:u.jsx(Jl,{})}),u.jsx(dl,{children:p.map(se=>u.jsx(Ui,{value:se.value,disabled:bu(se.value)&&!n,children:se.label},se.value))})]})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(nn,{className:"text-xs",children:"环境变量"}),u.jsxs(Xe,{variant:"ghost",size:"sm",onClick:Y,className:"h-6 px-1.5 text-xs",children:[u.jsx(fl,{className:"mr-1 size-3"}),"添加"]})]}),M.length>0&&u.jsx("div",{className:"space-y-2",children:M.map((se,he)=>u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Mn,{value:se.key,onChange:Te=>te(he,"key",Te.target.value),className:"h-7 w-40 font-mono text-xs",placeholder:"ENV_VAR_NAME"}),u.jsx(Mn,{type:"password",value:se.value,onChange:Te=>te(he,"value",Te.target.value),className:"h-7 flex-1 text-xs",placeholder:"value"}),u.jsx(Xe,{variant:"ghost",size:"icon",className:"size-7 text-red-400 hover:bg-red-500/10",onClick:()=>ne(he),children:u.jsx(Si,{className:"size-3"})})]},he))})]}),L&&u.jsx("div",{className:"rounded-md border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-xs text-amber-300",children:L}),$&&u.jsx("div",{className:"rounded-md border border-red-500/30 bg-red-500/5 px-3 py-2 text-xs text-red-400",children:$}),u.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[u.jsx(Xe,{variant:"ghost",size:"sm",onClick:t,children:"取消"}),u.jsx(Xe,{size:"sm",disabled:!re,onClick:()=>void q(),children:N?"正在安装...":"安装"})]})]})]})})},qKe=({value:e,onChange:t,placeholder:n="Search...",debounceMs:r})=>{const[s,i]=g.useState(e),o=g.useRef(null);g.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),g.useEffect(()=>{i(e)},[e]);const a=c=>{i(c),r&&r>0?(o.current&&clearTimeout(o.current),o.current=setTimeout(()=>t(c),r)):t(c)};return u.jsxs("div",{className:"relative",children:[u.jsx($i,{className:"absolute left-3 top-1/2 size-4 -translate-y-1/2 text-text-muted"}),u.jsx(Mn,{type:"text",value:s,onChange:c=>a(c.target.value),placeholder:n,className:"pl-9 pr-8"}),s&&u.jsx(Xe,{variant:"ghost",size:"icon",onClick:()=>a(""),className:"absolute right-1 top-1/2 size-7 -translate-y-1/2",children:u.jsx(Ar,{className:"size-3.5"})})]})},WKe=({state:e,isInstalled:t,onInstall:n,onUninstall:r,section:s="plugins",disabled:i,size:o="sm",errorMessage:a,cliStatus:c,cliStatusLoading:l})=>{const{cliStatus:d,cliStatusLoading:p}=le(Et(S=>({cliStatus:S.cliStatus,cliStatusLoading:S.cliStatusLoading}))),m=FO({isInstalled:t,cliStatus:c??d,cliStatusLoading:l??p,section:s}),O=i||!!m,[_,b]=g.useState(null);g.useEffect(()=>{(e==="idle"||e==="success")&&b(null)},[e]);const y=_??(t?"uninstall":"install");if(e==="pending")return u.jsxs(Xe,{size:o,variant:"outline",disabled:!0,children:[u.jsx(Ht,{className:"size-3.5 animate-spin"}),u.jsx("span",{className:"ml-1.5",children:y==="uninstall"?"正在移除...":"正在安装..."})]});if(e==="success")return u.jsxs(Xe,{size:o,variant:"outline",disabled:!0,className:"text-green-400",children:[u.jsx(es,{className:"size-3.5"}),u.jsx("span",{className:"ml-1.5",children:"完成"})]});if(e==="error"){const S=u.jsx(Xe,{size:o,variant:"outline",className:"border-red-500/30 text-red-400 hover:bg-red-500/10",onClick:T=>{if(T.stopPropagation(),y==="uninstall"){b("uninstall"),r();return}b("install"),n()},disabled:O,children:u.jsx("span",{children:"重试"})}),v=m??a;return v?u.jsxs("div",{className:"flex max-w-64 flex-col items-end gap-1",children:[u.jsx(Wl,{children:u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx("span",{tabIndex:0,children:S})}),u.jsx(nt,{className:"max-w-64 text-red-300",children:v})]})}),a&&!m?u.jsx("p",{className:"text-right text-[11px] leading-4 text-red-300",children:a}):null]}):S}const x=t?u.jsxs(Xe,{size:o,variant:"outline",className:"border-red-500/30 text-red-400 hover:bg-red-500/10",onClick:S=>{S.stopPropagation(),b("uninstall"),r()},disabled:O,children:[u.jsx(Si,{className:"size-3.5"}),u.jsx("span",{className:"ml-1.5",children:"卸载"})]}):u.jsx(Xe,{size:o,variant:"default",onClick:S=>{S.stopPropagation(),b("install"),n()},disabled:O,children:"安装"});return m?u.jsx(Wl,{children:u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx("span",{tabIndex:0,children:x})}),u.jsx(nt,{className:"max-w-64",children:m})]})}):x},GKe=({source:e})=>e==="official"?u.jsx(Ut,{className:"border-blue-500/30 bg-blue-500/10 text-blue-400",variant:"outline",children:"Official"}):e==="glama"?u.jsx(Ut,{className:"border-zinc-500/30 bg-zinc-500/10 text-zinc-400",variant:"outline",children:"Glama"}):u.jsx(Ut,{className:"border-orange-500/30 bg-orange-500/10 text-orange-400",variant:"outline",children:"Community"}),QDn=({server:e,isInstalled:t,installedEntry:n,installedEntries:r=[],diagnostic:s,diagnosticsLoading:i,onClick:o,cliStatus:a,cliStatusLoading:c})=>{const l=le($=>$.cliStatus),d=a??l,p=Ese(d?.flavor),f=JR(e.id,p),h=le($=>$.mcpInstallProgress[f]??"idle"),m=le($=>$.installMcpServer),O=le($=>$.uninstallMcpServer),_=le($=>$.installErrors[f]),b=le($=>e.repositoryUrl?$.mcpGitHubStars[e.repositoryUrl]:void 0),y=!!e.installSpec,x=r.length?r:n?[n]:[],S=e.installSpec?.type==="http"||e.envVars.length>0||e.requiresAuth||(e.authHeaders?.length??0)>0,v=kL(e.name),T=x.find($=>$.scope===p)??null,E=Gje(x),w=t&&x.length===1&&T?.name===v&&!S,P=y&&(t?w:!S),[k,C]=g.useState(!1),M=!!e.iconUrl&&!k,I=s?.status==="connected"?"border-emerald-500/30 bg-emerald-500/10 text-emerald-400":s?.status==="needs-authentication"?"border-amber-500/30 bg-amber-500/10 text-amber-400":s?.status==="failed"?"border-red-500/30 bg-red-500/10 text-red-400":"border-border bg-surface-raised text-text-muted";return u.jsxs("div",{role:"button",tabIndex:0,onClick:()=>o(e.id),onKeyDown:$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),o(e.id))},className:`relative flex w-full cursor-pointer flex-col gap-2 overflow-hidden rounded-lg border p-4 text-left transition-all duration-200 hover:border-border-emphasis hover:bg-surface-raised hover:shadow-[0_0_12px_rgba(255,255,255,0.02)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-border-emphasis)] ${t?"border-l-2 border-border border-l-emerald-500/30":"border-border"}`,children:[u.jsxs("div",{className:"flex items-start gap-2.5",children:[M&&u.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg border border-border bg-surface-raised",children:u.jsx("img",{src:e.iconUrl,alt:"",className:"size-7 rounded object-contain",onError:()=>C(!0)})}),u.jsx("div",{className:"min-w-0 flex-1",children:u.jsxs("div",{className:"flex items-start justify-between gap-2",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("h3",{className:"truncate text-sm font-semibold text-text",children:e.name}),e.source!=="official"&&u.jsx("div",{className:"mt-1",children:u.jsx(GKe,{source:e.source})})]}),u.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[t&&u.jsx(Ut,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-400",variant:"outline",children:E??"Installed"}),t&&i&&!s&&u.jsx(Ut,{className:"border-border bg-surface-raised text-text-muted",variant:"outline",children:"Checking..."}),s&&u.jsx(Ut,{className:I,variant:"outline",children:s.statusLabel})]})]})})]}),u.jsx("p",{className:"line-clamp-2 text-xs text-text-secondary",children:e.description}),s?.target&&u.jsx("p",{className:"truncate font-mono text-[10px] text-text-muted",title:s.target,children:s.target}),u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1 text-xs text-text-muted",children:[e.tools.length>0&&u.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-surface-raised px-1.5 py-0.5 ring-1 ring-border",children:[u.jsx(pE,{className:"size-3"}),e.tools.length," ",e.tools.length===1?"tool":"tools"]}),e.envVars.length>0&&u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(eft,{className:"size-3"}),e.envVars.length," ",e.envVars.length===1?"env":"envs"]}),e.requiresAuth&&u.jsxs("span",{className:"inline-flex items-center gap-1 text-amber-400",children:[u.jsx(A0,{className:"size-3"}),"Auth"]}),e.version&&u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(Bht,{className:"size-3"}),e.version]}),e.updatedAt&&u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(nc,{className:"size-3"}),_3(e.updatedAt)]}),e.author&&u.jsxs("span",{className:"truncate",children:["by ",e.author]}),e.hostingType==="remote"&&u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(Bdt,{className:"size-3"}),"Remote"]}),e.hostingType==="local"&&u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(zIe,{className:"size-3"}),"Local"]}),e.hostingType==="both"&&u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(QD,{className:"size-3"}),"Both"]}),e.repositoryUrl&&u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsxs("button",{className:"inline-flex items-center gap-1.5 text-text-muted transition-colors hover:text-text",onClick:$=>{$.stopPropagation(),K.openExternal(e.repositoryUrl)},children:[u.jsx(Apt,{className:"size-3.5"}),b!=null&&u.jsxs("span",{className:"inline-flex items-center gap-0.5",children:[u.jsx(GIe,{className:"size-3 fill-amber-400 text-amber-400"}),xhn(b)]})]})}),u.jsx(nt,{side:"top",children:"Repository"})]}),e.websiteUrl&&u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx("button",{className:"inline-flex items-center text-text-muted transition-colors hover:text-text",onClick:$=>{$.stopPropagation(),K.openExternal(e.websiteUrl)},children:u.jsx(QD,{className:"size-3.5"})})}),u.jsx(nt,{side:"top",children:"Website"})]})]}),P&&u.jsx("div",{className:"shrink-0",children:u.jsx(WKe,{state:h,isInstalled:t,section:"mcp",cliStatus:d,cliStatusLoading:c,onInstall:()=>m({registryId:e.id,serverName:v,scope:p,envValues:{},headers:[]}),onUninstall:()=>O(e.id,T?.name??v,p),size:"sm",errorMessage:_})}),y&&(!P||S)&&u.jsx("div",{className:"shrink-0",children:u.jsx(Xe,{size:"sm",variant:"outline",onClick:$=>{$.stopPropagation(),o(e.id)},children:t?"Manage":"Configure"})})]})]})},DDn=({server:e,isInstalled:t,installedEntry:n,installedEntries:r=[],diagnostic:s,diagnosticsLoading:i,projectPath:o,open:a,onClose:c,cliStatus:l,cliStatusLoading:d})=>{const p=le(ae=>ae.cliStatus),f=l??p,h=Ese(f?.flavor),[m,O]=g.useState(h),_=e?JR(e.id,m,o):null,b=le(ae=>(_?ae.mcpInstallProgress[_]:void 0)??"idle"),y=le(ae=>ae.installMcpServer),x=le(ae=>ae.uninstallMcpServer),S=le(ae=>_?ae.installErrors[_]:void 0),v=le(ae=>e?.repositoryUrl?ae.mcpGitHubStars[e.repositoryUrl]:void 0),[T,E]=g.useState(""),[w,P]=g.useState({}),[k,C]=g.useState([]),[M,I]=g.useState(!1),[$,R]=g.useState(new Set),N=g.useRef({}),j=g.useRef(h),Q=r.length?r:n?[n]:[],U=[{value:h,label:cZ(h,f?.flavor)},...h!=="user"&&Q.some(ae=>ae.scope==="user")?[{value:"user",label:cZ("user",f?.flavor)}]:[],{value:"project",label:"项目"},{value:"local",label:"本地"}],A=Wje(Q),V=Q.find(ae=>ae.scope===m)??null,z=Gje(Q),L=e?.envVars.map(ae=>ae.name).sort().join("\0")??"",q=f?.flavor==="agent_teams_orchestrator"?"运行时状态":"Claude 状态",Y=bu(m)?o??void 0:void 0;if(g.useEffect(()=>{!e||!a||(P(Object.fromEntries(e.envVars.map(ae=>[ae.name,""]))),C((e.authHeaders??[]).map(ae=>({key:ae.key,value:"",secret:ae.isSecret,description:ae.description,isRequired:ae.isRequired,valueTemplate:ae.valueTemplate,locked:!0}))),E(A?.name??kL(e.name)),O(A?.scope??h),I(!1),R(new Set),N.current={})},[a,A?.name,A?.scope,e?.id]),g.useEffect(()=>{if(!a){j.current=h;return}const ae=j.current;ae!==h&&!A&&m===ae&&Hje(m)&&O(h),j.current=h},[h,a,A,m]),g.useEffect(()=>{!e||!a||!V||E(V.name)},[a,V,e]),g.useEffect(()=>{a&&bu(m)&&!o&&O(h)},[h,a,o,m]),g.useEffect(()=>{if(!e||!a||e.envVars.length===0||!K.apiKeys)return;const ae=e.envVars.map(ce=>ce.name);K.apiKeys.lookup(ae,Y).then(ce=>{const H=N.current,pe={};for(const Ee of ce)pe[Ee.envVarName]=Ee.value;P(Ee=>{const we={...Ee};for(const[$e,Ze]of Object.entries(H))!($e in pe)&&we[$e]===Ze&&(we[$e]="");for(const[$e,Ze]of Object.entries(pe))(!we[$e]||we[$e]===H[$e])&&(we[$e]=Ze);return we}),R(new Set(Object.keys(pe))),N.current=pe},()=>{})},[Y,L,a,e?.id]),!e)return u.jsx(u.Fragment,{});const ne=!!e.installSpec,te=e.installSpec?.type==="http",G=!!e.iconUrl&&!M,Z=e.installSpec?.type==="stdio"?`https://www.npmjs.com/package/${e.installSpec.npmPackage}`:null,oe=k.some(ae=>ae.locked),re=e.envVars.some(ae=>ae.isRequired&&!w[ae.name]?.trim()),se=k.some(ae=>ae.isRequired&&!ae.value.trim()),he=V!==null,Te=V?.name??T,ee=V?.scope??m,ye=bu(m)&&!o,Oe=!T.trim()||re||se||ye,ie=s?.status==="connected"?"border-emerald-500/30 bg-emerald-500/10 text-emerald-400":s?.status==="needs-authentication"?"border-amber-500/30 bg-amber-500/10 text-amber-400":s?.status==="failed"?"border-red-500/30 bg-red-500/10 text-red-400":"border-border bg-surface-raised text-text-muted",ge=()=>{y({registryId:e.id,serverName:T,scope:m,projectPath:bu(m)?o??void 0:void 0,envValues:w,headers:k})},J=()=>{x(e.id,Te,ee,bu(ee)?o??void 0:void 0)},F=()=>{C(ae=>[...ae,{key:"",value:""}])},W=ae=>{C(ce=>ce.filter((H,pe)=>pe!==ae))},ue=(ae,ce,H)=>{C(pe=>pe.map((Ee,we)=>we===ae?{...Ee,[ce]:H}:Ee))};return u.jsx(Os,{open:a,onOpenChange:ae=>!ae&&c(),children:u.jsxs(ls,{className:"max-h-[85vh] max-w-2xl overflow-y-auto",children:[u.jsx(gs,{children:u.jsxs("div",{className:"flex items-start gap-3",children:[G&&u.jsx("div",{className:"flex size-10 shrink-0 items-center justify-center rounded-lg border border-border bg-surface-raised",children:u.jsx("img",{src:e.iconUrl,alt:"",className:"size-8 rounded object-contain",onError:()=>I(!0)})}),u.jsx("div",{className:"min-w-0 flex-1",children:u.jsxs("div",{className:"flex items-start justify-between gap-3",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx(cs,{className:"truncate",children:e.name}),u.jsx(Ti,{className:"mt-1",children:e.description})]}),u.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[t&&u.jsx(Ut,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-400",variant:"outline",children:z??"已安装"}),e.source!=="official"&&u.jsx(GKe,{source:e.source})]})]})})]})}),u.jsxs("div",{className:"grid grid-cols-1 gap-3 text-sm sm:grid-cols-2",children:[u.jsxs("div",{children:[u.jsx("span",{className:"text-text-muted",children:"来源"}),u.jsx("p",{className:"capitalize text-text",children:e.source})]}),v!=null&&u.jsxs("div",{children:[u.jsx("span",{className:"text-text-muted",children:"GitHub 星标"}),u.jsxs("p",{className:"flex items-center gap-1 text-text",children:[u.jsx(GIe,{className:"size-3.5 fill-amber-400 text-amber-400"}),v.toLocaleString()]})]}),e.version&&u.jsxs("div",{children:[u.jsx("span",{className:"text-text-muted",children:"版本"}),u.jsx("p",{className:"text-text",children:e.version})]}),e.license&&u.jsxs("div",{children:[u.jsx("span",{className:"text-text-muted",children:"许可证"}),u.jsx("p",{className:"text-text",children:e.license})]}),u.jsxs("div",{children:[u.jsx("span",{className:"text-text-muted",children:"安装类型"}),e.installSpec?.type==="stdio"?u.jsxs(Xe,{variant:"link",className:"h-auto p-0 text-sm text-blue-400",onClick:()=>void K.openExternal(Z),children:["npm: ",e.installSpec.npmPackage]}):u.jsx("p",{className:"text-text",children:e.installSpec?`HTTP: ${e.installSpec.transportType}`:"需要手动设置"})]}),e.author&&u.jsxs("div",{children:[u.jsx("span",{className:"text-text-muted",children:"作者"}),u.jsx("p",{className:"text-text",children:e.author})]}),e.hostingType&&u.jsxs("div",{children:[u.jsx("span",{className:"text-text-muted",children:"托管方式"}),u.jsx("p",{className:"capitalize text-text",children:e.hostingType})]}),e.publishedAt&&u.jsxs("div",{children:[u.jsx("span",{className:"text-text-muted",children:"发布时间"}),u.jsx("p",{className:"text-text",children:new Date(e.publishedAt).toLocaleDateString()})]}),e.updatedAt&&u.jsxs("div",{children:[u.jsx("span",{className:"text-text-muted",children:"更新时间"}),u.jsx("p",{className:"text-text",children:new Date(e.updatedAt).toLocaleDateString()})]})]}),e.requiresAuth&&u.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-sm text-amber-400",children:[u.jsx(A0,{className:"size-4"}),"此服务器需要认证"]}),te&&!e.requiresAuth&&(e.authHeaders?.length??0)===0&&u.jsx("div",{className:"rounded-md border border-blue-500/30 bg-blue-500/5 px-3 py-2 text-sm text-blue-400",children:"远程 MCP 服务器即使未在注册表中声明,也可能仍需要自定义请求头或 API 密钥。若安装后连接失败,请查看提供商文档。"}),he&&u.jsxs("div",{className:"space-y-2 rounded-md border border-border bg-surface-raised px-4 py-3",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3",children:[u.jsx("span",{className:"text-sm font-medium text-text",children:q}),i&&!s?u.jsx(Ut,{className:"border-border bg-surface-raised text-text-muted",variant:"outline",children:"检查中..."}):s?u.jsx(Ut,{className:ie,variant:"outline",children:s.statusLabel}):u.jsx(Ut,{className:"border-border bg-surface-raised text-text-muted",variant:"outline",children:"未检查"})]}),s?.target&&u.jsxs("div",{children:[u.jsx("p",{className:"mb-1 text-xs text-text-muted",children:"启动目标"}),u.jsx("code",{className:"block overflow-x-auto rounded bg-surface px-2 py-1 text-xs text-text",children:s.target})]})]}),ne&&u.jsxs("div",{className:"space-y-3 rounded-md border border-border bg-surface-raised p-4",children:[u.jsx("h4",{className:"text-sm font-medium text-text",children:he?"管理安装":"安装服务器"}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(nn,{htmlFor:"server-name",className:"text-xs",children:"服务器名称"}),u.jsx(Mn,{id:"server-name",value:T,onChange:ae=>E(ae.target.value),placeholder:"my-server",className:"h-8 text-sm",disabled:he})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(nn,{className:"text-xs",children:"范围"}),u.jsxs(Kl,{value:m,onValueChange:ae=>O(ae),children:[u.jsx(ul,{className:"h-8 text-sm",children:u.jsx(Jl,{})}),u.jsx(dl,{children:U.map(ae=>u.jsx(Ui,{value:ae.value,disabled:bu(ae.value)&&!o,children:ae.label},ae.value))})]})]}),e.envVars.length>0&&u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(nn,{className:"text-xs",children:"环境变量"}),u.jsx("div",{className:"space-y-2",children:e.envVars.map(ae=>u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("code",{className:"w-40 shrink-0 truncate text-xs text-blue-400",children:ae.name}),u.jsx(Mn,{type:ae.isSecret?"password":"text",value:w[ae.name]??"",onChange:ce=>P(H=>({...H,[ae.name]:ce.target.value})),className:"h-7 flex-1 text-xs",placeholder:ae.description??ae.name}),$.has(ae.name)&&w[ae.name]&&u.jsx("span",{className:"shrink-0 text-[10px] text-emerald-400",children:"已自动填充"})]},ae.name))})]}),te&&u.jsxs("div",{className:"space-y-1.5",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(nn,{className:"text-xs",children:"请求头"}),u.jsxs(Xe,{variant:"ghost",size:"sm",onClick:F,className:"h-6 px-1.5 text-xs",children:[u.jsx(fl,{className:"mr-1 size-3"}),oe?"添加自定义":"添加"]})]}),k.length>0&&u.jsx("div",{className:"space-y-2",children:k.map((ae,ce)=>u.jsxs("div",{className:"space-y-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[ae.locked?u.jsx("code",{className:"w-32 shrink-0 truncate text-xs text-blue-400",children:ae.key}):u.jsx(Mn,{value:ae.key,onChange:H=>ue(ce,"key",H.target.value),className:"h-7 w-32 text-xs",placeholder:"Header-Name"}),u.jsx(Mn,{type:ae.secret?"password":"text",value:ae.value,onChange:H=>ue(ce,"value",H.target.value),className:"h-7 flex-1 text-xs",placeholder:ae.valueTemplate??ae.description??"value"}),u.jsx(Xe,{variant:"ghost",size:"icon",className:"size-7 text-red-400 hover:bg-red-500/10",onClick:()=>W(ce),disabled:ae.locked&&ae.isRequired,children:u.jsx(Si,{className:"size-3"})})]}),(ae.description||ae.valueTemplate||ae.isRequired)&&u.jsx("p",{className:"text-[10px] text-text-muted",children:[ae.isRequired?"必填":null,ae.description,ae.valueTemplate].filter(Boolean).join(" • ")})]},ce))})]}),u.jsx("div",{className:"flex justify-end pt-1",children:u.jsx(WKe,{state:b,isInstalled:he,section:"mcp",cliStatus:f,cliStatusLoading:d,onInstall:ge,onUninstall:J,disabled:Oe,size:"default",errorMessage:S})})]}),!ne&&u.jsx("div",{className:"rounded-md border border-border bg-surface-raised px-4 py-3 text-sm text-text-muted",children:"此服务器需要手动设置。请查看仓库中的安装说明。"}),e.tools.length>0&&u.jsxs("div",{children:[u.jsxs("h4",{className:"mb-2 flex items-center gap-1.5 text-sm font-medium text-text",children:[u.jsx(pE,{className:"size-4"}),"工具(",e.tools.length,")"]}),u.jsx("div",{className:"max-h-48 space-y-1 overflow-y-auto",children:e.tools.map(ae=>u.jsxs("div",{className:"rounded-md bg-surface-raised p-2 text-xs",children:[u.jsx("code",{className:"font-mono text-text",children:ae.name}),ae.description&&u.jsx("p",{className:"mt-0.5 text-text-muted",children:ae.description})]},ae.name))})]}),u.jsxs("div",{className:"flex items-center gap-4",children:[e.repositoryUrl&&u.jsxs(Xe,{variant:"link",className:"h-auto p-0 text-sm text-blue-400",onClick:()=>void K.openExternal(e.repositoryUrl),children:[u.jsx(hf,{className:"mr-1 size-3.5"}),"仓库"]}),e.glamaUrl&&u.jsxs(Xe,{variant:"link",className:"h-auto p-0 text-sm text-blue-400",onClick:()=>void K.openExternal(e.glamaUrl),children:[u.jsx(hf,{className:"mr-1 size-3.5"}),"Glama"]}),e.websiteUrl&&u.jsxs(Xe,{variant:"link",className:"h-auto p-0 text-sm text-blue-400",onClick:()=>void K.openExternal(e.websiteUrl),children:[u.jsx(hf,{className:"mr-1 size-3.5"}),"网站"]})]})]})})},LDn=[{value:"name-asc",label:"Name A→Z"},{value:"name-desc",label:"Name Z→A"},{value:"tools-desc",label:"Most tools"}];function jDn(e,t){return[...e].sort((n,r)=>{switch(t){case"name-asc":return n.name.localeCompare(r.name);case"name-desc":return r.name.localeCompare(n.name);case"tools-desc":return r.tools.length-n.tools.length;default:return 0}})}const XDn=({projectPath:e,mcpSearchQuery:t,mcpSearch:n,mcpSearchResults:r,mcpSearchLoading:s,mcpSearchWarnings:i,selectedMcpServerId:o,setSelectedMcpServerId:a,cliStatus:c,cliStatusLoading:l})=>{const d=dT(e),{browseCatalog:p,browseNextCursor:f,browseLoading:h,browseError:m,mcpBrowse:O,installedServersByProjectPath:_,installedServersFallback:b,fetchMcpGitHubStars:y,mcpDiagnosticsByProjectPath:x,mcpDiagnosticsFallback:S,mcpDiagnosticsLoadingByProjectPath:v,mcpDiagnosticsLoadingFallback:T,mcpDiagnosticsErrorByProjectPath:E,mcpDiagnosticsErrorFallback:w,mcpDiagnosticsLastCheckedAtByProjectPath:P,mcpDiagnosticsLastCheckedAtFallback:k,runMcpDiagnostics:C,uninstallMcpServer:M,mcpInstallProgress:I}=le(Et(F=>({browseCatalog:F.mcpBrowseCatalog,browseNextCursor:F.mcpBrowseNextCursor,browseLoading:F.mcpBrowseLoading,browseError:F.mcpBrowseError,mcpBrowse:F.mcpBrowse,installedServersByProjectPath:F.mcpInstalledServersByProjectPath,installedServersFallback:F.mcpInstalledServers,fetchMcpGitHubStars:F.fetchMcpGitHubStars,mcpDiagnosticsByProjectPath:F.mcpDiagnosticsByProjectPath,mcpDiagnosticsFallback:F.mcpDiagnostics,mcpDiagnosticsLoadingByProjectPath:F.mcpDiagnosticsLoadingByProjectPath,mcpDiagnosticsLoadingFallback:F.mcpDiagnosticsLoading,mcpDiagnosticsErrorByProjectPath:F.mcpDiagnosticsErrorByProjectPath,mcpDiagnosticsErrorFallback:F.mcpDiagnosticsError,mcpDiagnosticsLastCheckedAtByProjectPath:F.mcpDiagnosticsLastCheckedAtByProjectPath,mcpDiagnosticsLastCheckedAtFallback:F.mcpDiagnosticsLastCheckedAt,runMcpDiagnostics:F.runMcpDiagnostics,uninstallMcpServer:F.uninstallMcpServer,mcpInstallProgress:F.mcpInstallProgress}))),$=le(F=>F.cliStatus),R=le(F=>F.cliStatusLoading),N=c??$,j=l??R,Q=_?.[d]??b??[],U=x?.[d]??S??{},A=v?.[d]??T??!1,V=E?.[d]??w??null,z=P?.[d]??k??null,[L,q]=g.useState("name-asc");g.useEffect(()=>{p.length===0&&!h&&!m&&O()},[p.length,m,h,O]);const Y=g.useMemo(()=>N===null||typeof N>"u"?j?"正在检查运行时状态...":"正在检查运行时可用性...":N?.installed===!1?N.binaryPath&&N.launchError?"已找到配置的运行时,但启动失败。请前往首页修复或重新安装。":"需要配置运行时。请前往首页安装或修复。":null,[N,j]);g.useEffect(()=>{Y||C(e??void 0)},[Y,e,C]),g.useEffect(()=>{const F=p.map(W=>W.repositoryUrl).filter(W=>!!W);F.length>0&&y(F)},[p,y]);const ne=t.trim().length>0,te=ne?r:p,G=ne?s:h,Z=ne?i:[],oe=g.useMemo(()=>new Set(Q.map(F=>F.name.toLowerCase())),[Q]),re=g.useMemo(()=>{const F=new Map;for(const W of Q){const ue=W.name.toLowerCase();F.set(ue,[...F.get(ue)??[],W])}return F},[Q]),se=F=>oe.has(kL(F.name)),he=F=>re.get(kL(F.name))??[],Te=F=>Wje(he(F)),ee=F=>{const W=Te(F);return W?U[UQ(W.name,W.scope)]??U[UQ(W.name)]??U[W.name]??null:null},ye=g.useMemo(()=>Object.values(U).sort((F,W)=>F.name.localeCompare(W.name)),[U]),Oe=F=>{switch(F){case"connected":return"border-emerald-500/30 bg-emerald-500/10 text-emerald-400";case"needs-authentication":return"border-amber-500/30 bg-amber-500/10 text-amber-400";case"failed":return"border-red-500/30 bg-red-500/10 text-red-400";default:return"border-border bg-surface-raised text-text-muted"}},ie=g.useMemo(()=>jDn(te,L),[te,L]),ge=Fle(N,!0),J=g.useMemo(()=>o?ie.find(F=>F.id===o)??p.find(F=>F.id===o)??r.find(F=>F.id===o)??null:null,[ie,p,r,o]);return u.jsxs("div",{className:"flex flex-col gap-4",children:[u.jsxs("div",{className:"rounded-md border border-black/10 bg-surface-raised px-4 py-3 dark:border-white/10",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3",children:[u.jsxs("div",{children:[u.jsx("p",{className:"text-sm font-medium text-text",children:"MCP 健康状态"}),u.jsx("p",{className:"text-xs text-text-muted",children:A?u.jsxs(u.Fragment,{children:["正在通过 ",ge," 检查已安装的 MCP 服务器..."]}):Y||(z?`上次检查:${_3(new Date(z).toISOString())}`:u.jsx(u.Fragment,{children:"在此页面运行诊断,以验证已安装 MCP 的连接状态。"}))})]}),u.jsxs(Xe,{variant:"outline",size:"sm",onClick:()=>void C(e??void 0),disabled:A||!!Y,className:"whitespace-nowrap",children:[u.jsx(ua,{className:`mr-1.5 size-3.5 ${A?"animate-spin":""}`}),A?"检查中...":"检查状态"]})]}),(A||ye.length>0)&&u.jsxs("div",{className:"mt-4 border-t border-black/10 pt-4 dark:border-white/10",children:[u.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[u.jsx("p",{className:"text-sm font-medium text-text",children:"运行时 MCP 诊断"}),ye.length>0&&u.jsxs("span",{className:"text-xs text-text-muted",children:[ye.length," 个服务器"]})]}),ye.length>0?u.jsx("div",{className:"mcp-diagnostics-list max-h-[18.5rem] space-y-2 overflow-y-auto pr-1",children:ye.map(F=>{const W=JR(F.name,F.scope||"user",e),ue=I[W]==="pending";return u.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-md border border-black/10 px-3 py-2 dark:border-white/10",children:[u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("p",{className:"text-sm text-text",children:F.name}),F.scope&&u.jsx("span",{className:"rounded-full border border-border bg-surface-raised px-1.5 py-0.5 text-[10px] uppercase tracking-wide text-text-muted",children:F.scope})]}),u.jsx("p",{className:"truncate font-mono text-[11px] text-text-muted",title:F.target,children:F.target})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Ut,{className:Oe(F.status),variant:"outline",children:F.statusLabel}),u.jsx(Xe,{variant:"ghost",size:"sm",className:"size-6 p-0 text-red-300 hover:text-red-200",disabled:ue,onClick:()=>{M(F.name,F.name,F.scope||void 0,e??void 0)},title:`卸载 ${F.name}`,children:u.jsx(Si,{className:"size-3.5"})})]})]},UQ(F.name,F.scope))})}):u.jsx("p",{className:"text-xs text-text-muted",children:"正在等待诊断结果..."})]})]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"flex-1",children:u.jsx(qKe,{value:t,onChange:n,placeholder:"搜索 MCP 服务器..."})}),u.jsxs(Kl,{value:L,onValueChange:F=>q(F),children:[u.jsx(ul,{className:"w-36",children:u.jsx(Jl,{})}),u.jsx(dl,{children:LDn.map(F=>u.jsx(Ui,{value:F.value,children:F.label},F.value))})]})]}),Z.length>0&&u.jsx("div",{className:"flex flex-col gap-1",children:Z.map((F,W)=>u.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-xs text-amber-400",children:[u.jsx(qn,{className:"size-3.5 shrink-0"}),F]},W))}),G&&ie.length===0&&u.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-3",children:Array.from({length:6},(F,W)=>u.jsxs("div",{className:"skeleton-card flex flex-col gap-2 rounded-lg border border-border p-4",style:{animationDelay:`${W*80}ms`},children:[u.jsxs("div",{className:"flex items-start gap-2.5",children:[u.jsx("div",{className:"size-9 rounded-lg bg-surface-raised"}),u.jsxs("div",{className:"flex-1 space-y-1.5",children:[u.jsx("div",{className:"h-4 w-32 rounded bg-surface-raised"}),u.jsx("div",{className:"h-3 w-16 rounded-full bg-surface-raised"})]})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx("div",{className:"h-3 w-full rounded bg-surface-raised"}),u.jsx("div",{className:"h-3 w-2/3 rounded bg-surface-raised"})]}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("div",{className:"h-5 w-12 rounded-full bg-surface-raised"}),u.jsx("div",{className:"h-7 w-16 rounded bg-surface-raised"})]})]},W))}),m&&!ne&&u.jsx("div",{className:"rounded-md border border-red-500/30 bg-red-500/5 p-4 text-sm text-red-400",children:m}),V&&(V.includes(xPn)?u.jsxs("div",{className:"flex items-start gap-3 rounded-md border border-amber-500/30 bg-amber-500/5 px-4 py-3",children:[u.jsx(qn,{className:"mt-0.5 size-4 shrink-0 text-amber-400"}),u.jsxs("div",{children:[u.jsx("p",{className:"text-sm font-medium text-amber-300",children:N?.flavor==="agent_teams_orchestrator"?`${ge} not available`:`${ge} not installed`}),u.jsxs("p",{className:"mt-0.5 text-xs text-text-muted",children:["MCP health checks require ",ge,". Go to the Dashboard to install or repair it."]})]})]}):u.jsx("div",{className:"rounded-md border border-red-500/30 bg-red-500/5 p-4 text-sm text-red-400",children:V})),!G&&ie.length===0&&u.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-sm border border-dashed border-border px-8 py-16",children:[u.jsx("div",{className:"flex size-10 items-center justify-center rounded-lg border border-border bg-surface-raised",children:ne?u.jsx($i,{className:"size-5 text-text-muted"}):u.jsx(uU,{className:"size-5 text-text-muted"})}),u.jsx("p",{className:"text-sm text-text-secondary",children:ne?"没有找到服务器":"暂无 MCP 服务器"}),u.jsx("p",{className:"text-xs text-text-muted",children:ne?"试试其他搜索词":"稍后再回来查看新服务器"})]}),ie.length>0&&u.jsx("div",{className:"mcp-servers-grid grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-3",children:ie.map(F=>u.jsx(QDn,{server:F,isInstalled:se(F),installedEntry:Te(F),installedEntries:he(F),diagnostic:ee(F),diagnosticsLoading:A,onClick:a,cliStatus:N,cliStatusLoading:j},F.id))}),!ne&&f&&u.jsx("div",{className:"flex justify-center py-4",children:u.jsx(Xe,{variant:"outline",size:"sm",disabled:h,onClick:()=>void O(f),children:"Load more"})}),u.jsx(DDn,{server:J,isInstalled:J?se(J):!1,installedEntry:J?Te(J):null,installedEntries:J?he(J):[],diagnostic:J?ee(J):null,diagnosticsLoading:A,projectPath:e,open:o!==null,onClose:()=>a(null),cliStatus:N,cliStatusLoading:j})]})},UP=[{rootKind:"hermit",directoryName:".hermit",segments:[".hermit","skills"],audience:"shared"},{rootKind:"claude",directoryName:".claude",segments:[".claude","skills"],audience:"shared"},{rootKind:"cursor",directoryName:".cursor",segments:[".cursor","skills"],audience:"shared"},{rootKind:"agents",directoryName:".agents",segments:[".agents","skills"],audience:"shared"},{rootKind:"codex",directoryName:".codex",segments:[".codex","skills"],audience:"codex"}];function HKe(e){return UP.find(t=>t.rootKind===e)}function _ee(e){return HKe(e).directoryName}function ZKe(e){return HKe(e).audience}function Jj(e){return e==="hermit"?"Hermit 管理":ZKe(e)==="codex"?"Codex 专用":"共享"}function Iwe(e,t){return ZKe(e)==="shared"||t==="codex"}var KKe="AlertDialog",[UDn]=sp(KKe,[mGe]),Wm=mGe(),JKe=e=>{const{__scopeAlertDialog:t,...n}=e,r=Wm(t);return u.jsx(aae,{...r,...n,modal:!0})};JKe.displayName=KKe;var zDn="AlertDialogTrigger",BDn=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Wm(n);return u.jsx(Ubn,{...s,...r,ref:t})});BDn.displayName=zDn;var FDn="AlertDialogPortal",eJe=e=>{const{__scopeAlertDialog:t,...n}=e,r=Wm(t);return u.jsx(lae,{...r,...n})};eJe.displayName=FDn;var YDn="AlertDialogOverlay",tJe=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Wm(n);return u.jsx(k3,{...s,...r,ref:t})});tJe.displayName=YDn;var bv="AlertDialogContent",[VDn,qDn]=UDn(bv),WDn=_Ae("AlertDialogContent"),nJe=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...s}=e,i=Wm(n),o=g.useRef(null),a=ts(t,o),c=g.useRef(null);return u.jsx(Dbn,{contentName:bv,titleName:rJe,docsSlug:"alert-dialog",children:u.jsx(VDn,{scope:n,cancelRef:c,children:u.jsxs(C3,{role:"alertdialog",...i,...s,ref:a,onOpenAutoFocus:xn(s.onOpenAutoFocus,l=>{l.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:l=>l.preventDefault(),onInteractOutside:l=>l.preventDefault(),children:[u.jsx(WDn,{children:r}),u.jsx(HDn,{contentRef:o})]})})})});nJe.displayName=bv;var rJe="AlertDialogTitle",sJe=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Wm(n);return u.jsx(cae,{...s,...r,ref:t})});sJe.displayName=rJe;var iJe="AlertDialogDescription",oJe=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Wm(n);return u.jsx(uae,{...s,...r,ref:t})});oJe.displayName=iJe;var GDn="AlertDialogAction",aJe=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Wm(n);return u.jsx(dae,{...s,...r,ref:t})});aJe.displayName=GDn;var lJe="AlertDialogCancel",cJe=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:s}=qDn(lJe,n),i=Wm(n),o=ts(t,s);return u.jsx(dae,{...i,...r,ref:o})});cJe.displayName=lJe;var HDn=({contentRef:e})=>{const t=`\`${bv}\` requires a description for the component to be accessible for screen reader users.
1649
+ 请展开下面的 **CLI 日志** 查看可读诊断。`:null}const WQn=({title:e,message:t,messageSeverity:n,tone:r="default",defaultLiveOutputOpen:s=!0,defaultLogsOpen:i,currentStepIndex:o,errorStepIndex:a,loading:c=!1,onCancel:l,successMessage:d,successMessageSeverity:p="success",onDismiss:f,startedAt:h,pid:m,cliLogsTail:O,assistantOutput:_,launchDiagnostics:b,surface:y="raised",className:x})=>{const S=VQn(h,c),[v,T]=g.useState(()=>i??!1),[E,w]=g.useState(!1),[P,k]=g.useState(s),C=g.useRef(null),M=r==="error",I=qQn(_,M),$=b?.filter(R=>R.severity==="warning"||R.severity==="error")??[];return g.useEffect(()=>{P&&C.current&&(C.current.scrollTop=C.current.scrollHeight)},[_,P]),g.useEffect(()=>{k(s)},[s]),g.useEffect(()=>{i!==void 0&&T(i)},[i]),g.useEffect(()=>{M&&O&&(T(!0),k(!1))},[M,O]),u.jsxs("div",{className:at(y==="flat"?"rounded-none border-0 bg-transparent p-0":"rounded-md border border-[var(--color-border)] bg-[var(--color-surface-raised)] px-3 py-2",M&&"border-red-500/40 bg-red-500/10",x),children:[d?u.jsxs("div",{className:"mb-1.5 flex items-center gap-2",children:[p==="warning"?u.jsx(qn,{size:14,className:"shrink-0 text-amber-400"}):p==="info"?u.jsx(Ks,{size:14,className:"shrink-0 text-sky-400"}):u.jsx(pl,{size:14,className:"shrink-0 text-[var(--step-done-text)]"}),u.jsx("p",{className:at("flex-1 text-xs",p==="warning"?"text-amber-400":p==="info"?"text-sky-400":"text-[var(--step-success-text)]"),children:d}),f?u.jsx(Xe,{variant:"ghost",size:"sm",className:"size-6 shrink-0 p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text)]",onClick:f,children:u.jsx(Ar,{size:12})}):null]}):f?u.jsx("div",{className:"flex justify-end",children:u.jsx(Xe,{variant:"ghost",size:"sm",className:"size-6 shrink-0 p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text)]",onClick:f,children:u.jsx(Ar,{size:12})})}):null,u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[c?u.jsx(Ht,{className:"size-3.5 shrink-0 animate-spin text-[var(--color-text-muted)]"}):null,u.jsx("p",{className:"text-xs font-medium text-[var(--color-text)]",children:e}),S!==null?u.jsxs("span",{className:"text-[10px] tabular-nums text-[var(--color-text-muted)]",children:["已运行 ",S]}):null,m!==void 0?u.jsxs("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:["PID ",m]}):null]}),l?u.jsx(Xe,{variant:"outline",size:"sm",className:"h-6 shrink-0 px-2 text-xs",onClick:l,children:"取消"}):null]}),t?u.jsx("p",{className:at("mt-1.5 text-xs",M||n==="error"?"text-red-400":n==="warning"?"text-amber-400":n==="info"?"text-sky-400":"text-[var(--color-text-muted)]"),children:t}):null,u.jsx("div",{className:"mt-2 px-2",children:u.jsx(WZe,{steps:FQn,currentIndex:o,errorIndex:a})}),$.length>0?u.jsxs("div",{className:"mt-2",children:[u.jsxs("button",{type:"button",className:"flex items-center gap-1 text-[11px] text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:()=>w(R=>!R),children:[E?u.jsx(Dr,{size:12}):u.jsx(jn,{size:12}),"诊断"]}),E?u.jsx("div",{className:"mt-1 space-y-1 rounded border border-[var(--color-border)] bg-[var(--color-surface)] p-2",children:$.map(R=>u.jsxs("div",{className:"text-[11px]",children:[u.jsx("div",{className:at(R.severity==="error"?"text-red-400":R.severity==="warning"?"text-amber-400":"text-[var(--color-text-secondary)]"),children:R.label}),R.detail?u.jsx("div",{className:"mt-0.5 text-[10px] text-[var(--color-text-muted)]",children:R.detail}):null]},R.id))}):null]}):null,u.jsxs("div",{className:"mt-2",children:[u.jsxs("button",{type:"button",className:"flex items-center gap-1 text-[11px] text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:()=>k(R=>!R),children:[P?u.jsx(Dr,{size:12}):u.jsx(jn,{size:12}),"实时输出"]}),P?u.jsx("div",{ref:C,className:at("mt-1 h-40 overflow-y-auto rounded border border-[var(--color-border)] bg-[var(--color-surface)] p-2",M&&"border-red-500/40"),children:I?u.jsx(ri,{content:I,bare:!0,maxHeight:"max-h-none"}):u.jsx("p",{className:at("text-[11px]",M?"text-[var(--step-error-text-dim)]":"text-[var(--color-text-muted)]"),children:"暂无输出。"})}):null]}),O?u.jsxs("div",{className:"mt-2",children:[u.jsxs("button",{type:"button",className:"flex items-center gap-1 text-[11px] text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:()=>T(R=>!R),children:[v?u.jsx(Dr,{size:12}):u.jsx(jn,{size:12}),"CLI 日志"]}),v?u.jsx(JZe,{cliLogsTail:O,order:"newest-first",className:"mt-1"}):null]}):null]})};function eKe(e){const{progress:t,cancelProvisioning:n,cancelCurrentProvisioning:r,teamMembers:s,memberSpawnStatuses:i,memberSpawnSnapshot:o}=le(Et(c=>({progress:wf(c,e),cancelProvisioning:c.cancelProvisioning,cancelCurrentProvisioning:c.cancelCurrentProvisioning,teamMembers:$se(c,e),memberSpawnStatuses:c.memberSpawnStatusesByTeam[e],memberSpawnSnapshot:c.memberSpawnSnapshotsByTeam[e]})));return{presentation:g.useMemo(()=>Sle({progress:t,members:s,memberSpawnStatuses:i,memberSpawnSnapshot:o}),[o,i,t,s]),cancelProvisioning:n,cancelCurrentProvisioning:r,runInstanceKey:t?`${e}:${t.runId}:${t.startedAt}`:null}}const tKe=g.memo(function({teamName:t,surface:n="flat",dismissible:r=!1,className:s,defaultLogsOpen:i}){const{presentation:o,cancelProvisioning:a,cancelCurrentProvisioning:c,runInstanceKey:l}=eKe(t),[d,p]=g.useState(!1),f=g.useRef(-1);if(g.useEffect(()=>{p(!1)},[l]),!o||d)return null;o.currentStepIndex>=0&&!o.isFailed&&(f.current=o.currentStepIndex);const h=o.isActive||o.hasMembersStillJoining,m=u.jsx(WQn,{title:o.panelTitle,message:o.panelMessage,messageSeverity:o.panelMessageSeverity,tone:o.panelTone,surface:n,currentStepIndex:o.currentStepIndex,errorStepIndex:o.isFailed?f.current>=0?f.current:0:void 0,loading:h,startedAt:o.progress.startedAt,pid:o.progress.pid,cliLogsTail:o.progress.cliLogsTail,assistantOutput:o.progress.assistantOutput,launchDiagnostics:o.progress.launchDiagnostics,defaultLiveOutputOpen:o.defaultLiveOutputOpen,defaultLogsOpen:i,onCancel:o.canCancel&&(c??a)?()=>{(c??a)?.(t,o.progress.runId)}:null,successMessage:o.successMessage,successMessageSeverity:o.successMessageSeverity,onDismiss:r&&o.isReady?()=>{p(!0)}:null,className:o.isFailed?void 0:s},o.progress.runId);return o.isFailed?u.jsxs("div",{className:at("space-y-2",s),children:[u.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-red-500/40 bg-red-500/10 px-3 py-2",children:[u.jsx("p",{className:"flex-1 text-xs text-[var(--step-error-text)]",children:o.progress.message}),r?u.jsx(Xe,{variant:"outline",size:"sm",className:"h-6 shrink-0 border-red-500/40 px-2 text-xs text-[var(--step-error-text)] hover:bg-red-500/10",onClick:()=>p(!0),children:u.jsx(Ar,{size:12})}):null]}),m]}):m}),GQn=lie.map(e=>({key:e.key,label:e.label})),HQn={"--stepper-done":"#22c55e","--stepper-done-glow":"rgba(34, 197, 94, 0.24)","--stepper-current":"#22c55e","--stepper-current-ring":"rgba(34, 197, 94, 0.18)","--stepper-pending":"rgba(148, 163, 184, 0.08)","--stepper-pending-text":"#cbd5e1","--stepper-pending-border":"rgba(148, 163, 184, 0.2)","--stepper-line":"rgba(148, 163, 184, 0.14)","--stepper-line-done":"#22c55e","--stepper-label":"#94a3b8","--stepper-label-active":"#e2e8f0","--stepper-error":"#ef4444","--stepper-error-glow":"rgba(239, 68, 68, 0.22)","--stepper-label-error":"#fca5a5"};function ZQn(e){return e!=null&&(e.isActive||e.isFailed)}const KQn=({teamName:e,enabled:t=!0})=>{const{presentation:n,runInstanceKey:r}=eKe(e),s=g.useRef(-1),[i,o]=g.useState(!1),a=t&&ZQn(n),c=n?.isFailed?s.current>=0?s.current:0:void 0;g.useEffect(()=>{o(!1),s.current=-1},[r,e]),g.useEffect(()=>{n&&!n.isFailed&&n.currentStepIndex>=0&&(s.current=n.currentStepIndex)},[n]);const l=g.useMemo(()=>[n?.compactTitle,n?.compactDetail].filter(Boolean).join(" - ")||"Open launch details",[n?.compactDetail,n?.compactTitle]);return!a||!n?null:u.jsxs(u.Fragment,{children:[u.jsxs("button",{type:"button",className:"focus-visible:ring-white/18 w-full touch-none select-none rounded-xl bg-transparent px-1 py-0.5 text-left text-slate-100 transition-opacity hover:opacity-95 focus-visible:outline-none focus-visible:ring-1",onClick:()=>o(!0),onMouseDown:d=>d.preventDefault(),onDragStart:d=>d.preventDefault(),"aria-label":l,children:[u.jsx("div",{className:"px-1 py-0.5",style:HQn,children:u.jsx(WZe,{steps:GQn,currentIndex:n.currentStepIndex,errorIndex:c,className:"w-full origin-top scale-[0.88]"})}),u.jsx("span",{className:"sr-only",children:l})]}),u.jsx(Os,{open:i,onOpenChange:o,children:u.jsxs(ls,{className:"w-[min(1120px,92vw)] max-w-5xl p-0",children:[u.jsxs(gs,{className:"sr-only",children:[u.jsx(cs,{children:"启动详情"}),u.jsx(Ti,{children:"查看团队启动进度、实时输出和 CLI 日志。"})]}),u.jsx("div",{className:"max-h-[85vh] overflow-y-auto p-4",children:u.jsx(tKe,{teamName:e,surface:"flat",defaultLogsOpen:!0})})]})})]})};function JQn(e,t){if(t.relatedTaskId)return[{taskId:t.relatedTaskId,displayId:t.relatedTaskDisplayId??t.relatedTaskId.slice(0,8),teamName:e}]}function e2n(e){const t=e.preview?.trim();return t||(e.kind==="task_assign"&&e.relatedTaskDisplayId?`Task ${e.relatedTaskDisplayId} assigned`:e.kind==="task_comment"&&e.relatedTaskDisplayId?`${e.relatedTaskDisplayId} updated`:`${e.sourceLabel} -> ${e.destinationLabel}`)}function t2n(e){const t=e.preview?.trim();switch(e.kind){case"task_assign":return`New task assigned to you: ${e.relatedTaskDisplayId??e.relatedTaskId??"task"}${t?` - ${t}`:""}`;case"task_comment":return t??`${e.sourceLabel} added a comment`;case"review_request":return t??`Review requested by ${e.sourceLabel}`;case"review_response":return t??`Review response from ${e.sourceLabel}`;case"inbox_message":default:return t??`${e.sourceLabel} -> ${e.destinationLabel}`}}function n2n(e,t){const n=t.kind==="task_comment"?"task_comment_notification":"default",r=JQn(e,t);return{from:t.sourceLabel,to:t.destinationLabel,text:t2n(t),timestamp:new Date(t.updatedAt*1e3).toISOString(),read:!0,summary:e2n(t),color:t.color,messageId:`graph-handoff:${t.key}`,source:"inbox",messageKind:n,taskRefs:r}}const Ewe=Pd.width,r2n=72,s2n=10,i2n=({teamName:e,getTransientHandoffSnapshot:t=()=>({cards:[],time:0}),getCameraZoom:n=()=>1,worldToScreen:r,getNodeWorldPosition:s=()=>null,focusNodeIds:i,focusEdgeIds:o,enabled:a=!0})=>{const c=g.useRef(null),l=g.useRef(new Map),d=g.useRef(""),[p,f]=g.useState([]),{teamData:h,teams:m}=XN(e),O=g.useMemo(()=>QN(h?.members),[h?.members]),{teamNames:_,teamColorByName:b}=Lle(m);g.useEffect(()=>{d.current="",f([])},[e]),g.useLayoutEffect(()=>{if(!a){f([]);return}let x=0;const S=()=>{const v=t({focusNodeIds:i,focusEdgeIds:o}),T=v.cards.filter(k=>k.anchorKind==="lead"||k.anchorKind==="member"),E=T.map(k=>`${k.key}:${k.count}:${k.updatedAt}:${k.anchorNodeId}`).join("|");E!==d.current&&(d.current=E,f(T));const w=c.current;if(w&&r){const k=r(0,0),C=Math.max(n(),.001);w.style.transform=`translate(${Math.round(k.x)}px, ${Math.round(k.y)}px) scale(${C.toFixed(3)})`}const P=new Map;for(const k of T){const C=l.current.get(k.key);if(!C)continue;const M=s(k.anchorNodeId),I=Y7e(k,v.time);if(!M||!r||I<=.001){C.style.opacity="0";continue}const $=P.get(k.anchorNodeId)??0;P.set(k.anchorNodeId,$+1);const R=$*(r2n*.34+s2n),N=.94+I*.06;C.style.left=`${Math.round(M.x)}px`,C.style.top=`${Math.round(M.y)}px`,C.style.opacity=String(I),C.style.transform=`translate(-50%, calc(-50% - ${R.toFixed(1)}px)) scale(${N.toFixed(3)})`}x=window.requestAnimationFrame(S)};return S(),()=>{window.cancelAnimationFrame(x)}},[a,o,i,n,s,t,r]);const y=g.useMemo(()=>p.map((x,S)=>({card:x,message:n2n(e,x),zebraShade:S%2===1})),[p,e]);return!a||!h||p.length===0?null:u.jsx("div",{ref:c,className:"pointer-events-none absolute left-0 top-0 z-[9] origin-top-left select-none",children:y.map(({card:x,message:S,zebraShade:v})=>u.jsx("div",{ref:T=>{l.current.set(x.key,T)},className:"pointer-events-none absolute z-[9] origin-center opacity-0 transition-opacity duration-150 ease-out",style:{width:`${Ewe}px`,maxWidth:`${Ewe}px`},onDragStart:T=>{T.preventDefault()},children:u.jsx(VZe,{message:S,teamName:e,messageContext:O,teamNames:_,teamColorByName:b,zebraShade:v,className:"pointer-events-none drop-shadow-[0_0_22px_rgba(94,234,212,0.12)]"})},x.key))})},o2n=g.lazy(()=>Me(()=>import("./TeamGraphOverlay-C6fVnVBE.js"),__vite__mapDeps([60,1])).then(e=>({default:e.TeamGraphOverlay}))),a2n=({teamName:e,isActive:t=!0,isPaneFocused:n=!1})=>{const r=bMn(e),{openTeamPage:s,commitOwnerSlotDrop:i,commitOwnerGridOrderDrop:o,setLayoutMode:a}=yMn(e),[c,l]=g.useState(!1),{sidebarVisible:d,toggleSidebarVisible:p}=_Mn(),{dialog:f,openCreateTaskDialog:h}=OMn(e),m=g.useCallback(M=>window.dispatchEvent(new CustomEvent("graph:open-task",{detail:{teamName:e,taskId:M}})),[e]),O=g.useCallback(M=>window.dispatchEvent(new CustomEvent("graph:send-message",{detail:{teamName:e,memberName:M}})),[e]),_=g.useCallback((M,I)=>window.dispatchEvent(new CustomEvent("graph:open-profile",{detail:{teamName:e,memberName:M,...I}})),[e]),b=g.useCallback(()=>{h("")},[h]),y=g.useCallback(M=>I=>window.dispatchEvent(new CustomEvent(`graph:${M}`,{detail:{teamName:e,taskId:I}})),[e]),x=g.useMemo(()=>y("start-task"),[y]),S=g.useMemo(()=>y("complete-task"),[y]),v=g.useMemo(()=>y("approve-task"),[y]),T=g.useMemo(()=>y("request-review"),[y]),E=g.useMemo(()=>y("request-changes"),[y]),w=g.useMemo(()=>y("cancel-task"),[y]),P=g.useMemo(()=>y("move-back-to-done"),[y]),k=g.useMemo(()=>y("delete-task"),[y]),C={onNodeDoubleClick:g.useCallback(M=>{M.kind==="task"?m(M.taskId):M.kind==="member"&&_(M.memberName)},[m,_]),onSendMessage:O,onOpenTaskDetail:m,onOpenMemberProfile:g.useCallback(M=>{_(M)},[_])};return u.jsxs("div",{className:"flex size-full overflow-hidden",style:{background:"#050510"},children:[d?u.jsx(cMn,{teamName:e,surface:"graph-tab",isActive:t,isFocused:n}):null,u.jsx("div",{className:"min-w-0 flex-1",children:u.jsx(KIn,{data:r,events:C,className:"team-graph-view size-full",suspendAnimation:!t,isSurfaceActive:t,onRequestFullscreen:()=>l(!0),onOpenTeamPage:s,onCreateTask:b,onToggleSidebar:p,isSidebarVisible:d,renderTopToolbarContent:()=>u.jsx(KQn,{teamName:e,enabled:t}),onLayoutModeChange:a,onOwnerSlotDrop:i,onOwnerGridOrderDrop:o,renderHud:M=>{const I=M,{getViewportSize:$,focusNodeIds:R,filters:N}=I;return u.jsxs(u.Fragment,{children:[u.jsx(i2n,{teamName:e,getTransientHandoffSnapshot:I.getTransientHandoffSnapshot,getCameraZoom:I.getCameraZoom,worldToScreen:I.worldToScreen,getNodeWorldPosition:I.getNodeWorldPosition,focusNodeIds:R,focusEdgeIds:I.focusEdgeIds??null,enabled:t}),u.jsx(bQn,{teamName:e,nodes:r.nodes,getActivityWorldRect:I.getActivityWorldRect,getCameraZoom:I.getCameraZoom,worldToScreen:I.worldToScreen,getNodeWorldPosition:I.getNodeWorldPosition,getViewportSize:$,focusNodeIds:R,enabled:t&&(N?.showActivity??!0),onOpenTaskDetail:m,onOpenMemberProfile:_})]})},renderEdgeOverlay:({edge:M,sourceNode:I,targetNode:$,onClose:R,onSelectNode:N})=>u.jsx(yQn,{teamName:e,edge:M,sourceNode:I,targetNode:$,onClose:R,onSelectNode:N,onOpenTaskDetail:m}),renderOverlay:({node:M,onClose:I})=>u.jsx($Qn,{node:M,teamName:e,onClose:I,onSendMessage:O,onOpenTaskDetail:m,onOpenMemberProfile:_,onCreateTask:h,onStartTask:x,onCompleteTask:S,onApproveTask:v,onRequestReview:T,onRequestChanges:E,onCancelTask:w,onMoveBackToDone:P,onDeleteTask:k})})}),f,c&&u.jsx(g.Suspense,{fallback:null,children:u.jsx(o2n,{teamName:e,onClose:()=>l(!1),sidebarVisible:d,onToggleSidebar:p,onSendMessage:O,onOpenTaskDetail:m,onOpenMemberProfile:_})})]})};function cee(e){return/^[A-Za-z]:[/\\]/.test(e)||e.startsWith("\\\\")||e.startsWith("//")}function l2n(e){return e.includes("\\")&&!e.includes("/")?"\\":"/"}function wwe(e,t){const n=l2n(e);return e.replace(/[/\\]$/,"")+n+t.replace(/[/\\]/g,n)}function XP(e,t,n=40){let r=e;if(t){const l=t.replace(/[/\\]$/,""),d=cee(r)||cee(l),p=d?r.toLowerCase():r,f=d?l.toLowerCase():l;(p.startsWith(f+"/")||p.startsWith(f+"\\"))&&(r=r.slice(l.length+1))}if(r=r.replace(/^\/Users\/[^/]+/,"~").replace(/^\/home\/[^/]+/,"~").replace(/^[A-Z]:\\Users\\[^\\]+/i,"~"),r.length<=n)return r;const s=r.includes("\\")?"\\":"/",i=r.split(s);let o=0;if((i[0]===""||i[0]==="~")&&(o=1),i.length-o<=3)return r;const a=i.slice(0,o+1).join(s),c=i.slice(-2).join(s);return`${a}${s}…${s}${c}`}function c2n(e){return(/^(\/Users\/[^/]+)/.exec(e)??/^(\/home\/[^/]+)/.exec(e)??/^([A-Z]:\\Users\\[^\\]+)/i.exec(e))?.[1]??null}function uee(e){const t=e.replace(/\\/g,"/");if(t.startsWith("/Users/")||t.startsWith("/home/")){const n=el(t);if(n.length>=2){const r=n.slice(2).join("/");return r?`~/${r}`:"~"}}if(u2n(e)){const n=el(t);if(n.length>=3){const r=n.slice(3).join("/");return r?`~/${r}`:"~"}}return t}function u2n(e){if(e.length<10)return!1;const t=e.charCodeAt(0);return(t>=65&&t<=90||t>=97&&t<=122)&&e[1]===":"&&e.slice(2,9).toLowerCase()==="\\users\\"}function Hj(e,t){let n=e;if((n.startsWith("~/")||n.startsWith("~\\"))&&t){const r=c2n(t);r&&(n=wwe(r,n.slice(2)))}return t&&!n.startsWith("/")&&!n.startsWith("~")&&!cee(n)&&(n=wwe(t,n)),n}const kwe=["anthropic","codex","gemini"];function d2n(e){return[...e].sort((t,n)=>kwe.indexOf(t)-kwe.indexOf(n))}function p2n(e,t){const n=e.associatedPaths.reduce((r,s)=>{const i=t.get(fr(s));return i?{pending:r.pending+i.pending,inProgress:r.inProgress+i.inProgress,completed:r.completed+i.completed}:r},{pending:0,inProgress:0,completed:0});return n.pending>0||n.inProgress>0||n.completed>0?n:void 0}function f2n(e,t){const n=new Set,r=[];for(const s of e.associatedPaths){const i=t.get(fr(s));if(i)for(const o of i)n.has(o.teamName)||(n.add(o.teamName),r.push(o))}return r.length>0?r:void 0}function h2n(e){const t=[e.primaryPath,...e.associatedPaths].filter(Boolean),n=Array.from(new Set(t));if(!(n.length<=1))return{badgeLabel:`${n.length} 个路径`,description:"此卡片合并了相关 worktree 和项目路径的最近活动。",paths:n.map((r,s)=>({label:s===0?"主路径":`相关路径 ${s}`,fullPath:r}))}}function m2n({projects:e,taskCountsByProject:t,activeTeamsByProject:n,tasksLoading:r}){return e.map(s=>({id:s.id,project:s,name:s.name,formattedPath:uee(s.primaryPath),lastActivityLabel:Ub(new Date(s.mostRecentActivity),{addSuffix:!0,locale:HXe}),providerIds:d2n(s.providerIds),primaryBranch:s.primaryBranch,taskCounts:p2n(s,t),tasksLoading:r,activeTeams:f2n(s,n),additionalPathCount:Math.max(0,s.associatedPaths.length-1),pathSummary:h2n(s)}))}function O2n({teams:e,aliveTeamNames:t,provisioningTeamNames:n,provisioningSnapshotByTeam:r}){const s=new Set([...t,...n]);if(s.size===0)return new Map;const i=new Set(e.map(l=>l.teamName)),o=n.filter(l=>!i.has(l)).map(l=>r[l]).filter(l=>!!l),a=new Map,c=o.length>0?[...e,...o]:e;for(const l of c){if(!l.projectPath||!s.has(l.teamName))continue;const d=fr(l.projectPath),p=a.get(d);p?p.push(l):a.set(d,[l])}return a}const nKe="tmp",g2n=`/${nKe}/`,_2n=`/private/${nKe}/`;function b2n(e){return e.trim().replace(/\\/g,"/").toLowerCase()}function y2n(e){const t=e.split("/").filter(Boolean);return t[t.length-1]??""}function x2n(e){return e.startsWith("/private/var/folders/")||e.startsWith("/var/folders/")||e.startsWith(_2n)||e.startsWith(g2n)||e.includes("/appdata/local/temp/")||e.includes("/appdata/locallow/temp/")}function Ul(e){const t=b2n(e??"");return t?t.includes("rendered_mcp_")||t.includes("rendered_mcp_config")||t.includes("/portable-mcp-live")?!0:y2n(t).startsWith("codex-agent-teams-appstyle-")&&x2n(t):!1}const rKe="recent-projects:open-history",dee="recent-projects:open-history-changed",S2n=1e3*60*60*48,v2n=120;function sKe(){return typeof window<"u"&&typeof window.localStorage<"u"}function iB(e){let t=e.trim().replace(/\\/g,"/");if(!t||Ul(t))return null;if(t!=="/"&&!/^[A-Za-z]:\/$/.test(t))for(;t.endsWith("/");)t=t.slice(0,-1);return t}function iKe(e){return e.toLowerCase()}function oKe(){if(!sKe())return{version:1,entries:[]};try{const e=window.localStorage.getItem(rKe);if(!e)return{version:1,entries:[]};const t=JSON.parse(e);return{version:1,entries:(Array.isArray(t.entries)?t.entries:[]).filter(r=>!!r&&typeof r.path=="string"&&typeof r.openedAt=="number"&&Number.isFinite(r.openedAt)).map(r=>({path:r.path,openedAt:r.openedAt}))}}catch{return{version:1,entries:[]}}}function T2n(e){const t=new Map;for(const n of e){const r=iB(n.path);r&&t.set(r,Math.max(t.get(r)??0,n.openedAt))}return Array.from(t.entries()).map(([n,r])=>({path:n,openedAt:r})).sort((n,r)=>r.openedAt-n.openedAt).slice(0,v2n)}function E2n(e){if(!sKe())return;const t={version:1,entries:T2n(e)};try{window.localStorage.setItem(rKe,JSON.stringify(t)),window.dispatchEvent(new CustomEvent(dee))}catch{}}function w2n(){const e=new Map,t=new Map;for(const n of oKe().entries){const r=iB(n.path);if(!r)continue;e.set(r,Math.max(e.get(r)??0,n.openedAt));const s=iKe(r),i=t.get(s);i?(i.openedAt=Math.max(i.openedAt,n.openedAt),i.exactPaths.add(r)):t.set(s,{openedAt:n.openedAt,exactPaths:new Set([r])})}return{exact:e,folded:t}}function k2n(e,t){const n=iB(t);if(!n)return 0;const r=e.exact.get(n);if(r!=null)return r;const s=e.folded.get(iKe(n));return s?.exactPaths.size!==1?0:s.openedAt}function Cwe(e,t){return[t.primaryPath,...t.associatedPaths].reduce((n,r)=>Math.max(n,k2n(e,r)),0)}function Zj(e,t=Date.now()){const n=Array.from(new Set(e.map(s=>iB(s)).filter(s=>!!s)));if(n.length===0)return;const r=oKe().entries;E2n([...r,...n.map(s=>({path:s,openedAt:t}))])}function C2n(e,t=Date.now()){const n=w2n(),r=s=>s>0&&t-s<=S2n;return[...e].sort((s,i)=>{const o=Cwe(n,s),a=Cwe(n,i),c=r(o),l=r(a);return c!==l?c?-1:1:c&&l&&o!==a?a-o:s.mostRecentActivity!==i.mostRecentActivity?i.mostRecentActivity-s.mostRecentActivity:o!==a?a-o:s.name.localeCompare(i.name)})}function R2n(e){if(typeof window>"u")return()=>{};const t=()=>e();return window.addEventListener(dee,t),()=>{window.removeEventListener(dee,t)}}function aKe(e){return e?Array.isArray(e)?{projects:e,degraded:!1}:Array.isArray(e.projects)?{projects:e.projects,degraded:e.degraded===!0}:null:null}const P2n=15e3,$2n=3e4;let M2=null,pee=0,_w=null;function Q2(){const e=aKe(M2);if(!e)return null;M2!==e&&(M2=e);const t=e.degraded?$2n:P2n;return{payload:e,fetchedAt:pee,isStale:Date.now()-pee>t}}async function N2n(e,t){const n=t?.force??!1,r=Q2();if(!n&&r&&!r.isStale)return r.payload;if(_w)return _w;const s=e().then(i=>{const o=aKe(i);return M2=o,pee=Date.now(),o??{projects:[],degraded:!0}}).finally(()=>{_w===s&&(_w=null)});return _w=s,s}function Rwe(e,t){const n=new Set(t.map(r=>fr(r)));for(const r of e)for(const s of r.worktrees)if(n.has(fr(s.path)))return{repoId:r.id,worktreeId:s.id};return null}function lKe(e){if(!e)return"";const t=e.replace(/[/\\]/g,"-"),n=/^([a-zA-Z]):-(.*)$/.exec(t);return n?`${n[1].toUpperCase()}--${n[2]}`:t.startsWith("-")?t:`-${t}`}function A2n(e){const t=lKe(e),n=e.split(/[/\\]/).filter(Boolean).pop()??e,r=Date.now();return{id:t,identity:null,worktrees:[{id:t,path:e,name:n,isMainWorktree:!0,source:"unknown",sessions:[],totalSessions:0,createdAt:r}],name:n,mostRecentSession:void 0,totalSessions:0}}const bw=Hi("Feature:RecentProjects:open");function I2n(){const{repositoryGroups:e,fetchRepositoryGroups:t,openTeamsTab:n}=le(Et(l=>({repositoryGroups:l.repositoryGroups,fetchRepositoryGroups:l.fetchRepositoryGroups,openTeamsTab:l.openTeamsTab}))),r=g.useCallback(l=>{le.setState(kU(l.repoId,l.worktreeId)),le.getState().fetchSessionsInitial(l.worktreeId),n()},[n]),s=g.useCallback(async(l,d)=>{const f=(d.length>0?d:[l]).filter(b=>!Ul(b));if(f.length===0){bw.warn("Skipped ephemeral recent project path",{path:l});return}const h=Rwe(e,f);if(h){r(h);return}await t();const m=le.getState().repositoryGroups,O=Rwe(m,f);if(O){r(O);return}if(Ul(l)){bw.warn("Skipped adding ephemeral recent project path",{path:l});return}await K.config.addCustomProjectPath(l),le.setState(b=>({repositoryGroups:[A2n(l),...b.repositoryGroups]}));const _=lKe(l);r({repoId:_,worktreeId:_})},[t,r,e]),i=g.useCallback(async(l,d)=>{if(l.type==="existing-worktree"){r({repoId:l.repositoryId,worktreeId:l.worktreeId});return}await s(l.path,d)},[r,s]),o=g.useCallback(async l=>{try{await i(l.openTarget,l.associatedPaths),Zj([l.primaryPath,...l.associatedPaths])}catch(d){bw.error("Failed to open recent project",d)}},[i]),a=g.useCallback(async l=>{try{await K.openPath(l,l)}catch(d){bw.error("Failed to open project path",d)}},[]),c=g.useCallback(async()=>{try{const d=(await K.config.selectFolders())[0];if(!d)return;await s(d,[d]),Zj([d])}catch(l){bw.error("Failed to select project folder",l)}},[s]);return{openRecentProject:o,openProjectPath:a,selectProjectFolder:c}}const M2n=11,Q2n=8,D2n=3e4,L2n=12e4,j2n=3,X2n=8e3;function U2n(e){return new Promise((t,n)=>{const r=window.setTimeout(()=>{n(new Error("最近项目加载超时,请稍后重试。"))},X2n);e.then(s=>{window.clearTimeout(r),t(s)},s=>{window.clearTimeout(r),n(s)})})}function z2n(e,t){if(!t)return!0;const n=t.trim().toLowerCase();return n?e.name.toLowerCase().includes(n)||e.primaryPath.toLowerCase().includes(n)||e.associatedPaths.some(r=>r.toLowerCase().includes(n))||e.primaryBranch?.toLowerCase().includes(n)===!0:!0}function B2n(e,t=M2n){const{globalTasks:n,globalTasksInitialized:r,globalTasksLoading:s,fetchAllTasks:i,teams:o,provisioningRuns:a,currentProvisioningRunIdByTeam:c,provisioningSnapshotByTeam:l}=le(Et(Y=>({globalTasks:Y.globalTasks,globalTasksInitialized:Y.globalTasksInitialized,globalTasksLoading:Y.globalTasksLoading,fetchAllTasks:Y.fetchAllTasks,teams:Y.teams,provisioningRuns:Y.provisioningRuns,currentProvisioningRunIdByTeam:Y.currentProvisioningRunIdByTeam,provisioningSnapshotByTeam:Y.provisioningSnapshotByTeam}))),d=g.useMemo(()=>Q2(),[]),{openRecentProject:p,openProjectPath:f,selectProjectFolder:h}=I2n(),[m,O]=g.useState(d?.payload.projects??[]),[_,b]=g.useState(d?.payload.degraded??!1),[y,x]=g.useState(d?.payload.degraded?1:0),[S,v]=g.useState(d==null),[T,E]=g.useState(null),[w,P]=g.useState(t),[k,C]=g.useState([]),[M,I]=g.useState(0),$=g.useRef(r),R=g.useRef(d?.payload.projects??[]),N=g.useMemo(()=>({currentProvisioningRunIdByTeam:c,provisioningRuns:a}),[c,a]),j=g.useMemo(()=>Object.keys(c).filter(Y=>My(N,Y)),[c,N]),Q=g.useMemo(()=>[...j].sort().join("\0"),[j]);g.useEffect(()=>{R.current=m},[m]);const U=g.useCallback(async Y=>{R.current.length>0||Q2()!=null||v(!0),E(null);try{const te=await U2n(N2n(()=>K.getDashboardRecentProjects(),Y));O(te.projects),b(te.degraded),x(G=>te.degraded?G+1:0)}catch(te){E(te instanceof Error?te.message:"最近项目加载失败")}finally{v(!1)}},[]);g.useEffect(()=>{const Y=Q2();Y&&!Y.isStale||U({force:Y!=null})},[U]),g.useEffect(()=>{if(!_)return;const Y=y<=j2n?D2n:L2n,ne=window.setTimeout(()=>{U({force:!0})},Y);return()=>{window.clearTimeout(ne)}},[y,_,U]),g.useEffect(()=>{if(m.length===0||$.current||r){$.current=$.current||r;return}$.current=!0,i()},[i,r,m.length]),g.useEffect(()=>{let Y=!1;return K.teams.aliveList().then(ne=>{Y||C(ne)}).catch(()=>{}),()=>{Y=!0}},[Q,o]),g.useEffect(()=>{e.trim()||P(t)},[t,e]),g.useEffect(()=>R2n(()=>I(Y=>Y+1)),[]);const A=g.useMemo(()=>Wxt(n),[n]),V=g.useMemo(()=>O2n({teams:o,aliveTeamNames:k,provisioningTeamNames:j,provisioningSnapshotByTeam:l}),[k,l,j,o]),z=g.useMemo(()=>m2n({projects:C2n(m),taskCountsByProject:A,activeTeamsByProject:V,tasksLoading:s}),[V,s,M,m,A]),L=g.useMemo(()=>z.filter(Y=>z2n(Y.project,e)),[z,e]);return{cards:g.useMemo(()=>e.trim()?L:L.slice(0,w),[L,e,w]),loading:S,error:T,canLoadMore:!e.trim()&&L.length>w,isElectron:!1,loadMore:()=>P(Y=>Y+Q2n),reload:U,openRecentProject:p,openProjectPath:f,selectProjectFolder:h}}const F2n=({card:e,onClick:t,onOpenPath:n})=>{const r=g.useMemo(()=>q9t(e.name),[e.name]),[s,i]=g.useState(!1);return u.jsxs("button",{onClick:t,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),className:"bg-surface/50 group relative flex min-h-[120px] flex-col overflow-hidden rounded-lg border border-l-[3px] border-border p-4 text-left transition-all duration-300 hover:border-border-emphasis hover:bg-surface-raised",style:{borderLeftColor:r.border,boxShadow:s?`inset 3px 0 12px -4px ${r.glow}`:void 0},children:[e.activeTeams&&e.activeTeams.length>0&&u.jsxs("span",{className:"absolute right-3 top-3 inline-flex size-2.5",children:[u.jsx("span",{className:"absolute inline-flex size-full animate-ping rounded-full bg-emerald-400 opacity-50"}),u.jsx("span",{className:"relative inline-flex size-2.5 rounded-full bg-emerald-500"})]}),u.jsxs("div",{className:"mb-1 flex items-center gap-2.5",children:[u.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-md border border-border bg-surface-overlay transition-colors duration-300 group-hover:border-border-emphasis",children:u.jsx(zv,{className:"size-4 transition-colors group-hover:text-text",style:{color:r.icon}})}),u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx("h3",{className:"min-w-0 truncate text-sm font-medium text-text transition-colors duration-200 group-hover:text-text",children:e.name}),e.pathSummary&&u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx("span",{className:"inline-flex shrink-0 items-center rounded-full bg-surface-overlay px-1.5 py-0.5 text-[9px] font-medium text-text-muted",children:e.pathSummary.badgeLabel})}),u.jsx(nt,{side:"bottom",align:"start",className:"max-w-sm",children:u.jsxs("div",{className:"space-y-2",children:[u.jsx("p",{className:"text-[11px] leading-relaxed text-text-secondary",children:e.pathSummary.description}),u.jsx("div",{className:"space-y-1.5",children:e.pathSummary.paths.map(o=>u.jsxs("div",{className:"space-y-0.5",children:[u.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-text-muted",children:o.label}),u.jsx("p",{className:"font-mono text-[11px] text-text",children:o.fullPath})]},`${o.label}:${o.fullPath}`))})]})})]})]}),u.jsx("div",{className:"mt-1 flex items-center gap-1.5",children:e.providerIds.map(o=>u.jsx("span",{className:"bg-surface-overlay/80 inline-flex items-center rounded-full border border-border p-1",title:o,children:u.jsx(kE,{providerId:o,className:"size-3.5"})},o))})]})]}),u.jsxs("div",{className:"flex w-full min-w-0 items-center gap-1 font-mono text-[10px] text-text-muted",children:[u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx("div",{role:"button",tabIndex:0,onClick:o=>{o.stopPropagation(),n()},onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),o.stopPropagation(),n())},className:"shrink-0 cursor-pointer rounded p-0.5 transition-colors hover:bg-white/5 hover:text-text-secondary",children:u.jsx(Bc,{className:"size-3"})})}),u.jsx(nt,{side:"bottom",children:"打开"})]}),u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx("span",{className:"truncate",children:e.formattedPath})}),u.jsx(nt,{side:"bottom",align:"start",children:u.jsx("p",{className:"font-mono text-[11px]",children:e.project.primaryPath})})]})]}),e.primaryBranch?u.jsxs("div",{className:"mb-auto mt-1 flex items-center gap-1.5 truncate",children:[u.jsx(b$,{className:"size-3 shrink-0 text-text-muted"}),u.jsx("span",{className:"truncate text-[10px] text-text-secondary",children:e.primaryBranch})]}):u.jsx("div",{className:"mb-auto"}),u.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[e.taskCounts&&(e.taskCounts.pending>0||e.taskCounts.inProgress>0||e.taskCounts.completed>0)&&u.jsxs(u.Fragment,{children:[e.taskCounts.inProgress>0&&u.jsxs("span",{className:"inline-flex items-center rounded-full bg-blue-500/15 px-1.5 py-0.5 text-[10px] font-medium text-blue-600 dark:text-blue-400",children:["进行中 ",e.taskCounts.inProgress]}),e.taskCounts.pending>0&&u.jsxs("span",{className:"inline-flex items-center rounded-full bg-yellow-500/15 px-1.5 py-0.5 text-[10px] font-medium text-yellow-400",children:["待处理 ",e.taskCounts.pending]}),e.taskCounts.completed>0&&u.jsxs("span",{className:"inline-flex items-center rounded-full bg-green-500/15 px-1.5 py-0.5 text-[10px] font-medium text-green-400",children:["已完成 ",e.taskCounts.completed]}),u.jsx("span",{className:"text-text-muted",children:"·"})]}),u.jsx("span",{className:"text-[10px] text-text-muted",children:e.lastActivityLabel})]}),e.tasksLoading?u.jsx("div",{className:"mt-2 w-full",children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("div",{className:"h-1.5 flex-1 animate-pulse overflow-hidden rounded-full bg-[var(--color-surface-raised)]"}),u.jsx("div",{className:"h-2.5 w-6 animate-pulse rounded bg-[var(--color-surface-raised)]"})]})}):e.taskCounts&&(()=>{const o=e.taskCounts.pending??0,a=e.taskCounts.inProgress??0,c=e.taskCounts.completed??0,l=o+a+c;if(l===0)return null;const d=Math.round(c/l*100);return u.jsx("div",{className:"mt-2 w-full space-y-1",children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("div",{className:"h-1.5 flex-1 overflow-hidden rounded-full bg-[var(--color-surface-raised)]",role:"progressbar","aria-valuenow":c,"aria-valuemin":0,"aria-valuemax":l,"aria-label":`任务完成 ${c}/${l}`,children:u.jsx("div",{className:"h-full rounded-full bg-emerald-500 transition-all duration-200",style:{width:`${d}%`}})}),u.jsxs("span",{className:"shrink-0 text-[10px] font-medium tracking-tight text-[var(--color-text-muted)]",children:[c,"/",l]})]})})})(),e.activeTeams&&e.activeTeams.length>0&&u.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 border-t border-border pt-2",children:[u.jsx(Io,{className:"size-3 shrink-0 text-emerald-400"}),e.activeTeams.map(o=>u.jsx("span",{className:"inline-flex items-center rounded-full bg-emerald-500/10 px-1.5 py-0.5 text-[9px] font-medium text-emerald-400",children:o.displayName},o.teamName))]})]})},Y2n=[60,66,50,55,75,45,40,65],V2n=[80,75,85,66,70,80,60,72],q2n=({searchQuery:e})=>{const{cards:t,loading:n,error:r,canLoadMore:s,isElectron:i,loadMore:o,reload:a,openRecentProject:c,openProjectPath:l}=B2n(e);return n?u.jsx("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-3 xl:grid-cols-4",children:Array.from({length:8}).map((d,p)=>u.jsxs("div",{className:"skeleton-card flex min-h-[120px] flex-col rounded-sm border border-border p-4",style:{animationDelay:`${p*80}ms`,backgroundColor:"var(--skeleton-base)"},children:[u.jsx("div",{className:"mb-3 size-8 rounded-sm",style:{backgroundColor:"var(--skeleton-base-light)"}}),u.jsx("div",{className:"mb-2 h-3.5 rounded-sm",style:{width:`${Y2n[p]}%`,backgroundColor:"var(--skeleton-base-light)"}}),u.jsx("div",{className:"mb-auto h-2.5 rounded-sm",style:{width:`${V2n[p]}%`,backgroundColor:"var(--skeleton-base-dim)"}}),u.jsxs("div",{className:"mt-3 flex gap-2",children:[u.jsx("div",{className:"h-2.5 w-16 rounded-sm",style:{backgroundColor:"var(--skeleton-base-dim)"}}),u.jsx("div",{className:"h-2.5 w-12 rounded-sm",style:{backgroundColor:"var(--skeleton-base-dim)"}})]})]},p))}):r&&t.length===0?u.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 rounded-sm border border-dashed border-border px-8 py-16",children:[u.jsx("div",{className:"mb-1 flex size-12 items-center justify-center rounded-sm border border-border bg-surface-raised",children:u.jsx(zv,{className:"size-6 text-text-muted"})}),u.jsxs("div",{className:"text-center",children:[u.jsx("p",{className:"mb-1 text-sm text-text-secondary",children:"项目加载失败"}),u.jsx("p",{className:"max-w-xl text-xs text-text-muted",children:r})]}),u.jsx("button",{onClick:()=>void a(),className:"rounded-sm border border-border bg-surface-raised px-3 py-1.5 text-xs text-text-secondary transition-colors hover:border-border-emphasis hover:text-text",children:"重试"})]}):t.length===0&&e.trim()?u.jsxs("div",{className:"flex flex-col items-center justify-center rounded-sm border border-dashed border-border px-8 py-16",children:[u.jsx("div",{className:"mb-4 flex size-12 items-center justify-center rounded-sm border border-border bg-surface-raised",children:u.jsx($i,{className:"size-6 text-text-muted"})}),u.jsx("p",{className:"mb-1 text-sm text-text-secondary",children:"未找到项目"}),u.jsxs("p",{className:"text-xs text-text-muted",children:["没有匹配“",e,"”的结果"]})]}):t.length===0?u.jsxs("div",{className:"flex flex-col items-center justify-center rounded-sm border border-dashed border-border px-8 py-16",children:[u.jsx("div",{className:"mb-4 flex size-12 items-center justify-center rounded-sm border border-border bg-surface-raised",children:u.jsx(zv,{className:"size-6 text-text-muted"})}),u.jsx("p",{className:"mb-1 text-sm text-text-secondary",children:"暂无最近项目"}),u.jsx("p",{className:"text-xs text-text-muted",children:"最近的 Claude 和 Codex 活动会显示在这里。"})]}):u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-3 xl:grid-cols-4",children:[!e.trim()&&i,t.map(d=>u.jsx(F2n,{card:d,onClick:()=>void c(d.project),onOpenPath:()=>void l(d.project.primaryPath)},d.id))]}),s&&u.jsx("div",{className:"flex justify-center",children:u.jsx(Xe,{variant:"outline",size:"sm",onClick:o,children:"加载更多"})})]})},Ble=typeof window<"u"&&window.navigator.userAgent.includes("Macintosh"),o8=Ble?"⌘":"Ctrl+",Pwe=Ble?"⇧":"Shift+";function Ig(e,t){return t?.shift?Ble?`${Pwe}${o8}${e}`:`${o8}${Pwe}${e}`:`${o8}${e}`}const W2n=["Claude Code","Cursor","Codex","Gemini","OpenCode","DeepSeek / IM"],G2n=["Feishu","Slack","Discord","DingTalk","WeCom","Telegram","Webhook / API"],H2n=({value:e,onChange:t})=>{const[n,r]=g.useState(!1),s=g.useRef(null),{openCommandPalette:i,selectedProjectId:o}=le(Et(a=>({openCommandPalette:a.openCommandPalette,selectedProjectId:a.selectedProjectId})));return g.useEffect(()=>{const a=c=>{(c.metaKey||c.ctrlKey)&&c.code==="KeyK"&&(c.preventDefault(),i())};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[i]),g.useLayoutEffect(()=>{const a=s.current;if(!a)return;a.focus({preventScroll:!0});const c=window.setTimeout(()=>{document.activeElement!==a&&a.focus({preventScroll:!0})},50);return()=>window.clearTimeout(c)},[]),u.jsx("div",{className:"relative w-full",children:u.jsxs("div",{className:`relative flex items-center gap-3 rounded-sm border bg-surface-raised px-4 py-3 transition-all duration-200 ${n?"border-zinc-500 shadow-[0_0_20px_rgba(255,255,255,0.04)] ring-1 ring-zinc-600/30":"border-border hover:border-zinc-600"} `,children:[u.jsx($i,{className:"size-4 shrink-0 text-text-muted"}),u.jsx("input",{ref:s,type:"text",value:e,onChange:a=>t(a.target.value),placeholder:"搜索项目...",className:"flex-1 bg-transparent text-sm text-text outline-none placeholder:text-text-muted",onFocus:()=>r(!0),onBlur:()=>r(!1)}),u.jsxs("button",{onClick:()=>i(),className:"flex shrink-0 items-center gap-1 transition-opacity hover:opacity-80",title:o?`搜索会话(${Ig("K")})`:`搜索项目(${Ig("K")})`,children:[u.jsx("kbd",{className:"flex h-5 items-center justify-center rounded border border-border bg-surface-overlay px-1.5 text-[10px] font-medium text-text-muted",children:u.jsx(N0,{className:"size-2.5"})}),u.jsx("kbd",{className:"flex size-5 items-center justify-center rounded border border-border bg-surface-overlay text-[10px] font-medium text-text-muted",children:"K"})]})]})})},Z2n=()=>{const[e,t]=g.useState(""),{openTeamsTab:n,openSettingsTab:r,teams:s,teamsLoading:i}=le(Et(a=>({openTeamsTab:a.openTeamsTab,openSettingsTab:a.openSettingsTab,teams:a.teams,teamsLoading:a.teamsLoading}))),o=e.trim().length===0&&!i&&s.length===0;return u.jsxs("div",{className:"relative flex-1 overflow-auto bg-surface",children:[u.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 h-[600px] bg-[radial-gradient(ellipse_80%_50%_at_50%_-20%,rgba(99,102,241,0.08),transparent)]","aria-hidden":"true"}),u.jsxs("div",{className:"relative mx-auto max-w-5xl px-8 py-12",children:[u.jsxs("section",{className:"mb-8 overflow-hidden rounded-xl border border-border bg-surface-raised",children:[u.jsxs("div",{className:"border-b border-border px-6 py-5",children:[u.jsxs("div",{className:"mb-2 inline-flex items-center gap-2 rounded-full border border-border bg-surface px-3 py-1 text-[11px] text-text-muted",children:[u.jsx(Qht,{className:"size-3.5"}),"一人公司优先"]}),u.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-text",children:"Hermit:一人公司的 AI 团队控制台"}),u.jsx("p",{className:"mt-2 text-sm text-text-secondary",children:"几乎覆盖所有主流 Harness,支持全渠道接入,把团队编排、消息协作、任务推进和运行状态放在同一个工作台。"})]}),u.jsxs("div",{className:"grid gap-4 px-6 py-5 md:grid-cols-3",children:[u.jsxs("div",{className:"rounded-lg border border-border bg-surface px-4 py-3",children:[u.jsxs("div",{className:"mb-2 inline-flex items-center gap-1.5 text-xs font-medium text-text-secondary",children:[u.jsx(imt,{className:"size-3.5"}),"Harness 覆盖"]}),u.jsx("p",{className:"text-xs text-text-muted",children:"几乎所有主流运行时都能接入统一团队控制台。"}),u.jsx("div",{className:"mt-3 flex flex-wrap gap-1.5",children:W2n.map(a=>u.jsx("span",{className:"rounded-md border border-border bg-surface-overlay px-2 py-1 text-[11px] text-text-secondary",children:a},a))})]}),u.jsxs("div",{className:"rounded-lg border border-border bg-surface px-4 py-3",children:[u.jsxs("div",{className:"mb-2 inline-flex items-center gap-1.5 text-xs font-medium text-text-secondary",children:[u.jsx(YIe,{className:"size-3.5"}),"渠道接入"]}),u.jsx("p",{className:"text-xs text-text-muted",children:"统一托管企业 IM、社区渠道和 Webhook/API,消息流和任务流自动对齐。"}),u.jsx("div",{className:"mt-3 flex flex-wrap gap-1.5",children:G2n.map(a=>u.jsx("span",{className:"rounded-md border border-border bg-surface-overlay px-2 py-1 text-[11px] text-text-secondary",children:a},a))})]}),u.jsxs("div",{className:"rounded-lg border border-border bg-surface px-4 py-3",children:[u.jsxs("div",{className:"mb-2 inline-flex items-center gap-1.5 text-xs font-medium text-text-secondary",children:[u.jsx(rc,{className:"size-3.5"}),"一人公司工作流"]}),u.jsx("p",{className:"text-xs text-text-muted",children:"你负责决策,Hermit 负责动态拉起子 agent、分发任务、跟踪执行和回收结果。"}),u.jsx("div",{className:"mt-3 rounded-md border border-border bg-surface-overlay px-2.5 py-2 text-[11px] text-text-muted",children:"需求输入 → 任务拆解 → 动态执行 → 结果汇总"})]})]})]}),u.jsxs("div",{className:"mb-12 flex items-center justify-center gap-3",children:[u.jsxs("button",{onClick:n,className:"flex shrink-0 items-center gap-2 rounded-sm border border-border bg-surface-raised px-4 py-3 text-sm text-text-secondary transition-all duration-200 hover:border-zinc-500 hover:text-text",children:[u.jsx(rc,{className:"size-4"}),"选择团队"]}),u.jsx("span",{className:"shrink-0 text-xs text-text-muted",children:"或"}),u.jsx("div",{className:"flex-1",children:u.jsx(H2n,{value:e,onChange:t})})]}),o?u.jsxs("section",{className:"rounded-xl border border-border bg-surface-raised p-5",children:[u.jsx("h2",{className:"text-sm font-semibold text-text",children:"快速开始(3 步)"}),u.jsx("p",{className:"mt-1 text-xs text-text-muted",children:"首次使用会看到空白首页。按下面步骤配置后,就会出现团队和项目内容。"}),u.jsxs("div",{className:"mt-4 grid gap-3 md:grid-cols-3",children:[u.jsxs("button",{type:"button",onClick:()=>r("harness"),className:"rounded-lg border border-border bg-surface px-3 py-3 text-left transition-colors hover:bg-surface-overlay",children:[u.jsx("p",{className:"text-[11px] font-medium text-text-muted",children:"第 1 步"}),u.jsx("p",{className:"mt-1 text-sm font-medium text-text",children:"配置 Harness"}),u.jsx("p",{className:"mt-1 text-xs text-text-muted",children:"连接 Claude/Codex/Gemini 等运行时"})]}),u.jsxs("button",{type:"button",onClick:()=>r("channels"),className:"rounded-lg border border-border bg-surface px-3 py-3 text-left transition-colors hover:bg-surface-overlay",children:[u.jsx("p",{className:"text-[11px] font-medium text-text-muted",children:"第 2 步"}),u.jsx("p",{className:"mt-1 text-sm font-medium text-text",children:"配置渠道"}),u.jsx("p",{className:"mt-1 text-xs text-text-muted",children:"接入飞书/Slack/Telegram/Webhook"})]}),u.jsxs("button",{type:"button",onClick:n,className:"rounded-lg border border-border bg-surface px-3 py-3 text-left transition-colors hover:bg-surface-overlay",children:[u.jsx("p",{className:"text-[11px] font-medium text-text-muted",children:"第 3 步"}),u.jsx("p",{className:"mt-1 text-sm font-medium text-text",children:"创建团队并启动"}),u.jsx("p",{className:"mt-1 text-xs text-text-muted",children:"设置工作目录后即可开始分发任务"})]})]})]}):u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[u.jsx("h2",{className:"text-xs font-medium uppercase tracking-wider text-text-muted",children:e.trim()?"搜索结果":"最近项目"}),e.trim()&&u.jsx("button",{onClick:()=>t(""),className:"text-xs text-text-muted transition-colors hover:text-text-secondary",children:"清除搜索"})]}),u.jsx(q2n,{searchQuery:e})]})]})]})},$we={search:"",categories:[],capabilities:[],installedOnly:!1};function K2n(){const[e,t]=g.useState("mcp-servers"),[n,r]=g.useState($we),[s,i]=g.useState({field:"popularity",order:"desc"}),[o,a]=g.useState(null),[c,l]=g.useState(""),[d,p]=g.useState([]),[f,h]=g.useState(!1),[m,O]=g.useState([]),[_,b]=g.useState(null),[y,x]=g.useState(""),[S]=g.useState(!1),[v,T]=g.useState("name-asc"),[E,w]=g.useState(null),P=g.useRef(null),k=g.useRef(0);g.useEffect(()=>()=>{P.current&&clearTimeout(P.current),k.current+=1},[]),g.useEffect(()=>{e!=="plugins"&&o!==null&&a(null),e!=="mcp-servers"&&_!==null&&b(null),e!=="skills"&&E!==null&&w(null)},[e,_,o,E]);const C=g.useCallback(Q=>{l(Q);const U=++k.current;if(P.current&&clearTimeout(P.current),!Q.trim()){p([]),O([]),h(!1);return}h(!0),P.current=setTimeout(()=>{if(!K.mcpRegistry){k.current===U&&h(!1);return}K.mcpRegistry.search(Q).then(A=>{k.current===U&&(p(A.servers),O(A.warnings),h(!1))},()=>{k.current===U&&(h(!1),O(["Search failed"]))})},300)},[]),M=g.useCallback(Q=>{r(U=>({...U,search:Q}))},[]),I=g.useCallback(Q=>{r(U=>({...U,categories:U.categories.includes(Q)?U.categories.filter(A=>A!==Q):[...U.categories,Q]}))},[]),$=g.useCallback(Q=>{r(U=>({...U,capabilities:U.capabilities.includes(Q)?U.capabilities.filter(A=>A!==Q):[...U.capabilities,Q]}))},[]),R=g.useCallback(()=>{r(Q=>({...Q,installedOnly:!Q.installedOnly}))},[]),N=g.useCallback(()=>{r($we)},[]),j=g.useMemo(()=>n.search!==""||n.categories.length>0||n.capabilities.length>0||n.installedOnly,[n]);return{activeSubTab:e,setActiveSubTab:t,pluginFilters:n,pluginSort:s,setPluginSort:i,selectedPluginId:o,setSelectedPluginId:a,updatePluginSearch:M,toggleCategory:I,toggleCapability:$,toggleInstalledOnly:R,clearFilters:N,hasActiveFilters:j,mcpSearchQuery:c,mcpSearch:C,mcpSearchResults:d,mcpSearchLoading:f,mcpSearchWarnings:m,selectedMcpServerId:_,setSelectedMcpServerId:b,skillsSearchQuery:y,setSkillsSearchQuery:x,skillsInstalledOnly:S,skillsSort:v,setSkillsSort:T,selectedSkillId:E,setSelectedSkillId:w}}function J2n(e){return Use(e)}function eDn(e){return e?.flavor==="agent_teams_orchestrator"}function tDn(e){switch(e){case"supported":return"支持";case"read-only":return"只读";default:return"不支持"}}function nDn(e,t,n){if(!e)return null;const r=t.find(s=>s.path===e);if(r)return r.id;for(const s of n){const i=s.worktrees.find(o=>o.path===e);if(i)return i.id}return null}function cKe(e,t,n){if(!e)return null;const r=t.find(s=>s.id===e);if(r)return{path:r.path,name:r.name};for(const s of n){const i=s.worktrees.find(o=>o.id===e);if(i)return{path:i.path,name:i.name}}return null}const Nwe="Agent CLI";function Fle(e,t=!1){return e?.flavor==="agent_teams_orchestrator"?!e.displayName||e.displayName==="agent_teams_orchestrator"?Nwe:e.displayName:e?.displayName?e.displayName:t?Nwe:"Agent CLI"}function Awe(e,[t,n]){return Math.min(n,Math.max(t,e))}var rDn=[" ","Enter","ArrowUp","ArrowDown"],sDn=[" ","Enter"],fy="Select",[oB,aB,iDn]=mWe(fy),[YE]=sp(fy,[iDn,f_]),lB=f_(),[oDn,P_]=YE(fy),[aDn,lDn]=YE(fy),uKe=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:i,value:o,defaultValue:a,onValueChange:c,dir:l,name:d,autoComplete:p,disabled:f,required:h,form:m}=e,O=lB(t),[_,b]=g.useState(null),[y,x]=g.useState(null),[S,v]=g.useState(!1),T=qoe(l),[E,w]=fm({prop:r,defaultProp:s??!1,onChange:i,caller:fy}),[P,k]=fm({prop:o,defaultProp:a,onChange:c,caller:fy}),C=g.useRef(null),M=_?m||!!_.closest("form"):!0,[I,$]=g.useState(new Set),R=Array.from(I).map(N=>N.props.value).join(";");return u.jsx(tU,{...O,children:u.jsxs(oDn,{required:h,scope:t,trigger:_,onTriggerChange:b,valueNode:y,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:v,contentId:ka(),value:P,onValueChange:k,open:E,onOpenChange:w,dir:T,triggerPointerDownPosRef:C,disabled:f,children:[u.jsx(oB.Provider,{scope:t,children:u.jsx(aDn,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback(N=>{$(j=>new Set(j).add(N))},[]),onNativeOptionRemove:g.useCallback(N=>{$(j=>{const Q=new Set(j);return Q.delete(N),Q})},[]),children:n})}),M?u.jsxs(IKe,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:p,value:P,onChange:N=>k(N.target.value),disabled:f,form:m,children:[P===void 0?u.jsx("option",{value:""}):null,Array.from(I)]},R):null]})})};uKe.displayName=fy;var dKe="SelectTrigger",pKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,i=lB(n),o=P_(dKe,n),a=o.disabled||r,c=ts(t,o.onTriggerChange),l=aB(n),d=g.useRef("touch"),[p,f,h]=QKe(O=>{const _=l().filter(x=>!x.disabled),b=_.find(x=>x.value===o.value),y=DKe(_,O,b);y!==void 0&&o.onValueChange(y.value)}),m=O=>{a||(o.onOpenChange(!0),h()),O&&(o.triggerPointerDownPosRef.current={x:Math.round(O.pageX),y:Math.round(O.pageY)})};return u.jsx(O$,{asChild:!0,...i,children:u.jsx(Or.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":MKe(o.value)?"":void 0,...s,ref:c,onClick:xn(s.onClick,O=>{O.currentTarget.focus(),d.current!=="mouse"&&m(O)}),onPointerDown:xn(s.onPointerDown,O=>{d.current=O.pointerType;const _=O.target;_.hasPointerCapture(O.pointerId)&&_.releasePointerCapture(O.pointerId),O.button===0&&O.ctrlKey===!1&&O.pointerType==="mouse"&&(m(O),O.preventDefault())}),onKeyDown:xn(s.onKeyDown,O=>{const _=p.current!=="";!(O.ctrlKey||O.altKey||O.metaKey)&&O.key.length===1&&f(O.key),!(_&&O.key===" ")&&rDn.includes(O.key)&&(m(),O.preventDefault())})})})});pKe.displayName=dKe;var fKe="SelectValue",hKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:i,placeholder:o="",...a}=e,c=P_(fKe,n),{onValueNodeHasChildrenChange:l}=c,d=i!==void 0,p=ts(t,c.onValueNodeChange);return Aa(()=>{l(d)},[l,d]),u.jsx(Or.span,{...a,ref:p,style:{pointerEvents:"none"},children:MKe(c.value)?u.jsx(u.Fragment,{children:o}):i})});hKe.displayName=fKe;var cDn="SelectIcon",mKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return u.jsx(Or.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});mKe.displayName=cDn;var uDn="SelectPortal",OKe=e=>u.jsx(lE,{asChild:!0,...e});OKe.displayName=uDn;var hy="SelectContent",gKe=g.forwardRef((e,t)=>{const n=P_(hy,e.__scopeSelect),[r,s]=g.useState();if(Aa(()=>{s(new DocumentFragment)},[]),!n.open){const i=r;return i?xi.createPortal(u.jsx(_Ke,{scope:e.__scopeSelect,children:u.jsx(oB.Slot,{scope:e.__scopeSelect,children:u.jsx("div",{children:e.children})})}),i):null}return u.jsx(bKe,{...e,ref:t})});gKe.displayName=hy;var Od=10,[_Ke,$_]=YE(hy),dDn="SelectContentImpl",pDn=Qv("SelectContent.RemoveScroll"),bKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:o,side:a,sideOffset:c,align:l,alignOffset:d,arrowPadding:p,collisionBoundary:f,collisionPadding:h,sticky:m,hideWhenDetached:O,avoidCollisions:_,...b}=e,y=P_(hy,n),[x,S]=g.useState(null),[v,T]=g.useState(null),E=ts(t,te=>S(te)),[w,P]=g.useState(null),[k,C]=g.useState(null),M=aB(n),[I,$]=g.useState(!1),R=g.useRef(!1);g.useEffect(()=>{if(x)return rae(x)},[x]),nae();const N=g.useCallback(te=>{const[G,...Z]=M().map(se=>se.ref.current),[oe]=Z.slice(-1),re=document.activeElement;for(const se of te)if(se===re||(se?.scrollIntoView({block:"nearest"}),se===G&&v&&(v.scrollTop=0),se===oe&&v&&(v.scrollTop=v.scrollHeight),se?.focus(),document.activeElement!==re))return},[M,v]),j=g.useCallback(()=>N([w,x]),[N,w,x]);g.useEffect(()=>{I&&j()},[I,j]);const{onOpenChange:Q,triggerPointerDownPosRef:U}=y;g.useEffect(()=>{if(x){let te={x:0,y:0};const G=oe=>{te={x:Math.abs(Math.round(oe.pageX)-(U.current?.x??0)),y:Math.abs(Math.round(oe.pageY)-(U.current?.y??0))}},Z=oe=>{te.x<=10&&te.y<=10?oe.preventDefault():x.contains(oe.target)||Q(!1),document.removeEventListener("pointermove",G),U.current=null};return U.current!==null&&(document.addEventListener("pointermove",G),document.addEventListener("pointerup",Z,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",G),document.removeEventListener("pointerup",Z,{capture:!0})}}},[x,Q,U]),g.useEffect(()=>{const te=()=>Q(!1);return window.addEventListener("blur",te),window.addEventListener("resize",te),()=>{window.removeEventListener("blur",te),window.removeEventListener("resize",te)}},[Q]);const[A,V]=QKe(te=>{const G=M().filter(re=>!re.disabled),Z=G.find(re=>re.ref.current===document.activeElement),oe=DKe(G,te,Z);oe&&setTimeout(()=>oe.ref.current.focus())}),z=g.useCallback((te,G,Z)=>{const oe=!R.current&&!Z;(y.value!==void 0&&y.value===G||oe)&&(P(te),oe&&(R.current=!0))},[y.value]),L=g.useCallback(()=>x?.focus(),[x]),q=g.useCallback((te,G,Z)=>{const oe=!R.current&&!Z;(y.value!==void 0&&y.value===G||oe)&&C(te)},[y.value]),Y=r==="popper"?fee:yKe,ne=Y===fee?{side:a,sideOffset:c,align:l,alignOffset:d,arrowPadding:p,collisionBoundary:f,collisionPadding:h,sticky:m,hideWhenDetached:O,avoidCollisions:_}:{};return u.jsx(_Ke,{scope:n,content:x,viewport:v,onViewportChange:T,itemRefCallback:z,selectedItem:w,onItemLeave:L,itemTextRefCallback:q,focusSelectedItem:j,selectedItemText:k,position:r,isPositioned:I,searchRef:A,children:u.jsx(E3,{as:pDn,allowPinchZoom:!0,children:u.jsx(v3,{asChild:!0,trapped:y.open,onMountAutoFocus:te=>{te.preventDefault()},onUnmountAutoFocus:xn(s,te=>{y.trigger?.focus({preventScroll:!0}),te.preventDefault()}),children:u.jsx(oE,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:te=>te.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:u.jsx(Y,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:te=>te.preventDefault(),...b,...ne,onPlaced:()=>$(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:xn(b.onKeyDown,te=>{const G=te.ctrlKey||te.altKey||te.metaKey;if(te.key==="Tab"&&te.preventDefault(),!G&&te.key.length===1&&V(te.key),["ArrowUp","ArrowDown","Home","End"].includes(te.key)){let oe=M().filter(re=>!re.disabled).map(re=>re.ref.current);if(["ArrowUp","End"].includes(te.key)&&(oe=oe.slice().reverse()),["ArrowUp","ArrowDown"].includes(te.key)){const re=te.target,se=oe.indexOf(re);oe=oe.slice(se+1)}setTimeout(()=>N(oe)),te.preventDefault()}})})})})})})});bKe.displayName=dDn;var fDn="SelectItemAlignedPosition",yKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,i=P_(hy,n),o=$_(hy,n),[a,c]=g.useState(null),[l,d]=g.useState(null),p=ts(t,E=>d(E)),f=aB(n),h=g.useRef(!1),m=g.useRef(!0),{viewport:O,selectedItem:_,selectedItemText:b,focusSelectedItem:y}=o,x=g.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&l&&O&&_&&b){const E=i.trigger.getBoundingClientRect(),w=l.getBoundingClientRect(),P=i.valueNode.getBoundingClientRect(),k=b.getBoundingClientRect();if(i.dir!=="rtl"){const re=k.left-w.left,se=P.left-re,he=E.left-se,Te=E.width+he,ee=Math.max(Te,w.width),ye=window.innerWidth-Od,Oe=Awe(se,[Od,Math.max(Od,ye-ee)]);a.style.minWidth=Te+"px",a.style.left=Oe+"px"}else{const re=w.right-k.right,se=window.innerWidth-P.right-re,he=window.innerWidth-E.right-se,Te=E.width+he,ee=Math.max(Te,w.width),ye=window.innerWidth-Od,Oe=Awe(se,[Od,Math.max(Od,ye-ee)]);a.style.minWidth=Te+"px",a.style.right=Oe+"px"}const C=f(),M=window.innerHeight-Od*2,I=O.scrollHeight,$=window.getComputedStyle(l),R=parseInt($.borderTopWidth,10),N=parseInt($.paddingTop,10),j=parseInt($.borderBottomWidth,10),Q=parseInt($.paddingBottom,10),U=R+N+I+Q+j,A=Math.min(_.offsetHeight*5,U),V=window.getComputedStyle(O),z=parseInt(V.paddingTop,10),L=parseInt(V.paddingBottom,10),q=E.top+E.height/2-Od,Y=M-q,ne=_.offsetHeight/2,te=_.offsetTop+ne,G=R+N+te,Z=U-G;if(G<=q){const re=C.length>0&&_===C[C.length-1].ref.current;a.style.bottom="0px";const se=l.clientHeight-O.offsetTop-O.offsetHeight,he=Math.max(Y,ne+(re?L:0)+se+j),Te=G+he;a.style.height=Te+"px"}else{const re=C.length>0&&_===C[0].ref.current;a.style.top="0px";const he=Math.max(q,R+O.offsetTop+(re?z:0)+ne)+Z;a.style.height=he+"px",O.scrollTop=G-q+O.offsetTop}a.style.margin=`${Od}px 0`,a.style.minHeight=A+"px",a.style.maxHeight=M+"px",r?.(),requestAnimationFrame(()=>h.current=!0)}},[f,i.trigger,i.valueNode,a,l,O,_,b,i.dir,r]);Aa(()=>x(),[x]);const[S,v]=g.useState();Aa(()=>{l&&v(window.getComputedStyle(l).zIndex)},[l]);const T=g.useCallback(E=>{E&&m.current===!0&&(x(),y?.(),m.current=!1)},[x,y]);return u.jsx(mDn,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:T,children:u.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:u.jsx(Or.div,{...s,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});yKe.displayName=fDn;var hDn="SelectPopperPosition",fee=g.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=Od,...i}=e,o=lB(n);return u.jsx(nU,{...o,...i,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});fee.displayName=hDn;var[mDn,Yle]=YE(hy,{}),hee="SelectViewport",xKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,i=$_(hee,n),o=Yle(hee,n),a=ts(t,i.onViewportChange),c=g.useRef(0);return u.jsxs(u.Fragment,{children:[u.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),u.jsx(oB.Slot,{scope:n,children:u.jsx(Or.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:xn(s.onScroll,l=>{const d=l.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:f}=o;if(f?.current&&p){const h=Math.abs(c.current-d.scrollTop);if(h>0){const m=window.innerHeight-Od*2,O=parseFloat(p.style.minHeight),_=parseFloat(p.style.height),b=Math.max(O,_);if(b<m){const y=b+h,x=Math.min(m,y),S=y-x;p.style.height=x+"px",p.style.bottom==="0px"&&(d.scrollTop=S>0?S:0,p.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});xKe.displayName=hee;var SKe="SelectGroup",[ODn,gDn]=YE(SKe),_Dn=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=ka();return u.jsx(ODn,{scope:n,id:s,children:u.jsx(Or.div,{role:"group","aria-labelledby":s,...r,ref:t})})});_Dn.displayName=SKe;var vKe="SelectLabel",TKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=gDn(vKe,n);return u.jsx(Or.div,{id:s.id,...r,ref:t})});TKe.displayName=vKe;var Kj="SelectItem",[bDn,EKe]=YE(Kj),wKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:i,...o}=e,a=P_(Kj,n),c=$_(Kj,n),l=a.value===r,[d,p]=g.useState(i??""),[f,h]=g.useState(!1),m=ts(t,y=>c.itemRefCallback?.(y,r,s)),O=ka(),_=g.useRef("touch"),b=()=>{s||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return u.jsx(bDn,{scope:n,value:r,disabled:s,textId:O,isSelected:l,onItemTextChange:g.useCallback(y=>{p(x=>x||(y?.textContent??"").trim())},[]),children:u.jsx(oB.ItemSlot,{scope:n,value:r,disabled:s,textValue:d,children:u.jsx(Or.div,{role:"option","aria-labelledby":O,"data-highlighted":f?"":void 0,"aria-selected":l&&f,"data-state":l?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...o,ref:m,onFocus:xn(o.onFocus,()=>h(!0)),onBlur:xn(o.onBlur,()=>h(!1)),onClick:xn(o.onClick,()=>{_.current!=="mouse"&&b()}),onPointerUp:xn(o.onPointerUp,()=>{_.current==="mouse"&&b()}),onPointerDown:xn(o.onPointerDown,y=>{_.current=y.pointerType}),onPointerMove:xn(o.onPointerMove,y=>{_.current=y.pointerType,s?c.onItemLeave?.():_.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:xn(o.onPointerLeave,y=>{y.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:xn(o.onKeyDown,y=>{c.searchRef?.current!==""&&y.key===" "||(sDn.includes(y.key)&&b(),y.key===" "&&y.preventDefault())})})})})});wKe.displayName=Kj;var Ok="SelectItemText",kKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...i}=e,o=P_(Ok,n),a=$_(Ok,n),c=EKe(Ok,n),l=lDn(Ok,n),[d,p]=g.useState(null),f=ts(t,b=>p(b),c.onItemTextChange,b=>a.itemTextRefCallback?.(b,c.value,c.disabled)),h=d?.textContent,m=g.useMemo(()=>u.jsx("option",{value:c.value,disabled:c.disabled,children:h},c.value),[c.disabled,c.value,h]),{onNativeOptionAdd:O,onNativeOptionRemove:_}=l;return Aa(()=>(O(m),()=>_(m)),[O,_,m]),u.jsxs(u.Fragment,{children:[u.jsx(Or.span,{id:c.textId,...i,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?xi.createPortal(i.children,o.valueNode):null]})});kKe.displayName=Ok;var CKe="SelectItemIndicator",RKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return EKe(CKe,n).isSelected?u.jsx(Or.span,{"aria-hidden":!0,...r,ref:t}):null});RKe.displayName=CKe;var mee="SelectScrollUpButton",PKe=g.forwardRef((e,t)=>{const n=$_(mee,e.__scopeSelect),r=Yle(mee,e.__scopeSelect),[s,i]=g.useState(!1),o=ts(t,r.onScrollButtonChange);return Aa(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollTop>0;i(l)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?u.jsx(NKe,{...e,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});PKe.displayName=mee;var Oee="SelectScrollDownButton",$Ke=g.forwardRef((e,t)=>{const n=$_(Oee,e.__scopeSelect),r=Yle(Oee,e.__scopeSelect),[s,i]=g.useState(!1),o=ts(t,r.onScrollButtonChange);return Aa(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<l;i(d)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?u.jsx(NKe,{...e,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});$Ke.displayName=Oee;var NKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,i=$_("SelectScrollButton",n),o=g.useRef(null),a=aB(n),c=g.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return g.useEffect(()=>()=>c(),[c]),Aa(()=>{a().find(d=>d.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),u.jsx(Or.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:xn(s.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:xn(s.onPointerMove,()=>{i.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:xn(s.onPointerLeave,()=>{c()})})}),yDn="SelectSeparator",AKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return u.jsx(Or.div,{"aria-hidden":!0,...r,ref:t})});AKe.displayName=yDn;var gee="SelectArrow",xDn=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=lB(n),i=P_(gee,n),o=$_(gee,n);return i.open&&o.position==="popper"?u.jsx(rU,{...s,...r,ref:t}):null});xDn.displayName=gee;var SDn="SelectBubbleInput",IKe=g.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=g.useRef(null),i=ts(r,s),o=TZe(t);return g.useEffect(()=>{const a=s.current;if(!a)return;const c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==t&&d){const p=new Event("change",{bubbles:!0});d.call(a,t),a.dispatchEvent(p)}},[o,t]),u.jsx(Or.select,{...n,style:{...WAe,...n.style},ref:i,defaultValue:t})});IKe.displayName=SDn;function MKe(e){return e===""||e===void 0}function QKe(e){const t=Xg(e),n=g.useRef(""),r=g.useRef(0),s=g.useCallback(o=>{const a=n.current+o;t(a),function c(l){n.current=l,window.clearTimeout(r.current),l!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(a)},[t]),i=g.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,i]}function DKe(e,t,n){const s=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=vDn(e,Math.max(i,0));s.length===1&&(o=o.filter(l=>l!==n));const c=o.find(l=>l.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function vDn(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var TDn=uKe,LKe=pKe,EDn=hKe,wDn=mKe,kDn=OKe,jKe=gKe,CDn=xKe,XKe=TKe,UKe=wKe,RDn=kKe,PDn=RKe,zKe=PKe,BKe=$Ke,FKe=AKe;const Kl=TDn,Jl=EDn,ul=g.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(LKe,{ref:r,className:at("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-[var(--color-border)] bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-[var(--color-surface)] placeholder:text-[var(--color-text-muted)] focus:outline-none focus:ring-1 focus:ring-[var(--color-border-emphasis)] disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,u.jsx(wDn,{asChild:!0,children:u.jsx(Dr,{className:"size-4 opacity-50"})})]}));ul.displayName=LKe.displayName;const YKe=g.forwardRef(({className:e,...t},n)=>u.jsx(zKe,{ref:n,className:at("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(cE,{className:"size-4"})}));YKe.displayName=zKe.displayName;const VKe=g.forwardRef(({className:e,...t},n)=>u.jsx(BKe,{ref:n,className:at("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(Dr,{className:"size-4"})}));VKe.displayName=BKe.displayName;const dl=g.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>u.jsx(kDn,{children:u.jsxs(jKe,{ref:s,className:at("relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border border-[var(--color-border)] bg-[var(--color-surface)] text-[var(--color-text)] shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[u.jsx(YKe,{}),u.jsx(CDn,{className:at("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),u.jsx(VKe,{})]})}));dl.displayName=jKe.displayName;const $Dn=g.forwardRef(({className:e,...t},n)=>u.jsx(XKe,{ref:n,className:at("px-2 py-1.5 text-sm font-semibold text-[var(--color-text-muted)]",e),...t}));$Dn.displayName=XKe.displayName;const Ui=g.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(UKe,{ref:r,className:at("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-[var(--color-surface-raised)] focus:text-[var(--color-text)] data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[u.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:u.jsx(PDn,{children:u.jsx(es,{className:"size-4"})})}),u.jsx(RDn,{children:t})]}));Ui.displayName=UKe.displayName;const NDn=g.forwardRef(({className:e,...t},n)=>u.jsx(FKe,{ref:n,className:at("-mx-1 my-1 h-px bg-[var(--color-border)]",e),...t}));NDn.displayName=FKe.displayName;const ADn=/^[\w.-]{1,100}$/,IDn=[{value:"streamable-http",label:"Streamable HTTP"},{value:"sse",label:"SSE"},{value:"http",label:"HTTP"}],MDn=({open:e,onClose:t,projectPath:n,cliStatus:r,cliStatusLoading:s})=>{const i=le(se=>se.installCustomMcpServer),o=le(se=>se.cliStatus),a=le(se=>se.cliStatusLoading),c=r??o,l=s??a,d=Ese(c?.flavor),p=[{value:d,label:cZ(d,c?.flavor)},{value:"project",label:"Project"},{value:"local",label:"Local"}],[f,h]=g.useState(""),[m,O]=g.useState("stdio"),[_,b]=g.useState(d),[y,x]=g.useState(""),[S,v]=g.useState(""),[T,E]=g.useState(""),[w,P]=g.useState("streamable-http"),[k,C]=g.useState([]),[M,I]=g.useState([]),[$,R]=g.useState(null),[N,j]=g.useState(!1),Q=g.useRef({}),U=g.useRef(!1),A=g.useRef(d),V=M.map(se=>se.key.trim()).filter(Boolean).sort().join("\0"),z=bu(_)?n??void 0:void 0,L=FO({isInstalled:!1,cliStatus:c,cliStatusLoading:l,section:"mcp"});g.useEffect(()=>{e&&!U.current&&(h(""),O("stdio"),b(d),x(""),v(""),E(""),P("streamable-http"),C([]),I([]),R(null),j(!1),Q.current={}),U.current=e,e||(A.current=d)},[d,e]),g.useEffect(()=>{if(!e){A.current=d;return}const se=A.current;se!==d&&_===se&&Hje(_)&&b(d),A.current=d},[d,e,_]),g.useEffect(()=>{e&&bu(_)&&!n&&b(d)},[d,e,n,_]),g.useEffect(()=>{if(!e||M.length===0||!K.apiKeys)return;const se=M.map(he=>he.key.trim()).filter(Boolean);se.length!==0&&K.apiKeys.lookup(se,z).then(he=>{const Te=Q.current,ee=Object.fromEntries(he.map(ye=>[ye.envVarName,ye.value]));I(ye=>{let Oe=!1;const ie=ye.map(ge=>{const J=ge.key.trim();if(!J)return ge;const F=Te[J],W=ee[J];return W?(!ge.value||ge.value===F)&&ge.value!==W?(Oe=!0,{...ge,value:W}):ge:F&&ge.value===F?(Oe=!0,{...ge,value:""}):ge});return Oe?ie:ye}),Q.current=ee},()=>{})},[z,V,e]);const q=async()=>{if(R(null),L){R(L);return}if(!f.trim()){R("Server name is required");return}if(!ADn.test(f)){R("Invalid server name. Use alphanumeric characters, dashes, underscores, dots.");return}let se;if(m==="stdio"){if(!y.trim()){R("npm package name is required");return}se={type:"stdio",npmPackage:y.trim(),npmVersion:S.trim()||void 0}}else{if(!T.trim()){R("Server URL is required");return}se={type:"http",url:T.trim(),transportType:w}}const he={};for(const ee of M)ee.key.trim()&&ee.value&&(he[ee.key.trim()]=ee.value);const Te={serverName:f,scope:_,projectPath:bu(_)?n??void 0:void 0,installSpec:se,envValues:he,headers:k.filter(ee=>ee.key.trim()&&ee.value.trim())};j(!0);try{await i(Te),t()}catch(ee){R(ee instanceof Error?ee.message:"安装失败")}finally{j(!1)}},Y=()=>I(se=>[...se,{key:"",value:""}]),ne=se=>I(he=>he.filter((Te,ee)=>ee!==se)),te=(se,he,Te)=>I(ee=>ee.map((ye,Oe)=>Oe===se?{...ye,[he]:Te}:ye)),G=()=>C(se=>[...se,{key:"",value:""}]),Z=se=>C(he=>he.filter((Te,ee)=>ee!==se)),oe=(se,he,Te)=>C(ee=>ee.map((ye,Oe)=>Oe===se?{...ye,[he]:Te}:ye)),re=f.trim()&&(m==="stdio"?y.trim():T.trim())&&!(bu(_)&&!n)&&!L&&!N;return u.jsx(Os,{open:e,onOpenChange:se=>!se&&t(),children:u.jsxs(ls,{className:"max-h-[85vh] max-w-lg overflow-y-auto",children:[u.jsx(gs,{children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("div",{className:"flex size-8 items-center justify-center rounded-lg border border-border bg-surface-raised",children:u.jsx(uU,{className:"size-4 text-text-muted"})}),u.jsxs("div",{children:[u.jsx(cs,{children:"添加自定义 MCP 服务器"}),u.jsx(Ti,{children:"不通过目录,手动添加一个服务器。"})]})]})}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(nn,{htmlFor:"custom-name",className:"text-xs",children:"服务器名称"}),u.jsx(Mn,{id:"custom-name",value:f,onChange:se=>h(se.target.value),placeholder:"my-server",className:"h-8 text-sm",autoFocus:!0})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(nn,{className:"text-xs",children:"传输方式"}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(Xe,{type:"button",variant:m==="stdio"?"default":"outline",size:"sm",onClick:()=>O("stdio"),children:"Stdio (npm)"}),u.jsx(Xe,{type:"button",variant:m==="http"?"default":"outline",size:"sm",onClick:()=>O("http"),children:"HTTP / SSE"})]})]}),m==="stdio"&&u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(nn,{htmlFor:"custom-npm",className:"text-xs",children:"npm 包"}),u.jsx(Mn,{id:"custom-npm",value:y,onChange:se=>x(se.target.value),placeholder:"@example/mcp-server",className:"h-8 font-mono text-sm"})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(nn,{htmlFor:"custom-version",className:"text-xs",children:"版本(可选)"}),u.jsx(Mn,{id:"custom-version",value:S,onChange:se=>v(se.target.value),placeholder:"latest",className:"h-8 text-sm"})]})]}),m==="http"&&u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(nn,{htmlFor:"custom-url",className:"text-xs",children:"服务器 URL"}),u.jsx(Mn,{id:"custom-url",value:T,onChange:se=>E(se.target.value),placeholder:"https://api.example.com/mcp",className:"h-8 text-sm"})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(nn,{className:"text-xs",children:"传输类型"}),u.jsxs(Kl,{value:w,onValueChange:se=>P(se),children:[u.jsx(ul,{className:"h-8 text-sm",children:u.jsx(Jl,{})}),u.jsx(dl,{children:IDn.map(se=>u.jsx(Ui,{value:se.value,children:se.label},se.value))})]})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(nn,{className:"text-xs",children:"请求头"}),u.jsxs(Xe,{variant:"ghost",size:"sm",onClick:G,className:"h-6 px-1.5 text-xs",children:[u.jsx(fl,{className:"mr-1 size-3"}),"添加"]})]}),k.length>0&&u.jsx("div",{className:"space-y-2",children:k.map((se,he)=>u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Mn,{value:se.key,onChange:Te=>oe(he,"key",Te.target.value),className:"h-7 w-32 text-xs",placeholder:"Header-Name"}),u.jsx(Mn,{value:se.value,onChange:Te=>oe(he,"value",Te.target.value),className:"h-7 flex-1 text-xs",placeholder:"value"}),u.jsx(Xe,{variant:"ghost",size:"icon",className:"size-7 text-red-400 hover:bg-red-500/10",onClick:()=>Z(he),children:u.jsx(Si,{className:"size-3"})})]},he))})]})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(nn,{className:"text-xs",children:"作用域"}),u.jsxs(Kl,{value:_,onValueChange:se=>b(se),children:[u.jsx(ul,{className:"h-8 text-sm",children:u.jsx(Jl,{})}),u.jsx(dl,{children:p.map(se=>u.jsx(Ui,{value:se.value,disabled:bu(se.value)&&!n,children:se.label},se.value))})]})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(nn,{className:"text-xs",children:"环境变量"}),u.jsxs(Xe,{variant:"ghost",size:"sm",onClick:Y,className:"h-6 px-1.5 text-xs",children:[u.jsx(fl,{className:"mr-1 size-3"}),"添加"]})]}),M.length>0&&u.jsx("div",{className:"space-y-2",children:M.map((se,he)=>u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Mn,{value:se.key,onChange:Te=>te(he,"key",Te.target.value),className:"h-7 w-40 font-mono text-xs",placeholder:"ENV_VAR_NAME"}),u.jsx(Mn,{type:"password",value:se.value,onChange:Te=>te(he,"value",Te.target.value),className:"h-7 flex-1 text-xs",placeholder:"value"}),u.jsx(Xe,{variant:"ghost",size:"icon",className:"size-7 text-red-400 hover:bg-red-500/10",onClick:()=>ne(he),children:u.jsx(Si,{className:"size-3"})})]},he))})]}),L&&u.jsx("div",{className:"rounded-md border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-xs text-amber-300",children:L}),$&&u.jsx("div",{className:"rounded-md border border-red-500/30 bg-red-500/5 px-3 py-2 text-xs text-red-400",children:$}),u.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[u.jsx(Xe,{variant:"ghost",size:"sm",onClick:t,children:"取消"}),u.jsx(Xe,{size:"sm",disabled:!re,onClick:()=>void q(),children:N?"正在安装...":"安装"})]})]})]})})},qKe=({value:e,onChange:t,placeholder:n="Search...",debounceMs:r})=>{const[s,i]=g.useState(e),o=g.useRef(null);g.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),g.useEffect(()=>{i(e)},[e]);const a=c=>{i(c),r&&r>0?(o.current&&clearTimeout(o.current),o.current=setTimeout(()=>t(c),r)):t(c)};return u.jsxs("div",{className:"relative",children:[u.jsx($i,{className:"absolute left-3 top-1/2 size-4 -translate-y-1/2 text-text-muted"}),u.jsx(Mn,{type:"text",value:s,onChange:c=>a(c.target.value),placeholder:n,className:"pl-9 pr-8"}),s&&u.jsx(Xe,{variant:"ghost",size:"icon",onClick:()=>a(""),className:"absolute right-1 top-1/2 size-7 -translate-y-1/2",children:u.jsx(Ar,{className:"size-3.5"})})]})},WKe=({state:e,isInstalled:t,onInstall:n,onUninstall:r,section:s="plugins",disabled:i,size:o="sm",errorMessage:a,cliStatus:c,cliStatusLoading:l})=>{const{cliStatus:d,cliStatusLoading:p}=le(Et(S=>({cliStatus:S.cliStatus,cliStatusLoading:S.cliStatusLoading}))),m=FO({isInstalled:t,cliStatus:c??d,cliStatusLoading:l??p,section:s}),O=i||!!m,[_,b]=g.useState(null);g.useEffect(()=>{(e==="idle"||e==="success")&&b(null)},[e]);const y=_??(t?"uninstall":"install");if(e==="pending")return u.jsxs(Xe,{size:o,variant:"outline",disabled:!0,children:[u.jsx(Ht,{className:"size-3.5 animate-spin"}),u.jsx("span",{className:"ml-1.5",children:y==="uninstall"?"正在移除...":"正在安装..."})]});if(e==="success")return u.jsxs(Xe,{size:o,variant:"outline",disabled:!0,className:"text-green-400",children:[u.jsx(es,{className:"size-3.5"}),u.jsx("span",{className:"ml-1.5",children:"完成"})]});if(e==="error"){const S=u.jsx(Xe,{size:o,variant:"outline",className:"border-red-500/30 text-red-400 hover:bg-red-500/10",onClick:T=>{if(T.stopPropagation(),y==="uninstall"){b("uninstall"),r();return}b("install"),n()},disabled:O,children:u.jsx("span",{children:"重试"})}),v=m??a;return v?u.jsxs("div",{className:"flex max-w-64 flex-col items-end gap-1",children:[u.jsx(Wl,{children:u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx("span",{tabIndex:0,children:S})}),u.jsx(nt,{className:"max-w-64 text-red-300",children:v})]})}),a&&!m?u.jsx("p",{className:"text-right text-[11px] leading-4 text-red-300",children:a}):null]}):S}const x=t?u.jsxs(Xe,{size:o,variant:"outline",className:"border-red-500/30 text-red-400 hover:bg-red-500/10",onClick:S=>{S.stopPropagation(),b("uninstall"),r()},disabled:O,children:[u.jsx(Si,{className:"size-3.5"}),u.jsx("span",{className:"ml-1.5",children:"卸载"})]}):u.jsx(Xe,{size:o,variant:"default",onClick:S=>{S.stopPropagation(),b("install"),n()},disabled:O,children:"安装"});return m?u.jsx(Wl,{children:u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx("span",{tabIndex:0,children:x})}),u.jsx(nt,{className:"max-w-64",children:m})]})}):x},GKe=({source:e})=>e==="official"?u.jsx(Ut,{className:"border-blue-500/30 bg-blue-500/10 text-blue-400",variant:"outline",children:"Official"}):e==="glama"?u.jsx(Ut,{className:"border-zinc-500/30 bg-zinc-500/10 text-zinc-400",variant:"outline",children:"Glama"}):u.jsx(Ut,{className:"border-orange-500/30 bg-orange-500/10 text-orange-400",variant:"outline",children:"Community"}),QDn=({server:e,isInstalled:t,installedEntry:n,installedEntries:r=[],diagnostic:s,diagnosticsLoading:i,onClick:o,cliStatus:a,cliStatusLoading:c})=>{const l=le($=>$.cliStatus),d=a??l,p=Ese(d?.flavor),f=JR(e.id,p),h=le($=>$.mcpInstallProgress[f]??"idle"),m=le($=>$.installMcpServer),O=le($=>$.uninstallMcpServer),_=le($=>$.installErrors[f]),b=le($=>e.repositoryUrl?$.mcpGitHubStars[e.repositoryUrl]:void 0),y=!!e.installSpec,x=r.length?r:n?[n]:[],S=e.installSpec?.type==="http"||e.envVars.length>0||e.requiresAuth||(e.authHeaders?.length??0)>0,v=kL(e.name),T=x.find($=>$.scope===p)??null,E=Gje(x),w=t&&x.length===1&&T?.name===v&&!S,P=y&&(t?w:!S),[k,C]=g.useState(!1),M=!!e.iconUrl&&!k,I=s?.status==="connected"?"border-emerald-500/30 bg-emerald-500/10 text-emerald-400":s?.status==="needs-authentication"?"border-amber-500/30 bg-amber-500/10 text-amber-400":s?.status==="failed"?"border-red-500/30 bg-red-500/10 text-red-400":"border-border bg-surface-raised text-text-muted";return u.jsxs("div",{role:"button",tabIndex:0,onClick:()=>o(e.id),onKeyDown:$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),o(e.id))},className:`relative flex w-full cursor-pointer flex-col gap-2 overflow-hidden rounded-lg border p-4 text-left transition-all duration-200 hover:border-border-emphasis hover:bg-surface-raised hover:shadow-[0_0_12px_rgba(255,255,255,0.02)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-border-emphasis)] ${t?"border-l-2 border-border border-l-emerald-500/30":"border-border"}`,children:[u.jsxs("div",{className:"flex items-start gap-2.5",children:[M&&u.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg border border-border bg-surface-raised",children:u.jsx("img",{src:e.iconUrl,alt:"",className:"size-7 rounded object-contain",onError:()=>C(!0)})}),u.jsx("div",{className:"min-w-0 flex-1",children:u.jsxs("div",{className:"flex items-start justify-between gap-2",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("h3",{className:"truncate text-sm font-semibold text-text",children:e.name}),e.source!=="official"&&u.jsx("div",{className:"mt-1",children:u.jsx(GKe,{source:e.source})})]}),u.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[t&&u.jsx(Ut,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-400",variant:"outline",children:E??"Installed"}),t&&i&&!s&&u.jsx(Ut,{className:"border-border bg-surface-raised text-text-muted",variant:"outline",children:"Checking..."}),s&&u.jsx(Ut,{className:I,variant:"outline",children:s.statusLabel})]})]})})]}),u.jsx("p",{className:"line-clamp-2 text-xs text-text-secondary",children:e.description}),s?.target&&u.jsx("p",{className:"truncate font-mono text-[10px] text-text-muted",title:s.target,children:s.target}),u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1 text-xs text-text-muted",children:[e.tools.length>0&&u.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-surface-raised px-1.5 py-0.5 ring-1 ring-border",children:[u.jsx(pE,{className:"size-3"}),e.tools.length," ",e.tools.length===1?"tool":"tools"]}),e.envVars.length>0&&u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(eft,{className:"size-3"}),e.envVars.length," ",e.envVars.length===1?"env":"envs"]}),e.requiresAuth&&u.jsxs("span",{className:"inline-flex items-center gap-1 text-amber-400",children:[u.jsx(A0,{className:"size-3"}),"Auth"]}),e.version&&u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(Bht,{className:"size-3"}),e.version]}),e.updatedAt&&u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(nc,{className:"size-3"}),_3(e.updatedAt)]}),e.author&&u.jsxs("span",{className:"truncate",children:["by ",e.author]}),e.hostingType==="remote"&&u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(Bdt,{className:"size-3"}),"Remote"]}),e.hostingType==="local"&&u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(zIe,{className:"size-3"}),"Local"]}),e.hostingType==="both"&&u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(QD,{className:"size-3"}),"Both"]}),e.repositoryUrl&&u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsxs("button",{className:"inline-flex items-center gap-1.5 text-text-muted transition-colors hover:text-text",onClick:$=>{$.stopPropagation(),K.openExternal(e.repositoryUrl)},children:[u.jsx(Apt,{className:"size-3.5"}),b!=null&&u.jsxs("span",{className:"inline-flex items-center gap-0.5",children:[u.jsx(GIe,{className:"size-3 fill-amber-400 text-amber-400"}),xhn(b)]})]})}),u.jsx(nt,{side:"top",children:"Repository"})]}),e.websiteUrl&&u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx("button",{className:"inline-flex items-center text-text-muted transition-colors hover:text-text",onClick:$=>{$.stopPropagation(),K.openExternal(e.websiteUrl)},children:u.jsx(QD,{className:"size-3.5"})})}),u.jsx(nt,{side:"top",children:"Website"})]})]}),P&&u.jsx("div",{className:"shrink-0",children:u.jsx(WKe,{state:h,isInstalled:t,section:"mcp",cliStatus:d,cliStatusLoading:c,onInstall:()=>m({registryId:e.id,serverName:v,scope:p,envValues:{},headers:[]}),onUninstall:()=>O(e.id,T?.name??v,p),size:"sm",errorMessage:_})}),y&&(!P||S)&&u.jsx("div",{className:"shrink-0",children:u.jsx(Xe,{size:"sm",variant:"outline",onClick:$=>{$.stopPropagation(),o(e.id)},children:t?"Manage":"Configure"})})]})]})},DDn=({server:e,isInstalled:t,installedEntry:n,installedEntries:r=[],diagnostic:s,diagnosticsLoading:i,projectPath:o,open:a,onClose:c,cliStatus:l,cliStatusLoading:d})=>{const p=le(ae=>ae.cliStatus),f=l??p,h=Ese(f?.flavor),[m,O]=g.useState(h),_=e?JR(e.id,m,o):null,b=le(ae=>(_?ae.mcpInstallProgress[_]:void 0)??"idle"),y=le(ae=>ae.installMcpServer),x=le(ae=>ae.uninstallMcpServer),S=le(ae=>_?ae.installErrors[_]:void 0),v=le(ae=>e?.repositoryUrl?ae.mcpGitHubStars[e.repositoryUrl]:void 0),[T,E]=g.useState(""),[w,P]=g.useState({}),[k,C]=g.useState([]),[M,I]=g.useState(!1),[$,R]=g.useState(new Set),N=g.useRef({}),j=g.useRef(h),Q=r.length?r:n?[n]:[],U=[{value:h,label:cZ(h,f?.flavor)},...h!=="user"&&Q.some(ae=>ae.scope==="user")?[{value:"user",label:cZ("user",f?.flavor)}]:[],{value:"project",label:"项目"},{value:"local",label:"本地"}],A=Wje(Q),V=Q.find(ae=>ae.scope===m)??null,z=Gje(Q),L=e?.envVars.map(ae=>ae.name).sort().join("\0")??"",q=f?.flavor==="agent_teams_orchestrator"?"运行时状态":"Claude 状态",Y=bu(m)?o??void 0:void 0;if(g.useEffect(()=>{!e||!a||(P(Object.fromEntries(e.envVars.map(ae=>[ae.name,""]))),C((e.authHeaders??[]).map(ae=>({key:ae.key,value:"",secret:ae.isSecret,description:ae.description,isRequired:ae.isRequired,valueTemplate:ae.valueTemplate,locked:!0}))),E(A?.name??kL(e.name)),O(A?.scope??h),I(!1),R(new Set),N.current={})},[a,A?.name,A?.scope,e?.id]),g.useEffect(()=>{if(!a){j.current=h;return}const ae=j.current;ae!==h&&!A&&m===ae&&Hje(m)&&O(h),j.current=h},[h,a,A,m]),g.useEffect(()=>{!e||!a||!V||E(V.name)},[a,V,e]),g.useEffect(()=>{a&&bu(m)&&!o&&O(h)},[h,a,o,m]),g.useEffect(()=>{if(!e||!a||e.envVars.length===0||!K.apiKeys)return;const ae=e.envVars.map(ce=>ce.name);K.apiKeys.lookup(ae,Y).then(ce=>{const H=N.current,pe={};for(const Ee of ce)pe[Ee.envVarName]=Ee.value;P(Ee=>{const we={...Ee};for(const[$e,Ze]of Object.entries(H))!($e in pe)&&we[$e]===Ze&&(we[$e]="");for(const[$e,Ze]of Object.entries(pe))(!we[$e]||we[$e]===H[$e])&&(we[$e]=Ze);return we}),R(new Set(Object.keys(pe))),N.current=pe},()=>{})},[Y,L,a,e?.id]),!e)return u.jsx(u.Fragment,{});const ne=!!e.installSpec,te=e.installSpec?.type==="http",G=!!e.iconUrl&&!M,Z=e.installSpec?.type==="stdio"?`https://www.npmjs.com/package/${e.installSpec.npmPackage}`:null,oe=k.some(ae=>ae.locked),re=e.envVars.some(ae=>ae.isRequired&&!w[ae.name]?.trim()),se=k.some(ae=>ae.isRequired&&!ae.value.trim()),he=V!==null,Te=V?.name??T,ee=V?.scope??m,ye=bu(m)&&!o,Oe=!T.trim()||re||se||ye,ie=s?.status==="connected"?"border-emerald-500/30 bg-emerald-500/10 text-emerald-400":s?.status==="needs-authentication"?"border-amber-500/30 bg-amber-500/10 text-amber-400":s?.status==="failed"?"border-red-500/30 bg-red-500/10 text-red-400":"border-border bg-surface-raised text-text-muted",ge=()=>{y({registryId:e.id,serverName:T,scope:m,projectPath:bu(m)?o??void 0:void 0,envValues:w,headers:k})},J=()=>{x(e.id,Te,ee,bu(ee)?o??void 0:void 0)},F=()=>{C(ae=>[...ae,{key:"",value:""}])},W=ae=>{C(ce=>ce.filter((H,pe)=>pe!==ae))},ue=(ae,ce,H)=>{C(pe=>pe.map((Ee,we)=>we===ae?{...Ee,[ce]:H}:Ee))};return u.jsx(Os,{open:a,onOpenChange:ae=>!ae&&c(),children:u.jsxs(ls,{className:"max-h-[85vh] max-w-2xl overflow-y-auto",children:[u.jsx(gs,{children:u.jsxs("div",{className:"flex items-start gap-3",children:[G&&u.jsx("div",{className:"flex size-10 shrink-0 items-center justify-center rounded-lg border border-border bg-surface-raised",children:u.jsx("img",{src:e.iconUrl,alt:"",className:"size-8 rounded object-contain",onError:()=>I(!0)})}),u.jsx("div",{className:"min-w-0 flex-1",children:u.jsxs("div",{className:"flex items-start justify-between gap-3",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx(cs,{className:"truncate",children:e.name}),u.jsx(Ti,{className:"mt-1",children:e.description})]}),u.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[t&&u.jsx(Ut,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-400",variant:"outline",children:z??"已安装"}),e.source!=="official"&&u.jsx(GKe,{source:e.source})]})]})})]})}),u.jsxs("div",{className:"grid grid-cols-1 gap-3 text-sm sm:grid-cols-2",children:[u.jsxs("div",{children:[u.jsx("span",{className:"text-text-muted",children:"来源"}),u.jsx("p",{className:"capitalize text-text",children:e.source})]}),v!=null&&u.jsxs("div",{children:[u.jsx("span",{className:"text-text-muted",children:"GitHub 星标"}),u.jsxs("p",{className:"flex items-center gap-1 text-text",children:[u.jsx(GIe,{className:"size-3.5 fill-amber-400 text-amber-400"}),v.toLocaleString()]})]}),e.version&&u.jsxs("div",{children:[u.jsx("span",{className:"text-text-muted",children:"版本"}),u.jsx("p",{className:"text-text",children:e.version})]}),e.license&&u.jsxs("div",{children:[u.jsx("span",{className:"text-text-muted",children:"许可证"}),u.jsx("p",{className:"text-text",children:e.license})]}),u.jsxs("div",{children:[u.jsx("span",{className:"text-text-muted",children:"安装类型"}),e.installSpec?.type==="stdio"?u.jsxs(Xe,{variant:"link",className:"h-auto p-0 text-sm text-blue-400",onClick:()=>void K.openExternal(Z),children:["npm: ",e.installSpec.npmPackage]}):u.jsx("p",{className:"text-text",children:e.installSpec?`HTTP: ${e.installSpec.transportType}`:"需要手动设置"})]}),e.author&&u.jsxs("div",{children:[u.jsx("span",{className:"text-text-muted",children:"作者"}),u.jsx("p",{className:"text-text",children:e.author})]}),e.hostingType&&u.jsxs("div",{children:[u.jsx("span",{className:"text-text-muted",children:"托管方式"}),u.jsx("p",{className:"capitalize text-text",children:e.hostingType})]}),e.publishedAt&&u.jsxs("div",{children:[u.jsx("span",{className:"text-text-muted",children:"发布时间"}),u.jsx("p",{className:"text-text",children:new Date(e.publishedAt).toLocaleDateString()})]}),e.updatedAt&&u.jsxs("div",{children:[u.jsx("span",{className:"text-text-muted",children:"更新时间"}),u.jsx("p",{className:"text-text",children:new Date(e.updatedAt).toLocaleDateString()})]})]}),e.requiresAuth&&u.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-sm text-amber-400",children:[u.jsx(A0,{className:"size-4"}),"此服务器需要认证"]}),te&&!e.requiresAuth&&(e.authHeaders?.length??0)===0&&u.jsx("div",{className:"rounded-md border border-blue-500/30 bg-blue-500/5 px-3 py-2 text-sm text-blue-400",children:"远程 MCP 服务器即使未在注册表中声明,也可能仍需要自定义请求头或 API 密钥。若安装后连接失败,请查看提供商文档。"}),he&&u.jsxs("div",{className:"space-y-2 rounded-md border border-border bg-surface-raised px-4 py-3",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3",children:[u.jsx("span",{className:"text-sm font-medium text-text",children:q}),i&&!s?u.jsx(Ut,{className:"border-border bg-surface-raised text-text-muted",variant:"outline",children:"检查中..."}):s?u.jsx(Ut,{className:ie,variant:"outline",children:s.statusLabel}):u.jsx(Ut,{className:"border-border bg-surface-raised text-text-muted",variant:"outline",children:"未检查"})]}),s?.target&&u.jsxs("div",{children:[u.jsx("p",{className:"mb-1 text-xs text-text-muted",children:"启动目标"}),u.jsx("code",{className:"block overflow-x-auto rounded bg-surface px-2 py-1 text-xs text-text",children:s.target})]})]}),ne&&u.jsxs("div",{className:"space-y-3 rounded-md border border-border bg-surface-raised p-4",children:[u.jsx("h4",{className:"text-sm font-medium text-text",children:he?"管理安装":"安装服务器"}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(nn,{htmlFor:"server-name",className:"text-xs",children:"服务器名称"}),u.jsx(Mn,{id:"server-name",value:T,onChange:ae=>E(ae.target.value),placeholder:"my-server",className:"h-8 text-sm",disabled:he})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(nn,{className:"text-xs",children:"范围"}),u.jsxs(Kl,{value:m,onValueChange:ae=>O(ae),children:[u.jsx(ul,{className:"h-8 text-sm",children:u.jsx(Jl,{})}),u.jsx(dl,{children:U.map(ae=>u.jsx(Ui,{value:ae.value,disabled:bu(ae.value)&&!o,children:ae.label},ae.value))})]})]}),e.envVars.length>0&&u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(nn,{className:"text-xs",children:"环境变量"}),u.jsx("div",{className:"space-y-2",children:e.envVars.map(ae=>u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("code",{className:"w-40 shrink-0 truncate text-xs text-blue-400",children:ae.name}),u.jsx(Mn,{type:ae.isSecret?"password":"text",value:w[ae.name]??"",onChange:ce=>P(H=>({...H,[ae.name]:ce.target.value})),className:"h-7 flex-1 text-xs",placeholder:ae.description??ae.name}),$.has(ae.name)&&w[ae.name]&&u.jsx("span",{className:"shrink-0 text-[10px] text-emerald-400",children:"已自动填充"})]},ae.name))})]}),te&&u.jsxs("div",{className:"space-y-1.5",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(nn,{className:"text-xs",children:"请求头"}),u.jsxs(Xe,{variant:"ghost",size:"sm",onClick:F,className:"h-6 px-1.5 text-xs",children:[u.jsx(fl,{className:"mr-1 size-3"}),oe?"添加自定义":"添加"]})]}),k.length>0&&u.jsx("div",{className:"space-y-2",children:k.map((ae,ce)=>u.jsxs("div",{className:"space-y-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[ae.locked?u.jsx("code",{className:"w-32 shrink-0 truncate text-xs text-blue-400",children:ae.key}):u.jsx(Mn,{value:ae.key,onChange:H=>ue(ce,"key",H.target.value),className:"h-7 w-32 text-xs",placeholder:"Header-Name"}),u.jsx(Mn,{type:ae.secret?"password":"text",value:ae.value,onChange:H=>ue(ce,"value",H.target.value),className:"h-7 flex-1 text-xs",placeholder:ae.valueTemplate??ae.description??"value"}),u.jsx(Xe,{variant:"ghost",size:"icon",className:"size-7 text-red-400 hover:bg-red-500/10",onClick:()=>W(ce),disabled:ae.locked&&ae.isRequired,children:u.jsx(Si,{className:"size-3"})})]}),(ae.description||ae.valueTemplate||ae.isRequired)&&u.jsx("p",{className:"text-[10px] text-text-muted",children:[ae.isRequired?"必填":null,ae.description,ae.valueTemplate].filter(Boolean).join(" • ")})]},ce))})]}),u.jsx("div",{className:"flex justify-end pt-1",children:u.jsx(WKe,{state:b,isInstalled:he,section:"mcp",cliStatus:f,cliStatusLoading:d,onInstall:ge,onUninstall:J,disabled:Oe,size:"default",errorMessage:S})})]}),!ne&&u.jsx("div",{className:"rounded-md border border-border bg-surface-raised px-4 py-3 text-sm text-text-muted",children:"此服务器需要手动设置。请查看仓库中的安装说明。"}),e.tools.length>0&&u.jsxs("div",{children:[u.jsxs("h4",{className:"mb-2 flex items-center gap-1.5 text-sm font-medium text-text",children:[u.jsx(pE,{className:"size-4"}),"工具(",e.tools.length,")"]}),u.jsx("div",{className:"max-h-48 space-y-1 overflow-y-auto",children:e.tools.map(ae=>u.jsxs("div",{className:"rounded-md bg-surface-raised p-2 text-xs",children:[u.jsx("code",{className:"font-mono text-text",children:ae.name}),ae.description&&u.jsx("p",{className:"mt-0.5 text-text-muted",children:ae.description})]},ae.name))})]}),u.jsxs("div",{className:"flex items-center gap-4",children:[e.repositoryUrl&&u.jsxs(Xe,{variant:"link",className:"h-auto p-0 text-sm text-blue-400",onClick:()=>void K.openExternal(e.repositoryUrl),children:[u.jsx(hf,{className:"mr-1 size-3.5"}),"仓库"]}),e.glamaUrl&&u.jsxs(Xe,{variant:"link",className:"h-auto p-0 text-sm text-blue-400",onClick:()=>void K.openExternal(e.glamaUrl),children:[u.jsx(hf,{className:"mr-1 size-3.5"}),"Glama"]}),e.websiteUrl&&u.jsxs(Xe,{variant:"link",className:"h-auto p-0 text-sm text-blue-400",onClick:()=>void K.openExternal(e.websiteUrl),children:[u.jsx(hf,{className:"mr-1 size-3.5"}),"网站"]})]})]})})},LDn=[{value:"name-asc",label:"Name A→Z"},{value:"name-desc",label:"Name Z→A"},{value:"tools-desc",label:"Most tools"}];function jDn(e,t){return[...e].sort((n,r)=>{switch(t){case"name-asc":return n.name.localeCompare(r.name);case"name-desc":return r.name.localeCompare(n.name);case"tools-desc":return r.tools.length-n.tools.length;default:return 0}})}const XDn=({projectPath:e,mcpSearchQuery:t,mcpSearch:n,mcpSearchResults:r,mcpSearchLoading:s,mcpSearchWarnings:i,selectedMcpServerId:o,setSelectedMcpServerId:a,cliStatus:c,cliStatusLoading:l})=>{const d=dT(e),{browseCatalog:p,browseNextCursor:f,browseLoading:h,browseError:m,mcpBrowse:O,installedServersByProjectPath:_,installedServersFallback:b,fetchMcpGitHubStars:y,mcpDiagnosticsByProjectPath:x,mcpDiagnosticsFallback:S,mcpDiagnosticsLoadingByProjectPath:v,mcpDiagnosticsLoadingFallback:T,mcpDiagnosticsErrorByProjectPath:E,mcpDiagnosticsErrorFallback:w,mcpDiagnosticsLastCheckedAtByProjectPath:P,mcpDiagnosticsLastCheckedAtFallback:k,runMcpDiagnostics:C,uninstallMcpServer:M,mcpInstallProgress:I}=le(Et(F=>({browseCatalog:F.mcpBrowseCatalog,browseNextCursor:F.mcpBrowseNextCursor,browseLoading:F.mcpBrowseLoading,browseError:F.mcpBrowseError,mcpBrowse:F.mcpBrowse,installedServersByProjectPath:F.mcpInstalledServersByProjectPath,installedServersFallback:F.mcpInstalledServers,fetchMcpGitHubStars:F.fetchMcpGitHubStars,mcpDiagnosticsByProjectPath:F.mcpDiagnosticsByProjectPath,mcpDiagnosticsFallback:F.mcpDiagnostics,mcpDiagnosticsLoadingByProjectPath:F.mcpDiagnosticsLoadingByProjectPath,mcpDiagnosticsLoadingFallback:F.mcpDiagnosticsLoading,mcpDiagnosticsErrorByProjectPath:F.mcpDiagnosticsErrorByProjectPath,mcpDiagnosticsErrorFallback:F.mcpDiagnosticsError,mcpDiagnosticsLastCheckedAtByProjectPath:F.mcpDiagnosticsLastCheckedAtByProjectPath,mcpDiagnosticsLastCheckedAtFallback:F.mcpDiagnosticsLastCheckedAt,runMcpDiagnostics:F.runMcpDiagnostics,uninstallMcpServer:F.uninstallMcpServer,mcpInstallProgress:F.mcpInstallProgress}))),$=le(F=>F.cliStatus),R=le(F=>F.cliStatusLoading),N=c??$,j=l??R,Q=_?.[d]??b??[],U=x?.[d]??S??{},A=v?.[d]??T??!1,V=E?.[d]??w??null,z=P?.[d]??k??null,[L,q]=g.useState("name-asc");g.useEffect(()=>{p.length===0&&!h&&!m&&O()},[p.length,m,h,O]);const Y=g.useMemo(()=>N===null||typeof N>"u"?j?"正在检查运行时状态...":"正在检查运行时可用性...":N?.installed===!1?N.binaryPath&&N.launchError?"已找到配置的运行时,但启动失败。请前往首页修复或重新安装。":"需要配置运行时。请前往首页安装或修复。":null,[N,j]);g.useEffect(()=>{Y||C(e??void 0)},[Y,e,C]),g.useEffect(()=>{const F=p.map(W=>W.repositoryUrl).filter(W=>!!W);F.length>0&&y(F)},[p,y]);const ne=t.trim().length>0,te=ne?r:p,G=ne?s:h,Z=ne?i:[],oe=g.useMemo(()=>new Set(Q.map(F=>F.name.toLowerCase())),[Q]),re=g.useMemo(()=>{const F=new Map;for(const W of Q){const ue=W.name.toLowerCase();F.set(ue,[...F.get(ue)??[],W])}return F},[Q]),se=F=>oe.has(kL(F.name)),he=F=>re.get(kL(F.name))??[],Te=F=>Wje(he(F)),ee=F=>{const W=Te(F);return W?U[UQ(W.name,W.scope)]??U[UQ(W.name)]??U[W.name]??null:null},ye=g.useMemo(()=>Object.values(U).sort((F,W)=>F.name.localeCompare(W.name)),[U]),Oe=F=>{switch(F){case"connected":return"border-emerald-500/30 bg-emerald-500/10 text-emerald-400";case"needs-authentication":return"border-amber-500/30 bg-amber-500/10 text-amber-400";case"failed":return"border-red-500/30 bg-red-500/10 text-red-400";default:return"border-border bg-surface-raised text-text-muted"}},ie=g.useMemo(()=>jDn(te,L),[te,L]),ge=Fle(N,!0),J=g.useMemo(()=>o?ie.find(F=>F.id===o)??p.find(F=>F.id===o)??r.find(F=>F.id===o)??null:null,[ie,p,r,o]);return u.jsxs("div",{className:"flex flex-col gap-4",children:[u.jsxs("div",{className:"rounded-md border border-black/10 bg-surface-raised px-4 py-3 dark:border-white/10",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3",children:[u.jsxs("div",{children:[u.jsx("p",{className:"text-sm font-medium text-text",children:"MCP 健康状态"}),u.jsx("p",{className:"text-xs text-text-muted",children:A?u.jsxs(u.Fragment,{children:["正在通过 ",ge," 检查已安装的 MCP 服务器..."]}):Y||(z?`上次检查:${_3(new Date(z).toISOString())}`:u.jsx(u.Fragment,{children:"在此页面运行诊断,以验证已安装 MCP 的连接状态。"}))})]}),u.jsxs(Xe,{variant:"outline",size:"sm",onClick:()=>void C(e??void 0),disabled:A||!!Y,className:"whitespace-nowrap",children:[u.jsx(ua,{className:`mr-1.5 size-3.5 ${A?"animate-spin":""}`}),A?"检查中...":"检查状态"]})]}),(A||ye.length>0)&&u.jsxs("div",{className:"mt-4 border-t border-black/10 pt-4 dark:border-white/10",children:[u.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[u.jsx("p",{className:"text-sm font-medium text-text",children:"运行时 MCP 诊断"}),ye.length>0&&u.jsxs("span",{className:"text-xs text-text-muted",children:[ye.length," 个服务器"]})]}),ye.length>0?u.jsx("div",{className:"mcp-diagnostics-list max-h-[18.5rem] space-y-2 overflow-y-auto pr-1",children:ye.map(F=>{const W=JR(F.name,F.scope||"user",e),ue=I[W]==="pending";return u.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-md border border-black/10 px-3 py-2 dark:border-white/10",children:[u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("p",{className:"text-sm text-text",children:F.name}),F.scope&&u.jsx("span",{className:"rounded-full border border-border bg-surface-raised px-1.5 py-0.5 text-[10px] uppercase tracking-wide text-text-muted",children:F.scope})]}),u.jsx("p",{className:"truncate font-mono text-[11px] text-text-muted",title:F.target,children:F.target})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Ut,{className:Oe(F.status),variant:"outline",children:F.statusLabel}),u.jsx(Xe,{variant:"ghost",size:"sm",className:"size-6 p-0 text-red-300 hover:text-red-200",disabled:ue,onClick:()=>{M(F.name,F.name,F.scope||void 0,e??void 0)},title:`卸载 ${F.name}`,children:u.jsx(Si,{className:"size-3.5"})})]})]},UQ(F.name,F.scope))})}):u.jsx("p",{className:"text-xs text-text-muted",children:"正在等待诊断结果..."})]})]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"flex-1",children:u.jsx(qKe,{value:t,onChange:n,placeholder:"搜索 MCP 服务器..."})}),u.jsxs(Kl,{value:L,onValueChange:F=>q(F),children:[u.jsx(ul,{className:"w-36",children:u.jsx(Jl,{})}),u.jsx(dl,{children:LDn.map(F=>u.jsx(Ui,{value:F.value,children:F.label},F.value))})]})]}),Z.length>0&&u.jsx("div",{className:"flex flex-col gap-1",children:Z.map((F,W)=>u.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-xs text-amber-400",children:[u.jsx(qn,{className:"size-3.5 shrink-0"}),F]},W))}),G&&ie.length===0&&u.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-3",children:Array.from({length:6},(F,W)=>u.jsxs("div",{className:"skeleton-card flex flex-col gap-2 rounded-lg border border-border p-4",style:{animationDelay:`${W*80}ms`},children:[u.jsxs("div",{className:"flex items-start gap-2.5",children:[u.jsx("div",{className:"size-9 rounded-lg bg-surface-raised"}),u.jsxs("div",{className:"flex-1 space-y-1.5",children:[u.jsx("div",{className:"h-4 w-32 rounded bg-surface-raised"}),u.jsx("div",{className:"h-3 w-16 rounded-full bg-surface-raised"})]})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx("div",{className:"h-3 w-full rounded bg-surface-raised"}),u.jsx("div",{className:"h-3 w-2/3 rounded bg-surface-raised"})]}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("div",{className:"h-5 w-12 rounded-full bg-surface-raised"}),u.jsx("div",{className:"h-7 w-16 rounded bg-surface-raised"})]})]},W))}),m&&!ne&&u.jsx("div",{className:"rounded-md border border-red-500/30 bg-red-500/5 p-4 text-sm text-red-400",children:m}),V&&(V.includes(xPn)?u.jsxs("div",{className:"flex items-start gap-3 rounded-md border border-amber-500/30 bg-amber-500/5 px-4 py-3",children:[u.jsx(qn,{className:"mt-0.5 size-4 shrink-0 text-amber-400"}),u.jsxs("div",{children:[u.jsx("p",{className:"text-sm font-medium text-amber-300",children:N?.flavor==="agent_teams_orchestrator"?`${ge} not available`:`${ge} not installed`}),u.jsxs("p",{className:"mt-0.5 text-xs text-text-muted",children:["MCP health checks require ",ge,". Go to the Dashboard to install or repair it."]})]})]}):u.jsx("div",{className:"rounded-md border border-red-500/30 bg-red-500/5 p-4 text-sm text-red-400",children:V})),!G&&ie.length===0&&u.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-sm border border-dashed border-border px-8 py-16",children:[u.jsx("div",{className:"flex size-10 items-center justify-center rounded-lg border border-border bg-surface-raised",children:ne?u.jsx($i,{className:"size-5 text-text-muted"}):u.jsx(uU,{className:"size-5 text-text-muted"})}),u.jsx("p",{className:"text-sm text-text-secondary",children:ne?"没有找到服务器":"暂无 MCP 服务器"}),u.jsx("p",{className:"text-xs text-text-muted",children:ne?"试试其他搜索词":"稍后再回来查看新服务器"})]}),ie.length>0&&u.jsx("div",{className:"mcp-servers-grid grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-3",children:ie.map(F=>u.jsx(QDn,{server:F,isInstalled:se(F),installedEntry:Te(F),installedEntries:he(F),diagnostic:ee(F),diagnosticsLoading:A,onClick:a,cliStatus:N,cliStatusLoading:j},F.id))}),!ne&&f&&u.jsx("div",{className:"flex justify-center py-4",children:u.jsx(Xe,{variant:"outline",size:"sm",disabled:h,onClick:()=>void O(f),children:"Load more"})}),u.jsx(DDn,{server:J,isInstalled:J?se(J):!1,installedEntry:J?Te(J):null,installedEntries:J?he(J):[],diagnostic:J?ee(J):null,diagnosticsLoading:A,projectPath:e,open:o!==null,onClose:()=>a(null),cliStatus:N,cliStatusLoading:j})]})},UP=[{rootKind:"hermit",directoryName:".hermit",segments:[".hermit","skills"],audience:"shared"},{rootKind:"claude",directoryName:".claude",segments:[".claude","skills"],audience:"shared"},{rootKind:"cursor",directoryName:".cursor",segments:[".cursor","skills"],audience:"shared"},{rootKind:"agents",directoryName:".agents",segments:[".agents","skills"],audience:"shared"},{rootKind:"codex",directoryName:".codex",segments:[".codex","skills"],audience:"codex"}];function HKe(e){return UP.find(t=>t.rootKind===e)}function _ee(e){return HKe(e).directoryName}function ZKe(e){return HKe(e).audience}function Jj(e){return e==="hermit"?"Hermit 管理":ZKe(e)==="codex"?"Codex 专用":"共享"}function Iwe(e,t){return ZKe(e)==="shared"||t==="codex"}var KKe="AlertDialog",[UDn]=sp(KKe,[mGe]),Wm=mGe(),JKe=e=>{const{__scopeAlertDialog:t,...n}=e,r=Wm(t);return u.jsx(aae,{...r,...n,modal:!0})};JKe.displayName=KKe;var zDn="AlertDialogTrigger",BDn=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Wm(n);return u.jsx(Ubn,{...s,...r,ref:t})});BDn.displayName=zDn;var FDn="AlertDialogPortal",eJe=e=>{const{__scopeAlertDialog:t,...n}=e,r=Wm(t);return u.jsx(lae,{...r,...n})};eJe.displayName=FDn;var YDn="AlertDialogOverlay",tJe=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Wm(n);return u.jsx(k3,{...s,...r,ref:t})});tJe.displayName=YDn;var bv="AlertDialogContent",[VDn,qDn]=UDn(bv),WDn=_Ae("AlertDialogContent"),nJe=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...s}=e,i=Wm(n),o=g.useRef(null),a=ts(t,o),c=g.useRef(null);return u.jsx(Dbn,{contentName:bv,titleName:rJe,docsSlug:"alert-dialog",children:u.jsx(VDn,{scope:n,cancelRef:c,children:u.jsxs(C3,{role:"alertdialog",...i,...s,ref:a,onOpenAutoFocus:xn(s.onOpenAutoFocus,l=>{l.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:l=>l.preventDefault(),onInteractOutside:l=>l.preventDefault(),children:[u.jsx(WDn,{children:r}),u.jsx(HDn,{contentRef:o})]})})})});nJe.displayName=bv;var rJe="AlertDialogTitle",sJe=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Wm(n);return u.jsx(cae,{...s,...r,ref:t})});sJe.displayName=rJe;var iJe="AlertDialogDescription",oJe=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Wm(n);return u.jsx(uae,{...s,...r,ref:t})});oJe.displayName=iJe;var GDn="AlertDialogAction",aJe=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Wm(n);return u.jsx(dae,{...s,...r,ref:t})});aJe.displayName=GDn;var lJe="AlertDialogCancel",cJe=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:s}=qDn(lJe,n),i=Wm(n),o=ts(t,s);return u.jsx(dae,{...i,...r,ref:o})});cJe.displayName=lJe;var HDn=({contentRef:e})=>{const t=`\`${bv}\` requires a description for the component to be accessible for screen reader users.
1650
1650
 
1651
1651
  You can add a description to the \`${bv}\` by passing a \`${iJe}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
1652
1652
 
@@ -1826,7 +1826,7 @@ Store screenshots or other bundled assets here.
1826
1826
  `).toLowerCase();return n.includes("working directory does not exist:")?"请选择存在的工作目录,然后重新打开此弹窗。":n.includes("not authenticated")||n.includes("not logged in")?"请在 Claude CLI 中完成所需提供商认证,然后重新打开此弹窗。":n.includes("provider is not configured for runtime use")?"请配置所选提供商运行时,然后重新打开此弹窗。":n.includes("spawn ")||n.includes(" enoent")||n.includes("eacces")||n.includes("enoexec")||n.includes("bad cpu type in executable")||n.includes("image not found")?"请确认本地 Claude CLI 二进制存在且可启动,然后重新打开此弹窗。":"请处理上方问题,然后重新打开此弹窗。"}const Wtt="in-process";function Gtt(){return["--teammate-mode",Wtt]}function O4n(e){const t=[];let n=!1;for(const r of e){if(n){n=!1;continue}if(r==="--teammate-mode"){n=!0;continue}r.startsWith("--teammate-mode=")||t.push(r)}return t}function g4n(e){return/^[A-Za-z0-9_./:=@+-]+$/.test(e)?e:`"${e.replace(/(["\\$`])/g,"\\$1")}"`}function tCe(e,t=Wtt){const n=O4n(yce(e)),r=[...Gtt(),...n];return r.length>0?r.map(g4n).join(" "):void 0}const _4n={anthropic:"Anthropic",codex:"Codex",gemini:"Gemini",opencode:"OpenCode"};function b4n(e){return _4n[e]??e}function y4n(e){const t=yce(e);for(let n=0;n<t.length;n+=1){const r=t[n];if(r==="--teammate-mode"){const s=t[n+1];return s==="auto"||s==="tmux"||s==="in-process"?s:null}if(r.startsWith("--teammate-mode=")){const s=r.slice(16);return s==="auto"||s==="tmux"||s==="in-process"?s:null}}return null}const x4n={visible:!1,blocksSubmission:!1,checking:!1,title:"",message:"",details:[],tmuxDetail:null,memberWarningById:{}};function S4n({leadProviderId:e,members:t,soloTeam:n=!1,extraCliArgs:r}){const s=n?[]:t.filter(o=>o.removedAt==null&&o.name.trim().length>0);return y4n(r)!=="tmux"||s.length===0?x4n:{visible:!0,blocksSubmission:!1,checking:!1,title:"已切换为进程内成员运行",message:`当前团队会通过 ${b4n(e)} 负责人会话启动成员,不再依赖 tmux。`,details:["自定义 CLI 参数里的 --teammate-mode tmux 会被忽略,并改为 in-process。"],tmuxDetail:null,memberWarningById:{}}}const v4n=({analysis:e,onOpenDashboard:t})=>{if(!e.visible)return null;const n=e.checking?Ks:qn;return u.jsx("div",{className:"rounded-md border p-3 text-xs",style:{backgroundColor:"var(--warning-bg)",borderColor:"var(--warning-border)",color:"var(--warning-text)"},children:u.jsxs("div",{className:"flex items-start gap-2",children:[u.jsx(n,{className:"mt-0.5 size-4 shrink-0"}),u.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[u.jsx("p",{className:"font-medium",children:e.title}),u.jsx("p",{className:"opacity-80",children:e.message}),e.tmuxDetail?u.jsx("p",{className:"text-[11px] opacity-70",children:e.tmuxDetail}):null,e.details.length>0?u.jsx("ul",{className:"list-disc space-y-0.5 pl-4 text-[11px] opacity-80",children:e.details.map(r=>u.jsx("li",{children:r},r))}):null,t?u.jsx(Xe,{type:"button",variant:"outline",size:"sm",className:"mt-1 h-7 px-2 text-[11px]",onClick:t,children:"打开首页"}):null]})]})})};function T4n(e){return{fastModeAvailable:!1}}function E4n(e){return{showFastModeControl:!1,resolvedFastMode:!1,selectable:!1,disabledReason:null}}function w4n(e){return{nextEffort:e.selectedEffort,effortResetReason:null,nextFastMode:e.selectedFastMode,fastModeResetReason:null}}function k4n(e,t){const n=new Map(e.map(r=>[r.providerId,r]));return t.map(r=>n.get(r)??{providerId:r,status:"pending",backendSummary:null,details:[]})}const j8=!0,C4n="TeamDelete,TodoWrite,TaskCreate,TaskUpdate";function X8(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return"UTC"}}function QM(){const e=localStorage.getItem("team:lastSelectedProvider");return V$(xa(e))}function Ux(e){const t=localStorage.getItem(`team:lastSelectedModel:${e}`);return t===null?e==="anthropic"?"opus":"":t1(e,t==="__default__"?"":t)}function Ew(){const e=localStorage.getItem("team:lastSelectedFastMode");return e==="on"||e==="off"||e==="inherit"?e:"inherit"}function zx(e){return a_(e)??"Anthropic"}function R4n(e,t,n,r){return{providerId:e.providerId??t,model:e.model?.trim()||n,effort:e.effort??r}}function P4n(e,t,n,r){return{providerId:xa(e.providerId)??t,model:e.model?.trim()||n,effort:e.effort??r}}function $4n(e){const t=e.filter(n=>{const r=n.name.trim().toLowerCase();return!n.removedAt&&!e_(r)});return t.length>0&&t.every(n=>n.isolation==="worktree")}const jee=e=>{const{open:t,onClose:n}=e,{isLight:r}=Qs(),s=le(ve=>ve.appConfig?.general?.multimodelEnabled??!1),i=le(ve=>ve.appConfig?.providerConnections?.anthropic.fastModeDefault??!1),o=le(ve=>ve.cliStatus),a=le(ve=>ve.cliStatusLoading),c=le(ve=>ve.bootstrapCliStatus),l=le(ve=>ve.fetchCliStatus),d=e.mode==="launch"||e.mode==="relaunch",p=e.mode==="relaunch",h=g.useMemo(()=>!o&&a&&s?Py():o,[o,a,s]),m=e.mode==="schedule",O=m?e.schedule??null:null,_=m&&!!O,b=e.teamName??"",[y,x]=g.useState(""),{teamByName:S,openDashboard:v}=le(Et(ve=>({teamByName:ve.teamByName,openDashboard:ve.openDashboard}))),T=le(ve=>ve.openTeamTab),E=g.useMemo(()=>Object.values(S).sort((ve,gt)=>ve.teamName.localeCompare(gt.teamName)).map(ve=>({value:ve.teamName,label:ve.displayName||ve.teamName,description:ve.description||void 0,meta:{color:ve.color}})),[S]),w=b||y,P=m&&!b,[k,C]=g.useState("project"),[M,I]=g.useState(""),[$,R]=g.useState(""),N=cy({key:`launchTeam:${w||"standalone"}:${e.mode}:prompt`}),j=NN(`launchTeam:${w||"standalone"}:${e.mode}:chips`),[Q,U]=g.useState([]),[A,V]=g.useState(!1),[z,L]=g.useState(null),[q,Y]=g.useState(null),[ne,te]=g.useState(!1),[G,Z]=g.useState(()=>lh(QM())),[oe,re]=g.useState(()=>Ux(lh(QM()))),[se,he]=g.useState([]),[Te,ee]=g.useState(!1),[ye,Oe]=g.useState(!1),[ie,ge]=g.useState(()=>localStorage.getItem("team:lastSkipPermissions")!=="false"),[J,F]=g.useState(()=>{const ve=localStorage.getItem("team:lastSelectedEffort");return ve===null?"":ve}),[W,ue]=g.useState(Ew),[ae,ce]=g.useState(null),[H,pe]=g.useState(()=>localStorage.getItem("team:lastLimitContext")==="true"),[Ee,we]=g.useState(!1),[$e,Ze]=g.useState(!1),[lt,yt]=g.useState("idle"),[xt,Ge]=g.useState(null),[Pt,Lt]=g.useState([]),[ct,_n]=g.useState([]),Be=g.useRef(0),jt=le(ve=>Sl(ve,ve.selectedTeamName)),Nt=le(ve=>w?ve.launchParamsByTeam[w]:void 0),Zt=d?e.members:jt,[je,tt]=g.useState(null),[kt,en]=g.useState(null),[We,ut]=g.useState(()=>localStorage.getItem(`team:lastWorktreeEnabled:${w}`)==="true"&&!!localStorage.getItem(`team:lastWorktreeName:${w}`)),[Re,xe]=g.useState(()=>localStorage.getItem(`team:lastWorktreeName:${w}`)??""),[Fe,et]=g.useState(()=>localStorage.getItem(`team:lastCustomArgs:${w}`)??""),[Ye,vt]=g.useState(null),[qt,Dt]=g.useState(null),Bt=p?e.projectPath??e.defaultProjectPath??"":"",[Kn,En]=g.useState(""),[Jn,ar]=g.useState(!0),[ze,Pe]=g.useState("0 9 * * 1-5"),[_e,ke]=g.useState(X8),[de,De]=g.useState(15),[Ue,mt]=g.useState(50),[St,ht]=g.useState(""),[Xt,bn]=g.useState(null),Ve=g.useMemo(()=>[],[se,G,ye]),zt=g.useMemo(()=>[G],[Ve,G]),wn=g.useMemo(()=>{const ve=(h?.providers??[]).map(gt=>[gt.providerId,r4n(gt)]);return new Map(ve)},[h?.providers]),jr=g.useRef(wn),Ws=g.useRef([]),Ie=g.useRef(null);g.useEffect(()=>{jr.current=wn},[wn]),g.useEffect(()=>{Ws.current=ct},[ct]),g.useEffect(()=>{t||(Ie.current=null)},[t]);const Ne=g.useMemo(()=>new Map((h?.providers??[]).map(ve=>[ve.providerId,ve])),[h?.providers]);g.useEffect(()=>{t&&he(ve=>{const gt=XBn({members:ve,selectedProviderId:G,runtimeProviderStatusById:Ne});return gt.changed?gt.members:ve})},[se,t,Ne,G]),g.useEffect(()=>{!t||o||a||Yg({multimodelEnabled:s,bootstrapCliStatus:c,fetchCliStatus:l})},[c,o,a,l,s,t]);const mn=le(ve=>ve.createSchedule),er=le(ve=>ve.updateSchedule),oi=ve=>{ut(ve),localStorage.setItem(`team:lastWorktreeEnabled:${w}`,String(ve)),ve||(xe(""),localStorage.setItem(`team:lastWorktreeName:${w}`,""))},ai=ve=>{xe(ve),localStorage.setItem(`team:lastWorktreeName:${w}`,ve)},Kc=ve=>{et(ve),localStorage.setItem(`team:lastCustomArgs:${w}`,ve)},cn=ve=>{const gt=lh(ve);Z(gt),localStorage.setItem("team:lastSelectedProvider",gt),gt!=="anthropic"&&(pe(!1),localStorage.setItem("team:lastLimitContext","false")),re(Ux(gt))},Pn=ve=>{const gt=t1(G,ve);re(gt),localStorage.setItem(`team:lastSelectedModel:${G}`,gt)},An=ve=>{ge(ve),localStorage.setItem("team:lastSkipPermissions",String(ve))},tr=ve=>{F(ve),localStorage.setItem("team:lastSelectedEffort",ve)},Br=ve=>{ue(ve),localStorage.setItem("team:lastSelectedFastMode",ve)};g.useEffect(()=>{const ve=localStorage.getItem("team:lastSelectedModel");ve!=null&&localStorage.getItem("team:lastSelectedModel:anthropic")==null&&localStorage.setItem("team:lastSelectedModel:anthropic",ve),localStorage.removeItem("team:lastSelectedModel");for(const gt of["lastSelectedModel","lastSelectedEffort"]){const Gt=`schedule:${gt}`,be=gt==="lastSelectedModel"?"team:lastSelectedModel:anthropic":`team:${gt}`,Ke=localStorage.getItem(Gt);Ke!=null&&localStorage.getItem(be)==null&&localStorage.setItem(be,Ke),localStorage.removeItem(Gt)}},[]);const lr=()=>{Y(null),te(!1),yt("idle"),Ge(null),Lt([]),_n([]),C("project"),I(""),R(""),we(!1),Ze(!1),he([]),Oe(!1),j.clearChipDraft(),vt(null),Dt(null),x(""),En(""),Pe("0 9 * * 1-5"),ke(X8()),De(15),mt(50),ht("")},xr=()=>{d&&lr(),n()};g.useEffect(()=>{if(!(!t||!m)){if(O){En(O.label??""),Pe(O.cronExpression),ke(O.timezone),De(O.warmUpMinutes),mt(O.maxTurns),ht(O.maxBudgetUsd!=null?String(O.maxBudgetUsd):""),N.setValue(O.launchConfig.prompt),R(O.launchConfig.cwd),C("custom");const ve=lh(O.launchConfig.providerId);Z(ve),re(ve===lh(O.launchConfig.providerId)?O.launchConfig.model??"":Ux("anthropic")),ge(O.launchConfig.skipPermissions!==!1),F(O.launchConfig.effort??""),ue(O.launchConfig.fastMode??Ew()),en(O.launchConfig.providerBackendId??null),bn(`${O.id}:${O.updatedAt??""}`)}else{En(""),Pe("0 9 * * 1-5"),ke(X8()),De(15),mt(50),ht(""),N.setValue(""),C("project"),I(""),R("");const ve=lh(QM());Z(ve),re(Ux(ve)),F(""),ue(Ew()),en(null),bn(null)}Y(null),te(!1)}},[t,m,O?.id]),g.useEffect(()=>{if(!t||!d)return;if(p){let gt=!1;return(async()=>{let Gt=null;try{Gt=w?await K.teams.getSavedRequest(w):null}catch{Gt=null}if(gt)return;vt(Gt),Dt(Gt?.members&&Gt.members.length>0?Gt.members:Bke(Zt));const be=lh(xa(Gt?.providerId)??"anthropic");Z(be),re(be===xa(Gt?.providerId)?Gt?.model??"":Ux(be)),F(Gt?.effort??""),ue(Gt?.fastMode??Ew()),ge(Gt?.skipPermissions??!0),we(!0)})(),()=>{gt=!0}}let ve=!1;return(async()=>{let gt=null;try{gt=w?await K.teams.getSavedRequest(w):null}catch{gt=null}if(ve)return;const Gt=Zt.length>0?Zt:gt?.members&&gt.members.length>0?gt.members:[],be=Bke(Gt),Ke=localStorage.getItem("team:lastSelectedEffort"),Ft=xa(gt?.providerId)??null,ur=typeof gt?.providerBackendId=="string"&&gt.providerBackendId.trim().length>0?gt.providerBackendId.trim():null,ir=lh(QM()),rt=LBn({members:Zt,savedRequest:gt,previousLaunchParams:Nt,multimodelEnabled:s,storedProviderId:ir,storedEffort:Ke===null?"medium":Ke,storedFastMode:Ew(),storedLimitContext:localStorage.getItem("team:lastLimitContext")==="true",getStoredModel:Ux});tt(Ft),en(rt.providerBackendId??ur??null),he(pBn(be).map(dr=>hBn(dr))),ee($4n(be)),Oe(!be.some(dr=>dr.providerId||dr.model||dr.effort));const Qt=lh(rt.providerId);Z(Qt),re(Qt===rt.providerId?rt.model:""),F(rt.effort),ue(rt.fastMode),pe(rt.limitContext),ge(gt?.skipPermissions??localStorage.getItem("team:lastSkipPermissions")!=="false")})(),()=>{ve=!0}},[t,d,w,Zt,s,Nt]);const cr=g.useMemo(()=>d?xa(Nt?.providerId)??je:null,[d,Nt?.providerId,je]),Ds=g.useMemo(()=>!d||!cr?!1:cr!==G,[d,cr,G]),Ki=m?!1:H,hi=g.useMemo(()=>vw(oe,H,G,Ne.get(G))??"",[H,Ne,oe,G]),Ua=g.useMemo(()=>IM(G,Ne.get(G))??bce(G,Nt?.providerBackendId??kt)??void 0,[Nt?.providerBackendId,Ne,kt,G]),fp=g.useMemo(()=>S4n({leadProviderId:G,members:[],extraCliArgs:d?tCe(Fe):void 0}),[Fe,Ve,d,Ua,G]),Yf=g.useMemo(()=>G==="anthropic"?T4n({source:{modelCatalog:Ne.get("anthropic")?.modelCatalog,runtimeCapabilities:Ne.get("anthropic")?.runtimeCapabilities}}):null,[Ki,Ne,oe,G]),Uo=g.useMemo(()=>G==="anthropic"&&Yf?E4n():null,[i,Yf,W,G]);g.useEffect(()=>{if(m&&O){const Gt=`${O.id}:${O.updatedAt??""}`;if(Xt!==Gt)return}if(G!=="anthropic"){ce(null);return}const ve=w4n({selectedEffort:J,selectedFastMode:W}),gt=[];ve.nextEffort!==J&&(F(ve.nextEffort),localStorage.setItem("team:lastSelectedEffort",ve.nextEffort)),ve.nextFastMode!==W&&(ue(ve.nextFastMode),localStorage.setItem("team:lastSelectedFastMode",ve.nextFastMode)),ce(gt.length>0?gt.join(" "):null)},[i,Yf,Ki,J,W,oe,G,O,Xt,m]);const hp=g.useMemo(()=>{const ve=new Map,gt=new Map,Gt=(Ke,Ft)=>{const ur=Ft?.trim()??"";if(!ur)return;const ir=ve.get(Ke)??[];ir.includes(ur)||ve.set(Ke,[...ir,ur])},be=Ke=>{Ke==="anthropic"&&G==="anthropic"&&gt.set(Ke,!0)};oe.trim()?Gt(G,hi):be(G);for(const Ke of Ve){if(Ke.removedAt)continue;const Ft=Utt({memberProviderId:Ke.providerId,memberModel:Ke.model,selectedProviderId:G,runtimeProviderStatusById:Ne});Ft.model?Gt(Ft.providerId,Ft.model):be(Ft.providerId)}for(const Ke of gt.keys())Gt(Ke,Ptt);return ve},[hi,Ve,Ne,oe,G]),M_=g.useMemo(()=>{if(!d)return[];const ve=[],gt=Nt?.model?.trim()||"",Gt=Nt?.effort,be=oe.trim()||hi;cr&&(cr!==G||gt!==be||(Gt??"")!==(J||""))&&ve.push({key:"lead",memberName:sz,message:`${tb(G,be,J||void 0)},而不是 ${tb(cr,gt,Gt)}`});const Ke=new Map(Zt.map(Ft=>[Ft.name.trim().toLowerCase(),Ft]));for(const Ft of Ve){if(Ft.removedAt)continue;const ur=Ft.name.trim();if(!ur)continue;const ir=Ke.get(ur.toLowerCase());if(!ir)continue;const{providerId:rt,model:Qt,effort:dr}=R4n(Ft,G,be,J||void 0),{providerId:yo,model:eu,effort:Km}=P4n(ir,cr??"anthropic",gt,Gt);if(yo===rt&&eu===Qt&&(Km??"")===(dr??"")&&(ir.isolation??"")===(Ft.isolation??""))continue;const Jm=yo!==rt||eu!==Qt||(Km??"")!==(dr??"")?`${tb(rt,Qt,dr)},而不是 ${tb(yo,eu,Km)}`:null,tu=ir.isolation!==Ft.isolation?`${Ft.isolation==="worktree"?"独立 worktree":"共享工作区"},而不是 ${ir.isolation==="worktree"?"独立 worktree":"共享工作区"}`:null;ve.push({key:`member:${ur.toLowerCase()}`,memberName:ur,message:[Jm,tu].filter(Sr=>!!Sr).join("; ")})}return ve},[d,Nt?.effort,Nt?.model,cr,G,oe,hi,J,Zt,Ve]),za=g.useMemo(()=>new Map(M_.map(ve=>[ve.key,ve.message])),[M_]);g.useMemo(()=>{const ve=[];Ds&&cr&&ve.push(`提供商已从 ${zx(cr)} 更改为 ${zx(G)}。之前的负责人会话不会恢复,负责人会以全新上下文启动。`);const gt=za.get("lead");return gt&&ve.push(`下次启动将使用 ${gt}。`),ve.length>0?ve.join(" "):null},[Ds,cr,G,za]);const Q_=g.useMemo(()=>{const ve={};for(const gt of Ve){const Gt=gt.name.trim();if(!Gt||gt.removedAt)continue;const be=za.get(`member:${Gt.toLowerCase()}`);be&&(ve[gt.id]=`下次启动将使用 ${be}。`)}return ve},[Ve,za]);g.useMemo(()=>{const ve={...Q_};for(const[gt,Gt]of Object.entries(fp.memberWarningById))ve[gt]=ve[gt]?`${ve[gt]} ${Gt}`:Gt;return ve},[Q_,fp.memberWarningById]);const D_=Ul(M)?"":M.trim(),Fr=k==="project"?D_:$.trim(),sd=g.useMemo(()=>KBn(zt,Ne),[Ne,zt]),Gm=g.useMemo(()=>ZBn(hp),[hp]),Vf=g.useMemo(()=>JBn({cwd:Fr,selectedProviderId:G,selectedModel:oe,selectedMemberProviders:zt,limitContext:H,runtimeStatusSignature:sd,modelChecksSignature:Gm}),[Fr,H,sd,zt,oe,Gm,G]);g.useEffect(()=>{!t||!d||e.clearProvisioningError?.(w)},[t,d,w]),g.useEffect(()=>{if(!t||!d){Be.current+=1,Ie.current=null;return}if(typeof K.teams.prepareProvisioning!="function"){Be.current+=1,Ie.current=null,yt("failed"),Lt([]),_n([]),Ge("当前 preload 版本不支持 team:prepareProvisioning,请重启开发应用。");return}if(!Fr){Be.current+=1,Ie.current=null,yt("idle"),Lt([]),_n([]),Ge("请选择工作目录以验证启动环境。");return}if(Ie.current===Vf)return;Ie.current=Vf;const ve=++Be.current,gt=k4n(Ws.current,zt);yt("loading"),Ge("正在并行检查选中的提供商..."),Lt([]),_n(gt),(async()=>{let Gt=gt;const be=zt.map(Ke=>{const Ft=hp.get(Ke)??[],ur=jr.current.get(Ke)??null;return{providerId:Ke,selectedModelChecks:Ft,backendSummary:ur}});try{for(const Qt of be)Gt=D8(Gt,Qt.providerId,{status:"checking",backendSummary:Qt.backendSummary,details:[]});Be.current===ve&&_n(Gt);const Ke=await Promise.all(be.map(async Qt=>{const dr=await HBn({cwd:Fr,providerId:Qt.providerId,selectedModelIds:Qt.selectedModelChecks,prepareProvisioning:K.teams.prepareProvisioning,limitContext:H,onModelProgress:({status:yo,details:eu})=>{Gt=D8(Gt,Qt.providerId,{status:yo,backendSummary:Qt.backendSummary,details:eu}),Be.current===ve&&_n(Gt)}});return{...Qt,prepResult:dr}}));let Ft=!1,ur=!1;const ir=[];for(const Qt of Ke)Qt.prepResult.warnings.length>0&&(ur=!0,ir.push(...Qt.prepResult.warnings.map(dr=>`${zx(Qt.providerId)}: ${dr}`))),Qt.prepResult.status==="failed"?Ft=!0:Qt.prepResult.status==="notes"&&(ur=!0),Gt=D8(Gt,Qt.providerId,{status:Qt.prepResult.status,backendSummary:Qt.backendSummary,details:Qt.prepResult.details});if(Be.current===ve&&_n(Gt),Be.current!==ve)return;const rt=qtt(Gt)??"部分所选提供商需要处理。";yt(Ft?"failed":"ready"),Ge(Ft?rt:ur?"所选提供商已就绪(含提示)。":"所选提供商已就绪。"),Lt(ir)}catch(Ke){if(Be.current!==ve)return;const Ft=Ke instanceof Error?Ke.message:"预热 Agent CLI 环境失败";yt("failed"),Lt([]),_n(s4n(Gt,Ft)),Ge(Ft)}})()},[t,d,Fr,Vf,G,zt,hp]);const Hm=le(Et(ve=>ve.repositoryGroups));g.useEffect(()=>{if(!t)return;V(!0),L(null);let ve=!1;return(async()=>{try{const gt=(await K.getProjects()).filter(Ke=>!Ul(Ke.path));if(ve)return;const Gt=new Set(gt.map(Ke=>Ke.path)),be=[];for(const Ke of Hm)for(const Ft of Ke.worktrees)!Ul(Ft.path)&&!Gt.has(Ft.path)&&(Gt.add(Ft.path),be.push({id:Ft.id,path:Ft.path,name:Ft.name,sessions:[],totalSessions:0,createdAt:Ft.createdAt??Date.now()}));U([...gt,...be])}catch(gt){if(ve)return;L(gt instanceof Error?gt.message:"项目加载失败"),U([])}finally{ve||V(!1)}})(),()=>{ve=!0}},[t,Hm]);const Jc=d?e.defaultProjectPath:void 0;g.useEffect(()=>{if(!t||k!=="project"||M)return;const ve=Q.filter(gt=>!Ul(gt.path));if(ve.length!==0){if(Jc&&!Ul(Jc)){const gt=fr(Jc),Gt=ve.find(be=>fr(be.path)===gt);if(Gt){I(Gt.path);return}}I(ve[0].path)}},[t,k,Q,M,Jc]),g.useEffect(()=>{!t||k!=="project"||!M||Ul(M)&&I("")},[t,k,M,I]),cBn(Fr||null);const Jy=d?e.activeTeams:void 0,i1=g.useMemo(()=>{if(!d||!Jy?.length||!Fr)return null;const ve=fr(Fr);return Jy.find(gt=>gt.teamName!==w&&fr(gt.projectPath)===ve)??null},[d,Jy,Fr,w]);g.useEffect(()=>{Ze(!1)},[i1?.teamName,Fr]),Gy(null),AN(null);const o1=g.useMemo(()=>mBn(se,Zt),[se,Zt]),eA=g.useMemo(()=>OBn(se,o1),[o1,se]),a1=g.useMemo(()=>{if(!d)return[];const ve=[];ve.push("--input-format","stream-json","--output-format","stream-json"),ve.push("--verbose","--setting-sources","user,project,local"),ve.push("--mcp-config","<auto>","--disallowedTools",C4n),ie&&ve.push("--dangerously-skip-permissions");const gt=vw(oe,H,G,Ne.get(G));gt&&ve.push("--model",gt);const Gt=AM({providerId:G,selectedEffort:J});if(Gt&&ve.push("--effort",Gt),G==="anthropic"){const be=Uo?.resolvedFastMode?{fastMode:!0,fastModePerSessionOptIn:!1}:{fastMode:!1};ve.push("--settings",JSON.stringify(be))}return ve.push(...Gtt()),Ee||ve.push("--resume","<previous>"),ve},[Uo?.resolvedFastMode,Yf,d,ie,oe,H,J,G,Ee,Ne]),Zm=g.useMemo(()=>{if(!d)return[];const ve=[];N.value.trim()&&ve.push("负责人提示词");const gt=Ve.filter(Gt=>!Gt.removedAt&&Gt.isolation==="worktree").length;return gt>0&&ve.push(`${gt} 个成员使用独立 worktree`),ve.push(`Provider: ${zx(G)}`),oe&&ve.push(`Model: ${oe}`),J&&ve.push(`Effort: ${J}`),G==="anthropic"&&(W==="on"?ve.push("快速模式"):W==="off"?ve.push("快速模式关闭"):G==="anthropic"&&i&&ve.push("快速默认")),G==="anthropic"&&H&&ve.push("上下文限制为 200K"),ie&&ve.push("自动批准工具"),ve.push("成员由运行时动态生成"),Ee&&ve.push("全新会话"),We&&Re.trim()&&ve.push(`Worktree:${Re.trim()}`),Fe.trim()&&ve.push("自定义 CLI 参数"),ve},[d,Ve,N.value,oe,G,J,W,i,H,ie,Ee,We,Re,Fe]),ex=g.useMemo(()=>{const ve=[];return Fr||ve.push("必须填写工作目录"),m&&(w||ve.push("必须选择团队"),N.value.trim()||ve.push("必须填写提示词"),ze.trim()||ve.push("必须填写 Cron 表达式")),ve},[Fr,m,w,N.value,ze]),qf=g.useMemo(()=>{const ve=Xke(G,oe,Ne.get(G));if(ve)return ve;if(!d)return null;for(const gt of Ve){if(gt.removedAt)continue;const Gt=xa(gt.providerId)??G,be=Xke(Gt,gt.model,Ne.get(Gt));if(!be)continue;const Ke=gt.name.trim();return Ke?`${Ke}: ${be}`:be}return null},[Ve,d,Ne,oe,G]),tx=g.useMemo(()=>{const ve=eCe(ct,G,hi||oe);return ve?.reason??ve?.detail??null},[hi,ct,oe,G]);g.useMemo(()=>{const ve={};if(!d)return ve;for(const gt of Ve){if(gt.removedAt)continue;if(ye&&tx){ve[gt.id]=tx;continue}const Gt=xa(gt.providerId)??G,be=eCe(ct,Gt,gt.model),Ke=be?.reason??be?.detail??null;Ke&&(ve[gt.id]=Ke)}return ve},[Ve,d,tx,ct,G,ye]);const tA=g.useMemo(()=>d&&!j8,[d,se]),nA=g.useMemo(()=>!1,[d,se]),rA=d?e.provisioningError:null,nx=q??qf??rA,zo=g.useMemo(()=>d4n({state:lt,message:xt,warnings:Pt,checks:ct}),[ct,xt,lt,Pt]),L_=le(ve=>d&&w?My(ve,w):!1);g.useEffect(()=>{!t||!d||!w||!L_||(T(w,Fr||Jc),xr())},[xr,Jc,Fr,w,d,L_,t,T]);const QB=()=>{if(p){if(!Ye&&!qt){Y("正在加载上次启动配置,请稍候...");return}if(qf){Y(qf);return}Y(null),te(!0),(async()=>{try{const ve=Ye,gt=AM({providerId:G,selectedEffort:J}),Gt={teamName:w,cwd:ve?.cwd??Bt??Fr,executionTarget:ve?.executionTarget??{type:"local",cwd:ve?.cwd??Bt??(Fr||void 0)},prompt:ve?.prompt,providerId:G,providerBackendId:IM(G,Ne.get(G))??ve?.providerBackendId??void 0,model:vw(oe,!1,G,Ne.get(G)),effort:gt,fastMode:W,limitContext:!1,clearContext:Ee||void 0,skipPermissions:ie,worktree:ve?.worktree,extraCliArgs:ve?.extraCliArgs},be=j8?[]:qt??[];await e.onRelaunch(Gt,be),T(w,Bt||Jc),xr()}catch(ve){const gt=ve instanceof Error?ve.message:"重新启动团队失败";Y(gt),console.error("Failed to relaunch team from dialog:",ve)}finally{te(!1)}})();return}if(ex.length>0){Y(ex[0]);return}if(qf){Y(qf);return}if(d&&fp.blocksSubmission){Y(fp.message);return}if(d&&!Fr){Y("请选择工作目录(cwd)");return}Y(null),te(!0),(async()=>{try{if(d){const ve=j8?[]:_Bn(Ve),gt=AM({providerId:G,selectedEffort:J}),Gt={teamName:w,cwd:Fr,executionTarget:{type:"local",cwd:Fr||void 0},prompt:N.value.trim()||void 0,providerId:G,providerBackendId:IM(G,Ne.get(G))??Ua??void 0,model:vw(oe,H,G,Ne.get(G)),effort:gt,fastMode:W,limitContext:H,clearContext:Ee||void 0,skipPermissions:ie,worktree:We&&Re.trim()?Re.trim():void 0,extraCliArgs:tCe(Fe)};await K.teams.replaceMembers(w,{members:ve}),await e.onLaunch(Gt),T(w,Fr||Jc),xr()}else{const ve=St?parseFloat(St):void 0,gt=IM(G,Ne.get(G))??Ua??void 0,Gt=vw(oe,!1,G,Ne.get(G)),be=AM({providerId:G,selectedEffort:J}),Ke={cwd:Fr,prompt:N.value.trim(),providerId:G,providerBackendId:gt,model:Gt,effort:be,fastMode:W,resolvedFastMode:Uo?.resolvedFastMode??!1,skipPermissions:ie};if(_&&O){const Ft={label:Kn.trim()||void 0,cronExpression:ze.trim(),timezone:_e,warmUpMinutes:de,maxTurns:Ue,maxBudgetUsd:ve,launchConfig:Ke};await er(O.id,Ft)}else{const Ft={teamName:w,label:Kn.trim()||void 0,cronExpression:ze.trim(),timezone:_e,warmUpMinutes:de,maxTurns:Ue,maxBudgetUsd:ve,launchConfig:Ke};await mn(Ft)}xr()}}catch(ve){const gt=ve instanceof Error?ve.message:m?"保存计划失败":p?"重新启动团队失败":"启动团队失败";Y(gt),d&&console.error(p?"Failed to relaunch team from dialog:":"Failed to launch team from dialog:",ve)}finally{te(!1)}})()},sA=p?ne||L_:d?ne||L_||ex.length>0||!!qf||tA||nA||fp.blocksSubmission:ne||ex.length>0||!!qf,DB=d?p?"重新启动团队":"启动团队":_?"编辑计划":"创建计划",LB=d?p?u.jsxs(u.Fragment,{children:["停止 ",u.jsx("span",{className:"font-mono font-medium",children:w})," ","的当前运行,并使用现有配置重新启动。"]}):u.jsxs(u.Fragment,{children:["通过 Agent CLI 启动团队 ",u.jsx("span",{className:"font-mono font-medium",children:w}),"。"]}):_?`正在编辑团队“${w}”的计划`:w?`为团队“${w}”创建自动运行计划`:"创建团队任务自动执行计划",jB=d?p?"重新启动团队":"启动团队":_?"保存更改":"创建计划",XB=d?p?"重新启动中...":"启动中...":_?"保存中...":"创建中...";return u.jsx(Os,{open:t,onOpenChange:ve=>{ve||xr()},children:u.jsxs(ls,{className:m?"max-h-[90vh] w-[calc(100vw-2rem)] max-w-3xl overflow-y-auto sm:w-[48rem]":"w-[calc(100vw-2rem)] max-w-3xl sm:w-[48rem]",children:[u.jsxs(gs,{children:[u.jsx(cs,{className:"text-sm",children:DB}),u.jsx(Ti,{className:"text-xs",children:LB})]}),p?u.jsxs("div",{className:"space-y-3",children:[u.jsx("div",{className:"rounded-md border p-3 text-xs",style:{backgroundColor:"var(--warning-bg)",borderColor:"var(--warning-border)",color:"var(--warning-text)"},children:u.jsxs("div",{className:"flex items-start gap-2",children:[u.jsx(qn,{className:"mt-0.5 size-4 shrink-0"}),u.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[u.jsx("p",{className:"font-medium",children:"重新启动会重置当前团队运行实例"}),u.jsx("p",{className:"opacity-80",children:"系统会停止当前团队进程,并使用以下运行时配置重新启动。 如需修改成员或工作流,请先在团队编辑面板中修改。 默认使用全新会话,避免恢复大上下文时触发 API 频率限制。"})]})]})}),u.jsxs("div",{children:[u.jsx(N8,{providerId:G,onProviderChange:cn,value:oe,onValueChange:Pn,id:"relaunch-model",disableGeminiOption:!0}),u.jsx(Lke,{value:J,onValueChange:tr,id:"relaunch-effort",providerId:G,model:oe,limitContext:!1}),G==="anthropic"?u.jsxs("div",{className:"mt-2",children:[u.jsx(M8,{value:W,onValueChange:Br,providerFastModeDefault:i,model:oe,limitContext:!1,id:"relaunch-fast-mode"}),ae?u.jsx("div",{className:"bg-amber-500/8 mt-2 rounded-md border border-amber-500/25 px-3 py-2 text-[11px] leading-relaxed text-amber-200",children:ae}):null]}):null]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(ni,{id:"relaunch-clear-context",checked:Ee,onCheckedChange:ve=>we(ve===!0)}),u.jsxs(nn,{htmlFor:"relaunch-clear-context",className:"flex cursor-pointer items-center gap-1.5 text-xs font-normal text-text-secondary",children:[u.jsx(hm,{className:"size-3 shrink-0"}),"清空上下文(新会话)"]})]}),!Ee&&u.jsx("div",{className:"rounded-md border px-3 py-2 text-xs",style:{backgroundColor:"rgba(245, 158, 11, 0.08)",borderColor:"rgba(245, 158, 11, 0.25)",color:"#fbbf24"},children:"恢复上次会话会带上旧上下文;当上下文较大或模型处于冷却时,重启更容易触发 API 频率限制。"}),Ee&&u.jsx("div",{className:"rounded-md border px-3 py-2 text-xs",style:{backgroundColor:"var(--warning-bg)",borderColor:"var(--warning-border)",color:"var(--warning-text)"},children:u.jsxs("div",{className:"flex items-start gap-2",children:[u.jsx(qn,{className:"mt-0.5 size-3.5 shrink-0"}),u.jsx("p",{children:"团队负责人会启动一个新会话,不再恢复之前的上下文。已积累的会话记忆和对话历史将不可用。"})]})})]}):null,d&&i1&&!$e?u.jsx("div",{className:"rounded-md border p-3 text-xs",style:{backgroundColor:"var(--warning-bg)",borderColor:"var(--warning-border)",color:"var(--warning-text)"},children:u.jsxs("div",{className:"flex items-start gap-2",children:[u.jsx(qn,{className:"mt-0.5 size-4 shrink-0"}),u.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[u.jsxs("p",{className:"font-medium",children:["该工作目录下已有团队“",i1.displayName,"”正在运行"]}),u.jsx("p",{className:"opacity-80",children:"在同一目录同时运行两个团队存在风险,可能会修改同一批文件。建议改用不同目录或 git worktree 进行隔离。"}),u.jsxs("p",{className:"text-[11px] opacity-70",children:["工作目录:",u.jsx("span",{className:"font-mono",children:Fr})]})]}),u.jsx("button",{type:"button",className:"shrink-0 rounded p-0.5 opacity-60 transition-colors hover:opacity-100",onClick:()=>Ze(!0),children:u.jsx(Ar,{className:"size-3.5"})})]})}):null,d?u.jsx(v4n,{analysis:fp,onOpenDashboard:()=>{xr(),v()}}):null,p?null:u.jsxs("div",{className:"space-y-4",children:[P?u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(nn,{className:"text-xs",children:"团队"}),u.jsx(CB,{options:E,value:y,onValueChange:x,placeholder:"选择团队...",searchPlaceholder:"搜索团队...",emptyMessage:E.length===0?"暂无可用团队,请先创建团队。":"没有匹配的团队。",disabled:E.length===0,renderOption:(ve,gt)=>{const Gt=ve.meta?.color,be=Gt?zr(Gt):Yc(ve.label);return u.jsxs(u.Fragment,{children:[gt?u.jsx(es,{className:"mr-2 size-3.5 shrink-0 text-[var(--color-text)]"}):u.jsx("span",{className:"mr-2 size-3.5 shrink-0 rounded-full",style:{backgroundColor:be.text}}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[gt?u.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:be.text}}):null,u.jsx("p",{className:"truncate font-medium text-[var(--color-text)]",children:ve.label})]}),ve.description?u.jsx("p",{className:"truncate text-[var(--color-text-muted)]",children:ve.description}):null]})]})}})]}):null,m?u.jsxs("div",{className:"rounded-lg border border-[var(--color-border-emphasis)] shadow-sm",style:{backgroundColor:r?"color-mix(in srgb, var(--color-surface-overlay) 24%, white 76%)":"var(--color-surface-overlay)"},children:[u.jsxs("button",{type:"button",className:"flex w-full items-center gap-1.5 px-3 py-2 text-left",onClick:()=>ar(ve=>!ve),children:[Jn?u.jsx(Dr,{className:"size-3.5 shrink-0 text-[var(--color-text-muted)]"}):u.jsx(jn,{className:"size-3.5 shrink-0 text-[var(--color-text-muted)]"}),u.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wider text-[var(--color-text-muted)]",children:"定时计划"}),!Jn&&(Kn||ze)?u.jsx("span",{className:"ml-auto truncate text-[11px] text-[var(--color-text-muted)] opacity-70",children:Kn||ze}):null]}),Jn?u.jsxs("div",{className:"space-y-3 border-t border-[var(--color-border)] px-3 pb-3 pt-2",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(nn,{htmlFor:"schedule-label",className:"label-optional",children:"标签(可选)"}),u.jsx(Mn,{id:"schedule-label",className:"h-8 text-xs",value:Kn,onChange:ve=>En(ve.target.value),placeholder:"例如:每日代码评审、夜间自动测试..."})]}),u.jsx($Bn,{cronExpression:ze,onCronExpressionChange:Pe,timezone:_e,onTimezoneChange:ke,warmUpMinutes:de,onWarmUpMinutesChange:De})]}):null]}):null,u.jsx(ztt,{cwdMode:k,onCwdModeChange:C,selectedProjectPath:M,onSelectedProjectPathChange:I,customCwd:$,onCustomCwdChange:R,projects:Q,projectsLoading:A,projectsError:z}),u.jsxs("div",{className:"rounded-md border border-[var(--color-border)] bg-[var(--color-surface)] p-3",children:[u.jsxs("div",{className:"mb-2",children:[u.jsx("p",{className:"text-xs font-medium text-[var(--color-text)]",children:"团队运行时"}),u.jsx("p",{className:"mt-0.5 text-[11px] text-[var(--color-text-muted)]",children:"Provider 作用于整个团队;成员只选择模型,默认继承这里的 provider。"})]}),u.jsx(N8,{providerId:G,onProviderChange:cn,value:oe,onValueChange:Pn,id:"launch-team-provider-model",disableGeminiOption:!0,modelIssueReasonByValue:oe.trim()?{[oe.trim()]:tx}:void 0})]}),d?u.jsx(UBn,{title:p?"重新启动设置":"可选启动设置",description:p?"重新启动团队前,请确认成员名单和团队负责人运行时。":"默认只需关注项目路径;需要更多控制时再展开这里。",summary:Zm,children:u.jsxs("div",{className:"space-y-4",children:[G==="anthropic"?u.jsxs("div",{className:"space-y-2",children:[u.jsx(M8,{value:W,onValueChange:Br,providerFastModeDefault:i,model:oe,limitContext:Ki,id:"launch-fast-mode"}),ae?u.jsxs("div",{className:"bg-amber-500/8 flex items-start gap-2 rounded-md border border-amber-500/25 px-3 py-2 text-[11px] leading-relaxed text-amber-200",children:[u.jsx(Ks,{className:"mt-0.5 size-3.5 shrink-0 text-amber-300"}),u.jsx("p",{children:ae})]}):null]}):null,u.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-sky-500/20 bg-sky-500/5 px-3 py-2",children:[u.jsx(Ks,{className:"mt-0.5 size-3.5 shrink-0 text-sky-400"}),u.jsx("p",{className:"text-[11px] leading-relaxed text-sky-300",children:"当前为目录工作空间模式:启动时不再写入预置成员,目录文件即记忆,成员会由负责人在运行中动态生成。"})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(nn,{htmlFor:"dialog-prompt",className:"label-optional",children:"给团队负责人的提示(可选)"}),u.jsx(Rm,{id:"dialog-prompt",className:"min-h-[100px] text-xs",minRows:4,maxRows:12,value:N.value,onValueChange:N.setValue,suggestions:eA,projectPath:Fr||null,chips:j.chips,onChipRemove:j.removeChip,onFileChipInsert:j.addChip,placeholder:"填写给团队负责人的说明...",footerRight:N.isSaved?u.jsx("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:"已保存"}):null})]}),u.jsx("div",{children:u.jsx(Mke,{id:"dialog-skip-permissions",checked:ie,onCheckedChange:An})}),u.jsxs("div",{className:"space-y-2",children:[Ds?u.jsx("div",{className:"rounded-md border px-3 py-2 text-xs",style:{backgroundColor:"var(--warning-bg)",borderColor:"var(--warning-border)",color:"var(--warning-text)"},children:u.jsxs("div",{className:"flex items-start gap-2",children:[u.jsx(qn,{className:"mt-0.5 size-3.5 shrink-0"}),u.jsxs("p",{children:["提供商已从 ",zx(cr)," 更改为"," ",zx(G),"。之前的负责人会话不会恢复,负责人会以全新上下文启动,以正确应用新的运行时。"]})]})}):null,u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(ni,{id:"clear-context",checked:Ee,onCheckedChange:ve=>we(ve===!0)}),u.jsxs(nn,{htmlFor:"clear-context",className:"flex cursor-pointer items-center gap-1.5 text-xs font-normal text-text-secondary",children:[u.jsx(hm,{className:"size-3 shrink-0"}),"清空上下文(新会话)"]})]}),Ee&&u.jsx("div",{className:"rounded-md border px-3 py-2 text-xs",style:{backgroundColor:"var(--warning-bg)",borderColor:"var(--warning-border)",color:"var(--warning-text)"},children:u.jsxs("div",{className:"flex items-start gap-2",children:[u.jsx(qn,{className:"mt-0.5 size-3.5 shrink-0"}),u.jsx("p",{children:"团队负责人会启动一个新会话,不再恢复之前的上下文。已积累的会话记忆和对话历史将不可用。"})]})})]}),u.jsx(IBn,{teamName:w,internalArgs:a1,worktreeEnabled:We,onWorktreeEnabledChange:oi,worktreeName:Re,onWorktreeNameChange:ai,customArgs:Fe,onCustomArgsChange:Kc})]})}):u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(nn,{htmlFor:"dialog-prompt",children:"提示词"}),u.jsx(Rm,{id:"dialog-prompt",className:"min-h-[100px] text-xs",minRows:4,maxRows:12,value:N.value,onValueChange:N.setValue,suggestions:eA,projectPath:Fr||null,chips:j.chips,onChipRemove:j.removeChip,onFileChipInsert:j.addChip,placeholder:"填写定时执行时给 Claude 的说明...",footerRight:N.isSaved?u.jsx("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:"已保存"}):null}),u.jsxs("p",{className:"text-[11px] text-[var(--color-text-muted)]",children:["该提示词会传递给 ",u.jsx("code",{className:"font-mono",children:"claude -p"})," 用于 one-shot execution"]})]}),u.jsxs("div",{children:[u.jsx(N8,{providerId:G,onProviderChange:cn,value:oe,onValueChange:Pn,id:"dialog-model",disableGeminiOption:!0}),u.jsx(Lke,{value:J,onValueChange:tr,id:"dialog-effort",providerId:G,model:oe,limitContext:!1}),G==="anthropic"?u.jsxs("div",{className:"mt-2",children:[u.jsx(M8,{value:W,onValueChange:Br,providerFastModeDefault:i,model:oe,limitContext:!1,id:"dialog-fast-mode"}),ae?u.jsx("div",{className:"bg-amber-500/8 mt-2 rounded-md border border-amber-500/25 px-3 py-2 text-[11px] leading-relaxed text-amber-200",children:ae}):null]}):null,u.jsx(Mke,{id:"dialog-skip-permissions",checked:ie,onCheckedChange:An})]})]}),m?u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx(nn,{htmlFor:"schedule-max-turns",className:"text-[11px] text-[var(--color-text-muted)]",children:"Max turns"}),u.jsx(Mn,{id:"schedule-max-turns",type:"number",min:1,max:500,className:"h-8 text-xs",value:Ue,onChange:ve=>mt(Math.max(1,parseInt(ve.target.value)||50))})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(nn,{htmlFor:"schedule-max-budget",className:"text-[11px] text-[var(--color-text-muted)]",children:"Max budget (USD)"}),u.jsx(Mn,{id:"schedule-max-budget",type:"number",min:0,step:.5,className:"h-8 text-xs",value:St,onChange:ve=>ht(ve.target.value),placeholder:"不限"})]})]}):null]}),nx?u.jsxs("div",{className:"flex items-start gap-2 rounded border border-red-500/40 bg-red-500/10 p-2 text-xs text-red-300",children:[u.jsx(qn,{className:"mt-0.5 size-3.5 shrink-0"}),u.jsx("span",{children:nx})]}):null,u.jsxs(qc,{className:d&&!p?"pt-4 sm:justify-between":"pt-4",children:[d&&!p?u.jsxs("div",{className:"min-w-0",children:[zo.state==="idle"||zo.state==="loading"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex items-center gap-2 text-xs text-[var(--color-text-muted)]",children:[u.jsx("span",{className:"inline-block size-3.5 animate-spin rounded-full border-2 border-current border-t-transparent"}),u.jsxs("div",{children:[u.jsx("span",{children:zo.message??(zo.state==="idle"?"正在预热 CLI 环境...":"正在准备环境...")}),u.jsx("p",{className:"mt-0.5 flex items-center gap-1.5 text-[10px] text-[var(--color-text-muted)] opacity-70",children:u.jsxs("span",{children:["启动前检查会提前发现",p?"重新启动":"启动","问题"]})})]})]}),u.jsx(L8,{checks:ct,className:"mt-2"})]}):null,zo.state==="ready"?u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium text-emerald-400",children:[u.jsx(pl,{className:"size-3.5 shrink-0"}),u.jsx("span",{children:ct.some(ve=>ve.status==="notes")||Pt.length>0?"CLI 环境已就绪(有提示)":"CLI 环境已就绪"})]}),zo.message?u.jsx("p",{className:"mt-0.5 pl-5 text-[11px] text-[var(--color-text-muted)]",children:zo.message}):null,u.jsx(L8,{checks:ct,className:"mt-1"}),Pt.length>0&&ct.length===0?u.jsx("div",{className:"mt-0.5 space-y-0.5 pl-5",children:Pt.map(ve=>u.jsx("p",{className:"text-[11px] text-sky-300",children:ve},ve))}):null]}):null,zo.state==="failed"?u.jsxs("div",{className:"text-xs",children:[u.jsxs("div",{className:"flex items-start gap-2 text-red-300",children:[u.jsx(qn,{className:"mt-0.5 size-4 shrink-0"}),u.jsxs("div",{className:"min-w-0",children:[u.jsxs("p",{className:"font-medium",children:["CLI 环境不可用,已阻止",p?"重新启动":"启动"]}),u.jsx("p",{className:"mt-0.5 text-red-300/80",children:zo.message??"准备环境失败"}),u.jsxs("p",{className:"mt-0.5 text-[10px] text-[var(--color-text-muted)] opacity-70",children:["启动前检查会提前发现",p?"重新启动":"启动","问题"]})]})]}),p4n(ct,zo.message)?null:u.jsx(L8,{checks:ct,className:"mt-2",suppressDetailsMatching:zo.message}),Pt.length>0&&ct.length===0?u.jsx("div",{className:"mt-1 space-y-0.5 pl-6",children:Pt.map(ve=>u.jsx("p",{className:"text-[11px]",style:{color:"var(--warning-text)"},children:ve},ve))}):null,u.jsxs("div",{className:"mt-1 flex items-center gap-2 pl-6",children:[u.jsx("p",{className:"text-[11px] text-[var(--color-text-muted)]",children:m4n(zo.message,ct)}),(zo.message??"").toLowerCase().includes("spawn ")||ct.some(ve=>ve.details.some(gt=>gt.toLowerCase().includes("spawn ")))?u.jsx("button",{type:"button",className:"shrink-0 rounded bg-blue-600 px-2 py-0.5 text-[11px] font-medium text-white transition-colors hover:bg-blue-500",onClick:()=>{xr(),v()},children:"前往首页"}):null]})]}):null]}):null,u.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[u.jsx(Xe,{variant:"outline",size:"sm",onClick:xr,children:d?"关闭":"取消"}),u.jsx(Xe,{size:"sm",className:"bg-emerald-600 text-white hover:bg-emerald-700",disabled:sA,onClick:QB,children:ne||L_?u.jsxs(u.Fragment,{children:[u.jsx(Ht,{className:"mr-1.5 size-3.5 animate-spin"}),XB]}):jB})]})]})]})})},N4n=({open:e,teamName:t,taskId:n,members:r,onCancel:s,onSubmit:i})=>{const o=le(m=>m.selectedTeamData?.config.projectPath??null),{suggestions:a}=Gy(t),c=cy({key:`requestChanges:${t}:${n??""}`,enabled:!!(t&&n)}),l=g.useMemo(()=>Zi(r),[r]),d=g.useMemo(()=>r.map(m=>({id:m.name,name:m.name,subtitle:Js(m.role)??Js(m.agentType)??void 0,color:l.get(m.name)})),[r,l]),p=Em(c.value).trim(),f=Zl-p.length,h=()=>{const m=Em(p)||void 0,O=p?Yb(c.value,a):[];c.clearDraft(),i(m,O)};return u.jsx(Os,{open:e&&n!==null,onOpenChange:m=>{m||s()},children:u.jsxs(ls,{className:"w-[600px]",children:[u.jsxs(gs,{children:[u.jsx(cs,{children:"请求修改"}),u.jsxs(Ti,{children:["Task #",n?to(n):""]})]}),u.jsx("div",{className:"grid gap-2 py-2",children:u.jsx(Rm,{id:"review-comment",value:c.value,onValueChange:c.setValue,placeholder:"描述需要修改的内容...(Enter 提交)",suggestions:d,taskSuggestions:a,projectPath:o,onModEnter:h,minRows:4,maxRows:12,maxLength:Zl,cornerAction:u.jsxs("button",{type:"button",className:"inline-flex shrink-0 items-center gap-1 rounded-full bg-red-600 px-3 py-1.5 text-[11px] font-medium text-white shadow-sm transition-colors hover:bg-red-500 disabled:cursor-not-allowed disabled:opacity-50",onClick:h,children:[u.jsx(dE,{size:12}),"提交"]}),footerRight:u.jsxs("div",{className:"flex items-center gap-2",children:[f<200?u.jsxs("span",{className:`text-[10px] ${f<100?"text-yellow-400":"text-[var(--color-text-muted)]"}`,children:["剩余 ",f," 字"]}):null,c.isSaved?u.jsx("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:"已保存"}):null]})})})]})})},A4n=({attachment:e,onRemove:t,onPreview:n,disabled:r})=>{const s=Z0(e.mimeType),i=s?`data:${e.mimeType};base64,${e.data}`:void 0;return u.jsxs("div",{className:"group/att relative flex shrink-0 items-center gap-2 rounded-md border border-[var(--color-border)] bg-[var(--color-surface)] p-1.5",children:[r?u.jsx("div",{className:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center rounded-md bg-black/50",children:u.jsx(ID,{size:18,className:"text-red-400"})}):null,s&&i?u.jsx(l7e,{src:i,alt:e.filename,size:"sm",onClick:n}):u.jsx("div",{className:"flex size-12 items-center justify-center rounded bg-[var(--color-surface-raised)]",children:u.jsx(Ym,{fileName:e.filename,className:"size-5"})}),u.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[u.jsx("span",{className:"max-w-[100px] truncate text-[11px] text-[var(--color-text-secondary)]",children:e.filename}),u.jsx("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:nRn(e.size)})]}),u.jsx("button",{type:"button",className:"absolute -right-1.5 -top-1.5 flex size-4 items-center justify-center rounded-full bg-red-500 text-white opacity-0 transition-opacity group-hover/att:opacity-100",onClick:()=>t(e.id),"aria-label":`Remove ${e.filename}`,children:u.jsx(Ar,{size:10})})]})},ww=400,Htt=({attachments:e,onRemove:t,error:n,onDismissError:r,disabled:s,disabledHint:i})=>{const[o,a]=g.useState(null),[c,l]=g.useState(new Set),d=g.useRef(new Set),[p,f]=g.useState(new Set),h=g.useRef(new Map),m=g.useRef(new Map);g.useEffect(()=>{const x=new Set(e.map(v=>v.id)),S=new Set;for(const v of x)d.current.has(v)||S.add(v);if(d.current=x,S.size!==0){queueMicrotask(()=>{f(v=>{const T=new Set(v);for(const E of S)T.add(E);return T})});for(const v of S){const T=window.setTimeout(()=>{f(E=>{const w=new Set(E);return w.delete(v),w}),m.current.delete(v)},ww);m.current.set(v,T)}}},[e]),g.useEffect(()=>{const x=h.current,S=m.current;return()=>{for(const v of x.values())window.clearTimeout(v);for(const v of S.values())window.clearTimeout(v)}},[]);const O=g.useCallback(x=>{l(v=>new Set(v).add(x));const S=window.setTimeout(()=>{l(v=>{const T=new Set(v);return T.delete(x),T}),h.current.delete(x),t(x)},ww);h.current.set(x,S)},[t]),_=e;if(_.length===0&&c.size===0&&!n)return null;const b=[],y=new Map;return _.forEach((x,S)=>{Z0(x.mimeType)&&(y.set(S,b.length),b.push({src:`data:${x.mimeType};base64,${x.data}`,alt:x.filename}))}),u.jsxs("div",{className:"space-y-1.5 px-1",children:[_.length>0?u.jsx("div",{className:"flex gap-2 overflow-x-auto py-1",children:_.map((x,S)=>{const v=c.has(x.id),T=p.has(x.id);return u.jsx("div",{style:{transition:`transform ${ww}ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity ${ww}ms ease`,transform:v?"scale(0)":T?void 0:"scale(1)",opacity:v?0:1,transformOrigin:"center center",animation:T?`att-scale-in ${ww}ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards`:void 0},children:u.jsx(A4n,{attachment:x,onRemove:O,onPreview:y.has(S)?()=>a(y.get(S)):void 0,disabled:s})},x.id)})}):null,s&&i&&_.length>0?u.jsxs("div",{className:"flex items-center gap-1.5 rounded-md px-2.5 py-1.5",style:{backgroundColor:"var(--warning-bg)",color:"var(--warning-text)"},children:[u.jsx(jo,{size:13,className:"shrink-0"}),u.jsx("p",{className:"text-[11px]",children:i})]}):null,n?u.jsxs("div",{className:"flex items-center gap-1.5 rounded-md bg-red-500/10 px-2.5 py-1.5",children:[u.jsx(jo,{size:13,className:"shrink-0 text-red-400"}),u.jsx("p",{className:"flex-1 text-[11px] text-red-400",children:n}),r?u.jsx("button",{type:"button",className:"shrink-0 rounded p-0.5 text-red-400 transition-colors hover:bg-red-500/20 hover:text-red-300",onClick:r,children:u.jsx(Ar,{size:12})}):null]}):null,o!==null&&b[o]?u.jsx(UE,{open:!0,onClose:()=>a(null),slides:b,index:o}):null]})},Ztt=({active:e,rejected:t,rejectionReason:n})=>e?t?u.jsx("div",{className:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center rounded-md border-2 border-dashed backdrop-blur-[1px]",style:{borderColor:"#ef4444",backgroundColor:"color-mix(in srgb, #ef4444 10%, transparent)"},children:u.jsxs("div",{className:"flex flex-col items-center gap-1.5 text-red-400",children:[u.jsx(ID,{size:24}),u.jsx("span",{className:"text-xs font-medium",children:n??"Files can only be sent to the team lead"})]})}):u.jsx("div",{className:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center rounded-md border-2 border-dashed backdrop-blur-[1px]",style:{borderColor:"var(--color-accent, #6366f1)",backgroundColor:"color-mix(in srgb, var(--color-accent, #6366f1) 10%, transparent)"},children:u.jsxs("div",{className:"flex flex-col items-center gap-1.5",style:{color:"var(--color-accent, #6366f1)"},children:[u.jsx(cU,{size:24}),u.jsx("span",{className:"text-xs font-medium",children:"将文件拖到这里"})]})}):null,Ktt=({warning:e,debugDetails:t,pendingDelayMs:n=1e4})=>{const r=`${e??""}:${t?.messageId??""}`,s=t?.responsePending===!0&&t.delivered!==!1,[i,o]=g.useState(null),[a,c]=g.useState(null),[l,d]=g.useState(()=>s?null:r),p=g.useRef(!0),f=g.useRef(null),h=g.useRef(null),m=i===r,O=a===r,_=g.useMemo(()=>t?JDt(t):"",[t]);if(g.useEffect(()=>(p.current=!0,()=>{p.current=!1,f.current!==null&&window.clearTimeout(f.current),h.current!==null&&window.clearTimeout(h.current)}),[]),g.useEffect(()=>{if(h.current!==null&&(window.clearTimeout(h.current),h.current=null),!e){d(null);return}if(!s||n<=0){d(r);return}d(null),h.current=window.setTimeout(()=>{h.current=null,p.current&&d(r)},n)},[s,r,n,e]),!e||s&&l!==r)return null;const b=async()=>{if(!(!_||!navigator.clipboard?.writeText)){try{await navigator.clipboard.writeText(_)}catch{return}p.current&&(c(r),f.current!==null&&window.clearTimeout(f.current),f.current=window.setTimeout(()=>{f.current=null,p.current&&c(null)},1500))}};return u.jsxs("span",{className:"relative inline-flex flex-col items-start gap-1",children:[u.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-amber-500/10 px-1.5 py-0.5 text-[10px] text-amber-300",children:[u.jsx(jo,{size:10,className:"shrink-0"}),u.jsx("span",{children:e}),t?u.jsx("button",{type:"button",className:"ml-1 rounded px-1 text-[10px] font-medium text-amber-200 underline decoration-amber-300/50 underline-offset-2 hover:text-amber-100","aria-expanded":m,onClick:()=>o(y=>y===r?null:r),children:"Details"}):null]}),m&&t?u.jsxs("span",{className:"z-10 block max-w-[min(34rem,calc(100vw-3rem))] rounded border border-amber-500/20 bg-[var(--color-bg-primary)] p-2 text-left text-[10px] text-[var(--color-text-secondary)] shadow-xl",children:[u.jsxs("span",{className:"grid grid-cols-[auto_1fr] gap-x-2 gap-y-1",children:[u.jsx("span",{className:"text-[var(--color-text-muted)]",children:"messageId"}),u.jsx("span",{className:"break-all",children:t.messageId}),u.jsx("span",{className:"text-[var(--color-text-muted)]",children:"providerId"}),u.jsx("span",{children:t.providerId}),u.jsx("span",{className:"text-[var(--color-text-muted)]",children:"delivered"}),u.jsx("span",{children:String(t.delivered)}),u.jsx("span",{className:"text-[var(--color-text-muted)]",children:"responsePending"}),u.jsx("span",{children:String(t.responsePending)}),u.jsx("span",{className:"text-[var(--color-text-muted)]",children:"responseState"}),u.jsx("span",{children:t.responseState??"null"}),u.jsx("span",{className:"text-[var(--color-text-muted)]",children:"ledgerStatus"}),u.jsx("span",{children:t.ledgerStatus??"null"}),u.jsx("span",{className:"text-[var(--color-text-muted)]",children:"acceptanceUnknown"}),u.jsx("span",{children:String(t.acceptanceUnknown)}),u.jsx("span",{className:"text-[var(--color-text-muted)]",children:"reason"}),u.jsx("span",{children:t.reason??"null"}),u.jsx("span",{className:"text-[var(--color-text-muted)]",children:"diagnostics"}),u.jsx("span",{children:t.diagnostics.length?t.diagnostics.join("; "):"[]"})]}),u.jsx("button",{type:"button",className:"mt-2 rounded border border-amber-500/20 px-2 py-1 text-[10px] text-amber-200 hover:border-amber-400/40 hover:text-amber-100",onClick:()=>void b(),children:O?"Copied":"Copy debug details"})]}):null]})},I4n=500;function M4n(e){return Array.isArray(e)?e.every(t=>{if(typeof t!="object"||t===null)return!1;const n=t;return typeof n.id=="string"&&typeof n.filename=="string"&&typeof n.mimeType=="string"&&typeof n.size=="number"&&typeof n.data=="string"}):!1}function Q4n(e){const t=e?.persistenceKey,[n,r]=g.useState([]),[s,i]=g.useState(null),o=g.useRef([]),a=g.useRef(null),c=g.useRef(null),l=g.useRef(t);l.current=t;const d=g.useRef(e?.onUnsupportedFiles);d.current=e?.onUnsupportedFiles;const p=g.useCallback(T=>{o.current=T,r(T)},[]),f=g.useCallback(T=>{const E=l.current;E&&(c.current={key:E,value:T},a.current!=null&&clearTimeout(a.current),a.current=setTimeout(()=>{a.current=null;const w=c.current;c.current=null,w!=null&&(w.value.length===0?ji.deleteDraft(w.key):ji.saveDraft(w.key,JSON.stringify(w.value)))},I4n))},[]),h=g.useCallback(()=>{if(a.current!=null&&(clearTimeout(a.current),a.current=null),c.current!=null){const T=c.current;c.current=null,T.value.length===0?ji.deleteDraft(T.key):ji.saveDraft(T.key,JSON.stringify(T.value))}},[]);g.useEffect(()=>{if(!t){h(),o.current=[],r([]);return}let T=!1;return h(),o.current=[],r([]),(async()=>{const E=await ji.loadDraft(t);if(!(T||E==null))try{const w=JSON.parse(E);M4n(w)&&(w.reduce((k,C)=>k+C.size,0)<=gv&&w.length<=og?(o.current=w,r(w)):ji.deleteDraft(t))}catch{}})(),()=>{T=!0}},[t,h]),g.useEffect(()=>()=>{h()},[h]);const m=n.reduce((T,E)=>T+E.size,0),O=n.length<og&&m<gv,_=g.useCallback(async T=>{i(null);const E=Array.from(T);if(E.length===0)return;const w=[],P=[];for(const I of E)PN(I)==="unsupported"?P.push(I):w.push(I);if(P.length>0&&(d.current?d.current(P):i(`不支持的文件类型:${P[0].name}`)),w.length===0)return;let k=0,C=!0;for(const I of w){const $=o7e(I);if(!$.valid){i($.error),C=!1;break}k+=I.size}if(!C)return;const M=[];for(const I of w)try{const $=await a7e(I);M.push($)}catch{i(`读取文件失败:${I.name}`),C=!1;break}C&&r(I=>{if(I.length+M.length>og)return i(`最多允许添加 ${og} 个附件`),I;if(I.reduce((N,j)=>N+j.size,0)+k>gv)return i("附件总大小超过 20MB 限制"),I;const R=[...I,...M];return o.current=R,f(R),R})},[f]),b=g.useCallback(T=>{r(E=>{const w=E.filter(P=>P.id!==T);return o.current=w,f(w),w}),i(null)},[f]),y=g.useCallback(()=>{i(null)},[]),x=g.useCallback(()=>{a.current!=null&&(clearTimeout(a.current),a.current=null),c.current=null,o.current=[],p([]),i(null);const T=l.current;T&&ji.deleteDraft(T)},[p]),S=g.useCallback(T=>{const E=T.clipboardData?.items;if(!E)return;const w=[];for(const P of Array.from(E))if(P.kind==="file"){const k=P.getAsFile();k&&w.push(k)}w.length>0&&(T.preventDefault(),_(w))},[_]),v=g.useCallback(T=>{T.preventDefault();const E=T.dataTransfer?.files;E?.length&&_(Array.from(E))},[_]);return{attachments:n,error:s,totalSize:m,canAddMore:O,addFiles:_,removeAttachment:b,clearAttachments:x,clearError:y,handlePaste:S,handleDrop:v}}const D4n=({open:e,teamName:t,members:n,defaultRecipient:r,defaultText:s,defaultChip:i,quotedMessage:o,isTeamAlive:a,sending:c,sendError:l,sendWarning:d,sendDebugDetails:p,lastResult:f,onSend:h,onClose:m})=>{const O=g.useMemo(()=>Zi(n),[n]),_=le(Ge=>Ge.selectedTeamData?.config.projectPath??null),[b,y]=g.useState(void 0),[x,S]=g.useState(!1),[v,T]=g.useState(""),E=cy({key:`sendMessage:${t}:text`}),w=NN(`sendMessage:${t}:chips`),P=g.useRef(!1),k=g.useRef(null),[C,M]=g.useState(!1),I=g.useRef(0),$=g.useRef(null),[R,N]=g.useState(null),j=g.useRef(0),{attachments:Q,error:U,canAddMore:A,addFiles:V,removeAttachment:z,clearAttachments:L,clearError:q,handlePaste:Y,handleDrop:ne}=Q4n({persistenceKey:`sendMessage:${t}:attachments`}),te=n.find(Ge=>Ge.name===v),G=te?Yn(te):!1,Z=G&&!!a,oe=Z&&A,re=Z?void 0:G?"团队在线时才能添加文件":"文件只能发送给团队负责人",[se,he]=g.useState(!1);g.useEffect(()=>{if(e&&!P.current){const Ge=n.find(Lt=>Yn(Lt))?.name;if(T(r??Ge??""),y(o),S(!1),k.current=f,i){const Lt=$f(i);E.setValue(Lt+`
1827
1827
  `),w.setChips([i])}else s&&E.setValue(s)}P.current=e},[e,r,s,i,o,f,n,E,w]),g.useEffect(()=>{e&&f&&f!==k.current&&(k.current=f,T(""),he(!0))},[e,f]),g.useEffect(()=>{se&&(E.clearDraft(),w.clearChipDraft(),L(),he(!1),m())},[se]);const ee=(b?.text.length??0)>120,ye=g.useMemo(()=>n.map(Ge=>({id:Ge.name,name:Ge.name,subtitle:Js(Ge.role)??Js(Ge.agentType)??void 0,color:O.get(Ge.name)})),[n,O]),{suggestions:Oe}=AN(t),{suggestions:ie}=Gy(t),ge=Q.length>0&&!Z,J=Em(E.value).trim(),F=FE(J,w.chips),W=b?Zoe(b.from,b.text,F):F,ue=Zl-W.length,ae=v.trim().length>0&&W.length>0&&W.length<=Zl&&!c&&!ge,ce=Ge=>{const Pt=w.chips.find(Lt=>Lt.id===Ge);Pt&&E.setValue(C2(E.value,Pt)),w.setChips(w.chips.filter(Lt=>Lt.id!==Ge))},H=()=>{if(!ae)return;const Ge=Yb(E.value,ie);Promise.resolve(h(v.trim(),W,J,Q.length>0?Q:void 0,void 0,Ge)).then(Pt=>{Pt?.runtimeDelivery?.attempted===!0&&Pt.runtimeDelivery.delivered===!1||(E.clearDraft(),w.clearChipDraft(),L())}).catch(()=>{})},pe=Ge=>{Ge||m()},Ee=g.useCallback(Ge=>{const Pt=Ge.target;Pt.files?.length&&V(Pt.files),Pt.value=""},[V]),we=g.useCallback(()=>{N(re??"文件只能发送给团队负责人"),window.clearTimeout(j.current),j.current=window.setTimeout(()=>{N(null)},4e3)},[re]);g.useEffect(()=>{const Ge=j;return()=>window.clearTimeout(Ge.current)},[]);const $e=g.useCallback(Ge=>{Ge.preventDefault(),I.current+=1,I.current===1&&M(!0)},[]),Ze=g.useCallback(Ge=>{Ge.preventDefault(),I.current-=1,I.current<=0&&(I.current=0,M(!1))},[]),lt=g.useCallback(Ge=>{Ge.preventDefault()},[]),yt=g.useCallback(Ge=>{if(Ge.preventDefault(),I.current=0,M(!1),!Z){Ge.dataTransfer?.files?.length&&we();return}ne(Ge)},[Z,ne,we]),xt=g.useCallback(Ge=>{if(!Z){Array.from(Ge.clipboardData.items).some(Lt=>Lt.kind==="file")&&(Ge.preventDefault(),we());return}Y(Ge)},[Z,Y,we]);return u.jsx(Os,{open:e,onOpenChange:pe,children:u.jsxs(ls,{className:"min-w-0 max-w-3xl",onDragEnter:$e,onDragLeave:Ze,onDragOver:lt,onDrop:yt,onPaste:xt,children:[u.jsx(Ztt,{active:C,rejected:!Z,rejectionReason:re}),u.jsxs(gs,{children:[u.jsx(cs,{children:"发送消息"}),u.jsx(Ti,{children:"向团队成员发送一条私信。"})]}),u.jsxs("div",{className:"grid gap-4 py-2",children:[u.jsxs("div",{className:"grid gap-2",children:[u.jsx(nn,{htmlFor:"smd-recipient",children:"接收人"}),u.jsx(mae,{members:n,value:v||null,onChange:Ge=>T(Ge??""),placeholder:"选择成员...",size:"sm"})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(nn,{htmlFor:"smd-message",children:"消息内容"}),G?u.jsxs(u.Fragment,{children:[u.jsx("input",{ref:$,type:"file",accept:"*/*",multiple:!0,className:"hidden",onChange:Ee}),u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx("button",{type:"button",className:`inline-flex items-center gap-1 rounded p-1 transition-colors ${oe?"text-[var(--color-text-secondary)] hover:text-[var(--color-text)]":"text-[var(--color-text-muted)] opacity-40"}`,disabled:!oe,onClick:()=>$.current?.click(),children:u.jsx(cU,{size:14})})}),u.jsx(nt,{side:"top",children:a?A?"添加文件(支持粘贴或拖拽)":"已达到附件上限":"团队在线时才能添加文件"})]})]}):null]}),u.jsx(Htt,{attachments:Q,onRemove:z,error:U??R,onDismissError:q,disabled:ge,disabledHint:"仅在团队在线且接收人为团队负责人时支持附件。请移除附件或切换接收人。"}),u.jsxs("div",{className:b?"flex flex-col":"contents",children:[b?u.jsxs("div",{className:"relative overflow-hidden rounded-t-md border border-b-0 border-blue-400/30 bg-blue-100/80 py-2 pl-3 pr-2 dark:border-blue-500/20 dark:bg-blue-950/20",children:[u.jsx("span",{className:"pointer-events-none absolute -right-1 top-1/2 -translate-y-1/2 select-none font-serif text-[64px] leading-none text-blue-500/[0.08] dark:text-blue-400/[0.08]",children:"“"}),u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx("button",{type:"button",className:"absolute right-1.5 top-1.5 z-10 rounded p-0.5 text-blue-400/60 hover:text-blue-600 dark:text-blue-300/40 dark:hover:text-blue-200",onClick:()=>y(void 0),children:u.jsx(Ar,{size:12})})}),u.jsx(nt,{side:"left",children:"移除引用"})]}),u.jsxs("div",{className:"mb-1 flex items-center gap-1.5",children:[u.jsx("span",{className:"text-[10px] text-blue-600/70 dark:text-blue-300/60",children:"正在回复"}),u.jsx(Ur,{name:b.from,color:O.get(b.from),size:"sm"})]}),u.jsx("div",{className:`pr-5 opacity-60 dark:opacity-50 ${x?"":"max-h-[3.75rem] overflow-hidden"}`,children:u.jsx(ri,{content:b.text,bare:!0,maxHeight:x?"max-h-48":"max-h-[3.75rem]"})}),ee?u.jsx("button",{type:"button",className:"mt-0.5 text-[10px] text-blue-500 hover:text-blue-700 dark:text-blue-400/60 dark:hover:text-blue-300",onClick:()=>S(Ge=>!Ge),children:x?"收起":"展开"}):null]}):null,u.jsx(Rm,{id:"smd-message",className:b?"rounded-t-none":void 0,placeholder:"输入消息...(回车发送)",value:E.value,onValueChange:E.setValue,suggestions:ye,teamSuggestions:Oe,taskSuggestions:ie,chips:w.chips,onChipRemove:ce,projectPath:_,onFileChipInsert:Ge=>w.setChips([...w.chips,Ge]),onModEnter:H,minRows:4,maxRows:12,maxLength:Zl,disabled:c,cornerAction:u.jsxs("button",{type:"button",className:"inline-flex shrink-0 items-center gap-1 rounded-full bg-blue-600 px-3 py-1.5 text-[11px] font-medium text-white shadow-sm transition-colors hover:bg-blue-500 disabled:cursor-not-allowed disabled:opacity-50",disabled:!ae,onClick:H,children:[u.jsx(dE,{size:12}),c?"发送中...":"发送"]}),footerRight:u.jsxs("div",{className:"flex items-center gap-2",children:[l?u.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-red-500/10 px-1.5 py-0.5 text-[10px] text-red-400",children:[u.jsx(jo,{size:10,className:"shrink-0"}),l]}):d?u.jsx(Ktt,{warning:d,debugDetails:p}):null,ue<200?u.jsxs("span",{className:`text-[10px] ${ue<100?"text-yellow-400":"text-[var(--color-text-muted)]"}`,children:["剩余 ",ue," 字符"]}):null,E.isSaved?u.jsx("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:"已保存"}):null]})})]})]})]})]})})};async function L4n({teamName:e,isTeamAlive:t,request:n,members:r,stopTeam:s,replaceMembers:i,launchTeam:o}){t&&await s(e),await i(e,{members:r}),await o(n)}function Sce(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function j4n(e,t){return e.reduce((n,r,s)=>{const i=t.get(r);return i&&(n[s]=i),n},Array(e.length))}function DM(e){return e!==null&&e>=0}function X4n(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function U4n(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const LM={scaleX:1,scaleY:1},z4n=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:s,overIndex:i,index:o}=e;const a=(t=n[s])!=null?t:r;if(!a)return null;const c=B4n(n,o,s);if(o===s){const l=n[i];return l?{x:s<i?l.left+l.width-(a.left+a.width):l.left-a.left,y:0,...LM}:null}return o>s&&o<=i?{x:-a.width-c,y:0,...LM}:o<s&&o>=i?{x:a.width+c,y:0,...LM}:{x:0,y:0,...LM}};function B4n(e,t,n){const r=e[t],s=e[t-1],i=e[t+1];return!r||!s&&!i?0:n<t?s?r.left-(s.left+s.width):i.left-(r.left+r.width):i?i.left-(r.left+r.width):r.left-(s.left+s.width)}const Jtt=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const i=Sce(t,r,n),o=t[s],a=i[s];return!a||!o?null:{x:a.left-o.left,y:a.top-o.top,scaleX:a.width/o.width,scaleY:a.height/o.height}},jM={scaleX:1,scaleY:1},F4n=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:s,rects:i,overIndex:o}=e;const a=(t=i[n])!=null?t:r;if(!a)return null;if(s===n){const l=i[o];return l?{x:0,y:n<o?l.top+l.height-(a.top+a.height):l.top-a.top,...jM}:null}const c=Y4n(i,s,n);return s>n&&s<=o?{x:0,y:-a.height-c,...jM}:s<n&&s>=o?{x:0,y:a.height+c,...jM}:{x:0,y:0,...jM}};function Y4n(e,t,n){const r=e[t],s=e[t-1],i=e[t+1];return r?n<t?s?r.top-(s.top+s.height):i?i.top-(r.top+r.height):0:i?i.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const ent="Sortable",tnt=Je.createContext({activeIndex:-1,containerId:ent,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Jtt,disabled:{draggable:!1,droppable:!1}});function nnt(e){let{children:t,id:n,items:r,strategy:s=Jtt,disabled:i=!1}=e;const{active:o,dragOverlay:a,droppableRects:c,over:l,measureDroppableContainers:d}=Lse(),p=F$(ent,n),f=a.rect!==null,h=g.useMemo(()=>r.map(T=>typeof T=="object"&&"id"in T?T.id:T),[r]),m=o!=null,O=o?h.indexOf(o.id):-1,_=l?h.indexOf(l.id):-1,b=g.useRef(h),y=!X4n(h,b.current),x=_!==-1&&O===-1||y,S=U4n(i);ep(()=>{y&&m&&d(h)},[y,h,m,d]),g.useEffect(()=>{b.current=h},[h]);const v=g.useMemo(()=>({activeIndex:O,containerId:p,disabled:S,disableTransforms:x,items:h,overIndex:_,useDragOverlay:f,sortedRects:j4n(h,c),strategy:s}),[O,p,S.draggable,S.droppable,x,h,_,c,f,s]);return Je.createElement(tnt.Provider,{value:v},t)}const V4n=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return Sce(n,r,s).indexOf(t)},q4n=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:s,items:i,newIndex:o,previousItems:a,previousContainerId:c,transition:l}=e;return!l||!r||a!==i&&s===o?!1:n?!0:o!==s&&t===c},W4n={duration:200,easing:"ease"},rnt="transform",G4n=Tm.Transition.toString({property:rnt,duration:0,easing:"linear"}),H4n={roleDescription:"sortable"};function Z4n(e){let{disabled:t,index:n,node:r,rect:s}=e;const[i,o]=g.useState(null),a=g.useRef(n);return ep(()=>{if(!t&&n!==a.current&&r.current){const c=s.current;if(c){const l=wE(r.current,{ignoreTransform:!0}),d={x:c.left-l.left,y:c.top-l.top,scaleX:c.width/l.width,scaleY:c.height/l.height};(d.x||d.y)&&o(d)}}n!==a.current&&(a.current=n)},[t,n,r,s]),g.useEffect(()=>{i&&o(null)},[i]),i}function snt(e){let{animateLayoutChanges:t=q4n,attributes:n,disabled:r,data:s,getNewIndex:i=V4n,id:o,strategy:a,resizeObserverConfig:c,transition:l=W4n}=e;const{items:d,containerId:p,activeIndex:f,disabled:h,disableTransforms:m,sortedRects:O,overIndex:_,useDragOverlay:b,strategy:y}=g.useContext(tnt),x=K4n(r,h),S=d.indexOf(o),v=g.useMemo(()=>({sortable:{containerId:p,index:S,items:d},...s}),[p,s,S,d]),T=g.useMemo(()=>d.slice(d.indexOf(o)),[d,o]),{rect:E,node:w,isOver:P,setNodeRef:k}=jse({id:o,data:v,disabled:x.droppable,resizeObserverConfig:{updateMeasurementsFor:T,...c}}),{active:C,activatorEvent:M,activeNodeRect:I,attributes:$,setNodeRef:R,listeners:N,isDragging:j,over:Q,setActivatorNodeRef:U,transform:A}=oXt({id:o,data:v,attributes:{...H4n,...n},disabled:x.draggable}),V=Y5t(k,R),z=!!C,L=z&&!m&&DM(f)&&DM(_),q=!b&&j,Y=q&&L?A:null,te=L?Y??(a??y)({rects:O,activeNodeRect:I,activeIndex:f,overIndex:_,index:S}):null,G=DM(f)&&DM(_)?i({id:o,items:d,activeIndex:f,overIndex:_}):S,Z=C?.id,oe=g.useRef({activeId:Z,items:d,newIndex:G,containerId:p}),re=d!==oe.current.items,se=t({active:C,containerId:p,isDragging:j,isSorting:z,id:o,index:S,items:d,newIndex:oe.current.newIndex,previousItems:oe.current.items,previousContainerId:oe.current.containerId,transition:l,wasDragging:oe.current.activeId!=null}),he=Z4n({disabled:!se,index:S,node:w,rect:E});return g.useEffect(()=>{z&&oe.current.newIndex!==G&&(oe.current.newIndex=G),p!==oe.current.containerId&&(oe.current.containerId=p),d!==oe.current.items&&(oe.current.items=d)},[z,G,p,d]),g.useEffect(()=>{if(Z===oe.current.activeId)return;if(Z!=null&&oe.current.activeId==null){oe.current.activeId=Z;return}const ee=setTimeout(()=>{oe.current.activeId=Z},50);return()=>clearTimeout(ee)},[Z]),{active:C,activeIndex:f,attributes:$,data:v,rect:E,index:S,newIndex:G,items:d,isOver:P,isSorting:z,isDragging:j,listeners:N,node:w,overIndex:_,over:Q,setNodeRef:V,setActivatorNodeRef:U,setDroppableNodeRef:k,setDraggableNodeRef:R,transform:he??te,transition:Te()};function Te(){if(he||re&&oe.current.newIndex===S)return G4n;if(!(q&&!lz(M)||!l)&&(z||se))return Tm.Transition.toString({...l,property:rnt})}}function K4n(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(r=e?.droppable)!=null?r:t.droppable}}Wr.Down,Wr.Right,Wr.Up,Wr.Left;const int="kanban-column-widths:",ont=180,nCe=256;function rCe(e){try{const t=localStorage.getItem(int+e);if(!t)return{};const n=JSON.parse(t);if(typeof n!="object"||n===null||Array.isArray(n))return{};const r={};for(const[s,i]of Object.entries(n))typeof i=="number"&&i>=ont&&(r[s]=i);return r}catch{return{}}}function J4n(e,t){try{localStorage.setItem(int+e,JSON.stringify(t))}catch{}}function eFn({storageKey:e,columnIds:t}){const[n,r]=g.useState(()=>rCe(e));g.useEffect(()=>{r(rCe(e))},[e]);const s=g.useRef(null),i=g.useRef(null),o=new Map;for(const d of t)o.set(d,n[d]??nCe);const a=g.useCallback(d=>{const p=s.current;if(!p)return;const f=d.clientX-p.startX,h=Math.max(ont,p.startWidth+f);r(m=>({...m,[p.leftId]:h}))},[]),c=g.useCallback(()=>{s.current&&(s.current=null,i.current?.abort(),i.current=null,document.body.style.cursor="",document.body.style.userSelect="",r(p=>(J4n(e,p),p)))},[e]);g.useEffect(()=>()=>{s.current=null,i.current?.abort(),i.current=null,document.body.style.cursor="",document.body.style.userSelect=""},[]);const l=g.useCallback(d=>({onPointerDown:p=>{p.preventDefault();const f=n[d]??nCe;s.current={leftId:d,startX:p.clientX,startWidth:f},i.current?.abort();const h=new AbortController;i.current=h,document.addEventListener("pointermove",a,{signal:h.signal}),document.addEventListener("pointerup",c,{signal:h.signal}),document.body.style.cursor="col-resize",document.body.style.userSelect="none"},style:{cursor:"col-resize",width:8,flexShrink:0,alignSelf:"stretch"},"aria-label":`Resize column ${d}`}),[n,a,c]);return{widths:o,getHandleProps:l}}const sCe=g.memo(function({title:t,count:n,icon:r,headerBg:s,bodyBg:i,className:o,headerClassName:a,bodyClassName:c,headerDragClassName:l,headerAccessory:d,children:p}){return u.jsxs("section",{className:at("relative rounded-md",o,!i&&"bg-[var(--color-surface)]"),style:i?{backgroundColor:i}:void 0,children:[n>0&&u.jsx(Ut,{variant:"secondary",className:"absolute -right-2 -top-2 z-10 min-w-5 px-1.5 py-0 text-[10px] font-medium leading-5",children:n}),u.jsxs("header",{className:at("rounded-t-md px-3 py-2",a,l),style:s?{backgroundColor:s}:void 0,children:[u.jsxs("h4",{className:"flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-[var(--color-text)]",children:[r,t]}),d&&u.jsx("div",{className:"absolute right-2 top-2 z-10",children:d})]}),u.jsx("div",{className:at("flex max-h-[480px] flex-col gap-1.5 overflow-auto p-2",c),children:p})]})}),tFn=/^agent_teams_ui\s+\[Agent Team:\s*["\u201C]([^"\u201D]+)["\u201D]\s*\|\s*Project:\s*["\u201C]([^"\u201D]+)["\u201D]\s*\|\s*Lead:\s*["\u201C]([^"\u201D]+)["\u201D]\]/,nFn=/^Team Start\s+\[Agent Team:\s*["\u201C]([^"\u201D]+)["\u201D]\s*\|\s*Project:\s*["\u201C]([^"\u201D]+)["\u201D]\s*\|\s*Lead:\s*["\u201C]([^"\u201D]+)["\u201D]\]/,rFn=/^(?:\[Image\s+#\d+\]\s*)+/;function sFn(e){if(!e)return{kind:"regular",displayText:"Untitled"};const t=tFn.exec(e);if(t)return{kind:"team-new",displayText:t[1],teamName:t[1],projectName:t[2]};const n=e.replace(/^(Team Start)\s*\(resume\)/,"$1"),r=nFn.exec(n);return r?{kind:"team-resume",displayText:r[1],teamName:r[1],projectName:r[2]}:{kind:"regular",displayText:e.replace(rFn,"").trim()||"Untitled"}}function iFn(e){return sFn(e).displayText}const Xee="__unassigned__",oFn=[{id:"todo",label:"待处理",color:"rgb(59, 130, 246)"},{id:"in_progress",label:"进行中",color:"rgb(234, 179, 8)"},{id:"done",label:"已完成",color:"rgb(34, 197, 94)"}],aFn=({filter:e,sessions:t,leadSessionId:n,members:r,onFilterChange:s})=>{const i=g.useMemo(()=>{let d=0;return e.sessionId!==null&&(d+=1),e.selectedOwners.size>0&&(d+=1),e.columns.size>0&&(d+=1),d},[e.sessionId,e.selectedOwners,e.columns]),o=d=>{s({...e,sessionId:d})},a=d=>{const p=new Set(e.selectedOwners);p.has(d)?p.delete(d):p.add(d),s({...e,selectedOwners:p})},c=d=>{const p=new Set(e.columns);p.has(d)?p.delete(d):p.add(d),s({...e,columns:p})},l=()=>{s({sessionId:null,selectedOwners:new Set,columns:new Set})};return u.jsxs(Wc,{children:[u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx(Ku,{asChild:!0,children:u.jsxs(Xe,{variant:"ghost",size:"sm",className:"relative h-7 px-2 text-[var(--color-text-muted)] hover:text-[var(--color-text)]","aria-label":"筛选任务",children:[u.jsx(lU,{size:14}),i>0&&u.jsx("span",{className:"absolute -right-1 -top-1 flex size-4 items-center justify-center rounded-full bg-blue-500 text-[10px] font-medium text-white",children:i})]})})}),u.jsx(nt,{side:"bottom",children:"筛选任务"})]}),u.jsxs(oc,{align:"end",className:"w-72 p-0",children:[u.jsxs("div",{className:"border-b border-[var(--color-border)] p-3",children:[u.jsx("p",{className:"mb-2 text-[11px] font-medium uppercase tracking-wider text-[var(--color-text-muted)]",children:"会话"}),u.jsxs("div",{className:"max-h-40 space-y-0.5 overflow-y-auto",children:[u.jsx("button",{type:"button",className:`w-full rounded-md px-2 py-1.5 text-left text-xs transition-colors ${e.sessionId===null?"bg-blue-500/15 text-blue-300":"text-[var(--color-text-secondary)] hover:bg-[var(--color-surface-raised)]"}`,onClick:()=>o(null),children:"全部会话"}),t.map(d=>{const p=d.id===n,f=e.sessionId===d.id,h=iFn(d.firstMessage)||d.id.slice(0,8);return u.jsxs("button",{type:"button",className:`flex w-full items-center gap-1.5 rounded-md px-2 py-1.5 text-left text-xs transition-colors ${f?"bg-blue-500/15 text-blue-300":"text-[var(--color-text-secondary)] hover:bg-[var(--color-surface-raised)]"}`,onClick:()=>o(f?null:d.id),children:[p&&u.jsx(tpt,{size:11,className:"shrink-0 text-blue-400"}),u.jsx("span",{className:"truncate",children:h})]},d.id)})]})]}),u.jsxs("div",{className:"border-b border-[var(--color-border)] p-3",children:[u.jsx("p",{className:"mb-2 text-[11px] font-medium uppercase tracking-wider text-[var(--color-text-muted)]",children:"成员"}),u.jsxs("div",{className:"space-y-1.5",children:[r.map(d=>u.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded-md px-1 py-0.5 text-xs text-[var(--color-text-secondary)] hover:bg-[var(--color-surface-raised)]",children:[u.jsx(ni,{checked:e.selectedOwners.has(d.name),onCheckedChange:()=>a(d.name)}),ml(d.name)]},d.name)),u.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded-md px-1 py-0.5 text-xs italic text-[var(--color-text-muted)] hover:bg-[var(--color-surface-raised)]",children:[u.jsx(ni,{checked:e.selectedOwners.has(Xee),onCheckedChange:()=>a(Xee)}),"(未分配)"]})]})]}),u.jsxs("div",{className:"border-b border-[var(--color-border)] p-3",children:[u.jsx("p",{className:"mb-2 text-[11px] font-medium uppercase tracking-wider text-[var(--color-text-muted)]",children:"列"}),u.jsx("div",{className:"space-y-1.5",children:oFn.map(d=>u.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded-md px-1 py-0.5 text-xs hover:bg-[var(--color-surface-raised)]",style:{color:d.color},children:[u.jsx(ni,{checked:e.columns.has(d.id),onCheckedChange:()=>c(d.id)}),d.label]},d.id))})]}),u.jsx("div",{className:"flex justify-end p-2",children:u.jsx(Xe,{variant:"ghost",size:"sm",className:"h-6 px-2 text-[11px] text-[var(--color-text-muted)] hover:text-[var(--color-text)]",disabled:i===0,onClick:l,children:"清空筛选"})})]})]})},lFn=[{field:"updatedAt",label:"最近更新",description:"按最近更新时间排序",icon:u.jsx(nc,{size:14})},{field:"createdAt",label:"创建时间",description:"按最新创建排序",icon:u.jsx(Xv,{size:14})},{field:"owner",label:"负责人",description:"按负责人名称排序",icon:u.jsx(dU,{size:14})},{field:"manual",label:"手动排序",description:"按拖拽顺序显示",icon:u.jsx(Qpt,{size:14})}],cFn=({sort:e,onSortChange:t})=>{const n=e.field!=="updatedAt";return u.jsxs(Wc,{children:[u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx(Ku,{asChild:!0,children:u.jsxs(Xe,{variant:"ghost",size:"sm",className:"relative h-7 px-2 text-[var(--color-text-muted)] hover:text-[var(--color-text)]","aria-label":"任务排序",children:[u.jsx(CIe,{size:14}),n&&u.jsx("span",{className:"absolute -right-1 -top-1 flex size-4 items-center justify-center rounded-full bg-blue-500 text-[10px] font-medium text-white",children:"1"})]})})}),u.jsx(nt,{side:"bottom",children:"任务排序"})]}),u.jsxs(oc,{align:"end",className:"w-56 p-0",children:[u.jsxs("div",{className:"p-3",children:[u.jsx("p",{className:"mb-2 text-[11px] font-medium uppercase tracking-wider text-[var(--color-text-muted)]",children:"排序方式"}),u.jsx("div",{className:"space-y-0.5",children:lFn.map(r=>{const s=e.field===r.field;return u.jsxs("button",{type:"button",className:at("flex w-full items-center gap-2.5 rounded-md px-2 py-1.5 text-left text-xs transition-colors",s?"bg-blue-500/15 text-blue-300":"text-[var(--color-text-secondary)] hover:bg-[var(--color-surface-raised)]"),onClick:()=>t({field:r.field}),children:[u.jsx("span",{className:at("shrink-0",s?"text-blue-400":"text-[var(--color-text-muted)]"),children:r.icon}),u.jsxs("div",{className:"min-w-0",children:[u.jsx("div",{className:"font-medium",children:r.label}),u.jsx("div",{className:at("text-[10px]",s?"text-blue-300/70":"text-[var(--color-text-muted)]"),children:r.description})]}),s&&u.jsx(Vut,{size:12,className:"ml-auto shrink-0 text-blue-400"})]},r.field)})})]}),n&&u.jsx("div",{className:"flex justify-end border-t border-[var(--color-border)] p-2",children:u.jsx(Xe,{variant:"ghost",size:"sm",className:"h-6 px-2 text-[11px] text-[var(--color-text-muted)] hover:text-[var(--color-text)]",onClick:()=>t({field:"updatedAt"}),children:"重置"})})]})]})},iCe={todo:{headerBg:"rgba(59, 130, 246, 0.22)",bodyBg:"rgba(59, 130, 246, 0.05)",icon:u.jsx(AIe,{size:14,className:"shrink-0 text-[var(--color-text-muted)]"})},in_progress:{headerBg:"rgba(234, 179, 8, 0.24)",bodyBg:"rgba(234, 179, 8, 0.06)",icon:u.jsx(Adt,{size:14,className:"shrink-0 text-[var(--color-text-muted)]"})},done:{headerBg:"rgba(34, 197, 94, 0.22)",bodyBg:"rgba(34, 197, 94, 0.05)",icon:u.jsx(pl,{size:14,className:"shrink-0 text-[var(--color-text-muted)]"})}},uFn=new Set(["auto","scroll","overlay"]),kw=[{id:"todo",title:"TODO"},{id:"in_progress",title:"IN PROGRESS"},{id:"done",title:"DONE"}];function dFn(e,t){const n=t.tasks[e.id];return n?.column&&(n.column==="review"||n.column==="approved")?"done":e.status==="pending"?"todo":e.status==="in_progress"?"in_progress":e.status==="completed"?"done":null}function pFn(e,t){if(!t?.length)return e;const n=new Map(e.map(i=>[i.id,i])),r=[],s=new Set;for(const i of t){const o=n.get(i);o&&(r.push(o),s.add(i))}for(const i of e)s.has(i.id)||r.push(i);return r}function fFn(e,t,n){return t==="manual"?pFn(e,n):[...e].sort((r,s)=>{if(t==="updatedAt"){const i=r.updatedAt?new Date(r.updatedAt).getTime():r.createdAt?new Date(r.createdAt).getTime():0;return(s.updatedAt?new Date(s.updatedAt).getTime():s.createdAt?new Date(s.createdAt).getTime():0)-i}if(t==="createdAt"){const i=r.createdAt?new Date(r.createdAt).getTime():0;return(s.createdAt?new Date(s.createdAt).getTime():0)-i}if(t==="owner"){const i=(r.owner??"").toLowerCase(),o=(s.owner??"").toLowerCase();return!i&&!o?0:i?o?i.localeCompare(o):-1:1}return 0})}const hFn=({task:e,memberColorMap:t})=>u.jsx("div",{"data-task-id":e.id,className:"rounded-md border border-[var(--color-border)] bg-[var(--color-surface-raised)] p-2 text-xs shadow-sm",children:u.jsxs("div",{className:"flex items-start justify-between gap-2",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("div",{className:"text-[10px] text-[var(--color-text-muted)]",children:Gr(e)}),u.jsx("div",{className:"mt-0.5 line-clamp-2 font-medium text-[var(--color-text)]",children:e.subject})]}),e.owner?u.jsx(Ur,{name:e.owner,color:t.get(e.owner),size:"xs"}):null]})}),mFn=({task:e,columnId:t,memberColorMap:n})=>{const{attributes:r,listeners:s,setNodeRef:i,transform:o,transition:a,isDragging:c}=snt({id:e.id,data:{type:"kanban-task",columnId:t,taskId:e.id}}),l={transform:Tm.Transform.toString(o),transition:a,opacity:c?.5:1};return u.jsx("div",{ref:i,style:l,...r,...s,children:u.jsx(hFn,{task:e,memberColorMap:n})})},OFn=({tasks:e,teamName:t,kanbanState:n,filter:r,sort:s,sessions:i,leadSessionId:o,members:a,onFilterChange:c,onSortChange:l,onRequestReview:d,onApprove:p,onRequestChanges:f,onMoveBackToDone:h,onStartTask:m,onCompleteTask:O,onCancelTask:_,onScrollToTask:b,onTaskClick:y,onViewChanges:x,onColumnOrderChange:S,toolbarLeft:v,onAddTask:T,onDeleteTask:E,deletedTaskCount:w,onOpenTrash:P})=>{const k=g.useRef(null),C=g.useRef([]),[M,I]=g.useState("grid"),$=M==="columns"&&!!S&&s.field==="manual",R=g.useRef(null),N=g.useMemo(()=>{const ee=e.map(ie=>`${ie.id}\0${ie.displayId??""}\0${ie.subject}\0${ie.status}`),ye=R.current;if(ye?.signatures.length===ee.length&&ye.signatures.every((ie,ge)=>ie===ee[ge]))return ye.map;const Oe=new Map(e.map(ie=>[ie.id,ie]));return R.current={signatures:ee,map:Oe},Oe},[e]),j=g.useMemo(()=>Zi(a),[a]),Q=g.useMemo(()=>{const ee=new Map(kw.map(({id:ye})=>[ye,[]]));for(const ye of e){const Oe=dFn(ye,n);Oe&&ee.get(Oe)?.push(ye)}return ee},[e,n]),U=g.useMemo(()=>{const ee=new Map;for(const ye of kw){const Oe=Q.get(ye.id)??[],ie=n.columnOrder?.[ye.id];ee.set(ye.id,fFn(Oe,s.field,ie))}return ee},[Q,n.columnOrder,s.field]),A=SXe(xXe(cz,{activationConstraint:{distance:8}})),V=g.useCallback(ee=>{const{active:ye,over:Oe}=ee;if(!S||!Oe||ye.id===Oe.id)return;const ie=ye.data.current;if(ie?.type!=="kanban-task")return;const ge=ie.columnId,J=U.get(ge)?.map(ae=>ae.id)??[],F=J.indexOf(ye.id),W=J.indexOf(Oe.id);if(F===-1||W===-1||F===W)return;const ue=Sce(J,F,W);S(ge,ue)},[S,U]),z=(ee,ye,Oe)=>{const ie=T&&ee==="todo"?()=>T(!1):T&&ee==="in_progress"?()=>T(!0):void 0,ge=ie?u.jsxs("button",{type:"button",onClick:ie,className:"flex w-full items-center justify-center gap-1.5 rounded-md border border-dashed border-[var(--color-border)] p-3 text-xs text-[var(--color-text-muted)] transition-colors hover:border-[var(--color-border-emphasis)] hover:text-[var(--color-text-secondary)]",children:[u.jsx(fl,{size:13}),"Add task"]}):null;if(ye.length===0)return ge??u.jsx("div",{className:"rounded-md border border-dashed border-[var(--color-border)] p-3 text-xs text-[var(--color-text-muted)]",children:"No tasks"});if($){const J=ye.map(F=>F.id);return u.jsxs(u.Fragment,{children:[u.jsx(nnt,{items:J,strategy:F4n,children:ye.map(F=>u.jsx(mFn,{task:F,columnId:ee,memberColorMap:j},F.id))}),ge]})}return u.jsxs(u.Fragment,{children:[ye.map(J=>u.jsx(qZe,{task:J,teamName:t,columnId:ee,kanbanTaskState:n.tasks[J.id],hasReviewers:!1,compact:Oe,taskMap:N,memberColorMap:j,onRequestReview:d,onApprove:p,onRequestChanges:f,onMoveBackToDone:h,onStartTask:m,onCompleteTask:O,onCancelTask:_,onScrollToTask:b,onTaskClick:y,onViewChanges:x,onDeleteTask:E},J.id)),ge]})},L=g.useMemo(()=>{if(r.columns.size===0)return kw;const ee=kw.filter(ye=>r.columns.has(ye.id));return ee.length>0?ee:kw},[r.columns]),q=L[0]?.id??null,Y=g.useMemo(()=>L.map(ee=>ee.id),[L]),{widths:ne,getHandleProps:te}=eFn({storageKey:t,columnIds:Y}),Z=q!=null?ne.get(q)??256:256,oe=g.useCallback(()=>{for(const ee of C.current)window.clearTimeout(ee);C.current=[]},[]);g.useEffect(()=>oe,[oe]);const re=g.useCallback(ee=>{let ye=ee?.parentElement??null;for(;ye;){const{overflowY:Oe}=window.getComputedStyle(ye);if(uFn.has(Oe))return ye;ye=ye.parentElement}return null},[]),se=g.useCallback(ee=>{const ye=re(k.current);if(!ye)return;const Oe=ye.scrollTop;oe();const ie=()=>{ye.scrollTop=Oe},ge=ee==="grid"?[120,240]:[120];C.current=ge.map(J=>window.setTimeout(ie,J))},[oe,re]),he=g.useCallback(ee=>{se(ee),I(ee)},[se,M]),Te=u.jsxs("div",{ref:k,className:"min-w-0 max-w-full overflow-x-hidden",children:[u.jsxs("div",{className:at("flex min-w-0 max-w-full items-center gap-2",M==="columns"?"mb-0":"mb-2",v==null&&"justify-end"),children:[v!=null&&u.jsx("div",{className:"min-w-0 max-w-full",style:{width:Z},children:v}),u.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[u.jsxs("div",{className:"inline-flex items-center rounded-md border border-[var(--color-border)]",children:[u.jsx(aFn,{filter:r,sessions:i,leadSessionId:o,members:a,onFilterChange:c}),u.jsx("div",{className:"h-4 w-px bg-[var(--color-border)]"}),u.jsx(cFn,{sort:s,onSortChange:l})]}),w!=null&&w>0&&P?u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsxs(Xe,{variant:"ghost",size:"sm",className:"h-7 px-2 text-[var(--color-text-muted)]",onClick:P,children:[u.jsx(Si,{size:14}),u.jsx("span",{className:"ml-1 text-xs",children:w})]})}),u.jsx(nt,{side:"bottom",children:"回收站"})]}):null,u.jsxs("div",{className:"inline-flex rounded-md border border-[var(--color-border)]",children:[u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx(Xe,{variant:"ghost",size:"sm",className:at("h-7 rounded-r-none px-2",M==="grid"?"bg-[var(--color-surface-raised)] text-[var(--color-text)]":"text-[var(--color-text-muted)]"),onClick:()=>he("grid"),"aria-label":"网格视图",children:u.jsx(rft,{size:14})})}),u.jsx(nt,{side:"bottom",children:"网格视图"})]}),u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx(Xe,{variant:"ghost",size:"sm",className:at("h-7 rounded-l-none border-l border-[var(--color-border)] px-2",M==="columns"?"bg-[var(--color-surface-raised)] text-[var(--color-text)]":"text-[var(--color-text-muted)]"),onClick:()=>he("columns"),"aria-label":"列视图",children:u.jsx(uR,{size:14})})}),u.jsx(nt,{side:"bottom",children:"列视图"})]})]})]})]}),M==="grid"?u.jsx("div",{className:"w-full min-w-0 max-w-full overflow-x-auto overflow-y-hidden px-1 pb-6 pr-4 pt-2",children:u.jsx("div",{className:"grid min-w-[900px] grid-cols-3 items-start gap-3",children:L.map(ee=>{const ye=U.get(ee.id)??[],Oe=iCe[ee.id];return u.jsx(sCe,{title:ee.title,count:ye.length,icon:Oe.icon,headerBg:Oe.headerBg,bodyBg:Oe.bodyBg,bodyClassName:"max-h-none overflow-visible",children:z(ee.id,ye)},ee.id)})})}):u.jsx("div",{className:"w-full min-w-0 max-w-full overflow-x-auto overflow-y-hidden px-1 pb-6 pr-4 pt-2",children:u.jsx("div",{className:"flex min-w-max items-start pr-1",children:L.map((ee,ye)=>{const Oe=U.get(ee.id)??[],ie=iCe[ee.id],ge=ne.get(ee.id)??256,J=te(ee.id);return u.jsxs("div",{className:"flex shrink-0",children:[u.jsx("div",{style:{width:ge},children:u.jsx(sCe,{title:ee.title,count:Oe.length,icon:ie.icon,headerBg:ie.headerBg,bodyBg:ie.bodyBg,bodyClassName:"max-h-none overflow-visible",children:z(ee.id,Oe,!0)})}),ye<L.length-1?u.jsx("div",{className:"group relative mx-0.5 flex items-center justify-center",onPointerDown:J.onPointerDown,style:J.style,"aria-label":J["aria-label"],children:u.jsx("div",{className:"h-full w-px bg-[var(--color-border)] transition-colors group-hover:bg-blue-500/50 group-active:bg-blue-500"})}):null]},ee.id)})})})]});return $?u.jsx(UXe,{sensors:A,onDragEnd:V,children:Te}):Te},gFn=15,_Fn=({value:e,onChange:t,tasks:n,members:r})=>{const[s,i]=g.useState(!1),[o,a]=g.useState(0),c=g.useRef(null),l=g.useRef(null),d=g.useRef(null),p=g.useRef(!1),f=g.useMemo(()=>{const b=/#(\S*)$/.exec(e);return b?b[1]:null},[e]),h=f!==null,m=g.useMemo(()=>{if(!h)return[];const b=f.toLowerCase();return n.filter(x=>{const S=Jg(x).toLowerCase();return b===""||S.includes(b)}).slice(0,gFn)},[h,f,n]);g.useEffect(()=>{if(p.current){p.current=!1;return}h&&m.length>0?(i(!0),a(0)):i(!1)},[h,m.length]),g.useEffect(()=>{if(!s)return;const b=y=>{c.current&&!c.current.contains(y.target)&&i(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[s]),g.useEffect(()=>{if(!s||!d.current)return;d.current.children[o]?.scrollIntoView({block:"nearest"})},[o,s]);const O=g.useCallback(b=>{const y=Jg(b),x=e.replace(/#\S*$/,`#${y}`);p.current=!0,t(x),i(!1),l.current?.focus()},[e,t]),_=g.useCallback(b=>{!s||m.length===0||(b.key==="ArrowDown"?(b.preventDefault(),a(y=>(y+1)%m.length)):b.key==="ArrowUp"?(b.preventDefault(),a(y=>(y-1+m.length)%m.length)):b.key==="Enter"?(b.preventDefault(),O(m[o])):b.key==="Escape"&&i(!1))},[s,m,o,O]);return u.jsxs("div",{ref:c,className:"relative w-full max-w-full",children:[u.jsx($i,{size:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-[var(--color-text-muted)]"}),u.jsx("input",{ref:l,type:"text",placeholder:"搜索任务...(#编号 或 文本)",value:e,onChange:b=>t(b.target.value),onKeyDown:_,className:"h-8 w-full min-w-[140px] rounded-md border border-[var(--color-border)] bg-[var(--color-surface)] px-8 text-xs text-[var(--color-text)] placeholder:text-[var(--color-text-muted)] focus:border-[var(--color-border-emphasis)] focus:outline-none"}),e&&u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx("button",{type:"button",className:"absolute right-2 top-1/2 -translate-y-1/2 text-[var(--color-text-muted)] hover:text-[var(--color-text)]",onClick:()=>t(""),children:u.jsx(Ar,{size:14})})}),u.jsx(nt,{side:"bottom",children:"清空搜索"})]}),s&&m.length>0&&u.jsxs("div",{ref:d,className:"absolute left-0 top-full z-50 mt-1 max-h-[280px] w-[360px] min-w-full max-w-[calc(100vw-2rem)] overflow-y-auto rounded-md border border-[var(--color-border)] bg-[var(--color-surface-overlay)] py-1 shadow-xl shadow-black/30",children:[u.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5",children:[u.jsx(LIe,{size:10,className:"text-[var(--color-text-muted)]"}),u.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide text-[var(--color-text-muted)]",children:"任务"})]}),m.map((b,y)=>u.jsx(bFn,{task:b,index:y,members:r,isActive:y===o,onSelect:()=>O(b),onHover:()=>a(y)},b.id))]})]})},bFn=Je.memo(function({task:t,index:n,members:r,isActive:s,onSelect:i,onHover:o}){const a=Jg(t),c=Tz[t.status]??t.status,l=g.useMemo(()=>{const m=new Map;for(const O of r)O.color&&m.set(O.name,O.color);return m},[r]),d=g.useMemo(()=>{if(!t.createdAt)return null;const m=new Date(t.createdAt);return isNaN(m.getTime())?null:mT(m,{addSuffix:!0})},[t.createdAt]),p=g.useMemo(()=>{if(!t.updatedAt)return null;const m=new Date(t.updatedAt);return isNaN(m.getTime())?null:mT(m,{addSuffix:!0})},[t.updatedAt]),f=g.useMemo(()=>{switch(t.status){case"pending":return"bg-zinc-500/15 text-zinc-400";case"in_progress":return"bg-blue-500/15 text-blue-400";case"completed":return"bg-emerald-500/15 text-emerald-400";case"deleted":return"bg-red-500/15 text-red-400";default:return"bg-zinc-500/15 text-zinc-400"}},[t.status]),h=n%2===1?"var(--card-bg-zebra)":"var(--card-bg)";return u.jsxs("button",{type:"button",className:"flex w-full items-start gap-2 px-3 py-1.5 text-left transition-colors hover:!bg-[var(--color-surface-raised)]",style:{backgroundColor:s?"var(--color-surface-raised)":h},onClick:i,onMouseEnter:o,children:[u.jsxs("div",{className:"flex shrink-0 flex-col items-start gap-0.5",children:[u.jsxs("span",{className:"font-mono text-[11px] font-medium text-[var(--color-text)]",children:["#",a]}),u.jsx("span",{className:`rounded px-1 py-px text-[9px] font-medium ${f}`,children:c})]}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("p",{className:"truncate text-[11px] text-[var(--color-text-secondary)]",children:t.subject}),u.jsxs("div",{className:"mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-0.5",children:[t.createdBy&&u.jsx(Ur,{name:t.createdBy,color:l.get(t.createdBy),size:"xs",hideAvatar:!0}),d&&u.jsxs("span",{className:"text-[9px] text-[var(--color-text-muted)]",children:["创建于 ",d]}),p&&p!==d&&u.jsxs("span",{className:"text-[9px] text-[var(--color-text-muted)]",children:["更新于 ",p]})]})]})]})}),yFn=({open:e,tasks:t,onClose:n,onRestore:r})=>u.jsx(Os,{open:e,onOpenChange:s=>!s&&n(),children:u.jsxs(ls,{className:"max-w-lg",children:[u.jsx(gs,{children:u.jsxs(cs,{className:"flex items-center gap-2 text-sm",children:[u.jsx(Si,{size:14,className:"text-[var(--color-text-muted)]"}),"回收站"]})}),t.length===0?u.jsx("div",{className:"py-8 text-center text-xs text-[var(--color-text-muted)]",children:"暂无已删除任务"}):u.jsx(Wl,{delayDuration:300,children:u.jsx("div",{className:"max-h-[400px] overflow-y-auto",children:u.jsxs("table",{className:"w-full text-xs",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b border-[var(--color-border)] text-left text-[var(--color-text-muted)]",children:[u.jsx("th",{className:"pb-2 pr-3 font-medium",children:"#"}),u.jsx("th",{className:"pb-2 pr-3 font-medium",children:"标题"}),u.jsx("th",{className:"pb-2 pr-3 font-medium",children:"负责人"}),u.jsx("th",{className:"pb-2 pr-3 font-medium",children:"删除时间"}),r?u.jsx("th",{className:"pb-2 font-medium"}):null]})}),u.jsx("tbody",{children:t.map(s=>u.jsxs("tr",{className:"border-b border-[var(--color-border-subtle)] last:border-0",children:[u.jsx("td",{className:"py-2 pr-3 text-[var(--color-text-muted)]",children:Gr(s)}),u.jsx("td",{className:"py-2 pr-3 text-[var(--color-text)]",children:s.subject}),u.jsx("td",{className:"py-2 pr-3 text-[var(--color-text-secondary)]",children:s.owner??"未分配"}),u.jsx("td",{className:"py-2 pr-3 text-[var(--color-text-muted)]",children:s.deletedAt?Ub(new Date(s.deletedAt),{addSuffix:!0}):"—"}),r?u.jsx("td",{className:"py-2",children:u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx("button",{type:"button",className:"rounded p-1 text-[var(--color-text-muted)] transition-colors hover:bg-emerald-500/10 hover:text-emerald-400",onClick:()=>r(s.id),"aria-label":"恢复任务",children:u.jsx(hm,{size:12})})}),u.jsx(nt,{side:"left",children:"恢复"})]})}):null]},s.id))})]})})}),u.jsx(qc,{children:u.jsx(Xe,{variant:"outline",size:"sm",onClick:n,children:"关闭"})})]})});function xFn(e,t){const[n,r]=g.useState(null),[s,i]=g.useState(t!==null),[o,a]=g.useState(null);return g.useEffect(()=>{if(!t){r(null),i(!1),a(null);return}let c=!1;return r(null),i(!0),a(null),(async()=>{try{const l=await K.teams.getMemberStats(e,t);c||r(l)}catch(l){c||a(l instanceof Error?l.message:"Unknown error")}finally{c||i(!1)}})(),()=>{c=!0}},[e,t]),{stats:n,loading:s,error:o}}function SFn(e,t){if(t)return e==="codex"&&t==="Codex native"?"Codex":t}function oCe(e){return e?e.launchState==="starting"||e.launchState==="runtime_pending_bootstrap"||e.launchState==="runtime_pending_permission"||e.status==="waiting"||e.status==="spawning":!1}function ant(e){if(e?.pidSource)return e.providerId==="opencode"&&e.restartable===!1&&e.pidSource==="opencode_bridge"?"RSS source: shared OpenCode host":e.pidSource==="agent_process_table"?"RSS source: runtime process":e.pidSource==="lead_process"?"RSS source: lead process":e.pidSource==="runtime_bootstrap"?"RSS source: runtime bootstrap process":e.pidSource==="persisted_metadata"?"RSS source: persisted runtime metadata":`PID source: ${e.pidSource}`}function lnt(e,t,n,r){const s=e.providerBackendId,i=e.model?.trim()||"",o=n?.runtimeModel?.trim()||r?.runtimeModel?.trim(),a=Eg(i)??Eg(o),c=e.providerId??a??t?.providerId??"anthropic",l=e.providerId??a,d=l==null||t?.providerId==null||l===t.providerId,p=i||d&&t?.model?.trim()||"",f=e.effort??(d?t?.effort:void 0),h=s??(d?t?.providerBackendId:void 0),m=SFn(c,SBn(c,h)),O=typeof r?.rssBytes=="number"&&r.rssBytes>0?` · ${g2(r.rssBytes)}`:"";if(o&&(oCe(n)||p.length===0)){const b=Eg(o)??c;return`${tb(b,o,f)}${m?` · ${m}`:""}${O}`}return oCe(n)?!p.length&&!O?void 0:`${tb(c,p,f)}${m?` · ${m}`:""}${O}`:`${tb(c,p,f)}${m?` · ${m}`:""}${O}`}function Uee(e,t){const{includePassiveIdlePeerSummariesWhenNoiseHidden:n=!1,timeWindow:r,filter:s,searchQuery:i}=t;let o=e.filter(p=>p.messageKind!=="task_comment_notification");r&&(o=o.filter(p=>{const f=new Date(p.timestamp).getTime();return f>=r.start&&f<r.end})),s.showNoise||(o=o.filter(p=>{const f=typeof p.text=="string"?p.text:"";return IN(f)?n&&wMn(f):!0}));const a=s.from.size>0,c=s.to.size>0;a&&c?o=o.filter(p=>{const f=!!(p.from?.trim()&&s.from.has(p.from.trim())),h=!!(p.to?.trim()&&s.to.has(p.to.trim()));return f&&h}):(a||c)&&(o=o.filter(p=>a?!!(p.from?.trim()&&s.from.has(p.from.trim())):c?!!(p.to?.trim()&&s.to.has(p.to.trim())):!0));const l=i.trim().toLowerCase();l&&(o=o.filter(p=>{const f=A2(p).toLowerCase(),h=QZe(p).toLowerCase(),m=(p.from??"").toLowerCase(),O=(p.to??"").toLowerCase();return f.includes(l)||h.includes(l)||m.includes(l)||O.includes(l)}));const d=new Set(o.map(p=>typeof p.messageId=="string"?p.messageId.trim():"").filter(p=>p.length>0));return o.filter(p=>{const f=typeof p.relayOfMessageId=="string"?p.relayOfMessageId.trim():"";if(!f)return!0;const h=typeof p.messageId=="string"?p.messageId.trim():"";return f===h?!0:!d.has(f)})}function cnt({teamName:e,memberName:t,members:n,tasks:r,messages:s}){const i=Uee(s,{timeWindow:null,filter:{from:new Set,to:new Set,showNoise:!0},searchQuery:""}),o=`lead:${e}`,a=n.find(p=>Yn(p))?.name??`${e}-lead`,c=t===a?o:`member:${e}:${t}`;return xle({data:{members:n,tasks:r,messages:i},teamName:e,leadId:o,leadName:a,ownerNodeIds:new Set([o,c])}).get(c)??[]}const vFn=({currentRole:e,onSave:t,onCancel:n,saving:r})=>{const s=e&&iie.includes(e),[i,o]=g.useState(e?s?e:yf:gT),[a,c]=g.useState(s?"":e??""),[l,d]=g.useState(null),p=h=>{o(h),d(null),h!==yf&&c("")},f=()=>{if(i===gT){t(void 0);return}if(i!==yf){t(i);return}const h=a.trim();if(!h){d("Role cannot be empty");return}if(FZ.has(h.toLowerCase())){d("This role is reserved");return}t(h)};return u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx(lBn,{value:i,onValueChange:p,customRole:a,onCustomRoleChange:h=>{c(h),d(null)},triggerClassName:"h-7 w-32 text-xs",inputClassName:"h-7 w-28 text-xs",customRoleError:l,onCustomRoleValidate:h=>FZ.has(h.trim().toLowerCase())?"This role is reserved":null}),u.jsx(Xe,{variant:"ghost",size:"icon",className:"size-6",onClick:f,disabled:r,children:r?u.jsx(Ht,{size:12,className:"animate-spin"}):u.jsx(es,{size:12})}),u.jsx(Xe,{variant:"ghost",size:"icon",className:"size-6",onClick:n,disabled:r,children:u.jsx(Ar,{size:12})})]})},TFn=({member:e,runtimeSummary:t,runtimeEntry:n,isTeamAlive:r,isTeamProvisioning:s,leadActivity:i,spawnStatus:o,spawnLaunchState:a,spawnLivenessSource:c,spawnRuntimeAlive:l,isLaunchSettling:d,onUpdateRole:p,updatingRole:f})=>{const[h,m]=g.useState(!1),O=le($=>$.selectedTeamName),_=le($=>O?Sl($,O):[]),b=g.useMemo(()=>ip(_),[_]),y=zr(e.color??""),x=e.role||Js(e.agentType),S=_T({member:e,spawnStatus:o,spawnLaunchState:a,spawnLivenessSource:c,spawnRuntimeAlive:l,runtimeEntry:n,runtimeAdvisory:e.runtimeAdvisory,isLaunchSettling:d,isTeamAlive:r,isTeamProvisioning:s,leadActivity:i}),v=S.presenceLabel,T=S.launchVisualState,E=S.launchStatusLabel,w=S.dotClass,P=S.runtimeAdvisoryLabel,k=S.runtimeAdvisoryTitle,C=S.runtimeAdvisoryTone,M=C==="error"&&P?P:T==="runtime_pending"||T==="permission_pending"||T==="shell_only"||T==="runtime_candidate"||T==="registered_only"||T==="stale_runtime"?E??v:v,I=!Yn(e)&&!e.removedAt&&!s&&!!p;return u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsxs("div",{className:"relative shrink-0",children:[u.jsx("img",{src:b.get(e.name)??lo(e.name,96),alt:e.name,className:"size-12 rounded-full bg-[var(--color-surface-raised)]",loading:"lazy"}),u.jsx("span",{className:`absolute -bottom-0.5 -right-0.5 size-3 rounded-full border-2 border-[var(--color-surface)] ${w}`,"aria-label":M})]}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx(cs,{className:"truncate",style:{color:y.text},children:ml(e.name)}),u.jsx(Ti,{asChild:!0,className:"mt-1 flex items-center gap-2",children:u.jsxs("div",{children:[h?u.jsx(vFn,{currentRole:e.role,saving:f,onSave:async $=>{try{await p?.($),m(!1)}catch{}},onCancel:()=>m(!1)}):u.jsxs(u.Fragment,{children:[u.jsx("span",{children:x||"无角色"}),I&&u.jsx("button",{type:"button",className:"inline-flex items-center text-[var(--color-text-muted)] transition-colors hover:text-[var(--color-text-secondary)]",onClick:()=>m(!0),"aria-label":"编辑角色",children:u.jsx(Nb,{size:12})})]}),!h&&u.jsx(u.Fragment,{children:u.jsx(Ut,{variant:"secondary",className:`px-1.5 py-0.5 text-[10px] font-normal leading-none ${C==="error"?"bg-red-500/15 text-red-300":"text-[var(--color-text-muted)]"}`,title:k,children:M})}),!h&&t?u.jsx("div",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:t}):null]})})]})]})},aCe="rounded-md border border-[var(--color-border)] bg-[var(--color-surface-raised)] px-2.5 py-1.5",EFn="cursor-pointer transition-colors hover:border-[var(--color-border-emphasis)] hover:bg-[var(--color-surface-overlay)]",lCe=({label:e,value:t,sub:n,onClick:r})=>{const s=r?`${aCe} ${EFn}`:aCe,i=u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"text-base font-semibold leading-tight text-[var(--color-text)]",children:t}),u.jsx("p",{className:"text-[10px] text-[var(--color-text-muted)]",children:e}),n&&u.jsx("p",{className:"mt-0.5 text-[9px] text-[var(--color-text-muted)]",children:n})]});return r?u.jsx("button",{type:"button",className:s,onClick:r,children:i}):u.jsx("div",{className:s,children:i})},wFn=({totalTasks:e,inProgressTasks:t,totalTokens:n,statsLoading:r,statsComputedAt:s,onTabChange:i})=>{const o=r?"...":n!=null?Rn(n):"—",a=!r&&s?`updated ${_3(s)}`:void 0;return u.jsxs("div",{className:"grid min-w-0 flex-1 grid-cols-2 gap-1.5",children:[u.jsx(lCe,{label:"Tasks",value:e,sub:t>0?`进行中: ${t}`:void 0,onClick:i?()=>i("tasks"):void 0}),u.jsx(lCe,{label:"Tokens",value:o,sub:a,onClick:i?()=>i("stats"):void 0})]})},kFn=100,CFn=[{value:"all",label:"All"},{value:"messages",label:"Messages"},{value:"comments",label:"Comments"}],RFn=({teamName:e,memberName:t,members:n,tasks:r,initialFilter:s="all",onCreateTask:i,onTaskClick:o})=>{const[a,c]=g.useState(s),[l,d]=g.useState(null),{messages:p,messagesState:f,loadOlderTeamMessages:h}=le(Et($=>({messages:hXe($,e,t),messagesState:e?$.teamMessagesByName[e]:void 0,loadOlderTeamMessages:$.loadOlderTeamMessages}))),{readSet:m}=Xle(e),O=g.useMemo(()=>new Map(r.map($=>[$.id,$])),[r]),_=g.useMemo(()=>QN(n),[n]);g.useEffect(()=>{c(s)},[s,t,e]);const b=g.useCallback(async()=>{!f?.hasMore||f.loadingHead||f.loadingOlder||await h(e)},[h,f,e]),y=(f?.loadingHead??!1)||(f?.loadingOlder??!1),x=f?.loadingOlder??!1,S=f?.hasMore??!1,v=g.useMemo(()=>cnt({teamName:e,memberName:t,members:n,tasks:r,messages:p}),[t,n,p,r,e]),T=g.useMemo(()=>v.slice(0,kFn),[v]),E=g.useMemo(()=>{switch(a){case"messages":return T.filter($=>$.message.messageKind!=="task_comment_notification");case"comments":return T.filter($=>$.message.messageKind==="task_comment_notification");default:return T}},[a,T]),w=g.useMemo(()=>{const $=new Map;for(const R of E)$.set(As(R.message),{type:"message",message:R.message});return $},[E]),P=g.useCallback($=>{const R=w.get($);R&&d(R)},[w]),k=g.useCallback($=>{const R=O.get($)??r.find(N=>N.displayId===$);R&&o?.(R)},[o,O,r]),M=y&&v.length===0?"Loading activity...":a==="comments"?"No comments for this member":a==="messages"?S?"No loaded messages for this member yet":"No messages with this member":S?"No loaded activity for this member yet":"No activity with this member",I=S&&a!=="comments";return u.jsxs("div",{className:"space-y-3",children:[u.jsx("div",{className:"flex flex-wrap items-center gap-2",children:CFn.map($=>{const R=a===$.value;return u.jsx("button",{type:"button",className:["rounded-full border px-3 py-1 text-xs font-medium transition-colors",R?"border-[var(--color-border-emphasis)] bg-[var(--color-surface-overlay)] text-[var(--color-text)]":"border-[var(--color-border)] bg-[var(--color-surface-raised)] text-[var(--color-text-muted)] hover:text-[var(--color-text)]"].join(" "),onClick:()=>c($.value),children:$.label},$.value)})}),u.jsxs("div",{className:"max-h-[320px] space-y-2 overflow-y-auto",children:[E.length>0?E.map(($,R)=>{const N=As($.message),j=sB($.message,_),Q={type:"message",message:$.message},U=!$.message.read&&!m.has(N);return u.jsx("div",{className:"cursor-pointer",role:"button",tabIndex:0,onClick:()=>d(Q),onKeyDown:A=>{(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),d(Q))},children:u.jsx(jN,{message:$.message,teamName:e,compactHeader:!0,collapseMode:"managed",isCollapsed:!0,canToggleCollapse:!1,isUnread:U,expandItemKey:N,onExpand:P,onCreateTask:i,onTaskIdClick:k,memberRole:j.memberRole,memberColor:j.memberColor,recipientColor:j.recipientColor,memberColorMap:_.colorMap,localMemberNames:_.localMemberNames,zebraShade:R%2===1})},$.graphItem.id)}):u.jsx("div",{className:"rounded-md border border-[var(--color-border)] px-4 py-6 text-center text-sm text-[var(--color-text-muted)]",children:M}),I&&u.jsx("div",{className:"flex justify-center pt-2",children:u.jsx(Xe,{variant:"ghost",size:"sm",className:"text-xs","aria-busy":x,disabled:x,onClick:()=>void b(),children:"Load older messages"})})]}),u.jsx(LC,{expandedItem:l,open:l!==null,onOpenChange:$=>{$||d(null)},teamName:e,members:n,onTaskIdClick:k,onCreateTaskFromMessage:i})]})},PFn=({teamName:e,memberName:t,prefetchedStats:n,prefetchedLoading:r,prefetchedError:s,onFileClick:i,onShowAllFiles:o})=>{const a=n!==void 0,[c,l]=g.useState(null),[d,p]=g.useState(!a),[f,h]=g.useState(null);g.useEffect(()=>{if(a)return;let x=!1;return p(!0),h(null),(async()=>{try{const S=await K.teams.getMemberStats(e,t);x||l(S)}catch(S){x||h(S instanceof Error?S.message:"Unknown error")}finally{x||p(!1)}})(),()=>{x=!0}},[e,t,a]);const m=a?n??null:c,O=a?r??!1:d,_=a?s??null:f;if(O)return u.jsxs("div",{className:"flex items-center justify-center gap-2 py-8 text-xs text-[var(--color-text-muted)]",children:[u.jsx(Ht,{size:14,className:"animate-spin"}),"Computing stats..."]});if(_)return u.jsxs("div",{className:"flex items-center justify-center gap-2 py-8 text-xs text-red-400",children:[u.jsx(jo,{size:14}),_]});if(!m)return u.jsxs("div",{className:"py-8 text-center text-xs text-[var(--color-text-muted)]",children:[u.jsx(Mne,{size:20,className:"mx-auto mb-2 opacity-40"}),"No stats available"]});const b=m.inputTokens+m.outputTokens,y=Object.values(m.toolUsage).reduce((x,S)=>x+S,0);return u.jsxs("div",{className:"max-h-[400px] space-y-3 overflow-y-auto pr-1",children:[u.jsx($Fn,{stats:m,totalTokens:b,totalToolCalls:y}),u.jsx(NFn,{toolUsage:m.toolUsage}),u.jsx(MFn,{files:m.filesTouched,fileStats:m.fileStats,onFileClick:i,onShowAll:o}),u.jsx(QFn,{stats:m})]})},XM=({label:e,value:t,sub:n,info:r})=>u.jsxs("div",{className:"rounded-md border border-[var(--color-border)] bg-[var(--color-surface-raised)] px-3 py-2",children:[u.jsx("p",{className:"text-lg font-semibold text-[var(--color-text)]",children:t}),u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("p",{className:"text-[11px] text-[var(--color-text-muted)]",children:e}),r&&u.jsxs("span",{className:"group relative",children:[u.jsx(Ks,{size:10,className:"cursor-help text-[var(--color-text-muted)] opacity-50 hover:opacity-80"}),u.jsx("span",{className:"pointer-events-none absolute bottom-full left-1/2 z-50 mb-1.5 w-52 -translate-x-1/2 rounded-md border border-[var(--color-border)] bg-[var(--color-surface-overlay)] px-2.5 py-2 text-[10px] leading-relaxed text-[var(--color-text-secondary)] opacity-0 shadow-lg transition-opacity group-hover:pointer-events-auto group-hover:opacity-100",children:r})]})]}),n&&u.jsx("p",{className:"mt-0.5 text-[10px] text-[var(--color-text-muted)]",children:n})]}),$Fn=({stats:e,totalTokens:t,totalToolCalls:n})=>u.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:[u.jsx(XM,{label:"Lines",value:`+${e.linesAdded}`,sub:e.linesRemoved>0?`-${e.linesRemoved}`:void 0,info:"Approximate. Accurate for Edit and Write tools. Bash file writes are estimated from command patterns (heredoc, echo, sed) and may be underreported."}),u.jsx(XM,{label:"Files",value:e.filesTouched.length}),u.jsx(XM,{label:"Tool Calls",value:n}),u.jsx(XM,{label:"Tokens",value:Rn(t)})]}),NFn=({toolUsage:e})=>{const t=Object.entries(e).sort(([,r],[,s])=>s-r);if(t.length===0)return null;const n=t[0][1];return u.jsxs("div",{className:"rounded-md border border-[var(--color-border)] bg-[var(--color-surface)] p-3",children:[u.jsx("p",{className:"mb-2 text-[11px] font-medium text-[var(--color-text-secondary)]",children:"Tool Usage"}),u.jsx("div",{className:"space-y-1.5",children:t.map(([r,s])=>u.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[u.jsx("span",{className:"w-16 shrink-0 truncate text-right text-[var(--color-text-muted)]",children:r}),u.jsx("div",{className:"h-3.5 flex-1 overflow-hidden rounded-sm bg-[var(--color-surface-raised)]",children:u.jsx("div",{className:"h-full rounded-sm bg-blue-500/40",style:{width:`${s/n*100}%`}})}),u.jsx("span",{className:"w-8 shrink-0 text-right tabular-nums text-[var(--color-text-muted)]",children:s})]},r))})]})},AFn=";.,";function IFn(e){let t=e.trim(),n=t.length;for(;n>0&&AFn.includes(t[n-1]);)n--;return t=t.slice(0,n),!t||t==="null"||t==="undefined"||t==="None"}const MFn=({files:e,fileStats:t,onFileClick:n,onShowAll:r})=>{const[s,i]=g.useState(!1),o=e.filter(d=>!IFn(d));if(o.length===0)return null;const a=s?o:o.slice(0,5),c=o.length-5,l=!!n;return u.jsxs("div",{className:"rounded-md border border-[var(--color-border)] bg-[var(--color-surface)] p-3",children:[u.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[u.jsxs("p",{className:"text-[11px] font-medium text-[var(--color-text-secondary)]",children:["Files Touched (",o.length,")"]}),r&&u.jsx("button",{className:"text-[10px] text-blue-400 hover:text-blue-300",onClick:r,children:"View All Changes"})]}),u.jsx("div",{className:"space-y-0.5",children:a.map(d=>{const p=Of(d)||d,f=t?.[d];return u.jsxs("button",{type:"button",className:at("flex w-full items-center gap-1.5 rounded px-1 py-0.5 text-left text-[11px] text-[var(--color-text-muted)]",l&&"cursor-pointer hover:bg-[var(--color-surface-raised)] hover:text-[var(--color-text-secondary)]"),title:d,onClick:()=>n?.(d),disabled:!l,children:[u.jsx(Uv,{size:10,className:"shrink-0 opacity-50"}),u.jsx("span",{className:"min-w-0 truncate",children:p}),f&&(f.added>0||f.removed>0)&&u.jsxs("span",{className:"flex shrink-0 items-center gap-1 font-mono text-[10px]",children:[f.added>0&&u.jsxs("span",{className:"text-emerald-400",children:["+",f.added]}),f.removed>0&&u.jsxs("span",{className:"text-red-400",children:["-",f.removed]})]})]},d)})}),c>0&&u.jsxs("button",{className:"mt-1.5 flex items-center gap-1 text-[10px] text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:()=>i(!s),children:[s?u.jsx(Dr,{size:10}):u.jsx(jn,{size:10}),s?"Show less":`+${c} more`]})]})},QFn=({stats:e})=>{const t=_3(e.computedAt);return u.jsxs("div",{className:"text-center text-[10px] text-[var(--color-text-muted)]",children:[e.sessionCount," session",e.sessionCount!==1?"s":""," · computed ",t]})},cCe={in_progress:0,pending:1,completed:2},DFn=({tasks:e,onTaskClick:t})=>{const n=g.useMemo(()=>e.filter(r=>r.status!=="deleted").sort((r,s)=>(cCe[r.status]??3)-(cCe[s.status]??3)),[e]);return n.length===0?u.jsx("div",{className:"rounded-md border border-[var(--color-border)] px-4 py-6 text-center text-sm text-[var(--color-text-muted)]",children:"No tasks assigned to this member"}):u.jsx("div",{className:"max-h-[320px] overflow-y-auto",children:u.jsx("div",{className:"flex flex-col gap-1",children:n.map(r=>{const s=Vg(r),i=s&&Zp[s]?{bg:Zp[s].bg,text:Zp[s].text}:GL[r.status],o=s&&Zp[s]?Zp[s].label:Tz[r.status];return u.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2.5 py-2 text-left hover:bg-[var(--color-surface-raised)]",onClick:()=>t?.(r),children:[u.jsx(Ut,{variant:"secondary",className:"shrink-0 px-1.5 py-0 text-[10px] font-normal",children:Gr(r)}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-[var(--color-text)]",children:r.subject}),u.jsx("span",{className:`shrink-0 rounded-full px-2 py-0.5 text-[10px] font-medium ${i.bg} ${i.text}`,children:o}),r.reviewState==="needsFix"?u.jsx("span",{className:`shrink-0 rounded-full px-2 py-0.5 text-[10px] font-medium ${Lc.needsFix.bg} ${Lc.needsFix.text}`,children:Lc.needsFix.label}):null]},r.id)})})})},LFn=({teamName:e,memberName:t,onFileClick:n,onViewAllChanges:r})=>{const[s,i]=g.useState(null),[o,a]=g.useState(!0),[c,l]=g.useState(null);if(g.useEffect(()=>{let f=!1;return a(!0),l(null),(async()=>{try{const h=await K.review.getAgentChanges(e,t);f||i(h)}catch(h){f||l(h instanceof Error?h.message:"Failed to load changes")}finally{f||a(!1)}})(),()=>{f=!0}},[e,t]),o)return u.jsxs("div",{className:"flex items-center justify-center gap-2 py-8 text-xs text-[var(--color-text-muted)]",children:[u.jsx(Ht,{size:14,className:"animate-spin"}),"Loading workspace changes..."]});if(c)return u.jsxs("div",{className:"flex items-center justify-center gap-2 py-8 text-xs text-red-400",children:[u.jsx(jo,{size:14}),c]});if(!s||s.files.length===0)return u.jsxs("div",{className:"py-8 text-center text-xs text-[var(--color-text-muted)]",children:[u.jsx(Bc,{size:20,className:"mx-auto mb-2 opacity-40"}),"No workspace changes"]});const d=s.files.reduce((f,h)=>f+h.linesAdded,0),p=s.files.reduce((f,h)=>f+h.linesRemoved,0);return u.jsxs("div",{className:"max-h-[400px] space-y-3 overflow-y-auto pr-1",children:[u.jsxs("div",{className:"flex items-center justify-between rounded-md border border-[var(--color-border)] bg-[var(--color-surface)] px-3 py-2",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsxs("span",{className:"text-xs text-[var(--color-text-secondary)]",children:[s.files.length," file",s.files.length!==1?"s":""," changed"]}),u.jsxs("span",{className:"flex items-center gap-1 font-mono text-xs",children:[d>0&&u.jsxs("span",{className:"text-emerald-400",children:["+",d]}),p>0&&u.jsxs("span",{className:"text-red-400",children:["-",p]})]})]}),r&&u.jsxs("button",{className:"flex items-center gap-1 text-[10px] text-blue-400 hover:text-blue-300",onClick:r,children:[u.jsx(Dne,{size:10}),"View Diff"]})]}),u.jsx("div",{className:"space-y-0.5",children:s.files.map(f=>{const h=Of(f.filePath)||f.filePath,m=!!n;return u.jsxs("button",{type:"button",className:at("flex w-full items-center gap-1.5 rounded px-2 py-1 text-left text-xs text-[var(--color-text-muted)]",m&&"cursor-pointer hover:bg-[var(--color-surface-raised)] hover:text-[var(--color-text-secondary)]"),title:f.filePath,onClick:()=>n?.(f.filePath),disabled:!m,children:[u.jsx(Uv,{size:12,className:"shrink-0 opacity-50"}),u.jsx("span",{className:"min-w-0 flex-1 truncate",children:h}),f.isNewFile&&u.jsx("span",{className:"shrink-0 text-[10px] text-emerald-400 opacity-60",children:"new"}),(f.linesAdded>0||f.linesRemoved>0)&&u.jsxs("span",{className:"flex shrink-0 items-center gap-1 font-mono text-[10px]",children:[f.linesAdded>0&&u.jsxs("span",{className:"text-emerald-400",children:["+",f.linesAdded]}),f.linesRemoved>0&&u.jsxs("span",{className:"text-red-400",children:["-",f.linesRemoved]})]})]},f.filePath)})})]})},jFn=({open:e,member:t,teamName:n,members:r,tasks:s,initialTab:i="tasks",initialActivityFilter:o="all",isTeamAlive:a,isTeamProvisioning:c,isLaunchSettling:l,leadActivity:d,spawnEntry:p,runtimeEntry:f,runtimeRunId:h,launchParams:m,onClose:O,onSendMessage:_,onAssignTask:b,onTaskClick:y,onRemoveMember:x,onRestartMember:S,onUpdateRole:v,updatingRole:T,onViewMemberChanges:E})=>{const w=g.useMemo(()=>t?s.filter(te=>te.owner===t.name):[],[s,t]),P=le(te=>hXe(te,n,t?.name??null)),k=g.useMemo(()=>t?cnt({teamName:n,memberName:t.name,members:r,tasks:s,messages:P}).length:0,[t,P,r,s,n]),C=g.useMemo(()=>w.filter(te=>te.status==="in_progress").length,[w]);g.useMemo(()=>w.filter(te=>te.status==="completed").length,[w]);const[M,I]=g.useState(i),[$,R]=g.useState(!1),[N,j]=g.useState(null),Q=g.useMemo(()=>t?lnt(t,m,p,f):void 0,[m,t,f,p]),U=ant(f);p?.launchState==="starting"||p?.launchState==="runtime_pending_bootstrap"||p?.launchState;const A=g.useMemo(()=>t?oie({teamName:n,runId:h,memberName:t.name,spawnEntry:p,runtimeEntry:f}):null,[t,f,h,p,n]),V=A!=null&&Ez(A)&&aie(A),z=A?JUe(A):void 0;g.useEffect(()=>{!e||!t||(I(i),j(null),R(!1))},[i,t,e]);const{stats:L,loading:q,error:Y}=xFn(n,t?.name??null),ne=L?L.inputTokens+L.outputTokens:null;return t?u.jsx(Os,{open:e,onOpenChange:te=>!te&&O(),children:u.jsxs(ls,{className:"min-w-0 sm:max-w-4xl",children:[u.jsxs("div",{className:"flex items-start gap-4",children:[u.jsx(gs,{className:"shrink-0",children:u.jsx(TFn,{member:t,runtimeSummary:Q,isTeamAlive:a,isTeamProvisioning:c,leadActivity:Yn(t)?d:void 0,spawnStatus:p?.status,spawnLaunchState:p?.launchState,spawnLivenessSource:p?.livenessSource,spawnRuntimeAlive:p?.runtimeAlive,runtimeEntry:f,isLaunchSettling:l,onUpdateRole:v?te=>v(t.name,te):void 0,updatingRole:T})}),u.jsx(wFn,{totalTasks:w.length,inProgressTasks:C,totalTokens:ne,statsLoading:q,statsComputedAt:L?.computedAt,onTabChange:I})]}),u.jsxs(g3,{value:M,onValueChange:te=>I(te),className:"min-w-0 overflow-hidden",children:[u.jsxs(_N,{className:"w-full",children:[u.jsxs(af,{value:"tasks",className:"flex-1 gap-1.5",children:["Tasks",w.length>0&&u.jsx("span",{className:"rounded-full bg-[var(--color-surface)] px-1.5 text-[10px]",children:w.length})]}),u.jsxs(af,{value:"workspace",className:"flex-1 gap-1.5",children:[u.jsx(Bc,{size:12}),"Workspace"]}),u.jsxs(af,{value:"activity",className:"flex-1 gap-1.5",children:["Activity",k>0&&u.jsx("span",{className:"rounded-full bg-[var(--color-surface)] px-1.5 text-[10px]",children:k})]}),u.jsxs(af,{value:"stats",className:"flex-1 gap-1.5",children:[u.jsx(Mne,{size:12}),"Stats"]})]}),u.jsx(lf,{value:"tasks",children:u.jsx(DFn,{tasks:w,onTaskClick:y})}),u.jsx(lf,{value:"workspace",children:u.jsx(LFn,{teamName:n,memberName:t.name,onFileClick:te=>E?.(t.name,te),onViewAllChanges:()=>E?.(t.name)})}),u.jsx(lf,{value:"activity",children:u.jsx(RFn,{teamName:n,memberName:t.name,members:r,tasks:s,initialFilter:o,onTaskClick:y})}),u.jsx(lf,{value:"stats",children:u.jsx(PFn,{teamName:n,memberName:t.name,prefetchedStats:L,prefetchedLoading:q,prefetchedError:Y,onFileClick:te=>E?.(t.name,te),onShowAllFiles:()=>E?.(t.name)})})]}),u.jsx(qc,{children:N?u.jsx("div",{className:"text-xs text-red-400",children:N}):z?u.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-xs text-red-400",children:[u.jsx("span",{className:"min-w-0 truncate",title:z,children:z}),A&&V?u.jsx(uie,{payload:A,label:"复制诊断信息",className:"h-auto shrink-0 gap-1.5 px-2 py-1 text-red-300 hover:bg-red-500/10 hover:text-red-200"}):null]}):f?.pid?u.jsxs("div",{className:"text-xs text-[var(--color-text-muted)]",children:["PID ",f.pid,U?` · ${U}`:""]}):null})]})}):null},uCe=1e3;function XFn(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function UFn(e,t=uCe){return g.useMemo(()=>{if(!e)return;const n=Number.isFinite(t)&&t>0?t:uCe;return{animationDelay:`${-(XFn()%n)}ms`,animationDuration:`${n}ms`}},[t,e])}const zFn=2e3,BFn=({className:e,label:t})=>{const n=e?.includes("animate-pulse")===!0,r=UFn(n,zFn);return u.jsx("span",{className:at("absolute -bottom-0.5 -right-0.5 rounded-full border-2 border-[var(--color-surface)]",e),style:r,"aria-label":t})};function FFn(e){const t=e?.trim();if(!t)return{summary:void 0,memory:void 0};const n=/^(.*?)(?:\s·\s(\d+(?:\.\d+)?\s(?:B|KB|MB|GB|TB)))$/.exec(t);return n?{summary:n[1]?.trim()||void 0,memory:n[2]?.trim()||void 0}:{summary:t,memory:void 0}}const YFn=({member:e,memberColor:t,runtimeSummary:n,runtimeEntry:r,runtimeRunId:s,taskCounts:i,isTeamAlive:o,isTeamProvisioning:a,leadActivity:c,currentTask:l,reviewTask:d,isAwaitingReply:p,isRemoved:f,spawnStatus:h,spawnEntry:m,spawnError:O,spawnLivenessSource:_,spawnLaunchState:b,spawnRuntimeAlive:y,isLaunchSettling:x,onOpenTask:S,onOpenReviewTask:v,onClick:T,onSendMessage:E,onAssignTask:w,onRestartMember:P,onSkipMemberForLaunch:k})=>{const C=le(je=>je.selectedTeamName),[M,I]=g.useState(!1),[$,R]=g.useState(null),[N,j]=g.useState(!1),[Q,U]=g.useState(null),A=le(je=>C?Sl(je,C):[]),V=g.useMemo(()=>ip(A),[A]),z=_T({member:e,spawnStatus:h,spawnLaunchState:b,spawnLivenessSource:_,spawnRuntimeAlive:y,runtimeEntry:r,runtimeAdvisory:e.runtimeAdvisory,isLaunchSettling:x,isTeamAlive:o,isTeamProvisioning:a,leadActivity:c}),L=z.dotClass,q=z.runtimeAdvisoryLabel,Y=z.runtimeAdvisoryTitle,ne=z.runtimeAdvisoryTone,te=z.presenceLabel,G=z.cardClass,Z=z.launchVisualState,oe=z.launchStatusLabel,re=Z==="runtime_pending"||Z==="permission_pending"||Z==="shell_only"||Z==="runtime_candidate"||Z==="registered_only"||Z==="stale_runtime"?oe??te:te,se=zr(t),{isLight:he}=Qs(),Te=i?.pending??0,ee=i?.inProgress??0,ye=i?.completed??0,Oe=Te+ee+ye,ie=Oe>0?Math.round(ye/Oe*100):0,ge=Js(e.role)??Js(e.agentType),{summary:J,memory:F}=FFn(n),W=ant(r),ue=Yn(e),ae=e.cwd?.trim(),ce=!ue&&!f&&e.isolation==="worktree",H=ae?`Worktree isolation configured. Worktree path: ${ae}`:"Worktree isolation is configured, but the runtime path is not available yet",pe=l??d??null,Ee=l?`Current task: #${to(l.id)}`:d?`Reviewing task: #${to(d.id)}`:void 0,we=!f&&te==="starting"&&b!=="failed_to_start"&&!pe&&!n,$e=!f&&!pe&&!q&&(te==="starting"||te==="connecting"||Z==="runtime_pending"||Z==="shell_only"||Z==="runtime_candidate"||Z==="registered_only"||Z==="stale_runtime"),Ze=te==="starting"?te:re,lt=g.useMemo(()=>oie({teamName:C,runId:s,memberName:e.name,spawnStatus:h,launchState:b,livenessSource:_,spawnEntry:m,runtimeEntry:r}),[e.name,r,s,C,m,b,_,h]),yt=!f&&Ez(lt)&&aie(lt),xt=h==="error"||b==="failed_to_start",Ge=h==="skipped"||b==="skipped_for_launch"||m?.skippedForLaunch===!0,Pt=!f&&xt,Lt=!f&&Ge,ct=o===!0||a===!0||x===!0,_n=(Pt||Lt)&&!Yn(e)&&!!P&&ct,Be=Pt&&!Yn(e)&&!!k&&ct,jt=!f&&!!q&&!$e&&!xt&&!Ge&&(!!pe||!p),Nt=async je=>{if(je.preventDefault(),je.stopPropagation(),!(!P||M)){R(null),I(!0);try{await P(e.name)}catch(tt){R(tt instanceof Error?tt.message:"重试启动成员失败")}finally{I(!1)}}},Zt=async je=>{if(je.preventDefault(),je.stopPropagation(),!(!k||N)){U(null),j(!0);try{await k(e.name)}catch(tt){U(tt instanceof Error?tt.message:"跳过成员失败")}finally{j(!1)}}};return u.jsx("div",{className:`rounded transition-opacity duration-300 ${f?"opacity-50":""} ${G}`,children:u.jsxs("div",{className:"group relative cursor-pointer rounded py-1.5",style:void 0,title:Ee,role:"button",tabIndex:0,onClick:T,onKeyDown:je=>{(je.key==="Enter"||je.key===" ")&&(je.preventDefault(),T?.())},children:[u.jsx("div",{className:"pointer-events-none absolute inset-0 rounded transition-colors group-hover:bg-white/5"}),u.jsxs("div",{className:"flex items-center gap-2.5",children:[u.jsxs("div",{className:"relative shrink-0",children:[u.jsx("div",{className:"rounded-full border-2 p-px",style:{borderColor:se.border,boxShadow:he?"none":`0 0 0 1px ${se.badge}`},children:u.jsx("img",{src:V.get(e.name)??lo(e.name),alt:e.name,className:"size-7 rounded-full bg-[var(--color-surface-raised)]",loading:"lazy"})}),u.jsx(BFn,{className:`size-2.5 ${L}`,label:re})]}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 text-sm",children:[u.jsx("span",{className:"shrink-0 font-medium text-[var(--color-text)]",children:ml(e.name)}),e.gitBranch?u.jsxs("span",{className:"flex shrink-0 items-center gap-0.5 text-[10px] text-[var(--color-text-muted)]",children:[u.jsx(b$,{size:10}),e.gitBranch]}):null,ce?u.jsx("span",{className:"shrink-0 rounded border border-emerald-400/35 bg-emerald-400/10 px-1 py-0.5 text-[9px] font-semibold uppercase leading-none text-emerald-300",title:H,children:"worktree"}):null,l?u.jsx(HL,{task:l,borderColor:se.border,activityLabel:"working on",onOpenTask:S}):null,d?u.jsx(HL,{task:d,borderColor:se.border,activityLabel:"reviewing",onOpenTask:v}):null,!pe&&p?u.jsxs(u.Fragment,{children:[ne==="error"?u.jsx(qn,{className:"size-3 shrink-0 text-red-400"}):u.jsx(Ht,{className:`size-3 shrink-0 animate-spin ${q?"text-amber-400":""}`,style:q?void 0:{color:se.border}}),u.jsx("span",{className:`shrink-0 text-[10px] ${ne==="error"?"text-red-300":q?"text-amber-300":"text-[var(--color-text-muted)]"}`,title:Y??"Message sent, awaiting reply",children:q??"awaiting reply"})]}):null]}),we?u.jsxs("div",{className:"mt-1 flex items-center gap-1.5","aria-hidden":"true",children:[u.jsx("div",{className:"skeleton-shimmer h-2 w-24 rounded-sm",style:{backgroundColor:"var(--skeleton-base-dim)"}}),u.jsx("div",{className:"skeleton-shimmer h-2 w-16 rounded-sm",style:{backgroundColor:"var(--skeleton-base)"}})]}):J||ge||F?u.jsxs("div",{className:"mt-0.5 flex min-w-0 items-center gap-1.5 text-[10px] font-medium text-[var(--color-text-muted)]",children:[J?u.jsx("span",{className:"min-w-0 truncate",children:J}):null,J&&ge?u.jsx("span",{className:"shrink-0 opacity-60",children:"•"}):null,ge?u.jsx("span",{className:"shrink-0",children:ge}):null,(J||ge)&&F?u.jsx("span",{className:"shrink-0 opacity-60",children:"•"}):null,F?u.jsx("span",{className:"shrink-0",title:W,children:F}):null]}):null]}),$e?u.jsxs("span",{className:"flex shrink-0 items-center gap-1",title:r?.runtimeDiagnostic,children:[u.jsx(Ht,{className:"size-3.5 shrink-0 animate-spin text-[var(--color-text-muted)]","aria-label":Ze}),u.jsx(Ut,{variant:"secondary",className:"shrink-0 px-1.5 py-0.5 text-[10px] font-normal leading-none text-[var(--color-text-muted)]",children:Ze})]}):Pt?u.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[u.jsx(qn,{className:"size-3.5 shrink-0 text-red-400"}),u.jsx(Ut,{variant:"secondary",className:"shrink-0 bg-red-500/15 px-1.5 py-0.5 text-[10px] font-normal leading-none text-red-400",children:re})]})}),u.jsx(nt,{side:"bottom",children:O??"Spawn failed"})]}),yt?u.jsx(uie,{payload:lt,className:"size-auto rounded p-1 text-red-300 transition-colors hover:bg-red-500/10 hover:text-red-200"}):null,Be?u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx("button",{type:"button","aria-label":N?"正在跳过成员":"本次启动跳过",className:"rounded p-1 text-red-300 transition-colors hover:bg-red-500/10 hover:text-red-200 disabled:cursor-not-allowed disabled:opacity-60",disabled:N||M,onClick:Zt,children:N?u.jsx(Ht,{className:"size-3.5 animate-spin"}):u.jsx(ID,{className:"size-3.5"})})}),u.jsx(nt,{side:"bottom",children:Q??(N?"正在跳过成员...":"本次启动跳过")})]}):null,_n?u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx("button",{type:"button","aria-label":M?"正在重试成员":"重试成员",className:"rounded p-1 text-red-300 transition-colors hover:bg-red-500/10 hover:text-red-200 disabled:cursor-not-allowed disabled:opacity-60",disabled:M||N,onClick:Nt,children:M?u.jsx(Ht,{className:"size-3.5 animate-spin"}):u.jsx(hm,{className:"size-3.5"})})}),u.jsx(nt,{side:"bottom",children:$??(M?"正在重试成员...":"重试成员")})]}):null]}):Lt?u.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[u.jsx(ID,{className:"size-3.5 shrink-0 text-zinc-400"}),u.jsx(Ut,{variant:"secondary",className:"shrink-0 bg-zinc-500/15 px-1.5 py-0.5 text-[10px] font-normal leading-none text-zinc-300",children:re})]})}),u.jsx(nt,{side:"bottom",children:m?.skipReason??"本次启动已跳过"})]}),_n?u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx("button",{type:"button","aria-label":M?"正在重试成员":"重试成员",className:"rounded p-1 text-zinc-300 transition-colors hover:bg-zinc-500/10 hover:text-zinc-100 disabled:cursor-not-allowed disabled:opacity-60",disabled:M,onClick:Nt,children:M?u.jsx(Ht,{className:"size-3.5 animate-spin"}):u.jsx(hm,{className:"size-3.5"})})}),u.jsx(nt,{side:"bottom",children:$??(M?"正在重试成员...":"重试成员")})]}):null]}):jt?u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[u.jsx(qn,{className:`size-3.5 shrink-0 ${ne==="error"?"text-red-400":"text-amber-400"}`}),u.jsx(Ut,{variant:"secondary",className:`shrink-0 px-1.5 py-0.5 text-[10px] font-normal leading-none ${ne==="error"?"bg-red-500/15 text-red-300":"bg-amber-500/15 text-amber-300"}`,title:Y,children:q})]})}),u.jsx(nt,{side:"bottom",children:Y??q})]}):pe?null:u.jsx(Ut,{variant:"secondary",className:`shrink-0 px-1.5 py-0.5 text-[10px] font-normal leading-none ${f?"bg-zinc-600 text-zinc-300":"text-[var(--color-text-muted)]"}`,title:f?"该成员已被移除":Ee,children:f?"已移除":re}),we?u.jsxs("div",{className:"shrink-0","aria-hidden":"true",children:[u.jsx("div",{className:"skeleton-shimmer h-[18px] w-[62px] rounded-full border",style:{backgroundColor:"var(--skeleton-base-dim)",borderColor:"var(--color-border)"}}),u.jsx("div",{className:"skeleton-shimmer mx-1 mt-1 h-[2px] w-10 rounded-full",style:{backgroundColor:"var(--skeleton-base)"}})]}):u.jsxs("div",{className:"shrink-0",title:Oe>0?`${ye}/${Oe} completed`:void 0,children:[u.jsxs(Ut,{variant:"secondary",className:"shrink-0 px-1.5 py-0.5 text-[10px] font-normal leading-none",children:[e.taskCount," ",e.taskCount===1?"task":"tasks"]}),Oe>0&&u.jsx("div",{className:"mx-0.5 mt-0.5 h-[2px] rounded-full bg-[var(--color-border)]",children:u.jsx("div",{className:"h-full rounded-full bg-emerald-500 transition-all duration-500",style:{width:`${ie}%`}})})]}),!f&&u.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx("button",{type:"button",className:"rounded p-1 text-[var(--color-text-muted)] transition-colors hover:bg-[var(--color-surface)] hover:text-[var(--color-text)]",onClick:je=>{je.stopPropagation(),E?.()},children:u.jsx(ca,{size:13})})}),u.jsx(nt,{side:"bottom",children:"发送消息"})]}),u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx("button",{type:"button",className:"rounded p-1 text-[var(--color-text-muted)] transition-colors hover:bg-[var(--color-surface)] hover:text-[var(--color-text)]",onClick:je=>{je.stopPropagation(),w?.()},children:u.jsx(fl,{size:13})})}),u.jsx(nt,{side:"bottom",children:"分配任务"})]})]})]})]})})};function VFn(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1){const r=e[n],s=t[n];if(r.name!==s.name||r.status!==s.status||r.currentTaskId!==s.currentTaskId||r.taskCount!==s.taskCount||r.color!==s.color||r.agentType!==s.agentType||r.role!==s.role||r.workflow!==s.workflow||r.providerId!==s.providerId||r.model!==s.model||r.effort!==s.effort||r.cwd!==s.cwd||r.gitBranch!==s.gitBranch||r.removedAt!==s.removedAt||r.runtimeAdvisory?.kind!==s.runtimeAdvisory?.kind||r.runtimeAdvisory?.observedAt!==s.runtimeAdvisory?.observedAt||r.runtimeAdvisory?.retryUntil!==s.runtimeAdvisory?.retryUntil||r.runtimeAdvisory?.retryDelayMs!==s.runtimeAdvisory?.retryDelayMs||r.runtimeAdvisory?.reasonCode!==s.runtimeAdvisory?.reasonCode||r.runtimeAdvisory?.message!==s.runtimeAdvisory?.message)return!1}return!0}function qFn(e,t){if(e===t)return!0;if(!e||!t)return e===t;if(e.size!==t.size)return!1;for(const[n,r]of e){const s=t.get(n);if(r.pending!==s?.pending||r.inProgress!==s.inProgress||r.completed!==s.completed)return!1}return!0}function WFn(e,t){if(e===t)return!0;if(!e||!t)return e===t;if(e.size!==t.size)return!1;for(const[n,r]of e){const s=t.get(n);if(r.id!==s?.id||r.displayId!==s.displayId||r.subject!==s.subject||r.owner!==s.owner||r.status!==s.status||r.reviewer!==s.reviewer||r.reviewState!==s.reviewState||r.kanbanColumn!==s.kanbanColumn)return!1}return!0}function GFn(e,t){if(e===t)return!0;if(!e||!t)return e===t;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const s of n)if(e[s]!==t[s])return!1;return!0}function HFn(e,t){if(e===t)return!0;if(!e||!t)return e===t;if(e.size!==t.size)return!1;for(const[n,r]of e){const s=t.get(n);if(r.status!==s?.status||r.launchState!==s.launchState||r.error!==s.error||r.hardFailure!==s.hardFailure||r.hardFailureReason!==s.hardFailureReason||r.skippedForLaunch!==s.skippedForLaunch||r.skipReason!==s.skipReason||r.skippedAt!==s.skippedAt||r.livenessSource!==s.livenessSource||r.livenessKind!==s.livenessKind||r.runtimeDiagnostic!==s.runtimeDiagnostic||r.runtimeDiagnosticSeverity!==s.runtimeDiagnosticSeverity||r.runtimeModel!==s.runtimeModel||r.runtimeAlive!==s.runtimeAlive||r.bootstrapConfirmed!==s.bootstrapConfirmed||r.agentToolAccepted!==s.agentToolAccepted||(r.pendingPermissionRequestIds??[]).join("\0")!==(s.pendingPermissionRequestIds??[]).join("\0"))return!1}return!0}function ZFn(e,t){return e===t?!0:!e||!t?e===t:e.providerId===t.providerId&&e.providerBackendId===t.providerBackendId&&e.model===t.model&&e.effort===t.effort&&e.fastMode===t.fastMode&&e.limitContext===t.limitContext}function KFn(e,t){if(e===t)return!0;if(!e||!t)return e===t;if(e.size!==t.size)return!1;for(const[n,r]of e){const s=t.get(n),i=r.diagnostics??[],o=s?.diagnostics??[];if(r.memberName!==s?.memberName||r.alive!==s?.alive||r.restartable!==s?.restartable||r.backendType!==s?.backendType||r.providerId!==s?.providerId||r.providerBackendId!==s?.providerBackendId||r.laneId!==s?.laneId||r.laneKind!==s?.laneKind||r.pid!==s?.pid||r.runtimeModel!==s?.runtimeModel||r.rssBytes!==s?.rssBytes||r.livenessKind!==s?.livenessKind||r.pidSource!==s?.pidSource||r.processCommand!==s?.processCommand||r.paneId!==s?.paneId||r.panePid!==s?.panePid||r.paneCurrentCommand!==s?.paneCurrentCommand||r.runtimePid!==s?.runtimePid||r.runtimeSessionId!==s?.runtimeSessionId||r.runtimeDiagnostic!==s?.runtimeDiagnostic||r.runtimeDiagnosticSeverity!==s?.runtimeDiagnosticSeverity||r.runtimeLastSeenAt!==s?.runtimeLastSeenAt||r.historicalBootstrapConfirmed!==s?.historicalBootstrapConfirmed||i.length!==o.length||!i.every((a,c)=>a===o[c]))return!1}return!0}function JFn(e,t){return VFn(e.members,t.members)&&qFn(e.memberTaskCounts,t.memberTaskCounts)&&WFn(e.taskMap,t.taskMap)&&GFn(e.pendingRepliesByMember,t.pendingRepliesByMember)&&HFn(e.memberSpawnStatuses,t.memberSpawnStatuses)&&KFn(e.memberRuntimeEntries,t.memberRuntimeEntries)&&e.runtimeRunId===t.runtimeRunId&&e.isLaunchSettling===t.isLaunchSettling&&e.isTeamAlive===t.isTeamAlive&&e.isTeamProvisioning===t.isTeamProvisioning&&e.leadActivity===t.leadActivity&&e.onRestartMember===t.onRestartMember&&e.onSkipMemberForLaunch===t.onSkipMemberForLaunch&&ZFn(e.launchParams,t.launchParams)}const eYn=g.memo(function({members:t,memberTaskCounts:n,taskMap:r,pendingRepliesByMember:s,memberSpawnStatuses:i,memberRuntimeEntries:o,runtimeRunId:a,isLaunchSettling:c,isTeamAlive:l,isTeamProvisioning:d,leadActivity:p,launchParams:f,onMemberClick:h,onSendMessage:m,onAssignTask:O,onOpenTask:_,onRestartMember:b,onSkipMemberForLaunch:y}){const x=g.useRef(null),[S,v]=g.useState(!1),T=g.useCallback($=>{const R=$[0];R&&v(R.contentRect.width>1e3)},[]);g.useEffect(()=>{const $=x.current;if(!$)return;const R=new ResizeObserver(T);return R.observe($),()=>R.disconnect()},[T]);const E=S?"grid grid-cols-2 gap-1":"grid grid-cols-1 gap-1",w=g.useMemo(()=>t.filter($=>!$.removedAt).sort(($,R)=>Yn($)?-1:Yn(R)?1:0),[t]),P=g.useMemo(()=>t.filter($=>$.removedAt),[t]),k=g.useMemo(()=>Zi(t),[t]),C=g.useCallback(($,R,N)=>lnt($,f,R,N),[f]);if(t.length===0)return u.jsx("div",{className:"rounded-md border border-[var(--color-border)] p-4 text-sm text-[var(--color-text-muted)]",children:"Solo team — lead only"});const M=g.useMemo(()=>{const $=new Map;if(!r)return $;for(const R of r.values())R.reviewer&&(R.reviewState==="review"||R.kanbanColumn==="review")&&$.set(R.reviewer,R);return $},[r]),I=($,R)=>{const N=$.currentTaskId&&r?r.get($.currentTaskId)??null:null,j=M.get($.name)??null,Q=j&&j.id!==$.currentTaskId?j:null,U=l!==!1&&!!s?.[$.name],A=i?.get($.name),V=o?.get($.name);return u.jsx(YFn,{member:$,memberColor:k.get($.name)??"blue",taskCounts:n?.get($.name.toLowerCase()),isTeamAlive:l,isTeamProvisioning:d,leadActivity:Yn($)?p:void 0,currentTask:R?null:N,reviewTask:R?null:Q,isAwaitingReply:R?!1:U,isRemoved:R,runtimeSummary:C($,R?void 0:A,R?void 0:V),runtimeEntry:R?void 0:V,runtimeRunId:R?void 0:a,spawnStatus:R?void 0:A?.status,spawnEntry:R?void 0:A,spawnError:R?void 0:A?.error??A?.hardFailureReason,spawnLivenessSource:R?void 0:A?.livenessSource,spawnLaunchState:R?void 0:A?.launchState,spawnRuntimeAlive:R?void 0:A?.runtimeAlive,isLaunchSettling:R?!1:c,onOpenTask:!R&&N?()=>_?.(N.id):void 0,onOpenReviewTask:!R&&Q?()=>_?.(Q.id):void 0,onClick:()=>h?.($),onSendMessage:()=>m?.($),onAssignTask:()=>O?.($),onRestartMember:R?void 0:b,onSkipMemberForLaunch:R?void 0:y},$.name)};return u.jsxs("div",{ref:x,className:"flex flex-col gap-1",children:[u.jsx("div",{className:E,children:w.map($=>I($,!1))}),P.length>0&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"mt-2 text-[10px] text-[var(--color-text-muted)]",children:["Removed (",P.length,")"]}),u.jsx("div",{className:E,children:P.map($=>I($,!0))})]})]})},JFn),unt=g.createContext({});function vce(e){const t=g.useRef(null);return t.current===null&&(t.current=e()),t.current}const tYn=typeof window<"u",dnt=tYn?g.useLayoutEffect:g.useEffect,Tce=g.createContext(null);function Ece(e,t){e.indexOf(t)===-1&&e.push(t)}function qT(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Af=(e,t,n)=>n>t?t:n<e?e:n;let wce=()=>{};const c_={},pnt=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function fnt(e){return typeof e=="object"&&e!==null}const hnt=e=>/^0[^.\s]+$/u.test(e);function mnt(e){let t;return()=>(t===void 0&&(t=e()),t)}const Yu=e=>e,nYn=(e,t)=>n=>t(e(n)),WN=(...e)=>e.reduce(nYn),WT=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class kce{constructor(){this.subscriptions=[]}add(t){return Ece(this.subscriptions,t),()=>qT(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const ec=e=>e*1e3,Iu=e=>e/1e3;function Ont(e,t){return t?e*(1e3/t):0}const rYn=(e,t,n)=>{const r=t-e;return((n-e)%r+r)%r+e},gnt=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,sYn=1e-7,iYn=12;function oYn(e,t,n,r,s){let i,o,a=0;do o=t+(n-t)/2,i=gnt(o,r,s)-e,i>0?n=o:t=o;while(Math.abs(i)>sYn&&++a<iYn);return o}function GN(e,t,n,r){if(e===t&&n===r)return Yu;const s=i=>oYn(i,0,1,e,n);return i=>i===0||i===1?i:gnt(s(i),t,r)}const _nt=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,bnt=e=>t=>1-e(1-t),ynt=GN(.33,1.53,.69,.99),Cce=bnt(ynt),xnt=_nt(Cce),Snt=e=>e>=1?1:(e*=2)<1?.5*Cce(e):.5*(2-Math.pow(2,-10*(e-1))),Rce=e=>1-Math.sin(Math.acos(e)),vnt=bnt(Rce),Tnt=_nt(Rce),aYn=GN(.42,0,1,1),lYn=GN(0,0,.58,1),Ent=GN(.42,0,.58,1),wnt=e=>Array.isArray(e)&&typeof e[0]!="number";function knt(e,t){return wnt(e)?e[rYn(0,e.length,t)]:e}const Cnt=e=>Array.isArray(e)&&typeof e[0]=="number",cYn={linear:Yu,easeIn:aYn,easeInOut:Ent,easeOut:lYn,circIn:Rce,circInOut:Tnt,circOut:vnt,backIn:Cce,backInOut:xnt,backOut:ynt,anticipate:Snt},uYn=e=>typeof e=="string",dCe=e=>{if(Cnt(e)){wce(e.length===4);const[t,n,r,s]=e;return GN(t,n,r,s)}else if(uYn(e))return cYn[e];return e},UM=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function dYn(e,t){let n=new Set,r=new Set,s=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(d){o.has(d)&&(l.schedule(d),e()),d(a)}const l={schedule:(d,p=!1,f=!1)=>{const m=f&&s?n:r;return p&&o.add(d),m.add(d),d},cancel:d=>{r.delete(d),o.delete(d)},process:d=>{if(a=d,s){i=!0;return}s=!0;const p=n;n=r,r=p,n.forEach(c),n.clear(),s=!1,i&&(i=!1,l.process(d))}};return l}const pYn=40;function Rnt(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=UM.reduce((x,S)=>(x[S]=dYn(i),x),{}),{setup:a,read:c,resolveKeyframes:l,preUpdate:d,update:p,preRender:f,render:h,postRender:m}=o,O=()=>{const x=c_.useManualTiming,S=x?s.timestamp:performance.now();n=!1,x||(s.delta=r?1e3/60:Math.max(Math.min(S-s.timestamp,pYn),1)),s.timestamp=S,s.isProcessing=!0,a.process(s),c.process(s),l.process(s),d.process(s),p.process(s),f.process(s),h.process(s),m.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(O))},_=()=>{n=!0,r=!0,s.isProcessing||e(O)};return{schedule:UM.reduce((x,S)=>{const v=o[S];return x[S]=(T,E=!1,w=!1)=>(n||_(),v.schedule(T,E,w)),x},{}),cancel:x=>{for(let S=0;S<UM.length;S++)o[UM[S]].cancel(x)},state:s,steps:o}}const{schedule:Ts,cancel:$m,state:Go,steps:U8}=Rnt(typeof requestAnimationFrame<"u"?requestAnimationFrame:Yu,!0);let B2;function fYn(){B2=void 0}const ol={now:()=>(B2===void 0&&ol.set(Go.isProcessing||c_.useManualTiming?Go.timestamp:performance.now()),B2),set:e=>{B2=e,queueMicrotask(fYn)}},Pnt=e=>t=>typeof t=="string"&&t.startsWith(e),$nt=Pnt("--"),hYn=Pnt("var(--"),Pce=e=>hYn(e)?mYn.test(e.split("/*")[0].trim()):!1,mYn=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function pCe(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const n1={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},HP={...n1,transform:e=>Af(0,1,e)},zM={...n1,default:1},UC=e=>Math.round(e*1e5)/1e5,$ce=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function OYn(e){return e==null}const gYn=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Nce=(e,t)=>n=>!!(typeof n=="string"&&gYn.test(n)&&n.startsWith(e)||t&&!OYn(n)&&Object.prototype.hasOwnProperty.call(n,t)),Nnt=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,a]=r.match($ce);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},_Yn=e=>Af(0,255,e),z8={...n1,transform:e=>Math.round(_Yn(e))},nb={test:Nce("rgb","red"),parse:Nnt("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+z8.transform(e)+", "+z8.transform(t)+", "+z8.transform(n)+", "+UC(HP.transform(r))+")"};function bYn(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const zee={test:Nce("#"),parse:bYn,transform:nb.transform},HN=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),vO=HN("deg"),Tf=HN("%"),on=HN("px"),yYn=HN("vh"),xYn=HN("vw"),fCe={...Tf,parse:e=>Tf.parse(e)/100,transform:e=>Tf.transform(e*100)},jS={test:Nce("hsl","hue"),parse:Nnt("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Tf.transform(UC(t))+", "+Tf.transform(UC(n))+", "+UC(HP.transform(r))+")"},Ii={test:e=>nb.test(e)||zee.test(e)||jS.test(e),parse:e=>nb.test(e)?nb.parse(e):jS.test(e)?jS.parse(e):zee.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?nb.transform(e):jS.transform(e),getAnimatableNone:e=>{const t=Ii.parse(e);return t.alpha=0,Ii.transform(t)}},SYn=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function vYn(e){return isNaN(e)&&typeof e=="string"&&(e.match($ce)?.length||0)+(e.match(SYn)?.length||0)>0}const Ant="number",Int="color",TYn="var",EYn="var(",hCe="${}",wYn=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function GT(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const a=t.replace(wYn,c=>(Ii.test(c)?(r.color.push(i),s.push(Int),n.push(Ii.parse(c))):c.startsWith(EYn)?(r.var.push(i),s.push(TYn),n.push(c)):(r.number.push(i),s.push(Ant),n.push(parseFloat(c))),++i,hCe)).split(hCe);return{values:n,split:a,indexes:r,types:s}}function kYn(e){return GT(e).values}function Mnt({split:e,types:t}){const n=e.length;return r=>{let s="";for(let i=0;i<n;i++)if(s+=e[i],r[i]!==void 0){const o=t[i];o===Ant?s+=UC(r[i]):o===Int?s+=Ii.transform(r[i]):s+=r[i]}return s}}function CYn(e){return Mnt(GT(e))}const RYn=e=>typeof e=="number"?0:Ii.test(e)?Ii.getAnimatableNone(e):e,PYn=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:RYn(e);function $Yn(e){const t=GT(e);return Mnt(t)(t.values.map((r,s)=>PYn(r,t.split[s])))}const qd={test:vYn,parse:kYn,createTransformer:CYn,getAnimatableNone:$Yn};function B8(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function NYn({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,i=0,o=0;if(!t)s=i=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,c=2*n-a;s=B8(c,a,e+1/3),i=B8(c,a,e),o=B8(c,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function OX(e,t){return n=>n>0?t:e}const Is=(e,t,n)=>e+(t-e)*n,F8=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},AYn=[zee,nb,jS],IYn=e=>AYn.find(t=>t.test(e));function mCe(e){const t=IYn(e);if(!t)return!1;let n=t.parse(e);return t===jS&&(n=NYn(n)),n}const OCe=(e,t)=>{const n=mCe(e),r=mCe(t);if(!n||!r)return OX(e,t);const s={...n};return i=>(s.red=F8(n.red,r.red,i),s.green=F8(n.green,r.green,i),s.blue=F8(n.blue,r.blue,i),s.alpha=Is(n.alpha,r.alpha,i),nb.transform(s))},Bee=new Set(["none","hidden"]);function MYn(e,t){return Bee.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function QYn(e,t){return n=>Is(e,t,n)}function Ace(e){return typeof e=="number"?QYn:typeof e=="string"?Pce(e)?OX:Ii.test(e)?OCe:jYn:Array.isArray(e)?Qnt:typeof e=="object"?Ii.test(e)?OCe:DYn:OX}function Qnt(e,t){const n=[...e],r=n.length,s=e.map((i,o)=>Ace(i)(i,t[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function DYn(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Ace(e[s])(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function LYn(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const i=t.types[s],o=e.indexes[i][r[i]],a=e.values[o]??0;n[s]=a,r[i]++}return n}const jYn=(e,t)=>{const n=qd.createTransformer(t),r=GT(e),s=GT(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Bee.has(e)&&!s.values.length||Bee.has(t)&&!r.values.length?MYn(e,t):WN(Qnt(LYn(r,s),s.values),n):OX(e,t)};function Dnt(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Is(e,t,n):Ace(e)(e,t)}const XYn=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Ts.update(t,n),stop:()=>$m(t),now:()=>Go.isProcessing?Go.timestamp:ol.now()}},Lnt=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i<s;i++)r+=Math.round(e(i/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},gX=2e4;function Ice(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<gX;)t+=n,r=e.next(t);return t>=gX?1/0:t}function jnt(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(Ice(r),gX);return{type:"keyframes",ease:i=>r.next(s*i).value/t,duration:Iu(s)}}const _i={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Fee(e,t){return e*Math.sqrt(1-t*t)}const UYn=12;function zYn(e,t,n){let r=n;for(let s=1;s<UYn;s++)r=r-e(r)/t(r);return r}const Y8=.001;function BYn({duration:e=_i.duration,bounce:t=_i.bounce,velocity:n=_i.velocity,mass:r=_i.mass}){let s,i,o=1-t;o=Af(_i.minDamping,_i.maxDamping,o),e=Af(_i.minDuration,_i.maxDuration,Iu(e)),o<1?(s=l=>{const d=l*o,p=d*e,f=d-n,h=Fee(l,o),m=Math.exp(-p);return Y8-f/h*m},i=l=>{const p=l*o*e,f=p*n+n,h=Math.pow(o,2)*Math.pow(l,2)*e,m=Math.exp(-p),O=Fee(Math.pow(l,2),o);return(-s(l)+Y8>0?-1:1)*((f-h)*m)/O}):(s=l=>{const d=Math.exp(-l*e),p=(l-n)*e+1;return-Y8+d*p},i=l=>{const d=Math.exp(-l*e),p=(n-l)*(e*e);return d*p});const a=5/e,c=zYn(s,i,a);if(e=ec(e),isNaN(c))return{stiffness:_i.stiffness,damping:_i.damping,duration:e};{const l=Math.pow(c,2)*r;return{stiffness:l,damping:o*2*Math.sqrt(r*l),duration:e}}}const FYn=["duration","bounce"],YYn=["stiffness","damping","mass"];function gCe(e,t){return t.some(n=>e[n]!==void 0)}function VYn(e){let t={velocity:_i.velocity,stiffness:_i.stiffness,damping:_i.damping,mass:_i.mass,isResolvedFromDuration:!1,...e};if(!gCe(e,YYn)&&gCe(e,FYn))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Af(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:_i.mass,stiffness:s,damping:i}}else{const n=BYn({...e,velocity:0});t={...t,...n,mass:_i.mass},t.isResolvedFromDuration=!0}return t}function ZP(e=_i.visualDuration,t=_i.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:c,damping:l,mass:d,duration:p,velocity:f,isResolvedFromDuration:h}=VYn({...n,velocity:-Iu(n.velocity||0)}),m=f||0,O=l/(2*Math.sqrt(c*d)),_=o-i,b=Iu(Math.sqrt(c/d)),y=Math.abs(_)<5;r||(r=y?_i.restSpeed.granular:_i.restSpeed.default),s||(s=y?_i.restDelta.granular:_i.restDelta.default);let x,S,v,T,E,w;if(O<1)v=Fee(b,O),T=(m+O*b*_)/v,x=k=>{const C=Math.exp(-O*b*k);return o-C*(T*Math.sin(v*k)+_*Math.cos(v*k))},E=O*b*T+_*v,w=O*b*_-T*v,S=k=>Math.exp(-O*b*k)*(E*Math.sin(v*k)+w*Math.cos(v*k));else if(O===1){x=C=>o-Math.exp(-b*C)*(_+(m+b*_)*C);const k=m+b*_;S=C=>Math.exp(-b*C)*(b*k*C-m)}else{const k=b*Math.sqrt(O*O-1);x=$=>{const R=Math.exp(-O*b*$),N=Math.min(k*$,300);return o-R*((m+O*b*_)*Math.sinh(N)+k*_*Math.cosh(N))/k};const C=(m+O*b*_)/k,M=O*b*C-_*k,I=O*b*_-C*k;S=$=>{const R=Math.exp(-O*b*$),N=Math.min(k*$,300);return R*(M*Math.sinh(N)+I*Math.cosh(N))}}const P={calculatedDuration:h&&p||null,velocity:k=>ec(S(k)),next:k=>{if(!h&&O<1){const M=Math.exp(-O*b*k),I=Math.sin(v*k),$=Math.cos(v*k),R=o-M*(T*I+_*$),N=ec(M*(E*I+w*$));return a.done=Math.abs(N)<=r&&Math.abs(o-R)<=s,a.value=a.done?o:R,a}const C=x(k);if(h)a.done=k>=p;else{const M=ec(S(k));a.done=Math.abs(M)<=r&&Math.abs(o-C)<=s}return a.value=a.done?o:C,a},toString:()=>{const k=Math.min(Ice(P),gX),C=Lnt(M=>P.next(k*M).value,k,30);return k+"ms "+C},toTransition:()=>{}};return P}ZP.applyToOptions=e=>{const t=jnt(e,100,ZP);return e.ease=t.ease,e.duration=ec(t.duration),e.type="keyframes",e};const qYn=5;function Xnt(e,t,n){const r=Math.max(t-qYn,0);return Ont(n-e(r),t-r)}function Yee({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:c,restDelta:l=.5,restSpeed:d}){const p=e[0],f={done:!1,value:p},h=w=>a!==void 0&&w<a||c!==void 0&&w>c,m=w=>a===void 0?c:c===void 0||Math.abs(a-w)<Math.abs(c-w)?a:c;let O=n*t;const _=p+O,b=o===void 0?_:o(_);b!==_&&(O=b-p);const y=w=>-O*Math.exp(-w/r),x=w=>b+y(w),S=w=>{const P=y(w),k=x(w);f.done=Math.abs(P)<=l,f.value=f.done?b:k};let v,T;const E=w=>{h(f.value)&&(v=w,T=ZP({keyframes:[f.value,m(f.value)],velocity:Xnt(x,w,f.value),damping:s,stiffness:i,restDelta:l,restSpeed:d}))};return E(0),{calculatedDuration:null,next:w=>{let P=!1;return!T&&v===void 0&&(P=!0,S(w),E(w)),v!==void 0&&w>=v?T.next(w-v):(!P&&S(w),f)}}}function WYn(e,t,n){const r=[],s=n||c_.mix||Dnt,i=e.length-1;for(let o=0;o<i;o++){let a=s(e[o],e[o+1]);if(t){const c=Array.isArray(t)?t[o]||Yu:t;a=WN(c,a)}r.push(a)}return r}function Unt(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const i=e.length;if(wce(i===t.length),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=WYn(t,r,s),c=a.length,l=d=>{if(o&&d<e[0])return t[0];let p=0;if(c>1)for(;p<e.length-2&&!(d<e[p+1]);p++);const f=WT(e[p],e[p+1],d);return a[p](f)};return n?d=>l(Af(e[0],e[i-1],d)):l}function znt(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=WT(0,t,r);e.push(Is(n,1,s))}}function Bnt(e){const t=[0];return znt(t,e.length-1),t}function GYn(e,t){return e.map(n=>n*t)}function HYn(e,t){return e.map(()=>t||Ent).splice(0,e.length-1)}function zC({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=wnt(r)?r.map(dCe):dCe(r),i={done:!1,value:t[0]},o=GYn(n&&n.length===t.length?n:Bnt(t),e),a=Unt(o,t,{ease:Array.isArray(s)?s:HYn(t,s)});return{calculatedDuration:e,next:c=>(i.value=a(c),i.done=c>=e,i)}}const ZYn=e=>e!==null;function RB(e,{repeat:t,repeatType:n="loop"},r,s=1){const i=e.filter(ZYn),a=s<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const KYn={decay:Yee,inertia:Yee,tween:zC,keyframes:zC,spring:ZP};function Fnt(e){typeof e.type=="string"&&(e.type=KYn[e.type])}class Mce{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const JYn=e=>e/100;class _X extends Mce{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==ol.now()&&this.tick(ol.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Fnt(t);const{type:n=zC,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=t;let{keyframes:a}=t;const c=n||zC;c!==zC&&typeof a[0]!="number"&&(this.mixKeyframes=WN(JYn,Dnt(a[0],a[1])),a=[0,100]);const l=c({...t,keyframes:a});i==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...a].reverse(),velocity:-o})),l.calculatedDuration===null&&(l.calculatedDuration=Ice(l));const{calculatedDuration:d}=l;this.calculatedDuration=d,this.resolvedDuration=d+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=l}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:l=0,keyframes:d,repeat:p,repeatType:f,repeatDelay:h,type:m,onUpdate:O,finalKeyframe:_}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const b=this.currentTime-l*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?b<0:b>s;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let x=this.currentTime,S=r;if(p){const w=Math.min(this.currentTime,s)/a;let P=Math.floor(w),k=w%1;!k&&w>=1&&(k=1),k===1&&P--,P=Math.min(P,p+1),!!(P%2)&&(f==="reverse"?(k=1-k,h&&(k-=h/a)):f==="mirror"&&(S=o)),x=Af(0,1,k)*a}let v;y?(this.delayState.value=d[0],v=this.delayState):v=S.next(x),i&&!y&&(v.value=i(v.value));let{done:T}=v;!y&&c!==null&&(T=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&T);return E&&m!==Yee&&(v.value=RB(d,this.options,_,this.speed)),O&&O(v.value),E&&this.finish(),v}then(t,n){return this.finished.then(t,n)}get duration(){return Iu(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Iu(t)}get time(){return Iu(this.currentTime)}set time(t){t=ec(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return Xnt(r=>this.generator.next(r).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(ol.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=Iu(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=XYn,startTime:n}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ol.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function eVn(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const rb=e=>e*180/Math.PI,Vee=e=>{const t=rb(Math.atan2(e[1],e[0]));return qee(t)},tVn={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Vee,rotateZ:Vee,skewX:e=>rb(Math.atan(e[1])),skewY:e=>rb(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},qee=e=>(e=e%360,e<0&&(e+=360),e),_Ce=Vee,bCe=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),yCe=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),nVn={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:bCe,scaleY:yCe,scale:e=>(bCe(e)+yCe(e))/2,rotateX:e=>qee(rb(Math.atan2(e[6],e[5]))),rotateY:e=>qee(rb(Math.atan2(-e[2],e[0]))),rotateZ:_Ce,rotate:_Ce,skewX:e=>rb(Math.atan(e[4])),skewY:e=>rb(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Wee(e){return e.includes("scale")?1:0}function Gee(e,t){if(!e||e==="none")return Wee(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=nVn,s=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=tVn,s=a}if(!s)return Wee(t);const i=r[t],o=s[1].split(",").map(sVn);return typeof i=="function"?i(o):o[i]}const rVn=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Gee(n,t)};function sVn(e){return parseFloat(e.trim())}const r1=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],s1=new Set(r1),xCe=e=>e===n1||e===on,iVn=new Set(["x","y","z"]),oVn=r1.filter(e=>!iVn.has(e));function aVn(e){const t=[];return oVn.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const dg={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Gee(t,"x"),y:(e,{transform:t})=>Gee(t,"y")};dg.translateX=dg.x;dg.translateY=dg.y;const Tb=new Set;let Hee=!1,Zee=!1,Kee=!1;function Ynt(){if(Zee){const e=Array.from(Tb).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=aVn(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{r.getValue(i)?.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Zee=!1,Hee=!1,Tb.forEach(e=>e.complete(Kee)),Tb.clear()}function Vnt(){Tb.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Zee=!0)})}function lVn(){Kee=!0,Vnt(),Ynt(),Kee=!1}class Qce{constructor(t,n,r,s,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Tb.add(this),Hee||(Hee=!0,Ts.read(Vnt),Ts.resolveKeyframes(Ynt))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const i=s?.get(),o=t[t.length-1];if(i!==void 0)t[0]=i;else if(r&&n){const a=r.readValue(n,o);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=o),s&&i===void 0&&s.set(t[0])}eVn(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Tb.delete(this)}cancel(){this.state==="scheduled"&&(Tb.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const cVn=e=>e.startsWith("--");function qnt(e,t,n){cVn(t)?e.style.setProperty(t,n):e.style[t]=n}const uVn={};function Wnt(e,t){const n=mnt(e);return()=>uVn[t]??n()}const dVn=Wnt(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Gnt=Wnt(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),xk=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,SCe={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:xk([0,.65,.55,1]),circOut:xk([.55,0,1,.45]),backIn:xk([.31,.01,.66,-.59]),backOut:xk([.33,1.53,.69,.99])};function Hnt(e,t){if(e)return typeof e=="function"?Gnt()?Lnt(e,t):"ease-out":Cnt(e)?xk(e):Array.isArray(e)?e.map(n=>Hnt(n,t)||SCe.easeOut):SCe[e]}function pVn(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:a="easeOut",times:c}={},l=void 0){const d={[t]:n};c&&(d.offset=c);const p=Hnt(a,s);Array.isArray(p)&&(d.easing=p);const f={delay:r,duration:s,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return l&&(f.pseudoElement=l),e.animate(d,f)}function Dce(e){return typeof e=="function"&&"applyToOptions"in e}function fVn({type:e,...t}){return Dce(e)&&Gnt()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class Znt extends Mce{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:a,onComplete:c}=t;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=t,wce(typeof t.type!="string");const l=fVn(t);this.animation=pVn(n,r,s,l,i),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const d=RB(s,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(d),qnt(n,r,d),this.animation.cancel()}c?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return Iu(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Iu(t)}get time(){return Iu(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ec(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:r,observe:s}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&dVn()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),Yu):s(this)}}const Knt={anticipate:Snt,backInOut:xnt,circInOut:Tnt};function hVn(e){return e in Knt}function mVn(e){typeof e.ease=="string"&&hVn(e.ease)&&(e.ease=Knt[e.ease])}const V8=10;class OVn extends Znt{constructor(t){mVn(t),Fnt(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:i,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new _X({...o,autoplay:!1}),c=Math.max(V8,ol.now()-this.startTime),l=Af(0,V8,c-V8),d=a.sample(c).value,{name:p}=this.options;i&&p&&qnt(i,p,d),n.setWithVelocity(a.sample(Math.max(0,c-l)).value,d,l),a.stop()}}const vCe=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(qd.test(e)||e==="0")&&!e.startsWith("url("));function gVn(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function _Vn(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],o=vCe(s,t),a=vCe(i,t);return!o||!a?!1:gVn(e)||(n==="spring"||Dce(n))&&r}function Jee(e){e.duration=0,e.type="keyframes"}const Jnt=new Set(["opacity","clipPath","filter","transform"]),bVn=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function yVn(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&bVn.test(e[t]))return!0;return!1}const xVn=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),SVn=mnt(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function vVn(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:i,type:o,keyframes:a}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:d}=t.owner.getProps();return SVn()&&n&&(Jnt.has(n)||xVn.has(n)&&yVn(a))&&(n!=="transform"||!d)&&!l&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const TVn=40;class EVn extends Mce{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",keyframes:a,name:c,motionValue:l,element:d,...p}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=ol.now();const f={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,name:c,motionValue:l,element:d,...p},h=d?.KeyframeResolver||Qce;this.keyframeResolver=new h(a,(m,O,_)=>this.onKeyframesResolved(m,O,f,!_),c,l,d),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,r,s){this.keyframeResolver=void 0;const{name:i,type:o,velocity:a,delay:c,isHandoff:l,onUpdate:d}=r;this.resolvedAt=ol.now();let p=!0;_Vn(t,i,o,a)||(p=!1,(c_.instantAnimations||!c)&&d?.(RB(t,r,n)),t[0]=t[t.length-1],Jee(r),r.repeat=0);const h={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>TVn?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},m=p&&!l&&vVn(h),O=h.motionValue?.owner?.current;let _;if(m)try{_=new OVn({...h,element:O})}catch{_=new _X(h)}else _=new _X(h);_.finished.then(()=>{this.notifyFinished()}).catch(Yu),this.pendingTimeline&&(this.stopTimeline=_.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=_}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),lVn()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class wVn{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t){const n=this.animations.map(r=>r.attachTimeline(t));return()=>{n.forEach((r,s)=>{r&&r(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return TCe(this.animations,"duration")}get iterationDuration(){return TCe(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(n=>n[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function TCe(e,t){let n=0;for(let r=0;r<e.length;r++){const s=e[r][t];s!==null&&s>n&&(n=s)}return n}class kVn extends wVn{then(t,n){return this.finished.finally(t).then(()=>{})}}function ert(e,t,n,r=0,s=1){const i=Array.from(e).sort((l,d)=>l.sortNodePosition(d)).indexOf(t),o=e.size,a=(o-1)*r;return typeof n=="function"?n(i,o):s===1?i*r:a-i*r}const CVn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function RVn(e){const t=CVn.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function trt(e,t,n=1){const[r,s]=RVn(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const o=i.trim();return pnt(o)?parseFloat(o):o}return Pce(s)?trt(s,t,n+1):s}const PVn={type:"spring",stiffness:500,damping:25,restSpeed:10},$Vn=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),NVn={type:"keyframes",duration:.8},AVn={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},IVn=(e,{keyframes:t})=>t.length>2?NVn:s1.has(e)?e.startsWith("scale")?$Vn(t[1]):PVn:AVn;function nrt(e,t){if(e?.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function Lce(e,t){const n=e?.[t]??e?.default??e;return n!==e?nrt(n,e):n}const MVn=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function QVn(e){for(const t in e)if(!MVn.has(t))return!0;return!1}const jce=(e,t,n,r={},s,i)=>o=>{const a=Lce(r,e)||{},c=a.delay||r.delay||0;let{elapsed:l=0}=r;l=l-ec(c);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-l,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:s};QVn(a)||Object.assign(d,IVn(e,d)),d.duration&&(d.duration=ec(d.duration)),d.repeatDelay&&(d.repeatDelay=ec(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let p=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(Jee(d),d.delay===0&&(p=!0)),(c_.instantAnimations||c_.skipAnimations||s?.shouldSkipAnimations)&&(p=!0,Jee(d),d.delay=0),d.allowFlatten=!a.type&&!a.ease,p&&!i&&t.get()!==void 0){const f=RB(d.keyframes,a);if(f!==void 0){Ts.update(()=>{d.onUpdate(f),d.onComplete()});return}}return a.isSync?new _X(d):new EVn(d)};function ECe(e){const t=[{},{}];return e?.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Xce(e,t,n,r){if(typeof t=="function"){const[s,i]=ECe(r);t=t(n!==void 0?n:e.custom,s,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,i]=ECe(r);t=t(n!==void 0?n:e.custom,s,i)}return t}function Eb(e,t,n){const r=e.getProps();return Xce(r,t,n!==void 0?n:r.custom,e)}const rrt=new Set(["width","height","top","left","right","bottom",...r1]),wCe=30,DVn=e=>!isNaN(parseFloat(e)),BC={current:void 0};class LVn{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const s=ol.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=ol.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=DVn(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new kce);const r=this.events[t].add(n);return t==="change"?()=>{r(),Ts.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return BC.current&&BC.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=ol.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>wCe)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,wCe);return Ont(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function u_(e,t){return new LVn(e,t)}const ete=e=>Array.isArray(e);function jVn(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,u_(n))}function XVn(e){return ete(e)?e[e.length-1]||0:e}function UVn(e,t){const n=Eb(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const a=XVn(i[o]);jVn(e,o,a)}}const co=e=>!!(e&&e.getVelocity);function zVn(e){return!!(co(e)&&e.add)}function tte(e,t){const n=e.getValue("willChange");if(zVn(n))return n.add(t);if(!n&&c_.WillChange){const r=new c_.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Uce(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const BVn="framerAppearId",srt="data-"+Uce(BVn);function irt(e){return e.props[srt]}function FVn({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function zce(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:o,...a}=t;const c=e.getDefaultTransition();i=i?nrt(i,c):c;const l=i?.reduceMotion;r&&(i=r);const d=[],p=s&&e.animationState&&e.animationState.getState()[s];for(const f in a){const h=e.getValue(f,e.latestValues[f]??null),m=a[f];if(m===void 0||p&&FVn(p,f))continue;const O={delay:n,...Lce(i||{},f)},_=h.get();if(_!==void 0&&!h.isAnimating()&&!Array.isArray(m)&&m===_&&!O.velocity){Ts.update(()=>h.set(m));continue}let b=!1;if(window.MotionHandoffAnimation){const S=irt(e);if(S){const v=window.MotionHandoffAnimation(S,f,Ts);v!==null&&(O.startTime=v,b=!0)}}tte(e,f);const y=l??e.shouldReduceMotion;h.start(jce(f,h,m,y&&rrt.has(f)?{type:!1}:O,e,b));const x=h.animation;x&&d.push(x)}if(o){const f=()=>Ts.update(()=>{o&&UVn(e,o)});d.length?Promise.all(d).then(f):f()}return d}function nte(e,t,n={}){const r=Eb(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(zce(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:l=0,staggerChildren:d,staggerDirection:p}=s;return YVn(e,t,c,l,d,p,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[c,l]=a==="beforeChildren"?[i,o]:[o,i];return c().then(()=>l())}else return Promise.all([i(),o(n.delay)])}function YVn(e,t,n=0,r=0,s=0,i=1,o){const a=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),a.push(nte(c,t,{...o,delay:n+(typeof r=="function"?0:r)+ert(e.variantChildren,c,r,s,i)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(a)}function VVn(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>nte(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=nte(e,t,n);else{const s=typeof t=="function"?Eb(e,t,n.custom):t;r=Promise.all(zce(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const qVn={test:e=>e==="auto",parse:e=>e},ort=e=>t=>t.test(e),art=[n1,on,Tf,vO,xYn,yYn,qVn],kCe=e=>art.find(ort(e));function WVn(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||hnt(e):!0}const GVn=new Set(["brightness","contrast","saturate","opacity"]);function HVn(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match($ce)||[];if(!r)return e;const s=n.replace(r,"");let i=GVn.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const ZVn=/\b([a-z-]*)\(.*?\)/gu,rte={...qd,getAnimatableNone:e=>{const t=e.match(ZVn);return t?t.map(HVn).join(" "):e}},ste={...qd,getAnimatableNone:e=>{const t=qd.parse(e);return qd.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},CCe={...n1,transform:Math.round},KVn={rotate:vO,rotateX:vO,rotateY:vO,rotateZ:vO,scale:zM,scaleX:zM,scaleY:zM,scaleZ:zM,skew:vO,skewX:vO,skewY:vO,distance:on,translateX:on,translateY:on,translateZ:on,x:on,y:on,z:on,perspective:on,transformPerspective:on,opacity:HP,originX:fCe,originY:fCe,originZ:on},Bce={borderWidth:on,borderTopWidth:on,borderRightWidth:on,borderBottomWidth:on,borderLeftWidth:on,borderRadius:on,borderTopLeftRadius:on,borderTopRightRadius:on,borderBottomRightRadius:on,borderBottomLeftRadius:on,width:on,maxWidth:on,height:on,maxHeight:on,top:on,right:on,bottom:on,left:on,inset:on,insetBlock:on,insetBlockStart:on,insetBlockEnd:on,insetInline:on,insetInlineStart:on,insetInlineEnd:on,padding:on,paddingTop:on,paddingRight:on,paddingBottom:on,paddingLeft:on,paddingBlock:on,paddingBlockStart:on,paddingBlockEnd:on,paddingInline:on,paddingInlineStart:on,paddingInlineEnd:on,margin:on,marginTop:on,marginRight:on,marginBottom:on,marginLeft:on,marginBlock:on,marginBlockStart:on,marginBlockEnd:on,marginInline:on,marginInlineStart:on,marginInlineEnd:on,fontSize:on,backgroundPositionX:on,backgroundPositionY:on,...KVn,zIndex:CCe,fillOpacity:HP,strokeOpacity:HP,numOctaves:CCe},JVn={...Bce,color:Ii,backgroundColor:Ii,outlineColor:Ii,fill:Ii,stroke:Ii,borderColor:Ii,borderTopColor:Ii,borderRightColor:Ii,borderBottomColor:Ii,borderLeftColor:Ii,filter:rte,WebkitFilter:rte,mask:ste,WebkitMask:ste},lrt=e=>JVn[e],eqn=new Set([rte,ste]);function crt(e,t){let n=lrt(e);return eqn.has(n)||(n=qd),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const tqn=new Set(["auto","none","0"]);function nqn(e,t,n){let r=0,s;for(;r<e.length&&!s;){const i=e[r];typeof i=="string"&&!tqn.has(i)&&GT(i).values.length&&(s=e[r]),r++}if(s&&n)for(const i of t)e[i]=crt(n,s)}class rqn extends Qce{constructor(t,n,r,s,i){super(t,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let d=0;d<t.length;d++){let p=t[d];if(typeof p=="string"&&(p=p.trim(),Pce(p))){const f=trt(p,n.current);f!==void 0&&(t[d]=f),d===t.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!rrt.has(r)||t.length!==2)return;const[s,i]=t,o=kCe(s),a=kCe(i),c=pCe(s),l=pCe(i);if(c!==l&&dg[r]){this.needsMeasurement=!0;return}if(o!==a)if(xCe(o)&&xCe(a))for(let d=0;d<t.length;d++){const p=t[d];typeof p=="string"&&(t[d]=parseFloat(p))}else dg[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||WVn(t[s]))&&r.push(s);r.length&&nqn(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=dg[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const i=r.length-1,o=r[i];r[i]=dg[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,c])=>{t.getValue(a).set(c)}),this.resolveNoneKeyframes()}}function Fce(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;t&&(r=t.current);const s=n?.[e]??r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(r=>r!=null)}const urt=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function sqn(e){return fnt(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Yce}=Rnt(queueMicrotask,!1),gd={x:!1,y:!1};function drt(){return gd.x||gd.y}function iqn(e){return e==="x"||e==="y"?gd[e]?null:(gd[e]=!0,()=>{gd[e]=!1}):gd.x||gd.y?null:(gd.x=gd.y=!0,()=>{gd.x=gd.y=!1})}function prt(e,t){const n=Fce(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function oqn(e){return!(e.pointerType==="touch"||drt())}function aqn(e,t,n={}){const[r,s,i]=prt(e,n);return r.forEach(o=>{let a=!1,c=!1,l;const d=()=>{o.removeEventListener("pointerleave",m)},p=_=>{l&&(l(_),l=void 0),d()},f=_=>{a=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),c&&(c=!1,p(_))},h=()=>{a=!0,window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",f,s)},m=_=>{if(_.pointerType!=="touch"){if(a){c=!0;return}p(_)}},O=_=>{if(!oqn(_))return;c=!1;const b=t(o,_);typeof b=="function"&&(l=b,o.addEventListener("pointerleave",m,s))};o.addEventListener("pointerenter",O,s),o.addEventListener("pointerdown",h,s)}),i}const frt=(e,t)=>t?e===t?!0:frt(e,t.parentElement):!1,Vce=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,lqn=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function cqn(e){return lqn.has(e.tagName)||e.isContentEditable===!0}const uqn=new Set(["INPUT","SELECT","TEXTAREA"]);function dqn(e){return uqn.has(e.tagName)||e.isContentEditable===!0}const F2=new WeakSet;function RCe(e){return t=>{t.key==="Enter"&&e(t)}}function q8(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const pqn=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=RCe(()=>{if(F2.has(n))return;q8(n,"down");const s=RCe(()=>{q8(n,"up")}),i=()=>q8(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function PCe(e){return Vce(e)&&!drt()}const $Ce=new WeakSet;function fqn(e,t,n={}){const[r,s,i]=prt(e,n),o=a=>{const c=a.currentTarget;if(!PCe(a)||$Ce.has(a))return;F2.add(c),n.stopPropagation&&$Ce.add(a);const l=t(c,a),d=(h,m)=>{window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",f),F2.has(c)&&F2.delete(c),PCe(h)&&typeof l=="function"&&l(h,{success:m})},p=h=>{d(h,c===window||c===document||n.useGlobalTarget||frt(c,h.target))},f=h=>{d(h,!1)};window.addEventListener("pointerup",p,s),window.addEventListener("pointercancel",f,s)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,s),sqn(a)&&(a.addEventListener("focus",l=>pqn(l,s)),!cqn(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}function PB(e){return fnt(e)&&"ownerSVGElement"in e}const Y2=new WeakMap;let V2;const hrt=(e,t,n)=>(r,s)=>s&&s[0]?s[0][e+"Size"]:PB(r)&&"getBBox"in r?r.getBBox()[t]:r[n],hqn=hrt("inline","width","offsetWidth"),mqn=hrt("block","height","offsetHeight");function Oqn({target:e,borderBoxSize:t}){Y2.get(e)?.forEach(n=>{n(e,{get width(){return hqn(e,t)},get height(){return mqn(e,t)}})})}function gqn(e){e.forEach(Oqn)}function _qn(){typeof ResizeObserver>"u"||(V2=new ResizeObserver(gqn))}function bqn(e,t){V2||_qn();const n=Fce(e);return n.forEach(r=>{let s=Y2.get(r);s||(s=new Set,Y2.set(r,s)),s.add(t),V2?.observe(r)}),()=>{n.forEach(r=>{const s=Y2.get(r);s?.delete(t),s?.size||V2?.unobserve(r)})}}const q2=new Set;let XS;function yqn(){XS=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};q2.forEach(t=>t(e))},window.addEventListener("resize",XS)}function xqn(e){return q2.add(e),XS||yqn(),()=>{q2.delete(e),!q2.size&&typeof XS=="function"&&(window.removeEventListener("resize",XS),XS=void 0)}}function NCe(e,t){return typeof e=="function"?xqn(e):bqn(e,t)}function mrt(e){return PB(e)&&e.tagName==="svg"}function W2(...e){const t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],s=e[1+n],i=e[2+n],o=e[3+n],a=Unt(s,i,o);return t?a(r):a}const Sqn=[...art,Ii,qd],vqn=e=>Sqn.find(ort(e)),ACe=()=>({translate:0,scale:1,origin:0,originPoint:0}),US=()=>({x:ACe(),y:ACe()}),ICe=()=>({min:0,max:0}),Ai=()=>({x:ICe(),y:ICe()}),KP=new WeakMap;function $B(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function JP(e){return typeof e=="string"||Array.isArray(e)}const qce=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Wce=["initial",...qce];function NB(e){return $B(e.animate)||Wce.some(t=>JP(e[t]))}function Ort(e){return!!(NB(e)||e.variants)}function Tqn(e,t,n){for(const r in t){const s=t[r],i=n[r];if(co(s))e.addValue(r,s);else if(co(i))e.addValue(r,u_(s,{owner:e}));else if(i!==s)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=e.getStaticValue(r);e.addValue(r,u_(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const bX={current:null},Gce={current:!1},Eqn=typeof window<"u";function grt(){if(Gce.current=!0,!!Eqn)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>bX.current=e.matches;e.addEventListener("change",t),t()}else bX.current=!1}const MCe=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let yX={};function _rt(e){yX=e}function wqn(){return yX}class brt{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:o,visualState:a},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Qce,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const h=ol.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,Ts.render(this.render,!1,!0))};const{latestValues:l,renderState:d}=a;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=d,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=i,this.options=c,this.blockInitialAnimation=!!o,this.isControllingVariants=NB(n),this.isVariantNode=Ort(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:p,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in f){const m=f[h];l[h]!==void 0&&co(m)&&m.set(l[h])}}mount(t){if(this.hasBeenMounted)for(const n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=t,KP.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Gce.current||grt(),this.shouldReduceMotion=bX.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),$m(this.notifyUpdate),$m(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&Jnt.has(t)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:c,ease:l,duration:d}=n.accelerate,p=new Znt({element:this.current,name:t,keyframes:a,times:c,ease:l,duration:ec(d)}),f=o(p);this.valueSubscriptions.set(t,()=>{f(),p.cancel()});return}const r=s1.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&Ts.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),i&&i(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in yX){const n=yX[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ai()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<MCe.length;r++){const s=MCe[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=t[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=Tqn(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=u_(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(pnt(r)||hnt(r))?r=parseFloat(r):!vqn(r)&&qd.test(n)&&(r=crt(t,n)),this.setBaseTarget(t,co(r)?r.get():r)),co(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=Xce(this.props,n,this.presenceContext?.custom);i&&(r=i[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!co(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new kce),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Yce.render(this.render)}}class yrt extends brt{constructor(){super(...arguments),this.KeyframeResolver=rqn}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;co(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class I_{constructor(t){this.isMounted=!1,this.node=t}update(){}}function xrt({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function kqn({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Cqn(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function W8(e){return e===void 0||e===1}function ite({scale:e,scaleX:t,scaleY:n}){return!W8(e)||!W8(t)||!W8(n)}function b0(e){return ite(e)||Srt(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Srt(e){return QCe(e.x)||QCe(e.y)}function QCe(e){return e&&e!=="0%"}function xX(e,t,n){const r=e-n,s=t*r;return n+s}function DCe(e,t,n,r,s){return s!==void 0&&(e=xX(e,s,r)),xX(e,n,r)+t}function ote(e,t=0,n=1,r,s){e.min=DCe(e.min,t,n,r,s),e.max=DCe(e.max,t,n,r,s)}function vrt(e,{x:t,y:n}){ote(e.x,t.translate,t.scale,t.originPoint),ote(e.y,n.translate,n.scale,n.originPoint)}const LCe=.999999999999,jCe=1.0000000000001;function Rqn(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let i,o;for(let a=0;a<s;a++){i=n[a],o=i.projectionDelta;const{visualElement:c}=i.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(qp(e.x,-i.scroll.offset.x),qp(e.y,-i.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,vrt(e,o)),r&&b0(i.latestValues)&&G2(e,i.latestValues,i.layout?.layoutBox))}t.x<jCe&&t.x>LCe&&(t.x=1),t.y<jCe&&t.y>LCe&&(t.y=1)}function qp(e,t){e.min+=t,e.max+=t}function XCe(e,t,n,r,s=.5){const i=Is(e.min,e.max,s);ote(e,t,n,i,r)}function UCe(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function G2(e,t,n){const r=n??e;XCe(e.x,UCe(t.x,r.x),t.scaleX,t.scale,t.originX),XCe(e.y,UCe(t.y,r.y),t.scaleY,t.scale,t.originY)}function Trt(e,t){return xrt(Cqn(e.getBoundingClientRect(),t))}function Pqn(e,t,n){const r=Trt(e,n),{scroll:s}=t;return s&&(qp(r.x,s.offset.x),qp(r.y,s.offset.y)),r}const $qn={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Nqn=r1.length;function Aqn(e,t,n){let r="",s=!0;for(let i=0;i<Nqn;i++){const o=r1[i],a=e[o];if(a===void 0)continue;let c=!0;if(typeof a=="number")c=a===(o.startsWith("scale")?1:0);else{const l=parseFloat(a);c=o.startsWith("scale")?l===1:l===0}if(!c||n){const l=urt(a,Bce[o]);if(!c){s=!1;const d=$qn[o]||o;r+=`${d}(${l}) `}n&&(t[o]=l)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function Hce(e,t,n){const{style:r,vars:s,transformOrigin:i}=e;let o=!1,a=!1;for(const c in t){const l=t[c];if(s1.has(c)){o=!0;continue}else if($nt(c)){s[c]=l;continue}else{const d=urt(l,Bce[c]);c.startsWith("origin")?(a=!0,i[c]=d):r[c]=d}}if(t.transform||(o||n?r.transform=Aqn(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:c="50%",originY:l="50%",originZ:d=0}=i;r.transformOrigin=`${c} ${l} ${d}`}}function Ert(e,{style:t,vars:n},r,s){const i=e.style;let o;for(o in t)i[o]=t[o];s?.applyProjectionStyles(i,r);for(o in n)i.setProperty(o,n[o])}function zCe(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Cw={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(on.test(e))e=parseFloat(e);else return e;const n=zCe(e,t.target.x),r=zCe(e,t.target.y);return`${n}% ${r}%`}},Iqn={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=qd.parse(e);if(s.length>5)return r;const i=qd.createTransformer(e),o=typeof s[0]!="number"?1:0,a=n.x.scale*t.x,c=n.y.scale*t.y;s[0+o]/=a,s[1+o]/=c;const l=Is(a,c,.5);return typeof s[2+o]=="number"&&(s[2+o]/=l),typeof s[3+o]=="number"&&(s[3+o]/=l),i(s)}},ate={borderRadius:{...Cw,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Cw,borderTopRightRadius:Cw,borderBottomLeftRadius:Cw,borderBottomRightRadius:Cw,boxShadow:Iqn};function wrt(e,{layout:t,layoutId:n}){return s1.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ate[e]||e==="opacity")}function Zce(e,t,n){const r=e.style,s=t?.style,i={};if(!r)return i;for(const o in r)(co(r[o])||s&&co(s[o])||wrt(o,e)||n?.getValue(o)?.liveStyle!==void 0)&&(i[o]=r[o]);return i}function Mqn(e){return window.getComputedStyle(e)}class krt extends yrt{constructor(){super(...arguments),this.type="html",this.renderInstance=Ert}readValueFromInstance(t,n){if(s1.has(n))return this.projection?.isProjecting?Wee(n):rVn(t,n);{const r=Mqn(t),s=($nt(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Trt(t,n)}build(t,n,r){Hce(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Zce(t,n,r)}}function Qqn(e,t){return e in t}class Dqn extends brt{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,n){if(Qqn(n,t)){const r=t[n];if(typeof r=="string"||typeof r=="number")return r}}getBaseTargetFromProps(){}removeValueFromRenderState(t,n){delete n.output[t]}measureInstanceViewportBox(){return Ai()}build(t,n){Object.assign(t.output,n)}renderInstance(t,{output:n}){Object.assign(t,n)}sortInstanceNodePosition(){return 0}}const Lqn={offset:"stroke-dashoffset",array:"stroke-dasharray"},jqn={offset:"strokeDashoffset",array:"strokeDasharray"};function Xqn(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?Lqn:jqn;e[i.offset]=`${-r}`,e[i.array]=`${t} ${n}`}const Uqn=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Crt(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...a},c,l,d){if(Hce(e,a,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:f}=e;p.transform&&(f.transform=p.transform,delete p.transform),(f.transform||p.transformOrigin)&&(f.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),f.transform&&(f.transformBox=d?.transformBox??"fill-box",delete p.transformBox);for(const h of Uqn)p[h]!==void 0&&(f[h]=p[h],delete p[h]);t!==void 0&&(p.x=t),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),s!==void 0&&Xqn(p,s,i,o,!1)}const Rrt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Prt=e=>typeof e=="string"&&e.toLowerCase()==="svg";function zqn(e,t,n,r){Ert(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(Rrt.has(s)?s:Uce(s),t.attrs[s])}function $rt(e,t,n){const r=Zce(e,t,n);for(const s in e)if(co(e[s])||co(t[s])){const i=r1.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}class Nrt extends yrt{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ai}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(s1.has(n)){const r=lrt(n);return r&&r.default||0}return n=Rrt.has(n)?n:Uce(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return $rt(t,n,r)}build(t,n,r){Crt(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){zqn(t,n,r,s)}mount(t){this.isSVGTag=Prt(t.tagName),super.mount(t)}}const Bqn=Wce.length;function Art(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Art(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Bqn;n++){const r=Wce[n],s=e.props[r];(JP(s)||s===!1)&&(t[r]=s)}return t}function Irt(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const Fqn=[...qce].reverse(),Yqn=qce.length;function Vqn(e){return t=>Promise.all(t.map(({animation:n,options:r})=>VVn(e,n,r)))}function qqn(e){let t=Vqn(e),n=BCe(),r=!0,s=!1;const i=l=>(d,p)=>{const f=Eb(e,p,l==="exit"?e.presenceContext?.custom:void 0);if(f){const{transition:h,transitionEnd:m,...O}=f;d={...d,...O,...m}}return d};function o(l){t=l(e)}function a(l){const{props:d}=e,p=Art(e.parent)||{},f=[],h=new Set;let m={},O=1/0;for(let b=0;b<Yqn;b++){const y=Fqn[b],x=n[y],S=d[y]!==void 0?d[y]:p[y],v=JP(S),T=y===l?x.isActive:null;T===!1&&(O=b);let E=S===p[y]&&S!==d[y]&&v;if(E&&(r||s)&&e.manuallyAnimateOnMount&&(E=!1),x.protectedKeys={...m},!x.isActive&&T===null||!S&&!x.prevProp||$B(S)||typeof S=="boolean")continue;if(y==="exit"&&x.isActive&&T!==!0){x.prevResolvedValues&&(m={...m,...x.prevResolvedValues});continue}const w=Wqn(x.prevProp,S);let P=w||y===l&&x.isActive&&!E&&v||b>O&&v,k=!1;const C=Array.isArray(S)?S:[S];let M=C.reduce(i(y),{});T===!1&&(M={});const{prevResolvedValues:I={}}=x,$={...I,...M},R=Q=>{P=!0,h.has(Q)&&(k=!0,h.delete(Q)),x.needsAnimating[Q]=!0;const U=e.getValue(Q);U&&(U.liveStyle=!1)};for(const Q in $){const U=M[Q],A=I[Q];if(m.hasOwnProperty(Q))continue;let V=!1;ete(U)&&ete(A)?V=!Irt(U,A):V=U!==A,V?U!=null?R(Q):h.add(Q):U!==void 0&&h.has(Q)?R(Q):x.protectedKeys[Q]=!0}x.prevProp=S,x.prevResolvedValues=M,x.isActive&&(m={...m,...M}),(r||s)&&e.blockInitialAnimation&&(P=!1);const N=E&&w;P&&(!N||k)&&f.push(...C.map(Q=>{const U={type:y};if(typeof Q=="string"&&(r||s)&&!N&&e.manuallyAnimateOnMount&&e.parent){const{parent:A}=e,V=Eb(A,Q);if(A.enteringChildren&&V){const{delayChildren:z}=V.transition||{};U.delay=ert(A.enteringChildren,e,z)}}return{animation:Q,options:U}}))}if(h.size){const b={};if(typeof d.initial!="boolean"){const y=Eb(e,Array.isArray(d.initial)?d.initial[0]:d.initial);y&&y.transition&&(b.transition=y.transition)}h.forEach(y=>{const x=e.getBaseTarget(y),S=e.getValue(y);S&&(S.liveStyle=!0),b[y]=x??null}),f.push({animation:b})}let _=!!f.length;return r&&(d.initial===!1||d.initial===d.animate)&&!e.manuallyAnimateOnMount&&(_=!1),r=!1,s=!1,_?t(f):Promise.resolve()}function c(l,d){if(n[l].isActive===d)return Promise.resolve();e.variantChildren?.forEach(f=>f.animationState?.setActive(l,d)),n[l].isActive=d;const p=a(l);for(const f in n)n[f].protectedKeys={};return p}return{animateChanges:a,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=BCe(),s=!0}}}function Wqn(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Irt(t,e):!1}function s0(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function BCe(){return{animate:s0(!0),whileInView:s0(),whileHover:s0(),whileTap:s0(),whileDrag:s0(),whileFocus:s0(),exit:s0()}}function lte(e,t){e.min=t.min,e.max=t.max}function ud(e,t){lte(e.x,t.x),lte(e.y,t.y)}function FCe(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const Mrt=1e-4,Gqn=1-Mrt,Hqn=1+Mrt,Qrt=.01,Zqn=0-Qrt,Kqn=0+Qrt;function al(e){return e.max-e.min}function Jqn(e,t,n){return Math.abs(e-t)<=n}function YCe(e,t,n,r=.5){e.origin=r,e.originPoint=Is(t.min,t.max,e.origin),e.scale=al(n)/al(t),e.translate=Is(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Gqn&&e.scale<=Hqn||isNaN(e.scale))&&(e.scale=1),(e.translate>=Zqn&&e.translate<=Kqn||isNaN(e.translate))&&(e.translate=0)}function FC(e,t,n,r){YCe(e.x,t.x,n.x,r?r.originX:void 0),YCe(e.y,t.y,n.y,r?r.originY:void 0)}function VCe(e,t,n,r=0){const s=r?Is(n.min,n.max,r):n.min;e.min=s+t.min,e.max=e.min+al(t)}function e6n(e,t,n,r){VCe(e.x,t.x,n.x,r?.x),VCe(e.y,t.y,n.y,r?.y)}function qCe(e,t,n,r=0){const s=r?Is(n.min,n.max,r):n.min;e.min=t.min-s,e.max=e.min+al(t)}function SX(e,t,n,r){qCe(e.x,t.x,n.x,r?.x),qCe(e.y,t.y,n.y,r?.y)}function WCe(e,t,n,r,s){return e-=t,e=xX(e,1/n,r),s!==void 0&&(e=xX(e,1/s,r)),e}function t6n(e,t=0,n=1,r=.5,s,i=e,o=e){if(Tf.test(t)&&(t=parseFloat(t),t=Is(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=Is(i.min,i.max,r);e===i&&(a-=t),e.min=WCe(e.min,t,n,a,s),e.max=WCe(e.max,t,n,a,s)}function GCe(e,t,[n,r,s],i,o){t6n(e,t[n],t[r],t[s],t.scale,i,o)}const n6n=["x","scaleX","originX"],r6n=["y","scaleY","originY"];function HCe(e,t,n,r){GCe(e.x,t,n6n,n?n.x:void 0,r?r.x:void 0),GCe(e.y,t,r6n,n?n.y:void 0,r?r.y:void 0)}function ZCe(e){return e.translate===0&&e.scale===1}function Drt(e){return ZCe(e.x)&&ZCe(e.y)}function KCe(e,t){return e.min===t.min&&e.max===t.max}function s6n(e,t){return KCe(e.x,t.x)&&KCe(e.y,t.y)}function JCe(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Lrt(e,t){return JCe(e.x,t.x)&&JCe(e.y,t.y)}function eRe(e){return al(e.x)/al(e.y)}function tRe(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Up(e){return[e("x"),e("y")]}function i6n(e,t,n){let r="";const s=e.x.translate/t.x,i=e.y.translate/t.y,o=n?.z||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:l,rotate:d,rotateX:p,rotateY:f,skewX:h,skewY:m}=n;l&&(r=`perspective(${l}px) ${r}`),d&&(r+=`rotate(${d}deg) `),p&&(r+=`rotateX(${p}deg) `),f&&(r+=`rotateY(${f}deg) `),h&&(r+=`skewX(${h}deg) `),m&&(r+=`skewY(${m}deg) `)}const a=e.x.scale*t.x,c=e.y.scale*t.y;return(a!==1||c!==1)&&(r+=`scale(${a}, ${c})`),r||"none"}const jrt=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],o6n=jrt.length,nRe=e=>typeof e=="string"?parseFloat(e):e,rRe=e=>typeof e=="number"||on.test(e);function a6n(e,t,n,r,s,i){s?(e.opacity=Is(0,n.opacity??1,l6n(r)),e.opacityExit=Is(t.opacity??1,0,c6n(r))):i&&(e.opacity=Is(t.opacity??1,n.opacity??1,r));for(let o=0;o<o6n;o++){const a=jrt[o];let c=sRe(t,a),l=sRe(n,a);if(c===void 0&&l===void 0)continue;c||(c=0),l||(l=0),c===0||l===0||rRe(c)===rRe(l)?(e[a]=Math.max(Is(nRe(c),nRe(l),r),0),(Tf.test(l)||Tf.test(c))&&(e[a]+="%")):e[a]=l}(t.rotate||n.rotate)&&(e.rotate=Is(t.rotate||0,n.rotate||0,r))}function sRe(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const l6n=Xrt(0,.5,vnt),c6n=Xrt(.5,.95,Yu);function Xrt(e,t,n){return r=>r<e?0:r>t?1:n(WT(e,t,r))}function Urt(e,t,n){const r=co(e)?e:u_(e);return r.start(jce("",r,t,n)),r.animation}function e$(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const u6n=(e,t)=>e.depth-t.depth;class d6n{constructor(){this.children=[],this.isDirty=!1}add(t){Ece(this.children,t),this.isDirty=!0}remove(t){qT(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(u6n),this.isDirty=!1,this.children.forEach(t)}}function p6n(e,t){const n=ol.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&($m(r),e(i-t))};return Ts.setup(r,!0),()=>$m(r)}function H2(e){return co(e)?e.get():e}class f6n{constructor(){this.members=[]}add(t){Ece(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const s=r.instance;(!s||s.isConnected===!1)&&!r.snapshot&&(qT(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(qT(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){for(let n=this.members.indexOf(t)-1;n>=0;n--){const r=this.members[n];if(r.isPresent!==!1&&r.instance?.isConnected!==!1)return this.promote(r),!0}return!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:s}=r.options,{layoutDependency:i}=t.options;(s===void 0||s!==i)&&(t.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const Z2={hasAnimatedSinceResize:!0,hasEverUpdated:!1},G8=["","X","Y","Z"],h6n=1e3;let m6n=0;function H8(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function zrt(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=irt(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Ts,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&zrt(r)}function Brt({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=t?.()){this.id=m6n++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(_6n),this.nodes.forEach(T6n),this.nodes.forEach(E6n),this.nodes.forEach(b6n)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new d6n)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new kce),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const c=this.eventHandlers.get(o);c&&c.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=PB(o)&&!mrt(o),this.instance=o;const{layoutId:a,layout:c,visualElement:l}=this.options;if(l&&!l.current&&l.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||a)&&(this.isLayoutDirty=!0),e){let d,p=0;const f=()=>this.root.updateBlockedByResize=!1;Ts.read(()=>{p=window.innerWidth}),e(o,()=>{const h=window.innerWidth;h!==p&&(p=h,this.root.updateBlockedByResize=!0,d&&d(),d=p6n(f,250),Z2.hasAnimatedSinceResize&&(Z2.hasAnimatedSinceResize=!1,this.nodes.forEach(aRe)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&l&&(a||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:p,hasRelativeLayoutChanged:f,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||l.getDefaultTransition()||P6n,{onLayoutAnimationStart:O,onLayoutAnimationComplete:_}=l.getProps(),b=!this.targetLayout||!Lrt(this.targetLayout,h),y=!p&&f;if(this.options.layoutRoot||this.resumeFrom||y||p&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const x={...Lce(m,"layout"),onPlay:O,onComplete:_};(l.shouldReduceMotion||this.options.layoutRoot)&&(x.delay=0,x.type=!1),this.startAnimation(x),this.setAnimationOrigin(d,y)}else p||aRe(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=h})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),$m(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(w6n),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&zrt(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const p=this.path[d];p.shouldResetTransform=!0,(typeof p.latestValues.x=="string"||typeof p.latestValues.y=="string")&&(p.isLayoutDirty=!0),p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;const l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const c=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),c&&this.nodes.forEach(x6n),this.nodes.forEach(iRe);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(oRe);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(S6n),this.nodes.forEach(v6n),this.nodes.forEach(O6n),this.nodes.forEach(g6n)):this.nodes.forEach(oRe),this.clearAllSnapshots();const a=ol.now();Go.delta=Af(0,1e3/60,a-Go.timestamp),Go.timestamp=a,Go.isProcessing=!0,U8.update.process(Go),U8.preRender.process(Go),U8.render.process(Go),Go.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Yce.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(y6n),this.sharedNodes.forEach(k6n)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ts.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ts.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!al(this.snapshot.measuredBox.x)&&!al(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Ai()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Drt(this.projectionDelta),c=this.getTransformTemplate(),l=c?c(this.latestValues,""):void 0,d=l!==this.prevTransformTemplateValue;o&&this.instance&&(a||b0(this.latestValues)||d)&&(s(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return o&&(c=this.removeTransform(c)),$6n(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return Ai();const a=o.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(N6n))){const{scroll:l}=this.root;l&&(qp(a.x,l.offset.x),qp(a.y,l.offset.y))}return a}removeElementScroll(o){const a=Ai();if(ud(a,o),this.scroll?.wasRoot)return a;for(let c=0;c<this.path.length;c++){const l=this.path[c],{scroll:d,options:p}=l;l!==this.root&&d&&p.layoutScroll&&(d.wasRoot&&ud(a,o),qp(a.x,d.offset.x),qp(a.y,d.offset.y))}return a}applyTransform(o,a=!1,c){const l=c||Ai();ud(l,o);for(let d=0;d<this.path.length;d++){const p=this.path[d];!a&&p.options.layoutScroll&&p.scroll&&p!==p.root&&(qp(l.x,-p.scroll.offset.x),qp(l.y,-p.scroll.offset.y)),b0(p.latestValues)&&G2(l,p.latestValues,p.layout?.layoutBox)}return b0(this.latestValues)&&G2(l,this.latestValues,this.layout?.layoutBox),l}removeTransform(o){const a=Ai();ud(a,o);for(let c=0;c<this.path.length;c++){const l=this.path[c];if(!b0(l.latestValues))continue;let d;l.instance&&(ite(l.latestValues)&&l.updateSnapshot(),d=Ai(),ud(d,l.measurePageBox())),HCe(a,l.latestValues,l.snapshot?.layoutBox,d)}return b0(this.latestValues)&&HCe(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Go.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==a;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:p}=this.options;if(!this.layout||!(d||p))return;this.resolvedRelativeTargetAt=Go.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Ai(),this.targetWithTransforms=Ai()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),e6n(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):ud(this.target,this.layout.layoutBox),vrt(this.target,this.targetDelta)):ud(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||ite(this.parent.latestValues)||Srt(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,a,c){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ai(),this.relativeTargetOrigin=Ai(),SX(this.relativeTargetOrigin,a,c,this.options.layoutAnchor||void 0),ud(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const o=this.getLead(),a=!!this.resumingFrom||this!==o;let c=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Go.timestamp&&(c=!1),c)return;const{layout:l,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(l||d))return;ud(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,f=this.treeScale.y;Rqn(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=Ai());const{target:h}=o;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(FCe(this.prevProjectionDelta.x,this.projectionDelta.x),FCe(this.prevProjectionDelta.y,this.projectionDelta.y)),FC(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==f||!tRe(this.projectionDelta.x,this.prevProjectionDelta.x)||!tRe(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",h))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){if(this.options.visualElement?.scheduleRender(),o){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=US(),this.projectionDelta=US(),this.projectionDeltaWithTransform=US()}setAnimationOrigin(o,a=!1){const c=this.snapshot,l=c?c.latestValues:{},d={...this.latestValues},p=US();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=Ai(),h=c?c.source:void 0,m=this.layout?this.layout.source:void 0,O=h!==m,_=this.getStack(),b=!_||_.members.length<=1,y=!!(O&&!b&&this.options.crossfade===!0&&!this.path.some(R6n));this.animationProgress=0;let x;this.mixTargetDelta=S=>{const v=S/1e3;lRe(p.x,o.x,v),lRe(p.y,o.y,v),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(SX(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),C6n(this.relativeTarget,this.relativeTargetOrigin,f,v),x&&s6n(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=Ai()),ud(x,this.relativeTarget)),O&&(this.animationValues=d,a6n(d,l,this.latestValues,v,y,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=v},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&($m(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ts.update(()=>{Z2.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=u_(0)),this.motionValue.jump(0,!1),this.currentAnimation=Urt(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(h6n),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:c,layout:l,latestValues:d}=o;if(!(!a||!c||!l)){if(this!==o&&this.layout&&l&&Frt(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||Ai();const p=al(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+p;const f=al(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+f}ud(a,c),G2(a,d),FC(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new f6n),this.sharedNodes.get(o).add(a);const l=a.options.initialPromotionConfig;a.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){const{layoutId:o}=this.options;return o?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:o}=this.options;return o?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:c}={}){const l=this.getStack();l&&l.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const l={};c.z&&H8("z",o,l,this.animationValues);for(let d=0;d<G8.length;d++)H8(`rotate${G8[d]}`,o,l,this.animationValues),H8(`skew${G8[d]}`,o,l,this.animationValues);o.render();for(const d in l)o.setStaticValue(d,l[d]),this.animationValues&&(this.animationValues[d]=l[d]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=H2(a?.pointerEvents)||"",o.transform=c?c(this.latestValues,""):"none";return}const l=this.getLead();if(!this.projectionDelta||!this.layout||!l.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=H2(a?.pointerEvents)||""),this.hasProjected&&!b0(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const d=l.animationValues||l.latestValues;this.applyTransformsToTarget();let p=i6n(this.projectionDeltaWithTransform,this.treeScale,d);c&&(p=c(d,p)),o.transform=p;const{x:f,y:h}=this.projectionDelta;o.transformOrigin=`${f.origin*100}% ${h.origin*100}% 0`,l.animationValues?o.opacity=l===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:o.opacity=l===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const m in ate){if(d[m]===void 0)continue;const{correct:O,applyTo:_,isCSSVariable:b}=ate[m],y=p==="none"?d[m]:O(d[m],l);if(_){const x=_.length;for(let S=0;S<x;S++)o[_[S]]=y}else b?this.options.visualElement.renderState.vars[m]=y:o[m]=y}this.options.layoutId&&(o.pointerEvents=l===this?H2(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>o.currentAnimation?.stop()),this.root.nodes.forEach(iRe),this.root.sharedNodes.clear()}}}function O6n(e){e.updateLayout()}function g6n(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=e.layout,{animationType:s}=e.options,i=t.source!==e.layout.source;if(s==="size")Up(d=>{const p=i?t.measuredBox[d]:t.layoutBox[d],f=al(p);p.min=n[d].min,p.max=p.min+f});else if(s==="x"||s==="y"){const d=s==="x"?"y":"x";lte(i?t.measuredBox[d]:t.layoutBox[d],n[d])}else Frt(s,t.layoutBox,n)&&Up(d=>{const p=i?t.measuredBox[d]:t.layoutBox[d],f=al(n[d]);p.max=p.min+f,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+f)});const o=US();FC(o,n,t.layoutBox);const a=US();i?FC(a,e.applyTransform(r,!0),t.measuredBox):FC(a,n,t.layoutBox);const c=!Drt(o);let l=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:p,layout:f}=d;if(p&&f){const h=e.options.layoutAnchor||void 0,m=Ai();SX(m,t.layoutBox,p.layoutBox,h);const O=Ai();SX(O,n,f.layoutBox,h),Lrt(m,O)||(l=!0),d.options.layoutRoot&&(e.relativeTarget=O,e.relativeTargetOrigin=m,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:a,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function _6n(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function b6n(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function y6n(e){e.clearSnapshot()}function iRe(e){e.clearMeasurements()}function x6n(e){e.isLayoutDirty=!0,e.updateLayout()}function oRe(e){e.isLayoutDirty=!1}function S6n(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function v6n(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function aRe(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function T6n(e){e.resolveTargetDelta()}function E6n(e){e.calcProjection()}function w6n(e){e.resetSkewAndRotation()}function k6n(e){e.removeLeadSnapshot()}function lRe(e,t,n){e.translate=Is(t.translate,0,n),e.scale=Is(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function cRe(e,t,n,r){e.min=Is(t.min,n.min,r),e.max=Is(t.max,n.max,r)}function C6n(e,t,n,r){cRe(e.x,t.x,n.x,r),cRe(e.y,t.y,n.y,r)}function R6n(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const P6n={duration:.45,ease:[.4,0,.1,1]},uRe=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),dRe=uRe("applewebkit/")&&!uRe("chrome/")?Math.round:Yu;function pRe(e){e.min=dRe(e.min),e.max=dRe(e.max)}function $6n(e){pRe(e.x),pRe(e.y)}function Frt(e,t,n){return e==="position"||e==="preserve-aspect"&&!Jqn(eRe(t),eRe(n),.2)}function N6n(e){return e!==e.root&&e.scroll?.wasRoot}const A6n=Brt({attachResizeListener:(e,t)=>e$(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Z8={current:void 0},Yrt=Brt({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Z8.current){const e=new A6n({});e.mount(window),e.setOptions({layoutScroll:!0}),Z8.current=e}return Z8.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Kce=g.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function I6n(e=!0){const t=g.useContext(Tce);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=g.useId();g.useEffect(()=>{if(e)return s(i)},[e]);const o=g.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,o]:[!0]}const Vrt=g.createContext({strict:!1}),fRe={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let hRe=!1;function M6n(){if(hRe)return;const e={};for(const t in fRe)e[t]={isEnabled:n=>fRe[t].some(r=>!!n[r])};_rt(e),hRe=!0}function qrt(){return M6n(),wqn()}function Q6n(e){const t=qrt();for(const n in e)t[n]={...t[n],...e[n]};_rt(t)}const D6n=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function vX(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||D6n.has(e)}let Wrt=e=>!vX(e);function L6n(e){typeof e=="function"&&(Wrt=t=>t.startsWith("on")?!vX(t):e(t))}try{L6n(require("@emotion/is-prop-valid").default)}catch{}function j6n(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||co(e[s])||(Wrt(s)||n===!0&&vX(s)||!t&&!vX(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const AB=g.createContext({});function X6n(e,t){if(NB(e)){const{initial:n,animate:r}=e;return{initial:n===!1||JP(n)?n:void 0,animate:JP(r)?r:void 0}}return e.inherit!==!1?t:{}}function U6n(e){const{initial:t,animate:n}=X6n(e,g.useContext(AB));return g.useMemo(()=>({initial:t,animate:n}),[mRe(t),mRe(n)])}function mRe(e){return Array.isArray(e)?e.join(" "):e}const Jce=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Grt(e,t,n){for(const r in t)!co(t[r])&&!wrt(r,n)&&(e[r]=t[r])}function z6n({transformTemplate:e},t){return g.useMemo(()=>{const n=Jce();return Hce(n,t,e),Object.assign({},n.vars,n.style)},[t])}function B6n(e,t){const n=e.style||{},r={};return Grt(r,n,e),Object.assign(r,z6n(e,t)),r}function F6n(e,t){const n={},r=B6n(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const Hrt=()=>({...Jce(),attrs:{}});function Y6n(e,t,n,r){const s=g.useMemo(()=>{const i=Hrt();return Crt(i,t,Prt(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};Grt(i,e.style,e),s.style={...i,...s.style}}return s}const V6n=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function eue(e){return typeof e!="string"||e.includes("-")?!1:!!(V6n.indexOf(e)>-1||/[A-Z]/u.test(e))}function q6n(e,t,n,{latestValues:r},s,i=!1,o){const c=(o??eue(e)?Y6n:F6n)(t,r,s,e),l=j6n(t,typeof e=="string",i),d=e!==g.Fragment?{...l,...c,ref:n}:{},{children:p}=t,f=g.useMemo(()=>co(p)?p.get():p,[p]);return g.createElement(e,{...d,children:f})}function W6n({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:G6n(n,r,s,e),renderState:t()}}function G6n(e,t,n,r){const s={},i=r(e,{});for(const f in i)s[f]=H2(i[f]);let{initial:o,animate:a}=e;const c=NB(e),l=Ort(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const p=d?a:o;if(p&&typeof p!="boolean"&&!$B(p)){const f=Array.isArray(p)?p:[p];for(let h=0;h<f.length;h++){const m=Xce(e,f[h]);if(m){const{transitionEnd:O,transition:_,...b}=m;for(const y in b){let x=b[y];if(Array.isArray(x)){const S=d?x.length-1:0;x=x[S]}x!==null&&(s[y]=x)}for(const y in O)s[y]=O[y]}}}return s}const Zrt=e=>(t,n)=>{const r=g.useContext(AB),s=g.useContext(Tce),i=()=>W6n(e,t,r,s);return n?i():vce(i)},H6n=Zrt({scrapeMotionValuesFromProps:Zce,createRenderState:Jce}),Z6n=Zrt({scrapeMotionValuesFromProps:$rt,createRenderState:Hrt}),K6n=Symbol.for("motionComponentSymbol");function J6n(e,t,n){const r=g.useRef(n);g.useInsertionEffect(()=>{r.current=n});const s=g.useRef(null);return g.useCallback(i=>{i&&e.onMount?.(i);const o=r.current;if(typeof o=="function")if(i){const a=o(i);typeof a=="function"&&(s.current=a)}else s.current?(s.current(),s.current=null):o(i);else o&&(o.current=i);t&&(i?t.mount(i):t.unmount())},[t])}const Krt=g.createContext({});function cS(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function eWn(e,t,n,r,s,i){const{visualElement:o}=g.useContext(AB),a=g.useContext(Vrt),c=g.useContext(Tce),l=g.useContext(Kce),d=l.reducedMotion,p=l.skipAnimations,f=g.useRef(null),h=g.useRef(!1);r=r||a.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:d,skipAnimations:p,isSVG:i}),h.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const m=f.current,O=g.useContext(Krt);m&&!m.projection&&s&&(m.type==="html"||m.type==="svg")&&tWn(f.current,n,s,O);const _=g.useRef(!1);g.useInsertionEffect(()=>{m&&_.current&&m.update(n,c)});const b=n[srt],y=g.useRef(!!b&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(b)&&window.MotionHasOptimisedAnimation?.(b));return dnt(()=>{h.current=!0,m&&(_.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),y.current&&m.animationState&&m.animationState.animateChanges())}),g.useEffect(()=>{m&&(!y.current&&m.animationState&&m.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(b)}),y.current=!1),m.enteringChildren=void 0)}),m}function tWn(e,t,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:a,layoutScroll:c,layoutRoot:l,layoutAnchor:d,layoutCrossfade:p}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Jrt(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||a&&cS(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:p,layoutScroll:c,layoutRoot:l,layoutAnchor:d})}function Jrt(e){if(e)return e.options.allowProjection!==!1?e.projection:Jrt(e.parent)}function K8(e,{forwardMotionProps:t=!1,type:n}={},r,s){r&&Q6n(r);const i=n?n==="svg":eue(e),o=i?Z6n:H6n;function a(l,d){let p;const f={...g.useContext(Kce),...l,layoutId:nWn(l)},{isStatic:h}=f,m=U6n(l),O=o(l,h);if(!h&&typeof window<"u"){rWn();const _=sWn(f);p=_.MeasureLayout,m.visualElement=eWn(e,O,f,s,_.ProjectionNode,i)}return u.jsxs(AB.Provider,{value:m,children:[p&&m.visualElement?u.jsx(p,{visualElement:m.visualElement,...f}):null,q6n(e,l,J6n(O,m.visualElement,d),O,h,t,i)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const c=g.forwardRef(a);return c[K6n]=e,c}function nWn({layoutId:e}){const t=g.useContext(unt).id;return t&&e!==void 0?t+"-"+e:e}function rWn(e,t){g.useContext(Vrt).strict}function sWn(e){const t=qrt(),{drag:n,layout:r}=t;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n?.isEnabled(e)||r?.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function iWn(e,t){if(typeof Proxy>"u")return K8;const n=new Map,r=(i,o)=>K8(i,o,e,t),s=(i,o)=>r(i,o);return new Proxy(s,{get:(i,o)=>o==="create"?r:(n.has(o)||n.set(o,K8(o,void 0,e,t)),n.get(o))})}const oWn=(e,t)=>t.isSVG??eue(e)?new Nrt(t):new krt(t,{allowProjection:e!==g.Fragment});class aWn extends I_{constructor(t){super(t),t.animationState||(t.animationState=qqn(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();$B(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let lWn=0;class cWn extends I_{constructor(){super(...arguments),this.id=lWn++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&r===!1){if(this.isExitComplete){const{initial:i,custom:o}=this.node.getProps();if(typeof i=="string"){const a=Eb(this.node,i,o);if(a){const{transition:c,transitionEnd:l,...d}=a;for(const p in d)this.node.getValue(p)?.jump(d[p])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const uWn={animation:{Feature:aWn},exit:{Feature:cWn}};function ZN(e){return{point:{x:e.pageX,y:e.pageY}}}const dWn=e=>t=>Vce(t)&&e(t,ZN(t));function YC(e,t,n,r){return e$(e,t,dWn(n),r)}const est=({current:e})=>e?e.ownerDocument.defaultView:null,ORe=(e,t)=>Math.abs(e-t);function pWn(e,t){const n=ORe(e.x,t.x),r=ORe(e.y,t.y);return Math.sqrt(n**2+r**2)}const gRe=new Set(["auto","scroll"]);class tst{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:o=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=h=>{this.handleScroll(h.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=BM(this.lastRawMoveEventInfo,this.transformPagePoint));const h=J8(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,O=pWn(h.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!O)return;const{point:_}=h,{timestamp:b}=Go;this.history.push({..._,timestamp:b});const{onStart:y,onMove:x}=this.handlers;m||(y&&y(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,h)},this.handlePointerMove=(h,m)=>{this.lastMoveEvent=h,this.lastRawMoveEventInfo=m,this.lastMoveEventInfo=BM(m,this.transformPagePoint),Ts.update(this.updatePoint,!0)},this.handlePointerUp=(h,m)=>{this.end();const{onEnd:O,onSessionEnd:_,resumeAnimation:b}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=J8(h.type==="pointercancel"?this.lastMoveEventInfo:BM(m,this.transformPagePoint),this.history);this.startEvent&&O&&O(h,y),_&&_(h,y)},!Vce(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const c=ZN(t),l=BM(c,this.transformPagePoint),{point:d}=l,{timestamp:p}=Go;this.history=[{...d,timestamp:p}];const{onSessionStart:f}=n;f&&f(t,J8(l,this.history)),this.removeListeners=WN(YC(this.contextWindow,"pointermove",this.handlePointerMove),YC(this.contextWindow,"pointerup",this.handlePointerUp),YC(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(gRe.has(r.overflowX)||gRe.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,s=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},i={x:s.x-n.x,y:s.y-n.y};i.x===0&&i.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(t,s),Ts.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),$m(this.updatePoint)}}function BM(e,t){return t?{point:t(e.point)}:e}function _Re(e,t){return{x:e.x-t.x,y:e.y-t.y}}function J8({point:e},t){return{point:e,delta:_Re(e,nst(t)),offset:_Re(e,fWn(t)),velocity:hWn(t,.1)}}function fWn(e){return e[0]}function nst(e){return e[e.length-1]}function hWn(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=nst(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>ec(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&s.timestamp-r.timestamp>ec(t)*2&&(r=e[1]);const i=Iu(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function mWn(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Is(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Is(n,e,r.max):Math.min(e,n)),e}function bRe(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function OWn(e,{top:t,left:n,bottom:r,right:s}){return{x:bRe(e.x,n,s),y:bRe(e.y,t,r)}}function yRe(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function gWn(e,t){return{x:yRe(e.x,t.x),y:yRe(e.y,t.y)}}function _Wn(e,t){let n=.5;const r=al(e),s=al(t);return s>r?n=WT(t.min,t.max-r,e.min):r>s&&(n=WT(e.min,e.max-s,t.min)),Af(0,1,n)}function bWn(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const cte=.35;function yWn(e=cte){return e===!1?e=0:e===!0&&(e=cte),{x:xRe(e,"left","right"),y:xRe(e,"top","bottom")}}function xRe(e,t,n){return{min:SRe(e,t),max:SRe(e,n)}}function SRe(e,t){return typeof e=="number"?e:e[t]||0}const xWn=new WeakMap;class SWn{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ai(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=p=>{n&&this.snapToCursor(ZN(p).point),this.stopAnimation()},o=(p,f)=>{const{drag:h,dragPropagation:m,onDragStart:O}=this.getProps();if(h&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=iqn(h),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Up(b=>{let y=this.getAxisMotionValue(b).get()||0;if(Tf.test(y)){const{projection:x}=this.visualElement;if(x&&x.layout){const S=x.layout.layoutBox[b];S&&(y=al(S)*(parseFloat(y)/100))}}this.originPoint[b]=y}),O&&Ts.update(()=>O(p,f),!1,!0),tte(this.visualElement,"transform");const{animationState:_}=this.visualElement;_&&_.setActive("whileDrag",!0)},a=(p,f)=>{this.latestPointerEvent=p,this.latestPanInfo=f;const{dragPropagation:h,dragDirectionLock:m,onDirectionLock:O,onDrag:_}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:b}=f;if(m&&this.currentDirection===null){this.currentDirection=TWn(b),this.currentDirection!==null&&O&&O(this.currentDirection);return}this.updateAxis("x",f.point,b),this.updateAxis("y",f.point,b),this.visualElement.render(),_&&Ts.update(()=>_(p,f),!1,!0)},c=(p,f)=>{this.latestPointerEvent=p,this.latestPanInfo=f,this.stop(p,f),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>{const{dragSnapToOrigin:p}=this.getProps();(p||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:d}=this.getProps();this.panSession=new tst(t,{onSessionStart:i,onStart:o,onMove:a,onSessionEnd:c,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:est(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,s=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!s||!r)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&Ts.postRender(()=>a(r,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!FM(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=mWn(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,s=this.constraints;t&&cS(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=OWn(r.layoutBox,t):this.constraints=!1,this.elastic=yWn(n),s!==this.constraints&&!cS(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&Up(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=bWn(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!cS(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=Pqn(r,s.root,this.visualElement.getTransformPagePoint());let o=gWn(s.layout.layoutBox,i);if(n){const a=n(kqn(o));this.hasMutatedConstraints=!!a,a&&(o=xrt(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=Up(d=>{if(!FM(d,n,this.currentDirection))return;let p=c&&c[d]||{};(o===!0||o===d)&&(p={min:0,max:0});const f=s?200:1e6,h=s?40:1e7,m={type:"inertia",velocity:r?t[d]:0,bounceStiffness:f,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...i,...p};return this.startAxisValueAnimation(d,m)});return Promise.all(l).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return tte(this.visualElement,t),r.start(jce(t,r,0,n,this.visualElement,!1))}stopAnimation(){Up(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Up(n=>{const{drag:r}=this.getProps();if(!FM(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n],c=i.get()||0;i.set(t[n]-Is(o,a,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!cS(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Up(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const c=a.get();s[o]=_Wn({min:c,max:c},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),Up(o=>{if(!FM(o,t,null))return;const a=this.getAxisMotionValue(o),{min:c,max:l}=this.constraints[o];a.set(Is(c,l,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;xWn.set(this.visualElement,this);const t=this.visualElement.current,n=YC(t,"pointerdown",l=>{const{drag:d,dragListener:p=!0}=this.getProps(),f=l.target,h=f!==t&&dqn(f);d&&p&&!h&&this.start(l)});let r;const s=()=>{const{dragConstraints:l}=this.getProps();cS(l)&&l.current&&(this.constraints=this.resolveRefConstraints(),r||(r=vWn(t,l.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Ts.read(s);const a=e$(window,"resize",()=>this.scalePositionWithinConstraints()),c=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:d})=>{this.isDragging&&d&&(Up(p=>{const f=this.getAxisMotionValue(p);f&&(this.originPoint[p]+=l[p].translate,f.set(f.get()+l[p].translate))}),this.visualElement.render())});return()=>{a(),n(),o(),c&&c(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=cte,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function vRe(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function vWn(e,t,n){const r=NCe(e,vRe(n)),s=NCe(t,vRe(n));return()=>{r(),s()}}function FM(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function TWn(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class EWn extends I_{constructor(t){super(t),this.removeGroupControls=Yu,this.removeListeners=Yu,this.controls=new SWn(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Yu}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const e9=e=>(t,n)=>{e&&Ts.update(()=>e(t,n),!1,!0)};class wWn extends I_{constructor(){super(...arguments),this.removePointerDownListener=Yu}onPointerDown(t){this.session=new tst(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:est(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:e9(t),onStart:e9(n),onMove:e9(r),onEnd:(i,o)=>{delete this.session,s&&Ts.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=YC(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let t9=!1;class kWn extends g.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),t9&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Z2.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:o}=r;return o&&(o.isPresent=i,t.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),t9=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==i?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||Ts.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:r}=t;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),Yce.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;t9=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function rst(e){const[t,n]=I6n(),r=g.useContext(unt);return u.jsx(kWn,{...e,layoutGroup:r,switchLayoutGroup:g.useContext(Krt),isPresent:t,safeToRemove:n})}const CWn={pan:{Feature:wWn},drag:{Feature:EWn,ProjectionNode:Yrt,MeasureLayout:rst}};function TRe(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&Ts.postRender(()=>i(t,ZN(t)))}class RWn extends I_{mount(){const{current:t}=this.node;t&&(this.unmount=aqn(t,(n,r)=>(TRe(this.node,r,"Start"),s=>TRe(this.node,s,"End"))))}unmount(){}}class PWn extends I_{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=WN(e$(this.node.current,"focus",()=>this.onFocus()),e$(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function ERe(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&Ts.postRender(()=>i(t,ZN(t)))}class $Wn extends I_{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=fqn(t,(s,i)=>(ERe(this.node,i,"Start"),(o,{success:a})=>ERe(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:r?.tap===!1})}unmount(){}}const ute=new WeakMap,n9=new WeakMap,NWn=e=>{const t=ute.get(e.target);t&&t(e)},AWn=e=>{e.forEach(NWn)};function IWn({root:e,...t}){const n=e||document;n9.has(n)||n9.set(n,{});const r=n9.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(AWn,{root:e,...t})),r[s]}function MWn(e,t,n){const r=IWn(t);return ute.set(e,n),r.observe(e),()=>{ute.delete(e),r.unobserve(e)}}const QWn={some:0,all:1};class DWn extends I_{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:QWn[s]},a=c=>{const{isIntersecting:l}=c;if(this.isInView===l||(this.isInView=l,i&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:d,onViewportLeave:p}=this.node.getProps(),f=l?d:p;f&&f(c)};this.stopObserver=MWn(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(LWn(t,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function LWn({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const jWn={inView:{Feature:DWn},tap:{Feature:$Wn},focus:{Feature:PWn},hover:{Feature:RWn}},XWn={layout:{ProjectionNode:Yrt,MeasureLayout:rst}},UWn={...uWn,...jWn,...CWn,...XWn},Nm=iWn(UWn,oWn);function dte(e){const t=vce(()=>u_(e)),{isStatic:n}=g.useContext(Kce);if(n){const[,r]=g.useState(e);g.useEffect(()=>t.on("change",r),[])}return t}function sst(e,t){const n=dte(t()),r=()=>n.set(t());return r(),dnt(()=>{const s=()=>Ts.preRender(r,!1,!0),i=e.map(o=>o.on("change",s));return()=>{i.forEach(o=>o()),$m(r)}}),n}function zWn(e){BC.current=[],e();const t=sst(BC.current,e);return BC.current=void 0,t}function zS(e,t,n,r){if(typeof e=="function")return zWn(e);const i=typeof t=="function"?t:W2(t,n,r),o=Array.isArray(e)?wRe(e,i):wRe([e],([c])=>i(c)),a=Array.isArray(e)?void 0:e.accelerate;return a&&!a.isTransformed&&typeof t!="function"&&Array.isArray(n)&&r?.clamp!==!1&&(o.accelerate={...a,times:t,keyframes:n,isTransformed:!0}),o}function wRe(e,t){const n=vce(()=>[]);return sst(e,()=>{n.length=0;const r=e.length;for(let s=0;s<r;s++)n[s]=e[s].get();return t(n)})}function BWn(){!Gce.current&&grt();const[e]=g.useState(bX.current);return e}function tue(e){return typeof e=="object"&&!Array.isArray(e)}function ist(e,t,n,r){return e==null?[]:typeof e=="string"&&tue(t)?Fce(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(s=>s!=null):[e]}function FWn(e,t,n){return e*(t+1)}function kRe(e,t,n,r){return typeof t=="number"?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,e+parseFloat(t)):t==="<"?n:t.startsWith("<")?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function YWn(e,t,n){for(let r=0;r<e.length;r++){const s=e[r];s.at>t&&s.at<n&&(qT(e,s),r--)}}function VWn(e,t,n,r,s,i){YWn(e,s,i);for(let o=0;o<t.length;o++)e.push({value:t[o],at:Is(s,i,r[o]),easing:knt(n,o)})}function qWn(e,t){for(let n=0;n<e.length;n++)e[n]=e[n]/(t+1)}function WWn(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}const GWn="easeInOut";function HWn(e,{defaultTransition:t={},...n}={},r,s){const i=t.duration||.3,o=new Map,a=new Map,c={},l=new Map;let d=0,p=0,f=0;for(let h=0;h<e.length;h++){const m=e[h];if(typeof m=="string"){l.set(m,p);continue}else if(!Array.isArray(m)){l.set(m.name,kRe(p,m.at,d,l));continue}let[O,_,b={}]=m;b.at!==void 0&&(p=kRe(p,b.at,d,l));let y=0;const x=(S,v,T,E=0,w=0)=>{const P=ZWn(S),{delay:k=0,times:C=Bnt(P),type:M=t.type||"keyframes",repeat:I,repeatType:$,repeatDelay:R=0,...N}=v;let{ease:j=t.ease||"easeOut",duration:Q}=v;const U=typeof k=="function"?k(E,w):k,A=P.length,V=Dce(M)?M:s?.[M||"keyframes"];if(A<=2&&V){let Y=100;if(A===2&&eGn(P)){const G=P[1]-P[0];Y=Math.abs(G)}const ne={...t,...N};Q!==void 0&&(ne.duration=ec(Q));const te=jnt(ne,Y,V);j=te.ease,Q=te.duration}Q??(Q=i);const z=p+U;C.length===1&&C[0]===0&&(C[1]=1);const L=C.length-P.length;if(L>0&&znt(C,L),P.length===1&&P.unshift(null),I){Q=FWn(Q,I);const Y=[...P],ne=[...C];j=Array.isArray(j)?[...j]:[j];const te=[...j];for(let G=0;G<I;G++){P.push(...Y);for(let Z=0;Z<Y.length;Z++)C.push(ne[Z]+(G+1)),j.push(Z===0?"linear":knt(te,Z-1))}qWn(C,I)}const q=z+Q;VWn(T,P,j,C,z,q),y=Math.max(U+Q,y),f=Math.max(q,f)};if(co(O)){const S=CRe(O,a);x(_,b,RRe("default",S))}else{const S=ist(O,_,r,c),v=S.length;for(let T=0;T<v;T++){_=_,b=b;const E=S[T],w=CRe(E,a);for(const P in _)x(_[P],KWn(b,P),RRe(P,w),T,v)}}d=p,p+=y}return a.forEach((h,m)=>{for(const O in h){const _=h[O];_.sort(WWn);const b=[],y=[],x=[];for(let E=0;E<_.length;E++){const{at:w,value:P,easing:k}=_[E];b.push(P),y.push(WT(0,f,w)),x.push(k||"easeOut")}y[0]!==0&&(y.unshift(0),b.unshift(b[0]),x.unshift(GWn)),y[y.length-1]!==1&&(y.push(1),b.push(null)),o.has(m)||o.set(m,{keyframes:{},transition:{}});const S=o.get(m);S.keyframes[O]=b;const{type:v,...T}=t;S.transition[O]={...T,duration:f,ease:x,times:y,...n}}}),o}function CRe(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function RRe(e,t){return t[e]||(t[e]=[]),t[e]}function ZWn(e){return Array.isArray(e)?e:[e]}function KWn(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}const JWn=e=>typeof e=="number",eGn=e=>e.every(JWn);function tGn(e){const t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=PB(e)&&!mrt(e)?new Nrt(t):new krt(t);n.mount(e),KP.set(e,n)}function nGn(e){const t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new Dqn(t);n.mount(e),KP.set(e,n)}function rGn(e,t){return co(e)||typeof e=="number"||typeof e=="string"&&!tue(t)}function ost(e,t,n,r){const s=[];if(rGn(e,t))s.push(Urt(e,tue(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return s;const i=ist(e,t,r),o=i.length;for(let a=0;a<o;a++){const c=i[a],l=c instanceof Element?tGn:nGn;KP.has(c)||l(c);const d=KP.get(c),p={...n};"delay"in p&&typeof p.delay=="function"&&(p.delay=p.delay(a,o)),s.push(...zce(d,{...t,transition:p},{}))}}return s}function sGn(e,t,n){const r=[],s=e.map(o=>{if(Array.isArray(o)&&typeof o[0]=="function"){const a=o[0],c=u_(0);return c.on("change",a),o.length===1?[c,[0,1]]:o.length===2?[c,[0,1],o[1]]:[c,o[1],o[2]]}return o});return HWn(s,t,n,{spring:ZP}).forEach(({keyframes:o,transition:a},c)=>{r.push(...ost(c,o,a))}),r}function iGn(e){return Array.isArray(e)&&e.some(Array.isArray)}function oGn(e={}){const{scope:t,reduceMotion:n}=e;function r(s,i,o){let a=[],c;if(iGn(s)){const{onComplete:d,...p}=i||{};typeof d=="function"&&(c=d),a=sGn(s,n!==void 0?{reduceMotion:n,...p}:p,t)}else{const{onComplete:d,...p}=o||{};typeof d=="function"&&(c=d),a=ost(s,i,n!==void 0?{reduceMotion:n,...p}:p,t)}const l=new kVn(a);return c&&l.finished.then(c),t&&(t.animations.push(l),l.finished.then(()=>{qT(t.animations,l)})),l}return r}const Rw=oGn();function PRe(e,t){let n;return(...r)=>{window.clearTimeout(n),n=window.setTimeout(()=>e(...r),t)}}function aGn({debounce:e,scroll:t,polyfill:n,offsetSize:r}={debounce:0,scroll:!1,offsetSize:!1}){const s=n||(typeof window>"u"?class{}:window.ResizeObserver);if(!s)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[i,o]=g.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),a=g.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:i,orientationHandler:null}),c=e?typeof e=="number"?e:e.scroll:null,l=e?typeof e=="number"?e:e.resize:null,d=g.useRef(!1);g.useEffect(()=>(d.current=!0,()=>void(d.current=!1)));const[p,f,h]=g.useMemo(()=>{const b=()=>{if(!a.current.element)return;const{left:y,top:x,width:S,height:v,bottom:T,right:E,x:w,y:P}=a.current.element.getBoundingClientRect(),k={left:y,top:x,width:S,height:v,bottom:T,right:E,x:w,y:P};a.current.element instanceof HTMLElement&&r&&(k.height=a.current.element.offsetHeight,k.width=a.current.element.offsetWidth),Object.freeze(k),d.current&&!dGn(a.current.lastBounds,k)&&o(a.current.lastBounds=k)};return[b,l?PRe(b,l):b,c?PRe(b,c):b]},[o,r,c,l]);function m(){a.current.scrollContainers&&(a.current.scrollContainers.forEach(b=>b.removeEventListener("scroll",h,!0)),a.current.scrollContainers=null),a.current.resizeObserver&&(a.current.resizeObserver.disconnect(),a.current.resizeObserver=null),a.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",a.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",a.current.orientationHandler))}function O(){a.current.element&&(a.current.resizeObserver=new s(h),a.current.resizeObserver.observe(a.current.element),t&&a.current.scrollContainers&&a.current.scrollContainers.forEach(b=>b.addEventListener("scroll",h,{capture:!0,passive:!0})),a.current.orientationHandler=()=>{h()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",a.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",a.current.orientationHandler))}const _=b=>{!b||b===a.current.element||(m(),a.current.element=b,a.current.scrollContainers=ast(b),O())};return cGn(h,!!t),lGn(f),g.useEffect(()=>{m(),O()},[t,h,f]),g.useEffect(()=>m,[]),[_,i,p]}function lGn(e){g.useEffect(()=>{const t=e;return window.addEventListener("resize",t),()=>void window.removeEventListener("resize",t)},[e])}function cGn(e,t){g.useEffect(()=>{if(t){const n=e;return window.addEventListener("scroll",n,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",n,!0)}},[e,t])}function ast(e){const t=[];if(!e||e===document.body)return t;const{overflow:n,overflowX:r,overflowY:s}=window.getComputedStyle(e);return[n,r,s].some(i=>i==="auto"||i==="scroll")&&t.push(e),[...t,...ast(e.parentElement)]}const uGn=["x","y","top","bottom","left","right","width","height"],dGn=(e,t)=>uGn.every(n=>e[n]===t[n]);var lst=g.createContext(void 0),cst=g.createContext(void 0);function KN(){const e=g.useContext(lst);if(!e)throw new Error("Sheet context error");return e}function pGn(){const e=g.useContext(cst);if(!e)throw new Error("Sheet context error");return e}var $Re="calc(100% - env(safe-area-inset-top) - 34px)",t$=typeof window>"u",fGn={ease:"easeOut",duration:.2},hGn={ease:"linear",duration:.01},mGn=.6,OGn=1200,nue=t$?g.useEffect:g.useLayoutEffect;function gGn(){const[e,t]=g.useState(()=>({windowHeight:t$?0:window.innerHeight,windowWidth:t$?0:window.innerWidth}));return nue(()=>{function n(){t({windowHeight:window.innerHeight,windowWidth:window.innerWidth})}return n(),window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n)}},[]),e}function Am(e,t){return t?e.base:{...e.base,...e.decorative}}function _Gn(e){for(let t=0;t<e.length;t++)if(e[t+1]<e[t])return!1;return!0}function TX(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n&&(n.current=t)})}}function rue(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)==null?void 0:t.platform)||window.navigator.platform):!1}function IB(e){let t=null;return()=>(t==null&&(t=e()),t)}var bGn=IB(function(){return rue(/^Mac/i)}),yGn=IB(function(){return rue(/^iPhone/i)}),xGn=IB(function(){return rue(/^iPad/i)||bGn()&&navigator.maxTouchPoints>1}),SGn=IB(function(){return yGn()||xGn()});function vGn(e,t=50,n=20){return new Promise(r=>{let s=0;const i=setInterval(()=>{const o=document.getElementsByClassName(e)[0];s++,(o||s>=n)&&(clearInterval(i),r(o))},t)})}var TGn=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Oy(e){return e instanceof HTMLInputElement&&!TGn.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function ust(){return typeof window<"u"&&window.isSecureContext}function dst(e,t,n){return Math.min(Math.max(e,t),n)}function Ro(e){const t=g.useRef(void 0);return nue(()=>{t.current=e}),g.useCallback((...n)=>{const r=t.current;return r?.(...n)},[])}var Pw=0,r9=null;function EGn(e={}){const{containerRef:t,isEnabled:n=!0,debounceDelay:r=100,visualViewportThreshold:s=100}=e,[i,o]=g.useState({isVisible:!1,height:0}),a=g.useRef(null),c=g.useRef(null);return g.useEffect(()=>{const l=window.visualViewport,d=wGn();function p(b){const y=t?.current||document.documentElement;d?y.style.setProperty("--keyboard-inset-height",`env(keyboard-inset-height, ${b}px)`):y.style.setProperty("--keyboard-inset-height",`${b}px`)}function f(b){o(y=>y.isVisible===b.isVisible&&y.height===b.height?y:b)}function h(){a.current=null,p(0),f({isVisible:!1,height:0})}if(!n){h();return}function m(){c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{const b=s9()??a.current;if(!(b?Oy(b):!1)){h();return}if(a.current=b,d?.overlaysContent){const x=d.boundingRect.height;p(x),f({isVisible:!0,height:x});return}if(l){const x=window.innerHeight-l.height;if(x>s){p(x),f({isVisible:!0,height:x});return}}h()},r)}function O(b){b.target instanceof HTMLElement&&Oy(b.target)&&(a.current=b.target,m())}function _(){requestAnimationFrame(()=>{a.current=s9(),m()})}return document.addEventListener("focusin",O),document.addEventListener("focusout",_),l&&(l.addEventListener("resize",m),l.addEventListener("scroll",m)),d&&(Pw===0&&(r9=d.overlaysContent,d.overlaysContent=!0),Pw++,d.addEventListener("geometrychange",m)),a.current=s9(),m(),()=>{document.removeEventListener("focusin",O),document.removeEventListener("focusout",_),l&&(l.removeEventListener("resize",m),l.removeEventListener("scroll",m)),d&&(d.removeEventListener("geometrychange",m),Pw=Math.max(0,Pw-1),Pw===0&&(d.overlaysContent=r9??!1,r9=null)),c.current&&clearTimeout(c.current),h()}},[r,n,s]),{keyboardHeight:i.height,isKeyboardOpen:i.isVisible}}function wGn(){return ust()&&"virtualKeyboard"in navigator?navigator.virtualKeyboard:null}function s9(){var e;let t=document.activeElement;for(;t instanceof HTMLElement&&((e=t.shadowRoot)!=null&&e.activeElement);)t=t.shadowRoot.activeElement;return t&&Oy(t)?t:null}function kGn({isEnabled:e,containerRef:t,onWillOpenKeyboard:n,onDidOpenKeyboard:r}){const[s,i]=g.useState(null),o=EGn({isEnabled:e,containerRef:t}),a=Ro(async l=>{var d;const p=l.target;Oy(p)&&((d=t.current)!=null&&d.contains(p))&&(await n?.(l),i(p))}),c=Ro(l=>{const d=l.target;s===d&&i(null)});return g.useEffect(()=>{if(e)return document.addEventListener("focusin",a),document.addEventListener("focusout",c),()=>{document.removeEventListener("focusin",a),document.removeEventListener("focusout",c)}},[e]),g.useEffect(()=>{const l=t.current;!e||!s||!l||!o.isKeyboardOpen||requestAnimationFrame(()=>{r?.(s)})},[e,o.isKeyboardOpen,s]),o}function CGn(){const[e]=g.useState(()=>{const t={top:0,left:0,right:0,bottom:0};if(t$)return t;const n=document.querySelector(":root");if(!n)return t;n.style.setProperty("--rms-sat","env(safe-area-inset-top)"),n.style.setProperty("--rms-sal","env(safe-area-inset-left)"),n.style.setProperty("--rms-sar","env(safe-area-inset-right)"),n.style.setProperty("--rms-sab","env(safe-area-inset-bottom)");const r=getComputedStyle(n),s=YM(r,"--rms-sat"),i=YM(r,"--rms-sal"),o=YM(r,"--rms-sar"),a=YM(r,"--rms-sab");return n.style.removeProperty("--rms-sat"),n.style.removeProperty("--rms-sal"),n.style.removeProperty("--rms-sar"),n.style.removeProperty("--rms-sab"),{top:s,left:i,right:o,bottom:a}});return e}function YM(e,t){const n=e.getPropertyValue(t).replace("px","").trim();return parseInt(n,10)||0}function RGn({y:e,detent:t,rootId:n,sheetHeight:r,snapPoints:s,startThreshold:i}){const o=CGn().top;let a=n;a&&t==="full"&&(console.warn('Using "full" detent with modal effect is not supported.'),a=void 0);const c=Ro(d=>{if(!a)return;let p=Math.max(0,1-d/r);const f=s.length>1?s[s.length-2]:void 0;if(f!==void 0){const m=f.snapValueY;d<=m?p=(m-d)/m:p=0}if(i!==void 0){const m=r-Math.min(Math.floor(i*r),r);d<=m?p=(m-d)/m:p=0}p=Math.max(0,Math.min(1,p));const h=window.innerWidth;$Gn(a,{scale:W2(p,[0,1],[1,(h-16)/h]),translateY:W2(p,[0,1],[0,24+o]),borderRadius:W2(p,[0,1],[0,10])})}),l=Ro(()=>{a&&e.get()+5>=r&&NRe(a)});g.useEffect(()=>{if(!a)return;const d=e.on("animationStart",()=>{a&&PGn(a)}),p=e.on("change",m=>{c(m)}),f=e.on("animationComplete",l),h=e.on("animationCancel",l);return()=>{a&&NRe(a),d(),p(),f(),h()}},[a])}function PGn(e){const t=document.querySelector(`#${e}`);if(!t)return;const n=document.querySelector("body");n.style.backgroundColor="#000000",t.style.overflow="hidden",t.style.transitionTimingFunction="cubic-bezier(0.32, 0.72, 0, 1)",t.style.transitionProperty="transform, border-radius",t.style.transitionDuration="0.5s",t.style.transformOrigin="center top"}function $Gn(e,t){const n=document.querySelector(`#${e}`);if(!n)return;const{scale:r,translateY:s,borderRadius:i}=t;n.style.transform=`scale(${r}) translate3d(0, ${s}px, 0)`,n.style.borderTopRightRadius=`${i}px`,n.style.borderTopLeftRadius=`${i}px`}function NRe(e){const t=document.querySelector(`#${e}`);if(!t)return;document.querySelector("body").style.removeProperty("background-color"),t.style.removeProperty("overflow"),t.style.removeProperty("transition-timing-function"),t.style.removeProperty("transition-property"),t.style.removeProperty("transition-duration"),t.style.removeProperty("transform-origin"),t.style.removeProperty("transform"),t.style.removeProperty("border-top-right-radius"),t.style.removeProperty("border-top-left-radius")}var NGn=24;function pte(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}var i9=typeof document<"u"&&window.visualViewport;function ARe(e,t){if(!e)return!1;const n=window.getComputedStyle(e);let r=/(auto|scroll)/.test(n.overflow+n.overflowX+n.overflowY);return r&&t&&(r=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),r}function pst(e,t){let n=e;for(ARe(n,t)&&(n=n.parentElement);n&&!ARe(n,t);)n=n.parentElement;return n||document.scrollingElement||document.documentElement}var VM=0,qM;function AGn(e={}){const{isDisabled:t}=e;nue(()=>{if(!t)return VM++,VM===1&&(SGn()?qM=MGn():qM=IGn()),()=>{VM--,VM===0&&qM?.()}},[t])}function IGn(){return pte(VC(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`),VC(document.documentElement,"overflow","hidden"))}function MGn(){let e,t=0;const n=p=>{var f;const h=(f=p.composedPath())==null?void 0:f[0];e=pst(h,!0),!(e===document.documentElement&&e===document.body)&&(t=p.changedTouches[0].pageY)},r=p=>{if(e===void 0)return;if(!e||e===document.documentElement||e===document.body){p.preventDefault();return}const f=p.changedTouches[0].pageY,h=e.scrollTop,m=e.scrollHeight-e.clientHeight;m!==0&&((h<=0&&f>t||h>=m&&f<t)&&p.preventDefault(),t=f)},s=p=>{var f;const h=(f=p.composedPath())==null?void 0:f[0];Oy(h)&&h!==document.activeElement&&(p.preventDefault(),h.style.transform="translateY(-2000px)",h.focus(),requestAnimationFrame(()=>{h.style.transform=""}))},i=p=>{var f;const h=(f=p.composedPath())==null?void 0:f[0];Oy(h)&&(h.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{h.style.transform="",i9&&(i9.height<window.innerHeight?requestAnimationFrame(()=>{IRe(h)}):i9.addEventListener("resize",()=>IRe(h),{once:!0}))}))},o=()=>{window.scrollTo(0,0)},a=window.pageXOffset,c=window.pageYOffset,l=pte(VC(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`),VC(document.documentElement,"overflow","hidden"),VC(document.body,"marginTop",`-${c}px`));window.scrollTo(0,0);const d=pte($w(document,"touchstart",n,{passive:!1,capture:!0}),$w(document,"touchmove",r,{passive:!1,capture:!0}),$w(document,"touchend",s,{passive:!1,capture:!0}),$w(document,"focus",i,!0),$w(window,"scroll",o));return()=>{l(),d(),window.scrollTo(a,c)}}function VC(e,t,n){const r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function $w(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function IRe(e){const t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){const n=pst(e);if(n!==document.documentElement&&n!==document.body&&n!==e){const r=n.getBoundingClientRect().top,s=e.getBoundingClientRect().top,i=e.getBoundingClientRect().bottom,o=n.getBoundingClientRect().bottom+NGn;i>o&&(n.scrollTop+=s-r)}e=n.parentElement}}function QGn({isOpen:e,onClosed:t,onOpening:n,onOpen:r,onClosing:s}){const[i,o]=g.useState(e?"opening":"closed"),a=Ro(()=>t?.()),c=Ro(()=>n?.()),l=Ro(()=>r?.()),d=Ro(()=>s?.());return g.useEffect(()=>{e&&i==="closed"?o("opening"):!e&&(i==="open"||i==="opening")&&o("closing")},[e,i]),g.useEffect(()=>{async function p(){switch(i){case"closed":await a?.();break;case"opening":await c?.(),o("open");break;case"open":await l?.();break;case"closing":await d?.(),o("closed");break}}p().catch(f=>{console.error("Internal sheet state error:",f)})},[i]),i}function DGn({snapPointsProp:e,sheetHeight:t}){if(e[0]!==0&&(console.error(`First snap point should be 0 to ensure the sheet can be fully closed. Got: [${e.join(", ")}]`),e.unshift(0)),e[e.length-1]!==1&&(console.error(`Last snap point should be 1 to ensure the sheet can be fully opened. Got: [${e.join(", ")}]`),e.push(1)),t<=0)return console.error(`Sheet height is ${t}, cannot compute snap points. Make sure the sheet is mounted and has a valid height.`),[];const n=e.map(r=>r>0&&r<=1?Math.round(r*t):r<0?t+r:r);return console.assert(_Gn(n),`Snap points need to be in ascending order got: [${e.join(", ")}]`),n.forEach(r=>{(r<0||r>t)&&console.warn(`Snap point ${r} is outside of the sheet height ${t}. This can cause unexpected behavior. Consider adjusting your snap points.`)}),n.includes(t)||(console.warn("Snap points do not include the sheet height.Please include `1` as the last snap point or it will be included automatically.This is to ensure the sheet can be fully opened."),n.push(t)),n.map((r,s)=>({snapIndex:s,snapValue:r,snapValueY:t-r}))}function o9(e){return e>0?1:e<0?-1:0}function EX(e){return e.slice().sort((t,n)=>t.snapValueY-n.snapValueY)}function WM(e,t){return e.reduce((n,r)=>Math.abs(r.snapValueY-t)<Math.abs(n.snapValueY-t)?r:n)}function MRe(e,t){const n=EX(e);for(let r=n.length-1;r>=0;r--)if(n[r].snapValueY<t)return n[r];return null}function QRe(e,t){const n=EX(e);for(let r=0;r<n.length;r++)if(n[r].snapValueY>t)return n[r];return null}function LGn({offsetY:e,velocityY:t,deltaY:n}){if(Math.abs(t)>50)return o9(t);const r=o9(e);return r!==0?r:o9(n)}function jGn({y:e,info:t,sheetHeight:n,snapPoints:r,dragVelocityThreshold:s,dragCloseThreshold:i}){const o=s,a=Math.max(2e3,o),c=.35,l=.2,d=20,p=24,f=0,h=n,m=t.offset.y,O=t.delta.y,_=t.velocity.y,b=dst(e+_*l,f,h),y=Math.abs(_),x=LGn({offsetY:m,velocityY:_,deltaY:O}),S=y>a,v=y>o;if(r.length===0){if(v)return{yTo:x<0?f:h,snapIndex:void 0};const $=f+(h-f)*i;return{yTo:b<$?f:h,snapIndex:void 0}}const T=WM(r,e);if(!v&&Math.abs(m)<d)return{yTo:T.snapValueY,snapIndex:T.snapIndex};if(!v&&Math.abs(e-T.snapValueY)<p)return{yTo:T.snapValueY,snapIndex:T.snapIndex};if(S){const $=x<0?f:h,R=WM(r,$);return{yTo:$,snapIndex:R.snapIndex}}if(v){const $=x<0?MRe(r,e):QRe(r,e),R=x<0?f:h,N=WM(r,R),j=$??N;return{yTo:j.snapValueY,snapIndex:j.snapIndex}}const E=EX(r)[0],w=EX(r)[r.length-1],P=MRe(r,e)??E,k=QRe(r,e)??w;if(P.snapIndex===k.snapIndex)return{yTo:P.snapValueY,snapIndex:P.snapIndex};const C=k.snapValueY-P.snapValueY,M=C>0?(e-P.snapValueY)/C:0;let I=T;if(x>0?I=M>c?k:P:x<0&&(I=M<1-c?P:k),y>200){const $=WM(r,b);Math.abs($.snapValueY-e)<Math.abs(I.snapValueY-e)&&(I=$)}return{yTo:I.snapValueY,snapIndex:I.snapIndex}}var Im={root:{base:{position:"fixed",top:0,bottom:0,left:0,right:0,overflow:"hidden",pointerEvents:"none"},decorative:{}},backdrop:{base:{zIndex:1,position:"fixed",top:0,left:0,width:"100%",height:"100%",touchAction:"none",userSelect:"none"},decorative:{backgroundColor:"rgba(0, 0, 0, 0.2)",border:"none",WebkitTapHighlightColor:"transparent"}},container:{base:{zIndex:2,position:"absolute",left:0,bottom:0,width:"100%",pointerEvents:"auto",display:"flex",flexDirection:"column"},decorative:{backgroundColor:"#fff",borderTopRightRadius:"8px",borderTopLeftRadius:"8px",boxShadow:"0px -2px 16px rgba(0, 0, 0, 0.3)"}},headerWrapper:{base:{width:"100%"},decorative:{}},header:{base:{width:"100%",position:"relative"},decorative:{height:"40px",display:"flex",alignItems:"center",justifyContent:"center"}},indicatorWrapper:{base:{display:"flex"},decorative:{}},indicator:{base:{display:"inline-block"},decorative:{width:"18px",height:"4px",borderRadius:"99px",backgroundColor:"#ddd"}},content:{base:{minHeight:"0px",position:"relative",flexGrow:1,display:"flex",flexDirection:"column"},decorative:{}},scroller:{base:{height:"100%",overflowY:"auto",overscrollBehaviorY:"none"},decorative:{}}},fst=g.forwardRef(({avoidKeyboard:e=!0,children:t,className:n="",detent:r="default",disableDismiss:s=!1,disableDrag:i=!1,disableScrollLocking:o=!1,dragCloseThreshold:a=mGn,dragVelocityThreshold:c=OGn,initialSnap:l,isOpen:d,modalEffectRootId:p,modalEffectThreshold:f,mountPoint:h,prefersReducedMotion:m=!1,snapPoints:O,style:_,tweenConfig:b=fGn,unstyled:y=!1,onOpenStart:x,onOpenEnd:S,onClose:v,onCloseStart:T,onCloseEnd:E,onSnap:w,onDrag:P,onDragStart:k,onDragEnd:C,...M},I)=>{const[$,R]=aGn(),N=g.useRef(null),j=Math.round(R.height),[Q,U]=g.useState(l),{windowHeight:A}=gGn(),V=j>0?j:A,z=dte(V),L=zS(z,H=>Math.max(j-H,0)),q=zS(z,H=>dst(1-H/V,0,1)),Y=dte(0),ne=BWn(),G={type:"tween",...!!(m||ne)?hGn:b},Z=zS(z,H=>H+2>=V?-1:_?.zIndex??9999),oe=zS(z,H=>H+2>=V?"hidden":"visible"),re=g.useMemo(()=>O&&j>0?DGn({sheetHeight:j,snapPointsProp:O}):[],[j,O?.join("")]),se=Ro(H=>{U(H),w?.(H)}),he=Ro(H=>O&&re?H<0||H>=re.length?(console.warn(`Invalid snap index ${H}. Snap points are: [${O.join(", ")}] and their computed values are: [${re.map(pe=>pe.snapValue).join(", ")}]`),null):re[H]:null),Te=Ro(async H=>{if(!O){console.warn("Snapping is not possible without `snapPoints` prop.");return}const pe=he(H);if(pe===null){console.warn(`Invalid snap index ${H}.`);return}if(H===0){v();return}await Rw(z,pe.snapValueY,{...G,onComplete:()=>se(H)})}),ye=kGn({isEnabled:d&&e,containerRef:N,onWillOpenKeyboard:async()=>{const H=re[re.length-1];H&&H.snapIndex!==Q&&(await Rw(z,H.snapValueY,G),se(H.snapIndex))},onDidOpenKeyboard:H=>{const pe=N.current;if(!pe)return;const Ee=H.getBoundingClientRect(),we=pe.getBoundingClientRect(),$e=pe.querySelector(".react-modal-sheet-content-scroller"),Ze=Math.max(Ee.top-we.top+$e.scrollTop-Ee.height,0);requestAnimationFrame(()=>{$e.scrollTo({top:Ze,behavior:"smooth"})})}}).isKeyboardOpen||i,Oe=Ro(()=>{var H;const pe=document.activeElement;pe&&Oy(pe)&&((H=N.current)!=null&&H.contains(pe))&&pe.blur()}),ie=Ro((H,pe)=>{Oe(),k?.(H,pe)}),ge=Ro((H,pe)=>{P?.(H,pe);const Ee=z.get(),we=z.getVelocity();we>0&&Y.set(10),we<0&&Y.set(-10),z.set(Math.max(Ee+pe.delta.y,0))}),J=Ro((H,pe)=>{Oe(),C?.(H,pe);const Ee=z.get(),we=jGn({y:Ee,info:pe,sheetHeight:j,dragCloseThreshold:a,snapPoints:re,dragVelocityThreshold:c});let $e=we.yTo;if(s&&$e+1>=j){const Ze=re.find(lt=>lt.snapValue>0);Ze?($e=Ze.snapValueY,se(Ze.snapIndex)):$e=Ee}else we.snapIndex!==void 0&&se(we.snapIndex);Rw(z,$e,G),$e+1>=j&&!s&&v(),Y.set(0)});RGn({y:z,detent:r,sheetHeight:j,snapPoints:re,rootId:p,startThreshold:f}),AGn({isDisabled:o||!d});const F=QGn({isOpen:d,onOpen:async()=>{x?.(),await vGn("react-modal-sheet-container");const H=l!==void 0?he(l):null,pe=H?.snapValueY??0;await Rw(z,pe,G),l!==void 0&&se(l),S?.()},onClosing:async()=>{T?.(),await Rw(z,V,G),E?.()}}),ue={currentSnap:Q,detent:r,disableDrag:ye,dragProps:{drag:"y",dragElastic:0,dragMomentum:!1,dragPropagation:!1,onDrag:ge,onDragStart:ie,onDragEnd:J},indicatorRotation:Y,avoidKeyboard:e,prefersReducedMotion:m,sheetBoundsRef:$,sheetRef:N,unstyled:y,yProgress:q,y:z},ae={height:j,currentSnap:Q,snapPoints:re,snapTo:Te,y:z,yInverted:L,yProgress:q};g.useImperativeHandle(I,()=>ae);const ce=Je.createElement(lst.Provider,{value:ue},Je.createElement(Nm.div,{...M,ref:I,"data-sheet-state":F,className:`react-modal-sheet-root ${n}`,style:{...Am(Im.root,y),zIndex:Z,visibility:oe,..._}},Je.createElement(cst.Provider,{value:ae},F!=="closed"?t:null)));return t$?ce:xi.createPortal(ce,h??document.body)});fst.displayName="Sheet";var XGn=e=>!!e.onClick||!!e.onTap,hst=g.forwardRef(({style:e,className:t="",unstyled:n,...r},s)=>{const i=KN(),o=XGn(r),a=o?Nm.button:Nm.div,c=o?"auto":"none",l=n??i.unstyled,d={opacity:i.yProgress,...Am(Im.backdrop,l),...e,pointerEvents:c};return Je.createElement(a,{...r,ref:s,className:`react-modal-sheet-backdrop ${t}`,style:d})});hst.displayName="SheetBackdrop";var mst=g.forwardRef(({children:e,style:t,className:n="",unstyled:r,...s},i)=>{const o=KN(),a=r??o.unstyled,c={...Am(Im.container,a),...t,y:o.y};return o.detent==="default"&&(c.height=$Re),o.detent==="full"&&(c.height="100%",c.maxHeight="100%"),o.detent==="content"&&(c.height="auto",c.maxHeight=$Re),Je.createElement(Nm.div,{...s,ref:TX([i,o.sheetRef,o.sheetBoundsRef]),className:`react-modal-sheet-container ${n}`,style:c},e)});mst.displayName="SheetContainer";var UGn={bottom:0,top:0,left:0,right:0};function Ost(){const e=g.useRef(null),t=g.useCallback(()=>UGn,[]);return{ref:e,onMeasure:t}}function zGn(e={}){const{debounceDelay:t=32,isEnabled:n=!0}=e,r=g.useRef(null),[s,i]=g.useState(null),[o,a]=g.useState(void 0),c=g.useMemo(()=>f=>{i(f)},[]),l=Ro(f=>{const{scrollTop:h,scrollHeight:m,clientHeight:O}=f;if(!(m>O)){o&&a(void 0);return}const b=h<=0,y=Math.ceil(m)-Math.ceil(h)===Math.ceil(O);let x;b?x="top":y?x="bottom":x="middle",f.style.touchAction=b?"pan-down":"",x!==o&&a(x)}),d=Ro(f=>{if(f.currentTarget instanceof HTMLElement){const h=f.currentTarget;r.current&&clearTimeout(r.current),t===0?l(h):r.current=setTimeout(()=>l(h),t)}}),p=Ro(f=>{if(f.currentTarget instanceof HTMLElement){const h=f.currentTarget;requestAnimationFrame(()=>{l(h)})}});return g.useEffect(()=>{if(!(!s||!n))return l(s),s.addEventListener("scroll",d),s.addEventListener("touchstart",p),()=>{r.current&&clearTimeout(r.current),s.removeEventListener("scroll",d),s.removeEventListener("touchstart",p)}},[s,n]),{scrollRef:c,scrollPosition:o}}var gst=g.forwardRef(({disableScroll:e,disableDrag:t,children:n,style:r,className:s="",scrollClassName:i="",scrollStyle:o,scrollRef:a=null,unstyled:c,...l},d)=>{const p=KN(),f=Ost(),h=zGn({isEnabled:typeof e=="function"?!0:!e}),m=typeof e=="function"?e({scrollPosition:h.scrollPosition,currentSnap:p.currentSnap}):!!e,O=!m&&h.scrollPosition&&h.scrollPosition!=="top",y=(typeof t=="function"?t({scrollPosition:h.scrollPosition,currentSnap:p.currentSnap}):!!t)||O||p.disableDrag||p.disableDrag?void 0:p.dragProps,x=c??p.unstyled,S={...Am(Im.content,x),...r},v=Am(Im.scroller,x);return p.avoidKeyboard&&(v.paddingBottom=ust()?"env(keyboard-inset-height, var(--keyboard-inset-height, 0px))":"var(--keyboard-inset-height, 0px)"),m&&(v.overflowY="clip"),y!==void 0&&(v.touchAction="pan-down"),Je.createElement(Nm.div,{...l,ref:TX([d,f.ref]),className:`react-modal-sheet-content ${s}`,style:S,...y,dragConstraints:f.ref,onMeasureDragConstraints:f.onMeasure},Je.createElement(Nm.div,{ref:TX([h.scrollRef,a]),style:{...v,...o},className:`react-modal-sheet-content-scroller ${i}`},n))});gst.displayName="SheetContent";function _st({style:e,className:t="",unstyled:n,...r}){const s=KN(),i=zS(s.indicatorRotation,d=>`translateX(2px) rotate(${d}deg)`),o=zS(s.indicatorRotation,d=>`translateX(-2px) rotate(${-1*d}deg)`),a=n??s.unstyled,c={...Am(Im.indicatorWrapper,a),...e},l=Am(Im.indicator,a);return Je.createElement("div",{className:`react-modal-sheet-drag-indicator-container ${t}`,style:c,...r},Je.createElement(Nm.span,{className:"react-modal-sheet-drag-indicator",style:{...l,transform:i}}),Je.createElement(Nm.span,{className:"react-modal-sheet-drag-indicator",style:{...l,transform:o}}))}var bst=g.forwardRef(({children:e,style:t,disableDrag:n,unstyled:r,className:s="",...i},o)=>{const a=KN(),c=Ost(),l=n||a.disableDrag?void 0:a.dragProps,d=r??a.unstyled,p={...Am(Im.headerWrapper,d),...t},f=Am(Im.header,d);return Je.createElement(Nm.div,{...i,ref:TX([o,c.ref]),style:p,className:`react-modal-sheet-header-container ${s}`,...l,dragConstraints:c.ref,onMeasureDragConstraints:c.onMeasure},e||Je.createElement("div",{className:"react-modal-sheet-header",style:f},Je.createElement(_st,null)))});bst.displayName="SheetHeader";var Nw=Object.assign(fst,{Container:mst,Header:bst,DragIndicator:_st,Content:gst,Backdrop:hst,useContext:pGn});const BGn="team-msg-expanded:";function sue(e){return`${BGn}${e}`}function wX(e){try{const t=localStorage.getItem(sue(e));if(!t)return new Set;const n=JSON.parse(t);return Array.isArray(n)?new Set(n.filter(r=>typeof r=="string")):new Set}catch{return new Set}}function FGn(e,t){try{const n=wX(e);if(n.has(t))return;n.add(t),localStorage.setItem(sue(e),JSON.stringify([...n]))}catch{}}function YGn(e,t){try{const n=wX(e);if(!n.has(t))return;n.delete(t),localStorage.setItem(sue(e),JSON.stringify([...n]))}catch{}}function VGn(e){const[t,n]=g.useState(0),r=g.useMemo(()=>t<0?new Set:e?wX(e):new Set,[e,t]),s=g.useCallback(i=>{if(!e)return;wX(e).has(i)?YGn(e,i):FGn(e,i),n(a=>a+1)},[e]);return{expandedSet:r,toggle:s}}function qGn(e){for(let t=0;t<e.length;t++)if(e[t]?.type==="message")return t;return-1}function WGn({allCollapsed:e,itemIndex:t,newestMessageIndex:n,isPinnedThoughtGroup:r,isExpandedOverride:s,onToggleOverride:i}){return e?r||t===n?{mode:"managed",isCollapsed:!1,canToggle:!1}:{mode:"managed",isCollapsed:!s,canToggle:i!=null,onToggle:i}:{mode:"default"}}const GGn=.15,GM=30,HGn=400,ZGn=[],KGn=new Map,DRe="default",JGn=8,e8n=4,t8n=60,n8n={"session-separator":135,"compaction-divider":50,"lead-thought-group":220,"message-row":140};function r8n(e,t){const n=new Set([e,t]);let r=e;for(;r&&r!==t;){const s=r.parentElement;if(!s)break;n.add(s);let i=r.previousElementSibling;for(;i;)i instanceof HTMLElement&&n.add(i),i=i.previousElementSibling;r=s}return[...n]}function LRe(e){if(e.type==="lead-thoughts")return e.group.thoughts[0]?.leadSessionId}const s8n=({message:e})=>u.jsxs("div",{className:"flex items-center gap-3",style:{paddingTop:16,paddingBottom:16},children:[u.jsx("div",{className:"h-px flex-1",style:{backgroundColor:"var(--tool-call-text)",opacity:.3}}),u.jsxs("div",{className:"flex shrink-0 items-center gap-2 px-3",children:[u.jsx(pR,{size:12,style:{color:"var(--tool-call-text)"}}),u.jsx("span",{className:"whitespace-nowrap text-[11px] font-medium",style:{color:"var(--tool-call-text)"},children:e.text})]}),u.jsx("div",{className:"h-px flex-1",style:{backgroundColor:"var(--tool-call-text)",opacity:.3}})]}),i8n=({message:e,teamName:t,memberRole:n,memberColor:r,recipientColor:s,isUnread:i,isNew:o,zebraShade:a,memberColorMap:c,localMemberNames:l,onMemberNameClick:d,onCreateTask:p,onReply:f,onVisible:h,onTaskIdClick:m,onRestartTeam:O,collapseMode:_,isCollapsed:b,canToggleCollapse:y,collapseToggleKey:x,onToggleCollapse:S,compactHeader:v,teamNames:T,teamColorByName:E,onTeamClick:w,onExpand:P,expandItemKey:k,onExpandContent:C,observerRoot:M})=>{const I=g.useRef(null),$=g.useRef(!1),R=g.useRef(e),N=g.useRef(h);return g.useEffect(()=>{R.current=e,N.current=h},[e,h]),g.useEffect(()=>{if(!h)return;const j=I.current;if(!j)return;const Q=M?.current??null,U=new IntersectionObserver(([A])=>{if(!A?.isIntersecting||$.current)return;const V=N.current,z=R.current;V&&($.current=!0,V(z))},{root:Q,threshold:GGn,rootMargin:"0px"});return U.observe(j),()=>U.disconnect()},[h,M]),u.jsx(yle,{animate:o,containerRef:I,children:u.jsx(jN,{message:e,teamName:t,memberRole:n,memberColor:r,recipientColor:s,isUnread:i,zebraShade:a,memberColorMap:c,localMemberNames:l,onMemberNameClick:d,onCreateTask:p,onReply:f,onTaskIdClick:m,onRestartTeam:O,collapseMode:_,isCollapsed:b,canToggleCollapse:y,collapseToggleKey:x,onToggleCollapse:S,compactHeader:v,teamNames:T,teamColorByName:E,onTeamClick:w,onExpand:P,expandItemKey:k,onExpandContent:C})})},o8n=Je.memo(i8n,(e,t)=>e.teamName===t.teamName&&e.memberRole===t.memberRole&&e.memberColor===t.memberColor&&e.recipientColor===t.recipientColor&&e.isUnread===t.isUnread&&e.isNew===t.isNew&&e.zebraShade===t.zebraShade&&e.memberColorMap===t.memberColorMap&&e.localMemberNames===t.localMemberNames&&e.onMemberNameClick===t.onMemberNameClick&&e.onCreateTask===t.onCreateTask&&e.onReply===t.onReply&&e.onVisible===t.onVisible&&e.onTaskIdClick===t.onTaskIdClick&&e.onRestartTeam===t.onRestartTeam&&e.collapseMode===t.collapseMode&&e.isCollapsed===t.isCollapsed&&e.canToggleCollapse===t.canToggleCollapse&&e.collapseToggleKey===t.collapseToggleKey&&e.onToggleCollapse===t.onToggleCollapse&&e.compactHeader===t.compactHeader&&DN(e.teamNames,t.teamNames)&&LN(e.teamColorByName,t.teamColorByName)&&e.onTeamClick===t.onTeamClick&&e.onExpand===t.onExpand&&e.expandItemKey===t.expandItemKey&&e.onExpandContent===t.onExpandContent&&e.observerRoot===t.observerRoot&&jZe(e.message,t.message)),a9=Je.memo(function({messages:t,teamName:n,members:r,readState:s,onCreateTaskFromMessage:i,onReplyToMessage:o,onMemberClick:a,onMessageVisible:c,onTaskIdClick:l,onRestartTeam:d,allCollapsed:p,expandOverrides:f,onToggleExpandOverride:h,currentLeadSessionId:m,isTeamAlive:O,leadActivity:_,leadContextUpdatedAt:b,teamNames:y=ZGn,teamColorByName:x=KGn,onTeamClick:S,onExpandItem:v,onExpandContent:T,viewport:E}){const w=E?.observerRoot??E?.scrollElementRef,[P,k]=g.useState(GM),C=g.useRef(null),[M,I]=g.useState(!1);g.useEffect(()=>{const ie=C.current;if(!ie)return;const ge=F=>{I(W=>{const ue=F<HGn;return W===ue?W:ue})};ge(ie.getBoundingClientRect().width);const J=new ResizeObserver(F=>{const W=F[0];W&&ge(W.contentRect.width)});return J.observe(ie),()=>J.disconnect()},[]);const $=g.useMemo(()=>QN(r),[r]),{colorMap:R,localMemberNames:N,memberInfo:j}=$,Q=g.useCallback(ie=>{const ge=r?.find(J=>J.name===ie||J.agentType===ie);ge&&a?.(ge)},[r,a]),{visibleMessages:U,hiddenCount:A}=g.useMemo(()=>{const ie=t.length;if(ie===0)return{visibleMessages:t,hiddenCount:0};let ge=0,J=ie;for(let ue=0;ue<ie;ue++)if(!aee(t[ue])&&(ge++,ge>P)){J=ue;break}const F=ge+(J<ie?t.slice(J).filter(ue=>!aee(ue)).length:0),W=Math.max(0,F-P);return{visibleMessages:J<ie?t.slice(0,J):t,hiddenCount:W}},[t,P]),V=g.useMemo(()=>BZe(U),[U]),z=g.useMemo(()=>{const ie=new Set;let ge=0;for(let J=V.length-1;J>=0;J--){const F=V[J];if(F.type==="lead-thoughts")ge%2===1&&ie.add(J),ge++;else{if(zMn(F.message.text)||oee(F.message))continue;ge%2===1&&ie.add(J),ge++}}return ie},[V]),L=g.useMemo(()=>{const ie=ge=>ge.type==="lead-thoughts"?_v(ge.group):As(ge.message);return V.map(ie)},[V]),q=_7e({itemKeys:L,paginationKey:P,resetKey:n});g.useEffect(()=>{},[n,L]);const Y=()=>{k(ie=>ie+GM)},ne=()=>{k(1/0)},te=g.useMemo(()=>{const ie=[];let ge;for(const J of V){ie.push(ge);const F=LRe(J);F&&(ge=F)}return ie},[V]),G=V[0]?.type==="lead-thoughts"?V[0]:null,Z=G?1:0,oe=g.useMemo(()=>{const ie=[];G&&ie.push({kind:"lead-thought-group",key:_v(G.group),itemIndex:0,group:G.group,isPinned:!0});for(let ge=Z;ge<V.length;ge+=1){const J=V[ge];if(ge>0){const W=LRe(J),ue=te[ge];ue&&W&&ue!==W&&ie.push({kind:"session-separator",key:`session-separator-${ge}-${ue}->${W}`})}if(J.type==="lead-thoughts"){ie.push({kind:"lead-thought-group",key:_v(J.group),itemIndex:ge,group:J.group,isPinned:!1});continue}const F=J.message;if(oee(F)){ie.push({kind:"compaction-divider",key:`compaction-${As(F)}`,message:F});continue}ie.push({kind:"message-row",key:As(F),itemIndex:ge,message:F})}return ie},[G,te,Z,V]),re=E?.virtualizationEnabled===!0&&E.scrollElementRef!=null&&oe.length>=t8n,[se,he]=g.useState(0);g.useLayoutEffect(()=>{if(!re)return;const ie=E?.scrollElementRef?.current??null,ge=C.current;if(!ie||!ge)return;let J=!1,F=null;const W=()=>{J||(J=!0,F=requestAnimationFrame(()=>{F=null,J=!1;const ce=ie.getBoundingClientRect(),H=ge.getBoundingClientRect(),pe=Math.max(0,H.top-ce.top+ie.scrollTop);he(Ee=>Math.abs(Ee-pe)<.5?Ee:pe)}))};W();const ue=new ResizeObserver(W);return r8n(ge,ie).forEach(ce=>ue.observe(ce)),window.addEventListener("resize",W),()=>{F!==null&&cancelAnimationFrame(F),ue.disconnect(),window.removeEventListener("resize",W)}},[re,E?.scrollElementRef]);const Te=mce({count:re?oe.length:0,getScrollElement:()=>E?.scrollElementRef?.current??null,estimateSize:ie=>n8n[oe[ie]?.kind??"message-row"],getItemKey:ie=>oe[ie]?.key??`row-${ie}`,overscan:JGn,gap:e8n,scrollMargin:se}),ee=g.useMemo(()=>qGn(V),[V]),ye=g.useCallback((ie,ge)=>{const J=WGn({allCollapsed:p,itemIndex:ge,newestMessageIndex:ee,isPinnedThoughtGroup:ge===0&&G!=null,isExpandedOverride:f?.has(ie)??!1,onToggleOverride:h?()=>h(ie):void 0});return J.mode!==DRe?{collapseMode:J.mode,isCollapsed:J.isCollapsed,canToggleCollapse:J.canToggle,collapseToggleKey:J.canToggle?ie:void 0}:{collapseMode:DRe,isCollapsed:!1,canToggleCollapse:!1}},[p,ee,G,f,h]),Oe=(ie,ge)=>{const J=ge?.suppressEntryAnimation===!0;switch(ie.kind){case"session-separator":return u.jsxs("div",{className:"flex items-center gap-3",style:{paddingTop:45,paddingBottom:45},children:[u.jsx("div",{className:"h-px flex-1 bg-blue-600/30 dark:bg-blue-400/30"}),u.jsx("span",{className:"whitespace-nowrap text-[11px] font-medium text-blue-600 dark:text-blue-400",children:"New session"}),u.jsx("div",{className:"h-px flex-1 bg-blue-600/30 dark:bg-blue-400/30"})]},ie.key);case"compaction-divider":return u.jsx(s8n,{message:ie.message},ie.key);case"lead-thought-group":{const{group:F,itemIndex:W,isPinned:ue,key:ae}=ie,ce=F.thoughts[0],H=j.get(ce.from),pe=ye(ae,W),Ee=ue?m?ce.leadSessionId===m:!0:!1;return u.jsx(lQn,{group:F,memberColor:H?.color,canBeLive:Ee,isTeamAlive:Ee?O:void 0,leadActivity:Ee?_:void 0,leadContextUpdatedAt:Ee?b:void 0,isNew:!J&&q.has(ae),onVisible:c,observerRoot:w,zebraShade:z.has(W),collapseMode:pe.collapseMode,isCollapsed:pe.isCollapsed,canToggleCollapse:pe.canToggleCollapse,collapseToggleKey:pe.collapseToggleKey,onToggleCollapse:h,onTaskIdClick:l,memberColorMap:R,onReply:o,compactHeader:M,teamNames:y,teamColorByName:x,onTeamClick:S,onExpand:M?v:void 0,expandItemKey:M?ae:void 0},ae)}case"message-row":{const{message:F,itemIndex:W,key:ue}=ie,ae=sB(F,$),ce=ye(ue,W),H=s?!F.read&&!s.readSet.has(s.getMessageKey(F)):!F.read;return u.jsx(o8n,{message:F,teamName:n,memberRole:ae.memberRole,memberColor:ae.memberColor,recipientColor:ae.recipientColor,isUnread:H,isNew:!J&&q.has(ue),zebraShade:z.has(W),memberColorMap:R,localMemberNames:N,onMemberNameClick:a?Q:void 0,onCreateTask:i,onReply:o,onVisible:c,onTaskIdClick:l,onRestartTeam:d,collapseMode:ce.collapseMode,isCollapsed:ce.isCollapsed,canToggleCollapse:ce.canToggleCollapse,collapseToggleKey:ce.collapseToggleKey,onToggleCollapse:h,compactHeader:M,teamNames:y,teamColorByName:x,onTeamClick:S,onExpand:M?v:void 0,expandItemKey:M?ue:void 0,observerRoot:w,onExpandContent:T},ue)}}};return t.length===0?u.jsxs("div",{className:"rounded-md border border-[var(--color-border)] p-3 pl-5 text-xs text-[var(--color-text-muted)]",children:[u.jsx("p",{children:"暂无消息"}),u.jsx("p",{className:"mt-1 text-[11px]",children:"向成员发送消息后,这里会显示活动。"})]}):u.jsxs("div",{ref:C,className:"space-y-1",children:[re?u.jsx("div",{style:{height:`${Te.getTotalSize()}px`,width:"100%",position:"relative"},children:Te.getVirtualItems().map(ie=>{const ge=oe[ie.index];return ge?u.jsx("div",{ref:Te.measureElement,"data-index":ie.index,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${ie.start-Te.options.scrollMargin}px)`},children:Oe(ge,{suppressEntryAnimation:!0})},ie.key):null})}):oe.map(ie=>Oe(ie)),A>0&&u.jsxs("div",{className:"relative flex justify-center pb-3 pt-1",children:[u.jsx("div",{className:"pointer-events-none absolute inset-x-0 -top-24",style:{bottom:"-1.6rem",background:"linear-gradient(to top, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.25) 25%, rgba(0, 0, 0, 0.1) 50%, rgba(0, 0, 0, 0.03) 75%, transparent 100%)"}}),u.jsxs("div",{className:"relative z-[1] flex items-center gap-3 rounded-full px-4 py-1.5",style:{backgroundColor:"var(--color-surface-raised)",boxShadow:"0 0 12px 4px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.04)",border:"1px solid var(--color-border-emphasis)"},children:[u.jsxs("span",{className:"text-[11px] tabular-nums text-[var(--color-text-muted)]",children:["+",A," older"]}),u.jsx("span",{className:"h-3 w-px bg-blue-600/30 dark:bg-blue-400/30"}),u.jsxs("button",{onClick:Y,className:"rounded-full px-2.5 py-0.5 text-[11px] font-medium text-[var(--color-text-secondary)] transition-all hover:bg-[rgba(255,255,255,0.08)] hover:text-[var(--color-text)]",children:["Show ",Math.min(GM,A)," more"]}),A>GM&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"h-3 w-px bg-blue-600/30 dark:bg-blue-400/30"}),u.jsx("button",{onClick:ne,className:"rounded-full px-2.5 py-0.5 text-[11px] text-[var(--color-text-muted)] transition-all hover:bg-[rgba(255,255,255,0.08)] hover:text-[var(--color-text-secondary)]",children:"Show all"})]})]})]})]})}),yst=new Map,xst=new Map;function Sst(e){return{from:new Set(e.from),to:new Set(e.to),showNoise:e.showNoise}}function a8n(){return{messagesSearchQuery:"",messagesFilter:{from:new Set,to:new Set,showNoise:!1},messagesFilterOpen:!1,messagesCollapsed:!0,messagesSearchBarVisible:!1,expandedItemKey:null,messagesScrollTop:0,bottomSheetSnapIndex:2}}function jRe(e){const t=yst.get(e)??a8n();return{...t,messagesFilter:Sst(t.messagesFilter)}}function l8n(e,t){yst.set(e,{...t,messagesFilter:Sst(t.messagesFilter)})}function XRe(e){return{...xst.get(e)??{}}}function c8n(e,t){xst.set(e,{...t})}const vst=1,u8n="composer:";function iue(e){return`${u8n}${e}`}function d8n(e){return{text:`draft:compose:${e}`,chips:`draft:compose:${e}:chips`,attachments:`draft:compose:${e}:attachments`}}function p8n(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.version=="number"&&typeof t.teamName=="string"&&typeof t.text=="string"&&Array.isArray(t.chips)&&Array.isArray(t.attachments)&&typeof t.updatedAt=="number"}let JN=!1,URe=!1;const HT=new Map;function oue(){URe||(URe=!0,console.warn("[composerDraftStorage] IndexedDB unavailable, using in-memory storage for this session.")),JN=!0}async function Tst(e,t){const n=iue(e);if(JN){HT.set(n,t);return}try{await Ry(n,t)}catch{oue(),HT.set(n,t)}}async function f8n(e){const t=iue(e);if(JN)return HT.get(t)??null;try{const n=await zd(t);return n==null?null:p8n(n)?n:(Za(t),null)}catch{return oue(),HT.get(t)??null}}async function h8n(e){const t=iue(e);if(JN){HT.delete(t);return}try{await Za(t)}catch{oue(),HT.delete(t)}}function l9(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.value=="string"&&typeof t.timestamp=="number"}function m8n(e){return Array.isArray(e)?e.every(t=>{if(typeof t!="object"||t===null)return!1;const n=t;return typeof n.id=="string"&&typeof n.filePath=="string"}):!1}function O8n(e){return Array.isArray(e)?e.every(t=>{if(typeof t!="object"||t===null)return!1;const n=t;return typeof n.id=="string"&&typeof n.filename=="string"&&typeof n.data=="string"}):!1}async function g8n(e){if(JN)return null;const t=d8n(e);try{const[n,r,s]=await Promise.all([zd(t.text),zd(t.chips),zd(t.attachments)]);if(n==null&&r==null&&s==null)return null;let i="";l9(n)&&(i=n.value);let o=[];if(r!=null){const l=typeof r=="string"?JSON.parse(r):r,d=l9(l)?l.value:l,p=typeof d=="string"?JSON.parse(d):d;m8n(p)&&(o=p)}let a=[];if(s!=null){const l=typeof s=="string"?JSON.parse(s):s,d=l9(l)?l.value:l,p=typeof d=="string"?JSON.parse(d):d;O8n(p)&&(a=p)}if(i.length===0&&o.length===0&&a.length===0)return await Promise.all([Za(t.text),Za(t.chips),Za(t.attachments)]),null;const c={version:vst,teamName:e,text:i,chips:o,attachments:a,updatedAt:Date.now()};return await Tst(e,c),await Promise.all([Za(t.text),Za(t.chips),Za(t.attachments)]),c}catch{return null}}function _8n(e){return{version:vst,teamName:e,text:"",chips:[],attachments:[],updatedAt:Date.now()}}const hO={saveSnapshot:Tst,loadSnapshot:f8n,deleteSnapshot:h8n,migrateLegacy:g8n,emptySnapshot:_8n},b8n=400;function y8n(e){const[t,n]=g.useState(""),[r,s]=g.useState([]),[i,o]=g.useState([]),[a,c]=g.useState(null),[l,d]=g.useState("do"),[p,f]=g.useState(!1),[h,m]=g.useState(!1),O=g.useRef(""),_=g.useRef([]),b=g.useRef([]),y=g.useRef("do"),x=g.useRef(e),S=g.useRef(!0),v=g.useRef(!1),T=g.useRef(null),E=g.useRef(null);g.useEffect(()=>{x.current=e},[e]),g.useEffect(()=>(S.current=!0,()=>{S.current=!1}),[]);const w=g.useCallback(()=>({version:1,teamName:x.current,text:O.current,chips:_.current,attachments:b.current,actionMode:y.current,updatedAt:Date.now()}),[]),P=g.useCallback(()=>{if(T.current!=null&&(clearTimeout(T.current),T.current=null),E.current!=null){const Y=E.current;E.current=null,Y.snapshot.text.length===0&&Y.snapshot.chips.length===0&&Y.snapshot.attachments.length===0?hO.deleteSnapshot(Y.teamName):hO.saveSnapshot(Y.teamName,Y.snapshot)}},[]),k=g.useCallback(()=>{const Y=w();E.current={teamName:x.current,snapshot:Y},T.current!=null&&clearTimeout(T.current),T.current=setTimeout(()=>{T.current=null;const ne=E.current;if(E.current=null,ne==null)return;ne.snapshot.text.length===0&&ne.snapshot.chips.length===0&&ne.snapshot.attachments.length===0?(hO.deleteSnapshot(ne.teamName),S.current&&f(!0)):hO.saveSnapshot(ne.teamName,ne.snapshot).then(()=>{S.current&&f(!0)})},b8n)},[w]),C=g.useCallback(Y=>{O.current=Y.text,_.current=Y.chips,b.current=Y.attachments,y.current=Y.actionMode??"do",n(Y.text),s(Y.chips),o(Y.attachments),d(Y.actionMode??"do")},[]);g.useEffect(()=>{let Y=!1;P(),v.current=!1;const ne=hO.emptySnapshot(e);return queueMicrotask(()=>{Y||(C(ne),f(!1),m(!1),c(null))}),(async()=>{let te=await hO.loadSnapshot(e);if(te==null&&(te=await hO.migrateLegacy(e)),!Y){if(v.current){S.current&&m(!0);return}te!=null&&((te.attachments.reduce((Z,oe)=>Z+oe.size,0)>gv||te.attachments.length>og)&&(te={...te,attachments:[]}),C(te),f(!0)),S.current&&m(!0)}})(),()=>{Y=!0}},[e,P,C]),g.useEffect(()=>()=>{P()},[P]);const M=g.useCallback(Y=>{v.current=!0,O.current=Y,n(Y),f(!1),k()},[k]),I=g.useCallback(Y=>{v.current=!0;const ne=[..._.current,Y];_.current=ne,s(ne),f(!1),k()},[k]),$=g.useCallback(Y=>{v.current=!0;const ne=_.current.filter(te=>te.id!==Y);_.current=ne,s(ne),f(!1),k()},[k]),R=g.useCallback(Y=>{v.current=!0,y.current=Y,d(Y),f(!1),k()},[k]),N=i.reduce((Y,ne)=>Y+ne.size,0),j=i.length<og&&N<gv,Q=g.useCallback(async Y=>{v.current=!0,c(null);const ne=Array.from(Y);if(ne.length===0)return;const te=[],G=[];for(const Te of ne)if(PN(Te)==="unsupported"){let ee="";try{ee=K.getPathForFile(Te)}catch{}ee?G.push(ee):c(`Unsupported file: ${Te.name}`)}else te.push(Te);if(G.length>0){const Te=G.join(`
1828
1828
  `)+`
1829
- `,ee=O.current;M(ee?Te+ee:Te)}if(te.length===0)return;let Z=0;for(const Te of te){const ee=o7e(Te);if(!ee.valid){c(ee.error);return}Z+=Te.size}const oe=[];for(const Te of te)try{const ee=await a7e(Te);oe.push(ee)}catch{c(`读取文件失败:${Te.name}`);return}const re=b.current;if(re.length+oe.length>og){c(`最多允许添加 ${og} 个附件`);return}if(re.reduce((Te,ee)=>Te+ee.size,0)+Z>gv){c("附件总大小超过 20MB 限制");return}const he=[...re,...oe];b.current=he,o(he),f(!1),k()},[k,M]),U=g.useCallback(Y=>{v.current=!0;const ne=b.current.filter(te=>te.id!==Y);b.current=ne,o(ne),c(null),f(!1),k()},[k]),A=g.useCallback(()=>{v.current=!0,b.current=[],o([]),c(null),f(!1),k()},[k]),V=g.useCallback(()=>{c(null)},[]),z=g.useCallback(Y=>{const ne=Y.clipboardData?.items;if(!ne)return;const te=[];for(const G of Array.from(ne))if(G.kind==="file"){const Z=G.getAsFile();Z&&te.push(Z)}te.length>0&&(Y.preventDefault(),Q(te))},[Q]),L=g.useCallback(Y=>{Y.preventDefault();const ne=Y.dataTransfer?.files;ne?.length&&Q(Array.from(ne))},[Q]),q=g.useCallback(()=>{T.current!=null&&(clearTimeout(T.current),T.current=null),E.current=null,O.current="",_.current=[],b.current=[],n(""),s([]),o([]),c(null),f(!1),hO.deleteSnapshot(x.current)},[]);return{text:t,setText:M,chips:r,addChip:I,removeChip:$,attachments:i,attachmentError:a,canAddMore:j,addFiles:Q,removeAttachment:U,clearAttachments:A,clearAttachmentError:V,handlePaste:z,handleDrop:L,actionMode:l,setActionMode:R,isSaved:p,isLoaded:h,clearDraft:q}}const x8n=[{name:"model",command:"/model",description:"Choose the active model for this session."},{name:"fast",command:"/fast",description:"Toggle Fast mode on or off."},{name:"permissions",command:"/permissions",description:"Adjust approval requirements for tools and commands."},{name:"plan",command:"/plan",description:"Switch to plan mode with an optional prompt."},{name:"review",command:"/review",description:"Ask Codex to review the current working tree."},{name:"diff",command:"/diff",description:"Show the current Git diff, including untracked files."},{name:"status",command:"/status",description:"Show session configuration and token usage."},{name:"mcp",command:"/mcp",description:"List configured MCP tools for this session."},{name:"mention",command:"/mention",description:"Attach a file or folder to the conversation."},{name:"apps",command:"/apps",description:"Browse available apps and connectors."},{name:"plugins",command:"/plugins",description:"Browse and manage installed plugins."},{name:"agent",command:"/agent",description:"Switch to another agent thread."},{name:"personality",command:"/personality",description:"Change Codex response style for the current thread."},{name:"compact",command:"/compact",description:"Summarize the conversation to free tokens."},{name:"clear",command:"/clear",description:"Clear the terminal and start a fresh chat."},{name:"new",command:"/new",description:"Start a new conversation in the current session."},{name:"copy",command:"/copy",description:"Copy the latest completed Codex output."},{name:"fork",command:"/fork",description:"Fork the current conversation into a new thread."},{name:"resume",command:"/resume",description:"Resume a previous conversation."},{name:"quit",command:"/quit",description:"Exit the CLI."},{name:"exit",command:"/exit",description:"Exit the CLI."}];function S8n(e){return e==="codex"?x8n:p7e}function v8n(e,t,n){const r=e.filter(o=>Iwe(o.rootKind,n)),s=t.filter(o=>Iwe(o.rootKind,n));if(n!=="codex")return[...r,...s];const i=o=>o.rootKind==="codex";return[...r.filter(i),...r.filter(o=>!i(o)),...s.filter(i),...s.filter(o=>!i(o))]}function T8n(e,t,n,r){const s=new Set(e.map(c=>c.name.trim().toLowerCase())),i=e.map(c=>({id:`command:${c.name}`,name:c.name,command:c.command,description:c.description,subtitle:c.description,type:"command"})),o=new Set,a=[];for(const c of v8n(t,n,r)){const l=c.folderName.trim().toLowerCase();!c.isValid||!l||!XRn(l)||s.has(l)||o.has(l)||(o.add(l),a.push({id:`skill:${c.id}`,name:c.folderName,command:`/${l}`,description:c.description,subtitle:`${c.scope==="project"?"Project skill":"Personal skill"} - ${Jj(c.rootKind)}`,searchText:`${c.name} ${c.folderName}`,type:"skill"}))}return[...i,...a]}const c9=({teamName:e,members:t,layout:n="default",isTeamAlive:r,sending:s,sendError:i,sendWarning:o,sendDebugDetails:a,lastResult:c,sessions:l=[],selectedSessionKey:d=null,onSessionChange:p,textareaRef:f,onSend:h})=>{const m=g.useRef(null),O=g.useMemo(()=>Be=>{m.current=Be,typeof f=="function"?f(Be):f&&(f.current=Be)},[f]),[_,b]=g.useState(()=>t.find(jt=>Yn(jt))?.name??t[0]?.name??""),[y,x]=g.useState(!1),[S,v]=g.useState(""),T=g.useRef(null),[E,w]=g.useState(!1),P=g.useRef(0),k=g.useRef(null),[C,M]=g.useState(null),I=g.useRef(0),$=g.useRef(null),[R,N]=g.useState(!1);g.useEffect(()=>{if(_&&t.some(Nt=>Nt.name===_))return;const jt=t.find(Nt=>Yn(Nt))?.name??t[0]?.name??"";jt&&jt!==_&&queueMicrotask(()=>b(jt))},[t,_]);const j=le(Be=>Be.selectedTeamName===e?Be.selectedTeamData?.config.projectPath??null:null),Q=le(Be=>{if(Be.selectedTeamName!==e)return Yc(e).border;const jt=Be.selectedTeamData?.config.color;if(jt)return zr(jt).border;const Nt=Be.selectedTeamData?.config.name??e;return Yc(Nt).border}),U=le(Be=>My(Be,e)),A=y8n(e),V=g.useMemo(()=>l.find(Be=>Be.sessionKey===d)??null,[d,l]),z=V?.chatName||V?.title||V?.userName||V?.sessionKey||"选择会话",L=g.useMemo(()=>Zi(t),[t]),q=g.useMemo(()=>t.map(Be=>({id:Be.name,name:Be.name,subtitle:Js(Be.role)??Js(Be.agentType)??void 0,color:L.get(Be.name)})),[t,L]),Y=g.useMemo(()=>{const Be=t.find(jt=>Yn(jt));return xa(Be?.providerId)??Eg(Be?.model)},[t]),{suggestions:ne}=AN(e),{suggestions:te}=Gy(e),G=le(Et(Be=>j?Be.skillsProjectCatalogByProjectPath[j]??[]:[])),Z=le(Et(Be=>Be.skillsUserCatalog)),oe=le(Be=>Be.fetchSkillsCatalog);g.useEffect(()=>{oe(j??void 0)},[oe,j]);const re=g.useMemo(()=>T8n(S8n(Y),G,Z,Y),[Y,G,Z]),se=Em(A.text).trim(),he=g.useMemo(()=>UT(se),[se]),Te=t.find(Be=>Be.name===_),ee=Te?L.get(Te.name):void 0,ye=Te?Yn(Te):!1,Oe=ye&&!!r,ie=Oe&&A.canAddMore,ge=Oe?void 0:ye?"团队在线时才能添加文件":"文件只能发送给团队负责人",J=A.attachments.length>0&&!Oe,F=he?A.attachments.length>0?"斜杠命令需要团队负责人在线,且不能与附件同时发送":ye?r?null:"斜杠命令需要团队负责人在线":"斜杠命令只能发送给团队负责人":null,W=_.length>0&&se.length>0&&se.length<=Zl&&!s&&!U&&!J&&!F,ue=g.useRef(!1),ae=g.useCallback(()=>{if(!W)return;$.current?.(),ue.current=!0;const Be=Yb(A.text,te),jt=FE(se,A.chips);h(_,jt,se,A.attachments.length>0?A.attachments:void 0,void 0,Be)},[W,_,se,h,A.attachments,A.chips,te]);g.useEffect(()=>{!s&&ue.current&&(ue.current=!1,!i&&a?.delivered!==!1&&A.clearDraft())},[s,i,a,A]);const{addFiles:ce}=A,H=g.useCallback(Be=>{const jt=Be.target;jt.files?.length&&ce(jt.files),jt.value=""},[ce]),pe=g.useCallback(()=>{M(ge??"Files can only be sent to the team lead"),window.clearTimeout(I.current),I.current=window.setTimeout(()=>{M(null)},4e3)},[ge]);g.useEffect(()=>{const Be=I;return()=>window.clearTimeout(Be.current)},[]);const Ee=g.useCallback(Be=>{Be.preventDefault(),P.current+=1,P.current===1&&w(!0)},[]),we=g.useCallback(Be=>{Be.preventDefault(),P.current-=1,P.current<=0&&(P.current=0,w(!1))},[]),$e=g.useCallback(Be=>{Be.preventDefault()},[]),{handleDrop:Ze}=A,lt=g.useCallback(Be=>{if(Be.preventDefault(),P.current=0,w(!1),!Oe){Be.dataTransfer?.files?.length&&pe();return}Ze(Be)},[Oe,Ze,pe]),{handlePaste:yt}=A,xt=g.useCallback(Be=>{if(!Oe){Array.from(Be.clipboardData.items).some(Nt=>Nt.kind==="file")&&(Be.preventDefault(),pe());return}yt(Be)},[Oe,yt,pe]),Ge=Zl-se.length,Pt=A.attachments.length>0||!!(A.attachmentError??C),Lt=!Pt,ct=n==="compact",_n=F?u.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-amber-500/10 px-1.5 py-0.5 text-[10px] text-amber-300",children:[u.jsx(jo,{size:10,className:"shrink-0"}),F]}):i?u.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-red-500/10 px-1.5 py-0.5 text-[10px] text-red-400",children:[u.jsx(jo,{size:10,className:"shrink-0"}),i]}):o?u.jsx(Ktt,{warning:o,debugDetails:a}):c?.deduplicated?u.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-amber-500/10 px-1.5 py-0.5 text-[10px] text-amber-300",children:[u.jsx(es,{size:10,className:"shrink-0"}),"已复用最近一次跨团队请求"]}):null;return u.jsxs("div",{className:at("relative",ct?"pb-1":"mb-1.5 pb-1.5"),role:"group",onDragEnter:Ee,onDragLeave:we,onDragOver:$e,onDrop:lt,onPaste:xt,children:[u.jsxs("div",{className:at(Lt?"mb-0":"mb-1",ct?"space-y-1.5":"space-y-2"),children:[u.jsxs("div",{className:"flex items-center gap-2",children:[ye?u.jsxs(u.Fragment,{children:[u.jsx("input",{ref:k,type:"file",accept:"*/*",multiple:!0,className:"hidden",onChange:H}),u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx("button",{type:"button",className:at("inline-flex shrink-0 items-center gap-1 rounded p-1 transition-colors",ie?"text-[var(--color-text-secondary)] hover:text-[var(--color-text)]":"text-[var(--color-text-muted)] opacity-40"),disabled:!ie,onClick:()=>k.current?.click(),children:u.jsx(cU,{size:14})})}),u.jsx(nt,{side:"top",children:r?A.canAddMore?"添加文件(支持粘贴或拖拽)":"已达到附件上限":"团队在线时才能添加文件"})]})]}):null,u.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[!r&&!U&&u.jsx("span",{className:"text-[10px]",style:{color:"var(--warning-text)"},children:"团队离线"}),u.jsxs("div",{className:at("mr-[15px] inline-flex items-center border text-xs transition-colors",Lt?"relative z-10 -mb-2 overflow-hidden rounded-b-none rounded-t-[1.35rem] border-b-0 bg-[var(--color-surface-raised)]":"rounded-full","border-[var(--color-border)]"),children:[u.jsxs(Wc,{open:R,onOpenChange:N,children:[u.jsx(Ku,{asChild:!0,children:u.jsxs("button",{type:"button",className:at("inline-flex items-center gap-1.5 border-r border-r-[var(--color-border)] px-2.5 py-1 text-xs transition-colors",Lt?"rounded-bl-none rounded-tl-[1.35rem]":"rounded-l-full","hover:bg-[var(--color-surface-raised)]"),children:[Q?u.jsx("span",{className:"inline-block size-2 shrink-0 rounded-full",style:{backgroundColor:Q}}):null,u.jsx("span",{className:"max-w-[120px] truncate text-[var(--color-text-secondary)]",children:z}),u.jsx(Dr,{size:12,className:"shrink-0 text-[var(--color-text-muted)]"})]})}),u.jsx(oc,{align:"end",className:"w-56 p-1.5",children:u.jsx("div",{className:"max-h-48 space-y-0.5 overflow-y-auto",children:l.length>0&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"px-2 py-1 text-[10px] font-medium uppercase tracking-wide text-[var(--color-text-muted)]",children:"会话"}),l.map(Be=>{const jt=d===Be.sessionKey,Nt=Be.chatName||Be.title||Be.userName||Be.sessionKey;return u.jsxs("button",{type:"button",className:at("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs transition-colors hover:bg-[var(--color-surface-raised)]",jt&&"bg-[var(--color-surface-raised)]"),onClick:()=>{p?.(Be.sessionKey),N(!1)},children:[u.jsx("span",{className:at("inline-block size-2 shrink-0 rounded-full",Be.live&&"animate-pulse"),style:{backgroundColor:Be.live?"#22c55e":Q}}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-[var(--color-text)]",children:Nt}),u.jsx("span",{className:"shrink-0 text-[10px] text-[var(--color-text-muted)]",children:Be.platform}),jt?u.jsx(es,{size:12,className:"ml-auto shrink-0 text-blue-400"}):null]},Be.sessionKey)})]})})})]}),u.jsxs(Wc,{open:y,onOpenChange:x,children:[u.jsx(Ku,{asChild:!0,children:u.jsxs("button",{type:"button",className:at("inline-flex items-center gap-1.5 px-2.5 py-1 text-xs transition-colors",Lt?"rounded-br-none rounded-tr-[1.35rem]":"rounded-r-full","hover:bg-[var(--color-surface-raised)]"),children:[_?u.jsx(Ur,{name:_,color:ee,size:"sm",hideAvatar:_==="user",disableHoverCard:!0}):u.jsx("span",{className:"text-[var(--color-text-muted)]",children:"选择..."}),u.jsx(Dr,{size:12,className:"shrink-0 text-[var(--color-text-muted)]"})]})}),u.jsxs(oc,{align:"end",className:"w-56 p-1.5",onOpenAutoFocus:Be=>{Be.preventDefault(),v(""),setTimeout(()=>T.current?.focus(),0)},children:[t.length>5&&u.jsxs("div",{className:"relative mb-1",children:[u.jsx($i,{size:12,className:"absolute left-2 top-1/2 -translate-y-1/2 text-[var(--color-text-muted)]"}),u.jsx("input",{ref:T,type:"text",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-surface)] py-1 pl-6 pr-2 text-xs text-[var(--color-text)] placeholder:text-[var(--color-text-muted)] focus:border-[var(--color-border-emphasis)] focus:outline-none",placeholder:"搜索...",value:S,onChange:Be=>v(Be.target.value)})]}),u.jsx("div",{className:"max-h-48 space-y-0.5 overflow-y-auto",children:(()=>{const Be=S.toLowerCase().trim(),jt=Be?t.filter(Zt=>Zt.name.toLowerCase().includes(Be)):t;return jt.length===0?u.jsx("div",{className:"px-2 py-3 text-center text-xs text-[var(--color-text-muted)]",children:"无匹配结果"}):[...jt].sort((Zt,je)=>{const tt=Yn(Zt)?1:0;return(Yn(je)?1:0)-tt}).map(Zt=>{const je=L.get(Zt.name),tt=Js(Zt.role)??Js(Zt.agentType),kt=Zt.name===_;return u.jsxs("button",{type:"button",className:at("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs transition-colors hover:bg-[var(--color-surface-raised)]",kt&&"bg-[var(--color-surface-raised)]"),onClick:()=>{b(Zt.name),x(!1),v("")},children:[u.jsx(Ur,{name:Zt.name,color:je,size:"sm",hideAvatar:Zt.name==="user",disableHoverCard:!0}),tt?u.jsx("span",{className:"shrink-0 text-[10px] text-[var(--color-text-muted)]",children:tt}):null,kt?u.jsx(es,{size:12,className:"ml-auto shrink-0 text-blue-400"}):null]},Zt.name)})})()})]})]})]})]})]}),Pt?u.jsx(Htt,{attachments:A.attachments,onRemove:A.removeAttachment,error:A.attachmentError??C,onDismissError:A.clearAttachmentError,disabled:J,disabledHint:"仅在团队在线且接收人为团队负责人时支持附件。请移除附件或切换接收人。"}):null]}),u.jsxs("div",{className:"relative",children:[u.jsx(Ztt,{active:E,rejected:!Oe,rejectionReason:ge}),u.jsx(Rm,{ref:O,id:`compose-${e}`,placeholder:U?"团队正在启动中... 消息将排队并在稍后投递到收件箱。":"输入消息...(回车发送,Shift+Enter 换行)",value:A.text,onValueChange:A.setText,suggestions:q,teamSuggestions:ne,taskSuggestions:te,commandSuggestions:re,chips:A.chips,onChipRemove:A.removeChip,projectPath:j,onFileChipInsert:A.addChip,onModEnter:ae,dismissMentionsRef:$,extraTips:g.useMemo(()=>[`Tips:你可以输入 "/" 来运行命令,如 ${re.filter(jt=>jt.type==="command").slice(0,6).map(jt=>jt.command).join("、")} 等。`],[re]),surfaceClassName:"message-composer-shell message-composer-orbit-surface bg-[var(--color-surface-raised)]",surfaceDecoration:"orbit-border",surfaceFadeColor:"var(--color-surface-raised)",className:"border-transparent shadow-none",minRows:1,maxRows:6,maxLength:Zl,disabled:s,hintText:void 0,showHint:!ct,cornerActionInset:"compact",cornerAction:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx("button",{type:"button",className:"inline-flex shrink-0 items-center rounded-full p-1.5 text-[var(--color-text-muted)] transition-colors hover:bg-[var(--color-surface-raised)] hover:text-[var(--color-text-secondary)]",onClick:()=>void K.openExternal("https://voicetext.site"),children:u.jsx(UIe,{size:14})})}),u.jsx(nt,{side:"top",children:"语音转文字"})]}),u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx("span",{className:"inline-flex",children:u.jsxs("button",{type:"button",className:"inline-flex shrink-0 items-center gap-1 rounded-full bg-blue-600 px-3 py-1.5 text-[11px] font-medium text-white shadow-sm transition-colors hover:bg-blue-500 disabled:cursor-not-allowed disabled:opacity-50",disabled:!W,onClick:ae,children:[u.jsx(dE,{size:12}),"发送"]})})}),F?u.jsx(nt,{side:"top",children:F}):U&&!s?u.jsx(nt,{side:"top",children:"团队启动期间暂不可发送"}):null]})]}),footerRight:ct?_n:u.jsxs("div",{className:"flex items-center gap-2",children:[_n,Ge<200?u.jsxs("span",{className:`text-[10px] ${Ge<100?"text-yellow-400":"text-[var(--color-text-muted)]"}`,children:["剩余 ",Ge," 字符"]}):null,A.isSaved?u.jsx("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:"已保存"}):null]})})]})]})};function E8n(e){const t=new Set;for(const n of e)n.from?.trim()&&t.add(n.from.trim());return Array.from(t).sort((n,r)=>n.localeCompare(r,void 0,{sensitivity:"base"}))}function w8n(e){const t=new Set;for(const n of e)n.to?.trim()&&t.add(n.to.trim());return Array.from(t).sort((n,r)=>n.localeCompare(r,void 0,{sensitivity:"base"}))}const k8n=({teamName:e,members:t,filter:n,messages:r,open:s,onOpenChange:i,onApply:o})=>{const[a,c]=g.useState({from:new Set,to:new Set,showNoise:!1});g.useEffect(()=>{if(s){const y={from:new Set(n.from),to:new Set(n.to),showNoise:!!n.showNoise};queueMicrotask(()=>c(y))}},[s,n.from,n.to,n.showNoise]);const l=g.useMemo(()=>Zi(t),[t]),d=g.useMemo(()=>E8n(r),[r]),p=g.useMemo(()=>w8n(r),[r]),f=(n.from.size>0?1:0)+(n.to.size>0?1:0),h=(a.from.size>0?1:0)+(a.to.size>0?1:0),m=y=>{c(x=>{const S=new Set(x.from);return S.has(y)?S.delete(y):S.add(y),{...x,from:S}})},O=y=>{c(x=>{const S=new Set(x.to);return S.has(y)?S.delete(y):S.add(y),{...x,to:S}})},_=()=>{o(a),i(!1)},b=()=>{const y={from:new Set,to:new Set,showNoise:!1};c(y),o(y)};return u.jsxs(Wc,{open:s,onOpenChange:i,children:[u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx(Ku,{asChild:!0,children:u.jsxs(Xe,{variant:"ghost",size:"sm",className:"relative h-7 px-2 text-[var(--color-text-muted)] hover:text-[var(--color-text)]","aria-label":"筛选消息",children:[u.jsx(lU,{size:14}),f>0&&u.jsx("span",{className:"absolute -right-1 -top-1 flex size-4 items-center justify-center rounded-full bg-blue-500 text-[10px] font-medium text-white",children:f})]})})}),u.jsx(nt,{side:"bottom",children:"筛选消息"})]}),u.jsxs(oc,{align:"end",className:"flex max-h-[70vh] w-72 flex-col p-0",children:[u.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[u.jsxs("div",{className:"border-b border-[var(--color-border)] p-3",children:[u.jsx("p",{className:"mb-2 text-[11px] font-medium uppercase tracking-wider text-[var(--color-text-muted)]",children:"发送方"}),u.jsx("div",{className:"space-y-1",children:d.length===0?u.jsx("p",{className:"text-xs italic text-[var(--color-text-muted)]",children:"暂无数据"}):d.map(y=>u.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded-md px-1 py-0.5 text-xs text-[var(--color-text-secondary)] hover:bg-[var(--color-surface-raised)]",children:[u.jsx(ni,{checked:a.from.has(y),onCheckedChange:()=>m(y)}),u.jsx(Ur,{name:y,color:l.get(y),teamName:e,size:"sm",hideAvatar:y==="user"})]},y))})]}),u.jsxs("div",{className:"border-b border-[var(--color-border)] p-3",children:[u.jsx("p",{className:"mb-2 text-[11px] font-medium uppercase tracking-wider text-[var(--color-text-muted)]",children:"接收方"}),u.jsx("div",{className:"space-y-1",children:p.length===0?u.jsx("p",{className:"text-xs italic text-[var(--color-text-muted)]",children:"暂无数据"}):p.map(y=>u.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded-md px-1 py-0.5 text-xs text-[var(--color-text-secondary)] hover:bg-[var(--color-surface-raised)]",children:[u.jsx(ni,{checked:a.to.has(y),onCheckedChange:()=>O(y)}),u.jsx(Ur,{name:y,color:l.get(y),teamName:e,size:"sm",hideAvatar:y==="user"})]},y))})]})]}),u.jsxs("div",{className:"shrink-0 border-t border-[var(--color-border)]",children:[u.jsx("div",{className:"border-b border-[var(--color-border)] p-3",children:u.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded-md px-1 py-0.5 text-xs text-[var(--color-text-secondary)] hover:bg-[var(--color-surface-raised)]",children:[u.jsx(ni,{checked:a.showNoise,onCheckedChange:()=>c(y=>({...y,showNoise:!y.showNoise}))}),u.jsx("span",{children:"显示状态更新(空闲/关闭)"})]})}),u.jsxs("div",{className:"flex justify-between gap-2 p-2",children:[u.jsx(Xe,{variant:"ghost",size:"sm",className:"h-7 px-2 text-[11px] text-[var(--color-text-muted)] hover:text-[var(--color-text)]",disabled:h===0&&!a.showNoise,onClick:b,children:"重置"}),u.jsx(Xe,{size:"sm",className:"h-7 px-3 text-[11px]",onClick:_,children:"保存"})]})]})]})]})},C8n=1e4;function zRe(e){if(typeof e!="string")return null;const t=e.trim();if(!t)return null;const n=t.indexOf(".");return n<=0?null:t.slice(0,n)}function R8n(e,t=Date.now()){if(!e||e.length===0)return[];const n=new Map,r=new Map,s=new Map,i=new Map;for(const d of e){const p=Date.parse(d.timestamp);if(Number.isFinite(p)){if(d.source==="cross_team_sent"){const f=zRe(d.to);if(!f)continue;if(d.conversationId){const h=s.get(d.conversationId);(!h||p>h.sentAtMs)&&s.set(d.conversationId,{teamName:f,sentAtMs:p,conversationId:d.conversationId})}else n.set(f,Math.max(n.get(f)??0,p));continue}if(d.source==="cross_team"){const f=zRe(d.from);if(!f)continue;d.conversationId?i.set(d.conversationId,Math.max(i.get(d.conversationId)??0,p)):r.set(f,Math.max(r.get(f)??0,p))}}}const o=d=>d>=t||t-d<=C8n,a=Array.from(s.values()).filter(({conversationId:d,sentAtMs:p})=>p>(i.get(d)??0)&&o(p)),c=new Set(a.map(d=>d.teamName)),l=Array.from(n.entries()).filter(([d])=>!c.has(d)).filter(([d,p])=>p>(r.get(d)??0)&&o(p)).map(([d,p])=>({teamName:d,sentAtMs:p})).sort((d,p)=>p.sentAtMs-d.sentAtMs);return[...a,...l].sort((d,p)=>p.sentAtMs-d.sentAtMs)}const P8n=({members:e,tasks:t,defaultCollapsed:n=!1,headerRight:r,onMemberClick:s,onTaskClick:i})=>{const{isLight:o}=Qs(),[a,c]=g.useState(n),l=Zi(e),d=ip(e),p=new Map(t.map(m=>[m.id,m])),f=[],h=new Set;for(const m of e){if(!m.currentTaskId)continue;const O=p.get(m.currentTaskId);O&&(O.reviewState==="approved"||O.status==="completed")||(h.add(m.name),f.push({member:m,task:O,taskId:m.currentTaskId,kind:"working"}))}for(const m of e){if(h.has(m.name))continue;const O=t.find(_=>_.reviewer===m.name&&(_.reviewState==="review"||_.kanbanColumn==="review"));O&&f.push({member:m,task:O,taskId:O.id,kind:"reviewing"})}return f.length===0?null:u.jsxs("div",{className:"mb-3 space-y-1.5",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3",children:[u.jsxs("button",{type:"button",className:"flex min-w-0 items-center gap-1.5 text-[10px] font-medium uppercase tracking-wide text-[var(--color-text-muted)] transition-colors hover:text-[var(--color-text-secondary)]",onClick:()=>c(m=>!m),"aria-label":a?"展开进行中任务":"收起进行中任务",children:[u.jsx(jn,{size:10,className:`shrink-0 transition-transform duration-150 ${a?"":"rotate-90"}`}),u.jsx("span",{children:"进行中"}),a&&u.jsx("span",{className:"rounded-full bg-[var(--color-surface-raised)] px-1.5 py-0.5 text-[10px] font-medium tabular-nums leading-none text-[var(--color-text-muted)]",children:f.length})]}),r?u.jsx("div",{className:"shrink-0",children:r}):null]}),!a&&f.map(({member:m,task:O,taskId:_,kind:b})=>{const y=zr(l.get(m.name)??""),x=Js(m.role??(m.agentType!=="general-purpose"?m.agentType:void 0)),S=b==="reviewing"?"bg-amber-400":"bg-emerald-400",v=b==="reviewing"?"bg-amber-500":"bg-emerald-500",T=b==="reviewing"?"reviewing":"working on";return u.jsx("article",{className:"activity-card-enter-animate overflow-hidden rounded-md",style:{backgroundColor:em,border:Tc,borderLeft:`3px solid ${y.border}`},children:u.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[u.jsxs("span",{className:"relative inline-flex shrink-0",children:[u.jsx("img",{src:d.get(m.name)??lo(m.name,24),alt:"",className:"size-5 rounded-full bg-[var(--color-surface-raised)]",loading:"lazy"}),u.jsxs("span",{className:"absolute -bottom-0.5 -right-0.5 flex size-2.5",children:[u.jsx("span",{className:`absolute inline-flex size-full animate-ping rounded-full ${S} opacity-70`}),u.jsx("span",{className:`relative inline-flex size-full rounded-full ${v}`})]})]}),s?u.jsx("button",{type:"button",className:"rounded px-1.5 py-0.5 text-[10px] font-medium tracking-wide transition-opacity hover:opacity-90 focus:outline-none focus:ring-1 focus:ring-[var(--color-border)]",style:{backgroundColor:ti(y,o),color:y.text,border:`1px solid ${y.border}40`},onClick:()=>s(m),children:ml(m.name)}):u.jsx("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-medium tracking-wide",style:{backgroundColor:ti(y,o),color:y.text,border:`1px solid ${y.border}40`},children:ml(m.name)}),x?u.jsx("span",{className:"text-[10px]",style:{color:Mt},children:x}):null,u.jsx("span",{className:"shrink-0 text-[10px]",style:{color:Mt},children:T}),O&&(i?u.jsxs("button",{type:"button",className:"min-w-0 flex-1 truncate rounded px-1.5 py-0.5 text-left text-[10px] font-medium text-[var(--color-text)] transition-opacity hover:opacity-90 focus:outline-none focus:ring-1 focus:ring-[var(--color-border)]",style:{border:`1px solid ${y.border}40`},onClick:()=>i(O),title:O.subject,children:[Gr(O)," ",O.subject]}):u.jsxs("span",{className:"min-w-0 flex-1 truncate px-1.5 py-0.5 text-[10px] font-medium text-[var(--color-text)]",style:{border:`1px solid ${y.border}40`},title:O.subject,children:[Gr(O)," ",O.subject]}))]})},`${m.name}-${_}`)})]})},$8n=({members:e,pendingRepliesByMember:t,pendingCrossTeamReplies:n=[],headerRight:r,onMemberClick:s})=>{const{isLight:i}=Qs(),o=le(Et(m=>m.pendingApprovals)),a=le(Et(m=>m.teamByName)),c=Zi(e),l=ip(e),d=Object.entries(t).map(([m,O])=>({kind:"member",member:e.find(_=>_.name===m)??null,name:m,sentAtMs:O})).filter(m=>!!m.member),p=n.map(m=>({kind:"team",teamName:m.teamName,sentAtMs:m.sentAtMs})),f=o.map(m=>({kind:"user",toolName:m.toolName,sentAtMs:new Date(m.receivedAt).getTime()})),h=[...d,...p,...f].sort((m,O)=>O.sentAtMs-m.sentAtMs);return h.length===0?null:u.jsxs("div",{className:"mb-3 space-y-1.5",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3",children:[u.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-[var(--color-text-muted)]",children:"Awaiting replies"}),r?u.jsx("div",{className:"shrink-0",children:r}):null]}),h.map(m=>{const O=mT(m.sentAtMs,{addSuffix:!0});if(m.kind==="member"){const{member:_}=m,b=zr(c.get(_.name)??""),y=Js(_.role??(_.agentType!=="general-purpose"?_.agentType:void 0)),x=vz(_.runtimeAdvisory,_.providerId),S=KUe(_.runtimeAdvisory,_.providerId),v=x!==null;return u.jsx("article",{className:"activity-card-enter-animate overflow-hidden rounded-md",style:{backgroundColor:em,border:Tc,borderLeft:`3px solid ${b.border}`},children:u.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[u.jsxs("span",{className:"relative inline-flex shrink-0",children:[u.jsx("img",{src:l.get(_.name)??lo(_.name,24),alt:"",className:"size-5 rounded-full bg-[var(--color-surface-raised)]",loading:"lazy"}),u.jsxs("span",{className:"absolute -bottom-0.5 -right-0.5 flex size-2.5",children:[u.jsx("span",{className:`absolute inline-flex size-full animate-ping rounded-full opacity-70 ${v?"bg-amber-400":"bg-emerald-400"}`}),u.jsx("span",{className:`relative inline-flex size-full rounded-full ${v?"bg-amber-500":"bg-emerald-500"}`})]})]}),s?u.jsx("button",{type:"button",className:"rounded px-1.5 py-0.5 text-[10px] font-medium tracking-wide transition-opacity hover:opacity-90 focus:outline-none focus:ring-1 focus:ring-[var(--color-border)]",style:{backgroundColor:ti(b,i),color:b.text,border:`1px solid ${b.border}40`},onClick:()=>s(_),title:"Open member",children:ml(_.name)}):u.jsx("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-medium tracking-wide",style:{backgroundColor:ti(b,i),color:b.text,border:`1px solid ${b.border}40`},children:ml(_.name)}),y?u.jsx("span",{className:"text-[10px]",style:{color:Mt},children:y}):null,u.jsx("span",{className:`min-w-0 flex-1 truncate text-[10px] ${v?"text-amber-300":""}`,style:v?void 0:{color:Mt},title:S??"Message sent, awaiting reply",children:x??"awaiting reply"}),v?u.jsx(Ht,{className:"size-3 shrink-0 animate-spin text-amber-400"}):null,u.jsx("span",{className:"shrink-0 text-[10px]",style:{color:Mt},children:O})]})},`pending-reply:${_.name}:${m.sentAtMs}`)}if(m.kind==="team"){const _=a[m.teamName]?.displayName||m.teamName,b=Yc(_,i);return u.jsx("article",{className:"activity-card-enter-animate overflow-hidden rounded-md",style:{backgroundColor:em,border:Tc,borderLeft:`3px solid ${b.border}`},children:u.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[u.jsxs("span",{className:"relative inline-flex shrink-0 items-center justify-center rounded-full bg-[var(--color-surface-raised)] p-1",children:[u.jsx(rc,{size:12,style:{color:b.border}}),u.jsxs("span",{className:"absolute -bottom-0.5 -right-0.5 flex size-2.5",children:[u.jsx("span",{className:"absolute inline-flex size-full animate-ping rounded-full bg-emerald-400 opacity-70"}),u.jsx("span",{className:"relative inline-flex size-full rounded-full bg-emerald-500"})]})]}),u.jsx("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-medium tracking-wide",style:{backgroundColor:ti(b,i),color:b.text,border:`1px solid ${b.border}40`},title:m.teamName,children:_}),u.jsx("span",{className:"text-[10px]",style:{color:Mt},children:"external team"}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-[10px]",style:{color:Mt},title:"Cross-team message sent, awaiting reply",children:"awaiting reply"}),u.jsx("span",{className:"shrink-0 text-[10px]",style:{color:Mt},children:O})]})},`pending-reply:team:${m.teamName}:${m.sentAtMs}`)}return u.jsx("article",{className:"activity-card-enter-animate overflow-hidden rounded-md",style:{backgroundColor:em,border:Tc,borderLeft:"3px solid var(--color-text-muted)"},children:u.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[u.jsxs("span",{className:"relative inline-flex shrink-0 items-center justify-center rounded-full bg-[var(--color-surface-raised)] p-1",children:[u.jsx(wht,{size:12,style:{color:"var(--color-text-muted)"}}),u.jsxs("span",{className:"absolute -bottom-0.5 -right-0.5 flex size-2.5",children:[u.jsx("span",{className:"absolute inline-flex size-full animate-ping rounded-full bg-amber-400 opacity-70"}),u.jsx("span",{className:"relative inline-flex size-full rounded-full bg-amber-500"})]})]}),u.jsx("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-medium tracking-wide",style:{backgroundColor:"var(--color-surface-raised)",color:"var(--color-text-secondary)",border:"1px solid var(--color-border-emphasis)"},children:"user"}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-[10px]",style:{color:Mt},title:`Tool approval: ${m.toolName}`,children:"awaiting approval"}),u.jsx("span",{className:"shrink-0 text-[10px]",style:{color:Mt},children:O})]})},`pending-reply:user:${m.sentAtMs}`)})]})},u9=({members:e,tasks:t,messages:n,pendingRepliesByMember:r,position:s,layout:i="overlay",onMemberClick:o,onTaskClick:a})=>{const[c,l]=g.useState(!1),[d,p]=g.useState(()=>Date.now()),f=g.useMemo(()=>R8n(n,d),[n,d]),h=g.useMemo(()=>Object.keys(r).some(x=>e.some(S=>S.name===x))||f.length>0,[e,r,f.length]),m=g.useMemo(()=>{const y=new Map(t.map(x=>[x.id,x]));return e.some(x=>{if(!x.currentTaskId)return!1;const S=y.get(x.currentTaskId);return!(S&&(S.reviewState==="approved"||S.status==="completed"))})},[e,t]),O=g.useMemo(()=>h?!0:m,[m,h]);if(g.useEffect(()=>{if(!O)return;const y=window.setInterval(()=>p(Date.now()),1e3);return()=>window.clearInterval(y)},[O]),!O)return null;const _=u.jsxs("button",{type:"button",className:"flex items-center gap-1 text-[10px] font-medium uppercase tracking-wide text-[var(--color-text-muted)] transition-colors hover:text-[var(--color-text-secondary)]",onClick:()=>l(y=>!y),"aria-label":c?"Expand status":"Collapse status",children:[u.jsx(jn,{size:12,className:`shrink-0 transition-transform duration-150 ${c?"":"rotate-90"}`}),"Status"]}),b=i==="flow"&&!c?_:null;return u.jsxs(u.Fragment,{children:[i==="overlay"?u.jsx("div",{className:"relative h-0",children:u.jsx("div",{className:"absolute -top-[19px] right-0 z-10",children:_})}):c?u.jsx("div",{className:"mb-2 flex justify-end",children:_}):null,!c&&u.jsxs("div",{className:i==="overlay"?"mt-5":"",children:[h?u.jsx($8n,{members:e,pendingRepliesByMember:r,pendingCrossTeamReplies:f,headerRight:b,onMemberClick:o}):null,u.jsx(P8n,{members:e,tasks:t,defaultCollapsed:s==="sidebar",headerRight:h?void 0:b,onMemberClick:o,onTaskClick:a})]})]})},N8n=40,HM=1,BRe=2,A8n=4,I8n=56;function M8n(e,t){if(Object.keys(e).length===0)return e;const n=new Map,r=new Map;for(const o of t){const a=Date.parse(o.timestamp);if(Number.isFinite(a)){if(o.from==="user"&&typeof o.to=="string"&&o.to.length>0&&o.source==="user_sent"){const c=n.get(o.to);(c==null||a>c)&&n.set(o.to,a);continue}if(o.to==="user"){const c=r.get(o.from);(c==null||a>c)&&r.set(o.from,a)}}}let s=!1;const i={};for(const[o,a]of Object.entries(e)){const c=r.get(o),d=n.get(o)??a;if(c!=null&&c>d){s=!0;continue}i[o]=a}return s?i:e}const Q8n=g.memo(function({teamName:t,position:n,onPositionChange:r,mountPoint:s,members:i,tasks:o,isTeamAlive:a,leadActivity:c,leadContextUpdatedAt:l,timeWindow:d,currentLeadSessionId:p,pendingRepliesByMember:f,onPendingReplyChange:h,onMemberClick:m,onTaskClick:O,onCreateTaskFromMessage:_,onReplyToMessage:b,onRestartTeam:y,onTaskIdClick:x,inlineScrollContainerRef:S,showPositionControls:v=!0}){const{sendTeamMessage:T,sendCrossTeamMessage:E,sendingMessage:w,sendMessageError:P,sendMessageWarning:k,sendMessageDebugDetails:C,lastSendMessageResult:M,teams:I,openTeamTab:$,messages:R,messagesState:N,loadOlderTeamMessages:j,refreshTeamMessagesHead:Q}=le(Et(Ve=>({sendTeamMessage:Ve.sendTeamMessage,sendCrossTeamMessage:Ve.sendCrossTeamMessage,sendingMessage:Ve.sendingMessage,sendMessageError:Ve.sendMessageError,sendMessageWarning:Ve.sendMessageWarning,sendMessageDebugDetails:Ve.sendMessageDebugDetails,lastSendMessageResult:Ve.lastSendMessageResult,teams:Ve.teams,openTeamTab:Ve.openTeamTab,messages:iz(Ve,t),messagesState:t?Ve.teamMessagesByName[t]:void 0,loadOlderTeamMessages:Ve.loadOlderTeamMessages,refreshTeamMessagesHead:Ve.refreshTeamMessagesHead}))),U=g.useRef(null),A=g.useCallback(async()=>{!N?.hasMore||N.loadingHead||N.loadingOlder||await j(t)},[j,N,t]);(N?.loadingHead??!1)||N?.loadingOlder;const V=N?.loadingOlder??!1,z=N?.hasMore??!1,L=R,q=L.length,Y=g.useRef(!1),ne=g.useRef(null),te=g.useRef(null),G=g.useRef(null),Z=g.useRef(null),oe=g.useRef(null),re=n==="inline"?S??null:n==="sidebar"?te:oe,se=g.useCallback(Ve=>{Ve>I8n||!z||N?.loadingHead||V||Y.current||(Y.current=!0,A())},[z,A,V,N?.loadingHead]);g.useEffect(()=>{V||(Y.current=!1)},[V]);const he=g.useMemo(()=>{if(re)return{scrollElementRef:re,observerRoot:re,scrollMargin:0,virtualizationEnabled:!0}},[re]),Te=g.useCallback(()=>{},[]),ee=g.useRef(jRe(t)),[ye,Oe]=g.useState(ee.current.messagesSearchQuery),[ie,ge]=g.useState(ee.current.messagesFilter),[J,F]=g.useState(ee.current.messagesFilterOpen),[W,ue]=g.useState(ee.current.messagesCollapsed),[ae,ce]=g.useState(ee.current.messagesSearchBarVisible),[H,pe]=g.useState(ee.current.expandedItemKey),[Ee,we]=g.useState([]),[$e,Ze]=g.useState(null),[lt,yt]=g.useState(!1),[xt,Ge]=g.useState(null),[Pt,Lt]=g.useState(ee.current.messagesScrollTop),[ct,_n]=g.useState(ee.current.bottomSheetSnapIndex),[Be,jt]=g.useState(196),[Nt,Zt]=g.useState(0);g.useEffect(()=>{ee.current=jRe(t),Oe(ee.current.messagesSearchQuery),ge(ee.current.messagesFilter),F(ee.current.messagesFilterOpen),ue(ee.current.messagesCollapsed),ce(ee.current.messagesSearchBarVisible),pe(ee.current.expandedItemKey),Lt(ee.current.messagesScrollTop),_n(ee.current.bottomSheetSnapIndex)},[t]),g.useEffect(()=>{let Ve=!1;return K.teams.getTeamSessions(t).then(zt=>{if(Ve)return;const wn=[...zt].sort((jr,Ws)=>new Date(Ws.updatedAt).getTime()-new Date(jr.updatedAt).getTime());we(wn),Ge(jr=>jr&&wn.some(Ws=>Ws.sessionKey===jr)?jr:wn[0]?.sessionKey??null)}).catch(()=>{Ve||(we([]),Ge(null))}),()=>{Ve=!0}},[t]);const je=g.useMemo(()=>Ee.find(Ve=>Ve.sessionKey===xt)??null,[xt,Ee]),tt=je?.platform==="hermit"||je?.sessionKey===`hermit:${t}:session`;g.useEffect(()=>{if(!je||tt){Ze(null),yt(!1);return}let Ve=!1;return yt(!0),K.teams.getSessionDetail(t,je.id,200).then(zt=>{Ve||Ze(zt)}).catch(()=>{Ve||Ze(null)}).finally(()=>{Ve||yt(!1)}),()=>{Ve=!0}},[tt,je,t]),g.useEffect(()=>{l8n(t,{messagesSearchQuery:ye,messagesFilter:ie,messagesFilterOpen:J,messagesCollapsed:W,messagesSearchBarVisible:ae,expandedItemKey:H,messagesScrollTop:Pt,bottomSheetSnapIndex:ct})},[t,ye,ie,J,W,ae,H,Pt,ct]),g.useEffect(()=>{const Ve=ie.from.size>0||ie.to.size>0;ae||ye.trim().length===0&&!Ve||ce(!0)},[ie.from,ie.to,ae,ye]),g.useEffect(()=>{if(t){if(L.length>0){U.current=null;return}N?.loadingHead||N?.loadingOlder||U.current!==t&&(U.current=t,Q(t).catch(()=>{}))}},[L.length,N?.loadingHead,N?.loadingOlder,Q,t]),g.useLayoutEffect(()=>{if(n!=="sidebar")return;const Ve=te.current;Ve&&(Ve.scrollTop=Pt)},[n,Pt]),g.useEffect(()=>{if(n==="sidebar")return;const Ve=n==="bottom-sheet"?oe.current:S?.current??null;if(!Ve)return;const zt=()=>{se(Ve.scrollTop)};return Ve.addEventListener("scroll",zt,{passive:!0}),zt(),()=>{Ve.removeEventListener("scroll",zt)}},[S,se,n]),g.useLayoutEffect(()=>{if(n!=="bottom-sheet"||typeof ResizeObserver>"u")return;const Ve=s instanceof HTMLElement?s:null,zt=[[Z.current,jt],[Ve,Zt]],wn=[];for(const[jr,Ws]of zt){if(!jr)continue;const Ie=()=>{const mn=Math.ceil(jr.getBoundingClientRect().height);mn>0&&Ws(mn)};Ie();const Ne=new ResizeObserver(()=>{Ie()});Ne.observe(jr),wn.push(Ne)}return()=>{wn.forEach(jr=>jr.disconnect())}},[n,s]);const kt=g.useMemo(()=>{const Ve=zt=>[...zt].sort((wn,jr)=>Date.parse(jr.timestamp)-Date.parse(wn.timestamp));return xt?je&&!tt?$e?[...$e.history].reverse().map((zt,wn)=>({messageId:`${$e.id}:${wn}:${zt.timestamp}`,from:zt.role==="user"?"user":$e.name||t,to:zt.role==="user"?$e.name||t:"user",text:zt.content,timestamp:zt.timestamp,read:!0,source:zt.role==="user"?"user_sent":"inbox",session:{id:$e.id,key:$e.sessionKey,platform:$e.platform,title:je.title||je.chatName||je.userName||je.sessionKey,chatName:je.chatName,userName:je.userName}})):[]:Ve(L.filter(zt=>zt.session?.key===xt)):[]},[L,tt,je,$e,xt,t]),en=g.useMemo(()=>Uee(kt,{timeWindow:d,filter:ie,searchQuery:ye}),[ie,ye,kt,d]),We=g.useMemo(()=>Uee(kt,{includePassiveIdlePeerSummariesWhenNoiseHidden:!0,timeWindow:d,filter:ie,searchQuery:ye}),[ie,ye,kt,d]),ut=g.useMemo(()=>L.filter(Ve=>Ve.messageKind!=="task_comment_notification"&&!n$n(typeof Ve.text=="string"?Ve.text:"")),[L]),Re=g.useMemo(()=>{if(!H)return null;if(!H.startsWith("thoughts-")){const zt=We.find(wn=>As(wn)===H);return zt?{type:"message",message:zt}:null}return BZe(We).find(zt=>zt.type==="lead-thoughts"&&_v(zt.group)===H)??null},[H,We]);g.useEffect(()=>{H&&Re===null&&pe(null)},[H,Re]);const xe=g.useCallback(Ve=>{pe(Ve)},[]),Fe=g.useCallback(Ve=>{Ve||pe(null)},[]),{readSet:et,markRead:Ye,markAllRead:vt}=Xle(t),{expandedSet:qt,toggle:Dt}=VGn(t),Bt=g.useMemo(()=>en.filter(Ve=>!Ve.read&&!et.has(As(Ve))).length,[en,et]),Kn=g.useCallback(Ve=>Ye(As(Ve)),[Ye]),En=g.useMemo(()=>({readSet:et,getMessageKey:As}),[et]),{teamNames:Jn,teamColorByName:ar}=Lle(I),ze=g.useCallback(()=>{const Ve=en.filter(zt=>!zt.read&&!et.has(As(zt))).map(zt=>As(zt));vt(Ve)},[en,et,vt]);g.useEffect(()=>{if(Object.keys(f).length===0)return;const Ve=M8n(f,ut);Ve!==f&&h(()=>Ve)},[h,f,ut]);const Pe=g.useCallback((Ve,zt,wn,jr,Ws,Ie)=>{const Ne=Date.now();h(mn=>({...mn,[Ve]:Ne})),T(t,{member:Ve,text:zt,summary:wn,attachments:jr,actionMode:Ws,taskRefs:Ie,sessionKey:xt&&xt!=="__unassigned__"?xt:void 0}).then(mn=>{mn?.runtimeDelivery?.attempted===!0&&mn.runtimeDelivery.delivered===!1&&h(er=>{if(er[Ve]!==Ne)return er;const oi={...er};return delete oi[Ve],oi})}).catch(()=>{h(mn=>{if(mn[Ve]!==Ne)return mn;const er={...mn};return delete er[Ve],er})})},[t,T,h,xt]);g.useCallback((Ve,zt,wn,jr,Ws)=>{E({fromTeam:t,fromMember:"user",toTeam:Ve,text:zt,taskRefs:Ws,actionMode:jr,summary:wn})},[t,E]);const _e=g.useCallback(()=>{r("inline")},[r]),ke=g.useCallback(()=>{r("sidebar")},[r]),de=g.useCallback(()=>{_n(BRe),r("bottom-sheet")},[r]),De=g.useCallback(Ve=>{_n(Ve),G.current?.snapTo(Ve)},[]),Ue=g.useCallback(()=>{if(ct===HM){De(BRe);return}De(HM)},[ct,De]),mt=g.useMemo(()=>{const Ve=Nt>0?Math.max(Nt-1,96):Number.POSITIVE_INFINITY,zt=Math.min(N8n,Ve),wn=Math.min(Math.max(zt+Be,zt+120),Ve),jr=Math.min(Math.max(Nt>0?Math.round(Nt*.58):520,wn+140),Ve);return[0,zt,wn,jr,1]},[Nt,Be]),St=g.useMemo(()=>Math.min(Math.max(ct,HM),A8n),[ct]),ht=u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1.5 rounded-md border border-[var(--color-border)] bg-transparent px-2 py-1",children:[u.jsx($i,{size:12,className:"shrink-0 text-[var(--color-text-muted)]"}),u.jsx("input",{type:"text",placeholder:"搜索...",value:ye,onChange:Ve=>Oe(Ve.target.value),onPointerDown:Ve=>Ve.stopPropagation(),onClick:Ve=>Ve.stopPropagation(),className:"min-w-0 flex-1 bg-transparent text-xs text-[var(--color-text)] placeholder:text-[var(--color-text-muted)] focus:outline-none"}),ye&&u.jsx("button",{type:"button",className:"shrink-0 rounded p-0.5 text-[var(--color-text-muted)] transition-colors hover:bg-[var(--color-surface-raised)] hover:text-[var(--color-text)]",onClick:()=>Oe(""),children:u.jsx(Ar,{size:14})})]}),u.jsx(k8n,{teamName:t,members:i,filter:ie,messages:kt,open:J,onOpenChange:F,onApply:ge})]}),Xt=u.jsxs("div",{className:"flex items-center gap-2",children:[ht,u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx(Xe,{variant:"ghost",size:"sm",className:"pointer-events-auto size-7 p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:Ve=>{Ve.stopPropagation(),ue(zt=>!zt)},children:W?u.jsx(Qk,{size:14}):u.jsx(R4,{size:14})})}),u.jsx(nt,{side:"bottom",children:W?"展开全部消息":"折叠全部消息"})]})]}),bn=u.jsxs("div",{className:"pb-14",children:[u.jsx(c9,{teamName:t,members:i,isTeamAlive:a,sending:w,sendError:P,sendWarning:k,sendDebugDetails:C,lastResult:M,sessions:Ee,selectedSessionKey:xt,onSessionChange:Ge,textareaRef:ne,onSend:Pe}),u.jsx(u9,{members:i,tasks:o,messages:kt,pendingRepliesByMember:f,layout:"flow",position:"inline",onMemberClick:m,onTaskClick:O}),u.jsx(a9,{messages:We,teamName:t,members:i,readState:En,allCollapsed:W,expandOverrides:qt,onToggleExpandOverride:Dt,currentLeadSessionId:p,isTeamAlive:a,leadActivity:c,leadContextUpdatedAt:l,teamNames:Jn,teamColorByName:ar,onTeamClick:$,onMemberClick:m,onCreateTaskFromMessage:void 0,onReplyToMessage:b,onMessageVisible:Kn,onRestartTeam:y,onTaskIdClick:x,onExpandItem:xe,onExpandContent:Te,viewport:he}),z&&u.jsx("div",{className:"flex justify-center py-2",children:u.jsxs("div",{className:"flex flex-col items-center gap-1",children:[u.jsx(Xe,{variant:"ghost",size:"sm",className:"text-xs text-text-muted","aria-busy":V,disabled:V,onClick:()=>void A(),children:"加载更早消息"}),u.jsxs("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:["已加载 ",q," 条"]})]})}),u.jsx(LC,{expandedItem:Re,open:H!==null,onOpenChange:Fe,teamName:t,members:i,onCreateTaskFromMessage:void 0,onReplyToMessage:b,onMemberClick:m,onTaskIdClick:x,onRestartTeam:y,teamNames:Jn,teamColorByName:ar,onTeamClick:$})]});if(n==="sidebar")return u.jsxs("div",{className:"flex size-full flex-col overflow-hidden bg-[var(--color-surface-sidebar)]",children:[u.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-[var(--color-border)] bg-[var(--color-surface-sidebar)] px-3 py-2",children:[u.jsx(ca,{size:14,className:"shrink-0 text-[var(--color-text-muted)]"}),u.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:"消息"}),en.length>0&&u.jsx(Ut,{variant:"secondary",className:"px-1.5 py-0.5 text-[10px] font-normal leading-none",children:en.length}),Bt>0&&u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsxs(Ut,{variant:"secondary",className:"bg-blue-500/20 px-1.5 py-0.5 text-[10px] font-normal leading-none text-blue-600 dark:text-blue-400",children:[Bt," 条新消息"]})}),u.jsxs(nt,{side:"bottom",children:[Bt," 条未读"]})]}),Bt>0&&u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx("button",{type:"button",className:"flex items-center gap-1 rounded-md px-1.5 py-1 text-[11px] text-blue-400 transition-colors hover:bg-blue-500/10",onClick:ze,children:u.jsx(gQ,{size:12})})}),u.jsx(nt,{side:"bottom",children:"全部标为已读"})]}),u.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx(Xe,{variant:"ghost",size:"sm",className:"size-7 p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:()=>ue(Ve=>!Ve),"aria-label":W?"展开全部消息":"折叠全部消息",children:W?u.jsx(Qk,{size:14}):u.jsx(R4,{size:14})})}),u.jsx(nt,{side:"bottom",children:W?"展开全部消息":"折叠全部消息"})]}),u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx(Xe,{variant:"ghost",size:"sm",className:"size-7 p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:()=>ce(Ve=>!Ve),"aria-label":ae?"隐藏消息搜索":"显示消息搜索",children:ae?u.jsx(Ar,{size:14}):u.jsx($i,{size:14})})}),u.jsx(nt,{side:"bottom",children:ae?"隐藏搜索":"搜索消息"})]}),u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx(Xe,{variant:"ghost",size:"sm",className:"size-7 p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:_e,"aria-label":"将消息移到页面内面板",children:u.jsx(BIe,{size:14})})}),u.jsx(nt,{side:"bottom",children:"移到页面内"})]})]})]}),ae&&u.jsx("div",{className:"shrink-0 border-b border-[var(--color-border)] px-3 py-1.5",children:ht}),u.jsxs("div",{ref:te,className:"min-h-0 min-w-0 flex-1 overflow-y-auto overflow-x-hidden pb-14 pr-3 pt-2",onScroll:Ve=>{const zt=Ve.currentTarget.scrollTop;Lt(zt),se(zt)},children:[u.jsxs("div",{className:"pl-3",children:[u.jsx(c9,{teamName:t,members:i,isTeamAlive:a,sending:w,sendError:P,sendWarning:k,sendDebugDetails:C,lastResult:M,sessions:Ee,selectedSessionKey:xt,onSessionChange:Ge,textareaRef:ne,onSend:Pe}),u.jsx(u9,{members:i,tasks:o,messages:kt,pendingRepliesByMember:f,layout:"flow",position:"sidebar",onMemberClick:m,onTaskClick:O})," "]}),u.jsx(a9,{messages:We,teamName:t,members:i,readState:En,allCollapsed:W,expandOverrides:qt,onToggleExpandOverride:Dt,currentLeadSessionId:p,isTeamAlive:a,leadActivity:c,leadContextUpdatedAt:l,teamNames:Jn,teamColorByName:ar,onTeamClick:$,onMemberClick:m,onCreateTaskFromMessage:void 0,onReplyToMessage:b,onMessageVisible:Kn,onRestartTeam:y,onTaskIdClick:x,onExpandItem:xe,onExpandContent:Te,viewport:he}),z&&u.jsx("div",{className:"flex justify-center py-2",children:u.jsxs("div",{className:"flex flex-col items-center gap-1",children:[u.jsx(Xe,{variant:"ghost",size:"sm",className:"text-xs text-text-muted","aria-busy":V,disabled:V,onClick:()=>void A(),children:"加载更早消息"}),u.jsxs("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:["已加载 ",q," 条"]})]})}),u.jsx(LC,{expandedItem:Re,open:H!==null,onOpenChange:Fe,teamName:t,members:i,onCreateTaskFromMessage:void 0,onReplyToMessage:b,onMemberClick:m,onTaskIdClick:x,onRestartTeam:y,teamNames:Jn,teamColorByName:ar,onTeamClick:$})]})]});if(n==="bottom-sheet"){if(!s)return u.jsx("div",{className:"hidden","aria-hidden":"true"});const Ve=St===HM;return u.jsx(Nw,{ref:G,isOpen:!0,onClose:_e,mountPoint:s,avoidKeyboard:!1,detent:"full",snapPoints:mt,initialSnap:St,onSnap:_n,disableDismiss:!0,disableScrollLocking:!0,style:{zIndex:30},className:"!pointer-events-none !absolute !inset-0",unstyled:!0,children:u.jsxs(Nw.Container,{unstyled:!0,className:"flex max-h-full w-full flex-col overflow-hidden rounded-t-[20px] border border-[var(--color-border)] bg-[var(--color-surface-sidebar)] shadow-[0_-18px_48px_rgba(0,0,0,0.35)]",children:[u.jsx(Nw.Header,{unstyled:!0,className:"shrink-0 cursor-grab select-none border-b border-[var(--color-border)] bg-[var(--color-surface-sidebar)] active:cursor-grabbing",children:u.jsxs("div",{className:"relative h-10 px-3",children:[u.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-1 flex justify-center",children:u.jsx(Nw.DragIndicator,{className:"!h-1 !w-9 cursor-grab !rounded-full active:cursor-grabbing",style:{backgroundColor:"color-mix(in srgb, var(--color-text-muted) 45%, transparent)"}})}),u.jsxs("div",{className:"flex h-full items-center gap-1.5",children:[u.jsx(ca,{size:13,className:"shrink-0 text-[var(--color-text-muted)]"}),u.jsx("span",{className:"text-[13px] font-medium text-[var(--color-text)]",children:"消息"}),en.length>0&&u.jsx(Ut,{variant:"secondary",className:"px-1 py-0 text-[9px] font-normal leading-none",children:en.length}),Bt>0&&u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsxs(Ut,{variant:"secondary",className:"bg-blue-500/20 px-1 py-0 text-[9px] font-normal leading-none text-blue-600 dark:text-blue-400",children:[Bt," 条新消息"]})}),u.jsxs(nt,{side:"top",children:[Bt," 条未读"]})]}),u.jsxs("div",{className:"ml-auto flex items-center gap-1",onPointerDown:zt=>zt.stopPropagation(),children:[Bt>0&&u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx(Xe,{variant:"ghost",size:"sm",className:"size-[22px] p-0 text-blue-400 hover:bg-blue-500/10 hover:text-blue-300",onClick:ze,"aria-label":"将全部消息标为已读",children:u.jsx(gQ,{size:13})})}),u.jsx(nt,{side:"top",children:"全部标为已读"})]}),u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx(Xe,{variant:"ghost",size:"sm",className:"size-[22px] p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:()=>ue(zt=>!zt),"aria-label":W?"展开全部消息":"折叠全部消息",children:W?u.jsx(Qk,{size:14}):u.jsx(R4,{size:14})})}),u.jsx(nt,{side:"top",children:W?"展开全部消息":"折叠全部消息"})]}),u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx(Xe,{variant:"ghost",size:"sm",className:"size-[22px] p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:()=>ce(zt=>!zt),"aria-label":ae?"隐藏消息搜索":"显示消息搜索",children:ae?u.jsx(Ar,{size:14}):u.jsx($i,{size:14})})}),u.jsx(nt,{side:"top",children:ae?"隐藏搜索":"搜索消息"})]}),u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx(Xe,{variant:"ghost",size:"sm",className:"size-[22px] p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:Ue,"aria-label":Ve?"展开底部消息面板":"折叠底部消息面板",children:Ve?u.jsx(jft,{size:14}):u.jsx(Dft,{size:14})})}),u.jsx(nt,{side:"top",children:Ve?"展开面板":"折叠面板"})]}),u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx(Xe,{variant:"ghost",size:"sm",className:"size-[22px] p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:_e,"aria-label":"将消息移到页面内面板",children:u.jsx(lpe,{size:14})})}),u.jsx(nt,{side:"top",children:"移到页面内"})]}),u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx(Xe,{variant:"ghost",size:"sm",className:"size-[22px] p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:ke,"aria-label":"将消息移到侧边栏",children:u.jsx(yH,{size:14})})}),u.jsx(nt,{side:"top",children:"移到侧边栏"})]})]})]})]})}),!Ve&&u.jsxs(Nw.Content,{className:"min-h-0 bg-[var(--color-surface-sidebar)]",scrollClassName:"flex min-h-full flex-col",scrollRef:oe,disableDrag:zt=>zt.scrollPosition!=="top",children:[u.jsxs("div",{ref:Z,className:"sticky top-0 z-[1] shrink-0 border-b border-[var(--color-border)] backdrop-blur",style:{backgroundColor:"var(--color-surface-sidebar)"},children:[ae&&u.jsx("div",{className:"border-b border-[var(--color-border)] px-3 py-2",children:ht}),u.jsx("div",{className:"p-3",children:u.jsx(c9,{teamName:t,layout:"compact",members:i,isTeamAlive:a,sending:w,sendError:P,sendWarning:k,sendDebugDetails:C,lastResult:M,sessions:Ee,selectedSessionKey:xt,onSessionChange:Ge,textareaRef:ne,onSend:Pe})})]}),u.jsx("div",{className:"shrink-0 px-3 pt-2",children:u.jsx(u9,{members:i,tasks:o,messages:kt,pendingRepliesByMember:f,layout:"flow",position:"inline",onMemberClick:m,onTaskClick:O})}),u.jsxs("div",{className:"flex-1 px-3 pb-4 pt-2",children:[u.jsx(a9,{messages:We,teamName:t,members:i,readState:En,allCollapsed:W,expandOverrides:qt,onToggleExpandOverride:Dt,currentLeadSessionId:p,isTeamAlive:a,leadActivity:c,leadContextUpdatedAt:l,teamNames:Jn,teamColorByName:ar,onTeamClick:$,onMemberClick:m,onCreateTaskFromMessage:void 0,onReplyToMessage:b,onMessageVisible:Kn,onRestartTeam:y,onTaskIdClick:x,onExpandItem:xe,onExpandContent:Te,viewport:he}),z&&u.jsx("div",{className:"flex justify-center py-2",children:u.jsxs("div",{className:"flex flex-col items-center gap-1",children:[u.jsx(Xe,{variant:"ghost",size:"sm",className:"text-xs text-text-muted","aria-busy":V,disabled:V,onClick:()=>void A(),children:"加载更早消息"}),u.jsxs("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:["已加载 ",q," 条"]})]})})]}),u.jsx(LC,{expandedItem:Re,open:H!==null,onOpenChange:Fe,teamName:t,members:i,onCreateTaskFromMessage:void 0,onReplyToMessage:b,onMemberClick:m,onTaskIdClick:x,onRestartTeam:y,teamNames:Jn,teamColorByName:ar,onTeamClick:$})]})]})})}return u.jsx(Vp,{sectionId:"messages",title:"消息",icon:u.jsx(ca,{size:14}),badge:en.length,secondaryBadge:en.length>0&&Bt>0?Bt:void 0,afterBadge:Bt>0?u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx("button",{type:"button",className:"pointer-events-auto flex items-center gap-1 rounded-md px-1.5 py-1 text-[11px] text-blue-400 transition-colors hover:bg-blue-500/10",onClick:Ve=>{Ve.stopPropagation(),ze()},children:u.jsx(gQ,{size:12})})}),u.jsx(nt,{side:"bottom",children:"全部标为已读"})]}):void 0,headerExtra:v?u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx(Xe,{variant:"ghost",size:"sm",className:"pointer-events-auto size-6 p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:Ve=>{Ve.stopPropagation(),de()},"aria-label":"将消息移到底部面板",children:u.jsx(lpe,{size:14})})}),u.jsx(nt,{side:"top",children:"移到底部面板"})]}),u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx(Xe,{variant:"ghost",size:"sm",className:"pointer-events-auto size-6 p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:Ve=>{Ve.stopPropagation(),ke()},"aria-label":"将消息移到侧边栏",children:u.jsx(yH,{size:14})})}),u.jsx(nt,{side:"top",children:"移到侧边栏"})]})]}):void 0,defaultOpen:!0,action:u.jsx("div",{className:"flex items-center gap-2 px-2",children:Xt}),children:bn})});function D8n(e){return e.ledgerSummary?.deletedInTask?"deleted":e.isNewFile||e.ledgerSummary?.createdInTask?"added":"modified"}const L8n=({open:e,onOpenChange:t,teamName:n,taskId:r,taskChangeRequestOptions:s})=>{const i=le(h=>h.changeSetLoading),o=le(h=>h.changeSetError),a=le(h=>h.activeChangeSet),c=le(h=>h.fetchTaskChanges),[l,d]=g.useState([]);g.useEffect(()=>{if(!e||!r){d([]);return}s&&c&&c(n,r,s)},[e,n,r,s,c]),g.useEffect(()=>{a?.files&&d(a.files)},[a]);const p=g.useCallback(()=>{t(!1)},[t]);if(!e)return null;const f=i&&l.length===0;return u.jsxs("div",{className:"fixed inset-0 z-50 flex flex-col bg-[var(--color-surface)]",children:[u.jsxs("div",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("h2",{className:"text-sm font-medium text-[var(--color-text)]",children:"变更查看"}),l.length>0&&u.jsxs("span",{className:"text-xs text-[var(--color-text-muted)]",children:[l.length," 个文件"]})]}),u.jsx("button",{onClick:p,className:"rounded-md p-1 text-[var(--color-text-muted)] hover:bg-[var(--color-surface-raised)] hover:text-[var(--color-text)]",children:u.jsx(Ar,{size:16})})]}),u.jsxs("div",{className:"flex-1 overflow-auto px-4 py-3",children:[f&&u.jsx("div",{className:"flex items-center justify-center py-12 text-[var(--color-text-muted)]",children:u.jsx("span",{className:"text-sm",children:"加载变更中..."})}),o&&u.jsx("div",{className:"mx-auto max-w-xl rounded-lg border border-red-500/20 bg-red-500/10 px-4 py-3 text-center",children:u.jsx("p",{className:"text-sm text-red-400",children:o})}),!f&&!o&&l.length>0&&u.jsx("div",{className:"space-y-1",children:l.map(h=>{const m=D8n(h);return u.jsxs("div",{className:m==="added"?"flex items-center gap-2 rounded-md bg-emerald-500/5 px-3 py-2 font-mono text-xs text-emerald-400":m==="deleted"?"flex items-center gap-2 rounded-md bg-red-500/5 px-3 py-2 font-mono text-xs text-red-400":"flex items-center gap-2 rounded-md bg-blue-500/5 px-3 py-2 font-mono text-xs text-blue-400",children:[u.jsx("span",{className:"w-12 shrink-0 text-center font-sans text-[10px] uppercase tracking-wide opacity-60",children:m}),u.jsx("span",{className:"min-w-0 truncate",children:h.filePath}),u.jsxs("span",{className:"ml-auto shrink-0 font-sans text-[var(--color-text-muted)]",children:["+",h.linesAdded," -",h.linesRemoved]})]},h.filePath)})}),!f&&!o&&l.length===0&&u.jsx("div",{className:"flex items-center justify-center py-12 text-[var(--color-text-muted)]",children:u.jsx("span",{className:"text-sm",children:"未记录文件变更"})})]})]})};function FRe(e){return mT(e,{addSuffix:!1}).replace(" seconds","s").replace(" second","s").replace(" minutes","m").replace(" minute","m").replace(" hours","h").replace(" hour","h").replace(" days","d").replace(" day","d").replace(" weeks","w").replace(" week","w").replace(" months","mo").replace(" month","mo").replace(" years","y").replace(" year","y")}function j8n(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n].name!==t[n].name||e[n].color!==t[n].color)return!1;return!0}function X8n(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1){const r=e[n],s=t[n];if(r.id!==s.id||r.port!==s.port||r.url!==s.url||r.label!==s.label||r.pid!==s.pid||r.registeredBy!==s.registeredBy||r.registeredAt!==s.registeredAt||r.stoppedAt!==s.stoppedAt)return!1}return!0}const U8n=g.memo(function({teamName:t,members:n,processes:r}){if(!t||r.length===0)return null;const s=new Map(n.map(o=>[o.name,o.color])),i=[...r].sort((o,a)=>{const c=!o.stoppedAt,l=!a.stoppedAt;return c!==l?c?-1:1:Date.parse(a.registeredAt)-Date.parse(o.registeredAt)});return u.jsx("div",{className:"space-y-0.5",children:i.map(o=>{const a=!o.stoppedAt,c=a?`${FRe(new Date(o.registeredAt))} 前`:`${FRe(new Date(o.stoppedAt))} 前停止`;return u.jsxs("div",{className:`flex items-center gap-2 rounded px-2 py-1.5 text-xs transition-colors hover:bg-[var(--color-surface-raised)] ${a?"":"opacity-50"}`,children:[u.jsxs("span",{className:"relative inline-flex size-2 shrink-0",title:a?"运行中":"已停止",children:[a&&u.jsx("span",{className:"absolute inline-flex size-full animate-ping rounded-full bg-emerald-400 opacity-50"}),u.jsx("span",{className:`relative inline-flex size-2 rounded-full ${a?"bg-emerald-400":"bg-zinc-500"}`})]}),u.jsx(Io,{size:12,className:"shrink-0 text-[var(--color-text-muted)]"}),u.jsx("span",{className:"min-w-0 truncate font-medium text-[var(--color-text)]",title:o.label,children:o.label}),(o.port!=null||o.url)&&u.jsxs("span",{className:"min-w-0 truncate text-[var(--color-text-secondary)]",children:[o.port!=null&&!o.url&&`:${o.port}`,o.url&&u.jsx("button",{type:"button",className:"text-[var(--color-text-secondary)] underline decoration-dotted underline-offset-2 transition-colors hover:text-blue-400",onClick:()=>void K.openExternal(o.url),title:o.url,children:o.url})]}),u.jsxs("span",{className:"ml-auto flex shrink-0 items-center gap-2",children:[a&&u.jsxs("button",{type:"button",className:"flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] text-red-400 transition-colors hover:bg-red-500/10",onClick:()=>void K.teams.killProcess(t,o.pid),title:"停止进程(SIGTERM)",children:[u.jsx(WIe,{size:8,className:"fill-current"}),"停止"]}),a&&o.url&&u.jsxs("button",{type:"button",className:"flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] text-blue-400 transition-colors hover:bg-blue-500/10",onClick:()=>void K.openExternal(o.url),title:"在浏览器中打开",children:[u.jsx(hf,{size:10}),"打开"]}),u.jsxs("span",{className:"font-mono text-[var(--color-text-muted)]",children:["PID",o.pid]}),o.registeredBy&&u.jsx(Ur,{name:o.registeredBy,color:s.get(o.registeredBy),teamName:t}),u.jsx("span",{className:"text-[var(--color-text-muted)]",children:c})]})]},o.id)})})},z8n);function z8n(e,t){return e.teamName===t.teamName&&j8n(e.members,t.members)&&X8n(e.processes,t.processes)}const ZM=g.memo(function({teamName:t}){return u.jsx(tKe,{teamName:t,surface:"flat",dismissible:!0,className:"mb-3"})});function Est(e){const{leadSessionId:t,projectId:n,sessionsLoading:r,knownSessions:s}=e;return!t||!n||r||s.length===0?!1:!s.some(i=>i.id===t)}function B8n(e){const{suppressionKey:t,currentKey:n}=e;return t===n&&Est(e)}const F8n=g.lazy(()=>Me(()=>import("./ProjectEditorOverlay-B-_Kp7vz.js"),__vite__mapDeps([61,1])).then(e=>({default:e.ProjectEditorOverlay}))),Y8n=1e4;function V8n(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){const r=e[n],s=t[n];if(r.name!==s.name||r.status!==s.status||r.currentTaskId!==s.currentTaskId||r.color!==s.color||r.agentType!==s.agentType||r.role!==s.role||r.workflow!==s.workflow||r.providerId!==s.providerId||r.model!==s.model||r.effort!==s.effort||r.cwd!==s.cwd||r.gitBranch!==s.gitBranch||r.removedAt!==s.removedAt||r.runtimeAdvisory?.kind!==s.runtimeAdvisory?.kind||r.runtimeAdvisory?.observedAt!==s.runtimeAdvisory?.observedAt||r.runtimeAdvisory?.retryUntil!==s.runtimeAdvisory?.retryUntil||r.runtimeAdvisory?.retryDelayMs!==s.runtimeAdvisory?.retryDelayMs||r.runtimeAdvisory?.reasonCode!==s.runtimeAdvisory?.reasonCode||r.runtimeAdvisory?.message!==s.runtimeAdvisory?.message)return!1}return!0}function q8n(e){const t=g.useMemo(()=>(e??[]).filter(r=>!r.removedAt),[e]),n=g.useRef(t);return V8n(n.current,t)||(n.current=t),n.current}function W8n(e,t){if(t.startsWith("#")){const r=t.slice(1);return e.filter(s=>s.id===r||s.displayId===r)}const n=t.toLowerCase();return e.filter(r=>r.id.toLowerCase().includes(n)||(r.displayId?.toLowerCase().includes(n)??!1)||r.subject.toLowerCase().includes(n)||(r.owner?.toLowerCase().includes(n)??!1))}const G8n=g.memo(function({teamName:t,onLaunch:n}){return u.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3 rounded-md border px-3 py-2",style:{backgroundColor:"var(--warning-bg)",borderColor:"var(--warning-border)",color:"var(--warning-text)"},children:[u.jsxs("span",{className:"flex items-center gap-1.5 text-xs",children:[u.jsx(qn,{size:14,className:"shrink-0"}),"团队离线中"]}),u.jsxs(Xe,{variant:"ghost",size:"sm",className:"h-7 shrink-0 gap-1 px-2 text-xs text-[var(--step-done-text)] hover:bg-[var(--step-done-bg)]",onClick:n,children:[u.jsx(Bv,{size:12}),"启动"]})]})});function H8n(e){if(!e)return;const t=new Map(Object.entries(e));return t.size>0?t:void 0}function Z8n(e){if(!e)return;const t=new Map(Object.entries(e));return t.size>0?t:void 0}const K8n=g.memo(function({teamName:t,isTeamProvisioning:n,isTeamAlive:r}){const{leadActivity:s,memberSpawnStatuses:i,memberSpawnSnapshot:o,fetchMemberSpawnStatuses:a}=le(Et(c=>({leadActivity:c.leadActivityByTeam[t],memberSpawnStatuses:c.memberSpawnStatusesByTeam[t],memberSpawnSnapshot:c.memberSpawnSnapshotsByTeam[t],fetchMemberSpawnStatuses:c.fetchMemberSpawnStatuses})));return g.useEffect(()=>{const c=y3n(i,o);if((n||c||i==null&&(r===!0||s==="active"||s==="idle"))&&a(t),!n&&!c)return;const d=window.setInterval(()=>{a(t)},b3n);return()=>{window.clearInterval(d)}},[a,r,n,s,o,i,t]),null}),J8n=15e3,e9n=g.memo(function({teamName:t,isTeamProvisioning:n,isTeamAlive:r,isThisTabActive:s}){const{leadActivity:i,fetchTeamAgentRuntime:o}=le(Et(a=>({leadActivity:a.leadActivityByTeam[t],fetchTeamAgentRuntime:a.fetchTeamAgentRuntime})));return g.useEffect(()=>{if(!s||!(n||r===!0||i==="active"||i==="idle"))return;o(t);const c=window.setInterval(()=>{o(t)},J8n);return()=>{window.clearInterval(c)}},[o,r,n,s,i,t]),null}),t9n=g.memo(function({teamName:t,tabId:n,projectId:r,leadSessionId:s,sessionHistoryKey:i,isThisTabActive:o,isTeamAlive:a,sessions:c,sessionsLoading:l}){const d=le(h=>h.fetchSessionDetail),p=g.useRef(null),f=g.useMemo(()=>`${t}:${r??""}:${s??""}:${i}`,[t,r,s,i]);return g.useEffect(()=>{p.current=null},[f]),g.useEffect(()=>{if(!o||!n||!r||!s)return;if(Est({leadSessionId:s,projectId:r,sessionsLoading:l,knownSessions:c})){p.current=f;return}const m=()=>{B8n({leadSessionId:s,projectId:r,sessionsLoading:l,knownSessions:c,suppressionKey:p.current,currentKey:f})||d(r,s,n,{silent:!0})};if(m(),!a)return;const O=window.setInterval(()=>{m()},1e4);return()=>window.clearInterval(O)},[d,a,o,s,f,r,c,l,n]),null}),n9n=g.memo(function({teamName:t,tabId:n,projectId:r,leadSessionId:s,fallbackProjectRoot:i}){const{leadTabData:o,leadContextSnapshot:a,isContextPanelVisible:c,selectedContextPhase:l,setContextPanelVisibleForTab:d,setSelectedContextPhaseForTab:p,fetchSessionDetail:f}=le(Et($=>({leadTabData:n?$.tabSessionData[n]??null:null,leadContextSnapshot:$.leadContextByTeam[t]??null,isContextPanelVisible:n?$.tabUIStates.get(n)?.showContextPanel??!1:!1,selectedContextPhase:n?$.tabUIStates.get(n)?.selectedContextPhase??null:null,setContextPanelVisibleForTab:$.setContextPanelVisibleForTab,setSelectedContextPhaseForTab:$.setSelectedContextPhaseForTab,fetchSessionDetail:$.fetchSessionDetail}))),[h,m]=g.useState(!1),O=g.useCallback($=>{n&&d(n,$)},[d,n]),_=g.useCallback($=>{n&&p(n,$)},[p,n]),b=o?.sessionDetail??null,y=o?.conversation??null,x=o?.sessionContextStats??null,S=o?.sessionPhaseInfo??null,v=o?.sessionDetailLoading??!1,T=!!(s&&b?.session?.id===s),E=g.useMemo(()=>{const $=b?.processes;if(!$||$.length===0)return;const R=$.reduce((N,j)=>N+(j.metrics.costUsd??0),0);return R>0?R:void 0},[b?.processes]),{allContextInjections:w,lastAssistantUsage:P,lastAssistantModelName:k}=g.useMemo(()=>{if(!T||!x||!y?.items.length)return{allContextInjections:[],lastAssistantUsage:null,lastAssistantModelName:void 0};const $=l;let R;if($!==null&&S){const V=S.phases.find(z=>z.phaseNumber===$);V&&(R=V.lastAIGroupId)}if(!R){const V=[...y.items].reverse().find(z=>z.type==="ai");if(V?.type!=="ai")return{allContextInjections:[],lastAssistantUsage:null,lastAssistantModelName:void 0};R=V.group.id}const j=x.get(R)?.accumulatedInjections??[];let Q=null,U;const A=y.items.find(V=>V.type==="ai"&&V.group.id===R);if(A?.type==="ai"){const V=A.group.responses||[];for(let z=V.length-1;z>=0;z--){const L=V[z];if(L.type==="assistant"&&L.usage){Q=L.usage,U=L.model;break}}}return{allContextInjections:j,lastAssistantUsage:Q,lastAssistantModelName:U}},[y,x,T,S,l]),C=g.useMemo(()=>Oce(w),[w]),M=g.useMemo(()=>Ett({usage:P,modelName:k,contextWindowTokens:a?.contextWindowTokens??null,visibleContextTokens:C}),[k,P,a?.contextWindowTokens,C]),I=g.useMemo(()=>{const $=M.contextUsedPercentOfContextWindow??a?.contextUsedPercent;return $==null?null:`${$.toFixed(1)}%`},[M.contextUsedPercentOfContextWindow,a?.contextUsedPercent]);return s?u.jsxs(u.Fragment,{children:[c&&u.jsx("div",{className:"w-80 shrink-0",children:T?u.jsx(vtt,{injections:w,onClose:()=>O(!1),projectRoot:b?.session?.projectPath??i,contextMetrics:M,sessionMetrics:b?.metrics,subagentCostUsd:E,phaseInfo:S??void 0,selectedPhase:l,onPhaseChange:_,side:"left"}):u.jsxs("div",{className:"flex h-full flex-col border-0 bg-[var(--color-surface)]",style:{backgroundColor:"var(--color-surface)"},children:[u.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--color-border)] px-3 py-2",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"上下文"}),u.jsx("p",{className:"text-[10px] text-[var(--color-text-muted)]",children:v?"加载中…":"暂无会话"})]}),u.jsx("button",{type:"button",className:"rounded p-1 text-[var(--color-text-muted)] transition-colors hover:bg-[var(--color-surface-raised)] hover:text-[var(--color-text)]",onClick:()=>O(!1),"aria-label":`关闭 ${t} 上下文面板`,children:"×"})]}),u.jsx("div",{className:"flex flex-1 items-center justify-center p-4",children:u.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:v?"正在加载上下文…":"打开团队负责人会话后可查看上下文。"})})]})}),u.jsx("div",{className:"pointer-events-none fixed bottom-4 z-20",style:{left:c?"calc(20rem + 1rem)":"1rem"},children:u.jsx("button",{onClick:()=>{O(!c),n&&r&&f(r,s,n,{silent:!0})},onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),className:"pointer-events-auto flex w-fit items-center gap-1 rounded-md px-2.5 py-1.5 text-xs shadow-lg backdrop-blur-md transition-colors",style:{backgroundColor:c?"var(--context-btn-active-bg)":h?"var(--context-btn-bg-hover)":"var(--context-btn-bg)",color:c?"var(--context-btn-active-text)":"var(--color-text-secondary)"},title:T?`会话:${s}`:v?"正在加载上下文…":s,children:I??"上下文"})})]}):null}),r9n=g.memo(function({teamName:t,...n}){const{leadActivity:r,progress:s,memberSpawnStatuses:i,memberSpawnSnapshot:o,runtimeSnapshot:a}=le(Et(f=>({leadActivity:f.leadActivityByTeam[t],progress:wf(f,t),memberSpawnStatuses:f.memberSpawnStatusesByTeam[t],memberSpawnSnapshot:f.memberSpawnSnapshotsByTeam[t],runtimeSnapshot:f.teamAgentRuntimeByTeam[t]}))),c=g.useMemo(()=>H8n(i),[i]),l=g.useMemo(()=>Z8n(a?.members),[a?.members]),d=a?.runId??o?.runId??s?.runId,p=g.useMemo(()=>s?.state!=="ready"?!1:kz(wz({members:n.members,memberSpawnStatuses:i,memberSpawnSnapshot:o})).hasMembersStillJoining,[o,i,s?.state,n.members]);return u.jsx(eYn,{...n,leadActivity:r,memberSpawnStatuses:c,memberRuntimeEntries:l,runtimeRunId:d,isLaunchSettling:p})}),s9n=g.memo(function({teamName:t,...n}){const{leadActivity:r,leadContextUpdatedAt:s}=le(Et(i=>({leadActivity:i.leadActivityByTeam[t],leadContextUpdatedAt:i.leadContextByTeam[t]?.updatedAt})));return u.jsx(Q8n,{...n,teamName:t,leadActivity:r,leadContextUpdatedAt:s})}),i9n=g.memo(function({teamName:t,member:n,...r}){const{leadActivity:s,liveMember:i,progress:o,launchMembers:a,memberSpawnStatuses:c,memberSpawnSnapshot:l,spawnEntry:d,runtimeRunId:p,runtimeEntry:f}=le(Et(m=>({leadActivity:m.leadActivityByTeam[t],liveMember:n?fXe(m,t,n.name):null,progress:wf(m,t),launchMembers:$se(m,t),memberSpawnStatuses:m.memberSpawnStatusesByTeam[t],memberSpawnSnapshot:m.memberSpawnSnapshotsByTeam[t],spawnEntry:n?m.memberSpawnStatusesByTeam[t]?.[n.name]:void 0,runtimeRunId:m.teamAgentRuntimeByTeam[t]?.runId??m.memberSpawnSnapshotsByTeam[t]?.runId??wf(m,t)?.runId,runtimeEntry:n?m.teamAgentRuntimeByTeam[t]?.members[n.name]:void 0}))),h=g.useMemo(()=>o?.state!=="ready"?!1:kz(wz({members:a,memberSpawnStatuses:c,memberSpawnSnapshot:l})).hasMembersStillJoining,[a,l,c,o?.state]);return u.jsx(jFn,{...r,teamName:t,member:i??n,isLaunchSettling:h,leadActivity:s,spawnEntry:d,runtimeEntry:f,runtimeRunId:p})}),o9n=({teamName:e,isPaneFocused:t=!1})=>{const{isLight:n}=Qs(),[r,s]=g.useState(null),[i,o]=g.useState(null),[a,c]=g.useState(null),[l,d]=g.useState(null),[p,f]=g.useState(()=>XRe(e)),[h,m]=g.useState({open:!1,defaultSubject:"",defaultDescription:"",defaultOwner:""}),[O,_]=g.useState(!1),[b,y]=g.useState(null),[x,S]=g.useState(!1),[v,T]=g.useState(!1),[E,w]=g.useState(null);g.useEffect(()=>{if(!v||!e)return;let be=!1;return(async()=>{try{const Ke=await K.teams.getSavedRequest(e);be||w(Ke??null)}catch{be||w(null)}})(),()=>{be=!0}},[v,e]);const[P,k]=g.useState({open:!1,mode:"launch"}),[C,M]=g.useState(!1),I=g.useRef(null),$=g.useRef(null),R=g.useRef(!1);g.useEffect(()=>{const be=I.current;be&&(C?be.setAttribute("inert",""):be.removeAttribute("inert"))},[C]),g.useEffect(()=>{const be=Sr=>{const{teamName:Bo,taskId:cc}=Sr.detail??{};if(Bo!==e||!ce)return;const Wf=ce.tasks.find(UB=>UB.id===cc);Wf&&o(Wf)},Ke=Sr=>{const{teamName:Bo,memberName:cc}=Sr.detail??{};Bo===e&&(L(cc),Y(void 0),te(void 0),j(!0))},Ft=Sr=>{const{teamName:Bo,memberName:cc,initialTab:Wf,initialActivityFilter:UB}=Sr.detail??{};if(Bo!==e||!ce)return;const lue=H.find(Zst=>Zst.name===cc);lue&&(c(lue),d({initialTab:Wf,initialActivityFilter:UB}))},ur=Sr=>{const{teamName:Bo,owner:cc}=Sr.detail??{};Bo===e&&za("","",cc??"")};window.addEventListener("graph:open-task",be),window.addEventListener("graph:send-message",Ke),window.addEventListener("graph:open-profile",Ft),window.addEventListener("graph:create-task",ur);const ir=Sr=>Bo=>{const{teamName:cc,taskId:Wf}=Bo.detail??{};cc!==e||!Wf||Sr(Wf)},rt=ir(Sr=>{(async()=>{try{const Bo=await Be(e,Sr);if(ce?.isAlive){const cc=ce.tasks.find(Wf=>Wf.id===Sr);try{Bo.notifiedOwner&&cc?.owner&&await K.teams.processSend(e,`Task ${Gr(cc)} "${cc.subject}" has started. Please begin working on it.`)}catch{}}}catch{}})()}),Qt=ir(Sr=>{(async()=>{try{await Ge(e,Sr,"completed")}catch{}})()}),dr=ir(Sr=>{(async()=>{try{await yt(e,Sr,{op:"set_column",column:"approved"})}catch{}})()}),yo=ir(Sr=>{(async()=>{try{await ct(e,Sr)}catch{}})()}),eu=ir(Sr=>{s(Sr)}),Km=ir(Sr=>{(async()=>{try{await Ge(e,Sr,"pending")}catch{}})()}),Jm=ir(Sr=>{(async()=>{try{await yt(e,Sr,{op:"remove"}),await Ge(e,Sr,"completed")}catch{}})()}),tu=ir(Sr=>zo(Sr));return window.addEventListener("graph:start-task",rt),window.addEventListener("graph:complete-task",Qt),window.addEventListener("graph:approve-task",dr),window.addEventListener("graph:request-review",yo),window.addEventListener("graph:request-changes",eu),window.addEventListener("graph:cancel-task",Km),window.addEventListener("graph:move-back-to-done",Jm),window.addEventListener("graph:delete-task",tu),()=>{window.removeEventListener("graph:open-task",be),window.removeEventListener("graph:send-message",Ke),window.removeEventListener("graph:open-profile",Ft),window.removeEventListener("graph:create-task",ur),window.removeEventListener("graph:start-task",rt),window.removeEventListener("graph:complete-task",Qt),window.removeEventListener("graph:approve-task",dr),window.removeEventListener("graph:request-review",yo),window.removeEventListener("graph:request-changes",eu),window.removeEventListener("graph:cancel-task",Km),window.removeEventListener("graph:move-back-to-done",Jm),window.removeEventListener("graph:delete-task",tu)}});const[N,j]=g.useState(!1),[Q,U]=g.useState(!1),[A,V]=g.useState(!1),[z,L]=g.useState(void 0),[q,Y]=g.useState(void 0),[ne,te]=g.useState(void 0),[G,Z]=g.useState(void 0),[oe,re]=g.useState({open:!1,mode:"task"}),[se,he]=g.useState([]),Te=P.open,[ee,ye]=g.useState([]),[Oe,ie]=g.useState(!1),[ge,J]=g.useState(null),[F,W]=g.useState({sessionId:null,selectedOwners:new Set,columns:new Set}),[ue,ae]=g.useState({field:"updatedAt"}),{data:ce,members:H,loading:pe,error:Ee,projects:we,repositoryGroups:$e,initTabUIState:Ze,selectTeam:lt,updateKanban:yt,updateKanbanColumnOrder:xt,updateTaskStatus:Ge,updateTaskOwner:Pt,sendTeamMessage:Lt,requestReview:ct,createTeamTask:_n,startTaskByUser:Be,deleteTeam:jt,openTeamsTab:Nt,closeTab:Zt,sendingMessage:je,sendMessageError:tt,sendMessageWarning:kt,sendMessageDebugDetails:en,lastSendMessageResult:We,reviewActionError:ut,restartMember:Re,skipMemberForLaunch:xe,removeMember:Fe,updateMemberRole:et,launchTeam:Ye,provisioningError:vt,clearProvisioningError:qt,isTeamProvisioning:Dt,refreshTeamData:Bt,refreshTeamMessagesHead:Kn,refreshMemberActivityMeta:En,syncTeamPendingReplyRefresh:Jn,kanbanFilterQuery:ar,clearKanbanFilter:ze,softDeleteTask:Pe,restoreTask:_e,fetchDeletedTasks:ke,deletedTasks:de,launchParams:De,selectReviewFile:Ue,pendingReviewRequest:mt,setPendingReviewRequest:St,teams:ht,fetchTeams:Xt}=le(Et(be=>({projects:be.projects,repositoryGroups:be.repositoryGroups,initTabUIState:be.initTabUIState,selectTeam:be.selectTeam,updateKanban:be.updateKanban,updateKanbanColumnOrder:be.updateKanbanColumnOrder,updateTaskStatus:be.updateTaskStatus,updateTaskOwner:be.updateTaskOwner,sendTeamMessage:be.sendTeamMessage,requestReview:be.requestReview,createTeamTask:be.createTeamTask,startTaskByUser:be.startTaskByUser,deleteTeam:be.deleteTeam,openTeamsTab:be.openTeamsTab,closeTab:be.closeTab,sendingMessage:be.sendingMessage,sendMessageError:be.sendMessageError,sendMessageWarning:be.sendMessageWarning,sendMessageDebugDetails:be.sendMessageDebugDetails,lastSendMessageResult:be.lastSendMessageResult,reviewActionError:be.reviewActionError,restartMember:be.restartMember,skipMemberForLaunch:be.skipMemberForLaunch,removeMember:be.removeMember,updateMemberRole:be.updateMemberRole,launchTeam:be.launchTeam,provisioningError:e?be.provisioningErrorByTeam[e]??null:null,clearProvisioningError:be.clearProvisioningError,isTeamProvisioning:e?My(be,e):!1,data:be.selectedTeamName===e?be.selectedTeamData:null,members:Sl(be,e),loading:be.selectedTeamName===e?be.selectedTeamLoading:!1,error:be.selectedTeamName===e?be.selectedTeamError:null,refreshTeamData:be.refreshTeamData,refreshTeamMessagesHead:be.refreshTeamMessagesHead,refreshMemberActivityMeta:be.refreshMemberActivityMeta,syncTeamPendingReplyRefresh:be.syncTeamPendingReplyRefresh,kanbanFilterQuery:be.kanbanFilterQuery,clearKanbanFilter:be.clearKanbanFilter,softDeleteTask:be.softDeleteTask,restoreTask:be.restoreTask,fetchDeletedTasks:be.fetchDeletedTasks,deletedTasks:be.deletedTasks,launchParams:e?be.launchParamsByTeam[e]:void 0,selectReviewFile:be.selectReviewFile,pendingReviewRequest:be.pendingReviewRequest,setPendingReviewRequest:be.setPendingReviewRequest,teams:be.teams,fetchTeams:be.fetchTeams}))),bn=x3(),Ve=le(be=>be.activeTabId),zt=bn?Ve===bn:!1,wn=g.useRef(!1),jr=g.useCallback(be=>{},[]);g.useEffect(()=>{bn&&Ze(bn)},[bn,Ze]),g.useEffect(()=>{f(XRe(e))},[e]),g.useEffect(()=>{c8n(e,p)},[p,e]),g.useEffect(()=>{const be=R.current;R.current=Dt,!be&&Dt&&$.current?.scrollIntoView({behavior:"smooth",block:"start"})},[Dt]);const[Ws,Ie]=g.useState(""),Ne=le(be=>be.editorPendingRevealFile);g.useEffect(()=>{Ne&&ce?.config.projectPath&&M(!0)},[Ne,ce?.config.projectPath]),g.useEffect(()=>{e&&(lt(e),ke(e))},[e,lt,ke]);const mn=ce?.teamName;g.useEffect(()=>{!zt||!e||pe||mn!=null&&mn!==e&&lt(e)},[zt,e,mn,pe,lt]),g.useEffect(()=>{const be=zt&&t,Ke=be&&!wn.current;wn.current=be,!(!Ke||!e)&&(async()=>{try{(await Kn(e)).feedChanged&&await En(e)}catch{}})()},[t,zt,En,Kn,e]),g.useEffect(()=>{if(!Te)return;let be=!1;const Ke=le.getState().teams;return(async()=>{try{const Ft=await K.teams.aliveList();if(be)return;const ur=new Set(Ft),ir=Ke.filter(rt=>ur.has(rt.teamName)&&rt.projectPath).map(rt=>({teamName:rt.teamName,displayName:rt.displayName,projectPath:rt.projectPath}));he(ir)}catch{}})(),()=>{be=!0}},[Te]),g.useEffect(()=>{ar&&(Ie(ar),ze())},[ar,ze]);const er=g.useMemo(()=>nDn(ce?.config.projectPath,we,$e),[we,$e,ce?.config.projectPath]),oi=ce?.config.leadSessionId??null,ai=g.useId(),Kc=g.useMemo(()=>(ce?.config.sessionHistory??[]).join("|"),[ce?.config.sessionHistory]);g.useEffect(()=>{const be=Object.keys(p).length>0;return Jn(e,ai,!!ce?.isAlive&&be,Y8n),()=>{Jn(e,ai,!1)}},[ce?.isAlive,p,ai,Jn,e]),g.useEffect(()=>{if(!er)return;let be=!1;return ie(!0),J(null),(async()=>{try{const Ke=await K.getSessions(er);be||ye(Ke)}catch(Ke){be||J(Ke instanceof Error?Ke.message:"加载会话失败")}finally{be||ie(!1)}})(),()=>{be=!0}},[er]);const cn=ce?.config.projectPath?.trim()??null,Pn=g.useMemo(()=>{const be=H.find(Ke=>Yn(Ke))?.cwd?.trim();return be&&be.length>0?be:cn},[H,cn]),An=g.useMemo(()=>{const be=new Map,Ke=Ft=>{const ur=Ft?.trim();if(!ur)return;const ir=fr(ur);!ir||be.has(ir)||be.set(ir,ur)};Ke(Pn);for(const Ft of H)Ke(Ft.cwd);return Array.from(be.values())},[H,Pn]);Ttt(An,{live:!0});const tr=le(Et(be=>Object.fromEntries(An.map(Ke=>{const Ft=fr(Ke);return[Ft,be.branchByPath[Ft]??null]})))),Br=Pn?tr[fr(Pn)]??null:null,lr=g.useMemo(()=>ce?H.map(be=>{const Ke=be.cwd?.trim(),Ft=Ke&&!Yn(be)&&Br!==null?(()=>{const ir=tr[fr(Ke)]??null;return ir&&ir!==Br?ir:void 0})():void 0;if(be.gitBranch===Ft)return be;const ur={...be};return Ft?ur.gitBranch=Ft:delete ur.gitBranch,ur}):[],[Br,H,tr]),xr=g.useMemo(()=>Zi(lr),[lr]),cr=g.useMemo(()=>{const be=new Set;if(ce?.config.leadSessionId&&be.add(ce.config.leadSessionId),ce?.config.sessionHistory)for(const Ke of ce.config.sessionHistory)be.add(Ke);return be},[ce?.config.leadSessionId,ce?.config.sessionHistory]),Ds=g.useMemo(()=>ee.filter(be=>cr.has(be.id)),[ee,cr]);g.useEffect(()=>{F.sessionId!==null&&!Ds.some(be=>be.id===F.sessionId)&&W(be=>({...be,sessionId:null}))},[F.sessionId,Ds]);const Ki=g.useMemo(()=>{if(F.sessionId===null)return null;const be=[...Ds].sort((ir,rt)=>ir.createdAt-rt.createdAt),Ke=be.findIndex(ir=>ir.id===F.sessionId);if(Ke===-1)return null;const Ft=be[Ke].createdAt,ur=Ke+1<be.length?be[Ke+1].createdAt:1/0;return{start:Ft,end:ur}},[F.sessionId,Ds]),hi=g.useMemo(()=>{if(!ce)return[];let be=ce.tasks;return Ki&&(be=be.filter(Ke=>{if(!Ke.createdAt)return!0;const Ft=new Date(Ke.createdAt).getTime();return Ft>=Ki.start&&Ft<Ki.end})),F.selectedOwners.size>0&&(be=be.filter(Ke=>Ke.owner?F.selectedOwners.has(Ke.owner):F.selectedOwners.has(Xee))),be},[ce,Ki,F.selectedOwners]),Ua=q8n(lr),fp=g.useMemo(()=>{const be=Ws.trim();return be?W8n(hi,be):hi},[hi,Ws]),Yf=g.useMemo(()=>Ua.filter(be=>!Yn(be)).length,[Ua]),Uo=g.useMemo(()=>new Map((ce?.tasks??[]).map(be=>[be.id,be])),[ce?.tasks]),hp=g.useRef(Uo);hp.current=Uo;const M_=g.useMemo(()=>Hxt(ce?.tasks??[]),[ce?.tasks]),za=g.useCallback((be="",Ke="",Ft="",ur)=>{m({open:!0,defaultSubject:be,defaultDescription:Ke,defaultOwner:Ft,defaultStartImmediately:ur})},[]),Q_=g.useCallback(()=>{m({open:!1,defaultSubject:"",defaultDescription:"",defaultOwner:"",defaultStartImmediately:void 0})},[]),D_=g.useCallback((be,Ke)=>{za(be,Ke)},[]),Fr=g.useCallback(be=>{L(be.from),Y(void 0),te(void 0),Z({from:be.from,text:Ea(be.text)}),j(!0)},[]),sd=g.useCallback(be=>{k({open:!0,mode:be})},[]),Gm=g.useCallback(()=>{k(be=>({...be,open:!1}))},[]),Vf=g.useCallback(()=>{sd("relaunch")},[sd]),Hm=g.useCallback(async be=>{await Ye(be),await Promise.all([Xt(),lt(e)])},[Xt,Ye,lt,e]),Jc=g.useCallback(async(be,Ke)=>{await L4n({teamName:e,isTeamAlive:ce?.isAlive===!0,request:be,members:Ke,stopTeam:Ft=>K.teams.stop(Ft),replaceMembers:(Ft,ur)=>K.teams.replaceMembers(Ft,ur),launchTeam:Ye}),await Promise.all([Xt(),lt(e)])},[ce?.isAlive,Xt,Ye,lt,e]),Jy=g.useCallback(async()=>{if(!ce?.config.projectPath)throw new Error("团队缺少项目路径,无法自动重启。");await K.teams.stop(e),await Ye({teamName:e,cwd:ce.config.projectPath}),await Promise.all([Xt(),lt(e)])},[ce?.config.projectPath,Xt,Ye,lt,e]),i1=g.useCallback(async be=>{if(!ce?.config.projectPath)throw new Error("团队缺少项目路径,无法自动重启。");await K.teams.stop(e);const Ke={teamName:e,cwd:ce.config.projectPath,providerId:be.providerId,model:be.model,effort:be.effort,fastMode:be.fastMode,clearContext:be.clearContext};await Ye(Ke)},[ce?.config.projectPath,Ye,e]),o1=g.useCallback(async be=>{await Re(e,be)},[Re,e]),eA=g.useCallback(async be=>{await xe(e,be)},[xe,e]),a1=g.useCallback(be=>{c(be),d(null)},[]),Zm=g.useCallback(()=>{c(null),d(null)},[]),ex=g.useCallback(be=>{L(be.name),Y(void 0),te(void 0),Z(void 0),j(!0)},[]),qf=g.useCallback(be=>{za("","",be.name)},[za]),tx=g.useCallback(be=>{const Ke=hp.current.get(be);Ke&&o(Ke)},[]),tA=g.useCallback(be=>{o(be)},[]),nA=g.useCallback(be=>{const Ke=Uo.get(be)??ce?.tasks.find(Ft=>Ft.displayId===be);Ke&&o(Ke)},[Uo,ce?.tasks]),rA=g.useCallback(be=>{const Ke=GJ(be,[])??void 0;be.type==="sendMessage"?(Y(Ke?void 0:be.formattedContext),te(Ke),L(void 0),Z(void 0),j(!0)):be.type==="createTask"&&(Ke?m({open:!0,defaultSubject:"",defaultDescription:"",defaultOwner:"",defaultStartImmediately:void 0,defaultChip:Ke}):za("",be.formattedContext))},[]);g.useEffect(()=>{mt&&(re({open:!0,mode:"task",taskId:mt.taskId,initialFilePath:mt.filePath,taskChangeRequestOptions:mt.requestOptions}),mt.filePath&&Ue(mt.filePath),St(null))},[mt,Ue,St]);const nx=le(be=>be.pendingMemberProfile);g.useEffect(()=>{if(!nx||!ce)return;const be=lr.find(Ke=>Ke.name===nx);be&&(c(be),d(null)),le.getState().closeMemberProfile()},[nx,lr]);const zo=g.useCallback(be=>{(async()=>{if(await Md({title:"删除任务",message:`将任务 #${to(be)} 移入废纸篓?`,confirmLabel:"删除",cancelLabel:"取消",variant:"danger"}))try{await Pe(e,be)}catch{}})()},[e,Pe]),L_=g.useCallback(be=>{const Ke=Uo.get(be);re({open:!0,mode:"task",taskId:be,taskChangeRequestOptions:Ke?Fc(Ke):{}})},[Uo]),QB=g.useCallback((be,Ke)=>{const Ft=Uo.get(be);re({open:!0,mode:"task",taskId:be,initialFilePath:Ke,taskChangeRequestOptions:Ft?Fc(Ft):{}}),Ke&&Ue(Ke)},[Ue,Uo]),sA=g.useCallback(()=>{U(!0)},[]),DB=g.useCallback(()=>{U(!1),(async()=>{try{(await jt(e)).restartRequired&&await Md({title:"需要重启 cc-connect",message:"已调用 cc-connect 删除团队配置。cc-connect 需要重启后才会真正移除该团队并停止相关运行时。",confirmLabel:"立即重启",cancelLabel:"稍后重启",variant:"danger"})&&await K.ccSettings.restart(),bn&&Zt(bn),Nt()}catch{}})()},[e,jt,Nt,Zt,bn]),LB=(be,Ke,Ft,ur,ir,rt,Qt,dr,yo)=>{_(!0),(async()=>{try{if(await _n(e,{subject:be,description:Ke||void 0,owner:Ft,blockedBy:ur,related:ir,prompt:rt,descriptionTaskRefs:dr,promptTaskRefs:yo,startImmediately:Qt}),rt&&Ft&&ce?.isAlive&&!Dt&&Qt!==!1){const eu=`New task assigned to ${Ft}: "${be}". Instructions:
1829
+ `,ee=O.current;M(ee?Te+ee:Te)}if(te.length===0)return;let Z=0;for(const Te of te){const ee=o7e(Te);if(!ee.valid){c(ee.error);return}Z+=Te.size}const oe=[];for(const Te of te)try{const ee=await a7e(Te);oe.push(ee)}catch{c(`读取文件失败:${Te.name}`);return}const re=b.current;if(re.length+oe.length>og){c(`最多允许添加 ${og} 个附件`);return}if(re.reduce((Te,ee)=>Te+ee.size,0)+Z>gv){c("附件总大小超过 20MB 限制");return}const he=[...re,...oe];b.current=he,o(he),f(!1),k()},[k,M]),U=g.useCallback(Y=>{v.current=!0;const ne=b.current.filter(te=>te.id!==Y);b.current=ne,o(ne),c(null),f(!1),k()},[k]),A=g.useCallback(()=>{v.current=!0,b.current=[],o([]),c(null),f(!1),k()},[k]),V=g.useCallback(()=>{c(null)},[]),z=g.useCallback(Y=>{const ne=Y.clipboardData?.items;if(!ne)return;const te=[];for(const G of Array.from(ne))if(G.kind==="file"){const Z=G.getAsFile();Z&&te.push(Z)}te.length>0&&(Y.preventDefault(),Q(te))},[Q]),L=g.useCallback(Y=>{Y.preventDefault();const ne=Y.dataTransfer?.files;ne?.length&&Q(Array.from(ne))},[Q]),q=g.useCallback(()=>{T.current!=null&&(clearTimeout(T.current),T.current=null),E.current=null,O.current="",_.current=[],b.current=[],n(""),s([]),o([]),c(null),f(!1),hO.deleteSnapshot(x.current)},[]);return{text:t,setText:M,chips:r,addChip:I,removeChip:$,attachments:i,attachmentError:a,canAddMore:j,addFiles:Q,removeAttachment:U,clearAttachments:A,clearAttachmentError:V,handlePaste:z,handleDrop:L,actionMode:l,setActionMode:R,isSaved:p,isLoaded:h,clearDraft:q}}const x8n=[{name:"model",command:"/model",description:"Choose the active model for this session."},{name:"fast",command:"/fast",description:"Toggle Fast mode on or off."},{name:"permissions",command:"/permissions",description:"Adjust approval requirements for tools and commands."},{name:"plan",command:"/plan",description:"Switch to plan mode with an optional prompt."},{name:"review",command:"/review",description:"Ask Codex to review the current working tree."},{name:"diff",command:"/diff",description:"Show the current Git diff, including untracked files."},{name:"status",command:"/status",description:"Show session configuration and token usage."},{name:"mcp",command:"/mcp",description:"List configured MCP tools for this session."},{name:"mention",command:"/mention",description:"Attach a file or folder to the conversation."},{name:"apps",command:"/apps",description:"Browse available apps and connectors."},{name:"plugins",command:"/plugins",description:"Browse and manage installed plugins."},{name:"agent",command:"/agent",description:"Switch to another agent thread."},{name:"personality",command:"/personality",description:"Change Codex response style for the current thread."},{name:"compact",command:"/compact",description:"Summarize the conversation to free tokens."},{name:"clear",command:"/clear",description:"Clear the terminal and start a fresh chat."},{name:"new",command:"/new",description:"Start a new conversation in the current session."},{name:"copy",command:"/copy",description:"Copy the latest completed Codex output."},{name:"fork",command:"/fork",description:"Fork the current conversation into a new thread."},{name:"resume",command:"/resume",description:"Resume a previous conversation."},{name:"quit",command:"/quit",description:"Exit the CLI."},{name:"exit",command:"/exit",description:"Exit the CLI."}];function S8n(e){return e==="codex"?x8n:p7e}function v8n(e,t,n){const r=e.filter(o=>Iwe(o.rootKind,n)),s=t.filter(o=>Iwe(o.rootKind,n));if(n!=="codex")return[...r,...s];const i=o=>o.rootKind==="codex";return[...r.filter(i),...r.filter(o=>!i(o)),...s.filter(i),...s.filter(o=>!i(o))]}function T8n(e,t,n,r){const s=new Set(e.map(c=>c.name.trim().toLowerCase())),i=e.map(c=>({id:`command:${c.name}`,name:c.name,command:c.command,description:c.description,subtitle:c.description,type:"command"})),o=new Set,a=[];for(const c of v8n(t,n,r)){const l=c.folderName.trim().toLowerCase();!c.isValid||!l||!XRn(l)||s.has(l)||o.has(l)||(o.add(l),a.push({id:`skill:${c.id}`,name:c.folderName,command:`/${l}`,description:c.description,subtitle:`${c.scope==="project"?"Project skill":"Personal skill"} - ${Jj(c.rootKind)}`,searchText:`${c.name} ${c.folderName}`,type:"skill"}))}return[...i,...a]}const c9=({teamName:e,members:t,layout:n="default",isTeamAlive:r,sending:s,sendError:i,sendWarning:o,sendDebugDetails:a,lastResult:c,sessions:l=[],selectedSessionKey:d=null,onSessionChange:p,textareaRef:f,onSend:h})=>{const m=g.useRef(null),O=g.useMemo(()=>Be=>{m.current=Be,typeof f=="function"?f(Be):f&&(f.current=Be)},[f]),[_,b]=g.useState(()=>t.find(jt=>Yn(jt))?.name??t[0]?.name??""),[y,x]=g.useState(!1),[S,v]=g.useState(""),T=g.useRef(null),[E,w]=g.useState(!1),P=g.useRef(0),k=g.useRef(null),[C,M]=g.useState(null),I=g.useRef(0),$=g.useRef(null),[R,N]=g.useState(!1);g.useEffect(()=>{if(_&&t.some(Nt=>Nt.name===_))return;const jt=t.find(Nt=>Yn(Nt))?.name??t[0]?.name??"";jt&&jt!==_&&queueMicrotask(()=>b(jt))},[t,_]);const j=le(Be=>Be.selectedTeamName===e?Be.selectedTeamData?.config.projectPath??null:null),Q=le(Be=>{if(Be.selectedTeamName!==e)return Yc(e).border;const jt=Be.selectedTeamData?.config.color;if(jt)return zr(jt).border;const Nt=Be.selectedTeamData?.config.name??e;return Yc(Nt).border}),U=le(Be=>My(Be,e)),A=y8n(e),V=g.useMemo(()=>l.find(Be=>Be.sessionKey===d)??null,[d,l]),z=V?.chatName||V?.title||V?.userName||V?.sessionKey||"选择会话",L=g.useMemo(()=>Zi(t),[t]),q=g.useMemo(()=>t.map(Be=>({id:Be.name,name:Be.name,subtitle:Js(Be.role)??Js(Be.agentType)??void 0,color:L.get(Be.name)})),[t,L]),Y=g.useMemo(()=>{const Be=t.find(jt=>Yn(jt));return xa(Be?.providerId)??Eg(Be?.model)},[t]),{suggestions:ne}=AN(e),{suggestions:te}=Gy(e),G=le(Et(Be=>j?Be.skillsProjectCatalogByProjectPath[j]??[]:[])),Z=le(Et(Be=>Be.skillsUserCatalog)),oe=le(Be=>Be.fetchSkillsCatalog);g.useEffect(()=>{oe(j??void 0)},[oe,j]);const re=g.useMemo(()=>T8n(S8n(Y),G,Z,Y),[Y,G,Z]),se=Em(A.text).trim(),he=g.useMemo(()=>UT(se),[se]),Te=t.find(Be=>Be.name===_),ee=Te?L.get(Te.name):void 0,ye=Te?Yn(Te):!1,Oe=ye&&!!r,ie=Oe&&A.canAddMore,ge=Oe?void 0:ye?"团队在线时才能添加文件":"文件只能发送给团队负责人",J=A.attachments.length>0&&!Oe,F=he?A.attachments.length>0?"斜杠命令需要团队负责人在线,且不能与附件同时发送":ye?r?null:"斜杠命令需要团队负责人在线":"斜杠命令只能发送给团队负责人":null,W=_.length>0&&se.length>0&&se.length<=Zl&&!s&&!U&&!J&&!F,ue=g.useRef(!1),ae=g.useCallback(()=>{if(!W)return;$.current?.(),ue.current=!0;const Be=Yb(A.text,te),jt=FE(se,A.chips);h(_,jt,se,A.attachments.length>0?A.attachments:void 0,void 0,Be)},[W,_,se,h,A.attachments,A.chips,te]);g.useEffect(()=>{!s&&ue.current&&(ue.current=!1,!i&&a?.delivered!==!1&&A.clearDraft())},[s,i,a,A]);const{addFiles:ce}=A,H=g.useCallback(Be=>{const jt=Be.target;jt.files?.length&&ce(jt.files),jt.value=""},[ce]),pe=g.useCallback(()=>{M(ge??"Files can only be sent to the team lead"),window.clearTimeout(I.current),I.current=window.setTimeout(()=>{M(null)},4e3)},[ge]);g.useEffect(()=>{const Be=I;return()=>window.clearTimeout(Be.current)},[]);const Ee=g.useCallback(Be=>{Be.preventDefault(),P.current+=1,P.current===1&&w(!0)},[]),we=g.useCallback(Be=>{Be.preventDefault(),P.current-=1,P.current<=0&&(P.current=0,w(!1))},[]),$e=g.useCallback(Be=>{Be.preventDefault()},[]),{handleDrop:Ze}=A,lt=g.useCallback(Be=>{if(Be.preventDefault(),P.current=0,w(!1),!Oe){Be.dataTransfer?.files?.length&&pe();return}Ze(Be)},[Oe,Ze,pe]),{handlePaste:yt}=A,xt=g.useCallback(Be=>{if(!Oe){Array.from(Be.clipboardData.items).some(Nt=>Nt.kind==="file")&&(Be.preventDefault(),pe());return}yt(Be)},[Oe,yt,pe]),Ge=Zl-se.length,Pt=A.attachments.length>0||!!(A.attachmentError??C),Lt=!Pt,ct=n==="compact",_n=F?u.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-amber-500/10 px-1.5 py-0.5 text-[10px] text-amber-300",children:[u.jsx(jo,{size:10,className:"shrink-0"}),F]}):i?u.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-red-500/10 px-1.5 py-0.5 text-[10px] text-red-400",children:[u.jsx(jo,{size:10,className:"shrink-0"}),i]}):o?u.jsx(Ktt,{warning:o,debugDetails:a}):c?.deduplicated?u.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-amber-500/10 px-1.5 py-0.5 text-[10px] text-amber-300",children:[u.jsx(es,{size:10,className:"shrink-0"}),"已复用最近一次跨团队请求"]}):null;return u.jsxs("div",{className:at("relative",ct?"pb-1":"mb-1.5 pb-1.5"),role:"group",onDragEnter:Ee,onDragLeave:we,onDragOver:$e,onDrop:lt,onPaste:xt,children:[u.jsxs("div",{className:at(Lt?"mb-0":"mb-1",ct?"space-y-1.5":"space-y-2"),children:[u.jsxs("div",{className:"flex items-center gap-2",children:[ye?u.jsxs(u.Fragment,{children:[u.jsx("input",{ref:k,type:"file",accept:"*/*",multiple:!0,className:"hidden",onChange:H}),u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx("button",{type:"button",className:at("inline-flex shrink-0 items-center gap-1 rounded p-1 transition-colors",ie?"text-[var(--color-text-secondary)] hover:text-[var(--color-text)]":"text-[var(--color-text-muted)] opacity-40"),disabled:!ie,onClick:()=>k.current?.click(),children:u.jsx(cU,{size:14})})}),u.jsx(nt,{side:"top",children:r?A.canAddMore?"添加文件(支持粘贴或拖拽)":"已达到附件上限":"团队在线时才能添加文件"})]})]}):null,u.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[!r&&!U&&u.jsx("span",{className:"text-[10px]",style:{color:"var(--warning-text)"},children:"团队离线"}),u.jsxs("div",{className:at("mr-[15px] inline-flex items-center border text-xs transition-colors",Lt?"relative z-10 -mb-2 overflow-hidden rounded-b-none rounded-t-[1.35rem] border-b-0 bg-[var(--color-surface-raised)]":"rounded-full","border-[var(--color-border)]"),children:[u.jsxs(Wc,{open:R,onOpenChange:N,children:[u.jsx(Ku,{asChild:!0,children:u.jsxs("button",{type:"button",className:at("inline-flex items-center gap-1.5 border-r border-r-[var(--color-border)] px-2.5 py-1 text-xs transition-colors",Lt?"rounded-bl-none rounded-tl-[1.35rem]":"rounded-l-full","hover:bg-[var(--color-surface-raised)]"),children:[Q?u.jsx("span",{className:"inline-block size-2 shrink-0 rounded-full",style:{backgroundColor:Q}}):null,u.jsx("span",{className:"max-w-[120px] truncate text-[var(--color-text-secondary)]",children:z}),u.jsx(Dr,{size:12,className:"shrink-0 text-[var(--color-text-muted)]"})]})}),u.jsx(oc,{align:"end",className:"w-56 p-1.5",children:u.jsx("div",{className:"max-h-48 space-y-0.5 overflow-y-auto",children:l.length>0&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"px-2 py-1 text-[10px] font-medium uppercase tracking-wide text-[var(--color-text-muted)]",children:"会话"}),l.map(Be=>{const jt=d===Be.sessionKey,Nt=Be.chatName||Be.title||Be.userName||Be.sessionKey;return u.jsxs("button",{type:"button",className:at("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs transition-colors hover:bg-[var(--color-surface-raised)]",jt&&"bg-[var(--color-surface-raised)]"),onClick:()=>{p?.(Be.sessionKey),N(!1)},children:[u.jsx("span",{className:at("inline-block size-2 shrink-0 rounded-full",Be.live&&"animate-pulse"),style:{backgroundColor:Be.live?"#22c55e":Q}}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-[var(--color-text)]",children:Nt}),u.jsx("span",{className:"shrink-0 text-[10px] text-[var(--color-text-muted)]",children:Be.platform}),jt?u.jsx(es,{size:12,className:"ml-auto shrink-0 text-blue-400"}):null]},Be.sessionKey)})]})})})]}),u.jsxs(Wc,{open:y,onOpenChange:x,children:[u.jsx(Ku,{asChild:!0,children:u.jsxs("button",{type:"button",className:at("inline-flex items-center gap-1.5 px-2.5 py-1 text-xs transition-colors",Lt?"rounded-br-none rounded-tr-[1.35rem]":"rounded-r-full","hover:bg-[var(--color-surface-raised)]"),children:[_?u.jsx(Ur,{name:_,color:ee,size:"sm",hideAvatar:_==="user",disableHoverCard:!0}):u.jsx("span",{className:"text-[var(--color-text-muted)]",children:"选择..."}),u.jsx(Dr,{size:12,className:"shrink-0 text-[var(--color-text-muted)]"})]})}),u.jsxs(oc,{align:"end",className:"w-56 p-1.5",onOpenAutoFocus:Be=>{Be.preventDefault(),v(""),setTimeout(()=>T.current?.focus(),0)},children:[t.length>5&&u.jsxs("div",{className:"relative mb-1",children:[u.jsx($i,{size:12,className:"absolute left-2 top-1/2 -translate-y-1/2 text-[var(--color-text-muted)]"}),u.jsx("input",{ref:T,type:"text",className:"w-full rounded-md border border-[var(--color-border)] bg-[var(--color-surface)] py-1 pl-6 pr-2 text-xs text-[var(--color-text)] placeholder:text-[var(--color-text-muted)] focus:border-[var(--color-border-emphasis)] focus:outline-none",placeholder:"搜索...",value:S,onChange:Be=>v(Be.target.value)})]}),u.jsx("div",{className:"max-h-48 space-y-0.5 overflow-y-auto",children:(()=>{const Be=S.toLowerCase().trim(),jt=Be?t.filter(Zt=>Zt.name.toLowerCase().includes(Be)):t;return jt.length===0?u.jsx("div",{className:"px-2 py-3 text-center text-xs text-[var(--color-text-muted)]",children:"无匹配结果"}):[...jt].sort((Zt,je)=>{const tt=Yn(Zt)?1:0;return(Yn(je)?1:0)-tt}).map(Zt=>{const je=L.get(Zt.name),tt=Js(Zt.role)??Js(Zt.agentType),kt=Zt.name===_;return u.jsxs("button",{type:"button",className:at("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs transition-colors hover:bg-[var(--color-surface-raised)]",kt&&"bg-[var(--color-surface-raised)]"),onClick:()=>{b(Zt.name),x(!1),v("")},children:[u.jsx(Ur,{name:Zt.name,color:je,size:"sm",hideAvatar:Zt.name==="user",disableHoverCard:!0}),tt?u.jsx("span",{className:"shrink-0 text-[10px] text-[var(--color-text-muted)]",children:tt}):null,kt?u.jsx(es,{size:12,className:"ml-auto shrink-0 text-blue-400"}):null]},Zt.name)})})()})]})]})]})]})]}),Pt?u.jsx(Htt,{attachments:A.attachments,onRemove:A.removeAttachment,error:A.attachmentError??C,onDismissError:A.clearAttachmentError,disabled:J,disabledHint:"仅在团队在线且接收人为团队负责人时支持附件。请移除附件或切换接收人。"}):null]}),u.jsxs("div",{className:"relative",children:[u.jsx(Ztt,{active:E,rejected:!Oe,rejectionReason:ge}),u.jsx(Rm,{ref:O,id:`compose-${e}`,placeholder:U?"团队正在启动中... 消息将排队并在稍后投递到收件箱。":"输入消息...(回车发送,Shift+Enter 换行)",value:A.text,onValueChange:A.setText,suggestions:q,teamSuggestions:ne,taskSuggestions:te,commandSuggestions:re,chips:A.chips,onChipRemove:A.removeChip,projectPath:j,onFileChipInsert:A.addChip,onModEnter:ae,dismissMentionsRef:$,extraTips:g.useMemo(()=>[`Tips:你可以输入 "/" 来运行命令,如 ${re.filter(jt=>jt.type==="command").slice(0,6).map(jt=>jt.command).join("、")} 等。`],[re]),surfaceClassName:"message-composer-shell message-composer-orbit-surface bg-[var(--color-surface-raised)]",surfaceDecoration:"orbit-border",surfaceFadeColor:"var(--color-surface-raised)",className:"border-transparent shadow-none",minRows:1,maxRows:6,maxLength:Zl,disabled:s,hintText:void 0,showHint:!ct,cornerActionInset:"compact",cornerAction:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx("button",{type:"button",className:"inline-flex shrink-0 items-center rounded-full p-1.5 text-[var(--color-text-muted)] transition-colors hover:bg-[var(--color-surface-raised)] hover:text-[var(--color-text-secondary)]",onClick:()=>void K.openExternal("https://voicetext.site"),children:u.jsx(UIe,{size:14})})}),u.jsx(nt,{side:"top",children:"语音转文字"})]}),u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx("span",{className:"inline-flex",children:u.jsxs("button",{type:"button",className:"inline-flex shrink-0 items-center gap-1 rounded-full bg-blue-600 px-3 py-1.5 text-[11px] font-medium text-white shadow-sm transition-colors hover:bg-blue-500 disabled:cursor-not-allowed disabled:opacity-50",disabled:!W,onClick:ae,children:[u.jsx(dE,{size:12}),"发送"]})})}),F?u.jsx(nt,{side:"top",children:F}):U&&!s?u.jsx(nt,{side:"top",children:"团队启动期间暂不可发送"}):null]})]}),footerRight:ct?_n:u.jsxs("div",{className:"flex items-center gap-2",children:[_n,Ge<200?u.jsxs("span",{className:`text-[10px] ${Ge<100?"text-yellow-400":"text-[var(--color-text-muted)]"}`,children:["剩余 ",Ge," 字符"]}):null,A.isSaved?u.jsx("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:"已保存"}):null]})})]})]})};function E8n(e){const t=new Set;for(const n of e)n.from?.trim()&&t.add(n.from.trim());return Array.from(t).sort((n,r)=>n.localeCompare(r,void 0,{sensitivity:"base"}))}function w8n(e){const t=new Set;for(const n of e)n.to?.trim()&&t.add(n.to.trim());return Array.from(t).sort((n,r)=>n.localeCompare(r,void 0,{sensitivity:"base"}))}const k8n=({teamName:e,members:t,filter:n,messages:r,open:s,onOpenChange:i,onApply:o})=>{const[a,c]=g.useState({from:new Set,to:new Set,showNoise:!1});g.useEffect(()=>{if(s){const y={from:new Set(n.from),to:new Set(n.to),showNoise:!!n.showNoise};queueMicrotask(()=>c(y))}},[s,n.from,n.to,n.showNoise]);const l=g.useMemo(()=>Zi(t),[t]),d=g.useMemo(()=>E8n(r),[r]),p=g.useMemo(()=>w8n(r),[r]),f=(n.from.size>0?1:0)+(n.to.size>0?1:0),h=(a.from.size>0?1:0)+(a.to.size>0?1:0),m=y=>{c(x=>{const S=new Set(x.from);return S.has(y)?S.delete(y):S.add(y),{...x,from:S}})},O=y=>{c(x=>{const S=new Set(x.to);return S.has(y)?S.delete(y):S.add(y),{...x,to:S}})},_=()=>{o(a),i(!1)},b=()=>{const y={from:new Set,to:new Set,showNoise:!1};c(y),o(y)};return u.jsxs(Wc,{open:s,onOpenChange:i,children:[u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx(Ku,{asChild:!0,children:u.jsxs(Xe,{variant:"ghost",size:"sm",className:"relative h-7 px-2 text-[var(--color-text-muted)] hover:text-[var(--color-text)]","aria-label":"筛选消息",children:[u.jsx(lU,{size:14}),f>0&&u.jsx("span",{className:"absolute -right-1 -top-1 flex size-4 items-center justify-center rounded-full bg-blue-500 text-[10px] font-medium text-white",children:f})]})})}),u.jsx(nt,{side:"bottom",children:"筛选消息"})]}),u.jsxs(oc,{align:"end",className:"flex max-h-[70vh] w-72 flex-col p-0",children:[u.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[u.jsxs("div",{className:"border-b border-[var(--color-border)] p-3",children:[u.jsx("p",{className:"mb-2 text-[11px] font-medium uppercase tracking-wider text-[var(--color-text-muted)]",children:"发送方"}),u.jsx("div",{className:"space-y-1",children:d.length===0?u.jsx("p",{className:"text-xs italic text-[var(--color-text-muted)]",children:"暂无数据"}):d.map(y=>u.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded-md px-1 py-0.5 text-xs text-[var(--color-text-secondary)] hover:bg-[var(--color-surface-raised)]",children:[u.jsx(ni,{checked:a.from.has(y),onCheckedChange:()=>m(y)}),u.jsx(Ur,{name:y,color:l.get(y),teamName:e,size:"sm",hideAvatar:y==="user"})]},y))})]}),u.jsxs("div",{className:"border-b border-[var(--color-border)] p-3",children:[u.jsx("p",{className:"mb-2 text-[11px] font-medium uppercase tracking-wider text-[var(--color-text-muted)]",children:"接收方"}),u.jsx("div",{className:"space-y-1",children:p.length===0?u.jsx("p",{className:"text-xs italic text-[var(--color-text-muted)]",children:"暂无数据"}):p.map(y=>u.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded-md px-1 py-0.5 text-xs text-[var(--color-text-secondary)] hover:bg-[var(--color-surface-raised)]",children:[u.jsx(ni,{checked:a.to.has(y),onCheckedChange:()=>O(y)}),u.jsx(Ur,{name:y,color:l.get(y),teamName:e,size:"sm",hideAvatar:y==="user"})]},y))})]})]}),u.jsxs("div",{className:"shrink-0 border-t border-[var(--color-border)]",children:[u.jsx("div",{className:"border-b border-[var(--color-border)] p-3",children:u.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded-md px-1 py-0.5 text-xs text-[var(--color-text-secondary)] hover:bg-[var(--color-surface-raised)]",children:[u.jsx(ni,{checked:a.showNoise,onCheckedChange:()=>c(y=>({...y,showNoise:!y.showNoise}))}),u.jsx("span",{children:"显示状态更新(空闲/关闭)"})]})}),u.jsxs("div",{className:"flex justify-between gap-2 p-2",children:[u.jsx(Xe,{variant:"ghost",size:"sm",className:"h-7 px-2 text-[11px] text-[var(--color-text-muted)] hover:text-[var(--color-text)]",disabled:h===0&&!a.showNoise,onClick:b,children:"重置"}),u.jsx(Xe,{size:"sm",className:"h-7 px-3 text-[11px]",onClick:_,children:"保存"})]})]})]})]})},C8n=1e4;function zRe(e){if(typeof e!="string")return null;const t=e.trim();if(!t)return null;const n=t.indexOf(".");return n<=0?null:t.slice(0,n)}function R8n(e,t=Date.now()){if(!e||e.length===0)return[];const n=new Map,r=new Map,s=new Map,i=new Map;for(const d of e){const p=Date.parse(d.timestamp);if(Number.isFinite(p)){if(d.source==="cross_team_sent"){const f=zRe(d.to);if(!f)continue;if(d.conversationId){const h=s.get(d.conversationId);(!h||p>h.sentAtMs)&&s.set(d.conversationId,{teamName:f,sentAtMs:p,conversationId:d.conversationId})}else n.set(f,Math.max(n.get(f)??0,p));continue}if(d.source==="cross_team"){const f=zRe(d.from);if(!f)continue;d.conversationId?i.set(d.conversationId,Math.max(i.get(d.conversationId)??0,p)):r.set(f,Math.max(r.get(f)??0,p))}}}const o=d=>d>=t||t-d<=C8n,a=Array.from(s.values()).filter(({conversationId:d,sentAtMs:p})=>p>(i.get(d)??0)&&o(p)),c=new Set(a.map(d=>d.teamName)),l=Array.from(n.entries()).filter(([d])=>!c.has(d)).filter(([d,p])=>p>(r.get(d)??0)&&o(p)).map(([d,p])=>({teamName:d,sentAtMs:p})).sort((d,p)=>p.sentAtMs-d.sentAtMs);return[...a,...l].sort((d,p)=>p.sentAtMs-d.sentAtMs)}const P8n=({members:e,tasks:t,defaultCollapsed:n=!1,headerRight:r,onMemberClick:s,onTaskClick:i})=>{const{isLight:o}=Qs(),[a,c]=g.useState(n),l=Zi(e),d=ip(e),p=new Map(t.map(m=>[m.id,m])),f=[],h=new Set;for(const m of e){if(!m.currentTaskId)continue;const O=p.get(m.currentTaskId);O&&(O.reviewState==="approved"||O.status==="completed")||(h.add(m.name),f.push({member:m,task:O,taskId:m.currentTaskId,kind:"working"}))}for(const m of e){if(h.has(m.name))continue;const O=t.find(_=>_.reviewer===m.name&&(_.reviewState==="review"||_.kanbanColumn==="review"));O&&f.push({member:m,task:O,taskId:O.id,kind:"reviewing"})}return f.length===0?null:u.jsxs("div",{className:"mb-3 space-y-1.5",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3",children:[u.jsxs("button",{type:"button",className:"flex min-w-0 items-center gap-1.5 text-[10px] font-medium uppercase tracking-wide text-[var(--color-text-muted)] transition-colors hover:text-[var(--color-text-secondary)]",onClick:()=>c(m=>!m),"aria-label":a?"展开进行中任务":"收起进行中任务",children:[u.jsx(jn,{size:10,className:`shrink-0 transition-transform duration-150 ${a?"":"rotate-90"}`}),u.jsx("span",{children:"进行中"}),a&&u.jsx("span",{className:"rounded-full bg-[var(--color-surface-raised)] px-1.5 py-0.5 text-[10px] font-medium tabular-nums leading-none text-[var(--color-text-muted)]",children:f.length})]}),r?u.jsx("div",{className:"shrink-0",children:r}):null]}),!a&&f.map(({member:m,task:O,taskId:_,kind:b})=>{const y=zr(l.get(m.name)??""),x=Js(m.role??(m.agentType!=="general-purpose"?m.agentType:void 0)),S=b==="reviewing"?"bg-amber-400":"bg-emerald-400",v=b==="reviewing"?"bg-amber-500":"bg-emerald-500",T=b==="reviewing"?"reviewing":"working on";return u.jsx("article",{className:"activity-card-enter-animate overflow-hidden rounded-md",style:{backgroundColor:em,border:Tc,borderLeft:`3px solid ${y.border}`},children:u.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[u.jsxs("span",{className:"relative inline-flex shrink-0",children:[u.jsx("img",{src:d.get(m.name)??lo(m.name,24),alt:"",className:"size-5 rounded-full bg-[var(--color-surface-raised)]",loading:"lazy"}),u.jsxs("span",{className:"absolute -bottom-0.5 -right-0.5 flex size-2.5",children:[u.jsx("span",{className:`absolute inline-flex size-full animate-ping rounded-full ${S} opacity-70`}),u.jsx("span",{className:`relative inline-flex size-full rounded-full ${v}`})]})]}),s?u.jsx("button",{type:"button",className:"rounded px-1.5 py-0.5 text-[10px] font-medium tracking-wide transition-opacity hover:opacity-90 focus:outline-none focus:ring-1 focus:ring-[var(--color-border)]",style:{backgroundColor:ti(y,o),color:y.text,border:`1px solid ${y.border}40`},onClick:()=>s(m),children:ml(m.name)}):u.jsx("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-medium tracking-wide",style:{backgroundColor:ti(y,o),color:y.text,border:`1px solid ${y.border}40`},children:ml(m.name)}),x?u.jsx("span",{className:"text-[10px]",style:{color:Mt},children:x}):null,u.jsx("span",{className:"shrink-0 text-[10px]",style:{color:Mt},children:T}),O&&(i?u.jsxs("button",{type:"button",className:"min-w-0 flex-1 truncate rounded px-1.5 py-0.5 text-left text-[10px] font-medium text-[var(--color-text)] transition-opacity hover:opacity-90 focus:outline-none focus:ring-1 focus:ring-[var(--color-border)]",style:{border:`1px solid ${y.border}40`},onClick:()=>i(O),title:O.subject,children:[Gr(O)," ",O.subject]}):u.jsxs("span",{className:"min-w-0 flex-1 truncate px-1.5 py-0.5 text-[10px] font-medium text-[var(--color-text)]",style:{border:`1px solid ${y.border}40`},title:O.subject,children:[Gr(O)," ",O.subject]}))]})},`${m.name}-${_}`)})]})},$8n=({members:e,pendingRepliesByMember:t,pendingCrossTeamReplies:n=[],headerRight:r,onMemberClick:s})=>{const{isLight:i}=Qs(),o=le(Et(m=>m.pendingApprovals)),a=le(Et(m=>m.teamByName)),c=Zi(e),l=ip(e),d=Object.entries(t).map(([m,O])=>({kind:"member",member:e.find(_=>_.name===m)??null,name:m,sentAtMs:O})).filter(m=>!!m.member),p=n.map(m=>({kind:"team",teamName:m.teamName,sentAtMs:m.sentAtMs})),f=o.map(m=>({kind:"user",toolName:m.toolName,sentAtMs:new Date(m.receivedAt).getTime()})),h=[...d,...p,...f].sort((m,O)=>O.sentAtMs-m.sentAtMs);return h.length===0?null:u.jsxs("div",{className:"mb-3 space-y-1.5",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3",children:[u.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-[var(--color-text-muted)]",children:"Awaiting replies"}),r?u.jsx("div",{className:"shrink-0",children:r}):null]}),h.map(m=>{const O=mT(m.sentAtMs,{addSuffix:!0});if(m.kind==="member"){const{member:_}=m,b=zr(c.get(_.name)??""),y=Js(_.role??(_.agentType!=="general-purpose"?_.agentType:void 0)),x=vz(_.runtimeAdvisory,_.providerId),S=KUe(_.runtimeAdvisory,_.providerId),v=x!==null;return u.jsx("article",{className:"activity-card-enter-animate overflow-hidden rounded-md",style:{backgroundColor:em,border:Tc,borderLeft:`3px solid ${b.border}`},children:u.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[u.jsxs("span",{className:"relative inline-flex shrink-0",children:[u.jsx("img",{src:l.get(_.name)??lo(_.name,24),alt:"",className:"size-5 rounded-full bg-[var(--color-surface-raised)]",loading:"lazy"}),u.jsxs("span",{className:"absolute -bottom-0.5 -right-0.5 flex size-2.5",children:[u.jsx("span",{className:`absolute inline-flex size-full animate-ping rounded-full opacity-70 ${v?"bg-amber-400":"bg-emerald-400"}`}),u.jsx("span",{className:`relative inline-flex size-full rounded-full ${v?"bg-amber-500":"bg-emerald-500"}`})]})]}),s?u.jsx("button",{type:"button",className:"rounded px-1.5 py-0.5 text-[10px] font-medium tracking-wide transition-opacity hover:opacity-90 focus:outline-none focus:ring-1 focus:ring-[var(--color-border)]",style:{backgroundColor:ti(b,i),color:b.text,border:`1px solid ${b.border}40`},onClick:()=>s(_),title:"Open member",children:ml(_.name)}):u.jsx("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-medium tracking-wide",style:{backgroundColor:ti(b,i),color:b.text,border:`1px solid ${b.border}40`},children:ml(_.name)}),y?u.jsx("span",{className:"text-[10px]",style:{color:Mt},children:y}):null,u.jsx("span",{className:`min-w-0 flex-1 truncate text-[10px] ${v?"text-amber-300":""}`,style:v?void 0:{color:Mt},title:S??"Message sent, awaiting reply",children:x??"awaiting reply"}),v?u.jsx(Ht,{className:"size-3 shrink-0 animate-spin text-amber-400"}):null,u.jsx("span",{className:"shrink-0 text-[10px]",style:{color:Mt},children:O})]})},`pending-reply:${_.name}:${m.sentAtMs}`)}if(m.kind==="team"){const _=a[m.teamName]?.displayName||m.teamName,b=Yc(_,i);return u.jsx("article",{className:"activity-card-enter-animate overflow-hidden rounded-md",style:{backgroundColor:em,border:Tc,borderLeft:`3px solid ${b.border}`},children:u.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[u.jsxs("span",{className:"relative inline-flex shrink-0 items-center justify-center rounded-full bg-[var(--color-surface-raised)] p-1",children:[u.jsx(rc,{size:12,style:{color:b.border}}),u.jsxs("span",{className:"absolute -bottom-0.5 -right-0.5 flex size-2.5",children:[u.jsx("span",{className:"absolute inline-flex size-full animate-ping rounded-full bg-emerald-400 opacity-70"}),u.jsx("span",{className:"relative inline-flex size-full rounded-full bg-emerald-500"})]})]}),u.jsx("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-medium tracking-wide",style:{backgroundColor:ti(b,i),color:b.text,border:`1px solid ${b.border}40`},title:m.teamName,children:_}),u.jsx("span",{className:"text-[10px]",style:{color:Mt},children:"external team"}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-[10px]",style:{color:Mt},title:"Cross-team message sent, awaiting reply",children:"awaiting reply"}),u.jsx("span",{className:"shrink-0 text-[10px]",style:{color:Mt},children:O})]})},`pending-reply:team:${m.teamName}:${m.sentAtMs}`)}return u.jsx("article",{className:"activity-card-enter-animate overflow-hidden rounded-md",style:{backgroundColor:em,border:Tc,borderLeft:"3px solid var(--color-text-muted)"},children:u.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[u.jsxs("span",{className:"relative inline-flex shrink-0 items-center justify-center rounded-full bg-[var(--color-surface-raised)] p-1",children:[u.jsx(wht,{size:12,style:{color:"var(--color-text-muted)"}}),u.jsxs("span",{className:"absolute -bottom-0.5 -right-0.5 flex size-2.5",children:[u.jsx("span",{className:"absolute inline-flex size-full animate-ping rounded-full bg-amber-400 opacity-70"}),u.jsx("span",{className:"relative inline-flex size-full rounded-full bg-amber-500"})]})]}),u.jsx("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-medium tracking-wide",style:{backgroundColor:"var(--color-surface-raised)",color:"var(--color-text-secondary)",border:"1px solid var(--color-border-emphasis)"},children:"user"}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-[10px]",style:{color:Mt},title:`Tool approval: ${m.toolName}`,children:"awaiting approval"}),u.jsx("span",{className:"shrink-0 text-[10px]",style:{color:Mt},children:O})]})},`pending-reply:user:${m.sentAtMs}`)})]})},u9=({members:e,tasks:t,messages:n,pendingRepliesByMember:r,position:s,layout:i="overlay",onMemberClick:o,onTaskClick:a})=>{const[c,l]=g.useState(!1),[d,p]=g.useState(()=>Date.now()),f=g.useMemo(()=>R8n(n,d),[n,d]),h=g.useMemo(()=>Object.keys(r).some(x=>e.some(S=>S.name===x))||f.length>0,[e,r,f.length]),m=g.useMemo(()=>{const y=new Map(t.map(x=>[x.id,x]));return e.some(x=>{if(!x.currentTaskId)return!1;const S=y.get(x.currentTaskId);return!(S&&(S.reviewState==="approved"||S.status==="completed"))})},[e,t]),O=g.useMemo(()=>h?!0:m,[m,h]);if(g.useEffect(()=>{if(!O)return;const y=window.setInterval(()=>p(Date.now()),1e3);return()=>window.clearInterval(y)},[O]),!O)return null;const _=u.jsxs("button",{type:"button",className:"flex items-center gap-1 text-[10px] font-medium uppercase tracking-wide text-[var(--color-text-muted)] transition-colors hover:text-[var(--color-text-secondary)]",onClick:()=>l(y=>!y),"aria-label":c?"Expand status":"Collapse status",children:[u.jsx(jn,{size:12,className:`shrink-0 transition-transform duration-150 ${c?"":"rotate-90"}`}),"Status"]}),b=i==="flow"&&!c?_:null;return u.jsxs(u.Fragment,{children:[i==="overlay"?u.jsx("div",{className:"relative h-0",children:u.jsx("div",{className:"absolute -top-[19px] right-0 z-10",children:_})}):c?u.jsx("div",{className:"mb-2 flex justify-end",children:_}):null,!c&&u.jsxs("div",{className:i==="overlay"?"mt-5":"",children:[h?u.jsx($8n,{members:e,pendingRepliesByMember:r,pendingCrossTeamReplies:f,headerRight:b,onMemberClick:o}):null,u.jsx(P8n,{members:e,tasks:t,defaultCollapsed:s==="sidebar",headerRight:h?void 0:b,onMemberClick:o,onTaskClick:a})]})]})},N8n=40,HM=1,BRe=2,A8n=4,I8n=56;function M8n(e,t){if(Object.keys(e).length===0)return e;const n=new Map,r=new Map;for(const o of t){const a=Date.parse(o.timestamp);if(Number.isFinite(a)){if(o.from==="user"&&typeof o.to=="string"&&o.to.length>0&&o.source==="user_sent"){const c=n.get(o.to);(c==null||a>c)&&n.set(o.to,a);continue}if(o.to==="user"){const c=r.get(o.from);(c==null||a>c)&&r.set(o.from,a)}}}let s=!1;const i={};for(const[o,a]of Object.entries(e)){const c=r.get(o),d=n.get(o)??a;if(c!=null&&c>d){s=!0;continue}i[o]=a}return s?i:e}const Q8n=g.memo(function({teamName:t,position:n,onPositionChange:r,mountPoint:s,members:i,tasks:o,isTeamAlive:a,leadActivity:c,leadContextUpdatedAt:l,timeWindow:d,currentLeadSessionId:p,pendingRepliesByMember:f,onPendingReplyChange:h,onMemberClick:m,onTaskClick:O,onCreateTaskFromMessage:_,onReplyToMessage:b,onRestartTeam:y,onTaskIdClick:x,inlineScrollContainerRef:S,showPositionControls:v=!0}){const{sendTeamMessage:T,sendCrossTeamMessage:E,sendingMessage:w,sendMessageError:P,sendMessageWarning:k,sendMessageDebugDetails:C,lastSendMessageResult:M,teams:I,openTeamTab:$,messages:R,messagesState:N,loadOlderTeamMessages:j,refreshTeamMessagesHead:Q}=le(Et(Ve=>({sendTeamMessage:Ve.sendTeamMessage,sendCrossTeamMessage:Ve.sendCrossTeamMessage,sendingMessage:Ve.sendingMessage,sendMessageError:Ve.sendMessageError,sendMessageWarning:Ve.sendMessageWarning,sendMessageDebugDetails:Ve.sendMessageDebugDetails,lastSendMessageResult:Ve.lastSendMessageResult,teams:Ve.teams,openTeamTab:Ve.openTeamTab,messages:iz(Ve,t),messagesState:t?Ve.teamMessagesByName[t]:void 0,loadOlderTeamMessages:Ve.loadOlderTeamMessages,refreshTeamMessagesHead:Ve.refreshTeamMessagesHead}))),U=g.useRef(null),A=g.useCallback(async()=>{!N?.hasMore||N.loadingHead||N.loadingOlder||await j(t)},[j,N,t]);(N?.loadingHead??!1)||N?.loadingOlder;const V=N?.loadingOlder??!1,z=N?.hasMore??!1,L=R,q=L.length,Y=g.useRef(!1),ne=g.useRef(null),te=g.useRef(null),G=g.useRef(null),Z=g.useRef(null),oe=g.useRef(null),re=n==="inline"?S??null:n==="sidebar"?te:oe,se=g.useCallback(Ve=>{Ve>I8n||!z||N?.loadingHead||V||Y.current||(Y.current=!0,A())},[z,A,V,N?.loadingHead]);g.useEffect(()=>{V||(Y.current=!1)},[V]);const he=g.useMemo(()=>{if(re)return{scrollElementRef:re,observerRoot:re,scrollMargin:0,virtualizationEnabled:!0}},[re]),Te=g.useCallback(()=>{},[]),ee=g.useRef(jRe(t)),[ye,Oe]=g.useState(ee.current.messagesSearchQuery),[ie,ge]=g.useState(ee.current.messagesFilter),[J,F]=g.useState(ee.current.messagesFilterOpen),[W,ue]=g.useState(ee.current.messagesCollapsed),[ae,ce]=g.useState(ee.current.messagesSearchBarVisible),[H,pe]=g.useState(ee.current.expandedItemKey),[Ee,we]=g.useState([]),[$e,Ze]=g.useState(null),[lt,yt]=g.useState(!1),[xt,Ge]=g.useState(null),[Pt,Lt]=g.useState(ee.current.messagesScrollTop),[ct,_n]=g.useState(ee.current.bottomSheetSnapIndex),[Be,jt]=g.useState(196),[Nt,Zt]=g.useState(0);g.useEffect(()=>{ee.current=jRe(t),Oe(ee.current.messagesSearchQuery),ge(ee.current.messagesFilter),F(ee.current.messagesFilterOpen),ue(ee.current.messagesCollapsed),ce(ee.current.messagesSearchBarVisible),pe(ee.current.expandedItemKey),Lt(ee.current.messagesScrollTop),_n(ee.current.bottomSheetSnapIndex)},[t]),g.useEffect(()=>{let Ve=!1;return K.teams.getTeamSessions(t).then(zt=>{if(Ve)return;const wn=[...zt].sort((jr,Ws)=>new Date(Ws.updatedAt).getTime()-new Date(jr.updatedAt).getTime());we(wn),Ge(jr=>jr&&wn.some(Ws=>Ws.sessionKey===jr)?jr:wn[0]?.sessionKey??null)}).catch(()=>{Ve||(we([]),Ge(null))}),()=>{Ve=!0}},[t]);const je=g.useMemo(()=>Ee.find(Ve=>Ve.sessionKey===xt)??null,[xt,Ee]),tt=je?.platform==="hermit"||je?.sessionKey===`hermit:${t}:session`;g.useEffect(()=>{if(!je||tt){Ze(null),yt(!1);return}let Ve=!1;return yt(!0),K.teams.getSessionDetail(t,je.id,200).then(zt=>{Ve||Ze(zt)}).catch(()=>{Ve||Ze(null)}).finally(()=>{Ve||yt(!1)}),()=>{Ve=!0}},[tt,je,t]),g.useEffect(()=>{l8n(t,{messagesSearchQuery:ye,messagesFilter:ie,messagesFilterOpen:J,messagesCollapsed:W,messagesSearchBarVisible:ae,expandedItemKey:H,messagesScrollTop:Pt,bottomSheetSnapIndex:ct})},[t,ye,ie,J,W,ae,H,Pt,ct]),g.useEffect(()=>{const Ve=ie.from.size>0||ie.to.size>0;ae||ye.trim().length===0&&!Ve||ce(!0)},[ie.from,ie.to,ae,ye]),g.useEffect(()=>{if(t){if(L.length>0){U.current=null;return}N?.loadingHead||N?.loadingOlder||U.current!==t&&(U.current=t,Q(t).catch(()=>{}))}},[L.length,N?.loadingHead,N?.loadingOlder,Q,t]),g.useLayoutEffect(()=>{if(n!=="sidebar")return;const Ve=te.current;Ve&&(Ve.scrollTop=Pt)},[n,Pt]),g.useEffect(()=>{if(n==="sidebar")return;const Ve=n==="bottom-sheet"?oe.current:S?.current??null;if(!Ve)return;const zt=()=>{se(Ve.scrollTop)};return Ve.addEventListener("scroll",zt,{passive:!0}),zt(),()=>{Ve.removeEventListener("scroll",zt)}},[S,se,n]),g.useLayoutEffect(()=>{if(n!=="bottom-sheet"||typeof ResizeObserver>"u")return;const Ve=s instanceof HTMLElement?s:null,zt=[[Z.current,jt],[Ve,Zt]],wn=[];for(const[jr,Ws]of zt){if(!jr)continue;const Ie=()=>{const mn=Math.ceil(jr.getBoundingClientRect().height);mn>0&&Ws(mn)};Ie();const Ne=new ResizeObserver(()=>{Ie()});Ne.observe(jr),wn.push(Ne)}return()=>{wn.forEach(jr=>jr.disconnect())}},[n,s]);const kt=g.useMemo(()=>{const Ve=zt=>[...zt].sort((wn,jr)=>Date.parse(jr.timestamp)-Date.parse(wn.timestamp));return xt?je&&!tt?$e?[...$e.history].reverse().map((zt,wn)=>({messageId:`${$e.id}:${wn}:${zt.timestamp}`,from:zt.role==="user"?"user":$e.name||t,to:zt.role==="user"?$e.name||t:"user",text:zt.content,timestamp:zt.timestamp,read:!0,source:zt.role==="user"?"user_sent":"inbox",session:{id:$e.id,key:$e.sessionKey,platform:$e.platform,title:je.title||je.chatName||je.userName||je.sessionKey,chatName:je.chatName,userName:je.userName}})):[]:Ve(L.filter(zt=>zt.session?.key===xt)):[]},[L,tt,je,$e,xt,t]),en=g.useMemo(()=>Uee(kt,{timeWindow:d,filter:ie,searchQuery:ye}),[ie,ye,kt,d]),We=g.useMemo(()=>Uee(kt,{includePassiveIdlePeerSummariesWhenNoiseHidden:!0,timeWindow:d,filter:ie,searchQuery:ye}),[ie,ye,kt,d]),ut=g.useMemo(()=>L.filter(Ve=>Ve.messageKind!=="task_comment_notification"&&!n$n(typeof Ve.text=="string"?Ve.text:"")),[L]),Re=g.useMemo(()=>{if(!H)return null;if(!H.startsWith("thoughts-")){const zt=We.find(wn=>As(wn)===H);return zt?{type:"message",message:zt}:null}return BZe(We).find(zt=>zt.type==="lead-thoughts"&&_v(zt.group)===H)??null},[H,We]);g.useEffect(()=>{H&&Re===null&&pe(null)},[H,Re]);const xe=g.useCallback(Ve=>{pe(Ve)},[]),Fe=g.useCallback(Ve=>{Ve||pe(null)},[]),{readSet:et,markRead:Ye,markAllRead:vt}=Xle(t),{expandedSet:qt,toggle:Dt}=VGn(t),Bt=g.useMemo(()=>en.filter(Ve=>!Ve.read&&!et.has(As(Ve))).length,[en,et]),Kn=g.useCallback(Ve=>Ye(As(Ve)),[Ye]),En=g.useMemo(()=>({readSet:et,getMessageKey:As}),[et]),{teamNames:Jn,teamColorByName:ar}=Lle(I),ze=g.useCallback(()=>{const Ve=en.filter(zt=>!zt.read&&!et.has(As(zt))).map(zt=>As(zt));vt(Ve)},[en,et,vt]);g.useEffect(()=>{if(Object.keys(f).length===0)return;const Ve=M8n(f,ut);Ve!==f&&h(()=>Ve)},[h,f,ut]);const Pe=g.useCallback((Ve,zt,wn,jr,Ws,Ie)=>{const Ne=Date.now();h(mn=>({...mn,[Ve]:Ne})),T(t,{member:Ve,text:zt,summary:wn,attachments:jr,actionMode:Ws,taskRefs:Ie,sessionKey:xt&&xt!=="__unassigned__"?xt:void 0}).then(mn=>{mn?.runtimeDelivery?.attempted===!0&&mn.runtimeDelivery.delivered===!1&&h(er=>{if(er[Ve]!==Ne)return er;const oi={...er};return delete oi[Ve],oi})}).catch(()=>{h(mn=>{if(mn[Ve]!==Ne)return mn;const er={...mn};return delete er[Ve],er})})},[t,T,h,xt]);g.useCallback((Ve,zt,wn,jr,Ws)=>{E({fromTeam:t,fromMember:"user",toTeam:Ve,text:zt,taskRefs:Ws,actionMode:jr,summary:wn})},[t,E]);const _e=g.useCallback(()=>{r("inline")},[r]),ke=g.useCallback(()=>{r("sidebar")},[r]),de=g.useCallback(()=>{_n(BRe),r("bottom-sheet")},[r]),De=g.useCallback(Ve=>{_n(Ve),G.current?.snapTo(Ve)},[]),Ue=g.useCallback(()=>{if(ct===HM){De(BRe);return}De(HM)},[ct,De]),mt=g.useMemo(()=>{const Ve=Nt>0?Math.max(Nt-1,96):Number.POSITIVE_INFINITY,zt=Math.min(N8n,Ve),wn=Math.min(Math.max(zt+Be,zt+120),Ve),jr=Math.min(Math.max(Nt>0?Math.round(Nt*.58):520,wn+140),Ve);return[0,zt,wn,jr,1]},[Nt,Be]),St=g.useMemo(()=>Math.min(Math.max(ct,HM),A8n),[ct]),ht=u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1.5 rounded-md border border-[var(--color-border)] bg-transparent px-2 py-1",children:[u.jsx($i,{size:12,className:"shrink-0 text-[var(--color-text-muted)]"}),u.jsx("input",{type:"text",placeholder:"搜索...",value:ye,onChange:Ve=>Oe(Ve.target.value),onPointerDown:Ve=>Ve.stopPropagation(),onClick:Ve=>Ve.stopPropagation(),className:"min-w-0 flex-1 bg-transparent text-xs text-[var(--color-text)] placeholder:text-[var(--color-text-muted)] focus:outline-none"}),ye&&u.jsx("button",{type:"button",className:"shrink-0 rounded p-0.5 text-[var(--color-text-muted)] transition-colors hover:bg-[var(--color-surface-raised)] hover:text-[var(--color-text)]",onClick:()=>Oe(""),children:u.jsx(Ar,{size:14})})]}),u.jsx(k8n,{teamName:t,members:i,filter:ie,messages:kt,open:J,onOpenChange:F,onApply:ge})]}),Xt=u.jsxs("div",{className:"flex items-center gap-2",children:[ht,u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx(Xe,{variant:"ghost",size:"sm",className:"pointer-events-auto size-7 p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:Ve=>{Ve.stopPropagation(),ue(zt=>!zt)},children:W?u.jsx(Qk,{size:14}):u.jsx(R4,{size:14})})}),u.jsx(nt,{side:"bottom",children:W?"展开全部消息":"折叠全部消息"})]})]}),bn=u.jsxs("div",{className:"pb-14",children:[u.jsx(c9,{teamName:t,members:i,isTeamAlive:a,sending:w,sendError:P,sendWarning:k,sendDebugDetails:C,lastResult:M,sessions:Ee,selectedSessionKey:xt,onSessionChange:Ge,textareaRef:ne,onSend:Pe}),u.jsx(u9,{members:i,tasks:o,messages:kt,pendingRepliesByMember:f,layout:"flow",position:"inline",onMemberClick:m,onTaskClick:O}),u.jsx(a9,{messages:We,teamName:t,members:i,readState:En,allCollapsed:W,expandOverrides:qt,onToggleExpandOverride:Dt,currentLeadSessionId:p,isTeamAlive:a,leadActivity:c,leadContextUpdatedAt:l,teamNames:Jn,teamColorByName:ar,onTeamClick:$,onMemberClick:m,onCreateTaskFromMessage:void 0,onReplyToMessage:b,onMessageVisible:Kn,onRestartTeam:y,onTaskIdClick:x,onExpandItem:xe,onExpandContent:Te,viewport:he}),z&&u.jsx("div",{className:"flex justify-center py-2",children:u.jsxs("div",{className:"flex flex-col items-center gap-1",children:[u.jsx(Xe,{variant:"ghost",size:"sm",className:"text-xs text-text-muted","aria-busy":V,disabled:V,onClick:()=>void A(),children:"加载更早消息"}),u.jsxs("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:["已加载 ",q," 条"]})]})}),u.jsx(LC,{expandedItem:Re,open:H!==null,onOpenChange:Fe,teamName:t,members:i,onCreateTaskFromMessage:void 0,onReplyToMessage:b,onMemberClick:m,onTaskIdClick:x,onRestartTeam:y,teamNames:Jn,teamColorByName:ar,onTeamClick:$})]});if(n==="sidebar")return u.jsxs("div",{className:"flex size-full flex-col overflow-hidden bg-[var(--color-surface-sidebar)]",children:[u.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-[var(--color-border)] bg-[var(--color-surface-sidebar)] px-3 py-2",children:[u.jsx(ca,{size:14,className:"shrink-0 text-[var(--color-text-muted)]"}),u.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:"消息"}),en.length>0&&u.jsx(Ut,{variant:"secondary",className:"px-1.5 py-0.5 text-[10px] font-normal leading-none",children:en.length}),Bt>0&&u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsxs(Ut,{variant:"secondary",className:"bg-blue-500/20 px-1.5 py-0.5 text-[10px] font-normal leading-none text-blue-600 dark:text-blue-400",children:[Bt," 条新消息"]})}),u.jsxs(nt,{side:"bottom",children:[Bt," 条未读"]})]}),Bt>0&&u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx("button",{type:"button",className:"flex items-center gap-1 rounded-md px-1.5 py-1 text-[11px] text-blue-400 transition-colors hover:bg-blue-500/10",onClick:ze,children:u.jsx(gQ,{size:12})})}),u.jsx(nt,{side:"bottom",children:"全部标为已读"})]}),u.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx(Xe,{variant:"ghost",size:"sm",className:"size-7 p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:()=>ue(Ve=>!Ve),"aria-label":W?"展开全部消息":"折叠全部消息",children:W?u.jsx(Qk,{size:14}):u.jsx(R4,{size:14})})}),u.jsx(nt,{side:"bottom",children:W?"展开全部消息":"折叠全部消息"})]}),u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx(Xe,{variant:"ghost",size:"sm",className:"size-7 p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:()=>ce(Ve=>!Ve),"aria-label":ae?"隐藏消息搜索":"显示消息搜索",children:ae?u.jsx(Ar,{size:14}):u.jsx($i,{size:14})})}),u.jsx(nt,{side:"bottom",children:ae?"隐藏搜索":"搜索消息"})]}),u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx(Xe,{variant:"ghost",size:"sm",className:"size-7 p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:_e,"aria-label":"将消息移到页面内面板",children:u.jsx(BIe,{size:14})})}),u.jsx(nt,{side:"bottom",children:"移到页面内"})]})]})]}),ae&&u.jsx("div",{className:"shrink-0 border-b border-[var(--color-border)] px-3 py-1.5",children:ht}),u.jsxs("div",{ref:te,className:"min-h-0 min-w-0 flex-1 overflow-y-auto overflow-x-hidden pb-14 pr-3 pt-2",onScroll:Ve=>{const zt=Ve.currentTarget.scrollTop;Lt(zt),se(zt)},children:[u.jsxs("div",{className:"pl-3",children:[u.jsx(c9,{teamName:t,members:i,isTeamAlive:a,sending:w,sendError:P,sendWarning:k,sendDebugDetails:C,lastResult:M,sessions:Ee,selectedSessionKey:xt,onSessionChange:Ge,textareaRef:ne,onSend:Pe}),u.jsx(u9,{members:i,tasks:o,messages:kt,pendingRepliesByMember:f,layout:"flow",position:"sidebar",onMemberClick:m,onTaskClick:O})," "]}),u.jsx(a9,{messages:We,teamName:t,members:i,readState:En,allCollapsed:W,expandOverrides:qt,onToggleExpandOverride:Dt,currentLeadSessionId:p,isTeamAlive:a,leadActivity:c,leadContextUpdatedAt:l,teamNames:Jn,teamColorByName:ar,onTeamClick:$,onMemberClick:m,onCreateTaskFromMessage:void 0,onReplyToMessage:b,onMessageVisible:Kn,onRestartTeam:y,onTaskIdClick:x,onExpandItem:xe,onExpandContent:Te,viewport:he}),z&&u.jsx("div",{className:"flex justify-center py-2",children:u.jsxs("div",{className:"flex flex-col items-center gap-1",children:[u.jsx(Xe,{variant:"ghost",size:"sm",className:"text-xs text-text-muted","aria-busy":V,disabled:V,onClick:()=>void A(),children:"加载更早消息"}),u.jsxs("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:["已加载 ",q," 条"]})]})}),u.jsx(LC,{expandedItem:Re,open:H!==null,onOpenChange:Fe,teamName:t,members:i,onCreateTaskFromMessage:void 0,onReplyToMessage:b,onMemberClick:m,onTaskIdClick:x,onRestartTeam:y,teamNames:Jn,teamColorByName:ar,onTeamClick:$})]})]});if(n==="bottom-sheet"){if(!s)return u.jsx("div",{className:"hidden","aria-hidden":"true"});const Ve=St===HM;return u.jsx(Nw,{ref:G,isOpen:!0,onClose:_e,mountPoint:s,avoidKeyboard:!1,detent:"full",snapPoints:mt,initialSnap:St,onSnap:_n,disableDismiss:!0,disableScrollLocking:!0,style:{zIndex:30},className:"!pointer-events-none !absolute !inset-0",unstyled:!0,children:u.jsxs(Nw.Container,{unstyled:!0,className:"flex max-h-full w-full flex-col overflow-hidden rounded-t-[20px] border border-[var(--color-border)] bg-[var(--color-surface-sidebar)] shadow-[0_-18px_48px_rgba(0,0,0,0.35)]",children:[u.jsx(Nw.Header,{unstyled:!0,className:"shrink-0 cursor-grab select-none border-b border-[var(--color-border)] bg-[var(--color-surface-sidebar)] active:cursor-grabbing",children:u.jsxs("div",{className:"relative h-10 px-3",children:[u.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-1 flex justify-center",children:u.jsx(Nw.DragIndicator,{className:"!h-1 !w-9 cursor-grab !rounded-full active:cursor-grabbing",style:{backgroundColor:"color-mix(in srgb, var(--color-text-muted) 45%, transparent)"}})}),u.jsxs("div",{className:"flex h-full items-center gap-1.5",children:[u.jsx(ca,{size:13,className:"shrink-0 text-[var(--color-text-muted)]"}),u.jsx("span",{className:"text-[13px] font-medium text-[var(--color-text)]",children:"消息"}),en.length>0&&u.jsx(Ut,{variant:"secondary",className:"px-1 py-0 text-[9px] font-normal leading-none",children:en.length}),Bt>0&&u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsxs(Ut,{variant:"secondary",className:"bg-blue-500/20 px-1 py-0 text-[9px] font-normal leading-none text-blue-600 dark:text-blue-400",children:[Bt," 条新消息"]})}),u.jsxs(nt,{side:"top",children:[Bt," 条未读"]})]}),u.jsxs("div",{className:"ml-auto flex items-center gap-1",onPointerDown:zt=>zt.stopPropagation(),children:[Bt>0&&u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx(Xe,{variant:"ghost",size:"sm",className:"size-[22px] p-0 text-blue-400 hover:bg-blue-500/10 hover:text-blue-300",onClick:ze,"aria-label":"将全部消息标为已读",children:u.jsx(gQ,{size:13})})}),u.jsx(nt,{side:"top",children:"全部标为已读"})]}),u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx(Xe,{variant:"ghost",size:"sm",className:"size-[22px] p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:()=>ue(zt=>!zt),"aria-label":W?"展开全部消息":"折叠全部消息",children:W?u.jsx(Qk,{size:14}):u.jsx(R4,{size:14})})}),u.jsx(nt,{side:"top",children:W?"展开全部消息":"折叠全部消息"})]}),u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx(Xe,{variant:"ghost",size:"sm",className:"size-[22px] p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:()=>ce(zt=>!zt),"aria-label":ae?"隐藏消息搜索":"显示消息搜索",children:ae?u.jsx(Ar,{size:14}):u.jsx($i,{size:14})})}),u.jsx(nt,{side:"top",children:ae?"隐藏搜索":"搜索消息"})]}),u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx(Xe,{variant:"ghost",size:"sm",className:"size-[22px] p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:Ue,"aria-label":Ve?"展开底部消息面板":"折叠底部消息面板",children:Ve?u.jsx(jft,{size:14}):u.jsx(Dft,{size:14})})}),u.jsx(nt,{side:"top",children:Ve?"展开面板":"折叠面板"})]}),u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx(Xe,{variant:"ghost",size:"sm",className:"size-[22px] p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:_e,"aria-label":"将消息移到页面内面板",children:u.jsx(lpe,{size:14})})}),u.jsx(nt,{side:"top",children:"移到页面内"})]}),u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx(Xe,{variant:"ghost",size:"sm",className:"size-[22px] p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:ke,"aria-label":"将消息移到侧边栏",children:u.jsx(yH,{size:14})})}),u.jsx(nt,{side:"top",children:"移到侧边栏"})]})]})]})]})}),!Ve&&u.jsxs(Nw.Content,{className:"min-h-0 bg-[var(--color-surface-sidebar)]",scrollClassName:"flex min-h-full flex-col",scrollRef:oe,disableDrag:zt=>zt.scrollPosition!=="top",children:[u.jsxs("div",{ref:Z,className:"sticky top-0 z-[1] shrink-0 border-b border-[var(--color-border)] backdrop-blur",style:{backgroundColor:"var(--color-surface-sidebar)"},children:[ae&&u.jsx("div",{className:"border-b border-[var(--color-border)] px-3 py-2",children:ht}),u.jsx("div",{className:"p-3",children:u.jsx(c9,{teamName:t,layout:"compact",members:i,isTeamAlive:a,sending:w,sendError:P,sendWarning:k,sendDebugDetails:C,lastResult:M,sessions:Ee,selectedSessionKey:xt,onSessionChange:Ge,textareaRef:ne,onSend:Pe})})]}),u.jsx("div",{className:"shrink-0 px-3 pt-2",children:u.jsx(u9,{members:i,tasks:o,messages:kt,pendingRepliesByMember:f,layout:"flow",position:"inline",onMemberClick:m,onTaskClick:O})}),u.jsxs("div",{className:"flex-1 px-3 pb-4 pt-2",children:[u.jsx(a9,{messages:We,teamName:t,members:i,readState:En,allCollapsed:W,expandOverrides:qt,onToggleExpandOverride:Dt,currentLeadSessionId:p,isTeamAlive:a,leadActivity:c,leadContextUpdatedAt:l,teamNames:Jn,teamColorByName:ar,onTeamClick:$,onMemberClick:m,onCreateTaskFromMessage:void 0,onReplyToMessage:b,onMessageVisible:Kn,onRestartTeam:y,onTaskIdClick:x,onExpandItem:xe,onExpandContent:Te,viewport:he}),z&&u.jsx("div",{className:"flex justify-center py-2",children:u.jsxs("div",{className:"flex flex-col items-center gap-1",children:[u.jsx(Xe,{variant:"ghost",size:"sm",className:"text-xs text-text-muted","aria-busy":V,disabled:V,onClick:()=>void A(),children:"加载更早消息"}),u.jsxs("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:["已加载 ",q," 条"]})]})})]}),u.jsx(LC,{expandedItem:Re,open:H!==null,onOpenChange:Fe,teamName:t,members:i,onCreateTaskFromMessage:void 0,onReplyToMessage:b,onMemberClick:m,onTaskIdClick:x,onRestartTeam:y,teamNames:Jn,teamColorByName:ar,onTeamClick:$})]})]})})}return u.jsx(Vp,{sectionId:"messages",title:"消息",icon:u.jsx(ca,{size:14}),badge:en.length,secondaryBadge:en.length>0&&Bt>0?Bt:void 0,afterBadge:Bt>0?u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx("button",{type:"button",className:"pointer-events-auto flex items-center gap-1 rounded-md px-1.5 py-1 text-[11px] text-blue-400 transition-colors hover:bg-blue-500/10",onClick:Ve=>{Ve.stopPropagation(),ze()},children:u.jsx(gQ,{size:12})})}),u.jsx(nt,{side:"bottom",children:"全部标为已读"})]}):void 0,headerExtra:v?u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx(Xe,{variant:"ghost",size:"sm",className:"pointer-events-auto size-6 p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:Ve=>{Ve.stopPropagation(),de()},"aria-label":"将消息移到底部面板",children:u.jsx(lpe,{size:14})})}),u.jsx(nt,{side:"top",children:"移到底部面板"})]}),u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx(Xe,{variant:"ghost",size:"sm",className:"pointer-events-auto size-6 p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:Ve=>{Ve.stopPropagation(),ke()},"aria-label":"将消息移到侧边栏",children:u.jsx(yH,{size:14})})}),u.jsx(nt,{side:"top",children:"移到侧边栏"})]})]}):void 0,defaultOpen:!0,action:u.jsx("div",{className:"flex items-center gap-2 px-2",children:Xt}),children:bn})});function D8n(e){return e.ledgerSummary?.deletedInTask?"deleted":e.isNewFile||e.ledgerSummary?.createdInTask?"added":"modified"}const L8n=({open:e,onOpenChange:t,teamName:n,taskId:r,taskChangeRequestOptions:s})=>{const i=le(h=>h.changeSetLoading),o=le(h=>h.changeSetError),a=le(h=>h.activeChangeSet),c=le(h=>h.fetchTaskChanges),[l,d]=g.useState([]);g.useEffect(()=>{if(!e||!r){d([]);return}s&&c&&c(n,r,s)},[e,n,r,s,c]),g.useEffect(()=>{a?.files&&d(a.files)},[a]);const p=g.useCallback(()=>{t(!1)},[t]);if(!e)return null;const f=i&&l.length===0;return u.jsxs("div",{className:"fixed inset-0 z-50 flex flex-col bg-[var(--color-surface)]",children:[u.jsxs("div",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("h2",{className:"text-sm font-medium text-[var(--color-text)]",children:"变更查看"}),l.length>0&&u.jsxs("span",{className:"text-xs text-[var(--color-text-muted)]",children:[l.length," 个文件"]})]}),u.jsx("button",{onClick:p,className:"rounded-md p-1 text-[var(--color-text-muted)] hover:bg-[var(--color-surface-raised)] hover:text-[var(--color-text)]",children:u.jsx(Ar,{size:16})})]}),u.jsxs("div",{className:"flex-1 overflow-auto px-4 py-3",children:[f&&u.jsx("div",{className:"flex items-center justify-center py-12 text-[var(--color-text-muted)]",children:u.jsx("span",{className:"text-sm",children:"加载变更中..."})}),o&&u.jsx("div",{className:"mx-auto max-w-xl rounded-lg border border-red-500/20 bg-red-500/10 px-4 py-3 text-center",children:u.jsx("p",{className:"text-sm text-red-400",children:o})}),!f&&!o&&l.length>0&&u.jsx("div",{className:"space-y-1",children:l.map(h=>{const m=D8n(h);return u.jsxs("div",{className:m==="added"?"flex items-center gap-2 rounded-md bg-emerald-500/5 px-3 py-2 font-mono text-xs text-emerald-400":m==="deleted"?"flex items-center gap-2 rounded-md bg-red-500/5 px-3 py-2 font-mono text-xs text-red-400":"flex items-center gap-2 rounded-md bg-blue-500/5 px-3 py-2 font-mono text-xs text-blue-400",children:[u.jsx("span",{className:"w-12 shrink-0 text-center font-sans text-[10px] uppercase tracking-wide opacity-60",children:m}),u.jsx("span",{className:"min-w-0 truncate",children:h.filePath}),u.jsxs("span",{className:"ml-auto shrink-0 font-sans text-[var(--color-text-muted)]",children:["+",h.linesAdded," -",h.linesRemoved]})]},h.filePath)})}),!f&&!o&&l.length===0&&u.jsx("div",{className:"flex items-center justify-center py-12 text-[var(--color-text-muted)]",children:u.jsx("span",{className:"text-sm",children:"未记录文件变更"})})]})]})};function FRe(e){return mT(e,{addSuffix:!1}).replace(" seconds","s").replace(" second","s").replace(" minutes","m").replace(" minute","m").replace(" hours","h").replace(" hour","h").replace(" days","d").replace(" day","d").replace(" weeks","w").replace(" week","w").replace(" months","mo").replace(" month","mo").replace(" years","y").replace(" year","y")}function j8n(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n].name!==t[n].name||e[n].color!==t[n].color)return!1;return!0}function X8n(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1){const r=e[n],s=t[n];if(r.id!==s.id||r.port!==s.port||r.url!==s.url||r.label!==s.label||r.pid!==s.pid||r.registeredBy!==s.registeredBy||r.registeredAt!==s.registeredAt||r.stoppedAt!==s.stoppedAt)return!1}return!0}const U8n=g.memo(function({teamName:t,members:n,processes:r}){if(!t||r.length===0)return null;const s=new Map(n.map(o=>[o.name,o.color])),i=[...r].sort((o,a)=>{const c=!o.stoppedAt,l=!a.stoppedAt;return c!==l?c?-1:1:Date.parse(a.registeredAt)-Date.parse(o.registeredAt)});return u.jsx("div",{className:"space-y-0.5",children:i.map(o=>{const a=!o.stoppedAt,c=a?`${FRe(new Date(o.registeredAt))} 前`:`${FRe(new Date(o.stoppedAt))} 前停止`;return u.jsxs("div",{className:`flex items-center gap-2 rounded px-2 py-1.5 text-xs transition-colors hover:bg-[var(--color-surface-raised)] ${a?"":"opacity-50"}`,children:[u.jsxs("span",{className:"relative inline-flex size-2 shrink-0",title:a?"运行中":"已停止",children:[a&&u.jsx("span",{className:"absolute inline-flex size-full animate-ping rounded-full bg-emerald-400 opacity-50"}),u.jsx("span",{className:`relative inline-flex size-2 rounded-full ${a?"bg-emerald-400":"bg-zinc-500"}`})]}),u.jsx(Io,{size:12,className:"shrink-0 text-[var(--color-text-muted)]"}),u.jsx("span",{className:"min-w-0 truncate font-medium text-[var(--color-text)]",title:o.label,children:o.label}),(o.port!=null||o.url)&&u.jsxs("span",{className:"min-w-0 truncate text-[var(--color-text-secondary)]",children:[o.port!=null&&!o.url&&`:${o.port}`,o.url&&u.jsx("button",{type:"button",className:"text-[var(--color-text-secondary)] underline decoration-dotted underline-offset-2 transition-colors hover:text-blue-400",onClick:()=>void K.openExternal(o.url),title:o.url,children:o.url})]}),u.jsxs("span",{className:"ml-auto flex shrink-0 items-center gap-2",children:[a&&u.jsxs("button",{type:"button",className:"flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] text-red-400 transition-colors hover:bg-red-500/10",onClick:()=>void K.teams.killProcess(t,o.pid),title:"停止进程(SIGTERM)",children:[u.jsx(WIe,{size:8,className:"fill-current"}),"停止"]}),a&&o.url&&u.jsxs("button",{type:"button",className:"flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] text-blue-400 transition-colors hover:bg-blue-500/10",onClick:()=>void K.openExternal(o.url),title:"在浏览器中打开",children:[u.jsx(hf,{size:10}),"打开"]}),u.jsxs("span",{className:"font-mono text-[var(--color-text-muted)]",children:["PID",o.pid]}),o.registeredBy&&u.jsx(Ur,{name:o.registeredBy,color:s.get(o.registeredBy),teamName:t}),u.jsx("span",{className:"text-[var(--color-text-muted)]",children:c})]})]},o.id)})})},z8n);function z8n(e,t){return e.teamName===t.teamName&&j8n(e.members,t.members)&&X8n(e.processes,t.processes)}const ZM=g.memo(function({teamName:t}){return u.jsx(tKe,{teamName:t,surface:"flat",dismissible:!0,className:"mb-3"})});function Est(e){const{leadSessionId:t,projectId:n,sessionsLoading:r,knownSessions:s}=e;return!t||!n||r||s.length===0?!1:!s.some(i=>i.id===t)}function B8n(e){const{suppressionKey:t,currentKey:n}=e;return t===n&&Est(e)}const F8n=g.lazy(()=>Me(()=>import("./ProjectEditorOverlay-OZg4lWtu.js"),__vite__mapDeps([61,1])).then(e=>({default:e.ProjectEditorOverlay}))),Y8n=1e4;function V8n(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){const r=e[n],s=t[n];if(r.name!==s.name||r.status!==s.status||r.currentTaskId!==s.currentTaskId||r.color!==s.color||r.agentType!==s.agentType||r.role!==s.role||r.workflow!==s.workflow||r.providerId!==s.providerId||r.model!==s.model||r.effort!==s.effort||r.cwd!==s.cwd||r.gitBranch!==s.gitBranch||r.removedAt!==s.removedAt||r.runtimeAdvisory?.kind!==s.runtimeAdvisory?.kind||r.runtimeAdvisory?.observedAt!==s.runtimeAdvisory?.observedAt||r.runtimeAdvisory?.retryUntil!==s.runtimeAdvisory?.retryUntil||r.runtimeAdvisory?.retryDelayMs!==s.runtimeAdvisory?.retryDelayMs||r.runtimeAdvisory?.reasonCode!==s.runtimeAdvisory?.reasonCode||r.runtimeAdvisory?.message!==s.runtimeAdvisory?.message)return!1}return!0}function q8n(e){const t=g.useMemo(()=>(e??[]).filter(r=>!r.removedAt),[e]),n=g.useRef(t);return V8n(n.current,t)||(n.current=t),n.current}function W8n(e,t){if(t.startsWith("#")){const r=t.slice(1);return e.filter(s=>s.id===r||s.displayId===r)}const n=t.toLowerCase();return e.filter(r=>r.id.toLowerCase().includes(n)||(r.displayId?.toLowerCase().includes(n)??!1)||r.subject.toLowerCase().includes(n)||(r.owner?.toLowerCase().includes(n)??!1))}const G8n=g.memo(function({teamName:t,onLaunch:n}){return u.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3 rounded-md border px-3 py-2",style:{backgroundColor:"var(--warning-bg)",borderColor:"var(--warning-border)",color:"var(--warning-text)"},children:[u.jsxs("span",{className:"flex items-center gap-1.5 text-xs",children:[u.jsx(qn,{size:14,className:"shrink-0"}),"团队离线中"]}),u.jsxs(Xe,{variant:"ghost",size:"sm",className:"h-7 shrink-0 gap-1 px-2 text-xs text-[var(--step-done-text)] hover:bg-[var(--step-done-bg)]",onClick:n,children:[u.jsx(Bv,{size:12}),"启动"]})]})});function H8n(e){if(!e)return;const t=new Map(Object.entries(e));return t.size>0?t:void 0}function Z8n(e){if(!e)return;const t=new Map(Object.entries(e));return t.size>0?t:void 0}const K8n=g.memo(function({teamName:t,isTeamProvisioning:n,isTeamAlive:r}){const{leadActivity:s,memberSpawnStatuses:i,memberSpawnSnapshot:o,fetchMemberSpawnStatuses:a}=le(Et(c=>({leadActivity:c.leadActivityByTeam[t],memberSpawnStatuses:c.memberSpawnStatusesByTeam[t],memberSpawnSnapshot:c.memberSpawnSnapshotsByTeam[t],fetchMemberSpawnStatuses:c.fetchMemberSpawnStatuses})));return g.useEffect(()=>{const c=y3n(i,o);if((n||c||i==null&&(r===!0||s==="active"||s==="idle"))&&a(t),!n&&!c)return;const d=window.setInterval(()=>{a(t)},b3n);return()=>{window.clearInterval(d)}},[a,r,n,s,o,i,t]),null}),J8n=15e3,e9n=g.memo(function({teamName:t,isTeamProvisioning:n,isTeamAlive:r,isThisTabActive:s}){const{leadActivity:i,fetchTeamAgentRuntime:o}=le(Et(a=>({leadActivity:a.leadActivityByTeam[t],fetchTeamAgentRuntime:a.fetchTeamAgentRuntime})));return g.useEffect(()=>{if(!s||!(n||r===!0||i==="active"||i==="idle"))return;o(t);const c=window.setInterval(()=>{o(t)},J8n);return()=>{window.clearInterval(c)}},[o,r,n,s,i,t]),null}),t9n=g.memo(function({teamName:t,tabId:n,projectId:r,leadSessionId:s,sessionHistoryKey:i,isThisTabActive:o,isTeamAlive:a,sessions:c,sessionsLoading:l}){const d=le(h=>h.fetchSessionDetail),p=g.useRef(null),f=g.useMemo(()=>`${t}:${r??""}:${s??""}:${i}`,[t,r,s,i]);return g.useEffect(()=>{p.current=null},[f]),g.useEffect(()=>{if(!o||!n||!r||!s)return;if(Est({leadSessionId:s,projectId:r,sessionsLoading:l,knownSessions:c})){p.current=f;return}const m=()=>{B8n({leadSessionId:s,projectId:r,sessionsLoading:l,knownSessions:c,suppressionKey:p.current,currentKey:f})||d(r,s,n,{silent:!0})};if(m(),!a)return;const O=window.setInterval(()=>{m()},1e4);return()=>window.clearInterval(O)},[d,a,o,s,f,r,c,l,n]),null}),n9n=g.memo(function({teamName:t,tabId:n,projectId:r,leadSessionId:s,fallbackProjectRoot:i}){const{leadTabData:o,leadContextSnapshot:a,isContextPanelVisible:c,selectedContextPhase:l,setContextPanelVisibleForTab:d,setSelectedContextPhaseForTab:p,fetchSessionDetail:f}=le(Et($=>({leadTabData:n?$.tabSessionData[n]??null:null,leadContextSnapshot:$.leadContextByTeam[t]??null,isContextPanelVisible:n?$.tabUIStates.get(n)?.showContextPanel??!1:!1,selectedContextPhase:n?$.tabUIStates.get(n)?.selectedContextPhase??null:null,setContextPanelVisibleForTab:$.setContextPanelVisibleForTab,setSelectedContextPhaseForTab:$.setSelectedContextPhaseForTab,fetchSessionDetail:$.fetchSessionDetail}))),[h,m]=g.useState(!1),O=g.useCallback($=>{n&&d(n,$)},[d,n]),_=g.useCallback($=>{n&&p(n,$)},[p,n]),b=o?.sessionDetail??null,y=o?.conversation??null,x=o?.sessionContextStats??null,S=o?.sessionPhaseInfo??null,v=o?.sessionDetailLoading??!1,T=!!(s&&b?.session?.id===s),E=g.useMemo(()=>{const $=b?.processes;if(!$||$.length===0)return;const R=$.reduce((N,j)=>N+(j.metrics.costUsd??0),0);return R>0?R:void 0},[b?.processes]),{allContextInjections:w,lastAssistantUsage:P,lastAssistantModelName:k}=g.useMemo(()=>{if(!T||!x||!y?.items.length)return{allContextInjections:[],lastAssistantUsage:null,lastAssistantModelName:void 0};const $=l;let R;if($!==null&&S){const V=S.phases.find(z=>z.phaseNumber===$);V&&(R=V.lastAIGroupId)}if(!R){const V=[...y.items].reverse().find(z=>z.type==="ai");if(V?.type!=="ai")return{allContextInjections:[],lastAssistantUsage:null,lastAssistantModelName:void 0};R=V.group.id}const j=x.get(R)?.accumulatedInjections??[];let Q=null,U;const A=y.items.find(V=>V.type==="ai"&&V.group.id===R);if(A?.type==="ai"){const V=A.group.responses||[];for(let z=V.length-1;z>=0;z--){const L=V[z];if(L.type==="assistant"&&L.usage){Q=L.usage,U=L.model;break}}}return{allContextInjections:j,lastAssistantUsage:Q,lastAssistantModelName:U}},[y,x,T,S,l]),C=g.useMemo(()=>Oce(w),[w]),M=g.useMemo(()=>Ett({usage:P,modelName:k,contextWindowTokens:a?.contextWindowTokens??null,visibleContextTokens:C}),[k,P,a?.contextWindowTokens,C]),I=g.useMemo(()=>{const $=M.contextUsedPercentOfContextWindow??a?.contextUsedPercent;return $==null?null:`${$.toFixed(1)}%`},[M.contextUsedPercentOfContextWindow,a?.contextUsedPercent]);return s?u.jsxs(u.Fragment,{children:[c&&u.jsx("div",{className:"w-80 shrink-0",children:T?u.jsx(vtt,{injections:w,onClose:()=>O(!1),projectRoot:b?.session?.projectPath??i,contextMetrics:M,sessionMetrics:b?.metrics,subagentCostUsd:E,phaseInfo:S??void 0,selectedPhase:l,onPhaseChange:_,side:"left"}):u.jsxs("div",{className:"flex h-full flex-col border-0 bg-[var(--color-surface)]",style:{backgroundColor:"var(--color-surface)"},children:[u.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--color-border)] px-3 py-2",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("p",{className:"text-sm font-medium text-[var(--color-text)]",children:"上下文"}),u.jsx("p",{className:"text-[10px] text-[var(--color-text-muted)]",children:v?"加载中…":"暂无会话"})]}),u.jsx("button",{type:"button",className:"rounded p-1 text-[var(--color-text-muted)] transition-colors hover:bg-[var(--color-surface-raised)] hover:text-[var(--color-text)]",onClick:()=>O(!1),"aria-label":`关闭 ${t} 上下文面板`,children:"×"})]}),u.jsx("div",{className:"flex flex-1 items-center justify-center p-4",children:u.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:v?"正在加载上下文…":"打开团队负责人会话后可查看上下文。"})})]})}),u.jsx("div",{className:"pointer-events-none fixed bottom-4 z-20",style:{left:c?"calc(20rem + 1rem)":"1rem"},children:u.jsx("button",{onClick:()=>{O(!c),n&&r&&f(r,s,n,{silent:!0})},onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),className:"pointer-events-auto flex w-fit items-center gap-1 rounded-md px-2.5 py-1.5 text-xs shadow-lg backdrop-blur-md transition-colors",style:{backgroundColor:c?"var(--context-btn-active-bg)":h?"var(--context-btn-bg-hover)":"var(--context-btn-bg)",color:c?"var(--context-btn-active-text)":"var(--color-text-secondary)"},title:T?`会话:${s}`:v?"正在加载上下文…":s,children:I??"上下文"})})]}):null}),r9n=g.memo(function({teamName:t,...n}){const{leadActivity:r,progress:s,memberSpawnStatuses:i,memberSpawnSnapshot:o,runtimeSnapshot:a}=le(Et(f=>({leadActivity:f.leadActivityByTeam[t],progress:wf(f,t),memberSpawnStatuses:f.memberSpawnStatusesByTeam[t],memberSpawnSnapshot:f.memberSpawnSnapshotsByTeam[t],runtimeSnapshot:f.teamAgentRuntimeByTeam[t]}))),c=g.useMemo(()=>H8n(i),[i]),l=g.useMemo(()=>Z8n(a?.members),[a?.members]),d=a?.runId??o?.runId??s?.runId,p=g.useMemo(()=>s?.state!=="ready"?!1:kz(wz({members:n.members,memberSpawnStatuses:i,memberSpawnSnapshot:o})).hasMembersStillJoining,[o,i,s?.state,n.members]);return u.jsx(eYn,{...n,leadActivity:r,memberSpawnStatuses:c,memberRuntimeEntries:l,runtimeRunId:d,isLaunchSettling:p})}),s9n=g.memo(function({teamName:t,...n}){const{leadActivity:r,leadContextUpdatedAt:s}=le(Et(i=>({leadActivity:i.leadActivityByTeam[t],leadContextUpdatedAt:i.leadContextByTeam[t]?.updatedAt})));return u.jsx(Q8n,{...n,teamName:t,leadActivity:r,leadContextUpdatedAt:s})}),i9n=g.memo(function({teamName:t,member:n,...r}){const{leadActivity:s,liveMember:i,progress:o,launchMembers:a,memberSpawnStatuses:c,memberSpawnSnapshot:l,spawnEntry:d,runtimeRunId:p,runtimeEntry:f}=le(Et(m=>({leadActivity:m.leadActivityByTeam[t],liveMember:n?fXe(m,t,n.name):null,progress:wf(m,t),launchMembers:$se(m,t),memberSpawnStatuses:m.memberSpawnStatusesByTeam[t],memberSpawnSnapshot:m.memberSpawnSnapshotsByTeam[t],spawnEntry:n?m.memberSpawnStatusesByTeam[t]?.[n.name]:void 0,runtimeRunId:m.teamAgentRuntimeByTeam[t]?.runId??m.memberSpawnSnapshotsByTeam[t]?.runId??wf(m,t)?.runId,runtimeEntry:n?m.teamAgentRuntimeByTeam[t]?.members[n.name]:void 0}))),h=g.useMemo(()=>o?.state!=="ready"?!1:kz(wz({members:a,memberSpawnStatuses:c,memberSpawnSnapshot:l})).hasMembersStillJoining,[a,l,c,o?.state]);return u.jsx(jFn,{...r,teamName:t,member:i??n,isLaunchSettling:h,leadActivity:s,spawnEntry:d,runtimeEntry:f,runtimeRunId:p})}),o9n=({teamName:e,isPaneFocused:t=!1})=>{const{isLight:n}=Qs(),[r,s]=g.useState(null),[i,o]=g.useState(null),[a,c]=g.useState(null),[l,d]=g.useState(null),[p,f]=g.useState(()=>XRe(e)),[h,m]=g.useState({open:!1,defaultSubject:"",defaultDescription:"",defaultOwner:""}),[O,_]=g.useState(!1),[b,y]=g.useState(null),[x,S]=g.useState(!1),[v,T]=g.useState(!1),[E,w]=g.useState(null);g.useEffect(()=>{if(!v||!e)return;let be=!1;return(async()=>{try{const Ke=await K.teams.getSavedRequest(e);be||w(Ke??null)}catch{be||w(null)}})(),()=>{be=!0}},[v,e]);const[P,k]=g.useState({open:!1,mode:"launch"}),[C,M]=g.useState(!1),I=g.useRef(null),$=g.useRef(null),R=g.useRef(!1);g.useEffect(()=>{const be=I.current;be&&(C?be.setAttribute("inert",""):be.removeAttribute("inert"))},[C]),g.useEffect(()=>{const be=Sr=>{const{teamName:Bo,taskId:cc}=Sr.detail??{};if(Bo!==e||!ce)return;const Wf=ce.tasks.find(UB=>UB.id===cc);Wf&&o(Wf)},Ke=Sr=>{const{teamName:Bo,memberName:cc}=Sr.detail??{};Bo===e&&(L(cc),Y(void 0),te(void 0),j(!0))},Ft=Sr=>{const{teamName:Bo,memberName:cc,initialTab:Wf,initialActivityFilter:UB}=Sr.detail??{};if(Bo!==e||!ce)return;const lue=H.find(Zst=>Zst.name===cc);lue&&(c(lue),d({initialTab:Wf,initialActivityFilter:UB}))},ur=Sr=>{const{teamName:Bo,owner:cc}=Sr.detail??{};Bo===e&&za("","",cc??"")};window.addEventListener("graph:open-task",be),window.addEventListener("graph:send-message",Ke),window.addEventListener("graph:open-profile",Ft),window.addEventListener("graph:create-task",ur);const ir=Sr=>Bo=>{const{teamName:cc,taskId:Wf}=Bo.detail??{};cc!==e||!Wf||Sr(Wf)},rt=ir(Sr=>{(async()=>{try{const Bo=await Be(e,Sr);if(ce?.isAlive){const cc=ce.tasks.find(Wf=>Wf.id===Sr);try{Bo.notifiedOwner&&cc?.owner&&await K.teams.processSend(e,`Task ${Gr(cc)} "${cc.subject}" has started. Please begin working on it.`)}catch{}}}catch{}})()}),Qt=ir(Sr=>{(async()=>{try{await Ge(e,Sr,"completed")}catch{}})()}),dr=ir(Sr=>{(async()=>{try{await yt(e,Sr,{op:"set_column",column:"approved"})}catch{}})()}),yo=ir(Sr=>{(async()=>{try{await ct(e,Sr)}catch{}})()}),eu=ir(Sr=>{s(Sr)}),Km=ir(Sr=>{(async()=>{try{await Ge(e,Sr,"pending")}catch{}})()}),Jm=ir(Sr=>{(async()=>{try{await yt(e,Sr,{op:"remove"}),await Ge(e,Sr,"completed")}catch{}})()}),tu=ir(Sr=>zo(Sr));return window.addEventListener("graph:start-task",rt),window.addEventListener("graph:complete-task",Qt),window.addEventListener("graph:approve-task",dr),window.addEventListener("graph:request-review",yo),window.addEventListener("graph:request-changes",eu),window.addEventListener("graph:cancel-task",Km),window.addEventListener("graph:move-back-to-done",Jm),window.addEventListener("graph:delete-task",tu),()=>{window.removeEventListener("graph:open-task",be),window.removeEventListener("graph:send-message",Ke),window.removeEventListener("graph:open-profile",Ft),window.removeEventListener("graph:create-task",ur),window.removeEventListener("graph:start-task",rt),window.removeEventListener("graph:complete-task",Qt),window.removeEventListener("graph:approve-task",dr),window.removeEventListener("graph:request-review",yo),window.removeEventListener("graph:request-changes",eu),window.removeEventListener("graph:cancel-task",Km),window.removeEventListener("graph:move-back-to-done",Jm),window.removeEventListener("graph:delete-task",tu)}});const[N,j]=g.useState(!1),[Q,U]=g.useState(!1),[A,V]=g.useState(!1),[z,L]=g.useState(void 0),[q,Y]=g.useState(void 0),[ne,te]=g.useState(void 0),[G,Z]=g.useState(void 0),[oe,re]=g.useState({open:!1,mode:"task"}),[se,he]=g.useState([]),Te=P.open,[ee,ye]=g.useState([]),[Oe,ie]=g.useState(!1),[ge,J]=g.useState(null),[F,W]=g.useState({sessionId:null,selectedOwners:new Set,columns:new Set}),[ue,ae]=g.useState({field:"updatedAt"}),{data:ce,members:H,loading:pe,error:Ee,projects:we,repositoryGroups:$e,initTabUIState:Ze,selectTeam:lt,updateKanban:yt,updateKanbanColumnOrder:xt,updateTaskStatus:Ge,updateTaskOwner:Pt,sendTeamMessage:Lt,requestReview:ct,createTeamTask:_n,startTaskByUser:Be,deleteTeam:jt,openTeamsTab:Nt,closeTab:Zt,sendingMessage:je,sendMessageError:tt,sendMessageWarning:kt,sendMessageDebugDetails:en,lastSendMessageResult:We,reviewActionError:ut,restartMember:Re,skipMemberForLaunch:xe,removeMember:Fe,updateMemberRole:et,launchTeam:Ye,provisioningError:vt,clearProvisioningError:qt,isTeamProvisioning:Dt,refreshTeamData:Bt,refreshTeamMessagesHead:Kn,refreshMemberActivityMeta:En,syncTeamPendingReplyRefresh:Jn,kanbanFilterQuery:ar,clearKanbanFilter:ze,softDeleteTask:Pe,restoreTask:_e,fetchDeletedTasks:ke,deletedTasks:de,launchParams:De,selectReviewFile:Ue,pendingReviewRequest:mt,setPendingReviewRequest:St,teams:ht,fetchTeams:Xt}=le(Et(be=>({projects:be.projects,repositoryGroups:be.repositoryGroups,initTabUIState:be.initTabUIState,selectTeam:be.selectTeam,updateKanban:be.updateKanban,updateKanbanColumnOrder:be.updateKanbanColumnOrder,updateTaskStatus:be.updateTaskStatus,updateTaskOwner:be.updateTaskOwner,sendTeamMessage:be.sendTeamMessage,requestReview:be.requestReview,createTeamTask:be.createTeamTask,startTaskByUser:be.startTaskByUser,deleteTeam:be.deleteTeam,openTeamsTab:be.openTeamsTab,closeTab:be.closeTab,sendingMessage:be.sendingMessage,sendMessageError:be.sendMessageError,sendMessageWarning:be.sendMessageWarning,sendMessageDebugDetails:be.sendMessageDebugDetails,lastSendMessageResult:be.lastSendMessageResult,reviewActionError:be.reviewActionError,restartMember:be.restartMember,skipMemberForLaunch:be.skipMemberForLaunch,removeMember:be.removeMember,updateMemberRole:be.updateMemberRole,launchTeam:be.launchTeam,provisioningError:e?be.provisioningErrorByTeam[e]??null:null,clearProvisioningError:be.clearProvisioningError,isTeamProvisioning:e?My(be,e):!1,data:be.selectedTeamName===e?be.selectedTeamData:null,members:Sl(be,e),loading:be.selectedTeamName===e?be.selectedTeamLoading:!1,error:be.selectedTeamName===e?be.selectedTeamError:null,refreshTeamData:be.refreshTeamData,refreshTeamMessagesHead:be.refreshTeamMessagesHead,refreshMemberActivityMeta:be.refreshMemberActivityMeta,syncTeamPendingReplyRefresh:be.syncTeamPendingReplyRefresh,kanbanFilterQuery:be.kanbanFilterQuery,clearKanbanFilter:be.clearKanbanFilter,softDeleteTask:be.softDeleteTask,restoreTask:be.restoreTask,fetchDeletedTasks:be.fetchDeletedTasks,deletedTasks:be.deletedTasks,launchParams:e?be.launchParamsByTeam[e]:void 0,selectReviewFile:be.selectReviewFile,pendingReviewRequest:be.pendingReviewRequest,setPendingReviewRequest:be.setPendingReviewRequest,teams:be.teams,fetchTeams:be.fetchTeams}))),bn=x3(),Ve=le(be=>be.activeTabId),zt=bn?Ve===bn:!1,wn=g.useRef(!1),jr=g.useCallback(be=>{},[]);g.useEffect(()=>{bn&&Ze(bn)},[bn,Ze]),g.useEffect(()=>{f(XRe(e))},[e]),g.useEffect(()=>{c8n(e,p)},[p,e]),g.useEffect(()=>{const be=R.current;R.current=Dt,!be&&Dt&&$.current?.scrollIntoView({behavior:"smooth",block:"start"})},[Dt]);const[Ws,Ie]=g.useState(""),Ne=le(be=>be.editorPendingRevealFile);g.useEffect(()=>{Ne&&ce?.config.projectPath&&M(!0)},[Ne,ce?.config.projectPath]),g.useEffect(()=>{e&&(lt(e),ke(e))},[e,lt,ke]);const mn=ce?.teamName;g.useEffect(()=>{!zt||!e||pe||mn!=null&&mn!==e&&lt(e)},[zt,e,mn,pe,lt]),g.useEffect(()=>{const be=zt&&t,Ke=be&&!wn.current;wn.current=be,!(!Ke||!e)&&(async()=>{try{(await Kn(e)).feedChanged&&await En(e)}catch{}})()},[t,zt,En,Kn,e]),g.useEffect(()=>{if(!Te)return;let be=!1;const Ke=le.getState().teams;return(async()=>{try{const Ft=await K.teams.aliveList();if(be)return;const ur=new Set(Ft),ir=Ke.filter(rt=>ur.has(rt.teamName)&&rt.projectPath).map(rt=>({teamName:rt.teamName,displayName:rt.displayName,projectPath:rt.projectPath}));he(ir)}catch{}})(),()=>{be=!0}},[Te]),g.useEffect(()=>{ar&&(Ie(ar),ze())},[ar,ze]);const er=g.useMemo(()=>nDn(ce?.config.projectPath,we,$e),[we,$e,ce?.config.projectPath]),oi=ce?.config.leadSessionId??null,ai=g.useId(),Kc=g.useMemo(()=>(ce?.config.sessionHistory??[]).join("|"),[ce?.config.sessionHistory]);g.useEffect(()=>{const be=Object.keys(p).length>0;return Jn(e,ai,!!ce?.isAlive&&be,Y8n),()=>{Jn(e,ai,!1)}},[ce?.isAlive,p,ai,Jn,e]),g.useEffect(()=>{if(!er)return;let be=!1;return ie(!0),J(null),(async()=>{try{const Ke=await K.getSessions(er);be||ye(Ke)}catch(Ke){be||J(Ke instanceof Error?Ke.message:"加载会话失败")}finally{be||ie(!1)}})(),()=>{be=!0}},[er]);const cn=ce?.config.projectPath?.trim()??null,Pn=g.useMemo(()=>{const be=H.find(Ke=>Yn(Ke))?.cwd?.trim();return be&&be.length>0?be:cn},[H,cn]),An=g.useMemo(()=>{const be=new Map,Ke=Ft=>{const ur=Ft?.trim();if(!ur)return;const ir=fr(ur);!ir||be.has(ir)||be.set(ir,ur)};Ke(Pn);for(const Ft of H)Ke(Ft.cwd);return Array.from(be.values())},[H,Pn]);Ttt(An,{live:!0});const tr=le(Et(be=>Object.fromEntries(An.map(Ke=>{const Ft=fr(Ke);return[Ft,be.branchByPath[Ft]??null]})))),Br=Pn?tr[fr(Pn)]??null:null,lr=g.useMemo(()=>ce?H.map(be=>{const Ke=be.cwd?.trim(),Ft=Ke&&!Yn(be)&&Br!==null?(()=>{const ir=tr[fr(Ke)]??null;return ir&&ir!==Br?ir:void 0})():void 0;if(be.gitBranch===Ft)return be;const ur={...be};return Ft?ur.gitBranch=Ft:delete ur.gitBranch,ur}):[],[Br,H,tr]),xr=g.useMemo(()=>Zi(lr),[lr]),cr=g.useMemo(()=>{const be=new Set;if(ce?.config.leadSessionId&&be.add(ce.config.leadSessionId),ce?.config.sessionHistory)for(const Ke of ce.config.sessionHistory)be.add(Ke);return be},[ce?.config.leadSessionId,ce?.config.sessionHistory]),Ds=g.useMemo(()=>ee.filter(be=>cr.has(be.id)),[ee,cr]);g.useEffect(()=>{F.sessionId!==null&&!Ds.some(be=>be.id===F.sessionId)&&W(be=>({...be,sessionId:null}))},[F.sessionId,Ds]);const Ki=g.useMemo(()=>{if(F.sessionId===null)return null;const be=[...Ds].sort((ir,rt)=>ir.createdAt-rt.createdAt),Ke=be.findIndex(ir=>ir.id===F.sessionId);if(Ke===-1)return null;const Ft=be[Ke].createdAt,ur=Ke+1<be.length?be[Ke+1].createdAt:1/0;return{start:Ft,end:ur}},[F.sessionId,Ds]),hi=g.useMemo(()=>{if(!ce)return[];let be=ce.tasks;return Ki&&(be=be.filter(Ke=>{if(!Ke.createdAt)return!0;const Ft=new Date(Ke.createdAt).getTime();return Ft>=Ki.start&&Ft<Ki.end})),F.selectedOwners.size>0&&(be=be.filter(Ke=>Ke.owner?F.selectedOwners.has(Ke.owner):F.selectedOwners.has(Xee))),be},[ce,Ki,F.selectedOwners]),Ua=q8n(lr),fp=g.useMemo(()=>{const be=Ws.trim();return be?W8n(hi,be):hi},[hi,Ws]),Yf=g.useMemo(()=>Ua.filter(be=>!Yn(be)).length,[Ua]),Uo=g.useMemo(()=>new Map((ce?.tasks??[]).map(be=>[be.id,be])),[ce?.tasks]),hp=g.useRef(Uo);hp.current=Uo;const M_=g.useMemo(()=>Hxt(ce?.tasks??[]),[ce?.tasks]),za=g.useCallback((be="",Ke="",Ft="",ur)=>{m({open:!0,defaultSubject:be,defaultDescription:Ke,defaultOwner:Ft,defaultStartImmediately:ur})},[]),Q_=g.useCallback(()=>{m({open:!1,defaultSubject:"",defaultDescription:"",defaultOwner:"",defaultStartImmediately:void 0})},[]),D_=g.useCallback((be,Ke)=>{za(be,Ke)},[]),Fr=g.useCallback(be=>{L(be.from),Y(void 0),te(void 0),Z({from:be.from,text:Ea(be.text)}),j(!0)},[]),sd=g.useCallback(be=>{k({open:!0,mode:be})},[]),Gm=g.useCallback(()=>{k(be=>({...be,open:!1}))},[]),Vf=g.useCallback(()=>{sd("relaunch")},[sd]),Hm=g.useCallback(async be=>{await Ye(be),await Promise.all([Xt(),lt(e)])},[Xt,Ye,lt,e]),Jc=g.useCallback(async(be,Ke)=>{await L4n({teamName:e,isTeamAlive:ce?.isAlive===!0,request:be,members:Ke,stopTeam:Ft=>K.teams.stop(Ft),replaceMembers:(Ft,ur)=>K.teams.replaceMembers(Ft,ur),launchTeam:Ye}),await Promise.all([Xt(),lt(e)])},[ce?.isAlive,Xt,Ye,lt,e]),Jy=g.useCallback(async()=>{if(!ce?.config.projectPath)throw new Error("团队缺少项目路径,无法自动重启。");await K.teams.stop(e),await Ye({teamName:e,cwd:ce.config.projectPath}),await Promise.all([Xt(),lt(e)])},[ce?.config.projectPath,Xt,Ye,lt,e]),i1=g.useCallback(async be=>{if(!ce?.config.projectPath)throw new Error("团队缺少项目路径,无法自动重启。");await K.teams.stop(e);const Ke={teamName:e,cwd:ce.config.projectPath,providerId:be.providerId,model:be.model,effort:be.effort,fastMode:be.fastMode,clearContext:be.clearContext};await Ye(Ke)},[ce?.config.projectPath,Ye,e]),o1=g.useCallback(async be=>{await Re(e,be)},[Re,e]),eA=g.useCallback(async be=>{await xe(e,be)},[xe,e]),a1=g.useCallback(be=>{c(be),d(null)},[]),Zm=g.useCallback(()=>{c(null),d(null)},[]),ex=g.useCallback(be=>{L(be.name),Y(void 0),te(void 0),Z(void 0),j(!0)},[]),qf=g.useCallback(be=>{za("","",be.name)},[za]),tx=g.useCallback(be=>{const Ke=hp.current.get(be);Ke&&o(Ke)},[]),tA=g.useCallback(be=>{o(be)},[]),nA=g.useCallback(be=>{const Ke=Uo.get(be)??ce?.tasks.find(Ft=>Ft.displayId===be);Ke&&o(Ke)},[Uo,ce?.tasks]),rA=g.useCallback(be=>{const Ke=GJ(be,[])??void 0;be.type==="sendMessage"?(Y(Ke?void 0:be.formattedContext),te(Ke),L(void 0),Z(void 0),j(!0)):be.type==="createTask"&&(Ke?m({open:!0,defaultSubject:"",defaultDescription:"",defaultOwner:"",defaultStartImmediately:void 0,defaultChip:Ke}):za("",be.formattedContext))},[]);g.useEffect(()=>{mt&&(re({open:!0,mode:"task",taskId:mt.taskId,initialFilePath:mt.filePath,taskChangeRequestOptions:mt.requestOptions}),mt.filePath&&Ue(mt.filePath),St(null))},[mt,Ue,St]);const nx=le(be=>be.pendingMemberProfile);g.useEffect(()=>{if(!nx||!ce)return;const be=lr.find(Ke=>Ke.name===nx);be&&(c(be),d(null)),le.getState().closeMemberProfile()},[nx,lr]);const zo=g.useCallback(be=>{(async()=>{if(await Md({title:"删除任务",message:`将任务 #${to(be)} 移入废纸篓?`,confirmLabel:"删除",cancelLabel:"取消",variant:"danger"}))try{await Pe(e,be)}catch{}})()},[e,Pe]),L_=g.useCallback(be=>{const Ke=Uo.get(be);re({open:!0,mode:"task",taskId:be,taskChangeRequestOptions:Ke?Fc(Ke):{}})},[Uo]),QB=g.useCallback((be,Ke)=>{const Ft=Uo.get(be);re({open:!0,mode:"task",taskId:be,initialFilePath:Ke,taskChangeRequestOptions:Ft?Fc(Ft):{}}),Ke&&Ue(Ke)},[Ue,Uo]),sA=g.useCallback(()=>{U(!0)},[]),DB=g.useCallback(()=>{U(!1),(async()=>{try{(await jt(e)).restartRequired&&await Md({title:"需要重启 cc-connect",message:"已调用 cc-connect 删除团队配置。cc-connect 需要重启后才会真正移除该团队并停止相关运行时。",confirmLabel:"立即重启",cancelLabel:"稍后重启",variant:"danger"})&&await K.ccSettings.restart(),bn&&Zt(bn),Nt()}catch{}})()},[e,jt,Nt,Zt,bn]),LB=(be,Ke,Ft,ur,ir,rt,Qt,dr,yo)=>{_(!0),(async()=>{try{if(await _n(e,{subject:be,description:Ke||void 0,owner:Ft,blockedBy:ur,related:ir,prompt:rt,descriptionTaskRefs:dr,promptTaskRefs:yo,startImmediately:Qt}),rt&&Ft&&ce?.isAlive&&!Dt&&Qt!==!1){const eu=`New task assigned to ${Ft}: "${be}". Instructions:
1830
1830
  ${rt}`;try{await K.teams.processSend(e,eu)}catch{}}Q_()}catch{}finally{_(!1)}})()},jB=g.useMemo(()=>({teamName:e,onPositionChange:jr,mountPoint:null,members:Ua,tasks:ce?.tasks??[],isTeamAlive:ce?.isAlive,timeWindow:Ki,teamSessionIds:cr,currentLeadSessionId:ce?.config.leadSessionId,pendingRepliesByMember:p,onPendingReplyChange:f,onMemberClick:a1,onTaskClick:tA,onCreateTaskFromMessage:D_,onReplyToMessage:Fr,onRestartTeam:Vf,onTaskIdClick:nA,inlineScrollContainerRef:I,showPositionControls:!1}),[Ua,ce?.config.leadSessionId,ce?.isAlive,ce?.tasks,D_,tA,Fr,Vf,a1,nA,p,e,cr,Ki,jr]);if(!e)return u.jsx("div",{className:"flex size-full items-center justify-center p-6 text-sm text-red-400",children:"Invalid team tab"});const XB=u.jsx(K8n,{teamName:e,isTeamProvisioning:Dt,isTeamAlive:ce?.isAlive}),ve=u.jsx(e9n,{teamName:e,isTeamProvisioning:Dt,isTeamAlive:ce?.isAlive,isThisTabActive:zt}),gt=u.jsx(t9n,{teamName:e,tabId:bn,projectId:er,leadSessionId:oi,sessionHistoryKey:Kc,isThisTabActive:zt,isTeamAlive:ce?.isAlive,sessions:ee,sessionsLoading:Oe}),Gt=()=>{if(pe&&!ce||ce&&ce.teamName!==e)return u.jsxs("div",{className:"size-full overflow-auto p-4",children:[u.jsx("div",{className:"mb-4 h-10 animate-pulse rounded-md bg-[var(--color-surface-raised)]"}),u.jsx("div",{ref:$,children:u.jsx(ZM,{teamName:e})}),u.jsxs("div",{className:"space-y-3",children:[u.jsx("div",{className:"h-24 animate-pulse rounded-md bg-[var(--color-surface-raised)]"}),u.jsx("div",{className:"h-48 animate-pulse rounded-md bg-[var(--color-surface-raised)]"}),u.jsx("div",{className:"h-48 animate-pulse rounded-md bg-[var(--color-surface-raised)]"})]})]});if(Ee==="TEAM_DRAFT"){const rt=le.getState().teamByName[e],Qt=rt?.displayName||e;return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"size-full overflow-auto p-6",children:[u.jsx("div",{ref:$,children:u.jsx(ZM,{teamName:e})}),u.jsx("div",{className:"flex min-h-[calc(100vh-12rem)] items-center justify-center",children:u.jsxs("div",{className:"max-w-md text-center",children:[u.jsx("p",{className:"text-sm font-medium text-text",children:"团队尚未启动"}),u.jsxs("p",{className:"mt-2 text-xs text-text-secondary",children:["这是一个草稿团队。",u.jsx("strong",{children:Qt})," ","尚未完成启动,点击“启动团队”后即可选择模型并进入动态编排。"]}),u.jsxs("div",{className:"mt-4 flex justify-center gap-2",children:[u.jsx("button",{className:"rounded-md bg-blue-600 px-4 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500",onClick:()=>sd("launch"),children:"启动团队"}),u.jsx("button",{className:"rounded-md bg-surface-raised px-4 py-1.5 text-xs font-medium text-text-secondary transition-colors hover:text-text",onClick:()=>{K.teams.deleteDraft(e).catch(()=>{})},children:"删除"})]})]})})]}),u.jsx(jee,{mode:P.mode,open:Te,teamName:e,members:[],defaultProjectPath:rt?.projectPath,provisioningError:vt,clearProvisioningError:qt,onClose:Gm,onLaunch:Hm,onRelaunch:Jc})]})}if(Ee)return u.jsx("div",{className:"flex size-full items-center justify-center p-6",children:u.jsxs("div",{className:"text-center",children:[u.jsx("p",{className:"text-sm font-medium text-red-400",children:"团队加载失败"}),u.jsx("p",{className:"mt-2 text-xs text-[var(--color-text-muted)]",children:Ee}),u.jsx("div",{className:"mt-4",children:u.jsx(Xe,{size:"sm",variant:"outline",onClick:()=>void lt(e,{allowReloadWhileProvisioning:!0}),children:"重试加载"})})]})});if(!ce)return u.jsxs("div",{className:"size-full overflow-auto p-4",children:[u.jsx("div",{ref:$,children:u.jsx(ZM,{teamName:e})}),u.jsx("div",{className:"flex flex-1 items-center justify-center p-6 text-sm text-[var(--color-text-muted)]",children:"编排完成后,这里将显示团队数据"})]});const be=ce.config.color?zr(ce.config.color):Yc(ce.config.name),Ke=ce.settings??{},Ft=ce.config.managedSources??(typeof Ke.admin_from=="string"?Ke.admin_from:"*"),ur=ce.config.disabledCommands??(Array.isArray(Ke.disabled_commands)?Ke.disabled_commands.filter(rt=>typeof rt=="string"&&rt.trim().length>0):[]),ir=ce.config.platformAllowFrom??(typeof Ke.platform_allow_from=="object"&&Ke.platform_allow_from!==null&&!Array.isArray(Ke.platform_allow_from)?Ke.platform_allow_from:{});return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex size-full overflow-hidden",children:[u.jsx(n9n,{teamName:e,tabId:bn,projectId:er,leadSessionId:oi,fallbackProjectRoot:ce.config.projectPath}),u.jsx("div",{className:"relative min-h-0 min-w-0 flex-1",children:u.jsxs("div",{ref:I,className:"size-full min-w-0 overflow-y-auto overflow-x-hidden p-4","data-team-name":e,children:[u.jsxs("div",{className:"relative -mx-4 -mt-4 mb-3 overflow-hidden border-b border-[var(--color-border)] px-4 py-3",children:[be?u.jsx("div",{className:"pointer-events-none absolute inset-0 z-0",style:{backgroundColor:ti(be,n)}}):null,u.jsxs("div",{className:at("flex items-start justify-between gap-2",be&&"relative z-10"),children:[u.jsx("div",{className:"min-w-0 flex-1",children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("h2",{className:"text-base font-semibold text-[var(--color-text)]",children:ce.config.name}),ce.isAlive&&u.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-emerald-500/15 px-1.5 py-0.5 text-[10px] font-medium text-emerald-400",children:[u.jsx("span",{className:"size-1.5 rounded-full bg-emerald-400"}),"运行中"]}),!ce.isAlive&&Dt&&u.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-yellow-500/15 px-1.5 py-0.5 text-[10px] font-medium text-yellow-400",children:[u.jsx("span",{className:"size-1.5 animate-pulse rounded-full bg-yellow-400"}),"启动中..."]})]})}),u.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx(Xe,{variant:"ghost",size:"sm",className:"h-7 gap-1 px-2 text-xs text-[var(--color-text-muted)] hover:text-[var(--color-text)]",disabled:Dt,onClick:()=>T(!0),children:u.jsx(Nb,{size:12})})}),u.jsx(nt,{side:"bottom",children:Dt?"团队仍在编排中,暂时无法编辑":"编辑团队"})]}),u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx(Xe,{variant:"ghost",size:"sm",className:"h-7 gap-1 px-2 text-xs text-red-400 hover:bg-red-500/10 hover:text-red-300",onClick:sA,children:u.jsx(Si,{size:12})})}),u.jsx(nt,{side:"bottom",children:"删除团队"})]})]})]}),ce.config.description&&u.jsx("p",{className:at("min-w-0 truncate text-xs text-[var(--color-text-muted)]",be&&"relative z-10"),children:ce.config.description}),u.jsx("div",{className:at("mt-1 flex items-start justify-between gap-3",be&&"relative z-10"),children:u.jsxs("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-x-3 gap-y-0.5",children:[ce.config.projectPath&&u.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--color-text-secondary)]",children:[u.jsx(Bc,{size:11,className:"shrink-0 text-[var(--color-text-muted)]"}),u.jsxs(st,{children:[u.jsx(it,{asChild:!0,children:u.jsx("span",{className:"max-w-60 truncate font-mono",children:ce.config.projectPath.replace(/\\/g,"/").split("/").filter(Boolean).pop()??ce.config.projectPath})}),u.jsx(nt,{side:"bottom",children:u.jsx("span",{className:"font-mono text-xs",children:uee(ce.config.projectPath)})})]})]}),Br&&u.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--color-text-secondary)]",title:Br,children:[u.jsx(b$,{size:11,className:"shrink-0 text-[var(--color-text-muted)]"}),u.jsx("span",{className:"max-w-32 truncate",children:Br})]})]})}),(()=>{const rt=ce.config.projectPath,Qt=ce.config.projectPathHistory?.filter(dr=>dr!==rt);return!Qt||Qt.length===0?null:u.jsxs("div",{className:at("mt-0.5 flex items-center gap-1 text-[10px] text-[var(--color-text-muted)]",be&&"relative z-10"),children:[u.jsx(jne,{size:10,className:"shrink-0"}),u.jsxs("span",{className:"truncate",children:["历史路径:",Qt.map(dr=>uee(dr)).join(", ")]})]})})()]}),!ce.isAlive&&!Dt?u.jsx(G8n,{teamName:e,onLaunch:()=>sd("launch")}):null,u.jsx("div",{ref:$,children:u.jsx(ZM,{teamName:e})}),ce.warnings?.some(rt=>rt.toLowerCase().includes("kanban"))?u.jsx("div",{className:"mb-3 rounded-md border border-[var(--step-warning-border)] bg-[var(--step-warning-bg)] px-3 py-2 text-xs text-[var(--step-warning-text)]",children:"看板未完整加载,当前展示的是安全回退数据。"}):null,ut?u.jsx("div",{className:"mb-3 rounded-md border border-red-500/40 bg-red-500/10 px-3 py-2 text-xs text-[var(--step-error-text)]",children:ut}):null,u.jsx(Vp,{sectionId:"team",title:"团队",icon:u.jsx(rc,{size:14}),badge:Yf===0?"单人":Yf,defaultOpen:!0,children:u.jsx(r9n,{teamName:e,members:lr,memberTaskCounts:M_,taskMap:Uo,pendingRepliesByMember:p,isTeamAlive:ce.isAlive,isTeamProvisioning:Dt,launchParams:De,onMemberClick:a1,onSendMessage:ex,onAssignTask:qf,onOpenTask:tx,onRestartMember:o1,onSkipMemberForLaunch:eA})}),u.jsx(Vp,{sectionId:"kanban",title:"外部派单",icon:u.jsx(uR,{size:14}),badge:hi.length,defaultOpen:!0,forceOpen:Ws.trim().length>0,action:u.jsxs(Xe,{variant:"ghost",size:"sm",className:"h-6 gap-1 px-2 text-xs text-[var(--color-text-muted)] hover:text-[var(--color-text)]",onClick:rt=>{rt.stopPropagation(),za()},children:[u.jsx(fl,{size:12}),"新建"]}),children:u.jsx("div",{className:"min-w-0",children:u.jsx(OFn,{tasks:fp,teamName:e,kanbanState:ce.kanbanState,filter:F,sort:ue,sessions:Ds,leadSessionId:ce.config.leadSessionId,members:Ua,onFilterChange:W,onSortChange:ae,toolbarLeft:u.jsx(_Fn,{value:Ws,onChange:Ie,tasks:hi,members:Ua}),onRequestReview:rt=>{(async()=>{try{await ct(e,rt)}catch{}})()},onApprove:rt=>{(async()=>{try{await yt(e,rt,{op:"set_column",column:"approved"})}catch{}})()},onRequestChanges:rt=>{s(rt)},onMoveBackToDone:rt=>{(async()=>{try{await yt(e,rt,{op:"remove"}),await Ge(e,rt,"completed")}catch{}})()},onStartTask:rt=>{(async()=>{try{const Qt=await Be(e,rt);if(ce?.isAlive){const dr=ce.tasks.find(yo=>yo.id===rt);try{if(Qt.notifiedOwner&&dr?.owner)await K.teams.processSend(e,`Task ${Gr(dr)} "${dr.subject}" has started. Please begin working on it.`);else if(!Qt.notifiedOwner){const yo=dr?.description?.trim()?`
1831
1831
  Description: ${dr.description.trim()}`:"";await K.teams.processSend(e,`Task #${to(rt)} "${dr?.subject??""}" has been moved to IN PROGRESS but has no assignee.${yo}
1832
1832
  Please assign it to an available team member, or take it yourself if everyone is busy.`)}}catch{}}}catch{}})()},onCompleteTask:rt=>{(async()=>{try{await Ge(e,rt,"completed")}catch{}})()},onCancelTask:rt=>{(async()=>{try{const Qt=ce?.tasks.find(dr=>dr.id===rt);if(await Ge(e,rt,"pending"),Qt?.owner)try{await K.teams.sendMessage(e,{member:Qt.owner,text:`Task ${Gr(Qt)} "${Qt.subject}" has been CANCELLED by the user and moved back to TODO. Stop working on it immediately.`,summary:`Task ${Gr(Qt)} cancelled`})}catch{}if(ce?.isAlive)try{const dr=Qt?.owner?` ${Qt.owner} has been notified to stop.`:"";await K.teams.processSend(e,`Task #${to(rt)} "${Qt?.subject??""}" has been cancelled and moved back to TODO.${dr}`)}catch{}}catch{}})()},onColumnOrderChange:(rt,Qt)=>{(async()=>{try{await xt(e,rt,Qt)}catch{}})()},onScrollToTask:rt=>{const Qt=document.querySelector(`[data-task-id="${rt}"]`);Qt&&(Qt.scrollIntoView({behavior:"smooth",block:"nearest"}),Qt.classList.remove("kanban-card-focus-pulse"),Qt.offsetWidth,Qt.classList.add("kanban-card-focus-pulse"),Qt.addEventListener("animationend",()=>Qt.classList.remove("kanban-card-focus-pulse"),{once:!0}))},onTaskClick:rt=>{o(rt)},onViewChanges:L_,onAddTask:rt=>za("","","",rt),onDeleteTask:zo,deletedTaskCount:de.length,onOpenTrash:()=>V(!0)})})}),u.jsx(s9n,{position:"inline",...jB}),(ce.processes?.length??0)>0&&u.jsx(Vp,{sectionId:"processes",title:"CLI 进程",icon:u.jsx(Io,{size:14}),badge:ce.processes.filter(rt=>!rt.stoppedAt).length,headerExtra:ce.processes.some(rt=>!rt.stoppedAt)?u.jsxs("span",{className:"pointer-events-none relative inline-flex size-2 shrink-0",title:"活跃中",children:[u.jsx("span",{className:"absolute inline-flex size-full animate-ping rounded-full bg-emerald-400 opacity-50"}),u.jsx("span",{className:"relative inline-flex size-2 rounded-full bg-emerald-400"})]}):null,defaultOpen:!0,children:u.jsx(U8n,{teamName:e,members:lr,processes:ce.processes})}),u.jsx(N4n,{open:r!==null,teamName:e,taskId:r,members:H,onCancel:()=>s(null),onSubmit:(rt,Qt)=>{r&&(async()=>{try{await yt(e,r,{op:"request_changes",comment:rt,taskRefs:Qt}),s(null)}catch{}})()}}),u.jsx(i9n,{open:a!==null,member:a,teamName:e,members:lr,tasks:ce.tasks,initialTab:l?.initialTab,initialActivityFilter:l?.initialActivityFilter,isTeamAlive:ce.isAlive,isTeamProvisioning:Dt,launchParams:De,onClose:Zm,onSendMessage:()=>{const rt=a?.name??"";Zm(),L(rt||void 0),Y(void 0),te(void 0),Z(void 0),j(!0)},onAssignTask:()=>{const rt=a?.name??"";Zm(),za("","",rt)},onRestartMember:o1,onTaskClick:rt=>{Zm(),o(rt)},onUpdateRole:async(rt,Qt)=>{S(!0);try{await et(e,rt,Qt),c(dr=>{if(dr?.name!==rt)return dr;const yo=typeof Qt=="string"&&Qt.trim()?Qt.trim():void 0;return{...dr,role:yo}})}finally{S(!1)}},updatingRole:x,onRemoveMember:()=>{const rt=a?.name;rt&&y(rt)},onViewMemberChanges:(rt,Qt)=>{Zm(),re({open:!0,mode:"agent",memberName:rt,initialFilePath:Qt})}}),u.jsx(IZe,{open:h.open,teamName:e,members:Ua,tasks:ce.tasks,isTeamAlive:ce.isAlive&&!Dt,defaultSubject:h.defaultSubject,defaultDescription:h.defaultDescription,defaultOwner:h.defaultOwner,defaultStartImmediately:h.defaultStartImmediately,defaultChip:h.defaultChip,onClose:Q_,onSubmit:LB,submitting:O}),u.jsx(N3n,{open:v,teamName:e,currentName:ce.config.name,currentDescription:ce.config.description??"",currentColor:ce.config.color??"",currentAgentType:ce.config.agentType??ce.harness??"cursor",currentWorkDir:ce.workDir??ce.config.projectPath??"",currentPermissionMode:ce.config.permissionMode??ce.permissionMode??"default",currentLanguage:ce.config.language??(typeof Ke.language=="string"?Ke.language:"zh"),currentShowContextIndicator:ce.config.showContextIndicator??(typeof Ke.show_context_indicator=="boolean"?Ke.show_context_indicator:!0),currentReplyFooter:ce.config.replyFooter??(typeof Ke.reply_footer=="boolean"?Ke.reply_footer:!0),currentInjectSender:ce.config.injectSender??(typeof Ke.inject_sender=="boolean"?Ke.inject_sender:!1),currentManagedSources:Ft,currentDisabledCommands:ur,currentPlatformAllowFrom:ir,currentMembers:lr.filter(rt=>!Yn(rt)),leadMember:lr.find(rt=>Yn(rt))??null,resolvedMemberColorMap:xr,isTeamAlive:ce.isAlive&&!Dt,isTeamProvisioning:Dt,projectPath:ce.config.projectPath,savedLaunchRequest:E,onClose:()=>T(!1),onSaved:()=>{Xt(),lt(e)},onDeleteTeam:sA,onRestartTeam:Jy,onSaveAndRestart:i1}),u.jsx(Os,{open:b!==null,onOpenChange:rt=>{rt||y(null)},children:u.jsxs(ls,{className:"max-w-sm",children:[u.jsxs(gs,{children:[u.jsx(cs,{children:"移除成员"}),u.jsxs(Ti,{children:["确认将 “",b,"” 从团队中移除?任务与消息会保留, 但该名称将无法再次使用。"]})]}),u.jsxs(qc,{children:[u.jsx(Xe,{variant:"ghost",size:"sm",onClick:()=>y(null),children:"取消"}),u.jsx(Xe,{variant:"destructive",size:"sm",onClick:()=>{const rt=b;y(null),Zm(),rt&&Fe(e,rt)},children:"移除"})]})]})}),u.jsx(Os,{open:Q,onOpenChange:U,children:u.jsxs(ls,{className:"max-w-sm",children:[u.jsxs(gs,{children:[u.jsx(cs,{children:"删除团队"}),u.jsxs(Ti,{children:["确认删除团队 “",ce.config.name,"”?此操作不可恢复,所有团队数据与任务都将被删除。"]})]}),u.jsxs(qc,{children:[u.jsx(Xe,{variant:"ghost",size:"sm",onClick:()=>U(!1),children:"取消"}),u.jsx(Xe,{variant:"destructive",size:"sm",onClick:DB,children:"删除"})]})]})}),u.jsx(jee,{mode:P.mode,open:Te,teamName:e,members:lr,defaultProjectPath:ce.config.projectPath,projectPath:ce.config.projectPath,provisioningError:vt,clearProvisioningError:qt,activeTeams:se,onClose:Gm,onLaunch:Hm,onRelaunch:Jc}),u.jsx(D4n,{open:N,teamName:e,members:Ua,defaultRecipient:z,defaultText:q,defaultChip:ne,quotedMessage:G,isTeamAlive:ce.isAlive,sending:je,sendError:tt,sendWarning:kt,sendDebugDetails:en,lastResult:We,onSend:async(rt,Qt,dr,yo,eu,Km)=>{const Jm=Date.now();f(tu=>({...tu,[rt]:Jm}));try{const tu=await Lt(e,{member:rt,text:Qt,summary:dr,attachments:yo,actionMode:eu,taskRefs:Km});return tu?.runtimeDelivery?.attempted===!0&&tu.runtimeDelivery.delivered===!1&&f(Sr=>{if(Sr[rt]!==Jm)return Sr;const Bo={...Sr};return delete Bo[rt],Bo}),tu}catch(tu){throw f(Sr=>{if(Sr[rt]!==Jm)return Sr;const Bo={...Sr};return delete Bo[rt],Bo}),tu}},onClose:()=>{j(!1),Z(void 0),Y(void 0),te(void 0)}}),u.jsx(b7e,{open:i!==null,task:i,teamName:e,kanbanTaskState:i?ce?.kanbanState.tasks[i.id]:void 0,taskMap:Uo,members:Ua,onClose:()=>o(null),onScrollToTask:rt=>{o(null);const Qt=document.querySelector(`[data-task-id="${rt}"]`);Qt&&(Qt.scrollIntoView({behavior:"smooth",block:"nearest"}),Qt.classList.remove("kanban-card-focus-pulse"),Qt.offsetWidth,Qt.classList.add("kanban-card-focus-pulse"),Qt.addEventListener("animationend",()=>Qt.classList.remove("kanban-card-focus-pulse"),{once:!0}))},onOwnerChange:(rt,Qt)=>{(async()=>{try{await Pt(e,rt,Qt)}catch{}})()},onViewChanges:QB,onOpenInEditor:rt=>{const{revealFileInEditor:Qt}=le.getState();Qt(rt)},onDeleteTask:zo}),u.jsx(yFn,{open:A,tasks:de,onClose:()=>V(!1),onRestore:rt=>{(async()=>{try{await _e(e,rt)}catch{}})()}}),u.jsx(L8n,{open:oe.open,onOpenChange:rt=>re(Qt=>({...Qt,open:rt,...rt?{}:{initialFilePath:void 0,taskChangeRequestOptions:void 0}})),teamName:e,mode:oe.mode,memberName:oe.memberName,taskId:oe.taskId,initialFilePath:oe.initialFilePath,taskChangeRequestOptions:oe.taskChangeRequestOptions,projectPath:ce.config.projectPath,onEditorAction:rA})]})})]}),C&&ce.config.projectPath&&u.jsx(g.Suspense,{fallback:null,children:u.jsx(F8n,{projectPath:ce.config.projectPath,onClose:()=>M(!1),onEditorAction:rA})})]})};return u.jsxs(u.Fragment,{children:[XB,ve,gt,Gt()]})},wst=2,df="createTeamDraft:form";function a9n(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.version=="number"&&t.version===wst&&typeof t.teamName=="string"&&(t.cwdMode==="project"||t.cwdMode==="custom")&&typeof t.selectedProjectPath=="string"&&typeof t.customCwd=="string"&&typeof t.teamColor=="string"&&typeof t.updatedAt=="number"}let MB=!1,YRe=!1;const ZT=new Map;function aue(){YRe||(YRe=!0,console.warn("[createTeamDraftStorage] IndexedDB unavailable, using in-memory storage for this session.")),MB=!0}async function l9n(e){if(MB){ZT.set(df,e);return}try{await Ry(df,e)}catch{aue(),ZT.set(df,e)}}async function c9n(){if(MB)return ZT.get(df)??null;try{const e=await zd(df);return e==null?null:a9n(e)?e:(Za(df),null)}catch{return aue(),ZT.get(df)??null}}async function u9n(){if(MB){ZT.delete(df);return}try{await Za(df)}catch{aue(),ZT.delete(df)}}function d9n(){return{version:wst,teamName:"",cwdMode:"project",selectedProjectPath:"",customCwd:"",teamColor:"",updatedAt:Date.now()}}const Bx={saveSnapshot:l9n,loadSnapshot:c9n,deleteSnapshot:u9n,emptySnapshot:d9n},p9n=400,f9n=2;function h9n(){const[e,t]=g.useState(""),[n,r]=g.useState("project"),[s,i]=g.useState(""),[o,a]=g.useState(""),[c,l]=g.useState(""),[d,p]=g.useState(!1),f=g.useRef(""),h=g.useRef("project"),m=g.useRef(""),O=g.useRef(""),_=g.useRef(""),b=g.useRef(!0),y=g.useRef(!1),x=g.useRef(null),S=g.useRef(null);g.useEffect(()=>(b.current=!0,()=>{b.current=!1}),[]);const v=g.useCallback(()=>({version:f9n,teamName:f.current,cwdMode:h.current,selectedProjectPath:m.current,customCwd:O.current,teamColor:_.current,updatedAt:Date.now()}),[]),T=g.useCallback(()=>{if(x.current!=null&&(clearTimeout(x.current),x.current=null),S.current!=null){const R=S.current;S.current=null,R.teamName===""?Bx.deleteSnapshot():Bx.saveSnapshot(R)}},[]),E=g.useCallback(()=>{const R=v();S.current=R,x.current!=null&&clearTimeout(x.current),x.current=setTimeout(()=>{x.current=null;const N=S.current;if(S.current=null,N==null)return;N.teamName===""?Bx.deleteSnapshot():Bx.saveSnapshot(N)},p9n)},[v]),w=g.useCallback(R=>{f.current=R.teamName,h.current=R.cwdMode,m.current=R.selectedProjectPath,O.current=R.customCwd,_.current=R.teamColor,t(R.teamName),r(R.cwdMode),i(R.selectedProjectPath),a(R.customCwd),l(R.teamColor)},[]);g.useEffect(()=>{let R=!1;return(async()=>{const N=await Bx.loadSnapshot();if(!R){if(y.current){b.current&&p(!0);return}N!=null&&w(N),b.current&&p(!0)}})(),()=>{R=!0}},[w]),g.useEffect(()=>()=>{T()},[T]);const P=g.useCallback(R=>{y.current=!0,f.current=R,t(R),E()},[E]),k=g.useCallback(R=>{y.current=!0,h.current=R,r(R),E()},[E]),C=g.useCallback(R=>{y.current=!0,m.current=R,i(R),E()},[E]),M=g.useCallback(R=>{y.current=!0,O.current=R,a(R),E()},[E]),I=g.useCallback(R=>{y.current=!0,_.current=R,l(R),E()},[E]),$=g.useCallback(()=>{x.current!=null&&(clearTimeout(x.current),x.current=null),S.current=null,y.current=!0,f.current="",h.current="project",m.current="",O.current="",_.current="",t(""),r("project"),i(""),a(""),l(""),Bx.deleteSnapshot()},[]);return{teamName:e,setTeamName:P,cwdMode:n,setCwdMode:k,selectedProjectPath:s,setSelectedProjectPath:C,customCwd:o,setCustomCwd:M,teamColor:c,setTeamColor:I,isLoaded:d,clearDraft:$}}const d9={telegram:{label:"Telegram",fields:[{key:"token",label:"Bot Token",required:!0,type:"password",placeholder:"123456:ABC-DEF..."},{key:"allow_from",label:"Allow From",placeholder:"* (all)",group:"advanced",hint:"限制可交互的用户/群,* 表示所有"},{key:"group_reply_all",label:"群聊回复全部",type:"boolean",group:"advanced"},{key:"share_session_in_channel",label:"共享群会话",type:"boolean",group:"advanced"}]},discord:{label:"Discord",fields:[{key:"token",label:"Bot Token",required:!0,type:"password"},{key:"allow_from",label:"Allow From",placeholder:"* (all)",group:"advanced"},{key:"guild_id",label:"Guild ID",placeholder:"",group:"advanced",hint:"限定特定服务器"},{key:"group_reply_all",label:"群聊回复全部",type:"boolean",group:"advanced"},{key:"share_session_in_channel",label:"共享频道会话",type:"boolean",group:"advanced"},{key:"thread_isolation",label:"Thread 隔离",type:"boolean",group:"advanced"}]},slack:{label:"Slack",fields:[{key:"bot_token",label:"Bot Token",required:!0,type:"password",placeholder:"xoxb-..."},{key:"app_token",label:"App Token",required:!0,type:"password",placeholder:"xapp-..."},{key:"allow_from",label:"Allow From",placeholder:"* (all)",group:"advanced"},{key:"share_session_in_channel",label:"共享频道会话",type:"boolean",group:"advanced"}]},dingtalk:{label:"DingTalk",fields:[{key:"client_id",label:"Client ID",required:!0},{key:"client_secret",label:"Client Secret",required:!0,type:"password"},{key:"allow_from",label:"Allow From",placeholder:"* (all)",group:"advanced"},{key:"share_session_in_channel",label:"共享群会话",type:"boolean",group:"advanced"}]},wecom:{label:"企业微信",fields:[{key:"corp_id",label:"Corp ID",required:!0},{key:"corp_secret",label:"Corp Secret",required:!0,type:"password"},{key:"agent_id",label:"Agent ID",required:!0,placeholder:"1000002"},{key:"callback_token",label:"Callback Token",required:!0},{key:"callback_aes_key",label:"Callback AES Key",required:!0,hint:"43 位 AES 密钥"},{key:"port",label:"端口",required:!0,placeholder:"8081"},{key:"callback_path",label:"Callback Path",placeholder:"/wecom/callback",group:"advanced"},{key:"api_base_url",label:"API Base URL",placeholder:"https://qyapi.weixin.qq.com",group:"advanced"},{key:"allow_from",label:"Allow From",placeholder:"* (all)",group:"advanced"}]},qq:{label:"QQ (OneBot v11)",fields:[{key:"ws_url",label:"WebSocket URL",required:!0,placeholder:"ws://127.0.0.1:3001"},{key:"token",label:"Access Token",type:"password",group:"advanced"},{key:"allow_from",label:"Allow From",placeholder:"* (all)",group:"advanced"},{key:"share_session_in_channel",label:"共享群会话",type:"boolean",group:"advanced"}]},qqbot:{label:"QQ Bot (官方)",fields:[{key:"app_id",label:"App ID",required:!0},{key:"app_secret",label:"App Secret",required:!0,type:"password"},{key:"sandbox",label:"沙盒模式",type:"boolean",group:"advanced"},{key:"allow_from",label:"Allow From",placeholder:"* (all)",group:"advanced"},{key:"share_session_in_channel",label:"共享群会话",type:"boolean",group:"advanced"}]},line:{label:"LINE",fields:[{key:"channel_secret",label:"Channel Secret",required:!0,type:"password"},{key:"channel_token",label:"Channel Token",required:!0,type:"password"},{key:"port",label:"端口",required:!0,placeholder:"8080"},{key:"callback_path",label:"Callback Path",placeholder:"/callback",group:"advanced"},{key:"allow_from",label:"Allow From",placeholder:"* (all)",group:"advanced"}]},weibo:{label:"微博",fields:[{key:"app_id",label:"App ID",required:!0,placeholder:"1234567890"},{key:"app_secret",label:"App Secret",required:!0,type:"password"},{key:"allow_from",label:"Allow From",placeholder:"* (all)",group:"advanced"}]}},m9n=["feishu","lark","weixin"];function O9n(e){return m9n.includes(e)}var g9n=Object.defineProperty,kX=Object.getOwnPropertySymbols,kst=Object.prototype.hasOwnProperty,Cst=Object.prototype.propertyIsEnumerable,VRe=(e,t,n)=>t in e?g9n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fte=(e,t)=>{for(var n in t||(t={}))kst.call(t,n)&&VRe(e,n,t[n]);if(kX)for(var n of kX(t))Cst.call(t,n)&&VRe(e,n,t[n]);return e},hte=(e,t)=>{var n={};for(var r in e)kst.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&kX)for(var r of kX(e))t.indexOf(r)<0&&Cst.call(e,r)&&(n[r]=e[r]);return n};/**