@surething/cockpit 1.0.186 → 1.0.187
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/.next-prod/BUILD_ID +1 -1
- package/.next-prod/app-path-routes-manifest.json +23 -23
- package/.next-prod/build-manifest.json +2 -2
- package/.next-prod/prerender-manifest.json +3 -3
- package/.next-prod/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/_global-error.html +2 -2
- package/.next-prod/server/app/_global-error.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/_not-found.html +2 -2
- package/.next-prod/server/app/_not-found.rsc +2 -2
- package/.next-prod/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next-prod/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/.next-prod/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next-prod/server/app/api/bash/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/chat/codex/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/chat/kimi/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/chat/ollama/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/chat/route.js +3 -3
- package/.next-prod/server/app/api/chat/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/claude-stats/route.js +1 -1
- package/.next-prod/server/app/api/claude-stats/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/commands/route.js +1 -1
- package/.next-prod/server/app/api/commands/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/comments/route.js +1 -1
- package/.next-prod/server/app/api/comments/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/db/columns/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/db/connect/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/db/disconnect/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/db/export/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/db/query/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/db/schemas/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/extension/version/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/file/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/files/blame/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/files/clipboard/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/files/copy/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/files/delete/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/files/expanded/route.js +1 -1
- package/.next-prod/server/app/api/files/expanded/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/files/index/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/files/init/route.js +1 -1
- package/.next-prod/server/app/api/files/init/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/files/paste/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/files/read/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/files/readdir/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/files/recent/route.js +1 -1
- package/.next-prod/server/app/api/files/recent/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/files/save/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/files/search/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/git/branch-diff/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/git/branches/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/git/commit-diff/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/git/commits/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/git/diff/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/git/discard/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/git/stage/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/git/status/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/git/unstage/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/git/worktree/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/global-state/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/jupyter/load/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/jupyter/save/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/jupyter/shutdown/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/lsp/definition/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/lsp/hover/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/lsp/references/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/lsp/status/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/lsp/warmup/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/mysql/columns/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/mysql/connect/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/mysql/disconnect/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/mysql/export/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/mysql/query/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/mysql/schemas/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/neo4j/connect/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/neo4j/disconnect/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/neo4j/query/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/neo4j/schema/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/note/route.js +1 -1
- package/.next-prod/server/app/api/note/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/ollama/start/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/open-cursor/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/open-vscode/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/pick-folder/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/pinned-sessions/route.js +1 -1
- package/.next-prod/server/app/api/pinned-sessions/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/project-settings/route.js +1 -1
- package/.next-prod/server/app/api/project-settings/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/project-state/route.js +1 -1
- package/.next-prod/server/app/api/project-state/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/projects/route.js +1 -1
- package/.next-prod/server/app/api/projects/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/redis/command/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/redis/connect/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/redis/delete/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/redis/disconnect/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/redis/get/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/redis/keys/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/redis/set/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/review/[id]/comments/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/review/[id]/replies/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/review/[id]/route.js +1 -1
- package/.next-prod/server/app/api/review/[id]/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/review/identify/route.js +1 -1
- package/.next-prod/server/app/api/review/identify/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/review/order/route.js +1 -1
- package/.next-prod/server/app/api/review/order/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/review/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/review/share-info/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/review/users/route.js +1 -1
- package/.next-prod/server/app/api/review/users/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/scheduled-tasks/route.js +1 -1
- package/.next-prod/server/app/api/scheduled-tasks/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/services/config/route.js +1 -1
- package/.next-prod/server/app/api/services/config/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/services/scripts/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/session/[sessionId]/fork/route.js +1 -1
- package/.next-prod/server/app/api/session/[sessionId]/fork/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/session/[sessionId]/history/route.js +1 -1
- package/.next-prod/server/app/api/session/[sessionId]/history/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/session-by-path/route.js +1 -1
- package/.next-prod/server/app/api/session-by-path/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/sessions/projects/[encodedPath]/route.js +1 -1
- package/.next-prod/server/app/api/sessions/projects/[encodedPath]/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/sessions/projects/route.js +1 -1
- package/.next-prod/server/app/api/sessions/projects/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/sessions/route.js +1 -1
- package/.next-prod/server/app/api/sessions/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/settings/route.js +1 -1
- package/.next-prod/server/app/api/settings/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/terminal/aliases/route.js +1 -1
- package/.next-prod/server/app/api/terminal/aliases/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/terminal/autocomplete/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/terminal/bubble-order/route.js +1 -1
- package/.next-prod/server/app/api/terminal/bubble-order/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/terminal/env/route.js +1 -1
- package/.next-prod/server/app/api/terminal/env/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/terminal/history/route.js +1 -1
- package/.next-prod/server/app/api/terminal/history/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/version/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/page.js +1 -1
- package/.next-prod/server/app/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/project/page.js +4 -4
- package/.next-prod/server/app/project/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/review/[id]/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app-paths-manifest.json +23 -23
- package/.next-prod/server/chunks/4098.js +1 -1
- package/.next-prod/server/chunks/5394.js +1 -1
- package/.next-prod/server/chunks/6062.js +1 -1
- package/.next-prod/server/chunks/7284.js +1 -1
- package/.next-prod/server/pages/404.html +2 -2
- package/.next-prod/server/pages/500.html +2 -2
- package/.next-prod/server/server-reference-manifest.json +1 -1
- package/.next-prod/static/chunks/{1593-7902218f5b10761f.js → 1593-d845ec6e5c8de67e.js} +1 -1
- package/.next-prod/static/chunks/{5493-482fc2bbb049e7a4.js → 5493-83d6a5ec42d6cbb3.js} +1 -1
- package/.next-prod/static/chunks/app/page-cc2b332242bc2c93.js +1 -0
- package/.next-prod/static/chunks/app/project/page-95039285184e0c74.js +25 -0
- package/.next-prod/static/css/bbd65867698c479b.css +3 -0
- package/.next-prod/trace +12 -12
- package/.next-prod/trace-build +1 -1
- package/dist/{chunk-VV5VMA4B.mjs → chunk-KLV3PBIZ.mjs} +17 -0
- package/dist/scheduledTasks.mjs +7 -2
- package/dist/wsServer.mjs +1 -1
- package/package.json +2 -2
- package/.next-prod/static/chunks/app/page-cc2bf3ca4c337090.js +0 -1
- package/.next-prod/static/chunks/app/project/page-62d5a8ed458279b8.js +0 -25
- package/.next-prod/static/css/1573b510894a4234.css +0 -3
- /package/.next-prod/static/{0mBqfZkcLM2Y1ikI9uxKG → Avd2f2SegjGOElSYvrTlK}/_buildManifest.js +0 -0
- /package/.next-prod/static/{0mBqfZkcLM2Y1ikI9uxKG → Avd2f2SegjGOElSYvrTlK}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5493],{10611:(e,t,s)=>{s.d(t,{G:()=>u,f:()=>h});var n=s(12115);function r(){if("u"<typeof document)return null;let e=document.querySelector('meta[name="cockpit-bridge"]');if(!e)return null;let t=e.dataset.id,s=e.dataset.version;return t?{id:t,version:s||"unknown"}:null}let a=null,o=new Set;function l(){o.forEach(e=>e())}function i(e){o.add(e);let t=r();return t&&!a&&(a=t,Promise.resolve().then(l)),()=>{o.delete(e)}}function d(){return a}function c(){return null}if("u">typeof document&&(a=r()),"u">typeof MutationObserver&&"u">typeof document){let e=new MutationObserver(()=>{let e=r();e&&(!a||e.id!==a.id||e.version!==a.version)&&(a=e,l())}),t=document.head||document.documentElement;t&&e.observe(t,{childList:!0})}function u(){return(0,n.useSyncExternalStore)(i,d,c)}function h(){return a??r()}},18658:(e,t,s)=>{s.d(t,{n:()=>o});var n=s(12115);let r="SCHEDULED_TASKS_CHANGED";function a(){try{window.parent.postMessage({type:r},"*")}catch{}document.querySelectorAll("iframe").forEach(e=>{try{e.contentWindow?.postMessage({type:r},"*")}catch{}})}function o(){let[e,t]=(0,n.useState)([]),[s,o]=(0,n.useState)(0),l=(0,n.useCallback)(()=>{fetch("/api/scheduled-tasks").then(e=>e.json()).then(e=>{t(e.tasks||[]),o(e.unreadCount||0)}).catch(()=>{})},[]);(0,n.useEffect)(()=>{l()},[l]),(0,n.useEffect)(()=>{let e=e=>{e.data?.type===r&&l()};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)},[l]);let i=(0,n.useCallback)(async e=>{try{let t=await fetch("/api/scheduled-tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();if(s.task)return l(),a(),s.task;return null}catch{return null}},[l]),d=(0,n.useCallback)(async e=>{await fetch("/api/scheduled-tasks",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,action:"pause"})}).catch(()=>{}),l(),a()},[l]),c=(0,n.useCallback)(async e=>{await fetch("/api/scheduled-tasks",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,action:"resume"})}).catch(()=>{}),l(),a()},[l]),u=(0,n.useCallback)(async e=>{await fetch("/api/scheduled-tasks",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e})}).catch(()=>{}),l(),a()},[l]),h=(0,n.useCallback)(async(e,t)=>{await fetch("/api/scheduled-tasks",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,action:"update",fields:t})}).catch(()=>{}),l(),a()},[l]),m=(0,n.useCallback)(async e=>{await fetch("/api/scheduled-tasks",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,action:"trigger"})}).catch(()=>{}),l(),a()},[l]),x=(0,n.useCallback)(async e=>{await fetch("/api/scheduled-tasks",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,action:"markRead"})}).catch(()=>{}),l(),a()},[l]),f=(0,n.useCallback)(async()=>{await fetch("/api/scheduled-tasks",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:"_",action:"markAllRead"})}).catch(()=>{}),l(),a()},[l]),p=(0,n.useCallback)(async e=>{await fetch("/api/scheduled-tasks",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:"_",action:"reorder",fields:{orderedIds:e}})}).catch(()=>{}),l(),a()},[l]);return{tasks:e,unreadCount:s,reload:l,createTask:i,pauseTask:d,resumeTask:c,triggerTask:m,deleteTask:u,updateTask:h,markRead:x,markAllRead:f,reorderTasks:p}}},22552:(e,t,s)=>{s.d(t,{h:()=>a});var n=s(12115);let r=new Map;function a({url:e,onMessage:t,enabled:s=!0}){let a=(0,n.useRef)(t);(0,n.useEffect)(()=>{a.current=t}),(0,n.useEffect)(()=>{if(!s)return;let t=e=>a.current(e),n=function(e){let t=r.get(e);if(t)return t;let s={ws:null,listeners:new Set,retryCount:0,retryTimer:null,connect(){let t="https:"===window.location.protocol?"wss:":"ws:",n=new WebSocket(`${t}//${window.location.host}${e}`);n.onopen=()=>{s.retryCount=0},n.onmessage=e=>{try{let t=JSON.parse(e.data);if("ping"===t.type)return;s.listeners.forEach(e=>e(t))}catch{}},n.onclose=()=>{if(0===s.listeners.size)return;let e=Math.min(1e3*Math.pow(1.5,s.retryCount),1e4);s.retryCount++,s.retryTimer=setTimeout(()=>s.connect(),e)},n.onerror=()=>{},s.ws=n},destroy(){s.retryTimer&&clearTimeout(s.retryTimer),s.ws&&s.ws.close(),s.ws=null,r.delete(e)}};return r.set(e,s),s.connect(),s}(e);return n.listeners.add(t),()=>{n.listeners.delete(t),0===n.listeners.size&&n.destroy()}},[e,s])}},28147:(e,t,s)=>{s.d(t,{E:()=>d});var n=s(95155),r=s(12115),a=s(79114),o=s(87918),l=s(72588);let i={once:[{labelKey:"scheduledTasks.5minLater",value:5},{labelKey:"scheduledTasks.15minLater",value:15},{labelKey:"scheduledTasks.30minLater",value:30},{labelKey:"scheduledTasks.1hourLater",value:60}],interval:[{labelKey:"scheduledTasks.every15min",value:15},{labelKey:"scheduledTasks.every30min",value:30},{labelKey:"scheduledTasks.every1hour",value:60},{labelKey:"scheduledTasks.every2hours",value:120}],cron:[{labelKey:"scheduledTasks.daily9am",value:"0 9 * * *"},{labelKey:"scheduledTasks.daily6pm",value:"0 18 * * *"},{labelKey:"scheduledTasks.weeklyMon9am",value:"0 9 * * 1"},{labelKey:"scheduledTasks.monthly1st9am",value:"0 9 1 * *"}]};function d({onClose:e,onCreate:t,editTask:s,onUpdate:d}){let{t:c}=(0,a.Bd)(),u=!!s,[h,m]=(0,r.useState)(s?.type||"once"),[x,f]=(0,r.useState)(s?.message||""),[p,g]=(0,r.useState)(s?String(s.delayMinutes||s.intervalMinutes||""):""),[b,v]=(0,r.useState)(s?.cron||""),[y,j]=(0,r.useState)(s?.activeFrom||"09:00"),[k,N]=(0,r.useState)(s?.activeTo||"18:00"),[w,C]=(0,r.useState)(!!(s?.activeFrom&&s?.activeTo)),[T,S]=(0,r.useState)(null),E=(0,r.useRef)(null),P=(0,r.useRef)(null);(0,r.useEffect)(()=>{P.current?.focus()},[]),(0,r.useEffect)(()=>{let t=t=>{E.current&&!E.current.contains(t.target)&&e()};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[e]);let L=(0,r.useCallback)(()=>{if(!x.trim())return;let n=null;if("once"===h){let e=T||parseInt(p,10);if(!e||e<=0)return;n={message:x.trim(),type:"once",delayMinutes:e}}else if("interval"===h){let e=T||parseInt(p,10);if(!e||e<=0)return;n={message:x.trim(),type:"interval",intervalMinutes:e,...w?{activeFrom:y,activeTo:k}:{}}}else if("cron"===h){let e=T||b.trim();if(!e)return;n={message:x.trim(),type:"cron",cron:e}}n&&(u&&s&&d?d(s.id,n):t(n),e())},[x,h,T,p,b,w,y,k,t,e,u,s,d]);return(0,n.jsxs)("div",{ref:E,className:`w-80 bg-popover border border-border rounded-lg shadow-lg z-50 ${u?"":"absolute bottom-full left-0 mb-2"}`,onKeyDown:t=>{"Escape"===t.key?e():"Enter"===t.key&&(t.metaKey||t.ctrlKey)&&L()},children:[(0,n.jsx)("div",{className:"px-3 py-2 border-b border-border bg-muted/50 rounded-t-lg",children:(0,n.jsx)("span",{className:"text-sm font-medium",children:u?c("scheduledTasks.editTask"):c("scheduledTasks.createTask")})}),(0,n.jsxs)("div",{className:"p-3 space-y-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"text-xs text-muted-foreground mb-1 block",children:c("scheduledTasks.sendMessage")}),(0,n.jsx)("textarea",{ref:P,value:x,onChange:e=>f(e.target.value),placeholder:c("scheduledTasks.messagePlaceholder"),rows:2,className:"w-full px-2 py-1.5 text-sm border border-border rounded bg-card text-foreground placeholder-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring resize-none"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"text-xs text-muted-foreground mb-1 block",children:c("scheduledTasks.type")}),(0,n.jsx)("div",{className:"flex gap-1",children:["once","interval","cron"].map(e=>(0,n.jsx)("button",{onClick:()=>{m(e),S(null),g(""),v("")},className:`flex-1 px-2 py-1 text-xs rounded transition-colors ${h===e?"bg-brand text-white":"bg-muted text-muted-foreground hover:text-foreground"}`,children:"once"===e?c("scheduledTasks.once"):"interval"===e?c("scheduledTasks.interval"):"Cron"},e))})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"text-xs text-muted-foreground mb-1 block",children:c("scheduledTasks.quickSelect")}),(0,n.jsx)("div",{className:"grid grid-cols-2 gap-1",children:i[h].map(e=>(0,n.jsx)("button",{onClick:()=>{S(e.value),"cron"===h?v(String(e.value)):g(String(e.value))},className:`px-2 py-1 text-xs rounded border transition-colors ${T===e.value?"border-brand bg-brand/10 text-brand":"border-border text-muted-foreground hover:text-foreground hover:border-foreground/30"}`,children:c(e.labelKey)},e.labelKey))})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"text-xs text-muted-foreground mb-1 block",children:"cron"===h?c("scheduledTasks.customCron"):c("scheduledTasks.customMinutes")}),"cron"===h?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("input",{type:"text",value:b,onChange:e=>{v(e.target.value),S(null)},placeholder:c("scheduledTasks.cronPlaceholder"),className:"w-full px-2 py-1.5 text-sm border border-border rounded bg-card text-foreground placeholder-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring font-mono"}),b.trim()&&(0,n.jsx)("div",{className:"mt-1 text-xs text-muted-foreground",children:function(e){let t=o.A.t,s=e.trim().split(/\s+/);if(5!==s.length)return null;let[n,r,a,l,i]=s,d={0:t("cron.dowSun"),1:t("cron.dowMon"),2:t("cron.dowTue"),3:t("cron.dowWed"),4:t("cron.dowThu"),5:t("cron.dowFri"),6:t("cron.dowSat")},c={1:`1${t("cron.monthPrefix")}`,2:`2${t("cron.monthPrefix")}`,3:`3${t("cron.monthPrefix")}`,4:`4${t("cron.monthPrefix")}`,5:`5${t("cron.monthPrefix")}`,6:`6${t("cron.monthPrefix")}`,7:`7${t("cron.monthPrefix")}`,8:`8${t("cron.monthPrefix")}`,9:`9${t("cron.monthPrefix")}`,10:`10${t("cron.monthPrefix")}`,11:`11${t("cron.monthPrefix")}`,12:`12${t("cron.monthPrefix")}`};try{let e="";if(n.includes("/")||r.includes("/")){if("*"===r&&n.includes("/"))return t("cron.everyNMinutes",{n:n.split("/")[1]});if("0"===n&&r.includes("/"))return t("cron.everyNHours",{n:r.split("/")[1]});return null}let s=parseInt(r,10),o=parseInt(n,10);if(isNaN(s)&&"*"!==r||isNaN(o)&&"*"!==n)return null;e="*"===r&&"*"===n?t("cron.everyMinute"):"*"===r?t("cron.everyHourAtMin",{m:o}):"*"===n?t("cron.hourlyEveryMin",{h:s}):`${String(s).padStart(2,"0")}:${String(o).padStart(2,"0")}`;let u=[];if("*"!==l){let e=l.split(",").map(e=>c[e]||`${e}${t("cron.monthPrefix")}`);u.push(e.join(", "))}if("*"!==a)if(a.includes("-")){let[e,s]=a.split("-");u.push(t("cron.dayRange",{a:e,b:s}))}else a.includes(",")?u.push(a.split(",").map(e=>`${e}${t("cron.dayOfMonth")}`).join(", ")):u.push(`${a}${t("cron.dayOfMonth")}`);if("*"!==i)if("1-5"===i)u.push(t("cron.weekdays"));else if("0,6"===i||"6,0"===i)u.push(t("cron.weekends"));else{let e=i.split(",").map(e=>{if(e.includes("-")){let[s,n]=e.split("-");return t("cron.weekdayRange",{a:d[s]||s,b:d[n]||n})}return`${t("cron.weekdayPrefix")}${d[e]||e}`});u.push(e.join(", "))}if(0===u.length&&"*"===a&&"*"===l&&"*"===i)return t("cron.daily",{time:e});return`${u.join(" ")} ${e}`}catch{return null}}(b.trim())||(0,n.jsx)("span",{className:"text-destructive",children:c("scheduledTasks.cronFormat")})})]}):(0,n.jsx)("input",{type:"number",value:p,onChange:e=>{g(e.target.value),S(null)},placeholder:c("scheduledTasks.minutesPlaceholder"),min:1,className:"w-full px-2 py-1.5 text-sm border border-border rounded bg-card text-foreground placeholder-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),"interval"===h&&(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground mb-1 cursor-pointer",children:[(0,n.jsx)("input",{type:"checkbox",checked:w,onChange:e=>C(e.target.checked),className:"rounded border-border"}),c("scheduledTasks.limitTimeRange")]}),w&&(0,n.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,n.jsx)("input",{type:"time",value:y,onChange:e=>j(e.target.value),className:"flex-1 px-2 py-1 text-sm border border-border rounded bg-card text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:c("scheduledTasks.to")}),(0,n.jsx)("input",{type:"time",value:k,onChange:e=>N(e.target.value),className:"flex-1 px-2 py-1 text-sm border border-border rounded bg-card text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]})]}),(0,n.jsx)("button",{onClick:L,disabled:!(x.trim()&&("once"===h||"interval"===h?!!(T||p&&parseInt(p,10)>0):"cron"===h&&!!(T||b.trim()))),className:"w-full py-1.5 text-sm font-medium rounded bg-brand text-white hover:bg-brand/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:u?c("scheduledTasks.saveBtn",{modKey:(0,l.Mu)()}):c("scheduledTasks.createBtn",{modKey:(0,l.Mu)()})})]})]})}},31914:(e,t,s)=>{s.d(t,{b:()=>c});var n=s(95155),r=s(12115),a=s(79114),o=s(72816),l=s(38093),i=s(72588),d=s(10611);function c({isOpen:e,onClose:t}){let{t:s,i18n:c}=(0,a.Bd)(),{theme:u,setTheme:h}=(0,o.D)(),m=(0,d.G)(),[x,f]=(0,r.useState)(""),[p,g]=(0,r.useState)(""),[b,v]=(0,r.useState)("auto");(0,r.useEffect)(()=>{e&&fetch("/api/settings").then(e=>e.json()).then(e=>{e.language&&v(e.language)}).catch(()=>{})},[e]);let y=(0,r.useCallback)(e=>{v(e),fetch("/api/settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({language:e})}).catch(()=>{});let t="auto"===e?navigator.language.startsWith("zh")?"zh":"en":e;c.changeLanguage(t)},[c]),j=m?"installed":"not-installed",k=m?.version??null;if((0,r.useEffect)(()=>{e&&fetch("/api/version").then(e=>e.json()).then(e=>{e.version&&g(e.version)}).catch(()=>{})},[e]),(0,r.useEffect)(()=>{e&&fetch("/api/extension/version").then(e=>e.json()).then(e=>{e.path&&f(e.path)}).catch(()=>{})},[e]),!e)return null;let N=[{value:"system",label:s("settings.themeSystem"),icon:"\uD83D\uDCBB"},{value:"light",label:s("settings.themeLight"),icon:"☀️"},{value:"dark",label:s("settings.themeDark"),icon:"\uD83C\uDF19"}];return(0,n.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,n.jsx)("div",{className:"absolute inset-0 bg-black/50",onClick:t}),(0,n.jsxs)("div",{className:"relative bg-card rounded-lg shadow-xl w-full max-w-md mx-4 overflow-hidden",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[(0,n.jsx)("h2",{className:"text-sm font-medium text-foreground",children:s("settings.title")}),(0,n.jsx)("button",{onClick:t,className:"p-1 text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors",children:(0,n.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsxs)("div",{className:"p-4 space-y-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:s("settings.theme")}),(0,n.jsx)("div",{className:"grid grid-cols-3 gap-2",children:N.map(e=>(0,n.jsxs)("button",{onClick:()=>h(e.value),className:`flex flex-col items-center gap-1 p-3 rounded-lg border transition-colors ${u===e.value?"border-brand bg-brand/10 text-brand":"border-border hover:border-slate-6 text-muted-foreground hover:text-foreground"}`,children:[(0,n.jsx)("span",{className:"text-xl",children:e.icon}),(0,n.jsx)("span",{className:"text-xs font-medium",children:e.label})]},e.value))})]}),(0,n.jsx)("div",{className:"border-t border-border"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:s("settings.language")}),(0,n.jsx)("div",{className:"grid grid-cols-3 gap-2",children:[{value:"auto",label:s("settings.languageAuto"),icon:"\uD83C\uDF10"},{value:"en",label:"English",icon:"\uD83C\uDDFA\uD83C\uDDF8"},{value:"zh",label:"中文",icon:"\uD83C\uDDE8\uD83C\uDDF3"}].map(e=>(0,n.jsxs)("button",{onClick:()=>y(e.value),className:`flex flex-col items-center gap-1 p-3 rounded-lg border transition-colors ${b===e.value?"border-brand bg-brand/10 text-brand":"border-border hover:border-slate-6 text-muted-foreground hover:text-foreground"}`,children:[(0,n.jsx)("span",{className:"text-xl",children:e.icon}),(0,n.jsx)("span",{className:"text-xs font-medium",children:e.label})]},e.value))})]}),(0,n.jsx)("div",{className:"border-t border-border"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:s("settings.browserExtension")}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,n.jsx)("span",{className:`inline-block w-2 h-2 rounded-full flex-shrink-0 ${"installed"===j?"bg-green-500":"bg-slate-400"}`}),(0,n.jsxs)("span",{children:["installed"===j&&`${s("settings.extensionInstalled")}${k?` (v${k})`:""}`,"not-installed"===j&&s("settings.extensionNotInstalled")]})]}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground leading-relaxed",children:s("settings.extensionDescription")}),"installed"!==j&&(0,n.jsxs)("div",{className:"text-xs text-muted-foreground bg-muted/50 rounded-md p-2 space-y-1",children:[(0,n.jsx)("p",{className:"font-medium text-foreground",children:s("settings.installSteps")}),(0,n.jsxs)("p",{children:[s("settings.step1")," ",(0,n.jsx)("code",{className:"px-1 py-0.5 bg-muted rounded text-foreground",children:"chrome://extensions"})]}),(0,n.jsx)("p",{children:s("settings.step2")}),(0,n.jsx)("p",{children:s("settings.step3")}),(0,i.L)()&&(0,n.jsx)("p",{dangerouslySetInnerHTML:{__html:s("settings.step4mac")}})]}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)("button",{onClick:()=>{let e=x||"chrome-extension";navigator.clipboard.writeText(e),(0,l.oR)(s("toast.copiedName",{name:e}))},className:"px-3 py-1.5 text-xs bg-brand text-white rounded-md hover:bg-brand/90 transition-colors",children:s("settings.copyExtensionPath")}),"installed"===j&&(0,n.jsx)("button",{onClick:()=>{m?.id&&window.chrome?.runtime?.sendMessage&&(window.chrome.runtime.sendMessage(m.id,{type:"reload"}),(0,l.oR)(s("toast.pluginReloading")))},className:"px-3 py-1.5 text-xs border border-border text-foreground rounded-md hover:bg-muted transition-colors",children:s("settings.reloadExtension")})]}),x&&(0,n.jsx)("p",{className:"text-[11px] text-muted-foreground font-mono truncate",children:x})]})]}),(0,n.jsx)("div",{className:"border-t border-border"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:s("settings.about")}),(0,n.jsxs)("div",{className:"text-xs text-muted-foreground space-y-1",children:[(0,n.jsxs)("p",{children:["Cockpit",p?` v${p}`:""]}),(0,n.jsx)("p",{className:"text-muted-foreground/60",children:"One seat. One AI. Everything under control."})]})]})]})]})]})}},36998:(e,t,s)=>{s.d(t,{P:()=>r});var n=s(12115);function r(){let[e,t]=(0,n.useState)([]),s=(0,n.useCallback)(()=>{fetch("/api/pinned-sessions").then(e=>e.json()).then(e=>t(e.sessions||[])).catch(()=>{})},[]);(0,n.useEffect)(()=>{s()},[s]),(0,n.useEffect)(()=>{let e=e=>{e.data?.type==="PINNED_SESSIONS_CHANGED"&&s()};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)},[s]);let r=(0,n.useCallback)(e=>{t(e),fetch("/api/pinned-sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessions:e})}).catch(()=>{});try{window.parent.postMessage({type:"PINNED_SESSIONS_CHANGED"},"*")}catch{}},[]),a=(0,n.useCallback)(t=>e.some(e=>e.sessionId===t),[e]),o=(0,n.useCallback)((t,s,n)=>{e.some(e=>e.sessionId===t)||r([...e,{sessionId:t,cwd:s,customTitle:n}])},[e,r]),l=(0,n.useCallback)(t=>{r(e.filter(e=>e.sessionId!==t))},[e,r]),i=(0,n.useCallback)((t,s)=>{r(e.map(e=>e.sessionId===t?{...e,customTitle:s}:e))},[e,r]);return{pinnedSessions:e,isPinned:a,pinSession:o,unpinSession:l,updateTitle:i,reorder:(0,n.useCallback)(e=>{r(e)},[r]),reload:s}}},72588:(e,t,s)=>{s.d(t,{L:()=>r,Mu:()=>a});var n=s(41463);function r(){return!("u"<typeof navigator)&&(/Mac|iPhone|iPad/.test(navigator.platform||"")||navigator.userAgentData?.platform==="macOS")}function a(){return r()?"⌘":"Ctrl+"}n.platform,n.platform,n.platform},97440:(e,t,s)=>{s.d(t,{r:()=>o});var n=s(95155),r=s(12115),a=s(79114);function o({isOpen:e,onClose:t,onSelectSession:s,onAddProject:o}){let{t:l}=(0,a.Bd)(),[i,d]=(0,r.useState)(!1),[c,u]=(0,r.useState)([]),[h,m]=(0,r.useState)({}),[x,f]=(0,r.useState)(!1),[p,g]=(0,r.useState)(null),[b,v]=(0,r.useState)(""),y=(0,r.useRef)(null),j=(0,r.useCallback)(async()=>{f(!0),g(null),m({});try{let e=await fetch("/api/sessions/projects");if(!e.ok)throw Error("Failed to load projects");let t=await e.json();u(t)}catch(e){g(e instanceof Error?e.message:"Unknown error")}finally{f(!1)}},[]),k=(0,r.useCallback)(async e=>{m(t=>({...t,[e]:{...t[e],isExpanded:!0,isLoading:!0,sessions:[],error:null}}));try{let t=await fetch(`/api/sessions/projects/${encodeURIComponent(e)}`);if(!t.ok)throw Error("Failed to load sessions");let s=await t.json();m(t=>({...t,[e]:{...t[e],isLoading:!1,sessions:s}}))}catch(t){m(s=>({...s,[e]:{...s[e],isLoading:!1,error:t instanceof Error?t.message:"Unknown error"}}))}},[]),N=(0,r.useCallback)(e=>{let t=h[e];t?.isExpanded?m(t=>({...t,[e]:{...t[e],isExpanded:!1}})):t?.sessions?.length?m(t=>({...t,[e]:{...t[e],isExpanded:!0}})):k(e)},[h,k]);(0,r.useEffect)(()=>{e&&(j(),setTimeout(()=>{y.current?.focus()},100))},[e,j]);let w=(0,r.useCallback)(async()=>{if(!i){d(!0);try{let e=await fetch("/api/pick-folder"),s=await e.json();s.folder&&o&&(o(s.folder),t())}catch{}finally{d(!1)}}},[i,o,t]);return((0,r.useEffect)(()=>{let s=s=>{"Escape"===s.key&&e&&t()};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[e,t]),e)?(0,n.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,n.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:t}),(0,n.jsxs)("div",{className:"relative w-full max-w-6xl h-[90vh] mx-4 bg-card rounded-lg shadow-xl flex flex-col overflow-hidden",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[(0,n.jsx)("h2",{className:"text-sm font-medium text-foreground",children:l("sessions.projectList")}),(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)("input",{ref:y,type:"text",placeholder:l("workspace.searchProjectPath"),value:b,onChange:e=>v(e.target.value),className:"px-2 py-1 text-xs border border-border rounded bg-card text-foreground placeholder-slate-9 focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent"}),o&&(0,n.jsxs)("button",{onClick:w,disabled:i,className:"flex items-center gap-1.5 px-2.5 py-1 text-xs rounded-md border border-border text-muted-foreground hover:text-foreground hover:bg-accent transition-colors disabled:opacity-50",title:l("sessions.openFolder"),children:[(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 10v6m3-3H9m-4 7h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),i?l("sessions.selectingFolder"):l("sessions.openFolder")]}),(0,n.jsx)("button",{onClick:t,className:"p-1 text-slate-9 hover:text-foreground hover:bg-accent rounded transition-colors",children:(0,n.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),(0,n.jsxs)("div",{className:"flex-1 overflow-y-auto p-4",children:[x&&(0,n.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,n.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,n.jsxs)("svg",{className:"animate-spin h-4 w-4",fill:"none",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,n.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,n.jsx)("span",{children:l("workspace.loadingProjects")})]})}),p&&(0,n.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,n.jsx)("div",{className:"text-xs text-red-11",children:p})}),!x&&!p&&0===c.length&&(0,n.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:l("workspace.projectNotFound")})}),!x&&!p&&c.filter(e=>e.fullPath.toLowerCase().includes(b.toLowerCase())).map(e=>{let t=h[e.encodedPath]||{isExpanded:!1,isLoading:!1,sessions:[],error:null};return(0,n.jsxs)("div",{className:"mb-3",children:[(0,n.jsxs)("button",{onClick:()=>N(e.encodedPath),className:"w-full flex items-center gap-2 p-2 rounded hover:bg-accent transition-colors text-left",children:[(0,n.jsx)("svg",{className:`w-3 h-3 text-muted-foreground transition-transform ${t.isExpanded?"rotate-90":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,n.jsx)("svg",{className:"w-4 h-4 text-muted-foreground",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})}),(0,n.jsx)("span",{className:"flex-1 text-xs font-medium text-foreground truncate",title:e.fullPath,children:e.fullPath}),(0,n.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",e.sessionCount,")"]})]}),t.isExpanded&&(0,n.jsxs)("div",{className:"ml-6 mt-2",children:[t.isLoading&&(0,n.jsxs)("div",{className:"flex items-center gap-2 p-3 text-xs text-muted-foreground",children:[(0,n.jsxs)("svg",{className:"animate-spin h-3 w-3",fill:"none",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,n.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,n.jsx)("span",{children:l("sessions.loadingSessions")})]}),t.error&&(0,n.jsx)("div",{className:"p-3 text-xs text-red-11",children:t.error}),!t.isLoading&&!t.error&&(0,n.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:t.sessions.map(t=>(0,n.jsxs)("div",{onClick:()=>{var n;let r;return n=e.fullPath,r=(t.path.split("/").pop()||"").replace(".jsonl",""),void(s?s(n,r):window.parent.postMessage({type:"OPEN_PROJECT",cwd:n,sessionId:r},"*"))},className:"p-3 bg-secondary rounded border border-border hover:border-brand hover:shadow-md cursor-pointer transition-all",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[t.engine&&"claude"!==t.engine&&(0,n.jsx)("span",{className:`shrink-0 px-1 py-0.5 text-[10px] leading-none font-medium rounded ${"ollama"===t.engine?"bg-blue-500/15 text-blue-11":"codex"===t.engine?"bg-green-500/15 text-green-11":"kimi"===t.engine?"bg-purple-500/15 text-purple-11":"bg-muted text-muted-foreground"}`,children:t.engine}),(0,n.jsx)("h4",{className:"text-xs font-medium text-foreground truncate",title:t.title,children:t.title})]}),(0,n.jsx)("div",{className:"text-xs text-muted-foreground mb-2",children:new Date(t.modifiedAt).toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}),(0,n.jsxs)("div",{className:"space-y-0.5 text-xs",children:[t.firstMessages.map((e,t)=>(0,n.jsxs)("div",{className:"text-foreground truncate",title:e,children:[(0,n.jsx)("span",{className:"text-slate-9 mr-1",children:"•"}),e]},`first-${t}`)),t.lastMessages.length>0&&(0,n.jsx)("div",{className:"text-slate-9 text-center py-0.5",children:"\xb7\xb7\xb7"}),t.lastMessages.map((e,t)=>(0,n.jsxs)("div",{className:"text-foreground truncate",title:e,children:[(0,n.jsx)("span",{className:"text-slate-9 mr-1",children:"•"}),e]},`last-${t}`))]})]},t.path))})]})]},e.encodedPath)})]})]})]}):null}}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5493],{10611:(e,t,s)=>{s.d(t,{G:()=>u,f:()=>h});var n=s(12115);function r(){if("u"<typeof document)return null;let e=document.querySelector('meta[name="cockpit-bridge"]');if(!e)return null;let t=e.dataset.id,s=e.dataset.version;return t?{id:t,version:s||"unknown"}:null}let a=null,o=new Set;function l(){o.forEach(e=>e())}function i(e){o.add(e);let t=r();return t&&!a&&(a=t,Promise.resolve().then(l)),()=>{o.delete(e)}}function d(){return a}function c(){return null}if("u">typeof document&&(a=r()),"u">typeof MutationObserver&&"u">typeof document){let e=new MutationObserver(()=>{let e=r();e&&(!a||e.id!==a.id||e.version!==a.version)&&(a=e,l())}),t=document.head||document.documentElement;t&&e.observe(t,{childList:!0})}function u(){return(0,n.useSyncExternalStore)(i,d,c)}function h(){return a??r()}},18658:(e,t,s)=>{s.d(t,{n:()=>o});var n=s(12115);let r="SCHEDULED_TASKS_CHANGED";function a(){try{window.parent.postMessage({type:r},"*")}catch{}document.querySelectorAll("iframe").forEach(e=>{try{e.contentWindow?.postMessage({type:r},"*")}catch{}})}function o(){let[e,t]=(0,n.useState)([]),[s,o]=(0,n.useState)(0),l=(0,n.useCallback)(()=>{fetch("/api/scheduled-tasks").then(e=>e.json()).then(e=>{t(e.tasks||[]),o(e.unreadCount||0)}).catch(()=>{})},[]);(0,n.useEffect)(()=>{l()},[l]),(0,n.useEffect)(()=>{let e=e=>{e.data?.type===r&&l()};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)},[l]);let i=(0,n.useCallback)(async e=>{try{let t=await fetch("/api/scheduled-tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();if(s.task)return l(),a(),s.task;return null}catch{return null}},[l]),d=(0,n.useCallback)(async e=>{await fetch("/api/scheduled-tasks",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,action:"pause"})}).catch(()=>{}),l(),a()},[l]),c=(0,n.useCallback)(async e=>{await fetch("/api/scheduled-tasks",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,action:"resume"})}).catch(()=>{}),l(),a()},[l]),u=(0,n.useCallback)(async e=>{await fetch("/api/scheduled-tasks",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e})}).catch(()=>{}),l(),a()},[l]),h=(0,n.useCallback)(async(e,t)=>{await fetch("/api/scheduled-tasks",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,action:"update",fields:t})}).catch(()=>{}),l(),a()},[l]),m=(0,n.useCallback)(async e=>{await fetch("/api/scheduled-tasks",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,action:"trigger"})}).catch(()=>{}),l(),a()},[l]),x=(0,n.useCallback)(async e=>{await fetch("/api/scheduled-tasks",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,action:"markRead"})}).catch(()=>{}),l(),a()},[l]),f=(0,n.useCallback)(async()=>{await fetch("/api/scheduled-tasks",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:"_",action:"markAllRead"})}).catch(()=>{}),l(),a()},[l]),p=(0,n.useCallback)(async e=>{await fetch("/api/scheduled-tasks",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:"_",action:"reorder",fields:{orderedIds:e}})}).catch(()=>{}),l(),a()},[l]);return{tasks:e,unreadCount:s,reload:l,createTask:i,pauseTask:d,resumeTask:c,triggerTask:m,deleteTask:u,updateTask:h,markRead:x,markAllRead:f,reorderTasks:p}}},22552:(e,t,s)=>{s.d(t,{h:()=>a});var n=s(12115);let r=new Map;function a({url:e,onMessage:t,enabled:s=!0}){let a=(0,n.useRef)(t);(0,n.useEffect)(()=>{a.current=t}),(0,n.useEffect)(()=>{if(!s)return;let t=e=>a.current(e),n=function(e){let t=r.get(e);if(t)return t;let s={ws:null,listeners:new Set,retryCount:0,retryTimer:null,connect(){let t="https:"===window.location.protocol?"wss:":"ws:",n=new WebSocket(`${t}//${window.location.host}${e}`);n.onopen=()=>{s.retryCount=0},n.onmessage=e=>{try{let t=JSON.parse(e.data);if("ping"===t.type)return;s.listeners.forEach(e=>e(t))}catch{}},n.onclose=()=>{if(0===s.listeners.size)return;let e=Math.min(1e3*Math.pow(1.5,s.retryCount),1e4);s.retryCount++,s.retryTimer=setTimeout(()=>s.connect(),e)},n.onerror=()=>{},s.ws=n},destroy(){s.retryTimer&&clearTimeout(s.retryTimer),s.ws&&s.ws.close(),s.ws=null,r.delete(e)}};return r.set(e,s),s.connect(),s}(e);return n.listeners.add(t),()=>{n.listeners.delete(t),0===n.listeners.size&&n.destroy()}},[e,s])}},28147:(e,t,s)=>{s.d(t,{E:()=>d});var n=s(95155),r=s(12115),a=s(79114),o=s(87918),l=s(72588);let i={once:[{labelKey:"scheduledTasks.5minLater",value:5},{labelKey:"scheduledTasks.15minLater",value:15},{labelKey:"scheduledTasks.30minLater",value:30},{labelKey:"scheduledTasks.1hourLater",value:60}],interval:[{labelKey:"scheduledTasks.every15min",value:15},{labelKey:"scheduledTasks.every30min",value:30},{labelKey:"scheduledTasks.every1hour",value:60},{labelKey:"scheduledTasks.every2hours",value:120}],cron:[{labelKey:"scheduledTasks.daily9am",value:"0 9 * * *"},{labelKey:"scheduledTasks.daily6pm",value:"0 18 * * *"},{labelKey:"scheduledTasks.weeklyMon9am",value:"0 9 * * 1"},{labelKey:"scheduledTasks.monthly1st9am",value:"0 9 1 * *"}]};function d({onClose:e,onCreate:t,editTask:s,onUpdate:d}){let{t:c}=(0,a.Bd)(),u=!!s,[h,m]=(0,r.useState)(s?.type||"once"),[x,f]=(0,r.useState)(s?.message||""),[p,g]=(0,r.useState)(s?String(s.delayMinutes||s.intervalMinutes||""):""),[b,v]=(0,r.useState)(s?.cron||""),[y,j]=(0,r.useState)(s?.activeFrom||"09:00"),[k,N]=(0,r.useState)(s?.activeTo||"18:00"),[w,C]=(0,r.useState)(!!(s?.activeFrom&&s?.activeTo)),[T,S]=(0,r.useState)(null),E=(0,r.useRef)(null),P=(0,r.useRef)(null);(0,r.useEffect)(()=>{P.current?.focus()},[]),(0,r.useEffect)(()=>{let t=t=>{E.current&&!E.current.contains(t.target)&&e()};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[e]);let L=(0,r.useCallback)(()=>{if(!x.trim())return;let n=null;if("once"===h){let e=T||parseInt(p,10);if(!e||e<=0)return;n={message:x.trim(),type:"once",delayMinutes:e}}else if("interval"===h){let e=T||parseInt(p,10);if(!e||e<=0)return;n={message:x.trim(),type:"interval",intervalMinutes:e,...w?{activeFrom:y,activeTo:k}:{}}}else if("cron"===h){let e=T||b.trim();if(!e)return;n={message:x.trim(),type:"cron",cron:e}}n&&(u&&s&&d?d(s.id,n):t(n),e())},[x,h,T,p,b,w,y,k,t,e,u,s,d]);return(0,n.jsxs)("div",{ref:E,className:`w-80 bg-popover border border-border rounded-lg shadow-lg z-50 ${u?"":"absolute bottom-full left-0 mb-2"}`,onKeyDown:t=>{"Escape"===t.key?e():"Enter"===t.key&&(t.metaKey||t.ctrlKey)&&L()},children:[(0,n.jsx)("div",{className:"px-3 py-2 border-b border-border bg-muted/50 rounded-t-lg",children:(0,n.jsx)("span",{className:"text-sm font-medium",children:u?c("scheduledTasks.editTask"):c("scheduledTasks.createTask")})}),(0,n.jsxs)("div",{className:"p-3 space-y-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"text-xs text-muted-foreground mb-1 block",children:c("scheduledTasks.sendMessage")}),(0,n.jsx)("textarea",{ref:P,value:x,onChange:e=>f(e.target.value),placeholder:c("scheduledTasks.messagePlaceholder"),rows:2,className:"w-full px-2 py-1.5 text-sm border border-border rounded bg-card text-foreground placeholder-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring resize-none"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"text-xs text-muted-foreground mb-1 block",children:c("scheduledTasks.type")}),(0,n.jsx)("div",{className:"flex gap-1",children:["once","interval","cron"].map(e=>(0,n.jsx)("button",{onClick:()=>{m(e),S(null),g(""),v("")},className:`flex-1 px-2 py-1 text-xs rounded transition-colors ${h===e?"bg-brand text-white":"bg-muted text-muted-foreground hover:text-foreground"}`,children:"once"===e?c("scheduledTasks.once"):"interval"===e?c("scheduledTasks.interval"):"Cron"},e))})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"text-xs text-muted-foreground mb-1 block",children:c("scheduledTasks.quickSelect")}),(0,n.jsx)("div",{className:"grid grid-cols-2 gap-1",children:i[h].map(e=>(0,n.jsx)("button",{onClick:()=>{S(e.value),"cron"===h?v(String(e.value)):g(String(e.value))},className:`px-2 py-1 text-xs rounded border transition-colors ${T===e.value?"border-brand bg-brand/10 text-brand":"border-border text-muted-foreground hover:text-foreground hover:border-foreground/30"}`,children:c(e.labelKey)},e.labelKey))})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"text-xs text-muted-foreground mb-1 block",children:"cron"===h?c("scheduledTasks.customCron"):c("scheduledTasks.customMinutes")}),"cron"===h?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("input",{type:"text",value:b,onChange:e=>{v(e.target.value),S(null)},placeholder:c("scheduledTasks.cronPlaceholder"),className:"w-full px-2 py-1.5 text-sm border border-border rounded bg-card text-foreground placeholder-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring font-mono"}),b.trim()&&(0,n.jsx)("div",{className:"mt-1 text-xs text-muted-foreground",children:function(e){let t=o.A.t,s=e.trim().split(/\s+/);if(5!==s.length)return null;let[n,r,a,l,i]=s,d={0:t("cron.dowSun"),1:t("cron.dowMon"),2:t("cron.dowTue"),3:t("cron.dowWed"),4:t("cron.dowThu"),5:t("cron.dowFri"),6:t("cron.dowSat")},c={1:`1${t("cron.monthPrefix")}`,2:`2${t("cron.monthPrefix")}`,3:`3${t("cron.monthPrefix")}`,4:`4${t("cron.monthPrefix")}`,5:`5${t("cron.monthPrefix")}`,6:`6${t("cron.monthPrefix")}`,7:`7${t("cron.monthPrefix")}`,8:`8${t("cron.monthPrefix")}`,9:`9${t("cron.monthPrefix")}`,10:`10${t("cron.monthPrefix")}`,11:`11${t("cron.monthPrefix")}`,12:`12${t("cron.monthPrefix")}`};try{let e="";if(n.includes("/")||r.includes("/")){if("*"===r&&n.includes("/"))return t("cron.everyNMinutes",{n:n.split("/")[1]});if("0"===n&&r.includes("/"))return t("cron.everyNHours",{n:r.split("/")[1]});return null}let s=parseInt(r,10),o=parseInt(n,10);if(isNaN(s)&&"*"!==r||isNaN(o)&&"*"!==n)return null;e="*"===r&&"*"===n?t("cron.everyMinute"):"*"===r?t("cron.everyHourAtMin",{m:o}):"*"===n?t("cron.hourlyEveryMin",{h:s}):`${String(s).padStart(2,"0")}:${String(o).padStart(2,"0")}`;let u=[];if("*"!==l){let e=l.split(",").map(e=>c[e]||`${e}${t("cron.monthPrefix")}`);u.push(e.join(", "))}if("*"!==a)if(a.includes("-")){let[e,s]=a.split("-");u.push(t("cron.dayRange",{a:e,b:s}))}else a.includes(",")?u.push(a.split(",").map(e=>`${e}${t("cron.dayOfMonth")}`).join(", ")):u.push(`${a}${t("cron.dayOfMonth")}`);if("*"!==i)if("1-5"===i)u.push(t("cron.weekdays"));else if("0,6"===i||"6,0"===i)u.push(t("cron.weekends"));else{let e=i.split(",").map(e=>{if(e.includes("-")){let[s,n]=e.split("-");return t("cron.weekdayRange",{a:d[s]||s,b:d[n]||n})}return`${t("cron.weekdayPrefix")}${d[e]||e}`});u.push(e.join(", "))}if(0===u.length&&"*"===a&&"*"===l&&"*"===i)return t("cron.daily",{time:e});return`${u.join(" ")} ${e}`}catch{return null}}(b.trim())||(0,n.jsx)("span",{className:"text-destructive",children:c("scheduledTasks.cronFormat")})})]}):(0,n.jsx)("input",{type:"number",value:p,onChange:e=>{g(e.target.value),S(null)},placeholder:c("scheduledTasks.minutesPlaceholder"),min:1,className:"w-full px-2 py-1.5 text-sm border border-border rounded bg-card text-foreground placeholder-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),"interval"===h&&(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground mb-1 cursor-pointer",children:[(0,n.jsx)("input",{type:"checkbox",checked:w,onChange:e=>C(e.target.checked),className:"rounded border-border"}),c("scheduledTasks.limitTimeRange")]}),w&&(0,n.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,n.jsx)("input",{type:"time",value:y,onChange:e=>j(e.target.value),className:"flex-1 px-2 py-1 text-sm border border-border rounded bg-card text-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:c("scheduledTasks.to")}),(0,n.jsx)("input",{type:"time",value:k,onChange:e=>N(e.target.value),className:"flex-1 px-2 py-1 text-sm border border-border rounded bg-card text-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]})]}),(0,n.jsx)("button",{onClick:L,disabled:!(x.trim()&&("once"===h||"interval"===h?!!(T||p&&parseInt(p,10)>0):"cron"===h&&!!(T||b.trim()))),className:"w-full py-1.5 text-sm font-medium rounded bg-brand text-white hover:bg-brand/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:u?c("scheduledTasks.saveBtn",{modKey:(0,l.Mu)()}):c("scheduledTasks.createBtn",{modKey:(0,l.Mu)()})})]})]})}},31914:(e,t,s)=>{s.d(t,{b:()=>c});var n=s(95155),r=s(12115),a=s(79114),o=s(72816),l=s(38093),i=s(72588),d=s(10611);function c({isOpen:e,onClose:t}){let{t:s,i18n:c}=(0,a.Bd)(),{theme:u,setTheme:h}=(0,o.D)(),m=(0,d.G)(),[x,f]=(0,r.useState)(""),[p,g]=(0,r.useState)(""),[b,v]=(0,r.useState)("auto");(0,r.useEffect)(()=>{e&&fetch("/api/settings").then(e=>e.json()).then(e=>{e.language&&v(e.language)}).catch(()=>{})},[e]);let y=(0,r.useCallback)(e=>{v(e),fetch("/api/settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({language:e})}).catch(()=>{});let t="auto"===e?navigator.language.startsWith("zh")?"zh":"en":e;c.changeLanguage(t)},[c]),j=m?"installed":"not-installed",k=m?.version??null;if((0,r.useEffect)(()=>{e&&fetch("/api/version").then(e=>e.json()).then(e=>{e.version&&g(e.version)}).catch(()=>{})},[e]),(0,r.useEffect)(()=>{e&&fetch("/api/extension/version").then(e=>e.json()).then(e=>{e.path&&f(e.path)}).catch(()=>{})},[e]),!e)return null;let N=[{value:"system",label:s("settings.themeSystem"),icon:"\uD83D\uDCBB"},{value:"light",label:s("settings.themeLight"),icon:"☀️"},{value:"dark",label:s("settings.themeDark"),icon:"\uD83C\uDF19"}];return(0,n.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,n.jsx)("div",{className:"absolute inset-0 bg-black/50",onClick:t}),(0,n.jsxs)("div",{className:"relative bg-card rounded-lg shadow-xl w-full max-w-md mx-4 overflow-hidden",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[(0,n.jsx)("h2",{className:"text-sm font-medium text-foreground",children:s("settings.title")}),(0,n.jsx)("button",{onClick:t,className:"p-1 text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors",children:(0,n.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsxs)("div",{className:"p-4 space-y-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:s("settings.theme")}),(0,n.jsx)("div",{className:"grid grid-cols-3 gap-2",children:N.map(e=>(0,n.jsxs)("button",{onClick:()=>h(e.value),className:`flex flex-col items-center gap-1 p-3 rounded-lg border transition-colors ${u===e.value?"border-brand bg-brand/10 text-brand":"border-border hover:border-slate-6 text-muted-foreground hover:text-foreground"}`,children:[(0,n.jsx)("span",{className:"text-xl",children:e.icon}),(0,n.jsx)("span",{className:"text-xs font-medium",children:e.label})]},e.value))})]}),(0,n.jsx)("div",{className:"border-t border-border"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:s("settings.language")}),(0,n.jsx)("div",{className:"grid grid-cols-3 gap-2",children:[{value:"auto",label:s("settings.languageAuto"),icon:"\uD83C\uDF10"},{value:"en",label:"English",icon:"\uD83C\uDDFA\uD83C\uDDF8"},{value:"zh",label:"中文",icon:"\uD83C\uDDE8\uD83C\uDDF3"}].map(e=>(0,n.jsxs)("button",{onClick:()=>y(e.value),className:`flex flex-col items-center gap-1 p-3 rounded-lg border transition-colors ${b===e.value?"border-brand bg-brand/10 text-brand":"border-border hover:border-slate-6 text-muted-foreground hover:text-foreground"}`,children:[(0,n.jsx)("span",{className:"text-xl",children:e.icon}),(0,n.jsx)("span",{className:"text-xs font-medium",children:e.label})]},e.value))})]}),(0,n.jsx)("div",{className:"border-t border-border"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:s("settings.browserExtension")}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,n.jsx)("span",{className:`inline-block w-2 h-2 rounded-full flex-shrink-0 ${"installed"===j?"bg-green-500":"bg-slate-400"}`}),(0,n.jsxs)("span",{children:["installed"===j&&`${s("settings.extensionInstalled")}${k?` (v${k})`:""}`,"not-installed"===j&&s("settings.extensionNotInstalled")]})]}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground leading-relaxed",children:s("settings.extensionDescription")}),"installed"!==j&&(0,n.jsxs)("div",{className:"text-xs text-muted-foreground bg-muted/50 rounded-md p-2 space-y-1",children:[(0,n.jsx)("p",{className:"font-medium text-foreground",children:s("settings.installSteps")}),(0,n.jsxs)("p",{children:[s("settings.step1")," ",(0,n.jsx)("code",{className:"px-1 py-0.5 bg-muted rounded text-foreground",children:"chrome://extensions"})]}),(0,n.jsx)("p",{children:s("settings.step2")}),(0,n.jsx)("p",{children:s("settings.step3")}),(0,i.L)()&&(0,n.jsx)("p",{dangerouslySetInnerHTML:{__html:s("settings.step4mac")}})]}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)("button",{onClick:()=>{let e=x||"chrome-extension";navigator.clipboard.writeText(e),(0,l.oR)(s("toast.copiedName",{name:e}))},className:"px-3 py-1.5 text-xs bg-brand text-white rounded-md hover:bg-brand/90 transition-colors",children:s("settings.copyExtensionPath")}),"installed"===j&&(0,n.jsx)("button",{onClick:()=>{m?.id&&window.chrome?.runtime?.sendMessage&&(window.chrome.runtime.sendMessage(m.id,{type:"reload"}),(0,l.oR)(s("toast.pluginReloading")))},className:"px-3 py-1.5 text-xs border border-border text-foreground rounded-md hover:bg-muted transition-colors",children:s("settings.reloadExtension")})]}),x&&(0,n.jsx)("p",{className:"text-[11px] text-muted-foreground font-mono truncate",children:x})]})]}),(0,n.jsx)("div",{className:"border-t border-border"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:s("settings.about")}),(0,n.jsxs)("div",{className:"text-xs text-muted-foreground space-y-1",children:[(0,n.jsxs)("p",{children:["Cockpit",p?` v${p}`:""]}),(0,n.jsx)("p",{className:"text-muted-foreground/60",children:"One seat. One AI. Everything under control."})]})]})]})]})]})}},36998:(e,t,s)=>{s.d(t,{P:()=>r});var n=s(12115);function r(){let[e,t]=(0,n.useState)([]),s=(0,n.useCallback)(()=>{fetch("/api/pinned-sessions").then(e=>e.json()).then(e=>t(e.sessions||[])).catch(()=>{})},[]);(0,n.useEffect)(()=>{s()},[s]),(0,n.useEffect)(()=>{let e=e=>{e.data?.type==="PINNED_SESSIONS_CHANGED"&&s()};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)},[s]);let r=(0,n.useCallback)(e=>{t(e),fetch("/api/pinned-sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessions:e})}).catch(()=>{});try{window.parent.postMessage({type:"PINNED_SESSIONS_CHANGED"},"*")}catch{}},[]),a=(0,n.useCallback)(t=>e.some(e=>e.sessionId===t),[e]),o=(0,n.useCallback)((t,s,n)=>{e.some(e=>e.sessionId===t)||r([...e,{sessionId:t,cwd:s,customTitle:n}])},[e,r]),l=(0,n.useCallback)(t=>{r(e.filter(e=>e.sessionId!==t))},[e,r]),i=(0,n.useCallback)((t,s)=>{r(e.map(e=>e.sessionId===t?{...e,customTitle:s}:e))},[e,r]);return{pinnedSessions:e,isPinned:a,pinSession:o,unpinSession:l,updateTitle:i,reorder:(0,n.useCallback)(e=>{r(e)},[r]),reload:s}}},72588:(e,t,s)=>{s.d(t,{L:()=>r,Mu:()=>a});var n=s(41463);function r(){return!("u"<typeof navigator)&&(/Mac|iPhone|iPad/.test(navigator.platform||"")||navigator.userAgentData?.platform==="macOS")}function a(){return r()?"⌘":"Ctrl+"}n.platform,n.platform,n.platform},97440:(e,t,s)=>{s.d(t,{r:()=>o});var n=s(95155),r=s(12115),a=s(79114);function o({isOpen:e,onClose:t,onSelectSession:s,onAddProject:o}){let{t:l}=(0,a.Bd)(),[i,d]=(0,r.useState)(!1),[c,u]=(0,r.useState)([]),[h,m]=(0,r.useState)({}),[x,f]=(0,r.useState)(!1),[p,g]=(0,r.useState)(null),[b,v]=(0,r.useState)(""),y=(0,r.useRef)(null),j=(0,r.useCallback)(async()=>{f(!0),g(null),m({});try{let e=await fetch("/api/sessions/projects");if(!e.ok)throw Error("Failed to load projects");let t=await e.json();u(t)}catch(e){g(e instanceof Error?e.message:"Unknown error")}finally{f(!1)}},[]),k=(0,r.useCallback)(async e=>{m(t=>({...t,[e]:{...t[e],isExpanded:!0,isLoading:!0,sessions:[],error:null}}));try{let t=await fetch(`/api/sessions/projects/${encodeURIComponent(e)}`);if(!t.ok)throw Error("Failed to load sessions");let s=await t.json();m(t=>({...t,[e]:{...t[e],isLoading:!1,sessions:s}}))}catch(t){m(s=>({...s,[e]:{...s[e],isLoading:!1,error:t instanceof Error?t.message:"Unknown error"}}))}},[]),N=(0,r.useCallback)(e=>{let t=h[e];t?.isExpanded?m(t=>({...t,[e]:{...t[e],isExpanded:!1}})):t?.sessions?.length?m(t=>({...t,[e]:{...t[e],isExpanded:!0}})):k(e)},[h,k]);(0,r.useEffect)(()=>{e&&(j(),setTimeout(()=>{y.current?.focus()},100))},[e,j]);let w=(0,r.useCallback)(async()=>{if(!i){d(!0);try{let e=await fetch("/api/pick-folder"),s=await e.json();s.folder&&o&&(o(s.folder),t())}catch{}finally{d(!1)}}},[i,o,t]);return((0,r.useEffect)(()=>{let s=s=>{"Escape"===s.key&&e&&t()};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[e,t]),e)?(0,n.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,n.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:t}),(0,n.jsxs)("div",{className:"relative w-full max-w-6xl h-[90vh] mx-4 bg-card rounded-lg shadow-xl flex flex-col overflow-hidden",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[(0,n.jsx)("h2",{className:"text-sm font-medium text-foreground",children:l("sessions.projectList")}),(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)("input",{ref:y,type:"text",placeholder:l("workspace.searchProjectPath"),value:b,onChange:e=>v(e.target.value),className:"px-2 py-1 text-xs border border-border rounded bg-card text-foreground placeholder-slate-9 focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent"}),o&&(0,n.jsxs)("button",{onClick:w,disabled:i,className:"flex items-center gap-1.5 px-2.5 py-1 text-xs rounded-md border border-border text-muted-foreground hover:text-foreground hover:bg-accent transition-colors disabled:opacity-50",title:l("sessions.openFolder"),children:[(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 10v6m3-3H9m-4 7h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),i?l("sessions.selectingFolder"):l("sessions.openFolder")]}),(0,n.jsx)("button",{onClick:t,className:"p-1 text-slate-9 hover:text-foreground hover:bg-accent rounded transition-colors",children:(0,n.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),(0,n.jsxs)("div",{className:"flex-1 overflow-y-auto p-4",children:[x&&(0,n.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,n.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,n.jsxs)("svg",{className:"animate-spin h-4 w-4",fill:"none",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,n.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,n.jsx)("span",{children:l("workspace.loadingProjects")})]})}),p&&(0,n.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,n.jsx)("div",{className:"text-xs text-red-11",children:p})}),!x&&!p&&0===c.length&&(0,n.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:l("workspace.projectNotFound")})}),!x&&!p&&c.filter(e=>e.fullPath.toLowerCase().includes(b.toLowerCase())).map(e=>{let t=h[e.encodedPath]||{isExpanded:!1,isLoading:!1,sessions:[],error:null};return(0,n.jsxs)("div",{className:"mb-3",children:[(0,n.jsxs)("button",{onClick:()=>N(e.encodedPath),className:"w-full flex items-center gap-2 p-2 rounded hover:bg-accent transition-colors text-left",children:[(0,n.jsx)("svg",{className:`w-3 h-3 text-muted-foreground transition-transform ${t.isExpanded?"rotate-90":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,n.jsx)("svg",{className:"w-4 h-4 text-muted-foreground",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})}),(0,n.jsx)("span",{className:"flex-1 text-xs font-medium text-foreground truncate",title:e.fullPath,children:e.fullPath}),(0,n.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",e.sessionCount,")"]})]}),t.isExpanded&&(0,n.jsxs)("div",{className:"ml-6 mt-2",children:[t.isLoading&&(0,n.jsxs)("div",{className:"flex items-center gap-2 p-3 text-xs text-muted-foreground",children:[(0,n.jsxs)("svg",{className:"animate-spin h-3 w-3",fill:"none",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,n.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,n.jsx)("span",{children:l("sessions.loadingSessions")})]}),t.error&&(0,n.jsx)("div",{className:"p-3 text-xs text-red-11",children:t.error}),!t.isLoading&&!t.error&&(0,n.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:t.sessions.map(t=>(0,n.jsxs)("div",{onClick:()=>{var n;let r;return n=e.fullPath,r=(t.path.split("/").pop()||"").replace(".jsonl",""),void(s?s(n,r):window.parent.postMessage({type:"OPEN_PROJECT",cwd:n,sessionId:r},"*"))},className:"p-3 bg-secondary rounded border border-border hover:border-brand hover:shadow-md cursor-pointer transition-all",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[t.engine&&"claude"!==t.engine&&(0,n.jsx)("span",{className:`shrink-0 px-1 py-0.5 text-[10px] leading-none font-medium rounded ${"claude2"===t.engine?"bg-orange-500/15 text-orange-11":"ollama"===t.engine?"bg-blue-500/15 text-blue-11":"codex"===t.engine?"bg-green-500/15 text-green-11":"kimi"===t.engine?"bg-purple-500/15 text-purple-11":"bg-muted text-muted-foreground"}`,children:t.engine}),(0,n.jsx)("h4",{className:"text-xs font-medium text-foreground truncate",title:t.title,children:t.title})]}),(0,n.jsx)("div",{className:"text-xs text-muted-foreground mb-2",children:new Date(t.modifiedAt).toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}),(0,n.jsxs)("div",{className:"space-y-0.5 text-xs",children:[t.firstMessages.map((e,t)=>(0,n.jsxs)("div",{className:"text-foreground truncate",title:e,children:[(0,n.jsx)("span",{className:"text-slate-9 mr-1",children:"•"}),e]},`first-${t}`)),t.lastMessages.length>0&&(0,n.jsx)("div",{className:"text-slate-9 text-center py-0.5",children:"\xb7\xb7\xb7"}),t.lastMessages.map((e,t)=>(0,n.jsxs)("div",{className:"text-foreground truncate",title:e,children:[(0,n.jsx)("span",{className:"text-slate-9 mr-1",children:"•"}),e]},`last-${t}`))]})]},t.path))})]})]},e.encodedPath)})]})]})]}):null}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8974],{1874:(e,t,s)=>{"use strict";s.d(t,{EmptyState:()=>l});var n=s(95155),r=s(12115),o=s(79114);function l({onSelectSession:e}){let{t}=(0,o.Bd)(),[s,l]=(0,r.useState)([]),[a,i]=(0,r.useState)({}),[c,d]=(0,r.useState)(!1),[u,h]=(0,r.useState)(null),[x,m]=(0,r.useState)(""),f=(0,r.useRef)(null),p=(0,r.useCallback)(async()=>{d(!0),h(null),i({});try{let e=await fetch("/api/sessions/projects");if(!e.ok)throw Error("Failed to load projects");let t=await e.json();l(t)}catch(e){h(e instanceof Error?e.message:"Unknown error")}finally{d(!1)}},[]),g=(0,r.useCallback)(async e=>{i(t=>({...t,[e]:{...t[e],isExpanded:!0,isLoading:!0,sessions:[],error:null}}));try{let t=await fetch(`/api/sessions/projects/${encodeURIComponent(e)}`);if(!t.ok)throw Error("Failed to load sessions");let s=await t.json();i(t=>({...t,[e]:{...t[e],isLoading:!1,sessions:s}}))}catch(t){i(s=>({...s,[e]:{...s[e],isLoading:!1,error:t instanceof Error?t.message:"Unknown error"}}))}},[]),v=(0,r.useCallback)(e=>{let t=a[e];t?.isExpanded?i(t=>({...t,[e]:{...t[e],isExpanded:!1}})):t?.sessions?.length?i(t=>({...t,[e]:{...t[e],isExpanded:!0}})):g(e)},[a,g]);return(0,r.useEffect)(()=>{p(),setTimeout(()=>{f.current?.focus()},100)},[p]),(0,n.jsxs)("div",{className:"flex-1 flex flex-col bg-card",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[(0,n.jsx)("h2",{className:"text-lg font-medium text-foreground",children:t("workspace.selectProject")}),(0,n.jsx)("input",{ref:f,type:"text",placeholder:t("workspace.searchProjectPath"),value:x,onChange:e=>m(e.target.value),className:"px-3 py-1.5 text-sm border border-border rounded-lg bg-card text-foreground placeholder-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent"})]}),(0,n.jsxs)("div",{className:"flex-1 overflow-y-auto p-6",children:[c&&(0,n.jsx)("div",{className:"flex items-center justify-center h-64",children:(0,n.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,n.jsxs)("svg",{className:"animate-spin h-5 w-5",fill:"none",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,n.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,n.jsx)("span",{children:t("workspace.loadingProjects")})]})}),u&&(0,n.jsx)("div",{className:"flex items-center justify-center h-64",children:(0,n.jsx)("div",{className:"text-sm text-red-500",children:u})}),!c&&!u&&0===s.length&&(0,n.jsx)("div",{className:"flex items-center justify-center h-64",children:(0,n.jsx)("div",{className:"text-sm text-muted-foreground",children:t("workspace.projectNotFound")})}),!c&&!u&&(0,n.jsx)("div",{className:"space-y-2",children:s.filter(e=>e.fullPath.toLowerCase().includes(x.toLowerCase())).map(s=>{let r=a[s.encodedPath]||{isExpanded:!1,isLoading:!1,sessions:[],error:null};return(0,n.jsxs)("div",{className:"border border-border rounded-lg overflow-hidden",children:[(0,n.jsxs)("button",{onClick:()=>v(s.encodedPath),className:"w-full flex items-center gap-3 p-3 hover:bg-accent transition-colors text-left",children:[(0,n.jsx)("svg",{className:`w-4 h-4 text-muted-foreground transition-transform ${r.isExpanded?"rotate-90":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,n.jsx)("svg",{className:"w-5 h-5 text-brand",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsx)("div",{className:"text-sm font-medium text-foreground truncate",children:s.name}),(0,n.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:s.fullPath})]}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground bg-secondary px-2 py-0.5 rounded",children:t("workspace.sessions",{count:s.sessionCount})})]}),r.isExpanded&&(0,n.jsxs)("div",{className:"border-t border-border bg-secondary/30",children:[r.isLoading&&(0,n.jsxs)("div",{className:"flex items-center gap-2 p-3 text-xs text-muted-foreground",children:[(0,n.jsxs)("svg",{className:"animate-spin h-4 w-4",fill:"none",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,n.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,n.jsx)("span",{children:t("workspace.loadingSessions")})]}),r.error&&(0,n.jsx)("div",{className:"p-3 text-xs text-red-500",children:r.error}),!r.isLoading&&!r.error&&0===r.sessions.length&&(0,n.jsx)("div",{className:"p-3 text-xs text-muted-foreground",children:t("workspace.noSessions")}),!r.isLoading&&!r.error&&r.sessions.map(t=>(0,n.jsxs)("button",{onClick:()=>{e(s.fullPath,(t.path.split("/").pop()||"").replace(".jsonl",""))},className:"w-full flex items-start gap-3 p-3 hover:bg-accent transition-colors text-left border-t border-border first:border-t-0",children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-muted-foreground mt-0.5 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsx)("div",{className:"text-sm text-foreground truncate",children:t.title}),(0,n.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:new Date(t.modifiedAt).toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}),t.firstMessages.length>0&&(0,n.jsx)("div",{className:"text-xs text-muted-foreground mt-1 truncate",children:t.firstMessages[0]})]})]},t.path))]})]},s.encodedPath)})})]})]})}},4189:(e,t,s)=>{"use strict";s.d(t,{Workspace:()=>q});var n=s(95155),r=s(12115),o=s(79114),l=s(80475),a=s(1874),i=s(97440),c=s(31914);let d={"claude-opus-4-6":{label:"Opus 4.6",input:5,output:25,cacheRead:.5,cacheWrite:6.25,color:"#f97316"},"claude-opus-4-5-20251101":{label:"Opus 4.5",input:5,output:25,cacheRead:.5,cacheWrite:6.25,color:"#fb923c"},"claude-sonnet-4-6":{label:"Sonnet 4.6",input:3,output:15,cacheRead:.3,cacheWrite:3.75,color:"#3b82f6"},"claude-sonnet-4-5-20250929":{label:"Sonnet 4.5",input:3,output:15,cacheRead:.3,cacheWrite:3.75,color:"#60a5fa"},"claude-haiku-4-5-20251001":{label:"Haiku 4.5",input:1,output:5,cacheRead:.1,cacheWrite:1.25,color:"#22c55e"}},u={label:"",input:3,output:15,cacheRead:.3,cacheWrite:3.75,color:"#94a3b8"};function h(e){if(d[e])return d[e];let t=e.toLowerCase();return t.includes("opus")?{...u,input:5,output:25,cacheRead:.5,cacheWrite:6.25,color:"#f97316"}:t.includes("haiku")?{...u,input:1,output:5,cacheRead:.1,cacheWrite:1.25,color:"#22c55e"}:u}function x(e){let t=d[e];return t?t.label:e.replace(/^claude-/,"").replace(/-\d{8}$/,"").replace(/-/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function m(e){return(d[e]??h(e)).color}function f(e){return e>=1e9?`${(e/1e9).toFixed(1)}B`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function p(e){return e>=1e3?`$${e.toFixed(0)}`:e>=100?`$${e.toFixed(1)}`:`$${e.toFixed(2)}`}function g({data:e,height:t=200,formatValue:s=f}){let o=(0,r.useRef)(null),l=(0,r.useRef)(null),[a,i]=(0,r.useState)(null),c=(0,r.useRef)([]),d=(0,r.useCallback)(()=>{let n=o.current,r=l.current;if(!n||!r)return;let a=window.devicePixelRatio||1,i=r.getBoundingClientRect().width;n.width=i*a,n.height=t*a,n.style.width=`${i}px`,n.style.height=`${t}px`;let d=n.getContext("2d");d.scale(a,a),d.clearRect(0,0,i,t);let{labels:u,datasets:h}=e;if(0===u.length)return;let x=i-50-12,m=t-8-28,f=function(e){if(e<=0)return 1;let t=Math.pow(10,Math.floor(Math.log10(e))),s=e/t;return s<=1?t:s<=2?2*t:s<=5?5*t:10*t}(Math.max(1,...u.map((e,t)=>h.reduce((e,s)=>e+s.data[t],0))));d.fillStyle=getComputedStyle(n).getPropertyValue("color")||"#888",d.font="10px ui-monospace, monospace",d.textAlign="right",d.textBaseline="middle";for(let e=0;e<=4;e++){var p;let t=f/4*e,r=8+m-t/f*m;d.fillText(s(t),44,r),d.strokeStyle=(p="--border",getComputedStyle(n).getPropertyValue(p).trim()||"#333"),d.lineWidth=.5,d.beginPath(),d.moveTo(50,r),d.lineTo(50+x,r),d.stroke()}let g=x/u.length,v=Math.max(4,Math.min(.6*g,32)),j=[];u.forEach((e,t)=>{let s=50+t*g+(g-v)/2,r=0;h.forEach(n=>{var o,l,a,i,c,u;let h=n.data[t];if(h<=0)return;let x=h/f*m,p=8+m-r-x;d.fillStyle=n.color,o=d,l=s,a=p,i=v,u=2,(c=x)<1||(u=Math.min(u,c/2,i/2),o.beginPath(),o.moveTo(l+u,a),o.lineTo(l+i-u,a),o.quadraticCurveTo(l+i,a,l+i,a+u),o.lineTo(l+i,a+c-u),o.quadraticCurveTo(l+i,a+c,l+i-u,a+c),o.lineTo(l+u,a+c),o.quadraticCurveTo(l,a+c,l,a+c-u),o.lineTo(l,a+u),o.quadraticCurveTo(l,a,l+u,a),o.fill()),j.push({x:s,y:p,w:v,h:x,label:e,value:h,dataset:n.label,color:n.color}),r+=x}),d.fillStyle=getComputedStyle(n).getPropertyValue("color")||"#888",d.font="9px ui-monospace, monospace",d.textAlign="center",d.textBaseline="top",t%(u.length>20?Math.ceil(u.length/15):1)==0&&d.fillText(e,s+v/2,8+m+6)}),c.current=j},[e,t,s]);(0,r.useEffect)(()=>{d();let e=new ResizeObserver(()=>d());return l.current&&e.observe(l.current),()=>e.disconnect()},[d]);let u=(0,r.useCallback)(e=>{let t=o.current?.getBoundingClientRect();if(!t)return;let n=e.clientX-t.left,r=e.clientY-t.top,l=c.current.find(e=>n>=e.x&&n<=e.x+e.w&&r>=e.y&&r<=e.y+e.h);l?i({x:e.clientX-t.left,y:l.y-4,content:`${l.dataset}: ${s(l.value)}`}):i(null)},[s]);return(0,n.jsxs)("div",{ref:l,className:"relative w-full text-muted-foreground",children:[(0,n.jsx)("canvas",{ref:o,className:"w-full",style:{height:t},onMouseMove:u,onMouseLeave:()=>i(null)}),a&&(0,n.jsx)("div",{className:"absolute pointer-events-none bg-popover text-popover-foreground text-[10px] px-2 py-1 rounded shadow-lg border border-border whitespace-nowrap z-10",style:{left:a.x,top:a.y,transform:"translate(-50%, -100%)"},children:a.content})]})}function v({hourCounts:e}){let{t}=(0,o.Bd)(),s=Math.max(1,...Object.values(e)),r=Array.from({length:24},(e,t)=>t);return(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:t("tokenStats.activeHours")}),(0,n.jsx)("div",{className:"flex gap-[2px] items-end h-16",children:r.map(r=>{let o=e[String(r)]||0,l=o/s;return(0,n.jsxs)("div",{className:"flex-1 flex flex-col items-center gap-0.5",title:t("tokenStats.hourSessions",{h:r,count:o}),children:[(0,n.jsx)("div",{className:"w-full rounded-sm transition-all",style:{height:`${Math.max(2,48*l)}px`,backgroundColor:l>0?`rgba(59, 130, 246, ${.2+.8*l})`:"var(--muted)"}}),r%3==0&&(0,n.jsx)("span",{className:"text-[8px] text-muted-foreground",children:r})]},r)})})]})}function j({isOpen:e,onClose:t}){var s;let l,a,{t:i}=(0,o.Bd)(),[c,d]=(0,r.useState)(null),[u,j]=(0,r.useState)(!0),[k,w]=(0,r.useState)("day"),[N,C]=(0,r.useState)("tokens"),[y,S]=(0,r.useState)("claude");(0,r.useEffect)(()=>{e&&(queueMicrotask(()=>j(!0)),fetch(`/api/claude-stats?engine=${y}`).then(e=>e.json()).then(e=>{e.error||queueMicrotask(()=>d(e))}).catch(()=>{}).finally(()=>queueMicrotask(()=>j(!1))))},[e,y]);let M=(0,r.useMemo)(()=>c?.modelUsage?Object.entries(c.modelUsage).filter(([e])=>!e.startsWith("<")).map(([e,t])=>{let s;return{id:e,label:x(e),color:m(e),usage:t,cost:(s=h(e),t.inputTokens/1e6*s.input+t.outputTokens/1e6*s.output+t.cacheReadInputTokens/1e6*s.cacheRead+t.cacheCreationInputTokens/1e6*s.cacheWrite),totalTokens:t.inputTokens+t.outputTokens+t.cacheReadInputTokens+t.cacheCreationInputTokens}}).sort((e,t)=>t.cost-e.cost):[],[c]),L=(0,r.useMemo)(()=>M.reduce((e,t)=>e+t.cost,0),[M]),T=(0,r.useMemo)(()=>M.map(e=>e.id),[M]),z=(0,r.useMemo)(()=>{let e={};for(let t of M)e[t.id]=t.totalTokens>0?t.cost/t.totalTokens:0;return e},[M]),{activityChart:B,tokenChart:E,costChart:H}=(0,r.useMemo)(()=>{let e=c?.dailyActivity||[],t=c?.dailyModelTokens||[];if("day"===k){let s=e.slice(-60),n=t.slice(-60),r={labels:s.map(e=>e.date.slice(5)),datasets:[{label:i("tokenStats.messages"),data:s.map(e=>e.messageCount),color:"#3b82f6"},{label:i("tokenStats.toolCalls"),data:s.map(e=>e.toolCallCount),color:"#22c55e"}]},o=n.map(e=>e.date.slice(5));return{activityChart:r,tokenChart:{labels:o,datasets:T.map(e=>({label:x(e),data:n.map(t=>t.tokensByModel[e]||0),color:m(e)}))},costChart:{labels:o,datasets:T.map(e=>({label:x(e),data:n.map(t=>(t.tokensByModel[e]||0)*(z[e]||0)),color:m(e)}))}}}if("week"===k){let s=function(e,t){let s=new Map;for(let t of e){let e=new Date(t.date),n=new Date(e);n.setDate(e.getDate()-e.getDay());let r=n.toISOString().slice(0,10),o=r.slice(5);s.has(r)||s.set(r,{label:o,messages:0,sessions:0,tools:0,tokensByModel:{}});let l=s.get(r);l.messages+=t.messageCount,l.sessions+=t.sessionCount,l.tools+=t.toolCallCount}for(let e of t){let t=new Date(e.date),n=new Date(t);n.setDate(t.getDate()-t.getDay());let r=n.toISOString().slice(0,10);s.has(r)||s.set(r,{label:r.slice(5),messages:0,sessions:0,tools:0,tokensByModel:{}});let o=s.get(r);for(let[t,s]of Object.entries(e.tokensByModel))o.tokensByModel[t]=(o.tokensByModel[t]||0)+s}return Array.from(s.values()).sort((e,t)=>e.label.localeCompare(t.label))}(e,t),n=s.map(e=>e.label),r={labels:n,datasets:[{label:i("tokenStats.messages"),data:s.map(e=>e.messages),color:"#3b82f6"},{label:i("tokenStats.toolCalls"),data:s.map(e=>e.tools),color:"#22c55e"}]};return{activityChart:r,tokenChart:{labels:n,datasets:T.map(e=>({label:x(e),data:s.map(t=>t.tokensByModel[e]||0),color:m(e)}))},costChart:{labels:n,datasets:T.map(e=>({label:x(e),data:s.map(t=>(t.tokensByModel[e]||0)*(z[e]||0)),color:m(e)}))}}}let s=function(e,t){let s=new Map;for(let t of e){let e=t.date.slice(0,7);s.has(e)||s.set(e,{label:e,messages:0,sessions:0,tools:0,tokensByModel:{}});let n=s.get(e);n.messages+=t.messageCount,n.sessions+=t.sessionCount,n.tools+=t.toolCallCount}for(let e of t){let t=e.date.slice(0,7);s.has(t)||s.set(t,{label:t,messages:0,sessions:0,tools:0,tokensByModel:{}});let n=s.get(t);for(let[t,s]of Object.entries(e.tokensByModel))n.tokensByModel[t]=(n.tokensByModel[t]||0)+s}return Array.from(s.values()).sort((e,t)=>e.label.localeCompare(t.label))}(e,t),n=s.map(e=>e.label),r={labels:n,datasets:[{label:i("tokenStats.messages"),data:s.map(e=>e.messages),color:"#3b82f6"},{label:i("tokenStats.toolCalls"),data:s.map(e=>e.tools),color:"#22c55e"}]};return{activityChart:r,tokenChart:{labels:n,datasets:T.map(e=>({label:x(e),data:s.map(t=>t.tokensByModel[e]||0),color:m(e)}))},costChart:{labels:n,datasets:T.map(e=>({label:x(e),data:s.map(t=>(t.tokensByModel[e]||0)*(z[e]||0)),color:m(e)}))}}},[c,k,T,z,i]);if((0,r.useEffect)(()=>{if(!e)return;let s=e=>{"Escape"===e.key&&t()};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[e,t]),!e)return null;let R=[{key:"day",label:i("tokenStats.day")},{key:"week",label:i("tokenStats.week")},{key:"month",label:i("tokenStats.month")}];return(0,n.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,n.jsx)("div",{className:"absolute inset-0 bg-black/50",onClick:t}),(0,n.jsxs)("div",{className:"relative bg-card rounded-xl shadow-xl w-full max-w-4xl mx-4 max-h-[90vh] flex flex-col overflow-hidden",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-6 py-3 border-b border-border flex-shrink-0",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)("h2",{className:"text-sm font-medium text-foreground",children:i("tokenStats.title")}),(0,n.jsx)("div",{className:"flex bg-muted rounded-md p-0.5",children:["claude","claude2"].map(e=>(0,n.jsx)("button",{className:`px-2.5 py-0.5 text-[11px] rounded transition-colors ${y===e?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,onClick:()=>{d(null),S(e)},children:"claude"===e?"Claude":"Claude 2"},e))}),(0,n.jsx)("div",{className:"flex bg-muted rounded-md p-0.5",children:R.map(e=>(0,n.jsx)("button",{className:`px-2.5 py-0.5 text-[11px] rounded transition-colors ${k===e.key?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,onClick:()=>w(e.key),children:e.label},e.key))})]}),(0,n.jsx)("button",{onClick:t,className:"p-1 text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors",children:(0,n.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsx)("div",{className:"flex-1 overflow-y-auto px-6 py-5 space-y-6",children:u?(0,n.jsx)("div",{className:"text-center text-muted-foreground py-12",children:i("common.loading")}):c?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"grid grid-cols-5 gap-3",children:[(0,n.jsx)(b,{label:i("tokenStats.totalSessions"),value:String(c.totalSessions??0)}),(0,n.jsx)(b,{label:i("tokenStats.totalMessages"),value:f(c.totalMessages??0)}),(0,n.jsx)(b,{label:i("tokenStats.equivalentApiCost"),value:p(L),highlight:!0}),(0,n.jsx)(b,{label:i("tokenStats.longestSession"),value:c.longestSession?(l=Math.floor((s=c.longestSession.duration)/36e5),a=Math.floor(s%36e5/6e4),l>0?`${l}h ${a}m`:`${a}m`):"-"}),(0,n.jsx)(b,{label:i("tokenStats.firstUse"),value:c.firstSessionDate?c.firstSessionDate.slice(0,10):"-"})]}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,n.jsx)("h3",{className:"text-xs font-medium text-muted-foreground",children:i("tokenStats.activityTrend")}),(0,n.jsxs)("div",{className:"flex items-center gap-3 text-[10px]",children:[(0,n.jsxs)("span",{className:"flex items-center gap-1",children:[(0,n.jsx)("span",{className:"inline-block w-2.5 h-2.5 rounded-sm",style:{backgroundColor:"#3b82f6"}}),i("tokenStats.messages")]}),(0,n.jsxs)("span",{className:"flex items-center gap-1",children:[(0,n.jsx)("span",{className:"inline-block w-2.5 h-2.5 rounded-sm",style:{backgroundColor:"#22c55e"}}),i("tokenStats.toolCalls")]})]})]}),(0,n.jsx)("div",{className:"border border-border rounded-lg p-3 bg-muted/20",children:(0,n.jsx)(g,{data:B,height:180})})]}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("h3",{className:"text-xs font-medium text-muted-foreground",children:i("tokenStats.byModel")}),(0,n.jsxs)("div",{className:"flex bg-muted rounded-md p-0.5",children:[(0,n.jsx)("button",{className:`px-2.5 py-0.5 text-[11px] rounded transition-colors ${"tokens"===N?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,onClick:()=>C("tokens"),children:i("tokenStats.tokenUsage")}),(0,n.jsx)("button",{className:`px-2.5 py-0.5 text-[11px] rounded transition-colors ${"cost"===N?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,onClick:()=>C("cost"),children:i("tokenStats.equivalentCost")})]})]}),(0,n.jsx)("div",{className:"flex items-center gap-3 text-[10px] flex-wrap",children:M.map(e=>(0,n.jsxs)("span",{className:"flex items-center gap-1",children:[(0,n.jsx)("span",{className:"inline-block w-2.5 h-2.5 rounded-sm",style:{backgroundColor:e.color}}),e.label]},e.id))})]}),(0,n.jsx)("div",{className:"border border-border rounded-lg p-3 bg-muted/20",children:(0,n.jsx)(g,{data:"tokens"===N?E:H,height:180,formatValue:"tokens"===N?f:p})})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:i("tokenStats.modelCostDetail")}),(0,n.jsx)("div",{className:"border border-border rounded-lg overflow-hidden",children:(0,n.jsxs)("table",{className:"w-full text-xs",children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{className:"bg-muted/50 text-muted-foreground",children:[(0,n.jsx)("th",{className:"text-left px-3 py-2 font-medium",children:i("tokenStats.model")}),(0,n.jsx)("th",{className:"text-right px-3 py-2 font-medium",children:"Input"}),(0,n.jsx)("th",{className:"text-right px-3 py-2 font-medium",children:"Output"}),(0,n.jsx)("th",{className:"text-right px-3 py-2 font-medium",children:"Cache Read"}),(0,n.jsx)("th",{className:"text-right px-3 py-2 font-medium",children:"Cache Write"}),(0,n.jsx)("th",{className:"text-right px-3 py-2 font-medium",children:i("tokenStats.share")}),(0,n.jsx)("th",{className:"text-right px-3 py-2 font-medium",children:i("tokenStats.equivalentCost")})]})}),(0,n.jsxs)("tbody",{children:[M.map(e=>(0,n.jsxs)("tr",{className:"border-t border-border",children:[(0,n.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:(0,n.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,n.jsx)("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:e.color}}),e.label]})}),(0,n.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground",children:f(e.usage.inputTokens)}),(0,n.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground",children:f(e.usage.outputTokens)}),(0,n.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground",children:f(e.usage.cacheReadInputTokens)}),(0,n.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground",children:f(e.usage.cacheCreationInputTokens)}),(0,n.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground",children:L>0?`${(e.cost/L*100).toFixed(1)}%`:"-"}),(0,n.jsx)("td",{className:"px-3 py-2 text-right font-medium text-foreground",children:p(e.cost)})]},e.id)),(0,n.jsxs)("tr",{className:"border-t-2 border-border bg-muted/30",children:[(0,n.jsx)("td",{className:"px-3 py-2 font-medium text-foreground",children:i("tokenStats.total")}),(0,n.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground",children:f(M.reduce((e,t)=>e+t.usage.inputTokens,0))}),(0,n.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground",children:f(M.reduce((e,t)=>e+t.usage.outputTokens,0))}),(0,n.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground",children:f(M.reduce((e,t)=>e+t.usage.cacheReadInputTokens,0))}),(0,n.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground",children:f(M.reduce((e,t)=>e+t.usage.cacheCreationInputTokens,0))}),(0,n.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground",children:"100%"}),(0,n.jsx)("td",{className:"px-3 py-2 text-right font-bold text-foreground",children:p(L)})]})]})]})})]}),c.hourCounts&&Object.keys(c.hourCounts).length>0&&(0,n.jsx)("div",{className:"border border-border rounded-lg p-3 bg-muted/20",children:(0,n.jsx)(v,{hourCounts:c.hourCounts})})]}):(0,n.jsx)("div",{className:"text-center text-muted-foreground py-12",children:i("tokenStats.notFound")})})]})]})}function b({label:e,value:t,highlight:s}){return(0,n.jsxs)("div",{className:"bg-muted/30 rounded-lg px-3 py-2.5",children:[(0,n.jsx)("div",{className:"text-[10px] text-muted-foreground",children:e}),(0,n.jsx)("div",{className:`text-sm font-semibold mt-0.5 ${s?"text-brand":"text-foreground"}`,children:t})]})}var k=s(87918),w=s(13439),N=s(37795),C=s(43561),y=s(5989),S=s(76065),M=s(43203),L=s(6268),T=s(48434),z=s(44695),B=s(59265),E=s(7305);function H(e){return e.storage.markdown.getMarkdown()}function R(){return[{label:k.A.t("slashCommands.heading1"),icon:"H1",description:k.A.t("slashCommands.heading1Desc"),action:e=>e.chain().focus().toggleHeading({level:1}).run()},{label:k.A.t("slashCommands.heading2"),icon:"H2",description:k.A.t("slashCommands.heading2Desc"),action:e=>e.chain().focus().toggleHeading({level:2}).run()},{label:k.A.t("slashCommands.heading3"),icon:"H3",description:k.A.t("slashCommands.heading3Desc"),action:e=>e.chain().focus().toggleHeading({level:3}).run()},{label:k.A.t("slashCommands.bulletList"),icon:"•",description:k.A.t("slashCommands.bulletListDesc"),action:e=>e.chain().focus().toggleBulletList().run()},{label:k.A.t("slashCommands.orderedList"),icon:"1.",description:k.A.t("slashCommands.orderedListDesc"),action:e=>e.chain().focus().toggleOrderedList().run()},{label:k.A.t("slashCommands.taskList"),icon:"☑",description:k.A.t("slashCommands.taskListDesc"),action:e=>e.chain().focus().toggleTaskList().run()},{label:k.A.t("slashCommands.blockquote"),icon:"❝",description:k.A.t("slashCommands.blockquoteDesc"),action:e=>e.chain().focus().toggleBlockquote().run()},{label:k.A.t("slashCommands.codeBlock"),icon:"<>",description:k.A.t("slashCommands.codeBlockDesc"),action:e=>e.chain().focus().toggleCodeBlock().run()},{label:k.A.t("slashCommands.table"),icon:"▦",description:k.A.t("slashCommands.tableDesc"),action:e=>e.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run()},{label:k.A.t("slashCommands.horizontalRule"),icon:"──",description:k.A.t("slashCommands.horizontalRuleDesc"),action:e=>e.chain().focus().setHorizontalRule().run()},{label:k.A.t("slashCommands.link"),icon:"\uD83D\uDD17",description:k.A.t("slashCommands.linkDesc"),action:e=>{window.dispatchEvent(new CustomEvent("tiptap-insert-link"))}}]}function A({editor:e,query:t,position:s,onClose:o}){let[l,a]=(0,r.useState)(0),i=(0,r.useRef)(null),c=R().filter(e=>e.label.toLowerCase().includes(t.toLowerCase())||e.description.toLowerCase().includes(t.toLowerCase()));(0,r.useEffect)(()=>{queueMicrotask(()=>a(0))},[t]);let d=s=>{e.chain().focus().deleteRange({from:e.state.selection.from-t.length-1,to:e.state.selection.from}).run(),s.action(e),o()};return((0,r.useEffect)(()=>{let e=e=>{"ArrowDown"===e.key?(e.preventDefault(),a(e=>(e+1)%c.length)):"ArrowUp"===e.key?(e.preventDefault(),a(e=>(e-1+c.length)%c.length)):"Enter"===e.key?(e.preventDefault(),c[l]&&d(c[l])):"Escape"===e.key&&(e.preventDefault(),o())};return document.addEventListener("keydown",e,!0),()=>document.removeEventListener("keydown",e,!0)},[c,l,o]),0===c.length)?null:(0,n.jsx)("div",{ref:i,className:"slash-command-menu fixed z-[60] bg-popover border border-border rounded-lg shadow-lg py-1 w-56 max-h-64 overflow-y-auto",style:{top:s.top,left:s.left},children:c.map((e,t)=>(0,n.jsxs)("button",{className:`w-full flex items-center gap-3 px-3 py-2 text-left text-sm transition-colors ${t===l?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent hover:text-foreground"}`,onClick:()=>d(e),onMouseEnter:()=>a(t),children:[(0,n.jsx)("span",{className:"w-6 text-center text-xs font-mono flex-shrink-0",children:e.icon}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsx)("div",{className:"font-medium",children:e.label}),(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:e.description})]})]},e.label))})}function $({editor:e,onClose:t,position:s}){let{t:l}=(0,o.Bd)(),[a,i]=(0,r.useState)(()=>e.getAttributes("link").href||""),c=(0,r.useRef)(null);(0,r.useEffect)(()=>{c.current?.focus()},[]);let d=()=>{let s=a.trim();if(s){let t=s.match(/^https?:\/\//)?s:`https://${s}`;e.chain().focus().extendMarkRange("link").setLink({href:t}).run()}else e.chain().focus().extendMarkRange("link").unsetLink().run();t()},u=s?{top:s.top,left:s.left}:{};return(0,n.jsxs)("div",{className:`${s?"fixed":"absolute top-full left-0 mt-1"} z-[60] bg-popover border border-border rounded-lg shadow-lg p-2 flex items-center gap-2`,style:u,children:[(0,n.jsx)("input",{ref:c,type:"text",value:a,onChange:e=>i(e.target.value),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),d()):"Escape"===e.key&&(e.preventDefault(),t())},placeholder:l("editor.linkPlaceholder"),className:"bg-background border border-border rounded px-2 py-1 text-sm w-64 outline-none focus:border-brand"}),(0,n.jsx)("button",{onClick:d,className:"p-1 rounded text-sm font-medium text-brand hover:bg-brand/10 transition-colors",title:l("editor.confirmLink"),children:(0,n.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,n.jsx)("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})})}),e.isActive("link")&&(0,n.jsx)("button",{onClick:()=>{e.chain().focus().extendMarkRange("link").unsetLink().run(),t()},className:"p-1 rounded text-sm font-medium text-red-500 hover:bg-red-500/10 transition-colors",title:l("editor.removeLink"),children:(0,n.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,n.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"})})})]})}function P({editor:e}){let{t}=(0,o.Bd)(),[s,l]=(0,r.useState)(!1),a=(0,r.useRef)(null),[,i]=(0,r.useState)(0);if((0,r.useEffect)(()=>{if(!e)return;let t=()=>i(e=>e+1);return e.on("selectionUpdate",t),e.on("transaction",t),()=>{e.off("selectionUpdate",t),e.off("transaction",t)}},[e]),(0,r.useEffect)(()=>{let e=()=>l(!0);return window.addEventListener("tiptap-insert-link",e),()=>window.removeEventListener("tiptap-insert-link",e)},[]),!e)return null;let c=e=>`p-1.5 rounded text-xs font-medium transition-colors ${e?"bg-brand/15 text-brand":"text-muted-foreground hover:text-foreground hover:bg-accent"}`,d="w-px h-5 bg-border mx-0.5",u=e.isActive("table");return(0,n.jsxs)("div",{className:"flex items-center gap-0.5 px-4 py-1.5 border-b border-border flex-shrink-0 flex-wrap",children:[(0,n.jsx)("button",{className:c(e.isActive("heading",{level:1})),onClick:()=>e.chain().focus().toggleHeading({level:1}).run(),title:t("editor.heading1"),children:"H1"}),(0,n.jsx)("button",{className:c(e.isActive("heading",{level:2})),onClick:()=>e.chain().focus().toggleHeading({level:2}).run(),title:t("editor.heading2"),children:"H2"}),(0,n.jsx)("button",{className:c(e.isActive("heading",{level:3})),onClick:()=>e.chain().focus().toggleHeading({level:3}).run(),title:t("editor.heading3"),children:"H3"}),(0,n.jsx)("div",{className:d}),(0,n.jsx)("button",{className:c(e.isActive("bold")),onClick:()=>e.chain().focus().toggleBold().run(),title:t("editor.bold"),children:(0,n.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,n.jsx)("path",{d:"M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42zM10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3v-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z"})})}),(0,n.jsx)("button",{className:c(e.isActive("italic")),onClick:()=>e.chain().focus().toggleItalic().run(),title:t("editor.italic"),children:(0,n.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,n.jsx)("path",{d:"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z"})})}),(0,n.jsx)("button",{className:c(e.isActive("strike")),onClick:()=>e.chain().focus().toggleStrike().run(),title:t("editor.strikethrough"),children:(0,n.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,n.jsx)("path",{d:"M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z"})})}),(0,n.jsx)("button",{className:c(e.isActive("code")),onClick:()=>e.chain().focus().toggleCode().run(),title:t("editor.inlineCode"),children:(0,n.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,n.jsx)("path",{d:"M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"})})}),(0,n.jsx)("div",{className:d}),(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsx)("button",{ref:a,className:c(e.isActive("link")),onClick:()=>l(!s),title:t("editor.link"),children:(0,n.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,n.jsx)("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"})})}),s&&(0,n.jsx)($,{editor:e,onClose:()=>l(!1),position:null})]}),(0,n.jsx)("div",{className:d}),(0,n.jsx)("button",{className:c(e.isActive("bulletList")),onClick:()=>e.chain().focus().toggleBulletList().run(),title:t("editor.bulletList"),children:(0,n.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,n.jsx)("path",{d:"M4 10.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5zm0-6c-.83 0-1.5.67-1.5 1.5S3.17 7.5 4 7.5 5.5 6.83 5.5 6 4.83 4.5 4 4.5zm0 12c-.83 0-1.5.68-1.5 1.5s.68 1.5 1.5 1.5 1.5-.68 1.5-1.5-.67-1.5-1.5-1.5zM7 19h14v-2H7v2zm0-6h14v-2H7v2zm0-8v2h14V5H7z"})})}),(0,n.jsx)("button",{className:c(e.isActive("orderedList")),onClick:()=>e.chain().focus().toggleOrderedList().run(),title:t("editor.orderedList"),children:(0,n.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,n.jsx)("path",{d:"M2 17h2v.5H3v1h1v.5H2v1h3v-4H2v1zm1-9h1V4H2v1h1v3zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2v1zm5-6v2h14V5H7zm0 14h14v-2H7v2zm0-6h14v-2H7v2z"})})}),(0,n.jsx)("button",{className:c(e.isActive("taskList")),onClick:()=>e.chain().focus().toggleTaskList().run(),title:t("editor.taskList"),children:(0,n.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,n.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM17.99 9l-1.41-1.42-6.59 6.59-2.58-2.57-1.42 1.41 4 3.99z"})})}),(0,n.jsx)("div",{className:d}),(0,n.jsx)("button",{className:c(e.isActive("blockquote")),onClick:()=>e.chain().focus().toggleBlockquote().run(),title:t("editor.blockquote"),children:(0,n.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,n.jsx)("path",{d:"M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z"})})}),(0,n.jsx)("button",{className:c(e.isActive("codeBlock")),onClick:()=>e.chain().focus().toggleCodeBlock().run(),title:t("editor.codeBlock"),children:(0,n.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,n.jsx)("path",{d:"M20 3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H4V5h16v14zm-7.5-4.5L15 12l-2.5-2.5L11 11l1.5 1.5L11 14l1.5 1.5zM9.5 14.5L7 12l2.5-2.5L11 11 9.5 12.5 11 14l-1.5.5z"})})}),(0,n.jsx)("button",{className:c(!1),onClick:()=>e.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),title:t("editor.table"),children:(0,n.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,n.jsx)("path",{d:"M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-9 15H4v-4h7v4zm0-6H4V7h7v4zm9 6h-7v-4h7v4zm0-6h-7V7h7v4z"})})}),(0,n.jsx)("button",{className:c(!1),onClick:()=>e.chain().focus().setHorizontalRule().run(),title:t("editor.horizontalRule"),children:(0,n.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,n.jsx)("path",{d:"M4 11h16v2H4z"})})}),u&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:d}),(0,n.jsx)("button",{className:c(!1),onClick:()=>e.chain().focus().addRowBefore().run(),title:t("editor.insertRowAbove"),children:(0,n.jsxs)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:[(0,n.jsx)("path",{d:"M20 4H4c-1.1 0-2 .9-2 2v2h20V6c0-1.1-.9-2-2-2zm0 6H2v10c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V10zM11 17H4v-2h7v2zm0-4H4v-2h7v2zm9 4h-7v-2h7v2zm0-4h-7v-2h7v2z"}),(0,n.jsx)("path",{d:"M14 1h-4v2H8v2h2v2h4V5h2V3h-2z",opacity:".6"})]})}),(0,n.jsx)("button",{className:c(!1),onClick:()=>e.chain().focus().addRowAfter().run(),title:t("editor.insertRowBelow"),children:(0,n.jsxs)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:[(0,n.jsx)("path",{d:"M20 4H4c-1.1 0-2 .9-2 2v10h20V6c0-1.1-.9-2-2-2zM11 12H4v-2h7v2zm0-4H4V6h7v2zm9 4h-7v-2h7v2zm0-4h-7V6h7v2z"}),(0,n.jsx)("path",{d:"M14 19h-4v2H8v2h2v-2h4v2h2v-2h-2z",opacity:".6"})]})}),(0,n.jsx)("button",{className:c(!1),onClick:()=>e.chain().focus().addColumnBefore().run(),title:t("editor.insertColumnLeft"),children:(0,n.jsxs)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:[(0,n.jsx)("path",{d:"M6 4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h2V4H6zm4 0v20h10c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2H10zm7 11H10v-2h7v2zm0-4H10V9h7v2z"}),(0,n.jsx)("path",{d:"M1 14v-4h2V8h2v2h-2v4h2v2H3v-2z",opacity:".6"})]})}),(0,n.jsx)("button",{className:c(!1),onClick:()=>e.chain().focus().addColumnAfter().run(),title:t("editor.insertColumnRight"),children:(0,n.jsxs)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:[(0,n.jsx)("path",{d:"M4 4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h10V4H4zm7 11H4v-2h7v2zm0-4H4V9h7v2z"}),(0,n.jsx)("path",{d:"M18 4v20h2c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-2z"}),(0,n.jsx)("path",{d:"M21 14v-4h2V8h2v2h-2v4h2v2h-2v-2z",opacity:".6"})]})}),(0,n.jsx)("div",{className:d}),(0,n.jsx)("button",{className:"p-1.5 rounded text-xs font-medium transition-colors text-orange-500 hover:bg-orange-500/10",onClick:()=>e.chain().focus().deleteRow().run(),title:t("editor.deleteRow"),children:(0,n.jsxs)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:[(0,n.jsx)("path",{d:"M20 4H4c-1.1 0-2 .9-2 2v2h20V6c0-1.1-.9-2-2-2zm0 6H2v10c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V10zm-8 8H4v-2h8v2z"}),(0,n.jsx)("path",{d:"M15 13l-1.41 1.41L15.17 16l-1.58 1.59L15 19l1.59-1.59L18.17 19l1.42-1.41L18 16l1.59-1.59L18.17 13 16.59 14.41z",fill:"currentColor"})]})}),(0,n.jsx)("button",{className:"p-1.5 rounded text-xs font-medium transition-colors text-orange-500 hover:bg-orange-500/10",onClick:()=>e.chain().focus().deleteColumn().run(),title:t("editor.deleteColumn"),children:(0,n.jsxs)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:[(0,n.jsx)("path",{d:"M6 4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h2V4H6zm4 0v20h10c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2H10zm7 7H10V9h7v2z"}),(0,n.jsx)("path",{d:"M13 16l-1.41 1.41L13.17 19l-1.58 1.59L13 22l1.59-1.59L16.17 22l1.42-1.41L16 19l1.59-1.59L16.17 16l-1.58 1.41z",fill:"currentColor"})]})}),(0,n.jsx)("button",{className:"p-1.5 rounded text-xs font-medium transition-colors text-red-500 hover:bg-red-500/10",onClick:()=>e.chain().focus().deleteTable().run(),title:t("editor.deleteTable"),children:(0,n.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,n.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"})})})]}),e.isActive("codeBlock")&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:d}),(0,n.jsx)("button",{className:"p-1.5 rounded text-xs font-medium transition-colors text-red-500 hover:bg-red-500/10",onClick:()=>e.chain().focus().toggleCodeBlock().run(),title:t("editor.deleteCodeBlock"),children:(0,n.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,n.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"})})})]})]})}function I({isOpen:e,onClose:t,projectCwd:s,projectName:l}){let{t:a}=(0,o.Bd)(),[i,c]=(0,r.useState)(!0),[d,u]=(0,r.useState)(!1),h=(0,r.useRef)(null),x=(0,r.useRef)(!1),[m,f]=(0,r.useState)(null),p=(0,r.useRef)(null),g=s?`/api/note?cwd=${encodeURIComponent(s)}`:"/api/note",v=(0,r.useCallback)(async e=>{u(!0);try{await fetch(g,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:e})}),x.current=!1}catch(e){console.error("Failed to save note:",e)}finally{u(!1)}},[g]),j=(0,r.useCallback)(e=>{x.current=!0,h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{v(e)},5e3)},[v]),b=(0,w.hG)({immediatelyRender:!1,extensions:[N.A.configure({heading:{levels:[1,2,3]}}),C.A.configure({placeholder:()=>k.A.t("editor.placeholder")}),y.XI.configure({resizable:!0}),S.H,M.n,L.A,T._,B.Ay.configure({autolink:!0,linkOnPaste:!0,openOnClick:!1,HTMLAttributes:{class:"tiptap-link",target:"_blank",rel:"noopener noreferrer"}}),z.L.configure({nested:!0}),E.o.configure({html:!0,transformCopiedText:!0,transformPastedText:!0})],editorProps:{attributes:{class:"tiptap-editor focus:outline-none min-h-[60vh] px-6 py-4"},handleClick:(e,t,s)=>{if(s.metaKey||s.ctrlKey){let s=e.state.doc.resolve(t).marks().find(e=>"link"===e.type.name)?.attrs;if(s?.href)return window.open(s.href,"_blank","noopener,noreferrer"),!0}return!1},handleKeyDown:(e,t)=>{if("Backspace"===t.key&&R.current){let e=R.current;if(e.isActive("codeBlock")){let{$from:t}=e.state.selection,s=t.node(t.depth);if("codeBlock"===s.type.name&&""===s.textContent)return e.chain().focus().toggleCodeBlock().run(),!0}}return"/"!==t.key||m||setTimeout(()=>{if(!R.current)return;let{from:e}=R.current.state.selection;if("/"===R.current.state.doc.textBetween(Math.max(0,e-1),e,"\n")){p.current=e;let t=R.current.view.coordsAtPos(e);f({query:"",position:{top:t.bottom+4,left:t.left}})}},0),!1}},onUpdate:({editor:e})=>{if(j(H(e)),null!==p.current){let{from:t}=e.state.selection;if(t<p.current)f(null),p.current=null;else{let s=e.state.doc.textBetween(p.current,t,"\n");s.includes(" ")||s.includes("\n")?(f(null),p.current=null):f(e=>e?{...e,query:s}:null)}}}}),R=(0,r.useRef)(b);(0,r.useEffect)(()=>{R.current=b},[b]),(0,r.useEffect)(()=>{e&&b&&(c(!0),f(null),p.current=null,fetch(g).then(e=>e.json()).then(e=>{b.commands.setContent(e.content||""),x.current=!1}).catch(e=>console.error("Failed to load note:",e)).finally(()=>c(!1)))},[e,b,g]);let $=(0,r.useCallback)(()=>{h.current&&(clearTimeout(h.current),h.current=null),x.current&&b&&v(H(b)),f(null),p.current=null,t()},[b,v,t]);return((0,r.useEffect)(()=>()=>{h.current&&clearTimeout(h.current)},[]),(0,r.useEffect)(()=>{if(!e)return;let t=e=>{"Escape"===e.key&&(m?(f(null),p.current=null):$())};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e,$,m]),e)?(0,n.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,n.jsx)("div",{className:"absolute inset-0 bg-black/50",onClick:$}),(0,n.jsxs)("div",{className:"relative bg-card rounded-lg shadow-xl w-full max-w-6xl h-[90vh] mx-4 flex flex-col overflow-hidden",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border flex-shrink-0",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("h2",{className:"text-sm font-medium text-foreground",children:l?a("editor.noteTitle",{name:l}):a("editor.noteUntitled")}),d&&(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:a("editor.saving")})]}),(0,n.jsx)("button",{onClick:$,className:"p-1 text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors",children:(0,n.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsx)(P,{editor:b}),(0,n.jsx)("div",{className:"flex-1 overflow-y-auto",children:i?(0,n.jsx)("div",{className:"flex items-center justify-center py-12 text-muted-foreground",children:(0,n.jsx)("span",{children:a("common.loading")})}):(0,n.jsx)(w.$Z,{editor:b})})]}),m&&b&&(0,n.jsx)(A,{editor:b,query:m.query,position:m.position,onClose:()=>{f(null),p.current=null}})]}):null}R();var D=s(47650);let W=[],V=[];function O(){V.forEach(e=>e())}function F(e){W=W.filter(t=>t.id!==e),O()}function U({onNavigate:e}){let t=function(){let[,e]=(0,r.useState)(0);return(0,r.useEffect)(()=>{let t=()=>e(e=>e+1);return V.push(t),()=>{V=V.filter(e=>e!==t)}},[]),W}();return 0===t.length?null:(0,D.createPortal)((0,n.jsx)("div",{className:"fixed bottom-4 left-4 z-[100] flex flex-col gap-2 pointer-events-none",children:t.map(t=>(0,n.jsx)(_,{item:t,onNavigate:e,onRemove:F},t.id))}),document.body)}function _({item:e,onNavigate:t,onRemove:s}){let{t:l}=(0,o.Bd)(),[a,i]=(0,r.useState)(!1),c=(0,r.useRef)(void 0),d=(0,r.useCallback)(()=>{i(!0),setTimeout(()=>s(e.id),300)},[e.id,s]);(0,r.useEffect)(()=>(c.current=setTimeout(d,5e3),()=>clearTimeout(c.current)),[d]);let u=(0,r.useCallback)(()=>{clearTimeout(c.current),t(e.cwd,e.sessionId),s(e.id)},[e,t,s]),h=(0,r.useCallback)(()=>{clearTimeout(c.current)},[]),x=(0,r.useCallback)(()=>{c.current=setTimeout(d,2e3)},[d]);return(0,n.jsxs)("div",{className:`pointer-events-auto bg-card border border-border rounded-lg shadow-lg px-3 py-2.5 min-w-[260px] max-w-[340px] cursor-pointer hover:bg-accent transition-all ${a?"opacity-0 -translate-x-4":"opacity-100 translate-x-0"}`,style:{animation:a?void 0:"slideInLeft 0.3s ease-out"},onClick:u,onMouseEnter:h,onMouseLeave:x,children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-green-9 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),(0,n.jsx)("span",{className:"text-sm font-medium text-foreground truncate",children:e.projectName}),(0,n.jsx)("span",{className:"text-xs text-green-11 flex-shrink-0",children:l("common.done")}),(0,n.jsx)("button",{onClick:e=>{e.stopPropagation(),d()},className:"ml-auto p-0.5 text-muted-foreground hover:text-foreground rounded transition-colors",children:(0,n.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e.message&&(0,n.jsx)("div",{className:"text-xs text-muted-foreground truncate mt-1 ml-6",children:e.message})]})}function q({initialCwd:e,initialSessionId:t}){let{t:s}=(0,o.Bd)(),[d,u]=(0,r.useState)([]),[h,x]=(0,r.useState)(0),[m,f]=(0,r.useState)(!1),[p,g]=(0,r.useState)(!1),[v,b]=(0,r.useState)(!1),[k,w]=(0,r.useState)(!1),[N,C]=(0,r.useState)(!1),[y,S]=(0,r.useState)(null),[M,L]=(0,r.useState)(!1),[T,z]=(0,r.useState)(new Set),B=(0,r.useRef)(new Map),E=(0,r.useRef)(new Map),H=(0,r.useRef)(new Map),R=(0,r.useRef)(null),A=(0,r.useCallback)(async()=>{try{let e=await fetch("/api/projects");if(e.ok){let t=await e.json();u(t.projects||[]),x(t.activeIndex||0),f(t.collapsed||!1)}}catch(e){console.error("Failed to load projects:",e)}finally{L(!0)}},[]),$=(0,r.useCallback)(async(e,t,s)=>{try{await fetch("/api/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projects:e,activeIndex:t,collapsed:s})})}catch(e){console.error("Failed to save projects:",e)}},[]);(0,r.useEffect)(()=>{let e=d[h]?.cwd;e&&z(t=>t.has(e)?t:new Set(t).add(e))},[h,d]),(0,r.useEffect)(()=>{for(let[e,t]of B.current.entries()){let s=d[h]?.cwd===e;t.contentWindow?.postMessage({type:"IFRAME_VISIBILITY",visible:s},"*")}},[h,d]),(0,r.useEffect)(()=>{A()},[A]);let P=(0,r.useCallback)((e,t)=>{let s=new URL(window.location.href);s.searchParams.set("cwd",e),t?s.searchParams.set("sessionId",t):s.searchParams.delete("sessionId"),window.history.replaceState({},"",s.toString());let n=e.split("/").filter(Boolean).pop();document.title=n?`Cockpit - ${n}`:"Cockpit"},[]),D=(0,r.useRef)(!1);(0,r.useEffect)(()=>{if(!M||D.current||!e)return;D.current=!0,t&&(E.current.set(e,{sessionId:t}),H.current.set(e,t));let s=d.findIndex(t=>t.cwd===e);if(s>=0)s!==h&&(x(s),$(d,s,m));else{let t=[...d,{cwd:e}],s=t.length-1;u(t),x(s),$(t,s,m)}P(e,t)},[M,e,t,d,h,m,$,P]),(0,r.useEffect)(()=>{let e=e=>{if(e.data?.type==="SESSION_CHANGE"&&e.data?.cwd&&e.data?.sessionId){let{cwd:t,sessionId:s}=e.data;H.current.set(t,s);let n=d[h];n?.cwd===t&&P(t,s)}if(e.data?.type==="SESSION_COMPLETE"&&e.data?.cwd&&e.data?.sessionId){let{cwd:s,sessionId:n,lastUserMessage:r}=e.data,o=d[h];if(o?.cwd!==s){var t;let e;t={projectName:s.split("/").pop()||s,message:r,cwd:s,sessionId:n},e=`session-toast-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,W=[...W,{...t,id:e}],O()}}if(e.data?.type==="OPEN_TOKEN_STATS"&&w(!0),e.data?.type==="OPEN_NOTE"&&e.data?.cwd&&(S(e.data.cwd),C(!0)),e.data?.type==="SCREENSHOT_PREPARE"&&e.data?.cwd){R.current=h;let t=e.data.cwd,s=d.findIndex(e=>e.cwd===t);s>=0&&s!==h&&x(s);return}if(e.data?.type==="SCREENSHOT_DONE"){null!==R.current&&R.current!==h&&x(R.current),R.current=null;return}if(e.data?.type==="OPEN_PROJECT"&&e.data?.cwd){let{cwd:t,sessionId:s}=e.data,n=s||"";H.current.set(t,n);let r=d.findIndex(e=>e.cwd===t);if(r>=0){if(n){let e=B.current.get(t);e?.contentWindow&&e.contentWindow.postMessage({type:"SWITCH_SESSION",sessionId:n},"*")}r!==h&&(x(r),$(d,r,m))}else{let e=[...d,{cwd:t}],s=e.length-1;u(e),x(s),$(e,s,m),n&&E.current.set(t,{sessionId:n})}P(t,n)}};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)},[d,h,m,P,$]);let V=(0,r.useCallback)(e=>{x(e),$(d,e,m);let t=d[e];if(t?.cwd){let e=H.current.get(t.cwd);P(t.cwd,e)}},[d,m,$,P]),F=(0,r.useCallback)(e=>{let t=d.filter((t,s)=>s!==e),s=h;e<h?s=h-1:e===h&&s>=t.length&&(s=Math.max(0,t.length-1)),u(t),x(s),$(t,s,m)},[d,h,m,$]),_=(0,r.useCallback)(e=>{let t=d[h],s=e.findIndex(e=>e.cwd===t?.cwd);u(e),x(s>=0?s:0),$(e,s>=0?s:0,m)},[d,h,m,$]),q=(0,r.useCallback)(()=>{let e=!m;f(e),$(d,h,e)},[d,h,m,$]),K=(0,r.useCallback)((e,t)=>{H.current.set(e,t);let s=d.findIndex(t=>t.cwd===e);if(s>=0){let n=B.current.get(e);n?.contentWindow&&n.contentWindow.postMessage({type:"SWITCH_SESSION",sessionId:t,switchToAgent:!0},"*"),x(s),$(d,s,m)}else{let s=[...d,{cwd:e}],n=s.length-1;u(s),x(n),$(s,n,m),E.current.set(e,{sessionId:t,switchToAgent:!0})}P(e,t),g(!1)},[d,m,$,P]),J=(0,r.useCallback)((e,t)=>{H.current.set(e,t);let s=d.findIndex(t=>t.cwd===e);if(s>=0){let n=B.current.get(e);n?.contentWindow&&n.contentWindow.postMessage({type:"SWITCH_SESSION",sessionId:t,switchToAgent:!0},"*"),s!==h&&(x(s),$(d,s,m))}else{let s=[...d,{cwd:e}],n=s.length-1;u(s),x(n),$(s,n,m),E.current.set(e,{sessionId:t,switchToAgent:!0})}P(e,t)},[d,h,m,$,P]),X=(0,r.useCallback)(e=>{let t=E.current.get(e);if(t){let s=B.current.get(e);s?.contentWindow&&s.contentWindow.postMessage({type:"SWITCH_SESSION",sessionId:t.sessionId,switchToAgent:t.switchToAgent},"*"),E.current.delete(e)}},[]);return M?(0,n.jsxs)("div",{className:"h-screen flex bg-background overflow-hidden",children:[(0,n.jsx)(l.ProjectSidebar,{projects:d,activeIndex:h,collapsed:m,currentCwd:d[h]?.cwd,onSelectProject:V,onRemoveProject:F,onReorderProjects:_,onToggleCollapse:q,onOpenSessionBrowser:()=>g(!0),onOpenSettings:()=>b(!0),onOpenNote:e=>{S(e??null),C(!0)},onSwitchProject:J,onAddProject:e=>{let t=d.findIndex(t=>t.cwd===e);if(t>=0)x(t),$(d,t,m);else{let t=[...d,{cwd:e}],s=t.length-1;u(t),x(s),$(t,s,m)}}}),(0,n.jsx)("div",{className:"flex-1 flex flex-col min-w-0 overflow-hidden",children:0===d.length?(0,n.jsx)(a.EmptyState,{onSelectSession:K}):(0,n.jsx)("div",{className:"flex-1 relative overflow-hidden",children:d.map((e,t)=>T.has(e.cwd)&&(0,n.jsx)("iframe",{ref:t=>{t?B.current.set(e.cwd,t):B.current.delete(e.cwd)},src:`/project?cwd=${encodeURIComponent(e.cwd)}`,onLoad:()=>X(e.cwd),className:`absolute inset-0 w-full h-full border-0 ${t===h?"block":"hidden"}`,title:`Project: ${e.cwd}`},e.cwd))})}),(0,n.jsx)(i.r,{isOpen:p,onClose:()=>g(!1),onSelectSession:K,onAddProject:e=>{let t=d.findIndex(t=>t.cwd===e);if(t>=0)x(t),$(d,t,m);else{let t=[...d,{cwd:e}],s=t.length-1;u(t),x(s),$(t,s,m)}g(!1)}}),(0,n.jsx)(c.b,{isOpen:v,onClose:()=>b(!1)}),(0,n.jsx)(j,{isOpen:k,onClose:()=>w(!1)}),(0,n.jsx)(I,{isOpen:N,onClose:()=>{C(!1),S(null)},projectCwd:y,projectName:y?y.split("/").pop():null}),(0,n.jsx)(U,{onNavigate:J})]}):(0,n.jsx)("div",{className:"h-screen flex items-center justify-center bg-card",children:(0,n.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,n.jsxs)("svg",{className:"animate-spin h-5 w-5",fill:"none",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,n.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,n.jsx)("span",{children:s("workspace.loadingText")})]})})}},30231:(e,t,s)=>{Promise.resolve().then(s.bind(s,1874)),Promise.resolve().then(s.bind(s,65438)),Promise.resolve().then(s.bind(s,80475)),Promise.resolve().then(s.bind(s,4189))},65438:(e,t,s)=>{"use strict";s.d(t,{ProjectItem:()=>a});var n=s(95155),r=s(12115),o=s(79114);function l({number:e,isActive:t}){return(0,n.jsxs)("svg",{className:`w-6 h-6 flex-shrink-0 ${t?"text-brand":"text-muted-foreground"}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:[(0,n.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4"}),(0,n.jsx)("text",{x:"12",y:"16",textAnchor:"middle",fill:"currentColor",stroke:"none",fontSize:"12",fontWeight:"500",children:e})]})}function a({index:e,name:t,cwd:s,isActive:a,collapsed:i,hasUnread:c,isLoading:d,onClick:u,onRemove:h,onOpenNote:x}){let{t:m}=(0,o.Bd)(),[f,p]=(0,r.useState)(!1);return(0,n.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1 rounded-lg cursor-pointer transition-colors relative ${i?"justify-center":""} ${a?"bg-accent text-foreground":"text-muted-foreground hover:bg-secondary hover:text-foreground"}`,onClick:u,onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),title:s,children:[(0,n.jsxs)("div",{className:"relative flex-shrink-0",children:[(0,n.jsx)(l,{number:e+1,isActive:a}),c&&!a&&!d&&(0,n.jsx)("span",{className:"absolute -top-0.5 -right-0.5 w-2 h-2 rounded-full bg-red-500"}),d&&(0,n.jsx)("span",{className:"absolute -top-0.5 -right-0.5 w-2 h-2 rounded-full bg-orange-9 animate-pulse"})]}),!i&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"flex-1 truncate text-sm",children:t}),!d&&a?(0,n.jsx)("span",{className:"w-2 h-2 rounded-full bg-brand flex-shrink-0"}):null]}),f&&!i&&(0,n.jsxs)("div",{className:"absolute right-1 top-1/2 -translate-y-1/2 flex items-center gap-0.5",children:[x&&(0,n.jsx)("button",{className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",onClick:e=>{e.stopPropagation(),x()},title:m("workspace.projectNotes"),children:(0,n.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),(0,n.jsx)("button",{className:"p-1 rounded hover:bg-red-500/20 text-muted-foreground hover:text-red-500 transition-colors",onClick:e=>{e.stopPropagation(),h()},title:m("workspace.closeProject"),children:(0,n.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]})}},80475:(e,t,s)=>{"use strict";s.d(t,{ProjectSidebar:()=>p});var n=s(95155),r=s(12115),o=s(79114),l=s(65438);function a({currentCwd:e,onSwitchProject:t,collapsed:s,sessions:l}){let{t:a}=(0,o.Bd)(),[i,c]=(0,r.useState)(!1),[d,u]=(0,r.useState)(0),h=(0,r.useRef)(null);(0,r.useEffect)(()=>{if(!i)return;let e=e=>{h.current&&!h.current.contains(e.target)&&c(!1)},t=()=>{c(!1)};return document.addEventListener("mousedown",e),window.addEventListener("blur",t),()=>{document.removeEventListener("mousedown",e),window.removeEventListener("blur",t)}},[i]);let x=(0,r.useCallback)(e=>{t(e.cwd,e.sessionId),c(!1)},[t]),m=l.filter(e=>"loading"===e.status).length,f=l.filter(e=>"unread"===e.status).length,p=(0,r.useCallback)(e=>{let t=Math.floor((d-e)/6e4);if(t<1)return a("common.justNow");if(t<60)return a("common.minutesAgo",{count:t});let s=Math.floor(t/60);return s<24?a("common.hoursAgo",{count:s}):a("common.daysAgo",{count:Math.floor(s/24)})},[a,d]);return(0,n.jsxs)("div",{className:"relative",ref:h,children:[(0,n.jsxs)("button",{onClick:()=>{u(Date.now()),c(!i)},className:`relative flex items-center gap-2 px-2 py-2 rounded-lg text-muted-foreground hover:text-foreground hover:bg-accent transition-colors ${s?"w-full justify-center":"w-full"}`,title:a("sessions.recentSessions"),children:[(0,n.jsx)("svg",{className:"w-5 h-5 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),!s&&(0,n.jsx)("span",{className:"text-sm flex-1 text-left",children:a("sessions.recentSessions")}),m>0&&(0,n.jsx)("span",{className:`min-w-[18px] h-[18px] px-1 text-white text-xs font-medium rounded-full flex items-center justify-center bg-orange-9 animate-pulse ${s?"absolute -top-1 -right-1":""}`,children:m}),f>0&&(0,n.jsx)("span",{className:`min-w-[18px] h-[18px] px-1 text-white text-xs font-medium rounded-full flex items-center justify-center bg-red-500 ${s&&!m?"absolute -top-1 -right-1":""}`,children:f})]}),i&&(0,n.jsxs)("div",{className:"absolute left-full bottom-0 ml-2 w-80 h-[450px] bg-popover border border-border rounded-lg shadow-lg z-50 flex flex-col",children:[(0,n.jsxs)("div",{className:"px-3 py-2 border-b border-border bg-muted/50 flex-shrink-0 rounded-t-lg",children:[(0,n.jsx)("span",{className:"text-sm font-medium",children:a("sessions.recentSessions")}),m>0&&(0,n.jsxs)("span",{className:"ml-2 text-xs text-orange-11",children:["(",a("sessions.runningCount",{count:m}),")"]}),f>0&&(0,n.jsxs)("span",{className:"ml-2 text-xs text-red-500",children:["(",a("sessions.unreadCount",{count:f}),")"]})]}),(0,n.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:0===l.length?(0,n.jsx)("div",{className:"px-3 py-4 text-sm text-muted-foreground text-center",children:a("sessions.noSessions")}):l.map((t,s)=>{let r;return(0,n.jsxs)("button",{onClick:()=>x(t),className:`w-full px-3 py-2 text-left hover:bg-accent transition-colors flex items-start gap-2 ${s!==l.length-1?"border-b border-border/50":""} ${e===t.cwd?"bg-accent/50":""}`,children:[(0,n.jsx)("span",{className:`mt-1.5 w-2 h-2 rounded-full flex-shrink-0 ${"loading"===t.status?"bg-orange-9 animate-pulse":"unread"===t.status?"bg-red-500":"bg-muted-foreground/30"}`}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",title:t.cwd,children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"font-medium text-sm truncate",children:(r=t.cwd).split("/").pop()||r}),"loading"===t.status&&(0,n.jsx)("span",{className:"text-xs text-orange-11 flex-shrink-0",children:a("sessions.running")}),"unread"===t.status&&(0,n.jsx)("span",{className:"text-xs text-red-500 flex-shrink-0",children:a("sessions.done")}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground flex-shrink-0",children:p(t.lastActive)})]}),(t.lastUserMessage||t.title)&&(0,n.jsx)("div",{className:"text-xs text-foreground/80 truncate",children:t.lastUserMessage||t.title})]})]},`${t.cwd}-${t.sessionId}`)})})]})]})}function i({collapsed:e,pinnedSessions:t,onSwitchProject:s,onUnpin:l,onUpdateTitle:a,onReorder:i}){let{t:c}=(0,o.Bd)(),[d,u]=(0,r.useState)(!1),h=(0,r.useRef)(null),[x,m]=(0,r.useState)(null),[f,p]=(0,r.useState)(""),g=(0,r.useRef)(null),[v,j]=(0,r.useState)(null),[b,k]=(0,r.useState)(null);(0,r.useEffect)(()=>{if(!d)return;let e=e=>{h.current&&!h.current.contains(e.target)&&(u(!1),m(null))},t=()=>{u(!1),m(null)};return document.addEventListener("mousedown",e),window.addEventListener("blur",t),()=>{document.removeEventListener("mousedown",e),window.removeEventListener("blur",t)}},[d]),(0,r.useEffect)(()=>{x&&(g.current?.focus(),g.current?.select())},[x]);let w=(0,r.useCallback)(e=>{x||(s(e.cwd,e.sessionId),u(!1))},[s,x]),N=(0,r.useCallback)((e,t)=>{t.stopPropagation(),m(e.sessionId),p(e.customTitle||"")},[]),C=(0,r.useCallback)(()=>{x&&f.trim()&&a(x,f.trim()),m(null)},[x,f,a]),y=(0,r.useCallback)(e=>{j(e)},[]),S=(0,r.useCallback)((e,t)=>{e.preventDefault(),k(t)},[]),M=(0,r.useCallback)(e=>{if(null===v||v===e){j(null),k(null);return}let s=[...t],[n]=s.splice(v,1);s.splice(e,0,n),i(s),j(null),k(null)},[v,t,i]),L=(0,r.useCallback)(()=>{j(null),k(null)},[]);return(0,n.jsxs)("div",{className:"relative",ref:h,children:[(0,n.jsxs)("button",{onClick:()=>u(!d),className:`relative flex items-center gap-2 px-2 py-2 rounded-lg text-muted-foreground hover:text-foreground hover:bg-accent transition-colors ${e?"w-full justify-center":"w-full"}`,title:c("sessions.pinnedSessions"),children:[(0,n.jsx)("svg",{className:"w-5 h-5 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"})}),!e&&(0,n.jsx)("span",{className:"text-sm flex-1 text-left",children:c("sessions.pinnedSessions")}),e&&t.length>0&&(0,n.jsx)("span",{className:"absolute -top-1 -right-1 min-w-[18px] h-[18px] px-1 text-muted-foreground text-xs font-medium rounded-full flex items-center justify-center bg-accent",children:t.length})]}),d&&(0,n.jsxs)("div",{className:"absolute left-full bottom-0 ml-2 w-80 max-h-[450px] bg-popover border border-border rounded-lg shadow-lg z-50 flex flex-col",children:[(0,n.jsx)("div",{className:"px-3 py-2 border-b border-border bg-muted/50 flex-shrink-0 rounded-t-lg",children:(0,n.jsx)("span",{className:"text-sm font-medium",children:c("sessions.pinnedSessions")})}),(0,n.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:0===t.length?(0,n.jsx)("div",{className:"px-3 py-4 text-sm text-muted-foreground text-center",children:c("sessions.noPinnedSessions")}):t.map((e,s)=>{let r;return(0,n.jsxs)("div",{draggable:!0,onDragStart:()=>y(s),onDragOver:e=>S(e,s),onDrop:()=>M(s),onDragEnd:L,onClick:()=>w(e),className:`group w-full px-3 py-2 text-left hover:bg-accent transition-colors flex items-start gap-2 cursor-pointer ${s!==t.length-1?"border-b border-border/50":""} ${v===s?"opacity-50":""} ${b===s?"border-t-2 border-brand":""}`,children:[(0,n.jsx)("span",{className:"mt-1.5 text-muted-foreground/30 flex-shrink-0 cursor-grab",children:(0,n.jsxs)("svg",{className:"w-3 h-3",viewBox:"0 0 10 16",fill:"currentColor",children:[(0,n.jsx)("circle",{cx:"3",cy:"2",r:"1.5"}),(0,n.jsx)("circle",{cx:"7",cy:"2",r:"1.5"}),(0,n.jsx)("circle",{cx:"3",cy:"8",r:"1.5"}),(0,n.jsx)("circle",{cx:"7",cy:"8",r:"1.5"}),(0,n.jsx)("circle",{cx:"3",cy:"14",r:"1.5"}),(0,n.jsx)("circle",{cx:"7",cy:"14",r:"1.5"})]})}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",title:e.cwd,children:[(0,n.jsx)("div",{className:"flex items-center gap-2",children:(0,n.jsx)("span",{className:"font-medium text-sm truncate",children:(r=e.cwd).split("/").pop()||r})}),x===e.sessionId?(0,n.jsx)("input",{ref:g,type:"text",value:f,onChange:e=>p(e.target.value),onKeyDown:e=>{e.nativeEvent.isComposing||("Enter"===e.key&&C(),"Escape"===e.key&&m(null))},onBlur:C,onClick:e=>e.stopPropagation(),className:"w-full text-xs px-1 py-0.5 border border-border rounded bg-card text-foreground focus:outline-none focus:ring-1 focus:ring-ring mt-0.5"}):(0,n.jsx)("div",{className:"text-xs text-foreground/80 truncate",children:e.customTitle||e.sessionId.slice(0,8)})]}),x!==e.sessionId&&(0,n.jsxs)("div",{className:"flex-shrink-0 flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity mt-0.5",children:[(0,n.jsx)("button",{onClick:t=>N(e,t),className:"p-0.5 rounded hover:bg-muted text-muted-foreground hover:text-foreground",title:c("sessions.editTitle"),children:(0,n.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"})})}),(0,n.jsx)("button",{onClick:t=>{t.stopPropagation(),l(e.sessionId)},className:"p-0.5 rounded hover:bg-muted text-muted-foreground hover:text-destructive",title:c("sessions.remove"),children:(0,n.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]},e.sessionId)})})]})]})}var c=s(28147);function d(e,t){if("once"===e.type)return t("scheduledTasks.onceType",{minutes:e.delayMinutes});if("interval"===e.type){let s=t("scheduledTasks.everyNMinutes",{minutes:e.intervalMinutes});return e.activeFrom&&e.activeTo?`${s} (${e.activeFrom}-${e.activeTo})`:s}return"cron"===e.type?e.cron||"cron":e.type}function u(e){return e.unread?"bg-red-500":e.completed?"bg-muted-foreground":e.paused?"bg-yellow-500":"error"===e.lastResult?"bg-red-500":"bg-green-500"}function h({collapsed:e,tasks:t,unreadCount:s,onSwitchProject:l,onPause:a,onResume:i,onTrigger:h,onDelete:x,onMarkRead:m,onUpdateTask:f,onReorder:p}){let{t:g}=(0,o.Bd)(),[v,j]=(0,r.useState)(!1),[b,k]=(0,r.useState)(null),w=(0,r.useRef)(null),N=t.filter(e=>!e.completed),C=N.filter(e=>!e.paused).length,y=t.filter(e=>e.completed),[S,M]=(0,r.useState)(null),[L,T]=(0,r.useState)(null),z=(0,r.useCallback)(e=>{M(e)},[]),B=(0,r.useCallback)((e,t)=>{e.preventDefault(),T(t)},[]),E=(0,r.useCallback)(e=>{if(null===S||S===e){M(null),T(null);return}let t=[...N],[s]=t.splice(S,1);t.splice(e,0,s),p([...t,...y].map(e=>e.id)),M(null),T(null)},[S,N,y,p]),H=(0,r.useCallback)(()=>{M(null),T(null)},[]),[,R]=(0,r.useState)(0);return(0,r.useEffect)(()=>{if(!v)return;let e=setInterval(()=>R(e=>e+1),1e4);return()=>clearInterval(e)},[v]),(0,r.useEffect)(()=>{if(!v)return;let e=e=>{w.current&&!w.current.contains(e.target)&&j(!1)},t=()=>j(!1);return document.addEventListener("mousedown",e),window.addEventListener("blur",t),()=>{document.removeEventListener("mousedown",e),window.removeEventListener("blur",t)}},[v]),(0,n.jsxs)("div",{className:"relative",ref:w,children:[(0,n.jsxs)("button",{onClick:()=>j(!v),className:`relative flex items-center gap-2 px-2 py-2 rounded-lg text-muted-foreground hover:text-foreground hover:bg-accent transition-colors ${e?"w-full justify-center":"w-full"}`,title:g("scheduledTasks.title"),children:[(0,n.jsxs)("svg",{className:"w-5 h-5 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"10",strokeWidth:2}),(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6l4 2"})]}),!e&&(0,n.jsx)("span",{className:"text-sm flex-1 text-left",children:g("scheduledTasks.title")}),s>0?(0,n.jsx)("span",{className:`min-w-[18px] h-[18px] px-1 text-white text-xs font-medium rounded-full flex items-center justify-center bg-red-500 ${e?"absolute -top-1 -right-1":""}`,children:s}):e&&t.length>0?(0,n.jsx)("span",{className:"absolute -top-1 -right-1 min-w-[18px] h-[18px] px-1 text-muted-foreground text-xs font-medium rounded-full flex items-center justify-center bg-accent",children:t.length}):null]}),v&&(0,n.jsxs)("div",{className:"absolute left-full bottom-0 ml-2 w-96 max-h-[500px] bg-popover border border-border rounded-lg shadow-lg z-50 flex flex-col",children:[(0,n.jsxs)("div",{className:"px-3 py-2 border-b border-border bg-muted/50 flex-shrink-0 rounded-t-lg flex items-center justify-between",children:[(0,n.jsx)("span",{className:"text-sm font-medium",children:g("scheduledTasks.title")}),N.length>0&&(0,n.jsxs)("span",{className:"text-xs text-muted-foreground",children:[g("scheduledTasks.activeCount",{running:C}),N.length-C>0?` \xb7 ${g("scheduledTasks.pausedCount",{paused:N.length-C})}`:""]})]}),(0,n.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:0===t.length?(0,n.jsx)("div",{className:"px-3 py-4 text-sm text-muted-foreground text-center",children:g("scheduledTasks.noScheduledTasks")}):(0,n.jsxs)(n.Fragment,{children:[N.map((e,t)=>{var s;return(0,n.jsx)("div",{draggable:!0,onDragStart:()=>z(t),onDragOver:e=>B(e,t),onDrop:()=>E(t),onDragEnd:H,className:`group px-3 py-2 hover:bg-accent transition-colors border-b border-border/50 cursor-pointer ${e.unread?"bg-brand/5":""} ${S===t?"opacity-50":""} ${L===t?"border-t-2 border-brand":""}`,onClick:()=>{l(e.cwd,e.sessionId),e.unread&&m(e.id),j(!1)},children:(0,n.jsxs)("div",{className:"flex items-start gap-2",children:[(0,n.jsx)("span",{className:`mt-1.5 w-2 h-2 rounded-full flex-shrink-0 ${u(e)}`}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"text-xs text-muted-foreground font-mono",children:(s=e.cwd).split("/").pop()||s}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:"\xb7"}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:e.completed?g("scheduledTasks.completed"):e.paused?g("scheduledTasks.paused"):g("common.running")})]}),(0,n.jsx)("div",{className:"text-sm text-foreground truncate mt-0.5",title:e.message,children:e.message}),(0,n.jsxs)("div",{className:"flex items-center gap-3 mt-1 text-xs text-muted-foreground",children:[(0,n.jsx)("span",{children:d(e,g)}),(0,n.jsx)("span",{children:"\xb7"}),(0,n.jsx)("span",{children:e.paused?g("scheduledTasks.paused"):function(e,t){if(!e)return"-";let s=e-Date.now();if(s<=0)return t("scheduledTasks.aboutToTrigger");if(s<6e4)return t("scheduledTasks.secondsLater",{count:Math.ceil(s/1e3)});if(s<36e5)return t("scheduledTasks.minutesLater",{count:Math.ceil(s/6e4)});if(s<864e5){let e=Math.floor(s/36e5),n=Math.ceil(s%36e5/6e4);return n>0?t("scheduledTasks.hoursMinutesLater",{h:e,m:n}):t("scheduledTasks.hoursLater",{h:e})}return new Date(e).toLocaleDateString("zh-CN",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}(e.nextFireTime,g)}),e.lastFiredAt&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{children:"\xb7"}),(0,n.jsxs)("span",{children:[g("scheduledTasks.lastResult"),": ","success"===e.lastResult?"✓":"✗"]})]})]})]}),(0,n.jsxs)("div",{className:"flex-shrink-0 flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,n.jsx)("button",{onClick:t=>{t.stopPropagation(),h(e.id)},className:"p-0.5 rounded hover:bg-muted text-muted-foreground hover:text-brand",title:g("scheduledTasks.runNow"),children:(0,n.jsx)("svg",{className:"w-3.5 h-3.5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M8 5v14l11-7z"})})}),(0,n.jsx)("button",{onClick:t=>{t.stopPropagation(),k(e)},className:"p-0.5 rounded hover:bg-muted text-muted-foreground hover:text-foreground",title:g("common.edit"),children:(0,n.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),e.paused?(0,n.jsx)("button",{onClick:t=>{t.stopPropagation(),i(e.id)},className:"p-0.5 rounded hover:bg-muted text-muted-foreground hover:text-green-500",title:g("scheduledTasks.resume"),children:(0,n.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"})})}):(0,n.jsx)("button",{onClick:t=>{t.stopPropagation(),a(e.id)},className:"p-0.5 rounded hover:bg-muted text-muted-foreground hover:text-yellow-500",title:g("scheduledTasks.pause"),children:(0,n.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 9v6m4-6v6"})})}),(0,n.jsx)("button",{onClick:t=>{t.stopPropagation(),x(e.id)},className:"p-0.5 rounded hover:bg-muted text-muted-foreground hover:text-destructive",title:g("common.delete"),children:(0,n.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]})},e.id)}),y.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"px-3 py-1.5 text-xs text-muted-foreground bg-muted/30 border-b border-border/50",children:g("scheduledTasks.completedCount",{count:y.length})}),y.map(e=>(0,n.jsx)("div",{className:"group px-3 py-2 hover:bg-accent transition-colors border-b border-border/50 opacity-60 cursor-pointer",onClick:()=>{l(e.cwd,e.sessionId),j(!1)},children:(0,n.jsxs)("div",{className:"flex items-start gap-2",children:[(0,n.jsx)("span",{className:`mt-1.5 w-2 h-2 rounded-full flex-shrink-0 ${u(e)}`}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsx)("div",{className:"text-sm text-foreground truncate",children:e.message}),(0,n.jsxs)("div",{className:"text-xs text-muted-foreground mt-0.5",children:[d(e,g)," \xb7 ","success"===e.lastResult?g("scheduledTasks.success"):g("scheduledTasks.failure")]})]}),(0,n.jsx)("div",{className:"flex-shrink-0 flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:(0,n.jsx)("button",{onClick:t=>{t.stopPropagation(),x(e.id)},className:"p-0.5 rounded hover:bg-muted text-muted-foreground hover:text-destructive",title:g("common.delete"),children:(0,n.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})})]})},e.id))]})]})})]}),b&&(0,n.jsxs)("div",{className:"fixed inset-0 z-[100] flex items-center justify-center",children:[(0,n.jsx)("div",{className:"absolute inset-0 bg-black/30",onClick:()=>k(null)}),(0,n.jsx)("div",{className:"relative",children:(0,n.jsx)(c.E,{onClose:()=>k(null),onCreate:()=>{},editTask:{id:b.id,message:b.message,type:b.type,delayMinutes:b.delayMinutes,intervalMinutes:b.intervalMinutes,activeFrom:b.activeFrom,activeTo:b.activeTo,cron:b.cron},onUpdate:(e,t)=>{f(e,t),k(null)}})})]})]})}var x=s(36998),m=s(18658),f=s(22552);function p({projects:e,activeIndex:t,collapsed:s,currentCwd:c,onSelectProject:d,onRemoveProject:u,onReorderProjects:p,onToggleCollapse:g,onOpenSessionBrowser:v,onOpenSettings:j,onOpenNote:b,onSwitchProject:k,onAddProject:w}){let{t:N}=(0,o.Bd)(),{pinnedSessions:C,unpinSession:y,updateTitle:S,reorder:M}=(0,x.P)(),{tasks:L,unreadCount:T,reload:z,pauseTask:B,resumeTask:E,triggerTask:H,deleteTask:R,updateTask:A,markRead:$,reorderTasks:P}=(0,m.n)(),[I,D]=(0,r.useState)(!1),[W,V]=(0,r.useState)(null),[O,F]=(0,r.useState)(null),[U,_]=(0,r.useState)([]),q=(0,r.useRef)(U);(0,r.useEffect)(()=>{q.current=U});let K=(0,r.useRef)(z);(0,r.useEffect)(()=>{K.current=z});let J=(0,r.useCallback)(e=>{try{if("task-fired"===e.type)return void K.current();let{data:t}=e;if(!t)return;_(t.sessions||[])}catch{}},[]);(0,f.h)({url:"/ws/global-state",onMessage:J});let X=new Set(U.filter(e=>"loading"===e.status).map(e=>e.cwd)),G=new Set(U.filter(e=>"unread"===e.status).map(e=>e.cwd)),Y=(0,r.useCallback)(e=>{V(e)},[]),Z=(0,r.useCallback)((e,t)=>{e.preventDefault(),null!==W&&W!==t&&F(t)},[W]),Q=(0,r.useCallback)(t=>{if(null!==W&&W!==t){let s=[...e],[n]=s.splice(W,1);s.splice(t,0,n),p(s)}V(null),F(null)},[W,e,p]),ee=(0,r.useCallback)(()=>{V(null),F(null)},[]);return(0,n.jsxs)("div",{className:`h-full bg-card border-r border-border flex flex-col transition-all duration-200 ${s?"w-12":"w-56"}`,children:[(0,n.jsxs)("div",{className:"p-2 border-b border-border relative",onMouseEnter:()=>D(!0),onMouseLeave:()=>D(!1),children:[(0,n.jsxs)("button",{className:`w-full flex items-center gap-2 px-2 py-2 rounded-lg text-muted-foreground hover:text-foreground hover:bg-accent transition-colors ${s?"justify-center":""}`,onClick:v,title:N("workspace.openProject"),children:[(0,n.jsxs)("svg",{className:"w-5 h-5 flex-shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}),(0,n.jsx)("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1"}),(0,n.jsx)("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}),(0,n.jsx)("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1"})]}),!s&&(0,n.jsx)("span",{className:"text-sm",children:N("workspace.openProject")})]}),I&&(s?(0,n.jsx)("button",{className:"absolute inset-0 m-2 flex items-center justify-center px-2 py-2 rounded-lg bg-accent text-foreground transition-colors z-10",onClick:g,title:N("workspace.expandSidebar"),children:(0,n.jsx)("svg",{className:"w-5 h-5 flex-shrink-0 rotate-180",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}):(0,n.jsx)("button",{className:"absolute top-1/2 -translate-y-1/2 right-2 p-2 rounded-lg bg-accent text-foreground transition-colors z-10",onClick:g,title:N("workspace.collapseSidebar"),children:(0,n.jsx)("svg",{className:"w-5 h-5 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}))]}),(0,n.jsx)("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:e.map((e,r)=>{var o;let a;return(0,n.jsx)("div",{draggable:!0,onDragStart:()=>Y(r),onDragOver:e=>Z(e,r),onDrop:()=>Q(r),onDragEnd:ee,className:`${O===r?"border-t-2 border-brand":""} ${W===r?"opacity-50":""}`,children:(0,n.jsx)(l.ProjectItem,{index:r,name:(a=(o=e.cwd).split("/").filter(Boolean))[a.length-1]||o,cwd:e.cwd,isActive:r===t,collapsed:s,hasUnread:G.has(e.cwd),isLoading:X.has(e.cwd),onClick:()=>d(r),onRemove:()=>u(r),onOpenNote:()=>b(e.cwd)})},e.cwd)})}),(0,n.jsxs)("div",{className:"p-2 border-t border-border space-y-1",children:[(0,n.jsx)(a,{currentCwd:c,onSwitchProject:k,collapsed:s,sessions:U}),(0,n.jsx)(i,{collapsed:s,pinnedSessions:C,onSwitchProject:k,onUnpin:y,onUpdateTitle:S,onReorder:M}),(0,n.jsx)(h,{collapsed:s,tasks:L,unreadCount:T,onSwitchProject:k,onPause:B,onResume:E,onTrigger:H,onDelete:R,onMarkRead:$,onUpdateTask:A,onReorder:P}),(0,n.jsxs)("button",{className:`w-full flex items-center gap-2 px-2 py-2 rounded-lg text-muted-foreground hover:text-foreground hover:bg-accent transition-colors ${s?"justify-center":""}`,onClick:()=>b(),title:N("workspace.notes"),children:[(0,n.jsx)("svg",{className:"w-5 h-5 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})}),!s&&(0,n.jsx)("span",{className:"text-sm",children:N("workspace.notes")})]}),(0,n.jsxs)("button",{className:`w-full flex items-center gap-2 px-2 py-2 rounded-lg text-muted-foreground hover:text-foreground hover:bg-accent transition-colors ${s?"justify-center":""}`,onClick:j,title:N("workspace.settings"),children:[(0,n.jsxs)("svg",{className:"w-5 h-5 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),!s&&(0,n.jsx)("span",{className:"text-sm",children:N("workspace.settings")})]})]})]})}}},e=>{e.O(0,[5004,277,9114,3695,3530,5493,8441,3794,7358],()=>e(e.s=30231)),_N_E=e.O()}]);
|