@tencent-ai/codebuddy-code 2.83.0 → 2.83.1-next.118b8fc.20260412
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/CHANGELOG.md +11 -0
- package/dist/codebuddy-headless.js +80 -81
- package/dist/codebuddy.js +87 -88
- package/dist/web-ui/assets/{index-CoP0gamp.js → index-DM_uJq2E.js} +111 -111
- package/dist/web-ui/index.html +1 -1
- package/package.json +3 -2
- package/product.cloudhosted.json +2 -2
- package/product.internal.json +2 -2
- package/product.ioa.json +2 -2
- package/product.json +2 -2
- package/product.selfhosted.json +2 -2
|
@@ -6,532 +6,532 @@ var dh=Object.defineProperty;var uh=(e,t,r)=>t in e?dh(e,t,{enumerable:!0,config
|
|
|
6
6
|
|
|
7
7
|
`);s=o.pop()||"";for(const c of o){const p=c.split(`
|
|
8
8
|
`);let g="";for(const b of p)b.startsWith("data: ")&&(g+=b.substring(6));if(g)try{const b=JSON.parse(g);this.handleMessage(b)}catch{}}}}finally{r.releaseLock()}}handleMessage(t){if("method"in t&&"id"in t&&t.id!==void 0&&t.id!==null){if(t.method==="session/request_permission"){this.handlePermissionRequest(t.id,t.params);return}if(t.method==="_codebuddy.ai/question"){this.handleExtMethodQuestion(t.id,t.params);return}if(t.method==="_codebuddy.ai/delegateTool"){this.handleExtMethodDelegateTool(t.id,t.params);return}return}if("id"in t&&t.id!==void 0&&t.id!==null&&!("method"in t)){const r=this.pendingRequests.get(t.id);r&&(this.pendingRequests.delete(t.id),"error"in t&&t.error?r.reject(new Error(t.error.message)):r.resolve(t.result))}if("method"in t&&t.method==="session/update"){const r=t.params;if(r!=null&&r.update){const i=r.update,l=((i==null?void 0:i._meta)||{})["codebuddy.ai/interruptionRequest"];l&&this.emit("interruption_request",{sessionUpdate:"interruption_request",sessionId:r.sessionId,interruptionId:l.interruptionId||`ir-${l.toolCallId}`,reason:"Tool requires approval",options:l.options||[],toolName:l.toolName,toolTitle:l.toolTitle,toolInput:l.toolInput,toolCallId:l.toolCallId});const d=r.update.sessionUpdate;this.emit(d,r.update)}}else if("method"in t&&t.method!=="session/update"&&!("id"in t&&t.id!==void 0&&t.id!==null)&&t.method==="_codebuddy.ai/checkpoint"){const i=t.params;(i==null?void 0:i.event)==="created"?this.emit("checkpointCreated",i.checkpoint):(i==null?void 0:i.event)==="updated"?this.emit("checkpointUpdated",i.checkpoint):(i==null?void 0:i.event)==="reverted"&&this.emit("checkpointReverted",i.checkpoint)}}mapPermissionDecisionToOptionId(t){return t==="allowAll"?"allow_always":t==="allow"?"allow":t==="rejectAndExitPlan"?"reject_and_exit_plan":"reject"}async sendJsonRpcResult(t,r){var l;const i={jsonrpc:"2.0",id:t,result:r},s=await fetch(`${this.baseUrl}/api/v1/acp`,{method:"POST",headers:this.buildAcpHeaders(),body:JSON.stringify(i)});if(!s.ok){let d="";try{const a=await s.json();(l=a==null?void 0:a.error)!=null&&l.message&&(d=a.error.message)}catch{}throw new Error(d||`ACP response failed: ${s.status} ${s.statusText}`)}}buildAcpHeaders(){const t={"Content-Type":"application/json",Accept:"application/json, text/event-stream"};return this.connectionId&&(t["acp-connection-id"]=this.connectionId),this.sessionToken&&(t["acp-session-token"]=this.sessionToken),this.token&&(t.Authorization=`Bearer ${this.token}`),t}handlePermissionRequest(t,r){var c;const i=r==null?void 0:r.toolCall,s=`perm-${t}`,l=((c=i==null?void 0:i._meta)==null?void 0:c["codebuddy.ai/toolName"])||(i==null?void 0:i.toolName)||"tool",d=(i==null?void 0:i.title)||l,a=i==null?void 0:i.rawInput,o=i==null?void 0:i.toolCallId;this.permissionRequestIds.set(s,t),o&&this.permissionRequestToolCallIds.set(o,s),this.emit("interruption_request",{sessionUpdate:"interruption_request",interruptionId:s,reason:"Tool requires approval",options:((r==null?void 0:r.options)||[]).map(p=>p.optionId||p.name),toolName:l,toolTitle:d,toolInput:a,toolCallId:o})}handleExtMethodQuestion(t,r){const{sessionId:i,toolCallId:s,schema:l}=r||{},d=((l==null?void 0:l.questions)||[]).map(a=>({id:a.id,question:a.question,header:a.header||"",options:(a.options||[]).map(o=>({label:o.label||"",description:o.description||""})),multiSelect:!!a.multiSelect}));this.extMethodRequestIds.set(s,t),this.emit("question_request",{toolCallId:s,sessionId:i,questions:d})}async handleExtMethodDelegateTool(t,r){const{toolId:i,input:s}=r||{};try{if(i==="ui-control"){const{uiController:l}=await Hr(async()=>{const{uiController:a}=await import("./index-DixJ0kqk.js");return{uiController:a}},[]),d=await l.execute({sessionId:r.sessionId,action:s.action,target:s.target,value:s.value});await this.sendJsonRpcResult(t,{status:"success",output:d})}else if(i==="ui-query"){const{uiController:l}=await Hr(async()=>{const{uiController:a}=await import("./index-DixJ0kqk.js");return{uiController:a}},[]),d=await l.queryElements({selector:s==null?void 0:s.selector,role:s==null?void 0:s.role,includeHidden:s==null?void 0:s.includeHidden,limit:s==null?void 0:s.limit});await this.sendJsonRpcResult(t,{status:"success",output:d})}else await this.sendJsonRpcResult(t,{status:"error",error:{message:`Unknown delegate tool: ${i}`}})}catch(l){await this.sendJsonRpcResult(t,{status:"error",error:{message:l instanceof Error?l.message:String(l)}})}}emit(t,r){const i=this.listeners.get(t);if(i)for(const s of i)try{s(r)}catch(l){console.error(`Event handler error for ${t}:`,l)}}setStatus(t){this._status=t,this.emit("status_change",t)}}const wh=Object.freeze(Object.defineProperty({__proto__:null,AcpClient:mi,fetchWithRetry:ye},Symbol.toStringTag,{value:"Module"})),uu="codebuddy.auth.token";function qt(){try{return sessionStorage.getItem(uu)}catch{return null}}function pu(e){try{sessionStorage.setItem(uu,e)}catch{}}function ue(e){const t={...e},r=qt();return r&&(t.Authorization=`Bearer ${r}`),t}const hu=$e(e=>({viewState:"loading",error:null,isSubmitting:!1,checkAuth:async()=>{try{e({viewState:"loading",error:null});const t=await ye("/api/v1/auth/status",{headers:ue()});if(!t.ok){e({viewState:"authenticated"});return}const r=await t.json();!r.authEnabled||r.authenticated?e({viewState:"authenticated"}):e({viewState:"login"})}catch(t){console.warn("[auth] Failed to check auth status, falling back to authenticated:",t),e({viewState:"authenticated"})}},login:async t=>{try{e({isSubmitting:!0,error:null});const i=await(await fetch("/api/v1/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:t})})).json();if(i.success){const s=i.token||t;return pu(s),e({viewState:"authenticated",isSubmitting:!1,error:null}),!0}return e({error:i.error||"login.error.incorrect",isSubmitting:!1}),!1}catch(r){return console.warn("[auth] Login request failed:",r),e({error:"app.connectFailed",isSubmitting:!1}),!1}},clearError:()=>e({error:null})})),ar=$e((e,t)=>({fileChanges:[],selectedFile:null,selectedDiff:null,diffLoading:!1,isCollapsed:!0,checkpoints:[],showCheckpoints:!1,reverting:!1,onCheckpoint:r=>{const{fileChanges:i}=t(),s=new Map;for(const l of i)s.set(l.uri,l);for(const l of r.fileChanges.files)s.set(l.uri,l);e({fileChanges:Array.from(s.values())})},selectFile:async r=>{const{selectedFile:i}=t();if(i===r){e({selectedFile:null,selectedDiff:null});return}e({selectedFile:r,selectedDiff:null,diffLoading:!0});try{const s=await ye(`/api/v1/file-changes/diff?path=${encodeURIComponent(r)}`,{headers:ue()});s.ok?e({selectedDiff:await s.json(),diffLoading:!1}):e({diffLoading:!1})}catch{e({diffLoading:!1})}},setCollapsed:r=>e({isCollapsed:r}),setShowCheckpoints:r=>e({showCheckpoints:r}),loadCheckpoints:async()=>{try{const r=await ye("/api/v1/file-changes/checkpoints",{headers:ue()});if(r.ok){const s=((await r.json()).checkpoints||[]).sort((l,d)=>d.createdAt-l.createdAt);e({checkpoints:s})}}catch{}},revertFiles:async r=>{e({reverting:!0});try{const i=await ye("/api/v1/file-changes/revert",{method:"POST",headers:{...ue(),"Content-Type":"application/json"},body:JSON.stringify({paths:r})});if(i.ok){const s=await i.json(),l=new Set(s.revertedFiles||[]);e(d=>({fileChanges:d.fileChanges.filter(a=>!l.has(a.uri)),selectedFile:l.has(d.selectedFile||"")?null:d.selectedFile,selectedDiff:l.has(d.selectedFile||"")?null:d.selectedDiff}))}}finally{e({reverting:!1})}},revertAll:async()=>{e({reverting:!0});try{(await ye("/api/v1/file-changes/revert",{method:"POST",headers:{...ue(),"Content-Type":"application/json"},body:JSON.stringify({})})).ok&&e({fileChanges:[],selectedFile:null,selectedDiff:null})}finally{e({reverting:!1})}},revertToCheckpoint:async(r,i="CodeAndConversation")=>{e({reverting:!0});try{if((await ye("/api/v1/file-changes/revert",{method:"POST",headers:{...ue(),"Content-Type":"application/json"},body:JSON.stringify({checkpointId:r,scope:i})})).ok){if((i==="Code"||i==="CodeAndConversation")&&e({fileChanges:[],selectedFile:null,selectedDiff:null}),i==="Conversation"||i==="CodeAndConversation")try{const{useChatStore:l}=await Hr(async()=>{const{useChatStore:o}=await Promise.resolve().then(()=>vh);return{useChatStore:o}},void 0);l.getState().clearChat();const d=Ne(),a=sessionStorage.getItem("acp-session-id");d&&a&&await d.loadSession(a)}catch(l){console.error("Failed to reload session after revert:",l)}t().loadCheckpoints()}}finally{e({reverting:!1})}},reset:()=>e({fileChanges:[],selectedFile:null,selectedDiff:null,diffLoading:!1,isCollapsed:!0,checkpoints:[],showCheckpoints:!1,reverting:!1})})),He=$e(e=>({isInTeam:!1,teamName:null,isAutoTeam:!1,members:[],focusedMemberName:null,memberHistories:{},setTeamStatus:t=>e({isInTeam:t.isInTeam,teamName:t.teamName||null,isAutoTeam:t.isAutoTeam||!1,members:t.members}),updateMembers:t=>e({members:t}),setFocusedMember:t=>e({focusedMemberName:t}),setMemberHistory:(t,r)=>e(i=>({memberHistories:{...i.memberHistories,[t]:r}})),clearTeam:()=>e({isInTeam:!1,teamName:null,isAutoTeam:!1,members:[],focusedMemberName:null,memberHistories:{}})})),mu=$e(e=>({userInfo:null,loading:!1,error:null,fetchUserInfo:async t=>{e({loading:!0,error:null});try{const r=await t.getUserInfo();r.userInfo?e({userInfo:r.userInfo,loading:!1}):e({loading:!1})}catch(r){console.warn("[user] Failed to fetch user info:",r),e({error:r.message,loading:!1})}},clearUserInfo:()=>{e({userInfo:null,error:null})}}));function Wc(e,t){const r=e.options||e.answers;let i=[];return Array.isArray(r)&&(i=r.map(s=>typeof s=="object"&&s!==null&&"label"in s?{label:String(s.label||""),description:String(s.description||"")}:{label:String(s||""),description:""}).filter(s=>s.label.trim().length>0)),{id:e.id||`q_${t}`,question:e.question||"",header:e.header||"",options:i,multiSelect:!!e.multiSelect}}const Eh={preparing:"preparing",model_requesting:"waiting for model",model_streaming:"streaming",model_done:"processing",tool_executing:"running tool",idle:null};function Ch(e){return e.phase==="tool_executing"&&e.toolName?`running ${e.toolName}`:e.phase==="model_streaming"&&e.streamingToolName?`writing ${e.streamingToolName}`:Eh[e.phase]??null}let Et=null;function Ne(){return Et||(Et=new mi),Et}function Th(){const e=C.useRef(Ne()),[t,r]=C.useState(0),{sessionId:i,setStatus:s,setSessionId:l,setModels:d,setCurrentModel:a,setModes:o,setCurrentMode:c,setCommands:p,setTopic:g,setThinkingEnabled:b,setPromptSuggestion:_}=rt(),{addChunk:w,addThinkingChunk:v,addToolCall:h,updateToolCall:m,addInterruption:u,addQuestion:f,setSessionEnd:x,resolveInterruptionByToolCallId:E,resolveQuestionByToolCallId:y,setHistoryLoading:S,addHistoryUserMessage:k,finalizeAssistantMessage:T,clearChat:R,setAgentPhaseLabel:A}=Ze();C.useEffect(()=>{const B=e.current,P=[],H=(U,F)=>{if(!F)return!1;try{const O=(F._meta||{})["codebuddy.ai/memberEvent"];if(!O)return!1;const $=He.getState(),I=$.memberHistories[O]||[];return $.setMemberHistory(O,[...I,{sessionUpdate:U,...F}]),!0}catch{return!1}};return P.push(B.on("user_message_chunk",U=>{if(H("user_message_chunk",U))return;const F=U.content,N=U._meta||{},O=!!N["codebuddy.ai/isCompactInternal"];let $;const I=N["codebuddy.ai/images"];Array.isArray(I)&&I.length>0&&($=I.filter(Y=>Y.blobPath&&Y.mimeType).map(Y=>({url:`/api/v1/files/download?path=${encodeURIComponent(Y.blobPath)}`,mimeType:Y.mimeType})),$.length===0&&($=void 0));let q;const W=N["codebuddy.ai/channelSource"];W&&(q={source:W,sender:N["codebuddy.ai/channelSender"]||"",senderName:N["codebuddy.ai/channelSenderName"],chatId:N["codebuddy.ai/channelChatId"],chatType:N["codebuddy.ai/channelChatType"]}),F&&typeof F.text=="string"&&k(F.text,$,O,q)})),P.push(B.on("agent_message_chunk",U=>{if(H("agent_message_chunk",U))return;const F=U.content,N=U._meta||{},O=N["codebuddy.ai/parentToolCallId"],$=!!N["codebuddy.ai/isCompactInternal"];typeof F=="string"?w(F,O,$):F&&F.type==="thinking"&&typeof F.text=="string"?v(F.text,O):F&&typeof F.text=="string"&&w(F.text,O,$)})),P.push(B.on("tool_call",U=>{if(H("tool_call",U))return;const F=U._meta||{},N=F["codebuddy.ai/parentToolCallId"],O=!!F["codebuddy.ai/isSubagent"],$=U.toolName||F["codebuddy.ai/toolName"]||"",I=F["codebuddy.ai/planContent"];h({id:U.toolCallId,name:U.title||$||U.kind||"tool",kind:U.kind||"other",toolName:$,input:U.rawInput||U.input,status:"running",locations:U.locations,content:U.content,parentToolCallId:N,subagent:O?{type:F["codebuddy.ai/subagentType"]||"general-purpose",description:F["codebuddy.ai/description"]||"",isBackground:!!F["codebuddy.ai/isBackground"],memberName:F["codebuddy.ai/memberName"]||void 0}:void 0,planContent:I})})),P.push(B.on("tool_call_update",U=>{if(H("tool_call_update",U))return;const N={status:U.status==="completed"?"completed":U.status==="failed"?"failed":U.toolStatus==="completed"?"completed":U.toolStatus==="failed"?"failed":"running",result:U.rawOutput||U.toolResult};U.content!==void 0&&(N.content=U.content),m(U.toolCallId,N)})),P.push(B.on("interruption_request",U=>{var F;if(U.toolName==="AskUserQuestion"){const N=Array.isArray((F=U.toolInput)==null?void 0:F.questions)?U.toolInput.questions:[];f({id:U.toolCallId,toolCallId:U.toolCallId,sessionId:U.sessionId||i||"",source:"interruption",questions:N.map(Wc)});return}u({id:U.interruptionId,sessionId:U.sessionId,reason:U.reason,options:U.options,toolName:U.toolName,toolTitle:U.toolTitle,toolInput:U.toolInput,toolCallId:U.toolCallId})})),P.push(B.on("question_request",U=>{const F=Array.isArray(U.questions)?U.questions:[];f({id:U.toolCallId,toolCallId:U.toolCallId,sessionId:U.sessionId,source:"extMethod",questions:F.map(Wc)})})),P.push(B.on("session_end",U=>{x(U.stopReason,U.errorMessage)})),P.push(B.on("session_info_update",U=>{U.title&&g(U.title);const F=U._meta||{};if(F["codebuddy.ai/historyReplay"]==="start"?S(!0):F["codebuddy.ai/historyReplay"]==="end"&&(S(!1),T()),F["codebuddy.ai/agentPhase"]){const O=F["codebuddy.ai/agentPhase"];A(Ch(O))}if(F["codebuddy.ai/sessionReset"]){const O=F["codebuddy.ai/newSessionId"];if(O){if(R(),g(null),_(null),l(O),typeof sessionStorage<"u"&&sessionStorage.setItem("acp-session-id",O),typeof window<"u"&&window.history&&window.location){const $=new URL(window.location.href);$.searchParams.get("sessionId")!==O&&($.searchParams.set("sessionId",O),window.history.replaceState({},"",$.toString()))}B.loadSession(O).then(D).catch($=>console.error("Failed to load new session after reset:",$))}}if(F["codebuddy.ai/permissionResolved"]){const O=F["codebuddy.ai/toolCallId"],$=F["codebuddy.ai/decision"];O&&$&&(Ne().clearPermissionRequestByToolCallId(O),E(O,$),y(O))}if("codebuddy.ai/promptSuggestion"in F){const O=F["codebuddy.ai/promptSuggestion"];_(O||null)}const N=F["codebuddy.ai/teamUpdate"];if(N)switch(N.type){case"member_status_change":N.members&&(N.teamName?He.getState().setTeamStatus({isInTeam:!0,teamName:N.teamName,isAutoTeam:N.isAutoTeam,members:N.members}):He.getState().updateMembers(N.members));break;case"team_created":He.getState().setTeamStatus({isInTeam:!0,teamName:N.teamName,members:[]});break;case"team_deleted":He.getState().clearTeam();break}})),P.push(B.on("model_update",U=>{d(U.availableModels||[]),a(U.currentModelId||"")})),P.push(B.on("mode_update",U=>{U.availableModes&&o(U.availableModes),U.currentModeId&&c(U.currentModeId)})),P.push(B.on("current_mode_update",U=>{U.currentModeId&&c(U.currentModeId)})),P.push(B.on("config_option_update",U=>{const F=U.configOptions||[];for(const N of F)N.id==="thought_level"?b(N.currentValue==="enabled"):N.id==="mode"&&N.currentValue?c(N.currentValue):N.id==="model"&&N.currentValue&&(a(N.currentValue),N.options&&d(N.options.map(O=>({id:O.value,name:O.name||O.value}))))})),P.push(B.on("status_change",U=>{s(U)})),P.push(B.on("available_commands_update",U=>{U.availableCommands&&p(U.availableCommands.map(F=>{var N;return{name:F.name,description:F.description||"",...((N=F._meta)==null?void 0:N.type)==="skill"?{type:"skill"}:{}}}))})),P.push(B.on("checkpointCreated",U=>{ar.getState().onCheckpoint(U)})),P.push(B.on("checkpointUpdated",U=>{ar.getState().onCheckpoint(U)})),P.push(B.on("checkpointReverted",()=>{ar.getState().reset()})),()=>{P.forEach(U=>U())}},[t,i,w,v,h,m,u,f,x,E,y,d,a,o,c,p,g,b,s,S,k,T,R,l,_]);const D=C.useCallback(B=>{if(B.models&&(d(B.models.availableModels.map(P=>({id:P.modelId,name:P.name}))),a(B.models.currentModelId)),B.modes&&(o(B.modes.availableModes),c(B.modes.currentModeId)),B.configOptions)for(const P of B.configOptions)P.id==="thought_level"&&b(P.currentValue==="enabled")},[d,a,o,c,b]),L=C.useCallback(async B=>{const P=typeof B=="string"?B:B==null?void 0:B.token,H=typeof B=="object"?B==null?void 0:B.continue:!1;if(P){if(Et)try{await Et.disconnect()}catch{}Et=new mi(void 0,P),e.current=Et,r(U=>U+1)}try{s("connecting"),_(null);const U=await e.current.initializeSession({continue:H});l(U.sessionId),D(U),s("connected"),mu.getState().fetchUserInfo(e.current)}catch(U){console.error("Connection failed:",U),s("error")}},[s,l,D,_]);return{client:e.current,connect:L}}const gu="/assets/dark-claw-cat-D_ew_BKV.png",fu="/assets/light-claw-cat-BgBWmnmi.png",bu="/assets/red-claw-cat--t2EuBIB.png",yu={small:{container:"w-20 h-20",text:"text-[12px]"},medium:{container:"w-32 h-32",text:"text-[14px]"},large:{container:"w-40 h-40",text:"text-[16px]"}};function _u({size:e="medium",className:t=""}){const i=Xe(l=>l.resolved)==="dark"?gu:fu,s=yu[e];return n.jsxs("div",{className:`relative ${s.container} ${t}`,children:[n.jsx("img",{src:i,alt:"",className:"cat-loading-layer cat-loading-layer-base absolute inset-0 w-full h-full object-contain",decoding:"async",loading:"eager"}),n.jsx("img",{src:bu,alt:"",className:"cat-loading-layer cat-loading-layer-color absolute inset-0 w-full h-full object-contain",decoding:"async",loading:"eager"})]})}function nt({size:e="medium",text:t="Loading...",className:r=""}){const i=yu[e];return n.jsxs("div",{className:`flex flex-col items-center justify-center gap-4 ${r}`,children:[n.jsx(_u,{size:e}),t&&n.jsx("div",{className:`text-text-secondary ${i.text} font-medium animate-pulse`,children:t})]})}function Nh({size:e="medium",className:t=""}){return n.jsx(_u,{size:e,className:t})}/**
|
|
9
|
-
* @license lucide-react v1.
|
|
9
|
+
* @license lucide-react v1.8.0 - ISC
|
|
10
10
|
*
|
|
11
11
|
* This source code is licensed under the ISC license.
|
|
12
12
|
* See the LICENSE file in the root directory of this source tree.
|
|
13
13
|
*/const xu=(...e)=>e.filter((t,r,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===r).join(" ").trim();/**
|
|
14
|
-
* @license lucide-react v1.
|
|
14
|
+
* @license lucide-react v1.8.0 - ISC
|
|
15
15
|
*
|
|
16
16
|
* This source code is licensed under the ISC license.
|
|
17
17
|
* See the LICENSE file in the root directory of this source tree.
|
|
18
18
|
*/const Ah=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
19
|
-
* @license lucide-react v1.
|
|
19
|
+
* @license lucide-react v1.8.0 - ISC
|
|
20
20
|
*
|
|
21
21
|
* This source code is licensed under the ISC license.
|
|
22
22
|
* See the LICENSE file in the root directory of this source tree.
|
|
23
23
|
*/const Rh=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,i)=>i?i.toUpperCase():r.toLowerCase());/**
|
|
24
|
-
* @license lucide-react v1.
|
|
24
|
+
* @license lucide-react v1.8.0 - ISC
|
|
25
25
|
*
|
|
26
26
|
* This source code is licensed under the ISC license.
|
|
27
27
|
* See the LICENSE file in the root directory of this source tree.
|
|
28
28
|
*/const qc=e=>{const t=Rh(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
29
|
-
* @license lucide-react v1.
|
|
29
|
+
* @license lucide-react v1.8.0 - ISC
|
|
30
30
|
*
|
|
31
31
|
* This source code is licensed under the ISC license.
|
|
32
32
|
* See the LICENSE file in the root directory of this source tree.
|
|
33
33
|
*/var Sn={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
34
|
-
* @license lucide-react v1.
|
|
34
|
+
* @license lucide-react v1.8.0 - ISC
|
|
35
35
|
*
|
|
36
36
|
* This source code is licensed under the ISC license.
|
|
37
37
|
* See the LICENSE file in the root directory of this source tree.
|
|
38
38
|
*/const Ih=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},Lh=C.createContext({}),Oh=()=>C.useContext(Lh),$h=C.forwardRef(({color:e,size:t,strokeWidth:r,absoluteStrokeWidth:i,className:s="",children:l,iconNode:d,...a},o)=>{const{size:c=24,strokeWidth:p=2,absoluteStrokeWidth:g=!1,color:b="currentColor",className:_=""}=Oh()??{},w=i??g?Number(r??p)*24/Number(t??c):r??p;return C.createElement("svg",{ref:o,...Sn,width:t??c??Sn.width,height:t??c??Sn.height,stroke:e??b,strokeWidth:w,className:xu("lucide",_,s),...!l&&!Ih(a)&&{"aria-hidden":"true"},...a},[...d.map(([v,h])=>C.createElement(v,h)),...Array.isArray(l)?l:[l]])});/**
|
|
39
|
-
* @license lucide-react v1.
|
|
39
|
+
* @license lucide-react v1.8.0 - ISC
|
|
40
40
|
*
|
|
41
41
|
* This source code is licensed under the ISC license.
|
|
42
42
|
* See the LICENSE file in the root directory of this source tree.
|
|
43
43
|
*/const Z=(e,t)=>{const r=C.forwardRef(({className:i,...s},l)=>C.createElement($h,{ref:l,iconNode:t,className:xu(`lucide-${Ah(qc(e))}`,`lucide-${e}`,i),...s}));return r.displayName=qc(e),r};/**
|
|
44
|
-
* @license lucide-react v1.
|
|
44
|
+
* @license lucide-react v1.8.0 - ISC
|
|
45
45
|
*
|
|
46
46
|
* This source code is licensed under the ISC license.
|
|
47
47
|
* See the LICENSE file in the root directory of this source tree.
|
|
48
48
|
*/const Dh=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],gi=Z("activity",Dh);/**
|
|
49
|
-
* @license lucide-react v1.
|
|
49
|
+
* @license lucide-react v1.8.0 - ISC
|
|
50
50
|
*
|
|
51
51
|
* This source code is licensed under the ISC license.
|
|
52
52
|
* See the LICENSE file in the root directory of this source tree.
|
|
53
53
|
*/const Mh=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],gr=Z("arrow-left",Mh);/**
|
|
54
|
-
* @license lucide-react v1.
|
|
54
|
+
* @license lucide-react v1.8.0 - ISC
|
|
55
55
|
*
|
|
56
56
|
* This source code is licensed under the ISC license.
|
|
57
57
|
* See the LICENSE file in the root directory of this source tree.
|
|
58
58
|
*/const jh=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Ph=Z("arrow-right",jh);/**
|
|
59
|
-
* @license lucide-react v1.
|
|
59
|
+
* @license lucide-react v1.8.0 - ISC
|
|
60
60
|
*
|
|
61
61
|
* This source code is licensed under the ISC license.
|
|
62
62
|
* See the LICENSE file in the root directory of this source tree.
|
|
63
63
|
*/const Fh=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Hn=Z("arrow-up",Fh);/**
|
|
64
|
-
* @license lucide-react v1.
|
|
64
|
+
* @license lucide-react v1.8.0 - ISC
|
|
65
65
|
*
|
|
66
66
|
* This source code is licensed under the ISC license.
|
|
67
67
|
* See the LICENSE file in the root directory of this source tree.
|
|
68
68
|
*/const Bh=[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]],Ct=Z("blocks",Bh);/**
|
|
69
|
-
* @license lucide-react v1.
|
|
69
|
+
* @license lucide-react v1.8.0 - ISC
|
|
70
70
|
*
|
|
71
71
|
* This source code is licensed under the ISC license.
|
|
72
72
|
* See the LICENSE file in the root directory of this source tree.
|
|
73
73
|
*/const Uh=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],fi=Z("book-open",Uh);/**
|
|
74
|
-
* @license lucide-react v1.
|
|
74
|
+
* @license lucide-react v1.8.0 - ISC
|
|
75
75
|
*
|
|
76
76
|
* This source code is licensed under the ISC license.
|
|
77
77
|
* See the LICENSE file in the root directory of this source tree.
|
|
78
78
|
*/const zh=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Gn=Z("bot",zh);/**
|
|
79
|
-
* @license lucide-react v1.
|
|
79
|
+
* @license lucide-react v1.8.0 - ISC
|
|
80
80
|
*
|
|
81
81
|
* This source code is licensed under the ISC license.
|
|
82
82
|
* See the LICENSE file in the root directory of this source tree.
|
|
83
83
|
*/const Hh=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Tt=Z("check",Hh);/**
|
|
84
|
-
* @license lucide-react v1.
|
|
84
|
+
* @license lucide-react v1.8.0 - ISC
|
|
85
85
|
*
|
|
86
86
|
* This source code is licensed under the ISC license.
|
|
87
87
|
* See the LICENSE file in the root directory of this source tree.
|
|
88
88
|
*/const Gh=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],it=Z("chevron-down",Gh);/**
|
|
89
|
-
* @license lucide-react v1.
|
|
89
|
+
* @license lucide-react v1.8.0 - ISC
|
|
90
90
|
*
|
|
91
91
|
* This source code is licensed under the ISC license.
|
|
92
92
|
* See the LICENSE file in the root directory of this source tree.
|
|
93
93
|
*/const Wh=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],qh=Z("chevron-left",Wh);/**
|
|
94
|
-
* @license lucide-react v1.
|
|
94
|
+
* @license lucide-react v1.8.0 - ISC
|
|
95
95
|
*
|
|
96
96
|
* This source code is licensed under the ISC license.
|
|
97
97
|
* See the LICENSE file in the root directory of this source tree.
|
|
98
98
|
*/const Vh=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Oe=Z("chevron-right",Vh);/**
|
|
99
|
-
* @license lucide-react v1.
|
|
99
|
+
* @license lucide-react v1.8.0 - ISC
|
|
100
100
|
*
|
|
101
101
|
* This source code is licensed under the ISC license.
|
|
102
102
|
* See the LICENSE file in the root directory of this source tree.
|
|
103
103
|
*/const Kh=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Yh=Z("circle-alert",Kh);/**
|
|
104
|
-
* @license lucide-react v1.
|
|
104
|
+
* @license lucide-react v1.8.0 - ISC
|
|
105
105
|
*
|
|
106
106
|
* This source code is licensed under the ISC license.
|
|
107
107
|
* See the LICENSE file in the root directory of this source tree.
|
|
108
108
|
*/const Xh=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Zh=Z("circle-check-big",Xh);/**
|
|
109
|
-
* @license lucide-react v1.
|
|
109
|
+
* @license lucide-react v1.8.0 - ISC
|
|
110
110
|
*
|
|
111
111
|
* This source code is licensed under the ISC license.
|
|
112
112
|
* See the LICENSE file in the root directory of this source tree.
|
|
113
113
|
*/const Jh=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],vu=Z("circle-check",Jh);/**
|
|
114
|
-
* @license lucide-react v1.
|
|
114
|
+
* @license lucide-react v1.8.0 - ISC
|
|
115
115
|
*
|
|
116
116
|
* This source code is licensed under the ISC license.
|
|
117
117
|
* See the LICENSE file in the root directory of this source tree.
|
|
118
118
|
*/const Qh=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],em=Z("circle-question-mark",Qh);/**
|
|
119
|
-
* @license lucide-react v1.
|
|
119
|
+
* @license lucide-react v1.8.0 - ISC
|
|
120
120
|
*
|
|
121
121
|
* This source code is licensed under the ISC license.
|
|
122
122
|
* See the LICENSE file in the root directory of this source tree.
|
|
123
123
|
*/const tm=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Gr=Z("circle-x",tm);/**
|
|
124
|
-
* @license lucide-react v1.
|
|
124
|
+
* @license lucide-react v1.8.0 - ISC
|
|
125
125
|
*
|
|
126
126
|
* This source code is licensed under the ISC license.
|
|
127
127
|
* See the LICENSE file in the root directory of this source tree.
|
|
128
128
|
*/const rm=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],nm=Z("circle",rm);/**
|
|
129
|
-
* @license lucide-react v1.
|
|
129
|
+
* @license lucide-react v1.8.0 - ISC
|
|
130
130
|
*
|
|
131
131
|
* This source code is licensed under the ISC license.
|
|
132
132
|
* See the LICENSE file in the root directory of this source tree.
|
|
133
133
|
*/const im=[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v.832",key:"1ujtp2"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h2",key:"qvpao1"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}],["rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",key:"ublpy"}]],bi=Z("clipboard-clock",im);/**
|
|
134
|
-
* @license lucide-react v1.
|
|
134
|
+
* @license lucide-react v1.8.0 - ISC
|
|
135
135
|
*
|
|
136
136
|
* This source code is licensed under the ISC license.
|
|
137
137
|
* See the LICENSE file in the root directory of this source tree.
|
|
138
138
|
*/const sm=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],am=Z("clipboard-list",sm);/**
|
|
139
|
-
* @license lucide-react v1.
|
|
139
|
+
* @license lucide-react v1.8.0 - ISC
|
|
140
140
|
*
|
|
141
141
|
* This source code is licensed under the ISC license.
|
|
142
142
|
* See the LICENSE file in the root directory of this source tree.
|
|
143
143
|
*/const om=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],pr=Z("clock",om);/**
|
|
144
|
-
* @license lucide-react v1.
|
|
144
|
+
* @license lucide-react v1.8.0 - ISC
|
|
145
145
|
*
|
|
146
146
|
* This source code is licensed under the ISC license.
|
|
147
147
|
* See the LICENSE file in the root directory of this source tree.
|
|
148
148
|
*/const lm=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],Su=Z("code",lm);/**
|
|
149
|
-
* @license lucide-react v1.
|
|
149
|
+
* @license lucide-react v1.8.0 - ISC
|
|
150
150
|
*
|
|
151
151
|
* This source code is licensed under the ISC license.
|
|
152
152
|
* See the LICENSE file in the root directory of this source tree.
|
|
153
153
|
*/const cm=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],Vc=Z("columns-2",cm);/**
|
|
154
|
-
* @license lucide-react v1.
|
|
154
|
+
* @license lucide-react v1.8.0 - ISC
|
|
155
155
|
*
|
|
156
156
|
* This source code is licensed under the ISC license.
|
|
157
157
|
* See the LICENSE file in the root directory of this source tree.
|
|
158
158
|
*/const dm=[["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],um=Z("copy-minus",dm);/**
|
|
159
|
-
* @license lucide-react v1.
|
|
159
|
+
* @license lucide-react v1.8.0 - ISC
|
|
160
160
|
*
|
|
161
161
|
* This source code is licensed under the ISC license.
|
|
162
162
|
* See the LICENSE file in the root directory of this source tree.
|
|
163
163
|
*/const pm=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Wn=Z("copy",pm);/**
|
|
164
|
-
* @license lucide-react v1.
|
|
164
|
+
* @license lucide-react v1.8.0 - ISC
|
|
165
165
|
*
|
|
166
166
|
* This source code is licensed under the ISC license.
|
|
167
167
|
* See the LICENSE file in the root directory of this source tree.
|
|
168
168
|
*/const hm=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],Kc=Z("corner-down-left",hm);/**
|
|
169
|
-
* @license lucide-react v1.
|
|
169
|
+
* @license lucide-react v1.8.0 - ISC
|
|
170
170
|
*
|
|
171
171
|
* This source code is licensed under the ISC license.
|
|
172
172
|
* See the LICENSE file in the root directory of this source tree.
|
|
173
173
|
*/const mm=[["path",{d:"m15 10 5 5-5 5",key:"qqa56n"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]],gm=Z("corner-down-right",mm);/**
|
|
174
|
-
* @license lucide-react v1.
|
|
174
|
+
* @license lucide-react v1.8.0 - ISC
|
|
175
175
|
*
|
|
176
176
|
* This source code is licensed under the ISC license.
|
|
177
177
|
* See the LICENSE file in the root directory of this source tree.
|
|
178
178
|
*/const fm=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],Rt=Z("cpu",fm);/**
|
|
179
|
-
* @license lucide-react v1.
|
|
179
|
+
* @license lucide-react v1.8.0 - ISC
|
|
180
180
|
*
|
|
181
181
|
* This source code is licensed under the ISC license.
|
|
182
182
|
* See the LICENSE file in the root directory of this source tree.
|
|
183
183
|
*/const bm=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],ku=Z("download",bm);/**
|
|
184
|
-
* @license lucide-react v1.
|
|
184
|
+
* @license lucide-react v1.8.0 - ISC
|
|
185
185
|
*
|
|
186
186
|
* This source code is licensed under the ISC license.
|
|
187
187
|
* See the LICENSE file in the root directory of this source tree.
|
|
188
188
|
*/const ym=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],ct=Z("external-link",ym);/**
|
|
189
|
-
* @license lucide-react v1.
|
|
189
|
+
* @license lucide-react v1.8.0 - ISC
|
|
190
190
|
*
|
|
191
191
|
* This source code is licensed under the ISC license.
|
|
192
192
|
* See the LICENSE file in the root directory of this source tree.
|
|
193
193
|
*/const _m=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],xm=Z("file-code",_m);/**
|
|
194
|
-
* @license lucide-react v1.
|
|
194
|
+
* @license lucide-react v1.8.0 - ISC
|
|
195
195
|
*
|
|
196
196
|
* This source code is licensed under the ISC license.
|
|
197
197
|
* See the LICENSE file in the root directory of this source tree.
|
|
198
198
|
*/const vm=[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]],wu=Z("file-pen",vm);/**
|
|
199
|
-
* @license lucide-react v1.
|
|
199
|
+
* @license lucide-react v1.8.0 - ISC
|
|
200
200
|
*
|
|
201
201
|
* This source code is licensed under the ISC license.
|
|
202
202
|
* See the LICENSE file in the root directory of this source tree.
|
|
203
203
|
*/const Sm=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]],km=Z("file-plus",Sm);/**
|
|
204
|
-
* @license lucide-react v1.
|
|
204
|
+
* @license lucide-react v1.8.0 - ISC
|
|
205
205
|
*
|
|
206
206
|
* This source code is licensed under the ISC license.
|
|
207
207
|
* See the LICENSE file in the root directory of this source tree.
|
|
208
208
|
*/const wm=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],st=Z("file-text",wm);/**
|
|
209
|
-
* @license lucide-react v1.
|
|
209
|
+
* @license lucide-react v1.8.0 - ISC
|
|
210
210
|
*
|
|
211
211
|
* This source code is licensed under the ISC license.
|
|
212
212
|
* See the LICENSE file in the root directory of this source tree.
|
|
213
213
|
*/const Em=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],Eu=Z("file",Em);/**
|
|
214
|
-
* @license lucide-react v1.
|
|
214
|
+
* @license lucide-react v1.8.0 - ISC
|
|
215
215
|
*
|
|
216
216
|
* This source code is licensed under the ISC license.
|
|
217
217
|
* See the LICENSE file in the root directory of this source tree.
|
|
218
218
|
*/const Cm=[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]],Cu=Z("files",Cm);/**
|
|
219
|
-
* @license lucide-react v1.
|
|
219
|
+
* @license lucide-react v1.8.0 - ISC
|
|
220
220
|
*
|
|
221
221
|
* This source code is licensed under the ISC license.
|
|
222
222
|
* See the LICENSE file in the root directory of this source tree.
|
|
223
223
|
*/const Tm=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M2 10h20",key:"1ir3d8"}]],Nm=Z("folder-closed",Tm);/**
|
|
224
|
-
* @license lucide-react v1.
|
|
224
|
+
* @license lucide-react v1.8.0 - ISC
|
|
225
225
|
*
|
|
226
226
|
* This source code is licensed under the ISC license.
|
|
227
227
|
* See the LICENSE file in the root directory of this source tree.
|
|
228
228
|
*/const Am=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],yi=Z("folder-open",Am);/**
|
|
229
|
-
* @license lucide-react v1.
|
|
229
|
+
* @license lucide-react v1.8.0 - ISC
|
|
230
230
|
*
|
|
231
231
|
* This source code is licensed under the ISC license.
|
|
232
232
|
* See the LICENSE file in the root directory of this source tree.
|
|
233
233
|
*/const Rm=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Im=Z("folder-plus",Rm);/**
|
|
234
|
-
* @license lucide-react v1.
|
|
234
|
+
* @license lucide-react v1.8.0 - ISC
|
|
235
235
|
*
|
|
236
236
|
* This source code is licensed under the ISC license.
|
|
237
237
|
* See the LICENSE file in the root directory of this source tree.
|
|
238
238
|
*/const Lm=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Om=Z("folder",Lm);/**
|
|
239
|
-
* @license lucide-react v1.
|
|
239
|
+
* @license lucide-react v1.8.0 - ISC
|
|
240
240
|
*
|
|
241
241
|
* This source code is licensed under the ISC license.
|
|
242
242
|
* See the LICENSE file in the root directory of this source tree.
|
|
243
243
|
*/const $m=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],Dm=Z("git-branch",$m);/**
|
|
244
|
-
* @license lucide-react v1.
|
|
244
|
+
* @license lucide-react v1.8.0 - ISC
|
|
245
245
|
*
|
|
246
246
|
* This source code is licensed under the ISC license.
|
|
247
247
|
* See the LICENSE file in the root directory of this source tree.
|
|
248
248
|
*/const Mm=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]],rn=Z("git-compare",Mm);/**
|
|
249
|
-
* @license lucide-react v1.
|
|
249
|
+
* @license lucide-react v1.8.0 - ISC
|
|
250
250
|
*
|
|
251
251
|
* This source code is licensed under the ISC license.
|
|
252
252
|
* See the LICENSE file in the root directory of this source tree.
|
|
253
253
|
*/const jm=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Tu=Z("globe",jm);/**
|
|
254
|
-
* @license lucide-react v1.
|
|
254
|
+
* @license lucide-react v1.8.0 - ISC
|
|
255
255
|
*
|
|
256
256
|
* This source code is licensed under the ISC license.
|
|
257
257
|
* See the LICENSE file in the root directory of this source tree.
|
|
258
258
|
*/const Pm=[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]],Fm=Z("hard-drive",Pm);/**
|
|
259
|
-
* @license lucide-react v1.
|
|
259
|
+
* @license lucide-react v1.8.0 - ISC
|
|
260
260
|
*
|
|
261
261
|
* This source code is licensed under the ISC license.
|
|
262
262
|
* See the LICENSE file in the root directory of this source tree.
|
|
263
263
|
*/const Bm=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],Um=Z("hash",Bm);/**
|
|
264
|
-
* @license lucide-react v1.
|
|
264
|
+
* @license lucide-react v1.8.0 - ISC
|
|
265
265
|
*
|
|
266
266
|
* This source code is licensed under the ISC license.
|
|
267
267
|
* See the LICENSE file in the root directory of this source tree.
|
|
268
268
|
*/const zm=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],Nu=Z("history",zm);/**
|
|
269
|
-
* @license lucide-react v1.
|
|
269
|
+
* @license lucide-react v1.8.0 - ISC
|
|
270
270
|
*
|
|
271
271
|
* This source code is licensed under the ISC license.
|
|
272
272
|
* See the LICENSE file in the root directory of this source tree.
|
|
273
273
|
*/const Hm=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],Au=Z("image",Hm);/**
|
|
274
|
-
* @license lucide-react v1.
|
|
274
|
+
* @license lucide-react v1.8.0 - ISC
|
|
275
275
|
*
|
|
276
276
|
* This source code is licensed under the ISC license.
|
|
277
277
|
* See the LICENSE file in the root directory of this source tree.
|
|
278
278
|
*/const Gm=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],Wm=Z("inbox",Gm);/**
|
|
279
|
-
* @license lucide-react v1.
|
|
279
|
+
* @license lucide-react v1.8.0 - ISC
|
|
280
280
|
*
|
|
281
281
|
* This source code is licensed under the ISC license.
|
|
282
282
|
* See the LICENSE file in the root directory of this source tree.
|
|
283
283
|
*/const qm=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Vm=Z("info",qm);/**
|
|
284
|
-
* @license lucide-react v1.
|
|
284
|
+
* @license lucide-react v1.8.0 - ISC
|
|
285
285
|
*
|
|
286
286
|
* This source code is licensed under the ISC license.
|
|
287
287
|
* See the LICENSE file in the root directory of this source tree.
|
|
288
288
|
*/const Km=[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]],Ym=Z("keyboard",Km);/**
|
|
289
|
-
* @license lucide-react v1.
|
|
289
|
+
* @license lucide-react v1.8.0 - ISC
|
|
290
290
|
*
|
|
291
291
|
* This source code is licensed under the ISC license.
|
|
292
292
|
* See the LICENSE file in the root directory of this source tree.
|
|
293
293
|
*/const Xm=[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]],Zm=Z("languages",Xm);/**
|
|
294
|
-
* @license lucide-react v1.
|
|
294
|
+
* @license lucide-react v1.8.0 - ISC
|
|
295
295
|
*
|
|
296
296
|
* This source code is licensed under the ISC license.
|
|
297
297
|
* See the LICENSE file in the root directory of this source tree.
|
|
298
|
-
*/const Jm=[["path",{d:"M9 17H7A5 5 0 0 1 7
|
|
299
|
-
* @license lucide-react v1.
|
|
298
|
+
*/const Jm=[["path",{d:"M9 17H7A5 5 0 0 1 7 7",key:"10o201"}],["path",{d:"M15 7h2a5 5 0 0 1 4 8",key:"1d3206"}],["line",{x1:"8",x2:"12",y1:"12",y2:"12",key:"rvw6j4"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]],Yc=Z("link-2-off",Jm);/**
|
|
299
|
+
* @license lucide-react v1.8.0 - ISC
|
|
300
300
|
*
|
|
301
301
|
* This source code is licensed under the ISC license.
|
|
302
302
|
* See the LICENSE file in the root directory of this source tree.
|
|
303
|
-
*/const
|
|
304
|
-
* @license lucide-react v1.
|
|
303
|
+
*/const Qm=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],eg=Z("link-2",Qm);/**
|
|
304
|
+
* @license lucide-react v1.8.0 - ISC
|
|
305
305
|
*
|
|
306
306
|
* This source code is licensed under the ISC license.
|
|
307
307
|
* See the LICENSE file in the root directory of this source tree.
|
|
308
308
|
*/const tg=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],_i=Z("list-checks",tg);/**
|
|
309
|
-
* @license lucide-react v1.
|
|
309
|
+
* @license lucide-react v1.8.0 - ISC
|
|
310
310
|
*
|
|
311
311
|
* This source code is licensed under the ISC license.
|
|
312
312
|
* See the LICENSE file in the root directory of this source tree.
|
|
313
313
|
*/const rg=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],Ru=Z("list-todo",rg);/**
|
|
314
|
-
* @license lucide-react v1.
|
|
314
|
+
* @license lucide-react v1.8.0 - ISC
|
|
315
315
|
*
|
|
316
316
|
* This source code is licensed under the ISC license.
|
|
317
317
|
* See the LICENSE file in the root directory of this source tree.
|
|
318
318
|
*/const ng=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],_e=Z("loader-circle",ng);/**
|
|
319
|
-
* @license lucide-react v1.
|
|
319
|
+
* @license lucide-react v1.8.0 - ISC
|
|
320
320
|
*
|
|
321
321
|
* This source code is licensed under the ISC license.
|
|
322
322
|
* See the LICENSE file in the root directory of this source tree.
|
|
323
323
|
*/const ig=[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]],sg=Z("map",ig);/**
|
|
324
|
-
* @license lucide-react v1.
|
|
324
|
+
* @license lucide-react v1.8.0 - ISC
|
|
325
325
|
*
|
|
326
326
|
* This source code is licensed under the ISC license.
|
|
327
327
|
* See the LICENSE file in the root directory of this source tree.
|
|
328
328
|
*/const ag=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],Iu=Z("maximize-2",ag);/**
|
|
329
|
-
* @license lucide-react v1.
|
|
329
|
+
* @license lucide-react v1.8.0 - ISC
|
|
330
330
|
*
|
|
331
331
|
* This source code is licensed under the ISC license.
|
|
332
332
|
* See the LICENSE file in the root directory of this source tree.
|
|
333
333
|
*/const og=[["path",{d:"M12 12v-2",key:"fwoke6"}],["path",{d:"M12 18v-2",key:"qj6yno"}],["path",{d:"M16 12v-2",key:"heuere"}],["path",{d:"M16 18v-2",key:"s1ct0w"}],["path",{d:"M2 11h1.5",key:"15p63e"}],["path",{d:"M20 18v-2",key:"12ehxp"}],["path",{d:"M20.5 11H22",key:"khsy7a"}],["path",{d:"M4 18v-2",key:"1c3oqr"}],["path",{d:"M8 12v-2",key:"1mwtfd"}],["path",{d:"M8 18v-2",key:"qcmpov"}],["rect",{x:"2",y:"6",width:"20",height:"10",rx:"2",key:"1qcswk"}]],qn=Z("memory-stick",og);/**
|
|
334
|
-
* @license lucide-react v1.
|
|
334
|
+
* @license lucide-react v1.8.0 - ISC
|
|
335
335
|
*
|
|
336
336
|
* This source code is licensed under the ISC license.
|
|
337
337
|
* See the LICENSE file in the root directory of this source tree.
|
|
338
338
|
*/const lg=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],cg=Z("menu",lg);/**
|
|
339
|
-
* @license lucide-react v1.
|
|
339
|
+
* @license lucide-react v1.8.0 - ISC
|
|
340
340
|
*
|
|
341
341
|
* This source code is licensed under the ISC license.
|
|
342
342
|
* See the LICENSE file in the root directory of this source tree.
|
|
343
343
|
*/const dg=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],kn=Z("message-circle-question-mark",dg);/**
|
|
344
|
-
* @license lucide-react v1.
|
|
344
|
+
* @license lucide-react v1.8.0 - ISC
|
|
345
345
|
*
|
|
346
346
|
* This source code is licensed under the ISC license.
|
|
347
347
|
* See the LICENSE file in the root directory of this source tree.
|
|
348
348
|
*/const ug=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],Lu=Z("message-circle",ug);/**
|
|
349
|
-
* @license lucide-react v1.
|
|
349
|
+
* @license lucide-react v1.8.0 - ISC
|
|
350
350
|
*
|
|
351
351
|
* This source code is licensed under the ISC license.
|
|
352
352
|
* See the LICENSE file in the root directory of this source tree.
|
|
353
353
|
*/const pg=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],fr=Z("message-square",pg);/**
|
|
354
|
-
* @license lucide-react v1.
|
|
354
|
+
* @license lucide-react v1.8.0 - ISC
|
|
355
355
|
*
|
|
356
356
|
* This source code is licensed under the ISC license.
|
|
357
357
|
* See the LICENSE file in the root directory of this source tree.
|
|
358
358
|
*/const hg=[["path",{d:"M5 12h14",key:"1ays0h"}]],mg=Z("minus",hg);/**
|
|
359
|
-
* @license lucide-react v1.
|
|
359
|
+
* @license lucide-react v1.8.0 - ISC
|
|
360
360
|
*
|
|
361
361
|
* This source code is licensed under the ISC license.
|
|
362
362
|
* See the LICENSE file in the root directory of this source tree.
|
|
363
363
|
*/const gg=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],Ou=Z("moon",gg);/**
|
|
364
|
-
* @license lucide-react v1.
|
|
364
|
+
* @license lucide-react v1.8.0 - ISC
|
|
365
365
|
*
|
|
366
366
|
* This source code is licensed under the ISC license.
|
|
367
367
|
* See the LICENSE file in the root directory of this source tree.
|
|
368
368
|
*/const fg=[["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0v-9a2 2 0 0 1 2-2h2",key:"39pd36"}],["rect",{width:"8",height:"4",x:"10",y:"6",rx:"1",key:"aywv1n"}]],Xc=Z("newspaper",fg);/**
|
|
369
|
-
* @license lucide-react v1.
|
|
369
|
+
* @license lucide-react v1.8.0 - ISC
|
|
370
370
|
*
|
|
371
371
|
* This source code is licensed under the ISC license.
|
|
372
372
|
* See the LICENSE file in the root directory of this source tree.
|
|
373
373
|
*/const bg=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],yg=Z("package",bg);/**
|
|
374
|
-
* @license lucide-react v1.
|
|
374
|
+
* @license lucide-react v1.8.0 - ISC
|
|
375
375
|
*
|
|
376
376
|
* This source code is licensed under the ISC license.
|
|
377
377
|
* See the LICENSE file in the root directory of this source tree.
|
|
378
378
|
*/const _g=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],xi=Z("panel-left",_g);/**
|
|
379
|
-
* @license lucide-react v1.
|
|
379
|
+
* @license lucide-react v1.8.0 - ISC
|
|
380
380
|
*
|
|
381
381
|
* This source code is licensed under the ISC license.
|
|
382
382
|
* See the LICENSE file in the root directory of this source tree.
|
|
383
383
|
*/const xg=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],vg=Z("pen-line",xg);/**
|
|
384
|
-
* @license lucide-react v1.
|
|
384
|
+
* @license lucide-react v1.8.0 - ISC
|
|
385
385
|
*
|
|
386
386
|
* This source code is licensed under the ISC license.
|
|
387
387
|
* See the LICENSE file in the root directory of this source tree.
|
|
388
388
|
*/const Sg=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],$u=Z("pencil",Sg);/**
|
|
389
|
-
* @license lucide-react v1.
|
|
389
|
+
* @license lucide-react v1.8.0 - ISC
|
|
390
390
|
*
|
|
391
391
|
* This source code is licensed under the ISC license.
|
|
392
392
|
* See the LICENSE file in the root directory of this source tree.
|
|
393
393
|
*/const kg=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]],wg=Z("pin",kg);/**
|
|
394
|
-
* @license lucide-react v1.
|
|
394
|
+
* @license lucide-react v1.8.0 - ISC
|
|
395
395
|
*
|
|
396
396
|
* This source code is licensed under the ISC license.
|
|
397
397
|
* See the LICENSE file in the root directory of this source tree.
|
|
398
398
|
*/const Eg=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Cg=Z("play",Eg);/**
|
|
399
|
-
* @license lucide-react v1.
|
|
399
|
+
* @license lucide-react v1.8.0 - ISC
|
|
400
400
|
*
|
|
401
401
|
* This source code is licensed under the ISC license.
|
|
402
402
|
* See the LICENSE file in the root directory of this source tree.
|
|
403
403
|
*/const Tg=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],Ng=Z("plug",Tg);/**
|
|
404
|
-
* @license lucide-react v1.
|
|
404
|
+
* @license lucide-react v1.8.0 - ISC
|
|
405
405
|
*
|
|
406
406
|
* This source code is licensed under the ISC license.
|
|
407
407
|
* See the LICENSE file in the root directory of this source tree.
|
|
408
408
|
*/const Ag=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],bt=Z("plus",Ag);/**
|
|
409
|
-
* @license lucide-react v1.
|
|
409
|
+
* @license lucide-react v1.8.0 - ISC
|
|
410
410
|
*
|
|
411
411
|
* This source code is licensed under the ISC license.
|
|
412
412
|
* See the LICENSE file in the root directory of this source tree.
|
|
413
413
|
*/const Rg=[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Ig=Z("power-off",Rg);/**
|
|
414
|
-
* @license lucide-react v1.
|
|
414
|
+
* @license lucide-react v1.8.0 - ISC
|
|
415
415
|
*
|
|
416
416
|
* This source code is licensed under the ISC license.
|
|
417
417
|
* See the LICENSE file in the root directory of this source tree.
|
|
418
418
|
*/const Lg=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],Du=Z("power",Lg);/**
|
|
419
|
-
* @license lucide-react v1.
|
|
419
|
+
* @license lucide-react v1.8.0 - ISC
|
|
420
420
|
*
|
|
421
421
|
* This source code is licensed under the ISC license.
|
|
422
422
|
* See the LICENSE file in the root directory of this source tree.
|
|
423
423
|
*/const Og=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],Wr=Z("radio",Og);/**
|
|
424
|
-
* @license lucide-react v1.
|
|
424
|
+
* @license lucide-react v1.8.0 - ISC
|
|
425
425
|
*
|
|
426
426
|
* This source code is licensed under the ISC license.
|
|
427
427
|
* See the LICENSE file in the root directory of this source tree.
|
|
428
428
|
*/const $g=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],dt=Z("refresh-cw",$g);/**
|
|
429
|
-
* @license lucide-react v1.
|
|
429
|
+
* @license lucide-react v1.8.0 - ISC
|
|
430
430
|
*
|
|
431
431
|
* This source code is licensed under the ISC license.
|
|
432
432
|
* See the LICENSE file in the root directory of this source tree.
|
|
433
433
|
*/const Dg=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Vn=Z("rotate-ccw",Dg);/**
|
|
434
|
-
* @license lucide-react v1.
|
|
434
|
+
* @license lucide-react v1.8.0 - ISC
|
|
435
435
|
*
|
|
436
436
|
* This source code is licensed under the ISC license.
|
|
437
437
|
* See the LICENSE file in the root directory of this source tree.
|
|
438
438
|
*/const Mg=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 12h18",key:"1i2n21"}]],jg=Z("rows-2",Mg);/**
|
|
439
|
-
* @license lucide-react v1.
|
|
439
|
+
* @license lucide-react v1.8.0 - ISC
|
|
440
440
|
*
|
|
441
441
|
* This source code is licensed under the ISC license.
|
|
442
442
|
* See the LICENSE file in the root directory of this source tree.
|
|
443
443
|
*/const Pg=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]],Fg=Z("scan",Pg);/**
|
|
444
|
-
* @license lucide-react v1.
|
|
444
|
+
* @license lucide-react v1.8.0 - ISC
|
|
445
445
|
*
|
|
446
446
|
* This source code is licensed under the ISC license.
|
|
447
447
|
* See the LICENSE file in the root directory of this source tree.
|
|
448
448
|
*/const Bg=[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]],Ug=Z("scissors",Bg);/**
|
|
449
|
-
* @license lucide-react v1.
|
|
449
|
+
* @license lucide-react v1.8.0 - ISC
|
|
450
450
|
*
|
|
451
451
|
* This source code is licensed under the ISC license.
|
|
452
452
|
* See the LICENSE file in the root directory of this source tree.
|
|
453
453
|
*/const zg=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],Hg=Z("scroll-text",zg);/**
|
|
454
|
-
* @license lucide-react v1.
|
|
454
|
+
* @license lucide-react v1.8.0 - ISC
|
|
455
455
|
*
|
|
456
456
|
* This source code is licensed under the ISC license.
|
|
457
457
|
* See the LICENSE file in the root directory of this source tree.
|
|
458
458
|
*/const Gg=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],tt=Z("search",Gg);/**
|
|
459
|
-
* @license lucide-react v1.
|
|
459
|
+
* @license lucide-react v1.8.0 - ISC
|
|
460
460
|
*
|
|
461
461
|
* This source code is licensed under the ISC license.
|
|
462
462
|
* See the LICENSE file in the root directory of this source tree.
|
|
463
463
|
*/const Wg=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],qg=Z("send",Wg);/**
|
|
464
|
-
* @license lucide-react v1.
|
|
464
|
+
* @license lucide-react v1.8.0 - ISC
|
|
465
465
|
*
|
|
466
466
|
* This source code is licensed under the ISC license.
|
|
467
467
|
* See the LICENSE file in the root directory of this source tree.
|
|
468
468
|
*/const Vg=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],qr=Z("server",Vg);/**
|
|
469
|
-
* @license lucide-react v1.
|
|
469
|
+
* @license lucide-react v1.8.0 - ISC
|
|
470
470
|
*
|
|
471
471
|
* This source code is licensed under the ISC license.
|
|
472
472
|
* See the LICENSE file in the root directory of this source tree.
|
|
473
473
|
*/const Kg=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],vi=Z("settings-2",Kg);/**
|
|
474
|
-
* @license lucide-react v1.
|
|
474
|
+
* @license lucide-react v1.8.0 - ISC
|
|
475
475
|
*
|
|
476
476
|
* This source code is licensed under the ISC license.
|
|
477
477
|
* See the LICENSE file in the root directory of this source tree.
|
|
478
478
|
*/const Yg=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Xg=Z("settings",Yg);/**
|
|
479
|
-
* @license lucide-react v1.
|
|
479
|
+
* @license lucide-react v1.8.0 - ISC
|
|
480
480
|
*
|
|
481
481
|
* This source code is licensed under the ISC license.
|
|
482
482
|
* See the LICENSE file in the root directory of this source tree.
|
|
483
483
|
*/const Zg=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],nn=Z("square-terminal",Zg);/**
|
|
484
|
-
* @license lucide-react v1.
|
|
484
|
+
* @license lucide-react v1.8.0 - ISC
|
|
485
485
|
*
|
|
486
486
|
* This source code is licensed under the ISC license.
|
|
487
487
|
* See the LICENSE file in the root directory of this source tree.
|
|
488
488
|
*/const Jg=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Mu=Z("square",Jg);/**
|
|
489
|
-
* @license lucide-react v1.
|
|
489
|
+
* @license lucide-react v1.8.0 - ISC
|
|
490
490
|
*
|
|
491
491
|
* This source code is licensed under the ISC license.
|
|
492
492
|
* See the LICENSE file in the root directory of this source tree.
|
|
493
493
|
*/const Qg=[["path",{d:"M15 21v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5",key:"slp6dd"}],["path",{d:"M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244",key:"o0xfot"}],["path",{d:"M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05",key:"wn3emo"}]],or=Z("store",Qg);/**
|
|
494
|
-
* @license lucide-react v1.
|
|
494
|
+
* @license lucide-react v1.8.0 - ISC
|
|
495
495
|
*
|
|
496
496
|
* This source code is licensed under the ISC license.
|
|
497
497
|
* See the LICENSE file in the root directory of this source tree.
|
|
498
498
|
*/const ef=[["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14.837 16.385a6 6 0 1 1-7.223-7.222c.624-.147.97.66.715 1.248a4 4 0 0 0 5.26 5.259c.589-.255 1.396.09 1.248.715",key:"xlf6rm"}],["path",{d:"M16 12a4 4 0 0 0-4-4",key:"6vsxu"}],["path",{d:"m19 5-1.256 1.256",key:"1yg6a6"}],["path",{d:"M20 12h2",key:"1q8mjw"}]],tf=Z("sun-moon",ef);/**
|
|
499
|
-
* @license lucide-react v1.
|
|
499
|
+
* @license lucide-react v1.8.0 - ISC
|
|
500
500
|
*
|
|
501
501
|
* This source code is licensed under the ISC license.
|
|
502
502
|
* See the LICENSE file in the root directory of this source tree.
|
|
503
503
|
*/const rf=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],ju=Z("sun",rf);/**
|
|
504
|
-
* @license lucide-react v1.
|
|
504
|
+
* @license lucide-react v1.8.0 - ISC
|
|
505
505
|
*
|
|
506
506
|
* This source code is licensed under the ISC license.
|
|
507
507
|
* See the LICENSE file in the root directory of this source tree.
|
|
508
508
|
*/const nf=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Pu=Z("terminal",nf);/**
|
|
509
|
-
* @license lucide-react v1.
|
|
509
|
+
* @license lucide-react v1.8.0 - ISC
|
|
510
510
|
*
|
|
511
511
|
* This source code is licensed under the ISC license.
|
|
512
512
|
* See the LICENSE file in the root directory of this source tree.
|
|
513
513
|
*/const sf=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],sn=Z("trash-2",sf);/**
|
|
514
|
-
* @license lucide-react v1.
|
|
514
|
+
* @license lucide-react v1.8.0 - ISC
|
|
515
515
|
*
|
|
516
516
|
* This source code is licensed under the ISC license.
|
|
517
517
|
* See the LICENSE file in the root directory of this source tree.
|
|
518
518
|
*/const af=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],lr=Z("triangle-alert",af);/**
|
|
519
|
-
* @license lucide-react v1.
|
|
519
|
+
* @license lucide-react v1.8.0 - ISC
|
|
520
520
|
*
|
|
521
521
|
* This source code is licensed under the ISC license.
|
|
522
522
|
* See the LICENSE file in the root directory of this source tree.
|
|
523
523
|
*/const of=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],Vr=Z("undo-2",of);/**
|
|
524
|
-
* @license lucide-react v1.
|
|
524
|
+
* @license lucide-react v1.8.0 - ISC
|
|
525
525
|
*
|
|
526
526
|
* This source code is licensed under the ISC license.
|
|
527
527
|
* See the LICENSE file in the root directory of this source tree.
|
|
528
528
|
*/const lf=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Fu=Z("users",lf);/**
|
|
529
|
-
* @license lucide-react v1.
|
|
529
|
+
* @license lucide-react v1.8.0 - ISC
|
|
530
530
|
*
|
|
531
531
|
* This source code is licensed under the ISC license.
|
|
532
532
|
* See the LICENSE file in the root directory of this source tree.
|
|
533
533
|
*/const cf=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ie=Z("x",cf);/**
|
|
534
|
-
* @license lucide-react v1.
|
|
534
|
+
* @license lucide-react v1.8.0 - ISC
|
|
535
535
|
*
|
|
536
536
|
* This source code is licensed under the ISC license.
|
|
537
537
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -608,8 +608,8 @@ ${t("terminal.processExited")}\r
|
|
|
608
608
|
text-text-primary focus:outline-none focus:border-accent-brand min-w-[180px]`,children:[n.jsx("option",{value:"",children:e("logs.selectWorker")}),i.map(y=>n.jsxs("option",{value:y.pid,children:["PID ",y.pid," — ",y.name||y.kind,y.isCurrent?` (${e("logs.current")})`:""]},y.pid))]}),a.length>0&&n.jsx("div",{className:"flex items-center gap-0.5 bg-bg-tertiary rounded-lg p-0.5",children:a.map(y=>{var S;return n.jsx("button",{onClick:()=>u(y),className:`px-2.5 py-1 text-[11px] font-medium rounded-md transition-colors ${y===d?"bg-bg-primary text-text-primary shadow-sm":"text-text-tertiary hover:text-text-secondary"}`,children:((S=jv[y])==null?void 0:S[t])||y},y)})}),n.jsx("div",{className:"flex-1"}),n.jsxs("div",{className:"relative",children:[n.jsx(tt,{size:13,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-text-tertiary"}),n.jsx("input",{type:"text",value:b,onChange:y=>_(y.target.value),placeholder:e("logs.search"),className:`pl-7 pr-7 py-1.5 text-xs rounded-lg border border-border-primary bg-bg-secondary
|
|
609
609
|
text-text-primary placeholder:text-text-tertiary focus:outline-none focus:border-accent-brand w-[180px]`}),b&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"absolute right-8 top-1/2 -translate-y-1/2 text-[10px] text-text-tertiary",children:x}),n.jsx("button",{onClick:()=>_(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-tertiary hover:text-text-primary",children:n.jsx(Ie,{size:12})})]})]}),n.jsxs("button",{onClick:()=>v(!w),className:`flex items-center gap-1 px-2.5 py-1.5 text-xs rounded-lg border transition-colors ${w?"border-accent-brand/40 bg-accent-brand/10 text-accent-brand":"border-border-primary text-text-secondary hover:text-text-primary"}`,title:e("logs.autoRefresh"),children:[n.jsx(dt,{size:12,className:w?"animate-spin":""}),e("logs.autoRefresh")]}),n.jsx("button",{onClick:m,className:"p-1.5 rounded-lg text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors",title:e("logs.refresh"),children:n.jsx(dt,{size:14})})]}),E&&n.jsxs("div",{className:"flex items-center gap-3 mt-2 text-[11px] text-text-tertiary",children:[o&&n.jsx(_t,{path:o,className:"font-mono truncate max-w-[400px]"}),E.url&&n.jsx("a",{href:E.url,target:"_blank",rel:"noopener noreferrer",className:"text-accent-brand hover:underline",children:E.url})]})]}),n.jsx("div",{className:"flex-1 overflow-auto bg-bg-primary",children:p?!l&&a.length===0?n.jsx("div",{className:"flex items-center justify-center h-full text-text-tertiary text-sm",children:e("logs.empty")}):b?n.jsx("div",{ref:h,className:"p-4 font-mono text-xs leading-5 min-h-full",children:f?f.split(`
|
|
610
610
|
`).map((y,S)=>n.jsx(zv,{line:y,searchText:b},S)):n.jsx("span",{className:"text-text-tertiary",children:e("logs.empty")})}):n.jsx("div",{ref:h,className:"min-h-full",children:n.jsx(Dv,{language:"log",style:r==="dark"?fn:bn,showLineNumbers:!0,wrapLongLines:!0,customStyle:{margin:0,padding:"16px",border:"none",background:"transparent",fontSize:"12px",lineHeight:"1.5"},codeTagProps:{style:{background:"transparent",textShadow:"none"}},lineNumberStyle:{minWidth:"3em",paddingRight:"1em",color:"var(--color-text-tertiary)",userSelect:"none"},children:l||e("logs.empty")})}):n.jsx("div",{className:"flex items-center justify-center h-full text-text-tertiary text-sm",children:e("logs.selectWorker")})})]})}const Fv={ERROR:"text-red-500 dark:text-red-400",WARN:"text-amber-600 dark:text-amber-400",INFO:"text-blue-500 dark:text-blue-400",DEBUG:"text-text-tertiary"},Bv={ERROR:"bg-red-50/50 dark:bg-red-900/10",WARN:"bg-amber-50/50 dark:bg-amber-900/10"},Uv=/^\[(\w+)\]\s/;function zv({line:e,searchText:t}){var o;if(!e.trim())return n.jsx("div",{className:"h-5"});const r=e.match(Uv),i=((o=r==null?void 0:r[1])==null?void 0:o.toUpperCase())||"",s=Fv[i]||"text-text-secondary",l=Bv[i]||"",a=t&&e.toLowerCase().includes(t.toLowerCase())?"bg-yellow-100/60 dark:bg-yellow-900/20":"";return n.jsx("div",{className:`whitespace-pre-wrap break-all px-2 py-px rounded-sm ${l} ${a}`,children:r?n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:`font-semibold ${s}`,children:["[",r[1],"]"]}),n.jsx("span",{className:"text-text-secondary",children:iu(e.slice(r[0].length),t)})]}):n.jsx("span",{className:"text-text-secondary",children:iu(e,t)})})}function iu(e,t){if(!t)return e;const r=e.toLowerCase(),i=t.toLowerCase(),s=[];let l=0,d=r.indexOf(i);for(;d!==-1;)d>l&&s.push(e.slice(l,d)),s.push(n.jsx("mark",{className:"bg-yellow-300 dark:bg-yellow-700 text-text-primary rounded-sm px-px",children:e.slice(d,d+t.length)},d)),l=d+t.length,d=r.indexOf(i,l);return l<e.length&&s.push(e.slice(l)),s.length>0?n.jsx(n.Fragment,{children:s}):e}const Hv=8e3,Gv=$e((e,t)=>({metrics:null,loading:!1,error:null,_pollTimer:null,fetchMetrics:async()=>{e({loading:!t().metrics,error:null});try{const r=await ye("/api/v1/metrics",{headers:ue()});if(!r.ok)throw new Error(`Failed to fetch metrics: ${r.status}`);const i=await r.json();e({metrics:i.data,loading:!1})}catch(r){e({error:r.message,loading:!1})}},startPolling:(r=Hv)=>{const{stopPolling:i,fetchMetrics:s}=t();i(),s();const l=setInterval(s,r);e({_pollTimer:l})},stopPolling:()=>{const{_pollTimer:r}=t();r&&(clearInterval(r),e({_pollTimer:null}))}})),Wv={interactive:"bg-blue-50 text-blue-700 border border-blue-200 dark:bg-blue-500/10 dark:text-blue-400 dark:border-blue-500/20",bg:"bg-purple-50 text-purple-700 border border-purple-200 dark:bg-purple-500/10 dark:text-purple-400 dark:border-purple-500/20",daemon:"bg-green-50 text-green-700 border border-green-200 dark:bg-green-500/10 dark:text-green-400 dark:border-green-500/20","daemon-worker":"bg-orange-50 text-orange-700 border border-orange-200 dark:bg-orange-500/10 dark:text-orange-400 dark:border-orange-500/20"};function qv(){const{t:e}=ne(),{metrics:t,loading:r,error:i,fetchMetrics:s,startPolling:l,stopPolling:d}=Gv(),{workers:a,fetchWorkers:o}=Lc();if(C.useEffect(()=>(l(8e3),o(),()=>d()),[l,d,o]),r&&!t)return n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx(nt,{size:"large",text:e("metrics.loading")})});if(i&&!t)return n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsxs("div",{className:"text-center",children:[n.jsx("div",{className:"text-text-secondary mb-4",children:i}),n.jsx("button",{onClick:s,className:"px-4 py-2 bg-accent-brand text-white rounded-lg text-sm",children:e("metrics.refresh")})]})});const c=Vv((t==null?void 0:t.instances)||[],a);return n.jsxs("div",{className:"flex-1 overflow-auto p-4 md:p-6",children:[n.jsxs("div",{className:"flex items-center justify-between mb-6",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(gi,{size:20,className:"text-accent-brand"}),n.jsx("h1",{className:"text-lg font-semibold text-text-primary",children:e("metrics.title")})]}),n.jsxs("button",{onClick:()=>{s(),o()},className:`flex items-center gap-1.5 px-3 py-1.5 text-sm text-text-secondary
|
|
611
|
-
hover:text-text-primary hover:bg-bg-hover rounded-lg transition-colors`,title:e("metrics.refresh"),children:[n.jsx(dt,{size:14}),n.jsx("span",{children:e("metrics.refresh")})]})]}),t&&n.jsxs(n.Fragment,{children:[n.jsx(Kv,{metrics:t}),n.jsx(Yv,{workers:c})]})]})}function Vv(e,t){return e.map(r=>{const i=t.find(s=>s.pid===r.pid);return{...r,kind:i==null?void 0:i.kind,name:i==null?void 0:i.name,url:(i==null?void 0:i.url)||(i==null?void 0:i.endpoint),status:i==null?void 0:i.status}})}function Kv({metrics:e}){const{t}=ne(),r=e.memTotalMib>0?e.memUsedMib/e.memTotalMib*100:0,i=e.diskTotal>0?e.diskUsed/e.diskTotal*100:0;return n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-6",children:[n.jsx(Fn,{icon:n.jsx(Rt,{size:18}),label:t("metrics.cpu"),value:`${e.cpuUsedPct.toFixed(1)}%`,subtext:`${e.cpuCount} ${t("metrics.cores")}`,percent:e.cpuUsedPct,colorClasses:zr(e.cpuUsedPct)}),n.jsx(Fn,{icon:n.jsx(qn,{size:18}),label:t("metrics.memory"),value:`${su(e.memUsedMib)} / ${su(e.memTotalMib)}`,subtext:`${r.toFixed(1)}%`,percent:r,colorClasses:zr(r)}),n.jsx(Fn,{icon:n.jsx(Fm,{size:18}),label:t("metrics.disk"),value:`${au(e.diskUsed)} / ${au(e.diskTotal)}`,subtext:`${i.toFixed(1)}%`,percent:i,colorClasses:zr(i)})]})}function Fn({icon:e,label:t,value:r,subtext:i,percent:s,colorClasses:l}){const[d,a]=l;return n.jsxs("div",{className:"bg-bg-secondary rounded-xl p-4 border border-border-primary",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsx("span",{className:d,children:e}),n.jsx("span",{className:"text-sm font-medium text-text-secondary",children:t})]}),n.jsx("div",{className:"text-xl font-semibold text-text-primary mb-1",children:r}),n.jsx("div",{className:"text-xs text-text-tertiary mb-3",children:i}),n.jsx("div",{className:"h-2 bg-bg-tertiary rounded-full overflow-hidden",children:n.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${a}`,style:{width:`${Math.min(s,100)}%`}})})]})}function Yv({workers:e}){const{t}=ne();return e.length===0?n.jsx("div",{className:"text-center py-12 text-text-tertiary",children:t("metrics.noWorkers")}):n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[n.jsx(Rt,{size:18,className:"text-text-secondary"}),n.jsxs("h2",{className:"text-base font-medium text-text-primary",children:["Workers (",e.length,")"]})]}),n.jsx("div",{className:"space-y-3",children:e.map(r=>n.jsx(Xv,{worker:r},r.id))})]})}function Xv({worker:e}){const{t}=ne();return n.jsx("div",{className:`bg-bg-secondary rounded-xl p-4 md:p-5 border transition-colors hover:border-gray-300 dark:hover:border-gray-600 border-border-primary ${e.error?"opacity-60":""}`,children:n.jsxs("div",{className:"flex flex-col gap-4",children:[n.jsxs("div",{className:"flex items-start justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("span",{className:`inline-block w-2 h-2 rounded-full ${e.error?"bg-red-400":"bg-green-400"}`}),e.kind&&n.jsx("span",{className:`inline-block px-2.5 py-0.5 text-xs font-medium rounded-md ${Wv[e.kind]||"bg-gray-100 text-gray-600"}`,children:e.kind}),n.jsx("span",{className:"text-sm font-medium text-text-primary",children:e.name||e.hostname}),e.isCurrent&&n.jsx("span",{className:"text-[10px] uppercase font-bold tracking-wider px-1.5 py-0.5 bg-accent-brand/10 text-accent-brand rounded",children:t("metrics.current")}),e.error&&n.jsx("span",{className:"text-xs text-red-400",children:e.error})]}),n.jsxs("span",{className:"text-xs text-text-tertiary font-mono bg-bg-tertiary px-2 py-0.5 rounded-md border border-border-primary/50",children:["PID ",e.pid]})]}),n.jsxs("div",{className:"flex flex-col md:flex-row md:items-start justify-between gap-4 md:gap-6",children:[n.jsxs("div",{className:"flex flex-col gap-2.5 flex-1 min-w-0",children:[n.jsx(_t,{path:e.cwd,className:"text-[13px] text-text-secondary font-mono truncate max-w-full"}),e.url&&n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(ct,{size:14,className:"text-text-tertiary flex-none"}),n.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-accent-brand hover:underline truncate",children:e.url})]})]}),e.rssMib>0||e.heapUsedMib>0?n.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 flex-none",style:{minWidth:"460px"},children:[n.jsxs("div",{className:"min-w-[100px]",children:[n.jsx(Dt,{icon:n.jsx(qn,{size:14}),label:"RSS",value:`${e.rssMib.toFixed(0)} MiB`}),n.jsx("div",{className:"mt-1.5 h-1.5 bg-bg-tertiary rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full rounded-full bg-blue-500 transition-all duration-500",style:{width:`${Math.min(e.rssMib/2048*100,100)}%`}})})]}),n.jsxs("div",{className:"min-w-[140px]",children:[n.jsx(Dt,{icon:n.jsx(qn,{size:14}),label:"Heap",value:`${e.heapUsedMib.toFixed(0)} / ${e.heapTotalMib.toFixed(0)} MiB`}),e.heapTotalMib>0&&n.jsx("div",{className:"mt-1.5 h-1.5 bg-bg-tertiary rounded-full overflow-hidden",children:n.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${zr(e.heapUsedMib/e.heapTotalMib*100)[1]}`,style:{width:`${Math.min(e.heapUsedMib/e.heapTotalMib*100,100)}%`}})})]}),n.jsx("div",{className:"min-w-[80px]",children:n.jsx(Dt,{icon:n.jsx(pr,{size:14}),label:t("metrics.uptime"),value:ou(e.uptimeSeconds)})}),n.jsx("div",{className:"min-w-[60px]",children:n.jsx(Dt,{icon:n.jsx(qr,{size:14}),label:t("metrics.version"),value:e.version||"-"})})]}):n.jsxs("div",{className:"grid grid-cols-2 gap-4 flex-none",style:{minWidth:"200px"},children:[n.jsx("div",{className:"min-w-[80px]",children:n.jsx(Dt,{icon:n.jsx(pr,{size:14}),label:t("metrics.uptime"),value:ou(e.uptimeSeconds)})}),n.jsx("div",{className:"min-w-[60px]",children:n.jsx(Dt,{icon:n.jsx(qr,{size:14}),label:t("metrics.version"),value:e.version||"-"})})]})]})]})})}function Dt({icon:e,label:t,value:r}){return n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsxs("div",{className:"flex items-center gap-1.5 text-text-tertiary",children:[e,n.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wider",children:t})]}),n.jsx("div",{className:"text-sm font-semibold text-text-primary",style:{fontVariantNumeric:"tabular-nums"},children:r})]})}function zr(e){return e>=90?["text-red-500","bg-red-500"]:e>=70?["text-amber-500","bg-amber-500"]:["text-green-500","bg-green-500"]}function su(e){return e>=1024?`${(e/1024).toFixed(1)} GiB`:`${e} MiB`}function au(e){if(e===0)return"0 B";const t=e/(1024*1024*1024);return t>=1?`${t.toFixed(1)} GB`:`${(e/(1024*1024)).toFixed(0)} MB`}function ou(e){if(e<60)return`${e}s`;if(e<3600)return`${Math.floor(e/60)}m ${e%60}s`;const t=Math.floor(e/3600),r=Math.floor(e%3600/60);return t>=24?`${Math.floor(t/24)}d ${t%24}h`:`${t}h ${r}m`}function Zv({onNavigate:e}){const{t}=ne(),[r,i]=C.useState(Xr);if(C.useEffect(()=>{const s=()=>i(Xr());return window.addEventListener("hashchange",s),()=>window.removeEventListener("hashchange",s)},[]),r==="add-wechat"||r!=null&&r.startsWith("rebind-wechat/")){const s=r!=null&&r.startsWith("rebind-wechat/")?r.split("/")[1]:void 0;return n.jsx(Qv,{onBack:()=>bd("remote-control"),t,existingInstanceId:s})}return r==="add-wecom"?n.jsx(eS,{onBack:()=>bd("remote-control"),t}):n.jsx(Jv,{onNavigate:e,t})}function Jv({onNavigate:e,t}){const[r,i]=C.useState([]),[s,l]=C.useState(!0),[d,a]=C.useState(null),[o,c]=C.useState(null),p=C.useCallback(async()=>{try{const y=await ye("/api/v1/channels");if(y.ok){const S=await y.json();i((S.clients||[]).filter(k=>!k.hidden&&!k.instanceId.startsWith("_pending")))}}catch{}finally{l(!1)}},[]);C.useEffect(()=>{p();const y=setInterval(p,5e3);return()=>clearInterval(y)},[p]);const g=C.useCallback(async(y,S,k)=>{const T=`${S}:${k}:${y}`;c(T),a(null);try{const R=y==="delete"?"DELETE":"POST",A=y==="delete"?`/api/v1/channels/${S}/${k}`:`/api/v1/channels/${S}/${k}/${y}`,D=await ye(A,{method:R});if(!D.ok){const B=await D.json().catch(()=>({}));throw new Error(B.error||`Failed: ${D.status}`)}const L=await D.json().catch(()=>({}));if(y==="unbind"&&S==="wechat"&&L.needsQrScan){rr("remote-control",`rebind-wechat/${k}`);return}await p()}catch(R){a((R==null?void 0:R.message)||"Action failed")}finally{c(null)}},[p]),b=y=>y==="connected"?"text-green-500":y==="connecting"?"text-yellow-500":y==="error"?"text-red-500":"text-text-tertiary",_=y=>t(y==="connected"?"remoteControl.connected":y==="connecting"?"remoteControl.connecting":"remoteControl.disconnected"),w=y=>y==="wechat"?n.jsx(Lu,{size:18,className:"text-green-500"}):y==="wecom"?n.jsx(Wr,{size:18,className:"text-accent-brand"}):n.jsx(Yc,{size:18,className:"text-text-tertiary"}),v=y=>y==="wechat"?t("channel.wechat")+t("remoteControl.bot"):y==="wecom"?t("channel.wecom")+t("remoteControl.bot"):y,h=y=>`${v(y.clientType)} #${y.instanceId.slice(0,4)}`,m=r.filter(y=>y.clientType==="wechat"),u=r.filter(y=>y.clientType==="wecom"),f=r.filter(y=>y.clientType!=="wechat"&&y.clientType!=="wecom"),x=y=>{const S=`${y.clientType}:${y.instanceId}`,k=y.status==="connected",T=o==null?void 0:o.startsWith(S);return n.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-bg-secondary hover:bg-bg-hover transition-colors cursor-pointer",onClick:()=>{T||g(k?"stop":"start",y.clientType,y.instanceId)},children:[w(y.clientType),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"text-sm font-medium text-text-primary truncate",children:h(y)}),n.jsx("span",{className:`text-xs ${b(y.status)}`,children:_(y.status)})]}),n.jsxs("div",{className:"flex items-center gap-1",onClick:R=>R.stopPropagation(),children:[n.jsx("button",{className:`p-1.5 rounded-md text-text-tertiary transition-colors ${k?"hover:text-orange-500":"hover:text-green-500"} hover:bg-bg-hover`,title:t(k?"remoteControl.disconnect":"remoteControl.connect"),disabled:!!T,onClick:()=>g(k?"stop":"start",y.clientType,y.instanceId),children:k?n.jsx(Yc,{size:14}):n.jsx(Qm,{size:14})}),k&&n.jsx("button",{className:"p-1.5 rounded-md text-text-tertiary hover:text-orange-500 hover:bg-bg-hover transition-colors",title:t("remoteControl.unbind"),disabled:!!T,onClick:()=>g("unbind",y.clientType,y.instanceId),children:n.jsx(dt,{size:14})}),n.jsx("button",{className:"p-1.5 rounded-md text-text-tertiary hover:text-red-500 hover:bg-bg-hover transition-colors",title:t("remoteControl.delete"),disabled:!!T,onClick:()=>g("delete",y.clientType,y.instanceId),children:n.jsx(sn,{size:14})})]})]},S)},E=(y,S,k,T)=>n.jsxs("div",{children:[n.jsx("h2",{className:"text-sm font-medium text-text-secondary mb-2",children:y}),S.length===0?n.jsx("div",{className:"py-4 text-center text-xs text-text-tertiary",children:t("remoteControl.noChannels")}):n.jsx("div",{className:"space-y-2",children:S.map(x)}),k&&n.jsxs("button",{className:"flex items-center gap-1.5 mt-2 px-3 py-1.5 text-xs text-text-tertiary hover:text-text-primary hover:bg-bg-hover rounded-md transition-colors",onClick:k,children:[n.jsx(bt,{size:12}),T||t("remoteControl.add")]})]});return n.jsxs("div",{className:"flex flex-col h-full overflow-y-auto",children:[n.jsxs("div",{className:"px-6 py-5 border-b border-border-primary",children:[n.jsx("h1",{className:"text-lg font-semibold text-text-primary",children:t("remoteControl.title")}),n.jsx("p",{className:"text-sm text-text-tertiary mt-1",children:t("remoteControl.subtitle")})]}),n.jsxs("div",{className:"px-6 py-4 flex-1 space-y-6",children:[d&&n.jsx("div",{className:"p-3 rounded-lg bg-red-500/10 text-red-500 text-sm",children:d}),s?n.jsx("div",{className:"text-sm text-text-tertiary py-4",children:t("remoteControl.connecting")}):r.length===0?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"py-8 text-center",children:[n.jsx(Wr,{size:32,className:"mx-auto mb-3 text-text-tertiary opacity-50"}),n.jsx("p",{className:"text-sm text-text-tertiary",children:t("remoteControl.noChannels")}),n.jsx("p",{className:"text-xs text-text-tertiary mt-1",children:t("remoteControl.noChannelsHint")})]}),n.jsxs("div",{className:"flex gap-3",children:[n.jsxs("button",{className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-bg-secondary hover:bg-bg-hover text-sm text-text-primary transition-colors border border-border-primary",onClick:()=>rr("remote-control","add-wechat"),children:[n.jsx(bt,{size:14}),t("remoteControl.addWeChat")]}),n.jsxs("button",{className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-bg-secondary hover:bg-bg-hover text-sm text-text-primary transition-colors border border-border-primary",onClick:()=>rr("remote-control","add-wecom"),children:[n.jsx(bt,{size:14}),t("remoteControl.addWeCom")]})]})]}):n.jsxs(n.Fragment,{children:[E(t("channel.wechat")+t("remoteControl.bot"),m,()=>rr("remote-control","add-wechat"),t("remoteControl.addWeChat")),E(t("channel.wecom")+t("remoteControl.bot"),u,()=>rr("remote-control","add-wecom"),t("remoteControl.addWeCom")),f.length>0&&E(t("remoteControl.plugin"),f)]}),n.jsx("hr",{className:"border-border-primary"}),n.jsxs("div",{className:"flex items-center gap-4 p-4 rounded-lg bg-bg-secondary hover:bg-bg-hover cursor-pointer transition-colors border border-border-primary",onClick:()=>{e?e("plugins"):window.location.hash="#/plugins"},children:[n.jsxs("div",{className:"flex-1",children:[n.jsx("h3",{className:"text-sm font-medium text-text-primary",children:t("remoteControl.installMore")}),n.jsx("p",{className:"text-xs text-text-tertiary mt-1",children:t("remoteControl.installMoreHint")})]}),n.jsx(Ph,{size:16,className:"text-text-tertiary"})]})]})]})}function Qv({onBack:e,t,existingInstanceId:r}){const[i,s]=C.useState(null),[l,d]=C.useState(t("remoteControl.fetchingQr")),[a,o]=C.useState(r??null),[c,p]=C.useState(null),[g,b]=C.useState(!1);return C.useEffect(()=>{let _=!1;return(async()=>{try{let w=r;if(!w){const v=await ye("/api/v1/channels/wechat",{method:"POST"});if(!v.ok)throw new Error((await v.json().catch(()=>({}))).error||"Failed");const h=await v.json();if(_)return;w=h.instanceId,o(w)}for(let v=0;v<180&&!_;v++){await new Promise(h=>setTimeout(h,1e3));try{const h=await fetch(`/api/v1/channels/wechat/${w}/qr`);if(!h.ok)continue;const m=await h.json();if(_)return;if(m.qrUrl&&s(m.qrUrl),m.message&&d(m.message),m.type==="confirmed"){b(!0),d(t("remoteControl.connected")),setTimeout(()=>{_||e()},1500);return}if(m.type==="error"){p(m.message);return}}catch{}}!_&&!g&&p("Timeout")}catch(w){_||p((w==null?void 0:w.message)||"Failed")}})(),()=>{_=!0}},[r]),n.jsxs("div",{className:"flex flex-col h-full overflow-y-auto",children:[n.jsxs("div",{className:"px-6 py-5 border-b border-border-primary flex items-center gap-3",children:[n.jsx("button",{onClick:e,className:"p-1 rounded-md hover:bg-bg-hover transition-colors",children:n.jsx(gr,{size:18})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-lg font-semibold text-text-primary",children:t("remoteControl.addWeChat")}),n.jsx("p",{className:"text-sm text-text-tertiary",children:t("remoteControl.scanQr")})]})]}),n.jsx("div",{className:"flex-1 flex flex-col items-center justify-center px-6 py-8",children:c?n.jsxs("div",{className:"text-center space-y-4",children:[n.jsx("p",{className:"text-red-500",children:c}),n.jsx("button",{onClick:e,className:"px-4 py-2 rounded-lg bg-bg-secondary hover:bg-bg-hover text-sm border border-border-primary",children:t("remoteControl.cancel")})]}):i?n.jsxs("div",{className:"text-center space-y-4",children:[n.jsx("div",{className:"inline-block p-4 bg-white rounded-xl",children:n.jsx("img",{src:`https://api.qrserver.com/v1/create-qr-code/?size=240x240&data=${encodeURIComponent(i)}`,alt:"QR Code",className:"w-60 h-60"})}),n.jsx("p",{className:"text-sm text-text-secondary",children:l})]}):n.jsxs("div",{className:"text-center space-y-3",children:[n.jsx("div",{className:"w-8 h-8 mx-auto border-2 border-accent-brand border-t-transparent rounded-full animate-spin"}),n.jsx("p",{className:"text-sm text-text-tertiary",children:l})]})})]})}function eS({onBack:e,t}){const[r,i]=C.useState(""),[s,l]=C.useState(""),[d,a]=C.useState("botId"),[o,c]=C.useState(!1),[p,g]=C.useState(null),b=C.useCallback(async()=>{if(!(!r.trim()||!s.trim())){c(!0),g(null);try{const _=await ye("/api/v1/channels/wecom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({botId:r.trim(),secret:s.trim()})});if(!_.ok){const w=await _.json().catch(()=>({}));throw new Error(w.error||"Failed")}e()}catch(_){g((_==null?void 0:_.message)||"Failed")}finally{c(!1)}}},[r,s,e]);return n.jsxs("div",{className:"flex flex-col h-full overflow-y-auto",children:[n.jsxs("div",{className:"px-6 py-5 border-b border-border-primary flex items-center gap-3",children:[n.jsx("button",{onClick:e,className:"p-1 rounded-md hover:bg-bg-hover transition-colors",children:n.jsx(gr,{size:18})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-lg font-semibold text-text-primary",children:t("remoteControl.addWeCom")}),n.jsx("p",{className:"text-sm text-text-tertiary",children:t("remoteControl.wecomBotIdHint")})]})]}),n.jsxs("div",{className:"px-6 py-8 max-w-md mx-auto w-full space-y-6",children:[p&&n.jsx("div",{className:"p-3 rounded-lg bg-red-500/10 text-red-500 text-sm",children:p}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-sm font-medium text-text-primary",children:"Bot ID"}),n.jsx("input",{type:"text",className:"w-full px-3 py-2 rounded-lg bg-bg-secondary border border-border-primary text-sm text-text-primary placeholder-text-tertiary focus:outline-none focus:border-accent-brand transition-colors",placeholder:"Enter Bot ID",value:r,onChange:_=>i(_.target.value),autoFocus:!0,disabled:d==="secret",onKeyDown:_=>{_.key==="Enter"&&r.trim()&&a("secret")}})]}),d==="secret"&&n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-sm font-medium text-text-primary",children:"Secret"}),n.jsx("input",{type:"password",className:"w-full px-3 py-2 rounded-lg bg-bg-secondary border border-border-primary text-sm text-text-primary placeholder-text-tertiary focus:outline-none focus:border-accent-brand transition-colors",placeholder:"Enter Secret",value:s,onChange:_=>l(_.target.value),autoFocus:!0,onKeyDown:_=>{_.key==="Enter"&&s.trim()&&b()}}),n.jsx("p",{className:"text-xs text-text-tertiary",children:t("remoteControl.wecomSecretHint")})]}),n.jsxs("div",{className:"flex gap-3 pt-2",children:[d==="botId"?n.jsx("button",{className:"px-4 py-2 rounded-lg bg-accent-brand text-white text-sm hover:bg-accent-brand/90 transition-colors disabled:opacity-50",disabled:!r.trim(),onClick:()=>a("secret"),children:t("remoteControl.next")}):n.jsx("button",{className:"px-4 py-2 rounded-lg bg-accent-brand text-white text-sm hover:bg-accent-brand/90 transition-colors disabled:opacity-50",disabled:!s.trim()||o,onClick:b,children:t(o?"remoteControl.connecting":"remoteControl.connect")}),n.jsx("button",{className:"px-4 py-2 rounded-lg bg-bg-secondary border border-border-primary text-sm text-text-secondary hover:bg-bg-hover transition-colors",onClick:e,children:t("remoteControl.cancel")})]})]})]})}const tS="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23copilot-clip-34e811bed903495093b85bf96a98fb1b_0)'%3e%3crect%20width='24'%20height='24'%20rx='12'%20fill='%234C4F6B'%3e%3c/rect%3e%3cpath%20d='M3.4689%2011.0144C3.32344%2011.2025%203.31607%2011.4567%203.4345%2012.0298C3.65883%2013.0748%204.24029%2014.4426%205.15579%2016.0716L5.747%2017.1172L5.72862%2017.511C5.70544%2017.9326%205.72848%2018.5857%205.77921%2019.0271C5.80994%2019.2967%205.8055%2019.3035%205.66483%2019.4638C5.12042%2020.0864%205.03916%2021.1287%205.44787%2022.2839C5.62456%2022.7775%206.16958%2023.6999%206.50726%2024.0756C7.35392%2025.0154%208.35051%2025.4646%209.11147%2025.246C9.25446%2025.2051%209.28403%2025.213%209.47117%2025.3424C10.182%2025.8233%2011.3834%2026.2377%2012.4447%2026.3663C14.2242%2026.5843%2016.2727%2026.143%2018.8281%2024.9925C19.8948%2024.5099%2022.2541%2023.1352%2023.2513%2022.4096C25.1083%2021.0667%2026.4805%2019.6414%2027.251%2018.2635C27.9337%2017.0364%2028.2735%2015.7781%2028.2495%2014.5174C28.2466%2014.2525%2028.2536%2014.2359%2028.3599%2014.1746C28.8797%2013.8703%2029.1497%2013.198%2029.0927%2012.3562C29.075%2012.1165%2029.0266%2011.7946%2028.9902%2011.6448C28.7404%2010.7144%2028.0885%209.59971%2027.4078%208.94729C26.6515%208.22182%2025.7943%207.9129%2025.1958%208.14598C25.0631%208.19758%2025.0452%208.19542%2024.9177%208.08995C24.6357%207.86124%2023.9604%207.43473%2023.5488%207.22673L23.1224%207.01477L22.8206%206.45595C22.0392%205.01609%2020.7826%203.33003%2019.8801%202.50992C19.4937%202.15818%2019.2668%202.03929%2019.019%202.05739C18.866%202.06657%2018.8535%202.07379%2018.645%202.26084C18.0389%202.79819%2017.1889%204.41355%2016.3588%206.60463L16.1271%207.21325L15.7053%207.34845C14.3909%207.76995%2013.2238%208.30219%2012.1896%208.94928C11.1973%209.56799%2010.6591%209.97037%209.84886%2010.688L9.36087%2011.1197L9.13878%2011.0813C7.00072%2010.7039%205.07892%2010.5639%204.19776%2010.7186C3.84772%2010.7832%203.55743%2010.9008%203.4689%2011.0144Z'%20fill='%23D2D3E0'%3e%3c/path%3e%3crect%20x='6.68555'%20y='16.3788'%20width='17.7918'%20height='11.5605'%20rx='4.61469'%20transform='rotate(-30%206.68555%2016.3788)'%20fill='%23212234'%3e%3c/rect%3e%3cg%3e%3crect%20x='12.2119'%20y='17.2593'%20width='2.13173'%20height='4.42744'%20rx='1.06587'%20transform='rotate(-30%2012.2119%2017.2593)'%20fill='%23D2D3E0'%3e%3canimate%20attributeName='height'%20values='4.42744;2.2;4.42744;4.42744;2.2;4.42744'%20dur='0.6s'%20begin='0s;blink134e811bed903495093b85bf96a98fb1b_0.end+3s'%20id='blink134e811bed903495093b85bf96a98fb1b_0'%3e%3c/animate%3e%3canimate%20attributeName='y'%20values='17.2593;18.2593;17.2593;17.2593;18.2593;17.2593'%20dur='0.6s'%20begin='0s;blink134e811bed903495093b85bf96a98fb1b_0.end+3s'%3e%3c/animate%3e%3canimate%20attributeName='opacity'%20values='1;0.2;1;1;0.2;1'%20dur='0.6s'%20begin='0s;blink134e811bed903495093b85bf96a98fb1b_0.end+3s'%3e%3c/animate%3e%3c/rect%3e%3c/g%3e%3cg%3e%3crect%20x='17.9634'%20y='13.9387'%20width='2.13173'%20height='4.42744'%20rx='1.06587'%20transform='rotate(-30%2017.9634%2013.9387)'%20fill='%23D2D3E0'%3e%3canimate%20attributeName='height'%20values='4.42744;2.2;4.42744;4.42744;2.2;4.42744'%20dur='0.6s'%20begin='0s;blink234e811bed903495093b85bf96a98fb1b_0.end+3s'%20id='blink234e811bed903495093b85bf96a98fb1b_0'%3e%3c/animate%3e%3canimate%20attributeName='y'%20values='13.9387;14.9387;13.9387;13.9387;14.9387;13.9387'%20dur='0.6s'%20begin='0s;blink234e811bed903495093b85bf96a98fb1b_0.end+3s'%3e%3c/animate%3e%3canimate%20attributeName='opacity'%20values='1;0.2;1;1;0.2;1'%20dur='0.6s'%20begin='0s;blink234e811bed903495093b85bf96a98fb1b_0.end+3s'%3e%3c/animate%3e%3c/rect%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='copilot-clip-34e811bed903495093b85bf96a98fb1b_0'%3e%3crect%20width='24'%20height='24'%20rx='12'%20fill='white'%3e%3c/rect%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",rS="/assets/logo-iZVLr450.svg";function nS({isOpen:e,onClose:t,mainView:r,onNavigate:i}){const{t:s}=ne(),{userInfo:l}=mu(),d=zt(b=>b.info),a=zt(b=>b.fetch),o=ar(b=>b.fileChanges.length);C.useEffect(()=>{d||a()},[a,d]);const c=(l==null?void 0:l.userName)||(d==null?void 0:d.userName)||s("sidebar.user"),p=(d==null?void 0:d.version)||"",g=p&&p!=="dev"&&p!=="0.0.0"?`v${p}`:"";return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:`sidebar-overlay ${e?"":"sidebar-overlay-hidden"}`,onClick:t}),n.jsxs("aside",{className:`sidebar ${e?"":"sidebar-closed"}`,role:"navigation","aria-label":"Main navigation",children:[n.jsxs("div",{className:"sidebar-header",children:[n.jsx("img",{src:rS,alt:"CodeBuddy",className:"sidebar-logo"}),n.jsx("span",{className:"sidebar-brand",children:"CodeBuddy"}),n.jsx("div",{className:"flex-1"}),n.jsx("button",{onClick:t,className:"md:hidden w-7 h-7 flex items-center justify-center rounded-md text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors","aria-label":"Close sidebar",children:n.jsx(Ie,{size:16})})]}),n.jsxs("nav",{className:"sidebar-nav","aria-label":"Primary",children:[n.jsxs("button",{className:`sidebar-nav-item ${r==="chat"?"active":""}`,onClick:()=>i("chat"),"aria-current":r==="chat"?"page":void 0,children:[n.jsx(fr,{size:16}),n.jsx("span",{children:s("sidebar.chatMode")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="workers"?"active":""}`,onClick:()=>i("workers"),children:[n.jsx(Rt,{size:16}),n.jsx("span",{children:s("sidebar.workers")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="remote-control"?"active":""}`,onClick:()=>i("remote-control"),children:[n.jsx(Wr,{size:16}),n.jsx("span",{children:s("sidebar.remoteControl")})]})]}),n.jsx("div",{className:"sidebar-content",children:n.jsxs("div",{className:"px-3 py-1",children:[n.jsxs("button",{className:`sidebar-nav-item ${r==="tasks"?"active":""}`,onClick:()=>i("tasks"),children:[n.jsx(_i,{size:16}),n.jsx("span",{children:s("sidebar.nav.tasks")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="terminal"?"active":""}`,onClick:()=>i("terminal"),children:[n.jsx(nn,{size:16}),n.jsx("span",{children:s("sidebar.terminalMode")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="editor"?"active":""}`,onClick:()=>i("editor"),children:[n.jsx(Cu,{size:16}),n.jsx("span",{children:s("sidebar.editor")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="changes"?"active":""}`,onClick:()=>i("changes"),children:[n.jsx(rn,{size:16}),n.jsx("span",{children:s("sidebar.changes")}),o>0&&n.jsx("span",{className:"sidebar-badge",children:o})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="plugins"?"active":""}`,onClick:()=>i("plugins"),children:[n.jsx(Ct,{size:16}),n.jsx("span",{children:s("sidebar.nav.plugins")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="metrics"?"active":""}`,onClick:()=>i("metrics"),children:[n.jsx(gi,{size:16}),n.jsx("span",{children:s("sidebar.metrics")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="logs"?"active":""}`,onClick:()=>i("logs"),children:[n.jsx(bi,{size:16}),n.jsx("span",{children:s("sidebar.logs")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="settings"?"active":""}`,onClick:()=>i("settings"),children:[n.jsx(vi,{size:16}),n.jsx("span",{children:s("sidebar.preferences")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="keybindings"?"active":""}`,onClick:()=>i("keybindings"),children:[n.jsx(Ym,{size:16}),n.jsx("span",{children:s("sidebar.keybindings")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="docs"?"active":""}`,onClick:()=>i("docs"),children:[n.jsx(fi,{size:16}),n.jsx("span",{children:s("sidebar.docs")})]})]})}),n.jsx("div",{className:"sidebar-footer",children:n.jsxs("div",{className:"sidebar-user",children:[n.jsx("img",{src:tS,alt:"User",className:"sidebar-user-avatar"}),n.jsxs("div",{className:"sidebar-user-info",children:[n.jsx("div",{className:"sidebar-user-name",children:c}),n.jsx("div",{className:"sidebar-user-status",children:g})]})]})})]})]})}function iS({onMenuClick:e,onNewChat:t,onSplitTerminal:r,onHistory:i,hasHistory:s,rightActions:l}){const{t:d}=ne(),{topic:a,status:o,currentModel:c}=rt(),{mainView:p,layout:g,terminalTitle:b}=Te(),[_,w]=C.useState(!1),v=C.useRef(null),h=p==="terminal",u=Ht(g)<Wp;C.useEffect(()=>{if(!_)return;const S=k=>{v.current&&!v.current.contains(k.target)&&w(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[_]);const f=C.useCallback(S=>{w(!1),r==null||r(S)},[r]),x=()=>{switch(p){case"chat":return a||d("chat.newChat");case"terminal":return b||d("terminal.title");case"settings":return d("settings.title");case"tasks":return d("tasks.title");case"plugins":return d("sidebar.nav.plugins");case"workers":return d("workers.title");case"metrics":return d("sidebar.metrics");case"logs":return d("sidebar.logs");case"docs":return d("sidebar.docs");case"remote-control":return d("sidebar.remoteControl");case"keybindings":return d("keybindings.title");default:return""}},E=c?c.replace(/^(claude-|gpt-|deepseek-)/,"").split("-").slice(0,2).join("-"):"",y=()=>l||(h?n.jsxs("div",{ref:v,className:"relative",children:[n.jsx("button",{onClick:()=>u&&w(!_),className:`text-text-secondary transition-colors flex items-center justify-center w-8 h-8 rounded-full ${u?"hover:text-text-primary hover:bg-bg-secondary":"opacity-40 cursor-not-allowed"}`,title:u?void 0:d("terminal.maxPanes"),"aria-label":"Split terminal",children:n.jsx(Vc,{size:20})}),_&&n.jsxs("div",{className:"absolute right-0 top-full mt-1 bg-bg-secondary border border-border-muted rounded-lg shadow-lg py-1 z-50 min-w-[140px]",children:[n.jsxs("button",{onClick:()=>f("horizontal"),className:"w-full flex items-center gap-3 px-4 py-2.5 text-[13px] text-text-primary hover:bg-bg-hover transition-colors",children:[n.jsx(Vc,{size:16,className:"text-text-secondary"}),n.jsx("span",{children:d("terminal.splitHorizontal")})]}),n.jsxs("button",{onClick:()=>f("vertical"),className:"w-full flex items-center gap-3 px-4 py-2.5 text-[13px] text-text-primary hover:bg-bg-hover transition-colors",children:[n.jsx(jg,{size:16,className:"text-text-secondary"}),n.jsx("span",{children:d("terminal.splitVertical")})]})]})]}):p==="chat"?n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("button",{onClick:t,className:"text-text-secondary hover:text-text-primary transition-colors flex items-center justify-center w-8 h-8 rounded-full hover:bg-bg-secondary","aria-label":"New chat",children:n.jsx(bt,{size:20})}),s&&n.jsx("button",{onClick:i,className:"text-text-secondary hover:text-text-primary transition-colors flex items-center justify-center w-8 h-8 rounded-full hover:bg-bg-secondary",title:d("sidebar.chatHistory"),"aria-label":"Chat history",children:n.jsx(Nu,{size:18})})]}):null);return n.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-6 h-14 bg-bg-primary text-xs flex-shrink-0 transition-colors duration-200 sticky top-0 z-10",role:"banner","aria-label":"Status bar",children:[n.jsx("div",{className:"flex items-center gap-4",children:n.jsx("button",{onClick:e,className:"text-text-secondary hover:text-text-primary transition-colors flex items-center justify-center w-8 h-8 rounded-full hover:bg-bg-secondary","aria-label":"Toggle sidebar",children:n.jsx(xi,{size:20})})}),n.jsxs("div",{className:"flex-1 flex flex-col justify-center items-center min-w-0 px-2",children:[n.jsx("span",{className:"font-medium text-text-primary text-[15px] tracking-wide truncate max-w-full",children:x()}),p==="chat"&&(E||o==="connected")&&n.jsx("span",{className:"hidden sm:block text-[10px] text-text-tertiary mt-0.5 truncate max-w-[200px]",children:[o==="connected"?"":"disconnected",E].filter(Boolean).join(" · ")})]}),n.jsx("div",{className:"flex items-center",children:y()})]})}let Bn=1e5;function sS(e){if(!Array.isArray(e))return[];const t=[];let r=null;for(const i of e)if(i.sessionUpdate==="user_message_chunk"){r&&(t.push(r),r=null);const s=i.content,l=(s==null?void 0:s.text)||"";if(!l.trim())continue;t.push({type:"message",id:`member-msg-${++Bn}`,role:"user",content:l,timestamp:Date.now()})}else if(i.sessionUpdate==="agent_message_chunk"){const s=i.content;if((s==null?void 0:s.type)==="thinking")continue;const l=(s==null?void 0:s.text)||"";if(!l)continue;r?r={...r,content:r.content+l}:r={type:"message",id:`member-msg-${++Bn}`,role:"assistant",content:l,timestamp:Date.now()}}else if(i.sessionUpdate==="tool_call"){r&&(t.push(r),r=null);const l=(i._meta||{})["codebuddy.ai/toolName"]||"";t.push({type:"tool_call",id:i.toolCallId||`member-tc-${++Bn}`,name:i.title||l||i.kind||"tool",kind:i.kind||"other",toolName:l,input:i.rawInput||i.input,status:i.status==="completed"?"completed":i.status==="failed"?"failed":"running",locations:i.locations,content:i.content})}else if(i.sessionUpdate==="tool_call_update"){const s=t.findIndex(l=>l.type==="tool_call"&&l.id===i.toolCallId);if(s!==-1){const l=t[s];t[s]={...l,status:i.status==="completed"?"completed":i.status==="failed"?"failed":l.status,result:i.rawOutput||i.toolResult||l.result,...i.content!==void 0?{content:i.content}:{}}}}return r&&t.push(r),t}function aS(){var b;const e=He(_=>_.focusedMemberName),t=He(_=>_.memberHistories),r=He(_=>_.members),i=He(_=>_.setFocusedMember),s=C.useRef(null),l=r.find(_=>_.name===e),d=e&&t[e]||[],a=C.useMemo(()=>sS(d),[d]),o=C.useMemo(()=>wp(a),[a]);C.useEffect(()=>{s.current&&(s.current.scrollTop=s.current.scrollHeight)},[o]);const c=C.useCallback(()=>{i(null)},[i]),p=(l==null?void 0:l.status)==="running"||(l==null?void 0:l.status)==="pending",{t:g}=ne();return n.jsxs("div",{ref:s,className:"absolute inset-0 overflow-y-auto overflow-x-hidden",children:[n.jsx("div",{className:"sticky top-0 z-10 bg-bg-primary/95 backdrop-blur-sm border-b border-border-muted/30",children:n.jsxs("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 py-3 flex items-center gap-3",children:[n.jsx("button",{type:"button",onClick:c,className:"p-1.5 rounded-md hover:bg-bg-secondary text-text-tertiary hover:text-text-secondary transition-colors",title:g("team.backToMain"),children:n.jsx(gr,{size:16})}),n.jsx(Gn,{size:16,className:"text-accent-purple flex-shrink-0"}),n.jsxs("span",{className:"text-[14px] font-semibold text-accent-purple",children:["@",e]}),(l==null?void 0:l.description)&&n.jsx("span",{className:"text-[12px] text-text-tertiary truncate flex-1",children:l.description}),p&&n.jsx(_e,{size:14,className:"animate-spin text-accent-purple flex-shrink-0"}),n.jsx("div",{className:"flex-1"}),l&&n.jsxs("span",{className:"text-[11px] text-text-tertiary flex-shrink-0",children:[l.toolCallCount?g("team.tools").replace("{count}",String(l.toolCallCount)):"",(b=l.tokenUsage)!=null&&b.lastContextWindow?`${l.toolCallCount?" · ":""}${g("team.tokens").replace("{count}",String(Math.round(l.tokenUsage.lastContextWindow/1e3))+"k")}`:""]})]})}),n.jsx("div",{className:"px-4 sm:px-6 pt-4 pb-8",children:n.jsxs("div",{className:"max-w-3xl mx-auto flex flex-col",children:[p&&o.length===0?n.jsxs("div",{className:"flex items-center justify-center gap-2 py-20 text-text-tertiary text-[13px]",children:[n.jsx(_e,{size:16,className:"animate-spin"}),n.jsx("span",{children:g("team.loadingHistory")})]}):o.length===0?n.jsx("div",{className:"flex items-center justify-center py-20 text-text-tertiary text-[13px]",children:g("team.noHistory")}):o.map((_,w)=>{if(_.kind==="user"){const v=_.entry.content?Sp(_.entry.content):void 0;if(v)return v.from==="system"?null:n.jsx("div",{children:n.jsx(kp,{msg:v})},_.entry.id);let h=_.entry.content||"";return h=h.replace(/<system-reminder>[\s\S]*?<\/system-reminder>\s*/g,"").trim(),h?n.jsx("div",{className:"flex justify-end mb-6",children:n.jsx("div",{className:"max-w-[85%] sm:max-w-[75%] px-5 py-3 rounded-2xl rounded-tr-sm bg-bg-user border border-transparent",children:n.jsx("p",{className:"whitespace-pre-wrap break-words text-text-primary text-chat",children:h})})},_.entry.id):null}return _.kind==="assistant_message"?n.jsx("div",{className:"mb-6",children:n.jsx(Cc,{message:_.entry})},_.entry.id):_.kind==="assistant_tools"?n.jsx("div",{className:"mb-6",children:n.jsx(vp,{entries:_.entries})},`tools-${w}`):null}),p&&o.length>0&&n.jsxs("div",{className:"flex items-center gap-2 py-4 text-text-tertiary text-[12px]",children:[n.jsx(_e,{size:12,className:"animate-spin"}),n.jsx("span",{children:g("team.agentRunning")})]})]})})]})}let oS=0;const lS={info:5e3,success:5e3,warn:8e3,error:0},Ft=$e((e,t)=>({toasts:[],addToast:(r,i)=>{const s=`toast-${++oS}`,l={id:s,type:r,message:i,createdAt:Date.now()};e(a=>({toasts:[...a.toasts.slice(-2),l]}));const d=lS[r];d>0&&setTimeout(()=>{t().removeToast(s)},d)},removeToast:r=>{e(i=>({toasts:i.toasts.filter(s=>s.id!==r)}))},clearAll:()=>e({toasts:[]})})),lu={info:e=>Ft.getState().addToast("info",e),warn:e=>Ft.getState().addToast("warn",e),error:e=>Ft.getState().addToast("error",e),success:e=>Ft.getState().addToast("success",e)},cS={info:Vm,success:Zh,warn:lr,error:Gr},dS={info:"text-accent-blue",success:"text-accent-green",warn:"text-accent-yellow",error:"text-accent-red"};function uS({item:e}){const t=Ft(d=>d.removeToast),[r,i]=C.useState(!1),s=cS[e.type],l=()=>{i(!0),setTimeout(()=>t(e.id),200)};return n.jsxs("div",{role:"alert",className:["flex items-start gap-3 px-4 py-3 rounded-xl border border-border-default shadow-lg","bg-bg-card backdrop-blur-sm","max-w-[360px] min-w-[280px]","transition-all duration-200",r?"opacity-0 translate-x-4":"opacity-100 translate-x-0","animate-fadeIn"].join(" "),children:[n.jsx(s,{size:18,className:`${dS[e.type]} shrink-0 mt-0.5`}),n.jsx("p",{className:"flex-1 text-[13px] text-text-primary leading-[1.5] break-words",children:e.message}),n.jsx("button",{onClick:l,"aria-label":"Dismiss",className:"shrink-0 w-5 h-5 flex items-center justify-center rounded text-text-tertiary hover:text-text-primary transition-colors",children:n.jsx(Ie,{size:14})})]})}function pS(){const e=Ft(t=>t.toasts);return e.length===0?null:n.jsx("div",{className:"fixed bottom-6 right-6 z-[999] flex flex-col-reverse gap-2 pointer-events-auto max-md:bottom-20 max-md:right-4 max-md:left-4 max-md:items-stretch",children:e.map(t=>n.jsx(uS,{item:t},t.id))})}function hS(e,t){const r=[];for(const i of e)i.type==="tool_call"&&r.push(i);for(const i of t.values())r.push(i);return r}function mS(e,t){const r={};for(const i of e){const s=i.input||{},l=i.toolName;if(l==="TaskCreate"){const d=i.result,a=typeof d=="string"?d:d&&typeof d=="object"?String(d.text??d.output??""):"",o=!a&&Array.isArray(i.content)?i.content.reduce((b,_)=>{var w;return b||String(((w=_==null?void 0:_.content)==null?void 0:w.text)??(_==null?void 0:_.text)??"")},""):"",c=(a||o).match(/Task #(\d+)/),p=c?c[1]:`t-${Object.keys(r).length+1}`;let g=s.owner?String(s.owner):void 0;if(!g&&(t!=null&&t.length)){const b=s.subject?String(s.subject).toLowerCase():"",_=s.description?String(s.description).toLowerCase():"",w=b+" "+_;for(const v of t)if(w.includes(v.toLowerCase())){g=v;break}}r[p]={id:p,subject:s.subject?String(s.subject):"",status:"pending",owner:g,activeForm:s.activeForm?String(s.activeForm):void 0}}else if(l==="TaskUpdate"){const d=s.taskId?String(s.taskId):void 0;if(d&&r[d]){const a=r[d];s.status&&s.status!=="deleted"&&(a.status=String(s.status)),s.subject&&(a.subject=String(s.subject)),s.owner!==void 0&&(a.owner=s.owner?String(s.owner):void 0),s.activeForm&&(a.activeForm=String(s.activeForm)),s.status==="deleted"&&delete r[d]}}}return Object.values(r)}function gS(e){return e.filter(t=>t.toolName==="TaskCreate"||t.toolName==="TaskUpdate").length}function fS({status:e}){switch(e){case"completed":return n.jsx(vu,{size:14,className:"text-accent-green flex-shrink-0"});case"in_progress":return n.jsx(_e,{size:14,className:"text-accent-brand flex-shrink-0 animate-spin"});default:return n.jsx(nm,{size:14,className:"text-text-tertiary flex-shrink-0"})}}function bS({member:e,isFocused:t,onClick:r}){var o;const i=e.status==="running"||e.status==="pending",s=e.status==="failed"||e.status==="killed",l=$b(e.color),d=ki(e.color),a=[];return e.toolCallCount&&a.push(`${e.toolCallCount} tools`),(o=e.tokenUsage)!=null&&o.lastContextWindow&&a.push(`${(e.tokenUsage.lastContextWindow/1e3).toFixed(1)}k`),n.jsxs("button",{type:"button",onClick:r,className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[11px] transition-colors cursor-pointer ${t?`${l.bg}`:i?`${l.bg} hover:opacity-80`:s?"bg-accent-red/10 text-accent-red":"bg-bg-secondary/50 text-text-tertiary hover:bg-bg-secondary/70"}`,style:{color:t||i?d:void 0,...t?{boxShadow:`0 0 0 1px ${d}40`}:{}},children:[n.jsxs("span",{className:"font-medium",children:["@",e.name]}),a.length>0&&n.jsx("span",{className:"opacity-70",children:a.join(" · ")}),i&&n.jsx(_e,{size:9,className:"animate-spin flex-shrink-0"}),s&&n.jsx(Gr,{size:9,className:"flex-shrink-0"}),!i&&!s&&n.jsx(Tt,{size:9,className:"flex-shrink-0"})]})}function yS(){const e=Ze(I=>I.timeline),t=Ze(I=>I.childToolCalls),r=Ze(I=>I.isAgentRunning),{t:i}=ne(),[s,l]=C.useState(!0),d=He(I=>I.isInTeam),a=He(I=>I.members),o=He(I=>I.focusedMemberName),c=He(I=>I.setFocusedMember),p=C.useMemo(()=>{const I=new Map;for(const q of a)q.color&&I.set(q.name,q.color);return I},[a]),g=C.useRef(0),[b,_]=C.useState(!1),w=C.useRef(r),v=C.useMemo(()=>hS(e,t),[e,t]),h=C.useMemo(()=>a.map(I=>I.name),[a]),m=C.useMemo(()=>mS(v,h),[v,h]),u=C.useMemo(()=>gS(v),[v]);C.useEffect(()=>{!w.current&&r&&(g.current=u,_(!0)),w.current=r},[r,u]),C.useEffect(()=>{b&&u>g.current&&_(!1)},[b,u]);const f=C.useCallback(()=>l(I=>!I),[]),x=C.useCallback(I=>{I.stopPropagation(),g.current=u,_(!0)},[u]),E=C.useCallback(I=>{c(o===I?null:I)},[o,c]),y=C.useCallback(I=>{I.owner&&p.has(I.owner)&&c(o===I.owner?null:I.owner)},[o,p,c]),S=a.filter(I=>I.status==="running"||I.status==="pending"),k=S.length>0,T=!r&&k,R=d&&a.length>0,A=m.length>0,D=A&&m.every(I=>I.status==="completed"),L=R&&!k&&!r,B=A&&m.every(I=>I.status==="pending")&&!r&&!k,H=A&&!(D||L||B)&&!b,U=R&&(k||o);if(!H&&!U)return null;const F=m.filter(I=>I.status==="completed").length,N=m.length,O=m.find(I=>I.status==="in_progress"),$=O?O.activeForm||O.subject:`${F}/${N}`;return n.jsx("div",{className:"flex-none px-4 sm:px-6 pb-1",children:n.jsx("div",{className:"max-w-3xl mx-auto",children:n.jsxs("div",{className:"rounded-lg border border-border-muted/15 bg-bg-secondary/30 overflow-hidden",children:[n.jsxs("button",{onClick:f,className:"flex items-center gap-2 w-full px-3 py-1.5 hover:bg-bg-hover/30 transition-colors cursor-pointer",children:[T?n.jsx(_e,{size:13,className:"animate-spin text-accent-purple flex-shrink-0"}):U?n.jsx(Fu,{size:13,className:"text-accent-purple flex-shrink-0"}):n.jsx(Ru,{size:13,className:"text-text-tertiary flex-shrink-0"}),T?n.jsx("span",{className:"text-xs font-medium text-accent-purple",children:i("team.waitingForTeammates").replace("{count}",String(S.length)).replace("{s}",S.length>1?"s":"")}):n.jsxs(n.Fragment,{children:[H&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-xs font-medium text-text-primary",children:i("todo.title")}),n.jsxs("span",{className:"text-[11px] text-text-tertiary tabular-nums",children:[F,"/",N]})]}),U&&H&&n.jsx("span",{className:"text-border-muted/40",children:"·"}),U&&n.jsxs("span",{className:"text-[11px] text-text-tertiary",children:[i("team.title")," ",S.length>0?i("team.activeCount").replace("{count}",String(S.length)):""]})]}),!s&&H&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-border-muted/60 select-none",children:"|"}),O&&r&&n.jsx(_e,{size:10,className:"text-accent-brand animate-spin flex-shrink-0"}),n.jsx("span",{className:"text-xs text-text-secondary truncate flex-1 text-left",children:$})]}),n.jsx("span",{className:"flex-1"}),!r&&!T&&n.jsx("span",{role:"button",tabIndex:0,onClick:x,onKeyDown:I=>{I.key==="Enter"&&x(I)},className:"text-text-tertiary hover:text-text-primary p-0.5 rounded transition-colors flex-shrink-0",children:n.jsx(Ie,{size:12})}),s?n.jsx(it,{size:12,className:"text-text-tertiary flex-shrink-0"}):n.jsx(Oe,{size:12,className:"text-text-tertiary flex-shrink-0"})]}),s&&n.jsxs("div",{className:"border-t border-border-muted/40",children:[U&&n.jsx("div",{className:"flex flex-wrap gap-1.5 px-3 py-1.5",children:a.map(I=>n.jsx(bS,{member:I,isFocused:o===I.name,onClick:()=>E(I.name)},I.name))}),H&&n.jsx("div",{className:`px-3 py-1.5 space-y-0.5 max-h-52 overflow-y-auto ${U?"border-t border-border-muted/30":""}`,children:m.map((I,q)=>{const W=I.owner?p.get(I.owner):void 0,Y=!!W,V=W?ki(W):void 0;return n.jsxs("div",{onClick:Y?()=>y(I):void 0,className:`flex items-center gap-2 py-0.5 text-xs ${Y?"cursor-pointer hover:bg-bg-hover/30 rounded px-1 -mx-1":""} ${I.status==="in_progress"?"text-text-primary":I.status==="completed"?"text-text-tertiary":"text-text-secondary"}`,children:[n.jsx(fS,{status:I.status}),n.jsxs("span",{className:`truncate ${I.status==="completed"?"line-through":""}`,children:[q+1,". ",I.status==="in_progress"?I.activeForm||I.subject||i("todo.untitled"):I.subject||i("todo.untitled")]}),W&&n.jsxs("span",{className:"text-[10px] font-medium flex-shrink-0 ml-auto",style:{color:V},children:["@",I.owner]})]},I.id)})})]})]})})})}function _S({title:e,message:t,confirmLabel:r,cancelLabel:i,danger:s,onConfirm:l,onCancel:d}){const{t:a}=ne(),o=C.useRef(null);C.useEffect(()=>{var p;(p=o.current)==null||p.focus()},[]);const c=C.useCallback(p=>{p.key==="Escape"&&(p.preventDefault(),d())},[d]);return n.jsxs("div",{className:"fixed inset-0 z-[200] flex items-center justify-center",onKeyDown:c,children:[n.jsx("div",{className:"absolute inset-0 bg-black/30",onClick:d}),n.jsxs("div",{role:"alertdialog","aria-modal":"true","aria-labelledby":"confirm-title",className:"relative bg-bg-card border border-border-default rounded-xl shadow-2xl w-full max-w-[400px] mx-4 overflow-hidden",children:[n.jsxs("div",{className:"px-5 pt-5 pb-4",children:[s&&n.jsx("div",{className:"w-10 h-10 rounded-full bg-error-bg flex items-center justify-center mb-3",children:n.jsx(lr,{size:20,className:"text-accent-red"})}),n.jsx("h3",{id:"confirm-title",className:"text-text-primary text-[15px] font-semibold mb-1",children:e}),t&&n.jsx("p",{className:"text-text-secondary text-[13px] leading-relaxed",children:t})]}),n.jsxs("div",{className:"flex items-center justify-end gap-2 px-5 pb-4",children:[n.jsx("button",{onClick:d,className:"px-4 py-1.5 text-[13px] text-text-secondary hover:text-text-primary rounded-lg hover:bg-bg-hover transition-colors",children:i||a("app.cancel")}),n.jsx("button",{ref:o,onClick:l,className:["px-4 py-1.5 text-[13px] font-medium rounded-lg transition-colors",s?"bg-accent-red text-white hover:opacity-90":"bg-accent-brand text-bg-primary hover:opacity-90"].join(" "),children:r||a("app.confirm")})]})]})]})}const xS=1e4;function vS(){const{t:e}=ne(),{workers:t,daemon:r,loading:i,error:s,fetchWorkers:l,fetchDaemonStatus:d,killWorker:a,startDaemon:o,stopDaemon:c,restartDaemon:p}=Lc();C.useEffect(()=>{l(),d();const m=setInterval(()=>{l(),d()},xS);return()=>clearInterval(m)},[l,d]);const g=C.useCallback(()=>{l(),d()},[l,d]),b=C.useCallback(m=>{window.location.hash=`#/logs?worker=${m.pid}`},[]),[_,w]=C.useState(null),v=C.useCallback(async m=>{w(m)},[]),h=C.useCallback(async()=>{_&&(await a(String(_.pid)),w(null))},[_,a]);return n.jsxs("div",{className:"flex-1 overflow-auto p-4 md:p-6",children:[_&&n.jsx(_S,{title:e("workers.action.kill.confirm"),danger:!0,onConfirm:h,onCancel:()=>w(null)}),n.jsxs("div",{className:"flex items-center justify-between mb-6",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Rt,{size:20,className:"text-accent-brand"}),n.jsx("h1",{className:"text-lg font-semibold text-text-primary",children:e("workers.title")})]}),n.jsxs("button",{onClick:g,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm text-text-secondary
|
|
612
|
-
hover:text-text-primary hover:bg-bg-hover rounded-lg transition-colors`,title:e("workers.refresh"),children:[n.jsx(dt,{size:14,className:i?"animate-spin":""}),n.jsx("span",{children:e("workers.refresh")})]})]}),s&&n.jsx("div",{className:"mb-4 p-3 rounded-xl error-banner text-sm",children:s}),n.jsx(
|
|
611
|
+
hover:text-text-primary hover:bg-bg-hover rounded-lg transition-colors`,title:e("metrics.refresh"),children:[n.jsx(dt,{size:14}),n.jsx("span",{children:e("metrics.refresh")})]})]}),t&&n.jsxs(n.Fragment,{children:[n.jsx(Kv,{metrics:t}),n.jsx(Yv,{workers:c})]})]})}function Vv(e,t){return e.map(r=>{const i=t.find(s=>s.pid===r.pid);return{...r,kind:i==null?void 0:i.kind,name:i==null?void 0:i.name,url:(i==null?void 0:i.url)||(i==null?void 0:i.endpoint),status:i==null?void 0:i.status}})}function Kv({metrics:e}){const{t}=ne(),r=e.memTotalMib>0?e.memUsedMib/e.memTotalMib*100:0,i=e.diskTotal>0?e.diskUsed/e.diskTotal*100:0;return n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-6",children:[n.jsx(Fn,{icon:n.jsx(Rt,{size:18}),label:t("metrics.cpu"),value:`${e.cpuUsedPct.toFixed(1)}%`,subtext:`${e.cpuCount} ${t("metrics.cores")}`,percent:e.cpuUsedPct,colorClasses:zr(e.cpuUsedPct)}),n.jsx(Fn,{icon:n.jsx(qn,{size:18}),label:t("metrics.memory"),value:`${su(e.memUsedMib)} / ${su(e.memTotalMib)}`,subtext:`${r.toFixed(1)}%`,percent:r,colorClasses:zr(r)}),n.jsx(Fn,{icon:n.jsx(Fm,{size:18}),label:t("metrics.disk"),value:`${au(e.diskUsed)} / ${au(e.diskTotal)}`,subtext:`${i.toFixed(1)}%`,percent:i,colorClasses:zr(i)})]})}function Fn({icon:e,label:t,value:r,subtext:i,percent:s,colorClasses:l}){const[d,a]=l;return n.jsxs("div",{className:"bg-bg-secondary rounded-xl p-4 border border-border-primary",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsx("span",{className:d,children:e}),n.jsx("span",{className:"text-sm font-medium text-text-secondary",children:t})]}),n.jsx("div",{className:"text-xl font-semibold text-text-primary mb-1",children:r}),n.jsx("div",{className:"text-xs text-text-tertiary mb-3",children:i}),n.jsx("div",{className:"h-2 bg-bg-tertiary rounded-full overflow-hidden",children:n.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${a}`,style:{width:`${Math.min(s,100)}%`}})})]})}function Yv({workers:e}){const{t}=ne();return e.length===0?n.jsx("div",{className:"text-center py-12 text-text-tertiary",children:t("metrics.noWorkers")}):n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[n.jsx(Rt,{size:18,className:"text-text-secondary"}),n.jsxs("h2",{className:"text-base font-medium text-text-primary",children:["Workers (",e.length,")"]})]}),n.jsx("div",{className:"space-y-3",children:e.map(r=>n.jsx(Xv,{worker:r},r.id))})]})}function Xv({worker:e}){const{t}=ne();return n.jsx("div",{className:`bg-bg-secondary rounded-xl p-4 md:p-5 border transition-colors hover:border-gray-300 dark:hover:border-gray-600 border-border-primary ${e.error?"opacity-60":""}`,children:n.jsxs("div",{className:"flex flex-col gap-4",children:[n.jsxs("div",{className:"flex items-start justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("span",{className:`inline-block w-2 h-2 rounded-full ${e.error?"bg-red-400":"bg-green-400"}`}),e.kind&&n.jsx("span",{className:`inline-block px-2.5 py-0.5 text-xs font-medium rounded-md ${Wv[e.kind]||"bg-gray-100 text-gray-600"}`,children:e.kind}),n.jsx("span",{className:"text-sm font-medium text-text-primary",children:e.name||e.hostname}),e.isCurrent&&n.jsx("span",{className:"text-[10px] uppercase font-bold tracking-wider px-1.5 py-0.5 bg-accent-brand/10 text-accent-brand rounded",children:t("metrics.current")}),e.error&&n.jsx("span",{className:"text-xs text-red-400",children:e.error})]}),n.jsxs("span",{className:"text-xs text-text-tertiary font-mono bg-bg-tertiary px-2 py-0.5 rounded-md border border-border-primary/50",children:["PID ",e.pid]})]}),n.jsxs("div",{className:"flex flex-col md:flex-row md:items-start justify-between gap-4 md:gap-6",children:[n.jsxs("div",{className:"flex flex-col gap-2.5 flex-1 min-w-0",children:[n.jsx(_t,{path:e.cwd,className:"text-[13px] text-text-secondary font-mono truncate max-w-full"}),e.url&&n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(ct,{size:14,className:"text-text-tertiary flex-none"}),n.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-accent-brand hover:underline truncate",children:e.url})]})]}),e.rssMib>0||e.heapUsedMib>0?n.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 flex-none",style:{minWidth:"460px"},children:[n.jsxs("div",{className:"min-w-[100px]",children:[n.jsx(Dt,{icon:n.jsx(qn,{size:14}),label:"RSS",value:`${e.rssMib.toFixed(0)} MiB`}),n.jsx("div",{className:"mt-1.5 h-1.5 bg-bg-tertiary rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full rounded-full bg-blue-500 transition-all duration-500",style:{width:`${Math.min(e.rssMib/2048*100,100)}%`}})})]}),n.jsxs("div",{className:"min-w-[140px]",children:[n.jsx(Dt,{icon:n.jsx(qn,{size:14}),label:"Heap",value:`${e.heapUsedMib.toFixed(0)} / ${e.heapTotalMib.toFixed(0)} MiB`}),e.heapTotalMib>0&&n.jsx("div",{className:"mt-1.5 h-1.5 bg-bg-tertiary rounded-full overflow-hidden",children:n.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${zr(e.heapUsedMib/e.heapTotalMib*100)[1]}`,style:{width:`${Math.min(e.heapUsedMib/e.heapTotalMib*100,100)}%`}})})]}),n.jsx("div",{className:"min-w-[80px]",children:n.jsx(Dt,{icon:n.jsx(pr,{size:14}),label:t("metrics.uptime"),value:ou(e.uptimeSeconds)})}),n.jsx("div",{className:"min-w-[60px]",children:n.jsx(Dt,{icon:n.jsx(qr,{size:14}),label:t("metrics.version"),value:e.version||"-"})})]}):n.jsxs("div",{className:"grid grid-cols-2 gap-4 flex-none",style:{minWidth:"200px"},children:[n.jsx("div",{className:"min-w-[80px]",children:n.jsx(Dt,{icon:n.jsx(pr,{size:14}),label:t("metrics.uptime"),value:ou(e.uptimeSeconds)})}),n.jsx("div",{className:"min-w-[60px]",children:n.jsx(Dt,{icon:n.jsx(qr,{size:14}),label:t("metrics.version"),value:e.version||"-"})})]})]})]})})}function Dt({icon:e,label:t,value:r}){return n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsxs("div",{className:"flex items-center gap-1.5 text-text-tertiary",children:[e,n.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wider",children:t})]}),n.jsx("div",{className:"text-sm font-semibold text-text-primary",style:{fontVariantNumeric:"tabular-nums"},children:r})]})}function zr(e){return e>=90?["text-red-500","bg-red-500"]:e>=70?["text-amber-500","bg-amber-500"]:["text-green-500","bg-green-500"]}function su(e){return e>=1024?`${(e/1024).toFixed(1)} GiB`:`${e} MiB`}function au(e){if(e===0)return"0 B";const t=e/(1024*1024*1024);return t>=1?`${t.toFixed(1)} GB`:`${(e/(1024*1024)).toFixed(0)} MB`}function ou(e){if(e<60)return`${e}s`;if(e<3600)return`${Math.floor(e/60)}m ${e%60}s`;const t=Math.floor(e/3600),r=Math.floor(e%3600/60);return t>=24?`${Math.floor(t/24)}d ${t%24}h`:`${t}h ${r}m`}function Zv({onNavigate:e}){const{t}=ne(),[r,i]=C.useState(Xr);if(C.useEffect(()=>{const s=()=>i(Xr());return window.addEventListener("hashchange",s),()=>window.removeEventListener("hashchange",s)},[]),r==="add-wechat"||r!=null&&r.startsWith("rebind-wechat/")){const s=r!=null&&r.startsWith("rebind-wechat/")?r.split("/")[1]:void 0;return n.jsx(Qv,{onBack:()=>bd("remote-control"),t,existingInstanceId:s})}return r==="add-wecom"?n.jsx(eS,{onBack:()=>bd("remote-control"),t}):n.jsx(Jv,{onNavigate:e,t})}function Jv({onNavigate:e,t}){const[r,i]=C.useState([]),[s,l]=C.useState(!0),[d,a]=C.useState(null),[o,c]=C.useState(null),p=C.useCallback(async()=>{try{const y=await ye("/api/v1/channels");if(y.ok){const S=await y.json();i((S.clients||[]).filter(k=>!k.hidden&&!k.instanceId.startsWith("_pending")))}}catch{}finally{l(!1)}},[]);C.useEffect(()=>{p();const y=setInterval(p,5e3);return()=>clearInterval(y)},[p]);const g=C.useCallback(async(y,S,k)=>{const T=`${S}:${k}:${y}`;c(T),a(null);try{const R=y==="delete"?"DELETE":"POST",A=y==="delete"?`/api/v1/channels/${S}/${k}`:`/api/v1/channels/${S}/${k}/${y}`,D=await ye(A,{method:R});if(!D.ok){const B=await D.json().catch(()=>({}));throw new Error(B.error||`Failed: ${D.status}`)}const L=await D.json().catch(()=>({}));if(y==="unbind"&&S==="wechat"&&L.needsQrScan){rr("remote-control",`rebind-wechat/${k}`);return}await p()}catch(R){a((R==null?void 0:R.message)||"Action failed")}finally{c(null)}},[p]),b=y=>y==="connected"?"text-green-500":y==="connecting"?"text-yellow-500":y==="error"?"text-red-500":"text-text-tertiary",_=y=>t(y==="connected"?"remoteControl.connected":y==="connecting"?"remoteControl.connecting":"remoteControl.disconnected"),w=y=>y==="wechat"?n.jsx(Lu,{size:18,className:"text-green-500"}):y==="wecom"?n.jsx(Wr,{size:18,className:"text-accent-brand"}):n.jsx(Yc,{size:18,className:"text-text-tertiary"}),v=y=>y==="wechat"?t("channel.wechat")+t("remoteControl.bot"):y==="wecom"?t("channel.wecom")+t("remoteControl.bot"):y,h=y=>`${v(y.clientType)} #${y.instanceId.slice(0,4)}`,m=r.filter(y=>y.clientType==="wechat"),u=r.filter(y=>y.clientType==="wecom"),f=r.filter(y=>y.clientType!=="wechat"&&y.clientType!=="wecom"),x=y=>{const S=`${y.clientType}:${y.instanceId}`,k=y.status==="connected",T=o==null?void 0:o.startsWith(S);return n.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-bg-secondary hover:bg-bg-hover transition-colors cursor-pointer",onClick:()=>{T||g(k?"stop":"start",y.clientType,y.instanceId)},children:[w(y.clientType),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"text-sm font-medium text-text-primary truncate",children:h(y)}),n.jsx("span",{className:`text-xs ${b(y.status)}`,children:_(y.status)})]}),n.jsxs("div",{className:"flex items-center gap-1",onClick:R=>R.stopPropagation(),children:[n.jsx("button",{className:`p-1.5 rounded-md text-text-tertiary transition-colors ${k?"hover:text-orange-500":"hover:text-green-500"} hover:bg-bg-hover`,title:t(k?"remoteControl.disconnect":"remoteControl.connect"),disabled:!!T,onClick:()=>g(k?"stop":"start",y.clientType,y.instanceId),children:k?n.jsx(Yc,{size:14}):n.jsx(eg,{size:14})}),k&&n.jsx("button",{className:"p-1.5 rounded-md text-text-tertiary hover:text-orange-500 hover:bg-bg-hover transition-colors",title:t("remoteControl.unbind"),disabled:!!T,onClick:()=>g("unbind",y.clientType,y.instanceId),children:n.jsx(dt,{size:14})}),n.jsx("button",{className:"p-1.5 rounded-md text-text-tertiary hover:text-red-500 hover:bg-bg-hover transition-colors",title:t("remoteControl.delete"),disabled:!!T,onClick:()=>g("delete",y.clientType,y.instanceId),children:n.jsx(sn,{size:14})})]})]},S)},E=(y,S,k,T)=>n.jsxs("div",{children:[n.jsx("h2",{className:"text-sm font-medium text-text-secondary mb-2",children:y}),S.length===0?n.jsx("div",{className:"py-4 text-center text-xs text-text-tertiary",children:t("remoteControl.noChannels")}):n.jsx("div",{className:"space-y-2",children:S.map(x)}),k&&n.jsxs("button",{className:"flex items-center gap-1.5 mt-2 px-3 py-1.5 text-xs text-text-tertiary hover:text-text-primary hover:bg-bg-hover rounded-md transition-colors",onClick:k,children:[n.jsx(bt,{size:12}),T||t("remoteControl.add")]})]});return n.jsxs("div",{className:"flex flex-col h-full overflow-y-auto",children:[n.jsxs("div",{className:"px-6 py-5 border-b border-border-primary",children:[n.jsx("h1",{className:"text-lg font-semibold text-text-primary",children:t("remoteControl.title")}),n.jsx("p",{className:"text-sm text-text-tertiary mt-1",children:t("remoteControl.subtitle")})]}),n.jsxs("div",{className:"px-6 py-4 flex-1 space-y-6",children:[d&&n.jsx("div",{className:"p-3 rounded-lg bg-red-500/10 text-red-500 text-sm",children:d}),s?n.jsx("div",{className:"text-sm text-text-tertiary py-4",children:t("remoteControl.connecting")}):r.length===0?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"py-8 text-center",children:[n.jsx(Wr,{size:32,className:"mx-auto mb-3 text-text-tertiary opacity-50"}),n.jsx("p",{className:"text-sm text-text-tertiary",children:t("remoteControl.noChannels")}),n.jsx("p",{className:"text-xs text-text-tertiary mt-1",children:t("remoteControl.noChannelsHint")})]}),n.jsxs("div",{className:"flex gap-3",children:[n.jsxs("button",{className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-bg-secondary hover:bg-bg-hover text-sm text-text-primary transition-colors border border-border-primary",onClick:()=>rr("remote-control","add-wechat"),children:[n.jsx(bt,{size:14}),t("remoteControl.addWeChat")]}),n.jsxs("button",{className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-bg-secondary hover:bg-bg-hover text-sm text-text-primary transition-colors border border-border-primary",onClick:()=>rr("remote-control","add-wecom"),children:[n.jsx(bt,{size:14}),t("remoteControl.addWeCom")]})]})]}):n.jsxs(n.Fragment,{children:[E(t("channel.wechat")+t("remoteControl.bot"),m,()=>rr("remote-control","add-wechat"),t("remoteControl.addWeChat")),E(t("channel.wecom")+t("remoteControl.bot"),u,()=>rr("remote-control","add-wecom"),t("remoteControl.addWeCom")),f.length>0&&E(t("remoteControl.plugin"),f)]}),n.jsx("hr",{className:"border-border-primary"}),n.jsxs("div",{className:"flex items-center gap-4 p-4 rounded-lg bg-bg-secondary hover:bg-bg-hover cursor-pointer transition-colors border border-border-primary",onClick:()=>{e?e("plugins"):window.location.hash="#/plugins"},children:[n.jsxs("div",{className:"flex-1",children:[n.jsx("h3",{className:"text-sm font-medium text-text-primary",children:t("remoteControl.installMore")}),n.jsx("p",{className:"text-xs text-text-tertiary mt-1",children:t("remoteControl.installMoreHint")})]}),n.jsx(Ph,{size:16,className:"text-text-tertiary"})]})]})]})}function Qv({onBack:e,t,existingInstanceId:r}){const[i,s]=C.useState(null),[l,d]=C.useState(t("remoteControl.fetchingQr")),[a,o]=C.useState(r??null),[c,p]=C.useState(null),[g,b]=C.useState(!1);return C.useEffect(()=>{let _=!1;return(async()=>{try{let w=r;if(!w){const v=await ye("/api/v1/channels/wechat",{method:"POST"});if(!v.ok)throw new Error((await v.json().catch(()=>({}))).error||"Failed");const h=await v.json();if(_)return;w=h.instanceId,o(w)}for(let v=0;v<180&&!_;v++){await new Promise(h=>setTimeout(h,1e3));try{const h=await fetch(`/api/v1/channels/wechat/${w}/qr`);if(!h.ok)continue;const m=await h.json();if(_)return;if(m.qrUrl&&s(m.qrUrl),m.message&&d(m.message),m.type==="confirmed"){b(!0),d(t("remoteControl.connected")),setTimeout(()=>{_||e()},1500);return}if(m.type==="error"){p(m.message);return}}catch{}}!_&&!g&&p("Timeout")}catch(w){_||p((w==null?void 0:w.message)||"Failed")}})(),()=>{_=!0}},[r]),n.jsxs("div",{className:"flex flex-col h-full overflow-y-auto",children:[n.jsxs("div",{className:"px-6 py-5 border-b border-border-primary flex items-center gap-3",children:[n.jsx("button",{onClick:e,className:"p-1 rounded-md hover:bg-bg-hover transition-colors",children:n.jsx(gr,{size:18})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-lg font-semibold text-text-primary",children:t("remoteControl.addWeChat")}),n.jsx("p",{className:"text-sm text-text-tertiary",children:t("remoteControl.scanQr")})]})]}),n.jsx("div",{className:"flex-1 flex flex-col items-center justify-center px-6 py-8",children:c?n.jsxs("div",{className:"text-center space-y-4",children:[n.jsx("p",{className:"text-red-500",children:c}),n.jsx("button",{onClick:e,className:"px-4 py-2 rounded-lg bg-bg-secondary hover:bg-bg-hover text-sm border border-border-primary",children:t("remoteControl.cancel")})]}):i?n.jsxs("div",{className:"text-center space-y-4",children:[n.jsx("div",{className:"inline-block p-4 bg-white rounded-xl",children:n.jsx("img",{src:`https://api.qrserver.com/v1/create-qr-code/?size=240x240&data=${encodeURIComponent(i)}`,alt:"QR Code",className:"w-60 h-60"})}),n.jsx("p",{className:"text-sm text-text-secondary",children:l})]}):n.jsxs("div",{className:"text-center space-y-3",children:[n.jsx("div",{className:"w-8 h-8 mx-auto border-2 border-accent-brand border-t-transparent rounded-full animate-spin"}),n.jsx("p",{className:"text-sm text-text-tertiary",children:l})]})})]})}function eS({onBack:e,t}){const[r,i]=C.useState(""),[s,l]=C.useState(""),[d,a]=C.useState("botId"),[o,c]=C.useState(!1),[p,g]=C.useState(null),b=C.useCallback(async()=>{if(!(!r.trim()||!s.trim())){c(!0),g(null);try{const _=await ye("/api/v1/channels/wecom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({botId:r.trim(),secret:s.trim()})});if(!_.ok){const w=await _.json().catch(()=>({}));throw new Error(w.error||"Failed")}e()}catch(_){g((_==null?void 0:_.message)||"Failed")}finally{c(!1)}}},[r,s,e]);return n.jsxs("div",{className:"flex flex-col h-full overflow-y-auto",children:[n.jsxs("div",{className:"px-6 py-5 border-b border-border-primary flex items-center gap-3",children:[n.jsx("button",{onClick:e,className:"p-1 rounded-md hover:bg-bg-hover transition-colors",children:n.jsx(gr,{size:18})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-lg font-semibold text-text-primary",children:t("remoteControl.addWeCom")}),n.jsx("p",{className:"text-sm text-text-tertiary",children:t("remoteControl.wecomBotIdHint")})]})]}),n.jsxs("div",{className:"px-6 py-8 max-w-md mx-auto w-full space-y-6",children:[p&&n.jsx("div",{className:"p-3 rounded-lg bg-red-500/10 text-red-500 text-sm",children:p}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-sm font-medium text-text-primary",children:"Bot ID"}),n.jsx("input",{type:"text",className:"w-full px-3 py-2 rounded-lg bg-bg-secondary border border-border-primary text-sm text-text-primary placeholder-text-tertiary focus:outline-none focus:border-accent-brand transition-colors",placeholder:"Enter Bot ID",value:r,onChange:_=>i(_.target.value),autoFocus:!0,disabled:d==="secret",onKeyDown:_=>{_.key==="Enter"&&r.trim()&&a("secret")}})]}),d==="secret"&&n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-sm font-medium text-text-primary",children:"Secret"}),n.jsx("input",{type:"password",className:"w-full px-3 py-2 rounded-lg bg-bg-secondary border border-border-primary text-sm text-text-primary placeholder-text-tertiary focus:outline-none focus:border-accent-brand transition-colors",placeholder:"Enter Secret",value:s,onChange:_=>l(_.target.value),autoFocus:!0,onKeyDown:_=>{_.key==="Enter"&&s.trim()&&b()}}),n.jsx("p",{className:"text-xs text-text-tertiary",children:t("remoteControl.wecomSecretHint")})]}),n.jsxs("div",{className:"flex gap-3 pt-2",children:[d==="botId"?n.jsx("button",{className:"px-4 py-2 rounded-lg bg-accent-brand text-white text-sm hover:bg-accent-brand/90 transition-colors disabled:opacity-50",disabled:!r.trim(),onClick:()=>a("secret"),children:t("remoteControl.next")}):n.jsx("button",{className:"px-4 py-2 rounded-lg bg-accent-brand text-white text-sm hover:bg-accent-brand/90 transition-colors disabled:opacity-50",disabled:!s.trim()||o,onClick:b,children:t(o?"remoteControl.connecting":"remoteControl.connect")}),n.jsx("button",{className:"px-4 py-2 rounded-lg bg-bg-secondary border border-border-primary text-sm text-text-secondary hover:bg-bg-hover transition-colors",onClick:e,children:t("remoteControl.cancel")})]})]})]})}const tS="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23copilot-clip-34e811bed903495093b85bf96a98fb1b_0)'%3e%3crect%20width='24'%20height='24'%20rx='12'%20fill='%234C4F6B'%3e%3c/rect%3e%3cpath%20d='M3.4689%2011.0144C3.32344%2011.2025%203.31607%2011.4567%203.4345%2012.0298C3.65883%2013.0748%204.24029%2014.4426%205.15579%2016.0716L5.747%2017.1172L5.72862%2017.511C5.70544%2017.9326%205.72848%2018.5857%205.77921%2019.0271C5.80994%2019.2967%205.8055%2019.3035%205.66483%2019.4638C5.12042%2020.0864%205.03916%2021.1287%205.44787%2022.2839C5.62456%2022.7775%206.16958%2023.6999%206.50726%2024.0756C7.35392%2025.0154%208.35051%2025.4646%209.11147%2025.246C9.25446%2025.2051%209.28403%2025.213%209.47117%2025.3424C10.182%2025.8233%2011.3834%2026.2377%2012.4447%2026.3663C14.2242%2026.5843%2016.2727%2026.143%2018.8281%2024.9925C19.8948%2024.5099%2022.2541%2023.1352%2023.2513%2022.4096C25.1083%2021.0667%2026.4805%2019.6414%2027.251%2018.2635C27.9337%2017.0364%2028.2735%2015.7781%2028.2495%2014.5174C28.2466%2014.2525%2028.2536%2014.2359%2028.3599%2014.1746C28.8797%2013.8703%2029.1497%2013.198%2029.0927%2012.3562C29.075%2012.1165%2029.0266%2011.7946%2028.9902%2011.6448C28.7404%2010.7144%2028.0885%209.59971%2027.4078%208.94729C26.6515%208.22182%2025.7943%207.9129%2025.1958%208.14598C25.0631%208.19758%2025.0452%208.19542%2024.9177%208.08995C24.6357%207.86124%2023.9604%207.43473%2023.5488%207.22673L23.1224%207.01477L22.8206%206.45595C22.0392%205.01609%2020.7826%203.33003%2019.8801%202.50992C19.4937%202.15818%2019.2668%202.03929%2019.019%202.05739C18.866%202.06657%2018.8535%202.07379%2018.645%202.26084C18.0389%202.79819%2017.1889%204.41355%2016.3588%206.60463L16.1271%207.21325L15.7053%207.34845C14.3909%207.76995%2013.2238%208.30219%2012.1896%208.94928C11.1973%209.56799%2010.6591%209.97037%209.84886%2010.688L9.36087%2011.1197L9.13878%2011.0813C7.00072%2010.7039%205.07892%2010.5639%204.19776%2010.7186C3.84772%2010.7832%203.55743%2010.9008%203.4689%2011.0144Z'%20fill='%23D2D3E0'%3e%3c/path%3e%3crect%20x='6.68555'%20y='16.3788'%20width='17.7918'%20height='11.5605'%20rx='4.61469'%20transform='rotate(-30%206.68555%2016.3788)'%20fill='%23212234'%3e%3c/rect%3e%3cg%3e%3crect%20x='12.2119'%20y='17.2593'%20width='2.13173'%20height='4.42744'%20rx='1.06587'%20transform='rotate(-30%2012.2119%2017.2593)'%20fill='%23D2D3E0'%3e%3canimate%20attributeName='height'%20values='4.42744;2.2;4.42744;4.42744;2.2;4.42744'%20dur='0.6s'%20begin='0s;blink134e811bed903495093b85bf96a98fb1b_0.end+3s'%20id='blink134e811bed903495093b85bf96a98fb1b_0'%3e%3c/animate%3e%3canimate%20attributeName='y'%20values='17.2593;18.2593;17.2593;17.2593;18.2593;17.2593'%20dur='0.6s'%20begin='0s;blink134e811bed903495093b85bf96a98fb1b_0.end+3s'%3e%3c/animate%3e%3canimate%20attributeName='opacity'%20values='1;0.2;1;1;0.2;1'%20dur='0.6s'%20begin='0s;blink134e811bed903495093b85bf96a98fb1b_0.end+3s'%3e%3c/animate%3e%3c/rect%3e%3c/g%3e%3cg%3e%3crect%20x='17.9634'%20y='13.9387'%20width='2.13173'%20height='4.42744'%20rx='1.06587'%20transform='rotate(-30%2017.9634%2013.9387)'%20fill='%23D2D3E0'%3e%3canimate%20attributeName='height'%20values='4.42744;2.2;4.42744;4.42744;2.2;4.42744'%20dur='0.6s'%20begin='0s;blink234e811bed903495093b85bf96a98fb1b_0.end+3s'%20id='blink234e811bed903495093b85bf96a98fb1b_0'%3e%3c/animate%3e%3canimate%20attributeName='y'%20values='13.9387;14.9387;13.9387;13.9387;14.9387;13.9387'%20dur='0.6s'%20begin='0s;blink234e811bed903495093b85bf96a98fb1b_0.end+3s'%3e%3c/animate%3e%3canimate%20attributeName='opacity'%20values='1;0.2;1;1;0.2;1'%20dur='0.6s'%20begin='0s;blink234e811bed903495093b85bf96a98fb1b_0.end+3s'%3e%3c/animate%3e%3c/rect%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='copilot-clip-34e811bed903495093b85bf96a98fb1b_0'%3e%3crect%20width='24'%20height='24'%20rx='12'%20fill='white'%3e%3c/rect%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",rS="/assets/logo-iZVLr450.svg";function nS({isOpen:e,onClose:t,mainView:r,onNavigate:i}){const{t:s}=ne(),{userInfo:l}=mu(),d=zt(b=>b.info),a=zt(b=>b.fetch),o=ar(b=>b.fileChanges.length);C.useEffect(()=>{d||a()},[a,d]);const c=(l==null?void 0:l.userName)||(d==null?void 0:d.userName)||s("sidebar.user"),p=(d==null?void 0:d.version)||"",g=p&&p!=="dev"&&p!=="0.0.0"?`v${p}`:"";return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:`sidebar-overlay ${e?"":"sidebar-overlay-hidden"}`,onClick:t}),n.jsxs("aside",{className:`sidebar ${e?"":"sidebar-closed"}`,role:"navigation","aria-label":"Main navigation",children:[n.jsxs("div",{className:"sidebar-header",children:[n.jsx("img",{src:rS,alt:"CodeBuddy",className:"sidebar-logo"}),n.jsx("span",{className:"sidebar-brand",children:"CodeBuddy"}),n.jsx("div",{className:"flex-1"}),n.jsx("button",{onClick:t,className:"md:hidden w-7 h-7 flex items-center justify-center rounded-md text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors","aria-label":"Close sidebar",children:n.jsx(Ie,{size:16})})]}),n.jsxs("nav",{className:"sidebar-nav","aria-label":"Primary",children:[n.jsxs("button",{className:`sidebar-nav-item ${r==="chat"?"active":""}`,onClick:()=>i("chat"),"aria-current":r==="chat"?"page":void 0,children:[n.jsx(fr,{size:16}),n.jsx("span",{children:s("sidebar.chatMode")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="workers"?"active":""}`,onClick:()=>i("workers"),children:[n.jsx(Rt,{size:16}),n.jsx("span",{children:s("sidebar.workers")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="remote-control"?"active":""}`,onClick:()=>i("remote-control"),children:[n.jsx(Wr,{size:16}),n.jsx("span",{children:s("sidebar.remoteControl")})]})]}),n.jsx("div",{className:"sidebar-content",children:n.jsxs("div",{className:"px-3 py-1",children:[n.jsxs("button",{className:`sidebar-nav-item ${r==="tasks"?"active":""}`,onClick:()=>i("tasks"),children:[n.jsx(_i,{size:16}),n.jsx("span",{children:s("sidebar.nav.tasks")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="terminal"?"active":""}`,onClick:()=>i("terminal"),children:[n.jsx(nn,{size:16}),n.jsx("span",{children:s("sidebar.terminalMode")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="editor"?"active":""}`,onClick:()=>i("editor"),children:[n.jsx(Cu,{size:16}),n.jsx("span",{children:s("sidebar.editor")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="changes"?"active":""}`,onClick:()=>i("changes"),children:[n.jsx(rn,{size:16}),n.jsx("span",{children:s("sidebar.changes")}),o>0&&n.jsx("span",{className:"sidebar-badge",children:o})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="plugins"?"active":""}`,onClick:()=>i("plugins"),children:[n.jsx(Ct,{size:16}),n.jsx("span",{children:s("sidebar.nav.plugins")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="metrics"?"active":""}`,onClick:()=>i("metrics"),children:[n.jsx(gi,{size:16}),n.jsx("span",{children:s("sidebar.metrics")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="logs"?"active":""}`,onClick:()=>i("logs"),children:[n.jsx(bi,{size:16}),n.jsx("span",{children:s("sidebar.logs")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="settings"?"active":""}`,onClick:()=>i("settings"),children:[n.jsx(vi,{size:16}),n.jsx("span",{children:s("sidebar.preferences")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="keybindings"?"active":""}`,onClick:()=>i("keybindings"),children:[n.jsx(Ym,{size:16}),n.jsx("span",{children:s("sidebar.keybindings")})]}),n.jsxs("button",{className:`sidebar-nav-item ${r==="docs"?"active":""}`,onClick:()=>i("docs"),children:[n.jsx(fi,{size:16}),n.jsx("span",{children:s("sidebar.docs")})]})]})}),n.jsx("div",{className:"sidebar-footer",children:n.jsxs("div",{className:"sidebar-user",children:[n.jsx("img",{src:tS,alt:"User",className:"sidebar-user-avatar"}),n.jsxs("div",{className:"sidebar-user-info",children:[n.jsx("div",{className:"sidebar-user-name",children:c}),n.jsx("div",{className:"sidebar-user-status",children:g})]})]})})]})]})}function iS({onMenuClick:e,onNewChat:t,onSplitTerminal:r,onHistory:i,hasHistory:s,rightActions:l}){const{t:d}=ne(),{topic:a,status:o,currentModel:c}=rt(),{mainView:p,layout:g,terminalTitle:b}=Te(),[_,w]=C.useState(!1),v=C.useRef(null),h=p==="terminal",u=Ht(g)<Wp;C.useEffect(()=>{if(!_)return;const S=k=>{v.current&&!v.current.contains(k.target)&&w(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[_]);const f=C.useCallback(S=>{w(!1),r==null||r(S)},[r]),x=()=>{switch(p){case"chat":return a||d("chat.newChat");case"terminal":return b||d("terminal.title");case"settings":return d("settings.title");case"tasks":return d("tasks.title");case"plugins":return d("sidebar.nav.plugins");case"workers":return d("workers.title");case"metrics":return d("sidebar.metrics");case"logs":return d("sidebar.logs");case"docs":return d("sidebar.docs");case"remote-control":return d("sidebar.remoteControl");case"keybindings":return d("keybindings.title");default:return""}},E=c?c.replace(/^(claude-|gpt-|deepseek-)/,"").split("-").slice(0,2).join("-"):"",y=()=>l||(h?n.jsxs("div",{ref:v,className:"relative",children:[n.jsx("button",{onClick:()=>u&&w(!_),className:`text-text-secondary transition-colors flex items-center justify-center w-8 h-8 rounded-full ${u?"hover:text-text-primary hover:bg-bg-secondary":"opacity-40 cursor-not-allowed"}`,title:u?void 0:d("terminal.maxPanes"),"aria-label":"Split terminal",children:n.jsx(Vc,{size:20})}),_&&n.jsxs("div",{className:"absolute right-0 top-full mt-1 bg-bg-secondary border border-border-muted rounded-lg shadow-lg py-1 z-50 min-w-[140px]",children:[n.jsxs("button",{onClick:()=>f("horizontal"),className:"w-full flex items-center gap-3 px-4 py-2.5 text-[13px] text-text-primary hover:bg-bg-hover transition-colors",children:[n.jsx(Vc,{size:16,className:"text-text-secondary"}),n.jsx("span",{children:d("terminal.splitHorizontal")})]}),n.jsxs("button",{onClick:()=>f("vertical"),className:"w-full flex items-center gap-3 px-4 py-2.5 text-[13px] text-text-primary hover:bg-bg-hover transition-colors",children:[n.jsx(jg,{size:16,className:"text-text-secondary"}),n.jsx("span",{children:d("terminal.splitVertical")})]})]})]}):p==="chat"?n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("button",{onClick:t,className:"text-text-secondary hover:text-text-primary transition-colors flex items-center justify-center w-8 h-8 rounded-full hover:bg-bg-secondary","aria-label":"New chat",children:n.jsx(bt,{size:20})}),s&&n.jsx("button",{onClick:i,className:"text-text-secondary hover:text-text-primary transition-colors flex items-center justify-center w-8 h-8 rounded-full hover:bg-bg-secondary",title:d("sidebar.chatHistory"),"aria-label":"Chat history",children:n.jsx(Nu,{size:18})})]}):null);return n.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-6 h-14 bg-bg-primary text-xs flex-shrink-0 transition-colors duration-200 sticky top-0 z-10",role:"banner","aria-label":"Status bar",children:[n.jsx("div",{className:"flex items-center gap-4",children:n.jsx("button",{onClick:e,className:"text-text-secondary hover:text-text-primary transition-colors flex items-center justify-center w-8 h-8 rounded-full hover:bg-bg-secondary","aria-label":"Toggle sidebar",children:n.jsx(xi,{size:20})})}),n.jsxs("div",{className:"flex-1 flex flex-col justify-center items-center min-w-0 px-2",children:[n.jsx("span",{className:"font-medium text-text-primary text-[15px] tracking-wide truncate max-w-full",children:x()}),p==="chat"&&(E||o==="connected")&&n.jsx("span",{className:"hidden sm:block text-[10px] text-text-tertiary mt-0.5 truncate max-w-[200px]",children:[o==="connected"?"":"disconnected",E].filter(Boolean).join(" · ")})]}),n.jsx("div",{className:"flex items-center",children:y()})]})}let Bn=1e5;function sS(e){if(!Array.isArray(e))return[];const t=[];let r=null;for(const i of e)if(i.sessionUpdate==="user_message_chunk"){r&&(t.push(r),r=null);const s=i.content,l=(s==null?void 0:s.text)||"";if(!l.trim())continue;t.push({type:"message",id:`member-msg-${++Bn}`,role:"user",content:l,timestamp:Date.now()})}else if(i.sessionUpdate==="agent_message_chunk"){const s=i.content;if((s==null?void 0:s.type)==="thinking")continue;const l=(s==null?void 0:s.text)||"";if(!l)continue;r?r={...r,content:r.content+l}:r={type:"message",id:`member-msg-${++Bn}`,role:"assistant",content:l,timestamp:Date.now()}}else if(i.sessionUpdate==="tool_call"){r&&(t.push(r),r=null);const l=(i._meta||{})["codebuddy.ai/toolName"]||"";t.push({type:"tool_call",id:i.toolCallId||`member-tc-${++Bn}`,name:i.title||l||i.kind||"tool",kind:i.kind||"other",toolName:l,input:i.rawInput||i.input,status:i.status==="completed"?"completed":i.status==="failed"?"failed":"running",locations:i.locations,content:i.content})}else if(i.sessionUpdate==="tool_call_update"){const s=t.findIndex(l=>l.type==="tool_call"&&l.id===i.toolCallId);if(s!==-1){const l=t[s];t[s]={...l,status:i.status==="completed"?"completed":i.status==="failed"?"failed":l.status,result:i.rawOutput||i.toolResult||l.result,...i.content!==void 0?{content:i.content}:{}}}}return r&&t.push(r),t}function aS(){var b;const e=He(_=>_.focusedMemberName),t=He(_=>_.memberHistories),r=He(_=>_.members),i=He(_=>_.setFocusedMember),s=C.useRef(null),l=r.find(_=>_.name===e),d=e&&t[e]||[],a=C.useMemo(()=>sS(d),[d]),o=C.useMemo(()=>wp(a),[a]);C.useEffect(()=>{s.current&&(s.current.scrollTop=s.current.scrollHeight)},[o]);const c=C.useCallback(()=>{i(null)},[i]),p=(l==null?void 0:l.status)==="running"||(l==null?void 0:l.status)==="pending",{t:g}=ne();return n.jsxs("div",{ref:s,className:"absolute inset-0 overflow-y-auto overflow-x-hidden",children:[n.jsx("div",{className:"sticky top-0 z-10 bg-bg-primary/95 backdrop-blur-sm border-b border-border-muted/30",children:n.jsxs("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 py-3 flex items-center gap-3",children:[n.jsx("button",{type:"button",onClick:c,className:"p-1.5 rounded-md hover:bg-bg-secondary text-text-tertiary hover:text-text-secondary transition-colors",title:g("team.backToMain"),children:n.jsx(gr,{size:16})}),n.jsx(Gn,{size:16,className:"text-accent-purple flex-shrink-0"}),n.jsxs("span",{className:"text-[14px] font-semibold text-accent-purple",children:["@",e]}),(l==null?void 0:l.description)&&n.jsx("span",{className:"text-[12px] text-text-tertiary truncate flex-1",children:l.description}),p&&n.jsx(_e,{size:14,className:"animate-spin text-accent-purple flex-shrink-0"}),n.jsx("div",{className:"flex-1"}),l&&n.jsxs("span",{className:"text-[11px] text-text-tertiary flex-shrink-0",children:[l.toolCallCount?g("team.tools").replace("{count}",String(l.toolCallCount)):"",(b=l.tokenUsage)!=null&&b.lastContextWindow?`${l.toolCallCount?" · ":""}${g("team.tokens").replace("{count}",String(Math.round(l.tokenUsage.lastContextWindow/1e3))+"k")}`:""]})]})}),n.jsx("div",{className:"px-4 sm:px-6 pt-4 pb-8",children:n.jsxs("div",{className:"max-w-3xl mx-auto flex flex-col",children:[p&&o.length===0?n.jsxs("div",{className:"flex items-center justify-center gap-2 py-20 text-text-tertiary text-[13px]",children:[n.jsx(_e,{size:16,className:"animate-spin"}),n.jsx("span",{children:g("team.loadingHistory")})]}):o.length===0?n.jsx("div",{className:"flex items-center justify-center py-20 text-text-tertiary text-[13px]",children:g("team.noHistory")}):o.map((_,w)=>{if(_.kind==="user"){const v=_.entry.content?Sp(_.entry.content):void 0;if(v)return v.from==="system"?null:n.jsx("div",{children:n.jsx(kp,{msg:v})},_.entry.id);let h=_.entry.content||"";return h=h.replace(/<system-reminder>[\s\S]*?<\/system-reminder>\s*/g,"").trim(),h?n.jsx("div",{className:"flex justify-end mb-6",children:n.jsx("div",{className:"max-w-[85%] sm:max-w-[75%] px-5 py-3 rounded-2xl rounded-tr-sm bg-bg-user border border-transparent",children:n.jsx("p",{className:"whitespace-pre-wrap break-words text-text-primary text-chat",children:h})})},_.entry.id):null}return _.kind==="assistant_message"?n.jsx("div",{className:"mb-6",children:n.jsx(Cc,{message:_.entry})},_.entry.id):_.kind==="assistant_tools"?n.jsx("div",{className:"mb-6",children:n.jsx(vp,{entries:_.entries})},`tools-${w}`):null}),p&&o.length>0&&n.jsxs("div",{className:"flex items-center gap-2 py-4 text-text-tertiary text-[12px]",children:[n.jsx(_e,{size:12,className:"animate-spin"}),n.jsx("span",{children:g("team.agentRunning")})]})]})})]})}let oS=0;const lS={info:5e3,success:5e3,warn:8e3,error:0},Ft=$e((e,t)=>({toasts:[],addToast:(r,i)=>{const s=`toast-${++oS}`,l={id:s,type:r,message:i,createdAt:Date.now()};e(a=>({toasts:[...a.toasts.slice(-2),l]}));const d=lS[r];d>0&&setTimeout(()=>{t().removeToast(s)},d)},removeToast:r=>{e(i=>({toasts:i.toasts.filter(s=>s.id!==r)}))},clearAll:()=>e({toasts:[]})})),lu={info:e=>Ft.getState().addToast("info",e),warn:e=>Ft.getState().addToast("warn",e),error:e=>Ft.getState().addToast("error",e),success:e=>Ft.getState().addToast("success",e)},cS={info:Vm,success:Zh,warn:lr,error:Gr},dS={info:"text-accent-blue",success:"text-accent-green",warn:"text-accent-yellow",error:"text-accent-red"};function uS({item:e}){const t=Ft(d=>d.removeToast),[r,i]=C.useState(!1),s=cS[e.type],l=()=>{i(!0),setTimeout(()=>t(e.id),200)};return n.jsxs("div",{role:"alert",className:["flex items-start gap-3 px-4 py-3 rounded-xl border border-border-default shadow-lg","bg-bg-card backdrop-blur-sm","max-w-[360px] min-w-[280px]","transition-all duration-200",r?"opacity-0 translate-x-4":"opacity-100 translate-x-0","animate-fadeIn"].join(" "),children:[n.jsx(s,{size:18,className:`${dS[e.type]} shrink-0 mt-0.5`}),n.jsx("p",{className:"flex-1 text-[13px] text-text-primary leading-[1.5] break-words",children:e.message}),n.jsx("button",{onClick:l,"aria-label":"Dismiss",className:"shrink-0 w-5 h-5 flex items-center justify-center rounded text-text-tertiary hover:text-text-primary transition-colors",children:n.jsx(Ie,{size:14})})]})}function pS(){const e=Ft(t=>t.toasts);return e.length===0?null:n.jsx("div",{className:"fixed bottom-6 right-6 z-[999] flex flex-col-reverse gap-2 pointer-events-auto max-md:bottom-20 max-md:right-4 max-md:left-4 max-md:items-stretch",children:e.map(t=>n.jsx(uS,{item:t},t.id))})}function hS(e,t){const r=[];for(const i of e)i.type==="tool_call"&&r.push(i);for(const i of t.values())r.push(i);return r}function mS(e,t){const r={};for(const i of e){const s=i.input||{},l=i.toolName;if(l==="TaskCreate"){const d=i.result,a=typeof d=="string"?d:d&&typeof d=="object"?String(d.text??d.output??""):"",o=!a&&Array.isArray(i.content)?i.content.reduce((b,_)=>{var w;return b||String(((w=_==null?void 0:_.content)==null?void 0:w.text)??(_==null?void 0:_.text)??"")},""):"",c=(a||o).match(/Task #(\d+)/),p=c?c[1]:`t-${Object.keys(r).length+1}`;let g=s.owner?String(s.owner):void 0;if(!g&&(t!=null&&t.length)){const b=s.subject?String(s.subject).toLowerCase():"",_=s.description?String(s.description).toLowerCase():"",w=b+" "+_;for(const v of t)if(w.includes(v.toLowerCase())){g=v;break}}r[p]={id:p,subject:s.subject?String(s.subject):"",status:"pending",owner:g,activeForm:s.activeForm?String(s.activeForm):void 0}}else if(l==="TaskUpdate"){const d=s.taskId?String(s.taskId):void 0;if(d&&r[d]){const a=r[d];s.status&&s.status!=="deleted"&&(a.status=String(s.status)),s.subject&&(a.subject=String(s.subject)),s.owner!==void 0&&(a.owner=s.owner?String(s.owner):void 0),s.activeForm&&(a.activeForm=String(s.activeForm)),s.status==="deleted"&&delete r[d]}}}return Object.values(r)}function gS(e){return e.filter(t=>t.toolName==="TaskCreate"||t.toolName==="TaskUpdate").length}function fS({status:e}){switch(e){case"completed":return n.jsx(vu,{size:14,className:"text-accent-green flex-shrink-0"});case"in_progress":return n.jsx(_e,{size:14,className:"text-accent-brand flex-shrink-0 animate-spin"});default:return n.jsx(nm,{size:14,className:"text-text-tertiary flex-shrink-0"})}}function bS({member:e,isFocused:t,onClick:r}){var o;const i=e.status==="running"||e.status==="pending",s=e.status==="failed"||e.status==="killed",l=$b(e.color),d=ki(e.color),a=[];return e.toolCallCount&&a.push(`${e.toolCallCount} tools`),(o=e.tokenUsage)!=null&&o.lastContextWindow&&a.push(`${(e.tokenUsage.lastContextWindow/1e3).toFixed(1)}k`),n.jsxs("button",{type:"button",onClick:r,className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[11px] transition-colors cursor-pointer ${t?`${l.bg}`:i?`${l.bg} hover:opacity-80`:s?"bg-accent-red/10 text-accent-red":"bg-bg-secondary/50 text-text-tertiary hover:bg-bg-secondary/70"}`,style:{color:t||i?d:void 0,...t?{boxShadow:`0 0 0 1px ${d}40`}:{}},children:[n.jsxs("span",{className:"font-medium",children:["@",e.name]}),a.length>0&&n.jsx("span",{className:"opacity-70",children:a.join(" · ")}),i&&n.jsx(_e,{size:9,className:"animate-spin flex-shrink-0"}),s&&n.jsx(Gr,{size:9,className:"flex-shrink-0"}),!i&&!s&&n.jsx(Tt,{size:9,className:"flex-shrink-0"})]})}function yS(){const e=Ze(I=>I.timeline),t=Ze(I=>I.childToolCalls),r=Ze(I=>I.isAgentRunning),{t:i}=ne(),[s,l]=C.useState(!0),d=He(I=>I.isInTeam),a=He(I=>I.members),o=He(I=>I.focusedMemberName),c=He(I=>I.setFocusedMember),p=C.useMemo(()=>{const I=new Map;for(const q of a)q.color&&I.set(q.name,q.color);return I},[a]),g=C.useRef(0),[b,_]=C.useState(!1),w=C.useRef(r),v=C.useMemo(()=>hS(e,t),[e,t]),h=C.useMemo(()=>a.map(I=>I.name),[a]),m=C.useMemo(()=>mS(v,h),[v,h]),u=C.useMemo(()=>gS(v),[v]);C.useEffect(()=>{!w.current&&r&&(g.current=u,_(!0)),w.current=r},[r,u]),C.useEffect(()=>{b&&u>g.current&&_(!1)},[b,u]);const f=C.useCallback(()=>l(I=>!I),[]),x=C.useCallback(I=>{I.stopPropagation(),g.current=u,_(!0)},[u]),E=C.useCallback(I=>{c(o===I?null:I)},[o,c]),y=C.useCallback(I=>{I.owner&&p.has(I.owner)&&c(o===I.owner?null:I.owner)},[o,p,c]),S=a.filter(I=>I.status==="running"||I.status==="pending"),k=S.length>0,T=!r&&k,R=d&&a.length>0,A=m.length>0,D=A&&m.every(I=>I.status==="completed"),L=R&&!k&&!r,B=A&&m.every(I=>I.status==="pending")&&!r&&!k,H=A&&!(D||L||B)&&!b,U=R&&(k||o);if(!H&&!U)return null;const F=m.filter(I=>I.status==="completed").length,N=m.length,O=m.find(I=>I.status==="in_progress"),$=O?O.activeForm||O.subject:`${F}/${N}`;return n.jsx("div",{className:"flex-none px-4 sm:px-6 pb-1",children:n.jsx("div",{className:"max-w-3xl mx-auto",children:n.jsxs("div",{className:"rounded-lg border border-border-muted/15 bg-bg-secondary/30 overflow-hidden",children:[n.jsxs("button",{onClick:f,className:"flex items-center gap-2 w-full px-3 py-1.5 hover:bg-bg-hover/30 transition-colors cursor-pointer",children:[T?n.jsx(_e,{size:13,className:"animate-spin text-accent-purple flex-shrink-0"}):U?n.jsx(Fu,{size:13,className:"text-accent-purple flex-shrink-0"}):n.jsx(Ru,{size:13,className:"text-text-tertiary flex-shrink-0"}),T?n.jsx("span",{className:"text-xs font-medium text-accent-purple",children:i("team.waitingForTeammates").replace("{count}",String(S.length)).replace("{s}",S.length>1?"s":"")}):n.jsxs(n.Fragment,{children:[H&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-xs font-medium text-text-primary",children:i("todo.title")}),n.jsxs("span",{className:"text-[11px] text-text-tertiary tabular-nums",children:[F,"/",N]})]}),U&&H&&n.jsx("span",{className:"text-border-muted/40",children:"·"}),U&&n.jsxs("span",{className:"text-[11px] text-text-tertiary",children:[i("team.title")," ",S.length>0?i("team.activeCount").replace("{count}",String(S.length)):""]})]}),!s&&H&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-border-muted/60 select-none",children:"|"}),O&&r&&n.jsx(_e,{size:10,className:"text-accent-brand animate-spin flex-shrink-0"}),n.jsx("span",{className:"text-xs text-text-secondary truncate flex-1 text-left",children:$})]}),n.jsx("span",{className:"flex-1"}),!r&&!T&&n.jsx("span",{role:"button",tabIndex:0,onClick:x,onKeyDown:I=>{I.key==="Enter"&&x(I)},className:"text-text-tertiary hover:text-text-primary p-0.5 rounded transition-colors flex-shrink-0",children:n.jsx(Ie,{size:12})}),s?n.jsx(it,{size:12,className:"text-text-tertiary flex-shrink-0"}):n.jsx(Oe,{size:12,className:"text-text-tertiary flex-shrink-0"})]}),s&&n.jsxs("div",{className:"border-t border-border-muted/40",children:[U&&n.jsx("div",{className:"flex flex-wrap gap-1.5 px-3 py-1.5",children:a.map(I=>n.jsx(bS,{member:I,isFocused:o===I.name,onClick:()=>E(I.name)},I.name))}),H&&n.jsx("div",{className:`px-3 py-1.5 space-y-0.5 max-h-52 overflow-y-auto ${U?"border-t border-border-muted/30":""}`,children:m.map((I,q)=>{const W=I.owner?p.get(I.owner):void 0,Y=!!W,V=W?ki(W):void 0;return n.jsxs("div",{onClick:Y?()=>y(I):void 0,className:`flex items-center gap-2 py-0.5 text-xs ${Y?"cursor-pointer hover:bg-bg-hover/30 rounded px-1 -mx-1":""} ${I.status==="in_progress"?"text-text-primary":I.status==="completed"?"text-text-tertiary":"text-text-secondary"}`,children:[n.jsx(fS,{status:I.status}),n.jsxs("span",{className:`truncate ${I.status==="completed"?"line-through":""}`,children:[q+1,". ",I.status==="in_progress"?I.activeForm||I.subject||i("todo.untitled"):I.subject||i("todo.untitled")]}),W&&n.jsxs("span",{className:"text-[10px] font-medium flex-shrink-0 ml-auto",style:{color:V},children:["@",I.owner]})]},I.id)})})]})]})})})}function _S(e){try{const t=new URL(e),r=window.location.hostname;return t.hostname===r?e:(t.hostname=r,t.toString())}catch(t){return console.warn("Failed to resolve worker URL, using original:",e,t),e}}function xS({title:e,message:t,confirmLabel:r,cancelLabel:i,danger:s,onConfirm:l,onCancel:d}){const{t:a}=ne(),o=C.useRef(null);C.useEffect(()=>{var p;(p=o.current)==null||p.focus()},[]);const c=C.useCallback(p=>{p.key==="Escape"&&(p.preventDefault(),d())},[d]);return n.jsxs("div",{className:"fixed inset-0 z-[200] flex items-center justify-center",onKeyDown:c,children:[n.jsx("div",{className:"absolute inset-0 bg-black/30",onClick:d}),n.jsxs("div",{role:"alertdialog","aria-modal":"true","aria-labelledby":"confirm-title",className:"relative bg-bg-card border border-border-default rounded-xl shadow-2xl w-full max-w-[400px] mx-4 overflow-hidden",children:[n.jsxs("div",{className:"px-5 pt-5 pb-4",children:[s&&n.jsx("div",{className:"w-10 h-10 rounded-full bg-error-bg flex items-center justify-center mb-3",children:n.jsx(lr,{size:20,className:"text-accent-red"})}),n.jsx("h3",{id:"confirm-title",className:"text-text-primary text-[15px] font-semibold mb-1",children:e}),t&&n.jsx("p",{className:"text-text-secondary text-[13px] leading-relaxed",children:t})]}),n.jsxs("div",{className:"flex items-center justify-end gap-2 px-5 pb-4",children:[n.jsx("button",{onClick:d,className:"px-4 py-1.5 text-[13px] text-text-secondary hover:text-text-primary rounded-lg hover:bg-bg-hover transition-colors",children:i||a("app.cancel")}),n.jsx("button",{ref:o,onClick:l,className:["px-4 py-1.5 text-[13px] font-medium rounded-lg transition-colors",s?"bg-accent-red text-white hover:opacity-90":"bg-accent-brand text-bg-primary hover:opacity-90"].join(" "),children:r||a("app.confirm")})]})]})]})}const vS=1e4;function SS(){const{t:e}=ne(),{workers:t,daemon:r,loading:i,error:s,fetchWorkers:l,fetchDaemonStatus:d,killWorker:a,startDaemon:o,stopDaemon:c,restartDaemon:p}=Lc();C.useEffect(()=>{l(),d();const m=setInterval(()=>{l(),d()},vS);return()=>clearInterval(m)},[l,d]);const g=C.useCallback(()=>{l(),d()},[l,d]),b=C.useCallback(m=>{window.location.hash=`#/logs?worker=${m.pid}`},[]),[_,w]=C.useState(null),v=C.useCallback(async m=>{w(m)},[]),h=C.useCallback(async()=>{_&&(await a(String(_.pid)),w(null))},[_,a]);return n.jsxs("div",{className:"flex-1 overflow-auto p-4 md:p-6",children:[_&&n.jsx(xS,{title:e("workers.action.kill.confirm"),danger:!0,onConfirm:h,onCancel:()=>w(null)}),n.jsxs("div",{className:"flex items-center justify-between mb-6",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Rt,{size:20,className:"text-accent-brand"}),n.jsx("h1",{className:"text-lg font-semibold text-text-primary",children:e("workers.title")})]}),n.jsxs("button",{onClick:g,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm text-text-secondary
|
|
612
|
+
hover:text-text-primary hover:bg-bg-hover rounded-lg transition-colors`,title:e("workers.refresh"),children:[n.jsx(dt,{size:14,className:i?"animate-spin":""}),n.jsx("span",{children:e("workers.refresh")})]})]}),s&&n.jsx("div",{className:"mb-4 p-3 rounded-xl error-banner text-sm",children:s}),n.jsx(kS,{daemon:r,onStart:()=>o(),onStop:c,onRestart:p}),n.jsx(wS,{workers:t,onViewLogs:b,onKill:v})]})}function kS({daemon:e,onStart:t,onStop:r,onRestart:i}){const{t:s}=ne(),l=(e==null?void 0:e.status)==="running",[d,a]=C.useState(null),o=C.useCallback(async(c,p)=>{a(c);try{await p()}finally{a(null)}},[]);return n.jsx("div",{className:`bg-bg-secondary rounded-xl p-4 md:p-5 border mb-6 transition-colors worker-card-hover ${l?"border-green-400/40 ring-1 ring-green-400/10":"border-border-default"}`,children:n.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(qr,{size:18,className:l?"text-green-500":"text-text-tertiary"}),n.jsx("span",{className:"text-base font-semibold text-text-primary",children:s("workers.daemon")}),(e==null?void 0:e.pid)&&n.jsxs("span",{className:"text-xs text-text-tertiary font-mono bg-bg-tertiary px-2 py-0.5 rounded-md ml-2 border border-border-default/50",children:["PID ",e.pid]})]}),n.jsxs("div",{className:"flex items-center gap-4 flex-wrap",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("span",{className:"relative flex h-2.5 w-2.5",children:[l&&n.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-green-400 opacity-75"}),n.jsx("span",{className:`relative inline-flex rounded-full h-2.5 w-2.5 ${l?"bg-green-500":"bg-gray-400"}`})]}),n.jsx("span",{className:"text-sm font-medium text-text-secondary",children:s(l?"workers.daemon.running":"workers.daemon.stopped")})]}),(e==null?void 0:e.endpoint)&&n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"text-border-primary",children:"|"}),n.jsx(ct,{size:14,className:"text-text-tertiary ml-1"}),n.jsx("a",{href:e.endpoint,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-accent-brand hover:underline",children:e.endpoint})]})]})]}),n.jsx("div",{className:"flex items-center gap-2 mt-2 md:mt-0",children:l?n.jsxs(n.Fragment,{children:[n.jsxs("button",{onClick:()=>o("stop",r),disabled:d!==null,className:`flex items-center gap-1.5 px-4 py-2 text-sm font-medium rounded-lg border border-border-default
|
|
613
613
|
bg-bg-primary text-text-secondary daemon-stop-btn transition-all disabled:opacity-50`,children:[d==="stop"?n.jsx(_e,{size:14,className:"animate-spin"}):n.jsx(Mu,{size:14}),s("workers.daemon.stop")]}),n.jsxs("button",{onClick:()=>o("restart",i),disabled:d!==null,className:`flex items-center gap-1.5 px-4 py-2 text-sm font-medium rounded-lg border border-border-default
|
|
614
614
|
bg-bg-primary text-text-secondary hover:text-text-primary hover:bg-bg-hover transition-all disabled:opacity-50`,children:[d==="restart"?n.jsx(_e,{size:14,className:"animate-spin"}):n.jsx(Vn,{size:14}),s("workers.daemon.restart")]})]}):n.jsxs("button",{onClick:()=>o("start",t),disabled:d!==null,className:`flex items-center gap-1.5 px-4 py-2 text-sm font-medium rounded-lg shadow-sm
|
|
615
|
-
daemon-start-btn transition-all disabled:opacity-70`,children:[d==="start"?n.jsx(_e,{size:14,className:"animate-spin"}):n.jsx(Cg,{size:14}),s(d==="start"?"workers.daemon.starting":"workers.daemon.start")]})})]})})}function kS({workers:e,onViewLogs:t,onKill:r}){const{t:i}=ne();return n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[n.jsx(Rt,{size:18,className:"text-text-secondary"}),n.jsxs("h2",{className:"text-base font-medium text-text-primary",children:[i("workers.active")," (",e.length,")"]})]}),e.length===0?n.jsx("div",{className:"text-center py-12 text-text-tertiary",children:i("workers.empty")}):n.jsx("div",{className:"space-y-4",children:[...e].sort((s,l)=>(l.isCurrent?1:0)-(s.isCurrent?1:0)).map(s=>n.jsx(ES,{worker:s,onViewLogs:t,onKill:r},`${s.pid}-${s.hostname}`))})]})}const wS={interactive:"kind-badge kind-badge-blue",bg:"kind-badge kind-badge-purple",daemon:"kind-badge kind-badge-green","daemon-worker":"kind-badge kind-badge-orange"};function ES({worker:e,onViewLogs:t,onKill:r}){const{t:i}=ne();return n.jsxs("div",{className:"group bg-bg-secondary rounded-xl p-4 md:p-5 border border-border-default transition-colors worker-card-hover",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("span",{className:`inline-block px-2.5 py-0.5 text-xs font-medium rounded-md ${wS[e.kind]||"bg-gray-100 text-gray-600"}`,children:e.kind}),e.isCurrent&&n.jsx("span",{className:"text-[10px] uppercase font-bold tracking-wider px-1.5 py-0.5 rounded current-badge",children:"current"}),n.jsxs("span",{className:"text-xs text-text-tertiary font-mono",children:["PID ",e.pid]}),e.name&&e.name!=="-"&&n.jsx("span",{className:"text-sm font-medium text-text-primary",children:e.name})]}),n.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[e.url&&n.jsx("a",{href:cu(e),target:"_blank",rel:"noopener noreferrer",className:"p-1.5 rounded-md text-text-tertiary hover:text-accent-brand hover:bg-bg-hover transition-colors",title:i("workers.action.open"),children:n.jsx(ct,{size:14})}),!e.manual&&n.jsx("button",{onClick:()=>t(e),className:"p-1.5 rounded-md text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors",title:i("workers.action.logs"),children:n.jsx(st,{size:14})}),!e.isCurrent&&n.jsx("button",{onClick:()=>r(e),className:"p-1.5 rounded-md text-text-tertiary daemon-kill-btn transition-colors",title:i("workers.action.kill"),children:n.jsx(Du,{size:14})})]})]}),n.jsxs("div",{className:"flex flex-col md:flex-row md:items-start justify-between gap-3 md:gap-6",children:[n.jsxs("div",{className:"flex flex-col gap-1.5 flex-1 min-w-0",children:[n.jsx(_t,{path:e.cwd,className:"text-[13px] text-text-secondary font-mono truncate max-w-full"}),e.url&&n.jsxs("a",{href:cu(e),target:"_blank",rel:"noopener noreferrer",className:"text-xs text-text-tertiary hover:text-accent-brand truncate inline-flex items-center gap-1",title:e.url,children:[n.jsx(ct,{size:10,className:"flex-none"}),e.url]})]}),n.jsxs("div",{className:"flex flex-wrap gap-x-8 gap-y-3 shrink-0",children:[n.jsx(Un,{icon:n.jsx(pr,{size:14}),label:"Started",value:TS(e.startedAt)}),e.version&&n.jsx(Un,{icon:n.jsx(Rt,{size:14}),label:"Version",value:e.version}),e.hostname&&n.jsx(Un,{icon:n.jsx(qr,{size:14}),label:"Host",value:e.hostname})]})]})]})}function Un({icon:e,label:t,value:r,valueClassName:i}){return n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsxs("div",{className:"flex items-center gap-1.5 text-text-tertiary",children:[e,n.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wider",children:t})]}),n.jsx("div",{className:`text-sm font-semibold text-text-primary ${i||""}`,children:r})]})}function CS(e){try{const t=new URL(e).hostname;return t==="127.0.0.1"||t==="localhost"||t==="::1"}catch{return!1}}function cu(e){if(!e.url)return"#";if(CS(e.url))return e.url;const t=$v(String(e.pid));if(!t)return e.url;try{const r=new URL(e.url);return r.searchParams.set("password",t),r.toString()}catch{return e.url}}function TS(e){const t=Math.floor((Date.now()-e)/1e3);if(t<60)return`${t}s ago`;const r=Math.floor(t/60);if(r<60)return`${r}m ago`;const i=Math.floor(r/60);return i<24?`${i}h ${r%60}m`:`${Math.floor(i/24)}d ${i%24}h`}function NS(){const{viewState:e,checkAuth:t}=hu(),{status:r,sessionId:i,topic:s,setPromptSuggestion:l,setTopic:d}=rt(),{connect:a}=Th(),{clearChat:o}=Ze(),c=He(F=>F.focusedMemberName),{t:p,resolved:g}=ne(),[b,_]=C.useState(()=>{try{const F=sessionStorage.getItem("codebuddy_sidebar_open");return F!==null?window.innerWidth>=768?F==="true":!1:window.innerWidth>=768}catch{return window.innerWidth>=768}}),w=C.useRef(b),[v,h]=C.useState(!1),[m,u]=C.useState(!1),[f,x]=C.useState(!1),{splitPane:E,mainView:y,setMainView:S}=Te(),k=C.useCallback(F=>{_(N=>{const O=typeof F=="function"?F(N):F;w.current=O;try{sessionStorage.setItem("codebuddy_sidebar_open",String(O))}catch{}return O})},[]);C.useEffect(()=>{const F=window.matchMedia("(min-width: 768px)"),N=O=>{O.matches?_(w.current):_(!1)};return F.addEventListener("change",N),()=>F.removeEventListener("change",N)},[]),C.useEffect(()=>{const F=N=>ze.handleKeyDown(N);return window.addEventListener("keydown",F),()=>window.removeEventListener("keydown",F)},[]),C.useEffect(()=>{r==="connected"&&Tc.getState().loadBindings()},[r]);const[T,R]=C.useState(!1),A=C.useRef();C.useEffect(()=>r!=="connected"?void 0:((()=>{fetch("/api/v1/sessions",{headers:ue()}).then(N=>N.ok?N.json():null).then(N=>{N!=null&&N.sessions&&R(N.sessions.length>1)}).catch(()=>{})})(),()=>{A.current&&clearTimeout(A.current)}),[r,i]);const D=C.useCallback(F=>{E(F)},[E]),L=C.useCallback(async()=>{if(i){try{await Ne().prompt(i,"/clear")}catch{lu.error(p("error.newChatFailed"))}o(),d(null),l(null),S("chat"),window.location.hash="/chat"}},[i,o,d,l,S]),B=C.useCallback(async F=>{if(i){try{await Ne().prompt(i,`/resume ${F}`)}catch{lu.error(p("error.switchSessionFailed"))}S("chat"),window.location.hash="/chat"}},[i,S]),P=C.useCallback(F=>{S(F),window.location.hash=`/${F}`,window.innerWidth<768&&_(!1)},[S]);if(C.useEffect(()=>{const F=[ze.register({id:"commandPalette.toggle",key:"p",meta:!0,shift:!0,handler:()=>x(N=>!N)}),ze.register({id:"sidebar.toggle",key:"b",meta:!0,handler:()=>k(N=>!N)}),ze.register({id:"terminal.toggle",key:"j",meta:!0,handler:()=>{const N=y==="terminal"?"chat":"terminal";S(N),window.location.hash="/"+N}}),ze.register({id:"newChat",key:"n",meta:!0,handler:()=>L()}),ze.register({id:"settings",key:",",meta:!0,handler:()=>{S("settings"),window.location.hash="/settings"}}),ze.registerAction("app:commandPalette",()=>x(N=>!N)),ze.registerAction("app:toggleSidebar",()=>k(N=>!N)),ze.registerAction("app:toggleTerminal",()=>{const N=y==="terminal"?"chat":"terminal";S(N),window.location.hash="/"+N}),ze.registerAction("app:newChat",()=>L()),ze.registerAction("app:settings",()=>{S("settings"),window.location.hash="/settings"}),ze.registerAction("app:focusInput",()=>{const N=document.querySelector("textarea");N==null||N.focus()}),ze.registerAction("app:keybindings",()=>{S("keybindings"),window.location.hash="/keybindings"})];return()=>F.forEach(N=>N())},[y,L,S,k]),C.useEffect(()=>{const F=new URLSearchParams(window.location.search),N=F.get("password"),O=F.get("token");if(N||O){pu(N||O),F.delete("password"),F.delete("token");const $=F.toString()?`${window.location.pathname}?${F.toString()}`:window.location.pathname;window.history.replaceState({},"",$)}t()},[t]),C.useEffect(()=>{if(e==="authenticated"){const F=Ec();S(F),(!window.location.hash||window.location.hash==="#")&&(window.location.hash=`/${F}`)}},[e,S]),C.useEffect(()=>My(N=>{S(N)}),[S]),C.useEffect(()=>{if(e==="authenticated"){const F=qt()||void 0;a({token:F,continue:!0})}},[e,a]),C.useEffect(()=>{document.documentElement.lang=g,document.title=s?`${s} - CodeBuddy Code`:p("page.title")},[g,p,s]),e==="loading")return n.jsx("div",{className:"flex h-screen h-[100dvh] bg-bg-primary text-text-primary transition-colors duration-200 font-sans overflow-hidden",children:n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx(nt,{size:"large",text:p("app.connecting")})})});if(e==="login")return n.jsx(Iv,{});const H=()=>{if(r==="connecting")return n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx(nt,{size:"large",text:p("app.connecting")})});if(r!=="connected"&&y!=="settings"&&y!=="docs")return n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsxs("div",{className:"text-center",children:[n.jsx("div",{className:"text-text-secondary mb-4 font-medium",children:p("app.connectFailed")}),n.jsx("button",{onClick:()=>a(),className:["px-6 py-2.5 bg-accent-brand text-white rounded-full","text-sm font-medium transition-all hover:bg-accent-brand/90","hover:scale-105 active:scale-95 shadow-sm"].join(" "),children:p("app.retry")})]})});switch(y){case"chat":return n.jsx(qe,{viewName:"chat",errorTitle:p("error.viewCrashed"),retryLabel:p("app.retry"),children:n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"flex-1 overflow-hidden w-full relative",children:c?n.jsx(aS,{}):n.jsx(I_,{onClickCloseBottomSheet:()=>u(!1)})}),n.jsx(yS,{}),n.jsx("div",{className:"flex-none bg-bg-primary",children:n.jsx(Cv,{onNavigate:P,onNewChat:L,onHistory:()=>h(!0),mainView:y,showBottomSheet:m,setShowBottomSheet:u})})]})});case"tasks":return n.jsx(qe,{viewName:"tasks",errorTitle:p("error.viewCrashed"),retryLabel:p("app.retry"),children:n.jsx(Xp,{})});case"plugins":return n.jsx(qe,{viewName:"plugins",errorTitle:p("error.viewCrashed"),retryLabel:p("app.retry"),children:n.jsx(zp,{})});case"terminal":return null;case"remote-control":return n.jsx(qe,{viewName:"remote-control",errorTitle:p("error.viewCrashed"),retryLabel:p("app.retry"),children:n.jsx(Zv,{onNavigate:P})});case"editor":return n.jsx(qe,{viewName:"editor",errorTitle:p("error.viewCrashed"),retryLabel:p("app.retry"),children:n.jsx(Fx,{onMenuClick:()=>k(F=>!F)})});case"changes":return n.jsx(qe,{viewName:"changes",errorTitle:p("error.viewCrashed"),retryLabel:p("app.retry"),children:n.jsx(Ju,{onMenuClick:()=>k(F=>!F)})});case"settings":return n.jsx(qe,{viewName:"settings",errorTitle:p("error.viewCrashed"),retryLabel:p("app.retry"),children:n.jsx(Gp,{})});case"keybindings":return n.jsx(qe,{viewName:"keybindings",errorTitle:p("error.viewCrashed"),retryLabel:p("app.retry"),children:n.jsx(Nv,{})});case"metrics":return n.jsx(qe,{viewName:"metrics",errorTitle:p("error.viewCrashed"),retryLabel:p("app.retry"),children:n.jsx(qv,{})});case"workers":return n.jsx(qe,{viewName:"workers",errorTitle:p("error.viewCrashed"),retryLabel:p("app.retry"),children:n.jsx(vS,{})});case"logs":return n.jsx(qe,{viewName:"logs",errorTitle:p("error.viewCrashed"),retryLabel:p("app.retry"),children:n.jsx(Pv,{})});case"docs":return n.jsx(qe,{viewName:"docs",errorTitle:p("error.viewCrashed"),retryLabel:p("app.retry"),children:n.jsx(Pd,{})});default:return null}};return y==="docs"&&window.location.hash.includes("standalone")?n.jsx("div",{className:"flex h-screen h-[100dvh] bg-bg-primary text-text-primary transition-colors duration-200 font-sans overflow-hidden",children:n.jsx(Pd,{})}):n.jsxs("div",{className:"flex h-screen h-[100dvh] bg-bg-primary text-text-primary transition-colors duration-200 font-sans overflow-hidden",children:[n.jsx(nS,{isOpen:b,onClose:()=>k(!1),mainView:y,onNavigate:P}),n.jsxs("div",{className:"flex-1 flex flex-col min-w-0 relative transition-all duration-300 h-full",children:[y!=="editor"&&y!=="changes"&&n.jsx(iS,{onMenuClick:()=>k(F=>!F),onNewChat:L,onSplitTerminal:D,onHistory:()=>h(!0),hasHistory:T}),n.jsxs("div",{className:"flex-1 flex flex-col w-full overflow-hidden relative",children:[n.jsx("div",{className:"flex-1 flex flex-col w-full",style:{display:y==="terminal"?"flex":"none"},children:n.jsx(Jp,{})}),y!=="terminal"&&H()]}),n.jsx(Ux,{isOpen:v,onClose:()=>h(!1),onSwitchSession:B})]}),n.jsx(pS,{}),n.jsx(z_,{isOpen:f,onClose:()=>x(!1),onNavigate:P,onNewChat:L})]})}xh.createRoot(document.getElementById("root")).render(n.jsx(C.StrictMode,{children:n.jsx(qe,{children:n.jsx(NS,{})})}));
|
|
615
|
+
daemon-start-btn transition-all disabled:opacity-70`,children:[d==="start"?n.jsx(_e,{size:14,className:"animate-spin"}):n.jsx(Cg,{size:14}),s(d==="start"?"workers.daemon.starting":"workers.daemon.start")]})})]})})}function wS({workers:e,onViewLogs:t,onKill:r}){const{t:i}=ne();return n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[n.jsx(Rt,{size:18,className:"text-text-secondary"}),n.jsxs("h2",{className:"text-base font-medium text-text-primary",children:[i("workers.active")," (",e.length,")"]})]}),e.length===0?n.jsx("div",{className:"text-center py-12 text-text-tertiary",children:i("workers.empty")}):n.jsx("div",{className:"space-y-4",children:[...e].sort((s,l)=>(l.isCurrent?1:0)-(s.isCurrent?1:0)).map(s=>n.jsx(CS,{worker:s,onViewLogs:t,onKill:r},`${s.pid}-${s.hostname}`))})]})}const ES={interactive:"kind-badge kind-badge-blue",bg:"kind-badge kind-badge-purple",daemon:"kind-badge kind-badge-green","daemon-worker":"kind-badge kind-badge-orange"};function CS({worker:e,onViewLogs:t,onKill:r}){const{t:i}=ne();return n.jsxs("div",{className:"group bg-bg-secondary rounded-xl p-4 md:p-5 border border-border-default transition-colors worker-card-hover",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("span",{className:`inline-block px-2.5 py-0.5 text-xs font-medium rounded-md ${ES[e.kind]||"bg-gray-100 text-gray-600"}`,children:e.kind}),e.isCurrent&&n.jsx("span",{className:"text-[10px] uppercase font-bold tracking-wider px-1.5 py-0.5 rounded current-badge",children:"current"}),n.jsxs("span",{className:"text-xs text-text-tertiary font-mono",children:["PID ",e.pid]}),e.name&&e.name!=="-"&&n.jsx("span",{className:"text-sm font-medium text-text-primary",children:e.name})]}),n.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[e.url&&n.jsx("a",{href:cu(e),target:"_blank",rel:"noopener noreferrer",className:"p-1.5 rounded-md text-text-tertiary hover:text-accent-brand hover:bg-bg-hover transition-colors",title:i("workers.action.open"),children:n.jsx(ct,{size:14})}),!e.manual&&n.jsx("button",{onClick:()=>t(e),className:"p-1.5 rounded-md text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors",title:i("workers.action.logs"),children:n.jsx(st,{size:14})}),!e.isCurrent&&n.jsx("button",{onClick:()=>r(e),className:"p-1.5 rounded-md text-text-tertiary daemon-kill-btn transition-colors",title:i("workers.action.kill"),children:n.jsx(Du,{size:14})})]})]}),n.jsxs("div",{className:"flex flex-col md:flex-row md:items-start justify-between gap-3 md:gap-6",children:[n.jsxs("div",{className:"flex flex-col gap-1.5 flex-1 min-w-0",children:[n.jsx(_t,{path:e.cwd,className:"text-[13px] text-text-secondary font-mono truncate max-w-full"}),e.url&&n.jsxs("a",{href:cu(e),target:"_blank",rel:"noopener noreferrer",className:"text-xs text-text-tertiary hover:text-accent-brand truncate inline-flex items-center gap-1",title:e.url,children:[n.jsx(ct,{size:10,className:"flex-none"}),e.url]})]}),n.jsxs("div",{className:"flex flex-wrap gap-x-8 gap-y-3 shrink-0",children:[n.jsx(Un,{icon:n.jsx(pr,{size:14}),label:"Started",value:NS(e.startedAt)}),e.version&&n.jsx(Un,{icon:n.jsx(Rt,{size:14}),label:"Version",value:e.version}),e.hostname&&n.jsx(Un,{icon:n.jsx(qr,{size:14}),label:"Host",value:e.hostname})]})]})]})}function Un({icon:e,label:t,value:r,valueClassName:i}){return n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsxs("div",{className:"flex items-center gap-1.5 text-text-tertiary",children:[e,n.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wider",children:t})]}),n.jsx("div",{className:`text-sm font-semibold text-text-primary ${i||""}`,children:r})]})}function TS(e){try{const t=new URL(e).hostname;return t==="127.0.0.1"||t==="localhost"||t==="::1"}catch{return!1}}function cu(e){if(!e.url)return"#";const t=_S(e.url);if(TS(t))return t;const r=$v(String(e.pid));if(!r)return t;try{const i=new URL(t);return i.searchParams.set("password",r),i.toString()}catch(i){return console.warn("Failed to build worker URL with password:",t,i),t}}function NS(e){const t=Math.floor((Date.now()-e)/1e3);if(t<60)return`${t}s ago`;const r=Math.floor(t/60);if(r<60)return`${r}m ago`;const i=Math.floor(r/60);return i<24?`${i}h ${r%60}m`:`${Math.floor(i/24)}d ${i%24}h`}function AS(){const{viewState:e,checkAuth:t}=hu(),{status:r,sessionId:i,topic:s,setPromptSuggestion:l,setTopic:d}=rt(),{connect:a}=Th(),{clearChat:o}=Ze(),c=He(F=>F.focusedMemberName),{t:p,resolved:g}=ne(),[b,_]=C.useState(()=>{try{const F=sessionStorage.getItem("codebuddy_sidebar_open");return F!==null?window.innerWidth>=768?F==="true":!1:window.innerWidth>=768}catch{return window.innerWidth>=768}}),w=C.useRef(b),[v,h]=C.useState(!1),[m,u]=C.useState(!1),[f,x]=C.useState(!1),{splitPane:E,mainView:y,setMainView:S}=Te(),k=C.useCallback(F=>{_(N=>{const O=typeof F=="function"?F(N):F;w.current=O;try{sessionStorage.setItem("codebuddy_sidebar_open",String(O))}catch{}return O})},[]);C.useEffect(()=>{const F=window.matchMedia("(min-width: 768px)"),N=O=>{O.matches?_(w.current):_(!1)};return F.addEventListener("change",N),()=>F.removeEventListener("change",N)},[]),C.useEffect(()=>{const F=N=>ze.handleKeyDown(N);return window.addEventListener("keydown",F),()=>window.removeEventListener("keydown",F)},[]),C.useEffect(()=>{r==="connected"&&Tc.getState().loadBindings()},[r]);const[T,R]=C.useState(!1),A=C.useRef();C.useEffect(()=>r!=="connected"?void 0:((()=>{fetch("/api/v1/sessions",{headers:ue()}).then(N=>N.ok?N.json():null).then(N=>{N!=null&&N.sessions&&R(N.sessions.length>1)}).catch(()=>{})})(),()=>{A.current&&clearTimeout(A.current)}),[r,i]);const D=C.useCallback(F=>{E(F)},[E]),L=C.useCallback(async()=>{if(i){try{await Ne().prompt(i,"/clear")}catch{lu.error(p("error.newChatFailed"))}o(),d(null),l(null),S("chat"),window.location.hash="/chat"}},[i,o,d,l,S]),B=C.useCallback(async F=>{if(i){try{await Ne().prompt(i,`/resume ${F}`)}catch{lu.error(p("error.switchSessionFailed"))}S("chat"),window.location.hash="/chat"}},[i,S]),P=C.useCallback(F=>{S(F),window.location.hash=`/${F}`,window.innerWidth<768&&_(!1)},[S]);if(C.useEffect(()=>{const F=[ze.register({id:"commandPalette.toggle",key:"p",meta:!0,shift:!0,handler:()=>x(N=>!N)}),ze.register({id:"sidebar.toggle",key:"b",meta:!0,handler:()=>k(N=>!N)}),ze.register({id:"terminal.toggle",key:"j",meta:!0,handler:()=>{const N=y==="terminal"?"chat":"terminal";S(N),window.location.hash="/"+N}}),ze.register({id:"newChat",key:"n",meta:!0,handler:()=>L()}),ze.register({id:"settings",key:",",meta:!0,handler:()=>{S("settings"),window.location.hash="/settings"}}),ze.registerAction("app:commandPalette",()=>x(N=>!N)),ze.registerAction("app:toggleSidebar",()=>k(N=>!N)),ze.registerAction("app:toggleTerminal",()=>{const N=y==="terminal"?"chat":"terminal";S(N),window.location.hash="/"+N}),ze.registerAction("app:newChat",()=>L()),ze.registerAction("app:settings",()=>{S("settings"),window.location.hash="/settings"}),ze.registerAction("app:focusInput",()=>{const N=document.querySelector("textarea");N==null||N.focus()}),ze.registerAction("app:keybindings",()=>{S("keybindings"),window.location.hash="/keybindings"})];return()=>F.forEach(N=>N())},[y,L,S,k]),C.useEffect(()=>{const F=new URLSearchParams(window.location.search),N=F.get("password"),O=F.get("token");if(N||O){pu(N||O),F.delete("password"),F.delete("token");const $=F.toString()?`${window.location.pathname}?${F.toString()}`:window.location.pathname;window.history.replaceState({},"",$)}t()},[t]),C.useEffect(()=>{if(e==="authenticated"){const F=Ec();S(F),(!window.location.hash||window.location.hash==="#")&&(window.location.hash=`/${F}`)}},[e,S]),C.useEffect(()=>My(N=>{S(N)}),[S]),C.useEffect(()=>{if(e==="authenticated"){const F=qt()||void 0;a({token:F,continue:!0})}},[e,a]),C.useEffect(()=>{document.documentElement.lang=g,document.title=s?`${s} - CodeBuddy Code`:p("page.title")},[g,p,s]),e==="loading")return n.jsx("div",{className:"flex h-screen h-[100dvh] bg-bg-primary text-text-primary transition-colors duration-200 font-sans overflow-hidden",children:n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx(nt,{size:"large",text:p("app.connecting")})})});if(e==="login")return n.jsx(Iv,{});const H=()=>{if(r==="connecting")return n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx(nt,{size:"large",text:p("app.connecting")})});if(r!=="connected"&&y!=="settings"&&y!=="docs")return n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsxs("div",{className:"text-center",children:[n.jsx("div",{className:"text-text-secondary mb-4 font-medium",children:p("app.connectFailed")}),n.jsx("button",{onClick:()=>a(),className:["px-6 py-2.5 bg-accent-brand text-white rounded-full","text-sm font-medium transition-all hover:bg-accent-brand/90","hover:scale-105 active:scale-95 shadow-sm"].join(" "),children:p("app.retry")})]})});switch(y){case"chat":return n.jsx(qe,{viewName:"chat",errorTitle:p("error.viewCrashed"),retryLabel:p("app.retry"),children:n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"flex-1 overflow-hidden w-full relative",children:c?n.jsx(aS,{}):n.jsx(I_,{onClickCloseBottomSheet:()=>u(!1)})}),n.jsx(yS,{}),n.jsx("div",{className:"flex-none bg-bg-primary",children:n.jsx(Cv,{onNavigate:P,onNewChat:L,onHistory:()=>h(!0),mainView:y,showBottomSheet:m,setShowBottomSheet:u})})]})});case"tasks":return n.jsx(qe,{viewName:"tasks",errorTitle:p("error.viewCrashed"),retryLabel:p("app.retry"),children:n.jsx(Xp,{})});case"plugins":return n.jsx(qe,{viewName:"plugins",errorTitle:p("error.viewCrashed"),retryLabel:p("app.retry"),children:n.jsx(zp,{})});case"terminal":return null;case"remote-control":return n.jsx(qe,{viewName:"remote-control",errorTitle:p("error.viewCrashed"),retryLabel:p("app.retry"),children:n.jsx(Zv,{onNavigate:P})});case"editor":return n.jsx(qe,{viewName:"editor",errorTitle:p("error.viewCrashed"),retryLabel:p("app.retry"),children:n.jsx(Fx,{onMenuClick:()=>k(F=>!F)})});case"changes":return n.jsx(qe,{viewName:"changes",errorTitle:p("error.viewCrashed"),retryLabel:p("app.retry"),children:n.jsx(Ju,{onMenuClick:()=>k(F=>!F)})});case"settings":return n.jsx(qe,{viewName:"settings",errorTitle:p("error.viewCrashed"),retryLabel:p("app.retry"),children:n.jsx(Gp,{})});case"keybindings":return n.jsx(qe,{viewName:"keybindings",errorTitle:p("error.viewCrashed"),retryLabel:p("app.retry"),children:n.jsx(Nv,{})});case"metrics":return n.jsx(qe,{viewName:"metrics",errorTitle:p("error.viewCrashed"),retryLabel:p("app.retry"),children:n.jsx(qv,{})});case"workers":return n.jsx(qe,{viewName:"workers",errorTitle:p("error.viewCrashed"),retryLabel:p("app.retry"),children:n.jsx(SS,{})});case"logs":return n.jsx(qe,{viewName:"logs",errorTitle:p("error.viewCrashed"),retryLabel:p("app.retry"),children:n.jsx(Pv,{})});case"docs":return n.jsx(qe,{viewName:"docs",errorTitle:p("error.viewCrashed"),retryLabel:p("app.retry"),children:n.jsx(Pd,{})});default:return null}};return y==="docs"&&window.location.hash.includes("standalone")?n.jsx("div",{className:"flex h-screen h-[100dvh] bg-bg-primary text-text-primary transition-colors duration-200 font-sans overflow-hidden",children:n.jsx(Pd,{})}):n.jsxs("div",{className:"flex h-screen h-[100dvh] bg-bg-primary text-text-primary transition-colors duration-200 font-sans overflow-hidden",children:[n.jsx(nS,{isOpen:b,onClose:()=>k(!1),mainView:y,onNavigate:P}),n.jsxs("div",{className:"flex-1 flex flex-col min-w-0 relative transition-all duration-300 h-full",children:[y!=="editor"&&y!=="changes"&&n.jsx(iS,{onMenuClick:()=>k(F=>!F),onNewChat:L,onSplitTerminal:D,onHistory:()=>h(!0),hasHistory:T}),n.jsxs("div",{className:"flex-1 flex flex-col w-full overflow-hidden relative",children:[n.jsx("div",{className:"flex-1 flex flex-col w-full",style:{display:y==="terminal"?"flex":"none"},children:n.jsx(Jp,{})}),y!=="terminal"&&H()]}),n.jsx(Ux,{isOpen:v,onClose:()=>h(!1),onSwitchSession:B})]}),n.jsx(pS,{}),n.jsx(z_,{isOpen:f,onClose:()=>x(!1),onNavigate:P,onNewChat:L})]})}xh.createRoot(document.getElementById("root")).render(n.jsx(C.StrictMode,{children:n.jsx(qe,{children:n.jsx(AS,{})})}));
|