@yancyyu/openhermit 1.6.36 → 1.6.37
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-B_QAoeaA.js → ProjectEditorOverlay-Va_Vz-zz.js} +1 -1
- package/dist-renderer/assets/{TeamGraphOverlay-PB9luAZU.js → TeamGraphOverlay-DYT3bwFR.js} +1 -1
- package/dist-renderer/assets/{_basePickBy-Dfzcp_Ry.js → _basePickBy-Dbt_EU-e.js} +1 -1
- package/dist-renderer/assets/{_baseUniq-B5u2Yiq2.js → _baseUniq-DWo68sXI.js} +1 -1
- package/dist-renderer/assets/{arc-DElOI7qz.js → arc-DXH1iZQK.js} +1 -1
- package/dist-renderer/assets/{architectureDiagram-VXUJARFQ-Cf6f4tCu.js → architectureDiagram-VXUJARFQ-cjffS2Qr.js} +1 -1
- package/dist-renderer/assets/{blockDiagram-VD42YOAC-FJUdo9Ry.js → blockDiagram-VD42YOAC-BKdZF02Y.js} +1 -1
- package/dist-renderer/assets/{c4Diagram-YG6GDRKO-BvJQS9lb.js → c4Diagram-YG6GDRKO-CN27pqaI.js} +1 -1
- package/dist-renderer/assets/channel-5dJIx68e.js +1 -0
- package/dist-renderer/assets/{chunk-4BX2VUAB-n-SGLbin.js → chunk-4BX2VUAB-CXPCI7g_.js} +1 -1
- package/dist-renderer/assets/{chunk-55IACEB6-Dwle9tlA.js → chunk-55IACEB6-BGAXQZRC.js} +1 -1
- package/dist-renderer/assets/{chunk-B4BG7PRW-Dic8YxQz.js → chunk-B4BG7PRW-TPDaA_KQ.js} +1 -1
- package/dist-renderer/assets/{chunk-DI55MBZ5-3n5jC1jk.js → chunk-DI55MBZ5-D1ADe_tq.js} +1 -1
- package/dist-renderer/assets/{chunk-FMBD7UC4-BqizUB3O.js → chunk-FMBD7UC4-Beimtg3a.js} +1 -1
- package/dist-renderer/assets/{chunk-QN33PNHL-JRDmD8o9.js → chunk-QN33PNHL-OjNBu854.js} +1 -1
- package/dist-renderer/assets/{chunk-QZHKN3VN-BxFpQw92.js → chunk-QZHKN3VN-DinqvbH8.js} +1 -1
- package/dist-renderer/assets/{chunk-TZMSLE5B-ByqPwtW9.js → chunk-TZMSLE5B-BfFtlPSZ.js} +1 -1
- package/dist-renderer/assets/classDiagram-2ON5EDUG-BMGXWJ2d.js +1 -0
- package/dist-renderer/assets/classDiagram-v2-WZHVMYZB-BMGXWJ2d.js +1 -0
- package/dist-renderer/assets/clone-D7FWfGY9.js +1 -0
- package/dist-renderer/assets/{cose-bilkent-S5V4N54A-CVztr86T.js → cose-bilkent-S5V4N54A-D9z9Dgt7.js} +1 -1
- package/dist-renderer/assets/{dagre-6UL2VRFP-CIui920O.js → dagre-6UL2VRFP-n1g-DhEE.js} +1 -1
- package/dist-renderer/assets/{diagram-PSM6KHXK-CyL8-bgb.js → diagram-PSM6KHXK-BvxFq-BE.js} +1 -1
- package/dist-renderer/assets/{diagram-QEK2KX5R-CM_67YoY.js → diagram-QEK2KX5R-wVnJuwza.js} +1 -1
- package/dist-renderer/assets/{diagram-S2PKOQOG-DtrtPSGg.js → diagram-S2PKOQOG-B707WJQw.js} +1 -1
- package/dist-renderer/assets/{erDiagram-Q2GNP2WA-bOICzF9d.js → erDiagram-Q2GNP2WA-C-_1dGHs.js} +1 -1
- package/dist-renderer/assets/{flowDiagram-NV44I4VS-CJV1g9Hr.js → flowDiagram-NV44I4VS-CMTSi3H6.js} +1 -1
- package/dist-renderer/assets/{ganttDiagram-JELNMOA3-CXbhDo09.js → ganttDiagram-JELNMOA3-DZ0bNrAA.js} +1 -1
- package/dist-renderer/assets/{gitGraphDiagram-V2S2FVAM-vbXopTpS.js → gitGraphDiagram-V2S2FVAM-DNVfGooQ.js} +1 -1
- package/dist-renderer/assets/{graph-CY2T-j4q.js → graph-865j_tM_.js} +1 -1
- package/dist-renderer/assets/{index-Dv7q-OB0.js → index-2EW-eu3q.js} +1 -1
- package/dist-renderer/assets/{index-S-i9egm8.js → index-4dEMStJj.js} +1 -1
- package/dist-renderer/assets/{index-C9ONRXVI.js → index-BTx1nc4T.js} +1 -1
- package/dist-renderer/assets/{index-CpyChjme.js → index-C_F9N5x-.js} +1 -1
- package/dist-renderer/assets/{index-Mrh4pTHw.js → index-DuUaf8at.js} +1 -1
- package/dist-renderer/assets/{index-Dn-BpzSm.js → index-LwDIsXJN.js} +8 -8
- package/dist-renderer/assets/{infoDiagram-HS3SLOUP-BNg14AdU.js → infoDiagram-HS3SLOUP-CyqtElLq.js} +1 -1
- package/dist-renderer/assets/{journeyDiagram-XKPGCS4Q-2_PkPCiu.js → journeyDiagram-XKPGCS4Q-BvjQ0Hm0.js} +1 -1
- package/dist-renderer/assets/{kanban-definition-3W4ZIXB7-DjTx7qoU.js → kanban-definition-3W4ZIXB7-CJJ-k0zT.js} +1 -1
- package/dist-renderer/assets/{layout-DZlHGGN0.js → layout-CnV6rQAG.js} +1 -1
- package/dist-renderer/assets/{linear-DnlOm48z.js → linear-Cw3UQgyX.js} +1 -1
- package/dist-renderer/assets/{mindmap-definition-VGOIOE7T-B-nrgt7V.js → mindmap-definition-VGOIOE7T-C5tDaGSK.js} +1 -1
- package/dist-renderer/assets/{pieDiagram-ADFJNKIX-BToJFvWR.js → pieDiagram-ADFJNKIX-CiIpPsau.js} +1 -1
- package/dist-renderer/assets/{quadrantDiagram-AYHSOK5B-C0qoxXvH.js → quadrantDiagram-AYHSOK5B-C3gtowNj.js} +1 -1
- package/dist-renderer/assets/{requirementDiagram-UZGBJVZJ-DCKGwsGN.js → requirementDiagram-UZGBJVZJ-CXBTrAnU.js} +1 -1
- package/dist-renderer/assets/{sankeyDiagram-TZEHDZUN-CS6JCcu7.js → sankeyDiagram-TZEHDZUN-wziX77xG.js} +1 -1
- package/dist-renderer/assets/{sequenceDiagram-WL72ISMW-C9pAWoSR.js → sequenceDiagram-WL72ISMW-sYqopcrj.js} +1 -1
- package/dist-renderer/assets/{stateDiagram-FKZM4ZOC-BTTX_v1m.js → stateDiagram-FKZM4ZOC-Bl1-0_Cp.js} +1 -1
- package/dist-renderer/assets/{stateDiagram-v2-4FDKWEC3-BHk97lQJ.js → stateDiagram-v2-4FDKWEC3-DOYYvDbi.js} +1 -1
- package/dist-renderer/assets/{timeline-definition-IT6M3QCI-CSWCEzCQ.js → timeline-definition-IT6M3QCI-CIRjJUBo.js} +1 -1
- package/dist-renderer/assets/{treemap-GDKQZRPO-CmiIc68g.js → treemap-GDKQZRPO-CVPuNe1n.js} +1 -1
- package/dist-renderer/assets/{xychartDiagram-PRI3JC2R-DhwSTphI.js → xychartDiagram-PRI3JC2R-3nT9yHwp.js} +1 -1
- package/dist-renderer/index.html +1 -1
- package/package.json +2 -2
- package/dist-renderer/assets/channel-DnbgZg0A.js +0 -1
- package/dist-renderer/assets/classDiagram-2ON5EDUG-BAD4p014.js +0 -1
- package/dist-renderer/assets/classDiagram-v2-WZHVMYZB-BAD4p014.js +0 -1
- package/dist-renderer/assets/clone-CRX5ZTPd.js +0 -1
|
@@ -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-C_F9N5x-.js","assets/splashScene-C8lWNnm4.js","assets/index-DuUaf8at.js","assets/index-BTx1nc4T.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-2EW-eu3q.js","assets/index-4dEMStJj.js","assets/dagre-6UL2VRFP-n1g-DhEE.js","assets/graph-865j_tM_.js","assets/_baseUniq-DWo68sXI.js","assets/layout-CnV6rQAG.js","assets/_basePickBy-Dbt_EU-e.js","assets/clone-D7FWfGY9.js","assets/cose-bilkent-S5V4N54A-D9z9Dgt7.js","assets/cytoscape.esm-DsxaTqgk.js","assets/c4Diagram-YG6GDRKO-CN27pqaI.js","assets/chunk-TZMSLE5B-BfFtlPSZ.js","assets/flowDiagram-NV44I4VS-CMTSi3H6.js","assets/chunk-FMBD7UC4-Beimtg3a.js","assets/chunk-55IACEB6-BGAXQZRC.js","assets/chunk-QN33PNHL-OjNBu854.js","assets/channel-5dJIx68e.js","assets/erDiagram-Q2GNP2WA-C-_1dGHs.js","assets/gitGraphDiagram-V2S2FVAM-DNVfGooQ.js","assets/chunk-4BX2VUAB-CXPCI7g_.js","assets/chunk-QZHKN3VN-DinqvbH8.js","assets/treemap-GDKQZRPO-CVPuNe1n.js","assets/ganttDiagram-JELNMOA3-DZ0bNrAA.js","assets/linear-Cw3UQgyX.js","assets/init-Gi6I4Gst.js","assets/defaultLocale-DX6XiGOO.js","assets/infoDiagram-HS3SLOUP-CyqtElLq.js","assets/pieDiagram-ADFJNKIX-CiIpPsau.js","assets/arc-DXH1iZQK.js","assets/ordinal-Cboi1Yqb.js","assets/quadrantDiagram-AYHSOK5B-C3gtowNj.js","assets/xychartDiagram-PRI3JC2R-3nT9yHwp.js","assets/requirementDiagram-UZGBJVZJ-CXBTrAnU.js","assets/sequenceDiagram-WL72ISMW-sYqopcrj.js","assets/classDiagram-2ON5EDUG-BMGXWJ2d.js","assets/chunk-B4BG7PRW-TPDaA_KQ.js","assets/classDiagram-v2-WZHVMYZB-BMGXWJ2d.js","assets/stateDiagram-FKZM4ZOC-Bl1-0_Cp.js","assets/chunk-DI55MBZ5-D1ADe_tq.js","assets/stateDiagram-v2-4FDKWEC3-DOYYvDbi.js","assets/journeyDiagram-XKPGCS4Q-BvjQ0Hm0.js","assets/timeline-definition-IT6M3QCI-CIRjJUBo.js","assets/mindmap-definition-VGOIOE7T-C5tDaGSK.js","assets/kanban-definition-3W4ZIXB7-CJJ-k0zT.js","assets/sankeyDiagram-TZEHDZUN-wziX77xG.js","assets/diagram-S2PKOQOG-B707WJQw.js","assets/diagram-QEK2KX5R-wVnJuwza.js","assets/blockDiagram-VD42YOAC-BKdZF02Y.js","assets/architectureDiagram-VXUJARFQ-cjffS2Qr.js","assets/diagram-PSM6KHXK-BvxFq-BE.js","assets/TeamGraphOverlay-DYT3bwFR.js","assets/ProjectEditorOverlay-Va_Vz-zz.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{L as iD,g as CPe,P as RPe,s as git}from"./splashScene-C8lWNnm4.js";function Oit(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 _it="modulepreload",bit=function(e){return"/"+e},xue={},De=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=bit(c),c in xue)return;xue[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":_it,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 De(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 nR=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Af(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function EZn(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 PPe={exports:{}},MX={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.js
|
|
@@ -977,7 +977,7 @@ Url: ${ZD(e)}`),!0}return!1}function Z_t(e,t){return t?.length?OQe(e).some(n=>Hh
|
|
|
977
977
|
Type: ${e}
|
|
978
978
|
Name: ${mm(r)}
|
|
979
979
|
Error:`,s)}}function pbt(){return J0t(e=>{j$("cls",{metric:e}),DQe=e},{reportAllChanges:!0})}function fbt(){return lbt(e=>{j$("lcp",{metric:e}),LQe=e},{reportAllChanges:!0})}function hbt(){return ubt(e=>{j$("ttfb",{metric:e}),jQe=e})}function mbt(){return ibt(e=>{j$("inp",{metric:e}),XQe=e})}function CU(e,t,n,r,s=!1){zQe(e,t);let i;return nL[e]||(i=n(),nL[e]=!0),r&&t({metric:r}),BQe(e,t,s?i:void 0)}function gbt(e){const t={};e==="event"&&(t.durationThreshold=0),CE(e,n=>{j$(e,{entries:n})},t)}function zQe(e,t){qk[e]=qk[e]||[],qk[e].push(t)}function BQe(e,t,n){return()=>{n&&n();const r=qk[e];if(!r)return;const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}function Obt(e){return"duration"in e}const _bt=e=>{const t=n=>{(n.type==="pagehide"||Hn.document?.visibilityState==="hidden")&&e(n)};kO("visibilitychange",t,{capture:!0,once:!0}),kO("pagehide",t,{capture:!0,once:!0})};function G4(e){return typeof e=="number"&&isFinite(e)}function GO(e,t,n,{...r}){const s=as(e).start_timestamp;return s&&s>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),eQe(e,()=>{const i=Iy({startTime:t,...r});return i&&i.end(n),i})}function bre(e){const t=ss();if(!t)return;const{name:n,transaction:r,attributes:s,startTime:i}=e,{release:o,environment:a,sendDefaultPii:c}=t.getOptions(),d=t.getIntegrationByName("Replay")?.getReplayId(),p=ws(),f=p.getUser(),h=f!==void 0?f.email||f.id||f.ip_address:void 0;let m;try{m=p.getScopeData().contexts.profile.profile_id}catch{}const g={release:o,environment:a,user:h||void 0,profile_id:m||void 0,replay_id:d||void 0,transaction:r,"user_agent.original":Hn.navigator?.userAgent,"client.address":c?"{{auto}}":void 0,...s};return Iy({name:n,attributes:g,startTime:i,experimental:{standalone:!0}})}function X$(){return Hn.addEventListener&&Hn.performance}function Hs(e){return e/1e3}function bbt(e){let t="unknown",n="unknown",r="";for(const s of e){if(s==="/"){[t,n]=e.split("/");break}if(!isNaN(Number(s))){t=r==="h"?"http":r,n=e.split(r)[1];break}r+=s}return r===e&&(t=r),{name:t,version:n}}function RU(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function PU(e,t){let n,r=!1;function s(a){!r&&n&&t(a,n.spanContext().spanId,n),r=!0}_bt(()=>{s("pagehide")});const i=e.on("beforeStartNavigationSpan",(a,c)=>{c?.isRedirect||(s("navigation"),i(),o())}),o=e.on("afterStartPageLoadSpan",a=>{n=a,o()})}function ybt(e){let t=0,n;if(!RU("layout-shift"))return;const r=Ore(({metric:s})=>{const i=s.entries[s.entries.length-1];i&&(t=s.value,n=i)},!0);PU(e,(s,i)=>{xbt(t,n,i,s),r()})}function xbt(e,t,n,r){jm&&Mt.log(`Sending CLS span (${e})`);const s=t?Hs((Ua()||0)+t.startTime):Oo(),i=ws().getScopeData().transactionName,o=t?ga(t.sources[0]?.node):"Layout shift",a={[xo]:"auto.http.browser.cls",[ep]:"ui.webvital.cls",[x_]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t?.sources&&t.sources.forEach((l,d)=>{a[`cls.source.${d+1}`]=ga(l.node)});const c=bre({name:o,transaction:i,attributes:a,startTime:s});c&&(c.addEvent("cls",{[N$]:"",[A$]:e}),c.end(s))}const Sbt=6e4;function U$(e){return e!=null&&e>0&&e<=Sbt}function vbt(e){let t=0,n;if(!RU("largest-contentful-paint"))return;const r=_re(({metric:s})=>{const i=s.entries[s.entries.length-1];!i||!U$(s.value)||(t=s.value,n=i)},!0);PU(e,(s,i)=>{Tbt(t,n,i,s),r()})}function Tbt(e,t,n,r){if(!U$(e))return;jm&&Mt.log(`Sending LCP span (${e})`);const s=Hs((Ua()||0)+(t?.startTime||0)),i=ws().getScopeData().transactionName,o=t?ga(t.element):"Largest contentful paint",a={[xo]:"auto.http.browser.lcp",[ep]:"ui.webvital.lcp",[x_]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(a["lcp.element"]=ga(t.element)),t.id&&(a["lcp.id"]=t.id),t.url&&(a["lcp.url"]=t.url),t.loadTime!=null&&(a["lcp.loadTime"]=t.loadTime),t.renderTime!=null&&(a["lcp.renderTime"]=t.renderTime),t.size!=null&&(a["lcp.size"]=t.size));const c=bre({name:o,transaction:i,attributes:a,startTime:s});c&&(c.addEvent("lcp",{[N$]:"millisecond",[A$]:e}),c.end(s))}function ru(e){return e&&((Ua()||performance.timeOrigin)+e)/1e3}function FQe(e){const t={};if(e.nextHopProtocol!=null){const{name:n,version:r}=bbt(e.nextHopProtocol);t["network.protocol.version"]=r,t["network.protocol.name"]=n}return Ua()||X$()?.timeOrigin?Ebt({...t,"http.request.redirect_start":ru(e.redirectStart),"http.request.redirect_end":ru(e.redirectEnd),"http.request.worker_start":ru(e.workerStart),"http.request.fetch_start":ru(e.fetchStart),"http.request.domain_lookup_start":ru(e.domainLookupStart),"http.request.domain_lookup_end":ru(e.domainLookupEnd),"http.request.connect_start":ru(e.connectStart),"http.request.secure_connection_start":ru(e.secureConnectionStart),"http.request.connection_end":ru(e.connectEnd),"http.request.request_start":ru(e.requestStart),"http.request.response_start":ru(e.responseStart),"http.request.response_end":ru(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0}):t}function Ebt(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}const wbt=2147483647;let yfe=0,el={},jl,rL;function kbt({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){const r=X$();if(r&&Ua()){r.mark&&Hn.performance.mark("sentry-tracing-init");const s=t?vbt(n):t===!1?Nbt():void 0,i=e?ybt(n):e===!1?$bt():void 0,o=Abt();return()=>{o(),s?.(),i?.()}}return()=>{}}function Cbt(){RR("longtask",({entries:e})=>{const t=Hc();if(!t)return;const{op:n,start_timestamp:r}=as(t);for(const s of e){const i=Hs(Ua()+s.startTime),o=Hs(s.duration);n==="navigation"&&r&&i<r||GO(t,i,i+o,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[xo]:"auto.ui.browser.metrics"}})}})}function Rbt(){new PerformanceObserver(t=>{const n=Hc();if(n)for(const r of t.getEntries()){if(!r.scripts[0])continue;const s=Hs(Ua()+r.startTime),{start_timestamp:i,op:o}=as(n);if(o==="navigation"&&i&&s<i)continue;const a=Hs(r.duration),c={[xo]:"auto.ui.browser.metrics"},l=r.scripts[0],{invoker:d,invokerType:p,sourceURL:f,sourceFunctionName:h,sourceCharPosition:m}=l;c["browser.script.invoker"]=d,c["browser.script.invoker_type"]=p,f&&(c["code.filepath"]=f),h&&(c["code.function"]=h),m!==-1&&(c["browser.script.source_char_position"]=m),GO(n,s,s+a,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:c})}}).observe({type:"long-animation-frame",buffered:!0})}function Pbt(){RR("event",({entries:e})=>{const t=Hc();if(t){for(const n of e)if(n.name==="click"){const r=Hs(Ua()+n.startTime),s=Hs(n.duration),i={name:ga(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[xo]:"auto.ui.browser.metrics"}},o=xMe(n.target);o&&(i.attributes["ui.component_name"]=o),GO(t,r,r+s,i)}}})}function $bt(){return Ore(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(el.cls={value:e.value,unit:""},rL=t)},!0)}function Nbt(){return _re(({metric:e})=>{const t=e.entries[e.entries.length-1];!t||!U$(e.value)||(el.lcp={value:e.value,unit:"millisecond"},jl=t)},!0)}function Abt(){return dbt(({metric:e})=>{e.entries[e.entries.length-1]&&(el.ttfb={value:e.value,unit:"millisecond"})})}function Ibt(e,t){const n=X$(),r=Ua();if(!n?.getEntries||!r)return;const{spanStreamingEnabled:s,ignorePerformanceApiSpans:i,ignoreResourceSpans:o,recordClsOnPageloadSpan:a,recordLcpOnPageloadSpan:c}=t,l=Hs(r),d=n.getEntries(),{op:p,start_timestamp:f}=as(e);if(d.slice(yfe).forEach(h=>{const m=Hs(h.startTime),g=Hs(Math.max(0,h.duration));if(!(p==="navigation"&&f&&l+m<f))switch(h.entryType){case"navigation":{Lbt(e,h,l);break}case"mark":case"paint":case"measure":{Qbt(e,h,m,g,l,i);const _=D$(),b=h.startTime<_.firstHiddenTime;h.name==="first-paint"&&b&&(el.fp={value:h.startTime,unit:"millisecond"}),h.name==="first-contentful-paint"&&b&&(el.fcp={value:h.startTime,unit:"millisecond"});break}case"resource":{Ubt(e,h,h.name,m,g,l,o);break}}}),yfe=Math.max(d.length-1,0),zbt(e,s),p==="pageload"){if(Ybt(el),s){const h=(m,g,_)=>{const b=_??`browser.web_vital.${m}.value`;e.setAttribute(b,g),jm&&Mt.log("Setting web vital attribute",{[b]:g},"on pageload span")};["ttfb","fp","fcp"].forEach(m=>{el[m]&&h(m,el[m].value)}),el["ttfb.requestTime"]&&h("ttfb.requestTime",el["ttfb.requestTime"].value,"browser.web_vital.ttfb.request_time")}else a||delete el.cls,c||delete el.lcp,Object.entries(el).forEach(([h,m])=>{xOt(h,m.value,m.unit)}),Bbt(e,t);e.setAttribute(s?"browser.performance.time_origin":"performance.timeOrigin",l),e.setAttribute(s?"browser.performance.navigation.activation_start":"performance.activationStart",kE())}jl=void 0,rL=void 0,el={}}function Mbt(e){if(e?.entryType==="measure")try{return e.detail.devtools.track==="Components ⚛"}catch{return}}function Qbt(e,t,n,r,s,i){if(Mbt(t)||["mark","measure"].includes(t.entryType)&&Hh(t.name,i))return;const o=Q$(!1),a=Hs(o?o.requestStart:0),c=s+Math.max(n,a),l=s+n,d=l+r,p={[xo]:"auto.resource.browser.metrics"};c!==l&&(p["sentry.browser.measure_happened_before_request"]=!0,p["sentry.browser.measure_start_time"]=c),Dbt(p,t),c<=d&&GO(e,c,d,{name:t.name,op:t.entryType,attributes:p})}function Dbt(e,t){try{const n=t.detail;if(!n)return;if(typeof n=="object"){for(const[r,s]of Object.entries(n))if(s&&Zv(s))e[`sentry.browser.measure.detail.${r}`]=s;else if(s!==void 0)try{e[`sentry.browser.measure.detail.${r}`]=JSON.stringify(s)}catch{}return}if(Zv(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function Lbt(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{DA(e,t,r,n)}),DA(e,t,"secureConnection",n,"TLS/SSL"),DA(e,t,"fetch",n,"cache"),DA(e,t,"domainLookup",n,"DNS"),Xbt(e,t,n)}function DA(e,t,n,r,s=n){const i=jbt(n),o=t[i],a=t[`${n}Start`];!a||!o||GO(e,r+Hs(a),r+Hs(o),{op:`browser.${s}`,name:t.name,attributes:{[xo]:"auto.ui.browser.metrics",...n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function jbt(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function Xbt(e,t,n){const r=n+Hs(t.requestStart),s=n+Hs(t.responseEnd),i=n+Hs(t.responseStart);t.responseEnd&&(GO(e,r,s,{op:"browser.request",name:t.name,attributes:{[xo]:"auto.ui.browser.metrics"}}),GO(e,i,s,{op:"browser.response",name:t.name,attributes:{[xo]:"auto.ui.browser.metrics"}}))}function Ubt(e,t,n,r,s,i,o){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;const a=t.initiatorType?`resource.${t.initiatorType}`:"resource.other";if(o?.includes(a))return;const c={[xo]:"auto.resource.browser.metrics"},l=gb(n);l.protocol&&(c["url.scheme"]=l.protocol.split(":").pop()),l.host&&(c["server.address"]=l.host),c["url.same_origin"]=n.includes(Hn.location.origin),Fbt(t,c,[["responseStatus","http.response.status_code"],["transferSize","http.response_transfer_size"],["encodedBodySize","http.response_content_length"],["decodedBodySize","http.decoded_response_content_length"],["renderBlockingStatus","resource.render_blocking_status"],["deliveryType","http.response_delivery_type"]]);const d={...c,...FQe(t)},p=i+r,f=p+s;GO(e,p,f,{name:n.replace(Hn.location.origin,""),op:a,attributes:d})}function zbt(e,t){const n=Hn.navigator;if(!n)return;const r=n.connection;r&&(r.effectiveType&&e.setAttribute(t?"network.connection.effective_type":"effectiveConnectionType",r.effectiveType),r.type&&e.setAttribute(t?"network.connection.type":"connectionType",r.type),G4(r.rtt)&&(el["connection.rtt"]={value:r.rtt,unit:"millisecond"},t&&e.setAttribute("network.connection.rtt",r.rtt))),G4(n.deviceMemory)&&(t?e.setAttribute("device.memory.estimated_capacity",n.deviceMemory):e.setAttribute("deviceMemory",`${n.deviceMemory} GB`)),G4(n.hardwareConcurrency)&&(t?e.setAttribute("device.processor_count",n.hardwareConcurrency):e.setAttribute("hardwareConcurrency",String(n.hardwareConcurrency)))}function Bbt(e,t){jl&&t.recordLcpOnPageloadSpan&&(jl.element&&e.setAttribute("lcp.element",ga(jl.element)),jl.id&&e.setAttribute("lcp.id",jl.id),jl.url&&e.setAttribute("lcp.url",jl.url.trim().slice(0,200)),jl.loadTime!=null&&e.setAttribute("lcp.loadTime",jl.loadTime),jl.renderTime!=null&&e.setAttribute("lcp.renderTime",jl.renderTime),e.setAttribute("lcp.size",jl.size)),rL?.sources&&t.recordClsOnPageloadSpan&&rL.sources.forEach((n,r)=>e.setAttribute(`cls.source.${r+1}`,ga(n.node)))}function Fbt(e,t,n){n.forEach(([r,s])=>{const i=e[r];i!=null&&(typeof i=="number"&&i<wbt||typeof i=="string")&&(t[s]=i)})}function Ybt(e){const t=Q$(!1);if(!t)return;const{responseStart:n,requestStart:r}=t;r<=n&&(e["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}const H4=[],Wk=new Map,dx=new Map,YQe=60;function Vbt(){if(X$()&&Ua()){const t=qbt();return()=>{t()}}return()=>{}}const PR={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"};function qbt(){return UQe(Wbt)}const Wbt=({metric:e})=>{if(e.value==null)return;const t=Hs(e.value);if(t>YQe)return;const n=e.entries.find(m=>m.duration===e.value&&PR[m.name]);if(!n)return;const{interactionId:r}=n,s=PR[n.name],i=Hs(Ua()+n.startTime),o=Hc(),a=o?Pa(o):void 0,c=r!=null?Wk.get(r):void 0,l=c?.span||a,d=l?as(l).description:ws().getScopeData().transactionName,p=c?.elementName||ga(n.target),f={[xo]:"auto.http.browser.inp",[ep]:`ui.interaction.${s}`,[x_]:n.duration},h=bre({name:p,transaction:d,attributes:f,startTime:i});h&&(h.addEvent("inp",{[N$]:"millisecond",[A$]:e.value}),h.end(i+t))};function Gbt(e){return e!=null?Wk.get(e):void 0}function Hbt(){const e=Object.keys(PR);wU()&&e.forEach(s=>{Hn.addEventListener(s,t,{capture:!0,passive:!0})});function t(s){const i=s.target;if(!i)return;const o=ga(i),a=Math.round(s.timeStamp);if(dx.set(a,o),dx.size>50){const c=dx.keys().next().value;c!==void 0&&dx.delete(c)}}function n(s){const i=Math.round(s.startTime);let o=dx.get(i);if(!o)for(let a=-5;a<=5;a++){const c=dx.get(i+a);if(c){o=c;break}}return o||"<unknown>"}const r=({entries:s})=>{const i=Hc(),o=i&&Pa(i);s.forEach(a=>{if(!Obt(a))return;const c=a.interactionId;if(c==null||Wk.has(c))return;const l=a.target?ga(a.target):n(a);if(H4.length>10){const d=H4.shift();Wk.delete(d)}H4.push(c),Wk.set(c,{span:o,elementName:l})})};RR("event",r),RR("first-input",r)}function yre(e){const{name:t,op:n,origin:r,metricName:s,value:i,attributes:o,parentSpan:a,reportEvent:c,startTime:l,endTime:d}=e,p=ws().getScopeData().transactionName,f={[xo]:r,[ep]:n,[x_]:0,[`browser.web_vital.${s}.value`]:i,"sentry.transaction":p,"user_agent.original":Hn.navigator?.userAgent,...o};a&&XMe(a).attributes?.[ep]==="pageload"&&(f["sentry.pageload.span_id"]=a.spanContext().spanId),c&&(f[`browser.web_vital.${s}.report_event`]=c);const h=Iy({name:t,attributes:f,startTime:l,parentSpan:a});h&&h.end(d??l)}function Zbt(e){let t=0,n;if(!RU("largest-contentful-paint"))return;const r=_re(({metric:s})=>{const i=s.entries[s.entries.length-1];!i||!U$(s.value)||(t=s.value,n=i)},!0);PU(e,(s,i,o)=>{Kbt(t,n,o,s),r()})}function Kbt(e,t,n,r){if(!U$(e))return;jm&&Mt.log(`Sending LCP span (${e})`);const s=Ua()||0,i=Hs(s),o=Hs(s+(t?.startTime||0)),a=t?ga(t.element):"Largest contentful paint",c={};t?.element&&(c["browser.web_vital.lcp.element"]=ga(t.element)),t?.id&&(c["browser.web_vital.lcp.id"]=t.id),t?.url&&(c["browser.web_vital.lcp.url"]=t.url),t?.loadTime!=null&&(c["browser.web_vital.lcp.load_time"]=t.loadTime),t?.renderTime!=null&&(c["browser.web_vital.lcp.render_time"]=t.renderTime),t?.size!=null&&(c["browser.web_vital.lcp.size"]=t.size),yre({name:a,op:"ui.webvital.lcp",origin:"auto.http.browser.lcp",metricName:"lcp",value:e,attributes:c,parentSpan:n,reportEvent:r,startTime:i,endTime:o})}function Jbt(e){let t=0,n;if(!RU("layout-shift"))return;const r=Ore(({metric:s})=>{const i=s.entries[s.entries.length-1];i&&(t=s.value,n=i)},!0);PU(e,(s,i,o)=>{eyt(t,n,o,s),r()})}function eyt(e,t,n,r){jm&&Mt.log(`Sending CLS span (${e})`);const s=t?Hs((Ua()||0)+t.startTime):Oo(),i=t?ga(t.sources[0]?.node):"Layout shift",o={};t?.sources&&t.sources.forEach((a,c)=>{o[`browser.web_vital.cls.source.${c+1}`]=ga(a.node)}),yre({name:i,op:"ui.webvital.cls",origin:"auto.http.browser.cls",metricName:"cls",value:e,attributes:o,parentSpan:n,reportEvent:r,startTime:s})}function tyt(){if(!X$()||!Ua())return;UQe(({metric:n})=>{if(n.value==null||Hs(n.value)>YQe)return;const s=n.entries.find(i=>i.duration===n.value&&PR[i.name]);s&&nyt(n.value,s)})}function nyt(e,t){jm&&Mt.log(`Sending INP span (${e})`);const n=Hs(Ua()+t.startTime),r=Hs(e),s=PR[t.name],i=Gbt(t.interactionId),o=Hc(),a=o?Pa(o):void 0,c=i?.span||a,l=c?XMe(c).name:ws().getScopeData().transactionName,d=i?.elementName||ga(t.target);yre({name:d,op:`ui.interaction.${s}`,origin:"auto.http.browser.inp",metricName:"inp",value:e,attributes:{[x_]:t.duration,"sentry.transaction":l},startTime:n,endTime:n+r,parentSpan:c})}const ryt=1e3;let xfe,WH,GH;function syt(e){const t="dom";b_(t,e),y_(t,iyt)}function iyt(){if(!Hn.document)return;const e=ju.bind(null,"dom"),t=Sfe(e,!0);Hn.document.addEventListener("click",t,!1),Hn.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{const s=Hn[n]?.prototype;s?.hasOwnProperty?.("addEventListener")&&(Pc(s,"addEventListener",function(i){return function(o,a,c){if(o==="click"||o=="keypress")try{const l=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},d=l[o]=l[o]||{refCount:0};if(!d.handler){const p=Sfe(e);d.handler=p,i.call(this,o,p,c)}d.refCount++}catch{}return i.call(this,o,a,c)}}),Pc(s,"removeEventListener",function(i){return function(o,a,c){if(o==="click"||o=="keypress")try{const l=this.__sentry_instrumentation_handlers__||{},d=l[o];d&&(d.refCount--,d.refCount<=0&&(i.call(this,o,d.handler,c),d.handler=void 0,delete l[o]),Object.keys(l).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return i.call(this,o,a,c)}}))})}function oyt(e){if(e.type!==WH)return!1;try{if(!e.target||e.target._sentryId!==GH)return!1}catch{}return!0}function ayt(e,t){return e!=="keypress"?!1:t?.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function Sfe(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=lyt(n);if(ayt(n.type,r))return;lc(n,"_sentryCaptured",!0),r&&!r._sentryId&&lc(r,"_sentryId",Xu());const s=n.type==="keypress"?"input":n.type;oyt(n)||(e({event:n,name:s,global:t}),WH=n.type,GH=r?r._sentryId:void 0),clearTimeout(xfe),xfe=Hn.setTimeout(()=>{GH=void 0,WH=void 0},ryt)}}function lyt(e){try{return e.target}catch{return null}}let LA;function xre(e){const t="history";b_(t,e),y_(t,cyt)}function cyt(){if(Hn.addEventListener("popstate",()=>{const t=Hn.location.href,n=LA;if(LA=t,n===t)return;ju("history",{from:n,to:t})}),!T0t())return;function e(t){return function(...n){const r=n.length>2?n[2]:void 0;if(r){const s=LA,i=uyt(String(r));if(LA=i,s===i)return t.apply(this,n);ju("history",{from:s,to:i})}return t.apply(this,n)}}Pc(Hn.history,"pushState",e),Pc(Hn.history,"replaceState",e)}function uyt(e){try{return new URL(e,Hn.location.origin).toString()}catch{return e}}const NQ={};function dyt(e){const t=NQ[e];if(t)return t;let n=Hn[e];if(BH(n))return NQ[e]=n.bind(Hn);const r=Hn.document;if(r&&typeof r.createElement=="function")try{const s=r.createElement("iframe");s.hidden=!0,r.head.appendChild(s);const i=s.contentWindow;i?.[e]&&(n=i[e]),r.head.removeChild(s)}catch(s){jm&&Mt.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,s)}return n&&(NQ[e]=n.bind(Hn))}function pyt(e){NQ[e]=void 0}const PS="__sentry_xhr_v3__";function VQe(e){const t="xhr";b_(t,e),y_(t,fyt)}function fyt(){if(!Hn.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){const s=new Error,i=Oo()*1e3,o=Gh(r[0])?r[0].toUpperCase():void 0,a=hyt(r[1]);if(!o||!a)return t.apply(n,r);n[PS]={method:o,url:a,request_headers:{}},o==="POST"&&a.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const c=()=>{const l=n[PS];if(l&&n.readyState===4){try{l.status_code=n.status}catch{}const d={endTimestamp:Oo()*1e3,startTimestamp:i,xhr:n,virtualError:s};ju("xhr",d)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(l,d,p){return c(),l.apply(d,p)}}):n.addEventListener("readystatechange",c),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(l,d,p){const[f,h]=p,m=d[PS];return m&&Gh(f)&&Gh(h)&&(m.request_headers[f.toLowerCase()]=h),l.apply(d,p)}}),t.apply(n,r)}}),e.send=new Proxy(e.send,{apply(t,n,r){const s=n[PS];if(!s)return t.apply(n,r);r[0]!==void 0&&(s.body=r[0]);const i={startTimestamp:Oo()*1e3,xhr:n};return ju("xhr",i),t.apply(n,r)}})}function hyt(e){if(Gh(e))return e;try{return e.toString()}catch{}}function myt(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return jm&&Mt.error(n,"Failed to get xhr response headers",e),{}}return t?t.split(`\r
|
|
980
|
-
`).reduce((n,r)=>{const[s,i]=r.split(": ");return i&&(n[s.toLowerCase()]=i),n},{}):{}}const gyt=40;function Oyt(e,t=dyt("fetch")){let n=0,r=0;async function s(i){const o=i.body.length;n+=o,r++;const a={body:i.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{const c=await t(e.url,a);return{statusCode:c.status,headers:{"x-sentry-rate-limits":c.headers.get("X-Sentry-Rate-Limits"),"retry-after":c.headers.get("Retry-After")}}}catch(c){throw pyt("fetch"),c}finally{n-=o,r--}}return k_t(e,s,dre(e.bufferSize||gyt))}const Dc=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,_yt=30,byt=50;function HH(e,t,n,r){const s={filename:e,function:t==="<anonymous>"?jb:t,in_app:!0};return n!==void 0&&(s.lineno=n),r!==void 0&&(s.colno=r),s}const yyt=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,xyt=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Syt=/\((\S*)(?::(\d+))(?::(\d+))\)/,vyt=/at (.+?) ?\(data:(.+?),/,Tyt=e=>{const t=e.match(vyt);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=yyt.exec(e);if(n){const[,s,i,o]=n;return HH(s,jb,+i,+o)}const r=xyt.exec(e);if(r){if(r[2]?.indexOf("eval")===0){const a=Syt.exec(r[2]);a&&(r[2]=a[1],r[3]=a[2],r[4]=a[3])}const[i,o]=qQe(r[1]||jb,r[2]);return HH(o,i,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},Eyt=[_yt,Tyt],wyt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,kyt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Cyt=e=>{const t=wyt.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const i=kyt.exec(t[3]);i&&(t[1]=t[1]||"eval",t[3]=i[1],t[4]=i[2],t[5]="")}let r=t[3],s=t[1]||jb;return[s,r]=qQe(s,r),HH(r,s,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},Ryt=[byt,Cyt],Pyt=[Eyt,Ryt],$yt=hMe(...Pyt),qQe=(e,t)=>{const n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:jb,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},jA=1024,Nyt="Breadcrumbs",Ayt=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:Nyt,setup(n){t.console&&i0t(Dyt(n)),t.dom&&syt(Qyt(n,t.dom)),t.xhr&&VQe(Lyt(n)),t.fetch&&CQe(jyt(n)),t.history&&xre(Xyt(n)),t.sentry&&n.on("beforeSendEvent",Myt(n))}}},Iyt=Ayt;function Myt(e){return function(n){ss()===e&&WO({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:E0(n)},{event:n})}}function Qyt(e,t){return function(r){if(ss()!==e)return;let s,i,o=typeof t=="object"?t.serializeAttribute:void 0,a=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;a&&a>jA&&(Dc&&Mt.warn(`\`dom.maxStringLength\` cannot exceed ${jA}, but a value of ${a} was configured. Sentry will use ${jA} instead.`),a=jA),typeof o=="string"&&(o=[o]);try{const l=r.event,d=Uyt(l)?l.target:l;s=ga(d,{keyAttrs:o,maxStringLength:a}),i=xMe(d)}catch{s="<unknown>"}if(s.length===0)return;const c={category:`ui.${r.name}`,message:s};i&&(c.data={"ui.component_name":i}),WO(c,{event:r.event,name:r.name,global:r.global})}}function Dyt(e){return function(n){if(ss()!==e)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:a0t(n.level),message:Ppe(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${Ppe(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;WO(r,{input:n.args,level:n.level})}}function Lyt(e){return function(n){if(ss()!==e)return;const{startTimestamp:r,endTimestamp:s}=n,i=n.xhr[PS];if(!r||!s||!i)return;const{method:o,url:a,status_code:c,body:l}=i,d={method:o,url:a,status_code:c},p={xhr:n.xhr,input:l,startTimestamp:r,endTimestamp:s},f={category:"xhr",data:d,type:"http",level:kQe(c)};e.emit("beforeOutgoingRequestBreadcrumb",f,p),WO(f,p)}}function jyt(e){return function(n){if(ss()!==e)return;const{startTimestamp:r,endTimestamp:s}=n;if(s&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){const i={data:n.error,input:n.args,startTimestamp:r,endTimestamp:s},o={category:"fetch",data:n.fetchData,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",o,i),WO(o,i)}else{const i=n.response,o={...n.fetchData,status_code:i?.status},a={input:n.args,response:i,startTimestamp:r,endTimestamp:s},c={category:"fetch",data:o,type:"http",level:kQe(o.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",c,a),WO(c,a)}}}function Xyt(e){return function(n){if(ss()!==e)return;let r=n.from,s=n.to;const i=gb(pr.location.href);let o=r?gb(r):void 0;const a=gb(s);o?.path||(o=i),i.protocol===a.protocol&&i.host===a.host&&(s=a.relative),i.protocol===o.protocol&&i.host===o.host&&(r=o.relative),WO({category:"navigation",data:{from:r,to:s}})}}function Uyt(e){return!!e&&!!e.target}const zyt="EventTarget,Window,Node,ApplicationCache,AudioTrackList,BroadcastChannel,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(","),Byt="BrowserApiErrors",Fyt=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:Byt,setupOnce(){t.setTimeout&&Pc(pr,"setTimeout",vfe),t.setInterval&&Pc(pr,"setInterval",vfe),t.requestAnimationFrame&&Pc(pr,"requestAnimationFrame",Vyt),t.XMLHttpRequest&&"XMLHttpRequest"in pr&&Pc(XMLHttpRequest.prototype,"send",qyt);const n=t.eventTarget;n&&(Array.isArray(n)?n:zyt).forEach(s=>Wyt(s,t))}}},Yyt=Fyt;function vfe(e){return function(...t){const n=t[0];return t[0]=tT(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${mm(e)}`}}),e.apply(this,t)}}function Vyt(e){return function(t){return e.apply(this,[tT(t,{mechanism:{data:{handler:mm(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function qyt(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(s=>{s in n&&typeof n[s]=="function"&&Pc(n,s,function(i){const o={mechanism:{data:{handler:mm(i)},handled:!1,type:`auto.browser.browserapierrors.xhr.${s}`}},a=sre(i);return a&&(o.mechanism.data.handler=mm(a)),tT(i,o)})}),e.apply(this,t)}}function Wyt(e,t){const r=pr[e]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(Pc(r,"addEventListener",function(s){return function(i,o,a){try{Gyt(o)&&(o.handleEvent=tT(o.handleEvent,{mechanism:{data:{handler:mm(o),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&Hyt(this,i,o),s.apply(this,[i,tT(o,{mechanism:{data:{handler:mm(o),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),a])}}),Pc(r,"removeEventListener",function(s){return function(i,o,a){try{const c=o.__sentry_wrapped__;c&&s.call(this,i,c,a)}catch{}return s.call(this,i,o,a)}}))}function Gyt(e){return typeof e.handleEvent=="function"}function Hyt(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}const Zyt=(e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof pr.document>"u"){Dc&&Mt.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}efe({ignoreDuration:!0}),B4();const n=Df();let r=n.getUser();n.addScopeListener(s=>{const i=s.getUser();(r?.id!==i?.id||r?.ip_address!==i?.ip_address)&&(B4(),r=i)}),t==="route"&&xre(({from:s,to:i})=>{s!==i&&(efe({ignoreDuration:!0}),B4())})}}},Kyt="CultureContext",Jyt=()=>({name:Kyt,preprocessEvent(e){const t=Tfe();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})},processSegmentSpan(e){const t=Tfe();t&&oQe(e,{"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar})}}),ext=Jyt;function Tfe(){try{const e=pr.Intl;if(!e)return;const t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}const txt="GlobalHandlers",nxt=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:txt,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(sxt(n),Efe("onerror")),t.onunhandledrejection&&(ixt(n),Efe("onunhandledrejection"))}}},rxt=nxt;function sxt(e){gMe(t=>{const{stackParser:n,attachStacktrace:r}=WQe();if(ss()!==e||PQe())return;const{msg:s,url:i,line:o,column:a,error:c}=t,l=lxt(hre(n,c||s,void 0,r,!1),i,o,a);l.level="error",lQe(l,{originalException:c,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function ixt(e){OMe(t=>{const{stackParser:n,attachStacktrace:r}=WQe();if(ss()!==e||PQe())return;const s=oxt(t),i=Zv(s)?axt(s):hre(n,s,void 0,r,!0);i.level="error",lQe(i,{originalException:s,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function oxt(e){if(Zv(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}function axt(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function lxt(e,t,n,r){const s=e.exception=e.exception||{},i=s.values=s.values||[],o=i[0]=i[0]||{},a=o.stacktrace=o.stacktrace||{},c=a.frames=a.frames||[];return c.length===0&&c.push({colno:r,lineno:n,filename:cxt(t)??C$(),function:jb,in_app:!0}),e}function Efe(e){Dc&&Mt.log(`Global Handler attached: ${e}`)}function WQe(){return ss()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function cxt(e){if(!(!Gh(e)||e.length===0))return e.startsWith("data:")?`<${wO(e,!1)}>`:e}const uxt=()=>({name:"HttpContext",preprocessEvent(e){if(!pr.navigator&&!pr.location&&!pr.document)return;const t=KD(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}},processSegmentSpan(e){if(!pr.navigator&&!pr.location&&!pr.document)return;const t=KD();oQe(e,{"url.full":t.url||void 0,"http.request.header.user_agent":t.headers["User-Agent"],"http.request.header.referer":t.headers.Referer})}}),dxt="cause",pxt=5,fxt="LinkedErrors",hxt=(e={})=>{const t=e.limit||pxt,n=e.key||dxt;return{name:fxt,preprocessEvent(r,s,i){const o=i.getOptions();r0t(pre,o.stackParser,n,t,r,s)}}},mxt=hxt;function gxt(){return Oxt()?(Dc&&$y(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0):!1}function Oxt(){if(typeof pr.window>"u")return!1;const e=pr;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;const n=C$();return!(pr===pr.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}function _xt(e){return[G_t(),Y_t(),g0t(),Yyt(),Iyt(),rxt(),mxt(),u0t(),uxt(),ext(),Zyt()]}function bxt(e={}){const t=!e.skipBrowserExtensionCheck&&gxt();let n=e.defaultIntegrations==null?_xt():e.defaultIntegrations;const r={...e,enabled:t?!1:e.enabled,stackParser:Bmt(e.stackParser||$yt),integrations:l_t({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||Oyt};return D_t(F0t,r)}function yxt(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function GQe(e){try{return new URL(e,pr.location.origin).href}catch{return}}function xxt(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function HQe(e){try{return new Headers(e)}catch{return}}const wfe=new WeakMap,Z4=new Map,ZQe={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function Sxt(e,t){const{traceFetch:n,traceXHR:r,trackFetchStreamPerformance:s,shouldCreateSpanForRequest:i,enableHTTPTimings:o,tracePropagationTargets:a,onRequestSpanStart:c,onRequestSpanEnd:l}={...ZQe,...t},d=typeof i=="function"?i:m=>!0,p=m=>Txt(m,a),f={},h=e.getOptions().propagateTraceparent;n&&(e.addEventProcessor(m=>(m.type==="transaction"&&m.spans&&m.spans.forEach(g=>{if(g.op==="http.client"){const _=Z4.get(g.span_id);_&&(g.timestamp=_/1e3,Z4.delete(g.span_id))}}),m)),s&&k0t(m=>{if(m.response){const g=wfe.get(m.response);g&&m.endTimestamp&&Z4.set(g,m.endTimestamp)}}),CQe(m=>{const g=O0t(m,d,p,f,{propagateTraceparent:h,onRequestSpanEnd:l});if(m.response&&m.fetchData.__span&&wfe.set(m.response,m.fetchData.__span),g){const _=GQe(m.fetchData.url),b=_?gb(_).host:void 0;g.setAttributes({"http.url":_?wO(_):void 0,"server.address":b}),o&&kfe(g,e),c?.(g,{headers:m.headers})}})),r&&VQe(m=>{const g=Ext(m,d,p,f,h,l);g&&(o&&kfe(g,e),c?.(g,{headers:HQe(m.xhr.__sentry_xhr_v3__?.request_headers)}))})}const vxt=300;function kfe(e,t){const{url:n}=as(e).data;if(!n||typeof n!="string")return;let r=()=>void setTimeout(s);if(Tf(t)){const i=e.end.bind(e);e.end=o=>{const a=o??Oo();let c=!1;const l=()=>{c||(c=!0,setTimeout(s),i(a),clearTimeout(d))};r=l;const d=setTimeout(l,vxt)}}const s=RR("resource",({entries:i})=>{i.forEach(o=>{xxt(o)&&o.name.endsWith(n)&&(e.setAttributes(FQe(o)),r())})})}function Txt(e,t){const n=C$();if(n){let r,s;try{r=new URL(e,n),s=new URL(n).origin}catch{return!1}const i=r.origin===s;return t?Hh(r.toString(),t)||i&&Hh(r.pathname,t):i}else{const r=!!e.match(/^\/(?!\/)/);return t?Hh(e,t):r}}function Ext(e,t,n,r,s,i){const o=e.xhr,a=o?.[PS];if(!o||o.__sentry_own_request__||!a)return;const{url:c,method:l}=a,d=Bd()&&t(c);if(e.endTimestamp){const y=o.__sentry_xhr_span_id__;if(!y)return;const x=r[y];x&&(d&&a.status_code!==void 0&&(RMe(x,a.status_code),x.end(),i?.(x,{headers:HQe(myt(o)),error:e.error})),delete r[y]);return}const p=GQe(c),f=gb(p||c),h=wO(FOt(c)),m=ss(),_=!!Hc()||!!m&&Tf(m),b=d&&_?Iy({name:`${l} ${h}`,attributes:{url:wO(c),type:"xhr","http.method":l,"http.url":p?wO(p):void 0,"server.address":f?.host,[xo]:"auto.http.browser",[ep]:"http.client",...f?.search&&{"http.query":f?.search},...f?.hash&&{"http.fragment":f?.hash}}}):new ff;return d&&!_&&m?.recordDroppedEvent("no_parent_span","span"),o.__sentry_xhr_span_id__=b.spanContext().spanId,r[o.__sentry_xhr_span_id__]=b,n(c)&&wxt(o,Bd()&&_?b:void 0,s),m&&m.emit("beforeOutgoingRequestSpan",b,e),b}function wxt(e,t,n){const{"sentry-trace":r,baggage:s,traceparent:i}=vQe({span:t,propagateTraceparent:n});r&&kxt(e,r,s,i)}function kxt(e,t,n,r){const s=e.__sentry_xhr_v3__?.request_headers;if(!(s?.["sentry-trace"]||!e.setRequestHeader))try{if(e.setRequestHeader("sentry-trace",t),r&&!s?.traceparent&&e.setRequestHeader("traceparent",r),n){const i=s?.baggage;(!i||!yxt(i))&&e.setRequestHeader("baggage",n)}}catch{}}function Cxt(){pr.document?pr.document.addEventListener("visibilitychange",()=>{const e=Hc();if(!e)return;const t=Pa(e);if(pr.document.hidden&&t){const n="cancelled",{op:r,status:s}=as(t);Dc&&Mt.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),s||t.setStatus({code:$o,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):Dc&&Mt.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const Rxt=3600,KQe="sentry_previous_trace",Pxt="sentry.previous_trace";function $xt(e,{linkPreviousTrace:t,consistentTraceSampling:n}){const r=t==="session-storage";let s=r?Ixt():void 0;e.on("spanStart",o=>{if(Pa(o)!==o)return;const a=ws().getPropagationContext();s=Nxt(s,o,a),r&&Axt(s)});let i=!0;n&&e.on("beforeSampling",o=>{if(!s)return;const a=ws(),c=a.getPropagationContext();if(i&&c.parentSpanId){i=!1;return}a.setPropagationContext({...c,dsc:{...c.dsc,sample_rate:String(s.sampleRate),sampled:String(ZH(s.spanContext))},sampleRand:s.sampleRand}),o.parentSampled=ZH(s.spanContext),o.parentSampleRate=s.sampleRate,o.spanAttributes={...o.spanAttributes,[kMe]:s.sampleRate}})}function Nxt(e,t,n){const r=as(t);function s(){try{return Number(n.dsc?.sample_rate)??Number(r.data?.[ire])}catch{return 0}}const i={spanContext:t.spanContext(),startTimestamp:r.start_timestamp,sampleRate:s(),sampleRand:n.sampleRand};if(!e)return i;const o=e.spanContext;return o.traceId===r.trace_id?e:(Date.now()/1e3-e.startTimestamp<=Rxt&&(Dc&&Mt.log(`Adding previous_trace \`${JSON.stringify(o)}\` link to span \`${JSON.stringify({op:r.op,...t.spanContext()})}\``),t.addLink({context:o,attributes:{[Sgt]:"previous_trace"}}),t.setAttribute(Pxt,`${o.traceId}-${o.spanId}-${ZH(o)?1:0}`)),i)}function Axt(e){try{pr.sessionStorage.setItem(KQe,JSON.stringify(e))}catch(t){Dc&&Mt.warn("Could not store previous trace in sessionStorage",t)}}function Ixt(){try{const e=pr.sessionStorage?.getItem(KQe);return JSON.parse(e)}catch{return}}function ZH(e){return e.traceFlags===1}const Mxt="BrowserTracing",Qxt=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function Dxt(){const e=pr.navigator;return e?.userAgent?Qxt.test(e.userAgent):!1}const Lxt={...CQ,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...ZQe},jxt=(e={})=>{"enableElementTiming"in e&&$y(()=>{console.warn("[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.")});const t={name:void 0,source:void 0},n=pr.document,{enableInp:r,enableLongTask:s,enableLongAnimationFrame:i,_experiments:{enableInteractions:o,enableStandaloneClsSpans:a,enableStandaloneLcpSpans:c},beforeStartSpan:l,idleTimeout:d,finalTimeout:p,childSpanTimeout:f,markBackgroundSpan:h,traceFetch:m,traceXHR:g,trackFetchStreamPerformance:_,shouldCreateSpanForRequest:b,enableHTTPTimings:y,ignoreResourceSpans:x,ignorePerformanceApiSpans:S,instrumentPageLoad:v,instrumentNavigation:T,detectRedirects:E,linkPreviousTrace:w,consistentTraceSampling:P,enableReportPageLoaded:C,onRequestSpanStart:k,onRequestSpanEnd:I}={...Lxt,...e},Q=Dxt();let $,R,N;function j(M,U,A=!0){const F=U.op==="pageload",z=U.name,D=l?l(U):U,V=D.attributes||{};if(z!==D.name&&(V[jh]="custom",D.attributes=V),!A){const te=Ny();Iy({...D,startTime:te}).end(te);return}t.name=D.name,t.source=V[jh];const q=nQe(D,{idleTimeout:d,finalTimeout:p,childSpanTimeout:f,disableAutoFinish:F,beforeSpanEnd:te=>{$?.();const H=Tf(M);Ibt(te,{recordClsOnPageloadSpan:!H&&!a,recordLcpOnPageloadSpan:!H&&!c,ignoreResourceSpans:x,ignorePerformanceApiSpans:S,spanStreamingEnabled:H}),Pfe(M,void 0);const G=ws(),ie=G.getPropagationContext();G.setPropagationContext({...ie,traceId:q.spanContext().traceId,sampled:S_(q),dsc:qO(te)}),F&&(N=void 0)},trimIdleSpanEndTimestamp:!C});F&&C&&(N=q),Pfe(M,q);function ee(){n&&["interactive","complete"].includes(n.readyState)&&M.emit("idleSpanEnableAutoFinish",q)}F&&!C&&n&&(n.addEventListener("readystatechange",()=>{ee()}),ee())}return{name:Mxt,setup(M){if(Q){Dc&&Mt.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}Ggt();const U=Tf(M);if($=kbt({recordClsStandaloneSpans:U?void 0:a||!1,recordLcpStandaloneSpans:U?void 0:c||!1,client:M}),U?(Zbt(M),Jbt(M),r&&tyt()):r&&Vbt(),i&&Xr.PerformanceObserver&&PerformanceObserver.supportedEntryTypes?.includes("long-animation-frame")?Rbt():s&&Cbt(),o&&Pbt(),E&&n){const F=()=>{R=Oo()};addEventListener("click",F,{capture:!0}),addEventListener("keydown",F,{capture:!0,passive:!0})}function A(){const F=$R(M);F&&!as(F).timestamp&&(Dc&&Mt.log(`[Tracing] Finishing current active span with op: ${as(F).op}`),F.setAttribute(TR,"cancelled"),F.end())}M.on("startNavigationSpan",(F,z)=>{if(ss()!==M)return;if(z?.isRedirect){Dc&&Mt.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),j(M,{op:"navigation.redirect",...F},!1);return}R=void 0,A(),Df().setPropagationContext({traceId:Om(),sampleRand:Math.random(),propagationSpanId:Bd()?void 0:Zh()});const D=ws();D.setPropagationContext({traceId:Om(),sampleRand:Math.random(),propagationSpanId:Bd()?void 0:Zh()}),D.setSDKProcessingMetadata({normalizedRequest:void 0}),j(M,{op:"navigation",...F,parentSpan:null,forceTransaction:!0})}),M.on("startPageLoadSpan",(F,z={})=>{if(ss()!==M)return;A();const D=z.sentryTrace||Cfe("sentry-trace")||Rfe("sentry-trace"),V=z.baggage||Cfe("baggage")||Rfe("baggage"),q=Ugt(D,V),ee=ws();ee.setPropagationContext(q),Bd()||(ee.getPropagationContext().propagationSpanId=Zh()),ee.setSDKProcessingMetadata({normalizedRequest:KD()}),j(M,{op:"pageload",...F})}),M.on("endPageloadSpan",()=>{C&&N&&(N.setAttribute(TR,"reportPageLoaded"),N.end())})},afterAllSetup(M){if(Q)return;let U=C$();if(w!=="off"&&$xt(M,{linkPreviousTrace:w,consistentTraceSampling:P}),pr.location){if(v){const A=Ua();Xxt(M,{name:pr.location.pathname,startTime:A?A/1e3:void 0,attributes:{[jh]:"url",[xo]:"auto.pageload.browser"}})}T&&xre(({to:A,from:F})=>{if(F===void 0&&U?.indexOf(A)!==-1){U=void 0;return}U=void 0;const z=iQe(A),D=$R(M),V=D&&E&&Bxt(D,R);Uxt(M,{name:z?.pathname||pr.location.pathname,attributes:{[jh]:"url",[xo]:"auto.navigation.browser"}},{url:A,isRedirect:V})})}h&&Cxt(),o&&zxt(M,d,p,f,t),r&&Hbt(),Sxt(M,{traceFetch:m,traceXHR:g,trackFetchStreamPerformance:_,tracePropagationTargets:M.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:b,enableHTTPTimings:y,onRequestSpanStart:k,onRequestSpanEnd:I})}}};function Xxt(e,t,n){e.emit("startPageLoadSpan",t,n),ws().setTransactionName(t.name);const r=$R(e);return r&&e.emit("afterStartPageLoadSpan",r),r}function Uxt(e,t,n){const{url:r,isRedirect:s}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:s}),e.emit("startNavigationSpan",t,{isRedirect:s});const i=ws();return i.setTransactionName(t.name),r&&!s&&i.setSDKProcessingMetadata({normalizedRequest:{...KD(),url:r}}),$R(e)}function Cfe(e){return pr.document?.querySelector(`meta[name=${e}]`)?.getAttribute("content")||void 0}function Rfe(e){return pr.performance?.getEntriesByType?.("navigation")[0]?.serverTiming?.find(r=>r.name===e)?.description}function zxt(e,t,n,r,s){const i=pr.document;let o;const a=()=>{const c="ui.action.click",l=$R(e);if(l){const d=as(l).op;if(["navigation","pageload"].includes(d)){Dc&&Mt.warn(`[Tracing] Did not create ${c} span because a pageload or navigation span is in progress.`);return}}if(o&&(o.setAttribute(TR,"interactionInterrupted"),o.end(),o=void 0),!s.name){Dc&&Mt.warn(`[Tracing] Did not create ${c} transaction because _latestRouteName is missing.`);return}o=nQe({name:s.name,op:c,attributes:{[jh]:s.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})};i&&addEventListener("click",a,{capture:!0})}const JQe="_sentry_idleSpan";function $R(e){return e[JQe]}function Pfe(e,t){lc(e,JQe,t)}const $fe=1.5;function Bxt(e,t){const n=as(e),r=Ny(),s=n.start_timestamp;return!(r-s>$fe||t&&r-t<=$fe)}function Fxt(e){const t={...e};return SQe(t,"react"),e_t("react",{version:O.version}),bxt(t)}const Yxt="hermit@1.6.36",Vxt="production",qxt=.1;function Wxt(e){return e.length>0&&e.startsWith("https://")}let e2e=!0,NR=!1;function t2e(e){e2e=e}function Gxt(){if(NR)return;const e="";if(!Wxt(e))return;Fxt({...{dsn:e,release:Yxt,environment:Vxt,tracesSampleRate:qxt,sendDefaultPii:!1},beforeSend:r=>e2e?r:null,integrations:[jxt()]}),NR=!0}function Hxt(){return NR}function Zxt(e,t){NR&&WO({category:"navigation",message:`Tab: ${e} → ${t}`,level:"info"})}function Kxt(e,t){NR&&SU(n=>{t&&n.setContext("react",t),aQe(e)})}function RE(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function Jxt(e,t){let n;const r=()=>{if(n)return n;const s=indexedDB.open(e);return s.onupgradeneeded=()=>s.result.createObjectStore(t),n=RE(s),n.then(i=>{i.onclose=()=>n=void 0},()=>{}),n};return(s,i)=>r().then(o=>i(o.transaction(t,s).objectStore(t)))}let K4;function $U(){return K4||(K4=Jxt("keyval-store","keyval")),K4}function Fd(e,t=$U()){return t("readonly",n=>RE(n.get(e)))}function My(e,t,n=$U()){return n("readwrite",r=>(r.put(t,e),RE(r.transaction)))}function sl(e,t=$U()){return t("readwrite",n=>(n.delete(e),RE(n.transaction)))}function eSt(e,t){return e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},RE(e.transaction)}function n2e(e=$U()){return e("readonly",t=>{if(t.getAllKeys)return RE(t.getAllKeys());const n=[];return eSt(t,r=>n.push(r.key)).then(()=>n)})}const Sre="comment-read-state-v2",r2e="comment-read-state-v2",tSt="comment-read-state",nSt="comment-read-state",rSt=300,sSt=30*24*60*60*1e3;function iSt(){try{const e=localStorage.getItem(r2e);if(!e)return null;const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?null:t}catch{return null}}function s2e(e){try{localStorage.setItem(r2e,JSON.stringify(e))}catch{}}function oSt(){try{const e=localStorage.getItem(nSt);if(!e)return null;const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return null;const n=Object.entries(t);return n.length>0&&typeof n[0][1]=="number"?t:null}catch{return null}}function i2e(e){const t={};for(const[n,r]of Object.entries(e))typeof r=="number"&&r>0&&(t[n]={readIds:[],lastUpdated:r});return t}let ua={};const J4=iSt();if(J4&&Object.keys(J4).length>0)ua=J4;else{const e=oSt();e&&Object.keys(e).length>0&&(ua=i2e(e))}let KH=Object.keys(ua).length>0,nT=!0,XA=null;const JH=new Set;function o2e(e){return JH.add(e),KH||dSt(),()=>{JH.delete(e)}}function a2e(){return ua}function aSt(e,t,n){if(n.length===0)return;const r=`${e}/${t}`,s=ua[r],i=new Set(s?.readIds??[]);let o=!1;for(const a of n)i.has(a)||(i.add(a),o=!0);o&&(ua={...ua,[r]:{readIds:Array.from(i),lastUpdated:Date.now()}},sL(),uSt())}function l2e(e,t,n,r){if(!r||r.length===0)return 0;const s=`${t}/${n}`,i=e[s];if(!i)return r.length;const o=new Set(i.readIds),a=o.size===0?i.lastUpdated:0;let c=0;for(const l of r)l.id&&o.has(l.id)||a>0&&new Date(l.createdAt).getTime()<=a||c++;return c}function lSt(e,t){const n=`${e}/${t}`,r=ua[n];return new Set(r?.readIds??[])}function cSt(e,t){const n=`${e}/${t}`,r=ua[n];return!r||r.readIds.length>0?0:r.lastUpdated}function vre(){return typeof indexedDB<"u"}function sL(){JH.forEach(e=>e())}function uSt(){XA&&clearTimeout(XA),XA=setTimeout(()=>{XA=null,pSt()},rSt)}async function dSt(){if(!KH){if(vre()&&nT)try{const e=await Fd(Sre);if(e&&typeof e=="object"){const t={...ua};for(const[n,r]of Object.entries(e)){if(!r||typeof r!="object")continue;const s=r,i=t[n];if(!i)t[n]=s;else{const o=new Set([...i.readIds,...s.readIds]);t[n]={readIds:Array.from(o),lastUpdated:Math.max(i.lastUpdated,s.lastUpdated)}}}ua=t,sL()}else{const t=await Fd(tSt);if(t&&typeof t=="object"){const n=i2e(t),r={...ua};for(const[s,i]of Object.entries(n))r[s]?r[s]={readIds:[...new Set([...r[s].readIds,...i.readIds])],lastUpdated:Math.max(r[s].lastUpdated,i.lastUpdated)}:r[s]=i;ua=r,sL()}}}catch{nT=!1}KH=!0}}async function pSt(){if(s2e(ua),nT&&vre())try{await My(Sre,ua)}catch{nT=!1}}async function fSt(){const e=Date.now();let t=!1;const n={};for(const[r,s]of Object.entries(ua))e-s.lastUpdated<sSt?n[r]=s:t=!0;if(t&&(ua=n,sL(),s2e(n),nT&&vre()))try{await My(Sre,n)}catch{nT=!1}}function dr(e){let t=e.replace(/\\/g,"/");if(t!=="/"&&!/^[A-Za-z]:\/$/.test(t))for(;t.endsWith("/");)t=t.slice(0,-1);return t.toLowerCase()}function Tre(e,t){return t==="pending"?{...e,pending:e.pending+1}:t==="in_progress"?{...e,inProgress:e.inProgress+1}:t==="completed"?{...e,completed:e.completed+1}:e}function hSt(e){const t=new Map;for(const n of e){if(!n.projectPath)continue;const r=dr(n.projectPath),s=t.get(r)??{pending:0,inProgress:0,completed:0};t.set(r,Tre(s,n.status))}return t}function mSt(e){const t=new Map;for(const n of e){const r=n.teamName,s=t.get(r)??{pending:0,inProgress:0,completed:0};t.set(r,Tre(s,n.status))}return t}function gSt(e){const t=new Map;for(const n of e){const r=n.owner?.trim();if(!r||n.status==="deleted")continue;const s=r.toLowerCase(),i=t.get(s)??{pending:0,inProgress:0,completed:0};t.set(s,Tre(i,n.status))}return t}function HO({multimodelEnabled:e,bootstrapCliStatus:t,fetchCliStatus:n}){return e?t({multimodelEnabled:!0}):n()}const OSt=2*60*1e3;function _St(e){if(!e)return;const t=[];if(typeof e.createdAt=="string"&&e.createdAt.length>0&&t.push(e.createdAt),Array.isArray(e.workIntervals))for(const o of e.workIntervals)typeof o?.startedAt=="string"&&o.startedAt.length>0&&t.push(o.startedAt);if(Array.isArray(e.historyEvents))for(const o of e.historyEvents)typeof o?.timestamp=="string"&&o.timestamp.length>0&&t.push(o.timestamp);if(t.length===0)return;const[n,...r]=t,s=r.reduce((o,a)=>o<a?o:a,n),i=new Date(s);return i.setTime(i.getTime()-OSt),i.toISOString()}function bSt(e){return Array.isArray(e.historyEvents)?e.historyEvents:[]}function ySt(e){const t=bSt(e);for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.type==="review_requested"||r.type==="review_changes_requested"||r.type==="review_approved"||r.type==="review_started")return r.to;if(r.type==="status_changed"&&(r.to==="in_progress"||r.to==="deleted"))return"none";if(r.type==="status_changed"&&r.to==="pending"){for(let s=n-1;s>=0;s--){const i=t[s];if(i.type==="review_requested"||i.type==="review_changes_requested"||i.type==="review_approved"||i.type==="review_started")return i.to==="needsFix"?"needsFix":"none";if(i.type==="task_created"||i.type==="status_changed"&&(i.to==="in_progress"||i.to==="pending"||i.to==="deleted"))return"none"}return"none"}}return null}function xSt(e){return e==="review"||e==="needsFix"||e==="approved"?e:"none"}function c2e(e){if(Array.isArray(e.historyEvents)&&e.historyEvents.length>0){const s=ySt({historyEvents:e.historyEvents});if(s)return s}const t=typeof e.status=="string"?e.status:null,n=s=>{const i=xSt(s);return i==="none"?null:t==="in_progress"||t==="deleted"?"none":t==="pending"?i==="needsFix"?"needsFix":"none":t==="completed"?i==="review"||i==="approved"?i:"none":i},r=n(e.reviewState);return r||(e.kanbanColumn==="review"||e.kanbanColumn==="approved"?n(e.kanbanColumn)??"none":"none")}function SSt(e){return e==="review"||e==="approved"?e:void 0}function Xb(e){return SSt(c2e(e))}function vSt(e){return c2e(e)}function Ere(e){const t=vSt(e);return t==="approved"?"approved":t==="review"?"review":e.status==="completed"?"completed":"active"}function TSt(e){const t=typeof e=="string"?e:Ere(e);return t==="completed"||t==="approved"}function ESt(e){return typeof e=="string"?e!=="active":Ere(e)!=="active"?!0:e.status==="in_progress"}function u2e(e){return _St(e)}function Yc(e,t){return{...{owner:e.owner,status:e.status,intervals:e.workIntervals,since:u2e(e),stateBucket:Ere(e)},...t}}function d2e(e){const t=typeof e.owner=="string"?e.owner.trim():"",n=typeof e.status=="string"?e.status.trim():"",r=typeof e.since=="string"?e.since:"",s=typeof e.stateBucket=="string"?e.stateBucket:"active",i=Array.isArray(e.intervals)?e.intervals.map(o=>({startedAt:o.startedAt,completedAt:o.completedAt??""})):[];return JSON.stringify({owner:t,status:n,since:r,stateBucket:s,intervals:i})}function kd(e,t,n){return`${e}:${t}:${d2e(n)}`}function p2e(e){switch(e?.stateBucket){case"approved":case"review":case"completed":return e.stateBucket;default:return"active"}}function eF(e){return TSt(p2e(e))}function wre(e){return p2e(e)!=="active"?!0:e?.status==="in_progress"}class Rg{constructor(t){this.namespace=t}static level=3;debug(...t){Rg.level<=0&&console.debug(`[${this.namespace}]`,...t)}info(...t){Rg.level<=1&&console.log(`[${this.namespace}]`,...t)}warn(...t){Rg.level<=2&&console.warn(`[${this.namespace}]`,...t)}error(...t){Rg.level<=3&&console.error(`[${this.namespace}]`,...t)}static setLevel(t){Rg.level=t}static getLevel(){return Rg.level}}function to(e){return new Rg(e)}const wSt={},Nfe=e=>{let t;const n=new Set,r=(d,p)=>{const f=typeof d=="function"?d(t):d;if(!Object.is(f,t)){const h=t;t=p??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(m=>m(t,h))}},s=()=>t,c={setState:r,getState:s,getInitialState:()=>l,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(wSt?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},l=t=e(r,s,c);return c},kSt=e=>e?Nfe(e):Nfe;var f2e={exports:{}},h2e={},m2e={exports:{}},g2e={};/**
|
|
980
|
+
`).reduce((n,r)=>{const[s,i]=r.split(": ");return i&&(n[s.toLowerCase()]=i),n},{}):{}}const gyt=40;function Oyt(e,t=dyt("fetch")){let n=0,r=0;async function s(i){const o=i.body.length;n+=o,r++;const a={body:i.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{const c=await t(e.url,a);return{statusCode:c.status,headers:{"x-sentry-rate-limits":c.headers.get("X-Sentry-Rate-Limits"),"retry-after":c.headers.get("Retry-After")}}}catch(c){throw pyt("fetch"),c}finally{n-=o,r--}}return k_t(e,s,dre(e.bufferSize||gyt))}const Dc=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,_yt=30,byt=50;function HH(e,t,n,r){const s={filename:e,function:t==="<anonymous>"?jb:t,in_app:!0};return n!==void 0&&(s.lineno=n),r!==void 0&&(s.colno=r),s}const yyt=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,xyt=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Syt=/\((\S*)(?::(\d+))(?::(\d+))\)/,vyt=/at (.+?) ?\(data:(.+?),/,Tyt=e=>{const t=e.match(vyt);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=yyt.exec(e);if(n){const[,s,i,o]=n;return HH(s,jb,+i,+o)}const r=xyt.exec(e);if(r){if(r[2]?.indexOf("eval")===0){const a=Syt.exec(r[2]);a&&(r[2]=a[1],r[3]=a[2],r[4]=a[3])}const[i,o]=qQe(r[1]||jb,r[2]);return HH(o,i,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},Eyt=[_yt,Tyt],wyt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,kyt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Cyt=e=>{const t=wyt.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const i=kyt.exec(t[3]);i&&(t[1]=t[1]||"eval",t[3]=i[1],t[4]=i[2],t[5]="")}let r=t[3],s=t[1]||jb;return[s,r]=qQe(s,r),HH(r,s,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},Ryt=[byt,Cyt],Pyt=[Eyt,Ryt],$yt=hMe(...Pyt),qQe=(e,t)=>{const n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:jb,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},jA=1024,Nyt="Breadcrumbs",Ayt=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:Nyt,setup(n){t.console&&i0t(Dyt(n)),t.dom&&syt(Qyt(n,t.dom)),t.xhr&&VQe(Lyt(n)),t.fetch&&CQe(jyt(n)),t.history&&xre(Xyt(n)),t.sentry&&n.on("beforeSendEvent",Myt(n))}}},Iyt=Ayt;function Myt(e){return function(n){ss()===e&&WO({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:E0(n)},{event:n})}}function Qyt(e,t){return function(r){if(ss()!==e)return;let s,i,o=typeof t=="object"?t.serializeAttribute:void 0,a=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;a&&a>jA&&(Dc&&Mt.warn(`\`dom.maxStringLength\` cannot exceed ${jA}, but a value of ${a} was configured. Sentry will use ${jA} instead.`),a=jA),typeof o=="string"&&(o=[o]);try{const l=r.event,d=Uyt(l)?l.target:l;s=ga(d,{keyAttrs:o,maxStringLength:a}),i=xMe(d)}catch{s="<unknown>"}if(s.length===0)return;const c={category:`ui.${r.name}`,message:s};i&&(c.data={"ui.component_name":i}),WO(c,{event:r.event,name:r.name,global:r.global})}}function Dyt(e){return function(n){if(ss()!==e)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:a0t(n.level),message:Ppe(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${Ppe(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;WO(r,{input:n.args,level:n.level})}}function Lyt(e){return function(n){if(ss()!==e)return;const{startTimestamp:r,endTimestamp:s}=n,i=n.xhr[PS];if(!r||!s||!i)return;const{method:o,url:a,status_code:c,body:l}=i,d={method:o,url:a,status_code:c},p={xhr:n.xhr,input:l,startTimestamp:r,endTimestamp:s},f={category:"xhr",data:d,type:"http",level:kQe(c)};e.emit("beforeOutgoingRequestBreadcrumb",f,p),WO(f,p)}}function jyt(e){return function(n){if(ss()!==e)return;const{startTimestamp:r,endTimestamp:s}=n;if(s&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){const i={data:n.error,input:n.args,startTimestamp:r,endTimestamp:s},o={category:"fetch",data:n.fetchData,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",o,i),WO(o,i)}else{const i=n.response,o={...n.fetchData,status_code:i?.status},a={input:n.args,response:i,startTimestamp:r,endTimestamp:s},c={category:"fetch",data:o,type:"http",level:kQe(o.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",c,a),WO(c,a)}}}function Xyt(e){return function(n){if(ss()!==e)return;let r=n.from,s=n.to;const i=gb(pr.location.href);let o=r?gb(r):void 0;const a=gb(s);o?.path||(o=i),i.protocol===a.protocol&&i.host===a.host&&(s=a.relative),i.protocol===o.protocol&&i.host===o.host&&(r=o.relative),WO({category:"navigation",data:{from:r,to:s}})}}function Uyt(e){return!!e&&!!e.target}const zyt="EventTarget,Window,Node,ApplicationCache,AudioTrackList,BroadcastChannel,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(","),Byt="BrowserApiErrors",Fyt=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:Byt,setupOnce(){t.setTimeout&&Pc(pr,"setTimeout",vfe),t.setInterval&&Pc(pr,"setInterval",vfe),t.requestAnimationFrame&&Pc(pr,"requestAnimationFrame",Vyt),t.XMLHttpRequest&&"XMLHttpRequest"in pr&&Pc(XMLHttpRequest.prototype,"send",qyt);const n=t.eventTarget;n&&(Array.isArray(n)?n:zyt).forEach(s=>Wyt(s,t))}}},Yyt=Fyt;function vfe(e){return function(...t){const n=t[0];return t[0]=tT(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${mm(e)}`}}),e.apply(this,t)}}function Vyt(e){return function(t){return e.apply(this,[tT(t,{mechanism:{data:{handler:mm(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function qyt(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(s=>{s in n&&typeof n[s]=="function"&&Pc(n,s,function(i){const o={mechanism:{data:{handler:mm(i)},handled:!1,type:`auto.browser.browserapierrors.xhr.${s}`}},a=sre(i);return a&&(o.mechanism.data.handler=mm(a)),tT(i,o)})}),e.apply(this,t)}}function Wyt(e,t){const r=pr[e]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(Pc(r,"addEventListener",function(s){return function(i,o,a){try{Gyt(o)&&(o.handleEvent=tT(o.handleEvent,{mechanism:{data:{handler:mm(o),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&Hyt(this,i,o),s.apply(this,[i,tT(o,{mechanism:{data:{handler:mm(o),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),a])}}),Pc(r,"removeEventListener",function(s){return function(i,o,a){try{const c=o.__sentry_wrapped__;c&&s.call(this,i,c,a)}catch{}return s.call(this,i,o,a)}}))}function Gyt(e){return typeof e.handleEvent=="function"}function Hyt(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}const Zyt=(e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof pr.document>"u"){Dc&&Mt.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}efe({ignoreDuration:!0}),B4();const n=Df();let r=n.getUser();n.addScopeListener(s=>{const i=s.getUser();(r?.id!==i?.id||r?.ip_address!==i?.ip_address)&&(B4(),r=i)}),t==="route"&&xre(({from:s,to:i})=>{s!==i&&(efe({ignoreDuration:!0}),B4())})}}},Kyt="CultureContext",Jyt=()=>({name:Kyt,preprocessEvent(e){const t=Tfe();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})},processSegmentSpan(e){const t=Tfe();t&&oQe(e,{"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar})}}),ext=Jyt;function Tfe(){try{const e=pr.Intl;if(!e)return;const t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}const txt="GlobalHandlers",nxt=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:txt,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(sxt(n),Efe("onerror")),t.onunhandledrejection&&(ixt(n),Efe("onunhandledrejection"))}}},rxt=nxt;function sxt(e){gMe(t=>{const{stackParser:n,attachStacktrace:r}=WQe();if(ss()!==e||PQe())return;const{msg:s,url:i,line:o,column:a,error:c}=t,l=lxt(hre(n,c||s,void 0,r,!1),i,o,a);l.level="error",lQe(l,{originalException:c,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function ixt(e){OMe(t=>{const{stackParser:n,attachStacktrace:r}=WQe();if(ss()!==e||PQe())return;const s=oxt(t),i=Zv(s)?axt(s):hre(n,s,void 0,r,!0);i.level="error",lQe(i,{originalException:s,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function oxt(e){if(Zv(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}function axt(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function lxt(e,t,n,r){const s=e.exception=e.exception||{},i=s.values=s.values||[],o=i[0]=i[0]||{},a=o.stacktrace=o.stacktrace||{},c=a.frames=a.frames||[];return c.length===0&&c.push({colno:r,lineno:n,filename:cxt(t)??C$(),function:jb,in_app:!0}),e}function Efe(e){Dc&&Mt.log(`Global Handler attached: ${e}`)}function WQe(){return ss()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function cxt(e){if(!(!Gh(e)||e.length===0))return e.startsWith("data:")?`<${wO(e,!1)}>`:e}const uxt=()=>({name:"HttpContext",preprocessEvent(e){if(!pr.navigator&&!pr.location&&!pr.document)return;const t=KD(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}},processSegmentSpan(e){if(!pr.navigator&&!pr.location&&!pr.document)return;const t=KD();oQe(e,{"url.full":t.url||void 0,"http.request.header.user_agent":t.headers["User-Agent"],"http.request.header.referer":t.headers.Referer})}}),dxt="cause",pxt=5,fxt="LinkedErrors",hxt=(e={})=>{const t=e.limit||pxt,n=e.key||dxt;return{name:fxt,preprocessEvent(r,s,i){const o=i.getOptions();r0t(pre,o.stackParser,n,t,r,s)}}},mxt=hxt;function gxt(){return Oxt()?(Dc&&$y(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0):!1}function Oxt(){if(typeof pr.window>"u")return!1;const e=pr;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;const n=C$();return!(pr===pr.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}function _xt(e){return[G_t(),Y_t(),g0t(),Yyt(),Iyt(),rxt(),mxt(),u0t(),uxt(),ext(),Zyt()]}function bxt(e={}){const t=!e.skipBrowserExtensionCheck&&gxt();let n=e.defaultIntegrations==null?_xt():e.defaultIntegrations;const r={...e,enabled:t?!1:e.enabled,stackParser:Bmt(e.stackParser||$yt),integrations:l_t({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||Oyt};return D_t(F0t,r)}function yxt(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function GQe(e){try{return new URL(e,pr.location.origin).href}catch{return}}function xxt(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function HQe(e){try{return new Headers(e)}catch{return}}const wfe=new WeakMap,Z4=new Map,ZQe={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function Sxt(e,t){const{traceFetch:n,traceXHR:r,trackFetchStreamPerformance:s,shouldCreateSpanForRequest:i,enableHTTPTimings:o,tracePropagationTargets:a,onRequestSpanStart:c,onRequestSpanEnd:l}={...ZQe,...t},d=typeof i=="function"?i:m=>!0,p=m=>Txt(m,a),f={},h=e.getOptions().propagateTraceparent;n&&(e.addEventProcessor(m=>(m.type==="transaction"&&m.spans&&m.spans.forEach(g=>{if(g.op==="http.client"){const _=Z4.get(g.span_id);_&&(g.timestamp=_/1e3,Z4.delete(g.span_id))}}),m)),s&&k0t(m=>{if(m.response){const g=wfe.get(m.response);g&&m.endTimestamp&&Z4.set(g,m.endTimestamp)}}),CQe(m=>{const g=O0t(m,d,p,f,{propagateTraceparent:h,onRequestSpanEnd:l});if(m.response&&m.fetchData.__span&&wfe.set(m.response,m.fetchData.__span),g){const _=GQe(m.fetchData.url),b=_?gb(_).host:void 0;g.setAttributes({"http.url":_?wO(_):void 0,"server.address":b}),o&&kfe(g,e),c?.(g,{headers:m.headers})}})),r&&VQe(m=>{const g=Ext(m,d,p,f,h,l);g&&(o&&kfe(g,e),c?.(g,{headers:HQe(m.xhr.__sentry_xhr_v3__?.request_headers)}))})}const vxt=300;function kfe(e,t){const{url:n}=as(e).data;if(!n||typeof n!="string")return;let r=()=>void setTimeout(s);if(Tf(t)){const i=e.end.bind(e);e.end=o=>{const a=o??Oo();let c=!1;const l=()=>{c||(c=!0,setTimeout(s),i(a),clearTimeout(d))};r=l;const d=setTimeout(l,vxt)}}const s=RR("resource",({entries:i})=>{i.forEach(o=>{xxt(o)&&o.name.endsWith(n)&&(e.setAttributes(FQe(o)),r())})})}function Txt(e,t){const n=C$();if(n){let r,s;try{r=new URL(e,n),s=new URL(n).origin}catch{return!1}const i=r.origin===s;return t?Hh(r.toString(),t)||i&&Hh(r.pathname,t):i}else{const r=!!e.match(/^\/(?!\/)/);return t?Hh(e,t):r}}function Ext(e,t,n,r,s,i){const o=e.xhr,a=o?.[PS];if(!o||o.__sentry_own_request__||!a)return;const{url:c,method:l}=a,d=Bd()&&t(c);if(e.endTimestamp){const y=o.__sentry_xhr_span_id__;if(!y)return;const x=r[y];x&&(d&&a.status_code!==void 0&&(RMe(x,a.status_code),x.end(),i?.(x,{headers:HQe(myt(o)),error:e.error})),delete r[y]);return}const p=GQe(c),f=gb(p||c),h=wO(FOt(c)),m=ss(),_=!!Hc()||!!m&&Tf(m),b=d&&_?Iy({name:`${l} ${h}`,attributes:{url:wO(c),type:"xhr","http.method":l,"http.url":p?wO(p):void 0,"server.address":f?.host,[xo]:"auto.http.browser",[ep]:"http.client",...f?.search&&{"http.query":f?.search},...f?.hash&&{"http.fragment":f?.hash}}}):new ff;return d&&!_&&m?.recordDroppedEvent("no_parent_span","span"),o.__sentry_xhr_span_id__=b.spanContext().spanId,r[o.__sentry_xhr_span_id__]=b,n(c)&&wxt(o,Bd()&&_?b:void 0,s),m&&m.emit("beforeOutgoingRequestSpan",b,e),b}function wxt(e,t,n){const{"sentry-trace":r,baggage:s,traceparent:i}=vQe({span:t,propagateTraceparent:n});r&&kxt(e,r,s,i)}function kxt(e,t,n,r){const s=e.__sentry_xhr_v3__?.request_headers;if(!(s?.["sentry-trace"]||!e.setRequestHeader))try{if(e.setRequestHeader("sentry-trace",t),r&&!s?.traceparent&&e.setRequestHeader("traceparent",r),n){const i=s?.baggage;(!i||!yxt(i))&&e.setRequestHeader("baggage",n)}}catch{}}function Cxt(){pr.document?pr.document.addEventListener("visibilitychange",()=>{const e=Hc();if(!e)return;const t=Pa(e);if(pr.document.hidden&&t){const n="cancelled",{op:r,status:s}=as(t);Dc&&Mt.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),s||t.setStatus({code:$o,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):Dc&&Mt.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const Rxt=3600,KQe="sentry_previous_trace",Pxt="sentry.previous_trace";function $xt(e,{linkPreviousTrace:t,consistentTraceSampling:n}){const r=t==="session-storage";let s=r?Ixt():void 0;e.on("spanStart",o=>{if(Pa(o)!==o)return;const a=ws().getPropagationContext();s=Nxt(s,o,a),r&&Axt(s)});let i=!0;n&&e.on("beforeSampling",o=>{if(!s)return;const a=ws(),c=a.getPropagationContext();if(i&&c.parentSpanId){i=!1;return}a.setPropagationContext({...c,dsc:{...c.dsc,sample_rate:String(s.sampleRate),sampled:String(ZH(s.spanContext))},sampleRand:s.sampleRand}),o.parentSampled=ZH(s.spanContext),o.parentSampleRate=s.sampleRate,o.spanAttributes={...o.spanAttributes,[kMe]:s.sampleRate}})}function Nxt(e,t,n){const r=as(t);function s(){try{return Number(n.dsc?.sample_rate)??Number(r.data?.[ire])}catch{return 0}}const i={spanContext:t.spanContext(),startTimestamp:r.start_timestamp,sampleRate:s(),sampleRand:n.sampleRand};if(!e)return i;const o=e.spanContext;return o.traceId===r.trace_id?e:(Date.now()/1e3-e.startTimestamp<=Rxt&&(Dc&&Mt.log(`Adding previous_trace \`${JSON.stringify(o)}\` link to span \`${JSON.stringify({op:r.op,...t.spanContext()})}\``),t.addLink({context:o,attributes:{[Sgt]:"previous_trace"}}),t.setAttribute(Pxt,`${o.traceId}-${o.spanId}-${ZH(o)?1:0}`)),i)}function Axt(e){try{pr.sessionStorage.setItem(KQe,JSON.stringify(e))}catch(t){Dc&&Mt.warn("Could not store previous trace in sessionStorage",t)}}function Ixt(){try{const e=pr.sessionStorage?.getItem(KQe);return JSON.parse(e)}catch{return}}function ZH(e){return e.traceFlags===1}const Mxt="BrowserTracing",Qxt=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function Dxt(){const e=pr.navigator;return e?.userAgent?Qxt.test(e.userAgent):!1}const Lxt={...CQ,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...ZQe},jxt=(e={})=>{"enableElementTiming"in e&&$y(()=>{console.warn("[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.")});const t={name:void 0,source:void 0},n=pr.document,{enableInp:r,enableLongTask:s,enableLongAnimationFrame:i,_experiments:{enableInteractions:o,enableStandaloneClsSpans:a,enableStandaloneLcpSpans:c},beforeStartSpan:l,idleTimeout:d,finalTimeout:p,childSpanTimeout:f,markBackgroundSpan:h,traceFetch:m,traceXHR:g,trackFetchStreamPerformance:_,shouldCreateSpanForRequest:b,enableHTTPTimings:y,ignoreResourceSpans:x,ignorePerformanceApiSpans:S,instrumentPageLoad:v,instrumentNavigation:T,detectRedirects:E,linkPreviousTrace:w,consistentTraceSampling:P,enableReportPageLoaded:C,onRequestSpanStart:k,onRequestSpanEnd:I}={...Lxt,...e},Q=Dxt();let $,R,N;function j(M,U,A=!0){const F=U.op==="pageload",z=U.name,D=l?l(U):U,V=D.attributes||{};if(z!==D.name&&(V[jh]="custom",D.attributes=V),!A){const te=Ny();Iy({...D,startTime:te}).end(te);return}t.name=D.name,t.source=V[jh];const q=nQe(D,{idleTimeout:d,finalTimeout:p,childSpanTimeout:f,disableAutoFinish:F,beforeSpanEnd:te=>{$?.();const H=Tf(M);Ibt(te,{recordClsOnPageloadSpan:!H&&!a,recordLcpOnPageloadSpan:!H&&!c,ignoreResourceSpans:x,ignorePerformanceApiSpans:S,spanStreamingEnabled:H}),Pfe(M,void 0);const G=ws(),ie=G.getPropagationContext();G.setPropagationContext({...ie,traceId:q.spanContext().traceId,sampled:S_(q),dsc:qO(te)}),F&&(N=void 0)},trimIdleSpanEndTimestamp:!C});F&&C&&(N=q),Pfe(M,q);function ee(){n&&["interactive","complete"].includes(n.readyState)&&M.emit("idleSpanEnableAutoFinish",q)}F&&!C&&n&&(n.addEventListener("readystatechange",()=>{ee()}),ee())}return{name:Mxt,setup(M){if(Q){Dc&&Mt.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}Ggt();const U=Tf(M);if($=kbt({recordClsStandaloneSpans:U?void 0:a||!1,recordLcpStandaloneSpans:U?void 0:c||!1,client:M}),U?(Zbt(M),Jbt(M),r&&tyt()):r&&Vbt(),i&&Xr.PerformanceObserver&&PerformanceObserver.supportedEntryTypes?.includes("long-animation-frame")?Rbt():s&&Cbt(),o&&Pbt(),E&&n){const F=()=>{R=Oo()};addEventListener("click",F,{capture:!0}),addEventListener("keydown",F,{capture:!0,passive:!0})}function A(){const F=$R(M);F&&!as(F).timestamp&&(Dc&&Mt.log(`[Tracing] Finishing current active span with op: ${as(F).op}`),F.setAttribute(TR,"cancelled"),F.end())}M.on("startNavigationSpan",(F,z)=>{if(ss()!==M)return;if(z?.isRedirect){Dc&&Mt.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),j(M,{op:"navigation.redirect",...F},!1);return}R=void 0,A(),Df().setPropagationContext({traceId:Om(),sampleRand:Math.random(),propagationSpanId:Bd()?void 0:Zh()});const D=ws();D.setPropagationContext({traceId:Om(),sampleRand:Math.random(),propagationSpanId:Bd()?void 0:Zh()}),D.setSDKProcessingMetadata({normalizedRequest:void 0}),j(M,{op:"navigation",...F,parentSpan:null,forceTransaction:!0})}),M.on("startPageLoadSpan",(F,z={})=>{if(ss()!==M)return;A();const D=z.sentryTrace||Cfe("sentry-trace")||Rfe("sentry-trace"),V=z.baggage||Cfe("baggage")||Rfe("baggage"),q=Ugt(D,V),ee=ws();ee.setPropagationContext(q),Bd()||(ee.getPropagationContext().propagationSpanId=Zh()),ee.setSDKProcessingMetadata({normalizedRequest:KD()}),j(M,{op:"pageload",...F})}),M.on("endPageloadSpan",()=>{C&&N&&(N.setAttribute(TR,"reportPageLoaded"),N.end())})},afterAllSetup(M){if(Q)return;let U=C$();if(w!=="off"&&$xt(M,{linkPreviousTrace:w,consistentTraceSampling:P}),pr.location){if(v){const A=Ua();Xxt(M,{name:pr.location.pathname,startTime:A?A/1e3:void 0,attributes:{[jh]:"url",[xo]:"auto.pageload.browser"}})}T&&xre(({to:A,from:F})=>{if(F===void 0&&U?.indexOf(A)!==-1){U=void 0;return}U=void 0;const z=iQe(A),D=$R(M),V=D&&E&&Bxt(D,R);Uxt(M,{name:z?.pathname||pr.location.pathname,attributes:{[jh]:"url",[xo]:"auto.navigation.browser"}},{url:A,isRedirect:V})})}h&&Cxt(),o&&zxt(M,d,p,f,t),r&&Hbt(),Sxt(M,{traceFetch:m,traceXHR:g,trackFetchStreamPerformance:_,tracePropagationTargets:M.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:b,enableHTTPTimings:y,onRequestSpanStart:k,onRequestSpanEnd:I})}}};function Xxt(e,t,n){e.emit("startPageLoadSpan",t,n),ws().setTransactionName(t.name);const r=$R(e);return r&&e.emit("afterStartPageLoadSpan",r),r}function Uxt(e,t,n){const{url:r,isRedirect:s}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:s}),e.emit("startNavigationSpan",t,{isRedirect:s});const i=ws();return i.setTransactionName(t.name),r&&!s&&i.setSDKProcessingMetadata({normalizedRequest:{...KD(),url:r}}),$R(e)}function Cfe(e){return pr.document?.querySelector(`meta[name=${e}]`)?.getAttribute("content")||void 0}function Rfe(e){return pr.performance?.getEntriesByType?.("navigation")[0]?.serverTiming?.find(r=>r.name===e)?.description}function zxt(e,t,n,r,s){const i=pr.document;let o;const a=()=>{const c="ui.action.click",l=$R(e);if(l){const d=as(l).op;if(["navigation","pageload"].includes(d)){Dc&&Mt.warn(`[Tracing] Did not create ${c} span because a pageload or navigation span is in progress.`);return}}if(o&&(o.setAttribute(TR,"interactionInterrupted"),o.end(),o=void 0),!s.name){Dc&&Mt.warn(`[Tracing] Did not create ${c} transaction because _latestRouteName is missing.`);return}o=nQe({name:s.name,op:c,attributes:{[jh]:s.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})};i&&addEventListener("click",a,{capture:!0})}const JQe="_sentry_idleSpan";function $R(e){return e[JQe]}function Pfe(e,t){lc(e,JQe,t)}const $fe=1.5;function Bxt(e,t){const n=as(e),r=Ny(),s=n.start_timestamp;return!(r-s>$fe||t&&r-t<=$fe)}function Fxt(e){const t={...e};return SQe(t,"react"),e_t("react",{version:O.version}),bxt(t)}const Yxt="hermit@1.6.37",Vxt="production",qxt=.1;function Wxt(e){return e.length>0&&e.startsWith("https://")}let e2e=!0,NR=!1;function t2e(e){e2e=e}function Gxt(){if(NR)return;const e="";if(!Wxt(e))return;Fxt({...{dsn:e,release:Yxt,environment:Vxt,tracesSampleRate:qxt,sendDefaultPii:!1},beforeSend:r=>e2e?r:null,integrations:[jxt()]}),NR=!0}function Hxt(){return NR}function Zxt(e,t){NR&&WO({category:"navigation",message:`Tab: ${e} → ${t}`,level:"info"})}function Kxt(e,t){NR&&SU(n=>{t&&n.setContext("react",t),aQe(e)})}function RE(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function Jxt(e,t){let n;const r=()=>{if(n)return n;const s=indexedDB.open(e);return s.onupgradeneeded=()=>s.result.createObjectStore(t),n=RE(s),n.then(i=>{i.onclose=()=>n=void 0},()=>{}),n};return(s,i)=>r().then(o=>i(o.transaction(t,s).objectStore(t)))}let K4;function $U(){return K4||(K4=Jxt("keyval-store","keyval")),K4}function Fd(e,t=$U()){return t("readonly",n=>RE(n.get(e)))}function My(e,t,n=$U()){return n("readwrite",r=>(r.put(t,e),RE(r.transaction)))}function sl(e,t=$U()){return t("readwrite",n=>(n.delete(e),RE(n.transaction)))}function eSt(e,t){return e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},RE(e.transaction)}function n2e(e=$U()){return e("readonly",t=>{if(t.getAllKeys)return RE(t.getAllKeys());const n=[];return eSt(t,r=>n.push(r.key)).then(()=>n)})}const Sre="comment-read-state-v2",r2e="comment-read-state-v2",tSt="comment-read-state",nSt="comment-read-state",rSt=300,sSt=30*24*60*60*1e3;function iSt(){try{const e=localStorage.getItem(r2e);if(!e)return null;const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?null:t}catch{return null}}function s2e(e){try{localStorage.setItem(r2e,JSON.stringify(e))}catch{}}function oSt(){try{const e=localStorage.getItem(nSt);if(!e)return null;const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return null;const n=Object.entries(t);return n.length>0&&typeof n[0][1]=="number"?t:null}catch{return null}}function i2e(e){const t={};for(const[n,r]of Object.entries(e))typeof r=="number"&&r>0&&(t[n]={readIds:[],lastUpdated:r});return t}let ua={};const J4=iSt();if(J4&&Object.keys(J4).length>0)ua=J4;else{const e=oSt();e&&Object.keys(e).length>0&&(ua=i2e(e))}let KH=Object.keys(ua).length>0,nT=!0,XA=null;const JH=new Set;function o2e(e){return JH.add(e),KH||dSt(),()=>{JH.delete(e)}}function a2e(){return ua}function aSt(e,t,n){if(n.length===0)return;const r=`${e}/${t}`,s=ua[r],i=new Set(s?.readIds??[]);let o=!1;for(const a of n)i.has(a)||(i.add(a),o=!0);o&&(ua={...ua,[r]:{readIds:Array.from(i),lastUpdated:Date.now()}},sL(),uSt())}function l2e(e,t,n,r){if(!r||r.length===0)return 0;const s=`${t}/${n}`,i=e[s];if(!i)return r.length;const o=new Set(i.readIds),a=o.size===0?i.lastUpdated:0;let c=0;for(const l of r)l.id&&o.has(l.id)||a>0&&new Date(l.createdAt).getTime()<=a||c++;return c}function lSt(e,t){const n=`${e}/${t}`,r=ua[n];return new Set(r?.readIds??[])}function cSt(e,t){const n=`${e}/${t}`,r=ua[n];return!r||r.readIds.length>0?0:r.lastUpdated}function vre(){return typeof indexedDB<"u"}function sL(){JH.forEach(e=>e())}function uSt(){XA&&clearTimeout(XA),XA=setTimeout(()=>{XA=null,pSt()},rSt)}async function dSt(){if(!KH){if(vre()&&nT)try{const e=await Fd(Sre);if(e&&typeof e=="object"){const t={...ua};for(const[n,r]of Object.entries(e)){if(!r||typeof r!="object")continue;const s=r,i=t[n];if(!i)t[n]=s;else{const o=new Set([...i.readIds,...s.readIds]);t[n]={readIds:Array.from(o),lastUpdated:Math.max(i.lastUpdated,s.lastUpdated)}}}ua=t,sL()}else{const t=await Fd(tSt);if(t&&typeof t=="object"){const n=i2e(t),r={...ua};for(const[s,i]of Object.entries(n))r[s]?r[s]={readIds:[...new Set([...r[s].readIds,...i.readIds])],lastUpdated:Math.max(r[s].lastUpdated,i.lastUpdated)}:r[s]=i;ua=r,sL()}}}catch{nT=!1}KH=!0}}async function pSt(){if(s2e(ua),nT&&vre())try{await My(Sre,ua)}catch{nT=!1}}async function fSt(){const e=Date.now();let t=!1;const n={};for(const[r,s]of Object.entries(ua))e-s.lastUpdated<sSt?n[r]=s:t=!0;if(t&&(ua=n,sL(),s2e(n),nT&&vre()))try{await My(Sre,n)}catch{nT=!1}}function dr(e){let t=e.replace(/\\/g,"/");if(t!=="/"&&!/^[A-Za-z]:\/$/.test(t))for(;t.endsWith("/");)t=t.slice(0,-1);return t.toLowerCase()}function Tre(e,t){return t==="pending"?{...e,pending:e.pending+1}:t==="in_progress"?{...e,inProgress:e.inProgress+1}:t==="completed"?{...e,completed:e.completed+1}:e}function hSt(e){const t=new Map;for(const n of e){if(!n.projectPath)continue;const r=dr(n.projectPath),s=t.get(r)??{pending:0,inProgress:0,completed:0};t.set(r,Tre(s,n.status))}return t}function mSt(e){const t=new Map;for(const n of e){const r=n.teamName,s=t.get(r)??{pending:0,inProgress:0,completed:0};t.set(r,Tre(s,n.status))}return t}function gSt(e){const t=new Map;for(const n of e){const r=n.owner?.trim();if(!r||n.status==="deleted")continue;const s=r.toLowerCase(),i=t.get(s)??{pending:0,inProgress:0,completed:0};t.set(s,Tre(i,n.status))}return t}function HO({multimodelEnabled:e,bootstrapCliStatus:t,fetchCliStatus:n}){return e?t({multimodelEnabled:!0}):n()}const OSt=2*60*1e3;function _St(e){if(!e)return;const t=[];if(typeof e.createdAt=="string"&&e.createdAt.length>0&&t.push(e.createdAt),Array.isArray(e.workIntervals))for(const o of e.workIntervals)typeof o?.startedAt=="string"&&o.startedAt.length>0&&t.push(o.startedAt);if(Array.isArray(e.historyEvents))for(const o of e.historyEvents)typeof o?.timestamp=="string"&&o.timestamp.length>0&&t.push(o.timestamp);if(t.length===0)return;const[n,...r]=t,s=r.reduce((o,a)=>o<a?o:a,n),i=new Date(s);return i.setTime(i.getTime()-OSt),i.toISOString()}function bSt(e){return Array.isArray(e.historyEvents)?e.historyEvents:[]}function ySt(e){const t=bSt(e);for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.type==="review_requested"||r.type==="review_changes_requested"||r.type==="review_approved"||r.type==="review_started")return r.to;if(r.type==="status_changed"&&(r.to==="in_progress"||r.to==="deleted"))return"none";if(r.type==="status_changed"&&r.to==="pending"){for(let s=n-1;s>=0;s--){const i=t[s];if(i.type==="review_requested"||i.type==="review_changes_requested"||i.type==="review_approved"||i.type==="review_started")return i.to==="needsFix"?"needsFix":"none";if(i.type==="task_created"||i.type==="status_changed"&&(i.to==="in_progress"||i.to==="pending"||i.to==="deleted"))return"none"}return"none"}}return null}function xSt(e){return e==="review"||e==="needsFix"||e==="approved"?e:"none"}function c2e(e){if(Array.isArray(e.historyEvents)&&e.historyEvents.length>0){const s=ySt({historyEvents:e.historyEvents});if(s)return s}const t=typeof e.status=="string"?e.status:null,n=s=>{const i=xSt(s);return i==="none"?null:t==="in_progress"||t==="deleted"?"none":t==="pending"?i==="needsFix"?"needsFix":"none":t==="completed"?i==="review"||i==="approved"?i:"none":i},r=n(e.reviewState);return r||(e.kanbanColumn==="review"||e.kanbanColumn==="approved"?n(e.kanbanColumn)??"none":"none")}function SSt(e){return e==="review"||e==="approved"?e:void 0}function Xb(e){return SSt(c2e(e))}function vSt(e){return c2e(e)}function Ere(e){const t=vSt(e);return t==="approved"?"approved":t==="review"?"review":e.status==="completed"?"completed":"active"}function TSt(e){const t=typeof e=="string"?e:Ere(e);return t==="completed"||t==="approved"}function ESt(e){return typeof e=="string"?e!=="active":Ere(e)!=="active"?!0:e.status==="in_progress"}function u2e(e){return _St(e)}function Yc(e,t){return{...{owner:e.owner,status:e.status,intervals:e.workIntervals,since:u2e(e),stateBucket:Ere(e)},...t}}function d2e(e){const t=typeof e.owner=="string"?e.owner.trim():"",n=typeof e.status=="string"?e.status.trim():"",r=typeof e.since=="string"?e.since:"",s=typeof e.stateBucket=="string"?e.stateBucket:"active",i=Array.isArray(e.intervals)?e.intervals.map(o=>({startedAt:o.startedAt,completedAt:o.completedAt??""})):[];return JSON.stringify({owner:t,status:n,since:r,stateBucket:s,intervals:i})}function kd(e,t,n){return`${e}:${t}:${d2e(n)}`}function p2e(e){switch(e?.stateBucket){case"approved":case"review":case"completed":return e.stateBucket;default:return"active"}}function eF(e){return TSt(p2e(e))}function wre(e){return p2e(e)!=="active"?!0:e?.status==="in_progress"}class Rg{constructor(t){this.namespace=t}static level=3;debug(...t){Rg.level<=0&&console.debug(`[${this.namespace}]`,...t)}info(...t){Rg.level<=1&&console.log(`[${this.namespace}]`,...t)}warn(...t){Rg.level<=2&&console.warn(`[${this.namespace}]`,...t)}error(...t){Rg.level<=3&&console.error(`[${this.namespace}]`,...t)}static setLevel(t){Rg.level=t}static getLevel(){return Rg.level}}function to(e){return new Rg(e)}const wSt={},Nfe=e=>{let t;const n=new Set,r=(d,p)=>{const f=typeof d=="function"?d(t):d;if(!Object.is(f,t)){const h=t;t=p??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(m=>m(t,h))}},s=()=>t,c={setState:r,getState:s,getInitialState:()=>l,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(wSt?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},l=t=e(r,s,c);return c},kSt=e=>e?Nfe(e):Nfe;var f2e={exports:{}},h2e={},m2e={exports:{}},g2e={};/**
|
|
981
981
|
* @license React
|
|
982
982
|
* use-sync-external-store-shim.production.js
|
|
983
983
|
*
|
|
@@ -1049,11 +1049,11 @@ Error:`,s)}}function pbt(){return J0t(e=>{j$("cls",{metric:e}),DQe=e},{reportAll
|
|
|
1049
1049
|
`;)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(Fn.contextHash)==t}takeNodes(t){let n=this.cursor,r=this.fragment.offset,s=this.fragmentEnd-(this.fragment.openEnd?1:0),i=t.absoluteLineStart,o=i,a=t.block.children.length,c=o,l=a;for(;;){if(n.to-r>s){if(n.type.isAnonymous&&n.firstChild())continue;break}let d=J5e(n.from-r,t.ranges);if(n.to-r<=t.ranges[t.rangeI].to)t.addNode(n.tree,d);else{let p=new yr(t.parser.nodeSet.types[Nt.Paragraph],[],[],0,t.block.hashProp);t.reusePlaceholders.set(p,n.tree),t.addNode(p,d)}if(n.type.is("Block")&&(h$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 J5e(e,t){let n=e;for(let r=1;r<t.length;r++){let s=t[r-1].to,i=t[r].from;s<e&&(n-=i-s)}return n}const g$t=Eo({"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 az(new PE(Y5e).extend(g$t),Object.keys(pI).map(e=>pI[e]),Object.keys(pI).map(e=>B5e[e]),Object.keys(pI),u$t,I5e,Object.keys(VF).map(e=>VF[e]),Object.keys(VF),[]);function _$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 b$t(e){let{codeParser:t,htmlParser:n}=e;return{wrap:BU((s,i)=>{let o=s.type.id;if(t&&(o==Nt.CodeBlock||o==Nt.FencedCode)){let a="";if(o==Nt.FencedCode){let l=s.node.getChild(Nt.CodeInfo);l&&(a=i.read(l.from,l.to))}let c=t(a);if(c)return{parser:c,overlay:l=>l.type.id==Nt.CodeText,bracketed:o==Nt.FencedCode}}else if(n&&(o==Nt.HTMLBlock||o==Nt.HTMLTag||o==Nt.CommentBlock))return{parser:n,overlay:_$t(s.node,s.from,s.to)};return null})}}const y$t={resolve:"Strikethrough",mark:"StrikethroughMark"},x$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=tP.test(r),c=tP.test(s);return e.addDelimiter(y$t,n,n+2,!o&&(!c||i||a),!i&&(!a||o||c))},after:"Emphasis"}]};function sC(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 ege(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 eje=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class tge{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)&&eje.test(s=n.text.slice(n.pos))){let i=[];sC(t,r.content,0,i,r.start)==sC(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=[];sC(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 S$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 ege(t.content,0)?new tge:null},endLeaf(e,t,n){if(n.parsers.some(s=>s instanceof tge)||!ege(t.text,t.basePos))return!1;let r=e.peekLine();return eje.test(r)&&sC(e,t.text,t.basePos)==sC(e,r,t.basePos)},before:"SetextHeading"}]};class v$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 T$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 v$t:null},after:"SetextHeading"}]},nge=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,rge=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,E$t=/[\w-]+\.[\w-]+($|\/)/,sge=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,ige=/\/[a-zA-Z\d@.]+/gy;function oge(e,t,n,r){let s=0;for(let i=t;i<n;i++)e[i]==r&&s++;return s}function w$t(e,t){rge.lastIndex=t;let n=rge.exec(e);if(!n||E$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==")"&&oge(e,t,r,")")>oge(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 age(e,t){sge.lastIndex=t;let n=sge.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 k$t={parseInline:[{name:"Autolink",parse(e,t,n){let r=n-e.offset;if(r&&/\w/.test(e.text[r-1]))return-1;nge.lastIndex=r;let s=nge.exec(e.text),i=-1;if(!s)return-1;if(s[1]||s[2]){if(i=w$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=age(e.text,r):(i=age(e.text,r+s[0].length),i>-1&&s[0]=="xmpp:"&&(ige.lastIndex=i,s=ige.exec(e.text),s&&(i=s.index+s[0].length)));return i<0?-1:(e.addElement(e.elt("URL",n,i+e.offset)),i+e.offset)}}]},C$t=[S$t,T$t,x$t,k$t];function tje(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)),sd(c))break}return-1}}const R$t={defineNodes:[{name:"Superscript",style:X.special(X.content)},{name:"SuperscriptMark",style:X.processingInstruction}],parseInline:[{name:"Superscript",parse:tje(94,"Superscript","SuperscriptMark")}]},P$t={defineNodes:[{name:"Subscript",style:X.special(X.content)},{name:"SubscriptMark",style:X.processingInstruction}],parseInline:[{name:"Subscript",parse:tje(126,"Subscript","SubscriptMark")}]},$$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))}}]},nje=KU({commentTokens:{block:{open:"<!--",close:"-->"}}}),rje=new Fn,sje=O$t.configure({props:[ko.add(e=>!e.is("Block")||e.is("Document")||tZ(e)!=null||N$t(e)?void 0:(t,n)=>({from:n.doc.lineAt(t.from).to,to:t.to})),rje.add(tZ),wo.add({Document:()=>null}),nO.add({Document:nje})]});function tZ(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function N$t(e){return e.name=="OrderedList"||e.name=="BulletList"}function A$t(e,t){let n=e;for(;;){let r=n.nextSibling,s;if(!r||(s=tZ(r.type))!=null&&s<=t)break;n=r}return n.to}const I$t=gLe.of((e,t,n)=>{for(let r=is(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let s=r.type.prop(rje);if(s==null)continue;let i=A$t(r,s);if(i>n)return{from:n,to:i}}return null});function yse(e){return new $c(nje,e,[],"markdown")}const ije=yse(sje),M$t=sje.configure([C$t,P$t,R$t,$$t,{props:[ko.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),nP=yse(M$t);function Q$t(e,t){return n=>{if(n&&e){let r=null;if(n=/\S*/.exec(n)[0],typeof e=="function"?r=e(n):r=Ye.matchLanguageName(e,n,!0),r instanceof Ye)return r.support?r.support.language.parser:xL.getSkippingParser(r.load());if(r)return r.parser}return t?t.parser:null}}let qF=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(+aje(this.item,t)[2]+n):"";return this.spaceBefore+r+this.type+this.spaceAfter}};function oje(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 qF(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 qF(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 qF(i.parent,c,c+d,o[1],l,p,i))}}return r}function aje(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function WF(e,t,n,r=0){for(let s=-1,i=e;;){if(i.name=="ListItem"){let a=aje(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(V$)!=" ")return e;let r=bm(e,4,n),s="";for(let i=r;i>0;)i>=4?(s+=" ",i-=4):(s+=" ",i--);return s+e.slice(n)}const lje=(e={})=>({state:t,dispatch:n})=>{let r=is(t),{doc:s}=t,i=null,o=t.changeByRange(a=>{if(!a.empty||!nP.isActiveAt(t,a.from,-1)&&!nP.isActiveAt(t,a.from,1))return i={range:a};let c=a.from,l=s.lineAt(c),d=oje(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"&&WF(p.item,s,T,-2),x&&x.node.name=="OrderedList"&&WF(x.item,s,T),{range:pt.cursor(S+v.length),changes:T}}else{let x=cge(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"&&WF(p.item,s,h);let m=p.item&&p.item.from<l.from,g="";if(!m||/^[\s\d.)\-+*>]*/.exec(l.text)[0].length>=p.to)for(let b=0,y=d.length-1;b<=y;b++)g+=b==y&&!m?d[b].marker(s,1):d[b].blank(b<y?bm(l.text,4,d[b+1].from)-g.length:null);let _=c;for(;_>l.from&&/\s/.test(l.text.charAt(_-l.from-1));)_--;return g=xse(g,t),D$t(p.node,t.doc)&&(g=cge(d,t,l)+t.lineBreak+g),h.push({from:_,to:c,insert:t.lineBreak+g}),{range:pt.cursor(_+g.length+1),changes:h}});return i?!1:(n(t.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)},cje=lje();function lge(e){return e.name=="QuoteMark"||e.name=="ListMark"}function D$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 cge(e,t,n){let r="";for(let s=0,i=e.length-2;s<=i;s++)r+=e[s].blank(s<i?bm(n.text,4,e[s+1].from)-r.length:null,s<i);return xse(r,t)}function L$t(e,t){let n=e.resolveInner(t,-1),r=t;lge(n)&&(r=n.from,n=n.parent);for(let s;s=n.childBefore(r);)if(lge(s))r=s.from;else if(s.name=="OrderedList"||s.name=="BulletList")n=s.lastChild,r=n.to;else break;return n}const uje=({state:e,dispatch:t})=>{let n=is(e),r=null,s=e.changeByRange(i=>{let o=i.from,{doc:a}=e;if(i.empty&&nP.isActiveAt(e,i.from)){let c=a.lineAt(o),l=oje(L$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(bm(c.text,4,d.to)-bm(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)},dje=[{key:"Enter",run:cje},{key:"Backspace",run:uje}],pje=oz({matchClosingTags:!1});function fje(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:s}=ije,completeHTMLTags:i=!0,pasteURLAsLink:o=!0,htmlTagLanguage:a=pje}=e;if(!(s instanceof az))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],l=[a.support,I$t],d;o&&l.push(hje),n instanceof Ki?(l.push(n.support),d=n.language):n&&(d=n);let p=t||d?Q$t(t,d):void 0;c.push(b$t({codeParser:p,htmlParser:a.language.parser})),r&&l.push($E.high(HU.of(dje)));let f=yse(s.configure(c));return i&&l.push(f.data.of({autocomplete:j$t})),new Ki(f,l)}function j$t(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let s=is(t).resolveInner(n,-1);for(;s&&!s.type.isTop;){if(s.name=="CodeBlock"||s.name=="FencedCode"||s.name=="ProcessingInstructionBlock"||s.name=="CommentBlock"||s.name=="Link"||s.name=="Image")return null;s=s.parent}return{from:n-r[0].length,to:n,options:X$t(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let GF=null;function X$t(){if(GF)return GF;let e=x5e(new FCt(ii.create({extensions:pje}),0,!0));return GF=e?e.options:[]}const U$t=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,hje=Gt.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),!nP.isActiveAt(t.state,r.from,1)))return!1;let i=is(t.state),o=!1;return i.iterate({from:r.from,to:r.to,enter:a=>{(a.from>r.from||U$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)}}),z$t=Object.freeze(Object.defineProperty({__proto__:null,commonmarkLanguage:ije,deleteMarkupBackward:uje,insertNewlineContinueMarkup:cje,insertNewlineContinueMarkupCommand:lje,markdown:fje,markdownKeymap:dje,markdownLanguage:nP,pasteURLAsLink:hje},Symbol.toStringTag,{value:"Module"})),B$t=1,F$t=2,Y$t=275,V$t=3,q$t=276,uge=277,W$t=278,G$t=4,H$t=5,Z$t=6,K$t=7,dge=8,J$t=9,eNt=10,tNt=11,nNt=12,rNt=13,sNt=14,iNt=15,oNt=16,aNt=17,lNt=18,cNt=19,uNt=20,dNt=21,pNt=22,fNt=23,hNt=24,mNt=25,gNt=26,ONt=27,_Nt=28,bNt=29,yNt=30,xNt=31,SNt=32,vNt=33,TNt=34,ENt=35,wNt=36,kNt=37,CNt=38,RNt=39,PNt=40,$Nt=41,NNt=42,ANt=43,INt=44,MNt=45,QNt=46,DNt=47,LNt=48,jNt=49,XNt=50,UNt=51,zNt=52,BNt=53,FNt=54,YNt=55,VNt=56,qNt=57,WNt=58,GNt=59,HNt=60,ZNt=61,KNt=62,HF=63,JNt=64,eAt=65,tAt=66,nAt={abstract:G$t,and:H$t,array:Z$t,as:K$t,true:dge,false:dge,break:J$t,case:eNt,catch:tNt,clone:nNt,const:rNt,continue:sNt,declare:oNt,default:iNt,do:aNt,echo:lNt,else:cNt,elseif:uNt,enddeclare:dNt,endfor:pNt,endforeach:fNt,endif:hNt,endswitch:mNt,endwhile:gNt,enum:ONt,extends:_Nt,final:bNt,finally:yNt,fn:xNt,for:SNt,foreach:vNt,from:TNt,function:ENt,global:wNt,goto:kNt,if:CNt,implements:RNt,include:PNt,include_once:$Nt,instanceof:NNt,insteadof:ANt,interface:INt,list:MNt,match:QNt,namespace:DNt,new:LNt,null:jNt,or:XNt,print:UNt,readonly:zNt,require:BNt,require_once:FNt,return:YNt,switch:VNt,throw:qNt,trait:WNt,try:GNt,unset:HNt,use:ZNt,var:KNt,public:HF,private:HF,protected:HF,while:JNt,xor:eAt,yield:tAt,__proto__:null};function pge(e){let t=nAt[e.toLowerCase()];return t??-1}function fge(e){return e==9||e==10||e==13||e==32}function mje(e){return e>=97&&e<=122||e>=65&&e<=90}function iC(e){return e==95||e>=128||mje(e)}function ZF(e){return e>=48&&e<=55||e>=97&&e<=102||e>=65&&e<=70}const rAt={int:!0,integer:!0,bool:!0,boolean:!0,float:!0,double:!0,real:!0,string:!0,array:!0,object:!0,unset:!0,__proto__:null},sAt=new Wn(e=>{if(e.next==40){e.advance();let t=0;for(;fge(e.peek(t));)t++;let n="",r;for(;mje(r=e.peek(t));)n+=String.fromCharCode(r),t++;for(;fge(e.peek(t));)t++;e.peek(t)==41&&rAt[n.toLowerCase()]&&e.acceptToken(B$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(),!iC(e.next))return;let n=String.fromCharCode(e.next);for(;e.advance(),!(!iC(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(F$t)}}}}),iAt=new Wn(e=>{e.next<0&&e.acceptToken(W$t)}),oAt=new Wn((e,t)=>{e.next==63&&t.canShift(uge)&&e.peek(1)==62&&e.acceptToken(uge)});function aAt(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&&ZF(e.peek(2)))return ZF(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(!ZF(r))break}return 0}const lAt=new Wn((e,t)=>{let n=!1;for(;!(e.next==34||e.next<0||e.next==36&&(iC(e.peek(1))||e.peek(1)==123)||e.next==123&&e.peek(1)==36);n=!0){if(e.next==92){let r=aAt(e);if(r){if(n)break;return e.acceptToken(V$t,r)}}else if(!n&&(e.next==91||e.next==45&&e.peek(1)==62&&iC(e.peek(2))||e.next==63&&e.peek(1)==45&&e.peek(2)==62&&iC(e.peek(3)))&&t.canShift(q$t))break;e.advance()}n&&e.acceptToken(Y$t)}),cAt=Eo({"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}),uAt={__proto__:null,static:325,STATIC:325,class:351,CLASS:351},dAt=So.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'#E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q$R$T$z%O%Q%S%T%U%V%d%}&S&W&[&q&t&u&x'P']'a(R(V(h(t)T)X)n)u)y){*V*Z*[*|+^,Q,T,Y,c,e,g,m-`-a-t-z.[.u.w/P/X/y0O0T0e0s0}1O1R1S1W1k1o1{2W2]2r3p3u3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4X4Y4Z4[4_4`4a4b4c4k5O5R5S5V5Z5[5_5a5b5d5e5f5g5h5i5j5k5l5m5n5o5p5q5r5u5{5|5}6O6P6Q6R6S6T6U6V6W6X6Y6Z6[6]6^6_6`6a6b6c6d6l7P7S7T7W7[7]7`7b7c7o7x7y7z7{7|7}8O8P8Q8R8S8T8U8V8W8X8Y8Z8[8]8^8_8`8a8b8d8e8f8g8h8s9T9W9Z9^9_9a9c9f9h9o9p9s9u9v:Q:R:S:T:U:V:W:X:Y:Z:[:]:^:_:`:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:q:r:s:u:v:w;S;e;i;j;k;n;u;v;z;|;}<P<Q<R<S<T<U<V<W<X<Y<Z<[<]<^<_<`<a<b<c<d<e<f<g<h<i<j<k<l<m<n<o<p<q<r<s<t<u<v<w<x<y<z<{<|=O=P=Q=R=S=T=U=a=b>V>W>[>]>^>c>h>i>l>n>o>p>q>v?^?_T$x{$|Q(q%QQ(v%TQ(y%VR2b1WQ%c!]Q(u%SQ,d(tQ/W,cQ/Y,eQ1Q/XR2_1RQ%q!fR)m%rR/p-O",nodeNames:"⚠ ( HeredocString EscapeSequence abstract LogicOp array as Boolean break case catch clone const continue default declare do echo else elseif enddeclare endfor endforeach endif endswitch endwhile enum extends final finally fn for foreach from function global goto if implements include include_once LogicOp insteadof interface list match namespace new null LogicOp print readonly require require_once return switch throw trait try unset use var Visibility while LogicOp yield LineComment BlockComment TextInterpolation PhpClose Text PhpOpen Template TextInterpolation EmptyStatement ; } { Block : LabelStatement Name ExpressionStatement ConditionalExpression LogicOp MatchExpression ) ( ParenthesizedExpression MatchBlock MatchArm , => AssignmentExpression ArrayExpression ValueList & VariadicUnpacking ... Pair [ ] ListExpression ValueList Pair Pair SubscriptExpression MemberExpression -> ?-> Name VariableName DynamicVariable $ ${ CallExpression ArgList NamedArgument SpreadArgument CastExpression UnionType LogicOp IntersectionType OptionalType NamedType QualifiedName \\ NamespaceName Name NamespaceName Name ScopedExpression :: ClassMemberName DynamicMemberName AssignOp UpdateExpression UpdateOp YieldExpression BinaryExpression LogicOp LogicOp LogicOp BitOp BitOp BitOp CompareOp CompareOp BitOp ArithOp ConcatOp ArithOp ArithOp IncludeExpression RequireExpression CloneExpression UnaryExpression ControlOp LogicOp PrintIntrinsic FunctionExpression static ParamList Parameter #[ Attributes Attribute VariadicParameter PropertyParameter PropertyHooks PropertyHook UseList ArrowFunction NewExpression class BaseClause ClassInterfaceClause DeclarationList ConstDeclaration VariableDeclarator PropertyDeclaration VariableDeclarator MethodDeclaration UseDeclaration UseList UseInsteadOfClause UseAsClause UpdateExpression ArithOp ShellExpression ThrowExpression Integer Float String MemberExpression SubscriptExpression UnaryExpression ArithOp Interpolation String IfStatement ColonBlock SwitchStatement Block CaseStatement DefaultStatement ColonBlock WhileStatement EmptyStatement DoStatement ForStatement ForSpec SequenceExpression ForeachStatement ForSpec Pair GotoStatement ContinueStatement BreakStatement ReturnStatement TryStatement CatchDeclarator DeclareStatement EchoStatement UnsetStatement ConstDeclaration FunctionDefinition ClassDeclaration InterfaceDeclaration TraitDeclaration EnumDeclaration EnumBody EnumCase NamespaceDefinition NamespaceUseDeclaration UseGroup UseClause UseClause GlobalDeclaration FunctionStaticDeclaration Program",maxTerm:318,nodeProps:[["group",-36,2,8,49,82,84,86,89,94,95,103,107,108,112,113,116,120,126,132,137,139,140,154,155,156,157,160,161,173,174,188,190,191,192,193,194,200,"Expression",-28,75,79,81,83,201,203,208,210,211,214,217,218,219,220,221,223,224,225,226,227,228,229,230,231,234,235,239,240,"Statement",-4,121,123,124,125,"Type"],["isolate",-4,67,68,71,200,""],["openedBy",70,"phpOpen",77,"{",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O!=yR!BgWO#O!?]#O#P!?u#P#S!?]#S#T!@n#T;'S!?];'S;=`!@s;=`<%l!=y<%lO!?]R!CWV%UQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!CpP;=`<%l!=y_!CzV!p^'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$z_!DjY$UQ#n['TPOY$zYZ%fZ!^$z!^!_%k!_!`6U!`#p$z#p#q!EY#q;'S$z;'S;=`&W<%lO$zR!EaV$SQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!E}V!oQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!FkV$eQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$z",tokenizers:[sAt,lAt,oAt,0,1,2,3,iAt],topRules:{Template:[0,73],Program:[1,241]},dynamicPrecedences:{298:1},specialized:[{term:284,get:(e,t)=>pge(e)<<1,external:pge},{term:284,get:e=>uAt[e]||-1}],tokenPrec:29889}),gje=vo.define({name:"php",parser:dAt.configure({props:[wo.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":gf({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"String BlockComment":()=>null,Statement:Ei({except:/^({|end(for|foreach|switch|while)\b)/})}),ko.add({"Block EnumBody DeclarationList SwitchBody ArrayExpression ValueList":rd,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 Oje(e={}){let t=[],n;if(e.baseLanguage!==null)if(e.baseLanguage)n=e.baseLanguage;else{let r=oz({matchClosingTags:!1});t.push(r.support),n=r.language}return new Ki(gje.configure({wrap:n&&BU(r=>r.type.isTop?{parser:n.parser,overlay:s=>s.name=="Text"}:null),top:e.plain?"Program":"Template"}),t)}const pAt=Object.freeze(Object.defineProperty({__proto__:null,php:Oje,phpLanguage:gje},Symbol.toStringTag,{value:"Module"})),fAt=1,_je=194,bje=195,hAt=196,hge=197,mAt=198,gAt=199,OAt=200,_At=2,yje=3,mge=201,bAt=24,yAt=25,xAt=49,SAt=50,vAt=55,TAt=56,EAt=57,wAt=59,kAt=60,CAt=61,RAt=62,PAt=63,$At=65,NAt=238,AAt=71,IAt=241,MAt=242,QAt=243,DAt=244,LAt=245,jAt=246,XAt=247,UAt=248,xje=72,zAt=249,BAt=250,FAt=251,YAt=252,VAt=253,qAt=254,WAt=255,GAt=256,HAt=73,ZAt=77,KAt=263,JAt=112,eIt=130,tIt=151,nIt=152,rIt=155,Vb=10,rP=13,Sse=32,lz=9,vse=35,sIt=40,iIt=46,nZ=123,gge=125,Sje=39,vje=34,Oge=92,oIt=111,aIt=120,lIt=78,cIt=117,uIt=85,dIt=new Set([yAt,xAt,SAt,KAt,$At,eIt,TAt,EAt,NAt,RAt,PAt,xje,HAt,ZAt,kAt,CAt,tIt,nIt,rIt,JAt]);function KF(e){return e==Vb||e==rP}function JF(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}const pIt=new Wn((e,t)=>{let n;if(e.next<0)e.acceptToken(gAt);else if(t.context.flags&YQ)KF(e.next)&&e.acceptToken(mAt,1);else if(((n=e.peek(-1))<0||KF(n))&&t.canShift(hge)){let r=0;for(;e.next==Sse||e.next==lz;)e.advance(),r++;(e.next==Vb||e.next==rP||e.next==vse)&&e.acceptToken(hge,-r)}else KF(e.next)&&e.acceptToken(hAt,1)},{contextual:!0}),fIt=new Wn((e,t)=>{let n=t.context;if(n.flags)return;let r=e.peek(-1);if(r==Vb||r==rP){let s=0,i=0;for(;;){if(e.next==Sse)s++;else if(e.next==lz)s+=8-s%8;else break;e.advance(),i++}s!=n.indent&&e.next!=Vb&&e.next!=rP&&e.next!=vse&&(s<n.indent?e.acceptToken(bje,-i):e.acceptToken(_je))}}),YQ=1,Tje=2,uh=4,dh=8,ph=16,fh=32;function VQ(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 hIt=new VQ(null,0,0);function mIt(e){let t=0;for(let n=0;n<e.length;n++)t+=e.charCodeAt(n)==lz?8-t%8:1;return t}const _ge=new Map([[IAt,0],[MAt,uh],[QAt,dh],[DAt,dh|uh],[LAt,ph],[jAt,ph|uh],[XAt,ph|dh],[UAt,ph|dh|uh],[zAt,fh],[BAt,fh|uh],[FAt,fh|dh],[YAt,fh|dh|uh],[VAt,fh|ph],[qAt,fh|ph|uh],[WAt,fh|ph|dh],[GAt,fh|ph|dh|uh]].map(([e,t])=>[e,t|Tje])),gIt=new Ly({start:hIt,reduce(e,t,n,r){return e.flags&YQ&&dIt.has(t)||(t==AAt||t==xje)&&e.flags&Tje?e.parent:e},shift(e,t,n,r){return t==_je?new VQ(e,mIt(r.read(r.pos,n.pos)),0):t==bje?e.parent:t==bAt||t==vAt||t==wAt||t==yje?new VQ(e,0,YQ):_ge.has(t)?new VQ(e,0,_ge.get(t)|e.flags&YQ):e},hash(e){return e.hash}}),OIt=new Wn(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==lz)){n!=sIt&&n!=iIt&&n!=Vb&&n!=rP&&n!=vse&&e.acceptToken(fAt);return}}}),_It=new Wn((e,t)=>{let{flags:n}=t.context,r=n&uh?vje:Sje,s=(n&dh)>0,i=!(n&ph),o=(n&fh)>0,a=e.pos;for(;!(e.next<0);)if(o&&e.next==nZ)if(e.peek(1)==nZ)e.advance(2);else{if(e.pos==a){e.acceptToken(yje,1);return}break}else if(i&&e.next==Oge){if(e.pos==a){e.advance();let c=e.next;c>=0&&(e.advance(),bIt(e,c)),e.acceptToken(_At);return}break}else if(e.next==Oge&&!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(mge,s?3:1);return}break}else if(e.next==Vb){if(s)e.advance();else if(e.pos==a){e.acceptToken(mge);return}break}else e.advance();e.pos>a&&e.acceptToken(OAt)});function bIt(e,t){if(t==oIt)for(let n=0;n<2&&e.next>=48&&e.next<=55;n++)e.advance();else if(t==aIt)for(let n=0;n<2&&JF(e.next);n++)e.advance();else if(t==cIt)for(let n=0;n<4&&JF(e.next);n++)e.advance();else if(t==uIt)for(let n=0;n<8&&JF(e.next);n++)e.advance();else if(t==lIt&&e.next==nZ){for(e.advance();e.next>=0&&e.next!=gge&&e.next!=Sje&&e.next!=vje&&e.next!=Vb;)e.advance();e.next==gge&&e.advance()}}const yIt=Eo({'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}),xIt={__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},SIt=So.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'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO5T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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:gIt,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:[yIt],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!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%TXY%oY[%T[]%o]p%Tpq%oq#O%T#O#P&o#P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To&tX&n`OY%TYZ%oZ]%T]^%o^#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc'f[&n`O!_%T!_!`([!`#T%T#T#U(r#U#f%T#f#g(r#g#h(r#h#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(cTmR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(yT!mR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk)aV&n`&[ZOr%Trs)vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk){V&n`Or%Trs*bs#o%T#p#q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Trs!*[s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*aV&n`Or%Trs!*vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*}T&n`&jZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!+eV&n`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[OIt,fIt,pIt,_It,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:e=>xIt[e]||-1}],tokenPrec:7668}),bge=new UU,Eje=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 vIt={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 wje(e,t){let n=bge.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=vIt[o.name];if(a&&a(o,i,s)||!s&&Eje.has(o.name))return!1;s=!1}else if(o.to-o.from>8192){for(let a of wje(e,o.node))r.push(a);return!1}}),bge.set(t,r),r}const yge=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,kje=["String","FormatString","Comment","PropertyName"];function Cje(e){let t=is(e.state).resolveInner(e.pos,-1);if(kje.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&yge.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let r=[];for(let s=t;s;s=s.parent)Eje.has(s.name)&&(r=r.concat(wje(e.state.doc,s)));return{options:r,from:n?t.from:e.pos,validFor:yge}}const TIt=["__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"}))),EIt=[_r("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),_r("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),_r("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),_r("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),_r(`if \${}:
|
|
1050
1050
|
|
|
1051
1051
|
`,{label:"if",detail:"block",type:"keyword"}),_r("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),_r("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),_r("import ${module}",{label:"import",detail:"statement",type:"keyword"}),_r("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],Rje=iz(kje,sz(TIt.concat(EIt)));function eY(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 tY(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 qQ=vo.define({name:"python",parser:SIt.configure({props:[wo.add({Body:e=>{var t;let n=/^\s*(#|$)/.test(e.textAfter)&&eY(e)||e.node;return(t=tY(e,n))!==null&&t!==void 0?t:e.continue()},MatchBody:e=>{var t;let n=eY(e);return(t=tY(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":gf({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":gf({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":gf({closing:"]"}),MemberExpression:e=>e.baseIndent+e.unit,"String FormatString":()=>null,Script:e=>{var t;let n=eY(e);return(t=n&&tY(e,n))!==null&&t!==void 0?t:e.continue()}}),ko.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":rd,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 Pje(){return new Ki(qQ,[qQ.data.of({autocomplete:Cje}),qQ.data.of({autocomplete:Rje})])}const wIt=Object.freeze(Object.defineProperty({__proto__:null,globalCompletion:Rje,localCompletionSource:Cje,python:Pje,pythonLanguage:qQ},Symbol.toStringTag,{value:"Module"})),kIt=1,CIt=2,RIt=3,PIt=4,$It=5,xge=98,NIt=101,AIt=102,Sge=114,IIt=69,mI=48,vge=46,MIt=43,QIt=45,Tge=35,Ege=34,DIt=124,LIt=60,jIt=62;function rZ(e){return e>=48&&e<=57}function gI(e){return rZ(e)||e==95}const XIt=new Wn((e,t)=>{if(rZ(e.next)){let n=!1;do e.advance();while(gI(e.next));if(e.next==vge){if(n=!0,e.advance(),rZ(e.next))do e.advance();while(gI(e.next));else if(e.next==vge||e.next>127||/\w/.test(String.fromCharCode(e.next)))return}if(e.next==NIt||e.next==IIt){if(n=!0,e.advance(),(e.next==MIt||e.next==QIt)&&e.advance(),!gI(e.next))return;do e.advance();while(gI(e.next))}if(e.next==AIt){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($It)}else if(e.next==xge||e.next==Sge){if(e.next==xge&&e.advance(),e.next!=Sge)return;e.advance();let n=0;for(;e.next==Tge;)n++,e.advance();if(e.next!=Ege)return;e.advance();e:for(;;){if(e.next<0)return;let r=e.next==Ege;if(e.advance(),r){for(let s=0;s<n;s++){if(e.next!=Tge)continue e;e.advance()}e.acceptToken(PIt);return}}}}),UIt=new Wn(e=>{e.next==DIt&&e.acceptToken(kIt,1)}),zIt=new Wn(e=>{e.next==LIt?e.acceptToken(CIt,1):e.next==jIt&&e.acceptToken(RIt,1)}),BIt=Eo({"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}),FIt={__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,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*[*^*e*n*w*x+U+V+h+o+}-i-t-v.U.`.p.t.x.y/Z/[/{/}0`0r0w1O1Y1Z1y2a2h2j2m2s2v3V3u3{3|4R4U4_4e4t5`5d5v6R6Y6p6v6x7c7r8gR0k+ZR0j+ZQ'R!qQ)c%XQ+w&|R4y1PX'Q!q%X&|1PR+y&|R+x&|T/S*S4TT/R*S4TR.o)sR.n)sR){%p",nodeNames:"⚠ | < > RawString Float LineComment BlockComment SourceFile ] InnerAttribute ! [ MetaItem self Metavariable super crate Identifier ScopedIdentifier :: QualifiedScope AbstractType impl SelfType MetaType TypeIdentifier ScopedTypeIdentifier ScopeIdentifier TypeArgList TypeBinding = Lifetime String Escape Char Boolean Integer } { Block ; ConstItem Vis pub ( in ) const BoundIdentifier : UnsafeBlock unsafe AsyncBlock async move IfExpression if LetDeclaration let LiteralPattern ArithOp MetaPattern SelfPattern ScopedIdentifier TuplePattern ScopedTypeIdentifier , StructPattern FieldPatternList FieldPattern ref mut FieldIdentifier .. RefPattern SlicePattern CapturedPattern ReferencePattern & MutPattern RangePattern ... OrPattern MacroPattern ParenthesizedTokens TokenBinding Identifier TokenRepetition ArithOp BitOp LogicOp UpdateOp CompareOp -> => ArithOp BracketedTokens BracedTokens _ else MatchExpression match MatchBlock MatchArm Attribute Guard UnaryExpression ArithOp DerefOp LogicOp ReferenceExpression TryExpression BinaryExpression ArithOp ArithOp BitOp BitOp BitOp BitOp LogicOp LogicOp AssignmentExpression TypeCastExpression as ReturnExpression return RangeExpression CallExpression ArgList AwaitExpression await FieldExpression GenericFunction BreakExpression break LoopLabel ContinueExpression continue IndexExpression ArrayExpression TupleExpression MacroInvocation UnitExpression ClosureExpression ParamList Parameter Parameter ParenthesizedExpression StructExpression FieldInitializerList ShorthandFieldInitializer FieldInitializer BaseFieldInitializer MatchArm WhileExpression while LoopExpression loop ForExpression for MacroInvocation MacroDefinition macro_rules MacroRule EmptyStatement ModItem mod DeclarationList AttributeItem ForeignModItem extern StructItem struct TypeParamList ConstrainedTypeParameter TraitBounds HigherRankedTraitBound RemovedTraitBound OptionalTypeParameter ConstParameter WhereClause where LifetimeClause TypeBoundClause FieldDeclarationList FieldDeclaration OrderedFieldDeclarationList UnionItem union EnumItem enum EnumVariantList EnumVariant TypeItem type FunctionItem default fn ParamList Parameter SelfParameter VariadicParameter VariadicParameter ImplItem TraitItem trait AssociatedType LetDeclaration UseDeclaration use ScopedIdentifier UseAsClause ScopedIdentifier UseList ScopedUseList UseWildcard ExternCrateDeclaration StaticItem static ExpressionStatement ExpressionStatement GenericType FunctionType ForLifetimes ParamList VariadicParameter Parameter VariadicParameter Parameter ReferenceType PointerType TupleType UnitType ArrayType MacroInvocation EmptyType DynamicType dyn BoundedType",maxTerm:359,nodeProps:[["isolate",-4,4,6,7,33,""],["group",-42,4,5,14,15,16,17,18,19,33,35,36,37,40,51,53,56,101,107,111,112,113,122,123,125,127,128,130,132,133,134,137,139,140,141,142,143,144,148,149,155,157,159,"Expression",-16,22,24,25,26,27,222,223,230,231,232,233,234,235,236,237,239,"Type",-20,42,161,162,165,166,169,170,172,188,190,194,196,204,205,207,208,209,217,218,220,"Statement",-17,49,60,62,63,64,65,68,74,75,76,77,78,80,81,83,84,99,"Pattern"],["openedBy",9,"[",38,"{",47,"("],["closedBy",12,"]",39,"}",45,")"]],propSources:[BIt],skippedNodes:[0,6,7,240],repeatNodeCount:32,tokenData:"$%h_R!XOX$nXY5gYZ6iZ]$n]^5g^p$npq5gqr7Xrs9cst:Rtu;Tuv>vvwAQwxCbxy!+Tyz!,Vz{!-X{|!/_|}!0g}!O!1i!O!P!3v!P!Q!8[!Q!R!Bw!R![!Dr![!]#+q!]!^#-{!^!_#.}!_!`#1b!`!a#3o!a!b#6S!b!c#7U!c!}#8W!}#O#:T#O#P#;V#P#Q#Cb#Q#R#Dd#R#S#8W#S#T$n#T#U#8W#U#V#El#V#f#8W#f#g#Ic#g#o#8W#o#p$ S#p#q$!U#q#r$$f#r${$n${$|#8W$|4w$n4w5b#8W5b5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n!c!}#8W!}#O$n#O#P&[#P#R$n#R#S#8W#S#T$n#T#o#8W#o${$n${$|#8W$|4w$n4w5b#8W5b5i$n5i6S#8W6S;'S$n;'S;=`4s<%lO$nV#Kji'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q!c$n!c!}#MX!}#O$n#O#P&[#P#R$n#R#S#MX#S#T$n#T#o#MX#o${$n${$|#MX$|4w$n4w5b#MX5b5i$n5i6S#MX6S;'S$n;'S;=`4s<%lO$nV#Mbj'_Q'OS'TPOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q![#MX![!c$n!c!}#MX!}#O$n#O#P&[#P#R$n#R#S#MX#S#T$n#T#o#MX#o${$n${$|#MX$|4w$n4w5b#MX5b5i$n5i6S#MX6S;'S$n;'S;=`4s<%lO$n_$ ]]wX'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n_$!_a'rX'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q!_$n!_!`@O!`#O$n#O#P&[#P#p$n#p#q$#d#q;'S$n;'S;=`4s<%lO$n_$#m]'|X'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n_$$o]vX'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=`4s<%lO$n",tokenizers:[UIt,zIt,XIt,0,1,2,3],topRules:{SourceFile:[0,8]},specialized:[{term:281,get:e=>FIt[e]||-1}],tokenPrec:15596}),$je=vo.define({name:"rust",parser:YIt.configure({props:[wo.add({IfExpression:Ei({except:/^\s*({|else\b)/}),"String BlockComment":()=>null,AttributeItem:e=>e.continue(),"Statement MatchArm":Ei()}),ko.add(e=>{if(/(Block|edTokens|List)$/.test(e.name))return rd;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 Nje(){return new Ki($je)}const VIt=Object.freeze(Object.defineProperty({__proto__:null,rust:Nje,rustLanguage:$je},Symbol.toStringTag,{value:"Module"})),Aje=168,sZ=169,qIt=170,WIt=1,GIt=2,wge=3,HIt=171,ZIt=172,kge=4,Cge=173,KIt=5,JIt=174,Rge=175,Pge=176,nY=177,$ge=6,Nge=7,eMt=8,tMt=9,cz=0,Uh=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],nMt=58,rMt=40,Tse=95,sMt=91,oC=45,iMt=46,Ese=35,oMt=37,Ije=123,aMt=125,aC=47,lC=42,ku=10,Age=61,lMt=43,cMt=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==aC&&((t=e.peek(1))==aC||t==lC)}const uMt=new Wn((e,t)=>{if(t.dialectEnabled(cz)){let n;if(e.next<0&&t.canShift(Pge))e.acceptToken(Pge);else if(((n=e.peek(-1))==ku||n<0)&&t.canShift(Rge)){let r=0;for(;e.next!=ku&&Uh.includes(e.next);)e.advance(),r++;e.next==ku||kse(e)?e.acceptToken(Rge,-r):r&&e.acceptToken(nY)}else if(e.next==ku)e.acceptToken(JIt,1);else if(Uh.includes(e.next)){for(e.advance();e.next!=ku&&Uh.includes(e.next);)e.advance();e.acceptToken(nY)}}else{let n=0;for(;Uh.includes(e.next);)e.advance(),n++;n&&e.acceptToken(nY)}},{contextual:!0}),dMt=new Wn((e,t)=>{if(kse(e)){if(e.advance(),t.dialectEnabled(cz)){let n=-1;for(let r=1;;r++){let s=e.peek(-r-1);if(s==ku||s<0){n=r+1;break}else if(!Uh.includes(s))break}if(n>-1){let r=e.next==lC,s=0;for(e.advance();e.next>=0;)if(e.next==ku){e.advance();let i=0;for(;e.next!=ku&&Uh.includes(e.next);)i++,e.advance();if(i<n){s=-i-1;break}}else if(r&&e.next==lC&&e.peek(1)==aC){s=2;break}else e.advance();e.acceptToken(r?Nge:$ge,s);return}}if(e.next==aC){for(;e.next!=ku&&e.next>=0;)e.advance();e.acceptToken($ge)}else{for(e.advance();e.next>=0;){let{next:n}=e;if(e.advance(),n==lC&&e.next==aC){e.advance();break}}e.acceptToken(Nge)}}}),pMt=new Wn((e,t)=>{(e.next==lMt||e.next==Age)&&t.dialectEnabled(cz)&&e.acceptToken(e.next==Age?eMt:tMt,1)}),fMt=new Wn((e,t)=>{if(!t.dialectEnabled(cz))return;let n=t.context.depth;if(e.next<0&&n){e.acceptToken(sZ);return}if(e.peek(-1)==ku){let s=0;for(;e.next!=ku&&Uh.includes(e.next);)e.advance(),s++;s!=n&&e.next!=ku&&!kse(e)&&(s<n?e.acceptToken(sZ,-s):e.acceptToken(Aje))}}),hMt=new Wn((e,t)=>{for(let n=!1,r=0,s=0;;s++){let{next:i}=e;if(gT(i)||i==oC||i==Tse||n&&wse(i))!n&&(i!=oC||s>0)&&(n=!0),r===s&&i==oC&&r++,e.advance();else if(i==Ese&&e.peek(1)==Ije){e.acceptToken(KIt,2);break}else{n&&e.acceptToken(r==2&&t.canShift(kge)?kge:t.canShift(Cge)?Cge:i==rMt?HIt:ZIt);break}}}),mMt=new Wn(e=>{if(e.next==aMt){for(e.advance();gT(e.next)||e.next==oC||e.next==Tse||wse(e.next);)e.advance();e.next==Ese&&e.peek(1)==Ije?e.acceptToken(GIt,2):e.acceptToken(WIt)}}),gMt=new Wn(e=>{if(Uh.includes(e.peek(-1))){let{next:t}=e;(gT(t)||t==Tse||t==Ese||t==iMt||t==sMt||t==nMt&&gT(e.peek(1))||t==oC||t==cMt||t==lC)&&e.acceptToken(qIt)}}),OMt=new Wn(e=>{if(!Uh.includes(e.peek(-1))){let{next:t}=e;if(t==oMt&&(e.advance(),e.acceptToken(wge)),gT(t)){do e.advance();while(gT(e.next)||wse(e.next));e.acceptToken(wge)}}});function Mje(e,t){this.parent=e,this.depth=t,this.hash=(e?e.hash+e.hash<<8:0)+t+(t<<4)}const _Mt=new Mje(null,0),bMt=new Ly({start:_Mt,shift(e,t,n,r){return t==Aje?new Mje(e,n.pos-r.pos):t==sZ?e.parent:e},hash(e){return e.hash}}),yMt=Eo({"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}),xMt={__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},SMt={__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},vMt={__proto__:null,"@import":162,"@include":194,"@mixin":200,"@function":200,"@use":204,"@extend":214,"@at-root":218,"@forward":222,"@media":228,"@charset":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Q(c'jR({(cQ%R#RR&o%RQ$u#OS&e$u(jR(j'sQ'r&gR(i'rQ&w%YR'|&wQ'z&vR(p'zQ&y%^R(O&yQ%a#eR&}%aR|QSoOq]wPx!f#l$_%f`XOPqx!f#l$_%fQ!zeQ!{fQ$W!aQ$X!bQ$Y!cQ$Z!dQ&O$`Q&p%TR(['ZQ!SVQ!uaQ!vbQ!wcQ!xdQ#OgQ#WiQ#crQ#guQ#hvS#q!Q$dQ#x!TQ$e!tQ%l#sQ%m#tQ%n#ul%u$O$a%v&Q&j'S'V'^'t(U(Y(^(w)UQ&S$cS&W$e&YQ&g$wQ&{%_Q'O%bQ'X%{Q'f&XQ(`'bQ(h'qQ(t(QR(u(SR%x$OR&R$aR&P$`QzPQ$^!fR%}$_X#ly#j#m%eQ#VhQ#_mQ$h!uR&^$iW#Rhm!u$iQ#^lQ$|#QQ%S#SQ&m%PQ&n%QQ'p&dR(f'oQ%O#QQ'v&kR)R(nQ#apQ$k!vQ$n!xQ$q!zQ$v#OQ%V#WQ%W#YQ%]#_Q%d#hQ&]$hQ&f$uQ&q%XQ'k&^Q'l&_S'm&`&bQ(k'sQ(}(eR)Q(jR&h$wR#ft",nodeNames:"⚠ InterpolationEnd InterpolationContinue Unit VariableName InterpolationStart LineComment Comment IndentedMixin IndentedInclude StyleSheet RuleSet UniversalSelector TagSelector TagName NestingSelector SuffixedSelector Suffix Interpolation SassVariableName ValueName ) ( ParenthesizedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp LogicOp UnaryExpression LogicOp NamespacedValue . CallExpression Callee ArgList : ... , CallLiteral CallTag ParenthesizedContent ] [ LineNames LineName ClassSelector ClassName PseudoClassSelector :: PseudoClassName PseudoClassName ArgList PseudoClassName ArgList IdSelector # IdName AttributeSelector AttributeName MatchOp ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp PlaceholderSelector ClassName Block { Declaration PropertyName Map Important Global Default ; } ImportStatement AtKeyword import Layer layer LayerName KeywordQuery FeatureQuery FeatureName BinaryQuery ComparisonQuery CompareOp UnaryQuery LogicOp ParenthesizedQuery SelectorQuery selector IncludeStatement include Keyword MixinStatement mixin UseStatement use Keyword Star Keyword ExtendStatement extend RootStatement at-root ForwardStatement forward Keyword MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports IfStatement ControlKeyword ControlKeyword Keyword ForStatement ControlKeyword Keyword Keyword Keyword EachStatement ControlKeyword Keyword WhileStatement ControlKeyword OutputStatement ControlKeyword AtRule Styles",maxTerm:196,context:bMt,nodeProps:[["openedBy",1,"InterpolationStart",5,"InterpolationEnd",21,"(",43,"[",78,"{"],["isolate",-3,6,7,26,""],["closedBy",22,")",44,"]",70,"}"]],propSources:[yMt],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!^!_Hs!_!`Is!`!aJ^!a!b#r!b!cKa!c!}#r!}#OMn#O#P#r#P#QNP#Q#RNb#R#T#r#T#UNw#U#c#r#c#d!!Y#d#o#r#o#p!!o#p#qNb#q#r!#Q#r#s!#c#s;'S#r;'S;=`!#z<%lO#rW#uSOy$Rz;'S$R;'S;=`$d<%lO$RW$WSzWOy$Rz;'S$R;'S;=`$d<%lO$RW$gP;=`<%l$RY$m[Oy$Rz!_$R!_!`%c!`#W$R#W#X%v#X#Z$R#Z#[)Z#[#]$R#]#^,V#^;'S$R;'S;=`$d<%lO$RY%jSzWlQOy$Rz;'S$R;'S;=`$d<%lO$RY%{UzWOy$Rz#X$R#X#Y&_#Y;'S$R;'S;=`$d<%lO$RY&dUzWOy$Rz#Y$R#Y#Z&v#Z;'S$R;'S;=`$d<%lO$RY&{UzWOy$Rz#T$R#T#U'_#U;'S$R;'S;=`$d<%lO$RY'dUzWOy$Rz#i$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$RXKTS!aPzWOy$Rz;'S$R;'S;=`$d<%lO$RXKdYOy$Rz}$R}!OLS!O!c$R!c!}Lq!}#T$R#T#oLq#o;'S$R;'S;=`$d<%lO$RXLXWzWOy$Rz!c$R!c!}Lq!}#T$R#T#oLq#o;'S$R;'S;=`$d<%lO$RXLx[!rPzWOy$Rz}$R}!OLq!O!Q$R!Q![Lq![!c$R!c!}Lq!}#T$R#T#oLq#o;'S$R;'S;=`$d<%lO$RZMsS|ROy$Rz;'S$R;'S;=`$d<%lO$R_NUS{VOy$Rz;'S$R;'S;=`$d<%lO$R[NeUOy$Rz!_$R!_!`;T!`;'S$R;'S;=`$d<%lO$RkNzUOy$Rz#b$R#b#c! ^#c;'S$R;'S;=`$d<%lO$Rk! cUzWOy$Rz#W$R#W#X! u#X;'S$R;'S;=`$d<%lO$Rk! |SmczWOy$Rz;'S$R;'S;=`$d<%lO$Rk!!]UOy$Rz#f$R#f#g! u#g;'S$R;'S;=`$d<%lO$RZ!!tS!hROy$Rz;'S$R;'S;=`$d<%lO$RZ!#VS!pROy$Rz;'S$R;'S;=`$d<%lO$R]!#hU!dPOy$Rz!_$R!_!`;T!`;'S$R;'S;=`$d<%lO$RW!#}P;=`<%l#r",tokenizers:[fMt,gMt,mMt,OMt,hMt,uMt,dMt,pMt,0,1,2,3,4],topRules:{StyleSheet:[0,10],Styles:[1,145]},dialects:{indented:0},specialized:[{term:172,get:e=>xMt[e]||-1},{term:171,get:e=>SMt[e]||-1},{term:80,get:e=>vMt[e]||-1},{term:173,get:e=>TMt[e]||-1}],tokenPrec:3217}),RL=vo.define({name:"sass",parser:EMt.configure({props:[ko.add({Block:rd,Comment(e,t){return{from:e.from+2,to:t.sliceDoc(e.to-2,e.to)=="*/"?e.to-2:e.to}}}),wo.add({Declaration:Ei()})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"},line:"//"},indentOnInput:/^\s*\}$/,wordChars:"$-"}}),wMt=RL.configure({dialect:"indented",props:[wo.add({"Block RuleSet":e=>e.baseIndent+e.unit}),ko.add({Block:e=>({from:e.from,to:e.to})})]}),Qje=rz(e=>e.name=="VariableName"||e.name=="SassVariableName");function iZ(e){return new Ki(e?.indented?wMt:RL,RL.data.of({autocomplete:Qje}))}const Ige=Object.freeze(Object.defineProperty({__proto__:null,sass:iZ,sassCompletionSource:Qje,sassLanguage:RL},Symbol.toStringTag,{value:"Module"})),kMt=36,Mge=1,CMt=2,Ox=3,rY=4,RMt=5,PMt=6,$Mt=7,NMt=8,AMt=9,IMt=10,MMt=11,QMt=12,DMt=13,LMt=14,jMt=15,XMt=16,UMt=17,Qge=18,zMt=19,Dje=20,Lje=21,Dge=22,BMt=23,FMt=24;function oZ(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57}function YMt(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function h0(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 VMt(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 aZ(e,t){for(;!(e.next!=95&&!oZ(e.next));)t!=null&&(t+=String.fromCharCode(e.next)),e.advance();return t}function WMt(e){if(e.next==39||e.next==34||e.next==96){let t=e.next;e.advance(),h0(e,t,!1)}else aZ(e)}function Lge(e,t){for(;e.next==48||e.next==49;)e.advance();t&&e.next==t&&e.advance()}function jge(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 Xge(e){for(;!(e.next<0||e.next==10);)e.advance()}function H_(e,t){for(let n=0;n<t.length;n++)if(t.charCodeAt(n)==e)return!0;return!1}const sY=` \r
|
|
1052
|
-
`;function jje(e,t,n){let r=Object.create(null);r.true=r.false=RMt,r.null=r.unknown=PMt;for(let s of e.split(" "))s&&(r[s]=Dje);for(let s of t.split(" "))s&&(r[s]=Lje);for(let s of(n||"").split(" "))s&&(r[s]=FMt);return r}const jy="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 ",Xy="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 ",lZ={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:jje(Xy,jy)};function GMt(e,t,n,r){let s={};for(let i in lZ)s[i]=(e.hasOwnProperty(i)?e:lZ)[i];return t&&(s.words=jje(t,n||"",r)),s}function Xje(e){return new Wn(t=>{var n;let{next:r}=t;if(t.advance(),H_(r,sY)){for(;H_(t.next,sY);)t.advance();t.acceptToken(kMt)}else if(r==36&&e.doubleDollarQuotedStrings){let s=aZ(t,"");t.next==36&&(t.advance(),VMt(t,s),t.acceptToken(Ox))}else if(r==39||r==34&&e.doubleQuotedStrings)h0(t,r,e.backslashEscapes),t.acceptToken(Ox);else if(r==35&&e.hashComments||r==47&&t.next==47&&e.slashComments)Xge(t),t.acceptToken(Mge);else if(r==45&&t.next==45&&(!e.spaceAfterDashes||t.peek(1)==32))Xge(t),t.acceptToken(Mge);else if(r==47&&t.next==42){t.advance();for(let s=1;;){let i=t.next;if(t.next<0)break;if(t.advance(),i==42&&t.next==47){if(s--,t.advance(),!s)break}else i==47&&t.next==42&&(s++,t.advance())}t.acceptToken(CMt)}else if((r==101||r==69)&&t.next==39)t.advance(),h0(t,39,!0),t.acceptToken(Ox);else if((r==110||r==78)&&t.next==39&&e.charSetCasts)t.advance(),h0(t,39,e.backslashEscapes),t.acceptToken(Ox);else if(r==95&&e.charSetCasts)for(let s=0;;s++){if(t.next==39&&s>1){t.advance(),h0(t,39,e.backslashEscapes),t.acceptToken(Ox);break}if(!oZ(t.next))break;t.advance()}else if(e.plsqlQuotingMechanism&&(r==113||r==81)&&t.next==39&&t.peek(1)>0&&!H_(t.peek(1),sY)){let s=t.peek(1);t.advance(2),qMt(t,s),t.acceptToken(Ox)}else if(H_(r,e.identifierQuotes)){const s=r==91?93:r;h0(t,s,!1),t.acceptToken(zMt)}else if(r==40)t.acceptToken($Mt);else if(r==41)t.acceptToken(NMt);else if(r==123)t.acceptToken(AMt);else if(r==125)t.acceptToken(IMt);else if(r==91)t.acceptToken(MMt);else if(r==93)t.acceptToken(QMt);else if(r==59)t.acceptToken(DMt);else if(e.unquotedBitLiterals&&r==48&&t.next==98)t.advance(),Lge(t),t.acceptToken(Dge);else if((r==98||r==66)&&(t.next==39||t.next==34)){const s=t.next;t.advance(),e.treatBitsAsBytes?(h0(t,s,e.backslashEscapes),t.acceptToken(BMt)):(Lge(t,s),t.acceptToken(Dge))}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();YMt(t.next);)t.advance();s&&t.next==39&&t.advance(),t.acceptToken(rY)}else if(r==46&&t.next>=48&&t.next<=57)jge(t,!0),t.acceptToken(rY);else if(r==46)t.acceptToken(LMt);else if(r>=48&&r<=57)jge(t,!1),t.acceptToken(rY);else if(H_(r,e.operatorChars)){for(;H_(t.next,e.operatorChars);)t.advance();t.acceptToken(jMt)}else if(H_(r,e.specialVar))t.next==r&&t.advance(),WMt(t),t.acceptToken(UMt);else if(r==58||r==44)t.acceptToken(XMt);else if(oZ(r)){let s=aZ(t,String.fromCharCode(r));t.acceptToken(t.next==46||t.peek(-s.length-1)==46?Qge:(n=e.words[s.toLowerCase()])!==null&&n!==void 0?n:Qge)}})}const Uje=Xje(lZ),HMt=So.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,Uje],topRules:{Script:[0,25]},tokenPrec:0});function cZ(e){let t=e.cursor().moveTo(e.from,-1);for(;/Comment/.test(t.name);)t.moveTo(t.from,-1);return t.node}function sP(e,t){let n=e.sliceString(t.from,t.to),r=/^([`'"\[])(.*)([`'"\]])$/.exec(n);return r?r[2]:n}function PL(e){return e&&(e.name=="Identifier"||e.name=="QuotedIdentifier")}function ZMt(e,t){if(t.name=="CompositeIdentifier"){let n=[];for(let r=t.firstChild;r;r=r.nextSibling)PL(r)&&n.push(sP(e,r));return n}return[sP(e,t)]}function Uge(e,t){for(let n=[];;){if(!t||t.name!=".")return n;let r=cZ(t);if(!PL(r))return n;n.unshift(sP(e,r)),t=cZ(r)}}function KMt(e,t){let n=is(e).resolveInner(t,-1),r=eQt(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:Uge(e.doc,cZ(n)),aliases:r}:n.name=="."?{from:t,quoted:null,parents:Uge(e.doc,n),aliases:r}:{from:t,quoted:null,parents:[],empty:!0,aliases:r}}const JMt=new Set("where group having order union intersect except all distinct limit offset fetch for".split(" "));function eQt(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&&PL(s.nextSibling))c=sP(e,s.nextSibling);else{if(a&&JMt.has(a))break;o&&PL(s)&&(c=sP(e,s))}c&&(r||(r=Object.create(null)),r[c]=ZMt(e,o)),o=/Identifier$/.test(s.name)?s:null}return r}function tQt(e,t,n){return n.map(r=>({...r,label:r.label[0]==e?r.label:e+r.label+t,apply:void 0}))}const nQt=/^\w*$/,rQt=/^[`'"\[]?\w*[`'"\]]?$/;function zge(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(Bge(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"?Bge(n,"property",this.idQuote,this.idCaseInsensitive):n)}addNamespace(t){Array.isArray(t)?this.addCompletions(t):zge(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;zge(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 Bge(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+zje(n)}}function zje(e){return e==="["?"]":e}function sQt(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:g}=KMt(d.state,d.pos);if(m&&!d.explicit)return null;g&&p.length==1&&(p=g[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&&g&&(b=b.concat(Object.keys(g).map(y=>({label:y,type:"constant"})))),h){let y=h[0],x=zje(y),S=d.state.sliceDoc(d.pos,d.pos+1)==x;return{from:f,to:S?d.pos+1:void 0,options:tQt(y,x,b),validFor:rQt}}else return{from:f,options:b,validFor:nQt}}}function iQt(e){return e==Lje?"type":e==Dje?"keyword":"variable"}function oQt(e,t,n){let r=Object.keys(e).map(s=>n(t?s.toUpperCase():s,iQt(e[s])));return iz(["QuotedIdentifier","String","LineComment","BlockComment","."],sz(r))}let aQt=HMt.configure({props:[wo.add({Statement:Ei()}),ko.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}}}),Eo({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 Hu{constructor(t,n,r){this.dialect=t,this.language=n,this.spec=r}get extension(){return this.language.extension}configureLanguage(t,n){return new Hu(this.dialect,this.language.configure(t,n),this.spec)}static define(t){let n=GMt(t,t.keywords,t.types,t.builtin),r=vo.define({name:"sql",parser:aQt.configure({tokenizers:[{from:Uje,to:Xje(n)}]}),languageData:{commentTokens:{line:"--",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}});return new Hu(n,r,t)}}function lQt(e,t){return{label:e,type:t,boost:-1}}function Bje(e,t=!1,n){return oQt(e.dialect.words,t,n||lQt)}function Fje(e){return e.schema?sQt(e.schema,e.tables,e.schemas,e.defaultTable,e.defaultSchema,e.dialect||uz):()=>null}function cQt(e){return e.schema?(e.dialect||uz).language.data.of({autocomplete:Fje(e)}):[]}function Yje(e={}){let t=e.dialect||uz;return new Ki(t.language,[cQt(e),t.language.data.of({autocomplete:Bje(t,e.upperCaseKeywords,e.keywordCompletion)})])}const uz=Hu.define({}),uQt=Hu.define({charSetCasts:!0,doubleDollarQuotedStrings:!0,operatorChars:"+-*/<>=~!@#%^&|`?",specialVar:"",keywords:Xy+"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:jy+"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"}),Vje="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",qje=jy+"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",Wje="charset clear edit ego help nopager notee nowarning pager print prompt quit rehash source status system tee",dQt=Hu.define({operatorChars:"*+-%<>!=&|^",charSetCasts:!0,doubleQuotedStrings:!0,unquotedBitLiterals:!0,hashComments:!0,spaceAfterDashes:!0,specialVar:"@?",identifierQuotes:"`",keywords:Xy+"group_concat "+Vje,types:qje,builtin:Wje}),pQt=Hu.define({operatorChars:"*+-%<>!=&|^",charSetCasts:!0,doubleQuotedStrings:!0,unquotedBitLiterals:!0,hashComments:!0,spaceAfterDashes:!0,specialVar:"@?",identifierQuotes:"`",keywords:Xy+"always generated groupby_concat hard persistent shutdown soft virtual "+Vje,types:qje,builtin:Wje});let fQt="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 hQt=Hu.define({keywords:Xy+"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:jy+"smalldatetime datetimeoffset datetime2 datetime bigint smallint smallmoney tinyint money real text nvarchar ntext varbinary image hierarchyid uniqueidentifier sql_variant xml",builtin:fQt,operatorChars:"*+-%<>!=^&|/",specialVar:"@",identifierQuotes:'"['}),mQt=Hu.define({keywords:Xy+"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:jy+"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:"@:?$"}),gQt=Hu.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:jy+"ascii bigint blob counter frozen inet list map static text timeuuid tuple uuid varint",slashComments:!0}),OQt=Hu.define({keywords:Xy+"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:jy+"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}),_Qt=Object.freeze(Object.defineProperty({__proto__:null,Cassandra:gQt,MSSQL:hQt,MariaSQL:pQt,MySQL:dQt,PLSQL:OQt,PostgreSQL:uQt,SQLDialect:Hu,SQLite:mQt,StandardSQL:uz,keywordCompletionSource:Bje,schemaCompletionSource:Fje,sql:Yje},Symbol.toStringTag,{value:"Module"})),uZ=1,bQt=2,yQt=3,xQt=4,SQt=5,vQt=36,TQt=37,EQt=38,wQt=11,kQt=13;function CQt(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function RQt(e){return e==9||e==10||e==13||e==32}let Fge=null,Yge=null,Vge=0;function dZ(e,t){let n=e.pos+t;if(Yge==e&&Vge==n)return Fge;for(;RQt(e.peek(t));)t++;let r="";for(;;){let s=e.peek(t);if(!CQt(s))break;r+=String.fromCharCode(s),t++}return Yge=e,Vge=n,Fge=r||null}function qge(e,t){this.name=e,this.parent=t}const PQt=new Ly({start:null,shift(e,t,n,r){return t==uZ?new qge(dZ(r,1)||"",e):e},reduce(e,t){return t==wQt&&e?e.parent:e},reuse(e,t,n,r){let s=t.type.id;return s==uZ||s==kQt?new qge(dZ(r,1)||"",e):e},strict:!1}),$Qt=new Wn((e,t)=>{if(e.next==60){if(e.advance(),e.next==47){e.advance();let n=dZ(e,0);if(!n)return e.acceptToken(SQt);if(t.context&&n==t.context.name)return e.acceptToken(bQt);for(let r=t.context;r;r=r.parent)if(r.name==n)return e.acceptToken(yQt,-2);e.acceptToken(xQt)}else if(e.next!=33&&e.next!=63)return e.acceptToken(uZ)}},{contextual:!0});function Rse(e,t){return new Wn(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 NQt=Rse(vQt,"-->"),AQt=Rse(TQt,"?>"),IQt=Rse(EQt,"]]>"),MQt=Eo({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)}),QQt=So.deserialize({version:14,states:",lOQOaOOOrOxO'#CfOzOpO'#CiO!tOaO'#CgOOOP'#Cg'#CgO!{OrO'#CrO#TOtO'#CsO#]OpO'#CtOOOP'#DT'#DTOOOP'#Cv'#CvQQOaOOOOOW'#Cw'#CwO#eOxO,59QOOOP,59Q,59QOOOO'#Cx'#CxO#mOpO,59TO#uO!bO,59TOOOP'#C|'#C|O$TOaO,59RO$[OpO'#CoOOOP,59R,59ROOOQ'#C}'#C}O$dOrO,59^OOOP,59^,59^OOOS'#DO'#DOO$lOtO,59_OOOP,59_,59_O$tOpO,59`O$|OpO,59`OOOP-E6t-E6tOOOW-E6u-E6uOOOP1G.l1G.lOOOO-E6v-E6vO%UO!bO1G.oO%UO!bO1G.oO%dOpO'#CkO%lO!bO'#CyO%zO!bO1G.oOOOP1G.o1G.oOOOP1G.w1G.wOOOP-E6z-E6zOOOP1G.m1G.mO&VOpO,59ZO&_OpO,59ZOOOQ-E6{-E6{OOOP1G.x1G.xOOOS-E6|-E6|OOOP1G.y1G.yO&gOpO1G.zO&gOpO1G.zOOOP1G.z1G.zO&oO!bO7+$ZO&}O!bO7+$ZOOOP7+$Z7+$ZOOOP7+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!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:PQt,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:[MQt],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#P#Q!'W#Q#R$q#R#S4n#S#T$q#T#o4n#o%W$q%W%o4n%o%p$q%p&a4n&a&b$q&b1p4n1p4U$q4U4d4n4d4e$q4e$IS4n$IS$I`$q$I`$Ib4n$Ib$Kh$q$Kh%#t4n%#t&/x$q&/x&Et4n&Et&FV$q&FV;'S4n;'S;:j8O;:j;=`)c<%l?&r$q?&r?Ah4n?Ah?BY$q?BY?Mn4n?MnO$qi$zXVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qa%nVVP!O`Ov%gwx&Tx!^%g!^!_&o!_;'S%g;'S;=`'W<%lO%gP&YTVPOv&Tw!^&T!_;'S&T;'S;=`&i<%lO&TP&lP;=`<%l&T`&tS!O`Ov&ox;'S&o;'S;=`'Q<%lO&o`'TP;=`<%l&oa'ZP;=`<%l%gX'eWVP|WOr'^rs&Tsv'^w!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Or(ors&osv(owx'}x#h(o#h#iNz#i;'S(o;'S;=`)]<%lO(oi! RX|W!O`Or(ors&osv(owx'}x#m(o#m#n! n#n;'S(o;'S;=`)]<%lO(oi! uX|W!O`Or(ors&osv(owx'}x#d(o#d#e!!b#e;'S(o;'S;=`)]<%lO(oi!!iX|W!O`Or(ors&osv(owx'}x#X(o#X#Y?y#Y;'S(o;'S;=`)]<%lO(oi!#_V!SP|W!O`Or(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(ok!$PXaQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qo!$wX[UVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(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:[$Qt,NQt,AQt,IQt,0,1,2,3,4],topRules:{Document:[0,6]},tokenPrec:0});function WQ(e,t){let n=t&&t.getChild("TagName");return n?e.sliceString(n.from,n.to):""}function iY(e,t){let n=t&&t.firstChild;return!n||n.name!="OpenTag"?"":WQ(e,n)}function DQt(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 oY(e){for(let t=e&&e.parent;t;t=t.parent)if(t.name=="Element")return t;return null}function LQt(e,t){var n;let r=is(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:oY(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:oY(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:oY(r)}:null}let jQt=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 aY=/^[:\-\.\w\u00b7-\uffff]*$/;function Wge(e){return Object.assign(Object.assign({type:"property"},e.completion||{}),{label:e.name})}function Gge(e){return typeof e=="string"?{label:`"${e}"`,type:"constant"}:/^"/.test(e.label)?e:Object.assign(Object.assign({},e),{label:`"${e.label}"`})}function Gje(e,t){let n=[],r=[],s=Object.create(null);for(let c of t){let l=Wge(c);n.push(l),c.global&&r.push(l),c.values&&(s[c.name]=c.values.map(Gge))}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(Gge)),Wge(f)))));let p=new jQt(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=LQt(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 g=o,_=iY(d,m);if(_){let b=a[_];g=b?.children||i}return{from:h,options:g.map(b=>b.completion),validFor:aY}}else if(f=="closeTag"){let g=iY(d,m);return g?{from:h,to:c.pos+(d.sliceString(c.pos,c.pos+1)==">"?1:0),options:[((l=a[g])===null||l===void 0?void 0:l.closeNameCompletion)||{label:g+">",type:"type"}],validFor:aY}:null}else if(f=="attrName"){let g=a[WQ(d,m)];return{from:h,options:g?.attrs||r,validFor:aY}}else if(f=="attrValue"){let g=DQt(d,m,h);if(!g)return null;let _=a[WQ(d,m)],b=(_?.attrValues||s)[g];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 g=iY(d,m),_=a[g],b=[],y=m&&m.lastChild;g&&(!y||y.name!="CloseTag"||WQ(d,y)!=g)&&b.push(_?_.closeCompletion:{label:"</"+g+">",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 $L=vo.define({name:"xml",parser:QQt.configure({props:[wo.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}}),ko.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 Hje(e={}){let t=[$L.data.of({autocomplete:Gje(e.elements||[],e.attributes||[])})];return e.autoCloseTags!==!1&&t.push(Zje),new Ki($L,t)}function Hge(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 Zje=Gt.inputHandler.of((e,t,n,r,s)=>{if(e.composing||e.state.readOnly||t!=n||r!=">"&&r!="/"||!$L.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=is(o).resolveInner(f,-1),g;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"&&(g=Hge(o.doc,_.parent,f))){let b=f+(o.doc.sliceString(f,f+1)===">"?1:0),y=`</${g}>`;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"&&(g=Hge(o.doc,_,f))){let b=f+(o.doc.sliceString(f,f+1)===">"?1:0),y=`${g}>`;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)}),XQt=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:Zje,completeFromSchema:Gje,xml:Hje,xmlLanguage:$L},Symbol.toStringTag,{value:"Module"})),eS=63,Zge=64,UQt=1,zQt=2,Kje=3,BQt=4,Jje=5,FQt=6,YQt=7,eXe=65,VQt=66,qQt=8,WQt=9,GQt=10,HQt=11,ZQt=12,tXe=13,KQt=19,JQt=20,e2t=29,t2t=33,n2t=34,r2t=47,s2t=0,Pse=1,pZ=2,iP=3,fZ=4;let C0=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}};C0.top=new C0(null,-1,s2t);function cC(e,t){for(let n=0,r=t-e.pos-1;;r--,n++){let s=e.peek(r);if(vm(s)||s==-1)return n}}function hZ(e){return e==32||e==9}function vm(e){return e==10||e==13}function nXe(e){return hZ(e)||vm(e)}function X0(e){return e<0||nXe(e)}const i2t=new Ly({start:C0.top,reduce(e,t){return e.type==iP&&(t==JQt||t==n2t)?e.parent:e},shift(e,t,n,r){if(t==Kje)return new C0(e,cC(r,r.pos),Pse);if(t==eXe||t==Jje)return new C0(e,cC(r,r.pos),pZ);if(t==eS)return e.parent;if(t==KQt||t==t2t)return new C0(e,0,iP);if(t==tXe&&e.type==fZ)return e.parent;if(t==r2t){let s=/[1-9]/.exec(r.read(r.pos,n.pos));if(s)return new C0(e,e.depth+ +s[0],fZ)}return e},hash(e){return e.hash}});function OT(e,t,n=0){return e.peek(n)==t&&e.peek(n+1)==t&&e.peek(n+2)==t&&X0(e.peek(n+3))}const o2t=new Wn((e,t)=>{if(e.next==-1&&t.canShift(Zge))return e.acceptToken(Zge);let n=e.peek(-1);if((vm(n)||n<0)&&t.context.type!=iP){if(OT(e,45))if(t.canShift(eS))e.acceptToken(eS);else return e.acceptToken(UQt,3);if(OT(e,46))if(t.canShift(eS))e.acceptToken(eS);else return e.acceptToken(zQt,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||!X0(e.peek(1))))&&e.next!=-1&&!vm(e.next)&&e.next!=35&&e.acceptToken(eS,-r)}},{contextual:!0}),a2t=new Wn((e,t)=>{if(t.context.type==iP){e.next==63&&(e.advance(),X0(e.next)&&e.acceptToken(YQt));return}if(e.next==45)e.advance(),X0(e.next)&&e.acceptToken(t.context.type==Pse&&t.context.depth==cC(e,e.pos-1)?BQt:Kje);else if(e.next==63)e.advance(),X0(e.next)&&e.acceptToken(t.context.type==pZ&&t.context.depth==cC(e,e.pos-1)?FQt:Jje);else{let n=e.pos;for(;;)if(hZ(e.next)){if(e.pos==n)return;e.advance()}else if(e.next==33)rXe(e);else if(e.next==38)mZ(e);else if(e.next==42){mZ(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(!c2t(e))return;break}else{sXe(e,!0,!1,0);break}for(;hZ(e.next);)e.advance();if(e.next==58){if(e.pos==n&&t.canShift(e2t))return;let r=e.peek(1);X0(r)&&e.acceptTokenTo(t.context.type==pZ&&t.context.depth==cC(e,n)?VQt:eXe,n)}}},{contextual:!0});function l2t(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 Kge(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function Jge(e,t){return e.next==37?(e.advance(),Kge(e.next)&&e.advance(),Kge(e.next)&&e.advance(),!0):l2t(e.next)||t&&e.next==44?(e.advance(),!0):!1}function rXe(e){if(e.advance(),e.next==60){for(e.advance();;)if(!Jge(e,!0)){e.next==62&&e.advance();break}}else for(;Jge(e,!1););}function mZ(e){for(e.advance();!X0(e.next)&&NL(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(vm(i)){if(t)return!1;r=!0}else if(t&&e.pos>=s+1024)return!1}return!r}function c2t(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||vm(e.next))return!1;e.advance()}}const u2t="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function NL(e){return e<33?"u":e>125?"s":u2t[e-33]}function lY(e,t){let n=NL(e);return n!="u"&&!(t&&n=="f")}function sXe(e,t,n,r){if(NL(e.next)=="s"||(e.next==63||e.next==58||e.next==45)&&lY(e.peek(1),n))e.advance();else return!1;let s=e.pos;for(;;){let i=e.next,o=0,a=r+1;for(;nXe(i);){if(vm(i)){if(t)return!1;a=0}else a++;i=e.peek(++o)}if(!(i>=0&&(i==58?lY(e.peek(o+1),n):i==35?e.peek(o-1)!=32:lY(i,n)))||!n&&a<=r||a==0&&!n&&(OT(e,45,o)||OT(e,46,o)))break;if(t&&NL(i)=="f")return!1;for(let l=o;l>=0;l--)e.advance();if(t&&e.pos>s+1024)return!1}return!0}const d2t=new Wn((e,t)=>{if(e.next==33)rXe(e),e.acceptToken(ZQt);else if(e.next==38||e.next==42){let n=e.next==38?GQt:HQt;mZ(e),e.acceptToken(n)}else e.next==39||e.next==34?($se(e,!1),e.acceptToken(WQt)):sXe(e,!1,t.context.type==iP,t.context.depth)&&e.acceptToken(qQt)}),p2t=new Wn((e,t)=>{let n=t.context.type==fZ?t.context.depth:-1,r=e.pos;e:for(;;){let s=0,i=e.next;for(;i==32;)i=e.peek(++s);if(!s&&(OT(e,45,s)||OT(e,46,s))||!vm(i)&&(n<0&&(n=Math.max(t.context.depth+1,s)),s<n))break;for(;;){if(e.next<0)break e;let o=vm(e.next);if(e.advance(),o)continue e;r=e.pos}}e.acceptTokenTo(tXe,r)}),f2t=Eo({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}),h2t=So.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'#CwOOQO'#Cv'#CvO+wQdO'#CvOOQO'#Cq'#CqO,UQ`O,59[O,^QfO,59[OOQR,59[,59[OOQO'#Cx'#CxO,eQ`O'#DPO,pQdO'#DPOOQO'#Dx'#DxO,zQdO'#DxO-XQ`O,59jO-aQfO,59jOOQR,59j,59jOOQR'#DS'#DSO-hQcO,59mO-sQgO'#DVO.TQ`O'#DVO.YQcO,59pOOQR'#DX'#DXO#|QfO'#DWO.hQcO'#DWOOQR,59v,59vO.yOWO,59vO/OOaO,59vO/WOaO,59vO/cQgO'#D_OOQR,59x,59xO0VQgO'#DaOOQR,59z,59zOOQP,59|,59|O0yOaO,59|O1ROaO,59|O1aOqO,59|OOQP-E7h-E7hO1oQgO,59XOOQP,59X,59XO2PQaO'#DeO2_QgO'#DeO2oQgO'#DkOOQP'#Dk'#DkQ)jQaOOO3PQdO'#CsOOQO,59^,59^O3kQdO'#CuOOQO,59`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#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:i2t,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[f2t],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#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![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'Sn;'S;=`!c<%l~n~On~~$s~$zOX~Y~",tokenizers:[0],topRules:{Document:[0,1]},tokenPrec:67}),Nse=vo.define({name:"yaml",parser:h2t.configure({props:[wo.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:gf({closing:"}"}),FlowSequence:gf({closing:"]"})}),ko.add({"FlowMapping FlowSequence":rd,"Item Pair BlockLiteral":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function iXe(){return new Ki(Nse)}const g2t=vo.define({name:"yaml-frontmatter",parser:m2t.configure({props:[Eo({DashLine:X.meta})]})});function O2t(e){let{language:t,support:n}=e.content instanceof Ki?e.content:{language:e.content,support:[]};return new Ki(g2t.configure({wrap:BU(r=>r.name=="FrontmatterContent"?{parser:Nse.parser}:r.name=="Body"?{parser:t.parser}:null)}),n)}const _2t=Object.freeze(Object.defineProperty({__proto__:null,yaml:iXe,yamlFrontmatter:O2t,yamlLanguage:Nse},Symbol.toStringTag,{value:"Module"}));function dt(e){return new Ki(Kre.define(e))}function lg(e){return De(()=>Promise.resolve().then(()=>_Qt),void 0).then(t=>t.sql({dialect:t[e]}))}const b2t=[Ye.of({name:"C",extensions:["c","h","ino"],load(){return De(()=>Promise.resolve().then(()=>vme),void 0).then(e=>e.cpp())}}),Ye.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return De(()=>Promise.resolve().then(()=>vme),void 0).then(e=>e.cpp())}}),Ye.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return lg("Cassandra")}}),Ye.of({name:"CSS",extensions:["css"],load(){return De(()=>Promise.resolve().then(()=>OCt),void 0).then(e=>e.css())}}),Ye.of({name:"Go",extensions:["go"],load(){return De(()=>Promise.resolve().then(()=>cRt),void 0).then(e=>e.go())}}),Ye.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return De(()=>Promise.resolve().then(()=>jPt),void 0).then(e=>e.html())}}),Ye.of({name:"Java",extensions:["java"],load(){return De(()=>Promise.resolve().then(()=>BPt),void 0).then(e=>e.java())}}),Ye.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return De(()=>Promise.resolve().then(()=>dI),void 0).then(e=>e.javascript())}}),Ye.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return De(()=>import("./index-CpyChjme.js"),__vite__mapDeps([0,1])).then(e=>e.jinja())}}),Ye.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return De(()=>Promise.resolve().then(()=>WPt),void 0).then(e=>e.json())}}),Ye.of({name:"JSX",extensions:["jsx"],load(){return De(()=>Promise.resolve().then(()=>dI),void 0).then(e=>e.javascript({jsx:!0}))}}),Ye.of({name:"LESS",extensions:["less"],load(){return De(()=>Promise.resolve().then(()=>i$t),void 0).then(e=>e.less())}}),Ye.of({name:"Liquid",extensions:["liquid"],load(){return De(()=>import("./index-Mrh4pTHw.js"),__vite__mapDeps([2,1])).then(e=>e.liquid())}}),Ye.of({name:"MariaDB SQL",load(){return lg("MariaSQL")}}),Ye.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return De(()=>Promise.resolve().then(()=>z$t),void 0).then(e=>e.markdown())}}),Ye.of({name:"MS SQL",load(){return lg("MSSQL")}}),Ye.of({name:"MySQL",load(){return lg("MySQL")}}),Ye.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return De(()=>Promise.resolve().then(()=>pAt),void 0).then(e=>e.php())}}),Ye.of({name:"PLSQL",extensions:["pls"],load(){return lg("PLSQL")}}),Ye.of({name:"PostgreSQL",load(){return lg("PostgreSQL")}}),Ye.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return De(()=>Promise.resolve().then(()=>wIt),void 0).then(e=>e.python())}}),Ye.of({name:"Rust",extensions:["rs"],load(){return De(()=>Promise.resolve().then(()=>VIt),void 0).then(e=>e.rust())}}),Ye.of({name:"Sass",extensions:["sass"],load(){return De(()=>Promise.resolve().then(()=>Ige),void 0).then(e=>e.sass({indented:!0}))}}),Ye.of({name:"SCSS",extensions:["scss"],load(){return De(()=>Promise.resolve().then(()=>Ige),void 0).then(e=>e.sass())}}),Ye.of({name:"SQL",extensions:["sql"],load(){return lg("StandardSQL")}}),Ye.of({name:"SQLite",load(){return lg("SQLite")}}),Ye.of({name:"TSX",extensions:["tsx"],load(){return De(()=>Promise.resolve().then(()=>dI),void 0).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),Ye.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return De(()=>Promise.resolve().then(()=>dI),void 0).then(e=>e.javascript({typescript:!0}))}}),Ye.of({name:"WebAssembly",extensions:["wat","wast"],load(){return De(()=>import("./index-C9ONRXVI.js"),__vite__mapDeps([3,1])).then(e=>e.wast())}}),Ye.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return De(()=>Promise.resolve().then(()=>XQt),void 0).then(e=>e.xml())}}),Ye.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return De(()=>Promise.resolve().then(()=>_2t),void 0).then(e=>e.yaml())}}),Ye.of({name:"APL",extensions:["dyalog","apl"],load(){return De(()=>import("./apl-B4CMkyY2.js"),[]).then(e=>dt(e.apl))}}),Ye.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return De(()=>import("./asciiarmor-Df11BRmG.js"),[]).then(e=>dt(e.asciiArmor))}}),Ye.of({name:"ASN.1",extensions:["asn","asn1"],load(){return De(()=>import("./asn1-EdZsLKOL.js"),[]).then(e=>dt(e.asn1({})))}}),Ye.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return De(()=>import("./asterisk-B-8jnY81.js"),[]).then(e=>dt(e.asterisk))}}),Ye.of({name:"Brainfuck",extensions:["b","bf"],load(){return De(()=>import("./brainfuck-C4LP7Hcl.js"),[]).then(e=>dt(e.brainfuck))}}),Ye.of({name:"Cobol",extensions:["cob","cpy"],load(){return De(()=>import("./cobol-CWcv1MsR.js"),[]).then(e=>dt(e.cobol))}}),Ye.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return De(()=>import("./clike-B9uivgTg.js"),[]).then(e=>dt(e.csharp))}}),Ye.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return De(()=>import("./clojure-BMjYHr_A.js"),[]).then(e=>dt(e.clojure))}}),Ye.of({name:"ClojureScript",extensions:["cljs"],load(){return De(()=>import("./clojure-BMjYHr_A.js"),[]).then(e=>dt(e.clojure))}}),Ye.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return De(()=>import("./css-BnMrqG3P.js"),[]).then(e=>dt(e.gss))}}),Ye.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return De(()=>import("./cmake-BQqOBYOt.js"),[]).then(e=>dt(e.cmake))}}),Ye.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return De(()=>import("./coffeescript-S37ZYGWr.js"),[]).then(e=>dt(e.coffeeScript))}}),Ye.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return De(()=>import("./commonlisp-DBKNyK5s.js"),[]).then(e=>dt(e.commonLisp))}}),Ye.of({name:"Cypher",extensions:["cyp","cypher"],load(){return De(()=>import("./cypher-C_CwsFkJ.js"),[]).then(e=>dt(e.cypher))}}),Ye.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return De(()=>import("./python-BuPzkPfP.js"),[]).then(e=>dt(e.cython))}}),Ye.of({name:"Crystal",extensions:["cr"],load(){return De(()=>import("./crystal-SjHAIU92.js"),[]).then(e=>dt(e.crystal))}}),Ye.of({name:"D",extensions:["d"],load(){return De(()=>import("./d-pRatUO7H.js"),[]).then(e=>dt(e.d))}}),Ye.of({name:"Dart",extensions:["dart"],load(){return De(()=>import("./clike-B9uivgTg.js"),[]).then(e=>dt(e.dart))}}),Ye.of({name:"diff",extensions:["diff","patch"],load(){return De(()=>import("./diff-DbItnlRl.js"),[]).then(e=>dt(e.diff))}}),Ye.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return De(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([4,5])).then(e=>dt(e.dockerFile))}}),Ye.of({name:"DTD",extensions:["dtd"],load(){return De(()=>import("./dtd-DF_7sFjM.js"),[]).then(e=>dt(e.dtd))}}),Ye.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return De(()=>import("./dylan-DwRh75JA.js"),[]).then(e=>dt(e.dylan))}}),Ye.of({name:"EBNF",load(){return De(()=>import("./ebnf-CDyGwa7X.js"),[]).then(e=>dt(e.ebnf))}}),Ye.of({name:"ECL",extensions:["ecl"],load(){return De(()=>import("./ecl-Cabwm37j.js"),[]).then(e=>dt(e.ecl))}}),Ye.of({name:"edn",extensions:["edn"],load(){return De(()=>import("./clojure-BMjYHr_A.js"),[]).then(e=>dt(e.clojure))}}),Ye.of({name:"Eiffel",extensions:["e"],load(){return De(()=>import("./eiffel-CnydiIhH.js"),[]).then(e=>dt(e.eiffel))}}),Ye.of({name:"Elm",extensions:["elm"],load(){return De(()=>import("./elm-vLlmbW-K.js"),[]).then(e=>dt(e.elm))}}),Ye.of({name:"Erlang",extensions:["erl"],load(){return De(()=>import("./erlang-BNw1qcRV.js"),[]).then(e=>dt(e.erlang))}}),Ye.of({name:"Esper",load(){return De(()=>import("./sql-D0XecflT.js"),[]).then(e=>dt(e.esper))}}),Ye.of({name:"Factor",extensions:["factor"],load(){return De(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([6,5])).then(e=>dt(e.factor))}}),Ye.of({name:"FCL",load(){return De(()=>import("./fcl-Kvtd6kyn.js"),[]).then(e=>dt(e.fcl))}}),Ye.of({name:"Forth",extensions:["forth","fth","4th"],load(){return De(()=>import("./forth-Ffai-XNe.js"),[]).then(e=>dt(e.forth))}}),Ye.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return De(()=>import("./fortran-DYz_wnZ1.js"),[]).then(e=>dt(e.fortran))}}),Ye.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return De(()=>import("./mllike-CXdrOF99.js"),[]).then(e=>dt(e.fSharp))}}),Ye.of({name:"Gas",extensions:["s"],load(){return De(()=>import("./gas-Bneqetm1.js"),[]).then(e=>dt(e.gas))}}),Ye.of({name:"Gherkin",extensions:["feature"],load(){return De(()=>import("./gherkin-heZmZLOM.js"),[]).then(e=>dt(e.gherkin))}}),Ye.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return De(()=>import("./groovy-D9Dt4D0W.js"),[]).then(e=>dt(e.groovy))}}),Ye.of({name:"Haskell",extensions:["hs"],load(){return De(()=>import("./haskell-BWDZoCOh.js"),[]).then(e=>dt(e.haskell))}}),Ye.of({name:"Haxe",extensions:["hx"],load(){return De(()=>import("./haxe-H-WmDvRZ.js"),[]).then(e=>dt(e.haxe))}}),Ye.of({name:"HXML",extensions:["hxml"],load(){return De(()=>import("./haxe-H-WmDvRZ.js"),[]).then(e=>dt(e.hxml))}}),Ye.of({name:"HTTP",load(){return De(()=>import("./http-DBlCnlav.js"),[]).then(e=>dt(e.http))}}),Ye.of({name:"IDL",extensions:["pro"],load(){return De(()=>import("./idl-BEugSyMb.js"),[]).then(e=>dt(e.idl))}}),Ye.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return De(()=>import("./javascript-qCveANmP.js"),[]).then(e=>dt(e.jsonld))}}),Ye.of({name:"Julia",extensions:["jl"],load(){return De(()=>import("./julia-DuME0IfC.js"),[]).then(e=>dt(e.julia))}}),Ye.of({name:"Kotlin",extensions:["kt","kts"],load(){return De(()=>import("./clike-B9uivgTg.js"),[]).then(e=>dt(e.kotlin))}}),Ye.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return De(()=>import("./livescript-BwQOo05w.js"),[]).then(e=>dt(e.liveScript))}}),Ye.of({name:"Lua",extensions:["lua"],load(){return De(()=>import("./lua-BgMRiT3U.js"),[]).then(e=>dt(e.lua))}}),Ye.of({name:"mIRC",extensions:["mrc"],load(){return De(()=>import("./mirc-CjQqDB4T.js"),[]).then(e=>dt(e.mirc))}}),Ye.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return De(()=>import("./mathematica-DTrFuWx2.js"),[]).then(e=>dt(e.mathematica))}}),Ye.of({name:"Modelica",extensions:["mo"],load(){return De(()=>import("./modelica-Dc1JOy9r.js"),[]).then(e=>dt(e.modelica))}}),Ye.of({name:"MUMPS",extensions:["mps"],load(){return De(()=>import("./mumps-BT43cFF4.js"),[]).then(e=>dt(e.mumps))}}),Ye.of({name:"Mbox",extensions:["mbox"],load(){return De(()=>import("./mbox-CNhZ1qSd.js"),[]).then(e=>dt(e.mbox))}}),Ye.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return De(()=>import("./nginx-DdIZxoE0.js"),[]).then(e=>dt(e.nginx))}}),Ye.of({name:"NSIS",extensions:["nsh","nsi"],load(){return De(()=>import("./nsis-LdVXkNf5.js"),__vite__mapDeps([7,5])).then(e=>dt(e.nsis))}}),Ye.of({name:"NTriples",extensions:["nt","nq"],load(){return De(()=>import("./ntriples-BfvgReVJ.js"),[]).then(e=>dt(e.ntriples))}}),Ye.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return De(()=>import("./clike-B9uivgTg.js"),[]).then(e=>dt(e.objectiveC))}}),Ye.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return De(()=>import("./clike-B9uivgTg.js"),[]).then(e=>dt(e.objectiveCpp))}}),Ye.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return De(()=>import("./mllike-CXdrOF99.js"),[]).then(e=>dt(e.oCaml))}}),Ye.of({name:"Octave",extensions:["m"],load(){return De(()=>import("./octave-Ck1zUtKM.js"),[]).then(e=>dt(e.octave))}}),Ye.of({name:"Oz",extensions:["oz"],load(){return De(()=>import("./oz-BzwKVEFT.js"),[]).then(e=>dt(e.oz))}}),Ye.of({name:"Pascal",extensions:["p","pas"],load(){return De(()=>import("./pascal--L3eBynH.js"),[]).then(e=>dt(e.pascal))}}),Ye.of({name:"Perl",extensions:["pl","pm"],load(){return De(()=>import("./perl-CdXCOZ3F.js"),[]).then(e=>dt(e.perl))}}),Ye.of({name:"Pig",extensions:["pig"],load(){return De(()=>import("./pig-CevX1Tat.js"),[]).then(e=>dt(e.pig))}}),Ye.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return De(()=>import("./powershell-CFHJl5sT.js"),[]).then(e=>dt(e.powerShell))}}),Ye.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return De(()=>import("./properties-C78fOPTZ.js"),[]).then(e=>dt(e.properties))}}),Ye.of({name:"ProtoBuf",extensions:["proto"],load(){return De(()=>import("./protobuf-ChK-085T.js"),[]).then(e=>dt(e.protobuf))}}),Ye.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return De(()=>import("./pug-DukmZTjD.js"),__vite__mapDeps([8,9])).then(e=>dt(e.pug))}}),Ye.of({name:"Puppet",extensions:["pp"],load(){return De(()=>import("./puppet-DMA9R1ak.js"),[]).then(e=>dt(e.puppet))}}),Ye.of({name:"Q",extensions:["q"],load(){return De(()=>import("./q-pXgVlZs6.js"),[]).then(e=>dt(e.q))}}),Ye.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return De(()=>import("./r-DUYO_cvP.js"),[]).then(e=>dt(e.r))}}),Ye.of({name:"RPM Changes",load(){return De(()=>import("./rpm-CTu-6PCP.js"),[]).then(e=>dt(e.rpmChanges))}}),Ye.of({name:"RPM Spec",extensions:["spec"],load(){return De(()=>import("./rpm-CTu-6PCP.js"),[]).then(e=>dt(e.rpmSpec))}}),Ye.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return De(()=>import("./ruby-B2Rjki9n.js"),[]).then(e=>dt(e.ruby))}}),Ye.of({name:"SAS",extensions:["sas"],load(){return De(()=>import("./sas-B4kiWyti.js"),[]).then(e=>dt(e.sas))}}),Ye.of({name:"Scala",extensions:["scala"],load(){return De(()=>import("./clike-B9uivgTg.js"),[]).then(e=>dt(e.scala))}}),Ye.of({name:"Scheme",extensions:["scm","ss"],load(){return De(()=>import("./scheme-C41bIUwD.js"),[]).then(e=>dt(e.scheme))}}),Ye.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return De(()=>import("./shell-CjFT_Tl9.js"),[]).then(e=>dt(e.shell))}}),Ye.of({name:"Sieve",extensions:["siv","sieve"],load(){return De(()=>import("./sieve-C3Gn_uJK.js"),[]).then(e=>dt(e.sieve))}}),Ye.of({name:"Smalltalk",extensions:["st"],load(){return De(()=>import("./smalltalk-CnHTOXQT.js"),[]).then(e=>dt(e.smalltalk))}}),Ye.of({name:"Solr",load(){return De(()=>import("./solr-DehyRSwq.js"),[]).then(e=>dt(e.solr))}}),Ye.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return De(()=>import("./mllike-CXdrOF99.js"),[]).then(e=>dt(e.sml))}}),Ye.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return De(()=>import("./sparql-DkYu6x3z.js"),[]).then(e=>dt(e.sparql))}}),Ye.of({name:"Spreadsheet",alias:["excel","formula"],load(){return De(()=>import("./spreadsheet-BCZA_wO0.js"),[]).then(e=>dt(e.spreadsheet))}}),Ye.of({name:"Squirrel",extensions:["nut"],load(){return De(()=>import("./clike-B9uivgTg.js"),[]).then(e=>dt(e.squirrel))}}),Ye.of({name:"Stylus",extensions:["styl"],load(){return De(()=>import("./stylus-B533Al4x.js"),[]).then(e=>dt(e.stylus))}}),Ye.of({name:"Swift",extensions:["swift"],load(){return De(()=>import("./swift-BzpIVaGY.js"),[]).then(e=>dt(e.swift))}}),Ye.of({name:"sTeX",load(){return De(()=>import("./stex-C3f8Ysf7.js"),[]).then(e=>dt(e.stex))}}),Ye.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return De(()=>import("./stex-C3f8Ysf7.js"),[]).then(e=>dt(e.stex))}}),Ye.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return De(()=>import("./verilog-C6RDOZhf.js"),[]).then(e=>dt(e.verilog))}}),Ye.of({name:"Tcl",extensions:["tcl"],load(){return De(()=>import("./tcl-DVfN8rqt.js"),[]).then(e=>dt(e.tcl))}}),Ye.of({name:"Textile",extensions:["textile"],load(){return De(()=>import("./textile-CnDTJFAw.js"),[]).then(e=>dt(e.textile))}}),Ye.of({name:"TiddlyWiki",load(){return De(()=>import("./tiddlywiki-DO-Gjzrf.js"),[]).then(e=>dt(e.tiddlyWiki))}}),Ye.of({name:"Tiki wiki",load(){return De(()=>import("./tiki-DGYXhP31.js"),[]).then(e=>dt(e.tiki))}}),Ye.of({name:"TOML",extensions:["toml"],load(){return De(()=>import("./toml-Bm5Em-hy.js"),[]).then(e=>dt(e.toml))}}),Ye.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return De(()=>import("./troff-wAsdV37c.js"),[]).then(e=>dt(e.troff))}}),Ye.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return De(()=>import("./ttcn-CfJYG6tj.js"),[]).then(e=>dt(e.ttcn))}}),Ye.of({name:"TTCN_CFG",extensions:["cfg"],load(){return De(()=>import("./ttcn-cfg-B9xdYoR4.js"),[]).then(e=>dt(e.ttcnCfg))}}),Ye.of({name:"Turtle",extensions:["ttl"],load(){return De(()=>import("./turtle-B1tBg_DP.js"),[]).then(e=>dt(e.turtle))}}),Ye.of({name:"Web IDL",extensions:["webidl"],load(){return De(()=>import("./webidl-ZXfAyPTL.js"),[]).then(e=>dt(e.webIDL))}}),Ye.of({name:"VB.NET",extensions:["vb"],load(){return De(()=>import("./vb-CmGdzxic.js"),[]).then(e=>dt(e.vb))}}),Ye.of({name:"VBScript",extensions:["vbs"],load(){return De(()=>import("./vbscript-BuJXcnF6.js"),[]).then(e=>dt(e.vbScript))}}),Ye.of({name:"Velocity",extensions:["vtl"],load(){return De(()=>import("./velocity-D8B20fx6.js"),[]).then(e=>dt(e.velocity))}}),Ye.of({name:"Verilog",extensions:["v"],load(){return De(()=>import("./verilog-C6RDOZhf.js"),[]).then(e=>dt(e.verilog))}}),Ye.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return De(()=>import("./vhdl-lSbBsy5d.js"),[]).then(e=>dt(e.vhdl))}}),Ye.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return De(()=>import("./xquery-CQfU5ijd.js"),[]).then(e=>dt(e.xQuery))}}),Ye.of({name:"Yacas",extensions:["ys"],load(){return De(()=>import("./yacas-BJ4BC0dw.js"),[]).then(e=>dt(e.yacas))}}),Ye.of({name:"Z80",extensions:["z80"],load(){return De(()=>import("./z80-Hz9HOZM7.js"),[]).then(e=>dt(e.z80))}}),Ye.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return De(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(e=>dt(e.mscgen))}}),Ye.of({name:"Xù",extensions:["xu"],load(){return De(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(e=>dt(e.xu))}}),Ye.of({name:"MsGenny",extensions:["msgenny"],load(){return De(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(e=>dt(e.msgenny))}}),Ye.of({name:"Vue",extensions:["vue"],load(){return De(()=>import("./index-Dv7q-OB0.js"),__vite__mapDeps([10,1])).then(e=>e.vue())}}),Ye.of({name:"Angular Template",load(){return De(()=>import("./index-S-i9egm8.js"),__vite__mapDeps([11,1])).then(e=>e.angular())}})];function oXe(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 Pje();case"json":case"jsonl":return P5e();case"css":return nse();case"scss":return iZ({indented:!1});case"sass":return iZ({indented:!0});case"less":return A5e();case"html":case"htm":return oz();case"xml":case"svg":return Hje();case"md":case"mdx":case"markdown":return fje();case"yaml":case"yml":return iXe();case"rs":return Nje();case"go":return GLe();case"java":return C5e();case"c":case"h":case"cpp":case"cxx":case"cc":case"hpp":return MLe();case"php":return Oje();case"sql":return Yje();default:return null}}function VZn(e){return Ye.matchFilename(b2t,e)}function cY(e){const t=e.split(".").pop()?.toLowerCase();return{ts:"TypeScript",tsx:"TypeScript (JSX)",js:"JavaScript",jsx:"JavaScript (JSX)",mjs:"JavaScript",cjs:"JavaScript",py:"Python",json:"JSON",jsonl:"JSON Lines",css:"CSS",scss:"SCSS",sass:"Sass",less:"Less",html:"HTML",htm:"HTML",xml:"XML",svg:"SVG",md:"Markdown",mdx:"MDX",markdown:"Markdown",yaml:"YAML",yml:"YAML",rs:"Rust",go:"Go",java:"Java",c:"C",h:"C/C++ Header",cpp:"C++",cxx:"C++",cc:"C++",hpp:"C++ Header",php:"PHP",sql:"SQL",sh:"Shell",bash:"Bash",zsh:"Zsh",toml:"TOML",ini:"INI",conf:"Config",txt:"Plain Text"}[t??""]??"Plain Text"}let bp=null,Z_=null,_x=null;const kp={register(e,t,n){bp=e,Z_=t,_x=n},unregister(){bp=null,Z_=null,_x=null},get isRegistered(){return bp!==null},getContent(e){return bp?.get(e)?.doc.toString()??null},getAllModifiedContent(e){const t=new Map;for(const n of Object.keys(e)){if(!e[n])continue;const r=bp?.get(n)?.doc.toString();r!==void 0&&t.set(n,r)}return t},deleteState(e){bp?.delete(e),Z_?.delete(e)},destroy(){_x?.destroy(),bp?.clear(),Z_?.clear(),_x=null},remapState(e,t){const n=bp?.get(e);n&&(bp.delete(e),bp.set(t,n));const r=Z_?.get(e);r!==void 0&&(Z_.delete(e),Z_.set(t,r))},updateView(e){_x=e},getView(){return _x}},y2t=1e4;let uC=null;const gZ=new Set;function x2t(e){return gZ.add(e),()=>gZ.delete(e)}function S2t(){uC=null,gZ.forEach(e=>e())}function tk(e){return uC?.projectPath===e&&Date.now()-uC.timestamp<y2t?{files:uC.files}:null}function aXe(e,t){uC={files:t,projectPath:e,timestamp:Date.now()}}function OI(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 bs=to("Store:editor");function ui(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}const ld=new Map,v2t=2e3;let uY=null;const T2t=1500,dY=new Map,E2t=350;let pY=null,_I={change:0,create:0,delete:0},U0=null,AL="",z0=null,IL="";const w2t=250,k2t=120;function M1(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}
|
|
1052
|
+
`;function jje(e,t,n){let r=Object.create(null);r.true=r.false=RMt,r.null=r.unknown=PMt;for(let s of e.split(" "))s&&(r[s]=Dje);for(let s of t.split(" "))s&&(r[s]=Lje);for(let s of(n||"").split(" "))s&&(r[s]=FMt);return r}const jy="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 ",Xy="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 ",lZ={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:jje(Xy,jy)};function GMt(e,t,n,r){let s={};for(let i in lZ)s[i]=(e.hasOwnProperty(i)?e:lZ)[i];return t&&(s.words=jje(t,n||"",r)),s}function Xje(e){return new Wn(t=>{var n;let{next:r}=t;if(t.advance(),H_(r,sY)){for(;H_(t.next,sY);)t.advance();t.acceptToken(kMt)}else if(r==36&&e.doubleDollarQuotedStrings){let s=aZ(t,"");t.next==36&&(t.advance(),VMt(t,s),t.acceptToken(Ox))}else if(r==39||r==34&&e.doubleQuotedStrings)h0(t,r,e.backslashEscapes),t.acceptToken(Ox);else if(r==35&&e.hashComments||r==47&&t.next==47&&e.slashComments)Xge(t),t.acceptToken(Mge);else if(r==45&&t.next==45&&(!e.spaceAfterDashes||t.peek(1)==32))Xge(t),t.acceptToken(Mge);else if(r==47&&t.next==42){t.advance();for(let s=1;;){let i=t.next;if(t.next<0)break;if(t.advance(),i==42&&t.next==47){if(s--,t.advance(),!s)break}else i==47&&t.next==42&&(s++,t.advance())}t.acceptToken(CMt)}else if((r==101||r==69)&&t.next==39)t.advance(),h0(t,39,!0),t.acceptToken(Ox);else if((r==110||r==78)&&t.next==39&&e.charSetCasts)t.advance(),h0(t,39,e.backslashEscapes),t.acceptToken(Ox);else if(r==95&&e.charSetCasts)for(let s=0;;s++){if(t.next==39&&s>1){t.advance(),h0(t,39,e.backslashEscapes),t.acceptToken(Ox);break}if(!oZ(t.next))break;t.advance()}else if(e.plsqlQuotingMechanism&&(r==113||r==81)&&t.next==39&&t.peek(1)>0&&!H_(t.peek(1),sY)){let s=t.peek(1);t.advance(2),qMt(t,s),t.acceptToken(Ox)}else if(H_(r,e.identifierQuotes)){const s=r==91?93:r;h0(t,s,!1),t.acceptToken(zMt)}else if(r==40)t.acceptToken($Mt);else if(r==41)t.acceptToken(NMt);else if(r==123)t.acceptToken(AMt);else if(r==125)t.acceptToken(IMt);else if(r==91)t.acceptToken(MMt);else if(r==93)t.acceptToken(QMt);else if(r==59)t.acceptToken(DMt);else if(e.unquotedBitLiterals&&r==48&&t.next==98)t.advance(),Lge(t),t.acceptToken(Dge);else if((r==98||r==66)&&(t.next==39||t.next==34)){const s=t.next;t.advance(),e.treatBitsAsBytes?(h0(t,s,e.backslashEscapes),t.acceptToken(BMt)):(Lge(t,s),t.acceptToken(Dge))}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();YMt(t.next);)t.advance();s&&t.next==39&&t.advance(),t.acceptToken(rY)}else if(r==46&&t.next>=48&&t.next<=57)jge(t,!0),t.acceptToken(rY);else if(r==46)t.acceptToken(LMt);else if(r>=48&&r<=57)jge(t,!1),t.acceptToken(rY);else if(H_(r,e.operatorChars)){for(;H_(t.next,e.operatorChars);)t.advance();t.acceptToken(jMt)}else if(H_(r,e.specialVar))t.next==r&&t.advance(),WMt(t),t.acceptToken(UMt);else if(r==58||r==44)t.acceptToken(XMt);else if(oZ(r)){let s=aZ(t,String.fromCharCode(r));t.acceptToken(t.next==46||t.peek(-s.length-1)==46?Qge:(n=e.words[s.toLowerCase()])!==null&&n!==void 0?n:Qge)}})}const Uje=Xje(lZ),HMt=So.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,Uje],topRules:{Script:[0,25]},tokenPrec:0});function cZ(e){let t=e.cursor().moveTo(e.from,-1);for(;/Comment/.test(t.name);)t.moveTo(t.from,-1);return t.node}function sP(e,t){let n=e.sliceString(t.from,t.to),r=/^([`'"\[])(.*)([`'"\]])$/.exec(n);return r?r[2]:n}function PL(e){return e&&(e.name=="Identifier"||e.name=="QuotedIdentifier")}function ZMt(e,t){if(t.name=="CompositeIdentifier"){let n=[];for(let r=t.firstChild;r;r=r.nextSibling)PL(r)&&n.push(sP(e,r));return n}return[sP(e,t)]}function Uge(e,t){for(let n=[];;){if(!t||t.name!=".")return n;let r=cZ(t);if(!PL(r))return n;n.unshift(sP(e,r)),t=cZ(r)}}function KMt(e,t){let n=is(e).resolveInner(t,-1),r=eQt(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:Uge(e.doc,cZ(n)),aliases:r}:n.name=="."?{from:t,quoted:null,parents:Uge(e.doc,n),aliases:r}:{from:t,quoted:null,parents:[],empty:!0,aliases:r}}const JMt=new Set("where group having order union intersect except all distinct limit offset fetch for".split(" "));function eQt(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&&PL(s.nextSibling))c=sP(e,s.nextSibling);else{if(a&&JMt.has(a))break;o&&PL(s)&&(c=sP(e,s))}c&&(r||(r=Object.create(null)),r[c]=ZMt(e,o)),o=/Identifier$/.test(s.name)?s:null}return r}function tQt(e,t,n){return n.map(r=>({...r,label:r.label[0]==e?r.label:e+r.label+t,apply:void 0}))}const nQt=/^\w*$/,rQt=/^[`'"\[]?\w*[`'"\]]?$/;function zge(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(Bge(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"?Bge(n,"property",this.idQuote,this.idCaseInsensitive):n)}addNamespace(t){Array.isArray(t)?this.addCompletions(t):zge(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;zge(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 Bge(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+zje(n)}}function zje(e){return e==="["?"]":e}function sQt(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:g}=KMt(d.state,d.pos);if(m&&!d.explicit)return null;g&&p.length==1&&(p=g[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&&g&&(b=b.concat(Object.keys(g).map(y=>({label:y,type:"constant"})))),h){let y=h[0],x=zje(y),S=d.state.sliceDoc(d.pos,d.pos+1)==x;return{from:f,to:S?d.pos+1:void 0,options:tQt(y,x,b),validFor:rQt}}else return{from:f,options:b,validFor:nQt}}}function iQt(e){return e==Lje?"type":e==Dje?"keyword":"variable"}function oQt(e,t,n){let r=Object.keys(e).map(s=>n(t?s.toUpperCase():s,iQt(e[s])));return iz(["QuotedIdentifier","String","LineComment","BlockComment","."],sz(r))}let aQt=HMt.configure({props:[wo.add({Statement:Ei()}),ko.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}}}),Eo({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 Hu{constructor(t,n,r){this.dialect=t,this.language=n,this.spec=r}get extension(){return this.language.extension}configureLanguage(t,n){return new Hu(this.dialect,this.language.configure(t,n),this.spec)}static define(t){let n=GMt(t,t.keywords,t.types,t.builtin),r=vo.define({name:"sql",parser:aQt.configure({tokenizers:[{from:Uje,to:Xje(n)}]}),languageData:{commentTokens:{line:"--",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}});return new Hu(n,r,t)}}function lQt(e,t){return{label:e,type:t,boost:-1}}function Bje(e,t=!1,n){return oQt(e.dialect.words,t,n||lQt)}function Fje(e){return e.schema?sQt(e.schema,e.tables,e.schemas,e.defaultTable,e.defaultSchema,e.dialect||uz):()=>null}function cQt(e){return e.schema?(e.dialect||uz).language.data.of({autocomplete:Fje(e)}):[]}function Yje(e={}){let t=e.dialect||uz;return new Ki(t.language,[cQt(e),t.language.data.of({autocomplete:Bje(t,e.upperCaseKeywords,e.keywordCompletion)})])}const uz=Hu.define({}),uQt=Hu.define({charSetCasts:!0,doubleDollarQuotedStrings:!0,operatorChars:"+-*/<>=~!@#%^&|`?",specialVar:"",keywords:Xy+"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:jy+"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"}),Vje="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",qje=jy+"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",Wje="charset clear edit ego help nopager notee nowarning pager print prompt quit rehash source status system tee",dQt=Hu.define({operatorChars:"*+-%<>!=&|^",charSetCasts:!0,doubleQuotedStrings:!0,unquotedBitLiterals:!0,hashComments:!0,spaceAfterDashes:!0,specialVar:"@?",identifierQuotes:"`",keywords:Xy+"group_concat "+Vje,types:qje,builtin:Wje}),pQt=Hu.define({operatorChars:"*+-%<>!=&|^",charSetCasts:!0,doubleQuotedStrings:!0,unquotedBitLiterals:!0,hashComments:!0,spaceAfterDashes:!0,specialVar:"@?",identifierQuotes:"`",keywords:Xy+"always generated groupby_concat hard persistent shutdown soft virtual "+Vje,types:qje,builtin:Wje});let fQt="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 hQt=Hu.define({keywords:Xy+"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:jy+"smalldatetime datetimeoffset datetime2 datetime bigint smallint smallmoney tinyint money real text nvarchar ntext varbinary image hierarchyid uniqueidentifier sql_variant xml",builtin:fQt,operatorChars:"*+-%<>!=^&|/",specialVar:"@",identifierQuotes:'"['}),mQt=Hu.define({keywords:Xy+"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:jy+"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:"@:?$"}),gQt=Hu.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:jy+"ascii bigint blob counter frozen inet list map static text timeuuid tuple uuid varint",slashComments:!0}),OQt=Hu.define({keywords:Xy+"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:jy+"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}),_Qt=Object.freeze(Object.defineProperty({__proto__:null,Cassandra:gQt,MSSQL:hQt,MariaSQL:pQt,MySQL:dQt,PLSQL:OQt,PostgreSQL:uQt,SQLDialect:Hu,SQLite:mQt,StandardSQL:uz,keywordCompletionSource:Bje,schemaCompletionSource:Fje,sql:Yje},Symbol.toStringTag,{value:"Module"})),uZ=1,bQt=2,yQt=3,xQt=4,SQt=5,vQt=36,TQt=37,EQt=38,wQt=11,kQt=13;function CQt(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function RQt(e){return e==9||e==10||e==13||e==32}let Fge=null,Yge=null,Vge=0;function dZ(e,t){let n=e.pos+t;if(Yge==e&&Vge==n)return Fge;for(;RQt(e.peek(t));)t++;let r="";for(;;){let s=e.peek(t);if(!CQt(s))break;r+=String.fromCharCode(s),t++}return Yge=e,Vge=n,Fge=r||null}function qge(e,t){this.name=e,this.parent=t}const PQt=new Ly({start:null,shift(e,t,n,r){return t==uZ?new qge(dZ(r,1)||"",e):e},reduce(e,t){return t==wQt&&e?e.parent:e},reuse(e,t,n,r){let s=t.type.id;return s==uZ||s==kQt?new qge(dZ(r,1)||"",e):e},strict:!1}),$Qt=new Wn((e,t)=>{if(e.next==60){if(e.advance(),e.next==47){e.advance();let n=dZ(e,0);if(!n)return e.acceptToken(SQt);if(t.context&&n==t.context.name)return e.acceptToken(bQt);for(let r=t.context;r;r=r.parent)if(r.name==n)return e.acceptToken(yQt,-2);e.acceptToken(xQt)}else if(e.next!=33&&e.next!=63)return e.acceptToken(uZ)}},{contextual:!0});function Rse(e,t){return new Wn(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 NQt=Rse(vQt,"-->"),AQt=Rse(TQt,"?>"),IQt=Rse(EQt,"]]>"),MQt=Eo({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)}),QQt=So.deserialize({version:14,states:",lOQOaOOOrOxO'#CfOzOpO'#CiO!tOaO'#CgOOOP'#Cg'#CgO!{OrO'#CrO#TOtO'#CsO#]OpO'#CtOOOP'#DT'#DTOOOP'#Cv'#CvQQOaOOOOOW'#Cw'#CwO#eOxO,59QOOOP,59Q,59QOOOO'#Cx'#CxO#mOpO,59TO#uO!bO,59TOOOP'#C|'#C|O$TOaO,59RO$[OpO'#CoOOOP,59R,59ROOOQ'#C}'#C}O$dOrO,59^OOOP,59^,59^OOOS'#DO'#DOO$lOtO,59_OOOP,59_,59_O$tOpO,59`O$|OpO,59`OOOP-E6t-E6tOOOW-E6u-E6uOOOP1G.l1G.lOOOO-E6v-E6vO%UO!bO1G.oO%UO!bO1G.oO%dOpO'#CkO%lO!bO'#CyO%zO!bO1G.oOOOP1G.o1G.oOOOP1G.w1G.wOOOP-E6z-E6zOOOP1G.m1G.mO&VOpO,59ZO&_OpO,59ZOOOQ-E6{-E6{OOOP1G.x1G.xOOOS-E6|-E6|OOOP1G.y1G.yO&gOpO1G.zO&gOpO1G.zOOOP1G.z1G.zO&oO!bO7+$ZO&}O!bO7+$ZOOOP7+$Z7+$ZOOOP7+$c7+$cO'YOpO,59VO'bOpO,59VO'mO!bO,59eOOOO-E6w-E6wO'{OpO1G.uO'{OpO1G.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!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:PQt,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:[MQt],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#P#Q!'W#Q#R$q#R#S4n#S#T$q#T#o4n#o%W$q%W%o4n%o%p$q%p&a4n&a&b$q&b1p4n1p4U$q4U4d4n4d4e$q4e$IS4n$IS$I`$q$I`$Ib4n$Ib$Kh$q$Kh%#t4n%#t&/x$q&/x&Et4n&Et&FV$q&FV;'S4n;'S;:j8O;:j;=`)c<%l?&r$q?&r?Ah4n?Ah?BY$q?BY?Mn4n?MnO$qi$zXVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qa%nVVP!O`Ov%gwx&Tx!^%g!^!_&o!_;'S%g;'S;=`'W<%lO%gP&YTVPOv&Tw!^&T!_;'S&T;'S;=`&i<%lO&TP&lP;=`<%l&T`&tS!O`Ov&ox;'S&o;'S;=`'Q<%lO&o`'TP;=`<%l&oa'ZP;=`<%l%gX'eWVP|WOr'^rs&Tsv'^w!^'^!^!_'}!_;'S'^;'S;=`(i<%lO'^W(ST|WOr'}sv'}w;'S'};'S;=`(c<%lO'}W(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'}x#m(o#m#n! n#n;'S(o;'S;=`)]<%lO(oi! uX|W!O`Or(ors&osv(owx'}x#d(o#d#e!!b#e;'S(o;'S;=`)]<%lO(oi!!iX|W!O`Or(ors&osv(owx'}x#X(o#X#Y?y#Y;'S(o;'S;=`)]<%lO(oi!#_V!SP|W!O`Or(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(ok!$PXaQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qo!$wX[UVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(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:[$Qt,NQt,AQt,IQt,0,1,2,3,4],topRules:{Document:[0,6]},tokenPrec:0});function WQ(e,t){let n=t&&t.getChild("TagName");return n?e.sliceString(n.from,n.to):""}function iY(e,t){let n=t&&t.firstChild;return!n||n.name!="OpenTag"?"":WQ(e,n)}function DQt(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 oY(e){for(let t=e&&e.parent;t;t=t.parent)if(t.name=="Element")return t;return null}function LQt(e,t){var n;let r=is(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:oY(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:oY(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:oY(r)}:null}let jQt=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 aY=/^[:\-\.\w\u00b7-\uffff]*$/;function Wge(e){return Object.assign(Object.assign({type:"property"},e.completion||{}),{label:e.name})}function Gge(e){return typeof e=="string"?{label:`"${e}"`,type:"constant"}:/^"/.test(e.label)?e:Object.assign(Object.assign({},e),{label:`"${e.label}"`})}function Gje(e,t){let n=[],r=[],s=Object.create(null);for(let c of t){let l=Wge(c);n.push(l),c.global&&r.push(l),c.values&&(s[c.name]=c.values.map(Gge))}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(Gge)),Wge(f)))));let p=new jQt(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=LQt(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 g=o,_=iY(d,m);if(_){let b=a[_];g=b?.children||i}return{from:h,options:g.map(b=>b.completion),validFor:aY}}else if(f=="closeTag"){let g=iY(d,m);return g?{from:h,to:c.pos+(d.sliceString(c.pos,c.pos+1)==">"?1:0),options:[((l=a[g])===null||l===void 0?void 0:l.closeNameCompletion)||{label:g+">",type:"type"}],validFor:aY}:null}else if(f=="attrName"){let g=a[WQ(d,m)];return{from:h,options:g?.attrs||r,validFor:aY}}else if(f=="attrValue"){let g=DQt(d,m,h);if(!g)return null;let _=a[WQ(d,m)],b=(_?.attrValues||s)[g];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 g=iY(d,m),_=a[g],b=[],y=m&&m.lastChild;g&&(!y||y.name!="CloseTag"||WQ(d,y)!=g)&&b.push(_?_.closeCompletion:{label:"</"+g+">",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 $L=vo.define({name:"xml",parser:QQt.configure({props:[wo.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}}),ko.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 Hje(e={}){let t=[$L.data.of({autocomplete:Gje(e.elements||[],e.attributes||[])})];return e.autoCloseTags!==!1&&t.push(Zje),new Ki($L,t)}function Hge(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 Zje=Gt.inputHandler.of((e,t,n,r,s)=>{if(e.composing||e.state.readOnly||t!=n||r!=">"&&r!="/"||!$L.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=is(o).resolveInner(f,-1),g;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"&&(g=Hge(o.doc,_.parent,f))){let b=f+(o.doc.sliceString(f,f+1)===">"?1:0),y=`</${g}>`;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"&&(g=Hge(o.doc,_,f))){let b=f+(o.doc.sliceString(f,f+1)===">"?1:0),y=`${g}>`;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)}),XQt=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:Zje,completeFromSchema:Gje,xml:Hje,xmlLanguage:$L},Symbol.toStringTag,{value:"Module"})),eS=63,Zge=64,UQt=1,zQt=2,Kje=3,BQt=4,Jje=5,FQt=6,YQt=7,eXe=65,VQt=66,qQt=8,WQt=9,GQt=10,HQt=11,ZQt=12,tXe=13,KQt=19,JQt=20,e2t=29,t2t=33,n2t=34,r2t=47,s2t=0,Pse=1,pZ=2,iP=3,fZ=4;let C0=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}};C0.top=new C0(null,-1,s2t);function cC(e,t){for(let n=0,r=t-e.pos-1;;r--,n++){let s=e.peek(r);if(vm(s)||s==-1)return n}}function hZ(e){return e==32||e==9}function vm(e){return e==10||e==13}function nXe(e){return hZ(e)||vm(e)}function X0(e){return e<0||nXe(e)}const i2t=new Ly({start:C0.top,reduce(e,t){return e.type==iP&&(t==JQt||t==n2t)?e.parent:e},shift(e,t,n,r){if(t==Kje)return new C0(e,cC(r,r.pos),Pse);if(t==eXe||t==Jje)return new C0(e,cC(r,r.pos),pZ);if(t==eS)return e.parent;if(t==KQt||t==t2t)return new C0(e,0,iP);if(t==tXe&&e.type==fZ)return e.parent;if(t==r2t){let s=/[1-9]/.exec(r.read(r.pos,n.pos));if(s)return new C0(e,e.depth+ +s[0],fZ)}return e},hash(e){return e.hash}});function OT(e,t,n=0){return e.peek(n)==t&&e.peek(n+1)==t&&e.peek(n+2)==t&&X0(e.peek(n+3))}const o2t=new Wn((e,t)=>{if(e.next==-1&&t.canShift(Zge))return e.acceptToken(Zge);let n=e.peek(-1);if((vm(n)||n<0)&&t.context.type!=iP){if(OT(e,45))if(t.canShift(eS))e.acceptToken(eS);else return e.acceptToken(UQt,3);if(OT(e,46))if(t.canShift(eS))e.acceptToken(eS);else return e.acceptToken(zQt,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||!X0(e.peek(1))))&&e.next!=-1&&!vm(e.next)&&e.next!=35&&e.acceptToken(eS,-r)}},{contextual:!0}),a2t=new Wn((e,t)=>{if(t.context.type==iP){e.next==63&&(e.advance(),X0(e.next)&&e.acceptToken(YQt));return}if(e.next==45)e.advance(),X0(e.next)&&e.acceptToken(t.context.type==Pse&&t.context.depth==cC(e,e.pos-1)?BQt:Kje);else if(e.next==63)e.advance(),X0(e.next)&&e.acceptToken(t.context.type==pZ&&t.context.depth==cC(e,e.pos-1)?FQt:Jje);else{let n=e.pos;for(;;)if(hZ(e.next)){if(e.pos==n)return;e.advance()}else if(e.next==33)rXe(e);else if(e.next==38)mZ(e);else if(e.next==42){mZ(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(!c2t(e))return;break}else{sXe(e,!0,!1,0);break}for(;hZ(e.next);)e.advance();if(e.next==58){if(e.pos==n&&t.canShift(e2t))return;let r=e.peek(1);X0(r)&&e.acceptTokenTo(t.context.type==pZ&&t.context.depth==cC(e,n)?VQt:eXe,n)}}},{contextual:!0});function l2t(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 Kge(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function Jge(e,t){return e.next==37?(e.advance(),Kge(e.next)&&e.advance(),Kge(e.next)&&e.advance(),!0):l2t(e.next)||t&&e.next==44?(e.advance(),!0):!1}function rXe(e){if(e.advance(),e.next==60){for(e.advance();;)if(!Jge(e,!0)){e.next==62&&e.advance();break}}else for(;Jge(e,!1););}function mZ(e){for(e.advance();!X0(e.next)&&NL(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(vm(i)){if(t)return!1;r=!0}else if(t&&e.pos>=s+1024)return!1}return!r}function c2t(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||vm(e.next))return!1;e.advance()}}const u2t="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function NL(e){return e<33?"u":e>125?"s":u2t[e-33]}function lY(e,t){let n=NL(e);return n!="u"&&!(t&&n=="f")}function sXe(e,t,n,r){if(NL(e.next)=="s"||(e.next==63||e.next==58||e.next==45)&&lY(e.peek(1),n))e.advance();else return!1;let s=e.pos;for(;;){let i=e.next,o=0,a=r+1;for(;nXe(i);){if(vm(i)){if(t)return!1;a=0}else a++;i=e.peek(++o)}if(!(i>=0&&(i==58?lY(e.peek(o+1),n):i==35?e.peek(o-1)!=32:lY(i,n)))||!n&&a<=r||a==0&&!n&&(OT(e,45,o)||OT(e,46,o)))break;if(t&&NL(i)=="f")return!1;for(let l=o;l>=0;l--)e.advance();if(t&&e.pos>s+1024)return!1}return!0}const d2t=new Wn((e,t)=>{if(e.next==33)rXe(e),e.acceptToken(ZQt);else if(e.next==38||e.next==42){let n=e.next==38?GQt:HQt;mZ(e),e.acceptToken(n)}else e.next==39||e.next==34?($se(e,!1),e.acceptToken(WQt)):sXe(e,!1,t.context.type==iP,t.context.depth)&&e.acceptToken(qQt)}),p2t=new Wn((e,t)=>{let n=t.context.type==fZ?t.context.depth:-1,r=e.pos;e:for(;;){let s=0,i=e.next;for(;i==32;)i=e.peek(++s);if(!s&&(OT(e,45,s)||OT(e,46,s))||!vm(i)&&(n<0&&(n=Math.max(t.context.depth+1,s)),s<n))break;for(;;){if(e.next<0)break e;let o=vm(e.next);if(e.advance(),o)continue e;r=e.pos}}e.acceptTokenTo(tXe,r)}),f2t=Eo({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}),h2t=So.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'#CwOOQO'#Cv'#CvO+wQdO'#CvOOQO'#Cq'#CqO,UQ`O,59[O,^QfO,59[OOQR,59[,59[OOQO'#Cx'#CxO,eQ`O'#DPO,pQdO'#DPOOQO'#Dx'#DxO,zQdO'#DxO-XQ`O,59jO-aQfO,59jOOQR,59j,59jOOQR'#DS'#DSO-hQcO,59mO-sQgO'#DVO.TQ`O'#DVO.YQcO,59pOOQR'#DX'#DXO#|QfO'#DWO.hQcO'#DWOOQR,59v,59vO.yOWO,59vO/OOaO,59vO/WOaO,59vO/cQgO'#D_OOQR,59x,59xO0VQgO'#DaOOQR,59z,59zOOQP,59|,59|O0yOaO,59|O1ROaO,59|O1aOqO,59|OOQP-E7h-E7hO1oQgO,59XOOQP,59X,59XO2PQaO'#DeO2_QgO'#DeO2oQgO'#DkOOQP'#Dk'#DkQ)jQaOOO3PQdO'#CsOOQO,59^,59^O3kQdO'#CuOOQO,59`,59`OOQO,59c,59cO4VQdO,59cO4aQdO'#CzO4kQ`O'#CzOOQO,59b,59bOOQU,5:Q,5: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n^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:i2t,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[f2t],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#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[o2t,a2t,d2t,p2t,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),m2t=So.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=vo.define({name:"yaml",parser:h2t.configure({props:[wo.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:gf({closing:"}"}),FlowSequence:gf({closing:"]"})}),ko.add({"FlowMapping FlowSequence":rd,"Item Pair BlockLiteral":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function iXe(){return new Ki(Nse)}const g2t=vo.define({name:"yaml-frontmatter",parser:m2t.configure({props:[Eo({DashLine:X.meta})]})});function O2t(e){let{language:t,support:n}=e.content instanceof Ki?e.content:{language:e.content,support:[]};return new Ki(g2t.configure({wrap:BU(r=>r.name=="FrontmatterContent"?{parser:Nse.parser}:r.name=="Body"?{parser:t.parser}:null)}),n)}const _2t=Object.freeze(Object.defineProperty({__proto__:null,yaml:iXe,yamlFrontmatter:O2t,yamlLanguage:Nse},Symbol.toStringTag,{value:"Module"}));function dt(e){return new Ki(Kre.define(e))}function lg(e){return De(()=>Promise.resolve().then(()=>_Qt),void 0).then(t=>t.sql({dialect:t[e]}))}const b2t=[Ye.of({name:"C",extensions:["c","h","ino"],load(){return De(()=>Promise.resolve().then(()=>vme),void 0).then(e=>e.cpp())}}),Ye.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return De(()=>Promise.resolve().then(()=>vme),void 0).then(e=>e.cpp())}}),Ye.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return lg("Cassandra")}}),Ye.of({name:"CSS",extensions:["css"],load(){return De(()=>Promise.resolve().then(()=>OCt),void 0).then(e=>e.css())}}),Ye.of({name:"Go",extensions:["go"],load(){return De(()=>Promise.resolve().then(()=>cRt),void 0).then(e=>e.go())}}),Ye.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return De(()=>Promise.resolve().then(()=>jPt),void 0).then(e=>e.html())}}),Ye.of({name:"Java",extensions:["java"],load(){return De(()=>Promise.resolve().then(()=>BPt),void 0).then(e=>e.java())}}),Ye.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return De(()=>Promise.resolve().then(()=>dI),void 0).then(e=>e.javascript())}}),Ye.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return De(()=>import("./index-C_F9N5x-.js"),__vite__mapDeps([0,1])).then(e=>e.jinja())}}),Ye.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return De(()=>Promise.resolve().then(()=>WPt),void 0).then(e=>e.json())}}),Ye.of({name:"JSX",extensions:["jsx"],load(){return De(()=>Promise.resolve().then(()=>dI),void 0).then(e=>e.javascript({jsx:!0}))}}),Ye.of({name:"LESS",extensions:["less"],load(){return De(()=>Promise.resolve().then(()=>i$t),void 0).then(e=>e.less())}}),Ye.of({name:"Liquid",extensions:["liquid"],load(){return De(()=>import("./index-DuUaf8at.js"),__vite__mapDeps([2,1])).then(e=>e.liquid())}}),Ye.of({name:"MariaDB SQL",load(){return lg("MariaSQL")}}),Ye.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return De(()=>Promise.resolve().then(()=>z$t),void 0).then(e=>e.markdown())}}),Ye.of({name:"MS SQL",load(){return lg("MSSQL")}}),Ye.of({name:"MySQL",load(){return lg("MySQL")}}),Ye.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return De(()=>Promise.resolve().then(()=>pAt),void 0).then(e=>e.php())}}),Ye.of({name:"PLSQL",extensions:["pls"],load(){return lg("PLSQL")}}),Ye.of({name:"PostgreSQL",load(){return lg("PostgreSQL")}}),Ye.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return De(()=>Promise.resolve().then(()=>wIt),void 0).then(e=>e.python())}}),Ye.of({name:"Rust",extensions:["rs"],load(){return De(()=>Promise.resolve().then(()=>VIt),void 0).then(e=>e.rust())}}),Ye.of({name:"Sass",extensions:["sass"],load(){return De(()=>Promise.resolve().then(()=>Ige),void 0).then(e=>e.sass({indented:!0}))}}),Ye.of({name:"SCSS",extensions:["scss"],load(){return De(()=>Promise.resolve().then(()=>Ige),void 0).then(e=>e.sass())}}),Ye.of({name:"SQL",extensions:["sql"],load(){return lg("StandardSQL")}}),Ye.of({name:"SQLite",load(){return lg("SQLite")}}),Ye.of({name:"TSX",extensions:["tsx"],load(){return De(()=>Promise.resolve().then(()=>dI),void 0).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),Ye.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return De(()=>Promise.resolve().then(()=>dI),void 0).then(e=>e.javascript({typescript:!0}))}}),Ye.of({name:"WebAssembly",extensions:["wat","wast"],load(){return De(()=>import("./index-BTx1nc4T.js"),__vite__mapDeps([3,1])).then(e=>e.wast())}}),Ye.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return De(()=>Promise.resolve().then(()=>XQt),void 0).then(e=>e.xml())}}),Ye.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return De(()=>Promise.resolve().then(()=>_2t),void 0).then(e=>e.yaml())}}),Ye.of({name:"APL",extensions:["dyalog","apl"],load(){return De(()=>import("./apl-B4CMkyY2.js"),[]).then(e=>dt(e.apl))}}),Ye.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return De(()=>import("./asciiarmor-Df11BRmG.js"),[]).then(e=>dt(e.asciiArmor))}}),Ye.of({name:"ASN.1",extensions:["asn","asn1"],load(){return De(()=>import("./asn1-EdZsLKOL.js"),[]).then(e=>dt(e.asn1({})))}}),Ye.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return De(()=>import("./asterisk-B-8jnY81.js"),[]).then(e=>dt(e.asterisk))}}),Ye.of({name:"Brainfuck",extensions:["b","bf"],load(){return De(()=>import("./brainfuck-C4LP7Hcl.js"),[]).then(e=>dt(e.brainfuck))}}),Ye.of({name:"Cobol",extensions:["cob","cpy"],load(){return De(()=>import("./cobol-CWcv1MsR.js"),[]).then(e=>dt(e.cobol))}}),Ye.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return De(()=>import("./clike-B9uivgTg.js"),[]).then(e=>dt(e.csharp))}}),Ye.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return De(()=>import("./clojure-BMjYHr_A.js"),[]).then(e=>dt(e.clojure))}}),Ye.of({name:"ClojureScript",extensions:["cljs"],load(){return De(()=>import("./clojure-BMjYHr_A.js"),[]).then(e=>dt(e.clojure))}}),Ye.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return De(()=>import("./css-BnMrqG3P.js"),[]).then(e=>dt(e.gss))}}),Ye.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return De(()=>import("./cmake-BQqOBYOt.js"),[]).then(e=>dt(e.cmake))}}),Ye.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return De(()=>import("./coffeescript-S37ZYGWr.js"),[]).then(e=>dt(e.coffeeScript))}}),Ye.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return De(()=>import("./commonlisp-DBKNyK5s.js"),[]).then(e=>dt(e.commonLisp))}}),Ye.of({name:"Cypher",extensions:["cyp","cypher"],load(){return De(()=>import("./cypher-C_CwsFkJ.js"),[]).then(e=>dt(e.cypher))}}),Ye.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return De(()=>import("./python-BuPzkPfP.js"),[]).then(e=>dt(e.cython))}}),Ye.of({name:"Crystal",extensions:["cr"],load(){return De(()=>import("./crystal-SjHAIU92.js"),[]).then(e=>dt(e.crystal))}}),Ye.of({name:"D",extensions:["d"],load(){return De(()=>import("./d-pRatUO7H.js"),[]).then(e=>dt(e.d))}}),Ye.of({name:"Dart",extensions:["dart"],load(){return De(()=>import("./clike-B9uivgTg.js"),[]).then(e=>dt(e.dart))}}),Ye.of({name:"diff",extensions:["diff","patch"],load(){return De(()=>import("./diff-DbItnlRl.js"),[]).then(e=>dt(e.diff))}}),Ye.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return De(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([4,5])).then(e=>dt(e.dockerFile))}}),Ye.of({name:"DTD",extensions:["dtd"],load(){return De(()=>import("./dtd-DF_7sFjM.js"),[]).then(e=>dt(e.dtd))}}),Ye.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return De(()=>import("./dylan-DwRh75JA.js"),[]).then(e=>dt(e.dylan))}}),Ye.of({name:"EBNF",load(){return De(()=>import("./ebnf-CDyGwa7X.js"),[]).then(e=>dt(e.ebnf))}}),Ye.of({name:"ECL",extensions:["ecl"],load(){return De(()=>import("./ecl-Cabwm37j.js"),[]).then(e=>dt(e.ecl))}}),Ye.of({name:"edn",extensions:["edn"],load(){return De(()=>import("./clojure-BMjYHr_A.js"),[]).then(e=>dt(e.clojure))}}),Ye.of({name:"Eiffel",extensions:["e"],load(){return De(()=>import("./eiffel-CnydiIhH.js"),[]).then(e=>dt(e.eiffel))}}),Ye.of({name:"Elm",extensions:["elm"],load(){return De(()=>import("./elm-vLlmbW-K.js"),[]).then(e=>dt(e.elm))}}),Ye.of({name:"Erlang",extensions:["erl"],load(){return De(()=>import("./erlang-BNw1qcRV.js"),[]).then(e=>dt(e.erlang))}}),Ye.of({name:"Esper",load(){return De(()=>import("./sql-D0XecflT.js"),[]).then(e=>dt(e.esper))}}),Ye.of({name:"Factor",extensions:["factor"],load(){return De(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([6,5])).then(e=>dt(e.factor))}}),Ye.of({name:"FCL",load(){return De(()=>import("./fcl-Kvtd6kyn.js"),[]).then(e=>dt(e.fcl))}}),Ye.of({name:"Forth",extensions:["forth","fth","4th"],load(){return De(()=>import("./forth-Ffai-XNe.js"),[]).then(e=>dt(e.forth))}}),Ye.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return De(()=>import("./fortran-DYz_wnZ1.js"),[]).then(e=>dt(e.fortran))}}),Ye.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return De(()=>import("./mllike-CXdrOF99.js"),[]).then(e=>dt(e.fSharp))}}),Ye.of({name:"Gas",extensions:["s"],load(){return De(()=>import("./gas-Bneqetm1.js"),[]).then(e=>dt(e.gas))}}),Ye.of({name:"Gherkin",extensions:["feature"],load(){return De(()=>import("./gherkin-heZmZLOM.js"),[]).then(e=>dt(e.gherkin))}}),Ye.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return De(()=>import("./groovy-D9Dt4D0W.js"),[]).then(e=>dt(e.groovy))}}),Ye.of({name:"Haskell",extensions:["hs"],load(){return De(()=>import("./haskell-BWDZoCOh.js"),[]).then(e=>dt(e.haskell))}}),Ye.of({name:"Haxe",extensions:["hx"],load(){return De(()=>import("./haxe-H-WmDvRZ.js"),[]).then(e=>dt(e.haxe))}}),Ye.of({name:"HXML",extensions:["hxml"],load(){return De(()=>import("./haxe-H-WmDvRZ.js"),[]).then(e=>dt(e.hxml))}}),Ye.of({name:"HTTP",load(){return De(()=>import("./http-DBlCnlav.js"),[]).then(e=>dt(e.http))}}),Ye.of({name:"IDL",extensions:["pro"],load(){return De(()=>import("./idl-BEugSyMb.js"),[]).then(e=>dt(e.idl))}}),Ye.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return De(()=>import("./javascript-qCveANmP.js"),[]).then(e=>dt(e.jsonld))}}),Ye.of({name:"Julia",extensions:["jl"],load(){return De(()=>import("./julia-DuME0IfC.js"),[]).then(e=>dt(e.julia))}}),Ye.of({name:"Kotlin",extensions:["kt","kts"],load(){return De(()=>import("./clike-B9uivgTg.js"),[]).then(e=>dt(e.kotlin))}}),Ye.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return De(()=>import("./livescript-BwQOo05w.js"),[]).then(e=>dt(e.liveScript))}}),Ye.of({name:"Lua",extensions:["lua"],load(){return De(()=>import("./lua-BgMRiT3U.js"),[]).then(e=>dt(e.lua))}}),Ye.of({name:"mIRC",extensions:["mrc"],load(){return De(()=>import("./mirc-CjQqDB4T.js"),[]).then(e=>dt(e.mirc))}}),Ye.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return De(()=>import("./mathematica-DTrFuWx2.js"),[]).then(e=>dt(e.mathematica))}}),Ye.of({name:"Modelica",extensions:["mo"],load(){return De(()=>import("./modelica-Dc1JOy9r.js"),[]).then(e=>dt(e.modelica))}}),Ye.of({name:"MUMPS",extensions:["mps"],load(){return De(()=>import("./mumps-BT43cFF4.js"),[]).then(e=>dt(e.mumps))}}),Ye.of({name:"Mbox",extensions:["mbox"],load(){return De(()=>import("./mbox-CNhZ1qSd.js"),[]).then(e=>dt(e.mbox))}}),Ye.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return De(()=>import("./nginx-DdIZxoE0.js"),[]).then(e=>dt(e.nginx))}}),Ye.of({name:"NSIS",extensions:["nsh","nsi"],load(){return De(()=>import("./nsis-LdVXkNf5.js"),__vite__mapDeps([7,5])).then(e=>dt(e.nsis))}}),Ye.of({name:"NTriples",extensions:["nt","nq"],load(){return De(()=>import("./ntriples-BfvgReVJ.js"),[]).then(e=>dt(e.ntriples))}}),Ye.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return De(()=>import("./clike-B9uivgTg.js"),[]).then(e=>dt(e.objectiveC))}}),Ye.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return De(()=>import("./clike-B9uivgTg.js"),[]).then(e=>dt(e.objectiveCpp))}}),Ye.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return De(()=>import("./mllike-CXdrOF99.js"),[]).then(e=>dt(e.oCaml))}}),Ye.of({name:"Octave",extensions:["m"],load(){return De(()=>import("./octave-Ck1zUtKM.js"),[]).then(e=>dt(e.octave))}}),Ye.of({name:"Oz",extensions:["oz"],load(){return De(()=>import("./oz-BzwKVEFT.js"),[]).then(e=>dt(e.oz))}}),Ye.of({name:"Pascal",extensions:["p","pas"],load(){return De(()=>import("./pascal--L3eBynH.js"),[]).then(e=>dt(e.pascal))}}),Ye.of({name:"Perl",extensions:["pl","pm"],load(){return De(()=>import("./perl-CdXCOZ3F.js"),[]).then(e=>dt(e.perl))}}),Ye.of({name:"Pig",extensions:["pig"],load(){return De(()=>import("./pig-CevX1Tat.js"),[]).then(e=>dt(e.pig))}}),Ye.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return De(()=>import("./powershell-CFHJl5sT.js"),[]).then(e=>dt(e.powerShell))}}),Ye.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return De(()=>import("./properties-C78fOPTZ.js"),[]).then(e=>dt(e.properties))}}),Ye.of({name:"ProtoBuf",extensions:["proto"],load(){return De(()=>import("./protobuf-ChK-085T.js"),[]).then(e=>dt(e.protobuf))}}),Ye.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return De(()=>import("./pug-DukmZTjD.js"),__vite__mapDeps([8,9])).then(e=>dt(e.pug))}}),Ye.of({name:"Puppet",extensions:["pp"],load(){return De(()=>import("./puppet-DMA9R1ak.js"),[]).then(e=>dt(e.puppet))}}),Ye.of({name:"Q",extensions:["q"],load(){return De(()=>import("./q-pXgVlZs6.js"),[]).then(e=>dt(e.q))}}),Ye.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return De(()=>import("./r-DUYO_cvP.js"),[]).then(e=>dt(e.r))}}),Ye.of({name:"RPM Changes",load(){return De(()=>import("./rpm-CTu-6PCP.js"),[]).then(e=>dt(e.rpmChanges))}}),Ye.of({name:"RPM Spec",extensions:["spec"],load(){return De(()=>import("./rpm-CTu-6PCP.js"),[]).then(e=>dt(e.rpmSpec))}}),Ye.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return De(()=>import("./ruby-B2Rjki9n.js"),[]).then(e=>dt(e.ruby))}}),Ye.of({name:"SAS",extensions:["sas"],load(){return De(()=>import("./sas-B4kiWyti.js"),[]).then(e=>dt(e.sas))}}),Ye.of({name:"Scala",extensions:["scala"],load(){return De(()=>import("./clike-B9uivgTg.js"),[]).then(e=>dt(e.scala))}}),Ye.of({name:"Scheme",extensions:["scm","ss"],load(){return De(()=>import("./scheme-C41bIUwD.js"),[]).then(e=>dt(e.scheme))}}),Ye.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return De(()=>import("./shell-CjFT_Tl9.js"),[]).then(e=>dt(e.shell))}}),Ye.of({name:"Sieve",extensions:["siv","sieve"],load(){return De(()=>import("./sieve-C3Gn_uJK.js"),[]).then(e=>dt(e.sieve))}}),Ye.of({name:"Smalltalk",extensions:["st"],load(){return De(()=>import("./smalltalk-CnHTOXQT.js"),[]).then(e=>dt(e.smalltalk))}}),Ye.of({name:"Solr",load(){return De(()=>import("./solr-DehyRSwq.js"),[]).then(e=>dt(e.solr))}}),Ye.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return De(()=>import("./mllike-CXdrOF99.js"),[]).then(e=>dt(e.sml))}}),Ye.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return De(()=>import("./sparql-DkYu6x3z.js"),[]).then(e=>dt(e.sparql))}}),Ye.of({name:"Spreadsheet",alias:["excel","formula"],load(){return De(()=>import("./spreadsheet-BCZA_wO0.js"),[]).then(e=>dt(e.spreadsheet))}}),Ye.of({name:"Squirrel",extensions:["nut"],load(){return De(()=>import("./clike-B9uivgTg.js"),[]).then(e=>dt(e.squirrel))}}),Ye.of({name:"Stylus",extensions:["styl"],load(){return De(()=>import("./stylus-B533Al4x.js"),[]).then(e=>dt(e.stylus))}}),Ye.of({name:"Swift",extensions:["swift"],load(){return De(()=>import("./swift-BzpIVaGY.js"),[]).then(e=>dt(e.swift))}}),Ye.of({name:"sTeX",load(){return De(()=>import("./stex-C3f8Ysf7.js"),[]).then(e=>dt(e.stex))}}),Ye.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return De(()=>import("./stex-C3f8Ysf7.js"),[]).then(e=>dt(e.stex))}}),Ye.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return De(()=>import("./verilog-C6RDOZhf.js"),[]).then(e=>dt(e.verilog))}}),Ye.of({name:"Tcl",extensions:["tcl"],load(){return De(()=>import("./tcl-DVfN8rqt.js"),[]).then(e=>dt(e.tcl))}}),Ye.of({name:"Textile",extensions:["textile"],load(){return De(()=>import("./textile-CnDTJFAw.js"),[]).then(e=>dt(e.textile))}}),Ye.of({name:"TiddlyWiki",load(){return De(()=>import("./tiddlywiki-DO-Gjzrf.js"),[]).then(e=>dt(e.tiddlyWiki))}}),Ye.of({name:"Tiki wiki",load(){return De(()=>import("./tiki-DGYXhP31.js"),[]).then(e=>dt(e.tiki))}}),Ye.of({name:"TOML",extensions:["toml"],load(){return De(()=>import("./toml-Bm5Em-hy.js"),[]).then(e=>dt(e.toml))}}),Ye.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return De(()=>import("./troff-wAsdV37c.js"),[]).then(e=>dt(e.troff))}}),Ye.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return De(()=>import("./ttcn-CfJYG6tj.js"),[]).then(e=>dt(e.ttcn))}}),Ye.of({name:"TTCN_CFG",extensions:["cfg"],load(){return De(()=>import("./ttcn-cfg-B9xdYoR4.js"),[]).then(e=>dt(e.ttcnCfg))}}),Ye.of({name:"Turtle",extensions:["ttl"],load(){return De(()=>import("./turtle-B1tBg_DP.js"),[]).then(e=>dt(e.turtle))}}),Ye.of({name:"Web IDL",extensions:["webidl"],load(){return De(()=>import("./webidl-ZXfAyPTL.js"),[]).then(e=>dt(e.webIDL))}}),Ye.of({name:"VB.NET",extensions:["vb"],load(){return De(()=>import("./vb-CmGdzxic.js"),[]).then(e=>dt(e.vb))}}),Ye.of({name:"VBScript",extensions:["vbs"],load(){return De(()=>import("./vbscript-BuJXcnF6.js"),[]).then(e=>dt(e.vbScript))}}),Ye.of({name:"Velocity",extensions:["vtl"],load(){return De(()=>import("./velocity-D8B20fx6.js"),[]).then(e=>dt(e.velocity))}}),Ye.of({name:"Verilog",extensions:["v"],load(){return De(()=>import("./verilog-C6RDOZhf.js"),[]).then(e=>dt(e.verilog))}}),Ye.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return De(()=>import("./vhdl-lSbBsy5d.js"),[]).then(e=>dt(e.vhdl))}}),Ye.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return De(()=>import("./xquery-CQfU5ijd.js"),[]).then(e=>dt(e.xQuery))}}),Ye.of({name:"Yacas",extensions:["ys"],load(){return De(()=>import("./yacas-BJ4BC0dw.js"),[]).then(e=>dt(e.yacas))}}),Ye.of({name:"Z80",extensions:["z80"],load(){return De(()=>import("./z80-Hz9HOZM7.js"),[]).then(e=>dt(e.z80))}}),Ye.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return De(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(e=>dt(e.mscgen))}}),Ye.of({name:"Xù",extensions:["xu"],load(){return De(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(e=>dt(e.xu))}}),Ye.of({name:"MsGenny",extensions:["msgenny"],load(){return De(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(e=>dt(e.msgenny))}}),Ye.of({name:"Vue",extensions:["vue"],load(){return De(()=>import("./index-2EW-eu3q.js"),__vite__mapDeps([10,1])).then(e=>e.vue())}}),Ye.of({name:"Angular Template",load(){return De(()=>import("./index-4dEMStJj.js"),__vite__mapDeps([11,1])).then(e=>e.angular())}})];function oXe(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 Pje();case"json":case"jsonl":return P5e();case"css":return nse();case"scss":return iZ({indented:!1});case"sass":return iZ({indented:!0});case"less":return A5e();case"html":case"htm":return oz();case"xml":case"svg":return Hje();case"md":case"mdx":case"markdown":return fje();case"yaml":case"yml":return iXe();case"rs":return Nje();case"go":return GLe();case"java":return C5e();case"c":case"h":case"cpp":case"cxx":case"cc":case"hpp":return MLe();case"php":return Oje();case"sql":return Yje();default:return null}}function VZn(e){return Ye.matchFilename(b2t,e)}function cY(e){const t=e.split(".").pop()?.toLowerCase();return{ts:"TypeScript",tsx:"TypeScript (JSX)",js:"JavaScript",jsx:"JavaScript (JSX)",mjs:"JavaScript",cjs:"JavaScript",py:"Python",json:"JSON",jsonl:"JSON Lines",css:"CSS",scss:"SCSS",sass:"Sass",less:"Less",html:"HTML",htm:"HTML",xml:"XML",svg:"SVG",md:"Markdown",mdx:"MDX",markdown:"Markdown",yaml:"YAML",yml:"YAML",rs:"Rust",go:"Go",java:"Java",c:"C",h:"C/C++ Header",cpp:"C++",cxx:"C++",cc:"C++",hpp:"C++ Header",php:"PHP",sql:"SQL",sh:"Shell",bash:"Bash",zsh:"Zsh",toml:"TOML",ini:"INI",conf:"Config",txt:"Plain Text"}[t??""]??"Plain Text"}let bp=null,Z_=null,_x=null;const kp={register(e,t,n){bp=e,Z_=t,_x=n},unregister(){bp=null,Z_=null,_x=null},get isRegistered(){return bp!==null},getContent(e){return bp?.get(e)?.doc.toString()??null},getAllModifiedContent(e){const t=new Map;for(const n of Object.keys(e)){if(!e[n])continue;const r=bp?.get(n)?.doc.toString();r!==void 0&&t.set(n,r)}return t},deleteState(e){bp?.delete(e),Z_?.delete(e)},destroy(){_x?.destroy(),bp?.clear(),Z_?.clear(),_x=null},remapState(e,t){const n=bp?.get(e);n&&(bp.delete(e),bp.set(t,n));const r=Z_?.get(e);r!==void 0&&(Z_.delete(e),Z_.set(t,r))},updateView(e){_x=e},getView(){return _x}},y2t=1e4;let uC=null;const gZ=new Set;function x2t(e){return gZ.add(e),()=>gZ.delete(e)}function S2t(){uC=null,gZ.forEach(e=>e())}function tk(e){return uC?.projectPath===e&&Date.now()-uC.timestamp<y2t?{files:uC.files}:null}function aXe(e,t){uC={files:t,projectPath:e,timestamp:Date.now()}}function OI(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 bs=to("Store:editor");function ui(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}const ld=new Map,v2t=2e3;let uY=null;const T2t=1500,dY=new Map,E2t=350;let pY=null,_I={change:0,create:0,delete:0},U0=null,AL="",z0=null,IL="";const w2t=250,k2t=120;function M1(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}
|
|
1053
1053
|
${r.join(`
|
|
1054
1054
|
`)}`;s!==AL&&(AL=s,U0&&clearTimeout(U0),U0=setTimeout(()=>{U0=null,Z.editor.setWatchedFiles(r)},150))}function fY(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,k2t);s.sort((o,a)=>o.localeCompare(a));const i=`${n}
|
|
1055
1055
|
${s.join(`
|
|
1056
|
-
`)}`;i!==IL&&(IL=i,z0&&clearTimeout(z0),z0=setTimeout(()=>{z0=null,Z.editor.setWatchedDirs(s)},w2t))}let K_=0;const bx=new Map,C2t=2e3;function R2t(e){try{const t=window.requestIdleCallback;if(typeof t=="function"){t(e,{timeout:2e3});return}}catch{}setTimeout(e,150)}const P2t=(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=IR(r),a=al(o),c=al(n),l=Lc(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 g of f)h=iL(h,g),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){bs.info("revealAndOpenFile: tree not loaded yet, deferring reveal");return}const a=IR(r),c=al(a),l=al(n),d=Lc(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 g=0;g<h.length-1;g++)m=iL(m,h[g]??""),await i(m)}o(n),e({editorPendingRevealFile:null})},openEditor:async n=>{const r=++K_;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 Z.editor.open(n);const i=performance.now()-s;if(K_!==r||t().editorProjectPath!==n)return;const o=performance.now(),a=await Z.editor.readDir(n),c=performance.now()-o;if(K_!==r||t().editorProjectPath!==n)return;const l=performance.now();e({editorFileTree:a.entries,editorFileTreeLoading:!1});const d=performance.now()-l;bs.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}})();R2t(()=>{K_!==r||t().editorProjectPath!==n||(p&&t().toggleWatcher(!0),setTimeout(()=>{K_!==r||t().editorProjectPath!==n||t().fetchGitStatus()},1200))})}catch(s){if(K_!==r||t().editorProjectPath!==n)return;const i=s instanceof Error?s.message:String(s);bs.error("Failed to open editor:",i),e({editorFileTreeLoading:!1,editorFileTreeError:i})}},closeEditor:()=>{K_++,U0&&(clearTimeout(U0),U0=null),z0&&(clearTimeout(z0),z0=null),AL="",IL="",ld.clear(),bx.clear(),Z.editor.close().catch(n=>{bs.error("editor:close failed:",n)}),kp.destroy(),e({editorProjectPath:null,editorFileTree:null,editorFileTreeLoading:!1,editorFileTreeError:null,editorExpandedDirs:{},editorOpenTabs:[],editorActiveTabId:null,editorFileLoading:{},editorModifiedFiles:{},editorSaving:{},editorSaveError:{},editorCreating:!1,editorCreateError:null,editorGitFiles:[],editorGitBranch:null,editorIsGitRepo:!1,editorGitLoading:!1,editorWatcherEnabled:!1,editorExternalChanges:{},editorFileMtimes:{},editorConflictFile:null,editorPendingGoToLine:null})},loadFileTree:async n=>{e({editorFileTreeLoading:!0,editorFileTreeError:null});try{const r=performance.now(),s=await Z.editor.readDir(n),i=performance.now()-r,o=performance.now();e({editorFileTree:s.entries,editorFileTreeLoading:!1});const a=performance.now()-o;bs.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);bs.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}}),fY(t));try{const i=performance.now(),o=await Z.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;bs.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);bs.error("Failed to expand directory:",o);const a=t().editorExpandedDirs;e({editorExpandedDirs:ui(a,n)})}},collapseDirectory:n=>{const{editorExpandedDirs:r}=t();e({editorExpandedDirs:ui(r,n)}),fY(t)},openFile:n=>{const{editorOpenTabs:r}=t(),s=r.find(l=>l.filePath===n);if(s){e({editorActiveTabId:s.id});return}const i=hf(n)||"file",o=cY(i),a={id:n,filePath:n,fileName:i,language:o},c=OI([...r,a]);e({editorOpenTabs:c,editorActiveTabId:a.id}),M1(t)},closeEditorTab:n=>{const{editorOpenTabs:r,editorActiveTabId:s,editorModifiedFiles:i,editorSaveError:o}=t(),a=r.filter(f=>f.id!==n),c=ui(i,n),l=ui(o,n);kp.deleteState(n);try{localStorage.removeItem(`editor-draft:${n}`)}catch{}let d=s;if(s===n){const f=r.findIndex(h=>h.id===n);a.length>0?d=a[Math.min(f,a.length-1)].id:d=null}const p=OI(a);e({editorOpenTabs:p,editorActiveTabId:d,editorModifiedFiles:c,editorSaveError:l}),M1(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:ui(r,n)})},saveFile:async n=>{const r=kp.getContent(n);if(r===null){bs.error("saveFile: no content available for",n);return}e(s=>({editorSaving:{...s.editorSaving,[n]:!0},editorSaveError:ui(s.editorSaveError,n)}));try{const s=t().editorFileMtimes[n],i=await Z.editor.writeFile(n,r,s);ld.set(n,Date.now()),e(o=>({editorModifiedFiles:ui(o.editorModifiedFiles,n),editorSaving:ui(o.editorSaving,n),editorFileMtimes:{...o.editorFileMtimes,[n]:i.mtimeMs},editorExternalChanges:ui(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")){bs.error("Save conflict detected:",n),e(o=>({editorSaving:ui(o.editorSaving,n),editorConflictFile:n}));return}bs.error("Failed to save file:",i),e(o=>({editorSaving:ui(o.editorSaving,n),editorSaveError:{...o.editorSaveError,[n]:i}}))}},saveAllFiles:async()=>{const{editorModifiedFiles:n}=t(),r=kp.getAllModifiedContent(n),s=[];for(const[i,o]of r)s.push((async()=>{e(a=>({editorSaving:{...a.editorSaving,[i]:!0}}));try{const a=t().editorFileMtimes[i],c=await Z.editor.writeFile(i,o,a);ld.set(i,Date.now()),e(l=>({editorModifiedFiles:ui(l.editorModifiedFiles,i),editorSaving:ui(l.editorSaving,i),editorFileMtimes:{...l.editorFileMtimes,[i]:c.mtimeMs},editorExternalChanges:ui(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")){bs.error("Save conflict detected:",i),e(l=>({editorSaving:ui(l.editorSaving,i),editorConflictFile:i}));return}bs.error("Failed to save file:",i,c),e(l=>({editorSaving:ui(l.editorSaving,i),editorSaveError:{...l.editorSaveError,[i]:c}}))}})());await Promise.allSettled(s)},discardChanges:n=>{const{editorModifiedFiles:r,editorSaveError:s}=t();e({editorModifiedFiles:ui(r,n),editorSaveError:ui(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 Z.editor.createFile(n,r);return await J_(t,e,n),e({editorCreating:!1}),s.filePath}catch(s){const i=s instanceof Error?s.message:String(s);return bs.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 Z.editor.createDir(n,r);return await J_(t,e,n),e({editorCreating:!1}),s.dirPath}catch(s){const i=s instanceof Error?s.message:String(s);return bs.error("Failed to create directory:",i),e({editorCreating:!1,editorCreateError:i}),null}},deleteFileFromTree:async n=>{try{await Z.editor.deleteFile(n);const{editorOpenTabs:r}=t(),s=r.filter(o=>evt(n,o.filePath));for(const o of s)t().closeEditorTab(o.id);const i=n.substring(0,L0(n));return i&&await J_(t,e,i),!0}catch(r){const s=r instanceof Error?r.message:String(r);return bs.error("Failed to delete file:",s),!1}},moveFileInTree:async(n,r)=>{const{editorSaving:s}=t();if(s[n])return bs.error("moveFileInTree: blocked — file is being saved:",n),!1;try{const i=await Z.editor.moveFile(n,r),{newPath:o,isDirectory:a}=i,c=n.substring(0,L0(n));bx.set(n,Date.now()),bx.set(o,Date.now()),e(d=>{const p=d.editorOpenTabs.map(f=>{const h=hh(f.filePath,n,o);if(h===f.filePath)return f;const m=hf(h)||"file";return{...f,id:h,filePath:h,fileName:m,language:cY(m)}});return{editorOpenTabs:OI(p),editorActiveTabId:hh(d.editorActiveTabId??"",n,o)||d.editorActiveTabId,editorModifiedFiles:Al(d.editorModifiedFiles,n,o),editorSaving:Al(d.editorSaving,n,o),editorSaveError:Al(d.editorSaveError,n,o),editorFileLoading:Al(d.editorFileLoading,n,o),editorExternalChanges:Al(d.editorExternalChanges,n,o),editorFileMtimes:Al(d.editorFileMtimes,n,o),editorExpandedDirs:Al(d.editorExpandedDirs,n,o)}}),M1(t);const{editorOpenTabs:l}=t();for(const d of l){const p=eOe(d.filePath,n,o);p!==d.filePath&&kp.remapState(p,d.filePath)}a||kp.remapState(n,o);try{for(let d=0;d<localStorage.length;d++){const p=localStorage.key(d);if(p?.startsWith("editor-draft:")){const f=p.slice(13),h=hh(f,n,o);if(h!==f){const m=localStorage.getItem(p);localStorage.removeItem(p),m!==null&&localStorage.setItem(`editor-draft:${h}`,m)}}}}catch{}for(const[d,p]of[...ld.entries()]){const f=hh(d,n,o);f!==d&&(ld.delete(d),ld.set(f,p))}return J_(t,e,c),J_(t,e,r),t().fetchGitStatus(),!0}catch(i){const o=i instanceof Error?i.message:String(i);return bs.error("moveFileInTree failed:",o),!1}},renameFileInTree:async(n,r)=>{const{editorSaving:s}=t();if(s[n])return bs.error("renameFileInTree: blocked — file is being saved:",n),!1;try{const i=await Z.editor.renameFile(n,r),{newPath:o,isDirectory:a}=i,c=n.substring(0,L0(n));bx.set(n,Date.now()),bx.set(o,Date.now()),e(d=>{const p=d.editorOpenTabs.map(f=>{const h=hh(f.filePath,n,o);if(h===f.filePath)return f;const m=hf(h)||"file";return{...f,id:h,filePath:h,fileName:m,language:cY(m)}});return{editorOpenTabs:OI(p),editorActiveTabId:hh(d.editorActiveTabId??"",n,o)||d.editorActiveTabId,editorModifiedFiles:Al(d.editorModifiedFiles,n,o),editorSaving:Al(d.editorSaving,n,o),editorSaveError:Al(d.editorSaveError,n,o),editorFileLoading:Al(d.editorFileLoading,n,o),editorExternalChanges:Al(d.editorExternalChanges,n,o),editorFileMtimes:Al(d.editorFileMtimes,n,o),editorExpandedDirs:Al(d.editorExpandedDirs,n,o)}}),M1(t);const{editorOpenTabs:l}=t();for(const d of l){const p=eOe(d.filePath,n,o);p!==d.filePath&&kp.remapState(p,d.filePath)}a||kp.remapState(n,o);try{for(let d=0;d<localStorage.length;d++){const p=localStorage.key(d);if(p?.startsWith("editor-draft:")){const f=p.slice(13),h=hh(f,n,o);if(h!==f){const m=localStorage.getItem(p);localStorage.removeItem(p),m!==null&&localStorage.setItem(`editor-draft:${h}`,m)}}}}catch{}for(const[d,p]of[...ld.entries()]){const f=hh(d,n,o);f!==d&&(ld.delete(d),ld.set(f,p))}return J_(t,e,c),t().fetchGitStatus(),!0}catch(i){const o=i instanceof Error?i.message:String(i);return bs.error("renameFileInTree failed:",o),!1}},fetchGitStatus:async()=>{e({editorGitLoading:!0});try{const n=performance.now(),r=await Z.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;bs.info(`[perf] fetchGitStatus: IPC=${s.toFixed(1)}ms, set=${o.toFixed(1)}ms, files=${r.files.length}`)}catch(n){bs.error("Failed to fetch git status:",n),e({editorGitLoading:!1})}},toggleWatcher:async n=>{try{await Z.editor.watchDir(n),e({editorWatcherEnabled:n});try{localStorage.setItem("editor-watcher-enabled",String(n))}catch{}n?(M1(t),fY(t)):(AL="",IL="",Z.editor.setWatchedFiles([]),Z.editor.setWatchedDirs([]))}catch(r){bs.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,pY||(pY=setTimeout(()=>{pY=null;const l=_I;_I={change:0,create:0,delete:0},bs.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=ld.get(n.path);if(o&&Date.now()-o<v2t)return;const a=bx.get(n.path);if(a&&Date.now()-a<C2t)return;if((r.some(l=>l.filePath===n.path)||n.type==="delete")&&e(l=>({editorExternalChanges:{...l.editorExternalChanges,[n.path]:n.type}})),uY||(uY=setTimeout(()=>{uY=null,t().fetchGitStatus()},T2t)),n.type==="create"||n.type==="delete"){S2t();const l=n.path.substring(0,L0(n.path));if(l&&s){const d=dY.get(l);d&&clearTimeout(d);const p=setTimeout(()=>{dY.delete(l),J_(t,e,l)},E2t);dY.set(l,p)}}},clearExternalChange:n=>{e(r=>({editorExternalChanges:ui(r.editorExternalChanges,n)}))},setFileMtime:(n,r)=>{e(s=>({editorFileMtimes:{...s.editorFileMtimes,[n]:r}}))},forceOverwrite:async n=>{const r=kp.getContent(n);if(r===null){bs.error("forceOverwrite: no content available for",n);return}e(s=>({editorSaving:{...s.editorSaving,[n]:!0},editorConflictFile:null}));try{const s=await Z.editor.writeFile(n,r);ld.set(n,Date.now()),e(i=>({editorModifiedFiles:ui(i.editorModifiedFiles,n),editorSaving:ui(i.editorSaving,n),editorFileMtimes:{...i.editorFileMtimes,[n]:s.mtimeMs},editorExternalChanges:ui(i.editorExternalChanges,n)}));try{localStorage.removeItem(`editor-draft:${n}`)}catch{}}catch(s){const i=s instanceof Error?s.message:String(s);bs.error("Failed to force overwrite:",i),e(o=>({editorSaving:ui(o.editorSaving,n),editorSaveError:{...o.editorSaveError,[n]:i}}))}},resolveConflict:()=>{e({editorConflictFile:null})}});async function J_(e,t,n){try{const r=performance.now(),s=await Z.editor.readDir(n);bs.info(`[perf] refreshDirectory: IPC=${(performance.now()-r).toFixed(1)}ms, entries=${s.entries.length}, dir=${hf(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){bs.error("Failed to refresh directory:",r)}}function hh(e,t,n){const r=al(t),s=al(e);if(r.length===0)return e;const i=Lc(t)||Lc(e)||Lc(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?iL(n,...c):n}function eOe(e,t,n){const r=al(n),s=al(e);if(r.length===0)return e;const i=Lc(t)||Lc(e)||Lc(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?iL(t,...c):t}function Al(e,t,n){const r={};let s=!1;for(const[i,o]of Object.entries(e)){const a=hh(i,t,n);a!==i&&(s=!0),r[a]=o}return s?r:e}function 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 G$(e){const t=[];return e.hasLspServers&&t.push("lsp"),e.hasMcpServers&&t.push("mcp"),e.hasAgents&&t.push("agent"),e.hasCommands&&t.push("command"),e.hasHooks&&t.push("hook"),t.length===0&&t.push("skill"),t}const $2t={lsp:"LSP",mcp:"MCP",agent:"Agent",command:"Command",hook:"Hook",skill:"Skill"};function Ise(e){return $2t[e]}function N2t(e){if(e>=1e6){const t=e/1e6;return t>=10?`${Math.round(t)}M`:`${t.toFixed(1).replace(/\.0$/,"")}M`}if(e>=1e3){const t=e/1e3;return t>=10?`${Math.round(t)}K`:`${t.toFixed(1).replace(/\.0$/,"")}K`}return String(e)}function H$(e){return e&&e.trim().toLowerCase()||"other"}function ML(e,t,n){return t==="project"||t==="local"?`plugin:${e}:${t}:${_T(n)}`:`plugin:${e}:${t}`}function oP(e,t,n){return t==="project"||t==="local"?`mcp:${e}:${t}:${_T(n)}`:`mcp:${e}:${t}`}function tS(e,t){return t?`mcp-diagnostic:${t}:${e}`:`mcp-diagnostic:${e}`}function _T(e){return e??"__global__"}function lXe(e,t){return e.some(n=>n.scope===t)}function cXe(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"已安装"}}function uXe(e){const t=Array.from(new Set(e.map(n=>n.scope)));return cXe(t)}const tOe={local:0,project:1,global:2,user:2};function dXe(e){return e.length===0?null:[...e].sort((t,n)=>tOe[t.scope]-tOe[n.scope])[0]}function pXe(e){const t=Array.from(new Set(e.map(n=>n.scope)));return cXe(t)}function qg(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=>Ufe(Gw(p,"mcp"))).length>0?null:i.map(p=>Gw(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=>Ufe(Gw(l,"plugins")));return a.length===0?i.map(d=>Gw(d,"plugins").reason).find(d=>typeof d=="string"&&d.trim().length>0)??"当前运行时不支持安装插件。":t||a.find(l=>l.authenticated)?null:`${a[0]?.displayName??"Anthropic"} 未连接。请打开首页登录。`}function dC(e){return e.toLowerCase().replace(/\s+/g,"-").replace(/[^\w.-]/g,"")}function Mse(e){return e==="agent_teams_orchestrator"?"global":"user"}function A2t(e){return e==="user"||e==="global"}function m0(e){return e==="project"||e==="local"}function nOe(e,t){switch(e){case"global":return"全局";case"user":return t==="agent_teams_orchestrator"?"用户(旧版)":"用户(全局)";case"project":return"项目";case"local":return"本地";default:return e}}function Bl(e,t){return e.panes.find(n=>n.id===t)}function kh(e,t){return e.panes.find(n=>n.tabs.some(r=>r.id===t))}function io(e,t){return{...e,panes:e.panes.map(n=>n.id===t.id?t:n)}}function nk(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=fXe(o);let c=e.focusedPaneId;return e.focusedPaneId===t&&(c=a[Math.min(n,a.length-1)].id),{panes:a,focusedPaneId:c}}function rOe(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:fXe(o)}}function fXe(e){if(e.length===0)return e;const t=1/e.length;return e.map(n=>({...n,widthFraction:t}))}function hXe(e){const t=Bl(e,e.focusedPaneId);return t?{openTabs:t.tabs,activeTabId:t.activeTabId,selectedTabIds:t.selectedTabIds}:{openTabs:[],activeTabId:null,selectedTabIds:[]}}function hu(e){return e.panes.flatMap(t=>t.tabs)}function sOe(e){return{id:e,tabs:[],activeTabId:null,selectedTabIds:[],widthFraction:0}}let yx=null,hY=0;const aP=new Map,lP=new Map,mY=new Map;let I2t=0,M2t=0;const gY=new Map,OY=new Map,Q2t="__user__";function _Y(e){return Object.values(e).some(Boolean)}function D2t(e){return e??"__user__"}function bI(e){return new Set(e.map(t=>t.pluginId))}function OZ(e,t){return e.startsWith(`plugin:${t}:`)}function iOe(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=>OZ(o,a))&&delete r[o];for(const o of Object.keys(s))i.some(a=>OZ(o,a))&&delete s[o];return{pluginInstallProgress:r,installErrors:s}}function xh(e){const t=aP.get(e);t&&(clearTimeout(t),aP.delete(e))}function oOe(e){const t=Array.from(e);for(const n of Array.from(aP.keys()))t.some(r=>OZ(n,r))&&xh(n)}function aOe(e,t){xh(e);const n=setTimeout(()=>{aP.delete(e),t(r=>r.pluginInstallProgress[e]!=="success"?{}:{pluginInstallProgress:{...r.pluginInstallProgress,[e]:"idle"}})},mXe);aP.set(e,n)}function L2t(e,t,n){return t==="project"||t==="local"?`mcp-custom:${e}:${t}:${_T(n)}`:`mcp-custom:${e}:${t}`}function _Z(e){return e.includes(":project:")||e.endsWith(":project")||e.includes(":local:")||e.endsWith(":local")}function uu(e){const t=lP.get(e);t&&(clearTimeout(t),lP.delete(e))}function bY(e,t){uu(e);const n=setTimeout(()=>{lP.delete(e),t(r=>r.mcpInstallProgress[e]!=="success"?{}:{mcpInstallProgress:{...r.mcpInstallProgress,[e]:"idle"}})},mXe);lP.set(e,n)}function j2t(e,t){const n={...e},r={...t};for(const s of Object.keys(n))(s.startsWith("mcp:")||s.startsWith("mcp-custom:"))&&_Z(s)&&delete n[s];for(const s of Object.keys(r))(s.startsWith("mcp:")||s.startsWith("mcp-custom:"))&&_Z(s)&&delete r[s];return{mcpInstallProgress:n,installErrors:r}}function X2t(){for(const e of Array.from(lP.keys()))_Z(e)&&uu(e)}function U2t(e){return e??Q2t}const mXe=2e3,lOe="Project- and local-scoped plugins require an active project in the Extensions tab.";function Q1(e){return HO({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 z2t=(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:{},extensionToasts:[],skillsUserCatalog:[],skillsProjectCatalogByProjectPath:{},skillsCatalogLoadingByProjectPath:{},skillsCatalogErrorByProjectPath:{},skillsLoading:!1,skillsError:null,skillsDetailsById:{},skillsDetailLoadingById:{},skillsDetailErrorById:{},skillsMutationLoading:!1,skillsMutationError:null,mcpGitHubStars:{},fetchPluginCatalog:async(n,r)=>{if(!Z.plugins)return;const s=D2t(n);if(yx&&!r&&yx.key===s){await yx.promise;return}const i=++hY,o=Symbol("pluginCatalogRequest");e({pluginCatalogLoading:!0,pluginCatalogError:null});let a=null;a=(async()=>{try{const c=await Z.plugins.getAll(n,r);e(l=>{if(i!==hY)return{};const d=n??null,f=l.pluginCatalogProjectPath===d?new Set:new Set([...bI(l.pluginCatalog),...bI(c)]),h=iOe(f,l.pluginInstallProgress,l.installErrors);return oOe(f),{pluginCatalog:c,pluginCatalogLoading:!1,pluginCatalogError:null,pluginCatalogProjectPath:d,pluginInstallProgress:h.pluginInstallProgress,installErrors:h.installErrors}})}catch(c){e(l=>{if(i!==hY)return{};const d=n??null,p=l.pluginCatalogProjectPath===d,f=iOe(p?new Set:bI(l.pluginCatalog),l.pluginInstallProgress,l.installErrors);return oOe(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{yx?.token===o&&(yx=null)}})(),yx={key:s,promise:a,token:o},await a},fetchPluginReadme:n=>{if(!Z.plugins)return;const r=t(),s=r.pluginReadmes[n];s!=null||r.pluginReadmeLoading[n]||(e(i=>({pluginReadmeLoading:{...i.pluginReadmeLoading,[n]:!0}})),Z.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(Z.mcpRegistry){e({mcpBrowseLoading:!0,mcpBrowseError:null});try{const r=await Z.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(Z.mcpRegistry)try{const r=await Z.mcpRegistry.getInstalled(n);e(s=>{const i=n??null,o=_T(i),a=s.mcpInstalledProjectPath===i,c=a?{mcpInstallProgress:s.mcpInstallProgress,installErrors:s.installErrors}:j2t(s.mcpInstallProgress,s.installErrors);return a||X2t(),{mcpInstalledServers:r,mcpInstalledServersByProjectPath:{...s.mcpInstalledServersByProjectPath,[o]:r},mcpInstalledProjectPath:i,mcpInstallProgress:c.mcpInstallProgress,installErrors:c.installErrors}})}catch{}},runMcpDiagnostics:async n=>{const r=Z.mcpRegistry;if(!r)return;const s=_T(n),i=mY.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(p=>[tS(p.name,p.scope),p])),l=a.filter(p=>p.status==="failed");if(l.length>0){const p=l.map(f=>f.name).join(", ");t().addExtensionToast("warning","MCP 连接异常",`${p} 连接失败`)}const d=Date.now();e({mcpDiagnostics:c,mcpDiagnosticsLoading:!1,mcpDiagnosticsByProjectPath:{...t().mcpDiagnosticsByProjectPath,[s]:c},mcpDiagnosticsLoadingByProjectPath:{...t().mcpDiagnosticsLoadingByProjectPath,[s]:!1},mcpDiagnosticsLastCheckedAt:d,mcpDiagnosticsLastCheckedAtByProjectPath:{...t().mcpDiagnosticsLastCheckedAtByProjectPath,[s]:d}})}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{mY.delete(s)}})();mY.set(s,o),await o},fetchSkillsCatalog:async n=>{if(!Z.skills)return;const r=U2t(n),s=++I2t;gY.set(r,s),e(i=>{const o={...i.skillsCatalogLoadingByProjectPath,[r]:!0};return{skillsCatalogLoadingByProjectPath:o,skillsCatalogErrorByProjectPath:{...i.skillsCatalogErrorByProjectPath,[r]:null},skillsLoading:_Y(o),skillsError:null}});try{const i=await Z.skills.list(n);if(gY.get(r)!==s)return;e(o=>({skillsCatalogLoadingByProjectPath:{...o.skillsCatalogLoadingByProjectPath,[r]:!1},skillsCatalogErrorByProjectPath:{...o.skillsCatalogErrorByProjectPath,[r]:null},skillsLoading:_Y({...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(gY.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:_Y({...a.skillsCatalogLoadingByProjectPath,[r]:!1}),skillsError:o}))}},fetchSkillDetail:async(n,r)=>{if(!Z.skills)return;const s=++M2t;OY.set(n,s),e(i=>({skillsDetailLoadingById:{...i.skillsDetailLoadingById,[n]:!0},skillsDetailErrorById:{...i.skillsDetailErrorById,[n]:null}}));try{const i=await Z.skills.getDetail(n,r);if(OY.get(n)!==s)return;e(o=>({skillsDetailsById:{...o.skillsDetailsById,[n]:i},skillsDetailLoadingById:{...o.skillsDetailLoadingById,[n]:!1},skillsDetailErrorById:{...o.skillsDetailErrorById,[n]:null}}))}catch(i){if(OY.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(!Z.skills)throw new Error("Skills API is not available");e({skillsMutationLoading:!0,skillsMutationError:null});try{const r=await Z.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(!Z.skills)throw new Error("Skills API is not available");e({skillsMutationLoading:!0,skillsMutationError:null});try{const r=await Z.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(!Z.skills)throw new Error("Skills API is not available");e({skillsMutationLoading:!0,skillsMutationError:null});try{const r=await Z.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(!Z.skills)throw new Error("Skills API is not available");e({skillsMutationLoading:!0,skillsMutationError:null});try{const r=await Z.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(!Z.skills)throw new Error("Skills API is not available");e({skillsMutationLoading:!0,skillsMutationError:null});try{await Z.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(!Z.plugins)return;const r=t().pluginCatalogProjectPath??void 0,s=n.scope!=="user"?n.projectPath??t().pluginCatalogProjectPath??void 0:n.projectPath,i=ML(n.pluginId,n.scope,s),o=s===n.projectPath?n:{...n,projectPath:s},a=t();if(a.cliStatus===null)try{await Q1(a)}catch{}const c=D1(t()),l=o.scope!=="user"&&!o.projectPath?lOe:qg({isInstalled:!1,...c,section:"plugins"});if(l){xh(i),e(d=>({pluginInstallProgress:{...d.pluginInstallProgress,[i]:"error"},installErrors:{...d.installErrors,[i]:l}}));return}xh(i),e(d=>({pluginInstallProgress:{...d.pluginInstallProgress,[i]:"pending"},installErrors:{...d.installErrors,[i]:""}}));try{const d=await Z.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().addExtensionToast("success","插件已安装",`已安装到 claudecode (${o.scope??"user"})`),t().fetchPluginCatalog(o.scope!=="user"?o.projectPath:r,!0),aOe(i,e)}catch(d){xh(i);const p=d instanceof Error?d.message:"Install failed";e(f=>({pluginInstallProgress:{...f.pluginInstallProgress,[i]:"error"},installErrors:{...f.installErrors,[i]:p}}))}},uninstallPlugin:async(n,r,s)=>{if(!Z.plugins)return;const i=t().pluginCatalogProjectPath??void 0,o=r??"user",a=o!=="user"?s??t().pluginCatalogProjectPath??void 0:s,c=ML(n,o,a);if(o!=="user"&&!a){xh(c),e(p=>({pluginInstallProgress:{...p.pluginInstallProgress,[c]:"error"},installErrors:{...p.installErrors,[c]:lOe}}));return}const l=t();if(l.cliStatus===null)try{await Q1(l)}catch{}const d=qg({isInstalled:!0,...D1(t()),section:"plugins"});if(d){xh(c),e(p=>({pluginInstallProgress:{...p.pluginInstallProgress,[c]:"error"},installErrors:{...p.installErrors,[c]:d}}));return}xh(c),e(p=>({pluginInstallProgress:{...p.pluginInstallProgress,[c]:"pending"}}));try{const p=await Z.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),aOe(c,e)}catch(p){xh(c);const f=p instanceof Error?p.message:"Uninstall failed";e(h=>({pluginInstallProgress:{...h.pluginInstallProgress,[c]:"error"},installErrors:{...h.installErrors,[c]:f}}))}},installMcpServer:async n=>{const r=oP(n.registryId,n.scope,n.projectPath);if(!Z.mcpRegistry){uu(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 Q1(s)}catch{}const i=qg({isInstalled:!1,...D1(t()),section:"mcp"});if(i){uu(r),e(o=>({mcpInstallProgress:{...o.mcpInstallProgress,[r]:"error"},installErrors:{...o.installErrors,[r]:i}}));return}uu(r),e(o=>({mcpInstallProgress:{...o.mcpInstallProgress,[r]:"pending"}}));try{const o=await Z.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"}})),bY(r,e)}catch(o){uu(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=L2t(n.serverName,r,n.projectPath);try{if(!Z.mcpRegistry)throw new Error("MCP Registry not available");const i=t();if(i.cliStatus===null)try{await Q1(i)}catch{}const o=qg({isInstalled:!1,...D1(t()),section:"mcp"});if(o)throw new Error(o);uu(s),e(c=>({mcpInstallProgress:{...c.mcpInstallProgress,[s]:"pending"}}));const a=await Z.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"}})),t().addExtensionToast("success","MCP 服务器已安装",`已安装 ${n.serverName}`),bY(s,e)}catch(i){uu(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"||m0(s)?s:"user",a=oP(n,o,i);if(!Z.mcpRegistry){uu(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 Q1(c)}catch{}const l=qg({isInstalled:!0,...D1(t()),section:"mcp"});if(l){uu(a),e(d=>({mcpInstallProgress:{...d.mcpInstallProgress,[a]:"error"},installErrors:{...d.installErrors,[a]:l}}));return}uu(a),e(d=>({mcpInstallProgress:{...d.mcpInstallProgress,[a]:"pending"}}));try{const d=await Z.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"}})),t().addExtensionToast("success","MCP 服务器已卸载"),bY(a,e)}catch(d){uu(a);const p=d instanceof Error?d.message:"Uninstall failed";e(f=>({mcpInstallProgress:{...f.mcpInstallProgress,[a]:"error"},installErrors:{...f.installErrors,[a]:p}}))}},addExtensionToast:(n,r,s)=>{const i=`toast-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;e(o=>({extensionToasts:[...o.extensionToasts,{id:i,type:n,title:r,message:s}]})),n==="success"&&setTimeout(()=>{e(o=>({extensionToasts:o.extensionToasts.filter(a=>a.id!==i)}))},3e3)},dismissExtensionToast:n=>{e(r=>({extensionToasts:r.extensionToasts.filter(s=>s.id!==n)}))},openExtensionsTab:()=>{const n=t(),r=n.selectedProjectId??n.activeProjectId??void 0,i=n.paneLayout.panes.find(o=>o.id===n.paneLayout.focusedPaneId)?.tabs.find(o=>o.type==="extensions");if(i){if(i.projectId!==r||i.label!=="扩展"){const o=kh(n.paneLayout,i.id);o&&e({paneLayout:io(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=>{!Z.mcpRegistry||n.length===0||Z.mcpRegistry.githubStars(n).then(r=>{Object.keys(r).length>0&&e(s=>({mcpGitHubStars:{...s.mcpGitHubStars,...r}}))}).catch(()=>{})}}),cOe=50;function bZ(e,t){return e.find(n=>n.type==="session"&&n.sessionId===t)}function gXe(e,t,n){return e.find(r=>r.type==="session"&&r.sessionId===t&&r.projectId===n)}function yZ(e){return e.length<=cOe?e:e.slice(0,cOe-1)+"…"}function B2t(e,t="notification",n){return{id:crypto.randomUUID(),kind:"error",source:t,highlight:n??"red",payload:e}}function uOe(e){return{id:crypto.randomUUID(),kind:"search",source:"commandPalette",highlight:"yellow",payload:e}}function F2t(e){return e.kind==="error"}function Y2t(e){return e.kind==="search"}const yI=to("Store:notification"),V2t=200,q2t=(e,t)=>({notifications:[],unreadCount:0,notificationsLoading:!1,notificationsError:null,fetchNotifications:async()=>{e({notificationsLoading:!0,notificationsError:null});try{const n=await Z.notifications.get({limit:V2t,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 Z.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=>Z.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 Z.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 Z.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=>Z.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 Z.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=B2t({errorId:n.id,errorTimestamp:n.timestamp,toolUseId:n.toolUseId,subagentId:n.subagentId,lineNumber:n.lineNumber},"notification",n.triggerColor),i=hu(r.paneLayout),o=gXe(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"})}}),QL=4;function xx(e){const t=hXe(e);return{paneLayout:e,openTabs:t.openTabs,activeTabId:t.activeTabId,selectedTabIds:t.selectedTabIds}}const W2t=(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=Bl(s,n);if(!i)return;const o={...s,focusedPaneId:n};e(xx(o)),i.activeTabId&&t().setActiveTab(i.activeTabId)},splitPane:(n,r,s)=>{const i=t(),{paneLayout:o}=i;if(o.panes.length>=QL)return;const a=Bl(o,n);if(!a)return;const c=a.tabs.find(g=>g.id===r);if(!c)return;const l=a.tabs.filter(g=>g.id!==r);let d=a.activeTabId;if(a.activeTabId===r){const g=a.tabs.findIndex(_=>_.id===r);d=l[g]?.id??l[g-1]?.id??null}const p={...a,tabs:l,activeTabId:d,selectedTabIds:a.selectedTabIds.filter(g=>g!==r)},f=crypto.randomUUID(),h={...sOe(f),tabs:[c],activeTabId:c.id};let m=io(o,p);l.length===0&&o.panes.length>1&&(m=nk(m,n)),m=rOe(m,p.id!==n?o.panes[0].id:n,h,s),m={...m,focusedPaneId:f},e(xx(m)),c.type==="session"&&t().setActiveTab(c.id)},closePane:n=>{const r=t(),{paneLayout:s}=r;if(s.panes.length<=1)return;const i=Bl(s,n);if(!i)return;for(const c of i.tabs)r.cleanupTabUIState(c.id),r.cleanupTabSessionData(c.id);const o=nk(s,n);e(xx(o));const a=Bl(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=Bl(a,r),l=Bl(a,s);if(!c||!l)return;const d=c.tabs.find(g=>g.id===n);if(!d)return;const p=c.tabs.filter(g=>g.id!==n);let f=c.activeTabId;if(c.activeTabId===n){const g=c.tabs.findIndex(_=>_.id===n);f=p[g]?.id??p[g-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=io(a,{...c,tabs:p,activeTabId:f,selectedTabIds:c.selectedTabIds.filter(g=>g!==n)});m=io(m,{...l,tabs:h,activeTabId:d.id}),p.length===0&&m.panes.length>1&&(m=nk(m,r)),m={...m,focusedPaneId:s},e(xx(m))},moveTabToNewPane:(n,r,s,i)=>{const o=t(),{paneLayout:a}=o;if(a.panes.length>=QL)return;const c=Bl(a,r);if(!c)return;const l=c.tabs.find(g=>g.id===n);if(!l)return;const d=c.tabs.filter(g=>g.id!==n);let p=c.activeTabId;if(c.activeTabId===n){const g=c.tabs.findIndex(_=>_.id===n);p=d[g]?.id??d[g-1]?.id??null}const f=crypto.randomUUID(),h={...sOe(f),tabs:[l],activeTabId:l.id};let m=io(a,{...c,tabs:d,activeTabId:p,selectedTabIds:c.selectedTabIds.filter(g=>g!==n)});d.length===0&&m.panes.length>1&&(m=nk(m,r)),m=rOe(m,s,h,i),m={...m,focusedPaneId:f},e(xx(m))},reorderTabInPane:(n,r,s)=>{const{paneLayout:i}=t(),o=Bl(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=io(i,{...o,tabs:a});e(xx(l))},resizePanes:(n,r)=>{const{paneLayout:s}=t(),i=s.panes.findIndex(h=>h.id===n);if(i===-1||i>=s.panes.length-1)return;const o=.1,a=Math.max(o,Math.min(1-o*(s.panes.length-1),r)),c=s.panes[i],l=s.panes[i+1],p=c.widthFraction+l.widthFraction-a;if(p<o)return;const f=s.panes.map((h,m)=>m===i?{...h,widthFraction:a}:m===i+1?{...h,widthFraction:p}:h);e({paneLayout:{...s,panes:f}})},getPaneForTab:n=>kh(t().paneLayout,n)?.id??null,getAllPaneTabs:()=>hu(t().paneLayout)}),G2t=(e,t)=>({projects:[],selectedProjectId:null,projectsLoading:!1,projectsError:null,fetchProjects:async()=>{if(!t().projectsLoading){e({projectsLoading:!0,projectsError:null});try{const r=[...await Z.getProjects()].sort((s,i)=>(i.mostRecentSession??0)-(s.mostRecentSession??0));e({projects:r,projectsLoading:!1})}catch(n){e({projectsError:n instanceof Error?n.message:"Failed to fetch projects",projectsLoading:!1})}}},selectProject:n=>{e({selectedProjectId:n,...Xh()}),t().fetchSessionsInitial(n)}}),yY=to("Store:repository"),H2t=3e4;async function Z2t(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 K2t=(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 Z2t(Z.getRepositoryGroups(),H2t,"get-repository-groups");e({repositoryGroups:r,repositoryGroupsLoading:!1});const s=Date.now()-n;s>=2e3&&yY.warn(`fetchRepositoryGroups slow ms=${s} count=${r.length}`)}catch(r){const s=Date.now()-n;yY.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){yY.warn("Repository not found:",n);return}const o=s.worktrees.find(a=>a.isMainWorktree)??s.worktrees[0];o?(e({selectedRepositoryId:n,selectedWorktreeId:o.id,selectedProjectId:o.id,activeProjectId:o.id,...Xh()}),t().fetchSessionsInitial(o.id)):e({selectedRepositoryId:n,selectedWorktreeId:null,...Xh()})},selectWorktree:n=>{e({selectedWorktreeId:n,selectedProjectId:n,activeProjectId:n,...Xh()}),t().fetchSessionsInitial(n)},setViewMode:n=>{e({viewMode:n,selectedRepositoryId:null,selectedWorktreeId:null,selectedProjectId:null,...Xh()}),n==="grouped"?t().fetchRepositoryGroups():t().fetchProjects()}}),xI=to("scheduleSlice"),J2t=(e,t)=>({schedules:[],schedulesLoading:!1,schedulesError:null,scheduleRuns:{},scheduleRunsLoading:{},async fetchSchedules(){if(!t().schedulesLoading){e({schedulesLoading:!0,schedulesError:null});try{const n=await Z.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 Z.schedules.create(n);return e(s=>({schedules:[...s.schedules,r]})),r},async updateSchedule(n,r){const s=await Z.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 Z.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 Z.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 Z.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 Z.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 Z.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 Z.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 Z.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()},openTasksTab:()=>{const n=t(),s=n.paneLayout.panes.find(i=>i.id===n.paneLayout.focusedPaneId)?.tabs.find(i=>i.type==="tasks");if(s){n.setActiveTab(s.id);return}n.openTab({type:"tasks",label:"任务"}),t().fetchAllTasks(),t().fetchSchedules()}});function eDt(e){return"chunkType"in e&&e.chunkType==="ai"}function tDt(e){return eDt(e)&&"semanticSteps"in e}function nDt(e){return e.type==="assistant"}function rDt(e){return"chunkType"in e&&e.chunkType==="user"&&"rawMessages"in e}function sDt(e){return"chunkType"in e&&e.chunkType==="system"&&"rawMessages"in e}function iDt(e){return"chunkType"in e&&e.chunkType==="compact"&&"rawMessages"in e}function oDt(e){return"chunkType"in e&&"rawMessages"in e}function bT(e){return e.length===0?[]:oDt(e[0])?e:null}const dz=/[\\/]/;function Sc(e){const t=e.split(dz);return t[t.length-1]||""}function aDt(e){return e.split(dz).filter(Boolean)[0]??""}function lDt(e){return e.split(dz).filter(Boolean)}function cDt(e){return dz.test(e)}function uDt(e){return/^\.\.?[\\/]/.test(e)}const dDt=to("Util:groupTransformer"),dOe=/\/([a-z][a-z-]{0,50})(?:\s+(\S[^\n]{0,1000}))?$/gim,pOe=100;function cP(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(rDt(l))r.push({type:"user",group:pDt(l,s++)});else if(sDt(l))r.push({type:"system",group:yDt(l)}),i++;else if(tDt(l))r.push({type:"ai",group:SDt(l,o)}),o++;else if(iDt(l))r.push({type:"compact",group:xDt(l)}),a++;else{const d="chunkType"in l?l.chunkType:"unknown";dDt.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=wDt(r,l),f=kDt(r,l);if(p&&f){const h=CDt(p),m=RDt(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 pDt(e,t){return fDt(e.userMessage,t)}function fDt(e,t){const n=hDt(e);return{id:`user-${e.uuid}`,message:e,timestamp:e.timestamp,content:n,index:t}}function hDt(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=Gvt(t),i=LU(t),o=i?[]:mDt(s);r.push(...Dse(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 mDt(e){if(!e)return[];const t=[];let n;for(dOe.lastIndex=0;(n=dOe.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 gDt=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"]),ODt=/[\s,)}\]]/;function _Dt(e){if(/^[A-Za-z]:[\\/]/.test(e)||e.startsWith("\\\\")||uDt(e))return!0;const t=aDt(e);return!!(gDt.has(t)||cDt(e)&&e.length>2&&(lDt(e).length>2||/\.[a-zA-Z0-9]+$/.test(e)))}function bDt(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&&!ODt.test(e[i]);)i+=1;s=e.slice(n,i)}return!s||!_Dt(s)?null:{path:s,raw:e.slice(t,i),startIndex:t,endIndex:i}}function Qse(e){if(!e)return[];const t=[];let n=0;for(;n<e.length;){const r=e.indexOf("@",n);if(r<0)break;const s=bDt(e,r);s?(t.push(s),n=s.endIndex):n=r+1}return t}function Dse(e){return Qse(e).map(({path:t,raw:n})=>({path:t,raw:n}))}function yDt(e){return{id:e.id,message:e.message,timestamp:e.startTime,commandOutput:e.commandOutput}}function xDt(e){return{id:e.id,timestamp:e.startTime,message:e.message}}function SDt(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=>nDt(d))??null,a=vDt(n,o),c=TDt(n),l=EDt(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 vDt(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 TDt(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>pOe?d.slice(0,pOe)+"...":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 EDt(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 wDt(e,t){for(let n=t-1;n>=0;n--)if(e[n].type==="ai")return e[n].group;return null}function kDt(e,t){for(let n=t+1;n<e.length;n++)if(e[n].type==="ai")return e[n].group;return null}function CDt(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 RDt(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 OXe=500,PDt="CLAUDE.md",fOe="project-memory";function Mp(e){let t=0;for(let r=0;r<e.length;r++){const s=e.charCodeAt(r);t=(t<<5)-t+s,t=t&t}return`cmd-${Math.abs(t).toString(16)}`}function Qp(e,t){return e}function Lse(e){return e.startsWith("/")||e.startsWith("\\\\")||/^[a-zA-Z]:[\\/]/.test(e)}function IS(e,t){if(Lse(t))return t;const n=$Dt(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=NDt(r,s),c=ADt(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 $Dt(e){let t=e.length;for(;t>0;){const n=e[t-1];if(n!=="/"&&n!=="\\")break;t--}return e.slice(0,t)}function NDt(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 ADt(e){return al(e)}function Ng(e){return e.replace(/\\/g,"/")}function IDt(e){const t=L0(e);return t===-1?"":e.slice(0,t)}function MDt(e){const t=L0(e);return t<=0?null:e.slice(0,t)}function QDt(e,t){const n=Ng(e).replace(/\/$/,""),r=Ng(t).replace(/\/$/,"");return r===n||r.startsWith(n+"/")}function _Xe(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 bXe(e,t){if(!e)return[];const n=e.content.fileReferences||[],r=[];for(const s of n)if(s.path){const i=Lse(s.path)?s.path:IS(t,s.path);r.push(i)}return r}function yXe(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(...Dse(r))}return t}function xXe(e,t){const n=[],r=e.includes("\\")?"\\":"/";let s=IDt(e);for(;s&&QDt(t,s);){const i=`${s}${r}${PDt}`;n.push(i);const o=MDt(s);if(!o||o===s)break;s=o}return n}function SXe(e,t,n){const r=[],s=v=>n?.[v]?.estimatedTokens??OXe,i=n?.enterprise?.path??"/Library/Application Support/ClaudeCode/CLAUDE.md",o=s("enterprise");o>0&&r.push({id:Mp(i),path:i,source:"enterprise",displayName:Qp(i),isGlobal:!0,estimatedTokens:o,firstSeenInGroup:t});const a="~/.claude/CLAUDE.md",c=s("user");c>0&&r.push({id:Mp(a),path:a,source:"user-memory",displayName:Qp(a),isGlobal:!0,estimatedTokens:c,firstSeenInGroup:t});const l=IS(e,"CLAUDE.md"),d=IS(e,".claude/CLAUDE.md"),p=s("project");p>0&&r.push({id:Mp(l),path:l,source:fOe,displayName:Qp(l),isGlobal:!0,estimatedTokens:p,firstSeenInGroup:t});const f=s("project-alt");f>0&&r.push({id:Mp(d),path:d,source:fOe,displayName:Qp(d),isGlobal:!0,estimatedTokens:f,firstSeenInGroup:t});const h=IS(e,".claude/rules/*.md"),m=s("project-rules");m>0&&r.push({id:Mp(h),path:h,source:"project-rules",displayName:Qp(h),isGlobal:!0,estimatedTokens:m,firstSeenInGroup:t});const g=IS(e,"CLAUDE.local.md"),_=s("project-local");_>0&&r.push({id:Mp(g),path:g,source:"project-local",displayName:Qp(g),isGlobal:!0,estimatedTokens:_,firstSeenInGroup:t});const b="~/.claude/rules/**/*.md",y=s("user-rules");y>0&&r.push({id:Mp(b),path:b,source:"user-rules",displayName:Qp(b),isGlobal:!0,estimatedTokens:y,firstSeenInGroup:t});const x=n?.["auto-memory"]?.path??"~/.claude/projects/.../memory/MEMORY.md",S=s("auto-memory");return S>0&&r.push({id:Mp(x),path:x,source:"auto-memory",displayName:Qp(x),isGlobal:!0,estimatedTokens:S,firstSeenInGroup:t}),r}function DDt(e,t){return{id:Mp(e),path:e,source:"directory",displayName:Qp(e),isGlobal:!1,estimatedTokens:OXe,firstSeenInGroup:t}}function LDt(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=SXe(i,d,a);for(const x of y)l.has(x.path)||(c.push(x),l.add(x.path))}const p=[],f=_Xe(t.steps);p.push(...f);const h=bXe(n,i);p.push(...h);const m=yXe(t.responses);for(const y of m)if(y.path){const x=Lse(y.path)?y.path:IS(i,y.path);p.push(x)}for(const y of p){const x=xXe(y,i);for(const S of x){if(l.has(S)||Ng(S)===`${Ng(i)}/CLAUDE.md`||Ng(S)===`${Ng(i)}/.claude/CLAUDE.md`||Ng(S)===`${Ng(i)}/CLAUDE.local.md`)continue;const T=DDt(S,d);c.push(T),l.add(S)}}const g=[...s,...c],_=g.reduce((y,x)=>y+x.estimatedTokens,0),b=o>0?_/o*100:0;return{newInjections:c,accumulatedInjections:g,totalEstimatedTokens:_,percentageOfContext:b,newCount:c.length,accumulatedCount:g.length}}function jDt(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=LDt({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 hOe=25e3,GQ="mentioned-file",vXe=new Set(["SendMessage","TeamCreate","TeamDelete","TaskCreate","TaskUpdate","TaskList","TaskGet"]);function XDt(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 UDt(e){return`tool-output-ai-${e}`}function zDt(e){return`thinking-text-ai-${e}`}function BDt(e){return`task-coord-ai-${e}`}function FDt(e){return`user-msg-ai-${e}`}function xY(e){return{...e,category:"claude-md"}}function mOe(e){return{id:XDt(e.path),category:GQ,path:e.path,displayName:e.displayName,estimatedTokens:e.estimatedTokens,firstSeenTurnIndex:e.turnIndex,firstSeenInGroup:e.aiGroupId,exists:e.exists??!0}}function YDt(e,t,n,r){const s=[];let i=0;for(const o of e.values()){if(vXe.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:UDt(t),category:"tool-output",turnIndex:t,aiGroupId:n,estimatedTokens:i,toolCount:s.length,toolBreakdown:s}}function VDt(e,t,n,r){const s=[];let i=0;for(const o of e.values()){if(!vXe.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:BDt(t),category:"task-coordination",turnIndex:t,aiGroupId:n,estimatedTokens:i,breakdown:s}}function qDt(e,t,n){const r=e.content.rawText??e.content.text??"";if(!r)return null;const s=Xo(r);if(s===0)return null;const i=r.length>80?r.slice(0,80)+"…":r;return{id:FDt(t),category:"user-message",turnIndex:t,aiGroupId:n,estimatedTokens:s,textPreview:i}}function WDt(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:zDt(t),category:"thinking-text",turnIndex:t,aiGroupId:n,estimatedTokens:s,breakdown:r}}function HQ(e){return e.startsWith("/")||e.startsWith("~/")||e.startsWith("~\\")||e==="~"||e.startsWith("\\\\")||/^[a-zA-Z]:[\\/]/.test(e)}function SY(e,t){if(HQ(t))return t;const n=GDt(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=HDt(r,s),c=ZDt(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 GDt(e){let t=e.length;for(;t>0;){const n=e[t-1];if(n!=="/"&&n!=="\\")break;t--}return e.slice(0,t)}function HDt(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 ZDt(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 Sx(e){return e.replace(/\\/g,"/")}function gOe(e,t){return{id:Mp(e),path:e,source:"directory",displayName:Qp(e),isGlobal:!1,estimatedTokens:500,firstSeenInGroup:t}}function KDt(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===GQ).map(w=>w.path)),h=`ai-${t.turnIndex}`;if(i){const w=SXe(a,h,c);for(const P of w)f.has(P.path)||(p.push(xY(P)),f.add(P.path))}const m=[],g=_Xe(t.steps);m.push(...g);const _=bXe(n,a);m.push(..._);const b=yXe(t.responses);for(const w of b)if(w.path){const P=HQ(w.path)?w.path:SY(a,w.path);m.push(P)}for(const w of m){const P=xXe(w,a);for(const C of P)if(!(f.has(C)||Sx(C)===`${Sx(a)}/CLAUDE.md`||Sx(C)===`${Sx(a)}/.claude/CLAUDE.md`||Sx(C)===`${Sx(a)}/CLAUDE.local.md`))if(d){const I=d[C];if(!I||!I.exists||I.estimatedTokens<=0)continue;const Q=gOe(C,h);Q.estimatedTokens=I.estimatedTokens,p.push(xY(Q)),f.add(C)}else{const I=gOe(C,h);p.push(xY(I)),f.add(C)}}if(n?.content.fileReferences)for(const w of n.content.fileReferences){if(!w.path)continue;const P=HQ(w.path)?w.path:SY(a,w.path);if(f.has(P))continue;const C=l?.get(P);if(C&&C.exists&&C.estimatedTokens<=hOe){const k=mOe({path:P,displayName:w.path,estimatedTokens:C.estimatedTokens,turnIndex:t.turnIndex,aiGroupId:h,exists:C.exists});p.push(k),f.add(P)}}for(const w of b){if(!w.path)continue;const P=HQ(w.path)?w.path:SY(a,w.path);if(f.has(P))continue;const C=l?.get(P);if(C&&C.exists&&C.estimatedTokens<=hOe){const k=mOe({path:P,displayName:w.path,estimatedTokens:C.estimatedTokens,turnIndex:t.turnIndex,aiGroupId:h,exists:C.exists});p.push(k),f.add(P)}}const y=YDt(r,t.turnIndex,h,s);y&&p.push(y);const x=VDt(r,t.turnIndex,h,s);if(x&&p.push(x),n){const w=qDt(n,t.turnIndex,h);w&&p.push(w)}if(s){const w=WDt(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 GQ: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 GQ: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 JDt(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 eLt(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 tLt(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,g=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:g}),o=[],a=!0,c=null,l++,g=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=$2e(x.steps,E,x.processes||[],x.responses)}const T=KDt({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&&g&&_){const E=JDt(_),w=eLt(x);E!==void 0&&w!==void 0&&f.set(g,{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:g});const b={phases:d,compactionCount:l-1,aiGroupPhaseMap:p,compactionTokenDeltas:f};return{statsMap:i,phaseInfo:b}}function xZ(e,t){if(nLt(t))return t;const n=rLt(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=sLt(r,s),c=iLt(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 nLt(e){return e.startsWith("/")||e.startsWith("\\\\")||/^[a-zA-Z]:[\\/]/.test(e)}function rLt(e){let t=e.length;for(;t>0;){const n=e[t-1];if(n!=="/"&&n!=="\\")break;t--}return e.slice(0,t)}function sLt(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 iLt(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 vx=to("Store:sessionDetail"),vY=new Map,TY=new Set,EY=new Set,DL=new Map;function oLt(e){const t=e??"__global__",n=(DL.get(t)??0)+1;return DL.set(t,n),n}function Tx(e,t){return DL.get(t??"__global__")===e}let wY="";function OOe(){return{sessionDetail:null,conversation:null,conversationLoading:!1,sessionDetailLoading:!1,sessionDetailError:null,sessionClaudeMdStats:null,sessionContextStats:null,sessionPhaseInfo:null,visibleAIGroupId:null,selectedAIGroup:null}}const aLt=(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=oLt(s);if(i?.silent||e({sessionDetailLoading:!0,sessionDetailError:null,conversationLoading:!0}),s&&!i?.silent){const a=t().tabSessionData;e({tabSessionData:{...a,[s]:{...a[s]??OOe(),sessionDetailLoading:!0,sessionDetailError:null,conversationLoading:!0}}})}try{const a=await Z.getSessionDetail(n,r);if(!Tx(o,s))return;const c=a?.session?.isOngoing??!1,l=a?bT(a.chunks):null,d=a&&l?cP(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:g}=t();let _=null,b=null,y=null;if(g!=="ssh"&&m&&m!==wY&&(wY=m,Z.readAgentConfigs(m).then(w=>{e({agentConfigs:w})}).catch(w=>{vx.error("Failed to read agent configs:",w),wY=""})),g!=="ssh"&&d?.items){let w={};try{if(w=await Z.readClaudeMdFiles(m),!Tx(o,s))return}catch($){vx.error("Failed to read CLAUDE.md files:",$)}_=jDt(d.items,m,w);const P={};if(_&&_.size>0){const $=new Set;for(const R of _.values())for(const N of R.accumulatedInjections)N.source==="directory"&&$.add(N.path);if($.size>0){const R=new Map,N=new Set,j=await Promise.all(Array.from($).map(async M=>{try{const U=M.replace(/[\\/]CLAUDE\.md$/,""),A=await Z.readDirectoryClaudeMd(U);return{fullPath:M,fileInfo:A,error:!1}}catch(U){return vx.error("Failed to read directory CLAUDE.md:",M,U),{fullPath:M,fileInfo:null,error:!0}}}));if(!Tx(o,s))return;for(const{fullPath:M,fileInfo:U,error:A}of j)A||!U?N.add(M):U.exists&&U.estimatedTokens>0?(R.set(M,U.estimatedTokens),P[M]=U):N.add(M);for(const[,M]of _.entries()){M.accumulatedInjections=M.accumulatedInjections.filter(U=>U.source!=="directory"||!N.has(U.path)),M.newInjections=M.newInjections.filter(U=>U.source!=="directory"||!N.has(U.path));for(const U of M.accumulatedInjections)U.source==="directory"&&R.has(U.path)&&(U.estimatedTokens=R.get(U.path));for(const U of M.newInjections)U.source==="directory"&&R.has(U.path)&&(U.estimatedTokens=R.get(U.path));M.totalEstimatedTokens=M.accumulatedInjections.reduce((U,A)=>U+A.estimatedTokens,0),M.accumulatedCount=M.accumulatedInjections.length,M.newCount=M.newInjections.length}}}const C=new Set;for(const $ of d.items)if($.type==="user"&&$.group.content.fileReferences)for(const R of $.group.content.fileReferences){const N=xZ(m,R.path);C.add(N)}for(const $ of d.items)if($.type==="ai")for(const R of $.group.responses){if(R.type!=="user")continue;let N="";if(typeof R.content=="string")N=R.content;else if(Array.isArray(R.content))for(const j of R.content)j.type==="text"&&j.text&&(N+=j.text);if(N)for(const j of Dse(N)){const M=xZ(m,j.path);C.add(M)}}const k=new Map,I=await Promise.all(Array.from(C).map(async $=>{try{const R=await Z.readMentionedFile($,m);return{filePath:$,fileInfo:R}}catch(R){return vx.error("Failed to read mentioned file:",$,R),{filePath:$,fileInfo:null}}}));if(!Tx(o,s))return;for(const{filePath:$,fileInfo:R}of I)R&&k.set($,R);const Q=tLt(d.items,m,w,k,P);b=Q.statsMap,y=Q.phaseInfo}const x=t();if(!Tx(o,s))return;const S=hu(x.paneLayout),v=bZ(S,r);if(v&&a){const w=a.session.firstMessage?yZ(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(vx.error("fetchSessionDetail error:",a),!Tx(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]??OOe(),sessionDetailError:c,sessionDetailLoading:!1,conversationLoading:!1}}})}}},refreshSessionInPlace:async(n,r)=>{const s=t(),o=hu(s.paneLayout).filter(l=>l.type==="session"&&l.sessionId===r);if(s.selectedSessionId!==r&&o.length===0)return;const a=`${n}/${r}`;if(TY.has(a)){EY.add(a);return}const c=(vY.get(a)??0)+1;vY.set(a,c),TY.add(a);try{const l=await Z.getSessionDetail(n,r);if(vY.get(a)!==c||!l)return;const d=l.session?.isOngoing??!1,p=bT(l.chunks);if(!p)return;const f=cP(p,l.processes,d);if(!f)return;const h=t(),m=hu(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(k=>k.type==="ai"&&k.group.id===w);let C=E.selectedAIGroup;if(P&&w){const k=f.items.find(I=>I.type==="ai"&&I.group.id===w);k?.type==="ai"&&(C=k.group)}v[T.id]={...E,sessionDetail:l,conversation:f,...P?{selectedAIGroup:C}:{}}}e({tabSessionData:v})}catch(l){vx.error("refreshSessionInPlace error:",l)}finally{TY.delete(a),EY.has(a)&&(EY.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=>{DL.delete(n);const r=t().tabSessionData;if(!(n in r))return;const s={...r};delete s[n],e({tabSessionData:s})}}),cd=to("Store:session"),lLt=150;function cLt(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 kY=new Map,uLt=(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 Z.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 Z.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 Z.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 cd.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=(kY.get(n)??0)+1;kY.set(n,s);const i=async()=>{const{connectionMode:a}=t();return Z.getSessionsPaginated(n,null,20,{includeTotalCount:!1,prefilterAll:!1,metadataLevel:a==="ssh"?"light":"deep"})},o=a=>{kY.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(cLt(a)&&t().selectedProjectId===n){cd.warn("refreshSessionsInPlace transient IPC error - retrying once");try{if(await new Promise(l=>setTimeout(l,lLt)),t().selectedProjectId!==n)return;const c=await i();o(c);return}catch(c){cd.error("refreshSessionsInPlace retry error:",c);return}}cd.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 Z.config.unpinSession(s,n):await Z.config.pinSession(s,n)}catch(a){e({pinnedSessionIds:o}),cd.error("togglePinSession error:",a)}},loadPinnedSessions:async()=>{const r=t().selectedProjectId;if(!r){e({pinnedSessionIds:[]});return}try{const{connectionMode:s}=t(),a=((await Z.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 Z.getSessionsByIds(r,d,{metadataLevel:s==="ssh"?"light":"deep"});if(p.length>0){const f=t().sessions,h=new Set(f.map(g=>g.id)),m=p.filter(g=>!h.has(g.id));m.length>0&&e({sessions:[...f,...m]})}}}catch(s){cd.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 Z.config.unhideSession(s,n):await Z.config.hideSession(s,n)}catch(a){e({hiddenSessionIds:o}),cd.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 Z.config.hideSessions(s,n)}catch(c){e({hiddenSessionIds:i}),cd.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 Z.config.unhideSessions(s,n)}catch(a){e({hiddenSessionIds:i}),cd.error("unhideMultipleSessions error:",a)}},loadHiddenSessions:async()=>{const r=t().selectedProjectId;if(!r){e({hiddenSessionIds:[]});return}try{const o=((await Z.config.get()).sessions?.hiddenSessions?.[r]??[]).map(a=>a.sessionId);e({hiddenSessionIds:o})}catch(s){cd.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=>Z.config.pinSession(s,c)))}catch(c){e({pinnedSessionIds:i}),cd.error("pinMultipleSessions error:",c)}}}),dLt=(e,t)=>({drillDownStack:[],currentSubagentDetail:null,subagentDetailLoading:!1,subagentDetailError:null,drillDownSubagent:async(n,r,s,i)=>{e({subagentDetailLoading:!0,subagentDetailError:null});try{const o=await Z.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}),Z.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 Ro(e){const t=hXe(e);return{paneLayout:e,openTabs:t.openTabs,activeTabId:t.activeTabId,selectedTabIds:t.selectedTabIds}}function L1(e,t,n){const r=kh(e,t);return r?io(e,{...r,tabs:r.tabs.map(s=>s.id===t?n(s):s)}):e}const pLt=(e,t)=>({openTabs:[],activeTabId:null,selectedTabIds:[],activeProjectId:null,openTab:(n,r)=>{const s=t(),{paneLayout:i}=s,o=Bl(i,i.focusedPaneId);if(!o)return;if(n.type==="session"&&n.sessionId&&!r?.forceNewTab){const d=hu(i),p=bZ(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:yZ(n.label),createdAt:Date.now()},m={...o,tabs:o.tabs.map(_=>_.id===f.id?h:_),activeTabId:h.id},g=io(i,m);e(Ro(g));return}}const a={...n,id:crypto.randomUUID(),label:yZ(n.label),createdAt:Date.now()},c={...o,tabs:[...o.tabs,a],activeTabId:a.id},l=io(i,c);e(Ro(l))},closeTab:n=>{const r=t(),{paneLayout:s}=r,i=kh(s,n);if(!i)return;const o=i.tabs.findIndex(f=>f.id===n);if(o===-1)return;r.cleanupTabUIState(n),r.cleanupTabSessionData(n);const a=i.tabs.filter(f=>f.id!==n);let c=i.activeTabId;if(i.activeTabId===n&&(c=a[o]?.id??a[o-1]?.id??null),a.length===0&&s.panes.length>1){r.closePane(i.id);return}const l=s.panes.filter(f=>f.id!==i.id).flatMap(f=>f.tabs);if(a.length===0&&l.length===0){const f={...i,tabs:[],activeTabId:null,selectedTabIds:[]},h=io(s,f);e({...Ro(h),...iT()});return}const d={...i,tabs:a,activeTabId:c,selectedTabIds:i.selectedTabIds.filter(f=>f!==n)},p=io(s,d);e(Ro(p)),c&&t().setActiveTab(c)},setActiveTab:n=>{const r=t(),{paneLayout:s}=r,i=r.getActiveTab(),a=kh(s,n)?.tabs.find(f=>f.id===n);i?.id!==n&&Zxt(i?.label??"none",a?.label??n);const c=kh(s,n);if(!c)return;const l=c.tabs.find(f=>f.id===n);if(!l)return;const d={...c,activeTabId:n};let p=io(s,d);if(p={...p,focusedPaneId:c.id},e(Ro(p)),l.type==="session"&&l.sessionId&&l.projectId){const f=l.sessionId,h=l.projectId,m=r.selectedSessionId!==f,g=r.tabSessionData[n],_=g?.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:g.sessionDetail,conversation:g.conversation,conversationLoading:!1,sessionDetailLoading:!1,sessionDetailError:null,sessionClaudeMdStats:g.sessionClaudeMdStats,sessionContextStats:g.sessionContextStats,sessionPhaseInfo:g.sessionPhaseInfo,visibleAIGroupId:g.visibleAIGroupId,selectedAIGroup:g.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:g.sessionDetail,conversation:g.conversation,conversationLoading:!1,sessionDetailLoading:!1,sessionDetailError:null,sessionClaudeMdStats:g.sessionClaudeMdStats,sessionContextStats:g.sessionContextStats,sessionPhaseInfo:g.sessionPhaseInfo,visibleAIGroupId:g.visibleAIGroupId,selectedAIGroup:g.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=dr(h),g=r.projects.find(_=>dr(_.path)===m);if(g&&r.selectedProjectId!==g.id)r.selectProject(g.id);else if(!g)for(const _ of r.repositoryGroups){const b=_.worktrees.find(y=>dr(y.path)===m);if(b&&r.selectedWorktreeId!==b.id){e(MU(_.id,b.id)),t().fetchSessionsInitial(b.id);break}}}}},openDashboard:()=>{const n=t(),{paneLayout:r}=n,s=hu(r).find(l=>l.type==="dashboard");if(s){const l=kh(r,s.id);if(l){const d=l.tabs.findIndex(f=>f.id===s.id),p=l.tabs.length-1;if(d!==-1&&d!==p){const f=[...l.tabs],[h]=f.splice(d,1);f.push(h);const m={...l,tabs:f,activeTabId:s.id},g=io(r,m);e(Ro(g));return}}n.setActiveTab(s.id);return}const i=Bl(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=io(r,a);e(Ro(c))},openSessionReport:n=>{const r=t(),i=hu(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=Bl(n.paneLayout,n.paneLayout.focusedPaneId);return r?.activeTabId?r.tabs.find(s=>s.id===r.activeTabId)??null:null},isSessionOpen:n=>hu(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(Ro(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(Ro(i))},saveTabScrollPosition:(n,r)=>{const{paneLayout:s}=t(),i=L1(s,n,o=>({...o,savedScrollTop:r}));e(Ro(i))},updateTabLabel:(n,r)=>{const{paneLayout:s}=t(),i=L1(s,n,o=>({...o,label:r}));e(Ro(i))},setTabContextPanelVisible:(n,r)=>{const{paneLayout:s}=t(),i=L1(s,n,o=>({...o,showContextPanel:r}));e(Ro(i))},setSelectedTabIds:n=>{const{paneLayout:r}=t(),s=Bl(r,r.focusedPaneId);if(!s)return;const i={...s,selectedTabIds:n},o=io(r,i);e(Ro(o))},clearTabSelection:()=>{const{paneLayout:n}=t(),r=Bl(n,n.focusedPaneId);if(!r)return;const s={...r,selectedTabIds:[]},i=io(n,s);e(Ro(i))},closeOtherTabs:n=>{const r=t(),{paneLayout:s}=r,i=kh(s,n);if(!i)return;const o=i.tabs.filter(d=>d.id!==n);for(const d of o)r.cleanupTabUIState(d.id),r.cleanupTabSessionData(d.id);const a=i.tabs.find(d=>d.id===n);if(!a)return;const c={...i,tabs:[a],activeTabId:n,selectedTabIds:[]},l=io(s,c);e(Ro(l)),t().setActiveTab(n)},closeTabsToRight:n=>{const r=t(),{paneLayout:s}=r,i=kh(s,n);if(!i)return;const o=i.tabs.findIndex(h=>h.id===n);if(o===-1)return;const a=i.tabs.slice(o+1);for(const h of a)r.cleanupTabUIState(h.id),r.cleanupTabSessionData(h.id);const c=i.tabs.slice(0,o+1),d=c.some(h=>h.id===i.activeTabId)?i.activeTabId:n,p={...i,tabs:c,activeTabId:d,selectedTabIds:[]},f=io(s,p);e(Ro(f)),d&&t().setActiveTab(d)},closeAllTabs:()=>{const n=t(),r=hu(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({...Ro({panes:[{id:s,tabs:[],activeTabId:null,selectedTabIds:[],widthFraction:1}],focusedPaneId:s}),...iT()})},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=io(i,{...l,tabs:d,activeTabId:p,selectedTabIds:l.selectedTabIds.filter(f=>!s.has(f))})}if(hu(i).length===0){r.closeAllTabs();return}for(const l of o)i=nk(i,l);e(Ro(i));const c=t().activeTabId;c&&t().setActiveTab(c)},setActiveProject:n=>{e({activeProjectId:n}),t().selectProject(n)},clearActiveProject:()=>{e({activeProjectId:null,selectedProjectId:null,selectedRepositoryId:null,selectedWorktreeId:null,...Xh()})},navigateToSession:(n,r,s=!1,i)=>{const o=t(),a=hu(o.paneLayout),c=gXe(a,r,n)??bZ(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=uOe({...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=uOe({...f});o.enqueueTabNavigation(p,h)}}const l=t().activeTabId??void 0;o.fetchSessionDetail(n,r,l)}}});function yp(){return{expandedAIGroupIds:new Set,expandedDisplayItemIds:new Map,expandedSubagentTraceIds:new Set,showContextPanel:!1,selectedContextPhase:null,savedScrollTop:void 0}}const fLt=(e,t)=>({tabUIStates:new Map,initTabUIState:n=>{const r=t();if(r.tabUIStates.has(n))return;const s=new Map(r.tabUIStates);s.set(n,yp()),e({tabUIStates:s})},cleanupTabUIState:n=>{const r=t();if(!r.tabUIStates.has(n))return;const s=new Map(r.tabUIStates);s.delete(n),e({tabUIStates:s})},toggleAIGroupExpansionForTab:(n,r)=>{const s=t(),i=new Map(s.tabUIStates),o=i.get(n)??yp(),a=new Set(o.expandedAIGroupIds);a.has(r)?a.delete(r):a.add(r),i.set(n,{...o,expandedAIGroupIds:a}),e({tabUIStates:i})},isAIGroupExpandedForTab:(n,r)=>t().tabUIStates.get(n)?.expandedAIGroupIds.has(r)??!1,expandAIGroupForTab:(n,r)=>{const s=t();if(s.tabUIStates.get(n)?.expandedAIGroupIds.has(r))return;const o=new Map(s.tabUIStates),a=o.get(n)??yp(),c=new Set(a.expandedAIGroupIds);c.add(r),o.set(n,{...a,expandedAIGroupIds:c}),e({tabUIStates:o})},toggleDisplayItemExpansionForTab:(n,r,s)=>{const i=t(),o=new Map(i.tabUIStates),a=o.get(n)??yp(),c=new Map(a.expandedDisplayItemIds),l=c.get(r)??new Set,d=new Set(l);d.has(s)?d.delete(s):d.add(s),c.set(r,d),o.set(n,{...a,expandedDisplayItemIds:c}),e({tabUIStates:o})},getExpandedDisplayItemIdsForTab:(n,r)=>t().tabUIStates.get(n)?.expandedDisplayItemIds.get(r)??new Set,expandDisplayItemForTab:(n,r,s)=>{const i=t();if(i.tabUIStates.get(n)?.expandedDisplayItemIds.get(r)?.has(s))return;const c=new Map(i.tabUIStates),l=c.get(n)??yp(),d=new Map(l.expandedDisplayItemIds),p=new Set(d.get(r)??new Set);p.add(s),d.set(r,p),c.set(n,{...l,expandedDisplayItemIds:d}),e({tabUIStates:c})},toggleSubagentTraceExpansionForTab:(n,r)=>{const s=t(),i=new Map(s.tabUIStates),o=i.get(n)??yp(),a=new Set(o.expandedSubagentTraceIds);a.has(r)?a.delete(r):a.add(r),i.set(n,{...o,expandedSubagentTraceIds:a}),e({tabUIStates:i})},expandSubagentTraceForTab:(n,r)=>{const s=t(),i=s.tabUIStates.get(n)??yp();if(i.expandedSubagentTraceIds.has(r))return;const o=new Set(i.expandedSubagentTraceIds);o.add(r);const a=new Map(s.tabUIStates);a.set(n,{...i,expandedSubagentTraceIds:o}),e({tabUIStates:a})},isSubagentTraceExpandedForTab:(n,r)=>t().tabUIStates.get(n)?.expandedSubagentTraceIds.has(r)??!1,setContextPanelVisibleForTab:(n,r)=>{const s=t(),i=new Map(s.tabUIStates),o=i.get(n)??yp();i.set(n,{...o,showContextPanel:r}),e({tabUIStates:i})},isContextPanelVisibleForTab:n=>t().tabUIStates.get(n)?.showContextPanel??!1,setSelectedContextPhaseForTab:(n,r)=>{const s=t(),i=new Map(s.tabUIStates),o=i.get(n)??yp();i.set(n,{...o,selectedContextPhase:r}),e({tabUIStates:i})},saveScrollPositionForTab:(n,r)=>{const s=t(),i=new Map(s.tabUIStates),o=i.get(n)??yp();i.set(n,{...o,savedScrollTop:r}),e({tabUIStates:i})},getScrollPositionForTab:n=>t().tabUIStates.get(n)?.savedScrollTop}),hLt=80;function Ls(e){if(typeof e.messageId=="string"&&e.messageId.trim().length>0)return e.messageId;const t=(e.text??"").slice(0,hLt);return`${e.timestamp}-${e.from}-${t}`}function mLt(e,t){const n=Date.parse(t.timestamp)-Date.parse(e.timestamp);return n!==0?n:Ls(e).localeCompare(Ls(t))}function SZ(...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(mLt)}const gLt="OpenCode runtime delivery is still being checked. Message was saved and will be retried if needed.";function OLt(e){const t=e.runtimeDelivery;return t?.attempted!==!0?{warning:null,debugDetails:null}:t.delivered===!1?{warning:null,debugDetails:{messageId:e.messageId,providerId:t.providerId,delivered:!1,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??[]}}:t.responsePending===!0?{warning:gLt,debugDetails:{messageId:e.messageId,providerId:t.providerId,delivered:null,responsePending:!0,responseState:t.responseState??null,ledgerStatus:t.ledgerStatus??null,acceptanceUnknown:typeof t.acceptanceUnknown=="boolean"?t.acceptanceUnknown:null,reason:t.reason??null,diagnostics:t.diagnostics??[]}}:{warning:null,debugDetails:null}}function _Lt(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 bLt=/^(?<source>[a-z0-9-]+)\/(?<model>\S.*)$/i,yLt={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 xLt(e){const t=e.trim().toLowerCase();if(!t)return e;const n=yLt[t];return n||t.split("-").filter(Boolean).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")}function LL(e){const t=e?.trim();if(!t)return null;const n=bLt.exec(t);return!n?.groups?.source||!n.groups.model?null:{raw:t,sourceId:n.groups.source.toLowerCase(),modelId:n.groups.model}}function SLt(e){const t=LL(e);return t?xLt(t.sourceId):null}function rk(e){return e==="anthropic"||e==="codex"||e==="gemini"||e==="opencode"}function ka(e){return rk(e)?e:void 0}function CO(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(LL(t)||LL(n))return"opencode"}function _Oe(e){const t=e?.trim();if(t)return t.replace(/(?:\[1m\])+$/,"")||void 0}function jse(e,t){const n=e?.trim();return n?(t??CO(n)??CO(_Oe(n)))!=="anthropic"?n:_Oe(n):void 0}const bOe=to("Renderer:unwrapIpc");class Ch extends Error{constructor(t,n,r){super(n),this.operation=t,this.causeError=r,this.name="IpcError"}}const vLt=["TEAM_PROVISIONING","TEAM_DRAFT"];async function ir(e,t){try{return await t()}catch(n){const r=n instanceof Error?n.message:String(n);throw vLt.some(s=>r.includes(s))?bOe.debug(`[${e}] ${r}`):bOe.error(`[${e}] ${r}`),new Ch(e,r,n)}}const B0={autoAllowAll:!1,autoAllowFileEdits:!1,autoAllowSafeBash:!1,timeoutAction:"wait",timeoutSeconds:30},TLt=/^[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 ELt(e){return TLt.test(e.trim())}function Ui(e){const t=e.trim();return t&&(ELt(t)?t.slice(0,8).toLowerCase():t)}function r_(e){return e.displayId?.trim()||Ui(e.id)}function Ps(e){return`#${r_(e)}`}function sk(e,t){if(!t)return!1;const n=t.trim();return n?e.id===n||r_(e)===n:!1}const pz="team-lead",TXe="lead",wLt="负责人",kLt=new Set([pz,TXe]),CLt=new Set([pz,TXe,"orchestrator"]),RLt=new Set(["lead"]);function Xse(e){return e?.trim().toLowerCase()??""}function s_(e){return kLt.has(Xse(e))}function PLt(e){return CLt.has(Xse(e))}function $Lt(e){return RLt.has(Xse(e))}function Jn(e){const t=typeof e.role=="string"?e.role:null;if($Lt(t))return!0;const n=typeof e.agentType=="string"?e.agentType:null;if(PLt(n))return!0;const r=typeof e.name=="string"?e.name:null;return s_(r)}function ZQ(e){const t=e.agentId?.trim();return t||e.name.trim()}const NLt=[[],[{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 EXe(e,t=[]){const n=e.filter(a=>!a.removedAt&&!Jn(a));if(n.length===0)return[];const r=new Map(n.map(a=>[ZQ(a),a])),s=[],i=new Set;for(const a of t){if(a.removedAt||Jn(a))continue;const c=ZQ(a);!r.has(c)||i.has(c)||(s.push(c),i.add(c))}const o=n.map(a=>ZQ(a)).filter(a=>!i.has(a)).toSorted((a,c)=>a.localeCompare(c));return s.push(...o),s}function KQ(e,t=[]){const n=EXe(e,t),r=n.length>0?n.join("|"):null,s=NLt[n.length],i={};return s?.length===n.length&&n.forEach((o,a)=>{i[o]=s[a]}),{orderedVisibleOwnerIds:n,signature:r,assignments:i}}const su="stable-slots-v1",Cp=to("teamSlice"),wXe=3e4,yOe=3e4,ALt=5e3,ILt=4e3,MLt=2e3,F0=new Map,yT=new Map,jL=new Set,nS=new Map,rS=new Map,g0=new Map,vZ=new Set,ik=new Map,TZ=new Set,pC=new Map,Y0=new Map,XL=new Map,kXe=new Map;let j1=null,CY=!1;const JQ=new Map,EZ=new Map,wZ=new Map;function RY(e){return F0.has(e)||(yT.get(e)?.size??0)>0||jL.has(e)}function xOe(e){return XL.get(e)}function QLt(e){return(Y0.get(e)?.size??0)>0}function DLt(){return new Set(Array.from(Y0.entries()).filter(([,e])=>e.size>0).map(([e])=>e))}function LLt(e){PZ.delete(e),$Z.delete(e);const t=`${e}:`;for(const n of BL.keys())n.startsWith(t)&&BL.delete(n);for(const n of FL.keys())n.startsWith(t)&&FL.delete(n)}function X1(e){F0.delete(e),yT.delete(e),jL.delete(e),nS.delete(e),rS.delete(e),g0.delete(e),vZ.delete(e),ik.delete(e),TZ.delete(e),XL.delete(e),JQ.delete(e),EZ.delete(e),wZ.delete(e),LLt(e)}function SOe(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 _a(e,t){if(!(t in e))return null;const n={...e};return delete n[t],n}function PY(e,t){const n=Object.fromEntries(Object.entries(e.provisioningRuns).filter(([,x])=>x.teamName!==t)),r=_a(e.teamDataCacheByName,t),s=_a(e.teamAgentRuntimeByTeam,t),i=_a(e.teamMessagesByName,t),o=_a(e.memberActivityMetaByTeam,t),a=_a(e.provisioningSnapshotByTeam,t),c=_a(e.currentProvisioningRunIdByTeam,t),l=_a(e.currentRuntimeRunIdByTeam,t),d=_a(e.provisioningStartedAtFloorByTeam,t),p=_a(e.leadActivityByTeam,t),f=_a(e.leadContextByTeam,t),h=_a(e.activeToolsByTeam,t),m=_a(e.finishedVisibleByTeam,t),g=_a(e.toolHistoryByTeam,t),_=_a(e.memberSpawnStatusesByTeam,t),b=_a(e.memberSpawnSnapshotsByTeam,t),y=_a(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}:{},...g?{toolHistoryByTeam:g}:{},..._?{memberSpawnStatusesByTeam:_}:{},...b?{memberSpawnSnapshotsByTeam:b}:{},...y?{provisioningErrorByTeam:y}:{}}}function vOe(e,t,n){const r={...e.ignoredProvisioningRunIds},s={...e.ignoredRuntimeRunIds},i=e.currentProvisioningRunIdByTeam[t],o=e.currentRuntimeRunIdByTeam[t];return i&&(r[i]=t),o&&(s[o]=t),{ignoredProvisioningRunIds:r,ignoredRuntimeRunIds:s,provisioningStartedAtFloorByTeam:{...e.provisioningStartedAtFloorByTeam,[t]:n}}}function Sh(e){return kXe.get(e)??0}function mc(e,t){return Sh(e)===t}function U1(e){kXe.set(e,Sh(e)+1)}function jLt(e){const t=Symbol(e),n=yT.get(e);return n?(n.add(t),t):(yT.set(e,new Set([t])),t)}function XLt(e,t){const n=yT.get(e);n&&(n.delete(t),n.size===0&&yT.delete(e))}function z1(){return new Date().toISOString()}function ULt(e){return new Promise(t=>setTimeout(t,e))}function TOe(e){if(e==null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function kZ(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=kZ(e[i],s);return Object.is(o,e[i])||(n=!0),o});return n?r:e}if(TOe(e)&&TOe(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=kZ(n[c],r[c]);Object.is(l,n[c])||(o=!0),a[c]=l}return o?a:e}return t}function EOe(e,t){return e?kZ(e,t):t}const zLt=new Set(["validating","spawning","configuring","assembling","finalizing","verifying"]),UL=new Set(["ready","failed","disconnected","cancelled"]);function wOe(e){return e.startsWith("pending:")}function BLt(e){return(e instanceof Error?e.message:String(e)).includes("Unknown runId")}function zL(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 kOe(e){const t=F0.get(e);if(t)return t;const n=zL(ir("team:getData",()=>Z.teams.getData(e)),wXe,`team:getData(${e})`).finally(()=>{F0.get(e)===n&&F0.delete(e)});return F0.set(e,n),n}function FLt(e){return zL(ir("team:getData",()=>Z.teams.getData(e)),wXe,`team:getData(${e})`)}function YLt(e){const t=Date.now(),n=EZ.get(e)??{windowStartedAt:t,count:0,lastWarnAt:0};return t-n.windowStartedAt>ILt&&(n.windowStartedAt=t,n.count=0),n.count+=1,EZ.set(e,n),n.count}function VLt(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 WLt(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 GLt(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)||!WLt(e[s],t[s]))return!1;return!0}function HLt(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)&&VLt(e.summary,t.summary)&&GLt(e.statuses,t.statuses):!1}function ZLt(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 KLt(e,t){const n=Date.now(),r=wZ.get(e)??0;n-r<MLt||(wZ.set(e,n),Cp.debug(`[perf] member-spawn snapshot suppressed team=${e} runId=${t??"none"} reason=member-spawn-ui-equal`))}function JLt(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 e5t(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)||!JLt(e.members[s],t.members[s]))return!1;return!0}function t5t(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 n5t={canonicalMessages:[],optimisticMessages:[],feedRevision:null,nextCursor:null,hasMore:!1,lastFetchedAt:null,loadingHead:!1,loadingOlder:!1,headHydrated:!1,olderHydrated:!1};function so(e,t){return e.teamMessagesByName[t]??n5t}function $Y(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(t5t),{...e,optimisticMessages:n}}function r5t(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 s5t(e,t){if(e.length===0)return e;const n=new Set(t.map(s=>typeof s.messageId=="string"?s.messageId.trim():"").filter(s=>s.length>0)),r=e.filter(s=>{const i=typeof s.messageId=="string"?s.messageId.trim():"";return!i||!n.has(i)});return r.length===e.length?e:r}function Ex(e){const t=pC.get(e);t!=null&&(clearTimeout(t),pC.delete(e))}function B1(e){Y0.delete(e)}function i5t(e,t,n){if(n){const s=Y0.get(e)??new Set;return s.add(t),Y0.set(e,s),!0}const r=Y0.get(e);return r?(r.delete(t),r.size===0?(Y0.delete(e),!1):!0):!1}function o5t(e,t){return t<=0?[]:e.slice(0,t)}function a5t(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=Yc(s);if(!wre(i)||typeof r.invalidateTaskChangePresence!="function"||typeof r.checkTaskHasChanges!="function")return;const o=kd(t,n,i);r.invalidateTaskChangePresence([o]);try{await r.checkTaskHasChanges(t,n,i)}catch{}}async function COe(e,t,n){let s=500;for(let i=1;i<=60;i++){const o=e(),a=o.provisioningRuns[t];if(a&&UL.has(a.state))return;try{const c=await o.getProvisioningStatus(t);if(UL.has(c.state))return}catch(c){if(BLt(c)){o.clearMissingProvisioningRun(t);return}}await ULt(s),s=Math.min(1500,Math.round(s*1.5))}}const e2=new Set,MS=new Set,CZ=new Set,RZ=new Set,ok=new Set;let ROe=!0;function l5t(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"&&!e2.has(s)&&(e2.add(s),c5t(r,!n)):e2.delete(s)}}function c5t(e,t){const n=e.comments?.length?e.comments[e.comments.length-1]:void 0,r=n?.text||e.description||`${Ps(e)}: ${e.subject}`,s=$a(r).trim();Z.teams?.showMessageNotification({teamName:e.teamName,teamDisplayName:e.teamDisplayName,from:n?.author||"lead",to:"user",summary:`Clarification needed — Task ${Ps(e)}`,body:s,teamEventType:"task_clarification",dedupeKey:`clarification:${e.teamName}:${e.id}:${e.updatedAt??Date.now()}`,suppressToast:t}).catch(()=>{})}function u5t(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=Xb(a),d=Xb(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 g=p?"approved":f?"review":h?"needsFix":a.status;if(!i.includes(g))continue;const _=`${a.teamName}:${a.id}:${g}`;if(MS.has(_))continue;MS.add(_);const b=p||f?"Completed":c.status;d5t(a,b,p?"approved":f?"review":h?"needsFix":void 0,!s)}}function d5t(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;Z.teams?.showMessageNotification({teamName:e.teamName,teamDisplayName:e.teamDisplayName,from:e.owner??"system",to:"user",summary:`Task ${Ps(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 p5t(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}`;CZ.has(p)||(CZ.add(p),f5t(s,d,!n))}}}function f5t(e,t,n){if(t.author==="user")return;const r=$a(t.text).trim(),s=r.length>100?r.slice(0,100)+"...":r;Z.teams?.showMessageNotification({teamName:e.teamName,teamDisplayName:e.teamDisplayName,from:t.author,to:"user",summary:`Comment on ${Ps(e)}: ${e.subject}`,body:s,teamEventType:"task_comment",dedupeKey:`comment:${e.teamName}:${e.id}:${t.id}`,suppressToast:n}).catch(()=>{})}function h5t(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)||RZ.has(i)||(RZ.add(i),m5t(s,!n))}}function m5t(e,t){Z.teams?.showMessageNotification({teamName:e.teamName,teamDisplayName:e.teamDisplayName,from:e.owner??"system",to:"user",summary:`New task ${Ps(e)}: ${e.subject}`,body:$a(e.description||e.subject).trim(),teamEventType:"task_created",dedupeKey:`created:${e.teamName}:${e.id}`,suppressToast:t}).catch(()=>{})}function g5t(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")){ok.delete(s);continue}if(ok.has(s))continue;const a=e.filter(l=>l.teamName===s);if(a.length>0&&a.every(l=>l.status==="completed"||l.status==="deleted")){ok.add(s);continue}ok.add(s),O5t(i[0],i.length,!n)}}function O5t(e,t,n){Z.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 POe(e,t,n){const r=new Set(n.map(o=>kd(e,o.id,Yc(o)))),s=[],i=new Set;for(const o of t){const a=kd(e,o.id,Yc(o));r.has(a)||(s.push(a),i.add(o.id))}return{cacheKeys:s,taskIds:[...i]}}function $Oe(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=kd(e,a.id,Yc(a)),l=kd(e,o.id,Yc(o));return c!==l?o:(s=!0,{...o,changePresence:a.changePresence})});return s?i:n}function NOe(e){const t=e instanceof Ch||e instanceof Error?e.message:"";return t.includes("Failed to verify inbox write")?"Message was written but not verified (race). Please try again.":t||"Failed to send message"}function AOe(e){const t=e instanceof Ch||e instanceof Error?e.message:"";return t.includes("Task status update verification failed")?"Failed to update task status (possible agent conflict).":t||"Failed to perform review action"}const PZ=new Map,BL=new Map,$Z=new Map,_5t=[],b5t=[],FL=new Map;function y5t(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 x5t(e,t){return e.map(n=>CXe(n,t?.members[n.name]))}function CXe(e,t){return{...e,status:y5t(e,t),messageCount:t?.messageCountExact??0,lastActiveAt:t?.lastAuthoredMessageAt??null}}function S5t(e,t){return e?e.memberName===t.memberName&&e.lastAuthoredMessageAt===t.lastAuthoredMessageAt&&e.messageCountExact===t.messageCountExact&&e.latestAuthoredMessageSignalsTermination===t.latestAuthoredMessageSignalsTermination:!1}function v5t(e,t){if(!e)return t;const n=Object.keys(t),r=Object.keys(e);let s=n.length!==r.length;const i={};for(const o of n){const a=t[o],c=e[o];if(!S5t(c,a)){s=!0,i[o]=a;continue}i[o]=c}return s?i:e}function Ri(e,t){return t?e.teamDataCacheByName[t]??(e.selectedTeamName===t?e.selectedTeamData:null):null}function kl(e,t){const n=Ri(e,t);if(!n||!t)return[];const r=e.memberActivityMetaByTeam[t],s=r?.members,i=PZ.get(t);if(i?.snapshotRef===n.members&&i.metaMembersRef===s)return i.result;const o=x5t(n.members,r);return PZ.set(t,{snapshotRef:n.members,metaMembersRef:s,result:o}),o}function RXe(e,t,n){const r=Ri(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=BL.get(o);if(a?.snapshotMemberRef===s&&a.metaEntryRef===i)return a.result;const c=CXe(s,i);return BL.set(o,{snapshotMemberRef:s,metaEntryRef:i,result:c}),c}function Use(e,t){return Ri(e,t)?.members??_5t}function T5t(e,t){return Ri(e,t)?.tasks??b5t}function E5t(e,t){return Ri(e,t)?.isAlive}function fz(e,t){if(!t)return[];const n=so(e,t),r=$Z.get(t);if(r?.canonicalRef===n.canonicalMessages&&r.optimisticRef===n.optimisticMessages)return r.result;const s=SZ(n.canonicalMessages,n.optimisticMessages);return $Z.set(t,{canonicalRef:n.canonicalMessages,optimisticRef:n.optimisticMessages,result:s}),s}function PXe(e,t,n){if(!t||!n)return[];const r=fz(e,t),s=`${t}:${n}`,i=FL.get(s);if(i?.messagesRef===r)return i.result;const o=r.filter(a=>a.from===n||a.to===n);return FL.set(s,{messagesRef:r,result:o}),o}function IOe(e,t){const n=e.memberActivityMetaByTeam[t],r=so(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 w5t(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 k5t(e,t){const n=w5t(e,t);return Object.keys(n).length>0?n:void 0}function C5t(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 MOe(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 R5t(e,t){return t==="TEAM_DRAFT"||t.includes("TEAM_DRAFT")||t===`Team not found: ${e}`||t==="Team config not found"}const NZ="team:launchParams:";function Ef(e,t){const n=e.currentProvisioningRunIdByTeam[t];return n?e.provisioningRuns[n]??null:null}function T_(e,t){const n=Ef(e,t);return n!=null&&zLt.has(n.state)}function P5t(){const e={};try{const t=localStorage;if(!t)return e;for(let n=0;n<t.length;n++){const r=t.key(n);if(r?.startsWith(NZ)){const s=r.slice(NZ.length),i=JSON.parse(t.getItem(r));i&&typeof i=="object"&&(e[s]=i)}}}catch{}return e}function QOe(e,t){try{localStorage?.setItem?.(NZ+e,JSON.stringify(t))}catch{}}function DOe(e,t){return jse(e,t)}const $Xe="team:toolApprovalSettings:";function NXe(e){if(!e)return B0;try{const t=JSON.parse(e),n=B0;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 B0}}function $5t(e){return NXe(localStorage?.getItem?.($Xe+e)??null)}function NY(e,t){try{localStorage?.setItem?.($Xe+e,JSON.stringify(t))}catch{}}function N5t(){return NXe(localStorage?.getItem?.("team:toolApprovalSettings")??null)}const A5t=(e,t)=>({teams:[],teamByName:{},teamBySessionId:{},branchByPath:{},teamsLoading:!1,teamsError:null,globalTasks:[],globalTasksLoading:!1,globalTasksInitialized:!1,globalTasksError:null,selectedTeamName:null,selectedTeamData:null,teamDataCacheByName:{},slotLayoutVersion:su,graphLayoutModeByTeam:{},gridOwnerOrderByTeam:{},slotAssignmentsByTeam:{},teamMessagesByName:{},memberActivityMetaByTeam:{},graphLayoutSessionByTeam:{},selectedTeamLoading:!1,selectedTeamLoadNonce:0,selectedTeamError:null,sendingMessage:!1,sendMessageError:null,sendMessageWarning:null,sendMessageDebugDetails:null,lastSendMessageResult:null,crossTeamTargets:[],crossTeamTargetsLoading:!1,reviewActionError:null,provisioningRuns:{},provisioningSnapshotByTeam:{},currentProvisioningRunIdByTeam:{},currentRuntimeRunIdByTeam:{},ignoredProvisioningRunIds:{},ignoredRuntimeRunIds:{},provisioningStartedAtFloorByTeam:{},leadActivityByTeam:{},leadContextByTeam:{},activeToolsByTeam:{},finishedVisibleByTeam:{},toolHistoryByTeam:{},memberSpawnStatusesByTeam:{},memberSpawnSnapshotsByTeam:{},teamAgentRuntimeByTeam:{},provisioningErrorByTeam:{},clearProvisioningError:n=>e(r=>{if(!n)return{provisioningErrorByTeam:{}};if(!(n in r.provisioningErrorByTeam))return{};const s={...r.provisioningErrorByTeam};return delete s[n],{provisioningErrorByTeam:s}}),launchParamsByTeam:P5t(),fetchMemberSpawnStatuses:async n=>{if(!(!Z.teams?.getMemberSpawnStatuses||(JQ.get(n)??0)>Date.now()))try{const s=await Z.teams.getMemberSpawnStatuses(n);JQ.delete(n),e(i=>{const o=ZLt(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 HLt(c,s)?(KLt(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'")&&JQ.set(n,Date.now()+ALt)}},fetchTeamAgentRuntime:async n=>{if(Z.teams?.getTeamAgentRuntime)try{const r=await Z.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 e5t(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:N5t(),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 Z.teams.getProjectBranch(i);return[dr(i),o]}catch{return[dr(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 zL(ir("team:list",()=>Z.teams.list()),yOe,"fetchTeams"),s={},i={};for(const o of r)if(s[o.teamName]=o,o.leadSessionId&&(i[o.leadSessionId]=o),Array.isArray(o.sessionHistory))for(const a of o.sessionHistory)typeof a=="string"&&a&&(i[a]=o);e(o=>{const a={...o.provisioningSnapshotByTeam};for(const c of r)delete a[c.teamName];return{teams:r,teamByName:s,teamBySessionId:i,teamsLoading:!1,teamsError:null,provisioningSnapshotByTeam:a}})}catch(r){e({teamsLoading:!1,teamsError:n?r instanceof Ch||r instanceof Error?r.message:"Failed to fetch teams":null})}},fetchAllTasks:async()=>{if(j1){CY=!0,await j1;return}const r=(async()=>{do{CY=!1;const s=!t().globalTasksInitialized;s&&e({globalTasksLoading:!0,globalTasksError:null});const i=t().globalTasks,o=ROe;ROe=!1;try{const a=await zL(ir("team:getAllTasks",()=>Z.teams.getAllTasks()),yOe,"fetchAllTasks");if(o){for(const l of a){l.needsClarification==="user"&&e2.add(`${l.teamName}:${l.id}`),MS.add(`${l.teamName}:${l.id}:${l.status}`),l.reviewState==="needsFix"&&MS.add(`${l.teamName}:${l.id}:needsFix`),Xb(l)==="approved"&&MS.add(`${l.teamName}:${l.id}:approved`),Xb(l)==="review"&&MS.add(`${l.teamName}:${l.id}:review`);for(const d of l.comments??[])CZ.add(`${l.teamName}:${l.id}:${d.id}`);RZ.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")&&ok.add(l)}else{const c=t().appConfig?.notifications?.notifyOnClarifications??!0;l5t(i,a,c),u5t(i,a,t().appConfig,t().teamByName);const l=t().appConfig?.notifications?.notifyOnTaskComments??!0;p5t(i,a,l);const d=t().appConfig?.notifications?.notifyOnTaskCreated??!0;h5t(i,a,d);const p=t().appConfig?.notifications?.notifyOnAllTasksCompleted??!0;g5t(i,a,p)}e({globalTasks:a,globalTasksLoading:!1,globalTasksInitialized:!0,globalTasksError:null})}catch(a){e({globalTasksLoading:!1,globalTasksInitialized:!0,globalTasksError:s?a instanceof Ch||a instanceof Error?a.message:"Failed to fetch tasks":null})}}while(CY)})().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=dr(r),h=p.projects.find(m=>dr(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!==su&&(o.slotLayoutVersion=su,c={},l={},a=!0);const d=KQ(r,s),p=k5t(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===su?{}:c?(Cp.warn(`[graph-layout] refusing occupied slot assignment team=${n} owner=${r} target=${s.ringIndex}:${s.sectorIndex} occupiedBy=${c[0]}`),{}):{slotLayoutVersion:su,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===su)return{};i&&o&&(d[i]=o);const p=Object.entries(d).find(([f,h])=>f===r||f===i?!1:h.ringIndex===s.ringIndex&&h.sectorIndex===s.sectorIndex||h.ringIndex===o?.ringIndex&&h.sectorIndex===o.sectorIndex);return p?(Cp.warn(`[graph-layout] refusing slot drop team=${n} owner=${r} target=${s.ringIndex}:${s.sectorIndex} conflict=${p[0]}`),{}):{slotLayoutVersion:su,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=Ri(i,n),a=[...i.gridOwnerOrderByTeam[n]??[]];for(const h of[r,s])a.includes(h)||a.push(h);const c=o?KQ(o.members,o.config.members??[]).orderedVisibleOwnerIds:a,l=C5t(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:su,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===su&&Object.keys(r.graphLayoutSessionByTeam).length===0?{}:{slotLayoutVersion:su,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:su,slotAssignmentsByTeam:s,graphLayoutSessionByTeam:i}})},resetTeamGraphSlotAssignmentsToDefaults:n=>{e(r=>{const s=Ri(r,n),i=s?KQ(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:su,slotAssignmentsByTeam:c,graphLayoutSessionByTeam:{...r.graphLayoutSessionByTeam,[n]:{mode:"default",signature:i.signature}}}})},setSelectedTeamTaskChangePresence:(n,r,s)=>{e(i=>{const o=Ri(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(Ri(t(),n))try{const s=await ir("team:getTaskChangePresence",()=>Z.teams.getTaskChangePresence(n));e(i=>{const o=Ri(i,n);if(!o)return{};let a=!1;const c=o.tasks.map(d=>{const p=s[d.id]??"unknown";return d.changePresence===p?d:(a=!0,{...d,changePresence:p})});if(!a)return{};const l={...o,tasks:c};return{teamDataCacheByName:{...i.teamDataCacheByName,[n]:l},...i.selectedTeamName===n?{selectedTeamData:l}:{}}})}catch{}},selectTeam:async(n,r)=>{const s=Sh(n),i=r?.allowReloadWhileProvisioning===!0;if(t().selectedTeamLoading&&t().selectedTeamName===n&&!i)return;const o=t().selectedTeamLoadNonce+1,a=Ri(t(),n);e({selectedTeamName:n,selectedTeamData:a,selectedTeamLoading:!0,selectedTeamLoadNonce:o,selectedTeamError:null,reviewActionError:null,toolApprovalSettings:$5t(n)});try{const c=await kOe(n);if(!mc(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:$Oe(n,a.tasks,c.tasks)}:c,h=EOe(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}}),XL.set(n,Date.now());const m=a?POe(n,a.tasks,c.tasks):{cacheKeys:[],taskIds:[]};m.cacheKeys.length>0&&t().invalidateTaskChangePresence(m.cacheKeys),m.taskIds.length>0&&await Z.review.invalidateTaskChangeSummaries(n,m.taskIds);const g=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"?`${g} Graph`:g;S.label!==v&&t().updateTabLabel(S.id,v)}if(((await t().refreshTeamMessagesHead(n)).feedChanged||IOe(t(),n))&&await t().refreshMemberActivityMeta(n),r?.skipProjectAutoSelect)return;const x=c.config.projectPath;if(x){const S=t(),v=dr(x),T=S.projects.find(E=>dr(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=>dr(P.path)===v);if(w){S.selectedWorktreeId!==w.id&&(e(MU(E.id,w.id)),t().fetchSessionsInitial(w.id));break}}}}catch(c){if(!mc(n,s))return;const l=t();if(l.selectedTeamName!==n||l.selectedTeamLoadNonce!==o)return;const d=T_(l,n),p=c instanceof Error?c.message:String(c);if(p==="TEAM_PROVISIONING"||p.includes("TEAM_PROVISIONING")&&d){e({selectedTeamLoading:!0,selectedTeamData:null,selectedTeamError:null});return}if(p==="TEAM_DRAFT"||p.includes("TEAM_DRAFT")){e({selectedTeamLoading:!1,selectedTeamData:null,selectedTeamError:"TEAM_DRAFT"});return}const f=c instanceof Ch||c instanceof Error?c.message:"Failed to fetch team data";e({selectedTeamLoading:!1,selectedTeamData:null,selectedTeamError:f})}},refreshTeamData:async(n,r)=>{const s=Sh(n),i=jLt(n),o=r?.withDedup===!0&&F0.has(n);YLt(n),o&&jL.add(n);try{const a=Ri(t(),n),c=r?.withDedup?await kOe(n):await FLt(n);if(!mc(n,s))return;const l=a?{...c,tasks:$Oe(n,a.tasks,c.tasks)}:c,d=EOe(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}}),XL.set(n,Date.now());const p=a?POe(n,a.tasks,c.tasks):{cacheKeys:[],taskIds:[]};p.cacheKeys.length>0&&t().invalidateTaskChangePresence(p.cacheKeys),p.taskIds.length>0&&await Z.review.invalidateTaskChangeSummaries(n,p.taskIds)}catch(a){if(!mc(n,s))return;const c=a instanceof Ch||a instanceof Error?a.message:"Failed to refresh team data";if(c==="TEAM_PROVISIONING"||c.includes("TEAM_PROVISIONING")){Cp.debug(`refreshTeamData(${n}) skipped: team is still provisioning`),t().selectedTeamName===n&&e({selectedTeamError:null});return}if(R5t(n,c)){e(l=>{const d=l.teamDataCacheByName[n]?{...l.teamDataCacheByName}:null;return d&&delete d[n],l.selectedTeamName!==n&&!d?{}:{...d?{teamDataCacheByName:d}:{},...l.selectedTeamName===n?{selectedTeamLoading:!1,selectedTeamData:null,selectedTeamError:c==="TEAM_DRAFT"||c.includes("TEAM_DRAFT")?"TEAM_DRAFT":c}:{}}});return}if(t().selectedTeamName!==n)return;if(Cp.warn(`refreshTeamData(${n}) failed: ${c}`),t().selectedTeamData){Cp.debug(`refreshTeamData(${n}) preserving existing data after transient error`),e({selectedTeamError:null});return}e({selectedTeamError:c})}finally{XLt(n,i),o&&jL.delete(n)&&t().refreshTeamData(n)}},refreshTeamMessagesHead:async n=>{const r=nS.get(n);if(r)return vZ.add(n),r;const s=g0.get(n);if(s)return s;const i=rS.get(n);if(i){const c=Sh(n),l=i.then(()=>{if(!mc(n,c))return{feedChanged:!1,headChanged:!1,feedRevision:null};if(g0.get(n)===l)g0.delete(n);else return{feedChanged:!1,headChanged:!1,feedRevision:null};return t().refreshTeamMessagesHead(n)}).finally(()=>{g0.get(n)===l&&g0.delete(n)});return g0.set(n,l),l}const o={current:null};o.current=(async()=>{const c=Sh(n);e(l=>({teamMessagesByName:{...l.teamMessagesByName,[n]:{...so(l,n),loadingHead:!0}}}));try{const l=await ir("team:getMessagesPage",()=>Z.teams.getMessagesPage(n,{limit:50}));if(!mc(n,c))return{feedChanged:!1,headChanged:!1,feedRevision:null};const d=so(t(),n),p=!d.headHydrated||d.feedRevision!==l.feedRevision,f=o5t(d.canonicalMessages,l.messages.length),h=!r5t(f,l.messages);return e(m=>{const g=so(m,n),_=a5t(g.canonicalMessages,l.messages),b=g.olderHydrated&&Array.isArray(_)&&_.length>0,y=h?b?SZ(_,l.messages):l.messages:g.canonicalMessages,x=s5t(g.optimisticMessages,y),S={...g,canonicalMessages:y,optimisticMessages:x,feedRevision:l.feedRevision,nextCursor:b?g.nextCursor:l.nextCursor,hasMore:b?g.hasMore:l.hasMore,lastFetchedAt:Date.now(),loadingHead:!1,headHydrated:!0,olderHydrated:b?g.olderHydrated:!1};return{teamMessagesByName:{...m.teamMessagesByName,[n]:S}}}),{feedChanged:p,headChanged:h,feedRevision:l.feedRevision}}catch(l){if(!mc(n,c))return{feedChanged:!1,headChanged:!1,feedRevision:null};throw e(d=>({teamMessagesByName:{...d.teamMessagesByName,[n]:{...so(d,n),loadingHead:!1}}})),l}finally{nS.get(n)===o.current&&(nS.delete(n),vZ.delete(n)&&t().refreshTeamMessagesHead(n))}})();const a=o.current;return nS.set(n,a),a},loadOlderTeamMessages:async n=>{const r=Sh(n),s=rS.get(n);if(s)return s;const i=nS.get(n);if(i&&(await i,!mc(n,r)))return;let o=so(t(),n);if(!o.headHydrated){if(await t().refreshTeamMessagesHead(n),!mc(n,r))return;o=so(t(),n)}if(!o.headHydrated||!o.nextCursor||o.loadingOlder||o.loadingHead)return;const a={current:null};a.current=(async()=>{const l=Sh(n);e(d=>({teamMessagesByName:{...d.teamMessagesByName,[n]:{...so(d,n),loadingOlder:!0}}}));try{const d=o.feedRevision,p=await ir("team:getMessagesPage",()=>Z.teams.getMessagesPage(n,{cursor:o.nextCursor,limit:50}));if(!mc(n,l))return;const f=so(t(),n);if(f.feedRevision!==d){e(h=>({teamMessagesByName:{...h.teamMessagesByName,[n]:{...so(h,n),loadingOlder:!1}}})),await t().refreshTeamMessagesHead(n);return}if(f.feedRevision&&f.feedRevision!==p.feedRevision){e(h=>({teamMessagesByName:{...h.teamMessagesByName,[n]:{...so(h,n),loadingOlder:!1}}})),await t().refreshTeamMessagesHead(n);return}e(h=>{const m=so(h,n),g=SZ(m.canonicalMessages,p.messages);return{teamMessagesByName:{...h.teamMessagesByName,[n]:{...m,canonicalMessages:g,nextCursor:p.nextCursor,hasMore:p.hasMore,feedRevision:p.feedRevision,loadingOlder:!1,olderHydrated:!0}}}})}catch{if(!mc(n,l))return;e(d=>({teamMessagesByName:{...d.teamMessagesByName,[n]:{...so(d,n),loadingOlder:!1}}}))}finally{rS.get(n)===a.current&&rS.delete(n)}})();const c=a.current;return rS.set(n,c),c},refreshMemberActivityMeta:async n=>{if(!so(t(),n).headHydrated)return;const s=ik.get(n);if(s)return TZ.add(n),s;const i={current:null};i.current=(async()=>{const a=Sh(n);try{const c=await ir("team:getMemberActivityMeta",()=>Z.teams.getMemberActivityMeta(n));if(!mc(n,a))return;e(l=>{const d=so(l,n).feedRevision;if(d&&c.feedRevision!==d)return{};const p=l.memberActivityMetaByTeam[n];if(p?.feedRevision===c.feedRevision)return{};const f=v5t(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(!mc(n,a))return;throw c}finally{ik.get(n)===i.current&&(ik.delete(n),TZ.delete(n)&&t().refreshMemberActivityMeta(n))}})();const o=i.current;return ik.set(n,o),o},syncTeamPendingReplyRefresh:(n,r,s,i=1e4)=>{if(Ex(n),!i5t(n,r,s))return;const a=setTimeout(()=>{pC.get(n)===a&&(pC.delete(n),(async()=>{try{((await t().refreshTeamMessagesHead(n)).feedChanged||IOe(t(),n))&&await t().refreshMemberActivityMeta(n)}catch{}})())},i);pC.set(n,a)},updateKanban:async(n,r,s)=>{try{e({reviewActionError:null}),await ir("team:updateKanban",()=>Z.teams.updateKanban(n,r,s)),await t().refreshTeamData(n)}catch(i){throw e({reviewActionError:AOe(i)}),i}},updateKanbanColumnOrder:async(n,r,s)=>{await ir("team:updateKanbanColumnOrder",()=>Z.teams.updateKanbanColumnOrder(n,r,s)),await t().refreshTeamData(n)},sendTeamMessage:async(n,r)=>{const s=r.messageId??`optimistic-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,i=r.timestamp??z1(),o={...r,messageId:s,timestamp:i},a={from:o.from??"user",to:o.to??o.member,text:o.text,timestamp:i,read:!0,taskRefs:o.taskRefs?.length?o.taskRefs:void 0,actionMode:o.actionMode,summary:o.summary,color:o.color,messageId:s,relayOfMessageId:o.relayOfMessageId,source:o.source??"user_sent",attachments:o.attachments?.length?o.attachments:void 0,leadSessionId:o.leadSessionId,conversationId:o.conversationId,replyToConversationId:o.replyToConversationId,toolSummary:o.toolSummary,toolCalls:o.toolCalls,messageKind:o.messageKind,slashCommand:o.slashCommand,commandOutput:o.commandOutput};e({sendingMessage:!0,sendMessageError:null,sendMessageWarning:null,sendMessageDebugDetails:null,lastSendMessageResult:null}),e(c=>({teamMessagesByName:{...c.teamMessagesByName,[n]:$Y(so(c,n),a)}}));try{const c=await ir("team:sendMessage",()=>Z.teams.sendMessage(n,o)),l=c.runtimeDelivery?.attempted===!0&&c.runtimeDelivery.delivered===!1,d=OLt(c),p={...a,messageId:c.messageId};return e(f=>({sendingMessage:!1,sendMessageError:null,sendMessageWarning:d.warning,sendMessageDebugDetails:d.debugDetails,lastSendMessageResult:l?null:c,teamMessagesByName:{...f.teamMessagesByName,[n]:$Y(so(f,n),p)}})),await t().refreshTeamMessagesHead(n),c}catch(c){throw e({sendingMessage:!1,lastSendMessageResult:null,sendMessageWarning:null,sendMessageDebugDetails:null,sendMessageError:NOe(c)}),c}},addOptimisticTeamMessage:(n,r)=>{e(s=>({teamMessagesByName:{...s.teamMessagesByName,[n]:$Y(so(s,n),r)}}))},fetchCrossTeamTargets:async()=>{e({crossTeamTargetsLoading:!0});try{const n=await Z.crossTeam.listTargets();e({crossTeamTargets:n,crossTeamTargetsLoading:!1})}catch(n){Cp.error("fetchCrossTeamTargets failed",n),e({crossTeamTargets:[],crossTeamTargetsLoading:!1})}},sendCrossTeamMessage:async n=>{e({sendingMessage:!0,sendMessageError:null,sendMessageWarning:null,sendMessageDebugDetails:null,lastSendMessageResult:null});try{const r=await Z.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:NOe(r)})}},requestReview:async(n,r)=>{try{e({reviewActionError:null}),await ir("team:requestReview",()=>Z.teams.requestReview(n,r)),await t().refreshTeamData(n),SI(t,n,r)}catch(s){throw e({reviewActionError:AOe(s)}),s}},createTeamTask:async(n,r)=>{const s=await ir("team:createTask",()=>Z.teams.createTask(n,r));return await t().refreshTeamData(n),s},startTask:async(n,r)=>{const s=await ir("team:startTask",()=>Z.teams.startTask(n,r));return await t().refreshTeamData(n),SI(t,n,r),s},startTaskByUser:async(n,r)=>{const s=await ir("team:startTaskByUser",()=>Z.teams.startTaskByUser(n,r));return await t().refreshTeamData(n),SI(t,n,r),s},updateTaskStatus:async(n,r,s)=>{await ir("team:updateTaskStatus",()=>Z.teams.updateTaskStatus(n,r,s)),await t().refreshTeamData(n),SI(t,n,r)},updateTaskOwner:async(n,r,s)=>{await ir("team:updateTaskOwner",()=>Z.teams.updateTaskOwner(n,r,s)),await t().refreshTeamData(n)},updateTaskFields:async(n,r,s)=>{await ir("team:updateTaskFields",()=>Z.teams.updateTaskFields(n,r,s)),await t().refreshTeamData(n)},addTaskRelationship:async(n,r,s,i)=>{await ir("team:addTaskRelationship",()=>Z.teams.addTaskRelationship(n,r,s,i)),await t().refreshTeamData(n)},removeTaskRelationship:async(n,r,s,i)=>{await ir("team:removeTaskRelationship",()=>Z.teams.removeTaskRelationship(n,r,s,i)),await t().refreshTeamData(n)},setTaskNeedsClarification:async(n,r,s)=>{await ir("team:setTaskClarification",()=>Z.teams.setTaskClarification(n,r,s)),await t().refreshTeamData(n),await t().fetchAllTasks()},saveTaskAttachment:async(n,r,s)=>{const i=crypto.randomUUID();await ir("team:saveTaskAttachment",()=>Z.teams.saveTaskAttachment(n,r,i,s.name,s.type,s.base64)),await t().refreshTeamData(n)},deleteTaskAttachment:async(n,r,s,i)=>{await ir("team:deleteTaskAttachment",()=>Z.teams.deleteTaskAttachment(n,r,s,i)),await t().refreshTeamData(n)},getTaskAttachmentData:async(n,r,s,i)=>ir("team:getTaskAttachment",()=>Z.teams.getTaskAttachment(n,r,s,i)),addTaskComment:async(n,r,s)=>{e({addingComment:!0,addCommentError:null});try{const i=await ir("team:addTaskComment",()=>Z.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 ir("team:addMember",()=>Z.teams.addMember(n,r)),await Promise.allSettled([t().refreshTeamData(n),t().fetchMemberSpawnStatuses(n),t().fetchTeamAgentRuntime(n)])},restartMember:async(n,r)=>{try{await ir("team:restartMember",()=>Z.teams.restartMember(n,r))}finally{await Promise.allSettled([t().fetchMemberSpawnStatuses(n),t().fetchTeamAgentRuntime(n)])}},skipMemberForLaunch:async(n,r)=>{try{await ir("team:skipMemberForLaunch",()=>Z.teams.skipMemberForLaunch(n,r))}finally{await Promise.allSettled([t().fetchMemberSpawnStatuses(n),t().fetchTeamAgentRuntime(n),t().fetchTeams()])}},removeMember:async(n,r)=>{await ir("team:removeMember",()=>Z.teams.removeMember(n,r)),await t().refreshTeamData(n)},updateMemberRole:async(n,r,s)=>{await ir("team:updateMemberRole",()=>Z.teams.updateMemberRole(n,r,s)),await t().refreshTeamData(n)},softDeleteTask:async(n,r)=>{await ir("team:softDeleteTask",()=>Z.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 ir("team:restoreTask",()=>Z.teams.restoreTask(n,r)),await t().refreshTeamData(n),await t().fetchDeletedTasks(n)},fetchDeletedTasks:async n=>{e({deletedTasksLoading:!0});try{const r=await ir("team:getDeletedTasks",()=>Z.teams.getDeletedTasks(n));e({deletedTasks:r,deletedTasksLoading:!1})}catch(r){Cp.error("Failed to fetch deleted tasks:",r),e({deletedTasks:[],deletedTasksLoading:!1})}},deleteTeam:async n=>{const r=await ir("team:deleteTeam",()=>Z.teams.deleteTeam(n));return U1(n),Ex(n),B1(n),X1(n),e(s=>({...PY(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 ir("team:restoreTeam",()=>Z.teams.restoreTeam(n)),U1(n),Ex(n),B1(n),X1(n),e(r=>{const s=PY(r,n),i=vOe(r,n,z1());return Object.keys(s).length===0?i:{...s,...i}}),await t().fetchTeams(),await t().fetchAllTasks()},permanentlyDeleteTeam:async n=>{await ir("team:permanentlyDeleteTeam",()=>Z.teams.permanentlyDeleteTeam(n)),U1(n),Ex(n),B1(n),X1(n);const r=t(),s=PY(r,n),i=vOe(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),Ex(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 g={...o.currentRuntimeRunIdByTeam},_=g[n.teamName];delete g[n.teamName];const b=_?{...o.ignoredRuntimeRunIds,[_]:n.teamName}:o.ignoredRuntimeRunIds,y=SOe(o,n.teamName);return{provisioningRuns:a,provisioningErrorByTeam:c,memberSpawnStatusesByTeam:l,memberSpawnSnapshotsByTeam:d,teamAgentRuntimeByTeam:p,activeToolsByTeam:f,finishedVisibleByTeam:h,toolHistoryByTeam:m,currentRuntimeRunIdByTeam:g,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?B0:{...B0,autoAllowAll:!0};NY(n.teamName,i),e({toolApprovalSettings:i});try{if(typeof Z.teams.createTeam!="function")throw new Error("Current preload version does not support team:create. Restart the dev app.");const o=await ir("team:create",()=>Z.teams.createTeam(n)),a=DOe(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};QOe(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),COe(t,o.runId),o.runId}catch(o){const a=o instanceof Ch||o instanceof Error?o.message:"Failed to create team";throw e(c=>{const l={...c.provisioningRuns};delete l[s];const d={...c.currentProvisioningRunIdByTeam};return d[n.teamName]===s&&delete d[n.teamName],{provisioningRuns:l,currentProvisioningRunIdByTeam:d,provisioningErrorByTeam:{...c.provisioningErrorByTeam,[n.teamName]:a}}}),o}},launchTeam:async n=>{t().subscribeProvisioningProgress(),U1(n.teamName),Ex(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},g=m[n.teamName];delete m[n.teamName];const _=g?{...i.ignoredRuntimeRunIds,[g]:n.teamName}:i.ignoredRuntimeRunIds,b=SOe(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?B0:{...B0,autoAllowAll:!0};NY(n.teamName,i),e({toolApprovalSettings:i})}try{const i=await ir("team:launch",()=>Z.teams.launchTeam(n)),o=DOe(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};QOe(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 COe(t,i.runId),i.runId}catch(i){const o=i instanceof Ch||i instanceof Error?i.message:"Failed to launch team";throw e(a=>{const c={...a.provisioningRuns};delete c[s];const l={...a.currentProvisioningRunIdByTeam};return l[n.teamName]===s&&delete l[n.teamName],{provisioningRuns:c,currentProvisioningRunIdByTeam:l,provisioningErrorByTeam:{...a.provisioningErrorByTeam,[n.teamName]:o}}}),i}},getProvisioningStatus:async n=>{const r=await ir("team:provisioningStatus",()=>Z.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},g={...r.finishedVisibleByTeam},_={...r.toolHistoryByTeam};return a&&(delete m[s.teamName],delete g[s.teamName],delete _[s.teamName]),{provisioningRuns:i,currentProvisioningRunIdByTeam:o,currentRuntimeRunIdByTeam:c,memberSpawnStatusesByTeam:p,memberSpawnSnapshotsByTeam:f,teamAgentRuntimeByTeam:h,activeToolsByTeam:m,finishedVisibleByTeam:g,toolHistoryByTeam:_,ignoredProvisioningRunIds:l,ignoredRuntimeRunIds:d}})},cancelProvisioning:async n=>{await ir("team:cancelProvisioning",()=>Z.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&&!UL.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 ir("team:stop",()=>Z.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):wOe(h)&&!wOe(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 g={...d.provisioningErrorByTeam};n.state==="failed"?g[n.teamName]=n.error??n.message:delete g[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:g,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();MOe(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&&UL.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 g=Object.fromEntries(Object.entries(m).filter(([,_])=>_.status==="error"));return Object.keys(g).length>0?p[n.teamName]=g:(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(!MOe(d,n.teamName))return;d.selectedTeamName===n.teamName?d.selectTeam(n.teamName):d.refreshTeamData(n.teamName,{withDedup:!0})}},subscribeProvisioningProgress:()=>{if(t().provisioningProgressUnsubscribe||!Z.teams?.onProvisioningProgress)return;const r=Z.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)NY(s,o);else try{localStorage?.setItem?.("team:toolApprovalSettings",JSON.stringify(o))}catch{}try{await Z.teams.updateToolApprovalSettings(s??"__global__",o)}catch(a){Cp.warn("Failed to sync tool approval settings to main:",a)}},respondToToolApproval:async(n,r,s,i,o)=>{try{await Z.teams.respondToToolApproval(n,r,s,i,o),e(a=>{const c=new Map(a.resolvedApprovals);return c.set(s,i),{pendingApprovals:a.pendingApprovals.filter(l=>!(l.runId===r&&l.requestId===s)),resolvedApprovals:c}})}catch(a){const c=a instanceof Error?a.message:String(a);throw Cp.error(`respondToToolApproval failed for ${n}/${s}: ${c}`),a}},unsubscribeProvisioningProgress:()=>{const n=t().provisioningProgressUnsubscribe;n&&(n(),e({provisioningProgressUnsubscribe:null}))}}),I5t=e=>({commandPaletteOpen:!1,sidebarCollapsed:!1,openCommandPalette:()=>{e({commandPaletteOpen:!0})},closeCommandPalette:()=>{e({commandPaletteOpen:!1})},toggleSidebar:()=>{e(t=>({sidebarCollapsed:!t.sidebarCollapsed}))}}),M5t=1e4,Q5t=1500,D5t=6,L5t=4e3,j5t=8,X5t=2e3,U5t=1e4,z5t=3e4,B5t=1e4,F5t=to("Store:index"),Y5t=new Set(["task","config","inbox","lead-message","lead-context","lead-activity","process","member-spawn"]),LOe=new Map;function V5t(e,t,n){if(!n)return;const r=Date.now(),s=LOe.get(e)??{windowStartedAt:r,count:0,lastWarnAt:0,countsByType:{}};r-s.windowStartedAt>L5t&&(s.windowStartedAt=r,s.count=0,s.countsByType={}),s.count+=1,s.countsByType[t]=(s.countsByType[t]??0)+1,s.count>=j5t&&r-s.lastWarnAt>=X5t&&(s.lastWarnAt=r),LOe.set(e,s)}const re=ZSt()((...e)=>({...G2t(...e),...K2t(...e),...uLt(...e),...aLt(...e),...dLt(...e),...A5t(...e),...dTt(...e),...pLt(...e),...fLt(...e),...W2t(...e),...I5t(...e),...q2t(...e),...kvt(...e),...Rvt(...e),...jvt(...e),...bvt(...e),...Evt(...e),...P2t(...e),...J2t(...e),...z2t(...e)}));function q5t(){fSt();const e=[];let t=null;re.getState().subscribeProvisioningProgress(),e.push(()=>{re.getState().unsubscribeProvisioningProgress()}),(async()=>{await re.getState().fetchConfig();const K=re.getState().appConfig;t2e(K?.general?.telemetryEnabled??!0),Z.cliInstaller&&(t=setTimeout(()=>{re.getState().appConfig?.general?.multimodelEnabled??!1?re.getState().bootstrapCliStatus({multimodelEnabled:!0}):re.getState().fetchCliStatus(),t=null},3e3)),await Promise.all([re.getState().fetchRepositoryGroups(),re.getState().fetchAllTasks(),re.getState().fetchTeams(),re.getState().fetchNotifications(),re.getState().fetchSchedules()])})(),e.push(()=>{t&&clearTimeout(t)});const n=setInterval(()=>{V()},M5t);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 g=new Map;let _=null,b=null;const y=150,x=300,S=800,v=400,T=500,E=2e3,w=500,P=async K=>{if(!K||!ie(K))return;const Y=re.getState();try{const W=await Y.refreshTeamMessagesHead(K),se=re.getState(),he=se.memberActivityMetaByTeam[K];(W.feedChanged||he?.feedRevision!==W.feedRevision)&&await se.refreshMemberActivityMeta(K)}catch{}},C=K=>{if(!K||!G(K)||d.has(K))return;const Y=setTimeout(()=>{d.delete(K),re.getState().fetchMemberSpawnStatuses(K)},T);d.set(K,Y)},k=K=>{if(!K||!G(K)||p.has(K))return;const Y=setTimeout(()=>{p.delete(K),re.getState().fetchTeamAgentRuntime(K)},T);p.set(K,Y)},I=K=>{if(!K||!ie(K)||c.has(K))return;const Y=setTimeout(()=>{c.delete(K),P(K)},S);c.set(K,Y)},Q=(K,Y,W,se)=>`${K}:${Y}:${W}:${se}`,$=(K,Y,W,se)=>{const he=Q(K,Y,W,se),we=f.get(he);we&&(clearTimeout(we),f.delete(he))},R=(K,Y,W,se,he,we)=>{$(K,Y,W,se);const J=Q(K,Y,W,se),de=setTimeout(()=>{f.delete(J),we()},he);f.set(J,de)},N=K=>{for(const[Y,W]of f.entries())Y.startsWith(`${K}:`)&&(clearTimeout(W),f.delete(Y))},j=(K,Y)=>{const W={...K.activeToolsByTeam},se={...K.finishedVisibleByTeam},he={...K.toolHistoryByTeam};return delete W[Y],delete se[Y],delete he[Y],{activeToolsByTeam:W,finishedVisibleByTeam:se,toolHistoryByTeam:he}},M=(K,Y,W)=>{const se={...K[Y]??{}},he=se[W.memberName]??[];return se[W.memberName]=[W,...he.filter(we=>we.toolUseId!==W.toolUseId)].slice(0,D5t),{...K,[Y]:se}},U=(K,Y)=>({...K??{},[Y.memberName]:{...(K??{})[Y.memberName]??{},[Y.toolUseId]:Y}}),A=(K,Y,W)=>{if(!K?.[Y]?.[W])return K??{};const se={...K??{}},he={...se[Y]??{}};return delete he[W],Object.keys(he).length===0?delete se[Y]:se[Y]=he,se},F=(K,Y)=>{if(!K?.[Y])return K??{};const W={...K??{}};return delete W[Y],W},z=(K,Y,W)=>{if(!K?.[Y]||W.length===0)return K??{};let se=K??{},he=!1;for(const we of W)se[Y]?.[we]&&(se=A(se,Y,we),he=!0);return he?se:K??{}},D=K=>{if(!K)return null;const Y=K.indexOf("::");return Y>=0?K.slice(0,Y):K},V=async()=>{if(h)return;const K=re.getState(),Y=Array.from(H(K));if(Y.length!==0){if(g.size>50){const W=new Set(re.getState().teams.map(se=>se.teamName));for(const se of g.keys())W.has(se)||g.delete(se)}h=!0;try{for(const W of Y){const se=Ri(K,W);if(se?.teamName!==W){RY(W)||K.refreshTeamData(W,{withDedup:!0});continue}const he=se.tasks.filter(nt=>nt.status!=="in_progress"?!1:wre(Yc(nt)));if(he.length===0){g.delete(W);continue}const we=g.get(W)??0,J=he.filter(nt=>nt.changePresence==="unknown"),de=J.length>0?J:he,ue=de[we%de.length];g.set(W,(we+1)%de.length);const ae=re.getState();if(!G(W))continue;const $e=Ri(ae,W);if($e?.teamName!==W){RY(W)||ae.refreshTeamData(W,{withDedup:!0});continue}const qe=$e.tasks.find(nt=>nt.id===ue.id);if(qe?.status!=="in_progress")continue;const ot=Yc(qe),Ot=kd(W,qe.id,ot);ae.invalidateTaskChangePresence([Ot]),await ae.checkTaskHasChanges(W,qe.id,ot)}}catch{}finally{h=!1}}},q=(K,Y)=>{const W=`${K}/${Y}`;if(r.has(W))return;const se=setTimeout(()=>{r.delete(W),re.getState().refreshSessionInPlace(K,Y)},y);r.set(W,se)},ee=K=>{const Y=s.get(K);Y&&clearTimeout(Y);const W=setTimeout(()=>{s.delete(K),re.getState().refreshSessionsInPlace(K)},x);s.set(K,W)};if(Z.notifications?.onNew){const K=Z.notifications.onNew((Y,W)=>{const se=W;se?.id&&re.setState(he=>he.notifications.some(we=>we.id===se.id)?{}:{notifications:[se,...he.notifications].slice(0,200)})});typeof K=="function"&&e.push(K)}if(Z.notifications?.onUpdated){const K=Z.notifications.onUpdated((Y,W)=>{const se=typeof W.unreadCount=="number"&&Number.isFinite(W.unreadCount)?Math.max(0,Math.floor(W.unreadCount)):0;re.setState({unreadCount:se})});typeof K=="function"&&e.push(K)}if(Z.notifications?.onClicked){const K=Z.notifications.onClicked((Y,W)=>{const se=W;se?.id&&se?.sessionId&&se?.projectId&&re.getState().navigateToError(se)});typeof K=="function"&&e.push(K)}const te=K=>{const{paneLayout:Y}=re.getState();return Y.panes.some(W=>W.activeTabId!=null&&W.tabs.some(se=>se.id===W.activeTabId&&se.type==="session"&&se.sessionId===K))},H=(K=re.getState())=>{const{paneLayout:Y}=K,W=new Set;for(const se of Y.panes){if(!se.activeTabId)continue;const he=se.tabs.find(we=>we.id===se.activeTabId);(he?.type==="team"||he?.type==="graph")&&he.teamName!=null&&W.add(he.teamName)}return W},G=K=>H().has(K),ie=K=>G(K)||QLt(K),ne=()=>{const K=H();for(const Y of DLt())K.add(Y);return K},pe=()=>H(),Te=(K,Y=Date.now())=>{i.set(K,Y)},_e=()=>{const K=re.getState(),Y=K.paneLayout.panes.find(se=>se.id===K.paneLayout.focusedPaneId);if(!Y?.activeTabId)return null;const W=Y.tabs.find(se=>se.id===Y.activeTabId);return W?.type!=="team"&&W?.type!=="graph"||!W.teamName||!Ri(K,W.teamName)?null:W.teamName},be=async()=>{if(m)return;const K=ne();if(K.size!==0){m=!0;try{await Promise.allSettled(Array.from(K,Y=>P(Y)))}finally{m=!1}}},Ie=async()=>{if(typeof document<"u"&&document.visibilityState==="hidden")return;const K=re.getState(),Y=_e();if(!Y||!G(Y)||K.selectedTeamName===Y&&K.selectedTeamLoading||RY(Y))return;const W=i.get(Y)??0,se=xOe(Y)??0,he=Math.max(W,se);if(he===0)return;const we=Date.now();if(!(we-he<z5t||(o.get(Y)??0)>=he)){F5t.warn(`[perf] idle-watchdog refresh team=${Y} idleMs=${we-he}`);try{await K.refreshTeamData(Y,{withDedup:!0})}finally{o.set(Y,Math.max(xOe(Y)??0,he,Date.now()))}}};if(Z.teams?.setToolActivityTracking){let K=new Set;const Y=()=>{const se=pe();for(const he of se)K.has(he)||Z.teams.setToolActivityTracking(he,!0).catch(()=>{});for(const he of K)se.has(he)||Z.teams.setToolActivityTracking(he,!1).catch(()=>{});K=se};Y();const W=re.subscribe((se,he)=>{se.paneLayout!==he.paneLayout&&Y()});e.push(()=>{W();for(const se of K)Z.teams.setToolActivityTracking(se,!1).catch(()=>{});K.clear()})}if(Z.onTodoChange){const K=Z.onTodoChange(Y=>{if(!Y.sessionId||Y.type==="unlink")return;const W=re.getState();if(W.selectedSessionId===Y.sessionId||te(Y.sessionId)){const de=W.getAllPaneTabs().find(ue=>ue.type==="session"&&ue.sessionId===Y.sessionId);de?.projectId&&q(de.projectId,Y.sessionId)}const he=W.getActiveTab(),we=he?.type==="session"&&typeof he.projectId=="string"?he.projectId:null;we&&we===W.selectedProjectId&&ee(we)});typeof K=="function"&&e.push(K)}if(Z.onFileChange){const K=Z.onFileChange(Y=>{if(Y.type==="unlink")return;const W=re.getState(),se=W.selectedProjectId,he=D(se),we=D(Y.projectId),J=!!se&&(we==null||he===we),de=!Y.isSubagent,ue=Y.sessionId==null||!W.sessions.some($e=>$e.id===Y.sessionId);if(de&&J&&ue&&(Y.type==="add"||W.connectionMode==="local"&&Y.type==="change")&&J&&se&&ee(se),(Y.type==="change"||Y.type==="add")&&se){const $e=W.selectedSessionId,qe=Y.sessionId,nt=(!!qe&&($e===qe||te(qe))?qe:null)??(J&&!qe&&!!$e?$e:null);if(nt){const Qt=W.getAllPaneTabs().find(ft=>ft.type==="session"&&ft.sessionId===nt)?.projectId??se;q(Qt,nt)}}});typeof K=="function"&&e.push(K)}const Se=setInterval(()=>{Ie()},U5t);e.push(()=>{clearInterval(Se)});const oe=setInterval(()=>{be()},B5t);if(e.push(()=>{clearInterval(oe)}),Z.teams?.onTeamChange){const K=Z.teams.onTeamChange((Y,W)=>{const se=!!W.teamName&&ie(W.teamName);if(V5t(W.teamName,W.type,se),(()=>{if(!W.runId)return!1;const ae=re.getState();return ae.ignoredProvisioningRunIds[W.runId]===W.teamName||ae.ignoredRuntimeRunIds[W.runId]===W.teamName})())return;const we=(()=>{if(!W.runId)return!1;const ae=re.getState().currentRuntimeRunIdByTeam[W.teamName];return ae!=null&&ae!==W.runId})(),J=()=>{if(!W.runId)return;re.getState().currentRuntimeRunIdByTeam[W.teamName]==null&&re.setState($e=>({currentRuntimeRunIdByTeam:{...$e.currentRuntimeRunIdByTeam,[W.teamName]:W.runId??null},ignoredRuntimeRunIds:Object.fromEntries(Object.entries($e.ignoredRuntimeRunIds).filter(([,qe])=>qe!==W.teamName))}))};if(Y5t.has(W.type)&&!we&&Te(W.teamName),W.type==="lead-activity"&&W.detail){if(we)return;J();const ae=W.detail;re.setState($e=>{const qe={leadActivityByTeam:{...$e.leadActivityByTeam,[W.teamName]:ae}},ot=$e.teamDataCacheByName[W.teamName]??($e.selectedTeamName===W.teamName?$e.selectedTeamData:null),Ot=ot&&ot.isAlive!==(ae!=="offline")?{...ot,isAlive:ae!=="offline"}:ot;return Ot&&(qe.teamDataCacheByName={...$e.teamDataCacheByName,[W.teamName]:Ot}),$e.selectedTeamName===W.teamName&&Ot&&(qe.selectedTeamData=Ot),ae==="offline"&&(qe.leadContextByTeam={...$e.leadContextByTeam},delete qe.leadContextByTeam[W.teamName],Object.assign(qe,j($e,W.teamName)),qe.currentRuntimeRunIdByTeam={...$e.currentRuntimeRunIdByTeam},delete qe.currentRuntimeRunIdByTeam[W.teamName],qe.ignoredRuntimeRunIds=W.runId?{...$e.ignoredRuntimeRunIds,[W.runId]:W.teamName}:$e.ignoredRuntimeRunIds,N(W.teamName)),qe});return}if(W.type==="lead-context"&&W.detail){if(we)return;J();try{const ae=JSON.parse(W.detail);re.setState($e=>({...$e,leadContextByTeam:{...$e.leadContextByTeam,[W.teamName]:ae}}))}catch{}return}if(W.type==="tool-activity"&&W.detail){if(we)return;J();try{const ae=JSON.parse(W.detail);if(ae.action==="start"&&ae.activity){const $e={memberName:ae.activity.memberName,toolUseId:ae.activity.toolUseId,toolName:ae.activity.toolName,preview:ae.activity.preview,startedAt:ae.activity.startedAt,source:ae.activity.source,state:"running"};re.setState(qe=>({activeToolsByTeam:{...qe.activeToolsByTeam,[W.teamName]:U(qe.activeToolsByTeam[W.teamName],$e)}}))}else if(ae.action==="finish"&&ae.memberName&&ae.toolUseId){const $e=ae.memberName,qe=ae.toolUseId;re.setState(ot=>{const Ot=ot.activeToolsByTeam[W.teamName]?.[$e]?.[qe];if(!Ot)return{};const nt={...Ot,state:ae.isError?"error":"complete",finishedAt:ae.finishedAt??new Date().toISOString(),resultPreview:ae.resultPreview};return R(W.teamName,$e,qe,"fade",Q5t,()=>{re.setState(Ge=>Ge.finishedVisibleByTeam[W.teamName]?.[$e]?.[qe]?{finishedVisibleByTeam:{...Ge.finishedVisibleByTeam,[W.teamName]:A(Ge.finishedVisibleByTeam[W.teamName],$e,qe)}}:{})}),{activeToolsByTeam:{...ot.activeToolsByTeam,[W.teamName]:A(ot.activeToolsByTeam[W.teamName],$e,qe)},finishedVisibleByTeam:{...ot.finishedVisibleByTeam,[W.teamName]:U(ot.finishedVisibleByTeam[W.teamName],nt)},toolHistoryByTeam:M(ot.toolHistoryByTeam,W.teamName,nt)}})}else if(ae.action==="reset")if(ae.memberName){const $e=ae.memberName,qe=Array.isArray(ae.toolUseIds)&&ae.toolUseIds.length>0?ae.toolUseIds:null;re.setState(ot=>ot.activeToolsByTeam[W.teamName]?.[$e]?{activeToolsByTeam:{...ot.activeToolsByTeam,[W.teamName]:qe?z(ot.activeToolsByTeam[W.teamName],$e,qe):F(ot.activeToolsByTeam[W.teamName],$e)}}:{})}else re.setState($e=>({activeToolsByTeam:{...$e.activeToolsByTeam,[W.teamName]:{}}}))}catch{}return}if(W.type==="member-spawn"){if(we)return;J(),C(W.teamName),k(W.teamName);return}if(W.type==="inbox"){I(W.teamName);return}if(W.type==="lead-message"){if(we)return;J(),I(W.teamName);return}if(W.type==="log-source-change"){if(!W?.teamName||!G(W.teamName)||l.has(W.teamName))return;const ae=setTimeout(()=>{l.delete(W.teamName),re.getState().refreshTeamChangePresence(W.teamName)},v);l.set(W.teamName,ae);return}if(_||(_=setTimeout(()=>{_=null,re.getState().fetchTeams()},E)),(W.type==="task"||W.type==="config")&&!b&&(b=setTimeout(()=>{b=null,re.getState().fetchAllTasks()},w)),!W?.teamName||!G(W.teamName)||a.has(W.teamName))return;const ue=setTimeout(()=>{a.delete(W.teamName),re.getState().refreshTeamData(W.teamName,{withDedup:!0})},S);a.set(W.teamName,ue)});typeof K=="function"&&e.push(()=>{K();for(const Y of a.values())clearTimeout(Y);a=new Map;for(const Y of c.values())clearTimeout(Y);c=new Map;for(const Y of l.values())clearTimeout(Y);l=new Map;for(const Y of d.values())clearTimeout(Y);d=new Map;for(const Y of p.values())clearTimeout(Y);p=new Map;for(const Y of f.values())clearTimeout(Y);f=new Map,i.clear(),o.clear(),_&&(clearTimeout(_),_=null),b&&(clearTimeout(b),b=null)})}if(Z.teams?.onProjectBranchChange){const K=Z.teams.onProjectBranchChange((Y,W)=>{if(!W?.projectPath)return;const se=dr(W.projectPath);se&&re.setState(he=>he.branchByPath[se]===W.branch?{}:{branchByPath:{...he.branchByPath,[se]:W.branch}})});typeof K=="function"&&e.push(K)}if(Z.teams?.onToolApprovalEvent){const K=Z.teams.onToolApprovalEvent((se,he)=>{const we=he;if("autoResolved"in we&&we.autoResolved){const J=we.reason!=="timeout_deny";re.setState(de=>{const ue=new Map(de.resolvedApprovals);return ue.set(we.requestId,J),{pendingApprovals:de.pendingApprovals.filter(ae=>!(ae.runId===we.runId&&ae.requestId===we.requestId)),resolvedApprovals:ue}})}else if("dismissed"in we&&we.dismissed){const J=we;re.setState(de=>({pendingApprovals:de.pendingApprovals.filter(ue=>!(ue.teamName===J.teamName&&ue.runId===J.runId))}))}else{const J=we;re.setState(de=>({pendingApprovals:[...de.pendingApprovals,J]}))}});typeof K=="function"&&e.push(K);const Y=re.getState().toolApprovalSettings,W=re.getState().selectedTeamName??"__global__";Z.teams.updateToolApprovalSettings?.(W,Y).catch(()=>{})}if(Z.editor?.onEditorChange){const K=Z.editor.onEditorChange(Y=>{const W=re.getState();W.editorProjectPath&&W.handleExternalFileChange(Y)});typeof K=="function"&&e.push(K)}if(Z.schedules?.onScheduleChange){const K=Z.schedules.onScheduleChange((Y,W)=>{const se=W;se?.scheduleId&&re.getState().applyScheduleChange(se.scheduleId)});typeof K=="function"&&e.push(K)}let Oe=null;if(Z.cliInstaller?.onProgress){const K=Z.cliInstaller.onProgress((Y,W)=>{const se=W;se.type!=="completed"&&Oe&&(clearTimeout(Oe),Oe=null);const he=se.detail??null;switch(se.type){case"checking":re.setState({cliInstallerState:"checking",cliInstallerDetail:he});break;case"downloading":re.setState({cliInstallerState:"downloading",cliDownloadProgress:se.percent??0,cliDownloadTransferred:se.transferred??0,cliDownloadTotal:se.total??0,cliInstallerDetail:he});break;case"verifying":re.setState({cliInstallerState:"verifying",cliInstallerDetail:he});break;case"installing":{const we=re.getState().cliInstallerLogs,J=re.getState().cliInstallerRawChunks,de=he?[...we,he].slice(-50):we,ue=se.rawChunk?[...J,se.rawChunk].slice(-200):J;re.setState({cliInstallerState:"installing",cliInstallerDetail:he,cliInstallerLogs:de,cliInstallerRawChunks:ue});break}case"completed":{const we=re.getState().appConfig?.general?.multimodelEnabled??!1;HO({multimodelEnabled:we,bootstrapCliStatus:re.getState().bootstrapCliStatus,fetchCliStatus:re.getState().fetchCliStatus})}re.setState({cliInstallerState:"completed",cliCompletedVersion:se.version??null,cliInstallerDetail:null}),Oe=setTimeout(()=>{Oe=null,re.getState().cliInstallerState==="completed"&&re.setState({cliInstallerState:"idle"})},3e3);break;case"error":re.setState({cliInstallerState:"error",cliInstallerError:se.error??"Unknown error"});break;case"status":if(se.status){let we=[];re.setState(J=>{const de=IQ(J.cliStatus,se.status),ue=yvt(de);return we=xvt(de),{cliStatus:de,cliProviderStatusLoading:ue.length>0?{...J.cliProviderStatusLoading,...Object.fromEntries(ue.map(ae=>[ae,!0]))}:J.cliProviderStatusLoading}});for(const J of we)re.getState().fetchCliProviderStatus(J,{silent:!1})}break}});typeof K=="function"&&e.push(()=>{K(),Oe&&(clearTimeout(Oe),Oe=null)})}if(Z.ssh?.onStatus){const K=Z.ssh.onStatus((Y,W)=>{const se=W;re.getState().setConnectionStatus(se.state,se.host,se.error)});typeof K=="function"&&e.push(K)}if(Z.context?.onChanged){const K=Z.context.onChanged((Y,W)=>{const{id:se}=W,he=re.getState().activeContextId;se!==he&&re.getState().switchContext(se)});typeof K=="function"&&e.push(K)}return()=>{for(const K of r.values())clearTimeout(K);r.clear();for(const K of s.values())clearTimeout(K);s.clear(),e.forEach(K=>K())}}const W5t=()=>{const e=re(r=>r.isContextSwitching),t=re(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:"正在加载工作区"})]})]})})},G5t="1.6.36",H5t={version:G5t},Z5t="https://github.com/yancyuu/Hermit/issues/new",K5t=120,J5t=1800,ejt=1200,tjt=12e3,njt=8e3,AZ=(e,t)=>e.length<=t?e:`${e.slice(0,t)}
|
|
1056
|
+
`)}`;i!==IL&&(IL=i,z0&&clearTimeout(z0),z0=setTimeout(()=>{z0=null,Z.editor.setWatchedDirs(s)},w2t))}let K_=0;const bx=new Map,C2t=2e3;function R2t(e){try{const t=window.requestIdleCallback;if(typeof t=="function"){t(e,{timeout:2e3});return}}catch{}setTimeout(e,150)}const P2t=(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=IR(r),a=al(o),c=al(n),l=Lc(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 g of f)h=iL(h,g),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){bs.info("revealAndOpenFile: tree not loaded yet, deferring reveal");return}const a=IR(r),c=al(a),l=al(n),d=Lc(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 g=0;g<h.length-1;g++)m=iL(m,h[g]??""),await i(m)}o(n),e({editorPendingRevealFile:null})},openEditor:async n=>{const r=++K_;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 Z.editor.open(n);const i=performance.now()-s;if(K_!==r||t().editorProjectPath!==n)return;const o=performance.now(),a=await Z.editor.readDir(n),c=performance.now()-o;if(K_!==r||t().editorProjectPath!==n)return;const l=performance.now();e({editorFileTree:a.entries,editorFileTreeLoading:!1});const d=performance.now()-l;bs.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}})();R2t(()=>{K_!==r||t().editorProjectPath!==n||(p&&t().toggleWatcher(!0),setTimeout(()=>{K_!==r||t().editorProjectPath!==n||t().fetchGitStatus()},1200))})}catch(s){if(K_!==r||t().editorProjectPath!==n)return;const i=s instanceof Error?s.message:String(s);bs.error("Failed to open editor:",i),e({editorFileTreeLoading:!1,editorFileTreeError:i})}},closeEditor:()=>{K_++,U0&&(clearTimeout(U0),U0=null),z0&&(clearTimeout(z0),z0=null),AL="",IL="",ld.clear(),bx.clear(),Z.editor.close().catch(n=>{bs.error("editor:close failed:",n)}),kp.destroy(),e({editorProjectPath:null,editorFileTree:null,editorFileTreeLoading:!1,editorFileTreeError:null,editorExpandedDirs:{},editorOpenTabs:[],editorActiveTabId:null,editorFileLoading:{},editorModifiedFiles:{},editorSaving:{},editorSaveError:{},editorCreating:!1,editorCreateError:null,editorGitFiles:[],editorGitBranch:null,editorIsGitRepo:!1,editorGitLoading:!1,editorWatcherEnabled:!1,editorExternalChanges:{},editorFileMtimes:{},editorConflictFile:null,editorPendingGoToLine:null})},loadFileTree:async n=>{e({editorFileTreeLoading:!0,editorFileTreeError:null});try{const r=performance.now(),s=await Z.editor.readDir(n),i=performance.now()-r,o=performance.now();e({editorFileTree:s.entries,editorFileTreeLoading:!1});const a=performance.now()-o;bs.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);bs.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}}),fY(t));try{const i=performance.now(),o=await Z.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;bs.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);bs.error("Failed to expand directory:",o);const a=t().editorExpandedDirs;e({editorExpandedDirs:ui(a,n)})}},collapseDirectory:n=>{const{editorExpandedDirs:r}=t();e({editorExpandedDirs:ui(r,n)}),fY(t)},openFile:n=>{const{editorOpenTabs:r}=t(),s=r.find(l=>l.filePath===n);if(s){e({editorActiveTabId:s.id});return}const i=hf(n)||"file",o=cY(i),a={id:n,filePath:n,fileName:i,language:o},c=OI([...r,a]);e({editorOpenTabs:c,editorActiveTabId:a.id}),M1(t)},closeEditorTab:n=>{const{editorOpenTabs:r,editorActiveTabId:s,editorModifiedFiles:i,editorSaveError:o}=t(),a=r.filter(f=>f.id!==n),c=ui(i,n),l=ui(o,n);kp.deleteState(n);try{localStorage.removeItem(`editor-draft:${n}`)}catch{}let d=s;if(s===n){const f=r.findIndex(h=>h.id===n);a.length>0?d=a[Math.min(f,a.length-1)].id:d=null}const p=OI(a);e({editorOpenTabs:p,editorActiveTabId:d,editorModifiedFiles:c,editorSaveError:l}),M1(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:ui(r,n)})},saveFile:async n=>{const r=kp.getContent(n);if(r===null){bs.error("saveFile: no content available for",n);return}e(s=>({editorSaving:{...s.editorSaving,[n]:!0},editorSaveError:ui(s.editorSaveError,n)}));try{const s=t().editorFileMtimes[n],i=await Z.editor.writeFile(n,r,s);ld.set(n,Date.now()),e(o=>({editorModifiedFiles:ui(o.editorModifiedFiles,n),editorSaving:ui(o.editorSaving,n),editorFileMtimes:{...o.editorFileMtimes,[n]:i.mtimeMs},editorExternalChanges:ui(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")){bs.error("Save conflict detected:",n),e(o=>({editorSaving:ui(o.editorSaving,n),editorConflictFile:n}));return}bs.error("Failed to save file:",i),e(o=>({editorSaving:ui(o.editorSaving,n),editorSaveError:{...o.editorSaveError,[n]:i}}))}},saveAllFiles:async()=>{const{editorModifiedFiles:n}=t(),r=kp.getAllModifiedContent(n),s=[];for(const[i,o]of r)s.push((async()=>{e(a=>({editorSaving:{...a.editorSaving,[i]:!0}}));try{const a=t().editorFileMtimes[i],c=await Z.editor.writeFile(i,o,a);ld.set(i,Date.now()),e(l=>({editorModifiedFiles:ui(l.editorModifiedFiles,i),editorSaving:ui(l.editorSaving,i),editorFileMtimes:{...l.editorFileMtimes,[i]:c.mtimeMs},editorExternalChanges:ui(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")){bs.error("Save conflict detected:",i),e(l=>({editorSaving:ui(l.editorSaving,i),editorConflictFile:i}));return}bs.error("Failed to save file:",i,c),e(l=>({editorSaving:ui(l.editorSaving,i),editorSaveError:{...l.editorSaveError,[i]:c}}))}})());await Promise.allSettled(s)},discardChanges:n=>{const{editorModifiedFiles:r,editorSaveError:s}=t();e({editorModifiedFiles:ui(r,n),editorSaveError:ui(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 Z.editor.createFile(n,r);return await J_(t,e,n),e({editorCreating:!1}),s.filePath}catch(s){const i=s instanceof Error?s.message:String(s);return bs.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 Z.editor.createDir(n,r);return await J_(t,e,n),e({editorCreating:!1}),s.dirPath}catch(s){const i=s instanceof Error?s.message:String(s);return bs.error("Failed to create directory:",i),e({editorCreating:!1,editorCreateError:i}),null}},deleteFileFromTree:async n=>{try{await Z.editor.deleteFile(n);const{editorOpenTabs:r}=t(),s=r.filter(o=>evt(n,o.filePath));for(const o of s)t().closeEditorTab(o.id);const i=n.substring(0,L0(n));return i&&await J_(t,e,i),!0}catch(r){const s=r instanceof Error?r.message:String(r);return bs.error("Failed to delete file:",s),!1}},moveFileInTree:async(n,r)=>{const{editorSaving:s}=t();if(s[n])return bs.error("moveFileInTree: blocked — file is being saved:",n),!1;try{const i=await Z.editor.moveFile(n,r),{newPath:o,isDirectory:a}=i,c=n.substring(0,L0(n));bx.set(n,Date.now()),bx.set(o,Date.now()),e(d=>{const p=d.editorOpenTabs.map(f=>{const h=hh(f.filePath,n,o);if(h===f.filePath)return f;const m=hf(h)||"file";return{...f,id:h,filePath:h,fileName:m,language:cY(m)}});return{editorOpenTabs:OI(p),editorActiveTabId:hh(d.editorActiveTabId??"",n,o)||d.editorActiveTabId,editorModifiedFiles:Al(d.editorModifiedFiles,n,o),editorSaving:Al(d.editorSaving,n,o),editorSaveError:Al(d.editorSaveError,n,o),editorFileLoading:Al(d.editorFileLoading,n,o),editorExternalChanges:Al(d.editorExternalChanges,n,o),editorFileMtimes:Al(d.editorFileMtimes,n,o),editorExpandedDirs:Al(d.editorExpandedDirs,n,o)}}),M1(t);const{editorOpenTabs:l}=t();for(const d of l){const p=eOe(d.filePath,n,o);p!==d.filePath&&kp.remapState(p,d.filePath)}a||kp.remapState(n,o);try{for(let d=0;d<localStorage.length;d++){const p=localStorage.key(d);if(p?.startsWith("editor-draft:")){const f=p.slice(13),h=hh(f,n,o);if(h!==f){const m=localStorage.getItem(p);localStorage.removeItem(p),m!==null&&localStorage.setItem(`editor-draft:${h}`,m)}}}}catch{}for(const[d,p]of[...ld.entries()]){const f=hh(d,n,o);f!==d&&(ld.delete(d),ld.set(f,p))}return J_(t,e,c),J_(t,e,r),t().fetchGitStatus(),!0}catch(i){const o=i instanceof Error?i.message:String(i);return bs.error("moveFileInTree failed:",o),!1}},renameFileInTree:async(n,r)=>{const{editorSaving:s}=t();if(s[n])return bs.error("renameFileInTree: blocked — file is being saved:",n),!1;try{const i=await Z.editor.renameFile(n,r),{newPath:o,isDirectory:a}=i,c=n.substring(0,L0(n));bx.set(n,Date.now()),bx.set(o,Date.now()),e(d=>{const p=d.editorOpenTabs.map(f=>{const h=hh(f.filePath,n,o);if(h===f.filePath)return f;const m=hf(h)||"file";return{...f,id:h,filePath:h,fileName:m,language:cY(m)}});return{editorOpenTabs:OI(p),editorActiveTabId:hh(d.editorActiveTabId??"",n,o)||d.editorActiveTabId,editorModifiedFiles:Al(d.editorModifiedFiles,n,o),editorSaving:Al(d.editorSaving,n,o),editorSaveError:Al(d.editorSaveError,n,o),editorFileLoading:Al(d.editorFileLoading,n,o),editorExternalChanges:Al(d.editorExternalChanges,n,o),editorFileMtimes:Al(d.editorFileMtimes,n,o),editorExpandedDirs:Al(d.editorExpandedDirs,n,o)}}),M1(t);const{editorOpenTabs:l}=t();for(const d of l){const p=eOe(d.filePath,n,o);p!==d.filePath&&kp.remapState(p,d.filePath)}a||kp.remapState(n,o);try{for(let d=0;d<localStorage.length;d++){const p=localStorage.key(d);if(p?.startsWith("editor-draft:")){const f=p.slice(13),h=hh(f,n,o);if(h!==f){const m=localStorage.getItem(p);localStorage.removeItem(p),m!==null&&localStorage.setItem(`editor-draft:${h}`,m)}}}}catch{}for(const[d,p]of[...ld.entries()]){const f=hh(d,n,o);f!==d&&(ld.delete(d),ld.set(f,p))}return J_(t,e,c),t().fetchGitStatus(),!0}catch(i){const o=i instanceof Error?i.message:String(i);return bs.error("renameFileInTree failed:",o),!1}},fetchGitStatus:async()=>{e({editorGitLoading:!0});try{const n=performance.now(),r=await Z.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;bs.info(`[perf] fetchGitStatus: IPC=${s.toFixed(1)}ms, set=${o.toFixed(1)}ms, files=${r.files.length}`)}catch(n){bs.error("Failed to fetch git status:",n),e({editorGitLoading:!1})}},toggleWatcher:async n=>{try{await Z.editor.watchDir(n),e({editorWatcherEnabled:n});try{localStorage.setItem("editor-watcher-enabled",String(n))}catch{}n?(M1(t),fY(t)):(AL="",IL="",Z.editor.setWatchedFiles([]),Z.editor.setWatchedDirs([]))}catch(r){bs.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,pY||(pY=setTimeout(()=>{pY=null;const l=_I;_I={change:0,create:0,delete:0},bs.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=ld.get(n.path);if(o&&Date.now()-o<v2t)return;const a=bx.get(n.path);if(a&&Date.now()-a<C2t)return;if((r.some(l=>l.filePath===n.path)||n.type==="delete")&&e(l=>({editorExternalChanges:{...l.editorExternalChanges,[n.path]:n.type}})),uY||(uY=setTimeout(()=>{uY=null,t().fetchGitStatus()},T2t)),n.type==="create"||n.type==="delete"){S2t();const l=n.path.substring(0,L0(n.path));if(l&&s){const d=dY.get(l);d&&clearTimeout(d);const p=setTimeout(()=>{dY.delete(l),J_(t,e,l)},E2t);dY.set(l,p)}}},clearExternalChange:n=>{e(r=>({editorExternalChanges:ui(r.editorExternalChanges,n)}))},setFileMtime:(n,r)=>{e(s=>({editorFileMtimes:{...s.editorFileMtimes,[n]:r}}))},forceOverwrite:async n=>{const r=kp.getContent(n);if(r===null){bs.error("forceOverwrite: no content available for",n);return}e(s=>({editorSaving:{...s.editorSaving,[n]:!0},editorConflictFile:null}));try{const s=await Z.editor.writeFile(n,r);ld.set(n,Date.now()),e(i=>({editorModifiedFiles:ui(i.editorModifiedFiles,n),editorSaving:ui(i.editorSaving,n),editorFileMtimes:{...i.editorFileMtimes,[n]:s.mtimeMs},editorExternalChanges:ui(i.editorExternalChanges,n)}));try{localStorage.removeItem(`editor-draft:${n}`)}catch{}}catch(s){const i=s instanceof Error?s.message:String(s);bs.error("Failed to force overwrite:",i),e(o=>({editorSaving:ui(o.editorSaving,n),editorSaveError:{...o.editorSaveError,[n]:i}}))}},resolveConflict:()=>{e({editorConflictFile:null})}});async function J_(e,t,n){try{const r=performance.now(),s=await Z.editor.readDir(n);bs.info(`[perf] refreshDirectory: IPC=${(performance.now()-r).toFixed(1)}ms, entries=${s.entries.length}, dir=${hf(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){bs.error("Failed to refresh directory:",r)}}function hh(e,t,n){const r=al(t),s=al(e);if(r.length===0)return e;const i=Lc(t)||Lc(e)||Lc(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?iL(n,...c):n}function eOe(e,t,n){const r=al(n),s=al(e);if(r.length===0)return e;const i=Lc(t)||Lc(e)||Lc(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?iL(t,...c):t}function Al(e,t,n){const r={};let s=!1;for(const[i,o]of Object.entries(e)){const a=hh(i,t,n);a!==i&&(s=!0),r[a]=o}return s?r:e}function 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 G$(e){const t=[];return e.hasLspServers&&t.push("lsp"),e.hasMcpServers&&t.push("mcp"),e.hasAgents&&t.push("agent"),e.hasCommands&&t.push("command"),e.hasHooks&&t.push("hook"),t.length===0&&t.push("skill"),t}const $2t={lsp:"LSP",mcp:"MCP",agent:"Agent",command:"Command",hook:"Hook",skill:"Skill"};function Ise(e){return $2t[e]}function N2t(e){if(e>=1e6){const t=e/1e6;return t>=10?`${Math.round(t)}M`:`${t.toFixed(1).replace(/\.0$/,"")}M`}if(e>=1e3){const t=e/1e3;return t>=10?`${Math.round(t)}K`:`${t.toFixed(1).replace(/\.0$/,"")}K`}return String(e)}function H$(e){return e&&e.trim().toLowerCase()||"other"}function ML(e,t,n){return t==="project"||t==="local"?`plugin:${e}:${t}:${_T(n)}`:`plugin:${e}:${t}`}function oP(e,t,n){return t==="project"||t==="local"?`mcp:${e}:${t}:${_T(n)}`:`mcp:${e}:${t}`}function tS(e,t){return t?`mcp-diagnostic:${t}:${e}`:`mcp-diagnostic:${e}`}function _T(e){return e??"__global__"}function lXe(e,t){return e.some(n=>n.scope===t)}function cXe(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"已安装"}}function uXe(e){const t=Array.from(new Set(e.map(n=>n.scope)));return cXe(t)}const tOe={local:0,project:1,global:2,user:2};function dXe(e){return e.length===0?null:[...e].sort((t,n)=>tOe[t.scope]-tOe[n.scope])[0]}function pXe(e){const t=Array.from(new Set(e.map(n=>n.scope)));return cXe(t)}function qg(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=>Ufe(Gw(p,"mcp"))).length>0?null:i.map(p=>Gw(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=>Ufe(Gw(l,"plugins")));return a.length===0?i.map(d=>Gw(d,"plugins").reason).find(d=>typeof d=="string"&&d.trim().length>0)??"当前运行时不支持安装插件。":t||a.find(l=>l.authenticated)?null:`${a[0]?.displayName??"Anthropic"} 未连接。请打开首页登录。`}function dC(e){return e.toLowerCase().replace(/\s+/g,"-").replace(/[^\w.-]/g,"")}function Mse(e){return e==="agent_teams_orchestrator"?"global":"user"}function A2t(e){return e==="user"||e==="global"}function m0(e){return e==="project"||e==="local"}function nOe(e,t){switch(e){case"global":return"全局";case"user":return t==="agent_teams_orchestrator"?"用户(旧版)":"用户(全局)";case"project":return"项目";case"local":return"本地";default:return e}}function Bl(e,t){return e.panes.find(n=>n.id===t)}function kh(e,t){return e.panes.find(n=>n.tabs.some(r=>r.id===t))}function io(e,t){return{...e,panes:e.panes.map(n=>n.id===t.id?t:n)}}function nk(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=fXe(o);let c=e.focusedPaneId;return e.focusedPaneId===t&&(c=a[Math.min(n,a.length-1)].id),{panes:a,focusedPaneId:c}}function rOe(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:fXe(o)}}function fXe(e){if(e.length===0)return e;const t=1/e.length;return e.map(n=>({...n,widthFraction:t}))}function hXe(e){const t=Bl(e,e.focusedPaneId);return t?{openTabs:t.tabs,activeTabId:t.activeTabId,selectedTabIds:t.selectedTabIds}:{openTabs:[],activeTabId:null,selectedTabIds:[]}}function hu(e){return e.panes.flatMap(t=>t.tabs)}function sOe(e){return{id:e,tabs:[],activeTabId:null,selectedTabIds:[],widthFraction:0}}let yx=null,hY=0;const aP=new Map,lP=new Map,mY=new Map;let I2t=0,M2t=0;const gY=new Map,OY=new Map,Q2t="__user__";function _Y(e){return Object.values(e).some(Boolean)}function D2t(e){return e??"__user__"}function bI(e){return new Set(e.map(t=>t.pluginId))}function OZ(e,t){return e.startsWith(`plugin:${t}:`)}function iOe(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=>OZ(o,a))&&delete r[o];for(const o of Object.keys(s))i.some(a=>OZ(o,a))&&delete s[o];return{pluginInstallProgress:r,installErrors:s}}function xh(e){const t=aP.get(e);t&&(clearTimeout(t),aP.delete(e))}function oOe(e){const t=Array.from(e);for(const n of Array.from(aP.keys()))t.some(r=>OZ(n,r))&&xh(n)}function aOe(e,t){xh(e);const n=setTimeout(()=>{aP.delete(e),t(r=>r.pluginInstallProgress[e]!=="success"?{}:{pluginInstallProgress:{...r.pluginInstallProgress,[e]:"idle"}})},mXe);aP.set(e,n)}function L2t(e,t,n){return t==="project"||t==="local"?`mcp-custom:${e}:${t}:${_T(n)}`:`mcp-custom:${e}:${t}`}function _Z(e){return e.includes(":project:")||e.endsWith(":project")||e.includes(":local:")||e.endsWith(":local")}function uu(e){const t=lP.get(e);t&&(clearTimeout(t),lP.delete(e))}function bY(e,t){uu(e);const n=setTimeout(()=>{lP.delete(e),t(r=>r.mcpInstallProgress[e]!=="success"?{}:{mcpInstallProgress:{...r.mcpInstallProgress,[e]:"idle"}})},mXe);lP.set(e,n)}function j2t(e,t){const n={...e},r={...t};for(const s of Object.keys(n))(s.startsWith("mcp:")||s.startsWith("mcp-custom:"))&&_Z(s)&&delete n[s];for(const s of Object.keys(r))(s.startsWith("mcp:")||s.startsWith("mcp-custom:"))&&_Z(s)&&delete r[s];return{mcpInstallProgress:n,installErrors:r}}function X2t(){for(const e of Array.from(lP.keys()))_Z(e)&&uu(e)}function U2t(e){return e??Q2t}const mXe=2e3,lOe="Project- and local-scoped plugins require an active project in the Extensions tab.";function Q1(e){return HO({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 z2t=(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:{},extensionToasts:[],skillsUserCatalog:[],skillsProjectCatalogByProjectPath:{},skillsCatalogLoadingByProjectPath:{},skillsCatalogErrorByProjectPath:{},skillsLoading:!1,skillsError:null,skillsDetailsById:{},skillsDetailLoadingById:{},skillsDetailErrorById:{},skillsMutationLoading:!1,skillsMutationError:null,mcpGitHubStars:{},fetchPluginCatalog:async(n,r)=>{if(!Z.plugins)return;const s=D2t(n);if(yx&&!r&&yx.key===s){await yx.promise;return}const i=++hY,o=Symbol("pluginCatalogRequest");e({pluginCatalogLoading:!0,pluginCatalogError:null});let a=null;a=(async()=>{try{const c=await Z.plugins.getAll(n,r);e(l=>{if(i!==hY)return{};const d=n??null,f=l.pluginCatalogProjectPath===d?new Set:new Set([...bI(l.pluginCatalog),...bI(c)]),h=iOe(f,l.pluginInstallProgress,l.installErrors);return oOe(f),{pluginCatalog:c,pluginCatalogLoading:!1,pluginCatalogError:null,pluginCatalogProjectPath:d,pluginInstallProgress:h.pluginInstallProgress,installErrors:h.installErrors}})}catch(c){e(l=>{if(i!==hY)return{};const d=n??null,p=l.pluginCatalogProjectPath===d,f=iOe(p?new Set:bI(l.pluginCatalog),l.pluginInstallProgress,l.installErrors);return oOe(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{yx?.token===o&&(yx=null)}})(),yx={key:s,promise:a,token:o},await a},fetchPluginReadme:n=>{if(!Z.plugins)return;const r=t(),s=r.pluginReadmes[n];s!=null||r.pluginReadmeLoading[n]||(e(i=>({pluginReadmeLoading:{...i.pluginReadmeLoading,[n]:!0}})),Z.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(Z.mcpRegistry){e({mcpBrowseLoading:!0,mcpBrowseError:null});try{const r=await Z.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(Z.mcpRegistry)try{const r=await Z.mcpRegistry.getInstalled(n);e(s=>{const i=n??null,o=_T(i),a=s.mcpInstalledProjectPath===i,c=a?{mcpInstallProgress:s.mcpInstallProgress,installErrors:s.installErrors}:j2t(s.mcpInstallProgress,s.installErrors);return a||X2t(),{mcpInstalledServers:r,mcpInstalledServersByProjectPath:{...s.mcpInstalledServersByProjectPath,[o]:r},mcpInstalledProjectPath:i,mcpInstallProgress:c.mcpInstallProgress,installErrors:c.installErrors}})}catch{}},runMcpDiagnostics:async n=>{const r=Z.mcpRegistry;if(!r)return;const s=_T(n),i=mY.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(p=>[tS(p.name,p.scope),p])),l=a.filter(p=>p.status==="failed");if(l.length>0){const p=l.map(f=>f.name).join(", ");t().addExtensionToast("warning","MCP 连接异常",`${p} 连接失败`)}const d=Date.now();e({mcpDiagnostics:c,mcpDiagnosticsLoading:!1,mcpDiagnosticsByProjectPath:{...t().mcpDiagnosticsByProjectPath,[s]:c},mcpDiagnosticsLoadingByProjectPath:{...t().mcpDiagnosticsLoadingByProjectPath,[s]:!1},mcpDiagnosticsLastCheckedAt:d,mcpDiagnosticsLastCheckedAtByProjectPath:{...t().mcpDiagnosticsLastCheckedAtByProjectPath,[s]:d}})}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{mY.delete(s)}})();mY.set(s,o),await o},fetchSkillsCatalog:async n=>{if(!Z.skills)return;const r=U2t(n),s=++I2t;gY.set(r,s),e(i=>{const o={...i.skillsCatalogLoadingByProjectPath,[r]:!0};return{skillsCatalogLoadingByProjectPath:o,skillsCatalogErrorByProjectPath:{...i.skillsCatalogErrorByProjectPath,[r]:null},skillsLoading:_Y(o),skillsError:null}});try{const i=await Z.skills.list(n);if(gY.get(r)!==s)return;e(o=>({skillsCatalogLoadingByProjectPath:{...o.skillsCatalogLoadingByProjectPath,[r]:!1},skillsCatalogErrorByProjectPath:{...o.skillsCatalogErrorByProjectPath,[r]:null},skillsLoading:_Y({...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(gY.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:_Y({...a.skillsCatalogLoadingByProjectPath,[r]:!1}),skillsError:o}))}},fetchSkillDetail:async(n,r)=>{if(!Z.skills)return;const s=++M2t;OY.set(n,s),e(i=>({skillsDetailLoadingById:{...i.skillsDetailLoadingById,[n]:!0},skillsDetailErrorById:{...i.skillsDetailErrorById,[n]:null}}));try{const i=await Z.skills.getDetail(n,r);if(OY.get(n)!==s)return;e(o=>({skillsDetailsById:{...o.skillsDetailsById,[n]:i},skillsDetailLoadingById:{...o.skillsDetailLoadingById,[n]:!1},skillsDetailErrorById:{...o.skillsDetailErrorById,[n]:null}}))}catch(i){if(OY.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(!Z.skills)throw new Error("Skills API is not available");e({skillsMutationLoading:!0,skillsMutationError:null});try{const r=await Z.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(!Z.skills)throw new Error("Skills API is not available");e({skillsMutationLoading:!0,skillsMutationError:null});try{const r=await Z.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(!Z.skills)throw new Error("Skills API is not available");e({skillsMutationLoading:!0,skillsMutationError:null});try{const r=await Z.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(!Z.skills)throw new Error("Skills API is not available");e({skillsMutationLoading:!0,skillsMutationError:null});try{const r=await Z.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(!Z.skills)throw new Error("Skills API is not available");e({skillsMutationLoading:!0,skillsMutationError:null});try{await Z.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(!Z.plugins)return;const r=t().pluginCatalogProjectPath??void 0,s=n.scope!=="user"?n.projectPath??t().pluginCatalogProjectPath??void 0:n.projectPath,i=ML(n.pluginId,n.scope,s),o=s===n.projectPath?n:{...n,projectPath:s},a=t();if(a.cliStatus===null)try{await Q1(a)}catch{}const c=D1(t()),l=o.scope!=="user"&&!o.projectPath?lOe:qg({isInstalled:!1,...c,section:"plugins"});if(l){xh(i),e(d=>({pluginInstallProgress:{...d.pluginInstallProgress,[i]:"error"},installErrors:{...d.installErrors,[i]:l}}));return}xh(i),e(d=>({pluginInstallProgress:{...d.pluginInstallProgress,[i]:"pending"},installErrors:{...d.installErrors,[i]:""}}));try{const d=await Z.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().addExtensionToast("success","插件已安装",`已安装到 claudecode (${o.scope??"user"})`),t().fetchPluginCatalog(o.scope!=="user"?o.projectPath:r,!0),aOe(i,e)}catch(d){xh(i);const p=d instanceof Error?d.message:"Install failed";e(f=>({pluginInstallProgress:{...f.pluginInstallProgress,[i]:"error"},installErrors:{...f.installErrors,[i]:p}}))}},uninstallPlugin:async(n,r,s)=>{if(!Z.plugins)return;const i=t().pluginCatalogProjectPath??void 0,o=r??"user",a=o!=="user"?s??t().pluginCatalogProjectPath??void 0:s,c=ML(n,o,a);if(o!=="user"&&!a){xh(c),e(p=>({pluginInstallProgress:{...p.pluginInstallProgress,[c]:"error"},installErrors:{...p.installErrors,[c]:lOe}}));return}const l=t();if(l.cliStatus===null)try{await Q1(l)}catch{}const d=qg({isInstalled:!0,...D1(t()),section:"plugins"});if(d){xh(c),e(p=>({pluginInstallProgress:{...p.pluginInstallProgress,[c]:"error"},installErrors:{...p.installErrors,[c]:d}}));return}xh(c),e(p=>({pluginInstallProgress:{...p.pluginInstallProgress,[c]:"pending"}}));try{const p=await Z.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),aOe(c,e)}catch(p){xh(c);const f=p instanceof Error?p.message:"Uninstall failed";e(h=>({pluginInstallProgress:{...h.pluginInstallProgress,[c]:"error"},installErrors:{...h.installErrors,[c]:f}}))}},installMcpServer:async n=>{const r=oP(n.registryId,n.scope,n.projectPath);if(!Z.mcpRegistry){uu(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 Q1(s)}catch{}const i=qg({isInstalled:!1,...D1(t()),section:"mcp"});if(i){uu(r),e(o=>({mcpInstallProgress:{...o.mcpInstallProgress,[r]:"error"},installErrors:{...o.installErrors,[r]:i}}));return}uu(r),e(o=>({mcpInstallProgress:{...o.mcpInstallProgress,[r]:"pending"}}));try{const o=await Z.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"}})),bY(r,e)}catch(o){uu(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=L2t(n.serverName,r,n.projectPath);try{if(!Z.mcpRegistry)throw new Error("MCP Registry not available");const i=t();if(i.cliStatus===null)try{await Q1(i)}catch{}const o=qg({isInstalled:!1,...D1(t()),section:"mcp"});if(o)throw new Error(o);uu(s),e(c=>({mcpInstallProgress:{...c.mcpInstallProgress,[s]:"pending"}}));const a=await Z.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"}})),t().addExtensionToast("success","MCP 服务器已安装",`已安装 ${n.serverName}`),bY(s,e)}catch(i){uu(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"||m0(s)?s:"user",a=oP(n,o,i);if(!Z.mcpRegistry){uu(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 Q1(c)}catch{}const l=qg({isInstalled:!0,...D1(t()),section:"mcp"});if(l){uu(a),e(d=>({mcpInstallProgress:{...d.mcpInstallProgress,[a]:"error"},installErrors:{...d.installErrors,[a]:l}}));return}uu(a),e(d=>({mcpInstallProgress:{...d.mcpInstallProgress,[a]:"pending"}}));try{const d=await Z.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"}})),t().addExtensionToast("success","MCP 服务器已卸载"),bY(a,e)}catch(d){uu(a);const p=d instanceof Error?d.message:"Uninstall failed";e(f=>({mcpInstallProgress:{...f.mcpInstallProgress,[a]:"error"},installErrors:{...f.installErrors,[a]:p}}))}},addExtensionToast:(n,r,s)=>{const i=`toast-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;e(o=>({extensionToasts:[...o.extensionToasts,{id:i,type:n,title:r,message:s}]})),n==="success"&&setTimeout(()=>{e(o=>({extensionToasts:o.extensionToasts.filter(a=>a.id!==i)}))},3e3)},dismissExtensionToast:n=>{e(r=>({extensionToasts:r.extensionToasts.filter(s=>s.id!==n)}))},openExtensionsTab:()=>{const n=t(),r=n.selectedProjectId??n.activeProjectId??void 0,i=n.paneLayout.panes.find(o=>o.id===n.paneLayout.focusedPaneId)?.tabs.find(o=>o.type==="extensions");if(i){if(i.projectId!==r||i.label!=="扩展"){const o=kh(n.paneLayout,i.id);o&&e({paneLayout:io(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=>{!Z.mcpRegistry||n.length===0||Z.mcpRegistry.githubStars(n).then(r=>{Object.keys(r).length>0&&e(s=>({mcpGitHubStars:{...s.mcpGitHubStars,...r}}))}).catch(()=>{})}}),cOe=50;function bZ(e,t){return e.find(n=>n.type==="session"&&n.sessionId===t)}function gXe(e,t,n){return e.find(r=>r.type==="session"&&r.sessionId===t&&r.projectId===n)}function yZ(e){return e.length<=cOe?e:e.slice(0,cOe-1)+"…"}function B2t(e,t="notification",n){return{id:crypto.randomUUID(),kind:"error",source:t,highlight:n??"red",payload:e}}function uOe(e){return{id:crypto.randomUUID(),kind:"search",source:"commandPalette",highlight:"yellow",payload:e}}function F2t(e){return e.kind==="error"}function Y2t(e){return e.kind==="search"}const yI=to("Store:notification"),V2t=200,q2t=(e,t)=>({notifications:[],unreadCount:0,notificationsLoading:!1,notificationsError:null,fetchNotifications:async()=>{e({notificationsLoading:!0,notificationsError:null});try{const n=await Z.notifications.get({limit:V2t,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 Z.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=>Z.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 Z.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 Z.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=>Z.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 Z.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=B2t({errorId:n.id,errorTimestamp:n.timestamp,toolUseId:n.toolUseId,subagentId:n.subagentId,lineNumber:n.lineNumber},"notification",n.triggerColor),i=hu(r.paneLayout),o=gXe(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"})}}),QL=4;function xx(e){const t=hXe(e);return{paneLayout:e,openTabs:t.openTabs,activeTabId:t.activeTabId,selectedTabIds:t.selectedTabIds}}const W2t=(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=Bl(s,n);if(!i)return;const o={...s,focusedPaneId:n};e(xx(o)),i.activeTabId&&t().setActiveTab(i.activeTabId)},splitPane:(n,r,s)=>{const i=t(),{paneLayout:o}=i;if(o.panes.length>=QL)return;const a=Bl(o,n);if(!a)return;const c=a.tabs.find(g=>g.id===r);if(!c)return;const l=a.tabs.filter(g=>g.id!==r);let d=a.activeTabId;if(a.activeTabId===r){const g=a.tabs.findIndex(_=>_.id===r);d=l[g]?.id??l[g-1]?.id??null}const p={...a,tabs:l,activeTabId:d,selectedTabIds:a.selectedTabIds.filter(g=>g!==r)},f=crypto.randomUUID(),h={...sOe(f),tabs:[c],activeTabId:c.id};let m=io(o,p);l.length===0&&o.panes.length>1&&(m=nk(m,n)),m=rOe(m,p.id!==n?o.panes[0].id:n,h,s),m={...m,focusedPaneId:f},e(xx(m)),c.type==="session"&&t().setActiveTab(c.id)},closePane:n=>{const r=t(),{paneLayout:s}=r;if(s.panes.length<=1)return;const i=Bl(s,n);if(!i)return;for(const c of i.tabs)r.cleanupTabUIState(c.id),r.cleanupTabSessionData(c.id);const o=nk(s,n);e(xx(o));const a=Bl(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=Bl(a,r),l=Bl(a,s);if(!c||!l)return;const d=c.tabs.find(g=>g.id===n);if(!d)return;const p=c.tabs.filter(g=>g.id!==n);let f=c.activeTabId;if(c.activeTabId===n){const g=c.tabs.findIndex(_=>_.id===n);f=p[g]?.id??p[g-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=io(a,{...c,tabs:p,activeTabId:f,selectedTabIds:c.selectedTabIds.filter(g=>g!==n)});m=io(m,{...l,tabs:h,activeTabId:d.id}),p.length===0&&m.panes.length>1&&(m=nk(m,r)),m={...m,focusedPaneId:s},e(xx(m))},moveTabToNewPane:(n,r,s,i)=>{const o=t(),{paneLayout:a}=o;if(a.panes.length>=QL)return;const c=Bl(a,r);if(!c)return;const l=c.tabs.find(g=>g.id===n);if(!l)return;const d=c.tabs.filter(g=>g.id!==n);let p=c.activeTabId;if(c.activeTabId===n){const g=c.tabs.findIndex(_=>_.id===n);p=d[g]?.id??d[g-1]?.id??null}const f=crypto.randomUUID(),h={...sOe(f),tabs:[l],activeTabId:l.id};let m=io(a,{...c,tabs:d,activeTabId:p,selectedTabIds:c.selectedTabIds.filter(g=>g!==n)});d.length===0&&m.panes.length>1&&(m=nk(m,r)),m=rOe(m,s,h,i),m={...m,focusedPaneId:f},e(xx(m))},reorderTabInPane:(n,r,s)=>{const{paneLayout:i}=t(),o=Bl(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=io(i,{...o,tabs:a});e(xx(l))},resizePanes:(n,r)=>{const{paneLayout:s}=t(),i=s.panes.findIndex(h=>h.id===n);if(i===-1||i>=s.panes.length-1)return;const o=.1,a=Math.max(o,Math.min(1-o*(s.panes.length-1),r)),c=s.panes[i],l=s.panes[i+1],p=c.widthFraction+l.widthFraction-a;if(p<o)return;const f=s.panes.map((h,m)=>m===i?{...h,widthFraction:a}:m===i+1?{...h,widthFraction:p}:h);e({paneLayout:{...s,panes:f}})},getPaneForTab:n=>kh(t().paneLayout,n)?.id??null,getAllPaneTabs:()=>hu(t().paneLayout)}),G2t=(e,t)=>({projects:[],selectedProjectId:null,projectsLoading:!1,projectsError:null,fetchProjects:async()=>{if(!t().projectsLoading){e({projectsLoading:!0,projectsError:null});try{const r=[...await Z.getProjects()].sort((s,i)=>(i.mostRecentSession??0)-(s.mostRecentSession??0));e({projects:r,projectsLoading:!1})}catch(n){e({projectsError:n instanceof Error?n.message:"Failed to fetch projects",projectsLoading:!1})}}},selectProject:n=>{e({selectedProjectId:n,...Xh()}),t().fetchSessionsInitial(n)}}),yY=to("Store:repository"),H2t=3e4;async function Z2t(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 K2t=(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 Z2t(Z.getRepositoryGroups(),H2t,"get-repository-groups");e({repositoryGroups:r,repositoryGroupsLoading:!1});const s=Date.now()-n;s>=2e3&&yY.warn(`fetchRepositoryGroups slow ms=${s} count=${r.length}`)}catch(r){const s=Date.now()-n;yY.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){yY.warn("Repository not found:",n);return}const o=s.worktrees.find(a=>a.isMainWorktree)??s.worktrees[0];o?(e({selectedRepositoryId:n,selectedWorktreeId:o.id,selectedProjectId:o.id,activeProjectId:o.id,...Xh()}),t().fetchSessionsInitial(o.id)):e({selectedRepositoryId:n,selectedWorktreeId:null,...Xh()})},selectWorktree:n=>{e({selectedWorktreeId:n,selectedProjectId:n,activeProjectId:n,...Xh()}),t().fetchSessionsInitial(n)},setViewMode:n=>{e({viewMode:n,selectedRepositoryId:null,selectedWorktreeId:null,selectedProjectId:null,...Xh()}),n==="grouped"?t().fetchRepositoryGroups():t().fetchProjects()}}),xI=to("scheduleSlice"),J2t=(e,t)=>({schedules:[],schedulesLoading:!1,schedulesError:null,scheduleRuns:{},scheduleRunsLoading:{},async fetchSchedules(){if(!t().schedulesLoading){e({schedulesLoading:!0,schedulesError:null});try{const n=await Z.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 Z.schedules.create(n);return e(s=>({schedules:[...s.schedules,r]})),r},async updateSchedule(n,r){const s=await Z.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 Z.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 Z.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 Z.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 Z.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 Z.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 Z.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 Z.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()},openTasksTab:()=>{const n=t(),s=n.paneLayout.panes.find(i=>i.id===n.paneLayout.focusedPaneId)?.tabs.find(i=>i.type==="tasks");if(s){n.setActiveTab(s.id);return}n.openTab({type:"tasks",label:"任务"}),t().fetchAllTasks(),t().fetchSchedules()}});function eDt(e){return"chunkType"in e&&e.chunkType==="ai"}function tDt(e){return eDt(e)&&"semanticSteps"in e}function nDt(e){return e.type==="assistant"}function rDt(e){return"chunkType"in e&&e.chunkType==="user"&&"rawMessages"in e}function sDt(e){return"chunkType"in e&&e.chunkType==="system"&&"rawMessages"in e}function iDt(e){return"chunkType"in e&&e.chunkType==="compact"&&"rawMessages"in e}function oDt(e){return"chunkType"in e&&"rawMessages"in e}function bT(e){return e.length===0?[]:oDt(e[0])?e:null}const dz=/[\\/]/;function Sc(e){const t=e.split(dz);return t[t.length-1]||""}function aDt(e){return e.split(dz).filter(Boolean)[0]??""}function lDt(e){return e.split(dz).filter(Boolean)}function cDt(e){return dz.test(e)}function uDt(e){return/^\.\.?[\\/]/.test(e)}const dDt=to("Util:groupTransformer"),dOe=/\/([a-z][a-z-]{0,50})(?:\s+(\S[^\n]{0,1000}))?$/gim,pOe=100;function cP(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(rDt(l))r.push({type:"user",group:pDt(l,s++)});else if(sDt(l))r.push({type:"system",group:yDt(l)}),i++;else if(tDt(l))r.push({type:"ai",group:SDt(l,o)}),o++;else if(iDt(l))r.push({type:"compact",group:xDt(l)}),a++;else{const d="chunkType"in l?l.chunkType:"unknown";dDt.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=wDt(r,l),f=kDt(r,l);if(p&&f){const h=CDt(p),m=RDt(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 pDt(e,t){return fDt(e.userMessage,t)}function fDt(e,t){const n=hDt(e);return{id:`user-${e.uuid}`,message:e,timestamp:e.timestamp,content:n,index:t}}function hDt(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=Gvt(t),i=LU(t),o=i?[]:mDt(s);r.push(...Dse(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 mDt(e){if(!e)return[];const t=[];let n;for(dOe.lastIndex=0;(n=dOe.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 gDt=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"]),ODt=/[\s,)}\]]/;function _Dt(e){if(/^[A-Za-z]:[\\/]/.test(e)||e.startsWith("\\\\")||uDt(e))return!0;const t=aDt(e);return!!(gDt.has(t)||cDt(e)&&e.length>2&&(lDt(e).length>2||/\.[a-zA-Z0-9]+$/.test(e)))}function bDt(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&&!ODt.test(e[i]);)i+=1;s=e.slice(n,i)}return!s||!_Dt(s)?null:{path:s,raw:e.slice(t,i),startIndex:t,endIndex:i}}function Qse(e){if(!e)return[];const t=[];let n=0;for(;n<e.length;){const r=e.indexOf("@",n);if(r<0)break;const s=bDt(e,r);s?(t.push(s),n=s.endIndex):n=r+1}return t}function Dse(e){return Qse(e).map(({path:t,raw:n})=>({path:t,raw:n}))}function yDt(e){return{id:e.id,message:e.message,timestamp:e.startTime,commandOutput:e.commandOutput}}function xDt(e){return{id:e.id,timestamp:e.startTime,message:e.message}}function SDt(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=>nDt(d))??null,a=vDt(n,o),c=TDt(n),l=EDt(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 vDt(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 TDt(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>pOe?d.slice(0,pOe)+"...":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 EDt(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 wDt(e,t){for(let n=t-1;n>=0;n--)if(e[n].type==="ai")return e[n].group;return null}function kDt(e,t){for(let n=t+1;n<e.length;n++)if(e[n].type==="ai")return e[n].group;return null}function CDt(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 RDt(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 OXe=500,PDt="CLAUDE.md",fOe="project-memory";function Mp(e){let t=0;for(let r=0;r<e.length;r++){const s=e.charCodeAt(r);t=(t<<5)-t+s,t=t&t}return`cmd-${Math.abs(t).toString(16)}`}function Qp(e,t){return e}function Lse(e){return e.startsWith("/")||e.startsWith("\\\\")||/^[a-zA-Z]:[\\/]/.test(e)}function IS(e,t){if(Lse(t))return t;const n=$Dt(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=NDt(r,s),c=ADt(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 $Dt(e){let t=e.length;for(;t>0;){const n=e[t-1];if(n!=="/"&&n!=="\\")break;t--}return e.slice(0,t)}function NDt(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 ADt(e){return al(e)}function Ng(e){return e.replace(/\\/g,"/")}function IDt(e){const t=L0(e);return t===-1?"":e.slice(0,t)}function MDt(e){const t=L0(e);return t<=0?null:e.slice(0,t)}function QDt(e,t){const n=Ng(e).replace(/\/$/,""),r=Ng(t).replace(/\/$/,"");return r===n||r.startsWith(n+"/")}function _Xe(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 bXe(e,t){if(!e)return[];const n=e.content.fileReferences||[],r=[];for(const s of n)if(s.path){const i=Lse(s.path)?s.path:IS(t,s.path);r.push(i)}return r}function yXe(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(...Dse(r))}return t}function xXe(e,t){const n=[],r=e.includes("\\")?"\\":"/";let s=IDt(e);for(;s&&QDt(t,s);){const i=`${s}${r}${PDt}`;n.push(i);const o=MDt(s);if(!o||o===s)break;s=o}return n}function SXe(e,t,n){const r=[],s=v=>n?.[v]?.estimatedTokens??OXe,i=n?.enterprise?.path??"/Library/Application Support/ClaudeCode/CLAUDE.md",o=s("enterprise");o>0&&r.push({id:Mp(i),path:i,source:"enterprise",displayName:Qp(i),isGlobal:!0,estimatedTokens:o,firstSeenInGroup:t});const a="~/.claude/CLAUDE.md",c=s("user");c>0&&r.push({id:Mp(a),path:a,source:"user-memory",displayName:Qp(a),isGlobal:!0,estimatedTokens:c,firstSeenInGroup:t});const l=IS(e,"CLAUDE.md"),d=IS(e,".claude/CLAUDE.md"),p=s("project");p>0&&r.push({id:Mp(l),path:l,source:fOe,displayName:Qp(l),isGlobal:!0,estimatedTokens:p,firstSeenInGroup:t});const f=s("project-alt");f>0&&r.push({id:Mp(d),path:d,source:fOe,displayName:Qp(d),isGlobal:!0,estimatedTokens:f,firstSeenInGroup:t});const h=IS(e,".claude/rules/*.md"),m=s("project-rules");m>0&&r.push({id:Mp(h),path:h,source:"project-rules",displayName:Qp(h),isGlobal:!0,estimatedTokens:m,firstSeenInGroup:t});const g=IS(e,"CLAUDE.local.md"),_=s("project-local");_>0&&r.push({id:Mp(g),path:g,source:"project-local",displayName:Qp(g),isGlobal:!0,estimatedTokens:_,firstSeenInGroup:t});const b="~/.claude/rules/**/*.md",y=s("user-rules");y>0&&r.push({id:Mp(b),path:b,source:"user-rules",displayName:Qp(b),isGlobal:!0,estimatedTokens:y,firstSeenInGroup:t});const x=n?.["auto-memory"]?.path??"~/.claude/projects/.../memory/MEMORY.md",S=s("auto-memory");return S>0&&r.push({id:Mp(x),path:x,source:"auto-memory",displayName:Qp(x),isGlobal:!0,estimatedTokens:S,firstSeenInGroup:t}),r}function DDt(e,t){return{id:Mp(e),path:e,source:"directory",displayName:Qp(e),isGlobal:!1,estimatedTokens:OXe,firstSeenInGroup:t}}function LDt(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=SXe(i,d,a);for(const x of y)l.has(x.path)||(c.push(x),l.add(x.path))}const p=[],f=_Xe(t.steps);p.push(...f);const h=bXe(n,i);p.push(...h);const m=yXe(t.responses);for(const y of m)if(y.path){const x=Lse(y.path)?y.path:IS(i,y.path);p.push(x)}for(const y of p){const x=xXe(y,i);for(const S of x){if(l.has(S)||Ng(S)===`${Ng(i)}/CLAUDE.md`||Ng(S)===`${Ng(i)}/.claude/CLAUDE.md`||Ng(S)===`${Ng(i)}/CLAUDE.local.md`)continue;const T=DDt(S,d);c.push(T),l.add(S)}}const g=[...s,...c],_=g.reduce((y,x)=>y+x.estimatedTokens,0),b=o>0?_/o*100:0;return{newInjections:c,accumulatedInjections:g,totalEstimatedTokens:_,percentageOfContext:b,newCount:c.length,accumulatedCount:g.length}}function jDt(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=LDt({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 hOe=25e3,GQ="mentioned-file",vXe=new Set(["SendMessage","TeamCreate","TeamDelete","TaskCreate","TaskUpdate","TaskList","TaskGet"]);function XDt(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 UDt(e){return`tool-output-ai-${e}`}function zDt(e){return`thinking-text-ai-${e}`}function BDt(e){return`task-coord-ai-${e}`}function FDt(e){return`user-msg-ai-${e}`}function xY(e){return{...e,category:"claude-md"}}function mOe(e){return{id:XDt(e.path),category:GQ,path:e.path,displayName:e.displayName,estimatedTokens:e.estimatedTokens,firstSeenTurnIndex:e.turnIndex,firstSeenInGroup:e.aiGroupId,exists:e.exists??!0}}function YDt(e,t,n,r){const s=[];let i=0;for(const o of e.values()){if(vXe.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:UDt(t),category:"tool-output",turnIndex:t,aiGroupId:n,estimatedTokens:i,toolCount:s.length,toolBreakdown:s}}function VDt(e,t,n,r){const s=[];let i=0;for(const o of e.values()){if(!vXe.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:BDt(t),category:"task-coordination",turnIndex:t,aiGroupId:n,estimatedTokens:i,breakdown:s}}function qDt(e,t,n){const r=e.content.rawText??e.content.text??"";if(!r)return null;const s=Xo(r);if(s===0)return null;const i=r.length>80?r.slice(0,80)+"…":r;return{id:FDt(t),category:"user-message",turnIndex:t,aiGroupId:n,estimatedTokens:s,textPreview:i}}function WDt(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:zDt(t),category:"thinking-text",turnIndex:t,aiGroupId:n,estimatedTokens:s,breakdown:r}}function HQ(e){return e.startsWith("/")||e.startsWith("~/")||e.startsWith("~\\")||e==="~"||e.startsWith("\\\\")||/^[a-zA-Z]:[\\/]/.test(e)}function SY(e,t){if(HQ(t))return t;const n=GDt(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=HDt(r,s),c=ZDt(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 GDt(e){let t=e.length;for(;t>0;){const n=e[t-1];if(n!=="/"&&n!=="\\")break;t--}return e.slice(0,t)}function HDt(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 ZDt(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 Sx(e){return e.replace(/\\/g,"/")}function gOe(e,t){return{id:Mp(e),path:e,source:"directory",displayName:Qp(e),isGlobal:!1,estimatedTokens:500,firstSeenInGroup:t}}function KDt(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===GQ).map(w=>w.path)),h=`ai-${t.turnIndex}`;if(i){const w=SXe(a,h,c);for(const P of w)f.has(P.path)||(p.push(xY(P)),f.add(P.path))}const m=[],g=_Xe(t.steps);m.push(...g);const _=bXe(n,a);m.push(..._);const b=yXe(t.responses);for(const w of b)if(w.path){const P=HQ(w.path)?w.path:SY(a,w.path);m.push(P)}for(const w of m){const P=xXe(w,a);for(const C of P)if(!(f.has(C)||Sx(C)===`${Sx(a)}/CLAUDE.md`||Sx(C)===`${Sx(a)}/.claude/CLAUDE.md`||Sx(C)===`${Sx(a)}/CLAUDE.local.md`))if(d){const I=d[C];if(!I||!I.exists||I.estimatedTokens<=0)continue;const Q=gOe(C,h);Q.estimatedTokens=I.estimatedTokens,p.push(xY(Q)),f.add(C)}else{const I=gOe(C,h);p.push(xY(I)),f.add(C)}}if(n?.content.fileReferences)for(const w of n.content.fileReferences){if(!w.path)continue;const P=HQ(w.path)?w.path:SY(a,w.path);if(f.has(P))continue;const C=l?.get(P);if(C&&C.exists&&C.estimatedTokens<=hOe){const k=mOe({path:P,displayName:w.path,estimatedTokens:C.estimatedTokens,turnIndex:t.turnIndex,aiGroupId:h,exists:C.exists});p.push(k),f.add(P)}}for(const w of b){if(!w.path)continue;const P=HQ(w.path)?w.path:SY(a,w.path);if(f.has(P))continue;const C=l?.get(P);if(C&&C.exists&&C.estimatedTokens<=hOe){const k=mOe({path:P,displayName:w.path,estimatedTokens:C.estimatedTokens,turnIndex:t.turnIndex,aiGroupId:h,exists:C.exists});p.push(k),f.add(P)}}const y=YDt(r,t.turnIndex,h,s);y&&p.push(y);const x=VDt(r,t.turnIndex,h,s);if(x&&p.push(x),n){const w=qDt(n,t.turnIndex,h);w&&p.push(w)}if(s){const w=WDt(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 GQ: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 GQ: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 JDt(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 eLt(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 tLt(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,g=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:g}),o=[],a=!0,c=null,l++,g=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=$2e(x.steps,E,x.processes||[],x.responses)}const T=KDt({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&&g&&_){const E=JDt(_),w=eLt(x);E!==void 0&&w!==void 0&&f.set(g,{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:g});const b={phases:d,compactionCount:l-1,aiGroupPhaseMap:p,compactionTokenDeltas:f};return{statsMap:i,phaseInfo:b}}function xZ(e,t){if(nLt(t))return t;const n=rLt(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=sLt(r,s),c=iLt(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 nLt(e){return e.startsWith("/")||e.startsWith("\\\\")||/^[a-zA-Z]:[\\/]/.test(e)}function rLt(e){let t=e.length;for(;t>0;){const n=e[t-1];if(n!=="/"&&n!=="\\")break;t--}return e.slice(0,t)}function sLt(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 iLt(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 vx=to("Store:sessionDetail"),vY=new Map,TY=new Set,EY=new Set,DL=new Map;function oLt(e){const t=e??"__global__",n=(DL.get(t)??0)+1;return DL.set(t,n),n}function Tx(e,t){return DL.get(t??"__global__")===e}let wY="";function OOe(){return{sessionDetail:null,conversation:null,conversationLoading:!1,sessionDetailLoading:!1,sessionDetailError:null,sessionClaudeMdStats:null,sessionContextStats:null,sessionPhaseInfo:null,visibleAIGroupId:null,selectedAIGroup:null}}const aLt=(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=oLt(s);if(i?.silent||e({sessionDetailLoading:!0,sessionDetailError:null,conversationLoading:!0}),s&&!i?.silent){const a=t().tabSessionData;e({tabSessionData:{...a,[s]:{...a[s]??OOe(),sessionDetailLoading:!0,sessionDetailError:null,conversationLoading:!0}}})}try{const a=await Z.getSessionDetail(n,r);if(!Tx(o,s))return;const c=a?.session?.isOngoing??!1,l=a?bT(a.chunks):null,d=a&&l?cP(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:g}=t();let _=null,b=null,y=null;if(g!=="ssh"&&m&&m!==wY&&(wY=m,Z.readAgentConfigs(m).then(w=>{e({agentConfigs:w})}).catch(w=>{vx.error("Failed to read agent configs:",w),wY=""})),g!=="ssh"&&d?.items){let w={};try{if(w=await Z.readClaudeMdFiles(m),!Tx(o,s))return}catch($){vx.error("Failed to read CLAUDE.md files:",$)}_=jDt(d.items,m,w);const P={};if(_&&_.size>0){const $=new Set;for(const R of _.values())for(const N of R.accumulatedInjections)N.source==="directory"&&$.add(N.path);if($.size>0){const R=new Map,N=new Set,j=await Promise.all(Array.from($).map(async M=>{try{const U=M.replace(/[\\/]CLAUDE\.md$/,""),A=await Z.readDirectoryClaudeMd(U);return{fullPath:M,fileInfo:A,error:!1}}catch(U){return vx.error("Failed to read directory CLAUDE.md:",M,U),{fullPath:M,fileInfo:null,error:!0}}}));if(!Tx(o,s))return;for(const{fullPath:M,fileInfo:U,error:A}of j)A||!U?N.add(M):U.exists&&U.estimatedTokens>0?(R.set(M,U.estimatedTokens),P[M]=U):N.add(M);for(const[,M]of _.entries()){M.accumulatedInjections=M.accumulatedInjections.filter(U=>U.source!=="directory"||!N.has(U.path)),M.newInjections=M.newInjections.filter(U=>U.source!=="directory"||!N.has(U.path));for(const U of M.accumulatedInjections)U.source==="directory"&&R.has(U.path)&&(U.estimatedTokens=R.get(U.path));for(const U of M.newInjections)U.source==="directory"&&R.has(U.path)&&(U.estimatedTokens=R.get(U.path));M.totalEstimatedTokens=M.accumulatedInjections.reduce((U,A)=>U+A.estimatedTokens,0),M.accumulatedCount=M.accumulatedInjections.length,M.newCount=M.newInjections.length}}}const C=new Set;for(const $ of d.items)if($.type==="user"&&$.group.content.fileReferences)for(const R of $.group.content.fileReferences){const N=xZ(m,R.path);C.add(N)}for(const $ of d.items)if($.type==="ai")for(const R of $.group.responses){if(R.type!=="user")continue;let N="";if(typeof R.content=="string")N=R.content;else if(Array.isArray(R.content))for(const j of R.content)j.type==="text"&&j.text&&(N+=j.text);if(N)for(const j of Dse(N)){const M=xZ(m,j.path);C.add(M)}}const k=new Map,I=await Promise.all(Array.from(C).map(async $=>{try{const R=await Z.readMentionedFile($,m);return{filePath:$,fileInfo:R}}catch(R){return vx.error("Failed to read mentioned file:",$,R),{filePath:$,fileInfo:null}}}));if(!Tx(o,s))return;for(const{filePath:$,fileInfo:R}of I)R&&k.set($,R);const Q=tLt(d.items,m,w,k,P);b=Q.statsMap,y=Q.phaseInfo}const x=t();if(!Tx(o,s))return;const S=hu(x.paneLayout),v=bZ(S,r);if(v&&a){const w=a.session.firstMessage?yZ(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(vx.error("fetchSessionDetail error:",a),!Tx(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]??OOe(),sessionDetailError:c,sessionDetailLoading:!1,conversationLoading:!1}}})}}},refreshSessionInPlace:async(n,r)=>{const s=t(),o=hu(s.paneLayout).filter(l=>l.type==="session"&&l.sessionId===r);if(s.selectedSessionId!==r&&o.length===0)return;const a=`${n}/${r}`;if(TY.has(a)){EY.add(a);return}const c=(vY.get(a)??0)+1;vY.set(a,c),TY.add(a);try{const l=await Z.getSessionDetail(n,r);if(vY.get(a)!==c||!l)return;const d=l.session?.isOngoing??!1,p=bT(l.chunks);if(!p)return;const f=cP(p,l.processes,d);if(!f)return;const h=t(),m=hu(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(k=>k.type==="ai"&&k.group.id===w);let C=E.selectedAIGroup;if(P&&w){const k=f.items.find(I=>I.type==="ai"&&I.group.id===w);k?.type==="ai"&&(C=k.group)}v[T.id]={...E,sessionDetail:l,conversation:f,...P?{selectedAIGroup:C}:{}}}e({tabSessionData:v})}catch(l){vx.error("refreshSessionInPlace error:",l)}finally{TY.delete(a),EY.has(a)&&(EY.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=>{DL.delete(n);const r=t().tabSessionData;if(!(n in r))return;const s={...r};delete s[n],e({tabSessionData:s})}}),cd=to("Store:session"),lLt=150;function cLt(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 kY=new Map,uLt=(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 Z.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 Z.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 Z.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 cd.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=(kY.get(n)??0)+1;kY.set(n,s);const i=async()=>{const{connectionMode:a}=t();return Z.getSessionsPaginated(n,null,20,{includeTotalCount:!1,prefilterAll:!1,metadataLevel:a==="ssh"?"light":"deep"})},o=a=>{kY.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(cLt(a)&&t().selectedProjectId===n){cd.warn("refreshSessionsInPlace transient IPC error - retrying once");try{if(await new Promise(l=>setTimeout(l,lLt)),t().selectedProjectId!==n)return;const c=await i();o(c);return}catch(c){cd.error("refreshSessionsInPlace retry error:",c);return}}cd.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 Z.config.unpinSession(s,n):await Z.config.pinSession(s,n)}catch(a){e({pinnedSessionIds:o}),cd.error("togglePinSession error:",a)}},loadPinnedSessions:async()=>{const r=t().selectedProjectId;if(!r){e({pinnedSessionIds:[]});return}try{const{connectionMode:s}=t(),a=((await Z.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 Z.getSessionsByIds(r,d,{metadataLevel:s==="ssh"?"light":"deep"});if(p.length>0){const f=t().sessions,h=new Set(f.map(g=>g.id)),m=p.filter(g=>!h.has(g.id));m.length>0&&e({sessions:[...f,...m]})}}}catch(s){cd.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 Z.config.unhideSession(s,n):await Z.config.hideSession(s,n)}catch(a){e({hiddenSessionIds:o}),cd.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 Z.config.hideSessions(s,n)}catch(c){e({hiddenSessionIds:i}),cd.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 Z.config.unhideSessions(s,n)}catch(a){e({hiddenSessionIds:i}),cd.error("unhideMultipleSessions error:",a)}},loadHiddenSessions:async()=>{const r=t().selectedProjectId;if(!r){e({hiddenSessionIds:[]});return}try{const o=((await Z.config.get()).sessions?.hiddenSessions?.[r]??[]).map(a=>a.sessionId);e({hiddenSessionIds:o})}catch(s){cd.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=>Z.config.pinSession(s,c)))}catch(c){e({pinnedSessionIds:i}),cd.error("pinMultipleSessions error:",c)}}}),dLt=(e,t)=>({drillDownStack:[],currentSubagentDetail:null,subagentDetailLoading:!1,subagentDetailError:null,drillDownSubagent:async(n,r,s,i)=>{e({subagentDetailLoading:!0,subagentDetailError:null});try{const o=await Z.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}),Z.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 Ro(e){const t=hXe(e);return{paneLayout:e,openTabs:t.openTabs,activeTabId:t.activeTabId,selectedTabIds:t.selectedTabIds}}function L1(e,t,n){const r=kh(e,t);return r?io(e,{...r,tabs:r.tabs.map(s=>s.id===t?n(s):s)}):e}const pLt=(e,t)=>({openTabs:[],activeTabId:null,selectedTabIds:[],activeProjectId:null,openTab:(n,r)=>{const s=t(),{paneLayout:i}=s,o=Bl(i,i.focusedPaneId);if(!o)return;if(n.type==="session"&&n.sessionId&&!r?.forceNewTab){const d=hu(i),p=bZ(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:yZ(n.label),createdAt:Date.now()},m={...o,tabs:o.tabs.map(_=>_.id===f.id?h:_),activeTabId:h.id},g=io(i,m);e(Ro(g));return}}const a={...n,id:crypto.randomUUID(),label:yZ(n.label),createdAt:Date.now()},c={...o,tabs:[...o.tabs,a],activeTabId:a.id},l=io(i,c);e(Ro(l))},closeTab:n=>{const r=t(),{paneLayout:s}=r,i=kh(s,n);if(!i)return;const o=i.tabs.findIndex(f=>f.id===n);if(o===-1)return;r.cleanupTabUIState(n),r.cleanupTabSessionData(n);const a=i.tabs.filter(f=>f.id!==n);let c=i.activeTabId;if(i.activeTabId===n&&(c=a[o]?.id??a[o-1]?.id??null),a.length===0&&s.panes.length>1){r.closePane(i.id);return}const l=s.panes.filter(f=>f.id!==i.id).flatMap(f=>f.tabs);if(a.length===0&&l.length===0){const f={...i,tabs:[],activeTabId:null,selectedTabIds:[]},h=io(s,f);e({...Ro(h),...iT()});return}const d={...i,tabs:a,activeTabId:c,selectedTabIds:i.selectedTabIds.filter(f=>f!==n)},p=io(s,d);e(Ro(p)),c&&t().setActiveTab(c)},setActiveTab:n=>{const r=t(),{paneLayout:s}=r,i=r.getActiveTab(),a=kh(s,n)?.tabs.find(f=>f.id===n);i?.id!==n&&Zxt(i?.label??"none",a?.label??n);const c=kh(s,n);if(!c)return;const l=c.tabs.find(f=>f.id===n);if(!l)return;const d={...c,activeTabId:n};let p=io(s,d);if(p={...p,focusedPaneId:c.id},e(Ro(p)),l.type==="session"&&l.sessionId&&l.projectId){const f=l.sessionId,h=l.projectId,m=r.selectedSessionId!==f,g=r.tabSessionData[n],_=g?.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:g.sessionDetail,conversation:g.conversation,conversationLoading:!1,sessionDetailLoading:!1,sessionDetailError:null,sessionClaudeMdStats:g.sessionClaudeMdStats,sessionContextStats:g.sessionContextStats,sessionPhaseInfo:g.sessionPhaseInfo,visibleAIGroupId:g.visibleAIGroupId,selectedAIGroup:g.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:g.sessionDetail,conversation:g.conversation,conversationLoading:!1,sessionDetailLoading:!1,sessionDetailError:null,sessionClaudeMdStats:g.sessionClaudeMdStats,sessionContextStats:g.sessionContextStats,sessionPhaseInfo:g.sessionPhaseInfo,visibleAIGroupId:g.visibleAIGroupId,selectedAIGroup:g.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=dr(h),g=r.projects.find(_=>dr(_.path)===m);if(g&&r.selectedProjectId!==g.id)r.selectProject(g.id);else if(!g)for(const _ of r.repositoryGroups){const b=_.worktrees.find(y=>dr(y.path)===m);if(b&&r.selectedWorktreeId!==b.id){e(MU(_.id,b.id)),t().fetchSessionsInitial(b.id);break}}}}},openDashboard:()=>{const n=t(),{paneLayout:r}=n,s=hu(r).find(l=>l.type==="dashboard");if(s){const l=kh(r,s.id);if(l){const d=l.tabs.findIndex(f=>f.id===s.id),p=l.tabs.length-1;if(d!==-1&&d!==p){const f=[...l.tabs],[h]=f.splice(d,1);f.push(h);const m={...l,tabs:f,activeTabId:s.id},g=io(r,m);e(Ro(g));return}}n.setActiveTab(s.id);return}const i=Bl(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=io(r,a);e(Ro(c))},openSessionReport:n=>{const r=t(),i=hu(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=Bl(n.paneLayout,n.paneLayout.focusedPaneId);return r?.activeTabId?r.tabs.find(s=>s.id===r.activeTabId)??null:null},isSessionOpen:n=>hu(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(Ro(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(Ro(i))},saveTabScrollPosition:(n,r)=>{const{paneLayout:s}=t(),i=L1(s,n,o=>({...o,savedScrollTop:r}));e(Ro(i))},updateTabLabel:(n,r)=>{const{paneLayout:s}=t(),i=L1(s,n,o=>({...o,label:r}));e(Ro(i))},setTabContextPanelVisible:(n,r)=>{const{paneLayout:s}=t(),i=L1(s,n,o=>({...o,showContextPanel:r}));e(Ro(i))},setSelectedTabIds:n=>{const{paneLayout:r}=t(),s=Bl(r,r.focusedPaneId);if(!s)return;const i={...s,selectedTabIds:n},o=io(r,i);e(Ro(o))},clearTabSelection:()=>{const{paneLayout:n}=t(),r=Bl(n,n.focusedPaneId);if(!r)return;const s={...r,selectedTabIds:[]},i=io(n,s);e(Ro(i))},closeOtherTabs:n=>{const r=t(),{paneLayout:s}=r,i=kh(s,n);if(!i)return;const o=i.tabs.filter(d=>d.id!==n);for(const d of o)r.cleanupTabUIState(d.id),r.cleanupTabSessionData(d.id);const a=i.tabs.find(d=>d.id===n);if(!a)return;const c={...i,tabs:[a],activeTabId:n,selectedTabIds:[]},l=io(s,c);e(Ro(l)),t().setActiveTab(n)},closeTabsToRight:n=>{const r=t(),{paneLayout:s}=r,i=kh(s,n);if(!i)return;const o=i.tabs.findIndex(h=>h.id===n);if(o===-1)return;const a=i.tabs.slice(o+1);for(const h of a)r.cleanupTabUIState(h.id),r.cleanupTabSessionData(h.id);const c=i.tabs.slice(0,o+1),d=c.some(h=>h.id===i.activeTabId)?i.activeTabId:n,p={...i,tabs:c,activeTabId:d,selectedTabIds:[]},f=io(s,p);e(Ro(f)),d&&t().setActiveTab(d)},closeAllTabs:()=>{const n=t(),r=hu(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({...Ro({panes:[{id:s,tabs:[],activeTabId:null,selectedTabIds:[],widthFraction:1}],focusedPaneId:s}),...iT()})},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=io(i,{...l,tabs:d,activeTabId:p,selectedTabIds:l.selectedTabIds.filter(f=>!s.has(f))})}if(hu(i).length===0){r.closeAllTabs();return}for(const l of o)i=nk(i,l);e(Ro(i));const c=t().activeTabId;c&&t().setActiveTab(c)},setActiveProject:n=>{e({activeProjectId:n}),t().selectProject(n)},clearActiveProject:()=>{e({activeProjectId:null,selectedProjectId:null,selectedRepositoryId:null,selectedWorktreeId:null,...Xh()})},navigateToSession:(n,r,s=!1,i)=>{const o=t(),a=hu(o.paneLayout),c=gXe(a,r,n)??bZ(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=uOe({...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=uOe({...f});o.enqueueTabNavigation(p,h)}}const l=t().activeTabId??void 0;o.fetchSessionDetail(n,r,l)}}});function yp(){return{expandedAIGroupIds:new Set,expandedDisplayItemIds:new Map,expandedSubagentTraceIds:new Set,showContextPanel:!1,selectedContextPhase:null,savedScrollTop:void 0}}const fLt=(e,t)=>({tabUIStates:new Map,initTabUIState:n=>{const r=t();if(r.tabUIStates.has(n))return;const s=new Map(r.tabUIStates);s.set(n,yp()),e({tabUIStates:s})},cleanupTabUIState:n=>{const r=t();if(!r.tabUIStates.has(n))return;const s=new Map(r.tabUIStates);s.delete(n),e({tabUIStates:s})},toggleAIGroupExpansionForTab:(n,r)=>{const s=t(),i=new Map(s.tabUIStates),o=i.get(n)??yp(),a=new Set(o.expandedAIGroupIds);a.has(r)?a.delete(r):a.add(r),i.set(n,{...o,expandedAIGroupIds:a}),e({tabUIStates:i})},isAIGroupExpandedForTab:(n,r)=>t().tabUIStates.get(n)?.expandedAIGroupIds.has(r)??!1,expandAIGroupForTab:(n,r)=>{const s=t();if(s.tabUIStates.get(n)?.expandedAIGroupIds.has(r))return;const o=new Map(s.tabUIStates),a=o.get(n)??yp(),c=new Set(a.expandedAIGroupIds);c.add(r),o.set(n,{...a,expandedAIGroupIds:c}),e({tabUIStates:o})},toggleDisplayItemExpansionForTab:(n,r,s)=>{const i=t(),o=new Map(i.tabUIStates),a=o.get(n)??yp(),c=new Map(a.expandedDisplayItemIds),l=c.get(r)??new Set,d=new Set(l);d.has(s)?d.delete(s):d.add(s),c.set(r,d),o.set(n,{...a,expandedDisplayItemIds:c}),e({tabUIStates:o})},getExpandedDisplayItemIdsForTab:(n,r)=>t().tabUIStates.get(n)?.expandedDisplayItemIds.get(r)??new Set,expandDisplayItemForTab:(n,r,s)=>{const i=t();if(i.tabUIStates.get(n)?.expandedDisplayItemIds.get(r)?.has(s))return;const c=new Map(i.tabUIStates),l=c.get(n)??yp(),d=new Map(l.expandedDisplayItemIds),p=new Set(d.get(r)??new Set);p.add(s),d.set(r,p),c.set(n,{...l,expandedDisplayItemIds:d}),e({tabUIStates:c})},toggleSubagentTraceExpansionForTab:(n,r)=>{const s=t(),i=new Map(s.tabUIStates),o=i.get(n)??yp(),a=new Set(o.expandedSubagentTraceIds);a.has(r)?a.delete(r):a.add(r),i.set(n,{...o,expandedSubagentTraceIds:a}),e({tabUIStates:i})},expandSubagentTraceForTab:(n,r)=>{const s=t(),i=s.tabUIStates.get(n)??yp();if(i.expandedSubagentTraceIds.has(r))return;const o=new Set(i.expandedSubagentTraceIds);o.add(r);const a=new Map(s.tabUIStates);a.set(n,{...i,expandedSubagentTraceIds:o}),e({tabUIStates:a})},isSubagentTraceExpandedForTab:(n,r)=>t().tabUIStates.get(n)?.expandedSubagentTraceIds.has(r)??!1,setContextPanelVisibleForTab:(n,r)=>{const s=t(),i=new Map(s.tabUIStates),o=i.get(n)??yp();i.set(n,{...o,showContextPanel:r}),e({tabUIStates:i})},isContextPanelVisibleForTab:n=>t().tabUIStates.get(n)?.showContextPanel??!1,setSelectedContextPhaseForTab:(n,r)=>{const s=t(),i=new Map(s.tabUIStates),o=i.get(n)??yp();i.set(n,{...o,selectedContextPhase:r}),e({tabUIStates:i})},saveScrollPositionForTab:(n,r)=>{const s=t(),i=new Map(s.tabUIStates),o=i.get(n)??yp();i.set(n,{...o,savedScrollTop:r}),e({tabUIStates:i})},getScrollPositionForTab:n=>t().tabUIStates.get(n)?.savedScrollTop}),hLt=80;function Ls(e){if(typeof e.messageId=="string"&&e.messageId.trim().length>0)return e.messageId;const t=(e.text??"").slice(0,hLt);return`${e.timestamp}-${e.from}-${t}`}function mLt(e,t){const n=Date.parse(t.timestamp)-Date.parse(e.timestamp);return n!==0?n:Ls(e).localeCompare(Ls(t))}function SZ(...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(mLt)}const gLt="OpenCode runtime delivery is still being checked. Message was saved and will be retried if needed.";function OLt(e){const t=e.runtimeDelivery;return t?.attempted!==!0?{warning:null,debugDetails:null}:t.delivered===!1?{warning:null,debugDetails:{messageId:e.messageId,providerId:t.providerId,delivered:!1,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??[]}}:t.responsePending===!0?{warning:gLt,debugDetails:{messageId:e.messageId,providerId:t.providerId,delivered:null,responsePending:!0,responseState:t.responseState??null,ledgerStatus:t.ledgerStatus??null,acceptanceUnknown:typeof t.acceptanceUnknown=="boolean"?t.acceptanceUnknown:null,reason:t.reason??null,diagnostics:t.diagnostics??[]}}:{warning:null,debugDetails:null}}function _Lt(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 bLt=/^(?<source>[a-z0-9-]+)\/(?<model>\S.*)$/i,yLt={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 xLt(e){const t=e.trim().toLowerCase();if(!t)return e;const n=yLt[t];return n||t.split("-").filter(Boolean).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")}function LL(e){const t=e?.trim();if(!t)return null;const n=bLt.exec(t);return!n?.groups?.source||!n.groups.model?null:{raw:t,sourceId:n.groups.source.toLowerCase(),modelId:n.groups.model}}function SLt(e){const t=LL(e);return t?xLt(t.sourceId):null}function rk(e){return e==="anthropic"||e==="codex"||e==="gemini"||e==="opencode"}function ka(e){return rk(e)?e:void 0}function CO(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(LL(t)||LL(n))return"opencode"}function _Oe(e){const t=e?.trim();if(t)return t.replace(/(?:\[1m\])+$/,"")||void 0}function jse(e,t){const n=e?.trim();return n?(t??CO(n)??CO(_Oe(n)))!=="anthropic"?n:_Oe(n):void 0}const bOe=to("Renderer:unwrapIpc");class Ch extends Error{constructor(t,n,r){super(n),this.operation=t,this.causeError=r,this.name="IpcError"}}const vLt=["TEAM_PROVISIONING","TEAM_DRAFT"];async function ir(e,t){try{return await t()}catch(n){const r=n instanceof Error?n.message:String(n);throw vLt.some(s=>r.includes(s))?bOe.debug(`[${e}] ${r}`):bOe.error(`[${e}] ${r}`),new Ch(e,r,n)}}const B0={autoAllowAll:!1,autoAllowFileEdits:!1,autoAllowSafeBash:!1,timeoutAction:"wait",timeoutSeconds:30},TLt=/^[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 ELt(e){return TLt.test(e.trim())}function Ui(e){const t=e.trim();return t&&(ELt(t)?t.slice(0,8).toLowerCase():t)}function r_(e){return e.displayId?.trim()||Ui(e.id)}function Ps(e){return`#${r_(e)}`}function sk(e,t){if(!t)return!1;const n=t.trim();return n?e.id===n||r_(e)===n:!1}const pz="team-lead",TXe="lead",wLt="负责人",kLt=new Set([pz,TXe]),CLt=new Set([pz,TXe,"orchestrator"]),RLt=new Set(["lead"]);function Xse(e){return e?.trim().toLowerCase()??""}function s_(e){return kLt.has(Xse(e))}function PLt(e){return CLt.has(Xse(e))}function $Lt(e){return RLt.has(Xse(e))}function Jn(e){const t=typeof e.role=="string"?e.role:null;if($Lt(t))return!0;const n=typeof e.agentType=="string"?e.agentType:null;if(PLt(n))return!0;const r=typeof e.name=="string"?e.name:null;return s_(r)}function ZQ(e){const t=e.agentId?.trim();return t||e.name.trim()}const NLt=[[],[{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 EXe(e,t=[]){const n=e.filter(a=>!a.removedAt&&!Jn(a));if(n.length===0)return[];const r=new Map(n.map(a=>[ZQ(a),a])),s=[],i=new Set;for(const a of t){if(a.removedAt||Jn(a))continue;const c=ZQ(a);!r.has(c)||i.has(c)||(s.push(c),i.add(c))}const o=n.map(a=>ZQ(a)).filter(a=>!i.has(a)).toSorted((a,c)=>a.localeCompare(c));return s.push(...o),s}function KQ(e,t=[]){const n=EXe(e,t),r=n.length>0?n.join("|"):null,s=NLt[n.length],i={};return s?.length===n.length&&n.forEach((o,a)=>{i[o]=s[a]}),{orderedVisibleOwnerIds:n,signature:r,assignments:i}}const su="stable-slots-v1",Cp=to("teamSlice"),wXe=3e4,yOe=3e4,ALt=5e3,ILt=4e3,MLt=2e3,F0=new Map,yT=new Map,jL=new Set,nS=new Map,rS=new Map,g0=new Map,vZ=new Set,ik=new Map,TZ=new Set,pC=new Map,Y0=new Map,XL=new Map,kXe=new Map;let j1=null,CY=!1;const JQ=new Map,EZ=new Map,wZ=new Map;function RY(e){return F0.has(e)||(yT.get(e)?.size??0)>0||jL.has(e)}function xOe(e){return XL.get(e)}function QLt(e){return(Y0.get(e)?.size??0)>0}function DLt(){return new Set(Array.from(Y0.entries()).filter(([,e])=>e.size>0).map(([e])=>e))}function LLt(e){PZ.delete(e),$Z.delete(e);const t=`${e}:`;for(const n of BL.keys())n.startsWith(t)&&BL.delete(n);for(const n of FL.keys())n.startsWith(t)&&FL.delete(n)}function X1(e){F0.delete(e),yT.delete(e),jL.delete(e),nS.delete(e),rS.delete(e),g0.delete(e),vZ.delete(e),ik.delete(e),TZ.delete(e),XL.delete(e),JQ.delete(e),EZ.delete(e),wZ.delete(e),LLt(e)}function SOe(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 _a(e,t){if(!(t in e))return null;const n={...e};return delete n[t],n}function PY(e,t){const n=Object.fromEntries(Object.entries(e.provisioningRuns).filter(([,x])=>x.teamName!==t)),r=_a(e.teamDataCacheByName,t),s=_a(e.teamAgentRuntimeByTeam,t),i=_a(e.teamMessagesByName,t),o=_a(e.memberActivityMetaByTeam,t),a=_a(e.provisioningSnapshotByTeam,t),c=_a(e.currentProvisioningRunIdByTeam,t),l=_a(e.currentRuntimeRunIdByTeam,t),d=_a(e.provisioningStartedAtFloorByTeam,t),p=_a(e.leadActivityByTeam,t),f=_a(e.leadContextByTeam,t),h=_a(e.activeToolsByTeam,t),m=_a(e.finishedVisibleByTeam,t),g=_a(e.toolHistoryByTeam,t),_=_a(e.memberSpawnStatusesByTeam,t),b=_a(e.memberSpawnSnapshotsByTeam,t),y=_a(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}:{},...g?{toolHistoryByTeam:g}:{},..._?{memberSpawnStatusesByTeam:_}:{},...b?{memberSpawnSnapshotsByTeam:b}:{},...y?{provisioningErrorByTeam:y}:{}}}function vOe(e,t,n){const r={...e.ignoredProvisioningRunIds},s={...e.ignoredRuntimeRunIds},i=e.currentProvisioningRunIdByTeam[t],o=e.currentRuntimeRunIdByTeam[t];return i&&(r[i]=t),o&&(s[o]=t),{ignoredProvisioningRunIds:r,ignoredRuntimeRunIds:s,provisioningStartedAtFloorByTeam:{...e.provisioningStartedAtFloorByTeam,[t]:n}}}function Sh(e){return kXe.get(e)??0}function mc(e,t){return Sh(e)===t}function U1(e){kXe.set(e,Sh(e)+1)}function jLt(e){const t=Symbol(e),n=yT.get(e);return n?(n.add(t),t):(yT.set(e,new Set([t])),t)}function XLt(e,t){const n=yT.get(e);n&&(n.delete(t),n.size===0&&yT.delete(e))}function z1(){return new Date().toISOString()}function ULt(e){return new Promise(t=>setTimeout(t,e))}function TOe(e){if(e==null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function kZ(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=kZ(e[i],s);return Object.is(o,e[i])||(n=!0),o});return n?r:e}if(TOe(e)&&TOe(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=kZ(n[c],r[c]);Object.is(l,n[c])||(o=!0),a[c]=l}return o?a:e}return t}function EOe(e,t){return e?kZ(e,t):t}const zLt=new Set(["validating","spawning","configuring","assembling","finalizing","verifying"]),UL=new Set(["ready","failed","disconnected","cancelled"]);function wOe(e){return e.startsWith("pending:")}function BLt(e){return(e instanceof Error?e.message:String(e)).includes("Unknown runId")}function zL(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 kOe(e){const t=F0.get(e);if(t)return t;const n=zL(ir("team:getData",()=>Z.teams.getData(e)),wXe,`team:getData(${e})`).finally(()=>{F0.get(e)===n&&F0.delete(e)});return F0.set(e,n),n}function FLt(e){return zL(ir("team:getData",()=>Z.teams.getData(e)),wXe,`team:getData(${e})`)}function YLt(e){const t=Date.now(),n=EZ.get(e)??{windowStartedAt:t,count:0,lastWarnAt:0};return t-n.windowStartedAt>ILt&&(n.windowStartedAt=t,n.count=0),n.count+=1,EZ.set(e,n),n.count}function VLt(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 WLt(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 GLt(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)||!WLt(e[s],t[s]))return!1;return!0}function HLt(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)&&VLt(e.summary,t.summary)&&GLt(e.statuses,t.statuses):!1}function ZLt(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 KLt(e,t){const n=Date.now(),r=wZ.get(e)??0;n-r<MLt||(wZ.set(e,n),Cp.debug(`[perf] member-spawn snapshot suppressed team=${e} runId=${t??"none"} reason=member-spawn-ui-equal`))}function JLt(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 e5t(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)||!JLt(e.members[s],t.members[s]))return!1;return!0}function t5t(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 n5t={canonicalMessages:[],optimisticMessages:[],feedRevision:null,nextCursor:null,hasMore:!1,lastFetchedAt:null,loadingHead:!1,loadingOlder:!1,headHydrated:!1,olderHydrated:!1};function so(e,t){return e.teamMessagesByName[t]??n5t}function $Y(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(t5t),{...e,optimisticMessages:n}}function r5t(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 s5t(e,t){if(e.length===0)return e;const n=new Set(t.map(s=>typeof s.messageId=="string"?s.messageId.trim():"").filter(s=>s.length>0)),r=e.filter(s=>{const i=typeof s.messageId=="string"?s.messageId.trim():"";return!i||!n.has(i)});return r.length===e.length?e:r}function Ex(e){const t=pC.get(e);t!=null&&(clearTimeout(t),pC.delete(e))}function B1(e){Y0.delete(e)}function i5t(e,t,n){if(n){const s=Y0.get(e)??new Set;return s.add(t),Y0.set(e,s),!0}const r=Y0.get(e);return r?(r.delete(t),r.size===0?(Y0.delete(e),!1):!0):!1}function o5t(e,t){return t<=0?[]:e.slice(0,t)}function a5t(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=Yc(s);if(!wre(i)||typeof r.invalidateTaskChangePresence!="function"||typeof r.checkTaskHasChanges!="function")return;const o=kd(t,n,i);r.invalidateTaskChangePresence([o]);try{await r.checkTaskHasChanges(t,n,i)}catch{}}async function COe(e,t,n){let s=500;for(let i=1;i<=60;i++){const o=e(),a=o.provisioningRuns[t];if(a&&UL.has(a.state))return;try{const c=await o.getProvisioningStatus(t);if(UL.has(c.state))return}catch(c){if(BLt(c)){o.clearMissingProvisioningRun(t);return}}await ULt(s),s=Math.min(1500,Math.round(s*1.5))}}const e2=new Set,MS=new Set,CZ=new Set,RZ=new Set,ok=new Set;let ROe=!0;function l5t(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"&&!e2.has(s)&&(e2.add(s),c5t(r,!n)):e2.delete(s)}}function c5t(e,t){const n=e.comments?.length?e.comments[e.comments.length-1]:void 0,r=n?.text||e.description||`${Ps(e)}: ${e.subject}`,s=$a(r).trim();Z.teams?.showMessageNotification({teamName:e.teamName,teamDisplayName:e.teamDisplayName,from:n?.author||"lead",to:"user",summary:`Clarification needed — Task ${Ps(e)}`,body:s,teamEventType:"task_clarification",dedupeKey:`clarification:${e.teamName}:${e.id}:${e.updatedAt??Date.now()}`,suppressToast:t}).catch(()=>{})}function u5t(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=Xb(a),d=Xb(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 g=p?"approved":f?"review":h?"needsFix":a.status;if(!i.includes(g))continue;const _=`${a.teamName}:${a.id}:${g}`;if(MS.has(_))continue;MS.add(_);const b=p||f?"Completed":c.status;d5t(a,b,p?"approved":f?"review":h?"needsFix":void 0,!s)}}function d5t(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;Z.teams?.showMessageNotification({teamName:e.teamName,teamDisplayName:e.teamDisplayName,from:e.owner??"system",to:"user",summary:`Task ${Ps(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 p5t(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}`;CZ.has(p)||(CZ.add(p),f5t(s,d,!n))}}}function f5t(e,t,n){if(t.author==="user")return;const r=$a(t.text).trim(),s=r.length>100?r.slice(0,100)+"...":r;Z.teams?.showMessageNotification({teamName:e.teamName,teamDisplayName:e.teamDisplayName,from:t.author,to:"user",summary:`Comment on ${Ps(e)}: ${e.subject}`,body:s,teamEventType:"task_comment",dedupeKey:`comment:${e.teamName}:${e.id}:${t.id}`,suppressToast:n}).catch(()=>{})}function h5t(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)||RZ.has(i)||(RZ.add(i),m5t(s,!n))}}function m5t(e,t){Z.teams?.showMessageNotification({teamName:e.teamName,teamDisplayName:e.teamDisplayName,from:e.owner??"system",to:"user",summary:`New task ${Ps(e)}: ${e.subject}`,body:$a(e.description||e.subject).trim(),teamEventType:"task_created",dedupeKey:`created:${e.teamName}:${e.id}`,suppressToast:t}).catch(()=>{})}function g5t(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")){ok.delete(s);continue}if(ok.has(s))continue;const a=e.filter(l=>l.teamName===s);if(a.length>0&&a.every(l=>l.status==="completed"||l.status==="deleted")){ok.add(s);continue}ok.add(s),O5t(i[0],i.length,!n)}}function O5t(e,t,n){Z.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 POe(e,t,n){const r=new Set(n.map(o=>kd(e,o.id,Yc(o)))),s=[],i=new Set;for(const o of t){const a=kd(e,o.id,Yc(o));r.has(a)||(s.push(a),i.add(o.id))}return{cacheKeys:s,taskIds:[...i]}}function $Oe(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=kd(e,a.id,Yc(a)),l=kd(e,o.id,Yc(o));return c!==l?o:(s=!0,{...o,changePresence:a.changePresence})});return s?i:n}function NOe(e){const t=e instanceof Ch||e instanceof Error?e.message:"";return t.includes("Failed to verify inbox write")?"Message was written but not verified (race). Please try again.":t||"Failed to send message"}function AOe(e){const t=e instanceof Ch||e instanceof Error?e.message:"";return t.includes("Task status update verification failed")?"Failed to update task status (possible agent conflict).":t||"Failed to perform review action"}const PZ=new Map,BL=new Map,$Z=new Map,_5t=[],b5t=[],FL=new Map;function y5t(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 x5t(e,t){return e.map(n=>CXe(n,t?.members[n.name]))}function CXe(e,t){return{...e,status:y5t(e,t),messageCount:t?.messageCountExact??0,lastActiveAt:t?.lastAuthoredMessageAt??null}}function S5t(e,t){return e?e.memberName===t.memberName&&e.lastAuthoredMessageAt===t.lastAuthoredMessageAt&&e.messageCountExact===t.messageCountExact&&e.latestAuthoredMessageSignalsTermination===t.latestAuthoredMessageSignalsTermination:!1}function v5t(e,t){if(!e)return t;const n=Object.keys(t),r=Object.keys(e);let s=n.length!==r.length;const i={};for(const o of n){const a=t[o],c=e[o];if(!S5t(c,a)){s=!0,i[o]=a;continue}i[o]=c}return s?i:e}function Ri(e,t){return t?e.teamDataCacheByName[t]??(e.selectedTeamName===t?e.selectedTeamData:null):null}function kl(e,t){const n=Ri(e,t);if(!n||!t)return[];const r=e.memberActivityMetaByTeam[t],s=r?.members,i=PZ.get(t);if(i?.snapshotRef===n.members&&i.metaMembersRef===s)return i.result;const o=x5t(n.members,r);return PZ.set(t,{snapshotRef:n.members,metaMembersRef:s,result:o}),o}function RXe(e,t,n){const r=Ri(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=BL.get(o);if(a?.snapshotMemberRef===s&&a.metaEntryRef===i)return a.result;const c=CXe(s,i);return BL.set(o,{snapshotMemberRef:s,metaEntryRef:i,result:c}),c}function Use(e,t){return Ri(e,t)?.members??_5t}function T5t(e,t){return Ri(e,t)?.tasks??b5t}function E5t(e,t){return Ri(e,t)?.isAlive}function fz(e,t){if(!t)return[];const n=so(e,t),r=$Z.get(t);if(r?.canonicalRef===n.canonicalMessages&&r.optimisticRef===n.optimisticMessages)return r.result;const s=SZ(n.canonicalMessages,n.optimisticMessages);return $Z.set(t,{canonicalRef:n.canonicalMessages,optimisticRef:n.optimisticMessages,result:s}),s}function PXe(e,t,n){if(!t||!n)return[];const r=fz(e,t),s=`${t}:${n}`,i=FL.get(s);if(i?.messagesRef===r)return i.result;const o=r.filter(a=>a.from===n||a.to===n);return FL.set(s,{messagesRef:r,result:o}),o}function IOe(e,t){const n=e.memberActivityMetaByTeam[t],r=so(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 w5t(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 k5t(e,t){const n=w5t(e,t);return Object.keys(n).length>0?n:void 0}function C5t(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 MOe(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 R5t(e,t){return t==="TEAM_DRAFT"||t.includes("TEAM_DRAFT")||t===`Team not found: ${e}`||t==="Team config not found"}const NZ="team:launchParams:";function Ef(e,t){const n=e.currentProvisioningRunIdByTeam[t];return n?e.provisioningRuns[n]??null:null}function T_(e,t){const n=Ef(e,t);return n!=null&&zLt.has(n.state)}function P5t(){const e={};try{const t=localStorage;if(!t)return e;for(let n=0;n<t.length;n++){const r=t.key(n);if(r?.startsWith(NZ)){const s=r.slice(NZ.length),i=JSON.parse(t.getItem(r));i&&typeof i=="object"&&(e[s]=i)}}}catch{}return e}function QOe(e,t){try{localStorage?.setItem?.(NZ+e,JSON.stringify(t))}catch{}}function DOe(e,t){return jse(e,t)}const $Xe="team:toolApprovalSettings:";function NXe(e){if(!e)return B0;try{const t=JSON.parse(e),n=B0;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 B0}}function $5t(e){return NXe(localStorage?.getItem?.($Xe+e)??null)}function NY(e,t){try{localStorage?.setItem?.($Xe+e,JSON.stringify(t))}catch{}}function N5t(){return NXe(localStorage?.getItem?.("team:toolApprovalSettings")??null)}const A5t=(e,t)=>({teams:[],teamByName:{},teamBySessionId:{},branchByPath:{},teamsLoading:!1,teamsError:null,globalTasks:[],globalTasksLoading:!1,globalTasksInitialized:!1,globalTasksError:null,selectedTeamName:null,selectedTeamData:null,teamDataCacheByName:{},slotLayoutVersion:su,graphLayoutModeByTeam:{},gridOwnerOrderByTeam:{},slotAssignmentsByTeam:{},teamMessagesByName:{},memberActivityMetaByTeam:{},graphLayoutSessionByTeam:{},selectedTeamLoading:!1,selectedTeamLoadNonce:0,selectedTeamError:null,sendingMessage:!1,sendMessageError:null,sendMessageWarning:null,sendMessageDebugDetails:null,lastSendMessageResult:null,crossTeamTargets:[],crossTeamTargetsLoading:!1,reviewActionError:null,provisioningRuns:{},provisioningSnapshotByTeam:{},currentProvisioningRunIdByTeam:{},currentRuntimeRunIdByTeam:{},ignoredProvisioningRunIds:{},ignoredRuntimeRunIds:{},provisioningStartedAtFloorByTeam:{},leadActivityByTeam:{},leadContextByTeam:{},activeToolsByTeam:{},finishedVisibleByTeam:{},toolHistoryByTeam:{},memberSpawnStatusesByTeam:{},memberSpawnSnapshotsByTeam:{},teamAgentRuntimeByTeam:{},provisioningErrorByTeam:{},clearProvisioningError:n=>e(r=>{if(!n)return{provisioningErrorByTeam:{}};if(!(n in r.provisioningErrorByTeam))return{};const s={...r.provisioningErrorByTeam};return delete s[n],{provisioningErrorByTeam:s}}),launchParamsByTeam:P5t(),fetchMemberSpawnStatuses:async n=>{if(!(!Z.teams?.getMemberSpawnStatuses||(JQ.get(n)??0)>Date.now()))try{const s=await Z.teams.getMemberSpawnStatuses(n);JQ.delete(n),e(i=>{const o=ZLt(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 HLt(c,s)?(KLt(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'")&&JQ.set(n,Date.now()+ALt)}},fetchTeamAgentRuntime:async n=>{if(Z.teams?.getTeamAgentRuntime)try{const r=await Z.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 e5t(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:N5t(),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 Z.teams.getProjectBranch(i);return[dr(i),o]}catch{return[dr(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 zL(ir("team:list",()=>Z.teams.list()),yOe,"fetchTeams"),s={},i={};for(const o of r)if(s[o.teamName]=o,o.leadSessionId&&(i[o.leadSessionId]=o),Array.isArray(o.sessionHistory))for(const a of o.sessionHistory)typeof a=="string"&&a&&(i[a]=o);e(o=>{const a={...o.provisioningSnapshotByTeam};for(const c of r)delete a[c.teamName];return{teams:r,teamByName:s,teamBySessionId:i,teamsLoading:!1,teamsError:null,provisioningSnapshotByTeam:a}})}catch(r){e({teamsLoading:!1,teamsError:n?r instanceof Ch||r instanceof Error?r.message:"Failed to fetch teams":null})}},fetchAllTasks:async()=>{if(j1){CY=!0,await j1;return}const r=(async()=>{do{CY=!1;const s=!t().globalTasksInitialized;s&&e({globalTasksLoading:!0,globalTasksError:null});const i=t().globalTasks,o=ROe;ROe=!1;try{const a=await zL(ir("team:getAllTasks",()=>Z.teams.getAllTasks()),yOe,"fetchAllTasks");if(o){for(const l of a){l.needsClarification==="user"&&e2.add(`${l.teamName}:${l.id}`),MS.add(`${l.teamName}:${l.id}:${l.status}`),l.reviewState==="needsFix"&&MS.add(`${l.teamName}:${l.id}:needsFix`),Xb(l)==="approved"&&MS.add(`${l.teamName}:${l.id}:approved`),Xb(l)==="review"&&MS.add(`${l.teamName}:${l.id}:review`);for(const d of l.comments??[])CZ.add(`${l.teamName}:${l.id}:${d.id}`);RZ.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")&&ok.add(l)}else{const c=t().appConfig?.notifications?.notifyOnClarifications??!0;l5t(i,a,c),u5t(i,a,t().appConfig,t().teamByName);const l=t().appConfig?.notifications?.notifyOnTaskComments??!0;p5t(i,a,l);const d=t().appConfig?.notifications?.notifyOnTaskCreated??!0;h5t(i,a,d);const p=t().appConfig?.notifications?.notifyOnAllTasksCompleted??!0;g5t(i,a,p)}e({globalTasks:a,globalTasksLoading:!1,globalTasksInitialized:!0,globalTasksError:null})}catch(a){e({globalTasksLoading:!1,globalTasksInitialized:!0,globalTasksError:s?a instanceof Ch||a instanceof Error?a.message:"Failed to fetch tasks":null})}}while(CY)})().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=dr(r),h=p.projects.find(m=>dr(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!==su&&(o.slotLayoutVersion=su,c={},l={},a=!0);const d=KQ(r,s),p=k5t(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===su?{}:c?(Cp.warn(`[graph-layout] refusing occupied slot assignment team=${n} owner=${r} target=${s.ringIndex}:${s.sectorIndex} occupiedBy=${c[0]}`),{}):{slotLayoutVersion:su,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===su)return{};i&&o&&(d[i]=o);const p=Object.entries(d).find(([f,h])=>f===r||f===i?!1:h.ringIndex===s.ringIndex&&h.sectorIndex===s.sectorIndex||h.ringIndex===o?.ringIndex&&h.sectorIndex===o.sectorIndex);return p?(Cp.warn(`[graph-layout] refusing slot drop team=${n} owner=${r} target=${s.ringIndex}:${s.sectorIndex} conflict=${p[0]}`),{}):{slotLayoutVersion:su,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=Ri(i,n),a=[...i.gridOwnerOrderByTeam[n]??[]];for(const h of[r,s])a.includes(h)||a.push(h);const c=o?KQ(o.members,o.config.members??[]).orderedVisibleOwnerIds:a,l=C5t(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:su,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===su&&Object.keys(r.graphLayoutSessionByTeam).length===0?{}:{slotLayoutVersion:su,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:su,slotAssignmentsByTeam:s,graphLayoutSessionByTeam:i}})},resetTeamGraphSlotAssignmentsToDefaults:n=>{e(r=>{const s=Ri(r,n),i=s?KQ(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:su,slotAssignmentsByTeam:c,graphLayoutSessionByTeam:{...r.graphLayoutSessionByTeam,[n]:{mode:"default",signature:i.signature}}}})},setSelectedTeamTaskChangePresence:(n,r,s)=>{e(i=>{const o=Ri(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(Ri(t(),n))try{const s=await ir("team:getTaskChangePresence",()=>Z.teams.getTaskChangePresence(n));e(i=>{const o=Ri(i,n);if(!o)return{};let a=!1;const c=o.tasks.map(d=>{const p=s[d.id]??"unknown";return d.changePresence===p?d:(a=!0,{...d,changePresence:p})});if(!a)return{};const l={...o,tasks:c};return{teamDataCacheByName:{...i.teamDataCacheByName,[n]:l},...i.selectedTeamName===n?{selectedTeamData:l}:{}}})}catch{}},selectTeam:async(n,r)=>{const s=Sh(n),i=r?.allowReloadWhileProvisioning===!0;if(t().selectedTeamLoading&&t().selectedTeamName===n&&!i)return;const o=t().selectedTeamLoadNonce+1,a=Ri(t(),n);e({selectedTeamName:n,selectedTeamData:a,selectedTeamLoading:!0,selectedTeamLoadNonce:o,selectedTeamError:null,reviewActionError:null,toolApprovalSettings:$5t(n)});try{const c=await kOe(n);if(!mc(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:$Oe(n,a.tasks,c.tasks)}:c,h=EOe(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}}),XL.set(n,Date.now());const m=a?POe(n,a.tasks,c.tasks):{cacheKeys:[],taskIds:[]};m.cacheKeys.length>0&&t().invalidateTaskChangePresence(m.cacheKeys),m.taskIds.length>0&&await Z.review.invalidateTaskChangeSummaries(n,m.taskIds);const g=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"?`${g} Graph`:g;S.label!==v&&t().updateTabLabel(S.id,v)}if(((await t().refreshTeamMessagesHead(n)).feedChanged||IOe(t(),n))&&await t().refreshMemberActivityMeta(n),r?.skipProjectAutoSelect)return;const x=c.config.projectPath;if(x){const S=t(),v=dr(x),T=S.projects.find(E=>dr(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=>dr(P.path)===v);if(w){S.selectedWorktreeId!==w.id&&(e(MU(E.id,w.id)),t().fetchSessionsInitial(w.id));break}}}}catch(c){if(!mc(n,s))return;const l=t();if(l.selectedTeamName!==n||l.selectedTeamLoadNonce!==o)return;const d=T_(l,n),p=c instanceof Error?c.message:String(c);if(p==="TEAM_PROVISIONING"||p.includes("TEAM_PROVISIONING")&&d){e({selectedTeamLoading:!0,selectedTeamData:null,selectedTeamError:null});return}if(p==="TEAM_DRAFT"||p.includes("TEAM_DRAFT")){e({selectedTeamLoading:!1,selectedTeamData:null,selectedTeamError:"TEAM_DRAFT"});return}const f=c instanceof Ch||c instanceof Error?c.message:"Failed to fetch team data";e({selectedTeamLoading:!1,selectedTeamData:null,selectedTeamError:f})}},refreshTeamData:async(n,r)=>{const s=Sh(n),i=jLt(n),o=r?.withDedup===!0&&F0.has(n);YLt(n),o&&jL.add(n);try{const a=Ri(t(),n),c=r?.withDedup?await kOe(n):await FLt(n);if(!mc(n,s))return;const l=a?{...c,tasks:$Oe(n,a.tasks,c.tasks)}:c,d=EOe(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}}),XL.set(n,Date.now());const p=a?POe(n,a.tasks,c.tasks):{cacheKeys:[],taskIds:[]};p.cacheKeys.length>0&&t().invalidateTaskChangePresence(p.cacheKeys),p.taskIds.length>0&&await Z.review.invalidateTaskChangeSummaries(n,p.taskIds)}catch(a){if(!mc(n,s))return;const c=a instanceof Ch||a instanceof Error?a.message:"Failed to refresh team data";if(c==="TEAM_PROVISIONING"||c.includes("TEAM_PROVISIONING")){Cp.debug(`refreshTeamData(${n}) skipped: team is still provisioning`),t().selectedTeamName===n&&e({selectedTeamError:null});return}if(R5t(n,c)){e(l=>{const d=l.teamDataCacheByName[n]?{...l.teamDataCacheByName}:null;return d&&delete d[n],l.selectedTeamName!==n&&!d?{}:{...d?{teamDataCacheByName:d}:{},...l.selectedTeamName===n?{selectedTeamLoading:!1,selectedTeamData:null,selectedTeamError:c==="TEAM_DRAFT"||c.includes("TEAM_DRAFT")?"TEAM_DRAFT":c}:{}}});return}if(t().selectedTeamName!==n)return;if(Cp.warn(`refreshTeamData(${n}) failed: ${c}`),t().selectedTeamData){Cp.debug(`refreshTeamData(${n}) preserving existing data after transient error`),e({selectedTeamError:null});return}e({selectedTeamError:c})}finally{XLt(n,i),o&&jL.delete(n)&&t().refreshTeamData(n)}},refreshTeamMessagesHead:async n=>{const r=nS.get(n);if(r)return vZ.add(n),r;const s=g0.get(n);if(s)return s;const i=rS.get(n);if(i){const c=Sh(n),l=i.then(()=>{if(!mc(n,c))return{feedChanged:!1,headChanged:!1,feedRevision:null};if(g0.get(n)===l)g0.delete(n);else return{feedChanged:!1,headChanged:!1,feedRevision:null};return t().refreshTeamMessagesHead(n)}).finally(()=>{g0.get(n)===l&&g0.delete(n)});return g0.set(n,l),l}const o={current:null};o.current=(async()=>{const c=Sh(n);e(l=>({teamMessagesByName:{...l.teamMessagesByName,[n]:{...so(l,n),loadingHead:!0}}}));try{const l=await ir("team:getMessagesPage",()=>Z.teams.getMessagesPage(n,{limit:50}));if(!mc(n,c))return{feedChanged:!1,headChanged:!1,feedRevision:null};const d=so(t(),n),p=!d.headHydrated||d.feedRevision!==l.feedRevision,f=o5t(d.canonicalMessages,l.messages.length),h=!r5t(f,l.messages);return e(m=>{const g=so(m,n),_=a5t(g.canonicalMessages,l.messages),b=g.olderHydrated&&Array.isArray(_)&&_.length>0,y=h?b?SZ(_,l.messages):l.messages:g.canonicalMessages,x=s5t(g.optimisticMessages,y),S={...g,canonicalMessages:y,optimisticMessages:x,feedRevision:l.feedRevision,nextCursor:b?g.nextCursor:l.nextCursor,hasMore:b?g.hasMore:l.hasMore,lastFetchedAt:Date.now(),loadingHead:!1,headHydrated:!0,olderHydrated:b?g.olderHydrated:!1};return{teamMessagesByName:{...m.teamMessagesByName,[n]:S}}}),{feedChanged:p,headChanged:h,feedRevision:l.feedRevision}}catch(l){if(!mc(n,c))return{feedChanged:!1,headChanged:!1,feedRevision:null};throw e(d=>({teamMessagesByName:{...d.teamMessagesByName,[n]:{...so(d,n),loadingHead:!1}}})),l}finally{nS.get(n)===o.current&&(nS.delete(n),vZ.delete(n)&&t().refreshTeamMessagesHead(n))}})();const a=o.current;return nS.set(n,a),a},loadOlderTeamMessages:async n=>{const r=Sh(n),s=rS.get(n);if(s)return s;const i=nS.get(n);if(i&&(await i,!mc(n,r)))return;let o=so(t(),n);if(!o.headHydrated){if(await t().refreshTeamMessagesHead(n),!mc(n,r))return;o=so(t(),n)}if(!o.headHydrated||!o.nextCursor||o.loadingOlder||o.loadingHead)return;const a={current:null};a.current=(async()=>{const l=Sh(n);e(d=>({teamMessagesByName:{...d.teamMessagesByName,[n]:{...so(d,n),loadingOlder:!0}}}));try{const d=o.feedRevision,p=await ir("team:getMessagesPage",()=>Z.teams.getMessagesPage(n,{cursor:o.nextCursor,limit:50}));if(!mc(n,l))return;const f=so(t(),n);if(f.feedRevision!==d){e(h=>({teamMessagesByName:{...h.teamMessagesByName,[n]:{...so(h,n),loadingOlder:!1}}})),await t().refreshTeamMessagesHead(n);return}if(f.feedRevision&&f.feedRevision!==p.feedRevision){e(h=>({teamMessagesByName:{...h.teamMessagesByName,[n]:{...so(h,n),loadingOlder:!1}}})),await t().refreshTeamMessagesHead(n);return}e(h=>{const m=so(h,n),g=SZ(m.canonicalMessages,p.messages);return{teamMessagesByName:{...h.teamMessagesByName,[n]:{...m,canonicalMessages:g,nextCursor:p.nextCursor,hasMore:p.hasMore,feedRevision:p.feedRevision,loadingOlder:!1,olderHydrated:!0}}}})}catch{if(!mc(n,l))return;e(d=>({teamMessagesByName:{...d.teamMessagesByName,[n]:{...so(d,n),loadingOlder:!1}}}))}finally{rS.get(n)===a.current&&rS.delete(n)}})();const c=a.current;return rS.set(n,c),c},refreshMemberActivityMeta:async n=>{if(!so(t(),n).headHydrated)return;const s=ik.get(n);if(s)return TZ.add(n),s;const i={current:null};i.current=(async()=>{const a=Sh(n);try{const c=await ir("team:getMemberActivityMeta",()=>Z.teams.getMemberActivityMeta(n));if(!mc(n,a))return;e(l=>{const d=so(l,n).feedRevision;if(d&&c.feedRevision!==d)return{};const p=l.memberActivityMetaByTeam[n];if(p?.feedRevision===c.feedRevision)return{};const f=v5t(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(!mc(n,a))return;throw c}finally{ik.get(n)===i.current&&(ik.delete(n),TZ.delete(n)&&t().refreshMemberActivityMeta(n))}})();const o=i.current;return ik.set(n,o),o},syncTeamPendingReplyRefresh:(n,r,s,i=1e4)=>{if(Ex(n),!i5t(n,r,s))return;const a=setTimeout(()=>{pC.get(n)===a&&(pC.delete(n),(async()=>{try{((await t().refreshTeamMessagesHead(n)).feedChanged||IOe(t(),n))&&await t().refreshMemberActivityMeta(n)}catch{}})())},i);pC.set(n,a)},updateKanban:async(n,r,s)=>{try{e({reviewActionError:null}),await ir("team:updateKanban",()=>Z.teams.updateKanban(n,r,s)),await t().refreshTeamData(n)}catch(i){throw e({reviewActionError:AOe(i)}),i}},updateKanbanColumnOrder:async(n,r,s)=>{await ir("team:updateKanbanColumnOrder",()=>Z.teams.updateKanbanColumnOrder(n,r,s)),await t().refreshTeamData(n)},sendTeamMessage:async(n,r)=>{const s=r.messageId??`optimistic-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,i=r.timestamp??z1(),o={...r,messageId:s,timestamp:i},a={from:o.from??"user",to:o.to??o.member,text:o.text,timestamp:i,read:!0,taskRefs:o.taskRefs?.length?o.taskRefs:void 0,actionMode:o.actionMode,summary:o.summary,color:o.color,messageId:s,relayOfMessageId:o.relayOfMessageId,source:o.source??"user_sent",attachments:o.attachments?.length?o.attachments:void 0,leadSessionId:o.leadSessionId,conversationId:o.conversationId,replyToConversationId:o.replyToConversationId,toolSummary:o.toolSummary,toolCalls:o.toolCalls,messageKind:o.messageKind,slashCommand:o.slashCommand,commandOutput:o.commandOutput};e({sendingMessage:!0,sendMessageError:null,sendMessageWarning:null,sendMessageDebugDetails:null,lastSendMessageResult:null}),e(c=>({teamMessagesByName:{...c.teamMessagesByName,[n]:$Y(so(c,n),a)}}));try{const c=await ir("team:sendMessage",()=>Z.teams.sendMessage(n,o)),l=c.runtimeDelivery?.attempted===!0&&c.runtimeDelivery.delivered===!1,d=OLt(c),p={...a,messageId:c.messageId};return e(f=>({sendingMessage:!1,sendMessageError:null,sendMessageWarning:d.warning,sendMessageDebugDetails:d.debugDetails,lastSendMessageResult:l?null:c,teamMessagesByName:{...f.teamMessagesByName,[n]:$Y(so(f,n),p)}})),await t().refreshTeamMessagesHead(n),c}catch(c){throw e({sendingMessage:!1,lastSendMessageResult:null,sendMessageWarning:null,sendMessageDebugDetails:null,sendMessageError:NOe(c)}),c}},addOptimisticTeamMessage:(n,r)=>{e(s=>({teamMessagesByName:{...s.teamMessagesByName,[n]:$Y(so(s,n),r)}}))},fetchCrossTeamTargets:async()=>{e({crossTeamTargetsLoading:!0});try{const n=await Z.crossTeam.listTargets();e({crossTeamTargets:n,crossTeamTargetsLoading:!1})}catch(n){Cp.error("fetchCrossTeamTargets failed",n),e({crossTeamTargets:[],crossTeamTargetsLoading:!1})}},sendCrossTeamMessage:async n=>{e({sendingMessage:!0,sendMessageError:null,sendMessageWarning:null,sendMessageDebugDetails:null,lastSendMessageResult:null});try{const r=await Z.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:NOe(r)})}},requestReview:async(n,r)=>{try{e({reviewActionError:null}),await ir("team:requestReview",()=>Z.teams.requestReview(n,r)),await t().refreshTeamData(n),SI(t,n,r)}catch(s){throw e({reviewActionError:AOe(s)}),s}},createTeamTask:async(n,r)=>{const s=await ir("team:createTask",()=>Z.teams.createTask(n,r));return await t().refreshTeamData(n),s},startTask:async(n,r)=>{const s=await ir("team:startTask",()=>Z.teams.startTask(n,r));return await t().refreshTeamData(n),SI(t,n,r),s},startTaskByUser:async(n,r)=>{const s=await ir("team:startTaskByUser",()=>Z.teams.startTaskByUser(n,r));return await t().refreshTeamData(n),SI(t,n,r),s},updateTaskStatus:async(n,r,s)=>{await ir("team:updateTaskStatus",()=>Z.teams.updateTaskStatus(n,r,s)),await t().refreshTeamData(n),SI(t,n,r)},updateTaskOwner:async(n,r,s)=>{await ir("team:updateTaskOwner",()=>Z.teams.updateTaskOwner(n,r,s)),await t().refreshTeamData(n)},updateTaskFields:async(n,r,s)=>{await ir("team:updateTaskFields",()=>Z.teams.updateTaskFields(n,r,s)),await t().refreshTeamData(n)},addTaskRelationship:async(n,r,s,i)=>{await ir("team:addTaskRelationship",()=>Z.teams.addTaskRelationship(n,r,s,i)),await t().refreshTeamData(n)},removeTaskRelationship:async(n,r,s,i)=>{await ir("team:removeTaskRelationship",()=>Z.teams.removeTaskRelationship(n,r,s,i)),await t().refreshTeamData(n)},setTaskNeedsClarification:async(n,r,s)=>{await ir("team:setTaskClarification",()=>Z.teams.setTaskClarification(n,r,s)),await t().refreshTeamData(n),await t().fetchAllTasks()},saveTaskAttachment:async(n,r,s)=>{const i=crypto.randomUUID();await ir("team:saveTaskAttachment",()=>Z.teams.saveTaskAttachment(n,r,i,s.name,s.type,s.base64)),await t().refreshTeamData(n)},deleteTaskAttachment:async(n,r,s,i)=>{await ir("team:deleteTaskAttachment",()=>Z.teams.deleteTaskAttachment(n,r,s,i)),await t().refreshTeamData(n)},getTaskAttachmentData:async(n,r,s,i)=>ir("team:getTaskAttachment",()=>Z.teams.getTaskAttachment(n,r,s,i)),addTaskComment:async(n,r,s)=>{e({addingComment:!0,addCommentError:null});try{const i=await ir("team:addTaskComment",()=>Z.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 ir("team:addMember",()=>Z.teams.addMember(n,r)),await Promise.allSettled([t().refreshTeamData(n),t().fetchMemberSpawnStatuses(n),t().fetchTeamAgentRuntime(n)])},restartMember:async(n,r)=>{try{await ir("team:restartMember",()=>Z.teams.restartMember(n,r))}finally{await Promise.allSettled([t().fetchMemberSpawnStatuses(n),t().fetchTeamAgentRuntime(n)])}},skipMemberForLaunch:async(n,r)=>{try{await ir("team:skipMemberForLaunch",()=>Z.teams.skipMemberForLaunch(n,r))}finally{await Promise.allSettled([t().fetchMemberSpawnStatuses(n),t().fetchTeamAgentRuntime(n),t().fetchTeams()])}},removeMember:async(n,r)=>{await ir("team:removeMember",()=>Z.teams.removeMember(n,r)),await t().refreshTeamData(n)},updateMemberRole:async(n,r,s)=>{await ir("team:updateMemberRole",()=>Z.teams.updateMemberRole(n,r,s)),await t().refreshTeamData(n)},softDeleteTask:async(n,r)=>{await ir("team:softDeleteTask",()=>Z.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 ir("team:restoreTask",()=>Z.teams.restoreTask(n,r)),await t().refreshTeamData(n),await t().fetchDeletedTasks(n)},fetchDeletedTasks:async n=>{e({deletedTasksLoading:!0});try{const r=await ir("team:getDeletedTasks",()=>Z.teams.getDeletedTasks(n));e({deletedTasks:r,deletedTasksLoading:!1})}catch(r){Cp.error("Failed to fetch deleted tasks:",r),e({deletedTasks:[],deletedTasksLoading:!1})}},deleteTeam:async n=>{const r=await ir("team:deleteTeam",()=>Z.teams.deleteTeam(n));return U1(n),Ex(n),B1(n),X1(n),e(s=>({...PY(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 ir("team:restoreTeam",()=>Z.teams.restoreTeam(n)),U1(n),Ex(n),B1(n),X1(n),e(r=>{const s=PY(r,n),i=vOe(r,n,z1());return Object.keys(s).length===0?i:{...s,...i}}),await t().fetchTeams(),await t().fetchAllTasks()},permanentlyDeleteTeam:async n=>{await ir("team:permanentlyDeleteTeam",()=>Z.teams.permanentlyDeleteTeam(n)),U1(n),Ex(n),B1(n),X1(n);const r=t(),s=PY(r,n),i=vOe(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),Ex(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 g={...o.currentRuntimeRunIdByTeam},_=g[n.teamName];delete g[n.teamName];const b=_?{...o.ignoredRuntimeRunIds,[_]:n.teamName}:o.ignoredRuntimeRunIds,y=SOe(o,n.teamName);return{provisioningRuns:a,provisioningErrorByTeam:c,memberSpawnStatusesByTeam:l,memberSpawnSnapshotsByTeam:d,teamAgentRuntimeByTeam:p,activeToolsByTeam:f,finishedVisibleByTeam:h,toolHistoryByTeam:m,currentRuntimeRunIdByTeam:g,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?B0:{...B0,autoAllowAll:!0};NY(n.teamName,i),e({toolApprovalSettings:i});try{if(typeof Z.teams.createTeam!="function")throw new Error("Current preload version does not support team:create. Restart the dev app.");const o=await ir("team:create",()=>Z.teams.createTeam(n)),a=DOe(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};QOe(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),COe(t,o.runId),o.runId}catch(o){const a=o instanceof Ch||o instanceof Error?o.message:"Failed to create team";throw e(c=>{const l={...c.provisioningRuns};delete l[s];const d={...c.currentProvisioningRunIdByTeam};return d[n.teamName]===s&&delete d[n.teamName],{provisioningRuns:l,currentProvisioningRunIdByTeam:d,provisioningErrorByTeam:{...c.provisioningErrorByTeam,[n.teamName]:a}}}),o}},launchTeam:async n=>{t().subscribeProvisioningProgress(),U1(n.teamName),Ex(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},g=m[n.teamName];delete m[n.teamName];const _=g?{...i.ignoredRuntimeRunIds,[g]:n.teamName}:i.ignoredRuntimeRunIds,b=SOe(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?B0:{...B0,autoAllowAll:!0};NY(n.teamName,i),e({toolApprovalSettings:i})}try{const i=await ir("team:launch",()=>Z.teams.launchTeam(n)),o=DOe(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};QOe(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 COe(t,i.runId),i.runId}catch(i){const o=i instanceof Ch||i instanceof Error?i.message:"Failed to launch team";throw e(a=>{const c={...a.provisioningRuns};delete c[s];const l={...a.currentProvisioningRunIdByTeam};return l[n.teamName]===s&&delete l[n.teamName],{provisioningRuns:c,currentProvisioningRunIdByTeam:l,provisioningErrorByTeam:{...a.provisioningErrorByTeam,[n.teamName]:o}}}),i}},getProvisioningStatus:async n=>{const r=await ir("team:provisioningStatus",()=>Z.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},g={...r.finishedVisibleByTeam},_={...r.toolHistoryByTeam};return a&&(delete m[s.teamName],delete g[s.teamName],delete _[s.teamName]),{provisioningRuns:i,currentProvisioningRunIdByTeam:o,currentRuntimeRunIdByTeam:c,memberSpawnStatusesByTeam:p,memberSpawnSnapshotsByTeam:f,teamAgentRuntimeByTeam:h,activeToolsByTeam:m,finishedVisibleByTeam:g,toolHistoryByTeam:_,ignoredProvisioningRunIds:l,ignoredRuntimeRunIds:d}})},cancelProvisioning:async n=>{await ir("team:cancelProvisioning",()=>Z.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&&!UL.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 ir("team:stop",()=>Z.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):wOe(h)&&!wOe(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 g={...d.provisioningErrorByTeam};n.state==="failed"?g[n.teamName]=n.error??n.message:delete g[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:g,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();MOe(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&&UL.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 g=Object.fromEntries(Object.entries(m).filter(([,_])=>_.status==="error"));return Object.keys(g).length>0?p[n.teamName]=g:(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(!MOe(d,n.teamName))return;d.selectedTeamName===n.teamName?d.selectTeam(n.teamName):d.refreshTeamData(n.teamName,{withDedup:!0})}},subscribeProvisioningProgress:()=>{if(t().provisioningProgressUnsubscribe||!Z.teams?.onProvisioningProgress)return;const r=Z.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)NY(s,o);else try{localStorage?.setItem?.("team:toolApprovalSettings",JSON.stringify(o))}catch{}try{await Z.teams.updateToolApprovalSettings(s??"__global__",o)}catch(a){Cp.warn("Failed to sync tool approval settings to main:",a)}},respondToToolApproval:async(n,r,s,i,o)=>{try{await Z.teams.respondToToolApproval(n,r,s,i,o),e(a=>{const c=new Map(a.resolvedApprovals);return c.set(s,i),{pendingApprovals:a.pendingApprovals.filter(l=>!(l.runId===r&&l.requestId===s)),resolvedApprovals:c}})}catch(a){const c=a instanceof Error?a.message:String(a);throw Cp.error(`respondToToolApproval failed for ${n}/${s}: ${c}`),a}},unsubscribeProvisioningProgress:()=>{const n=t().provisioningProgressUnsubscribe;n&&(n(),e({provisioningProgressUnsubscribe:null}))}}),I5t=e=>({commandPaletteOpen:!1,sidebarCollapsed:!1,openCommandPalette:()=>{e({commandPaletteOpen:!0})},closeCommandPalette:()=>{e({commandPaletteOpen:!1})},toggleSidebar:()=>{e(t=>({sidebarCollapsed:!t.sidebarCollapsed}))}}),M5t=1e4,Q5t=1500,D5t=6,L5t=4e3,j5t=8,X5t=2e3,U5t=1e4,z5t=3e4,B5t=1e4,F5t=to("Store:index"),Y5t=new Set(["task","config","inbox","lead-message","lead-context","lead-activity","process","member-spawn"]),LOe=new Map;function V5t(e,t,n){if(!n)return;const r=Date.now(),s=LOe.get(e)??{windowStartedAt:r,count:0,lastWarnAt:0,countsByType:{}};r-s.windowStartedAt>L5t&&(s.windowStartedAt=r,s.count=0,s.countsByType={}),s.count+=1,s.countsByType[t]=(s.countsByType[t]??0)+1,s.count>=j5t&&r-s.lastWarnAt>=X5t&&(s.lastWarnAt=r),LOe.set(e,s)}const re=ZSt()((...e)=>({...G2t(...e),...K2t(...e),...uLt(...e),...aLt(...e),...dLt(...e),...A5t(...e),...dTt(...e),...pLt(...e),...fLt(...e),...W2t(...e),...I5t(...e),...q2t(...e),...kvt(...e),...Rvt(...e),...jvt(...e),...bvt(...e),...Evt(...e),...P2t(...e),...J2t(...e),...z2t(...e)}));function q5t(){fSt();const e=[];let t=null;re.getState().subscribeProvisioningProgress(),e.push(()=>{re.getState().unsubscribeProvisioningProgress()}),(async()=>{await re.getState().fetchConfig();const K=re.getState().appConfig;t2e(K?.general?.telemetryEnabled??!0),Z.cliInstaller&&(t=setTimeout(()=>{re.getState().appConfig?.general?.multimodelEnabled??!1?re.getState().bootstrapCliStatus({multimodelEnabled:!0}):re.getState().fetchCliStatus(),t=null},3e3)),await Promise.all([re.getState().fetchRepositoryGroups(),re.getState().fetchAllTasks(),re.getState().fetchTeams(),re.getState().fetchNotifications(),re.getState().fetchSchedules()])})(),e.push(()=>{t&&clearTimeout(t)});const n=setInterval(()=>{V()},M5t);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 g=new Map;let _=null,b=null;const y=150,x=300,S=800,v=400,T=500,E=2e3,w=500,P=async K=>{if(!K||!ie(K))return;const Y=re.getState();try{const W=await Y.refreshTeamMessagesHead(K),se=re.getState(),he=se.memberActivityMetaByTeam[K];(W.feedChanged||he?.feedRevision!==W.feedRevision)&&await se.refreshMemberActivityMeta(K)}catch{}},C=K=>{if(!K||!G(K)||d.has(K))return;const Y=setTimeout(()=>{d.delete(K),re.getState().fetchMemberSpawnStatuses(K)},T);d.set(K,Y)},k=K=>{if(!K||!G(K)||p.has(K))return;const Y=setTimeout(()=>{p.delete(K),re.getState().fetchTeamAgentRuntime(K)},T);p.set(K,Y)},I=K=>{if(!K||!ie(K)||c.has(K))return;const Y=setTimeout(()=>{c.delete(K),P(K)},S);c.set(K,Y)},Q=(K,Y,W,se)=>`${K}:${Y}:${W}:${se}`,$=(K,Y,W,se)=>{const he=Q(K,Y,W,se),we=f.get(he);we&&(clearTimeout(we),f.delete(he))},R=(K,Y,W,se,he,we)=>{$(K,Y,W,se);const J=Q(K,Y,W,se),de=setTimeout(()=>{f.delete(J),we()},he);f.set(J,de)},N=K=>{for(const[Y,W]of f.entries())Y.startsWith(`${K}:`)&&(clearTimeout(W),f.delete(Y))},j=(K,Y)=>{const W={...K.activeToolsByTeam},se={...K.finishedVisibleByTeam},he={...K.toolHistoryByTeam};return delete W[Y],delete se[Y],delete he[Y],{activeToolsByTeam:W,finishedVisibleByTeam:se,toolHistoryByTeam:he}},M=(K,Y,W)=>{const se={...K[Y]??{}},he=se[W.memberName]??[];return se[W.memberName]=[W,...he.filter(we=>we.toolUseId!==W.toolUseId)].slice(0,D5t),{...K,[Y]:se}},U=(K,Y)=>({...K??{},[Y.memberName]:{...(K??{})[Y.memberName]??{},[Y.toolUseId]:Y}}),A=(K,Y,W)=>{if(!K?.[Y]?.[W])return K??{};const se={...K??{}},he={...se[Y]??{}};return delete he[W],Object.keys(he).length===0?delete se[Y]:se[Y]=he,se},F=(K,Y)=>{if(!K?.[Y])return K??{};const W={...K??{}};return delete W[Y],W},z=(K,Y,W)=>{if(!K?.[Y]||W.length===0)return K??{};let se=K??{},he=!1;for(const we of W)se[Y]?.[we]&&(se=A(se,Y,we),he=!0);return he?se:K??{}},D=K=>{if(!K)return null;const Y=K.indexOf("::");return Y>=0?K.slice(0,Y):K},V=async()=>{if(h)return;const K=re.getState(),Y=Array.from(H(K));if(Y.length!==0){if(g.size>50){const W=new Set(re.getState().teams.map(se=>se.teamName));for(const se of g.keys())W.has(se)||g.delete(se)}h=!0;try{for(const W of Y){const se=Ri(K,W);if(se?.teamName!==W){RY(W)||K.refreshTeamData(W,{withDedup:!0});continue}const he=se.tasks.filter(nt=>nt.status!=="in_progress"?!1:wre(Yc(nt)));if(he.length===0){g.delete(W);continue}const we=g.get(W)??0,J=he.filter(nt=>nt.changePresence==="unknown"),de=J.length>0?J:he,ue=de[we%de.length];g.set(W,(we+1)%de.length);const ae=re.getState();if(!G(W))continue;const $e=Ri(ae,W);if($e?.teamName!==W){RY(W)||ae.refreshTeamData(W,{withDedup:!0});continue}const qe=$e.tasks.find(nt=>nt.id===ue.id);if(qe?.status!=="in_progress")continue;const ot=Yc(qe),Ot=kd(W,qe.id,ot);ae.invalidateTaskChangePresence([Ot]),await ae.checkTaskHasChanges(W,qe.id,ot)}}catch{}finally{h=!1}}},q=(K,Y)=>{const W=`${K}/${Y}`;if(r.has(W))return;const se=setTimeout(()=>{r.delete(W),re.getState().refreshSessionInPlace(K,Y)},y);r.set(W,se)},ee=K=>{const Y=s.get(K);Y&&clearTimeout(Y);const W=setTimeout(()=>{s.delete(K),re.getState().refreshSessionsInPlace(K)},x);s.set(K,W)};if(Z.notifications?.onNew){const K=Z.notifications.onNew((Y,W)=>{const se=W;se?.id&&re.setState(he=>he.notifications.some(we=>we.id===se.id)?{}:{notifications:[se,...he.notifications].slice(0,200)})});typeof K=="function"&&e.push(K)}if(Z.notifications?.onUpdated){const K=Z.notifications.onUpdated((Y,W)=>{const se=typeof W.unreadCount=="number"&&Number.isFinite(W.unreadCount)?Math.max(0,Math.floor(W.unreadCount)):0;re.setState({unreadCount:se})});typeof K=="function"&&e.push(K)}if(Z.notifications?.onClicked){const K=Z.notifications.onClicked((Y,W)=>{const se=W;se?.id&&se?.sessionId&&se?.projectId&&re.getState().navigateToError(se)});typeof K=="function"&&e.push(K)}const te=K=>{const{paneLayout:Y}=re.getState();return Y.panes.some(W=>W.activeTabId!=null&&W.tabs.some(se=>se.id===W.activeTabId&&se.type==="session"&&se.sessionId===K))},H=(K=re.getState())=>{const{paneLayout:Y}=K,W=new Set;for(const se of Y.panes){if(!se.activeTabId)continue;const he=se.tabs.find(we=>we.id===se.activeTabId);(he?.type==="team"||he?.type==="graph")&&he.teamName!=null&&W.add(he.teamName)}return W},G=K=>H().has(K),ie=K=>G(K)||QLt(K),ne=()=>{const K=H();for(const Y of DLt())K.add(Y);return K},pe=()=>H(),Te=(K,Y=Date.now())=>{i.set(K,Y)},_e=()=>{const K=re.getState(),Y=K.paneLayout.panes.find(se=>se.id===K.paneLayout.focusedPaneId);if(!Y?.activeTabId)return null;const W=Y.tabs.find(se=>se.id===Y.activeTabId);return W?.type!=="team"&&W?.type!=="graph"||!W.teamName||!Ri(K,W.teamName)?null:W.teamName},be=async()=>{if(m)return;const K=ne();if(K.size!==0){m=!0;try{await Promise.allSettled(Array.from(K,Y=>P(Y)))}finally{m=!1}}},Ie=async()=>{if(typeof document<"u"&&document.visibilityState==="hidden")return;const K=re.getState(),Y=_e();if(!Y||!G(Y)||K.selectedTeamName===Y&&K.selectedTeamLoading||RY(Y))return;const W=i.get(Y)??0,se=xOe(Y)??0,he=Math.max(W,se);if(he===0)return;const we=Date.now();if(!(we-he<z5t||(o.get(Y)??0)>=he)){F5t.warn(`[perf] idle-watchdog refresh team=${Y} idleMs=${we-he}`);try{await K.refreshTeamData(Y,{withDedup:!0})}finally{o.set(Y,Math.max(xOe(Y)??0,he,Date.now()))}}};if(Z.teams?.setToolActivityTracking){let K=new Set;const Y=()=>{const se=pe();for(const he of se)K.has(he)||Z.teams.setToolActivityTracking(he,!0).catch(()=>{});for(const he of K)se.has(he)||Z.teams.setToolActivityTracking(he,!1).catch(()=>{});K=se};Y();const W=re.subscribe((se,he)=>{se.paneLayout!==he.paneLayout&&Y()});e.push(()=>{W();for(const se of K)Z.teams.setToolActivityTracking(se,!1).catch(()=>{});K.clear()})}if(Z.onTodoChange){const K=Z.onTodoChange(Y=>{if(!Y.sessionId||Y.type==="unlink")return;const W=re.getState();if(W.selectedSessionId===Y.sessionId||te(Y.sessionId)){const de=W.getAllPaneTabs().find(ue=>ue.type==="session"&&ue.sessionId===Y.sessionId);de?.projectId&&q(de.projectId,Y.sessionId)}const he=W.getActiveTab(),we=he?.type==="session"&&typeof he.projectId=="string"?he.projectId:null;we&&we===W.selectedProjectId&&ee(we)});typeof K=="function"&&e.push(K)}if(Z.onFileChange){const K=Z.onFileChange(Y=>{if(Y.type==="unlink")return;const W=re.getState(),se=W.selectedProjectId,he=D(se),we=D(Y.projectId),J=!!se&&(we==null||he===we),de=!Y.isSubagent,ue=Y.sessionId==null||!W.sessions.some($e=>$e.id===Y.sessionId);if(de&&J&&ue&&(Y.type==="add"||W.connectionMode==="local"&&Y.type==="change")&&J&&se&&ee(se),(Y.type==="change"||Y.type==="add")&&se){const $e=W.selectedSessionId,qe=Y.sessionId,nt=(!!qe&&($e===qe||te(qe))?qe:null)??(J&&!qe&&!!$e?$e:null);if(nt){const Qt=W.getAllPaneTabs().find(ft=>ft.type==="session"&&ft.sessionId===nt)?.projectId??se;q(Qt,nt)}}});typeof K=="function"&&e.push(K)}const Se=setInterval(()=>{Ie()},U5t);e.push(()=>{clearInterval(Se)});const oe=setInterval(()=>{be()},B5t);if(e.push(()=>{clearInterval(oe)}),Z.teams?.onTeamChange){const K=Z.teams.onTeamChange((Y,W)=>{const se=!!W.teamName&&ie(W.teamName);if(V5t(W.teamName,W.type,se),(()=>{if(!W.runId)return!1;const ae=re.getState();return ae.ignoredProvisioningRunIds[W.runId]===W.teamName||ae.ignoredRuntimeRunIds[W.runId]===W.teamName})())return;const we=(()=>{if(!W.runId)return!1;const ae=re.getState().currentRuntimeRunIdByTeam[W.teamName];return ae!=null&&ae!==W.runId})(),J=()=>{if(!W.runId)return;re.getState().currentRuntimeRunIdByTeam[W.teamName]==null&&re.setState($e=>({currentRuntimeRunIdByTeam:{...$e.currentRuntimeRunIdByTeam,[W.teamName]:W.runId??null},ignoredRuntimeRunIds:Object.fromEntries(Object.entries($e.ignoredRuntimeRunIds).filter(([,qe])=>qe!==W.teamName))}))};if(Y5t.has(W.type)&&!we&&Te(W.teamName),W.type==="lead-activity"&&W.detail){if(we)return;J();const ae=W.detail;re.setState($e=>{const qe={leadActivityByTeam:{...$e.leadActivityByTeam,[W.teamName]:ae}},ot=$e.teamDataCacheByName[W.teamName]??($e.selectedTeamName===W.teamName?$e.selectedTeamData:null),Ot=ot&&ot.isAlive!==(ae!=="offline")?{...ot,isAlive:ae!=="offline"}:ot;return Ot&&(qe.teamDataCacheByName={...$e.teamDataCacheByName,[W.teamName]:Ot}),$e.selectedTeamName===W.teamName&&Ot&&(qe.selectedTeamData=Ot),ae==="offline"&&(qe.leadContextByTeam={...$e.leadContextByTeam},delete qe.leadContextByTeam[W.teamName],Object.assign(qe,j($e,W.teamName)),qe.currentRuntimeRunIdByTeam={...$e.currentRuntimeRunIdByTeam},delete qe.currentRuntimeRunIdByTeam[W.teamName],qe.ignoredRuntimeRunIds=W.runId?{...$e.ignoredRuntimeRunIds,[W.runId]:W.teamName}:$e.ignoredRuntimeRunIds,N(W.teamName)),qe});return}if(W.type==="lead-context"&&W.detail){if(we)return;J();try{const ae=JSON.parse(W.detail);re.setState($e=>({...$e,leadContextByTeam:{...$e.leadContextByTeam,[W.teamName]:ae}}))}catch{}return}if(W.type==="tool-activity"&&W.detail){if(we)return;J();try{const ae=JSON.parse(W.detail);if(ae.action==="start"&&ae.activity){const $e={memberName:ae.activity.memberName,toolUseId:ae.activity.toolUseId,toolName:ae.activity.toolName,preview:ae.activity.preview,startedAt:ae.activity.startedAt,source:ae.activity.source,state:"running"};re.setState(qe=>({activeToolsByTeam:{...qe.activeToolsByTeam,[W.teamName]:U(qe.activeToolsByTeam[W.teamName],$e)}}))}else if(ae.action==="finish"&&ae.memberName&&ae.toolUseId){const $e=ae.memberName,qe=ae.toolUseId;re.setState(ot=>{const Ot=ot.activeToolsByTeam[W.teamName]?.[$e]?.[qe];if(!Ot)return{};const nt={...Ot,state:ae.isError?"error":"complete",finishedAt:ae.finishedAt??new Date().toISOString(),resultPreview:ae.resultPreview};return R(W.teamName,$e,qe,"fade",Q5t,()=>{re.setState(Ge=>Ge.finishedVisibleByTeam[W.teamName]?.[$e]?.[qe]?{finishedVisibleByTeam:{...Ge.finishedVisibleByTeam,[W.teamName]:A(Ge.finishedVisibleByTeam[W.teamName],$e,qe)}}:{})}),{activeToolsByTeam:{...ot.activeToolsByTeam,[W.teamName]:A(ot.activeToolsByTeam[W.teamName],$e,qe)},finishedVisibleByTeam:{...ot.finishedVisibleByTeam,[W.teamName]:U(ot.finishedVisibleByTeam[W.teamName],nt)},toolHistoryByTeam:M(ot.toolHistoryByTeam,W.teamName,nt)}})}else if(ae.action==="reset")if(ae.memberName){const $e=ae.memberName,qe=Array.isArray(ae.toolUseIds)&&ae.toolUseIds.length>0?ae.toolUseIds:null;re.setState(ot=>ot.activeToolsByTeam[W.teamName]?.[$e]?{activeToolsByTeam:{...ot.activeToolsByTeam,[W.teamName]:qe?z(ot.activeToolsByTeam[W.teamName],$e,qe):F(ot.activeToolsByTeam[W.teamName],$e)}}:{})}else re.setState($e=>({activeToolsByTeam:{...$e.activeToolsByTeam,[W.teamName]:{}}}))}catch{}return}if(W.type==="member-spawn"){if(we)return;J(),C(W.teamName),k(W.teamName);return}if(W.type==="inbox"){I(W.teamName);return}if(W.type==="lead-message"){if(we)return;J(),I(W.teamName);return}if(W.type==="log-source-change"){if(!W?.teamName||!G(W.teamName)||l.has(W.teamName))return;const ae=setTimeout(()=>{l.delete(W.teamName),re.getState().refreshTeamChangePresence(W.teamName)},v);l.set(W.teamName,ae);return}if(_||(_=setTimeout(()=>{_=null,re.getState().fetchTeams()},E)),(W.type==="task"||W.type==="config")&&!b&&(b=setTimeout(()=>{b=null,re.getState().fetchAllTasks()},w)),!W?.teamName||!G(W.teamName)||a.has(W.teamName))return;const ue=setTimeout(()=>{a.delete(W.teamName),re.getState().refreshTeamData(W.teamName,{withDedup:!0})},S);a.set(W.teamName,ue)});typeof K=="function"&&e.push(()=>{K();for(const Y of a.values())clearTimeout(Y);a=new Map;for(const Y of c.values())clearTimeout(Y);c=new Map;for(const Y of l.values())clearTimeout(Y);l=new Map;for(const Y of d.values())clearTimeout(Y);d=new Map;for(const Y of p.values())clearTimeout(Y);p=new Map;for(const Y of f.values())clearTimeout(Y);f=new Map,i.clear(),o.clear(),_&&(clearTimeout(_),_=null),b&&(clearTimeout(b),b=null)})}if(Z.teams?.onProjectBranchChange){const K=Z.teams.onProjectBranchChange((Y,W)=>{if(!W?.projectPath)return;const se=dr(W.projectPath);se&&re.setState(he=>he.branchByPath[se]===W.branch?{}:{branchByPath:{...he.branchByPath,[se]:W.branch}})});typeof K=="function"&&e.push(K)}if(Z.teams?.onToolApprovalEvent){const K=Z.teams.onToolApprovalEvent((se,he)=>{const we=he;if("autoResolved"in we&&we.autoResolved){const J=we.reason!=="timeout_deny";re.setState(de=>{const ue=new Map(de.resolvedApprovals);return ue.set(we.requestId,J),{pendingApprovals:de.pendingApprovals.filter(ae=>!(ae.runId===we.runId&&ae.requestId===we.requestId)),resolvedApprovals:ue}})}else if("dismissed"in we&&we.dismissed){const J=we;re.setState(de=>({pendingApprovals:de.pendingApprovals.filter(ue=>!(ue.teamName===J.teamName&&ue.runId===J.runId))}))}else{const J=we;re.setState(de=>({pendingApprovals:[...de.pendingApprovals,J]}))}});typeof K=="function"&&e.push(K);const Y=re.getState().toolApprovalSettings,W=re.getState().selectedTeamName??"__global__";Z.teams.updateToolApprovalSettings?.(W,Y).catch(()=>{})}if(Z.editor?.onEditorChange){const K=Z.editor.onEditorChange(Y=>{const W=re.getState();W.editorProjectPath&&W.handleExternalFileChange(Y)});typeof K=="function"&&e.push(K)}if(Z.schedules?.onScheduleChange){const K=Z.schedules.onScheduleChange((Y,W)=>{const se=W;se?.scheduleId&&re.getState().applyScheduleChange(se.scheduleId)});typeof K=="function"&&e.push(K)}let Oe=null;if(Z.cliInstaller?.onProgress){const K=Z.cliInstaller.onProgress((Y,W)=>{const se=W;se.type!=="completed"&&Oe&&(clearTimeout(Oe),Oe=null);const he=se.detail??null;switch(se.type){case"checking":re.setState({cliInstallerState:"checking",cliInstallerDetail:he});break;case"downloading":re.setState({cliInstallerState:"downloading",cliDownloadProgress:se.percent??0,cliDownloadTransferred:se.transferred??0,cliDownloadTotal:se.total??0,cliInstallerDetail:he});break;case"verifying":re.setState({cliInstallerState:"verifying",cliInstallerDetail:he});break;case"installing":{const we=re.getState().cliInstallerLogs,J=re.getState().cliInstallerRawChunks,de=he?[...we,he].slice(-50):we,ue=se.rawChunk?[...J,se.rawChunk].slice(-200):J;re.setState({cliInstallerState:"installing",cliInstallerDetail:he,cliInstallerLogs:de,cliInstallerRawChunks:ue});break}case"completed":{const we=re.getState().appConfig?.general?.multimodelEnabled??!1;HO({multimodelEnabled:we,bootstrapCliStatus:re.getState().bootstrapCliStatus,fetchCliStatus:re.getState().fetchCliStatus})}re.setState({cliInstallerState:"completed",cliCompletedVersion:se.version??null,cliInstallerDetail:null}),Oe=setTimeout(()=>{Oe=null,re.getState().cliInstallerState==="completed"&&re.setState({cliInstallerState:"idle"})},3e3);break;case"error":re.setState({cliInstallerState:"error",cliInstallerError:se.error??"Unknown error"});break;case"status":if(se.status){let we=[];re.setState(J=>{const de=IQ(J.cliStatus,se.status),ue=yvt(de);return we=xvt(de),{cliStatus:de,cliProviderStatusLoading:ue.length>0?{...J.cliProviderStatusLoading,...Object.fromEntries(ue.map(ae=>[ae,!0]))}:J.cliProviderStatusLoading}});for(const J of we)re.getState().fetchCliProviderStatus(J,{silent:!1})}break}});typeof K=="function"&&e.push(()=>{K(),Oe&&(clearTimeout(Oe),Oe=null)})}if(Z.ssh?.onStatus){const K=Z.ssh.onStatus((Y,W)=>{const se=W;re.getState().setConnectionStatus(se.state,se.host,se.error)});typeof K=="function"&&e.push(K)}if(Z.context?.onChanged){const K=Z.context.onChanged((Y,W)=>{const{id:se}=W,he=re.getState().activeContextId;se!==he&&re.getState().switchContext(se)});typeof K=="function"&&e.push(K)}return()=>{for(const K of r.values())clearTimeout(K);r.clear();for(const K of s.values())clearTimeout(K);s.clear(),e.forEach(K=>K())}}const W5t=()=>{const e=re(r=>r.isContextSwitching),t=re(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:"正在加载工作区"})]})]})})},G5t="1.6.37",H5t={version:G5t},Z5t="https://github.com/yancyuu/Hermit/issues/new",K5t=120,J5t=1800,ejt=1200,tjt=12e3,njt=8e3,AZ=(e,t)=>e.length<=t?e:`${e.slice(0,t)}
|
|
1057
1057
|
...[truncated]`,rjt=e=>{const t=e?`[BUG] ${e.name}: ${e.message}`:"[BUG] Application crash";return AZ(t,K5t)},sjt=()=>"Web browser",xp=e=>{if(!e)return"Not available";const t=e.trim();return t.length>0?t:"Not available"},ijt=()=>{const{userAgent:e}=window.navigator;return e.includes("Mac OS X")?"macOS":e.includes("Windows")?"Windows":e.includes("Linux")?"Linux":"Unknown"},jOe=e=>e?.activeTabType?e.activeTabLabel?`${e.activeTabType} (${e.activeTabLabel})`:e.activeTabType:"Not available",AXe=({error:e,componentStack:t,context:n},r)=>{const s=e?.message??"Unknown application crash",i=e?.stack?AZ(e.stack,r.js):"Not available",o=t?AZ(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: ${jOe(n)}`,`- Active team tab: ${xp(n?.activeTeamName)}`,`- Selected team: ${xp(n?.selectedTeamName)}`,`- Current task: ${xp(n?.taskId)}`,`- Session ID: ${xp(n?.sessionId)}`,`- Project ID: ${xp(n?.projectId)}`,"","**Steps to reproduce**","1. Open the app and navigate to the screen where the crash happened.","2. Repeat the action that triggered the error.","3. Observe the global error screen.","","**Expected behavior**","The app should continue working instead of crashing.","","**Screenshots**","Attach a screenshot if you have one.","","**Environment**",`- OS: ${ijt()}`,`- Runtime: ${sjt()}`,`- App version: ${H5t.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: ${jOe(n)}`,`Active team tab: ${xp(n?.activeTeamName)}`,`Selected team: ${xp(n?.selectedTeamName)}`,`Current task: ${xp(n?.taskId)}`,`Session ID: ${xp(n?.sessionId)}`,`Project ID: ${xp(n?.projectId)}`,"```","","**JavaScript stack trace**","```text",i,"```","","**React component stack**","```text",o,"```"].join(`
|
|
1058
1058
|
`)},ojt=e=>AXe(e,{js:tjt,react:njt}),ajt=e=>{const t=new URLSearchParams({template:"bug_report.md",labels:"bug",title:rjt(e.error),body:AXe(e,{js:J5t,react:ejt})});return`${Z5t}?${t.toString()}`},XOe=to("Component:ErrorBoundary");class ljt extends O.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){XOe.error("ErrorBoundary caught an error:",t,n),this.setState({errorInfo:n}),Hxt()&&Kxt(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=re.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=ajt({error:this.state.error,componentStack:this.state.errorInfo?.componentStack??null,context:this.getBugReportContext()});Z.openExternal(t)};handleCopyErrorDetails=async()=>{try{await navigator.clipboard.writeText(ojt({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){XOe.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(zn,{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(qr,{className:"size-4 text-green-400"}):u.jsx(yE,{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(VIe,{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(go,{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 cjt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return O.useMemo(()=>r=>{t.forEach(s=>s(r))},t)}const hz=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function IE(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function zse(e){return"nodeType"in e}function Cl(e){var t,n;return e?IE(e)?e:zse(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Bse(e){const{Document:t}=Cl(e);return e instanceof t}function Z$(e){return IE(e)?!1:e instanceof Cl(e).HTMLElement}function IXe(e){return e instanceof Cl(e).SVGElement}function ME(e){return e?IE(e)?e.document:zse(e)?Bse(e)?e:Z$(e)||IXe(e)?e.ownerDocument:document:document:document}const np=hz?O.useLayoutEffect:O.useEffect;function mz(e){const t=O.useRef(e);return np(()=>{t.current=e}),O.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 ujt(){const e=O.useRef(null),t=O.useCallback((r,s)=>{e.current=setInterval(r,s)},[]),n=O.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function uP(e,t){t===void 0&&(t=[e]);const n=O.useRef(e);return np(()=>{n.current!==e&&(n.current=e)},t),n}function K$(e,t){const n=O.useRef();return O.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function YL(e){const t=mz(e),n=O.useRef(null),r=O.useCallback(s=>{s!==n.current&&t?.(s,n.current),n.current=s},[]);return[n,r]}function VL(e){const t=O.useRef();return O.useEffect(()=>{t.current=e},[e]),t.current}let AY={};function J$(e,t){return O.useMemo(()=>{if(t)return t;const n=AY[e]==null?0:AY[e]+1;return AY[e]=n,e+"-"+n},[e,t])}function MXe(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 hv=MXe(1),qL=MXe(-1);function djt(e){return"clientX"in e&&"clientY"in e}function gz(e){if(!e)return!1;const{KeyboardEvent:t}=Cl(e.target);return t&&e instanceof t}function pjt(e){if(!e)return!1;const{TouchEvent:t}=Cl(e.target);return t&&e instanceof t}function WL(e){if(pjt(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 djt(e)?{x:e.clientX,y:e.clientY}:null}const Tm=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Tm.Translate.toString(e),Tm.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),UOe="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function fjt(e){return e.matches(UOe)?e:e.querySelector(UOe)}const hjt={display:"none"};function mjt(e){let{id:t,value:n}=e;return Je.createElement("div",{id:t,style:hjt},n)}function gjt(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 Ojt(){const[e,t]=O.useState("");return{announce:O.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const QXe=O.createContext(null);function _jt(e){const t=O.useContext(QXe);O.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function bjt(){const[e]=O.useState(()=>new Set),t=O.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[O.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 yjt={draggable:`
|
|
1059
1059
|
To pick up a draggable item, press the space bar.
|
|
@@ -1339,8 +1339,8 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
|
|
|
1339
1339
|
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),ct.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 ct.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"),xye=B((e,t)=>{ct.warn("abc88 cutPathAtIntersect",e,t);let n=[],r=e[0],s=!1;return e.forEach(i=>{if(ct.info("abc88 checking point",i,t),!Lln(t,i)&&!s){const o=jln(t,r,i);ct.debug("abc88 inside",i,r,o),ct.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)?ct.warn("abc88 no intersect",o,n):n.push(o),s=!0}else ct.warn("abc88 outside",i,r),r=i,s||n.push(i)}),ct.debug("returning points",n),n},"cutPathAtIntersect");function Vqe(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(Vqe,"extractCornerPoints");var Sye=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"),Xln=B(function(e){const{cornerPointPositions:t}=Vqe(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=Sye(s,o,5),c=Sye(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){ct.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 ct.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"),Uln=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"),zln=B(function(e,t,n,r,s,i,o,a=!1){const{handDrawnSeed:c}=ls();let l=t.points,d=!1;const p=s;var f=i;const h=[];for(const $ in t.cssCompiledStyles)SYe($)||h.push(t.cssCompiledStyles[$]);ct.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])),ct.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&&(ct.info("to cluster abc88",n.get(t.toCluster)),l=xye(t.points,n.get(t.toCluster).node),d=!0),t.fromCluster&&(ct.debug("from cluster abc88",n.get(t.fromCluster),JSON.stringify(l,null,2)),l=xye(l.reverse(),n.get(t.fromCluster).node).reverse(),d=!0);let g=l.filter($=>!Number.isNaN($.y));g=Xln(g);let _=h2;switch(_=T5,t.curve){case"linear":_=T5;break;case"basis":_=h2;break;case"cardinal":_=w4e;break;case"bumpX":_=x4e;break;case"bumpY":_=S4e;break;case"catmullRom":_=C4e;break;case"monotoneX":_=I4e;break;case"monotoneY":_=M4e;break;case"natural":_=D4e;break;case"step":_=L4e;break;case"stepAfter":_=X4e;break;case"stepBefore":_=j4e;break;default:_=h2}const{x:b,y}=Lrn(t),x=xnn().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"?qqe(Wqe(g,t),5):x(g);const E=Array.isArray(t.style)?t.style:[t.style];let w=E.find($=>$?.startsWith("stroke:")),P=!1;if(t.look==="handDrawn"){const $=an.svg(e);Object.assign([],g);const R=$.path(T,{roughness:.3,seed:c});S+=" transition",v=Mr(R).select("path").attr("id",t.id).attr("class"," "+S+(t.classes?" "+t.classes:"")).attr("style",E?E.reduce((j,M)=>j+";"+M,""):"");let N=v.attr("d");v.attr("d",N),e.node().appendChild(v.node())}else{const $=h.join(";"),R=E?E.reduce((z,D)=>z+D+";",""):"";let N="";t.animate&&(N=" edge-animation-fast"),t.animation&&(N=" edge-animation-"+t.animation);const j=($?$+";"+R+";":R)+";"+(E?E.reduce((z,D)=>z+";"+D,""):"");v=e.append("path").attr("d",T).attr("id",t.id).attr("class"," "+S+(t.classes?" "+t.classes:"")+(N??"")).attr("style",j),w=j.match(/stroke:([^;]+)/)?.[1],P=t.animate===!0||!!t.animation||$.includes("animation");const M=v.node(),U=typeof M.getTotalLength=="function"?M.getTotalLength():0,A=jbe[t.arrowTypeStart]||0,F=jbe[t.arrowTypeEnd]||0;if(t.look==="neo"&&!P){const D=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?Uln(U,A,F):`0 ${A} ${U-A-F} ${F}`}; stroke-dashoffset: 0;`;v.attr("style",D+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&&g.forEach($=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",$.x).attr("cy",$.y)});let C="";(ls().flowchart.arrowMarkerAbsolute||ls().state.arrowMarkerAbsolute)&&(C=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,C=C.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),ct.info("arrowTypeStart",t.arrowTypeStart),ct.info("arrowTypeEnd",t.arrowTypeEnd),Iln(v,t,C,o,r,w);const k=Math.floor(l.length/2),I=l[k];Pd.isLabelCoordinateInPath(I,v.attr("d"))||(d=!0);let Q={};return d&&(Q.updatedPath=l),Q.originalPath=t.points,Q},"insertEdge");function qqe(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 g=l/h,_=d/h,b=p/m,y=f/m,x=g*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-g*T,w=o.y-_*T,P=o.x+b*T,C=o.y+y*T;n+=`L${E},${w}`,n+=`Q${o.x},${o.y} ${P},${C}`}}return n}B(qqe,"generateRoundedPath");function eJ(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(eJ,"calculateDeltaAndAngle");function Wqe(e,t){const n=e.map(s=>({...s}));if(e.length>=2&&Sa[t.arrowTypeStart]){const s=Sa[t.arrowTypeStart],i=e[0],o=e[1],{angle:a}=eJ(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&&Sa[t.arrowTypeEnd]){const s=Sa[t.arrowTypeEnd],i=e[r-1],o=e[r-2],{angle:a}=eJ(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(Wqe,"applyMarkerOffsetsToPoints");var Bln=B((e,t,n,r)=>{t.forEach(s=>{icn[s](e,n,r)})},"insertMarkers"),Fln=B((e,t,n)=>{ct.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"),Yln=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"),Vln=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"),qln=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"),Wln=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"),Gln=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"),Hln=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"),Zln=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"),Kln=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"),Jln=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"),ecn=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"),tcn=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"),ncn=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"),rcn=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
|
|
1340
1340
|
L20,10
|
|
1341
1341
|
M20,10
|
|
1342
|
-
L0,20`)},"requirement_arrow"),scn=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"),icn={extension:Fln,composition:Yln,aggregation:Vln,dependency:qln,lollipop:Wln,point:Gln,circle:Hln,cross:Zln,barb:Kln,only_one:Jln,zero_or_one:ecn,one_or_more:tcn,zero_or_more:ncn,requirement_arrow:rcn,requirement_contains:scn},ocn=Bln,acn={common:BE,getConfig:Ma,insertCluster:mln,insertEdge:zln,insertEdgeLabel:Qln,insertMarkers:ocn,insertNode:Yqe,interpolateToCurve:xoe,labelHelper:$n,log:ct,positionEdgeLabel:Dln},NP={},Gqe=B(e=>{for(const t of e)NP[t.name]=t},"registerLayoutLoaders"),lcn=B(()=>{Gqe([{name:"dagre",loader:B(async()=>await De(()=>import("./dagre-6UL2VRFP-CIui920O.js"),__vite__mapDeps([12,13,14,15,16,17,1])),"loader")},{name:"cose-bilkent",loader:B(async()=>await De(()=>import("./cose-bilkent-S5V4N54A-CVztr86T.js"),__vite__mapDeps([18,19,1])),"loader")}])},"registerDefaultLayoutLoaders");lcn();var kKn=B(async(e,t)=>{if(!(e.layoutAlgorithm in NP))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);const n=NP[e.layoutAlgorithm];return(await n.loader()).render(e,t,acn,{algorithm:n.algorithm})},"render"),CKn=B((e="",{fallback:t="dagre"}={})=>{if(e in NP)return e;if(t in NP)return ct.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"),Hqe="comm",Zqe="rule",Kqe="decl",ccn="@import",ucn="@namespace",dcn="@keyframes",pcn="@layer",Jqe=Math.abs,Uoe=String.fromCharCode;function e6e(e){return e.trim()}function b2(e,t,n){return e.replace(t,n)}function fcn(e,t,n){return e.indexOf(t,n)}function yv(e,t){return e.charCodeAt(t)|0}function DT(e,t,n){return e.slice(t,n)}function zp(e){return e.length}function hcn(e){return e.length}function WI(e,t){return t.push(e),e}var f3=1,LT=1,t6e=0,Ju=0,Yi=0,WE="";function zoe(e,t,n,r,s,i,o,a){return{value:e,root:t,parent:n,type:r,props:s,children:i,line:f3,column:LT,length:o,return:"",siblings:a}}function mcn(){return Yi}function gcn(){return Yi=Ju>0?yv(WE,--Ju):0,LT--,Yi===10&&(LT=1,f3--),Yi}function Wd(){return Yi=Ju<t6e?yv(WE,Ju++):0,LT++,Yi===10&&(LT=1,f3++),Yi}function iO(){return yv(WE,Ju)}function y2(){return Ju}function h3(e,t){return DT(WE,e,t)}function AP(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 Ocn(e){return f3=LT=1,t6e=zp(WE=e),Ju=0,[]}function _cn(e){return WE="",e}function kV(e){return e6e(h3(Ju-1,tJ(e===91?e+2:e===40?e+1:e)))}function bcn(e){for(;(Yi=iO())&&Yi<33;)Wd();return AP(e)>2||AP(Yi)>3?"":" "}function ycn(e,t){for(;--t&&Wd()&&!(Yi<48||Yi>102||Yi>57&&Yi<65||Yi>70&&Yi<97););return h3(e,y2()+(t<6&&iO()==32&&Wd()==32))}function tJ(e){for(;Wd();)switch(Yi){case e:return Ju;case 34:case 39:e!==34&&e!==39&&tJ(Yi);break;case 40:e===41&&tJ(e);break;case 92:Wd();break}return Ju}function xcn(e,t){for(;Wd()&&e+Yi!==57;)if(e+Yi===84&&iO()===47)break;return"/*"+h3(t,Ju-1)+"*"+Uoe(e===47?e:Wd())}function Scn(e){for(;!AP(iO());)Wd();return h3(e,Ju)}function vcn(e){return _cn(x2("",null,null,null,[""],e=Ocn(e),0,[0],e))}function x2(e,t,n,r,s,i,o,a,c){for(var l=0,d=0,p=o,f=0,h=0,m=0,g=1,_=1,b=1,y=0,x="",S=s,v=i,T=r,E=x;_;)switch(m=y,y=Wd()){case 40:if(m!=108&&yv(E,p-1)==58){fcn(E+=b2(kV(y),"&","&\f"),"&\f",Jqe(l?a[l-1]:0))!=-1&&(b=-1);break}case 34:case 39:case 91:E+=kV(y);break;case 9:case 10:case 13:case 32:E+=bcn(m);break;case 92:E+=ycn(y2()-1,7);continue;case 47:switch(iO()){case 42:case 47:WI(Tcn(xcn(Wd(),y2()),t,n,c),c),(AP(m||1)==5||AP(iO()||1)==5)&&zp(E)&&DT(E,-1,void 0)!==" "&&(E+=" ");break;default:E+="/"}break;case 123*g:a[l++]=zp(E)*b;case 125*g:case 59:case 0:switch(y){case 0:case 125:_=0;case 59+d:b==-1&&(E=b2(E,/\f/g,"")),h>0&&(zp(E)-p||g===0&&m===47)&&WI(h>32?Tye(E+";",r,n,p-1,c):Tye(b2(E," ","")+";",r,n,p-2,c),c);break;case 59:E+=";";default:if(WI(T=vye(E,t,n,l,d,s,a,x,S=[],v=[],p,i),i),y===123)if(d===0)x2(E,t,T,T,S,i,p,a,v);else{switch(f){case 99:if(yv(E,3)===110)break;case 108:if(yv(E,2)===97)break;default:d=0;case 100:case 109:case 115:}d?x2(e,T,T,r&&WI(vye(e,T,T,0,0,s,a,x,s,S=[],p,v),v),s,v,p,a,r?S:v):x2(E,T,T,T,[""],v,0,a,v)}}l=d=h=0,g=b=1,x=E="",p=o;break;case 58:p=1+zp(E),h=m;default:if(g<1){if(y==123)--g;else if(y==125&&g++==0&&gcn()==125)continue}switch(E+=Uoe(y),y*g){case 38:b=d>0?1:(E+="\f",-1);break;case 44:a[l++]=(zp(E)-1)*b,b=1;break;case 64:iO()===45&&(E+=kV(Wd())),f=iO(),d=p=zp(x=E+=Scn(y2())),y++;break;case 45:m===45&&zp(E)==2&&(g=0)}}return i}function vye(e,t,n,r,s,i,o,a,c,l,d,p){for(var f=s-1,h=s===0?i:[""],m=hcn(h),g=0,_=0,b=0;g<r;++g)for(var y=0,x=DT(e,f+1,f=Jqe(_=o[g])),S=e;y<m;++y)(S=e6e(_>0?h[y]+" "+x:b2(x,/&\f/g,h[y])))&&(c[b++]=S);return zoe(e,t,n,s===0?Zqe:a,c,l,d,p)}function Tcn(e,t,n,r){return zoe(e,t,n,Hqe,Uoe(mcn()),DT(e,2,-2),0,r)}function Tye(e,t,n,r,s){return zoe(e,t,n,Kqe,DT(e,0,r),DT(e,r+1,-1),r,s)}function nJ(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function Ecn(e,t,n,r){switch(e.type){case pcn:if(e.children.length)break;case ccn:case ucn:case Kqe:return e.return=e.return||e.value;case Hqe:return"";case dcn:return e.return=e.value+"{"+nJ(e.children,r)+"}";case Zqe:if(!zp(e.value=e.props.join(",")))return""}return zp(n=nJ(e.children,r))?e.return=e.value+"{"+n+"}":""}var wcn=kYe(Object.keys,Object),kcn=Object.prototype,Ccn=kcn.hasOwnProperty;function Rcn(e){if(!r3(e))return wcn(e);var t=[];for(var n in Object(e))Ccn.call(e,n)&&n!="constructor"&&t.push(n);return t}var rJ=Wy(zf,"DataView"),sJ=Wy(zf,"Promise"),iJ=Wy(zf,"Set"),oJ=Wy(zf,"WeakMap"),Eye="[object Map]",Pcn="[object Object]",wye="[object Promise]",kye="[object Set]",Cye="[object WeakMap]",Rye="[object DataView]",$cn=qy(rJ),Ncn=qy(PP),Acn=qy(sJ),Icn=qy(iJ),Mcn=qy(oJ),y0=YE;(rJ&&y0(new rJ(new ArrayBuffer(1)))!=Rye||PP&&y0(new PP)!=Eye||sJ&&y0(sJ.resolve())!=wye||iJ&&y0(new iJ)!=kye||oJ&&y0(new oJ)!=Cye)&&(y0=function(e){var t=YE(e),n=t==Pcn?e.constructor:void 0,r=n?qy(n):"";if(r)switch(r){case $cn:return Rye;case Ncn:return Eye;case Acn:return wye;case Icn:return kye;case Mcn:return Cye}return t});var Qcn="[object Map]",Dcn="[object Set]",Lcn=Object.prototype,jcn=Lcn.hasOwnProperty;function Pye(e){if(e==null)return!0;if(s3(e)&&(D5(e)||typeof e=="string"||typeof e.splice=="function"||boe(e)||yoe(e)||Q5(e)))return!e.length;var t=y0(e);if(t==Qcn||t==Dcn)return!e.size;if(r3(e))return!Rcn(e).length;for(var n in e)if(jcn.call(e,n))return!1;return!0}var n6e="c4",Xcn=B(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),Ucn=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./c4Diagram-YG6GDRKO-BvJQS9lb.js");return{diagram:t}},__vite__mapDeps([20,21,1]));return{id:n6e,diagram:e}},"loader"),zcn={id:n6e,detector:Xcn,loader:Ucn},Bcn=zcn,r6e="flowchart",Fcn=B((e,t)=>t?.flowchart?.defaultRenderer==="dagre-wrapper"||t?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(e),"detector"),Ycn=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-CJV1g9Hr.js");return{diagram:t}},__vite__mapDeps([22,23,24,25,26,1]));return{id:r6e,diagram:e}},"loader"),Vcn={id:r6e,detector:Fcn,loader:Ycn},qcn=Vcn,s6e="flowchart-v2",Wcn=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"),Gcn=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-CJV1g9Hr.js");return{diagram:t}},__vite__mapDeps([22,23,24,25,26,1]));return{id:s6e,diagram:e}},"loader"),Hcn={id:s6e,detector:Wcn,loader:Gcn},Zcn=Hcn,i6e="er",Kcn=B(e=>/^\s*erDiagram/.test(e),"detector"),Jcn=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./erDiagram-Q2GNP2WA-bOICzF9d.js");return{diagram:t}},__vite__mapDeps([27,24,25,26,1]));return{id:i6e,diagram:e}},"loader"),eun={id:i6e,detector:Kcn,loader:Jcn},tun=eun,o6e="gitGraph",nun=B(e=>/^\s*gitGraph/.test(e),"detector"),run=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./gitGraphDiagram-V2S2FVAM-vbXopTpS.js");return{diagram:t}},__vite__mapDeps([28,29,30,31,14,16,17,1]));return{id:o6e,diagram:e}},"loader"),sun={id:o6e,detector:nun,loader:run},iun=sun,a6e="gantt",oun=B(e=>/^\s*gantt/.test(e),"detector"),aun=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./ganttDiagram-JELNMOA3-CXbhDo09.js");return{diagram:t}},__vite__mapDeps([32,33,34,35,1]));return{id:a6e,diagram:e}},"loader"),lun={id:a6e,detector:oun,loader:aun},cun=lun,l6e="info",uun=B(e=>/^\s*info/.test(e),"detector"),dun=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./infoDiagram-HS3SLOUP-BNg14AdU.js");return{diagram:t}},__vite__mapDeps([36,31,14,16,17,1]));return{id:l6e,diagram:e}},"loader"),pun={id:l6e,detector:uun,loader:dun},c6e="pie",fun=B(e=>/^\s*pie/.test(e),"detector"),hun=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./pieDiagram-ADFJNKIX-BToJFvWR.js");return{diagram:t}},__vite__mapDeps([37,29,31,14,16,17,38,39,34,1]));return{id:c6e,diagram:e}},"loader"),mun={id:c6e,detector:fun,loader:hun},u6e="quadrantChart",gun=B(e=>/^\s*quadrantChart/.test(e),"detector"),Oun=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./quadrantDiagram-AYHSOK5B-C0qoxXvH.js");return{diagram:t}},__vite__mapDeps([40,33,34,35,1]));return{id:u6e,diagram:e}},"loader"),_un={id:u6e,detector:gun,loader:Oun},bun=_un,d6e="xychart",yun=B(e=>/^\s*xychart(-beta)?/.test(e),"detector"),xun=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./xychartDiagram-PRI3JC2R-DhwSTphI.js");return{diagram:t}},__vite__mapDeps([41,34,39,33,35,1]));return{id:d6e,diagram:e}},"loader"),Sun={id:d6e,detector:yun,loader:xun},vun=Sun,p6e="requirement",Tun=B(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),Eun=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./requirementDiagram-UZGBJVZJ-DCKGwsGN.js");return{diagram:t}},__vite__mapDeps([42,24,25,1]));return{id:p6e,diagram:e}},"loader"),wun={id:p6e,detector:Tun,loader:Eun},kun=wun,f6e="sequence",Cun=B(e=>/^\s*sequenceDiagram/.test(e),"detector"),Run=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./sequenceDiagram-WL72ISMW-C9pAWoSR.js");return{diagram:t}},__vite__mapDeps([43,21,30,1]));return{id:f6e,diagram:e}},"loader"),Pun={id:f6e,detector:Cun,loader:Run},$un=Pun,h6e="class",Nun=B((e,t)=>t?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e),"detector"),Aun=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./classDiagram-2ON5EDUG-BAD4p014.js");return{diagram:t}},__vite__mapDeps([44,45,23,24,25,1]));return{id:h6e,diagram:e}},"loader"),Iun={id:h6e,detector:Nun,loader:Aun},Mun=Iun,m6e="classDiagram",Qun=B((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e),"detector"),Dun=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./classDiagram-v2-WZHVMYZB-BAD4p014.js");return{diagram:t}},__vite__mapDeps([46,45,23,24,25,1]));return{id:m6e,diagram:e}},"loader"),Lun={id:m6e,detector:Qun,loader:Dun},jun=Lun,g6e="state",Xun=B((e,t)=>t?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e),"detector"),Uun=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./stateDiagram-FKZM4ZOC-BTTX_v1m.js");return{diagram:t}},__vite__mapDeps([47,48,24,25,13,14,15,16,1]));return{id:g6e,diagram:e}},"loader"),zun={id:g6e,detector:Xun,loader:Uun},Bun=zun,O6e="stateDiagram",Fun=B((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer==="dagre-wrapper"),"detector"),Yun=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./stateDiagram-v2-4FDKWEC3-BHk97lQJ.js");return{diagram:t}},__vite__mapDeps([49,48,24,25,1]));return{id:O6e,diagram:e}},"loader"),Vun={id:O6e,detector:Fun,loader:Yun},qun=Vun,_6e="journey",Wun=B(e=>/^\s*journey/.test(e),"detector"),Gun=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./journeyDiagram-XKPGCS4Q-2_PkPCiu.js");return{diagram:t}},__vite__mapDeps([50,21,23,38,1]));return{id:_6e,diagram:e}},"loader"),Hun={id:_6e,detector:Wun,loader:Gun},Zun=Hun,Kun=B((e,t,n)=>{ct.debug(`rendering svg for syntax error
|
|
1343
|
-
`);const r=Pnn(t),s=r.append("g");r.attr("viewBox","0 0 2412 512"),FBe(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"),b6e={draw:Kun},Jun=b6e,edn={db:{},renderer:b6e,parser:{parse:B(()=>{},"parse")}},tdn=edn,y6e="flowchart-elk",ndn=B((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk"?(t.layout="elk",!0):!1,"detector"),rdn=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-
|
|
1342
|
+
L0,20`)},"requirement_arrow"),scn=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"),icn={extension:Fln,composition:Yln,aggregation:Vln,dependency:qln,lollipop:Wln,point:Gln,circle:Hln,cross:Zln,barb:Kln,only_one:Jln,zero_or_one:ecn,one_or_more:tcn,zero_or_more:ncn,requirement_arrow:rcn,requirement_contains:scn},ocn=Bln,acn={common:BE,getConfig:Ma,insertCluster:mln,insertEdge:zln,insertEdgeLabel:Qln,insertMarkers:ocn,insertNode:Yqe,interpolateToCurve:xoe,labelHelper:$n,log:ct,positionEdgeLabel:Dln},NP={},Gqe=B(e=>{for(const t of e)NP[t.name]=t},"registerLayoutLoaders"),lcn=B(()=>{Gqe([{name:"dagre",loader:B(async()=>await De(()=>import("./dagre-6UL2VRFP-n1g-DhEE.js"),__vite__mapDeps([12,13,14,15,16,17,1])),"loader")},{name:"cose-bilkent",loader:B(async()=>await De(()=>import("./cose-bilkent-S5V4N54A-D9z9Dgt7.js"),__vite__mapDeps([18,19,1])),"loader")}])},"registerDefaultLayoutLoaders");lcn();var kKn=B(async(e,t)=>{if(!(e.layoutAlgorithm in NP))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);const n=NP[e.layoutAlgorithm];return(await n.loader()).render(e,t,acn,{algorithm:n.algorithm})},"render"),CKn=B((e="",{fallback:t="dagre"}={})=>{if(e in NP)return e;if(t in NP)return ct.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"),Hqe="comm",Zqe="rule",Kqe="decl",ccn="@import",ucn="@namespace",dcn="@keyframes",pcn="@layer",Jqe=Math.abs,Uoe=String.fromCharCode;function e6e(e){return e.trim()}function b2(e,t,n){return e.replace(t,n)}function fcn(e,t,n){return e.indexOf(t,n)}function yv(e,t){return e.charCodeAt(t)|0}function DT(e,t,n){return e.slice(t,n)}function zp(e){return e.length}function hcn(e){return e.length}function WI(e,t){return t.push(e),e}var f3=1,LT=1,t6e=0,Ju=0,Yi=0,WE="";function zoe(e,t,n,r,s,i,o,a){return{value:e,root:t,parent:n,type:r,props:s,children:i,line:f3,column:LT,length:o,return:"",siblings:a}}function mcn(){return Yi}function gcn(){return Yi=Ju>0?yv(WE,--Ju):0,LT--,Yi===10&&(LT=1,f3--),Yi}function Wd(){return Yi=Ju<t6e?yv(WE,Ju++):0,LT++,Yi===10&&(LT=1,f3++),Yi}function iO(){return yv(WE,Ju)}function y2(){return Ju}function h3(e,t){return DT(WE,e,t)}function AP(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 Ocn(e){return f3=LT=1,t6e=zp(WE=e),Ju=0,[]}function _cn(e){return WE="",e}function kV(e){return e6e(h3(Ju-1,tJ(e===91?e+2:e===40?e+1:e)))}function bcn(e){for(;(Yi=iO())&&Yi<33;)Wd();return AP(e)>2||AP(Yi)>3?"":" "}function ycn(e,t){for(;--t&&Wd()&&!(Yi<48||Yi>102||Yi>57&&Yi<65||Yi>70&&Yi<97););return h3(e,y2()+(t<6&&iO()==32&&Wd()==32))}function tJ(e){for(;Wd();)switch(Yi){case e:return Ju;case 34:case 39:e!==34&&e!==39&&tJ(Yi);break;case 40:e===41&&tJ(e);break;case 92:Wd();break}return Ju}function xcn(e,t){for(;Wd()&&e+Yi!==57;)if(e+Yi===84&&iO()===47)break;return"/*"+h3(t,Ju-1)+"*"+Uoe(e===47?e:Wd())}function Scn(e){for(;!AP(iO());)Wd();return h3(e,Ju)}function vcn(e){return _cn(x2("",null,null,null,[""],e=Ocn(e),0,[0],e))}function x2(e,t,n,r,s,i,o,a,c){for(var l=0,d=0,p=o,f=0,h=0,m=0,g=1,_=1,b=1,y=0,x="",S=s,v=i,T=r,E=x;_;)switch(m=y,y=Wd()){case 40:if(m!=108&&yv(E,p-1)==58){fcn(E+=b2(kV(y),"&","&\f"),"&\f",Jqe(l?a[l-1]:0))!=-1&&(b=-1);break}case 34:case 39:case 91:E+=kV(y);break;case 9:case 10:case 13:case 32:E+=bcn(m);break;case 92:E+=ycn(y2()-1,7);continue;case 47:switch(iO()){case 42:case 47:WI(Tcn(xcn(Wd(),y2()),t,n,c),c),(AP(m||1)==5||AP(iO()||1)==5)&&zp(E)&&DT(E,-1,void 0)!==" "&&(E+=" ");break;default:E+="/"}break;case 123*g:a[l++]=zp(E)*b;case 125*g:case 59:case 0:switch(y){case 0:case 125:_=0;case 59+d:b==-1&&(E=b2(E,/\f/g,"")),h>0&&(zp(E)-p||g===0&&m===47)&&WI(h>32?Tye(E+";",r,n,p-1,c):Tye(b2(E," ","")+";",r,n,p-2,c),c);break;case 59:E+=";";default:if(WI(T=vye(E,t,n,l,d,s,a,x,S=[],v=[],p,i),i),y===123)if(d===0)x2(E,t,T,T,S,i,p,a,v);else{switch(f){case 99:if(yv(E,3)===110)break;case 108:if(yv(E,2)===97)break;default:d=0;case 100:case 109:case 115:}d?x2(e,T,T,r&&WI(vye(e,T,T,0,0,s,a,x,s,S=[],p,v),v),s,v,p,a,r?S:v):x2(E,T,T,T,[""],v,0,a,v)}}l=d=h=0,g=b=1,x=E="",p=o;break;case 58:p=1+zp(E),h=m;default:if(g<1){if(y==123)--g;else if(y==125&&g++==0&&gcn()==125)continue}switch(E+=Uoe(y),y*g){case 38:b=d>0?1:(E+="\f",-1);break;case 44:a[l++]=(zp(E)-1)*b,b=1;break;case 64:iO()===45&&(E+=kV(Wd())),f=iO(),d=p=zp(x=E+=Scn(y2())),y++;break;case 45:m===45&&zp(E)==2&&(g=0)}}return i}function vye(e,t,n,r,s,i,o,a,c,l,d,p){for(var f=s-1,h=s===0?i:[""],m=hcn(h),g=0,_=0,b=0;g<r;++g)for(var y=0,x=DT(e,f+1,f=Jqe(_=o[g])),S=e;y<m;++y)(S=e6e(_>0?h[y]+" "+x:b2(x,/&\f/g,h[y])))&&(c[b++]=S);return zoe(e,t,n,s===0?Zqe:a,c,l,d,p)}function Tcn(e,t,n,r){return zoe(e,t,n,Hqe,Uoe(mcn()),DT(e,2,-2),0,r)}function Tye(e,t,n,r,s){return zoe(e,t,n,Kqe,DT(e,0,r),DT(e,r+1,-1),r,s)}function nJ(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function Ecn(e,t,n,r){switch(e.type){case pcn:if(e.children.length)break;case ccn:case ucn:case Kqe:return e.return=e.return||e.value;case Hqe:return"";case dcn:return e.return=e.value+"{"+nJ(e.children,r)+"}";case Zqe:if(!zp(e.value=e.props.join(",")))return""}return zp(n=nJ(e.children,r))?e.return=e.value+"{"+n+"}":""}var wcn=kYe(Object.keys,Object),kcn=Object.prototype,Ccn=kcn.hasOwnProperty;function Rcn(e){if(!r3(e))return wcn(e);var t=[];for(var n in Object(e))Ccn.call(e,n)&&n!="constructor"&&t.push(n);return t}var rJ=Wy(zf,"DataView"),sJ=Wy(zf,"Promise"),iJ=Wy(zf,"Set"),oJ=Wy(zf,"WeakMap"),Eye="[object Map]",Pcn="[object Object]",wye="[object Promise]",kye="[object Set]",Cye="[object WeakMap]",Rye="[object DataView]",$cn=qy(rJ),Ncn=qy(PP),Acn=qy(sJ),Icn=qy(iJ),Mcn=qy(oJ),y0=YE;(rJ&&y0(new rJ(new ArrayBuffer(1)))!=Rye||PP&&y0(new PP)!=Eye||sJ&&y0(sJ.resolve())!=wye||iJ&&y0(new iJ)!=kye||oJ&&y0(new oJ)!=Cye)&&(y0=function(e){var t=YE(e),n=t==Pcn?e.constructor:void 0,r=n?qy(n):"";if(r)switch(r){case $cn:return Rye;case Ncn:return Eye;case Acn:return wye;case Icn:return kye;case Mcn:return Cye}return t});var Qcn="[object Map]",Dcn="[object Set]",Lcn=Object.prototype,jcn=Lcn.hasOwnProperty;function Pye(e){if(e==null)return!0;if(s3(e)&&(D5(e)||typeof e=="string"||typeof e.splice=="function"||boe(e)||yoe(e)||Q5(e)))return!e.length;var t=y0(e);if(t==Qcn||t==Dcn)return!e.size;if(r3(e))return!Rcn(e).length;for(var n in e)if(jcn.call(e,n))return!1;return!0}var n6e="c4",Xcn=B(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),Ucn=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./c4Diagram-YG6GDRKO-CN27pqaI.js");return{diagram:t}},__vite__mapDeps([20,21,1]));return{id:n6e,diagram:e}},"loader"),zcn={id:n6e,detector:Xcn,loader:Ucn},Bcn=zcn,r6e="flowchart",Fcn=B((e,t)=>t?.flowchart?.defaultRenderer==="dagre-wrapper"||t?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(e),"detector"),Ycn=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-CMTSi3H6.js");return{diagram:t}},__vite__mapDeps([22,23,24,25,26,1]));return{id:r6e,diagram:e}},"loader"),Vcn={id:r6e,detector:Fcn,loader:Ycn},qcn=Vcn,s6e="flowchart-v2",Wcn=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"),Gcn=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-CMTSi3H6.js");return{diagram:t}},__vite__mapDeps([22,23,24,25,26,1]));return{id:s6e,diagram:e}},"loader"),Hcn={id:s6e,detector:Wcn,loader:Gcn},Zcn=Hcn,i6e="er",Kcn=B(e=>/^\s*erDiagram/.test(e),"detector"),Jcn=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./erDiagram-Q2GNP2WA-C-_1dGHs.js");return{diagram:t}},__vite__mapDeps([27,24,25,26,1]));return{id:i6e,diagram:e}},"loader"),eun={id:i6e,detector:Kcn,loader:Jcn},tun=eun,o6e="gitGraph",nun=B(e=>/^\s*gitGraph/.test(e),"detector"),run=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./gitGraphDiagram-V2S2FVAM-DNVfGooQ.js");return{diagram:t}},__vite__mapDeps([28,29,30,31,14,16,17,1]));return{id:o6e,diagram:e}},"loader"),sun={id:o6e,detector:nun,loader:run},iun=sun,a6e="gantt",oun=B(e=>/^\s*gantt/.test(e),"detector"),aun=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./ganttDiagram-JELNMOA3-DZ0bNrAA.js");return{diagram:t}},__vite__mapDeps([32,33,34,35,1]));return{id:a6e,diagram:e}},"loader"),lun={id:a6e,detector:oun,loader:aun},cun=lun,l6e="info",uun=B(e=>/^\s*info/.test(e),"detector"),dun=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./infoDiagram-HS3SLOUP-CyqtElLq.js");return{diagram:t}},__vite__mapDeps([36,31,14,16,17,1]));return{id:l6e,diagram:e}},"loader"),pun={id:l6e,detector:uun,loader:dun},c6e="pie",fun=B(e=>/^\s*pie/.test(e),"detector"),hun=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./pieDiagram-ADFJNKIX-CiIpPsau.js");return{diagram:t}},__vite__mapDeps([37,29,31,14,16,17,38,39,34,1]));return{id:c6e,diagram:e}},"loader"),mun={id:c6e,detector:fun,loader:hun},u6e="quadrantChart",gun=B(e=>/^\s*quadrantChart/.test(e),"detector"),Oun=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./quadrantDiagram-AYHSOK5B-C3gtowNj.js");return{diagram:t}},__vite__mapDeps([40,33,34,35,1]));return{id:u6e,diagram:e}},"loader"),_un={id:u6e,detector:gun,loader:Oun},bun=_un,d6e="xychart",yun=B(e=>/^\s*xychart(-beta)?/.test(e),"detector"),xun=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./xychartDiagram-PRI3JC2R-3nT9yHwp.js");return{diagram:t}},__vite__mapDeps([41,34,39,33,35,1]));return{id:d6e,diagram:e}},"loader"),Sun={id:d6e,detector:yun,loader:xun},vun=Sun,p6e="requirement",Tun=B(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),Eun=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./requirementDiagram-UZGBJVZJ-CXBTrAnU.js");return{diagram:t}},__vite__mapDeps([42,24,25,1]));return{id:p6e,diagram:e}},"loader"),wun={id:p6e,detector:Tun,loader:Eun},kun=wun,f6e="sequence",Cun=B(e=>/^\s*sequenceDiagram/.test(e),"detector"),Run=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./sequenceDiagram-WL72ISMW-sYqopcrj.js");return{diagram:t}},__vite__mapDeps([43,21,30,1]));return{id:f6e,diagram:e}},"loader"),Pun={id:f6e,detector:Cun,loader:Run},$un=Pun,h6e="class",Nun=B((e,t)=>t?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e),"detector"),Aun=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./classDiagram-2ON5EDUG-BMGXWJ2d.js");return{diagram:t}},__vite__mapDeps([44,45,23,24,25,1]));return{id:h6e,diagram:e}},"loader"),Iun={id:h6e,detector:Nun,loader:Aun},Mun=Iun,m6e="classDiagram",Qun=B((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e),"detector"),Dun=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./classDiagram-v2-WZHVMYZB-BMGXWJ2d.js");return{diagram:t}},__vite__mapDeps([46,45,23,24,25,1]));return{id:m6e,diagram:e}},"loader"),Lun={id:m6e,detector:Qun,loader:Dun},jun=Lun,g6e="state",Xun=B((e,t)=>t?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e),"detector"),Uun=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./stateDiagram-FKZM4ZOC-Bl1-0_Cp.js");return{diagram:t}},__vite__mapDeps([47,48,24,25,13,14,15,16,1]));return{id:g6e,diagram:e}},"loader"),zun={id:g6e,detector:Xun,loader:Uun},Bun=zun,O6e="stateDiagram",Fun=B((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer==="dagre-wrapper"),"detector"),Yun=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./stateDiagram-v2-4FDKWEC3-DOYYvDbi.js");return{diagram:t}},__vite__mapDeps([49,48,24,25,1]));return{id:O6e,diagram:e}},"loader"),Vun={id:O6e,detector:Fun,loader:Yun},qun=Vun,_6e="journey",Wun=B(e=>/^\s*journey/.test(e),"detector"),Gun=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./journeyDiagram-XKPGCS4Q-BvjQ0Hm0.js");return{diagram:t}},__vite__mapDeps([50,21,23,38,1]));return{id:_6e,diagram:e}},"loader"),Hun={id:_6e,detector:Wun,loader:Gun},Zun=Hun,Kun=B((e,t,n)=>{ct.debug(`rendering svg for syntax error
|
|
1343
|
+
`);const r=Pnn(t),s=r.append("g");r.attr("viewBox","0 0 2412 512"),FBe(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"),b6e={draw:Kun},Jun=b6e,edn={db:{},renderer:b6e,parser:{parse:B(()=>{},"parse")}},tdn=edn,y6e="flowchart-elk",ndn=B((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk"?(t.layout="elk",!0):!1,"detector"),rdn=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-CMTSi3H6.js");return{diagram:t}},__vite__mapDeps([22,23,24,25,26,1]));return{id:y6e,diagram:e}},"loader"),sdn={id:y6e,detector:ndn,loader:rdn},idn=sdn,x6e="timeline",odn=B(e=>/^\s*timeline/.test(e),"detector"),adn=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./timeline-definition-IT6M3QCI-CIRjJUBo.js");return{diagram:t}},__vite__mapDeps([51,38,1]));return{id:x6e,diagram:e}},"loader"),ldn={id:x6e,detector:odn,loader:adn},cdn=ldn,S6e="mindmap",udn=B(e=>/^\s*mindmap/.test(e),"detector"),ddn=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./mindmap-definition-VGOIOE7T-C5tDaGSK.js");return{diagram:t}},__vite__mapDeps([52,24,25,1]));return{id:S6e,diagram:e}},"loader"),pdn={id:S6e,detector:udn,loader:ddn},fdn=pdn,v6e="kanban",hdn=B(e=>/^\s*kanban/.test(e),"detector"),mdn=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./kanban-definition-3W4ZIXB7-CJJ-k0zT.js");return{diagram:t}},__vite__mapDeps([53,23,1]));return{id:v6e,diagram:e}},"loader"),gdn={id:v6e,detector:hdn,loader:mdn},Odn=gdn,T6e="sankey",_dn=B(e=>/^\s*sankey(-beta)?/.test(e),"detector"),bdn=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./sankeyDiagram-TZEHDZUN-wziX77xG.js");return{diagram:t}},__vite__mapDeps([54,39,34,1]));return{id:T6e,diagram:e}},"loader"),ydn={id:T6e,detector:_dn,loader:bdn},xdn=ydn,E6e="packet",Sdn=B(e=>/^\s*packet(-beta)?/.test(e),"detector"),vdn=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./diagram-S2PKOQOG-B707WJQw.js");return{diagram:t}},__vite__mapDeps([55,29,31,14,16,17,1]));return{id:E6e,diagram:e}},"loader"),Tdn={id:E6e,detector:Sdn,loader:vdn},w6e="radar",Edn=B(e=>/^\s*radar-beta/.test(e),"detector"),wdn=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./diagram-QEK2KX5R-wVnJuwza.js");return{diagram:t}},__vite__mapDeps([56,29,31,14,16,17,1]));return{id:w6e,diagram:e}},"loader"),kdn={id:w6e,detector:Edn,loader:wdn},k6e="block",Cdn=B(e=>/^\s*block(-beta)?/.test(e),"detector"),Rdn=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./blockDiagram-VD42YOAC-BKdZF02Y.js");return{diagram:t}},__vite__mapDeps([57,23,17,14,13,26,1]));return{id:k6e,diagram:e}},"loader"),Pdn={id:k6e,detector:Cdn,loader:Rdn},$dn=Pdn,C6e="architecture",Ndn=B(e=>/^\s*architecture/.test(e),"detector"),Adn=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./architectureDiagram-VXUJARFQ-cjffS2Qr.js");return{diagram:t}},__vite__mapDeps([58,29,31,14,16,17,19,1]));return{id:C6e,diagram:e}},"loader"),Idn={id:C6e,detector:Ndn,loader:Adn},Mdn=Idn,R6e="treemap",Qdn=B(e=>/^\s*treemap/.test(e),"detector"),Ddn=B(async()=>{const{diagram:e}=await De(async()=>{const{diagram:t}=await import("./diagram-PSM6KHXK-BvxFq-BE.js");return{diagram:t}},__vite__mapDeps([59,25,29,31,14,16,17,35,39,34,1]));return{id:R6e,diagram:e}},"loader"),Ldn={id:R6e,detector:Qdn,loader:Ddn},$ye=!1,m3=B(()=>{$ye||($ye=!0,O5("error",tdn,e=>e.toLowerCase().trim()==="error"),O5("---",{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("---")),fK(idn,fdn,Mdn),fK(Bcn,Odn,jun,Mun,tun,cun,pun,mun,kun,$un,Zcn,qcn,cdn,iun,qun,Bun,Zun,bun,xdn,Tdn,vun,$dn,kdn,Ldn))},"addDiagrams"),jdn=B(async()=>{ct.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(Jb).map(async([n,{detector:r,loader:s}])=>{if(s)try{OK(n)}catch{try{const{diagram:i,id:o}=await s();O5(o,i,r)}catch(i){throw ct.error(`Failed to load external diagram with key ${n}. Removing from detectors.`),delete Jb[n],i}}}))).filter(n=>n.status==="rejected");if(t.length>0){ct.error(`Failed to load ${t.length} external diagrams`);for(const n of t)ct.error(n);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),Xdn="graphics-document document";function P6e(e,t){e.attr("role",Xdn),t!==""&&e.attr("aria-roledescription",t)}B(P6e,"setA11yDiagramInfo");function $6e(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($6e,"addSVGa11yTitleDescription");var aJ=class N6e{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=Ma(),s=Fie(t,r);t=Lon(t)+`
|
|
1344
1344
|
`;try{OK(s)}catch{const l=oKt(s);if(!l)throw new NBe(`Diagram ${s} not found.`);const{id:d,diagram:p}=await l();O5(d,p)}const{db:i,parser:o,renderer:a,init:c}=OK(s);return o.parser&&(o.parser.yy=i),i.clear?.(),c?.(r),n.title&&i.setDiagramTitle?.(n.title),await o.parse(t),new N6e(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}},Nye=[],Udn=B(()=>{Nye.forEach(e=>{e()}),Nye=[]},"attachFunctions"),zdn=B(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function A6e(e){const t=e.match($Be);if(!t)return{text:e,metadata:{}};let n=Drn(t[1],{schema:Qrn})??{};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(A6e,"extractFrontMatter");var Bdn=B(e=>e.replace(/\r\n?/g,`
|
|
1345
1345
|
`).replace(/<(\w+)([^>]*)>/g,(t,n,r)=>"<"+n+r.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),Fdn=B(e=>{const{text:t,metadata:n}=A6e(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"),Ydn=B(e=>{const t=Pd.detectInit(e)??{},n=Pd.detectDirective(e,"wrap");return Array.isArray(n)?t.wrap=n.some(({type:r})=>r==="wrap"):n?.type==="wrap"&&(t.wrap=!0),{text:Eon(e),directive:t}},"processDirectives");function Boe(e){const t=Bdn(e),n=Fdn(t),r=Ydn(n.text),s=woe(n.config,r.directive);return e=zdn(r.text),{code:e,title:n.title,config:s}}B(Boe,"preprocessDiagram");function I6e(e){const t=new TextEncoder().encode(e),n=Array.from(t,r=>String.fromCodePoint(r)).join("");return btoa(n)}B(I6e,"toBase64");var Vdn=5e4,qdn="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",Wdn="sandbox",Gdn="loose",Hdn="http://www.w3.org/2000/svg",Zdn="http://www.w3.org/1999/xlink",Kdn="http://www.w3.org/1999/xhtml",Jdn="100%",epn="100%",tpn="border:0;margin:0;",npn="margin:0",rpn="allow-top-navigation-by-user-activation allow-popups",spn='The "iframe" tag is not supported by your browser.',ipn=["foreignobject"],opn=["dominant-baseline"];function Foe(e){const t=Boe(e);return m5(),SKt(t.config??{}),t}B(Foe,"processAndSetConfigs");async function M6e(e,t){m3();try{const{code:n,config:r}=Foe(e);return{diagramType:(await D6e(n)).type,config:r}}catch(n){if(t?.suppressErrors)return!1;throw n}}B(M6e,"parse");var Aye=B((e,t,n=[])=>`
|
|
1346
1346
|
.${e} ${t} { ${n.join(" !important; ")} !important; }`,"cssImportantStyles"),apn=B((e,t=new Map)=>{let n="";if(e.themeCSS!==void 0&&(n+=`
|
|
@@ -1661,7 +1661,7 @@ ${tt}`.slice(0,2e3);f?.(Ce,ve)},[tn,e.from,e.summary,e,f,$,Q]),On=D&&x,Lt=On&&!T
|
|
|
1661
1661
|
|
|
1662
1662
|
已隐藏 CLI 流中的原始载荷,因为其中包含编码或类似二进制的内容。
|
|
1663
1663
|
|
|
1664
|
-
请展开下面的 **CLI 日志** 查看可读诊断。`:null}const h2n=({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:g,assistantOutput:_,launchDiagnostics:b,surface:y="raised",className:x})=>{const S=p2n(h,c),[v,T]=O.useState(()=>i??!1),[E,w]=O.useState(!1),[P,C]=O.useState(s),k=O.useRef(null),I=r==="error",Q=f2n(_,I),$=b?.filter(R=>R.severity==="warning"||R.severity==="error")??[];return O.useEffect(()=>{P&&k.current&&(k.current.scrollTop=k.current.scrollHeight)},[_,P]),O.useEffect(()=>{C(s)},[s]),O.useEffect(()=>{i!==void 0&&T(i)},[i]),O.useEffect(()=>{I&&g&&(T(!0),C(!1))},[I,g]),u.jsxs("div",{className:st(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(zn,{size:14,className:"shrink-0 text-amber-400"}):p==="info"?u.jsx(Gs,{size:14,className:"shrink-0 text-sky-400"}):u.jsx(ma,{size:14,className:"shrink-0 text-[var(--step-done-text)]"}),u.jsx("p",{className:st("flex-1 text-xs",p==="warning"?"text-amber-400":p==="info"?"text-sky-400":"text-[var(--step-success-text)]"),children:d}),f?u.jsx(Me,{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(Pr,{size:12})}):null]}):f?u.jsx("div",{className:"flex justify-end",children:u.jsx(Me,{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(Pr,{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(zt,{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(Me,{variant:"outline",size:"sm",className:"h-6 shrink-0 px-2 text-xs",onClick:l,children:"取消"}):null]}),t?u.jsx("p",{className:st("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(lKe,{steps:u2n,currentIndex:o,errorIndex:a})}),$.length>0?u.jsxs("div",{className:"mt-2",children:[u.jsxs("button",{type:"button",className:"flex items-center gap-1 text-[11px] text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:()=>w(R=>!R),children:[E?u.jsx(Dr,{size:12}):u.jsx(Bn,{size:12}),"诊断"]}),E?u.jsx("div",{className:"mt-1 space-y-1 rounded border border-[var(--color-border)] bg-[var(--color-surface)] p-2",children:$.map(R=>u.jsxs("div",{className:"text-[11px]",children:[u.jsx("div",{className:st(R.severity==="error"?"text-red-400":R.severity==="warning"?"text-amber-400":"text-[var(--color-text-secondary)]"),children:R.label}),R.detail?u.jsx("div",{className:"mt-0.5 text-[10px] text-[var(--color-text-muted)]",children:R.detail}):null]},R.id))}):null]}):null,u.jsxs("div",{className:"mt-2",children:[u.jsxs("button",{type:"button",className:"flex items-center gap-1 text-[11px] text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:()=>C(R=>!R),children:[P?u.jsx(Dr,{size:12}):u.jsx(Bn,{size:12}),"实时输出"]}),P?u.jsx("div",{ref:k,className:st("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:Q?u.jsx(Ks,{content:Q,bare:!0,maxHeight:"max-h-none"}):u.jsx("p",{className:st("text-[11px]",I?"text-[var(--step-error-text-dim)]":"text-[var(--color-text-muted)]"),children:"暂无输出。"})}):null]}),g?u.jsxs("div",{className:"mt-2",children:[u.jsxs("button",{type:"button",className:"flex items-center gap-1 text-[11px] text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:()=>T(R=>!R),children:[v?u.jsx(Dr,{size:12}):u.jsx(Bn,{size:12}),"CLI 日志"]}),v?u.jsx(fKe,{cliLogsTail:g,order:"newest-first",className:"mt-1"}):null]}):null]})};function hKe(e){const{progress:t,cancelProvisioning:n,cancelCurrentProvisioning:r,teamMembers:s,memberSpawnStatuses:i,memberSpawnSnapshot:o}=re(vt(c=>({progress:Ef(c,e),cancelProvisioning:c.cancelProvisioning,cancelCurrentProvisioning:c.cancelCurrentProvisioning,teamMembers:Use(c,e),memberSpawnStatuses:c.memberSpawnStatusesByTeam[e],memberSpawnSnapshot:c.memberSpawnSnapshotsByTeam[e]})));return{presentation:O.useMemo(()=>Ale({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 mKe=O.memo(function({teamName:t,surface:n="flat",dismissible:r=!1,className:s,defaultLogsOpen:i}){const{presentation:o,cancelProvisioning:a,cancelCurrentProvisioning:c,runInstanceKey:l}=hKe(t),[d,p]=O.useState(!1),f=O.useRef(-1);if(O.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(h2n,{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:st("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(Me,{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(Pr,{size:12})}):null]}),m]}):m}),m2n=bie.map(e=>({key:e.key,label:e.label})),g2n={"--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 O2n(e){return e!=null&&(e.isActive||e.isFailed)}const _2n=({teamName:e,enabled:t=!0})=>{const{presentation:n,runInstanceKey:r}=hKe(e),s=O.useRef(-1),[i,o]=O.useState(!1),a=t&&O2n(n),c=n?.isFailed?s.current>=0?s.current:0:void 0;O.useEffect(()=>{o(!1),s.current=-1},[r,e]),O.useEffect(()=>{n&&!n.isFailed&&n.currentStepIndex>=0&&(s.current=n.currentStepIndex)},[n]);const l=O.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:g2n,children:u.jsx(lKe,{steps:m2n,currentIndex:n.currentStepIndex,errorIndex:c,className:"w-full origin-top scale-[0.88]"})}),u.jsx("span",{className:"sr-only",children:l})]}),u.jsx(us,{open:i,onOpenChange:o,children:u.jsxs(ts,{className:"w-[min(1120px,92vw)] max-w-5xl p-0",children:[u.jsxs(ds,{className:"sr-only",children:[u.jsx(ns,{children:"启动详情"}),u.jsx(oi,{children:"查看团队启动进度、实时输出和 CLI 日志。"})]}),u.jsx("div",{className:"max-h-[85vh] overflow-y-auto p-4",children:u.jsx(mKe,{teamName:e,surface:"flat",defaultLogsOpen:!0})})]})})]})};function b2n(e,t){if(t.relatedTaskId)return[{taskId:t.relatedTaskId,displayId:t.relatedTaskDisplayId??t.relatedTaskId.slice(0,8),teamName:e}]}function y2n(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 x2n(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 S2n(e,t){const n=t.kind==="task_comment"?"task_comment_notification":"default",r=b2n(e,t);return{from:t.sourceLabel,to:t.destinationLabel,text:x2n(t),timestamp:new Date(t.updatedAt*1e3).toISOString(),read:!0,summary:y2n(t),color:t.color,messageId:`graph-handoff:${t.key}`,source:"inbox",messageKind:n,taskRefs:r}}const Dwe=Nd.width,v2n=72,T2n=10,E2n=({teamName:e,getTransientHandoffSnapshot:t=()=>({cards:[],time:0}),getCameraZoom:n=()=>1,worldToScreen:r,getNodeWorldPosition:s=()=>null,focusNodeIds:i,focusEdgeIds:o,enabled:a=!0})=>{const c=O.useRef(null),l=O.useRef(new Map),d=O.useRef(""),[p,f]=O.useState([]),{teamData:h,teams:m}=GN(e),g=O.useMemo(()=>YN(h?.members),[h?.members]),{teamNames:_,teamColorByName:b}=Gle(m);O.useEffect(()=>{d.current="",f([])},[e]),O.useLayoutEffect(()=>{if(!a){f([]);return}let x=0;const S=()=>{const v=t({focusNodeIds:i,focusEdgeIds:o}),T=v.cards.filter(C=>C.anchorKind==="lead"||C.anchorKind==="member"),E=T.map(C=>`${C.key}:${C.count}:${C.updatedAt}:${C.anchorNodeId}`).join("|");E!==d.current&&(d.current=E,f(T));const w=c.current;if(w&&r){const C=r(0,0),k=Math.max(n(),.001);w.style.transform=`translate(${Math.round(C.x)}px, ${Math.round(C.y)}px) scale(${k.toFixed(3)})`}const P=new Map;for(const C of T){const k=l.current.get(C.key);if(!k)continue;const I=s(C.anchorNodeId),Q=oZe(C,v.time);if(!I||!r||Q<=.001){k.style.opacity="0";continue}const $=P.get(C.anchorNodeId)??0;P.set(C.anchorNodeId,$+1);const R=$*(v2n*.34+T2n),N=.94+Q*.06;k.style.left=`${Math.round(I.x)}px`,k.style.top=`${Math.round(I.y)}px`,k.style.opacity=String(Q),k.style.transform=`translate(-50%, calc(-50% - ${R.toFixed(1)}px)) scale(${N.toFixed(3)})`}x=window.requestAnimationFrame(S)};return S(),()=>{window.cancelAnimationFrame(x)}},[a,o,i,n,s,t,r]);const y=O.useMemo(()=>p.map((x,S)=>({card:x,message:S2n(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:`${Dwe}px`,maxWidth:`${Dwe}px`},onDragStart:T=>{T.preventDefault()},children:u.jsx(oKe,{message:S,teamName:e,messageContext:g,teamNames:_,teamColorByName:b,zebraShade:v,className:"pointer-events-none drop-shadow-[0_0_22px_rgba(94,234,212,0.12)]"})},x.key))})},w2n=O.lazy(()=>De(()=>import("./TeamGraphOverlay-PB9luAZU.js"),__vite__mapDeps([60,1])).then(e=>({default:e.TeamGraphOverlay}))),k2n=({teamName:e,isActive:t=!0,isPaneFocused:n=!1})=>{const r=jMn(e),{openTeamPage:s,commitOwnerSlotDrop:i,commitOwnerGridOrderDrop:o,setLayoutMode:a}=XMn(e),[c,l]=O.useState(!1),{sidebarVisible:d,toggleSidebarVisible:p}=LMn(),{dialog:f,openCreateTaskDialog:h}=QMn(e),m=O.useCallback(I=>window.dispatchEvent(new CustomEvent("graph:open-task",{detail:{teamName:e,taskId:I}})),[e]),g=O.useCallback(I=>window.dispatchEvent(new CustomEvent("graph:send-message",{detail:{teamName:e,memberName:I}})),[e]),_=O.useCallback((I,Q)=>window.dispatchEvent(new CustomEvent("graph:open-profile",{detail:{teamName:e,memberName:I,...Q}})),[e]),b=O.useCallback(()=>{h("")},[h]),y=O.useCallback(I=>Q=>window.dispatchEvent(new CustomEvent(`graph:${I}`,{detail:{teamName:e,taskId:Q}})),[e]),x=O.useMemo(()=>y("start-task"),[y]),S=O.useMemo(()=>y("complete-task"),[y]),v=O.useMemo(()=>y("approve-task"),[y]),T=O.useMemo(()=>y("request-review"),[y]),E=O.useMemo(()=>y("request-changes"),[y]),w=O.useMemo(()=>y("cancel-task"),[y]),P=O.useMemo(()=>y("move-back-to-done"),[y]),C=O.useMemo(()=>y("delete-task"),[y]),k={onNodeDoubleClick:O.useCallback(I=>{I.kind==="task"?m(I.taskId):I.kind==="member"&&_(I.memberName)},[m,_]),onSendMessage:g,onOpenTaskDetail:m,onOpenMemberProfile:O.useCallback(I=>{_(I)},[_])};return u.jsxs("div",{className:"flex size-full overflow-hidden",style:{background:"#050510"},children:[d?u.jsx(CMn,{teamName:e,surface:"graph-tab",isActive:t,isFocused:n}):null,u.jsx("div",{className:"min-w-0 flex-1",children:u.jsx(OMn,{data:r,events:k,className:"team-graph-view size-full",suspendAnimation:!t,isSurfaceActive:t,onRequestFullscreen:()=>l(!0),onOpenTeamPage:s,onCreateTask:b,onToggleSidebar:p,isSidebarVisible:d,renderTopToolbarContent:()=>u.jsx(_2n,{teamName:e,enabled:t}),onLayoutModeChange:a,onOwnerSlotDrop:i,onOwnerGridOrderDrop:o,renderHud:I=>{const Q=I,{getViewportSize:$,focusNodeIds:R,filters:N}=Q;return u.jsxs(u.Fragment,{children:[u.jsx(E2n,{teamName:e,getTransientHandoffSnapshot:Q.getTransientHandoffSnapshot,getCameraZoom:Q.getCameraZoom,worldToScreen:Q.worldToScreen,getNodeWorldPosition:Q.getNodeWorldPosition,focusNodeIds:R,focusEdgeIds:Q.focusEdgeIds??null,enabled:t}),u.jsx(jQn,{teamName:e,nodes:r.nodes,getActivityWorldRect:Q.getActivityWorldRect,getCameraZoom:Q.getCameraZoom,worldToScreen:Q.worldToScreen,getNodeWorldPosition:Q.getNodeWorldPosition,getViewportSize:$,focusNodeIds:R,enabled:t&&(N?.showActivity??!0),onOpenTaskDetail:m,onOpenMemberProfile:_})]})},renderEdgeOverlay:({edge:I,sourceNode:Q,targetNode:$,onClose:R,onSelectNode:N})=>u.jsx(XQn,{teamName:e,edge:I,sourceNode:Q,targetNode:$,onClose:R,onSelectNode:N,onOpenTaskDetail:m}),renderOverlay:({node:I,onClose:Q})=>u.jsx(ZQn,{node:I,teamName:e,onClose:Q,onSendMessage:g,onOpenTaskDetail:m,onOpenMemberProfile:_,onCreateTask:h,onStartTask:x,onCompleteTask:S,onApproveTask:v,onRequestReview:T,onRequestChanges:E,onCancelTask:w,onMoveBackToDone:P,onDeleteTask:C})})}),f,c&&u.jsx(O.Suspense,{fallback:null,children:u.jsx(w2n,{teamName:e,onClose:()=>l(!1),sidebarVisible:d,onToggleSidebar:p,onSendMessage:g,onOpenTaskDetail:m,onOpenMemberProfile:_})})]})};function Oee(e){return/^[A-Za-z]:[/\\]/.test(e)||e.startsWith("\\\\")||e.startsWith("//")}function C2n(e){return e.includes("\\")&&!e.includes("/")?"\\":"/"}function Lwe(e,t){const n=C2n(e);return e.replace(/[/\\]$/,"")+n+t.replace(/[/\\]/g,n)}function qP(e,t,n=40){let r=e;if(t){const l=t.replace(/[/\\]$/,""),d=Oee(r)||Oee(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 R2n(e){return(/^(\/Users\/[^/]+)/.exec(e)??/^(\/home\/[^/]+)/.exec(e)??/^([A-Z]:\\Users\\[^\\]+)/i.exec(e))?.[1]??null}function _ee(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(P2n(e)){const n=al(t);if(n.length>=3){const r=n.slice(3).join("/");return r?`~/${r}`:"~"}}return t}function P2n(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 rX(e,t){let n=e;if((n.startsWith("~/")||n.startsWith("~\\"))&&t){const r=R2n(t);r&&(n=Lwe(r,n.slice(2)))}return t&&!n.startsWith("/")&&!n.startsWith("~")&&!Oee(n)&&(n=Lwe(t,n)),n}const jwe=["anthropic","codex","gemini"];function $2n(e){return[...e].sort((t,n)=>jwe.indexOf(t)-jwe.indexOf(n))}function N2n(e,t){const n=e.associatedPaths.reduce((r,s)=>{const i=t.get(dr(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 A2n(e,t){const n=new Set,r=[];for(const s of e.associatedPaths){const i=t.get(dr(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 I2n(e){const t=[e.primaryPath,...e.associatedPaths].filter(Boolean),n=Array.from(new Set(t));if(!(n.length<=1))return{badgeLabel:`${n.length} 个路径`,description:"此卡片合并了相关 worktree 和项目路径的最近活动。",paths:n.map((r,s)=>({label:s===0?"主路径":`相关路径 ${s}`,fullPath:r}))}}function M2n({projects:e,taskCountsByProject:t,activeTeamsByProject:n,tasksLoading:r}){return e.map(s=>({id:s.id,project:s,name:s.name,formattedPath:_ee(s.primaryPath),lastActivityLabel:ST(new Date(s.mostRecentActivity),{addSuffix:!0,locale:pUe}),providerIds:$2n(s.providerIds),primaryBranch:s.primaryBranch,taskCounts:N2n(s,t),tasksLoading:r,activeTeams:A2n(s,n),additionalPathCount:Math.max(0,s.associatedPaths.length-1),pathSummary:I2n(s)}))}function Q2n({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=dr(l.projectPath),p=a.get(d);p?p.push(l):a.set(d,[l])}return a}const gKe="tmp",D2n=`/${gKe}/`,L2n=`/private/${gKe}/`;function j2n(e){return e.trim().replace(/\\/g,"/").toLowerCase()}function X2n(e){const t=e.split("/").filter(Boolean);return t[t.length-1]??""}function U2n(e){return e.startsWith("/private/var/folders/")||e.startsWith("/var/folders/")||e.startsWith(L2n)||e.startsWith(D2n)||e.includes("/appdata/local/temp/")||e.includes("/appdata/locallow/temp/")}function Wl(e){const t=j2n(e??"");return t?t.includes("rendered_mcp_")||t.includes("rendered_mcp_config")||t.includes("/portable-mcp-live")?!0:X2n(t).startsWith("codex-agent-teams-appstyle-")&&U2n(t):!1}const OKe="recent-projects:open-history",bee="recent-projects:open-history-changed",z2n=1e3*60*60*48,B2n=120;function _Ke(){return typeof window<"u"&&typeof window.localStorage<"u"}function pB(e){let t=e.trim().replace(/\\/g,"/");if(!t||Wl(t))return null;if(t!=="/"&&!/^[A-Za-z]:\/$/.test(t))for(;t.endsWith("/");)t=t.slice(0,-1);return t}function bKe(e){return e.toLowerCase()}function yKe(){if(!_Ke())return{version:1,entries:[]};try{const e=window.localStorage.getItem(OKe);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 F2n(e){const t=new Map;for(const n of e){const r=pB(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,B2n)}function Y2n(e){if(!_Ke())return;const t={version:1,entries:F2n(e)};try{window.localStorage.setItem(OKe,JSON.stringify(t)),window.dispatchEvent(new CustomEvent(bee))}catch{}}function V2n(){const e=new Map,t=new Map;for(const n of yKe().entries){const r=pB(n.path);if(!r)continue;e.set(r,Math.max(e.get(r)??0,n.openedAt));const s=bKe(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 q2n(e,t){const n=pB(t);if(!n)return 0;const r=e.exact.get(n);if(r!=null)return r;const s=e.folded.get(bKe(n));return s?.exactPaths.size!==1?0:s.openedAt}function Xwe(e,t){return[t.primaryPath,...t.associatedPaths].reduce((n,r)=>Math.max(n,q2n(e,r)),0)}function sX(e,t=Date.now()){const n=Array.from(new Set(e.map(s=>pB(s)).filter(s=>!!s)));if(n.length===0)return;const r=yKe().entries;Y2n([...r,...n.map(s=>({path:s,openedAt:t}))])}function W2n(e,t=Date.now()){const n=V2n(),r=s=>s>0&&t-s<=z2n;return[...e].sort((s,i)=>{const o=Xwe(n,s),a=Xwe(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 G2n(e){if(typeof window>"u")return()=>{};const t=()=>e();return window.addEventListener(bee,t),()=>{window.removeEventListener(bee,t)}}function xKe(e){return e?Array.isArray(e)?{projects:e,degraded:!1}:Array.isArray(e.projects)?{projects:e.projects,degraded:e.degraded===!0}:null:null}const H2n=15e3,Z2n=3e4;let z2=null,yee=0,ww=null;function B2(){const e=xKe(z2);if(!e)return null;z2!==e&&(z2=e);const t=e.degraded?Z2n:H2n;return{payload:e,fetchedAt:yee,isStale:Date.now()-yee>t}}async function K2n(e,t){const n=t?.force??!1,r=B2();if(!n&&r&&!r.isStale)return r.payload;if(ww)return ww;const s=e().then(i=>{const o=xKe(i);return z2=o,yee=Date.now(),o??{projects:[],degraded:!0}}).finally(()=>{ww===s&&(ww=null)});return ww=s,s}function Uwe(e,t){const n=new Set(t.map(r=>dr(r)));for(const r of e)for(const s of r.worktrees)if(n.has(dr(s.path)))return{repoId:r.id,worktreeId:s.id};return null}function SKe(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 J2n(e){const t=SKe(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 kw=to("Feature:RecentProjects:open");function eDn(){const{repositoryGroups:e,fetchRepositoryGroups:t,openTeamsTab:n}=re(vt(l=>({repositoryGroups:l.repositoryGroups,fetchRepositoryGroups:l.fetchRepositoryGroups,openTeamsTab:l.openTeamsTab}))),r=O.useCallback(l=>{re.setState(MU(l.repoId,l.worktreeId)),re.getState().fetchSessionsInitial(l.worktreeId),n()},[n]),s=O.useCallback(async(l,d)=>{const f=(d.length>0?d:[l]).filter(b=>!Wl(b));if(f.length===0){kw.warn("Skipped ephemeral recent project path",{path:l});return}const h=Uwe(e,f);if(h){r(h);return}await t();const m=re.getState().repositoryGroups,g=Uwe(m,f);if(g){r(g);return}if(Wl(l)){kw.warn("Skipped adding ephemeral recent project path",{path:l});return}await Z.config.addCustomProjectPath(l),re.setState(b=>({repositoryGroups:[J2n(l),...b.repositoryGroups]}));const _=SKe(l);r({repoId:_,worktreeId:_})},[t,r,e]),i=O.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=O.useCallback(async l=>{try{await i(l.openTarget,l.associatedPaths),sX([l.primaryPath,...l.associatedPaths])}catch(d){kw.error("Failed to open recent project",d)}},[i]),a=O.useCallback(async l=>{try{await Z.openPath(l,l)}catch(d){kw.error("Failed to open project path",d)}},[]),c=O.useCallback(async()=>{try{const d=(await Z.config.selectFolders())[0];if(!d)return;await s(d,[d]),sX([d])}catch(l){kw.error("Failed to select project folder",l)}},[s]);return{openRecentProject:o,openProjectPath:a,selectProjectFolder:c}}const tDn=11,nDn=8,rDn=3e4,sDn=12e4,iDn=3,oDn=8e3;function aDn(e){return new Promise((t,n)=>{const r=window.setTimeout(()=>{n(new Error("最近项目加载超时,请稍后重试。"))},oDn);e.then(s=>{window.clearTimeout(r),t(s)},s=>{window.clearTimeout(r),n(s)})})}function lDn(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 cDn(e,t=tDn){const{globalTasks:n,globalTasksInitialized:r,globalTasksLoading:s,fetchAllTasks:i,teams:o,provisioningRuns:a,currentProvisioningRunIdByTeam:c,provisioningSnapshotByTeam:l}=re(vt(q=>({globalTasks:q.globalTasks,globalTasksInitialized:q.globalTasksInitialized,globalTasksLoading:q.globalTasksLoading,fetchAllTasks:q.fetchAllTasks,teams:q.teams,provisioningRuns:q.provisioningRuns,currentProvisioningRunIdByTeam:q.currentProvisioningRunIdByTeam,provisioningSnapshotByTeam:q.provisioningSnapshotByTeam}))),d=O.useMemo(()=>B2(),[]),{openRecentProject:p,openProjectPath:f,selectProjectFolder:h}=eDn(),[m,g]=O.useState(d?.payload.projects??[]),[_,b]=O.useState(d?.payload.degraded??!1),[y,x]=O.useState(d?.payload.degraded?1:0),[S,v]=O.useState(d==null),[T,E]=O.useState(null),[w,P]=O.useState(t),[C,k]=O.useState([]),[I,Q]=O.useState(0),$=O.useRef(r),R=O.useRef(d?.payload.projects??[]),N=O.useMemo(()=>({currentProvisioningRunIdByTeam:c,provisioningRuns:a}),[c,a]),j=O.useMemo(()=>Object.keys(c).filter(q=>T_(N,q)),[c,N]),M=O.useMemo(()=>[...j].sort().join("\0"),[j]);O.useEffect(()=>{R.current=m},[m]);const U=O.useCallback(async q=>{R.current.length>0||B2()!=null||v(!0),E(null);try{const te=await aDn(K2n(()=>Z.getDashboardRecentProjects(),q));g(te.projects),b(te.degraded),x(H=>te.degraded?H+1:0)}catch(te){E(te instanceof Error?te.message:"最近项目加载失败")}finally{v(!1)}},[]);O.useEffect(()=>{const q=B2();q&&!q.isStale||U({force:q!=null})},[U]),O.useEffect(()=>{if(!_)return;const q=y<=iDn?rDn:sDn,ee=window.setTimeout(()=>{U({force:!0})},q);return()=>{window.clearTimeout(ee)}},[y,_,U]),O.useEffect(()=>{if(m.length===0||$.current||r){$.current=$.current||r;return}$.current=!0,i()},[i,r,m.length]),O.useEffect(()=>{let q=!1;return Z.teams.aliveList().then(ee=>{q||k(ee)}).catch(()=>{}),()=>{q=!0}},[M,o]),O.useEffect(()=>{e.trim()||P(t)},[t,e]),O.useEffect(()=>G2n(()=>Q(q=>q+1)),[]);const A=O.useMemo(()=>hSt(n),[n]),F=O.useMemo(()=>Q2n({teams:o,aliveTeamNames:C,provisioningTeamNames:j,provisioningSnapshotByTeam:l}),[C,l,j,o]),z=O.useMemo(()=>M2n({projects:W2n(m),taskCountsByProject:A,activeTeamsByProject:F,tasksLoading:s}),[F,s,I,m,A]),D=O.useMemo(()=>z.filter(q=>lDn(q.project,e)),[z,e]);return{cards:O.useMemo(()=>e.trim()?D:D.slice(0,w),[D,e,w]),loading:S,error:T,canLoadMore:!e.trim()&&D.length>w,isElectron:!1,loadMore:()=>P(q=>q+nDn),reload:U,openRecentProject:p,openProjectPath:f,selectProjectFolder:h}}const uDn=({card:e,onClick:t,onOpenPath:n})=>{const r=O.useMemo(()=>dHt(e.name),[e.name]),[s,i]=O.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(at,{children:[u.jsx(lt,{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(it,{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(Uy,{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(at,{children:[u.jsx(lt,{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(Fc,{className:"size-3"})})}),u.jsx(it,{side:"bottom",children:"打开"})]}),u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx("span",{className:"truncate",children:e.formattedPath})}),u.jsx(it,{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(E$,{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(zo,{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))]})]})},dDn=[60,66,50,55,75,45,40,65],pDn=[80,75,85,66,70,80,60,72],fDn=({searchQuery:e})=>{const{cards:t,loading:n,error:r,canLoadMore:s,isElectron:i,loadMore:o,reload:a,openRecentProject:c,openProjectPath:l}=cDn(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:`${dDn[p]}%`,backgroundColor:"var(--skeleton-base-light)"}}),u.jsx("div",{className:"mb-auto h-2.5 rounded-sm",style:{width:`${pDn[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(uDn,{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(Me,{variant:"outline",size:"sm",onClick:o,children:"加载更多"})})]})},hDn=["Claude Code","Cursor","Codex","Gemini","OpenCode","DeepSeek / IM"],mDn=["Feishu","Slack","Discord","DingTalk","WeCom","Telegram","Webhook / API"],gDn=()=>{const{openTeamsTab:e,openSettingsTab:t,teams:n,teamsLoading:r}=re(vt(i=>({openTeamsTab:i.openTeamsTab,openSettingsTab:i.openSettingsTab,teams:i.teams,teamsLoading:i.teamsLoading}))),s=!r&&n.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(rmt,{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(Emt,{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:hDn.map(i=>u.jsx("span",{className:"rounded-md border border-border bg-surface-overlay px-2 py-1 text-[11px] text-text-secondary",children:i},i))})]}),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(sMe,{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:mDn.map(i=>u.jsx("span",{className:"rounded-md border border-border bg-surface-overlay px-2 py-1 text-[11px] text-text-secondary",children:i},i))})]}),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(ac,{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.jsx("div",{className:"mb-8 flex items-center justify-center",children:u.jsxs("button",{onClick:e,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(ac,{className:"size-4"}),"选择团队"]})}),s?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:()=>t("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:()=>t("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:e,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.jsx("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:"最近项目"})}),u.jsx(fDn,{searchQuery:""})]})]})]})},zwe={search:"",categories:[],capabilities:[],installedOnly:!1};function ODn(){const[e,t]=O.useState("plugins"),[n,r]=O.useState(zwe),[s,i]=O.useState({field:"popularity",order:"desc"}),[o,a]=O.useState(null),[c,l]=O.useState(""),[d,p]=O.useState([]),[f,h]=O.useState(!1),[m,g]=O.useState([]),[_,b]=O.useState(null),[y,x]=O.useState(""),[S]=O.useState(!1),[v,T]=O.useState("name-asc"),[E,w]=O.useState(null),P=O.useRef(null),C=O.useRef(0);O.useEffect(()=>()=>{P.current&&clearTimeout(P.current),C.current+=1},[]),O.useEffect(()=>{e!=="plugins"&&o!==null&&a(null),e!=="mcp-servers"&&_!==null&&b(null),e!=="skills"&&E!==null&&w(null)},[e,_,o,E]);const k=O.useCallback(M=>{l(M);const U=++C.current;if(P.current&&clearTimeout(P.current),!M.trim()){p([]),g([]),h(!1);return}h(!0),P.current=setTimeout(()=>{if(!Z.mcpRegistry){C.current===U&&h(!1);return}Z.mcpRegistry.search(M).then(A=>{C.current===U&&(p(A.servers),g(A.warnings),h(!1))},()=>{C.current===U&&(h(!1),g(["Search failed"]))})},300)},[]),I=O.useCallback(M=>{r(U=>({...U,search:M}))},[]),Q=O.useCallback(M=>{r(U=>({...U,categories:U.categories.includes(M)?U.categories.filter(A=>A!==M):[...U.categories,M]}))},[]),$=O.useCallback(M=>{r(U=>({...U,capabilities:U.capabilities.includes(M)?U.capabilities.filter(A=>A!==M):[...U.capabilities,M]}))},[]),R=O.useCallback(()=>{r(M=>({...M,installedOnly:!M.installedOnly}))},[]),N=O.useCallback(()=>{r(zwe)},[]),j=O.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:Q,toggleCapability:$,toggleInstalledOnly:R,clearFilters:N,hasActiveFilters:j,mcpSearchQuery:c,mcpSearch:k,mcpSearchResults:d,mcpSearchLoading:f,mcpSearchWarnings:m,selectedMcpServerId:_,setSelectedMcpServerId:b,skillsSearchQuery:y,setSkillsSearchQuery:x,skillsInstalledOnly:S,skillsSort:v,setSkillsSort:T,selectedSkillId:E,setSelectedSkillId:w}}function _Dn(e){return Zse(e)}function bDn(e){return e.filter(t=>{const n=t.capabilities?.extensions;return n?n.plugins.ownership!=="provider-scoped"||n.mcp.ownership!=="provider-scoped"||n.skills.ownership!=="provider-scoped":!1})}function yDn(e){return e?.flavor==="agent_teams_orchestrator"}function xDn(e){switch(e){case"supported":return"支持";case"read-only":return"只读";default:return"不支持"}}function SDn(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 vKe(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 Bwe="Agent CLI";function ece(e,t=!1){return e?.flavor==="agent_teams_orchestrator"?!e.displayName||e.displayName==="agent_teams_orchestrator"?Bwe:e.displayName:e?.displayName?e.displayName:t?Bwe:"Agent CLI"}function Fwe(e,[t,n]){return Math.min(n,Math.max(t,e))}var vDn=[" ","Enter","ArrowUp","ArrowDown"],TDn=[" ","Enter"],by="Select",[fB,hB,EDn]=$We(by),[e1]=op(by,[EDn,O_]),mB=O_(),[wDn,M_]=e1(by),[kDn,CDn]=e1(by),TKe=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,g=mB(t),[_,b]=O.useState(null),[y,x]=O.useState(null),[S,v]=O.useState(!1),T=sae(l),[E,w]=hm({prop:r,defaultProp:s??!1,onChange:i,caller:by}),[P,C]=hm({prop:o,defaultProp:a,onChange:c,caller:by}),k=O.useRef(null),I=_?m||!!_.closest("form"):!0,[Q,$]=O.useState(new Set),R=Array.from(Q).map(N=>N.props.value).join(";");return u.jsx(lU,{...g,children:u.jsxs(wDn,{required:h,scope:t,trigger:_,onTriggerChange:b,valueNode:y,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:v,contentId:Aa(),value:P,onValueChange:C,open:E,onOpenChange:w,dir:T,triggerPointerDownPosRef:k,disabled:f,children:[u.jsx(fB.Provider,{scope:t,children:u.jsx(kDn,{scope:e.__scopeSelect,onNativeOptionAdd:O.useCallback(N=>{$(j=>new Set(j).add(N))},[]),onNativeOptionRemove:O.useCallback(N=>{$(j=>{const M=new Set(j);return M.delete(N),M})},[]),children:n})}),I?u.jsxs(WKe,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:p,value:P,onChange:N=>C(N.target.value),disabled:f,form:m,children:[P===void 0?u.jsx("option",{value:""}):null,Array.from(Q)]},R):null]})})};TKe.displayName=by;var EKe="SelectTrigger",wKe=O.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,i=mB(n),o=M_(EKe,n),a=o.disabled||r,c=rs(t,o.onTriggerChange),l=hB(n),d=O.useRef("touch"),[p,f,h]=HKe(g=>{const _=l().filter(x=>!x.disabled),b=_.find(x=>x.value===o.value),y=ZKe(_,g,b);y!==void 0&&o.onValueChange(y.value)}),m=g=>{a||(o.onOpenChange(!0),h()),g&&(o.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return u.jsx(S$,{asChild:!0,...i,children:u.jsx(hr.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":GKe(o.value)?"":void 0,...s,ref:c,onClick:bn(s.onClick,g=>{g.currentTarget.focus(),d.current!=="mouse"&&m(g)}),onPointerDown:bn(s.onPointerDown,g=>{d.current=g.pointerType;const _=g.target;_.hasPointerCapture(g.pointerId)&&_.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(m(g),g.preventDefault())}),onKeyDown:bn(s.onKeyDown,g=>{const _=p.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&f(g.key),!(_&&g.key===" ")&&vDn.includes(g.key)&&(m(),g.preventDefault())})})})});wKe.displayName=EKe;var kKe="SelectValue",CKe=O.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:i,placeholder:o="",...a}=e,c=M_(kKe,n),{onValueNodeHasChildrenChange:l}=c,d=i!==void 0,p=rs(t,c.onValueNodeChange);return ja(()=>{l(d)},[l,d]),u.jsx(hr.span,{...a,ref:p,style:{pointerEvents:"none"},children:GKe(c.value)?u.jsx(u.Fragment,{children:o}):i})});CKe.displayName=kKe;var RDn="SelectIcon",RKe=O.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return u.jsx(hr.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});RKe.displayName=RDn;var PDn="SelectPortal",PKe=e=>u.jsx(OE,{asChild:!0,...e});PKe.displayName=PDn;var yy="SelectContent",$Ke=O.forwardRef((e,t)=>{const n=M_(yy,e.__scopeSelect),[r,s]=O.useState();if(ja(()=>{s(new DocumentFragment)},[]),!n.open){const i=r;return i?Ti.createPortal(u.jsx(NKe,{scope:e.__scopeSelect,children:u.jsx(fB.Slot,{scope:e.__scopeSelect,children:u.jsx("div",{children:e.children})})}),i):null}return u.jsx(AKe,{...e,ref:t})});$Ke.displayName=yy;var _d=10,[NKe,Q_]=e1(yy),$Dn="SelectContentImpl",NDn=Fv("SelectContent.RemoveScroll"),AKe=O.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:g,avoidCollisions:_,...b}=e,y=M_(yy,n),[x,S]=O.useState(null),[v,T]=O.useState(null),E=rs(t,te=>S(te)),[w,P]=O.useState(null),[C,k]=O.useState(null),I=hB(n),[Q,$]=O.useState(!1),R=O.useRef(!1);O.useEffect(()=>{if(x)return hae(x)},[x]),fae();const N=O.useCallback(te=>{const[H,...G]=I().map(pe=>pe.ref.current),[ie]=G.slice(-1),ne=document.activeElement;for(const pe of te)if(pe===ne||(pe?.scrollIntoView({block:"nearest"}),pe===H&&v&&(v.scrollTop=0),pe===ie&&v&&(v.scrollTop=v.scrollHeight),pe?.focus(),document.activeElement!==ne))return},[I,v]),j=O.useCallback(()=>N([w,x]),[N,w,x]);O.useEffect(()=>{Q&&j()},[Q,j]);const{onOpenChange:M,triggerPointerDownPosRef:U}=y;O.useEffect(()=>{if(x){let te={x:0,y:0};const H=ie=>{te={x:Math.abs(Math.round(ie.pageX)-(U.current?.x??0)),y:Math.abs(Math.round(ie.pageY)-(U.current?.y??0))}},G=ie=>{te.x<=10&&te.y<=10?ie.preventDefault():x.contains(ie.target)||M(!1),document.removeEventListener("pointermove",H),U.current=null};return U.current!==null&&(document.addEventListener("pointermove",H),document.addEventListener("pointerup",G,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",H),document.removeEventListener("pointerup",G,{capture:!0})}}},[x,M,U]),O.useEffect(()=>{const te=()=>M(!1);return window.addEventListener("blur",te),window.addEventListener("resize",te),()=>{window.removeEventListener("blur",te),window.removeEventListener("resize",te)}},[M]);const[A,F]=HKe(te=>{const H=I().filter(ne=>!ne.disabled),G=H.find(ne=>ne.ref.current===document.activeElement),ie=ZKe(H,te,G);ie&&setTimeout(()=>ie.ref.current.focus())}),z=O.useCallback((te,H,G)=>{const ie=!R.current&&!G;(y.value!==void 0&&y.value===H||ie)&&(P(te),ie&&(R.current=!0))},[y.value]),D=O.useCallback(()=>x?.focus(),[x]),V=O.useCallback((te,H,G)=>{const ie=!R.current&&!G;(y.value!==void 0&&y.value===H||ie)&&k(te)},[y.value]),q=r==="popper"?xee:IKe,ee=q===xee?{side:a,sideOffset:c,align:l,alignOffset:d,arrowPadding:p,collisionBoundary:f,collisionPadding:h,sticky:m,hideWhenDetached:g,avoidCollisions:_}:{};return u.jsx(NKe,{scope:n,content:x,viewport:v,onViewportChange:T,itemRefCallback:z,selectedItem:w,onItemLeave:D,itemTextRefCallback:V,focusSelectedItem:j,selectedItemText:C,position:r,isPositioned:Q,searchRef:A,children:u.jsx(N3,{as:NDn,allowPinchZoom:!0,children:u.jsx(P3,{asChild:!0,trapped:y.open,onMountAutoFocus:te=>{te.preventDefault()},onUnmountAutoFocus:bn(s,te=>{y.trigger?.focus({preventScroll:!0}),te.preventDefault()}),children:u.jsx(mE,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:te=>te.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:u.jsx(q,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:te=>te.preventDefault(),...b,...ee,onPlaced:()=>$(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:bn(b.onKeyDown,te=>{const H=te.ctrlKey||te.altKey||te.metaKey;if(te.key==="Tab"&&te.preventDefault(),!H&&te.key.length===1&&F(te.key),["ArrowUp","ArrowDown","Home","End"].includes(te.key)){let ie=I().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);if(["ArrowUp","End"].includes(te.key)&&(ie=ie.slice().reverse()),["ArrowUp","ArrowDown"].includes(te.key)){const ne=te.target,pe=ie.indexOf(ne);ie=ie.slice(pe+1)}setTimeout(()=>N(ie)),te.preventDefault()}})})})})})})});AKe.displayName=$Dn;var ADn="SelectItemAlignedPosition",IKe=O.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,i=M_(yy,n),o=Q_(yy,n),[a,c]=O.useState(null),[l,d]=O.useState(null),p=rs(t,E=>d(E)),f=hB(n),h=O.useRef(!1),m=O.useRef(!0),{viewport:g,selectedItem:_,selectedItemText:b,focusSelectedItem:y}=o,x=O.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&l&&g&&_&&b){const E=i.trigger.getBoundingClientRect(),w=l.getBoundingClientRect(),P=i.valueNode.getBoundingClientRect(),C=b.getBoundingClientRect();if(i.dir!=="rtl"){const ne=C.left-w.left,pe=P.left-ne,Te=E.left-pe,_e=E.width+Te,be=Math.max(_e,w.width),Ie=window.innerWidth-_d,Se=Fwe(pe,[_d,Math.max(_d,Ie-be)]);a.style.minWidth=_e+"px",a.style.left=Se+"px"}else{const ne=w.right-C.right,pe=window.innerWidth-P.right-ne,Te=window.innerWidth-E.right-pe,_e=E.width+Te,be=Math.max(_e,w.width),Ie=window.innerWidth-_d,Se=Fwe(pe,[_d,Math.max(_d,Ie-be)]);a.style.minWidth=_e+"px",a.style.right=Se+"px"}const k=f(),I=window.innerHeight-_d*2,Q=g.scrollHeight,$=window.getComputedStyle(l),R=parseInt($.borderTopWidth,10),N=parseInt($.paddingTop,10),j=parseInt($.borderBottomWidth,10),M=parseInt($.paddingBottom,10),U=R+N+Q+M+j,A=Math.min(_.offsetHeight*5,U),F=window.getComputedStyle(g),z=parseInt(F.paddingTop,10),D=parseInt(F.paddingBottom,10),V=E.top+E.height/2-_d,q=I-V,ee=_.offsetHeight/2,te=_.offsetTop+ee,H=R+N+te,G=U-H;if(H<=V){const ne=k.length>0&&_===k[k.length-1].ref.current;a.style.bottom="0px";const pe=l.clientHeight-g.offsetTop-g.offsetHeight,Te=Math.max(q,ee+(ne?D:0)+pe+j),_e=H+Te;a.style.height=_e+"px"}else{const ne=k.length>0&&_===k[0].ref.current;a.style.top="0px";const Te=Math.max(V,R+g.offsetTop+(ne?z:0)+ee)+G;a.style.height=Te+"px",g.scrollTop=H-V+g.offsetTop}a.style.margin=`${_d}px 0`,a.style.minHeight=A+"px",a.style.maxHeight=I+"px",r?.(),requestAnimationFrame(()=>h.current=!0)}},[f,i.trigger,i.valueNode,a,l,g,_,b,i.dir,r]);ja(()=>x(),[x]);const[S,v]=O.useState();ja(()=>{l&&v(window.getComputedStyle(l).zIndex)},[l]);const T=O.useCallback(E=>{E&&m.current===!0&&(x(),y?.(),m.current=!1)},[x,y]);return u.jsx(MDn,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:T,children:u.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:u.jsx(hr.div,{...s,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});IKe.displayName=ADn;var IDn="SelectPopperPosition",xee=O.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=_d,...i}=e,o=mB(n);return u.jsx(cU,{...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)"}})});xee.displayName=IDn;var[MDn,tce]=e1(yy,{}),See="SelectViewport",MKe=O.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,i=Q_(See,n),o=tce(See,n),a=rs(t,i.onViewportChange),c=O.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(fB.Slot,{scope:n,children:u.jsx(hr.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:bn(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-_d*2,g=parseFloat(p.style.minHeight),_=parseFloat(p.style.height),b=Math.max(g,_);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})})})]})});MKe.displayName=See;var QKe="SelectGroup",[QDn,DDn]=e1(QKe),LDn=O.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Aa();return u.jsx(QDn,{scope:n,id:s,children:u.jsx(hr.div,{role:"group","aria-labelledby":s,...r,ref:t})})});LDn.displayName=QKe;var DKe="SelectLabel",LKe=O.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=DDn(DKe,n);return u.jsx(hr.div,{id:s.id,...r,ref:t})});LKe.displayName=DKe;var iX="SelectItem",[jDn,jKe]=e1(iX),XKe=O.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:i,...o}=e,a=M_(iX,n),c=Q_(iX,n),l=a.value===r,[d,p]=O.useState(i??""),[f,h]=O.useState(!1),m=rs(t,y=>c.itemRefCallback?.(y,r,s)),g=Aa(),_=O.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(jDn,{scope:n,value:r,disabled:s,textId:g,isSelected:l,onItemTextChange:O.useCallback(y=>{p(x=>x||(y?.textContent??"").trim())},[]),children:u.jsx(fB.ItemSlot,{scope:n,value:r,disabled:s,textValue:d,children:u.jsx(hr.div,{role:"option","aria-labelledby":g,"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:bn(o.onFocus,()=>h(!0)),onBlur:bn(o.onBlur,()=>h(!1)),onClick:bn(o.onClick,()=>{_.current!=="mouse"&&b()}),onPointerUp:bn(o.onPointerUp,()=>{_.current==="mouse"&&b()}),onPointerDown:bn(o.onPointerDown,y=>{_.current=y.pointerType}),onPointerMove:bn(o.onPointerMove,y=>{_.current=y.pointerType,s?c.onItemLeave?.():_.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:bn(o.onPointerLeave,y=>{y.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:bn(o.onKeyDown,y=>{c.searchRef?.current!==""&&y.key===" "||(TDn.includes(y.key)&&b(),y.key===" "&&y.preventDefault())})})})})});XKe.displayName=iX;var Ek="SelectItemText",UKe=O.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...i}=e,o=M_(Ek,n),a=Q_(Ek,n),c=jKe(Ek,n),l=CDn(Ek,n),[d,p]=O.useState(null),f=rs(t,b=>p(b),c.onItemTextChange,b=>a.itemTextRefCallback?.(b,c.value,c.disabled)),h=d?.textContent,m=O.useMemo(()=>u.jsx("option",{value:c.value,disabled:c.disabled,children:h},c.value),[c.disabled,c.value,h]),{onNativeOptionAdd:g,onNativeOptionRemove:_}=l;return ja(()=>(g(m),()=>_(m)),[g,_,m]),u.jsxs(u.Fragment,{children:[u.jsx(hr.span,{id:c.textId,...i,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Ti.createPortal(i.children,o.valueNode):null]})});UKe.displayName=Ek;var zKe="SelectItemIndicator",BKe=O.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return jKe(zKe,n).isSelected?u.jsx(hr.span,{"aria-hidden":!0,...r,ref:t}):null});BKe.displayName=zKe;var vee="SelectScrollUpButton",FKe=O.forwardRef((e,t)=>{const n=Q_(vee,e.__scopeSelect),r=tce(vee,e.__scopeSelect),[s,i]=O.useState(!1),o=rs(t,r.onScrollButtonChange);return ja(()=>{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(VKe,{...e,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});FKe.displayName=vee;var Tee="SelectScrollDownButton",YKe=O.forwardRef((e,t)=>{const n=Q_(Tee,e.__scopeSelect),r=tce(Tee,e.__scopeSelect),[s,i]=O.useState(!1),o=rs(t,r.onScrollButtonChange);return ja(()=>{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(VKe,{...e,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});YKe.displayName=Tee;var VKe=O.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,i=Q_("SelectScrollButton",n),o=O.useRef(null),a=hB(n),c=O.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return O.useEffect(()=>()=>c(),[c]),ja(()=>{a().find(d=>d.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),u.jsx(hr.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:bn(s.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:bn(s.onPointerMove,()=>{i.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:bn(s.onPointerLeave,()=>{c()})})}),XDn="SelectSeparator",qKe=O.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return u.jsx(hr.div,{"aria-hidden":!0,...r,ref:t})});qKe.displayName=XDn;var Eee="SelectArrow",UDn=O.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=mB(n),i=M_(Eee,n),o=Q_(Eee,n);return i.open&&o.position==="popper"?u.jsx(uU,{...s,...r,ref:t}):null});UDn.displayName=Eee;var zDn="SelectBubbleInput",WKe=O.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=O.useRef(null),i=rs(r,s),o=jZe(t);return O.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(hr.select,{...n,style:{...uIe,...n.style},ref:i,defaultValue:t})});WKe.displayName=zDn;function GKe(e){return e===""||e===void 0}function HKe(e){const t=BO(e),n=O.useRef(""),r=O.useRef(0),s=O.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=O.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return O.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,i]}function ZKe(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=BDn(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 BDn(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var FDn=TKe,KKe=wKe,YDn=CKe,VDn=RKe,qDn=PKe,JKe=$Ke,WDn=MKe,eJe=LKe,tJe=XKe,GDn=UKe,HDn=BKe,nJe=FKe,rJe=YKe,sJe=qKe;const qo=FDn,Wo=YDn,_o=O.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(KKe,{ref:r,className:st("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(VDn,{asChild:!0,children:u.jsx(Dr,{className:"size-4 opacity-50"})})]}));_o.displayName=KKe.displayName;const iJe=O.forwardRef(({className:e,...t},n)=>u.jsx(nJe,{ref:n,className:st("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(_E,{className:"size-4"})}));iJe.displayName=nJe.displayName;const oJe=O.forwardRef(({className:e,...t},n)=>u.jsx(rJe,{ref:n,className:st("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(Dr,{className:"size-4"})}));oJe.displayName=rJe.displayName;const bo=O.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>u.jsx(qDn,{children:u.jsxs(JKe,{ref:s,className:st("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(iJe,{}),u.jsx(WDn,{className:st("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),u.jsx(oJe,{})]})}));bo.displayName=JKe.displayName;const ZDn=O.forwardRef(({className:e,...t},n)=>u.jsx(eJe,{ref:n,className:st("px-2 py-1.5 text-sm font-semibold text-[var(--color-text-muted)]",e),...t}));ZDn.displayName=eJe.displayName;const qs=O.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(tJe,{ref:r,className:st("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(HDn,{children:u.jsx(qr,{className:"size-4"})})}),u.jsx(GDn,{children:t})]}));qs.displayName=tJe.displayName;const KDn=O.forwardRef(({className:e,...t},n)=>u.jsx(sJe,{ref:n,className:st("-mx-1 my-1 h-px bg-[var(--color-border)]",e),...t}));KDn.displayName=sJe.displayName;const JDn={mcp:[{value:"claudecode",label:"Claude Code"},{value:"cursor",label:"Cursor"}],skills:[{value:"claudecode",label:"Claude Code"},{value:"codex",label:"Codex"},{value:"gemini",label:"Gemini CLI"},{value:"opencode",label:"OpenCode"},{value:"cursor",label:"Cursor"}]},aJe=({capability:e,value:t,onChange:n,disabled:r})=>{const s=JDn[e];return u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(Zt,{className:"shrink-0 text-xs text-text-muted",children:"运行时"}),u.jsxs(qo,{value:t,onValueChange:n,disabled:r,children:[u.jsx(_o,{className:"h-8 w-40 text-xs",children:u.jsx(Wo,{placeholder:"选择运行时"})}),u.jsx(bo,{children:s.map(i=>u.jsx(qs,{value:i.value,className:"text-xs",children:i.label},i.value))})]})]})},eLn=/^[\w.-]{1,100}$/,tLn=[{value:"streamable-http",label:"Streamable HTTP"},{value:"sse",label:"SSE"},{value:"http",label:"HTTP"}],nLn=({open:e,onClose:t})=>{const n=re(N=>N.installCustomMcpServer),r=re(N=>N.cliStatus),s=Mse(r?.flavor),i=s==="global"?"user":s,[o,a]=O.useState(""),[c,l]=O.useState("stdio"),[d,p]=O.useState("claudecode"),[f,h]=O.useState(""),[m,g]=O.useState(""),[_,b]=O.useState(""),[y,x]=O.useState("streamable-http"),[S,v]=O.useState([]),[T,E]=O.useState(null),[w,P]=O.useState(!1),C=O.useRef(!1);O.useEffect(()=>{e&&!C.current&&(a(""),l("stdio"),h(""),g(""),b(""),x("streamable-http"),v([]),E(null),P(!1)),C.current=e},[e]);const k=async()=>{if(E(null),!o.trim()){E("Server name is required");return}if(!eLn.test(o)){E("Invalid server name. Use alphanumeric characters, dashes, underscores, dots.");return}let N;if(c==="stdio"){if(!f.trim()){E("npm package name is required");return}N={type:"stdio",npmPackage:f.trim(),npmVersion:m.trim()||void 0}}else{if(!_.trim()){E("Server URL is required");return}N={type:"http",url:_.trim(),transportType:y}}const j={serverName:o,scope:i,installSpec:N,envValues:{},headers:S.filter(M=>M.key.trim()&&M.value.trim()),harnessType:d};P(!0);try{await n(j),t()}catch(M){E(M instanceof Error?M.message:"安装失败")}finally{P(!1)}},I=()=>v(N=>[...N,{key:"",value:""}]),Q=N=>v(j=>j.filter((M,U)=>U!==N)),$=(N,j,M)=>v(U=>U.map((A,F)=>F===N?{...A,[j]:M}:A)),R=o.trim()&&(c==="stdio"?f.trim():_.trim())&&!w;return u.jsx(us,{open:e,onOpenChange:N=>!N&&t(),children:u.jsxs(ts,{className:"max-h-[85vh] w-full max-w-lg overflow-y-auto",children:[u.jsx(ds,{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(OU,{className:"size-4 text-text-muted"})}),u.jsxs("div",{children:[u.jsx(ns,{children:"添加自定义 MCP 服务器"}),u.jsx(oi,{children:"不通过目录,手动添加一个服务器。"})]})]})}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Zt,{htmlFor:"custom-name",className:"text-xs",children:"服务器名称"}),u.jsx(An,{id:"custom-name",value:o,onChange:N=>a(N.target.value),placeholder:"my-server",className:"h-8 text-sm",autoFocus:!0})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Zt,{className:"text-xs",children:"传输方式"}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(Me,{type:"button",variant:c==="stdio"?"default":"outline",size:"sm",onClick:()=>l("stdio"),children:"Stdio (npm)"}),u.jsx(Me,{type:"button",variant:c==="http"?"default":"outline",size:"sm",onClick:()=>l("http"),children:"HTTP / SSE"})]})]}),c==="stdio"&&u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Zt,{htmlFor:"custom-npm",className:"text-xs",children:"npm 包"}),u.jsx(An,{id:"custom-npm",value:f,onChange:N=>h(N.target.value),placeholder:"@example/mcp-server",className:"h-8 font-mono text-sm"})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Zt,{htmlFor:"custom-version",className:"text-xs",children:"版本(可选)"}),u.jsx(An,{id:"custom-version",value:m,onChange:N=>g(N.target.value),placeholder:"latest",className:"h-8 text-sm"})]})]}),c==="http"&&u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Zt,{htmlFor:"custom-url",className:"text-xs",children:"服务器 URL"}),u.jsx(An,{id:"custom-url",value:_,onChange:N=>b(N.target.value),placeholder:"https://api.example.com/mcp",className:"h-8 text-sm"})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Zt,{className:"text-xs",children:"传输类型"}),u.jsxs(qo,{value:y,onValueChange:N=>x(N),children:[u.jsx(_o,{className:"h-8 text-sm",children:u.jsx(Wo,{})}),u.jsx(bo,{children:tLn.map(N=>u.jsx(qs,{value:N.value,children:N.label},N.value))})]})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(Zt,{className:"text-xs",children:"请求头"}),u.jsxs(Me,{variant:"ghost",size:"sm",onClick:I,className:"h-6 px-1.5 text-xs",children:[u.jsx(oc,{className:"mr-1 size-3"}),"添加"]})]}),S.length>0&&u.jsx("div",{className:"max-h-32 space-y-2 overflow-y-auto",children:S.map((N,j)=>u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(An,{value:N.key,onChange:M=>$(j,"key",M.target.value),className:"h-7 w-32 text-xs",placeholder:"Header-Name"}),u.jsx(An,{value:N.value,onChange:M=>$(j,"value",M.target.value),className:"h-7 flex-1 text-xs",placeholder:"value"}),u.jsx(Me,{variant:"ghost",size:"icon",className:"size-7 text-red-400 hover:bg-red-500/10",onClick:()=>Q(j),children:u.jsx(Ai,{className:"size-3"})})]},j))})]})]}),u.jsx(aJe,{capability:"mcp",value:d,onChange:p}),T&&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:T}),u.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[u.jsx(Me,{variant:"ghost",size:"sm",onClick:t,children:"取消"}),u.jsx(Me,{size:"sm",disabled:!R,onClick:()=>void k(),children:w?"正在安装...":"安装"})]})]})]})})},rLn=({projectPath:e})=>{const[t,n]=O.useState("global"),[r,s]=O.useState([]),[i,o]=O.useState(!0),[a,c]=O.useState(!1),[l,d]=O.useState({}),[p,f]=O.useState(!1),h=O.useCallback(async()=>{o(!0);try{const T=t==="global"?Z.credentials?await Z.credentials.getSkillGlobalEnv("__global__"):{}:e&&Z.credentials?await Z.credentials.getProjectEnv(e):{},E={};for(const[k,I]of Object.entries(T))typeof I=="string"&&(E[k]=I);const w=new Map;if(Z.skills)try{const k=await Z.skills.list(e??void 0);for(const I of k)if(I.requiredEnv?.length)for(const Q of I.requiredEnv){const $=w.get(Q.name);$?($.from.push(I.name),Q.isRequired!==!1&&($.isRequired=!0)):w.set(Q.name,{name:Q.name,description:Q.description,isRequired:Q.isRequired!==!1,from:[I.name]})}}catch{}const P=new Set([...Object.keys(E),...w.keys()]),C=[];for(const[,k]of w)C.push({key:k.name,value:E[k.name]??"",source:k});for(const k of Object.keys(E))w.has(k)||C.push({key:k,value:E[k]});s(C)}catch{s([])}finally{o(!1),f(!1)}},[t,e]);O.useEffect(()=>{h()},[h]);const m=()=>{s(T=>[...T,{key:"",value:"",isNew:!0}]),f(!0)},g=T=>{s(E=>E.filter((w,P)=>P!==T)),f(!0)},_=(T,E,w)=>{s(P=>P.map((C,k)=>k===T?{...C,[E]:w}:C)),f(!0)},b=T=>{d(E=>({...E,[T]:!E[T]}))},y=async()=>{const T={};for(const E of r){const w=E.key.trim();w&&(T[w]=E.value)}c(!0);try{t==="global"?await Z.credentials?.saveSkillGlobalEnv("__global__",T):e&&await Z.credentials?.saveProjectEnv(e,T),await h()}catch{}finally{c(!1)}},S=r.filter(T=>T.source?.isRequired).filter(T=>!T.value.trim()),v=r.filter(T=>T.key.trim()&&T.value.trim()).length;return u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx(Zt,{className:"text-sm",children:"环境变量"}),u.jsxs("p",{className:"text-xs text-text-muted",children:["配置运行时环境变量,启动 agent 时自动注入。",t==="global"?"全局变量所有项目生效。":"项目变量仅当前项目生效并可覆盖全局。"]})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Me,{variant:"ghost",size:"icon",className:"size-7",onClick:()=>void h(),disabled:i,children:u.jsx(go,{className:`size-3.5 ${i?"animate-spin":""}`})}),u.jsxs(qo,{value:t,onValueChange:T=>n(T),children:[u.jsx(_o,{className:"h-8 w-28 text-xs",children:u.jsx(Wo,{})}),u.jsxs(bo,{children:[u.jsx(qs,{value:"global",children:"全局"}),u.jsx(qs,{value:"project",disabled:!e,children:e?"当前项目":"无项目"})]})]})]})]}),i?u.jsx("div",{className:"py-8 text-center text-xs text-text-muted",children:"扫描环境变量需求..."}):u.jsxs(u.Fragment,{children:[S.length>0&&u.jsxs("div",{className:"flex items-start 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(zn,{className:"mt-0.5 size-3.5 shrink-0"}),u.jsxs("span",{children:["缺少必填变量:",S.map(T=>T.key).join(", ")]})]}),u.jsx("div",{className:"space-y-3",children:r.map((T,E)=>u.jsxs("div",{className:"space-y-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(An,{value:T.key,onChange:w=>_(E,"key",w.target.value),className:"h-8 w-48 font-mono text-xs",placeholder:"ENV_VAR_NAME",disabled:!!T.source}),u.jsxs("div",{className:"relative flex-1",children:[u.jsx(An,{type:l[E]?"text":"password",value:T.value,onChange:w=>_(E,"value",w.target.value),className:"h-8 pr-8 text-xs",placeholder:T.source?.isRequired?"必填":"可选"}),u.jsx("button",{type:"button",onClick:()=>b(E),className:"hover:text-text-default absolute right-2 top-1/2 -translate-y-1/2 text-text-muted",children:l[E]?u.jsx(hU,{className:"size-3.5"}):u.jsx(Qb,{className:"size-3.5"})})]}),u.jsx(Me,{variant:"ghost",size:"icon",className:"size-8 shrink-0 text-red-400 hover:bg-red-500/10",onClick:()=>g(E),children:u.jsx(Ai,{className:"size-3.5"})})]}),T.source&&u.jsxs("div",{className:"flex items-center gap-2 pl-1 text-[11px] text-text-muted",children:[u.jsx("span",{className:`rounded px-1 py-0.5 font-medium ${T.source.isRequired?T.value.trim()?"bg-green-500/10 text-green-500":"bg-red-500/10 text-red-400":"bg-surface-raised text-text-muted"}`,children:T.source.isRequired?T.value.trim()?"已配置":"必填":"可选"}),u.jsxs("span",{children:["来自 ",T.source.from.join(", ")]}),T.source.description&&u.jsxs("span",{children:["— ",T.source.description]})]})]},E))}),u.jsxs(Me,{variant:"outline",size:"sm",onClick:m,className:"h-8 gap-1.5 text-xs",children:[u.jsx(oc,{className:"size-3.5"}),"添加变量"]}),r.length>0&&u.jsxs("div",{className:"flex items-center gap-3 text-xs text-text-muted",children:[u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx(ma,{className:"size-3 text-green-500"}),v," 已配置"]}),S.length>0&&u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx(Wh,{className:"size-3 text-red-400"}),S.length," 缺失"]})]}),r.length===0&&u.jsxs("div",{className:"py-6 text-center text-xs text-text-muted",children:["未检测到需要的环境变量。安装的 Skills 如果声明了所需变量,会自动出现在这里。",u.jsx("br",{}),"也可以手动添加。"]}),p&&u.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[u.jsx(Me,{variant:"ghost",size:"sm",onClick:h,children:"取消"}),u.jsx(Me,{size:"sm",onClick:()=>void y(),disabled:a,children:a?"保存中...":"保存"})]})]})]})},nce=({value:e,onChange:t,placeholder:n="Search...",debounceMs:r})=>{const[s,i]=O.useState(e),o=O.useRef(null);O.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),O.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(An,{type:"text",value:s,onChange:c=>a(c.target.value),placeholder:n,className:"pl-9 pr-8"}),s&&u.jsx(Me,{variant:"ghost",size:"icon",onClick:()=>a(""),className:"absolute right-1 top-1/2 size-7 -translate-y-1/2",children:u.jsx(Pr,{className:"size-3.5"})})]})},gB=({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}=re(vt(S=>({cliStatus:S.cliStatus,cliStatusLoading:S.cliStatusLoading}))),m=qg({isInstalled:t,cliStatus:c??d,cliStatusLoading:l??p,section:s}),g=i||!!m,[_,b]=O.useState(null);O.useEffect(()=>{(e==="idle"||e==="success")&&b(null)},[e]);const y=_??(t?"uninstall":"install");if(e==="pending")return u.jsxs(Me,{size:o,variant:"outline",disabled:!0,children:[u.jsx(zt,{className:"size-3.5 animate-spin"}),u.jsx("span",{className:"ml-1.5",children:y==="uninstall"?"正在移除...":"正在安装..."})]});if(e==="success")return u.jsxs(Me,{size:o,variant:"outline",disabled:!0,className:"text-green-400",children:[u.jsx(qr,{className:"size-3.5"}),u.jsx("span",{className:"ml-1.5",children:"完成"})]});if(e==="error"){const S=u.jsx(Me,{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:g,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(tc,{children:u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx("span",{tabIndex:0,children:S})}),u.jsx(it,{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(Me,{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:g,children:[u.jsx(Ai,{className:"size-3.5"}),u.jsx("span",{className:"ml-1.5",children:"卸载"})]}):u.jsx(Me,{size:o,variant:"default",onClick:S=>{S.stopPropagation(),b("install"),n()},disabled:g,children:"安装"});return m?u.jsx(tc,{children:u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx("span",{tabIndex:0,children:x})}),u.jsx(it,{className:"max-w-64",children:m})]})}):x},rce=({source:e})=>e==="official"?u.jsx($t,{className:"border-blue-500/30 bg-blue-500/10 text-blue-400",variant:"outline",children:"Official"}):e==="glama"?u.jsx($t,{className:"border-zinc-500/30 bg-zinc-500/10 text-zinc-400",variant:"outline",children:"Glama"}):u.jsx($t,{className:"border-orange-500/30 bg-orange-500/10 text-orange-400",variant:"outline",children:"Community"}),Ywe=({server:e,isInstalled:t,installedEntry:n,installedEntries:r=[],diagnostic:s,diagnosticsLoading:i,onClick:o,cliStatus:a,cliStatusLoading:c})=>{const l=re($=>$.cliStatus),d=a??l,p=Mse(d?.flavor),f=oP(e.id,p),h=re($=>$.mcpInstallProgress[f]??"idle"),m=re($=>$.installMcpServer),g=re($=>$.uninstallMcpServer),_=re($=>$.installErrors[f]),b=re($=>e.repositoryUrl?$.mcpGitHubStars[e.repositoryUrl]:void 0),y=!!e.installSpec,x=r.length?r:n?[n]:[],S=e.installSpec?.type==="http"||e.envVars.length>0||e.requiresAuth||(e.authHeaders?.length??0)>0,v=dC(e.name),T=x.find($=>$.scope===p)??null,E=pXe(x),w=t&&x.length===1&&T?.name===v&&!S,P=y&&(t?w:!S),[C,k]=O.useState(!1),I=!!e.iconUrl&&!C,Q=s?.status==="connected"?"border-emerald-500/30 bg-emerald-500/10 text-emerald-400":s?.status==="needs-authentication"?"border-amber-500/30 bg-amber-500/10 text-amber-400":s?.status==="failed"?"border-red-500/30 bg-red-500/10 text-red-400":"border-border bg-surface-raised text-text-muted";return u.jsxs("div",{role:"button",tabIndex:0,onClick:()=>o(e.id),onKeyDown:$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),o(e.id))},className:`relative flex w-full cursor-pointer flex-col gap-2 overflow-hidden rounded-lg border p-4 text-left transition-all duration-200 hover:border-border-emphasis hover:bg-surface-raised hover:shadow-[0_0_12px_rgba(255,255,255,0.02)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-border-emphasis)] ${t?"border-l-2 border-border border-l-emerald-500/30":"border-border"}`,children:[u.jsxs("div",{className:"flex items-start gap-2.5",children:[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:()=>k(!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(rce,{source:e.source})})]}),u.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[t&&u.jsx($t,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-400",variant:"outline",children:E??"Installed"}),t&&i&&!s&&u.jsx($t,{className:"border-border bg-surface-raised text-text-muted",variant:"outline",children:"Checking..."}),s&&u.jsx($t,{className:Q,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(SE,{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(Oft,{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(D0,{className:"size-3"}),"Auth"]}),e.version&&u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(dMe,{className:"size-3"}),e.version]}),e.updatedAt&&u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(_l,{className:"size-3"}),E3(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(opt,{className:"size-3"}),"Remote"]}),e.hostingType==="local"&&u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(tMe,{className:"size-3"}),"Local"]}),e.hostingType==="both"&&u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(BD,{className:"size-3"}),"Both"]}),e.repositoryUrl&&u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsxs("button",{className:"inline-flex items-center gap-1.5 text-text-muted transition-colors hover:text-text",onClick:$=>{$.stopPropagation(),Z.openExternal(e.repositoryUrl)},children:[u.jsx(Hpt,{className:"size-3.5"}),b!=null&&u.jsxs("span",{className:"inline-flex items-center gap-0.5",children:[u.jsx(cMe,{className:"size-3 fill-amber-400 text-amber-400"}),jhn(b)]})]})}),u.jsx(it,{side:"top",children:"Repository"})]}),e.websiteUrl&&u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx("button",{className:"inline-flex items-center text-text-muted transition-colors hover:text-text",onClick:$=>{$.stopPropagation(),Z.openExternal(e.websiteUrl)},children:u.jsx(BD,{className:"size-3.5"})})}),u.jsx(it,{side:"top",children:"Website"})]})]}),P&&u.jsx("div",{className:"shrink-0",children:u.jsx(gB,{state:h,isInstalled:t,section:"mcp",cliStatus:d,cliStatusLoading:c,onInstall:()=>m({registryId:e.id,serverName:v,scope:p,envValues:{},headers:[]}),onUninstall:()=>g(e.id,T?.name??v,p),size:"sm",errorMessage:_})}),y&&(!P||S)&&u.jsx("div",{className:"shrink-0",children:u.jsx(Me,{size:"sm",variant:"outline",onClick:$=>{$.stopPropagation(),o(e.id)},children:t?"Manage":"Configure"})})]})]})},sLn=({server:e,isInstalled:t,installedEntry:n,installedEntries:r=[],diagnostic:s,diagnosticsLoading:i,projectPath:o,open:a,onClose:c,cliStatus:l,cliStatusLoading:d})=>{const p=re(ue=>ue.cliStatus),f=l??p,h=Mse(f?.flavor),[m,g]=O.useState(h),_=e?oP(e.id,m,o):null,b=re(ue=>(_?ue.mcpInstallProgress[_]:void 0)??"idle"),y=re(ue=>ue.installMcpServer),x=re(ue=>ue.uninstallMcpServer),S=re(ue=>_?ue.installErrors[_]:void 0),v=re(ue=>e?.repositoryUrl?ue.mcpGitHubStars[e.repositoryUrl]:void 0),[T,E]=O.useState(""),[w,P]=O.useState("claudecode"),[C,k]=O.useState({}),[I,Q]=O.useState([]),[$,R]=O.useState(!1),[N,j]=O.useState(new Set),M=O.useRef({}),U=O.useRef(h),A=r.length?r:n?[n]:[],F=[{value:h,label:nOe(h,f?.flavor)},...h!=="user"&&A.some(ue=>ue.scope==="user")?[{value:"user",label:nOe("user",f?.flavor)}]:[],{value:"project",label:"项目"},{value:"local",label:"本地"}],z=dXe(A),D=A.find(ue=>ue.scope===m)??null,V=pXe(A),q=e?.envVars.map(ue=>ue.name).sort().join("\0")??"",ee=f?.flavor==="agent_teams_orchestrator"?"运行时状态":"Claude 状态",te=m0(m)?o??void 0:void 0;if(O.useEffect(()=>{!e||!a||(k(Object.fromEntries(e.envVars.map(ue=>[ue.name,""]))),Q((e.authHeaders??[]).map(ue=>({key:ue.key,value:"",secret:ue.isSecret,description:ue.description,isRequired:ue.isRequired,valueTemplate:ue.valueTemplate,locked:!0}))),E(z?.name??dC(e.name)),g(z?.scope??h),R(!1),j(new Set),M.current={})},[a,z?.name,z?.scope,e?.id]),O.useEffect(()=>{if(!a){U.current=h;return}const ue=U.current;ue!==h&&!z&&m===ue&&A2t(m)&&g(h),U.current=h},[h,a,z,m]),O.useEffect(()=>{!e||!a||!D||E(D.name)},[a,D,e]),O.useEffect(()=>{a&&m0(m)&&!o&&g(h)},[h,a,o,m]),O.useEffect(()=>{if(!e||!a||e.envVars.length===0||!Z.apiKeys)return;const ue=e.envVars.map(ae=>ae.name);Z.apiKeys.lookup(ue,te).then(ae=>{const $e=M.current,qe={};for(const ot of ae)qe[ot.envVarName]=ot.value;k(ot=>{const Ot={...ot};for(const[nt,Ge]of Object.entries($e))!(nt in qe)&&Ot[nt]===Ge&&(Ot[nt]="");for(const[nt,Ge]of Object.entries(qe))(!Ot[nt]||Ot[nt]===$e[nt])&&(Ot[nt]=Ge);return Ot}),j(new Set(Object.keys(qe))),M.current=qe},()=>{})},[te,q,a,e?.id]),!e)return u.jsx(u.Fragment,{});const H=!!e.installSpec,G=e.installSpec?.type==="http",ie=!!e.iconUrl&&!$,ne=e.installSpec?.type==="stdio"?`https://www.npmjs.com/package/${e.installSpec.npmPackage}`:null,pe=I.some(ue=>ue.locked),Te=e.envVars.some(ue=>ue.isRequired&&!C[ue.name]?.trim()),_e=I.some(ue=>ue.isRequired&&!ue.value.trim()),be=D!==null,Ie=D?.name??T,Se=D?.scope??m,oe=m0(m)&&!o,Oe=!T.trim()||Te||_e||oe,K=qg({isInstalled:!1,cliStatus:f,cliStatusLoading:d??!1,section:"mcp"}),Y=qg({isInstalled:!0,cliStatus:f,cliStatusLoading:d??!1,section:"mcp"}),W=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",se=()=>{y({registryId:e.id,serverName:T,scope:m,projectPath:m0(m)?o??void 0:void 0,envValues:C,headers:I,harnessType:w})},he=()=>{x(e.id,Ie,Se,m0(Se)?o??void 0:void 0)},we=()=>{Q(ue=>[...ue,{key:"",value:""}])},J=ue=>{Q(ae=>ae.filter(($e,qe)=>qe!==ue))},de=(ue,ae,$e)=>{Q(qe=>qe.map((ot,Ot)=>Ot===ue?{...ot,[ae]:$e}:ot))};return u.jsx(us,{open:a,onOpenChange:ue=>!ue&&c(),children:u.jsxs(ts,{className:"max-h-[85vh] max-w-2xl overflow-y-auto",children:[u.jsx(ds,{children:u.jsxs("div",{className:"flex items-start gap-3",children:[ie&&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:()=>R(!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(ns,{className:"truncate",children:e.name}),u.jsx(oi,{className:"mt-1",children:e.description})]}),u.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[t&&u.jsx($t,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-400",variant:"outline",children:V??"已安装"}),e.source!=="official"&&u.jsx(rce,{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(cMe,{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(Me,{variant:"link",className:"h-auto p-0 text-sm text-blue-400",onClick:()=>void Z.openExternal(ne),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(D0,{className:"size-4"}),"此服务器需要认证"]}),G&&!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 密钥。若安装后连接失败,请查看提供商文档。"}),be&&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:ee}),i&&!s?u.jsx($t,{className:"border-border bg-surface-raised text-text-muted",variant:"outline",children:"检查中..."}):s?u.jsx($t,{className:W,variant:"outline",children:s.statusLabel}):u.jsx($t,{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})]})]}),H&&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:be?"管理安装":"安装服务器"}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Zt,{htmlFor:"server-name",className:"text-xs",children:"服务器名称"}),u.jsx(An,{id:"server-name",value:T,onChange:ue=>E(ue.target.value),placeholder:"my-server",className:"h-8 text-sm",disabled:be})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Zt,{className:"text-xs",children:"范围"}),u.jsxs(qo,{value:m,onValueChange:ue=>g(ue),children:[u.jsx(_o,{className:"h-8 text-sm",children:u.jsx(Wo,{})}),u.jsx(bo,{children:F.map(ue=>u.jsx(qs,{value:ue.value,disabled:m0(ue.value)&&!o,children:ue.label},ue.value))})]})]}),u.jsx(aJe,{capability:"mcp",value:w,onChange:P,disabled:be}),e.envVars.length>0&&u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Zt,{className:"text-xs",children:"环境变量"}),u.jsx("div",{className:"space-y-2",children:e.envVars.map(ue=>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:ue.name}),u.jsx(An,{type:ue.isSecret?"password":"text",value:C[ue.name]??"",onChange:ae=>k($e=>({...$e,[ue.name]:ae.target.value})),className:"h-7 flex-1 text-xs",placeholder:ue.description??ue.name}),N.has(ue.name)&&C[ue.name]&&u.jsx("span",{className:"shrink-0 text-[10px] text-emerald-400",children:"已自动填充"})]},ue.name))})]}),G&&u.jsxs("div",{className:"space-y-1.5",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(Zt,{className:"text-xs",children:"请求头"}),u.jsxs(Me,{variant:"ghost",size:"sm",onClick:we,className:"h-6 px-1.5 text-xs",children:[u.jsx(oc,{className:"mr-1 size-3"}),pe?"添加自定义":"添加"]})]}),I.length>0&&u.jsx("div",{className:"space-y-2",children:I.map((ue,ae)=>u.jsxs("div",{className:"space-y-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[ue.locked?u.jsx("code",{className:"w-32 shrink-0 truncate text-xs text-blue-400",children:ue.key}):u.jsx(An,{value:ue.key,onChange:$e=>de(ae,"key",$e.target.value),className:"h-7 w-32 text-xs",placeholder:"Header-Name"}),u.jsx(An,{type:ue.secret?"password":"text",value:ue.value,onChange:$e=>de(ae,"value",$e.target.value),className:"h-7 flex-1 text-xs",placeholder:ue.valueTemplate??ue.description??"value"}),u.jsx(Me,{variant:"ghost",size:"icon",className:"size-7 text-red-400 hover:bg-red-500/10",onClick:()=>J(ae),disabled:ue.locked&&ue.isRequired,children:u.jsx(Ai,{className:"size-3"})})]}),(ue.description||ue.valueTemplate||ue.isRequired)&&u.jsx("p",{className:"text-[10px] text-text-muted",children:[ue.isRequired?"必填":null,ue.description,ue.valueTemplate].filter(Boolean).join(" • ")})]},ae))})]}),u.jsx("div",{className:"flex items-center justify-end gap-2 pt-1",children:be?u.jsxs(u.Fragment,{children:[u.jsxs(Me,{variant:"ghost",size:"sm",className:"border-red-500/30 text-red-400 hover:bg-red-500/10","data-testid":"uninstall-button",onClick:he,disabled:!!Y,children:[u.jsx(Ai,{className:"size-3.5"}),u.jsx("span",{className:"ml-1.5",children:"卸载"})]}),b==="pending"?u.jsxs(Me,{size:"default",disabled:!0,children:[u.jsx(zt,{className:"size-3.5 animate-spin"}),u.jsx("span",{className:"ml-1.5",children:"保存并重启中..."})]}):b==="success"?u.jsxs(Me,{size:"default",disabled:!0,className:"text-green-400",children:[u.jsx(qr,{className:"size-3.5"}),u.jsx("span",{className:"ml-1.5",children:"完成"})]}):b==="error"?u.jsxs("div",{className:"flex max-w-64 flex-col items-end gap-1",children:[u.jsx(tc,{children:u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx("span",{tabIndex:0,children:u.jsx(Me,{size:"default",variant:"outline",className:"border-red-500/30 text-red-400 hover:bg-red-500/10",onClick:se,disabled:Oe||!!K,children:"保存并重启"})})}),S&&u.jsx(it,{className:"max-w-64 text-red-300",children:S})]})}),S&&u.jsx("p",{className:"text-right text-[11px] leading-4 text-red-300",children:S})]}):u.jsx(Me,{size:"default","data-testid":"save-restart-button",onClick:se,disabled:Oe||!!K,children:"保存并重启"})]}):u.jsx(gB,{state:b,isInstalled:!1,section:"mcp",cliStatus:f,cliStatusLoading:d,onInstall:se,onUninstall:he,disabled:Oe,size:"default",errorMessage:S})})]}),!H&&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(SE,{className:"size-4"}),"工具(",e.tools.length,")"]}),u.jsx("div",{className:"max-h-48 space-y-1 overflow-y-auto",children:e.tools.map(ue=>u.jsxs("div",{className:"rounded-md bg-surface-raised p-2 text-xs",children:[u.jsx("code",{className:"font-mono text-text",children:ue.name}),ue.description&&u.jsx("p",{className:"mt-0.5 text-text-muted",children:ue.description})]},ue.name))})]}),u.jsxs("div",{className:"flex items-center gap-4",children:[e.repositoryUrl&&u.jsxs(Me,{variant:"link",className:"h-auto p-0 text-sm text-blue-400",onClick:()=>void Z.openExternal(e.repositoryUrl),children:[u.jsx(zd,{className:"mr-1 size-3.5"}),"仓库"]}),e.glamaUrl&&u.jsxs(Me,{variant:"link",className:"h-auto p-0 text-sm text-blue-400",onClick:()=>void Z.openExternal(e.glamaUrl),children:[u.jsx(zd,{className:"mr-1 size-3.5"}),"Glama"]}),e.websiteUrl&&u.jsxs(Me,{variant:"link",className:"h-auto p-0 text-sm text-blue-400",onClick:()=>void Z.openExternal(e.websiteUrl),children:[u.jsx(zd,{className:"mr-1 size-3.5"}),"网站"]})]})]})})},iLn=[{value:"name-asc",label:"Name A→Z"},{value:"name-desc",label:"Name Z→A"},{value:"tools-desc",label:"Most tools"}];function oLn(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 aLn=({projectPath:e,mcpSearchQuery:t,mcpSearch:n,mcpSearchResults:r,mcpSearchLoading:s,mcpSearchWarnings:i,selectedMcpServerId:o,setSelectedMcpServerId:a,cliStatus:c,cliStatusLoading:l})=>{const d=_T(e),{browseCatalog:p,browseNextCursor:f,browseLoading:h,browseError:m,mcpBrowse:g,installedServersByProjectPath:_,installedServersFallback:b,fetchMcpGitHubStars:y,mcpDiagnosticsByProjectPath:x,mcpDiagnosticsFallback:S,mcpDiagnosticsLoadingByProjectPath:v,mcpDiagnosticsLoadingFallback:T,mcpDiagnosticsErrorByProjectPath:E,mcpDiagnosticsErrorFallback:w,mcpDiagnosticsLastCheckedAtByProjectPath:P,mcpDiagnosticsLastCheckedAtFallback:C,runMcpDiagnostics:k,uninstallMcpServer:I,mcpInstallProgress:Q}=re(vt(Y=>({browseCatalog:Y.mcpBrowseCatalog,browseNextCursor:Y.mcpBrowseNextCursor,browseLoading:Y.mcpBrowseLoading,browseError:Y.mcpBrowseError,mcpBrowse:Y.mcpBrowse,installedServersByProjectPath:Y.mcpInstalledServersByProjectPath,installedServersFallback:Y.mcpInstalledServers,fetchMcpGitHubStars:Y.fetchMcpGitHubStars,mcpDiagnosticsByProjectPath:Y.mcpDiagnosticsByProjectPath,mcpDiagnosticsFallback:Y.mcpDiagnostics,mcpDiagnosticsLoadingByProjectPath:Y.mcpDiagnosticsLoadingByProjectPath,mcpDiagnosticsLoadingFallback:Y.mcpDiagnosticsLoading,mcpDiagnosticsErrorByProjectPath:Y.mcpDiagnosticsErrorByProjectPath,mcpDiagnosticsErrorFallback:Y.mcpDiagnosticsError,mcpDiagnosticsLastCheckedAtByProjectPath:Y.mcpDiagnosticsLastCheckedAtByProjectPath,mcpDiagnosticsLastCheckedAtFallback:Y.mcpDiagnosticsLastCheckedAt,runMcpDiagnostics:Y.runMcpDiagnostics,uninstallMcpServer:Y.uninstallMcpServer,mcpInstallProgress:Y.mcpInstallProgress}))),$=re(Y=>Y.cliStatus),R=re(Y=>Y.cliStatusLoading),N=c??$,j=l??R,M=_?.[d]??b??[],U=x?.[d]??S??{},A=v?.[d]??T??!1,F=E?.[d]??w??null,z=P?.[d]??C??null,[D,V]=O.useState("name-asc");O.useEffect(()=>{p.length===0&&!h&&!m&&g()},[p.length,m,h,g]);const q=O.useMemo(()=>N===null||typeof N>"u"?j?"正在检查运行时状态...":"正在检查运行时可用性...":N?.installed===!1?N.binaryPath&&N.launchError?"已找到配置的运行时,但启动失败。请前往首页修复或重新安装。":"需要配置运行时。请前往首页安装或修复。":null,[N,j]);O.useEffect(()=>{q||k(e??void 0)},[q,e,k]),O.useEffect(()=>{const Y=p.map(W=>W.repositoryUrl).filter(W=>!!W);Y.length>0&&y(Y)},[p,y]);const ee=t.trim().length>0,te=ee?r:p,H=ee?s:h,G=ee?i:[],ie=O.useMemo(()=>new Set(M.map(Y=>Y.name.toLowerCase())),[M]),ne=O.useMemo(()=>{const Y=new Map;for(const W of M){const se=W.name.toLowerCase();Y.set(se,[...Y.get(se)??[],W])}return Y},[M]),pe=Y=>ie.has(dC(Y.name)),Te=Y=>ne.get(dC(Y.name))??[],_e=Y=>dXe(Te(Y)),be=Y=>{const W=_e(Y);return W?U[tS(W.name,W.scope)]??U[tS(W.name)]??U[W.name]??null:null},Ie=O.useMemo(()=>Object.values(U).sort((Y,W)=>Y.name.localeCompare(W.name)),[U]),Se=Y=>{switch(Y){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"}},oe=O.useMemo(()=>oLn(te,D),[te,D]),Oe=ece(N,!0),K=O.useMemo(()=>o?oe.find(Y=>Y.id===o)??p.find(Y=>Y.id===o)??r.find(Y=>Y.id===o)??null:null,[oe,p,r,o]);return u.jsxs("div",{className:"flex flex-col gap-4",children:[u.jsxs("div",{className:"rounded-md border border-black/10 bg-surface-raised px-4 py-3 dark:border-white/10",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3",children:[u.jsxs("div",{children:[u.jsx("p",{className:"text-sm font-medium text-text",children:"MCP 健康状态"}),u.jsx("p",{className:"text-xs text-text-muted",children:A?u.jsxs(u.Fragment,{children:["正在通过 ",Oe," 检查已安装的 MCP 服务器..."]}):q||(z?`上次检查:${E3(new Date(z).toISOString())}`:u.jsx(u.Fragment,{children:"在此页面运行诊断,以验证已安装 MCP 的连接状态。"}))})]}),u.jsxs(Me,{variant:"outline",size:"sm",onClick:()=>void k(e??void 0),disabled:A||!!q,className:"whitespace-nowrap",children:[u.jsx(go,{className:`mr-1.5 size-3.5 ${A?"animate-spin":""}`}),A?"检查中...":"检查状态"]})]}),(A||Ie.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 诊断"}),Ie.length>0&&u.jsxs("span",{className:"text-xs text-text-muted",children:[Ie.length," 个服务器"]})]}),Ie.length>0?u.jsx("div",{className:"mcp-diagnostics-list max-h-[18.5rem] space-y-2 overflow-y-auto pr-1",children:Ie.map(Y=>{const W=oP(Y.name,Y.scope||"user",e),se=Q[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:Y.name}),Y.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:Y.scope})]}),u.jsx("p",{className:"truncate font-mono text-[11px] text-text-muted",title:Y.target,children:Y.target})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx($t,{className:Se(Y.status),variant:"outline",children:Y.statusLabel}),u.jsx(Me,{variant:"ghost",size:"sm",className:"size-6 p-0 text-red-300 hover:text-red-200",disabled:se,onClick:()=>{I(Y.name,Y.name,Y.scope||void 0,e??void 0)},title:`卸载 ${Y.name}`,children:u.jsx(Ai,{className:"size-3.5"})})]})]},tS(Y.name,Y.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(nce,{value:t,onChange:n,placeholder:"搜索 MCP 服务器..."})}),u.jsxs(qo,{value:D,onValueChange:Y=>V(Y),children:[u.jsx(_o,{className:"w-36",children:u.jsx(Wo,{})}),u.jsx(bo,{children:iLn.map(Y=>u.jsx(qs,{value:Y.value,children:Y.label},Y.value))})]})]}),G.length>0&&u.jsx("div",{className:"flex flex-col gap-1",children:G.map((Y,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(zn,{className:"size-3.5 shrink-0"}),Y]},W))}),H&&oe.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},(Y,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&&!ee&&u.jsx("div",{className:"rounded-md border border-red-500/30 bg-red-500/5 p-4 text-sm text-red-400",children:m}),F&&(F.includes(jPn)?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(zn,{className:"mt-0.5 size-4 shrink-0 text-amber-400"}),u.jsxs("div",{children:[u.jsx("p",{className:"text-sm font-medium text-amber-300",children:N?.flavor==="agent_teams_orchestrator"?`${Oe} not available`:`${Oe} not installed`}),u.jsxs("p",{className:"mt-0.5 text-xs text-text-muted",children:["MCP health checks require ",Oe,". 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:F})),M.length>0&&u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3",children:[u.jsx("p",{className:"text-sm font-medium text-text",children:"已安装"}),u.jsx($t,{variant:"secondary",className:"font-normal",children:M.length})]}),u.jsx("div",{className:"mcp-servers-grid grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-3",children:M.map(Y=>{const se=p.find(we=>dC(we.name)===Y.name.toLowerCase())??{id:`custom:${Y.name}`,name:Y.name,description:Y.transport==="http"?"HTTP/SSE 服务器":"Stdio 服务器",source:"official",installSpec:null,envVars:[],requiresAuth:!1,tools:[]},he=U[tS(Y.name,Y.scope)]??U[tS(Y.name)]??U[Y.name]??null;return u.jsx(Ywe,{server:se,isInstalled:!0,installedEntry:Y,installedEntries:[Y],diagnostic:he,diagnosticsLoading:A,onClick:a,cliStatus:N,cliStatusLoading:j},`${Y.name}-${Y.scope}`)})})]}),!H&&oe.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:ee?u.jsx(Mi,{className:"size-5 text-text-muted"}):u.jsx(OU,{className:"size-5 text-text-muted"})}),u.jsx("p",{className:"text-sm text-text-secondary",children:ee?"没有找到服务器":"暂无 MCP 服务器"}),u.jsx("p",{className:"text-xs text-text-muted",children:ee?"试试其他搜索词":"稍后再回来查看新服务器"})]}),oe.length>0&&u.jsx("div",{className:"mcp-servers-grid grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-3",children:oe.map(Y=>u.jsx(Ywe,{server:Y,isInstalled:pe(Y),installedEntry:_e(Y),installedEntries:Te(Y),diagnostic:be(Y),diagnosticsLoading:A,onClick:a,cliStatus:N,cliStatusLoading:j},Y.id))}),!ee&&f&&u.jsx("div",{className:"flex justify-center py-4",children:u.jsx(Me,{variant:"outline",size:"sm",disabled:h,onClick:()=>void g(f),children:"Load more"})}),u.jsx(sLn,{server:K,isInstalled:K?pe(K):!1,installedEntry:K?_e(K):null,installedEntries:K?Te(K):[],diagnostic:K?be(K):null,diagnosticsLoading:A,projectPath:e,open:o!==null,onClose:()=>a(null),cliStatus:N,cliStatusLoading:j})]})},lLn=["lsp","mcp","agent","command","hook","skill"],cLn=({plugins:e,selected:t,onToggle:n})=>{const r=O.useMemo(()=>{const s=new Map;for(const i of e){const o=G$(i);for(const a of o)s.set(a,(s.get(a)??0)+1)}return s},[e]);return u.jsx("div",{className:"flex flex-wrap gap-1.5",children:lLn.map(s=>{const i=r.get(s)??0;if(i===0)return null;const o=t.includes(s);return u.jsxs(Me,{variant:"ghost",size:"sm",onClick:()=>n(s),"aria-pressed":o,className:`h-7 rounded-full border px-2.5 text-[11px] font-medium transition-all ${o?"border-purple-500/40 bg-purple-500/15 text-purple-300 shadow-sm":"hover:bg-surface-raised/60 border-border bg-transparent text-text-secondary hover:border-border-emphasis hover:text-text"}`,children:[u.jsx("span",{children:Ise(s)}),u.jsx("span",{className:`ml-1.5 rounded-full px-1 py-0.5 text-[9px] leading-none ${o?"bg-surface-raised text-text-secondary":"bg-surface-raised/70 text-text-muted"}`,children:i})]},s)})})},uLn=({plugins:e,selected:t,onToggle:n})=>{const r=O.useMemo(()=>{const s=new Map;for(const i of e){const o=H$(i.category);s.set(o,(s.get(o)??0)+1)}return[...s.entries()].sort((i,o)=>o[1]-i[1])},[e]);return r.length===0?u.jsx(u.Fragment,{}):u.jsx("div",{className:"flex flex-wrap gap-1.5",children:r.map(([s,i])=>{const o=t.includes(s);return u.jsxs(Me,{variant:"ghost",size:"sm",onClick:()=>n(s),"aria-pressed":o,className:`h-7 rounded-full border px-2.5 text-[11px] font-medium transition-all ${o?"border-blue-500/40 bg-blue-500/15 text-blue-300 shadow-sm":"hover:bg-surface-raised/60 border-border bg-transparent text-text-secondary hover:border-border-emphasis hover:text-text"}`,children:[u.jsx("span",{children:s}),u.jsx("span",{className:`ml-1.5 rounded-full px-1 py-0.5 text-[9px] leading-none ${o?"bg-surface-raised text-text-secondary":"bg-surface-raised/70 text-text-muted"}`,children:i})]},s)})})},lJe=({count:e})=>e<=0?null:u.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-text-muted",children:[u.jsx(Yne,{className:"size-3"}),N2t(e)]}),dLn=({plugin:e,index:t,onClick:n,cliStatus:r,cliStatusLoading:s})=>{const i=G$(e),o=H$(e.category),a=ML(e.pluginId,"user"),c=re(b=>b.pluginInstallProgress[a]??"idle"),l=re(b=>b.installPlugin),d=re(b=>b.uninstallPlugin),p=re(b=>b.installErrors[a]),f=lXe(e.installations,"user"),h=uXe(e.installations),m=t%2===0,g=Math.floor(t/2)%2===0,_=Math.floor(t/3)%2===0;return u.jsxs("div",{role:"button",tabIndex:0,onClick:()=>n(e.pluginId),onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),n(e.pluginId))},className:`relative flex w-full cursor-pointer flex-col gap-3 rounded-xl border p-4 text-left transition-all duration-200 hover:border-border-emphasis hover:bg-white/[0.06] 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)] ${m?"bg-white/[0.045]":"bg-white/[0.015]"} ${g?"sm:bg-white/[0.045]":"sm:bg-white/[0.015]"} ${_?"xl:bg-white/[0.045]":"xl:bg-white/[0.015]"} ${e.isInstalled?"border-l-2 border-border border-l-emerald-500/35":"border-border"}`,children:[e.source==="official"&&u.jsx("div",{className:"pointer-events-none absolute -left-px -top-px size-16 overflow-hidden",children:u.jsx("div",{className:"absolute left-[-24px] top-[4px] w-[80px] -rotate-45 bg-blue-500/90 text-center text-[9px] font-semibold leading-[18px] text-white shadow-sm",children:"Official"})}),u.jsxs("div",{className:"flex items-start justify-between gap-2",children:[u.jsxs("div",{className:"min-w-0 space-y-1",children:[u.jsx("h3",{className:"truncate text-sm font-semibold text-text",children:e.name}),u.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[u.jsx($t,{variant:"secondary",className:"text-[11px]",children:o}),i.map(b=>u.jsx($t,{variant:"outline",className:"bg-surface-raised/60 border-border text-[11px] text-text-secondary",children:Ise(b)},b))]})]}),u.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[u.jsx(lJe,{count:e.installCount}),h&&u.jsx($t,{className:"shrink-0 border-emerald-500/30 bg-emerald-500/10 text-emerald-400",variant:"outline",children:h})]})]}),u.jsx("p",{className:"line-clamp-3 min-h-[3.75rem] text-xs leading-5 text-text-secondary",children:e.description}),u.jsxs("div",{className:"flex items-start justify-between gap-2",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-3 text-xs text-text-muted",children:[u.jsx("span",{className:"truncate",children:e.author?.name??"Unknown author"}),e.version&&u.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1",children:[u.jsx(dMe,{className:"size-3"}),e.version]})]}),u.jsx("div",{className:"shrink-0",onClick:b=>b.stopPropagation(),children:u.jsx(gB,{state:c,isInstalled:f,section:"plugins",cliStatus:r,cliStatusLoading:s,onInstall:()=>l({pluginId:e.pluginId,scope:"user"}),onUninstall:()=>d(e.pluginId,"user"),size:"sm",errorMessage:p})})]})]})},pLn=[{value:"user",label:"User (global)"},{value:"project",label:"Project (shared)"},{value:"local",label:"Local (gitignored)"}],fLn=({plugin:e,open:t,onClose:n,projectPath:r,cliStatus:s,cliStatusLoading:i})=>{const{fetchPluginReadme:o,readmes:a,readmeLoading:c,installPlugin:l,uninstallPlugin:d}=re(vt(E=>({fetchPluginReadme:E.fetchPluginReadme,readmes:E.pluginReadmes,readmeLoading:E.pluginReadmeLoading,installPlugin:E.installPlugin,uninstallPlugin:E.uninstallPlugin}))),[p,f]=O.useState("user"),h=!!r;O.useEffect(()=>{e&&t&&o(e.pluginId)},[e,t,o]),O.useEffect(()=>{t&&f("user")},[t,e?.pluginId]),O.useEffect(()=>{p!=="user"&&!h&&f("user")},[h,p]);const m=e?ML(e.pluginId,p,p!=="user"?r:void 0):null,g=re(E=>(m?E.pluginInstallProgress[m]:void 0)??"idle"),_=re(E=>m?E.installErrors[m]:void 0);if(!e)return u.jsx(u.Fragment,{});const b=G$(e),y=H$(e.category),x=a[e.pluginId],S=c[e.pluginId]??!1,v=lXe(e.installations,p),T=uXe(e.installations);return u.jsx(us,{open:t,onOpenChange:E=>!E&&n(),children:u.jsxs(ts,{className:"max-w-2xl",children:[u.jsx(ds,{children:u.jsxs("div",{className:"flex items-start justify-between gap-3",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx(ns,{className:"truncate",children:e.name}),u.jsx(oi,{className:"mt-1",children:e.description})]}),u.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[T&&u.jsx($t,{className:"shrink-0 border-emerald-500/30 bg-emerald-500/10 text-emerald-400",variant:"outline",children:T}),u.jsx(rce,{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:"text-text",children:e.author?.name??"Unknown"})]}),u.jsxs("div",{children:[u.jsx("span",{className:"text-text-muted",children:"分类"}),u.jsx("p",{className:"capitalize text-text",children:y})]}),u.jsxs("div",{children:[u.jsx("span",{className:"text-text-muted",children:"来源"}),u.jsx("p",{className:"capitalize text-text",children:e.source})]}),e.version&&u.jsxs("div",{children:[u.jsx("span",{className:"text-text-muted",children:"版本"}),u.jsx("p",{className:"text-text",children:e.version})]}),u.jsxs("div",{children:[u.jsx("span",{className:"text-text-muted",children:"能力"}),u.jsx("div",{className:"mt-0.5 flex flex-wrap gap-1",children:b.map(E=>u.jsx($t,{variant:"outline",className:"border-purple-500/30 bg-purple-500/10 text-purple-400",children:Ise(E)},E))})]}),u.jsxs("div",{children:[u.jsx("span",{className:"text-text-muted",children:"安装量"}),u.jsx("div",{className:"mt-0.5",children:u.jsx(lJe,{count:e.installCount})})]})]}),u.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-border bg-surface-raised px-4 py-3",children:[u.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[u.jsx(Zt,{className:"text-xs text-text-muted",children:"Scope:"}),u.jsxs(qo,{value:p,onValueChange:E=>f(E),children:[u.jsx(_o,{className:"h-7 w-36 text-xs",children:u.jsx(Wo,{})}),u.jsx(bo,{children:pLn.map(E=>u.jsx(qs,{value:E.value,disabled:E.value!=="user"&&!h,children:E.label},E.value))})]})]}),u.jsx(gB,{state:g,isInstalled:v,section:"plugins",cliStatus:s,cliStatusLoading:i,onInstall:()=>l({pluginId:e.pluginId,scope:p,...p!=="user"&&r?{projectPath:r}:{}}),onUninstall:()=>d(e.pluginId,p,p!=="user"?r??void 0:void 0),size:"default",errorMessage:_})]}),u.jsxs("div",{className:"flex items-center gap-4",children:[e.homepage&&u.jsxs(Me,{variant:"link",className:"h-auto justify-start p-0 text-sm text-blue-400",onClick:()=>void Z.openExternal(e.homepage),children:[u.jsx(zd,{className:"mr-1 size-3.5"}),"Homepage"]}),e.author?.email&&u.jsxs(Me,{variant:"link",className:"h-auto justify-start p-0 text-sm text-blue-400",onClick:()=>void Z.openExternal(`mailto:${e.author.email}`),children:[u.jsx(Uft,{className:"mr-1 size-3.5"}),"Contact"]})]}),u.jsxs("div",{className:"mt-2 max-h-80 overflow-y-auto rounded-md border border-border bg-surface-raised p-4",children:[S&&u.jsxs("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[u.jsx(zt,{className:"size-4 animate-spin"}),"Loading README..."]}),!S&&x&&u.jsx(Ks,{content:x,bare:!0,maxHeight:"max-h-none"}),!S&&!x&&u.jsx("p",{className:"text-sm text-text-muted",children:"暂无 README。"})]})]})})},hLn=[{value:"popularity:desc",label:"热门"},{value:"name:asc",label:"名称 A-Z"},{value:"name:desc",label:"名称 Z-A"},{value:"category:asc",label:"分类"}];function mLn(e,t,n){let r=e;if(t.search){const i=t.search.toLowerCase();r=r.filter(o=>o.name.toLowerCase().includes(i)||o.description.toLowerCase().includes(i)||o.pluginId.toLowerCase().includes(i))}t.categories.length>0&&(r=r.filter(i=>t.categories.includes(H$(i.category)))),t.capabilities.length>0&&(r=r.filter(i=>{const o=G$(i);return t.capabilities.some(a=>o.includes(a))})),t.installedOnly&&(r=r.filter(i=>i.isInstalled));const s=n.order==="asc"?1:-1;return r=[...r].sort((i,o)=>{switch(n.field){case"popularity":return(i.installCount-o.installCount)*s;case"name":return i.name.localeCompare(o.name)*s;case"category":return i.category.localeCompare(o.category)*s;default:return 0}}),r}const gLn=({projectPath:e,pluginFilters:t,pluginSort:n,selectedPluginId:r,updatePluginSearch:s,toggleCategory:i,toggleCapability:o,toggleInstalledOnly:a,setSelectedPluginId:c,clearFilters:l,hasActiveFilters:d,setPluginSort:p,cliStatus:f,cliStatusLoading:h})=>{const{catalog:m,loading:g,error:_,cliStatus:b}=re(vt(P=>({catalog:P.pluginCatalog,loading:P.pluginCatalogLoading,error:P.pluginCatalogError,cliStatus:P.cliStatus}))),y=f??b,x=O.useMemo(()=>mLn(m,t,n),[m,t,n]),S=O.useMemo(()=>r?m.find(P=>P.pluginId===r)??null:null,[m,r]);O.useEffect(()=>{r&&!g&&!S&&c(null)},[g,S,r,c]),O.useEffect(()=>{_&&r&&c(null)},[_,r,c]);const v=`${n.field}:${n.order}`,T=t.categories.length+t.capabilities.length+(t.installedOnly?1:0)+(t.search?1:0),E=O.useMemo(()=>new Set(m.map(P=>H$(P.category))).size,[m]),w=O.useMemo(()=>{const P=new Set;for(const C of m)for(const k of G$(C))P.add(k);return P.size},[m]);return u.jsxs("div",{className:"flex flex-col gap-4",children:[y?.flavor==="agent_teams_orchestrator"&&(()=>{const P=y.providers.find(k=>k.providerId==="codex");if(!P)return null;const C=Gw(P,"plugins");return C.status==="supported"?null:u.jsxs("div",{className:"rounded-md border border-amber-500/30 bg-amber-500/5 px-4 py-3 text-sm text-amber-300",children:["在多模型运行时中,目前插件仅保证用于 Anthropic 会话。我们正在为所有智能体构建更广泛的插件支持,包括通用插件和智能体专用插件。",C.reason?` ${C.reason}`:""]})})(),u.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-center",children:[u.jsx("div",{className:"flex-1",children:u.jsx(nce,{value:t.search,onChange:s,placeholder:"搜索插件..."})}),u.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[u.jsxs(qo,{value:v,onValueChange:P=>{const[C,k]=P.split(":");p({field:C,order:k})},children:[u.jsxs(_o,{className:"w-full gap-2 sm:w-40",children:[u.jsx(zne,{className:"size-3.5 shrink-0 text-text-muted"}),u.jsx(Wo,{})]}),u.jsx(bo,{children:hLn.map(P=>u.jsx(qs,{value:P.value,children:P.label},P.value))})]}),u.jsxs(Zt,{htmlFor:"installed-only",className:"bg-surface-raised/40 flex h-10 cursor-pointer items-center gap-2 rounded-lg border border-border px-3 text-xs text-text-secondary transition-colors hover:border-border-emphasis hover:text-text",children:[u.jsx(ai,{id:"installed-only",checked:t.installedOnly,onCheckedChange:a}),"仅已安装"]})]})]}),u.jsx("div",{className:"bg-surface-raised/20 rounded-xl p-4",children:u.jsxs("div",{className:"flex flex-col gap-4",children:[u.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx("div",{className:"bg-surface-raised/60 flex size-8 items-center justify-center rounded-lg border border-border",children:u.jsx(T$,{className:"size-4 text-text-muted"})}),u.jsxs("div",{children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx("h2",{className:"text-sm font-semibold text-text",children:"按适用场景浏览"}),u.jsxs($t,{variant:"outline",className:"text-[11px] text-text-muted",children:[T," 个已启用"]})]}),u.jsx("p",{className:"text-xs text-text-muted",children:"按分类、能力或安装状态缩小目录范围。"})]})]}),u.jsxs("div",{className:"flex flex-wrap gap-2 text-[11px] text-text-muted",children:[u.jsxs($t,{variant:"secondary",className:"font-normal",children:[m.length," 个插件"]}),u.jsxs($t,{variant:"secondary",className:"font-normal",children:[E," 个分类"]}),u.jsxs($t,{variant:"secondary",className:"font-normal",children:[w," 项能力"]})]})]}),d&&u.jsx(Me,{variant:"ghost",size:"sm",onClick:l,className:"justify-start rounded-lg border border-border px-3 text-xs text-text-secondary hover:text-text lg:justify-center",children:"清除所有筛选"})]}),u.jsx("div",{className:"overflow-hidden rounded-lg border border-border bg-transparent",children:u.jsxs("div",{className:"grid gap-0 xl:grid-cols-2",children:[u.jsxs("section",{className:"space-y-3 p-3 xl:border-r xl:border-border",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-text-muted",children:"分类"}),u.jsxs("span",{className:"text-[11px] text-text-muted",children:["已选 ",t.categories.length," 个"]})]}),u.jsx(uLn,{plugins:m,selected:t.categories,onToggle:i})]}),u.jsxs("section",{className:"space-y-3 border-t border-border p-3 xl:border-t-0",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-text-muted",children:"能力"}),u.jsxs("span",{className:"text-[11px] text-text-muted",children:["已选 ",t.capabilities.length," 个"]})]}),u.jsx(cLn,{plugins:m,selected:t.capabilities,onToggle:o})]})]})})]})}),!g&&!_&&x.length>0&&u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[u.jsxs("p",{className:"text-xs text-text-muted",children:["显示 ",x.length," / ",m.length," 个插件"]}),d&&u.jsx("p",{className:"text-xs text-text-muted",children:"调整筛选后结果会立即更新。"})]}),g&&u.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-3",children:Array.from({length:6},(P,C)=>u.jsxs("div",{className:"skeleton-card flex flex-col gap-2 rounded-lg border border-border p-4",style:{animationDelay:`${C*80}ms`},children:[u.jsxs("div",{className:"flex items-start justify-between gap-2",children:[u.jsx("div",{className:"h-4 w-32 rounded bg-surface-raised"}),u.jsx("div",{className:"h-5 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-3/4 rounded bg-surface-raised"})]}),u.jsxs("div",{className:"flex gap-1.5",children:[u.jsx("div",{className:"h-5 w-14 rounded-full bg-surface-raised"}),u.jsx("div",{className:"h-5 w-12 rounded-full bg-surface-raised"})]}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("div",{className:"h-3 w-24 rounded bg-surface-raised"}),u.jsx("div",{className:"h-7 w-16 rounded bg-surface-raised"})]})]},C))}),_&&u.jsx("div",{className:"rounded-md border border-red-500/30 bg-red-500/5 p-4 text-sm text-red-400",children:_}),!g&&!_&&x.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:d?u.jsx(Mi,{className:"size-5 text-text-muted"}):u.jsx(Lb,{className:"size-5 text-text-muted"})}),u.jsx("p",{className:"text-sm text-text-secondary",children:d?"没有匹配筛选条件的插件":"暂无可用插件"}),u.jsx("p",{className:"text-xs text-text-muted",children:d?"试着调整搜索或筛选条件":"稍后再回来查看新插件"}),d&&u.jsx(Me,{variant:"outline",size:"sm",onClick:l,children:"Clear filters"})]}),!g&&!_&&x.length>0&&u.jsx("div",{className:"plugins-grid grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-3",children:x.map((P,C)=>u.jsx(dLn,{plugin:P,index:C,onClick:c,cliStatus:y,cliStatusLoading:h},P.pluginId))}),u.jsx(fLn,{plugin:S,open:r!==null,onClose:()=>c(null),projectPath:e,cliStatus:y,cliStatusLoading:h})]})},WP=[{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 cJe(e){return WP.find(t=>t.rootKind===e)}function wee(e){return cJe(e).directoryName}function uJe(e){return cJe(e).audience}function oX(e){return e==="hermit"?"Hermit 管理":uJe(e)==="codex"?"Codex 专用":"共享"}function Vwe(e,t){return uJe(e)==="shared"||t==="codex"}var dJe="AlertDialog",[OLn]=op(dJe,[$Ge]),Gm=$Ge(),pJe=e=>{const{__scopeAlertDialog:t,...n}=e,r=Gm(t);return u.jsx(_ae,{...r,...n,modal:!0})};pJe.displayName=dJe;var _Ln="AlertDialogTrigger",bLn=O.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Gm(n);return u.jsx(iyn,{...s,...r,ref:t})});bLn.displayName=_Ln;var yLn="AlertDialogPortal",fJe=e=>{const{__scopeAlertDialog:t,...n}=e,r=Gm(t);return u.jsx(bae,{...r,...n})};fJe.displayName=yLn;var xLn="AlertDialogOverlay",hJe=O.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Gm(n);return u.jsx(I3,{...s,...r,ref:t})});hJe.displayName=xLn;var wv="AlertDialogContent",[SLn,vLn]=OLn(wv),TLn=IAe("AlertDialogContent"),mJe=O.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...s}=e,i=Gm(n),o=O.useRef(null),a=rs(t,o),c=O.useRef(null);return u.jsx(tyn,{contentName:wv,titleName:gJe,docsSlug:"alert-dialog",children:u.jsx(SLn,{scope:n,cancelRef:c,children:u.jsxs(M3,{role:"alertdialog",...i,...s,ref:a,onOpenAutoFocus:bn(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(wLn,{contentRef:o})]})})})});mJe.displayName=wv;var gJe="AlertDialogTitle",OJe=O.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Gm(n);return u.jsx(yae,{...s,...r,ref:t})});OJe.displayName=gJe;var _Je="AlertDialogDescription",bJe=O.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Gm(n);return u.jsx(xae,{...s,...r,ref:t})});bJe.displayName=_Je;var ELn="AlertDialogAction",yJe=O.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Gm(n);return u.jsx(Sae,{...s,...r,ref:t})});yJe.displayName=ELn;var xJe="AlertDialogCancel",SJe=O.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:s}=vLn(xJe,n),i=Gm(n),o=rs(t,s);return u.jsx(Sae,{...i,...r,ref:o})});SJe.displayName=xJe;var wLn=({contentRef:e})=>{const t=`\`${wv}\` requires a description for the component to be accessible for screen reader users.
|
|
1664
|
+
请展开下面的 **CLI 日志** 查看可读诊断。`:null}const h2n=({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:g,assistantOutput:_,launchDiagnostics:b,surface:y="raised",className:x})=>{const S=p2n(h,c),[v,T]=O.useState(()=>i??!1),[E,w]=O.useState(!1),[P,C]=O.useState(s),k=O.useRef(null),I=r==="error",Q=f2n(_,I),$=b?.filter(R=>R.severity==="warning"||R.severity==="error")??[];return O.useEffect(()=>{P&&k.current&&(k.current.scrollTop=k.current.scrollHeight)},[_,P]),O.useEffect(()=>{C(s)},[s]),O.useEffect(()=>{i!==void 0&&T(i)},[i]),O.useEffect(()=>{I&&g&&(T(!0),C(!1))},[I,g]),u.jsxs("div",{className:st(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(zn,{size:14,className:"shrink-0 text-amber-400"}):p==="info"?u.jsx(Gs,{size:14,className:"shrink-0 text-sky-400"}):u.jsx(ma,{size:14,className:"shrink-0 text-[var(--step-done-text)]"}),u.jsx("p",{className:st("flex-1 text-xs",p==="warning"?"text-amber-400":p==="info"?"text-sky-400":"text-[var(--step-success-text)]"),children:d}),f?u.jsx(Me,{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(Pr,{size:12})}):null]}):f?u.jsx("div",{className:"flex justify-end",children:u.jsx(Me,{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(Pr,{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(zt,{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(Me,{variant:"outline",size:"sm",className:"h-6 shrink-0 px-2 text-xs",onClick:l,children:"取消"}):null]}),t?u.jsx("p",{className:st("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(lKe,{steps:u2n,currentIndex:o,errorIndex:a})}),$.length>0?u.jsxs("div",{className:"mt-2",children:[u.jsxs("button",{type:"button",className:"flex items-center gap-1 text-[11px] text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:()=>w(R=>!R),children:[E?u.jsx(Dr,{size:12}):u.jsx(Bn,{size:12}),"诊断"]}),E?u.jsx("div",{className:"mt-1 space-y-1 rounded border border-[var(--color-border)] bg-[var(--color-surface)] p-2",children:$.map(R=>u.jsxs("div",{className:"text-[11px]",children:[u.jsx("div",{className:st(R.severity==="error"?"text-red-400":R.severity==="warning"?"text-amber-400":"text-[var(--color-text-secondary)]"),children:R.label}),R.detail?u.jsx("div",{className:"mt-0.5 text-[10px] text-[var(--color-text-muted)]",children:R.detail}):null]},R.id))}):null]}):null,u.jsxs("div",{className:"mt-2",children:[u.jsxs("button",{type:"button",className:"flex items-center gap-1 text-[11px] text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:()=>C(R=>!R),children:[P?u.jsx(Dr,{size:12}):u.jsx(Bn,{size:12}),"实时输出"]}),P?u.jsx("div",{ref:k,className:st("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:Q?u.jsx(Ks,{content:Q,bare:!0,maxHeight:"max-h-none"}):u.jsx("p",{className:st("text-[11px]",I?"text-[var(--step-error-text-dim)]":"text-[var(--color-text-muted)]"),children:"暂无输出。"})}):null]}),g?u.jsxs("div",{className:"mt-2",children:[u.jsxs("button",{type:"button",className:"flex items-center gap-1 text-[11px] text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:()=>T(R=>!R),children:[v?u.jsx(Dr,{size:12}):u.jsx(Bn,{size:12}),"CLI 日志"]}),v?u.jsx(fKe,{cliLogsTail:g,order:"newest-first",className:"mt-1"}):null]}):null]})};function hKe(e){const{progress:t,cancelProvisioning:n,cancelCurrentProvisioning:r,teamMembers:s,memberSpawnStatuses:i,memberSpawnSnapshot:o}=re(vt(c=>({progress:Ef(c,e),cancelProvisioning:c.cancelProvisioning,cancelCurrentProvisioning:c.cancelCurrentProvisioning,teamMembers:Use(c,e),memberSpawnStatuses:c.memberSpawnStatusesByTeam[e],memberSpawnSnapshot:c.memberSpawnSnapshotsByTeam[e]})));return{presentation:O.useMemo(()=>Ale({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 mKe=O.memo(function({teamName:t,surface:n="flat",dismissible:r=!1,className:s,defaultLogsOpen:i}){const{presentation:o,cancelProvisioning:a,cancelCurrentProvisioning:c,runInstanceKey:l}=hKe(t),[d,p]=O.useState(!1),f=O.useRef(-1);if(O.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(h2n,{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:st("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(Me,{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(Pr,{size:12})}):null]}),m]}):m}),m2n=bie.map(e=>({key:e.key,label:e.label})),g2n={"--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 O2n(e){return e!=null&&(e.isActive||e.isFailed)}const _2n=({teamName:e,enabled:t=!0})=>{const{presentation:n,runInstanceKey:r}=hKe(e),s=O.useRef(-1),[i,o]=O.useState(!1),a=t&&O2n(n),c=n?.isFailed?s.current>=0?s.current:0:void 0;O.useEffect(()=>{o(!1),s.current=-1},[r,e]),O.useEffect(()=>{n&&!n.isFailed&&n.currentStepIndex>=0&&(s.current=n.currentStepIndex)},[n]);const l=O.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:g2n,children:u.jsx(lKe,{steps:m2n,currentIndex:n.currentStepIndex,errorIndex:c,className:"w-full origin-top scale-[0.88]"})}),u.jsx("span",{className:"sr-only",children:l})]}),u.jsx(us,{open:i,onOpenChange:o,children:u.jsxs(ts,{className:"w-[min(1120px,92vw)] max-w-5xl p-0",children:[u.jsxs(ds,{className:"sr-only",children:[u.jsx(ns,{children:"启动详情"}),u.jsx(oi,{children:"查看团队启动进度、实时输出和 CLI 日志。"})]}),u.jsx("div",{className:"max-h-[85vh] overflow-y-auto p-4",children:u.jsx(mKe,{teamName:e,surface:"flat",defaultLogsOpen:!0})})]})})]})};function b2n(e,t){if(t.relatedTaskId)return[{taskId:t.relatedTaskId,displayId:t.relatedTaskDisplayId??t.relatedTaskId.slice(0,8),teamName:e}]}function y2n(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 x2n(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 S2n(e,t){const n=t.kind==="task_comment"?"task_comment_notification":"default",r=b2n(e,t);return{from:t.sourceLabel,to:t.destinationLabel,text:x2n(t),timestamp:new Date(t.updatedAt*1e3).toISOString(),read:!0,summary:y2n(t),color:t.color,messageId:`graph-handoff:${t.key}`,source:"inbox",messageKind:n,taskRefs:r}}const Dwe=Nd.width,v2n=72,T2n=10,E2n=({teamName:e,getTransientHandoffSnapshot:t=()=>({cards:[],time:0}),getCameraZoom:n=()=>1,worldToScreen:r,getNodeWorldPosition:s=()=>null,focusNodeIds:i,focusEdgeIds:o,enabled:a=!0})=>{const c=O.useRef(null),l=O.useRef(new Map),d=O.useRef(""),[p,f]=O.useState([]),{teamData:h,teams:m}=GN(e),g=O.useMemo(()=>YN(h?.members),[h?.members]),{teamNames:_,teamColorByName:b}=Gle(m);O.useEffect(()=>{d.current="",f([])},[e]),O.useLayoutEffect(()=>{if(!a){f([]);return}let x=0;const S=()=>{const v=t({focusNodeIds:i,focusEdgeIds:o}),T=v.cards.filter(C=>C.anchorKind==="lead"||C.anchorKind==="member"),E=T.map(C=>`${C.key}:${C.count}:${C.updatedAt}:${C.anchorNodeId}`).join("|");E!==d.current&&(d.current=E,f(T));const w=c.current;if(w&&r){const C=r(0,0),k=Math.max(n(),.001);w.style.transform=`translate(${Math.round(C.x)}px, ${Math.round(C.y)}px) scale(${k.toFixed(3)})`}const P=new Map;for(const C of T){const k=l.current.get(C.key);if(!k)continue;const I=s(C.anchorNodeId),Q=oZe(C,v.time);if(!I||!r||Q<=.001){k.style.opacity="0";continue}const $=P.get(C.anchorNodeId)??0;P.set(C.anchorNodeId,$+1);const R=$*(v2n*.34+T2n),N=.94+Q*.06;k.style.left=`${Math.round(I.x)}px`,k.style.top=`${Math.round(I.y)}px`,k.style.opacity=String(Q),k.style.transform=`translate(-50%, calc(-50% - ${R.toFixed(1)}px)) scale(${N.toFixed(3)})`}x=window.requestAnimationFrame(S)};return S(),()=>{window.cancelAnimationFrame(x)}},[a,o,i,n,s,t,r]);const y=O.useMemo(()=>p.map((x,S)=>({card:x,message:S2n(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:`${Dwe}px`,maxWidth:`${Dwe}px`},onDragStart:T=>{T.preventDefault()},children:u.jsx(oKe,{message:S,teamName:e,messageContext:g,teamNames:_,teamColorByName:b,zebraShade:v,className:"pointer-events-none drop-shadow-[0_0_22px_rgba(94,234,212,0.12)]"})},x.key))})},w2n=O.lazy(()=>De(()=>import("./TeamGraphOverlay-DYT3bwFR.js"),__vite__mapDeps([60,1])).then(e=>({default:e.TeamGraphOverlay}))),k2n=({teamName:e,isActive:t=!0,isPaneFocused:n=!1})=>{const r=jMn(e),{openTeamPage:s,commitOwnerSlotDrop:i,commitOwnerGridOrderDrop:o,setLayoutMode:a}=XMn(e),[c,l]=O.useState(!1),{sidebarVisible:d,toggleSidebarVisible:p}=LMn(),{dialog:f,openCreateTaskDialog:h}=QMn(e),m=O.useCallback(I=>window.dispatchEvent(new CustomEvent("graph:open-task",{detail:{teamName:e,taskId:I}})),[e]),g=O.useCallback(I=>window.dispatchEvent(new CustomEvent("graph:send-message",{detail:{teamName:e,memberName:I}})),[e]),_=O.useCallback((I,Q)=>window.dispatchEvent(new CustomEvent("graph:open-profile",{detail:{teamName:e,memberName:I,...Q}})),[e]),b=O.useCallback(()=>{h("")},[h]),y=O.useCallback(I=>Q=>window.dispatchEvent(new CustomEvent(`graph:${I}`,{detail:{teamName:e,taskId:Q}})),[e]),x=O.useMemo(()=>y("start-task"),[y]),S=O.useMemo(()=>y("complete-task"),[y]),v=O.useMemo(()=>y("approve-task"),[y]),T=O.useMemo(()=>y("request-review"),[y]),E=O.useMemo(()=>y("request-changes"),[y]),w=O.useMemo(()=>y("cancel-task"),[y]),P=O.useMemo(()=>y("move-back-to-done"),[y]),C=O.useMemo(()=>y("delete-task"),[y]),k={onNodeDoubleClick:O.useCallback(I=>{I.kind==="task"?m(I.taskId):I.kind==="member"&&_(I.memberName)},[m,_]),onSendMessage:g,onOpenTaskDetail:m,onOpenMemberProfile:O.useCallback(I=>{_(I)},[_])};return u.jsxs("div",{className:"flex size-full overflow-hidden",style:{background:"#050510"},children:[d?u.jsx(CMn,{teamName:e,surface:"graph-tab",isActive:t,isFocused:n}):null,u.jsx("div",{className:"min-w-0 flex-1",children:u.jsx(OMn,{data:r,events:k,className:"team-graph-view size-full",suspendAnimation:!t,isSurfaceActive:t,onRequestFullscreen:()=>l(!0),onOpenTeamPage:s,onCreateTask:b,onToggleSidebar:p,isSidebarVisible:d,renderTopToolbarContent:()=>u.jsx(_2n,{teamName:e,enabled:t}),onLayoutModeChange:a,onOwnerSlotDrop:i,onOwnerGridOrderDrop:o,renderHud:I=>{const Q=I,{getViewportSize:$,focusNodeIds:R,filters:N}=Q;return u.jsxs(u.Fragment,{children:[u.jsx(E2n,{teamName:e,getTransientHandoffSnapshot:Q.getTransientHandoffSnapshot,getCameraZoom:Q.getCameraZoom,worldToScreen:Q.worldToScreen,getNodeWorldPosition:Q.getNodeWorldPosition,focusNodeIds:R,focusEdgeIds:Q.focusEdgeIds??null,enabled:t}),u.jsx(jQn,{teamName:e,nodes:r.nodes,getActivityWorldRect:Q.getActivityWorldRect,getCameraZoom:Q.getCameraZoom,worldToScreen:Q.worldToScreen,getNodeWorldPosition:Q.getNodeWorldPosition,getViewportSize:$,focusNodeIds:R,enabled:t&&(N?.showActivity??!0),onOpenTaskDetail:m,onOpenMemberProfile:_})]})},renderEdgeOverlay:({edge:I,sourceNode:Q,targetNode:$,onClose:R,onSelectNode:N})=>u.jsx(XQn,{teamName:e,edge:I,sourceNode:Q,targetNode:$,onClose:R,onSelectNode:N,onOpenTaskDetail:m}),renderOverlay:({node:I,onClose:Q})=>u.jsx(ZQn,{node:I,teamName:e,onClose:Q,onSendMessage:g,onOpenTaskDetail:m,onOpenMemberProfile:_,onCreateTask:h,onStartTask:x,onCompleteTask:S,onApproveTask:v,onRequestReview:T,onRequestChanges:E,onCancelTask:w,onMoveBackToDone:P,onDeleteTask:C})})}),f,c&&u.jsx(O.Suspense,{fallback:null,children:u.jsx(w2n,{teamName:e,onClose:()=>l(!1),sidebarVisible:d,onToggleSidebar:p,onSendMessage:g,onOpenTaskDetail:m,onOpenMemberProfile:_})})]})};function Oee(e){return/^[A-Za-z]:[/\\]/.test(e)||e.startsWith("\\\\")||e.startsWith("//")}function C2n(e){return e.includes("\\")&&!e.includes("/")?"\\":"/"}function Lwe(e,t){const n=C2n(e);return e.replace(/[/\\]$/,"")+n+t.replace(/[/\\]/g,n)}function qP(e,t,n=40){let r=e;if(t){const l=t.replace(/[/\\]$/,""),d=Oee(r)||Oee(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 R2n(e){return(/^(\/Users\/[^/]+)/.exec(e)??/^(\/home\/[^/]+)/.exec(e)??/^([A-Z]:\\Users\\[^\\]+)/i.exec(e))?.[1]??null}function _ee(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(P2n(e)){const n=al(t);if(n.length>=3){const r=n.slice(3).join("/");return r?`~/${r}`:"~"}}return t}function P2n(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 rX(e,t){let n=e;if((n.startsWith("~/")||n.startsWith("~\\"))&&t){const r=R2n(t);r&&(n=Lwe(r,n.slice(2)))}return t&&!n.startsWith("/")&&!n.startsWith("~")&&!Oee(n)&&(n=Lwe(t,n)),n}const jwe=["anthropic","codex","gemini"];function $2n(e){return[...e].sort((t,n)=>jwe.indexOf(t)-jwe.indexOf(n))}function N2n(e,t){const n=e.associatedPaths.reduce((r,s)=>{const i=t.get(dr(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 A2n(e,t){const n=new Set,r=[];for(const s of e.associatedPaths){const i=t.get(dr(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 I2n(e){const t=[e.primaryPath,...e.associatedPaths].filter(Boolean),n=Array.from(new Set(t));if(!(n.length<=1))return{badgeLabel:`${n.length} 个路径`,description:"此卡片合并了相关 worktree 和项目路径的最近活动。",paths:n.map((r,s)=>({label:s===0?"主路径":`相关路径 ${s}`,fullPath:r}))}}function M2n({projects:e,taskCountsByProject:t,activeTeamsByProject:n,tasksLoading:r}){return e.map(s=>({id:s.id,project:s,name:s.name,formattedPath:_ee(s.primaryPath),lastActivityLabel:ST(new Date(s.mostRecentActivity),{addSuffix:!0,locale:pUe}),providerIds:$2n(s.providerIds),primaryBranch:s.primaryBranch,taskCounts:N2n(s,t),tasksLoading:r,activeTeams:A2n(s,n),additionalPathCount:Math.max(0,s.associatedPaths.length-1),pathSummary:I2n(s)}))}function Q2n({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=dr(l.projectPath),p=a.get(d);p?p.push(l):a.set(d,[l])}return a}const gKe="tmp",D2n=`/${gKe}/`,L2n=`/private/${gKe}/`;function j2n(e){return e.trim().replace(/\\/g,"/").toLowerCase()}function X2n(e){const t=e.split("/").filter(Boolean);return t[t.length-1]??""}function U2n(e){return e.startsWith("/private/var/folders/")||e.startsWith("/var/folders/")||e.startsWith(L2n)||e.startsWith(D2n)||e.includes("/appdata/local/temp/")||e.includes("/appdata/locallow/temp/")}function Wl(e){const t=j2n(e??"");return t?t.includes("rendered_mcp_")||t.includes("rendered_mcp_config")||t.includes("/portable-mcp-live")?!0:X2n(t).startsWith("codex-agent-teams-appstyle-")&&U2n(t):!1}const OKe="recent-projects:open-history",bee="recent-projects:open-history-changed",z2n=1e3*60*60*48,B2n=120;function _Ke(){return typeof window<"u"&&typeof window.localStorage<"u"}function pB(e){let t=e.trim().replace(/\\/g,"/");if(!t||Wl(t))return null;if(t!=="/"&&!/^[A-Za-z]:\/$/.test(t))for(;t.endsWith("/");)t=t.slice(0,-1);return t}function bKe(e){return e.toLowerCase()}function yKe(){if(!_Ke())return{version:1,entries:[]};try{const e=window.localStorage.getItem(OKe);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 F2n(e){const t=new Map;for(const n of e){const r=pB(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,B2n)}function Y2n(e){if(!_Ke())return;const t={version:1,entries:F2n(e)};try{window.localStorage.setItem(OKe,JSON.stringify(t)),window.dispatchEvent(new CustomEvent(bee))}catch{}}function V2n(){const e=new Map,t=new Map;for(const n of yKe().entries){const r=pB(n.path);if(!r)continue;e.set(r,Math.max(e.get(r)??0,n.openedAt));const s=bKe(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 q2n(e,t){const n=pB(t);if(!n)return 0;const r=e.exact.get(n);if(r!=null)return r;const s=e.folded.get(bKe(n));return s?.exactPaths.size!==1?0:s.openedAt}function Xwe(e,t){return[t.primaryPath,...t.associatedPaths].reduce((n,r)=>Math.max(n,q2n(e,r)),0)}function sX(e,t=Date.now()){const n=Array.from(new Set(e.map(s=>pB(s)).filter(s=>!!s)));if(n.length===0)return;const r=yKe().entries;Y2n([...r,...n.map(s=>({path:s,openedAt:t}))])}function W2n(e,t=Date.now()){const n=V2n(),r=s=>s>0&&t-s<=z2n;return[...e].sort((s,i)=>{const o=Xwe(n,s),a=Xwe(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 G2n(e){if(typeof window>"u")return()=>{};const t=()=>e();return window.addEventListener(bee,t),()=>{window.removeEventListener(bee,t)}}function xKe(e){return e?Array.isArray(e)?{projects:e,degraded:!1}:Array.isArray(e.projects)?{projects:e.projects,degraded:e.degraded===!0}:null:null}const H2n=15e3,Z2n=3e4;let z2=null,yee=0,ww=null;function B2(){const e=xKe(z2);if(!e)return null;z2!==e&&(z2=e);const t=e.degraded?Z2n:H2n;return{payload:e,fetchedAt:yee,isStale:Date.now()-yee>t}}async function K2n(e,t){const n=t?.force??!1,r=B2();if(!n&&r&&!r.isStale)return r.payload;if(ww)return ww;const s=e().then(i=>{const o=xKe(i);return z2=o,yee=Date.now(),o??{projects:[],degraded:!0}}).finally(()=>{ww===s&&(ww=null)});return ww=s,s}function Uwe(e,t){const n=new Set(t.map(r=>dr(r)));for(const r of e)for(const s of r.worktrees)if(n.has(dr(s.path)))return{repoId:r.id,worktreeId:s.id};return null}function SKe(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 J2n(e){const t=SKe(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 kw=to("Feature:RecentProjects:open");function eDn(){const{repositoryGroups:e,fetchRepositoryGroups:t,openTeamsTab:n}=re(vt(l=>({repositoryGroups:l.repositoryGroups,fetchRepositoryGroups:l.fetchRepositoryGroups,openTeamsTab:l.openTeamsTab}))),r=O.useCallback(l=>{re.setState(MU(l.repoId,l.worktreeId)),re.getState().fetchSessionsInitial(l.worktreeId),n()},[n]),s=O.useCallback(async(l,d)=>{const f=(d.length>0?d:[l]).filter(b=>!Wl(b));if(f.length===0){kw.warn("Skipped ephemeral recent project path",{path:l});return}const h=Uwe(e,f);if(h){r(h);return}await t();const m=re.getState().repositoryGroups,g=Uwe(m,f);if(g){r(g);return}if(Wl(l)){kw.warn("Skipped adding ephemeral recent project path",{path:l});return}await Z.config.addCustomProjectPath(l),re.setState(b=>({repositoryGroups:[J2n(l),...b.repositoryGroups]}));const _=SKe(l);r({repoId:_,worktreeId:_})},[t,r,e]),i=O.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=O.useCallback(async l=>{try{await i(l.openTarget,l.associatedPaths),sX([l.primaryPath,...l.associatedPaths])}catch(d){kw.error("Failed to open recent project",d)}},[i]),a=O.useCallback(async l=>{try{await Z.openPath(l,l)}catch(d){kw.error("Failed to open project path",d)}},[]),c=O.useCallback(async()=>{try{const d=(await Z.config.selectFolders())[0];if(!d)return;await s(d,[d]),sX([d])}catch(l){kw.error("Failed to select project folder",l)}},[s]);return{openRecentProject:o,openProjectPath:a,selectProjectFolder:c}}const tDn=11,nDn=8,rDn=3e4,sDn=12e4,iDn=3,oDn=8e3;function aDn(e){return new Promise((t,n)=>{const r=window.setTimeout(()=>{n(new Error("最近项目加载超时,请稍后重试。"))},oDn);e.then(s=>{window.clearTimeout(r),t(s)},s=>{window.clearTimeout(r),n(s)})})}function lDn(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 cDn(e,t=tDn){const{globalTasks:n,globalTasksInitialized:r,globalTasksLoading:s,fetchAllTasks:i,teams:o,provisioningRuns:a,currentProvisioningRunIdByTeam:c,provisioningSnapshotByTeam:l}=re(vt(q=>({globalTasks:q.globalTasks,globalTasksInitialized:q.globalTasksInitialized,globalTasksLoading:q.globalTasksLoading,fetchAllTasks:q.fetchAllTasks,teams:q.teams,provisioningRuns:q.provisioningRuns,currentProvisioningRunIdByTeam:q.currentProvisioningRunIdByTeam,provisioningSnapshotByTeam:q.provisioningSnapshotByTeam}))),d=O.useMemo(()=>B2(),[]),{openRecentProject:p,openProjectPath:f,selectProjectFolder:h}=eDn(),[m,g]=O.useState(d?.payload.projects??[]),[_,b]=O.useState(d?.payload.degraded??!1),[y,x]=O.useState(d?.payload.degraded?1:0),[S,v]=O.useState(d==null),[T,E]=O.useState(null),[w,P]=O.useState(t),[C,k]=O.useState([]),[I,Q]=O.useState(0),$=O.useRef(r),R=O.useRef(d?.payload.projects??[]),N=O.useMemo(()=>({currentProvisioningRunIdByTeam:c,provisioningRuns:a}),[c,a]),j=O.useMemo(()=>Object.keys(c).filter(q=>T_(N,q)),[c,N]),M=O.useMemo(()=>[...j].sort().join("\0"),[j]);O.useEffect(()=>{R.current=m},[m]);const U=O.useCallback(async q=>{R.current.length>0||B2()!=null||v(!0),E(null);try{const te=await aDn(K2n(()=>Z.getDashboardRecentProjects(),q));g(te.projects),b(te.degraded),x(H=>te.degraded?H+1:0)}catch(te){E(te instanceof Error?te.message:"最近项目加载失败")}finally{v(!1)}},[]);O.useEffect(()=>{const q=B2();q&&!q.isStale||U({force:q!=null})},[U]),O.useEffect(()=>{if(!_)return;const q=y<=iDn?rDn:sDn,ee=window.setTimeout(()=>{U({force:!0})},q);return()=>{window.clearTimeout(ee)}},[y,_,U]),O.useEffect(()=>{if(m.length===0||$.current||r){$.current=$.current||r;return}$.current=!0,i()},[i,r,m.length]),O.useEffect(()=>{let q=!1;return Z.teams.aliveList().then(ee=>{q||k(ee)}).catch(()=>{}),()=>{q=!0}},[M,o]),O.useEffect(()=>{e.trim()||P(t)},[t,e]),O.useEffect(()=>G2n(()=>Q(q=>q+1)),[]);const A=O.useMemo(()=>hSt(n),[n]),F=O.useMemo(()=>Q2n({teams:o,aliveTeamNames:C,provisioningTeamNames:j,provisioningSnapshotByTeam:l}),[C,l,j,o]),z=O.useMemo(()=>M2n({projects:W2n(m),taskCountsByProject:A,activeTeamsByProject:F,tasksLoading:s}),[F,s,I,m,A]),D=O.useMemo(()=>z.filter(q=>lDn(q.project,e)),[z,e]);return{cards:O.useMemo(()=>e.trim()?D:D.slice(0,w),[D,e,w]),loading:S,error:T,canLoadMore:!e.trim()&&D.length>w,isElectron:!1,loadMore:()=>P(q=>q+nDn),reload:U,openRecentProject:p,openProjectPath:f,selectProjectFolder:h}}const uDn=({card:e,onClick:t,onOpenPath:n})=>{const r=O.useMemo(()=>dHt(e.name),[e.name]),[s,i]=O.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(at,{children:[u.jsx(lt,{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(it,{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(Uy,{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(at,{children:[u.jsx(lt,{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(Fc,{className:"size-3"})})}),u.jsx(it,{side:"bottom",children:"打开"})]}),u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx("span",{className:"truncate",children:e.formattedPath})}),u.jsx(it,{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(E$,{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(zo,{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))]})]})},dDn=[60,66,50,55,75,45,40,65],pDn=[80,75,85,66,70,80,60,72],fDn=({searchQuery:e})=>{const{cards:t,loading:n,error:r,canLoadMore:s,isElectron:i,loadMore:o,reload:a,openRecentProject:c,openProjectPath:l}=cDn(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:`${dDn[p]}%`,backgroundColor:"var(--skeleton-base-light)"}}),u.jsx("div",{className:"mb-auto h-2.5 rounded-sm",style:{width:`${pDn[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(uDn,{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(Me,{variant:"outline",size:"sm",onClick:o,children:"加载更多"})})]})},hDn=["Claude Code","Cursor","Codex","Gemini","OpenCode","DeepSeek / IM"],mDn=["Feishu","Slack","Discord","DingTalk","WeCom","Telegram","Webhook / API"],gDn=()=>{const{openTeamsTab:e,openSettingsTab:t,teams:n,teamsLoading:r}=re(vt(i=>({openTeamsTab:i.openTeamsTab,openSettingsTab:i.openSettingsTab,teams:i.teams,teamsLoading:i.teamsLoading}))),s=!r&&n.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(rmt,{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(Emt,{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:hDn.map(i=>u.jsx("span",{className:"rounded-md border border-border bg-surface-overlay px-2 py-1 text-[11px] text-text-secondary",children:i},i))})]}),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(sMe,{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:mDn.map(i=>u.jsx("span",{className:"rounded-md border border-border bg-surface-overlay px-2 py-1 text-[11px] text-text-secondary",children:i},i))})]}),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(ac,{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.jsx("div",{className:"mb-8 flex items-center justify-center",children:u.jsxs("button",{onClick:e,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(ac,{className:"size-4"}),"选择团队"]})}),s?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:()=>t("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:()=>t("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:e,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.jsx("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:"最近项目"})}),u.jsx(fDn,{searchQuery:""})]})]})]})},zwe={search:"",categories:[],capabilities:[],installedOnly:!1};function ODn(){const[e,t]=O.useState("plugins"),[n,r]=O.useState(zwe),[s,i]=O.useState({field:"popularity",order:"desc"}),[o,a]=O.useState(null),[c,l]=O.useState(""),[d,p]=O.useState([]),[f,h]=O.useState(!1),[m,g]=O.useState([]),[_,b]=O.useState(null),[y,x]=O.useState(""),[S]=O.useState(!1),[v,T]=O.useState("name-asc"),[E,w]=O.useState(null),P=O.useRef(null),C=O.useRef(0);O.useEffect(()=>()=>{P.current&&clearTimeout(P.current),C.current+=1},[]),O.useEffect(()=>{e!=="plugins"&&o!==null&&a(null),e!=="mcp-servers"&&_!==null&&b(null),e!=="skills"&&E!==null&&w(null)},[e,_,o,E]);const k=O.useCallback(M=>{l(M);const U=++C.current;if(P.current&&clearTimeout(P.current),!M.trim()){p([]),g([]),h(!1);return}h(!0),P.current=setTimeout(()=>{if(!Z.mcpRegistry){C.current===U&&h(!1);return}Z.mcpRegistry.search(M).then(A=>{C.current===U&&(p(A.servers),g(A.warnings),h(!1))},()=>{C.current===U&&(h(!1),g(["Search failed"]))})},300)},[]),I=O.useCallback(M=>{r(U=>({...U,search:M}))},[]),Q=O.useCallback(M=>{r(U=>({...U,categories:U.categories.includes(M)?U.categories.filter(A=>A!==M):[...U.categories,M]}))},[]),$=O.useCallback(M=>{r(U=>({...U,capabilities:U.capabilities.includes(M)?U.capabilities.filter(A=>A!==M):[...U.capabilities,M]}))},[]),R=O.useCallback(()=>{r(M=>({...M,installedOnly:!M.installedOnly}))},[]),N=O.useCallback(()=>{r(zwe)},[]),j=O.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:Q,toggleCapability:$,toggleInstalledOnly:R,clearFilters:N,hasActiveFilters:j,mcpSearchQuery:c,mcpSearch:k,mcpSearchResults:d,mcpSearchLoading:f,mcpSearchWarnings:m,selectedMcpServerId:_,setSelectedMcpServerId:b,skillsSearchQuery:y,setSkillsSearchQuery:x,skillsInstalledOnly:S,skillsSort:v,setSkillsSort:T,selectedSkillId:E,setSelectedSkillId:w}}function _Dn(e){return Zse(e)}function bDn(e){return e.filter(t=>{const n=t.capabilities?.extensions;return n?n.plugins.ownership!=="provider-scoped"||n.mcp.ownership!=="provider-scoped"||n.skills.ownership!=="provider-scoped":!1})}function yDn(e){return e?.flavor==="agent_teams_orchestrator"}function xDn(e){switch(e){case"supported":return"支持";case"read-only":return"只读";default:return"不支持"}}function SDn(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 vKe(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 Bwe="Agent CLI";function ece(e,t=!1){return e?.flavor==="agent_teams_orchestrator"?!e.displayName||e.displayName==="agent_teams_orchestrator"?Bwe:e.displayName:e?.displayName?e.displayName:t?Bwe:"Agent CLI"}function Fwe(e,[t,n]){return Math.min(n,Math.max(t,e))}var vDn=[" ","Enter","ArrowUp","ArrowDown"],TDn=[" ","Enter"],by="Select",[fB,hB,EDn]=$We(by),[e1]=op(by,[EDn,O_]),mB=O_(),[wDn,M_]=e1(by),[kDn,CDn]=e1(by),TKe=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,g=mB(t),[_,b]=O.useState(null),[y,x]=O.useState(null),[S,v]=O.useState(!1),T=sae(l),[E,w]=hm({prop:r,defaultProp:s??!1,onChange:i,caller:by}),[P,C]=hm({prop:o,defaultProp:a,onChange:c,caller:by}),k=O.useRef(null),I=_?m||!!_.closest("form"):!0,[Q,$]=O.useState(new Set),R=Array.from(Q).map(N=>N.props.value).join(";");return u.jsx(lU,{...g,children:u.jsxs(wDn,{required:h,scope:t,trigger:_,onTriggerChange:b,valueNode:y,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:v,contentId:Aa(),value:P,onValueChange:C,open:E,onOpenChange:w,dir:T,triggerPointerDownPosRef:k,disabled:f,children:[u.jsx(fB.Provider,{scope:t,children:u.jsx(kDn,{scope:e.__scopeSelect,onNativeOptionAdd:O.useCallback(N=>{$(j=>new Set(j).add(N))},[]),onNativeOptionRemove:O.useCallback(N=>{$(j=>{const M=new Set(j);return M.delete(N),M})},[]),children:n})}),I?u.jsxs(WKe,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:p,value:P,onChange:N=>C(N.target.value),disabled:f,form:m,children:[P===void 0?u.jsx("option",{value:""}):null,Array.from(Q)]},R):null]})})};TKe.displayName=by;var EKe="SelectTrigger",wKe=O.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,i=mB(n),o=M_(EKe,n),a=o.disabled||r,c=rs(t,o.onTriggerChange),l=hB(n),d=O.useRef("touch"),[p,f,h]=HKe(g=>{const _=l().filter(x=>!x.disabled),b=_.find(x=>x.value===o.value),y=ZKe(_,g,b);y!==void 0&&o.onValueChange(y.value)}),m=g=>{a||(o.onOpenChange(!0),h()),g&&(o.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return u.jsx(S$,{asChild:!0,...i,children:u.jsx(hr.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":GKe(o.value)?"":void 0,...s,ref:c,onClick:bn(s.onClick,g=>{g.currentTarget.focus(),d.current!=="mouse"&&m(g)}),onPointerDown:bn(s.onPointerDown,g=>{d.current=g.pointerType;const _=g.target;_.hasPointerCapture(g.pointerId)&&_.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(m(g),g.preventDefault())}),onKeyDown:bn(s.onKeyDown,g=>{const _=p.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&f(g.key),!(_&&g.key===" ")&&vDn.includes(g.key)&&(m(),g.preventDefault())})})})});wKe.displayName=EKe;var kKe="SelectValue",CKe=O.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:i,placeholder:o="",...a}=e,c=M_(kKe,n),{onValueNodeHasChildrenChange:l}=c,d=i!==void 0,p=rs(t,c.onValueNodeChange);return ja(()=>{l(d)},[l,d]),u.jsx(hr.span,{...a,ref:p,style:{pointerEvents:"none"},children:GKe(c.value)?u.jsx(u.Fragment,{children:o}):i})});CKe.displayName=kKe;var RDn="SelectIcon",RKe=O.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return u.jsx(hr.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});RKe.displayName=RDn;var PDn="SelectPortal",PKe=e=>u.jsx(OE,{asChild:!0,...e});PKe.displayName=PDn;var yy="SelectContent",$Ke=O.forwardRef((e,t)=>{const n=M_(yy,e.__scopeSelect),[r,s]=O.useState();if(ja(()=>{s(new DocumentFragment)},[]),!n.open){const i=r;return i?Ti.createPortal(u.jsx(NKe,{scope:e.__scopeSelect,children:u.jsx(fB.Slot,{scope:e.__scopeSelect,children:u.jsx("div",{children:e.children})})}),i):null}return u.jsx(AKe,{...e,ref:t})});$Ke.displayName=yy;var _d=10,[NKe,Q_]=e1(yy),$Dn="SelectContentImpl",NDn=Fv("SelectContent.RemoveScroll"),AKe=O.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:g,avoidCollisions:_,...b}=e,y=M_(yy,n),[x,S]=O.useState(null),[v,T]=O.useState(null),E=rs(t,te=>S(te)),[w,P]=O.useState(null),[C,k]=O.useState(null),I=hB(n),[Q,$]=O.useState(!1),R=O.useRef(!1);O.useEffect(()=>{if(x)return hae(x)},[x]),fae();const N=O.useCallback(te=>{const[H,...G]=I().map(pe=>pe.ref.current),[ie]=G.slice(-1),ne=document.activeElement;for(const pe of te)if(pe===ne||(pe?.scrollIntoView({block:"nearest"}),pe===H&&v&&(v.scrollTop=0),pe===ie&&v&&(v.scrollTop=v.scrollHeight),pe?.focus(),document.activeElement!==ne))return},[I,v]),j=O.useCallback(()=>N([w,x]),[N,w,x]);O.useEffect(()=>{Q&&j()},[Q,j]);const{onOpenChange:M,triggerPointerDownPosRef:U}=y;O.useEffect(()=>{if(x){let te={x:0,y:0};const H=ie=>{te={x:Math.abs(Math.round(ie.pageX)-(U.current?.x??0)),y:Math.abs(Math.round(ie.pageY)-(U.current?.y??0))}},G=ie=>{te.x<=10&&te.y<=10?ie.preventDefault():x.contains(ie.target)||M(!1),document.removeEventListener("pointermove",H),U.current=null};return U.current!==null&&(document.addEventListener("pointermove",H),document.addEventListener("pointerup",G,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",H),document.removeEventListener("pointerup",G,{capture:!0})}}},[x,M,U]),O.useEffect(()=>{const te=()=>M(!1);return window.addEventListener("blur",te),window.addEventListener("resize",te),()=>{window.removeEventListener("blur",te),window.removeEventListener("resize",te)}},[M]);const[A,F]=HKe(te=>{const H=I().filter(ne=>!ne.disabled),G=H.find(ne=>ne.ref.current===document.activeElement),ie=ZKe(H,te,G);ie&&setTimeout(()=>ie.ref.current.focus())}),z=O.useCallback((te,H,G)=>{const ie=!R.current&&!G;(y.value!==void 0&&y.value===H||ie)&&(P(te),ie&&(R.current=!0))},[y.value]),D=O.useCallback(()=>x?.focus(),[x]),V=O.useCallback((te,H,G)=>{const ie=!R.current&&!G;(y.value!==void 0&&y.value===H||ie)&&k(te)},[y.value]),q=r==="popper"?xee:IKe,ee=q===xee?{side:a,sideOffset:c,align:l,alignOffset:d,arrowPadding:p,collisionBoundary:f,collisionPadding:h,sticky:m,hideWhenDetached:g,avoidCollisions:_}:{};return u.jsx(NKe,{scope:n,content:x,viewport:v,onViewportChange:T,itemRefCallback:z,selectedItem:w,onItemLeave:D,itemTextRefCallback:V,focusSelectedItem:j,selectedItemText:C,position:r,isPositioned:Q,searchRef:A,children:u.jsx(N3,{as:NDn,allowPinchZoom:!0,children:u.jsx(P3,{asChild:!0,trapped:y.open,onMountAutoFocus:te=>{te.preventDefault()},onUnmountAutoFocus:bn(s,te=>{y.trigger?.focus({preventScroll:!0}),te.preventDefault()}),children:u.jsx(mE,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:te=>te.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:u.jsx(q,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:te=>te.preventDefault(),...b,...ee,onPlaced:()=>$(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:bn(b.onKeyDown,te=>{const H=te.ctrlKey||te.altKey||te.metaKey;if(te.key==="Tab"&&te.preventDefault(),!H&&te.key.length===1&&F(te.key),["ArrowUp","ArrowDown","Home","End"].includes(te.key)){let ie=I().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);if(["ArrowUp","End"].includes(te.key)&&(ie=ie.slice().reverse()),["ArrowUp","ArrowDown"].includes(te.key)){const ne=te.target,pe=ie.indexOf(ne);ie=ie.slice(pe+1)}setTimeout(()=>N(ie)),te.preventDefault()}})})})})})})});AKe.displayName=$Dn;var ADn="SelectItemAlignedPosition",IKe=O.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,i=M_(yy,n),o=Q_(yy,n),[a,c]=O.useState(null),[l,d]=O.useState(null),p=rs(t,E=>d(E)),f=hB(n),h=O.useRef(!1),m=O.useRef(!0),{viewport:g,selectedItem:_,selectedItemText:b,focusSelectedItem:y}=o,x=O.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&l&&g&&_&&b){const E=i.trigger.getBoundingClientRect(),w=l.getBoundingClientRect(),P=i.valueNode.getBoundingClientRect(),C=b.getBoundingClientRect();if(i.dir!=="rtl"){const ne=C.left-w.left,pe=P.left-ne,Te=E.left-pe,_e=E.width+Te,be=Math.max(_e,w.width),Ie=window.innerWidth-_d,Se=Fwe(pe,[_d,Math.max(_d,Ie-be)]);a.style.minWidth=_e+"px",a.style.left=Se+"px"}else{const ne=w.right-C.right,pe=window.innerWidth-P.right-ne,Te=window.innerWidth-E.right-pe,_e=E.width+Te,be=Math.max(_e,w.width),Ie=window.innerWidth-_d,Se=Fwe(pe,[_d,Math.max(_d,Ie-be)]);a.style.minWidth=_e+"px",a.style.right=Se+"px"}const k=f(),I=window.innerHeight-_d*2,Q=g.scrollHeight,$=window.getComputedStyle(l),R=parseInt($.borderTopWidth,10),N=parseInt($.paddingTop,10),j=parseInt($.borderBottomWidth,10),M=parseInt($.paddingBottom,10),U=R+N+Q+M+j,A=Math.min(_.offsetHeight*5,U),F=window.getComputedStyle(g),z=parseInt(F.paddingTop,10),D=parseInt(F.paddingBottom,10),V=E.top+E.height/2-_d,q=I-V,ee=_.offsetHeight/2,te=_.offsetTop+ee,H=R+N+te,G=U-H;if(H<=V){const ne=k.length>0&&_===k[k.length-1].ref.current;a.style.bottom="0px";const pe=l.clientHeight-g.offsetTop-g.offsetHeight,Te=Math.max(q,ee+(ne?D:0)+pe+j),_e=H+Te;a.style.height=_e+"px"}else{const ne=k.length>0&&_===k[0].ref.current;a.style.top="0px";const Te=Math.max(V,R+g.offsetTop+(ne?z:0)+ee)+G;a.style.height=Te+"px",g.scrollTop=H-V+g.offsetTop}a.style.margin=`${_d}px 0`,a.style.minHeight=A+"px",a.style.maxHeight=I+"px",r?.(),requestAnimationFrame(()=>h.current=!0)}},[f,i.trigger,i.valueNode,a,l,g,_,b,i.dir,r]);ja(()=>x(),[x]);const[S,v]=O.useState();ja(()=>{l&&v(window.getComputedStyle(l).zIndex)},[l]);const T=O.useCallback(E=>{E&&m.current===!0&&(x(),y?.(),m.current=!1)},[x,y]);return u.jsx(MDn,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:T,children:u.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:u.jsx(hr.div,{...s,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});IKe.displayName=ADn;var IDn="SelectPopperPosition",xee=O.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=_d,...i}=e,o=mB(n);return u.jsx(cU,{...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)"}})});xee.displayName=IDn;var[MDn,tce]=e1(yy,{}),See="SelectViewport",MKe=O.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,i=Q_(See,n),o=tce(See,n),a=rs(t,i.onViewportChange),c=O.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(fB.Slot,{scope:n,children:u.jsx(hr.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:bn(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-_d*2,g=parseFloat(p.style.minHeight),_=parseFloat(p.style.height),b=Math.max(g,_);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})})})]})});MKe.displayName=See;var QKe="SelectGroup",[QDn,DDn]=e1(QKe),LDn=O.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Aa();return u.jsx(QDn,{scope:n,id:s,children:u.jsx(hr.div,{role:"group","aria-labelledby":s,...r,ref:t})})});LDn.displayName=QKe;var DKe="SelectLabel",LKe=O.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=DDn(DKe,n);return u.jsx(hr.div,{id:s.id,...r,ref:t})});LKe.displayName=DKe;var iX="SelectItem",[jDn,jKe]=e1(iX),XKe=O.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:i,...o}=e,a=M_(iX,n),c=Q_(iX,n),l=a.value===r,[d,p]=O.useState(i??""),[f,h]=O.useState(!1),m=rs(t,y=>c.itemRefCallback?.(y,r,s)),g=Aa(),_=O.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(jDn,{scope:n,value:r,disabled:s,textId:g,isSelected:l,onItemTextChange:O.useCallback(y=>{p(x=>x||(y?.textContent??"").trim())},[]),children:u.jsx(fB.ItemSlot,{scope:n,value:r,disabled:s,textValue:d,children:u.jsx(hr.div,{role:"option","aria-labelledby":g,"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:bn(o.onFocus,()=>h(!0)),onBlur:bn(o.onBlur,()=>h(!1)),onClick:bn(o.onClick,()=>{_.current!=="mouse"&&b()}),onPointerUp:bn(o.onPointerUp,()=>{_.current==="mouse"&&b()}),onPointerDown:bn(o.onPointerDown,y=>{_.current=y.pointerType}),onPointerMove:bn(o.onPointerMove,y=>{_.current=y.pointerType,s?c.onItemLeave?.():_.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:bn(o.onPointerLeave,y=>{y.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:bn(o.onKeyDown,y=>{c.searchRef?.current!==""&&y.key===" "||(TDn.includes(y.key)&&b(),y.key===" "&&y.preventDefault())})})})})});XKe.displayName=iX;var Ek="SelectItemText",UKe=O.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...i}=e,o=M_(Ek,n),a=Q_(Ek,n),c=jKe(Ek,n),l=CDn(Ek,n),[d,p]=O.useState(null),f=rs(t,b=>p(b),c.onItemTextChange,b=>a.itemTextRefCallback?.(b,c.value,c.disabled)),h=d?.textContent,m=O.useMemo(()=>u.jsx("option",{value:c.value,disabled:c.disabled,children:h},c.value),[c.disabled,c.value,h]),{onNativeOptionAdd:g,onNativeOptionRemove:_}=l;return ja(()=>(g(m),()=>_(m)),[g,_,m]),u.jsxs(u.Fragment,{children:[u.jsx(hr.span,{id:c.textId,...i,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Ti.createPortal(i.children,o.valueNode):null]})});UKe.displayName=Ek;var zKe="SelectItemIndicator",BKe=O.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return jKe(zKe,n).isSelected?u.jsx(hr.span,{"aria-hidden":!0,...r,ref:t}):null});BKe.displayName=zKe;var vee="SelectScrollUpButton",FKe=O.forwardRef((e,t)=>{const n=Q_(vee,e.__scopeSelect),r=tce(vee,e.__scopeSelect),[s,i]=O.useState(!1),o=rs(t,r.onScrollButtonChange);return ja(()=>{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(VKe,{...e,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});FKe.displayName=vee;var Tee="SelectScrollDownButton",YKe=O.forwardRef((e,t)=>{const n=Q_(Tee,e.__scopeSelect),r=tce(Tee,e.__scopeSelect),[s,i]=O.useState(!1),o=rs(t,r.onScrollButtonChange);return ja(()=>{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(VKe,{...e,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});YKe.displayName=Tee;var VKe=O.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,i=Q_("SelectScrollButton",n),o=O.useRef(null),a=hB(n),c=O.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return O.useEffect(()=>()=>c(),[c]),ja(()=>{a().find(d=>d.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),u.jsx(hr.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:bn(s.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:bn(s.onPointerMove,()=>{i.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:bn(s.onPointerLeave,()=>{c()})})}),XDn="SelectSeparator",qKe=O.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return u.jsx(hr.div,{"aria-hidden":!0,...r,ref:t})});qKe.displayName=XDn;var Eee="SelectArrow",UDn=O.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=mB(n),i=M_(Eee,n),o=Q_(Eee,n);return i.open&&o.position==="popper"?u.jsx(uU,{...s,...r,ref:t}):null});UDn.displayName=Eee;var zDn="SelectBubbleInput",WKe=O.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=O.useRef(null),i=rs(r,s),o=jZe(t);return O.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(hr.select,{...n,style:{...uIe,...n.style},ref:i,defaultValue:t})});WKe.displayName=zDn;function GKe(e){return e===""||e===void 0}function HKe(e){const t=BO(e),n=O.useRef(""),r=O.useRef(0),s=O.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=O.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return O.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,i]}function ZKe(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=BDn(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 BDn(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var FDn=TKe,KKe=wKe,YDn=CKe,VDn=RKe,qDn=PKe,JKe=$Ke,WDn=MKe,eJe=LKe,tJe=XKe,GDn=UKe,HDn=BKe,nJe=FKe,rJe=YKe,sJe=qKe;const qo=FDn,Wo=YDn,_o=O.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(KKe,{ref:r,className:st("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(VDn,{asChild:!0,children:u.jsx(Dr,{className:"size-4 opacity-50"})})]}));_o.displayName=KKe.displayName;const iJe=O.forwardRef(({className:e,...t},n)=>u.jsx(nJe,{ref:n,className:st("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(_E,{className:"size-4"})}));iJe.displayName=nJe.displayName;const oJe=O.forwardRef(({className:e,...t},n)=>u.jsx(rJe,{ref:n,className:st("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(Dr,{className:"size-4"})}));oJe.displayName=rJe.displayName;const bo=O.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>u.jsx(qDn,{children:u.jsxs(JKe,{ref:s,className:st("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(iJe,{}),u.jsx(WDn,{className:st("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),u.jsx(oJe,{})]})}));bo.displayName=JKe.displayName;const ZDn=O.forwardRef(({className:e,...t},n)=>u.jsx(eJe,{ref:n,className:st("px-2 py-1.5 text-sm font-semibold text-[var(--color-text-muted)]",e),...t}));ZDn.displayName=eJe.displayName;const qs=O.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(tJe,{ref:r,className:st("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(HDn,{children:u.jsx(qr,{className:"size-4"})})}),u.jsx(GDn,{children:t})]}));qs.displayName=tJe.displayName;const KDn=O.forwardRef(({className:e,...t},n)=>u.jsx(sJe,{ref:n,className:st("-mx-1 my-1 h-px bg-[var(--color-border)]",e),...t}));KDn.displayName=sJe.displayName;const JDn={mcp:[{value:"claudecode",label:"Claude Code"},{value:"cursor",label:"Cursor"}],skills:[{value:"claudecode",label:"Claude Code"},{value:"codex",label:"Codex"},{value:"gemini",label:"Gemini CLI"},{value:"opencode",label:"OpenCode"},{value:"cursor",label:"Cursor"}]},aJe=({capability:e,value:t,onChange:n,disabled:r})=>{const s=JDn[e];return u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(Zt,{className:"shrink-0 text-xs text-text-muted",children:"运行时"}),u.jsxs(qo,{value:t,onValueChange:n,disabled:r,children:[u.jsx(_o,{className:"h-8 w-40 text-xs",children:u.jsx(Wo,{placeholder:"选择运行时"})}),u.jsx(bo,{children:s.map(i=>u.jsx(qs,{value:i.value,className:"text-xs",children:i.label},i.value))})]})]})},eLn=/^[\w.-]{1,100}$/,tLn=[{value:"streamable-http",label:"Streamable HTTP"},{value:"sse",label:"SSE"},{value:"http",label:"HTTP"}],nLn=({open:e,onClose:t})=>{const n=re(N=>N.installCustomMcpServer),r=re(N=>N.cliStatus),s=Mse(r?.flavor),i=s==="global"?"user":s,[o,a]=O.useState(""),[c,l]=O.useState("stdio"),[d,p]=O.useState("claudecode"),[f,h]=O.useState(""),[m,g]=O.useState(""),[_,b]=O.useState(""),[y,x]=O.useState("streamable-http"),[S,v]=O.useState([]),[T,E]=O.useState(null),[w,P]=O.useState(!1),C=O.useRef(!1);O.useEffect(()=>{e&&!C.current&&(a(""),l("stdio"),h(""),g(""),b(""),x("streamable-http"),v([]),E(null),P(!1)),C.current=e},[e]);const k=async()=>{if(E(null),!o.trim()){E("Server name is required");return}if(!eLn.test(o)){E("Invalid server name. Use alphanumeric characters, dashes, underscores, dots.");return}let N;if(c==="stdio"){if(!f.trim()){E("npm package name is required");return}N={type:"stdio",npmPackage:f.trim(),npmVersion:m.trim()||void 0}}else{if(!_.trim()){E("Server URL is required");return}N={type:"http",url:_.trim(),transportType:y}}const j={serverName:o,scope:i,installSpec:N,envValues:{},headers:S.filter(M=>M.key.trim()&&M.value.trim()),harnessType:d};P(!0);try{await n(j),t()}catch(M){E(M instanceof Error?M.message:"安装失败")}finally{P(!1)}},I=()=>v(N=>[...N,{key:"",value:""}]),Q=N=>v(j=>j.filter((M,U)=>U!==N)),$=(N,j,M)=>v(U=>U.map((A,F)=>F===N?{...A,[j]:M}:A)),R=o.trim()&&(c==="stdio"?f.trim():_.trim())&&!w;return u.jsx(us,{open:e,onOpenChange:N=>!N&&t(),children:u.jsxs(ts,{className:"max-h-[85vh] w-full max-w-lg overflow-y-auto",children:[u.jsx(ds,{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(OU,{className:"size-4 text-text-muted"})}),u.jsxs("div",{children:[u.jsx(ns,{children:"添加自定义 MCP 服务器"}),u.jsx(oi,{children:"不通过目录,手动添加一个服务器。"})]})]})}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Zt,{htmlFor:"custom-name",className:"text-xs",children:"服务器名称"}),u.jsx(An,{id:"custom-name",value:o,onChange:N=>a(N.target.value),placeholder:"my-server",className:"h-8 text-sm",autoFocus:!0})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Zt,{className:"text-xs",children:"传输方式"}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(Me,{type:"button",variant:c==="stdio"?"default":"outline",size:"sm",onClick:()=>l("stdio"),children:"Stdio (npm)"}),u.jsx(Me,{type:"button",variant:c==="http"?"default":"outline",size:"sm",onClick:()=>l("http"),children:"HTTP / SSE"})]})]}),c==="stdio"&&u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Zt,{htmlFor:"custom-npm",className:"text-xs",children:"npm 包"}),u.jsx(An,{id:"custom-npm",value:f,onChange:N=>h(N.target.value),placeholder:"@example/mcp-server",className:"h-8 font-mono text-sm"})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Zt,{htmlFor:"custom-version",className:"text-xs",children:"版本(可选)"}),u.jsx(An,{id:"custom-version",value:m,onChange:N=>g(N.target.value),placeholder:"latest",className:"h-8 text-sm"})]})]}),c==="http"&&u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Zt,{htmlFor:"custom-url",className:"text-xs",children:"服务器 URL"}),u.jsx(An,{id:"custom-url",value:_,onChange:N=>b(N.target.value),placeholder:"https://api.example.com/mcp",className:"h-8 text-sm"})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Zt,{className:"text-xs",children:"传输类型"}),u.jsxs(qo,{value:y,onValueChange:N=>x(N),children:[u.jsx(_o,{className:"h-8 text-sm",children:u.jsx(Wo,{})}),u.jsx(bo,{children:tLn.map(N=>u.jsx(qs,{value:N.value,children:N.label},N.value))})]})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(Zt,{className:"text-xs",children:"请求头"}),u.jsxs(Me,{variant:"ghost",size:"sm",onClick:I,className:"h-6 px-1.5 text-xs",children:[u.jsx(oc,{className:"mr-1 size-3"}),"添加"]})]}),S.length>0&&u.jsx("div",{className:"max-h-32 space-y-2 overflow-y-auto",children:S.map((N,j)=>u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(An,{value:N.key,onChange:M=>$(j,"key",M.target.value),className:"h-7 w-32 text-xs",placeholder:"Header-Name"}),u.jsx(An,{value:N.value,onChange:M=>$(j,"value",M.target.value),className:"h-7 flex-1 text-xs",placeholder:"value"}),u.jsx(Me,{variant:"ghost",size:"icon",className:"size-7 text-red-400 hover:bg-red-500/10",onClick:()=>Q(j),children:u.jsx(Ai,{className:"size-3"})})]},j))})]})]}),u.jsx(aJe,{capability:"mcp",value:d,onChange:p}),T&&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:T}),u.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[u.jsx(Me,{variant:"ghost",size:"sm",onClick:t,children:"取消"}),u.jsx(Me,{size:"sm",disabled:!R,onClick:()=>void k(),children:w?"正在安装...":"安装"})]})]})]})})},rLn=({projectPath:e})=>{const[t,n]=O.useState("global"),[r,s]=O.useState([]),[i,o]=O.useState(!0),[a,c]=O.useState(!1),[l,d]=O.useState({}),[p,f]=O.useState(!1),h=O.useCallback(async()=>{o(!0);try{const T=t==="global"?Z.credentials?await Z.credentials.getSkillGlobalEnv("__global__"):{}:e&&Z.credentials?await Z.credentials.getProjectEnv(e):{},E={};for(const[k,I]of Object.entries(T))typeof I=="string"&&(E[k]=I);const w=new Map;if(Z.skills)try{const k=await Z.skills.list(e??void 0);for(const I of k)if(I.requiredEnv?.length)for(const Q of I.requiredEnv){const $=w.get(Q.name);$?($.from.push(I.name),Q.isRequired!==!1&&($.isRequired=!0)):w.set(Q.name,{name:Q.name,description:Q.description,isRequired:Q.isRequired!==!1,from:[I.name]})}}catch{}const P=new Set([...Object.keys(E),...w.keys()]),C=[];for(const[,k]of w)C.push({key:k.name,value:E[k.name]??"",source:k});for(const k of Object.keys(E))w.has(k)||C.push({key:k,value:E[k]});s(C)}catch{s([])}finally{o(!1),f(!1)}},[t,e]);O.useEffect(()=>{h()},[h]);const m=()=>{s(T=>[...T,{key:"",value:"",isNew:!0}]),f(!0)},g=T=>{s(E=>E.filter((w,P)=>P!==T)),f(!0)},_=(T,E,w)=>{s(P=>P.map((C,k)=>k===T?{...C,[E]:w}:C)),f(!0)},b=T=>{d(E=>({...E,[T]:!E[T]}))},y=async()=>{const T={};for(const E of r){const w=E.key.trim();w&&(T[w]=E.value)}c(!0);try{t==="global"?await Z.credentials?.saveSkillGlobalEnv("__global__",T):e&&await Z.credentials?.saveProjectEnv(e,T),await h()}catch{}finally{c(!1)}},S=r.filter(T=>T.source?.isRequired).filter(T=>!T.value.trim()),v=r.filter(T=>T.key.trim()&&T.value.trim()).length;return u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx(Zt,{className:"text-sm",children:"环境变量"}),u.jsxs("p",{className:"text-xs text-text-muted",children:["配置运行时环境变量,启动 agent 时自动注入。",t==="global"?"全局变量所有项目生效。":"项目变量仅当前项目生效并可覆盖全局。"]})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Me,{variant:"ghost",size:"icon",className:"size-7",onClick:()=>void h(),disabled:i,children:u.jsx(go,{className:`size-3.5 ${i?"animate-spin":""}`})}),u.jsxs(qo,{value:t,onValueChange:T=>n(T),children:[u.jsx(_o,{className:"h-8 w-28 text-xs",children:u.jsx(Wo,{})}),u.jsxs(bo,{children:[u.jsx(qs,{value:"global",children:"全局"}),u.jsx(qs,{value:"project",disabled:!e,children:e?"当前项目":"无项目"})]})]})]})]}),i?u.jsx("div",{className:"py-8 text-center text-xs text-text-muted",children:"扫描环境变量需求..."}):u.jsxs(u.Fragment,{children:[S.length>0&&u.jsxs("div",{className:"flex items-start 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(zn,{className:"mt-0.5 size-3.5 shrink-0"}),u.jsxs("span",{children:["缺少必填变量:",S.map(T=>T.key).join(", ")]})]}),u.jsx("div",{className:"space-y-3",children:r.map((T,E)=>u.jsxs("div",{className:"space-y-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(An,{value:T.key,onChange:w=>_(E,"key",w.target.value),className:"h-8 w-48 font-mono text-xs",placeholder:"ENV_VAR_NAME",disabled:!!T.source}),u.jsxs("div",{className:"relative flex-1",children:[u.jsx(An,{type:l[E]?"text":"password",value:T.value,onChange:w=>_(E,"value",w.target.value),className:"h-8 pr-8 text-xs",placeholder:T.source?.isRequired?"必填":"可选"}),u.jsx("button",{type:"button",onClick:()=>b(E),className:"hover:text-text-default absolute right-2 top-1/2 -translate-y-1/2 text-text-muted",children:l[E]?u.jsx(hU,{className:"size-3.5"}):u.jsx(Qb,{className:"size-3.5"})})]}),u.jsx(Me,{variant:"ghost",size:"icon",className:"size-8 shrink-0 text-red-400 hover:bg-red-500/10",onClick:()=>g(E),children:u.jsx(Ai,{className:"size-3.5"})})]}),T.source&&u.jsxs("div",{className:"flex items-center gap-2 pl-1 text-[11px] text-text-muted",children:[u.jsx("span",{className:`rounded px-1 py-0.5 font-medium ${T.source.isRequired?T.value.trim()?"bg-green-500/10 text-green-500":"bg-red-500/10 text-red-400":"bg-surface-raised text-text-muted"}`,children:T.source.isRequired?T.value.trim()?"已配置":"必填":"可选"}),u.jsxs("span",{children:["来自 ",T.source.from.join(", ")]}),T.source.description&&u.jsxs("span",{children:["— ",T.source.description]})]})]},E))}),u.jsxs(Me,{variant:"outline",size:"sm",onClick:m,className:"h-8 gap-1.5 text-xs",children:[u.jsx(oc,{className:"size-3.5"}),"添加变量"]}),r.length>0&&u.jsxs("div",{className:"flex items-center gap-3 text-xs text-text-muted",children:[u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx(ma,{className:"size-3 text-green-500"}),v," 已配置"]}),S.length>0&&u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx(Wh,{className:"size-3 text-red-400"}),S.length," 缺失"]})]}),r.length===0&&u.jsxs("div",{className:"py-6 text-center text-xs text-text-muted",children:["未检测到需要的环境变量。安装的 Skills 如果声明了所需变量,会自动出现在这里。",u.jsx("br",{}),"也可以手动添加。"]}),p&&u.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[u.jsx(Me,{variant:"ghost",size:"sm",onClick:h,children:"取消"}),u.jsx(Me,{size:"sm",onClick:()=>void y(),disabled:a,children:a?"保存中...":"保存"})]})]})]})},nce=({value:e,onChange:t,placeholder:n="Search...",debounceMs:r})=>{const[s,i]=O.useState(e),o=O.useRef(null);O.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),O.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(An,{type:"text",value:s,onChange:c=>a(c.target.value),placeholder:n,className:"pl-9 pr-8"}),s&&u.jsx(Me,{variant:"ghost",size:"icon",onClick:()=>a(""),className:"absolute right-1 top-1/2 size-7 -translate-y-1/2",children:u.jsx(Pr,{className:"size-3.5"})})]})},gB=({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}=re(vt(S=>({cliStatus:S.cliStatus,cliStatusLoading:S.cliStatusLoading}))),m=qg({isInstalled:t,cliStatus:c??d,cliStatusLoading:l??p,section:s}),g=i||!!m,[_,b]=O.useState(null);O.useEffect(()=>{(e==="idle"||e==="success")&&b(null)},[e]);const y=_??(t?"uninstall":"install");if(e==="pending")return u.jsxs(Me,{size:o,variant:"outline",disabled:!0,children:[u.jsx(zt,{className:"size-3.5 animate-spin"}),u.jsx("span",{className:"ml-1.5",children:y==="uninstall"?"正在移除...":"正在安装..."})]});if(e==="success")return u.jsxs(Me,{size:o,variant:"outline",disabled:!0,className:"text-green-400",children:[u.jsx(qr,{className:"size-3.5"}),u.jsx("span",{className:"ml-1.5",children:"完成"})]});if(e==="error"){const S=u.jsx(Me,{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:g,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(tc,{children:u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx("span",{tabIndex:0,children:S})}),u.jsx(it,{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(Me,{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:g,children:[u.jsx(Ai,{className:"size-3.5"}),u.jsx("span",{className:"ml-1.5",children:"卸载"})]}):u.jsx(Me,{size:o,variant:"default",onClick:S=>{S.stopPropagation(),b("install"),n()},disabled:g,children:"安装"});return m?u.jsx(tc,{children:u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx("span",{tabIndex:0,children:x})}),u.jsx(it,{className:"max-w-64",children:m})]})}):x},rce=({source:e})=>e==="official"?u.jsx($t,{className:"border-blue-500/30 bg-blue-500/10 text-blue-400",variant:"outline",children:"Official"}):e==="glama"?u.jsx($t,{className:"border-zinc-500/30 bg-zinc-500/10 text-zinc-400",variant:"outline",children:"Glama"}):u.jsx($t,{className:"border-orange-500/30 bg-orange-500/10 text-orange-400",variant:"outline",children:"Community"}),Ywe=({server:e,isInstalled:t,installedEntry:n,installedEntries:r=[],diagnostic:s,diagnosticsLoading:i,onClick:o,cliStatus:a,cliStatusLoading:c})=>{const l=re($=>$.cliStatus),d=a??l,p=Mse(d?.flavor),f=oP(e.id,p),h=re($=>$.mcpInstallProgress[f]??"idle"),m=re($=>$.installMcpServer),g=re($=>$.uninstallMcpServer),_=re($=>$.installErrors[f]),b=re($=>e.repositoryUrl?$.mcpGitHubStars[e.repositoryUrl]:void 0),y=!!e.installSpec,x=r.length?r:n?[n]:[],S=e.installSpec?.type==="http"||e.envVars.length>0||e.requiresAuth||(e.authHeaders?.length??0)>0,v=dC(e.name),T=x.find($=>$.scope===p)??null,E=pXe(x),w=t&&x.length===1&&T?.name===v&&!S,P=y&&(t?w:!S),[C,k]=O.useState(!1),I=!!e.iconUrl&&!C,Q=s?.status==="connected"?"border-emerald-500/30 bg-emerald-500/10 text-emerald-400":s?.status==="needs-authentication"?"border-amber-500/30 bg-amber-500/10 text-amber-400":s?.status==="failed"?"border-red-500/30 bg-red-500/10 text-red-400":"border-border bg-surface-raised text-text-muted";return u.jsxs("div",{role:"button",tabIndex:0,onClick:()=>o(e.id),onKeyDown:$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),o(e.id))},className:`relative flex w-full cursor-pointer flex-col gap-2 overflow-hidden rounded-lg border p-4 text-left transition-all duration-200 hover:border-border-emphasis hover:bg-surface-raised hover:shadow-[0_0_12px_rgba(255,255,255,0.02)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--color-border-emphasis)] ${t?"border-l-2 border-border border-l-emerald-500/30":"border-border"}`,children:[u.jsxs("div",{className:"flex items-start gap-2.5",children:[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:()=>k(!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(rce,{source:e.source})})]}),u.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[t&&u.jsx($t,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-400",variant:"outline",children:E??"Installed"}),t&&i&&!s&&u.jsx($t,{className:"border-border bg-surface-raised text-text-muted",variant:"outline",children:"Checking..."}),s&&u.jsx($t,{className:Q,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(SE,{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(Oft,{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(D0,{className:"size-3"}),"Auth"]}),e.version&&u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(dMe,{className:"size-3"}),e.version]}),e.updatedAt&&u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(_l,{className:"size-3"}),E3(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(opt,{className:"size-3"}),"Remote"]}),e.hostingType==="local"&&u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(tMe,{className:"size-3"}),"Local"]}),e.hostingType==="both"&&u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(BD,{className:"size-3"}),"Both"]}),e.repositoryUrl&&u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsxs("button",{className:"inline-flex items-center gap-1.5 text-text-muted transition-colors hover:text-text",onClick:$=>{$.stopPropagation(),Z.openExternal(e.repositoryUrl)},children:[u.jsx(Hpt,{className:"size-3.5"}),b!=null&&u.jsxs("span",{className:"inline-flex items-center gap-0.5",children:[u.jsx(cMe,{className:"size-3 fill-amber-400 text-amber-400"}),jhn(b)]})]})}),u.jsx(it,{side:"top",children:"Repository"})]}),e.websiteUrl&&u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx("button",{className:"inline-flex items-center text-text-muted transition-colors hover:text-text",onClick:$=>{$.stopPropagation(),Z.openExternal(e.websiteUrl)},children:u.jsx(BD,{className:"size-3.5"})})}),u.jsx(it,{side:"top",children:"Website"})]})]}),P&&u.jsx("div",{className:"shrink-0",children:u.jsx(gB,{state:h,isInstalled:t,section:"mcp",cliStatus:d,cliStatusLoading:c,onInstall:()=>m({registryId:e.id,serverName:v,scope:p,envValues:{},headers:[]}),onUninstall:()=>g(e.id,T?.name??v,p),size:"sm",errorMessage:_})}),y&&(!P||S)&&u.jsx("div",{className:"shrink-0",children:u.jsx(Me,{size:"sm",variant:"outline",onClick:$=>{$.stopPropagation(),o(e.id)},children:t?"Manage":"Configure"})})]})]})},sLn=({server:e,isInstalled:t,installedEntry:n,installedEntries:r=[],diagnostic:s,diagnosticsLoading:i,projectPath:o,open:a,onClose:c,cliStatus:l,cliStatusLoading:d})=>{const p=re(ue=>ue.cliStatus),f=l??p,h=Mse(f?.flavor),[m,g]=O.useState(h),_=e?oP(e.id,m,o):null,b=re(ue=>(_?ue.mcpInstallProgress[_]:void 0)??"idle"),y=re(ue=>ue.installMcpServer),x=re(ue=>ue.uninstallMcpServer),S=re(ue=>_?ue.installErrors[_]:void 0),v=re(ue=>e?.repositoryUrl?ue.mcpGitHubStars[e.repositoryUrl]:void 0),[T,E]=O.useState(""),[w,P]=O.useState("claudecode"),[C,k]=O.useState({}),[I,Q]=O.useState([]),[$,R]=O.useState(!1),[N,j]=O.useState(new Set),M=O.useRef({}),U=O.useRef(h),A=r.length?r:n?[n]:[],F=[{value:h,label:nOe(h,f?.flavor)},...h!=="user"&&A.some(ue=>ue.scope==="user")?[{value:"user",label:nOe("user",f?.flavor)}]:[],{value:"project",label:"项目"},{value:"local",label:"本地"}],z=dXe(A),D=A.find(ue=>ue.scope===m)??null,V=pXe(A),q=e?.envVars.map(ue=>ue.name).sort().join("\0")??"",ee=f?.flavor==="agent_teams_orchestrator"?"运行时状态":"Claude 状态",te=m0(m)?o??void 0:void 0;if(O.useEffect(()=>{!e||!a||(k(Object.fromEntries(e.envVars.map(ue=>[ue.name,""]))),Q((e.authHeaders??[]).map(ue=>({key:ue.key,value:"",secret:ue.isSecret,description:ue.description,isRequired:ue.isRequired,valueTemplate:ue.valueTemplate,locked:!0}))),E(z?.name??dC(e.name)),g(z?.scope??h),R(!1),j(new Set),M.current={})},[a,z?.name,z?.scope,e?.id]),O.useEffect(()=>{if(!a){U.current=h;return}const ue=U.current;ue!==h&&!z&&m===ue&&A2t(m)&&g(h),U.current=h},[h,a,z,m]),O.useEffect(()=>{!e||!a||!D||E(D.name)},[a,D,e]),O.useEffect(()=>{a&&m0(m)&&!o&&g(h)},[h,a,o,m]),O.useEffect(()=>{if(!e||!a||e.envVars.length===0||!Z.apiKeys)return;const ue=e.envVars.map(ae=>ae.name);Z.apiKeys.lookup(ue,te).then(ae=>{const $e=M.current,qe={};for(const ot of ae)qe[ot.envVarName]=ot.value;k(ot=>{const Ot={...ot};for(const[nt,Ge]of Object.entries($e))!(nt in qe)&&Ot[nt]===Ge&&(Ot[nt]="");for(const[nt,Ge]of Object.entries(qe))(!Ot[nt]||Ot[nt]===$e[nt])&&(Ot[nt]=Ge);return Ot}),j(new Set(Object.keys(qe))),M.current=qe},()=>{})},[te,q,a,e?.id]),!e)return u.jsx(u.Fragment,{});const H=!!e.installSpec,G=e.installSpec?.type==="http",ie=!!e.iconUrl&&!$,ne=e.installSpec?.type==="stdio"?`https://www.npmjs.com/package/${e.installSpec.npmPackage}`:null,pe=I.some(ue=>ue.locked),Te=e.envVars.some(ue=>ue.isRequired&&!C[ue.name]?.trim()),_e=I.some(ue=>ue.isRequired&&!ue.value.trim()),be=D!==null,Ie=D?.name??T,Se=D?.scope??m,oe=m0(m)&&!o,Oe=!T.trim()||Te||_e||oe,K=qg({isInstalled:!1,cliStatus:f,cliStatusLoading:d??!1,section:"mcp"}),Y=qg({isInstalled:!0,cliStatus:f,cliStatusLoading:d??!1,section:"mcp"}),W=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",se=()=>{y({registryId:e.id,serverName:T,scope:m,projectPath:m0(m)?o??void 0:void 0,envValues:C,headers:I,harnessType:w})},he=()=>{x(e.id,Ie,Se,m0(Se)?o??void 0:void 0)},we=()=>{Q(ue=>[...ue,{key:"",value:""}])},J=ue=>{Q(ae=>ae.filter(($e,qe)=>qe!==ue))},de=(ue,ae,$e)=>{Q(qe=>qe.map((ot,Ot)=>Ot===ue?{...ot,[ae]:$e}:ot))};return u.jsx(us,{open:a,onOpenChange:ue=>!ue&&c(),children:u.jsxs(ts,{className:"max-h-[85vh] max-w-2xl overflow-y-auto",children:[u.jsx(ds,{children:u.jsxs("div",{className:"flex items-start gap-3",children:[ie&&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:()=>R(!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(ns,{className:"truncate",children:e.name}),u.jsx(oi,{className:"mt-1",children:e.description})]}),u.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[t&&u.jsx($t,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-400",variant:"outline",children:V??"已安装"}),e.source!=="official"&&u.jsx(rce,{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(cMe,{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(Me,{variant:"link",className:"h-auto p-0 text-sm text-blue-400",onClick:()=>void Z.openExternal(ne),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(D0,{className:"size-4"}),"此服务器需要认证"]}),G&&!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 密钥。若安装后连接失败,请查看提供商文档。"}),be&&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:ee}),i&&!s?u.jsx($t,{className:"border-border bg-surface-raised text-text-muted",variant:"outline",children:"检查中..."}):s?u.jsx($t,{className:W,variant:"outline",children:s.statusLabel}):u.jsx($t,{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})]})]}),H&&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:be?"管理安装":"安装服务器"}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Zt,{htmlFor:"server-name",className:"text-xs",children:"服务器名称"}),u.jsx(An,{id:"server-name",value:T,onChange:ue=>E(ue.target.value),placeholder:"my-server",className:"h-8 text-sm",disabled:be})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Zt,{className:"text-xs",children:"范围"}),u.jsxs(qo,{value:m,onValueChange:ue=>g(ue),children:[u.jsx(_o,{className:"h-8 text-sm",children:u.jsx(Wo,{})}),u.jsx(bo,{children:F.map(ue=>u.jsx(qs,{value:ue.value,disabled:m0(ue.value)&&!o,children:ue.label},ue.value))})]})]}),u.jsx(aJe,{capability:"mcp",value:w,onChange:P,disabled:be}),e.envVars.length>0&&u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Zt,{className:"text-xs",children:"环境变量"}),u.jsx("div",{className:"space-y-2",children:e.envVars.map(ue=>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:ue.name}),u.jsx(An,{type:ue.isSecret?"password":"text",value:C[ue.name]??"",onChange:ae=>k($e=>({...$e,[ue.name]:ae.target.value})),className:"h-7 flex-1 text-xs",placeholder:ue.description??ue.name}),N.has(ue.name)&&C[ue.name]&&u.jsx("span",{className:"shrink-0 text-[10px] text-emerald-400",children:"已自动填充"})]},ue.name))})]}),G&&u.jsxs("div",{className:"space-y-1.5",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(Zt,{className:"text-xs",children:"请求头"}),u.jsxs(Me,{variant:"ghost",size:"sm",onClick:we,className:"h-6 px-1.5 text-xs",children:[u.jsx(oc,{className:"mr-1 size-3"}),pe?"添加自定义":"添加"]})]}),I.length>0&&u.jsx("div",{className:"space-y-2",children:I.map((ue,ae)=>u.jsxs("div",{className:"space-y-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[ue.locked?u.jsx("code",{className:"w-32 shrink-0 truncate text-xs text-blue-400",children:ue.key}):u.jsx(An,{value:ue.key,onChange:$e=>de(ae,"key",$e.target.value),className:"h-7 w-32 text-xs",placeholder:"Header-Name"}),u.jsx(An,{type:ue.secret?"password":"text",value:ue.value,onChange:$e=>de(ae,"value",$e.target.value),className:"h-7 flex-1 text-xs",placeholder:ue.valueTemplate??ue.description??"value"}),u.jsx(Me,{variant:"ghost",size:"icon",className:"size-7 text-red-400 hover:bg-red-500/10",onClick:()=>J(ae),disabled:ue.locked&&ue.isRequired,children:u.jsx(Ai,{className:"size-3"})})]}),(ue.description||ue.valueTemplate||ue.isRequired)&&u.jsx("p",{className:"text-[10px] text-text-muted",children:[ue.isRequired?"必填":null,ue.description,ue.valueTemplate].filter(Boolean).join(" • ")})]},ae))})]}),u.jsx("div",{className:"flex items-center justify-end gap-2 pt-1",children:be?u.jsxs(u.Fragment,{children:[u.jsxs(Me,{variant:"ghost",size:"sm",className:"border-red-500/30 text-red-400 hover:bg-red-500/10","data-testid":"uninstall-button",onClick:he,disabled:!!Y,children:[u.jsx(Ai,{className:"size-3.5"}),u.jsx("span",{className:"ml-1.5",children:"卸载"})]}),b==="pending"?u.jsxs(Me,{size:"default",disabled:!0,children:[u.jsx(zt,{className:"size-3.5 animate-spin"}),u.jsx("span",{className:"ml-1.5",children:"保存并重启中..."})]}):b==="success"?u.jsxs(Me,{size:"default",disabled:!0,className:"text-green-400",children:[u.jsx(qr,{className:"size-3.5"}),u.jsx("span",{className:"ml-1.5",children:"完成"})]}):b==="error"?u.jsxs("div",{className:"flex max-w-64 flex-col items-end gap-1",children:[u.jsx(tc,{children:u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx("span",{tabIndex:0,children:u.jsx(Me,{size:"default",variant:"outline",className:"border-red-500/30 text-red-400 hover:bg-red-500/10",onClick:se,disabled:Oe||!!K,children:"保存并重启"})})}),S&&u.jsx(it,{className:"max-w-64 text-red-300",children:S})]})}),S&&u.jsx("p",{className:"text-right text-[11px] leading-4 text-red-300",children:S})]}):u.jsx(Me,{size:"default","data-testid":"save-restart-button",onClick:se,disabled:Oe||!!K,children:"保存并重启"})]}):u.jsx(gB,{state:b,isInstalled:!1,section:"mcp",cliStatus:f,cliStatusLoading:d,onInstall:se,onUninstall:he,disabled:Oe,size:"default",errorMessage:S})})]}),!H&&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(SE,{className:"size-4"}),"工具(",e.tools.length,")"]}),u.jsx("div",{className:"max-h-48 space-y-1 overflow-y-auto",children:e.tools.map(ue=>u.jsxs("div",{className:"rounded-md bg-surface-raised p-2 text-xs",children:[u.jsx("code",{className:"font-mono text-text",children:ue.name}),ue.description&&u.jsx("p",{className:"mt-0.5 text-text-muted",children:ue.description})]},ue.name))})]}),u.jsxs("div",{className:"flex items-center gap-4",children:[e.repositoryUrl&&u.jsxs(Me,{variant:"link",className:"h-auto p-0 text-sm text-blue-400",onClick:()=>void Z.openExternal(e.repositoryUrl),children:[u.jsx(zd,{className:"mr-1 size-3.5"}),"仓库"]}),e.glamaUrl&&u.jsxs(Me,{variant:"link",className:"h-auto p-0 text-sm text-blue-400",onClick:()=>void Z.openExternal(e.glamaUrl),children:[u.jsx(zd,{className:"mr-1 size-3.5"}),"Glama"]}),e.websiteUrl&&u.jsxs(Me,{variant:"link",className:"h-auto p-0 text-sm text-blue-400",onClick:()=>void Z.openExternal(e.websiteUrl),children:[u.jsx(zd,{className:"mr-1 size-3.5"}),"网站"]})]})]})})},iLn=[{value:"name-asc",label:"Name A→Z"},{value:"name-desc",label:"Name Z→A"},{value:"tools-desc",label:"Most tools"}];function oLn(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 aLn=({projectPath:e,mcpSearchQuery:t,mcpSearch:n,mcpSearchResults:r,mcpSearchLoading:s,mcpSearchWarnings:i,selectedMcpServerId:o,setSelectedMcpServerId:a,cliStatus:c,cliStatusLoading:l})=>{const d=_T(e),{browseCatalog:p,browseNextCursor:f,browseLoading:h,browseError:m,mcpBrowse:g,installedServersByProjectPath:_,installedServersFallback:b,fetchMcpGitHubStars:y,mcpDiagnosticsByProjectPath:x,mcpDiagnosticsFallback:S,mcpDiagnosticsLoadingByProjectPath:v,mcpDiagnosticsLoadingFallback:T,mcpDiagnosticsErrorByProjectPath:E,mcpDiagnosticsErrorFallback:w,mcpDiagnosticsLastCheckedAtByProjectPath:P,mcpDiagnosticsLastCheckedAtFallback:C,runMcpDiagnostics:k,uninstallMcpServer:I,mcpInstallProgress:Q}=re(vt(Y=>({browseCatalog:Y.mcpBrowseCatalog,browseNextCursor:Y.mcpBrowseNextCursor,browseLoading:Y.mcpBrowseLoading,browseError:Y.mcpBrowseError,mcpBrowse:Y.mcpBrowse,installedServersByProjectPath:Y.mcpInstalledServersByProjectPath,installedServersFallback:Y.mcpInstalledServers,fetchMcpGitHubStars:Y.fetchMcpGitHubStars,mcpDiagnosticsByProjectPath:Y.mcpDiagnosticsByProjectPath,mcpDiagnosticsFallback:Y.mcpDiagnostics,mcpDiagnosticsLoadingByProjectPath:Y.mcpDiagnosticsLoadingByProjectPath,mcpDiagnosticsLoadingFallback:Y.mcpDiagnosticsLoading,mcpDiagnosticsErrorByProjectPath:Y.mcpDiagnosticsErrorByProjectPath,mcpDiagnosticsErrorFallback:Y.mcpDiagnosticsError,mcpDiagnosticsLastCheckedAtByProjectPath:Y.mcpDiagnosticsLastCheckedAtByProjectPath,mcpDiagnosticsLastCheckedAtFallback:Y.mcpDiagnosticsLastCheckedAt,runMcpDiagnostics:Y.runMcpDiagnostics,uninstallMcpServer:Y.uninstallMcpServer,mcpInstallProgress:Y.mcpInstallProgress}))),$=re(Y=>Y.cliStatus),R=re(Y=>Y.cliStatusLoading),N=c??$,j=l??R,M=_?.[d]??b??[],U=x?.[d]??S??{},A=v?.[d]??T??!1,F=E?.[d]??w??null,z=P?.[d]??C??null,[D,V]=O.useState("name-asc");O.useEffect(()=>{p.length===0&&!h&&!m&&g()},[p.length,m,h,g]);const q=O.useMemo(()=>N===null||typeof N>"u"?j?"正在检查运行时状态...":"正在检查运行时可用性...":N?.installed===!1?N.binaryPath&&N.launchError?"已找到配置的运行时,但启动失败。请前往首页修复或重新安装。":"需要配置运行时。请前往首页安装或修复。":null,[N,j]);O.useEffect(()=>{q||k(e??void 0)},[q,e,k]),O.useEffect(()=>{const Y=p.map(W=>W.repositoryUrl).filter(W=>!!W);Y.length>0&&y(Y)},[p,y]);const ee=t.trim().length>0,te=ee?r:p,H=ee?s:h,G=ee?i:[],ie=O.useMemo(()=>new Set(M.map(Y=>Y.name.toLowerCase())),[M]),ne=O.useMemo(()=>{const Y=new Map;for(const W of M){const se=W.name.toLowerCase();Y.set(se,[...Y.get(se)??[],W])}return Y},[M]),pe=Y=>ie.has(dC(Y.name)),Te=Y=>ne.get(dC(Y.name))??[],_e=Y=>dXe(Te(Y)),be=Y=>{const W=_e(Y);return W?U[tS(W.name,W.scope)]??U[tS(W.name)]??U[W.name]??null:null},Ie=O.useMemo(()=>Object.values(U).sort((Y,W)=>Y.name.localeCompare(W.name)),[U]),Se=Y=>{switch(Y){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"}},oe=O.useMemo(()=>oLn(te,D),[te,D]),Oe=ece(N,!0),K=O.useMemo(()=>o?oe.find(Y=>Y.id===o)??p.find(Y=>Y.id===o)??r.find(Y=>Y.id===o)??null:null,[oe,p,r,o]);return u.jsxs("div",{className:"flex flex-col gap-4",children:[u.jsxs("div",{className:"rounded-md border border-black/10 bg-surface-raised px-4 py-3 dark:border-white/10",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3",children:[u.jsxs("div",{children:[u.jsx("p",{className:"text-sm font-medium text-text",children:"MCP 健康状态"}),u.jsx("p",{className:"text-xs text-text-muted",children:A?u.jsxs(u.Fragment,{children:["正在通过 ",Oe," 检查已安装的 MCP 服务器..."]}):q||(z?`上次检查:${E3(new Date(z).toISOString())}`:u.jsx(u.Fragment,{children:"在此页面运行诊断,以验证已安装 MCP 的连接状态。"}))})]}),u.jsxs(Me,{variant:"outline",size:"sm",onClick:()=>void k(e??void 0),disabled:A||!!q,className:"whitespace-nowrap",children:[u.jsx(go,{className:`mr-1.5 size-3.5 ${A?"animate-spin":""}`}),A?"检查中...":"检查状态"]})]}),(A||Ie.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 诊断"}),Ie.length>0&&u.jsxs("span",{className:"text-xs text-text-muted",children:[Ie.length," 个服务器"]})]}),Ie.length>0?u.jsx("div",{className:"mcp-diagnostics-list max-h-[18.5rem] space-y-2 overflow-y-auto pr-1",children:Ie.map(Y=>{const W=oP(Y.name,Y.scope||"user",e),se=Q[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:Y.name}),Y.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:Y.scope})]}),u.jsx("p",{className:"truncate font-mono text-[11px] text-text-muted",title:Y.target,children:Y.target})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx($t,{className:Se(Y.status),variant:"outline",children:Y.statusLabel}),u.jsx(Me,{variant:"ghost",size:"sm",className:"size-6 p-0 text-red-300 hover:text-red-200",disabled:se,onClick:()=>{I(Y.name,Y.name,Y.scope||void 0,e??void 0)},title:`卸载 ${Y.name}`,children:u.jsx(Ai,{className:"size-3.5"})})]})]},tS(Y.name,Y.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(nce,{value:t,onChange:n,placeholder:"搜索 MCP 服务器..."})}),u.jsxs(qo,{value:D,onValueChange:Y=>V(Y),children:[u.jsx(_o,{className:"w-36",children:u.jsx(Wo,{})}),u.jsx(bo,{children:iLn.map(Y=>u.jsx(qs,{value:Y.value,children:Y.label},Y.value))})]})]}),G.length>0&&u.jsx("div",{className:"flex flex-col gap-1",children:G.map((Y,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(zn,{className:"size-3.5 shrink-0"}),Y]},W))}),H&&oe.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},(Y,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&&!ee&&u.jsx("div",{className:"rounded-md border border-red-500/30 bg-red-500/5 p-4 text-sm text-red-400",children:m}),F&&(F.includes(jPn)?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(zn,{className:"mt-0.5 size-4 shrink-0 text-amber-400"}),u.jsxs("div",{children:[u.jsx("p",{className:"text-sm font-medium text-amber-300",children:N?.flavor==="agent_teams_orchestrator"?`${Oe} not available`:`${Oe} not installed`}),u.jsxs("p",{className:"mt-0.5 text-xs text-text-muted",children:["MCP health checks require ",Oe,". 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:F})),M.length>0&&u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3",children:[u.jsx("p",{className:"text-sm font-medium text-text",children:"已安装"}),u.jsx($t,{variant:"secondary",className:"font-normal",children:M.length})]}),u.jsx("div",{className:"mcp-servers-grid grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-3",children:M.map(Y=>{const se=p.find(we=>dC(we.name)===Y.name.toLowerCase())??{id:`custom:${Y.name}`,name:Y.name,description:Y.transport==="http"?"HTTP/SSE 服务器":"Stdio 服务器",source:"official",installSpec:null,envVars:[],requiresAuth:!1,tools:[]},he=U[tS(Y.name,Y.scope)]??U[tS(Y.name)]??U[Y.name]??null;return u.jsx(Ywe,{server:se,isInstalled:!0,installedEntry:Y,installedEntries:[Y],diagnostic:he,diagnosticsLoading:A,onClick:a,cliStatus:N,cliStatusLoading:j},`${Y.name}-${Y.scope}`)})})]}),!H&&oe.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:ee?u.jsx(Mi,{className:"size-5 text-text-muted"}):u.jsx(OU,{className:"size-5 text-text-muted"})}),u.jsx("p",{className:"text-sm text-text-secondary",children:ee?"没有找到服务器":"暂无 MCP 服务器"}),u.jsx("p",{className:"text-xs text-text-muted",children:ee?"试试其他搜索词":"稍后再回来查看新服务器"})]}),oe.length>0&&u.jsx("div",{className:"mcp-servers-grid grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-3",children:oe.map(Y=>u.jsx(Ywe,{server:Y,isInstalled:pe(Y),installedEntry:_e(Y),installedEntries:Te(Y),diagnostic:be(Y),diagnosticsLoading:A,onClick:a,cliStatus:N,cliStatusLoading:j},Y.id))}),!ee&&f&&u.jsx("div",{className:"flex justify-center py-4",children:u.jsx(Me,{variant:"outline",size:"sm",disabled:h,onClick:()=>void g(f),children:"Load more"})}),u.jsx(sLn,{server:K,isInstalled:K?pe(K):!1,installedEntry:K?_e(K):null,installedEntries:K?Te(K):[],diagnostic:K?be(K):null,diagnosticsLoading:A,projectPath:e,open:o!==null,onClose:()=>a(null),cliStatus:N,cliStatusLoading:j})]})},lLn=["lsp","mcp","agent","command","hook","skill"],cLn=({plugins:e,selected:t,onToggle:n})=>{const r=O.useMemo(()=>{const s=new Map;for(const i of e){const o=G$(i);for(const a of o)s.set(a,(s.get(a)??0)+1)}return s},[e]);return u.jsx("div",{className:"flex flex-wrap gap-1.5",children:lLn.map(s=>{const i=r.get(s)??0;if(i===0)return null;const o=t.includes(s);return u.jsxs(Me,{variant:"ghost",size:"sm",onClick:()=>n(s),"aria-pressed":o,className:`h-7 rounded-full border px-2.5 text-[11px] font-medium transition-all ${o?"border-purple-500/40 bg-purple-500/15 text-purple-300 shadow-sm":"hover:bg-surface-raised/60 border-border bg-transparent text-text-secondary hover:border-border-emphasis hover:text-text"}`,children:[u.jsx("span",{children:Ise(s)}),u.jsx("span",{className:`ml-1.5 rounded-full px-1 py-0.5 text-[9px] leading-none ${o?"bg-surface-raised text-text-secondary":"bg-surface-raised/70 text-text-muted"}`,children:i})]},s)})})},uLn=({plugins:e,selected:t,onToggle:n})=>{const r=O.useMemo(()=>{const s=new Map;for(const i of e){const o=H$(i.category);s.set(o,(s.get(o)??0)+1)}return[...s.entries()].sort((i,o)=>o[1]-i[1])},[e]);return r.length===0?u.jsx(u.Fragment,{}):u.jsx("div",{className:"flex flex-wrap gap-1.5",children:r.map(([s,i])=>{const o=t.includes(s);return u.jsxs(Me,{variant:"ghost",size:"sm",onClick:()=>n(s),"aria-pressed":o,className:`h-7 rounded-full border px-2.5 text-[11px] font-medium transition-all ${o?"border-blue-500/40 bg-blue-500/15 text-blue-300 shadow-sm":"hover:bg-surface-raised/60 border-border bg-transparent text-text-secondary hover:border-border-emphasis hover:text-text"}`,children:[u.jsx("span",{children:s}),u.jsx("span",{className:`ml-1.5 rounded-full px-1 py-0.5 text-[9px] leading-none ${o?"bg-surface-raised text-text-secondary":"bg-surface-raised/70 text-text-muted"}`,children:i})]},s)})})},lJe=({count:e})=>e<=0?null:u.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-text-muted",children:[u.jsx(Yne,{className:"size-3"}),N2t(e)]}),dLn=({plugin:e,index:t,onClick:n,cliStatus:r,cliStatusLoading:s})=>{const i=G$(e),o=H$(e.category),a=ML(e.pluginId,"user"),c=re(b=>b.pluginInstallProgress[a]??"idle"),l=re(b=>b.installPlugin),d=re(b=>b.uninstallPlugin),p=re(b=>b.installErrors[a]),f=lXe(e.installations,"user"),h=uXe(e.installations),m=t%2===0,g=Math.floor(t/2)%2===0,_=Math.floor(t/3)%2===0;return u.jsxs("div",{role:"button",tabIndex:0,onClick:()=>n(e.pluginId),onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),n(e.pluginId))},className:`relative flex w-full cursor-pointer flex-col gap-3 rounded-xl border p-4 text-left transition-all duration-200 hover:border-border-emphasis hover:bg-white/[0.06] 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)] ${m?"bg-white/[0.045]":"bg-white/[0.015]"} ${g?"sm:bg-white/[0.045]":"sm:bg-white/[0.015]"} ${_?"xl:bg-white/[0.045]":"xl:bg-white/[0.015]"} ${e.isInstalled?"border-l-2 border-border border-l-emerald-500/35":"border-border"}`,children:[e.source==="official"&&u.jsx("div",{className:"pointer-events-none absolute -left-px -top-px size-16 overflow-hidden",children:u.jsx("div",{className:"absolute left-[-24px] top-[4px] w-[80px] -rotate-45 bg-blue-500/90 text-center text-[9px] font-semibold leading-[18px] text-white shadow-sm",children:"Official"})}),u.jsxs("div",{className:"flex items-start justify-between gap-2",children:[u.jsxs("div",{className:"min-w-0 space-y-1",children:[u.jsx("h3",{className:"truncate text-sm font-semibold text-text",children:e.name}),u.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[u.jsx($t,{variant:"secondary",className:"text-[11px]",children:o}),i.map(b=>u.jsx($t,{variant:"outline",className:"bg-surface-raised/60 border-border text-[11px] text-text-secondary",children:Ise(b)},b))]})]}),u.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[u.jsx(lJe,{count:e.installCount}),h&&u.jsx($t,{className:"shrink-0 border-emerald-500/30 bg-emerald-500/10 text-emerald-400",variant:"outline",children:h})]})]}),u.jsx("p",{className:"line-clamp-3 min-h-[3.75rem] text-xs leading-5 text-text-secondary",children:e.description}),u.jsxs("div",{className:"flex items-start justify-between gap-2",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-3 text-xs text-text-muted",children:[u.jsx("span",{className:"truncate",children:e.author?.name??"Unknown author"}),e.version&&u.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1",children:[u.jsx(dMe,{className:"size-3"}),e.version]})]}),u.jsx("div",{className:"shrink-0",onClick:b=>b.stopPropagation(),children:u.jsx(gB,{state:c,isInstalled:f,section:"plugins",cliStatus:r,cliStatusLoading:s,onInstall:()=>l({pluginId:e.pluginId,scope:"user"}),onUninstall:()=>d(e.pluginId,"user"),size:"sm",errorMessage:p})})]})]})},pLn=[{value:"user",label:"User (global)"},{value:"project",label:"Project (shared)"},{value:"local",label:"Local (gitignored)"}],fLn=({plugin:e,open:t,onClose:n,projectPath:r,cliStatus:s,cliStatusLoading:i})=>{const{fetchPluginReadme:o,readmes:a,readmeLoading:c,installPlugin:l,uninstallPlugin:d}=re(vt(E=>({fetchPluginReadme:E.fetchPluginReadme,readmes:E.pluginReadmes,readmeLoading:E.pluginReadmeLoading,installPlugin:E.installPlugin,uninstallPlugin:E.uninstallPlugin}))),[p,f]=O.useState("user"),h=!!r;O.useEffect(()=>{e&&t&&o(e.pluginId)},[e,t,o]),O.useEffect(()=>{t&&f("user")},[t,e?.pluginId]),O.useEffect(()=>{p!=="user"&&!h&&f("user")},[h,p]);const m=e?ML(e.pluginId,p,p!=="user"?r:void 0):null,g=re(E=>(m?E.pluginInstallProgress[m]:void 0)??"idle"),_=re(E=>m?E.installErrors[m]:void 0);if(!e)return u.jsx(u.Fragment,{});const b=G$(e),y=H$(e.category),x=a[e.pluginId],S=c[e.pluginId]??!1,v=lXe(e.installations,p),T=uXe(e.installations);return u.jsx(us,{open:t,onOpenChange:E=>!E&&n(),children:u.jsxs(ts,{className:"max-w-2xl",children:[u.jsx(ds,{children:u.jsxs("div",{className:"flex items-start justify-between gap-3",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx(ns,{className:"truncate",children:e.name}),u.jsx(oi,{className:"mt-1",children:e.description})]}),u.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[T&&u.jsx($t,{className:"shrink-0 border-emerald-500/30 bg-emerald-500/10 text-emerald-400",variant:"outline",children:T}),u.jsx(rce,{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:"text-text",children:e.author?.name??"Unknown"})]}),u.jsxs("div",{children:[u.jsx("span",{className:"text-text-muted",children:"分类"}),u.jsx("p",{className:"capitalize text-text",children:y})]}),u.jsxs("div",{children:[u.jsx("span",{className:"text-text-muted",children:"来源"}),u.jsx("p",{className:"capitalize text-text",children:e.source})]}),e.version&&u.jsxs("div",{children:[u.jsx("span",{className:"text-text-muted",children:"版本"}),u.jsx("p",{className:"text-text",children:e.version})]}),u.jsxs("div",{children:[u.jsx("span",{className:"text-text-muted",children:"能力"}),u.jsx("div",{className:"mt-0.5 flex flex-wrap gap-1",children:b.map(E=>u.jsx($t,{variant:"outline",className:"border-purple-500/30 bg-purple-500/10 text-purple-400",children:Ise(E)},E))})]}),u.jsxs("div",{children:[u.jsx("span",{className:"text-text-muted",children:"安装量"}),u.jsx("div",{className:"mt-0.5",children:u.jsx(lJe,{count:e.installCount})})]})]}),u.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-border bg-surface-raised px-4 py-3",children:[u.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[u.jsx(Zt,{className:"text-xs text-text-muted",children:"Scope:"}),u.jsxs(qo,{value:p,onValueChange:E=>f(E),children:[u.jsx(_o,{className:"h-7 w-36 text-xs",children:u.jsx(Wo,{})}),u.jsx(bo,{children:pLn.map(E=>u.jsx(qs,{value:E.value,disabled:E.value!=="user"&&!h,children:E.label},E.value))})]})]}),u.jsx(gB,{state:g,isInstalled:v,section:"plugins",cliStatus:s,cliStatusLoading:i,onInstall:()=>l({pluginId:e.pluginId,scope:p,...p!=="user"&&r?{projectPath:r}:{}}),onUninstall:()=>d(e.pluginId,p,p!=="user"?r??void 0:void 0),size:"default",errorMessage:_})]}),u.jsxs("div",{className:"flex items-center gap-4",children:[e.homepage&&u.jsxs(Me,{variant:"link",className:"h-auto justify-start p-0 text-sm text-blue-400",onClick:()=>void Z.openExternal(e.homepage),children:[u.jsx(zd,{className:"mr-1 size-3.5"}),"Homepage"]}),e.author?.email&&u.jsxs(Me,{variant:"link",className:"h-auto justify-start p-0 text-sm text-blue-400",onClick:()=>void Z.openExternal(`mailto:${e.author.email}`),children:[u.jsx(Uft,{className:"mr-1 size-3.5"}),"Contact"]})]}),u.jsxs("div",{className:"mt-2 max-h-80 overflow-y-auto rounded-md border border-border bg-surface-raised p-4",children:[S&&u.jsxs("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[u.jsx(zt,{className:"size-4 animate-spin"}),"Loading README..."]}),!S&&x&&u.jsx(Ks,{content:x,bare:!0,maxHeight:"max-h-none"}),!S&&!x&&u.jsx("p",{className:"text-sm text-text-muted",children:"暂无 README。"})]})]})})},hLn=[{value:"popularity:desc",label:"热门"},{value:"name:asc",label:"名称 A-Z"},{value:"name:desc",label:"名称 Z-A"},{value:"category:asc",label:"分类"}];function mLn(e,t,n){let r=e;if(t.search){const i=t.search.toLowerCase();r=r.filter(o=>o.name.toLowerCase().includes(i)||o.description.toLowerCase().includes(i)||o.pluginId.toLowerCase().includes(i))}t.categories.length>0&&(r=r.filter(i=>t.categories.includes(H$(i.category)))),t.capabilities.length>0&&(r=r.filter(i=>{const o=G$(i);return t.capabilities.some(a=>o.includes(a))})),t.installedOnly&&(r=r.filter(i=>i.isInstalled));const s=n.order==="asc"?1:-1;return r=[...r].sort((i,o)=>{switch(n.field){case"popularity":return(i.installCount-o.installCount)*s;case"name":return i.name.localeCompare(o.name)*s;case"category":return i.category.localeCompare(o.category)*s;default:return 0}}),r}const gLn=({projectPath:e,pluginFilters:t,pluginSort:n,selectedPluginId:r,updatePluginSearch:s,toggleCategory:i,toggleCapability:o,toggleInstalledOnly:a,setSelectedPluginId:c,clearFilters:l,hasActiveFilters:d,setPluginSort:p,cliStatus:f,cliStatusLoading:h})=>{const{catalog:m,loading:g,error:_,cliStatus:b}=re(vt(P=>({catalog:P.pluginCatalog,loading:P.pluginCatalogLoading,error:P.pluginCatalogError,cliStatus:P.cliStatus}))),y=f??b,x=O.useMemo(()=>mLn(m,t,n),[m,t,n]),S=O.useMemo(()=>r?m.find(P=>P.pluginId===r)??null:null,[m,r]);O.useEffect(()=>{r&&!g&&!S&&c(null)},[g,S,r,c]),O.useEffect(()=>{_&&r&&c(null)},[_,r,c]);const v=`${n.field}:${n.order}`,T=t.categories.length+t.capabilities.length+(t.installedOnly?1:0)+(t.search?1:0),E=O.useMemo(()=>new Set(m.map(P=>H$(P.category))).size,[m]),w=O.useMemo(()=>{const P=new Set;for(const C of m)for(const k of G$(C))P.add(k);return P.size},[m]);return u.jsxs("div",{className:"flex flex-col gap-4",children:[y?.flavor==="agent_teams_orchestrator"&&(()=>{const P=y.providers.find(k=>k.providerId==="codex");if(!P)return null;const C=Gw(P,"plugins");return C.status==="supported"?null:u.jsxs("div",{className:"rounded-md border border-amber-500/30 bg-amber-500/5 px-4 py-3 text-sm text-amber-300",children:["在多模型运行时中,目前插件仅保证用于 Anthropic 会话。我们正在为所有智能体构建更广泛的插件支持,包括通用插件和智能体专用插件。",C.reason?` ${C.reason}`:""]})})(),u.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-center",children:[u.jsx("div",{className:"flex-1",children:u.jsx(nce,{value:t.search,onChange:s,placeholder:"搜索插件..."})}),u.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[u.jsxs(qo,{value:v,onValueChange:P=>{const[C,k]=P.split(":");p({field:C,order:k})},children:[u.jsxs(_o,{className:"w-full gap-2 sm:w-40",children:[u.jsx(zne,{className:"size-3.5 shrink-0 text-text-muted"}),u.jsx(Wo,{})]}),u.jsx(bo,{children:hLn.map(P=>u.jsx(qs,{value:P.value,children:P.label},P.value))})]}),u.jsxs(Zt,{htmlFor:"installed-only",className:"bg-surface-raised/40 flex h-10 cursor-pointer items-center gap-2 rounded-lg border border-border px-3 text-xs text-text-secondary transition-colors hover:border-border-emphasis hover:text-text",children:[u.jsx(ai,{id:"installed-only",checked:t.installedOnly,onCheckedChange:a}),"仅已安装"]})]})]}),u.jsx("div",{className:"bg-surface-raised/20 rounded-xl p-4",children:u.jsxs("div",{className:"flex flex-col gap-4",children:[u.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx("div",{className:"bg-surface-raised/60 flex size-8 items-center justify-center rounded-lg border border-border",children:u.jsx(T$,{className:"size-4 text-text-muted"})}),u.jsxs("div",{children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx("h2",{className:"text-sm font-semibold text-text",children:"按适用场景浏览"}),u.jsxs($t,{variant:"outline",className:"text-[11px] text-text-muted",children:[T," 个已启用"]})]}),u.jsx("p",{className:"text-xs text-text-muted",children:"按分类、能力或安装状态缩小目录范围。"})]})]}),u.jsxs("div",{className:"flex flex-wrap gap-2 text-[11px] text-text-muted",children:[u.jsxs($t,{variant:"secondary",className:"font-normal",children:[m.length," 个插件"]}),u.jsxs($t,{variant:"secondary",className:"font-normal",children:[E," 个分类"]}),u.jsxs($t,{variant:"secondary",className:"font-normal",children:[w," 项能力"]})]})]}),d&&u.jsx(Me,{variant:"ghost",size:"sm",onClick:l,className:"justify-start rounded-lg border border-border px-3 text-xs text-text-secondary hover:text-text lg:justify-center",children:"清除所有筛选"})]}),u.jsx("div",{className:"overflow-hidden rounded-lg border border-border bg-transparent",children:u.jsxs("div",{className:"grid gap-0 xl:grid-cols-2",children:[u.jsxs("section",{className:"space-y-3 p-3 xl:border-r xl:border-border",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-text-muted",children:"分类"}),u.jsxs("span",{className:"text-[11px] text-text-muted",children:["已选 ",t.categories.length," 个"]})]}),u.jsx(uLn,{plugins:m,selected:t.categories,onToggle:i})]}),u.jsxs("section",{className:"space-y-3 border-t border-border p-3 xl:border-t-0",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-text-muted",children:"能力"}),u.jsxs("span",{className:"text-[11px] text-text-muted",children:["已选 ",t.capabilities.length," 个"]})]}),u.jsx(cLn,{plugins:m,selected:t.capabilities,onToggle:o})]})]})})]})}),!g&&!_&&x.length>0&&u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[u.jsxs("p",{className:"text-xs text-text-muted",children:["显示 ",x.length," / ",m.length," 个插件"]}),d&&u.jsx("p",{className:"text-xs text-text-muted",children:"调整筛选后结果会立即更新。"})]}),g&&u.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-3",children:Array.from({length:6},(P,C)=>u.jsxs("div",{className:"skeleton-card flex flex-col gap-2 rounded-lg border border-border p-4",style:{animationDelay:`${C*80}ms`},children:[u.jsxs("div",{className:"flex items-start justify-between gap-2",children:[u.jsx("div",{className:"h-4 w-32 rounded bg-surface-raised"}),u.jsx("div",{className:"h-5 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-3/4 rounded bg-surface-raised"})]}),u.jsxs("div",{className:"flex gap-1.5",children:[u.jsx("div",{className:"h-5 w-14 rounded-full bg-surface-raised"}),u.jsx("div",{className:"h-5 w-12 rounded-full bg-surface-raised"})]}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("div",{className:"h-3 w-24 rounded bg-surface-raised"}),u.jsx("div",{className:"h-7 w-16 rounded bg-surface-raised"})]})]},C))}),_&&u.jsx("div",{className:"rounded-md border border-red-500/30 bg-red-500/5 p-4 text-sm text-red-400",children:_}),!g&&!_&&x.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:d?u.jsx(Mi,{className:"size-5 text-text-muted"}):u.jsx(Lb,{className:"size-5 text-text-muted"})}),u.jsx("p",{className:"text-sm text-text-secondary",children:d?"没有匹配筛选条件的插件":"暂无可用插件"}),u.jsx("p",{className:"text-xs text-text-muted",children:d?"试着调整搜索或筛选条件":"稍后再回来查看新插件"}),d&&u.jsx(Me,{variant:"outline",size:"sm",onClick:l,children:"Clear filters"})]}),!g&&!_&&x.length>0&&u.jsx("div",{className:"plugins-grid grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-3",children:x.map((P,C)=>u.jsx(dLn,{plugin:P,index:C,onClick:c,cliStatus:y,cliStatusLoading:h},P.pluginId))}),u.jsx(fLn,{plugin:S,open:r!==null,onClose:()=>c(null),projectPath:e,cliStatus:y,cliStatusLoading:h})]})},WP=[{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 cJe(e){return WP.find(t=>t.rootKind===e)}function wee(e){return cJe(e).directoryName}function uJe(e){return cJe(e).audience}function oX(e){return e==="hermit"?"Hermit 管理":uJe(e)==="codex"?"Codex 专用":"共享"}function Vwe(e,t){return uJe(e)==="shared"||t==="codex"}var dJe="AlertDialog",[OLn]=op(dJe,[$Ge]),Gm=$Ge(),pJe=e=>{const{__scopeAlertDialog:t,...n}=e,r=Gm(t);return u.jsx(_ae,{...r,...n,modal:!0})};pJe.displayName=dJe;var _Ln="AlertDialogTrigger",bLn=O.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Gm(n);return u.jsx(iyn,{...s,...r,ref:t})});bLn.displayName=_Ln;var yLn="AlertDialogPortal",fJe=e=>{const{__scopeAlertDialog:t,...n}=e,r=Gm(t);return u.jsx(bae,{...r,...n})};fJe.displayName=yLn;var xLn="AlertDialogOverlay",hJe=O.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Gm(n);return u.jsx(I3,{...s,...r,ref:t})});hJe.displayName=xLn;var wv="AlertDialogContent",[SLn,vLn]=OLn(wv),TLn=IAe("AlertDialogContent"),mJe=O.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...s}=e,i=Gm(n),o=O.useRef(null),a=rs(t,o),c=O.useRef(null);return u.jsx(tyn,{contentName:wv,titleName:gJe,docsSlug:"alert-dialog",children:u.jsx(SLn,{scope:n,cancelRef:c,children:u.jsxs(M3,{role:"alertdialog",...i,...s,ref:a,onOpenAutoFocus:bn(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(wLn,{contentRef:o})]})})})});mJe.displayName=wv;var gJe="AlertDialogTitle",OJe=O.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Gm(n);return u.jsx(yae,{...s,...r,ref:t})});OJe.displayName=gJe;var _Je="AlertDialogDescription",bJe=O.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Gm(n);return u.jsx(xae,{...s,...r,ref:t})});bJe.displayName=_Je;var ELn="AlertDialogAction",yJe=O.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Gm(n);return u.jsx(Sae,{...s,...r,ref:t})});yJe.displayName=ELn;var xJe="AlertDialogCancel",SJe=O.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:s}=vLn(xJe,n),i=Gm(n),o=rs(t,s);return u.jsx(Sae,{...i,...r,ref:o})});SJe.displayName=xJe;var wLn=({contentRef:e})=>{const t=`\`${wv}\` requires a description for the component to be accessible for screen reader users.
|
|
1665
1665
|
|
|
1666
1666
|
You can add a description to the \`${wv}\` by passing a \`${_Je}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
1667
1667
|
|
|
@@ -1841,7 +1841,7 @@ Store screenshots or other bundled assets here.
|
|
|
1841
1841
|
`).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 unt="in-process";function dnt(){return["--teammate-mode",unt]}function oFn(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 aFn(e){return/^[A-Za-z0-9_./:=@+-]+$/.test(e)?e:`"${e.replace(/(["\\$`])/g,"\\$1")}"`}function OCe(e,t=unt){const n=oFn(Nce(e)),r=[...dnt(),...n];return r.length>0?r.map(aFn).join(" "):void 0}const lFn={anthropic:"Anthropic",codex:"Codex",gemini:"Gemini",opencode:"OpenCode"};function cFn(e){return lFn[e]??e}function uFn(e){const t=Nce(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 dFn={visible:!1,blocksSubmission:!1,checking:!1,title:"",message:"",details:[],tmuxDetail:null,memberWarningById:{}};function pFn({leadProviderId:e,members:t,soloTeam:n=!1,extraCliArgs:r}){const s=n?[]:t.filter(o=>o.removedAt==null&&o.name.trim().length>0);return uFn(r)!=="tmux"||s.length===0?dFn:{visible:!0,blocksSubmission:!1,checking:!1,title:"已切换为进程内成员运行",message:`当前团队会通过 ${cFn(e)} 负责人会话启动成员,不再依赖 tmux。`,details:["自定义 CLI 参数里的 --teammate-mode tmux 会被忽略,并改为 in-process。"],tmuxDetail:null,memberWarningById:{}}}const fFn=({analysis:e,onOpenDashboard:t})=>{if(!e.visible)return null;const n=e.checking?Gs:zn;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(Me,{type:"button",variant:"outline",size:"sm",className:"mt-1 h-7 px-2 text-[11px]",onClick:t,children:"打开首页"}):null]})]})})};function hFn(e){return{fastModeAvailable:!1}}function mFn(e){return{showFastModeControl:!1,resolvedFastMode:!1,selectable:!1,disabledReason:null}}function gFn(e){return{nextEffort:e.selectedEffort,effortResetReason:null,nextFastMode:e.selectedFastMode,fastModeResetReason:null}}function OFn(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 V8=!0,_Fn="TeamDelete,TodoWrite,TaskCreate,TaskUpdate";function q8(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return"UTC"}}function FM(){const e=localStorage.getItem("team:lastSelectedProvider");return tN(ka(e))}function Vx(e){const t=localStorage.getItem(`team:lastSelectedModel:${e}`);return t===null?e==="anthropic"?"opus":"":c1(e,t==="__default__"?"":t)}function Aw(){const e=localStorage.getItem("team:lastSelectedFastMode");return e==="on"||e==="off"||e==="inherit"?e:"inherit"}function qx(e){return d_(e)??"Anthropic"}function bFn(e,t,n,r){return{providerId:e.providerId??t,model:e.model?.trim()||n,effort:e.effort??r}}function yFn(e,t,n,r){return{providerId:ka(e.providerId)??t,model:e.model?.trim()||n,effort:e.effort??r}}function xFn(e){const t=e.filter(n=>{const r=n.name.trim().toLowerCase();return!n.removedAt&&!s_(r)});return t.length>0&&t.every(n=>n.isolation==="worktree")}const qee=e=>{const{open:t,onClose:n}=e,{isLight:r}=Js(),s=re(ge=>ge.appConfig?.general?.multimodelEnabled??!1),i=re(ge=>ge.appConfig?.providerConnections?.anthropic.fastModeDefault??!1),o=re(ge=>ge.cliStatus),a=re(ge=>ge.cliStatusLoading),c=re(ge=>ge.bootstrapCliStatus),l=re(ge=>ge.fetchCliStatus),d=e.mode==="launch"||e.mode==="relaunch",p=e.mode==="relaunch",h=O.useMemo(()=>!o&&a&&s?Qy():o,[o,a,s]),m=e.mode==="schedule",g=m?e.schedule??null:null,_=m&&!!g,b=e.teamName??"",[y,x]=O.useState(""),{teamByName:S,openDashboard:v}=re(vt(ge=>({teamByName:ge.teamByName,openDashboard:ge.openDashboard}))),T=re(ge=>ge.openTeamTab),E=O.useMemo(()=>Object.values(S).sort((ge,ht)=>ge.teamName.localeCompare(ht.teamName)).map(ge=>({value:ge.teamName,label:ge.displayName||ge.teamName,description:ge.description||void 0,meta:{color:ge.color}})),[S]),w=b||y,P=m&&!b,[C,k]=O.useState("project"),[I,Q]=O.useState(""),[$,R]=O.useState(""),N=my({key:`launchTeam:${w||"standalone"}:${e.mode}:prompt`}),j=UN(`launchTeam:${w||"standalone"}:${e.mode}:chips`),[M,U]=O.useState([]),[A,F]=O.useState(!1),[z,D]=O.useState(null),[V,q]=O.useState(null),[ee,te]=O.useState(!1),[H,G]=O.useState(()=>lh(FM())),[ie,ne]=O.useState(()=>Vx(lh(FM()))),[pe,Te]=O.useState([]),[_e,be]=O.useState(!1),[Ie,Se]=O.useState(!1),[oe,Oe]=O.useState(()=>localStorage.getItem("team:lastSkipPermissions")!=="false"),[K,Y]=O.useState(()=>{const ge=localStorage.getItem("team:lastSelectedEffort");return ge===null?"":ge}),[W,se]=O.useState(Aw),[he,we]=O.useState(null),[J,de]=O.useState(()=>localStorage.getItem("team:lastLimitContext")==="true"),[ue,ae]=O.useState(!1),[$e,qe]=O.useState(!1),[ot,Ot]=O.useState("idle"),[nt,Ge]=O.useState(null),[St,Qt]=O.useState([]),[ft,tn]=O.useState([]),jt=O.useRef(0),On=re(ge=>kl(ge,ge.selectedTeamName)),Lt=re(ge=>w?ge.launchParamsByTeam[w]:void 0),fn=d?e.members:On,[xe,Fe]=O.useState(null),[_t,At]=O.useState(null),[Ve,et]=O.useState(()=>localStorage.getItem(`team:lastWorktreeEnabled:${w}`)==="true"&&!!localStorage.getItem(`team:lastWorktreeName:${w}`)),[Ce,tt]=O.useState(()=>localStorage.getItem(`team:lastWorktreeName:${w}`)??""),[ve,Ue]=O.useState(()=>localStorage.getItem(`team:lastCustomArgs:${w}`)??""),[mt,Ke]=O.useState(null),[Ct,Xt]=O.useState(null),Wt=p?e.projectPath??e.defaultProjectPath??"":"",[nr,nn]=O.useState(""),[Zn,jr]=O.useState(!0),[Xe,Re]=O.useState("0 9 * * 1-5"),[me,Ee]=O.useState(q8),[le,je]=O.useState(15),[Be,yt]=O.useState(50),[wt,ut]=O.useState(""),[Ut,yn]=O.useState(null),Rn=O.useMemo(()=>[],[pe,H,Ie]),We=O.useMemo(()=>[H],[Rn,H]),Tt=O.useMemo(()=>{const ge=(h?.providers??[]).map(ht=>[ht.providerId,q4n(ht)]);return new Map(ge)},[h?.providers]),Kn=O.useRef(Tt),Ar=O.useRef([]),Ne=O.useRef(null);O.useEffect(()=>{Kn.current=Tt},[Tt]),O.useEffect(()=>{Ar.current=ft},[ft]),O.useEffect(()=>{t||(Ne.current=null)},[t]);const Ae=O.useMemo(()=>new Map((h?.providers??[]).map(ge=>[ge.providerId,ge])),[h?.providers]);O.useEffect(()=>{t&&Te(ge=>{const ht=P4n({members:ge,selectedProviderId:H,runtimeProviderStatusById:Ae});return ht.changed?ht.members:ge})},[pe,t,Ae,H]),O.useEffect(()=>{!t||o||a||HO({multimodelEnabled:s,bootstrapCliStatus:c,fetchCliStatus:l})},[c,o,a,l,s,t]);const mn=re(ge=>ge.createSchedule),Xn=re(ge=>ge.updateSchedule),ks=ge=>{et(ge),localStorage.setItem(`team:lastWorktreeEnabled:${w}`,String(ge)),ge||(tt(""),localStorage.setItem(`team:lastWorktreeName:${w}`,""))},Us=ge=>{tt(ge),localStorage.setItem(`team:lastWorktreeName:${w}`,ge)},Rl=ge=>{Ue(ge),localStorage.setItem(`team:lastCustomArgs:${w}`,ge)},Jt=ge=>{const ht=lh(ge);G(ht),localStorage.setItem("team:lastSelectedProvider",ht),ht!=="anthropic"&&(de(!1),localStorage.setItem("team:lastLimitContext","false")),ne(Vx(ht))},In=ge=>{const ht=c1(H,ge);ne(ht),localStorage.setItem(`team:lastSelectedModel:${H}`,ht)},Nn=ge=>{Oe(ge),localStorage.setItem("team:lastSkipPermissions",String(ge))},cr=ge=>{Y(ge),localStorage.setItem("team:lastSelectedEffort",ge)},_s=ge=>{se(ge),localStorage.setItem("team:lastSelectedFastMode",ge)};O.useEffect(()=>{const ge=localStorage.getItem("team:lastSelectedModel");ge!=null&&localStorage.getItem("team:lastSelectedModel:anthropic")==null&&localStorage.setItem("team:lastSelectedModel:anthropic",ge),localStorage.removeItem("team:lastSelectedModel");for(const ht of["lastSelectedModel","lastSelectedEffort"]){const Bt=`schedule:${ht}`,xn=ht==="lastSelectedModel"?"team:lastSelectedModel:anthropic":`team:${ht}`,En=localStorage.getItem(Bt);En!=null&&localStorage.getItem(xn)==null&&localStorage.setItem(xn,En),localStorage.removeItem(Bt)}},[]);const zr=()=>{q(null),te(!1),Ot("idle"),Ge(null),Qt([]),tn([]),k("project"),Q(""),R(""),ae(!1),qe(!1),Te([]),Se(!1),j.clearChipDraft(),Ke(null),Xt(null),x(""),nn(""),Re("0 9 * * 1-5"),Ee(q8()),je(15),yt(50),ut("")},mr=()=>{d&&zr(),n()};O.useEffect(()=>{if(!(!t||!m)){if(g){nn(g.label??""),Re(g.cronExpression),Ee(g.timezone),je(g.warmUpMinutes),yt(g.maxTurns),ut(g.maxBudgetUsd!=null?String(g.maxBudgetUsd):""),N.setValue(g.launchConfig.prompt),R(g.launchConfig.cwd),k("custom");const ge=lh(g.launchConfig.providerId);G(ge),ne(ge===lh(g.launchConfig.providerId)?g.launchConfig.model??"":Vx("anthropic")),Oe(g.launchConfig.skipPermissions!==!1),Y(g.launchConfig.effort??""),se(g.launchConfig.fastMode??Aw()),At(g.launchConfig.providerBackendId??null),yn(`${g.id}:${g.updatedAt??""}`)}else{nn(""),Re("0 9 * * 1-5"),Ee(q8()),je(15),yt(50),ut(""),N.setValue(""),k("project"),Q(""),R("");const ge=lh(FM());G(ge),ne(Vx(ge)),Y(""),se(Aw()),At(null),yn(null)}q(null),te(!1)}},[t,m,g?.id]),O.useEffect(()=>{if(!t||!d)return;if(p){let ht=!1;return(async()=>{let Bt=null;try{Bt=w?await Z.teams.getSavedRequest(w):null}catch{Bt=null}if(ht)return;Ke(Bt),Xt(Bt?.members&&Bt.members.length>0?Bt.members:iCe(fn));const xn=lh(ka(Bt?.providerId)??"anthropic");G(xn),ne(xn===ka(Bt?.providerId)?Bt?.model??"":Vx(xn)),Y(Bt?.effort??""),se(Bt?.fastMode??Aw()),Oe(Bt?.skipPermissions??!0),ae(!0)})(),()=>{ht=!0}}let ge=!1;return(async()=>{let ht=null;try{ht=w?await Z.teams.getSavedRequest(w):null}catch{ht=null}if(ge)return;const Bt=fn.length>0?fn:ht?.members&&ht.members.length>0?ht.members:[],xn=iCe(Bt),En=localStorage.getItem("team:lastSelectedEffort"),Dn=ka(ht?.providerId)??null,no=typeof ht?.providerBackendId=="string"&&ht.providerBackendId.trim().length>0?ht.providerBackendId.trim():null,Oa=lh(FM()),sr=C4n({members:fn,savedRequest:ht,previousLaunchParams:Lt,multimodelEnabled:s,storedProviderId:Oa,storedEffort:En===null?"medium":En,storedFastMode:Aw(),storedLimitContext:localStorage.getItem("team:lastLimitContext")==="true",getStoredModel:Vx});Fe(Dn),At(sr.providerBackendId??no??null),Te(n4n(xn).map(Cs=>s4n(Cs))),be(xFn(xn)),Se(!xn.some(Cs=>Cs.providerId||Cs.model||Cs.effort));const xr=lh(sr.providerId);G(xr),ne(xr===sr.providerId?sr.model:""),Y(sr.effort),se(sr.fastMode),de(sr.limitContext),Oe(ht?.skipPermissions??localStorage.getItem("team:lastSkipPermissions")!=="false")})(),()=>{ge=!0}},[t,d,w,fn,s,Lt]);const gr=O.useMemo(()=>d?ka(Lt?.providerId)??xe:null,[d,Lt?.providerId,xe]),Ms=O.useMemo(()=>!d||!gr?!1:gr!==H,[d,gr,H]),Oi=m?!1:J,ki=O.useMemo(()=>$w(ie,J,H,Ae.get(H))??"",[J,Ae,ie,H]),od=O.useMemo(()=>zM(H,Ae.get(H))??$ce(H,Lt?.providerBackendId??_t)??void 0,[Lt?.providerBackendId,Ae,_t,H]),qa=O.useMemo(()=>pFn({leadProviderId:H,members:[],extraCliArgs:d?OCe(ve):void 0}),[ve,Rn,d,od,H]),Jc=O.useMemo(()=>H==="anthropic"?hFn({source:{modelCatalog:Ae.get("anthropic")?.modelCatalog,runtimeCapabilities:Ae.get("anthropic")?.runtimeCapabilities}}):null,[Oi,Ae,ie,H]),Pl=O.useMemo(()=>H==="anthropic"&&Jc?mFn():null,[i,Jc,W,H]);O.useEffect(()=>{if(m&&g){const Bt=`${g.id}:${g.updatedAt??""}`;if(Ut!==Bt)return}if(H!=="anthropic"){we(null);return}const ge=gFn({selectedEffort:K,selectedFastMode:W}),ht=[];ge.nextEffort!==K&&(Y(ge.nextEffort),localStorage.setItem("team:lastSelectedEffort",ge.nextEffort)),ge.nextFastMode!==W&&(se(ge.nextFastMode),localStorage.setItem("team:lastSelectedFastMode",ge.nextFastMode)),we(ht.length>0?ht.join(" "):null)},[i,Jc,Oi,K,W,ie,H,g,Ut,m]);const Yf=O.useMemo(()=>{const ge=new Map,ht=new Map,Bt=(En,Dn)=>{const no=Dn?.trim()??"";if(!no)return;const Oa=ge.get(En)??[];Oa.includes(no)||ge.set(En,[...Oa,no])},xn=En=>{En==="anthropic"&&H==="anthropic"&&ht.set(En,!0)};ie.trim()?Bt(H,ki):xn(H);for(const En of Rn){if(En.removedAt)continue;const Dn=rnt({memberProviderId:En.providerId,memberModel:En.model,selectedProviderId:H,runtimeProviderStatusById:Ae});Dn.model?Bt(Dn.providerId,Dn.model):xn(Dn.providerId)}for(const En of ht.keys())Bt(En,Vtt);return ge},[ki,Rn,Ae,ie,H]),Hm=O.useMemo(()=>{if(!d)return[];const ge=[],ht=Lt?.model?.trim()||"",Bt=Lt?.effort,xn=ie.trim()||ki;gr&&(gr!==H||ht!==xn||(Bt??"")!==(K||""))&&ge.push({key:"lead",memberName:pz,message:`${ib(H,xn,K||void 0)},而不是 ${ib(gr,ht,Bt)}`});const En=new Map(fn.map(Dn=>[Dn.name.trim().toLowerCase(),Dn]));for(const Dn of Rn){if(Dn.removedAt)continue;const no=Dn.name.trim();if(!no)continue;const Oa=En.get(no.toLowerCase());if(!Oa)continue;const{providerId:sr,model:xr,effort:Cs}=bFn(Dn,H,xn,K||void 0),{providerId:Ha,model:qf,effort:ax}=yFn(Oa,gr??"anthropic",ht,Bt);if(Ha===sr&&qf===xr&&(ax??"")===(Cs??"")&&(Oa.isolation??"")===(Dn.isolation??""))continue;const WB=Ha!==sr||qf!==xr||(ax??"")!==(Cs??"")?`${ib(sr,xr,Cs)},而不是 ${ib(Ha,qf,ax)}`:null,hit=Oa.isolation!==Dn.isolation?`${Dn.isolation==="worktree"?"独立 worktree":"共享工作区"},而不是 ${Oa.isolation==="worktree"?"独立 worktree":"共享工作区"}`:null;ge.push({key:`member:${no.toLowerCase()}`,memberName:no,message:[WB,hit].filter(mit=>!!mit).join("; ")})}return ge},[d,Lt?.effort,Lt?.model,gr,H,ie,ki,K,fn,Rn]),Wa=O.useMemo(()=>new Map(Hm.map(ge=>[ge.key,ge.message])),[Hm]);O.useMemo(()=>{const ge=[];Ms&&gr&&ge.push(`提供商已从 ${qx(gr)} 更改为 ${qx(H)}。之前的负责人会话不会恢复,负责人会以全新上下文启动。`);const ht=Wa.get("lead");return ht&&ge.push(`下次启动将使用 ${ht}。`),ge.length>0?ge.join(" "):null},[Ms,gr,H,Wa]);const X_=O.useMemo(()=>{const ge={};for(const ht of Rn){const Bt=ht.name.trim();if(!Bt||ht.removedAt)continue;const xn=Wa.get(`member:${Bt.toLowerCase()}`);xn&&(ge[ht.id]=`下次启动将使用 ${xn}。`)}return ge},[Rn,Wa]);O.useMemo(()=>{const ge={...X_};for(const[ht,Bt]of Object.entries(qa.memberWarningById))ge[ht]=ge[ht]?`${ge[ht]} ${Bt}`:Bt;return ge},[X_,qa.memberWarningById]);const eu=Wl(I)?"":I.trim(),Br=C==="project"?eu:$.trim(),tu=O.useMemo(()=>z4n(We,Ae),[Ae,We]),Zm=O.useMemo(()=>U4n(Yf),[Yf]),Vf=O.useMemo(()=>B4n({cwd:Br,selectedProviderId:H,selectedModel:ie,selectedMemberProviders:We,limitContext:J,runtimeStatusSignature:tu,modelChecksSignature:Zm}),[Br,J,tu,We,ie,Zm,H]);O.useEffect(()=>{!t||!d||e.clearProvisioningError?.(w)},[t,d,w]),O.useEffect(()=>{if(!t||!d){jt.current+=1,Ne.current=null;return}if(typeof Z.teams.prepareProvisioning!="function"){jt.current+=1,Ne.current=null,Ot("failed"),Qt([]),tn([]),Ge("当前 preload 版本不支持 team:prepareProvisioning,请重启开发应用。");return}if(!Br){jt.current+=1,Ne.current=null,Ot("idle"),Qt([]),tn([]),Ge("请选择工作目录以验证启动环境。");return}if(Ne.current===Vf)return;Ne.current=Vf;const ge=++jt.current,ht=OFn(Ar.current,We);Ot("loading"),Ge("正在并行检查选中的提供商..."),Qt([]),tn(ht),(async()=>{let Bt=ht;const xn=We.map(En=>{const Dn=Yf.get(En)??[],no=Kn.current.get(En)??null;return{providerId:En,selectedModelChecks:Dn,backendSummary:no}});try{for(const xr of xn)Bt=F8(Bt,xr.providerId,{status:"checking",backendSummary:xr.backendSummary,details:[]});jt.current===ge&&tn(Bt);const En=await Promise.all(xn.map(async xr=>{const Cs=await X4n({cwd:Br,providerId:xr.providerId,selectedModelIds:xr.selectedModelChecks,prepareProvisioning:Z.teams.prepareProvisioning,limitContext:J,onModelProgress:({status:Ha,details:qf})=>{Bt=F8(Bt,xr.providerId,{status:Ha,backendSummary:xr.backendSummary,details:qf}),jt.current===ge&&tn(Bt)}});return{...xr,prepResult:Cs}}));let Dn=!1,no=!1;const Oa=[];for(const xr of En)xr.prepResult.warnings.length>0&&(no=!0,Oa.push(...xr.prepResult.warnings.map(Cs=>`${qx(xr.providerId)}: ${Cs}`))),xr.prepResult.status==="failed"?Dn=!0:xr.prepResult.status==="notes"&&(no=!0),Bt=F8(Bt,xr.providerId,{status:xr.prepResult.status,backendSummary:xr.backendSummary,details:xr.prepResult.details});if(jt.current===ge&&tn(Bt),jt.current!==ge)return;const sr=cnt(Bt)??"部分所选提供商需要处理。";Ot(Dn?"failed":"ready"),Ge(Dn?sr:no?"所选提供商已就绪(含提示)。":"所选提供商已就绪。"),Qt(Oa)}catch(En){if(jt.current!==ge)return;const Dn=En instanceof Error?En.message:"预热 Agent CLI 环境失败";Ot("failed"),Qt([]),tn(W4n(Bt,Dn)),Ge(Dn)}})()},[t,d,Br,Vf,H,We,Yf]);const Km=re(vt(ge=>ge.repositoryGroups));O.useEffect(()=>{if(!t)return;F(!0),D(null);let ge=!1;return(async()=>{try{const ht=(await Z.getProjects()).filter(En=>!Wl(En.path));if(ge)return;const Bt=new Set(ht.map(En=>En.path)),xn=[];for(const En of Km)for(const Dn of En.worktrees)!Wl(Dn.path)&&!Bt.has(Dn.path)&&(Bt.add(Dn.path),xn.push({id:Dn.id,path:Dn.path,name:Dn.name,sessions:[],totalSessions:0,createdAt:Dn.createdAt??Date.now()}));U([...ht,...xn])}catch(ht){if(ge)return;D(ht instanceof Error?ht.message:"项目加载失败"),U([])}finally{ge||F(!1)}})(),()=>{ge=!0}},[t,Km]);const nu=d?e.defaultProjectPath:void 0;O.useEffect(()=>{if(!t||C!=="project"||I)return;const ge=M.filter(ht=>!Wl(ht.path));if(ge.length!==0){if(nu&&!Wl(nu)){const ht=dr(nu),Bt=ge.find(xn=>dr(xn.path)===ht);if(Bt){Q(Bt.path);return}}Q(ge[0].path)}},[t,C,M,I,nu]),O.useEffect(()=>{!t||C!=="project"||!I||Wl(I)&&Q("")},[t,C,I,Q]),JBn(Br||null);const U_=d?e.activeTeams:void 0,f1=O.useMemo(()=>{if(!d||!U_?.length||!Br)return null;const ge=dr(Br);return U_.find(ht=>ht.teamName!==w&&dr(ht.projectPath)===ge)??null},[d,U_,Br,w]);O.useEffect(()=>{qe(!1)},[f1?.teamName,Br]),tx(null),zN(null);const ix=O.useMemo(()=>i4n(pe,fn),[pe,fn]),z_=O.useMemo(()=>o4n(pe,ix),[ix,pe]),FB=O.useMemo(()=>{if(!d)return[];const ge=[];ge.push("--input-format","stream-json","--output-format","stream-json"),ge.push("--verbose","--setting-sources","user,project,local"),ge.push("--mcp-config","<auto>","--disallowedTools",_Fn),oe&&ge.push("--dangerously-skip-permissions");const ht=$w(ie,J,H,Ae.get(H));ht&&ge.push("--model",ht);const Bt=UM({providerId:H,selectedEffort:K});if(Bt&&ge.push("--effort",Bt),H==="anthropic"){const xn=Pl?.resolvedFastMode?{fastMode:!0,fastModePerSessionOptIn:!1}:{fastMode:!1};ge.push("--settings",JSON.stringify(xn))}return ge.push(...dnt()),ue||ge.push("--resume","<previous>"),ge},[Pl?.resolvedFastMode,Jc,d,oe,ie,J,K,H,ue,Ae]),uA=O.useMemo(()=>{if(!d)return[];const ge=[];N.value.trim()&&ge.push("负责人提示词");const ht=Rn.filter(Bt=>!Bt.removedAt&&Bt.isolation==="worktree").length;return ht>0&&ge.push(`${ht} 个成员使用独立 worktree`),ge.push(`Provider: ${qx(H)}`),ie&&ge.push(`Model: ${ie}`),K&&ge.push(`Effort: ${K}`),H==="anthropic"&&(W==="on"?ge.push("快速模式"):W==="off"?ge.push("快速模式关闭"):H==="anthropic"&&i&&ge.push("快速默认")),H==="anthropic"&&J&&ge.push("上下文限制为 200K"),oe&&ge.push("自动批准工具"),ge.push("成员由运行时动态生成"),ue&&ge.push("全新会话"),Ve&&Ce.trim()&&ge.push(`Worktree:${Ce.trim()}`),ve.trim()&&ge.push("自定义 CLI 参数"),ge},[d,Rn,N.value,ie,H,K,W,i,J,oe,ue,Ve,Ce,ve]),Jm=O.useMemo(()=>{const ge=[];return Br||ge.push("必须填写工作目录"),m&&(w||ge.push("必须选择团队"),N.value.trim()||ge.push("必须填写提示词"),Xe.trim()||ge.push("必须填写 Cron 表达式")),ge},[Br,m,w,N.value,Xe]),hp=O.useMemo(()=>{const ge=nCe(H,ie,Ae.get(H));if(ge)return ge;if(!d)return null;for(const ht of Rn){if(ht.removedAt)continue;const Bt=ka(ht.providerId)??H,xn=nCe(Bt,ht.model,Ae.get(Bt));if(!xn)continue;const En=ht.name.trim();return En?`${En}: ${xn}`:xn}return null},[Rn,d,Ae,ie,H]),ox=O.useMemo(()=>{const ge=gCe(ft,H,ki||ie);return ge?.reason??ge?.detail??null},[ki,ft,ie,H]);O.useMemo(()=>{const ge={};if(!d)return ge;for(const ht of Rn){if(ht.removedAt)continue;if(Ie&&ox){ge[ht.id]=ox;continue}const Bt=ka(ht.providerId)??H,xn=gCe(ft,Bt,ht.model),En=xn?.reason??xn?.detail??null;En&&(ge[ht.id]=En)}return ge},[Rn,d,ox,ft,H,Ie]);const dA=O.useMemo(()=>d&&!V8,[d,pe]),YB=O.useMemo(()=>!1,[d,pe]),VB=d?e.provisioningError:null,pA=V??hp??VB,Ga=O.useMemo(()=>tFn({state:ot,message:nt,warnings:St,checks:ft}),[ft,nt,ot,St]),B_=re(ge=>d&&w?T_(ge,w):!1);O.useEffect(()=>{!t||!d||!w||!B_||(T(w,Br||nu),mr())},[mr,nu,Br,w,d,B_,t,T]);const qB=()=>{if(p){if(!mt&&!Ct){q("正在加载上次启动配置,请稍候...");return}if(hp){q(hp);return}q(null),te(!0),(async()=>{try{const ge=mt,ht=UM({providerId:H,selectedEffort:K}),Bt={teamName:w,cwd:ge?.cwd??Wt??Br,executionTarget:ge?.executionTarget??{type:"local",cwd:ge?.cwd??Wt??(Br||void 0)},prompt:ge?.prompt,providerId:H,providerBackendId:zM(H,Ae.get(H))??ge?.providerBackendId??void 0,model:$w(ie,!1,H,Ae.get(H)),effort:ht,fastMode:W,limitContext:!1,clearContext:ue||void 0,skipPermissions:oe,worktree:ge?.worktree,extraCliArgs:ge?.extraCliArgs},xn=V8?[]:Ct??[];await e.onRelaunch(Bt,xn),T(w,Wt||nu),mr()}catch(ge){const ht=ge instanceof Error?ge.message:"重新启动团队失败";q(ht),console.error("Failed to relaunch team from dialog:",ge)}finally{te(!1)}})();return}if(Jm.length>0){q(Jm[0]);return}if(hp){q(hp);return}if(d&&qa.blocksSubmission){q(qa.message);return}if(d&&!Br){q("请选择工作目录(cwd)");return}q(null),te(!0),(async()=>{try{if(d){const ge=V8?[]:l4n(Rn),ht=UM({providerId:H,selectedEffort:K}),Bt={teamName:w,cwd:Br,executionTarget:{type:"local",cwd:Br||void 0},prompt:N.value.trim()||void 0,providerId:H,providerBackendId:zM(H,Ae.get(H))??od??void 0,model:$w(ie,J,H,Ae.get(H)),effort:ht,fastMode:W,limitContext:J,clearContext:ue||void 0,skipPermissions:oe,worktree:Ve&&Ce.trim()?Ce.trim():void 0,extraCliArgs:OCe(ve)};await Z.teams.replaceMembers(w,{members:ge}),await e.onLaunch(Bt),T(w,Br||nu),mr()}else{const ge=wt?parseFloat(wt):void 0,ht=zM(H,Ae.get(H))??od??void 0,Bt=$w(ie,!1,H,Ae.get(H)),xn=UM({providerId:H,selectedEffort:K}),En={cwd:Br,prompt:N.value.trim(),providerId:H,providerBackendId:ht,model:Bt,effort:xn,fastMode:W,resolvedFastMode:Pl?.resolvedFastMode??!1,skipPermissions:oe};if(_&&g){const Dn={label:nr.trim()||void 0,cronExpression:Xe.trim(),timezone:me,warmUpMinutes:le,maxTurns:Be,maxBudgetUsd:ge,launchConfig:En};await Xn(g.id,Dn)}else{const Dn={teamName:w,label:nr.trim()||void 0,cronExpression:Xe.trim(),timezone:me,warmUpMinutes:le,maxTurns:Be,maxBudgetUsd:ge,launchConfig:En};await mn(Dn)}mr()}}catch(ge){const ht=ge instanceof Error?ge.message:m?"保存计划失败":p?"重新启动团队失败":"启动团队失败";q(ht),d&&console.error(p?"Failed to relaunch team from dialog:":"Failed to launch team from dialog:",ge)}finally{te(!1)}})()},Pe=p?ee||B_:d?ee||B_||Jm.length>0||!!hp||dA||YB||qa.blocksSubmission:ee||Jm.length>0||!!hp,He=d?p?"重新启动团队":"启动团队":_?"编辑计划":"创建计划",Vt=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}”创建自动运行计划`:"创建团队自动运行计划",rr=d?p?"重新启动团队":"启动团队":_?"保存更改":"创建计划",Fr=d?p?"重新启动中...":"启动中...":_?"保存中...":"创建中...";return u.jsx(us,{open:t,onOpenChange:ge=>{ge||mr()},children:u.jsxs(ts,{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(ds,{children:[u.jsx(ns,{className:"text-sm",children:He}),u.jsx(oi,{className:"text-xs",children:Vt})]}),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(zn,{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(j8,{providerId:H,onProviderChange:Jt,value:ie,onValueChange:In,id:"relaunch-model",disableGeminiOption:!0}),u.jsx(eCe,{value:K,onValueChange:cr,id:"relaunch-effort",providerId:H,model:ie,limitContext:!1}),H==="anthropic"?u.jsxs("div",{className:"mt-2",children:[u.jsx(z8,{value:W,onValueChange:_s,providerFastModeDefault:i,model:ie,limitContext:!1,id:"relaunch-fast-mode"}),he?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:he}):null]}):null]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(ai,{id:"relaunch-clear-context",checked:ue,onCheckedChange:ge=>ae(ge===!0)}),u.jsxs(Zt,{htmlFor:"relaunch-clear-context",className:"flex cursor-pointer items-center gap-1.5 text-xs font-normal text-text-secondary",children:[u.jsx(VO,{className:"size-3 shrink-0"}),"清空上下文(新会话)"]})]}),!ue&&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 频率限制。"}),ue&&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(zn,{className:"mt-0.5 size-3.5 shrink-0"}),u.jsx("p",{children:"团队负责人会启动一个新会话,不再恢复之前的上下文。已积累的会话记忆和对话历史将不可用。"})]})})]}):null,d&&f1&&!$e?u.jsx("div",{className:"rounded-md border p-3 text-xs",style:{backgroundColor:"var(--warning-bg)",borderColor:"var(--warning-border)",color:"var(--warning-text)"},children:u.jsxs("div",{className:"flex items-start gap-2",children:[u.jsx(zn,{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:["该工作目录下已有团队“",f1.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:Br})]})]}),u.jsx("button",{type:"button",className:"shrink-0 rounded p-0.5 opacity-60 transition-colors hover:opacity-100",onClick:()=>qe(!0),children:u.jsx(Pr,{className:"size-3.5"})})]})}):null,d?u.jsx(fFn,{analysis:qa,onOpenDashboard:()=>{mr(),v()}}):null,p?null:u.jsxs("div",{className:"space-y-4",children:[P?u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Zt,{className:"text-xs",children:"团队"}),u.jsx(QB,{options:E,value:y,onValueChange:x,placeholder:"选择团队...",searchPlaceholder:"搜索团队...",emptyMessage:E.length===0?"暂无可用团队,请先创建团队。":"没有匹配的团队。",disabled:E.length===0,renderOption:(ge,ht)=>{const Bt=ge.meta?.color,xn=Bt?Wr(Bt):qc(ge.label);return u.jsxs(u.Fragment,{children:[ht?u.jsx(qr,{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:xn.text}}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[ht?u.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:xn.text}}):null,u.jsx("p",{className:"truncate font-medium text-[var(--color-text)]",children:ge.label})]}),ge.description?u.jsx("p",{className:"truncate text-[var(--color-text-muted)]",children:ge.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:()=>jr(ge=>!ge),children:[Zn?u.jsx(Dr,{className:"size-3.5 shrink-0 text-[var(--color-text-muted)]"}):u.jsx(Bn,{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:"定时计划"}),!Zn&&(nr||Xe)?u.jsx("span",{className:"ml-auto truncate text-[11px] text-[var(--color-text-muted)] opacity-70",children:nr||Xe}):null]}),Zn?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(Zt,{htmlFor:"schedule-label",className:"label-optional",children:"标签(可选)"}),u.jsx(An,{id:"schedule-label",className:"h-8 text-xs",value:nr,onChange:ge=>nn(ge.target.value),placeholder:"例如:每日代码评审、夜间自动测试..."})]}),u.jsx(x4n,{cronExpression:Xe,onCronExpressionChange:Re,timezone:me,onTimezoneChange:Ee,warmUpMinutes:le,onWarmUpMinutesChange:je})]}):null]}):null,u.jsx(snt,{cwdMode:C,onCwdModeChange:k,selectedProjectPath:I,onSelectedProjectPathChange:Q,customCwd:$,onCustomCwdChange:R,projects:M,projectsLoading:A,projectsError:z}),u.jsxs("div",{className:"rounded-md border border-[var(--color-border)] bg-[var(--color-surface)] p-3",children:[u.jsxs("div",{className:"mb-2",children:[u.jsx("p",{className:"text-xs font-medium text-[var(--color-text)]",children:"团队运行时"}),u.jsx("p",{className:"mt-0.5 text-[11px] text-[var(--color-text-muted)]",children:"Provider 作用于整个团队;成员只选择模型,默认继承这里的 provider。"})]}),u.jsx(j8,{providerId:H,onProviderChange:Jt,value:ie,onValueChange:In,id:"launch-team-provider-model",disableGeminiOption:!0,modelIssueReasonByValue:ie.trim()?{[ie.trim()]:ox}:void 0})]}),d?u.jsx($4n,{title:p?"重新启动设置":"可选启动设置",description:p?"重新启动团队前,请确认成员名单和团队负责人运行时。":"默认只需关注项目路径;需要更多控制时再展开这里。",summary:uA,children:u.jsxs("div",{className:"space-y-4",children:[H==="anthropic"?u.jsxs("div",{className:"space-y-2",children:[u.jsx(z8,{value:W,onValueChange:_s,providerFastModeDefault:i,model:ie,limitContext:Oi,id:"launch-fast-mode"}),he?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(Gs,{className:"mt-0.5 size-3.5 shrink-0 text-amber-300"}),u.jsx("p",{children:he})]}):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(Gs,{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(Zt,{htmlFor:"dialog-prompt",className:"label-optional",children:"给团队负责人的提示(可选)"}),u.jsx(Rm,{id:"dialog-prompt",className:"min-h-[100px] text-xs",minRows:4,maxRows:12,value:N.value,onValueChange:N.setValue,suggestions:z_,projectPath:Br||null,chips:j.chips,onChipRemove:j.removeChip,onFileChipInsert:j.addChip,placeholder:"填写给团队负责人的说明...",footerRight:N.isSaved?u.jsx("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:"已保存"}):null})]}),u.jsx("div",{children:u.jsx(Zke,{id:"dialog-skip-permissions",checked:oe,onCheckedChange:Nn})}),u.jsxs("div",{className:"space-y-2",children:[Ms?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(zn,{className:"mt-0.5 size-3.5 shrink-0"}),u.jsxs("p",{children:["提供商已从 ",qx(gr)," 更改为"," ",qx(H),"。之前的负责人会话不会恢复,负责人会以全新上下文启动,以正确应用新的运行时。"]})]})}):null,u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(ai,{id:"clear-context",checked:ue,onCheckedChange:ge=>ae(ge===!0)}),u.jsxs(Zt,{htmlFor:"clear-context",className:"flex cursor-pointer items-center gap-1.5 text-xs font-normal text-text-secondary",children:[u.jsx(VO,{className:"size-3 shrink-0"}),"清空上下文(新会话)"]})]}),ue&&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(zn,{className:"mt-0.5 size-3.5 shrink-0"}),u.jsx("p",{children:"团队负责人会启动一个新会话,不再恢复之前的上下文。已积累的会话记忆和对话历史将不可用。"})]})})]}),u.jsx(T4n,{teamName:w,internalArgs:FB,worktreeEnabled:Ve,onWorktreeEnabledChange:ks,worktreeName:Ce,onWorktreeNameChange:Us,customArgs:ve,onCustomArgsChange:Rl})]})}):u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(Zt,{htmlFor:"dialog-prompt",children:"提示词"}),u.jsx(Rm,{id:"dialog-prompt",className:"min-h-[100px] text-xs",minRows:4,maxRows:12,value:N.value,onValueChange:N.setValue,suggestions:z_,projectPath:Br||null,chips:j.chips,onChipRemove:j.removeChip,onFileChipInsert:j.addChip,placeholder:"填写定时执行时给 Claude 的说明...",footerRight:N.isSaved?u.jsx("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:"已保存"}):null}),u.jsxs("p",{className:"text-[11px] text-[var(--color-text-muted)]",children:["该提示词会传递给 ",u.jsx("code",{className:"font-mono",children:"claude -p"})," 用于 one-shot execution"]})]}),u.jsxs("div",{children:[u.jsx(j8,{providerId:H,onProviderChange:Jt,value:ie,onValueChange:In,id:"dialog-model",disableGeminiOption:!0}),u.jsx(eCe,{value:K,onValueChange:cr,id:"dialog-effort",providerId:H,model:ie,limitContext:!1}),H==="anthropic"?u.jsxs("div",{className:"mt-2",children:[u.jsx(z8,{value:W,onValueChange:_s,providerFastModeDefault:i,model:ie,limitContext:!1,id:"dialog-fast-mode"}),he?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:he}):null]}):null,u.jsx(Zke,{id:"dialog-skip-permissions",checked:oe,onCheckedChange:Nn})]})]}),m?u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx(Zt,{htmlFor:"schedule-max-turns",className:"text-[11px] text-[var(--color-text-muted)]",children:"Max turns"}),u.jsx(An,{id:"schedule-max-turns",type:"number",min:1,max:500,className:"h-8 text-xs",value:Be,onChange:ge=>yt(Math.max(1,parseInt(ge.target.value)||50))})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(Zt,{htmlFor:"schedule-max-budget",className:"text-[11px] text-[var(--color-text-muted)]",children:"Max budget (USD)"}),u.jsx(An,{id:"schedule-max-budget",type:"number",min:0,step:.5,className:"h-8 text-xs",value:wt,onChange:ge=>ut(ge.target.value),placeholder:"不限"})]})]}):null]}),pA?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(zn,{className:"mt-0.5 size-3.5 shrink-0"}),u.jsx("span",{children:pA})]}):null,u.jsxs(ed,{className:d&&!p?"pt-4 sm:justify-between":"pt-4",children:[d&&!p?u.jsxs("div",{className:"min-w-0",children:[Ga.state==="idle"||Ga.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:Ga.message??(Ga.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(Y8,{checks:ft,className:"mt-2"})]}):null,Ga.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(ma,{className:"size-3.5 shrink-0"}),u.jsx("span",{children:ft.some(ge=>ge.status==="notes")||St.length>0?"CLI 环境已就绪(有提示)":"CLI 环境已就绪"})]}),Ga.message?u.jsx("p",{className:"mt-0.5 pl-5 text-[11px] text-[var(--color-text-muted)]",children:Ga.message}):null,u.jsx(Y8,{checks:ft,className:"mt-1"}),St.length>0&&ft.length===0?u.jsx("div",{className:"mt-0.5 space-y-0.5 pl-5",children:St.map(ge=>u.jsx("p",{className:"text-[11px] text-sky-300",children:ge},ge))}):null]}):null,Ga.state==="failed"?u.jsxs("div",{className:"text-xs",children:[u.jsxs("div",{className:"flex items-start gap-2 text-red-300",children:[u.jsx(zn,{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:Ga.message??"准备环境失败"}),u.jsxs("p",{className:"mt-0.5 text-[10px] text-[var(--color-text-muted)] opacity-70",children:["启动前检查会提前发现",p?"重新启动":"启动","问题"]})]})]}),nFn(ft,Ga.message)?null:u.jsx(Y8,{checks:ft,className:"mt-2",suppressDetailsMatching:Ga.message}),St.length>0&&ft.length===0?u.jsx("div",{className:"mt-1 space-y-0.5 pl-6",children:St.map(ge=>u.jsx("p",{className:"text-[11px]",style:{color:"var(--warning-text)"},children:ge},ge))}):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:iFn(Ga.message,ft)}),(Ga.message??"").toLowerCase().includes("spawn ")||ft.some(ge=>ge.details.some(ht=>ht.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:()=>{mr(),v()},children:"前往首页"}):null]})]}):null]}):null,u.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[u.jsx(Me,{variant:"outline",size:"sm",onClick:mr,children:d?"关闭":"取消"}),u.jsx(Me,{size:"sm",className:"bg-emerald-600 text-white hover:bg-emerald-700",disabled:Pe,onClick:qB,children:ee||B_?u.jsxs(u.Fragment,{children:[u.jsx(zt,{className:"mr-1.5 size-3.5 animate-spin"}),Fr]}):rr})]})]})]})})},SFn=({open:e,teamName:t,taskId:n,members:r,onCancel:s,onSubmit:i})=>{const o=re(m=>m.selectedTeamData?.config.projectPath??null),{suggestions:a}=tx(t),c=my({key:`requestChanges:${t}:${n??""}`,enabled:!!(t&&n)}),l=O.useMemo(()=>Co(r),[r]),d=O.useMemo(()=>r.map(m=>({id:m.name,name:m.name,subtitle:mi(m.role)??mi(m.agentType)??void 0,color:l.get(m.name)})),[r,l]),p=Em(c.value).trim(),f=fl-p.length,h=()=>{const m=Em(p)||void 0,g=p?Zb(c.value,a):[];c.clearDraft(),i(m,g)};return u.jsx(us,{open:e&&n!==null,onOpenChange:m=>{m||s()},children:u.jsxs(ts,{className:"w-[600px]",children:[u.jsxs(ds,{children:[u.jsx(ns,{children:"请求修改"}),u.jsxs(oi,{children:["Task #",n?Ui(n):""]})]}),u.jsx("div",{className:"grid gap-2 py-2",children:u.jsx(Rm,{id:"review-comment",value:c.value,onValueChange:c.setValue,placeholder:"描述需要修改的内容...(Enter 提交)",suggestions:d,taskSuggestions:a,projectPath:o,onModEnter:h,minRows:4,maxRows:12,maxLength:fl,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(xE,{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]})})})]})})},vFn=({attachment:e,onRemove:t,onPreview:n,disabled:r})=>{const s=tb(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(UD,{size:18,className:"text-red-400"})}):null,s&&i?u.jsx(T7e,{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(Vm,{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:yRn(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(Pr,{size:10})})]})},Iw=400,pnt=({attachments:e,onRemove:t,error:n,onDismissError:r,disabled:s,disabledHint:i})=>{const[o,a]=O.useState(null),[c,l]=O.useState(new Set),d=O.useRef(new Set),[p,f]=O.useState(new Set),h=O.useRef(new Map),m=O.useRef(new Map);O.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)},Iw);m.current.set(v,T)}}},[e]),O.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 g=O.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)},Iw);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)=>{tb(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 ${Iw}ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity ${Iw}ms ease`,transform:v?"scale(0)":T?void 0:"scale(1)",opacity:v?0:1,transformOrigin:"center center",animation:T?`att-scale-in ${Iw}ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards`:void 0},children:u.jsx(vFn,{attachment:x,onRemove:g,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(Zi,{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(Zi,{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(Pr,{size:12})}):null]}):null,o!==null&&b[o]?u.jsx(HE,{open:!0,onClose:()=>a(null),slides:b,index:o}):null]})},fnt=({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(UD,{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(gU,{size:24}),u.jsx("span",{className:"text-xs font-medium",children:"将文件拖到这里"})]})}):null,hnt=({warning:e,debugDetails:t,pendingDelayMs:n=1e4})=>{const r=`${e??""}:${t?.messageId??""}`,s=t?.responsePending===!0&&t.delivered!==!1,[i,o]=O.useState(null),[a,c]=O.useState(null),[l,d]=O.useState(()=>s?null:r),p=O.useRef(!0),f=O.useRef(null),h=O.useRef(null),m=i===r,g=a===r,_=O.useMemo(()=>t?_Lt(t):"",[t]);if(O.useEffect(()=>(p.current=!0,()=>{p.current=!1,f.current!==null&&window.clearTimeout(f.current),h.current!==null&&window.clearTimeout(h.current)}),[]),O.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(Zi,{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:g?"Copied":"Copy debug details"})]}):null]})},TFn=500;function EFn(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 wFn(e){const t=e?.persistenceKey,[n,r]=O.useState([]),[s,i]=O.useState(null),o=O.useRef([]),a=O.useRef(null),c=O.useRef(null),l=O.useRef(t);l.current=t;const d=O.useRef(e?.onUnsupportedFiles);d.current=e?.onUnsupportedFiles;const p=O.useCallback(T=>{o.current=T,r(T)},[]),f=O.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?Fi.deleteDraft(w.key):Fi.saveDraft(w.key,JSON.stringify(w.value)))},TFn))},[]),h=O.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?Fi.deleteDraft(T.key):Fi.saveDraft(T.key,JSON.stringify(T.value))}},[]);O.useEffect(()=>{if(!t){h(),o.current=[],r([]);return}let T=!1;return h(),o.current=[],r([]),(async()=>{const E=await Fi.loadDraft(t);if(!(T||E==null))try{const w=JSON.parse(E);EFn(w)&&(w.reduce((C,k)=>C+k.size,0)<=Tv&&w.length<=cO?(o.current=w,r(w)):Fi.deleteDraft(t))}catch{}})(),()=>{T=!0}},[t,h]),O.useEffect(()=>()=>{h()},[h]);const m=n.reduce((T,E)=>T+E.size,0),g=n.length<cO&&m<Tv,_=O.useCallback(async T=>{i(null);const E=Array.from(T);if(E.length===0)return;const w=[],P=[];for(const Q of E)jN(Q)==="unsupported"?P.push(Q):w.push(Q);if(P.length>0&&(d.current?d.current(P):i(`不支持的文件类型:${P[0].name}`)),w.length===0)return;let C=0,k=!0;for(const Q of w){const $=S7e(Q);if(!$.valid){i($.error),k=!1;break}C+=Q.size}if(!k)return;const I=[];for(const Q of w)try{const $=await v7e(Q);I.push($)}catch{i(`读取文件失败:${Q.name}`),k=!1;break}k&&r(Q=>{if(Q.length+I.length>cO)return i(`最多允许添加 ${cO} 个附件`),Q;if(Q.reduce((N,j)=>N+j.size,0)+C>Tv)return i("附件总大小超过 20MB 限制"),Q;const R=[...Q,...I];return o.current=R,f(R),R})},[f]),b=O.useCallback(T=>{r(E=>{const w=E.filter(P=>P.id!==T);return o.current=w,f(w),w}),i(null)},[f]),y=O.useCallback(()=>{i(null)},[]),x=O.useCallback(()=>{a.current!=null&&(clearTimeout(a.current),a.current=null),c.current=null,o.current=[],p([]),i(null);const T=l.current;T&&Fi.deleteDraft(T)},[p]),S=O.useCallback(T=>{const E=T.clipboardData?.items;if(!E)return;const w=[];for(const P of Array.from(E))if(P.kind==="file"){const C=P.getAsFile();C&&w.push(C)}w.length>0&&(T.preventDefault(),_(w))},[_]),v=O.useCallback(T=>{T.preventDefault();const E=T.dataTransfer?.files;E?.length&&_(Array.from(E))},[_]);return{attachments:n,error:s,totalSize:m,canAddMore:g,addFiles:_,removeAttachment:b,clearAttachments:x,clearError:y,handlePaste:S,handleDrop:v}}const kFn=({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 g=O.useMemo(()=>Co(n),[n]),_=re(Ge=>Ge.selectedTeamData?.config.projectPath??null),[b,y]=O.useState(void 0),[x,S]=O.useState(!1),[v,T]=O.useState(""),E=my({key:`sendMessage:${t}:text`}),w=UN(`sendMessage:${t}:chips`),P=O.useRef(!1),C=O.useRef(null),[k,I]=O.useState(!1),Q=O.useRef(0),$=O.useRef(null),[R,N]=O.useState(null),j=O.useRef(0),{attachments:M,error:U,canAddMore:A,addFiles:F,removeAttachment:z,clearAttachments:D,clearError:V,handlePaste:q,handleDrop:ee}=wFn({persistenceKey:`sendMessage:${t}:attachments`}),te=n.find(Ge=>Ge.name===v),H=te?Jn(te):!1,G=H&&!!a,ie=G&&A,ne=G?void 0:H?"团队在线时才能添加文件":"文件只能发送给团队负责人",[pe,Te]=O.useState(!1);O.useEffect(()=>{if(e&&!P.current){const Ge=n.find(Qt=>Jn(Qt))?.name;if(T(r??Ge??""),y(o),S(!1),C.current=f,i){const Qt=Pf(i);E.setValue(Qt+`
|
|
1842
1842
|
`),w.setChips([i])}else s&&E.setValue(s)}P.current=e},[e,r,s,i,o,f,n,E,w]),O.useEffect(()=>{e&&f&&f!==C.current&&(C.current=f,T(""),Te(!0))},[e,f]),O.useEffect(()=>{pe&&(E.clearDraft(),w.clearChipDraft(),D(),Te(!1),m())},[pe]);const be=(b?.text.length??0)>120,Ie=O.useMemo(()=>n.map(Ge=>({id:Ge.name,name:Ge.name,subtitle:mi(Ge.role)??mi(Ge.agentType)??void 0,color:g.get(Ge.name)})),[n,g]),{suggestions:Se}=zN(t),{suggestions:oe}=tx(t),Oe=M.length>0&&!G,K=Em(E.value).trim(),Y=JE(K,w.chips),W=b?lae(b.from,b.text,Y):Y,se=fl-W.length,he=v.trim().length>0&&W.length>0&&W.length<=fl&&!c&&!Oe,we=Ge=>{const St=w.chips.find(Qt=>Qt.id===Ge);St&&E.setValue(M2(E.value,St)),w.setChips(w.chips.filter(Qt=>Qt.id!==Ge))},J=()=>{if(!he)return;const Ge=Zb(E.value,oe);Promise.resolve(h(v.trim(),W,K,M.length>0?M:void 0,void 0,Ge)).then(St=>{St?.runtimeDelivery?.attempted===!0&&St.runtimeDelivery.delivered===!1||(E.clearDraft(),w.clearChipDraft(),D())}).catch(()=>{})},de=Ge=>{Ge||m()},ue=O.useCallback(Ge=>{const St=Ge.target;St.files?.length&&F(St.files),St.value=""},[F]),ae=O.useCallback(()=>{N(ne??"文件只能发送给团队负责人"),window.clearTimeout(j.current),j.current=window.setTimeout(()=>{N(null)},4e3)},[ne]);O.useEffect(()=>{const Ge=j;return()=>window.clearTimeout(Ge.current)},[]);const $e=O.useCallback(Ge=>{Ge.preventDefault(),Q.current+=1,Q.current===1&&I(!0)},[]),qe=O.useCallback(Ge=>{Ge.preventDefault(),Q.current-=1,Q.current<=0&&(Q.current=0,I(!1))},[]),ot=O.useCallback(Ge=>{Ge.preventDefault()},[]),Ot=O.useCallback(Ge=>{if(Ge.preventDefault(),Q.current=0,I(!1),!G){Ge.dataTransfer?.files?.length&&ae();return}ee(Ge)},[G,ee,ae]),nt=O.useCallback(Ge=>{if(!G){Array.from(Ge.clipboardData.items).some(Qt=>Qt.kind==="file")&&(Ge.preventDefault(),ae());return}q(Ge)},[G,q,ae]);return u.jsx(us,{open:e,onOpenChange:de,children:u.jsxs(ts,{className:"min-w-0 max-w-3xl",onDragEnter:$e,onDragLeave:qe,onDragOver:ot,onDrop:Ot,onPaste:nt,children:[u.jsx(fnt,{active:k,rejected:!G,rejectionReason:ne}),u.jsxs(ds,{children:[u.jsx(ns,{children:"发送消息"}),u.jsx(oi,{children:"向团队成员发送一条私信。"})]}),u.jsxs("div",{className:"grid gap-4 py-2",children:[u.jsxs("div",{className:"grid gap-2",children:[u.jsx(Zt,{htmlFor:"smd-recipient",children:"接收人"}),u.jsx(wae,{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(Zt,{htmlFor:"smd-message",children:"消息内容"}),H?u.jsxs(u.Fragment,{children:[u.jsx("input",{ref:$,type:"file",accept:"*/*",multiple:!0,className:"hidden",onChange:ue}),u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx("button",{type:"button",className:`inline-flex items-center gap-1 rounded p-1 transition-colors ${ie?"text-[var(--color-text-secondary)] hover:text-[var(--color-text)]":"text-[var(--color-text-muted)] opacity-40"}`,disabled:!ie,onClick:()=>$.current?.click(),children:u.jsx(gU,{size:14})})}),u.jsx(it,{side:"top",children:a?A?"添加文件(支持粘贴或拖拽)":"已达到附件上限":"团队在线时才能添加文件"})]})]}):null]}),u.jsx(pnt,{attachments:M,onRemove:z,error:U??R,onDismissError:V,disabled:Oe,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(at,{children:[u.jsx(lt,{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(Pr,{size:12})})}),u.jsx(it,{side:"left",children:"移除引用"})]}),u.jsxs("div",{className:"mb-1 flex items-center gap-1.5",children:[u.jsx("span",{className:"text-[10px] text-blue-600/70 dark:text-blue-300/60",children:"正在回复"}),u.jsx(Ur,{name:b.from,color:g.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(Ks,{content:b.text,bare:!0,maxHeight:x?"max-h-48":"max-h-[3.75rem]"})}),be?u.jsx("button",{type:"button",className:"mt-0.5 text-[10px] text-blue-500 hover:text-blue-700 dark:text-blue-400/60 dark:hover:text-blue-300",onClick:()=>S(Ge=>!Ge),children:x?"收起":"展开"}):null]}):null,u.jsx(Rm,{id:"smd-message",className:b?"rounded-t-none":void 0,placeholder:"输入消息...(回车发送)",value:E.value,onValueChange:E.setValue,suggestions:Ie,teamSuggestions:Se,taskSuggestions:oe,chips:w.chips,onChipRemove:we,projectPath:_,onFileChipInsert:Ge=>w.setChips([...w.chips,Ge]),onModEnter:J,minRows:4,maxRows:12,maxLength:fl,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:!he,onClick:J,children:[u.jsx(xE,{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(Zi,{size:10,className:"shrink-0"}),l]}):d?u.jsx(hnt,{warning:d,debugDetails:p}):null,se<200?u.jsxs("span",{className:`text-[10px] ${se<100?"text-yellow-400":"text-[var(--color-text-muted)]"}`,children:["剩余 ",se," 字符"]}):null,E.isSaved?u.jsx("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:"已保存"}):null]})})]})]})]})]})})};async function CFn({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 Ice(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function RFn(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 PFn(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 $Fn(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const VM={scaleX:1,scaleY:1},NFn=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=AFn(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 AFn(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 mnt=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const i=Ice(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},IFn=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=MFn(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 MFn(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 gnt="Sortable",Ont=Je.createContext({activeIndex:-1,containerId:gnt,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:mnt,disabled:{draggable:!1,droppable:!1}});function _nt(e){let{children:t,id:n,items:r,strategy:s=mnt,disabled:i=!1}=e;const{active:o,dragOverlay:a,droppableRects:c,over:l,measureDroppableContainers:d}=Wse(),p=J$(gnt,n),f=a.rect!==null,h=O.useMemo(()=>r.map(T=>typeof T=="object"&&"id"in T?T.id:T),[r]),m=o!=null,g=o?h.indexOf(o.id):-1,_=l?h.indexOf(l.id):-1,b=O.useRef(h),y=!PFn(h,b.current),x=_!==-1&&g===-1||y,S=$Fn(i);np(()=>{y&&m&&d(h)},[y,h,m,d]),O.useEffect(()=>{b.current=h},[h]);const v=O.useMemo(()=>({activeIndex:g,containerId:p,disabled:S,disableTransforms:x,items:h,overIndex:_,useDragOverlay:f,sortedRects:RFn(h,c),strategy:s}),[g,p,S.draggable,S.droppable,x,h,_,c,f,s]);return Je.createElement(Ont.Provider,{value:v},t)}const QFn=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return Ice(n,r,s).indexOf(t)},DFn=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},LFn={duration:200,easing:"ease"},bnt="transform",jFn=Tm.Transition.toString({property:bnt,duration:0,easing:"linear"}),XFn={roleDescription:"sortable"};function UFn(e){let{disabled:t,index:n,node:r,rect:s}=e;const[i,o]=O.useState(null),a=O.useRef(n);return np(()=>{if(!t&&n!==a.current&&r.current){const c=s.current;if(c){const l=QE(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]),O.useEffect(()=>{i&&o(null)},[i]),i}function ynt(e){let{animateLayoutChanges:t=DFn,attributes:n,disabled:r,data:s,getNewIndex:i=QFn,id:o,strategy:a,resizeObserverConfig:c,transition:l=LFn}=e;const{items:d,containerId:p,activeIndex:f,disabled:h,disableTransforms:m,sortedRects:g,overIndex:_,useDragOverlay:b,strategy:y}=O.useContext(Ont),x=zFn(r,h),S=d.indexOf(o),v=O.useMemo(()=>({sortable:{containerId:p,index:S,items:d},...s}),[p,s,S,d]),T=O.useMemo(()=>d.slice(d.indexOf(o)),[d,o]),{rect:E,node:w,isOver:P,setNodeRef:C}=Gse({id:o,data:v,disabled:x.droppable,resizeObserverConfig:{updateMeasurementsFor:T,...c}}),{active:k,activatorEvent:I,activeNodeRect:Q,attributes:$,setNodeRef:R,listeners:N,isDragging:j,over:M,setActivatorNodeRef:U,transform:A}=TXt({id:o,data:v,attributes:{...XFn,...n},disabled:x.draggable}),F=cjt(C,R),z=!!k,D=z&&!m&&YM(f)&&YM(_),V=!b&&j,q=V&&D?A:null,te=D?q??(a??y)({rects:g,activeNodeRect:Q,activeIndex:f,overIndex:_,index:S}):null,H=YM(f)&&YM(_)?i({id:o,items:d,activeIndex:f,overIndex:_}):S,G=k?.id,ie=O.useRef({activeId:G,items:d,newIndex:H,containerId:p}),ne=d!==ie.current.items,pe=t({active:k,containerId:p,isDragging:j,isSorting:z,id:o,index:S,items:d,newIndex:ie.current.newIndex,previousItems:ie.current.items,previousContainerId:ie.current.containerId,transition:l,wasDragging:ie.current.activeId!=null}),Te=UFn({disabled:!pe,index:S,node:w,rect:E});return O.useEffect(()=>{z&&ie.current.newIndex!==H&&(ie.current.newIndex=H),p!==ie.current.containerId&&(ie.current.containerId=p),d!==ie.current.items&&(ie.current.items=d)},[z,H,p,d]),O.useEffect(()=>{if(G===ie.current.activeId)return;if(G!=null&&ie.current.activeId==null){ie.current.activeId=G;return}const be=setTimeout(()=>{ie.current.activeId=G},50);return()=>clearTimeout(be)},[G]),{active:k,activeIndex:f,attributes:$,data:v,rect:E,index:S,newIndex:H,items:d,isOver:P,isSorting:z,isDragging:j,listeners:N,node:w,overIndex:_,over:M,setNodeRef:F,setActivatorNodeRef:U,setDroppableNodeRef:C,setDraggableNodeRef:R,transform:Te??te,transition:_e()};function _e(){if(Te||ne&&ie.current.newIndex===S)return jFn;if(!(V&&!gz(I)||!l)&&(z||pe))return Tm.Transition.toString({...l,property:bnt})}}function zFn(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}}Hr.Down,Hr.Right,Hr.Up,Hr.Left;const xnt="kanban-column-widths:",Snt=180,_Ce=256;function bCe(e){try{const t=localStorage.getItem(xnt+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>=Snt&&(r[s]=i);return r}catch{return{}}}function BFn(e,t){try{localStorage.setItem(xnt+e,JSON.stringify(t))}catch{}}function FFn({storageKey:e,columnIds:t}){const[n,r]=O.useState(()=>bCe(e));O.useEffect(()=>{r(bCe(e))},[e]);const s=O.useRef(null),i=O.useRef(null),o=new Map;for(const d of t)o.set(d,n[d]??_Ce);const a=O.useCallback(d=>{const p=s.current;if(!p)return;const f=d.clientX-p.startX,h=Math.max(Snt,p.startWidth+f);r(m=>({...m,[p.leftId]:h}))},[]),c=O.useCallback(()=>{s.current&&(s.current=null,i.current?.abort(),i.current=null,document.body.style.cursor="",document.body.style.userSelect="",r(p=>(BFn(e,p),p)))},[e]);O.useEffect(()=>()=>{s.current=null,i.current?.abort(),i.current=null,document.body.style.cursor="",document.body.style.userSelect=""},[]);const l=O.useCallback(d=>({onPointerDown:p=>{p.preventDefault();const f=n[d]??_Ce;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 yCe=O.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:st("relative rounded-md",o,!i&&"bg-[var(--color-surface)]"),style:i?{backgroundColor:i}:void 0,children:[n>0&&u.jsx($t,{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:st("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:st("flex max-h-[480px] flex-col gap-1.5 overflow-auto p-2",c),children:p})]})}),YFn=/^agent_teams_ui\s+\[Agent Team:\s*["\u201C]([^"\u201D]+)["\u201D]\s*\|\s*Project:\s*["\u201C]([^"\u201D]+)["\u201D]\s*\|\s*Lead:\s*["\u201C]([^"\u201D]+)["\u201D]\]/,VFn=/^Team Start\s+\[Agent Team:\s*["\u201C]([^"\u201D]+)["\u201D]\s*\|\s*Project:\s*["\u201C]([^"\u201D]+)["\u201D]\s*\|\s*Lead:\s*["\u201C]([^"\u201D]+)["\u201D]\]/,qFn=/^(?:\[Image\s+#\d+\]\s*)+/;function WFn(e){if(!e)return{kind:"regular",displayText:"Untitled"};const t=YFn.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=VFn.exec(n);return r?{kind:"team-resume",displayText:r[1],teamName:r[1],projectName:r[2]}:{kind:"regular",displayText:e.replace(qFn,"").trim()||"Untitled"}}function GFn(e){return WFn(e).displayText}const Wee="__unassigned__",HFn=[{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)"}],ZFn=({filter:e,sessions:t,leadSessionId:n,members:r,onFilterChange:s})=>{const i=O.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(uc,{children:[u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx(Gc,{asChild:!0,children:u.jsxs(Me,{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(T$,{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(it,{side:"bottom",children:"筛选任务"})]}),u.jsxs(Sl,{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=GFn(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(_pt,{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(ai,{checked:e.selectedOwners.has(d.name),onCheckedChange:()=>a(d.name)}),Vc(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(ai,{checked:e.selectedOwners.has(Wee),onCheckedChange:()=>a(Wee)}),"(未分配)"]})]})]}),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:HFn.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(ai,{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(Me,{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:"清空筛选"})})]})]})},KFn=[{field:"updatedAt",label:"最近更新",description:"按最近更新时间排序",icon:u.jsx(_l,{size:14})},{field:"createdAt",label:"创建时间",description:"按最新创建排序",icon:u.jsx(YO,{size:14})},{field:"owner",label:"负责人",description:"按负责人名称排序",icon:u.jsx(_U,{size:14})},{field:"manual",label:"手动排序",description:"按拖拽顺序显示",icon:u.jsx(Jpt,{size:14})}],JFn=({sort:e,onSortChange:t})=>{const n=e.field!=="updatedAt";return u.jsxs(uc,{children:[u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx(Gc,{asChild:!0,children:u.jsxs(Me,{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(zne,{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(it,{side:"bottom",children:"任务排序"})]}),u.jsxs(Sl,{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:KFn.map(r=>{const s=e.field===r.field;return u.jsxs("button",{type:"button",className:st("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:st("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:st("text-[10px]",s?"text-blue-300/70":"text-[var(--color-text-muted)]"),children:r.description})]}),s&&u.jsx(udt,{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(Me,{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:"重置"})})]})]})},xCe={todo:{headerBg:"rgba(59, 130, 246, 0.22)",bodyBg:"rgba(59, 130, 246, 0.05)",icon:u.jsx(GIe,{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(ma,{size:14,className:"shrink-0 text-[var(--color-text-muted)]"})}},eYn=new Set(["auto","scroll","overlay"]),Mw=[{id:"todo",title:"TODO"},{id:"in_progress",title:"IN PROGRESS"},{id:"done",title:"DONE"}];function tYn(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 nYn(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 rYn(e,t,n){return t==="manual"?nYn(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 sYn=({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:Ps(e)}),u.jsx("div",{className:"mt-0.5 line-clamp-2 font-medium text-[var(--color-text)]",children:e.subject})]}),e.owner?u.jsx(Ur,{name:e.owner,color:t.get(e.owner),size:"xs"}):null]})}),iYn=({task:e,columnId:t,memberColorMap:n})=>{const{attributes:r,listeners:s,setNodeRef:i,transform:o,transition:a,isDragging:c}=ynt({id:e.id,data:{type:"kanban-task",columnId:t,taskId:e.id}}),l={transform:Tm.Transform.toString(o),transition:a,opacity:c?.5:1};return u.jsx("div",{ref:i,style:l,...r,...s,children:u.jsx(sYn,{task:e,memberColorMap:n})})},oYn=({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:g,onCancelTask:_,onScrollToTask:b,onTaskClick:y,onViewChanges:x,onColumnOrderChange:S,toolbarLeft:v,onAddTask:T,onDeleteTask:E,deletedTaskCount:w,onOpenTrash:P})=>{const C=O.useRef(null),k=O.useRef([]),[I,Q]=O.useState("columns");O.useEffect(()=>{Q("columns")},[]);const $=I==="columns"&&!!S&&s.field==="manual",R=O.useRef(null),N=O.useMemo(()=>{const _e=e.map(Se=>`${Se.id}\0${Se.displayId??""}\0${Se.subject}\0${Se.status}`),be=R.current;if(be?.signatures.length===_e.length&&be.signatures.every((Se,oe)=>Se===_e[oe]))return be.map;const Ie=new Map(e.map(Se=>[Se.id,Se]));return R.current={signatures:_e,map:Ie},Ie},[e]),j=O.useMemo(()=>Co(a),[a]),M=O.useMemo(()=>{const _e=new Map(Mw.map(({id:be})=>[be,[]]));for(const be of e){const Ie=tYn(be,n);Ie&&_e.get(Ie)?.push(be)}return _e},[e,n]),U=O.useMemo(()=>{const _e=new Map;for(const be of Mw){const Ie=M.get(be.id)??[],Se=n.columnOrder?.[be.id];_e.set(be.id,rYn(Ie,s.field,Se))}return _e},[M,n.columnOrder,s.field]),A=LXe(DXe(Oz,{activationConstraint:{distance:8}})),F=O.useCallback(_e=>{const{active:be,over:Ie}=_e;if(!S||!Ie||be.id===Ie.id)return;const Se=be.data.current;if(Se?.type!=="kanban-task")return;const oe=Se.columnId,Oe=U.get(oe)?.map(se=>se.id)??[],K=Oe.indexOf(be.id),Y=Oe.indexOf(Ie.id);if(K===-1||Y===-1||K===Y)return;const W=Ice(Oe,K,Y);S(oe,W)},[S,U]),z=(_e,be,Ie)=>{if(be.length===0)return u.jsx("div",{className:"rounded-md border border-dashed border-[var(--color-border)] p-3 text-xs text-[var(--color-text-muted)]",children:"No tasks"});if($){const Se=be.map(oe=>oe.id);return u.jsx(_nt,{items:Se,strategy:IFn,children:be.map(oe=>u.jsx(iYn,{task:oe,columnId:_e,memberColorMap:j},oe.id))})}return u.jsx(u.Fragment,{children:be.map(Se=>u.jsx(aKe,{task:Se,teamName:t,columnId:_e,kanbanTaskState:n.tasks[Se.id],hasReviewers:!1,compact:Ie,taskMap:N,memberColorMap:j,onRequestReview:d,onApprove:p,onRequestChanges:f,onMoveBackToDone:h,onStartTask:m,onCompleteTask:g,onCancelTask:_,onScrollToTask:b,onTaskClick:y,onViewChanges:x,onDeleteTask:E},Se.id))})},D=O.useMemo(()=>{if(r.columns.size===0)return Mw;const _e=Mw.filter(be=>r.columns.has(be.id));return _e.length>0?_e:Mw},[r.columns]),V=D[0]?.id??null,q=O.useMemo(()=>D.map(_e=>_e.id),[D]),{widths:ee}=FFn({storageKey:t,columnIds:q}),H=V!=null?ee.get(V)??256:256,G=O.useCallback(()=>{for(const _e of k.current)window.clearTimeout(_e);k.current=[]},[]);O.useEffect(()=>G,[G]);const ie=O.useCallback(_e=>{let be=_e?.parentElement??null;for(;be;){const{overflowY:Ie}=window.getComputedStyle(be);if(eYn.has(Ie))return be;be=be.parentElement}return null},[]),ne=O.useCallback(_e=>{const be=ie(C.current);if(!be)return;const Ie=be.scrollTop;G();const Se=()=>{be.scrollTop=Ie},oe=_e==="grid"?[120,240]:[120];k.current=oe.map(Oe=>window.setTimeout(Se,Oe))},[G,ie]),pe=O.useCallback(_e=>{ne(_e),Q(_e)},[ne,I]),Te=u.jsxs("div",{ref:C,className:"min-w-0 max-w-full overflow-x-hidden",children:[u.jsxs("div",{className:st("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:H},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(ZFn,{filter:r,sessions:i,leadSessionId:o,members:a,onFilterChange:c}),u.jsx("div",{className:"h-4 w-px bg-[var(--color-border)]"}),u.jsx(JFn,{sort:s,onSortChange:l})]}),w!=null&&w>0&&P?u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsxs(Me,{variant:"ghost",size:"sm",className:"h-7 px-2 text-[var(--color-text-muted)]",onClick:P,children:[u.jsx(Ai,{size:14}),u.jsx("span",{className:"ml-1 text-xs",children:w})]})}),u.jsx(it,{side:"bottom",children:"回收站"})]}):null,u.jsxs("div",{className:"inline-flex rounded-md border border-[var(--color-border)]",children:[u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx(Me,{variant:"ghost",size:"sm",className:st("h-7 rounded-r-none px-2",I==="grid"?"bg-[var(--color-surface-raised)] text-[var(--color-text)]":"text-[var(--color-text-muted)]"),onClick:()=>pe("grid"),"aria-label":"网格视图",children:u.jsx(yft,{size:14})})}),u.jsx(it,{side:"bottom",children:"网格视图"})]}),u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx(Me,{variant:"ghost",size:"sm",className:st("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:()=>pe("columns"),"aria-label":"列视图",children:u.jsx(Wv,{size:14})})}),u.jsx(it,{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:D.map(_e=>{const be=U.get(_e.id)??[],Ie=xCe[_e.id];return u.jsx(yCe,{title:_e.title,count:be.length,icon:Ie.icon,headerBg:Ie.headerBg,bodyBg:Ie.bodyBg,bodyClassName:"max-h-none overflow-visible",children:z(_e.id,be)},_e.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 w-full items-start gap-3",children:D.map(_e=>{const be=U.get(_e.id)??[],Ie=xCe[_e.id];return u.jsx("div",{className:"min-w-0 flex-1",children:u.jsx(yCe,{title:_e.title,count:be.length,icon:Ie.icon,headerBg:Ie.headerBg,bodyBg:Ie.bodyBg,bodyClassName:"max-h-none overflow-visible",children:z(_e.id,be,!0)})},_e.id)})})})]});return $?u.jsx(rUe,{sensors:A,onDragEnd:F,children:Te}):Te},aYn=15,lYn=({value:e,onChange:t,tasks:n,members:r})=>{const[s,i]=O.useState(!1),[o,a]=O.useState(0),c=O.useRef(null),l=O.useRef(null),d=O.useRef(null),p=O.useRef(!1),f=O.useMemo(()=>{const b=/#(\S*)$/.exec(e);return b?b[1]:null},[e]),h=f!==null,m=O.useMemo(()=>{if(!h)return[];const b=f.toLowerCase();return n.filter(x=>{const S=r_(x).toLowerCase();return b===""||S.includes(b)}).slice(0,aYn)},[h,f,n]);O.useEffect(()=>{if(p.current){p.current=!1;return}h&&m.length>0?(i(!0),a(0)):i(!1)},[h,m.length]),O.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]),O.useEffect(()=>{if(!s||!d.current)return;d.current.children[o]?.scrollIntoView({block:"nearest"})},[o,s]);const g=O.useCallback(b=>{const y=r_(b),x=e.replace(/#\S*$/,`#${y}`);p.current=!0,t(x),i(!1),l.current?.focus()},[e,t]),_=O.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(),g(m[o])):b.key==="Escape"&&i(!1))},[s,m,o,g]);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(at,{children:[u.jsx(lt,{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(Pr,{size:14})})}),u.jsx(it,{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(ZIe,{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(cYn,{task:b,index:y,members:r,isActive:y===o,onSelect:()=>g(b),onHover:()=>a(y)},b.id))]})]})},cYn=Je.memo(function({task:t,index:n,members:r,isActive:s,onSelect:i,onHover:o}){const a=r_(t),c=gie[t.status]??t.status,l=O.useMemo(()=>{const m=new Map;for(const g of r)g.color&&m.set(g.name,g.color);return m},[r]),d=O.useMemo(()=>{if(!t.createdAt)return null;const m=new Date(t.createdAt);return isNaN(m.getTime())?null:vT(m,{addSuffix:!0})},[t.createdAt]),p=O.useMemo(()=>{if(!t.updatedAt)return null;const m=new Date(t.updatedAt);return isNaN(m.getTime())?null:vT(m,{addSuffix:!0})},[t.updatedAt]),f=O.useMemo(()=>{switch(t.status){case"pending":return"bg-zinc-500/15 text-zinc-400";case"in_progress":return"bg-blue-500/15 text-blue-400";case"completed":return"bg-emerald-500/15 text-emerald-400";case"deleted":return"bg-red-500/15 text-red-400";default:return"bg-zinc-500/15 text-zinc-400"}},[t.status]),h=n%2===1?"var(--card-bg-zebra)":"var(--card-bg)";return u.jsxs("button",{type:"button",className:"flex w-full items-start gap-2 px-3 py-1.5 text-left transition-colors hover:!bg-[var(--color-surface-raised)]",style:{backgroundColor:s?"var(--color-surface-raised)":h},onClick:i,onMouseEnter:o,children:[u.jsxs("div",{className:"flex shrink-0 flex-col items-start gap-0.5",children:[u.jsxs("span",{className:"font-mono text-[11px] font-medium text-[var(--color-text)]",children:["#",a]}),u.jsx("span",{className:`rounded px-1 py-px text-[9px] font-medium ${f}`,children:c})]}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("p",{className:"truncate text-[11px] text-[var(--color-text-secondary)]",children:t.subject}),u.jsxs("div",{className:"mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-0.5",children:[t.createdBy&&u.jsx(Ur,{name:t.createdBy,color:l.get(t.createdBy),size:"xs",hideAvatar:!0}),d&&u.jsxs("span",{className:"text-[9px] text-[var(--color-text-muted)]",children:["创建于 ",d]}),p&&p!==d&&u.jsxs("span",{className:"text-[9px] text-[var(--color-text-muted)]",children:["更新于 ",p]})]})]})]})});function uYn(e,t){const[n,r]=O.useState(null),[s,i]=O.useState(t!==null),[o,a]=O.useState(null);return O.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 Z.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 dYn(e,t){if(t)return e==="codex"&&t==="Codex native"?"Codex":t}function SCe(e){return e?e.launchState==="starting"||e.launchState==="runtime_pending_bootstrap"||e.launchState==="runtime_pending_permission"||e.status==="waiting"||e.status==="spawning":!1}function vnt(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 Tnt(e,t,n,r){const s=e.providerBackendId,i=e.model?.trim()||"",o=n?.runtimeModel?.trim()||r?.runtimeModel?.trim(),a=CO(i)??CO(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=dYn(c,p4n(c,h)),g=typeof r?.rssBytes=="number"&&r.rssBytes>0?` · ${T2(r.rssBytes)}`:"";if(o&&(SCe(n)||p.length===0)){const b=CO(o)??c;return`${ib(b,o,f)}${m?` · ${m}`:""}${g}`}return SCe(n)?!p.length&&!g?void 0:`${ib(c,p,f)}${m?` · ${m}`:""}${g}`:`${ib(c,p,f)}${m?` · ${m}`:""}${g}`}function Gee(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 BN(f)?n&&VMn(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=X2(p).toLowerCase(),h=HZe(p).toLowerCase(),m=(p.from??"").toLowerCase(),g=(p.to??"").toLowerCase();return f.includes(l)||h.includes(l)||m.includes(l)||g.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 Ent({teamName:e,memberName:t,members:n,tasks:r,messages:s}){const i=Gee(s,{timeWindow:null,filter:{from:new Set,to:new Set,showNoise:!0},searchQuery:""}),o=`lead:${e}`,a=n.find(p=>Jn(p))?.name??`${e}-lead`,c=t===a?o:`member:${e}:${t}`;return Nle({data:{members:n,tasks:r,messages:i},teamName:e,leadId:o,leadName:a,ownerNodeIds:new Set([o,c])}).get(c)??[]}const pYn=({currentRole:e,onSave:t,onCancel:n,saving:r})=>{const s=e&&mie.includes(e),[i,o]=O.useState(e?s?e:_f:ET),[a,c]=O.useState(s?"":e??""),[l,d]=O.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(ZZ.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(KBn,{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=>ZZ.has(h.trim().toLowerCase())?"This role is reserved":null}),u.jsx(Me,{variant:"ghost",size:"icon",className:"size-6",onClick:f,disabled:r,children:r?u.jsx(zt,{size:12,className:"animate-spin"}):u.jsx(qr,{size:12})}),u.jsx(Me,{variant:"ghost",size:"icon",className:"size-6",onClick:n,disabled:r,children:u.jsx(Pr,{size:12})})]})},fYn=({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]=O.useState(!1),g=re($=>$.selectedTeamName),_=re($=>g?kl($,g):[]),b=O.useMemo(()=>jf(_),[_]),y=Wr(e.color??""),x=e.role||mi(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,C=S.runtimeAdvisoryTitle,k=S.runtimeAdvisoryTone,I=k==="error"&&P?P:T==="runtime_pending"||T==="permission_pending"||T==="shell_only"||T==="runtime_candidate"||T==="registered_only"||T==="stale_runtime"?E??v:v,Q=!Jn(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)??fo(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(ns,{className:"truncate",style:{color:y.text},children:Vc(e.name)}),u.jsx(oi,{asChild:!0,className:"mt-1 flex items-center gap-2",children:u.jsxs("div",{children:[h?u.jsx(pYn,{currentRole:e.role,saving:f,onSave:async $=>{try{await p?.($),m(!1)}catch{}},onCancel:()=>m(!1)}):u.jsxs(u.Fragment,{children:[u.jsx("span",{children:x||"无角色"}),Q&&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(Db,{size:12})})]}),!h&&u.jsx(u.Fragment,{children:u.jsx($t,{variant:"secondary",className:`px-1.5 py-0.5 text-[10px] font-normal leading-none ${k==="error"?"bg-red-500/15 text-red-300":"text-[var(--color-text-muted)]"}`,title:C,children:I})}),!h&&t?u.jsx("div",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:t}):null]})})]})]})},vCe="rounded-md border border-[var(--color-border)] bg-[var(--color-surface-raised)] px-2.5 py-1.5",hYn="cursor-pointer transition-colors hover:border-[var(--color-border-emphasis)] hover:bg-[var(--color-surface-overlay)]",TCe=({label:e,value:t,sub:n,onClick:r})=>{const s=r?`${vCe} ${hYn}`:vCe,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})},mYn=({totalTasks:e,inProgressTasks:t,totalTokens:n,statsLoading:r,statsComputedAt:s,onTabChange:i})=>{const o=r?"...":n!=null?Cn(n):"—",a=!r&&s?`updated ${E3(s)}`:void 0;return u.jsxs("div",{className:"grid min-w-0 flex-1 grid-cols-2 gap-1.5",children:[u.jsx(TCe,{label:"Tasks",value:e,sub:t>0?`进行中: ${t}`:void 0,onClick:i?()=>i("tasks"):void 0}),u.jsx(TCe,{label:"Tokens",value:o,sub:a,onClick:i?()=>i("stats"):void 0})]})},gYn=100,OYn=[{value:"all",label:"All"},{value:"messages",label:"Messages"},{value:"comments",label:"Comments"}],_Yn=({teamName:e,memberName:t,members:n,tasks:r,initialFilter:s="all",onCreateTask:i,onTaskClick:o})=>{const[a,c]=O.useState(s),[l,d]=O.useState(null),{messages:p,messagesState:f,loadOlderTeamMessages:h}=re(vt($=>({messages:PXe($,e,t),messagesState:e?$.teamMessagesByName[e]:void 0,loadOlderTeamMessages:$.loadOlderTeamMessages}))),{readSet:m}=Zle(e),g=O.useMemo(()=>new Map(r.map($=>[$.id,$])),[r]),_=O.useMemo(()=>YN(n),[n]);O.useEffect(()=>{c(s)},[s,t,e]);const b=O.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=O.useMemo(()=>Ent({teamName:e,memberName:t,members:n,tasks:r,messages:p}),[t,n,p,r,e]),T=O.useMemo(()=>v.slice(0,gYn),[v]),E=O.useMemo(()=>{switch(a){case"messages":return T.filter($=>$.message.messageKind!=="task_comment_notification");case"comments":return T.filter($=>$.message.messageKind==="task_comment_notification");default:return T}},[a,T]),w=O.useMemo(()=>{const $=new Map;for(const R of E)$.set(Ls(R.message),{type:"message",message:R.message});return $},[E]),P=O.useCallback($=>{const R=w.get($);R&&d(R)},[w]),C=O.useCallback($=>{const R=g.get($)??r.find(N=>N.displayId===$);R&&o?.(R)},[o,g,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",Q=S&&a!=="comments";return u.jsxs("div",{className:"space-y-3",children:[u.jsx("div",{className:"flex flex-wrap items-center gap-2",children:OYn.map($=>{const R=a===$.value;return u.jsx("button",{type:"button",className:["rounded-full border px-3 py-1 text-xs font-medium transition-colors",R?"border-[var(--color-border-emphasis)] bg-[var(--color-surface-overlay)] text-[var(--color-text)]":"border-[var(--color-border)] bg-[var(--color-surface-raised)] text-[var(--color-text-muted)] hover:text-[var(--color-text)]"].join(" "),onClick:()=>c($.value),children:$.label},$.value)})}),u.jsxs("div",{className:"max-h-[320px] space-y-2 overflow-y-auto",children:[E.length>0?E.map(($,R)=>{const N=Ls($.message),j=dB($.message,_),M={type:"message",message:$.message},U=!$.message.read&&!m.has(N);return u.jsx("div",{className:"cursor-pointer",role:"button",tabIndex:0,onClick:()=>d(M),onKeyDown:A=>{(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),d(M))},children:u.jsx(WN,{message:$.message,teamName:e,compactHeader:!0,collapseMode:"managed",isCollapsed:!0,canToggleCollapse:!1,isUnread:U,expandItemKey:N,onExpand:P,onCreateTask:i,onTaskIdClick:C,memberRole:j.memberRole,memberColor:j.memberColor,recipientColor:j.recipientColor,memberColorMap:_.colorMap,localMemberNames:_.localMemberNames,zebraShade:R%2===1})},$.graphItem.id)}):u.jsx("div",{className:"rounded-md border border-[var(--color-border)] px-4 py-6 text-center text-sm text-[var(--color-text-muted)]",children:I}),Q&&u.jsx("div",{className:"flex justify-center pt-2",children:u.jsx(Me,{variant:"ghost",size:"sm",className:"text-xs","aria-busy":x,disabled:x,onClick:()=>void b(),children:"Load older messages"})})]}),u.jsx(qC,{expandedItem:l,open:l!==null,onOpenChange:$=>{$||d(null)},teamName:e,members:n,onTaskIdClick:C,onCreateTaskFromMessage:i})]})},bYn=({teamName:e,memberName:t,prefetchedStats:n,prefetchedLoading:r,prefetchedError:s,onFileClick:i,onShowAllFiles:o})=>{const a=n!==void 0,[c,l]=O.useState(null),[d,p]=O.useState(!a),[f,h]=O.useState(null);O.useEffect(()=>{if(a)return;let x=!1;return p(!0),h(null),(async()=>{try{const S=await Z.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,g=a?r??!1:d,_=a?s??null:f;if(g)return u.jsxs("div",{className:"flex items-center justify-center gap-2 py-8 text-xs text-[var(--color-text-muted)]",children:[u.jsx(zt,{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(Zi,{size:14}),_]});if(!m)return u.jsxs("div",{className:"py-8 text-center text-xs text-[var(--color-text-muted)]",children:[u.jsx(bR,{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(yYn,{stats:m,totalTokens:b,totalToolCalls:y}),u.jsx(xYn,{toolUsage:m.toolUsage}),u.jsx(TYn,{files:m.filesTouched,fileStats:m.fileStats,onFileClick:i,onShowAll:o}),u.jsx(EYn,{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(Gs,{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})]}),yYn=({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:Cn(t)})]}),xYn=({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))})]})},SYn=";.,";function vYn(e){let t=e.trim(),n=t.length;for(;n>0&&SYn.includes(t[n-1]);)n--;return t=t.slice(0,n),!t||t==="null"||t==="undefined"||t==="None"}const TYn=({files:e,fileStats:t,onFileClick:n,onShowAll:r})=>{const[s,i]=O.useState(!1),o=e.filter(d=>!vYn(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=hf(d)||d,f=t?.[d];return u.jsxs("button",{type:"button",className:st("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(Dr,{size:10}):u.jsx(Bn,{size:10}),s?"Show less":`+${c} more`]})]})},EYn=({stats:e})=>{const t=E3(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]})},wYn=({teamName:e,memberName:t,onFileClick:n,onViewAllChanges:r})=>{const[s,i]=O.useState(null),[o,a]=O.useState(!0),[c,l]=O.useState(null);if(O.useEffect(()=>{let f=!1;return a(!0),l(null),(async()=>{try{const h=await Z.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(zt,{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(Zi,{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(Fc,{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=hf(f.filePath)||f.filePath,m=!!n;return u.jsxs("button",{type:"button",className:st("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)})})]})},kYn=({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:g,onSendMessage:_,onRemoveMember:b,onRestartMember:y,onUpdateRole:x,updatingRole:S,onViewMemberChanges:v})=>{const T=re(D=>PXe(D,n,t?.name??null)),E=O.useMemo(()=>t?Ent({teamName:n,memberName:t.name,members:r,tasks:s,messages:T}).length:0,[t,T,r,s,n]),[w,P]=O.useState(i==="tasks"?"workspace":i),[C,k]=O.useState(!1),[I,Q]=O.useState(null),$=O.useMemo(()=>t?Tnt(t,m,p,f):void 0,[m,t,f,p]),R=vnt(f);p?.launchState==="starting"||p?.launchState==="runtime_pending_bootstrap"||p?.launchState;const N=O.useMemo(()=>t?Oie({teamName:n,runId:h,memberName:t.name,spawnEntry:p,runtimeEntry:f}):null,[t,f,h,p,n]),j=N!=null&&Nz(N)&&_ie(N),M=N?mze(N):void 0;O.useEffect(()=>{!e||!t||(P(i),Q(null),k(!1))},[i,t,e]);const{stats:U,loading:A,error:F}=uYn(n,t?.name??null),z=U?U.inputTokens+U.outputTokens:null;return t?u.jsx(us,{open:e,onOpenChange:D=>!D&&g(),children:u.jsxs(ts,{className:"min-w-0 sm:max-w-4xl",children:[u.jsxs("div",{className:"flex items-start gap-4",children:[u.jsx(ds,{className:"shrink-0",children:u.jsx(fYn,{member:t,runtimeSummary:$,isTeamAlive:a,isTeamProvisioning:c,leadActivity:Jn(t)?d:void 0,spawnStatus:p?.status,spawnLaunchState:p?.launchState,spawnLivenessSource:p?.livenessSource,spawnRuntimeAlive:p?.runtimeAlive,runtimeEntry:f,isLaunchSettling:l,onUpdateRole:x?D=>x(t.name,D):void 0,updatingRole:S})}),u.jsx(mYn,{totalTasks:0,inProgressTasks:0,totalTokens:z,statsLoading:A,statsComputedAt:U?.computedAt,onTabChange:P})]}),u.jsxs(T3,{value:w,onValueChange:D=>P(D),className:"min-w-0 overflow-hidden",children:[u.jsxs(kN,{className:"w-full",children:[u.jsxs(rm,{value:"workspace",className:"flex-1 gap-1.5",children:[u.jsx(Fc,{size:12}),"Workspace"]}),u.jsxs(rm,{value:"activity",className:"flex-1 gap-1.5",children:["Activity",E>0&&u.jsx("span",{className:"rounded-full bg-[var(--color-surface)] px-1.5 text-[10px]",children:E})]}),u.jsxs(rm,{value:"stats",className:"flex-1 gap-1.5",children:[u.jsx(bR,{size:12}),"Stats"]})]}),u.jsx(Ld,{value:"workspace",children:u.jsx(wYn,{teamName:n,memberName:t.name,onFileClick:D=>v?.(t.name,D),onViewAllChanges:()=>v?.(t.name)})}),u.jsx(Ld,{value:"activity",children:u.jsx(_Yn,{teamName:n,memberName:t.name,members:r,tasks:s,initialFilter:o})}),u.jsx(Ld,{value:"stats",children:u.jsx(bYn,{teamName:n,memberName:t.name,prefetchedStats:U,prefetchedLoading:A,prefetchedError:F,onFileClick:D=>v?.(t.name,D),onShowAllFiles:()=>v?.(t.name)})})]}),u.jsx(ed,{children:I?u.jsx("div",{className:"text-xs text-red-400",children:I}):M?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:M,children:M}),N&&j?u.jsx(xie,{payload:N,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,R?` · ${R}`:""]}):null})]})}):null},ECe=1e3;function CYn(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function RYn(e,t=ECe){return O.useMemo(()=>{if(!e)return;const n=Number.isFinite(t)&&t>0?t:ECe;return{animationDelay:`${-(CYn()%n)}ms`,animationDuration:`${n}ms`}},[t,e])}const PYn=2e3,$Yn=({className:e,label:t})=>{const n=e?.includes("animate-pulse")===!0,r=RYn(n,PYn);return u.jsx("span",{className:st("absolute -bottom-0.5 -right-0.5 rounded-full border-2 border-[var(--color-surface)]",e),style:r,"aria-label":t})};function NYn(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 AYn=({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:g,spawnLivenessSource:_,spawnLaunchState:b,spawnRuntimeAlive:y,isLaunchSettling:x,onOpenTask:S,onOpenReviewTask:v,onClick:T,onSendMessage:E,onAssignTask:w,onRestartMember:P,onSkipMemberForLaunch:C})=>{const k=re(xe=>xe.selectedTeamName),[I,Q]=O.useState(!1),[$,R]=O.useState(null),[N,j]=O.useState(!1),[M,U]=O.useState(null),A=re(xe=>k?kl(xe,k):[]),F=O.useMemo(()=>jf(A),[A]),z=wT({member:e,spawnStatus:h,spawnLaunchState:b,spawnLivenessSource:_,spawnRuntimeAlive:y,runtimeEntry:r,runtimeAdvisory:e.runtimeAdvisory,isLaunchSettling:x,isTeamAlive:o,isTeamProvisioning:a,leadActivity:c}),D=z.dotClass,V=z.runtimeAdvisoryLabel,q=z.runtimeAdvisoryTitle,ee=z.runtimeAdvisoryTone,te=z.presenceLabel,H=z.cardClass,G=z.launchVisualState,ie=z.launchStatusLabel,ne=G==="runtime_pending"||G==="permission_pending"||G==="shell_only"||G==="runtime_candidate"||G==="registered_only"||G==="stale_runtime"?ie??te:te,pe=Wr(t),{isLight:Te}=Js(),_e=i?.pending??0,be=i?.inProgress??0,Ie=i?.completed??0,Se=_e+be+Ie,oe=Se>0?Math.round(Ie/Se*100):0,Oe=mi(e.role)??mi(e.agentType),{summary:K,memory:Y}=NYn(n),W=vnt(r),se=Jn(e),he=e.cwd?.trim(),we=!se&&!f&&e.isolation==="worktree",J=he?`Worktree isolation configured. Worktree path: ${he}`:"Worktree isolation is configured, but the runtime path is not available yet",de=l??d??null,ue=l?`Current task: #${Ui(l.id)}`:d?`Reviewing task: #${Ui(d.id)}`:void 0,ae=!f&&te==="starting"&&b!=="failed_to_start"&&!de&&!n,$e=!f&&!de&&!V&&(te==="starting"||te==="connecting"||G==="runtime_pending"||G==="shell_only"||G==="runtime_candidate"||G==="registered_only"||G==="stale_runtime"),qe=te==="starting"?te:ne,ot=O.useMemo(()=>Oie({teamName:k,runId:s,memberName:e.name,spawnStatus:h,launchState:b,livenessSource:_,spawnEntry:m,runtimeEntry:r}),[e.name,r,s,k,m,b,_,h]),Ot=!f&&Nz(ot)&&_ie(ot),nt=h==="error"||b==="failed_to_start",Ge=h==="skipped"||b==="skipped_for_launch"||m?.skippedForLaunch===!0,St=!f&&nt,Qt=!f&&Ge,ft=o===!0||a===!0||x===!0,tn=(St||Qt)&&!Jn(e)&&!!P&&ft,jt=St&&!Jn(e)&&!!C&&ft,On=!f&&!!V&&!$e&&!nt&&!Ge&&(!!de||!p),Lt=async xe=>{if(xe.preventDefault(),xe.stopPropagation(),!(!P||I)){R(null),Q(!0);try{await P(e.name)}catch(Fe){R(Fe instanceof Error?Fe.message:"重试启动成员失败")}finally{Q(!1)}}},fn=async xe=>{if(xe.preventDefault(),xe.stopPropagation(),!(!C||N)){U(null),j(!0);try{await C(e.name)}catch(Fe){U(Fe instanceof Error?Fe.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:ue,role:"button",tabIndex:0,onClick:T,onKeyDown:xe=>{(xe.key==="Enter"||xe.key===" ")&&(xe.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:pe.border,boxShadow:Te?"none":`0 0 0 1px ${pe.badge}`},children:u.jsx("img",{src:F.get(e.name)??fo(e.name),alt:e.name,className:"size-7 rounded-full bg-[var(--color-surface-raised)]",loading:"lazy"})}),u.jsx($Yn,{className:`size-2.5 ${D}`,label:ne})]}),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:Vc(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(E$,{size:10}),e.gitBranch]}):null,we?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:J,children:"worktree"}):null,l?u.jsx(r5,{task:l,borderColor:pe.border,activityLabel:"working on",onOpenTask:S}):null,d?u.jsx(r5,{task:d,borderColor:pe.border,activityLabel:"reviewing",onOpenTask:v}):null,!de&&p?u.jsxs(u.Fragment,{children:[ee==="error"?u.jsx(zn,{className:"size-3 shrink-0 text-red-400"}):u.jsx(zt,{className:`size-3 shrink-0 animate-spin ${V?"text-amber-400":""}`,style:V?void 0:{color:pe.border}}),u.jsx("span",{className:`shrink-0 text-[10px] ${ee==="error"?"text-red-300":V?"text-amber-300":"text-[var(--color-text-muted)]"}`,title:q??"Message sent, awaiting reply",children:V??"awaiting reply"})]}):null]}),ae?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)"}})]}):K||Oe||Y?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:[K?u.jsx("span",{className:"min-w-0 truncate",children:K}):null,K&&Oe?u.jsx("span",{className:"shrink-0 opacity-60",children:"•"}):null,Oe?u.jsx("span",{className:"shrink-0",children:Oe}):null,(K||Oe)&&Y?u.jsx("span",{className:"shrink-0 opacity-60",children:"•"}):null,Y?u.jsx("span",{className:"shrink-0",title:W,children:Y}):null]}):null]}),$e?u.jsxs("span",{className:"flex shrink-0 items-center gap-1",title:r?.runtimeDiagnostic,children:[u.jsx(zt,{className:"size-3.5 shrink-0 animate-spin text-[var(--color-text-muted)]","aria-label":qe}),u.jsx($t,{variant:"secondary",className:"shrink-0 px-1.5 py-0.5 text-[10px] font-normal leading-none text-[var(--color-text-muted)]",children:qe})]}):St?u.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[u.jsx(zn,{className:"size-3.5 shrink-0 text-red-400"}),u.jsx($t,{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:ne})]})}),u.jsx(it,{side:"bottom",children:g??"Spawn failed"})]}),Ot?u.jsx(xie,{payload:ot,className:"size-auto rounded p-1 text-red-300 transition-colors hover:bg-red-500/10 hover:text-red-200"}):null,jt?u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx("button",{type:"button","aria-label":N?"正在跳过成员":"本次启动跳过",className:"rounded p-1 text-red-300 transition-colors hover:bg-red-500/10 hover:text-red-200 disabled:cursor-not-allowed disabled:opacity-60",disabled:N||I,onClick:fn,children:N?u.jsx(zt,{className:"size-3.5 animate-spin"}):u.jsx(UD,{className:"size-3.5"})})}),u.jsx(it,{side:"bottom",children:M??(N?"正在跳过成员...":"本次启动跳过")})]}):null,tn?u.jsxs(at,{children:[u.jsx(lt,{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||N,onClick:Lt,children:I?u.jsx(zt,{className:"size-3.5 animate-spin"}):u.jsx(VO,{className:"size-3.5"})})}),u.jsx(it,{side:"bottom",children:$??(I?"正在重试成员...":"重试成员")})]}):null]}):Qt?u.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[u.jsx(UD,{className:"size-3.5 shrink-0 text-zinc-400"}),u.jsx($t,{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:ne})]})}),u.jsx(it,{side:"bottom",children:m?.skipReason??"本次启动已跳过"})]}),tn?u.jsxs(at,{children:[u.jsx(lt,{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:Lt,children:I?u.jsx(zt,{className:"size-3.5 animate-spin"}):u.jsx(VO,{className:"size-3.5"})})}),u.jsx(it,{side:"bottom",children:$??(I?"正在重试成员...":"重试成员")})]}):null]}):On?u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[u.jsx(zn,{className:`size-3.5 shrink-0 ${ee==="error"?"text-red-400":"text-amber-400"}`}),u.jsx($t,{variant:"secondary",className:`shrink-0 px-1.5 py-0.5 text-[10px] font-normal leading-none ${ee==="error"?"bg-red-500/15 text-red-300":"bg-amber-500/15 text-amber-300"}`,title:q,children:V})]})}),u.jsx(it,{side:"bottom",children:q??V})]}):de?null:u.jsx($t,{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?"该成员已被移除":ue,children:f?"已移除":ne}),ae?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:Se>0?`${Ie}/${Se} completed`:void 0,children:[u.jsxs($t,{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"]}),Se>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:`${oe}%`}})})]}),!f&&u.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[u.jsxs(at,{children:[u.jsx(lt,{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:xe=>{xe.stopPropagation(),E?.()},children:u.jsx(mo,{size:13})})}),u.jsx(it,{side:"bottom",children:"发送消息"})]}),u.jsxs(at,{children:[u.jsx(lt,{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:xe=>{xe.stopPropagation(),w?.()},children:u.jsx(oc,{size:13})})}),u.jsx(it,{side:"bottom",children:"分配任务"})]})]})]})]})})};function IYn(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 MYn(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 QYn(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 DYn(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 LYn(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 jYn(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 XYn(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 UYn(e,t){return IYn(e.members,t.members)&&MYn(e.memberTaskCounts,t.memberTaskCounts)&&QYn(e.taskMap,t.taskMap)&&DYn(e.pendingRepliesByMember,t.pendingRepliesByMember)&&LYn(e.memberSpawnStatuses,t.memberSpawnStatuses)&&XYn(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&&jYn(e.launchParams,t.launchParams)}const zYn=O.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:g,onOpenTask:_,onRestartMember:b,onSkipMemberForLaunch:y}){const x=O.useRef(null),[S,v]=O.useState(!1),T=O.useCallback($=>{const R=$[0];R&&v(R.contentRect.width>1e3)},[]);O.useEffect(()=>{const $=x.current;if(!$)return;const R=new ResizeObserver(T);return R.observe($),()=>R.disconnect()},[T]);const E=S?"grid grid-cols-2 gap-1":"grid grid-cols-1 gap-1",w=O.useMemo(()=>t.filter($=>!$.removedAt).sort(($,R)=>Jn($)?-1:Jn(R)?1:0),[t]),P=O.useMemo(()=>t.filter($=>$.removedAt),[t]),C=O.useMemo(()=>Co(t),[t]),k=O.useCallback(($,R,N)=>Tnt($,f,R,N),[f]);if(t.length===0)return u.jsx("div",{className:"rounded-md border border-[var(--color-border)] p-4 text-sm text-[var(--color-text-muted)]",children:"Solo team — lead only"});const I=O.useMemo(()=>{const $=new Map;if(!r)return $;for(const R of r.values())R.reviewer&&(R.reviewState==="review"||R.kanbanColumn==="review")&&$.set(R.reviewer,R);return $},[r]),Q=($,R)=>{const N=$.currentTaskId&&r?r.get($.currentTaskId)??null:null,j=I.get($.name)??null,M=j&&j.id!==$.currentTaskId?j:null,U=l!==!1&&!!s?.[$.name],A=i?.get($.name),F=o?.get($.name);return u.jsx(AYn,{member:$,memberColor:C.get($.name)??"blue",taskCounts:n?.get($.name.toLowerCase()),isTeamAlive:l,isTeamProvisioning:d,leadActivity:Jn($)?p:void 0,currentTask:R?null:N,reviewTask:R?null:M,isAwaitingReply:R?!1:U,isRemoved:R,runtimeSummary:k($,R?void 0:A,R?void 0:F),runtimeEntry:R?void 0:F,runtimeRunId:R?void 0:a,spawnStatus:R?void 0:A?.status,spawnEntry:R?void 0:A,spawnError:R?void 0:A?.error??A?.hardFailureReason,spawnLivenessSource:R?void 0:A?.livenessSource,spawnLaunchState:R?void 0:A?.launchState,spawnRuntimeAlive:R?void 0:A?.runtimeAlive,isLaunchSettling:R?!1:c,onOpenTask:!R&&N?()=>_?.(N.id):void 0,onOpenReviewTask:!R&&M?()=>_?.(M.id):void 0,onClick:()=>h?.($),onSendMessage:()=>m?.($),onAssignTask:()=>g?.($),onRestartMember:R?void 0:b,onSkipMemberForLaunch:R?void 0:y},$.name)};return u.jsxs("div",{ref:x,className:"flex flex-col gap-1",children:[u.jsx("div",{className:E,children:w.map($=>Q($,!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($=>Q($,!0))})]})]})},UYn),wnt=O.createContext({});function Mce(e){const t=O.useRef(null);return t.current===null&&(t.current=e()),t.current}const BYn=typeof window<"u",knt=BYn?O.useLayoutEffect:O.useEffect,Qce=O.createContext(null);function Dce(e,t){e.indexOf(t)===-1&&e.push(t)}function nE(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Nf=(e,t,n)=>n>t?t:n<e?e:n;let Lce=()=>{};const f_={},Cnt=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Rnt(e){return typeof e=="object"&&e!==null}const Pnt=e=>/^0[^.\s]+$/u.test(e);function $nt(e){let t;return()=>(t===void 0&&(t=e()),t)}const qu=e=>e,FYn=(e,t)=>n=>t(e(n)),sA=(...e)=>e.reduce(FYn),rE=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class jce{constructor(){this.subscriptions=[]}add(t){return Dce(this.subscriptions,t),()=>nE(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 sc=e=>e*1e3,Qu=e=>e/1e3;function Nnt(e,t){return t?e*(1e3/t):0}const YYn=(e,t,n)=>{const r=t-e;return((n-e)%r+r)%r+e},Ant=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,VYn=1e-7,qYn=12;function WYn(e,t,n,r,s){let i,o,a=0;do o=t+(n-t)/2,i=Ant(o,r,s)-e,i>0?n=o:t=o;while(Math.abs(i)>VYn&&++a<qYn);return o}function iA(e,t,n,r){if(e===t&&n===r)return qu;const s=i=>WYn(i,0,1,e,n);return i=>i===0||i===1?i:Ant(s(i),t,r)}const Int=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Mnt=e=>t=>1-e(1-t),Qnt=iA(.33,1.53,.69,.99),Xce=Mnt(Qnt),Dnt=Int(Xce),Lnt=e=>e>=1?1:(e*=2)<1?.5*Xce(e):.5*(2-Math.pow(2,-10*(e-1))),Uce=e=>1-Math.sin(Math.acos(e)),jnt=Mnt(Uce),Xnt=Int(Uce),GYn=iA(.42,0,1,1),HYn=iA(0,0,.58,1),Unt=iA(.42,0,.58,1),znt=e=>Array.isArray(e)&&typeof e[0]!="number";function Bnt(e,t){return znt(e)?e[YYn(0,e.length,t)]:e}const Fnt=e=>Array.isArray(e)&&typeof e[0]=="number",ZYn={linear:qu,easeIn:GYn,easeInOut:Unt,easeOut:HYn,circIn:Uce,circInOut:Xnt,circOut:jnt,backIn:Xce,backInOut:Dnt,backOut:Qnt,anticipate:Lnt},KYn=e=>typeof e=="string",wCe=e=>{if(Fnt(e)){Lce(e.length===4);const[t,n,r,s]=e;return iA(t,n,r,s)}else if(KYn(e))return ZYn[e];return e},GM=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function JYn(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 eVn=40;function Ynt(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]=JYn(i),x),{}),{setup:a,read:c,resolveKeyframes:l,preUpdate:d,update:p,preRender:f,render:h,postRender:m}=o,g=()=>{const x=f_.useManualTiming,S=x?s.timestamp:performance.now();n=!1,x||(s.delta=r?1e3/60:Math.max(Math.min(S-s.timestamp,eVn),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(g))},_=()=>{n=!0,r=!0,s.isProcessing||e(g)};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:Es,cancel:Nm,state:ta,steps:W8}=Ynt(typeof requestAnimationFrame<"u"?requestAnimationFrame:qu,!0);let H2;function tVn(){H2=void 0}const hl={now:()=>(H2===void 0&&hl.set(ta.isProcessing||f_.useManualTiming?ta.timestamp:performance.now()),H2),set:e=>{H2=e,queueMicrotask(tVn)}},Vnt=e=>t=>typeof t=="string"&&t.startsWith(e),qnt=Vnt("--"),nVn=Vnt("var(--"),zce=e=>nVn(e)?rVn.test(e.split("/*")[0].trim()):!1,rVn=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function kCe(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const u1={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},n$={...u1,transform:e=>Nf(0,1,e)},HM={...u1,default:1},HC=e=>Math.round(e*1e5)/1e5,Bce=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function sVn(e){return e==null}const iVn=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Fce=(e,t)=>n=>!!(typeof n=="string"&&iVn.test(n)&&n.startsWith(e)||t&&!sVn(n)&&Object.prototype.hasOwnProperty.call(n,t)),Wnt=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,a]=r.match(Bce);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},oVn=e=>Nf(0,255,e),G8={...u1,transform:e=>Math.round(oVn(e))},ob={test:Fce("rgb","red"),parse:Wnt("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+G8.transform(e)+", "+G8.transform(t)+", "+G8.transform(n)+", "+HC(n$.transform(r))+")"};function aVn(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 Hee={test:Fce("#"),parse:aVn,transform:ob.transform},oA=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),wg=oA("deg"),vf=oA("%"),sn=oA("px"),lVn=oA("vh"),cVn=oA("vw"),CCe={...vf,parse:e=>vf.parse(e)/100,transform:e=>vf.transform(e*100)},VS={test:Fce("hsl","hue"),parse:Wnt("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+vf.transform(HC(t))+", "+vf.transform(HC(n))+", "+HC(n$.transform(r))+")"},Li={test:e=>ob.test(e)||Hee.test(e)||VS.test(e),parse:e=>ob.test(e)?ob.parse(e):VS.test(e)?VS.parse(e):Hee.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ob.transform(e):VS.transform(e),getAnimatableNone:e=>{const t=Li.parse(e);return t.alpha=0,Li.transform(t)}},uVn=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function dVn(e){return isNaN(e)&&typeof e=="string"&&(e.match(Bce)?.length||0)+(e.match(uVn)?.length||0)>0}const Gnt="number",Hnt="color",pVn="var",fVn="var(",RCe="${}",hVn=/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 sE(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const a=t.replace(hVn,c=>(Li.test(c)?(r.color.push(i),s.push(Hnt),n.push(Li.parse(c))):c.startsWith(fVn)?(r.var.push(i),s.push(pVn),n.push(c)):(r.number.push(i),s.push(Gnt),n.push(parseFloat(c))),++i,RCe)).split(RCe);return{values:n,split:a,indexes:r,types:s}}function mVn(e){return sE(e).values}function Znt({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===Gnt?s+=HC(r[i]):o===Hnt?s+=Li.transform(r[i]):s+=r[i]}return s}}function gVn(e){return Znt(sE(e))}const OVn=e=>typeof e=="number"?0:Li.test(e)?Li.getAnimatableNone(e):e,_Vn=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:OVn(e);function bVn(e){const t=sE(e);return Znt(t)(t.values.map((r,s)=>_Vn(r,t.split[s])))}const Gd={test:dVn,parse:mVn,createTransformer:gVn,getAnimatableNone:bVn};function H8(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 yVn({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=H8(c,a,e+1/3),i=H8(c,a,e),o=H8(c,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function vX(e,t){return n=>n>0?t:e}const js=(e,t,n)=>e+(t-e)*n,Z8=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},xVn=[Hee,ob,VS],SVn=e=>xVn.find(t=>t.test(e));function PCe(e){const t=SVn(e);if(!t)return!1;let n=t.parse(e);return t===VS&&(n=yVn(n)),n}const $Ce=(e,t)=>{const n=PCe(e),r=PCe(t);if(!n||!r)return vX(e,t);const s={...n};return i=>(s.red=Z8(n.red,r.red,i),s.green=Z8(n.green,r.green,i),s.blue=Z8(n.blue,r.blue,i),s.alpha=js(n.alpha,r.alpha,i),ob.transform(s))},Zee=new Set(["none","hidden"]);function vVn(e,t){return Zee.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function TVn(e,t){return n=>js(e,t,n)}function Yce(e){return typeof e=="number"?TVn:typeof e=="string"?zce(e)?vX:Li.test(e)?$Ce:kVn:Array.isArray(e)?Knt:typeof e=="object"?Li.test(e)?$Ce:EVn:vX}function Knt(e,t){const n=[...e],r=n.length,s=e.map((i,o)=>Yce(i)(i,t[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function EVn(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Yce(e[s])(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function wVn(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 kVn=(e,t)=>{const n=Gd.createTransformer(t),r=sE(e),s=sE(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?Zee.has(e)&&!s.values.length||Zee.has(t)&&!r.values.length?vVn(e,t):sA(Knt(wVn(r,s),s.values),n):vX(e,t)};function Jnt(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?js(e,t,n):Yce(e)(e,t)}const CVn=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Es.update(t,n),stop:()=>Nm(t),now:()=>ta.isProcessing?ta.timestamp:hl.now()}},ert=(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)})`},TX=2e4;function Vce(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<TX;)t+=n,r=e.next(t);return t>=TX?1/0:t}function trt(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(Vce(r),TX);return{type:"keyframes",ease:i=>r.next(s*i).value/t,duration:Qu(s)}}const xi={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 Kee(e,t){return e*Math.sqrt(1-t*t)}const RVn=12;function PVn(e,t,n){let r=n;for(let s=1;s<RVn;s++)r=r-e(r)/t(r);return r}const K8=.001;function $Vn({duration:e=xi.duration,bounce:t=xi.bounce,velocity:n=xi.velocity,mass:r=xi.mass}){let s,i,o=1-t;o=Nf(xi.minDamping,xi.maxDamping,o),e=Nf(xi.minDuration,xi.maxDuration,Qu(e)),o<1?(s=l=>{const d=l*o,p=d*e,f=d-n,h=Kee(l,o),m=Math.exp(-p);return K8-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),g=Kee(Math.pow(l,2),o);return(-s(l)+K8>0?-1:1)*((f-h)*m)/g}):(s=l=>{const d=Math.exp(-l*e),p=(l-n)*e+1;return-K8+d*p},i=l=>{const d=Math.exp(-l*e),p=(n-l)*(e*e);return d*p});const a=5/e,c=PVn(s,i,a);if(e=sc(e),isNaN(c))return{stiffness:xi.stiffness,damping:xi.damping,duration:e};{const l=Math.pow(c,2)*r;return{stiffness:l,damping:o*2*Math.sqrt(r*l),duration:e}}}const NVn=["duration","bounce"],AVn=["stiffness","damping","mass"];function NCe(e,t){return t.some(n=>e[n]!==void 0)}function IVn(e){let t={velocity:xi.velocity,stiffness:xi.stiffness,damping:xi.damping,mass:xi.mass,isResolvedFromDuration:!1,...e};if(!NCe(e,AVn)&&NCe(e,NVn))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Nf(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:xi.mass,stiffness:s,damping:i}}else{const n=$Vn({...e,velocity:0});t={...t,...n,mass:xi.mass},t.isResolvedFromDuration=!0}return t}function r$(e=xi.visualDuration,t=xi.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}=IVn({...n,velocity:-Qu(n.velocity||0)}),m=f||0,g=l/(2*Math.sqrt(c*d)),_=o-i,b=Qu(Math.sqrt(c/d)),y=Math.abs(_)<5;r||(r=y?xi.restSpeed.granular:xi.restSpeed.default),s||(s=y?xi.restDelta.granular:xi.restDelta.default);let x,S,v,T,E,w;if(g<1)v=Kee(b,g),T=(m+g*b*_)/v,x=C=>{const k=Math.exp(-g*b*C);return o-k*(T*Math.sin(v*C)+_*Math.cos(v*C))},E=g*b*T+_*v,w=g*b*_-T*v,S=C=>Math.exp(-g*b*C)*(E*Math.sin(v*C)+w*Math.cos(v*C));else if(g===1){x=k=>o-Math.exp(-b*k)*(_+(m+b*_)*k);const C=m+b*_;S=k=>Math.exp(-b*k)*(b*C*k-m)}else{const C=b*Math.sqrt(g*g-1);x=$=>{const R=Math.exp(-g*b*$),N=Math.min(C*$,300);return o-R*((m+g*b*_)*Math.sinh(N)+C*_*Math.cosh(N))/C};const k=(m+g*b*_)/C,I=g*b*k-_*C,Q=g*b*_-k*C;S=$=>{const R=Math.exp(-g*b*$),N=Math.min(C*$,300);return R*(I*Math.sinh(N)+Q*Math.cosh(N))}}const P={calculatedDuration:h&&p||null,velocity:C=>sc(S(C)),next:C=>{if(!h&&g<1){const I=Math.exp(-g*b*C),Q=Math.sin(v*C),$=Math.cos(v*C),R=o-I*(T*Q+_*$),N=sc(I*(E*Q+w*$));return a.done=Math.abs(N)<=r&&Math.abs(o-R)<=s,a.value=a.done?o:R,a}const k=x(C);if(h)a.done=C>=p;else{const I=sc(S(C));a.done=Math.abs(I)<=r&&Math.abs(o-k)<=s}return a.value=a.done?o:k,a},toString:()=>{const C=Math.min(Vce(P),TX),k=ert(I=>P.next(C*I).value,C,30);return C+"ms "+k},toTransition:()=>{}};return P}r$.applyToOptions=e=>{const t=trt(e,100,r$);return e.ease=t.ease,e.duration=sc(t.duration),e.type="keyframes",e};const MVn=5;function nrt(e,t,n){const r=Math.max(t-MVn,0);return Nnt(n-e(r),t-r)}function Jee({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 g=n*t;const _=p+g,b=o===void 0?_:o(_);b!==_&&(g=b-p);const y=w=>-g*Math.exp(-w/r),x=w=>b+y(w),S=w=>{const P=y(w),C=x(w);f.done=Math.abs(P)<=l,f.value=f.done?b:C};let v,T;const E=w=>{h(f.value)&&(v=w,T=r$({keyframes:[f.value,m(f.value)],velocity:nrt(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 QVn(e,t,n){const r=[],s=n||f_.mix||Jnt,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]||qu:t;a=sA(c,a)}r.push(a)}return r}function rrt(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const i=e.length;if(Lce(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=QVn(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=rE(e[p],e[p+1],d);return a[p](f)};return n?d=>l(Nf(e[0],e[i-1],d)):l}function srt(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=rE(0,t,r);e.push(js(n,1,s))}}function irt(e){const t=[0];return srt(t,e.length-1),t}function DVn(e,t){return e.map(n=>n*t)}function LVn(e,t){return e.map(()=>t||Unt).splice(0,e.length-1)}function ZC({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=znt(r)?r.map(wCe):wCe(r),i={done:!1,value:t[0]},o=DVn(n&&n.length===t.length?n:irt(t),e),a=rrt(o,t,{ease:Array.isArray(s)?s:LVn(t,s)});return{calculatedDuration:e,next:c=>(i.value=a(c),i.done=c>=e,i)}}const jVn=e=>e!==null;function DB(e,{repeat:t,repeatType:n="loop"},r,s=1){const i=e.filter(jVn),a=s<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const XVn={decay:Jee,inertia:Jee,tween:ZC,keyframes:ZC,spring:r$};function ort(e){typeof e.type=="string"&&(e.type=XVn[e.type])}class qce{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 UVn=e=>e/100;class EX extends qce{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;ort(t);const{type:n=ZC,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=t;let{keyframes:a}=t;const c=n||ZC;c!==ZC&&typeof a[0]!="number"&&(this.mixKeyframes=sA(UVn,Jnt(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=Vce(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:g,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),C=w%1;!C&&w>=1&&(C=1),C===1&&P--,P=Math.min(P,p+1),!!(P%2)&&(f==="reverse"?(C=1-C,h&&(C-=h/a)):f==="mirror"&&(S=o)),x=Nf(0,1,C)*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!==Jee&&(v.value=DB(d,this.options,_,this.speed)),g&&g(v.value),E&&this.finish(),v}then(t,n){return this.finished.then(t,n)}get duration(){return Qu(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Qu(t)}get time(){return Qu(this.currentTime)}set time(t){t=sc(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 nrt(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=Qu(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=CVn,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 zVn(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ab=e=>e*180/Math.PI,ete=e=>{const t=ab(Math.atan2(e[1],e[0]));return tte(t)},BVn={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:ete,rotateZ:ete,skewX:e=>ab(Math.atan(e[1])),skewY:e=>ab(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},tte=e=>(e=e%360,e<0&&(e+=360),e),ACe=ete,ICe=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),MCe=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),FVn={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ICe,scaleY:MCe,scale:e=>(ICe(e)+MCe(e))/2,rotateX:e=>tte(ab(Math.atan2(e[6],e[5]))),rotateY:e=>tte(ab(Math.atan2(-e[2],e[0]))),rotateZ:ACe,rotate:ACe,skewX:e=>ab(Math.atan(e[4])),skewY:e=>ab(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function nte(e){return e.includes("scale")?1:0}function rte(e,t){if(!e||e==="none")return nte(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=FVn,s=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=BVn,s=a}if(!s)return nte(t);const i=r[t],o=s[1].split(",").map(VVn);return typeof i=="function"?i(o):o[i]}const YVn=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return rte(n,t)};function VVn(e){return parseFloat(e.trim())}const d1=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],p1=new Set(d1),QCe=e=>e===u1||e===sn,qVn=new Set(["x","y","z"]),WVn=d1.filter(e=>!qVn.has(e));function GVn(e){const t=[];return WVn.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const mO={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})=>rte(t,"x"),y:(e,{transform:t})=>rte(t,"y")};mO.translateX=mO.x;mO.translateY=mO.y;const Cb=new Set;let ste=!1,ite=!1,ote=!1;function art(){if(ite){const e=Array.from(Cb).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=GVn(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)})}ite=!1,ste=!1,Cb.forEach(e=>e.complete(ote)),Cb.clear()}function lrt(){Cb.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ite=!0)})}function HVn(){ote=!0,lrt(),art(),ote=!1}class Wce{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?(Cb.add(this),ste||(ste=!0,Es.read(lrt),Es.resolveKeyframes(art))):(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])}zVn(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Cb.delete(this)}cancel(){this.state==="scheduled"&&(Cb.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const ZVn=e=>e.startsWith("--");function crt(e,t,n){ZVn(t)?e.style.setProperty(t,n):e.style[t]=n}const KVn={};function urt(e,t){const n=$nt(e);return()=>KVn[t]??n()}const JVn=urt(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),drt=urt(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Rk=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,DCe={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Rk([0,.65,.55,1]),circOut:Rk([.55,0,1,.45]),backIn:Rk([.31,.01,.66,-.59]),backOut:Rk([.33,1.53,.69,.99])};function prt(e,t){if(e)return typeof e=="function"?drt()?ert(e,t):"ease-out":Fnt(e)?Rk(e):Array.isArray(e)?e.map(n=>prt(n,t)||DCe.easeOut):DCe[e]}function eqn(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=prt(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 Gce(e){return typeof e=="function"&&"applyToOptions"in e}function tqn({type:e,...t}){return Gce(e)&&drt()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class frt extends qce{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,Lce(typeof t.type!="string");const l=tqn(t);this.animation=eqn(n,r,s,l,i),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const d=DB(s,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(d),crt(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 Qu(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Qu(t)}get time(){return Qu(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=sc(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&&JVn()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),qu):s(this)}}const hrt={anticipate:Lnt,backInOut:Dnt,circInOut:Xnt};function nqn(e){return e in hrt}function rqn(e){typeof e.ease=="string"&&nqn(e.ease)&&(e.ease=hrt[e.ease])}const J8=10;class sqn extends frt{constructor(t){rqn(t),ort(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 EX({...o,autoplay:!1}),c=Math.max(J8,hl.now()-this.startTime),l=Nf(0,J8,c-J8),d=a.sample(c).value,{name:p}=this.options;i&&p&&crt(i,p,d),n.setWithVelocity(a.sample(Math.max(0,c-l)).value,d,l),a.stop()}}const LCe=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Gd.test(e)||e==="0")&&!e.startsWith("url("));function iqn(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 oqn(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=LCe(s,t),a=LCe(i,t);return!o||!a?!1:iqn(e)||(n==="spring"||Gce(n))&&r}function ate(e){e.duration=0,e.type="keyframes"}const mrt=new Set(["opacity","clipPath","filter","transform"]),aqn=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function lqn(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&aqn.test(e[t]))return!0;return!1}const cqn=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),uqn=$nt(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function dqn(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 uqn()&&n&&(mrt.has(n)||cqn.has(n)&&lqn(a))&&(n!=="transform"||!d)&&!l&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const pqn=40;class fqn extends qce{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||Wce;this.keyframeResolver=new h(a,(m,g,_)=>this.onKeyframesResolved(m,g,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;oqn(t,i,o,a)||(p=!1,(f_.instantAnimations||!c)&&d?.(DB(t,r,n)),t[0]=t[t.length-1],ate(r),r.repeat=0);const h={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>pqn?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},m=p&&!l&&dqn(h),g=h.motionValue?.owner?.current;let _;if(m)try{_=new sqn({...h,element:g})}catch{_=new EX(h)}else _=new EX(h);_.finished.then(()=>{this.notifyFinished()}).catch(qu),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(),HVn()),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 hqn{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 jCe(this.animations,"duration")}get iterationDuration(){return jCe(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 jCe(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 mqn extends hqn{then(t,n){return this.finished.finally(t).then(()=>{})}}function grt(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 gqn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Oqn(e){const t=gqn.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function Ort(e,t,n=1){const[r,s]=Oqn(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const o=i.trim();return Cnt(o)?parseFloat(o):o}return zce(s)?Ort(s,t,n+1):s}const _qn={type:"spring",stiffness:500,damping:25,restSpeed:10},bqn=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),yqn={type:"keyframes",duration:.8},xqn={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Sqn=(e,{keyframes:t})=>t.length>2?yqn:p1.has(e)?e.startsWith("scale")?bqn(t[1]):_qn:xqn;function _rt(e,t){if(e?.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function Hce(e,t){const n=e?.[t]??e?.default??e;return n!==e?_rt(n,e):n}const vqn=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Tqn(e){for(const t in e)if(!vqn.has(t))return!0;return!1}const Zce=(e,t,n,r={},s,i)=>o=>{const a=Hce(r,e)||{},c=a.delay||r.delay||0;let{elapsed:l=0}=r;l=l-sc(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};Tqn(a)||Object.assign(d,Sqn(e,d)),d.duration&&(d.duration=sc(d.duration)),d.repeatDelay&&(d.repeatDelay=sc(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let p=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(ate(d),d.delay===0&&(p=!0)),(f_.instantAnimations||f_.skipAnimations||s?.shouldSkipAnimations)&&(p=!0,ate(d),d.delay=0),d.allowFlatten=!a.type&&!a.ease,p&&!i&&t.get()!==void 0){const f=DB(d.keyframes,a);if(f!==void 0){Es.update(()=>{d.onUpdate(f),d.onComplete()});return}}return a.isSync?new EX(d):new fqn(d)};function XCe(e){const t=[{},{}];return e?.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Kce(e,t,n,r){if(typeof t=="function"){const[s,i]=XCe(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]=XCe(r);t=t(n!==void 0?n:e.custom,s,i)}return t}function Rb(e,t,n){const r=e.getProps();return Kce(r,t,n!==void 0?n:r.custom,e)}const brt=new Set(["width","height","top","left","right","bottom",...d1]),UCe=30,Eqn=e=>!isNaN(parseFloat(e)),KC={current:void 0};class wqn{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=Eqn(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 jce);const r=this.events[t].add(n);return t==="change"?()=>{r(),Es.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 KC.current&&KC.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=hl.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>UCe)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,UCe);return Nnt(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 h_(e,t){return new wqn(e,t)}const lte=e=>Array.isArray(e);function kqn(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,h_(n))}function Cqn(e){return lte(e)?e[e.length-1]||0:e}function Rqn(e,t){const n=Rb(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const a=Cqn(i[o]);kqn(e,o,a)}}const ho=e=>!!(e&&e.getVelocity);function Pqn(e){return!!(ho(e)&&e.add)}function cte(e,t){const n=e.getValue("willChange");if(Pqn(n))return n.add(t);if(!n&&f_.WillChange){const r=new f_.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Jce(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const $qn="framerAppearId",yrt="data-"+Jce($qn);function xrt(e){return e.props[yrt]}function Nqn({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function eue(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:o,...a}=t;const c=e.getDefaultTransition();i=i?_rt(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&&Nqn(p,f))continue;const g={delay:n,...Hce(i||{},f)},_=h.get();if(_!==void 0&&!h.isAnimating()&&!Array.isArray(m)&&m===_&&!g.velocity){Es.update(()=>h.set(m));continue}let b=!1;if(window.MotionHandoffAnimation){const S=xrt(e);if(S){const v=window.MotionHandoffAnimation(S,f,Es);v!==null&&(g.startTime=v,b=!0)}}cte(e,f);const y=l??e.shouldReduceMotion;h.start(Zce(f,h,m,y&&brt.has(f)?{type:!1}:g,e,b));const x=h.animation;x&&d.push(x)}if(o){const f=()=>Es.update(()=>{o&&Rqn(e,o)});d.length?Promise.all(d).then(f):f()}return d}function ute(e,t,n={}){const r=Rb(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(eue(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:l=0,staggerChildren:d,staggerDirection:p}=s;return Aqn(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 Aqn(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(ute(c,t,{...o,delay:n+(typeof r=="function"?0:r)+grt(e.variantChildren,c,r,s,i)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(a)}function Iqn(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>ute(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=ute(e,t,n);else{const s=typeof t=="function"?Rb(e,t,n.custom):t;r=Promise.all(eue(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const Mqn={test:e=>e==="auto",parse:e=>e},Srt=e=>t=>t.test(e),vrt=[u1,sn,vf,wg,cVn,lVn,Mqn],zCe=e=>vrt.find(Srt(e));function Qqn(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Pnt(e):!0}const Dqn=new Set(["brightness","contrast","saturate","opacity"]);function Lqn(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Bce)||[];if(!r)return e;const s=n.replace(r,"");let i=Dqn.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const jqn=/\b([a-z-]*)\(.*?\)/gu,dte={...Gd,getAnimatableNone:e=>{const t=e.match(jqn);return t?t.map(Lqn).join(" "):e}},pte={...Gd,getAnimatableNone:e=>{const t=Gd.parse(e);return Gd.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},BCe={...u1,transform:Math.round},Xqn={rotate:wg,rotateX:wg,rotateY:wg,rotateZ:wg,scale:HM,scaleX:HM,scaleY:HM,scaleZ:HM,skew:wg,skewX:wg,skewY:wg,distance:sn,translateX:sn,translateY:sn,translateZ:sn,x:sn,y:sn,z:sn,perspective:sn,transformPerspective:sn,opacity:n$,originX:CCe,originY:CCe,originZ:sn},tue={borderWidth:sn,borderTopWidth:sn,borderRightWidth:sn,borderBottomWidth:sn,borderLeftWidth:sn,borderRadius:sn,borderTopLeftRadius:sn,borderTopRightRadius:sn,borderBottomRightRadius:sn,borderBottomLeftRadius:sn,width:sn,maxWidth:sn,height:sn,maxHeight:sn,top:sn,right:sn,bottom:sn,left:sn,inset:sn,insetBlock:sn,insetBlockStart:sn,insetBlockEnd:sn,insetInline:sn,insetInlineStart:sn,insetInlineEnd:sn,padding:sn,paddingTop:sn,paddingRight:sn,paddingBottom:sn,paddingLeft:sn,paddingBlock:sn,paddingBlockStart:sn,paddingBlockEnd:sn,paddingInline:sn,paddingInlineStart:sn,paddingInlineEnd:sn,margin:sn,marginTop:sn,marginRight:sn,marginBottom:sn,marginLeft:sn,marginBlock:sn,marginBlockStart:sn,marginBlockEnd:sn,marginInline:sn,marginInlineStart:sn,marginInlineEnd:sn,fontSize:sn,backgroundPositionX:sn,backgroundPositionY:sn,...Xqn,zIndex:BCe,fillOpacity:n$,strokeOpacity:n$,numOctaves:BCe},Uqn={...tue,color:Li,backgroundColor:Li,outlineColor:Li,fill:Li,stroke:Li,borderColor:Li,borderTopColor:Li,borderRightColor:Li,borderBottomColor:Li,borderLeftColor:Li,filter:dte,WebkitFilter:dte,mask:pte,WebkitMask:pte},Trt=e=>Uqn[e],zqn=new Set([dte,pte]);function Ert(e,t){let n=Trt(e);return zqn.has(n)||(n=Gd),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Bqn=new Set(["auto","none","0"]);function Fqn(e,t,n){let r=0,s;for(;r<e.length&&!s;){const i=e[r];typeof i=="string"&&!Bqn.has(i)&&sE(i).values.length&&(s=e[r]),r++}if(s&&n)for(const i of t)e[i]=Ert(n,s)}class Yqn extends Wce{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(),zce(p))){const f=Ort(p,n.current);f!==void 0&&(t[d]=f),d===t.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!brt.has(r)||t.length!==2)return;const[s,i]=t,o=zCe(s),a=zCe(i),c=kCe(s),l=kCe(i);if(c!==l&&mO[r]){this.needsMeasurement=!0;return}if(o!==a)if(QCe(o)&&QCe(a))for(let d=0;d<t.length;d++){const p=t[d];typeof p=="string"&&(t[d]=parseFloat(p))}else mO[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||Qqn(t[s]))&&r.push(s);r.length&&Fqn(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=mO[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]=mO[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 nue(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 wrt=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Vqn(e){return Rnt(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:rue}=Ynt(queueMicrotask,!1),bd={x:!1,y:!1};function krt(){return bd.x||bd.y}function qqn(e){return e==="x"||e==="y"?bd[e]?null:(bd[e]=!0,()=>{bd[e]=!1}):bd.x||bd.y?null:(bd.x=bd.y=!0,()=>{bd.x=bd.y=!1})}function Crt(e,t){const n=nue(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function Wqn(e){return!(e.pointerType==="touch"||krt())}function Gqn(e,t,n={}){const[r,s,i]=Crt(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(_)}},g=_=>{if(!Wqn(_))return;c=!1;const b=t(o,_);typeof b=="function"&&(l=b,o.addEventListener("pointerleave",m,s))};o.addEventListener("pointerenter",g,s),o.addEventListener("pointerdown",h,s)}),i}const Rrt=(e,t)=>t?e===t?!0:Rrt(e,t.parentElement):!1,sue=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Hqn=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Zqn(e){return Hqn.has(e.tagName)||e.isContentEditable===!0}const Kqn=new Set(["INPUT","SELECT","TEXTAREA"]);function Jqn(e){return Kqn.has(e.tagName)||e.isContentEditable===!0}const Z2=new WeakSet;function FCe(e){return t=>{t.key==="Enter"&&e(t)}}function e9(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const e6n=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=FCe(()=>{if(Z2.has(n))return;e9(n,"down");const s=FCe(()=>{e9(n,"up")}),i=()=>e9(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 YCe(e){return sue(e)&&!krt()}const VCe=new WeakSet;function t6n(e,t,n={}){const[r,s,i]=Crt(e,n),o=a=>{const c=a.currentTarget;if(!YCe(a)||VCe.has(a))return;Z2.add(c),n.stopPropagation&&VCe.add(a);const l=t(c,a),d=(h,m)=>{window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",f),Z2.has(c)&&Z2.delete(c),YCe(h)&&typeof l=="function"&&l(h,{success:m})},p=h=>{d(h,c===window||c===document||n.useGlobalTarget||Rrt(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),Vqn(a)&&(a.addEventListener("focus",l=>e6n(l,s)),!Zqn(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}function LB(e){return Rnt(e)&&"ownerSVGElement"in e}const K2=new WeakMap;let J2;const Prt=(e,t,n)=>(r,s)=>s&&s[0]?s[0][e+"Size"]:LB(r)&&"getBBox"in r?r.getBBox()[t]:r[n],n6n=Prt("inline","width","offsetWidth"),r6n=Prt("block","height","offsetHeight");function s6n({target:e,borderBoxSize:t}){K2.get(e)?.forEach(n=>{n(e,{get width(){return n6n(e,t)},get height(){return r6n(e,t)}})})}function i6n(e){e.forEach(s6n)}function o6n(){typeof ResizeObserver>"u"||(J2=new ResizeObserver(i6n))}function a6n(e,t){J2||o6n();const n=nue(e);return n.forEach(r=>{let s=K2.get(r);s||(s=new Set,K2.set(r,s)),s.add(t),J2?.observe(r)}),()=>{n.forEach(r=>{const s=K2.get(r);s?.delete(t),s?.size||J2?.unobserve(r)})}}const eD=new Set;let qS;function l6n(){qS=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};eD.forEach(t=>t(e))},window.addEventListener("resize",qS)}function c6n(e){return eD.add(e),qS||l6n(),()=>{eD.delete(e),!eD.size&&typeof qS=="function"&&(window.removeEventListener("resize",qS),qS=void 0)}}function qCe(e,t){return typeof e=="function"?c6n(e):a6n(e,t)}function $rt(e){return LB(e)&&e.tagName==="svg"}function tD(...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=rrt(s,i,o);return t?a(r):a}const u6n=[...vrt,Li,Gd],d6n=e=>u6n.find(Srt(e)),WCe=()=>({translate:0,scale:1,origin:0,originPoint:0}),WS=()=>({x:WCe(),y:WCe()}),GCe=()=>({min:0,max:0}),Di=()=>({x:GCe(),y:GCe()}),s$=new WeakMap;function jB(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function i$(e){return typeof e=="string"||Array.isArray(e)}const iue=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],oue=["initial",...iue];function XB(e){return jB(e.animate)||oue.some(t=>i$(e[t]))}function Nrt(e){return!!(XB(e)||e.variants)}function p6n(e,t,n){for(const r in t){const s=t[r],i=n[r];if(ho(s))e.addValue(r,s);else if(ho(i))e.addValue(r,h_(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,h_(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const wX={current:null},aue={current:!1},f6n=typeof window<"u";function Art(){if(aue.current=!0,!!f6n)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>wX.current=e.matches;e.addEventListener("change",t),t()}else wX.current=!1}const HCe=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let kX={};function Irt(e){kX=e}function h6n(){return kX}class Mrt{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=Wce,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,Es.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=XB(n),this.isVariantNode=Nrt(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&&ho(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,s$.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:(aue.current||Art(),this.shouldReduceMotion=wX.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(),Nm(this.notifyUpdate),Nm(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&&mrt.has(t)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:c,ease:l,duration:d}=n.accelerate,p=new frt({element:this.current,name:t,keyframes:a,times:c,ease:l,duration:sc(d)}),f=o(p);this.valueSubscriptions.set(t,()=>{f(),p.cancel()});return}const r=p1.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&Es.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 kX){const n=kX[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<HCe.length;r++){const s=HCe[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=p6n(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=h_(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"&&(Cnt(r)||Pnt(r))?r=parseFloat(r):!d6n(r)&&Gd.test(n)&&(r=Ert(t,n)),this.setBaseTarget(t,ho(r)?r.get():r)),ho(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=Kce(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&&!ho(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 jce),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){rue.render(this.render)}}class Qrt extends Mrt{constructor(){super(...arguments),this.KeyframeResolver=Yqn}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;ho(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class j_{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Drt({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function m6n({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function g6n(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 t9(e){return e===void 0||e===1}function fte({scale:e,scaleX:t,scaleY:n}){return!t9(e)||!t9(t)||!t9(n)}function T0(e){return fte(e)||Lrt(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Lrt(e){return ZCe(e.x)||ZCe(e.y)}function ZCe(e){return e&&e!=="0%"}function CX(e,t,n){const r=e-n,s=t*r;return n+s}function KCe(e,t,n,r,s){return s!==void 0&&(e=CX(e,s,r)),CX(e,n,r)+t}function hte(e,t=0,n=1,r,s){e.min=KCe(e.min,t,n,r,s),e.max=KCe(e.max,t,n,r,s)}function jrt(e,{x:t,y:n}){hte(e.x,t.translate,t.scale,t.originPoint),hte(e.y,n.translate,n.scale,n.originPoint)}const JCe=.999999999999,eRe=1.0000000000001;function O6n(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let i,o;for(let a=0;a<s;a++){i=n[a],o=i.projectionDelta;const{visualElement:c}=i.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(qp(e.x,-i.scroll.offset.x),qp(e.y,-i.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,jrt(e,o)),r&&T0(i.latestValues)&&nD(e,i.latestValues,i.layout?.layoutBox))}t.x<eRe&&t.x>JCe&&(t.x=1),t.y<eRe&&t.y>JCe&&(t.y=1)}function qp(e,t){e.min+=t,e.max+=t}function tRe(e,t,n,r,s=.5){const i=js(e.min,e.max,s);hte(e,t,n,i,r)}function nRe(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function nD(e,t,n){const r=n??e;tRe(e.x,nRe(t.x,r.x),t.scaleX,t.scale,t.originX),tRe(e.y,nRe(t.y,r.y),t.scaleY,t.scale,t.originY)}function Xrt(e,t){return Drt(g6n(e.getBoundingClientRect(),t))}function _6n(e,t,n){const r=Xrt(e,n),{scroll:s}=t;return s&&(qp(r.x,s.offset.x),qp(r.y,s.offset.y)),r}const b6n={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},y6n=d1.length;function x6n(e,t,n){let r="",s=!0;for(let i=0;i<y6n;i++){const o=d1[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=wrt(a,tue[o]);if(!c){s=!1;const d=b6n[o]||o;r+=`${d}(${l}) `}n&&(t[o]=l)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function lue(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(p1.has(c)){o=!0;continue}else if(qnt(c)){s[c]=l;continue}else{const d=wrt(l,tue[c]);c.startsWith("origin")?(a=!0,i[c]=d):r[c]=d}}if(t.transform||(o||n?r.transform=x6n(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 Urt(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 rRe(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Qw={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(sn.test(e))e=parseFloat(e);else return e;const n=rRe(e,t.target.x),r=rRe(e,t.target.y);return`${n}% ${r}%`}},S6n={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Gd.parse(e);if(s.length>5)return r;const i=Gd.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)}},mte={borderRadius:{...Qw,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Qw,borderTopRightRadius:Qw,borderBottomLeftRadius:Qw,borderBottomRightRadius:Qw,boxShadow:S6n};function zrt(e,{layout:t,layoutId:n}){return p1.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!mte[e]||e==="opacity")}function cue(e,t,n){const r=e.style,s=t?.style,i={};if(!r)return i;for(const o in r)(ho(r[o])||s&&ho(s[o])||zrt(o,e)||n?.getValue(o)?.liveStyle!==void 0)&&(i[o]=r[o]);return i}function v6n(e){return window.getComputedStyle(e)}class Brt extends Qrt{constructor(){super(...arguments),this.type="html",this.renderInstance=Urt}readValueFromInstance(t,n){if(p1.has(n))return this.projection?.isProjecting?nte(n):YVn(t,n);{const r=v6n(t),s=(qnt(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Xrt(t,n)}build(t,n,r){lue(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return cue(t,n,r)}}function T6n(e,t){return e in t}class E6n extends Mrt{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,n){if(T6n(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 w6n={offset:"stroke-dashoffset",array:"stroke-dasharray"},k6n={offset:"strokeDashoffset",array:"strokeDasharray"};function C6n(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?w6n:k6n;e[i.offset]=`${-r}`,e[i.array]=`${t} ${n}`}const R6n=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Frt(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...a},c,l,d){if(lue(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 R6n)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&&C6n(p,s,i,o,!1)}const Yrt=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"]),Vrt=e=>typeof e=="string"&&e.toLowerCase()==="svg";function P6n(e,t,n,r){Urt(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(Yrt.has(s)?s:Jce(s),t.attrs[s])}function qrt(e,t,n){const r=cue(e,t,n);for(const s in e)if(ho(e[s])||ho(t[s])){const i=d1.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}class Wrt extends Qrt{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Di}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(p1.has(n)){const r=Trt(n);return r&&r.default||0}return n=Yrt.has(n)?n:Jce(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return qrt(t,n,r)}build(t,n,r){Frt(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){P6n(t,n,r,s)}mount(t){this.isSVGTag=Vrt(t.tagName),super.mount(t)}}const $6n=oue.length;function Grt(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Grt(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<$6n;n++){const r=oue[n],s=e.props[r];(i$(s)||s===!1)&&(t[r]=s)}return t}function Hrt(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 N6n=[...iue].reverse(),A6n=iue.length;function I6n(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Iqn(e,n,r)))}function M6n(e){let t=I6n(e),n=sRe(),r=!0,s=!1;const i=l=>(d,p)=>{const f=Rb(e,p,l==="exit"?e.presenceContext?.custom:void 0);if(f){const{transition:h,transitionEnd:m,...g}=f;d={...d,...g,...m}}return d};function o(l){t=l(e)}function a(l){const{props:d}=e,p=Grt(e.parent)||{},f=[],h=new Set;let m={},g=1/0;for(let b=0;b<A6n;b++){const y=N6n[b],x=n[y],S=d[y]!==void 0?d[y]:p[y],v=i$(S),T=y===l?x.isActive:null;T===!1&&(g=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||jB(S)||typeof S=="boolean")continue;if(y==="exit"&&x.isActive&&T!==!0){x.prevResolvedValues&&(m={...m,...x.prevResolvedValues});continue}const w=Q6n(x.prevProp,S);let P=w||y===l&&x.isActive&&!E&&v||b>g&&v,C=!1;const k=Array.isArray(S)?S:[S];let I=k.reduce(i(y),{});T===!1&&(I={});const{prevResolvedValues:Q={}}=x,$={...Q,...I},R=M=>{P=!0,h.has(M)&&(C=!0,h.delete(M)),x.needsAnimating[M]=!0;const U=e.getValue(M);U&&(U.liveStyle=!1)};for(const M in $){const U=I[M],A=Q[M];if(m.hasOwnProperty(M))continue;let F=!1;lte(U)&<e(A)?F=!Hrt(U,A):F=U!==A,F?U!=null?R(M):h.add(M):U!==void 0&&h.has(M)?R(M):x.protectedKeys[M]=!0}x.prevProp=S,x.prevResolvedValues=I,x.isActive&&(m={...m,...I}),(r||s)&&e.blockInitialAnimation&&(P=!1);const N=E&&w;P&&(!N||C)&&f.push(...k.map(M=>{const U={type:y};if(typeof M=="string"&&(r||s)&&!N&&e.manuallyAnimateOnMount&&e.parent){const{parent:A}=e,F=Rb(A,M);if(A.enteringChildren&&F){const{delayChildren:z}=F.transition||{};U.delay=grt(A.enteringChildren,e,z)}}return{animation:M,options:U}}))}if(h.size){const b={};if(typeof d.initial!="boolean"){const y=Rb(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=sRe(),s=!0}}}function Q6n(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Hrt(t,e):!1}function l0(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function sRe(){return{animate:l0(!0),whileInView:l0(),whileHover:l0(),whileTap:l0(),whileDrag:l0(),whileFocus:l0(),exit:l0()}}function gte(e,t){e.min=t.min,e.max=t.max}function pd(e,t){gte(e.x,t.x),gte(e.y,t.y)}function iRe(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const Zrt=1e-4,D6n=1-Zrt,L6n=1+Zrt,Krt=.01,j6n=0-Krt,X6n=0+Krt;function ml(e){return e.max-e.min}function U6n(e,t,n){return Math.abs(e-t)<=n}function oRe(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>=D6n&&e.scale<=L6n||isNaN(e.scale))&&(e.scale=1),(e.translate>=j6n&&e.translate<=X6n||isNaN(e.translate))&&(e.translate=0)}function JC(e,t,n,r){oRe(e.x,t.x,n.x,r?r.originX:void 0),oRe(e.y,t.y,n.y,r?r.originY:void 0)}function aRe(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 z6n(e,t,n,r){aRe(e.x,t.x,n.x,r?.x),aRe(e.y,t.y,n.y,r?.y)}function lRe(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 RX(e,t,n,r){lRe(e.x,t.x,n.x,r?.x),lRe(e.y,t.y,n.y,r?.y)}function cRe(e,t,n,r,s){return e-=t,e=CX(e,1/n,r),s!==void 0&&(e=CX(e,1/s,r)),e}function B6n(e,t=0,n=1,r=.5,s,i=e,o=e){if(vf.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=cRe(e.min,t,n,a,s),e.max=cRe(e.max,t,n,a,s)}function uRe(e,t,[n,r,s],i,o){B6n(e,t[n],t[r],t[s],t.scale,i,o)}const F6n=["x","scaleX","originX"],Y6n=["y","scaleY","originY"];function dRe(e,t,n,r){uRe(e.x,t,F6n,n?n.x:void 0,r?r.x:void 0),uRe(e.y,t,Y6n,n?n.y:void 0,r?r.y:void 0)}function pRe(e){return e.translate===0&&e.scale===1}function Jrt(e){return pRe(e.x)&&pRe(e.y)}function fRe(e,t){return e.min===t.min&&e.max===t.max}function V6n(e,t){return fRe(e.x,t.x)&&fRe(e.y,t.y)}function hRe(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function est(e,t){return hRe(e.x,t.x)&&hRe(e.y,t.y)}function mRe(e){return ml(e.x)/ml(e.y)}function gRe(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Up(e){return[e("x"),e("y")]}function q6n(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 tst=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],W6n=tst.length,ORe=e=>typeof e=="string"?parseFloat(e):e,_Re=e=>typeof e=="number"||sn.test(e);function G6n(e,t,n,r,s,i){s?(e.opacity=js(0,n.opacity??1,H6n(r)),e.opacityExit=js(t.opacity??1,0,Z6n(r))):i&&(e.opacity=js(t.opacity??1,n.opacity??1,r));for(let o=0;o<W6n;o++){const a=tst[o];let c=bRe(t,a),l=bRe(n,a);if(c===void 0&&l===void 0)continue;c||(c=0),l||(l=0),c===0||l===0||_Re(c)===_Re(l)?(e[a]=Math.max(js(ORe(c),ORe(l),r),0),(vf.test(l)||vf.test(c))&&(e[a]+="%")):e[a]=l}(t.rotate||n.rotate)&&(e.rotate=js(t.rotate||0,n.rotate||0,r))}function bRe(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const H6n=nst(0,.5,jnt),Z6n=nst(.5,.95,qu);function nst(e,t,n){return r=>r<e?0:r>t?1:n(rE(e,t,r))}function rst(e,t,n){const r=ho(e)?e:h_(e);return r.start(Zce("",r,t,n)),r.animation}function o$(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const K6n=(e,t)=>e.depth-t.depth;class J6n{constructor(){this.children=[],this.isDirty=!1}add(t){Dce(this.children,t),this.isDirty=!0}remove(t){nE(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(K6n),this.isDirty=!1,this.children.forEach(t)}}function eWn(e,t){const n=hl.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(Nm(r),e(i-t))};return Es.setup(r,!0),()=>Nm(r)}function rD(e){return ho(e)?e.get():e}class tWn{constructor(){this.members=[]}add(t){Dce(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&&(nE(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(nE(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 sD={hasAnimatedSinceResize:!0,hasEverUpdated:!1},n9=["","X","Y","Z"],nWn=1e3;let rWn=0;function r9(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function sst(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=xrt(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Es,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&sst(r)}function ist({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=t?.()){this.id=rWn++,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(oWn),this.nodes.forEach(pWn),this.nodes.forEach(fWn),this.nodes.forEach(aWn)},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 J6n)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new jce),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=LB(o)&&!$rt(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;Es.read(()=>{p=window.innerWidth}),e(o,()=>{const h=window.innerWidth;h!==p&&(p=h,this.root.updateBlockedByResize=!0,d&&d(),d=eWn(f,250),sD.hasAnimatedSinceResize&&(sD.hasAnimatedSinceResize=!1,this.nodes.forEach(SRe)))})}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()||_Wn,{onLayoutAnimationStart:g,onLayoutAnimationComplete:_}=l.getProps(),b=!this.targetLayout||!est(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={...Hce(m,"layout"),onPlay:g,onComplete:_};(l.shouldReduceMotion||this.options.layoutRoot)&&(x.delay=0,x.type=!1),this.startAnimation(x),this.setAnimationOrigin(d,y)}else p||SRe(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(),Nm(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(hWn),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&&sst(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(cWn),this.nodes.forEach(yRe);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(xRe);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(uWn),this.nodes.forEach(dWn),this.nodes.forEach(sWn),this.nodes.forEach(iWn)):this.nodes.forEach(xRe),this.clearAllSnapshots();const a=hl.now();ta.delta=Nf(0,1e3/60,a-ta.timestamp),ta.timestamp=a,ta.isProcessing=!0,W8.update.process(ta),W8.preRender.process(ta),W8.render.process(ta),ta.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,rue.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(lWn),this.sharedNodes.forEach(mWn)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Es.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Es.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&&!Jrt(this.projectionDelta),c=this.getTransformTemplate(),l=c?c(this.latestValues,""):void 0,d=l!==this.prevTransformTemplateValue;o&&this.instance&&(a||T0(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)),bWn(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(yWn))){const{scroll:l}=this.root;l&&(qp(a.x,l.offset.x),qp(a.y,l.offset.y))}return a}removeElementScroll(o){const a=Di();if(pd(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&&pd(a,o),qp(a.x,d.offset.x),qp(a.y,d.offset.y))}return a}applyTransform(o,a=!1,c){const l=c||Di();pd(l,o);for(let d=0;d<this.path.length;d++){const p=this.path[d];!a&&p.options.layoutScroll&&p.scroll&&p!==p.root&&(qp(l.x,-p.scroll.offset.x),qp(l.y,-p.scroll.offset.y)),T0(p.latestValues)&&nD(l,p.latestValues,p.layout?.layoutBox)}return T0(this.latestValues)&&nD(l,this.latestValues,this.layout?.layoutBox),l}removeTransform(o){const a=Di();pd(a,o);for(let c=0;c<this.path.length;c++){const l=this.path[c];if(!T0(l.latestValues))continue;let d;l.instance&&(fte(l.latestValues)&&l.updateSnapshot(),d=Di(),pd(d,l.measurePageBox())),dRe(a,l.latestValues,l.snapshot?.layoutBox,d)}return T0(this.latestValues)&&dRe(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!==ta.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=ta.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(),z6n(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):pd(this.target,this.layout.layoutBox),jrt(this.target,this.targetDelta)):pd(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||fte(this.parent.latestValues)||Lrt(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(),RX(this.relativeTargetOrigin,a,c,this.options.layoutAnchor||void 0),pd(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===ta.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;pd(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,f=this.treeScale.y;O6n(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():(iRe(this.prevProjectionDelta.x,this.projectionDelta.x),iRe(this.prevProjectionDelta.y,this.projectionDelta.y)),JC(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==f||!gRe(this.projectionDelta.x,this.prevProjectionDelta.x)||!gRe(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=WS(),this.projectionDelta=WS(),this.projectionDeltaWithTransform=WS()}setAnimationOrigin(o,a=!1){const c=this.snapshot,l=c?c.latestValues:{},d={...this.latestValues},p=WS();(!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,g=h!==m,_=this.getStack(),b=!_||_.members.length<=1,y=!!(g&&!b&&this.options.crossfade===!0&&!this.path.some(OWn));this.animationProgress=0;let x;this.mixTargetDelta=S=>{const v=S/1e3;vRe(p.x,o.x,v),vRe(p.y,o.y,v),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(RX(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),gWn(this.relativeTarget,this.relativeTargetOrigin,f,v),x&&V6n(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=Di()),pd(x,this.relativeTarget)),g&&(this.animationValues=d,G6n(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&&(Nm(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Es.update(()=>{sD.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=h_(0)),this.motionValue.jump(0,!1),this.currentAnimation=rst(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(nWn),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&&ost(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}pd(a,c),nD(a,d),JC(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new tWn),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&&r9("z",o,l,this.animationValues);for(let d=0;d<n9.length;d++)r9(`rotate${n9[d]}`,o,l,this.animationValues),r9(`skew${n9[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=rD(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=rD(a?.pointerEvents)||""),this.hasProjected&&!T0(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const d=l.animationValues||l.latestValues;this.applyTransformsToTarget();let p=q6n(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 mte){if(d[m]===void 0)continue;const{correct:g,applyTo:_,isCSSVariable:b}=mte[m],y=p==="none"?d[m]:g(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?rD(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>o.currentAnimation?.stop()),this.root.nodes.forEach(yRe),this.root.sharedNodes.clear()}}}function sWn(e){e.updateLayout()}function iWn(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=e.layout,{animationType:s}=e.options,i=t.source!==e.layout.source;if(s==="size")Up(d=>{const p=i?t.measuredBox[d]:t.layoutBox[d],f=ml(p);p.min=n[d].min,p.max=p.min+f});else if(s==="x"||s==="y"){const d=s==="x"?"y":"x";gte(i?t.measuredBox[d]:t.layoutBox[d],n[d])}else ost(s,t.layoutBox,n)&&Up(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=WS();JC(o,n,t.layoutBox);const a=WS();i?JC(a,e.applyTransform(r,!0),t.measuredBox):JC(a,n,t.layoutBox);const c=!Jrt(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();RX(m,t.layoutBox,p.layoutBox,h);const g=Di();RX(g,n,f.layoutBox,h),est(m,g)||(l=!0),d.options.layoutRoot&&(e.relativeTarget=g,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 oWn(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 aWn(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function lWn(e){e.clearSnapshot()}function yRe(e){e.clearMeasurements()}function cWn(e){e.isLayoutDirty=!0,e.updateLayout()}function xRe(e){e.isLayoutDirty=!1}function uWn(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function dWn(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function SRe(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function pWn(e){e.resolveTargetDelta()}function fWn(e){e.calcProjection()}function hWn(e){e.resetSkewAndRotation()}function mWn(e){e.removeLeadSnapshot()}function vRe(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 TRe(e,t,n,r){e.min=js(t.min,n.min,r),e.max=js(t.max,n.max,r)}function gWn(e,t,n,r){TRe(e.x,t.x,n.x,r),TRe(e.y,t.y,n.y,r)}function OWn(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const _Wn={duration:.45,ease:[.4,0,.1,1]},ERe=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),wRe=ERe("applewebkit/")&&!ERe("chrome/")?Math.round:qu;function kRe(e){e.min=wRe(e.min),e.max=wRe(e.max)}function bWn(e){kRe(e.x),kRe(e.y)}function ost(e,t,n){return e==="position"||e==="preserve-aspect"&&!U6n(mRe(t),mRe(n),.2)}function yWn(e){return e!==e.root&&e.scroll?.wasRoot}const xWn=ist({attachResizeListener:(e,t)=>o$(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),s9={current:void 0},ast=ist({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!s9.current){const e=new xWn({});e.mount(window),e.setOptions({layoutScroll:!0}),s9.current=e}return s9.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),uue=O.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function SWn(e=!0){const t=O.useContext(Qce);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=O.useId();O.useEffect(()=>{if(e)return s(i)},[e]);const o=O.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,o]:[!0]}const lst=O.createContext({strict:!1}),CRe={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 RRe=!1;function vWn(){if(RRe)return;const e={};for(const t in CRe)e[t]={isEnabled:n=>CRe[t].some(r=>!!n[r])};Irt(e),RRe=!0}function cst(){return vWn(),h6n()}function TWn(e){const t=cst();for(const n in e)t[n]={...t[n],...e[n]};Irt(t)}const EWn=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 PX(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||EWn.has(e)}let ust=e=>!PX(e);function wWn(e){typeof e=="function"&&(ust=t=>t.startsWith("on")?!PX(t):e(t))}try{wWn(require("@emotion/is-prop-valid").default)}catch{}function kWn(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||ho(e[s])||(ust(s)||n===!0&&PX(s)||!t&&!PX(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const UB=O.createContext({});function CWn(e,t){if(XB(e)){const{initial:n,animate:r}=e;return{initial:n===!1||i$(n)?n:void 0,animate:i$(r)?r:void 0}}return e.inherit!==!1?t:{}}function RWn(e){const{initial:t,animate:n}=CWn(e,O.useContext(UB));return O.useMemo(()=>({initial:t,animate:n}),[PRe(t),PRe(n)])}function PRe(e){return Array.isArray(e)?e.join(" "):e}const due=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function dst(e,t,n){for(const r in t)!ho(t[r])&&!zrt(r,n)&&(e[r]=t[r])}function PWn({transformTemplate:e},t){return O.useMemo(()=>{const n=due();return lue(n,t,e),Object.assign({},n.vars,n.style)},[t])}function $Wn(e,t){const n=e.style||{},r={};return dst(r,n,e),Object.assign(r,PWn(e,t)),r}function NWn(e,t){const n={},r=$Wn(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 pst=()=>({...due(),attrs:{}});function AWn(e,t,n,r){const s=O.useMemo(()=>{const i=pst();return Frt(i,t,Vrt(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};dst(i,e.style,e),s.style={...i,...s.style}}return s}const IWn=["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 pue(e){return typeof e!="string"||e.includes("-")?!1:!!(IWn.indexOf(e)>-1||/[A-Z]/u.test(e))}function MWn(e,t,n,{latestValues:r},s,i=!1,o){const c=(o??pue(e)?AWn:NWn)(t,r,s,e),l=kWn(t,typeof e=="string",i),d=e!==O.Fragment?{...l,...c,ref:n}:{},{children:p}=t,f=O.useMemo(()=>ho(p)?p.get():p,[p]);return O.createElement(e,{...d,children:f})}function QWn({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:DWn(n,r,s,e),renderState:t()}}function DWn(e,t,n,r){const s={},i=r(e,{});for(const f in i)s[f]=rD(i[f]);let{initial:o,animate:a}=e;const c=XB(e),l=Nrt(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"&&!jB(p)){const f=Array.isArray(p)?p:[p];for(let h=0;h<f.length;h++){const m=Kce(e,f[h]);if(m){const{transitionEnd:g,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 g)s[y]=g[y]}}}return s}const fst=e=>(t,n)=>{const r=O.useContext(UB),s=O.useContext(Qce),i=()=>QWn(e,t,r,s);return n?i():Mce(i)},LWn=fst({scrapeMotionValuesFromProps:cue,createRenderState:due}),jWn=fst({scrapeMotionValuesFromProps:qrt,createRenderState:pst}),XWn=Symbol.for("motionComponentSymbol");function UWn(e,t,n){const r=O.useRef(n);O.useInsertionEffect(()=>{r.current=n});const s=O.useRef(null);return O.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 hst=O.createContext({});function mS(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function zWn(e,t,n,r,s,i){const{visualElement:o}=O.useContext(UB),a=O.useContext(lst),c=O.useContext(Qce),l=O.useContext(uue),d=l.reducedMotion,p=l.skipAnimations,f=O.useRef(null),h=O.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,g=O.useContext(hst);m&&!m.projection&&s&&(m.type==="html"||m.type==="svg")&&BWn(f.current,n,s,g);const _=O.useRef(!1);O.useInsertionEffect(()=>{m&&_.current&&m.update(n,c)});const b=n[yrt],y=O.useRef(!!b&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(b)&&window.MotionHasOptimisedAnimation?.(b));return knt(()=>{h.current=!0,m&&(_.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),y.current&&m.animationState&&m.animationState.animateChanges())}),O.useEffect(()=>{m&&(!y.current&&m.animationState&&m.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(b)}),y.current=!1),m.enteringChildren=void 0)}),m}function BWn(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:mst(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||a&&mS(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:p,layoutScroll:c,layoutRoot:l,layoutAnchor:d})}function mst(e){if(e)return e.options.allowProjection!==!1?e.projection:mst(e.parent)}function i9(e,{forwardMotionProps:t=!1,type:n}={},r,s){r&&TWn(r);const i=n?n==="svg":pue(e),o=i?jWn:LWn;function a(l,d){let p;const f={...O.useContext(uue),...l,layoutId:FWn(l)},{isStatic:h}=f,m=RWn(l),g=o(l,h);if(!h&&typeof window<"u"){YWn();const _=VWn(f);p=_.MeasureLayout,m.visualElement=zWn(e,g,f,s,_.ProjectionNode,i)}return u.jsxs(UB.Provider,{value:m,children:[p&&m.visualElement?u.jsx(p,{visualElement:m.visualElement,...f}):null,MWn(e,l,UWn(g,m.visualElement,d),g,h,t,i)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const c=O.forwardRef(a);return c[XWn]=e,c}function FWn({layoutId:e}){const t=O.useContext(wnt).id;return t&&e!==void 0?t+"-"+e:e}function YWn(e,t){O.useContext(lst).strict}function VWn(e){const t=cst(),{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 qWn(e,t){if(typeof Proxy>"u")return i9;const n=new Map,r=(i,o)=>i9(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,i9(o,void 0,e,t)),n.get(o))})}const WWn=(e,t)=>t.isSVG??pue(e)?new Wrt(t):new Brt(t,{allowProjection:e!==O.Fragment});class GWn extends j_{constructor(t){super(t),t.animationState||(t.animationState=M6n(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();jB(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 HWn=0;class ZWn extends j_{constructor(){super(...arguments),this.id=HWn++,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=Rb(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 KWn={animation:{Feature:GWn},exit:{Feature:ZWn}};function aA(e){return{point:{x:e.pageX,y:e.pageY}}}const JWn=e=>t=>sue(t)&&e(t,aA(t));function eR(e,t,n,r){return o$(e,t,JWn(n),r)}const gst=({current:e})=>e?e.ownerDocument.defaultView:null,$Re=(e,t)=>Math.abs(e-t);function eGn(e,t){const n=$Re(e.x,t.x),r=$Re(e.y,t.y);return Math.sqrt(n**2+r**2)}const NRe=new Set(["auto","scroll"]);class Ost{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=o9(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,g=eGn(h.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!g)return;const{point:_}=h,{timestamp:b}=ta;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),Es.update(this.updatePoint,!0)},this.handlePointerUp=(h,m)=>{this.end();const{onEnd:g,onSessionEnd:_,resumeAnimation:b}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=o9(h.type==="pointercancel"?this.lastMoveEventInfo:ZM(m,this.transformPagePoint),this.history);this.startEvent&&g&&g(h,y),_&&_(h,y)},!sue(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const c=aA(t),l=ZM(c,this.transformPagePoint),{point:d}=l,{timestamp:p}=ta;this.history=[{...d,timestamp:p}];const{onSessionStart:f}=n;f&&f(t,o9(l,this.history)),this.removeListeners=sA(eR(this.contextWindow,"pointermove",this.handlePointerMove),eR(this.contextWindow,"pointerup",this.handlePointerUp),eR(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(NRe.has(r.overflowX)||NRe.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),Es.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Nm(this.updatePoint)}}function ZM(e,t){return t?{point:t(e.point)}:e}function ARe(e,t){return{x:e.x-t.x,y:e.y-t.y}}function o9({point:e},t){return{point:e,delta:ARe(e,_st(t)),offset:ARe(e,tGn(t)),velocity:nGn(t,.1)}}function tGn(e){return e[0]}function _st(e){return e[e.length-1]}function nGn(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=_st(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>sc(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&s.timestamp-r.timestamp>sc(t)*2&&(r=e[1]);const i=Qu(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 rGn(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 IRe(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 sGn(e,{top:t,left:n,bottom:r,right:s}){return{x:IRe(e.x,n,s),y:IRe(e.y,t,r)}}function MRe(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 iGn(e,t){return{x:MRe(e.x,t.x),y:MRe(e.y,t.y)}}function oGn(e,t){let n=.5;const r=ml(e),s=ml(t);return s>r?n=rE(t.min,t.max-r,e.min):r>s&&(n=rE(e.min,e.max-s,t.min)),Nf(0,1,n)}function aGn(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 Ote=.35;function lGn(e=Ote){return e===!1?e=0:e===!0&&(e=Ote),{x:QRe(e,"left","right"),y:QRe(e,"top","bottom")}}function QRe(e,t,n){return{min:DRe(e,t),max:DRe(e,n)}}function DRe(e,t){return typeof e=="number"?e:e[t]||0}const cGn=new WeakMap;class uGn{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(aA(p).point),this.stopAnimation()},o=(p,f)=>{const{drag:h,dragPropagation:m,onDragStart:g}=this.getProps();if(h&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=qqn(h),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Up(b=>{let y=this.getAxisMotionValue(b).get()||0;if(vf.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}),g&&Es.update(()=>g(p,f),!1,!0),cte(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:g,onDrag:_}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:b}=f;if(m&&this.currentDirection===null){this.currentDirection=pGn(b),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,b),this.updateAxis("y",f.point,b),this.visualElement.render(),_&&Es.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 Ost(t,{onSessionStart:i,onStart:o,onMove:a,onSessionEnd:c,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:gst(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&&Es.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=rGn(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&&mS(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=sGn(r.layoutBox,t):this.constraints=!1,this.elastic=lGn(n),s!==this.constraints&&!mS(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&Up(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=aGn(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!mS(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=_6n(r,s.root,this.visualElement.getTransformPagePoint());let o=iGn(s.layout.layoutBox,i);if(n){const a=n(m6n(o));this.hasMutatedConstraints=!!a,a&&(o=Drt(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=Up(d=>{if(!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 cte(this.visualElement,t),r.start(Zce(t,r,0,n,this.visualElement,!1))}stopAnimation(){Up(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Up(n=>{const{drag:r}=this.getProps();if(!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(!mS(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Up(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const c=a.get();s[o]=oGn({min:c,max:c},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),Up(o=>{if(!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;cGn.set(this.visualElement,this);const t=this.visualElement.current,n=eR(t,"pointerdown",l=>{const{drag:d,dragListener:p=!0}=this.getProps(),f=l.target,h=f!==t&&Jqn(f);d&&p&&!h&&this.start(l)});let r;const s=()=>{const{dragConstraints:l}=this.getProps();mS(l)&&l.current&&(this.constraints=this.resolveRefConstraints(),r||(r=dGn(t,l.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Es.read(s);const a=o$(window,"resize",()=>this.scalePositionWithinConstraints()),c=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:d})=>{this.isDragging&&d&&(Up(p=>{const f=this.getAxisMotionValue(p);f&&(this.originPoint[p]+=l[p].translate,f.set(f.get()+l[p].translate))}),this.visualElement.render())});return()=>{a(),n(),o(),c&&c(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=Ote,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function LRe(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function dGn(e,t,n){const r=qCe(e,LRe(n)),s=qCe(t,LRe(n));return()=>{r(),s()}}function KM(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function pGn(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class fGn extends j_{constructor(t){super(t),this.removeGroupControls=qu,this.removeListeners=qu,this.controls=new uGn(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||qu}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 a9=e=>(t,n)=>{e&&Es.update(()=>e(t,n),!1,!0)};class hGn extends j_{constructor(){super(...arguments),this.removePointerDownListener=qu}onPointerDown(t){this.session=new Ost(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:gst(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:a9(t),onStart:a9(n),onMove:a9(r),onEnd:(i,o)=>{delete this.session,s&&Es.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=eR(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 l9=!1;class mGn extends O.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),l9&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),sD.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}),l9=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==i?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||Es.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(),rue.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;l9=!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 bst(e){const[t,n]=SWn(),r=O.useContext(wnt);return u.jsx(mGn,{...e,layoutGroup:r,switchLayoutGroup:O.useContext(hst),isPresent:t,safeToRemove:n})}const gGn={pan:{Feature:hGn},drag:{Feature:fGn,ProjectionNode:ast,MeasureLayout:bst}};function jRe(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&&Es.postRender(()=>i(t,aA(t)))}class OGn extends j_{mount(){const{current:t}=this.node;t&&(this.unmount=Gqn(t,(n,r)=>(jRe(this.node,r,"Start"),s=>jRe(this.node,s,"End"))))}unmount(){}}class _Gn extends j_{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=sA(o$(this.node.current,"focus",()=>this.onFocus()),o$(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function XRe(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&&Es.postRender(()=>i(t,aA(t)))}class bGn extends j_{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=t6n(t,(s,i)=>(XRe(this.node,i,"Start"),(o,{success:a})=>XRe(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:r?.tap===!1})}unmount(){}}const _te=new WeakMap,c9=new WeakMap,yGn=e=>{const t=_te.get(e.target);t&&t(e)},xGn=e=>{e.forEach(yGn)};function SGn({root:e,...t}){const n=e||document;c9.has(n)||c9.set(n,{});const r=c9.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(xGn,{root:e,...t})),r[s]}function vGn(e,t,n){const r=SGn(t);return _te.set(e,n),r.observe(e),()=>{_te.delete(e),r.unobserve(e)}}const TGn={some:0,all:1};class EGn extends j_{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:TGn[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=vGn(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(wGn(t,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function wGn({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const kGn={inView:{Feature:EGn},tap:{Feature:bGn},focus:{Feature:_Gn},hover:{Feature:OGn}},CGn={layout:{ProjectionNode:ast,MeasureLayout:bst}},RGn={...KWn,...kGn,...gGn,...CGn},Am=qWn(RGn,WWn);function bte(e){const t=Mce(()=>h_(e)),{isStatic:n}=O.useContext(uue);if(n){const[,r]=O.useState(e);O.useEffect(()=>t.on("change",r),[])}return t}function yst(e,t){const n=bte(t()),r=()=>n.set(t());return r(),knt(()=>{const s=()=>Es.preRender(r,!1,!0),i=e.map(o=>o.on("change",s));return()=>{i.forEach(o=>o()),Nm(r)}}),n}function PGn(e){KC.current=[],e();const t=yst(KC.current,e);return KC.current=void 0,t}function GS(e,t,n,r){if(typeof e=="function")return PGn(e);const i=typeof t=="function"?t:tD(t,n,r),o=Array.isArray(e)?URe(e,i):URe([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 URe(e,t){const n=Mce(()=>[]);return yst(e,()=>{n.length=0;const r=e.length;for(let s=0;s<r;s++)n[s]=e[s].get();return t(n)})}function $Gn(){!aue.current&&Art();const[e]=O.useState(wX.current);return e}function fue(e){return typeof e=="object"&&!Array.isArray(e)}function xst(e,t,n,r){return e==null?[]:typeof e=="string"&&fue(t)?nue(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(s=>s!=null):[e]}function NGn(e,t,n){return e*(t+1)}function zRe(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 AGn(e,t,n){for(let r=0;r<e.length;r++){const s=e[r];s.at>t&&s.at<n&&(nE(e,s),r--)}}function IGn(e,t,n,r,s,i){AGn(e,s,i);for(let o=0;o<t.length;o++)e.push({value:t[o],at:js(s,i,r[o]),easing:Bnt(n,o)})}function MGn(e,t){for(let n=0;n<e.length;n++)e[n]=e[n]/(t+1)}function QGn(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}const DGn="easeInOut";function LGn(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,zRe(p,m.at,d,l));continue}let[g,_,b={}]=m;b.at!==void 0&&(p=zRe(p,b.at,d,l));let y=0;const x=(S,v,T,E=0,w=0)=>{const P=jGn(S),{delay:C=0,times:k=irt(P),type:I=t.type||"keyframes",repeat:Q,repeatType:$,repeatDelay:R=0,...N}=v;let{ease:j=t.ease||"easeOut",duration:M}=v;const U=typeof C=="function"?C(E,w):C,A=P.length,F=Gce(I)?I:s?.[I||"keyframes"];if(A<=2&&F){let q=100;if(A===2&&zGn(P)){const H=P[1]-P[0];q=Math.abs(H)}const ee={...t,...N};M!==void 0&&(ee.duration=sc(M));const te=trt(ee,q,F);j=te.ease,M=te.duration}M??(M=i);const z=p+U;k.length===1&&k[0]===0&&(k[1]=1);const D=k.length-P.length;if(D>0&&srt(k,D),P.length===1&&P.unshift(null),Q){M=NGn(M,Q);const q=[...P],ee=[...k];j=Array.isArray(j)?[...j]:[j];const te=[...j];for(let H=0;H<Q;H++){P.push(...q);for(let G=0;G<q.length;G++)k.push(ee[G]+(H+1)),j.push(G===0?"linear":Bnt(te,G-1))}MGn(k,Q)}const V=z+M;IGn(T,P,j,k,z,V),y=Math.max(U+M,y),f=Math.max(V,f)};if(ho(g)){const S=BRe(g,a);x(_,b,FRe("default",S))}else{const S=xst(g,_,r,c),v=S.length;for(let T=0;T<v;T++){_=_,b=b;const E=S[T],w=BRe(E,a);for(const P in _)x(_[P],XGn(b,P),FRe(P,w),T,v)}}d=p,p+=y}return a.forEach((h,m)=>{for(const g in h){const _=h[g];_.sort(QGn);const b=[],y=[],x=[];for(let E=0;E<_.length;E++){const{at:w,value:P,easing:C}=_[E];b.push(P),y.push(rE(0,f,w)),x.push(C||"easeOut")}y[0]!==0&&(y.unshift(0),b.unshift(b[0]),x.unshift(DGn)),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[g]=b;const{type:v,...T}=t;S.transition[g]={...T,duration:f,ease:x,times:y,...n}}}),o}function BRe(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function FRe(e,t){return t[e]||(t[e]=[]),t[e]}function jGn(e){return Array.isArray(e)?e:[e]}function XGn(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}const UGn=e=>typeof e=="number",zGn=e=>e.every(UGn);function BGn(e){const t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=LB(e)&&!$rt(e)?new Wrt(t):new Brt(t);n.mount(e),s$.set(e,n)}function FGn(e){const t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new E6n(t);n.mount(e),s$.set(e,n)}function YGn(e,t){return ho(e)||typeof e=="number"||typeof e=="string"&&!fue(t)}function Sst(e,t,n,r){const s=[];if(YGn(e,t))s.push(rst(e,fue(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return s;const i=xst(e,t,r),o=i.length;for(let a=0;a<o;a++){const c=i[a],l=c instanceof Element?BGn:FGn;s$.has(c)||l(c);const d=s$.get(c),p={...n};"delay"in p&&typeof p.delay=="function"&&(p.delay=p.delay(a,o)),s.push(...eue(d,{...t,transition:p},{}))}}return s}function VGn(e,t,n){const r=[],s=e.map(o=>{if(Array.isArray(o)&&typeof o[0]=="function"){const a=o[0],c=h_(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 LGn(s,t,n,{spring:r$}).forEach(({keyframes:o,transition:a},c)=>{r.push(...Sst(c,o,a))}),r}function qGn(e){return Array.isArray(e)&&e.some(Array.isArray)}function WGn(e={}){const{scope:t,reduceMotion:n}=e;function r(s,i,o){let a=[],c;if(qGn(s)){const{onComplete:d,...p}=i||{};typeof d=="function"&&(c=d),a=VGn(s,n!==void 0?{reduceMotion:n,...p}:p,t)}else{const{onComplete:d,...p}=o||{};typeof d=="function"&&(c=d),a=Sst(s,i,n!==void 0?{reduceMotion:n,...p}:p,t)}const l=new mqn(a);return c&&l.finished.then(c),t&&(t.animations.push(l),l.finished.then(()=>{nE(t.animations,l)})),l}return r}const Dw=WGn();function YRe(e,t){let n;return(...r)=>{window.clearTimeout(n),n=window.setTimeout(()=>e(...r),t)}}function GGn({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]=O.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),a=O.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=O.useRef(!1);O.useEffect(()=>(d.current=!0,()=>void(d.current=!1)));const[p,f,h]=O.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(),C={left:y,top:x,width:S,height:v,bottom:T,right:E,x:w,y:P};a.current.element instanceof HTMLElement&&r&&(C.height=a.current.element.offsetHeight,C.width=a.current.element.offsetWidth),Object.freeze(C),d.current&&!JGn(a.current.lastBounds,C)&&o(a.current.lastBounds=C)};return[b,l?YRe(b,l):b,c?YRe(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 g(){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=vst(b),g())};return ZGn(h,!!t),HGn(f),O.useEffect(()=>{m(),g()},[t,h,f]),O.useEffect(()=>m,[]),[_,i,p]}function HGn(e){O.useEffect(()=>{const t=e;return window.addEventListener("resize",t),()=>void window.removeEventListener("resize",t)},[e])}function ZGn(e,t){O.useEffect(()=>{if(t){const n=e;return window.addEventListener("scroll",n,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",n,!0)}},[e,t])}function vst(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,...vst(e.parentElement)]}const KGn=["x","y","top","bottom","left","right","width","height"],JGn=(e,t)=>KGn.every(n=>e[n]===t[n]);var Tst=O.createContext(void 0),Est=O.createContext(void 0);function lA(){const e=O.useContext(Tst);if(!e)throw new Error("Sheet context error");return e}function e8n(){const e=O.useContext(Est);if(!e)throw new Error("Sheet context error");return e}var VRe="calc(100% - env(safe-area-inset-top) - 34px)",a$=typeof window>"u",t8n={ease:"easeOut",duration:.2},n8n={ease:"linear",duration:.01},r8n=.6,s8n=1200,hue=a$?O.useEffect:O.useLayoutEffect;function i8n(){const[e,t]=O.useState(()=>({windowHeight:a$?0:window.innerHeight,windowWidth:a$?0:window.innerWidth}));return hue(()=>{function n(){t({windowHeight:window.innerHeight,windowWidth:window.innerWidth})}return n(),window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n)}},[]),e}function Im(e,t){return t?e.base:{...e.base,...e.decorative}}function o8n(e){for(let t=0;t<e.length;t++)if(e[t+1]<e[t])return!1;return!0}function $X(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n&&(n.current=t)})}}function mue(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 zB(e){let t=null;return()=>(t==null&&(t=e()),t)}var a8n=zB(function(){return mue(/^Mac/i)}),l8n=zB(function(){return mue(/^iPhone/i)}),c8n=zB(function(){return mue(/^iPad/i)||a8n()&&navigator.maxTouchPoints>1}),u8n=zB(function(){return l8n()||c8n()});function d8n(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 p8n=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Sy(e){return e instanceof HTMLInputElement&&!p8n.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function wst(){return typeof window<"u"&&window.isSecureContext}function kst(e,t,n){return Math.min(Math.max(e,t),n)}function Do(e){const t=O.useRef(void 0);return hue(()=>{t.current=e}),O.useCallback((...n)=>{const r=t.current;return r?.(...n)},[])}var Lw=0,u9=null;function f8n(e={}){const{containerRef:t,isEnabled:n=!0,debounceDelay:r=100,visualViewportThreshold:s=100}=e,[i,o]=O.useState({isVisible:!1,height:0}),a=O.useRef(null),c=O.useRef(null);return O.useEffect(()=>{const l=window.visualViewport,d=h8n();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=d9()??a.current;if(!(b?Sy(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 g(b){b.target instanceof HTMLElement&&Sy(b.target)&&(a.current=b.target,m())}function _(){requestAnimationFrame(()=>{a.current=d9(),m()})}return document.addEventListener("focusin",g),document.addEventListener("focusout",_),l&&(l.addEventListener("resize",m),l.addEventListener("scroll",m)),d&&(Lw===0&&(u9=d.overlaysContent,d.overlaysContent=!0),Lw++,d.addEventListener("geometrychange",m)),a.current=d9(),m(),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",_),l&&(l.removeEventListener("resize",m),l.removeEventListener("scroll",m)),d&&(d.removeEventListener("geometrychange",m),Lw=Math.max(0,Lw-1),Lw===0&&(d.overlaysContent=u9??!1,u9=null)),c.current&&clearTimeout(c.current),h()}},[r,n,s]),{keyboardHeight:i.height,isKeyboardOpen:i.isVisible}}function h8n(){return wst()&&"virtualKeyboard"in navigator?navigator.virtualKeyboard:null}function d9(){var e;let t=document.activeElement;for(;t instanceof HTMLElement&&((e=t.shadowRoot)!=null&&e.activeElement);)t=t.shadowRoot.activeElement;return t&&Sy(t)?t:null}function m8n({isEnabled:e,containerRef:t,onWillOpenKeyboard:n,onDidOpenKeyboard:r}){const[s,i]=O.useState(null),o=f8n({isEnabled:e,containerRef:t}),a=Do(async l=>{var d;const p=l.target;Sy(p)&&((d=t.current)!=null&&d.contains(p))&&(await n?.(l),i(p))}),c=Do(l=>{const d=l.target;s===d&&i(null)});return O.useEffect(()=>{if(e)return document.addEventListener("focusin",a),document.addEventListener("focusout",c),()=>{document.removeEventListener("focusin",a),document.removeEventListener("focusout",c)}},[e]),O.useEffect(()=>{const l=t.current;!e||!s||!l||!o.isKeyboardOpen||requestAnimationFrame(()=>{r?.(s)})},[e,o.isKeyboardOpen,s]),o}function g8n(){const[e]=O.useState(()=>{const t={top:0,left:0,right:0,bottom:0};if(a$)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 O8n({y:e,detent:t,rootId:n,sheetHeight:r,snapPoints:s,startThreshold:i}){const o=g8n().top;let a=n;a&&t==="full"&&(console.warn('Using "full" detent with modal effect is not supported.'),a=void 0);const c=Do(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;b8n(a,{scale:tD(p,[0,1],[1,(h-16)/h]),translateY:tD(p,[0,1],[0,24+o]),borderRadius:tD(p,[0,1],[0,10])})}),l=Do(()=>{a&&e.get()+5>=r&&qRe(a)});O.useEffect(()=>{if(!a)return;const d=e.on("animationStart",()=>{a&&_8n(a)}),p=e.on("change",m=>{c(m)}),f=e.on("animationComplete",l),h=e.on("animationCancel",l);return()=>{a&&qRe(a),d(),p(),f(),h()}},[a])}function _8n(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 b8n(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 qRe(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 y8n=24;function yte(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}var p9=typeof document<"u"&&window.visualViewport;function WRe(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 Cst(e,t){let n=e;for(WRe(n,t)&&(n=n.parentElement);n&&!WRe(n,t);)n=n.parentElement;return n||document.scrollingElement||document.documentElement}var eQ=0,tQ;function x8n(e={}){const{isDisabled:t}=e;hue(()=>{if(!t)return eQ++,eQ===1&&(u8n()?tQ=v8n():tQ=S8n()),()=>{eQ--,eQ===0&&tQ?.()}},[t])}function S8n(){return yte(tR(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`),tR(document.documentElement,"overflow","hidden"))}function v8n(){let e,t=0;const n=p=>{var f;const h=(f=p.composedPath())==null?void 0:f[0];e=Cst(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];Sy(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];Sy(h)&&(h.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{h.style.transform="",p9&&(p9.height<window.innerHeight?requestAnimationFrame(()=>{GRe(h)}):p9.addEventListener("resize",()=>GRe(h),{once:!0}))}))},o=()=>{window.scrollTo(0,0)},a=window.pageXOffset,c=window.pageYOffset,l=yte(tR(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`),tR(document.documentElement,"overflow","hidden"),tR(document.body,"marginTop",`-${c}px`));window.scrollTo(0,0);const d=yte(jw(document,"touchstart",n,{passive:!1,capture:!0}),jw(document,"touchmove",r,{passive:!1,capture:!0}),jw(document,"touchend",s,{passive:!1,capture:!0}),jw(document,"focus",i,!0),jw(window,"scroll",o));return()=>{l(),d(),window.scrollTo(a,c)}}function tR(e,t,n){const r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function jw(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function GRe(e){const t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){const n=Cst(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+y8n;i>o&&(n.scrollTop+=s-r)}e=n.parentElement}}function T8n({isOpen:e,onClosed:t,onOpening:n,onOpen:r,onClosing:s}){const[i,o]=O.useState(e?"opening":"closed"),a=Do(()=>t?.()),c=Do(()=>n?.()),l=Do(()=>r?.()),d=Do(()=>s?.());return O.useEffect(()=>{e&&i==="closed"?o("opening"):!e&&(i==="open"||i==="opening")&&o("closing")},[e,i]),O.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 E8n({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(o8n(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 f9(e){return e>0?1:e<0?-1:0}function NX(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 HRe(e,t){const n=NX(e);for(let r=n.length-1;r>=0;r--)if(n[r].snapValueY<t)return n[r];return null}function ZRe(e,t){const n=NX(e);for(let r=0;r<n.length;r++)if(n[r].snapValueY>t)return n[r];return null}function w8n({offsetY:e,velocityY:t,deltaY:n}){if(Math.abs(t)>50)return f9(t);const r=f9(e);return r!==0?r:f9(n)}function k8n({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,g=t.delta.y,_=t.velocity.y,b=kst(e+_*l,f,h),y=Math.abs(_),x=w8n({offsetY:m,velocityY:_,deltaY:g}),S=y>a,v=y>o;if(r.length===0){if(v)return{yTo:x<0?f:h,snapIndex:void 0};const $=f+(h-f)*i;return{yTo:b<$?f:h,snapIndex:void 0}}const T=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 $=x<0?f:h,R=nQ(r,$);return{yTo:$,snapIndex:R.snapIndex}}if(v){const $=x<0?HRe(r,e):ZRe(r,e),R=x<0?f:h,N=nQ(r,R),j=$??N;return{yTo:j.snapValueY,snapIndex:j.snapIndex}}const E=NX(r)[0],w=NX(r)[r.length-1],P=HRe(r,e)??E,C=ZRe(r,e)??w;if(P.snapIndex===C.snapIndex)return{yTo:P.snapValueY,snapIndex:P.snapIndex};const k=C.snapValueY-P.snapValueY,I=k>0?(e-P.snapValueY)/k:0;let Q=T;if(x>0?Q=I>c?C:P:x<0&&(Q=I<1-c?P:C),y>200){const $=nQ(r,b);Math.abs($.snapValueY-e)<Math.abs(Q.snapValueY-e)&&(Q=$)}return{yTo:Q.snapValueY,snapIndex:Q.snapIndex}}var Mm={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:{}}},Rst=O.forwardRef(({avoidKeyboard:e=!0,children:t,className:n="",detent:r="default",disableDismiss:s=!1,disableDrag:i=!1,disableScrollLocking:o=!1,dragCloseThreshold:a=r8n,dragVelocityThreshold:c=s8n,initialSnap:l,isOpen:d,modalEffectRootId:p,modalEffectThreshold:f,mountPoint:h,prefersReducedMotion:m=!1,snapPoints:g,style:_,tweenConfig:b=t8n,unstyled:y=!1,onOpenStart:x,onOpenEnd:S,onClose:v,onCloseStart:T,onCloseEnd:E,onSnap:w,onDrag:P,onDragStart:C,onDragEnd:k,...I},Q)=>{const[$,R]=GGn(),N=O.useRef(null),j=Math.round(R.height),[M,U]=O.useState(l),{windowHeight:A}=i8n(),F=j>0?j:A,z=bte(F),D=GS(z,J=>Math.max(j-J,0)),V=GS(z,J=>kst(1-J/F,0,1)),q=bte(0),ee=$Gn(),H={type:"tween",...!!(m||ee)?n8n:b},G=GS(z,J=>J+2>=F?-1:_?.zIndex??9999),ie=GS(z,J=>J+2>=F?"hidden":"visible"),ne=O.useMemo(()=>g&&j>0?E8n({sheetHeight:j,snapPointsProp:g}):[],[j,g?.join("")]),pe=Do(J=>{U(J),w?.(J)}),Te=Do(J=>g&&ne?J<0||J>=ne.length?(console.warn(`Invalid snap index ${J}. Snap points are: [${g.join(", ")}] and their computed values are: [${ne.map(de=>de.snapValue).join(", ")}]`),null):ne[J]:null),_e=Do(async J=>{if(!g){console.warn("Snapping is not possible without `snapPoints` prop.");return}const de=Te(J);if(de===null){console.warn(`Invalid snap index ${J}.`);return}if(J===0){v();return}await Dw(z,de.snapValueY,{...H,onComplete:()=>pe(J)})}),Ie=m8n({isEnabled:d&&e,containerRef:N,onWillOpenKeyboard:async()=>{const J=ne[ne.length-1];J&&J.snapIndex!==M&&(await Dw(z,J.snapValueY,H),pe(J.snapIndex))},onDidOpenKeyboard:J=>{const de=N.current;if(!de)return;const ue=J.getBoundingClientRect(),ae=de.getBoundingClientRect(),$e=de.querySelector(".react-modal-sheet-content-scroller"),qe=Math.max(ue.top-ae.top+$e.scrollTop-ue.height,0);requestAnimationFrame(()=>{$e.scrollTo({top:qe,behavior:"smooth"})})}}).isKeyboardOpen||i,Se=Do(()=>{var J;const de=document.activeElement;de&&Sy(de)&&((J=N.current)!=null&&J.contains(de))&&de.blur()}),oe=Do((J,de)=>{Se(),C?.(J,de)}),Oe=Do((J,de)=>{P?.(J,de);const ue=z.get(),ae=z.getVelocity();ae>0&&q.set(10),ae<0&&q.set(-10),z.set(Math.max(ue+de.delta.y,0))}),K=Do((J,de)=>{Se(),k?.(J,de);const ue=z.get(),ae=k8n({y:ue,info:de,sheetHeight:j,dragCloseThreshold:a,snapPoints:ne,dragVelocityThreshold:c});let $e=ae.yTo;if(s&&$e+1>=j){const qe=ne.find(ot=>ot.snapValue>0);qe?($e=qe.snapValueY,pe(qe.snapIndex)):$e=ue}else ae.snapIndex!==void 0&&pe(ae.snapIndex);Dw(z,$e,H),$e+1>=j&&!s&&v(),q.set(0)});O8n({y:z,detent:r,sheetHeight:j,snapPoints:ne,rootId:p,startThreshold:f}),x8n({isDisabled:o||!d});const Y=T8n({isOpen:d,onOpen:async()=>{x?.(),await d8n("react-modal-sheet-container");const J=l!==void 0?Te(l):null,de=J?.snapValueY??0;await Dw(z,de,H),l!==void 0&&pe(l),S?.()},onClosing:async()=>{T?.(),await Dw(z,F,H),E?.()}}),se={currentSnap:M,detent:r,disableDrag:Ie,dragProps:{drag:"y",dragElastic:0,dragMomentum:!1,dragPropagation:!1,onDrag:Oe,onDragStart:oe,onDragEnd:K},indicatorRotation:q,avoidKeyboard:e,prefersReducedMotion:m,sheetBoundsRef:$,sheetRef:N,unstyled:y,yProgress:V,y:z},he={height:j,currentSnap:M,snapPoints:ne,snapTo:_e,y:z,yInverted:D,yProgress:V};O.useImperativeHandle(Q,()=>he);const we=Je.createElement(Tst.Provider,{value:se},Je.createElement(Am.div,{...I,ref:Q,"data-sheet-state":Y,className:`react-modal-sheet-root ${n}`,style:{...Im(Mm.root,y),zIndex:G,visibility:ie,..._}},Je.createElement(Est.Provider,{value:he},Y!=="closed"?t:null)));return a$?we:Ti.createPortal(we,h??document.body)});Rst.displayName="Sheet";var C8n=e=>!!e.onClick||!!e.onTap,Pst=O.forwardRef(({style:e,className:t="",unstyled:n,...r},s)=>{const i=lA(),o=C8n(r),a=o?Am.button:Am.div,c=o?"auto":"none",l=n??i.unstyled,d={opacity:i.yProgress,...Im(Mm.backdrop,l),...e,pointerEvents:c};return Je.createElement(a,{...r,ref:s,className:`react-modal-sheet-backdrop ${t}`,style:d})});Pst.displayName="SheetBackdrop";var $st=O.forwardRef(({children:e,style:t,className:n="",unstyled:r,...s},i)=>{const o=lA(),a=r??o.unstyled,c={...Im(Mm.container,a),...t,y:o.y};return o.detent==="default"&&(c.height=VRe),o.detent==="full"&&(c.height="100%",c.maxHeight="100%"),o.detent==="content"&&(c.height="auto",c.maxHeight=VRe),Je.createElement(Am.div,{...s,ref:$X([i,o.sheetRef,o.sheetBoundsRef]),className:`react-modal-sheet-container ${n}`,style:c},e)});$st.displayName="SheetContainer";var R8n={bottom:0,top:0,left:0,right:0};function Nst(){const e=O.useRef(null),t=O.useCallback(()=>R8n,[]);return{ref:e,onMeasure:t}}function P8n(e={}){const{debounceDelay:t=32,isEnabled:n=!0}=e,r=O.useRef(null),[s,i]=O.useState(null),[o,a]=O.useState(void 0),c=O.useMemo(()=>f=>{i(f)},[]),l=Do(f=>{const{scrollTop:h,scrollHeight:m,clientHeight:g}=f;if(!(m>g)){o&&a(void 0);return}const b=h<=0,y=Math.ceil(m)-Math.ceil(h)===Math.ceil(g);let x;b?x="top":y?x="bottom":x="middle",f.style.touchAction=b?"pan-down":"",x!==o&&a(x)}),d=Do(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=Do(f=>{if(f.currentTarget instanceof HTMLElement){const h=f.currentTarget;requestAnimationFrame(()=>{l(h)})}});return O.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 Ast=O.forwardRef(({disableScroll:e,disableDrag:t,children:n,style:r,className:s="",scrollClassName:i="",scrollStyle:o,scrollRef:a=null,unstyled:c,...l},d)=>{const p=lA(),f=Nst(),h=P8n({isEnabled:typeof e=="function"?!0:!e}),m=typeof e=="function"?e({scrollPosition:h.scrollPosition,currentSnap:p.currentSnap}):!!e,g=!m&&h.scrollPosition&&h.scrollPosition!=="top",y=(typeof t=="function"?t({scrollPosition:h.scrollPosition,currentSnap:p.currentSnap}):!!t)||g||p.disableDrag||p.disableDrag?void 0:p.dragProps,x=c??p.unstyled,S={...Im(Mm.content,x),...r},v=Im(Mm.scroller,x);return p.avoidKeyboard&&(v.paddingBottom=wst()?"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(Am.div,{...l,ref:$X([d,f.ref]),className:`react-modal-sheet-content ${s}`,style:S,...y,dragConstraints:f.ref,onMeasureDragConstraints:f.onMeasure},Je.createElement(Am.div,{ref:$X([h.scrollRef,a]),style:{...v,...o},className:`react-modal-sheet-content-scroller ${i}`},n))});Ast.displayName="SheetContent";function Ist({style:e,className:t="",unstyled:n,...r}){const s=lA(),i=GS(s.indicatorRotation,d=>`translateX(2px) rotate(${d}deg)`),o=GS(s.indicatorRotation,d=>`translateX(-2px) rotate(${-1*d}deg)`),a=n??s.unstyled,c={...Im(Mm.indicatorWrapper,a),...e},l=Im(Mm.indicator,a);return Je.createElement("div",{className:`react-modal-sheet-drag-indicator-container ${t}`,style:c,...r},Je.createElement(Am.span,{className:"react-modal-sheet-drag-indicator",style:{...l,transform:i}}),Je.createElement(Am.span,{className:"react-modal-sheet-drag-indicator",style:{...l,transform:o}}))}var Mst=O.forwardRef(({children:e,style:t,disableDrag:n,unstyled:r,className:s="",...i},o)=>{const a=lA(),c=Nst(),l=n||a.disableDrag?void 0:a.dragProps,d=r??a.unstyled,p={...Im(Mm.headerWrapper,d),...t},f=Im(Mm.header,d);return Je.createElement(Am.div,{...i,ref:$X([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(Ist,null)))});Mst.displayName="SheetHeader";var Xw=Object.assign(Rst,{Container:$st,Header:Mst,DragIndicator:Ist,Content:Ast,Backdrop:Pst,useContext:e8n});const $8n="team-msg-expanded:";function gue(e){return`${$8n}${e}`}function AX(e){try{const t=localStorage.getItem(gue(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 N8n(e,t){try{const n=AX(e);if(n.has(t))return;n.add(t),localStorage.setItem(gue(e),JSON.stringify([...n]))}catch{}}function A8n(e,t){try{const n=AX(e);if(!n.has(t))return;n.delete(t),localStorage.setItem(gue(e),JSON.stringify([...n]))}catch{}}function I8n(e){const[t,n]=O.useState(0),r=O.useMemo(()=>t<0?new Set:e?AX(e):new Set,[e,t]),s=O.useCallback(i=>{if(!e)return;AX(e).has(i)?A8n(e,i):N8n(e,i),n(a=>a+1)},[e]);return{expandedSet:r,toggle:s}}function M8n(e){for(let t=0;t<e.length;t++)if(e[t]?.type==="message")return t;return-1}function Q8n({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 D8n=.15,rQ=30,L8n=400,j8n=[],X8n=new Map,KRe="default",U8n=8,z8n=4,B8n=60,F8n={"session-separator":135,"compaction-divider":50,"lead-thought-group":220,"message-row":140};function Y8n(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 JRe(e){if(e.type==="lead-thoughts")return e.group.thoughts[0]?.leadSessionId}const V8n=({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(yR,{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}})]}),q8n=({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:g,collapseMode:_,isCollapsed:b,canToggleCollapse:y,collapseToggleKey:x,onToggleCollapse:S,compactHeader:v,teamNames:T,teamColorByName:E,onTeamClick:w,onExpand:P,expandItemKey:C,onExpandContent:k,observerRoot:I})=>{const Q=O.useRef(null),$=O.useRef(!1),R=O.useRef(e),N=O.useRef(h);return O.useEffect(()=>{R.current=e,N.current=h},[e,h]),O.useEffect(()=>{if(!h)return;const j=Q.current;if(!j)return;const M=I?.current??null,U=new IntersectionObserver(([A])=>{if(!A?.isIntersecting||$.current)return;const F=N.current,z=R.current;F&&($.current=!0,F(z))},{root:M,threshold:D8n,rootMargin:"0px"});return U.observe(j),()=>U.disconnect()},[h,I]),u.jsx($le,{animate:o,containerRef:Q,children:u.jsx(WN,{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:g,collapseMode:_,isCollapsed:b,canToggleCollapse:y,collapseToggleKey:x,onToggleCollapse:S,compactHeader:v,teamNames:T,teamColorByName:E,onTeamClick:w,onExpand:P,expandItemKey:C,onExpandContent:k})})},W8n=Je.memo(q8n,(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&&VN(e.teamNames,t.teamNames)&&qN(e.teamColorByName,t.teamColorByName)&&e.onTeamClick===t.onTeamClick&&e.onExpand===t.onExpand&&e.expandItemKey===t.expandItemKey&&e.onExpandContent===t.onExpandContent&&e.observerRoot===t.observerRoot&&JZe(e.message,t.message)),h9=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:g,leadActivity:_,leadContextUpdatedAt:b,teamNames:y=j8n,teamColorByName:x=X8n,onTeamClick:S,onExpandItem:v,onExpandContent:T,viewport:E}){const w=E?.observerRoot??E?.scrollElementRef,[P,C]=O.useState(rQ),k=O.useRef(null),[I,Q]=O.useState(!1);O.useEffect(()=>{const oe=k.current;if(!oe)return;const Oe=Y=>{Q(W=>{const se=Y<L8n;return W===se?W:se})};Oe(oe.getBoundingClientRect().width);const K=new ResizeObserver(Y=>{const W=Y[0];W&&Oe(W.contentRect.width)});return K.observe(oe),()=>K.disconnect()},[]);const $=O.useMemo(()=>YN(r),[r]),{colorMap:R,localMemberNames:N,memberInfo:j}=$,M=O.useCallback(oe=>{const Oe=r?.find(K=>K.name===oe||K.agentType===oe);Oe&&a?.(Oe)},[r,a]),{visibleMessages:U,hiddenCount:A}=O.useMemo(()=>{const oe=t.length;if(oe===0)return{visibleMessages:t,hiddenCount:0};let Oe=0,K=oe;for(let se=0;se<oe;se++)if(!mee(t[se])&&(Oe++,Oe>P)){K=se;break}const Y=Oe+(K<oe?t.slice(K).filter(se=>!mee(se)).length:0),W=Math.max(0,Y-P);return{visibleMessages:K<oe?t.slice(0,K):t,hiddenCount:W}},[t,P]),F=O.useMemo(()=>rKe(U),[U]),z=O.useMemo(()=>{const oe=new Set;let Oe=0;for(let K=F.length-1;K>=0;K--){const Y=F[K];if(Y.type==="lead-thoughts")Oe%2===1&&oe.add(K),Oe++;else{if(lQn(Y.message.text)||hee(Y.message))continue;Oe%2===1&&oe.add(K),Oe++}}return oe},[F]),D=O.useMemo(()=>{const oe=Oe=>Oe.type==="lead-thoughts"?Ev(Oe.group):Ls(Oe.message);return F.map(oe)},[F]),V=I7e({itemKeys:D,paginationKey:P,resetKey:n});O.useEffect(()=>{},[n,D]);const q=()=>{C(oe=>oe+rQ)},ee=()=>{C(1/0)},te=O.useMemo(()=>{const oe=[];let Oe;for(const K of F){oe.push(Oe);const Y=JRe(K);Y&&(Oe=Y)}return oe},[F]),H=F[0]?.type==="lead-thoughts"?F[0]:null,G=H?1:0,ie=O.useMemo(()=>{const oe=[];H&&oe.push({kind:"lead-thought-group",key:Ev(H.group),itemIndex:0,group:H.group,isPinned:!0});for(let Oe=G;Oe<F.length;Oe+=1){const K=F[Oe];if(Oe>0){const W=JRe(K),se=te[Oe];se&&W&&se!==W&&oe.push({kind:"session-separator",key:`session-separator-${Oe}-${se}->${W}`})}if(K.type==="lead-thoughts"){oe.push({kind:"lead-thought-group",key:Ev(K.group),itemIndex:Oe,group:K.group,isPinned:!1});continue}const Y=K.message;if(hee(Y)){oe.push({kind:"compaction-divider",key:`compaction-${Ls(Y)}`,message:Y});continue}oe.push({kind:"message-row",key:Ls(Y),itemIndex:Oe,message:Y})}return oe},[H,te,G,F]),ne=E?.virtualizationEnabled===!0&&E.scrollElementRef!=null&&ie.length>=B8n,[pe,Te]=O.useState(0);O.useLayoutEffect(()=>{if(!ne)return;const oe=E?.scrollElementRef?.current??null,Oe=k.current;if(!oe||!Oe)return;let K=!1,Y=null;const W=()=>{K||(K=!0,Y=requestAnimationFrame(()=>{Y=null,K=!1;const we=oe.getBoundingClientRect(),J=Oe.getBoundingClientRect(),de=Math.max(0,J.top-we.top+oe.scrollTop);Te(ue=>Math.abs(ue-de)<.5?ue:de)}))};W();const se=new ResizeObserver(W);return Y8n(Oe,oe).forEach(we=>se.observe(we)),window.addEventListener("resize",W),()=>{Y!==null&&cancelAnimationFrame(Y),se.disconnect(),window.removeEventListener("resize",W)}},[ne,E?.scrollElementRef]);const _e=kce({count:ne?ie.length:0,getScrollElement:()=>E?.scrollElementRef?.current??null,estimateSize:oe=>F8n[ie[oe]?.kind??"message-row"],getItemKey:oe=>ie[oe]?.key??`row-${oe}`,overscan:U8n,gap:z8n,scrollMargin:pe}),be=O.useMemo(()=>M8n(F),[F]),Ie=O.useCallback((oe,Oe)=>{const K=Q8n({allCollapsed:p,itemIndex:Oe,newestMessageIndex:be,isPinnedThoughtGroup:Oe===0&&H!=null,isExpandedOverride:f?.has(oe)??!1,onToggleOverride:h?()=>h(oe):void 0});return K.mode!==KRe?{collapseMode:K.mode,isCollapsed:K.isCollapsed,canToggleCollapse:K.canToggle,collapseToggleKey:K.canToggle?oe:void 0}:{collapseMode:KRe,isCollapsed:!1,canToggleCollapse:!1}},[p,be,H,f,h]),Se=(oe,Oe)=>{const K=Oe?.suppressEntryAnimation===!0;switch(oe.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"})]},oe.key);case"compaction-divider":return u.jsx(V8n,{message:oe.message},oe.key);case"lead-thought-group":{const{group:Y,itemIndex:W,isPinned:se,key:he}=oe,we=Y.thoughts[0],J=j.get(we.from),de=Ie(he,W),ue=se?m?we.leadSessionId===m:!0:!1;return u.jsx(CQn,{group:Y,memberColor:J?.color,canBeLive:ue,isTeamAlive:ue?g:void 0,leadActivity:ue?_:void 0,leadContextUpdatedAt:ue?b:void 0,isNew:!K&&V.has(he),onVisible:c,observerRoot:w,zebraShade:z.has(W),collapseMode:de.collapseMode,isCollapsed:de.isCollapsed,canToggleCollapse:de.canToggleCollapse,collapseToggleKey:de.collapseToggleKey,onToggleCollapse:h,onTaskIdClick:l,memberColorMap:R,onReply:o,compactHeader:I,teamNames:y,teamColorByName:x,onTeamClick:S,onExpand:I?v:void 0,expandItemKey:I?he:void 0},he)}case"message-row":{const{message:Y,itemIndex:W,key:se}=oe,he=dB(Y,$),we=Ie(se,W),J=s?!Y.read&&!s.readSet.has(s.getMessageKey(Y)):!Y.read;return u.jsx(W8n,{message:Y,teamName:n,memberRole:he.memberRole,memberColor:he.memberColor,recipientColor:he.recipientColor,isUnread:J,isNew:!K&&V.has(se),zebraShade:z.has(W),memberColorMap:R,localMemberNames:N,onMemberNameClick:a?M:void 0,onCreateTask:i,onReply:o,onVisible:c,onTaskIdClick:l,onRestartTeam:d,collapseMode:we.collapseMode,isCollapsed:we.isCollapsed,canToggleCollapse:we.canToggleCollapse,collapseToggleKey:we.collapseToggleKey,onToggleCollapse:h,compactHeader:I,teamNames:y,teamColorByName:x,onTeamClick:S,onExpand:I?v:void 0,expandItemKey:I?se:void 0,observerRoot:w,onExpandContent:T},se)}}};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:k,className:"space-y-1",children:[ne?u.jsx("div",{style:{height:`${_e.getTotalSize()}px`,width:"100%",position:"relative"},children:_e.getVirtualItems().map(oe=>{const Oe=ie[oe.index];return Oe?u.jsx("div",{ref:_e.measureElement,"data-index":oe.index,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${oe.start-_e.options.scrollMargin}px)`},children:Se(Oe,{suppressEntryAnimation:!0})},oe.key):null})}):ie.map(oe=>Se(oe)),A>0&&u.jsxs("div",{className:"relative flex justify-center pb-3 pt-1",children:[u.jsx("div",{className:"pointer-events-none absolute inset-x-0 -top-24",style:{bottom:"-1.6rem",background:"linear-gradient(to top, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.25) 25%, rgba(0, 0, 0, 0.1) 50%, rgba(0, 0, 0, 0.03) 75%, transparent 100%)"}}),u.jsxs("div",{className:"relative z-[1] flex items-center gap-3 rounded-full px-4 py-1.5",style:{backgroundColor:"var(--color-surface-raised)",boxShadow:"0 0 12px 4px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.04)",border:"1px solid var(--color-border-emphasis)"},children:[u.jsxs("span",{className:"text-[11px] tabular-nums text-[var(--color-text-muted)]",children:["+",A," older"]}),u.jsx("span",{className:"h-3 w-px bg-blue-600/30 dark:bg-blue-400/30"}),u.jsxs("button",{onClick:q,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,A)," more"]}),A>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:ee,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"})]})]})]})]})}),Qst=new Map,Dst=new Map;function Lst(e){return{from:new Set(e.from),to:new Set(e.to),showNoise:e.showNoise}}function G8n(){return{messagesSearchQuery:"",messagesFilter:{from:new Set,to:new Set,showNoise:!1},messagesFilterOpen:!1,messagesCollapsed:!0,messagesSearchBarVisible:!1,expandedItemKey:null,messagesScrollTop:0,bottomSheetSnapIndex:2}}function ePe(e){const t=Qst.get(e)??G8n();return{...t,messagesFilter:Lst(t.messagesFilter)}}function H8n(e,t){Qst.set(e,{...t,messagesFilter:Lst(t.messagesFilter)})}function tPe(e){return{...Dst.get(e)??{}}}function Z8n(e,t){Dst.set(e,{...t})}const jst=1,K8n="composer:";function Oue(e){return`${K8n}${e}`}function J8n(e){return{text:`draft:compose:${e}`,chips:`draft:compose:${e}:chips`,attachments:`draft:compose:${e}:attachments`}}function e9n(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 cA=!1,nPe=!1;const iE=new Map;function _ue(){nPe||(nPe=!0,console.warn("[composerDraftStorage] IndexedDB unavailable, using in-memory storage for this session.")),cA=!0}async function Xst(e,t){const n=Oue(e);if(cA){iE.set(n,t);return}try{await My(n,t)}catch{_ue(),iE.set(n,t)}}async function t9n(e){const t=Oue(e);if(cA)return iE.get(t)??null;try{const n=await Fd(t);return n==null?null:e9n(n)?n:(sl(t),null)}catch{return _ue(),iE.get(t)??null}}async function n9n(e){const t=Oue(e);if(cA){iE.delete(t);return}try{await sl(t)}catch{_ue(),iE.delete(t)}}function m9(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.value=="string"&&typeof t.timestamp=="number"}function r9n(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 s9n(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 i9n(e){if(cA)return null;const t=J8n(e);try{const[n,r,s]=await Promise.all([Fd(t.text),Fd(t.chips),Fd(t.attachments)]);if(n==null&&r==null&&s==null)return null;let i="";m9(n)&&(i=n.value);let o=[];if(r!=null){const l=typeof r=="string"?JSON.parse(r):r,d=m9(l)?l.value:l,p=typeof d=="string"?JSON.parse(d):d;r9n(p)&&(o=p)}let a=[];if(s!=null){const l=typeof s=="string"?JSON.parse(s):s,d=m9(l)?l.value:l,p=typeof d=="string"?JSON.parse(d):d;s9n(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:jst,teamName:e,text:i,chips:o,attachments:a,updatedAt:Date.now()};return await Xst(e,c),await Promise.all([sl(t.text),sl(t.chips),sl(t.attachments)]),c}catch{return null}}function o9n(e){return{version:jst,teamName:e,text:"",chips:[],attachments:[],updatedAt:Date.now()}}const Og={saveSnapshot:Xst,loadSnapshot:t9n,deleteSnapshot:n9n,migrateLegacy:i9n,emptySnapshot:o9n},a9n=400;function l9n(e){const[t,n]=O.useState(""),[r,s]=O.useState([]),[i,o]=O.useState([]),[a,c]=O.useState(null),[l,d]=O.useState("do"),[p,f]=O.useState(!1),[h,m]=O.useState(!1),g=O.useRef(""),_=O.useRef([]),b=O.useRef([]),y=O.useRef("do"),x=O.useRef(e),S=O.useRef(!0),v=O.useRef(!1),T=O.useRef(null),E=O.useRef(null);O.useEffect(()=>{x.current=e},[e]),O.useEffect(()=>(S.current=!0,()=>{S.current=!1}),[]);const w=O.useCallback(()=>({version:1,teamName:x.current,text:g.current,chips:_.current,attachments:b.current,actionMode:y.current,updatedAt:Date.now()}),[]),P=O.useCallback(()=>{if(T.current!=null&&(clearTimeout(T.current),T.current=null),E.current!=null){const q=E.current;E.current=null,q.snapshot.text.length===0&&q.snapshot.chips.length===0&&q.snapshot.attachments.length===0?Og.deleteSnapshot(q.teamName):Og.saveSnapshot(q.teamName,q.snapshot)}},[]),C=O.useCallback(()=>{const q=w();E.current={teamName:x.current,snapshot:q},T.current!=null&&clearTimeout(T.current),T.current=setTimeout(()=>{T.current=null;const ee=E.current;if(E.current=null,ee==null)return;ee.snapshot.text.length===0&&ee.snapshot.chips.length===0&&ee.snapshot.attachments.length===0?(Og.deleteSnapshot(ee.teamName),S.current&&f(!0)):Og.saveSnapshot(ee.teamName,ee.snapshot).then(()=>{S.current&&f(!0)})},a9n)},[w]),k=O.useCallback(q=>{g.current=q.text,_.current=q.chips,b.current=q.attachments,y.current=q.actionMode??"do",n(q.text),s(q.chips),o(q.attachments),d(q.actionMode??"do")},[]);O.useEffect(()=>{let q=!1;P(),v.current=!1;const ee=Og.emptySnapshot(e);return queueMicrotask(()=>{q||(k(ee),f(!1),m(!1),c(null))}),(async()=>{let te=await Og.loadSnapshot(e);if(te==null&&(te=await Og.migrateLegacy(e)),!q){if(v.current){S.current&&m(!0);return}te!=null&&((te.attachments.reduce((G,ie)=>G+ie.size,0)>Tv||te.attachments.length>cO)&&(te={...te,attachments:[]}),k(te),f(!0)),S.current&&m(!0)}})(),()=>{q=!0}},[e,P,k]),O.useEffect(()=>()=>{P()},[P]);const I=O.useCallback(q=>{v.current=!0,g.current=q,n(q),f(!1),C()},[C]),Q=O.useCallback(q=>{v.current=!0;const ee=[..._.current,q];_.current=ee,s(ee),f(!1),C()},[C]),$=O.useCallback(q=>{v.current=!0;const ee=_.current.filter(te=>te.id!==q);_.current=ee,s(ee),f(!1),C()},[C]),R=O.useCallback(q=>{v.current=!0,y.current=q,d(q),f(!1),C()},[C]),N=i.reduce((q,ee)=>q+ee.size,0),j=i.length<cO&&N<Tv,M=O.useCallback(async q=>{v.current=!0,c(null);const ee=Array.from(q);if(ee.length===0)return;const te=[],H=[];for(const _e of ee)if(jN(_e)==="unsupported"){let be="";try{be=Z.getPathForFile(_e)}catch{}be?H.push(be):c(`Unsupported file: ${_e.name}`)}else te.push(_e);if(H.length>0){const _e=H.join(`
|
|
1843
1843
|
`)+`
|
|
1844
|
-
`,be=g.current;I(be?_e+be:_e)}if(te.length===0)return;let G=0;for(const _e of te){const be=S7e(_e);if(!be.valid){c(be.error);return}G+=_e.size}const ie=[];for(const _e of te)try{const be=await v7e(_e);ie.push(be)}catch{c(`读取文件失败:${_e.name}`);return}const ne=b.current;if(ne.length+ie.length>cO){c(`最多允许添加 ${cO} 个附件`);return}if(ne.reduce((_e,be)=>_e+be.size,0)+G>Tv){c("附件总大小超过 20MB 限制");return}const Te=[...ne,...ie];b.current=Te,o(Te),f(!1),C()},[C,I]),U=O.useCallback(q=>{v.current=!0;const ee=b.current.filter(te=>te.id!==q);b.current=ee,o(ee),c(null),f(!1),C()},[C]),A=O.useCallback(()=>{v.current=!0,b.current=[],o([]),c(null),f(!1),C()},[C]),F=O.useCallback(()=>{c(null)},[]),z=O.useCallback(q=>{const ee=q.clipboardData?.items;if(!ee)return;const te=[];for(const H of Array.from(ee))if(H.kind==="file"){const G=H.getAsFile();G&&te.push(G)}te.length>0&&(q.preventDefault(),M(te))},[M]),D=O.useCallback(q=>{q.preventDefault();const ee=q.dataTransfer?.files;ee?.length&&M(Array.from(ee))},[M]),V=O.useCallback(()=>{T.current!=null&&(clearTimeout(T.current),T.current=null),E.current=null,g.current="",_.current=[],b.current=[],n(""),s([]),o([]),c(null),f(!1),Og.deleteSnapshot(x.current)},[]);return{text:t,setText:I,chips:r,addChip:Q,removeChip:$,attachments:i,attachmentError:a,canAddMore:j,addFiles:M,removeAttachment:U,clearAttachments:A,clearAttachmentError:F,handlePaste:z,handleDrop:D,actionMode:l,setActionMode:R,isSaved:p,isLoaded:h,clearDraft:V}}const c9n=[{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 u9n(e){return e==="codex"?c9n:C7e}function d9n(e,t,n){const r=e.filter(o=>Vwe(o.rootKind,n)),s=t.filter(o=>Vwe(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 p9n(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 d9n(t,n,r)){const l=c.folderName.trim().toLowerCase();!c.isValid||!l||!sPn(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"} - ${oX(c.rootKind)}`,searchText:`${c.name} ${c.folderName}`,type:"skill"}))}return[...i,...a]}const g9=({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,onDispatchTask:m})=>{const g=O.useRef(null),_=O.useMemo(()=>xe=>{g.current=xe,typeof f=="function"?f(xe):f&&(f.current=xe)},[f]),[b,y]=O.useState(()=>t.find(Fe=>Jn(Fe))?.name??t[0]?.name??""),[x,S]=O.useState(!1),[v,T]=O.useState(""),E=O.useRef(null),[w,P]=O.useState(!1),C=O.useRef(0),k=O.useRef(null),[I,Q]=O.useState(null),$=O.useRef(0),R=O.useRef(null),[N,j]=O.useState(!1);O.useEffect(()=>{if(b&&t.some(_t=>_t.name===b))return;const Fe=t.find(_t=>Jn(_t))?.name??t[0]?.name??"";Fe&&Fe!==b&&queueMicrotask(()=>y(Fe))},[t,b]);const M=re(xe=>xe.selectedTeamName===e?xe.selectedTeamData?.config.projectPath??null:null),U=re(xe=>{if(xe.selectedTeamName!==e)return qc(e).border;const Fe=xe.selectedTeamData?.config.color;if(Fe)return Wr(Fe).border;const _t=xe.selectedTeamData?.config.name??e;return qc(_t).border}),A=re(xe=>T_(xe,e)),F=l9n(e),z=O.useMemo(()=>l.find(xe=>xe.sessionKey===d)??null,[d,l]),D=z?.chatName||z?.title||z?.userName||z?.sessionKey||"选择会话",V=O.useMemo(()=>Co(t),[t]),q=O.useMemo(()=>t.map(xe=>({id:xe.name,name:xe.name,subtitle:mi(xe.role)??mi(xe.agentType)??void 0,color:V.get(xe.name)})),[t,V]),ee=O.useMemo(()=>{const xe=t.find(Fe=>Jn(Fe));return ka(xe?.providerId)??CO(xe?.model)},[t]),{suggestions:te}=zN(e),{suggestions:H}=tx(e),G=re(vt(xe=>M?xe.skillsProjectCatalogByProjectPath[M]??[]:[])),ie=re(vt(xe=>xe.skillsUserCatalog)),ne=re(xe=>xe.fetchSkillsCatalog);O.useEffect(()=>{ne(M??void 0)},[ne,M]);const pe=O.useMemo(()=>p9n(u9n(ee),G,ie,ee),[ee,G,ie]),Te=Em(F.text).trim(),_e=O.useMemo(()=>GT(Te),[Te]),be=t.find(xe=>xe.name===b),Ie=be?V.get(be.name):void 0,Se=be?Jn(be):!1,oe=Se&&!!r,Oe=oe&&F.canAddMore,K=oe?void 0:Se?"团队在线时才能添加文件":"文件只能发送给团队负责人",Y=F.attachments.length>0&&!oe,W=_e?F.attachments.length>0?"斜杠命令需要团队负责人在线,且不能与附件同时发送":Se?r?null:"斜杠命令需要团队负责人在线":"斜杠命令只能发送给团队负责人":null,se=O.useMemo(()=>{const xe=Te.match(/^@([^\s]+)\s+([\s\S]+)$/);if(!xe||!m)return null;const Fe=xe[1],_t=xe[2]?.trim();if(!Fe||!_t)return null;const At=te.find(et=>(et.id.startsWith("team:")?et.id.slice(5):et.id)===Fe||et.name===Fe);return{slug:At?At.id.startsWith("team:")?At.id.slice(5):At.id:Fe,subject:_t}},[m,te,Te]),he=se!==null&&Te.length>0&&Te.length<=fl&&!s,we=b.length>0&&Te.length>0&&Te.length<=fl&&!s&&!A&&!Y&&!W,J=he||we,de=O.useRef(!1),ue=O.useCallback(()=>{if(!J)return;R.current?.();const xe=Zb(F.text,H),Fe=JE(Te,F.chips);if(se&&m){Promise.resolve(m(se.slug,se.subject,Fe)).then(_t=>{_t!==!1&&F.clearDraft()});return}de.current=!0,h(b,Fe,Te,F.attachments.length>0?F.attachments:void 0,void 0,xe)},[J,b,Te,h,F,H,se,m]);O.useEffect(()=>{!s&&de.current&&(de.current=!1,!i&&a?.delivered!==!1&&F.clearDraft())},[s,i,a,F]);const{addFiles:ae}=F,$e=O.useCallback(xe=>{const Fe=xe.target;Fe.files?.length&&ae(Fe.files),Fe.value=""},[ae]),qe=O.useCallback(()=>{Q(K??"Files can only be sent to the team lead"),window.clearTimeout($.current),$.current=window.setTimeout(()=>{Q(null)},4e3)},[K]);O.useEffect(()=>{const xe=$;return()=>window.clearTimeout(xe.current)},[]);const ot=O.useCallback(xe=>{xe.preventDefault(),C.current+=1,C.current===1&&P(!0)},[]),Ot=O.useCallback(xe=>{xe.preventDefault(),C.current-=1,C.current<=0&&(C.current=0,P(!1))},[]),nt=O.useCallback(xe=>{xe.preventDefault()},[]),{handleDrop:Ge}=F,St=O.useCallback(xe=>{if(xe.preventDefault(),C.current=0,P(!1),!oe){xe.dataTransfer?.files?.length&&qe();return}Ge(xe)},[oe,Ge,qe]),{handlePaste:Qt}=F,ft=O.useCallback(xe=>{if(!oe){Array.from(xe.clipboardData.items).some(_t=>_t.kind==="file")&&(xe.preventDefault(),qe());return}Qt(xe)},[oe,Qt,qe]),tn=fl-Te.length,jt=F.attachments.length>0||!!(F.attachmentError??I),On=!jt,Lt=n==="compact",fn=W?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(Zi,{size:10,className:"shrink-0"}),W]}):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(Zi,{size:10,className:"shrink-0"}),i]}):o?u.jsx(hnt,{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(qr,{size:10,className:"shrink-0"}),"已复用最近一次跨团队请求"]}):null;return u.jsxs("div",{className:st("relative",Lt?"pb-1":"mb-1.5 pb-1.5"),role:"group",onDragEnter:ot,onDragLeave:Ot,onDragOver:nt,onDrop:St,onPaste:ft,children:[u.jsxs("div",{className:st(On?"mb-0":"mb-1",Lt?"space-y-1.5":"space-y-2"),children:[u.jsxs("div",{className:"flex items-center gap-2",children:[Se?u.jsxs(u.Fragment,{children:[u.jsx("input",{ref:k,type:"file",accept:"*/*",multiple:!0,className:"hidden",onChange:$e}),u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx("button",{type:"button",className:st("inline-flex shrink-0 items-center gap-1 rounded p-1 transition-colors",Oe?"text-[var(--color-text-secondary)] hover:text-[var(--color-text)]":"text-[var(--color-text-muted)] opacity-40"),disabled:!Oe,onClick:()=>k.current?.click(),children:u.jsx(gU,{size:14})})}),u.jsx(it,{side:"top",children:r?F.canAddMore?"添加文件(支持粘贴或拖拽)":"已达到附件上限":"团队在线时才能添加文件"})]})]}):null,u.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[!r&&!A&&u.jsx("span",{className:"text-[10px]",style:{color:"var(--warning-text)"},children:"团队离线"}),u.jsxs("div",{className:st("mr-[15px] inline-flex items-center border text-xs transition-colors",On?"relative z-10 -mb-2 overflow-hidden rounded-b-none rounded-t-[1.35rem] border-b-0 bg-[var(--color-surface-raised)]":"rounded-full","border-[var(--color-border)]"),children:[u.jsxs(uc,{open:N,onOpenChange:j,children:[u.jsx(Gc,{asChild:!0,children:u.jsxs("button",{type:"button",className:st("inline-flex items-center gap-1.5 border-r border-r-[var(--color-border)] px-2.5 py-1 text-xs transition-colors",On?"rounded-bl-none rounded-tl-[1.35rem]":"rounded-l-full","hover:bg-[var(--color-surface-raised)]"),children:[U?u.jsx("span",{className:"inline-block size-2 shrink-0 rounded-full",style:{backgroundColor:U}}):null,u.jsx("span",{className:"max-w-[120px] truncate text-[var(--color-text-secondary)]",children:D}),u.jsx(Dr,{size:12,className:"shrink-0 text-[var(--color-text-muted)]"})]})}),u.jsx(Sl,{align:"end",className:"w-56 p-1.5",children:u.jsx("div",{className:"max-h-48 space-y-0.5 overflow-y-auto",children:l.length>0&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"px-2 py-1 text-[10px] font-medium uppercase tracking-wide text-[var(--color-text-muted)]",children:"会话"}),l.map(xe=>{const Fe=d===xe.sessionKey,_t=xe.chatName||xe.title||xe.userName||xe.sessionKey;return u.jsxs("button",{type:"button",className:st("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)]",Fe&&"bg-[var(--color-surface-raised)]"),onClick:()=>{p?.(xe.sessionKey),j(!1)},children:[u.jsx("span",{className:st("inline-block size-2 shrink-0 rounded-full",xe.live&&"animate-pulse"),style:{backgroundColor:xe.live?"#22c55e":U}}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-[var(--color-text)]",children:_t}),u.jsx("span",{className:"shrink-0 text-[10px] text-[var(--color-text-muted)]",children:xe.platform}),Fe?u.jsx(qr,{size:12,className:"ml-auto shrink-0 text-blue-400"}):null]},xe.sessionKey)})]})})})]}),u.jsxs(uc,{open:x,onOpenChange:S,children:[u.jsx(Gc,{asChild:!0,children:u.jsxs("button",{type:"button",className:st("inline-flex items-center gap-1.5 px-2.5 py-1 text-xs transition-colors",On?"rounded-br-none rounded-tr-[1.35rem]":"rounded-r-full","hover:bg-[var(--color-surface-raised)]"),children:[b?u.jsx(Ur,{name:b,color:Ie,size:"sm",hideAvatar:b==="user",disableHoverCard:!0}):u.jsx("span",{className:"text-[var(--color-text-muted)]",children:"选择..."}),u.jsx(Dr,{size:12,className:"shrink-0 text-[var(--color-text-muted)]"})]})}),u.jsxs(Sl,{align:"end",className:"w-56 p-1.5",onOpenAutoFocus:xe=>{xe.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:xe=>T(xe.target.value)})]}),u.jsx("div",{className:"max-h-48 space-y-0.5 overflow-y-auto",children:(()=>{const xe=v.toLowerCase().trim(),Fe=xe?t.filter(At=>At.name.toLowerCase().includes(xe)):t;return Fe.length===0?u.jsx("div",{className:"px-2 py-3 text-center text-xs text-[var(--color-text-muted)]",children:"无匹配结果"}):[...Fe].sort((At,Ve)=>{const et=Jn(At)?1:0;return(Jn(Ve)?1:0)-et}).map(At=>{const Ve=V.get(At.name),et=mi(At.role)??mi(At.agentType),Ce=At.name===b;return u.jsxs("button",{type:"button",className:st("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)]",Ce&&"bg-[var(--color-surface-raised)]"),onClick:()=>{y(At.name),S(!1),T("")},children:[u.jsx(Ur,{name:At.name,color:Ve,size:"sm",hideAvatar:At.name==="user",disableHoverCard:!0}),et?u.jsx("span",{className:"shrink-0 text-[10px] text-[var(--color-text-muted)]",children:et}):null,Ce?u.jsx(qr,{size:12,className:"ml-auto shrink-0 text-blue-400"}):null]},At.name)})})()})]})]})]})]})]}),jt?u.jsx(pnt,{attachments:F.attachments,onRemove:F.removeAttachment,error:F.attachmentError??I,onDismissError:F.clearAttachmentError,disabled:Y,disabledHint:"仅在团队在线且接收人为团队负责人时支持附件。请移除附件或切换接收人。"}):null]}),u.jsxs("div",{className:"relative",children:[u.jsx(fnt,{active:w,rejected:!oe,rejectionReason:K}),u.jsx(Rm,{ref:_,id:`compose-${e}`,placeholder:A?"团队正在启动中... 消息将排队并在稍后投递到收件箱。":"输入消息...(回车发送,Shift+Enter 换行)",value:F.text,onValueChange:F.setText,suggestions:q,teamSuggestions:te,taskSuggestions:H,commandSuggestions:pe,chips:F.chips,onChipRemove:F.removeChip,projectPath:M,onFileChipInsert:F.addChip,onModEnter:ue,dismissMentionsRef:R,extraTips:O.useMemo(()=>[`Tips:你可以输入 "/" 来运行命令,如 ${pe.filter(Fe=>Fe.type==="command").slice(0,6).map(Fe=>Fe.command).join("、")} 等。`],[pe]),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:fl,disabled:s,hintText:void 0,showHint:!Lt,cornerActionInset:"compact",cornerAction:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs(at,{children:[u.jsx(lt,{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 Z.openExternal("https://voicetext.site"),children:u.jsx(eMe,{size:14})})}),u.jsx(it,{side:"top",children:"语音转文字"})]}),u.jsxs(at,{children:[u.jsx(lt,{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:!J,onClick:ue,children:[u.jsx(xE,{size:12}),"发送"]})})}),W?u.jsx(it,{side:"top",children:W}):A&&!s?u.jsx(it,{side:"top",children:"团队启动期间暂不可发送"}):null]})]}),footerRight:Lt?fn:u.jsxs("div",{className:"flex items-center gap-2",children:[fn,tn<200?u.jsxs("span",{className:`text-[10px] ${tn<100?"text-yellow-400":"text-[var(--color-text-muted)]"}`,children:["剩余 ",tn," 字符"]}):null,F.isSaved?u.jsx("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:"已保存"}):null]})})]})]})};function f9n(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 h9n(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 m9n=({teamName:e,members:t,filter:n,messages:r,open:s,onOpenChange:i,onApply:o})=>{const[a,c]=O.useState({from:new Set,to:new Set,showNoise:!1});O.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=O.useMemo(()=>Co(t),[t]),d=O.useMemo(()=>f9n(r),[r]),p=O.useMemo(()=>h9n(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}})},g=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(uc,{open:s,onOpenChange:i,children:[u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx(Gc,{asChild:!0,children:u.jsxs(Me,{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(T$,{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(it,{side:"bottom",children:"筛选消息"})]}),u.jsxs(Sl,{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(ai,{checked:a.from.has(y),onCheckedChange:()=>m(y)}),u.jsx(Ur,{name:y,color:l.get(y),teamName:e,size:"sm",hideAvatar:y==="user"})]},y))})]}),u.jsxs("div",{className:"border-b border-[var(--color-border)] p-3",children:[u.jsx("p",{className:"mb-2 text-[11px] font-medium uppercase tracking-wider text-[var(--color-text-muted)]",children:"接收方"}),u.jsx("div",{className:"space-y-1",children:p.length===0?u.jsx("p",{className:"text-xs italic text-[var(--color-text-muted)]",children:"暂无数据"}):p.map(y=>u.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded-md px-1 py-0.5 text-xs text-[var(--color-text-secondary)] hover:bg-[var(--color-surface-raised)]",children:[u.jsx(ai,{checked:a.to.has(y),onCheckedChange:()=>g(y)}),u.jsx(Ur,{name:y,color:l.get(y),teamName:e,size:"sm",hideAvatar:y==="user"})]},y))})]})]}),u.jsxs("div",{className:"shrink-0 border-t border-[var(--color-border)]",children:[u.jsx("div",{className:"border-b border-[var(--color-border)] p-3",children:u.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded-md px-1 py-0.5 text-xs text-[var(--color-text-secondary)] hover:bg-[var(--color-surface-raised)]",children:[u.jsx(ai,{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(Me,{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(Me,{size:"sm",className:"h-7 px-3 text-[11px]",onClick:_,children:"保存"})]})]})]})]})},g9n=1e4;function rPe(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 O9n(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=rPe(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=rPe(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<=g9n,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 _9n=({members:e,pendingRepliesByMember:t,pendingCrossTeamReplies:n=[],headerRight:r,onMemberClick:s})=>{const{isLight:i}=Js(),o=re(vt(m=>m.pendingApprovals)),a=re(vt(m=>m.teamByName)),c=Co(e),l=jf(e),d=Object.entries(t).map(([m,g])=>({kind:"member",member:e.find(_=>_.name===m)??null,name:m,sentAtMs:g})).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,g)=>g.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 g=vT(m.sentAtMs,{addSuffix:!0});if(m.kind==="member"){const{member:_}=m,b=Wr(c.get(_.name)??""),y=mi(_.role??(_.agentType!=="general-purpose"?_.agentType:void 0)),x=$z(_.runtimeAdvisory,_.providerId),S=hze(_.runtimeAdvisory,_.providerId),v=x!==null;return u.jsx("article",{className:"activity-card-enter-animate overflow-hidden rounded-md",style:{backgroundColor:RO,border:Cu,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)??fo(_.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:wi(b,i),color:b.text,border:`1px solid ${b.border}40`},onClick:()=>s(_),title:"Open member",children:Vc(_.name)}):u.jsx("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-medium tracking-wide",style:{backgroundColor:wi(b,i),color:b.text,border:`1px solid ${b.border}40`},children:Vc(_.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(zt,{className:"size-3 shrink-0 animate-spin text-amber-400"}):null,u.jsx("span",{className:"shrink-0 text-[10px]",style:{color:Dt},children:g})]})},`pending-reply:${_.name}:${m.sentAtMs}`)}if(m.kind==="team"){const _=a[m.teamName]?.displayName||m.teamName,b=qc(_,i);return u.jsx("article",{className:"activity-card-enter-animate overflow-hidden rounded-md",style:{backgroundColor:RO,border:Cu,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(ac,{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:wi(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:g})]})},`pending-reply:team:${m.teamName}:${m.sentAtMs}`)}return u.jsx("article",{className:"activity-card-enter-animate overflow-hidden rounded-md",style:{backgroundColor:RO,border:Cu,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(Vht,{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:g})]})},`pending-reply:user:${m.sentAtMs}`)})]})},O9=({members:e,messages:t,pendingRepliesByMember:n,layout:r="overlay",onMemberClick:s})=>{const[i,o]=O.useState(!1),[a,c]=O.useState(()=>Date.now()),l=O.useMemo(()=>O9n(t,a),[t,a]),d=O.useMemo(()=>Object.keys(n).some(g=>e.some(_=>_.name===g))||l.length>0,[e,n,l.length]),p=O.useMemo(()=>d,[d]);if(O.useEffect(()=>{if(!p)return;const m=window.setInterval(()=>c(Date.now()),1e3);return()=>window.clearInterval(m)},[p]),!p)return null;const f=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:()=>o(m=>!m),"aria-label":i?"Expand status":"Collapse status",children:[u.jsx(Bn,{size:12,className:`shrink-0 transition-transform duration-150 ${i?"":"rotate-90"}`}),"Status"]}),h=r==="flow"&&!i?f:null;return u.jsxs(u.Fragment,{children:[r==="overlay"?u.jsx("div",{className:"relative h-0",children:u.jsx("div",{className:"absolute -top-[19px] right-0 z-10",children:f})}):i?u.jsx("div",{className:"mb-2 flex justify-end",children:f}):null,!i&&u.jsx("div",{className:r==="overlay"?"mt-5":"",children:d?u.jsx(_9n,{members:e,pendingRepliesByMember:n,pendingCrossTeamReplies:l,headerRight:h,onMemberClick:s}):null})]})},b9n=40,sQ=1,sPe=2,y9n=4,x9n=56;function S9n(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 v9n=O.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:g,onCreateTaskFromMessage:_,onReplyToMessage:b,onRestartTeam:y,onTaskIdClick:x,inlineScrollContainerRef:S,showPositionControls:v=!0}){const{sendTeamMessage:T,sendCrossTeamMessage:E,sendingMessage:w,sendMessageError:P,sendMessageWarning:C,sendMessageDebugDetails:k,lastSendMessageResult:I,teams:Q,openTeamTab:$,messages:R,hasMore:N,loadingOlderMessages:j,loadOlderTeamMessages:M,refreshTeamMessagesHead:U,addOptimisticTeamMessage:A}=re(vt(We=>({sendTeamMessage:We.sendTeamMessage,sendCrossTeamMessage:We.sendCrossTeamMessage,sendingMessage:We.sendingMessage,sendMessageError:We.sendMessageError,sendMessageWarning:We.sendMessageWarning,sendMessageDebugDetails:We.sendMessageDebugDetails,lastSendMessageResult:We.lastSendMessageResult,teams:We.teams,openTeamTab:We.openTeamTab,messages:fz(We,t),hasMore:t?We.teamMessagesByName[t]?.hasMore??!1:!1,loadingOlderMessages:t?We.teamMessagesByName[t]?.loadingOlder??!1:!1,loadOlderTeamMessages:We.loadOlderTeamMessages,refreshTeamMessagesHead:We.refreshTeamMessagesHead,addOptimisticTeamMessage:We.addOptimisticTeamMessage}))),F=O.useRef(null),z=O.useCallback(async()=>{const We=re.getState().teamMessagesByName[t];!We?.hasMore||We.loadingHead||We.loadingOlder||await M(t)},[M,t]),D=R,V=D.length,q=O.useRef(!1),ee=O.useRef(null),te=O.useRef(null),H=O.useRef(null),G=O.useRef(null),ie=O.useRef(null),ne=n==="inline"?S??null:n==="sidebar"?te:ie,pe=O.useCallback(We=>{We>x9n||!N||j||re.getState().teamMessagesByName[t]?.loadingHead||q.current||(q.current=!0,z())},[N,z,j,t]);O.useEffect(()=>{j||(q.current=!1)},[j]);const Te=O.useMemo(()=>{if(ne)return{scrollElementRef:ne,observerRoot:ne,scrollMargin:0,virtualizationEnabled:!0}},[ne]),_e=O.useCallback(()=>{},[]),be=O.useRef(ePe(t)),[Ie,Se]=O.useState(be.current.messagesSearchQuery),[oe,Oe]=O.useState(be.current.messagesFilter),[K,Y]=O.useState(be.current.messagesFilterOpen),[W,se]=O.useState(be.current.messagesCollapsed),[he,we]=O.useState(be.current.messagesSearchBarVisible),[J,de]=O.useState(be.current.expandedItemKey),[ue,ae]=O.useState([]),[$e,qe]=O.useState(null),[ot,Ot]=O.useState(!1),[nt,Ge]=O.useState(null),[St,Qt]=O.useState(be.current.messagesScrollTop),[ft,tn]=O.useState(be.current.bottomSheetSnapIndex),[jt,On]=O.useState(196),[Lt,fn]=O.useState(0);O.useEffect(()=>{be.current=ePe(t),Se(be.current.messagesSearchQuery),Oe(be.current.messagesFilter),Y(be.current.messagesFilterOpen),se(be.current.messagesCollapsed),we(be.current.messagesSearchBarVisible),de(be.current.expandedItemKey),Qt(be.current.messagesScrollTop),tn(be.current.bottomSheetSnapIndex)},[t]),O.useEffect(()=>{let We=!1;return Z.teams.getTeamSessions(t).then(Tt=>{if(We)return;const Kn=[...Tt].sort((Ar,Ne)=>new Date(Ne.updatedAt).getTime()-new Date(Ar.updatedAt).getTime());ae(Kn),Ge(Ar=>Ar&&Kn.some(Ne=>Ne.sessionKey===Ar)?Ar:Kn[0]?.sessionKey??null)}).catch(()=>{We||(ae([]),Ge(null))}),()=>{We=!0}},[t,p]);const xe=O.useMemo(()=>ue.find(We=>We.sessionKey===nt)??null,[nt,ue]),Fe=xe?.platform==="hermit"||xe?.sessionKey===`hermit:${t}:session`;O.useEffect(()=>{if(!xe||Fe){qe(null),Ot(!1);return}let We=!1;return Ot(!0),Z.teams.getSessionDetail(t,xe.id,200).then(Tt=>{We||qe(Tt)}).catch(()=>{We||qe(null)}).finally(()=>{We||Ot(!1)}),()=>{We=!0}},[Fe,xe,t]),O.useEffect(()=>{H8n(t,{messagesSearchQuery:Ie,messagesFilter:oe,messagesFilterOpen:K,messagesCollapsed:W,messagesSearchBarVisible:he,expandedItemKey:J,messagesScrollTop:St,bottomSheetSnapIndex:ft})},[t,Ie,oe,K,W,he,J,St,ft]),O.useEffect(()=>{const We=oe.from.size>0||oe.to.size>0;he||Ie.trim().length===0&&!We||we(!0)},[oe.from,oe.to,he,Ie]),O.useEffect(()=>{if(!t)return;if(D.length>0){F.current=null;return}const We=re.getState().teamMessagesByName[t];We?.loadingHead||We?.loadingOlder||F.current!==t&&(F.current=t,U(t).catch(()=>{}))},[D.length,U,t]),O.useLayoutEffect(()=>{if(n!=="sidebar")return;const We=te.current;We&&(We.scrollTop=St)},[n,St]),O.useEffect(()=>{if(n==="sidebar")return;const We=n==="bottom-sheet"?ie.current:S?.current??null;if(!We)return;const Tt=()=>{pe(We.scrollTop)};return We.addEventListener("scroll",Tt,{passive:!0}),Tt(),()=>{We.removeEventListener("scroll",Tt)}},[S,pe,n]),O.useLayoutEffect(()=>{if(n!=="bottom-sheet"||typeof ResizeObserver>"u")return;const We=s instanceof HTMLElement?s:null,Tt=[[G.current,On],[We,fn]],Kn=[];for(const[Ar,Ne]of Tt){if(!Ar)continue;const Ae=()=>{const Xn=Math.ceil(Ar.getBoundingClientRect().height);Xn>0&&Ne(Xn)};Ae();const mn=new ResizeObserver(()=>{Ae()});mn.observe(Ar),Kn.push(mn)}return()=>{Kn.forEach(Ar=>Ar.disconnect())}},[n,s]);const _t=O.useMemo(()=>{const We=Tt=>[...Tt].sort((Kn,Ar)=>Date.parse(Ar.timestamp)-Date.parse(Kn.timestamp));return nt?xe&&!Fe?$e?[...$e.history].reverse().map((Tt,Kn)=>({messageId:`${$e.id}:${Kn}:${Tt.timestamp}`,from:Tt.role==="user"?"user":$e.name||t,to:Tt.role==="user"?$e.name||t:"user",text:Tt.content,timestamp:Tt.timestamp,read:!0,source:Tt.role==="user"?"user_sent":"inbox",session:{id:$e.id,key:$e.sessionKey,platform:$e.platform,title:xe.title||xe.chatName||xe.userName||xe.sessionKey,chatName:xe.chatName,userName:xe.userName}})):[]:We(D.filter(Tt=>Tt.session?.key===nt)):We(D)},[D,Fe,xe,$e,nt,t]),At=O.useMemo(()=>Gee(_t,{timeWindow:d,filter:oe,searchQuery:Ie}),[oe,Ie,_t,d]),Ve=O.useMemo(()=>Gee(_t,{includePassiveIdlePeerSummariesWhenNoiseHidden:!0,timeWindow:d,filter:oe,searchQuery:Ie}),[oe,Ie,_t,d]),et=O.useMemo(()=>D.filter(We=>We.messageKind!=="task_comment_notification"&&!x$n(typeof We.text=="string"?We.text:"")),[D]),Ce=O.useMemo(()=>{if(!J)return null;if(!J.startsWith("thoughts-")){const Tt=Ve.find(Kn=>Ls(Kn)===J);return Tt?{type:"message",message:Tt}:null}return rKe(Ve).find(Tt=>Tt.type==="lead-thoughts"&&Ev(Tt.group)===J)??null},[J,Ve]);O.useEffect(()=>{J&&Ce===null&&de(null)},[J,Ce]);const tt=O.useCallback(We=>{de(We)},[]),ve=O.useCallback(We=>{We||de(null)},[]),{readSet:Ue,markRead:mt,markAllRead:Ke}=Zle(t),{expandedSet:Ct,toggle:Xt}=I8n(t),Wt=O.useMemo(()=>At.filter(We=>!We.read&&!Ue.has(Ls(We))).length,[At,Ue]),nr=O.useCallback(We=>mt(Ls(We)),[mt]),nn=O.useMemo(()=>({readSet:Ue,getMessageKey:Ls}),[Ue]),{teamNames:Zn,teamColorByName:jr}=Gle(Q),Xe=O.useCallback(()=>{const We=At.filter(Tt=>!Tt.read&&!Ue.has(Ls(Tt))).map(Tt=>Ls(Tt));Ke(We)},[At,Ue,Ke]);O.useEffect(()=>{if(Object.keys(f).length===0)return;const We=S9n(f,et);We!==f&&h(()=>We)},[h,f,et]);const Re=O.useCallback((We,Tt,Kn,Ar,Ne,Ae)=>{const mn=Date.now();h(Xn=>({...Xn,[We]:mn})),T(t,{member:We,text:Tt,summary:Kn,attachments:Ar,actionMode:Ne,taskRefs:Ae,sessionKey:nt&&nt!=="__unassigned__"?nt:void 0}).then(Xn=>{Xn?.runtimeDelivery?.attempted===!0&&Xn.runtimeDelivery.delivered===!1&&h(ks=>{if(ks[We]!==mn)return ks;const Us={...ks};return delete Us[We],Us})}).catch(()=>{h(Xn=>{if(Xn[We]!==mn)return Xn;const ks={...Xn};return delete ks[We],ks})})},[t,T,h,nt]);O.useCallback((We,Tt,Kn,Ar,Ne)=>{E({fromTeam:t,fromMember:"user",toTeam:We,text:Tt,sessionKey:nt&&nt!=="__unassigned__"?nt:void 0,taskRefs:Ne,actionMode:Ar,summary:Kn})},[t,nt,E]);const me=O.useCallback(async(We,Tt,Kn)=>{const Ar=Date.now(),Ne=`optimistic-cross-team-${Ar}`;A(t,{from:"user",to:We,text:`@${We} ${Tt}`,timestamp:new Date(Ar).toISOString(),read:!0,messageId:Ne,source:"cross_team_sent",session:nt&&nt!=="__unassigned__"?{key:nt}:void 0});try{await E({fromTeam:t,fromMember:"user",toTeam:We,text:Kn,messageId:Ne})}catch(Ae){const mn=Ae instanceof Error?Ae.message:"跨团队任务派发失败",Xn=mn.includes("Redis not configured")?"无法派发给其他团队:Redis 未配置或未连接。请先在设置里开启团队总线并配置 Redis。":mn.includes("Distributed collaboration is not enabled")?"无法派发给其他团队:团队总线/分布式团队协作未开启。请先在设置里开启。":`无法派发给 ${We}:${mn}`;return A(t,{from:"system",to:"user",text:Xn,timestamp:new Date(Date.now()).toISOString(),read:!0,messageId:`optimistic-cross-team-error-${Date.now()}`,source:"system_notification"}),window.dispatchEvent(new CustomEvent("collab:refresh")),await U(t),!1}return window.dispatchEvent(new CustomEvent("collab:refresh")),await U(t),window.setTimeout(()=>{U(t)},300),!0},[A,t,U,nt,E]),Ee=O.useCallback(()=>{r("inline")},[r]),le=O.useCallback(()=>{r("sidebar")},[r]),je=O.useCallback(()=>{tn(sPe),r("bottom-sheet")},[r]),Be=O.useCallback(We=>{tn(We),H.current?.snapTo(We)},[]),yt=O.useCallback(()=>{if(ft===sQ){Be(sPe);return}Be(sQ)},[ft,Be]),wt=O.useMemo(()=>{const We=Lt>0?Math.max(Lt-1,96):Number.POSITIVE_INFINITY,Tt=Math.min(b9n,We),Kn=Math.min(Math.max(Tt+jt,Tt+120),We),Ar=Math.min(Math.max(Lt>0?Math.round(Lt*.58):520,Kn+140),We);return[0,Tt,Kn,Ar,1]},[Lt,jt]),ut=O.useMemo(()=>Math.min(Math.max(ft,sQ),y9n),[ft]),Ut=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:Ie,onChange:We=>Se(We.target.value),onPointerDown:We=>We.stopPropagation(),onClick:We=>We.stopPropagation(),className:"min-w-0 flex-1 bg-transparent text-xs text-[var(--color-text)] placeholder:text-[var(--color-text-muted)] focus:outline-none"}),Ie&&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:()=>Se(""),children:u.jsx(Pr,{size:14})})]}),u.jsx(m9n,{teamName:t,members:i,filter:oe,messages:_t,open:K,onOpenChange:Y,onApply:Oe})]}),yn=u.jsxs("div",{className:"flex items-center gap-2",children:[Ut,u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx(Me,{variant:"ghost",size:"sm",className:"pointer-events-auto size-7 p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:We=>{We.stopPropagation(),se(Tt=>!Tt)},children:W?u.jsx(Fk,{size:14}):u.jsx(Q4,{size:14})})}),u.jsx(it,{side:"bottom",children:W?"展开全部消息":"折叠全部消息"})]})]}),Rn=u.jsxs("div",{className:"pb-14",children:[u.jsx(g9,{teamName:t,members:i,isTeamAlive:a,sending:w,sendError:P,sendWarning:C,sendDebugDetails:k,lastResult:I,sessions:ue,selectedSessionKey:nt,onSessionChange:Ge,textareaRef:ee,onSend:Re,onDispatchTask:me}),u.jsx(O9,{members:i,tasks:o,messages:_t,pendingRepliesByMember:f,layout:"flow",position:"inline",onMemberClick:m,onTaskClick:g}),u.jsx(h9,{messages:Ve,teamName:t,members:i,readState:nn,allCollapsed:W,expandOverrides:Ct,onToggleExpandOverride:Xt,currentLeadSessionId:p,isTeamAlive:a,leadActivity:c,leadContextUpdatedAt:l,teamNames:Zn,teamColorByName:jr,onTeamClick:$,onMemberClick:m,onCreateTaskFromMessage:void 0,onReplyToMessage:b,onMessageVisible:nr,onRestartTeam:y,onTaskIdClick:x,onExpandItem:tt,onExpandContent:_e,viewport:Te}),N&&u.jsx("div",{className:"flex justify-center py-2",children:u.jsxs("div",{className:"flex flex-col items-center gap-1",children:[u.jsx(Me,{variant:"ghost",size:"sm",className:"text-xs text-text-muted","aria-busy":j,disabled:j,onClick:()=>void z(),children:"加载更早消息"}),u.jsxs("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:["已加载 ",V," 条"]})]})}),u.jsx(qC,{expandedItem:Ce,open:J!==null,onOpenChange:ve,teamName:t,members:i,onCreateTaskFromMessage:void 0,onReplyToMessage:b,onMemberClick:m,onTaskIdClick:x,onRestartTeam:y,teamNames:Zn,teamColorByName:jr,onTeamClick:$})]});if(n==="sidebar")return u.jsxs("div",{className:"flex size-full flex-col overflow-hidden bg-[var(--color-surface-sidebar)]",children:[u.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-[var(--color-border)] bg-[var(--color-surface-sidebar)] px-3 py-2",children:[u.jsx(mo,{size:14,className:"shrink-0 text-[var(--color-text-muted)]"}),u.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:"消息"}),At.length>0&&u.jsx($t,{variant:"secondary",className:"px-1.5 py-0.5 text-[10px] font-normal leading-none",children:At.length}),Wt>0&&u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsxs($t,{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:[Wt," 条新消息"]})}),u.jsxs(it,{side:"bottom",children:[Wt," 条未读"]})]}),Wt>0&&u.jsxs(at,{children:[u.jsx(lt,{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:Xe,children:u.jsx(EQ,{size:12})})}),u.jsx(it,{side:"bottom",children:"全部标为已读"})]}),u.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx(Me,{variant:"ghost",size:"sm",className:"size-7 p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:()=>se(We=>!We),"aria-label":W?"展开全部消息":"折叠全部消息",children:W?u.jsx(Fk,{size:14}):u.jsx(Q4,{size:14})})}),u.jsx(it,{side:"bottom",children:W?"展开全部消息":"折叠全部消息"})]}),u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx(Me,{variant:"ghost",size:"sm",className:"size-7 p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:()=>we(We=>!We),"aria-label":he?"隐藏消息搜索":"显示消息搜索",children:he?u.jsx(Pr,{size:14}):u.jsx(Mi,{size:14})})}),u.jsx(it,{side:"bottom",children:he?"隐藏搜索":"搜索消息"})]}),u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx(Me,{variant:"ghost",size:"sm",className:"size-7 p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:Ee,"aria-label":"将消息移到页面内面板",children:u.jsx(nMe,{size:14})})}),u.jsx(it,{side:"bottom",children:"移到页面内"})]})]})]}),he&&u.jsx("div",{className:"shrink-0 border-b border-[var(--color-border)] px-3 py-1.5",children:Ut}),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:We=>{const Tt=We.currentTarget.scrollTop;Qt(Tt),pe(Tt)},children:[u.jsxs("div",{className:"pl-3",children:[u.jsx(g9,{teamName:t,members:i,isTeamAlive:a,sending:w,sendError:P,sendWarning:C,sendDebugDetails:k,lastResult:I,sessions:ue,selectedSessionKey:nt,onSessionChange:Ge,textareaRef:ee,onSend:Re,onDispatchTask:me}),u.jsx(O9,{members:i,tasks:o,messages:_t,pendingRepliesByMember:f,layout:"flow",position:"sidebar",onMemberClick:m,onTaskClick:g})," "]}),u.jsx(h9,{messages:Ve,teamName:t,members:i,readState:nn,allCollapsed:W,expandOverrides:Ct,onToggleExpandOverride:Xt,currentLeadSessionId:p,isTeamAlive:a,leadActivity:c,leadContextUpdatedAt:l,teamNames:Zn,teamColorByName:jr,onTeamClick:$,onMemberClick:m,onCreateTaskFromMessage:void 0,onReplyToMessage:b,onMessageVisible:nr,onRestartTeam:y,onTaskIdClick:x,onExpandItem:tt,onExpandContent:_e,viewport:Te}),N&&u.jsx("div",{className:"flex justify-center py-2",children:u.jsxs("div",{className:"flex flex-col items-center gap-1",children:[u.jsx(Me,{variant:"ghost",size:"sm",className:"text-xs text-text-muted","aria-busy":j,disabled:j,onClick:()=>void z(),children:"加载更早消息"}),u.jsxs("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:["已加载 ",V," 条"]})]})}),u.jsx(qC,{expandedItem:Ce,open:J!==null,onOpenChange:ve,teamName:t,members:i,onCreateTaskFromMessage:void 0,onReplyToMessage:b,onMemberClick:m,onTaskIdClick:x,onRestartTeam:y,teamNames:Zn,teamColorByName:jr,onTeamClick:$})]})]});if(n==="bottom-sheet"){if(!s)return u.jsx("div",{className:"hidden","aria-hidden":"true"});const We=ut===sQ;return u.jsx(Xw,{ref:H,isOpen:!0,onClose:Ee,mountPoint:s,avoidKeyboard:!1,detent:"full",snapPoints:wt,initialSnap:ut,onSnap:tn,disableDismiss:!0,disableScrollLocking:!0,style:{zIndex:30},className:"!pointer-events-none !absolute !inset-0",unstyled:!0,children:u.jsxs(Xw.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(Xw.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(Xw.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(mo,{size:13,className:"shrink-0 text-[var(--color-text-muted)]"}),u.jsx("span",{className:"text-[13px] font-medium text-[var(--color-text)]",children:"消息"}),At.length>0&&u.jsx($t,{variant:"secondary",className:"px-1 py-0 text-[9px] font-normal leading-none",children:At.length}),Wt>0&&u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsxs($t,{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:[Wt," 条新消息"]})}),u.jsxs(it,{side:"top",children:[Wt," 条未读"]})]}),u.jsxs("div",{className:"ml-auto flex items-center gap-1",onPointerDown:Tt=>Tt.stopPropagation(),children:[Wt>0&&u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx(Me,{variant:"ghost",size:"sm",className:"size-[22px] p-0 text-blue-400 hover:bg-blue-500/10 hover:text-blue-300",onClick:Xe,"aria-label":"将全部消息标为已读",children:u.jsx(EQ,{size:13})})}),u.jsx(it,{side:"top",children:"全部标为已读"})]}),u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx(Me,{variant:"ghost",size:"sm",className:"size-[22px] p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:()=>se(Tt=>!Tt),"aria-label":W?"展开全部消息":"折叠全部消息",children:W?u.jsx(Fk,{size:14}):u.jsx(Q4,{size:14})})}),u.jsx(it,{side:"top",children:W?"展开全部消息":"折叠全部消息"})]}),u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx(Me,{variant:"ghost",size:"sm",className:"size-[22px] p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:()=>we(Tt=>!Tt),"aria-label":he?"隐藏消息搜索":"显示消息搜索",children:he?u.jsx(Pr,{size:14}):u.jsx(Mi,{size:14})})}),u.jsx(it,{side:"top",children:he?"隐藏搜索":"搜索消息"})]}),u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx(Me,{variant:"ghost",size:"sm",className:"size-[22px] p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:yt,"aria-label":We?"展开底部消息面板":"折叠底部消息面板",children:We?u.jsx(oht,{size:14}):u.jsx(sht,{size:14})})}),u.jsx(it,{side:"top",children:We?"展开面板":"折叠面板"})]}),u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx(Me,{variant:"ghost",size:"sm",className:"size-[22px] p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:Ee,"aria-label":"将消息移到页面内面板",children:u.jsx(ype,{size:14})})}),u.jsx(it,{side:"top",children:"移到页面内"})]}),u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx(Me,{variant:"ghost",size:"sm",className:"size-[22px] p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:le,"aria-label":"将消息移到侧边栏",children:u.jsx(CH,{size:14})})}),u.jsx(it,{side:"top",children:"移到侧边栏"})]})]})]})]})}),!We&&u.jsxs(Xw.Content,{className:"min-h-0 bg-[var(--color-surface-sidebar)]",scrollClassName:"flex min-h-full flex-col",scrollRef:ie,disableDrag:Tt=>Tt.scrollPosition!=="top",children:[u.jsxs("div",{ref:G,className:"sticky top-0 z-[1] shrink-0 border-b border-[var(--color-border)] backdrop-blur",style:{backgroundColor:"var(--color-surface-sidebar)"},children:[he&&u.jsx("div",{className:"border-b border-[var(--color-border)] px-3 py-2",children:Ut}),u.jsx("div",{className:"p-3",children:u.jsx(g9,{teamName:t,layout:"compact",members:i,isTeamAlive:a,sending:w,sendError:P,sendWarning:C,sendDebugDetails:k,lastResult:I,sessions:ue,selectedSessionKey:nt,onSessionChange:Ge,textareaRef:ee,onSend:Re,onDispatchTask:me})})]}),u.jsx("div",{className:"shrink-0 px-3 pt-2",children:u.jsx(O9,{members:i,tasks:o,messages:_t,pendingRepliesByMember:f,layout:"flow",position:"inline",onMemberClick:m,onTaskClick:g})}),u.jsxs("div",{className:"flex-1 px-3 pb-4 pt-2",children:[u.jsx(h9,{messages:Ve,teamName:t,members:i,readState:nn,allCollapsed:W,expandOverrides:Ct,onToggleExpandOverride:Xt,currentLeadSessionId:p,isTeamAlive:a,leadActivity:c,leadContextUpdatedAt:l,teamNames:Zn,teamColorByName:jr,onTeamClick:$,onMemberClick:m,onCreateTaskFromMessage:void 0,onReplyToMessage:b,onMessageVisible:nr,onRestartTeam:y,onTaskIdClick:x,onExpandItem:tt,onExpandContent:_e,viewport:Te}),N&&u.jsx("div",{className:"flex justify-center py-2",children:u.jsxs("div",{className:"flex flex-col items-center gap-1",children:[u.jsx(Me,{variant:"ghost",size:"sm",className:"text-xs text-text-muted","aria-busy":j,disabled:j,onClick:()=>void z(),children:"加载更早消息"}),u.jsxs("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:["已加载 ",V," 条"]})]})})]}),u.jsx(qC,{expandedItem:Ce,open:J!==null,onOpenChange:ve,teamName:t,members:i,onCreateTaskFromMessage:void 0,onReplyToMessage:b,onMemberClick:m,onTaskIdClick:x,onRestartTeam:y,teamNames:Zn,teamColorByName:jr,onTeamClick:$})]})]})})}return u.jsx(Vp,{sectionId:"messages",title:"消息",icon:u.jsx(mo,{size:14}),badge:At.length,secondaryBadge:At.length>0&&Wt>0?Wt:void 0,afterBadge:Wt>0?u.jsxs(at,{children:[u.jsx(lt,{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:We=>{We.stopPropagation(),Xe()},children:u.jsx(EQ,{size:12})})}),u.jsx(it,{side:"bottom",children:"全部标为已读"})]}):void 0,headerExtra:v?u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx(Me,{variant:"ghost",size:"sm",className:"pointer-events-auto size-6 p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:We=>{We.stopPropagation(),je()},"aria-label":"将消息移到底部面板",children:u.jsx(ype,{size:14})})}),u.jsx(it,{side:"top",children:"移到底部面板"})]}),u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx(Me,{variant:"ghost",size:"sm",className:"pointer-events-auto size-6 p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:We=>{We.stopPropagation(),le()},"aria-label":"将消息移到侧边栏",children:u.jsx(CH,{size:14})})}),u.jsx(it,{side:"top",children:"移到侧边栏"})]})]}):void 0,defaultOpen:!0,action:u.jsx("div",{className:"flex items-center gap-2 px-2",children:yn}),children:Rn})});function T9n(e){return e.ledgerSummary?.deletedInTask?"deleted":e.isNewFile||e.ledgerSummary?.createdInTask?"added":"modified"}const E9n=({open:e,onOpenChange:t,teamName:n,taskId:r,taskChangeRequestOptions:s})=>{const i=re(h=>h.changeSetLoading),o=re(h=>h.changeSetError),a=re(h=>h.activeChangeSet),c=re(h=>h.fetchTaskChanges),[l,d]=O.useState([]);O.useEffect(()=>{if(!e||!r){d([]);return}s&&c&&c(n,r,s)},[e,n,r,s,c]),O.useEffect(()=>{a?.files&&d(a.files)},[a]);const p=O.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(Pr,{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=T9n(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:"未记录文件变更"})})]})]})},w9n=({projectPath:e})=>{const[t,n]=O.useState([]),[r,s]=O.useState({}),[i,o]=O.useState(new Set),[a,c]=O.useState(!1),[l,d]=O.useState(!1),[p,f]=O.useState(null),[h,m]=O.useState(null),g=O.useCallback(async()=>{if(!(!e||!Z.credentials)){c(!0),f(null);try{const x=[],S=[];if(Z.skills)try{const P=await Z.skills.list(e);for(const C of P){const k=C.requiredEnv??[];k.length>0&&S.push({name:C.name,envVars:k.map(I=>({name:I.name,isRequired:I.isRequired??!0,description:I.description}))})}}catch{}const T=(await Z.credentials.scanRequired(e,x,S).catch(()=>null))?.required??[];n(T);const E=await Z.credentials.getProjectEnv(e).catch(()=>({})),w={};for(const P of T)w[P.name]=E?.[P.name]??P.value??"";s(w)}catch(x){f(x instanceof Error?x.message:"扫描环境变量失败")}finally{c(!1)}}},[e]);O.useEffect(()=>{g()},[g]);const _=async()=>{if(!(!e||!Z.credentials)){d(!0),f(null),m(null);try{await Z.credentials.saveProjectEnv(e,r),m("环境变量已加密保存"),setTimeout(()=>m(null),3e3),await g()}catch(x){f(x instanceof Error?x.message:"保存失败")}finally{d(!1)}}},b=x=>{o(S=>{const v=new Set(S);return v.has(x)?v.delete(x):v.add(x),v})};if(!e)return u.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-text-muted",children:[u.jsx(Kne,{className:"mb-3 size-10 opacity-40"}),u.jsx("p",{className:"text-sm",children:"请先选择一个项目以管理环境变量。"})]});if(a)return u.jsx("div",{className:"flex items-center justify-center py-12 text-text-muted",children:u.jsx("p",{className:"text-sm",children:"正在扫描项目所需的环境变量..."})});const y=t.filter(x=>x.isRequired&&!r[x.name]?.trim());return u.jsxs("div",{className:"space-y-4 px-1",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"text-sm font-medium text-text",children:"项目环境变量"}),u.jsx("p",{className:"text-xs text-text-muted",children:"管理当前项目所需的环境变量,供 Skills 和 CLI 工具使用。值已加密存储。"})]}),u.jsx(Me,{size:"sm",variant:"outline",onClick:()=>void g(),disabled:a,children:"刷新"})]}),p&&u.jsx("div",{className:"rounded-md border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-400",children:p}),h&&u.jsx("div",{className:"rounded-md border border-emerald-500/30 bg-emerald-500/10 px-3 py-2 text-xs text-emerald-400",children:h}),y.length>0&&u.jsxs("div",{className:"rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-xs text-amber-400",children:["缺少必填变量:",y.map(x=>x.name).join(", ")]}),t.length===0&&!a&&u.jsx("div",{className:"py-8 text-center text-xs text-text-muted",children:"未检测到所需的环境变量。启用 MCP 服务器或 Skills 后会自动扫描。"}),t.length>0&&u.jsxs("div",{className:"space-y-3",children:[t.map(x=>u.jsxs("div",{className:"space-y-1.5",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Zt,{className:"font-mono text-xs text-text",children:x.name}),u.jsx("span",{className:`rounded px-1.5 py-0.5 text-[10px] font-medium ${x.isRequired?"bg-red-500/10 text-red-400":"bg-surface-raised text-text-muted"}`,children:x.isRequired?"必填":"可选"}),u.jsxs("span",{className:"text-[10px] text-text-muted",children:["来自 ",x.source]})]}),x.description&&u.jsx("p",{className:"text-[11px] text-text-muted",children:x.description}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(An,{type:i.has(x.name)?"text":"password",value:r[x.name]??"",onChange:S=>s(v=>({...v,[x.name]:S.target.value})),placeholder:x.isRequired?"必填":"可选",className:"h-7 flex-1 font-mono text-xs"}),u.jsx(Me,{size:"icon",variant:"ghost",className:"size-7 shrink-0",onClick:()=>b(x.name),children:i.has(x.name)?u.jsx(hU,{className:"size-3.5"}):u.jsx(Qb,{className:"size-3.5"})})]})]},x.name)),u.jsx("div",{className:"pt-2",children:u.jsxs(Me,{size:"sm",onClick:()=>void _(),disabled:l,children:[u.jsx(oMe,{className:"mr-1.5 size-3.5"}),l?"保存中...":"加密保存"]})})]})]})};function iPe(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 k9n(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 C9n(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 R9n=O.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?`${iPe(new Date(o.registeredAt))} 前`:`${iPe(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(zo,{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 Z.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 Z.teams.killProcess(t,o.pid),title:"停止进程(SIGTERM)",children:[u.jsx(lMe,{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 Z.openExternal(o.url),title:"在浏览器中打开",children:[u.jsx(zd,{size:10}),"打开"]}),u.jsxs("span",{className:"font-mono text-[var(--color-text-muted)]",children:["PID",o.pid]}),o.registeredBy&&u.jsx(Ur,{name:o.registeredBy,color:s.get(o.registeredBy),teamName:t}),u.jsx("span",{className:"text-[var(--color-text-muted)]",children:c})]})]},o.id)})})},P9n);function P9n(e,t){return e.teamName===t.teamName&&k9n(e.members,t.members)&&C9n(e.processes,t.processes)}const iQ=O.memo(function({teamName:t}){return u.jsx(mKe,{teamName:t,surface:"flat",dismissible:!0,className:"mb-3"})});function Ust(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 $9n(e){const{suppressionKey:t,currentKey:n}=e;return t===n&&Ust(e)}const N9n=O.lazy(()=>De(()=>import("./ProjectEditorOverlay-B_QAoeaA.js"),__vite__mapDeps([61,1])).then(e=>({default:e.ProjectEditorOverlay}))),A9n=1e4;function I9n(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 M9n(e){const t=O.useMemo(()=>(e??[]).filter(r=>!r.removedAt),[e]),n=O.useRef(t);return I9n(n.current,t)||(n.current=t),n.current}function Q9n(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))}O.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(zn,{size:14,className:"shrink-0"}),"团队离线中"]}),u.jsxs(Me,{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(w$,{size:12}),"启动"]})]})});function D9n(e){if(!e)return;const t=new Map(Object.entries(e));return t.size>0?t:void 0}function L9n(e){if(!e)return;const t=new Map(Object.entries(e));return t.size>0?t:void 0}const j9n=O.memo(function({teamName:t,isTeamProvisioning:n,isTeamAlive:r}){const{leadActivity:s,memberSpawnStatuses:i,memberSpawnSnapshot:o,fetchMemberSpawnStatuses:a}=re(vt(c=>({leadActivity:c.leadActivityByTeam[t],memberSpawnStatuses:c.memberSpawnStatusesByTeam[t],memberSpawnSnapshot:c.memberSpawnSnapshotsByTeam[t],fetchMemberSpawnStatuses:c.fetchMemberSpawnStatuses})));return O.useEffect(()=>{const c=cBn(i,o);if((n||c||i==null&&(r===!0||s==="active"||s==="idle"))&&a(t),!n&&!c)return;const d=window.setInterval(()=>{a(t)},lBn);return()=>{window.clearInterval(d)}},[a,r,n,s,o,i,t]),null}),X9n=15e3,U9n=O.memo(function({teamName:t,isTeamProvisioning:n,isTeamAlive:r,isThisTabActive:s}){const{leadActivity:i,fetchTeamAgentRuntime:o}=re(vt(a=>({leadActivity:a.leadActivityByTeam[t],fetchTeamAgentRuntime:a.fetchTeamAgentRuntime})));return O.useEffect(()=>{if(!s||!(n||r===!0||i==="active"||i==="idle"))return;o(t);const c=window.setInterval(()=>{o(t)},X9n);return()=>{window.clearInterval(c)}},[o,r,n,s,i,t]),null}),z9n=O.memo(function({teamName:t,tabId:n,projectId:r,leadSessionId:s,sessionHistoryKey:i,isThisTabActive:o,isTeamAlive:a,sessions:c,sessionsLoading:l}){const d=re(h=>h.fetchSessionDetail),p=O.useRef(null),f=O.useMemo(()=>`${t}:${r??""}:${s??""}:${i}`,[t,r,s,i]);return O.useEffect(()=>{p.current=null},[f]),O.useEffect(()=>{if(!o||!n||!r||!s)return;if(Ust({leadSessionId:s,projectId:r,sessionsLoading:l,knownSessions:c})){p.current=f;return}const m=()=>{$9n({leadSessionId:s,projectId:r,sessionsLoading:l,knownSessions:c,suppressionKey:p.current,currentKey:f})||d(r,s,n,{silent:!0})};if(m(),!a)return;const g=window.setInterval(()=>{m()},1e4);return()=>window.clearInterval(g)},[d,a,o,s,f,r,c,l,n]),null}),B9n=O.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}=re(vt($=>({leadTabData:n?$.tabSessionData[n]??null:null,leadContextSnapshot:$.leadContextByTeam[t]??null,isContextPanelVisible:n?$.tabUIStates.get(n)?.showContextPanel??!1:!1,selectedContextPhase:n?$.tabUIStates.get(n)?.selectedContextPhase??null:null,setContextPanelVisibleForTab:$.setContextPanelVisibleForTab,setSelectedContextPhaseForTab:$.setSelectedContextPhaseForTab,fetchSessionDetail:$.fetchSessionDetail}))),[h,m]=O.useState(!1),g=O.useCallback($=>{n&&d(n,$)},[d,n]),_=O.useCallback($=>{n&&p(n,$)},[p,n]),b=o?.sessionDetail??null,y=o?.conversation??null,x=o?.sessionContextStats??null,S=o?.sessionPhaseInfo??null,v=o?.sessionDetailLoading??!1,T=!!(s&&b?.session?.id===s),E=O.useMemo(()=>{const $=b?.processes;if(!$||$.length===0)return;const R=$.reduce((N,j)=>N+(j.metrics.costUsd??0),0);return R>0?R:void 0},[b?.processes]),{allContextInjections:w,lastAssistantUsage:P,lastAssistantModelName:C}=O.useMemo(()=>{if(!T||!x||!y?.items.length)return{allContextInjections:[],lastAssistantUsage:null,lastAssistantModelName:void 0};const $=l;let R;if($!==null&&S){const F=S.phases.find(z=>z.phaseNumber===$);F&&(R=F.lastAIGroupId)}if(!R){const F=[...y.items].reverse().find(z=>z.type==="ai");if(F?.type!=="ai")return{allContextInjections:[],lastAssistantUsage:null,lastAssistantModelName:void 0};R=F.group.id}const j=x.get(R)?.accumulatedInjections??[];let M=null,U;const A=y.items.find(F=>F.type==="ai"&&F.group.id===R);if(A?.type==="ai"){const F=A.group.responses||[];for(let z=F.length-1;z>=0;z--){const D=F[z];if(D.type==="assistant"&&D.usage){M=D.usage,U=D.model;break}}}return{allContextInjections:j,lastAssistantUsage:M,lastAssistantModelName:U}},[y,x,T,S,l]),k=O.useMemo(()=>Cce(w),[w]),I=O.useMemo(()=>Utt({usage:P,modelName:C,contextWindowTokens:a?.contextWindowTokens??null,visibleContextTokens:k}),[C,P,a?.contextWindowTokens,k]),Q=O.useMemo(()=>{const $=I.contextUsedPercentOfContextWindow??a?.contextUsedPercent;return $==null?null:`${$.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(jtt,{injections:w,onClose:()=>g(!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:()=>g(!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:()=>{g(!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:Q??"上下文"})})]}):null}),F9n=O.memo(function({teamName:t,...n}){const{leadActivity:r,progress:s,memberSpawnStatuses:i,memberSpawnSnapshot:o,runtimeSnapshot:a}=re(vt(f=>({leadActivity:f.leadActivityByTeam[t],progress:Ef(f,t),memberSpawnStatuses:f.memberSpawnStatusesByTeam[t],memberSpawnSnapshot:f.memberSpawnSnapshotsByTeam[t],runtimeSnapshot:f.teamAgentRuntimeByTeam[t]}))),c=O.useMemo(()=>D9n(i),[i]),l=O.useMemo(()=>L9n(a?.members),[a?.members]),d=a?.runId??o?.runId??s?.runId,p=O.useMemo(()=>s?.state!=="ready"?!1:Iz(Az({members:n.members,memberSpawnStatuses:i,memberSpawnSnapshot:o})).hasMembersStillJoining,[o,i,s?.state,n.members]);return u.jsx(zYn,{...n,leadActivity:r,memberSpawnStatuses:c,memberRuntimeEntries:l,runtimeRunId:d,isLaunchSettling:p})}),Y9n=O.memo(function({teamName:t,...n}){const{leadActivity:r,leadContextUpdatedAt:s}=re(vt(i=>({leadActivity:i.leadActivityByTeam[t],leadContextUpdatedAt:i.leadContextByTeam[t]?.updatedAt})));return u.jsx(v9n,{...n,teamName:t,leadActivity:r,leadContextUpdatedAt:s})}),V9n=O.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}=re(vt(m=>({leadActivity:m.leadActivityByTeam[t],liveMember:n?RXe(m,t,n.name):null,progress:Ef(m,t),launchMembers:Use(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??Ef(m,t)?.runId,runtimeEntry:n?m.teamAgentRuntimeByTeam[t]?.members[n.name]:void 0}))),h=O.useMemo(()=>o?.state!=="ready"?!1:Iz(Az({members:a,memberSpawnStatuses:c,memberSpawnSnapshot:l})).hasMembersStillJoining,[a,l,c,o?.state]);return u.jsx(kYn,{...r,teamName:t,member:i??n,isLaunchSettling:h,leadActivity:s,spawnEntry:d,runtimeEntry:f,runtimeRunId:p})}),q9n=({teamName:e,isPaneFocused:t=!1})=>{const{isLight:n}=Js(),[r,s]=O.useState(null),[i,o]=O.useState(null),[a,c]=O.useState(null),[l,d]=O.useState(null),[p,f]=O.useState(()=>tPe(e)),[h,m]=O.useState({open:!1,defaultSubject:"",defaultDescription:"",defaultOwner:""}),[g,_]=O.useState(!1),[b,y]=O.useState(null),[x,S]=O.useState(!1),[v,T]=O.useState(!1),[E,w]=O.useState(!1),[P,C]=O.useState(!1),[k,I]=O.useState({open:!1,mode:"launch"}),[Q,$]=O.useState(!1),R=O.useRef(null),N=O.useRef(null),j=O.useRef(!1);O.useEffect(()=>{const Pe=R.current;Pe&&(Q?Pe.setAttribute("inert",""):Pe.removeAttribute("inert"))},[Q]),O.useEffect(()=>{const Pe=sr=>{const{teamName:xr,taskId:Cs}=sr.detail??{};if(xr!==e||!ae)return;const Ha=ae.tasks.find(qf=>qf.id===Cs);Ha&&o(Ha)},He=sr=>{const{teamName:xr,memberName:Cs}=sr.detail??{};xr===e&&(te(Cs),G(void 0),ne(void 0),U(!0))},Vt=sr=>{const{teamName:xr,memberName:Cs,initialTab:Ha,initialActivityFilter:qf}=sr.detail??{};if(xr!==e||!ae)return;const ax=$e.find(WB=>WB.name===Cs);ax&&(c(ax),d({initialTab:Ha,initialActivityFilter:qf}))},rr=sr=>{const{teamName:xr,owner:Cs}=sr.detail??{};xr===e&&eu("","",Cs??"")};window.addEventListener("graph:open-task",Pe),window.addEventListener("graph:send-message",He),window.addEventListener("graph:open-profile",Vt),window.addEventListener("graph:create-task",rr);const Fr=sr=>xr=>{const{teamName:Cs,taskId:Ha}=xr.detail??{};Cs!==e||!Ha||sr(Ha)},ge=Fr(sr=>{(async()=>{try{const xr=await xe(e,sr);if(ae?.isAlive){const Cs=ae.tasks.find(Ha=>Ha.id===sr);try{xr.notifiedOwner&&Cs?.owner&&await Z.teams.processSend(e,`Task ${Ps(Cs)} "${Cs.subject}" has started. Please begin working on it.`)}catch{}}}catch{}})()}),ht=Fr(sr=>{(async()=>{try{await tn(e,sr,"completed")}catch{}})()}),Bt=Fr(sr=>{(async()=>{try{await Qt(e,sr,{op:"set_column",column:"approved"})}catch{}})()}),xn=Fr(sr=>{(async()=>{try{await Lt(e,sr)}catch{}})()}),En=Fr(sr=>{s(sr)}),Dn=Fr(sr=>{(async()=>{try{await tn(e,sr,"pending")}catch{}})()}),no=Fr(sr=>{(async()=>{try{await Qt(e,sr,{op:"remove"}),await tn(e,sr,"completed")}catch{}})()}),Oa=Fr(sr=>hp(sr));return window.addEventListener("graph:start-task",ge),window.addEventListener("graph:complete-task",ht),window.addEventListener("graph:approve-task",Bt),window.addEventListener("graph:request-review",xn),window.addEventListener("graph:request-changes",En),window.addEventListener("graph:cancel-task",Dn),window.addEventListener("graph:move-back-to-done",no),window.addEventListener("graph:delete-task",Oa),()=>{window.removeEventListener("graph:open-task",Pe),window.removeEventListener("graph:send-message",He),window.removeEventListener("graph:open-profile",Vt),window.removeEventListener("graph:create-task",rr),window.removeEventListener("graph:start-task",ge),window.removeEventListener("graph:complete-task",ht),window.removeEventListener("graph:approve-task",Bt),window.removeEventListener("graph:request-review",xn),window.removeEventListener("graph:request-changes",En),window.removeEventListener("graph:cancel-task",Dn),window.removeEventListener("graph:move-back-to-done",no),window.removeEventListener("graph:delete-task",Oa)}});const[M,U]=O.useState(!1),[A,F]=O.useState(!1),[z,D]=O.useState(!1),[V,q]=O.useState(!1),[ee,te]=O.useState(void 0),[H,G]=O.useState(void 0),[ie,ne]=O.useState(void 0),[pe,Te]=O.useState(void 0),[_e,be]=O.useState({open:!1,mode:"task"}),[Ie,Se]=O.useState([]),oe=k.open,[Oe,K]=O.useState([]),[Y,W]=O.useState(!1),[se,he]=O.useState(null),[we,J]=O.useState({sessionId:null,selectedOwners:new Set,columns:new Set}),[de,ue]=O.useState({field:"updatedAt"}),{data:ae,members:$e,loading:qe,error:ot,projects:Ot,repositoryGroups:nt,initTabUIState:Ge,selectTeam:St,updateKanban:Qt,updateKanbanColumnOrder:ft,updateTaskStatus:tn,updateTaskOwner:jt,sendTeamMessage:On,requestReview:Lt,createTeamTask:fn,startTaskByUser:xe,deleteTeam:Fe,openTeamsTab:_t,closeTab:At,sendingMessage:Ve,sendMessageError:et,sendMessageWarning:Ce,sendMessageDebugDetails:tt,lastSendMessageResult:ve,reviewActionError:Ue,restartMember:mt,skipMemberForLaunch:Ke,removeMember:Ct,updateMemberRole:Xt,launchTeam:Wt,provisioningError:nr,clearProvisioningError:nn,isTeamProvisioning:Zn,refreshTeamData:jr,refreshTeamMessagesHead:Xe,refreshMemberActivityMeta:Re,syncTeamPendingReplyRefresh:me,kanbanFilterQuery:Ee,clearKanbanFilter:le,softDeleteTask:je,restoreTask:Be,fetchDeletedTasks:yt,deletedTasks:wt,launchParams:ut,selectReviewFile:Ut,pendingReviewRequest:yn,setPendingReviewRequest:Rn,teams:We,fetchTeams:Tt}=re(vt(Pe=>({projects:Pe.projects,repositoryGroups:Pe.repositoryGroups,initTabUIState:Pe.initTabUIState,selectTeam:Pe.selectTeam,updateKanban:Pe.updateKanban,updateKanbanColumnOrder:Pe.updateKanbanColumnOrder,updateTaskStatus:Pe.updateTaskStatus,updateTaskOwner:Pe.updateTaskOwner,sendTeamMessage:Pe.sendTeamMessage,requestReview:Pe.requestReview,createTeamTask:Pe.createTeamTask,startTaskByUser:Pe.startTaskByUser,deleteTeam:Pe.deleteTeam,openTeamsTab:Pe.openTeamsTab,closeTab:Pe.closeTab,sendingMessage:Pe.sendingMessage,sendMessageError:Pe.sendMessageError,sendMessageWarning:Pe.sendMessageWarning,sendMessageDebugDetails:Pe.sendMessageDebugDetails,lastSendMessageResult:Pe.lastSendMessageResult,reviewActionError:Pe.reviewActionError,restartMember:Pe.restartMember,skipMemberForLaunch:Pe.skipMemberForLaunch,removeMember:Pe.removeMember,updateMemberRole:Pe.updateMemberRole,launchTeam:Pe.launchTeam,provisioningError:e?Pe.provisioningErrorByTeam[e]??null:null,clearProvisioningError:Pe.clearProvisioningError,isTeamProvisioning:e?T_(Pe,e):!1,data:Pe.selectedTeamName===e?Pe.selectedTeamData:null,members:kl(Pe,e),loading:Pe.selectedTeamName===e?Pe.selectedTeamLoading:!1,error:Pe.selectedTeamName===e?Pe.selectedTeamError:null,refreshTeamData:Pe.refreshTeamData,refreshTeamMessagesHead:Pe.refreshTeamMessagesHead,refreshMemberActivityMeta:Pe.refreshMemberActivityMeta,syncTeamPendingReplyRefresh:Pe.syncTeamPendingReplyRefresh,kanbanFilterQuery:Pe.kanbanFilterQuery,clearKanbanFilter:Pe.clearKanbanFilter,softDeleteTask:Pe.softDeleteTask,restoreTask:Pe.restoreTask,fetchDeletedTasks:Pe.fetchDeletedTasks,deletedTasks:Pe.deletedTasks,launchParams:e?Pe.launchParamsByTeam[e]:void 0,selectReviewFile:Pe.selectReviewFile,pendingReviewRequest:Pe.pendingReviewRequest,setPendingReviewRequest:Pe.setPendingReviewRequest,teams:Pe.teams,fetchTeams:Pe.fetchTeams}))),Kn=C3(),Ar=re(Pe=>Pe.activeTabId),Ne=Kn?Ar===Kn:!1,Ae=O.useRef(!1),mn=O.useCallback(Pe=>{},[]);O.useEffect(()=>{Kn&&Ge(Kn)},[Kn,Ge]),O.useEffect(()=>{f(tPe(e))},[e]),O.useEffect(()=>{Z8n(e,p)},[p,e]),O.useEffect(()=>{const Pe=j.current;j.current=Zn,!Pe&&Zn&&N.current?.scrollIntoView({behavior:"smooth",block:"start"})},[Zn]);const[Xn,ks]=O.useState(""),Us=re(Pe=>Pe.editorPendingRevealFile);O.useEffect(()=>{Us&&ae?.config.projectPath&&$(!0)},[Us,ae?.config.projectPath]),O.useEffect(()=>{e&&(St(e),yt(e))},[e,St,yt]);const Rl=ae?.teamName;O.useEffect(()=>{!Ne||!e||qe||Rl!=null&&Rl!==e&&St(e)},[Ne,e,Rl,qe,St]),O.useEffect(()=>{const Pe=Ne&&t,He=Pe&&!Ae.current;Ae.current=Pe,!(!He||!e)&&(async()=>{try{(await Xe(e)).feedChanged&&await Re(e)}catch{}})()},[t,Ne,Re,Xe,e]),O.useEffect(()=>{if(!oe)return;let Pe=!1;const He=re.getState().teams;return(async()=>{try{const Vt=await Z.teams.aliveList();if(Pe)return;const rr=new Set(Vt),Fr=He.filter(ge=>rr.has(ge.teamName)&&ge.projectPath).map(ge=>({teamName:ge.teamName,displayName:ge.displayName,projectPath:ge.projectPath}));Se(Fr)}catch{}})(),()=>{Pe=!0}},[oe]),O.useEffect(()=>{Ee&&(ks(Ee),le())},[Ee,le]);const Jt=O.useMemo(()=>SDn(ae?.config.projectPath,Ot,nt),[Ot,nt,ae?.config.projectPath]),In=ae?.config.leadSessionId??null,Nn=O.useId(),cr=O.useMemo(()=>(ae?.config.sessionHistory??[]).join("|"),[ae?.config.sessionHistory]);O.useEffect(()=>{const Pe=Object.keys(p).length>0;return me(e,Nn,!!ae?.isAlive&&Pe,A9n),()=>{me(e,Nn,!1)}},[ae?.isAlive,p,Nn,me,e]),O.useEffect(()=>{if(!Jt)return;let Pe=!1;return W(!0),he(null),(async()=>{try{const He=await Z.getSessions(Jt);Pe||K(He)}catch(He){Pe||he(He instanceof Error?He.message:"加载会话失败")}finally{Pe||W(!1)}})(),()=>{Pe=!0}},[Jt]);const _s=ae?.config.projectPath?.trim()??null,zr=O.useMemo(()=>{const Pe=$e.find(He=>Jn(He))?.cwd?.trim();return Pe&&Pe.length>0?Pe:_s},[$e,_s]),mr=O.useMemo(()=>{const Pe=new Map,He=Vt=>{const rr=Vt?.trim();if(!rr)return;const Fr=dr(rr);!Fr||Pe.has(Fr)||Pe.set(Fr,rr)};He(zr);for(const Vt of $e)He(Vt.cwd);return Array.from(Pe.values())},[$e,zr]);Xtt(mr,{live:!0});const gr=re(vt(Pe=>Object.fromEntries(mr.map(He=>{const Vt=dr(He);return[Vt,Pe.branchByPath[Vt]??null]})))),Ms=zr?gr[dr(zr)]??null:null,Oi=O.useMemo(()=>ae?$e.map(Pe=>{const He=Pe.cwd?.trim(),Vt=He&&!Jn(Pe)&&Ms!==null?(()=>{const Fr=gr[dr(He)]??null;return Fr&&Fr!==Ms?Fr:void 0})():void 0;if(Pe.gitBranch===Vt)return Pe;const rr={...Pe};return Vt?rr.gitBranch=Vt:delete rr.gitBranch,rr}):[],[Ms,$e,gr]);O.useMemo(()=>Co(Oi),[Oi]);const ki=O.useMemo(()=>{const Pe=new Set;if(ae?.config.leadSessionId&&Pe.add(ae.config.leadSessionId),ae?.config.sessionHistory)for(const He of ae.config.sessionHistory)Pe.add(He);return Pe},[ae?.config.leadSessionId,ae?.config.sessionHistory]),od=O.useMemo(()=>Oe.filter(Pe=>ki.has(Pe.id)),[Oe,ki]);O.useEffect(()=>{we.sessionId!==null&&!od.some(Pe=>Pe.id===we.sessionId)&&J(Pe=>({...Pe,sessionId:null}))},[we.sessionId,od]);const qa=O.useMemo(()=>{if(we.sessionId===null)return null;const Pe=[...od].sort((Fr,ge)=>Fr.createdAt-ge.createdAt),He=Pe.findIndex(Fr=>Fr.id===we.sessionId);if(He===-1)return null;const Vt=Pe[He].createdAt,rr=He+1<Pe.length?Pe[He+1].createdAt:1/0;return{start:Vt,end:rr}},[we.sessionId,od]),Jc=O.useMemo(()=>{if(!ae)return[];let Pe=ae.tasks;return qa&&(Pe=Pe.filter(He=>{if(!He.createdAt)return!0;const Vt=new Date(He.createdAt).getTime();return Vt>=qa.start&&Vt<qa.end})),we.selectedOwners.size>0&&(Pe=Pe.filter(He=>He.owner?we.selectedOwners.has(He.owner):we.selectedOwners.has(Wee))),Pe},[ae,qa,we.selectedOwners]),Pl=M9n(Oi),Yf=O.useMemo(()=>{const Pe=Xn.trim();return Pe?Q9n(Jc,Pe):Jc},[Jc,Xn]),Hm=O.useMemo(()=>Pl.filter(Pe=>!Jn(Pe)).length,[Pl]),Wa=O.useMemo(()=>new Map((ae?.tasks??[]).map(Pe=>[Pe.id,Pe])),[ae?.tasks]),X_=O.useRef(Wa);X_.current=Wa,O.useMemo(()=>gSt(ae?.tasks??[]),[ae?.tasks]);const eu=O.useCallback((Pe="",He="",Vt="",rr)=>{m({open:!0,defaultSubject:Pe,defaultDescription:He,defaultOwner:Vt,defaultStartImmediately:rr})},[]);O.useCallback(()=>{m({open:!1,defaultSubject:"",defaultDescription:"",defaultOwner:"",defaultStartImmediately:void 0})},[]),O.useCallback((Pe,He)=>{eu(Pe,He)},[]);const Br=O.useCallback(Pe=>{te(Pe.from),G(void 0),ne(void 0),Te({from:Pe.from,text:$a(Pe.text)}),U(!0)},[]),tu=O.useCallback(Pe=>{I({open:!0,mode:Pe})},[]),Zm=O.useCallback(()=>{I(Pe=>({...Pe,open:!1}))},[]),Vf=O.useCallback(()=>{tu("relaunch")},[tu]);O.useCallback(()=>{(async()=>{if(!ae?.config.projectPath){tu("launch");return}await Z.ccSettings.restart(),await Z.teams.launchTeam({teamName:e,cwd:ae.config.projectPath}),window.setTimeout(()=>{Tt(),St(e)},1500)})()},[ae?.config.projectPath,Tt,tu,St,e]);const Km=O.useCallback(async Pe=>{await Wt(Pe),await Promise.all([Tt(),St(e)])},[Tt,Wt,St,e]),nu=O.useCallback(async(Pe,He)=>{await CFn({teamName:e,isTeamAlive:ae?.isAlive===!0,request:Pe,members:He,stopTeam:Vt=>Z.teams.stop(Vt),replaceMembers:(Vt,rr)=>Z.teams.replaceMembers(Vt,rr),launchTeam:Wt}),await Promise.all([Tt(),St(e)])},[ae?.isAlive,Tt,Wt,St,e]);O.useCallback(async()=>{await Z.ccSettings.restart(),await Promise.all([Tt(),St(e)])},[Tt,St,e]),O.useCallback(async Pe=>{if(!ae?.config.projectPath)throw new Error("团队缺少项目路径,无法自动重启。");await Z.teams.stop(e);const He={teamName:e,cwd:ae.config.projectPath,providerId:Pe.providerId,model:Pe.model,effort:Pe.effort,fastMode:Pe.fastMode,clearContext:Pe.clearContext};await Wt(He)},[ae?.config.projectPath,Wt,e]);const U_=O.useCallback(async Pe=>{await mt(e,Pe)},[mt,e]),f1=O.useCallback(async Pe=>{await Ke(e,Pe)},[Ke,e]),ix=O.useCallback(Pe=>{c(Pe),d(null)},[]),z_=O.useCallback(()=>{c(null),d(null)},[]),FB=O.useCallback(Pe=>{te(Pe.name),G(void 0),ne(void 0),Te(void 0),U(!0)},[]);O.useCallback(Pe=>{eu("","",Pe.name)},[eu]),O.useCallback(Pe=>{const He=X_.current.get(Pe);He&&o(He)},[]),O.useCallback(Pe=>{o(Pe)},[]),O.useCallback(Pe=>{const He=Wa.get(Pe)??ae?.tasks.find(Vt=>Vt.displayId===Pe);He&&o(He)},[Wa,ae?.tasks]);const uA=O.useCallback(Pe=>{const He=ree(Pe,[])??void 0;Pe.type==="sendMessage"?(G(He?void 0:Pe.formattedContext),ne(He),te(void 0),Te(void 0),U(!0)):Pe.type==="createTask"&&(He?m({open:!0,defaultSubject:"",defaultDescription:"",defaultOwner:"",defaultStartImmediately:void 0,defaultChip:He}):eu("",Pe.formattedContext))},[]);O.useEffect(()=>{yn&&(be({open:!0,mode:"task",taskId:yn.taskId,initialFilePath:yn.filePath,taskChangeRequestOptions:yn.requestOptions}),yn.filePath&&Ut(yn.filePath),Rn(null))},[yn,Ut,Rn]);const Jm=re(Pe=>Pe.pendingMemberProfile);O.useEffect(()=>{if(!Jm||!ae)return;const Pe=Oi.find(He=>He.name===Jm);Pe&&(c(Pe),d(null)),re.getState().closeMemberProfile()},[Jm,Oi]);const hp=O.useCallback(Pe=>{(async()=>{if(await nf({title:"删除任务",message:`将任务 #${Ui(Pe)} 移入废纸篓?`,confirmLabel:"删除",cancelLabel:"取消",variant:"danger"}))try{await je(e,Pe)}catch{}})()},[e,je]),ox=O.useCallback(Pe=>{const He=Wa.get(Pe);be({open:!0,mode:"task",taskId:Pe,taskChangeRequestOptions:He?Yc(He):{}})},[Wa]);O.useCallback((Pe,He)=>{const Vt=Wa.get(Pe);be({open:!0,mode:"task",taskId:Pe,initialFilePath:He,taskChangeRequestOptions:Vt?Yc(Vt):{}}),He&&Ut(He)},[Ut,Wa]);const dA=O.useCallback(()=>{F(!0)},[]),YB=O.useCallback(()=>{D(!0),(async()=>{try{(await Fe(e)).restartRequired&&await Z.ccSettings.restart(),await Tt(),F(!1),Kn&&At(Kn),_t()}catch(Pe){console.error("Failed to delete team:",Pe),F(!1)}finally{D(!1)}})()},[e,Fe,_t,At,Kn,Tt]),VB=O.useMemo(()=>({teamName:e,onPositionChange:mn,mountPoint:null,members:Pl,tasks:ae?.tasks??[],isTeamAlive:ae?.isAlive,timeWindow:qa,teamSessionIds:ki,currentLeadSessionId:ae?.config.leadSessionId,pendingRepliesByMember:p,onPendingReplyChange:f,onMemberClick:ix,onReplyToMessage:Br,onRestartTeam:Vf,inlineScrollContainerRef:R,showPositionControls:!1}),[Pl,ae?.config.leadSessionId,ae?.isAlive,ae?.tasks,Br,Vf,ix,p,e,ki,qa,mn]);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 pA=u.jsx(j9n,{teamName:e,isTeamProvisioning:Zn,isTeamAlive:ae?.isAlive}),Ga=u.jsx(U9n,{teamName:e,isTeamProvisioning:Zn,isTeamAlive:ae?.isAlive,isThisTabActive:Ne}),B_=u.jsx(z9n,{teamName:e,tabId:Kn,projectId:Jt,leadSessionId:In,sessionHistoryKey:cr,isThisTabActive:Ne,isTeamAlive:ae?.isAlive,sessions:Oe,sessionsLoading:Y}),qB=()=>{if(qe&&!ae||ae&&ae.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:N,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(ot==="TEAM_DRAFT"){const He=re.getState().teamByName[e],Vt=He?.displayName||e;return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"size-full overflow-auto p-6",children:[u.jsx("div",{ref:N,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:Vt})," ","尚未完成启动,点击“启动团队”后即可选择模型并进入动态编排。"]}),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:()=>tu("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:()=>{Z.teams.deleteDraft(e).catch(()=>{})},children:"删除"})]})]})})]}),u.jsx(qee,{mode:k.mode,open:oe,teamName:e,members:[],defaultProjectPath:He?.projectPath,provisioningError:nr,clearProvisioningError:nn,onClose:Zm,onLaunch:Km,onRelaunch:nu})]})}if(ot)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:ot}),u.jsx("div",{className:"mt-4",children:u.jsx(Me,{size:"sm",variant:"outline",onClick:()=>void St(e,{allowReloadWhileProvisioning:!0}),children:"重试加载"})})]})});if(!ae)return u.jsxs("div",{className:"size-full overflow-auto p-4",children:[u.jsx("div",{ref:N,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 Pe=ae.config.color?Wr(ae.config.color):qc(ae.config.name);return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex size-full overflow-hidden",children:[u.jsx(B9n,{teamName:e,tabId:Kn,projectId:Jt,leadSessionId:In,fallbackProjectRoot:ae.config.projectPath}),u.jsx("div",{className:"relative min-h-0 min-w-0 flex-1",children:u.jsxs("div",{ref:R,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:[Pe?u.jsx("div",{className:"pointer-events-none absolute inset-0 z-0",style:{backgroundColor:wi(Pe,n)}}):null,u.jsxs("div",{className:st("flex items-start justify-between gap-2",Pe&&"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:ae.config.name}),ae.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"}),"运行中"]}),!ae.isAlive&&Zn&&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(Me,{variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2.5 text-xs text-[var(--color-text-secondary)]",disabled:Zn,onClick:()=>T(!0),children:[u.jsx(Db,{size:12}),"编辑"]}),u.jsxs(uc,{open:P,onOpenChange:C,children:[u.jsx(Gc,{asChild:!0,children:u.jsx(Me,{variant:"ghost",size:"sm",className:"h-7 w-7 px-0 text-[var(--color-text-muted)]",children:u.jsx(Vne,{size:14})})}),u.jsxs(Sl,{align:"end",className:"w-44 p-1",children:[ae.config.projectPath&&u.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-xs text-[var(--color-text-secondary)] hover:bg-[var(--color-surface-raised)] hover:text-[var(--color-text)]",onClick:()=>{C(!1),w(!0)},children:[u.jsx(Kne,{size:13}),"环境变量"]}),e!=="default"&&e!=="my-project"&&u.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-xs text-red-400 hover:bg-red-500/10",onClick:()=>{C(!1),dA()},children:[u.jsx(Ai,{size:13}),"删除团队"]})]})]})]})]}),ae.config.description&&u.jsx("p",{className:st("min-w-0 truncate text-xs text-[var(--color-text-muted)]",Pe&&"relative z-10"),children:ae.config.description}),u.jsx("div",{className:st("mt-1 flex items-start justify-between gap-3",Pe&&"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:[ae.config.projectPath&&u.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--color-text-secondary)]",children:[u.jsx(Fc,{size:11,className:"shrink-0 text-[var(--color-text-muted)]"}),u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx("span",{className:"max-w-60 truncate font-mono",children:ae.config.projectPath.replace(/\\/g,"/").split("/").filter(Boolean).pop()??ae.config.projectPath})}),u.jsx(it,{side:"bottom",children:u.jsx("span",{className:"font-mono text-xs",children:_ee(ae.config.projectPath)})})]})]}),Ms&&u.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--color-text-secondary)]",title:Ms,children:[u.jsx(E$,{size:11,className:"shrink-0 text-[var(--color-text-muted)]"}),u.jsx("span",{className:"max-w-32 truncate",children:Ms})]})]})}),(()=>{const He=ae.config.projectPath,Vt=ae.config.projectPathHistory?.filter(rr=>rr!==He);return!Vt||Vt.length===0?null:u.jsxs("div",{className:st("mt-0.5 flex items-center gap-1 text-[10px] text-[var(--color-text-muted)]",Pe&&"relative z-10"),children:[u.jsx(Gne,{size:10,className:"shrink-0"}),u.jsxs("span",{className:"truncate",children:["历史路径:",Vt.map(rr=>_ee(rr)).join(", ")]})]})})()]}),u.jsx("div",{ref:N,children:u.jsx(iQ,{teamName:e})}),ae.warnings?.some(He=>He.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,Ue?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:Ue}):null,u.jsx(Vp,{sectionId:"team",title:"团队",icon:u.jsx(ac,{size:14}),badge:Hm===0?"单人":Hm,defaultOpen:!0,children:u.jsx(F9n,{teamName:e,members:Oi,pendingRepliesByMember:p,isTeamAlive:ae.isAlive,isTeamProvisioning:Zn,launchParams:ut,onMemberClick:ix,onSendMessage:FB,onRestartMember:U_,onSkipMemberForLaunch:f1})}),u.jsx(Vp,{sectionId:"kanban",title:"外部派单",icon:u.jsx(Wv,{size:14}),badge:Jc.length,headerExtra:u.jsx("span",{className:"ml-1.5 rounded bg-amber-500/15 px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-amber-500",children:"Beta"}),defaultOpen:!0,forceOpen:Xn.trim().length>0,action:u.jsxs(Me,{variant:"ghost",size:"sm",className:"h-6 gap-1 px-2 text-xs text-[var(--color-text-muted)] hover:text-[var(--color-text)]",onClick:He=>{He.stopPropagation(),eu()},children:[u.jsx(oc,{size:12}),"新建"]}),children:u.jsx("div",{className:"min-w-0",children:u.jsx(oYn,{tasks:Yf,teamName:e,kanbanState:ae.kanbanState,filter:we,sort:de,sessions:od,leadSessionId:ae.config.leadSessionId,members:Pl,onFilterChange:J,onSortChange:ue,toolbarLeft:u.jsx(lYn,{value:Xn,onChange:ks,tasks:Jc,members:Pl}),onRequestReview:He=>{(async()=>{try{await Lt(e,He)}catch{}})()},onApprove:He=>{(async()=>{try{await Qt(e,He,{op:"set_column",column:"approved"})}catch{}})()},onRequestChanges:He=>{s(He)},onMoveBackToDone:He=>{(async()=>{try{await Qt(e,He,{op:"remove"}),await tn(e,He,"completed")}catch{}})()},onStartTask:He=>{(async()=>{try{const Vt=await xe(e,He);if(ae?.isAlive){const rr=ae.tasks.find(Fr=>Fr.id===He);try{if(Vt.notifiedOwner&&rr?.owner)await Z.teams.processSend(e,`Task ${Ps(rr)} "${rr.subject}" has started. Please begin working on it.`);else if(!Vt.notifiedOwner){const Fr=rr?.description?.trim()?`
|
|
1844
|
+
`,be=g.current;I(be?_e+be:_e)}if(te.length===0)return;let G=0;for(const _e of te){const be=S7e(_e);if(!be.valid){c(be.error);return}G+=_e.size}const ie=[];for(const _e of te)try{const be=await v7e(_e);ie.push(be)}catch{c(`读取文件失败:${_e.name}`);return}const ne=b.current;if(ne.length+ie.length>cO){c(`最多允许添加 ${cO} 个附件`);return}if(ne.reduce((_e,be)=>_e+be.size,0)+G>Tv){c("附件总大小超过 20MB 限制");return}const Te=[...ne,...ie];b.current=Te,o(Te),f(!1),C()},[C,I]),U=O.useCallback(q=>{v.current=!0;const ee=b.current.filter(te=>te.id!==q);b.current=ee,o(ee),c(null),f(!1),C()},[C]),A=O.useCallback(()=>{v.current=!0,b.current=[],o([]),c(null),f(!1),C()},[C]),F=O.useCallback(()=>{c(null)},[]),z=O.useCallback(q=>{const ee=q.clipboardData?.items;if(!ee)return;const te=[];for(const H of Array.from(ee))if(H.kind==="file"){const G=H.getAsFile();G&&te.push(G)}te.length>0&&(q.preventDefault(),M(te))},[M]),D=O.useCallback(q=>{q.preventDefault();const ee=q.dataTransfer?.files;ee?.length&&M(Array.from(ee))},[M]),V=O.useCallback(()=>{T.current!=null&&(clearTimeout(T.current),T.current=null),E.current=null,g.current="",_.current=[],b.current=[],n(""),s([]),o([]),c(null),f(!1),Og.deleteSnapshot(x.current)},[]);return{text:t,setText:I,chips:r,addChip:Q,removeChip:$,attachments:i,attachmentError:a,canAddMore:j,addFiles:M,removeAttachment:U,clearAttachments:A,clearAttachmentError:F,handlePaste:z,handleDrop:D,actionMode:l,setActionMode:R,isSaved:p,isLoaded:h,clearDraft:V}}const c9n=[{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 u9n(e){return e==="codex"?c9n:C7e}function d9n(e,t,n){const r=e.filter(o=>Vwe(o.rootKind,n)),s=t.filter(o=>Vwe(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 p9n(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 d9n(t,n,r)){const l=c.folderName.trim().toLowerCase();!c.isValid||!l||!sPn(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"} - ${oX(c.rootKind)}`,searchText:`${c.name} ${c.folderName}`,type:"skill"}))}return[...i,...a]}const g9=({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,onDispatchTask:m})=>{const g=O.useRef(null),_=O.useMemo(()=>xe=>{g.current=xe,typeof f=="function"?f(xe):f&&(f.current=xe)},[f]),[b,y]=O.useState(()=>t.find(Fe=>Jn(Fe))?.name??t[0]?.name??""),[x,S]=O.useState(!1),[v,T]=O.useState(""),E=O.useRef(null),[w,P]=O.useState(!1),C=O.useRef(0),k=O.useRef(null),[I,Q]=O.useState(null),$=O.useRef(0),R=O.useRef(null),[N,j]=O.useState(!1);O.useEffect(()=>{if(b&&t.some(_t=>_t.name===b))return;const Fe=t.find(_t=>Jn(_t))?.name??t[0]?.name??"";Fe&&Fe!==b&&queueMicrotask(()=>y(Fe))},[t,b]);const M=re(xe=>xe.selectedTeamName===e?xe.selectedTeamData?.config.projectPath??null:null),U=re(xe=>{if(xe.selectedTeamName!==e)return qc(e).border;const Fe=xe.selectedTeamData?.config.color;if(Fe)return Wr(Fe).border;const _t=xe.selectedTeamData?.config.name??e;return qc(_t).border}),A=re(xe=>T_(xe,e)),F=l9n(e),z=O.useMemo(()=>l.find(xe=>xe.sessionKey===d)??null,[d,l]),D=z?.chatName||z?.title||z?.userName||z?.sessionKey||"选择会话",V=O.useMemo(()=>Co(t),[t]),q=O.useMemo(()=>t.map(xe=>({id:xe.name,name:xe.name,subtitle:mi(xe.role)??mi(xe.agentType)??void 0,color:V.get(xe.name)})),[t,V]),ee=O.useMemo(()=>{const xe=t.find(Fe=>Jn(Fe));return ka(xe?.providerId)??CO(xe?.model)},[t]),{suggestions:te}=zN(e),{suggestions:H}=tx(e),G=re(vt(xe=>M?xe.skillsProjectCatalogByProjectPath[M]??[]:[])),ie=re(vt(xe=>xe.skillsUserCatalog)),ne=re(xe=>xe.fetchSkillsCatalog);O.useEffect(()=>{ne(M??void 0)},[ne,M]);const pe=O.useMemo(()=>p9n(u9n(ee),G,ie,ee),[ee,G,ie]),Te=Em(F.text).trim(),_e=O.useMemo(()=>GT(Te),[Te]),be=t.find(xe=>xe.name===b),Ie=be?V.get(be.name):void 0,Se=be?Jn(be):!1,oe=Se&&!!r,Oe=oe&&F.canAddMore,K=oe?void 0:Se?"团队在线时才能添加文件":"文件只能发送给团队负责人",Y=F.attachments.length>0&&!oe,W=_e?F.attachments.length>0?"斜杠命令需要团队负责人在线,且不能与附件同时发送":Se?r?null:"斜杠命令需要团队负责人在线":"斜杠命令只能发送给团队负责人":null,se=O.useMemo(()=>{const xe=Te.match(/^@([^\s]+)\s+([\s\S]+)$/);if(!xe||!m)return null;const Fe=xe[1],_t=xe[2]?.trim();if(!Fe||!_t)return null;const At=te.find(et=>(et.id.startsWith("team:")?et.id.slice(5):et.id)===Fe||et.name===Fe);return{slug:At?At.id.startsWith("team:")?At.id.slice(5):At.id:Fe,subject:_t}},[m,te,Te]),he=se!==null&&Te.length>0&&Te.length<=fl&&!s,we=b.length>0&&Te.length>0&&Te.length<=fl&&!s&&!A&&!Y&&!W,J=he||we,de=O.useRef(!1),ue=O.useCallback(()=>{if(!J)return;R.current?.();const xe=Zb(F.text,H),Fe=JE(Te,F.chips);if(se&&m){Promise.resolve(m(se.slug,se.subject,Fe)).then(_t=>{_t!==!1&&F.clearDraft()});return}de.current=!0,h(b,Fe,Te,F.attachments.length>0?F.attachments:void 0,void 0,xe)},[J,b,Te,h,F,H,se,m]);O.useEffect(()=>{!s&&de.current&&(de.current=!1,!i&&a?.delivered!==!1&&F.clearDraft())},[s,i,a,F]);const{addFiles:ae}=F,$e=O.useCallback(xe=>{const Fe=xe.target;Fe.files?.length&&ae(Fe.files),Fe.value=""},[ae]),qe=O.useCallback(()=>{Q(K??"Files can only be sent to the team lead"),window.clearTimeout($.current),$.current=window.setTimeout(()=>{Q(null)},4e3)},[K]);O.useEffect(()=>{const xe=$;return()=>window.clearTimeout(xe.current)},[]);const ot=O.useCallback(xe=>{xe.preventDefault(),C.current+=1,C.current===1&&P(!0)},[]),Ot=O.useCallback(xe=>{xe.preventDefault(),C.current-=1,C.current<=0&&(C.current=0,P(!1))},[]),nt=O.useCallback(xe=>{xe.preventDefault()},[]),{handleDrop:Ge}=F,St=O.useCallback(xe=>{if(xe.preventDefault(),C.current=0,P(!1),!oe){xe.dataTransfer?.files?.length&&qe();return}Ge(xe)},[oe,Ge,qe]),{handlePaste:Qt}=F,ft=O.useCallback(xe=>{if(!oe){Array.from(xe.clipboardData.items).some(_t=>_t.kind==="file")&&(xe.preventDefault(),qe());return}Qt(xe)},[oe,Qt,qe]),tn=fl-Te.length,jt=F.attachments.length>0||!!(F.attachmentError??I),On=!jt,Lt=n==="compact",fn=W?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(Zi,{size:10,className:"shrink-0"}),W]}):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(Zi,{size:10,className:"shrink-0"}),i]}):o?u.jsx(hnt,{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(qr,{size:10,className:"shrink-0"}),"已复用最近一次跨团队请求"]}):null;return u.jsxs("div",{className:st("relative",Lt?"pb-1":"mb-1.5 pb-1.5"),role:"group",onDragEnter:ot,onDragLeave:Ot,onDragOver:nt,onDrop:St,onPaste:ft,children:[u.jsxs("div",{className:st(On?"mb-0":"mb-1",Lt?"space-y-1.5":"space-y-2"),children:[u.jsxs("div",{className:"flex items-center gap-2",children:[Se?u.jsxs(u.Fragment,{children:[u.jsx("input",{ref:k,type:"file",accept:"*/*",multiple:!0,className:"hidden",onChange:$e}),u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx("button",{type:"button",className:st("inline-flex shrink-0 items-center gap-1 rounded p-1 transition-colors",Oe?"text-[var(--color-text-secondary)] hover:text-[var(--color-text)]":"text-[var(--color-text-muted)] opacity-40"),disabled:!Oe,onClick:()=>k.current?.click(),children:u.jsx(gU,{size:14})})}),u.jsx(it,{side:"top",children:r?F.canAddMore?"添加文件(支持粘贴或拖拽)":"已达到附件上限":"团队在线时才能添加文件"})]})]}):null,u.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[!r&&!A&&u.jsx("span",{className:"text-[10px]",style:{color:"var(--warning-text)"},children:"团队离线"}),u.jsxs("div",{className:st("mr-[15px] inline-flex items-center border text-xs transition-colors",On?"relative z-10 -mb-2 overflow-hidden rounded-b-none rounded-t-[1.35rem] border-b-0 bg-[var(--color-surface-raised)]":"rounded-full","border-[var(--color-border)]"),children:[u.jsxs(uc,{open:N,onOpenChange:j,children:[u.jsx(Gc,{asChild:!0,children:u.jsxs("button",{type:"button",className:st("inline-flex items-center gap-1.5 border-r border-r-[var(--color-border)] px-2.5 py-1 text-xs transition-colors",On?"rounded-bl-none rounded-tl-[1.35rem]":"rounded-l-full","hover:bg-[var(--color-surface-raised)]"),children:[U?u.jsx("span",{className:"inline-block size-2 shrink-0 rounded-full",style:{backgroundColor:U}}):null,u.jsx("span",{className:"max-w-[120px] truncate text-[var(--color-text-secondary)]",children:D}),u.jsx(Dr,{size:12,className:"shrink-0 text-[var(--color-text-muted)]"})]})}),u.jsx(Sl,{align:"end",className:"w-56 p-1.5",children:u.jsx("div",{className:"max-h-48 space-y-0.5 overflow-y-auto",children:l.length>0&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"px-2 py-1 text-[10px] font-medium uppercase tracking-wide text-[var(--color-text-muted)]",children:"会话"}),l.map(xe=>{const Fe=d===xe.sessionKey,_t=xe.chatName||xe.title||xe.userName||xe.sessionKey;return u.jsxs("button",{type:"button",className:st("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)]",Fe&&"bg-[var(--color-surface-raised)]"),onClick:()=>{p?.(xe.sessionKey),j(!1)},children:[u.jsx("span",{className:st("inline-block size-2 shrink-0 rounded-full",xe.live&&"animate-pulse"),style:{backgroundColor:xe.live?"#22c55e":U}}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-[var(--color-text)]",children:_t}),u.jsx("span",{className:"shrink-0 text-[10px] text-[var(--color-text-muted)]",children:xe.platform}),Fe?u.jsx(qr,{size:12,className:"ml-auto shrink-0 text-blue-400"}):null]},xe.sessionKey)})]})})})]}),u.jsxs(uc,{open:x,onOpenChange:S,children:[u.jsx(Gc,{asChild:!0,children:u.jsxs("button",{type:"button",className:st("inline-flex items-center gap-1.5 px-2.5 py-1 text-xs transition-colors",On?"rounded-br-none rounded-tr-[1.35rem]":"rounded-r-full","hover:bg-[var(--color-surface-raised)]"),children:[b?u.jsx(Ur,{name:b,color:Ie,size:"sm",hideAvatar:b==="user",disableHoverCard:!0}):u.jsx("span",{className:"text-[var(--color-text-muted)]",children:"选择..."}),u.jsx(Dr,{size:12,className:"shrink-0 text-[var(--color-text-muted)]"})]})}),u.jsxs(Sl,{align:"end",className:"w-56 p-1.5",onOpenAutoFocus:xe=>{xe.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:xe=>T(xe.target.value)})]}),u.jsx("div",{className:"max-h-48 space-y-0.5 overflow-y-auto",children:(()=>{const xe=v.toLowerCase().trim(),Fe=xe?t.filter(At=>At.name.toLowerCase().includes(xe)):t;return Fe.length===0?u.jsx("div",{className:"px-2 py-3 text-center text-xs text-[var(--color-text-muted)]",children:"无匹配结果"}):[...Fe].sort((At,Ve)=>{const et=Jn(At)?1:0;return(Jn(Ve)?1:0)-et}).map(At=>{const Ve=V.get(At.name),et=mi(At.role)??mi(At.agentType),Ce=At.name===b;return u.jsxs("button",{type:"button",className:st("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)]",Ce&&"bg-[var(--color-surface-raised)]"),onClick:()=>{y(At.name),S(!1),T("")},children:[u.jsx(Ur,{name:At.name,color:Ve,size:"sm",hideAvatar:At.name==="user",disableHoverCard:!0}),et?u.jsx("span",{className:"shrink-0 text-[10px] text-[var(--color-text-muted)]",children:et}):null,Ce?u.jsx(qr,{size:12,className:"ml-auto shrink-0 text-blue-400"}):null]},At.name)})})()})]})]})]})]})]}),jt?u.jsx(pnt,{attachments:F.attachments,onRemove:F.removeAttachment,error:F.attachmentError??I,onDismissError:F.clearAttachmentError,disabled:Y,disabledHint:"仅在团队在线且接收人为团队负责人时支持附件。请移除附件或切换接收人。"}):null]}),u.jsxs("div",{className:"relative",children:[u.jsx(fnt,{active:w,rejected:!oe,rejectionReason:K}),u.jsx(Rm,{ref:_,id:`compose-${e}`,placeholder:A?"团队正在启动中... 消息将排队并在稍后投递到收件箱。":"输入消息...(回车发送,Shift+Enter 换行)",value:F.text,onValueChange:F.setText,suggestions:q,teamSuggestions:te,taskSuggestions:H,commandSuggestions:pe,chips:F.chips,onChipRemove:F.removeChip,projectPath:M,onFileChipInsert:F.addChip,onModEnter:ue,dismissMentionsRef:R,extraTips:O.useMemo(()=>[`Tips:你可以输入 "/" 来运行命令,如 ${pe.filter(Fe=>Fe.type==="command").slice(0,6).map(Fe=>Fe.command).join("、")} 等。`],[pe]),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:fl,disabled:s,hintText:void 0,showHint:!Lt,cornerActionInset:"compact",cornerAction:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs(at,{children:[u.jsx(lt,{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 Z.openExternal("https://voicetext.site"),children:u.jsx(eMe,{size:14})})}),u.jsx(it,{side:"top",children:"语音转文字"})]}),u.jsxs(at,{children:[u.jsx(lt,{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:!J,onClick:ue,children:[u.jsx(xE,{size:12}),"发送"]})})}),W?u.jsx(it,{side:"top",children:W}):A&&!s?u.jsx(it,{side:"top",children:"团队启动期间暂不可发送"}):null]})]}),footerRight:Lt?fn:u.jsxs("div",{className:"flex items-center gap-2",children:[fn,tn<200?u.jsxs("span",{className:`text-[10px] ${tn<100?"text-yellow-400":"text-[var(--color-text-muted)]"}`,children:["剩余 ",tn," 字符"]}):null,F.isSaved?u.jsx("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:"已保存"}):null]})})]})]})};function f9n(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 h9n(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 m9n=({teamName:e,members:t,filter:n,messages:r,open:s,onOpenChange:i,onApply:o})=>{const[a,c]=O.useState({from:new Set,to:new Set,showNoise:!1});O.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=O.useMemo(()=>Co(t),[t]),d=O.useMemo(()=>f9n(r),[r]),p=O.useMemo(()=>h9n(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}})},g=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(uc,{open:s,onOpenChange:i,children:[u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx(Gc,{asChild:!0,children:u.jsxs(Me,{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(T$,{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(it,{side:"bottom",children:"筛选消息"})]}),u.jsxs(Sl,{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(ai,{checked:a.from.has(y),onCheckedChange:()=>m(y)}),u.jsx(Ur,{name:y,color:l.get(y),teamName:e,size:"sm",hideAvatar:y==="user"})]},y))})]}),u.jsxs("div",{className:"border-b border-[var(--color-border)] p-3",children:[u.jsx("p",{className:"mb-2 text-[11px] font-medium uppercase tracking-wider text-[var(--color-text-muted)]",children:"接收方"}),u.jsx("div",{className:"space-y-1",children:p.length===0?u.jsx("p",{className:"text-xs italic text-[var(--color-text-muted)]",children:"暂无数据"}):p.map(y=>u.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded-md px-1 py-0.5 text-xs text-[var(--color-text-secondary)] hover:bg-[var(--color-surface-raised)]",children:[u.jsx(ai,{checked:a.to.has(y),onCheckedChange:()=>g(y)}),u.jsx(Ur,{name:y,color:l.get(y),teamName:e,size:"sm",hideAvatar:y==="user"})]},y))})]})]}),u.jsxs("div",{className:"shrink-0 border-t border-[var(--color-border)]",children:[u.jsx("div",{className:"border-b border-[var(--color-border)] p-3",children:u.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded-md px-1 py-0.5 text-xs text-[var(--color-text-secondary)] hover:bg-[var(--color-surface-raised)]",children:[u.jsx(ai,{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(Me,{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(Me,{size:"sm",className:"h-7 px-3 text-[11px]",onClick:_,children:"保存"})]})]})]})]})},g9n=1e4;function rPe(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 O9n(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=rPe(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=rPe(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<=g9n,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 _9n=({members:e,pendingRepliesByMember:t,pendingCrossTeamReplies:n=[],headerRight:r,onMemberClick:s})=>{const{isLight:i}=Js(),o=re(vt(m=>m.pendingApprovals)),a=re(vt(m=>m.teamByName)),c=Co(e),l=jf(e),d=Object.entries(t).map(([m,g])=>({kind:"member",member:e.find(_=>_.name===m)??null,name:m,sentAtMs:g})).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,g)=>g.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 g=vT(m.sentAtMs,{addSuffix:!0});if(m.kind==="member"){const{member:_}=m,b=Wr(c.get(_.name)??""),y=mi(_.role??(_.agentType!=="general-purpose"?_.agentType:void 0)),x=$z(_.runtimeAdvisory,_.providerId),S=hze(_.runtimeAdvisory,_.providerId),v=x!==null;return u.jsx("article",{className:"activity-card-enter-animate overflow-hidden rounded-md",style:{backgroundColor:RO,border:Cu,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)??fo(_.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:wi(b,i),color:b.text,border:`1px solid ${b.border}40`},onClick:()=>s(_),title:"Open member",children:Vc(_.name)}):u.jsx("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-medium tracking-wide",style:{backgroundColor:wi(b,i),color:b.text,border:`1px solid ${b.border}40`},children:Vc(_.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(zt,{className:"size-3 shrink-0 animate-spin text-amber-400"}):null,u.jsx("span",{className:"shrink-0 text-[10px]",style:{color:Dt},children:g})]})},`pending-reply:${_.name}:${m.sentAtMs}`)}if(m.kind==="team"){const _=a[m.teamName]?.displayName||m.teamName,b=qc(_,i);return u.jsx("article",{className:"activity-card-enter-animate overflow-hidden rounded-md",style:{backgroundColor:RO,border:Cu,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(ac,{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:wi(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:g})]})},`pending-reply:team:${m.teamName}:${m.sentAtMs}`)}return u.jsx("article",{className:"activity-card-enter-animate overflow-hidden rounded-md",style:{backgroundColor:RO,border:Cu,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(Vht,{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:g})]})},`pending-reply:user:${m.sentAtMs}`)})]})},O9=({members:e,messages:t,pendingRepliesByMember:n,layout:r="overlay",onMemberClick:s})=>{const[i,o]=O.useState(!1),[a,c]=O.useState(()=>Date.now()),l=O.useMemo(()=>O9n(t,a),[t,a]),d=O.useMemo(()=>Object.keys(n).some(g=>e.some(_=>_.name===g))||l.length>0,[e,n,l.length]),p=O.useMemo(()=>d,[d]);if(O.useEffect(()=>{if(!p)return;const m=window.setInterval(()=>c(Date.now()),1e3);return()=>window.clearInterval(m)},[p]),!p)return null;const f=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:()=>o(m=>!m),"aria-label":i?"Expand status":"Collapse status",children:[u.jsx(Bn,{size:12,className:`shrink-0 transition-transform duration-150 ${i?"":"rotate-90"}`}),"Status"]}),h=r==="flow"&&!i?f:null;return u.jsxs(u.Fragment,{children:[r==="overlay"?u.jsx("div",{className:"relative h-0",children:u.jsx("div",{className:"absolute -top-[19px] right-0 z-10",children:f})}):i?u.jsx("div",{className:"mb-2 flex justify-end",children:f}):null,!i&&u.jsx("div",{className:r==="overlay"?"mt-5":"",children:d?u.jsx(_9n,{members:e,pendingRepliesByMember:n,pendingCrossTeamReplies:l,headerRight:h,onMemberClick:s}):null})]})},b9n=40,sQ=1,sPe=2,y9n=4,x9n=56;function S9n(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 v9n=O.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:g,onCreateTaskFromMessage:_,onReplyToMessage:b,onRestartTeam:y,onTaskIdClick:x,inlineScrollContainerRef:S,showPositionControls:v=!0}){const{sendTeamMessage:T,sendCrossTeamMessage:E,sendingMessage:w,sendMessageError:P,sendMessageWarning:C,sendMessageDebugDetails:k,lastSendMessageResult:I,teams:Q,openTeamTab:$,messages:R,hasMore:N,loadingOlderMessages:j,loadOlderTeamMessages:M,refreshTeamMessagesHead:U,addOptimisticTeamMessage:A}=re(vt(We=>({sendTeamMessage:We.sendTeamMessage,sendCrossTeamMessage:We.sendCrossTeamMessage,sendingMessage:We.sendingMessage,sendMessageError:We.sendMessageError,sendMessageWarning:We.sendMessageWarning,sendMessageDebugDetails:We.sendMessageDebugDetails,lastSendMessageResult:We.lastSendMessageResult,teams:We.teams,openTeamTab:We.openTeamTab,messages:fz(We,t),hasMore:t?We.teamMessagesByName[t]?.hasMore??!1:!1,loadingOlderMessages:t?We.teamMessagesByName[t]?.loadingOlder??!1:!1,loadOlderTeamMessages:We.loadOlderTeamMessages,refreshTeamMessagesHead:We.refreshTeamMessagesHead,addOptimisticTeamMessage:We.addOptimisticTeamMessage}))),F=O.useRef(null),z=O.useCallback(async()=>{const We=re.getState().teamMessagesByName[t];!We?.hasMore||We.loadingHead||We.loadingOlder||await M(t)},[M,t]),D=R,V=D.length,q=O.useRef(!1),ee=O.useRef(null),te=O.useRef(null),H=O.useRef(null),G=O.useRef(null),ie=O.useRef(null),ne=n==="inline"?S??null:n==="sidebar"?te:ie,pe=O.useCallback(We=>{We>x9n||!N||j||re.getState().teamMessagesByName[t]?.loadingHead||q.current||(q.current=!0,z())},[N,z,j,t]);O.useEffect(()=>{j||(q.current=!1)},[j]);const Te=O.useMemo(()=>{if(ne)return{scrollElementRef:ne,observerRoot:ne,scrollMargin:0,virtualizationEnabled:!0}},[ne]),_e=O.useCallback(()=>{},[]),be=O.useRef(ePe(t)),[Ie,Se]=O.useState(be.current.messagesSearchQuery),[oe,Oe]=O.useState(be.current.messagesFilter),[K,Y]=O.useState(be.current.messagesFilterOpen),[W,se]=O.useState(be.current.messagesCollapsed),[he,we]=O.useState(be.current.messagesSearchBarVisible),[J,de]=O.useState(be.current.expandedItemKey),[ue,ae]=O.useState([]),[$e,qe]=O.useState(null),[ot,Ot]=O.useState(!1),[nt,Ge]=O.useState(null),[St,Qt]=O.useState(be.current.messagesScrollTop),[ft,tn]=O.useState(be.current.bottomSheetSnapIndex),[jt,On]=O.useState(196),[Lt,fn]=O.useState(0);O.useEffect(()=>{be.current=ePe(t),Se(be.current.messagesSearchQuery),Oe(be.current.messagesFilter),Y(be.current.messagesFilterOpen),se(be.current.messagesCollapsed),we(be.current.messagesSearchBarVisible),de(be.current.expandedItemKey),Qt(be.current.messagesScrollTop),tn(be.current.bottomSheetSnapIndex)},[t]),O.useEffect(()=>{let We=!1;return Z.teams.getTeamSessions(t).then(Tt=>{if(We)return;const Kn=[...Tt].sort((Ar,Ne)=>new Date(Ne.updatedAt).getTime()-new Date(Ar.updatedAt).getTime());ae(Kn),Ge(Ar=>Ar&&Kn.some(Ne=>Ne.sessionKey===Ar)?Ar:Kn[0]?.sessionKey??null)}).catch(()=>{We||(ae([]),Ge(null))}),()=>{We=!0}},[t,p]);const xe=O.useMemo(()=>ue.find(We=>We.sessionKey===nt)??null,[nt,ue]),Fe=xe?.platform==="hermit"||xe?.sessionKey===`hermit:${t}:session`;O.useEffect(()=>{if(!xe||Fe){qe(null),Ot(!1);return}let We=!1;return Ot(!0),Z.teams.getSessionDetail(t,xe.id,200).then(Tt=>{We||qe(Tt)}).catch(()=>{We||qe(null)}).finally(()=>{We||Ot(!1)}),()=>{We=!0}},[Fe,xe,t]),O.useEffect(()=>{H8n(t,{messagesSearchQuery:Ie,messagesFilter:oe,messagesFilterOpen:K,messagesCollapsed:W,messagesSearchBarVisible:he,expandedItemKey:J,messagesScrollTop:St,bottomSheetSnapIndex:ft})},[t,Ie,oe,K,W,he,J,St,ft]),O.useEffect(()=>{const We=oe.from.size>0||oe.to.size>0;he||Ie.trim().length===0&&!We||we(!0)},[oe.from,oe.to,he,Ie]),O.useEffect(()=>{if(!t)return;if(D.length>0){F.current=null;return}const We=re.getState().teamMessagesByName[t];We?.loadingHead||We?.loadingOlder||F.current!==t&&(F.current=t,U(t).catch(()=>{}))},[D.length,U,t]),O.useLayoutEffect(()=>{if(n!=="sidebar")return;const We=te.current;We&&(We.scrollTop=St)},[n,St]),O.useEffect(()=>{if(n==="sidebar")return;const We=n==="bottom-sheet"?ie.current:S?.current??null;if(!We)return;const Tt=()=>{pe(We.scrollTop)};return We.addEventListener("scroll",Tt,{passive:!0}),Tt(),()=>{We.removeEventListener("scroll",Tt)}},[S,pe,n]),O.useLayoutEffect(()=>{if(n!=="bottom-sheet"||typeof ResizeObserver>"u")return;const We=s instanceof HTMLElement?s:null,Tt=[[G.current,On],[We,fn]],Kn=[];for(const[Ar,Ne]of Tt){if(!Ar)continue;const Ae=()=>{const Xn=Math.ceil(Ar.getBoundingClientRect().height);Xn>0&&Ne(Xn)};Ae();const mn=new ResizeObserver(()=>{Ae()});mn.observe(Ar),Kn.push(mn)}return()=>{Kn.forEach(Ar=>Ar.disconnect())}},[n,s]);const _t=O.useMemo(()=>{const We=Tt=>[...Tt].sort((Kn,Ar)=>Date.parse(Ar.timestamp)-Date.parse(Kn.timestamp));return nt?xe&&!Fe?$e?[...$e.history].reverse().map((Tt,Kn)=>({messageId:`${$e.id}:${Kn}:${Tt.timestamp}`,from:Tt.role==="user"?"user":$e.name||t,to:Tt.role==="user"?$e.name||t:"user",text:Tt.content,timestamp:Tt.timestamp,read:!0,source:Tt.role==="user"?"user_sent":"inbox",session:{id:$e.id,key:$e.sessionKey,platform:$e.platform,title:xe.title||xe.chatName||xe.userName||xe.sessionKey,chatName:xe.chatName,userName:xe.userName}})):[]:We(D.filter(Tt=>Tt.session?.key===nt)):We(D)},[D,Fe,xe,$e,nt,t]),At=O.useMemo(()=>Gee(_t,{timeWindow:d,filter:oe,searchQuery:Ie}),[oe,Ie,_t,d]),Ve=O.useMemo(()=>Gee(_t,{includePassiveIdlePeerSummariesWhenNoiseHidden:!0,timeWindow:d,filter:oe,searchQuery:Ie}),[oe,Ie,_t,d]),et=O.useMemo(()=>D.filter(We=>We.messageKind!=="task_comment_notification"&&!x$n(typeof We.text=="string"?We.text:"")),[D]),Ce=O.useMemo(()=>{if(!J)return null;if(!J.startsWith("thoughts-")){const Tt=Ve.find(Kn=>Ls(Kn)===J);return Tt?{type:"message",message:Tt}:null}return rKe(Ve).find(Tt=>Tt.type==="lead-thoughts"&&Ev(Tt.group)===J)??null},[J,Ve]);O.useEffect(()=>{J&&Ce===null&&de(null)},[J,Ce]);const tt=O.useCallback(We=>{de(We)},[]),ve=O.useCallback(We=>{We||de(null)},[]),{readSet:Ue,markRead:mt,markAllRead:Ke}=Zle(t),{expandedSet:Ct,toggle:Xt}=I8n(t),Wt=O.useMemo(()=>At.filter(We=>!We.read&&!Ue.has(Ls(We))).length,[At,Ue]),nr=O.useCallback(We=>mt(Ls(We)),[mt]),nn=O.useMemo(()=>({readSet:Ue,getMessageKey:Ls}),[Ue]),{teamNames:Zn,teamColorByName:jr}=Gle(Q),Xe=O.useCallback(()=>{const We=At.filter(Tt=>!Tt.read&&!Ue.has(Ls(Tt))).map(Tt=>Ls(Tt));Ke(We)},[At,Ue,Ke]);O.useEffect(()=>{if(Object.keys(f).length===0)return;const We=S9n(f,et);We!==f&&h(()=>We)},[h,f,et]);const Re=O.useCallback((We,Tt,Kn,Ar,Ne,Ae)=>{const mn=Date.now();h(Xn=>({...Xn,[We]:mn})),T(t,{member:We,text:Tt,summary:Kn,attachments:Ar,actionMode:Ne,taskRefs:Ae,sessionKey:nt&&nt!=="__unassigned__"?nt:void 0}).then(Xn=>{Xn?.runtimeDelivery?.attempted===!0&&Xn.runtimeDelivery.delivered===!1&&h(ks=>{if(ks[We]!==mn)return ks;const Us={...ks};return delete Us[We],Us})}).catch(()=>{h(Xn=>{if(Xn[We]!==mn)return Xn;const ks={...Xn};return delete ks[We],ks})})},[t,T,h,nt]);O.useCallback((We,Tt,Kn,Ar,Ne)=>{E({fromTeam:t,fromMember:"user",toTeam:We,text:Tt,sessionKey:nt&&nt!=="__unassigned__"?nt:void 0,taskRefs:Ne,actionMode:Ar,summary:Kn})},[t,nt,E]);const me=O.useCallback(async(We,Tt,Kn)=>{const Ar=Date.now(),Ne=`optimistic-cross-team-${Ar}`;A(t,{from:"user",to:We,text:`@${We} ${Tt}`,timestamp:new Date(Ar).toISOString(),read:!0,messageId:Ne,source:"cross_team_sent",session:nt&&nt!=="__unassigned__"?{key:nt}:void 0});try{await E({fromTeam:t,fromMember:"user",toTeam:We,text:Kn,messageId:Ne})}catch(Ae){const mn=Ae instanceof Error?Ae.message:"跨团队任务派发失败",Xn=mn.includes("Redis not configured")?"无法派发给其他团队:Redis 未配置或未连接。请先在设置里开启团队总线并配置 Redis。":mn.includes("Distributed collaboration is not enabled")?"无法派发给其他团队:团队总线/分布式团队协作未开启。请先在设置里开启。":`无法派发给 ${We}:${mn}`;return A(t,{from:"system",to:"user",text:Xn,timestamp:new Date(Date.now()).toISOString(),read:!0,messageId:`optimistic-cross-team-error-${Date.now()}`,source:"system_notification"}),window.dispatchEvent(new CustomEvent("collab:refresh")),await U(t),!1}return window.dispatchEvent(new CustomEvent("collab:refresh")),await U(t),window.setTimeout(()=>{U(t)},300),!0},[A,t,U,nt,E]),Ee=O.useCallback(()=>{r("inline")},[r]),le=O.useCallback(()=>{r("sidebar")},[r]),je=O.useCallback(()=>{tn(sPe),r("bottom-sheet")},[r]),Be=O.useCallback(We=>{tn(We),H.current?.snapTo(We)},[]),yt=O.useCallback(()=>{if(ft===sQ){Be(sPe);return}Be(sQ)},[ft,Be]),wt=O.useMemo(()=>{const We=Lt>0?Math.max(Lt-1,96):Number.POSITIVE_INFINITY,Tt=Math.min(b9n,We),Kn=Math.min(Math.max(Tt+jt,Tt+120),We),Ar=Math.min(Math.max(Lt>0?Math.round(Lt*.58):520,Kn+140),We);return[0,Tt,Kn,Ar,1]},[Lt,jt]),ut=O.useMemo(()=>Math.min(Math.max(ft,sQ),y9n),[ft]),Ut=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:Ie,onChange:We=>Se(We.target.value),onPointerDown:We=>We.stopPropagation(),onClick:We=>We.stopPropagation(),className:"min-w-0 flex-1 bg-transparent text-xs text-[var(--color-text)] placeholder:text-[var(--color-text-muted)] focus:outline-none"}),Ie&&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:()=>Se(""),children:u.jsx(Pr,{size:14})})]}),u.jsx(m9n,{teamName:t,members:i,filter:oe,messages:_t,open:K,onOpenChange:Y,onApply:Oe})]}),yn=u.jsxs("div",{className:"flex items-center gap-2",children:[Ut,u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx(Me,{variant:"ghost",size:"sm",className:"pointer-events-auto size-7 p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:We=>{We.stopPropagation(),se(Tt=>!Tt)},children:W?u.jsx(Fk,{size:14}):u.jsx(Q4,{size:14})})}),u.jsx(it,{side:"bottom",children:W?"展开全部消息":"折叠全部消息"})]})]}),Rn=u.jsxs("div",{className:"pb-14",children:[u.jsx(g9,{teamName:t,members:i,isTeamAlive:a,sending:w,sendError:P,sendWarning:C,sendDebugDetails:k,lastResult:I,sessions:ue,selectedSessionKey:nt,onSessionChange:Ge,textareaRef:ee,onSend:Re,onDispatchTask:me}),u.jsx(O9,{members:i,tasks:o,messages:_t,pendingRepliesByMember:f,layout:"flow",position:"inline",onMemberClick:m,onTaskClick:g}),u.jsx(h9,{messages:Ve,teamName:t,members:i,readState:nn,allCollapsed:W,expandOverrides:Ct,onToggleExpandOverride:Xt,currentLeadSessionId:p,isTeamAlive:a,leadActivity:c,leadContextUpdatedAt:l,teamNames:Zn,teamColorByName:jr,onTeamClick:$,onMemberClick:m,onCreateTaskFromMessage:void 0,onReplyToMessage:b,onMessageVisible:nr,onRestartTeam:y,onTaskIdClick:x,onExpandItem:tt,onExpandContent:_e,viewport:Te}),N&&u.jsx("div",{className:"flex justify-center py-2",children:u.jsxs("div",{className:"flex flex-col items-center gap-1",children:[u.jsx(Me,{variant:"ghost",size:"sm",className:"text-xs text-text-muted","aria-busy":j,disabled:j,onClick:()=>void z(),children:"加载更早消息"}),u.jsxs("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:["已加载 ",V," 条"]})]})}),u.jsx(qC,{expandedItem:Ce,open:J!==null,onOpenChange:ve,teamName:t,members:i,onCreateTaskFromMessage:void 0,onReplyToMessage:b,onMemberClick:m,onTaskIdClick:x,onRestartTeam:y,teamNames:Zn,teamColorByName:jr,onTeamClick:$})]});if(n==="sidebar")return u.jsxs("div",{className:"flex size-full flex-col overflow-hidden bg-[var(--color-surface-sidebar)]",children:[u.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-[var(--color-border)] bg-[var(--color-surface-sidebar)] px-3 py-2",children:[u.jsx(mo,{size:14,className:"shrink-0 text-[var(--color-text-muted)]"}),u.jsx("span",{className:"text-sm font-medium text-[var(--color-text)]",children:"消息"}),At.length>0&&u.jsx($t,{variant:"secondary",className:"px-1.5 py-0.5 text-[10px] font-normal leading-none",children:At.length}),Wt>0&&u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsxs($t,{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:[Wt," 条新消息"]})}),u.jsxs(it,{side:"bottom",children:[Wt," 条未读"]})]}),Wt>0&&u.jsxs(at,{children:[u.jsx(lt,{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:Xe,children:u.jsx(EQ,{size:12})})}),u.jsx(it,{side:"bottom",children:"全部标为已读"})]}),u.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx(Me,{variant:"ghost",size:"sm",className:"size-7 p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:()=>se(We=>!We),"aria-label":W?"展开全部消息":"折叠全部消息",children:W?u.jsx(Fk,{size:14}):u.jsx(Q4,{size:14})})}),u.jsx(it,{side:"bottom",children:W?"展开全部消息":"折叠全部消息"})]}),u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx(Me,{variant:"ghost",size:"sm",className:"size-7 p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:()=>we(We=>!We),"aria-label":he?"隐藏消息搜索":"显示消息搜索",children:he?u.jsx(Pr,{size:14}):u.jsx(Mi,{size:14})})}),u.jsx(it,{side:"bottom",children:he?"隐藏搜索":"搜索消息"})]}),u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx(Me,{variant:"ghost",size:"sm",className:"size-7 p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:Ee,"aria-label":"将消息移到页面内面板",children:u.jsx(nMe,{size:14})})}),u.jsx(it,{side:"bottom",children:"移到页面内"})]})]})]}),he&&u.jsx("div",{className:"shrink-0 border-b border-[var(--color-border)] px-3 py-1.5",children:Ut}),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:We=>{const Tt=We.currentTarget.scrollTop;Qt(Tt),pe(Tt)},children:[u.jsxs("div",{className:"pl-3",children:[u.jsx(g9,{teamName:t,members:i,isTeamAlive:a,sending:w,sendError:P,sendWarning:C,sendDebugDetails:k,lastResult:I,sessions:ue,selectedSessionKey:nt,onSessionChange:Ge,textareaRef:ee,onSend:Re,onDispatchTask:me}),u.jsx(O9,{members:i,tasks:o,messages:_t,pendingRepliesByMember:f,layout:"flow",position:"sidebar",onMemberClick:m,onTaskClick:g})," "]}),u.jsx(h9,{messages:Ve,teamName:t,members:i,readState:nn,allCollapsed:W,expandOverrides:Ct,onToggleExpandOverride:Xt,currentLeadSessionId:p,isTeamAlive:a,leadActivity:c,leadContextUpdatedAt:l,teamNames:Zn,teamColorByName:jr,onTeamClick:$,onMemberClick:m,onCreateTaskFromMessage:void 0,onReplyToMessage:b,onMessageVisible:nr,onRestartTeam:y,onTaskIdClick:x,onExpandItem:tt,onExpandContent:_e,viewport:Te}),N&&u.jsx("div",{className:"flex justify-center py-2",children:u.jsxs("div",{className:"flex flex-col items-center gap-1",children:[u.jsx(Me,{variant:"ghost",size:"sm",className:"text-xs text-text-muted","aria-busy":j,disabled:j,onClick:()=>void z(),children:"加载更早消息"}),u.jsxs("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:["已加载 ",V," 条"]})]})}),u.jsx(qC,{expandedItem:Ce,open:J!==null,onOpenChange:ve,teamName:t,members:i,onCreateTaskFromMessage:void 0,onReplyToMessage:b,onMemberClick:m,onTaskIdClick:x,onRestartTeam:y,teamNames:Zn,teamColorByName:jr,onTeamClick:$})]})]});if(n==="bottom-sheet"){if(!s)return u.jsx("div",{className:"hidden","aria-hidden":"true"});const We=ut===sQ;return u.jsx(Xw,{ref:H,isOpen:!0,onClose:Ee,mountPoint:s,avoidKeyboard:!1,detent:"full",snapPoints:wt,initialSnap:ut,onSnap:tn,disableDismiss:!0,disableScrollLocking:!0,style:{zIndex:30},className:"!pointer-events-none !absolute !inset-0",unstyled:!0,children:u.jsxs(Xw.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(Xw.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(Xw.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(mo,{size:13,className:"shrink-0 text-[var(--color-text-muted)]"}),u.jsx("span",{className:"text-[13px] font-medium text-[var(--color-text)]",children:"消息"}),At.length>0&&u.jsx($t,{variant:"secondary",className:"px-1 py-0 text-[9px] font-normal leading-none",children:At.length}),Wt>0&&u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsxs($t,{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:[Wt," 条新消息"]})}),u.jsxs(it,{side:"top",children:[Wt," 条未读"]})]}),u.jsxs("div",{className:"ml-auto flex items-center gap-1",onPointerDown:Tt=>Tt.stopPropagation(),children:[Wt>0&&u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx(Me,{variant:"ghost",size:"sm",className:"size-[22px] p-0 text-blue-400 hover:bg-blue-500/10 hover:text-blue-300",onClick:Xe,"aria-label":"将全部消息标为已读",children:u.jsx(EQ,{size:13})})}),u.jsx(it,{side:"top",children:"全部标为已读"})]}),u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx(Me,{variant:"ghost",size:"sm",className:"size-[22px] p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:()=>se(Tt=>!Tt),"aria-label":W?"展开全部消息":"折叠全部消息",children:W?u.jsx(Fk,{size:14}):u.jsx(Q4,{size:14})})}),u.jsx(it,{side:"top",children:W?"展开全部消息":"折叠全部消息"})]}),u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx(Me,{variant:"ghost",size:"sm",className:"size-[22px] p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:()=>we(Tt=>!Tt),"aria-label":he?"隐藏消息搜索":"显示消息搜索",children:he?u.jsx(Pr,{size:14}):u.jsx(Mi,{size:14})})}),u.jsx(it,{side:"top",children:he?"隐藏搜索":"搜索消息"})]}),u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx(Me,{variant:"ghost",size:"sm",className:"size-[22px] p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:yt,"aria-label":We?"展开底部消息面板":"折叠底部消息面板",children:We?u.jsx(oht,{size:14}):u.jsx(sht,{size:14})})}),u.jsx(it,{side:"top",children:We?"展开面板":"折叠面板"})]}),u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx(Me,{variant:"ghost",size:"sm",className:"size-[22px] p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:Ee,"aria-label":"将消息移到页面内面板",children:u.jsx(ype,{size:14})})}),u.jsx(it,{side:"top",children:"移到页面内"})]}),u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx(Me,{variant:"ghost",size:"sm",className:"size-[22px] p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:le,"aria-label":"将消息移到侧边栏",children:u.jsx(CH,{size:14})})}),u.jsx(it,{side:"top",children:"移到侧边栏"})]})]})]})]})}),!We&&u.jsxs(Xw.Content,{className:"min-h-0 bg-[var(--color-surface-sidebar)]",scrollClassName:"flex min-h-full flex-col",scrollRef:ie,disableDrag:Tt=>Tt.scrollPosition!=="top",children:[u.jsxs("div",{ref:G,className:"sticky top-0 z-[1] shrink-0 border-b border-[var(--color-border)] backdrop-blur",style:{backgroundColor:"var(--color-surface-sidebar)"},children:[he&&u.jsx("div",{className:"border-b border-[var(--color-border)] px-3 py-2",children:Ut}),u.jsx("div",{className:"p-3",children:u.jsx(g9,{teamName:t,layout:"compact",members:i,isTeamAlive:a,sending:w,sendError:P,sendWarning:C,sendDebugDetails:k,lastResult:I,sessions:ue,selectedSessionKey:nt,onSessionChange:Ge,textareaRef:ee,onSend:Re,onDispatchTask:me})})]}),u.jsx("div",{className:"shrink-0 px-3 pt-2",children:u.jsx(O9,{members:i,tasks:o,messages:_t,pendingRepliesByMember:f,layout:"flow",position:"inline",onMemberClick:m,onTaskClick:g})}),u.jsxs("div",{className:"flex-1 px-3 pb-4 pt-2",children:[u.jsx(h9,{messages:Ve,teamName:t,members:i,readState:nn,allCollapsed:W,expandOverrides:Ct,onToggleExpandOverride:Xt,currentLeadSessionId:p,isTeamAlive:a,leadActivity:c,leadContextUpdatedAt:l,teamNames:Zn,teamColorByName:jr,onTeamClick:$,onMemberClick:m,onCreateTaskFromMessage:void 0,onReplyToMessage:b,onMessageVisible:nr,onRestartTeam:y,onTaskIdClick:x,onExpandItem:tt,onExpandContent:_e,viewport:Te}),N&&u.jsx("div",{className:"flex justify-center py-2",children:u.jsxs("div",{className:"flex flex-col items-center gap-1",children:[u.jsx(Me,{variant:"ghost",size:"sm",className:"text-xs text-text-muted","aria-busy":j,disabled:j,onClick:()=>void z(),children:"加载更早消息"}),u.jsxs("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:["已加载 ",V," 条"]})]})})]}),u.jsx(qC,{expandedItem:Ce,open:J!==null,onOpenChange:ve,teamName:t,members:i,onCreateTaskFromMessage:void 0,onReplyToMessage:b,onMemberClick:m,onTaskIdClick:x,onRestartTeam:y,teamNames:Zn,teamColorByName:jr,onTeamClick:$})]})]})})}return u.jsx(Vp,{sectionId:"messages",title:"消息",icon:u.jsx(mo,{size:14}),badge:At.length,secondaryBadge:At.length>0&&Wt>0?Wt:void 0,afterBadge:Wt>0?u.jsxs(at,{children:[u.jsx(lt,{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:We=>{We.stopPropagation(),Xe()},children:u.jsx(EQ,{size:12})})}),u.jsx(it,{side:"bottom",children:"全部标为已读"})]}):void 0,headerExtra:v?u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx(Me,{variant:"ghost",size:"sm",className:"pointer-events-auto size-6 p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:We=>{We.stopPropagation(),je()},"aria-label":"将消息移到底部面板",children:u.jsx(ype,{size:14})})}),u.jsx(it,{side:"top",children:"移到底部面板"})]}),u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx(Me,{variant:"ghost",size:"sm",className:"pointer-events-auto size-6 p-0 text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",onClick:We=>{We.stopPropagation(),le()},"aria-label":"将消息移到侧边栏",children:u.jsx(CH,{size:14})})}),u.jsx(it,{side:"top",children:"移到侧边栏"})]})]}):void 0,defaultOpen:!0,action:u.jsx("div",{className:"flex items-center gap-2 px-2",children:yn}),children:Rn})});function T9n(e){return e.ledgerSummary?.deletedInTask?"deleted":e.isNewFile||e.ledgerSummary?.createdInTask?"added":"modified"}const E9n=({open:e,onOpenChange:t,teamName:n,taskId:r,taskChangeRequestOptions:s})=>{const i=re(h=>h.changeSetLoading),o=re(h=>h.changeSetError),a=re(h=>h.activeChangeSet),c=re(h=>h.fetchTaskChanges),[l,d]=O.useState([]);O.useEffect(()=>{if(!e||!r){d([]);return}s&&c&&c(n,r,s)},[e,n,r,s,c]),O.useEffect(()=>{a?.files&&d(a.files)},[a]);const p=O.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(Pr,{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=T9n(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:"未记录文件变更"})})]})]})},w9n=({projectPath:e})=>{const[t,n]=O.useState([]),[r,s]=O.useState({}),[i,o]=O.useState(new Set),[a,c]=O.useState(!1),[l,d]=O.useState(!1),[p,f]=O.useState(null),[h,m]=O.useState(null),g=O.useCallback(async()=>{if(!(!e||!Z.credentials)){c(!0),f(null);try{const x=[],S=[];if(Z.skills)try{const P=await Z.skills.list(e);for(const C of P){const k=C.requiredEnv??[];k.length>0&&S.push({name:C.name,envVars:k.map(I=>({name:I.name,isRequired:I.isRequired??!0,description:I.description}))})}}catch{}const T=(await Z.credentials.scanRequired(e,x,S).catch(()=>null))?.required??[];n(T);const E=await Z.credentials.getProjectEnv(e).catch(()=>({})),w={};for(const P of T)w[P.name]=E?.[P.name]??P.value??"";s(w)}catch(x){f(x instanceof Error?x.message:"扫描环境变量失败")}finally{c(!1)}}},[e]);O.useEffect(()=>{g()},[g]);const _=async()=>{if(!(!e||!Z.credentials)){d(!0),f(null),m(null);try{await Z.credentials.saveProjectEnv(e,r),m("环境变量已加密保存"),setTimeout(()=>m(null),3e3),await g()}catch(x){f(x instanceof Error?x.message:"保存失败")}finally{d(!1)}}},b=x=>{o(S=>{const v=new Set(S);return v.has(x)?v.delete(x):v.add(x),v})};if(!e)return u.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-text-muted",children:[u.jsx(Kne,{className:"mb-3 size-10 opacity-40"}),u.jsx("p",{className:"text-sm",children:"请先选择一个项目以管理环境变量。"})]});if(a)return u.jsx("div",{className:"flex items-center justify-center py-12 text-text-muted",children:u.jsx("p",{className:"text-sm",children:"正在扫描项目所需的环境变量..."})});const y=t.filter(x=>x.isRequired&&!r[x.name]?.trim());return u.jsxs("div",{className:"space-y-4 px-1",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"text-sm font-medium text-text",children:"项目环境变量"}),u.jsx("p",{className:"text-xs text-text-muted",children:"管理当前项目所需的环境变量,供 Skills 和 CLI 工具使用。值已加密存储。"})]}),u.jsx(Me,{size:"sm",variant:"outline",onClick:()=>void g(),disabled:a,children:"刷新"})]}),p&&u.jsx("div",{className:"rounded-md border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-400",children:p}),h&&u.jsx("div",{className:"rounded-md border border-emerald-500/30 bg-emerald-500/10 px-3 py-2 text-xs text-emerald-400",children:h}),y.length>0&&u.jsxs("div",{className:"rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-xs text-amber-400",children:["缺少必填变量:",y.map(x=>x.name).join(", ")]}),t.length===0&&!a&&u.jsx("div",{className:"py-8 text-center text-xs text-text-muted",children:"未检测到所需的环境变量。启用 MCP 服务器或 Skills 后会自动扫描。"}),t.length>0&&u.jsxs("div",{className:"space-y-3",children:[t.map(x=>u.jsxs("div",{className:"space-y-1.5",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Zt,{className:"font-mono text-xs text-text",children:x.name}),u.jsx("span",{className:`rounded px-1.5 py-0.5 text-[10px] font-medium ${x.isRequired?"bg-red-500/10 text-red-400":"bg-surface-raised text-text-muted"}`,children:x.isRequired?"必填":"可选"}),u.jsxs("span",{className:"text-[10px] text-text-muted",children:["来自 ",x.source]})]}),x.description&&u.jsx("p",{className:"text-[11px] text-text-muted",children:x.description}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(An,{type:i.has(x.name)?"text":"password",value:r[x.name]??"",onChange:S=>s(v=>({...v,[x.name]:S.target.value})),placeholder:x.isRequired?"必填":"可选",className:"h-7 flex-1 font-mono text-xs"}),u.jsx(Me,{size:"icon",variant:"ghost",className:"size-7 shrink-0",onClick:()=>b(x.name),children:i.has(x.name)?u.jsx(hU,{className:"size-3.5"}):u.jsx(Qb,{className:"size-3.5"})})]})]},x.name)),u.jsx("div",{className:"pt-2",children:u.jsxs(Me,{size:"sm",onClick:()=>void _(),disabled:l,children:[u.jsx(oMe,{className:"mr-1.5 size-3.5"}),l?"保存中...":"加密保存"]})})]})]})};function iPe(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 k9n(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 C9n(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 R9n=O.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?`${iPe(new Date(o.registeredAt))} 前`:`${iPe(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(zo,{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 Z.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 Z.teams.killProcess(t,o.pid),title:"停止进程(SIGTERM)",children:[u.jsx(lMe,{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 Z.openExternal(o.url),title:"在浏览器中打开",children:[u.jsx(zd,{size:10}),"打开"]}),u.jsxs("span",{className:"font-mono text-[var(--color-text-muted)]",children:["PID",o.pid]}),o.registeredBy&&u.jsx(Ur,{name:o.registeredBy,color:s.get(o.registeredBy),teamName:t}),u.jsx("span",{className:"text-[var(--color-text-muted)]",children:c})]})]},o.id)})})},P9n);function P9n(e,t){return e.teamName===t.teamName&&k9n(e.members,t.members)&&C9n(e.processes,t.processes)}const iQ=O.memo(function({teamName:t}){return u.jsx(mKe,{teamName:t,surface:"flat",dismissible:!0,className:"mb-3"})});function Ust(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 $9n(e){const{suppressionKey:t,currentKey:n}=e;return t===n&&Ust(e)}const N9n=O.lazy(()=>De(()=>import("./ProjectEditorOverlay-Va_Vz-zz.js"),__vite__mapDeps([61,1])).then(e=>({default:e.ProjectEditorOverlay}))),A9n=1e4;function I9n(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 M9n(e){const t=O.useMemo(()=>(e??[]).filter(r=>!r.removedAt),[e]),n=O.useRef(t);return I9n(n.current,t)||(n.current=t),n.current}function Q9n(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))}O.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(zn,{size:14,className:"shrink-0"}),"团队离线中"]}),u.jsxs(Me,{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(w$,{size:12}),"启动"]})]})});function D9n(e){if(!e)return;const t=new Map(Object.entries(e));return t.size>0?t:void 0}function L9n(e){if(!e)return;const t=new Map(Object.entries(e));return t.size>0?t:void 0}const j9n=O.memo(function({teamName:t,isTeamProvisioning:n,isTeamAlive:r}){const{leadActivity:s,memberSpawnStatuses:i,memberSpawnSnapshot:o,fetchMemberSpawnStatuses:a}=re(vt(c=>({leadActivity:c.leadActivityByTeam[t],memberSpawnStatuses:c.memberSpawnStatusesByTeam[t],memberSpawnSnapshot:c.memberSpawnSnapshotsByTeam[t],fetchMemberSpawnStatuses:c.fetchMemberSpawnStatuses})));return O.useEffect(()=>{const c=cBn(i,o);if((n||c||i==null&&(r===!0||s==="active"||s==="idle"))&&a(t),!n&&!c)return;const d=window.setInterval(()=>{a(t)},lBn);return()=>{window.clearInterval(d)}},[a,r,n,s,o,i,t]),null}),X9n=15e3,U9n=O.memo(function({teamName:t,isTeamProvisioning:n,isTeamAlive:r,isThisTabActive:s}){const{leadActivity:i,fetchTeamAgentRuntime:o}=re(vt(a=>({leadActivity:a.leadActivityByTeam[t],fetchTeamAgentRuntime:a.fetchTeamAgentRuntime})));return O.useEffect(()=>{if(!s||!(n||r===!0||i==="active"||i==="idle"))return;o(t);const c=window.setInterval(()=>{o(t)},X9n);return()=>{window.clearInterval(c)}},[o,r,n,s,i,t]),null}),z9n=O.memo(function({teamName:t,tabId:n,projectId:r,leadSessionId:s,sessionHistoryKey:i,isThisTabActive:o,isTeamAlive:a,sessions:c,sessionsLoading:l}){const d=re(h=>h.fetchSessionDetail),p=O.useRef(null),f=O.useMemo(()=>`${t}:${r??""}:${s??""}:${i}`,[t,r,s,i]);return O.useEffect(()=>{p.current=null},[f]),O.useEffect(()=>{if(!o||!n||!r||!s)return;if(Ust({leadSessionId:s,projectId:r,sessionsLoading:l,knownSessions:c})){p.current=f;return}const m=()=>{$9n({leadSessionId:s,projectId:r,sessionsLoading:l,knownSessions:c,suppressionKey:p.current,currentKey:f})||d(r,s,n,{silent:!0})};if(m(),!a)return;const g=window.setInterval(()=>{m()},1e4);return()=>window.clearInterval(g)},[d,a,o,s,f,r,c,l,n]),null}),B9n=O.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}=re(vt($=>({leadTabData:n?$.tabSessionData[n]??null:null,leadContextSnapshot:$.leadContextByTeam[t]??null,isContextPanelVisible:n?$.tabUIStates.get(n)?.showContextPanel??!1:!1,selectedContextPhase:n?$.tabUIStates.get(n)?.selectedContextPhase??null:null,setContextPanelVisibleForTab:$.setContextPanelVisibleForTab,setSelectedContextPhaseForTab:$.setSelectedContextPhaseForTab,fetchSessionDetail:$.fetchSessionDetail}))),[h,m]=O.useState(!1),g=O.useCallback($=>{n&&d(n,$)},[d,n]),_=O.useCallback($=>{n&&p(n,$)},[p,n]),b=o?.sessionDetail??null,y=o?.conversation??null,x=o?.sessionContextStats??null,S=o?.sessionPhaseInfo??null,v=o?.sessionDetailLoading??!1,T=!!(s&&b?.session?.id===s),E=O.useMemo(()=>{const $=b?.processes;if(!$||$.length===0)return;const R=$.reduce((N,j)=>N+(j.metrics.costUsd??0),0);return R>0?R:void 0},[b?.processes]),{allContextInjections:w,lastAssistantUsage:P,lastAssistantModelName:C}=O.useMemo(()=>{if(!T||!x||!y?.items.length)return{allContextInjections:[],lastAssistantUsage:null,lastAssistantModelName:void 0};const $=l;let R;if($!==null&&S){const F=S.phases.find(z=>z.phaseNumber===$);F&&(R=F.lastAIGroupId)}if(!R){const F=[...y.items].reverse().find(z=>z.type==="ai");if(F?.type!=="ai")return{allContextInjections:[],lastAssistantUsage:null,lastAssistantModelName:void 0};R=F.group.id}const j=x.get(R)?.accumulatedInjections??[];let M=null,U;const A=y.items.find(F=>F.type==="ai"&&F.group.id===R);if(A?.type==="ai"){const F=A.group.responses||[];for(let z=F.length-1;z>=0;z--){const D=F[z];if(D.type==="assistant"&&D.usage){M=D.usage,U=D.model;break}}}return{allContextInjections:j,lastAssistantUsage:M,lastAssistantModelName:U}},[y,x,T,S,l]),k=O.useMemo(()=>Cce(w),[w]),I=O.useMemo(()=>Utt({usage:P,modelName:C,contextWindowTokens:a?.contextWindowTokens??null,visibleContextTokens:k}),[C,P,a?.contextWindowTokens,k]),Q=O.useMemo(()=>{const $=I.contextUsedPercentOfContextWindow??a?.contextUsedPercent;return $==null?null:`${$.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(jtt,{injections:w,onClose:()=>g(!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:()=>g(!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:()=>{g(!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:Q??"上下文"})})]}):null}),F9n=O.memo(function({teamName:t,...n}){const{leadActivity:r,progress:s,memberSpawnStatuses:i,memberSpawnSnapshot:o,runtimeSnapshot:a}=re(vt(f=>({leadActivity:f.leadActivityByTeam[t],progress:Ef(f,t),memberSpawnStatuses:f.memberSpawnStatusesByTeam[t],memberSpawnSnapshot:f.memberSpawnSnapshotsByTeam[t],runtimeSnapshot:f.teamAgentRuntimeByTeam[t]}))),c=O.useMemo(()=>D9n(i),[i]),l=O.useMemo(()=>L9n(a?.members),[a?.members]),d=a?.runId??o?.runId??s?.runId,p=O.useMemo(()=>s?.state!=="ready"?!1:Iz(Az({members:n.members,memberSpawnStatuses:i,memberSpawnSnapshot:o})).hasMembersStillJoining,[o,i,s?.state,n.members]);return u.jsx(zYn,{...n,leadActivity:r,memberSpawnStatuses:c,memberRuntimeEntries:l,runtimeRunId:d,isLaunchSettling:p})}),Y9n=O.memo(function({teamName:t,...n}){const{leadActivity:r,leadContextUpdatedAt:s}=re(vt(i=>({leadActivity:i.leadActivityByTeam[t],leadContextUpdatedAt:i.leadContextByTeam[t]?.updatedAt})));return u.jsx(v9n,{...n,teamName:t,leadActivity:r,leadContextUpdatedAt:s})}),V9n=O.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}=re(vt(m=>({leadActivity:m.leadActivityByTeam[t],liveMember:n?RXe(m,t,n.name):null,progress:Ef(m,t),launchMembers:Use(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??Ef(m,t)?.runId,runtimeEntry:n?m.teamAgentRuntimeByTeam[t]?.members[n.name]:void 0}))),h=O.useMemo(()=>o?.state!=="ready"?!1:Iz(Az({members:a,memberSpawnStatuses:c,memberSpawnSnapshot:l})).hasMembersStillJoining,[a,l,c,o?.state]);return u.jsx(kYn,{...r,teamName:t,member:i??n,isLaunchSettling:h,leadActivity:s,spawnEntry:d,runtimeEntry:f,runtimeRunId:p})}),q9n=({teamName:e,isPaneFocused:t=!1})=>{const{isLight:n}=Js(),[r,s]=O.useState(null),[i,o]=O.useState(null),[a,c]=O.useState(null),[l,d]=O.useState(null),[p,f]=O.useState(()=>tPe(e)),[h,m]=O.useState({open:!1,defaultSubject:"",defaultDescription:"",defaultOwner:""}),[g,_]=O.useState(!1),[b,y]=O.useState(null),[x,S]=O.useState(!1),[v,T]=O.useState(!1),[E,w]=O.useState(!1),[P,C]=O.useState(!1),[k,I]=O.useState({open:!1,mode:"launch"}),[Q,$]=O.useState(!1),R=O.useRef(null),N=O.useRef(null),j=O.useRef(!1);O.useEffect(()=>{const Pe=R.current;Pe&&(Q?Pe.setAttribute("inert",""):Pe.removeAttribute("inert"))},[Q]),O.useEffect(()=>{const Pe=sr=>{const{teamName:xr,taskId:Cs}=sr.detail??{};if(xr!==e||!ae)return;const Ha=ae.tasks.find(qf=>qf.id===Cs);Ha&&o(Ha)},He=sr=>{const{teamName:xr,memberName:Cs}=sr.detail??{};xr===e&&(te(Cs),G(void 0),ne(void 0),U(!0))},Vt=sr=>{const{teamName:xr,memberName:Cs,initialTab:Ha,initialActivityFilter:qf}=sr.detail??{};if(xr!==e||!ae)return;const ax=$e.find(WB=>WB.name===Cs);ax&&(c(ax),d({initialTab:Ha,initialActivityFilter:qf}))},rr=sr=>{const{teamName:xr,owner:Cs}=sr.detail??{};xr===e&&eu("","",Cs??"")};window.addEventListener("graph:open-task",Pe),window.addEventListener("graph:send-message",He),window.addEventListener("graph:open-profile",Vt),window.addEventListener("graph:create-task",rr);const Fr=sr=>xr=>{const{teamName:Cs,taskId:Ha}=xr.detail??{};Cs!==e||!Ha||sr(Ha)},ge=Fr(sr=>{(async()=>{try{const xr=await xe(e,sr);if(ae?.isAlive){const Cs=ae.tasks.find(Ha=>Ha.id===sr);try{xr.notifiedOwner&&Cs?.owner&&await Z.teams.processSend(e,`Task ${Ps(Cs)} "${Cs.subject}" has started. Please begin working on it.`)}catch{}}}catch{}})()}),ht=Fr(sr=>{(async()=>{try{await tn(e,sr,"completed")}catch{}})()}),Bt=Fr(sr=>{(async()=>{try{await Qt(e,sr,{op:"set_column",column:"approved"})}catch{}})()}),xn=Fr(sr=>{(async()=>{try{await Lt(e,sr)}catch{}})()}),En=Fr(sr=>{s(sr)}),Dn=Fr(sr=>{(async()=>{try{await tn(e,sr,"pending")}catch{}})()}),no=Fr(sr=>{(async()=>{try{await Qt(e,sr,{op:"remove"}),await tn(e,sr,"completed")}catch{}})()}),Oa=Fr(sr=>hp(sr));return window.addEventListener("graph:start-task",ge),window.addEventListener("graph:complete-task",ht),window.addEventListener("graph:approve-task",Bt),window.addEventListener("graph:request-review",xn),window.addEventListener("graph:request-changes",En),window.addEventListener("graph:cancel-task",Dn),window.addEventListener("graph:move-back-to-done",no),window.addEventListener("graph:delete-task",Oa),()=>{window.removeEventListener("graph:open-task",Pe),window.removeEventListener("graph:send-message",He),window.removeEventListener("graph:open-profile",Vt),window.removeEventListener("graph:create-task",rr),window.removeEventListener("graph:start-task",ge),window.removeEventListener("graph:complete-task",ht),window.removeEventListener("graph:approve-task",Bt),window.removeEventListener("graph:request-review",xn),window.removeEventListener("graph:request-changes",En),window.removeEventListener("graph:cancel-task",Dn),window.removeEventListener("graph:move-back-to-done",no),window.removeEventListener("graph:delete-task",Oa)}});const[M,U]=O.useState(!1),[A,F]=O.useState(!1),[z,D]=O.useState(!1),[V,q]=O.useState(!1),[ee,te]=O.useState(void 0),[H,G]=O.useState(void 0),[ie,ne]=O.useState(void 0),[pe,Te]=O.useState(void 0),[_e,be]=O.useState({open:!1,mode:"task"}),[Ie,Se]=O.useState([]),oe=k.open,[Oe,K]=O.useState([]),[Y,W]=O.useState(!1),[se,he]=O.useState(null),[we,J]=O.useState({sessionId:null,selectedOwners:new Set,columns:new Set}),[de,ue]=O.useState({field:"updatedAt"}),{data:ae,members:$e,loading:qe,error:ot,projects:Ot,repositoryGroups:nt,initTabUIState:Ge,selectTeam:St,updateKanban:Qt,updateKanbanColumnOrder:ft,updateTaskStatus:tn,updateTaskOwner:jt,sendTeamMessage:On,requestReview:Lt,createTeamTask:fn,startTaskByUser:xe,deleteTeam:Fe,openTeamsTab:_t,closeTab:At,sendingMessage:Ve,sendMessageError:et,sendMessageWarning:Ce,sendMessageDebugDetails:tt,lastSendMessageResult:ve,reviewActionError:Ue,restartMember:mt,skipMemberForLaunch:Ke,removeMember:Ct,updateMemberRole:Xt,launchTeam:Wt,provisioningError:nr,clearProvisioningError:nn,isTeamProvisioning:Zn,refreshTeamData:jr,refreshTeamMessagesHead:Xe,refreshMemberActivityMeta:Re,syncTeamPendingReplyRefresh:me,kanbanFilterQuery:Ee,clearKanbanFilter:le,softDeleteTask:je,restoreTask:Be,fetchDeletedTasks:yt,deletedTasks:wt,launchParams:ut,selectReviewFile:Ut,pendingReviewRequest:yn,setPendingReviewRequest:Rn,teams:We,fetchTeams:Tt}=re(vt(Pe=>({projects:Pe.projects,repositoryGroups:Pe.repositoryGroups,initTabUIState:Pe.initTabUIState,selectTeam:Pe.selectTeam,updateKanban:Pe.updateKanban,updateKanbanColumnOrder:Pe.updateKanbanColumnOrder,updateTaskStatus:Pe.updateTaskStatus,updateTaskOwner:Pe.updateTaskOwner,sendTeamMessage:Pe.sendTeamMessage,requestReview:Pe.requestReview,createTeamTask:Pe.createTeamTask,startTaskByUser:Pe.startTaskByUser,deleteTeam:Pe.deleteTeam,openTeamsTab:Pe.openTeamsTab,closeTab:Pe.closeTab,sendingMessage:Pe.sendingMessage,sendMessageError:Pe.sendMessageError,sendMessageWarning:Pe.sendMessageWarning,sendMessageDebugDetails:Pe.sendMessageDebugDetails,lastSendMessageResult:Pe.lastSendMessageResult,reviewActionError:Pe.reviewActionError,restartMember:Pe.restartMember,skipMemberForLaunch:Pe.skipMemberForLaunch,removeMember:Pe.removeMember,updateMemberRole:Pe.updateMemberRole,launchTeam:Pe.launchTeam,provisioningError:e?Pe.provisioningErrorByTeam[e]??null:null,clearProvisioningError:Pe.clearProvisioningError,isTeamProvisioning:e?T_(Pe,e):!1,data:Pe.selectedTeamName===e?Pe.selectedTeamData:null,members:kl(Pe,e),loading:Pe.selectedTeamName===e?Pe.selectedTeamLoading:!1,error:Pe.selectedTeamName===e?Pe.selectedTeamError:null,refreshTeamData:Pe.refreshTeamData,refreshTeamMessagesHead:Pe.refreshTeamMessagesHead,refreshMemberActivityMeta:Pe.refreshMemberActivityMeta,syncTeamPendingReplyRefresh:Pe.syncTeamPendingReplyRefresh,kanbanFilterQuery:Pe.kanbanFilterQuery,clearKanbanFilter:Pe.clearKanbanFilter,softDeleteTask:Pe.softDeleteTask,restoreTask:Pe.restoreTask,fetchDeletedTasks:Pe.fetchDeletedTasks,deletedTasks:Pe.deletedTasks,launchParams:e?Pe.launchParamsByTeam[e]:void 0,selectReviewFile:Pe.selectReviewFile,pendingReviewRequest:Pe.pendingReviewRequest,setPendingReviewRequest:Pe.setPendingReviewRequest,teams:Pe.teams,fetchTeams:Pe.fetchTeams}))),Kn=C3(),Ar=re(Pe=>Pe.activeTabId),Ne=Kn?Ar===Kn:!1,Ae=O.useRef(!1),mn=O.useCallback(Pe=>{},[]);O.useEffect(()=>{Kn&&Ge(Kn)},[Kn,Ge]),O.useEffect(()=>{f(tPe(e))},[e]),O.useEffect(()=>{Z8n(e,p)},[p,e]),O.useEffect(()=>{const Pe=j.current;j.current=Zn,!Pe&&Zn&&N.current?.scrollIntoView({behavior:"smooth",block:"start"})},[Zn]);const[Xn,ks]=O.useState(""),Us=re(Pe=>Pe.editorPendingRevealFile);O.useEffect(()=>{Us&&ae?.config.projectPath&&$(!0)},[Us,ae?.config.projectPath]),O.useEffect(()=>{e&&(St(e),yt(e))},[e,St,yt]);const Rl=ae?.teamName;O.useEffect(()=>{!Ne||!e||qe||Rl!=null&&Rl!==e&&St(e)},[Ne,e,Rl,qe,St]),O.useEffect(()=>{const Pe=Ne&&t,He=Pe&&!Ae.current;Ae.current=Pe,!(!He||!e)&&(async()=>{try{(await Xe(e)).feedChanged&&await Re(e)}catch{}})()},[t,Ne,Re,Xe,e]),O.useEffect(()=>{if(!oe)return;let Pe=!1;const He=re.getState().teams;return(async()=>{try{const Vt=await Z.teams.aliveList();if(Pe)return;const rr=new Set(Vt),Fr=He.filter(ge=>rr.has(ge.teamName)&&ge.projectPath).map(ge=>({teamName:ge.teamName,displayName:ge.displayName,projectPath:ge.projectPath}));Se(Fr)}catch{}})(),()=>{Pe=!0}},[oe]),O.useEffect(()=>{Ee&&(ks(Ee),le())},[Ee,le]);const Jt=O.useMemo(()=>SDn(ae?.config.projectPath,Ot,nt),[Ot,nt,ae?.config.projectPath]),In=ae?.config.leadSessionId??null,Nn=O.useId(),cr=O.useMemo(()=>(ae?.config.sessionHistory??[]).join("|"),[ae?.config.sessionHistory]);O.useEffect(()=>{const Pe=Object.keys(p).length>0;return me(e,Nn,!!ae?.isAlive&&Pe,A9n),()=>{me(e,Nn,!1)}},[ae?.isAlive,p,Nn,me,e]),O.useEffect(()=>{if(!Jt)return;let Pe=!1;return W(!0),he(null),(async()=>{try{const He=await Z.getSessions(Jt);Pe||K(He)}catch(He){Pe||he(He instanceof Error?He.message:"加载会话失败")}finally{Pe||W(!1)}})(),()=>{Pe=!0}},[Jt]);const _s=ae?.config.projectPath?.trim()??null,zr=O.useMemo(()=>{const Pe=$e.find(He=>Jn(He))?.cwd?.trim();return Pe&&Pe.length>0?Pe:_s},[$e,_s]),mr=O.useMemo(()=>{const Pe=new Map,He=Vt=>{const rr=Vt?.trim();if(!rr)return;const Fr=dr(rr);!Fr||Pe.has(Fr)||Pe.set(Fr,rr)};He(zr);for(const Vt of $e)He(Vt.cwd);return Array.from(Pe.values())},[$e,zr]);Xtt(mr,{live:!0});const gr=re(vt(Pe=>Object.fromEntries(mr.map(He=>{const Vt=dr(He);return[Vt,Pe.branchByPath[Vt]??null]})))),Ms=zr?gr[dr(zr)]??null:null,Oi=O.useMemo(()=>ae?$e.map(Pe=>{const He=Pe.cwd?.trim(),Vt=He&&!Jn(Pe)&&Ms!==null?(()=>{const Fr=gr[dr(He)]??null;return Fr&&Fr!==Ms?Fr:void 0})():void 0;if(Pe.gitBranch===Vt)return Pe;const rr={...Pe};return Vt?rr.gitBranch=Vt:delete rr.gitBranch,rr}):[],[Ms,$e,gr]);O.useMemo(()=>Co(Oi),[Oi]);const ki=O.useMemo(()=>{const Pe=new Set;if(ae?.config.leadSessionId&&Pe.add(ae.config.leadSessionId),ae?.config.sessionHistory)for(const He of ae.config.sessionHistory)Pe.add(He);return Pe},[ae?.config.leadSessionId,ae?.config.sessionHistory]),od=O.useMemo(()=>Oe.filter(Pe=>ki.has(Pe.id)),[Oe,ki]);O.useEffect(()=>{we.sessionId!==null&&!od.some(Pe=>Pe.id===we.sessionId)&&J(Pe=>({...Pe,sessionId:null}))},[we.sessionId,od]);const qa=O.useMemo(()=>{if(we.sessionId===null)return null;const Pe=[...od].sort((Fr,ge)=>Fr.createdAt-ge.createdAt),He=Pe.findIndex(Fr=>Fr.id===we.sessionId);if(He===-1)return null;const Vt=Pe[He].createdAt,rr=He+1<Pe.length?Pe[He+1].createdAt:1/0;return{start:Vt,end:rr}},[we.sessionId,od]),Jc=O.useMemo(()=>{if(!ae)return[];let Pe=ae.tasks;return qa&&(Pe=Pe.filter(He=>{if(!He.createdAt)return!0;const Vt=new Date(He.createdAt).getTime();return Vt>=qa.start&&Vt<qa.end})),we.selectedOwners.size>0&&(Pe=Pe.filter(He=>He.owner?we.selectedOwners.has(He.owner):we.selectedOwners.has(Wee))),Pe},[ae,qa,we.selectedOwners]),Pl=M9n(Oi),Yf=O.useMemo(()=>{const Pe=Xn.trim();return Pe?Q9n(Jc,Pe):Jc},[Jc,Xn]),Hm=O.useMemo(()=>Pl.filter(Pe=>!Jn(Pe)).length,[Pl]),Wa=O.useMemo(()=>new Map((ae?.tasks??[]).map(Pe=>[Pe.id,Pe])),[ae?.tasks]),X_=O.useRef(Wa);X_.current=Wa,O.useMemo(()=>gSt(ae?.tasks??[]),[ae?.tasks]);const eu=O.useCallback((Pe="",He="",Vt="",rr)=>{m({open:!0,defaultSubject:Pe,defaultDescription:He,defaultOwner:Vt,defaultStartImmediately:rr})},[]);O.useCallback(()=>{m({open:!1,defaultSubject:"",defaultDescription:"",defaultOwner:"",defaultStartImmediately:void 0})},[]),O.useCallback((Pe,He)=>{eu(Pe,He)},[]);const Br=O.useCallback(Pe=>{te(Pe.from),G(void 0),ne(void 0),Te({from:Pe.from,text:$a(Pe.text)}),U(!0)},[]),tu=O.useCallback(Pe=>{I({open:!0,mode:Pe})},[]),Zm=O.useCallback(()=>{I(Pe=>({...Pe,open:!1}))},[]),Vf=O.useCallback(()=>{tu("relaunch")},[tu]);O.useCallback(()=>{(async()=>{if(!ae?.config.projectPath){tu("launch");return}await Z.ccSettings.restart(),await Z.teams.launchTeam({teamName:e,cwd:ae.config.projectPath}),window.setTimeout(()=>{Tt(),St(e)},1500)})()},[ae?.config.projectPath,Tt,tu,St,e]);const Km=O.useCallback(async Pe=>{await Wt(Pe),await Promise.all([Tt(),St(e)])},[Tt,Wt,St,e]),nu=O.useCallback(async(Pe,He)=>{await CFn({teamName:e,isTeamAlive:ae?.isAlive===!0,request:Pe,members:He,stopTeam:Vt=>Z.teams.stop(Vt),replaceMembers:(Vt,rr)=>Z.teams.replaceMembers(Vt,rr),launchTeam:Wt}),await Promise.all([Tt(),St(e)])},[ae?.isAlive,Tt,Wt,St,e]);O.useCallback(async()=>{await Z.ccSettings.restart(),await Promise.all([Tt(),St(e)])},[Tt,St,e]),O.useCallback(async Pe=>{if(!ae?.config.projectPath)throw new Error("团队缺少项目路径,无法自动重启。");await Z.teams.stop(e);const He={teamName:e,cwd:ae.config.projectPath,providerId:Pe.providerId,model:Pe.model,effort:Pe.effort,fastMode:Pe.fastMode,clearContext:Pe.clearContext};await Wt(He)},[ae?.config.projectPath,Wt,e]);const U_=O.useCallback(async Pe=>{await mt(e,Pe)},[mt,e]),f1=O.useCallback(async Pe=>{await Ke(e,Pe)},[Ke,e]),ix=O.useCallback(Pe=>{c(Pe),d(null)},[]),z_=O.useCallback(()=>{c(null),d(null)},[]),FB=O.useCallback(Pe=>{te(Pe.name),G(void 0),ne(void 0),Te(void 0),U(!0)},[]);O.useCallback(Pe=>{eu("","",Pe.name)},[eu]),O.useCallback(Pe=>{const He=X_.current.get(Pe);He&&o(He)},[]),O.useCallback(Pe=>{o(Pe)},[]),O.useCallback(Pe=>{const He=Wa.get(Pe)??ae?.tasks.find(Vt=>Vt.displayId===Pe);He&&o(He)},[Wa,ae?.tasks]);const uA=O.useCallback(Pe=>{const He=ree(Pe,[])??void 0;Pe.type==="sendMessage"?(G(He?void 0:Pe.formattedContext),ne(He),te(void 0),Te(void 0),U(!0)):Pe.type==="createTask"&&(He?m({open:!0,defaultSubject:"",defaultDescription:"",defaultOwner:"",defaultStartImmediately:void 0,defaultChip:He}):eu("",Pe.formattedContext))},[]);O.useEffect(()=>{yn&&(be({open:!0,mode:"task",taskId:yn.taskId,initialFilePath:yn.filePath,taskChangeRequestOptions:yn.requestOptions}),yn.filePath&&Ut(yn.filePath),Rn(null))},[yn,Ut,Rn]);const Jm=re(Pe=>Pe.pendingMemberProfile);O.useEffect(()=>{if(!Jm||!ae)return;const Pe=Oi.find(He=>He.name===Jm);Pe&&(c(Pe),d(null)),re.getState().closeMemberProfile()},[Jm,Oi]);const hp=O.useCallback(Pe=>{(async()=>{if(await nf({title:"删除任务",message:`将任务 #${Ui(Pe)} 移入废纸篓?`,confirmLabel:"删除",cancelLabel:"取消",variant:"danger"}))try{await je(e,Pe)}catch{}})()},[e,je]),ox=O.useCallback(Pe=>{const He=Wa.get(Pe);be({open:!0,mode:"task",taskId:Pe,taskChangeRequestOptions:He?Yc(He):{}})},[Wa]);O.useCallback((Pe,He)=>{const Vt=Wa.get(Pe);be({open:!0,mode:"task",taskId:Pe,initialFilePath:He,taskChangeRequestOptions:Vt?Yc(Vt):{}}),He&&Ut(He)},[Ut,Wa]);const dA=O.useCallback(()=>{F(!0)},[]),YB=O.useCallback(()=>{D(!0),(async()=>{try{(await Fe(e)).restartRequired&&await Z.ccSettings.restart(),await Tt(),F(!1),Kn&&At(Kn),_t()}catch(Pe){console.error("Failed to delete team:",Pe),F(!1)}finally{D(!1)}})()},[e,Fe,_t,At,Kn,Tt]),VB=O.useMemo(()=>({teamName:e,onPositionChange:mn,mountPoint:null,members:Pl,tasks:ae?.tasks??[],isTeamAlive:ae?.isAlive,timeWindow:qa,teamSessionIds:ki,currentLeadSessionId:ae?.config.leadSessionId,pendingRepliesByMember:p,onPendingReplyChange:f,onMemberClick:ix,onReplyToMessage:Br,onRestartTeam:Vf,inlineScrollContainerRef:R,showPositionControls:!1}),[Pl,ae?.config.leadSessionId,ae?.isAlive,ae?.tasks,Br,Vf,ix,p,e,ki,qa,mn]);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 pA=u.jsx(j9n,{teamName:e,isTeamProvisioning:Zn,isTeamAlive:ae?.isAlive}),Ga=u.jsx(U9n,{teamName:e,isTeamProvisioning:Zn,isTeamAlive:ae?.isAlive,isThisTabActive:Ne}),B_=u.jsx(z9n,{teamName:e,tabId:Kn,projectId:Jt,leadSessionId:In,sessionHistoryKey:cr,isThisTabActive:Ne,isTeamAlive:ae?.isAlive,sessions:Oe,sessionsLoading:Y}),qB=()=>{if(qe&&!ae||ae&&ae.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:N,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(ot==="TEAM_DRAFT"){const He=re.getState().teamByName[e],Vt=He?.displayName||e;return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"size-full overflow-auto p-6",children:[u.jsx("div",{ref:N,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:Vt})," ","尚未完成启动,点击“启动团队”后即可选择模型并进入动态编排。"]}),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:()=>tu("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:()=>{Z.teams.deleteDraft(e).catch(()=>{})},children:"删除"})]})]})})]}),u.jsx(qee,{mode:k.mode,open:oe,teamName:e,members:[],defaultProjectPath:He?.projectPath,provisioningError:nr,clearProvisioningError:nn,onClose:Zm,onLaunch:Km,onRelaunch:nu})]})}if(ot)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:ot}),u.jsx("div",{className:"mt-4",children:u.jsx(Me,{size:"sm",variant:"outline",onClick:()=>void St(e,{allowReloadWhileProvisioning:!0}),children:"重试加载"})})]})});if(!ae)return u.jsxs("div",{className:"size-full overflow-auto p-4",children:[u.jsx("div",{ref:N,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 Pe=ae.config.color?Wr(ae.config.color):qc(ae.config.name);return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex size-full overflow-hidden",children:[u.jsx(B9n,{teamName:e,tabId:Kn,projectId:Jt,leadSessionId:In,fallbackProjectRoot:ae.config.projectPath}),u.jsx("div",{className:"relative min-h-0 min-w-0 flex-1",children:u.jsxs("div",{ref:R,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:[Pe?u.jsx("div",{className:"pointer-events-none absolute inset-0 z-0",style:{backgroundColor:wi(Pe,n)}}):null,u.jsxs("div",{className:st("flex items-start justify-between gap-2",Pe&&"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:ae.config.name}),ae.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"}),"运行中"]}),!ae.isAlive&&Zn&&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(Me,{variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2.5 text-xs text-[var(--color-text-secondary)]",disabled:Zn,onClick:()=>T(!0),children:[u.jsx(Db,{size:12}),"编辑"]}),u.jsxs(uc,{open:P,onOpenChange:C,children:[u.jsx(Gc,{asChild:!0,children:u.jsx(Me,{variant:"ghost",size:"sm",className:"h-7 w-7 px-0 text-[var(--color-text-muted)]",children:u.jsx(Vne,{size:14})})}),u.jsxs(Sl,{align:"end",className:"w-44 p-1",children:[ae.config.projectPath&&u.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-xs text-[var(--color-text-secondary)] hover:bg-[var(--color-surface-raised)] hover:text-[var(--color-text)]",onClick:()=>{C(!1),w(!0)},children:[u.jsx(Kne,{size:13}),"环境变量"]}),e!=="default"&&e!=="my-project"&&u.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-xs text-red-400 hover:bg-red-500/10",onClick:()=>{C(!1),dA()},children:[u.jsx(Ai,{size:13}),"删除团队"]})]})]})]})]}),ae.config.description&&u.jsx("p",{className:st("min-w-0 truncate text-xs text-[var(--color-text-muted)]",Pe&&"relative z-10"),children:ae.config.description}),u.jsx("div",{className:st("mt-1 flex items-start justify-between gap-3",Pe&&"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:[ae.config.projectPath&&u.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--color-text-secondary)]",children:[u.jsx(Fc,{size:11,className:"shrink-0 text-[var(--color-text-muted)]"}),u.jsxs(at,{children:[u.jsx(lt,{asChild:!0,children:u.jsx("span",{className:"max-w-60 truncate font-mono",children:ae.config.projectPath.replace(/\\/g,"/").split("/").filter(Boolean).pop()??ae.config.projectPath})}),u.jsx(it,{side:"bottom",children:u.jsx("span",{className:"font-mono text-xs",children:_ee(ae.config.projectPath)})})]})]}),Ms&&u.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--color-text-secondary)]",title:Ms,children:[u.jsx(E$,{size:11,className:"shrink-0 text-[var(--color-text-muted)]"}),u.jsx("span",{className:"max-w-32 truncate",children:Ms})]})]})}),(()=>{const He=ae.config.projectPath,Vt=ae.config.projectPathHistory?.filter(rr=>rr!==He);return!Vt||Vt.length===0?null:u.jsxs("div",{className:st("mt-0.5 flex items-center gap-1 text-[10px] text-[var(--color-text-muted)]",Pe&&"relative z-10"),children:[u.jsx(Gne,{size:10,className:"shrink-0"}),u.jsxs("span",{className:"truncate",children:["历史路径:",Vt.map(rr=>_ee(rr)).join(", ")]})]})})()]}),u.jsx("div",{ref:N,children:u.jsx(iQ,{teamName:e})}),ae.warnings?.some(He=>He.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,Ue?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:Ue}):null,u.jsx(Vp,{sectionId:"team",title:"团队",icon:u.jsx(ac,{size:14}),badge:Hm===0?"单人":Hm,defaultOpen:!0,children:u.jsx(F9n,{teamName:e,members:Oi,pendingRepliesByMember:p,isTeamAlive:ae.isAlive,isTeamProvisioning:Zn,launchParams:ut,onMemberClick:ix,onSendMessage:FB,onRestartMember:U_,onSkipMemberForLaunch:f1})}),u.jsx(Vp,{sectionId:"kanban",title:"外部派单",icon:u.jsx(Wv,{size:14}),badge:Jc.length,headerExtra:u.jsx("span",{className:"ml-1.5 rounded bg-amber-500/15 px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-amber-500",children:"Beta"}),defaultOpen:!0,forceOpen:Xn.trim().length>0,action:u.jsxs(Me,{variant:"ghost",size:"sm",className:"h-6 gap-1 px-2 text-xs text-[var(--color-text-muted)] hover:text-[var(--color-text)]",onClick:He=>{He.stopPropagation(),eu()},children:[u.jsx(oc,{size:12}),"新建"]}),children:u.jsx("div",{className:"min-w-0",children:u.jsx(oYn,{tasks:Yf,teamName:e,kanbanState:ae.kanbanState,filter:we,sort:de,sessions:od,leadSessionId:ae.config.leadSessionId,members:Pl,onFilterChange:J,onSortChange:ue,toolbarLeft:u.jsx(lYn,{value:Xn,onChange:ks,tasks:Jc,members:Pl}),onRequestReview:He=>{(async()=>{try{await Lt(e,He)}catch{}})()},onApprove:He=>{(async()=>{try{await Qt(e,He,{op:"set_column",column:"approved"})}catch{}})()},onRequestChanges:He=>{s(He)},onMoveBackToDone:He=>{(async()=>{try{await Qt(e,He,{op:"remove"}),await tn(e,He,"completed")}catch{}})()},onStartTask:He=>{(async()=>{try{const Vt=await xe(e,He);if(ae?.isAlive){const rr=ae.tasks.find(Fr=>Fr.id===He);try{if(Vt.notifiedOwner&&rr?.owner)await Z.teams.processSend(e,`Task ${Ps(rr)} "${rr.subject}" has started. Please begin working on it.`);else if(!Vt.notifiedOwner){const Fr=rr?.description?.trim()?`
|
|
1845
1845
|
Description: ${rr.description.trim()}`:"";await Z.teams.processSend(e,`Task #${Ui(He)} "${rr?.subject??""}" has been moved to IN PROGRESS but has no assignee.${Fr}
|
|
1846
1846
|
Please assign it to an available team member, or take it yourself if everyone is busy.`)}}catch{}}}catch{}})()},onCompleteTask:He=>{(async()=>{try{await tn(e,He,"completed")}catch{}})()},onCancelTask:He=>{(async()=>{try{const Vt=ae?.tasks.find(rr=>rr.id===He);if(await tn(e,He,"pending"),Vt?.owner)try{await Z.teams.sendMessage(e,{member:Vt.owner,text:`Task ${Ps(Vt)} "${Vt.subject}" has been CANCELLED by the user and moved back to TODO. Stop working on it immediately.`,summary:`Task ${Ps(Vt)} cancelled`})}catch{}if(ae?.isAlive)try{const rr=Vt?.owner?` ${Vt.owner} has been notified to stop.`:"";await Z.teams.processSend(e,`Task #${Ui(He)} "${Vt?.subject??""}" has been cancelled and moved back to TODO.${rr}`)}catch{}}catch{}})()},onColumnOrderChange:(He,Vt)=>{(async()=>{try{await ft(e,He,Vt)}catch{}})()},onScrollToTask:He=>{const Vt=document.querySelector(`[data-task-id="${He}"]`);Vt&&(Vt.scrollIntoView({behavior:"smooth",block:"nearest"}),Vt.classList.remove("kanban-card-focus-pulse"),Vt.offsetWidth,Vt.classList.add("kanban-card-focus-pulse"),Vt.addEventListener("animationend",()=>Vt.classList.remove("kanban-card-focus-pulse"),{once:!0}))},onTaskClick:He=>{o(He)},onViewChanges:ox,onAddTask:He=>eu("","","",He),onDeleteTask:hp,deletedTaskCount:wt.length,onOpenTrash:()=>q(!0)})})}),u.jsx(Y9n,{position:"inline",...VB}),(ae.processes?.length??0)>0&&u.jsx(Vp,{sectionId:"processes",title:"CLI 进程",icon:u.jsx(zo,{size:14}),badge:ae.processes.filter(He=>!He.stoppedAt).length,headerExtra:ae.processes.some(He=>!He.stoppedAt)?u.jsxs("span",{className:"pointer-events-none relative inline-flex size-2 shrink-0",title:"活跃中",children:[u.jsx("span",{className:"absolute inline-flex size-full animate-ping rounded-full bg-emerald-400 opacity-50"}),u.jsx("span",{className:"relative inline-flex size-2 rounded-full bg-emerald-400"})]}):null,defaultOpen:!0,children:u.jsx(R9n,{teamName:e,members:Oi,processes:ae.processes})}),u.jsx(SFn,{open:r!==null,teamName:e,taskId:r,members:$e,onCancel:()=>s(null),onSubmit:(He,Vt)=>{r&&(async()=>{try{await Qt(e,r,{op:"request_changes",comment:He,taskRefs:Vt}),s(null)}catch{}})()}}),u.jsx(V9n,{open:a!==null,member:a,teamName:e,members:Oi,tasks:ae.tasks,initialTab:l?.initialTab,initialActivityFilter:l?.initialActivityFilter,isTeamAlive:ae.isAlive,isTeamProvisioning:Zn,launchParams:ut,onClose:z_,onSendMessage:()=>{const He=a?.name??"";z_(),te(He||void 0),G(void 0),ne(void 0),Te(void 0),U(!0)},onRestartMember:U_,onUpdateRole:async(He,Vt)=>{S(!0);try{await Xt(e,He,Vt),c(rr=>{if(rr?.name!==He)return rr;const Fr=typeof Vt=="string"&&Vt.trim()?Vt.trim():void 0;return{...rr,role:Fr}})}finally{S(!1)}},updatingRole:x,onRemoveMember:()=>{const He=a?.name;He&&y(He)},onViewMemberChanges:(He,Vt)=>{z_(),be({open:!0,mode:"agent",memberName:He,initialFilePath:Vt})}}),u.jsx(us,{open:E,onOpenChange:w,children:u.jsxs(ts,{className:"max-h-[80vh] max-w-lg overflow-y-auto",children:[u.jsxs(ds,{children:[u.jsx(ns,{children:"项目环境变量"}),u.jsx(oi,{children:"管理当前项目所需的环境变量,供 MCP 和 Skills 使用。"})]}),u.jsx(w9n,{projectPath:ae.config.projectPath??null})]})}),u.jsx(us,{open:b!==null,onOpenChange:He=>{He||y(null)},children:u.jsxs(ts,{className:"max-w-sm",children:[u.jsxs(ds,{children:[u.jsx(ns,{children:"移除成员"}),u.jsxs(oi,{children:["确认将 “",b,"” 从团队中移除?任务与消息会保留, 但该名称将无法再次使用。"]})]}),u.jsxs(ed,{children:[u.jsx(Me,{variant:"ghost",size:"sm",onClick:()=>y(null),children:"取消"}),u.jsx(Me,{variant:"destructive",size:"sm",onClick:()=>{const He=b;y(null),z_(),He&&Ct(e,He)},children:"移除"})]})]})}),u.jsx(us,{open:A,onOpenChange:He=>{z||F(He)},children:u.jsxs(ts,{className:"max-w-sm",children:[u.jsxs(ds,{children:[u.jsx(ns,{children:"删除团队"}),u.jsxs(oi,{children:["确认删除团队 “",ae.config.name,"”?此操作不可恢复,所有团队数据与任务都将被删除。"]})]}),u.jsxs(ed,{children:[u.jsx(Me,{variant:"ghost",size:"sm",onClick:()=>F(!1),children:"取消"}),u.jsxs(Me,{variant:"destructive",size:"sm",onClick:YB,disabled:z,children:[z&&u.jsx(zt,{size:14,className:"mr-1.5 animate-spin"}),"删除并重启"]})]})]})}),u.jsx(qee,{mode:k.mode,open:oe,teamName:e,members:Oi,defaultProjectPath:ae.config.projectPath,projectPath:ae.config.projectPath,provisioningError:nr,clearProvisioningError:nn,activeTeams:Ie,onClose:Zm,onLaunch:Km,onRelaunch:nu}),u.jsx(kFn,{open:M,teamName:e,members:Pl,defaultRecipient:ee,defaultText:H,defaultChip:ie,quotedMessage:pe,isTeamAlive:ae.isAlive,sending:Ve,sendError:et,sendWarning:Ce,sendDebugDetails:tt,lastResult:ve,onSend:async(He,Vt,rr,Fr,ge,ht)=>{const Bt=Date.now();f(xn=>({...xn,[He]:Bt}));try{const xn=await On(e,{member:He,text:Vt,summary:rr,attachments:Fr,actionMode:ge,taskRefs:ht});return xn?.runtimeDelivery?.attempted===!0&&xn.runtimeDelivery.delivered===!1&&f(En=>{if(En[He]!==Bt)return En;const Dn={...En};return delete Dn[He],Dn}),xn}catch(xn){throw f(En=>{if(En[He]!==Bt)return En;const Dn={...En};return delete Dn[He],Dn}),xn}},onClose:()=>{U(!1),Te(void 0),G(void 0),ne(void 0)}}),u.jsx(E9n,{open:_e.open,onOpenChange:He=>be(Vt=>({...Vt,open:He,...He?{}:{initialFilePath:void 0,taskChangeRequestOptions:void 0}})),teamName:e,mode:_e.mode,memberName:_e.memberName,taskId:_e.taskId,initialFilePath:_e.initialFilePath,taskChangeRequestOptions:_e.taskChangeRequestOptions,projectPath:ae.config.projectPath,onEditorAction:uA})]})})]}),Q&&ae.config.projectPath&&u.jsx(O.Suspense,{fallback:null,children:u.jsx(N9n,{projectPath:ae.config.projectPath,onClose:()=>$(!1),onEditorAction:uA})})]})};return u.jsxs(u.Fragment,{children:[pA,Ga,B_,qB(),u.jsx(SBn,{open:v,teamName:e,onClose:()=>T(!1),onDeleteTeam:e!=="default"&&e!=="my-project"?dA:void 0})]})},zst=2,uf="createTeamDraft:form";function W9n(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.version=="number"&&t.version===zst&&typeof t.teamName=="string"&&(t.cwdMode==="project"||t.cwdMode==="custom")&&typeof t.selectedProjectPath=="string"&&typeof t.customCwd=="string"&&typeof t.teamColor=="string"&&typeof t.updatedAt=="number"}let BB=!1,oPe=!1;const oE=new Map;function bue(){oPe||(oPe=!0,console.warn("[createTeamDraftStorage] IndexedDB unavailable, using in-memory storage for this session.")),BB=!0}async function G9n(e){if(BB){oE.set(uf,e);return}try{await My(uf,e)}catch{bue(),oE.set(uf,e)}}async function H9n(){if(BB)return oE.get(uf)??null;try{const e=await Fd(uf);return e==null?null:W9n(e)?e:(sl(uf),null)}catch{return bue(),oE.get(uf)??null}}async function Z9n(){if(BB){oE.delete(uf);return}try{await sl(uf)}catch{bue(),oE.delete(uf)}}function K9n(){return{version:zst,teamName:"",cwdMode:"project",selectedProjectPath:"",customCwd:"",teamColor:"",updatedAt:Date.now()}}const Wx={saveSnapshot:G9n,loadSnapshot:H9n,deleteSnapshot:Z9n,emptySnapshot:K9n},J9n=400,eHn=2;function tHn(){const[e,t]=O.useState(""),[n,r]=O.useState("project"),[s,i]=O.useState(""),[o,a]=O.useState(""),[c,l]=O.useState(""),[d,p]=O.useState(!1),f=O.useRef(""),h=O.useRef("project"),m=O.useRef(""),g=O.useRef(""),_=O.useRef(""),b=O.useRef(!0),y=O.useRef(!1),x=O.useRef(null),S=O.useRef(null);O.useEffect(()=>(b.current=!0,()=>{b.current=!1}),[]);const v=O.useCallback(()=>({version:eHn,teamName:f.current,cwdMode:h.current,selectedProjectPath:m.current,customCwd:g.current,teamColor:_.current,updatedAt:Date.now()}),[]),T=O.useCallback(()=>{if(x.current!=null&&(clearTimeout(x.current),x.current=null),S.current!=null){const R=S.current;S.current=null,R.teamName===""?Wx.deleteSnapshot():Wx.saveSnapshot(R)}},[]),E=O.useCallback(()=>{const R=v();S.current=R,x.current!=null&&clearTimeout(x.current),x.current=setTimeout(()=>{x.current=null;const N=S.current;if(S.current=null,N==null)return;N.teamName===""?Wx.deleteSnapshot():Wx.saveSnapshot(N)},J9n)},[v]),w=O.useCallback(R=>{f.current=R.teamName,h.current=R.cwdMode,m.current=R.selectedProjectPath,g.current=R.customCwd,_.current=R.teamColor,t(R.teamName),r(R.cwdMode),i(R.selectedProjectPath),a(R.customCwd),l(R.teamColor)},[]);O.useEffect(()=>{let R=!1;return(async()=>{const N=await Wx.loadSnapshot();if(!R){if(y.current){b.current&&p(!0);return}N!=null&&w(N),b.current&&p(!0)}})(),()=>{R=!0}},[w]),O.useEffect(()=>()=>{T()},[T]);const P=O.useCallback(R=>{y.current=!0,f.current=R,t(R),E()},[E]),C=O.useCallback(R=>{y.current=!0,h.current=R,r(R),E()},[E]),k=O.useCallback(R=>{y.current=!0,m.current=R,i(R),E()},[E]),I=O.useCallback(R=>{y.current=!0,g.current=R,a(R),E()},[E]),Q=O.useCallback(R=>{y.current=!0,_.current=R,l(R),E()},[E]),$=O.useCallback(()=>{x.current!=null&&(clearTimeout(x.current),x.current=null),S.current=null,y.current=!0,f.current="",h.current="project",m.current="",g.current="",_.current="",t(""),r("project"),i(""),a(""),l(""),Wx.deleteSnapshot()},[]);return{teamName:e,setTeamName:P,cwdMode:n,setCwdMode:C,selectedProjectPath:s,setSelectedProjectPath:k,customCwd:o,setCustomCwd:I,teamColor:c,setTeamColor:Q,isLoaded:d,clearDraft:$}}const _9={telegram:{label:"Telegram",fields:[{key:"token",label:"Bot Token",required:!0,type:"password",placeholder:"123456:ABC-DEF..."},{key:"allow_from",label:"Allow From",placeholder:"* (all)",group:"advanced",hint:"限制可交互的用户/群,* 表示所有"},{key:"group_reply_all",label:"群聊回复全部",type:"boolean",group:"advanced"},{key:"share_session_in_channel",label:"共享群会话",type:"boolean",group:"advanced"}]},discord:{label:"Discord",fields:[{key:"token",label:"Bot Token",required:!0,type:"password"},{key:"allow_from",label:"Allow From",placeholder:"* (all)",group:"advanced"},{key:"guild_id",label:"Guild ID",placeholder:"",group:"advanced",hint:"限定特定服务器"},{key:"group_reply_all",label:"群聊回复全部",type:"boolean",group:"advanced"},{key:"share_session_in_channel",label:"共享频道会话",type:"boolean",group:"advanced"},{key:"thread_isolation",label:"Thread 隔离",type:"boolean",group:"advanced"}]},slack:{label:"Slack",fields:[{key:"bot_token",label:"Bot Token",required:!0,type:"password",placeholder:"xoxb-..."},{key:"app_token",label:"App Token",required:!0,type:"password",placeholder:"xapp-..."},{key:"allow_from",label:"Allow From",placeholder:"* (all)",group:"advanced"},{key:"share_session_in_channel",label:"共享频道会话",type:"boolean",group:"advanced"}]},dingtalk:{label:"DingTalk",fields:[{key:"client_id",label:"Client ID",required:!0},{key:"client_secret",label:"Client Secret",required:!0,type:"password"},{key:"allow_from",label:"Allow From",placeholder:"* (all)",group:"advanced"},{key:"share_session_in_channel",label:"共享群会话",type:"boolean",group:"advanced"}]},wecom:{label:"企业微信",fields:[{key:"corp_id",label:"Corp ID",required:!0},{key:"corp_secret",label:"Corp Secret",required:!0,type:"password"},{key:"agent_id",label:"Agent ID",required:!0,placeholder:"1000002"},{key:"callback_token",label:"Callback Token",required:!0},{key:"callback_aes_key",label:"Callback AES Key",required:!0,hint:"43 位 AES 密钥"},{key:"port",label:"端口",required:!0,placeholder:"8081"},{key:"callback_path",label:"Callback Path",placeholder:"/wecom/callback",group:"advanced"},{key:"api_base_url",label:"API Base URL",placeholder:"https://qyapi.weixin.qq.com",group:"advanced"},{key:"allow_from",label:"Allow From",placeholder:"* (all)",group:"advanced"}]},qq:{label:"QQ (OneBot v11)",fields:[{key:"ws_url",label:"WebSocket URL",required:!0,placeholder:"ws://127.0.0.1:3001"},{key:"token",label:"Access Token",type:"password",group:"advanced"},{key:"allow_from",label:"Allow From",placeholder:"* (all)",group:"advanced"},{key:"share_session_in_channel",label:"共享群会话",type:"boolean",group:"advanced"}]},qqbot:{label:"QQ Bot (官方)",fields:[{key:"app_id",label:"App ID",required:!0},{key:"app_secret",label:"App Secret",required:!0,type:"password"},{key:"sandbox",label:"沙盒模式",type:"boolean",group:"advanced"},{key:"allow_from",label:"Allow From",placeholder:"* (all)",group:"advanced"},{key:"share_session_in_channel",label:"共享群会话",type:"boolean",group:"advanced"}]},line:{label:"LINE",fields:[{key:"channel_secret",label:"Channel Secret",required:!0,type:"password"},{key:"channel_token",label:"Channel Token",required:!0,type:"password"},{key:"port",label:"端口",required:!0,placeholder:"8080"},{key:"callback_path",label:"Callback Path",placeholder:"/callback",group:"advanced"},{key:"allow_from",label:"Allow From",placeholder:"* (all)",group:"advanced"}]},weibo:{label:"微博",fields:[{key:"app_id",label:"App ID",required:!0,placeholder:"1234567890"},{key:"app_secret",label:"App Secret",required:!0,type:"password"},{key:"allow_from",label:"Allow From",placeholder:"* (all)",group:"advanced"}]}},nHn=["feishu","lark","weixin"];function rHn(e){return nHn.includes(e)}var sHn=Object.defineProperty,IX=Object.getOwnPropertySymbols,Bst=Object.prototype.hasOwnProperty,Fst=Object.prototype.propertyIsEnumerable,aPe=(e,t,n)=>t in e?sHn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xte=(e,t)=>{for(var n in t||(t={}))Bst.call(t,n)&&aPe(e,n,t[n]);if(IX)for(var n of IX(t))Fst.call(t,n)&&aPe(e,n,t[n]);return e},Ste=(e,t)=>{var n={};for(var r in e)Bst.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&IX)for(var r of IX(e))t.indexOf(r)<0&&Fst.call(e,r)&&(n[r]=e[r]);return n};/**
|
|
1847
1847
|
* @license QR Code generator library (TypeScript)
|