@yancyyu/openhermit 1.6.1 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-renderer/assets/{ProjectEditorOverlay-DrZKGMUE.js → ProjectEditorOverlay-CbUuh4s6.js} +1 -1
- package/dist-renderer/assets/{TeamGraphOverlay-D0F9r5Fj.js → TeamGraphOverlay-BcW3BpwF.js} +1 -1
- package/dist-renderer/assets/{_basePickBy-D3hJcHOm.js → _basePickBy-CKIlmmKj.js} +1 -1
- package/dist-renderer/assets/{_baseUniq-DGaoGuIo.js → _baseUniq-BaszK-OV.js} +1 -1
- package/dist-renderer/assets/{arc-BEf0FRUv.js → arc-1fVqP9Ce.js} +1 -1
- package/dist-renderer/assets/{architectureDiagram-VXUJARFQ-CV0ZxlU6.js → architectureDiagram-VXUJARFQ-zam-7hA6.js} +1 -1
- package/dist-renderer/assets/{blockDiagram-VD42YOAC-BBgj7JQU.js → blockDiagram-VD42YOAC-D8xGHFXg.js} +1 -1
- package/dist-renderer/assets/{c4Diagram-YG6GDRKO-z4ASXsqO.js → c4Diagram-YG6GDRKO-Di5L-goJ.js} +1 -1
- package/dist-renderer/assets/channel-LMe_u94M.js +1 -0
- package/dist-renderer/assets/{chunk-4BX2VUAB-GgD2k-Lr.js → chunk-4BX2VUAB-CHzgY8XW.js} +1 -1
- package/dist-renderer/assets/{chunk-55IACEB6-DtIOM4VP.js → chunk-55IACEB6-ZdRwXKdJ.js} +1 -1
- package/dist-renderer/assets/{chunk-B4BG7PRW-vt_YV8kf.js → chunk-B4BG7PRW-B_uylMCY.js} +1 -1
- package/dist-renderer/assets/{chunk-DI55MBZ5-CkNWOUcb.js → chunk-DI55MBZ5-wYr371uz.js} +1 -1
- package/dist-renderer/assets/{chunk-FMBD7UC4-CfEfRL0J.js → chunk-FMBD7UC4-BfizdXAi.js} +1 -1
- package/dist-renderer/assets/{chunk-QN33PNHL-BuVE3RIP.js → chunk-QN33PNHL-Cj982aHa.js} +1 -1
- package/dist-renderer/assets/{chunk-QZHKN3VN-K_7QwWik.js → chunk-QZHKN3VN-XTwuzIO_.js} +1 -1
- package/dist-renderer/assets/{chunk-TZMSLE5B-DMp8QOiS.js → chunk-TZMSLE5B-CUwxAopg.js} +1 -1
- package/dist-renderer/assets/classDiagram-2ON5EDUG-BNtx_JTN.js +1 -0
- package/dist-renderer/assets/classDiagram-v2-WZHVMYZB-BNtx_JTN.js +1 -0
- package/dist-renderer/assets/clone-DDrblqPb.js +1 -0
- package/dist-renderer/assets/{cose-bilkent-S5V4N54A-BVY9tzNS.js → cose-bilkent-S5V4N54A-B8LUaIV2.js} +1 -1
- package/dist-renderer/assets/{dagre-6UL2VRFP--faZMK7S.js → dagre-6UL2VRFP-Yd_BzJ7X.js} +1 -1
- package/dist-renderer/assets/{diagram-PSM6KHXK-DmtFeluG.js → diagram-PSM6KHXK-DZn1fMo1.js} +1 -1
- package/dist-renderer/assets/{diagram-QEK2KX5R-Bcp7Lb0A.js → diagram-QEK2KX5R-DbhFrd7F.js} +1 -1
- package/dist-renderer/assets/{diagram-S2PKOQOG-ti_QkBTz.js → diagram-S2PKOQOG-D6oc2CRZ.js} +1 -1
- package/dist-renderer/assets/{erDiagram-Q2GNP2WA-BDEvbMUF.js → erDiagram-Q2GNP2WA-RrBObwfM.js} +1 -1
- package/dist-renderer/assets/{flowDiagram-NV44I4VS-kcRZb1MY.js → flowDiagram-NV44I4VS-xlLG9tm_.js} +1 -1
- package/dist-renderer/assets/{ganttDiagram-JELNMOA3-DqTbb3Zl.js → ganttDiagram-JELNMOA3-B6Al4dAh.js} +1 -1
- package/dist-renderer/assets/{gitGraphDiagram-V2S2FVAM-AldFx-Oq.js → gitGraphDiagram-V2S2FVAM-CuGidXMi.js} +1 -1
- package/dist-renderer/assets/{graph-DoTH18rj.js → graph-BQw-1-cA.js} +1 -1
- package/dist-renderer/assets/{index-Ci3TO_JU.js → index-BpJYupeN.js} +1 -1
- package/dist-renderer/assets/{index-BUfRAXh0.js → index-CKJk7OXh.js} +1 -1
- package/dist-renderer/assets/{index-DkKHJirK.js → index-CvnJPw8e.js} +1 -1
- package/dist-renderer/assets/{index-CcbnCZI-.js → index-DjwP6Ixl.js} +1 -1
- package/dist-renderer/assets/{index-CRzo33Zq.js → index-DzOCasPD.js} +7 -7
- package/dist-renderer/assets/{index-CPvx8mQq.js → index-aaTSqCVw.js} +1 -1
- package/dist-renderer/assets/{infoDiagram-HS3SLOUP-CZ8BxA5O.js → infoDiagram-HS3SLOUP-ngSZr4DB.js} +1 -1
- package/dist-renderer/assets/{journeyDiagram-XKPGCS4Q-DFap5MzN.js → journeyDiagram-XKPGCS4Q-DUYha9XK.js} +1 -1
- package/dist-renderer/assets/{kanban-definition-3W4ZIXB7-eL0Btbev.js → kanban-definition-3W4ZIXB7-DLZKoOOn.js} +1 -1
- package/dist-renderer/assets/{layout-DVFi6Pff.js → layout-4o4rszYm.js} +1 -1
- package/dist-renderer/assets/{linear-CcYzZckM.js → linear-DpDNspMR.js} +1 -1
- package/dist-renderer/assets/{mindmap-definition-VGOIOE7T-YdwndBk4.js → mindmap-definition-VGOIOE7T-DsyExv6x.js} +1 -1
- package/dist-renderer/assets/{pieDiagram-ADFJNKIX-C2bgVxYV.js → pieDiagram-ADFJNKIX-DLjsd_sD.js} +1 -1
- package/dist-renderer/assets/{quadrantDiagram-AYHSOK5B-DyiRJVZc.js → quadrantDiagram-AYHSOK5B-D25UFXCn.js} +1 -1
- package/dist-renderer/assets/{requirementDiagram-UZGBJVZJ-9dKf2vDK.js → requirementDiagram-UZGBJVZJ-1dT3ylVG.js} +1 -1
- package/dist-renderer/assets/{sankeyDiagram-TZEHDZUN-DM0P_yL1.js → sankeyDiagram-TZEHDZUN-B1LLRw_7.js} +1 -1
- package/dist-renderer/assets/{sequenceDiagram-WL72ISMW-BBGTN3ZY.js → sequenceDiagram-WL72ISMW-C2vbAh6y.js} +1 -1
- package/dist-renderer/assets/{stateDiagram-FKZM4ZOC-Bg5q7FLR.js → stateDiagram-FKZM4ZOC-eS7McRG8.js} +1 -1
- package/dist-renderer/assets/{stateDiagram-v2-4FDKWEC3-BEe_MxUA.js → stateDiagram-v2-4FDKWEC3-06gw1trU.js} +1 -1
- package/dist-renderer/assets/{timeline-definition-IT6M3QCI-CFHreXGq.js → timeline-definition-IT6M3QCI-CSL5SWqc.js} +1 -1
- package/dist-renderer/assets/treemap-GDKQZRPO-CLnyWw5Y.js +162 -0
- package/dist-renderer/assets/{xychartDiagram-PRI3JC2R-BtaW7FFn.js → xychartDiagram-PRI3JC2R-DpXwqxEZ.js} +1 -1
- package/dist-renderer/index.html +1 -1
- package/package.json +1 -1
- package/src/main/server.ts +16 -0
- package/src/renderer/store/slices/teamSlice.ts +30 -1
- package/dist-renderer/assets/channel-BmFF1HZd.js +0 -1
- package/dist-renderer/assets/classDiagram-2ON5EDUG-BcZUsklT.js +0 -1
- package/dist-renderer/assets/classDiagram-v2-WZHVMYZB-BcZUsklT.js +0 -1
- package/dist-renderer/assets/clone-DFAYLyhG.js +0 -1
- package/dist-renderer/assets/treemap-GDKQZRPO-CHC-_z92.js +0 -162
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BpJYupeN.js","assets/splashScene-C8lWNnm4.js","assets/index-DjwP6Ixl.js","assets/index-CKJk7OXh.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-CvnJPw8e.js","assets/index-aaTSqCVw.js","assets/dagre-6UL2VRFP-Yd_BzJ7X.js","assets/graph-BQw-1-cA.js","assets/_baseUniq-BaszK-OV.js","assets/layout-4o4rszYm.js","assets/_basePickBy-CKIlmmKj.js","assets/clone-DDrblqPb.js","assets/cose-bilkent-S5V4N54A-B8LUaIV2.js","assets/cytoscape.esm-DsxaTqgk.js","assets/c4Diagram-YG6GDRKO-Di5L-goJ.js","assets/chunk-TZMSLE5B-CUwxAopg.js","assets/flowDiagram-NV44I4VS-xlLG9tm_.js","assets/chunk-FMBD7UC4-BfizdXAi.js","assets/chunk-55IACEB6-ZdRwXKdJ.js","assets/chunk-QN33PNHL-Cj982aHa.js","assets/channel-LMe_u94M.js","assets/erDiagram-Q2GNP2WA-RrBObwfM.js","assets/gitGraphDiagram-V2S2FVAM-CuGidXMi.js","assets/chunk-4BX2VUAB-CHzgY8XW.js","assets/chunk-QZHKN3VN-XTwuzIO_.js","assets/treemap-GDKQZRPO-CLnyWw5Y.js","assets/ganttDiagram-JELNMOA3-B6Al4dAh.js","assets/linear-DpDNspMR.js","assets/init-Gi6I4Gst.js","assets/defaultLocale-DX6XiGOO.js","assets/infoDiagram-HS3SLOUP-ngSZr4DB.js","assets/pieDiagram-ADFJNKIX-DLjsd_sD.js","assets/arc-1fVqP9Ce.js","assets/ordinal-Cboi1Yqb.js","assets/quadrantDiagram-AYHSOK5B-D25UFXCn.js","assets/xychartDiagram-PRI3JC2R-DpXwqxEZ.js","assets/requirementDiagram-UZGBJVZJ-1dT3ylVG.js","assets/sequenceDiagram-WL72ISMW-C2vbAh6y.js","assets/classDiagram-2ON5EDUG-BNtx_JTN.js","assets/chunk-B4BG7PRW-B_uylMCY.js","assets/classDiagram-v2-WZHVMYZB-BNtx_JTN.js","assets/stateDiagram-FKZM4ZOC-eS7McRG8.js","assets/chunk-DI55MBZ5-wYr371uz.js","assets/stateDiagram-v2-4FDKWEC3-06gw1trU.js","assets/journeyDiagram-XKPGCS4Q-DUYha9XK.js","assets/timeline-definition-IT6M3QCI-CSL5SWqc.js","assets/mindmap-definition-VGOIOE7T-DsyExv6x.js","assets/kanban-definition-3W4ZIXB7-DLZKoOOn.js","assets/sankeyDiagram-TZEHDZUN-B1LLRw_7.js","assets/diagram-S2PKOQOG-D6oc2CRZ.js","assets/diagram-QEK2KX5R-DbhFrd7F.js","assets/blockDiagram-VD42YOAC-D8xGHFXg.js","assets/architectureDiagram-VXUJARFQ-zam-7hA6.js","assets/diagram-PSM6KHXK-DZn1fMo1.js","assets/TeamGraphOverlay-BcW3BpwF.js","assets/ProjectEditorOverlay-CbUuh4s6.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{L as lD,g as xPe,P as SPe,s as ait}from"./splashScene-C8lWNnm4.js";function lit(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 cit="modulepreload",uit=function(e){return"/"+e},bue={},Qe=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=uit(c),c in bue)return;bue[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":cit,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 Qe(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 KC=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function q7n(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 vPe={exports:{}},jX={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.js
|
|
@@ -1029,11 +1029,11 @@ Error:`,s)}}function ebt(){return U0t(e=>{L$("cls",{metric:e}),NQe=e},{reportAll
|
|
|
1029
1029
|
`;)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=W5e(n.from-r,t.ranges);if(n.to-r<=t.ranges[t.rangeI].to)t.addNode(n.tree,d);else{let p=new xr(t.parser.nodeSet.types[At.Paragraph],[],[],0,t.block.hashProp);t.reusePlaceholders.set(p,n.tree),t.addNode(p,d)}if(n.type.is("Block")&&(r$t.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 W5e(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 i$t=yo({"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}),o$t=new uz(new kE(X5e).extend(i$t),Object.keys(pI).map(e=>pI[e]),Object.keys(pI).map(e=>L5e[e]),Object.keys(pI),JPt,R5e,Object.keys(GF).map(e=>GF[e]),Object.keys(GF),[]);function a$t(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 l$t(e){let{codeParser:t,htmlParser:n}=e;return{wrap:VU((s,i)=>{let o=s.type.id;if(t&&(o==At.CodeBlock||o==At.FencedCode)){let a="";if(o==At.FencedCode){let l=s.node.getChild(At.CodeInfo);l&&(a=i.read(l.from,l.to))}let c=t(a);if(c)return{parser:c,overlay:l=>l.type.id==At.CodeText,bracketed:o==At.FencedCode}}else if(n&&(o==At.HTMLBlock||o==At.HTMLTag||o==At.CommentBlock))return{parser:n,overlay:a$t(s.node,s.from,s.to)};return null})}}const c$t={resolve:"Strikethrough",mark:"StrikethroughMark"},u$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=JR.test(r),c=JR.test(s);return e.addDelimiter(c$t,n,n+2,!o&&(!c||i||a),!i&&(!a||o||c))},after:"Emphasis"}]};function tC(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 Kme(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 G5e=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class Jme{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)&&G5e.test(s=n.text.slice(n.pos))){let i=[];tC(t,r.content,0,i,r.start)==tC(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=[];tC(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 d$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 Kme(t.content,0)?new Jme:null},endLeaf(e,t,n){if(n.parsers.some(s=>s instanceof Jme)||!Kme(t.text,t.basePos))return!1;let r=e.peekLine();return G5e.test(r)&&tC(e,t.text,t.basePos)==tC(e,r,t.basePos)},before:"SetextHeading"}]};class p$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 f$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 p$t:null},after:"SetextHeading"}]},eOe=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,tOe=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,h$t=/[\w-]+\.[\w-]+($|\/)/,nOe=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,rOe=/\/[a-zA-Z\d@.]+/gy;function sOe(e,t,n,r){let s=0;for(let i=t;i<n;i++)e[i]==r&&s++;return s}function m$t(e,t){tOe.lastIndex=t;let n=tOe.exec(e);if(!n||h$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==")"&&sOe(e,t,r,")")>sOe(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 iOe(e,t){nOe.lastIndex=t;let n=nOe.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 O$t={parseInline:[{name:"Autolink",parse(e,t,n){let r=n-e.offset;if(r&&/\w/.test(e.text[r-1]))return-1;eOe.lastIndex=r;let s=eOe.exec(e.text),i=-1;if(!s)return-1;if(s[1]||s[2]){if(i=m$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=iOe(e.text,r):(i=iOe(e.text,r+s[0].length),i>-1&&s[0]=="xmpp:"&&(rOe.lastIndex=i,s=rOe.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)}}]},g$t=[d$t,f$t,u$t,O$t];function H5e(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)),ud(c))break}return-1}}const _$t={defineNodes:[{name:"Superscript",style:X.special(X.content)},{name:"SuperscriptMark",style:X.processingInstruction}],parseInline:[{name:"Superscript",parse:H5e(94,"Superscript","SuperscriptMark")}]},b$t={defineNodes:[{name:"Subscript",style:X.special(X.content)},{name:"SubscriptMark",style:X.processingInstruction}],parseInline:[{name:"Subscript",parse:H5e(126,"Subscript","SubscriptMark")}]},y$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=tz({commentTokens:{block:{open:"<!--",close:"-->"}}}),K5e=new Un,J5e=o$t.configure({props:[So.add(e=>!e.is("Block")||e.is("Document")||sZ(e)!=null||x$t(e)?void 0:(t,n)=>({from:n.doc.lineAt(t.from).to,to:t.to})),K5e.add(sZ),xo.add({Document:()=>null}),lg.add({Document:Z5e})]});function sZ(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function x$t(e){return e.name=="OrderedList"||e.name=="BulletList"}function S$t(e,t){let n=e;for(;;){let r=n.nextSibling,s;if(!r||(s=sZ(r.type))!=null&&s<=t)break;n=r}return n.to}const v$t=dLe.of((e,t,n)=>{for(let r=rs(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let s=r.type.prop(K5e);if(s==null)continue;let i=S$t(r,s);if(i>n)return{from:n,to:i}}return null});function yse(e){return new Lc(Z5e,e,[],"markdown")}const eje=yse(J5e),T$t=J5e.configure([g$t,b$t,_$t,y$t,{props:[So.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),eP=yse(T$t);function E$t(e,t){return n=>{if(n&&e){let r=null;if(n=/\S*/.exec(n)[0],typeof e=="function"?r=e(n):r=Ve.matchLanguageName(e,n,!0),r instanceof Ve)return r.support?r.support.language.parser:vL.getSkippingParser(r.load());if(r)return r.parser}return t?t.parser:null}}let HF=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(+nje(this.item,t)[2]+n):"";return this.spaceBefore+r+this.type+this.spaceAfter}};function tje(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 HF(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 HF(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 HF(i.parent,c,c+d,o[1],l,p,i))}}return r}function nje(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function ZF(e,t,n,r=0){for(let s=-1,i=e;;){if(i.name=="ListItem"){let a=nje(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 xse(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(Y$)!=" ")return e;let r=$m(e,4,n),s="";for(let i=r;i>0;)i>=4?(s+=" ",i-=4):(s+=" ",i--);return s+e.slice(n)}const rje=(e={})=>({state:t,dispatch:n})=>{let r=rs(t),{doc:s}=t,i=null,o=t.changeByRange(a=>{if(!a.empty||!eP.isActiveAt(t,a.from,-1)&&!eP.isActiveAt(t,a.from,1))return i={range:a};let c=a.from,l=s.lineAt(c),d=tje(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"&&ZF(p.item,s,T,-2),x&&x.node.name=="OrderedList"&&ZF(x.item,s,T),{range:pt.cursor(S+v.length),changes:T}}else{let x=aOe(d,t,l);return{range:pt.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"&&ZF(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?$m(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=xse(O,t),w$t(p.node,t.doc)&&(O=aOe(d,t,l)+t.lineBreak+O),h.push({from:_,to:c,insert:t.lineBreak+O}),{range:pt.cursor(_+O.length+1),changes:h}});return i?!1:(n(t.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)},sje=rje();function oOe(e){return e.name=="QuoteMark"||e.name=="ListMark"}function w$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 aOe(e,t,n){let r="";for(let s=0,i=e.length-2;s<=i;s++)r+=e[s].blank(s<i?$m(n.text,4,e[s+1].from)-r.length:null,s<i);return xse(r,t)}function k$t(e,t){let n=e.resolveInner(t,-1),r=t;oOe(n)&&(r=n.from,n=n.parent);for(let s;s=n.childBefore(r);)if(oOe(s))r=s.from;else if(s.name=="OrderedList"||s.name=="BulletList")n=s.lastChild,r=n.to;else break;return n}const ije=({state:e,dispatch:t})=>{let n=rs(e),r=null,s=e.changeByRange(i=>{let o=i.from,{doc:a}=e;if(i.empty&&eP.isActiveAt(e,i.from)){let c=a.lineAt(o),l=tje(k$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:pt.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($m(c.text,4,d.to)-$m(c.text,4,d.from));return f==c.from&&(h=xse(h,e)),{range:pt.cursor(f+h.length),changes:{from:f,to:c.from+d.to,insert:h}}}if(f<o)return{range:pt.cursor(f),changes:{from:f,to:o}}}}}return r={range:i}});return r?!1:(t(e.update(s,{scrollIntoView:!0,userEvent:"delete"})),!0)},oje=[{key:"Enter",run:sje},{key:"Backspace",run:ije}],aje=cz({matchClosingTags:!1});function lje(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:s}=eje,completeHTMLTags:i=!0,pasteURLAsLink:o=!0,htmlTagLanguage:a=aje}=e;if(!(s instanceof uz))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],l=[a.support,v$t],d;o&&l.push(cje),n instanceof Zi?(l.push(n.support),d=n.language):n&&(d=n);let p=t||d?E$t(t,d):void 0;c.push(l$t({codeParser:p,htmlParser:a.language.parser})),r&&l.push(CE.high(JU.of(oje)));let f=yse(s.configure(c));return i&&l.push(f.data.of({autocomplete:C$t})),new Zi(f,l)}function C$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:R$t(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let KF=null;function R$t(){if(KF)return KF;let e=O5e(new ACt(si.create({extensions:aje}),0,!0));return KF=e?e.options:[]}const P$t=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,cje=Wt.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),!eP.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||P$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)}}),$$t=Object.freeze(Object.defineProperty({__proto__:null,commonmarkLanguage:eje,deleteMarkupBackward:ije,insertNewlineContinueMarkup:sje,insertNewlineContinueMarkupCommand:rje,markdown:lje,markdownKeymap:oje,markdownLanguage:eP,pasteURLAsLink:cje},Symbol.toStringTag,{value:"Module"})),N$t=1,A$t=2,I$t=275,M$t=3,Q$t=276,lOe=277,D$t=278,L$t=4,j$t=5,X$t=6,U$t=7,cOe=8,z$t=9,B$t=10,F$t=11,Y$t=12,V$t=13,q$t=14,W$t=15,G$t=16,H$t=17,Z$t=18,K$t=19,J$t=20,eNt=21,tNt=22,nNt=23,rNt=24,sNt=25,iNt=26,oNt=27,aNt=28,lNt=29,cNt=30,uNt=31,dNt=32,pNt=33,fNt=34,hNt=35,mNt=36,ONt=37,gNt=38,_Nt=39,bNt=40,yNt=41,xNt=42,SNt=43,vNt=44,TNt=45,ENt=46,wNt=47,kNt=48,CNt=49,RNt=50,PNt=51,$Nt=52,NNt=53,ANt=54,INt=55,MNt=56,QNt=57,DNt=58,LNt=59,jNt=60,XNt=61,UNt=62,JF=63,zNt=64,BNt=65,FNt=66,YNt={abstract:L$t,and:j$t,array:X$t,as:U$t,true:cOe,false:cOe,break:z$t,case:B$t,catch:F$t,clone:Y$t,const:V$t,continue:q$t,declare:G$t,default:W$t,do:H$t,echo:Z$t,else:K$t,elseif:J$t,enddeclare:eNt,endfor:tNt,endforeach:nNt,endif:rNt,endswitch:sNt,endwhile:iNt,enum:oNt,extends:aNt,final:lNt,finally:cNt,fn:uNt,for:dNt,foreach:pNt,from:fNt,function:hNt,global:mNt,goto:ONt,if:gNt,implements:_Nt,include:bNt,include_once:yNt,instanceof:xNt,insteadof:SNt,interface:vNt,list:TNt,match:ENt,namespace:wNt,new:kNt,null:CNt,or:RNt,print:PNt,readonly:$Nt,require:NNt,require_once:ANt,return:INt,switch:MNt,throw:QNt,trait:DNt,try:LNt,unset:jNt,use:XNt,var:UNt,public:JF,private:JF,protected:JF,while:zNt,xor:BNt,yield:FNt,__proto__:null};function uOe(e){let t=YNt[e.toLowerCase()];return t??-1}function dOe(e){return e==9||e==10||e==13||e==32}function uje(e){return e>=97&&e<=122||e>=65&&e<=90}function nC(e){return e==95||e>=128||uje(e)}function eY(e){return e>=48&&e<=55||e>=97&&e<=102||e>=65&&e<=70}const VNt={int:!0,integer:!0,bool:!0,boolean:!0,float:!0,double:!0,real:!0,string:!0,array:!0,object:!0,unset:!0,__proto__:null},qNt=new Hn(e=>{if(e.next==40){e.advance();let t=0;for(;dOe(e.peek(t));)t++;let n="",r;for(;uje(r=e.peek(t));)n+=String.fromCharCode(r),t++;for(;dOe(e.peek(t));)t++;e.peek(t)==41&&VNt[n.toLowerCase()]&&e.acceptToken(N$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(),!nC(e.next))return;let n=String.fromCharCode(e.next);for(;e.advance(),!(!nC(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(A$t)}}}}),WNt=new Hn(e=>{e.next<0&&e.acceptToken(D$t)}),GNt=new Hn((e,t)=>{e.next==63&&t.canShift(lOe)&&e.peek(1)==62&&e.acceptToken(lOe)});function HNt(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&&eY(e.peek(2)))return eY(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(!eY(r))break}return 0}const ZNt=new Hn((e,t)=>{let n=!1;for(;!(e.next==34||e.next<0||e.next==36&&(nC(e.peek(1))||e.peek(1)==123)||e.next==123&&e.peek(1)==36);n=!0){if(e.next==92){let r=HNt(e);if(r){if(n)break;return e.acceptToken(M$t,r)}}else if(!n&&(e.next==91||e.next==45&&e.peek(1)==62&&nC(e.peek(2))||e.next==63&&e.peek(1)==45&&e.peek(2)==62&&nC(e.peek(3)))&&t.canShift(Q$t))break;e.advance()}n&&e.acceptToken(I$t)}),KNt=yo({"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}),JNt={__proto__:null,static:325,STATIC:325,class:351,CLASS:351},eAt=go.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'#GoO/bQ`O'#GtOhQaO'#GvO;iQ`O'#GwO;nQ`O'#GzO:]Q`O'#G}O;sQeO'#HOO;sQeO'#HPO;sQeO'#HQO;}Q`O'#HRO<SQ`O'#HTO<XQaO'#HUO>hQ`O'#HVO:]Q`O'#HWO>mQ`O'#HWO;}Q`O'#HXO:]Q`O'#HZO:]Q`O'#H[O:]Q`O'#H]O>rQ`O'#H`O>}Q`O'#HaO<XQaO'#HeOOQ#u'#Ic'#IcOOQ#u'#Hj'#HjQhQaOOO:]Q`O'#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<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:[KNt],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#U#V!9Y#V#o!7z#o#p!Cs#p#q!Da#q#r!Ev#r#s!Fd#s$f$z$f$g&^$g&j!7z&j$I_$z$I_$I`&^$I`$KW$z$KW$KX&^$KX;'S$z;'S;=`&W<%l?HT$z?HT?HU&^?HUO$zP%PV'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zP%kO'TPP%nWOY$zYZ%fZ!a$z!b;'S$z;'S;=`&W<%l~$z~O$z~~%fP&ZP;=`<%l$z_&ed'TP'S^OX$zXY&^YZ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[xo.add({IfStatement:Ei({except:/^\s*({|else\b|elseif\b|endif\b)/}),TryStatement:Ei({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":Rf({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"String BlockComment":()=>null,Statement:Ei({except:/^({|end(for|foreach|switch|while)\b)/})}),So.add({"Block EnumBody DeclarationList SwitchBody ArrayExpression ValueList":cd,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 pje(e={}){let t=[],n;if(e.baseLanguage!==null)if(e.baseLanguage)n=e.baseLanguage;else{let r=cz({matchClosingTags:!1});t.push(r.support),n=r.language}return new Zi(dje.configure({wrap:n&&VU(r=>r.type.isTop?{parser:n.parser,overlay:s=>s.name=="Text"}:null),top:e.plain?"Program":"Template"}),t)}const tAt=Object.freeze(Object.defineProperty({__proto__:null,php:pje,phpLanguage:dje},Symbol.toStringTag,{value:"Module"})),nAt=1,fje=194,hje=195,rAt=196,pOe=197,sAt=198,iAt=199,oAt=200,aAt=2,mje=3,fOe=201,lAt=24,cAt=25,uAt=49,dAt=50,pAt=55,fAt=56,hAt=57,mAt=59,OAt=60,gAt=61,_At=62,bAt=63,yAt=65,xAt=238,SAt=71,vAt=241,TAt=242,EAt=243,wAt=244,kAt=245,CAt=246,RAt=247,PAt=248,Oje=72,$At=249,NAt=250,AAt=251,IAt=252,MAt=253,QAt=254,DAt=255,LAt=256,jAt=73,XAt=77,UAt=263,zAt=112,BAt=130,FAt=151,YAt=152,VAt=155,Gb=10,tP=13,Sse=32,dz=9,vse=35,qAt=40,WAt=46,iZ=123,hOe=125,gje=39,_je=34,mOe=92,GAt=111,HAt=120,ZAt=78,KAt=117,JAt=85,eIt=new Set([cAt,uAt,dAt,UAt,yAt,BAt,fAt,hAt,xAt,_At,bAt,Oje,jAt,XAt,OAt,gAt,FAt,YAt,VAt,zAt]);function tY(e){return e==Gb||e==tP}function nY(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}const tIt=new Hn((e,t)=>{let n;if(e.next<0)e.acceptToken(iAt);else if(t.context.flags&VQ)tY(e.next)&&e.acceptToken(sAt,1);else if(((n=e.peek(-1))<0||tY(n))&&t.canShift(pOe)){let r=0;for(;e.next==Sse||e.next==dz;)e.advance(),r++;(e.next==Gb||e.next==tP||e.next==vse)&&e.acceptToken(pOe,-r)}else tY(e.next)&&e.acceptToken(rAt,1)},{contextual:!0}),nIt=new Hn((e,t)=>{let n=t.context;if(n.flags)return;let r=e.peek(-1);if(r==Gb||r==tP){let s=0,i=0;for(;;){if(e.next==Sse)s++;else if(e.next==dz)s+=8-s%8;else break;e.advance(),i++}s!=n.indent&&e.next!=Gb&&e.next!=tP&&e.next!=vse&&(s<n.indent?e.acceptToken(hje,-i):e.acceptToken(fje))}}),VQ=1,bje=2,Sh=4,vh=8,Th=16,Eh=32;function qQ(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 rIt=new qQ(null,0,0);function sIt(e){let t=0;for(let n=0;n<e.length;n++)t+=e.charCodeAt(n)==dz?8-t%8:1;return t}const OOe=new Map([[vAt,0],[TAt,Sh],[EAt,vh],[wAt,vh|Sh],[kAt,Th],[CAt,Th|Sh],[RAt,Th|vh],[PAt,Th|vh|Sh],[$At,Eh],[NAt,Eh|Sh],[AAt,Eh|vh],[IAt,Eh|vh|Sh],[MAt,Eh|Th],[QAt,Eh|Th|Sh],[DAt,Eh|Th|vh],[LAt,Eh|Th|vh|Sh]].map(([e,t])=>[e,t|bje])),iIt=new zy({start:rIt,reduce(e,t,n,r){return e.flags&VQ&&eIt.has(t)||(t==SAt||t==Oje)&&e.flags&bje?e.parent:e},shift(e,t,n,r){return t==fje?new qQ(e,sIt(r.read(r.pos,n.pos)),0):t==hje?e.parent:t==lAt||t==pAt||t==mAt||t==mje?new qQ(e,0,VQ):OOe.has(t)?new qQ(e,0,OOe.get(t)|e.flags&VQ):e},hash(e){return e.hash}}),oIt=new Hn(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==Sse||n==dz)){n!=qAt&&n!=WAt&&n!=Gb&&n!=tP&&n!=vse&&e.acceptToken(nAt);return}}}),aIt=new Hn((e,t)=>{let{flags:n}=t.context,r=n&Sh?_je:gje,s=(n&vh)>0,i=!(n&Th),o=(n&Eh)>0,a=e.pos;for(;!(e.next<0);)if(o&&e.next==iZ)if(e.peek(1)==iZ)e.advance(2);else{if(e.pos==a){e.acceptToken(mje,1);return}break}else if(i&&e.next==mOe){if(e.pos==a){e.advance();let c=e.next;c>=0&&(e.advance(),lIt(e,c)),e.acceptToken(aAt);return}break}else if(e.next==mOe&&!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(fOe,s?3:1);return}break}else if(e.next==Gb){if(s)e.advance();else if(e.pos==a){e.acceptToken(fOe);return}break}else e.advance();e.pos>a&&e.acceptToken(oAt)});function lIt(e,t){if(t==GAt)for(let n=0;n<2&&e.next>=48&&e.next<=55;n++)e.advance();else if(t==HAt)for(let n=0;n<2&&nY(e.next);n++)e.advance();else if(t==KAt)for(let n=0;n<4&&nY(e.next);n++)e.advance();else if(t==JAt)for(let n=0;n<8&&nY(e.next);n++)e.advance();else if(t==ZAt&&e.next==iZ){for(e.advance();e.next>=0&&e.next!=hOe&&e.next!=gje&&e.next!=_je&&e.next!=Gb;)e.advance();e.next==hOe&&e.advance()}}const cIt=yo({'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}),uIt={__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},dIt=go.deserialize({version:14,states:"##jO`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS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y*z*}+U+V+Y+a+d+k,X,Y,],g,h,i,k,l,o,s,u,w,y,z-O-d-f-m-p.f.g/V/Z0i0j0kQ#qpW%W!o!s0d0nQ%X!pQ%Y!qQ%[!tQ%f0cS'v%Z0hQ'x0eQ'y0fQ,p*rQ-u,qS.i-s/sR0p0rU#uq.k0qR(w&][cOn#g$j)t,PZ!xY#[#}$Q+YQ#W[Q#zrR$TxQ%b!yQ%i!}Q%o#RQ'j${Q(V%eQ(Z%jQ(c%pQ(f%qQ*|(`Q,f*bQ-t,pQ.m-uR/].lQ$StQ(R%cR*s(SQ.l-sR/}/sR#QZR#V[R%Q!iQ%O!iV*c'm*d,g!Z!lQ!n#c#p$R$d$p$u$v$w$x$y$z%e%j%p%q&`'O'g(q(|)j*o*x+w,v0gR%T!kT#]^#_Q%x#[R,{+YQ(m%xS+_(n(oQ,}+`Q-x,{S.n-y-zR/^.oT+Z(k+]Q$`}Q&g$QQ)o'PR+{)pQ$XzQ)W&qR+i)XQ$XzQ&o$WQ)W&qR+i)XQ#khW$Vz$W&q)XQ$[{Q&r$ZZ)R&l)S+f+g-RR$^|R)c&wXlOn)t,PQ$f!RR'Q$gQ$m!UR'R$hR*X'_Q*V'_V-g,`-h.TQ.d-lQ/P.^R/Q._U.]-l.^._Q/U.aQ/b.tQ/g.zU/i.|/j/yQ/n/RQ/|/oQ0O/tU0Q/u0S0[Q0]0UQ0a0ZR0b0^R/T.`R/d.t",nodeNames:"⚠ print Escape { Comment Script AssignStatement * BinaryExpression BitOp BitOp BitOp BitOp ArithOp ArithOp @ 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:iIt,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:[cIt],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!R;k!R![>_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2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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:[oIt,nIt,tIt,aIt,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:e=>uIt[e]||-1}],tokenPrec:7668}),gOe=new FU,yje=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function hI(e){return(t,n,r)=>{if(r)return!1;let s=t.node.getChild("VariableName");return s&&n(s,e),!0}}const pIt={FunctionDefinition:hI("function"),ClassDefinition:hI("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:hI("variable"),AsPattern:hI("variable"),__proto__:null};function xje(e,t){let n=gOe.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=pIt[o.name];if(a&&a(o,i,s)||!s&&yje.has(o.name))return!1;s=!1}else if(o.to-o.from>8192){for(let a of xje(e,o.node))r.push(a);return!1}}),gOe.set(t,r),r}const _Oe=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,Sje=["String","FormatString","Comment","PropertyName"];function vje(e){let t=rs(e.state).resolveInner(e.pos,-1);if(Sje.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&_Oe.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let r=[];for(let s=t;s;s=s.parent)yje.has(s.name)&&(r=r.concat(xje(e.state.doc,s)));return{options:r,from:n?t.from:e.pos,validFor:_Oe}}const fIt=["__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"}))),hIt=[br("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),br("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),br("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),br("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),br(`if \${}:
|
|
1030
1030
|
|
|
1031
1031
|
`,{label:"if",detail:"block",type:"keyword"}),br("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),br("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),br("import ${module}",{label:"import",detail:"statement",type:"keyword"}),br("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],Tje=lz(Sje,az(fIt.concat(hIt)));function rY(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 sY(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 WQ=_o.define({name:"python",parser:dIt.configure({props:[xo.add({Body:e=>{var t;let n=/^\s*(#|$)/.test(e.textAfter)&&rY(e)||e.node;return(t=sY(e,n))!==null&&t!==void 0?t:e.continue()},MatchBody:e=>{var t;let n=rY(e);return(t=sY(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":Rf({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":Rf({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":Rf({closing:"]"}),MemberExpression:e=>e.baseIndent+e.unit,"String FormatString":()=>null,Script:e=>{var t;let n=rY(e);return(t=n&&sY(e,n))!==null&&t!==void 0?t:e.continue()}}),So.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":cd,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 Eje(){return new Zi(WQ,[WQ.data.of({autocomplete:vje}),WQ.data.of({autocomplete:Tje})])}const mIt=Object.freeze(Object.defineProperty({__proto__:null,globalCompletion:Tje,localCompletionSource:vje,python:Eje,pythonLanguage:WQ},Symbol.toStringTag,{value:"Module"})),OIt=1,gIt=2,_It=3,bIt=4,yIt=5,bOe=98,xIt=101,SIt=102,yOe=114,vIt=69,mI=48,xOe=46,TIt=43,EIt=45,SOe=35,vOe=34,wIt=124,kIt=60,CIt=62;function oZ(e){return e>=48&&e<=57}function OI(e){return oZ(e)||e==95}const RIt=new Hn((e,t)=>{if(oZ(e.next)){let n=!1;do e.advance();while(OI(e.next));if(e.next==xOe){if(n=!0,e.advance(),oZ(e.next))do e.advance();while(OI(e.next));else if(e.next==xOe||e.next>127||/\w/.test(String.fromCharCode(e.next)))return}if(e.next==xIt||e.next==vIt){if(n=!0,e.advance(),(e.next==TIt||e.next==EIt)&&e.advance(),!OI(e.next))return;do e.advance();while(OI(e.next))}if(e.next==SIt){let r=e.peek(1);if(r==mI+3&&e.peek(2)==mI+2||r==mI+6&&e.peek(2)==mI+4)e.advance(3),n=!0;else return}n&&e.acceptToken(yIt)}else if(e.next==bOe||e.next==yOe){if(e.next==bOe&&e.advance(),e.next!=yOe)return;e.advance();let n=0;for(;e.next==SOe;)n++,e.advance();if(e.next!=vOe)return;e.advance();e:for(;;){if(e.next<0)return;let r=e.next==vOe;if(e.advance(),r){for(let s=0;s<n;s++){if(e.next!=SOe)continue e;e.advance()}e.acceptToken(bIt);return}}}}),PIt=new Hn(e=>{e.next==wIt&&e.acceptToken(OIt,1)}),$It=new Hn(e=>{e.next==kIt?e.acceptToken(gIt,1):e.next==CIt&&e.acceptToken(_It,1)}),NIt=yo({"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}),AIt={__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},IIt=go.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'#Em'#EmOOQV'#En'#EnO.YQ_O'#EkO0_Q_O'#EoO2gQWOOO4QQ_O'#FPO7hQWO'#J`OOQV'#FY'#FYO7{Q_O'#F^O:WQ_O'#FaOOQO'#F`'#F`O=sQ_O'#FcO=}Q_O'#FbO@VQWO'#FgOOQO'#J`'#J`OOQV'#Io'#IoOA]Q_O'#InOEPQWO'#InOOQV'#Fw'#FwOF[QWO'#JuOFcQWO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7S7g7{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,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{!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:[PIt,$It,RIt,0,1,2,3],topRules:{SourceFile:[0,8]},specialized:[{term:281,get:e=>AIt[e]||-1}],tokenPrec:15596}),wje=_o.define({name:"rust",parser:IIt.configure({props:[xo.add({IfExpression:Ei({except:/^\s*({|else\b)/}),"String BlockComment":()=>null,AttributeItem:e=>e.continue(),"Statement MatchArm":Ei()}),So.add(e=>{if(/(Block|edTokens|List)$/.test(e.name))return cd;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 kje(){return new Zi(wje)}const MIt=Object.freeze(Object.defineProperty({__proto__:null,rust:kje,rustLanguage:wje},Symbol.toStringTag,{value:"Module"})),Cje=168,aZ=169,QIt=170,DIt=1,LIt=2,TOe=3,jIt=171,XIt=172,EOe=4,wOe=173,UIt=5,zIt=174,kOe=175,COe=176,iY=177,ROe=6,POe=7,BIt=8,FIt=9,pz=0,Jh=[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],YIt=58,VIt=40,Tse=95,qIt=91,rC=45,WIt=46,Ese=35,GIt=37,Rje=123,HIt=125,sC=47,iC=42,Mu=10,$Oe=61,ZIt=43,KIt=38;function gT(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function wse(e){return e>=48&&e<=57}function kse(e){let t;return e.next==sC&&((t=e.peek(1))==sC||t==iC)}const JIt=new Hn((e,t)=>{if(t.dialectEnabled(pz)){let n;if(e.next<0&&t.canShift(COe))e.acceptToken(COe);else if(((n=e.peek(-1))==Mu||n<0)&&t.canShift(kOe)){let r=0;for(;e.next!=Mu&&Jh.includes(e.next);)e.advance(),r++;e.next==Mu||kse(e)?e.acceptToken(kOe,-r):r&&e.acceptToken(iY)}else if(e.next==Mu)e.acceptToken(zIt,1);else if(Jh.includes(e.next)){for(e.advance();e.next!=Mu&&Jh.includes(e.next);)e.advance();e.acceptToken(iY)}}else{let n=0;for(;Jh.includes(e.next);)e.advance(),n++;n&&e.acceptToken(iY)}},{contextual:!0}),eMt=new Hn((e,t)=>{if(kse(e)){if(e.advance(),t.dialectEnabled(pz)){let n=-1;for(let r=1;;r++){let s=e.peek(-r-1);if(s==Mu||s<0){n=r+1;break}else if(!Jh.includes(s))break}if(n>-1){let r=e.next==iC,s=0;for(e.advance();e.next>=0;)if(e.next==Mu){e.advance();let i=0;for(;e.next!=Mu&&Jh.includes(e.next);)i++,e.advance();if(i<n){s=-i-1;break}}else if(r&&e.next==iC&&e.peek(1)==sC){s=2;break}else e.advance();e.acceptToken(r?POe:ROe,s);return}}if(e.next==sC){for(;e.next!=Mu&&e.next>=0;)e.advance();e.acceptToken(ROe)}else{for(e.advance();e.next>=0;){let{next:n}=e;if(e.advance(),n==iC&&e.next==sC){e.advance();break}}e.acceptToken(POe)}}}),tMt=new Hn((e,t)=>{(e.next==ZIt||e.next==$Oe)&&t.dialectEnabled(pz)&&e.acceptToken(e.next==$Oe?BIt:FIt,1)}),nMt=new Hn((e,t)=>{if(!t.dialectEnabled(pz))return;let n=t.context.depth;if(e.next<0&&n){e.acceptToken(aZ);return}if(e.peek(-1)==Mu){let s=0;for(;e.next!=Mu&&Jh.includes(e.next);)e.advance(),s++;s!=n&&e.next!=Mu&&!kse(e)&&(s<n?e.acceptToken(aZ,-s):e.acceptToken(Cje))}}),rMt=new Hn((e,t)=>{for(let n=!1,r=0,s=0;;s++){let{next:i}=e;if(gT(i)||i==rC||i==Tse||n&&wse(i))!n&&(i!=rC||s>0)&&(n=!0),r===s&&i==rC&&r++,e.advance();else if(i==Ese&&e.peek(1)==Rje){e.acceptToken(UIt,2);break}else{n&&e.acceptToken(r==2&&t.canShift(EOe)?EOe:t.canShift(wOe)?wOe:i==VIt?jIt:XIt);break}}}),sMt=new Hn(e=>{if(e.next==HIt){for(e.advance();gT(e.next)||e.next==rC||e.next==Tse||wse(e.next);)e.advance();e.next==Ese&&e.peek(1)==Rje?e.acceptToken(LIt,2):e.acceptToken(DIt)}}),iMt=new Hn(e=>{if(Jh.includes(e.peek(-1))){let{next:t}=e;(gT(t)||t==Tse||t==Ese||t==WIt||t==qIt||t==YIt&&gT(e.peek(1))||t==rC||t==KIt||t==iC)&&e.acceptToken(QIt)}}),oMt=new Hn(e=>{if(!Jh.includes(e.peek(-1))){let{next:t}=e;if(t==GIt&&(e.advance(),e.acceptToken(TOe)),gT(t)){do e.advance();while(gT(e.next)||wse(e.next));e.acceptToken(TOe)}}});function Pje(e,t){this.parent=e,this.depth=t,this.hash=(e?e.hash+e.hash<<8:0)+t+(t<<4)}const aMt=new Pje(null,0),lMt=new zy({start:aMt,shift(e,t,n,r){return t==Cje?new Pje(e,n.pos-r.pos):t==aZ?e.parent:e},hash(e){return e.hash}}),cMt=yo({"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}),uMt={__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},dMt={__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},pMt={__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},fMt={__proto__:null,layer:166,not:184,only:184,selector:190},hMt=go.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}O%rQ.jO'#E`O%rQ.jO'#EcO%rQ.jO'#EeO(cQ)OO'#EjO)TQ)OO'#ElO%rQ.jO'#EnO)bQ)OO'#EqO%rQ.jO'#EsO)|Q)OO'#EuO*XQ)OO'#ExO*aQ)OO'#FOO*uQ)OO'#FbOOQ&Z'#GW'#GWOOQ&Y'#Fe'#FeO+PQ(nO'#FeQ`Q+tOOO%r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Q&]$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:lMt,nodeProps:[["openedBy",1,"InterpolationStart",5,"InterpolationEnd",21,"(",43,"[",78,"{"],["isolate",-3,6,7,26,""],["closedBy",22,")",44,"]",70,"}"]],propSources:[cMt],skippedNodes:[0,6,7,146],repeatNodeCount:21,tokenData:"!$Q~RyOq#rqr$jrs0jst2^tu8{uv;hvw;{wx<^xy={yz>^z{>c{|>||}Co}!ODQ!O!PDo!P!QFY!Q![Fk![!]Gf!]!^Hb!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ROy$Rz;'S$R;'S;=`$d<%lO$R]!#hU!dPOy$Rz!_$R!_!`;T!`;'S$R;'S;=`$d<%lO$RW!#}P;=`<%l#r",tokenizers:[nMt,iMt,sMt,oMt,rMt,JIt,eMt,tMt,0,1,2,3,4],topRules:{StyleSheet:[0,10],Styles:[1,145]},dialects:{indented:0},specialized:[{term:172,get:e=>uMt[e]||-1},{term:171,get:e=>dMt[e]||-1},{term:80,get:e=>pMt[e]||-1},{term:173,get:e=>fMt[e]||-1}],tokenPrec:3217}),$L=_o.define({name:"sass",parser:hMt.configure({props:[So.add({Block:cd,Comment(e,t){return{from:e.from+2,to:t.sliceDoc(e.to-2,e.to)=="*/"?e.to-2:e.to}}}),xo.add({Declaration:Ei()})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"},line:"//"},indentOnInput:/^\s*\}$/,wordChars:"$-"}}),mMt=$L.configure({dialect:"indented",props:[xo.add({"Block RuleSet":e=>e.baseIndent+e.unit}),So.add({Block:e=>({from:e.from,to:e.to})})]}),$je=oz(e=>e.name=="VariableName"||e.name=="SassVariableName");function lZ(e){return new Zi(e?.indented?mMt:$L,$L.data.of({autocomplete:$je}))}const NOe=Object.freeze(Object.defineProperty({__proto__:null,sass:lZ,sassCompletionSource:$je,sassLanguage:$L},Symbol.toStringTag,{value:"Module"})),OMt=36,AOe=1,gMt=2,xx=3,oY=4,_Mt=5,bMt=6,yMt=7,xMt=8,SMt=9,vMt=10,TMt=11,EMt=12,wMt=13,kMt=14,CMt=15,RMt=16,PMt=17,IOe=18,$Mt=19,Nje=20,Aje=21,MOe=22,NMt=23,AMt=24;function cZ(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57}function IMt(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function y0(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 MMt(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 QMt(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 uZ(e,t){for(;!(e.next!=95&&!cZ(e.next));)t!=null&&(t+=String.fromCharCode(e.next)),e.advance();return t}function DMt(e){if(e.next==39||e.next==34||e.next==96){let t=e.next;e.advance(),y0(e,t,!1)}else uZ(e)}function QOe(e,t){for(;e.next==48||e.next==49;)e.advance();t&&e.next==t&&e.advance()}function DOe(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 LOe(e){for(;!(e.next<0||e.next==10);)e.advance()}function t0(e,t){for(let n=0;n<t.length;n++)if(t.charCodeAt(n)==e)return!0;return!1}const aY=` \r
|
|
1032
|
-
`;function Ije(e,t,n){let r=Object.create(null);r.true=r.false=_Mt,r.null=r.unknown=bMt;for(let s of e.split(" "))s&&(r[s]=Nje);for(let s of t.split(" "))s&&(r[s]=Aje);for(let s of(n||"").split(" "))s&&(r[s]=AMt);return r}const By="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 ",Fy="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 ",dZ={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:Ije(Fy,By)};function LMt(e,t,n,r){let s={};for(let i in dZ)s[i]=(e.hasOwnProperty(i)?e:dZ)[i];return t&&(s.words=Ije(t,n||"",r)),s}function Mje(e){return new Hn(t=>{var n;let{next:r}=t;if(t.advance(),t0(r,aY)){for(;t0(t.next,aY);)t.advance();t.acceptToken(OMt)}else if(r==36&&e.doubleDollarQuotedStrings){let s=uZ(t,"");t.next==36&&(t.advance(),MMt(t,s),t.acceptToken(xx))}else if(r==39||r==34&&e.doubleQuotedStrings)y0(t,r,e.backslashEscapes),t.acceptToken(xx);else if(r==35&&e.hashComments||r==47&&t.next==47&&e.slashComments)LOe(t),t.acceptToken(AOe);else if(r==45&&t.next==45&&(!e.spaceAfterDashes||t.peek(1)==32))LOe(t),t.acceptToken(AOe);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(gMt)}else if((r==101||r==69)&&t.next==39)t.advance(),y0(t,39,!0),t.acceptToken(xx);else if((r==110||r==78)&&t.next==39&&e.charSetCasts)t.advance(),y0(t,39,e.backslashEscapes),t.acceptToken(xx);else if(r==95&&e.charSetCasts)for(let s=0;;s++){if(t.next==39&&s>1){t.advance(),y0(t,39,e.backslashEscapes),t.acceptToken(xx);break}if(!cZ(t.next))break;t.advance()}else if(e.plsqlQuotingMechanism&&(r==113||r==81)&&t.next==39&&t.peek(1)>0&&!t0(t.peek(1),aY)){let s=t.peek(1);t.advance(2),QMt(t,s),t.acceptToken(xx)}else if(t0(r,e.identifierQuotes)){const s=r==91?93:r;y0(t,s,!1),t.acceptToken($Mt)}else if(r==40)t.acceptToken(yMt);else if(r==41)t.acceptToken(xMt);else if(r==123)t.acceptToken(SMt);else if(r==125)t.acceptToken(vMt);else if(r==91)t.acceptToken(TMt);else if(r==93)t.acceptToken(EMt);else if(r==59)t.acceptToken(wMt);else if(e.unquotedBitLiterals&&r==48&&t.next==98)t.advance(),QOe(t),t.acceptToken(MOe);else if((r==98||r==66)&&(t.next==39||t.next==34)){const s=t.next;t.advance(),e.treatBitsAsBytes?(y0(t,s,e.backslashEscapes),t.acceptToken(NMt)):(QOe(t,s),t.acceptToken(MOe))}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();IMt(t.next);)t.advance();s&&t.next==39&&t.advance(),t.acceptToken(oY)}else if(r==46&&t.next>=48&&t.next<=57)DOe(t,!0),t.acceptToken(oY);else if(r==46)t.acceptToken(kMt);else if(r>=48&&r<=57)DOe(t,!1),t.acceptToken(oY);else if(t0(r,e.operatorChars)){for(;t0(t.next,e.operatorChars);)t.advance();t.acceptToken(CMt)}else if(t0(r,e.specialVar))t.next==r&&t.advance(),DMt(t),t.acceptToken(PMt);else if(r==58||r==44)t.acceptToken(RMt);else if(cZ(r)){let s=uZ(t,String.fromCharCode(r));t.acceptToken(t.next==46||t.peek(-s.length-1)==46?IOe:(n=e.words[s.toLowerCase()])!==null&&n!==void 0?n:IOe)}})}const Qje=Mje(dZ),jMt=go.deserialize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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,Qje],topRules:{Script:[0,25]},tokenPrec:0});function pZ(e){let t=e.cursor().moveTo(e.from,-1);for(;/Comment/.test(t.name);)t.moveTo(t.from,-1);return t.node}function nP(e,t){let n=e.sliceString(t.from,t.to),r=/^([`'"\[])(.*)([`'"\]])$/.exec(n);return r?r[2]:n}function NL(e){return e&&(e.name=="Identifier"||e.name=="QuotedIdentifier")}function XMt(e,t){if(t.name=="CompositeIdentifier"){let n=[];for(let r=t.firstChild;r;r=r.nextSibling)NL(r)&&n.push(nP(e,r));return n}return[nP(e,t)]}function jOe(e,t){for(let n=[];;){if(!t||t.name!=".")return n;let r=pZ(t);if(!NL(r))return n;n.unshift(nP(e,r)),t=pZ(r)}}function UMt(e,t){let n=rs(e).resolveInner(t,-1),r=BMt(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:jOe(e.doc,pZ(n)),aliases:r}:n.name=="."?{from:t,quoted:null,parents:jOe(e.doc,n),aliases:r}:{from:t,quoted:null,parents:[],empty:!0,aliases:r}}const zMt=new Set("where group having order union intersect except all distinct limit offset fetch for".split(" "));function BMt(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&&NL(s.nextSibling))c=nP(e,s.nextSibling);else{if(a&&zMt.has(a))break;o&&NL(s)&&(c=nP(e,s))}c&&(r||(r=Object.create(null)),r[c]=XMt(e,o)),o=/Identifier$/.test(s.name)?s:null}return r}function FMt(e,t,n){return n.map(r=>({...r,label:r.label[0]==e?r.label:e+r.label+t,apply:void 0}))}const YMt=/^\w*$/,VMt=/^[`'"\[]?\w*[`'"\]]?$/;function XOe(e){return e.self&&typeof e.self.label=="string"}class Cse{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(UOe(t,"type",this.idQuote,this.idCaseInsensitive)),n[t]=new Cse(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"?UOe(n,"property",this.idQuote,this.idCaseInsensitive):n)}addNamespace(t){Array.isArray(t)?this.addCompletions(t):XOe(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;XOe(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 UOe(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+Dje(n)}}function Dje(e){return e==="["?"]":e}function qMt(e,t,n,r,s,i){var o;let a=((o=i?.spec.identifierQuotes)===null||o===void 0?void 0:o[0])||'"',c=new Cse(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}=UMt(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=Dje(y),S=d.state.sliceDoc(d.pos,d.pos+1)==x;return{from:f,to:S?d.pos+1:void 0,options:FMt(y,x,b),validFor:VMt}}else return{from:f,options:b,validFor:YMt}}}function WMt(e){return e==Aje?"type":e==Nje?"keyword":"variable"}function GMt(e,t,n){let r=Object.keys(e).map(s=>n(t?s.toUpperCase():s,WMt(e[s])));return lz(["QuotedIdentifier","String","LineComment","BlockComment","."],az(r))}let HMt=jMt.configure({props:[xo.add({Statement:Ei()}),So.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}}}),yo({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 nd{constructor(t,n,r){this.dialect=t,this.language=n,this.spec=r}get extension(){return this.language.extension}configureLanguage(t,n){return new nd(this.dialect,this.language.configure(t,n),this.spec)}static define(t){let n=LMt(t,t.keywords,t.types,t.builtin),r=_o.define({name:"sql",parser:HMt.configure({tokenizers:[{from:Qje,to:Mje(n)}]}),languageData:{commentTokens:{line:"--",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}});return new nd(n,r,t)}}function ZMt(e,t){return{label:e,type:t,boost:-1}}function Lje(e,t=!1,n){return GMt(e.dialect.words,t,n||ZMt)}function jje(e){return e.schema?qMt(e.schema,e.tables,e.schemas,e.defaultTable,e.defaultSchema,e.dialect||fz):()=>null}function KMt(e){return e.schema?(e.dialect||fz).language.data.of({autocomplete:jje(e)}):[]}function Xje(e={}){let t=e.dialect||fz;return new Zi(t.language,[KMt(e),t.language.data.of({autocomplete:Lje(t,e.upperCaseKeywords,e.keywordCompletion)})])}const fz=nd.define({}),JMt=nd.define({charSetCasts:!0,doubleDollarQuotedStrings:!0,operatorChars:"+-*/<>=~!@#%^&|`?",specialVar:"",keywords:Fy+"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:By+"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"}),Uje="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",zje=By+"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",Bje="charset clear edit ego help nopager notee nowarning pager print prompt quit rehash source status system tee",eQt=nd.define({operatorChars:"*+-%<>!=&|^",charSetCasts:!0,doubleQuotedStrings:!0,unquotedBitLiterals:!0,hashComments:!0,spaceAfterDashes:!0,specialVar:"@?",identifierQuotes:"`",keywords:Fy+"group_concat "+Uje,types:zje,builtin:Bje}),tQt=nd.define({operatorChars:"*+-%<>!=&|^",charSetCasts:!0,doubleQuotedStrings:!0,unquotedBitLiterals:!0,hashComments:!0,spaceAfterDashes:!0,specialVar:"@?",identifierQuotes:"`",keywords:Fy+"always generated groupby_concat hard persistent shutdown soft virtual "+Uje,types:zje,builtin:Bje});let nQt="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 rQt=nd.define({keywords:Fy+"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:By+"smalldatetime datetimeoffset datetime2 datetime bigint smallint smallmoney tinyint money real text nvarchar ntext varbinary image hierarchyid uniqueidentifier sql_variant xml",builtin:nQt,operatorChars:"*+-%<>!=^&|/",specialVar:"@",identifierQuotes:'"['}),sQt=nd.define({keywords:Fy+"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:By+"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:"@:?$"}),iQt=nd.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:By+"ascii bigint blob counter frozen inet list map static text timeuuid tuple uuid varint",slashComments:!0}),oQt=nd.define({keywords:Fy+"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:By+"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}),aQt=Object.freeze(Object.defineProperty({__proto__:null,Cassandra:iQt,MSSQL:rQt,MariaSQL:tQt,MySQL:eQt,PLSQL:oQt,PostgreSQL:JMt,SQLDialect:nd,SQLite:sQt,StandardSQL:fz,keywordCompletionSource:Lje,schemaCompletionSource:jje,sql:Xje},Symbol.toStringTag,{value:"Module"})),fZ=1,lQt=2,cQt=3,uQt=4,dQt=5,pQt=36,fQt=37,hQt=38,mQt=11,OQt=13;function gQt(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function _Qt(e){return e==9||e==10||e==13||e==32}let zOe=null,BOe=null,FOe=0;function hZ(e,t){let n=e.pos+t;if(BOe==e&&FOe==n)return zOe;for(;_Qt(e.peek(t));)t++;let r="";for(;;){let s=e.peek(t);if(!gQt(s))break;r+=String.fromCharCode(s),t++}return BOe=e,FOe=n,zOe=r||null}function YOe(e,t){this.name=e,this.parent=t}const bQt=new zy({start:null,shift(e,t,n,r){return t==fZ?new YOe(hZ(r,1)||"",e):e},reduce(e,t){return t==mQt&&e?e.parent:e},reuse(e,t,n,r){let s=t.type.id;return s==fZ||s==OQt?new YOe(hZ(r,1)||"",e):e},strict:!1}),yQt=new Hn((e,t)=>{if(e.next==60){if(e.advance(),e.next==47){e.advance();let n=hZ(e,0);if(!n)return e.acceptToken(dQt);if(t.context&&n==t.context.name)return e.acceptToken(lQt);for(let r=t.context;r;r=r.parent)if(r.name==n)return e.acceptToken(cQt,-2);e.acceptToken(uQt)}else if(e.next!=33&&e.next!=63)return e.acceptToken(fZ)}},{contextual:!0});function Rse(e,t){return new Hn(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 xQt=Rse(pQt,"-->"),SQt=Rse(fQt,"?>"),vQt=Rse(hQt,"]]>"),TQt=yo({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)}),EQt=go.deserialize({version:14,states:",lOQOaOOOrOxO'#CfOzOpO'#CiO!tOaO'#CgOOOP'#Cg'#CgO!{OrO'#CrO#TOtO'#CsO#]OpO'#CtOOOP'#DT'#DTOOOP'#Cv'#CvQQOaOOOOOW'#Cw'#CwO#eOxO,59QOO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}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:bQt,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:[TQt],skippedNodes:[0],repeatNodeCount:9,tokenData:"!)v~R!YOX$qXY)iYZ)iZ]$q]^)i^p$qpq)iqr$qrs*vsv$qvw+fwx/ix}$q}!O0[!O!P$q!P!Q2z!Q![$q![!]4n!]!^$q!^!_8U!_!`!#t!`!a!$l!a!b!%d!b!c$q!c!}4n!}#P$q#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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:[yQt,xQt,SQt,vQt,0,1,2,3,4],topRules:{Document:[0,6]},tokenPrec:0});function GQ(e,t){let n=t&&t.getChild("TagName");return n?e.sliceString(n.from,n.to):""}function lY(e,t){let n=t&&t.firstChild;return!n||n.name!="OpenTag"?"":GQ(e,n)}function wQt(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 cY(e){for(let t=e&&e.parent;t;t=t.parent)if(t.name=="Element")return t;return null}function kQt(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:cY(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:cY(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:cY(r)}:null}let CQt=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 uY=/^[:\-\.\w\u00b7-\uffff]*$/;function VOe(e){return Object.assign(Object.assign({type:"property"},e.completion||{}),{label:e.name})}function qOe(e){return typeof e=="string"?{label:`"${e}"`,type:"constant"}:/^"/.test(e.label)?e:Object.assign(Object.assign({},e),{label:`"${e.label}"`})}function Fje(e,t){let n=[],r=[],s=Object.create(null);for(let c of t){let l=VOe(c);n.push(l),c.global&&r.push(l),c.values&&(s[c.name]=c.values.map(qOe))}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(qOe)),VOe(f)))));let p=new CQt(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=kQt(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,_=lY(d,m);if(_){let b=a[_];O=b?.children||i}return{from:h,options:O.map(b=>b.completion),validFor:uY}}else if(f=="closeTag"){let O=lY(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:uY}:null}else if(f=="attrName"){let O=a[GQ(d,m)];return{from:h,options:O?.attrs||r,validFor:uY}}else if(f=="attrValue"){let O=wQt(d,m,h);if(!O)return null;let _=a[GQ(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=lY(d,m),_=a[O],b=[],y=m&&m.lastChild;O&&(!y||y.name!="CloseTag"||GQ(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 AL=_o.define({name:"xml",parser:EQt.configure({props:[xo.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}}),So.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 Yje(e={}){let t=[AL.data.of({autocomplete:Fje(e.elements||[],e.attributes||[])})];return e.autoCloseTags!==!1&&t.push(Vje),new Zi(AL,t)}function WOe(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 Vje=Wt.inputHandler.of((e,t,n,r,s)=>{if(e.composing||e.state.readOnly||t!=n||r!=">"&&r!="/"||!AL.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=WOe(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=WOe(o.doc,_,f))){let b=f+(o.doc.sliceString(f,f+1)===">"?1:0),y=`${O}>`;return{range:pt.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)}),RQt=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:Vje,completeFromSchema:Fje,xml:Yje,xmlLanguage:AL},Symbol.toStringTag,{value:"Module"})),rS=63,GOe=64,PQt=1,$Qt=2,qje=3,NQt=4,Wje=5,AQt=6,IQt=7,Gje=65,MQt=66,QQt=8,DQt=9,LQt=10,jQt=11,XQt=12,Hje=13,UQt=19,zQt=20,BQt=29,FQt=33,YQt=34,VQt=47,qQt=0,Pse=1,mZ=2,rP=3,OZ=4;let A0=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}};A0.top=new A0(null,-1,qQt);function oC(e,t){for(let n=0,r=t-e.pos-1;;r--,n++){let s=e.peek(r);if(Mm(s)||s==-1)return n}}function gZ(e){return e==32||e==9}function Mm(e){return e==10||e==13}function Zje(e){return gZ(e)||Mm(e)}function V0(e){return e<0||Zje(e)}const WQt=new zy({start:A0.top,reduce(e,t){return e.type==rP&&(t==zQt||t==YQt)?e.parent:e},shift(e,t,n,r){if(t==qje)return new A0(e,oC(r,r.pos),Pse);if(t==Gje||t==Wje)return new A0(e,oC(r,r.pos),mZ);if(t==rS)return e.parent;if(t==UQt||t==FQt)return new A0(e,0,rP);if(t==Hje&&e.type==OZ)return e.parent;if(t==VQt){let s=/[1-9]/.exec(r.read(r.pos,n.pos));if(s)return new A0(e,e.depth+ +s[0],OZ)}return e},hash(e){return e.hash}});function _T(e,t,n=0){return e.peek(n)==t&&e.peek(n+1)==t&&e.peek(n+2)==t&&V0(e.peek(n+3))}const GQt=new Hn((e,t)=>{if(e.next==-1&&t.canShift(GOe))return e.acceptToken(GOe);let n=e.peek(-1);if((Mm(n)||n<0)&&t.context.type!=rP){if(_T(e,45))if(t.canShift(rS))e.acceptToken(rS);else return e.acceptToken(PQt,3);if(_T(e,46))if(t.canShift(rS))e.acceptToken(rS);else return e.acceptToken($Qt,3);let r=0;for(;e.next==32;)r++,e.advance();(r<t.context.depth||r==t.context.depth&&t.context.type==Pse&&(e.next!=45||!V0(e.peek(1))))&&e.next!=-1&&!Mm(e.next)&&e.next!=35&&e.acceptToken(rS,-r)}},{contextual:!0}),HQt=new Hn((e,t)=>{if(t.context.type==rP){e.next==63&&(e.advance(),V0(e.next)&&e.acceptToken(IQt));return}if(e.next==45)e.advance(),V0(e.next)&&e.acceptToken(t.context.type==Pse&&t.context.depth==oC(e,e.pos-1)?NQt:qje);else if(e.next==63)e.advance(),V0(e.next)&&e.acceptToken(t.context.type==mZ&&t.context.depth==oC(e,e.pos-1)?AQt:Wje);else{let n=e.pos;for(;;)if(gZ(e.next)){if(e.pos==n)return;e.advance()}else if(e.next==33)Kje(e);else if(e.next==38)_Z(e);else if(e.next==42){_Z(e);break}else if(e.next==39||e.next==34){if($se(e,!0))break;return}else if(e.next==91||e.next==123){if(!KQt(e))return;break}else{Jje(e,!0,!1,0);break}for(;gZ(e.next);)e.advance();if(e.next==58){if(e.pos==n&&t.canShift(BQt))return;let r=e.peek(1);V0(r)&&e.acceptTokenTo(t.context.type==mZ&&t.context.depth==oC(e,n)?MQt:Gje,n)}}},{contextual:!0});function ZQt(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 HOe(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function ZOe(e,t){return e.next==37?(e.advance(),HOe(e.next)&&e.advance(),HOe(e.next)&&e.advance(),!0):ZQt(e.next)||t&&e.next==44?(e.advance(),!0):!1}function Kje(e){if(e.advance(),e.next==60){for(e.advance();;)if(!ZOe(e,!0)){e.next==62&&e.advance();break}}else for(;ZOe(e,!1););}function _Z(e){for(e.advance();!V0(e.next)&&IL(e.next)!="f";)e.advance()}function $se(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(Mm(i)){if(t)return!1;r=!0}else if(t&&e.pos>=s+1024)return!1}return!r}function KQt(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(!$se(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||Mm(e.next))return!1;e.advance()}}const JQt="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function IL(e){return e<33?"u":e>125?"s":JQt[e-33]}function dY(e,t){let n=IL(e);return n!="u"&&!(t&&n=="f")}function Jje(e,t,n,r){if(IL(e.next)=="s"||(e.next==63||e.next==58||e.next==45)&&dY(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(Mm(i)){if(t)return!1;a=0}else a++;i=e.peek(++o)}if(!(i>=0&&(i==58?dY(e.peek(o+1),n):i==35?e.peek(o-1)!=32:dY(i,n)))||!n&&a<=r||a==0&&!n&&(_T(e,45,o)||_T(e,46,o)))break;if(t&&IL(i)=="f")return!1;for(let l=o;l>=0;l--)e.advance();if(t&&e.pos>s+1024)return!1}return!0}const e2t=new Hn((e,t)=>{if(e.next==33)Kje(e),e.acceptToken(XQt);else if(e.next==38||e.next==42){let n=e.next==38?LQt:jQt;_Z(e),e.acceptToken(n)}else e.next==39||e.next==34?($se(e,!1),e.acceptToken(DQt)):Jje(e,!1,t.context.type==rP,t.context.depth)&&e.acceptToken(QQt)}),t2t=new Hn((e,t)=>{let n=t.context.type==OZ?t.context.depth:-1,r=e.pos;e:for(;;){let s=0,i=e.next;for(;i==32;)i=e.peek(++s);if(!s&&(_T(e,45,s)||_T(e,46,s))||!Mm(i)&&(n<0&&(n=Math.max(t.context.depth+1,s)),s<n))break;for(;;){if(e.next<0)break e;let o=Mm(e.next);if(e.advance(),o)continue e;r=e.pos}}e.acceptTokenTo(Hje,r)}),n2t=yo({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}),r2t=go.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'#DbOOQP'#Dj'#DjO(zQaO'#CmO)YQgO'#CmOOQP'#Cm'#CmQ)jQaOOQ)uQgOOQ]QgOOO*PQdO'#CrO*nQdO'#CtOOQO'#Dw'#DwO+]Q`O'#CxO+hQdO'#CwO+rQ`O'#C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]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:WQt,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[n2t],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q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-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}),Nse=_o.define({name:"yaml",parser:r2t.configure({props:[xo.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:Rf({closing:"}"}),FlowSequence:Rf({closing:"]"})}),So.add({"FlowMapping FlowSequence":cd,"Item Pair BlockLiteral":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function eXe(){return new Zi(Nse)}const i2t=_o.define({name:"yaml-frontmatter",parser:s2t.configure({props:[yo({DashLine:X.meta})]})});function o2t(e){let{language:t,support:n}=e.content instanceof Zi?e.content:{language:e.content,support:[]};return new Zi(i2t.configure({wrap:VU(r=>r.name=="FrontmatterContent"?{parser:Nse.parser}:r.name=="Body"?{parser:t.parser}:null)}),n)}const a2t=Object.freeze(Object.defineProperty({__proto__:null,yaml:eXe,yamlFrontmatter:o2t,yamlLanguage:Nse},Symbol.toStringTag,{value:"Module"}));function dt(e){return new Zi(Kre.define(e))}function gO(e){return Qe(()=>Promise.resolve().then(()=>aQt),void 0).then(t=>t.sql({dialect:t[e]}))}const l2t=[Ve.of({name:"C",extensions:["c","h","ino"],load(){return Qe(()=>Promise.resolve().then(()=>xme),void 0).then(e=>e.cpp())}}),Ve.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return Qe(()=>Promise.resolve().then(()=>xme),void 0).then(e=>e.cpp())}}),Ve.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return gO("Cassandra")}}),Ve.of({name:"CSS",extensions:["css"],load(){return Qe(()=>Promise.resolve().then(()=>oCt),void 0).then(e=>e.css())}}),Ve.of({name:"Go",extensions:["go"],load(){return Qe(()=>Promise.resolve().then(()=>KCt),void 0).then(e=>e.go())}}),Ve.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return Qe(()=>Promise.resolve().then(()=>CPt),void 0).then(e=>e.html())}}),Ve.of({name:"Java",extensions:["java"],load(){return Qe(()=>Promise.resolve().then(()=>NPt),void 0).then(e=>e.java())}}),Ve.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return Qe(()=>Promise.resolve().then(()=>dI),void 0).then(e=>e.javascript())}}),Ve.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return Qe(()=>import("./index-Ci3TO_JU.js"),__vite__mapDeps([0,1])).then(e=>e.jinja())}}),Ve.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return Qe(()=>Promise.resolve().then(()=>DPt),void 0).then(e=>e.json())}}),Ve.of({name:"JSX",extensions:["jsx"],load(){return Qe(()=>Promise.resolve().then(()=>dI),void 0).then(e=>e.javascript({jsx:!0}))}}),Ve.of({name:"LESS",extensions:["less"],load(){return Qe(()=>Promise.resolve().then(()=>WPt),void 0).then(e=>e.less())}}),Ve.of({name:"Liquid",extensions:["liquid"],load(){return Qe(()=>import("./index-CcbnCZI-.js"),__vite__mapDeps([2,1])).then(e=>e.liquid())}}),Ve.of({name:"MariaDB SQL",load(){return gO("MariaSQL")}}),Ve.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return Qe(()=>Promise.resolve().then(()=>$$t),void 0).then(e=>e.markdown())}}),Ve.of({name:"MS SQL",load(){return gO("MSSQL")}}),Ve.of({name:"MySQL",load(){return gO("MySQL")}}),Ve.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return Qe(()=>Promise.resolve().then(()=>tAt),void 0).then(e=>e.php())}}),Ve.of({name:"PLSQL",extensions:["pls"],load(){return gO("PLSQL")}}),Ve.of({name:"PostgreSQL",load(){return gO("PostgreSQL")}}),Ve.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return Qe(()=>Promise.resolve().then(()=>mIt),void 0).then(e=>e.python())}}),Ve.of({name:"Rust",extensions:["rs"],load(){return Qe(()=>Promise.resolve().then(()=>MIt),void 0).then(e=>e.rust())}}),Ve.of({name:"Sass",extensions:["sass"],load(){return Qe(()=>Promise.resolve().then(()=>NOe),void 0).then(e=>e.sass({indented:!0}))}}),Ve.of({name:"SCSS",extensions:["scss"],load(){return Qe(()=>Promise.resolve().then(()=>NOe),void 0).then(e=>e.sass())}}),Ve.of({name:"SQL",extensions:["sql"],load(){return gO("StandardSQL")}}),Ve.of({name:"SQLite",load(){return gO("SQLite")}}),Ve.of({name:"TSX",extensions:["tsx"],load(){return Qe(()=>Promise.resolve().then(()=>dI),void 0).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),Ve.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return Qe(()=>Promise.resolve().then(()=>dI),void 0).then(e=>e.javascript({typescript:!0}))}}),Ve.of({name:"WebAssembly",extensions:["wat","wast"],load(){return Qe(()=>import("./index-BUfRAXh0.js"),__vite__mapDeps([3,1])).then(e=>e.wast())}}),Ve.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return Qe(()=>Promise.resolve().then(()=>RQt),void 0).then(e=>e.xml())}}),Ve.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return Qe(()=>Promise.resolve().then(()=>a2t),void 0).then(e=>e.yaml())}}),Ve.of({name:"APL",extensions:["dyalog","apl"],load(){return Qe(()=>import("./apl-B4CMkyY2.js"),[]).then(e=>dt(e.apl))}}),Ve.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return Qe(()=>import("./asciiarmor-Df11BRmG.js"),[]).then(e=>dt(e.asciiArmor))}}),Ve.of({name:"ASN.1",extensions:["asn","asn1"],load(){return Qe(()=>import("./asn1-EdZsLKOL.js"),[]).then(e=>dt(e.asn1({})))}}),Ve.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return Qe(()=>import("./asterisk-B-8jnY81.js"),[]).then(e=>dt(e.asterisk))}}),Ve.of({name:"Brainfuck",extensions:["b","bf"],load(){return Qe(()=>import("./brainfuck-C4LP7Hcl.js"),[]).then(e=>dt(e.brainfuck))}}),Ve.of({name:"Cobol",extensions:["cob","cpy"],load(){return Qe(()=>import("./cobol-CWcv1MsR.js"),[]).then(e=>dt(e.cobol))}}),Ve.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return Qe(()=>import("./clike-B9uivgTg.js"),[]).then(e=>dt(e.csharp))}}),Ve.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return Qe(()=>import("./clojure-BMjYHr_A.js"),[]).then(e=>dt(e.clojure))}}),Ve.of({name:"ClojureScript",extensions:["cljs"],load(){return Qe(()=>import("./clojure-BMjYHr_A.js"),[]).then(e=>dt(e.clojure))}}),Ve.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return Qe(()=>import("./css-BnMrqG3P.js"),[]).then(e=>dt(e.gss))}}),Ve.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return Qe(()=>import("./cmake-BQqOBYOt.js"),[]).then(e=>dt(e.cmake))}}),Ve.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return Qe(()=>import("./coffeescript-S37ZYGWr.js"),[]).then(e=>dt(e.coffeeScript))}}),Ve.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return Qe(()=>import("./commonlisp-DBKNyK5s.js"),[]).then(e=>dt(e.commonLisp))}}),Ve.of({name:"Cypher",extensions:["cyp","cypher"],load(){return Qe(()=>import("./cypher-C_CwsFkJ.js"),[]).then(e=>dt(e.cypher))}}),Ve.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return Qe(()=>import("./python-BuPzkPfP.js"),[]).then(e=>dt(e.cython))}}),Ve.of({name:"Crystal",extensions:["cr"],load(){return Qe(()=>import("./crystal-SjHAIU92.js"),[]).then(e=>dt(e.crystal))}}),Ve.of({name:"D",extensions:["d"],load(){return Qe(()=>import("./d-pRatUO7H.js"),[]).then(e=>dt(e.d))}}),Ve.of({name:"Dart",extensions:["dart"],load(){return Qe(()=>import("./clike-B9uivgTg.js"),[]).then(e=>dt(e.dart))}}),Ve.of({name:"diff",extensions:["diff","patch"],load(){return Qe(()=>import("./diff-DbItnlRl.js"),[]).then(e=>dt(e.diff))}}),Ve.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return Qe(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([4,5])).then(e=>dt(e.dockerFile))}}),Ve.of({name:"DTD",extensions:["dtd"],load(){return Qe(()=>import("./dtd-DF_7sFjM.js"),[]).then(e=>dt(e.dtd))}}),Ve.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return Qe(()=>import("./dylan-DwRh75JA.js"),[]).then(e=>dt(e.dylan))}}),Ve.of({name:"EBNF",load(){return Qe(()=>import("./ebnf-CDyGwa7X.js"),[]).then(e=>dt(e.ebnf))}}),Ve.of({name:"ECL",extensions:["ecl"],load(){return Qe(()=>import("./ecl-Cabwm37j.js"),[]).then(e=>dt(e.ecl))}}),Ve.of({name:"edn",extensions:["edn"],load(){return Qe(()=>import("./clojure-BMjYHr_A.js"),[]).then(e=>dt(e.clojure))}}),Ve.of({name:"Eiffel",extensions:["e"],load(){return Qe(()=>import("./eiffel-CnydiIhH.js"),[]).then(e=>dt(e.eiffel))}}),Ve.of({name:"Elm",extensions:["elm"],load(){return Qe(()=>import("./elm-vLlmbW-K.js"),[]).then(e=>dt(e.elm))}}),Ve.of({name:"Erlang",extensions:["erl"],load(){return Qe(()=>import("./erlang-BNw1qcRV.js"),[]).then(e=>dt(e.erlang))}}),Ve.of({name:"Esper",load(){return Qe(()=>import("./sql-D0XecflT.js"),[]).then(e=>dt(e.esper))}}),Ve.of({name:"Factor",extensions:["factor"],load(){return Qe(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([6,5])).then(e=>dt(e.factor))}}),Ve.of({name:"FCL",load(){return Qe(()=>import("./fcl-Kvtd6kyn.js"),[]).then(e=>dt(e.fcl))}}),Ve.of({name:"Forth",extensions:["forth","fth","4th"],load(){return Qe(()=>import("./forth-Ffai-XNe.js"),[]).then(e=>dt(e.forth))}}),Ve.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return Qe(()=>import("./fortran-DYz_wnZ1.js"),[]).then(e=>dt(e.fortran))}}),Ve.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return Qe(()=>import("./mllike-CXdrOF99.js"),[]).then(e=>dt(e.fSharp))}}),Ve.of({name:"Gas",extensions:["s"],load(){return Qe(()=>import("./gas-Bneqetm1.js"),[]).then(e=>dt(e.gas))}}),Ve.of({name:"Gherkin",extensions:["feature"],load(){return Qe(()=>import("./gherkin-heZmZLOM.js"),[]).then(e=>dt(e.gherkin))}}),Ve.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return Qe(()=>import("./groovy-D9Dt4D0W.js"),[]).then(e=>dt(e.groovy))}}),Ve.of({name:"Haskell",extensions:["hs"],load(){return Qe(()=>import("./haskell-BWDZoCOh.js"),[]).then(e=>dt(e.haskell))}}),Ve.of({name:"Haxe",extensions:["hx"],load(){return Qe(()=>import("./haxe-H-WmDvRZ.js"),[]).then(e=>dt(e.haxe))}}),Ve.of({name:"HXML",extensions:["hxml"],load(){return Qe(()=>import("./haxe-H-WmDvRZ.js"),[]).then(e=>dt(e.hxml))}}),Ve.of({name:"HTTP",load(){return Qe(()=>import("./http-DBlCnlav.js"),[]).then(e=>dt(e.http))}}),Ve.of({name:"IDL",extensions:["pro"],load(){return Qe(()=>import("./idl-BEugSyMb.js"),[]).then(e=>dt(e.idl))}}),Ve.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return Qe(()=>import("./javascript-qCveANmP.js"),[]).then(e=>dt(e.jsonld))}}),Ve.of({name:"Julia",extensions:["jl"],load(){return Qe(()=>import("./julia-DuME0IfC.js"),[]).then(e=>dt(e.julia))}}),Ve.of({name:"Kotlin",extensions:["kt","kts"],load(){return Qe(()=>import("./clike-B9uivgTg.js"),[]).then(e=>dt(e.kotlin))}}),Ve.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return Qe(()=>import("./livescript-BwQOo05w.js"),[]).then(e=>dt(e.liveScript))}}),Ve.of({name:"Lua",extensions:["lua"],load(){return Qe(()=>import("./lua-BgMRiT3U.js"),[]).then(e=>dt(e.lua))}}),Ve.of({name:"mIRC",extensions:["mrc"],load(){return Qe(()=>import("./mirc-CjQqDB4T.js"),[]).then(e=>dt(e.mirc))}}),Ve.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return Qe(()=>import("./mathematica-DTrFuWx2.js"),[]).then(e=>dt(e.mathematica))}}),Ve.of({name:"Modelica",extensions:["mo"],load(){return Qe(()=>import("./modelica-Dc1JOy9r.js"),[]).then(e=>dt(e.modelica))}}),Ve.of({name:"MUMPS",extensions:["mps"],load(){return Qe(()=>import("./mumps-BT43cFF4.js"),[]).then(e=>dt(e.mumps))}}),Ve.of({name:"Mbox",extensions:["mbox"],load(){return Qe(()=>import("./mbox-CNhZ1qSd.js"),[]).then(e=>dt(e.mbox))}}),Ve.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return Qe(()=>import("./nginx-DdIZxoE0.js"),[]).then(e=>dt(e.nginx))}}),Ve.of({name:"NSIS",extensions:["nsh","nsi"],load(){return Qe(()=>import("./nsis-LdVXkNf5.js"),__vite__mapDeps([7,5])).then(e=>dt(e.nsis))}}),Ve.of({name:"NTriples",extensions:["nt","nq"],load(){return Qe(()=>import("./ntriples-BfvgReVJ.js"),[]).then(e=>dt(e.ntriples))}}),Ve.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return Qe(()=>import("./clike-B9uivgTg.js"),[]).then(e=>dt(e.objectiveC))}}),Ve.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return Qe(()=>import("./clike-B9uivgTg.js"),[]).then(e=>dt(e.objectiveCpp))}}),Ve.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return Qe(()=>import("./mllike-CXdrOF99.js"),[]).then(e=>dt(e.oCaml))}}),Ve.of({name:"Octave",extensions:["m"],load(){return Qe(()=>import("./octave-Ck1zUtKM.js"),[]).then(e=>dt(e.octave))}}),Ve.of({name:"Oz",extensions:["oz"],load(){return Qe(()=>import("./oz-BzwKVEFT.js"),[]).then(e=>dt(e.oz))}}),Ve.of({name:"Pascal",extensions:["p","pas"],load(){return Qe(()=>import("./pascal--L3eBynH.js"),[]).then(e=>dt(e.pascal))}}),Ve.of({name:"Perl",extensions:["pl","pm"],load(){return Qe(()=>import("./perl-CdXCOZ3F.js"),[]).then(e=>dt(e.perl))}}),Ve.of({name:"Pig",extensions:["pig"],load(){return Qe(()=>import("./pig-CevX1Tat.js"),[]).then(e=>dt(e.pig))}}),Ve.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return Qe(()=>import("./powershell-CFHJl5sT.js"),[]).then(e=>dt(e.powerShell))}}),Ve.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return Qe(()=>import("./properties-C78fOPTZ.js"),[]).then(e=>dt(e.properties))}}),Ve.of({name:"ProtoBuf",extensions:["proto"],load(){return Qe(()=>import("./protobuf-ChK-085T.js"),[]).then(e=>dt(e.protobuf))}}),Ve.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return Qe(()=>import("./pug-DukmZTjD.js"),__vite__mapDeps([8,9])).then(e=>dt(e.pug))}}),Ve.of({name:"Puppet",extensions:["pp"],load(){return Qe(()=>import("./puppet-DMA9R1ak.js"),[]).then(e=>dt(e.puppet))}}),Ve.of({name:"Q",extensions:["q"],load(){return Qe(()=>import("./q-pXgVlZs6.js"),[]).then(e=>dt(e.q))}}),Ve.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return Qe(()=>import("./r-DUYO_cvP.js"),[]).then(e=>dt(e.r))}}),Ve.of({name:"RPM Changes",load(){return Qe(()=>import("./rpm-CTu-6PCP.js"),[]).then(e=>dt(e.rpmChanges))}}),Ve.of({name:"RPM Spec",extensions:["spec"],load(){return Qe(()=>import("./rpm-CTu-6PCP.js"),[]).then(e=>dt(e.rpmSpec))}}),Ve.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return Qe(()=>import("./ruby-B2Rjki9n.js"),[]).then(e=>dt(e.ruby))}}),Ve.of({name:"SAS",extensions:["sas"],load(){return Qe(()=>import("./sas-B4kiWyti.js"),[]).then(e=>dt(e.sas))}}),Ve.of({name:"Scala",extensions:["scala"],load(){return Qe(()=>import("./clike-B9uivgTg.js"),[]).then(e=>dt(e.scala))}}),Ve.of({name:"Scheme",extensions:["scm","ss"],load(){return Qe(()=>import("./scheme-C41bIUwD.js"),[]).then(e=>dt(e.scheme))}}),Ve.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return Qe(()=>import("./shell-CjFT_Tl9.js"),[]).then(e=>dt(e.shell))}}),Ve.of({name:"Sieve",extensions:["siv","sieve"],load(){return Qe(()=>import("./sieve-C3Gn_uJK.js"),[]).then(e=>dt(e.sieve))}}),Ve.of({name:"Smalltalk",extensions:["st"],load(){return Qe(()=>import("./smalltalk-CnHTOXQT.js"),[]).then(e=>dt(e.smalltalk))}}),Ve.of({name:"Solr",load(){return Qe(()=>import("./solr-DehyRSwq.js"),[]).then(e=>dt(e.solr))}}),Ve.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return Qe(()=>import("./mllike-CXdrOF99.js"),[]).then(e=>dt(e.sml))}}),Ve.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return Qe(()=>import("./sparql-DkYu6x3z.js"),[]).then(e=>dt(e.sparql))}}),Ve.of({name:"Spreadsheet",alias:["excel","formula"],load(){return Qe(()=>import("./spreadsheet-BCZA_wO0.js"),[]).then(e=>dt(e.spreadsheet))}}),Ve.of({name:"Squirrel",extensions:["nut"],load(){return Qe(()=>import("./clike-B9uivgTg.js"),[]).then(e=>dt(e.squirrel))}}),Ve.of({name:"Stylus",extensions:["styl"],load(){return Qe(()=>import("./stylus-B533Al4x.js"),[]).then(e=>dt(e.stylus))}}),Ve.of({name:"Swift",extensions:["swift"],load(){return Qe(()=>import("./swift-BzpIVaGY.js"),[]).then(e=>dt(e.swift))}}),Ve.of({name:"sTeX",load(){return Qe(()=>import("./stex-C3f8Ysf7.js"),[]).then(e=>dt(e.stex))}}),Ve.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return Qe(()=>import("./stex-C3f8Ysf7.js"),[]).then(e=>dt(e.stex))}}),Ve.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return Qe(()=>import("./verilog-C6RDOZhf.js"),[]).then(e=>dt(e.verilog))}}),Ve.of({name:"Tcl",extensions:["tcl"],load(){return Qe(()=>import("./tcl-DVfN8rqt.js"),[]).then(e=>dt(e.tcl))}}),Ve.of({name:"Textile",extensions:["textile"],load(){return Qe(()=>import("./textile-CnDTJFAw.js"),[]).then(e=>dt(e.textile))}}),Ve.of({name:"TiddlyWiki",load(){return Qe(()=>import("./tiddlywiki-DO-Gjzrf.js"),[]).then(e=>dt(e.tiddlyWiki))}}),Ve.of({name:"Tiki wiki",load(){return Qe(()=>import("./tiki-DGYXhP31.js"),[]).then(e=>dt(e.tiki))}}),Ve.of({name:"TOML",extensions:["toml"],load(){return Qe(()=>import("./toml-Bm5Em-hy.js"),[]).then(e=>dt(e.toml))}}),Ve.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return Qe(()=>import("./troff-wAsdV37c.js"),[]).then(e=>dt(e.troff))}}),Ve.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return Qe(()=>import("./ttcn-CfJYG6tj.js"),[]).then(e=>dt(e.ttcn))}}),Ve.of({name:"TTCN_CFG",extensions:["cfg"],load(){return Qe(()=>import("./ttcn-cfg-B9xdYoR4.js"),[]).then(e=>dt(e.ttcnCfg))}}),Ve.of({name:"Turtle",extensions:["ttl"],load(){return Qe(()=>import("./turtle-B1tBg_DP.js"),[]).then(e=>dt(e.turtle))}}),Ve.of({name:"Web IDL",extensions:["webidl"],load(){return Qe(()=>import("./webidl-ZXfAyPTL.js"),[]).then(e=>dt(e.webIDL))}}),Ve.of({name:"VB.NET",extensions:["vb"],load(){return Qe(()=>import("./vb-CmGdzxic.js"),[]).then(e=>dt(e.vb))}}),Ve.of({name:"VBScript",extensions:["vbs"],load(){return Qe(()=>import("./vbscript-BuJXcnF6.js"),[]).then(e=>dt(e.vbScript))}}),Ve.of({name:"Velocity",extensions:["vtl"],load(){return Qe(()=>import("./velocity-D8B20fx6.js"),[]).then(e=>dt(e.velocity))}}),Ve.of({name:"Verilog",extensions:["v"],load(){return Qe(()=>import("./verilog-C6RDOZhf.js"),[]).then(e=>dt(e.verilog))}}),Ve.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return Qe(()=>import("./vhdl-lSbBsy5d.js"),[]).then(e=>dt(e.vhdl))}}),Ve.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return Qe(()=>import("./xquery-CQfU5ijd.js"),[]).then(e=>dt(e.xQuery))}}),Ve.of({name:"Yacas",extensions:["ys"],load(){return Qe(()=>import("./yacas-BJ4BC0dw.js"),[]).then(e=>dt(e.yacas))}}),Ve.of({name:"Z80",extensions:["z80"],load(){return Qe(()=>import("./z80-Hz9HOZM7.js"),[]).then(e=>dt(e.z80))}}),Ve.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return Qe(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(e=>dt(e.mscgen))}}),Ve.of({name:"Xù",extensions:["xu"],load(){return Qe(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(e=>dt(e.xu))}}),Ve.of({name:"MsGenny",extensions:["msgenny"],load(){return Qe(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(e=>dt(e.msgenny))}}),Ve.of({name:"Vue",extensions:["vue"],load(){return Qe(()=>import("./index-DkKHJirK.js"),__vite__mapDeps([10,1])).then(e=>e.vue())}}),Ve.of({name:"Angular Template",load(){return Qe(()=>import("./index-CPvx8mQq.js"),__vite__mapDeps([11,1])).then(e=>e.angular())}})];function tXe(e){const t=e.split(".").pop()?.toLowerCase();switch(t){case"ts":case"tsx":case"js":case"jsx":case"mjs":case"cjs":return hse({jsx:t==="tsx"||t==="jsx",typescript:t==="ts"||t==="tsx"});case"py":return Eje();case"json":case"jsonl":return E5e();case"css":return nse();case"scss":return lZ({indented:!1});case"sass":return lZ({indented:!0});case"less":return C5e();case"html":case"htm":return cz();case"xml":case"svg":return Yje();case"md":case"mdx":case"markdown":return lje();case"yaml":case"yml":return eXe();case"rs":return kje();case"go":return FLe();case"java":return v5e();case"c":case"h":case"cpp":case"cxx":case"cc":case"hpp":return PLe();case"php":return pje();case"sql":return Xje();default:return null}}function hZn(e){return Ve.matchFilename(l2t,e)}function pY(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 Rp=null,n0=null,Sx=null;const Dp={register(e,t,n){Rp=e,n0=t,Sx=n},unregister(){Rp=null,n0=null,Sx=null},get isRegistered(){return Rp!==null},getContent(e){return Rp?.get(e)?.doc.toString()??null},getAllModifiedContent(e){const t=new Map;for(const n of Object.keys(e)){if(!e[n])continue;const r=Rp?.get(n)?.doc.toString();r!==void 0&&t.set(n,r)}return t},deleteState(e){Rp?.delete(e),n0?.delete(e)},destroy(){Sx?.destroy(),Rp?.clear(),n0?.clear(),Sx=null},remapState(e,t){const n=Rp?.get(e);n&&(Rp.delete(e),Rp.set(t,n));const r=n0?.get(e);r!==void 0&&(n0.delete(e),n0.set(t,r))},updateView(e){Sx=e},getView(){return Sx}},c2t=1e4;let aC=null;const bZ=new Set;function u2t(e){return bZ.add(e),()=>bZ.delete(e)}function d2t(){aC=null,bZ.forEach(e=>e())}function Jw(e){return aC?.projectPath===e&&Date.now()-aC.timestamp<c2t?{files:aC.files}:null}function nXe(e,t){aC={files:t,projectPath:e,timestamp:Date.now()}}function gI(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=al(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 xs=eo("Store:editor");function di(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}const hd=new Map,p2t=2e3;let fY=null;const f2t=1500,hY=new Map,h2t=350;let mY=null,_I={change:0,create:0,delete:0},q0=null,ML="",W0=null,QL="";const m2t=250,O2t=120;function Q1(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}
|
|
1032
|
+
`;function Ije(e,t,n){let r=Object.create(null);r.true=r.false=_Mt,r.null=r.unknown=bMt;for(let s of e.split(" "))s&&(r[s]=Nje);for(let s of t.split(" "))s&&(r[s]=Aje);for(let s of(n||"").split(" "))s&&(r[s]=AMt);return r}const By="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 ",Fy="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 ",dZ={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:Ije(Fy,By)};function LMt(e,t,n,r){let s={};for(let i in dZ)s[i]=(e.hasOwnProperty(i)?e:dZ)[i];return t&&(s.words=Ije(t,n||"",r)),s}function Mje(e){return new Hn(t=>{var n;let{next:r}=t;if(t.advance(),t0(r,aY)){for(;t0(t.next,aY);)t.advance();t.acceptToken(OMt)}else if(r==36&&e.doubleDollarQuotedStrings){let s=uZ(t,"");t.next==36&&(t.advance(),MMt(t,s),t.acceptToken(xx))}else if(r==39||r==34&&e.doubleQuotedStrings)y0(t,r,e.backslashEscapes),t.acceptToken(xx);else if(r==35&&e.hashComments||r==47&&t.next==47&&e.slashComments)LOe(t),t.acceptToken(AOe);else if(r==45&&t.next==45&&(!e.spaceAfterDashes||t.peek(1)==32))LOe(t),t.acceptToken(AOe);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(gMt)}else if((r==101||r==69)&&t.next==39)t.advance(),y0(t,39,!0),t.acceptToken(xx);else if((r==110||r==78)&&t.next==39&&e.charSetCasts)t.advance(),y0(t,39,e.backslashEscapes),t.acceptToken(xx);else if(r==95&&e.charSetCasts)for(let s=0;;s++){if(t.next==39&&s>1){t.advance(),y0(t,39,e.backslashEscapes),t.acceptToken(xx);break}if(!cZ(t.next))break;t.advance()}else if(e.plsqlQuotingMechanism&&(r==113||r==81)&&t.next==39&&t.peek(1)>0&&!t0(t.peek(1),aY)){let s=t.peek(1);t.advance(2),QMt(t,s),t.acceptToken(xx)}else if(t0(r,e.identifierQuotes)){const s=r==91?93:r;y0(t,s,!1),t.acceptToken($Mt)}else if(r==40)t.acceptToken(yMt);else if(r==41)t.acceptToken(xMt);else if(r==123)t.acceptToken(SMt);else if(r==125)t.acceptToken(vMt);else if(r==91)t.acceptToken(TMt);else if(r==93)t.acceptToken(EMt);else if(r==59)t.acceptToken(wMt);else if(e.unquotedBitLiterals&&r==48&&t.next==98)t.advance(),QOe(t),t.acceptToken(MOe);else if((r==98||r==66)&&(t.next==39||t.next==34)){const s=t.next;t.advance(),e.treatBitsAsBytes?(y0(t,s,e.backslashEscapes),t.acceptToken(NMt)):(QOe(t,s),t.acceptToken(MOe))}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();IMt(t.next);)t.advance();s&&t.next==39&&t.advance(),t.acceptToken(oY)}else if(r==46&&t.next>=48&&t.next<=57)DOe(t,!0),t.acceptToken(oY);else if(r==46)t.acceptToken(kMt);else if(r>=48&&r<=57)DOe(t,!1),t.acceptToken(oY);else if(t0(r,e.operatorChars)){for(;t0(t.next,e.operatorChars);)t.advance();t.acceptToken(CMt)}else if(t0(r,e.specialVar))t.next==r&&t.advance(),DMt(t),t.acceptToken(PMt);else if(r==58||r==44)t.acceptToken(RMt);else if(cZ(r)){let s=uZ(t,String.fromCharCode(r));t.acceptToken(t.next==46||t.peek(-s.length-1)==46?IOe:(n=e.words[s.toLowerCase()])!==null&&n!==void 0?n:IOe)}})}const Qje=Mje(dZ),jMt=go.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,Qje],topRules:{Script:[0,25]},tokenPrec:0});function pZ(e){let t=e.cursor().moveTo(e.from,-1);for(;/Comment/.test(t.name);)t.moveTo(t.from,-1);return t.node}function nP(e,t){let n=e.sliceString(t.from,t.to),r=/^([`'"\[])(.*)([`'"\]])$/.exec(n);return r?r[2]:n}function NL(e){return e&&(e.name=="Identifier"||e.name=="QuotedIdentifier")}function XMt(e,t){if(t.name=="CompositeIdentifier"){let n=[];for(let r=t.firstChild;r;r=r.nextSibling)NL(r)&&n.push(nP(e,r));return n}return[nP(e,t)]}function jOe(e,t){for(let n=[];;){if(!t||t.name!=".")return n;let r=pZ(t);if(!NL(r))return n;n.unshift(nP(e,r)),t=pZ(r)}}function UMt(e,t){let n=rs(e).resolveInner(t,-1),r=BMt(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:jOe(e.doc,pZ(n)),aliases:r}:n.name=="."?{from:t,quoted:null,parents:jOe(e.doc,n),aliases:r}:{from:t,quoted:null,parents:[],empty:!0,aliases:r}}const zMt=new Set("where group having order union intersect except all distinct limit offset fetch for".split(" "));function BMt(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&&NL(s.nextSibling))c=nP(e,s.nextSibling);else{if(a&&zMt.has(a))break;o&&NL(s)&&(c=nP(e,s))}c&&(r||(r=Object.create(null)),r[c]=XMt(e,o)),o=/Identifier$/.test(s.name)?s:null}return r}function FMt(e,t,n){return n.map(r=>({...r,label:r.label[0]==e?r.label:e+r.label+t,apply:void 0}))}const YMt=/^\w*$/,VMt=/^[`'"\[]?\w*[`'"\]]?$/;function XOe(e){return e.self&&typeof e.self.label=="string"}class Cse{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(UOe(t,"type",this.idQuote,this.idCaseInsensitive)),n[t]=new Cse(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"?UOe(n,"property",this.idQuote,this.idCaseInsensitive):n)}addNamespace(t){Array.isArray(t)?this.addCompletions(t):XOe(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;XOe(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 UOe(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+Dje(n)}}function Dje(e){return e==="["?"]":e}function qMt(e,t,n,r,s,i){var o;let a=((o=i?.spec.identifierQuotes)===null||o===void 0?void 0:o[0])||'"',c=new Cse(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}=UMt(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=Dje(y),S=d.state.sliceDoc(d.pos,d.pos+1)==x;return{from:f,to:S?d.pos+1:void 0,options:FMt(y,x,b),validFor:VMt}}else return{from:f,options:b,validFor:YMt}}}function WMt(e){return e==Aje?"type":e==Nje?"keyword":"variable"}function GMt(e,t,n){let r=Object.keys(e).map(s=>n(t?s.toUpperCase():s,WMt(e[s])));return lz(["QuotedIdentifier","String","LineComment","BlockComment","."],az(r))}let HMt=jMt.configure({props:[xo.add({Statement:Ei()}),So.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}}}),yo({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 nd{constructor(t,n,r){this.dialect=t,this.language=n,this.spec=r}get extension(){return this.language.extension}configureLanguage(t,n){return new nd(this.dialect,this.language.configure(t,n),this.spec)}static define(t){let n=LMt(t,t.keywords,t.types,t.builtin),r=_o.define({name:"sql",parser:HMt.configure({tokenizers:[{from:Qje,to:Mje(n)}]}),languageData:{commentTokens:{line:"--",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}});return new nd(n,r,t)}}function ZMt(e,t){return{label:e,type:t,boost:-1}}function Lje(e,t=!1,n){return GMt(e.dialect.words,t,n||ZMt)}function jje(e){return e.schema?qMt(e.schema,e.tables,e.schemas,e.defaultTable,e.defaultSchema,e.dialect||fz):()=>null}function KMt(e){return e.schema?(e.dialect||fz).language.data.of({autocomplete:jje(e)}):[]}function Xje(e={}){let t=e.dialect||fz;return new Zi(t.language,[KMt(e),t.language.data.of({autocomplete:Lje(t,e.upperCaseKeywords,e.keywordCompletion)})])}const fz=nd.define({}),JMt=nd.define({charSetCasts:!0,doubleDollarQuotedStrings:!0,operatorChars:"+-*/<>=~!@#%^&|`?",specialVar:"",keywords:Fy+"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:By+"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"}),Uje="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",zje=By+"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",Bje="charset clear edit ego help nopager notee nowarning pager print prompt quit rehash source status system tee",eQt=nd.define({operatorChars:"*+-%<>!=&|^",charSetCasts:!0,doubleQuotedStrings:!0,unquotedBitLiterals:!0,hashComments:!0,spaceAfterDashes:!0,specialVar:"@?",identifierQuotes:"`",keywords:Fy+"group_concat "+Uje,types:zje,builtin:Bje}),tQt=nd.define({operatorChars:"*+-%<>!=&|^",charSetCasts:!0,doubleQuotedStrings:!0,unquotedBitLiterals:!0,hashComments:!0,spaceAfterDashes:!0,specialVar:"@?",identifierQuotes:"`",keywords:Fy+"always generated groupby_concat hard persistent shutdown soft virtual "+Uje,types:zje,builtin:Bje});let nQt="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 rQt=nd.define({keywords:Fy+"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:By+"smalldatetime datetimeoffset datetime2 datetime bigint smallint smallmoney tinyint money real text nvarchar ntext varbinary image hierarchyid uniqueidentifier sql_variant xml",builtin:nQt,operatorChars:"*+-%<>!=^&|/",specialVar:"@",identifierQuotes:'"['}),sQt=nd.define({keywords:Fy+"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:By+"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:"@:?$"}),iQt=nd.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:By+"ascii bigint blob counter frozen inet list map static text timeuuid tuple uuid varint",slashComments:!0}),oQt=nd.define({keywords:Fy+"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:By+"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}),aQt=Object.freeze(Object.defineProperty({__proto__:null,Cassandra:iQt,MSSQL:rQt,MariaSQL:tQt,MySQL:eQt,PLSQL:oQt,PostgreSQL:JMt,SQLDialect:nd,SQLite:sQt,StandardSQL:fz,keywordCompletionSource:Lje,schemaCompletionSource:jje,sql:Xje},Symbol.toStringTag,{value:"Module"})),fZ=1,lQt=2,cQt=3,uQt=4,dQt=5,pQt=36,fQt=37,hQt=38,mQt=11,OQt=13;function gQt(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function _Qt(e){return e==9||e==10||e==13||e==32}let zOe=null,BOe=null,FOe=0;function hZ(e,t){let n=e.pos+t;if(BOe==e&&FOe==n)return zOe;for(;_Qt(e.peek(t));)t++;let r="";for(;;){let s=e.peek(t);if(!gQt(s))break;r+=String.fromCharCode(s),t++}return BOe=e,FOe=n,zOe=r||null}function YOe(e,t){this.name=e,this.parent=t}const bQt=new zy({start:null,shift(e,t,n,r){return t==fZ?new YOe(hZ(r,1)||"",e):e},reduce(e,t){return t==mQt&&e?e.parent:e},reuse(e,t,n,r){let s=t.type.id;return s==fZ||s==OQt?new YOe(hZ(r,1)||"",e):e},strict:!1}),yQt=new Hn((e,t)=>{if(e.next==60){if(e.advance(),e.next==47){e.advance();let n=hZ(e,0);if(!n)return e.acceptToken(dQt);if(t.context&&n==t.context.name)return e.acceptToken(lQt);for(let r=t.context;r;r=r.parent)if(r.name==n)return e.acceptToken(cQt,-2);e.acceptToken(uQt)}else if(e.next!=33&&e.next!=63)return e.acceptToken(fZ)}},{contextual:!0});function Rse(e,t){return new Hn(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 xQt=Rse(pQt,"-->"),SQt=Rse(fQt,"?>"),vQt=Rse(hQt,"]]>"),TQt=yo({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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-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:bQt,nodeProps:[["closedBy",1,"SelfCloseEndTag EndTag",13,"CloseTag MissingCloseTag"],["openedBy",12,"StartTag StartCloseTag",19,"OpenTag",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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:[yQt,xQt,SQt,vQt,0,1,2,3,4],topRules:{Document:[0,6]},tokenPrec:0});function GQ(e,t){let n=t&&t.getChild("TagName");return n?e.sliceString(n.from,n.to):""}function lY(e,t){let n=t&&t.firstChild;return!n||n.name!="OpenTag"?"":GQ(e,n)}function wQt(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 cY(e){for(let t=e&&e.parent;t;t=t.parent)if(t.name=="Element")return t;return null}function kQt(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:cY(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:cY(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:cY(r)}:null}let CQt=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 uY=/^[:\-\.\w\u00b7-\uffff]*$/;function VOe(e){return Object.assign(Object.assign({type:"property"},e.completion||{}),{label:e.name})}function qOe(e){return typeof e=="string"?{label:`"${e}"`,type:"constant"}:/^"/.test(e.label)?e:Object.assign(Object.assign({},e),{label:`"${e.label}"`})}function Fje(e,t){let n=[],r=[],s=Object.create(null);for(let c of t){let l=VOe(c);n.push(l),c.global&&r.push(l),c.values&&(s[c.name]=c.values.map(qOe))}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(qOe)),VOe(f)))));let p=new CQt(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=kQt(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,_=lY(d,m);if(_){let b=a[_];O=b?.children||i}return{from:h,options:O.map(b=>b.completion),validFor:uY}}else if(f=="closeTag"){let O=lY(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:uY}:null}else if(f=="attrName"){let O=a[GQ(d,m)];return{from:h,options:O?.attrs||r,validFor:uY}}else if(f=="attrValue"){let O=wQt(d,m,h);if(!O)return null;let _=a[GQ(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=lY(d,m),_=a[O],b=[],y=m&&m.lastChild;O&&(!y||y.name!="CloseTag"||GQ(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 AL=_o.define({name:"xml",parser:EQt.configure({props:[xo.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}}),So.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 Yje(e={}){let t=[AL.data.of({autocomplete:Fje(e.elements||[],e.attributes||[])})];return e.autoCloseTags!==!1&&t.push(Vje),new Zi(AL,t)}function WOe(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 Vje=Wt.inputHandler.of((e,t,n,r,s)=>{if(e.composing||e.state.readOnly||t!=n||r!=">"&&r!="/"||!AL.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=WOe(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=WOe(o.doc,_,f))){let b=f+(o.doc.sliceString(f,f+1)===">"?1:0),y=`${O}>`;return{range:pt.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)}),RQt=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:Vje,completeFromSchema:Fje,xml:Yje,xmlLanguage:AL},Symbol.toStringTag,{value:"Module"})),rS=63,GOe=64,PQt=1,$Qt=2,qje=3,NQt=4,Wje=5,AQt=6,IQt=7,Gje=65,MQt=66,QQt=8,DQt=9,LQt=10,jQt=11,XQt=12,Hje=13,UQt=19,zQt=20,BQt=29,FQt=33,YQt=34,VQt=47,qQt=0,Pse=1,mZ=2,rP=3,OZ=4;let A0=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}};A0.top=new A0(null,-1,qQt);function oC(e,t){for(let n=0,r=t-e.pos-1;;r--,n++){let s=e.peek(r);if(Mm(s)||s==-1)return n}}function gZ(e){return e==32||e==9}function Mm(e){return e==10||e==13}function Zje(e){return gZ(e)||Mm(e)}function V0(e){return e<0||Zje(e)}const WQt=new zy({start:A0.top,reduce(e,t){return e.type==rP&&(t==zQt||t==YQt)?e.parent:e},shift(e,t,n,r){if(t==qje)return new A0(e,oC(r,r.pos),Pse);if(t==Gje||t==Wje)return new A0(e,oC(r,r.pos),mZ);if(t==rS)return e.parent;if(t==UQt||t==FQt)return new A0(e,0,rP);if(t==Hje&&e.type==OZ)return e.parent;if(t==VQt){let s=/[1-9]/.exec(r.read(r.pos,n.pos));if(s)return new A0(e,e.depth+ +s[0],OZ)}return e},hash(e){return e.hash}});function _T(e,t,n=0){return e.peek(n)==t&&e.peek(n+1)==t&&e.peek(n+2)==t&&V0(e.peek(n+3))}const GQt=new Hn((e,t)=>{if(e.next==-1&&t.canShift(GOe))return e.acceptToken(GOe);let n=e.peek(-1);if((Mm(n)||n<0)&&t.context.type!=rP){if(_T(e,45))if(t.canShift(rS))e.acceptToken(rS);else return e.acceptToken(PQt,3);if(_T(e,46))if(t.canShift(rS))e.acceptToken(rS);else return e.acceptToken($Qt,3);let r=0;for(;e.next==32;)r++,e.advance();(r<t.context.depth||r==t.context.depth&&t.context.type==Pse&&(e.next!=45||!V0(e.peek(1))))&&e.next!=-1&&!Mm(e.next)&&e.next!=35&&e.acceptToken(rS,-r)}},{contextual:!0}),HQt=new Hn((e,t)=>{if(t.context.type==rP){e.next==63&&(e.advance(),V0(e.next)&&e.acceptToken(IQt));return}if(e.next==45)e.advance(),V0(e.next)&&e.acceptToken(t.context.type==Pse&&t.context.depth==oC(e,e.pos-1)?NQt:qje);else if(e.next==63)e.advance(),V0(e.next)&&e.acceptToken(t.context.type==mZ&&t.context.depth==oC(e,e.pos-1)?AQt:Wje);else{let n=e.pos;for(;;)if(gZ(e.next)){if(e.pos==n)return;e.advance()}else if(e.next==33)Kje(e);else if(e.next==38)_Z(e);else if(e.next==42){_Z(e);break}else if(e.next==39||e.next==34){if($se(e,!0))break;return}else if(e.next==91||e.next==123){if(!KQt(e))return;break}else{Jje(e,!0,!1,0);break}for(;gZ(e.next);)e.advance();if(e.next==58){if(e.pos==n&&t.canShift(BQt))return;let r=e.peek(1);V0(r)&&e.acceptTokenTo(t.context.type==mZ&&t.context.depth==oC(e,n)?MQt:Gje,n)}}},{contextual:!0});function ZQt(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 HOe(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function ZOe(e,t){return e.next==37?(e.advance(),HOe(e.next)&&e.advance(),HOe(e.next)&&e.advance(),!0):ZQt(e.next)||t&&e.next==44?(e.advance(),!0):!1}function Kje(e){if(e.advance(),e.next==60){for(e.advance();;)if(!ZOe(e,!0)){e.next==62&&e.advance();break}}else for(;ZOe(e,!1););}function _Z(e){for(e.advance();!V0(e.next)&&IL(e.next)!="f";)e.advance()}function $se(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(Mm(i)){if(t)return!1;r=!0}else if(t&&e.pos>=s+1024)return!1}return!r}function KQt(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(!$se(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||Mm(e.next))return!1;e.advance()}}const JQt="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function IL(e){return e<33?"u":e>125?"s":JQt[e-33]}function dY(e,t){let n=IL(e);return n!="u"&&!(t&&n=="f")}function Jje(e,t,n,r){if(IL(e.next)=="s"||(e.next==63||e.next==58||e.next==45)&&dY(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(Mm(i)){if(t)return!1;a=0}else a++;i=e.peek(++o)}if(!(i>=0&&(i==58?dY(e.peek(o+1),n):i==35?e.peek(o-1)!=32:dY(i,n)))||!n&&a<=r||a==0&&!n&&(_T(e,45,o)||_T(e,46,o)))break;if(t&&IL(i)=="f")return!1;for(let l=o;l>=0;l--)e.advance();if(t&&e.pos>s+1024)return!1}return!0}const e2t=new Hn((e,t)=>{if(e.next==33)Kje(e),e.acceptToken(XQt);else if(e.next==38||e.next==42){let n=e.next==38?LQt:jQt;_Z(e),e.acceptToken(n)}else e.next==39||e.next==34?($se(e,!1),e.acceptToken(DQt)):Jje(e,!1,t.context.type==rP,t.context.depth)&&e.acceptToken(QQt)}),t2t=new Hn((e,t)=>{let n=t.context.type==OZ?t.context.depth:-1,r=e.pos;e:for(;;){let s=0,i=e.next;for(;i==32;)i=e.peek(++s);if(!s&&(_T(e,45,s)||_T(e,46,s))||!Mm(i)&&(n<0&&(n=Math.max(t.context.depth+1,s)),s<n))break;for(;;){if(e.next<0)break e;let o=Mm(e.next);if(e.advance(),o)continue e;r=e.pos}}e.acceptTokenTo(Hje,r)}),n2t=yo({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}),r2t=go.deserialize({version:14,states:"5lQ!ZQgOOO#PQfO'#CpO#uQfO'#DOOOQR'#Dv'#DvO$qQgO'#DRO%gQdO'#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O!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:74,context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PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[GQt,HQt,e2t,t2t,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),s2t=go.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}),Nse=_o.define({name:"yaml",parser:r2t.configure({props:[xo.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:Rf({closing:"}"}),FlowSequence:Rf({closing:"]"})}),So.add({"FlowMapping FlowSequence":cd,"Item Pair BlockLiteral":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function eXe(){return new Zi(Nse)}const i2t=_o.define({name:"yaml-frontmatter",parser:s2t.configure({props:[yo({DashLine:X.meta})]})});function o2t(e){let{language:t,support:n}=e.content instanceof Zi?e.content:{language:e.content,support:[]};return new Zi(i2t.configure({wrap:VU(r=>r.name=="FrontmatterContent"?{parser:Nse.parser}:r.name=="Body"?{parser:t.parser}:null)}),n)}const a2t=Object.freeze(Object.defineProperty({__proto__:null,yaml:eXe,yamlFrontmatter:o2t,yamlLanguage:Nse},Symbol.toStringTag,{value:"Module"}));function dt(e){return new Zi(Kre.define(e))}function gO(e){return Qe(()=>Promise.resolve().then(()=>aQt),void 0).then(t=>t.sql({dialect:t[e]}))}const l2t=[Ve.of({name:"C",extensions:["c","h","ino"],load(){return Qe(()=>Promise.resolve().then(()=>xme),void 0).then(e=>e.cpp())}}),Ve.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return Qe(()=>Promise.resolve().then(()=>xme),void 0).then(e=>e.cpp())}}),Ve.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return gO("Cassandra")}}),Ve.of({name:"CSS",extensions:["css"],load(){return Qe(()=>Promise.resolve().then(()=>oCt),void 0).then(e=>e.css())}}),Ve.of({name:"Go",extensions:["go"],load(){return Qe(()=>Promise.resolve().then(()=>KCt),void 0).then(e=>e.go())}}),Ve.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return Qe(()=>Promise.resolve().then(()=>CPt),void 0).then(e=>e.html())}}),Ve.of({name:"Java",extensions:["java"],load(){return Qe(()=>Promise.resolve().then(()=>NPt),void 0).then(e=>e.java())}}),Ve.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return Qe(()=>Promise.resolve().then(()=>dI),void 0).then(e=>e.javascript())}}),Ve.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return Qe(()=>import("./index-BpJYupeN.js"),__vite__mapDeps([0,1])).then(e=>e.jinja())}}),Ve.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return Qe(()=>Promise.resolve().then(()=>DPt),void 0).then(e=>e.json())}}),Ve.of({name:"JSX",extensions:["jsx"],load(){return Qe(()=>Promise.resolve().then(()=>dI),void 0).then(e=>e.javascript({jsx:!0}))}}),Ve.of({name:"LESS",extensions:["less"],load(){return Qe(()=>Promise.resolve().then(()=>WPt),void 0).then(e=>e.less())}}),Ve.of({name:"Liquid",extensions:["liquid"],load(){return Qe(()=>import("./index-DjwP6Ixl.js"),__vite__mapDeps([2,1])).then(e=>e.liquid())}}),Ve.of({name:"MariaDB SQL",load(){return gO("MariaSQL")}}),Ve.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return Qe(()=>Promise.resolve().then(()=>$$t),void 0).then(e=>e.markdown())}}),Ve.of({name:"MS SQL",load(){return gO("MSSQL")}}),Ve.of({name:"MySQL",load(){return gO("MySQL")}}),Ve.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return Qe(()=>Promise.resolve().then(()=>tAt),void 0).then(e=>e.php())}}),Ve.of({name:"PLSQL",extensions:["pls"],load(){return gO("PLSQL")}}),Ve.of({name:"PostgreSQL",load(){return gO("PostgreSQL")}}),Ve.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return Qe(()=>Promise.resolve().then(()=>mIt),void 0).then(e=>e.python())}}),Ve.of({name:"Rust",extensions:["rs"],load(){return Qe(()=>Promise.resolve().then(()=>MIt),void 0).then(e=>e.rust())}}),Ve.of({name:"Sass",extensions:["sass"],load(){return Qe(()=>Promise.resolve().then(()=>NOe),void 0).then(e=>e.sass({indented:!0}))}}),Ve.of({name:"SCSS",extensions:["scss"],load(){return Qe(()=>Promise.resolve().then(()=>NOe),void 0).then(e=>e.sass())}}),Ve.of({name:"SQL",extensions:["sql"],load(){return gO("StandardSQL")}}),Ve.of({name:"SQLite",load(){return gO("SQLite")}}),Ve.of({name:"TSX",extensions:["tsx"],load(){return Qe(()=>Promise.resolve().then(()=>dI),void 0).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),Ve.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return Qe(()=>Promise.resolve().then(()=>dI),void 0).then(e=>e.javascript({typescript:!0}))}}),Ve.of({name:"WebAssembly",extensions:["wat","wast"],load(){return Qe(()=>import("./index-CKJk7OXh.js"),__vite__mapDeps([3,1])).then(e=>e.wast())}}),Ve.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return Qe(()=>Promise.resolve().then(()=>RQt),void 0).then(e=>e.xml())}}),Ve.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return Qe(()=>Promise.resolve().then(()=>a2t),void 0).then(e=>e.yaml())}}),Ve.of({name:"APL",extensions:["dyalog","apl"],load(){return Qe(()=>import("./apl-B4CMkyY2.js"),[]).then(e=>dt(e.apl))}}),Ve.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return Qe(()=>import("./asciiarmor-Df11BRmG.js"),[]).then(e=>dt(e.asciiArmor))}}),Ve.of({name:"ASN.1",extensions:["asn","asn1"],load(){return Qe(()=>import("./asn1-EdZsLKOL.js"),[]).then(e=>dt(e.asn1({})))}}),Ve.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return Qe(()=>import("./asterisk-B-8jnY81.js"),[]).then(e=>dt(e.asterisk))}}),Ve.of({name:"Brainfuck",extensions:["b","bf"],load(){return Qe(()=>import("./brainfuck-C4LP7Hcl.js"),[]).then(e=>dt(e.brainfuck))}}),Ve.of({name:"Cobol",extensions:["cob","cpy"],load(){return Qe(()=>import("./cobol-CWcv1MsR.js"),[]).then(e=>dt(e.cobol))}}),Ve.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return Qe(()=>import("./clike-B9uivgTg.js"),[]).then(e=>dt(e.csharp))}}),Ve.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return Qe(()=>import("./clojure-BMjYHr_A.js"),[]).then(e=>dt(e.clojure))}}),Ve.of({name:"ClojureScript",extensions:["cljs"],load(){return Qe(()=>import("./clojure-BMjYHr_A.js"),[]).then(e=>dt(e.clojure))}}),Ve.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return Qe(()=>import("./css-BnMrqG3P.js"),[]).then(e=>dt(e.gss))}}),Ve.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return Qe(()=>import("./cmake-BQqOBYOt.js"),[]).then(e=>dt(e.cmake))}}),Ve.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return Qe(()=>import("./coffeescript-S37ZYGWr.js"),[]).then(e=>dt(e.coffeeScript))}}),Ve.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return Qe(()=>import("./commonlisp-DBKNyK5s.js"),[]).then(e=>dt(e.commonLisp))}}),Ve.of({name:"Cypher",extensions:["cyp","cypher"],load(){return Qe(()=>import("./cypher-C_CwsFkJ.js"),[]).then(e=>dt(e.cypher))}}),Ve.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return Qe(()=>import("./python-BuPzkPfP.js"),[]).then(e=>dt(e.cython))}}),Ve.of({name:"Crystal",extensions:["cr"],load(){return Qe(()=>import("./crystal-SjHAIU92.js"),[]).then(e=>dt(e.crystal))}}),Ve.of({name:"D",extensions:["d"],load(){return Qe(()=>import("./d-pRatUO7H.js"),[]).then(e=>dt(e.d))}}),Ve.of({name:"Dart",extensions:["dart"],load(){return Qe(()=>import("./clike-B9uivgTg.js"),[]).then(e=>dt(e.dart))}}),Ve.of({name:"diff",extensions:["diff","patch"],load(){return Qe(()=>import("./diff-DbItnlRl.js"),[]).then(e=>dt(e.diff))}}),Ve.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return Qe(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([4,5])).then(e=>dt(e.dockerFile))}}),Ve.of({name:"DTD",extensions:["dtd"],load(){return Qe(()=>import("./dtd-DF_7sFjM.js"),[]).then(e=>dt(e.dtd))}}),Ve.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return Qe(()=>import("./dylan-DwRh75JA.js"),[]).then(e=>dt(e.dylan))}}),Ve.of({name:"EBNF",load(){return Qe(()=>import("./ebnf-CDyGwa7X.js"),[]).then(e=>dt(e.ebnf))}}),Ve.of({name:"ECL",extensions:["ecl"],load(){return Qe(()=>import("./ecl-Cabwm37j.js"),[]).then(e=>dt(e.ecl))}}),Ve.of({name:"edn",extensions:["edn"],load(){return Qe(()=>import("./clojure-BMjYHr_A.js"),[]).then(e=>dt(e.clojure))}}),Ve.of({name:"Eiffel",extensions:["e"],load(){return Qe(()=>import("./eiffel-CnydiIhH.js"),[]).then(e=>dt(e.eiffel))}}),Ve.of({name:"Elm",extensions:["elm"],load(){return Qe(()=>import("./elm-vLlmbW-K.js"),[]).then(e=>dt(e.elm))}}),Ve.of({name:"Erlang",extensions:["erl"],load(){return Qe(()=>import("./erlang-BNw1qcRV.js"),[]).then(e=>dt(e.erlang))}}),Ve.of({name:"Esper",load(){return Qe(()=>import("./sql-D0XecflT.js"),[]).then(e=>dt(e.esper))}}),Ve.of({name:"Factor",extensions:["factor"],load(){return Qe(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([6,5])).then(e=>dt(e.factor))}}),Ve.of({name:"FCL",load(){return Qe(()=>import("./fcl-Kvtd6kyn.js"),[]).then(e=>dt(e.fcl))}}),Ve.of({name:"Forth",extensions:["forth","fth","4th"],load(){return Qe(()=>import("./forth-Ffai-XNe.js"),[]).then(e=>dt(e.forth))}}),Ve.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return Qe(()=>import("./fortran-DYz_wnZ1.js"),[]).then(e=>dt(e.fortran))}}),Ve.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return Qe(()=>import("./mllike-CXdrOF99.js"),[]).then(e=>dt(e.fSharp))}}),Ve.of({name:"Gas",extensions:["s"],load(){return Qe(()=>import("./gas-Bneqetm1.js"),[]).then(e=>dt(e.gas))}}),Ve.of({name:"Gherkin",extensions:["feature"],load(){return Qe(()=>import("./gherkin-heZmZLOM.js"),[]).then(e=>dt(e.gherkin))}}),Ve.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return Qe(()=>import("./groovy-D9Dt4D0W.js"),[]).then(e=>dt(e.groovy))}}),Ve.of({name:"Haskell",extensions:["hs"],load(){return Qe(()=>import("./haskell-BWDZoCOh.js"),[]).then(e=>dt(e.haskell))}}),Ve.of({name:"Haxe",extensions:["hx"],load(){return Qe(()=>import("./haxe-H-WmDvRZ.js"),[]).then(e=>dt(e.haxe))}}),Ve.of({name:"HXML",extensions:["hxml"],load(){return Qe(()=>import("./haxe-H-WmDvRZ.js"),[]).then(e=>dt(e.hxml))}}),Ve.of({name:"HTTP",load(){return Qe(()=>import("./http-DBlCnlav.js"),[]).then(e=>dt(e.http))}}),Ve.of({name:"IDL",extensions:["pro"],load(){return Qe(()=>import("./idl-BEugSyMb.js"),[]).then(e=>dt(e.idl))}}),Ve.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return Qe(()=>import("./javascript-qCveANmP.js"),[]).then(e=>dt(e.jsonld))}}),Ve.of({name:"Julia",extensions:["jl"],load(){return Qe(()=>import("./julia-DuME0IfC.js"),[]).then(e=>dt(e.julia))}}),Ve.of({name:"Kotlin",extensions:["kt","kts"],load(){return Qe(()=>import("./clike-B9uivgTg.js"),[]).then(e=>dt(e.kotlin))}}),Ve.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return Qe(()=>import("./livescript-BwQOo05w.js"),[]).then(e=>dt(e.liveScript))}}),Ve.of({name:"Lua",extensions:["lua"],load(){return Qe(()=>import("./lua-BgMRiT3U.js"),[]).then(e=>dt(e.lua))}}),Ve.of({name:"mIRC",extensions:["mrc"],load(){return Qe(()=>import("./mirc-CjQqDB4T.js"),[]).then(e=>dt(e.mirc))}}),Ve.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return Qe(()=>import("./mathematica-DTrFuWx2.js"),[]).then(e=>dt(e.mathematica))}}),Ve.of({name:"Modelica",extensions:["mo"],load(){return Qe(()=>import("./modelica-Dc1JOy9r.js"),[]).then(e=>dt(e.modelica))}}),Ve.of({name:"MUMPS",extensions:["mps"],load(){return Qe(()=>import("./mumps-BT43cFF4.js"),[]).then(e=>dt(e.mumps))}}),Ve.of({name:"Mbox",extensions:["mbox"],load(){return Qe(()=>import("./mbox-CNhZ1qSd.js"),[]).then(e=>dt(e.mbox))}}),Ve.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return Qe(()=>import("./nginx-DdIZxoE0.js"),[]).then(e=>dt(e.nginx))}}),Ve.of({name:"NSIS",extensions:["nsh","nsi"],load(){return Qe(()=>import("./nsis-LdVXkNf5.js"),__vite__mapDeps([7,5])).then(e=>dt(e.nsis))}}),Ve.of({name:"NTriples",extensions:["nt","nq"],load(){return Qe(()=>import("./ntriples-BfvgReVJ.js"),[]).then(e=>dt(e.ntriples))}}),Ve.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return Qe(()=>import("./clike-B9uivgTg.js"),[]).then(e=>dt(e.objectiveC))}}),Ve.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return Qe(()=>import("./clike-B9uivgTg.js"),[]).then(e=>dt(e.objectiveCpp))}}),Ve.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return Qe(()=>import("./mllike-CXdrOF99.js"),[]).then(e=>dt(e.oCaml))}}),Ve.of({name:"Octave",extensions:["m"],load(){return Qe(()=>import("./octave-Ck1zUtKM.js"),[]).then(e=>dt(e.octave))}}),Ve.of({name:"Oz",extensions:["oz"],load(){return Qe(()=>import("./oz-BzwKVEFT.js"),[]).then(e=>dt(e.oz))}}),Ve.of({name:"Pascal",extensions:["p","pas"],load(){return Qe(()=>import("./pascal--L3eBynH.js"),[]).then(e=>dt(e.pascal))}}),Ve.of({name:"Perl",extensions:["pl","pm"],load(){return Qe(()=>import("./perl-CdXCOZ3F.js"),[]).then(e=>dt(e.perl))}}),Ve.of({name:"Pig",extensions:["pig"],load(){return Qe(()=>import("./pig-CevX1Tat.js"),[]).then(e=>dt(e.pig))}}),Ve.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return Qe(()=>import("./powershell-CFHJl5sT.js"),[]).then(e=>dt(e.powerShell))}}),Ve.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return Qe(()=>import("./properties-C78fOPTZ.js"),[]).then(e=>dt(e.properties))}}),Ve.of({name:"ProtoBuf",extensions:["proto"],load(){return Qe(()=>import("./protobuf-ChK-085T.js"),[]).then(e=>dt(e.protobuf))}}),Ve.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return Qe(()=>import("./pug-DukmZTjD.js"),__vite__mapDeps([8,9])).then(e=>dt(e.pug))}}),Ve.of({name:"Puppet",extensions:["pp"],load(){return Qe(()=>import("./puppet-DMA9R1ak.js"),[]).then(e=>dt(e.puppet))}}),Ve.of({name:"Q",extensions:["q"],load(){return Qe(()=>import("./q-pXgVlZs6.js"),[]).then(e=>dt(e.q))}}),Ve.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return Qe(()=>import("./r-DUYO_cvP.js"),[]).then(e=>dt(e.r))}}),Ve.of({name:"RPM Changes",load(){return Qe(()=>import("./rpm-CTu-6PCP.js"),[]).then(e=>dt(e.rpmChanges))}}),Ve.of({name:"RPM Spec",extensions:["spec"],load(){return Qe(()=>import("./rpm-CTu-6PCP.js"),[]).then(e=>dt(e.rpmSpec))}}),Ve.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return Qe(()=>import("./ruby-B2Rjki9n.js"),[]).then(e=>dt(e.ruby))}}),Ve.of({name:"SAS",extensions:["sas"],load(){return Qe(()=>import("./sas-B4kiWyti.js"),[]).then(e=>dt(e.sas))}}),Ve.of({name:"Scala",extensions:["scala"],load(){return Qe(()=>import("./clike-B9uivgTg.js"),[]).then(e=>dt(e.scala))}}),Ve.of({name:"Scheme",extensions:["scm","ss"],load(){return Qe(()=>import("./scheme-C41bIUwD.js"),[]).then(e=>dt(e.scheme))}}),Ve.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return Qe(()=>import("./shell-CjFT_Tl9.js"),[]).then(e=>dt(e.shell))}}),Ve.of({name:"Sieve",extensions:["siv","sieve"],load(){return Qe(()=>import("./sieve-C3Gn_uJK.js"),[]).then(e=>dt(e.sieve))}}),Ve.of({name:"Smalltalk",extensions:["st"],load(){return Qe(()=>import("./smalltalk-CnHTOXQT.js"),[]).then(e=>dt(e.smalltalk))}}),Ve.of({name:"Solr",load(){return Qe(()=>import("./solr-DehyRSwq.js"),[]).then(e=>dt(e.solr))}}),Ve.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return Qe(()=>import("./mllike-CXdrOF99.js"),[]).then(e=>dt(e.sml))}}),Ve.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return Qe(()=>import("./sparql-DkYu6x3z.js"),[]).then(e=>dt(e.sparql))}}),Ve.of({name:"Spreadsheet",alias:["excel","formula"],load(){return Qe(()=>import("./spreadsheet-BCZA_wO0.js"),[]).then(e=>dt(e.spreadsheet))}}),Ve.of({name:"Squirrel",extensions:["nut"],load(){return Qe(()=>import("./clike-B9uivgTg.js"),[]).then(e=>dt(e.squirrel))}}),Ve.of({name:"Stylus",extensions:["styl"],load(){return Qe(()=>import("./stylus-B533Al4x.js"),[]).then(e=>dt(e.stylus))}}),Ve.of({name:"Swift",extensions:["swift"],load(){return Qe(()=>import("./swift-BzpIVaGY.js"),[]).then(e=>dt(e.swift))}}),Ve.of({name:"sTeX",load(){return Qe(()=>import("./stex-C3f8Ysf7.js"),[]).then(e=>dt(e.stex))}}),Ve.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return Qe(()=>import("./stex-C3f8Ysf7.js"),[]).then(e=>dt(e.stex))}}),Ve.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return Qe(()=>import("./verilog-C6RDOZhf.js"),[]).then(e=>dt(e.verilog))}}),Ve.of({name:"Tcl",extensions:["tcl"],load(){return Qe(()=>import("./tcl-DVfN8rqt.js"),[]).then(e=>dt(e.tcl))}}),Ve.of({name:"Textile",extensions:["textile"],load(){return Qe(()=>import("./textile-CnDTJFAw.js"),[]).then(e=>dt(e.textile))}}),Ve.of({name:"TiddlyWiki",load(){return Qe(()=>import("./tiddlywiki-DO-Gjzrf.js"),[]).then(e=>dt(e.tiddlyWiki))}}),Ve.of({name:"Tiki wiki",load(){return Qe(()=>import("./tiki-DGYXhP31.js"),[]).then(e=>dt(e.tiki))}}),Ve.of({name:"TOML",extensions:["toml"],load(){return Qe(()=>import("./toml-Bm5Em-hy.js"),[]).then(e=>dt(e.toml))}}),Ve.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return Qe(()=>import("./troff-wAsdV37c.js"),[]).then(e=>dt(e.troff))}}),Ve.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return Qe(()=>import("./ttcn-CfJYG6tj.js"),[]).then(e=>dt(e.ttcn))}}),Ve.of({name:"TTCN_CFG",extensions:["cfg"],load(){return Qe(()=>import("./ttcn-cfg-B9xdYoR4.js"),[]).then(e=>dt(e.ttcnCfg))}}),Ve.of({name:"Turtle",extensions:["ttl"],load(){return Qe(()=>import("./turtle-B1tBg_DP.js"),[]).then(e=>dt(e.turtle))}}),Ve.of({name:"Web IDL",extensions:["webidl"],load(){return Qe(()=>import("./webidl-ZXfAyPTL.js"),[]).then(e=>dt(e.webIDL))}}),Ve.of({name:"VB.NET",extensions:["vb"],load(){return Qe(()=>import("./vb-CmGdzxic.js"),[]).then(e=>dt(e.vb))}}),Ve.of({name:"VBScript",extensions:["vbs"],load(){return Qe(()=>import("./vbscript-BuJXcnF6.js"),[]).then(e=>dt(e.vbScript))}}),Ve.of({name:"Velocity",extensions:["vtl"],load(){return Qe(()=>import("./velocity-D8B20fx6.js"),[]).then(e=>dt(e.velocity))}}),Ve.of({name:"Verilog",extensions:["v"],load(){return Qe(()=>import("./verilog-C6RDOZhf.js"),[]).then(e=>dt(e.verilog))}}),Ve.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return Qe(()=>import("./vhdl-lSbBsy5d.js"),[]).then(e=>dt(e.vhdl))}}),Ve.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return Qe(()=>import("./xquery-CQfU5ijd.js"),[]).then(e=>dt(e.xQuery))}}),Ve.of({name:"Yacas",extensions:["ys"],load(){return Qe(()=>import("./yacas-BJ4BC0dw.js"),[]).then(e=>dt(e.yacas))}}),Ve.of({name:"Z80",extensions:["z80"],load(){return Qe(()=>import("./z80-Hz9HOZM7.js"),[]).then(e=>dt(e.z80))}}),Ve.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return Qe(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(e=>dt(e.mscgen))}}),Ve.of({name:"Xù",extensions:["xu"],load(){return Qe(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(e=>dt(e.xu))}}),Ve.of({name:"MsGenny",extensions:["msgenny"],load(){return Qe(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(e=>dt(e.msgenny))}}),Ve.of({name:"Vue",extensions:["vue"],load(){return Qe(()=>import("./index-CvnJPw8e.js"),__vite__mapDeps([10,1])).then(e=>e.vue())}}),Ve.of({name:"Angular Template",load(){return Qe(()=>import("./index-aaTSqCVw.js"),__vite__mapDeps([11,1])).then(e=>e.angular())}})];function tXe(e){const t=e.split(".").pop()?.toLowerCase();switch(t){case"ts":case"tsx":case"js":case"jsx":case"mjs":case"cjs":return hse({jsx:t==="tsx"||t==="jsx",typescript:t==="ts"||t==="tsx"});case"py":return Eje();case"json":case"jsonl":return E5e();case"css":return nse();case"scss":return lZ({indented:!1});case"sass":return lZ({indented:!0});case"less":return C5e();case"html":case"htm":return cz();case"xml":case"svg":return Yje();case"md":case"mdx":case"markdown":return lje();case"yaml":case"yml":return eXe();case"rs":return kje();case"go":return FLe();case"java":return v5e();case"c":case"h":case"cpp":case"cxx":case"cc":case"hpp":return PLe();case"php":return pje();case"sql":return Xje();default:return null}}function hZn(e){return Ve.matchFilename(l2t,e)}function pY(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 Rp=null,n0=null,Sx=null;const Dp={register(e,t,n){Rp=e,n0=t,Sx=n},unregister(){Rp=null,n0=null,Sx=null},get isRegistered(){return Rp!==null},getContent(e){return Rp?.get(e)?.doc.toString()??null},getAllModifiedContent(e){const t=new Map;for(const n of Object.keys(e)){if(!e[n])continue;const r=Rp?.get(n)?.doc.toString();r!==void 0&&t.set(n,r)}return t},deleteState(e){Rp?.delete(e),n0?.delete(e)},destroy(){Sx?.destroy(),Rp?.clear(),n0?.clear(),Sx=null},remapState(e,t){const n=Rp?.get(e);n&&(Rp.delete(e),Rp.set(t,n));const r=n0?.get(e);r!==void 0&&(n0.delete(e),n0.set(t,r))},updateView(e){Sx=e},getView(){return Sx}},c2t=1e4;let aC=null;const bZ=new Set;function u2t(e){return bZ.add(e),()=>bZ.delete(e)}function d2t(){aC=null,bZ.forEach(e=>e())}function Jw(e){return aC?.projectPath===e&&Date.now()-aC.timestamp<c2t?{files:aC.files}:null}function nXe(e,t){aC={files:t,projectPath:e,timestamp:Date.now()}}function gI(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=al(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 xs=eo("Store:editor");function di(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}const hd=new Map,p2t=2e3;let fY=null;const f2t=1500,hY=new Map,h2t=350;let mY=null,_I={change:0,create:0,delete:0},q0=null,ML="",W0=null,QL="";const m2t=250,O2t=120;function Q1(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}
|
|
1033
1033
|
${r.join(`
|
|
1034
1034
|
`)}`;s!==ML&&(ML=s,q0&&clearTimeout(q0),q0=setTimeout(()=>{q0=null,ee.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,O2t);s.sort((o,a)=>o.localeCompare(a));const i=`${n}
|
|
1035
1035
|
${s.join(`
|
|
1036
|
-
`)}`;i!==QL&&(QL=i,W0&&clearTimeout(W0),W0=setTimeout(()=>{W0=null,ee.editor.setWatchedDirs(s)},m2t))}let r0=0;const vx=new Map,g2t=2e3;function _2t(e){try{const t=window.requestIdleCallback;if(typeof t=="function"){t(e,{timeout:2e3});return}}catch{}setTimeout(e,150)}const b2t=(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=NR(r),a=al(o),c=al(n),l=Yc(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=aL(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){xs.info("revealAndOpenFile: tree not loaded yet, deferring reveal");return}const a=NR(r),c=al(a),l=al(n),d=Yc(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=aL(m,h[O]??""),await i(m)}o(n),e({editorPendingRevealFile:null})},openEditor:async n=>{const r=++r0;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 ee.editor.open(n);const i=performance.now()-s;if(r0!==r||t().editorProjectPath!==n)return;const o=performance.now(),a=await ee.editor.readDir(n),c=performance.now()-o;if(r0!==r||t().editorProjectPath!==n)return;const l=performance.now();e({editorFileTree:a.entries,editorFileTreeLoading:!1});const d=performance.now()-l;xs.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}})();_2t(()=>{r0!==r||t().editorProjectPath!==n||(p&&t().toggleWatcher(!0),setTimeout(()=>{r0!==r||t().editorProjectPath!==n||t().fetchGitStatus()},1200))})}catch(s){if(r0!==r||t().editorProjectPath!==n)return;const i=s instanceof Error?s.message:String(s);xs.error("Failed to open editor:",i),e({editorFileTreeLoading:!1,editorFileTreeError:i})}},closeEditor:()=>{r0++,q0&&(clearTimeout(q0),q0=null),W0&&(clearTimeout(W0),W0=null),ML="",QL="",hd.clear(),vx.clear(),ee.editor.close().catch(n=>{xs.error("editor:close failed:",n)}),Dp.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 ee.editor.readDir(n),i=performance.now()-r,o=performance.now();e({editorFileTree:s.entries,editorFileTreeLoading:!1});const a=performance.now()-o;xs.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);xs.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 ee.editor.readDir(n),a=performance.now()-i,c=t().editorFileTree,l=performance.now(),d=Ase(c??[],n,o.entries),p=performance.now()-l,f=performance.now();e({editorFileTree:d});const h=performance.now()-f;xs.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);xs.error("Failed to expand directory:",o);const a=t().editorExpandedDirs;e({editorExpandedDirs:di(a,n)})}},collapseDirectory:n=>{const{editorExpandedDirs:r}=t();e({editorExpandedDirs:di(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=kf(n)||"file",o=pY(i),a={id:n,filePath:n,fileName:i,language:o},c=gI([...r,a]);e({editorOpenTabs:c,editorActiveTabId:a.id}),Q1(t)},closeEditorTab:n=>{const{editorOpenTabs:r,editorActiveTabId:s,editorModifiedFiles:i,editorSaveError:o}=t(),a=r.filter(f=>f.id!==n),c=di(i,n),l=di(o,n);Dp.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=gI(a);e({editorOpenTabs:p,editorActiveTabId:d,editorModifiedFiles:c,editorSaveError:l}),Q1(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:di(r,n)})},saveFile:async n=>{const r=Dp.getContent(n);if(r===null){xs.error("saveFile: no content available for",n);return}e(s=>({editorSaving:{...s.editorSaving,[n]:!0},editorSaveError:di(s.editorSaveError,n)}));try{const s=t().editorFileMtimes[n],i=await ee.editor.writeFile(n,r,s);hd.set(n,Date.now()),e(o=>({editorModifiedFiles:di(o.editorModifiedFiles,n),editorSaving:di(o.editorSaving,n),editorFileMtimes:{...o.editorFileMtimes,[n]:i.mtimeMs},editorExternalChanges:di(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")){xs.error("Save conflict detected:",n),e(o=>({editorSaving:di(o.editorSaving,n),editorConflictFile:n}));return}xs.error("Failed to save file:",i),e(o=>({editorSaving:di(o.editorSaving,n),editorSaveError:{...o.editorSaveError,[n]:i}}))}},saveAllFiles:async()=>{const{editorModifiedFiles:n}=t(),r=Dp.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 ee.editor.writeFile(i,o,a);hd.set(i,Date.now()),e(l=>({editorModifiedFiles:di(l.editorModifiedFiles,i),editorSaving:di(l.editorSaving,i),editorFileMtimes:{...l.editorFileMtimes,[i]:c.mtimeMs},editorExternalChanges:di(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")){xs.error("Save conflict detected:",i),e(l=>({editorSaving:di(l.editorSaving,i),editorConflictFile:i}));return}xs.error("Failed to save file:",i,c),e(l=>({editorSaving:di(l.editorSaving,i),editorSaveError:{...l.editorSaveError,[i]:c}}))}})());await Promise.allSettled(s)},discardChanges:n=>{const{editorModifiedFiles:r,editorSaveError:s}=t();e({editorModifiedFiles:di(r,n),editorSaveError:di(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 ee.editor.createFile(n,r);return await s0(t,e,n),e({editorCreating:!1}),s.filePath}catch(s){const i=s instanceof Error?s.message:String(s);return xs.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 ee.editor.createDir(n,r);return await s0(t,e,n),e({editorCreating:!1}),s.dirPath}catch(s){const i=s instanceof Error?s.message:String(s);return xs.error("Failed to create directory:",i),e({editorCreating:!1,editorCreateError:i}),null}},deleteFileFromTree:async n=>{try{await ee.editor.deleteFile(n);const{editorOpenTabs:r}=t(),s=r.filter(o=>zSt(n,o.filePath));for(const o of s)t().closeEditorTab(o.id);const i=n.substring(0,F0(n));return i&&await s0(t,e,i),!0}catch(r){const s=r instanceof Error?r.message:String(r);return xs.error("Failed to delete file:",s),!1}},moveFileInTree:async(n,r)=>{const{editorSaving:s}=t();if(s[n])return xs.error("moveFileInTree: blocked — file is being saved:",n),!1;try{const i=await ee.editor.moveFile(n,r),{newPath:o,isDirectory:a}=i,c=n.substring(0,F0(n));vx.set(n,Date.now()),vx.set(o,Date.now()),e(d=>{const p=d.editorOpenTabs.map(f=>{const h=wh(f.filePath,n,o);if(h===f.filePath)return f;const m=kf(h)||"file";return{...f,id:h,filePath:h,fileName:m,language:pY(m)}});return{editorOpenTabs:gI(p),editorActiveTabId:wh(d.editorActiveTabId??"",n,o)||d.editorActiveTabId,editorModifiedFiles:Il(d.editorModifiedFiles,n,o),editorSaving:Il(d.editorSaving,n,o),editorSaveError:Il(d.editorSaveError,n,o),editorFileLoading:Il(d.editorFileLoading,n,o),editorExternalChanges:Il(d.editorExternalChanges,n,o),editorFileMtimes:Il(d.editorFileMtimes,n,o),editorExpandedDirs:Il(d.editorExpandedDirs,n,o)}}),Q1(t);const{editorOpenTabs:l}=t();for(const d of l){const p=KOe(d.filePath,n,o);p!==d.filePath&&Dp.remapState(p,d.filePath)}a||Dp.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=wh(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[...hd.entries()]){const f=wh(d,n,o);f!==d&&(hd.delete(d),hd.set(f,p))}return s0(t,e,c),s0(t,e,r),t().fetchGitStatus(),!0}catch(i){const o=i instanceof Error?i.message:String(i);return xs.error("moveFileInTree failed:",o),!1}},renameFileInTree:async(n,r)=>{const{editorSaving:s}=t();if(s[n])return xs.error("renameFileInTree: blocked — file is being saved:",n),!1;try{const i=await ee.editor.renameFile(n,r),{newPath:o,isDirectory:a}=i,c=n.substring(0,F0(n));vx.set(n,Date.now()),vx.set(o,Date.now()),e(d=>{const p=d.editorOpenTabs.map(f=>{const h=wh(f.filePath,n,o);if(h===f.filePath)return f;const m=kf(h)||"file";return{...f,id:h,filePath:h,fileName:m,language:pY(m)}});return{editorOpenTabs:gI(p),editorActiveTabId:wh(d.editorActiveTabId??"",n,o)||d.editorActiveTabId,editorModifiedFiles:Il(d.editorModifiedFiles,n,o),editorSaving:Il(d.editorSaving,n,o),editorSaveError:Il(d.editorSaveError,n,o),editorFileLoading:Il(d.editorFileLoading,n,o),editorExternalChanges:Il(d.editorExternalChanges,n,o),editorFileMtimes:Il(d.editorFileMtimes,n,o),editorExpandedDirs:Il(d.editorExpandedDirs,n,o)}}),Q1(t);const{editorOpenTabs:l}=t();for(const d of l){const p=KOe(d.filePath,n,o);p!==d.filePath&&Dp.remapState(p,d.filePath)}a||Dp.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=wh(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[...hd.entries()]){const f=wh(d,n,o);f!==d&&(hd.delete(d),hd.set(f,p))}return s0(t,e,c),t().fetchGitStatus(),!0}catch(i){const o=i instanceof Error?i.message:String(i);return xs.error("renameFileInTree failed:",o),!1}},fetchGitStatus:async()=>{e({editorGitLoading:!0});try{const n=performance.now(),r=await ee.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;xs.info(`[perf] fetchGitStatus: IPC=${s.toFixed(1)}ms, set=${o.toFixed(1)}ms, files=${r.files.length}`)}catch(n){xs.error("Failed to fetch git status:",n),e({editorGitLoading:!1})}},toggleWatcher:async n=>{try{await ee.editor.watchDir(n),e({editorWatcherEnabled:n});try{localStorage.setItem("editor-watcher-enabled",String(n))}catch{}n?(Q1(t),OY(t)):(ML="",QL="",ee.editor.setWatchedFiles([]),ee.editor.setWatchedDirs([]))}catch(r){xs.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=>{_I[n.type]=(_I[n.type]??0)+1,mY||(mY=setTimeout(()=>{mY=null;const l=_I;_I={change:0,create:0,delete:0},xs.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=hd.get(n.path);if(o&&Date.now()-o<p2t)return;const a=vx.get(n.path);if(a&&Date.now()-a<g2t)return;if((r.some(l=>l.filePath===n.path)||n.type==="delete")&&e(l=>({editorExternalChanges:{...l.editorExternalChanges,[n.path]:n.type}})),fY||(fY=setTimeout(()=>{fY=null,t().fetchGitStatus()},f2t)),n.type==="create"||n.type==="delete"){d2t();const l=n.path.substring(0,F0(n.path));if(l&&s){const d=hY.get(l);d&&clearTimeout(d);const p=setTimeout(()=>{hY.delete(l),s0(t,e,l)},h2t);hY.set(l,p)}}},clearExternalChange:n=>{e(r=>({editorExternalChanges:di(r.editorExternalChanges,n)}))},setFileMtime:(n,r)=>{e(s=>({editorFileMtimes:{...s.editorFileMtimes,[n]:r}}))},forceOverwrite:async n=>{const r=Dp.getContent(n);if(r===null){xs.error("forceOverwrite: no content available for",n);return}e(s=>({editorSaving:{...s.editorSaving,[n]:!0},editorConflictFile:null}));try{const s=await ee.editor.writeFile(n,r);hd.set(n,Date.now()),e(i=>({editorModifiedFiles:di(i.editorModifiedFiles,n),editorSaving:di(i.editorSaving,n),editorFileMtimes:{...i.editorFileMtimes,[n]:s.mtimeMs},editorExternalChanges:di(i.editorExternalChanges,n)}));try{localStorage.removeItem(`editor-draft:${n}`)}catch{}}catch(s){const i=s instanceof Error?s.message:String(s);xs.error("Failed to force overwrite:",i),e(o=>({editorSaving:di(o.editorSaving,n),editorSaveError:{...o.editorSaveError,[n]:i}}))}},resolveConflict:()=>{e({editorConflictFile:null})}});async function s0(e,t,n){try{const r=performance.now(),s=await ee.editor.readDir(n);xs.info(`[perf] refreshDirectory: IPC=${(performance.now()-r).toFixed(1)}ms, entries=${s.entries.length}, dir=${kf(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=Ase(i,n,s.entries);t({editorFileTree:a})}}catch(r){xs.error("Failed to refresh directory:",r)}}function wh(e,t,n){const r=al(t),s=al(e);if(r.length===0)return e;const i=Yc(t)||Yc(e)||Yc(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?aL(n,...c):n}function KOe(e,t,n){const r=al(n),s=al(e);if(r.length===0)return e;const i=Yc(t)||Yc(e)||Yc(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?aL(t,...c):t}function Il(e,t,n){const r={};let s=!1;for(const[i,o]of Object.entries(e)){const a=wh(i,t,n);a!==i&&(s=!0),r[a]=o}return s?r:e}function Ase(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=Ase(i.children,t,n);if(o!==i.children)return r=!0,{...i,children:o}}return i});return r?s:e}function JOe(e,t,n){return t==="project"||t==="local"?`plugin:${e}:${t}:${bT(n)}`:`plugin:${e}:${t}`}function sP(e,t,n){return t==="project"||t==="local"?`mcp:${e}:${t}:${bT(n)}`:`mcp:${e}:${t}`}function HQ(e,t){return t?`mcp-diagnostic:${t}:${e}`:`mcp-diagnostic:${e}`}function bT(e){return e??"__global__"}function y2t(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 ege={local:0,project:1,global:2,user:2};function rXe(e){return e.length===0?null:[...e].sort((t,n)=>ege[t.scope]-ege[n.scope])[0]}function sXe(e){const t=Array.from(new Set(e.map(n=>n.scope)));return y2t(t)}function JO(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=>jfe(UA(p,"mcp"))).length>0?null:i.map(p=>UA(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=>jfe(UA(l,"plugins")));return a.length===0?i.map(d=>UA(d,"plugins").reason).find(d=>typeof d=="string"&&d.trim().length>0)??"当前运行时不支持安装插件。":t||a.find(l=>l.authenticated)?null:`${a[0]?.displayName??"Anthropic"} 未连接。请打开首页登录。`}function DL(e){return e.toLowerCase().replace(/\s+/g,"-").replace(/[^\w.-]/g,"")}function Ise(e){return e==="agent_teams_orchestrator"?"global":"user"}function iXe(e){return e==="user"||e==="global"}function ku(e){return e==="project"||e==="local"}function yZ(e,t){switch(e){case"global":return"全局";case"user":return t==="agent_teams_orchestrator"?"用户(旧版)":"用户(全局)";case"project":return"项目";case"local":return"本地";default:return e}}function Fl(e,t){return e.panes.find(n=>n.id===t)}function jh(e,t){return e.panes.find(n=>n.tabs.some(r=>r.id===t))}function ro(e,t){return{...e,panes:e.panes.map(n=>n.id===t.id?t:n)}}function ek(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=oXe(o);let c=e.focusedPaneId;return e.focusedPaneId===t&&(c=a[Math.min(n,a.length-1)].id),{panes:a,focusedPaneId:c}}function tge(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:oXe(o)}}function oXe(e){if(e.length===0)return e;const t=1/e.length;return e.map(n=>({...n,widthFraction:t}))}function aXe(e){const t=Fl(e,e.focusedPaneId);return t?{openTabs:t.tabs,activeTabId:t.activeTabId,selectedTabIds:t.selectedTabIds}:{openTabs:[],activeTabId:null,selectedTabIds:[]}}function xu(e){return e.panes.flatMap(t=>t.tabs)}function nge(e){return{id:e,tabs:[],activeTabId:null,selectedTabIds:[],widthFraction:0}}let Tx=null,gY=0;const iP=new Map,oP=new Map,_Y=new Map;let x2t=0,S2t=0;const bY=new Map,yY=new Map,v2t="__user__";function xY(e){return Object.values(e).some(Boolean)}function T2t(e){return e??"__user__"}function bI(e){return new Set(e.map(t=>t.pluginId))}function xZ(e,t){return e.startsWith(`plugin:${t}:`)}function rge(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=>xZ(o,a))&&delete r[o];for(const o of Object.keys(s))i.some(a=>xZ(o,a))&&delete s[o];return{pluginInstallProgress:r,installErrors:s}}function Ah(e){const t=iP.get(e);t&&(clearTimeout(t),iP.delete(e))}function sge(e){const t=Array.from(e);for(const n of Array.from(iP.keys()))t.some(r=>xZ(n,r))&&Ah(n)}function ige(e,t){Ah(e);const n=setTimeout(()=>{iP.delete(e),t(r=>r.pluginInstallProgress[e]!=="success"?{}:{pluginInstallProgress:{...r.pluginInstallProgress,[e]:"idle"}})},lXe);iP.set(e,n)}function E2t(e,t,n){return t==="project"||t==="local"?`mcp-custom:${e}:${t}:${bT(n)}`:`mcp-custom:${e}:${t}`}function SZ(e){return e.includes(":project:")||e.endsWith(":project")||e.includes(":local:")||e.endsWith(":local")}function gu(e){const t=oP.get(e);t&&(clearTimeout(t),oP.delete(e))}function SY(e,t){gu(e);const n=setTimeout(()=>{oP.delete(e),t(r=>r.mcpInstallProgress[e]!=="success"?{}:{mcpInstallProgress:{...r.mcpInstallProgress,[e]:"idle"}})},lXe);oP.set(e,n)}function w2t(e,t){const n={...e},r={...t};for(const s of Object.keys(n))(s.startsWith("mcp:")||s.startsWith("mcp-custom:"))&&SZ(s)&&delete n[s];for(const s of Object.keys(r))(s.startsWith("mcp:")||s.startsWith("mcp-custom:"))&&SZ(s)&&delete r[s];return{mcpInstallProgress:n,installErrors:r}}function k2t(){for(const e of Array.from(oP.keys()))SZ(e)&&gu(e)}function C2t(e){return e??v2t}function R2t(e,t){const n=e.filter(r=>r.id!==t.id);return[t,...n]}const lXe=2e3,oge="Project- and local-scoped plugins require an active project in the Extensions tab.";function i0(e){return e_({multimodelEnabled:e.appConfig?.general?.multimodelEnabled??!1,bootstrapCliStatus:e.bootstrapCliStatus,fetchCliStatus:e.fetchCliStatus})}function D1(e){return{cliStatus:e.cliStatus,cliStatusLoading:e.cliStatus===null&&e.cliStatusLoading}}const P2t=(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(!ee.plugins)return;const s=T2t(n);if(Tx&&!r&&Tx.key===s){await Tx.promise;return}const i=++gY,o=Symbol("pluginCatalogRequest");e({pluginCatalogLoading:!0,pluginCatalogError:null});let a=null;a=(async()=>{try{const c=await ee.plugins.getAll(n,r);e(l=>{if(i!==gY)return{};const d=n??null,f=l.pluginCatalogProjectPath===d?new Set:new Set([...bI(l.pluginCatalog),...bI(c)]),h=rge(f,l.pluginInstallProgress,l.installErrors);return sge(f),{pluginCatalog:c,pluginCatalogLoading:!1,pluginCatalogError:null,pluginCatalogProjectPath:d,pluginInstallProgress:h.pluginInstallProgress,installErrors:h.installErrors}})}catch(c){e(l=>{if(i!==gY)return{};const d=n??null,p=l.pluginCatalogProjectPath===d,f=rge(p?new Set:bI(l.pluginCatalog),l.pluginInstallProgress,l.installErrors);return sge(p?new Set:bI(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{Tx?.token===o&&(Tx=null)}})(),Tx={key:s,promise:a,token:o},await a},fetchPluginReadme:n=>{if(!ee.plugins)return;const r=t(),s=r.pluginReadmes[n];s!=null||r.pluginReadmeLoading[n]||(e(i=>({pluginReadmeLoading:{...i.pluginReadmeLoading,[n]:!0}})),ee.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(ee.mcpRegistry){e({mcpBrowseLoading:!0,mcpBrowseError:null});try{const r=await ee.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(ee.mcpRegistry)try{const r=await ee.mcpRegistry.getInstalled(n);e(s=>{const i=n??null,o=bT(i),a=s.mcpInstalledProjectPath===i,c=a?{mcpInstallProgress:s.mcpInstallProgress,installErrors:s.installErrors}:w2t(s.mcpInstallProgress,s.installErrors);return a||k2t(),{mcpInstalledServers:r,mcpInstalledServersByProjectPath:{...s.mcpInstalledServersByProjectPath,[o]:r},mcpInstalledProjectPath:i,mcpInstallProgress:c.mcpInstallProgress,installErrors:c.installErrors}})}catch{}},runMcpDiagnostics:async n=>{const r=ee.mcpRegistry;if(!r)return;const s=bT(n),i=_Y.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=>[HQ(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{_Y.delete(s)}})();_Y.set(s,o),await o},fetchSkillsCatalog:async n=>{if(!ee.skills)return;const r=C2t(n),s=++x2t;bY.set(r,s),e(i=>{const o={...i.skillsCatalogLoadingByProjectPath,[r]:!0};return{skillsCatalogLoadingByProjectPath:o,skillsCatalogErrorByProjectPath:{...i.skillsCatalogErrorByProjectPath,[r]:null},skillsLoading:xY(o),skillsError:null}});try{const i=await ee.skills.list(n);if(bY.get(r)!==s)return;e(o=>({skillsCatalogLoadingByProjectPath:{...o.skillsCatalogLoadingByProjectPath,[r]:!1},skillsCatalogErrorByProjectPath:{...o.skillsCatalogErrorByProjectPath,[r]:null},skillsLoading:xY({...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(bY.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:xY({...a.skillsCatalogLoadingByProjectPath,[r]:!1}),skillsError:o}))}},fetchSkillDetail:async(n,r)=>{if(!ee.skills)return;const s=++S2t;yY.set(n,s),e(i=>({skillsDetailLoadingById:{...i.skillsDetailLoadingById,[n]:!0},skillsDetailErrorById:{...i.skillsDetailErrorById,[n]:null}}));try{const i=await ee.skills.getDetail(n,r);if(yY.get(n)!==s)return;e(o=>({skillsDetailsById:{...o.skillsDetailsById,[n]:i},skillsDetailLoadingById:{...o.skillsDetailLoadingById,[n]:!1},skillsDetailErrorById:{...o.skillsDetailErrorById,[n]:null}}))}catch(i){if(yY.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(!ee.skills)throw new Error("Skills API is not available");e({skillsMutationLoading:!0,skillsMutationError:null});try{const r=await ee.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(!ee.skills)throw new Error("Skills API is not available");e({skillsMutationLoading:!0,skillsMutationError:null});try{const r=await ee.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(!ee.skills)throw new Error("Skills API is not available");e({skillsMutationLoading:!0,skillsMutationError:null});try{const r=await ee.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(!ee.skills)throw new Error("Skills API is not available");e({skillsMutationLoading:!0,skillsMutationError:null});try{const r=await ee.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(!ee.skills)throw new Error("Skills API is not available");e({skillsMutationLoading:!0,skillsMutationError:null});try{await ee.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(!ee.plugins)return;const r=t().pluginCatalogProjectPath??void 0,s=n.scope!=="user"?n.projectPath??t().pluginCatalogProjectPath??void 0:n.projectPath,i=JOe(n.pluginId,n.scope,s),o=s===n.projectPath?n:{...n,projectPath:s},a=t();if(a.cliStatus===null)try{await i0(a)}catch{}const c=D1(t()),l=o.scope!=="user"&&!o.projectPath?oge:JO({isInstalled:!1,...c,section:"plugins"});if(l){Ah(i),e(d=>({pluginInstallProgress:{...d.pluginInstallProgress,[i]:"error"},installErrors:{...d.installErrors,[i]:l}}));return}Ah(i),e(d=>({pluginInstallProgress:{...d.pluginInstallProgress,[i]:"pending"},installErrors:{...d.installErrors,[i]:""}}));try{const d=await ee.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),ige(i,e)}catch(d){Ah(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(!ee.plugins)return;const i=t().pluginCatalogProjectPath??void 0,o=r??"user",a=o!=="user"?s??t().pluginCatalogProjectPath??void 0:s,c=JOe(n,o,a);if(o!=="user"&&!a){Ah(c),e(p=>({pluginInstallProgress:{...p.pluginInstallProgress,[c]:"error"},installErrors:{...p.installErrors,[c]:oge}}));return}const l=t();if(l.cliStatus===null)try{await i0(l)}catch{}const d=JO({isInstalled:!0,...D1(t()),section:"plugins"});if(d){Ah(c),e(p=>({pluginInstallProgress:{...p.pluginInstallProgress,[c]:"error"},installErrors:{...p.installErrors,[c]:d}}));return}Ah(c),e(p=>({pluginInstallProgress:{...p.pluginInstallProgress,[c]:"pending"}}));try{const p=await ee.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),ige(c,e)}catch(p){Ah(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=sP(n.registryId,n.scope,n.projectPath);if(!ee.mcpRegistry){gu(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 i0(s)}catch{}const i=JO({isInstalled:!1,...D1(t()),section:"mcp"});if(i){gu(r),e(o=>({mcpInstallProgress:{...o.mcpInstallProgress,[r]:"error"},installErrors:{...o.installErrors,[r]:i}}));return}gu(r),e(o=>({mcpInstallProgress:{...o.mcpInstallProgress,[r]:"pending"}}));try{const o=await ee.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"}})),SY(r,e)}catch(o){gu(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=E2t(n.serverName,r,n.projectPath);try{if(!ee.mcpRegistry)throw new Error("MCP Registry not available");const i=t();if(i.cliStatus===null)try{await i0(i)}catch{}const o=JO({isInstalled:!1,...D1(t()),section:"mcp"});if(o)throw new Error(o);gu(s),e(c=>({mcpInstallProgress:{...c.mcpInstallProgress,[s]:"pending"}}));const a=await ee.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"}})),SY(s,e)}catch(i){gu(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"||ku(s)?s:"user",a=sP(n,o,i);if(!ee.mcpRegistry){gu(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 i0(c)}catch{}const l=JO({isInstalled:!0,...D1(t()),section:"mcp"});if(l){gu(a),e(d=>({mcpInstallProgress:{...d.mcpInstallProgress,[a]:"error"},installErrors:{...d.installErrors,[a]:l}}));return}gu(a),e(d=>({mcpInstallProgress:{...d.mcpInstallProgress,[a]:"pending"}}));try{const d=await ee.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"}})),SY(a,e)}catch(d){gu(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(ee.apiKeys){e({apiKeysLoading:!0,apiKeysError:null});try{const n=await ee.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(ee.apiKeys)try{const n=await ee.apiKeys.getStorageStatus();e({apiKeyStorageStatus:n})}catch{}},saveApiKey:async n=>{if(ee.apiKeys){e({apiKeySaving:!0,apiKeysError:null});try{const r=await ee.apiKeys.save(n),s=[];try{const o=await ee.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:R2t(a.apiKeys,r)}))}await i0(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(ee.apiKeys)try{await ee.apiKeys.delete(n),e(s=>({apiKeys:s.apiKeys.filter(i=>i.id!==n)})),await i0(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=jh(n.paneLayout,i.id);o&&e({paneLayout:ro(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=>{!ee.mcpRegistry||n.length===0||ee.mcpRegistry.githubStars(n).then(r=>{Object.keys(r).length>0&&e(s=>({mcpGitHubStars:{...s.mcpGitHubStars,...r}}))}).catch(()=>{})}}),age=50;function vZ(e,t){return e.find(n=>n.type==="session"&&n.sessionId===t)}function cXe(e,t,n){return e.find(r=>r.type==="session"&&r.sessionId===t&&r.projectId===n)}function TZ(e){return e.length<=age?e:e.slice(0,age-1)+"…"}function $2t(e,t="notification",n){return{id:crypto.randomUUID(),kind:"error",source:t,highlight:n??"red",payload:e}}function lge(e){return{id:crypto.randomUUID(),kind:"search",source:"commandPalette",highlight:"yellow",payload:e}}function N2t(e){return e.kind==="error"}function A2t(e){return e.kind==="search"}const yI=eo("Store:notification"),I2t=200,M2t=(e,t)=>({notifications:[],unreadCount:0,notificationsLoading:!1,notificationsError:null,fetchNotifications:async()=>{e({notificationsLoading:!0,notificationsError:null});try{const n=await ee.notifications.get({limit:I2t,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 ee.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){yI.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=>ee.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 ee.notifications.markAllRead()){await t().fetchNotifications();return}e(s=>({notifications:s.notifications.map(i=>({...i,isRead:!0})),unreadCount:0}))}}catch(r){yI.error("Failed to mark all notifications as read:",r)}},deleteNotification:async n=>{try{if(!await ee.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){yI.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=>ee.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 ee.notifications.clear()){await t().fetchNotifications();return}e({notifications:[],unreadCount:0})}}catch(r){yI.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=$2t({errorId:n.id,errorTimestamp:n.timestamp,toolUseId:n.toolUseId,subagentId:n.subagentId,lineNumber:n.lineNumber},"notification",n.triggerColor),i=xu(r.paneLayout),o=cXe(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"})}}),LL=4;function Ex(e){const t=aXe(e);return{paneLayout:e,openTabs:t.openTabs,activeTabId:t.activeTabId,selectedTabIds:t.selectedTabIds}}const Q2t=(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=Fl(s,n);if(!i)return;const o={...s,focusedPaneId:n};e(Ex(o)),i.activeTabId&&t().setActiveTab(i.activeTabId)},splitPane:(n,r,s)=>{const i=t(),{paneLayout:o}=i;if(o.panes.length>=LL)return;const a=Fl(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={...nge(f),tabs:[c],activeTabId:c.id};let m=ro(o,p);l.length===0&&o.panes.length>1&&(m=ek(m,n)),m=tge(m,p.id!==n?o.panes[0].id:n,h,s),m={...m,focusedPaneId:f},e(Ex(m)),c.type==="session"&&t().setActiveTab(c.id)},closePane:n=>{const r=t(),{paneLayout:s}=r;if(s.panes.length<=1)return;const i=Fl(s,n);if(!i)return;for(const c of i.tabs)r.cleanupTabUIState(c.id),r.cleanupTabSessionData(c.id);const o=ek(s,n);e(Ex(o));const a=Fl(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=Fl(a,r),l=Fl(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=ro(a,{...c,tabs:p,activeTabId:f,selectedTabIds:c.selectedTabIds.filter(O=>O!==n)});m=ro(m,{...l,tabs:h,activeTabId:d.id}),p.length===0&&m.panes.length>1&&(m=ek(m,r)),m={...m,focusedPaneId:s},e(Ex(m))},moveTabToNewPane:(n,r,s,i)=>{const o=t(),{paneLayout:a}=o;if(a.panes.length>=LL)return;const c=Fl(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={...nge(f),tabs:[l],activeTabId:l.id};let m=ro(a,{...c,tabs:d,activeTabId:p,selectedTabIds:c.selectedTabIds.filter(O=>O!==n)});d.length===0&&m.panes.length>1&&(m=ek(m,r)),m=tge(m,s,h,i),m={...m,focusedPaneId:f},e(Ex(m))},reorderTabInPane:(n,r,s)=>{const{paneLayout:i}=t(),o=Fl(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=ro(i,{...o,tabs:a});e(Ex(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=>jh(t().paneLayout,n)?.id??null,getAllPaneTabs:()=>xu(t().paneLayout)}),D2t=(e,t)=>({projects:[],selectedProjectId:null,projectsLoading:!1,projectsError:null,fetchProjects:async()=>{if(!t().projectsLoading){e({projectsLoading:!0,projectsError:null});try{const r=[...await ee.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,...Kh()}),t().fetchSessionsInitial(n)}}),vY=eo("Store:repository"),L2t=3e4;async function j2t(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 X2t=(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 j2t(ee.getRepositoryGroups(),L2t,"get-repository-groups");e({repositoryGroups:r,repositoryGroupsLoading:!1});const s=Date.now()-n;s>=2e3&&vY.warn(`fetchRepositoryGroups slow ms=${s} count=${r.length}`)}catch(r){const s=Date.now()-n;vY.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){vY.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,...Kh()}),t().fetchSessionsInitial(o.id)):e({selectedRepositoryId:n,selectedWorktreeId:null,...Kh()})},selectWorktree:n=>{e({selectedWorktreeId:n,selectedProjectId:n,activeProjectId:n,...Kh()}),t().fetchSessionsInitial(n)},setViewMode:n=>{e({viewMode:n,selectedRepositoryId:null,selectedWorktreeId:null,selectedProjectId:null,...Kh()}),n==="grouped"?t().fetchRepositoryGroups():t().fetchProjects()}}),xI=eo("scheduleSlice"),U2t=(e,t)=>({schedules:[],schedulesLoading:!1,schedulesError:null,scheduleRuns:{},scheduleRunsLoading:{},async fetchSchedules(){if(!t().schedulesLoading){e({schedulesLoading:!0,schedulesError:null});try{const n=await ee.schedules.list();e({schedules:n,schedulesLoading:!1})}catch(n){const r=n instanceof Error?n.message:"Failed to fetch schedules";xI.error("fetchSchedules failed:",r),e({schedulesError:r,schedulesLoading:!1})}}},async createSchedule(n){const r=await ee.schedules.create(n);return e(s=>({schedules:[...s.schedules,r]})),r},async updateSchedule(n,r){const s=await ee.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 ee.schedules.delete(n)}catch(i){const o=i instanceof Error?i.message:"删除计划失败";throw xI.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 ee.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 ee.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 ee.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 ee.schedules.getRuns(n);e(s=>({scheduleRuns:{...s.scheduleRuns,[n]:r},scheduleRunsLoading:{...s.scheduleRunsLoading,[n]:!1}}))}catch(r){xI.error(`fetchRunHistory(${n}) failed:`,r),e(s=>({scheduleRunsLoading:{...s.scheduleRunsLoading,[n]:!1}}))}}},async applyScheduleChange(n){try{const r=await ee.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 ee.schedules.getRuns(n);e(i=>({scheduleRuns:{...i.scheduleRuns,[n]:s}}))}}catch(r){xI.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 z2t(e){return"chunkType"in e&&e.chunkType==="ai"}function B2t(e){return z2t(e)&&"semanticSteps"in e}function F2t(e){return e.type==="assistant"}function Y2t(e){return"chunkType"in e&&e.chunkType==="user"&&"rawMessages"in e}function V2t(e){return"chunkType"in e&&e.chunkType==="system"&&"rawMessages"in e}function q2t(e){return"chunkType"in e&&e.chunkType==="compact"&&"rawMessages"in e}function W2t(e){return"chunkType"in e&&"rawMessages"in e}function yT(e){return e.length===0?[]:W2t(e[0])?e:null}const hz=/[\\/]/;function Cc(e){const t=e.split(hz);return t[t.length-1]||""}function G2t(e){return e.split(hz).filter(Boolean)[0]??""}function H2t(e){return e.split(hz).filter(Boolean)}function Z2t(e){return hz.test(e)}function K2t(e){return/^\.\.?[\\/]/.test(e)}const J2t=eo("Util:groupTransformer"),cge=/\/([a-z][a-z-]{0,50})(?:\s+(\S[^\n]{0,1000}))?$/gim,uge=100;function aP(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(Y2t(l))r.push({type:"user",group:eDt(l,s++)});else if(V2t(l))r.push({type:"system",group:lDt(l)}),i++;else if(B2t(l))r.push({type:"ai",group:uDt(l,o)}),o++;else if(q2t(l))r.push({type:"compact",group:cDt(l)}),a++;else{const d="chunkType"in l?l.chunkType:"unknown";J2t.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=hDt(r,l),f=mDt(r,l);if(p&&f){const h=ODt(p),m=gDt(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 eDt(e,t){return tDt(e.userMessage,t)}function tDt(e,t){const n=nDt(e);return{id:`user-${e.uuid}`,message:e,timestamp:e.timestamp,content:n,index:t}}function nDt(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=Lvt(t),i=UU(t),o=i?[]:rDt(s);r.push(...Qse(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 rDt(e){if(!e)return[];const t=[];let n;for(cge.lastIndex=0;(n=cge.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 sDt=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"]),iDt=/[\s,)}\]]/;function oDt(e){if(/^[A-Za-z]:[\\/]/.test(e)||e.startsWith("\\\\")||K2t(e))return!0;const t=G2t(e);return!!(sDt.has(t)||Z2t(e)&&e.length>2&&(H2t(e).length>2||/\.[a-zA-Z0-9]+$/.test(e)))}function aDt(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&&!iDt.test(e[i]);)i+=1;s=e.slice(n,i)}return!s||!oDt(s)?null:{path:s,raw:e.slice(t,i),startIndex:t,endIndex:i}}function Mse(e){if(!e)return[];const t=[];let n=0;for(;n<e.length;){const r=e.indexOf("@",n);if(r<0)break;const s=aDt(e,r);s?(t.push(s),n=s.endIndex):n=r+1}return t}function Qse(e){return Mse(e).map(({path:t,raw:n})=>({path:t,raw:n}))}function lDt(e){return{id:e.id,message:e.message,timestamp:e.startTime,commandOutput:e.commandOutput}}function cDt(e){return{id:e.id,timestamp:e.startTime,message:e.message}}function uDt(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=>F2t(d))??null,a=dDt(n,o),c=pDt(n),l=fDt(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 dDt(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 pDt(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>uge?d.slice(0,uge)+"...":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 fDt(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 hDt(e,t){for(let n=t-1;n>=0;n--)if(e[n].type==="ai")return e[n].group;return null}function mDt(e,t){for(let n=t+1;n<e.length;n++)if(e[n].type==="ai")return e[n].group;return null}function ODt(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 gDt(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 uXe=500,_Dt="CLAUDE.md",dge="project-memory";function Yp(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 Vp(e,t){return e}function Dse(e){return e.startsWith("/")||e.startsWith("\\\\")||/^[a-zA-Z]:[\\/]/.test(e)}function MS(e,t){if(Dse(t))return t;const n=bDt(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=yDt(r,s),c=xDt(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 bDt(e){let t=e.length;for(;t>0;){const n=e[t-1];if(n!=="/"&&n!=="\\")break;t--}return e.slice(0,t)}function yDt(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 xDt(e){return al(e)}function LO(e){return e.replace(/\\/g,"/")}function SDt(e){const t=F0(e);return t===-1?"":e.slice(0,t)}function vDt(e){const t=F0(e);return t<=0?null:e.slice(0,t)}function TDt(e,t){const n=LO(e).replace(/\/$/,""),r=LO(t).replace(/\/$/,"");return r===n||r.startsWith(n+"/")}function dXe(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 pXe(e,t){if(!e)return[];const n=e.content.fileReferences||[],r=[];for(const s of n)if(s.path){const i=Dse(s.path)?s.path:MS(t,s.path);r.push(i)}return r}function fXe(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(...Qse(r))}return t}function hXe(e,t){const n=[],r=e.includes("\\")?"\\":"/";let s=SDt(e);for(;s&&TDt(t,s);){const i=`${s}${r}${_Dt}`;n.push(i);const o=vDt(s);if(!o||o===s)break;s=o}return n}function mXe(e,t,n){const r=[],s=v=>n?.[v]?.estimatedTokens??uXe,i=n?.enterprise?.path??"/Library/Application Support/ClaudeCode/CLAUDE.md",o=s("enterprise");o>0&&r.push({id:Yp(i),path:i,source:"enterprise",displayName:Vp(i),isGlobal:!0,estimatedTokens:o,firstSeenInGroup:t});const a="~/.claude/CLAUDE.md",c=s("user");c>0&&r.push({id:Yp(a),path:a,source:"user-memory",displayName:Vp(a),isGlobal:!0,estimatedTokens:c,firstSeenInGroup:t});const l=MS(e,"CLAUDE.md"),d=MS(e,".claude/CLAUDE.md"),p=s("project");p>0&&r.push({id:Yp(l),path:l,source:dge,displayName:Vp(l),isGlobal:!0,estimatedTokens:p,firstSeenInGroup:t});const f=s("project-alt");f>0&&r.push({id:Yp(d),path:d,source:dge,displayName:Vp(d),isGlobal:!0,estimatedTokens:f,firstSeenInGroup:t});const h=MS(e,".claude/rules/*.md"),m=s("project-rules");m>0&&r.push({id:Yp(h),path:h,source:"project-rules",displayName:Vp(h),isGlobal:!0,estimatedTokens:m,firstSeenInGroup:t});const O=MS(e,"CLAUDE.local.md"),_=s("project-local");_>0&&r.push({id:Yp(O),path:O,source:"project-local",displayName:Vp(O),isGlobal:!0,estimatedTokens:_,firstSeenInGroup:t});const b="~/.claude/rules/**/*.md",y=s("user-rules");y>0&&r.push({id:Yp(b),path:b,source:"user-rules",displayName:Vp(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:Yp(x),path:x,source:"auto-memory",displayName:Vp(x),isGlobal:!0,estimatedTokens:S,firstSeenInGroup:t}),r}function EDt(e,t){return{id:Yp(e),path:e,source:"directory",displayName:Vp(e),isGlobal:!1,estimatedTokens:uXe,firstSeenInGroup:t}}function wDt(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=mXe(i,d,a);for(const x of y)l.has(x.path)||(c.push(x),l.add(x.path))}const p=[],f=dXe(t.steps);p.push(...f);const h=pXe(n,i);p.push(...h);const m=fXe(t.responses);for(const y of m)if(y.path){const x=Dse(y.path)?y.path:MS(i,y.path);p.push(x)}for(const y of p){const x=hXe(y,i);for(const S of x){if(l.has(S)||LO(S)===`${LO(i)}/CLAUDE.md`||LO(S)===`${LO(i)}/.claude/CLAUDE.md`||LO(S)===`${LO(i)}/CLAUDE.local.md`)continue;const T=EDt(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 kDt(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=wDt({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 pge=25e3,ZQ="mentioned-file",OXe=new Set(["SendMessage","TeamCreate","TeamDelete","TaskCreate","TaskUpdate","TaskList","TaskGet"]);function CDt(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 RDt(e){return`tool-output-ai-${e}`}function PDt(e){return`thinking-text-ai-${e}`}function $Dt(e){return`task-coord-ai-${e}`}function NDt(e){return`user-msg-ai-${e}`}function TY(e){return{...e,category:"claude-md"}}function fge(e){return{id:CDt(e.path),category:ZQ,path:e.path,displayName:e.displayName,estimatedTokens:e.estimatedTokens,firstSeenTurnIndex:e.turnIndex,firstSeenInGroup:e.aiGroupId,exists:e.exists??!0}}function ADt(e,t,n,r){const s=[];let i=0;for(const o of e.values()){if(OXe.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:RDt(t),category:"tool-output",turnIndex:t,aiGroupId:n,estimatedTokens:i,toolCount:s.length,toolBreakdown:s}}function IDt(e,t,n,r){const s=[];let i=0;for(const o of e.values()){if(!OXe.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:$Dt(t),category:"task-coordination",turnIndex:t,aiGroupId:n,estimatedTokens:i,breakdown:s}}function MDt(e,t,n){const r=e.content.rawText??e.content.text??"";if(!r)return null;const s=Qo(r);if(s===0)return null;const i=r.length>80?r.slice(0,80)+"…":r;return{id:NDt(t),category:"user-message",turnIndex:t,aiGroupId:n,estimatedTokens:s,textPreview:i}}function QDt(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:PDt(t),category:"thinking-text",turnIndex:t,aiGroupId:n,estimatedTokens:s,breakdown:r}}function KQ(e){return e.startsWith("/")||e.startsWith("~/")||e.startsWith("~\\")||e==="~"||e.startsWith("\\\\")||/^[a-zA-Z]:[\\/]/.test(e)}function EY(e,t){if(KQ(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=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 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}function wx(e){return e.replace(/\\/g,"/")}function hge(e,t){return{id:Yp(e),path:e,source:"directory",displayName:Vp(e),isGlobal:!1,estimatedTokens:500,firstSeenInGroup:t}}function XDt(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=mXe(a,h,c);for(const P of w)f.has(P.path)||(p.push(TY(P)),f.add(P.path))}const m=[],O=dXe(t.steps);m.push(...O);const _=pXe(n,a);m.push(..._);const b=fXe(t.responses);for(const w of b)if(w.path){const P=KQ(w.path)?w.path:EY(a,w.path);m.push(P)}for(const w of m){const P=hXe(w,a);for(const k of P)if(!(f.has(k)||wx(k)===`${wx(a)}/CLAUDE.md`||wx(k)===`${wx(a)}/.claude/CLAUDE.md`||wx(k)===`${wx(a)}/CLAUDE.local.md`))if(d){const I=d[k];if(!I||!I.exists||I.estimatedTokens<=0)continue;const N=hge(k,h);N.estimatedTokens=I.estimatedTokens,p.push(TY(N)),f.add(k)}else{const I=hge(k,h);p.push(TY(I)),f.add(k)}}if(n?.content.fileReferences)for(const w of n.content.fileReferences){if(!w.path)continue;const P=KQ(w.path)?w.path:EY(a,w.path);if(f.has(P))continue;const k=l?.get(P);if(k&&k.exists&&k.estimatedTokens<=pge){const C=fge({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=KQ(w.path)?w.path:EY(a,w.path);if(f.has(P))continue;const k=l?.get(P);if(k&&k.exists&&k.estimatedTokens<=pge){const C=fge({path:P,displayName:w.path,estimatedTokens:k.estimatedTokens,turnIndex:t.turnIndex,aiGroupId:h,exists:k.exists});p.push(C),f.add(P)}}const y=ADt(r,t.turnIndex,h,s);y&&p.push(y);const x=IDt(r,t.turnIndex,h,s);if(x&&p.push(x),n){const w=MDt(n,t.turnIndex,h);w&&p.push(w)}if(s){const w=QDt(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 UDt(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 zDt(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 BDt(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=Cre(x.steps,x.responses));let v=x.displayItems;if(!v&&x.steps&&x.steps.length>0){const E=Rre(x.steps,x.isOngoing??!1);v=w2e(x.steps,E,x.processes||[],x.responses)}const T=XDt({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=UDt(_),w=zDt(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 EZ(e,t){if(FDt(t))return t;const n=YDt(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=VDt(r,s),c=qDt(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 FDt(e){return e.startsWith("/")||e.startsWith("\\\\")||/^[a-zA-Z]:[\\/]/.test(e)}function YDt(e){let t=e.length;for(;t>0;){const n=e[t-1];if(n!=="/"&&n!=="\\")break;t--}return e.slice(0,t)}function VDt(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 qDt(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 kx=eo("Store:sessionDetail"),wY=new Map,kY=new Set,CY=new Set,jL=new Map;function WDt(e){const t=e??"__global__",n=(jL.get(t)??0)+1;return jL.set(t,n),n}function Cx(e,t){return jL.get(t??"__global__")===e}let RY="";function mge(){return{sessionDetail:null,conversation:null,conversationLoading:!1,sessionDetailLoading:!1,sessionDetailError:null,sessionClaudeMdStats:null,sessionContextStats:null,sessionPhaseInfo:null,visibleAIGroupId:null,selectedAIGroup:null}}const GDt=(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=WDt(s);if(i?.silent||e({sessionDetailLoading:!0,sessionDetailError:null,conversationLoading:!0}),s&&!i?.silent){const a=t().tabSessionData;e({tabSessionData:{...a,[s]:{...a[s]??mge(),sessionDetailLoading:!0,sessionDetailError:null,conversationLoading:!0}}})}try{const a=await ee.getSessionDetail(n,r);if(!Cx(o,s))return;const c=a?.session?.isOngoing??!1,l=a?yT(a.chunks):null,d=a&&l?aP(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!==RY&&(RY=m,ee.readAgentConfigs(m).then(w=>{e({agentConfigs:w})}).catch(w=>{kx.error("Failed to read agent configs:",w),RY=""})),O!=="ssh"&&d?.items){let w={};try{if(w=await ee.readClaudeMdFiles(m),!Cx(o,s))return}catch(R){kx.error("Failed to read CLAUDE.md files:",R)}_=kDt(d.items,m,w);const P={};if(_&&_.size>0){const R=new Set;for(const $ of _.values())for(const A of $.accumulatedInjections)A.source==="directory"&&R.add(A.path);if(R.size>0){const $=new Map,A=new Set,j=await Promise.all(Array.from(R).map(async Q=>{try{const U=Q.replace(/[\\/]CLAUDE\.md$/,""),M=await ee.readDirectoryClaudeMd(U);return{fullPath:Q,fileInfo:M,error:!1}}catch(U){return kx.error("Failed to read directory CLAUDE.md:",Q,U),{fullPath:Q,fileInfo:null,error:!0}}}));if(!Cx(o,s))return;for(const{fullPath:Q,fileInfo:U,error:M}of j)M||!U?A.add(Q):U.exists&&U.estimatedTokens>0?($.set(Q,U.estimatedTokens),P[Q]=U):A.add(Q);for(const[,Q]of _.entries()){Q.accumulatedInjections=Q.accumulatedInjections.filter(U=>U.source!=="directory"||!A.has(U.path)),Q.newInjections=Q.newInjections.filter(U=>U.source!=="directory"||!A.has(U.path));for(const U of Q.accumulatedInjections)U.source==="directory"&&$.has(U.path)&&(U.estimatedTokens=$.get(U.path));for(const U of Q.newInjections)U.source==="directory"&&$.has(U.path)&&(U.estimatedTokens=$.get(U.path));Q.totalEstimatedTokens=Q.accumulatedInjections.reduce((U,M)=>U+M.estimatedTokens,0),Q.accumulatedCount=Q.accumulatedInjections.length,Q.newCount=Q.newInjections.length}}}const k=new Set;for(const R of d.items)if(R.type==="user"&&R.group.content.fileReferences)for(const $ of R.group.content.fileReferences){const A=EZ(m,$.path);k.add(A)}for(const R of d.items)if(R.type==="ai")for(const $ of R.group.responses){if($.type!=="user")continue;let A="";if(typeof $.content=="string")A=$.content;else if(Array.isArray($.content))for(const j of $.content)j.type==="text"&&j.text&&(A+=j.text);if(A)for(const j of Qse(A)){const Q=EZ(m,j.path);k.add(Q)}}const C=new Map,I=await Promise.all(Array.from(k).map(async R=>{try{const $=await ee.readMentionedFile(R,m);return{filePath:R,fileInfo:$}}catch($){return kx.error("Failed to read mentioned file:",R,$),{filePath:R,fileInfo:null}}}));if(!Cx(o,s))return;for(const{filePath:R,fileInfo:$}of I)$&&C.set(R,$);const N=BDt(d.items,m,w,C,P);b=N.statsMap,y=N.phaseInfo}const x=t();if(!Cx(o,s))return;const S=xu(x.paneLayout),v=vZ(S,r);if(v&&a){const w=a.session.firstMessage?TZ(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(kx.error("fetchSessionDetail error:",a),!Cx(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]??mge(),sessionDetailError:c,sessionDetailLoading:!1,conversationLoading:!1}}})}}},refreshSessionInPlace:async(n,r)=>{const s=t(),o=xu(s.paneLayout).filter(l=>l.type==="session"&&l.sessionId===r);if(s.selectedSessionId!==r&&o.length===0)return;const a=`${n}/${r}`;if(kY.has(a)){CY.add(a);return}const c=(wY.get(a)??0)+1;wY.set(a,c),kY.add(a);try{const l=await ee.getSessionDetail(n,r);if(wY.get(a)!==c||!l)return;const d=l.session?.isOngoing??!1,p=yT(l.chunks);if(!p)return;const f=aP(p,l.processes,d);if(!f)return;const h=t(),m=xu(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(I=>I.type==="ai"&&I.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){kx.error("refreshSessionInPlace error:",l)}finally{kY.delete(a),CY.has(a)&&(CY.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=>{jL.delete(n);const r=t().tabSessionData;if(!(n in r))return;const s={...r};delete s[n],e({tabSessionData:s})}}),md=eo("Store:session"),HDt=150;function ZDt(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 PY=new Map,KDt=(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 ee.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 ee.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 ee.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 md.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=(PY.get(n)??0)+1;PY.set(n,s);const i=async()=>{const{connectionMode:a}=t();return ee.getSessionsPaginated(n,null,20,{includeTotalCount:!1,prefilterAll:!1,metadataLevel:a==="ssh"?"light":"deep"})},o=a=>{PY.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(ZDt(a)&&t().selectedProjectId===n){md.warn("refreshSessionsInPlace transient IPC error - retrying once");try{if(await new Promise(l=>setTimeout(l,HDt)),t().selectedProjectId!==n)return;const c=await i();o(c);return}catch(c){md.error("refreshSessionsInPlace retry error:",c);return}}md.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 ee.config.unpinSession(s,n):await ee.config.pinSession(s,n)}catch(a){e({pinnedSessionIds:o}),md.error("togglePinSession error:",a)}},loadPinnedSessions:async()=>{const r=t().selectedProjectId;if(!r){e({pinnedSessionIds:[]});return}try{const{connectionMode:s}=t(),a=((await ee.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 ee.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){md.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 ee.config.unhideSession(s,n):await ee.config.hideSession(s,n)}catch(a){e({hiddenSessionIds:o}),md.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 ee.config.hideSessions(s,n)}catch(c){e({hiddenSessionIds:i}),md.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 ee.config.unhideSessions(s,n)}catch(a){e({hiddenSessionIds:i}),md.error("unhideMultipleSessions error:",a)}},loadHiddenSessions:async()=>{const r=t().selectedProjectId;if(!r){e({hiddenSessionIds:[]});return}try{const o=((await ee.config.get()).sessions?.hiddenSessions?.[r]??[]).map(a=>a.sessionId);e({hiddenSessionIds:o})}catch(s){md.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=>ee.config.pinSession(s,c)))}catch(c){e({pinnedSessionIds:i}),md.error("pinMultipleSessions error:",c)}}}),JDt=(e,t)=>({drillDownStack:[],currentSubagentDetail:null,subagentDetailLoading:!1,subagentDetailError:null,drillDownSubagent:async(n,r,s,i)=>{e({subagentDetailLoading:!0,subagentDetailError:null});try{const o=await ee.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}),ee.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 Eo(e){const t=aXe(e);return{paneLayout:e,openTabs:t.openTabs,activeTabId:t.activeTabId,selectedTabIds:t.selectedTabIds}}function L1(e,t,n){const r=jh(e,t);return r?ro(e,{...r,tabs:r.tabs.map(s=>s.id===t?n(s):s)}):e}const eLt=(e,t)=>({openTabs:[],activeTabId:null,selectedTabIds:[],activeProjectId:null,openTab:(n,r)=>{const s=t(),{paneLayout:i}=s,o=Fl(i,i.focusedPaneId);if(!o)return;if(n.type==="session"&&n.sessionId&&!r?.forceNewTab){const d=xu(i),p=vZ(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:TZ(n.label),createdAt:Date.now()},m={...o,tabs:o.tabs.map(_=>_.id===f.id?h:_),activeTabId:h.id},O=ro(i,m);e(Eo(O));return}}const a={...n,id:crypto.randomUUID(),label:TZ(n.label),createdAt:Date.now()},c={...o,tabs:[...o.tabs,a],activeTabId:a.id},l=ro(i,c);e(Eo(l))},closeTab:n=>{const r=t(),{paneLayout:s}=r,i=jh(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=ro(s,f);e({...Eo(h),...oT()});return}const d={...i,tabs:a,activeTabId:c,selectedTabIds:i.selectedTabIds.filter(f=>f!==n)},p=ro(s,d);e(Eo(p)),c&&t().setActiveTab(c)},setActiveTab:n=>{const r=t(),{paneLayout:s}=r,i=r.getActiveTab(),a=jh(s,n)?.tabs.find(f=>f.id===n);i?.id!==n&&jxt(i?.label??"none",a?.label??n);const c=jh(s,n);if(!c)return;const l=c.tabs.find(f=>f.id===n);if(!l)return;const d={...c,activeTabId:n};let p=ro(s,d);if(p={...p,focusedPaneId:c.id},e(Eo(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=pr(h),O=r.projects.find(_=>pr(_.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=>pr(y.path)===m);if(b&&r.selectedWorktreeId!==b.id){e(LU(_.id,b.id)),t().fetchSessionsInitial(b.id);break}}}}},openDashboard:()=>{const n=t(),{paneLayout:r}=n,s=xu(r).find(l=>l.type==="dashboard");if(s){const l=jh(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=ro(r,m);e(Eo(O));return}}n.setActiveTab(s.id);return}const i=Fl(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=ro(r,a);e(Eo(c))},openSessionReport:n=>{const r=t(),i=xu(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=Fl(n.paneLayout,n.paneLayout.focusedPaneId);return r?.activeTabId?r.tabs.find(s=>s.id===r.activeTabId)??null:null},isSessionOpen:n=>xu(t().paneLayout).some(s=>s.type==="session"&&s.sessionId===n),enqueueTabNavigation:(n,r)=>{const{paneLayout:s}=t(),i=L1(s,n,o=>({...o,pendingNavigation:r}));e(Eo(i))},consumeTabNavigation:(n,r)=>{const{paneLayout:s}=t(),i=L1(s,n,o=>o.pendingNavigation?.id===r?{...o,pendingNavigation:void 0,lastConsumedNavigationId:r}:o);e(Eo(i))},saveTabScrollPosition:(n,r)=>{const{paneLayout:s}=t(),i=L1(s,n,o=>({...o,savedScrollTop:r}));e(Eo(i))},updateTabLabel:(n,r)=>{const{paneLayout:s}=t(),i=L1(s,n,o=>({...o,label:r}));e(Eo(i))},setTabContextPanelVisible:(n,r)=>{const{paneLayout:s}=t(),i=L1(s,n,o=>({...o,showContextPanel:r}));e(Eo(i))},setSelectedTabIds:n=>{const{paneLayout:r}=t(),s=Fl(r,r.focusedPaneId);if(!s)return;const i={...s,selectedTabIds:n},o=ro(r,i);e(Eo(o))},clearTabSelection:()=>{const{paneLayout:n}=t(),r=Fl(n,n.focusedPaneId);if(!r)return;const s={...r,selectedTabIds:[]},i=ro(n,s);e(Eo(i))},closeOtherTabs:n=>{const r=t(),{paneLayout:s}=r,i=jh(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=ro(s,c);e(Eo(l)),t().setActiveTab(n)},closeTabsToRight:n=>{const r=t(),{paneLayout:s}=r,i=jh(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=ro(s,p);e(Eo(f)),d&&t().setActiveTab(d)},closeAllTabs:()=>{const n=t(),r=xu(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({...Eo({panes:[{id:s,tabs:[],activeTabId:null,selectedTabIds:[],widthFraction:1}],focusedPaneId:s}),...oT()})},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=ro(i,{...l,tabs:d,activeTabId:p,selectedTabIds:l.selectedTabIds.filter(f=>!s.has(f))})}if(xu(i).length===0){r.closeAllTabs();return}for(const l of o)i=ek(i,l);e(Eo(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,...Kh()})},navigateToSession:(n,r,s=!1,i)=>{const o=t(),a=xu(o.paneLayout),c=cXe(a,r,n)??vZ(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=lge({...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=lge({...f});o.enqueueTabNavigation(p,h)}}const l=t().activeTabId??void 0;o.fetchSessionDetail(n,r,l)}}});function Pp(){return{expandedAIGroupIds:new Set,expandedDisplayItemIds:new Map,expandedSubagentTraceIds:new Set,showContextPanel:!1,selectedContextPhase:null,savedScrollTop:void 0}}const tLt=(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,Pp()),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)??Pp(),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)??Pp(),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)??Pp(),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)??Pp(),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)??Pp(),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)??Pp();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)??Pp();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)??Pp();i.set(n,{...o,selectedContextPhase:r}),e({tabUIStates:i})},saveScrollPositionForTab:(n,r)=>{const s=t(),i=new Map(s.tabUIStates),o=i.get(n)??Pp();i.set(n,{...o,savedScrollTop:r}),e({tabUIStates:i})},getScrollPositionForTab:n=>t().tabUIStates.get(n)?.savedScrollTop}),nLt=80;function Ls(e){if(typeof e.messageId=="string"&&e.messageId.trim().length>0)return e.messageId;const t=(e.text??"").slice(0,nLt);return`${e.timestamp}-${e.from}-${t}`}function rLt(e,t){const n=Date.parse(t.timestamp)-Date.parse(e.timestamp);return n!==0?n:Ls(e).localeCompare(Ls(t))}function wZ(...e){const t=new Map;for(const n of e)for(const r of n)t.set(Ls(r),r);return Array.from(t.values()).sort(rLt)}const sLt="OpenCode runtime delivery is still being checked. Message was saved and will be retried if needed.",iLt="OpenCode runtime delivery failed. Message was saved to inbox, but live delivery did not complete.";function oLt(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?iLt:sLt,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 aLt(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 lLt=/^(?<source>[a-z0-9-]+)\/(?<model>\S.*)$/i,cLt={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 uLt(e){const t=e.trim().toLowerCase();if(!t)return e;const n=cLt[t];return n||t.split("-").filter(Boolean).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")}function XL(e){const t=e?.trim();if(!t)return null;const n=lLt.exec(t);return!n?.groups?.source||!n.groups.model?null:{raw:t,sourceId:n.groups.source.toLowerCase(),modelId:n.groups.model}}function dLt(e){const t=XL(e);return t?uLt(t.sourceId):null}function tk(e){return e==="anthropic"||e==="codex"||e==="gemini"||e==="opencode"}function Ta(e){return tk(e)?e:void 0}function Ig(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(XL(t)||XL(n))return"opencode"}function Oge(e){const t=e?.trim();if(t)return t.replace(/(?:\[1m\])+$/,"")||void 0}function Lse(e,t){const n=e?.trim();return n?(t??Ig(n)??Ig(Oge(n)))!=="anthropic"?n:Oge(n):void 0}const gge=eo("Renderer:unwrapIpc");class Xh extends Error{constructor(t,n,r){super(n),this.operation=t,this.causeError=r,this.name="IpcError"}}const pLt=["TEAM_PROVISIONING","TEAM_DRAFT"];async function sr(e,t){try{return await t()}catch(n){const r=n instanceof Error?n.message:String(n);throw pLt.some(s=>r.includes(s))?gge.debug(`[${e}] ${r}`):gge.error(`[${e}] ${r}`),new Xh(e,r,n)}}const G0={autoAllowAll:!1,autoAllowFileEdits:!1,autoAllowSafeBash:!1,timeoutAction:"wait",timeoutSeconds:30},fLt=/^[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 hLt(e){return fLt.test(e.trim())}function so(e){const t=e.trim();return t&&(hLt(t)?t.slice(0,8).toLowerCase():t)}function l_(e){return e.displayId?.trim()||so(e.id)}function Gr(e){return`#${l_(e)}`}function nk(e,t){if(!t)return!1;const n=t.trim();return n?e.id===n||l_(e)===n:!1}const W$="team-lead",gXe="lead",mLt="负责人",OLt=new Set([W$,gXe]),gLt=new Set([W$,gXe,"orchestrator"]),_Lt=new Set(["lead"]);function jse(e){return e?.trim().toLowerCase()??""}function c_(e){return OLt.has(jse(e))}function bLt(e){return gLt.has(jse(e))}function yLt(e){return _Lt.has(jse(e))}function Gn(e){const t=typeof e.role=="string"?e.role:null;if(yLt(t))return!0;const n=typeof e.agentType=="string"?e.agentType:null;if(bLt(n))return!0;const r=typeof e.name=="string"?e.name:null;return c_(r)}function JQ(e){const t=e.agentId?.trim();return t||e.name.trim()}const xLt=[[],[{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 _Xe(e,t=[]){const n=e.filter(a=>!a.removedAt&&!Gn(a));if(n.length===0)return[];const r=new Map(n.map(a=>[JQ(a),a])),s=[],i=new Set;for(const a of t){if(a.removedAt||Gn(a))continue;const c=JQ(a);!r.has(c)||i.has(c)||(s.push(c),i.add(c))}const o=n.map(a=>JQ(a)).filter(a=>!i.has(a)).toSorted((a,c)=>a.localeCompare(c));return s.push(...o),s}function e2(e,t=[]){const n=_Xe(e,t),r=n.length>0?n.join("|"):null,s=xLt[n.length],i={};return s?.length===n.length&&n.forEach((o,a)=>{i[o]=s[a]}),{orderedVisibleOwnerIds:n,signature:r,assignments:i}}const du="stable-slots-v1",Lp=eo("teamSlice"),bXe=3e4,_ge=3e4,SLt=5e3,vLt=4e3,TLt=2e3,H0=new Map,xT=new Map,UL=new Set,sS=new Map,iS=new Map,x0=new Map,kZ=new Set,rk=new Map,CZ=new Set,lC=new Map,Z0=new Map,zL=new Map,yXe=new Map;let j1=null,$Y=!1;const t2=new Map,RZ=new Map,PZ=new Map;function NY(e){return H0.has(e)||(xT.get(e)?.size??0)>0||UL.has(e)}function bge(e){return zL.get(e)}function ELt(e){return(Z0.get(e)?.size??0)>0}function wLt(){return new Set(Array.from(Z0.entries()).filter(([,e])=>e.size>0).map(([e])=>e))}function kLt(e){IZ.delete(e),MZ.delete(e);const t=`${e}:`;for(const n of YL.keys())n.startsWith(t)&&YL.delete(n);for(const n of VL.keys())n.startsWith(t)&&VL.delete(n)}function X1(e){H0.delete(e),xT.delete(e),UL.delete(e),sS.delete(e),iS.delete(e),x0.delete(e),kZ.delete(e),rk.delete(e),CZ.delete(e),zL.delete(e),t2.delete(e),RZ.delete(e),PZ.delete(e),kLt(e)}function yge(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 ma(e,t){if(!(t in e))return null;const n={...e};return delete n[t],n}function AY(e,t){const n=Object.fromEntries(Object.entries(e.provisioningRuns).filter(([,x])=>x.teamName!==t)),r=ma(e.teamDataCacheByName,t),s=ma(e.teamAgentRuntimeByTeam,t),i=ma(e.teamMessagesByName,t),o=ma(e.memberActivityMetaByTeam,t),a=ma(e.provisioningSnapshotByTeam,t),c=ma(e.currentProvisioningRunIdByTeam,t),l=ma(e.currentRuntimeRunIdByTeam,t),d=ma(e.provisioningStartedAtFloorByTeam,t),p=ma(e.leadActivityByTeam,t),f=ma(e.leadContextByTeam,t),h=ma(e.activeToolsByTeam,t),m=ma(e.finishedVisibleByTeam,t),O=ma(e.toolHistoryByTeam,t),_=ma(e.memberSpawnStatusesByTeam,t),b=ma(e.memberSpawnSnapshotsByTeam,t),y=ma(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 xge(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 Ih(e){return yXe.get(e)??0}function xc(e,t){return Ih(e)===t}function U1(e){yXe.set(e,Ih(e)+1)}function CLt(e){const t=Symbol(e),n=xT.get(e);return n?(n.add(t),t):(xT.set(e,new Set([t])),t)}function RLt(e,t){const n=xT.get(e);n&&(n.delete(t),n.size===0&&xT.delete(e))}function z1(){return new Date().toISOString()}function PLt(e){return new Promise(t=>setTimeout(t,e))}function Sge(e){if(e==null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function $Z(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=$Z(e[i],s);return Object.is(o,e[i])||(n=!0),o});return n?r:e}if(Sge(e)&&Sge(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=$Z(n[c],r[c]);Object.is(l,n[c])||(o=!0),a[c]=l}return o?a:e}return t}function vge(e,t){return e?$Z(e,t):t}const $Lt=new Set(["validating","spawning","configuring","assembling","finalizing","verifying"]),BL=new Set(["ready","failed","disconnected","cancelled"]);function Tge(e){return e.startsWith("pending:")}function NLt(e){return(e instanceof Error?e.message:String(e)).includes("Unknown runId")}function FL(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 Ege(e){const t=H0.get(e);if(t)return t;const n=FL(sr("team:getData",()=>ee.teams.getData(e)),bXe,`team:getData(${e})`).finally(()=>{H0.get(e)===n&&H0.delete(e)});return H0.set(e,n),n}function ALt(e){return FL(sr("team:getData",()=>ee.teams.getData(e)),bXe,`team:getData(${e})`)}function ILt(e){const t=Date.now(),n=RZ.get(e)??{windowStartedAt:t,count:0,lastWarnAt:0};return t-n.windowStartedAt>vLt&&(n.windowStartedAt=t,n.count=0),n.count+=1,RZ.set(e,n),n.count}function MLt(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 QLt(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 DLt(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 LLt(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)||!DLt(e[s],t[s]))return!1;return!0}function jLt(e,t){return e?e.runId===t.runId&&e.teamLaunchState===t.teamLaunchState&&e.launchPhase===t.launchPhase&&e.source===t.source&&QLt(e.expectedMembers,t.expectedMembers)&&MLt(e.summary,t.summary)&&LLt(e.statuses,t.statuses):!1}function XLt(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 ULt(e,t){const n=Date.now(),r=PZ.get(e)??0;n-r<TLt||(PZ.set(e,n),Lp.debug(`[perf] member-spawn snapshot suppressed team=${e} runId=${t??"none"} reason=member-spawn-ui-equal`))}function zLt(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 BLt(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)||!zLt(e.members[s],t.members[s]))return!1;return!0}function FLt(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 YLt={canonicalMessages:[],optimisticMessages:[],feedRevision:null,nextCursor:null,hasMore:!1,lastFetchedAt:null,loadingHead:!1,loadingOlder:!1,headHydrated:!1,olderHydrated:!1};function qo(e,t){return e.teamMessagesByName[t]??YLt}function VLt(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(FLt),{...e,optimisticMessages:n}}function qLt(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 WLt(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 Rx(e){const t=lC.get(e);t!=null&&(clearTimeout(t),lC.delete(e))}function B1(e){Z0.delete(e)}function GLt(e,t,n){if(n){const s=Z0.get(e)??new Set;return s.add(t),Z0.set(e,s),!0}const r=Z0.get(e);return r?(r.delete(t),r.size===0?(Z0.delete(e),!1):!0):!1}function HLt(e,t){return t<=0?[]:e.slice(0,t)}function ZLt(e,t){if(e.length===0)return[];if(t.length===0)return null;const n=new Set(t.map(o=>Ls(o)));let r=!1;for(const o of e)if(!n.has(Ls(o))){r=!0;break}if(!r)return[];const s=Ls(t[t.length-1]),i=e.findIndex(o=>Ls(o)===s);return i<0?null:e.slice(i+1).filter(o=>!n.has(Ls(o)))}async function SI(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=Jc(s);if(!Ere(i)||typeof r.invalidateTaskChangePresence!="function"||typeof r.checkTaskHasChanges!="function")return;const o=Ad(t,n,i);r.invalidateTaskChangePresence([o]);try{await r.checkTaskHasChanges(t,n,i)}catch{}}async function wge(e,t,n){let s=500;for(let i=1;i<=60;i++){const o=e(),a=o.provisioningRuns[t];if(a&&BL.has(a.state))return;try{const c=await o.getProvisioningStatus(t);if(BL.has(c.state))return}catch(c){if(NLt(c)){o.clearMissingProvisioningRun(t);return}}await PLt(s),s=Math.min(1500,Math.round(s*1.5))}}const n2=new Set,QS=new Set,NZ=new Set,AZ=new Set,sk=new Set;let kge=!0;function KLt(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"&&!n2.has(s)&&(n2.add(s),JLt(r,!n)):n2.delete(s)}}function JLt(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=Ca(r).trim();ee.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 e5t(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=t_(a),d=t_(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(QS.has(_))continue;QS.add(_);const b=p||f?"Completed":c.status;t5t(a,b,p?"approved":f?"review":h?"needsFix":void 0,!s)}}function t5t(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;ee.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 n5t(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}`;NZ.has(p)||(NZ.add(p),r5t(s,d,!n))}}}function r5t(e,t,n){if(t.author==="user")return;const r=Ca(t.text).trim(),s=r.length>100?r.slice(0,100)+"...":r;ee.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 s5t(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)||AZ.has(i)||(AZ.add(i),i5t(s,!n))}}function i5t(e,t){ee.teams?.showMessageNotification({teamName:e.teamName,teamDisplayName:e.teamDisplayName,from:e.owner??"system",to:"user",summary:`New task ${Gr(e)}: ${e.subject}`,body:Ca(e.description||e.subject).trim(),teamEventType:"task_created",dedupeKey:`created:${e.teamName}:${e.id}`,suppressToast:t}).catch(()=>{})}function o5t(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")){sk.delete(s);continue}if(sk.has(s))continue;const a=e.filter(l=>l.teamName===s);if(a.length>0&&a.every(l=>l.status==="completed"||l.status==="deleted")){sk.add(s);continue}sk.add(s),a5t(i[0],i.length,!n)}}function a5t(e,t,n){ee.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 Cge(e,t,n){const r=new Set(n.map(o=>Ad(e,o.id,Jc(o)))),s=[],i=new Set;for(const o of t){const a=Ad(e,o.id,Jc(o));r.has(a)||(s.push(a),i.add(o.id))}return{cacheKeys:s,taskIds:[...i]}}function Rge(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=Ad(e,a.id,Jc(a)),l=Ad(e,o.id,Jc(o));return c!==l?o:(s=!0,{...o,changePresence:a.changePresence})});return s?i:n}function Pge(e){const t=e instanceof Xh||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 $ge(e){const t=e instanceof Xh||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 IZ=new Map,YL=new Map,MZ=new Map,l5t=[],c5t=[],VL=new Map;function u5t(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 d5t(e,t){return e.map(n=>xXe(n,t?.members[n.name]))}function xXe(e,t){return{...e,status:u5t(e,t),messageCount:t?.messageCountExact??0,lastActiveAt:t?.lastAuthoredMessageAt??null}}function p5t(e,t){return e?e.memberName===t.memberName&&e.lastAuthoredMessageAt===t.lastAuthoredMessageAt&&e.messageCountExact===t.messageCountExact&&e.latestAuthoredMessageSignalsTermination===t.latestAuthoredMessageSignalsTermination:!1}function f5t(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(!p5t(c,a)){s=!0,i[o]=a;continue}i[o]=c}return s?i:e}function Pi(e,t){return t?e.teamDataCacheByName[t]??(e.selectedTeamName===t?e.selectedTeamData:null):null}function Pl(e,t){const n=Pi(e,t);if(!n||!t)return[];const r=e.memberActivityMetaByTeam[t],s=r?.members,i=IZ.get(t);if(i?.snapshotRef===n.members&&i.metaMembersRef===s)return i.result;const o=d5t(n.members,r);return IZ.set(t,{snapshotRef:n.members,metaMembersRef:s,result:o}),o}function SXe(e,t,n){const r=Pi(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=YL.get(o);if(a?.snapshotMemberRef===s&&a.metaEntryRef===i)return a.result;const c=xXe(s,i);return YL.set(o,{snapshotMemberRef:s,metaEntryRef:i,result:c}),c}function Xse(e,t){return Pi(e,t)?.members??l5t}function h5t(e,t){return Pi(e,t)?.tasks??c5t}function m5t(e,t){return Pi(e,t)?.isAlive}function mz(e,t){if(!t)return[];const n=qo(e,t),r=MZ.get(t);if(r?.canonicalRef===n.canonicalMessages&&r.optimisticRef===n.optimisticMessages)return r.result;const s=wZ(n.canonicalMessages,n.optimisticMessages);return MZ.set(t,{canonicalRef:n.canonicalMessages,optimisticRef:n.optimisticMessages,result:s}),s}function vXe(e,t,n){if(!t||!n)return[];const r=mz(e,t),s=`${t}:${n}`,i=VL.get(s);if(i?.messagesRef===r)return i.result;const o=r.filter(a=>a.from===n||a.to===n);return VL.set(s,{messagesRef:r,result:o}),o}function Nge(e,t){const n=e.memberActivityMetaByTeam[t],r=qo(e,t).feedRevision;return n?r?n.feedRevision!==r:!1:!0}function vI(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 O5t(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 g5t(e,t){const n=O5t(e,t);return Object.keys(n).length>0?n:void 0}function _5t(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 Age(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 b5t(e,t){return t==="TEAM_DRAFT"||t.includes("TEAM_DRAFT")||t===`Team not found: ${e}`||t==="Team config not found"}const QZ="team:launchParams:";function Df(e,t){const n=e.currentProvisioningRunIdByTeam[t];return n?e.provisioningRuns[n]??null:null}function Yy(e,t){const n=Df(e,t);return n!=null&&$Lt.has(n.state)}function y5t(){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(QZ)){const s=r.slice(QZ.length),i=JSON.parse(t.getItem(r));i&&typeof i=="object"&&(e[s]=i)}}}catch{}return e}function Ige(e,t){try{localStorage?.setItem?.(QZ+e,JSON.stringify(t))}catch{}}function Mge(e,t){return Lse(e,t)}const TXe="team:toolApprovalSettings:";function EXe(e){if(!e)return G0;try{const t=JSON.parse(e),n=G0;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 G0}}function x5t(e){return EXe(localStorage?.getItem?.(TXe+e)??null)}function IY(e,t){try{localStorage?.setItem?.(TXe+e,JSON.stringify(t))}catch{}}function S5t(){return EXe(localStorage?.getItem?.("team:toolApprovalSettings")??null)}const v5t=(e,t)=>({teams:[],teamByName:{},teamBySessionId:{},branchByPath:{},teamsLoading:!1,teamsError:null,globalTasks:[],globalTasksLoading:!1,globalTasksInitialized:!1,globalTasksError:null,selectedTeamName:null,selectedTeamData:null,teamDataCacheByName:{},slotLayoutVersion:du,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:y5t(),fetchMemberSpawnStatuses:async n=>{if(!(!ee.teams?.getMemberSpawnStatuses||(t2.get(n)??0)>Date.now()))try{const s=await ee.teams.getMemberSpawnStatuses(n);t2.delete(n),e(i=>{const o=XLt(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 jLt(c,s)?(ULt(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'")&&t2.set(n,Date.now()+SLt)}},fetchTeamAgentRuntime:async n=>{if(ee.teams?.getTeamAgentRuntime)try{const r=await ee.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 BLt(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:S5t(),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 ee.teams.getProjectBranch(i);return[pr(i),o]}catch{return[pr(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 FL(sr("team:list",()=>ee.teams.list()),_ge,"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 Xh||r instanceof Error?r.message:"Failed to fetch teams":null})}},fetchAllTasks:async()=>{if(j1){$Y=!0,await j1;return}const r=(async()=>{do{$Y=!1;const s=!t().globalTasksInitialized;s&&e({globalTasksLoading:!0,globalTasksError:null});const i=t().globalTasks,o=kge;kge=!1;try{const a=await FL(sr("team:getAllTasks",()=>ee.teams.getAllTasks()),_ge,"fetchAllTasks");if(o){for(const l of a){l.needsClarification==="user"&&n2.add(`${l.teamName}:${l.id}`),QS.add(`${l.teamName}:${l.id}:${l.status}`),l.reviewState==="needsFix"&&QS.add(`${l.teamName}:${l.id}:needsFix`),t_(l)==="approved"&&QS.add(`${l.teamName}:${l.id}:approved`),t_(l)==="review"&&QS.add(`${l.teamName}:${l.id}:review`);for(const d of l.comments??[])NZ.add(`${l.teamName}:${l.id}:${d.id}`);AZ.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")&&sk.add(l)}else{const c=t().appConfig?.notifications?.notifyOnClarifications??!0;KLt(i,a,c),e5t(i,a,t().appConfig,t().teamByName);const l=t().appConfig?.notifications?.notifyOnTaskComments??!0;n5t(i,a,l);const d=t().appConfig?.notifications?.notifyOnTaskCreated??!0;s5t(i,a,d);const p=t().appConfig?.notifications?.notifyOnAllTasksCompleted??!0;o5t(i,a,p)}e({globalTasks:a,globalTasksLoading:!1,globalTasksInitialized:!0,globalTasksError:null})}catch(a){e({globalTasksLoading:!1,globalTasksInitialized:!0,globalTasksError:s?a instanceof Xh||a instanceof Error?a.message:"Failed to fetch tasks":null})}}while($Y)})().finally(()=>{j1===r&&(j1=null)});j1=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=pr(r),h=p.projects.find(m=>pr(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!==du&&(o.slotLayoutVersion=du,c={},l={},a=!0);const d=e2(r,s),p=g5t(c[n],d.orderedVisibleOwnerIds),f=l[n];return f?.mode==="manual"?vI(c[n],p)||(c={...c},p?c[n]=p:delete c[n],a=!0):((!vI(c[n],p)||!vI(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===du?{}:c?(Lp.warn(`[graph-layout] refusing occupied slot assignment team=${n} owner=${r} target=${s.ringIndex}:${s.sectorIndex} occupiedBy=${c[0]}`),{}):{slotLayoutVersion:du,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===du)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?(Lp.warn(`[graph-layout] refusing slot drop team=${n} owner=${r} target=${s.ringIndex}:${s.sectorIndex} conflict=${p[0]}`),{}):{slotLayoutVersion:du,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=Pi(i,n),a=[...i.gridOwnerOrderByTeam[n]??[]];for(const h of[r,s])a.includes(h)||a.push(h);const c=o?e2(o.members,o.config.members??[]).orderedVisibleOwnerIds:a,l=_5t(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:du,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===du&&Object.keys(r.graphLayoutSessionByTeam).length===0?{}:{slotLayoutVersion:du,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:du,slotAssignmentsByTeam:s,graphLayoutSessionByTeam:i}})},resetTeamGraphSlotAssignmentsToDefaults:n=>{e(r=>{const s=Pi(r,n),i=s?e2(s.members,s.config.members??[]):{signature:null,assignments:{}},o=r.slotAssignmentsByTeam[n],a=r.graphLayoutSessionByTeam[n];if(vI(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:du,slotAssignmentsByTeam:c,graphLayoutSessionByTeam:{...r.graphLayoutSessionByTeam,[n]:{mode:"default",signature:i.signature}}}})},setSelectedTeamTaskChangePresence:(n,r,s)=>{e(i=>{const o=Pi(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(Pi(t(),n))try{const s=await sr("team:getTaskChangePresence",()=>ee.teams.getTaskChangePresence(n));e(i=>{const o=Pi(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=Ih(n),i=r?.allowReloadWhileProvisioning===!0;if(t().selectedTeamLoading&&t().selectedTeamName===n&&!i)return;const o=t().selectedTeamLoadNonce+1,a=Pi(t(),n);e({selectedTeamName:n,selectedTeamData:a,selectedTeamLoading:!0,selectedTeamLoadNonce:o,selectedTeamError:null,reviewActionError:null,toolApprovalSettings:x5t(n)});try{const c=await Ege(n);if(!xc(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:Rge(n,a.tasks,c.tasks)}:c,h=vge(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}}),zL.set(n,Date.now());const m=a?Cge(n,a.tasks,c.tasks):{cacheKeys:[],taskIds:[]};m.cacheKeys.length>0&&t().invalidateTaskChangePresence(m.cacheKeys),m.taskIds.length>0&&await ee.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||Nge(t(),n))&&await t().refreshMemberActivityMeta(n),r?.skipProjectAutoSelect)return;const x=c.config.projectPath;if(x){const S=t(),v=pr(x),T=S.projects.find(E=>pr(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=>pr(P.path)===v);if(w){S.selectedWorktreeId!==w.id&&(e(LU(E.id,w.id)),t().fetchSessionsInitial(w.id));break}}}}catch(c){if(!xc(n,s))return;const l=t();if(l.selectedTeamName!==n||l.selectedTeamLoadNonce!==o)return;const d=Yy(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 Xh||c instanceof Error?c.message:"Failed to fetch team data";e({selectedTeamLoading:!1,selectedTeamData:null,selectedTeamError:f})}},refreshTeamData:async(n,r)=>{const s=Ih(n),i=CLt(n),o=r?.withDedup===!0&&H0.has(n);ILt(n),o&&UL.add(n);try{const a=Pi(t(),n),c=r?.withDedup?await Ege(n):await ALt(n);if(!xc(n,s))return;const l=a?{...c,tasks:Rge(n,a.tasks,c.tasks)}:c,d=vge(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}}),zL.set(n,Date.now());const p=a?Cge(n,a.tasks,c.tasks):{cacheKeys:[],taskIds:[]};p.cacheKeys.length>0&&t().invalidateTaskChangePresence(p.cacheKeys),p.taskIds.length>0&&await ee.review.invalidateTaskChangeSummaries(n,p.taskIds)}catch(a){if(!xc(n,s))return;const c=a instanceof Xh||a instanceof Error?a.message:"Failed to refresh team data";if(c==="TEAM_PROVISIONING"||c.includes("TEAM_PROVISIONING")){Lp.debug(`refreshTeamData(${n}) skipped: team is still provisioning`),t().selectedTeamName===n&&e({selectedTeamError:null});return}if(b5t(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(Lp.warn(`refreshTeamData(${n}) failed: ${c}`),t().selectedTeamData){Lp.debug(`refreshTeamData(${n}) preserving existing data after transient error`),e({selectedTeamError:null});return}e({selectedTeamError:c})}finally{RLt(n,i),o&&UL.delete(n)&&t().refreshTeamData(n)}},refreshTeamMessagesHead:async n=>{const r=sS.get(n);if(r)return kZ.add(n),r;const s=x0.get(n);if(s)return s;const i=iS.get(n);if(i){const c=Ih(n),l=i.then(()=>{if(!xc(n,c))return{feedChanged:!1,headChanged:!1,feedRevision:null};if(x0.get(n)===l)x0.delete(n);else return{feedChanged:!1,headChanged:!1,feedRevision:null};return t().refreshTeamMessagesHead(n)}).finally(()=>{x0.get(n)===l&&x0.delete(n)});return x0.set(n,l),l}const o={current:null};o.current=(async()=>{const c=Ih(n);e(l=>({teamMessagesByName:{...l.teamMessagesByName,[n]:{...qo(l,n),loadingHead:!0}}}));try{const l=await sr("team:getMessagesPage",()=>ee.teams.getMessagesPage(n,{limit:50}));if(!xc(n,c))return{feedChanged:!1,headChanged:!1,feedRevision:null};const d=qo(t(),n),p=!d.headHydrated||d.feedRevision!==l.feedRevision,f=HLt(d.canonicalMessages,l.messages.length),h=!qLt(f,l.messages);return e(m=>{const O=qo(m,n),_=ZLt(O.canonicalMessages,l.messages),b=O.olderHydrated&&Array.isArray(_)&&_.length>0,y=h?b?wZ(_,l.messages):l.messages:O.canonicalMessages,x=WLt(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(!xc(n,c))return{feedChanged:!1,headChanged:!1,feedRevision:null};throw e(d=>({teamMessagesByName:{...d.teamMessagesByName,[n]:{...qo(d,n),loadingHead:!1}}})),l}finally{sS.get(n)===o.current&&(sS.delete(n),kZ.delete(n)&&t().refreshTeamMessagesHead(n))}})();const a=o.current;return sS.set(n,a),a},loadOlderTeamMessages:async n=>{const r=Ih(n),s=iS.get(n);if(s)return s;const i=sS.get(n);if(i&&(await i,!xc(n,r)))return;let o=qo(t(),n);if(!o.headHydrated){if(await t().refreshTeamMessagesHead(n),!xc(n,r))return;o=qo(t(),n)}if(!o.headHydrated||!o.nextCursor||o.loadingOlder||o.loadingHead)return;const a={current:null};a.current=(async()=>{const l=Ih(n);e(d=>({teamMessagesByName:{...d.teamMessagesByName,[n]:{...qo(d,n),loadingOlder:!0}}}));try{const d=o.feedRevision,p=await sr("team:getMessagesPage",()=>ee.teams.getMessagesPage(n,{cursor:o.nextCursor,limit:50}));if(!xc(n,l))return;const f=qo(t(),n);if(f.feedRevision!==d){e(h=>({teamMessagesByName:{...h.teamMessagesByName,[n]:{...qo(h,n),loadingOlder:!1}}})),await t().refreshTeamMessagesHead(n);return}if(f.feedRevision&&f.feedRevision!==p.feedRevision){e(h=>({teamMessagesByName:{...h.teamMessagesByName,[n]:{...qo(h,n),loadingOlder:!1}}})),await t().refreshTeamMessagesHead(n);return}e(h=>{const m=qo(h,n),O=wZ(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(!xc(n,l))return;e(d=>({teamMessagesByName:{...d.teamMessagesByName,[n]:{...qo(d,n),loadingOlder:!1}}}))}finally{iS.get(n)===a.current&&iS.delete(n)}})();const c=a.current;return iS.set(n,c),c},refreshMemberActivityMeta:async n=>{if(!qo(t(),n).headHydrated)return;const s=rk.get(n);if(s)return CZ.add(n),s;const i={current:null};i.current=(async()=>{const a=Ih(n);try{const c=await sr("team:getMemberActivityMeta",()=>ee.teams.getMemberActivityMeta(n));if(!xc(n,a))return;e(l=>{const d=qo(l,n).feedRevision;if(d&&c.feedRevision!==d)return{};const p=l.memberActivityMetaByTeam[n];if(p?.feedRevision===c.feedRevision)return{};const f=f5t(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(!xc(n,a))return;throw c}finally{rk.get(n)===i.current&&(rk.delete(n),CZ.delete(n)&&t().refreshMemberActivityMeta(n))}})();const o=i.current;return rk.set(n,o),o},syncTeamPendingReplyRefresh:(n,r,s,i=1e4)=>{if(Rx(n),!GLt(n,r,s))return;const a=setTimeout(()=>{lC.get(n)===a&&(lC.delete(n),(async()=>{try{((await t().refreshTeamMessagesHead(n)).feedChanged||Nge(t(),n))&&await t().refreshMemberActivityMeta(n)}catch{}})())},i);lC.set(n,a)},updateKanban:async(n,r,s)=>{try{e({reviewActionError:null}),await sr("team:updateKanban",()=>ee.teams.updateKanban(n,r,s)),await t().refreshTeamData(n)}catch(i){throw e({reviewActionError:$ge(i)}),i}},updateKanbanColumnOrder:async(n,r,s)=>{await sr("team:updateKanbanColumnOrder",()=>ee.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 sr("team:sendMessage",()=>ee.teams.sendMessage(n,r)),i=s.runtimeDelivery?.attempted===!0&&s.runtimeDelivery.delivered===!1,o=oLt(s),a={from:r.from??"user",to:r.to??r.member,text:r.text,timestamp:r.timestamp??z1(),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]:VLt(qo(c,n),a)}})),await t().refreshTeamMessagesHead(n),s}catch(s){throw e({sendingMessage:!1,lastSendMessageResult:null,sendMessageWarning:null,sendMessageDebugDetails:null,sendMessageError:Pge(s)}),s}},fetchCrossTeamTargets:async()=>{e({crossTeamTargetsLoading:!0});try{const n=await ee.crossTeam.listTargets();e({crossTeamTargets:n,crossTeamTargetsLoading:!1})}catch(n){Lp.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 ee.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:Pge(r)})}},requestReview:async(n,r)=>{try{e({reviewActionError:null}),await sr("team:requestReview",()=>ee.teams.requestReview(n,r)),await t().refreshTeamData(n),SI(t,n,r)}catch(s){throw e({reviewActionError:$ge(s)}),s}},createTeamTask:async(n,r)=>{const s=await sr("team:createTask",()=>ee.teams.createTask(n,r));return await t().refreshTeamData(n),s},startTask:async(n,r)=>{const s=await sr("team:startTask",()=>ee.teams.startTask(n,r));return await t().refreshTeamData(n),SI(t,n,r),s},startTaskByUser:async(n,r)=>{const s=await sr("team:startTaskByUser",()=>ee.teams.startTaskByUser(n,r));return await t().refreshTeamData(n),SI(t,n,r),s},updateTaskStatus:async(n,r,s)=>{await sr("team:updateTaskStatus",()=>ee.teams.updateTaskStatus(n,r,s)),await t().refreshTeamData(n),SI(t,n,r)},updateTaskOwner:async(n,r,s)=>{await sr("team:updateTaskOwner",()=>ee.teams.updateTaskOwner(n,r,s)),await t().refreshTeamData(n)},updateTaskFields:async(n,r,s)=>{await sr("team:updateTaskFields",()=>ee.teams.updateTaskFields(n,r,s)),await t().refreshTeamData(n)},addTaskRelationship:async(n,r,s,i)=>{await sr("team:addTaskRelationship",()=>ee.teams.addTaskRelationship(n,r,s,i)),await t().refreshTeamData(n)},removeTaskRelationship:async(n,r,s,i)=>{await sr("team:removeTaskRelationship",()=>ee.teams.removeTaskRelationship(n,r,s,i)),await t().refreshTeamData(n)},setTaskNeedsClarification:async(n,r,s)=>{await sr("team:setTaskClarification",()=>ee.teams.setTaskClarification(n,r,s)),await t().refreshTeamData(n),await t().fetchAllTasks()},saveTaskAttachment:async(n,r,s)=>{const i=crypto.randomUUID();await sr("team:saveTaskAttachment",()=>ee.teams.saveTaskAttachment(n,r,i,s.name,s.type,s.base64)),await t().refreshTeamData(n)},deleteTaskAttachment:async(n,r,s,i)=>{await sr("team:deleteTaskAttachment",()=>ee.teams.deleteTaskAttachment(n,r,s,i)),await t().refreshTeamData(n)},getTaskAttachmentData:async(n,r,s,i)=>sr("team:getTaskAttachment",()=>ee.teams.getTaskAttachment(n,r,s,i)),addTaskComment:async(n,r,s)=>{e({addingComment:!0,addCommentError:null});try{const i=await sr("team:addTaskComment",()=>ee.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 sr("team:addMember",()=>ee.teams.addMember(n,r)),await Promise.allSettled([t().refreshTeamData(n),t().fetchMemberSpawnStatuses(n),t().fetchTeamAgentRuntime(n)])},restartMember:async(n,r)=>{try{await sr("team:restartMember",()=>ee.teams.restartMember(n,r))}finally{await Promise.allSettled([t().fetchMemberSpawnStatuses(n),t().fetchTeamAgentRuntime(n)])}},skipMemberForLaunch:async(n,r)=>{try{await sr("team:skipMemberForLaunch",()=>ee.teams.skipMemberForLaunch(n,r))}finally{await Promise.allSettled([t().fetchMemberSpawnStatuses(n),t().fetchTeamAgentRuntime(n),t().fetchTeams()])}},removeMember:async(n,r)=>{await sr("team:removeMember",()=>ee.teams.removeMember(n,r)),await t().refreshTeamData(n)},updateMemberRole:async(n,r,s)=>{await sr("team:updateMemberRole",()=>ee.teams.updateMemberRole(n,r,s)),await t().refreshTeamData(n)},softDeleteTask:async(n,r)=>{await sr("team:softDeleteTask",()=>ee.teams.softDeleteTask(n,r)),await t().refreshTeamData(n),await t().fetchDeletedTasks(n)},restoreTask:async(n,r)=>{await sr("team:restoreTask",()=>ee.teams.restoreTask(n,r)),await t().refreshTeamData(n),await t().fetchDeletedTasks(n)},fetchDeletedTasks:async n=>{e({deletedTasksLoading:!0});try{const r=await sr("team:getDeletedTasks",()=>ee.teams.getDeletedTasks(n));e({deletedTasks:r,deletedTasksLoading:!1})}catch(r){Lp.error("Failed to fetch deleted tasks:",r),e({deletedTasks:[],deletedTasksLoading:!1})}},deleteTeam:async n=>{const r=await sr("team:deleteTeam",()=>ee.teams.deleteTeam(n));return U1(n),Rx(n),B1(n),X1(n),e(s=>({...AY(s,n),teams:s.teams.filter(i=>i.teamName!==n),selectedTeam:s.selectedTeam?.teamName===n?null:s.selectedTeam,selectedTeamName:s.selectedTeamName===n?null:s.selectedTeamName,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 sr("team:restoreTeam",()=>ee.teams.restoreTeam(n)),U1(n),Rx(n),B1(n),X1(n),e(r=>{const s=AY(r,n),i=xge(r,n,z1());return Object.keys(s).length===0?i:{...s,...i}}),await t().fetchTeams(),await t().fetchAllTasks()},permanentlyDeleteTeam:async n=>{await sr("team:permanentlyDeleteTeam",()=>ee.teams.permanentlyDeleteTeam(n)),U1(n),Rx(n),B1(n),X1(n);const r=t(),s=AY(r,n),i=xge(r,n,z1());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(),U1(n.teamName),Rx(n.teamName),B1(n.teamName),X1(n.teamName);const r=z1();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=yge(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?G0:{...G0,autoAllowAll:!0};IY(n.teamName,i),e({toolApprovalSettings:i});try{if(typeof ee.teams.createTeam!="function")throw new Error("Current preload version does not support team:create. Restart the dev app.");const o=await sr("team:create",()=>ee.teams.createTeam(n)),a=Mge(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};Ige(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),wge(t,o.runId),o.runId}catch(o){const a=o instanceof Xh||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(),U1(n.teamName),Rx(n.teamName),B1(n.teamName),X1(n.teamName);const r=z1();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=yge(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?G0:{...G0,autoAllowAll:!0};IY(n.teamName,i),e({toolApprovalSettings:i})}try{const i=await sr("team:launch",()=>ee.teams.launchTeam(n)),o=Mge(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};Ige(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 wge(t,i.runId),i.runId}catch(i){const o=i instanceof Xh||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 sr("team:provisioningStatus",()=>ee.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 sr("team:cancelProvisioning",()=>ee.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&&!BL.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 sr("team:stop",()=>ee.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):Tge(h)&&!Tge(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();Age(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&&BL.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(!Age(d,n.teamName))return;d.selectedTeamName===n.teamName?d.selectTeam(n.teamName):d.refreshTeamData(n.teamName,{withDedup:!0})}},subscribeProvisioningProgress:()=>{if(t().provisioningProgressUnsubscribe||!ee.teams?.onProvisioningProgress)return;const r=ee.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)IY(s,o);else try{localStorage?.setItem?.("team:toolApprovalSettings",JSON.stringify(o))}catch{}try{await ee.teams.updateToolApprovalSettings(s??"__global__",o)}catch(a){Lp.warn("Failed to sync tool approval settings to main:",a)}},respondToToolApproval:async(n,r,s,i,o)=>{try{await ee.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 Lp.error(`respondToToolApproval failed for ${n}/${s}: ${c}`),a}},unsubscribeProvisioningProgress:()=>{const n=t().provisioningProgressUnsubscribe;n&&(n(),e({provisioningProgressUnsubscribe:null}))}}),T5t=e=>({commandPaletteOpen:!1,sidebarCollapsed:!1,openCommandPalette:()=>{e({commandPaletteOpen:!0})},closeCommandPalette:()=>{e({commandPaletteOpen:!1})},toggleSidebar:()=>{e(t=>({sidebarCollapsed:!t.sidebarCollapsed}))}}),E5t=1e4,w5t=1500,k5t=6,C5t=4e3,R5t=8,P5t=2e3,$5t=1e4,N5t=3e4,A5t=1e4,I5t=eo("Store:index"),M5t=new Set(["task","config","inbox","lead-message","lead-context","lead-activity","process","member-spawn"]),Qge=new Map;function Q5t(e,t,n){if(!n)return;const r=Date.now(),s=Qge.get(e)??{windowStartedAt:r,count:0,lastWarnAt:0,countsByType:{}};r-s.windowStartedAt>C5t&&(s.windowStartedAt=r,s.count=0,s.countsByType={}),s.count+=1,s.countsByType[t]=(s.countsByType[t]??0)+1,s.count>=R5t&&r-s.lastWarnAt>=P5t&&(s.lastWarnAt=r),Qge.set(e,s)}const oe=jSt()((...e)=>({...D2t(...e),...X2t(...e),...KDt(...e),...GDt(...e),...JDt(...e),...v5t(...e),...eTt(...e),...eLt(...e),...tLt(...e),...Q2t(...e),...T5t(...e),...M2t(...e),...Ovt(...e),..._vt(...e),...Cvt(...e),...avt(...e),...hvt(...e),...b2t(...e),...U2t(...e),...P2t(...e)}));function D5t(){tSt();const e=[];let t=null;oe.getState().subscribeProvisioningProgress(),e.push(()=>{oe.getState().unsubscribeProvisioningProgress()}),(async()=>{await oe.getState().fetchConfig();const J=oe.getState().appConfig;HQe(J?.general?.telemetryEnabled??!0),ee.cliInstaller&&(t=setTimeout(()=>{oe.getState().appConfig?.general?.multimodelEnabled??!1?oe.getState().bootstrapCliStatus({multimodelEnabled:!0}):oe.getState().fetchCliStatus(),t=null},3e3)),await Promise.all([oe.getState().fetchRepositoryGroups(),oe.getState().fetchAllTasks(),oe.getState().fetchTeams(),oe.getState().fetchNotifications(),oe.getState().fetchSchedules()])})(),e.push(()=>{t&&clearTimeout(t)});const n=setInterval(()=>{V()},E5t);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||!se(J))return;const F=oe.getState();try{const W=await F.refreshTeamMessagesHead(J),ue=oe.getState(),ie=ue.memberActivityMetaByTeam[J];(W.feedChanged||ie?.feedRevision!==W.feedRevision)&&await ue.refreshMemberActivityMeta(J)}catch{}},k=J=>{if(!J||!Z(J)||d.has(J))return;const F=setTimeout(()=>{d.delete(J),oe.getState().fetchMemberSpawnStatuses(J)},T);d.set(J,F)},C=J=>{if(!J||!Z(J)||p.has(J))return;const F=setTimeout(()=>{p.delete(J),oe.getState().fetchTeamAgentRuntime(J)},T);p.set(J,F)},I=J=>{if(!J||!se(J)||c.has(J))return;const F=setTimeout(()=>{c.delete(J),P(J)},S);c.set(J,F)},N=(J,F,W,ue)=>`${J}:${F}:${W}:${ue}`,R=(J,F,W,ue)=>{const ie=N(J,F,W,ue),le=f.get(ie);le&&(clearTimeout(le),f.delete(ie))},$=(J,F,W,ue,ie,le)=>{R(J,F,W,ue);const K=N(J,F,W,ue),pe=setTimeout(()=>{f.delete(K),le()},ie);f.set(K,pe)},A=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},ie={...J.toolHistoryByTeam};return delete W[F],delete ue[F],delete ie[F],{activeToolsByTeam:W,finishedVisibleByTeam:ue,toolHistoryByTeam:ie}},Q=(J,F,W)=>{const ue={...J[F]??{}},ie=ue[W.memberName]??[];return ue[W.memberName]=[W,...ie.filter(le=>le.toolUseId!==W.toolUseId)].slice(0,k5t),{...J,[F]:ue}},U=(J,F)=>({...J??{},[F.memberName]:{...(J??{})[F.memberName]??{},[F.toolUseId]:F}}),M=(J,F,W)=>{if(!J?.[F]?.[W])return J??{};const ue={...J??{}},ie={...ue[F]??{}};return delete ie[W],Object.keys(ie).length===0?delete ue[F]:ue[F]=ie,ue},q=(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??{},ie=!1;for(const le of W)ue[F]?.[le]&&(ue=M(ue,F,le),ie=!0);return ie?ue:J??{}},L=J=>{if(!J)return null;const F=J.indexOf("::");return F>=0?J.slice(0,F):J},V=async()=>{if(h)return;const J=oe.getState(),F=Array.from(H(J));if(F.length!==0){if(O.size>50){const W=new Set(oe.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=Pi(J,W);if(ue?.teamName!==W){NY(W)||J.refreshTeamData(W,{withDedup:!0});continue}const ie=ue.tasks.filter(xt=>xt.status!=="in_progress"?!1:Ere(Jc(xt)));if(ie.length===0){O.delete(W);continue}const le=O.get(W)??0,K=ie.filter(xt=>xt.changePresence==="unknown"),pe=K.length>0?K:ie,we=pe[le%pe.length];O.set(W,(le+1)%pe.length);const Ee=oe.getState();if(!Z(W))continue;const Ae=Pi(Ee,W);if(Ae?.teamName!==W){NY(W)||Ee.refreshTeamData(W,{withDedup:!0});continue}const We=Ae.tasks.find(xt=>xt.id===we.id);if(We?.status!=="in_progress")continue;const et=Jc(We),yt=Ad(W,We.id,et);Ee.invalidateTaskChangePresence([yt]),await Ee.checkTaskHasChanges(W,We.id,et)}}catch{}finally{h=!1}}},Y=(J,F)=>{const W=`${J}/${F}`;if(r.has(W))return;const ue=setTimeout(()=>{r.delete(W),oe.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),oe.getState().refreshSessionsInPlace(J)},x);s.set(J,W)};if(ee.notifications?.onNew){const J=ee.notifications.onNew((F,W)=>{const ue=W;ue?.id&&oe.setState(ie=>ie.notifications.some(le=>le.id===ue.id)?{}:{notifications:[ue,...ie.notifications].slice(0,200)})});typeof J=="function"&&e.push(J)}if(ee.notifications?.onUpdated){const J=ee.notifications.onUpdated((F,W)=>{const ue=typeof W.unreadCount=="number"&&Number.isFinite(W.unreadCount)?Math.max(0,Math.floor(W.unreadCount)):0;oe.setState({unreadCount:ue})});typeof J=="function"&&e.push(J)}if(ee.notifications?.onClicked){const J=ee.notifications.onClicked((F,W)=>{const ue=W;ue?.id&&ue?.sessionId&&ue?.projectId&&oe.getState().navigateToError(ue)});typeof J=="function"&&e.push(J)}const te=J=>{const{paneLayout:F}=oe.getState();return F.panes.some(W=>W.activeTabId!=null&&W.tabs.some(ue=>ue.id===W.activeTabId&&ue.type==="session"&&ue.sessionId===J))},H=(J=oe.getState())=>{const{paneLayout:F}=J,W=new Set;for(const ue of F.panes){if(!ue.activeTabId)continue;const ie=ue.tabs.find(le=>le.id===ue.activeTabId);(ie?.type==="team"||ie?.type==="graph")&&ie.teamName!=null&&W.add(ie.teamName)}return W},Z=J=>H().has(J),se=J=>Z(J)||ELt(J),he=()=>{const J=H();for(const F of wLt())J.add(F);return J},ce=()=>H(),me=(J,F=Date.now())=>{i.set(J,F)},ae=()=>{const J=oe.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||!Pi(J,W.teamName)?null:W.teamName},G=async()=>{if(m)return;const J=he();if(J.size!==0){m=!0;try{await Promise.allSettled(Array.from(J,F=>P(F)))}finally{m=!1}}},be=async()=>{if(typeof document<"u"&&document.visibilityState==="hidden")return;const J=oe.getState(),F=ae();if(!F||!Z(F)||J.selectedTeamName===F&&J.selectedTeamLoading||NY(F))return;const W=i.get(F)??0,ue=bge(F)??0,ie=Math.max(W,ue);if(ie===0)return;const le=Date.now();if(!(le-ie<N5t||(o.get(F)??0)>=ie)){I5t.warn(`[perf] idle-watchdog refresh team=${F} idleMs=${le-ie}`);try{await J.refreshTeamData(F,{withDedup:!0})}finally{o.set(F,Math.max(bge(F)??0,ie,Date.now()))}}};if(ee.teams?.setToolActivityTracking){let J=new Set;const F=()=>{const ue=ce();for(const ie of ue)J.has(ie)||ee.teams.setToolActivityTracking(ie,!0).catch(()=>{});for(const ie of J)ue.has(ie)||ee.teams.setToolActivityTracking(ie,!1).catch(()=>{});J=ue};F();const W=oe.subscribe((ue,ie)=>{ue.paneLayout!==ie.paneLayout&&F()});e.push(()=>{W();for(const ue of J)ee.teams.setToolActivityTracking(ue,!1).catch(()=>{});J.clear()})}if(ee.onTodoChange){const J=ee.onTodoChange(F=>{if(!F.sessionId||F.type==="unlink")return;const W=oe.getState();if(W.selectedSessionId===F.sessionId||te(F.sessionId)){const pe=W.getAllPaneTabs().find(we=>we.type==="session"&&we.sessionId===F.sessionId);pe?.projectId&&Y(pe.projectId,F.sessionId)}const ie=W.getActiveTab(),le=ie?.type==="session"&&typeof ie.projectId=="string"?ie.projectId:null;le&&le===W.selectedProjectId&&ne(le)});typeof J=="function"&&e.push(J)}if(ee.onFileChange){const J=ee.onFileChange(F=>{if(F.type==="unlink")return;const W=oe.getState(),ue=W.selectedProjectId,ie=L(ue),le=L(F.projectId),K=!!ue&&(le==null||ie===le),pe=!F.isSubagent,we=F.sessionId==null||!W.sessions.some(Ae=>Ae.id===F.sessionId);if(pe&&K&&we&&(F.type==="add"||W.connectionMode==="local"&&F.type==="change")&&K&&ue&&ne(ue),(F.type==="change"||F.type==="add")&&ue){const Ae=W.selectedSessionId,We=F.sessionId,xt=(!!We&&(Ae===We||te(We))?We:null)??(K&&!We&&!!Ae?Ae:null);if(xt){const Xt=W.getAllPaneTabs().find(ct=>ct.type==="session"&&ct.sessionId===xt)?.projectId??ue;Y(Xt,xt)}}});typeof J=="function"&&e.push(J)}const _e=setInterval(()=>{be()},$5t);e.push(()=>{clearInterval(_e)});const re=setInterval(()=>{G()},A5t);if(e.push(()=>{clearInterval(re)}),ee.teams?.onTeamChange){const J=ee.teams.onTeamChange((F,W)=>{const ue=!!W.teamName&&se(W.teamName);if(Q5t(W.teamName,W.type,ue),(()=>{if(!W.runId)return!1;const Ee=oe.getState();return Ee.ignoredProvisioningRunIds[W.runId]===W.teamName||Ee.ignoredRuntimeRunIds[W.runId]===W.teamName})())return;const le=(()=>{if(!W.runId)return!1;const Ee=oe.getState().currentRuntimeRunIdByTeam[W.teamName];return Ee!=null&&Ee!==W.runId})(),K=()=>{if(!W.runId)return;oe.getState().currentRuntimeRunIdByTeam[W.teamName]==null&&oe.setState(Ae=>({currentRuntimeRunIdByTeam:{...Ae.currentRuntimeRunIdByTeam,[W.teamName]:W.runId??null},ignoredRuntimeRunIds:Object.fromEntries(Object.entries(Ae.ignoredRuntimeRunIds).filter(([,We])=>We!==W.teamName))}))};if(M5t.has(W.type)&&!le&&me(W.teamName),W.type==="lead-activity"&&W.detail){if(le)return;K();const Ee=W.detail;oe.setState(Ae=>{const We={leadActivityByTeam:{...Ae.leadActivityByTeam,[W.teamName]:Ee}},et=Ae.teamDataCacheByName[W.teamName]??(Ae.selectedTeamName===W.teamName?Ae.selectedTeamData:null),yt=et&&et.isAlive!==(Ee!=="offline")?{...et,isAlive:Ee!=="offline"}:et;return yt&&(We.teamDataCacheByName={...Ae.teamDataCacheByName,[W.teamName]:yt}),Ae.selectedTeamName===W.teamName&&yt&&(We.selectedTeamData=yt),Ee==="offline"&&(We.leadContextByTeam={...Ae.leadContextByTeam},delete We.leadContextByTeam[W.teamName],Object.assign(We,j(Ae,W.teamName)),We.currentRuntimeRunIdByTeam={...Ae.currentRuntimeRunIdByTeam},delete We.currentRuntimeRunIdByTeam[W.teamName],We.ignoredRuntimeRunIds=W.runId?{...Ae.ignoredRuntimeRunIds,[W.runId]:W.teamName}:Ae.ignoredRuntimeRunIds,A(W.teamName)),We});return}if(W.type==="lead-context"&&W.detail){if(le)return;K();try{const Ee=JSON.parse(W.detail);oe.setState(Ae=>({...Ae,leadContextByTeam:{...Ae.leadContextByTeam,[W.teamName]:Ee}}))}catch{}return}if(W.type==="tool-activity"&&W.detail){if(le)return;K();try{const Ee=JSON.parse(W.detail);if(Ee.action==="start"&&Ee.activity){const Ae={memberName:Ee.activity.memberName,toolUseId:Ee.activity.toolUseId,toolName:Ee.activity.toolName,preview:Ee.activity.preview,startedAt:Ee.activity.startedAt,source:Ee.activity.source,state:"running"};oe.setState(We=>({activeToolsByTeam:{...We.activeToolsByTeam,[W.teamName]:U(We.activeToolsByTeam[W.teamName],Ae)}}))}else if(Ee.action==="finish"&&Ee.memberName&&Ee.toolUseId){const Ae=Ee.memberName,We=Ee.toolUseId;oe.setState(et=>{const yt=et.activeToolsByTeam[W.teamName]?.[Ae]?.[We];if(!yt)return{};const xt={...yt,state:Ee.isError?"error":"complete",finishedAt:Ee.finishedAt??new Date().toISOString(),resultPreview:Ee.resultPreview};return $(W.teamName,Ae,We,"fade",w5t,()=>{oe.setState(Ge=>Ge.finishedVisibleByTeam[W.teamName]?.[Ae]?.[We]?{finishedVisibleByTeam:{...Ge.finishedVisibleByTeam,[W.teamName]:M(Ge.finishedVisibleByTeam[W.teamName],Ae,We)}}:{})}),{activeToolsByTeam:{...et.activeToolsByTeam,[W.teamName]:M(et.activeToolsByTeam[W.teamName],Ae,We)},finishedVisibleByTeam:{...et.finishedVisibleByTeam,[W.teamName]:U(et.finishedVisibleByTeam[W.teamName],xt)},toolHistoryByTeam:Q(et.toolHistoryByTeam,W.teamName,xt)}})}else if(Ee.action==="reset")if(Ee.memberName){const Ae=Ee.memberName,We=Array.isArray(Ee.toolUseIds)&&Ee.toolUseIds.length>0?Ee.toolUseIds:null;oe.setState(et=>et.activeToolsByTeam[W.teamName]?.[Ae]?{activeToolsByTeam:{...et.activeToolsByTeam,[W.teamName]:We?z(et.activeToolsByTeam[W.teamName],Ae,We):q(et.activeToolsByTeam[W.teamName],Ae)}}:{})}else oe.setState(Ae=>({activeToolsByTeam:{...Ae.activeToolsByTeam,[W.teamName]:{}}}))}catch{}return}if(W.type==="member-spawn"){if(le)return;K(),k(W.teamName),C(W.teamName);return}if(W.type==="inbox"){I(W.teamName);return}if(W.type==="lead-message"){if(le)return;K(),I(W.teamName);return}if(W.type==="log-source-change"){if(!W?.teamName||!Z(W.teamName)||l.has(W.teamName))return;const Ee=setTimeout(()=>{l.delete(W.teamName),oe.getState().refreshTeamChangePresence(W.teamName)},v);l.set(W.teamName,Ee);return}if(_||(_=setTimeout(()=>{_=null,oe.getState().fetchTeams()},E)),(W.type==="task"||W.type==="config")&&!b&&(b=setTimeout(()=>{b=null,oe.getState().fetchAllTasks()},w)),!W?.teamName||!Z(W.teamName)||a.has(W.teamName))return;const we=setTimeout(()=>{a.delete(W.teamName),oe.getState().refreshTeamData(W.teamName,{withDedup:!0})},S);a.set(W.teamName,we)});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(ee.teams?.onProjectBranchChange){const J=ee.teams.onProjectBranchChange((F,W)=>{if(!W?.projectPath)return;const ue=pr(W.projectPath);ue&&oe.setState(ie=>ie.branchByPath[ue]===W.branch?{}:{branchByPath:{...ie.branchByPath,[ue]:W.branch}})});typeof J=="function"&&e.push(J)}if(ee.teams?.onToolApprovalEvent){const J=ee.teams.onToolApprovalEvent((ue,ie)=>{const le=ie;if("autoResolved"in le&&le.autoResolved){const K=le.reason!=="timeout_deny";oe.setState(pe=>{const we=new Map(pe.resolvedApprovals);return we.set(le.requestId,K),{pendingApprovals:pe.pendingApprovals.filter(Ee=>!(Ee.runId===le.runId&&Ee.requestId===le.requestId)),resolvedApprovals:we}})}else if("dismissed"in le&&le.dismissed){const K=le;oe.setState(pe=>({pendingApprovals:pe.pendingApprovals.filter(we=>!(we.teamName===K.teamName&&we.runId===K.runId))}))}else{const K=le;oe.setState(pe=>({pendingApprovals:[...pe.pendingApprovals,K]}))}});typeof J=="function"&&e.push(J);const F=oe.getState().toolApprovalSettings,W=oe.getState().selectedTeamName??"__global__";ee.teams.updateToolApprovalSettings?.(W,F).catch(()=>{})}if(ee.editor?.onEditorChange){const J=ee.editor.onEditorChange(F=>{const W=oe.getState();W.editorProjectPath&&W.handleExternalFileChange(F)});typeof J=="function"&&e.push(J)}if(ee.schedules?.onScheduleChange){const J=ee.schedules.onScheduleChange((F,W)=>{const ue=W;ue?.scheduleId&&oe.getState().applyScheduleChange(ue.scheduleId)});typeof J=="function"&&e.push(J)}let ge=null;if(ee.cliInstaller?.onProgress){const J=ee.cliInstaller.onProgress((F,W)=>{const ue=W;ue.type!=="completed"&&ge&&(clearTimeout(ge),ge=null);const ie=ue.detail??null;switch(ue.type){case"checking":oe.setState({cliInstallerState:"checking",cliInstallerDetail:ie});break;case"downloading":oe.setState({cliInstallerState:"downloading",cliDownloadProgress:ue.percent??0,cliDownloadTransferred:ue.transferred??0,cliDownloadTotal:ue.total??0,cliInstallerDetail:ie});break;case"verifying":oe.setState({cliInstallerState:"verifying",cliInstallerDetail:ie});break;case"installing":{const le=oe.getState().cliInstallerLogs,K=oe.getState().cliInstallerRawChunks,pe=ie?[...le,ie].slice(-50):le,we=ue.rawChunk?[...K,ue.rawChunk].slice(-200):K;oe.setState({cliInstallerState:"installing",cliInstallerDetail:ie,cliInstallerLogs:pe,cliInstallerRawChunks:we});break}case"completed":{const le=oe.getState().appConfig?.general?.multimodelEnabled??!1;e_({multimodelEnabled:le,bootstrapCliStatus:oe.getState().bootstrapCliStatus,fetchCliStatus:oe.getState().fetchCliStatus})}oe.setState({cliInstallerState:"completed",cliCompletedVersion:ue.version??null,cliInstallerDetail:null}),ge=setTimeout(()=>{ge=null,oe.getState().cliInstallerState==="completed"&&oe.setState({cliInstallerState:"idle"})},3e3);break;case"error":oe.setState({cliInstallerState:"error",cliInstallerError:ue.error??"Unknown error"});break;case"status":if(ue.status){let le=[];oe.setState(K=>{const pe=MQ(K.cliStatus,ue.status),we=cvt(pe);return le=uvt(pe),{cliStatus:pe,cliProviderStatusLoading:we.length>0?{...K.cliProviderStatusLoading,...Object.fromEntries(we.map(Ee=>[Ee,!0]))}:K.cliProviderStatusLoading}});for(const K of le)oe.getState().fetchCliProviderStatus(K,{silent:!1})}break}});typeof J=="function"&&e.push(()=>{J(),ge&&(clearTimeout(ge),ge=null)})}if(ee.ssh?.onStatus){const J=ee.ssh.onStatus((F,W)=>{const ue=W;oe.getState().setConnectionStatus(ue.state,ue.host,ue.error)});typeof J=="function"&&e.push(J)}if(ee.context?.onChanged){const J=ee.context.onChanged((F,W)=>{const{id:ue}=W,ie=oe.getState().activeContextId;ue!==ie&&oe.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 L5t=()=>{const e=oe(r=>r.isContextSwitching),t=oe(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:"正在加载工作区"})]})]})})},j5t="1.5.9",X5t={version:j5t},U5t="https://github.com/yancyuu/Hermit/issues/new",z5t=120,B5t=1800,F5t=1200,Y5t=12e3,V5t=8e3,DZ=(e,t)=>e.length<=t?e:`${e.slice(0,t)}
|
|
1036
|
+
`)}`;i!==QL&&(QL=i,W0&&clearTimeout(W0),W0=setTimeout(()=>{W0=null,ee.editor.setWatchedDirs(s)},m2t))}let r0=0;const vx=new Map,g2t=2e3;function _2t(e){try{const t=window.requestIdleCallback;if(typeof t=="function"){t(e,{timeout:2e3});return}}catch{}setTimeout(e,150)}const b2t=(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=NR(r),a=al(o),c=al(n),l=Yc(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=aL(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){xs.info("revealAndOpenFile: tree not loaded yet, deferring reveal");return}const a=NR(r),c=al(a),l=al(n),d=Yc(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=aL(m,h[O]??""),await i(m)}o(n),e({editorPendingRevealFile:null})},openEditor:async n=>{const r=++r0;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 ee.editor.open(n);const i=performance.now()-s;if(r0!==r||t().editorProjectPath!==n)return;const o=performance.now(),a=await ee.editor.readDir(n),c=performance.now()-o;if(r0!==r||t().editorProjectPath!==n)return;const l=performance.now();e({editorFileTree:a.entries,editorFileTreeLoading:!1});const d=performance.now()-l;xs.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}})();_2t(()=>{r0!==r||t().editorProjectPath!==n||(p&&t().toggleWatcher(!0),setTimeout(()=>{r0!==r||t().editorProjectPath!==n||t().fetchGitStatus()},1200))})}catch(s){if(r0!==r||t().editorProjectPath!==n)return;const i=s instanceof Error?s.message:String(s);xs.error("Failed to open editor:",i),e({editorFileTreeLoading:!1,editorFileTreeError:i})}},closeEditor:()=>{r0++,q0&&(clearTimeout(q0),q0=null),W0&&(clearTimeout(W0),W0=null),ML="",QL="",hd.clear(),vx.clear(),ee.editor.close().catch(n=>{xs.error("editor:close failed:",n)}),Dp.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 ee.editor.readDir(n),i=performance.now()-r,o=performance.now();e({editorFileTree:s.entries,editorFileTreeLoading:!1});const a=performance.now()-o;xs.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);xs.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 ee.editor.readDir(n),a=performance.now()-i,c=t().editorFileTree,l=performance.now(),d=Ase(c??[],n,o.entries),p=performance.now()-l,f=performance.now();e({editorFileTree:d});const h=performance.now()-f;xs.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);xs.error("Failed to expand directory:",o);const a=t().editorExpandedDirs;e({editorExpandedDirs:di(a,n)})}},collapseDirectory:n=>{const{editorExpandedDirs:r}=t();e({editorExpandedDirs:di(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=kf(n)||"file",o=pY(i),a={id:n,filePath:n,fileName:i,language:o},c=gI([...r,a]);e({editorOpenTabs:c,editorActiveTabId:a.id}),Q1(t)},closeEditorTab:n=>{const{editorOpenTabs:r,editorActiveTabId:s,editorModifiedFiles:i,editorSaveError:o}=t(),a=r.filter(f=>f.id!==n),c=di(i,n),l=di(o,n);Dp.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=gI(a);e({editorOpenTabs:p,editorActiveTabId:d,editorModifiedFiles:c,editorSaveError:l}),Q1(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:di(r,n)})},saveFile:async n=>{const r=Dp.getContent(n);if(r===null){xs.error("saveFile: no content available for",n);return}e(s=>({editorSaving:{...s.editorSaving,[n]:!0},editorSaveError:di(s.editorSaveError,n)}));try{const s=t().editorFileMtimes[n],i=await ee.editor.writeFile(n,r,s);hd.set(n,Date.now()),e(o=>({editorModifiedFiles:di(o.editorModifiedFiles,n),editorSaving:di(o.editorSaving,n),editorFileMtimes:{...o.editorFileMtimes,[n]:i.mtimeMs},editorExternalChanges:di(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")){xs.error("Save conflict detected:",n),e(o=>({editorSaving:di(o.editorSaving,n),editorConflictFile:n}));return}xs.error("Failed to save file:",i),e(o=>({editorSaving:di(o.editorSaving,n),editorSaveError:{...o.editorSaveError,[n]:i}}))}},saveAllFiles:async()=>{const{editorModifiedFiles:n}=t(),r=Dp.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 ee.editor.writeFile(i,o,a);hd.set(i,Date.now()),e(l=>({editorModifiedFiles:di(l.editorModifiedFiles,i),editorSaving:di(l.editorSaving,i),editorFileMtimes:{...l.editorFileMtimes,[i]:c.mtimeMs},editorExternalChanges:di(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")){xs.error("Save conflict detected:",i),e(l=>({editorSaving:di(l.editorSaving,i),editorConflictFile:i}));return}xs.error("Failed to save file:",i,c),e(l=>({editorSaving:di(l.editorSaving,i),editorSaveError:{...l.editorSaveError,[i]:c}}))}})());await Promise.allSettled(s)},discardChanges:n=>{const{editorModifiedFiles:r,editorSaveError:s}=t();e({editorModifiedFiles:di(r,n),editorSaveError:di(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 ee.editor.createFile(n,r);return await s0(t,e,n),e({editorCreating:!1}),s.filePath}catch(s){const i=s instanceof Error?s.message:String(s);return xs.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 ee.editor.createDir(n,r);return await s0(t,e,n),e({editorCreating:!1}),s.dirPath}catch(s){const i=s instanceof Error?s.message:String(s);return xs.error("Failed to create directory:",i),e({editorCreating:!1,editorCreateError:i}),null}},deleteFileFromTree:async n=>{try{await ee.editor.deleteFile(n);const{editorOpenTabs:r}=t(),s=r.filter(o=>zSt(n,o.filePath));for(const o of s)t().closeEditorTab(o.id);const i=n.substring(0,F0(n));return i&&await s0(t,e,i),!0}catch(r){const s=r instanceof Error?r.message:String(r);return xs.error("Failed to delete file:",s),!1}},moveFileInTree:async(n,r)=>{const{editorSaving:s}=t();if(s[n])return xs.error("moveFileInTree: blocked — file is being saved:",n),!1;try{const i=await ee.editor.moveFile(n,r),{newPath:o,isDirectory:a}=i,c=n.substring(0,F0(n));vx.set(n,Date.now()),vx.set(o,Date.now()),e(d=>{const p=d.editorOpenTabs.map(f=>{const h=wh(f.filePath,n,o);if(h===f.filePath)return f;const m=kf(h)||"file";return{...f,id:h,filePath:h,fileName:m,language:pY(m)}});return{editorOpenTabs:gI(p),editorActiveTabId:wh(d.editorActiveTabId??"",n,o)||d.editorActiveTabId,editorModifiedFiles:Il(d.editorModifiedFiles,n,o),editorSaving:Il(d.editorSaving,n,o),editorSaveError:Il(d.editorSaveError,n,o),editorFileLoading:Il(d.editorFileLoading,n,o),editorExternalChanges:Il(d.editorExternalChanges,n,o),editorFileMtimes:Il(d.editorFileMtimes,n,o),editorExpandedDirs:Il(d.editorExpandedDirs,n,o)}}),Q1(t);const{editorOpenTabs:l}=t();for(const d of l){const p=KOe(d.filePath,n,o);p!==d.filePath&&Dp.remapState(p,d.filePath)}a||Dp.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=wh(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[...hd.entries()]){const f=wh(d,n,o);f!==d&&(hd.delete(d),hd.set(f,p))}return s0(t,e,c),s0(t,e,r),t().fetchGitStatus(),!0}catch(i){const o=i instanceof Error?i.message:String(i);return xs.error("moveFileInTree failed:",o),!1}},renameFileInTree:async(n,r)=>{const{editorSaving:s}=t();if(s[n])return xs.error("renameFileInTree: blocked — file is being saved:",n),!1;try{const i=await ee.editor.renameFile(n,r),{newPath:o,isDirectory:a}=i,c=n.substring(0,F0(n));vx.set(n,Date.now()),vx.set(o,Date.now()),e(d=>{const p=d.editorOpenTabs.map(f=>{const h=wh(f.filePath,n,o);if(h===f.filePath)return f;const m=kf(h)||"file";return{...f,id:h,filePath:h,fileName:m,language:pY(m)}});return{editorOpenTabs:gI(p),editorActiveTabId:wh(d.editorActiveTabId??"",n,o)||d.editorActiveTabId,editorModifiedFiles:Il(d.editorModifiedFiles,n,o),editorSaving:Il(d.editorSaving,n,o),editorSaveError:Il(d.editorSaveError,n,o),editorFileLoading:Il(d.editorFileLoading,n,o),editorExternalChanges:Il(d.editorExternalChanges,n,o),editorFileMtimes:Il(d.editorFileMtimes,n,o),editorExpandedDirs:Il(d.editorExpandedDirs,n,o)}}),Q1(t);const{editorOpenTabs:l}=t();for(const d of l){const p=KOe(d.filePath,n,o);p!==d.filePath&&Dp.remapState(p,d.filePath)}a||Dp.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=wh(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[...hd.entries()]){const f=wh(d,n,o);f!==d&&(hd.delete(d),hd.set(f,p))}return s0(t,e,c),t().fetchGitStatus(),!0}catch(i){const o=i instanceof Error?i.message:String(i);return xs.error("renameFileInTree failed:",o),!1}},fetchGitStatus:async()=>{e({editorGitLoading:!0});try{const n=performance.now(),r=await ee.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;xs.info(`[perf] fetchGitStatus: IPC=${s.toFixed(1)}ms, set=${o.toFixed(1)}ms, files=${r.files.length}`)}catch(n){xs.error("Failed to fetch git status:",n),e({editorGitLoading:!1})}},toggleWatcher:async n=>{try{await ee.editor.watchDir(n),e({editorWatcherEnabled:n});try{localStorage.setItem("editor-watcher-enabled",String(n))}catch{}n?(Q1(t),OY(t)):(ML="",QL="",ee.editor.setWatchedFiles([]),ee.editor.setWatchedDirs([]))}catch(r){xs.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=>{_I[n.type]=(_I[n.type]??0)+1,mY||(mY=setTimeout(()=>{mY=null;const l=_I;_I={change:0,create:0,delete:0},xs.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=hd.get(n.path);if(o&&Date.now()-o<p2t)return;const a=vx.get(n.path);if(a&&Date.now()-a<g2t)return;if((r.some(l=>l.filePath===n.path)||n.type==="delete")&&e(l=>({editorExternalChanges:{...l.editorExternalChanges,[n.path]:n.type}})),fY||(fY=setTimeout(()=>{fY=null,t().fetchGitStatus()},f2t)),n.type==="create"||n.type==="delete"){d2t();const l=n.path.substring(0,F0(n.path));if(l&&s){const d=hY.get(l);d&&clearTimeout(d);const p=setTimeout(()=>{hY.delete(l),s0(t,e,l)},h2t);hY.set(l,p)}}},clearExternalChange:n=>{e(r=>({editorExternalChanges:di(r.editorExternalChanges,n)}))},setFileMtime:(n,r)=>{e(s=>({editorFileMtimes:{...s.editorFileMtimes,[n]:r}}))},forceOverwrite:async n=>{const r=Dp.getContent(n);if(r===null){xs.error("forceOverwrite: no content available for",n);return}e(s=>({editorSaving:{...s.editorSaving,[n]:!0},editorConflictFile:null}));try{const s=await ee.editor.writeFile(n,r);hd.set(n,Date.now()),e(i=>({editorModifiedFiles:di(i.editorModifiedFiles,n),editorSaving:di(i.editorSaving,n),editorFileMtimes:{...i.editorFileMtimes,[n]:s.mtimeMs},editorExternalChanges:di(i.editorExternalChanges,n)}));try{localStorage.removeItem(`editor-draft:${n}`)}catch{}}catch(s){const i=s instanceof Error?s.message:String(s);xs.error("Failed to force overwrite:",i),e(o=>({editorSaving:di(o.editorSaving,n),editorSaveError:{...o.editorSaveError,[n]:i}}))}},resolveConflict:()=>{e({editorConflictFile:null})}});async function s0(e,t,n){try{const r=performance.now(),s=await ee.editor.readDir(n);xs.info(`[perf] refreshDirectory: IPC=${(performance.now()-r).toFixed(1)}ms, entries=${s.entries.length}, dir=${kf(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=Ase(i,n,s.entries);t({editorFileTree:a})}}catch(r){xs.error("Failed to refresh directory:",r)}}function wh(e,t,n){const r=al(t),s=al(e);if(r.length===0)return e;const i=Yc(t)||Yc(e)||Yc(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?aL(n,...c):n}function KOe(e,t,n){const r=al(n),s=al(e);if(r.length===0)return e;const i=Yc(t)||Yc(e)||Yc(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?aL(t,...c):t}function Il(e,t,n){const r={};let s=!1;for(const[i,o]of Object.entries(e)){const a=wh(i,t,n);a!==i&&(s=!0),r[a]=o}return s?r:e}function Ase(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=Ase(i.children,t,n);if(o!==i.children)return r=!0,{...i,children:o}}return i});return r?s:e}function JOe(e,t,n){return t==="project"||t==="local"?`plugin:${e}:${t}:${bT(n)}`:`plugin:${e}:${t}`}function sP(e,t,n){return t==="project"||t==="local"?`mcp:${e}:${t}:${bT(n)}`:`mcp:${e}:${t}`}function HQ(e,t){return t?`mcp-diagnostic:${t}:${e}`:`mcp-diagnostic:${e}`}function bT(e){return e??"__global__"}function y2t(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 ege={local:0,project:1,global:2,user:2};function rXe(e){return e.length===0?null:[...e].sort((t,n)=>ege[t.scope]-ege[n.scope])[0]}function sXe(e){const t=Array.from(new Set(e.map(n=>n.scope)));return y2t(t)}function JO(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=>jfe(UA(p,"mcp"))).length>0?null:i.map(p=>UA(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=>jfe(UA(l,"plugins")));return a.length===0?i.map(d=>UA(d,"plugins").reason).find(d=>typeof d=="string"&&d.trim().length>0)??"当前运行时不支持安装插件。":t||a.find(l=>l.authenticated)?null:`${a[0]?.displayName??"Anthropic"} 未连接。请打开首页登录。`}function DL(e){return e.toLowerCase().replace(/\s+/g,"-").replace(/[^\w.-]/g,"")}function Ise(e){return e==="agent_teams_orchestrator"?"global":"user"}function iXe(e){return e==="user"||e==="global"}function ku(e){return e==="project"||e==="local"}function yZ(e,t){switch(e){case"global":return"全局";case"user":return t==="agent_teams_orchestrator"?"用户(旧版)":"用户(全局)";case"project":return"项目";case"local":return"本地";default:return e}}function Fl(e,t){return e.panes.find(n=>n.id===t)}function jh(e,t){return e.panes.find(n=>n.tabs.some(r=>r.id===t))}function ro(e,t){return{...e,panes:e.panes.map(n=>n.id===t.id?t:n)}}function ek(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=oXe(o);let c=e.focusedPaneId;return e.focusedPaneId===t&&(c=a[Math.min(n,a.length-1)].id),{panes:a,focusedPaneId:c}}function tge(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:oXe(o)}}function oXe(e){if(e.length===0)return e;const t=1/e.length;return e.map(n=>({...n,widthFraction:t}))}function aXe(e){const t=Fl(e,e.focusedPaneId);return t?{openTabs:t.tabs,activeTabId:t.activeTabId,selectedTabIds:t.selectedTabIds}:{openTabs:[],activeTabId:null,selectedTabIds:[]}}function xu(e){return e.panes.flatMap(t=>t.tabs)}function nge(e){return{id:e,tabs:[],activeTabId:null,selectedTabIds:[],widthFraction:0}}let Tx=null,gY=0;const iP=new Map,oP=new Map,_Y=new Map;let x2t=0,S2t=0;const bY=new Map,yY=new Map,v2t="__user__";function xY(e){return Object.values(e).some(Boolean)}function T2t(e){return e??"__user__"}function bI(e){return new Set(e.map(t=>t.pluginId))}function xZ(e,t){return e.startsWith(`plugin:${t}:`)}function rge(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=>xZ(o,a))&&delete r[o];for(const o of Object.keys(s))i.some(a=>xZ(o,a))&&delete s[o];return{pluginInstallProgress:r,installErrors:s}}function Ah(e){const t=iP.get(e);t&&(clearTimeout(t),iP.delete(e))}function sge(e){const t=Array.from(e);for(const n of Array.from(iP.keys()))t.some(r=>xZ(n,r))&&Ah(n)}function ige(e,t){Ah(e);const n=setTimeout(()=>{iP.delete(e),t(r=>r.pluginInstallProgress[e]!=="success"?{}:{pluginInstallProgress:{...r.pluginInstallProgress,[e]:"idle"}})},lXe);iP.set(e,n)}function E2t(e,t,n){return t==="project"||t==="local"?`mcp-custom:${e}:${t}:${bT(n)}`:`mcp-custom:${e}:${t}`}function SZ(e){return e.includes(":project:")||e.endsWith(":project")||e.includes(":local:")||e.endsWith(":local")}function gu(e){const t=oP.get(e);t&&(clearTimeout(t),oP.delete(e))}function SY(e,t){gu(e);const n=setTimeout(()=>{oP.delete(e),t(r=>r.mcpInstallProgress[e]!=="success"?{}:{mcpInstallProgress:{...r.mcpInstallProgress,[e]:"idle"}})},lXe);oP.set(e,n)}function w2t(e,t){const n={...e},r={...t};for(const s of Object.keys(n))(s.startsWith("mcp:")||s.startsWith("mcp-custom:"))&&SZ(s)&&delete n[s];for(const s of Object.keys(r))(s.startsWith("mcp:")||s.startsWith("mcp-custom:"))&&SZ(s)&&delete r[s];return{mcpInstallProgress:n,installErrors:r}}function k2t(){for(const e of Array.from(oP.keys()))SZ(e)&&gu(e)}function C2t(e){return e??v2t}function R2t(e,t){const n=e.filter(r=>r.id!==t.id);return[t,...n]}const lXe=2e3,oge="Project- and local-scoped plugins require an active project in the Extensions tab.";function i0(e){return e_({multimodelEnabled:e.appConfig?.general?.multimodelEnabled??!1,bootstrapCliStatus:e.bootstrapCliStatus,fetchCliStatus:e.fetchCliStatus})}function D1(e){return{cliStatus:e.cliStatus,cliStatusLoading:e.cliStatus===null&&e.cliStatusLoading}}const P2t=(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(!ee.plugins)return;const s=T2t(n);if(Tx&&!r&&Tx.key===s){await Tx.promise;return}const i=++gY,o=Symbol("pluginCatalogRequest");e({pluginCatalogLoading:!0,pluginCatalogError:null});let a=null;a=(async()=>{try{const c=await ee.plugins.getAll(n,r);e(l=>{if(i!==gY)return{};const d=n??null,f=l.pluginCatalogProjectPath===d?new Set:new Set([...bI(l.pluginCatalog),...bI(c)]),h=rge(f,l.pluginInstallProgress,l.installErrors);return sge(f),{pluginCatalog:c,pluginCatalogLoading:!1,pluginCatalogError:null,pluginCatalogProjectPath:d,pluginInstallProgress:h.pluginInstallProgress,installErrors:h.installErrors}})}catch(c){e(l=>{if(i!==gY)return{};const d=n??null,p=l.pluginCatalogProjectPath===d,f=rge(p?new Set:bI(l.pluginCatalog),l.pluginInstallProgress,l.installErrors);return sge(p?new Set:bI(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{Tx?.token===o&&(Tx=null)}})(),Tx={key:s,promise:a,token:o},await a},fetchPluginReadme:n=>{if(!ee.plugins)return;const r=t(),s=r.pluginReadmes[n];s!=null||r.pluginReadmeLoading[n]||(e(i=>({pluginReadmeLoading:{...i.pluginReadmeLoading,[n]:!0}})),ee.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(ee.mcpRegistry){e({mcpBrowseLoading:!0,mcpBrowseError:null});try{const r=await ee.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(ee.mcpRegistry)try{const r=await ee.mcpRegistry.getInstalled(n);e(s=>{const i=n??null,o=bT(i),a=s.mcpInstalledProjectPath===i,c=a?{mcpInstallProgress:s.mcpInstallProgress,installErrors:s.installErrors}:w2t(s.mcpInstallProgress,s.installErrors);return a||k2t(),{mcpInstalledServers:r,mcpInstalledServersByProjectPath:{...s.mcpInstalledServersByProjectPath,[o]:r},mcpInstalledProjectPath:i,mcpInstallProgress:c.mcpInstallProgress,installErrors:c.installErrors}})}catch{}},runMcpDiagnostics:async n=>{const r=ee.mcpRegistry;if(!r)return;const s=bT(n),i=_Y.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=>[HQ(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{_Y.delete(s)}})();_Y.set(s,o),await o},fetchSkillsCatalog:async n=>{if(!ee.skills)return;const r=C2t(n),s=++x2t;bY.set(r,s),e(i=>{const o={...i.skillsCatalogLoadingByProjectPath,[r]:!0};return{skillsCatalogLoadingByProjectPath:o,skillsCatalogErrorByProjectPath:{...i.skillsCatalogErrorByProjectPath,[r]:null},skillsLoading:xY(o),skillsError:null}});try{const i=await ee.skills.list(n);if(bY.get(r)!==s)return;e(o=>({skillsCatalogLoadingByProjectPath:{...o.skillsCatalogLoadingByProjectPath,[r]:!1},skillsCatalogErrorByProjectPath:{...o.skillsCatalogErrorByProjectPath,[r]:null},skillsLoading:xY({...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(bY.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:xY({...a.skillsCatalogLoadingByProjectPath,[r]:!1}),skillsError:o}))}},fetchSkillDetail:async(n,r)=>{if(!ee.skills)return;const s=++S2t;yY.set(n,s),e(i=>({skillsDetailLoadingById:{...i.skillsDetailLoadingById,[n]:!0},skillsDetailErrorById:{...i.skillsDetailErrorById,[n]:null}}));try{const i=await ee.skills.getDetail(n,r);if(yY.get(n)!==s)return;e(o=>({skillsDetailsById:{...o.skillsDetailsById,[n]:i},skillsDetailLoadingById:{...o.skillsDetailLoadingById,[n]:!1},skillsDetailErrorById:{...o.skillsDetailErrorById,[n]:null}}))}catch(i){if(yY.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(!ee.skills)throw new Error("Skills API is not available");e({skillsMutationLoading:!0,skillsMutationError:null});try{const r=await ee.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(!ee.skills)throw new Error("Skills API is not available");e({skillsMutationLoading:!0,skillsMutationError:null});try{const r=await ee.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(!ee.skills)throw new Error("Skills API is not available");e({skillsMutationLoading:!0,skillsMutationError:null});try{const r=await ee.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(!ee.skills)throw new Error("Skills API is not available");e({skillsMutationLoading:!0,skillsMutationError:null});try{const r=await ee.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(!ee.skills)throw new Error("Skills API is not available");e({skillsMutationLoading:!0,skillsMutationError:null});try{await ee.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(!ee.plugins)return;const r=t().pluginCatalogProjectPath??void 0,s=n.scope!=="user"?n.projectPath??t().pluginCatalogProjectPath??void 0:n.projectPath,i=JOe(n.pluginId,n.scope,s),o=s===n.projectPath?n:{...n,projectPath:s},a=t();if(a.cliStatus===null)try{await i0(a)}catch{}const c=D1(t()),l=o.scope!=="user"&&!o.projectPath?oge:JO({isInstalled:!1,...c,section:"plugins"});if(l){Ah(i),e(d=>({pluginInstallProgress:{...d.pluginInstallProgress,[i]:"error"},installErrors:{...d.installErrors,[i]:l}}));return}Ah(i),e(d=>({pluginInstallProgress:{...d.pluginInstallProgress,[i]:"pending"},installErrors:{...d.installErrors,[i]:""}}));try{const d=await ee.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),ige(i,e)}catch(d){Ah(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(!ee.plugins)return;const i=t().pluginCatalogProjectPath??void 0,o=r??"user",a=o!=="user"?s??t().pluginCatalogProjectPath??void 0:s,c=JOe(n,o,a);if(o!=="user"&&!a){Ah(c),e(p=>({pluginInstallProgress:{...p.pluginInstallProgress,[c]:"error"},installErrors:{...p.installErrors,[c]:oge}}));return}const l=t();if(l.cliStatus===null)try{await i0(l)}catch{}const d=JO({isInstalled:!0,...D1(t()),section:"plugins"});if(d){Ah(c),e(p=>({pluginInstallProgress:{...p.pluginInstallProgress,[c]:"error"},installErrors:{...p.installErrors,[c]:d}}));return}Ah(c),e(p=>({pluginInstallProgress:{...p.pluginInstallProgress,[c]:"pending"}}));try{const p=await ee.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),ige(c,e)}catch(p){Ah(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=sP(n.registryId,n.scope,n.projectPath);if(!ee.mcpRegistry){gu(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 i0(s)}catch{}const i=JO({isInstalled:!1,...D1(t()),section:"mcp"});if(i){gu(r),e(o=>({mcpInstallProgress:{...o.mcpInstallProgress,[r]:"error"},installErrors:{...o.installErrors,[r]:i}}));return}gu(r),e(o=>({mcpInstallProgress:{...o.mcpInstallProgress,[r]:"pending"}}));try{const o=await ee.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"}})),SY(r,e)}catch(o){gu(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=E2t(n.serverName,r,n.projectPath);try{if(!ee.mcpRegistry)throw new Error("MCP Registry not available");const i=t();if(i.cliStatus===null)try{await i0(i)}catch{}const o=JO({isInstalled:!1,...D1(t()),section:"mcp"});if(o)throw new Error(o);gu(s),e(c=>({mcpInstallProgress:{...c.mcpInstallProgress,[s]:"pending"}}));const a=await ee.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"}})),SY(s,e)}catch(i){gu(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"||ku(s)?s:"user",a=sP(n,o,i);if(!ee.mcpRegistry){gu(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 i0(c)}catch{}const l=JO({isInstalled:!0,...D1(t()),section:"mcp"});if(l){gu(a),e(d=>({mcpInstallProgress:{...d.mcpInstallProgress,[a]:"error"},installErrors:{...d.installErrors,[a]:l}}));return}gu(a),e(d=>({mcpInstallProgress:{...d.mcpInstallProgress,[a]:"pending"}}));try{const d=await ee.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"}})),SY(a,e)}catch(d){gu(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(ee.apiKeys){e({apiKeysLoading:!0,apiKeysError:null});try{const n=await ee.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(ee.apiKeys)try{const n=await ee.apiKeys.getStorageStatus();e({apiKeyStorageStatus:n})}catch{}},saveApiKey:async n=>{if(ee.apiKeys){e({apiKeySaving:!0,apiKeysError:null});try{const r=await ee.apiKeys.save(n),s=[];try{const o=await ee.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:R2t(a.apiKeys,r)}))}await i0(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(ee.apiKeys)try{await ee.apiKeys.delete(n),e(s=>({apiKeys:s.apiKeys.filter(i=>i.id!==n)})),await i0(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=jh(n.paneLayout,i.id);o&&e({paneLayout:ro(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=>{!ee.mcpRegistry||n.length===0||ee.mcpRegistry.githubStars(n).then(r=>{Object.keys(r).length>0&&e(s=>({mcpGitHubStars:{...s.mcpGitHubStars,...r}}))}).catch(()=>{})}}),age=50;function vZ(e,t){return e.find(n=>n.type==="session"&&n.sessionId===t)}function cXe(e,t,n){return e.find(r=>r.type==="session"&&r.sessionId===t&&r.projectId===n)}function TZ(e){return e.length<=age?e:e.slice(0,age-1)+"…"}function $2t(e,t="notification",n){return{id:crypto.randomUUID(),kind:"error",source:t,highlight:n??"red",payload:e}}function lge(e){return{id:crypto.randomUUID(),kind:"search",source:"commandPalette",highlight:"yellow",payload:e}}function N2t(e){return e.kind==="error"}function A2t(e){return e.kind==="search"}const yI=eo("Store:notification"),I2t=200,M2t=(e,t)=>({notifications:[],unreadCount:0,notificationsLoading:!1,notificationsError:null,fetchNotifications:async()=>{e({notificationsLoading:!0,notificationsError:null});try{const n=await ee.notifications.get({limit:I2t,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 ee.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){yI.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=>ee.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 ee.notifications.markAllRead()){await t().fetchNotifications();return}e(s=>({notifications:s.notifications.map(i=>({...i,isRead:!0})),unreadCount:0}))}}catch(r){yI.error("Failed to mark all notifications as read:",r)}},deleteNotification:async n=>{try{if(!await ee.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){yI.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=>ee.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 ee.notifications.clear()){await t().fetchNotifications();return}e({notifications:[],unreadCount:0})}}catch(r){yI.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=$2t({errorId:n.id,errorTimestamp:n.timestamp,toolUseId:n.toolUseId,subagentId:n.subagentId,lineNumber:n.lineNumber},"notification",n.triggerColor),i=xu(r.paneLayout),o=cXe(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"})}}),LL=4;function Ex(e){const t=aXe(e);return{paneLayout:e,openTabs:t.openTabs,activeTabId:t.activeTabId,selectedTabIds:t.selectedTabIds}}const Q2t=(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=Fl(s,n);if(!i)return;const o={...s,focusedPaneId:n};e(Ex(o)),i.activeTabId&&t().setActiveTab(i.activeTabId)},splitPane:(n,r,s)=>{const i=t(),{paneLayout:o}=i;if(o.panes.length>=LL)return;const a=Fl(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={...nge(f),tabs:[c],activeTabId:c.id};let m=ro(o,p);l.length===0&&o.panes.length>1&&(m=ek(m,n)),m=tge(m,p.id!==n?o.panes[0].id:n,h,s),m={...m,focusedPaneId:f},e(Ex(m)),c.type==="session"&&t().setActiveTab(c.id)},closePane:n=>{const r=t(),{paneLayout:s}=r;if(s.panes.length<=1)return;const i=Fl(s,n);if(!i)return;for(const c of i.tabs)r.cleanupTabUIState(c.id),r.cleanupTabSessionData(c.id);const o=ek(s,n);e(Ex(o));const a=Fl(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=Fl(a,r),l=Fl(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=ro(a,{...c,tabs:p,activeTabId:f,selectedTabIds:c.selectedTabIds.filter(O=>O!==n)});m=ro(m,{...l,tabs:h,activeTabId:d.id}),p.length===0&&m.panes.length>1&&(m=ek(m,r)),m={...m,focusedPaneId:s},e(Ex(m))},moveTabToNewPane:(n,r,s,i)=>{const o=t(),{paneLayout:a}=o;if(a.panes.length>=LL)return;const c=Fl(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={...nge(f),tabs:[l],activeTabId:l.id};let m=ro(a,{...c,tabs:d,activeTabId:p,selectedTabIds:c.selectedTabIds.filter(O=>O!==n)});d.length===0&&m.panes.length>1&&(m=ek(m,r)),m=tge(m,s,h,i),m={...m,focusedPaneId:f},e(Ex(m))},reorderTabInPane:(n,r,s)=>{const{paneLayout:i}=t(),o=Fl(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=ro(i,{...o,tabs:a});e(Ex(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=>jh(t().paneLayout,n)?.id??null,getAllPaneTabs:()=>xu(t().paneLayout)}),D2t=(e,t)=>({projects:[],selectedProjectId:null,projectsLoading:!1,projectsError:null,fetchProjects:async()=>{if(!t().projectsLoading){e({projectsLoading:!0,projectsError:null});try{const r=[...await ee.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,...Kh()}),t().fetchSessionsInitial(n)}}),vY=eo("Store:repository"),L2t=3e4;async function j2t(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 X2t=(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 j2t(ee.getRepositoryGroups(),L2t,"get-repository-groups");e({repositoryGroups:r,repositoryGroupsLoading:!1});const s=Date.now()-n;s>=2e3&&vY.warn(`fetchRepositoryGroups slow ms=${s} count=${r.length}`)}catch(r){const s=Date.now()-n;vY.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){vY.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,...Kh()}),t().fetchSessionsInitial(o.id)):e({selectedRepositoryId:n,selectedWorktreeId:null,...Kh()})},selectWorktree:n=>{e({selectedWorktreeId:n,selectedProjectId:n,activeProjectId:n,...Kh()}),t().fetchSessionsInitial(n)},setViewMode:n=>{e({viewMode:n,selectedRepositoryId:null,selectedWorktreeId:null,selectedProjectId:null,...Kh()}),n==="grouped"?t().fetchRepositoryGroups():t().fetchProjects()}}),xI=eo("scheduleSlice"),U2t=(e,t)=>({schedules:[],schedulesLoading:!1,schedulesError:null,scheduleRuns:{},scheduleRunsLoading:{},async fetchSchedules(){if(!t().schedulesLoading){e({schedulesLoading:!0,schedulesError:null});try{const n=await ee.schedules.list();e({schedules:n,schedulesLoading:!1})}catch(n){const r=n instanceof Error?n.message:"Failed to fetch schedules";xI.error("fetchSchedules failed:",r),e({schedulesError:r,schedulesLoading:!1})}}},async createSchedule(n){const r=await ee.schedules.create(n);return e(s=>({schedules:[...s.schedules,r]})),r},async updateSchedule(n,r){const s=await ee.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 ee.schedules.delete(n)}catch(i){const o=i instanceof Error?i.message:"删除计划失败";throw xI.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 ee.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 ee.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 ee.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 ee.schedules.getRuns(n);e(s=>({scheduleRuns:{...s.scheduleRuns,[n]:r},scheduleRunsLoading:{...s.scheduleRunsLoading,[n]:!1}}))}catch(r){xI.error(`fetchRunHistory(${n}) failed:`,r),e(s=>({scheduleRunsLoading:{...s.scheduleRunsLoading,[n]:!1}}))}}},async applyScheduleChange(n){try{const r=await ee.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 ee.schedules.getRuns(n);e(i=>({scheduleRuns:{...i.scheduleRuns,[n]:s}}))}}catch(r){xI.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 z2t(e){return"chunkType"in e&&e.chunkType==="ai"}function B2t(e){return z2t(e)&&"semanticSteps"in e}function F2t(e){return e.type==="assistant"}function Y2t(e){return"chunkType"in e&&e.chunkType==="user"&&"rawMessages"in e}function V2t(e){return"chunkType"in e&&e.chunkType==="system"&&"rawMessages"in e}function q2t(e){return"chunkType"in e&&e.chunkType==="compact"&&"rawMessages"in e}function W2t(e){return"chunkType"in e&&"rawMessages"in e}function yT(e){return e.length===0?[]:W2t(e[0])?e:null}const hz=/[\\/]/;function Cc(e){const t=e.split(hz);return t[t.length-1]||""}function G2t(e){return e.split(hz).filter(Boolean)[0]??""}function H2t(e){return e.split(hz).filter(Boolean)}function Z2t(e){return hz.test(e)}function K2t(e){return/^\.\.?[\\/]/.test(e)}const J2t=eo("Util:groupTransformer"),cge=/\/([a-z][a-z-]{0,50})(?:\s+(\S[^\n]{0,1000}))?$/gim,uge=100;function aP(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(Y2t(l))r.push({type:"user",group:eDt(l,s++)});else if(V2t(l))r.push({type:"system",group:lDt(l)}),i++;else if(B2t(l))r.push({type:"ai",group:uDt(l,o)}),o++;else if(q2t(l))r.push({type:"compact",group:cDt(l)}),a++;else{const d="chunkType"in l?l.chunkType:"unknown";J2t.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=hDt(r,l),f=mDt(r,l);if(p&&f){const h=ODt(p),m=gDt(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 eDt(e,t){return tDt(e.userMessage,t)}function tDt(e,t){const n=nDt(e);return{id:`user-${e.uuid}`,message:e,timestamp:e.timestamp,content:n,index:t}}function nDt(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=Lvt(t),i=UU(t),o=i?[]:rDt(s);r.push(...Qse(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 rDt(e){if(!e)return[];const t=[];let n;for(cge.lastIndex=0;(n=cge.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 sDt=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"]),iDt=/[\s,)}\]]/;function oDt(e){if(/^[A-Za-z]:[\\/]/.test(e)||e.startsWith("\\\\")||K2t(e))return!0;const t=G2t(e);return!!(sDt.has(t)||Z2t(e)&&e.length>2&&(H2t(e).length>2||/\.[a-zA-Z0-9]+$/.test(e)))}function aDt(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&&!iDt.test(e[i]);)i+=1;s=e.slice(n,i)}return!s||!oDt(s)?null:{path:s,raw:e.slice(t,i),startIndex:t,endIndex:i}}function Mse(e){if(!e)return[];const t=[];let n=0;for(;n<e.length;){const r=e.indexOf("@",n);if(r<0)break;const s=aDt(e,r);s?(t.push(s),n=s.endIndex):n=r+1}return t}function Qse(e){return Mse(e).map(({path:t,raw:n})=>({path:t,raw:n}))}function lDt(e){return{id:e.id,message:e.message,timestamp:e.startTime,commandOutput:e.commandOutput}}function cDt(e){return{id:e.id,timestamp:e.startTime,message:e.message}}function uDt(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=>F2t(d))??null,a=dDt(n,o),c=pDt(n),l=fDt(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 dDt(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 pDt(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>uge?d.slice(0,uge)+"...":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 fDt(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 hDt(e,t){for(let n=t-1;n>=0;n--)if(e[n].type==="ai")return e[n].group;return null}function mDt(e,t){for(let n=t+1;n<e.length;n++)if(e[n].type==="ai")return e[n].group;return null}function ODt(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 gDt(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 uXe=500,_Dt="CLAUDE.md",dge="project-memory";function Yp(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 Vp(e,t){return e}function Dse(e){return e.startsWith("/")||e.startsWith("\\\\")||/^[a-zA-Z]:[\\/]/.test(e)}function MS(e,t){if(Dse(t))return t;const n=bDt(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=yDt(r,s),c=xDt(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 bDt(e){let t=e.length;for(;t>0;){const n=e[t-1];if(n!=="/"&&n!=="\\")break;t--}return e.slice(0,t)}function yDt(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 xDt(e){return al(e)}function LO(e){return e.replace(/\\/g,"/")}function SDt(e){const t=F0(e);return t===-1?"":e.slice(0,t)}function vDt(e){const t=F0(e);return t<=0?null:e.slice(0,t)}function TDt(e,t){const n=LO(e).replace(/\/$/,""),r=LO(t).replace(/\/$/,"");return r===n||r.startsWith(n+"/")}function dXe(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 pXe(e,t){if(!e)return[];const n=e.content.fileReferences||[],r=[];for(const s of n)if(s.path){const i=Dse(s.path)?s.path:MS(t,s.path);r.push(i)}return r}function fXe(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(...Qse(r))}return t}function hXe(e,t){const n=[],r=e.includes("\\")?"\\":"/";let s=SDt(e);for(;s&&TDt(t,s);){const i=`${s}${r}${_Dt}`;n.push(i);const o=vDt(s);if(!o||o===s)break;s=o}return n}function mXe(e,t,n){const r=[],s=v=>n?.[v]?.estimatedTokens??uXe,i=n?.enterprise?.path??"/Library/Application Support/ClaudeCode/CLAUDE.md",o=s("enterprise");o>0&&r.push({id:Yp(i),path:i,source:"enterprise",displayName:Vp(i),isGlobal:!0,estimatedTokens:o,firstSeenInGroup:t});const a="~/.claude/CLAUDE.md",c=s("user");c>0&&r.push({id:Yp(a),path:a,source:"user-memory",displayName:Vp(a),isGlobal:!0,estimatedTokens:c,firstSeenInGroup:t});const l=MS(e,"CLAUDE.md"),d=MS(e,".claude/CLAUDE.md"),p=s("project");p>0&&r.push({id:Yp(l),path:l,source:dge,displayName:Vp(l),isGlobal:!0,estimatedTokens:p,firstSeenInGroup:t});const f=s("project-alt");f>0&&r.push({id:Yp(d),path:d,source:dge,displayName:Vp(d),isGlobal:!0,estimatedTokens:f,firstSeenInGroup:t});const h=MS(e,".claude/rules/*.md"),m=s("project-rules");m>0&&r.push({id:Yp(h),path:h,source:"project-rules",displayName:Vp(h),isGlobal:!0,estimatedTokens:m,firstSeenInGroup:t});const O=MS(e,"CLAUDE.local.md"),_=s("project-local");_>0&&r.push({id:Yp(O),path:O,source:"project-local",displayName:Vp(O),isGlobal:!0,estimatedTokens:_,firstSeenInGroup:t});const b="~/.claude/rules/**/*.md",y=s("user-rules");y>0&&r.push({id:Yp(b),path:b,source:"user-rules",displayName:Vp(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:Yp(x),path:x,source:"auto-memory",displayName:Vp(x),isGlobal:!0,estimatedTokens:S,firstSeenInGroup:t}),r}function EDt(e,t){return{id:Yp(e),path:e,source:"directory",displayName:Vp(e),isGlobal:!1,estimatedTokens:uXe,firstSeenInGroup:t}}function wDt(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=mXe(i,d,a);for(const x of y)l.has(x.path)||(c.push(x),l.add(x.path))}const p=[],f=dXe(t.steps);p.push(...f);const h=pXe(n,i);p.push(...h);const m=fXe(t.responses);for(const y of m)if(y.path){const x=Dse(y.path)?y.path:MS(i,y.path);p.push(x)}for(const y of p){const x=hXe(y,i);for(const S of x){if(l.has(S)||LO(S)===`${LO(i)}/CLAUDE.md`||LO(S)===`${LO(i)}/.claude/CLAUDE.md`||LO(S)===`${LO(i)}/CLAUDE.local.md`)continue;const T=EDt(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 kDt(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=wDt({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 pge=25e3,ZQ="mentioned-file",OXe=new Set(["SendMessage","TeamCreate","TeamDelete","TaskCreate","TaskUpdate","TaskList","TaskGet"]);function CDt(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 RDt(e){return`tool-output-ai-${e}`}function PDt(e){return`thinking-text-ai-${e}`}function $Dt(e){return`task-coord-ai-${e}`}function NDt(e){return`user-msg-ai-${e}`}function TY(e){return{...e,category:"claude-md"}}function fge(e){return{id:CDt(e.path),category:ZQ,path:e.path,displayName:e.displayName,estimatedTokens:e.estimatedTokens,firstSeenTurnIndex:e.turnIndex,firstSeenInGroup:e.aiGroupId,exists:e.exists??!0}}function ADt(e,t,n,r){const s=[];let i=0;for(const o of e.values()){if(OXe.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:RDt(t),category:"tool-output",turnIndex:t,aiGroupId:n,estimatedTokens:i,toolCount:s.length,toolBreakdown:s}}function IDt(e,t,n,r){const s=[];let i=0;for(const o of e.values()){if(!OXe.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:$Dt(t),category:"task-coordination",turnIndex:t,aiGroupId:n,estimatedTokens:i,breakdown:s}}function MDt(e,t,n){const r=e.content.rawText??e.content.text??"";if(!r)return null;const s=Qo(r);if(s===0)return null;const i=r.length>80?r.slice(0,80)+"…":r;return{id:NDt(t),category:"user-message",turnIndex:t,aiGroupId:n,estimatedTokens:s,textPreview:i}}function QDt(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:PDt(t),category:"thinking-text",turnIndex:t,aiGroupId:n,estimatedTokens:s,breakdown:r}}function KQ(e){return e.startsWith("/")||e.startsWith("~/")||e.startsWith("~\\")||e==="~"||e.startsWith("\\\\")||/^[a-zA-Z]:[\\/]/.test(e)}function EY(e,t){if(KQ(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=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 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}function wx(e){return e.replace(/\\/g,"/")}function hge(e,t){return{id:Yp(e),path:e,source:"directory",displayName:Vp(e),isGlobal:!1,estimatedTokens:500,firstSeenInGroup:t}}function XDt(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=mXe(a,h,c);for(const P of w)f.has(P.path)||(p.push(TY(P)),f.add(P.path))}const m=[],O=dXe(t.steps);m.push(...O);const _=pXe(n,a);m.push(..._);const b=fXe(t.responses);for(const w of b)if(w.path){const P=KQ(w.path)?w.path:EY(a,w.path);m.push(P)}for(const w of m){const P=hXe(w,a);for(const k of P)if(!(f.has(k)||wx(k)===`${wx(a)}/CLAUDE.md`||wx(k)===`${wx(a)}/.claude/CLAUDE.md`||wx(k)===`${wx(a)}/CLAUDE.local.md`))if(d){const I=d[k];if(!I||!I.exists||I.estimatedTokens<=0)continue;const N=hge(k,h);N.estimatedTokens=I.estimatedTokens,p.push(TY(N)),f.add(k)}else{const I=hge(k,h);p.push(TY(I)),f.add(k)}}if(n?.content.fileReferences)for(const w of n.content.fileReferences){if(!w.path)continue;const P=KQ(w.path)?w.path:EY(a,w.path);if(f.has(P))continue;const k=l?.get(P);if(k&&k.exists&&k.estimatedTokens<=pge){const C=fge({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=KQ(w.path)?w.path:EY(a,w.path);if(f.has(P))continue;const k=l?.get(P);if(k&&k.exists&&k.estimatedTokens<=pge){const C=fge({path:P,displayName:w.path,estimatedTokens:k.estimatedTokens,turnIndex:t.turnIndex,aiGroupId:h,exists:k.exists});p.push(C),f.add(P)}}const y=ADt(r,t.turnIndex,h,s);y&&p.push(y);const x=IDt(r,t.turnIndex,h,s);if(x&&p.push(x),n){const w=MDt(n,t.turnIndex,h);w&&p.push(w)}if(s){const w=QDt(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 UDt(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 zDt(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 BDt(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=Cre(x.steps,x.responses));let v=x.displayItems;if(!v&&x.steps&&x.steps.length>0){const E=Rre(x.steps,x.isOngoing??!1);v=w2e(x.steps,E,x.processes||[],x.responses)}const T=XDt({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=UDt(_),w=zDt(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 EZ(e,t){if(FDt(t))return t;const n=YDt(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=VDt(r,s),c=qDt(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 FDt(e){return e.startsWith("/")||e.startsWith("\\\\")||/^[a-zA-Z]:[\\/]/.test(e)}function YDt(e){let t=e.length;for(;t>0;){const n=e[t-1];if(n!=="/"&&n!=="\\")break;t--}return e.slice(0,t)}function VDt(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 qDt(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 kx=eo("Store:sessionDetail"),wY=new Map,kY=new Set,CY=new Set,jL=new Map;function WDt(e){const t=e??"__global__",n=(jL.get(t)??0)+1;return jL.set(t,n),n}function Cx(e,t){return jL.get(t??"__global__")===e}let RY="";function mge(){return{sessionDetail:null,conversation:null,conversationLoading:!1,sessionDetailLoading:!1,sessionDetailError:null,sessionClaudeMdStats:null,sessionContextStats:null,sessionPhaseInfo:null,visibleAIGroupId:null,selectedAIGroup:null}}const GDt=(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=WDt(s);if(i?.silent||e({sessionDetailLoading:!0,sessionDetailError:null,conversationLoading:!0}),s&&!i?.silent){const a=t().tabSessionData;e({tabSessionData:{...a,[s]:{...a[s]??mge(),sessionDetailLoading:!0,sessionDetailError:null,conversationLoading:!0}}})}try{const a=await ee.getSessionDetail(n,r);if(!Cx(o,s))return;const c=a?.session?.isOngoing??!1,l=a?yT(a.chunks):null,d=a&&l?aP(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!==RY&&(RY=m,ee.readAgentConfigs(m).then(w=>{e({agentConfigs:w})}).catch(w=>{kx.error("Failed to read agent configs:",w),RY=""})),O!=="ssh"&&d?.items){let w={};try{if(w=await ee.readClaudeMdFiles(m),!Cx(o,s))return}catch(R){kx.error("Failed to read CLAUDE.md files:",R)}_=kDt(d.items,m,w);const P={};if(_&&_.size>0){const R=new Set;for(const $ of _.values())for(const A of $.accumulatedInjections)A.source==="directory"&&R.add(A.path);if(R.size>0){const $=new Map,A=new Set,j=await Promise.all(Array.from(R).map(async Q=>{try{const U=Q.replace(/[\\/]CLAUDE\.md$/,""),M=await ee.readDirectoryClaudeMd(U);return{fullPath:Q,fileInfo:M,error:!1}}catch(U){return kx.error("Failed to read directory CLAUDE.md:",Q,U),{fullPath:Q,fileInfo:null,error:!0}}}));if(!Cx(o,s))return;for(const{fullPath:Q,fileInfo:U,error:M}of j)M||!U?A.add(Q):U.exists&&U.estimatedTokens>0?($.set(Q,U.estimatedTokens),P[Q]=U):A.add(Q);for(const[,Q]of _.entries()){Q.accumulatedInjections=Q.accumulatedInjections.filter(U=>U.source!=="directory"||!A.has(U.path)),Q.newInjections=Q.newInjections.filter(U=>U.source!=="directory"||!A.has(U.path));for(const U of Q.accumulatedInjections)U.source==="directory"&&$.has(U.path)&&(U.estimatedTokens=$.get(U.path));for(const U of Q.newInjections)U.source==="directory"&&$.has(U.path)&&(U.estimatedTokens=$.get(U.path));Q.totalEstimatedTokens=Q.accumulatedInjections.reduce((U,M)=>U+M.estimatedTokens,0),Q.accumulatedCount=Q.accumulatedInjections.length,Q.newCount=Q.newInjections.length}}}const k=new Set;for(const R of d.items)if(R.type==="user"&&R.group.content.fileReferences)for(const $ of R.group.content.fileReferences){const A=EZ(m,$.path);k.add(A)}for(const R of d.items)if(R.type==="ai")for(const $ of R.group.responses){if($.type!=="user")continue;let A="";if(typeof $.content=="string")A=$.content;else if(Array.isArray($.content))for(const j of $.content)j.type==="text"&&j.text&&(A+=j.text);if(A)for(const j of Qse(A)){const Q=EZ(m,j.path);k.add(Q)}}const C=new Map,I=await Promise.all(Array.from(k).map(async R=>{try{const $=await ee.readMentionedFile(R,m);return{filePath:R,fileInfo:$}}catch($){return kx.error("Failed to read mentioned file:",R,$),{filePath:R,fileInfo:null}}}));if(!Cx(o,s))return;for(const{filePath:R,fileInfo:$}of I)$&&C.set(R,$);const N=BDt(d.items,m,w,C,P);b=N.statsMap,y=N.phaseInfo}const x=t();if(!Cx(o,s))return;const S=xu(x.paneLayout),v=vZ(S,r);if(v&&a){const w=a.session.firstMessage?TZ(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(kx.error("fetchSessionDetail error:",a),!Cx(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]??mge(),sessionDetailError:c,sessionDetailLoading:!1,conversationLoading:!1}}})}}},refreshSessionInPlace:async(n,r)=>{const s=t(),o=xu(s.paneLayout).filter(l=>l.type==="session"&&l.sessionId===r);if(s.selectedSessionId!==r&&o.length===0)return;const a=`${n}/${r}`;if(kY.has(a)){CY.add(a);return}const c=(wY.get(a)??0)+1;wY.set(a,c),kY.add(a);try{const l=await ee.getSessionDetail(n,r);if(wY.get(a)!==c||!l)return;const d=l.session?.isOngoing??!1,p=yT(l.chunks);if(!p)return;const f=aP(p,l.processes,d);if(!f)return;const h=t(),m=xu(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(I=>I.type==="ai"&&I.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){kx.error("refreshSessionInPlace error:",l)}finally{kY.delete(a),CY.has(a)&&(CY.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=>{jL.delete(n);const r=t().tabSessionData;if(!(n in r))return;const s={...r};delete s[n],e({tabSessionData:s})}}),md=eo("Store:session"),HDt=150;function ZDt(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 PY=new Map,KDt=(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 ee.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 ee.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 ee.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 md.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=(PY.get(n)??0)+1;PY.set(n,s);const i=async()=>{const{connectionMode:a}=t();return ee.getSessionsPaginated(n,null,20,{includeTotalCount:!1,prefilterAll:!1,metadataLevel:a==="ssh"?"light":"deep"})},o=a=>{PY.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(ZDt(a)&&t().selectedProjectId===n){md.warn("refreshSessionsInPlace transient IPC error - retrying once");try{if(await new Promise(l=>setTimeout(l,HDt)),t().selectedProjectId!==n)return;const c=await i();o(c);return}catch(c){md.error("refreshSessionsInPlace retry error:",c);return}}md.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 ee.config.unpinSession(s,n):await ee.config.pinSession(s,n)}catch(a){e({pinnedSessionIds:o}),md.error("togglePinSession error:",a)}},loadPinnedSessions:async()=>{const r=t().selectedProjectId;if(!r){e({pinnedSessionIds:[]});return}try{const{connectionMode:s}=t(),a=((await ee.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 ee.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){md.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 ee.config.unhideSession(s,n):await ee.config.hideSession(s,n)}catch(a){e({hiddenSessionIds:o}),md.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 ee.config.hideSessions(s,n)}catch(c){e({hiddenSessionIds:i}),md.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 ee.config.unhideSessions(s,n)}catch(a){e({hiddenSessionIds:i}),md.error("unhideMultipleSessions error:",a)}},loadHiddenSessions:async()=>{const r=t().selectedProjectId;if(!r){e({hiddenSessionIds:[]});return}try{const o=((await ee.config.get()).sessions?.hiddenSessions?.[r]??[]).map(a=>a.sessionId);e({hiddenSessionIds:o})}catch(s){md.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=>ee.config.pinSession(s,c)))}catch(c){e({pinnedSessionIds:i}),md.error("pinMultipleSessions error:",c)}}}),JDt=(e,t)=>({drillDownStack:[],currentSubagentDetail:null,subagentDetailLoading:!1,subagentDetailError:null,drillDownSubagent:async(n,r,s,i)=>{e({subagentDetailLoading:!0,subagentDetailError:null});try{const o=await ee.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}),ee.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 Eo(e){const t=aXe(e);return{paneLayout:e,openTabs:t.openTabs,activeTabId:t.activeTabId,selectedTabIds:t.selectedTabIds}}function L1(e,t,n){const r=jh(e,t);return r?ro(e,{...r,tabs:r.tabs.map(s=>s.id===t?n(s):s)}):e}const eLt=(e,t)=>({openTabs:[],activeTabId:null,selectedTabIds:[],activeProjectId:null,openTab:(n,r)=>{const s=t(),{paneLayout:i}=s,o=Fl(i,i.focusedPaneId);if(!o)return;if(n.type==="session"&&n.sessionId&&!r?.forceNewTab){const d=xu(i),p=vZ(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:TZ(n.label),createdAt:Date.now()},m={...o,tabs:o.tabs.map(_=>_.id===f.id?h:_),activeTabId:h.id},O=ro(i,m);e(Eo(O));return}}const a={...n,id:crypto.randomUUID(),label:TZ(n.label),createdAt:Date.now()},c={...o,tabs:[...o.tabs,a],activeTabId:a.id},l=ro(i,c);e(Eo(l))},closeTab:n=>{const r=t(),{paneLayout:s}=r,i=jh(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=ro(s,f);e({...Eo(h),...oT()});return}const d={...i,tabs:a,activeTabId:c,selectedTabIds:i.selectedTabIds.filter(f=>f!==n)},p=ro(s,d);e(Eo(p)),c&&t().setActiveTab(c)},setActiveTab:n=>{const r=t(),{paneLayout:s}=r,i=r.getActiveTab(),a=jh(s,n)?.tabs.find(f=>f.id===n);i?.id!==n&&jxt(i?.label??"none",a?.label??n);const c=jh(s,n);if(!c)return;const l=c.tabs.find(f=>f.id===n);if(!l)return;const d={...c,activeTabId:n};let p=ro(s,d);if(p={...p,focusedPaneId:c.id},e(Eo(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=pr(h),O=r.projects.find(_=>pr(_.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=>pr(y.path)===m);if(b&&r.selectedWorktreeId!==b.id){e(LU(_.id,b.id)),t().fetchSessionsInitial(b.id);break}}}}},openDashboard:()=>{const n=t(),{paneLayout:r}=n,s=xu(r).find(l=>l.type==="dashboard");if(s){const l=jh(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=ro(r,m);e(Eo(O));return}}n.setActiveTab(s.id);return}const i=Fl(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=ro(r,a);e(Eo(c))},openSessionReport:n=>{const r=t(),i=xu(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=Fl(n.paneLayout,n.paneLayout.focusedPaneId);return r?.activeTabId?r.tabs.find(s=>s.id===r.activeTabId)??null:null},isSessionOpen:n=>xu(t().paneLayout).some(s=>s.type==="session"&&s.sessionId===n),enqueueTabNavigation:(n,r)=>{const{paneLayout:s}=t(),i=L1(s,n,o=>({...o,pendingNavigation:r}));e(Eo(i))},consumeTabNavigation:(n,r)=>{const{paneLayout:s}=t(),i=L1(s,n,o=>o.pendingNavigation?.id===r?{...o,pendingNavigation:void 0,lastConsumedNavigationId:r}:o);e(Eo(i))},saveTabScrollPosition:(n,r)=>{const{paneLayout:s}=t(),i=L1(s,n,o=>({...o,savedScrollTop:r}));e(Eo(i))},updateTabLabel:(n,r)=>{const{paneLayout:s}=t(),i=L1(s,n,o=>({...o,label:r}));e(Eo(i))},setTabContextPanelVisible:(n,r)=>{const{paneLayout:s}=t(),i=L1(s,n,o=>({...o,showContextPanel:r}));e(Eo(i))},setSelectedTabIds:n=>{const{paneLayout:r}=t(),s=Fl(r,r.focusedPaneId);if(!s)return;const i={...s,selectedTabIds:n},o=ro(r,i);e(Eo(o))},clearTabSelection:()=>{const{paneLayout:n}=t(),r=Fl(n,n.focusedPaneId);if(!r)return;const s={...r,selectedTabIds:[]},i=ro(n,s);e(Eo(i))},closeOtherTabs:n=>{const r=t(),{paneLayout:s}=r,i=jh(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=ro(s,c);e(Eo(l)),t().setActiveTab(n)},closeTabsToRight:n=>{const r=t(),{paneLayout:s}=r,i=jh(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=ro(s,p);e(Eo(f)),d&&t().setActiveTab(d)},closeAllTabs:()=>{const n=t(),r=xu(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({...Eo({panes:[{id:s,tabs:[],activeTabId:null,selectedTabIds:[],widthFraction:1}],focusedPaneId:s}),...oT()})},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=ro(i,{...l,tabs:d,activeTabId:p,selectedTabIds:l.selectedTabIds.filter(f=>!s.has(f))})}if(xu(i).length===0){r.closeAllTabs();return}for(const l of o)i=ek(i,l);e(Eo(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,...Kh()})},navigateToSession:(n,r,s=!1,i)=>{const o=t(),a=xu(o.paneLayout),c=cXe(a,r,n)??vZ(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=lge({...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=lge({...f});o.enqueueTabNavigation(p,h)}}const l=t().activeTabId??void 0;o.fetchSessionDetail(n,r,l)}}});function Pp(){return{expandedAIGroupIds:new Set,expandedDisplayItemIds:new Map,expandedSubagentTraceIds:new Set,showContextPanel:!1,selectedContextPhase:null,savedScrollTop:void 0}}const tLt=(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,Pp()),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)??Pp(),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)??Pp(),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)??Pp(),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)??Pp(),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)??Pp(),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)??Pp();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)??Pp();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)??Pp();i.set(n,{...o,selectedContextPhase:r}),e({tabUIStates:i})},saveScrollPositionForTab:(n,r)=>{const s=t(),i=new Map(s.tabUIStates),o=i.get(n)??Pp();i.set(n,{...o,savedScrollTop:r}),e({tabUIStates:i})},getScrollPositionForTab:n=>t().tabUIStates.get(n)?.savedScrollTop}),nLt=80;function Ls(e){if(typeof e.messageId=="string"&&e.messageId.trim().length>0)return e.messageId;const t=(e.text??"").slice(0,nLt);return`${e.timestamp}-${e.from}-${t}`}function rLt(e,t){const n=Date.parse(t.timestamp)-Date.parse(e.timestamp);return n!==0?n:Ls(e).localeCompare(Ls(t))}function wZ(...e){const t=new Map;for(const n of e)for(const r of n)t.set(Ls(r),r);return Array.from(t.values()).sort(rLt)}const sLt="OpenCode runtime delivery is still being checked. Message was saved and will be retried if needed.",iLt="OpenCode runtime delivery failed. Message was saved to inbox, but live delivery did not complete.";function oLt(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?iLt:sLt,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 aLt(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 lLt=/^(?<source>[a-z0-9-]+)\/(?<model>\S.*)$/i,cLt={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 uLt(e){const t=e.trim().toLowerCase();if(!t)return e;const n=cLt[t];return n||t.split("-").filter(Boolean).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")}function XL(e){const t=e?.trim();if(!t)return null;const n=lLt.exec(t);return!n?.groups?.source||!n.groups.model?null:{raw:t,sourceId:n.groups.source.toLowerCase(),modelId:n.groups.model}}function dLt(e){const t=XL(e);return t?uLt(t.sourceId):null}function tk(e){return e==="anthropic"||e==="codex"||e==="gemini"||e==="opencode"}function Ta(e){return tk(e)?e:void 0}function Ig(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(XL(t)||XL(n))return"opencode"}function Oge(e){const t=e?.trim();if(t)return t.replace(/(?:\[1m\])+$/,"")||void 0}function Lse(e,t){const n=e?.trim();return n?(t??Ig(n)??Ig(Oge(n)))!=="anthropic"?n:Oge(n):void 0}const gge=eo("Renderer:unwrapIpc");class Xh extends Error{constructor(t,n,r){super(n),this.operation=t,this.causeError=r,this.name="IpcError"}}const pLt=["TEAM_PROVISIONING","TEAM_DRAFT"];async function sr(e,t){try{return await t()}catch(n){const r=n instanceof Error?n.message:String(n);throw pLt.some(s=>r.includes(s))?gge.debug(`[${e}] ${r}`):gge.error(`[${e}] ${r}`),new Xh(e,r,n)}}const G0={autoAllowAll:!1,autoAllowFileEdits:!1,autoAllowSafeBash:!1,timeoutAction:"wait",timeoutSeconds:30},fLt=/^[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 hLt(e){return fLt.test(e.trim())}function so(e){const t=e.trim();return t&&(hLt(t)?t.slice(0,8).toLowerCase():t)}function l_(e){return e.displayId?.trim()||so(e.id)}function Gr(e){return`#${l_(e)}`}function nk(e,t){if(!t)return!1;const n=t.trim();return n?e.id===n||l_(e)===n:!1}const W$="team-lead",gXe="lead",mLt="负责人",OLt=new Set([W$,gXe]),gLt=new Set([W$,gXe,"orchestrator"]),_Lt=new Set(["lead"]);function jse(e){return e?.trim().toLowerCase()??""}function c_(e){return OLt.has(jse(e))}function bLt(e){return gLt.has(jse(e))}function yLt(e){return _Lt.has(jse(e))}function Gn(e){const t=typeof e.role=="string"?e.role:null;if(yLt(t))return!0;const n=typeof e.agentType=="string"?e.agentType:null;if(bLt(n))return!0;const r=typeof e.name=="string"?e.name:null;return c_(r)}function JQ(e){const t=e.agentId?.trim();return t||e.name.trim()}const xLt=[[],[{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 _Xe(e,t=[]){const n=e.filter(a=>!a.removedAt&&!Gn(a));if(n.length===0)return[];const r=new Map(n.map(a=>[JQ(a),a])),s=[],i=new Set;for(const a of t){if(a.removedAt||Gn(a))continue;const c=JQ(a);!r.has(c)||i.has(c)||(s.push(c),i.add(c))}const o=n.map(a=>JQ(a)).filter(a=>!i.has(a)).toSorted((a,c)=>a.localeCompare(c));return s.push(...o),s}function e2(e,t=[]){const n=_Xe(e,t),r=n.length>0?n.join("|"):null,s=xLt[n.length],i={};return s?.length===n.length&&n.forEach((o,a)=>{i[o]=s[a]}),{orderedVisibleOwnerIds:n,signature:r,assignments:i}}const du="stable-slots-v1",Lp=eo("teamSlice"),bXe=3e4,_ge=3e4,SLt=5e3,vLt=4e3,TLt=2e3,H0=new Map,xT=new Map,UL=new Set,sS=new Map,iS=new Map,x0=new Map,kZ=new Set,rk=new Map,CZ=new Set,lC=new Map,Z0=new Map,zL=new Map,yXe=new Map;let j1=null,$Y=!1;const t2=new Map,RZ=new Map,PZ=new Map;function NY(e){return H0.has(e)||(xT.get(e)?.size??0)>0||UL.has(e)}function bge(e){return zL.get(e)}function ELt(e){return(Z0.get(e)?.size??0)>0}function wLt(){return new Set(Array.from(Z0.entries()).filter(([,e])=>e.size>0).map(([e])=>e))}function kLt(e){IZ.delete(e),MZ.delete(e);const t=`${e}:`;for(const n of YL.keys())n.startsWith(t)&&YL.delete(n);for(const n of VL.keys())n.startsWith(t)&&VL.delete(n)}function X1(e){H0.delete(e),xT.delete(e),UL.delete(e),sS.delete(e),iS.delete(e),x0.delete(e),kZ.delete(e),rk.delete(e),CZ.delete(e),zL.delete(e),t2.delete(e),RZ.delete(e),PZ.delete(e),kLt(e)}function yge(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 ma(e,t){if(!(t in e))return null;const n={...e};return delete n[t],n}function AY(e,t){const n=Object.fromEntries(Object.entries(e.provisioningRuns).filter(([,x])=>x.teamName!==t)),r=ma(e.teamDataCacheByName,t),s=ma(e.teamAgentRuntimeByTeam,t),i=ma(e.teamMessagesByName,t),o=ma(e.memberActivityMetaByTeam,t),a=ma(e.provisioningSnapshotByTeam,t),c=ma(e.currentProvisioningRunIdByTeam,t),l=ma(e.currentRuntimeRunIdByTeam,t),d=ma(e.provisioningStartedAtFloorByTeam,t),p=ma(e.leadActivityByTeam,t),f=ma(e.leadContextByTeam,t),h=ma(e.activeToolsByTeam,t),m=ma(e.finishedVisibleByTeam,t),O=ma(e.toolHistoryByTeam,t),_=ma(e.memberSpawnStatusesByTeam,t),b=ma(e.memberSpawnSnapshotsByTeam,t),y=ma(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 xge(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 Ih(e){return yXe.get(e)??0}function xc(e,t){return Ih(e)===t}function U1(e){yXe.set(e,Ih(e)+1)}function CLt(e){const t=Symbol(e),n=xT.get(e);return n?(n.add(t),t):(xT.set(e,new Set([t])),t)}function RLt(e,t){const n=xT.get(e);n&&(n.delete(t),n.size===0&&xT.delete(e))}function z1(){return new Date().toISOString()}function PLt(e){return new Promise(t=>setTimeout(t,e))}function Sge(e){if(e==null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function $Z(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=$Z(e[i],s);return Object.is(o,e[i])||(n=!0),o});return n?r:e}if(Sge(e)&&Sge(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=$Z(n[c],r[c]);Object.is(l,n[c])||(o=!0),a[c]=l}return o?a:e}return t}function vge(e,t){return e?$Z(e,t):t}const $Lt=new Set(["validating","spawning","configuring","assembling","finalizing","verifying"]),BL=new Set(["ready","failed","disconnected","cancelled"]);function Tge(e){return e.startsWith("pending:")}function NLt(e){return(e instanceof Error?e.message:String(e)).includes("Unknown runId")}function FL(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 Ege(e){const t=H0.get(e);if(t)return t;const n=FL(sr("team:getData",()=>ee.teams.getData(e)),bXe,`team:getData(${e})`).finally(()=>{H0.get(e)===n&&H0.delete(e)});return H0.set(e,n),n}function ALt(e){return FL(sr("team:getData",()=>ee.teams.getData(e)),bXe,`team:getData(${e})`)}function ILt(e){const t=Date.now(),n=RZ.get(e)??{windowStartedAt:t,count:0,lastWarnAt:0};return t-n.windowStartedAt>vLt&&(n.windowStartedAt=t,n.count=0),n.count+=1,RZ.set(e,n),n.count}function MLt(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 QLt(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 DLt(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 LLt(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)||!DLt(e[s],t[s]))return!1;return!0}function jLt(e,t){return e?e.runId===t.runId&&e.teamLaunchState===t.teamLaunchState&&e.launchPhase===t.launchPhase&&e.source===t.source&&QLt(e.expectedMembers,t.expectedMembers)&&MLt(e.summary,t.summary)&&LLt(e.statuses,t.statuses):!1}function XLt(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 ULt(e,t){const n=Date.now(),r=PZ.get(e)??0;n-r<TLt||(PZ.set(e,n),Lp.debug(`[perf] member-spawn snapshot suppressed team=${e} runId=${t??"none"} reason=member-spawn-ui-equal`))}function zLt(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 BLt(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)||!zLt(e.members[s],t.members[s]))return!1;return!0}function FLt(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 YLt={canonicalMessages:[],optimisticMessages:[],feedRevision:null,nextCursor:null,hasMore:!1,lastFetchedAt:null,loadingHead:!1,loadingOlder:!1,headHydrated:!1,olderHydrated:!1};function qo(e,t){return e.teamMessagesByName[t]??YLt}function VLt(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(FLt),{...e,optimisticMessages:n}}function qLt(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 WLt(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 Rx(e){const t=lC.get(e);t!=null&&(clearTimeout(t),lC.delete(e))}function B1(e){Z0.delete(e)}function GLt(e,t,n){if(n){const s=Z0.get(e)??new Set;return s.add(t),Z0.set(e,s),!0}const r=Z0.get(e);return r?(r.delete(t),r.size===0?(Z0.delete(e),!1):!0):!1}function HLt(e,t){return t<=0?[]:e.slice(0,t)}function ZLt(e,t){if(e.length===0)return[];if(t.length===0)return null;const n=new Set(t.map(o=>Ls(o)));let r=!1;for(const o of e)if(!n.has(Ls(o))){r=!0;break}if(!r)return[];const s=Ls(t[t.length-1]),i=e.findIndex(o=>Ls(o)===s);return i<0?null:e.slice(i+1).filter(o=>!n.has(Ls(o)))}async function SI(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=Jc(s);if(!Ere(i)||typeof r.invalidateTaskChangePresence!="function"||typeof r.checkTaskHasChanges!="function")return;const o=Ad(t,n,i);r.invalidateTaskChangePresence([o]);try{await r.checkTaskHasChanges(t,n,i)}catch{}}async function wge(e,t,n){let s=500;for(let i=1;i<=60;i++){const o=e(),a=o.provisioningRuns[t];if(a&&BL.has(a.state))return;try{const c=await o.getProvisioningStatus(t);if(BL.has(c.state))return}catch(c){if(NLt(c)){o.clearMissingProvisioningRun(t);return}}await PLt(s),s=Math.min(1500,Math.round(s*1.5))}}const n2=new Set,QS=new Set,NZ=new Set,AZ=new Set,sk=new Set;let kge=!0;function KLt(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"&&!n2.has(s)&&(n2.add(s),JLt(r,!n)):n2.delete(s)}}function JLt(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=Ca(r).trim();ee.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 e5t(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=t_(a),d=t_(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(QS.has(_))continue;QS.add(_);const b=p||f?"Completed":c.status;t5t(a,b,p?"approved":f?"review":h?"needsFix":void 0,!s)}}function t5t(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;ee.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 n5t(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}`;NZ.has(p)||(NZ.add(p),r5t(s,d,!n))}}}function r5t(e,t,n){if(t.author==="user")return;const r=Ca(t.text).trim(),s=r.length>100?r.slice(0,100)+"...":r;ee.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 s5t(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)||AZ.has(i)||(AZ.add(i),i5t(s,!n))}}function i5t(e,t){ee.teams?.showMessageNotification({teamName:e.teamName,teamDisplayName:e.teamDisplayName,from:e.owner??"system",to:"user",summary:`New task ${Gr(e)}: ${e.subject}`,body:Ca(e.description||e.subject).trim(),teamEventType:"task_created",dedupeKey:`created:${e.teamName}:${e.id}`,suppressToast:t}).catch(()=>{})}function o5t(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")){sk.delete(s);continue}if(sk.has(s))continue;const a=e.filter(l=>l.teamName===s);if(a.length>0&&a.every(l=>l.status==="completed"||l.status==="deleted")){sk.add(s);continue}sk.add(s),a5t(i[0],i.length,!n)}}function a5t(e,t,n){ee.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 Cge(e,t,n){const r=new Set(n.map(o=>Ad(e,o.id,Jc(o)))),s=[],i=new Set;for(const o of t){const a=Ad(e,o.id,Jc(o));r.has(a)||(s.push(a),i.add(o.id))}return{cacheKeys:s,taskIds:[...i]}}function Rge(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=Ad(e,a.id,Jc(a)),l=Ad(e,o.id,Jc(o));return c!==l?o:(s=!0,{...o,changePresence:a.changePresence})});return s?i:n}function Pge(e){const t=e instanceof Xh||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 $ge(e){const t=e instanceof Xh||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 IZ=new Map,YL=new Map,MZ=new Map,l5t=[],c5t=[],VL=new Map;function u5t(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 d5t(e,t){return e.map(n=>xXe(n,t?.members[n.name]))}function xXe(e,t){return{...e,status:u5t(e,t),messageCount:t?.messageCountExact??0,lastActiveAt:t?.lastAuthoredMessageAt??null}}function p5t(e,t){return e?e.memberName===t.memberName&&e.lastAuthoredMessageAt===t.lastAuthoredMessageAt&&e.messageCountExact===t.messageCountExact&&e.latestAuthoredMessageSignalsTermination===t.latestAuthoredMessageSignalsTermination:!1}function f5t(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(!p5t(c,a)){s=!0,i[o]=a;continue}i[o]=c}return s?i:e}function Pi(e,t){return t?e.teamDataCacheByName[t]??(e.selectedTeamName===t?e.selectedTeamData:null):null}function Pl(e,t){const n=Pi(e,t);if(!n||!t)return[];const r=e.memberActivityMetaByTeam[t],s=r?.members,i=IZ.get(t);if(i?.snapshotRef===n.members&&i.metaMembersRef===s)return i.result;const o=d5t(n.members,r);return IZ.set(t,{snapshotRef:n.members,metaMembersRef:s,result:o}),o}function SXe(e,t,n){const r=Pi(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=YL.get(o);if(a?.snapshotMemberRef===s&&a.metaEntryRef===i)return a.result;const c=xXe(s,i);return YL.set(o,{snapshotMemberRef:s,metaEntryRef:i,result:c}),c}function Xse(e,t){return Pi(e,t)?.members??l5t}function h5t(e,t){return Pi(e,t)?.tasks??c5t}function m5t(e,t){return Pi(e,t)?.isAlive}function mz(e,t){if(!t)return[];const n=qo(e,t),r=MZ.get(t);if(r?.canonicalRef===n.canonicalMessages&&r.optimisticRef===n.optimisticMessages)return r.result;const s=wZ(n.canonicalMessages,n.optimisticMessages);return MZ.set(t,{canonicalRef:n.canonicalMessages,optimisticRef:n.optimisticMessages,result:s}),s}function vXe(e,t,n){if(!t||!n)return[];const r=mz(e,t),s=`${t}:${n}`,i=VL.get(s);if(i?.messagesRef===r)return i.result;const o=r.filter(a=>a.from===n||a.to===n);return VL.set(s,{messagesRef:r,result:o}),o}function Nge(e,t){const n=e.memberActivityMetaByTeam[t],r=qo(e,t).feedRevision;return n?r?n.feedRevision!==r:!1:!0}function vI(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 O5t(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 g5t(e,t){const n=O5t(e,t);return Object.keys(n).length>0?n:void 0}function _5t(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 Age(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 b5t(e,t){return t==="TEAM_DRAFT"||t.includes("TEAM_DRAFT")||t===`Team not found: ${e}`||t==="Team config not found"}const QZ="team:launchParams:";function Df(e,t){const n=e.currentProvisioningRunIdByTeam[t];return n?e.provisioningRuns[n]??null:null}function Yy(e,t){const n=Df(e,t);return n!=null&&$Lt.has(n.state)}function y5t(){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(QZ)){const s=r.slice(QZ.length),i=JSON.parse(t.getItem(r));i&&typeof i=="object"&&(e[s]=i)}}}catch{}return e}function Ige(e,t){try{localStorage?.setItem?.(QZ+e,JSON.stringify(t))}catch{}}function Mge(e,t){return Lse(e,t)}const TXe="team:toolApprovalSettings:";function EXe(e){if(!e)return G0;try{const t=JSON.parse(e),n=G0;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 G0}}function x5t(e){return EXe(localStorage?.getItem?.(TXe+e)??null)}function IY(e,t){try{localStorage?.setItem?.(TXe+e,JSON.stringify(t))}catch{}}function S5t(){return EXe(localStorage?.getItem?.("team:toolApprovalSettings")??null)}const v5t=(e,t)=>({teams:[],teamByName:{},teamBySessionId:{},branchByPath:{},teamsLoading:!1,teamsError:null,globalTasks:[],globalTasksLoading:!1,globalTasksInitialized:!1,globalTasksError:null,selectedTeamName:null,selectedTeamData:null,teamDataCacheByName:{},slotLayoutVersion:du,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:y5t(),fetchMemberSpawnStatuses:async n=>{if(!(!ee.teams?.getMemberSpawnStatuses||(t2.get(n)??0)>Date.now()))try{const s=await ee.teams.getMemberSpawnStatuses(n);t2.delete(n),e(i=>{const o=XLt(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 jLt(c,s)?(ULt(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'")&&t2.set(n,Date.now()+SLt)}},fetchTeamAgentRuntime:async n=>{if(ee.teams?.getTeamAgentRuntime)try{const r=await ee.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 BLt(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:S5t(),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 ee.teams.getProjectBranch(i);return[pr(i),o]}catch{return[pr(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 FL(sr("team:list",()=>ee.teams.list()),_ge,"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 Xh||r instanceof Error?r.message:"Failed to fetch teams":null})}},fetchAllTasks:async()=>{if(j1){$Y=!0,await j1;return}const r=(async()=>{do{$Y=!1;const s=!t().globalTasksInitialized;s&&e({globalTasksLoading:!0,globalTasksError:null});const i=t().globalTasks,o=kge;kge=!1;try{const a=await FL(sr("team:getAllTasks",()=>ee.teams.getAllTasks()),_ge,"fetchAllTasks");if(o){for(const l of a){l.needsClarification==="user"&&n2.add(`${l.teamName}:${l.id}`),QS.add(`${l.teamName}:${l.id}:${l.status}`),l.reviewState==="needsFix"&&QS.add(`${l.teamName}:${l.id}:needsFix`),t_(l)==="approved"&&QS.add(`${l.teamName}:${l.id}:approved`),t_(l)==="review"&&QS.add(`${l.teamName}:${l.id}:review`);for(const d of l.comments??[])NZ.add(`${l.teamName}:${l.id}:${d.id}`);AZ.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")&&sk.add(l)}else{const c=t().appConfig?.notifications?.notifyOnClarifications??!0;KLt(i,a,c),e5t(i,a,t().appConfig,t().teamByName);const l=t().appConfig?.notifications?.notifyOnTaskComments??!0;n5t(i,a,l);const d=t().appConfig?.notifications?.notifyOnTaskCreated??!0;s5t(i,a,d);const p=t().appConfig?.notifications?.notifyOnAllTasksCompleted??!0;o5t(i,a,p)}e({globalTasks:a,globalTasksLoading:!1,globalTasksInitialized:!0,globalTasksError:null})}catch(a){e({globalTasksLoading:!1,globalTasksInitialized:!0,globalTasksError:s?a instanceof Xh||a instanceof Error?a.message:"Failed to fetch tasks":null})}}while($Y)})().finally(()=>{j1===r&&(j1=null)});j1=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=pr(r),h=p.projects.find(m=>pr(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!==du&&(o.slotLayoutVersion=du,c={},l={},a=!0);const d=e2(r,s),p=g5t(c[n],d.orderedVisibleOwnerIds),f=l[n];return f?.mode==="manual"?vI(c[n],p)||(c={...c},p?c[n]=p:delete c[n],a=!0):((!vI(c[n],p)||!vI(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===du?{}:c?(Lp.warn(`[graph-layout] refusing occupied slot assignment team=${n} owner=${r} target=${s.ringIndex}:${s.sectorIndex} occupiedBy=${c[0]}`),{}):{slotLayoutVersion:du,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===du)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?(Lp.warn(`[graph-layout] refusing slot drop team=${n} owner=${r} target=${s.ringIndex}:${s.sectorIndex} conflict=${p[0]}`),{}):{slotLayoutVersion:du,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=Pi(i,n),a=[...i.gridOwnerOrderByTeam[n]??[]];for(const h of[r,s])a.includes(h)||a.push(h);const c=o?e2(o.members,o.config.members??[]).orderedVisibleOwnerIds:a,l=_5t(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:du,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===du&&Object.keys(r.graphLayoutSessionByTeam).length===0?{}:{slotLayoutVersion:du,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:du,slotAssignmentsByTeam:s,graphLayoutSessionByTeam:i}})},resetTeamGraphSlotAssignmentsToDefaults:n=>{e(r=>{const s=Pi(r,n),i=s?e2(s.members,s.config.members??[]):{signature:null,assignments:{}},o=r.slotAssignmentsByTeam[n],a=r.graphLayoutSessionByTeam[n];if(vI(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:du,slotAssignmentsByTeam:c,graphLayoutSessionByTeam:{...r.graphLayoutSessionByTeam,[n]:{mode:"default",signature:i.signature}}}})},setSelectedTeamTaskChangePresence:(n,r,s)=>{e(i=>{const o=Pi(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(Pi(t(),n))try{const s=await sr("team:getTaskChangePresence",()=>ee.teams.getTaskChangePresence(n));e(i=>{const o=Pi(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=Ih(n),i=r?.allowReloadWhileProvisioning===!0;if(t().selectedTeamLoading&&t().selectedTeamName===n&&!i)return;const o=t().selectedTeamLoadNonce+1,a=Pi(t(),n);e({selectedTeamName:n,selectedTeamData:a,selectedTeamLoading:!0,selectedTeamLoadNonce:o,selectedTeamError:null,reviewActionError:null,toolApprovalSettings:x5t(n)});try{const c=await Ege(n);if(!xc(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:Rge(n,a.tasks,c.tasks)}:c,h=vge(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}}),zL.set(n,Date.now());const m=a?Cge(n,a.tasks,c.tasks):{cacheKeys:[],taskIds:[]};m.cacheKeys.length>0&&t().invalidateTaskChangePresence(m.cacheKeys),m.taskIds.length>0&&await ee.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||Nge(t(),n))&&await t().refreshMemberActivityMeta(n),r?.skipProjectAutoSelect)return;const x=c.config.projectPath;if(x){const S=t(),v=pr(x),T=S.projects.find(E=>pr(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=>pr(P.path)===v);if(w){S.selectedWorktreeId!==w.id&&(e(LU(E.id,w.id)),t().fetchSessionsInitial(w.id));break}}}}catch(c){if(!xc(n,s))return;const l=t();if(l.selectedTeamName!==n||l.selectedTeamLoadNonce!==o)return;const d=Yy(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 Xh||c instanceof Error?c.message:"Failed to fetch team data";e({selectedTeamLoading:!1,selectedTeamData:null,selectedTeamError:f})}},refreshTeamData:async(n,r)=>{const s=Ih(n),i=CLt(n),o=r?.withDedup===!0&&H0.has(n);ILt(n),o&&UL.add(n);try{const a=Pi(t(),n),c=r?.withDedup?await Ege(n):await ALt(n);if(!xc(n,s))return;const l=a?{...c,tasks:Rge(n,a.tasks,c.tasks)}:c,d=vge(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}}),zL.set(n,Date.now());const p=a?Cge(n,a.tasks,c.tasks):{cacheKeys:[],taskIds:[]};p.cacheKeys.length>0&&t().invalidateTaskChangePresence(p.cacheKeys),p.taskIds.length>0&&await ee.review.invalidateTaskChangeSummaries(n,p.taskIds)}catch(a){if(!xc(n,s))return;const c=a instanceof Xh||a instanceof Error?a.message:"Failed to refresh team data";if(c==="TEAM_PROVISIONING"||c.includes("TEAM_PROVISIONING")){Lp.debug(`refreshTeamData(${n}) skipped: team is still provisioning`),t().selectedTeamName===n&&e({selectedTeamError:null});return}if(b5t(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(Lp.warn(`refreshTeamData(${n}) failed: ${c}`),t().selectedTeamData){Lp.debug(`refreshTeamData(${n}) preserving existing data after transient error`),e({selectedTeamError:null});return}e({selectedTeamError:c})}finally{RLt(n,i),o&&UL.delete(n)&&t().refreshTeamData(n)}},refreshTeamMessagesHead:async n=>{const r=sS.get(n);if(r)return kZ.add(n),r;const s=x0.get(n);if(s)return s;const i=iS.get(n);if(i){const c=Ih(n),l=i.then(()=>{if(!xc(n,c))return{feedChanged:!1,headChanged:!1,feedRevision:null};if(x0.get(n)===l)x0.delete(n);else return{feedChanged:!1,headChanged:!1,feedRevision:null};return t().refreshTeamMessagesHead(n)}).finally(()=>{x0.get(n)===l&&x0.delete(n)});return x0.set(n,l),l}const o={current:null};o.current=(async()=>{const c=Ih(n);e(l=>({teamMessagesByName:{...l.teamMessagesByName,[n]:{...qo(l,n),loadingHead:!0}}}));try{const l=await sr("team:getMessagesPage",()=>ee.teams.getMessagesPage(n,{limit:50}));if(!xc(n,c))return{feedChanged:!1,headChanged:!1,feedRevision:null};const d=qo(t(),n),p=!d.headHydrated||d.feedRevision!==l.feedRevision,f=HLt(d.canonicalMessages,l.messages.length),h=!qLt(f,l.messages);return e(m=>{const O=qo(m,n),_=ZLt(O.canonicalMessages,l.messages),b=O.olderHydrated&&Array.isArray(_)&&_.length>0,y=h?b?wZ(_,l.messages):l.messages:O.canonicalMessages,x=WLt(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(!xc(n,c))return{feedChanged:!1,headChanged:!1,feedRevision:null};throw e(d=>({teamMessagesByName:{...d.teamMessagesByName,[n]:{...qo(d,n),loadingHead:!1}}})),l}finally{sS.get(n)===o.current&&(sS.delete(n),kZ.delete(n)&&t().refreshTeamMessagesHead(n))}})();const a=o.current;return sS.set(n,a),a},loadOlderTeamMessages:async n=>{const r=Ih(n),s=iS.get(n);if(s)return s;const i=sS.get(n);if(i&&(await i,!xc(n,r)))return;let o=qo(t(),n);if(!o.headHydrated){if(await t().refreshTeamMessagesHead(n),!xc(n,r))return;o=qo(t(),n)}if(!o.headHydrated||!o.nextCursor||o.loadingOlder||o.loadingHead)return;const a={current:null};a.current=(async()=>{const l=Ih(n);e(d=>({teamMessagesByName:{...d.teamMessagesByName,[n]:{...qo(d,n),loadingOlder:!0}}}));try{const d=o.feedRevision,p=await sr("team:getMessagesPage",()=>ee.teams.getMessagesPage(n,{cursor:o.nextCursor,limit:50}));if(!xc(n,l))return;const f=qo(t(),n);if(f.feedRevision!==d){e(h=>({teamMessagesByName:{...h.teamMessagesByName,[n]:{...qo(h,n),loadingOlder:!1}}})),await t().refreshTeamMessagesHead(n);return}if(f.feedRevision&&f.feedRevision!==p.feedRevision){e(h=>({teamMessagesByName:{...h.teamMessagesByName,[n]:{...qo(h,n),loadingOlder:!1}}})),await t().refreshTeamMessagesHead(n);return}e(h=>{const m=qo(h,n),O=wZ(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(!xc(n,l))return;e(d=>({teamMessagesByName:{...d.teamMessagesByName,[n]:{...qo(d,n),loadingOlder:!1}}}))}finally{iS.get(n)===a.current&&iS.delete(n)}})();const c=a.current;return iS.set(n,c),c},refreshMemberActivityMeta:async n=>{if(!qo(t(),n).headHydrated)return;const s=rk.get(n);if(s)return CZ.add(n),s;const i={current:null};i.current=(async()=>{const a=Ih(n);try{const c=await sr("team:getMemberActivityMeta",()=>ee.teams.getMemberActivityMeta(n));if(!xc(n,a))return;e(l=>{const d=qo(l,n).feedRevision;if(d&&c.feedRevision!==d)return{};const p=l.memberActivityMetaByTeam[n];if(p?.feedRevision===c.feedRevision)return{};const f=f5t(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(!xc(n,a))return;throw c}finally{rk.get(n)===i.current&&(rk.delete(n),CZ.delete(n)&&t().refreshMemberActivityMeta(n))}})();const o=i.current;return rk.set(n,o),o},syncTeamPendingReplyRefresh:(n,r,s,i=1e4)=>{if(Rx(n),!GLt(n,r,s))return;const a=setTimeout(()=>{lC.get(n)===a&&(lC.delete(n),(async()=>{try{((await t().refreshTeamMessagesHead(n)).feedChanged||Nge(t(),n))&&await t().refreshMemberActivityMeta(n)}catch{}})())},i);lC.set(n,a)},updateKanban:async(n,r,s)=>{try{e({reviewActionError:null}),await sr("team:updateKanban",()=>ee.teams.updateKanban(n,r,s)),await t().refreshTeamData(n)}catch(i){throw e({reviewActionError:$ge(i)}),i}},updateKanbanColumnOrder:async(n,r,s)=>{await sr("team:updateKanbanColumnOrder",()=>ee.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 sr("team:sendMessage",()=>ee.teams.sendMessage(n,r)),i=s.runtimeDelivery?.attempted===!0&&s.runtimeDelivery.delivered===!1,o=oLt(s),a={from:r.from??"user",to:r.to??r.member,text:r.text,timestamp:r.timestamp??z1(),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]:VLt(qo(c,n),a)}})),await t().refreshTeamMessagesHead(n),s}catch(s){throw e({sendingMessage:!1,lastSendMessageResult:null,sendMessageWarning:null,sendMessageDebugDetails:null,sendMessageError:Pge(s)}),s}},fetchCrossTeamTargets:async()=>{e({crossTeamTargetsLoading:!0});try{const n=await ee.crossTeam.listTargets();e({crossTeamTargets:n,crossTeamTargetsLoading:!1})}catch(n){Lp.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 ee.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:Pge(r)})}},requestReview:async(n,r)=>{try{e({reviewActionError:null}),await sr("team:requestReview",()=>ee.teams.requestReview(n,r)),await t().refreshTeamData(n),SI(t,n,r)}catch(s){throw e({reviewActionError:$ge(s)}),s}},createTeamTask:async(n,r)=>{const s=await sr("team:createTask",()=>ee.teams.createTask(n,r));return await t().refreshTeamData(n),s},startTask:async(n,r)=>{const s=await sr("team:startTask",()=>ee.teams.startTask(n,r));return await t().refreshTeamData(n),SI(t,n,r),s},startTaskByUser:async(n,r)=>{const s=await sr("team:startTaskByUser",()=>ee.teams.startTaskByUser(n,r));return await t().refreshTeamData(n),SI(t,n,r),s},updateTaskStatus:async(n,r,s)=>{await sr("team:updateTaskStatus",()=>ee.teams.updateTaskStatus(n,r,s)),await t().refreshTeamData(n),SI(t,n,r)},updateTaskOwner:async(n,r,s)=>{await sr("team:updateTaskOwner",()=>ee.teams.updateTaskOwner(n,r,s)),await t().refreshTeamData(n)},updateTaskFields:async(n,r,s)=>{await sr("team:updateTaskFields",()=>ee.teams.updateTaskFields(n,r,s)),await t().refreshTeamData(n)},addTaskRelationship:async(n,r,s,i)=>{await sr("team:addTaskRelationship",()=>ee.teams.addTaskRelationship(n,r,s,i)),await t().refreshTeamData(n)},removeTaskRelationship:async(n,r,s,i)=>{await sr("team:removeTaskRelationship",()=>ee.teams.removeTaskRelationship(n,r,s,i)),await t().refreshTeamData(n)},setTaskNeedsClarification:async(n,r,s)=>{await sr("team:setTaskClarification",()=>ee.teams.setTaskClarification(n,r,s)),await t().refreshTeamData(n),await t().fetchAllTasks()},saveTaskAttachment:async(n,r,s)=>{const i=crypto.randomUUID();await sr("team:saveTaskAttachment",()=>ee.teams.saveTaskAttachment(n,r,i,s.name,s.type,s.base64)),await t().refreshTeamData(n)},deleteTaskAttachment:async(n,r,s,i)=>{await sr("team:deleteTaskAttachment",()=>ee.teams.deleteTaskAttachment(n,r,s,i)),await t().refreshTeamData(n)},getTaskAttachmentData:async(n,r,s,i)=>sr("team:getTaskAttachment",()=>ee.teams.getTaskAttachment(n,r,s,i)),addTaskComment:async(n,r,s)=>{e({addingComment:!0,addCommentError:null});try{const i=await sr("team:addTaskComment",()=>ee.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 sr("team:addMember",()=>ee.teams.addMember(n,r)),await Promise.allSettled([t().refreshTeamData(n),t().fetchMemberSpawnStatuses(n),t().fetchTeamAgentRuntime(n)])},restartMember:async(n,r)=>{try{await sr("team:restartMember",()=>ee.teams.restartMember(n,r))}finally{await Promise.allSettled([t().fetchMemberSpawnStatuses(n),t().fetchTeamAgentRuntime(n)])}},skipMemberForLaunch:async(n,r)=>{try{await sr("team:skipMemberForLaunch",()=>ee.teams.skipMemberForLaunch(n,r))}finally{await Promise.allSettled([t().fetchMemberSpawnStatuses(n),t().fetchTeamAgentRuntime(n),t().fetchTeams()])}},removeMember:async(n,r)=>{await sr("team:removeMember",()=>ee.teams.removeMember(n,r)),await t().refreshTeamData(n)},updateMemberRole:async(n,r,s)=>{await sr("team:updateMemberRole",()=>ee.teams.updateMemberRole(n,r,s)),await t().refreshTeamData(n)},softDeleteTask:async(n,r)=>{await sr("team:softDeleteTask",()=>ee.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 sr("team:restoreTask",()=>ee.teams.restoreTask(n,r)),await t().refreshTeamData(n),await t().fetchDeletedTasks(n)},fetchDeletedTasks:async n=>{e({deletedTasksLoading:!0});try{const r=await sr("team:getDeletedTasks",()=>ee.teams.getDeletedTasks(n));e({deletedTasks:r,deletedTasksLoading:!1})}catch(r){Lp.error("Failed to fetch deleted tasks:",r),e({deletedTasks:[],deletedTasksLoading:!1})}},deleteTeam:async n=>{const r=await sr("team:deleteTeam",()=>ee.teams.deleteTeam(n));return U1(n),Rx(n),B1(n),X1(n),e(s=>({...AY(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 sr("team:restoreTeam",()=>ee.teams.restoreTeam(n)),U1(n),Rx(n),B1(n),X1(n),e(r=>{const s=AY(r,n),i=xge(r,n,z1());return Object.keys(s).length===0?i:{...s,...i}}),await t().fetchTeams(),await t().fetchAllTasks()},permanentlyDeleteTeam:async n=>{await sr("team:permanentlyDeleteTeam",()=>ee.teams.permanentlyDeleteTeam(n)),U1(n),Rx(n),B1(n),X1(n);const r=t(),s=AY(r,n),i=xge(r,n,z1());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(),U1(n.teamName),Rx(n.teamName),B1(n.teamName),X1(n.teamName);const r=z1();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=yge(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?G0:{...G0,autoAllowAll:!0};IY(n.teamName,i),e({toolApprovalSettings:i});try{if(typeof ee.teams.createTeam!="function")throw new Error("Current preload version does not support team:create. Restart the dev app.");const o=await sr("team:create",()=>ee.teams.createTeam(n)),a=Mge(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};Ige(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),wge(t,o.runId),o.runId}catch(o){const a=o instanceof Xh||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(),U1(n.teamName),Rx(n.teamName),B1(n.teamName),X1(n.teamName);const r=z1();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=yge(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?G0:{...G0,autoAllowAll:!0};IY(n.teamName,i),e({toolApprovalSettings:i})}try{const i=await sr("team:launch",()=>ee.teams.launchTeam(n)),o=Mge(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};Ige(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 wge(t,i.runId),i.runId}catch(i){const o=i instanceof Xh||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 sr("team:provisioningStatus",()=>ee.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 sr("team:cancelProvisioning",()=>ee.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&&!BL.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 sr("team:stop",()=>ee.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):Tge(h)&&!Tge(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();Age(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&&BL.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(!Age(d,n.teamName))return;d.selectedTeamName===n.teamName?d.selectTeam(n.teamName):d.refreshTeamData(n.teamName,{withDedup:!0})}},subscribeProvisioningProgress:()=>{if(t().provisioningProgressUnsubscribe||!ee.teams?.onProvisioningProgress)return;const r=ee.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)IY(s,o);else try{localStorage?.setItem?.("team:toolApprovalSettings",JSON.stringify(o))}catch{}try{await ee.teams.updateToolApprovalSettings(s??"__global__",o)}catch(a){Lp.warn("Failed to sync tool approval settings to main:",a)}},respondToToolApproval:async(n,r,s,i,o)=>{try{await ee.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 Lp.error(`respondToToolApproval failed for ${n}/${s}: ${c}`),a}},unsubscribeProvisioningProgress:()=>{const n=t().provisioningProgressUnsubscribe;n&&(n(),e({provisioningProgressUnsubscribe:null}))}}),T5t=e=>({commandPaletteOpen:!1,sidebarCollapsed:!1,openCommandPalette:()=>{e({commandPaletteOpen:!0})},closeCommandPalette:()=>{e({commandPaletteOpen:!1})},toggleSidebar:()=>{e(t=>({sidebarCollapsed:!t.sidebarCollapsed}))}}),E5t=1e4,w5t=1500,k5t=6,C5t=4e3,R5t=8,P5t=2e3,$5t=1e4,N5t=3e4,A5t=1e4,I5t=eo("Store:index"),M5t=new Set(["task","config","inbox","lead-message","lead-context","lead-activity","process","member-spawn"]),Qge=new Map;function Q5t(e,t,n){if(!n)return;const r=Date.now(),s=Qge.get(e)??{windowStartedAt:r,count:0,lastWarnAt:0,countsByType:{}};r-s.windowStartedAt>C5t&&(s.windowStartedAt=r,s.count=0,s.countsByType={}),s.count+=1,s.countsByType[t]=(s.countsByType[t]??0)+1,s.count>=R5t&&r-s.lastWarnAt>=P5t&&(s.lastWarnAt=r),Qge.set(e,s)}const oe=jSt()((...e)=>({...D2t(...e),...X2t(...e),...KDt(...e),...GDt(...e),...JDt(...e),...v5t(...e),...eTt(...e),...eLt(...e),...tLt(...e),...Q2t(...e),...T5t(...e),...M2t(...e),...Ovt(...e),..._vt(...e),...Cvt(...e),...avt(...e),...hvt(...e),...b2t(...e),...U2t(...e),...P2t(...e)}));function D5t(){tSt();const e=[];let t=null;oe.getState().subscribeProvisioningProgress(),e.push(()=>{oe.getState().unsubscribeProvisioningProgress()}),(async()=>{await oe.getState().fetchConfig();const J=oe.getState().appConfig;HQe(J?.general?.telemetryEnabled??!0),ee.cliInstaller&&(t=setTimeout(()=>{oe.getState().appConfig?.general?.multimodelEnabled??!1?oe.getState().bootstrapCliStatus({multimodelEnabled:!0}):oe.getState().fetchCliStatus(),t=null},3e3)),await Promise.all([oe.getState().fetchRepositoryGroups(),oe.getState().fetchAllTasks(),oe.getState().fetchTeams(),oe.getState().fetchNotifications(),oe.getState().fetchSchedules()])})(),e.push(()=>{t&&clearTimeout(t)});const n=setInterval(()=>{V()},E5t);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||!se(J))return;const F=oe.getState();try{const W=await F.refreshTeamMessagesHead(J),ue=oe.getState(),ie=ue.memberActivityMetaByTeam[J];(W.feedChanged||ie?.feedRevision!==W.feedRevision)&&await ue.refreshMemberActivityMeta(J)}catch{}},k=J=>{if(!J||!Z(J)||d.has(J))return;const F=setTimeout(()=>{d.delete(J),oe.getState().fetchMemberSpawnStatuses(J)},T);d.set(J,F)},C=J=>{if(!J||!Z(J)||p.has(J))return;const F=setTimeout(()=>{p.delete(J),oe.getState().fetchTeamAgentRuntime(J)},T);p.set(J,F)},I=J=>{if(!J||!se(J)||c.has(J))return;const F=setTimeout(()=>{c.delete(J),P(J)},S);c.set(J,F)},N=(J,F,W,ue)=>`${J}:${F}:${W}:${ue}`,R=(J,F,W,ue)=>{const ie=N(J,F,W,ue),le=f.get(ie);le&&(clearTimeout(le),f.delete(ie))},$=(J,F,W,ue,ie,le)=>{R(J,F,W,ue);const K=N(J,F,W,ue),pe=setTimeout(()=>{f.delete(K),le()},ie);f.set(K,pe)},A=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},ie={...J.toolHistoryByTeam};return delete W[F],delete ue[F],delete ie[F],{activeToolsByTeam:W,finishedVisibleByTeam:ue,toolHistoryByTeam:ie}},Q=(J,F,W)=>{const ue={...J[F]??{}},ie=ue[W.memberName]??[];return ue[W.memberName]=[W,...ie.filter(le=>le.toolUseId!==W.toolUseId)].slice(0,k5t),{...J,[F]:ue}},U=(J,F)=>({...J??{},[F.memberName]:{...(J??{})[F.memberName]??{},[F.toolUseId]:F}}),M=(J,F,W)=>{if(!J?.[F]?.[W])return J??{};const ue={...J??{}},ie={...ue[F]??{}};return delete ie[W],Object.keys(ie).length===0?delete ue[F]:ue[F]=ie,ue},q=(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??{},ie=!1;for(const le of W)ue[F]?.[le]&&(ue=M(ue,F,le),ie=!0);return ie?ue:J??{}},L=J=>{if(!J)return null;const F=J.indexOf("::");return F>=0?J.slice(0,F):J},V=async()=>{if(h)return;const J=oe.getState(),F=Array.from(H(J));if(F.length!==0){if(O.size>50){const W=new Set(oe.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=Pi(J,W);if(ue?.teamName!==W){NY(W)||J.refreshTeamData(W,{withDedup:!0});continue}const ie=ue.tasks.filter(xt=>xt.status!=="in_progress"?!1:Ere(Jc(xt)));if(ie.length===0){O.delete(W);continue}const le=O.get(W)??0,K=ie.filter(xt=>xt.changePresence==="unknown"),pe=K.length>0?K:ie,we=pe[le%pe.length];O.set(W,(le+1)%pe.length);const Ee=oe.getState();if(!Z(W))continue;const Ae=Pi(Ee,W);if(Ae?.teamName!==W){NY(W)||Ee.refreshTeamData(W,{withDedup:!0});continue}const We=Ae.tasks.find(xt=>xt.id===we.id);if(We?.status!=="in_progress")continue;const et=Jc(We),yt=Ad(W,We.id,et);Ee.invalidateTaskChangePresence([yt]),await Ee.checkTaskHasChanges(W,We.id,et)}}catch{}finally{h=!1}}},Y=(J,F)=>{const W=`${J}/${F}`;if(r.has(W))return;const ue=setTimeout(()=>{r.delete(W),oe.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),oe.getState().refreshSessionsInPlace(J)},x);s.set(J,W)};if(ee.notifications?.onNew){const J=ee.notifications.onNew((F,W)=>{const ue=W;ue?.id&&oe.setState(ie=>ie.notifications.some(le=>le.id===ue.id)?{}:{notifications:[ue,...ie.notifications].slice(0,200)})});typeof J=="function"&&e.push(J)}if(ee.notifications?.onUpdated){const J=ee.notifications.onUpdated((F,W)=>{const ue=typeof W.unreadCount=="number"&&Number.isFinite(W.unreadCount)?Math.max(0,Math.floor(W.unreadCount)):0;oe.setState({unreadCount:ue})});typeof J=="function"&&e.push(J)}if(ee.notifications?.onClicked){const J=ee.notifications.onClicked((F,W)=>{const ue=W;ue?.id&&ue?.sessionId&&ue?.projectId&&oe.getState().navigateToError(ue)});typeof J=="function"&&e.push(J)}const te=J=>{const{paneLayout:F}=oe.getState();return F.panes.some(W=>W.activeTabId!=null&&W.tabs.some(ue=>ue.id===W.activeTabId&&ue.type==="session"&&ue.sessionId===J))},H=(J=oe.getState())=>{const{paneLayout:F}=J,W=new Set;for(const ue of F.panes){if(!ue.activeTabId)continue;const ie=ue.tabs.find(le=>le.id===ue.activeTabId);(ie?.type==="team"||ie?.type==="graph")&&ie.teamName!=null&&W.add(ie.teamName)}return W},Z=J=>H().has(J),se=J=>Z(J)||ELt(J),he=()=>{const J=H();for(const F of wLt())J.add(F);return J},ce=()=>H(),me=(J,F=Date.now())=>{i.set(J,F)},ae=()=>{const J=oe.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||!Pi(J,W.teamName)?null:W.teamName},G=async()=>{if(m)return;const J=he();if(J.size!==0){m=!0;try{await Promise.allSettled(Array.from(J,F=>P(F)))}finally{m=!1}}},be=async()=>{if(typeof document<"u"&&document.visibilityState==="hidden")return;const J=oe.getState(),F=ae();if(!F||!Z(F)||J.selectedTeamName===F&&J.selectedTeamLoading||NY(F))return;const W=i.get(F)??0,ue=bge(F)??0,ie=Math.max(W,ue);if(ie===0)return;const le=Date.now();if(!(le-ie<N5t||(o.get(F)??0)>=ie)){I5t.warn(`[perf] idle-watchdog refresh team=${F} idleMs=${le-ie}`);try{await J.refreshTeamData(F,{withDedup:!0})}finally{o.set(F,Math.max(bge(F)??0,ie,Date.now()))}}};if(ee.teams?.setToolActivityTracking){let J=new Set;const F=()=>{const ue=ce();for(const ie of ue)J.has(ie)||ee.teams.setToolActivityTracking(ie,!0).catch(()=>{});for(const ie of J)ue.has(ie)||ee.teams.setToolActivityTracking(ie,!1).catch(()=>{});J=ue};F();const W=oe.subscribe((ue,ie)=>{ue.paneLayout!==ie.paneLayout&&F()});e.push(()=>{W();for(const ue of J)ee.teams.setToolActivityTracking(ue,!1).catch(()=>{});J.clear()})}if(ee.onTodoChange){const J=ee.onTodoChange(F=>{if(!F.sessionId||F.type==="unlink")return;const W=oe.getState();if(W.selectedSessionId===F.sessionId||te(F.sessionId)){const pe=W.getAllPaneTabs().find(we=>we.type==="session"&&we.sessionId===F.sessionId);pe?.projectId&&Y(pe.projectId,F.sessionId)}const ie=W.getActiveTab(),le=ie?.type==="session"&&typeof ie.projectId=="string"?ie.projectId:null;le&&le===W.selectedProjectId&&ne(le)});typeof J=="function"&&e.push(J)}if(ee.onFileChange){const J=ee.onFileChange(F=>{if(F.type==="unlink")return;const W=oe.getState(),ue=W.selectedProjectId,ie=L(ue),le=L(F.projectId),K=!!ue&&(le==null||ie===le),pe=!F.isSubagent,we=F.sessionId==null||!W.sessions.some(Ae=>Ae.id===F.sessionId);if(pe&&K&&we&&(F.type==="add"||W.connectionMode==="local"&&F.type==="change")&&K&&ue&&ne(ue),(F.type==="change"||F.type==="add")&&ue){const Ae=W.selectedSessionId,We=F.sessionId,xt=(!!We&&(Ae===We||te(We))?We:null)??(K&&!We&&!!Ae?Ae:null);if(xt){const Xt=W.getAllPaneTabs().find(ct=>ct.type==="session"&&ct.sessionId===xt)?.projectId??ue;Y(Xt,xt)}}});typeof J=="function"&&e.push(J)}const _e=setInterval(()=>{be()},$5t);e.push(()=>{clearInterval(_e)});const re=setInterval(()=>{G()},A5t);if(e.push(()=>{clearInterval(re)}),ee.teams?.onTeamChange){const J=ee.teams.onTeamChange((F,W)=>{const ue=!!W.teamName&&se(W.teamName);if(Q5t(W.teamName,W.type,ue),(()=>{if(!W.runId)return!1;const Ee=oe.getState();return Ee.ignoredProvisioningRunIds[W.runId]===W.teamName||Ee.ignoredRuntimeRunIds[W.runId]===W.teamName})())return;const le=(()=>{if(!W.runId)return!1;const Ee=oe.getState().currentRuntimeRunIdByTeam[W.teamName];return Ee!=null&&Ee!==W.runId})(),K=()=>{if(!W.runId)return;oe.getState().currentRuntimeRunIdByTeam[W.teamName]==null&&oe.setState(Ae=>({currentRuntimeRunIdByTeam:{...Ae.currentRuntimeRunIdByTeam,[W.teamName]:W.runId??null},ignoredRuntimeRunIds:Object.fromEntries(Object.entries(Ae.ignoredRuntimeRunIds).filter(([,We])=>We!==W.teamName))}))};if(M5t.has(W.type)&&!le&&me(W.teamName),W.type==="lead-activity"&&W.detail){if(le)return;K();const Ee=W.detail;oe.setState(Ae=>{const We={leadActivityByTeam:{...Ae.leadActivityByTeam,[W.teamName]:Ee}},et=Ae.teamDataCacheByName[W.teamName]??(Ae.selectedTeamName===W.teamName?Ae.selectedTeamData:null),yt=et&&et.isAlive!==(Ee!=="offline")?{...et,isAlive:Ee!=="offline"}:et;return yt&&(We.teamDataCacheByName={...Ae.teamDataCacheByName,[W.teamName]:yt}),Ae.selectedTeamName===W.teamName&&yt&&(We.selectedTeamData=yt),Ee==="offline"&&(We.leadContextByTeam={...Ae.leadContextByTeam},delete We.leadContextByTeam[W.teamName],Object.assign(We,j(Ae,W.teamName)),We.currentRuntimeRunIdByTeam={...Ae.currentRuntimeRunIdByTeam},delete We.currentRuntimeRunIdByTeam[W.teamName],We.ignoredRuntimeRunIds=W.runId?{...Ae.ignoredRuntimeRunIds,[W.runId]:W.teamName}:Ae.ignoredRuntimeRunIds,A(W.teamName)),We});return}if(W.type==="lead-context"&&W.detail){if(le)return;K();try{const Ee=JSON.parse(W.detail);oe.setState(Ae=>({...Ae,leadContextByTeam:{...Ae.leadContextByTeam,[W.teamName]:Ee}}))}catch{}return}if(W.type==="tool-activity"&&W.detail){if(le)return;K();try{const Ee=JSON.parse(W.detail);if(Ee.action==="start"&&Ee.activity){const Ae={memberName:Ee.activity.memberName,toolUseId:Ee.activity.toolUseId,toolName:Ee.activity.toolName,preview:Ee.activity.preview,startedAt:Ee.activity.startedAt,source:Ee.activity.source,state:"running"};oe.setState(We=>({activeToolsByTeam:{...We.activeToolsByTeam,[W.teamName]:U(We.activeToolsByTeam[W.teamName],Ae)}}))}else if(Ee.action==="finish"&&Ee.memberName&&Ee.toolUseId){const Ae=Ee.memberName,We=Ee.toolUseId;oe.setState(et=>{const yt=et.activeToolsByTeam[W.teamName]?.[Ae]?.[We];if(!yt)return{};const xt={...yt,state:Ee.isError?"error":"complete",finishedAt:Ee.finishedAt??new Date().toISOString(),resultPreview:Ee.resultPreview};return $(W.teamName,Ae,We,"fade",w5t,()=>{oe.setState(Ge=>Ge.finishedVisibleByTeam[W.teamName]?.[Ae]?.[We]?{finishedVisibleByTeam:{...Ge.finishedVisibleByTeam,[W.teamName]:M(Ge.finishedVisibleByTeam[W.teamName],Ae,We)}}:{})}),{activeToolsByTeam:{...et.activeToolsByTeam,[W.teamName]:M(et.activeToolsByTeam[W.teamName],Ae,We)},finishedVisibleByTeam:{...et.finishedVisibleByTeam,[W.teamName]:U(et.finishedVisibleByTeam[W.teamName],xt)},toolHistoryByTeam:Q(et.toolHistoryByTeam,W.teamName,xt)}})}else if(Ee.action==="reset")if(Ee.memberName){const Ae=Ee.memberName,We=Array.isArray(Ee.toolUseIds)&&Ee.toolUseIds.length>0?Ee.toolUseIds:null;oe.setState(et=>et.activeToolsByTeam[W.teamName]?.[Ae]?{activeToolsByTeam:{...et.activeToolsByTeam,[W.teamName]:We?z(et.activeToolsByTeam[W.teamName],Ae,We):q(et.activeToolsByTeam[W.teamName],Ae)}}:{})}else oe.setState(Ae=>({activeToolsByTeam:{...Ae.activeToolsByTeam,[W.teamName]:{}}}))}catch{}return}if(W.type==="member-spawn"){if(le)return;K(),k(W.teamName),C(W.teamName);return}if(W.type==="inbox"){I(W.teamName);return}if(W.type==="lead-message"){if(le)return;K(),I(W.teamName);return}if(W.type==="log-source-change"){if(!W?.teamName||!Z(W.teamName)||l.has(W.teamName))return;const Ee=setTimeout(()=>{l.delete(W.teamName),oe.getState().refreshTeamChangePresence(W.teamName)},v);l.set(W.teamName,Ee);return}if(_||(_=setTimeout(()=>{_=null,oe.getState().fetchTeams()},E)),(W.type==="task"||W.type==="config")&&!b&&(b=setTimeout(()=>{b=null,oe.getState().fetchAllTasks()},w)),!W?.teamName||!Z(W.teamName)||a.has(W.teamName))return;const we=setTimeout(()=>{a.delete(W.teamName),oe.getState().refreshTeamData(W.teamName,{withDedup:!0})},S);a.set(W.teamName,we)});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(ee.teams?.onProjectBranchChange){const J=ee.teams.onProjectBranchChange((F,W)=>{if(!W?.projectPath)return;const ue=pr(W.projectPath);ue&&oe.setState(ie=>ie.branchByPath[ue]===W.branch?{}:{branchByPath:{...ie.branchByPath,[ue]:W.branch}})});typeof J=="function"&&e.push(J)}if(ee.teams?.onToolApprovalEvent){const J=ee.teams.onToolApprovalEvent((ue,ie)=>{const le=ie;if("autoResolved"in le&&le.autoResolved){const K=le.reason!=="timeout_deny";oe.setState(pe=>{const we=new Map(pe.resolvedApprovals);return we.set(le.requestId,K),{pendingApprovals:pe.pendingApprovals.filter(Ee=>!(Ee.runId===le.runId&&Ee.requestId===le.requestId)),resolvedApprovals:we}})}else if("dismissed"in le&&le.dismissed){const K=le;oe.setState(pe=>({pendingApprovals:pe.pendingApprovals.filter(we=>!(we.teamName===K.teamName&&we.runId===K.runId))}))}else{const K=le;oe.setState(pe=>({pendingApprovals:[...pe.pendingApprovals,K]}))}});typeof J=="function"&&e.push(J);const F=oe.getState().toolApprovalSettings,W=oe.getState().selectedTeamName??"__global__";ee.teams.updateToolApprovalSettings?.(W,F).catch(()=>{})}if(ee.editor?.onEditorChange){const J=ee.editor.onEditorChange(F=>{const W=oe.getState();W.editorProjectPath&&W.handleExternalFileChange(F)});typeof J=="function"&&e.push(J)}if(ee.schedules?.onScheduleChange){const J=ee.schedules.onScheduleChange((F,W)=>{const ue=W;ue?.scheduleId&&oe.getState().applyScheduleChange(ue.scheduleId)});typeof J=="function"&&e.push(J)}let ge=null;if(ee.cliInstaller?.onProgress){const J=ee.cliInstaller.onProgress((F,W)=>{const ue=W;ue.type!=="completed"&&ge&&(clearTimeout(ge),ge=null);const ie=ue.detail??null;switch(ue.type){case"checking":oe.setState({cliInstallerState:"checking",cliInstallerDetail:ie});break;case"downloading":oe.setState({cliInstallerState:"downloading",cliDownloadProgress:ue.percent??0,cliDownloadTransferred:ue.transferred??0,cliDownloadTotal:ue.total??0,cliInstallerDetail:ie});break;case"verifying":oe.setState({cliInstallerState:"verifying",cliInstallerDetail:ie});break;case"installing":{const le=oe.getState().cliInstallerLogs,K=oe.getState().cliInstallerRawChunks,pe=ie?[...le,ie].slice(-50):le,we=ue.rawChunk?[...K,ue.rawChunk].slice(-200):K;oe.setState({cliInstallerState:"installing",cliInstallerDetail:ie,cliInstallerLogs:pe,cliInstallerRawChunks:we});break}case"completed":{const le=oe.getState().appConfig?.general?.multimodelEnabled??!1;e_({multimodelEnabled:le,bootstrapCliStatus:oe.getState().bootstrapCliStatus,fetchCliStatus:oe.getState().fetchCliStatus})}oe.setState({cliInstallerState:"completed",cliCompletedVersion:ue.version??null,cliInstallerDetail:null}),ge=setTimeout(()=>{ge=null,oe.getState().cliInstallerState==="completed"&&oe.setState({cliInstallerState:"idle"})},3e3);break;case"error":oe.setState({cliInstallerState:"error",cliInstallerError:ue.error??"Unknown error"});break;case"status":if(ue.status){let le=[];oe.setState(K=>{const pe=MQ(K.cliStatus,ue.status),we=cvt(pe);return le=uvt(pe),{cliStatus:pe,cliProviderStatusLoading:we.length>0?{...K.cliProviderStatusLoading,...Object.fromEntries(we.map(Ee=>[Ee,!0]))}:K.cliProviderStatusLoading}});for(const K of le)oe.getState().fetchCliProviderStatus(K,{silent:!1})}break}});typeof J=="function"&&e.push(()=>{J(),ge&&(clearTimeout(ge),ge=null)})}if(ee.ssh?.onStatus){const J=ee.ssh.onStatus((F,W)=>{const ue=W;oe.getState().setConnectionStatus(ue.state,ue.host,ue.error)});typeof J=="function"&&e.push(J)}if(ee.context?.onChanged){const J=ee.context.onChanged((F,W)=>{const{id:ue}=W,ie=oe.getState().activeContextId;ue!==ie&&oe.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 L5t=()=>{const e=oe(r=>r.isContextSwitching),t=oe(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:"正在加载工作区"})]})]})})},j5t="1.5.9",X5t={version:j5t},U5t="https://github.com/yancyuu/Hermit/issues/new",z5t=120,B5t=1800,F5t=1200,Y5t=12e3,V5t=8e3,DZ=(e,t)=>e.length<=t?e:`${e.slice(0,t)}
|
|
1037
1037
|
...[truncated]`,q5t=e=>{const t=e?`[BUG] ${e.name}: ${e.message}`:"[BUG] Application crash";return DZ(t,z5t)},W5t=()=>"Web browser",$p=e=>{if(!e)return"Not available";const t=e.trim();return t.length>0?t:"Not available"},G5t=()=>{const{userAgent:e}=window.navigator;return e.includes("Mac OS X")?"macOS":e.includes("Windows")?"Windows":e.includes("Linux")?"Linux":"Unknown"},Dge=e=>e?.activeTabType?e.activeTabLabel?`${e.activeTabType} (${e.activeTabLabel})`:e.activeTabType:"Not available",wXe=({error:e,componentStack:t,context:n},r)=>{const s=e?.message??"Unknown application crash",i=e?.stack?DZ(e.stack,r.js):"Not available",o=t?DZ(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: ${Dge(n)}`,`- Active team tab: ${$p(n?.activeTeamName)}`,`- Selected team: ${$p(n?.selectedTeamName)}`,`- Current task: ${$p(n?.taskId)}`,`- Session ID: ${$p(n?.sessionId)}`,`- Project ID: ${$p(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: ${G5t()}`,`- Runtime: ${W5t()}`,`- App version: ${X5t.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: ${Dge(n)}`,`Active team tab: ${$p(n?.activeTeamName)}`,`Selected team: ${$p(n?.selectedTeamName)}`,`Current task: ${$p(n?.taskId)}`,`Session ID: ${$p(n?.sessionId)}`,`Project ID: ${$p(n?.projectId)}`,"```","","**JavaScript stack trace**","```text",i,"```","","**React component stack**","```text",o,"```"].join(`
|
|
1038
1038
|
`)},H5t=e=>wXe(e,{js:Y5t,react:V5t}),Z5t=e=>{const t=new URLSearchParams({template:"bug_report.md",labels:"bug",title:q5t(e.error),body:wXe(e,{js:B5t,react:F5t})});return`${U5t}?${t.toString()}`},Lge=eo("Component:ErrorBoundary");class K5t 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){Lge.error("ErrorBoundary caught an error:",t,n),this.setState({errorInfo:n}),Lxt()&&Xxt(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=oe.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=Z5t({error:this.state.error,componentStack:this.state.errorInfo?.componentStack??null,context:this.getBugReportContext()});ee.openExternal(t)};handleCopyErrorDetails=async()=>{try{await navigator.clipboard.writeText(H5t({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){Lge.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(Kn,{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(Kr,{className:"size-4 text-green-400"}):u.jsx(_E,{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(XIe,{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(pa,{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 J5t(){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 $E(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Use(e){return"nodeType"in e}function $l(e){var t,n;return e?$E(e)?e:Use(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function zse(e){const{Document:t}=$l(e);return e instanceof t}function G$(e){return $E(e)?!1:e instanceof $l(e).HTMLElement}function kXe(e){return e instanceof $l(e).SVGElement}function NE(e){return e?$E(e)?e.document:Use(e)?zse(e)?e:G$(e)||kXe(e)?e.ownerDocument:document:document:document}const ap=Oz?g.useLayoutEffect:g.useEffect;function gz(e){const t=g.useRef(e);return ap(()=>{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 ejt(){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 lP(e,t){t===void 0&&(t=[e]);const n=g.useRef(e);return ap(()=>{n.current!==e&&(n.current=e)},t),n}function H$(e,t){const n=g.useRef();return g.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function qL(e){const t=gz(e),n=g.useRef(null),r=g.useCallback(s=>{s!==n.current&&t?.(s,n.current),n.current=s},[]);return[n,r]}function WL(e){const t=g.useRef();return g.useEffect(()=>{t.current=e},[e]),t.current}let MY={};function Z$(e,t){return g.useMemo(()=>{if(t)return t;const n=MY[e]==null?0:MY[e]+1;return MY[e]=n,e+"-"+n},[e,t])}function CXe(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 mv=CXe(1),GL=CXe(-1);function tjt(e){return"clientX"in e&&"clientY"in e}function _z(e){if(!e)return!1;const{KeyboardEvent:t}=$l(e.target);return t&&e instanceof t}function njt(e){if(!e)return!1;const{TouchEvent:t}=$l(e.target);return t&&e instanceof t}function HL(e){if(njt(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 tjt(e)?{x:e.clientX,y:e.clientY}:null}const Qm=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[Qm.Translate.toString(e),Qm.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),jge="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function rjt(e){return e.matches(jge)?e:e.querySelector(jge)}const sjt={display:"none"};function ijt(e){let{id:t,value:n}=e;return Je.createElement("div",{id:t,style:sjt},n)}function ojt(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 ajt(){const[e,t]=g.useState("");return{announce:g.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const RXe=g.createContext(null);function ljt(e){const t=g.useContext(RXe);g.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function cjt(){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 ujt={draggable:`
|
|
1039
1039
|
To pick up a draggable item, press the space bar.
|
|
@@ -1319,8 +1319,8 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
|
|
|
1319
1319
|
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),ut.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 ut.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"),bye=B((e,t)=>{ut.warn("abc88 cutPathAtIntersect",e,t);let n=[],r=e[0],s=!1;return e.forEach(i=>{if(ut.info("abc88 checking point",i,t),!Cln(t,i)&&!s){const o=Rln(t,r,i);ut.debug("abc88 inside",i,r,o),ut.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)?ut.warn("abc88 no intersect",o,n):n.push(o),s=!0}else ut.warn("abc88 outside",i,r),r=i,s||n.push(i)}),ut.debug("returning points",n),n},"cutPathAtIntersect");function jqe(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(jqe,"extractCornerPoints");var yye=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"),Pln=B(function(e){const{cornerPointPositions:t}=jqe(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=yye(s,o,5),c=yye(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){ut.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 ut.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"),$ln=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"),Nln=B(function(e,t,n,r,s,i,o,a=!1){const{handDrawnSeed:c}=as();let l=t.points,d=!1;const p=s;var f=i;const h=[];for(const R in t.cssCompiledStyles)mYe(R)||h.push(t.cssCompiledStyles[R]);ut.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])),ut.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&&(ut.info("to cluster abc88",n.get(t.toCluster)),l=bye(t.points,n.get(t.toCluster).node),d=!0),t.fromCluster&&(ut.debug("from cluster abc88",n.get(t.fromCluster),JSON.stringify(l,null,2)),l=bye(l.reverse(),n.get(t.fromCluster).node).reverse(),d=!0);let O=l.filter(R=>!Number.isNaN(R.y));O=Pln(O);let _=O2;switch(_=k5,t.curve){case"linear":_=k5;break;case"basis":_=O2;break;case"cardinal":_=b4e;break;case"bumpX":_=h4e;break;case"bumpY":_=m4e;break;case"catmullRom":_=x4e;break;case"monotoneX":_=k4e;break;case"monotoneY":_=C4e;break;case"natural":_=P4e;break;case"step":_=$4e;break;case"stepAfter":_=A4e;break;case"stepBefore":_=N4e;break;default:_=O2}const{x:b,y}=Crn(t),x=dnn().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"?Xqe(Uqe(O,t),5):x(O);const E=Array.isArray(t.style)?t.style:[t.style];let w=E.find(R=>R?.startsWith("stroke:")),P=!1;if(t.look==="handDrawn"){const R=rn.svg(e);Object.assign([],O);const $=R.path(T,{roughness:.3,seed:c});S+=" transition",v=Qr($).select("path").attr("id",t.id).attr("class"," "+S+(t.classes?" "+t.classes:"")).attr("style",E?E.reduce((j,Q)=>j+";"+Q,""):"");let A=v.attr("d");v.attr("d",A),e.node().appendChild(v.node())}else{const R=h.join(";"),$=E?E.reduce((z,L)=>z+L+";",""):"";let A="";t.animate&&(A=" edge-animation-fast"),t.animation&&(A=" 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:"")+(A??"")).attr("style",j),w=j.match(/stroke:([^;]+)/)?.[1],P=t.animate===!0||!!t.animation||R.includes("animation");const Q=v.node(),U=typeof Q.getTotalLength=="function"?Q.getTotalLength():0,M=Dbe[t.arrowTypeStart]||0,q=Dbe[t.arrowTypeEnd]||0;if(t.look==="neo"&&!P){const L=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?$ln(U,M,q):`0 ${M} ${U-M-q} ${q}`}; 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(R=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",R.x).attr("cy",R.y)});let k="";(as().flowchart.arrowMarkerAbsolute||as().state.arrowMarkerAbsolute)&&(k=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,k=k.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),ut.info("arrowTypeStart",t.arrowTypeStart),ut.info("arrowTypeEnd",t.arrowTypeEnd),Tln(v,t,k,o,r,w);const C=Math.floor(l.length/2),I=l[C];Qd.isLabelCoordinateInPath(I,v.attr("d"))||(d=!0);let N={};return d&&(N.updatedPath=l),N.originalPath=t.points,N},"insertEdge");function Xqe(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(Xqe,"generateRoundedPath");function rJ(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(rJ,"calculateDeltaAndAngle");function Uqe(e,t){const n=e.map(s=>({...s}));if(e.length>=2&&ba[t.arrowTypeStart]){const s=ba[t.arrowTypeStart],i=e[0],o=e[1],{angle:a}=rJ(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&&ba[t.arrowTypeEnd]){const s=ba[t.arrowTypeEnd],i=e[r-1],o=e[r-2],{angle:a}=rJ(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(Uqe,"applyMarkerOffsetsToPoints");var Aln=B((e,t,n,r)=>{t.forEach(s=>{Gln[s](e,n,r)})},"insertMarkers"),Iln=B((e,t,n)=>{ut.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"),Mln=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"),Qln=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"),Dln=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"),Lln=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"),jln=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"),Xln=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"),Uln=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"),zln=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"),Bln=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"),Fln=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"),Yln=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"),Vln=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"),qln=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
|
|
1320
1320
|
L20,10
|
|
1321
1321
|
M20,10
|
|
1322
|
-
L0,20`)},"requirement_arrow"),Wln=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"),Gln={extension:Iln,composition:Mln,aggregation:Qln,dependency:Dln,lollipop:Lln,point:jln,circle:Xln,cross:Uln,barb:zln,only_one:Bln,zero_or_one:Fln,one_or_more:Yln,zero_or_more:Vln,requirement_arrow:qln,requirement_contains:Wln},Hln=Aln,Zln={common:UE,getConfig:Na,insertCluster:iln,insertEdge:Nln,insertEdgeLabel:wln,insertMarkers:Hln,insertNode:Lqe,interpolateToCurve:boe,labelHelper:$n,log:ut,positionEdgeLabel:kln},PP={},zqe=B(e=>{for(const t of e)PP[t.name]=t},"registerLayoutLoaders"),Kln=B(()=>{zqe([{name:"dagre",loader:B(async()=>await Qe(()=>import("./dagre-6UL2VRFP--faZMK7S.js"),__vite__mapDeps([12,13,14,15,16,17,1])),"loader")},{name:"cose-bilkent",loader:B(async()=>await Qe(()=>import("./cose-bilkent-S5V4N54A-BVY9tzNS.js"),__vite__mapDeps([18,19,1])),"loader")}])},"registerDefaultLayoutLoaders");Kln();var GZn=B(async(e,t)=>{if(!(e.layoutAlgorithm in PP))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);const n=PP[e.layoutAlgorithm];return(await n.loader()).render(e,t,Zln,{algorithm:n.algorithm})},"render"),HZn=B((e="",{fallback:t="dagre"}={})=>{if(e in PP)return e;if(t in PP)return ut.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"),Bqe="comm",Fqe="rule",Yqe="decl",Jln="@import",ecn="@namespace",tcn="@keyframes",ncn="@layer",Vqe=Math.abs,joe=String.fromCharCode;function qqe(e){return e.trim()}function x2(e,t,n){return e.replace(t,n)}function rcn(e,t,n){return e.indexOf(t,n)}function xv(e,t){return e.charCodeAt(t)|0}function DT(e,t,n){return e.slice(t,n)}function Kp(e){return e.length}function scn(e){return e.length}function WI(e,t){return t.push(e),e}var O3=1,LT=1,Wqe=0,id=0,Fi=0,VE="";function Xoe(e,t,n,r,s,i,o,a){return{value:e,root:t,parent:n,type:r,props:s,children:i,line:O3,column:LT,length:o,return:"",siblings:a}}function icn(){return Fi}function ocn(){return Fi=id>0?xv(VE,--id):0,LT--,Fi===10&&(LT=1,O3--),Fi}function Jd(){return Fi=id<Wqe?xv(VE,id++):0,LT++,Fi===10&&(LT=1,O3++),Fi}function dg(){return xv(VE,id)}function S2(){return id}function g3(e,t){return DT(VE,e,t)}function $P(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 acn(e){return O3=LT=1,Wqe=Kp(VE=e),id=0,[]}function lcn(e){return VE="",e}function RV(e){return qqe(g3(id-1,sJ(e===91?e+2:e===40?e+1:e)))}function ccn(e){for(;(Fi=dg())&&Fi<33;)Jd();return $P(e)>2||$P(Fi)>3?"":" "}function ucn(e,t){for(;--t&&Jd()&&!(Fi<48||Fi>102||Fi>57&&Fi<65||Fi>70&&Fi<97););return g3(e,S2()+(t<6&&dg()==32&&Jd()==32))}function sJ(e){for(;Jd();)switch(Fi){case e:return id;case 34:case 39:e!==34&&e!==39&&sJ(Fi);break;case 40:e===41&&sJ(e);break;case 92:Jd();break}return id}function dcn(e,t){for(;Jd()&&e+Fi!==57;)if(e+Fi===84&&dg()===47)break;return"/*"+g3(t,id-1)+"*"+joe(e===47?e:Jd())}function pcn(e){for(;!$P(dg());)Jd();return g3(e,id)}function fcn(e){return lcn(v2("",null,null,null,[""],e=acn(e),0,[0],e))}function v2(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=Jd()){case 40:if(m!=108&&xv(E,p-1)==58){rcn(E+=x2(RV(y),"&","&\f"),"&\f",Vqe(l?a[l-1]:0))!=-1&&(b=-1);break}case 34:case 39:case 91:E+=RV(y);break;case 9:case 10:case 13:case 32:E+=ccn(m);break;case 92:E+=ucn(S2()-1,7);continue;case 47:switch(dg()){case 42:case 47:WI(hcn(dcn(Jd(),S2()),t,n,c),c),($P(m||1)==5||$P(dg()||1)==5)&&Kp(E)&&DT(E,-1,void 0)!==" "&&(E+=" ");break;default:E+="/"}break;case 123*O:a[l++]=Kp(E)*b;case 125*O:case 59:case 0:switch(y){case 0:case 125:_=0;case 59+d:b==-1&&(E=x2(E,/\f/g,"")),h>0&&(Kp(E)-p||O===0&&m===47)&&WI(h>32?Sye(E+";",r,n,p-1,c):Sye(x2(E," ","")+";",r,n,p-2,c),c);break;case 59:E+=";";default:if(WI(T=xye(E,t,n,l,d,s,a,x,S=[],v=[],p,i),i),y===123)if(d===0)v2(E,t,T,T,S,i,p,a,v);else{switch(f){case 99:if(xv(E,3)===110)break;case 108:if(xv(E,2)===97)break;default:d=0;case 100:case 109:case 115:}d?v2(e,T,T,r&&WI(xye(e,T,T,0,0,s,a,x,s,S=[],p,v),v),s,v,p,a,r?S:v):v2(E,T,T,T,[""],v,0,a,v)}}l=d=h=0,O=b=1,x=E="",p=o;break;case 58:p=1+Kp(E),h=m;default:if(O<1){if(y==123)--O;else if(y==125&&O++==0&&ocn()==125)continue}switch(E+=joe(y),y*O){case 38:b=d>0?1:(E+="\f",-1);break;case 44:a[l++]=(Kp(E)-1)*b,b=1;break;case 64:dg()===45&&(E+=RV(Jd())),f=dg(),d=p=Kp(x=E+=pcn(S2())),y++;break;case 45:m===45&&Kp(E)==2&&(O=0)}}return i}function xye(e,t,n,r,s,i,o,a,c,l,d,p){for(var f=s-1,h=s===0?i:[""],m=scn(h),O=0,_=0,b=0;O<r;++O)for(var y=0,x=DT(e,f+1,f=Vqe(_=o[O])),S=e;y<m;++y)(S=qqe(_>0?h[y]+" "+x:x2(x,/&\f/g,h[y])))&&(c[b++]=S);return Xoe(e,t,n,s===0?Fqe:a,c,l,d,p)}function hcn(e,t,n,r){return Xoe(e,t,n,Bqe,joe(icn()),DT(e,2,-2),0,r)}function Sye(e,t,n,r,s){return Xoe(e,t,n,Yqe,DT(e,0,r),DT(e,r+1,-1),r,s)}function iJ(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function mcn(e,t,n,r){switch(e.type){case ncn:if(e.children.length)break;case Jln:case ecn:case Yqe:return e.return=e.return||e.value;case Bqe:return"";case tcn:return e.return=e.value+"{"+iJ(e.children,r)+"}";case Fqe:if(!Kp(e.value=e.props.join(",")))return""}return Kp(n=iJ(e.children,r))?e.return=e.value+"{"+n+"}":""}var Ocn=yYe(Object.keys,Object),gcn=Object.prototype,_cn=gcn.hasOwnProperty;function bcn(e){if(!o3(e))return Ocn(e);var t=[];for(var n in Object(e))_cn.call(e,n)&&n!="constructor"&&t.push(n);return t}var oJ=Ky(Jf,"DataView"),aJ=Ky(Jf,"Promise"),lJ=Ky(Jf,"Set"),cJ=Ky(Jf,"WeakMap"),vye="[object Map]",ycn="[object Object]",Tye="[object Promise]",Eye="[object Set]",wye="[object WeakMap]",kye="[object DataView]",xcn=Zy(oJ),Scn=Zy(CP),vcn=Zy(aJ),Tcn=Zy(lJ),Ecn=Zy(cJ),E0=BE;(oJ&&E0(new oJ(new ArrayBuffer(1)))!=kye||CP&&E0(new CP)!=vye||aJ&&E0(aJ.resolve())!=Tye||lJ&&E0(new lJ)!=Eye||cJ&&E0(new cJ)!=wye)&&(E0=function(e){var t=BE(e),n=t==ycn?e.constructor:void 0,r=n?Zy(n):"";if(r)switch(r){case xcn:return kye;case Scn:return vye;case vcn:return Tye;case Tcn:return Eye;case Ecn:return wye}return t});var wcn="[object Map]",kcn="[object Set]",Ccn=Object.prototype,Rcn=Ccn.hasOwnProperty;function Cye(e){if(e==null)return!0;if(a3(e)&&(X5(e)||typeof e=="string"||typeof e.splice=="function"||goe(e)||_oe(e)||j5(e)))return!e.length;var t=E0(e);if(t==wcn||t==kcn)return!e.size;if(o3(e))return!bcn(e).length;for(var n in e)if(Rcn.call(e,n))return!1;return!0}var Gqe="c4",Pcn=B(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),$cn=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./c4Diagram-YG6GDRKO-z4ASXsqO.js");return{diagram:t}},__vite__mapDeps([20,21,1]));return{id:Gqe,diagram:e}},"loader"),Ncn={id:Gqe,detector:Pcn,loader:$cn},Acn=Ncn,Hqe="flowchart",Icn=B((e,t)=>t?.flowchart?.defaultRenderer==="dagre-wrapper"||t?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(e),"detector"),Mcn=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-kcRZb1MY.js");return{diagram:t}},__vite__mapDeps([22,23,24,25,26,1]));return{id:Hqe,diagram:e}},"loader"),Qcn={id:Hqe,detector:Icn,loader:Mcn},Dcn=Qcn,Zqe="flowchart-v2",Lcn=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"),jcn=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-kcRZb1MY.js");return{diagram:t}},__vite__mapDeps([22,23,24,25,26,1]));return{id:Zqe,diagram:e}},"loader"),Xcn={id:Zqe,detector:Lcn,loader:jcn},Ucn=Xcn,Kqe="er",zcn=B(e=>/^\s*erDiagram/.test(e),"detector"),Bcn=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./erDiagram-Q2GNP2WA-BDEvbMUF.js");return{diagram:t}},__vite__mapDeps([27,24,25,26,1]));return{id:Kqe,diagram:e}},"loader"),Fcn={id:Kqe,detector:zcn,loader:Bcn},Ycn=Fcn,Jqe="gitGraph",Vcn=B(e=>/^\s*gitGraph/.test(e),"detector"),qcn=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./gitGraphDiagram-V2S2FVAM-AldFx-Oq.js");return{diagram:t}},__vite__mapDeps([28,29,30,31,14,16,17,1]));return{id:Jqe,diagram:e}},"loader"),Wcn={id:Jqe,detector:Vcn,loader:qcn},Gcn=Wcn,e6e="gantt",Hcn=B(e=>/^\s*gantt/.test(e),"detector"),Zcn=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./ganttDiagram-JELNMOA3-DqTbb3Zl.js");return{diagram:t}},__vite__mapDeps([32,33,34,35,1]));return{id:e6e,diagram:e}},"loader"),Kcn={id:e6e,detector:Hcn,loader:Zcn},Jcn=Kcn,t6e="info",eun=B(e=>/^\s*info/.test(e),"detector"),tun=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./infoDiagram-HS3SLOUP-CZ8BxA5O.js");return{diagram:t}},__vite__mapDeps([36,31,14,16,17,1]));return{id:t6e,diagram:e}},"loader"),nun={id:t6e,detector:eun,loader:tun},n6e="pie",run=B(e=>/^\s*pie/.test(e),"detector"),sun=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./pieDiagram-ADFJNKIX-C2bgVxYV.js");return{diagram:t}},__vite__mapDeps([37,29,31,14,16,17,38,39,34,1]));return{id:n6e,diagram:e}},"loader"),iun={id:n6e,detector:run,loader:sun},r6e="quadrantChart",oun=B(e=>/^\s*quadrantChart/.test(e),"detector"),aun=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./quadrantDiagram-AYHSOK5B-DyiRJVZc.js");return{diagram:t}},__vite__mapDeps([40,33,34,35,1]));return{id:r6e,diagram:e}},"loader"),lun={id:r6e,detector:oun,loader:aun},cun=lun,s6e="xychart",uun=B(e=>/^\s*xychart(-beta)?/.test(e),"detector"),dun=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./xychartDiagram-PRI3JC2R-BtaW7FFn.js");return{diagram:t}},__vite__mapDeps([41,34,39,33,35,1]));return{id:s6e,diagram:e}},"loader"),pun={id:s6e,detector:uun,loader:dun},fun=pun,i6e="requirement",hun=B(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),mun=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./requirementDiagram-UZGBJVZJ-9dKf2vDK.js");return{diagram:t}},__vite__mapDeps([42,24,25,1]));return{id:i6e,diagram:e}},"loader"),Oun={id:i6e,detector:hun,loader:mun},gun=Oun,o6e="sequence",_un=B(e=>/^\s*sequenceDiagram/.test(e),"detector"),bun=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./sequenceDiagram-WL72ISMW-BBGTN3ZY.js");return{diagram:t}},__vite__mapDeps([43,21,30,1]));return{id:o6e,diagram:e}},"loader"),yun={id:o6e,detector:_un,loader:bun},xun=yun,a6e="class",Sun=B((e,t)=>t?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e),"detector"),vun=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./classDiagram-2ON5EDUG-BcZUsklT.js");return{diagram:t}},__vite__mapDeps([44,45,23,24,25,1]));return{id:a6e,diagram:e}},"loader"),Tun={id:a6e,detector:Sun,loader:vun},Eun=Tun,l6e="classDiagram",wun=B((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e),"detector"),kun=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./classDiagram-v2-WZHVMYZB-BcZUsklT.js");return{diagram:t}},__vite__mapDeps([46,45,23,24,25,1]));return{id:l6e,diagram:e}},"loader"),Cun={id:l6e,detector:wun,loader:kun},Run=Cun,c6e="state",Pun=B((e,t)=>t?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e),"detector"),$un=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./stateDiagram-FKZM4ZOC-Bg5q7FLR.js");return{diagram:t}},__vite__mapDeps([47,48,24,25,13,14,15,16,1]));return{id:c6e,diagram:e}},"loader"),Nun={id:c6e,detector:Pun,loader:$un},Aun=Nun,u6e="stateDiagram",Iun=B((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer==="dagre-wrapper"),"detector"),Mun=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./stateDiagram-v2-4FDKWEC3-BEe_MxUA.js");return{diagram:t}},__vite__mapDeps([49,48,24,25,1]));return{id:u6e,diagram:e}},"loader"),Qun={id:u6e,detector:Iun,loader:Mun},Dun=Qun,d6e="journey",Lun=B(e=>/^\s*journey/.test(e),"detector"),jun=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./journeyDiagram-XKPGCS4Q-DFap5MzN.js");return{diagram:t}},__vite__mapDeps([50,21,23,38,1]));return{id:d6e,diagram:e}},"loader"),Xun={id:d6e,detector:Lun,loader:jun},Uun=Xun,zun=B((e,t,n)=>{ut.debug(`rendering svg for syntax error
|
|
1323
|
-
`);const r=ynn(t),s=r.append("g");r.attr("viewBox","0 0 2412 512"),DBe(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"),p6e={draw:zun},Bun=p6e,Fun={db:{},renderer:p6e,parser:{parse:B(()=>{},"parse")}},Yun=Fun,f6e="flowchart-elk",Vun=B((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk"?(t.layout="elk",!0):!1,"detector"),qun=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-
|
|
1322
|
+
L0,20`)},"requirement_arrow"),Wln=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"),Gln={extension:Iln,composition:Mln,aggregation:Qln,dependency:Dln,lollipop:Lln,point:jln,circle:Xln,cross:Uln,barb:zln,only_one:Bln,zero_or_one:Fln,one_or_more:Yln,zero_or_more:Vln,requirement_arrow:qln,requirement_contains:Wln},Hln=Aln,Zln={common:UE,getConfig:Na,insertCluster:iln,insertEdge:Nln,insertEdgeLabel:wln,insertMarkers:Hln,insertNode:Lqe,interpolateToCurve:boe,labelHelper:$n,log:ut,positionEdgeLabel:kln},PP={},zqe=B(e=>{for(const t of e)PP[t.name]=t},"registerLayoutLoaders"),Kln=B(()=>{zqe([{name:"dagre",loader:B(async()=>await Qe(()=>import("./dagre-6UL2VRFP-Yd_BzJ7X.js"),__vite__mapDeps([12,13,14,15,16,17,1])),"loader")},{name:"cose-bilkent",loader:B(async()=>await Qe(()=>import("./cose-bilkent-S5V4N54A-B8LUaIV2.js"),__vite__mapDeps([18,19,1])),"loader")}])},"registerDefaultLayoutLoaders");Kln();var GZn=B(async(e,t)=>{if(!(e.layoutAlgorithm in PP))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);const n=PP[e.layoutAlgorithm];return(await n.loader()).render(e,t,Zln,{algorithm:n.algorithm})},"render"),HZn=B((e="",{fallback:t="dagre"}={})=>{if(e in PP)return e;if(t in PP)return ut.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"),Bqe="comm",Fqe="rule",Yqe="decl",Jln="@import",ecn="@namespace",tcn="@keyframes",ncn="@layer",Vqe=Math.abs,joe=String.fromCharCode;function qqe(e){return e.trim()}function x2(e,t,n){return e.replace(t,n)}function rcn(e,t,n){return e.indexOf(t,n)}function xv(e,t){return e.charCodeAt(t)|0}function DT(e,t,n){return e.slice(t,n)}function Kp(e){return e.length}function scn(e){return e.length}function WI(e,t){return t.push(e),e}var O3=1,LT=1,Wqe=0,id=0,Fi=0,VE="";function Xoe(e,t,n,r,s,i,o,a){return{value:e,root:t,parent:n,type:r,props:s,children:i,line:O3,column:LT,length:o,return:"",siblings:a}}function icn(){return Fi}function ocn(){return Fi=id>0?xv(VE,--id):0,LT--,Fi===10&&(LT=1,O3--),Fi}function Jd(){return Fi=id<Wqe?xv(VE,id++):0,LT++,Fi===10&&(LT=1,O3++),Fi}function dg(){return xv(VE,id)}function S2(){return id}function g3(e,t){return DT(VE,e,t)}function $P(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 acn(e){return O3=LT=1,Wqe=Kp(VE=e),id=0,[]}function lcn(e){return VE="",e}function RV(e){return qqe(g3(id-1,sJ(e===91?e+2:e===40?e+1:e)))}function ccn(e){for(;(Fi=dg())&&Fi<33;)Jd();return $P(e)>2||$P(Fi)>3?"":" "}function ucn(e,t){for(;--t&&Jd()&&!(Fi<48||Fi>102||Fi>57&&Fi<65||Fi>70&&Fi<97););return g3(e,S2()+(t<6&&dg()==32&&Jd()==32))}function sJ(e){for(;Jd();)switch(Fi){case e:return id;case 34:case 39:e!==34&&e!==39&&sJ(Fi);break;case 40:e===41&&sJ(e);break;case 92:Jd();break}return id}function dcn(e,t){for(;Jd()&&e+Fi!==57;)if(e+Fi===84&&dg()===47)break;return"/*"+g3(t,id-1)+"*"+joe(e===47?e:Jd())}function pcn(e){for(;!$P(dg());)Jd();return g3(e,id)}function fcn(e){return lcn(v2("",null,null,null,[""],e=acn(e),0,[0],e))}function v2(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=Jd()){case 40:if(m!=108&&xv(E,p-1)==58){rcn(E+=x2(RV(y),"&","&\f"),"&\f",Vqe(l?a[l-1]:0))!=-1&&(b=-1);break}case 34:case 39:case 91:E+=RV(y);break;case 9:case 10:case 13:case 32:E+=ccn(m);break;case 92:E+=ucn(S2()-1,7);continue;case 47:switch(dg()){case 42:case 47:WI(hcn(dcn(Jd(),S2()),t,n,c),c),($P(m||1)==5||$P(dg()||1)==5)&&Kp(E)&&DT(E,-1,void 0)!==" "&&(E+=" ");break;default:E+="/"}break;case 123*O:a[l++]=Kp(E)*b;case 125*O:case 59:case 0:switch(y){case 0:case 125:_=0;case 59+d:b==-1&&(E=x2(E,/\f/g,"")),h>0&&(Kp(E)-p||O===0&&m===47)&&WI(h>32?Sye(E+";",r,n,p-1,c):Sye(x2(E," ","")+";",r,n,p-2,c),c);break;case 59:E+=";";default:if(WI(T=xye(E,t,n,l,d,s,a,x,S=[],v=[],p,i),i),y===123)if(d===0)v2(E,t,T,T,S,i,p,a,v);else{switch(f){case 99:if(xv(E,3)===110)break;case 108:if(xv(E,2)===97)break;default:d=0;case 100:case 109:case 115:}d?v2(e,T,T,r&&WI(xye(e,T,T,0,0,s,a,x,s,S=[],p,v),v),s,v,p,a,r?S:v):v2(E,T,T,T,[""],v,0,a,v)}}l=d=h=0,O=b=1,x=E="",p=o;break;case 58:p=1+Kp(E),h=m;default:if(O<1){if(y==123)--O;else if(y==125&&O++==0&&ocn()==125)continue}switch(E+=joe(y),y*O){case 38:b=d>0?1:(E+="\f",-1);break;case 44:a[l++]=(Kp(E)-1)*b,b=1;break;case 64:dg()===45&&(E+=RV(Jd())),f=dg(),d=p=Kp(x=E+=pcn(S2())),y++;break;case 45:m===45&&Kp(E)==2&&(O=0)}}return i}function xye(e,t,n,r,s,i,o,a,c,l,d,p){for(var f=s-1,h=s===0?i:[""],m=scn(h),O=0,_=0,b=0;O<r;++O)for(var y=0,x=DT(e,f+1,f=Vqe(_=o[O])),S=e;y<m;++y)(S=qqe(_>0?h[y]+" "+x:x2(x,/&\f/g,h[y])))&&(c[b++]=S);return Xoe(e,t,n,s===0?Fqe:a,c,l,d,p)}function hcn(e,t,n,r){return Xoe(e,t,n,Bqe,joe(icn()),DT(e,2,-2),0,r)}function Sye(e,t,n,r,s){return Xoe(e,t,n,Yqe,DT(e,0,r),DT(e,r+1,-1),r,s)}function iJ(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function mcn(e,t,n,r){switch(e.type){case ncn:if(e.children.length)break;case Jln:case ecn:case Yqe:return e.return=e.return||e.value;case Bqe:return"";case tcn:return e.return=e.value+"{"+iJ(e.children,r)+"}";case Fqe:if(!Kp(e.value=e.props.join(",")))return""}return Kp(n=iJ(e.children,r))?e.return=e.value+"{"+n+"}":""}var Ocn=yYe(Object.keys,Object),gcn=Object.prototype,_cn=gcn.hasOwnProperty;function bcn(e){if(!o3(e))return Ocn(e);var t=[];for(var n in Object(e))_cn.call(e,n)&&n!="constructor"&&t.push(n);return t}var oJ=Ky(Jf,"DataView"),aJ=Ky(Jf,"Promise"),lJ=Ky(Jf,"Set"),cJ=Ky(Jf,"WeakMap"),vye="[object Map]",ycn="[object Object]",Tye="[object Promise]",Eye="[object Set]",wye="[object WeakMap]",kye="[object DataView]",xcn=Zy(oJ),Scn=Zy(CP),vcn=Zy(aJ),Tcn=Zy(lJ),Ecn=Zy(cJ),E0=BE;(oJ&&E0(new oJ(new ArrayBuffer(1)))!=kye||CP&&E0(new CP)!=vye||aJ&&E0(aJ.resolve())!=Tye||lJ&&E0(new lJ)!=Eye||cJ&&E0(new cJ)!=wye)&&(E0=function(e){var t=BE(e),n=t==ycn?e.constructor:void 0,r=n?Zy(n):"";if(r)switch(r){case xcn:return kye;case Scn:return vye;case vcn:return Tye;case Tcn:return Eye;case Ecn:return wye}return t});var wcn="[object Map]",kcn="[object Set]",Ccn=Object.prototype,Rcn=Ccn.hasOwnProperty;function Cye(e){if(e==null)return!0;if(a3(e)&&(X5(e)||typeof e=="string"||typeof e.splice=="function"||goe(e)||_oe(e)||j5(e)))return!e.length;var t=E0(e);if(t==wcn||t==kcn)return!e.size;if(o3(e))return!bcn(e).length;for(var n in e)if(Rcn.call(e,n))return!1;return!0}var Gqe="c4",Pcn=B(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),$cn=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./c4Diagram-YG6GDRKO-Di5L-goJ.js");return{diagram:t}},__vite__mapDeps([20,21,1]));return{id:Gqe,diagram:e}},"loader"),Ncn={id:Gqe,detector:Pcn,loader:$cn},Acn=Ncn,Hqe="flowchart",Icn=B((e,t)=>t?.flowchart?.defaultRenderer==="dagre-wrapper"||t?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(e),"detector"),Mcn=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-xlLG9tm_.js");return{diagram:t}},__vite__mapDeps([22,23,24,25,26,1]));return{id:Hqe,diagram:e}},"loader"),Qcn={id:Hqe,detector:Icn,loader:Mcn},Dcn=Qcn,Zqe="flowchart-v2",Lcn=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"),jcn=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-xlLG9tm_.js");return{diagram:t}},__vite__mapDeps([22,23,24,25,26,1]));return{id:Zqe,diagram:e}},"loader"),Xcn={id:Zqe,detector:Lcn,loader:jcn},Ucn=Xcn,Kqe="er",zcn=B(e=>/^\s*erDiagram/.test(e),"detector"),Bcn=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./erDiagram-Q2GNP2WA-RrBObwfM.js");return{diagram:t}},__vite__mapDeps([27,24,25,26,1]));return{id:Kqe,diagram:e}},"loader"),Fcn={id:Kqe,detector:zcn,loader:Bcn},Ycn=Fcn,Jqe="gitGraph",Vcn=B(e=>/^\s*gitGraph/.test(e),"detector"),qcn=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./gitGraphDiagram-V2S2FVAM-CuGidXMi.js");return{diagram:t}},__vite__mapDeps([28,29,30,31,14,16,17,1]));return{id:Jqe,diagram:e}},"loader"),Wcn={id:Jqe,detector:Vcn,loader:qcn},Gcn=Wcn,e6e="gantt",Hcn=B(e=>/^\s*gantt/.test(e),"detector"),Zcn=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./ganttDiagram-JELNMOA3-B6Al4dAh.js");return{diagram:t}},__vite__mapDeps([32,33,34,35,1]));return{id:e6e,diagram:e}},"loader"),Kcn={id:e6e,detector:Hcn,loader:Zcn},Jcn=Kcn,t6e="info",eun=B(e=>/^\s*info/.test(e),"detector"),tun=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./infoDiagram-HS3SLOUP-ngSZr4DB.js");return{diagram:t}},__vite__mapDeps([36,31,14,16,17,1]));return{id:t6e,diagram:e}},"loader"),nun={id:t6e,detector:eun,loader:tun},n6e="pie",run=B(e=>/^\s*pie/.test(e),"detector"),sun=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./pieDiagram-ADFJNKIX-DLjsd_sD.js");return{diagram:t}},__vite__mapDeps([37,29,31,14,16,17,38,39,34,1]));return{id:n6e,diagram:e}},"loader"),iun={id:n6e,detector:run,loader:sun},r6e="quadrantChart",oun=B(e=>/^\s*quadrantChart/.test(e),"detector"),aun=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./quadrantDiagram-AYHSOK5B-D25UFXCn.js");return{diagram:t}},__vite__mapDeps([40,33,34,35,1]));return{id:r6e,diagram:e}},"loader"),lun={id:r6e,detector:oun,loader:aun},cun=lun,s6e="xychart",uun=B(e=>/^\s*xychart(-beta)?/.test(e),"detector"),dun=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./xychartDiagram-PRI3JC2R-DpXwqxEZ.js");return{diagram:t}},__vite__mapDeps([41,34,39,33,35,1]));return{id:s6e,diagram:e}},"loader"),pun={id:s6e,detector:uun,loader:dun},fun=pun,i6e="requirement",hun=B(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),mun=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./requirementDiagram-UZGBJVZJ-1dT3ylVG.js");return{diagram:t}},__vite__mapDeps([42,24,25,1]));return{id:i6e,diagram:e}},"loader"),Oun={id:i6e,detector:hun,loader:mun},gun=Oun,o6e="sequence",_un=B(e=>/^\s*sequenceDiagram/.test(e),"detector"),bun=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./sequenceDiagram-WL72ISMW-C2vbAh6y.js");return{diagram:t}},__vite__mapDeps([43,21,30,1]));return{id:o6e,diagram:e}},"loader"),yun={id:o6e,detector:_un,loader:bun},xun=yun,a6e="class",Sun=B((e,t)=>t?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e),"detector"),vun=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./classDiagram-2ON5EDUG-BNtx_JTN.js");return{diagram:t}},__vite__mapDeps([44,45,23,24,25,1]));return{id:a6e,diagram:e}},"loader"),Tun={id:a6e,detector:Sun,loader:vun},Eun=Tun,l6e="classDiagram",wun=B((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e),"detector"),kun=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./classDiagram-v2-WZHVMYZB-BNtx_JTN.js");return{diagram:t}},__vite__mapDeps([46,45,23,24,25,1]));return{id:l6e,diagram:e}},"loader"),Cun={id:l6e,detector:wun,loader:kun},Run=Cun,c6e="state",Pun=B((e,t)=>t?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e),"detector"),$un=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./stateDiagram-FKZM4ZOC-eS7McRG8.js");return{diagram:t}},__vite__mapDeps([47,48,24,25,13,14,15,16,1]));return{id:c6e,diagram:e}},"loader"),Nun={id:c6e,detector:Pun,loader:$un},Aun=Nun,u6e="stateDiagram",Iun=B((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer==="dagre-wrapper"),"detector"),Mun=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./stateDiagram-v2-4FDKWEC3-06gw1trU.js");return{diagram:t}},__vite__mapDeps([49,48,24,25,1]));return{id:u6e,diagram:e}},"loader"),Qun={id:u6e,detector:Iun,loader:Mun},Dun=Qun,d6e="journey",Lun=B(e=>/^\s*journey/.test(e),"detector"),jun=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./journeyDiagram-XKPGCS4Q-DUYha9XK.js");return{diagram:t}},__vite__mapDeps([50,21,23,38,1]));return{id:d6e,diagram:e}},"loader"),Xun={id:d6e,detector:Lun,loader:jun},Uun=Xun,zun=B((e,t,n)=>{ut.debug(`rendering svg for syntax error
|
|
1323
|
+
`);const r=ynn(t),s=r.append("g");r.attr("viewBox","0 0 2412 512"),DBe(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"),p6e={draw:zun},Bun=p6e,Fun={db:{},renderer:p6e,parser:{parse:B(()=>{},"parse")}},Yun=Fun,f6e="flowchart-elk",Vun=B((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk"?(t.layout="elk",!0):!1,"detector"),qun=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-xlLG9tm_.js");return{diagram:t}},__vite__mapDeps([22,23,24,25,26,1]));return{id:f6e,diagram:e}},"loader"),Wun={id:f6e,detector:Vun,loader:qun},Gun=Wun,h6e="timeline",Hun=B(e=>/^\s*timeline/.test(e),"detector"),Zun=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./timeline-definition-IT6M3QCI-CSL5SWqc.js");return{diagram:t}},__vite__mapDeps([51,38,1]));return{id:h6e,diagram:e}},"loader"),Kun={id:h6e,detector:Hun,loader:Zun},Jun=Kun,m6e="mindmap",edn=B(e=>/^\s*mindmap/.test(e),"detector"),tdn=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./mindmap-definition-VGOIOE7T-DsyExv6x.js");return{diagram:t}},__vite__mapDeps([52,24,25,1]));return{id:m6e,diagram:e}},"loader"),ndn={id:m6e,detector:edn,loader:tdn},rdn=ndn,O6e="kanban",sdn=B(e=>/^\s*kanban/.test(e),"detector"),idn=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./kanban-definition-3W4ZIXB7-DLZKoOOn.js");return{diagram:t}},__vite__mapDeps([53,23,1]));return{id:O6e,diagram:e}},"loader"),odn={id:O6e,detector:sdn,loader:idn},adn=odn,g6e="sankey",ldn=B(e=>/^\s*sankey(-beta)?/.test(e),"detector"),cdn=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./sankeyDiagram-TZEHDZUN-B1LLRw_7.js");return{diagram:t}},__vite__mapDeps([54,39,34,1]));return{id:g6e,diagram:e}},"loader"),udn={id:g6e,detector:ldn,loader:cdn},ddn=udn,_6e="packet",pdn=B(e=>/^\s*packet(-beta)?/.test(e),"detector"),fdn=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./diagram-S2PKOQOG-D6oc2CRZ.js");return{diagram:t}},__vite__mapDeps([55,29,31,14,16,17,1]));return{id:_6e,diagram:e}},"loader"),hdn={id:_6e,detector:pdn,loader:fdn},b6e="radar",mdn=B(e=>/^\s*radar-beta/.test(e),"detector"),Odn=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./diagram-QEK2KX5R-DbhFrd7F.js");return{diagram:t}},__vite__mapDeps([56,29,31,14,16,17,1]));return{id:b6e,diagram:e}},"loader"),gdn={id:b6e,detector:mdn,loader:Odn},y6e="block",_dn=B(e=>/^\s*block(-beta)?/.test(e),"detector"),bdn=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./blockDiagram-VD42YOAC-D8xGHFXg.js");return{diagram:t}},__vite__mapDeps([57,23,17,14,13,26,1]));return{id:y6e,diagram:e}},"loader"),ydn={id:y6e,detector:_dn,loader:bdn},xdn=ydn,x6e="architecture",Sdn=B(e=>/^\s*architecture/.test(e),"detector"),vdn=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./architectureDiagram-VXUJARFQ-zam-7hA6.js");return{diagram:t}},__vite__mapDeps([58,29,31,14,16,17,19,1]));return{id:x6e,diagram:e}},"loader"),Tdn={id:x6e,detector:Sdn,loader:vdn},Edn=Tdn,S6e="treemap",wdn=B(e=>/^\s*treemap/.test(e),"detector"),kdn=B(async()=>{const{diagram:e}=await Qe(async()=>{const{diagram:t}=await import("./diagram-PSM6KHXK-DZn1fMo1.js");return{diagram:t}},__vite__mapDeps([59,25,29,31,14,16,17,35,39,34,1]));return{id:S6e,diagram:e}},"loader"),Cdn={id:S6e,detector:wdn,loader:kdn},Rye=!1,_3=B(()=>{Rye||(Rye=!0,y5("error",Yun,e=>e.toLowerCase().trim()==="error"),y5("---",{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("---")),OK(Gun,rdn,Edn),OK(Acn,adn,Run,Eun,Ycn,Jcn,nun,iun,gun,xun,Ucn,Dcn,Jun,Gcn,Dun,Aun,Uun,cun,ddn,hdn,fun,xdn,gdn,Cdn))},"addDiagrams"),Rdn=B(async()=>{ut.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(ry).map(async([n,{detector:r,loader:s}])=>{if(s)try{yK(n)}catch{try{const{diagram:i,id:o}=await s();y5(o,i,r)}catch(i){throw ut.error(`Failed to load external diagram with key ${n}. Removing from detectors.`),delete ry[n],i}}}))).filter(n=>n.status==="rejected");if(t.length>0){ut.error(`Failed to load ${t.length} external diagrams`);for(const n of t)ut.error(n);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),Pdn="graphics-document document";function v6e(e,t){e.attr("role",Pdn),t!==""&&e.attr("aria-roledescription",t)}B(v6e,"setA11yDiagramInfo");function T6e(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(T6e,"addSVGa11yTitleDescription");var uJ=class E6e{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=Na(),s=zie(t,r);t=Con(t)+`
|
|
1324
1324
|
`;try{yK(s)}catch{const l=HZt(s);if(!l)throw new EBe(`Diagram ${s} not found.`);const{id:d,diagram:p}=await l();y5(d,p)}const{db:i,parser:o,renderer:a,init:c}=yK(s);return o.parser&&(o.parser.yy=i),i.clear?.(),c?.(r),n.title&&i.setDiagramTitle?.(n.title),await o.parse(t),new E6e(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}},Pye=[],$dn=B(()=>{Pye.forEach(e=>{e()}),Pye=[]},"attachFunctions"),Ndn=B(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function w6e(e){const t=e.match(TBe);if(!t)return{text:e,metadata:{}};let n=krn(t[1],{schema:wrn})??{};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(w6e,"extractFrontMatter");var Adn=B(e=>e.replace(/\r\n?/g,`
|
|
1325
1325
|
`).replace(/<(\w+)([^>]*)>/g,(t,n,r)=>"<"+n+r.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),Idn=B(e=>{const{text:t,metadata:n}=w6e(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"),Mdn=B(e=>{const t=Qd.detectInit(e)??{},n=Qd.detectDirective(e,"wrap");return Array.isArray(n)?t.wrap=n.some(({type:r})=>r==="wrap"):n?.type==="wrap"&&(t.wrap=!0),{text:mon(e),directive:t}},"processDirectives");function Uoe(e){const t=Adn(e),n=Idn(t),r=Mdn(n.text),s=Toe(n.config,r.directive);return e=Ndn(r.text),{code:e,title:n.title,config:s}}B(Uoe,"preprocessDiagram");function k6e(e){const t=new TextEncoder().encode(e),n=Array.from(t,r=>String.fromCodePoint(r)).join("");return btoa(n)}B(k6e,"toBase64");var Qdn=5e4,Ddn="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",Ldn="sandbox",jdn="loose",Xdn="http://www.w3.org/2000/svg",Udn="http://www.w3.org/1999/xlink",zdn="http://www.w3.org/1999/xhtml",Bdn="100%",Fdn="100%",Ydn="border:0;margin:0;",Vdn="margin:0",qdn="allow-top-navigation-by-user-activation allow-popups",Wdn='The "iframe" tag is not supported by your browser.',Gdn=["foreignobject"],Hdn=["dominant-baseline"];function zoe(e){const t=Uoe(e);return _5(),pKt(t.config??{}),t}B(zoe,"processAndSetConfigs");async function C6e(e,t){_3();try{const{code:n,config:r}=zoe(e);return{diagramType:(await P6e(n)).type,config:r}}catch(n){if(t?.suppressErrors)return!1;throw n}}B(C6e,"parse");var $ye=B((e,t,n=[])=>`
|
|
1326
1326
|
.${e} ${t} { ${n.join(" !important; ")} !important; }`,"cssImportantStyles"),Zdn=B((e,t=new Map)=>{let n="";if(e.themeCSS!==void 0&&(n+=`
|
|
@@ -1641,7 +1641,7 @@ ${ye}`.slice(0,2e3);f?.(Pe,Be)},[mn,e.from,e.summary,e,f,R,N]),Sn=L&&x,jt=Sn&&!T
|
|
|
1641
1641
|
|
|
1642
1642
|
已隐藏 CLI 流中的原始载荷,因为其中包含编码或类似二进制的内容。
|
|
1643
1643
|
|
|
1644
|
-
请展开下面的 **CLI 日志** 查看可读诊断。`:null}const t2n=({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=JQn(h,c),[v,T]=g.useState(()=>i??!1),[E,w]=g.useState(!1),[P,k]=g.useState(s),C=g.useRef(null),I=r==="error",N=e2n(_,I),R=b?.filter($=>$.severity==="warning"||$.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(()=>{I&&O&&(T(!0),k(!1))},[I,O]),u.jsxs("div",{className:nt(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",I&&"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(Kn,{size:14,className:"shrink-0 text-amber-400"}):p==="info"?u.jsx(ni,{size:14,className:"shrink-0 text-sky-400"}):u.jsx(yl,{size:14,className:"shrink-0 text-[var(--step-done-text)]"}),u.jsx("p",{className:nt("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(qt,{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:nt("mt-1.5 text-xs",I||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(rKe,{steps:ZQn,currentIndex:o,errorIndex:a})}),R.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($=>!$),children:[E?u.jsx(Ur,{size:12}):u.jsx(Ln,{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:R.map($=>u.jsxs("div",{className:"text-[11px]",children:[u.jsx("div",{className:nt($.severity==="error"?"text-red-400":$.severity==="warning"?"text-amber-400":"text-[var(--color-text-secondary)]"),children:$.label}),$.detail?u.jsx("div",{className:"mt-0.5 text-[10px] text-[var(--color-text-muted)]",children:$.detail}):null]},$.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($=>!$),children:[P?u.jsx(Ur,{size:12}):u.jsx(Ln,{size:12}),"实时输出"]}),P?u.jsx("div",{ref:C,className:nt("mt-1 h-40 overflow-y-auto rounded border border-[var(--color-border)] bg-[var(--color-surface)] p-2",I&&"border-red-500/40"),children:N?u.jsx(ai,{content:N,bare:!0,maxHeight:"max-h-none"}):u.jsx("p",{className:nt("text-[11px]",I?"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($=>!$),children:[v?u.jsx(Ur,{size:12}):u.jsx(Ln,{size:12}),"CLI 日志"]}),v?u.jsx(lKe,{cliLogsTail:O,order:"newest-first",className:"mt-1"}):null]}):null]})};function cKe(e){const{progress:t,cancelProvisioning:n,cancelCurrentProvisioning:r,teamMembers:s,memberSpawnStatuses:i,memberSpawnSnapshot:o}=oe(Et(c=>({progress:Df(c,e),cancelProvisioning:c.cancelProvisioning,cancelCurrentProvisioning:c.cancelCurrentProvisioning,teamMembers:Xse(c,e),memberSpawnStatuses:c.memberSpawnStatusesByTeam[e],memberSpawnSnapshot:c.memberSpawnSnapshotsByTeam[e]})));return{presentation:g.useMemo(()=>$le({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 uKe=g.memo(function({teamName:t,surface:n="flat",dismissible:r=!1,className:s,defaultLogsOpen:i}){const{presentation:o,cancelProvisioning:a,cancelCurrentProvisioning:c,runInstanceKey:l}=cKe(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(t2n,{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:nt("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}),n2n=gie.map(e=>({key:e.key,label:e.label})),r2n={"--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 s2n(e){return e!=null&&(e.isActive||e.isFailed)}const i2n=({teamName:e,enabled:t=!0})=>{const{presentation:n,runInstanceKey:r}=cKe(e),s=g.useRef(-1),[i,o]=g.useState(!1),a=t&&s2n(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:r2n,children:u.jsx(rKe,{steps:n2n,currentIndex:n.currentStepIndex,errorIndex:c,className:"w-full origin-top scale-[0.88]"})}),u.jsx("span",{className:"sr-only",children:l})]}),u.jsx(_s,{open:i,onOpenChange:o,children:u.jsxs(cs,{className:"w-[min(1120px,92vw)] max-w-5xl p-0",children:[u.jsxs(bs,{className:"sr-only",children:[u.jsx(us,{children:"启动详情"}),u.jsx(wi,{children:"查看团队启动进度、实时输出和 CLI 日志。"})]}),u.jsx("div",{className:"max-h-[85vh] overflow-y-auto p-4",children:u.jsx(uKe,{teamName:e,surface:"flat",defaultLogsOpen:!0})})]})})]})};function o2n(e,t){if(t.relatedTaskId)return[{taskId:t.relatedTaskId,displayId:t.relatedTaskDisplayId??t.relatedTaskId.slice(0,8),teamName:e}]}function a2n(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 l2n(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 c2n(e,t){const n=t.kind==="task_comment"?"task_comment_notification":"default",r=o2n(e,t);return{from:t.sourceLabel,to:t.destinationLabel,text:l2n(t),timestamp:new Date(t.updatedAt*1e3).toISOString(),read:!0,summary:a2n(t),color:t.color,messageId:`graph-handoff:${t.key}`,source:"inbox",messageKind:n,taskRefs:r}}const Iwe=Ld.width,u2n=72,d2n=10,p2n=({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}=qN(e),O=g.useMemo(()=>BN(h?.members),[h?.members]),{teamNames:_,teamColorByName:b}=qle(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 I=s(k.anchorNodeId),N=eZe(k,v.time);if(!I||!r||N<=.001){C.style.opacity="0";continue}const R=P.get(k.anchorNodeId)??0;P.set(k.anchorNodeId,R+1);const $=R*(u2n*.34+d2n),A=.94+N*.06;C.style.left=`${Math.round(I.x)}px`,C.style.top=`${Math.round(I.y)}px`,C.style.opacity=String(N),C.style.transform=`translate(-50%, calc(-50% - ${$.toFixed(1)}px)) scale(${A.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:c2n(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:`${Iwe}px`,maxWidth:`${Iwe}px`},onDragStart:T=>{T.preventDefault()},children:u.jsx(tKe,{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))})},f2n=g.lazy(()=>Qe(()=>import("./TeamGraphOverlay-D0F9r5Fj.js"),__vite__mapDeps([60,1])).then(e=>({default:e.TeamGraphOverlay}))),h2n=({teamName:e,isActive:t=!0,isPaneFocused:n=!1})=>{const r=kMn(e),{openTeamPage:s,commitOwnerSlotDrop:i,commitOwnerGridOrderDrop:o,setLayoutMode:a}=CMn(e),[c,l]=g.useState(!1),{sidebarVisible:d,toggleSidebarVisible:p}=wMn(),{dialog:f,openCreateTaskDialog:h}=TMn(e),m=g.useCallback(I=>window.dispatchEvent(new CustomEvent("graph:open-task",{detail:{teamName:e,taskId:I}})),[e]),O=g.useCallback(I=>window.dispatchEvent(new CustomEvent("graph:send-message",{detail:{teamName:e,memberName:I}})),[e]),_=g.useCallback((I,N)=>window.dispatchEvent(new CustomEvent("graph:open-profile",{detail:{teamName:e,memberName:I,...N}})),[e]),b=g.useCallback(()=>{h("")},[h]),y=g.useCallback(I=>N=>window.dispatchEvent(new CustomEvent(`graph:${I}`,{detail:{teamName:e,taskId:N}})),[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(I=>{I.kind==="task"?m(I.taskId):I.kind==="member"&&_(I.memberName)},[m,_]),onSendMessage:O,onOpenTaskDetail:m,onOpenMemberProfile:g.useCallback(I=>{_(I)},[_])};return u.jsxs("div",{className:"flex size-full overflow-hidden",style:{background:"#050510"},children:[d?u.jsx(gMn,{teamName:e,surface:"graph-tab",isActive:t,isFocused:n}):null,u.jsx("div",{className:"min-w-0 flex-1",children:u.jsx(oMn,{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(i2n,{teamName:e,enabled:t}),onLayoutModeChange:a,onOwnerSlotDrop:i,onOwnerGridOrderDrop:o,renderHud:I=>{const N=I,{getViewportSize:R,focusNodeIds:$,filters:A}=N;return u.jsxs(u.Fragment,{children:[u.jsx(p2n,{teamName:e,getTransientHandoffSnapshot:N.getTransientHandoffSnapshot,getCameraZoom:N.getCameraZoom,worldToScreen:N.worldToScreen,getNodeWorldPosition:N.getNodeWorldPosition,focusNodeIds:$,focusEdgeIds:N.focusEdgeIds??null,enabled:t}),u.jsx(kQn,{teamName:e,nodes:r.nodes,getActivityWorldRect:N.getActivityWorldRect,getCameraZoom:N.getCameraZoom,worldToScreen:N.worldToScreen,getNodeWorldPosition:N.getNodeWorldPosition,getViewportSize:R,focusNodeIds:$,enabled:t&&(A?.showActivity??!0),onOpenTaskDetail:m,onOpenMemberProfile:_})]})},renderEdgeOverlay:({edge:I,sourceNode:N,targetNode:R,onClose:$,onSelectNode:A})=>u.jsx(CQn,{teamName:e,edge:I,sourceNode:N,targetNode:R,onClose:$,onSelectNode:A,onOpenTaskDetail:m}),renderOverlay:({node:I,onClose:N})=>u.jsx(LQn,{node:I,teamName:e,onClose:N,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(f2n,{teamName:e,onClose:()=>l(!1),sidebarVisible:d,onToggleSidebar:p,onSendMessage:O,onOpenTaskDetail:m,onOpenMemberProfile:_})})]})};function yee(e){return/^[A-Za-z]:[/\\]/.test(e)||e.startsWith("\\\\")||e.startsWith("//")}function m2n(e){return e.includes("\\")&&!e.includes("/")?"\\":"/"}function Mwe(e,t){const n=m2n(e);return e.replace(/[/\\]$/,"")+n+t.replace(/[/\\]/g,n)}function YP(e,t,n=40){let r=e;if(t){const l=t.replace(/[/\\]$/,""),d=yee(r)||yee(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 O2n(e){return(/^(\/Users\/[^/]+)/.exec(e)??/^(\/home\/[^/]+)/.exec(e)??/^([A-Z]:\\Users\\[^\\]+)/i.exec(e))?.[1]??null}function xee(e){const t=e.replace(/\\/g,"/");if(t.startsWith("/Users/")||t.startsWith("/home/")){const n=al(t);if(n.length>=2){const r=n.slice(2).join("/");return r?`~/${r}`:"~"}}if(g2n(e)){const n=al(t);if(n.length>=3){const r=n.slice(3).join("/");return r?`~/${r}`:"~"}}return t}function g2n(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 oX(e,t){let n=e;if((n.startsWith("~/")||n.startsWith("~\\"))&&t){const r=O2n(t);r&&(n=Mwe(r,n.slice(2)))}return t&&!n.startsWith("/")&&!n.startsWith("~")&&!yee(n)&&(n=Mwe(t,n)),n}const Qwe=["anthropic","codex","gemini"];function _2n(e){return[...e].sort((t,n)=>Qwe.indexOf(t)-Qwe.indexOf(n))}function b2n(e,t){const n=e.associatedPaths.reduce((r,s)=>{const i=t.get(pr(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 y2n(e,t){const n=new Set,r=[];for(const s of e.associatedPaths){const i=t.get(pr(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 x2n(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 S2n({projects:e,taskCountsByProject:t,activeTeamsByProject:n,tasksLoading:r}){return e.map(s=>({id:s.id,project:s,name:s.name,formattedPath:xee(s.primaryPath),lastActivityLabel:Zb(new Date(s.mostRecentActivity),{addSuffix:!0,locale:iUe}),providerIds:_2n(s.providerIds),primaryBranch:s.primaryBranch,taskCounts:b2n(s,t),tasksLoading:r,activeTeams:y2n(s,n),additionalPathCount:Math.max(0,s.associatedPaths.length-1),pathSummary:x2n(s)}))}function v2n({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=pr(l.projectPath),p=a.get(d);p?p.push(l):a.set(d,[l])}return a}const dKe="tmp",T2n=`/${dKe}/`,E2n=`/private/${dKe}/`;function w2n(e){return e.trim().replace(/\\/g,"/").toLowerCase()}function k2n(e){const t=e.split("/").filter(Boolean);return t[t.length-1]??""}function C2n(e){return e.startsWith("/private/var/folders/")||e.startsWith("/var/folders/")||e.startsWith(E2n)||e.startsWith(T2n)||e.includes("/appdata/local/temp/")||e.includes("/appdata/locallow/temp/")}function Gl(e){const t=w2n(e??"");return t?t.includes("rendered_mcp_")||t.includes("rendered_mcp_config")||t.includes("/portable-mcp-live")?!0:k2n(t).startsWith("codex-agent-teams-appstyle-")&&C2n(t):!1}const pKe="recent-projects:open-history",See="recent-projects:open-history-changed",R2n=1e3*60*60*48,P2n=120;function fKe(){return typeof window<"u"&&typeof window.localStorage<"u"}function mB(e){let t=e.trim().replace(/\\/g,"/");if(!t||Gl(t))return null;if(t!=="/"&&!/^[A-Za-z]:\/$/.test(t))for(;t.endsWith("/");)t=t.slice(0,-1);return t}function hKe(e){return e.toLowerCase()}function mKe(){if(!fKe())return{version:1,entries:[]};try{const e=window.localStorage.getItem(pKe);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 $2n(e){const t=new Map;for(const n of e){const r=mB(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,P2n)}function N2n(e){if(!fKe())return;const t={version:1,entries:$2n(e)};try{window.localStorage.setItem(pKe,JSON.stringify(t)),window.dispatchEvent(new CustomEvent(See))}catch{}}function A2n(){const e=new Map,t=new Map;for(const n of mKe().entries){const r=mB(n.path);if(!r)continue;e.set(r,Math.max(e.get(r)??0,n.openedAt));const s=hKe(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 I2n(e,t){const n=mB(t);if(!n)return 0;const r=e.exact.get(n);if(r!=null)return r;const s=e.folded.get(hKe(n));return s?.exactPaths.size!==1?0:s.openedAt}function Dwe(e,t){return[t.primaryPath,...t.associatedPaths].reduce((n,r)=>Math.max(n,I2n(e,r)),0)}function aX(e,t=Date.now()){const n=Array.from(new Set(e.map(s=>mB(s)).filter(s=>!!s)));if(n.length===0)return;const r=mKe().entries;N2n([...r,...n.map(s=>({path:s,openedAt:t}))])}function M2n(e,t=Date.now()){const n=A2n(),r=s=>s>0&&t-s<=R2n;return[...e].sort((s,i)=>{const o=Dwe(n,s),a=Dwe(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 Q2n(e){if(typeof window>"u")return()=>{};const t=()=>e();return window.addEventListener(See,t),()=>{window.removeEventListener(See,t)}}function OKe(e){return e?Array.isArray(e)?{projects:e,degraded:!1}:Array.isArray(e.projects)?{projects:e.projects,degraded:e.degraded===!0}:null:null}const D2n=15e3,L2n=3e4;let F2=null,vee=0,Ew=null;function Y2(){const e=OKe(F2);if(!e)return null;F2!==e&&(F2=e);const t=e.degraded?L2n:D2n;return{payload:e,fetchedAt:vee,isStale:Date.now()-vee>t}}async function j2n(e,t){const n=t?.force??!1,r=Y2();if(!n&&r&&!r.isStale)return r.payload;if(Ew)return Ew;const s=e().then(i=>{const o=OKe(i);return F2=o,vee=Date.now(),o??{projects:[],degraded:!0}}).finally(()=>{Ew===s&&(Ew=null)});return Ew=s,s}function Lwe(e,t){const n=new Set(t.map(r=>pr(r)));for(const r of e)for(const s of r.worktrees)if(n.has(pr(s.path)))return{repoId:r.id,worktreeId:s.id};return null}function gKe(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 X2n(e){const t=gKe(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 ww=eo("Feature:RecentProjects:open");function U2n(){const{repositoryGroups:e,fetchRepositoryGroups:t,openTeamsTab:n}=oe(Et(l=>({repositoryGroups:l.repositoryGroups,fetchRepositoryGroups:l.fetchRepositoryGroups,openTeamsTab:l.openTeamsTab}))),r=g.useCallback(l=>{oe.setState(LU(l.repoId,l.worktreeId)),oe.getState().fetchSessionsInitial(l.worktreeId),n()},[n]),s=g.useCallback(async(l,d)=>{const f=(d.length>0?d:[l]).filter(b=>!Gl(b));if(f.length===0){ww.warn("Skipped ephemeral recent project path",{path:l});return}const h=Lwe(e,f);if(h){r(h);return}await t();const m=oe.getState().repositoryGroups,O=Lwe(m,f);if(O){r(O);return}if(Gl(l)){ww.warn("Skipped adding ephemeral recent project path",{path:l});return}await ee.config.addCustomProjectPath(l),oe.setState(b=>({repositoryGroups:[X2n(l),...b.repositoryGroups]}));const _=gKe(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),aX([l.primaryPath,...l.associatedPaths])}catch(d){ww.error("Failed to open recent project",d)}},[i]),a=g.useCallback(async l=>{try{await ee.openPath(l,l)}catch(d){ww.error("Failed to open project path",d)}},[]),c=g.useCallback(async()=>{try{const d=(await ee.config.selectFolders())[0];if(!d)return;await s(d,[d]),aX([d])}catch(l){ww.error("Failed to select project folder",l)}},[s]);return{openRecentProject:o,openProjectPath:a,selectProjectFolder:c}}const z2n=11,B2n=8,F2n=3e4,Y2n=12e4,V2n=3,q2n=8e3;function W2n(e){return new Promise((t,n)=>{const r=window.setTimeout(()=>{n(new Error("最近项目加载超时,请稍后重试。"))},q2n);e.then(s=>{window.clearTimeout(r),t(s)},s=>{window.clearTimeout(r),n(s)})})}function G2n(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 H2n(e,t=z2n){const{globalTasks:n,globalTasksInitialized:r,globalTasksLoading:s,fetchAllTasks:i,teams:o,provisioningRuns:a,currentProvisioningRunIdByTeam:c,provisioningSnapshotByTeam:l}=oe(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(()=>Y2(),[]),{openRecentProject:p,openProjectPath:f,selectProjectFolder:h}=U2n(),[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([]),[I,N]=g.useState(0),R=g.useRef(r),$=g.useRef(d?.payload.projects??[]),A=g.useMemo(()=>({currentProvisioningRunIdByTeam:c,provisioningRuns:a}),[c,a]),j=g.useMemo(()=>Object.keys(c).filter(Y=>Yy(A,Y)),[c,A]),Q=g.useMemo(()=>[...j].sort().join("\0"),[j]);g.useEffect(()=>{$.current=m},[m]);const U=g.useCallback(async Y=>{$.current.length>0||Y2()!=null||v(!0),E(null);try{const te=await W2n(j2n(()=>ee.getDashboardRecentProjects(),Y));O(te.projects),b(te.degraded),x(H=>te.degraded?H+1:0)}catch(te){E(te instanceof Error?te.message:"最近项目加载失败")}finally{v(!1)}},[]);g.useEffect(()=>{const Y=Y2();Y&&!Y.isStale||U({force:Y!=null})},[U]),g.useEffect(()=>{if(!_)return;const Y=y<=V2n?F2n:Y2n,ne=window.setTimeout(()=>{U({force:!0})},Y);return()=>{window.clearTimeout(ne)}},[y,_,U]),g.useEffect(()=>{if(m.length===0||R.current||r){R.current=R.current||r;return}R.current=!0,i()},[i,r,m.length]),g.useEffect(()=>{let Y=!1;return ee.teams.aliveList().then(ne=>{Y||C(ne)}).catch(()=>{}),()=>{Y=!0}},[Q,o]),g.useEffect(()=>{e.trim()||P(t)},[t,e]),g.useEffect(()=>Q2n(()=>N(Y=>Y+1)),[]);const M=g.useMemo(()=>nSt(n),[n]),q=g.useMemo(()=>v2n({teams:o,aliveTeamNames:k,provisioningTeamNames:j,provisioningSnapshotByTeam:l}),[k,l,j,o]),z=g.useMemo(()=>S2n({projects:M2n(m),taskCountsByProject:M,activeTeamsByProject:q,tasksLoading:s}),[q,s,I,m,M]),L=g.useMemo(()=>z.filter(Y=>G2n(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+B2n),reload:U,openRecentProject:p,openProjectPath:f,selectProjectFolder:h}}const Z2n=({card:e,onClick:t,onOpenPath:n})=>{const r=g.useMemo(()=>tHt(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(Hv,{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(it,{children:[u.jsx(ot,{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(tt,{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(IE,{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(it,{children:[u.jsx(ot,{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(Kc,{className:"size-3"})})}),u.jsx(tt,{side:"bottom",children:"打开"})]}),u.jsxs(it,{children:[u.jsx(ot,{asChild:!0,children:u.jsx("span",{className:"truncate",children:e.formattedPath})}),u.jsx(tt,{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(T$,{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(Lo,{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))]})]})},K2n=[60,66,50,55,75,45,40,65],J2n=[80,75,85,66,70,80,60,72],eDn=({searchQuery:e})=>{const{cards:t,loading:n,error:r,canLoadMore:s,isElectron:i,loadMore:o,reload:a,openRecentProject:c,openProjectPath:l}=H2n(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:`${K2n[p]}%`,backgroundColor:"var(--skeleton-base-light)"}}),u.jsx("div",{className:"mb-auto h-2.5 rounded-sm",style:{width:`${J2n[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(Hv,{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(Mi,{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(Hv,{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(Z2n,{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:"加载更多"})})]})},Kle=typeof window<"u"&&window.navigator.userAgent.includes("Macintosh"),O8=Kle?"⌘":"Ctrl+",jwe=Kle?"⇧":"Shift+";function Bg(e,t){return t?.shift?Kle?`${jwe}${O8}${e}`:`${O8}${jwe}${e}`:`${O8}${e}`}const tDn=["Claude Code","Cursor","Codex","Gemini","OpenCode","DeepSeek / IM"],nDn=["Feishu","Slack","Discord","DingTalk","WeCom","Telegram","Webhook / API"],rDn=({value:e,onChange:t})=>{const[n,r]=g.useState(!1),s=g.useRef(null),{openCommandPalette:i,selectedProjectId:o}=oe(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(Mi,{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?`搜索会话(${Bg("K")})`:`搜索项目(${Bg("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(z0,{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"})]})]})})},sDn=()=>{const[e,t]=g.useState(""),{openTeamsTab:n,openSettingsTab:r,teams:s,teamsLoading:i}=oe(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(Fht,{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(fmt,{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:tDn.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(eMe,{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:nDn.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(dc,{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(dc,{className:"size-4"}),"选择团队"]}),u.jsx("span",{className:"shrink-0 text-xs text-text-muted",children:"或"}),u.jsx("div",{className:"flex-1",children:u.jsx(rDn,{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(eDn,{searchQuery:e})]})]})]})},Xwe={search:"",categories:[],capabilities:[],installedOnly:!1};function iDn(){const[e,t]=g.useState("mcp-servers"),[n,r]=g.useState(Xwe),[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(!ee.mcpRegistry){k.current===U&&h(!1);return}ee.mcpRegistry.search(Q).then(M=>{k.current===U&&(p(M.servers),O(M.warnings),h(!1))},()=>{k.current===U&&(h(!1),O(["Search failed"]))})},300)},[]),I=g.useCallback(Q=>{r(U=>({...U,search:Q}))},[]),N=g.useCallback(Q=>{r(U=>({...U,categories:U.categories.includes(Q)?U.categories.filter(M=>M!==Q):[...U.categories,Q]}))},[]),R=g.useCallback(Q=>{r(U=>({...U,capabilities:U.capabilities.includes(Q)?U.capabilities.filter(M=>M!==Q):[...U.capabilities,Q]}))},[]),$=g.useCallback(()=>{r(Q=>({...Q,installedOnly:!Q.installedOnly}))},[]),A=g.useCallback(()=>{r(Xwe)},[]),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:I,toggleCategory:N,toggleCapability:R,toggleInstalledOnly:$,clearFilters:A,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 oDn(e){return Hse(e)}function aDn(e){return e?.flavor==="agent_teams_orchestrator"}function lDn(e){switch(e){case"supported":return"支持";case"read-only":return"只读";default:return"不支持"}}function cDn(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 _Ke(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 Uwe="Agent CLI";function Jle(e,t=!1){return e?.flavor==="agent_teams_orchestrator"?!e.displayName||e.displayName==="agent_teams_orchestrator"?Uwe:e.displayName:e?.displayName?e.displayName:t?Uwe:"Agent CLI"}function zwe(e,[t,n]){return Math.min(n,Math.max(t,e))}var uDn=[" ","Enter","ArrowUp","ArrowDown"],dDn=[" ","Enter"],vy="Select",[OB,gB,pDn]=TWe(vy),[KE]=dp(vy,[pDn,S_]),_B=S_(),[fDn,j_]=KE(vy),[hDn,mDn]=KE(vy),bKe=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=_B(t),[_,b]=g.useState(null),[y,x]=g.useState(null),[S,v]=g.useState(!1),T=nae(l),[E,w]=Em({prop:r,defaultProp:s??!1,onChange:i,caller:vy}),[P,k]=Em({prop:o,defaultProp:a,onChange:c,caller:vy}),C=g.useRef(null),I=_?m||!!_.closest("form"):!0,[N,R]=g.useState(new Set),$=Array.from(N).map(A=>A.props.value).join(";");return u.jsx(pU,{...O,children:u.jsxs(fDn,{required:h,scope:t,trigger:_,onTriggerChange:b,valueNode:y,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:v,contentId:Pa(),value:P,onValueChange:k,open:E,onOpenChange:w,dir:T,triggerPointerDownPosRef:C,disabled:f,children:[u.jsx(OB.Provider,{scope:t,children:u.jsx(hDn,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback(A=>{R(j=>new Set(j).add(A))},[]),onNativeOptionRemove:g.useCallback(A=>{R(j=>{const Q=new Set(j);return Q.delete(A),Q})},[]),children:n})}),I?u.jsxs(BKe,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:p,value:P,onChange:A=>k(A.target.value),disabled:f,form:m,children:[P===void 0?u.jsx("option",{value:""}):null,Array.from(N)]},$):null]})})};bKe.displayName=vy;var yKe="SelectTrigger",xKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,i=_B(n),o=j_(yKe,n),a=o.disabled||r,c=ts(t,o.onTriggerChange),l=gB(n),d=g.useRef("touch"),[p,f,h]=YKe(O=>{const _=l().filter(x=>!x.disabled),b=_.find(x=>x.value===o.value),y=VKe(_,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(x$,{asChild:!0,...i,children:u.jsx(mr.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":FKe(o.value)?"":void 0,...s,ref:c,onClick:_n(s.onClick,O=>{O.currentTarget.focus(),d.current!=="mouse"&&m(O)}),onPointerDown:_n(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:_n(s.onKeyDown,O=>{const _=p.current!=="";!(O.ctrlKey||O.altKey||O.metaKey)&&O.key.length===1&&f(O.key),!(_&&O.key===" ")&&uDn.includes(O.key)&&(m(),O.preventDefault())})})})});xKe.displayName=yKe;var SKe="SelectValue",vKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:i,placeholder:o="",...a}=e,c=j_(SKe,n),{onValueNodeHasChildrenChange:l}=c,d=i!==void 0,p=ts(t,c.onValueNodeChange);return Qa(()=>{l(d)},[l,d]),u.jsx(mr.span,{...a,ref:p,style:{pointerEvents:"none"},children:FKe(c.value)?u.jsx(u.Fragment,{children:o}):i})});vKe.displayName=SKe;var ODn="SelectIcon",TKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return u.jsx(mr.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});TKe.displayName=ODn;var gDn="SelectPortal",EKe=e=>u.jsx(OE,{asChild:!0,...e});EKe.displayName=gDn;var Ty="SelectContent",wKe=g.forwardRef((e,t)=>{const n=j_(Ty,e.__scopeSelect),[r,s]=g.useState();if(Qa(()=>{s(new DocumentFragment)},[]),!n.open){const i=r;return i?vi.createPortal(u.jsx(kKe,{scope:e.__scopeSelect,children:u.jsx(OB.Slot,{scope:e.__scopeSelect,children:u.jsx("div",{children:e.children})})}),i):null}return u.jsx(CKe,{...e,ref:t})});wKe.displayName=Ty;var Td=10,[kKe,X_]=KE(Ty),_Dn="SelectContentImpl",bDn=Fv("SelectContent.RemoveScroll"),CKe=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=j_(Ty,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),I=gB(n),[N,R]=g.useState(!1),$=g.useRef(!1);g.useEffect(()=>{if(x)return pae(x)},[x]),dae();const A=g.useCallback(te=>{const[H,...Z]=I().map(ce=>ce.ref.current),[se]=Z.slice(-1),he=document.activeElement;for(const ce of te)if(ce===he||(ce?.scrollIntoView({block:"nearest"}),ce===H&&v&&(v.scrollTop=0),ce===se&&v&&(v.scrollTop=v.scrollHeight),ce?.focus(),document.activeElement!==he))return},[I,v]),j=g.useCallback(()=>A([w,x]),[A,w,x]);g.useEffect(()=>{N&&j()},[N,j]);const{onOpenChange:Q,triggerPointerDownPosRef:U}=y;g.useEffect(()=>{if(x){let te={x:0,y:0};const H=se=>{te={x:Math.abs(Math.round(se.pageX)-(U.current?.x??0)),y:Math.abs(Math.round(se.pageY)-(U.current?.y??0))}},Z=se=>{te.x<=10&&te.y<=10?se.preventDefault():x.contains(se.target)||Q(!1),document.removeEventListener("pointermove",H),U.current=null};return U.current!==null&&(document.addEventListener("pointermove",H),document.addEventListener("pointerup",Z,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",H),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[M,q]=YKe(te=>{const H=I().filter(he=>!he.disabled),Z=H.find(he=>he.ref.current===document.activeElement),se=VKe(H,te,Z);se&&setTimeout(()=>se.ref.current.focus())}),z=g.useCallback((te,H,Z)=>{const se=!$.current&&!Z;(y.value!==void 0&&y.value===H||se)&&(P(te),se&&($.current=!0))},[y.value]),L=g.useCallback(()=>x?.focus(),[x]),V=g.useCallback((te,H,Z)=>{const se=!$.current&&!Z;(y.value!==void 0&&y.value===H||se)&&C(te)},[y.value]),Y=r==="popper"?Tee:RKe,ne=Y===Tee?{side:a,sideOffset:c,align:l,alignOffset:d,arrowPadding:p,collisionBoundary:f,collisionPadding:h,sticky:m,hideWhenDetached:O,avoidCollisions:_}:{};return u.jsx(kKe,{scope:n,content:x,viewport:v,onViewportChange:T,itemRefCallback:z,selectedItem:w,onItemLeave:L,itemTextRefCallback:V,focusSelectedItem:j,selectedItemText:k,position:r,isPositioned:N,searchRef:M,children:u.jsx(M3,{as:bDn,allowPinchZoom:!0,children:u.jsx(A3,{asChild:!0,trapped:y.open,onMountAutoFocus:te=>{te.preventDefault()},onUnmountAutoFocus:_n(s,te=>{y.trigger?.focus({preventScroll:!0}),te.preventDefault()}),children:u.jsx(hE,{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:()=>R(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:_n(b.onKeyDown,te=>{const H=te.ctrlKey||te.altKey||te.metaKey;if(te.key==="Tab"&&te.preventDefault(),!H&&te.key.length===1&&q(te.key),["ArrowUp","ArrowDown","Home","End"].includes(te.key)){let se=I().filter(he=>!he.disabled).map(he=>he.ref.current);if(["ArrowUp","End"].includes(te.key)&&(se=se.slice().reverse()),["ArrowUp","ArrowDown"].includes(te.key)){const he=te.target,ce=se.indexOf(he);se=se.slice(ce+1)}setTimeout(()=>A(se)),te.preventDefault()}})})})})})})});CKe.displayName=_Dn;var yDn="SelectItemAlignedPosition",RKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,i=j_(Ty,n),o=X_(Ty,n),[a,c]=g.useState(null),[l,d]=g.useState(null),p=ts(t,E=>d(E)),f=gB(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 he=k.left-w.left,ce=P.left-he,me=E.left-ce,ae=E.width+me,G=Math.max(ae,w.width),be=window.innerWidth-Td,_e=zwe(ce,[Td,Math.max(Td,be-G)]);a.style.minWidth=ae+"px",a.style.left=_e+"px"}else{const he=w.right-k.right,ce=window.innerWidth-P.right-he,me=window.innerWidth-E.right-ce,ae=E.width+me,G=Math.max(ae,w.width),be=window.innerWidth-Td,_e=zwe(ce,[Td,Math.max(Td,be-G)]);a.style.minWidth=ae+"px",a.style.right=_e+"px"}const C=f(),I=window.innerHeight-Td*2,N=O.scrollHeight,R=window.getComputedStyle(l),$=parseInt(R.borderTopWidth,10),A=parseInt(R.paddingTop,10),j=parseInt(R.borderBottomWidth,10),Q=parseInt(R.paddingBottom,10),U=$+A+N+Q+j,M=Math.min(_.offsetHeight*5,U),q=window.getComputedStyle(O),z=parseInt(q.paddingTop,10),L=parseInt(q.paddingBottom,10),V=E.top+E.height/2-Td,Y=I-V,ne=_.offsetHeight/2,te=_.offsetTop+ne,H=$+A+te,Z=U-H;if(H<=V){const he=C.length>0&&_===C[C.length-1].ref.current;a.style.bottom="0px";const ce=l.clientHeight-O.offsetTop-O.offsetHeight,me=Math.max(Y,ne+(he?L:0)+ce+j),ae=H+me;a.style.height=ae+"px"}else{const he=C.length>0&&_===C[0].ref.current;a.style.top="0px";const me=Math.max(V,$+O.offsetTop+(he?z:0)+ne)+Z;a.style.height=me+"px",O.scrollTop=H-V+O.offsetTop}a.style.margin=`${Td}px 0`,a.style.minHeight=M+"px",a.style.maxHeight=I+"px",r?.(),requestAnimationFrame(()=>h.current=!0)}},[f,i.trigger,i.valueNode,a,l,O,_,b,i.dir,r]);Qa(()=>x(),[x]);const[S,v]=g.useState();Qa(()=>{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(SDn,{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(mr.div,{...s,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});RKe.displayName=yDn;var xDn="SelectPopperPosition",Tee=g.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=Td,...i}=e,o=_B(n);return u.jsx(fU,{...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)"}})});Tee.displayName=xDn;var[SDn,ece]=KE(Ty,{}),Eee="SelectViewport",PKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,i=X_(Eee,n),o=ece(Eee,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(mr.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:_n(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-Td*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})})})]})});PKe.displayName=Eee;var $Ke="SelectGroup",[vDn,TDn]=KE($Ke),EDn=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Pa();return u.jsx(vDn,{scope:n,id:s,children:u.jsx(mr.div,{role:"group","aria-labelledby":s,...r,ref:t})})});EDn.displayName=$Ke;var NKe="SelectLabel",AKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=TDn(NKe,n);return u.jsx(mr.div,{id:s.id,...r,ref:t})});AKe.displayName=NKe;var lX="SelectItem",[wDn,IKe]=KE(lX),MKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:i,...o}=e,a=j_(lX,n),c=X_(lX,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=Pa(),_=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(wDn,{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(mr.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:_n(o.onFocus,()=>h(!0)),onBlur:_n(o.onBlur,()=>h(!1)),onClick:_n(o.onClick,()=>{_.current!=="mouse"&&b()}),onPointerUp:_n(o.onPointerUp,()=>{_.current==="mouse"&&b()}),onPointerDown:_n(o.onPointerDown,y=>{_.current=y.pointerType}),onPointerMove:_n(o.onPointerMove,y=>{_.current=y.pointerType,s?c.onItemLeave?.():_.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_n(o.onPointerLeave,y=>{y.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:_n(o.onKeyDown,y=>{c.searchRef?.current!==""&&y.key===" "||(dDn.includes(y.key)&&b(),y.key===" "&&y.preventDefault())})})})})});MKe.displayName=lX;var vk="SelectItemText",QKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...i}=e,o=j_(vk,n),a=X_(vk,n),c=IKe(vk,n),l=mDn(vk,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 Qa(()=>(O(m),()=>_(m)),[O,_,m]),u.jsxs(u.Fragment,{children:[u.jsx(mr.span,{id:c.textId,...i,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?vi.createPortal(i.children,o.valueNode):null]})});QKe.displayName=vk;var DKe="SelectItemIndicator",LKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return IKe(DKe,n).isSelected?u.jsx(mr.span,{"aria-hidden":!0,...r,ref:t}):null});LKe.displayName=DKe;var wee="SelectScrollUpButton",jKe=g.forwardRef((e,t)=>{const n=X_(wee,e.__scopeSelect),r=ece(wee,e.__scopeSelect),[s,i]=g.useState(!1),o=ts(t,r.onScrollButtonChange);return Qa(()=>{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(UKe,{...e,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});jKe.displayName=wee;var kee="SelectScrollDownButton",XKe=g.forwardRef((e,t)=>{const n=X_(kee,e.__scopeSelect),r=ece(kee,e.__scopeSelect),[s,i]=g.useState(!1),o=ts(t,r.onScrollButtonChange);return Qa(()=>{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(UKe,{...e,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});XKe.displayName=kee;var UKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,i=X_("SelectScrollButton",n),o=g.useRef(null),a=gB(n),c=g.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return g.useEffect(()=>()=>c(),[c]),Qa(()=>{a().find(d=>d.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),u.jsx(mr.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:_n(s.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:_n(s.onPointerMove,()=>{i.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:_n(s.onPointerLeave,()=>{c()})})}),kDn="SelectSeparator",zKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return u.jsx(mr.div,{"aria-hidden":!0,...r,ref:t})});zKe.displayName=kDn;var Cee="SelectArrow",CDn=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=_B(n),i=j_(Cee,n),o=X_(Cee,n);return i.open&&o.position==="popper"?u.jsx(hU,{...s,...r,ref:t}):null});CDn.displayName=Cee;var RDn="SelectBubbleInput",BKe=g.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=g.useRef(null),i=ts(r,s),o=AZe(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(mr.select,{...n,style:{...rIe,...n.style},ref:i,defaultValue:t})});BKe.displayName=RDn;function FKe(e){return e===""||e===void 0}function YKe(e){const t=Gg(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 VKe(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=PDn(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 PDn(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var $Dn=bKe,qKe=xKe,NDn=vKe,ADn=TKe,IDn=EKe,WKe=wKe,MDn=PKe,GKe=AKe,HKe=MKe,QDn=QKe,DDn=LKe,ZKe=jKe,KKe=XKe,JKe=zKe;const oc=$Dn,ac=NDn,_l=g.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(qKe,{ref:r,className:nt("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(ADn,{asChild:!0,children:u.jsx(Ur,{className:"size-4 opacity-50"})})]}));_l.displayName=qKe.displayName;const eJe=g.forwardRef(({className:e,...t},n)=>u.jsx(ZKe,{ref:n,className:nt("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(gE,{className:"size-4"})}));eJe.displayName=ZKe.displayName;const tJe=g.forwardRef(({className:e,...t},n)=>u.jsx(KKe,{ref:n,className:nt("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(Ur,{className:"size-4"})}));tJe.displayName=KKe.displayName;const bl=g.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>u.jsx(IDn,{children:u.jsxs(WKe,{ref:s,className:nt("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(eJe,{}),u.jsx(MDn,{className:nt("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),u.jsx(tJe,{})]})}));bl.displayName=WKe.displayName;const LDn=g.forwardRef(({className:e,...t},n)=>u.jsx(GKe,{ref:n,className:nt("px-2 py-1.5 text-sm font-semibold text-[var(--color-text-muted)]",e),...t}));LDn.displayName=GKe.displayName;const Yi=g.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(HKe,{ref:r,className:nt("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(DDn,{children:u.jsx(Kr,{className:"size-4"})})}),u.jsx(QDn,{children:t})]}));Yi.displayName=HKe.displayName;const jDn=g.forwardRef(({className:e,...t},n)=>u.jsx(JKe,{ref:n,className:nt("-mx-1 my-1 h-px bg-[var(--color-border)]",e),...t}));jDn.displayName=JKe.displayName;const XDn=/^[\w.-]{1,100}$/,UDn=[{value:"streamable-http",label:"Streamable HTTP"},{value:"sse",label:"SSE"},{value:"http",label:"HTTP"}],zDn=({open:e,onClose:t,projectPath:n,cliStatus:r,cliStatusLoading:s})=>{const i=oe(ce=>ce.installCustomMcpServer),o=oe(ce=>ce.cliStatus),a=oe(ce=>ce.cliStatusLoading),c=r??o,l=s??a,d=Ise(c?.flavor),p=[{value:d,label:yZ(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([]),[I,N]=g.useState([]),[R,$]=g.useState(null),[A,j]=g.useState(!1),Q=g.useRef({}),U=g.useRef(!1),M=g.useRef(d),q=I.map(ce=>ce.key.trim()).filter(Boolean).sort().join("\0"),z=ku(_)?n??void 0:void 0,L=JO({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([]),N([]),$(null),j(!1),Q.current={}),U.current=e,e||(M.current=d)},[d,e]),g.useEffect(()=>{if(!e){M.current=d;return}const ce=M.current;ce!==d&&_===ce&&iXe(_)&&b(d),M.current=d},[d,e,_]),g.useEffect(()=>{e&&ku(_)&&!n&&b(d)},[d,e,n,_]),g.useEffect(()=>{if(!e||I.length===0||!ee.apiKeys)return;const ce=I.map(me=>me.key.trim()).filter(Boolean);ce.length!==0&&ee.apiKeys.lookup(ce,z).then(me=>{const ae=Q.current,G=Object.fromEntries(me.map(be=>[be.envVarName,be.value]));N(be=>{let _e=!1;const re=be.map(ge=>{const J=ge.key.trim();if(!J)return ge;const F=ae[J],W=G[J];return W?(!ge.value||ge.value===F)&&ge.value!==W?(_e=!0,{...ge,value:W}):ge:F&&ge.value===F?(_e=!0,{...ge,value:""}):ge});return _e?re:be}),Q.current=G},()=>{})},[z,q,e]);const V=async()=>{if($(null),L){$(L);return}if(!f.trim()){$("Server name is required");return}if(!XDn.test(f)){$("Invalid server name. Use alphanumeric characters, dashes, underscores, dots.");return}let ce;if(m==="stdio"){if(!y.trim()){$("npm package name is required");return}ce={type:"stdio",npmPackage:y.trim(),npmVersion:S.trim()||void 0}}else{if(!T.trim()){$("Server URL is required");return}ce={type:"http",url:T.trim(),transportType:w}}const me={};for(const G of I)G.key.trim()&&G.value&&(me[G.key.trim()]=G.value);const ae={serverName:f,scope:_,projectPath:ku(_)?n??void 0:void 0,installSpec:ce,envValues:me,headers:k.filter(G=>G.key.trim()&&G.value.trim())};j(!0);try{await i(ae),t()}catch(G){$(G instanceof Error?G.message:"安装失败")}finally{j(!1)}},Y=()=>N(ce=>[...ce,{key:"",value:""}]),ne=ce=>N(me=>me.filter((ae,G)=>G!==ce)),te=(ce,me,ae)=>N(G=>G.map((be,_e)=>_e===ce?{...be,[me]:ae}:be)),H=()=>C(ce=>[...ce,{key:"",value:""}]),Z=ce=>C(me=>me.filter((ae,G)=>G!==ce)),se=(ce,me,ae)=>C(G=>G.map((be,_e)=>_e===ce?{...be,[me]:ae}:be)),he=f.trim()&&(m==="stdio"?y.trim():T.trim())&&!(ku(_)&&!n)&&!L&&!A;return u.jsx(_s,{open:e,onOpenChange:ce=>!ce&&t(),children:u.jsxs(cs,{className:"max-h-[85vh] max-w-lg overflow-y-auto",children:[u.jsx(bs,{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(xU,{className:"size-4 text-text-muted"})}),u.jsxs("div",{children:[u.jsx(us,{children:"添加自定义 MCP 服务器"}),u.jsx(wi,{children:"不通过目录,手动添加一个服务器。"})]})]})}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Kt,{htmlFor:"custom-name",className:"text-xs",children:"服务器名称"}),u.jsx(In,{id:"custom-name",value:f,onChange:ce=>h(ce.target.value),placeholder:"my-server",className:"h-8 text-sm",autoFocus:!0})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Kt,{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(Kt,{htmlFor:"custom-npm",className:"text-xs",children:"npm 包"}),u.jsx(In,{id:"custom-npm",value:y,onChange:ce=>x(ce.target.value),placeholder:"@example/mcp-server",className:"h-8 font-mono text-sm"})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Kt,{htmlFor:"custom-version",className:"text-xs",children:"版本(可选)"}),u.jsx(In,{id:"custom-version",value:S,onChange:ce=>v(ce.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(Kt,{htmlFor:"custom-url",className:"text-xs",children:"服务器 URL"}),u.jsx(In,{id:"custom-url",value:T,onChange:ce=>E(ce.target.value),placeholder:"https://api.example.com/mcp",className:"h-8 text-sm"})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Kt,{className:"text-xs",children:"传输类型"}),u.jsxs(oc,{value:w,onValueChange:ce=>P(ce),children:[u.jsx(_l,{className:"h-8 text-sm",children:u.jsx(ac,{})}),u.jsx(bl,{children:UDn.map(ce=>u.jsx(Yi,{value:ce.value,children:ce.label},ce.value))})]})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(Kt,{className:"text-xs",children:"请求头"}),u.jsxs(Xe,{variant:"ghost",size:"sm",onClick:H,className:"h-6 px-1.5 text-xs",children:[u.jsx(xl,{className:"mr-1 size-3"}),"添加"]})]}),k.length>0&&u.jsx("div",{className:"space-y-2",children:k.map((ce,me)=>u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(In,{value:ce.key,onChange:ae=>se(me,"key",ae.target.value),className:"h-7 w-32 text-xs",placeholder:"Header-Name"}),u.jsx(In,{value:ce.value,onChange:ae=>se(me,"value",ae.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(me),children:u.jsx(Ti,{className:"size-3"})})]},me))})]})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Kt,{className:"text-xs",children:"作用域"}),u.jsxs(oc,{value:_,onValueChange:ce=>b(ce),children:[u.jsx(_l,{className:"h-8 text-sm",children:u.jsx(ac,{})}),u.jsx(bl,{children:p.map(ce=>u.jsx(Yi,{value:ce.value,disabled:ku(ce.value)&&!n,children:ce.label},ce.value))})]})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(Kt,{className:"text-xs",children:"环境变量"}),u.jsxs(Xe,{variant:"ghost",size:"sm",onClick:Y,className:"h-6 px-1.5 text-xs",children:[u.jsx(xl,{className:"mr-1 size-3"}),"添加"]})]}),I.length>0&&u.jsx("div",{className:"space-y-2",children:I.map((ce,me)=>u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(In,{value:ce.key,onChange:ae=>te(me,"key",ae.target.value),className:"h-7 w-40 font-mono text-xs",placeholder:"ENV_VAR_NAME"}),u.jsx(In,{type:"password",value:ce.value,onChange:ae=>te(me,"value",ae.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(me),children:u.jsx(Ti,{className:"size-3"})})]},me))})]}),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}),R&&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:R}),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:!he,onClick:()=>void V(),children:A?"正在安装...":"安装"})]})]})]})})},nJe=({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(Mi,{className:"absolute left-3 top-1/2 size-4 -translate-y-1/2 text-text-muted"}),u.jsx(In,{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"})})]})},rJe=({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}=oe(Et(S=>({cliStatus:S.cliStatus,cliStatusLoading:S.cliStatusLoading}))),m=JO({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(qt,{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(Kr,{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(nc,{children:u.jsxs(it,{children:[u.jsx(ot,{asChild:!0,children:u.jsx("span",{tabIndex:0,children:S})}),u.jsx(tt,{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(Ti,{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(nc,{children:u.jsxs(it,{children:[u.jsx(ot,{asChild:!0,children:u.jsx("span",{tabIndex:0,children:x})}),u.jsx(tt,{className:"max-w-64",children:m})]})}):x},sJe=({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"}),BDn=({server:e,isInstalled:t,installedEntry:n,installedEntries:r=[],diagnostic:s,diagnosticsLoading:i,onClick:o,cliStatus:a,cliStatusLoading:c})=>{const l=oe(R=>R.cliStatus),d=a??l,p=Ise(d?.flavor),f=sP(e.id,p),h=oe(R=>R.mcpInstallProgress[f]??"idle"),m=oe(R=>R.installMcpServer),O=oe(R=>R.uninstallMcpServer),_=oe(R=>R.installErrors[f]),b=oe(R=>e.repositoryUrl?R.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=DL(e.name),T=x.find(R=>R.scope===p)??null,E=sXe(x),w=t&&x.length===1&&T?.name===v&&!S,P=y&&(t?w:!S),[k,C]=g.useState(!1),I=!!e.iconUrl&&!k,N=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:R=>{(R.key==="Enter"||R.key===" ")&&(R.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:[I&&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(sJe,{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:N,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(bE,{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(cft,{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(B0,{className:"size-3"}),"Auth"]}),e.version&&u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(Zht,{className:"size-3"}),e.version]}),e.updatedAt&&u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(uc,{className:"size-3"}),C3(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(Kdt,{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(VD,{className:"size-3"}),"Both"]}),e.repositoryUrl&&u.jsxs(it,{children:[u.jsx(ot,{asChild:!0,children:u.jsxs("button",{className:"inline-flex items-center gap-1.5 text-text-muted transition-colors hover:text-text",onClick:R=>{R.stopPropagation(),ee.openExternal(e.repositoryUrl)},children:[u.jsx(zpt,{className:"size-3.5"}),b!=null&&u.jsxs("span",{className:"inline-flex items-center gap-0.5",children:[u.jsx(rMe,{className:"size-3 fill-amber-400 text-amber-400"}),Rhn(b)]})]})}),u.jsx(tt,{side:"top",children:"Repository"})]}),e.websiteUrl&&u.jsxs(it,{children:[u.jsx(ot,{asChild:!0,children:u.jsx("button",{className:"inline-flex items-center text-text-muted transition-colors hover:text-text",onClick:R=>{R.stopPropagation(),ee.openExternal(e.websiteUrl)},children:u.jsx(VD,{className:"size-3.5"})})}),u.jsx(tt,{side:"top",children:"Website"})]})]}),P&&u.jsx("div",{className:"shrink-0",children:u.jsx(rJe,{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:R=>{R.stopPropagation(),o(e.id)},children:t?"Manage":"Configure"})})]})]})},FDn=({server:e,isInstalled:t,installedEntry:n,installedEntries:r=[],diagnostic:s,diagnosticsLoading:i,projectPath:o,open:a,onClose:c,cliStatus:l,cliStatusLoading:d})=>{const p=oe(ie=>ie.cliStatus),f=l??p,h=Ise(f?.flavor),[m,O]=g.useState(h),_=e?sP(e.id,m,o):null,b=oe(ie=>(_?ie.mcpInstallProgress[_]:void 0)??"idle"),y=oe(ie=>ie.installMcpServer),x=oe(ie=>ie.uninstallMcpServer),S=oe(ie=>_?ie.installErrors[_]:void 0),v=oe(ie=>e?.repositoryUrl?ie.mcpGitHubStars[e.repositoryUrl]:void 0),[T,E]=g.useState(""),[w,P]=g.useState({}),[k,C]=g.useState([]),[I,N]=g.useState(!1),[R,$]=g.useState(new Set),A=g.useRef({}),j=g.useRef(h),Q=r.length?r:n?[n]:[],U=[{value:h,label:yZ(h,f?.flavor)},...h!=="user"&&Q.some(ie=>ie.scope==="user")?[{value:"user",label:yZ("user",f?.flavor)}]:[],{value:"project",label:"项目"},{value:"local",label:"本地"}],M=rXe(Q),q=Q.find(ie=>ie.scope===m)??null,z=sXe(Q),L=e?.envVars.map(ie=>ie.name).sort().join("\0")??"",V=f?.flavor==="agent_teams_orchestrator"?"运行时状态":"Claude 状态",Y=ku(m)?o??void 0:void 0;if(g.useEffect(()=>{!e||!a||(P(Object.fromEntries(e.envVars.map(ie=>[ie.name,""]))),C((e.authHeaders??[]).map(ie=>({key:ie.key,value:"",secret:ie.isSecret,description:ie.description,isRequired:ie.isRequired,valueTemplate:ie.valueTemplate,locked:!0}))),E(M?.name??DL(e.name)),O(M?.scope??h),N(!1),$(new Set),A.current={})},[a,M?.name,M?.scope,e?.id]),g.useEffect(()=>{if(!a){j.current=h;return}const ie=j.current;ie!==h&&!M&&m===ie&&iXe(m)&&O(h),j.current=h},[h,a,M,m]),g.useEffect(()=>{!e||!a||!q||E(q.name)},[a,q,e]),g.useEffect(()=>{a&&ku(m)&&!o&&O(h)},[h,a,o,m]),g.useEffect(()=>{if(!e||!a||e.envVars.length===0||!ee.apiKeys)return;const ie=e.envVars.map(le=>le.name);ee.apiKeys.lookup(ie,Y).then(le=>{const K=A.current,pe={};for(const we of le)pe[we.envVarName]=we.value;P(we=>{const Ee={...we};for(const[Ae,We]of Object.entries(K))!(Ae in pe)&&Ee[Ae]===We&&(Ee[Ae]="");for(const[Ae,We]of Object.entries(pe))(!Ee[Ae]||Ee[Ae]===K[Ae])&&(Ee[Ae]=We);return Ee}),$(new Set(Object.keys(pe))),A.current=pe},()=>{})},[Y,L,a,e?.id]),!e)return u.jsx(u.Fragment,{});const ne=!!e.installSpec,te=e.installSpec?.type==="http",H=!!e.iconUrl&&!I,Z=e.installSpec?.type==="stdio"?`https://www.npmjs.com/package/${e.installSpec.npmPackage}`:null,se=k.some(ie=>ie.locked),he=e.envVars.some(ie=>ie.isRequired&&!w[ie.name]?.trim()),ce=k.some(ie=>ie.isRequired&&!ie.value.trim()),me=q!==null,ae=q?.name??T,G=q?.scope??m,be=ku(m)&&!o,_e=!T.trim()||he||ce||be,re=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:ku(m)?o??void 0:void 0,envValues:w,headers:k})},J=()=>{x(e.id,ae,G,ku(G)?o??void 0:void 0)},F=()=>{C(ie=>[...ie,{key:"",value:""}])},W=ie=>{C(le=>le.filter((K,pe)=>pe!==ie))},ue=(ie,le,K)=>{C(pe=>pe.map((we,Ee)=>Ee===ie?{...we,[le]:K}:we))};return u.jsx(_s,{open:a,onOpenChange:ie=>!ie&&c(),children:u.jsxs(cs,{className:"max-h-[85vh] max-w-2xl overflow-y-auto",children:[u.jsx(bs,{children:u.jsxs("div",{className:"flex items-start gap-3",children:[H&&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:()=>N(!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(us,{className:"truncate",children:e.name}),u.jsx(wi,{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(sJe,{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(rMe,{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 ee.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(B0,{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 密钥。若安装后连接失败,请查看提供商文档。"}),me&&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:V}),i&&!s?u.jsx(Ut,{className:"border-border bg-surface-raised text-text-muted",variant:"outline",children:"检查中..."}):s?u.jsx(Ut,{className:re,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:me?"管理安装":"安装服务器"}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Kt,{htmlFor:"server-name",className:"text-xs",children:"服务器名称"}),u.jsx(In,{id:"server-name",value:T,onChange:ie=>E(ie.target.value),placeholder:"my-server",className:"h-8 text-sm",disabled:me})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Kt,{className:"text-xs",children:"范围"}),u.jsxs(oc,{value:m,onValueChange:ie=>O(ie),children:[u.jsx(_l,{className:"h-8 text-sm",children:u.jsx(ac,{})}),u.jsx(bl,{children:U.map(ie=>u.jsx(Yi,{value:ie.value,disabled:ku(ie.value)&&!o,children:ie.label},ie.value))})]})]}),e.envVars.length>0&&u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Kt,{className:"text-xs",children:"环境变量"}),u.jsx("div",{className:"space-y-2",children:e.envVars.map(ie=>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:ie.name}),u.jsx(In,{type:ie.isSecret?"password":"text",value:w[ie.name]??"",onChange:le=>P(K=>({...K,[ie.name]:le.target.value})),className:"h-7 flex-1 text-xs",placeholder:ie.description??ie.name}),R.has(ie.name)&&w[ie.name]&&u.jsx("span",{className:"shrink-0 text-[10px] text-emerald-400",children:"已自动填充"})]},ie.name))})]}),te&&u.jsxs("div",{className:"space-y-1.5",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(Kt,{className:"text-xs",children:"请求头"}),u.jsxs(Xe,{variant:"ghost",size:"sm",onClick:F,className:"h-6 px-1.5 text-xs",children:[u.jsx(xl,{className:"mr-1 size-3"}),se?"添加自定义":"添加"]})]}),k.length>0&&u.jsx("div",{className:"space-y-2",children:k.map((ie,le)=>u.jsxs("div",{className:"space-y-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[ie.locked?u.jsx("code",{className:"w-32 shrink-0 truncate text-xs text-blue-400",children:ie.key}):u.jsx(In,{value:ie.key,onChange:K=>ue(le,"key",K.target.value),className:"h-7 w-32 text-xs",placeholder:"Header-Name"}),u.jsx(In,{type:ie.secret?"password":"text",value:ie.value,onChange:K=>ue(le,"value",K.target.value),className:"h-7 flex-1 text-xs",placeholder:ie.valueTemplate??ie.description??"value"}),u.jsx(Xe,{variant:"ghost",size:"icon",className:"size-7 text-red-400 hover:bg-red-500/10",onClick:()=>W(le),disabled:ie.locked&&ie.isRequired,children:u.jsx(Ti,{className:"size-3"})})]}),(ie.description||ie.valueTemplate||ie.isRequired)&&u.jsx("p",{className:"text-[10px] text-text-muted",children:[ie.isRequired?"必填":null,ie.description,ie.valueTemplate].filter(Boolean).join(" • ")})]},le))})]}),u.jsx("div",{className:"flex justify-end pt-1",children:u.jsx(rJe,{state:b,isInstalled:me,section:"mcp",cliStatus:f,cliStatusLoading:d,onInstall:ge,onUninstall:J,disabled:_e,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(bE,{className:"size-4"}),"工具(",e.tools.length,")"]}),u.jsx("div",{className:"max-h-48 space-y-1 overflow-y-auto",children:e.tools.map(ie=>u.jsxs("div",{className:"rounded-md bg-surface-raised p-2 text-xs",children:[u.jsx("code",{className:"font-mono text-text",children:ie.name}),ie.description&&u.jsx("p",{className:"mt-0.5 text-text-muted",children:ie.description})]},ie.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 ee.openExternal(e.repositoryUrl),children:[u.jsx(Ef,{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 ee.openExternal(e.glamaUrl),children:[u.jsx(Ef,{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 ee.openExternal(e.websiteUrl),children:[u.jsx(Ef,{className:"mr-1 size-3.5"}),"网站"]})]})]})})},YDn=[{value:"name-asc",label:"Name A→Z"},{value:"name-desc",label:"Name Z→A"},{value:"tools-desc",label:"Most tools"}];function VDn(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 qDn=({projectPath:e,mcpSearchQuery:t,mcpSearch:n,mcpSearchResults:r,mcpSearchLoading:s,mcpSearchWarnings:i,selectedMcpServerId:o,setSelectedMcpServerId:a,cliStatus:c,cliStatusLoading:l})=>{const d=bT(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:I,mcpInstallProgress:N}=oe(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}))),R=oe(F=>F.cliStatus),$=oe(F=>F.cliStatusLoading),A=c??R,j=l??$,Q=_?.[d]??b??[],U=x?.[d]??S??{},M=v?.[d]??T??!1,q=E?.[d]??w??null,z=P?.[d]??k??null,[L,V]=g.useState("name-asc");g.useEffect(()=>{p.length===0&&!h&&!m&&O()},[p.length,m,h,O]);const Y=g.useMemo(()=>A===null||typeof A>"u"?j?"正在检查运行时状态...":"正在检查运行时可用性...":A?.installed===!1?A.binaryPath&&A.launchError?"已找到配置的运行时,但启动失败。请前往首页修复或重新安装。":"需要配置运行时。请前往首页安装或修复。":null,[A,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,H=ne?s:h,Z=ne?i:[],se=g.useMemo(()=>new Set(Q.map(F=>F.name.toLowerCase())),[Q]),he=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]),ce=F=>se.has(DL(F.name)),me=F=>he.get(DL(F.name))??[],ae=F=>rXe(me(F)),G=F=>{const W=ae(F);return W?U[HQ(W.name,W.scope)]??U[HQ(W.name)]??U[W.name]??null:null},be=g.useMemo(()=>Object.values(U).sort((F,W)=>F.name.localeCompare(W.name)),[U]),_e=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"}},re=g.useMemo(()=>VDn(te,L),[te,L]),ge=Jle(A,!0),J=g.useMemo(()=>o?re.find(F=>F.id===o)??p.find(F=>F.id===o)??r.find(F=>F.id===o)??null:null,[re,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:M?u.jsxs(u.Fragment,{children:["正在通过 ",ge," 检查已安装的 MCP 服务器..."]}):Y||(z?`上次检查:${C3(new Date(z).toISOString())}`:u.jsx(u.Fragment,{children:"在此页面运行诊断,以验证已安装 MCP 的连接状态。"}))})]}),u.jsxs(Xe,{variant:"outline",size:"sm",onClick:()=>void C(e??void 0),disabled:M||!!Y,className:"whitespace-nowrap",children:[u.jsx(pa,{className:`mr-1.5 size-3.5 ${M?"animate-spin":""}`}),M?"检查中...":"检查状态"]})]}),(M||be.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 诊断"}),be.length>0&&u.jsxs("span",{className:"text-xs text-text-muted",children:[be.length," 个服务器"]})]}),be.length>0?u.jsx("div",{className:"mcp-diagnostics-list max-h-[18.5rem] space-y-2 overflow-y-auto pr-1",children:be.map(F=>{const W=sP(F.name,F.scope||"user",e),ue=N[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:_e(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:()=>{I(F.name,F.name,F.scope||void 0,e??void 0)},title:`卸载 ${F.name}`,children:u.jsx(Ti,{className:"size-3.5"})})]})]},HQ(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(nJe,{value:t,onChange:n,placeholder:"搜索 MCP 服务器..."})}),u.jsxs(oc,{value:L,onValueChange:F=>V(F),children:[u.jsx(_l,{className:"w-36",children:u.jsx(ac,{})}),u.jsx(bl,{children:YDn.map(F=>u.jsx(Yi,{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(Kn,{className:"size-3.5 shrink-0"}),F]},W))}),H&&re.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}),q&&(q.includes(RPn)?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(Kn,{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:A?.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:q})),!H&&re.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(Mi,{className:"size-5 text-text-muted"}):u.jsx(xU,{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?"试试其他搜索词":"稍后再回来查看新服务器"})]}),re.length>0&&u.jsx("div",{className:"mcp-servers-grid grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-3",children:re.map(F=>u.jsx(BDn,{server:F,isInstalled:ce(F),installedEntry:ae(F),installedEntries:me(F),diagnostic:G(F),diagnosticsLoading:M,onClick:a,cliStatus:A,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(FDn,{server:J,isInstalled:J?ce(J):!1,installedEntry:J?ae(J):null,installedEntries:J?me(J):[],diagnostic:J?G(J):null,diagnosticsLoading:M,projectPath:e,open:o!==null,onClose:()=>a(null),cliStatus:A,cliStatusLoading:j})]})},VP=[{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 iJe(e){return VP.find(t=>t.rootKind===e)}function Ree(e){return iJe(e).directoryName}function oJe(e){return iJe(e).audience}function cX(e){return e==="hermit"?"Hermit 管理":oJe(e)==="codex"?"Codex 专用":"共享"}function Bwe(e,t){return oJe(e)==="shared"||t==="codex"}var aJe="AlertDialog",[WDn]=dp(aJe,[TGe]),oO=TGe(),lJe=e=>{const{__scopeAlertDialog:t,...n}=e,r=oO(t);return u.jsx(Oae,{...r,...n,modal:!0})};lJe.displayName=aJe;var GDn="AlertDialogTrigger",HDn=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=oO(n);return u.jsx(Gbn,{...s,...r,ref:t})});HDn.displayName=GDn;var ZDn="AlertDialogPortal",cJe=e=>{const{__scopeAlertDialog:t,...n}=e,r=oO(t);return u.jsx(gae,{...r,...n})};cJe.displayName=ZDn;var KDn="AlertDialogOverlay",uJe=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=oO(n);return u.jsx(D3,{...s,...r,ref:t})});uJe.displayName=KDn;var kv="AlertDialogContent",[JDn,eLn]=WDn(kv),tLn=kAe("AlertDialogContent"),dJe=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...s}=e,i=oO(n),o=g.useRef(null),a=ts(t,o),c=g.useRef(null);return u.jsx(Ybn,{contentName:kv,titleName:pJe,docsSlug:"alert-dialog",children:u.jsx(JDn,{scope:n,cancelRef:c,children:u.jsxs(L3,{role:"alertdialog",...i,...s,ref:a,onOpenAutoFocus:_n(s.onOpenAutoFocus,l=>{l.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:l=>l.preventDefault(),onInteractOutside:l=>l.preventDefault(),children:[u.jsx(tLn,{children:r}),u.jsx(rLn,{contentRef:o})]})})})});dJe.displayName=kv;var pJe="AlertDialogTitle",fJe=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=oO(n);return u.jsx(_ae,{...s,...r,ref:t})});fJe.displayName=pJe;var hJe="AlertDialogDescription",mJe=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=oO(n);return u.jsx(bae,{...s,...r,ref:t})});mJe.displayName=hJe;var nLn="AlertDialogAction",OJe=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=oO(n);return u.jsx(yae,{...s,...r,ref:t})});OJe.displayName=nLn;var gJe="AlertDialogCancel",_Je=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:s}=eLn(gJe,n),i=oO(n),o=ts(t,s);return u.jsx(yae,{...i,...r,ref:o})});_Je.displayName=gJe;var rLn=({contentRef:e})=>{const t=`\`${kv}\` requires a description for the component to be accessible for screen reader users.
|
|
1644
|
+
请展开下面的 **CLI 日志** 查看可读诊断。`:null}const t2n=({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=JQn(h,c),[v,T]=g.useState(()=>i??!1),[E,w]=g.useState(!1),[P,k]=g.useState(s),C=g.useRef(null),I=r==="error",N=e2n(_,I),R=b?.filter($=>$.severity==="warning"||$.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(()=>{I&&O&&(T(!0),k(!1))},[I,O]),u.jsxs("div",{className:nt(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",I&&"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(Kn,{size:14,className:"shrink-0 text-amber-400"}):p==="info"?u.jsx(ni,{size:14,className:"shrink-0 text-sky-400"}):u.jsx(yl,{size:14,className:"shrink-0 text-[var(--step-done-text)]"}),u.jsx("p",{className:nt("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(qt,{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:nt("mt-1.5 text-xs",I||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(rKe,{steps:ZQn,currentIndex:o,errorIndex:a})}),R.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($=>!$),children:[E?u.jsx(Ur,{size:12}):u.jsx(Ln,{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:R.map($=>u.jsxs("div",{className:"text-[11px]",children:[u.jsx("div",{className:nt($.severity==="error"?"text-red-400":$.severity==="warning"?"text-amber-400":"text-[var(--color-text-secondary)]"),children:$.label}),$.detail?u.jsx("div",{className:"mt-0.5 text-[10px] text-[var(--color-text-muted)]",children:$.detail}):null]},$.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($=>!$),children:[P?u.jsx(Ur,{size:12}):u.jsx(Ln,{size:12}),"实时输出"]}),P?u.jsx("div",{ref:C,className:nt("mt-1 h-40 overflow-y-auto rounded border border-[var(--color-border)] bg-[var(--color-surface)] p-2",I&&"border-red-500/40"),children:N?u.jsx(ai,{content:N,bare:!0,maxHeight:"max-h-none"}):u.jsx("p",{className:nt("text-[11px]",I?"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($=>!$),children:[v?u.jsx(Ur,{size:12}):u.jsx(Ln,{size:12}),"CLI 日志"]}),v?u.jsx(lKe,{cliLogsTail:O,order:"newest-first",className:"mt-1"}):null]}):null]})};function cKe(e){const{progress:t,cancelProvisioning:n,cancelCurrentProvisioning:r,teamMembers:s,memberSpawnStatuses:i,memberSpawnSnapshot:o}=oe(Et(c=>({progress:Df(c,e),cancelProvisioning:c.cancelProvisioning,cancelCurrentProvisioning:c.cancelCurrentProvisioning,teamMembers:Xse(c,e),memberSpawnStatuses:c.memberSpawnStatusesByTeam[e],memberSpawnSnapshot:c.memberSpawnSnapshotsByTeam[e]})));return{presentation:g.useMemo(()=>$le({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 uKe=g.memo(function({teamName:t,surface:n="flat",dismissible:r=!1,className:s,defaultLogsOpen:i}){const{presentation:o,cancelProvisioning:a,cancelCurrentProvisioning:c,runInstanceKey:l}=cKe(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(t2n,{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:nt("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}),n2n=gie.map(e=>({key:e.key,label:e.label})),r2n={"--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 s2n(e){return e!=null&&(e.isActive||e.isFailed)}const i2n=({teamName:e,enabled:t=!0})=>{const{presentation:n,runInstanceKey:r}=cKe(e),s=g.useRef(-1),[i,o]=g.useState(!1),a=t&&s2n(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:r2n,children:u.jsx(rKe,{steps:n2n,currentIndex:n.currentStepIndex,errorIndex:c,className:"w-full origin-top scale-[0.88]"})}),u.jsx("span",{className:"sr-only",children:l})]}),u.jsx(_s,{open:i,onOpenChange:o,children:u.jsxs(cs,{className:"w-[min(1120px,92vw)] max-w-5xl p-0",children:[u.jsxs(bs,{className:"sr-only",children:[u.jsx(us,{children:"启动详情"}),u.jsx(wi,{children:"查看团队启动进度、实时输出和 CLI 日志。"})]}),u.jsx("div",{className:"max-h-[85vh] overflow-y-auto p-4",children:u.jsx(uKe,{teamName:e,surface:"flat",defaultLogsOpen:!0})})]})})]})};function o2n(e,t){if(t.relatedTaskId)return[{taskId:t.relatedTaskId,displayId:t.relatedTaskDisplayId??t.relatedTaskId.slice(0,8),teamName:e}]}function a2n(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 l2n(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 c2n(e,t){const n=t.kind==="task_comment"?"task_comment_notification":"default",r=o2n(e,t);return{from:t.sourceLabel,to:t.destinationLabel,text:l2n(t),timestamp:new Date(t.updatedAt*1e3).toISOString(),read:!0,summary:a2n(t),color:t.color,messageId:`graph-handoff:${t.key}`,source:"inbox",messageKind:n,taskRefs:r}}const Iwe=Ld.width,u2n=72,d2n=10,p2n=({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}=qN(e),O=g.useMemo(()=>BN(h?.members),[h?.members]),{teamNames:_,teamColorByName:b}=qle(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 I=s(k.anchorNodeId),N=eZe(k,v.time);if(!I||!r||N<=.001){C.style.opacity="0";continue}const R=P.get(k.anchorNodeId)??0;P.set(k.anchorNodeId,R+1);const $=R*(u2n*.34+d2n),A=.94+N*.06;C.style.left=`${Math.round(I.x)}px`,C.style.top=`${Math.round(I.y)}px`,C.style.opacity=String(N),C.style.transform=`translate(-50%, calc(-50% - ${$.toFixed(1)}px)) scale(${A.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:c2n(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:`${Iwe}px`,maxWidth:`${Iwe}px`},onDragStart:T=>{T.preventDefault()},children:u.jsx(tKe,{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))})},f2n=g.lazy(()=>Qe(()=>import("./TeamGraphOverlay-BcW3BpwF.js"),__vite__mapDeps([60,1])).then(e=>({default:e.TeamGraphOverlay}))),h2n=({teamName:e,isActive:t=!0,isPaneFocused:n=!1})=>{const r=kMn(e),{openTeamPage:s,commitOwnerSlotDrop:i,commitOwnerGridOrderDrop:o,setLayoutMode:a}=CMn(e),[c,l]=g.useState(!1),{sidebarVisible:d,toggleSidebarVisible:p}=wMn(),{dialog:f,openCreateTaskDialog:h}=TMn(e),m=g.useCallback(I=>window.dispatchEvent(new CustomEvent("graph:open-task",{detail:{teamName:e,taskId:I}})),[e]),O=g.useCallback(I=>window.dispatchEvent(new CustomEvent("graph:send-message",{detail:{teamName:e,memberName:I}})),[e]),_=g.useCallback((I,N)=>window.dispatchEvent(new CustomEvent("graph:open-profile",{detail:{teamName:e,memberName:I,...N}})),[e]),b=g.useCallback(()=>{h("")},[h]),y=g.useCallback(I=>N=>window.dispatchEvent(new CustomEvent(`graph:${I}`,{detail:{teamName:e,taskId:N}})),[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(I=>{I.kind==="task"?m(I.taskId):I.kind==="member"&&_(I.memberName)},[m,_]),onSendMessage:O,onOpenTaskDetail:m,onOpenMemberProfile:g.useCallback(I=>{_(I)},[_])};return u.jsxs("div",{className:"flex size-full overflow-hidden",style:{background:"#050510"},children:[d?u.jsx(gMn,{teamName:e,surface:"graph-tab",isActive:t,isFocused:n}):null,u.jsx("div",{className:"min-w-0 flex-1",children:u.jsx(oMn,{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(i2n,{teamName:e,enabled:t}),onLayoutModeChange:a,onOwnerSlotDrop:i,onOwnerGridOrderDrop:o,renderHud:I=>{const N=I,{getViewportSize:R,focusNodeIds:$,filters:A}=N;return u.jsxs(u.Fragment,{children:[u.jsx(p2n,{teamName:e,getTransientHandoffSnapshot:N.getTransientHandoffSnapshot,getCameraZoom:N.getCameraZoom,worldToScreen:N.worldToScreen,getNodeWorldPosition:N.getNodeWorldPosition,focusNodeIds:$,focusEdgeIds:N.focusEdgeIds??null,enabled:t}),u.jsx(kQn,{teamName:e,nodes:r.nodes,getActivityWorldRect:N.getActivityWorldRect,getCameraZoom:N.getCameraZoom,worldToScreen:N.worldToScreen,getNodeWorldPosition:N.getNodeWorldPosition,getViewportSize:R,focusNodeIds:$,enabled:t&&(A?.showActivity??!0),onOpenTaskDetail:m,onOpenMemberProfile:_})]})},renderEdgeOverlay:({edge:I,sourceNode:N,targetNode:R,onClose:$,onSelectNode:A})=>u.jsx(CQn,{teamName:e,edge:I,sourceNode:N,targetNode:R,onClose:$,onSelectNode:A,onOpenTaskDetail:m}),renderOverlay:({node:I,onClose:N})=>u.jsx(LQn,{node:I,teamName:e,onClose:N,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(f2n,{teamName:e,onClose:()=>l(!1),sidebarVisible:d,onToggleSidebar:p,onSendMessage:O,onOpenTaskDetail:m,onOpenMemberProfile:_})})]})};function yee(e){return/^[A-Za-z]:[/\\]/.test(e)||e.startsWith("\\\\")||e.startsWith("//")}function m2n(e){return e.includes("\\")&&!e.includes("/")?"\\":"/"}function Mwe(e,t){const n=m2n(e);return e.replace(/[/\\]$/,"")+n+t.replace(/[/\\]/g,n)}function YP(e,t,n=40){let r=e;if(t){const l=t.replace(/[/\\]$/,""),d=yee(r)||yee(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 O2n(e){return(/^(\/Users\/[^/]+)/.exec(e)??/^(\/home\/[^/]+)/.exec(e)??/^([A-Z]:\\Users\\[^\\]+)/i.exec(e))?.[1]??null}function xee(e){const t=e.replace(/\\/g,"/");if(t.startsWith("/Users/")||t.startsWith("/home/")){const n=al(t);if(n.length>=2){const r=n.slice(2).join("/");return r?`~/${r}`:"~"}}if(g2n(e)){const n=al(t);if(n.length>=3){const r=n.slice(3).join("/");return r?`~/${r}`:"~"}}return t}function g2n(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 oX(e,t){let n=e;if((n.startsWith("~/")||n.startsWith("~\\"))&&t){const r=O2n(t);r&&(n=Mwe(r,n.slice(2)))}return t&&!n.startsWith("/")&&!n.startsWith("~")&&!yee(n)&&(n=Mwe(t,n)),n}const Qwe=["anthropic","codex","gemini"];function _2n(e){return[...e].sort((t,n)=>Qwe.indexOf(t)-Qwe.indexOf(n))}function b2n(e,t){const n=e.associatedPaths.reduce((r,s)=>{const i=t.get(pr(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 y2n(e,t){const n=new Set,r=[];for(const s of e.associatedPaths){const i=t.get(pr(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 x2n(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 S2n({projects:e,taskCountsByProject:t,activeTeamsByProject:n,tasksLoading:r}){return e.map(s=>({id:s.id,project:s,name:s.name,formattedPath:xee(s.primaryPath),lastActivityLabel:Zb(new Date(s.mostRecentActivity),{addSuffix:!0,locale:iUe}),providerIds:_2n(s.providerIds),primaryBranch:s.primaryBranch,taskCounts:b2n(s,t),tasksLoading:r,activeTeams:y2n(s,n),additionalPathCount:Math.max(0,s.associatedPaths.length-1),pathSummary:x2n(s)}))}function v2n({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=pr(l.projectPath),p=a.get(d);p?p.push(l):a.set(d,[l])}return a}const dKe="tmp",T2n=`/${dKe}/`,E2n=`/private/${dKe}/`;function w2n(e){return e.trim().replace(/\\/g,"/").toLowerCase()}function k2n(e){const t=e.split("/").filter(Boolean);return t[t.length-1]??""}function C2n(e){return e.startsWith("/private/var/folders/")||e.startsWith("/var/folders/")||e.startsWith(E2n)||e.startsWith(T2n)||e.includes("/appdata/local/temp/")||e.includes("/appdata/locallow/temp/")}function Gl(e){const t=w2n(e??"");return t?t.includes("rendered_mcp_")||t.includes("rendered_mcp_config")||t.includes("/portable-mcp-live")?!0:k2n(t).startsWith("codex-agent-teams-appstyle-")&&C2n(t):!1}const pKe="recent-projects:open-history",See="recent-projects:open-history-changed",R2n=1e3*60*60*48,P2n=120;function fKe(){return typeof window<"u"&&typeof window.localStorage<"u"}function mB(e){let t=e.trim().replace(/\\/g,"/");if(!t||Gl(t))return null;if(t!=="/"&&!/^[A-Za-z]:\/$/.test(t))for(;t.endsWith("/");)t=t.slice(0,-1);return t}function hKe(e){return e.toLowerCase()}function mKe(){if(!fKe())return{version:1,entries:[]};try{const e=window.localStorage.getItem(pKe);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 $2n(e){const t=new Map;for(const n of e){const r=mB(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,P2n)}function N2n(e){if(!fKe())return;const t={version:1,entries:$2n(e)};try{window.localStorage.setItem(pKe,JSON.stringify(t)),window.dispatchEvent(new CustomEvent(See))}catch{}}function A2n(){const e=new Map,t=new Map;for(const n of mKe().entries){const r=mB(n.path);if(!r)continue;e.set(r,Math.max(e.get(r)??0,n.openedAt));const s=hKe(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 I2n(e,t){const n=mB(t);if(!n)return 0;const r=e.exact.get(n);if(r!=null)return r;const s=e.folded.get(hKe(n));return s?.exactPaths.size!==1?0:s.openedAt}function Dwe(e,t){return[t.primaryPath,...t.associatedPaths].reduce((n,r)=>Math.max(n,I2n(e,r)),0)}function aX(e,t=Date.now()){const n=Array.from(new Set(e.map(s=>mB(s)).filter(s=>!!s)));if(n.length===0)return;const r=mKe().entries;N2n([...r,...n.map(s=>({path:s,openedAt:t}))])}function M2n(e,t=Date.now()){const n=A2n(),r=s=>s>0&&t-s<=R2n;return[...e].sort((s,i)=>{const o=Dwe(n,s),a=Dwe(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 Q2n(e){if(typeof window>"u")return()=>{};const t=()=>e();return window.addEventListener(See,t),()=>{window.removeEventListener(See,t)}}function OKe(e){return e?Array.isArray(e)?{projects:e,degraded:!1}:Array.isArray(e.projects)?{projects:e.projects,degraded:e.degraded===!0}:null:null}const D2n=15e3,L2n=3e4;let F2=null,vee=0,Ew=null;function Y2(){const e=OKe(F2);if(!e)return null;F2!==e&&(F2=e);const t=e.degraded?L2n:D2n;return{payload:e,fetchedAt:vee,isStale:Date.now()-vee>t}}async function j2n(e,t){const n=t?.force??!1,r=Y2();if(!n&&r&&!r.isStale)return r.payload;if(Ew)return Ew;const s=e().then(i=>{const o=OKe(i);return F2=o,vee=Date.now(),o??{projects:[],degraded:!0}}).finally(()=>{Ew===s&&(Ew=null)});return Ew=s,s}function Lwe(e,t){const n=new Set(t.map(r=>pr(r)));for(const r of e)for(const s of r.worktrees)if(n.has(pr(s.path)))return{repoId:r.id,worktreeId:s.id};return null}function gKe(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 X2n(e){const t=gKe(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 ww=eo("Feature:RecentProjects:open");function U2n(){const{repositoryGroups:e,fetchRepositoryGroups:t,openTeamsTab:n}=oe(Et(l=>({repositoryGroups:l.repositoryGroups,fetchRepositoryGroups:l.fetchRepositoryGroups,openTeamsTab:l.openTeamsTab}))),r=g.useCallback(l=>{oe.setState(LU(l.repoId,l.worktreeId)),oe.getState().fetchSessionsInitial(l.worktreeId),n()},[n]),s=g.useCallback(async(l,d)=>{const f=(d.length>0?d:[l]).filter(b=>!Gl(b));if(f.length===0){ww.warn("Skipped ephemeral recent project path",{path:l});return}const h=Lwe(e,f);if(h){r(h);return}await t();const m=oe.getState().repositoryGroups,O=Lwe(m,f);if(O){r(O);return}if(Gl(l)){ww.warn("Skipped adding ephemeral recent project path",{path:l});return}await ee.config.addCustomProjectPath(l),oe.setState(b=>({repositoryGroups:[X2n(l),...b.repositoryGroups]}));const _=gKe(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),aX([l.primaryPath,...l.associatedPaths])}catch(d){ww.error("Failed to open recent project",d)}},[i]),a=g.useCallback(async l=>{try{await ee.openPath(l,l)}catch(d){ww.error("Failed to open project path",d)}},[]),c=g.useCallback(async()=>{try{const d=(await ee.config.selectFolders())[0];if(!d)return;await s(d,[d]),aX([d])}catch(l){ww.error("Failed to select project folder",l)}},[s]);return{openRecentProject:o,openProjectPath:a,selectProjectFolder:c}}const z2n=11,B2n=8,F2n=3e4,Y2n=12e4,V2n=3,q2n=8e3;function W2n(e){return new Promise((t,n)=>{const r=window.setTimeout(()=>{n(new Error("最近项目加载超时,请稍后重试。"))},q2n);e.then(s=>{window.clearTimeout(r),t(s)},s=>{window.clearTimeout(r),n(s)})})}function G2n(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 H2n(e,t=z2n){const{globalTasks:n,globalTasksInitialized:r,globalTasksLoading:s,fetchAllTasks:i,teams:o,provisioningRuns:a,currentProvisioningRunIdByTeam:c,provisioningSnapshotByTeam:l}=oe(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(()=>Y2(),[]),{openRecentProject:p,openProjectPath:f,selectProjectFolder:h}=U2n(),[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([]),[I,N]=g.useState(0),R=g.useRef(r),$=g.useRef(d?.payload.projects??[]),A=g.useMemo(()=>({currentProvisioningRunIdByTeam:c,provisioningRuns:a}),[c,a]),j=g.useMemo(()=>Object.keys(c).filter(Y=>Yy(A,Y)),[c,A]),Q=g.useMemo(()=>[...j].sort().join("\0"),[j]);g.useEffect(()=>{$.current=m},[m]);const U=g.useCallback(async Y=>{$.current.length>0||Y2()!=null||v(!0),E(null);try{const te=await W2n(j2n(()=>ee.getDashboardRecentProjects(),Y));O(te.projects),b(te.degraded),x(H=>te.degraded?H+1:0)}catch(te){E(te instanceof Error?te.message:"最近项目加载失败")}finally{v(!1)}},[]);g.useEffect(()=>{const Y=Y2();Y&&!Y.isStale||U({force:Y!=null})},[U]),g.useEffect(()=>{if(!_)return;const Y=y<=V2n?F2n:Y2n,ne=window.setTimeout(()=>{U({force:!0})},Y);return()=>{window.clearTimeout(ne)}},[y,_,U]),g.useEffect(()=>{if(m.length===0||R.current||r){R.current=R.current||r;return}R.current=!0,i()},[i,r,m.length]),g.useEffect(()=>{let Y=!1;return ee.teams.aliveList().then(ne=>{Y||C(ne)}).catch(()=>{}),()=>{Y=!0}},[Q,o]),g.useEffect(()=>{e.trim()||P(t)},[t,e]),g.useEffect(()=>Q2n(()=>N(Y=>Y+1)),[]);const M=g.useMemo(()=>nSt(n),[n]),q=g.useMemo(()=>v2n({teams:o,aliveTeamNames:k,provisioningTeamNames:j,provisioningSnapshotByTeam:l}),[k,l,j,o]),z=g.useMemo(()=>S2n({projects:M2n(m),taskCountsByProject:M,activeTeamsByProject:q,tasksLoading:s}),[q,s,I,m,M]),L=g.useMemo(()=>z.filter(Y=>G2n(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+B2n),reload:U,openRecentProject:p,openProjectPath:f,selectProjectFolder:h}}const Z2n=({card:e,onClick:t,onOpenPath:n})=>{const r=g.useMemo(()=>tHt(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(Hv,{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(it,{children:[u.jsx(ot,{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(tt,{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(IE,{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(it,{children:[u.jsx(ot,{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(Kc,{className:"size-3"})})}),u.jsx(tt,{side:"bottom",children:"打开"})]}),u.jsxs(it,{children:[u.jsx(ot,{asChild:!0,children:u.jsx("span",{className:"truncate",children:e.formattedPath})}),u.jsx(tt,{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(T$,{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(Lo,{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))]})]})},K2n=[60,66,50,55,75,45,40,65],J2n=[80,75,85,66,70,80,60,72],eDn=({searchQuery:e})=>{const{cards:t,loading:n,error:r,canLoadMore:s,isElectron:i,loadMore:o,reload:a,openRecentProject:c,openProjectPath:l}=H2n(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:`${K2n[p]}%`,backgroundColor:"var(--skeleton-base-light)"}}),u.jsx("div",{className:"mb-auto h-2.5 rounded-sm",style:{width:`${J2n[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(Hv,{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(Mi,{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(Hv,{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(Z2n,{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:"加载更多"})})]})},Kle=typeof window<"u"&&window.navigator.userAgent.includes("Macintosh"),O8=Kle?"⌘":"Ctrl+",jwe=Kle?"⇧":"Shift+";function Bg(e,t){return t?.shift?Kle?`${jwe}${O8}${e}`:`${O8}${jwe}${e}`:`${O8}${e}`}const tDn=["Claude Code","Cursor","Codex","Gemini","OpenCode","DeepSeek / IM"],nDn=["Feishu","Slack","Discord","DingTalk","WeCom","Telegram","Webhook / API"],rDn=({value:e,onChange:t})=>{const[n,r]=g.useState(!1),s=g.useRef(null),{openCommandPalette:i,selectedProjectId:o}=oe(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(Mi,{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?`搜索会话(${Bg("K")})`:`搜索项目(${Bg("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(z0,{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"})]})]})})},sDn=()=>{const[e,t]=g.useState(""),{openTeamsTab:n,openSettingsTab:r,teams:s,teamsLoading:i}=oe(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(Fht,{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(fmt,{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:tDn.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(eMe,{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:nDn.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(dc,{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(dc,{className:"size-4"}),"选择团队"]}),u.jsx("span",{className:"shrink-0 text-xs text-text-muted",children:"或"}),u.jsx("div",{className:"flex-1",children:u.jsx(rDn,{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(eDn,{searchQuery:e})]})]})]})},Xwe={search:"",categories:[],capabilities:[],installedOnly:!1};function iDn(){const[e,t]=g.useState("mcp-servers"),[n,r]=g.useState(Xwe),[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(!ee.mcpRegistry){k.current===U&&h(!1);return}ee.mcpRegistry.search(Q).then(M=>{k.current===U&&(p(M.servers),O(M.warnings),h(!1))},()=>{k.current===U&&(h(!1),O(["Search failed"]))})},300)},[]),I=g.useCallback(Q=>{r(U=>({...U,search:Q}))},[]),N=g.useCallback(Q=>{r(U=>({...U,categories:U.categories.includes(Q)?U.categories.filter(M=>M!==Q):[...U.categories,Q]}))},[]),R=g.useCallback(Q=>{r(U=>({...U,capabilities:U.capabilities.includes(Q)?U.capabilities.filter(M=>M!==Q):[...U.capabilities,Q]}))},[]),$=g.useCallback(()=>{r(Q=>({...Q,installedOnly:!Q.installedOnly}))},[]),A=g.useCallback(()=>{r(Xwe)},[]),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:I,toggleCategory:N,toggleCapability:R,toggleInstalledOnly:$,clearFilters:A,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 oDn(e){return Hse(e)}function aDn(e){return e?.flavor==="agent_teams_orchestrator"}function lDn(e){switch(e){case"supported":return"支持";case"read-only":return"只读";default:return"不支持"}}function cDn(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 _Ke(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 Uwe="Agent CLI";function Jle(e,t=!1){return e?.flavor==="agent_teams_orchestrator"?!e.displayName||e.displayName==="agent_teams_orchestrator"?Uwe:e.displayName:e?.displayName?e.displayName:t?Uwe:"Agent CLI"}function zwe(e,[t,n]){return Math.min(n,Math.max(t,e))}var uDn=[" ","Enter","ArrowUp","ArrowDown"],dDn=[" ","Enter"],vy="Select",[OB,gB,pDn]=TWe(vy),[KE]=dp(vy,[pDn,S_]),_B=S_(),[fDn,j_]=KE(vy),[hDn,mDn]=KE(vy),bKe=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=_B(t),[_,b]=g.useState(null),[y,x]=g.useState(null),[S,v]=g.useState(!1),T=nae(l),[E,w]=Em({prop:r,defaultProp:s??!1,onChange:i,caller:vy}),[P,k]=Em({prop:o,defaultProp:a,onChange:c,caller:vy}),C=g.useRef(null),I=_?m||!!_.closest("form"):!0,[N,R]=g.useState(new Set),$=Array.from(N).map(A=>A.props.value).join(";");return u.jsx(pU,{...O,children:u.jsxs(fDn,{required:h,scope:t,trigger:_,onTriggerChange:b,valueNode:y,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:v,contentId:Pa(),value:P,onValueChange:k,open:E,onOpenChange:w,dir:T,triggerPointerDownPosRef:C,disabled:f,children:[u.jsx(OB.Provider,{scope:t,children:u.jsx(hDn,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback(A=>{R(j=>new Set(j).add(A))},[]),onNativeOptionRemove:g.useCallback(A=>{R(j=>{const Q=new Set(j);return Q.delete(A),Q})},[]),children:n})}),I?u.jsxs(BKe,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:p,value:P,onChange:A=>k(A.target.value),disabled:f,form:m,children:[P===void 0?u.jsx("option",{value:""}):null,Array.from(N)]},$):null]})})};bKe.displayName=vy;var yKe="SelectTrigger",xKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,i=_B(n),o=j_(yKe,n),a=o.disabled||r,c=ts(t,o.onTriggerChange),l=gB(n),d=g.useRef("touch"),[p,f,h]=YKe(O=>{const _=l().filter(x=>!x.disabled),b=_.find(x=>x.value===o.value),y=VKe(_,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(x$,{asChild:!0,...i,children:u.jsx(mr.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":FKe(o.value)?"":void 0,...s,ref:c,onClick:_n(s.onClick,O=>{O.currentTarget.focus(),d.current!=="mouse"&&m(O)}),onPointerDown:_n(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:_n(s.onKeyDown,O=>{const _=p.current!=="";!(O.ctrlKey||O.altKey||O.metaKey)&&O.key.length===1&&f(O.key),!(_&&O.key===" ")&&uDn.includes(O.key)&&(m(),O.preventDefault())})})})});xKe.displayName=yKe;var SKe="SelectValue",vKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:i,placeholder:o="",...a}=e,c=j_(SKe,n),{onValueNodeHasChildrenChange:l}=c,d=i!==void 0,p=ts(t,c.onValueNodeChange);return Qa(()=>{l(d)},[l,d]),u.jsx(mr.span,{...a,ref:p,style:{pointerEvents:"none"},children:FKe(c.value)?u.jsx(u.Fragment,{children:o}):i})});vKe.displayName=SKe;var ODn="SelectIcon",TKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return u.jsx(mr.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});TKe.displayName=ODn;var gDn="SelectPortal",EKe=e=>u.jsx(OE,{asChild:!0,...e});EKe.displayName=gDn;var Ty="SelectContent",wKe=g.forwardRef((e,t)=>{const n=j_(Ty,e.__scopeSelect),[r,s]=g.useState();if(Qa(()=>{s(new DocumentFragment)},[]),!n.open){const i=r;return i?vi.createPortal(u.jsx(kKe,{scope:e.__scopeSelect,children:u.jsx(OB.Slot,{scope:e.__scopeSelect,children:u.jsx("div",{children:e.children})})}),i):null}return u.jsx(CKe,{...e,ref:t})});wKe.displayName=Ty;var Td=10,[kKe,X_]=KE(Ty),_Dn="SelectContentImpl",bDn=Fv("SelectContent.RemoveScroll"),CKe=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=j_(Ty,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),I=gB(n),[N,R]=g.useState(!1),$=g.useRef(!1);g.useEffect(()=>{if(x)return pae(x)},[x]),dae();const A=g.useCallback(te=>{const[H,...Z]=I().map(ce=>ce.ref.current),[se]=Z.slice(-1),he=document.activeElement;for(const ce of te)if(ce===he||(ce?.scrollIntoView({block:"nearest"}),ce===H&&v&&(v.scrollTop=0),ce===se&&v&&(v.scrollTop=v.scrollHeight),ce?.focus(),document.activeElement!==he))return},[I,v]),j=g.useCallback(()=>A([w,x]),[A,w,x]);g.useEffect(()=>{N&&j()},[N,j]);const{onOpenChange:Q,triggerPointerDownPosRef:U}=y;g.useEffect(()=>{if(x){let te={x:0,y:0};const H=se=>{te={x:Math.abs(Math.round(se.pageX)-(U.current?.x??0)),y:Math.abs(Math.round(se.pageY)-(U.current?.y??0))}},Z=se=>{te.x<=10&&te.y<=10?se.preventDefault():x.contains(se.target)||Q(!1),document.removeEventListener("pointermove",H),U.current=null};return U.current!==null&&(document.addEventListener("pointermove",H),document.addEventListener("pointerup",Z,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",H),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[M,q]=YKe(te=>{const H=I().filter(he=>!he.disabled),Z=H.find(he=>he.ref.current===document.activeElement),se=VKe(H,te,Z);se&&setTimeout(()=>se.ref.current.focus())}),z=g.useCallback((te,H,Z)=>{const se=!$.current&&!Z;(y.value!==void 0&&y.value===H||se)&&(P(te),se&&($.current=!0))},[y.value]),L=g.useCallback(()=>x?.focus(),[x]),V=g.useCallback((te,H,Z)=>{const se=!$.current&&!Z;(y.value!==void 0&&y.value===H||se)&&C(te)},[y.value]),Y=r==="popper"?Tee:RKe,ne=Y===Tee?{side:a,sideOffset:c,align:l,alignOffset:d,arrowPadding:p,collisionBoundary:f,collisionPadding:h,sticky:m,hideWhenDetached:O,avoidCollisions:_}:{};return u.jsx(kKe,{scope:n,content:x,viewport:v,onViewportChange:T,itemRefCallback:z,selectedItem:w,onItemLeave:L,itemTextRefCallback:V,focusSelectedItem:j,selectedItemText:k,position:r,isPositioned:N,searchRef:M,children:u.jsx(M3,{as:bDn,allowPinchZoom:!0,children:u.jsx(A3,{asChild:!0,trapped:y.open,onMountAutoFocus:te=>{te.preventDefault()},onUnmountAutoFocus:_n(s,te=>{y.trigger?.focus({preventScroll:!0}),te.preventDefault()}),children:u.jsx(hE,{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:()=>R(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:_n(b.onKeyDown,te=>{const H=te.ctrlKey||te.altKey||te.metaKey;if(te.key==="Tab"&&te.preventDefault(),!H&&te.key.length===1&&q(te.key),["ArrowUp","ArrowDown","Home","End"].includes(te.key)){let se=I().filter(he=>!he.disabled).map(he=>he.ref.current);if(["ArrowUp","End"].includes(te.key)&&(se=se.slice().reverse()),["ArrowUp","ArrowDown"].includes(te.key)){const he=te.target,ce=se.indexOf(he);se=se.slice(ce+1)}setTimeout(()=>A(se)),te.preventDefault()}})})})})})})});CKe.displayName=_Dn;var yDn="SelectItemAlignedPosition",RKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,i=j_(Ty,n),o=X_(Ty,n),[a,c]=g.useState(null),[l,d]=g.useState(null),p=ts(t,E=>d(E)),f=gB(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 he=k.left-w.left,ce=P.left-he,me=E.left-ce,ae=E.width+me,G=Math.max(ae,w.width),be=window.innerWidth-Td,_e=zwe(ce,[Td,Math.max(Td,be-G)]);a.style.minWidth=ae+"px",a.style.left=_e+"px"}else{const he=w.right-k.right,ce=window.innerWidth-P.right-he,me=window.innerWidth-E.right-ce,ae=E.width+me,G=Math.max(ae,w.width),be=window.innerWidth-Td,_e=zwe(ce,[Td,Math.max(Td,be-G)]);a.style.minWidth=ae+"px",a.style.right=_e+"px"}const C=f(),I=window.innerHeight-Td*2,N=O.scrollHeight,R=window.getComputedStyle(l),$=parseInt(R.borderTopWidth,10),A=parseInt(R.paddingTop,10),j=parseInt(R.borderBottomWidth,10),Q=parseInt(R.paddingBottom,10),U=$+A+N+Q+j,M=Math.min(_.offsetHeight*5,U),q=window.getComputedStyle(O),z=parseInt(q.paddingTop,10),L=parseInt(q.paddingBottom,10),V=E.top+E.height/2-Td,Y=I-V,ne=_.offsetHeight/2,te=_.offsetTop+ne,H=$+A+te,Z=U-H;if(H<=V){const he=C.length>0&&_===C[C.length-1].ref.current;a.style.bottom="0px";const ce=l.clientHeight-O.offsetTop-O.offsetHeight,me=Math.max(Y,ne+(he?L:0)+ce+j),ae=H+me;a.style.height=ae+"px"}else{const he=C.length>0&&_===C[0].ref.current;a.style.top="0px";const me=Math.max(V,$+O.offsetTop+(he?z:0)+ne)+Z;a.style.height=me+"px",O.scrollTop=H-V+O.offsetTop}a.style.margin=`${Td}px 0`,a.style.minHeight=M+"px",a.style.maxHeight=I+"px",r?.(),requestAnimationFrame(()=>h.current=!0)}},[f,i.trigger,i.valueNode,a,l,O,_,b,i.dir,r]);Qa(()=>x(),[x]);const[S,v]=g.useState();Qa(()=>{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(SDn,{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(mr.div,{...s,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});RKe.displayName=yDn;var xDn="SelectPopperPosition",Tee=g.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=Td,...i}=e,o=_B(n);return u.jsx(fU,{...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)"}})});Tee.displayName=xDn;var[SDn,ece]=KE(Ty,{}),Eee="SelectViewport",PKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,i=X_(Eee,n),o=ece(Eee,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(mr.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:_n(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-Td*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})})})]})});PKe.displayName=Eee;var $Ke="SelectGroup",[vDn,TDn]=KE($Ke),EDn=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Pa();return u.jsx(vDn,{scope:n,id:s,children:u.jsx(mr.div,{role:"group","aria-labelledby":s,...r,ref:t})})});EDn.displayName=$Ke;var NKe="SelectLabel",AKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=TDn(NKe,n);return u.jsx(mr.div,{id:s.id,...r,ref:t})});AKe.displayName=NKe;var lX="SelectItem",[wDn,IKe]=KE(lX),MKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:i,...o}=e,a=j_(lX,n),c=X_(lX,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=Pa(),_=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(wDn,{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(mr.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:_n(o.onFocus,()=>h(!0)),onBlur:_n(o.onBlur,()=>h(!1)),onClick:_n(o.onClick,()=>{_.current!=="mouse"&&b()}),onPointerUp:_n(o.onPointerUp,()=>{_.current==="mouse"&&b()}),onPointerDown:_n(o.onPointerDown,y=>{_.current=y.pointerType}),onPointerMove:_n(o.onPointerMove,y=>{_.current=y.pointerType,s?c.onItemLeave?.():_.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_n(o.onPointerLeave,y=>{y.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:_n(o.onKeyDown,y=>{c.searchRef?.current!==""&&y.key===" "||(dDn.includes(y.key)&&b(),y.key===" "&&y.preventDefault())})})})})});MKe.displayName=lX;var vk="SelectItemText",QKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...i}=e,o=j_(vk,n),a=X_(vk,n),c=IKe(vk,n),l=mDn(vk,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 Qa(()=>(O(m),()=>_(m)),[O,_,m]),u.jsxs(u.Fragment,{children:[u.jsx(mr.span,{id:c.textId,...i,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?vi.createPortal(i.children,o.valueNode):null]})});QKe.displayName=vk;var DKe="SelectItemIndicator",LKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return IKe(DKe,n).isSelected?u.jsx(mr.span,{"aria-hidden":!0,...r,ref:t}):null});LKe.displayName=DKe;var wee="SelectScrollUpButton",jKe=g.forwardRef((e,t)=>{const n=X_(wee,e.__scopeSelect),r=ece(wee,e.__scopeSelect),[s,i]=g.useState(!1),o=ts(t,r.onScrollButtonChange);return Qa(()=>{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(UKe,{...e,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});jKe.displayName=wee;var kee="SelectScrollDownButton",XKe=g.forwardRef((e,t)=>{const n=X_(kee,e.__scopeSelect),r=ece(kee,e.__scopeSelect),[s,i]=g.useState(!1),o=ts(t,r.onScrollButtonChange);return Qa(()=>{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(UKe,{...e,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});XKe.displayName=kee;var UKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,i=X_("SelectScrollButton",n),o=g.useRef(null),a=gB(n),c=g.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return g.useEffect(()=>()=>c(),[c]),Qa(()=>{a().find(d=>d.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),u.jsx(mr.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:_n(s.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:_n(s.onPointerMove,()=>{i.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:_n(s.onPointerLeave,()=>{c()})})}),kDn="SelectSeparator",zKe=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return u.jsx(mr.div,{"aria-hidden":!0,...r,ref:t})});zKe.displayName=kDn;var Cee="SelectArrow",CDn=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=_B(n),i=j_(Cee,n),o=X_(Cee,n);return i.open&&o.position==="popper"?u.jsx(hU,{...s,...r,ref:t}):null});CDn.displayName=Cee;var RDn="SelectBubbleInput",BKe=g.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=g.useRef(null),i=ts(r,s),o=AZe(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(mr.select,{...n,style:{...rIe,...n.style},ref:i,defaultValue:t})});BKe.displayName=RDn;function FKe(e){return e===""||e===void 0}function YKe(e){const t=Gg(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 VKe(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=PDn(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 PDn(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var $Dn=bKe,qKe=xKe,NDn=vKe,ADn=TKe,IDn=EKe,WKe=wKe,MDn=PKe,GKe=AKe,HKe=MKe,QDn=QKe,DDn=LKe,ZKe=jKe,KKe=XKe,JKe=zKe;const oc=$Dn,ac=NDn,_l=g.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(qKe,{ref:r,className:nt("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(ADn,{asChild:!0,children:u.jsx(Ur,{className:"size-4 opacity-50"})})]}));_l.displayName=qKe.displayName;const eJe=g.forwardRef(({className:e,...t},n)=>u.jsx(ZKe,{ref:n,className:nt("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(gE,{className:"size-4"})}));eJe.displayName=ZKe.displayName;const tJe=g.forwardRef(({className:e,...t},n)=>u.jsx(KKe,{ref:n,className:nt("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(Ur,{className:"size-4"})}));tJe.displayName=KKe.displayName;const bl=g.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>u.jsx(IDn,{children:u.jsxs(WKe,{ref:s,className:nt("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(eJe,{}),u.jsx(MDn,{className:nt("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),u.jsx(tJe,{})]})}));bl.displayName=WKe.displayName;const LDn=g.forwardRef(({className:e,...t},n)=>u.jsx(GKe,{ref:n,className:nt("px-2 py-1.5 text-sm font-semibold text-[var(--color-text-muted)]",e),...t}));LDn.displayName=GKe.displayName;const Yi=g.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(HKe,{ref:r,className:nt("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(DDn,{children:u.jsx(Kr,{className:"size-4"})})}),u.jsx(QDn,{children:t})]}));Yi.displayName=HKe.displayName;const jDn=g.forwardRef(({className:e,...t},n)=>u.jsx(JKe,{ref:n,className:nt("-mx-1 my-1 h-px bg-[var(--color-border)]",e),...t}));jDn.displayName=JKe.displayName;const XDn=/^[\w.-]{1,100}$/,UDn=[{value:"streamable-http",label:"Streamable HTTP"},{value:"sse",label:"SSE"},{value:"http",label:"HTTP"}],zDn=({open:e,onClose:t,projectPath:n,cliStatus:r,cliStatusLoading:s})=>{const i=oe(ce=>ce.installCustomMcpServer),o=oe(ce=>ce.cliStatus),a=oe(ce=>ce.cliStatusLoading),c=r??o,l=s??a,d=Ise(c?.flavor),p=[{value:d,label:yZ(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([]),[I,N]=g.useState([]),[R,$]=g.useState(null),[A,j]=g.useState(!1),Q=g.useRef({}),U=g.useRef(!1),M=g.useRef(d),q=I.map(ce=>ce.key.trim()).filter(Boolean).sort().join("\0"),z=ku(_)?n??void 0:void 0,L=JO({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([]),N([]),$(null),j(!1),Q.current={}),U.current=e,e||(M.current=d)},[d,e]),g.useEffect(()=>{if(!e){M.current=d;return}const ce=M.current;ce!==d&&_===ce&&iXe(_)&&b(d),M.current=d},[d,e,_]),g.useEffect(()=>{e&&ku(_)&&!n&&b(d)},[d,e,n,_]),g.useEffect(()=>{if(!e||I.length===0||!ee.apiKeys)return;const ce=I.map(me=>me.key.trim()).filter(Boolean);ce.length!==0&&ee.apiKeys.lookup(ce,z).then(me=>{const ae=Q.current,G=Object.fromEntries(me.map(be=>[be.envVarName,be.value]));N(be=>{let _e=!1;const re=be.map(ge=>{const J=ge.key.trim();if(!J)return ge;const F=ae[J],W=G[J];return W?(!ge.value||ge.value===F)&&ge.value!==W?(_e=!0,{...ge,value:W}):ge:F&&ge.value===F?(_e=!0,{...ge,value:""}):ge});return _e?re:be}),Q.current=G},()=>{})},[z,q,e]);const V=async()=>{if($(null),L){$(L);return}if(!f.trim()){$("Server name is required");return}if(!XDn.test(f)){$("Invalid server name. Use alphanumeric characters, dashes, underscores, dots.");return}let ce;if(m==="stdio"){if(!y.trim()){$("npm package name is required");return}ce={type:"stdio",npmPackage:y.trim(),npmVersion:S.trim()||void 0}}else{if(!T.trim()){$("Server URL is required");return}ce={type:"http",url:T.trim(),transportType:w}}const me={};for(const G of I)G.key.trim()&&G.value&&(me[G.key.trim()]=G.value);const ae={serverName:f,scope:_,projectPath:ku(_)?n??void 0:void 0,installSpec:ce,envValues:me,headers:k.filter(G=>G.key.trim()&&G.value.trim())};j(!0);try{await i(ae),t()}catch(G){$(G instanceof Error?G.message:"安装失败")}finally{j(!1)}},Y=()=>N(ce=>[...ce,{key:"",value:""}]),ne=ce=>N(me=>me.filter((ae,G)=>G!==ce)),te=(ce,me,ae)=>N(G=>G.map((be,_e)=>_e===ce?{...be,[me]:ae}:be)),H=()=>C(ce=>[...ce,{key:"",value:""}]),Z=ce=>C(me=>me.filter((ae,G)=>G!==ce)),se=(ce,me,ae)=>C(G=>G.map((be,_e)=>_e===ce?{...be,[me]:ae}:be)),he=f.trim()&&(m==="stdio"?y.trim():T.trim())&&!(ku(_)&&!n)&&!L&&!A;return u.jsx(_s,{open:e,onOpenChange:ce=>!ce&&t(),children:u.jsxs(cs,{className:"max-h-[85vh] max-w-lg overflow-y-auto",children:[u.jsx(bs,{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(xU,{className:"size-4 text-text-muted"})}),u.jsxs("div",{children:[u.jsx(us,{children:"添加自定义 MCP 服务器"}),u.jsx(wi,{children:"不通过目录,手动添加一个服务器。"})]})]})}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Kt,{htmlFor:"custom-name",className:"text-xs",children:"服务器名称"}),u.jsx(In,{id:"custom-name",value:f,onChange:ce=>h(ce.target.value),placeholder:"my-server",className:"h-8 text-sm",autoFocus:!0})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Kt,{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(Kt,{htmlFor:"custom-npm",className:"text-xs",children:"npm 包"}),u.jsx(In,{id:"custom-npm",value:y,onChange:ce=>x(ce.target.value),placeholder:"@example/mcp-server",className:"h-8 font-mono text-sm"})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Kt,{htmlFor:"custom-version",className:"text-xs",children:"版本(可选)"}),u.jsx(In,{id:"custom-version",value:S,onChange:ce=>v(ce.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(Kt,{htmlFor:"custom-url",className:"text-xs",children:"服务器 URL"}),u.jsx(In,{id:"custom-url",value:T,onChange:ce=>E(ce.target.value),placeholder:"https://api.example.com/mcp",className:"h-8 text-sm"})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Kt,{className:"text-xs",children:"传输类型"}),u.jsxs(oc,{value:w,onValueChange:ce=>P(ce),children:[u.jsx(_l,{className:"h-8 text-sm",children:u.jsx(ac,{})}),u.jsx(bl,{children:UDn.map(ce=>u.jsx(Yi,{value:ce.value,children:ce.label},ce.value))})]})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(Kt,{className:"text-xs",children:"请求头"}),u.jsxs(Xe,{variant:"ghost",size:"sm",onClick:H,className:"h-6 px-1.5 text-xs",children:[u.jsx(xl,{className:"mr-1 size-3"}),"添加"]})]}),k.length>0&&u.jsx("div",{className:"space-y-2",children:k.map((ce,me)=>u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(In,{value:ce.key,onChange:ae=>se(me,"key",ae.target.value),className:"h-7 w-32 text-xs",placeholder:"Header-Name"}),u.jsx(In,{value:ce.value,onChange:ae=>se(me,"value",ae.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(me),children:u.jsx(Ti,{className:"size-3"})})]},me))})]})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Kt,{className:"text-xs",children:"作用域"}),u.jsxs(oc,{value:_,onValueChange:ce=>b(ce),children:[u.jsx(_l,{className:"h-8 text-sm",children:u.jsx(ac,{})}),u.jsx(bl,{children:p.map(ce=>u.jsx(Yi,{value:ce.value,disabled:ku(ce.value)&&!n,children:ce.label},ce.value))})]})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(Kt,{className:"text-xs",children:"环境变量"}),u.jsxs(Xe,{variant:"ghost",size:"sm",onClick:Y,className:"h-6 px-1.5 text-xs",children:[u.jsx(xl,{className:"mr-1 size-3"}),"添加"]})]}),I.length>0&&u.jsx("div",{className:"space-y-2",children:I.map((ce,me)=>u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(In,{value:ce.key,onChange:ae=>te(me,"key",ae.target.value),className:"h-7 w-40 font-mono text-xs",placeholder:"ENV_VAR_NAME"}),u.jsx(In,{type:"password",value:ce.value,onChange:ae=>te(me,"value",ae.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(me),children:u.jsx(Ti,{className:"size-3"})})]},me))})]}),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}),R&&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:R}),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:!he,onClick:()=>void V(),children:A?"正在安装...":"安装"})]})]})]})})},nJe=({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(Mi,{className:"absolute left-3 top-1/2 size-4 -translate-y-1/2 text-text-muted"}),u.jsx(In,{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"})})]})},rJe=({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}=oe(Et(S=>({cliStatus:S.cliStatus,cliStatusLoading:S.cliStatusLoading}))),m=JO({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(qt,{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(Kr,{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(nc,{children:u.jsxs(it,{children:[u.jsx(ot,{asChild:!0,children:u.jsx("span",{tabIndex:0,children:S})}),u.jsx(tt,{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(Ti,{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(nc,{children:u.jsxs(it,{children:[u.jsx(ot,{asChild:!0,children:u.jsx("span",{tabIndex:0,children:x})}),u.jsx(tt,{className:"max-w-64",children:m})]})}):x},sJe=({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"}),BDn=({server:e,isInstalled:t,installedEntry:n,installedEntries:r=[],diagnostic:s,diagnosticsLoading:i,onClick:o,cliStatus:a,cliStatusLoading:c})=>{const l=oe(R=>R.cliStatus),d=a??l,p=Ise(d?.flavor),f=sP(e.id,p),h=oe(R=>R.mcpInstallProgress[f]??"idle"),m=oe(R=>R.installMcpServer),O=oe(R=>R.uninstallMcpServer),_=oe(R=>R.installErrors[f]),b=oe(R=>e.repositoryUrl?R.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=DL(e.name),T=x.find(R=>R.scope===p)??null,E=sXe(x),w=t&&x.length===1&&T?.name===v&&!S,P=y&&(t?w:!S),[k,C]=g.useState(!1),I=!!e.iconUrl&&!k,N=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:R=>{(R.key==="Enter"||R.key===" ")&&(R.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:[I&&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(sJe,{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:N,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(bE,{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(cft,{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(B0,{className:"size-3"}),"Auth"]}),e.version&&u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(Zht,{className:"size-3"}),e.version]}),e.updatedAt&&u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(uc,{className:"size-3"}),C3(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(Kdt,{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(VD,{className:"size-3"}),"Both"]}),e.repositoryUrl&&u.jsxs(it,{children:[u.jsx(ot,{asChild:!0,children:u.jsxs("button",{className:"inline-flex items-center gap-1.5 text-text-muted transition-colors hover:text-text",onClick:R=>{R.stopPropagation(),ee.openExternal(e.repositoryUrl)},children:[u.jsx(zpt,{className:"size-3.5"}),b!=null&&u.jsxs("span",{className:"inline-flex items-center gap-0.5",children:[u.jsx(rMe,{className:"size-3 fill-amber-400 text-amber-400"}),Rhn(b)]})]})}),u.jsx(tt,{side:"top",children:"Repository"})]}),e.websiteUrl&&u.jsxs(it,{children:[u.jsx(ot,{asChild:!0,children:u.jsx("button",{className:"inline-flex items-center text-text-muted transition-colors hover:text-text",onClick:R=>{R.stopPropagation(),ee.openExternal(e.websiteUrl)},children:u.jsx(VD,{className:"size-3.5"})})}),u.jsx(tt,{side:"top",children:"Website"})]})]}),P&&u.jsx("div",{className:"shrink-0",children:u.jsx(rJe,{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:R=>{R.stopPropagation(),o(e.id)},children:t?"Manage":"Configure"})})]})]})},FDn=({server:e,isInstalled:t,installedEntry:n,installedEntries:r=[],diagnostic:s,diagnosticsLoading:i,projectPath:o,open:a,onClose:c,cliStatus:l,cliStatusLoading:d})=>{const p=oe(ie=>ie.cliStatus),f=l??p,h=Ise(f?.flavor),[m,O]=g.useState(h),_=e?sP(e.id,m,o):null,b=oe(ie=>(_?ie.mcpInstallProgress[_]:void 0)??"idle"),y=oe(ie=>ie.installMcpServer),x=oe(ie=>ie.uninstallMcpServer),S=oe(ie=>_?ie.installErrors[_]:void 0),v=oe(ie=>e?.repositoryUrl?ie.mcpGitHubStars[e.repositoryUrl]:void 0),[T,E]=g.useState(""),[w,P]=g.useState({}),[k,C]=g.useState([]),[I,N]=g.useState(!1),[R,$]=g.useState(new Set),A=g.useRef({}),j=g.useRef(h),Q=r.length?r:n?[n]:[],U=[{value:h,label:yZ(h,f?.flavor)},...h!=="user"&&Q.some(ie=>ie.scope==="user")?[{value:"user",label:yZ("user",f?.flavor)}]:[],{value:"project",label:"项目"},{value:"local",label:"本地"}],M=rXe(Q),q=Q.find(ie=>ie.scope===m)??null,z=sXe(Q),L=e?.envVars.map(ie=>ie.name).sort().join("\0")??"",V=f?.flavor==="agent_teams_orchestrator"?"运行时状态":"Claude 状态",Y=ku(m)?o??void 0:void 0;if(g.useEffect(()=>{!e||!a||(P(Object.fromEntries(e.envVars.map(ie=>[ie.name,""]))),C((e.authHeaders??[]).map(ie=>({key:ie.key,value:"",secret:ie.isSecret,description:ie.description,isRequired:ie.isRequired,valueTemplate:ie.valueTemplate,locked:!0}))),E(M?.name??DL(e.name)),O(M?.scope??h),N(!1),$(new Set),A.current={})},[a,M?.name,M?.scope,e?.id]),g.useEffect(()=>{if(!a){j.current=h;return}const ie=j.current;ie!==h&&!M&&m===ie&&iXe(m)&&O(h),j.current=h},[h,a,M,m]),g.useEffect(()=>{!e||!a||!q||E(q.name)},[a,q,e]),g.useEffect(()=>{a&&ku(m)&&!o&&O(h)},[h,a,o,m]),g.useEffect(()=>{if(!e||!a||e.envVars.length===0||!ee.apiKeys)return;const ie=e.envVars.map(le=>le.name);ee.apiKeys.lookup(ie,Y).then(le=>{const K=A.current,pe={};for(const we of le)pe[we.envVarName]=we.value;P(we=>{const Ee={...we};for(const[Ae,We]of Object.entries(K))!(Ae in pe)&&Ee[Ae]===We&&(Ee[Ae]="");for(const[Ae,We]of Object.entries(pe))(!Ee[Ae]||Ee[Ae]===K[Ae])&&(Ee[Ae]=We);return Ee}),$(new Set(Object.keys(pe))),A.current=pe},()=>{})},[Y,L,a,e?.id]),!e)return u.jsx(u.Fragment,{});const ne=!!e.installSpec,te=e.installSpec?.type==="http",H=!!e.iconUrl&&!I,Z=e.installSpec?.type==="stdio"?`https://www.npmjs.com/package/${e.installSpec.npmPackage}`:null,se=k.some(ie=>ie.locked),he=e.envVars.some(ie=>ie.isRequired&&!w[ie.name]?.trim()),ce=k.some(ie=>ie.isRequired&&!ie.value.trim()),me=q!==null,ae=q?.name??T,G=q?.scope??m,be=ku(m)&&!o,_e=!T.trim()||he||ce||be,re=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:ku(m)?o??void 0:void 0,envValues:w,headers:k})},J=()=>{x(e.id,ae,G,ku(G)?o??void 0:void 0)},F=()=>{C(ie=>[...ie,{key:"",value:""}])},W=ie=>{C(le=>le.filter((K,pe)=>pe!==ie))},ue=(ie,le,K)=>{C(pe=>pe.map((we,Ee)=>Ee===ie?{...we,[le]:K}:we))};return u.jsx(_s,{open:a,onOpenChange:ie=>!ie&&c(),children:u.jsxs(cs,{className:"max-h-[85vh] max-w-2xl overflow-y-auto",children:[u.jsx(bs,{children:u.jsxs("div",{className:"flex items-start gap-3",children:[H&&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:()=>N(!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(us,{className:"truncate",children:e.name}),u.jsx(wi,{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(sJe,{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(rMe,{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 ee.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(B0,{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 密钥。若安装后连接失败,请查看提供商文档。"}),me&&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:V}),i&&!s?u.jsx(Ut,{className:"border-border bg-surface-raised text-text-muted",variant:"outline",children:"检查中..."}):s?u.jsx(Ut,{className:re,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:me?"管理安装":"安装服务器"}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Kt,{htmlFor:"server-name",className:"text-xs",children:"服务器名称"}),u.jsx(In,{id:"server-name",value:T,onChange:ie=>E(ie.target.value),placeholder:"my-server",className:"h-8 text-sm",disabled:me})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Kt,{className:"text-xs",children:"范围"}),u.jsxs(oc,{value:m,onValueChange:ie=>O(ie),children:[u.jsx(_l,{className:"h-8 text-sm",children:u.jsx(ac,{})}),u.jsx(bl,{children:U.map(ie=>u.jsx(Yi,{value:ie.value,disabled:ku(ie.value)&&!o,children:ie.label},ie.value))})]})]}),e.envVars.length>0&&u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Kt,{className:"text-xs",children:"环境变量"}),u.jsx("div",{className:"space-y-2",children:e.envVars.map(ie=>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:ie.name}),u.jsx(In,{type:ie.isSecret?"password":"text",value:w[ie.name]??"",onChange:le=>P(K=>({...K,[ie.name]:le.target.value})),className:"h-7 flex-1 text-xs",placeholder:ie.description??ie.name}),R.has(ie.name)&&w[ie.name]&&u.jsx("span",{className:"shrink-0 text-[10px] text-emerald-400",children:"已自动填充"})]},ie.name))})]}),te&&u.jsxs("div",{className:"space-y-1.5",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(Kt,{className:"text-xs",children:"请求头"}),u.jsxs(Xe,{variant:"ghost",size:"sm",onClick:F,className:"h-6 px-1.5 text-xs",children:[u.jsx(xl,{className:"mr-1 size-3"}),se?"添加自定义":"添加"]})]}),k.length>0&&u.jsx("div",{className:"space-y-2",children:k.map((ie,le)=>u.jsxs("div",{className:"space-y-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[ie.locked?u.jsx("code",{className:"w-32 shrink-0 truncate text-xs text-blue-400",children:ie.key}):u.jsx(In,{value:ie.key,onChange:K=>ue(le,"key",K.target.value),className:"h-7 w-32 text-xs",placeholder:"Header-Name"}),u.jsx(In,{type:ie.secret?"password":"text",value:ie.value,onChange:K=>ue(le,"value",K.target.value),className:"h-7 flex-1 text-xs",placeholder:ie.valueTemplate??ie.description??"value"}),u.jsx(Xe,{variant:"ghost",size:"icon",className:"size-7 text-red-400 hover:bg-red-500/10",onClick:()=>W(le),disabled:ie.locked&&ie.isRequired,children:u.jsx(Ti,{className:"size-3"})})]}),(ie.description||ie.valueTemplate||ie.isRequired)&&u.jsx("p",{className:"text-[10px] text-text-muted",children:[ie.isRequired?"必填":null,ie.description,ie.valueTemplate].filter(Boolean).join(" • ")})]},le))})]}),u.jsx("div",{className:"flex justify-end pt-1",children:u.jsx(rJe,{state:b,isInstalled:me,section:"mcp",cliStatus:f,cliStatusLoading:d,onInstall:ge,onUninstall:J,disabled:_e,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(bE,{className:"size-4"}),"工具(",e.tools.length,")"]}),u.jsx("div",{className:"max-h-48 space-y-1 overflow-y-auto",children:e.tools.map(ie=>u.jsxs("div",{className:"rounded-md bg-surface-raised p-2 text-xs",children:[u.jsx("code",{className:"font-mono text-text",children:ie.name}),ie.description&&u.jsx("p",{className:"mt-0.5 text-text-muted",children:ie.description})]},ie.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 ee.openExternal(e.repositoryUrl),children:[u.jsx(Ef,{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 ee.openExternal(e.glamaUrl),children:[u.jsx(Ef,{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 ee.openExternal(e.websiteUrl),children:[u.jsx(Ef,{className:"mr-1 size-3.5"}),"网站"]})]})]})})},YDn=[{value:"name-asc",label:"Name A→Z"},{value:"name-desc",label:"Name Z→A"},{value:"tools-desc",label:"Most tools"}];function VDn(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 qDn=({projectPath:e,mcpSearchQuery:t,mcpSearch:n,mcpSearchResults:r,mcpSearchLoading:s,mcpSearchWarnings:i,selectedMcpServerId:o,setSelectedMcpServerId:a,cliStatus:c,cliStatusLoading:l})=>{const d=bT(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:I,mcpInstallProgress:N}=oe(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}))),R=oe(F=>F.cliStatus),$=oe(F=>F.cliStatusLoading),A=c??R,j=l??$,Q=_?.[d]??b??[],U=x?.[d]??S??{},M=v?.[d]??T??!1,q=E?.[d]??w??null,z=P?.[d]??k??null,[L,V]=g.useState("name-asc");g.useEffect(()=>{p.length===0&&!h&&!m&&O()},[p.length,m,h,O]);const Y=g.useMemo(()=>A===null||typeof A>"u"?j?"正在检查运行时状态...":"正在检查运行时可用性...":A?.installed===!1?A.binaryPath&&A.launchError?"已找到配置的运行时,但启动失败。请前往首页修复或重新安装。":"需要配置运行时。请前往首页安装或修复。":null,[A,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,H=ne?s:h,Z=ne?i:[],se=g.useMemo(()=>new Set(Q.map(F=>F.name.toLowerCase())),[Q]),he=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]),ce=F=>se.has(DL(F.name)),me=F=>he.get(DL(F.name))??[],ae=F=>rXe(me(F)),G=F=>{const W=ae(F);return W?U[HQ(W.name,W.scope)]??U[HQ(W.name)]??U[W.name]??null:null},be=g.useMemo(()=>Object.values(U).sort((F,W)=>F.name.localeCompare(W.name)),[U]),_e=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"}},re=g.useMemo(()=>VDn(te,L),[te,L]),ge=Jle(A,!0),J=g.useMemo(()=>o?re.find(F=>F.id===o)??p.find(F=>F.id===o)??r.find(F=>F.id===o)??null:null,[re,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:M?u.jsxs(u.Fragment,{children:["正在通过 ",ge," 检查已安装的 MCP 服务器..."]}):Y||(z?`上次检查:${C3(new Date(z).toISOString())}`:u.jsx(u.Fragment,{children:"在此页面运行诊断,以验证已安装 MCP 的连接状态。"}))})]}),u.jsxs(Xe,{variant:"outline",size:"sm",onClick:()=>void C(e??void 0),disabled:M||!!Y,className:"whitespace-nowrap",children:[u.jsx(pa,{className:`mr-1.5 size-3.5 ${M?"animate-spin":""}`}),M?"检查中...":"检查状态"]})]}),(M||be.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 诊断"}),be.length>0&&u.jsxs("span",{className:"text-xs text-text-muted",children:[be.length," 个服务器"]})]}),be.length>0?u.jsx("div",{className:"mcp-diagnostics-list max-h-[18.5rem] space-y-2 overflow-y-auto pr-1",children:be.map(F=>{const W=sP(F.name,F.scope||"user",e),ue=N[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:_e(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:()=>{I(F.name,F.name,F.scope||void 0,e??void 0)},title:`卸载 ${F.name}`,children:u.jsx(Ti,{className:"size-3.5"})})]})]},HQ(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(nJe,{value:t,onChange:n,placeholder:"搜索 MCP 服务器..."})}),u.jsxs(oc,{value:L,onValueChange:F=>V(F),children:[u.jsx(_l,{className:"w-36",children:u.jsx(ac,{})}),u.jsx(bl,{children:YDn.map(F=>u.jsx(Yi,{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(Kn,{className:"size-3.5 shrink-0"}),F]},W))}),H&&re.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}),q&&(q.includes(RPn)?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(Kn,{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:A?.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:q})),!H&&re.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(Mi,{className:"size-5 text-text-muted"}):u.jsx(xU,{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?"试试其他搜索词":"稍后再回来查看新服务器"})]}),re.length>0&&u.jsx("div",{className:"mcp-servers-grid grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-3",children:re.map(F=>u.jsx(BDn,{server:F,isInstalled:ce(F),installedEntry:ae(F),installedEntries:me(F),diagnostic:G(F),diagnosticsLoading:M,onClick:a,cliStatus:A,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(FDn,{server:J,isInstalled:J?ce(J):!1,installedEntry:J?ae(J):null,installedEntries:J?me(J):[],diagnostic:J?G(J):null,diagnosticsLoading:M,projectPath:e,open:o!==null,onClose:()=>a(null),cliStatus:A,cliStatusLoading:j})]})},VP=[{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 iJe(e){return VP.find(t=>t.rootKind===e)}function Ree(e){return iJe(e).directoryName}function oJe(e){return iJe(e).audience}function cX(e){return e==="hermit"?"Hermit 管理":oJe(e)==="codex"?"Codex 专用":"共享"}function Bwe(e,t){return oJe(e)==="shared"||t==="codex"}var aJe="AlertDialog",[WDn]=dp(aJe,[TGe]),oO=TGe(),lJe=e=>{const{__scopeAlertDialog:t,...n}=e,r=oO(t);return u.jsx(Oae,{...r,...n,modal:!0})};lJe.displayName=aJe;var GDn="AlertDialogTrigger",HDn=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=oO(n);return u.jsx(Gbn,{...s,...r,ref:t})});HDn.displayName=GDn;var ZDn="AlertDialogPortal",cJe=e=>{const{__scopeAlertDialog:t,...n}=e,r=oO(t);return u.jsx(gae,{...r,...n})};cJe.displayName=ZDn;var KDn="AlertDialogOverlay",uJe=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=oO(n);return u.jsx(D3,{...s,...r,ref:t})});uJe.displayName=KDn;var kv="AlertDialogContent",[JDn,eLn]=WDn(kv),tLn=kAe("AlertDialogContent"),dJe=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...s}=e,i=oO(n),o=g.useRef(null),a=ts(t,o),c=g.useRef(null);return u.jsx(Ybn,{contentName:kv,titleName:pJe,docsSlug:"alert-dialog",children:u.jsx(JDn,{scope:n,cancelRef:c,children:u.jsxs(L3,{role:"alertdialog",...i,...s,ref:a,onOpenAutoFocus:_n(s.onOpenAutoFocus,l=>{l.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:l=>l.preventDefault(),onInteractOutside:l=>l.preventDefault(),children:[u.jsx(tLn,{children:r}),u.jsx(rLn,{contentRef:o})]})})})});dJe.displayName=kv;var pJe="AlertDialogTitle",fJe=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=oO(n);return u.jsx(_ae,{...s,...r,ref:t})});fJe.displayName=pJe;var hJe="AlertDialogDescription",mJe=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=oO(n);return u.jsx(bae,{...s,...r,ref:t})});mJe.displayName=hJe;var nLn="AlertDialogAction",OJe=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=oO(n);return u.jsx(yae,{...s,...r,ref:t})});OJe.displayName=nLn;var gJe="AlertDialogCancel",_Je=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:s}=eLn(gJe,n),i=oO(n),o=ts(t,s);return u.jsx(yae,{...i,...r,ref:o})});_Je.displayName=gJe;var rLn=({contentRef:e})=>{const t=`\`${kv}\` requires a description for the component to be accessible for screen reader users.
|
|
1645
1645
|
|
|
1646
1646
|
You can add a description to the \`${kv}\` by passing a \`${hJe}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
1647
1647
|
|
|
@@ -1821,7 +1821,7 @@ Store screenshots or other bundled assets here.
|
|
|
1821
1821
|
`).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 rnt="in-process";function snt(){return["--teammate-mode",rnt]}function v4n(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 T4n(e){return/^[A-Za-z0-9_./:=@+-]+$/.test(e)?e:`"${e.replace(/(["\\$`])/g,"\\$1")}"`}function cCe(e,t=rnt){const n=v4n(Rce(e)),r=[...snt(),...n];return r.length>0?r.map(T4n).join(" "):void 0}const E4n={anthropic:"Anthropic",codex:"Codex",gemini:"Gemini",opencode:"OpenCode"};function w4n(e){return E4n[e]??e}function k4n(e){const t=Rce(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 C4n={visible:!1,blocksSubmission:!1,checking:!1,title:"",message:"",details:[],tmuxDetail:null,memberWarningById:{}};function R4n({leadProviderId:e,members:t,soloTeam:n=!1,extraCliArgs:r}){const s=n?[]:t.filter(o=>o.removedAt==null&&o.name.trim().length>0);return k4n(r)!=="tmux"||s.length===0?C4n:{visible:!0,blocksSubmission:!1,checking:!1,title:"已切换为进程内成员运行",message:`当前团队会通过 ${w4n(e)} 负责人会话启动成员,不再依赖 tmux。`,details:["自定义 CLI 参数里的 --teammate-mode tmux 会被忽略,并改为 in-process。"],tmuxDetail:null,memberWarningById:{}}}const P4n=({analysis:e,onOpenDashboard:t})=>{if(!e.visible)return null;const n=e.checking?ni:Kn;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 $4n(e){return{fastModeAvailable:!1}}function N4n(e){return{showFastModeControl:!1,resolvedFastMode:!1,selectable:!1,disabledReason:null}}function A4n(e){return{nextEffort:e.selectedEffort,effortResetReason:null,nextFastMode:e.selectedFastMode,fastModeResetReason:null}}function I4n(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 H8=!0,M4n="TeamDelete,TodoWrite,TaskCreate,TaskUpdate";function Z8(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return"UTC"}}function FM(){const e=localStorage.getItem("team:lastSelectedProvider");return J$(Ta(e))}function Gx(e){const t=localStorage.getItem(`team:lastSelectedModel:${e}`);return t===null?e==="anthropic"?"opus":"":l1(e,t==="__default__"?"":t)}function Nw(){const e=localStorage.getItem("team:lastSelectedFastMode");return e==="on"||e==="off"||e==="inherit"?e:"inherit"}function Hx(e){return O_(e)??"Anthropic"}function Q4n(e,t,n,r){return{providerId:e.providerId??t,model:e.model?.trim()||n,effort:e.effort??r}}function D4n(e,t,n,r){return{providerId:Ta(e.providerId)??t,model:e.model?.trim()||n,effort:e.effort??r}}function L4n(e){const t=e.filter(n=>{const r=n.name.trim().toLowerCase();return!n.removedAt&&!c_(r)});return t.length>0&&t.every(n=>n.isolation==="worktree")}const Gee=e=>{const{open:t,onClose:n}=e,{isLight:r}=Us(),s=oe(ve=>ve.appConfig?.general?.multimodelEnabled??!1),i=oe(ve=>ve.appConfig?.providerConnections?.anthropic.fastModeDefault??!1),o=oe(ve=>ve.cliStatus),a=oe(ve=>ve.cliStatusLoading),c=oe(ve=>ve.bootstrapCliStatus),l=oe(ve=>ve.fetchCliStatus),d=e.mode==="launch"||e.mode==="relaunch",p=e.mode==="relaunch",h=g.useMemo(()=>!o&&a&&s?Xy():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}=oe(Et(ve=>({teamByName:ve.teamByName,openDashboard:ve.openDashboard}))),T=oe(ve=>ve.openTeamTab),E=g.useMemo(()=>Object.values(S).sort((ve,Ot)=>ve.teamName.localeCompare(Ot.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"),[I,N]=g.useState(""),[R,$]=g.useState(""),A=by({key:`launchTeam:${w||"standalone"}:${e.mode}:prompt`}),j=jN(`launchTeam:${w||"standalone"}:${e.mode}:chips`),[Q,U]=g.useState([]),[M,q]=g.useState(!1),[z,L]=g.useState(null),[V,Y]=g.useState(null),[ne,te]=g.useState(!1),[H,Z]=g.useState(()=>yh(FM())),[se,he]=g.useState(()=>Gx(yh(FM()))),[ce,me]=g.useState([]),[ae,G]=g.useState(!1),[be,_e]=g.useState(!1),[re,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(Nw),[ie,le]=g.useState(null),[K,pe]=g.useState(()=>localStorage.getItem("team:lastLimitContext")==="true"),[we,Ee]=g.useState(!1),[Ae,We]=g.useState(!1),[et,yt]=g.useState("idle"),[xt,Ge]=g.useState(null),[Ct,Xt]=g.useState([]),[ct,mn]=g.useState([]),Lt=g.useRef(0),Sn=oe(ve=>Pl(ve,ve.selectedTeamName)),jt=oe(ve=>w?ve.launchParamsByTeam[w]:void 0),dn=d?e.members:Sn,[ze,rt]=g.useState(null),[Nt,Ht]=g.useState(null),[qe,lt]=g.useState(()=>localStorage.getItem(`team:lastWorktreeEnabled:${w}`)==="true"&&!!localStorage.getItem(`team:lastWorktreeName:${w}`)),[Pe,ye]=g.useState(()=>localStorage.getItem(`team:lastWorktreeName:${w}`)??""),[Be,Ze]=g.useState(()=>localStorage.getItem(`team:lastCustomArgs:${w}`)??""),[Ye,Ce]=g.useState(null),[st,wt]=g.useState(null),Rt=p?e.projectPath??e.defaultProjectPath??"":"",[Yn,On]=g.useState(""),[Vn,cr]=g.useState(!0),[Fe,$e]=g.useState("0 9 * * 1-5"),[xe,ke]=g.useState(Z8),[de,Le]=g.useState(15),[Ue,mt]=g.useState(50),[vt,ft]=g.useState(""),[zt,En]=g.useState(null),Cn=g.useMemo(()=>[],[ce,H,be]),Ke=g.useMemo(()=>[H],[Cn,H]),It=g.useMemo(()=>{const ve=(h?.providers??[]).map(Ot=>[Ot.providerId,u4n(Ot)]);return new Map(ve)},[h?.providers]),Br=g.useRef(It),Fr=g.useRef([]),Ie=g.useRef(null);g.useEffect(()=>{Br.current=It},[It]),g.useEffect(()=>{Fr.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&&me(ve=>{const Ot=qBn({members:ve,selectedProviderId:H,runtimeProviderStatusById:Ne});return Ot.changed?Ot.members:ve})},[ce,t,Ne,H]),g.useEffect(()=>{!t||o||a||e_({multimodelEnabled:s,bootstrapCliStatus:c,fetchCliStatus:l})},[c,o,a,l,s,t]);const vn=oe(ve=>ve.createSchedule),jn=oe(ve=>ve.updateSchedule),Rs=ve=>{lt(ve),localStorage.setItem(`team:lastWorktreeEnabled:${w}`,String(ve)),ve||(ye(""),localStorage.setItem(`team:lastWorktreeName:${w}`,""))},zs=ve=>{ye(ve),localStorage.setItem(`team:lastWorktreeName:${w}`,ve)},Fa=ve=>{Ze(ve),localStorage.setItem(`team:lastCustomArgs:${w}`,ve)},sn=ve=>{const Ot=yh(ve);Z(Ot),localStorage.setItem("team:lastSelectedProvider",Ot),Ot!=="anthropic"&&(pe(!1),localStorage.setItem("team:lastLimitContext","false")),he(Gx(Ot))},Nn=ve=>{const Ot=l1(H,ve);he(Ot),localStorage.setItem(`team:lastSelectedModel:${H}`,Ot)},Rn=ve=>{ge(ve),localStorage.setItem("team:lastSkipPermissions",String(ve))},ar=ve=>{F(ve),localStorage.setItem("team:lastSelectedEffort",ve)},ds=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 Ot of["lastSelectedModel","lastSelectedEffort"]){const Yt=`schedule:${Ot}`,zn=Ot==="lastSelectedModel"?"team:lastSelectedModel:anthropic":`team:${Ot}`,qn=localStorage.getItem(Yt);qn!=null&&localStorage.getItem(zn)==null&&localStorage.setItem(zn,qn),localStorage.removeItem(Yt)}},[]);const jr=()=>{Y(null),te(!1),yt("idle"),Ge(null),Xt([]),mn([]),C("project"),N(""),$(""),Ee(!1),We(!1),me([]),_e(!1),j.clearChipDraft(),Ce(null),wt(null),x(""),On(""),$e("0 9 * * 1-5"),ke(Z8()),Le(15),mt(50),ft("")},Or=()=>{d&&jr(),n()};g.useEffect(()=>{if(!(!t||!m)){if(O){On(O.label??""),$e(O.cronExpression),ke(O.timezone),Le(O.warmUpMinutes),mt(O.maxTurns),ft(O.maxBudgetUsd!=null?String(O.maxBudgetUsd):""),A.setValue(O.launchConfig.prompt),$(O.launchConfig.cwd),C("custom");const ve=yh(O.launchConfig.providerId);Z(ve),he(ve===yh(O.launchConfig.providerId)?O.launchConfig.model??"":Gx("anthropic")),ge(O.launchConfig.skipPermissions!==!1),F(O.launchConfig.effort??""),ue(O.launchConfig.fastMode??Nw()),Ht(O.launchConfig.providerBackendId??null),En(`${O.id}:${O.updatedAt??""}`)}else{On(""),$e("0 9 * * 1-5"),ke(Z8()),Le(15),mt(50),ft(""),A.setValue(""),C("project"),N(""),$("");const ve=yh(FM());Z(ve),he(Gx(ve)),F(""),ue(Nw()),Ht(null),En(null)}Y(null),te(!1)}},[t,m,O?.id]),g.useEffect(()=>{if(!t||!d)return;if(p){let Ot=!1;return(async()=>{let Yt=null;try{Yt=w?await ee.teams.getSavedRequest(w):null}catch{Yt=null}if(Ot)return;Ce(Yt),wt(Yt?.members&&Yt.members.length>0?Yt.members:Zke(dn));const zn=yh(Ta(Yt?.providerId)??"anthropic");Z(zn),he(zn===Ta(Yt?.providerId)?Yt?.model??"":Gx(zn)),F(Yt?.effort??""),ue(Yt?.fastMode??Nw()),ge(Yt?.skipPermissions??!0),Ee(!0)})(),()=>{Ot=!0}}let ve=!1;return(async()=>{let Ot=null;try{Ot=w?await ee.teams.getSavedRequest(w):null}catch{Ot=null}if(ve)return;const Yt=dn.length>0?dn:Ot?.members&&Ot.members.length>0?Ot.members:[],zn=Zke(Yt),qn=localStorage.getItem("team:lastSelectedEffort"),nr=Ta(Ot?.providerId)??null,To=typeof Ot?.providerBackendId=="string"&&Ot.providerBackendId.trim().length>0?Ot.providerBackendId.trim():null,qa=yh(FM()),Wa=YBn({members:dn,savedRequest:Ot,previousLaunchParams:jt,multimodelEnabled:s,storedProviderId:qa,storedEffort:qn===null?"medium":qn,storedFastMode:Nw(),storedLimitContext:localStorage.getItem("team:lastLimitContext")==="true",getStoredModel:Gx});rt(nr),Ht(Wa.providerBackendId??To??null),me(bBn(zn).map(Ga=>xBn(Ga))),G(L4n(zn)),_e(!zn.some(Ga=>Ga.providerId||Ga.model||Ga.effort));const Ps=yh(Wa.providerId);Z(Ps),he(Ps===Wa.providerId?Wa.model:""),F(Wa.effort),ue(Wa.fastMode),pe(Wa.limitContext),ge(Ot?.skipPermissions??localStorage.getItem("team:lastSkipPermissions")!=="false")})(),()=>{ve=!0}},[t,d,w,dn,s,jt]);const gr=g.useMemo(()=>d?Ta(jt?.providerId)??ze:null,[d,jt?.providerId,ze]),ki=g.useMemo(()=>!d||!gr?!1:gr!==H,[d,gr,H]),Ya=m?!1:K,Ci=g.useMemo(()=>Pw(se,K,H,Ne.get(H))??"",[K,Ne,se,H]),aO=g.useMemo(()=>zM(H,Ne.get(H))??Cce(H,jt?.providerBackendId??Nt)??void 0,[jt?.providerBackendId,Ne,Nt,H]),ou=g.useMemo(()=>R4n({leadProviderId:H,members:[],extraCliArgs:d?cCe(Be):void 0}),[Be,Cn,d,aO,H]),gc=g.useMemo(()=>H==="anthropic"?$4n({source:{modelCatalog:Ne.get("anthropic")?.modelCatalog,runtimeCapabilities:Ne.get("anthropic")?.runtimeCapabilities}}):null,[Ya,Ne,se,H]),vo=g.useMemo(()=>H==="anthropic"&&gc?N4n():null,[i,gc,W,H]);g.useEffect(()=>{if(m&&O){const Yt=`${O.id}:${O.updatedAt??""}`;if(zt!==Yt)return}if(H!=="anthropic"){le(null);return}const ve=A4n({selectedEffort:J,selectedFastMode:W}),Ot=[];ve.nextEffort!==J&&(F(ve.nextEffort),localStorage.setItem("team:lastSelectedEffort",ve.nextEffort)),ve.nextFastMode!==W&&(ue(ve.nextFastMode),localStorage.setItem("team:lastSelectedFastMode",ve.nextFastMode)),le(Ot.length>0?Ot.join(" "):null)},[i,gc,Ya,J,W,se,H,O,zt,m]);const nh=g.useMemo(()=>{const ve=new Map,Ot=new Map,Yt=(qn,nr)=>{const To=nr?.trim()??"";if(!To)return;const qa=ve.get(qn)??[];qa.includes(To)||ve.set(qn,[...qa,To])},zn=qn=>{qn==="anthropic"&&H==="anthropic"&&Ot.set(qn,!0)};se.trim()?Yt(H,Ci):zn(H);for(const qn of Cn){if(qn.removedAt)continue;const nr=Htt({memberProviderId:qn.providerId,memberModel:qn.model,selectedProviderId:H,runtimeProviderStatusById:Ne});nr.model?Yt(nr.providerId,nr.model):zn(nr.providerId)}for(const qn of Ot.keys())Yt(qn,jtt);return ve},[Ci,Cn,Ne,se,H]),yp=g.useMemo(()=>{if(!d)return[];const ve=[],Ot=jt?.model?.trim()||"",Yt=jt?.effort,zn=se.trim()||Ci;gr&&(gr!==H||Ot!==zn||(Yt??"")!==(J||""))&&ve.push({key:"lead",memberName:W$,message:`${db(H,zn,J||void 0)},而不是 ${db(gr,Ot,Yt)}`});const qn=new Map(dn.map(nr=>[nr.name.trim().toLowerCase(),nr]));for(const nr of Cn){if(nr.removedAt)continue;const To=nr.name.trim();if(!To)continue;const qa=qn.get(To.toLowerCase());if(!qa)continue;const{providerId:Wa,model:Ps,effort:Ga}=Q4n(nr,H,zn,J||void 0),{providerId:q_,model:W_,effort:Te}=D4n(qa,gr??"anthropic",Ot,Yt);if(q_===Wa&&W_===Ps&&(Te??"")===(Ga??"")&&(qa.isolation??"")===(nr.isolation??""))continue;const St=q_!==Wa||W_!==Ps||(Te??"")!==(Ga??"")?`${db(Wa,Ps,Ga)},而不是 ${db(q_,W_,Te)}`:null,Zn=qa.isolation!==nr.isolation?`${nr.isolation==="worktree"?"独立 worktree":"共享工作区"},而不是 ${qa.isolation==="worktree"?"独立 worktree":"共享工作区"}`:null;ve.push({key:`member:${To.toLowerCase()}`,memberName:To,message:[St,Zn].filter(ys=>!!ys).join("; ")})}return ve},[d,jt?.effort,jt?.model,gr,H,se,Ci,J,dn,Cn]),au=g.useMemo(()=>new Map(yp.map(ve=>[ve.key,ve.message])),[yp]);g.useMemo(()=>{const ve=[];ki&&gr&&ve.push(`提供商已从 ${Hx(gr)} 更改为 ${Hx(H)}。之前的负责人会话不会恢复,负责人会以全新上下文启动。`);const Ot=au.get("lead");return Ot&&ve.push(`下次启动将使用 ${Ot}。`),ve.length>0?ve.join(" "):null},[ki,gr,H,au]);const pd=g.useMemo(()=>{const ve={};for(const Ot of Cn){const Yt=Ot.name.trim();if(!Yt||Ot.removedAt)continue;const zn=au.get(`member:${Yt.toLowerCase()}`);zn&&(ve[Ot.id]=`下次启动将使用 ${zn}。`)}return ve},[Cn,au]);g.useMemo(()=>{const ve={...pd};for(const[Ot,Yt]of Object.entries(ou.memberWarningById))ve[Ot]=ve[Ot]?`${ve[Ot]} ${Yt}`:Yt;return ve},[pd,ou.memberWarningById]);const rh=Gl(I)?"":I.trim(),ur=k==="project"?rh:R.trim(),xp=g.useMemo(()=>i4n(Ke,Ne),[Ne,Ke]),F_=g.useMemo(()=>s4n(nh),[nh]),sh=g.useMemo(()=>o4n({cwd:ur,selectedProviderId:H,selectedModel:se,selectedMemberProviders:Ke,limitContext:K,runtimeStatusSignature:xp,modelChecksSignature:F_}),[ur,K,xp,Ke,se,F_,H]);g.useEffect(()=>{!t||!d||e.clearProvisioningError?.(w)},[t,d,w]),g.useEffect(()=>{if(!t||!d){Lt.current+=1,Ie.current=null;return}if(typeof ee.teams.prepareProvisioning!="function"){Lt.current+=1,Ie.current=null,yt("failed"),Xt([]),mn([]),Ge("当前 preload 版本不支持 team:prepareProvisioning,请重启开发应用。");return}if(!ur){Lt.current+=1,Ie.current=null,yt("idle"),Xt([]),mn([]),Ge("请选择工作目录以验证启动环境。");return}if(Ie.current===sh)return;Ie.current=sh;const ve=++Lt.current,Ot=I4n(Fr.current,Ke);yt("loading"),Ge("正在并行检查选中的提供商..."),Xt([]),mn(Ot),(async()=>{let Yt=Ot;const zn=Ke.map(qn=>{const nr=nh.get(qn)??[],To=Br.current.get(qn)??null;return{providerId:qn,selectedModelChecks:nr,backendSummary:To}});try{for(const Ps of zn)Yt=W8(Yt,Ps.providerId,{status:"checking",backendSummary:Ps.backendSummary,details:[]});Lt.current===ve&&mn(Yt);const qn=await Promise.all(zn.map(async Ps=>{const Ga=await r4n({cwd:ur,providerId:Ps.providerId,selectedModelIds:Ps.selectedModelChecks,prepareProvisioning:ee.teams.prepareProvisioning,limitContext:K,onModelProgress:({status:q_,details:W_})=>{Yt=W8(Yt,Ps.providerId,{status:q_,backendSummary:Ps.backendSummary,details:W_}),Lt.current===ve&&mn(Yt)}});return{...Ps,prepResult:Ga}}));let nr=!1,To=!1;const qa=[];for(const Ps of qn)Ps.prepResult.warnings.length>0&&(To=!0,qa.push(...Ps.prepResult.warnings.map(Ga=>`${Hx(Ps.providerId)}: ${Ga}`))),Ps.prepResult.status==="failed"?nr=!0:Ps.prepResult.status==="notes"&&(To=!0),Yt=W8(Yt,Ps.providerId,{status:Ps.prepResult.status,backendSummary:Ps.backendSummary,details:Ps.prepResult.details});if(Lt.current===ve&&mn(Yt),Lt.current!==ve)return;const Wa=nnt(Yt)??"部分所选提供商需要处理。";yt(nr?"failed":"ready"),Ge(nr?Wa:To?"所选提供商已就绪(含提示)。":"所选提供商已就绪。"),Xt(qa)}catch(qn){if(Lt.current!==ve)return;const nr=qn instanceof Error?qn.message:"预热 Agent CLI 环境失败";yt("failed"),Xt([]),mn(d4n(Yt,nr)),Ge(nr)}})()},[t,d,ur,sh,H,Ke,nh]);const ha=oe(Et(ve=>ve.repositoryGroups));g.useEffect(()=>{if(!t)return;q(!0),L(null);let ve=!1;return(async()=>{try{const Ot=(await ee.getProjects()).filter(qn=>!Gl(qn.path));if(ve)return;const Yt=new Set(Ot.map(qn=>qn.path)),zn=[];for(const qn of ha)for(const nr of qn.worktrees)!Gl(nr.path)&&!Yt.has(nr.path)&&(Yt.add(nr.path),zn.push({id:nr.id,path:nr.path,name:nr.name,sessions:[],totalSessions:0,createdAt:nr.createdAt??Date.now()}));U([...Ot,...zn])}catch(Ot){if(ve)return;L(Ot instanceof Error?Ot.message:"项目加载失败"),U([])}finally{ve||q(!1)}})(),()=>{ve=!0}},[t,ha]);const lu=d?e.defaultProjectPath:void 0;g.useEffect(()=>{if(!t||k!=="project"||I)return;const ve=Q.filter(Ot=>!Gl(Ot.path));if(ve.length!==0){if(lu&&!Gl(lu)){const Ot=pr(lu),Yt=ve.find(zn=>pr(zn.path)===Ot);if(Yt){N(Yt.path);return}}N(ve[0].path)}},[t,k,Q,I,lu]),g.useEffect(()=>{!t||k!=="project"||!I||Gl(I)&&N("")},[t,k,I,N]),OBn(ur||null);const cx=d?e.activeTeams:void 0,cu=g.useMemo(()=>{if(!d||!cx?.length||!ur)return null;const ve=pr(ur);return cx.find(Ot=>Ot.teamName!==w&&pr(Ot.projectPath)===ve)??null},[d,cx,ur,w]);g.useEffect(()=>{We(!1)},[cu?.teamName,ur]),ix(null),XN(null);const p1=g.useMemo(()=>SBn(ce,dn),[ce,dn]),f1=g.useMemo(()=>vBn(ce,p1),[p1,ce]),aA=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",M4n),re&&ve.push("--dangerously-skip-permissions");const Ot=Pw(se,K,H,Ne.get(H));Ot&&ve.push("--model",Ot);const Yt=UM({providerId:H,selectedEffort:J});if(Yt&&ve.push("--effort",Yt),H==="anthropic"){const zn=vo?.resolvedFastMode?{fastMode:!0,fastModePerSessionOptIn:!1}:{fastMode:!1};ve.push("--settings",JSON.stringify(zn))}return ve.push(...snt()),we||ve.push("--resume","<previous>"),ve},[vo?.resolvedFastMode,gc,d,re,se,K,J,H,we,Ne]),ux=g.useMemo(()=>{if(!d)return[];const ve=[];A.value.trim()&&ve.push("负责人提示词");const Ot=Cn.filter(Yt=>!Yt.removedAt&&Yt.isolation==="worktree").length;return Ot>0&&ve.push(`${Ot} 个成员使用独立 worktree`),ve.push(`Provider: ${Hx(H)}`),se&&ve.push(`Model: ${se}`),J&&ve.push(`Effort: ${J}`),H==="anthropic"&&(W==="on"?ve.push("快速模式"):W==="off"?ve.push("快速模式关闭"):H==="anthropic"&&i&&ve.push("快速默认")),H==="anthropic"&&K&&ve.push("上下文限制为 200K"),re&&ve.push("自动批准工具"),ve.push("成员由运行时动态生成"),we&&ve.push("全新会话"),qe&&Pe.trim()&&ve.push(`Worktree:${Pe.trim()}`),Be.trim()&&ve.push("自定义 CLI 参数"),ve},[d,Cn,A.value,se,H,J,W,i,K,re,we,qe,Pe,Be]),Y_=g.useMemo(()=>{const ve=[];return ur||ve.push("必须填写工作目录"),m&&(w||ve.push("必须选择团队"),A.value.trim()||ve.push("必须填写提示词"),Fe.trim()||ve.push("必须填写 Cron 表达式")),ve},[ur,m,w,A.value,Fe]),Sp=g.useMemo(()=>{const ve=Wke(H,se,Ne.get(H));if(ve)return ve;if(!d)return null;for(const Ot of Cn){if(Ot.removedAt)continue;const Yt=Ta(Ot.providerId)??H,zn=Wke(Yt,Ot.model,Ne.get(Yt));if(!zn)continue;const qn=Ot.name.trim();return qn?`${qn}: ${zn}`:zn}return null},[Cn,d,Ne,se,H]),V_=g.useMemo(()=>{const ve=lCe(ct,H,Ci||se);return ve?.reason??ve?.detail??null},[Ci,ct,se,H]);g.useMemo(()=>{const ve={};if(!d)return ve;for(const Ot of Cn){if(Ot.removedAt)continue;if(be&&V_){ve[Ot.id]=V_;continue}const Yt=Ta(Ot.providerId)??H,zn=lCe(ct,Yt,Ot.model),qn=zn?.reason??zn?.detail??null;qn&&(ve[Ot.id]=qn)}return ve},[Cn,d,V_,ct,H,be]);const lA=g.useMemo(()=>d&&!H8,[d,ce]),VB=g.useMemo(()=>!1,[d,ce]),qB=d?e.provisioningError:null,h1=V??Sp??qB,Va=g.useMemo(()=>_4n({state:et,message:xt,warnings:Ct,checks:ct}),[ct,xt,et,Ct]),ih=oe(ve=>d&&w?Yy(ve,w):!1);g.useEffect(()=>{!t||!d||!w||!ih||(T(w,ur||lu),Or())},[Or,lu,ur,w,d,ih,t,T]);const lO=()=>{if(p){if(!Ye&&!st){Y("正在加载上次启动配置,请稍候...");return}if(Sp){Y(Sp);return}Y(null),te(!0),(async()=>{try{const ve=Ye,Ot=UM({providerId:H,selectedEffort:J}),Yt={teamName:w,cwd:ve?.cwd??Rt??ur,executionTarget:ve?.executionTarget??{type:"local",cwd:ve?.cwd??Rt??(ur||void 0)},prompt:ve?.prompt,providerId:H,providerBackendId:zM(H,Ne.get(H))??ve?.providerBackendId??void 0,model:Pw(se,!1,H,Ne.get(H)),effort:Ot,fastMode:W,limitContext:!1,clearContext:we||void 0,skipPermissions:re,worktree:ve?.worktree,extraCliArgs:ve?.extraCliArgs},zn=H8?[]:st??[];await e.onRelaunch(Yt,zn),T(w,Rt||lu),Or()}catch(ve){const Ot=ve instanceof Error?ve.message:"重新启动团队失败";Y(Ot),console.error("Failed to relaunch team from dialog:",ve)}finally{te(!1)}})();return}if(Y_.length>0){Y(Y_[0]);return}if(Sp){Y(Sp);return}if(d&&ou.blocksSubmission){Y(ou.message);return}if(d&&!ur){Y("请选择工作目录(cwd)");return}Y(null),te(!0),(async()=>{try{if(d){const ve=H8?[]:EBn(Cn),Ot=UM({providerId:H,selectedEffort:J}),Yt={teamName:w,cwd:ur,executionTarget:{type:"local",cwd:ur||void 0},prompt:A.value.trim()||void 0,providerId:H,providerBackendId:zM(H,Ne.get(H))??aO??void 0,model:Pw(se,K,H,Ne.get(H)),effort:Ot,fastMode:W,limitContext:K,clearContext:we||void 0,skipPermissions:re,worktree:qe&&Pe.trim()?Pe.trim():void 0,extraCliArgs:cCe(Be)};await ee.teams.replaceMembers(w,{members:ve}),await e.onLaunch(Yt),T(w,ur||lu),Or()}else{const ve=vt?parseFloat(vt):void 0,Ot=zM(H,Ne.get(H))??aO??void 0,Yt=Pw(se,!1,H,Ne.get(H)),zn=UM({providerId:H,selectedEffort:J}),qn={cwd:ur,prompt:A.value.trim(),providerId:H,providerBackendId:Ot,model:Yt,effort:zn,fastMode:W,resolvedFastMode:vo?.resolvedFastMode??!1,skipPermissions:re};if(_&&O){const nr={label:Yn.trim()||void 0,cronExpression:Fe.trim(),timezone:xe,warmUpMinutes:de,maxTurns:Ue,maxBudgetUsd:ve,launchConfig:qn};await jn(O.id,nr)}else{const nr={teamName:w,label:Yn.trim()||void 0,cronExpression:Fe.trim(),timezone:xe,warmUpMinutes:de,maxTurns:Ue,maxBudgetUsd:ve,launchConfig:qn};await vn(nr)}Or()}}catch(ve){const Ot=ve instanceof Error?ve.message:m?"保存计划失败":p?"重新启动团队失败":"启动团队失败";Y(Ot),d&&console.error(p?"Failed to relaunch team from dialog:":"Failed to launch team from dialog:",ve)}finally{te(!1)}})()},WB=p?ne||ih:d?ne||ih||Y_.length>0||!!Sp||lA||VB||ou.blocksSubmission:ne||Y_.length>0||!!Sp,GB=d?p?"重新启动团队":"启动团队":_?"编辑计划":"创建计划",HB=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}”创建自动运行计划`:"创建团队任务自动执行计划",cA=d?p?"重新启动团队":"启动团队":_?"保存更改":"创建计划",uA=d?p?"重新启动中...":"启动中...":_?"保存中...":"创建中...";return u.jsx(_s,{open:t,onOpenChange:ve=>{ve||Or()},children:u.jsxs(cs,{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(bs,{children:[u.jsx(us,{className:"text-sm",children:GB}),u.jsx(wi,{className:"text-xs",children:HB})]}),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(Kn,{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(B8,{providerId:H,onProviderChange:sn,value:se,onValueChange:Nn,id:"relaunch-model",disableGeminiOption:!0}),u.jsx(Vke,{value:J,onValueChange:ar,id:"relaunch-effort",providerId:H,model:se,limitContext:!1}),H==="anthropic"?u.jsxs("div",{className:"mt-2",children:[u.jsx(V8,{value:W,onValueChange:ds,providerFastModeDefault:i,model:se,limitContext:!1,id:"relaunch-fast-mode"}),ie?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:ie}):null]}):null]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(oi,{id:"relaunch-clear-context",checked:we,onCheckedChange:ve=>Ee(ve===!0)}),u.jsxs(Kt,{htmlFor:"relaunch-clear-context",className:"flex cursor-pointer items-center gap-1.5 text-xs font-normal text-text-secondary",children:[u.jsx(wm,{className:"size-3 shrink-0"}),"清空上下文(新会话)"]})]}),!we&&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 频率限制。"}),we&&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(Kn,{className:"mt-0.5 size-3.5 shrink-0"}),u.jsx("p",{children:"团队负责人会启动一个新会话,不再恢复之前的上下文。已积累的会话记忆和对话历史将不可用。"})]})})]}):null,d&&cu&&!Ae?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(Kn,{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:["该工作目录下已有团队“",cu.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:ur})]})]}),u.jsx("button",{type:"button",className:"shrink-0 rounded p-0.5 opacity-60 transition-colors hover:opacity-100",onClick:()=>We(!0),children:u.jsx(Ar,{className:"size-3.5"})})]})}):null,d?u.jsx(P4n,{analysis:ou,onOpenDashboard:()=>{Or(),v()}}):null,p?null:u.jsxs("div",{className:"space-y-4",children:[P?u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Kt,{className:"text-xs",children:"团队"}),u.jsx(LB,{options:E,value:y,onValueChange:x,placeholder:"选择团队...",searchPlaceholder:"搜索团队...",emptyMessage:E.length===0?"暂无可用团队,请先创建团队。":"没有匹配的团队。",disabled:E.length===0,renderOption:(ve,Ot)=>{const Yt=ve.meta?.color,zn=Yt?Ir(Yt):ll(ve.label);return u.jsxs(u.Fragment,{children:[Ot?u.jsx(Kr,{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:zn.text}}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[Ot?u.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:zn.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:()=>cr(ve=>!ve),children:[Vn?u.jsx(Ur,{className:"size-3.5 shrink-0 text-[var(--color-text-muted)]"}):u.jsx(Ln,{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:"定时计划"}),!Vn&&(Yn||Fe)?u.jsx("span",{className:"ml-auto truncate text-[11px] text-[var(--color-text-muted)] opacity-70",children:Yn||Fe}):null]}),Vn?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(Kt,{htmlFor:"schedule-label",className:"label-optional",children:"标签(可选)"}),u.jsx(In,{id:"schedule-label",className:"h-8 text-xs",value:Yn,onChange:ve=>On(ve.target.value),placeholder:"例如:每日代码评审、夜间自动测试..."})]}),u.jsx(LBn,{cronExpression:Fe,onCronExpressionChange:$e,timezone:xe,onTimezoneChange:ke,warmUpMinutes:de,onWarmUpMinutesChange:Le})]}):null]}):null,u.jsx(Ztt,{cwdMode:k,onCwdModeChange:C,selectedProjectPath:I,onSelectedProjectPathChange:N,customCwd:R,onCustomCwdChange:$,projects:Q,projectsLoading:M,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(B8,{providerId:H,onProviderChange:sn,value:se,onValueChange:Nn,id:"launch-team-provider-model",disableGeminiOption:!0,modelIssueReasonByValue:se.trim()?{[se.trim()]:V_}:void 0})]}),d?u.jsx(WBn,{title:p?"重新启动设置":"可选启动设置",description:p?"重新启动团队前,请确认成员名单和团队负责人运行时。":"默认只需关注项目路径;需要更多控制时再展开这里。",summary:ux,children:u.jsxs("div",{className:"space-y-4",children:[H==="anthropic"?u.jsxs("div",{className:"space-y-2",children:[u.jsx(V8,{value:W,onValueChange:ds,providerFastModeDefault:i,model:se,limitContext:Ya,id:"launch-fast-mode"}),ie?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(ni,{className:"mt-0.5 size-3.5 shrink-0 text-amber-300"}),u.jsx("p",{children:ie})]}):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(ni,{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(Kt,{htmlFor:"dialog-prompt",className:"label-optional",children:"给团队负责人的提示(可选)"}),u.jsx(Um,{id:"dialog-prompt",className:"min-h-[100px] text-xs",minRows:4,maxRows:12,value:A.value,onValueChange:A.setValue,suggestions:f1,projectPath:ur||null,chips:j.chips,onChipRemove:j.removeChip,onFileChipInsert:j.addChip,placeholder:"填写给团队负责人的说明...",footerRight:A.isSaved?u.jsx("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:"已保存"}):null})]}),u.jsx("div",{children:u.jsx(Bke,{id:"dialog-skip-permissions",checked:re,onCheckedChange:Rn})}),u.jsxs("div",{className:"space-y-2",children:[ki?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(Kn,{className:"mt-0.5 size-3.5 shrink-0"}),u.jsxs("p",{children:["提供商已从 ",Hx(gr)," 更改为"," ",Hx(H),"。之前的负责人会话不会恢复,负责人会以全新上下文启动,以正确应用新的运行时。"]})]})}):null,u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(oi,{id:"clear-context",checked:we,onCheckedChange:ve=>Ee(ve===!0)}),u.jsxs(Kt,{htmlFor:"clear-context",className:"flex cursor-pointer items-center gap-1.5 text-xs font-normal text-text-secondary",children:[u.jsx(wm,{className:"size-3 shrink-0"}),"清空上下文(新会话)"]})]}),we&&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(Kn,{className:"mt-0.5 size-3.5 shrink-0"}),u.jsx("p",{children:"团队负责人会启动一个新会话,不再恢复之前的上下文。已积累的会话记忆和对话历史将不可用。"})]})})]}),u.jsx(UBn,{teamName:w,internalArgs:aA,worktreeEnabled:qe,onWorktreeEnabledChange:Rs,worktreeName:Pe,onWorktreeNameChange:zs,customArgs:Be,onCustomArgsChange:Fa})]})}):u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Kt,{htmlFor:"dialog-prompt",children:"提示词"}),u.jsx(Um,{id:"dialog-prompt",className:"min-h-[100px] text-xs",minRows:4,maxRows:12,value:A.value,onValueChange:A.setValue,suggestions:f1,projectPath:ur||null,chips:j.chips,onChipRemove:j.removeChip,onFileChipInsert:j.addChip,placeholder:"填写定时执行时给 Claude 的说明...",footerRight:A.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(B8,{providerId:H,onProviderChange:sn,value:se,onValueChange:Nn,id:"dialog-model",disableGeminiOption:!0}),u.jsx(Vke,{value:J,onValueChange:ar,id:"dialog-effort",providerId:H,model:se,limitContext:!1}),H==="anthropic"?u.jsxs("div",{className:"mt-2",children:[u.jsx(V8,{value:W,onValueChange:ds,providerFastModeDefault:i,model:se,limitContext:!1,id:"dialog-fast-mode"}),ie?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:ie}):null]}):null,u.jsx(Bke,{id:"dialog-skip-permissions",checked:re,onCheckedChange:Rn})]})]}),m?u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx(Kt,{htmlFor:"schedule-max-turns",className:"text-[11px] text-[var(--color-text-muted)]",children:"Max turns"}),u.jsx(In,{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(Kt,{htmlFor:"schedule-max-budget",className:"text-[11px] text-[var(--color-text-muted)]",children:"Max budget (USD)"}),u.jsx(In,{id:"schedule-max-budget",type:"number",min:0,step:.5,className:"h-8 text-xs",value:vt,onChange:ve=>ft(ve.target.value),placeholder:"不限"})]})]}):null]}),h1?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(Kn,{className:"mt-0.5 size-3.5 shrink-0"}),u.jsx("span",{children:h1})]}):null,u.jsxs(tu,{className:d&&!p?"pt-4 sm:justify-between":"pt-4",children:[d&&!p?u.jsxs("div",{className:"min-w-0",children:[Va.state==="idle"||Va.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:Va.message??(Va.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(G8,{checks:ct,className:"mt-2"})]}):null,Va.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(yl,{className:"size-3.5 shrink-0"}),u.jsx("span",{children:ct.some(ve=>ve.status==="notes")||Ct.length>0?"CLI 环境已就绪(有提示)":"CLI 环境已就绪"})]}),Va.message?u.jsx("p",{className:"mt-0.5 pl-5 text-[11px] text-[var(--color-text-muted)]",children:Va.message}):null,u.jsx(G8,{checks:ct,className:"mt-1"}),Ct.length>0&&ct.length===0?u.jsx("div",{className:"mt-0.5 space-y-0.5 pl-5",children:Ct.map(ve=>u.jsx("p",{className:"text-[11px] text-sky-300",children:ve},ve))}):null]}):null,Va.state==="failed"?u.jsxs("div",{className:"text-xs",children:[u.jsxs("div",{className:"flex items-start gap-2 text-red-300",children:[u.jsx(Kn,{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:Va.message??"准备环境失败"}),u.jsxs("p",{className:"mt-0.5 text-[10px] text-[var(--color-text-muted)] opacity-70",children:["启动前检查会提前发现",p?"重新启动":"启动","问题"]})]})]}),b4n(ct,Va.message)?null:u.jsx(G8,{checks:ct,className:"mt-2",suppressDetailsMatching:Va.message}),Ct.length>0&&ct.length===0?u.jsx("div",{className:"mt-1 space-y-0.5 pl-6",children:Ct.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:S4n(Va.message,ct)}),(Va.message??"").toLowerCase().includes("spawn ")||ct.some(ve=>ve.details.some(Ot=>Ot.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:()=>{Or(),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:Or,children:d?"关闭":"取消"}),u.jsx(Xe,{size:"sm",className:"bg-emerald-600 text-white hover:bg-emerald-700",disabled:WB,onClick:lO,children:ne||ih?u.jsxs(u.Fragment,{children:[u.jsx(qt,{className:"mr-1.5 size-3.5 animate-spin"}),uA]}):cA})]})]})]})})},j4n=({open:e,teamName:t,taskId:n,members:r,onCancel:s,onSubmit:i})=>{const o=oe(m=>m.selectedTeamData?.config.projectPath??null),{suggestions:a}=ix(t),c=by({key:`requestChanges:${t}:${n??""}`,enabled:!!(t&&n)}),l=g.useMemo(()=>to(r),[r]),d=g.useMemo(()=>r.map(m=>({id:m.name,name:m.name,subtitle:ri(m.role)??ri(m.agentType)??void 0,color:l.get(m.name)})),[r,l]),p=Dm(c.value).trim(),f=ic-p.length,h=()=>{const m=Dm(p)||void 0,O=p?ty(c.value,a):[];c.clearDraft(),i(m,O)};return u.jsx(_s,{open:e&&n!==null,onOpenChange:m=>{m||s()},children:u.jsxs(cs,{className:"w-[600px]",children:[u.jsxs(bs,{children:[u.jsx(us,{children:"请求修改"}),u.jsxs(wi,{children:["Task #",n?so(n):""]})]}),u.jsx("div",{className:"grid gap-2 py-2",children:u.jsx(Um,{id:"review-comment",value:c.value,onValueChange:c.setValue,placeholder:"描述需要修改的内容...(Enter 提交)",suggestions:d,taskSuggestions:a,projectPath:o,onModEnter:h,minRows:4,maxRows:12,maxLength:ic,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(E$,{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]})})})]})})},X4n=({attachment:e,onRemove:t,onPreview:n,disabled:r})=>{const s=ab(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(FD,{size:18,className:"text-red-400"})}):null,s&&i?u.jsx(g7e,{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(rO,{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:uRn(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})})]})},Aw=400,int=({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)},Aw);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)},Aw);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)=>{ab(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 ${Aw}ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity ${Aw}ms ease`,transform:v?"scale(0)":T?void 0:"scale(1)",opacity:v?0:1,transformOrigin:"center center",animation:T?`att-scale-in ${Aw}ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards`:void 0},children:u.jsx(X4n,{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(Bo,{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(Bo,{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(WE,{open:!0,onClose:()=>a(null),slides:b,index:o}):null]})},ont=({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(FD,{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(yU,{size:24}),u.jsx("span",{className:"text-xs font-medium",children:"将文件拖到这里"})]})}):null,ant=({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?aLt(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(Bo,{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]})},U4n=500;function z4n(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 B4n(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?Bi.deleteDraft(w.key):Bi.saveDraft(w.key,JSON.stringify(w.value)))},U4n))},[]),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?Bi.deleteDraft(T.key):Bi.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 Bi.loadDraft(t);if(!(T||E==null))try{const w=JSON.parse(E);z4n(w)&&(w.reduce((k,C)=>k+C.size,0)<=Ev&&w.length<=mg?(o.current=w,r(w)):Bi.deleteDraft(t))}catch{}})(),()=>{T=!0}},[t,h]),g.useEffect(()=>()=>{h()},[h]);const m=n.reduce((T,E)=>T+E.size,0),O=n.length<mg&&m<Ev,_=g.useCallback(async T=>{i(null);const E=Array.from(T);if(E.length===0)return;const w=[],P=[];for(const N of E)DN(N)==="unsupported"?P.push(N):w.push(N);if(P.length>0&&(d.current?d.current(P):i(`不支持的文件类型:${P[0].name}`)),w.length===0)return;let k=0,C=!0;for(const N of w){const R=m7e(N);if(!R.valid){i(R.error),C=!1;break}k+=N.size}if(!C)return;const I=[];for(const N of w)try{const R=await O7e(N);I.push(R)}catch{i(`读取文件失败:${N.name}`),C=!1;break}C&&r(N=>{if(N.length+I.length>mg)return i(`最多允许添加 ${mg} 个附件`),N;if(N.reduce((A,j)=>A+j.size,0)+k>Ev)return i("附件总大小超过 20MB 限制"),N;const $=[...N,...I];return o.current=$,f($),$})},[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&&Bi.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 F4n=({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(()=>to(n),[n]),_=oe(Ge=>Ge.selectedTeamData?.config.projectPath??null),[b,y]=g.useState(void 0),[x,S]=g.useState(!1),[v,T]=g.useState(""),E=by({key:`sendMessage:${t}:text`}),w=jN(`sendMessage:${t}:chips`),P=g.useRef(!1),k=g.useRef(null),[C,I]=g.useState(!1),N=g.useRef(0),R=g.useRef(null),[$,A]=g.useState(null),j=g.useRef(0),{attachments:Q,error:U,canAddMore:M,addFiles:q,removeAttachment:z,clearAttachments:L,clearError:V,handlePaste:Y,handleDrop:ne}=B4n({persistenceKey:`sendMessage:${t}:attachments`}),te=n.find(Ge=>Ge.name===v),H=te?Gn(te):!1,Z=H&&!!a,se=Z&&M,he=Z?void 0:H?"团队在线时才能添加文件":"文件只能发送给团队负责人",[ce,me]=g.useState(!1);g.useEffect(()=>{if(e&&!P.current){const Ge=n.find(Xt=>Gn(Xt))?.name;if(T(r??Ge??""),y(o),S(!1),k.current=f,i){const Xt=zf(i);E.setValue(Xt+`
|
|
1822
1822
|
`),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(""),me(!0))},[e,f]),g.useEffect(()=>{ce&&(E.clearDraft(),w.clearChipDraft(),L(),me(!1),m())},[ce]);const G=(b?.text.length??0)>120,be=g.useMemo(()=>n.map(Ge=>({id:Ge.name,name:Ge.name,subtitle:ri(Ge.role)??ri(Ge.agentType)??void 0,color:O.get(Ge.name)})),[n,O]),{suggestions:_e}=XN(t),{suggestions:re}=ix(t),ge=Q.length>0&&!Z,J=Dm(E.value).trim(),F=ZE(J,w.chips),W=b?oae(b.from,b.text,F):F,ue=ic-W.length,ie=v.trim().length>0&&W.length>0&&W.length<=ic&&!c&&!ge,le=Ge=>{const Ct=w.chips.find(Xt=>Xt.id===Ge);Ct&&E.setValue(D2(E.value,Ct)),w.setChips(w.chips.filter(Xt=>Xt.id!==Ge))},K=()=>{if(!ie)return;const Ge=ty(E.value,re);Promise.resolve(h(v.trim(),W,J,Q.length>0?Q:void 0,void 0,Ge)).then(Ct=>{Ct?.runtimeDelivery?.attempted===!0&&Ct.runtimeDelivery.delivered===!1||(E.clearDraft(),w.clearChipDraft(),L())}).catch(()=>{})},pe=Ge=>{Ge||m()},we=g.useCallback(Ge=>{const Ct=Ge.target;Ct.files?.length&&q(Ct.files),Ct.value=""},[q]),Ee=g.useCallback(()=>{A(he??"文件只能发送给团队负责人"),window.clearTimeout(j.current),j.current=window.setTimeout(()=>{A(null)},4e3)},[he]);g.useEffect(()=>{const Ge=j;return()=>window.clearTimeout(Ge.current)},[]);const Ae=g.useCallback(Ge=>{Ge.preventDefault(),N.current+=1,N.current===1&&I(!0)},[]),We=g.useCallback(Ge=>{Ge.preventDefault(),N.current-=1,N.current<=0&&(N.current=0,I(!1))},[]),et=g.useCallback(Ge=>{Ge.preventDefault()},[]),yt=g.useCallback(Ge=>{if(Ge.preventDefault(),N.current=0,I(!1),!Z){Ge.dataTransfer?.files?.length&&Ee();return}ne(Ge)},[Z,ne,Ee]),xt=g.useCallback(Ge=>{if(!Z){Array.from(Ge.clipboardData.items).some(Xt=>Xt.kind==="file")&&(Ge.preventDefault(),Ee());return}Y(Ge)},[Z,Y,Ee]);return u.jsx(_s,{open:e,onOpenChange:pe,children:u.jsxs(cs,{className:"min-w-0 max-w-3xl",onDragEnter:Ae,onDragLeave:We,onDragOver:et,onDrop:yt,onPaste:xt,children:[u.jsx(ont,{active:C,rejected:!Z,rejectionReason:he}),u.jsxs(bs,{children:[u.jsx(us,{children:"发送消息"}),u.jsx(wi,{children:"向团队成员发送一条私信。"})]}),u.jsxs("div",{className:"grid gap-4 py-2",children:[u.jsxs("div",{className:"grid gap-2",children:[u.jsx(Kt,{htmlFor:"smd-recipient",children:"接收人"}),u.jsx(Tae,{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(Kt,{htmlFor:"smd-message",children:"消息内容"}),H?u.jsxs(u.Fragment,{children:[u.jsx("input",{ref:R,type:"file",accept:"*/*",multiple:!0,className:"hidden",onChange:we}),u.jsxs(it,{children:[u.jsx(ot,{asChild:!0,children:u.jsx("button",{type:"button",className:`inline-flex items-center gap-1 rounded p-1 transition-colors ${se?"text-[var(--color-text-secondary)] hover:text-[var(--color-text)]":"text-[var(--color-text-muted)] opacity-40"}`,disabled:!se,onClick:()=>R.current?.click(),children:u.jsx(yU,{size:14})})}),u.jsx(tt,{side:"top",children:a?M?"添加文件(支持粘贴或拖拽)":"已达到附件上限":"团队在线时才能添加文件"})]})]}):null]}),u.jsx(int,{attachments:Q,onRemove:z,error:U??$,onDismissError:V,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(it,{children:[u.jsx(ot,{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(tt,{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(zr,{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(ai,{content:b.text,bare:!0,maxHeight:x?"max-h-48":"max-h-[3.75rem]"})}),G?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(Um,{id:"smd-message",className:b?"rounded-t-none":void 0,placeholder:"输入消息...(回车发送)",value:E.value,onValueChange:E.setValue,suggestions:be,teamSuggestions:_e,taskSuggestions:re,chips:w.chips,onChipRemove:le,projectPath:_,onFileChipInsert:Ge=>w.setChips([...w.chips,Ge]),onModEnter:K,minRows:4,maxRows:12,maxLength:ic,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:!ie,onClick:K,children:[u.jsx(E$,{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(Bo,{size:10,className:"shrink-0"}),l]}):d?u.jsx(ant,{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 Y4n({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 $ce(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function V4n(e,t){return e.reduce((n,r,s)=>{const i=t.get(r);return i&&(n[s]=i),n},Array(e.length))}function YM(e){return e!==null&&e>=0}function q4n(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 W4n(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const VM={scaleX:1,scaleY:1},G4n=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=H4n(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,...VM}:null}return o>s&&o<=i?{x:-a.width-c,y:0,...VM}:o<s&&o>=i?{x:a.width+c,y:0,...VM}:{x:0,y:0,...VM}};function H4n(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 lnt=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const i=$ce(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}},qM={scaleX:1,scaleY:1},Z4n=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,...qM}:null}const c=K4n(i,s,n);return s>n&&s<=o?{x:0,y:-a.height-c,...qM}:s<n&&s>=o?{x:0,y:a.height+c,...qM}:{x:0,y:0,...qM}};function K4n(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 cnt="Sortable",unt=Je.createContext({activeIndex:-1,containerId:cnt,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:lnt,disabled:{draggable:!1,droppable:!1}});function dnt(e){let{children:t,id:n,items:r,strategy:s=lnt,disabled:i=!1}=e;const{active:o,dragOverlay:a,droppableRects:c,over:l,measureDroppableContainers:d}=qse(),p=Z$(cnt,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=!q4n(h,b.current),x=_!==-1&&O===-1||y,S=W4n(i);ap(()=>{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:V4n(h,c),strategy:s}),[O,p,S.draggable,S.droppable,x,h,_,c,f,s]);return Je.createElement(unt.Provider,{value:v},t)}const J4n=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return $ce(n,r,s).indexOf(t)},eFn=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},tFn={duration:200,easing:"ease"},pnt="transform",nFn=Qm.Transition.toString({property:pnt,duration:0,easing:"linear"}),rFn={roleDescription:"sortable"};function sFn(e){let{disabled:t,index:n,node:r,rect:s}=e;const[i,o]=g.useState(null),a=g.useRef(n);return ap(()=>{if(!t&&n!==a.current&&r.current){const c=s.current;if(c){const l=AE(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 fnt(e){let{animateLayoutChanges:t=eFn,attributes:n,disabled:r,data:s,getNewIndex:i=J4n,id:o,strategy:a,resizeObserverConfig:c,transition:l=tFn}=e;const{items:d,containerId:p,activeIndex:f,disabled:h,disableTransforms:m,sortedRects:O,overIndex:_,useDragOverlay:b,strategy:y}=g.useContext(unt),x=iFn(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}=Wse({id:o,data:v,disabled:x.droppable,resizeObserverConfig:{updateMeasurementsFor:T,...c}}),{active:C,activatorEvent:I,activeNodeRect:N,attributes:R,setNodeRef:$,listeners:A,isDragging:j,over:Q,setActivatorNodeRef:U,transform:M}=hXt({id:o,data:v,attributes:{...rFn,...n},disabled:x.draggable}),q=J5t(k,$),z=!!C,L=z&&!m&&YM(f)&&YM(_),V=!b&&j,Y=V&&L?M:null,te=L?Y??(a??y)({rects:O,activeNodeRect:N,activeIndex:f,overIndex:_,index:S}):null,H=YM(f)&&YM(_)?i({id:o,items:d,activeIndex:f,overIndex:_}):S,Z=C?.id,se=g.useRef({activeId:Z,items:d,newIndex:H,containerId:p}),he=d!==se.current.items,ce=t({active:C,containerId:p,isDragging:j,isSorting:z,id:o,index:S,items:d,newIndex:se.current.newIndex,previousItems:se.current.items,previousContainerId:se.current.containerId,transition:l,wasDragging:se.current.activeId!=null}),me=sFn({disabled:!ce,index:S,node:w,rect:E});return g.useEffect(()=>{z&&se.current.newIndex!==H&&(se.current.newIndex=H),p!==se.current.containerId&&(se.current.containerId=p),d!==se.current.items&&(se.current.items=d)},[z,H,p,d]),g.useEffect(()=>{if(Z===se.current.activeId)return;if(Z!=null&&se.current.activeId==null){se.current.activeId=Z;return}const G=setTimeout(()=>{se.current.activeId=Z},50);return()=>clearTimeout(G)},[Z]),{active:C,activeIndex:f,attributes:R,data:v,rect:E,index:S,newIndex:H,items:d,isOver:P,isSorting:z,isDragging:j,listeners:A,node:w,overIndex:_,over:Q,setNodeRef:q,setActivatorNodeRef:U,setDroppableNodeRef:k,setDraggableNodeRef:$,transform:me??te,transition:ae()};function ae(){if(me||he&&se.current.newIndex===S)return nFn;if(!(V&&!_z(I)||!l)&&(z||ce))return Qm.Transition.toString({...l,property:pnt})}}function iFn(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 hnt="kanban-column-widths:",mnt=180,uCe=256;function dCe(e){try{const t=localStorage.getItem(hnt+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>=mnt&&(r[s]=i);return r}catch{return{}}}function oFn(e,t){try{localStorage.setItem(hnt+e,JSON.stringify(t))}catch{}}function aFn({storageKey:e,columnIds:t}){const[n,r]=g.useState(()=>dCe(e));g.useEffect(()=>{r(dCe(e))},[e]);const s=g.useRef(null),i=g.useRef(null),o=new Map;for(const d of t)o.set(d,n[d]??uCe);const a=g.useCallback(d=>{const p=s.current;if(!p)return;const f=d.clientX-p.startX,h=Math.max(mnt,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=>(oFn(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]??uCe;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 pCe=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:nt("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:nt("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:nt("flex max-h-[480px] flex-col gap-1.5 overflow-auto p-2",c),children:p})]})}),lFn=/^agent_teams_ui\s+\[Agent Team:\s*["\u201C]([^"\u201D]+)["\u201D]\s*\|\s*Project:\s*["\u201C]([^"\u201D]+)["\u201D]\s*\|\s*Lead:\s*["\u201C]([^"\u201D]+)["\u201D]\]/,cFn=/^Team Start\s+\[Agent Team:\s*["\u201C]([^"\u201D]+)["\u201D]\s*\|\s*Project:\s*["\u201C]([^"\u201D]+)["\u201D]\s*\|\s*Lead:\s*["\u201C]([^"\u201D]+)["\u201D]\]/,uFn=/^(?:\[Image\s+#\d+\]\s*)+/;function dFn(e){if(!e)return{kind:"regular",displayText:"Untitled"};const t=lFn.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=cFn.exec(n);return r?{kind:"team-resume",displayText:r[1],teamName:r[1],projectName:r[2]}:{kind:"regular",displayText:e.replace(uFn,"").trim()||"Untitled"}}function pFn(e){return dFn(e).displayText}const Hee="__unassigned__",fFn=[{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)"}],hFn=({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(nu,{children:[u.jsxs(it,{children:[u.jsx(ot,{asChild:!0,children:u.jsx(od,{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(bU,{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(tt,{side:"bottom",children:"筛选任务"})]}),u.jsxs(hc,{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=pFn(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(upt,{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(oi,{checked:e.selectedOwners.has(d.name),onCheckedChange:()=>a(d.name)}),vl(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(oi,{checked:e.selectedOwners.has(Hee),onCheckedChange:()=>a(Hee)}),"(未分配)"]})]})]}),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:fFn.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(oi,{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:"清空筛选"})})]})]})},mFn=[{field:"updatedAt",label:"最近更新",description:"按最近更新时间排序",icon:u.jsx(uc,{size:14})},{field:"createdAt",label:"创建时间",description:"按最新创建排序",icon:u.jsx(Wv,{size:14})},{field:"owner",label:"负责人",description:"按负责人名称排序",icon:u.jsx(SU,{size:14})},{field:"manual",label:"手动排序",description:"按拖拽顺序显示",icon:u.jsx(Ypt,{size:14})}],OFn=({sort:e,onSortChange:t})=>{const n=e.field!=="updatedAt";return u.jsxs(nu,{children:[u.jsxs(it,{children:[u.jsx(ot,{asChild:!0,children:u.jsx(od,{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(DIe,{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(tt,{side:"bottom",children:"任务排序"})]}),u.jsxs(hc,{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:mFn.map(r=>{const s=e.field===r.field;return u.jsxs("button",{type:"button",className:nt("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:nt("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:nt("text-[10px]",s?"text-blue-300/70":"text-[var(--color-text-muted)]"),children:r.description})]}),s&&u.jsx(tdt,{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:"重置"})})]})]})},fCe={todo:{headerBg:"rgba(59, 130, 246, 0.22)",bodyBg:"rgba(59, 130, 246, 0.05)",icon:u.jsx(zIe,{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(zdt,{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(yl,{size:14,className:"shrink-0 text-[var(--color-text-muted)]"})}},gFn=new Set(["auto","scroll","overlay"]),Iw=[{id:"todo",title:"TODO"},{id:"in_progress",title:"IN PROGRESS"},{id:"done",title:"DONE"}];function _Fn(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 bFn(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 yFn(e,t,n){return t==="manual"?bFn(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 xFn=({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(zr,{name:e.owner,color:t.get(e.owner),size:"xs"}):null]})}),SFn=({task:e,columnId:t,memberColorMap:n})=>{const{attributes:r,listeners:s,setNodeRef:i,transform:o,transition:a,isDragging:c}=fnt({id:e.id,data:{type:"kanban-task",columnId:t,taskId:e.id}}),l={transform:Qm.Transform.toString(o),transition:a,opacity:c?.5:1};return u.jsx("div",{ref:i,style:l,...r,...s,children:u.jsx(xFn,{task:e,memberColorMap:n})})},vFn=({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([]),[I,N]=g.useState("grid"),R=I==="columns"&&!!S&&s.field==="manual",$=g.useRef(null),A=g.useMemo(()=>{const G=e.map(re=>`${re.id}\0${re.displayId??""}\0${re.subject}\0${re.status}`),be=$.current;if(be?.signatures.length===G.length&&be.signatures.every((re,ge)=>re===G[ge]))return be.map;const _e=new Map(e.map(re=>[re.id,re]));return $.current={signatures:G,map:_e},_e},[e]),j=g.useMemo(()=>to(a),[a]),Q=g.useMemo(()=>{const G=new Map(Iw.map(({id:be})=>[be,[]]));for(const be of e){const _e=_Fn(be,n);_e&&G.get(_e)?.push(be)}return G},[e,n]),U=g.useMemo(()=>{const G=new Map;for(const be of Iw){const _e=Q.get(be.id)??[],re=n.columnOrder?.[be.id];G.set(be.id,yFn(_e,s.field,re))}return G},[Q,n.columnOrder,s.field]),M=$Xe(PXe(bz,{activationConstraint:{distance:8}})),q=g.useCallback(G=>{const{active:be,over:_e}=G;if(!S||!_e||be.id===_e.id)return;const re=be.data.current;if(re?.type!=="kanban-task")return;const ge=re.columnId,J=U.get(ge)?.map(ie=>ie.id)??[],F=J.indexOf(be.id),W=J.indexOf(_e.id);if(F===-1||W===-1||F===W)return;const ue=$ce(J,F,W);S(ge,ue)},[S,U]),z=(G,be,_e)=>{const re=T&&G==="todo"?()=>T(!1):T&&G==="in_progress"?()=>T(!0):void 0,ge=re?u.jsxs("button",{type:"button",onClick:re,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(xl,{size:13}),"Add task"]}):null;if(be.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(R){const J=be.map(F=>F.id);return u.jsxs(u.Fragment,{children:[u.jsx(dnt,{items:J,strategy:Z4n,children:be.map(F=>u.jsx(SFn,{task:F,columnId:G,memberColorMap:j},F.id))}),ge]})}return u.jsxs(u.Fragment,{children:[be.map(J=>u.jsx(nKe,{task:J,teamName:t,columnId:G,kanbanTaskState:n.tasks[J.id],hasReviewers:!1,compact:_e,taskMap:A,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 Iw;const G=Iw.filter(be=>r.columns.has(be.id));return G.length>0?G:Iw},[r.columns]),V=L[0]?.id??null,Y=g.useMemo(()=>L.map(G=>G.id),[L]),{widths:ne,getHandleProps:te}=aFn({storageKey:t,columnIds:Y}),Z=V!=null?ne.get(V)??256:256,se=g.useCallback(()=>{for(const G of C.current)window.clearTimeout(G);C.current=[]},[]);g.useEffect(()=>se,[se]);const he=g.useCallback(G=>{let be=G?.parentElement??null;for(;be;){const{overflowY:_e}=window.getComputedStyle(be);if(gFn.has(_e))return be;be=be.parentElement}return null},[]),ce=g.useCallback(G=>{const be=he(k.current);if(!be)return;const _e=be.scrollTop;se();const re=()=>{be.scrollTop=_e},ge=G==="grid"?[120,240]:[120];C.current=ge.map(J=>window.setTimeout(re,J))},[se,he]),me=g.useCallback(G=>{ce(G),N(G)},[ce,I]),ae=u.jsxs("div",{ref:k,className:"min-w-0 max-w-full overflow-x-hidden",children:[u.jsxs("div",{className:nt("flex min-w-0 max-w-full items-center gap-2",I==="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(hFn,{filter:r,sessions:i,leadSessionId:o,members:a,onFilterChange:c}),u.jsx("div",{className:"h-4 w-px bg-[var(--color-border)]"}),u.jsx(OFn,{sort:s,onSortChange:l})]}),w!=null&&w>0&&P?u.jsxs(it,{children:[u.jsx(ot,{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(Ti,{size:14}),u.jsx("span",{className:"ml-1 text-xs",children:w})]})}),u.jsx(tt,{side:"bottom",children:"回收站"})]}):null,u.jsxs("div",{className:"inline-flex rounded-md border border-[var(--color-border)]",children:[u.jsxs(it,{children:[u.jsx(ot,{asChild:!0,children:u.jsx(Xe,{variant:"ghost",size:"sm",className:nt("h-7 rounded-r-none px-2",I==="grid"?"bg-[var(--color-surface-raised)] text-[var(--color-text)]":"text-[var(--color-text-muted)]"),onClick:()=>me("grid"),"aria-label":"网格视图",children:u.jsx(pft,{size:14})})}),u.jsx(tt,{side:"bottom",children:"网格视图"})]}),u.jsxs(it,{children:[u.jsx(ot,{asChild:!0,children:u.jsx(Xe,{variant:"ghost",size:"sm",className:nt("h-7 rounded-l-none border-l border-[var(--color-border)] px-2",I==="columns"?"bg-[var(--color-surface-raised)] text-[var(--color-text)]":"text-[var(--color-text-muted)]"),onClick:()=>me("columns"),"aria-label":"列视图",children:u.jsx(mR,{size:14})})}),u.jsx(tt,{side:"bottom",children:"列视图"})]})]})]})]}),I==="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(G=>{const be=U.get(G.id)??[],_e=fCe[G.id];return u.jsx(pCe,{title:G.title,count:be.length,icon:_e.icon,headerBg:_e.headerBg,bodyBg:_e.bodyBg,bodyClassName:"max-h-none overflow-visible",children:z(G.id,be)},G.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((G,be)=>{const _e=U.get(G.id)??[],re=fCe[G.id],ge=ne.get(G.id)??256,J=te(G.id);return u.jsxs("div",{className:"flex shrink-0",children:[u.jsx("div",{style:{width:ge},children:u.jsx(pCe,{title:G.title,count:_e.length,icon:re.icon,headerBg:re.headerBg,bodyBg:re.bodyBg,bodyClassName:"max-h-none overflow-visible",children:z(G.id,_e,!0)})}),be<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]},G.id)})})})]});return R?u.jsx(HXe,{sensors:M,onDragEnd:q,children:ae}):ae},TFn=15,EFn=({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=l_(x).toLowerCase();return b===""||S.includes(b)}).slice(0,TFn)},[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=l_(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(Mi,{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(it,{children:[u.jsx(ot,{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(tt,{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(qIe,{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(wFn,{task:b,index:y,members:r,isActive:y===o,onSelect:()=>O(b),onHover:()=>a(y)},b.id))]})]})},wFn=Je.memo(function({task:t,index:n,members:r,isActive:s,onSelect:i,onHover:o}){const a=l_(t),c=Iz[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:vT(m,{addSuffix:!0})},[t.createdAt]),p=g.useMemo(()=>{if(!t.updatedAt)return null;const m=new Date(t.updatedAt);return isNaN(m.getTime())?null:vT(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(zr,{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]})]})]})]})}),kFn=({open:e,tasks:t,onClose:n,onRestore:r})=>u.jsx(_s,{open:e,onOpenChange:s=>!s&&n(),children:u.jsxs(cs,{className:"max-w-lg",children:[u.jsx(bs,{children:u.jsxs(us,{className:"flex items-center gap-2 text-sm",children:[u.jsx(Ti,{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(nc,{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?Zb(new Date(s.deletedAt),{addSuffix:!0}):"—"}),r?u.jsx("td",{className:"py-2",children:u.jsxs(it,{children:[u.jsx(ot,{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(wm,{size:12})})}),u.jsx(tt,{side:"left",children:"恢复"})]})}):null]},s.id))})]})})}),u.jsx(tu,{children:u.jsx(Xe,{variant:"outline",size:"sm",onClick:n,children:"关闭"})})]})});function CFn(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 ee.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 RFn(e,t){if(t)return e==="codex"&&t==="Codex native"?"Codex":t}function hCe(e){return e?e.launchState==="starting"||e.launchState==="runtime_pending_bootstrap"||e.launchState==="runtime_pending_permission"||e.status==="waiting"||e.status==="spawning":!1}function Ont(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 gnt(e,t,n,r){const s=e.providerBackendId,i=e.model?.trim()||"",o=n?.runtimeModel?.trim()||r?.runtimeModel?.trim(),a=Ig(i)??Ig(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=RFn(c,RBn(c,h)),O=typeof r?.rssBytes=="number"&&r.rssBytes>0?` · ${w2(r.rssBytes)}`:"";if(o&&(hCe(n)||p.length===0)){const b=Ig(o)??c;return`${db(b,o,f)}${m?` · ${m}`:""}${O}`}return hCe(n)?!p.length&&!O?void 0:`${db(c,p,f)}${m?` · ${m}`:""}${O}`:`${db(c,p,f)}${m?` · ${m}`:""}${O}`}function Zee(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 UN(f)?n&&IMn(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=z2(p).toLowerCase(),h=YZe(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 _nt({teamName:e,memberName:t,members:n,tasks:r,messages:s}){const i=Zee(s,{timeWindow:null,filter:{from:new Set,to:new Set,showNoise:!0},searchQuery:""}),o=`lead:${e}`,a=n.find(p=>Gn(p))?.name??`${e}-lead`,c=t===a?o:`member:${e}:${t}`;return Ple({data:{members:n,tasks:r,messages:i},teamName:e,leadId:o,leadName:a,ownerNodeIds:new Set([o,c])}).get(c)??[]}const PFn=({currentRole:e,onSave:t,onCancel:n,saving:r})=>{const s=e&&hie.includes(e),[i,o]=g.useState(e?s?e:$f:ET),[a,c]=g.useState(s?"":e??""),[l,d]=g.useState(null),p=h=>{o(h),d(null),h!==$f&&c("")},f=()=>{if(i===ET){t(void 0);return}if(i!==$f){t(i);return}const h=a.trim();if(!h){d("Role cannot be empty");return}if(tK.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(mBn,{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=>tK.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(qt,{size:12,className:"animate-spin"}):u.jsx(Kr,{size:12})}),u.jsx(Xe,{variant:"ghost",size:"icon",className:"size-6",onClick:n,disabled:r,children:u.jsx(Ar,{size:12})})]})},$Fn=({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=oe(R=>R.selectedTeamName),_=oe(R=>O?Pl(R,O):[]),b=g.useMemo(()=>pp(_),[_]),y=Ir(e.color??""),x=e.role||ri(e.agentType),S=wT({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,I=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,N=!Gn(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)??po(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":I})]}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx(us,{className:"truncate",style:{color:y.text},children:vl(e.name)}),u.jsx(wi,{asChild:!0,className:"mt-1 flex items-center gap-2",children:u.jsxs("div",{children:[h?u.jsx(PFn,{currentRole:e.role,saving:f,onSave:async R=>{try{await p?.(R),m(!1)}catch{}},onCancel:()=>m(!1)}):u.jsxs(u.Fragment,{children:[u.jsx("span",{children:x||"无角色"}),N&&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(zb,{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:I})}),!h&&t?u.jsx("div",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:t}):null]})})]})]})},mCe="rounded-md border border-[var(--color-border)] bg-[var(--color-surface-raised)] px-2.5 py-1.5",NFn="cursor-pointer transition-colors hover:border-[var(--color-border-emphasis)] hover:bg-[var(--color-surface-overlay)]",OCe=({label:e,value:t,sub:n,onClick:r})=>{const s=r?`${mCe} ${NFn}`:mCe,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})},AFn=({totalTasks:e,inProgressTasks:t,totalTokens:n,statsLoading:r,statsComputedAt:s,onTabChange:i})=>{const o=r?"...":n!=null?kn(n):"—",a=!r&&s?`updated ${C3(s)}`:void 0;return u.jsxs("div",{className:"grid min-w-0 flex-1 grid-cols-2 gap-1.5",children:[u.jsx(OCe,{label:"Tasks",value:e,sub:t>0?`进行中: ${t}`:void 0,onClick:i?()=>i("tasks"):void 0}),u.jsx(OCe,{label:"Tokens",value:o,sub:a,onClick:i?()=>i("stats"):void 0})]})},IFn=100,MFn=[{value:"all",label:"All"},{value:"messages",label:"Messages"},{value:"comments",label:"Comments"}],QFn=({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}=oe(Et(R=>({messages:vXe(R,e,t),messagesState:e?R.teamMessagesByName[e]:void 0,loadOlderTeamMessages:R.loadOlderTeamMessages}))),{readSet:m}=Gle(e),O=g.useMemo(()=>new Map(r.map(R=>[R.id,R])),[r]),_=g.useMemo(()=>BN(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(()=>_nt({teamName:e,memberName:t,members:n,tasks:r,messages:p}),[t,n,p,r,e]),T=g.useMemo(()=>v.slice(0,IFn),[v]),E=g.useMemo(()=>{switch(a){case"messages":return T.filter(R=>R.message.messageKind!=="task_comment_notification");case"comments":return T.filter(R=>R.message.messageKind==="task_comment_notification");default:return T}},[a,T]),w=g.useMemo(()=>{const R=new Map;for(const $ of E)R.set(Ls($.message),{type:"message",message:$.message});return R},[E]),P=g.useCallback(R=>{const $=w.get(R);$&&d($)},[w]),k=g.useCallback(R=>{const $=O.get(R)??r.find(A=>A.displayId===R);$&&o?.($)},[o,O,r]),I=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",N=S&&a!=="comments";return u.jsxs("div",{className:"space-y-3",children:[u.jsx("div",{className:"flex flex-wrap items-center gap-2",children:MFn.map(R=>{const $=a===R.value;return u.jsx("button",{type:"button",className:["rounded-full border px-3 py-1 text-xs font-medium transition-colors",$?"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(R.value),children:R.label},R.value)})}),u.jsxs("div",{className:"max-h-[320px] space-y-2 overflow-y-auto",children:[E.length>0?E.map((R,$)=>{const A=Ls(R.message),j=hB(R.message,_),Q={type:"message",message:R.message},U=!R.message.read&&!m.has(A);return u.jsx("div",{className:"cursor-pointer",role:"button",tabIndex:0,onClick:()=>d(Q),onKeyDown:M=>{(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),d(Q))},children:u.jsx(VN,{message:R.message,teamName:e,compactHeader:!0,collapseMode:"managed",isCollapsed:!0,canToggleCollapse:!1,isUnread:U,expandItemKey:A,onExpand:P,onCreateTask:i,onTaskIdClick:k,memberRole:j.memberRole,memberColor:j.memberColor,recipientColor:j.recipientColor,memberColorMap:_.colorMap,localMemberNames:_.localMemberNames,zebraShade:$%2===1})},R.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:I}),N&&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(BC,{expandedItem:l,open:l!==null,onOpenChange:R=>{R||d(null)},teamName:e,members:n,onTaskIdClick:k,onCreateTaskFromMessage:i})]})},DFn=({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 ee.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(qt,{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(Bo,{size:14}),_]});if(!m)return u.jsxs("div",{className:"py-8 text-center text-xs text-[var(--color-text-muted)]",children:[u.jsx(Yne,{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(LFn,{stats:m,totalTokens:b,totalToolCalls:y}),u.jsx(jFn,{toolUsage:m.toolUsage}),u.jsx(zFn,{files:m.filesTouched,fileStats:m.fileStats,onFileClick:i,onShowAll:o}),u.jsx(BFn,{stats:m})]})},WM=({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(ni,{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})]}),LFn=({stats:e,totalTokens:t,totalToolCalls:n})=>u.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:[u.jsx(WM,{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(WM,{label:"Files",value:e.filesTouched.length}),u.jsx(WM,{label:"Tool Calls",value:n}),u.jsx(WM,{label:"Tokens",value:kn(t)})]}),jFn=({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))})]})},XFn=";.,";function UFn(e){let t=e.trim(),n=t.length;for(;n>0&&XFn.includes(t[n-1]);)n--;return t=t.slice(0,n),!t||t==="null"||t==="undefined"||t==="None"}const zFn=({files:e,fileStats:t,onFileClick:n,onShowAll:r})=>{const[s,i]=g.useState(!1),o=e.filter(d=>!UFn(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=kf(d)||d,f=t?.[d];return u.jsxs("button",{type:"button",className:nt("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(Gv,{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(Ur,{size:10}):u.jsx(Ln,{size:10}),s?"Show less":`+${c} more`]})]})},BFn=({stats:e})=>{const t=C3(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]})},gCe={in_progress:0,pending:1,completed:2},FFn=({tasks:e,onTaskClick:t})=>{const n=g.useMemo(()=>e.filter(r=>r.status!=="deleted").sort((r,s)=>(gCe[r.status]??3)-(gCe[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=t_(r),i=s&&lf[s]?{bg:lf[s].bg,text:lf[s].text}:i5[r.status],o=s&&lf[s]?lf[s].label:Iz[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 ${qc.needsFix.bg} ${qc.needsFix.text}`,children:qc.needsFix.label}):null]},r.id)})})})},YFn=({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 ee.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(qt,{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(Bo,{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(Kc,{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(qne,{size:10}),"View Diff"]})]}),u.jsx("div",{className:"space-y-0.5",children:s.files.map(f=>{const h=kf(f.filePath)||f.filePath,m=!!n;return u.jsxs("button",{type:"button",className:nt("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(Gv,{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)})})]})},VFn=({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=oe(te=>vXe(te,n,t?.name??null)),k=g.useMemo(()=>t?_nt({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[I,N]=g.useState(i),[R,$]=g.useState(!1),[A,j]=g.useState(null),Q=g.useMemo(()=>t?gnt(t,m,p,f):void 0,[m,t,f,p]),U=Ont(f);p?.launchState==="starting"||p?.launchState==="runtime_pending_bootstrap"||p?.launchState;const M=g.useMemo(()=>t?mie({teamName:n,runId:h,memberName:t.name,spawnEntry:p,runtimeEntry:f}):null,[t,f,h,p,n]),q=M!=null&&Mz(M)&&Oie(M),z=M?lze(M):void 0;g.useEffect(()=>{!e||!t||(N(i),j(null),$(!1))},[i,t,e]);const{stats:L,loading:V,error:Y}=CFn(n,t?.name??null),ne=L?L.inputTokens+L.outputTokens:null;return t?u.jsx(_s,{open:e,onOpenChange:te=>!te&&O(),children:u.jsxs(cs,{className:"min-w-0 sm:max-w-4xl",children:[u.jsxs("div",{className:"flex items-start gap-4",children:[u.jsx(bs,{className:"shrink-0",children:u.jsx($Fn,{member:t,runtimeSummary:Q,isTeamAlive:a,isTeamProvisioning:c,leadActivity:Gn(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(AFn,{totalTasks:w.length,inProgressTasks:C,totalTokens:ne,statsLoading:V,statsComputedAt:L?.computedAt,onTabChange:N})]}),u.jsxs(k3,{value:I,onValueChange:te=>N(te),className:"min-w-0 overflow-hidden",children:[u.jsxs(EN,{className:"w-full",children:[u.jsxs(gf,{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(gf,{value:"workspace",className:"flex-1 gap-1.5",children:[u.jsx(Kc,{size:12}),"Workspace"]}),u.jsxs(gf,{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(gf,{value:"stats",className:"flex-1 gap-1.5",children:[u.jsx(Yne,{size:12}),"Stats"]})]}),u.jsx(_f,{value:"tasks",children:u.jsx(FFn,{tasks:w,onTaskClick:y})}),u.jsx(_f,{value:"workspace",children:u.jsx(YFn,{teamName:n,memberName:t.name,onFileClick:te=>E?.(t.name,te),onViewAllChanges:()=>E?.(t.name)})}),u.jsx(_f,{value:"activity",children:u.jsx(QFn,{teamName:n,memberName:t.name,members:r,tasks:s,initialFilter:o,onTaskClick:y})}),u.jsx(_f,{value:"stats",children:u.jsx(DFn,{teamName:n,memberName:t.name,prefetchedStats:L,prefetchedLoading:V,prefetchedError:Y,onFileClick:te=>E?.(t.name,te),onShowAllFiles:()=>E?.(t.name)})})]}),u.jsx(tu,{children:A?u.jsx("div",{className:"text-xs text-red-400",children:A}):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}),M&&q?u.jsx(bie,{payload:M,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},_Ce=1e3;function qFn(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function WFn(e,t=_Ce){return g.useMemo(()=>{if(!e)return;const n=Number.isFinite(t)&&t>0?t:_Ce;return{animationDelay:`${-(qFn()%n)}ms`,animationDuration:`${n}ms`}},[t,e])}const GFn=2e3,HFn=({className:e,label:t})=>{const n=e?.includes("animate-pulse")===!0,r=WFn(n,GFn);return u.jsx("span",{className:nt("absolute -bottom-0.5 -right-0.5 rounded-full border-2 border-[var(--color-surface)]",e),style:r,"aria-label":t})};function ZFn(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 KFn=({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=oe(ze=>ze.selectedTeamName),[I,N]=g.useState(!1),[R,$]=g.useState(null),[A,j]=g.useState(!1),[Q,U]=g.useState(null),M=oe(ze=>C?Pl(ze,C):[]),q=g.useMemo(()=>pp(M),[M]),z=wT({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,V=z.runtimeAdvisoryLabel,Y=z.runtimeAdvisoryTitle,ne=z.runtimeAdvisoryTone,te=z.presenceLabel,H=z.cardClass,Z=z.launchVisualState,se=z.launchStatusLabel,he=Z==="runtime_pending"||Z==="permission_pending"||Z==="shell_only"||Z==="runtime_candidate"||Z==="registered_only"||Z==="stale_runtime"?se??te:te,ce=Ir(t),{isLight:me}=Us(),ae=i?.pending??0,G=i?.inProgress??0,be=i?.completed??0,_e=ae+G+be,re=_e>0?Math.round(be/_e*100):0,ge=ri(e.role)??ri(e.agentType),{summary:J,memory:F}=ZFn(n),W=Ont(r),ue=Gn(e),ie=e.cwd?.trim(),le=!ue&&!f&&e.isolation==="worktree",K=ie?`Worktree isolation configured. Worktree path: ${ie}`:"Worktree isolation is configured, but the runtime path is not available yet",pe=l??d??null,we=l?`Current task: #${so(l.id)}`:d?`Reviewing task: #${so(d.id)}`:void 0,Ee=!f&&te==="starting"&&b!=="failed_to_start"&&!pe&&!n,Ae=!f&&!pe&&!V&&(te==="starting"||te==="connecting"||Z==="runtime_pending"||Z==="shell_only"||Z==="runtime_candidate"||Z==="registered_only"||Z==="stale_runtime"),We=te==="starting"?te:he,et=g.useMemo(()=>mie({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&&Mz(et)&&Oie(et),xt=h==="error"||b==="failed_to_start",Ge=h==="skipped"||b==="skipped_for_launch"||m?.skippedForLaunch===!0,Ct=!f&&xt,Xt=!f&&Ge,ct=o===!0||a===!0||x===!0,mn=(Ct||Xt)&&!Gn(e)&&!!P&&ct,Lt=Ct&&!Gn(e)&&!!k&&ct,Sn=!f&&!!V&&!Ae&&!xt&&!Ge&&(!!pe||!p),jt=async ze=>{if(ze.preventDefault(),ze.stopPropagation(),!(!P||I)){$(null),N(!0);try{await P(e.name)}catch(rt){$(rt instanceof Error?rt.message:"重试启动成员失败")}finally{N(!1)}}},dn=async ze=>{if(ze.preventDefault(),ze.stopPropagation(),!(!k||A)){U(null),j(!0);try{await k(e.name)}catch(rt){U(rt instanceof Error?rt.message:"跳过成员失败")}finally{j(!1)}}};return u.jsx("div",{className:`rounded transition-opacity duration-300 ${f?"opacity-50":""} ${H}`,children:u.jsxs("div",{className:"group relative cursor-pointer rounded py-1.5",style:void 0,title:we,role:"button",tabIndex:0,onClick:T,onKeyDown:ze=>{(ze.key==="Enter"||ze.key===" ")&&(ze.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:ce.border,boxShadow:me?"none":`0 0 0 1px ${ce.badge}`},children:u.jsx("img",{src:q.get(e.name)??po(e.name),alt:e.name,className:"size-7 rounded-full bg-[var(--color-surface-raised)]",loading:"lazy"})}),u.jsx(HFn,{className:`size-2.5 ${L}`,label:he})]}),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:vl(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(T$,{size:10}),e.gitBranch]}):null,le?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:K,children:"worktree"}):null,l?u.jsx(o5,{task:l,borderColor:ce.border,activityLabel:"working on",onOpenTask:S}):null,d?u.jsx(o5,{task:d,borderColor:ce.border,activityLabel:"reviewing",onOpenTask:v}):null,!pe&&p?u.jsxs(u.Fragment,{children:[ne==="error"?u.jsx(Kn,{className:"size-3 shrink-0 text-red-400"}):u.jsx(qt,{className:`size-3 shrink-0 animate-spin ${V?"text-amber-400":""}`,style:V?void 0:{color:ce.border}}),u.jsx("span",{className:`shrink-0 text-[10px] ${ne==="error"?"text-red-300":V?"text-amber-300":"text-[var(--color-text-muted)]"}`,title:Y??"Message sent, awaiting reply",children:V??"awaiting reply"})]}):null]}),Ee?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]}),Ae?u.jsxs("span",{className:"flex shrink-0 items-center gap-1",title:r?.runtimeDiagnostic,children:[u.jsx(qt,{className:"size-3.5 shrink-0 animate-spin text-[var(--color-text-muted)]","aria-label":We}),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:We})]}):Ct?u.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[u.jsxs(it,{children:[u.jsx(ot,{asChild:!0,children:u.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[u.jsx(Kn,{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:he})]})}),u.jsx(tt,{side:"bottom",children:O??"Spawn failed"})]}),yt?u.jsx(bie,{payload:et,className:"size-auto rounded p-1 text-red-300 transition-colors hover:bg-red-500/10 hover:text-red-200"}):null,Lt?u.jsxs(it,{children:[u.jsx(ot,{asChild:!0,children:u.jsx("button",{type:"button","aria-label":A?"正在跳过成员":"本次启动跳过",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:A||I,onClick:dn,children:A?u.jsx(qt,{className:"size-3.5 animate-spin"}):u.jsx(FD,{className:"size-3.5"})})}),u.jsx(tt,{side:"bottom",children:Q??(A?"正在跳过成员...":"本次启动跳过")})]}):null,mn?u.jsxs(it,{children:[u.jsx(ot,{asChild:!0,children:u.jsx("button",{type:"button","aria-label":I?"正在重试成员":"重试成员",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:I||A,onClick:jt,children:I?u.jsx(qt,{className:"size-3.5 animate-spin"}):u.jsx(wm,{className:"size-3.5"})})}),u.jsx(tt,{side:"bottom",children:R??(I?"正在重试成员...":"重试成员")})]}):null]}):Xt?u.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[u.jsxs(it,{children:[u.jsx(ot,{asChild:!0,children:u.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[u.jsx(FD,{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:he})]})}),u.jsx(tt,{side:"bottom",children:m?.skipReason??"本次启动已跳过"})]}),mn?u.jsxs(it,{children:[u.jsx(ot,{asChild:!0,children:u.jsx("button",{type:"button","aria-label":I?"正在重试成员":"重试成员",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:I,onClick:jt,children:I?u.jsx(qt,{className:"size-3.5 animate-spin"}):u.jsx(wm,{className:"size-3.5"})})}),u.jsx(tt,{side:"bottom",children:R??(I?"正在重试成员...":"重试成员")})]}):null]}):Sn?u.jsxs(it,{children:[u.jsx(ot,{asChild:!0,children:u.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[u.jsx(Kn,{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:V})]})}),u.jsx(tt,{side:"bottom",children:Y??V})]}):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?"该成员已被移除":we,children:f?"已移除":he}),Ee?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:_e>0?`${be}/${_e} 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"]}),_e>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:`${re}%`}})})]}),!f&&u.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[u.jsxs(it,{children:[u.jsx(ot,{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:ze=>{ze.stopPropagation(),E?.()},children:u.jsx(da,{size:13})})}),u.jsx(tt,{side:"bottom",children:"发送消息"})]}),u.jsxs(it,{children:[u.jsx(ot,{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:ze=>{ze.stopPropagation(),w?.()},children:u.jsx(xl,{size:13})})}),u.jsx(tt,{side:"bottom",children:"分配任务"})]})]})]})]})})};function JFn(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 eYn(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 tYn(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 nYn(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 rYn(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 sYn(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 iYn(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 oYn(e,t){return JFn(e.members,t.members)&&eYn(e.memberTaskCounts,t.memberTaskCounts)&&tYn(e.taskMap,t.taskMap)&&nYn(e.pendingRepliesByMember,t.pendingRepliesByMember)&&rYn(e.memberSpawnStatuses,t.memberSpawnStatuses)&&iYn(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&&sYn(e.launchParams,t.launchParams)}const aYn=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(R=>{const $=R[0];$&&v($.contentRect.width>1e3)},[]);g.useEffect(()=>{const R=x.current;if(!R)return;const $=new ResizeObserver(T);return $.observe(R),()=>$.disconnect()},[T]);const E=S?"grid grid-cols-2 gap-1":"grid grid-cols-1 gap-1",w=g.useMemo(()=>t.filter(R=>!R.removedAt).sort((R,$)=>Gn(R)?-1:Gn($)?1:0),[t]),P=g.useMemo(()=>t.filter(R=>R.removedAt),[t]),k=g.useMemo(()=>to(t),[t]),C=g.useCallback((R,$,A)=>gnt(R,f,$,A),[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 I=g.useMemo(()=>{const R=new Map;if(!r)return R;for(const $ of r.values())$.reviewer&&($.reviewState==="review"||$.kanbanColumn==="review")&&R.set($.reviewer,$);return R},[r]),N=(R,$)=>{const A=R.currentTaskId&&r?r.get(R.currentTaskId)??null:null,j=I.get(R.name)??null,Q=j&&j.id!==R.currentTaskId?j:null,U=l!==!1&&!!s?.[R.name],M=i?.get(R.name),q=o?.get(R.name);return u.jsx(KFn,{member:R,memberColor:k.get(R.name)??"blue",taskCounts:n?.get(R.name.toLowerCase()),isTeamAlive:l,isTeamProvisioning:d,leadActivity:Gn(R)?p:void 0,currentTask:$?null:A,reviewTask:$?null:Q,isAwaitingReply:$?!1:U,isRemoved:$,runtimeSummary:C(R,$?void 0:M,$?void 0:q),runtimeEntry:$?void 0:q,runtimeRunId:$?void 0:a,spawnStatus:$?void 0:M?.status,spawnEntry:$?void 0:M,spawnError:$?void 0:M?.error??M?.hardFailureReason,spawnLivenessSource:$?void 0:M?.livenessSource,spawnLaunchState:$?void 0:M?.launchState,spawnRuntimeAlive:$?void 0:M?.runtimeAlive,isLaunchSettling:$?!1:c,onOpenTask:!$&&A?()=>_?.(A.id):void 0,onOpenReviewTask:!$&&Q?()=>_?.(Q.id):void 0,onClick:()=>h?.(R),onSendMessage:()=>m?.(R),onAssignTask:()=>O?.(R),onRestartMember:$?void 0:b,onSkipMemberForLaunch:$?void 0:y},R.name)};return u.jsxs("div",{ref:x,className:"flex flex-col gap-1",children:[u.jsx("div",{className:E,children:w.map(R=>N(R,!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(R=>N(R,!0))})]})]})},oYn),bnt=g.createContext({});function Nce(e){const t=g.useRef(null);return t.current===null&&(t.current=e()),t.current}const lYn=typeof window<"u",ynt=lYn?g.useLayoutEffect:g.useEffect,Ace=g.createContext(null);function Ice(e,t){e.indexOf(t)===-1&&e.push(t)}function tE(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Ff=(e,t,n)=>n>t?t:n<e?e:n;let Mce=()=>{};const __={},xnt=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Snt(e){return typeof e=="object"&&e!==null}const vnt=e=>/^0[^.\s]+$/u.test(e);function Tnt(e){let t;return()=>(t===void 0&&(t=e()),t)}const Ju=e=>e,cYn=(e,t)=>n=>t(e(n)),tA=(...e)=>e.reduce(cYn),nE=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Qce{constructor(){this.subscriptions=[]}add(t){return Ice(this.subscriptions,t),()=>tE(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 lc=e=>e*1e3,zu=e=>e/1e3;function Ent(e,t){return t?e*(1e3/t):0}const uYn=(e,t,n)=>{const r=t-e;return((n-e)%r+r)%r+e},wnt=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,dYn=1e-7,pYn=12;function fYn(e,t,n,r,s){let i,o,a=0;do o=t+(n-t)/2,i=wnt(o,r,s)-e,i>0?n=o:t=o;while(Math.abs(i)>dYn&&++a<pYn);return o}function nA(e,t,n,r){if(e===t&&n===r)return Ju;const s=i=>fYn(i,0,1,e,n);return i=>i===0||i===1?i:wnt(s(i),t,r)}const knt=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Cnt=e=>t=>1-e(1-t),Rnt=nA(.33,1.53,.69,.99),Dce=Cnt(Rnt),Pnt=knt(Dce),$nt=e=>e>=1?1:(e*=2)<1?.5*Dce(e):.5*(2-Math.pow(2,-10*(e-1))),Lce=e=>1-Math.sin(Math.acos(e)),Nnt=Cnt(Lce),Ant=knt(Lce),hYn=nA(.42,0,1,1),mYn=nA(0,0,.58,1),Int=nA(.42,0,.58,1),Mnt=e=>Array.isArray(e)&&typeof e[0]!="number";function Qnt(e,t){return Mnt(e)?e[uYn(0,e.length,t)]:e}const Dnt=e=>Array.isArray(e)&&typeof e[0]=="number",OYn={linear:Ju,easeIn:hYn,easeInOut:Int,easeOut:mYn,circIn:Lce,circInOut:Ant,circOut:Nnt,backIn:Dce,backInOut:Pnt,backOut:Rnt,anticipate:$nt},gYn=e=>typeof e=="string",bCe=e=>{if(Dnt(e)){Mce(e.length===4);const[t,n,r,s]=e;return nA(t,n,r,s)}else if(gYn(e))return OYn[e];return e},GM=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function _Yn(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 bYn=40;function Lnt(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=GM.reduce((x,S)=>(x[S]=_Yn(i),x),{}),{setup:a,read:c,resolveKeyframes:l,preUpdate:d,update:p,preRender:f,render:h,postRender:m}=o,O=()=>{const x=__.useManualTiming,S=x?s.timestamp:performance.now();n=!1,x||(s.delta=r?1e3/60:Math.max(Math.min(S-s.timestamp,bYn),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:GM.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<GM.length;S++)o[GM[S]].cancel(x)},state:s,steps:o}}const{schedule:ks,cancel:Bm,state:Zo,steps:K8}=Lnt(typeof requestAnimationFrame<"u"?requestAnimationFrame:Ju,!0);let K2;function yYn(){K2=void 0}const hl={now:()=>(K2===void 0&&hl.set(Zo.isProcessing||__.useManualTiming?Zo.timestamp:performance.now()),K2),set:e=>{K2=e,queueMicrotask(yYn)}},jnt=e=>t=>typeof t=="string"&&t.startsWith(e),Xnt=jnt("--"),xYn=jnt("var(--"),jce=e=>xYn(e)?SYn.test(e.split("/*")[0].trim()):!1,SYn=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function yCe(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const c1={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},t$={...c1,transform:e=>Ff(0,1,e)},HM={...c1,default:1},VC=e=>Math.round(e*1e5)/1e5,Xce=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function vYn(e){return e==null}const TYn=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Uce=(e,t)=>n=>!!(typeof n=="string"&&TYn.test(n)&&n.startsWith(e)||t&&!vYn(n)&&Object.prototype.hasOwnProperty.call(n,t)),Unt=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,a]=r.match(Xce);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},EYn=e=>Ff(0,255,e),J8={...c1,transform:e=>Math.round(EYn(e))},pb={test:Uce("rgb","red"),parse:Unt("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+J8.transform(e)+", "+J8.transform(t)+", "+J8.transform(n)+", "+VC(t$.transform(r))+")"};function wYn(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 Kee={test:Uce("#"),parse:wYn,transform:pb.transform},rA=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),NO=rA("deg"),Mf=rA("%"),tn=rA("px"),kYn=rA("vh"),CYn=rA("vw"),xCe={...Mf,parse:e=>Mf.parse(e)/100,transform:e=>Mf.transform(e*100)},qS={test:Uce("hsl","hue"),parse:Unt("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Mf.transform(VC(t))+", "+Mf.transform(VC(n))+", "+VC(t$.transform(r))+")"},Li={test:e=>pb.test(e)||Kee.test(e)||qS.test(e),parse:e=>pb.test(e)?pb.parse(e):qS.test(e)?qS.parse(e):Kee.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?pb.transform(e):qS.transform(e),getAnimatableNone:e=>{const t=Li.parse(e);return t.alpha=0,Li.transform(t)}},RYn=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function PYn(e){return isNaN(e)&&typeof e=="string"&&(e.match(Xce)?.length||0)+(e.match(RYn)?.length||0)>0}const znt="number",Bnt="color",$Yn="var",NYn="var(",SCe="${}",AYn=/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 rE(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const a=t.replace(AYn,c=>(Li.test(c)?(r.color.push(i),s.push(Bnt),n.push(Li.parse(c))):c.startsWith(NYn)?(r.var.push(i),s.push($Yn),n.push(c)):(r.number.push(i),s.push(znt),n.push(parseFloat(c))),++i,SCe)).split(SCe);return{values:n,split:a,indexes:r,types:s}}function IYn(e){return rE(e).values}function Fnt({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===znt?s+=VC(r[i]):o===Bnt?s+=Li.transform(r[i]):s+=r[i]}return s}}function MYn(e){return Fnt(rE(e))}const QYn=e=>typeof e=="number"?0:Li.test(e)?Li.getAnimatableNone(e):e,DYn=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:QYn(e);function LYn(e){const t=rE(e);return Fnt(t)(t.values.map((r,s)=>DYn(r,t.split[s])))}const ep={test:PYn,parse:IYn,createTransformer:MYn,getAnimatableNone:LYn};function e9(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 jYn({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=e9(c,a,e+1/3),i=e9(c,a,e),o=e9(c,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function kX(e,t){return n=>n>0?t:e}const js=(e,t,n)=>e+(t-e)*n,t9=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},XYn=[Kee,pb,qS],UYn=e=>XYn.find(t=>t.test(e));function vCe(e){const t=UYn(e);if(!t)return!1;let n=t.parse(e);return t===qS&&(n=jYn(n)),n}const TCe=(e,t)=>{const n=vCe(e),r=vCe(t);if(!n||!r)return kX(e,t);const s={...n};return i=>(s.red=t9(n.red,r.red,i),s.green=t9(n.green,r.green,i),s.blue=t9(n.blue,r.blue,i),s.alpha=js(n.alpha,r.alpha,i),pb.transform(s))},Jee=new Set(["none","hidden"]);function zYn(e,t){return Jee.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function BYn(e,t){return n=>js(e,t,n)}function zce(e){return typeof e=="number"?BYn:typeof e=="string"?jce(e)?kX:Li.test(e)?TCe:VYn:Array.isArray(e)?Ynt:typeof e=="object"?Li.test(e)?TCe:FYn:kX}function Ynt(e,t){const n=[...e],r=n.length,s=e.map((i,o)=>zce(i)(i,t[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function FYn(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=zce(e[s])(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function YYn(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 VYn=(e,t)=>{const n=ep.createTransformer(t),r=rE(e),s=rE(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?Jee.has(e)&&!s.values.length||Jee.has(t)&&!r.values.length?zYn(e,t):tA(Ynt(YYn(r,s),s.values),n):kX(e,t)};function Vnt(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?js(e,t,n):zce(e)(e,t)}const qYn=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>ks.update(t,n),stop:()=>Bm(t),now:()=>Zo.isProcessing?Zo.timestamp:hl.now()}},qnt=(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)})`},CX=2e4;function Bce(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<CX;)t+=n,r=e.next(t);return t>=CX?1/0:t}function Wnt(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(Bce(r),CX);return{type:"keyframes",ease:i=>r.next(s*i).value/t,duration:zu(s)}}const yi={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 ete(e,t){return e*Math.sqrt(1-t*t)}const WYn=12;function GYn(e,t,n){let r=n;for(let s=1;s<WYn;s++)r=r-e(r)/t(r);return r}const n9=.001;function HYn({duration:e=yi.duration,bounce:t=yi.bounce,velocity:n=yi.velocity,mass:r=yi.mass}){let s,i,o=1-t;o=Ff(yi.minDamping,yi.maxDamping,o),e=Ff(yi.minDuration,yi.maxDuration,zu(e)),o<1?(s=l=>{const d=l*o,p=d*e,f=d-n,h=ete(l,o),m=Math.exp(-p);return n9-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=ete(Math.pow(l,2),o);return(-s(l)+n9>0?-1:1)*((f-h)*m)/O}):(s=l=>{const d=Math.exp(-l*e),p=(l-n)*e+1;return-n9+d*p},i=l=>{const d=Math.exp(-l*e),p=(n-l)*(e*e);return d*p});const a=5/e,c=GYn(s,i,a);if(e=lc(e),isNaN(c))return{stiffness:yi.stiffness,damping:yi.damping,duration:e};{const l=Math.pow(c,2)*r;return{stiffness:l,damping:o*2*Math.sqrt(r*l),duration:e}}}const ZYn=["duration","bounce"],KYn=["stiffness","damping","mass"];function ECe(e,t){return t.some(n=>e[n]!==void 0)}function JYn(e){let t={velocity:yi.velocity,stiffness:yi.stiffness,damping:yi.damping,mass:yi.mass,isResolvedFromDuration:!1,...e};if(!ECe(e,KYn)&&ECe(e,ZYn))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Ff(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:yi.mass,stiffness:s,damping:i}}else{const n=HYn({...e,velocity:0});t={...t,...n,mass:yi.mass},t.isResolvedFromDuration=!0}return t}function n$(e=yi.visualDuration,t=yi.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}=JYn({...n,velocity:-zu(n.velocity||0)}),m=f||0,O=l/(2*Math.sqrt(c*d)),_=o-i,b=zu(Math.sqrt(c/d)),y=Math.abs(_)<5;r||(r=y?yi.restSpeed.granular:yi.restSpeed.default),s||(s=y?yi.restDelta.granular:yi.restDelta.default);let x,S,v,T,E,w;if(O<1)v=ete(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=R=>{const $=Math.exp(-O*b*R),A=Math.min(k*R,300);return o-$*((m+O*b*_)*Math.sinh(A)+k*_*Math.cosh(A))/k};const C=(m+O*b*_)/k,I=O*b*C-_*k,N=O*b*_-C*k;S=R=>{const $=Math.exp(-O*b*R),A=Math.min(k*R,300);return $*(I*Math.sinh(A)+N*Math.cosh(A))}}const P={calculatedDuration:h&&p||null,velocity:k=>lc(S(k)),next:k=>{if(!h&&O<1){const I=Math.exp(-O*b*k),N=Math.sin(v*k),R=Math.cos(v*k),$=o-I*(T*N+_*R),A=lc(I*(E*N+w*R));return a.done=Math.abs(A)<=r&&Math.abs(o-$)<=s,a.value=a.done?o:$,a}const C=x(k);if(h)a.done=k>=p;else{const I=lc(S(k));a.done=Math.abs(I)<=r&&Math.abs(o-C)<=s}return a.value=a.done?o:C,a},toString:()=>{const k=Math.min(Bce(P),CX),C=qnt(I=>P.next(k*I).value,k,30);return k+"ms "+C},toTransition:()=>{}};return P}n$.applyToOptions=e=>{const t=Wnt(e,100,n$);return e.ease=t.ease,e.duration=lc(t.duration),e.type="keyframes",e};const eVn=5;function Gnt(e,t,n){const r=Math.max(t-eVn,0);return Ent(n-e(r),t-r)}function tte({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=n$({keyframes:[f.value,m(f.value)],velocity:Gnt(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 tVn(e,t,n){const r=[],s=n||__.mix||Vnt,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]||Ju:t;a=tA(c,a)}r.push(a)}return r}function Hnt(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const i=e.length;if(Mce(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=tVn(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=nE(e[p],e[p+1],d);return a[p](f)};return n?d=>l(Ff(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=nE(0,t,r);e.push(js(n,1,s))}}function Knt(e){const t=[0];return Znt(t,e.length-1),t}function nVn(e,t){return e.map(n=>n*t)}function rVn(e,t){return e.map(()=>t||Int).splice(0,e.length-1)}function qC({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=Mnt(r)?r.map(bCe):bCe(r),i={done:!1,value:t[0]},o=nVn(n&&n.length===t.length?n:Knt(t),e),a=Hnt(o,t,{ease:Array.isArray(s)?s:rVn(t,s)});return{calculatedDuration:e,next:c=>(i.value=a(c),i.done=c>=e,i)}}const sVn=e=>e!==null;function jB(e,{repeat:t,repeatType:n="loop"},r,s=1){const i=e.filter(sVn),a=s<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const iVn={decay:tte,inertia:tte,tween:qC,keyframes:qC,spring:n$};function Jnt(e){typeof e.type=="string"&&(e.type=iVn[e.type])}class Fce{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 oVn=e=>e/100;class RX extends Fce{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!==hl.now()&&this.tick(hl.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;Jnt(t);const{type:n=qC,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=t;let{keyframes:a}=t;const c=n||qC;c!==qC&&typeof a[0]!="number"&&(this.mixKeyframes=tA(oVn,Vnt(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=Bce(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=Ff(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!==tte&&(v.value=jB(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 zu(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+zu(t)}get time(){return zu(this.currentTime)}set time(t){t=lc(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 Gnt(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(hl.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=zu(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=qYn,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(hl.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 aVn(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const fb=e=>e*180/Math.PI,nte=e=>{const t=fb(Math.atan2(e[1],e[0]));return rte(t)},lVn={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:nte,rotateZ:nte,skewX:e=>fb(Math.atan(e[1])),skewY:e=>fb(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},rte=e=>(e=e%360,e<0&&(e+=360),e),wCe=nte,kCe=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),CCe=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),cVn={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:kCe,scaleY:CCe,scale:e=>(kCe(e)+CCe(e))/2,rotateX:e=>rte(fb(Math.atan2(e[6],e[5]))),rotateY:e=>rte(fb(Math.atan2(-e[2],e[0]))),rotateZ:wCe,rotate:wCe,skewX:e=>fb(Math.atan(e[4])),skewY:e=>fb(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function ste(e){return e.includes("scale")?1:0}function ite(e,t){if(!e||e==="none")return ste(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=cVn,s=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=lVn,s=a}if(!s)return ste(t);const i=r[t],o=s[1].split(",").map(dVn);return typeof i=="function"?i(o):o[i]}const uVn=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return ite(n,t)};function dVn(e){return parseFloat(e.trim())}const u1=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],d1=new Set(u1),RCe=e=>e===c1||e===tn,pVn=new Set(["x","y","z"]),fVn=u1.filter(e=>!pVn.has(e));function hVn(e){const t=[];return fVn.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const yg={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})=>ite(t,"x"),y:(e,{transform:t})=>ite(t,"y")};yg.translateX=yg.x;yg.translateY=yg.y;const Ib=new Set;let ote=!1,ate=!1,lte=!1;function ert(){if(ate){const e=Array.from(Ib).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=hVn(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)})}ate=!1,ote=!1,Ib.forEach(e=>e.complete(lte)),Ib.clear()}function trt(){Ib.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ate=!0)})}function mVn(){lte=!0,trt(),ert(),lte=!1}class Yce{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?(Ib.add(this),ote||(ote=!0,ks.read(trt),ks.resolveKeyframes(ert))):(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])}aVn(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Ib.delete(this)}cancel(){this.state==="scheduled"&&(Ib.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const OVn=e=>e.startsWith("--");function nrt(e,t,n){OVn(t)?e.style.setProperty(t,n):e.style[t]=n}const gVn={};function rrt(e,t){const n=Tnt(e);return()=>gVn[t]??n()}const _Vn=rrt(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),srt=rrt(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),kk=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,PCe={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:kk([0,.65,.55,1]),circOut:kk([.55,0,1,.45]),backIn:kk([.31,.01,.66,-.59]),backOut:kk([.33,1.53,.69,.99])};function irt(e,t){if(e)return typeof e=="function"?srt()?qnt(e,t):"ease-out":Dnt(e)?kk(e):Array.isArray(e)?e.map(n=>irt(n,t)||PCe.easeOut):PCe[e]}function bVn(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=irt(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 Vce(e){return typeof e=="function"&&"applyToOptions"in e}function yVn({type:e,...t}){return Vce(e)&&srt()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class ort extends Fce{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,Mce(typeof t.type!="string");const l=yVn(t);this.animation=bVn(n,r,s,l,i),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const d=jB(s,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(d),nrt(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 zu(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+zu(t)}get time(){return zu(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=lc(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&&_Vn()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),Ju):s(this)}}const art={anticipate:$nt,backInOut:Pnt,circInOut:Ant};function xVn(e){return e in art}function SVn(e){typeof e.ease=="string"&&xVn(e.ease)&&(e.ease=art[e.ease])}const r9=10;class vVn extends ort{constructor(t){SVn(t),Jnt(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 RX({...o,autoplay:!1}),c=Math.max(r9,hl.now()-this.startTime),l=Ff(0,r9,c-r9),d=a.sample(c).value,{name:p}=this.options;i&&p&&nrt(i,p,d),n.setWithVelocity(a.sample(Math.max(0,c-l)).value,d,l),a.stop()}}const $Ce=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ep.test(e)||e==="0")&&!e.startsWith("url("));function TVn(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 EVn(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=$Ce(s,t),a=$Ce(i,t);return!o||!a?!1:TVn(e)||(n==="spring"||Vce(n))&&r}function cte(e){e.duration=0,e.type="keyframes"}const lrt=new Set(["opacity","clipPath","filter","transform"]),wVn=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function kVn(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&wVn.test(e[t]))return!0;return!1}const CVn=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),RVn=Tnt(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function PVn(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 RVn()&&n&&(lrt.has(n)||CVn.has(n)&&kVn(a))&&(n!=="transform"||!d)&&!l&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const $Vn=40;class NVn extends Fce{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=hl.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||Yce;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=hl.now();let p=!0;EVn(t,i,o,a)||(p=!1,(__.instantAnimations||!c)&&d?.(jB(t,r,n)),t[0]=t[t.length-1],cte(r),r.repeat=0);const h={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>$Vn?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},m=p&&!l&&PVn(h),O=h.motionValue?.owner?.current;let _;if(m)try{_=new vVn({...h,element:O})}catch{_=new RX(h)}else _=new RX(h);_.finished.then(()=>{this.notifyFinished()}).catch(Ju),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(),mVn()),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 AVn{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 NCe(this.animations,"duration")}get iterationDuration(){return NCe(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 NCe(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 IVn extends AVn{then(t,n){return this.finished.finally(t).then(()=>{})}}function crt(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 MVn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function QVn(e){const t=MVn.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function urt(e,t,n=1){const[r,s]=QVn(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const o=i.trim();return xnt(o)?parseFloat(o):o}return jce(s)?urt(s,t,n+1):s}const DVn={type:"spring",stiffness:500,damping:25,restSpeed:10},LVn=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),jVn={type:"keyframes",duration:.8},XVn={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},UVn=(e,{keyframes:t})=>t.length>2?jVn:d1.has(e)?e.startsWith("scale")?LVn(t[1]):DVn:XVn;function drt(e,t){if(e?.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function qce(e,t){const n=e?.[t]??e?.default??e;return n!==e?drt(n,e):n}const zVn=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function BVn(e){for(const t in e)if(!zVn.has(t))return!0;return!1}const Wce=(e,t,n,r={},s,i)=>o=>{const a=qce(r,e)||{},c=a.delay||r.delay||0;let{elapsed:l=0}=r;l=l-lc(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};BVn(a)||Object.assign(d,UVn(e,d)),d.duration&&(d.duration=lc(d.duration)),d.repeatDelay&&(d.repeatDelay=lc(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let p=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(cte(d),d.delay===0&&(p=!0)),(__.instantAnimations||__.skipAnimations||s?.shouldSkipAnimations)&&(p=!0,cte(d),d.delay=0),d.allowFlatten=!a.type&&!a.ease,p&&!i&&t.get()!==void 0){const f=jB(d.keyframes,a);if(f!==void 0){ks.update(()=>{d.onUpdate(f),d.onComplete()});return}}return a.isSync?new RX(d):new NVn(d)};function ACe(e){const t=[{},{}];return e?.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Gce(e,t,n,r){if(typeof t=="function"){const[s,i]=ACe(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]=ACe(r);t=t(n!==void 0?n:e.custom,s,i)}return t}function Mb(e,t,n){const r=e.getProps();return Gce(r,t,n!==void 0?n:r.custom,e)}const prt=new Set(["width","height","top","left","right","bottom",...u1]),ICe=30,FVn=e=>!isNaN(parseFloat(e)),WC={current:void 0};class YVn{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const s=hl.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=hl.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=FVn(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 Qce);const r=this.events[t].add(n);return t==="change"?()=>{r(),ks.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 WC.current&&WC.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=hl.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>ICe)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ICe);return Ent(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 b_(e,t){return new YVn(e,t)}const ute=e=>Array.isArray(e);function VVn(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,b_(n))}function qVn(e){return ute(e)?e[e.length-1]||0:e}function WVn(e,t){const n=Mb(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const a=qVn(i[o]);VVn(e,o,a)}}const fo=e=>!!(e&&e.getVelocity);function GVn(e){return!!(fo(e)&&e.add)}function dte(e,t){const n=e.getValue("willChange");if(GVn(n))return n.add(t);if(!n&&__.WillChange){const r=new __.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Hce(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const HVn="framerAppearId",frt="data-"+Hce(HVn);function hrt(e){return e.props[frt]}function ZVn({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?drt(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&&ZVn(p,f))continue;const O={delay:n,...qce(i||{},f)},_=h.get();if(_!==void 0&&!h.isAnimating()&&!Array.isArray(m)&&m===_&&!O.velocity){ks.update(()=>h.set(m));continue}let b=!1;if(window.MotionHandoffAnimation){const S=hrt(e);if(S){const v=window.MotionHandoffAnimation(S,f,ks);v!==null&&(O.startTime=v,b=!0)}}dte(e,f);const y=l??e.shouldReduceMotion;h.start(Wce(f,h,m,y&&prt.has(f)?{type:!1}:O,e,b));const x=h.animation;x&&d.push(x)}if(o){const f=()=>ks.update(()=>{o&&WVn(e,o)});d.length?Promise.all(d).then(f):f()}return d}function pte(e,t,n={}){const r=Mb(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 KVn(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 KVn(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(pte(c,t,{...o,delay:n+(typeof r=="function"?0:r)+crt(e.variantChildren,c,r,s,i)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(a)}function JVn(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>pte(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=pte(e,t,n);else{const s=typeof t=="function"?Mb(e,t,n.custom):t;r=Promise.all(Zce(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const eqn={test:e=>e==="auto",parse:e=>e},mrt=e=>t=>t.test(e),Ort=[c1,tn,Mf,NO,CYn,kYn,eqn],MCe=e=>Ort.find(mrt(e));function tqn(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||vnt(e):!0}const nqn=new Set(["brightness","contrast","saturate","opacity"]);function rqn(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Xce)||[];if(!r)return e;const s=n.replace(r,"");let i=nqn.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const sqn=/\b([a-z-]*)\(.*?\)/gu,fte={...ep,getAnimatableNone:e=>{const t=e.match(sqn);return t?t.map(rqn).join(" "):e}},hte={...ep,getAnimatableNone:e=>{const t=ep.parse(e);return ep.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},QCe={...c1,transform:Math.round},iqn={rotate:NO,rotateX:NO,rotateY:NO,rotateZ:NO,scale:HM,scaleX:HM,scaleY:HM,scaleZ:HM,skew:NO,skewX:NO,skewY:NO,distance:tn,translateX:tn,translateY:tn,translateZ:tn,x:tn,y:tn,z:tn,perspective:tn,transformPerspective:tn,opacity:t$,originX:xCe,originY:xCe,originZ:tn},Kce={borderWidth:tn,borderTopWidth:tn,borderRightWidth:tn,borderBottomWidth:tn,borderLeftWidth:tn,borderRadius:tn,borderTopLeftRadius:tn,borderTopRightRadius:tn,borderBottomRightRadius:tn,borderBottomLeftRadius:tn,width:tn,maxWidth:tn,height:tn,maxHeight:tn,top:tn,right:tn,bottom:tn,left:tn,inset:tn,insetBlock:tn,insetBlockStart:tn,insetBlockEnd:tn,insetInline:tn,insetInlineStart:tn,insetInlineEnd:tn,padding:tn,paddingTop:tn,paddingRight:tn,paddingBottom:tn,paddingLeft:tn,paddingBlock:tn,paddingBlockStart:tn,paddingBlockEnd:tn,paddingInline:tn,paddingInlineStart:tn,paddingInlineEnd:tn,margin:tn,marginTop:tn,marginRight:tn,marginBottom:tn,marginLeft:tn,marginBlock:tn,marginBlockStart:tn,marginBlockEnd:tn,marginInline:tn,marginInlineStart:tn,marginInlineEnd:tn,fontSize:tn,backgroundPositionX:tn,backgroundPositionY:tn,...iqn,zIndex:QCe,fillOpacity:t$,strokeOpacity:t$,numOctaves:QCe},oqn={...Kce,color:Li,backgroundColor:Li,outlineColor:Li,fill:Li,stroke:Li,borderColor:Li,borderTopColor:Li,borderRightColor:Li,borderBottomColor:Li,borderLeftColor:Li,filter:fte,WebkitFilter:fte,mask:hte,WebkitMask:hte},grt=e=>oqn[e],aqn=new Set([fte,hte]);function _rt(e,t){let n=grt(e);return aqn.has(n)||(n=ep),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const lqn=new Set(["auto","none","0"]);function cqn(e,t,n){let r=0,s;for(;r<e.length&&!s;){const i=e[r];typeof i=="string"&&!lqn.has(i)&&rE(i).values.length&&(s=e[r]),r++}if(s&&n)for(const i of t)e[i]=_rt(n,s)}class uqn extends Yce{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(),jce(p))){const f=urt(p,n.current);f!==void 0&&(t[d]=f),d===t.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!prt.has(r)||t.length!==2)return;const[s,i]=t,o=MCe(s),a=MCe(i),c=yCe(s),l=yCe(i);if(c!==l&&yg[r]){this.needsMeasurement=!0;return}if(o!==a)if(RCe(o)&&RCe(a))for(let d=0;d<t.length;d++){const p=t[d];typeof p=="string"&&(t[d]=parseFloat(p))}else yg[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||tqn(t[s]))&&r.push(s);r.length&&cqn(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=yg[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]=yg[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 Jce(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 brt=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function dqn(e){return Snt(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:eue}=Lnt(queueMicrotask,!1),Ed={x:!1,y:!1};function yrt(){return Ed.x||Ed.y}function pqn(e){return e==="x"||e==="y"?Ed[e]?null:(Ed[e]=!0,()=>{Ed[e]=!1}):Ed.x||Ed.y?null:(Ed.x=Ed.y=!0,()=>{Ed.x=Ed.y=!1})}function xrt(e,t){const n=Jce(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function fqn(e){return!(e.pointerType==="touch"||yrt())}function hqn(e,t,n={}){const[r,s,i]=xrt(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(!fqn(_))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 Srt=(e,t)=>t?e===t?!0:Srt(e,t.parentElement):!1,tue=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,mqn=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Oqn(e){return mqn.has(e.tagName)||e.isContentEditable===!0}const gqn=new Set(["INPUT","SELECT","TEXTAREA"]);function _qn(e){return gqn.has(e.tagName)||e.isContentEditable===!0}const J2=new WeakSet;function DCe(e){return t=>{t.key==="Enter"&&e(t)}}function s9(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const bqn=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=DCe(()=>{if(J2.has(n))return;s9(n,"down");const s=DCe(()=>{s9(n,"up")}),i=()=>s9(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 LCe(e){return tue(e)&&!yrt()}const jCe=new WeakSet;function yqn(e,t,n={}){const[r,s,i]=xrt(e,n),o=a=>{const c=a.currentTarget;if(!LCe(a)||jCe.has(a))return;J2.add(c),n.stopPropagation&&jCe.add(a);const l=t(c,a),d=(h,m)=>{window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",f),J2.has(c)&&J2.delete(c),LCe(h)&&typeof l=="function"&&l(h,{success:m})},p=h=>{d(h,c===window||c===document||n.useGlobalTarget||Srt(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),dqn(a)&&(a.addEventListener("focus",l=>bqn(l,s)),!Oqn(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}function XB(e){return Snt(e)&&"ownerSVGElement"in e}const eD=new WeakMap;let tD;const vrt=(e,t,n)=>(r,s)=>s&&s[0]?s[0][e+"Size"]:XB(r)&&"getBBox"in r?r.getBBox()[t]:r[n],xqn=vrt("inline","width","offsetWidth"),Sqn=vrt("block","height","offsetHeight");function vqn({target:e,borderBoxSize:t}){eD.get(e)?.forEach(n=>{n(e,{get width(){return xqn(e,t)},get height(){return Sqn(e,t)}})})}function Tqn(e){e.forEach(vqn)}function Eqn(){typeof ResizeObserver>"u"||(tD=new ResizeObserver(Tqn))}function wqn(e,t){tD||Eqn();const n=Jce(e);return n.forEach(r=>{let s=eD.get(r);s||(s=new Set,eD.set(r,s)),s.add(t),tD?.observe(r)}),()=>{n.forEach(r=>{const s=eD.get(r);s?.delete(t),s?.size||tD?.unobserve(r)})}}const nD=new Set;let WS;function kqn(){WS=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};nD.forEach(t=>t(e))},window.addEventListener("resize",WS)}function Cqn(e){return nD.add(e),WS||kqn(),()=>{nD.delete(e),!nD.size&&typeof WS=="function"&&(window.removeEventListener("resize",WS),WS=void 0)}}function XCe(e,t){return typeof e=="function"?Cqn(e):wqn(e,t)}function Trt(e){return XB(e)&&e.tagName==="svg"}function rD(...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=Hnt(s,i,o);return t?a(r):a}const Rqn=[...Ort,Li,ep],Pqn=e=>Rqn.find(mrt(e)),UCe=()=>({translate:0,scale:1,origin:0,originPoint:0}),GS=()=>({x:UCe(),y:UCe()}),zCe=()=>({min:0,max:0}),Di=()=>({x:zCe(),y:zCe()}),r$=new WeakMap;function UB(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function s$(e){return typeof e=="string"||Array.isArray(e)}const nue=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],rue=["initial",...nue];function zB(e){return UB(e.animate)||rue.some(t=>s$(e[t]))}function Ert(e){return!!(zB(e)||e.variants)}function $qn(e,t,n){for(const r in t){const s=t[r],i=n[r];if(fo(s))e.addValue(r,s);else if(fo(i))e.addValue(r,b_(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,b_(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const PX={current:null},sue={current:!1},Nqn=typeof window<"u";function wrt(){if(sue.current=!0,!!Nqn)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>PX.current=e.matches;e.addEventListener("change",t),t()}else PX.current=!1}const BCe=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let $X={};function krt(e){$X=e}function Aqn(){return $X}class Crt{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=Yce,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=hl.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,ks.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=zB(n),this.isVariantNode=Ert(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&&fo(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,r$.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:(sue.current||wrt(),this.shouldReduceMotion=PX.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(),Bm(this.notifyUpdate),Bm(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&&lrt.has(t)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:c,ease:l,duration:d}=n.accelerate,p=new ort({element:this.current,name:t,keyframes:a,times:c,ease:l,duration:lc(d)}),f=o(p);this.valueSubscriptions.set(t,()=>{f(),p.cancel()});return}const r=d1.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&ks.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 $X){const n=$X[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):Di()}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<BCe.length;r++){const s=BCe[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=$qn(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=b_(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"&&(xnt(r)||vnt(r))?r=parseFloat(r):!Pqn(r)&&ep.test(n)&&(r=_rt(t,n)),this.setBaseTarget(t,fo(r)?r.get():r)),fo(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=Gce(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&&!fo(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 Qce),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){eue.render(this.render)}}class Rrt extends Crt{constructor(){super(...arguments),this.KeyframeResolver=uqn}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;fo(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class B_{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Prt({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Iqn({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Mqn(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 i9(e){return e===void 0||e===1}function mte({scale:e,scaleX:t,scaleY:n}){return!i9(e)||!i9(t)||!i9(n)}function R0(e){return mte(e)||$rt(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function $rt(e){return FCe(e.x)||FCe(e.y)}function FCe(e){return e&&e!=="0%"}function NX(e,t,n){const r=e-n,s=t*r;return n+s}function YCe(e,t,n,r,s){return s!==void 0&&(e=NX(e,s,r)),NX(e,n,r)+t}function Ote(e,t=0,n=1,r,s){e.min=YCe(e.min,t,n,r,s),e.max=YCe(e.max,t,n,r,s)}function Nrt(e,{x:t,y:n}){Ote(e.x,t.translate,t.scale,t.originPoint),Ote(e.y,n.translate,n.scale,n.originPoint)}const VCe=.999999999999,qCe=1.0000000000001;function Qqn(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&&(rf(e.x,-i.scroll.offset.x),rf(e.y,-i.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Nrt(e,o)),r&&R0(i.latestValues)&&sD(e,i.latestValues,i.layout?.layoutBox))}t.x<qCe&&t.x>VCe&&(t.x=1),t.y<qCe&&t.y>VCe&&(t.y=1)}function rf(e,t){e.min+=t,e.max+=t}function WCe(e,t,n,r,s=.5){const i=js(e.min,e.max,s);Ote(e,t,n,i,r)}function GCe(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function sD(e,t,n){const r=n??e;WCe(e.x,GCe(t.x,r.x),t.scaleX,t.scale,t.originX),WCe(e.y,GCe(t.y,r.y),t.scaleY,t.scale,t.originY)}function Art(e,t){return Prt(Mqn(e.getBoundingClientRect(),t))}function Dqn(e,t,n){const r=Art(e,n),{scroll:s}=t;return s&&(rf(r.x,s.offset.x),rf(r.y,s.offset.y)),r}const Lqn={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},jqn=u1.length;function Xqn(e,t,n){let r="",s=!0;for(let i=0;i<jqn;i++){const o=u1[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=brt(a,Kce[o]);if(!c){s=!1;const d=Lqn[o]||o;r+=`${d}(${l}) `}n&&(t[o]=l)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function iue(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(d1.has(c)){o=!0;continue}else if(Xnt(c)){s[c]=l;continue}else{const d=brt(l,Kce[c]);c.startsWith("origin")?(a=!0,i[c]=d):r[c]=d}}if(t.transform||(o||n?r.transform=Xqn(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 Irt(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 HCe(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Mw={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(tn.test(e))e=parseFloat(e);else return e;const n=HCe(e,t.target.x),r=HCe(e,t.target.y);return`${n}% ${r}%`}},Uqn={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=ep.parse(e);if(s.length>5)return r;const i=ep.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=js(a,c,.5);return typeof s[2+o]=="number"&&(s[2+o]/=l),typeof s[3+o]=="number"&&(s[3+o]/=l),i(s)}},gte={borderRadius:{...Mw,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Mw,borderTopRightRadius:Mw,borderBottomLeftRadius:Mw,borderBottomRightRadius:Mw,boxShadow:Uqn};function Mrt(e,{layout:t,layoutId:n}){return d1.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!gte[e]||e==="opacity")}function oue(e,t,n){const r=e.style,s=t?.style,i={};if(!r)return i;for(const o in r)(fo(r[o])||s&&fo(s[o])||Mrt(o,e)||n?.getValue(o)?.liveStyle!==void 0)&&(i[o]=r[o]);return i}function zqn(e){return window.getComputedStyle(e)}class Qrt extends Rrt{constructor(){super(...arguments),this.type="html",this.renderInstance=Irt}readValueFromInstance(t,n){if(d1.has(n))return this.projection?.isProjecting?ste(n):uVn(t,n);{const r=zqn(t),s=(Xnt(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Art(t,n)}build(t,n,r){iue(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return oue(t,n,r)}}function Bqn(e,t){return e in t}class Fqn extends Crt{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,n){if(Bqn(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 Di()}build(t,n){Object.assign(t.output,n)}renderInstance(t,{output:n}){Object.assign(t,n)}sortInstanceNodePosition(){return 0}}const Yqn={offset:"stroke-dashoffset",array:"stroke-dasharray"},Vqn={offset:"strokeDashoffset",array:"strokeDasharray"};function qqn(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?Yqn:Vqn;e[i.offset]=`${-r}`,e[i.array]=`${t} ${n}`}const Wqn=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Drt(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...a},c,l,d){if(iue(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 Wqn)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&&qqn(p,s,i,o,!1)}const Lrt=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"]),jrt=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Gqn(e,t,n,r){Irt(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(Lrt.has(s)?s:Hce(s),t.attrs[s])}function Xrt(e,t,n){const r=oue(e,t,n);for(const s in e)if(fo(e[s])||fo(t[s])){const i=u1.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}class Urt extends Rrt{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Di}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(d1.has(n)){const r=grt(n);return r&&r.default||0}return n=Lrt.has(n)?n:Hce(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Xrt(t,n,r)}build(t,n,r){Drt(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){Gqn(t,n,r,s)}mount(t){this.isSVGTag=jrt(t.tagName),super.mount(t)}}const Hqn=rue.length;function zrt(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?zrt(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Hqn;n++){const r=rue[n],s=e.props[r];(s$(s)||s===!1)&&(t[r]=s)}return t}function Brt(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 Zqn=[...nue].reverse(),Kqn=nue.length;function Jqn(e){return t=>Promise.all(t.map(({animation:n,options:r})=>JVn(e,n,r)))}function e6n(e){let t=Jqn(e),n=ZCe(),r=!0,s=!1;const i=l=>(d,p)=>{const f=Mb(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=zrt(e.parent)||{},f=[],h=new Set;let m={},O=1/0;for(let b=0;b<Kqn;b++){const y=Zqn[b],x=n[y],S=d[y]!==void 0?d[y]:p[y],v=s$(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||UB(S)||typeof S=="boolean")continue;if(y==="exit"&&x.isActive&&T!==!0){x.prevResolvedValues&&(m={...m,...x.prevResolvedValues});continue}const w=t6n(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 I=C.reduce(i(y),{});T===!1&&(I={});const{prevResolvedValues:N={}}=x,R={...N,...I},$=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 R){const U=I[Q],M=N[Q];if(m.hasOwnProperty(Q))continue;let q=!1;ute(U)&&ute(M)?q=!Brt(U,M):q=U!==M,q?U!=null?$(Q):h.add(Q):U!==void 0&&h.has(Q)?$(Q):x.protectedKeys[Q]=!0}x.prevProp=S,x.prevResolvedValues=I,x.isActive&&(m={...m,...I}),(r||s)&&e.blockInitialAnimation&&(P=!1);const A=E&&w;P&&(!A||k)&&f.push(...C.map(Q=>{const U={type:y};if(typeof Q=="string"&&(r||s)&&!A&&e.manuallyAnimateOnMount&&e.parent){const{parent:M}=e,q=Mb(M,Q);if(M.enteringChildren&&q){const{delayChildren:z}=q.transition||{};U.delay=crt(M.enteringChildren,e,z)}}return{animation:Q,options:U}}))}if(h.size){const b={};if(typeof d.initial!="boolean"){const y=Mb(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=ZCe(),s=!0}}}function t6n(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Brt(t,e):!1}function h0(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ZCe(){return{animate:h0(!0),whileInView:h0(),whileHover:h0(),whileTap:h0(),whileDrag:h0(),whileFocus:h0(),exit:h0()}}function _te(e,t){e.min=t.min,e.max=t.max}function _d(e,t){_te(e.x,t.x),_te(e.y,t.y)}function KCe(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const Frt=1e-4,n6n=1-Frt,r6n=1+Frt,Yrt=.01,s6n=0-Yrt,i6n=0+Yrt;function ml(e){return e.max-e.min}function o6n(e,t,n){return Math.abs(e-t)<=n}function JCe(e,t,n,r=.5){e.origin=r,e.originPoint=js(t.min,t.max,e.origin),e.scale=ml(n)/ml(t),e.translate=js(n.min,n.max,e.origin)-e.originPoint,(e.scale>=n6n&&e.scale<=r6n||isNaN(e.scale))&&(e.scale=1),(e.translate>=s6n&&e.translate<=i6n||isNaN(e.translate))&&(e.translate=0)}function GC(e,t,n,r){JCe(e.x,t.x,n.x,r?r.originX:void 0),JCe(e.y,t.y,n.y,r?r.originY:void 0)}function eRe(e,t,n,r=0){const s=r?js(n.min,n.max,r):n.min;e.min=s+t.min,e.max=e.min+ml(t)}function a6n(e,t,n,r){eRe(e.x,t.x,n.x,r?.x),eRe(e.y,t.y,n.y,r?.y)}function tRe(e,t,n,r=0){const s=r?js(n.min,n.max,r):n.min;e.min=t.min-s,e.max=e.min+ml(t)}function AX(e,t,n,r){tRe(e.x,t.x,n.x,r?.x),tRe(e.y,t.y,n.y,r?.y)}function nRe(e,t,n,r,s){return e-=t,e=NX(e,1/n,r),s!==void 0&&(e=NX(e,1/s,r)),e}function l6n(e,t=0,n=1,r=.5,s,i=e,o=e){if(Mf.test(t)&&(t=parseFloat(t),t=js(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=js(i.min,i.max,r);e===i&&(a-=t),e.min=nRe(e.min,t,n,a,s),e.max=nRe(e.max,t,n,a,s)}function rRe(e,t,[n,r,s],i,o){l6n(e,t[n],t[r],t[s],t.scale,i,o)}const c6n=["x","scaleX","originX"],u6n=["y","scaleY","originY"];function sRe(e,t,n,r){rRe(e.x,t,c6n,n?n.x:void 0,r?r.x:void 0),rRe(e.y,t,u6n,n?n.y:void 0,r?r.y:void 0)}function iRe(e){return e.translate===0&&e.scale===1}function Vrt(e){return iRe(e.x)&&iRe(e.y)}function oRe(e,t){return e.min===t.min&&e.max===t.max}function d6n(e,t){return oRe(e.x,t.x)&&oRe(e.y,t.y)}function aRe(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function qrt(e,t){return aRe(e.x,t.x)&&aRe(e.y,t.y)}function lRe(e){return ml(e.x)/ml(e.y)}function cRe(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Zp(e){return[e("x"),e("y")]}function p6n(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 Wrt=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],f6n=Wrt.length,uRe=e=>typeof e=="string"?parseFloat(e):e,dRe=e=>typeof e=="number"||tn.test(e);function h6n(e,t,n,r,s,i){s?(e.opacity=js(0,n.opacity??1,m6n(r)),e.opacityExit=js(t.opacity??1,0,O6n(r))):i&&(e.opacity=js(t.opacity??1,n.opacity??1,r));for(let o=0;o<f6n;o++){const a=Wrt[o];let c=pRe(t,a),l=pRe(n,a);if(c===void 0&&l===void 0)continue;c||(c=0),l||(l=0),c===0||l===0||dRe(c)===dRe(l)?(e[a]=Math.max(js(uRe(c),uRe(l),r),0),(Mf.test(l)||Mf.test(c))&&(e[a]+="%")):e[a]=l}(t.rotate||n.rotate)&&(e.rotate=js(t.rotate||0,n.rotate||0,r))}function pRe(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const m6n=Grt(0,.5,Nnt),O6n=Grt(.5,.95,Ju);function Grt(e,t,n){return r=>r<e?0:r>t?1:n(nE(e,t,r))}function Hrt(e,t,n){const r=fo(e)?e:b_(e);return r.start(Wce("",r,t,n)),r.animation}function i$(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const g6n=(e,t)=>e.depth-t.depth;class _6n{constructor(){this.children=[],this.isDirty=!1}add(t){Ice(this.children,t),this.isDirty=!0}remove(t){tE(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(g6n),this.isDirty=!1,this.children.forEach(t)}}function b6n(e,t){const n=hl.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(Bm(r),e(i-t))};return ks.setup(r,!0),()=>Bm(r)}function iD(e){return fo(e)?e.get():e}class y6n{constructor(){this.members=[]}add(t){Ice(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&&(tE(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(tE(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 oD={hasAnimatedSinceResize:!0,hasEverUpdated:!1},o9=["","X","Y","Z"],x6n=1e3;let S6n=0;function a9(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=hrt(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ks,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Zrt(r)}function Krt({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=t?.()){this.id=S6n++,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(E6n),this.nodes.forEach($6n),this.nodes.forEach(N6n),this.nodes.forEach(w6n)},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 _6n)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Qce),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=XB(o)&&!Trt(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;ks.read(()=>{p=window.innerWidth}),e(o,()=>{const h=window.innerWidth;h!==p&&(p=h,this.root.updateBlockedByResize=!0,d&&d(),d=b6n(f,250),oD.hasAnimatedSinceResize&&(oD.hasAnimatedSinceResize=!1,this.nodes.forEach(mRe)))})}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()||D6n,{onLayoutAnimationStart:O,onLayoutAnimationComplete:_}=l.getProps(),b=!this.targetLayout||!qrt(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={...qce(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||mRe(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(),Bm(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(A6n),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(C6n),this.nodes.forEach(fRe);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(hRe);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(R6n),this.nodes.forEach(P6n),this.nodes.forEach(v6n),this.nodes.forEach(T6n)):this.nodes.forEach(hRe),this.clearAllSnapshots();const a=hl.now();Zo.delta=Ff(0,1e3/60,a-Zo.timestamp),Zo.timestamp=a,Zo.isProcessing=!0,K8.update.process(Zo),K8.preRender.process(Zo),K8.render.process(Zo),Zo.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,eue.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(k6n),this.sharedNodes.forEach(I6n)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ks.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ks.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ml(this.snapshot.measuredBox.x)&&!ml(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=Di()),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&&!Vrt(this.projectionDelta),c=this.getTransformTemplate(),l=c?c(this.latestValues,""):void 0,d=l!==this.prevTransformTemplateValue;o&&this.instance&&(a||R0(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)),L6n(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return Di();const a=o.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(j6n))){const{scroll:l}=this.root;l&&(rf(a.x,l.offset.x),rf(a.y,l.offset.y))}return a}removeElementScroll(o){const a=Di();if(_d(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&&_d(a,o),rf(a.x,d.offset.x),rf(a.y,d.offset.y))}return a}applyTransform(o,a=!1,c){const l=c||Di();_d(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&&(rf(l.x,-p.scroll.offset.x),rf(l.y,-p.scroll.offset.y)),R0(p.latestValues)&&sD(l,p.latestValues,p.layout?.layoutBox)}return R0(this.latestValues)&&sD(l,this.latestValues,this.layout?.layoutBox),l}removeTransform(o){const a=Di();_d(a,o);for(let c=0;c<this.path.length;c++){const l=this.path[c];if(!R0(l.latestValues))continue;let d;l.instance&&(mte(l.latestValues)&&l.updateSnapshot(),d=Di(),_d(d,l.measurePageBox())),sRe(a,l.latestValues,l.snapshot?.layoutBox,d)}return R0(this.latestValues)&&sRe(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!==Zo.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=Zo.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=Di(),this.targetWithTransforms=Di()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),a6n(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):_d(this.target,this.layout.layoutBox),Nrt(this.target,this.targetDelta)):_d(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||mte(this.parent.latestValues)||$rt(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=Di(),this.relativeTargetOrigin=Di(),AX(this.relativeTargetOrigin,a,c,this.options.layoutAnchor||void 0),_d(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===Zo.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;_d(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,f=this.treeScale.y;Qqn(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=Di());const{target:h}=o;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(KCe(this.prevProjectionDelta.x,this.projectionDelta.x),KCe(this.prevProjectionDelta.y,this.projectionDelta.y)),GC(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==f||!cRe(this.projectionDelta.x,this.prevProjectionDelta.x)||!cRe(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=GS(),this.projectionDelta=GS(),this.projectionDeltaWithTransform=GS()}setAnimationOrigin(o,a=!1){const c=this.snapshot,l=c?c.latestValues:{},d={...this.latestValues},p=GS();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=Di(),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(Q6n));this.animationProgress=0;let x;this.mixTargetDelta=S=>{const v=S/1e3;ORe(p.x,o.x,v),ORe(p.y,o.y,v),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(AX(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),M6n(this.relativeTarget,this.relativeTargetOrigin,f,v),x&&d6n(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=Di()),_d(x,this.relativeTarget)),O&&(this.animationValues=d,h6n(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&&(Bm(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ks.update(()=>{oD.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=b_(0)),this.motionValue.jump(0,!1),this.currentAnimation=Hrt(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(x6n),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&&Jrt(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||Di();const p=ml(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+p;const f=ml(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+f}_d(a,c),sD(a,d),GC(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new y6n),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&&a9("z",o,l,this.animationValues);for(let d=0;d<o9.length;d++)a9(`rotate${o9[d]}`,o,l,this.animationValues),a9(`skew${o9[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=iD(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=iD(a?.pointerEvents)||""),this.hasProjected&&!R0(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const d=l.animationValues||l.latestValues;this.applyTransformsToTarget();let p=p6n(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 gte){if(d[m]===void 0)continue;const{correct:O,applyTo:_,isCSSVariable:b}=gte[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?iD(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>o.currentAnimation?.stop()),this.root.nodes.forEach(fRe),this.root.sharedNodes.clear()}}}function v6n(e){e.updateLayout()}function T6n(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")Zp(d=>{const p=i?t.measuredBox[d]:t.layoutBox[d],f=ml(p);p.min=n[d].min,p.max=p.min+f});else if(s==="x"||s==="y"){const d=s==="x"?"y":"x";_te(i?t.measuredBox[d]:t.layoutBox[d],n[d])}else Jrt(s,t.layoutBox,n)&&Zp(d=>{const p=i?t.measuredBox[d]:t.layoutBox[d],f=ml(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=GS();GC(o,n,t.layoutBox);const a=GS();i?GC(a,e.applyTransform(r,!0),t.measuredBox):GC(a,n,t.layoutBox);const c=!Vrt(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=Di();AX(m,t.layoutBox,p.layoutBox,h);const O=Di();AX(O,n,f.layoutBox,h),qrt(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 E6n(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 w6n(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function k6n(e){e.clearSnapshot()}function fRe(e){e.clearMeasurements()}function C6n(e){e.isLayoutDirty=!0,e.updateLayout()}function hRe(e){e.isLayoutDirty=!1}function R6n(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function P6n(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function mRe(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function $6n(e){e.resolveTargetDelta()}function N6n(e){e.calcProjection()}function A6n(e){e.resetSkewAndRotation()}function I6n(e){e.removeLeadSnapshot()}function ORe(e,t,n){e.translate=js(t.translate,0,n),e.scale=js(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function gRe(e,t,n,r){e.min=js(t.min,n.min,r),e.max=js(t.max,n.max,r)}function M6n(e,t,n,r){gRe(e.x,t.x,n.x,r),gRe(e.y,t.y,n.y,r)}function Q6n(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const D6n={duration:.45,ease:[.4,0,.1,1]},_Re=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),bRe=_Re("applewebkit/")&&!_Re("chrome/")?Math.round:Ju;function yRe(e){e.min=bRe(e.min),e.max=bRe(e.max)}function L6n(e){yRe(e.x),yRe(e.y)}function Jrt(e,t,n){return e==="position"||e==="preserve-aspect"&&!o6n(lRe(t),lRe(n),.2)}function j6n(e){return e!==e.root&&e.scroll?.wasRoot}const X6n=Krt({attachResizeListener:(e,t)=>i$(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),l9={current:void 0},est=Krt({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!l9.current){const e=new X6n({});e.mount(window),e.setOptions({layoutScroll:!0}),l9.current=e}return l9.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),aue=g.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function U6n(e=!0){const t=g.useContext(Ace);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 tst=g.createContext({strict:!1}),xRe={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 SRe=!1;function z6n(){if(SRe)return;const e={};for(const t in xRe)e[t]={isEnabled:n=>xRe[t].some(r=>!!n[r])};krt(e),SRe=!0}function nst(){return z6n(),Aqn()}function B6n(e){const t=nst();for(const n in e)t[n]={...t[n],...e[n]};krt(t)}const F6n=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 IX(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||F6n.has(e)}let rst=e=>!IX(e);function Y6n(e){typeof e=="function"&&(rst=t=>t.startsWith("on")?!IX(t):e(t))}try{Y6n(require("@emotion/is-prop-valid").default)}catch{}function V6n(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||fo(e[s])||(rst(s)||n===!0&&IX(s)||!t&&!IX(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const BB=g.createContext({});function q6n(e,t){if(zB(e)){const{initial:n,animate:r}=e;return{initial:n===!1||s$(n)?n:void 0,animate:s$(r)?r:void 0}}return e.inherit!==!1?t:{}}function W6n(e){const{initial:t,animate:n}=q6n(e,g.useContext(BB));return g.useMemo(()=>({initial:t,animate:n}),[vRe(t),vRe(n)])}function vRe(e){return Array.isArray(e)?e.join(" "):e}const lue=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function sst(e,t,n){for(const r in t)!fo(t[r])&&!Mrt(r,n)&&(e[r]=t[r])}function G6n({transformTemplate:e},t){return g.useMemo(()=>{const n=lue();return iue(n,t,e),Object.assign({},n.vars,n.style)},[t])}function H6n(e,t){const n=e.style||{},r={};return sst(r,n,e),Object.assign(r,G6n(e,t)),r}function Z6n(e,t){const n={},r=H6n(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 ist=()=>({...lue(),attrs:{}});function K6n(e,t,n,r){const s=g.useMemo(()=>{const i=ist();return Drt(i,t,jrt(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};sst(i,e.style,e),s.style={...i,...s.style}}return s}const J6n=["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 cue(e){return typeof e!="string"||e.includes("-")?!1:!!(J6n.indexOf(e)>-1||/[A-Z]/u.test(e))}function eWn(e,t,n,{latestValues:r},s,i=!1,o){const c=(o??cue(e)?K6n:Z6n)(t,r,s,e),l=V6n(t,typeof e=="string",i),d=e!==g.Fragment?{...l,...c,ref:n}:{},{children:p}=t,f=g.useMemo(()=>fo(p)?p.get():p,[p]);return g.createElement(e,{...d,children:f})}function tWn({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:nWn(n,r,s,e),renderState:t()}}function nWn(e,t,n,r){const s={},i=r(e,{});for(const f in i)s[f]=iD(i[f]);let{initial:o,animate:a}=e;const c=zB(e),l=Ert(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"&&!UB(p)){const f=Array.isArray(p)?p:[p];for(let h=0;h<f.length;h++){const m=Gce(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 ost=e=>(t,n)=>{const r=g.useContext(BB),s=g.useContext(Ace),i=()=>tWn(e,t,r,s);return n?i():Nce(i)},rWn=ost({scrapeMotionValuesFromProps:oue,createRenderState:lue}),sWn=ost({scrapeMotionValuesFromProps:Xrt,createRenderState:ist}),iWn=Symbol.for("motionComponentSymbol");function oWn(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 ast=g.createContext({});function gS(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function aWn(e,t,n,r,s,i){const{visualElement:o}=g.useContext(BB),a=g.useContext(tst),c=g.useContext(Ace),l=g.useContext(aue),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(ast);m&&!m.projection&&s&&(m.type==="html"||m.type==="svg")&&lWn(f.current,n,s,O);const _=g.useRef(!1);g.useInsertionEffect(()=>{m&&_.current&&m.update(n,c)});const b=n[frt],y=g.useRef(!!b&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(b)&&window.MotionHasOptimisedAnimation?.(b));return ynt(()=>{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 lWn(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:lst(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||a&&gS(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:p,layoutScroll:c,layoutRoot:l,layoutAnchor:d})}function lst(e){if(e)return e.options.allowProjection!==!1?e.projection:lst(e.parent)}function c9(e,{forwardMotionProps:t=!1,type:n}={},r,s){r&&B6n(r);const i=n?n==="svg":cue(e),o=i?sWn:rWn;function a(l,d){let p;const f={...g.useContext(aue),...l,layoutId:cWn(l)},{isStatic:h}=f,m=W6n(l),O=o(l,h);if(!h&&typeof window<"u"){uWn();const _=dWn(f);p=_.MeasureLayout,m.visualElement=aWn(e,O,f,s,_.ProjectionNode,i)}return u.jsxs(BB.Provider,{value:m,children:[p&&m.visualElement?u.jsx(p,{visualElement:m.visualElement,...f}):null,eWn(e,l,oWn(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[iWn]=e,c}function cWn({layoutId:e}){const t=g.useContext(bnt).id;return t&&e!==void 0?t+"-"+e:e}function uWn(e,t){g.useContext(tst).strict}function dWn(e){const t=nst(),{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 pWn(e,t){if(typeof Proxy>"u")return c9;const n=new Map,r=(i,o)=>c9(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,c9(o,void 0,e,t)),n.get(o))})}const fWn=(e,t)=>t.isSVG??cue(e)?new Urt(t):new Qrt(t,{allowProjection:e!==g.Fragment});class hWn extends B_{constructor(t){super(t),t.animationState||(t.animationState=e6n(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();UB(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 mWn=0;class OWn extends B_{constructor(){super(...arguments),this.id=mWn++,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=Mb(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 gWn={animation:{Feature:hWn},exit:{Feature:OWn}};function sA(e){return{point:{x:e.pageX,y:e.pageY}}}const _Wn=e=>t=>tue(t)&&e(t,sA(t));function HC(e,t,n,r){return i$(e,t,_Wn(n),r)}const cst=({current:e})=>e?e.ownerDocument.defaultView:null,TRe=(e,t)=>Math.abs(e-t);function bWn(e,t){const n=TRe(e.x,t.x),r=TRe(e.y,t.y);return Math.sqrt(n**2+r**2)}const ERe=new Set(["auto","scroll"]);class ust{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=ZM(this.lastRawMoveEventInfo,this.transformPagePoint));const h=u9(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,O=bWn(h.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!O)return;const{point:_}=h,{timestamp:b}=Zo;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=ZM(m,this.transformPagePoint),ks.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=u9(h.type==="pointercancel"?this.lastMoveEventInfo:ZM(m,this.transformPagePoint),this.history);this.startEvent&&O&&O(h,y),_&&_(h,y)},!tue(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const c=sA(t),l=ZM(c,this.transformPagePoint),{point:d}=l,{timestamp:p}=Zo;this.history=[{...d,timestamp:p}];const{onSessionStart:f}=n;f&&f(t,u9(l,this.history)),this.removeListeners=tA(HC(this.contextWindow,"pointermove",this.handlePointerMove),HC(this.contextWindow,"pointerup",this.handlePointerUp),HC(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(ERe.has(r.overflowX)||ERe.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),ks.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Bm(this.updatePoint)}}function ZM(e,t){return t?{point:t(e.point)}:e}function wRe(e,t){return{x:e.x-t.x,y:e.y-t.y}}function u9({point:e},t){return{point:e,delta:wRe(e,dst(t)),offset:wRe(e,yWn(t)),velocity:xWn(t,.1)}}function yWn(e){return e[0]}function dst(e){return e[e.length-1]}function xWn(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=dst(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>lc(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&s.timestamp-r.timestamp>lc(t)*2&&(r=e[1]);const i=zu(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 SWn(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?js(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?js(n,e,r.max):Math.min(e,n)),e}function kRe(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 vWn(e,{top:t,left:n,bottom:r,right:s}){return{x:kRe(e.x,n,s),y:kRe(e.y,t,r)}}function CRe(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 TWn(e,t){return{x:CRe(e.x,t.x),y:CRe(e.y,t.y)}}function EWn(e,t){let n=.5;const r=ml(e),s=ml(t);return s>r?n=nE(t.min,t.max-r,e.min):r>s&&(n=nE(e.min,e.max-s,t.min)),Ff(0,1,n)}function wWn(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 bte=.35;function kWn(e=bte){return e===!1?e=0:e===!0&&(e=bte),{x:RRe(e,"left","right"),y:RRe(e,"top","bottom")}}function RRe(e,t,n){return{min:PRe(e,t),max:PRe(e,n)}}function PRe(e,t){return typeof e=="number"?e:e[t]||0}const CWn=new WeakMap;class RWn{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=Di(),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(sA(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=pqn(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),Zp(b=>{let y=this.getAxisMotionValue(b).get()||0;if(Mf.test(y)){const{projection:x}=this.visualElement;if(x&&x.layout){const S=x.layout.layoutBox[b];S&&(y=ml(S)*(parseFloat(y)/100))}}this.originPoint[b]=y}),O&&ks.update(()=>O(p,f),!1,!0),dte(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=$Wn(b),this.currentDirection!==null&&O&&O(this.currentDirection);return}this.updateAxis("x",f.point,b),this.updateAxis("y",f.point,b),this.visualElement.render(),_&&ks.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 ust(t,{onSessionStart:i,onStart:o,onMove:a,onSessionEnd:c,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:cst(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&&ks.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||!KM(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=SWn(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&&gS(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=vWn(r.layoutBox,t):this.constraints=!1,this.elastic=kWn(n),s!==this.constraints&&!gS(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&Zp(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=wWn(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!gS(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=Dqn(r,s.root,this.visualElement.getTransformPagePoint());let o=TWn(s.layout.layoutBox,i);if(n){const a=n(Iqn(o));this.hasMutatedConstraints=!!a,a&&(o=Prt(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=Zp(d=>{if(!KM(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 dte(this.visualElement,t),r.start(Wce(t,r,0,n,this.visualElement,!1))}stopAnimation(){Zp(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){Zp(n=>{const{drag:r}=this.getProps();if(!KM(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]-js(o,a,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!gS(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Zp(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const c=a.get();s[o]=EWn({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(),Zp(o=>{if(!KM(o,t,null))return;const a=this.getAxisMotionValue(o),{min:c,max:l}=this.constraints[o];a.set(js(c,l,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;CWn.set(this.visualElement,this);const t=this.visualElement.current,n=HC(t,"pointerdown",l=>{const{drag:d,dragListener:p=!0}=this.getProps(),f=l.target,h=f!==t&&_qn(f);d&&p&&!h&&this.start(l)});let r;const s=()=>{const{dragConstraints:l}=this.getProps();gS(l)&&l.current&&(this.constraints=this.resolveRefConstraints(),r||(r=PWn(t,l.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),ks.read(s);const a=i$(window,"resize",()=>this.scalePositionWithinConstraints()),c=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:d})=>{this.isDragging&&d&&(Zp(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=bte,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function $Re(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function PWn(e,t,n){const r=XCe(e,$Re(n)),s=XCe(t,$Re(n));return()=>{r(),s()}}function KM(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function $Wn(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class NWn extends B_{constructor(t){super(t),this.removeGroupControls=Ju,this.removeListeners=Ju,this.controls=new RWn(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ju}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 d9=e=>(t,n)=>{e&&ks.update(()=>e(t,n),!1,!0)};class AWn extends B_{constructor(){super(...arguments),this.removePointerDownListener=Ju}onPointerDown(t){this.session=new ust(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:cst(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:d9(t),onStart:d9(n),onMove:d9(r),onEnd:(i,o)=>{delete this.session,s&&ks.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=HC(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 p9=!1;class IWn 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),p9&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),oD.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}),p9=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==i?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||ks.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(),eue.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;p9=!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 pst(e){const[t,n]=U6n(),r=g.useContext(bnt);return u.jsx(IWn,{...e,layoutGroup:r,switchLayoutGroup:g.useContext(ast),isPresent:t,safeToRemove:n})}const MWn={pan:{Feature:AWn},drag:{Feature:NWn,ProjectionNode:est,MeasureLayout:pst}};function NRe(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&&ks.postRender(()=>i(t,sA(t)))}class QWn extends B_{mount(){const{current:t}=this.node;t&&(this.unmount=hqn(t,(n,r)=>(NRe(this.node,r,"Start"),s=>NRe(this.node,s,"End"))))}unmount(){}}class DWn extends B_{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=tA(i$(this.node.current,"focus",()=>this.onFocus()),i$(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function ARe(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&&ks.postRender(()=>i(t,sA(t)))}class LWn extends B_{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=yqn(t,(s,i)=>(ARe(this.node,i,"Start"),(o,{success:a})=>ARe(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:r?.tap===!1})}unmount(){}}const yte=new WeakMap,f9=new WeakMap,jWn=e=>{const t=yte.get(e.target);t&&t(e)},XWn=e=>{e.forEach(jWn)};function UWn({root:e,...t}){const n=e||document;f9.has(n)||f9.set(n,{});const r=f9.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(XWn,{root:e,...t})),r[s]}function zWn(e,t,n){const r=UWn(t);return yte.set(e,n),r.observe(e),()=>{yte.delete(e),r.unobserve(e)}}const BWn={some:0,all:1};class FWn extends B_{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:BWn[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=zWn(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(YWn(t,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function YWn({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const VWn={inView:{Feature:FWn},tap:{Feature:LWn},focus:{Feature:DWn},hover:{Feature:QWn}},qWn={layout:{ProjectionNode:est,MeasureLayout:pst}},WWn={...gWn,...VWn,...MWn,...qWn},Fm=pWn(WWn,fWn);function xte(e){const t=Nce(()=>b_(e)),{isStatic:n}=g.useContext(aue);if(n){const[,r]=g.useState(e);g.useEffect(()=>t.on("change",r),[])}return t}function fst(e,t){const n=xte(t()),r=()=>n.set(t());return r(),ynt(()=>{const s=()=>ks.preRender(r,!1,!0),i=e.map(o=>o.on("change",s));return()=>{i.forEach(o=>o()),Bm(r)}}),n}function GWn(e){WC.current=[],e();const t=fst(WC.current,e);return WC.current=void 0,t}function HS(e,t,n,r){if(typeof e=="function")return GWn(e);const i=typeof t=="function"?t:rD(t,n,r),o=Array.isArray(e)?IRe(e,i):IRe([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 IRe(e,t){const n=Nce(()=>[]);return fst(e,()=>{n.length=0;const r=e.length;for(let s=0;s<r;s++)n[s]=e[s].get();return t(n)})}function HWn(){!sue.current&&wrt();const[e]=g.useState(PX.current);return e}function uue(e){return typeof e=="object"&&!Array.isArray(e)}function hst(e,t,n,r){return e==null?[]:typeof e=="string"&&uue(t)?Jce(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(s=>s!=null):[e]}function ZWn(e,t,n){return e*(t+1)}function MRe(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 KWn(e,t,n){for(let r=0;r<e.length;r++){const s=e[r];s.at>t&&s.at<n&&(tE(e,s),r--)}}function JWn(e,t,n,r,s,i){KWn(e,s,i);for(let o=0;o<t.length;o++)e.push({value:t[o],at:js(s,i,r[o]),easing:Qnt(n,o)})}function eGn(e,t){for(let n=0;n<e.length;n++)e[n]=e[n]/(t+1)}function tGn(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}const nGn="easeInOut";function rGn(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,MRe(p,m.at,d,l));continue}let[O,_,b={}]=m;b.at!==void 0&&(p=MRe(p,b.at,d,l));let y=0;const x=(S,v,T,E=0,w=0)=>{const P=sGn(S),{delay:k=0,times:C=Knt(P),type:I=t.type||"keyframes",repeat:N,repeatType:R,repeatDelay:$=0,...A}=v;let{ease:j=t.ease||"easeOut",duration:Q}=v;const U=typeof k=="function"?k(E,w):k,M=P.length,q=Vce(I)?I:s?.[I||"keyframes"];if(M<=2&&q){let Y=100;if(M===2&&aGn(P)){const H=P[1]-P[0];Y=Math.abs(H)}const ne={...t,...A};Q!==void 0&&(ne.duration=lc(Q));const te=Wnt(ne,Y,q);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),N){Q=ZWn(Q,N);const Y=[...P],ne=[...C];j=Array.isArray(j)?[...j]:[j];const te=[...j];for(let H=0;H<N;H++){P.push(...Y);for(let Z=0;Z<Y.length;Z++)C.push(ne[Z]+(H+1)),j.push(Z===0?"linear":Qnt(te,Z-1))}eGn(C,N)}const V=z+Q;JWn(T,P,j,C,z,V),y=Math.max(U+Q,y),f=Math.max(V,f)};if(fo(O)){const S=QRe(O,a);x(_,b,DRe("default",S))}else{const S=hst(O,_,r,c),v=S.length;for(let T=0;T<v;T++){_=_,b=b;const E=S[T],w=QRe(E,a);for(const P in _)x(_[P],iGn(b,P),DRe(P,w),T,v)}}d=p,p+=y}return a.forEach((h,m)=>{for(const O in h){const _=h[O];_.sort(tGn);const b=[],y=[],x=[];for(let E=0;E<_.length;E++){const{at:w,value:P,easing:k}=_[E];b.push(P),y.push(nE(0,f,w)),x.push(k||"easeOut")}y[0]!==0&&(y.unshift(0),b.unshift(b[0]),x.unshift(nGn)),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 QRe(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function DRe(e,t){return t[e]||(t[e]=[]),t[e]}function sGn(e){return Array.isArray(e)?e:[e]}function iGn(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}const oGn=e=>typeof e=="number",aGn=e=>e.every(oGn);function lGn(e){const t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=XB(e)&&!Trt(e)?new Urt(t):new Qrt(t);n.mount(e),r$.set(e,n)}function cGn(e){const t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new Fqn(t);n.mount(e),r$.set(e,n)}function uGn(e,t){return fo(e)||typeof e=="number"||typeof e=="string"&&!uue(t)}function mst(e,t,n,r){const s=[];if(uGn(e,t))s.push(Hrt(e,uue(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return s;const i=hst(e,t,r),o=i.length;for(let a=0;a<o;a++){const c=i[a],l=c instanceof Element?lGn:cGn;r$.has(c)||l(c);const d=r$.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 dGn(e,t,n){const r=[],s=e.map(o=>{if(Array.isArray(o)&&typeof o[0]=="function"){const a=o[0],c=b_(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 rGn(s,t,n,{spring:n$}).forEach(({keyframes:o,transition:a},c)=>{r.push(...mst(c,o,a))}),r}function pGn(e){return Array.isArray(e)&&e.some(Array.isArray)}function fGn(e={}){const{scope:t,reduceMotion:n}=e;function r(s,i,o){let a=[],c;if(pGn(s)){const{onComplete:d,...p}=i||{};typeof d=="function"&&(c=d),a=dGn(s,n!==void 0?{reduceMotion:n,...p}:p,t)}else{const{onComplete:d,...p}=o||{};typeof d=="function"&&(c=d),a=mst(s,i,n!==void 0?{reduceMotion:n,...p}:p,t)}const l=new IVn(a);return c&&l.finished.then(c),t&&(t.animations.push(l),l.finished.then(()=>{tE(t.animations,l)})),l}return r}const Qw=fGn();function LRe(e,t){let n;return(...r)=>{window.clearTimeout(n),n=window.setTimeout(()=>e(...r),t)}}function hGn({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&&!_Gn(a.current.lastBounds,k)&&o(a.current.lastBounds=k)};return[b,l?LRe(b,l):b,c?LRe(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=Ost(b),O())};return OGn(h,!!t),mGn(f),g.useEffect(()=>{m(),O()},[t,h,f]),g.useEffect(()=>m,[]),[_,i,p]}function mGn(e){g.useEffect(()=>{const t=e;return window.addEventListener("resize",t),()=>void window.removeEventListener("resize",t)},[e])}function OGn(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 Ost(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,...Ost(e.parentElement)]}const gGn=["x","y","top","bottom","left","right","width","height"],_Gn=(e,t)=>gGn.every(n=>e[n]===t[n]);var gst=g.createContext(void 0),_st=g.createContext(void 0);function iA(){const e=g.useContext(gst);if(!e)throw new Error("Sheet context error");return e}function bGn(){const e=g.useContext(_st);if(!e)throw new Error("Sheet context error");return e}var jRe="calc(100% - env(safe-area-inset-top) - 34px)",o$=typeof window>"u",yGn={ease:"easeOut",duration:.2},xGn={ease:"linear",duration:.01},SGn=.6,vGn=1200,due=o$?g.useEffect:g.useLayoutEffect;function TGn(){const[e,t]=g.useState(()=>({windowHeight:o$?0:window.innerHeight,windowWidth:o$?0:window.innerWidth}));return due(()=>{function n(){t({windowHeight:window.innerHeight,windowWidth:window.innerWidth})}return n(),window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n)}},[]),e}function Ym(e,t){return t?e.base:{...e.base,...e.decorative}}function EGn(e){for(let t=0;t<e.length;t++)if(e[t+1]<e[t])return!1;return!0}function MX(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n&&(n.current=t)})}}function pue(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 FB(e){let t=null;return()=>(t==null&&(t=e()),t)}var wGn=FB(function(){return pue(/^Mac/i)}),kGn=FB(function(){return pue(/^iPhone/i)}),CGn=FB(function(){return pue(/^iPad/i)||wGn()&&navigator.maxTouchPoints>1}),RGn=FB(function(){return kGn()||CGn()});function PGn(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 $Gn=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function wy(e){return e instanceof HTMLInputElement&&!$Gn.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function bst(){return typeof window<"u"&&window.isSecureContext}function yst(e,t,n){return Math.min(Math.max(e,t),n)}function Ao(e){const t=g.useRef(void 0);return due(()=>{t.current=e}),g.useCallback((...n)=>{const r=t.current;return r?.(...n)},[])}var Dw=0,h9=null;function NGn(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=AGn();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=m9()??a.current;if(!(b?wy(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&&wy(b.target)&&(a.current=b.target,m())}function _(){requestAnimationFrame(()=>{a.current=m9(),m()})}return document.addEventListener("focusin",O),document.addEventListener("focusout",_),l&&(l.addEventListener("resize",m),l.addEventListener("scroll",m)),d&&(Dw===0&&(h9=d.overlaysContent,d.overlaysContent=!0),Dw++,d.addEventListener("geometrychange",m)),a.current=m9(),m(),()=>{document.removeEventListener("focusin",O),document.removeEventListener("focusout",_),l&&(l.removeEventListener("resize",m),l.removeEventListener("scroll",m)),d&&(d.removeEventListener("geometrychange",m),Dw=Math.max(0,Dw-1),Dw===0&&(d.overlaysContent=h9??!1,h9=null)),c.current&&clearTimeout(c.current),h()}},[r,n,s]),{keyboardHeight:i.height,isKeyboardOpen:i.isVisible}}function AGn(){return bst()&&"virtualKeyboard"in navigator?navigator.virtualKeyboard:null}function m9(){var e;let t=document.activeElement;for(;t instanceof HTMLElement&&((e=t.shadowRoot)!=null&&e.activeElement);)t=t.shadowRoot.activeElement;return t&&wy(t)?t:null}function IGn({isEnabled:e,containerRef:t,onWillOpenKeyboard:n,onDidOpenKeyboard:r}){const[s,i]=g.useState(null),o=NGn({isEnabled:e,containerRef:t}),a=Ao(async l=>{var d;const p=l.target;wy(p)&&((d=t.current)!=null&&d.contains(p))&&(await n?.(l),i(p))}),c=Ao(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 MGn(){const[e]=g.useState(()=>{const t={top:0,left:0,right:0,bottom:0};if(o$)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=JM(r,"--rms-sat"),i=JM(r,"--rms-sal"),o=JM(r,"--rms-sar"),a=JM(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 JM(e,t){const n=e.getPropertyValue(t).replace("px","").trim();return parseInt(n,10)||0}function QGn({y:e,detent:t,rootId:n,sheetHeight:r,snapPoints:s,startThreshold:i}){const o=MGn().top;let a=n;a&&t==="full"&&(console.warn('Using "full" detent with modal effect is not supported.'),a=void 0);const c=Ao(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;LGn(a,{scale:rD(p,[0,1],[1,(h-16)/h]),translateY:rD(p,[0,1],[0,24+o]),borderRadius:rD(p,[0,1],[0,10])})}),l=Ao(()=>{a&&e.get()+5>=r&&XRe(a)});g.useEffect(()=>{if(!a)return;const d=e.on("animationStart",()=>{a&&DGn(a)}),p=e.on("change",m=>{c(m)}),f=e.on("animationComplete",l),h=e.on("animationCancel",l);return()=>{a&&XRe(a),d(),p(),f(),h()}},[a])}function DGn(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 LGn(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 XRe(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 jGn=24;function Ste(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}var O9=typeof document<"u"&&window.visualViewport;function URe(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 xst(e,t){let n=e;for(URe(n,t)&&(n=n.parentElement);n&&!URe(n,t);)n=n.parentElement;return n||document.scrollingElement||document.documentElement}var eQ=0,tQ;function XGn(e={}){const{isDisabled:t}=e;due(()=>{if(!t)return eQ++,eQ===1&&(RGn()?tQ=zGn():tQ=UGn()),()=>{eQ--,eQ===0&&tQ?.()}},[t])}function UGn(){return Ste(ZC(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`),ZC(document.documentElement,"overflow","hidden"))}function zGn(){let e,t=0;const n=p=>{var f;const h=(f=p.composedPath())==null?void 0:f[0];e=xst(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];wy(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];wy(h)&&(h.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{h.style.transform="",O9&&(O9.height<window.innerHeight?requestAnimationFrame(()=>{zRe(h)}):O9.addEventListener("resize",()=>zRe(h),{once:!0}))}))},o=()=>{window.scrollTo(0,0)},a=window.pageXOffset,c=window.pageYOffset,l=Ste(ZC(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`),ZC(document.documentElement,"overflow","hidden"),ZC(document.body,"marginTop",`-${c}px`));window.scrollTo(0,0);const d=Ste(Lw(document,"touchstart",n,{passive:!1,capture:!0}),Lw(document,"touchmove",r,{passive:!1,capture:!0}),Lw(document,"touchend",s,{passive:!1,capture:!0}),Lw(document,"focus",i,!0),Lw(window,"scroll",o));return()=>{l(),d(),window.scrollTo(a,c)}}function ZC(e,t,n){const r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function Lw(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function zRe(e){const t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){const n=xst(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+jGn;i>o&&(n.scrollTop+=s-r)}e=n.parentElement}}function BGn({isOpen:e,onClosed:t,onOpening:n,onOpen:r,onClosing:s}){const[i,o]=g.useState(e?"opening":"closed"),a=Ao(()=>t?.()),c=Ao(()=>n?.()),l=Ao(()=>r?.()),d=Ao(()=>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 FGn({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(EGn(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 g9(e){return e>0?1:e<0?-1:0}function QX(e){return e.slice().sort((t,n)=>t.snapValueY-n.snapValueY)}function nQ(e,t){return e.reduce((n,r)=>Math.abs(r.snapValueY-t)<Math.abs(n.snapValueY-t)?r:n)}function BRe(e,t){const n=QX(e);for(let r=n.length-1;r>=0;r--)if(n[r].snapValueY<t)return n[r];return null}function FRe(e,t){const n=QX(e);for(let r=0;r<n.length;r++)if(n[r].snapValueY>t)return n[r];return null}function YGn({offsetY:e,velocityY:t,deltaY:n}){if(Math.abs(t)>50)return g9(t);const r=g9(e);return r!==0?r:g9(n)}function VGn({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=yst(e+_*l,f,h),y=Math.abs(_),x=YGn({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 R=f+(h-f)*i;return{yTo:b<R?f:h,snapIndex:void 0}}const T=nQ(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 R=x<0?f:h,$=nQ(r,R);return{yTo:R,snapIndex:$.snapIndex}}if(v){const R=x<0?BRe(r,e):FRe(r,e),$=x<0?f:h,A=nQ(r,$),j=R??A;return{yTo:j.snapValueY,snapIndex:j.snapIndex}}const E=QX(r)[0],w=QX(r)[r.length-1],P=BRe(r,e)??E,k=FRe(r,e)??w;if(P.snapIndex===k.snapIndex)return{yTo:P.snapValueY,snapIndex:P.snapIndex};const C=k.snapValueY-P.snapValueY,I=C>0?(e-P.snapValueY)/C:0;let N=T;if(x>0?N=I>c?k:P:x<0&&(N=I<1-c?P:k),y>200){const R=nQ(r,b);Math.abs(R.snapValueY-e)<Math.abs(N.snapValueY-e)&&(N=R)}return{yTo:N.snapValueY,snapIndex:N.snapIndex}}var Vm={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:{}}},Sst=g.forwardRef(({avoidKeyboard:e=!0,children:t,className:n="",detent:r="default",disableDismiss:s=!1,disableDrag:i=!1,disableScrollLocking:o=!1,dragCloseThreshold:a=SGn,dragVelocityThreshold:c=vGn,initialSnap:l,isOpen:d,modalEffectRootId:p,modalEffectThreshold:f,mountPoint:h,prefersReducedMotion:m=!1,snapPoints:O,style:_,tweenConfig:b=yGn,unstyled:y=!1,onOpenStart:x,onOpenEnd:S,onClose:v,onCloseStart:T,onCloseEnd:E,onSnap:w,onDrag:P,onDragStart:k,onDragEnd:C,...I},N)=>{const[R,$]=hGn(),A=g.useRef(null),j=Math.round($.height),[Q,U]=g.useState(l),{windowHeight:M}=TGn(),q=j>0?j:M,z=xte(q),L=HS(z,K=>Math.max(j-K,0)),V=HS(z,K=>yst(1-K/q,0,1)),Y=xte(0),ne=HWn(),H={type:"tween",...!!(m||ne)?xGn:b},Z=HS(z,K=>K+2>=q?-1:_?.zIndex??9999),se=HS(z,K=>K+2>=q?"hidden":"visible"),he=g.useMemo(()=>O&&j>0?FGn({sheetHeight:j,snapPointsProp:O}):[],[j,O?.join("")]),ce=Ao(K=>{U(K),w?.(K)}),me=Ao(K=>O&&he?K<0||K>=he.length?(console.warn(`Invalid snap index ${K}. Snap points are: [${O.join(", ")}] and their computed values are: [${he.map(pe=>pe.snapValue).join(", ")}]`),null):he[K]:null),ae=Ao(async K=>{if(!O){console.warn("Snapping is not possible without `snapPoints` prop.");return}const pe=me(K);if(pe===null){console.warn(`Invalid snap index ${K}.`);return}if(K===0){v();return}await Qw(z,pe.snapValueY,{...H,onComplete:()=>ce(K)})}),be=IGn({isEnabled:d&&e,containerRef:A,onWillOpenKeyboard:async()=>{const K=he[he.length-1];K&&K.snapIndex!==Q&&(await Qw(z,K.snapValueY,H),ce(K.snapIndex))},onDidOpenKeyboard:K=>{const pe=A.current;if(!pe)return;const we=K.getBoundingClientRect(),Ee=pe.getBoundingClientRect(),Ae=pe.querySelector(".react-modal-sheet-content-scroller"),We=Math.max(we.top-Ee.top+Ae.scrollTop-we.height,0);requestAnimationFrame(()=>{Ae.scrollTo({top:We,behavior:"smooth"})})}}).isKeyboardOpen||i,_e=Ao(()=>{var K;const pe=document.activeElement;pe&&wy(pe)&&((K=A.current)!=null&&K.contains(pe))&&pe.blur()}),re=Ao((K,pe)=>{_e(),k?.(K,pe)}),ge=Ao((K,pe)=>{P?.(K,pe);const we=z.get(),Ee=z.getVelocity();Ee>0&&Y.set(10),Ee<0&&Y.set(-10),z.set(Math.max(we+pe.delta.y,0))}),J=Ao((K,pe)=>{_e(),C?.(K,pe);const we=z.get(),Ee=VGn({y:we,info:pe,sheetHeight:j,dragCloseThreshold:a,snapPoints:he,dragVelocityThreshold:c});let Ae=Ee.yTo;if(s&&Ae+1>=j){const We=he.find(et=>et.snapValue>0);We?(Ae=We.snapValueY,ce(We.snapIndex)):Ae=we}else Ee.snapIndex!==void 0&&ce(Ee.snapIndex);Qw(z,Ae,H),Ae+1>=j&&!s&&v(),Y.set(0)});QGn({y:z,detent:r,sheetHeight:j,snapPoints:he,rootId:p,startThreshold:f}),XGn({isDisabled:o||!d});const F=BGn({isOpen:d,onOpen:async()=>{x?.(),await PGn("react-modal-sheet-container");const K=l!==void 0?me(l):null,pe=K?.snapValueY??0;await Qw(z,pe,H),l!==void 0&&ce(l),S?.()},onClosing:async()=>{T?.(),await Qw(z,q,H),E?.()}}),ue={currentSnap:Q,detent:r,disableDrag:be,dragProps:{drag:"y",dragElastic:0,dragMomentum:!1,dragPropagation:!1,onDrag:ge,onDragStart:re,onDragEnd:J},indicatorRotation:Y,avoidKeyboard:e,prefersReducedMotion:m,sheetBoundsRef:R,sheetRef:A,unstyled:y,yProgress:V,y:z},ie={height:j,currentSnap:Q,snapPoints:he,snapTo:ae,y:z,yInverted:L,yProgress:V};g.useImperativeHandle(N,()=>ie);const le=Je.createElement(gst.Provider,{value:ue},Je.createElement(Fm.div,{...I,ref:N,"data-sheet-state":F,className:`react-modal-sheet-root ${n}`,style:{...Ym(Vm.root,y),zIndex:Z,visibility:se,..._}},Je.createElement(_st.Provider,{value:ie},F!=="closed"?t:null)));return o$?le:vi.createPortal(le,h??document.body)});Sst.displayName="Sheet";var qGn=e=>!!e.onClick||!!e.onTap,vst=g.forwardRef(({style:e,className:t="",unstyled:n,...r},s)=>{const i=iA(),o=qGn(r),a=o?Fm.button:Fm.div,c=o?"auto":"none",l=n??i.unstyled,d={opacity:i.yProgress,...Ym(Vm.backdrop,l),...e,pointerEvents:c};return Je.createElement(a,{...r,ref:s,className:`react-modal-sheet-backdrop ${t}`,style:d})});vst.displayName="SheetBackdrop";var Tst=g.forwardRef(({children:e,style:t,className:n="",unstyled:r,...s},i)=>{const o=iA(),a=r??o.unstyled,c={...Ym(Vm.container,a),...t,y:o.y};return o.detent==="default"&&(c.height=jRe),o.detent==="full"&&(c.height="100%",c.maxHeight="100%"),o.detent==="content"&&(c.height="auto",c.maxHeight=jRe),Je.createElement(Fm.div,{...s,ref:MX([i,o.sheetRef,o.sheetBoundsRef]),className:`react-modal-sheet-container ${n}`,style:c},e)});Tst.displayName="SheetContainer";var WGn={bottom:0,top:0,left:0,right:0};function Est(){const e=g.useRef(null),t=g.useCallback(()=>WGn,[]);return{ref:e,onMeasure:t}}function GGn(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=Ao(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=Ao(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=Ao(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 wst=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=iA(),f=Est(),h=GGn({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={...Ym(Vm.content,x),...r},v=Ym(Vm.scroller,x);return p.avoidKeyboard&&(v.paddingBottom=bst()?"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(Fm.div,{...l,ref:MX([d,f.ref]),className:`react-modal-sheet-content ${s}`,style:S,...y,dragConstraints:f.ref,onMeasureDragConstraints:f.onMeasure},Je.createElement(Fm.div,{ref:MX([h.scrollRef,a]),style:{...v,...o},className:`react-modal-sheet-content-scroller ${i}`},n))});wst.displayName="SheetContent";function kst({style:e,className:t="",unstyled:n,...r}){const s=iA(),i=HS(s.indicatorRotation,d=>`translateX(2px) rotate(${d}deg)`),o=HS(s.indicatorRotation,d=>`translateX(-2px) rotate(${-1*d}deg)`),a=n??s.unstyled,c={...Ym(Vm.indicatorWrapper,a),...e},l=Ym(Vm.indicator,a);return Je.createElement("div",{className:`react-modal-sheet-drag-indicator-container ${t}`,style:c,...r},Je.createElement(Fm.span,{className:"react-modal-sheet-drag-indicator",style:{...l,transform:i}}),Je.createElement(Fm.span,{className:"react-modal-sheet-drag-indicator",style:{...l,transform:o}}))}var Cst=g.forwardRef(({children:e,style:t,disableDrag:n,unstyled:r,className:s="",...i},o)=>{const a=iA(),c=Est(),l=n||a.disableDrag?void 0:a.dragProps,d=r??a.unstyled,p={...Ym(Vm.headerWrapper,d),...t},f=Ym(Vm.header,d);return Je.createElement(Fm.div,{...i,ref:MX([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(kst,null)))});Cst.displayName="SheetHeader";var jw=Object.assign(Sst,{Container:Tst,Header:Cst,DragIndicator:kst,Content:wst,Backdrop:vst,useContext:bGn});const HGn="team-msg-expanded:";function fue(e){return`${HGn}${e}`}function DX(e){try{const t=localStorage.getItem(fue(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 ZGn(e,t){try{const n=DX(e);if(n.has(t))return;n.add(t),localStorage.setItem(fue(e),JSON.stringify([...n]))}catch{}}function KGn(e,t){try{const n=DX(e);if(!n.has(t))return;n.delete(t),localStorage.setItem(fue(e),JSON.stringify([...n]))}catch{}}function JGn(e){const[t,n]=g.useState(0),r=g.useMemo(()=>t<0?new Set:e?DX(e):new Set,[e,t]),s=g.useCallback(i=>{if(!e)return;DX(e).has(i)?KGn(e,i):ZGn(e,i),n(a=>a+1)},[e]);return{expandedSet:r,toggle:s}}function e8n(e){for(let t=0;t<e.length;t++)if(e[t]?.type==="message")return t;return-1}function t8n({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 n8n=.15,rQ=30,r8n=400,s8n=[],i8n=new Map,YRe="default",o8n=8,a8n=4,l8n=60,c8n={"session-separator":135,"compaction-divider":50,"lead-thought-group":220,"message-row":140};function u8n(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 VRe(e){if(e.type==="lead-thoughts")return e.group.thoughts[0]?.leadSessionId}const d8n=({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(gR,{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}})]}),p8n=({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:I})=>{const N=g.useRef(null),R=g.useRef(!1),$=g.useRef(e),A=g.useRef(h);return g.useEffect(()=>{$.current=e,A.current=h},[e,h]),g.useEffect(()=>{if(!h)return;const j=N.current;if(!j)return;const Q=I?.current??null,U=new IntersectionObserver(([M])=>{if(!M?.isIntersecting||R.current)return;const q=A.current,z=$.current;q&&(R.current=!0,q(z))},{root:Q,threshold:n8n,rootMargin:"0px"});return U.observe(j),()=>U.disconnect()},[h,I]),u.jsx(Rle,{animate:o,containerRef:N,children:u.jsx(VN,{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})})},f8n=Je.memo(p8n,(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&&FN(e.teamNames,t.teamNames)&&YN(e.teamColorByName,t.teamColorByName)&&e.onTeamClick===t.onTeamClick&&e.onExpand===t.onExpand&&e.expandItemKey===t.expandItemKey&&e.onExpandContent===t.onExpandContent&&e.observerRoot===t.observerRoot&&WZe(e.message,t.message)),_9=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=s8n,teamColorByName:x=i8n,onTeamClick:S,onExpandItem:v,onExpandContent:T,viewport:E}){const w=E?.observerRoot??E?.scrollElementRef,[P,k]=g.useState(rQ),C=g.useRef(null),[I,N]=g.useState(!1);g.useEffect(()=>{const re=C.current;if(!re)return;const ge=F=>{N(W=>{const ue=F<r8n;return W===ue?W:ue})};ge(re.getBoundingClientRect().width);const J=new ResizeObserver(F=>{const W=F[0];W&&ge(W.contentRect.width)});return J.observe(re),()=>J.disconnect()},[]);const R=g.useMemo(()=>BN(r),[r]),{colorMap:$,localMemberNames:A,memberInfo:j}=R,Q=g.useCallback(re=>{const ge=r?.find(J=>J.name===re||J.agentType===re);ge&&a?.(ge)},[r,a]),{visibleMessages:U,hiddenCount:M}=g.useMemo(()=>{const re=t.length;if(re===0)return{visibleMessages:t,hiddenCount:0};let ge=0,J=re;for(let ue=0;ue<re;ue++)if(!_ee(t[ue])&&(ge++,ge>P)){J=ue;break}const F=ge+(J<re?t.slice(J).filter(ue=>!_ee(ue)).length:0),W=Math.max(0,F-P);return{visibleMessages:J<re?t.slice(0,J):t,hiddenCount:W}},[t,P]),q=g.useMemo(()=>KZe(U),[U]),z=g.useMemo(()=>{const re=new Set;let ge=0;for(let J=q.length-1;J>=0;J--){const F=q[J];if(F.type==="lead-thoughts")ge%2===1&&re.add(J),ge++;else{if(HMn(F.message.text)||gee(F.message))continue;ge%2===1&&re.add(J),ge++}}return re},[q]),L=g.useMemo(()=>{const re=ge=>ge.type==="lead-thoughts"?wv(ge.group):Ls(ge.message);return q.map(re)},[q]),V=k7e({itemKeys:L,paginationKey:P,resetKey:n});g.useEffect(()=>{},[n,L]);const Y=()=>{k(re=>re+rQ)},ne=()=>{k(1/0)},te=g.useMemo(()=>{const re=[];let ge;for(const J of q){re.push(ge);const F=VRe(J);F&&(ge=F)}return re},[q]),H=q[0]?.type==="lead-thoughts"?q[0]:null,Z=H?1:0,se=g.useMemo(()=>{const re=[];H&&re.push({kind:"lead-thought-group",key:wv(H.group),itemIndex:0,group:H.group,isPinned:!0});for(let ge=Z;ge<q.length;ge+=1){const J=q[ge];if(ge>0){const W=VRe(J),ue=te[ge];ue&&W&&ue!==W&&re.push({kind:"session-separator",key:`session-separator-${ge}-${ue}->${W}`})}if(J.type==="lead-thoughts"){re.push({kind:"lead-thought-group",key:wv(J.group),itemIndex:ge,group:J.group,isPinned:!1});continue}const F=J.message;if(gee(F)){re.push({kind:"compaction-divider",key:`compaction-${Ls(F)}`,message:F});continue}re.push({kind:"message-row",key:Ls(F),itemIndex:ge,message:F})}return re},[H,te,Z,q]),he=E?.virtualizationEnabled===!0&&E.scrollElementRef!=null&&se.length>=l8n,[ce,me]=g.useState(0);g.useLayoutEffect(()=>{if(!he)return;const re=E?.scrollElementRef?.current??null,ge=C.current;if(!re||!ge)return;let J=!1,F=null;const W=()=>{J||(J=!0,F=requestAnimationFrame(()=>{F=null,J=!1;const le=re.getBoundingClientRect(),K=ge.getBoundingClientRect(),pe=Math.max(0,K.top-le.top+re.scrollTop);me(we=>Math.abs(we-pe)<.5?we:pe)}))};W();const ue=new ResizeObserver(W);return u8n(ge,re).forEach(le=>ue.observe(le)),window.addEventListener("resize",W),()=>{F!==null&&cancelAnimationFrame(F),ue.disconnect(),window.removeEventListener("resize",W)}},[he,E?.scrollElementRef]);const ae=Tce({count:he?se.length:0,getScrollElement:()=>E?.scrollElementRef?.current??null,estimateSize:re=>c8n[se[re]?.kind??"message-row"],getItemKey:re=>se[re]?.key??`row-${re}`,overscan:o8n,gap:a8n,scrollMargin:ce}),G=g.useMemo(()=>e8n(q),[q]),be=g.useCallback((re,ge)=>{const J=t8n({allCollapsed:p,itemIndex:ge,newestMessageIndex:G,isPinnedThoughtGroup:ge===0&&H!=null,isExpandedOverride:f?.has(re)??!1,onToggleOverride:h?()=>h(re):void 0});return J.mode!==YRe?{collapseMode:J.mode,isCollapsed:J.isCollapsed,canToggleCollapse:J.canToggle,collapseToggleKey:J.canToggle?re:void 0}:{collapseMode:YRe,isCollapsed:!1,canToggleCollapse:!1}},[p,G,H,f,h]),_e=(re,ge)=>{const J=ge?.suppressEntryAnimation===!0;switch(re.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"})]},re.key);case"compaction-divider":return u.jsx(d8n,{message:re.message},re.key);case"lead-thought-group":{const{group:F,itemIndex:W,isPinned:ue,key:ie}=re,le=F.thoughts[0],K=j.get(le.from),pe=be(ie,W),we=ue?m?le.leadSessionId===m:!0:!1;return u.jsx(OQn,{group:F,memberColor:K?.color,canBeLive:we,isTeamAlive:we?O:void 0,leadActivity:we?_:void 0,leadContextUpdatedAt:we?b:void 0,isNew:!J&&V.has(ie),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:$,onReply:o,compactHeader:I,teamNames:y,teamColorByName:x,onTeamClick:S,onExpand:I?v:void 0,expandItemKey:I?ie:void 0},ie)}case"message-row":{const{message:F,itemIndex:W,key:ue}=re,ie=hB(F,R),le=be(ue,W),K=s?!F.read&&!s.readSet.has(s.getMessageKey(F)):!F.read;return u.jsx(f8n,{message:F,teamName:n,memberRole:ie.memberRole,memberColor:ie.memberColor,recipientColor:ie.recipientColor,isUnread:K,isNew:!J&&V.has(ue),zebraShade:z.has(W),memberColorMap:$,localMemberNames:A,onMemberNameClick:a?Q:void 0,onCreateTask:i,onReply:o,onVisible:c,onTaskIdClick:l,onRestartTeam:d,collapseMode:le.collapseMode,isCollapsed:le.isCollapsed,canToggleCollapse:le.canToggleCollapse,collapseToggleKey:le.collapseToggleKey,onToggleCollapse:h,compactHeader:I,teamNames:y,teamColorByName:x,onTeamClick:S,onExpand:I?v:void 0,expandItemKey:I?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:[he?u.jsx("div",{style:{height:`${ae.getTotalSize()}px`,width:"100%",position:"relative"},children:ae.getVirtualItems().map(re=>{const ge=se[re.index];return ge?u.jsx("div",{ref:ae.measureElement,"data-index":re.index,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${re.start-ae.options.scrollMargin}px)`},children:_e(ge,{suppressEntryAnimation:!0})},re.key):null})}):se.map(re=>_e(re)),M>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:["+",M," 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(rQ,M)," more"]}),M>rQ&&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"})]})]})]})]})}),Rst=new Map,Pst=new Map;function $st(e){return{from:new Set(e.from),to:new Set(e.to),showNoise:e.showNoise}}function h8n(){return{messagesSearchQuery:"",messagesFilter:{from:new Set,to:new Set,showNoise:!1},messagesFilterOpen:!1,messagesCollapsed:!0,messagesSearchBarVisible:!1,expandedItemKey:null,messagesScrollTop:0,bottomSheetSnapIndex:2}}function qRe(e){const t=Rst.get(e)??h8n();return{...t,messagesFilter:$st(t.messagesFilter)}}function m8n(e,t){Rst.set(e,{...t,messagesFilter:$st(t.messagesFilter)})}function WRe(e){return{...Pst.get(e)??{}}}function O8n(e,t){Pst.set(e,{...t})}const Nst=1,g8n="composer:";function hue(e){return`${g8n}${e}`}function _8n(e){return{text:`draft:compose:${e}`,chips:`draft:compose:${e}:chips`,attachments:`draft:compose:${e}:attachments`}}function b8n(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 oA=!1,GRe=!1;const sE=new Map;function mue(){GRe||(GRe=!0,console.warn("[composerDraftStorage] IndexedDB unavailable, using in-memory storage for this session.")),oA=!0}async function Ast(e,t){const n=hue(e);if(oA){sE.set(n,t);return}try{await jy(n,t)}catch{mue(),sE.set(n,t)}}async function y8n(e){const t=hue(e);if(oA)return sE.get(t)??null;try{const n=await Gd(t);return n==null?null:b8n(n)?n:(sl(t),null)}catch{return mue(),sE.get(t)??null}}async function x8n(e){const t=hue(e);if(oA){sE.delete(t);return}try{await sl(t)}catch{mue(),sE.delete(t)}}function b9(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.value=="string"&&typeof t.timestamp=="number"}function S8n(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 v8n(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 T8n(e){if(oA)return null;const t=_8n(e);try{const[n,r,s]=await Promise.all([Gd(t.text),Gd(t.chips),Gd(t.attachments)]);if(n==null&&r==null&&s==null)return null;let i="";b9(n)&&(i=n.value);let o=[];if(r!=null){const l=typeof r=="string"?JSON.parse(r):r,d=b9(l)?l.value:l,p=typeof d=="string"?JSON.parse(d):d;S8n(p)&&(o=p)}let a=[];if(s!=null){const l=typeof s=="string"?JSON.parse(s):s,d=b9(l)?l.value:l,p=typeof d=="string"?JSON.parse(d):d;v8n(p)&&(a=p)}if(i.length===0&&o.length===0&&a.length===0)return await Promise.all([sl(t.text),sl(t.chips),sl(t.attachments)]),null;const c={version:Nst,teamName:e,text:i,chips:o,attachments:a,updatedAt:Date.now()};return await Ast(e,c),await Promise.all([sl(t.text),sl(t.chips),sl(t.attachments)]),c}catch{return null}}function E8n(e){return{version:Nst,teamName:e,text:"",chips:[],attachments:[],updatedAt:Date.now()}}const vO={saveSnapshot:Ast,loadSnapshot:y8n,deleteSnapshot:x8n,migrateLegacy:T8n,emptySnapshot:E8n},w8n=400;function k8n(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?vO.deleteSnapshot(Y.teamName):vO.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?(vO.deleteSnapshot(ne.teamName),S.current&&f(!0)):vO.saveSnapshot(ne.teamName,ne.snapshot).then(()=>{S.current&&f(!0)})},w8n)},[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=vO.emptySnapshot(e);return queueMicrotask(()=>{Y||(C(ne),f(!1),m(!1),c(null))}),(async()=>{let te=await vO.loadSnapshot(e);if(te==null&&(te=await vO.migrateLegacy(e)),!Y){if(v.current){S.current&&m(!0);return}te!=null&&((te.attachments.reduce((Z,se)=>Z+se.size,0)>Ev||te.attachments.length>mg)&&(te={...te,attachments:[]}),C(te),f(!0)),S.current&&m(!0)}})(),()=>{Y=!0}},[e,P,C]),g.useEffect(()=>()=>{P()},[P]);const I=g.useCallback(Y=>{v.current=!0,O.current=Y,n(Y),f(!1),k()},[k]),N=g.useCallback(Y=>{v.current=!0;const ne=[..._.current,Y];_.current=ne,s(ne),f(!1),k()},[k]),R=g.useCallback(Y=>{v.current=!0;const ne=_.current.filter(te=>te.id!==Y);_.current=ne,s(ne),f(!1),k()},[k]),$=g.useCallback(Y=>{v.current=!0,y.current=Y,d(Y),f(!1),k()},[k]),A=i.reduce((Y,ne)=>Y+ne.size,0),j=i.length<mg&&A<Ev,Q=g.useCallback(async Y=>{v.current=!0,c(null);const ne=Array.from(Y);if(ne.length===0)return;const te=[],H=[];for(const ae of ne)if(DN(ae)==="unsupported"){let G="";try{G=ee.getPathForFile(ae)}catch{}G?H.push(G):c(`Unsupported file: ${ae.name}`)}else te.push(ae);if(H.length>0){const ae=H.join(`
|
|
1823
1823
|
`)+`
|
|
1824
|
-
`,G=O.current;I(G?ae+G:ae)}if(te.length===0)return;let Z=0;for(const ae of te){const G=m7e(ae);if(!G.valid){c(G.error);return}Z+=ae.size}const se=[];for(const ae of te)try{const G=await O7e(ae);se.push(G)}catch{c(`读取文件失败:${ae.name}`);return}const he=b.current;if(he.length+se.length>mg){c(`最多允许添加 ${mg} 个附件`);return}if(he.reduce((ae,G)=>ae+G.size,0)+Z>Ev){c("附件总大小超过 20MB 限制");return}const me=[...he,...se];b.current=me,o(me),f(!1),k()},[k,I]),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]),M=g.useCallback(()=>{v.current=!0,b.current=[],o([]),c(null),f(!1),k()},[k]),q=g.useCallback(()=>{c(null)},[]),z=g.useCallback(Y=>{const ne=Y.clipboardData?.items;if(!ne)return;const te=[];for(const H of Array.from(ne))if(H.kind==="file"){const Z=H.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]),V=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),vO.deleteSnapshot(x.current)},[]);return{text:t,setText:I,chips:r,addChip:N,removeChip:R,attachments:i,attachmentError:a,canAddMore:j,addFiles:Q,removeAttachment:U,clearAttachments:M,clearAttachmentError:q,handlePaste:z,handleDrop:L,actionMode:l,setActionMode:$,isSaved:p,isLoaded:h,clearDraft:V}}const C8n=[{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 R8n(e){return e==="codex"?C8n:x7e}function P8n(e,t,n){const r=e.filter(o=>Bwe(o.rootKind,n)),s=t.filter(o=>Bwe(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 $8n(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 P8n(t,n,r)){const l=c.folderName.trim().toLowerCase();!c.isValid||!l||!WRn(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"} - ${cX(c.rootKind)}`,searchText:`${c.name} ${c.folderName}`,type:"skill"}))}return[...i,...a]}const y9=({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,onCrossTeamSend:m})=>{const O=g.useRef(null),_=g.useMemo(()=>Ce=>{O.current=Ce,typeof f=="function"?f(Ce):f&&(f.current=Ce)},[f]),[b,y]=g.useState(()=>t.find(st=>Gn(st))?.name??t[0]?.name??""),[x,S]=g.useState(!1),[v,T]=g.useState(""),E=g.useRef(null),[w,P]=g.useState(!1),k=g.useRef(0),C=g.useRef(null),[I,N]=g.useState(null),R=g.useRef(0),$=g.useRef(null),[A,j]=g.useState(null),[Q,U]=g.useState(!1),[M,q]=g.useState(new Set),z=oe(Et(Ce=>Ce.crossTeamTargets)),L=oe(Ce=>Ce.fetchCrossTeamTargets);g.useEffect(()=>{L()},[L]);const V=g.useCallback(async()=>{try{const Ce=await ee.teams.aliveList();q(new Set(Ce))}catch{}},[]);g.useEffect(()=>{V()},[V]),g.useEffect(()=>{Q&&V()},[Q,V]);const Y=g.useMemo(()=>z.filter(Ce=>Ce.teamName!==e),[z,e]),ne=g.useMemo(()=>Y.map(Ce=>({...Ce,isOnline:M.has(Ce.teamName)})).sort((Ce,st)=>Ce.isOnline&&!st.isOnline?-1:!Ce.isOnline&&st.isOnline?1:(Ce.displayName||Ce.teamName).localeCompare(st.displayName||st.teamName,void 0,{sensitivity:"base"})),[M,Y]),te=ne.length>0,H=A!==null,Z=ne.find(Ce=>Ce.teamName===A),se=Z?.displayName??A,he=H?"Tips:跨团队消息会发送到目标团队负责人。如果你希望回复发回你当前团队负责人而不是你本人,请在消息中明确说明。":void 0;g.useEffect(()=>{if(b&&t.some(wt=>wt.name===b))return;const st=t.find(wt=>Gn(wt))?.name??t[0]?.name??"";st&&st!==b&&queueMicrotask(()=>y(st))},[t,b]);const ce=oe(Ce=>Ce.selectedTeamName===e?Ce.selectedTeamData?.config.projectPath??null:null),me=oe(Ce=>{if(Ce.selectedTeamName!==e)return ll(e).border;const st=Ce.selectedTeamData?.config.color;if(st)return Ir(st).border;const wt=Ce.selectedTeamData?.config.name??e;return ll(wt).border}),ae=oe(Ce=>Yy(Ce,e)),G=k8n(e),be=g.useMemo(()=>l.find(Ce=>Ce.sessionKey===d)??null,[d,l]),_e=be?.title||be?.chatName||be?.userName||be?.sessionKey||"选择会话",re=g.useMemo(()=>to(t),[t]),ge=g.useMemo(()=>t.map(Ce=>({id:Ce.name,name:Ce.name,subtitle:ri(Ce.role)??ri(Ce.agentType)??void 0,color:re.get(Ce.name)})),[t,re]),J=g.useMemo(()=>{const Ce=t.find(st=>Gn(st));return Ta(Ce?.providerId)??Ig(Ce?.model)},[t]),{suggestions:F}=XN(e),{suggestions:W}=ix(e),ue=oe(Et(Ce=>ce?Ce.skillsProjectCatalogByProjectPath[ce]??[]:[])),ie=oe(Et(Ce=>Ce.skillsUserCatalog)),le=oe(Ce=>Ce.fetchSkillsCatalog);g.useEffect(()=>{le(ce??void 0)},[le,ce]);const K=g.useMemo(()=>$8n(R8n(J),ue,ie,J),[J,ue,ie]),pe=Dm(G.text).trim(),we=g.useMemo(()=>GT(pe),[pe]),Ee=t.find(Ce=>Ce.name===b),Ae=Ee?re.get(Ee.name):void 0,We=Ee?Gn(Ee):!1,et=We&&!H&&!!r,yt=et&&G.canAddMore,xt=et?void 0:H?"跨团队消息暂不支持文件附件":We?"团队在线时才能添加文件":"文件只能发送给团队负责人",Ge=G.attachments.length>0&&!et,Ct=we?G.attachments.length>0?"斜杠命令需要团队负责人在线,且不能与附件同时发送":H?"斜杠命令只能在当前团队负责人上执行":We?r?null:"斜杠命令需要团队负责人在线":"斜杠命令只能发送给团队负责人":null,Xt=b.length>0&&pe.length>0&&pe.length<=ic&&!s&&!ae&&!Ge&&!Ct&&(!H||m!==void 0),ct=g.useRef(!1),mn=g.useCallback(()=>{if(!Xt)return;$.current?.(),ct.current=!0;const Ce=ty(G.text,W),st=ZE(pe,G.chips);H&&A&&m?m(A,st,pe,void 0,Ce):h(b,st,pe,G.attachments.length>0?G.attachments:void 0,void 0,Ce)},[Xt,b,pe,h,m,H,A,G.attachments,G.chips,W]);g.useEffect(()=>{!s&&ct.current&&(ct.current=!1,!i&&a?.delivered!==!1&&G.clearDraft())},[s,i,a,G]);const{addFiles:Lt}=G,Sn=g.useCallback(Ce=>{const st=Ce.target;st.files?.length&&Lt(st.files),st.value=""},[Lt]),jt=g.useCallback(()=>{N(xt??"Files can only be sent to the team lead"),window.clearTimeout(R.current),R.current=window.setTimeout(()=>{N(null)},4e3)},[xt]);g.useEffect(()=>{const Ce=R;return()=>window.clearTimeout(Ce.current)},[]);const dn=g.useCallback(Ce=>{Ce.preventDefault(),k.current+=1,k.current===1&&P(!0)},[]),ze=g.useCallback(Ce=>{Ce.preventDefault(),k.current-=1,k.current<=0&&(k.current=0,P(!1))},[]),rt=g.useCallback(Ce=>{Ce.preventDefault()},[]),{handleDrop:Nt}=G,Ht=g.useCallback(Ce=>{if(Ce.preventDefault(),k.current=0,P(!1),!et){Ce.dataTransfer?.files?.length&&jt();return}Nt(Ce)},[et,Nt,jt]),{handlePaste:qe}=G,lt=g.useCallback(Ce=>{if(!et){Array.from(Ce.clipboardData.items).some(wt=>wt.kind==="file")&&(Ce.preventDefault(),jt());return}qe(Ce)},[et,qe,jt]),Pe=ic-pe.length,ye=G.attachments.length>0||!!(G.attachmentError??I),Be=!ye,Ze=n==="compact",Ye=Ct?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(Bo,{size:10,className:"shrink-0"}),Ct]}):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(Bo,{size:10,className:"shrink-0"}),i]}):o?u.jsx(ant,{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(Kr,{size:10,className:"shrink-0"}),"已复用最近一次跨团队请求"]}):null;return u.jsxs("div",{className:nt("relative",Ze?"pb-1":"mb-1.5 pb-1.5"),role:"group",onDragEnter:dn,onDragLeave:ze,onDragOver:rt,onDrop:Ht,onPaste:lt,children:[u.jsxs("div",{className:nt(Be?"mb-0":"mb-1",Ze?"space-y-1.5":"space-y-2"),children:[u.jsxs("div",{className:"flex items-center gap-2",children:[We?u.jsxs(u.Fragment,{children:[u.jsx("input",{ref:C,type:"file",accept:"*/*",multiple:!0,className:"hidden",onChange:Sn}),u.jsxs(it,{children:[u.jsx(ot,{asChild:!0,children:u.jsx("button",{type:"button",className:nt("inline-flex shrink-0 items-center gap-1 rounded p-1 transition-colors",yt?"text-[var(--color-text-secondary)] hover:text-[var(--color-text)]":"text-[var(--color-text-muted)] opacity-40"),disabled:!yt,onClick:()=>C.current?.click(),children:u.jsx(yU,{size:14})})}),u.jsx(tt,{side:"top",children:r?G.canAddMore?"添加文件(支持粘贴或拖拽)":"已达到附件上限":"团队在线时才能添加文件"})]})]}):null,u.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[!r&&!ae&&u.jsx("span",{className:"text-[10px]",style:{color:"var(--warning-text)"},children:"团队离线"}),u.jsxs("div",{className:nt("mr-[15px] inline-flex items-center border text-xs transition-colors",Be?"relative z-10 -mb-2 overflow-hidden rounded-b-none rounded-t-[1.35rem] border-b-0 bg-[var(--color-surface-raised)]":"rounded-full",H?"border-[var(--cross-team-border)]":"border-[var(--color-border)]"),children:[u.jsxs(nu,{open:Q,onOpenChange:U,children:[u.jsx(od,{asChild:!0,children:u.jsxs("button",{type:"button",className:nt("inline-flex items-center gap-1.5 border-r border-r-[var(--color-border)] px-2.5 py-1 text-xs transition-colors",Be?"rounded-bl-none rounded-tl-[1.35rem]":"rounded-l-full",H?"hover:bg-[var(--cross-team-bg)]/80 bg-[var(--cross-team-bg)] text-purple-400":"hover:bg-[var(--color-surface-raised)]"),children:[H?u.jsxs(u.Fragment,{children:[u.jsx("span",{className:nt("inline-block size-2 shrink-0 rounded-full",Z?.isOnline&&"animate-pulse"),style:{backgroundColor:Z?.isOnline?"#22c55e":Z?Z.color?Ir(Z.color).border:ll(Z.displayName).border:void 0}}),u.jsx("span",{className:"max-w-[100px] truncate",children:se})]}):u.jsxs(u.Fragment,{children:[me?u.jsx("span",{className:"inline-block size-2 shrink-0 rounded-full",style:{backgroundColor:me}}):null,u.jsx("span",{className:"max-w-[120px] truncate text-[var(--color-text-secondary)]",children:_e})]}),u.jsx(Ur,{size:12,className:"shrink-0 text-[var(--color-text-muted)]"})]})}),u.jsx(hc,{align:"end",className:"w-56 p-1.5",children:u.jsxs("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(Ce=>{const st=d===Ce.sessionKey,wt=Ce.title||Ce.chatName||Ce.userName||Ce.sessionKey;return u.jsxs("button",{type:"button",className:nt("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)]",st&&"bg-[var(--color-surface-raised)]"),onClick:()=>{p?.(Ce.sessionKey),j(null),U(!1)},children:[u.jsx("span",{className:nt("inline-block size-2 shrink-0 rounded-full",Ce.live&&"animate-pulse"),style:{backgroundColor:Ce.live?"#22c55e":me}}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-[var(--color-text)]",children:wt}),u.jsx("span",{className:"shrink-0 text-[10px] text-[var(--color-text-muted)]",children:Ce.platform}),st?u.jsx(Kr,{size:12,className:"ml-auto shrink-0 text-blue-400"}):null]},Ce.sessionKey)}),u.jsx("div",{className:"my-1 h-px bg-[var(--color-border)]"})]}),te?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"my-1 h-px bg-[var(--color-border)]"}),ne.map(Ce=>{const st=A===Ce.teamName;return u.jsxs("button",{type:"button",className:nt("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)]",st&&"bg-[var(--cross-team-bg)]"),onClick:()=>{j(Ce.teamName),y(W$),U(!1)},children:[u.jsx("span",{className:nt("inline-block size-2 shrink-0 rounded-full",Ce.isOnline&&"animate-pulse"),style:{backgroundColor:Ce.isOnline?"#22c55e":Ce.color?Ir(Ce.color).border:ll(Ce.displayName).border},title:Ce.isOnline?"在线":"离线"}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx("div",{className:"truncate text-[var(--color-text)]",children:Ce.displayName}),u.jsx("span",{className:nt("shrink-0 text-[10px]",Ce.isOnline?"text-green-400":"text-[var(--color-text-muted)]"),children:Ce.isOnline?"在线":"离线"})]}),Ce.description?u.jsx("div",{className:"truncate text-[10px] text-[var(--color-text-muted)]",children:Ce.description}):null]}),st?u.jsx(Kr,{size:12,className:"ml-auto shrink-0 text-purple-400"}):null]},Ce.teamName)})]}):null]})})]}),u.jsxs(nu,{open:H?!1:x,onOpenChange:H?void 0:S,children:[u.jsx(od,{asChild:!0,children:u.jsxs("button",{type:"button",className:nt("inline-flex items-center gap-1.5 px-2.5 py-1 text-xs transition-colors",Be?"rounded-br-none rounded-tr-[1.35rem]":"rounded-r-full",H?"cursor-default bg-[var(--cross-team-bg)] opacity-60":"hover:bg-[var(--color-surface-raised)]"),disabled:H,children:[b?u.jsx(zr,{name:b,color:Ae,size:"sm",hideAvatar:b==="user",disableHoverCard:!0}):u.jsx("span",{className:"text-[var(--color-text-muted)]",children:"选择..."}),u.jsx(Ur,{size:12,className:"shrink-0 text-[var(--color-text-muted)]"})]})}),u.jsxs(hc,{align:"end",className:"w-56 p-1.5",onOpenAutoFocus:Ce=>{Ce.preventDefault(),T(""),setTimeout(()=>E.current?.focus(),0)},children:[t.length>5&&u.jsxs("div",{className:"relative mb-1",children:[u.jsx(Mi,{size:12,className:"absolute left-2 top-1/2 -translate-y-1/2 text-[var(--color-text-muted)]"}),u.jsx("input",{ref:E,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:v,onChange:Ce=>T(Ce.target.value)})]}),u.jsx("div",{className:"max-h-48 space-y-0.5 overflow-y-auto",children:(()=>{const Ce=v.toLowerCase().trim(),st=Ce?t.filter(Rt=>Rt.name.toLowerCase().includes(Ce)):t;return st.length===0?u.jsx("div",{className:"px-2 py-3 text-center text-xs text-[var(--color-text-muted)]",children:"无匹配结果"}):[...st].sort((Rt,Yn)=>{const On=Gn(Rt)?1:0;return(Gn(Yn)?1:0)-On}).map(Rt=>{const Yn=re.get(Rt.name),On=ri(Rt.role)??ri(Rt.agentType),Vn=Rt.name===b;return u.jsxs("button",{type:"button",className:nt("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)]",Vn&&"bg-[var(--color-surface-raised)]"),onClick:()=>{y(Rt.name),S(!1),T("")},children:[u.jsx(zr,{name:Rt.name,color:Yn,size:"sm",hideAvatar:Rt.name==="user",disableHoverCard:!0}),On?u.jsx("span",{className:"shrink-0 text-[10px] text-[var(--color-text-muted)]",children:On}):null,Vn?u.jsx(Kr,{size:12,className:"ml-auto shrink-0 text-blue-400"}):null]},Rt.name)})})()})]})]})]})]})]}),ye?u.jsx(int,{attachments:G.attachments,onRemove:G.removeAttachment,error:G.attachmentError??I,onDismissError:G.clearAttachmentError,disabled:Ge,disabledHint:"仅在团队在线且接收人为团队负责人时支持附件。请移除附件或切换接收人。"}):null]}),u.jsxs("div",{className:"relative",children:[u.jsx(ont,{active:w,rejected:!et,rejectionReason:xt}),u.jsx(Um,{ref:_,id:`compose-${e}`,placeholder:ae?"团队正在启动中... 消息将排队并在稍后投递到收件箱。":H?`发送跨团队消息到 ${se??"目标团队"}...`:"输入消息...(回车发送,Shift+Enter 换行)",value:G.text,onValueChange:G.setText,suggestions:ge,teamSuggestions:F,taskSuggestions:W,commandSuggestions:K,chips:G.chips,onChipRemove:G.removeChip,projectPath:ce,onFileChipInsert:G.addChip,onModEnter:mn,dismissMentionsRef:$,extraTips:g.useMemo(()=>[`Tips:你可以输入 "/" 来运行命令,如 ${K.filter(st=>st.type==="command").slice(0,6).map(st=>st.command).join("、")} 等。`],[K]),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:ic,disabled:s,hintText:he,showHint:!Ze,cornerActionInset:"compact",cornerAction:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs(it,{children:[u.jsx(ot,{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 ee.openExternal("https://voicetext.site"),children:u.jsx(HIe,{size:14})})}),u.jsx(tt,{side:"top",children:"语音转文字"})]}),u.jsxs(it,{children:[u.jsx(ot,{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:!Xt,onClick:mn,children:[u.jsx(E$,{size:12}),"发送"]})})}),Ct?u.jsx(tt,{side:"top",children:Ct}):ae&&!s?u.jsx(tt,{side:"top",children:"团队启动期间暂不可发送"}):null]})]}),footerRight:Ze?Ye:u.jsxs("div",{className:"flex items-center gap-2",children:[Ye,Pe<200?u.jsxs("span",{className:`text-[10px] ${Pe<100?"text-yellow-400":"text-[var(--color-text-muted)]"}`,children:["剩余 ",Pe," 字符"]}):null,G.isSaved?u.jsx("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:"已保存"}):null]})})]})]})};function N8n(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 A8n(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 I8n=({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(()=>to(t),[t]),d=g.useMemo(()=>N8n(r),[r]),p=g.useMemo(()=>A8n(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(nu,{open:s,onOpenChange:i,children:[u.jsxs(it,{children:[u.jsx(ot,{asChild:!0,children:u.jsx(od,{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(bU,{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(tt,{side:"bottom",children:"筛选消息"})]}),u.jsxs(hc,{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(oi,{checked:a.from.has(y),onCheckedChange:()=>m(y)}),u.jsx(zr,{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(oi,{checked:a.to.has(y),onCheckedChange:()=>O(y)}),u.jsx(zr,{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(oi,{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:"保存"})]})]})]})]})},M8n=1e4;function HRe(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 Q8n(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=HRe(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=HRe(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<=M8n,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 D8n=({members:e,tasks:t,defaultCollapsed:n=!1,headerRight:r,onMemberClick:s,onTaskClick:i})=>{const{isLight:o}=Us(),[a,c]=g.useState(n),l=to(e),d=pp(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(Ln,{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=Ir(l.get(m.name)??""),x=ri(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:pm,border:Ac,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)??po(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:ii(y,o),color:y.text,border:`1px solid ${y.border}40`},onClick:()=>s(m),children:vl(m.name)}):u.jsx("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-medium tracking-wide",style:{backgroundColor:ii(y,o),color:y.text,border:`1px solid ${y.border}40`},children:vl(m.name)}),x?u.jsx("span",{className:"text-[10px]",style:{color:Dt},children:x}):null,u.jsx("span",{className:"shrink-0 text-[10px]",style:{color:Dt},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}-${_}`)})]})},L8n=({members:e,pendingRepliesByMember:t,pendingCrossTeamReplies:n=[],headerRight:r,onMemberClick:s})=>{const{isLight:i}=Us(),o=oe(Et(m=>m.pendingApprovals)),a=oe(Et(m=>m.teamByName)),c=to(e),l=pp(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=vT(m.sentAtMs,{addSuffix:!0});if(m.kind==="member"){const{member:_}=m,b=Ir(c.get(_.name)??""),y=ri(_.role??(_.agentType!=="general-purpose"?_.agentType:void 0)),x=Az(_.runtimeAdvisory,_.providerId),S=aze(_.runtimeAdvisory,_.providerId),v=x!==null;return u.jsx("article",{className:"activity-card-enter-animate overflow-hidden rounded-md",style:{backgroundColor:pm,border:Ac,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)??po(_.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:ii(b,i),color:b.text,border:`1px solid ${b.border}40`},onClick:()=>s(_),title:"Open member",children:vl(_.name)}):u.jsx("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-medium tracking-wide",style:{backgroundColor:ii(b,i),color:b.text,border:`1px solid ${b.border}40`},children:vl(_.name)}),y?u.jsx("span",{className:"text-[10px]",style:{color:Dt},children:y}):null,u.jsx("span",{className:`min-w-0 flex-1 truncate text-[10px] ${v?"text-amber-300":""}`,style:v?void 0:{color:Dt},title:S??"Message sent, awaiting reply",children:x??"awaiting reply"}),v?u.jsx(qt,{className:"size-3 shrink-0 animate-spin text-amber-400"}):null,u.jsx("span",{className:"shrink-0 text-[10px]",style:{color:Dt},children:O})]})},`pending-reply:${_.name}:${m.sentAtMs}`)}if(m.kind==="team"){const _=a[m.teamName]?.displayName||m.teamName,b=ll(_,i);return u.jsx("article",{className:"activity-card-enter-animate overflow-hidden rounded-md",style:{backgroundColor:pm,border:Ac,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(dc,{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:ii(b,i),color:b.text,border:`1px solid ${b.border}40`},title:m.teamName,children:_}),u.jsx("span",{className:"text-[10px]",style:{color:Dt},children:"external team"}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-[10px]",style:{color:Dt},title:"Cross-team message sent, awaiting reply",children:"awaiting reply"}),u.jsx("span",{className:"shrink-0 text-[10px]",style:{color:Dt},children:O})]})},`pending-reply:team:${m.teamName}:${m.sentAtMs}`)}return u.jsx("article",{className:"activity-card-enter-animate overflow-hidden rounded-md",style:{backgroundColor:pm,border:Ac,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(Iht,{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:Dt},title:`Tool approval: ${m.toolName}`,children:"awaiting approval"}),u.jsx("span",{className:"shrink-0 text-[10px]",style:{color:Dt},children:O})]})},`pending-reply:user:${m.sentAtMs}`)})]})},x9=({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(()=>Q8n(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(Ln,{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(L8n,{members:e,pendingRepliesByMember:r,pendingCrossTeamReplies:f,headerRight:b,onMemberClick:o}):null,u.jsx(D8n,{members:e,tasks:t,defaultCollapsed:s==="sidebar",headerRight:h?void 0:b,onMemberClick:o,onTaskClick:a})]})]})},j8n=40,sQ=1,ZRe=2,X8n=4,U8n=56;function z8n(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 B8n=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:I,teams:N,openTeamTab:R,messages:$,messagesState:A,loadOlderTeamMessages:j,refreshTeamMessagesHead:Q}=oe(Et(Ke=>({sendTeamMessage:Ke.sendTeamMessage,sendCrossTeamMessage:Ke.sendCrossTeamMessage,sendingMessage:Ke.sendingMessage,sendMessageError:Ke.sendMessageError,sendMessageWarning:Ke.sendMessageWarning,sendMessageDebugDetails:Ke.sendMessageDebugDetails,lastSendMessageResult:Ke.lastSendMessageResult,teams:Ke.teams,openTeamTab:Ke.openTeamTab,messages:mz(Ke,t),messagesState:t?Ke.teamMessagesByName[t]:void 0,loadOlderTeamMessages:Ke.loadOlderTeamMessages,refreshTeamMessagesHead:Ke.refreshTeamMessagesHead}))),U=g.useRef(null),M=g.useCallback(async()=>{!A?.hasMore||A.loadingHead||A.loadingOlder||await j(t)},[j,A,t]);(A?.loadingHead??!1)||A?.loadingOlder;const q=A?.loadingOlder??!1,z=A?.hasMore??!1,L=$,V=L.length,Y=g.useRef(!1),ne=g.useRef(null),te=g.useRef(null),H=g.useRef(null),Z=g.useRef(null),se=g.useRef(null),he=n==="inline"?S??null:n==="sidebar"?te:se,ce=g.useCallback(Ke=>{Ke>U8n||!z||A?.loadingHead||q||Y.current||(Y.current=!0,M())},[z,M,q,A?.loadingHead]);g.useEffect(()=>{q||(Y.current=!1)},[q]);const me=g.useMemo(()=>{if(he)return{scrollElementRef:he,observerRoot:he,scrollMargin:0,virtualizationEnabled:!0}},[he]),ae=g.useCallback(()=>{},[]),G=g.useRef(qRe(t)),[be,_e]=g.useState(G.current.messagesSearchQuery),[re,ge]=g.useState(G.current.messagesFilter),[J,F]=g.useState(G.current.messagesFilterOpen),[W,ue]=g.useState(G.current.messagesCollapsed),[ie,le]=g.useState(G.current.messagesSearchBarVisible),[K,pe]=g.useState(G.current.expandedItemKey),[we,Ee]=g.useState([]),[Ae,We]=g.useState(null),[et,yt]=g.useState(!1),[xt,Ge]=g.useState(null),[Ct,Xt]=g.useState(G.current.messagesScrollTop),[ct,mn]=g.useState(G.current.bottomSheetSnapIndex),[Lt,Sn]=g.useState(196),[jt,dn]=g.useState(0);g.useEffect(()=>{G.current=qRe(t),_e(G.current.messagesSearchQuery),ge(G.current.messagesFilter),F(G.current.messagesFilterOpen),ue(G.current.messagesCollapsed),le(G.current.messagesSearchBarVisible),pe(G.current.expandedItemKey),Xt(G.current.messagesScrollTop),mn(G.current.bottomSheetSnapIndex)},[t]),g.useEffect(()=>{let Ke=!1;return ee.teams.getTeamSessions(t).then(It=>{if(Ke)return;const Br=[...It].sort((Fr,Ie)=>new Date(Ie.updatedAt).getTime()-new Date(Fr.updatedAt).getTime());Ee(Br),Ge(Fr=>Fr&&Br.some(Ie=>Ie.sessionKey===Fr)?Fr:Br[0]?.sessionKey??null)}).catch(()=>{Ke||(Ee([]),Ge(null))}),()=>{Ke=!0}},[t]);const ze=g.useMemo(()=>we.find(Ke=>Ke.sessionKey===xt)??null,[xt,we]),rt=ze?.platform==="hermit"||ze?.sessionKey===`hermit:${t}:session`;g.useEffect(()=>{if(!ze||rt){We(null),yt(!1);return}let Ke=!1;return yt(!0),ee.teams.getSessionDetail(t,ze.id,200).then(It=>{Ke||We(It)}).catch(()=>{Ke||We(null)}).finally(()=>{Ke||yt(!1)}),()=>{Ke=!0}},[rt,ze,t]),g.useEffect(()=>{m8n(t,{messagesSearchQuery:be,messagesFilter:re,messagesFilterOpen:J,messagesCollapsed:W,messagesSearchBarVisible:ie,expandedItemKey:K,messagesScrollTop:Ct,bottomSheetSnapIndex:ct})},[t,be,re,J,W,ie,K,Ct,ct]),g.useEffect(()=>{const Ke=re.from.size>0||re.to.size>0;ie||be.trim().length===0&&!Ke||le(!0)},[re.from,re.to,ie,be]),g.useEffect(()=>{if(t){if(L.length>0){U.current=null;return}A?.loadingHead||A?.loadingOlder||U.current!==t&&(U.current=t,Q(t).catch(()=>{}))}},[L.length,A?.loadingHead,A?.loadingOlder,Q,t]),g.useLayoutEffect(()=>{if(n!=="sidebar")return;const Ke=te.current;Ke&&(Ke.scrollTop=Ct)},[n,Ct]),g.useEffect(()=>{if(n==="sidebar")return;const Ke=n==="bottom-sheet"?se.current:S?.current??null;if(!Ke)return;const It=()=>{ce(Ke.scrollTop)};return Ke.addEventListener("scroll",It,{passive:!0}),It(),()=>{Ke.removeEventListener("scroll",It)}},[S,ce,n]),g.useLayoutEffect(()=>{if(n!=="bottom-sheet"||typeof ResizeObserver>"u")return;const Ke=s instanceof HTMLElement?s:null,It=[[Z.current,Sn],[Ke,dn]],Br=[];for(const[Fr,Ie]of It){if(!Fr)continue;const Ne=()=>{const jn=Math.ceil(Fr.getBoundingClientRect().height);jn>0&&Ie(jn)};Ne();const vn=new ResizeObserver(()=>{Ne()});vn.observe(Fr),Br.push(vn)}return()=>{Br.forEach(Fr=>Fr.disconnect())}},[n,s]);const Nt=g.useMemo(()=>{const Ke=It=>[...It].sort((Br,Fr)=>Date.parse(Fr.timestamp)-Date.parse(Br.timestamp));return xt?ze&&!rt?Ae?[...Ae.history].reverse().map((It,Br)=>({messageId:`${Ae.id}:${Br}:${It.timestamp}`,from:It.role==="user"?"user":Ae.name||t,to:It.role==="user"?Ae.name||t:"user",text:It.content,timestamp:It.timestamp,read:!0,source:It.role==="user"?"user_sent":"inbox",session:{id:Ae.id,key:Ae.sessionKey,platform:Ae.platform,title:ze.title||ze.chatName||ze.userName||ze.sessionKey,chatName:ze.chatName,userName:ze.userName}})):[]:Ke(L.filter(It=>It.session?.key===xt)):[]},[L,rt,ze,Ae,xt,t]),Ht=g.useMemo(()=>Zee(Nt,{timeWindow:d,filter:re,searchQuery:be}),[re,be,Nt,d]),qe=g.useMemo(()=>Zee(Nt,{includePassiveIdlePeerSummariesWhenNoiseHidden:!0,timeWindow:d,filter:re,searchQuery:be}),[re,be,Nt,d]),lt=g.useMemo(()=>L.filter(Ke=>Ke.messageKind!=="task_comment_notification"&&!u$n(typeof Ke.text=="string"?Ke.text:"")),[L]),Pe=g.useMemo(()=>{if(!K)return null;if(!K.startsWith("thoughts-")){const It=qe.find(Br=>Ls(Br)===K);return It?{type:"message",message:It}:null}return KZe(qe).find(It=>It.type==="lead-thoughts"&&wv(It.group)===K)??null},[K,qe]);g.useEffect(()=>{K&&Pe===null&&pe(null)},[K,Pe]);const ye=g.useCallback(Ke=>{pe(Ke)},[]),Be=g.useCallback(Ke=>{Ke||pe(null)},[]),{readSet:Ze,markRead:Ye,markAllRead:Ce}=Gle(t),{expandedSet:st,toggle:wt}=JGn(t),Rt=g.useMemo(()=>Ht.filter(Ke=>!Ke.read&&!Ze.has(Ls(Ke))).length,[Ht,Ze]),Yn=g.useCallback(Ke=>Ye(Ls(Ke)),[Ye]),On=g.useMemo(()=>({readSet:Ze,getMessageKey:Ls}),[Ze]),{teamNames:Vn,teamColorByName:cr}=qle(N),Fe=g.useCallback(()=>{const Ke=Ht.filter(It=>!It.read&&!Ze.has(Ls(It))).map(It=>Ls(It));Ce(Ke)},[Ht,Ze,Ce]);g.useEffect(()=>{if(Object.keys(f).length===0)return;const Ke=z8n(f,lt);Ke!==f&&h(()=>Ke)},[h,f,lt]);const $e=g.useCallback((Ke,It,Br,Fr,Ie,Ne)=>{const vn=Date.now();h(jn=>({...jn,[Ke]:vn})),T(t,{member:Ke,text:It,summary:Br,attachments:Fr,actionMode:Ie,taskRefs:Ne,sessionKey:xt&&xt!=="__unassigned__"?xt:void 0}).then(jn=>{jn?.runtimeDelivery?.attempted===!0&&jn.runtimeDelivery.delivered===!1&&h(Rs=>{if(Rs[Ke]!==vn)return Rs;const zs={...Rs};return delete zs[Ke],zs})}).catch(()=>{h(jn=>{if(jn[Ke]!==vn)return jn;const Rs={...jn};return delete Rs[Ke],Rs})})},[t,T,h,xt]),xe=g.useCallback((Ke,It,Br,Fr,Ie)=>{E({fromTeam:t,fromMember:"user",toTeam:Ke,text:It,taskRefs:Ie,actionMode:Fr,summary:Br})},[t,E]),ke=g.useCallback(()=>{r("inline")},[r]),de=g.useCallback(()=>{r("sidebar")},[r]),Le=g.useCallback(()=>{mn(ZRe),r("bottom-sheet")},[r]),Ue=g.useCallback(Ke=>{mn(Ke),H.current?.snapTo(Ke)},[]),mt=g.useCallback(()=>{if(ct===sQ){Ue(ZRe);return}Ue(sQ)},[ct,Ue]),vt=g.useMemo(()=>{const Ke=jt>0?Math.max(jt-1,96):Number.POSITIVE_INFINITY,It=Math.min(j8n,Ke),Br=Math.min(Math.max(It+Lt,It+120),Ke),Fr=Math.min(Math.max(jt>0?Math.round(jt*.58):520,Br+140),Ke);return[0,It,Br,Fr,1]},[jt,Lt]),ft=g.useMemo(()=>Math.min(Math.max(ct,sQ),X8n),[ct]),zt=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(Mi,{size:12,className:"shrink-0 text-[var(--color-text-muted)]"}),u.jsx("input",{type:"text",placeholder:"搜索...",value:be,onChange:Ke=>_e(Ke.target.value),onPointerDown:Ke=>Ke.stopPropagation(),onClick:Ke=>Ke.stopPropagation(),className:"min-w-0 flex-1 bg-transparent text-xs text-[var(--color-text)] placeholder:text-[var(--color-text-muted)] focus:outline-none"}),be&&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:()=>_e(""),children:u.jsx(Ar,{size:14})})]}),u.jsx(I8n,{teamName:t,members:i,filter:re,messages:Nt,open:J,onOpenChange:F,onApply:ge})]}),En=u.jsxs("div",{className:"flex items-center gap-2",children:[zt,u.jsxs(it,{children:[u.jsx(ot,{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:Ke=>{Ke.stopPropagation(),ue(It=>!It)},children:W?u.jsx(zk,{size:14}):u.jsx(j4,{size:14})})}),u.jsx(tt,{side:"bottom",children:W?"展开全部消息":"折叠全部消息"})]})]}),Cn=u.jsxs("div",{className:"pb-14",children:[u.jsx(y9,{teamName:t,members:i,isTeamAlive:a,sending:w,sendError:P,sendWarning:k,sendDebugDetails:C,lastResult:I,sessions:we,selectedSessionKey:xt,onSessionChange:Ge,textareaRef:ne,onSend:$e,onCrossTeamSend:xe}),u.jsx(x9,{members:i,tasks:o,messages:Nt,pendingRepliesByMember:f,layout:"flow",position:"inline",onMemberClick:m,onTaskClick:O}),u.jsx(_9,{messages:qe,teamName:t,members:i,readState:On,allCollapsed:W,expandOverrides:st,onToggleExpandOverride:wt,currentLeadSessionId:p,isTeamAlive:a,leadActivity:c,leadContextUpdatedAt:l,teamNames:Vn,teamColorByName:cr,onTeamClick:R,onMemberClick:m,onCreateTaskFromMessage:void 0,onReplyToMessage:b,onMessageVisible:Yn,onRestartTeam:y,onTaskIdClick:x,onExpandItem:ye,onExpandContent:ae,viewport:me}),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":q,disabled:q,onClick:()=>void M(),children:"加载更早消息"}),u.jsxs("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:["已加载 ",V," 条"]})]})}),u.jsx(BC,{expandedItem:Pe,open:K!==null,onOpenChange:Be,teamName:t,members:i,onCreateTaskFromMessage:void 0,onReplyToMessage:b,onMemberClick:m,onTaskIdClick:x,onRestartTeam:y,teamNames:Vn,teamColorByName:cr,onTeamClick:R})]});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(da,{size:14,className:"shrink-0 text-[var(--color-text-muted)]"}),u.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:"消息"}),Ht.length>0&&u.jsx(Ut,{variant:"secondary",className:"px-1.5 py-0.5 text-[10px] font-normal leading-none",children:Ht.length}),Rt>0&&u.jsxs(it,{children:[u.jsx(ot,{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:[Rt," 条新消息"]})}),u.jsxs(tt,{side:"bottom",children:[Rt," 条未读"]})]}),Rt>0&&u.jsxs(it,{children:[u.jsx(ot,{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:Fe,children:u.jsx(EQ,{size:12})})}),u.jsx(tt,{side:"bottom",children:"全部标为已读"})]}),u.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[u.jsxs(it,{children:[u.jsx(ot,{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(Ke=>!Ke),"aria-label":W?"展开全部消息":"折叠全部消息",children:W?u.jsx(zk,{size:14}):u.jsx(j4,{size:14})})}),u.jsx(tt,{side:"bottom",children:W?"展开全部消息":"折叠全部消息"})]}),u.jsxs(it,{children:[u.jsx(ot,{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:()=>le(Ke=>!Ke),"aria-label":ie?"隐藏消息搜索":"显示消息搜索",children:ie?u.jsx(Ar,{size:14}):u.jsx(Mi,{size:14})})}),u.jsx(tt,{side:"bottom",children:ie?"隐藏搜索":"搜索消息"})]}),u.jsxs(it,{children:[u.jsx(ot,{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:ke,"aria-label":"将消息移到页面内面板",children:u.jsx(KIe,{size:14})})}),u.jsx(tt,{side:"bottom",children:"移到页面内"})]})]})]}),ie&&u.jsx("div",{className:"shrink-0 border-b border-[var(--color-border)] px-3 py-1.5",children:zt}),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:Ke=>{const It=Ke.currentTarget.scrollTop;Xt(It),ce(It)},children:[u.jsxs("div",{className:"pl-3",children:[u.jsx(y9,{teamName:t,members:i,isTeamAlive:a,sending:w,sendError:P,sendWarning:k,sendDebugDetails:C,lastResult:I,sessions:we,selectedSessionKey:xt,onSessionChange:Ge,textareaRef:ne,onSend:$e,onCrossTeamSend:xe}),u.jsx(x9,{members:i,tasks:o,messages:Nt,pendingRepliesByMember:f,layout:"flow",position:"sidebar",onMemberClick:m,onTaskClick:O})," "]}),u.jsx(_9,{messages:qe,teamName:t,members:i,readState:On,allCollapsed:W,expandOverrides:st,onToggleExpandOverride:wt,currentLeadSessionId:p,isTeamAlive:a,leadActivity:c,leadContextUpdatedAt:l,teamNames:Vn,teamColorByName:cr,onTeamClick:R,onMemberClick:m,onCreateTaskFromMessage:void 0,onReplyToMessage:b,onMessageVisible:Yn,onRestartTeam:y,onTaskIdClick:x,onExpandItem:ye,onExpandContent:ae,viewport:me}),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":q,disabled:q,onClick:()=>void M(),children:"加载更早消息"}),u.jsxs("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:["已加载 ",V," 条"]})]})}),u.jsx(BC,{expandedItem:Pe,open:K!==null,onOpenChange:Be,teamName:t,members:i,onCreateTaskFromMessage:void 0,onReplyToMessage:b,onMemberClick:m,onTaskIdClick:x,onRestartTeam:y,teamNames:Vn,teamColorByName:cr,onTeamClick:R})]})]});if(n==="bottom-sheet"){if(!s)return u.jsx("div",{className:"hidden","aria-hidden":"true"});const Ke=ft===sQ;return u.jsx(jw,{ref:H,isOpen:!0,onClose:ke,mountPoint:s,avoidKeyboard:!1,detent:"full",snapPoints:vt,initialSnap:ft,onSnap:mn,disableDismiss:!0,disableScrollLocking:!0,style:{zIndex:30},className:"!pointer-events-none !absolute !inset-0",unstyled:!0,children:u.jsxs(jw.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(jw.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(jw.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(da,{size:13,className:"shrink-0 text-[var(--color-text-muted)]"}),u.jsx("span",{className:"text-[13px] font-medium text-[var(--color-text)]",children:"消息"}),Ht.length>0&&u.jsx(Ut,{variant:"secondary",className:"px-1 py-0 text-[9px] font-normal leading-none",children:Ht.length}),Rt>0&&u.jsxs(it,{children:[u.jsx(ot,{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:[Rt," 条新消息"]})}),u.jsxs(tt,{side:"top",children:[Rt," 条未读"]})]}),u.jsxs("div",{className:"ml-auto flex items-center gap-1",onPointerDown:It=>It.stopPropagation(),children:[Rt>0&&u.jsxs(it,{children:[u.jsx(ot,{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:Fe,"aria-label":"将全部消息标为已读",children:u.jsx(EQ,{size:13})})}),u.jsx(tt,{side:"top",children:"全部标为已读"})]}),u.jsxs(it,{children:[u.jsx(ot,{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(It=>!It),"aria-label":W?"展开全部消息":"折叠全部消息",children:W?u.jsx(zk,{size:14}):u.jsx(j4,{size:14})})}),u.jsx(tt,{side:"top",children:W?"展开全部消息":"折叠全部消息"})]}),u.jsxs(it,{children:[u.jsx(ot,{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:()=>le(It=>!It),"aria-label":ie?"隐藏消息搜索":"显示消息搜索",children:ie?u.jsx(Ar,{size:14}):u.jsx(Mi,{size:14})})}),u.jsx(tt,{side:"top",children:ie?"隐藏搜索":"搜索消息"})]}),u.jsxs(it,{children:[u.jsx(ot,{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:mt,"aria-label":Ke?"展开底部消息面板":"折叠底部消息面板",children:Ke?u.jsx(Wft,{size:14}):u.jsx(Vft,{size:14})})}),u.jsx(tt,{side:"top",children:Ke?"展开面板":"折叠面板"})]}),u.jsxs(it,{children:[u.jsx(ot,{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(_pe,{size:14})})}),u.jsx(tt,{side:"top",children:"移到页面内"})]}),u.jsxs(it,{children:[u.jsx(ot,{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:de,"aria-label":"将消息移到侧边栏",children:u.jsx($H,{size:14})})}),u.jsx(tt,{side:"top",children:"移到侧边栏"})]})]})]})]})}),!Ke&&u.jsxs(jw.Content,{className:"min-h-0 bg-[var(--color-surface-sidebar)]",scrollClassName:"flex min-h-full flex-col",scrollRef:se,disableDrag:It=>It.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:[ie&&u.jsx("div",{className:"border-b border-[var(--color-border)] px-3 py-2",children:zt}),u.jsx("div",{className:"p-3",children:u.jsx(y9,{teamName:t,layout:"compact",members:i,isTeamAlive:a,sending:w,sendError:P,sendWarning:k,sendDebugDetails:C,lastResult:I,sessions:we,selectedSessionKey:xt,onSessionChange:Ge,textareaRef:ne,onSend:$e,onCrossTeamSend:xe})})]}),u.jsx("div",{className:"shrink-0 px-3 pt-2",children:u.jsx(x9,{members:i,tasks:o,messages:Nt,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(_9,{messages:qe,teamName:t,members:i,readState:On,allCollapsed:W,expandOverrides:st,onToggleExpandOverride:wt,currentLeadSessionId:p,isTeamAlive:a,leadActivity:c,leadContextUpdatedAt:l,teamNames:Vn,teamColorByName:cr,onTeamClick:R,onMemberClick:m,onCreateTaskFromMessage:void 0,onReplyToMessage:b,onMessageVisible:Yn,onRestartTeam:y,onTaskIdClick:x,onExpandItem:ye,onExpandContent:ae,viewport:me}),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":q,disabled:q,onClick:()=>void M(),children:"加载更早消息"}),u.jsxs("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:["已加载 ",V," 条"]})]})})]}),u.jsx(BC,{expandedItem:Pe,open:K!==null,onOpenChange:Be,teamName:t,members:i,onCreateTaskFromMessage:void 0,onReplyToMessage:b,onMemberClick:m,onTaskIdClick:x,onRestartTeam:y,teamNames:Vn,teamColorByName:cr,onTeamClick:R})]})]})})}return u.jsx(nf,{sectionId:"messages",title:"消息",icon:u.jsx(da,{size:14}),badge:Ht.length,secondaryBadge:Ht.length>0&&Rt>0?Rt:void 0,afterBadge:Rt>0?u.jsxs(it,{children:[u.jsx(ot,{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:Ke=>{Ke.stopPropagation(),Fe()},children:u.jsx(EQ,{size:12})})}),u.jsx(tt,{side:"bottom",children:"全部标为已读"})]}):void 0,headerExtra:v?u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsxs(it,{children:[u.jsx(ot,{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:Ke=>{Ke.stopPropagation(),Le()},"aria-label":"将消息移到底部面板",children:u.jsx(_pe,{size:14})})}),u.jsx(tt,{side:"top",children:"移到底部面板"})]}),u.jsxs(it,{children:[u.jsx(ot,{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:Ke=>{Ke.stopPropagation(),de()},"aria-label":"将消息移到侧边栏",children:u.jsx($H,{size:14})})}),u.jsx(tt,{side:"top",children:"移到侧边栏"})]})]}):void 0,defaultOpen:!0,action:u.jsx("div",{className:"flex items-center gap-2 px-2",children:En}),children:Cn})});function F8n(e){return e.ledgerSummary?.deletedInTask?"deleted":e.isNewFile||e.ledgerSummary?.createdInTask?"added":"modified"}const Y8n=({open:e,onOpenChange:t,teamName:n,taskId:r,taskChangeRequestOptions:s})=>{const i=oe(h=>h.changeSetLoading),o=oe(h=>h.changeSetError),a=oe(h=>h.activeChangeSet),c=oe(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=F8n(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 KRe(e){return vT(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 V8n(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 q8n(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 W8n=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?`${KRe(new Date(o.registeredAt))} 前`:`${KRe(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(Lo,{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 ee.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 ee.teams.killProcess(t,o.pid),title:"停止进程(SIGTERM)",children:[u.jsx(nMe,{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 ee.openExternal(o.url),title:"在浏览器中打开",children:[u.jsx(Ef,{size:10}),"打开"]}),u.jsxs("span",{className:"font-mono text-[var(--color-text-muted)]",children:["PID",o.pid]}),o.registeredBy&&u.jsx(zr,{name:o.registeredBy,color:s.get(o.registeredBy),teamName:t}),u.jsx("span",{className:"text-[var(--color-text-muted)]",children:c})]})]},o.id)})})},G8n);function G8n(e,t){return e.teamName===t.teamName&&V8n(e.members,t.members)&&q8n(e.processes,t.processes)}const iQ=g.memo(function({teamName:t}){return u.jsx(uKe,{teamName:t,surface:"flat",dismissible:!0,className:"mb-3"})});function Ist(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 H8n(e){const{suppressionKey:t,currentKey:n}=e;return t===n&&Ist(e)}const Z8n=g.lazy(()=>Qe(()=>import("./ProjectEditorOverlay-DrZKGMUE.js"),__vite__mapDeps([61,1])).then(e=>({default:e.ProjectEditorOverlay}))),K8n=1e4,Oue="schedule:",J8n=new Set(["pending","warming_up","warm","running"]);function aD(e){return e.startsWith(Oue)}function JRe(e){return aD(e)?e.slice(Oue.length):null}function e9n(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 t9n(e){const t=g.useMemo(()=>(e??[]).filter(r=>!r.removedAt),[e]),n=g.useRef(t);return e9n(n.current,t)||(n.current=t),n.current}function n9n(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 r9n=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(Kn,{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(Zv,{size:12}),"启动"]})]})});function s9n(e){if(!e)return;const t=new Map(Object.entries(e));return t.size>0?t:void 0}function i9n(e){if(!e)return;const t=new Map(Object.entries(e));return t.size>0?t:void 0}const o9n=g.memo(function({teamName:t,isTeamProvisioning:n,isTeamAlive:r}){const{leadActivity:s,memberSpawnStatuses:i,memberSpawnSnapshot:o,fetchMemberSpawnStatuses:a}=oe(Et(c=>({leadActivity:c.leadActivityByTeam[t],memberSpawnStatuses:c.memberSpawnStatusesByTeam[t],memberSpawnSnapshot:c.memberSpawnSnapshotsByTeam[t],fetchMemberSpawnStatuses:c.fetchMemberSpawnStatuses})));return g.useEffect(()=>{const c=k3n(i,o);if((n||c||i==null&&(r===!0||s==="active"||s==="idle"))&&a(t),!n&&!c)return;const d=window.setInterval(()=>{a(t)},w3n);return()=>{window.clearInterval(d)}},[a,r,n,s,o,i,t]),null}),a9n=15e3,l9n=g.memo(function({teamName:t,isTeamProvisioning:n,isTeamAlive:r,isThisTabActive:s}){const{leadActivity:i,fetchTeamAgentRuntime:o}=oe(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)},a9n);return()=>{window.clearInterval(c)}},[o,r,n,s,i,t]),null}),c9n=g.memo(function({teamName:t,tabId:n,projectId:r,leadSessionId:s,sessionHistoryKey:i,isThisTabActive:o,isTeamAlive:a,sessions:c,sessionsLoading:l}){const d=oe(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(Ist({leadSessionId:s,projectId:r,sessionsLoading:l,knownSessions:c})){p.current=f;return}const m=()=>{H8n({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}),u9n=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}=oe(Et(R=>({leadTabData:n?R.tabSessionData[n]??null:null,leadContextSnapshot:R.leadContextByTeam[t]??null,isContextPanelVisible:n?R.tabUIStates.get(n)?.showContextPanel??!1:!1,selectedContextPhase:n?R.tabUIStates.get(n)?.selectedContextPhase??null:null,setContextPanelVisibleForTab:R.setContextPanelVisibleForTab,setSelectedContextPhaseForTab:R.setSelectedContextPhaseForTab,fetchSessionDetail:R.fetchSessionDetail}))),[h,m]=g.useState(!1),O=g.useCallback(R=>{n&&d(n,R)},[d,n]),_=g.useCallback(R=>{n&&p(n,R)},[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 R=b?.processes;if(!R||R.length===0)return;const $=R.reduce((A,j)=>A+(j.metrics.costUsd??0),0);return $>0?$: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 R=l;let $;if(R!==null&&S){const q=S.phases.find(z=>z.phaseNumber===R);q&&($=q.lastAIGroupId)}if(!$){const q=[...y.items].reverse().find(z=>z.type==="ai");if(q?.type!=="ai")return{allContextInjections:[],lastAssistantUsage:null,lastAssistantModelName:void 0};$=q.group.id}const j=x.get($)?.accumulatedInjections??[];let Q=null,U;const M=y.items.find(q=>q.type==="ai"&&q.group.id===$);if(M?.type==="ai"){const q=M.group.responses||[];for(let z=q.length-1;z>=0;z--){const L=q[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(()=>Ece(w),[w]),I=g.useMemo(()=>Itt({usage:P,modelName:k,contextWindowTokens:a?.contextWindowTokens??null,visibleContextTokens:C}),[k,P,a?.contextWindowTokens,C]),N=g.useMemo(()=>{const R=I.contextUsedPercentOfContextWindow??a?.contextUsedPercent;return R==null?null:`${R.toFixed(1)}%`},[I.contextUsedPercentOfContextWindow,a?.contextUsedPercent]);return s?u.jsxs(u.Fragment,{children:[c&&u.jsx("div",{className:"w-80 shrink-0",children:T?u.jsx(Ntt,{injections:w,onClose:()=>O(!1),projectRoot:b?.session?.projectPath??i,contextMetrics:I,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:N??"上下文"})})]}):null}),d9n=g.memo(function({teamName:t,...n}){const{leadActivity:r,progress:s,memberSpawnStatuses:i,memberSpawnSnapshot:o,runtimeSnapshot:a}=oe(Et(f=>({leadActivity:f.leadActivityByTeam[t],progress:Df(f,t),memberSpawnStatuses:f.memberSpawnStatusesByTeam[t],memberSpawnSnapshot:f.memberSpawnSnapshotsByTeam[t],runtimeSnapshot:f.teamAgentRuntimeByTeam[t]}))),c=g.useMemo(()=>s9n(i),[i]),l=g.useMemo(()=>i9n(a?.members),[a?.members]),d=a?.runId??o?.runId??s?.runId,p=g.useMemo(()=>s?.state!=="ready"?!1:Dz(Qz({members:n.members,memberSpawnStatuses:i,memberSpawnSnapshot:o})).hasMembersStillJoining,[o,i,s?.state,n.members]);return u.jsx(aYn,{...n,leadActivity:r,memberSpawnStatuses:c,memberRuntimeEntries:l,runtimeRunId:d,isLaunchSettling:p})}),p9n=g.memo(function({teamName:t,...n}){const{leadActivity:r,leadContextUpdatedAt:s}=oe(Et(i=>({leadActivity:i.leadActivityByTeam[t],leadContextUpdatedAt:i.leadContextByTeam[t]?.updatedAt})));return u.jsx(B8n,{...n,teamName:t,leadActivity:r,leadContextUpdatedAt:s})}),f9n=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}=oe(Et(m=>({leadActivity:m.leadActivityByTeam[t],liveMember:n?SXe(m,t,n.name):null,progress:Df(m,t),launchMembers:Xse(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??Df(m,t)?.runId,runtimeEntry:n?m.teamAgentRuntimeByTeam[t]?.members[n.name]:void 0}))),h=g.useMemo(()=>o?.state!=="ready"?!1:Dz(Qz({members:a,memberSpawnStatuses:c,memberSpawnSnapshot:l})).hasMembersStillJoining,[a,l,c,o?.state]);return u.jsx(VFn,{...r,teamName:t,member:i??n,isLaunchSettling:h,leadActivity:s,spawnEntry:d,runtimeEntry:f,runtimeRunId:p})}),h9n=({teamName:e,isPaneFocused:t=!1})=>{const{isLight:n}=Us(),[r,s]=g.useState(null),[i,o]=g.useState(null),[a,c]=g.useState(null),[l,d]=g.useState(null),[p,f]=g.useState(()=>WRe(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 Te=!1;return(async()=>{try{const St=await ee.teams.getSavedRequest(e);Te||w(St??null)}catch{Te||w(null)}})(),()=>{Te=!0}},[v,e]);const[P,k]=g.useState({open:!1,mode:"launch"}),[C,I]=g.useState(!1),N=g.useRef(null),R=g.useRef(null),$=g.useRef(!1);g.useEffect(()=>{const Te=N.current;Te&&(C?Te.setAttribute("inert",""):Te.removeAttribute("inert"))},[C]),g.useEffect(()=>{const Te=Pr=>{const{teamName:Yo,taskId:_c}=Pr.detail??{};if(Yo!==e||!le)return;const oh=le.tasks.find(ZB=>ZB.id===_c);oh&&o(oh)},St=Pr=>{const{teamName:Yo,memberName:_c}=Pr.detail??{};Yo===e&&(L(_c),Y(void 0),te(void 0),j(!0))},Zn=Pr=>{const{teamName:Yo,memberName:_c,initialTab:oh,initialActivityFilter:ZB}=Pr.detail??{};if(Yo!==e||!le)return;const _ue=K.find(oit=>oit.name===_c);_ue&&(c(_ue),d({initialTab:oh,initialActivityFilter:ZB}))},ys=Pr=>{const{teamName:Yo,owner:_c}=Pr.detail??{};Yo===e&&cu("","",_c??"")};window.addEventListener("graph:open-task",Te),window.addEventListener("graph:send-message",St),window.addEventListener("graph:open-profile",Zn),window.addEventListener("graph:create-task",ys);const ss=Pr=>Yo=>{const{teamName:_c,taskId:oh}=Yo.detail??{};_c!==e||!oh||Pr(oh)},ht=ss(Pr=>{(async()=>{try{const Yo=await Lt(e,Pr);if(le?.isAlive){const _c=le.tasks.find(oh=>oh.id===Pr);try{Yo.notifiedOwner&&_c?.owner&&await ee.teams.processSend(e,`Task ${Gr(_c)} "${_c.subject}" has started. Please begin working on it.`)}catch{}}}catch{}})()}),pn=ss(Pr=>{(async()=>{try{await Ge(e,Pr,"completed")}catch{}})()}),ui=ss(Pr=>{(async()=>{try{await yt(e,Pr,{op:"set_column",column:"approved"})}catch{}})()}),Ha=ss(Pr=>{(async()=>{try{await ct(e,Pr)}catch{}})()}),vp=ss(Pr=>{s(Pr)}),dA=ss(Pr=>{(async()=>{try{await Ge(e,Pr,"pending")}catch{}})()}),dx=ss(Pr=>{(async()=>{try{await yt(e,Pr,{op:"remove"}),await Ge(e,Pr,"completed")}catch{}})()}),Tp=ss(Pr=>Yt(Pr));return window.addEventListener("graph:start-task",ht),window.addEventListener("graph:complete-task",pn),window.addEventListener("graph:approve-task",ui),window.addEventListener("graph:request-review",Ha),window.addEventListener("graph:request-changes",vp),window.addEventListener("graph:cancel-task",dA),window.addEventListener("graph:move-back-to-done",dx),window.addEventListener("graph:delete-task",Tp),()=>{window.removeEventListener("graph:open-task",Te),window.removeEventListener("graph:send-message",St),window.removeEventListener("graph:open-profile",Zn),window.removeEventListener("graph:create-task",ys),window.removeEventListener("graph:start-task",ht),window.removeEventListener("graph:complete-task",pn),window.removeEventListener("graph:approve-task",ui),window.removeEventListener("graph:request-review",Ha),window.removeEventListener("graph:request-changes",vp),window.removeEventListener("graph:cancel-task",dA),window.removeEventListener("graph:move-back-to-done",dx),window.removeEventListener("graph:delete-task",Tp)}});const[A,j]=g.useState(!1),[Q,U]=g.useState(!1),[M,q]=g.useState(!1),[z,L]=g.useState(void 0),[V,Y]=g.useState(void 0),[ne,te]=g.useState(void 0),[H,Z]=g.useState(void 0),[se,he]=g.useState({open:!1,mode:"task"}),[ce,me]=g.useState([]),ae=P.open,[G,be]=g.useState([]),[_e,re]=g.useState(!1),[ge,J]=g.useState(null),[F,W]=g.useState({sessionId:null,selectedOwners:new Set,columns:new Set}),[ue,ie]=g.useState({field:"updatedAt"}),{data:le,members:K,loading:pe,error:we,projects:Ee,repositoryGroups:Ae,initTabUIState:We,selectTeam:et,updateKanban:yt,updateKanbanColumnOrder:xt,updateTaskStatus:Ge,updateTaskOwner:Ct,sendTeamMessage:Xt,requestReview:ct,createTeamTask:mn,startTaskByUser:Lt,deleteTeam:Sn,openTeamsTab:jt,closeTab:dn,sendingMessage:ze,sendMessageError:rt,sendMessageWarning:Nt,sendMessageDebugDetails:Ht,lastSendMessageResult:qe,reviewActionError:lt,restartMember:Pe,skipMemberForLaunch:ye,removeMember:Be,updateMemberRole:Ze,launchTeam:Ye,provisioningError:Ce,clearProvisioningError:st,isTeamProvisioning:wt,refreshTeamData:Rt,refreshTeamMessagesHead:Yn,refreshMemberActivityMeta:On,syncTeamPendingReplyRefresh:Vn,kanbanFilterQuery:cr,clearKanbanFilter:Fe,softDeleteTask:$e,restoreTask:xe,fetchDeletedTasks:ke,deletedTasks:de,launchParams:Le,selectReviewFile:Ue,pendingReviewRequest:mt,setPendingReviewRequest:vt,teams:ft,schedules:zt,scheduleRuns:En,scheduleRunsLoading:Cn,fetchSchedules:Ke,fetchRunHistory:It,triggerScheduleNow:Br,removeSchedule:Fr,fetchTeams:Ie}=oe(Et(Te=>({projects:Te.projects,repositoryGroups:Te.repositoryGroups,initTabUIState:Te.initTabUIState,selectTeam:Te.selectTeam,updateKanban:Te.updateKanban,updateKanbanColumnOrder:Te.updateKanbanColumnOrder,updateTaskStatus:Te.updateTaskStatus,updateTaskOwner:Te.updateTaskOwner,sendTeamMessage:Te.sendTeamMessage,requestReview:Te.requestReview,createTeamTask:Te.createTeamTask,startTaskByUser:Te.startTaskByUser,deleteTeam:Te.deleteTeam,openTeamsTab:Te.openTeamsTab,closeTab:Te.closeTab,sendingMessage:Te.sendingMessage,sendMessageError:Te.sendMessageError,sendMessageWarning:Te.sendMessageWarning,sendMessageDebugDetails:Te.sendMessageDebugDetails,lastSendMessageResult:Te.lastSendMessageResult,reviewActionError:Te.reviewActionError,restartMember:Te.restartMember,skipMemberForLaunch:Te.skipMemberForLaunch,removeMember:Te.removeMember,updateMemberRole:Te.updateMemberRole,launchTeam:Te.launchTeam,provisioningError:e?Te.provisioningErrorByTeam[e]??null:null,clearProvisioningError:Te.clearProvisioningError,isTeamProvisioning:e?Yy(Te,e):!1,data:Te.selectedTeamName===e?Te.selectedTeamData:null,members:Pl(Te,e),loading:Te.selectedTeamName===e?Te.selectedTeamLoading:!1,error:Te.selectedTeamName===e?Te.selectedTeamError:null,refreshTeamData:Te.refreshTeamData,refreshTeamMessagesHead:Te.refreshTeamMessagesHead,refreshMemberActivityMeta:Te.refreshMemberActivityMeta,syncTeamPendingReplyRefresh:Te.syncTeamPendingReplyRefresh,kanbanFilterQuery:Te.kanbanFilterQuery,clearKanbanFilter:Te.clearKanbanFilter,softDeleteTask:Te.softDeleteTask,restoreTask:Te.restoreTask,fetchDeletedTasks:Te.fetchDeletedTasks,deletedTasks:Te.deletedTasks,launchParams:e?Te.launchParamsByTeam[e]:void 0,selectReviewFile:Te.selectReviewFile,pendingReviewRequest:Te.pendingReviewRequest,setPendingReviewRequest:Te.setPendingReviewRequest,teams:Te.teams,schedules:Te.schedules,scheduleRuns:Te.scheduleRuns,scheduleRunsLoading:Te.scheduleRunsLoading,fetchSchedules:Te.fetchSchedules,fetchRunHistory:Te.fetchRunHistory,triggerScheduleNow:Te.triggerNow,removeSchedule:Te.deleteSchedule,fetchTeams:Te.fetchTeams}))),Ne=$3(),vn=oe(Te=>Te.activeTabId),jn=Ne?vn===Ne:!1,Rs=g.useRef(!1),zs=g.useCallback(Te=>{},[]);g.useEffect(()=>{Ne&&We(Ne)},[Ne,We]),g.useEffect(()=>{f(WRe(e))},[e]),g.useEffect(()=>{O8n(e,p)},[p,e]),g.useEffect(()=>{const Te=$.current;$.current=wt,!Te&&wt&&R.current?.scrollIntoView({behavior:"smooth",block:"start"})},[wt]);const[Fa,sn]=g.useState(""),Nn=oe(Te=>Te.editorPendingRevealFile);g.useEffect(()=>{Nn&&le?.config.projectPath&&I(!0)},[Nn,le?.config.projectPath]),g.useEffect(()=>{e&&(et(e),ke(e))},[e,et,ke]),g.useEffect(()=>{Ke()},[Ke]);const Rn=g.useMemo(()=>zt.filter(Te=>Te.teamName===e),[zt,e]);g.useEffect(()=>{for(const Te of Rn)En[Te.id]||Cn[Te.id]||It(Te.id)},[It,En,Cn,Rn]);const ar=g.useMemo(()=>Rn.map(Te=>{const St=(En[Te.id]??[])[0],ys=(St?J8n.has(St.status):!1)?"in_progress":"pending",ss=Te.label?.trim()||SX(Te.cronExpression),ht=St?`最近运行:${St.status}${St.startedAt?` (${new Date(St.startedAt).toLocaleString("zh-CN")})`:""}`:null,pn=Te.nextRunAt?`下次执行:${new Date(Te.nextRunAt).toLocaleString("zh-CN")}`:null;return{id:`${Oue}${Te.id}`,displayId:`SCH-${Te.id.slice(0,6)}`,subject:`[定时] ${ss}`,description:[`Cron: ${Te.cronExpression}`,`时区: ${Te.timezone}`,pn,ht].filter(ui=>!!ui).join(`
|
|
1824
|
+
`,G=O.current;I(G?ae+G:ae)}if(te.length===0)return;let Z=0;for(const ae of te){const G=m7e(ae);if(!G.valid){c(G.error);return}Z+=ae.size}const se=[];for(const ae of te)try{const G=await O7e(ae);se.push(G)}catch{c(`读取文件失败:${ae.name}`);return}const he=b.current;if(he.length+se.length>mg){c(`最多允许添加 ${mg} 个附件`);return}if(he.reduce((ae,G)=>ae+G.size,0)+Z>Ev){c("附件总大小超过 20MB 限制");return}const me=[...he,...se];b.current=me,o(me),f(!1),k()},[k,I]),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]),M=g.useCallback(()=>{v.current=!0,b.current=[],o([]),c(null),f(!1),k()},[k]),q=g.useCallback(()=>{c(null)},[]),z=g.useCallback(Y=>{const ne=Y.clipboardData?.items;if(!ne)return;const te=[];for(const H of Array.from(ne))if(H.kind==="file"){const Z=H.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]),V=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),vO.deleteSnapshot(x.current)},[]);return{text:t,setText:I,chips:r,addChip:N,removeChip:R,attachments:i,attachmentError:a,canAddMore:j,addFiles:Q,removeAttachment:U,clearAttachments:M,clearAttachmentError:q,handlePaste:z,handleDrop:L,actionMode:l,setActionMode:$,isSaved:p,isLoaded:h,clearDraft:V}}const C8n=[{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 R8n(e){return e==="codex"?C8n:x7e}function P8n(e,t,n){const r=e.filter(o=>Bwe(o.rootKind,n)),s=t.filter(o=>Bwe(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 $8n(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 P8n(t,n,r)){const l=c.folderName.trim().toLowerCase();!c.isValid||!l||!WRn(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"} - ${cX(c.rootKind)}`,searchText:`${c.name} ${c.folderName}`,type:"skill"}))}return[...i,...a]}const y9=({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,onCrossTeamSend:m})=>{const O=g.useRef(null),_=g.useMemo(()=>Ce=>{O.current=Ce,typeof f=="function"?f(Ce):f&&(f.current=Ce)},[f]),[b,y]=g.useState(()=>t.find(st=>Gn(st))?.name??t[0]?.name??""),[x,S]=g.useState(!1),[v,T]=g.useState(""),E=g.useRef(null),[w,P]=g.useState(!1),k=g.useRef(0),C=g.useRef(null),[I,N]=g.useState(null),R=g.useRef(0),$=g.useRef(null),[A,j]=g.useState(null),[Q,U]=g.useState(!1),[M,q]=g.useState(new Set),z=oe(Et(Ce=>Ce.crossTeamTargets)),L=oe(Ce=>Ce.fetchCrossTeamTargets);g.useEffect(()=>{L()},[L]);const V=g.useCallback(async()=>{try{const Ce=await ee.teams.aliveList();q(new Set(Ce))}catch{}},[]);g.useEffect(()=>{V()},[V]),g.useEffect(()=>{Q&&V()},[Q,V]);const Y=g.useMemo(()=>z.filter(Ce=>Ce.teamName!==e),[z,e]),ne=g.useMemo(()=>Y.map(Ce=>({...Ce,isOnline:M.has(Ce.teamName)})).sort((Ce,st)=>Ce.isOnline&&!st.isOnline?-1:!Ce.isOnline&&st.isOnline?1:(Ce.displayName||Ce.teamName).localeCompare(st.displayName||st.teamName,void 0,{sensitivity:"base"})),[M,Y]),te=ne.length>0,H=A!==null,Z=ne.find(Ce=>Ce.teamName===A),se=Z?.displayName??A,he=H?"Tips:跨团队消息会发送到目标团队负责人。如果你希望回复发回你当前团队负责人而不是你本人,请在消息中明确说明。":void 0;g.useEffect(()=>{if(b&&t.some(wt=>wt.name===b))return;const st=t.find(wt=>Gn(wt))?.name??t[0]?.name??"";st&&st!==b&&queueMicrotask(()=>y(st))},[t,b]);const ce=oe(Ce=>Ce.selectedTeamName===e?Ce.selectedTeamData?.config.projectPath??null:null),me=oe(Ce=>{if(Ce.selectedTeamName!==e)return ll(e).border;const st=Ce.selectedTeamData?.config.color;if(st)return Ir(st).border;const wt=Ce.selectedTeamData?.config.name??e;return ll(wt).border}),ae=oe(Ce=>Yy(Ce,e)),G=k8n(e),be=g.useMemo(()=>l.find(Ce=>Ce.sessionKey===d)??null,[d,l]),_e=be?.title||be?.chatName||be?.userName||be?.sessionKey||"选择会话",re=g.useMemo(()=>to(t),[t]),ge=g.useMemo(()=>t.map(Ce=>({id:Ce.name,name:Ce.name,subtitle:ri(Ce.role)??ri(Ce.agentType)??void 0,color:re.get(Ce.name)})),[t,re]),J=g.useMemo(()=>{const Ce=t.find(st=>Gn(st));return Ta(Ce?.providerId)??Ig(Ce?.model)},[t]),{suggestions:F}=XN(e),{suggestions:W}=ix(e),ue=oe(Et(Ce=>ce?Ce.skillsProjectCatalogByProjectPath[ce]??[]:[])),ie=oe(Et(Ce=>Ce.skillsUserCatalog)),le=oe(Ce=>Ce.fetchSkillsCatalog);g.useEffect(()=>{le(ce??void 0)},[le,ce]);const K=g.useMemo(()=>$8n(R8n(J),ue,ie,J),[J,ue,ie]),pe=Dm(G.text).trim(),we=g.useMemo(()=>GT(pe),[pe]),Ee=t.find(Ce=>Ce.name===b),Ae=Ee?re.get(Ee.name):void 0,We=Ee?Gn(Ee):!1,et=We&&!H&&!!r,yt=et&&G.canAddMore,xt=et?void 0:H?"跨团队消息暂不支持文件附件":We?"团队在线时才能添加文件":"文件只能发送给团队负责人",Ge=G.attachments.length>0&&!et,Ct=we?G.attachments.length>0?"斜杠命令需要团队负责人在线,且不能与附件同时发送":H?"斜杠命令只能在当前团队负责人上执行":We?r?null:"斜杠命令需要团队负责人在线":"斜杠命令只能发送给团队负责人":null,Xt=b.length>0&&pe.length>0&&pe.length<=ic&&!s&&!ae&&!Ge&&!Ct&&(!H||m!==void 0),ct=g.useRef(!1),mn=g.useCallback(()=>{if(!Xt)return;$.current?.(),ct.current=!0;const Ce=ty(G.text,W),st=ZE(pe,G.chips);H&&A&&m?m(A,st,pe,void 0,Ce):h(b,st,pe,G.attachments.length>0?G.attachments:void 0,void 0,Ce)},[Xt,b,pe,h,m,H,A,G.attachments,G.chips,W]);g.useEffect(()=>{!s&&ct.current&&(ct.current=!1,!i&&a?.delivered!==!1&&G.clearDraft())},[s,i,a,G]);const{addFiles:Lt}=G,Sn=g.useCallback(Ce=>{const st=Ce.target;st.files?.length&&Lt(st.files),st.value=""},[Lt]),jt=g.useCallback(()=>{N(xt??"Files can only be sent to the team lead"),window.clearTimeout(R.current),R.current=window.setTimeout(()=>{N(null)},4e3)},[xt]);g.useEffect(()=>{const Ce=R;return()=>window.clearTimeout(Ce.current)},[]);const dn=g.useCallback(Ce=>{Ce.preventDefault(),k.current+=1,k.current===1&&P(!0)},[]),ze=g.useCallback(Ce=>{Ce.preventDefault(),k.current-=1,k.current<=0&&(k.current=0,P(!1))},[]),rt=g.useCallback(Ce=>{Ce.preventDefault()},[]),{handleDrop:Nt}=G,Ht=g.useCallback(Ce=>{if(Ce.preventDefault(),k.current=0,P(!1),!et){Ce.dataTransfer?.files?.length&&jt();return}Nt(Ce)},[et,Nt,jt]),{handlePaste:qe}=G,lt=g.useCallback(Ce=>{if(!et){Array.from(Ce.clipboardData.items).some(wt=>wt.kind==="file")&&(Ce.preventDefault(),jt());return}qe(Ce)},[et,qe,jt]),Pe=ic-pe.length,ye=G.attachments.length>0||!!(G.attachmentError??I),Be=!ye,Ze=n==="compact",Ye=Ct?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(Bo,{size:10,className:"shrink-0"}),Ct]}):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(Bo,{size:10,className:"shrink-0"}),i]}):o?u.jsx(ant,{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(Kr,{size:10,className:"shrink-0"}),"已复用最近一次跨团队请求"]}):null;return u.jsxs("div",{className:nt("relative",Ze?"pb-1":"mb-1.5 pb-1.5"),role:"group",onDragEnter:dn,onDragLeave:ze,onDragOver:rt,onDrop:Ht,onPaste:lt,children:[u.jsxs("div",{className:nt(Be?"mb-0":"mb-1",Ze?"space-y-1.5":"space-y-2"),children:[u.jsxs("div",{className:"flex items-center gap-2",children:[We?u.jsxs(u.Fragment,{children:[u.jsx("input",{ref:C,type:"file",accept:"*/*",multiple:!0,className:"hidden",onChange:Sn}),u.jsxs(it,{children:[u.jsx(ot,{asChild:!0,children:u.jsx("button",{type:"button",className:nt("inline-flex shrink-0 items-center gap-1 rounded p-1 transition-colors",yt?"text-[var(--color-text-secondary)] hover:text-[var(--color-text)]":"text-[var(--color-text-muted)] opacity-40"),disabled:!yt,onClick:()=>C.current?.click(),children:u.jsx(yU,{size:14})})}),u.jsx(tt,{side:"top",children:r?G.canAddMore?"添加文件(支持粘贴或拖拽)":"已达到附件上限":"团队在线时才能添加文件"})]})]}):null,u.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[!r&&!ae&&u.jsx("span",{className:"text-[10px]",style:{color:"var(--warning-text)"},children:"团队离线"}),u.jsxs("div",{className:nt("mr-[15px] inline-flex items-center border text-xs transition-colors",Be?"relative z-10 -mb-2 overflow-hidden rounded-b-none rounded-t-[1.35rem] border-b-0 bg-[var(--color-surface-raised)]":"rounded-full",H?"border-[var(--cross-team-border)]":"border-[var(--color-border)]"),children:[u.jsxs(nu,{open:Q,onOpenChange:U,children:[u.jsx(od,{asChild:!0,children:u.jsxs("button",{type:"button",className:nt("inline-flex items-center gap-1.5 border-r border-r-[var(--color-border)] px-2.5 py-1 text-xs transition-colors",Be?"rounded-bl-none rounded-tl-[1.35rem]":"rounded-l-full",H?"hover:bg-[var(--cross-team-bg)]/80 bg-[var(--cross-team-bg)] text-purple-400":"hover:bg-[var(--color-surface-raised)]"),children:[H?u.jsxs(u.Fragment,{children:[u.jsx("span",{className:nt("inline-block size-2 shrink-0 rounded-full",Z?.isOnline&&"animate-pulse"),style:{backgroundColor:Z?.isOnline?"#22c55e":Z?Z.color?Ir(Z.color).border:ll(Z.displayName).border:void 0}}),u.jsx("span",{className:"max-w-[100px] truncate",children:se})]}):u.jsxs(u.Fragment,{children:[me?u.jsx("span",{className:"inline-block size-2 shrink-0 rounded-full",style:{backgroundColor:me}}):null,u.jsx("span",{className:"max-w-[120px] truncate text-[var(--color-text-secondary)]",children:_e})]}),u.jsx(Ur,{size:12,className:"shrink-0 text-[var(--color-text-muted)]"})]})}),u.jsx(hc,{align:"end",className:"w-56 p-1.5",children:u.jsxs("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(Ce=>{const st=d===Ce.sessionKey,wt=Ce.title||Ce.chatName||Ce.userName||Ce.sessionKey;return u.jsxs("button",{type:"button",className:nt("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)]",st&&"bg-[var(--color-surface-raised)]"),onClick:()=>{p?.(Ce.sessionKey),j(null),U(!1)},children:[u.jsx("span",{className:nt("inline-block size-2 shrink-0 rounded-full",Ce.live&&"animate-pulse"),style:{backgroundColor:Ce.live?"#22c55e":me}}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-[var(--color-text)]",children:wt}),u.jsx("span",{className:"shrink-0 text-[10px] text-[var(--color-text-muted)]",children:Ce.platform}),st?u.jsx(Kr,{size:12,className:"ml-auto shrink-0 text-blue-400"}):null]},Ce.sessionKey)}),u.jsx("div",{className:"my-1 h-px bg-[var(--color-border)]"})]}),te?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"my-1 h-px bg-[var(--color-border)]"}),ne.map(Ce=>{const st=A===Ce.teamName;return u.jsxs("button",{type:"button",className:nt("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)]",st&&"bg-[var(--cross-team-bg)]"),onClick:()=>{j(Ce.teamName),y(W$),U(!1)},children:[u.jsx("span",{className:nt("inline-block size-2 shrink-0 rounded-full",Ce.isOnline&&"animate-pulse"),style:{backgroundColor:Ce.isOnline?"#22c55e":Ce.color?Ir(Ce.color).border:ll(Ce.displayName).border},title:Ce.isOnline?"在线":"离线"}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx("div",{className:"truncate text-[var(--color-text)]",children:Ce.displayName}),u.jsx("span",{className:nt("shrink-0 text-[10px]",Ce.isOnline?"text-green-400":"text-[var(--color-text-muted)]"),children:Ce.isOnline?"在线":"离线"})]}),Ce.description?u.jsx("div",{className:"truncate text-[10px] text-[var(--color-text-muted)]",children:Ce.description}):null]}),st?u.jsx(Kr,{size:12,className:"ml-auto shrink-0 text-purple-400"}):null]},Ce.teamName)})]}):null]})})]}),u.jsxs(nu,{open:H?!1:x,onOpenChange:H?void 0:S,children:[u.jsx(od,{asChild:!0,children:u.jsxs("button",{type:"button",className:nt("inline-flex items-center gap-1.5 px-2.5 py-1 text-xs transition-colors",Be?"rounded-br-none rounded-tr-[1.35rem]":"rounded-r-full",H?"cursor-default bg-[var(--cross-team-bg)] opacity-60":"hover:bg-[var(--color-surface-raised)]"),disabled:H,children:[b?u.jsx(zr,{name:b,color:Ae,size:"sm",hideAvatar:b==="user",disableHoverCard:!0}):u.jsx("span",{className:"text-[var(--color-text-muted)]",children:"选择..."}),u.jsx(Ur,{size:12,className:"shrink-0 text-[var(--color-text-muted)]"})]})}),u.jsxs(hc,{align:"end",className:"w-56 p-1.5",onOpenAutoFocus:Ce=>{Ce.preventDefault(),T(""),setTimeout(()=>E.current?.focus(),0)},children:[t.length>5&&u.jsxs("div",{className:"relative mb-1",children:[u.jsx(Mi,{size:12,className:"absolute left-2 top-1/2 -translate-y-1/2 text-[var(--color-text-muted)]"}),u.jsx("input",{ref:E,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:v,onChange:Ce=>T(Ce.target.value)})]}),u.jsx("div",{className:"max-h-48 space-y-0.5 overflow-y-auto",children:(()=>{const Ce=v.toLowerCase().trim(),st=Ce?t.filter(Rt=>Rt.name.toLowerCase().includes(Ce)):t;return st.length===0?u.jsx("div",{className:"px-2 py-3 text-center text-xs text-[var(--color-text-muted)]",children:"无匹配结果"}):[...st].sort((Rt,Yn)=>{const On=Gn(Rt)?1:0;return(Gn(Yn)?1:0)-On}).map(Rt=>{const Yn=re.get(Rt.name),On=ri(Rt.role)??ri(Rt.agentType),Vn=Rt.name===b;return u.jsxs("button",{type:"button",className:nt("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)]",Vn&&"bg-[var(--color-surface-raised)]"),onClick:()=>{y(Rt.name),S(!1),T("")},children:[u.jsx(zr,{name:Rt.name,color:Yn,size:"sm",hideAvatar:Rt.name==="user",disableHoverCard:!0}),On?u.jsx("span",{className:"shrink-0 text-[10px] text-[var(--color-text-muted)]",children:On}):null,Vn?u.jsx(Kr,{size:12,className:"ml-auto shrink-0 text-blue-400"}):null]},Rt.name)})})()})]})]})]})]})]}),ye?u.jsx(int,{attachments:G.attachments,onRemove:G.removeAttachment,error:G.attachmentError??I,onDismissError:G.clearAttachmentError,disabled:Ge,disabledHint:"仅在团队在线且接收人为团队负责人时支持附件。请移除附件或切换接收人。"}):null]}),u.jsxs("div",{className:"relative",children:[u.jsx(ont,{active:w,rejected:!et,rejectionReason:xt}),u.jsx(Um,{ref:_,id:`compose-${e}`,placeholder:ae?"团队正在启动中... 消息将排队并在稍后投递到收件箱。":H?`发送跨团队消息到 ${se??"目标团队"}...`:"输入消息...(回车发送,Shift+Enter 换行)",value:G.text,onValueChange:G.setText,suggestions:ge,teamSuggestions:F,taskSuggestions:W,commandSuggestions:K,chips:G.chips,onChipRemove:G.removeChip,projectPath:ce,onFileChipInsert:G.addChip,onModEnter:mn,dismissMentionsRef:$,extraTips:g.useMemo(()=>[`Tips:你可以输入 "/" 来运行命令,如 ${K.filter(st=>st.type==="command").slice(0,6).map(st=>st.command).join("、")} 等。`],[K]),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:ic,disabled:s,hintText:he,showHint:!Ze,cornerActionInset:"compact",cornerAction:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs(it,{children:[u.jsx(ot,{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 ee.openExternal("https://voicetext.site"),children:u.jsx(HIe,{size:14})})}),u.jsx(tt,{side:"top",children:"语音转文字"})]}),u.jsxs(it,{children:[u.jsx(ot,{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:!Xt,onClick:mn,children:[u.jsx(E$,{size:12}),"发送"]})})}),Ct?u.jsx(tt,{side:"top",children:Ct}):ae&&!s?u.jsx(tt,{side:"top",children:"团队启动期间暂不可发送"}):null]})]}),footerRight:Ze?Ye:u.jsxs("div",{className:"flex items-center gap-2",children:[Ye,Pe<200?u.jsxs("span",{className:`text-[10px] ${Pe<100?"text-yellow-400":"text-[var(--color-text-muted)]"}`,children:["剩余 ",Pe," 字符"]}):null,G.isSaved?u.jsx("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:"已保存"}):null]})})]})]})};function N8n(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 A8n(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 I8n=({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(()=>to(t),[t]),d=g.useMemo(()=>N8n(r),[r]),p=g.useMemo(()=>A8n(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(nu,{open:s,onOpenChange:i,children:[u.jsxs(it,{children:[u.jsx(ot,{asChild:!0,children:u.jsx(od,{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(bU,{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(tt,{side:"bottom",children:"筛选消息"})]}),u.jsxs(hc,{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(oi,{checked:a.from.has(y),onCheckedChange:()=>m(y)}),u.jsx(zr,{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(oi,{checked:a.to.has(y),onCheckedChange:()=>O(y)}),u.jsx(zr,{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(oi,{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:"保存"})]})]})]})]})},M8n=1e4;function HRe(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 Q8n(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=HRe(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=HRe(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<=M8n,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 D8n=({members:e,tasks:t,defaultCollapsed:n=!1,headerRight:r,onMemberClick:s,onTaskClick:i})=>{const{isLight:o}=Us(),[a,c]=g.useState(n),l=to(e),d=pp(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(Ln,{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=Ir(l.get(m.name)??""),x=ri(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:pm,border:Ac,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)??po(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:ii(y,o),color:y.text,border:`1px solid ${y.border}40`},onClick:()=>s(m),children:vl(m.name)}):u.jsx("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-medium tracking-wide",style:{backgroundColor:ii(y,o),color:y.text,border:`1px solid ${y.border}40`},children:vl(m.name)}),x?u.jsx("span",{className:"text-[10px]",style:{color:Dt},children:x}):null,u.jsx("span",{className:"shrink-0 text-[10px]",style:{color:Dt},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}-${_}`)})]})},L8n=({members:e,pendingRepliesByMember:t,pendingCrossTeamReplies:n=[],headerRight:r,onMemberClick:s})=>{const{isLight:i}=Us(),o=oe(Et(m=>m.pendingApprovals)),a=oe(Et(m=>m.teamByName)),c=to(e),l=pp(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=vT(m.sentAtMs,{addSuffix:!0});if(m.kind==="member"){const{member:_}=m,b=Ir(c.get(_.name)??""),y=ri(_.role??(_.agentType!=="general-purpose"?_.agentType:void 0)),x=Az(_.runtimeAdvisory,_.providerId),S=aze(_.runtimeAdvisory,_.providerId),v=x!==null;return u.jsx("article",{className:"activity-card-enter-animate overflow-hidden rounded-md",style:{backgroundColor:pm,border:Ac,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)??po(_.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:ii(b,i),color:b.text,border:`1px solid ${b.border}40`},onClick:()=>s(_),title:"Open member",children:vl(_.name)}):u.jsx("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-medium tracking-wide",style:{backgroundColor:ii(b,i),color:b.text,border:`1px solid ${b.border}40`},children:vl(_.name)}),y?u.jsx("span",{className:"text-[10px]",style:{color:Dt},children:y}):null,u.jsx("span",{className:`min-w-0 flex-1 truncate text-[10px] ${v?"text-amber-300":""}`,style:v?void 0:{color:Dt},title:S??"Message sent, awaiting reply",children:x??"awaiting reply"}),v?u.jsx(qt,{className:"size-3 shrink-0 animate-spin text-amber-400"}):null,u.jsx("span",{className:"shrink-0 text-[10px]",style:{color:Dt},children:O})]})},`pending-reply:${_.name}:${m.sentAtMs}`)}if(m.kind==="team"){const _=a[m.teamName]?.displayName||m.teamName,b=ll(_,i);return u.jsx("article",{className:"activity-card-enter-animate overflow-hidden rounded-md",style:{backgroundColor:pm,border:Ac,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(dc,{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:ii(b,i),color:b.text,border:`1px solid ${b.border}40`},title:m.teamName,children:_}),u.jsx("span",{className:"text-[10px]",style:{color:Dt},children:"external team"}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-[10px]",style:{color:Dt},title:"Cross-team message sent, awaiting reply",children:"awaiting reply"}),u.jsx("span",{className:"shrink-0 text-[10px]",style:{color:Dt},children:O})]})},`pending-reply:team:${m.teamName}:${m.sentAtMs}`)}return u.jsx("article",{className:"activity-card-enter-animate overflow-hidden rounded-md",style:{backgroundColor:pm,border:Ac,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(Iht,{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:Dt},title:`Tool approval: ${m.toolName}`,children:"awaiting approval"}),u.jsx("span",{className:"shrink-0 text-[10px]",style:{color:Dt},children:O})]})},`pending-reply:user:${m.sentAtMs}`)})]})},x9=({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(()=>Q8n(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(Ln,{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(L8n,{members:e,pendingRepliesByMember:r,pendingCrossTeamReplies:f,headerRight:b,onMemberClick:o}):null,u.jsx(D8n,{members:e,tasks:t,defaultCollapsed:s==="sidebar",headerRight:h?void 0:b,onMemberClick:o,onTaskClick:a})]})]})},j8n=40,sQ=1,ZRe=2,X8n=4,U8n=56;function z8n(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 B8n=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:I,teams:N,openTeamTab:R,messages:$,messagesState:A,loadOlderTeamMessages:j,refreshTeamMessagesHead:Q}=oe(Et(Ke=>({sendTeamMessage:Ke.sendTeamMessage,sendCrossTeamMessage:Ke.sendCrossTeamMessage,sendingMessage:Ke.sendingMessage,sendMessageError:Ke.sendMessageError,sendMessageWarning:Ke.sendMessageWarning,sendMessageDebugDetails:Ke.sendMessageDebugDetails,lastSendMessageResult:Ke.lastSendMessageResult,teams:Ke.teams,openTeamTab:Ke.openTeamTab,messages:mz(Ke,t),messagesState:t?Ke.teamMessagesByName[t]:void 0,loadOlderTeamMessages:Ke.loadOlderTeamMessages,refreshTeamMessagesHead:Ke.refreshTeamMessagesHead}))),U=g.useRef(null),M=g.useCallback(async()=>{!A?.hasMore||A.loadingHead||A.loadingOlder||await j(t)},[j,A,t]);(A?.loadingHead??!1)||A?.loadingOlder;const q=A?.loadingOlder??!1,z=A?.hasMore??!1,L=$,V=L.length,Y=g.useRef(!1),ne=g.useRef(null),te=g.useRef(null),H=g.useRef(null),Z=g.useRef(null),se=g.useRef(null),he=n==="inline"?S??null:n==="sidebar"?te:se,ce=g.useCallback(Ke=>{Ke>U8n||!z||A?.loadingHead||q||Y.current||(Y.current=!0,M())},[z,M,q,A?.loadingHead]);g.useEffect(()=>{q||(Y.current=!1)},[q]);const me=g.useMemo(()=>{if(he)return{scrollElementRef:he,observerRoot:he,scrollMargin:0,virtualizationEnabled:!0}},[he]),ae=g.useCallback(()=>{},[]),G=g.useRef(qRe(t)),[be,_e]=g.useState(G.current.messagesSearchQuery),[re,ge]=g.useState(G.current.messagesFilter),[J,F]=g.useState(G.current.messagesFilterOpen),[W,ue]=g.useState(G.current.messagesCollapsed),[ie,le]=g.useState(G.current.messagesSearchBarVisible),[K,pe]=g.useState(G.current.expandedItemKey),[we,Ee]=g.useState([]),[Ae,We]=g.useState(null),[et,yt]=g.useState(!1),[xt,Ge]=g.useState(null),[Ct,Xt]=g.useState(G.current.messagesScrollTop),[ct,mn]=g.useState(G.current.bottomSheetSnapIndex),[Lt,Sn]=g.useState(196),[jt,dn]=g.useState(0);g.useEffect(()=>{G.current=qRe(t),_e(G.current.messagesSearchQuery),ge(G.current.messagesFilter),F(G.current.messagesFilterOpen),ue(G.current.messagesCollapsed),le(G.current.messagesSearchBarVisible),pe(G.current.expandedItemKey),Xt(G.current.messagesScrollTop),mn(G.current.bottomSheetSnapIndex)},[t]),g.useEffect(()=>{let Ke=!1;return ee.teams.getTeamSessions(t).then(It=>{if(Ke)return;const Br=[...It].sort((Fr,Ie)=>new Date(Ie.updatedAt).getTime()-new Date(Fr.updatedAt).getTime());Ee(Br),Ge(Fr=>Fr&&Br.some(Ie=>Ie.sessionKey===Fr)?Fr:Br[0]?.sessionKey??null)}).catch(()=>{Ke||(Ee([]),Ge(null))}),()=>{Ke=!0}},[t]);const ze=g.useMemo(()=>we.find(Ke=>Ke.sessionKey===xt)??null,[xt,we]),rt=ze?.platform==="hermit"||ze?.sessionKey===`hermit:${t}:session`;g.useEffect(()=>{if(!ze||rt){We(null),yt(!1);return}let Ke=!1;return yt(!0),ee.teams.getSessionDetail(t,ze.id,200).then(It=>{Ke||We(It)}).catch(()=>{Ke||We(null)}).finally(()=>{Ke||yt(!1)}),()=>{Ke=!0}},[rt,ze,t]),g.useEffect(()=>{m8n(t,{messagesSearchQuery:be,messagesFilter:re,messagesFilterOpen:J,messagesCollapsed:W,messagesSearchBarVisible:ie,expandedItemKey:K,messagesScrollTop:Ct,bottomSheetSnapIndex:ct})},[t,be,re,J,W,ie,K,Ct,ct]),g.useEffect(()=>{const Ke=re.from.size>0||re.to.size>0;ie||be.trim().length===0&&!Ke||le(!0)},[re.from,re.to,ie,be]),g.useEffect(()=>{if(t){if(L.length>0){U.current=null;return}A?.loadingHead||A?.loadingOlder||U.current!==t&&(U.current=t,Q(t).catch(()=>{}))}},[L.length,A?.loadingHead,A?.loadingOlder,Q,t]),g.useLayoutEffect(()=>{if(n!=="sidebar")return;const Ke=te.current;Ke&&(Ke.scrollTop=Ct)},[n,Ct]),g.useEffect(()=>{if(n==="sidebar")return;const Ke=n==="bottom-sheet"?se.current:S?.current??null;if(!Ke)return;const It=()=>{ce(Ke.scrollTop)};return Ke.addEventListener("scroll",It,{passive:!0}),It(),()=>{Ke.removeEventListener("scroll",It)}},[S,ce,n]),g.useLayoutEffect(()=>{if(n!=="bottom-sheet"||typeof ResizeObserver>"u")return;const Ke=s instanceof HTMLElement?s:null,It=[[Z.current,Sn],[Ke,dn]],Br=[];for(const[Fr,Ie]of It){if(!Fr)continue;const Ne=()=>{const jn=Math.ceil(Fr.getBoundingClientRect().height);jn>0&&Ie(jn)};Ne();const vn=new ResizeObserver(()=>{Ne()});vn.observe(Fr),Br.push(vn)}return()=>{Br.forEach(Fr=>Fr.disconnect())}},[n,s]);const Nt=g.useMemo(()=>{const Ke=It=>[...It].sort((Br,Fr)=>Date.parse(Fr.timestamp)-Date.parse(Br.timestamp));return xt?ze&&!rt?Ae?[...Ae.history].reverse().map((It,Br)=>({messageId:`${Ae.id}:${Br}:${It.timestamp}`,from:It.role==="user"?"user":Ae.name||t,to:It.role==="user"?Ae.name||t:"user",text:It.content,timestamp:It.timestamp,read:!0,source:It.role==="user"?"user_sent":"inbox",session:{id:Ae.id,key:Ae.sessionKey,platform:Ae.platform,title:ze.title||ze.chatName||ze.userName||ze.sessionKey,chatName:ze.chatName,userName:ze.userName}})):[]:Ke(L.filter(It=>It.session?.key===xt)):[]},[L,rt,ze,Ae,xt,t]),Ht=g.useMemo(()=>Zee(Nt,{timeWindow:d,filter:re,searchQuery:be}),[re,be,Nt,d]),qe=g.useMemo(()=>Zee(Nt,{includePassiveIdlePeerSummariesWhenNoiseHidden:!0,timeWindow:d,filter:re,searchQuery:be}),[re,be,Nt,d]),lt=g.useMemo(()=>L.filter(Ke=>Ke.messageKind!=="task_comment_notification"&&!u$n(typeof Ke.text=="string"?Ke.text:"")),[L]),Pe=g.useMemo(()=>{if(!K)return null;if(!K.startsWith("thoughts-")){const It=qe.find(Br=>Ls(Br)===K);return It?{type:"message",message:It}:null}return KZe(qe).find(It=>It.type==="lead-thoughts"&&wv(It.group)===K)??null},[K,qe]);g.useEffect(()=>{K&&Pe===null&&pe(null)},[K,Pe]);const ye=g.useCallback(Ke=>{pe(Ke)},[]),Be=g.useCallback(Ke=>{Ke||pe(null)},[]),{readSet:Ze,markRead:Ye,markAllRead:Ce}=Gle(t),{expandedSet:st,toggle:wt}=JGn(t),Rt=g.useMemo(()=>Ht.filter(Ke=>!Ke.read&&!Ze.has(Ls(Ke))).length,[Ht,Ze]),Yn=g.useCallback(Ke=>Ye(Ls(Ke)),[Ye]),On=g.useMemo(()=>({readSet:Ze,getMessageKey:Ls}),[Ze]),{teamNames:Vn,teamColorByName:cr}=qle(N),Fe=g.useCallback(()=>{const Ke=Ht.filter(It=>!It.read&&!Ze.has(Ls(It))).map(It=>Ls(It));Ce(Ke)},[Ht,Ze,Ce]);g.useEffect(()=>{if(Object.keys(f).length===0)return;const Ke=z8n(f,lt);Ke!==f&&h(()=>Ke)},[h,f,lt]);const $e=g.useCallback((Ke,It,Br,Fr,Ie,Ne)=>{const vn=Date.now();h(jn=>({...jn,[Ke]:vn})),T(t,{member:Ke,text:It,summary:Br,attachments:Fr,actionMode:Ie,taskRefs:Ne,sessionKey:xt&&xt!=="__unassigned__"?xt:void 0}).then(jn=>{jn?.runtimeDelivery?.attempted===!0&&jn.runtimeDelivery.delivered===!1&&h(Rs=>{if(Rs[Ke]!==vn)return Rs;const zs={...Rs};return delete zs[Ke],zs})}).catch(()=>{h(jn=>{if(jn[Ke]!==vn)return jn;const Rs={...jn};return delete Rs[Ke],Rs})})},[t,T,h,xt]),xe=g.useCallback((Ke,It,Br,Fr,Ie)=>{E({fromTeam:t,fromMember:"user",toTeam:Ke,text:It,taskRefs:Ie,actionMode:Fr,summary:Br})},[t,E]),ke=g.useCallback(()=>{r("inline")},[r]),de=g.useCallback(()=>{r("sidebar")},[r]),Le=g.useCallback(()=>{mn(ZRe),r("bottom-sheet")},[r]),Ue=g.useCallback(Ke=>{mn(Ke),H.current?.snapTo(Ke)},[]),mt=g.useCallback(()=>{if(ct===sQ){Ue(ZRe);return}Ue(sQ)},[ct,Ue]),vt=g.useMemo(()=>{const Ke=jt>0?Math.max(jt-1,96):Number.POSITIVE_INFINITY,It=Math.min(j8n,Ke),Br=Math.min(Math.max(It+Lt,It+120),Ke),Fr=Math.min(Math.max(jt>0?Math.round(jt*.58):520,Br+140),Ke);return[0,It,Br,Fr,1]},[jt,Lt]),ft=g.useMemo(()=>Math.min(Math.max(ct,sQ),X8n),[ct]),zt=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(Mi,{size:12,className:"shrink-0 text-[var(--color-text-muted)]"}),u.jsx("input",{type:"text",placeholder:"搜索...",value:be,onChange:Ke=>_e(Ke.target.value),onPointerDown:Ke=>Ke.stopPropagation(),onClick:Ke=>Ke.stopPropagation(),className:"min-w-0 flex-1 bg-transparent text-xs text-[var(--color-text)] placeholder:text-[var(--color-text-muted)] focus:outline-none"}),be&&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:()=>_e(""),children:u.jsx(Ar,{size:14})})]}),u.jsx(I8n,{teamName:t,members:i,filter:re,messages:Nt,open:J,onOpenChange:F,onApply:ge})]}),En=u.jsxs("div",{className:"flex items-center gap-2",children:[zt,u.jsxs(it,{children:[u.jsx(ot,{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:Ke=>{Ke.stopPropagation(),ue(It=>!It)},children:W?u.jsx(zk,{size:14}):u.jsx(j4,{size:14})})}),u.jsx(tt,{side:"bottom",children:W?"展开全部消息":"折叠全部消息"})]})]}),Cn=u.jsxs("div",{className:"pb-14",children:[u.jsx(y9,{teamName:t,members:i,isTeamAlive:a,sending:w,sendError:P,sendWarning:k,sendDebugDetails:C,lastResult:I,sessions:we,selectedSessionKey:xt,onSessionChange:Ge,textareaRef:ne,onSend:$e,onCrossTeamSend:xe}),u.jsx(x9,{members:i,tasks:o,messages:Nt,pendingRepliesByMember:f,layout:"flow",position:"inline",onMemberClick:m,onTaskClick:O}),u.jsx(_9,{messages:qe,teamName:t,members:i,readState:On,allCollapsed:W,expandOverrides:st,onToggleExpandOverride:wt,currentLeadSessionId:p,isTeamAlive:a,leadActivity:c,leadContextUpdatedAt:l,teamNames:Vn,teamColorByName:cr,onTeamClick:R,onMemberClick:m,onCreateTaskFromMessage:void 0,onReplyToMessage:b,onMessageVisible:Yn,onRestartTeam:y,onTaskIdClick:x,onExpandItem:ye,onExpandContent:ae,viewport:me}),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":q,disabled:q,onClick:()=>void M(),children:"加载更早消息"}),u.jsxs("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:["已加载 ",V," 条"]})]})}),u.jsx(BC,{expandedItem:Pe,open:K!==null,onOpenChange:Be,teamName:t,members:i,onCreateTaskFromMessage:void 0,onReplyToMessage:b,onMemberClick:m,onTaskIdClick:x,onRestartTeam:y,teamNames:Vn,teamColorByName:cr,onTeamClick:R})]});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(da,{size:14,className:"shrink-0 text-[var(--color-text-muted)]"}),u.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:"消息"}),Ht.length>0&&u.jsx(Ut,{variant:"secondary",className:"px-1.5 py-0.5 text-[10px] font-normal leading-none",children:Ht.length}),Rt>0&&u.jsxs(it,{children:[u.jsx(ot,{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:[Rt," 条新消息"]})}),u.jsxs(tt,{side:"bottom",children:[Rt," 条未读"]})]}),Rt>0&&u.jsxs(it,{children:[u.jsx(ot,{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:Fe,children:u.jsx(EQ,{size:12})})}),u.jsx(tt,{side:"bottom",children:"全部标为已读"})]}),u.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[u.jsxs(it,{children:[u.jsx(ot,{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(Ke=>!Ke),"aria-label":W?"展开全部消息":"折叠全部消息",children:W?u.jsx(zk,{size:14}):u.jsx(j4,{size:14})})}),u.jsx(tt,{side:"bottom",children:W?"展开全部消息":"折叠全部消息"})]}),u.jsxs(it,{children:[u.jsx(ot,{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:()=>le(Ke=>!Ke),"aria-label":ie?"隐藏消息搜索":"显示消息搜索",children:ie?u.jsx(Ar,{size:14}):u.jsx(Mi,{size:14})})}),u.jsx(tt,{side:"bottom",children:ie?"隐藏搜索":"搜索消息"})]}),u.jsxs(it,{children:[u.jsx(ot,{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:ke,"aria-label":"将消息移到页面内面板",children:u.jsx(KIe,{size:14})})}),u.jsx(tt,{side:"bottom",children:"移到页面内"})]})]})]}),ie&&u.jsx("div",{className:"shrink-0 border-b border-[var(--color-border)] px-3 py-1.5",children:zt}),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:Ke=>{const It=Ke.currentTarget.scrollTop;Xt(It),ce(It)},children:[u.jsxs("div",{className:"pl-3",children:[u.jsx(y9,{teamName:t,members:i,isTeamAlive:a,sending:w,sendError:P,sendWarning:k,sendDebugDetails:C,lastResult:I,sessions:we,selectedSessionKey:xt,onSessionChange:Ge,textareaRef:ne,onSend:$e,onCrossTeamSend:xe}),u.jsx(x9,{members:i,tasks:o,messages:Nt,pendingRepliesByMember:f,layout:"flow",position:"sidebar",onMemberClick:m,onTaskClick:O})," "]}),u.jsx(_9,{messages:qe,teamName:t,members:i,readState:On,allCollapsed:W,expandOverrides:st,onToggleExpandOverride:wt,currentLeadSessionId:p,isTeamAlive:a,leadActivity:c,leadContextUpdatedAt:l,teamNames:Vn,teamColorByName:cr,onTeamClick:R,onMemberClick:m,onCreateTaskFromMessage:void 0,onReplyToMessage:b,onMessageVisible:Yn,onRestartTeam:y,onTaskIdClick:x,onExpandItem:ye,onExpandContent:ae,viewport:me}),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":q,disabled:q,onClick:()=>void M(),children:"加载更早消息"}),u.jsxs("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:["已加载 ",V," 条"]})]})}),u.jsx(BC,{expandedItem:Pe,open:K!==null,onOpenChange:Be,teamName:t,members:i,onCreateTaskFromMessage:void 0,onReplyToMessage:b,onMemberClick:m,onTaskIdClick:x,onRestartTeam:y,teamNames:Vn,teamColorByName:cr,onTeamClick:R})]})]});if(n==="bottom-sheet"){if(!s)return u.jsx("div",{className:"hidden","aria-hidden":"true"});const Ke=ft===sQ;return u.jsx(jw,{ref:H,isOpen:!0,onClose:ke,mountPoint:s,avoidKeyboard:!1,detent:"full",snapPoints:vt,initialSnap:ft,onSnap:mn,disableDismiss:!0,disableScrollLocking:!0,style:{zIndex:30},className:"!pointer-events-none !absolute !inset-0",unstyled:!0,children:u.jsxs(jw.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(jw.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(jw.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(da,{size:13,className:"shrink-0 text-[var(--color-text-muted)]"}),u.jsx("span",{className:"text-[13px] font-medium text-[var(--color-text)]",children:"消息"}),Ht.length>0&&u.jsx(Ut,{variant:"secondary",className:"px-1 py-0 text-[9px] font-normal leading-none",children:Ht.length}),Rt>0&&u.jsxs(it,{children:[u.jsx(ot,{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:[Rt," 条新消息"]})}),u.jsxs(tt,{side:"top",children:[Rt," 条未读"]})]}),u.jsxs("div",{className:"ml-auto flex items-center gap-1",onPointerDown:It=>It.stopPropagation(),children:[Rt>0&&u.jsxs(it,{children:[u.jsx(ot,{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:Fe,"aria-label":"将全部消息标为已读",children:u.jsx(EQ,{size:13})})}),u.jsx(tt,{side:"top",children:"全部标为已读"})]}),u.jsxs(it,{children:[u.jsx(ot,{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(It=>!It),"aria-label":W?"展开全部消息":"折叠全部消息",children:W?u.jsx(zk,{size:14}):u.jsx(j4,{size:14})})}),u.jsx(tt,{side:"top",children:W?"展开全部消息":"折叠全部消息"})]}),u.jsxs(it,{children:[u.jsx(ot,{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:()=>le(It=>!It),"aria-label":ie?"隐藏消息搜索":"显示消息搜索",children:ie?u.jsx(Ar,{size:14}):u.jsx(Mi,{size:14})})}),u.jsx(tt,{side:"top",children:ie?"隐藏搜索":"搜索消息"})]}),u.jsxs(it,{children:[u.jsx(ot,{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:mt,"aria-label":Ke?"展开底部消息面板":"折叠底部消息面板",children:Ke?u.jsx(Wft,{size:14}):u.jsx(Vft,{size:14})})}),u.jsx(tt,{side:"top",children:Ke?"展开面板":"折叠面板"})]}),u.jsxs(it,{children:[u.jsx(ot,{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(_pe,{size:14})})}),u.jsx(tt,{side:"top",children:"移到页面内"})]}),u.jsxs(it,{children:[u.jsx(ot,{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:de,"aria-label":"将消息移到侧边栏",children:u.jsx($H,{size:14})})}),u.jsx(tt,{side:"top",children:"移到侧边栏"})]})]})]})]})}),!Ke&&u.jsxs(jw.Content,{className:"min-h-0 bg-[var(--color-surface-sidebar)]",scrollClassName:"flex min-h-full flex-col",scrollRef:se,disableDrag:It=>It.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:[ie&&u.jsx("div",{className:"border-b border-[var(--color-border)] px-3 py-2",children:zt}),u.jsx("div",{className:"p-3",children:u.jsx(y9,{teamName:t,layout:"compact",members:i,isTeamAlive:a,sending:w,sendError:P,sendWarning:k,sendDebugDetails:C,lastResult:I,sessions:we,selectedSessionKey:xt,onSessionChange:Ge,textareaRef:ne,onSend:$e,onCrossTeamSend:xe})})]}),u.jsx("div",{className:"shrink-0 px-3 pt-2",children:u.jsx(x9,{members:i,tasks:o,messages:Nt,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(_9,{messages:qe,teamName:t,members:i,readState:On,allCollapsed:W,expandOverrides:st,onToggleExpandOverride:wt,currentLeadSessionId:p,isTeamAlive:a,leadActivity:c,leadContextUpdatedAt:l,teamNames:Vn,teamColorByName:cr,onTeamClick:R,onMemberClick:m,onCreateTaskFromMessage:void 0,onReplyToMessage:b,onMessageVisible:Yn,onRestartTeam:y,onTaskIdClick:x,onExpandItem:ye,onExpandContent:ae,viewport:me}),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":q,disabled:q,onClick:()=>void M(),children:"加载更早消息"}),u.jsxs("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:["已加载 ",V," 条"]})]})})]}),u.jsx(BC,{expandedItem:Pe,open:K!==null,onOpenChange:Be,teamName:t,members:i,onCreateTaskFromMessage:void 0,onReplyToMessage:b,onMemberClick:m,onTaskIdClick:x,onRestartTeam:y,teamNames:Vn,teamColorByName:cr,onTeamClick:R})]})]})})}return u.jsx(nf,{sectionId:"messages",title:"消息",icon:u.jsx(da,{size:14}),badge:Ht.length,secondaryBadge:Ht.length>0&&Rt>0?Rt:void 0,afterBadge:Rt>0?u.jsxs(it,{children:[u.jsx(ot,{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:Ke=>{Ke.stopPropagation(),Fe()},children:u.jsx(EQ,{size:12})})}),u.jsx(tt,{side:"bottom",children:"全部标为已读"})]}):void 0,headerExtra:v?u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsxs(it,{children:[u.jsx(ot,{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:Ke=>{Ke.stopPropagation(),Le()},"aria-label":"将消息移到底部面板",children:u.jsx(_pe,{size:14})})}),u.jsx(tt,{side:"top",children:"移到底部面板"})]}),u.jsxs(it,{children:[u.jsx(ot,{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:Ke=>{Ke.stopPropagation(),de()},"aria-label":"将消息移到侧边栏",children:u.jsx($H,{size:14})})}),u.jsx(tt,{side:"top",children:"移到侧边栏"})]})]}):void 0,defaultOpen:!0,action:u.jsx("div",{className:"flex items-center gap-2 px-2",children:En}),children:Cn})});function F8n(e){return e.ledgerSummary?.deletedInTask?"deleted":e.isNewFile||e.ledgerSummary?.createdInTask?"added":"modified"}const Y8n=({open:e,onOpenChange:t,teamName:n,taskId:r,taskChangeRequestOptions:s})=>{const i=oe(h=>h.changeSetLoading),o=oe(h=>h.changeSetError),a=oe(h=>h.activeChangeSet),c=oe(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=F8n(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 KRe(e){return vT(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 V8n(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 q8n(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 W8n=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?`${KRe(new Date(o.registeredAt))} 前`:`${KRe(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(Lo,{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 ee.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 ee.teams.killProcess(t,o.pid),title:"停止进程(SIGTERM)",children:[u.jsx(nMe,{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 ee.openExternal(o.url),title:"在浏览器中打开",children:[u.jsx(Ef,{size:10}),"打开"]}),u.jsxs("span",{className:"font-mono text-[var(--color-text-muted)]",children:["PID",o.pid]}),o.registeredBy&&u.jsx(zr,{name:o.registeredBy,color:s.get(o.registeredBy),teamName:t}),u.jsx("span",{className:"text-[var(--color-text-muted)]",children:c})]})]},o.id)})})},G8n);function G8n(e,t){return e.teamName===t.teamName&&V8n(e.members,t.members)&&q8n(e.processes,t.processes)}const iQ=g.memo(function({teamName:t}){return u.jsx(uKe,{teamName:t,surface:"flat",dismissible:!0,className:"mb-3"})});function Ist(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 H8n(e){const{suppressionKey:t,currentKey:n}=e;return t===n&&Ist(e)}const Z8n=g.lazy(()=>Qe(()=>import("./ProjectEditorOverlay-CbUuh4s6.js"),__vite__mapDeps([61,1])).then(e=>({default:e.ProjectEditorOverlay}))),K8n=1e4,Oue="schedule:",J8n=new Set(["pending","warming_up","warm","running"]);function aD(e){return e.startsWith(Oue)}function JRe(e){return aD(e)?e.slice(Oue.length):null}function e9n(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 t9n(e){const t=g.useMemo(()=>(e??[]).filter(r=>!r.removedAt),[e]),n=g.useRef(t);return e9n(n.current,t)||(n.current=t),n.current}function n9n(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 r9n=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(Kn,{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(Zv,{size:12}),"启动"]})]})});function s9n(e){if(!e)return;const t=new Map(Object.entries(e));return t.size>0?t:void 0}function i9n(e){if(!e)return;const t=new Map(Object.entries(e));return t.size>0?t:void 0}const o9n=g.memo(function({teamName:t,isTeamProvisioning:n,isTeamAlive:r}){const{leadActivity:s,memberSpawnStatuses:i,memberSpawnSnapshot:o,fetchMemberSpawnStatuses:a}=oe(Et(c=>({leadActivity:c.leadActivityByTeam[t],memberSpawnStatuses:c.memberSpawnStatusesByTeam[t],memberSpawnSnapshot:c.memberSpawnSnapshotsByTeam[t],fetchMemberSpawnStatuses:c.fetchMemberSpawnStatuses})));return g.useEffect(()=>{const c=k3n(i,o);if((n||c||i==null&&(r===!0||s==="active"||s==="idle"))&&a(t),!n&&!c)return;const d=window.setInterval(()=>{a(t)},w3n);return()=>{window.clearInterval(d)}},[a,r,n,s,o,i,t]),null}),a9n=15e3,l9n=g.memo(function({teamName:t,isTeamProvisioning:n,isTeamAlive:r,isThisTabActive:s}){const{leadActivity:i,fetchTeamAgentRuntime:o}=oe(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)},a9n);return()=>{window.clearInterval(c)}},[o,r,n,s,i,t]),null}),c9n=g.memo(function({teamName:t,tabId:n,projectId:r,leadSessionId:s,sessionHistoryKey:i,isThisTabActive:o,isTeamAlive:a,sessions:c,sessionsLoading:l}){const d=oe(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(Ist({leadSessionId:s,projectId:r,sessionsLoading:l,knownSessions:c})){p.current=f;return}const m=()=>{H8n({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}),u9n=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}=oe(Et(R=>({leadTabData:n?R.tabSessionData[n]??null:null,leadContextSnapshot:R.leadContextByTeam[t]??null,isContextPanelVisible:n?R.tabUIStates.get(n)?.showContextPanel??!1:!1,selectedContextPhase:n?R.tabUIStates.get(n)?.selectedContextPhase??null:null,setContextPanelVisibleForTab:R.setContextPanelVisibleForTab,setSelectedContextPhaseForTab:R.setSelectedContextPhaseForTab,fetchSessionDetail:R.fetchSessionDetail}))),[h,m]=g.useState(!1),O=g.useCallback(R=>{n&&d(n,R)},[d,n]),_=g.useCallback(R=>{n&&p(n,R)},[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 R=b?.processes;if(!R||R.length===0)return;const $=R.reduce((A,j)=>A+(j.metrics.costUsd??0),0);return $>0?$: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 R=l;let $;if(R!==null&&S){const q=S.phases.find(z=>z.phaseNumber===R);q&&($=q.lastAIGroupId)}if(!$){const q=[...y.items].reverse().find(z=>z.type==="ai");if(q?.type!=="ai")return{allContextInjections:[],lastAssistantUsage:null,lastAssistantModelName:void 0};$=q.group.id}const j=x.get($)?.accumulatedInjections??[];let Q=null,U;const M=y.items.find(q=>q.type==="ai"&&q.group.id===$);if(M?.type==="ai"){const q=M.group.responses||[];for(let z=q.length-1;z>=0;z--){const L=q[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(()=>Ece(w),[w]),I=g.useMemo(()=>Itt({usage:P,modelName:k,contextWindowTokens:a?.contextWindowTokens??null,visibleContextTokens:C}),[k,P,a?.contextWindowTokens,C]),N=g.useMemo(()=>{const R=I.contextUsedPercentOfContextWindow??a?.contextUsedPercent;return R==null?null:`${R.toFixed(1)}%`},[I.contextUsedPercentOfContextWindow,a?.contextUsedPercent]);return s?u.jsxs(u.Fragment,{children:[c&&u.jsx("div",{className:"w-80 shrink-0",children:T?u.jsx(Ntt,{injections:w,onClose:()=>O(!1),projectRoot:b?.session?.projectPath??i,contextMetrics:I,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:N??"上下文"})})]}):null}),d9n=g.memo(function({teamName:t,...n}){const{leadActivity:r,progress:s,memberSpawnStatuses:i,memberSpawnSnapshot:o,runtimeSnapshot:a}=oe(Et(f=>({leadActivity:f.leadActivityByTeam[t],progress:Df(f,t),memberSpawnStatuses:f.memberSpawnStatusesByTeam[t],memberSpawnSnapshot:f.memberSpawnSnapshotsByTeam[t],runtimeSnapshot:f.teamAgentRuntimeByTeam[t]}))),c=g.useMemo(()=>s9n(i),[i]),l=g.useMemo(()=>i9n(a?.members),[a?.members]),d=a?.runId??o?.runId??s?.runId,p=g.useMemo(()=>s?.state!=="ready"?!1:Dz(Qz({members:n.members,memberSpawnStatuses:i,memberSpawnSnapshot:o})).hasMembersStillJoining,[o,i,s?.state,n.members]);return u.jsx(aYn,{...n,leadActivity:r,memberSpawnStatuses:c,memberRuntimeEntries:l,runtimeRunId:d,isLaunchSettling:p})}),p9n=g.memo(function({teamName:t,...n}){const{leadActivity:r,leadContextUpdatedAt:s}=oe(Et(i=>({leadActivity:i.leadActivityByTeam[t],leadContextUpdatedAt:i.leadContextByTeam[t]?.updatedAt})));return u.jsx(B8n,{...n,teamName:t,leadActivity:r,leadContextUpdatedAt:s})}),f9n=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}=oe(Et(m=>({leadActivity:m.leadActivityByTeam[t],liveMember:n?SXe(m,t,n.name):null,progress:Df(m,t),launchMembers:Xse(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??Df(m,t)?.runId,runtimeEntry:n?m.teamAgentRuntimeByTeam[t]?.members[n.name]:void 0}))),h=g.useMemo(()=>o?.state!=="ready"?!1:Dz(Qz({members:a,memberSpawnStatuses:c,memberSpawnSnapshot:l})).hasMembersStillJoining,[a,l,c,o?.state]);return u.jsx(VFn,{...r,teamName:t,member:i??n,isLaunchSettling:h,leadActivity:s,spawnEntry:d,runtimeEntry:f,runtimeRunId:p})}),h9n=({teamName:e,isPaneFocused:t=!1})=>{const{isLight:n}=Us(),[r,s]=g.useState(null),[i,o]=g.useState(null),[a,c]=g.useState(null),[l,d]=g.useState(null),[p,f]=g.useState(()=>WRe(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 Te=!1;return(async()=>{try{const St=await ee.teams.getSavedRequest(e);Te||w(St??null)}catch{Te||w(null)}})(),()=>{Te=!0}},[v,e]);const[P,k]=g.useState({open:!1,mode:"launch"}),[C,I]=g.useState(!1),N=g.useRef(null),R=g.useRef(null),$=g.useRef(!1);g.useEffect(()=>{const Te=N.current;Te&&(C?Te.setAttribute("inert",""):Te.removeAttribute("inert"))},[C]),g.useEffect(()=>{const Te=Pr=>{const{teamName:Yo,taskId:_c}=Pr.detail??{};if(Yo!==e||!le)return;const oh=le.tasks.find(ZB=>ZB.id===_c);oh&&o(oh)},St=Pr=>{const{teamName:Yo,memberName:_c}=Pr.detail??{};Yo===e&&(L(_c),Y(void 0),te(void 0),j(!0))},Zn=Pr=>{const{teamName:Yo,memberName:_c,initialTab:oh,initialActivityFilter:ZB}=Pr.detail??{};if(Yo!==e||!le)return;const _ue=K.find(oit=>oit.name===_c);_ue&&(c(_ue),d({initialTab:oh,initialActivityFilter:ZB}))},ys=Pr=>{const{teamName:Yo,owner:_c}=Pr.detail??{};Yo===e&&cu("","",_c??"")};window.addEventListener("graph:open-task",Te),window.addEventListener("graph:send-message",St),window.addEventListener("graph:open-profile",Zn),window.addEventListener("graph:create-task",ys);const ss=Pr=>Yo=>{const{teamName:_c,taskId:oh}=Yo.detail??{};_c!==e||!oh||Pr(oh)},ht=ss(Pr=>{(async()=>{try{const Yo=await Lt(e,Pr);if(le?.isAlive){const _c=le.tasks.find(oh=>oh.id===Pr);try{Yo.notifiedOwner&&_c?.owner&&await ee.teams.processSend(e,`Task ${Gr(_c)} "${_c.subject}" has started. Please begin working on it.`)}catch{}}}catch{}})()}),pn=ss(Pr=>{(async()=>{try{await Ge(e,Pr,"completed")}catch{}})()}),ui=ss(Pr=>{(async()=>{try{await yt(e,Pr,{op:"set_column",column:"approved"})}catch{}})()}),Ha=ss(Pr=>{(async()=>{try{await ct(e,Pr)}catch{}})()}),vp=ss(Pr=>{s(Pr)}),dA=ss(Pr=>{(async()=>{try{await Ge(e,Pr,"pending")}catch{}})()}),dx=ss(Pr=>{(async()=>{try{await yt(e,Pr,{op:"remove"}),await Ge(e,Pr,"completed")}catch{}})()}),Tp=ss(Pr=>Yt(Pr));return window.addEventListener("graph:start-task",ht),window.addEventListener("graph:complete-task",pn),window.addEventListener("graph:approve-task",ui),window.addEventListener("graph:request-review",Ha),window.addEventListener("graph:request-changes",vp),window.addEventListener("graph:cancel-task",dA),window.addEventListener("graph:move-back-to-done",dx),window.addEventListener("graph:delete-task",Tp),()=>{window.removeEventListener("graph:open-task",Te),window.removeEventListener("graph:send-message",St),window.removeEventListener("graph:open-profile",Zn),window.removeEventListener("graph:create-task",ys),window.removeEventListener("graph:start-task",ht),window.removeEventListener("graph:complete-task",pn),window.removeEventListener("graph:approve-task",ui),window.removeEventListener("graph:request-review",Ha),window.removeEventListener("graph:request-changes",vp),window.removeEventListener("graph:cancel-task",dA),window.removeEventListener("graph:move-back-to-done",dx),window.removeEventListener("graph:delete-task",Tp)}});const[A,j]=g.useState(!1),[Q,U]=g.useState(!1),[M,q]=g.useState(!1),[z,L]=g.useState(void 0),[V,Y]=g.useState(void 0),[ne,te]=g.useState(void 0),[H,Z]=g.useState(void 0),[se,he]=g.useState({open:!1,mode:"task"}),[ce,me]=g.useState([]),ae=P.open,[G,be]=g.useState([]),[_e,re]=g.useState(!1),[ge,J]=g.useState(null),[F,W]=g.useState({sessionId:null,selectedOwners:new Set,columns:new Set}),[ue,ie]=g.useState({field:"updatedAt"}),{data:le,members:K,loading:pe,error:we,projects:Ee,repositoryGroups:Ae,initTabUIState:We,selectTeam:et,updateKanban:yt,updateKanbanColumnOrder:xt,updateTaskStatus:Ge,updateTaskOwner:Ct,sendTeamMessage:Xt,requestReview:ct,createTeamTask:mn,startTaskByUser:Lt,deleteTeam:Sn,openTeamsTab:jt,closeTab:dn,sendingMessage:ze,sendMessageError:rt,sendMessageWarning:Nt,sendMessageDebugDetails:Ht,lastSendMessageResult:qe,reviewActionError:lt,restartMember:Pe,skipMemberForLaunch:ye,removeMember:Be,updateMemberRole:Ze,launchTeam:Ye,provisioningError:Ce,clearProvisioningError:st,isTeamProvisioning:wt,refreshTeamData:Rt,refreshTeamMessagesHead:Yn,refreshMemberActivityMeta:On,syncTeamPendingReplyRefresh:Vn,kanbanFilterQuery:cr,clearKanbanFilter:Fe,softDeleteTask:$e,restoreTask:xe,fetchDeletedTasks:ke,deletedTasks:de,launchParams:Le,selectReviewFile:Ue,pendingReviewRequest:mt,setPendingReviewRequest:vt,teams:ft,schedules:zt,scheduleRuns:En,scheduleRunsLoading:Cn,fetchSchedules:Ke,fetchRunHistory:It,triggerScheduleNow:Br,removeSchedule:Fr,fetchTeams:Ie}=oe(Et(Te=>({projects:Te.projects,repositoryGroups:Te.repositoryGroups,initTabUIState:Te.initTabUIState,selectTeam:Te.selectTeam,updateKanban:Te.updateKanban,updateKanbanColumnOrder:Te.updateKanbanColumnOrder,updateTaskStatus:Te.updateTaskStatus,updateTaskOwner:Te.updateTaskOwner,sendTeamMessage:Te.sendTeamMessage,requestReview:Te.requestReview,createTeamTask:Te.createTeamTask,startTaskByUser:Te.startTaskByUser,deleteTeam:Te.deleteTeam,openTeamsTab:Te.openTeamsTab,closeTab:Te.closeTab,sendingMessage:Te.sendingMessage,sendMessageError:Te.sendMessageError,sendMessageWarning:Te.sendMessageWarning,sendMessageDebugDetails:Te.sendMessageDebugDetails,lastSendMessageResult:Te.lastSendMessageResult,reviewActionError:Te.reviewActionError,restartMember:Te.restartMember,skipMemberForLaunch:Te.skipMemberForLaunch,removeMember:Te.removeMember,updateMemberRole:Te.updateMemberRole,launchTeam:Te.launchTeam,provisioningError:e?Te.provisioningErrorByTeam[e]??null:null,clearProvisioningError:Te.clearProvisioningError,isTeamProvisioning:e?Yy(Te,e):!1,data:Te.selectedTeamName===e?Te.selectedTeamData:null,members:Pl(Te,e),loading:Te.selectedTeamName===e?Te.selectedTeamLoading:!1,error:Te.selectedTeamName===e?Te.selectedTeamError:null,refreshTeamData:Te.refreshTeamData,refreshTeamMessagesHead:Te.refreshTeamMessagesHead,refreshMemberActivityMeta:Te.refreshMemberActivityMeta,syncTeamPendingReplyRefresh:Te.syncTeamPendingReplyRefresh,kanbanFilterQuery:Te.kanbanFilterQuery,clearKanbanFilter:Te.clearKanbanFilter,softDeleteTask:Te.softDeleteTask,restoreTask:Te.restoreTask,fetchDeletedTasks:Te.fetchDeletedTasks,deletedTasks:Te.deletedTasks,launchParams:e?Te.launchParamsByTeam[e]:void 0,selectReviewFile:Te.selectReviewFile,pendingReviewRequest:Te.pendingReviewRequest,setPendingReviewRequest:Te.setPendingReviewRequest,teams:Te.teams,schedules:Te.schedules,scheduleRuns:Te.scheduleRuns,scheduleRunsLoading:Te.scheduleRunsLoading,fetchSchedules:Te.fetchSchedules,fetchRunHistory:Te.fetchRunHistory,triggerScheduleNow:Te.triggerNow,removeSchedule:Te.deleteSchedule,fetchTeams:Te.fetchTeams}))),Ne=$3(),vn=oe(Te=>Te.activeTabId),jn=Ne?vn===Ne:!1,Rs=g.useRef(!1),zs=g.useCallback(Te=>{},[]);g.useEffect(()=>{Ne&&We(Ne)},[Ne,We]),g.useEffect(()=>{f(WRe(e))},[e]),g.useEffect(()=>{O8n(e,p)},[p,e]),g.useEffect(()=>{const Te=$.current;$.current=wt,!Te&&wt&&R.current?.scrollIntoView({behavior:"smooth",block:"start"})},[wt]);const[Fa,sn]=g.useState(""),Nn=oe(Te=>Te.editorPendingRevealFile);g.useEffect(()=>{Nn&&le?.config.projectPath&&I(!0)},[Nn,le?.config.projectPath]),g.useEffect(()=>{e&&(et(e),ke(e))},[e,et,ke]),g.useEffect(()=>{Ke()},[Ke]);const Rn=g.useMemo(()=>zt.filter(Te=>Te.teamName===e),[zt,e]);g.useEffect(()=>{for(const Te of Rn)En[Te.id]||Cn[Te.id]||It(Te.id)},[It,En,Cn,Rn]);const ar=g.useMemo(()=>Rn.map(Te=>{const St=(En[Te.id]??[])[0],ys=(St?J8n.has(St.status):!1)?"in_progress":"pending",ss=Te.label?.trim()||SX(Te.cronExpression),ht=St?`最近运行:${St.status}${St.startedAt?` (${new Date(St.startedAt).toLocaleString("zh-CN")})`:""}`:null,pn=Te.nextRunAt?`下次执行:${new Date(Te.nextRunAt).toLocaleString("zh-CN")}`:null;return{id:`${Oue}${Te.id}`,displayId:`SCH-${Te.id.slice(0,6)}`,subject:`[定时] ${ss}`,description:[`Cron: ${Te.cronExpression}`,`时区: ${Te.timezone}`,pn,ht].filter(ui=>!!ui).join(`
|
|
1825
1825
|
`),status:ys,createdAt:Te.createdAt,updatedAt:St?.startedAt??Te.updatedAt}}),[En,Rn]),ds=le?.teamName;g.useEffect(()=>{!jn||!e||pe||ds!=null&&ds!==e&&et(e)},[jn,e,ds,pe,et]),g.useEffect(()=>{const Te=jn&&t,St=Te&&!Rs.current;Rs.current=Te,!(!St||!e)&&(async()=>{try{(await Yn(e)).feedChanged&&await On(e)}catch{}})()},[t,jn,On,Yn,e]),g.useEffect(()=>{if(!ae)return;let Te=!1;const St=oe.getState().teams;return(async()=>{try{const Zn=await ee.teams.aliveList();if(Te)return;const ys=new Set(Zn),ss=St.filter(ht=>ys.has(ht.teamName)&&ht.projectPath).map(ht=>({teamName:ht.teamName,displayName:ht.displayName,projectPath:ht.projectPath}));me(ss)}catch{}})(),()=>{Te=!0}},[ae]),g.useEffect(()=>{cr&&(sn(cr),Fe())},[cr,Fe]);const jr=g.useMemo(()=>cDn(le?.config.projectPath,Ee,Ae),[Ee,Ae,le?.config.projectPath]),Or=le?.config.leadSessionId??null,gr=g.useId(),ki=g.useMemo(()=>(le?.config.sessionHistory??[]).join("|"),[le?.config.sessionHistory]);g.useEffect(()=>{const Te=Object.keys(p).length>0;return Vn(e,gr,!!le?.isAlive&&Te,K8n),()=>{Vn(e,gr,!1)}},[le?.isAlive,p,gr,Vn,e]),g.useEffect(()=>{if(!jr)return;let Te=!1;return re(!0),J(null),(async()=>{try{const St=await ee.getSessions(jr);Te||be(St)}catch(St){Te||J(St instanceof Error?St.message:"加载会话失败")}finally{Te||re(!1)}})(),()=>{Te=!0}},[jr]);const Ya=le?.config.projectPath?.trim()??null,Ci=g.useMemo(()=>{const Te=K.find(St=>Gn(St))?.cwd?.trim();return Te&&Te.length>0?Te:Ya},[K,Ya]),aO=g.useMemo(()=>{const Te=new Map,St=Zn=>{const ys=Zn?.trim();if(!ys)return;const ss=pr(ys);!ss||Te.has(ss)||Te.set(ss,ys)};St(Ci);for(const Zn of K)St(Zn.cwd);return Array.from(Te.values())},[K,Ci]);Att(aO,{live:!0});const ou=oe(Et(Te=>Object.fromEntries(aO.map(St=>{const Zn=pr(St);return[Zn,Te.branchByPath[Zn]??null]})))),gc=Ci?ou[pr(Ci)]??null:null,vo=g.useMemo(()=>le?K.map(Te=>{const St=Te.cwd?.trim(),Zn=St&&!Gn(Te)&&gc!==null?(()=>{const ss=ou[pr(St)]??null;return ss&&ss!==gc?ss:void 0})():void 0;if(Te.gitBranch===Zn)return Te;const ys={...Te};return Zn?ys.gitBranch=Zn:delete ys.gitBranch,ys}):[],[gc,K,ou]),nh=g.useMemo(()=>to(vo),[vo]),yp=g.useMemo(()=>{const Te=new Set;if(le?.config.leadSessionId&&Te.add(le.config.leadSessionId),le?.config.sessionHistory)for(const St of le.config.sessionHistory)Te.add(St);return Te},[le?.config.leadSessionId,le?.config.sessionHistory]),au=g.useMemo(()=>G.filter(Te=>yp.has(Te.id)),[G,yp]);g.useEffect(()=>{F.sessionId!==null&&!au.some(Te=>Te.id===F.sessionId)&&W(Te=>({...Te,sessionId:null}))},[F.sessionId,au]);const pd=g.useMemo(()=>{if(F.sessionId===null)return null;const Te=[...au].sort((ss,ht)=>ss.createdAt-ht.createdAt),St=Te.findIndex(ss=>ss.id===F.sessionId);if(St===-1)return null;const Zn=Te[St].createdAt,ys=St+1<Te.length?Te[St+1].createdAt:1/0;return{start:Zn,end:ys}},[F.sessionId,au]),rh=g.useMemo(()=>{if(!le)return[];let Te=le.tasks;return pd&&(Te=Te.filter(St=>{if(!St.createdAt)return!0;const Zn=new Date(St.createdAt).getTime();return Zn>=pd.start&&Zn<pd.end})),F.selectedOwners.size>0&&(Te=Te.filter(St=>St.owner?F.selectedOwners.has(St.owner):F.selectedOwners.has(Hee))),Te},[le,pd,F.selectedOwners]),ur=t9n(vo),xp=g.useMemo(()=>[...rh,...ar],[rh,ar]),F_=g.useMemo(()=>{const Te=Fa.trim();return Te?n9n(xp,Te):xp},[xp,Fa]),sh=g.useMemo(()=>ur.filter(Te=>!Gn(Te)).length,[ur]),ha=g.useMemo(()=>new Map((le?.tasks??[]).map(Te=>[Te.id,Te])),[le?.tasks]),lu=g.useRef(ha);lu.current=ha;const cx=g.useMemo(()=>sSt(le?.tasks??[]),[le?.tasks]),cu=g.useCallback((Te="",St="",Zn="",ys)=>{m({open:!0,defaultSubject:Te,defaultDescription:St,defaultOwner:Zn,defaultStartImmediately:ys})},[]),p1=g.useCallback(()=>{m({open:!1,defaultSubject:"",defaultDescription:"",defaultOwner:"",defaultStartImmediately:void 0})},[]),f1=g.useCallback((Te,St)=>{cu(Te,St)},[]),aA=g.useCallback(Te=>{L(Te.from),Y(void 0),te(void 0),Z({from:Te.from,text:Ca(Te.text)}),j(!0)},[]),ux=g.useCallback(Te=>{k({open:!0,mode:Te})},[]),Y_=g.useCallback(()=>{k(Te=>({...Te,open:!1}))},[]),Sp=g.useCallback(()=>{ux("relaunch")},[ux]),V_=g.useCallback(async Te=>{await Ye(Te),await Promise.all([Ie(),et(e)])},[Ie,Ye,et,e]),lA=g.useCallback(async(Te,St)=>{await Y4n({teamName:e,isTeamAlive:le?.isAlive===!0,request:Te,members:St,stopTeam:Zn=>ee.teams.stop(Zn),replaceMembers:(Zn,ys)=>ee.teams.replaceMembers(Zn,ys),launchTeam:Ye}),await Promise.all([Ie(),et(e)])},[le?.isAlive,Ie,Ye,et,e]),VB=g.useCallback(async()=>{if(!le?.config.projectPath)throw new Error("团队缺少项目路径,无法自动重启。");await ee.teams.stop(e),await Ye({teamName:e,cwd:le.config.projectPath}),await Promise.all([Ie(),et(e)])},[le?.config.projectPath,Ie,Ye,et,e]),qB=g.useCallback(async Te=>{if(!le?.config.projectPath)throw new Error("团队缺少项目路径,无法自动重启。");await ee.teams.stop(e);const St={teamName:e,cwd:le.config.projectPath,providerId:Te.providerId,model:Te.model,effort:Te.effort,fastMode:Te.fastMode,clearContext:Te.clearContext};await Ye(St)},[le?.config.projectPath,Ye,e]),h1=g.useCallback(async Te=>{await Pe(e,Te)},[Pe,e]),Va=g.useCallback(async Te=>{await ye(e,Te)},[ye,e]),ih=g.useCallback(Te=>{c(Te),d(null)},[]),lO=g.useCallback(()=>{c(null),d(null)},[]),WB=g.useCallback(Te=>{L(Te.name),Y(void 0),te(void 0),Z(void 0),j(!0)},[]),GB=g.useCallback(Te=>{cu("","",Te.name)},[cu]),HB=g.useCallback(Te=>{const St=lu.current.get(Te);St&&o(St)},[]),cA=g.useCallback(Te=>{o(Te)},[]),uA=g.useCallback(Te=>{const St=ha.get(Te)??le?.tasks.find(Zn=>Zn.displayId===Te);St&&o(St)},[ha,le?.tasks]),ve=g.useCallback(Te=>{const St=oee(Te,[])??void 0;Te.type==="sendMessage"?(Y(St?void 0:Te.formattedContext),te(St),L(void 0),Z(void 0),j(!0)):Te.type==="createTask"&&(St?m({open:!0,defaultSubject:"",defaultDescription:"",defaultOwner:"",defaultStartImmediately:void 0,defaultChip:St}):cu("",Te.formattedContext))},[]);g.useEffect(()=>{mt&&(he({open:!0,mode:"task",taskId:mt.taskId,initialFilePath:mt.filePath,taskChangeRequestOptions:mt.requestOptions}),mt.filePath&&Ue(mt.filePath),vt(null))},[mt,Ue,vt]);const Ot=oe(Te=>Te.pendingMemberProfile);g.useEffect(()=>{if(!Ot||!le)return;const Te=vo.find(St=>St.name===Ot);Te&&(c(Te),d(null)),oe.getState().closeMemberProfile()},[Ot,vo]);const Yt=g.useCallback(Te=>{(async()=>{const St=JRe(Te),Zn=St!==null,ys=Zn?"删除定时任务":"删除任务",ss=Zn?"将该定时任务从看板中删除(会同时删除计划)?":`将任务 #${so(Te)} 移入废纸篓?`;if(await Bd({title:ys,message:ss,confirmLabel:"删除",cancelLabel:"取消",variant:"danger"}))try{St?await Fr(St):await $e(e,Te)}catch{}})()},[e,$e,Fr]),zn=g.useCallback(Te=>{const St=ha.get(Te);he({open:!0,mode:"task",taskId:Te,taskChangeRequestOptions:St?Jc(St):{}})},[ha]),qn=g.useCallback((Te,St)=>{const Zn=ha.get(Te);he({open:!0,mode:"task",taskId:Te,initialFilePath:St,taskChangeRequestOptions:Zn?Jc(Zn):{}}),St&&Ue(St)},[Ue,ha]),nr=g.useCallback(()=>{U(!0)},[]),To=g.useCallback(()=>{U(!1),(async()=>{try{(await Sn(e)).restartRequired&&await Bd({title:"需要重启 cc-connect",message:"已调用 cc-connect 删除团队配置。cc-connect 需要重启后才会真正移除该团队并停止相关运行时。",confirmLabel:"立即重启",cancelLabel:"稍后重启",variant:"danger"})&&await ee.ccSettings.restart(),Ne&&dn(Ne),jt()}catch{}})()},[e,Sn,jt,dn,Ne]),qa=(Te,St,Zn,ys,ss,ht,pn,ui,Ha)=>{_(!0),(async()=>{try{if(await mn(e,{subject:Te,description:St||void 0,owner:Zn,blockedBy:ys,related:ss,prompt:ht,descriptionTaskRefs:ui,promptTaskRefs:Ha,startImmediately:pn}),ht&&Zn&&le?.isAlive&&!wt&&pn!==!1){const vp=`New task assigned to ${Zn}: "${Te}". Instructions:
|
|
1826
1826
|
${ht}`;try{await ee.teams.processSend(e,vp)}catch{}}p1()}catch{}finally{_(!1)}})()},Wa=g.useMemo(()=>({teamName:e,onPositionChange:zs,mountPoint:null,members:ur,tasks:le?.tasks??[],isTeamAlive:le?.isAlive,timeWindow:pd,teamSessionIds:yp,currentLeadSessionId:le?.config.leadSessionId,pendingRepliesByMember:p,onPendingReplyChange:f,onMemberClick:ih,onTaskClick:cA,onCreateTaskFromMessage:f1,onReplyToMessage:aA,onRestartTeam:Sp,onTaskIdClick:uA,inlineScrollContainerRef:N,showPositionControls:!1}),[ur,le?.config.leadSessionId,le?.isAlive,le?.tasks,f1,cA,aA,Sp,ih,uA,p,e,yp,pd,zs]);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 Ps=u.jsx(o9n,{teamName:e,isTeamProvisioning:wt,isTeamAlive:le?.isAlive}),Ga=u.jsx(l9n,{teamName:e,isTeamProvisioning:wt,isTeamAlive:le?.isAlive,isThisTabActive:jn}),q_=u.jsx(c9n,{teamName:e,tabId:Ne,projectId:jr,leadSessionId:Or,sessionHistoryKey:ki,isThisTabActive:jn,isTeamAlive:le?.isAlive,sessions:G,sessionsLoading:_e}),W_=()=>{if(pe&&!le||le&&le.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:R,children:u.jsx(iQ,{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(we==="TEAM_DRAFT"){const ht=oe.getState().teamByName[e],pn=ht?.displayName||e;return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"size-full overflow-auto p-6",children:[u.jsx("div",{ref:R,children:u.jsx(iQ,{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:pn})," ","尚未完成启动,点击“启动团队”后即可选择模型并进入动态编排。"]}),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:()=>ux("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:()=>{ee.teams.deleteDraft(e).catch(()=>{})},children:"删除"})]})]})})]}),u.jsx(Gee,{mode:P.mode,open:ae,teamName:e,members:[],defaultProjectPath:ht?.projectPath,provisioningError:Ce,clearProvisioningError:st,onClose:Y_,onLaunch:V_,onRelaunch:lA})]})}if(we)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:we}),u.jsx("div",{className:"mt-4",children:u.jsx(Xe,{size:"sm",variant:"outline",onClick:()=>void et(e,{allowReloadWhileProvisioning:!0}),children:"重试加载"})})]})});if(!le)return u.jsxs("div",{className:"size-full overflow-auto p-4",children:[u.jsx("div",{ref:R,children:u.jsx(iQ,{teamName:e})}),u.jsx("div",{className:"flex flex-1 items-center justify-center p-6 text-sm text-[var(--color-text-muted)]",children:"编排完成后,这里将显示团队数据"})]});const Te=le.config.color?Ir(le.config.color):ll(le.config.name),St=le.settings??{},Zn=le.config.managedSources??(typeof St.admin_from=="string"?St.admin_from:"*"),ys=le.config.disabledCommands??(Array.isArray(St.disabled_commands)?St.disabled_commands.filter(ht=>typeof ht=="string"&&ht.trim().length>0):[]),ss=le.config.platformAllowFrom??(typeof St.platform_allow_from=="object"&&St.platform_allow_from!==null&&!Array.isArray(St.platform_allow_from)?St.platform_allow_from:{});return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex size-full overflow-hidden",children:[u.jsx(u9n,{teamName:e,tabId:Ne,projectId:jr,leadSessionId:Or,fallbackProjectRoot:le.config.projectPath}),u.jsx("div",{className:"relative min-h-0 min-w-0 flex-1",children:u.jsxs("div",{ref:N,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:[Te?u.jsx("div",{className:"pointer-events-none absolute inset-0 z-0",style:{backgroundColor:ii(Te,n)}}):null,u.jsxs("div",{className:nt("flex items-start justify-between gap-2",Te&&"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:le.config.name}),le.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"}),"运行中"]}),!le.isAlive&&wt&&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(it,{children:[u.jsx(ot,{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:wt,onClick:()=>T(!0),children:u.jsx(zb,{size:12})})}),u.jsx(tt,{side:"bottom",children:wt?"团队仍在编排中,暂时无法编辑":"编辑团队"})]}),u.jsxs(it,{children:[u.jsx(ot,{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:nr,children:u.jsx(Ti,{size:12})})}),u.jsx(tt,{side:"bottom",children:"删除团队"})]})]})]}),le.config.description&&u.jsx("p",{className:nt("min-w-0 truncate text-xs text-[var(--color-text-muted)]",Te&&"relative z-10"),children:le.config.description}),u.jsx("div",{className:nt("mt-1 flex items-start justify-between gap-3",Te&&"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:[le.config.projectPath&&u.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--color-text-secondary)]",children:[u.jsx(Kc,{size:11,className:"shrink-0 text-[var(--color-text-muted)]"}),u.jsxs(it,{children:[u.jsx(ot,{asChild:!0,children:u.jsx("span",{className:"max-w-60 truncate font-mono",children:le.config.projectPath.replace(/\\/g,"/").split("/").filter(Boolean).pop()??le.config.projectPath})}),u.jsx(tt,{side:"bottom",children:u.jsx("span",{className:"font-mono text-xs",children:xee(le.config.projectPath)})})]})]}),gc&&u.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--color-text-secondary)]",title:gc,children:[u.jsx(T$,{size:11,className:"shrink-0 text-[var(--color-text-muted)]"}),u.jsx("span",{className:"max-w-32 truncate",children:gc})]})]})}),(()=>{const ht=le.config.projectPath,pn=le.config.projectPathHistory?.filter(ui=>ui!==ht);return!pn||pn.length===0?null:u.jsxs("div",{className:nt("mt-0.5 flex items-center gap-1 text-[10px] text-[var(--color-text-muted)]",Te&&"relative z-10"),children:[u.jsx(Gne,{size:10,className:"shrink-0"}),u.jsxs("span",{className:"truncate",children:["历史路径:",pn.map(ui=>xee(ui)).join(", ")]})]})})()]}),!le.isAlive&&!wt?u.jsx(r9n,{teamName:e,onLaunch:()=>ux("launch")}):null,u.jsx("div",{ref:R,children:u.jsx(iQ,{teamName:e})}),le.warnings?.some(ht=>ht.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,lt?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:lt}):null,u.jsx(nf,{sectionId:"team",title:"团队",icon:u.jsx(dc,{size:14}),badge:sh===0?"单人":sh,defaultOpen:!0,children:u.jsx(d9n,{teamName:e,members:vo,memberTaskCounts:cx,taskMap:ha,pendingRepliesByMember:p,isTeamAlive:le.isAlive,isTeamProvisioning:wt,launchParams:Le,onMemberClick:ih,onSendMessage:WB,onAssignTask:GB,onOpenTask:HB,onRestartMember:h1,onSkipMemberForLaunch:Va})}),u.jsx(nf,{sectionId:"kanban",title:"任务",icon:u.jsx(mR,{size:14}),badge:rh.length,defaultOpen:!0,forceOpen:Fa.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:ht=>{ht.stopPropagation(),cu()},children:[u.jsx(xl,{size:12}),"任务"]}),children:u.jsx("div",{className:"min-w-0",children:u.jsx(vFn,{tasks:F_,teamName:e,kanbanState:le.kanbanState,filter:F,sort:ue,sessions:au,leadSessionId:le.config.leadSessionId,members:ur,onFilterChange:W,onSortChange:ie,toolbarLeft:u.jsx(EFn,{value:Fa,onChange:sn,tasks:rh,members:ur}),onRequestReview:ht=>{(async()=>{try{await ct(e,ht)}catch{}})()},onApprove:ht=>{(async()=>{try{await yt(e,ht,{op:"set_column",column:"approved"})}catch{}})()},onRequestChanges:ht=>{s(ht)},onMoveBackToDone:ht=>{(async()=>{try{await yt(e,ht,{op:"remove"}),await Ge(e,ht,"completed")}catch{}})()},onStartTask:ht=>{(async()=>{const pn=JRe(ht);if(pn){try{await Br(pn),await It(pn)}catch{}return}try{const ui=await Lt(e,ht);if(le?.isAlive){const Ha=le.tasks.find(vp=>vp.id===ht);try{if(ui.notifiedOwner&&Ha?.owner)await ee.teams.processSend(e,`Task ${Gr(Ha)} "${Ha.subject}" has started. Please begin working on it.`);else if(!ui.notifiedOwner){const vp=Ha?.description?.trim()?`
|
|
1827
1827
|
Description: ${Ha.description.trim()}`:"";await ee.teams.processSend(e,`Task #${so(ht)} "${Ha?.subject??""}" has been moved to IN PROGRESS but has no assignee.${vp}
|